PageSourceSearch

https://shopchief.ai/assets/WorkspacePanel-Do7nQsxa.js

js shopchief.ai collected 2026-10-05 13:37:53 UTC 39,018 bytes, 8 lines download raw bytes

1import{r as m,j as e,u as te,f as qe,d as Ne,e as Ge}from"./vendor-react-CTRzRpah.js";import{e as Ve,f as Je,g as le,w as Ae,h as Xe,j as Ye,k as Ze}from"./WorkspaceMediaCreation-DD9o6gVy.js";import{W as Se}from"./modelIcon-DawO5kwT.js";import{u as T}from"./vendor-i18n-DoDT9obM.js";import{d as es,$ as L,aB as ss,z as $,h as ts,X as as,af as pe,e as rs,a4 as os,aC as is,aD as ns,P as E,aE as cs}from"./index-BHw7wEI7.js";import{j as ls,W as ds}from"./index-F7KAf4HD.js";import{p as K,b as ps,e as Ie,c as ae,s as ue,d as us,P as ms,C as me}from"./WorkspaceMaterialPicker-BVqE-vG1.js";import{b as Ce,f as De,n as fe,a as he,P as fs}from"./WorkspaceChatShell-2uBvTBMC.js";import{S as hs}from"./store-0hSayIFj.js";import{A as ks}from"./arrow-left-OkkvZCWU.js";import{C as ke}from"./ConfirmDialog-XnCqv263.js";import{I as xs,u as gs}from"./useUploadOperations-DNjIlzYV.js";import{e as ws,L as Le,P as js,X as Te}from"./queryKeys-DWv8mXuC.js";import"./DeferredCodeMirrorViewer-C0tDxalG.js";import{r as Fe,c as _s,d as Ee,i as xe,e as ys}from"./assetMedia-CDzqe9b3.js";import{A as vs}from"./WorkspaceBreadcrumbs-VEg1dUaQ.js";import{e as Ps,b as ge,P as bs}from"./workspace-material-picker-BsxC4pY7.js";import{P as ne}from"./plus-Bu14pFhr.js";import{u as Ns,W as As}from"./useWorkspaceDraftApplication-DAAwfwmQ.js";import"./runtime-preload-BlTxHScW.js";import"./arrow-right-BtW8KA6L.js";import"./useMutation-DEcB3Wiz.js";import"./download-B6H8hb8Z.js";import"./ToolResultPanel-LFHiXqXq.js";import"./percentages-BXMCSKIN-CZ_5FCDY.js";import"./vendor-mermaid-chunk-sht3w25y-CLirMy0B.js";import"./vendor-mermaid-chunk-5vm5rss4-B-vc9Rf-.js";import"./vendor-mermaid-chunk-y2cyzvjy-DM6BcmAw.js";import"./vendor-mermaid-chunk-xxdrqbxy-BsMwvJqo.js";import"./vendor-mermaid-chunk-clgd4zfx-wfmph31d.js";import"./vendor-mermaid-chunk-du6hzsff-DouAnZUC.js";import"./vendor-mermaid-chunk-x3czislh-B5IYOjXv.js";import"./vendor-mermaid-chunk-popq4y6h-CHEGFkhC.js";import"./vendor-mermaid-chunk-lnge3pju-Ds5PI3dp.js";import"./vendor-mermaid-chunk-tluhslcs-kl6rSNbS.js";import"./vendor-mermaid-chunk-l3nej4n5-Dk5L8TpI.js";import"./vendor-mermaid-chunk-gvqu2gxp-PLeYGogA.js";import"./vendor-mermaid-chunk-4hammtfa-C_p9w-2T.js";import"./vendor-mermaid-chunk-p2qgcys3-Dc-kQ9V3.js";import"./vendor-mermaid-chunk-gmad6qvw-CZG6rys4.js";import"./vendor-mermaid-chunk-pwaf6vod-BmhSuP_6.js";import"./vendor-mermaid-chunk-75z2aovw-CgwVWkO-.js";import"./vendor-mermaid-chunk-osk3nfvy-BKGpS57v.js";import"./vendor-mermaid-chunk-f27pbjko-BDZfsUm8.js";import"./vendor-excalidraw-chunk-eio257pc-DWy3eETq.js";import"./vendor-excalidraw-chunk-srax5oiu-mOC3shw1.js";import"./vendor-excalidraw-chunk-k2utitrg-DWoloFLN.js";import"./vendor-excalidraw-chunk-zuyeq4tg-BkEluSkJ.js";import"./vendor-compression-D-zx1J4M.js";import"./vendor-excalidraw-chunk-6u3ayisy-Dle0LcWJ.js";import"./vendor-excalidraw-chunk-z3n5dim6-Di0vQw-R.js";/* empty css                 */import"./panel-right-B3E22Wy2.js";import"./zoom-out-p47jH9_s.js";import"./circle-x-BkZKFB9z.js";import"./triangle-alert-Dndl96CD.js";import"./circle-check-big-D7iLPcOa.js";import"./eye-BlDANx-W.js";import"./clsx-B-dksMZM.js";import"./CopyButton-oJjFi8G5.js";import"./check-DT4Zpvo4.js";import"./maximize-2-BCC1XIgT.js";import"./vendor-markdown-DHwf5oUb.js";import"./vendor-katex-BXSmdmBE.js";import"./chevron-right-CAgv5ot7.js";import"./loader-circle-5Zxfjjjw.js";import"./circle-alert-D714LSKA.js";import"./backendErrors-B-UMtFQd.js";import"./abortable-yjmNzpSh.js";import"./external-link-BNQn9QLx.js";import"./file-text-A7ul9Slh.js";import"./chevron-down-7J53ZPo5.js";import"./search-IP0Io7zz.js";import"./users-BibxxKri.js";import"./exportProjectZip-D2UxYPyS.js";import"./BrandLockup-Cz-NvMsw.js";import"./shares-B0H5nnx7.js";import"./useInfiniteQuery-B5fugA6d.js";import"./lock-BDh_ZBma.js";import"./clock-3-BnOQmqJN.js";import"./auth-BemDsk6-.js";import"./shopping-bag-BRhu6Z1l.js";import"./plug-DDlFBIKz.js";import"./info-BOTcoCq0.js";import"./billing-operations-iLnxND4B.js";import"./minus-BFwr_f0O.js";import"./user-CcIQJ4rk.js";import"./tenants-B3saI7Hv.js";import"./circle-help-DIOsYbdS.js";import"./canonicalMessages-DkvoJ2P0.js";import"./chevron-left-CUGyrsiz.js";import"./useFileUpload-DHOi-yyc.js";import"./WorkspaceHeroComposer-Cwo8xuwD.js";import"./type-CbGScd6B.js";import"./settings-2-DxQwLxA2.js";import"./mail-D7Prprdd.js";import"./sparkles-Bi_01Tk5.js";import"./marketplace-CduNbOcQ.js";import"./landingPrompt-CxtDivWO.js";/* empty css                  */import"./paginationPages-HVlc7Lz6.js";import"./shield-check-bzDuh2d4.js";import"./book-open-CLlkExMl.js";import"./upload-DBZ669XE.js";/**
2 * @license lucide-react v0.468.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const Ss=es("ImagePlus",[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]);function re(s,t){const r=["B","MB","GB","TB"],a=s>=1e12?3:s>=1e9?2:s>=1e6?1:0,o=[1,1e6,1e9,1e12][a];return`${new Intl.NumberFormat(t,{maximumFractionDigits:2}).format(s/o)} ${r[a]}`}function Is({refreshToken:s}){const{t,i18n:r}=T(),a=Ve(),{refetch:o}=a;m.useEffect(()=>{s&&o()},[s,o]);const n=a.data,l=n?.status==="ready"&&typeof n.used_bytes=="number",c=(n?.used_bytes??0)+(n?.reserved_bytes??0),i=n?.limit_bytes?c/n.limit_bytes:1,f=n?.over_limit||l&&i>=.9;
6return e.jsxs("section",{className:"asset-storage-usage","aria-label":t("workspace.storage.label"),children:[e.jsxs("div",{className:"asset-storage-usage__summary",role:"status",children:[e.jsx("span",{children:t("workspace.storage.label")}),a.isError?e.jsxs("span",{className:"asset-storage-usage__message",children:[t("workspace.storage.error"),e.jsx("button",{type:"button",className:"btn-secondary",onClick:()=>{a.refetch()},disabled:a.isFetching,children:t("common.retry")})]}):a.isPending?t("workspace.storage.loading"):l?e.jsxs("span",{children:[re(n.used_bytes??0,r.language)," / ",re(n.limit_bytes,r.language)]}):e.jsx("span",{children:t(n?.status==="incomplete"?"workspace.storage.incomplete":"workspace.storage.initializing")})]}),l&&!a.isError&&e.jsxs(e.Fragment,{children:[e.jsx("progress",{className:f?"asset-storage-usage__progress is-warning":"asset-storage-usage__progress",value:Math.min(c,n.limit_bytes),max:Math.max(n.limit_bytes,1),"aria-label":t("workspace.storage.label")}),e.jsxs("div",{className:"asset-storage-usage__detail",children:[n.reserved_bytes>0&&e.jsx("span",{children:t("workspace.storage.saving",{size:re(n.reserved_bytes,r.language)})}),f&&e.jsx("span",{role:"status",children:t(n.over_limit?"workspace.storage.overLimit":"workspace.storage.nearLimit")})]})]})]})}function Cs(s={}){const t=Je(s),r=le(),a=m.useCallback(async()=>(await t.refetch()).data??null,[t]),o=m.useCallback(c=>r.createProduct.mutateAsync(c),[r.createProduct]),n=m.useCallback((c,i)=>r.updateProduct.mutateAsync({id:c,data:i}),[r.updateProduct]),l=m.useCallback((c,i)=>r.updateAsset.mutateAsync({id:c,data:i}),[r.updateAsset]);return{snapshot:t.data??null,isLoading:t.isLoading,error:t.error?Ae(t.error,"Failed to load workspace"):null,refresh:a,createProduct:o,updateProduct:n,updateAsset:l,deleteProduct:r.deleteProduct.mutateAsync,deleteAsset:r.deleteAsset.mutateAsync}}const we={total:0,skip:0,limit:20};function Ds(s={}){const t=Xe({...s,productSkip:s.productSkip??s.skip,productLimit:s.productLimit??s.limit}),r=le(),a=m.useCallback(f=>r.createProduct.mutateAsync(f),[r.createProduct]),o=m.useCallback(f=>r.createAsset.mutateAsync(f),[r.createAsset]),n=m.useCallback((f,p)=>r.updateAsset.mutateAsync({id:f,data:p}),[r.updateAsset]),l=t.productsQuery.data,c=t.assetsQuery.data,i=[t.productsQuery.error,t.assetsQuery.error].find(Boolean);return{products:l?.products??[],assets:c?.assets??[],productPage:l?je(l):we,assetPage:c?je(c):we,isLoading:t.productsQuery.isLoading||t.assetsQuery.isLoading,error:i?Ae(i,"Failed to load workspace lists"):null,createProduct:a,deleteProduct:r.deleteProduct.mutateAsync,createAsset:o,updateAsset:n,deleteAsset:r.deleteAsset.mutateAsync}}function je(s){return{total:s.total,skip:s.skip,limit:s.limit}}function Ls({showAssistant:s=!0}){return e.jsx("div",{className:K,children:e.jsx("div",{className:"workspace-content-area workspace-detail-shell workspace-detail-skeleton","aria-hidden":"true",children:e.jsxs("main",{className:"workspace-detail-main",children:[e.jsx(Ts,{}),e.jsxs("div",{className:`workspace-detail-main__content ${s?"":"workspace-detail-main__content--full"}`,children:[e.jsx("div",{className:"workspace-detail-main__body",children:e.jsx(Fs,{})}),s&&e.jsx($s,{})]})]})})})}function Ts(){return e.jsxs("div",{className:"workspace-detail-main__header",children:[e.jsxs("div",{className:"workspace-detail-skeleton__breadcrumb",children:[e.jsx(L,{width:"w-20",className:"!h-2.5 !rounded-md"}),e.jsx(L,{width:"w-36",className:"!h-3.5 !rounded-md"}),e.jsx(L,{width:"w-24",className:"!h-2.5 !rounded-md"})]}),e.jsx("div",{className:"workspace-detail-skeleton__header-action skeleton-line"})]})}function Fs(){return e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"workspace-panel-section workspace-detail-info-section",children:[e.jsx(oe,{hasAction:!0}),e.jsxs("div",{className:"workspace-panel-section__body",children:[e.jsxs("div",{className:"workspace-product-identity-panel",children:[e.jsx("div",{className:"workspace-product-identity-panel__preview skeleton-line"}),e.jsx("div",{className:"workspace-product-identity-panel__content",children:e.jsx("div",{className:"workspace-product-identity-panel__identity",children:e.jsxs("div",{className:"workspace-detail-skeleton__identity-lines",children:[e.jsx(L,{width:"w-32",className:"!h-3.5 !rounded-md"}),e.jsx(L,{width:"w-44",className:"!h-2.5 !rounded-md"})]})})})]}),e.jsx(Es,{rows:5})]})]}),e.jsxs("section",{className:"workspace-panel-section workspace-detail-info-section",children:[e.jsx(oe,{}),e.jsx(_e,{})]}),e.jsxs("section",{className:"workspace-panel-section workspace-detail-info-section",children:[e.jsx(oe,{hasAction:!0}
6),e.jsx(_e,{})]})]})}function oe({hasAction:s=!1}){return e.jsx("div",{className:"workspace-panel-section__header",children:e.jsxs("div",{children:[e.jsxs("div",{children:[e.jsx(L,{width:"w-28",className:"!h-3.5 !rounded-md"}),e.jsx(L,{width:"w-20",className:"!h-2.5 !rounded-md"})]}),s&&e.jsx("div",{className:"workspace-detail-skeleton__small-action skeleton-line"})]})})}function Es({rows:s}){return e.jsx("div",{className:"workspace-detail-fact-grid",children:Array.from({length:s}).map((t,r)=>e.jsxs("div",{className:"workspace-detail-fact",children:[e.jsx(L,{width:r%2===0?"w-20":"w-24",className:"!h-2.5 !rounded-md"}),e.jsxs("div",{className:"workspace-detail-skeleton__fact-value",children:[e.jsx(L,{width:r%3===0?"w-full":"w-4/5",className:"!h-3 !rounded-md"}),r%3===0&&e.jsx(L,{width:"w-2/3",className:"!h-3 !rounded-md"})]})]},r))})}function _e(){return e.jsx("div",{className:"workspace-detail-skeleton__image-grid",children:Array.from({length:4}).map((s,t)=>e.jsx("div",{className:"workspace-detail-skeleton__image-card skeleton-line"},t))})}function $s(){return e.jsxs("aside",{className:"workspace-assistant-rail workspace-detail-skeleton__assistant",children:[e.jsx("div",{className:"workspace-assistant-rail__toolbar",children:e.jsxs("div",{className:"workspace-assistant-rail__actions",children:[e.jsx("div",{className:"workspace-assistant-rail__icon skeleton-line"}),e.jsx("div",{className:"workspace-assistant-rail__icon skeleton-line"})]})}),e.jsxs("div",{className:"workspace-assistant-rail__chat",children:[e.jsxs("div",{className:"workspace-detail-skeleton__assistant-empty",children:[e.jsx("div",{className:"workspace-detail-skeleton__assistant-avatar skeleton-line"}),e.jsx(L,{width:"w-36",className:"!h-3.5 !rounded-md"}),e.jsx(L,{width:"w-48",className:"!h-2.5 !rounded-md"})]}),e.jsxs("div",{className:"workspace-detail-skeleton__assistant-composer",children:[e.jsx(L,{width:"w-2/3",className:"!h-3 !rounded-md"}),e.jsxs("div",{className:"workspace-detail-skeleton__assistant-tools",children:[e.jsx("span",{className:"skeleton-line"}),e.jsx("span",{className:"skeleton-line"}),e.jsx("span",{className:"skeleton-line"})]})]})]})]})}function Us({entityLabel:s,backTo:t,error:r}){const{t:a}=T(),o=te();return e.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 px-6 py-16 text-center",children:[e.jsx("div",{className:"flex size-12 items-center justify-center rounded-full bg-stone-100 text-stone-400",children:e.jsx(hs,{size:22})}),e.jsx("h2",{className:"text-base font-semibold text-stone-800",children:a("workspace.detail.notFoundTitle","Not available in this store")}),e.jsx("p",{className:"max-w-md text-sm text-stone-500",children:a("workspace.detail.notFoundBody","This {{entity}} doesn't exist in the current store, or belongs to another store.",{entity:s})}),r&&e.jsx("p",{className:"max-w-md text-xs text-stone-400",children:r}),e.jsxs("button",{type:"button",onClick:()=>o(t),className:"mt-1 inline-flex items-center gap-1.5 rounded-lg border border-stone-200 bg-white px-3 py-1.5 text-sm text-stone-700 transition-colors hover:border-stone-300 hover:bg-stone-50",children:[e.jsx(ks,{size:14}),a("workspace.detail.notFoundBack","Back")]})]})}function Ws({value:s,emptyText:t}){const r=s?.trim();return r?e.jsx("span",{className:"workspace-formatted-text",children:Os(r).map((a,o)=>Ms(a,o))}):e.jsx(e.Fragment,{children:t})}function Ms(s,t){if(s.kind==="ul"||s.kind==="ol"){const r=s.kind==="ul"?"ul":"ol";return e.jsx(r,{className:"workspace-formatted-text__list",children:s.items.map((a,o)=>e.jsx("li",{value:s.kind==="ol"?a.value:void 0,children:Y(a.text)},`${o}-${a.marker}-${a.text}`))},`${s.kind}-${t}`)}if(s.kind==="table"){const[r,...a]=s.rows;return e.jsx("span",{className:"workspace-formatted-text__table-wrap",children:e.jsxs("table",{className:"workspace-formatted-text__table",children:[e.jsx("thead",{children:e.jsx("tr",{children:r.map((o,n)=>e.jsx("th",{children:Y(o)},`${n}-${o}`))})}),e.jsx("tbody",{children:a.map((o,n)=>e.jsx("tr",{children:o.map((l,c)=>e.jsx("td",{children:Y(l)},`${c}-${l}`))},`${n}-${o.join("|")}`))})]})},`table-${t}`)}return e.jsx("span",{className:"workspace-formatted-text__paragraph",children:s.lines.map((r,a)=>{const o=$e(r);return e.jsx("span",{className:`workspace-formatted-text__line ${o.trim()?"":"is-empty"} ${ee(o)?"is-ordered":""}`,children:o.trim()?Y(o):" "},`${a}-${r}`)})},`lines-${t}`)}function Os(s){const t=s.replace(/\r\n?/g,`
7`).split(`
8`),r=[];let a=0;for(;a<t.length;){const o=t[a];if(ye(t,a)){const l=[se(t[a])];for(a+=2;a<t.length&&Ue(t[a]);)l.push(se(t[a])),a+=1;r.push({kind:"table",rows:Ks(l)});continue}if(ie(o)){const l=[];for(;a<t.length&&ie(t[a]);)l.push(Bs(t[a])),a+=1;r.push({kind:"ul",items:l});continue}if(ee(o)){const l=[];for(;a<t.length&&ee(t[a]);)l.push(Rs(t[a])),a+=1;r.push({kind:"ol",items:l});continue}const n=[];for(;a<t.length&&!ye(t,a)&&!ie(t[a])&&!ee(t[a]);)n.push(t[a]),a+=1;r.push({kind:"lines",lines:n})}return r}function $e(s){return s.replace(/^\s{0,3}#{1,6}\s+/,"")}function ee(s){return/^\s*\d+[.)]\s+/.test(s)}function Rs(s){const t=s.match(/^\s*(\d+[.)])\s+(.*)$/),r=t?.[1]??"";return{marker:r,value:Number.parseInt(r,10)||void 0,text:t?.[2]??s}}function ie(s){return/^\s*[-*+]\s+/.test(s)}function Bs(s){const t=s.match(/^\s*([-*+])\s+(.*)$/);return{marker:t?.[1]??"-",text:t?.[2]??s}}function ye(s,t){return Ue(s[t])&&zs(s[t+1])}function Ue(s){if(!s)return!1;const t=s.trim();return t.includes("|")&&se(t).length>=2}
8function zs(s){if(!s)return!1;const t=se(s);return t.length>=2&&t.every(r=>/^:?-{3,}:?$/.test(r.trim()))}function se(s){return s.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(t=>$e(t.trim()))}function Ks(s){const t=Math.max(...s.map(r=>r.length));return s.map(r=>[...r,...Array.from({length:t-r.length},()=>"")])}function Y(s){return s.split(/(\*\*[^*\n]+\*\*|__[^_\n]+__)/g).map((r,a)=>{const o=r.startsWith("**")&&r.endsWith("**"),n=r.startsWith("__")&&r.endsWith("__");return!o&&!n?r:e.jsx("strong",{children:r.slice(2,-2)},`${a}-${r}`)})}function ce({assets:s,products:t,isLoading:r,toolbarLeading:a,primaryAction:o,primaryActionPlacement:n,hideToolbar:l,emptyTitle:c,emptyDescription:i,selectedAssetId:f,selectedAssetIds:p,compact:u,selectionMode:h,onToggleAssetSelected:d,onUpdateAsset:x,onDeleteAsset:k,onAddToConversation:y}){const{t:g}=T(),C=te(),[j,b]=m.useState(null),[N,U]=m.useState(null),[D,_]=m.useState(null),[A,v]=m.useState(!1),[P,O]=m.useState(null),{archiveAsset:W}=le(),I=m.useMemo(()=>s.map(w=>({asset:w,url:Fe(w)})).filter(w=>!!w.url),[s]),Q=w=>{const J=I.findIndex(X=>X.asset.id===w.id);if(J>=0){b(J);return}if(w.asset_type==="reference"&&w.content_text){window.open(w.content_text,"_blank","noopener,noreferrer");return}U(w)},q=async()=>{if(!(!D||!k)){v(!0);try{await k(D.id),_(null)}catch{$.error(g("workspace.storage.deleteFailed"))}finally{v(!1)}}},F=j!==null?I[j]:null,{url:H}=ws(F?.asset.file_id,F?.url),G=F?_s(F.asset):null,V=G?.detail.map(w=>({label:g(`workspace.assets.imageDetail.${w.key}`,w.key),value:w.value})),M=N?Ee(N):null;return e.jsxs("div",{className:"workspace-asset-split",children:[e.jsx(ps,{assets:s,products:t,isLoading:r,selectedAssetId:f,selectedAssetIds:p,compact:u,selectionMode:h,toolbarLeading:a,primaryAction:o,primaryActionPlacement:n,hideToolbar:l,emptyTitle:c,emptyDescription:i,onSelectAsset:Q,onToggleAssetSelected:d,onUpdateAsset:x,onDeleteAsset:k?_:void 0,onArchiveAsset:k?O:void 0,onAddToConversation:y,onOpenSession:w=>w.session_id&&C(ss(w.session_id))}),F&&H&&e.jsx(xs,{src:H,fileKey:F.asset.file_id,alt:F.asset.title||F.asset.asset_type,isOpen:j!==null,onClose:()=>b(null),onPrevious:()=>b(w=>w!==null&&w>0?w-1:w),onNext:()=>b(w=>w!==null&&w<I.length-1?w+1:w),hasPrevious:j!==null&&j>0,hasNext:j!==null&&j<I.length-1,positionLabel:`${(j??0)+1} / ${I.length}`,promptText:G?.prompt??void 0,detailItems:V}),N&&M&&e.jsx(Le,{path:M.fileName,content:M.content,s3Key:M.s3Key,mimeType:M.mimeType,registryKey:`workspace-asset-preview:${N.id}`,onClose:()=>U(null),mobileFillViewport:!0,hideViewModeToggle:!0}),e.jsx(ke,{isOpen:P!==null,title:g("workspace.storage.archive"),message:g("workspace.storage.archiveConfirm",{name:P?.title}),confirmText:g("workspace.storage.archive"),cancelText:g("common.cancel"),onConfirm:async()=>{if(P)try{await W.mutateAsync(P.id),O(null)}catch{$.error(g("workspace.storage.deleteFailed"))}},onCancel:()=>O(null),loading:W.isPending}),e.jsx(ke,{isOpen:D!==null,title:g("workspace.assets.deleteTitle"),message:g("workspace.assets.deleteConfirm",{name:D?.title||g("workspace.list.typeOther")}),confirmText:g("workspace.storage.permanentDelete"),cancelText:g("common.cancel"),onConfirm:q,onCancel:()=>_(null),variant:"danger",loading:A})]})}function Qs({product:s,imageUrl:t,onUpdateProduct:r}){const{t:a}=T(),{uploadFile:o}=gs(),n=m.useRef(null),[l,c]=m.useState(!1),i=s?.name||a("workspace.product.title"),f=s?.hero_image_url?.trim()||t||null,p=s?.selling_price?.trim()||a("workspace.empty.needsInput"),u=()=>{l||!s||n.current?.click()},h=async d=>{const x=d.target.files?.[0]??null;if(d.target.value="",!(!x||!s||l)){if(!x.type.startsWith("image/")){$.error(a("workspace.product.imageInvalidType"));return}c(!0);try{const k=await o({file:x}),y=ts(k.key);await r(s.id,{hero_image_url:y}),$.success(a("workspace.product.imageUpdated"))}catch(k){$.error(k instanceof Error?k.message:a("workspace.product.imageUpdateFailed"))}finally{c(!1)}}};return e.jsxs("section",{className:"workspace-product-identity-panel","aria-label":a("workspace.product.summary"),children:[e.jsx("div",{className:"workspace-product-identity-panel__media",children:e.jsxs("button",{type:"button",className:"workspace-product-identity-panel__preview",onClick:u,disabled:!s||l,"aria-label":a("workspace.product.imageUpload"),children:[e.jsx(js,{src:f,alt:"",fallback:e.jsx(Ps,{size:22,strokeWidth:1.7})}),e.jsxs("span",{className:"workspace-product-identity-panel__overlay",children:[e.jsx(Ss,{size:15}),e.jsx("span",{children:a(l?"workspace.product.imageUploading":f?"workspace.product.imageChange":"workspace.product.imageUpload")})]})]})}),e.jsxs("div",{className:"workspace-product-identity-panel__content",children:[e.jsx("div",{className:"workspace-product-identity-panel__identity",children:e.jsxs("div",{className:"workspace-product-identity-panel__text",children:[e.jsx("h2",{children:i}),e.jsx("p",{children:p})]})}),e.jsx("input",{ref:n,type:"file",accept:"image/*",className:"sr-only",onChange:h,disabled:!s||l})]})]})}
8function B({label:s,value:t,onChange:r,helper:a,multiline:o=!1,required:n=!1,type:l="text",min:c}){const i=m.useMemo(()=>`workspace-detail-edit-${s.replace(/\s+/g,"-").toLowerCase()}`,[s]);return e.jsxs("label",{className:"workspace-detail-edit-field",htmlFor:i,children:[e.jsx("span",{className:"workspace-detail-edit-field__label",children:s}),o?e.jsx("textarea",{id:i,className:"workspace-detail-edit-field__control workspace-detail-edit-field__control--textarea",value:t,onChange:f=>r(f.target.value),required:n,rows:3}):e.jsx("input",{id:i,className:"workspace-detail-edit-field__control",value:t,onChange:f=>r(f.target.value),required:n,type:l,min:c}),a&&e.jsx("span",{className:"workspace-detail-edit-field__helper",children:a})]})}let ve=0;function We(){return ve+=1,`fact-${ve}`}function Hs(s){return Object.entries(s??{}).map(([t,r])=>({id:We(),key:t,value:De(r)}))}function Pe(s){return{name:s.name??"",shopifyProductId:s.shopify_product_id??"",purchasePrice:s.purchase_price??"",sellingPrice:s.selling_price??"",stock:s.stock!=null?String(s.stock):"",sourcingUrl:s.sourcing_url??"",facts:Hs(s.facts)}}function Z(s){const t=s.trim();return t||null}function qs(s){const t=s.trim();if(!t)return null;const r=Number(t);return!Number.isInteger(r)||r<0?"invalid":r}function Gs(s,t){const r={},a=new Set;for(const o of t){const n=fe(o.key);if(!n||a.has(n))continue;a.add(n);const l=o.value.trim();r[n]=l||null}for(const o of Object.keys(s.facts??{})){const n=fe(o);n&&!a.has(n)&&(r[o]=null)}return r}function Vs({product:s,onUpdateProduct:t,onDone:r}){const{t:a}=T(),[o,n]=m.useState(()=>Pe(s)),[l,c]=m.useState(!1);m.useEffect(()=>{n(Pe(s))},[s]);const i=(d,x)=>{n(k=>({...k,[d]:x}))},f=(d,x)=>{n(k=>({...k,facts:k.facts.map(y=>y.id===d?{...y,...x}:y)}))},p=()=>{n(d=>({...d,facts:[...d.facts,{id:We(),key:"",value:""}]}))},u=d=>{n(x=>({...x,facts:x.facts.filter(k=>k.id!==d)}))},h=async d=>{d.preventDefault();const x=o.name.trim();if(!x){$.error(a("workspace.forms.nameRequired"));return}const k=qs(o.stock);if(k==="invalid"){$.error(a("workspace.product.fieldHints.stockInvalid"));return}c(!0);try{await t(s.id,{name:x,shopify_product_id:Z(o.shopifyProductId),purchase_price:Z(o.purchasePrice),selling_price:Z(o.sellingPrice),stock:k,sourcing_url:Z(o.sourcingUrl),facts:Gs(s,o.facts)}),$.success(a("workspace.product.updated")),r()}catch(y){$.error(y instanceof Error?y.message:a("workspace.product.updateFailed"))}finally{c(!1)}};return e.jsxs("form",{className:"workspace-detail-edit-form",onSubmit:h,children:[e.jsx(B,{label:a("workspace.fields.name"),value:o.name,onChange:d=>i("name",d),required:!0}),e.jsx(B,{label:a("workspace.product.fields.shopifyProductId"),value:o.shopifyProductId,onChange:d=>i("shopifyProductId",d),helper:a("workspace.product.fieldHints.shopifyProductId")}),e.jsx(B,{label:a("workspace.product.fields.purchasePrice"),value:o.purchasePrice,onChange:d=>i("purchasePrice",d),helper:a("workspace.product.fieldHints.purchasePrice")}),e.jsx(B,{label:a("workspace.product.fields.sellingPrice"),value:o.sellingPrice,onChange:d=>i("sellingPrice",d),helper:a("workspace.product.fieldHints.sellingPrice")}),e.jsx(B,{label:a("workspace.product.fields.stock"),value:o.stock,onChange:d=>i("stock",d),type:"number",min:0,helper:a("workspace.product.fieldHints.stock")}),e.jsx(B,{label:a("workspace.product.fields.sourcingUrl"),value:o.sourcingUrl,onChange:d=>i("sourcingUrl",d),helper:a("workspace.product.fieldHints.sourcingUrl")}),e.jsxs("fieldset",{className:"workspace-detail-edit-facts",children:[e.jsx("legend",{className:"workspace-detail-edit-facts__title",children:a("workspace.product.facts.title")}),o.facts.map(d=>e.jsxs("div",{className:"workspace-detail-edit-facts__row",children:[e.jsx("input",{className:"workspace-detail-edit-facts__key",value:d.key,onChange:x=>f(d.id,{key:x.target.value}),placeholder:a("workspace.product.facts.keyPlaceholder"),"aria-label":a("workspace.product.facts.keyPlaceholder")}),e.jsx("input",{className:"workspace-detail-edit-facts__value",value:d.value,onChange:x=>f(d.id,{value:x.target.value}),placeholder:a("workspace.product.facts.valuePlaceholder"),"aria-label":a("workspace.product.facts.valuePlaceholder")}),e.jsx("button",{type:"button",className:"workspace-detail-edit-facts__remove",onClick:()=>u(d.id),disabled:l,"aria-label":a("workspace.product.facts.remove"),title:Ce(d.key)||a("workspace.product.facts.remove"),children:e.jsx(as,{size:14})})]},d.id)),e.jsxs("button",{type:"button",className:"workspace-detail-edit-facts__add",onClick:p,disabled:l,children:[e.jsx(ne,{size:14}),e.jsx("span",{children:a("workspace.product.facts.add")})]})]}),e.jsxs("div",{className:"workspace-detail-edit-form__actions",children:[e.jsx("button",{type:"button",className:"workspace-detail-edit-form__secondary",onClick:r,disabled:l,children:a("common.cancel")}),e.jsx("button",{type:"submit",className:"workspace-detail-edit-form__primary",disabled:l,children:a(l?"common.saving":"common.save")})]})]})}function Js({createdAt:s,updatedAt:t}){const{t:r}=T();return!s&&!t?null:e.jsxs("div",{className:"workspace-detail-timestamp-footer",children:[s&&e.jsxs("span",{children:[r("workspace.fields.created"),e.jsx("time",{dateTime:s,children:ge(s)})]}),t&&e.jsxs("span",{children:[r("workspace.fields.updated"),e.jsx("time",{dateTime:t,children:ge(t)})]})]})}function be(s){const t=p=>p&&Date.parse(p)||0,r=p=>{const u=p.content_json;return typeof u?.url=="string"?u.url:null},a=p=>{try{const u=new URL(p,window.location.origin);return u.search="",u.hash="",u.toString()}catch{return p.split("#")[0].split("?")[0]}};function o(p){return typeof p=="string"&&p.trim()?p.trim():""}function n(p){const u=p.file_metadata??{},h=p.file_id||o(u.key)||o(u.file_key);if(h)return`file:${h}`;const d=r(p);return d?`url:${a(d)}`:null}function l(p){const u=p.content_json??{};let h=0;return p.source==="ai_generated"&&(h+=8),typeof u.prompt=="string"&&u.prompt.trim()&&(h+=4),typeof u.parameters=="object"&&u.parameters&&(h+=2),typeof u.reference_images=="object"&&u.reference_images&&(h+=1),h}function c(p,u){const h=l(p),d=l(u);return h!==d?h>d:t(p.updated_at)>=t(u.updated_at)}const i=new Map,f=[];for(const p of s){const u=n(p);if(!u){f.push(p);continue}const h=i.get(u);(!h||c(p,h))&&i.set(u,p)}return[...i.values(),...f].sort((p,u)=>t(u.updated_at)-t(p.updated_at))}function Xs({productId:s,snapshot:t,onUpdateProduct:r,onDeleteProduct:a,onAssistantContextReady:o}){const{t:n}=T(),l=t?.products?.find(_=>_.id===s)??null,c=Ye(s,!l),[i,f]=m.useState(()=>l),[p,u]=m.useState(!1),[h,d]=m.useState([]),x=m.useMemo(()=>i?[i,...(t?.products??[]).filter(_=>_.id!==i.id)]:t?.products??[],[i,t?.products]);m.useEffect(()=>{const _=l??c.data??null;f(A=>_??(A?.id===s?A:null))},[s,c.data,l]);const k=!l&&c.isLoading,y=c.error?c.error instanceof Error?c.error.message:n("workspace.products.loadFailed"):null,g=m.useMemo(()=>i?be((t?.assets??[]).filter(_=>_.product_ids?.includes(i.id)&&xe(_))):[],[i,t?.assets]),C=m.useMemo(()=>i?be((t?.assets??[]).filter(_=>_.product_ids?.includes(i.id)&&!xe(_)&&ys(_))):[],[i,t?.assets]),j=i?.id??null,b=m.useMemo(()=>Te({productIds:j?[j]:[],contextSnapshotId:t?.context_snapshot?.id}),[j,t?.context_snapshot?.id]);m.useEffect(()=>{o?.(j?b:null)},[b,j,o]);const N=m.useCallback(async(_,A)=>{if(!r)throw new Error(n("tenant.errors.permissionDenied"));const v=await r(_,A);return f(v),v},[r,n]),U=m.useCallback(()=>i&&a?a(i.id):Promise.resolve(),[i,a]),D=m.useCallback(_=>{d(A=>A.includes(_.id)?A.filter(v=>v!==_.id):[...A,_.id])},[]);return{t:n,product:i,isEditingProduct:p,setIsEditingProduct:u,isLoading:k,error:y,productSourceAssets:g,productMarketingAssets:C,railProducts:x,context:b,assistantAssetIds:h,setAssistantAssetIds:d,updateProductAndSync:N,deleteProduct:U,addAssetToConversation:D}}function R({label:s,value:t}){const{t:r}=T();return e.jsxs("div",{className:"workspace-detail-fact",children:[e.jsx("dt",{className:"workspace-detail-fact__label",children:s}),e.jsx("dd",{className:"workspace-detail-fact__value",children:e.jsx(Ws,{value:t,emptyText:r("workspace.empty.needsInput")})})]})}function Ys({productId:s,snapshot:t,onCreateAsset:r,onUpdateProduct:a,onUp
8dateAsset:o,onDeleteProduct:n,onDeleteAsset:l}){const{t:c}=T(),{product:i,isEditingProduct:f,setIsEditingProduct:p,isLoading:u,error:h,productSourceAssets:d,productMarketingAssets:x,updateProductAndSync:k,deleteProduct:y}=Xs({productId:s,snapshot:t,onUpdateProduct:a,onDeleteProduct:n});return u&&!i?e.jsx(Ls,{showAssistant:!1}):i?e.jsx("div",{className:K,children:e.jsx("div",{"data-route-scroll-root":"true",className:"workspace-content-area workspace-detail-shell",children:e.jsxs("main",{className:"workspace-detail-main",children:[e.jsxs("div",{className:"workspace-detail-main__header",children:[e.jsx(vs,{crumbs:[{label:c("nav.workspaceProducts"),to:pe("/products")}],currentLabel:i?.name||c("workspace.product.title"),meta:i?.status}),e.jsx(he,{entity:"product",name:i?.name||c("workspace.product.title"),disabled:!i||!n,onDelete:y})]}),e.jsx("div",{className:"workspace-detail-main__content workspace-detail-main__content--full",children:e.jsxs("div",{className:"workspace-detail-main__body",children:[e.jsx("div",{className:"workspace-detail-mobile-actions",children:e.jsx(he,{entity:"product",name:i?.name||c("workspace.product.title"),disabled:!i||!n,onDelete:y})}),h&&e.jsx("div",{className:Ie,children:h}),e.jsxs(ae,{title:c("workspace.product.summary"),action:e.jsxs("button",{type:"button",className:"workspace-detail-edit-button",onClick:()=>p(g=>!g),disabled:!i||!a,children:[e.jsx(bs,{size:14}),e.jsx("span",{children:c(f?"common.cancel":"common.edit")})]}),className:"workspace-detail-info-section",variant:"plain",children:[a&&e.jsx(Qs,{product:i,imageUrl:d.length?Fe(d[0]):null,onUpdateProduct:k}),f&&i&&a?e.jsx(Vs,{product:i,onUpdateProduct:k,onDone:()=>p(!1)}):e.jsxs("dl",{className:"workspace-detail-fact-grid",children:[e.jsx(R,{label:c("workspace.fields.name"),value:i?.name}),e.jsx(R,{label:c("workspace.product.fields.shopifyProductId"),value:i?.shopify_product_id}),e.jsx(R,{label:c("workspace.product.fields.purchasePrice"),value:i?.purchase_price}),e.jsx(R,{label:c("workspace.product.fields.sellingPrice"),value:i?.selling_price}),e.jsx(R,{label:c("workspace.product.fields.stock"),value:i?.stock!=null?String(i.stock):null}),e.jsx(R,{label:c("workspace.product.fields.sourcingUrl"),value:i?.sourcing_url}),Object.entries(i?.facts??{}).map(([g,C])=>e.jsx(R,{label:Ce(g),value:De(C)||null},g))]})]}),e.jsx(ae,{title:c("workspace.detail.productSourceImages"),action:r?e.jsx(Se,{scope:{productIds:i?[i.id]:[]},onCreateAsset:r,disabled:!i,label:c("workspace.assets.uploadProductImage"),accept:"image/*",imageAssetType:"product_image",imageAssetRole:"product_source"}):void 0,className:"workspace-detail-info-section",variant:"plain",children:e.jsx("div",{className:"workspace-detail-assets-compact",children:e.jsx(ce,{assets:d,compact:!0,hideToolbar:!0,primaryActionPlacement:"controls",emptyDescription:c("workspace.empty.productSourceImagesDescription"),onUpdateAsset:o,onDeleteAsset:l})})}),e.jsx(ae,{title:c("workspace.detail.productMarketingAssets"),className:"workspace-detail-info-section",variant:"plain",children:e.jsx("div",{className:"workspace-detail-assets-compact",children:e.jsx(ce,{assets:x,compact:!0,hideToolbar:!0,primaryActionPlacement:"controls",onUpdateAsset:o,onDeleteAsset:l})})}),e.jsx(Js,{createdAt:i?.created_at,updatedAt:i?.updated_at})]})})]})})}):e.jsx("div",{className:K,children:e.jsx(Us,{entityLabel:c("nav.workspaceProducts"),backTo:pe("/products"),error:h})})}function Zs({snapshot:s,isLoading:t,error:r,pendingInput:a,pendingAttachments:o,pendingAgentOptions:n,pendingWorkspaceContext:l,autoSubmitPendingInput:c,onPendingInputConsumed:i,ChatShell:f}){const{t:p}=T(),[u,h]=m.useState([]),{draftApplication:d,applyDraft:x,acknowledgeDraft:k}=Ns(),[y,g]=m.useState(null),[C,j]=m.useState(null),[b,N]=m.useState(null),[U,D]=m.useState(null),[_,A]=m.useState(0),[v,P]=m.useState(0),O=Te({contextSnapshotId:s?.context_snapshot?.id});m.useEffect(()=>{a?.trim()&&(!s||t||(g(a),j(l??null),N(o??null),D(n??null),A(I=>I+1),c&&P(I=>I+1),i?.()))},[c,t,i,n,o,a,l,s]);const W=I=>{g(I),j(null),A(Q=>Q+1)};return t&&!s?e.jsx("div",{className:`${K} workspace-list-shell`,children:e.jsx(is,{})}):e.jsx("div",{className:`${K} workspace-list-shell`,children:e.jsxs("div",{className:"workspace-home-welcome","data-onboarding-target":"workspace-home",children:[r&&e.jsx("div",{role:"alert",className:`${Ie} workspace-home-error`,children:r}),e.jsxs("section",{className:"workspace-home-hero","aria-labelledby":"workspace-home-title",children:[e.jsx("h1",{id:"workspace-home-title",className:"workspace-home-title",children:e.jsx("span",{children:p("workspace.home.prompt")})}),e.jsx(f,{context:O,draftApplication:d,onDraftApplicationResult:k,onProductSelectionChange:h,disabled:!s,draftMessage:y,draftMessageKey:_,draftSubmitKey:v,draftContext:C,draftAttachments:b,draftAgentOptions:U,assets:s?.assets??[],imageGenerationModel:typeof s?.defaults?.image_generation_model=="string"?s.defaults.image_generation_model:null,variant:"hero",materialPickerEnabled:!0})]}),e.jsx(As,{onApply:W,onApplyDraft:x,selectedProductIds:u})]})})}function et(s){const{currentTenant:t}=rs(),{currentStoreId:r}=os(),a=qe();return e.jsx(Zs,{...s},`${t?.id}:${r}:${a.key}`)}const z=20;function st({products:s,assets:t,isLoading:r,createAction:a,onDeleteProduct:o,page:n,total:l,onPageChange:c}){const{t:i}=T(),f=te();return e.jsxs(Oe,{children:[e.jsx(fs,{products:s,assets:t,isLoading:r,toolbarLeading:e.jsx(Re,{currentLabel:i("workspace.products.title")}),primaryAction:a,onOpenProduct:p=>f(ns("workspace-products",{productId:p})),onDeleteProduct:o}),e.jsx(Me,{page:n,total:l,onChange:c})]})}function tt({assets:s,products:t,isLoading:r,createAction:a,onUpdateAsset:o,onDeleteAsset:n,page:l,total:c,onPageChange:i}){const{t:f}=T(),[p,u]=Ne(),h=p.get("assetId")??"",d=Ze(h,!!h),x=d.data,k=x?Ee(x):null,y=()=>{const g=new URLSearchParams(p);g.delete("assetId"),g.delete("assetAction"),u(g,{replace:!0})};return e.jsxs(e.Fragment,{children:[h&&d.isPending&&e.jsx("p",{role:"status",children:f("common.loading")}),h&&d.isError&&e.jsxs("div",{role:"alert",children:[f("common.loadFailed")," ",e.jsx("button",{onClick:()=>{d.refetch()},children:f("common.retry")}),e.jsx("button",{onClick:y,children:f("common.close")})]}),x&&o&&e.jsx(us,{asset:x,products:t,onClose:y,onSave:async(g,C)=>{await o(g,C),y()}}),x&&k&&!o&&e.jsx(Le,{path:k.fileName,content:k.content,s3Key:k.s3Key,mimeType:k.mimeType,onClose:y}),e.jsx(ce,{assets:s,products:t,isLoading:r,compact:!0,toolbarLeading:e.jsx(Re,{currentLabel:f("workspace.assets.title")}),primaryAction:a,onUpdateAsset:o,onDeleteAsset:n}),e.jsx(Me,{page:l,total:c,onChange:i})]})}function Me({page:s,total:t,onChange:r}){return t<=z?null:e.jsx("div",{className:"extension-center-pagination",children:e.jsx(ms,{page:s,pageSize:z,total:t,onChange:r})})}function Oe({children:s,aside:t,className:r}){return e.jsx("div",{className:`${K} workspace-list-shell ${r??""}`,children:e.jsxs("div",{"data-route-scroll-root":"true",className:t?`${ue} grid gap-4 xl:grid-cols-[minmax(0,1fr)_24rem]`:ue,children:[e.jsx("main",{className:"grid content-start gap-3",children:s}),t]})})}function Re({currentLabel:s}){return e.jsx("div",{className:"workspace-list-page-title",children:e.jsx("h1",{className:"workspace-list-page-title__label",children:s})})}function Za({routeView:s,onAssistantContextReady:t,businessRefreshToken:r,pendingInput:a,pendingAttachments:o,pendingAgentOptions:n,pendingWorksp
8aceContext:l,autoSubmitPendingInput:c,onPendingInputConsumed:i,ChatShell:f,AutomationPanel:p}){const{t:u}=T(),{productId:h}=Ge(),d=te(),[x]=Ne(),[k,y]=m.useState(null),[g,C]=m.useState(1),{can:j}=ls(),b=s==="workspace-products"&&!h,N=s==="workspace-assets",U=s==="workspace-home",D=b||N,_=(g-1)*z,A=x.get("productId")||null,v=Cs({refreshToken:r,enabled:!D&&s!=="workspace-automation",includeProducts:!U,includeAssets:!U}),P=Ds({enabled:D,includeProducts:b||N,includeAssets:b||N,refreshToken:r,skip:_,limit:z,productSkip:N?0:_,productLimit:N?200:z,assetSkip:b?0:_,assetLimit:b?200:z,productId:N?A:null});m.useEffect(()=>{h||t?.(null)},[h,t]),m.useEffect(()=>{C(1)},[s,A]);const O=P.isLoading,W=u("tenant.errors.permissionDenied"),I=j(E.PRODUCT_WRITE),Q=j(E.PRODUCT_WRITE),q=j(E.PRODUCT_DELETE),F=j(E.ASSET_WRITE),H=j(E.ASSET_DELETE),G=j(E.FILE_UPLOAD_IMAGE)||j(E.FILE_UPLOAD_VIDEO)||j(E.FILE_UPLOAD_AUDIO)||j(E.FILE_UPLOAD_DOCUMENT),V=F&&j(E.FILE_UPLOAD)&&G,M=S=>S?I:!0,w=S=>{if(!M(S)){$.error(W);return}y(S)},J=async S=>D?P.createProduct(S):v.createProduct(S),X=async S=>{await P.createAsset(S),D||await v.refresh()},Be=(S,Ke,Qe,He=!1)=>{const de=!M(S);return e.jsxs(me,{onClick:()=>w(S),variant:"primary",disabled:He||de,title:de?W:void 0,children:[Qe,Ke]})},ze=S=>e.jsxs(e.Fragment,{children:[S,e.jsx(ds,{mode:k,canSubmitAction:M(k),permissionMessage:W,onClose:()=>y(null),onCreateProduct:I?J:void 0})]});return h?e.jsx(Ys,{productId:h,snapshot:v.snapshot,onCreateAsset:V?X:void 0,onUpdateProduct:Q?v.updateProduct:void 0,onUpdateAsset:F?v.updateAsset:void 0,onDeleteAsset:H?v.deleteAsset:void 0,onDeleteProduct:q?async S=>{await v.deleteProduct(S),d(cs("workspace-products",{base:!0}))}:void 0}):b?ze(e.jsx(st,{products:P.products,assets:P.assets,isLoading:O,createAction:Be("product",u("workspace.forms.createProduct"),e.jsx(ne,{size:15})),onDeleteProduct:q?P.deleteProduct:void 0,page:g,total:P.productPage.total,onPageChange:C})):N?e.jsxs(Oe,{className:"workspace-assets-page",children:[e.jsx(Is,{refreshToken:r}),e.jsx(tt,{assets:P.assets,products:P.products,isLoading:O,createAction:V?e.jsx(Se,{scope:{},onCreateAsset:X,label:u("workspace.assets.uploadAsset"),className:"btn-primary h-9"}):e.jsxs(me,{variant:"primary",disabled:!0,title:W,children:[e.jsx(ne,{size:15}),u("workspace.assets.uploadAsset")]}),onUpdateAsset:F?P.updateAsset:void 0,onDeleteAsset:H?P.deleteAsset:void 0,page:g,total:P.assetPage.total,onPageChange:C})]}):s==="workspace-automation"?e.jsx(p,{}):e.jsx(et,{ChatShell:f,snapshot:v.snapshot,isLoading:v.isLoading,error:v.error,pendingInput:a,pendingAttachments:o,pendingAgentOptions:n,pendingWorkspaceContext:l,autoSubmitPendingInput:c,onPendingInputConsumed:i})}export{Za as WorkspacePanel};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.