dsh-artifact-studio 0.9.0 → 0.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -9
- package/THIRD_PARTY_NOTICES.md +1 -0
- package/assets/canvas.engine.js +86 -85
- package/assets/canvas.viewer.js +6418 -0
- package/client.canvas.js +1 -1
- package/client.js +274 -329
- package/client.sheet.js +80 -80
- package/dist/contract.js +2 -2
- package/dist/host/lib/assets.js +12 -0
- package/dist/host/lib/brief.js +129 -4
- package/dist/host/lib/design-render.js +37 -0
- package/dist/host/lib/export.js +26 -8
- package/dist/host/lib/service.js +28 -1
- package/dist/host/lib/skill.js +33 -159
- package/dist/host/lib/svg-model.js +85 -0
- package/dist/host/lib/svg-viewer.js +380 -0
- package/dist/host/lib/tools.js +38 -6
- package/dist/host/lib/viewer.js +150 -0
- package/dist/host/lib/xlsx.js +4 -3
- package/dist/host/worker/design-worker.js +72 -5
- package/dist/host/worker/page-model.js +169 -0
- package/dist/sheet/model.js +67 -0
- package/dist/sheet/output.js +14 -2
- package/package.json +9 -2
package/client.js
CHANGED
|
@@ -4,7 +4,7 @@ window.__ModuleLoader__.load({
|
|
|
4
4
|
var module = { exports: {} };
|
|
5
5
|
var exports = module.exports;
|
|
6
6
|
globalThis.__dshArtifactsRequireAsync = require.async;
|
|
7
|
-
"use strict";var
|
|
7
|
+
"use strict";var Po=Object.create;var Bt=Object.defineProperty;var Oo=Object.getOwnPropertyDescriptor;var Fo=Object.getOwnPropertyNames;var jo=Object.getPrototypeOf,Bo=Object.prototype.hasOwnProperty;var Ho=(e,t)=>{for(var a in t)Bt(e,a,{get:t[a],enumerable:!0})},vr=(e,t,a,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Fo(t))!Bo.call(e,n)&&n!==a&&Bt(e,n,{get:()=>t[n],enumerable:!(r=Oo(t,n))||r.enumerable});return e};var _o=(e,t,a)=>(a=e!=null?Po(jo(e)):{},vr(t||!e||!e.__esModule?Bt(a,"default",{value:e,enumerable:!0}):a,e)),Vo=e=>vr(Bt({},"__esModule",{value:!0}),e);var Ls={};Ho(Ls,{ARTIFACT_ID:()=>Nt,ARTIFACT_KIND:()=>Ka,ArtifactCard:()=>$a,ArtifactTab:()=>Ua,CARD_TOOLS:()=>so,DocView:()=>ea,GALLERY_ID:()=>la,GALLERY_KIND:()=>qa,PANEL_ID:()=>dt,apply:()=>Ds,inject:()=>Is});module.exports=Vo(Ls);var io=require("@deepseek-ai/dsh-client-ui-primitives");var Wo=["page","doc","design","sheet"];function Go(e){return Wo.some(t=>t===e)}var br={page:["html"],doc:["md","docx","html"],design:["png","svg","fig","html","html-svg"],sheet:["csv","xlsx"]};var Ht=/^art_(ws|lib)_[a-z0-9]{10,32}$/,yr=/^[a-z][a-z0-9-]{1,39}$/;var $e=["primary","accent","surface","text","muted","background","raised","border","control","action","actionText","focus","success","warning","danger"];function Aa(e){if(e===null||typeof e!="object")return!1;let t={...e};return typeof t.pages=="number"&&typeof t.nodes=="number"&&t.types!==null&&typeof t.types=="object"&&Array.isArray(t.fonts)&&t.fonts.every(a=>typeof a=="string")&&Array.isArray(t.warnings)&&t.warnings.every(a=>typeof a=="string")}function Ea(e){if(e===null||typeof e!="object")return!1;let t="origin"in e?e.origin:void 0,a="action"in e?e.action:void 0;return(t==="agent"||t==="user")&&(a==="create"||a==="update"||a==="restore"||a==="rebase")}function Wt(e){if(e===null||typeof e!="object")return!1;let t={...e};return t.schemaVersion===1&&typeof t.id=="string"&&Ht.test(t.id)&&(t.scope==="workspace"||t.scope==="library")&&typeof t.type=="string"&&Go(t.type)&&typeof t.title=="string"&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string"&&typeof t.version=="number"&&Number.isInteger(t.version)&&t.version>=1&&typeof t.contentFile=="string"&&typeof t.contentBytes=="number"&&typeof t.contentHash=="string"&&Ea(t.source)&&(t.recipe===void 0||typeof t.recipe=="string"&&yr.test(t.recipe))&&(t.generation===void 0||$t(t.generation))}var _t="dsh-resource://artifact/",Vt="data-artifact-theme";function te(e){return e.scope==="workspace"?`${_t}workspace/${encodeURIComponent(e.workspaceId)}/${e.id}`:`${_t}library/${e.id}`}function He(e){if(typeof e!="string"||!e.startsWith(_t))return;let t=e.slice(_t.length).split("/");if(t[0]==="library"&&t.length===2){let a=t[1]??"";return Ht.test(a)&&a.startsWith("art_lib_")?{scope:"library",id:a}:void 0}if(t[0]==="workspace"&&t.length===3){let a=t[2]??"",r;try{r=decodeURIComponent(t[1]??"")}catch{return}return r===""||!Ht.test(a)||!a.startsWith("art_ws_")?void 0:{scope:"workspace",workspaceId:r,id:a}}}function wr(e){if(Ht.test(e))return e.startsWith("art_ws_")?"workspace":"library"}function Ra(e){return"--artifact-color-"+e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function xr(e){let t=[];for(let r of $e)t.push(`${Ra(r)}: ${e.colors[r]};`);t.push(`--artifact-font-family: ${e.typography.fontFamily};`),t.push(`--artifact-font-display: ${e.typography.displayFamily};`),t.push(`--artifact-font-mono: ${e.typography.monoFamily};`),e.typography.scale.forEach((r,n)=>t.push(`--artifact-font-size-${n}: ${r}px;`)),t.push(`--artifact-space-unit: ${e.spacing.unit}px;`),e.spacing.scale.forEach((r,n)=>t.push(`--artifact-space-${n}: ${r}px;`));for(let[r,n]of Object.entries(e.radius))t.push(`--artifact-radius-${r}: ${n}px;`);let a=$e.map(r=>`${Ra(r)}: ${e.colorsDark[r]};`).join(`
|
|
8
8
|
`);return[`:root {
|
|
9
9
|
${t.join(`
|
|
10
10
|
`)}
|
|
@@ -18,9 +18,9 @@ window.__ModuleLoader__.load({
|
|
|
18
18
|
`)}
|
|
19
19
|
}
|
|
20
20
|
}`].join(`
|
|
21
|
-
`)}function Ut(e,t){let a=t?e.colorsDark:e.colors,r={"--artifact-font-family":e.typography.fontFamily,"--artifact-font-display":e.typography.displayFamily,"--artifact-font-mono":e.typography.monoFamily};for(let n of bt)r[Ca(n)]=a[n];e.typography.scale.forEach((n,o)=>{r[`--artifact-font-size-${o}`]=`${n}px`}),e.spacing.scale.forEach((n,o)=>{r[`--artifact-space-${o}`]=`${n}px`});for(let[n,o]of Object.entries(e.radius))r[`--artifact-radius-${n}`]=`${o}px`;return r}var Co=/^ds_[a-z0-9]{16}$/,No=/^sha256:[a-f0-9]{64}$/;function Gt(e){if(e===null||typeof e!="object")return!1;let t={...e};return typeof t.id=="string"&&Co.test(t.id)&&typeof t.revision=="number"&&Number.isSafeInteger(t.revision)&&t.revision>0&&(t.scope==="workspace"||t.scope==="library")&&typeof t.name=="string"&&t.name.length>0&&t.name.length<=80}function $t(e){if(e===null||typeof e!="object")return!1;let t={...e};return typeof t.hash=="string"&&No.test(t.hash)&&typeof t.bytes=="number"&&Number.isSafeInteger(t.bytes)&&t.bytes>0&&t.bytes<=65536&&(t.system===null||Gt(t.system))&&(t.recipe===null||typeof t.recipe=="string"&&mr.test(t.recipe))&&(t.kit===null||typeof t.kit=="string"&&t.kit.length<=20)}var zo="/artifacts-rpc",Ge=class extends Error{code;details;constructor(t,a,r){super(a),this.name="ArtifactCallError",this.code=t,this.details=r}},Ra=null;function br(e){Ra=e}async function ae(e,t,a,r){if(Ra===null)throw new Ge("artifact/not-ready","The artifact channel is not ready.",{});let n=await Ra.rpc.call(zo,e,t,r);if(!n.ok)throw new Ge(n.error.code,n.error.message,n.error.details);if(!a(n.value))throw new Ge("artifact/bad-response",`The ${e} response has an unexpected shape.`,{});return n.value}function ie(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Ro(e){return ie(e)&&Array.isArray(e.items)&&e.items.every(Wt)&&typeof e.total=="number"&&typeof e.hasMore=="boolean"}function Eo(e){return ie(e)&&Wt(e.manifest)&&typeof e.content=="string"&&typeof e.version=="number"&&typeof e.designCss=="string"&&yr(e.design)&&(e.generation===void 0||$t(e.generation))&&(e.designInfo===void 0||Na(e.designInfo))}function yt(e){return ie(e)&&Wt(e.manifest)}function Io(e){return ie(e)&&typeof e.version=="number"&&typeof e.createdAt=="string"&&typeof e.contentHash=="string"&&typeof e.contentBytes=="number"&&za(e.source)&&(e.generation===void 0||$t(e.generation))}function Ao(e){return ie(e)&&Array.isArray(e.versions)&&e.versions.every(Io)}function Do(e){return ie(e)&&e.trashed===!0&&typeof e.trashPath=="string"}function Po(e){return ie(e)&&typeof e.path=="string"&&typeof e.bytes=="number"&&typeof e.fileName=="string"&&typeof e.mediaType=="string"&&typeof e.data=="string"}function Lo(e){return ie(e)&&typeof e.html=="string"}function Mo(e){return ie(e)&&typeof e.mediaType=="string"&&typeof e.data=="string"&&typeof e.width=="number"&&typeof e.height=="number"&&Na(e.info)}function yr(e){return ie(e)&&e.schemaVersion===1&&typeof e.name=="string"&&ie(e.colors)&&ie(e.colorsDark)&&ie(e.typography)&&ie(e.spacing)&&ie(e.radius)}function vt(e){return ie(e)&&yr(e.tokens)&&(e.source==="workspace"||e.source==="library"||e.source==="default")&&typeof e.css=="string"&&(e.system===void 0||Gt(e.system))}function Oo(e){return ie(e)&&(e.scope==="workspace"||e.scope==="library")&&typeof e.revision=="number"&&Number.isSafeInteger(e.revision)&&e.revision>=0&&(e.defaultId===null||typeof e.defaultId=="string")&&Array.isArray(e.systems)&&e.systems.every(Gt)}function le(e){return{scope:e.scope,...e.workspaceId===null?{}:{workspaceId:e.workspaceId}}}var _={list:(e,t,a)=>ae("list",{...le(e),...t},Ro,a),get:(e,t,a,r)=>ae("get",{...le(e),id:t,...a===void 0?{}:{version:a}},Eo,r),create:(e,t,a,r)=>ae("create",{...le(e),type:t,title:a,content:r},yt),update:(e,t,a,r,n)=>ae("update",{...le(e),id:t,baseVersion:a,content:r,...n===void 0?{}:{title:n}},yt),rename:(e,t,a,r)=>ae("update",{...le(e),id:t,baseVersion:a,title:r},yt),remove:(e,t)=>ae("delete",{...le(e),id:t},Do),history:(e,t,a)=>ae("history",{...le(e),id:t},Ao,a),restore:(e,t,a,r)=>ae("restore",{...le(e),id:t,version:a,baseVersion:r},yt),exportFile:(e,t,a,r)=>ae("export",{...le(e),id:t,format:a,version:r},Po),printable:(e,t,a)=>ae("printable",{...le(e),id:t,version:a},Lo),preview:(e,t,a,r)=>ae("preview",{...le(e),id:t,...a===void 0?{}:{version:a}},Mo,r),designSystem:(e,t)=>ae("designSystem",e===null?{}:{workspaceId:e},vt,t),selectedDesign:(e,t={},a)=>ae("designSystem",{...le(e),systemId:t.systemId,systemScope:t.systemScope,systemRevision:t.revision},vt,a),designSystems:(e,t)=>ae("designSystems",le(e),Oo,t),saveDesignSystem:(e,t,a)=>ae("saveDesignSystem",{...le(e),tokens:t,...a},vt),setDesignDefault:(e,t,a)=>ae("setDesignDefault",{...le(e),systemId:t,expectedRevision:a},vt),rebase:(e,t,a,r={})=>ae("rebase",{...le(e),id:t,baseVersion:a,systemId:r.systemId,systemScope:r.systemScope,systemRevision:r.revision},yt),clearDesignSystem:e=>ae("clearDesignSystem",{workspaceId:e,scope:"workspace"},vt)};function q(e){return e instanceof Ge?e.code:void 0}function Y(e){switch(e){case"artifact/not-found":return"error.notFound";case"artifact/stale-catalog":return"error.staleCatalog";case"artifact/writer-busy":return"error.writerBusy";case"artifact/unsupported-kit":return"error.unsupportedKit";case"artifact/stale-version":return"error.stale";case"artifact/too-large":return"error.tooLarge";case"artifact/no-workspace":return"error.noWorkspace";case"artifact/forbidden-path":return"error.forbidden";case"artifact/corrupt":return"error.corrupt";case"artifact/invalid-tokens":return"error.tokens";case"artifact/library-unavailable":return"error.library";case"artifact/design-invalid":return"error.designInvalid";case"artifact/design-icon-unsupported":return"error.designIcon";case"artifact/design-icon-not-found":return"error.designIconNotFound";case"artifact/design-render-failed":return"error.designRender";case"artifact/design-timeout":return"error.designTimeout";case"artifact/design-unavailable":return"error.designUnavailable";case"artifact/unsupported-type":return"error.unsupportedType";case"artifact/invalid-sheet":return"error.sheetInvalid";default:return"error.generic"}}function Ea(e){if(!(!(e instanceof Ge)||!e.code.startsWith("artifact/design-")))return e.message===""?void 0:e.message}function vr(e,t){return Ea(t)??e(Y(q(t)))}function xr(e){let t=atob(e.data),a=new Uint8Array(t.length);for(let o=0;o<t.length;o+=1)a[o]=t.charCodeAt(o);let r=URL.createObjectURL(new Blob([a],{type:e.mediaType})),n=document.createElement("a");n.href=r,n.download=e.fileName,n.rel="noopener",document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(r),3e4)}var nt=require("react");var wt=require("react");function qt(e){let t=e,a=new Set;return{get:()=>t,set(r){t=r;for(let n of a)n()},subscribe(r){return a.add(r),()=>a.delete(r)}}}var at=qt(new Map);function Ae(e,t){if(at.get().get(e)===t)return;let a=new Map(at.get());a.set(e,t),at.set(a)}function wr(e){return at.get().get(e)}function kr(e){return(0,wt.useSyncExternalStore)(at.subscribe,()=>e===void 0?void 0:at.get().get(e))}var xt=qt(new Map);function Fe(e,t){if((xt.get().get(e)??0)>=t)return;let a=new Map(xt.get());a.set(e,t),xt.set(a)}function Sr(e){return(0,wt.useSyncExternalStore)(xt.subscribe,()=>e===void 0?0:xt.get().get(e)??0)}var Kt=qt(0);function we(){Kt.set(Kt.get()+1)}function Yt(){return(0,wt.useSyncExternalStore)(Kt.subscribe,Kt.get)}var rt=qt(null);function se(e){rt.set({seq:(rt.get()?.seq??0)+1,message:e})}function Tr(){return(0,wt.useSyncExternalStore)(rt.subscribe,rt.get)}function Ia(e){let t=rt.get();t===null||e!==void 0&&t.seq!==e||rt.set(null)}var De=new Map,Aa;function Cr(){Aa?.();let e=t=>{[...De.values()].some(a=>a.getSnapshot().draft!==null||a.getSnapshot().saving)&&(t.preventDefault(),t.returnValue="")};return window.addEventListener("beforeunload",e),Aa=()=>window.removeEventListener("beforeunload",e),Aa}var Da=class{state={payload:null,draft:null,loading:!0,saving:!1,conflict:!1,revision:0};listeners=new Set;pending=null;readSequence=0;mounts=0;renameTo;where;key;address;constructor(t){this.address=t,this.key=te(t),this.where={scope:t.scope,workspaceId:t.scope==="workspace"?t.workspaceId:null}}getSnapshot=()=>this.state;subscribe=t=>(this.listeners.add(t),()=>this.listeners.delete(t));publish(t){this.state={...this.state,...t},this.state.draft!==null||this.state.saving?De.set(this.key,this):this.mounts===0&&De.get(this.key)===this&&De.delete(this.key);for(let a of this.listeners)a()}attach(){return this.mounts+=1,De.set(this.key,this),this.mounts===1&&(this.state.payload===null||this.state.draft===null)&&this.load(),()=>{this.mounts-=1,this.mounts===0&&this.state.draft===null&&!this.state.saving&&De.get(this.key)===this&&De.delete(this.key)}}async load(){let t=++this.readSequence;this.publish({loading:!0,failure:void 0,failureMessage:void 0});try{let a=await _.get(this.where,this.address.id);if(t!==this.readSequence)return;if(this.state.draft!==null&&this.state.payload!==null){this.publish({loading:!1,conflict:a.version!==this.state.payload.version});return}this.publish({payload:a,loading:!1,conflict:!1,failure:void 0,revision:this.state.revision+1}),Ae(this.address.id,a.manifest.title),Fe(this.address.id,a.version)}catch(a){t===this.readSequence&&this.publish({loading:!1,failure:q(a)??"artifact/storage-failure",failureMessage:void 0})}}edit(t){this.publish({draft:t,failure:void 0,failureMessage:void 0})}async discardAndReload(){this.pending!==null&&await this.pending,this.publish({draft:null,conflict:!1,failure:void 0,failureMessage:void 0}),await this.load()}externalVersion(t){this.state.payload===null||t<=this.state.payload.version||this.state.saving||(this.state.draft!==null?this.publish({conflict:!0}):this.load())}save(t){return t!==void 0&&(this.renameTo=t),this.pending!==null?this.pending:this.state.conflict||this.state.payload===null?Promise.resolve(!1):(this.pending=Promise.resolve().then(()=>this.drain()),this.pending)}async drain(){this.publish({saving:!0,failure:void 0,failureMessage:void 0});try{for(;this.state.draft!==null||this.renameTo!==void 0;){let t=this.state.payload;if(t===null||this.state.conflict)return!1;let a=this.state.draft,r=a??t.content,n=this.renameTo,{manifest:o}=await _.update(this.where,this.address.id,t.version,r,n);this.renameTo===n&&(this.renameTo=void 0),this.accept(o,r,this.state.draft===a?null:this.state.draft)}return!0}catch(t){let a=q(t)??"artifact/storage-failure";return this.renameTo=void 0,this.publish({failure:a,failureMessage:a.startsWith("artifact/design-")?Ea(t):void 0,conflict:a==="artifact/stale-version"}),!1}finally{this.pending=null,this.publish({saving:!1})}}accept(t,a,r){let n=this.state.payload;n!==null&&(++this.readSequence,this.publish({payload:{...n,manifest:t,content:a,version:t.version},draft:r,conflict:!1,loading:!1}),Ae(t.id,t.title),Fe(t.id,t.version),we())}};function Nr(e){let t=te(e),a=(0,nt.useMemo)(()=>{let n=De.get(t);if(n!==void 0)return n;let o=new Da(e);return De.set(t,o),o},[t]),r=(0,nt.useSyncExternalStore)(a.subscribe,a.getSnapshot,a.getSnapshot);return(0,nt.useEffect)(()=>a.attach(),[a]),{model:a,state:r}}var N=require("react"),k=require("@deepseek-ai/dsh-client-ui-primitives");var be=require("react"),Se=require("@deepseek-ai/dsh-client-ui-primitives");var ks=require("react"),S=require("react/jsx-runtime");function Z({children:e,size:t=16}){return(0,S.jsx)("svg",{viewBox:"0 0 24 24",width:t,height:t,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e})}var kt=({size:e})=>(0,S.jsxs)(Z,{size:e,children:[(0,S.jsx)("rect",{x:"3.5",y:"3.5",width:"7",height:"7",rx:"1.5"}),(0,S.jsx)("rect",{x:"13.5",y:"3.5",width:"7",height:"7",rx:"1.5"}),(0,S.jsx)("rect",{x:"3.5",y:"13.5",width:"7",height:"7",rx:"1.5"}),(0,S.jsx)("path",{d:"M17 13.5v7M13.5 17h7"})]}),ke=({size:e})=>(0,S.jsxs)(Z,{size:e,children:[(0,S.jsx)("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2"}),(0,S.jsx)("path",{d:"M3.5 8.5h17M9 13l-2 1.8L9 16.5M15 13l2 1.8-2 1.7"})]}),Pe=({size:e})=>(0,S.jsxs)(Z,{size:e,children:[(0,S.jsx)("path",{d:"M6.5 3.5h7l4 4v13h-11z"}),(0,S.jsx)("path",{d:"M13.5 3.5v4h4M9 12h6M9 15.5h6"})]}),$e=({size:e})=>(0,S.jsxs)(Z,{size:e,children:[(0,S.jsx)("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2"}),(0,S.jsx)("path",{d:"M3.5 9.5h17M9.5 9.5v10M15 9.5v10M3.5 14.5h17"})]}),Ke=({size:e})=>(0,S.jsxs)(Z,{size:e,children:[(0,S.jsx)("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2"}),(0,S.jsx)("path",{d:"M3.5 14.5l4.5-4.5 4 4 3-3 5 5"}),(0,S.jsx)("circle",{cx:"8.5",cy:"8.5",r:"1.2"})]}),zr=({size:e})=>(0,S.jsxs)(Z,{size:e,children:[(0,S.jsx)("path",{d:"M20.5 12a8.5 8.5 0 1 1-8.5-8.5c4.7 0 8.5 3.4 8.5 7.6 0 2.1-1.7 3.8-3.8 3.8h-1.4c-1 0-1.9.8-1.9 1.8 0 .8.5 1.3.5 2.1 0 1-.7 1.7-1.9 1.7Z"}),(0,S.jsx)("circle",{cx:"7.6",cy:"10",r:"1.1",fill:"currentColor",stroke:"none"}),(0,S.jsx)("circle",{cx:"10",cy:"6.8",r:"1.1",fill:"currentColor",stroke:"none"}),(0,S.jsx)("circle",{cx:"14",cy:"7",r:"1.1",fill:"currentColor",stroke:"none"}),(0,S.jsx)("circle",{cx:"17",cy:"10.2",r:"1.1",fill:"currentColor",stroke:"none"})]}),Rr=({size:e})=>(0,S.jsx)(Z,{size:e,children:(0,S.jsx)("path",{d:"M7 3v18M17 3v18M3 7h18M3 17h18"})}),Er=({size:e})=>(0,S.jsx)(Z,{size:e,children:(0,S.jsx)("path",{d:"M5 6h14M12 6v13"})}),Ir=({size:e})=>(0,S.jsxs)(Z,{size:e,children:[(0,S.jsx)("rect",{x:"3.5",y:"3.5",width:"11",height:"11",rx:"2"}),(0,S.jsx)("circle",{cx:"15.5",cy:"15.5",r:"5"})]}),Ar=({size:e})=>(0,S.jsxs)(Z,{size:e,children:[(0,S.jsx)("rect",{x:"3.5",y:"3.5",width:"12",height:"12",rx:"2"}),(0,S.jsx)("path",{d:"M8.5 8.5h12v12h-12z"})]}),Dr=({size:e})=>(0,S.jsx)(Z,{size:e,children:(0,S.jsx)("path",{d:"M5 3.5l12.5 8.2-5.7 1.2L14 19l-2.4 1-2.1-5.1L5 18.2z"})}),Pr=({size:e})=>(0,S.jsx)(Z,{size:e,children:(0,S.jsx)("path",{d:"M8 12V5.5a1.5 1.5 0 0 1 3 0V11M11 10.5V4.5a1.5 1.5 0 0 1 3 0V11M14 10.5V6.5a1.5 1.5 0 0 1 3 0V13c0 4-2.4 7-6 7-3.3 0-4.6-1.6-6.5-5.2L3.2 11.5a1.5 1.5 0 0 1 2.5-1.6L8 12.5"})}),Lr=({size:e})=>(0,S.jsxs)(Z,{size:e,children:[(0,S.jsx)("rect",{x:"4.5",y:"4.5",width:"15",height:"15",rx:"2"}),(0,S.jsx)("path",{d:"M8.5 4.5v15M15.5 4.5v15M4.5 8.5h15M4.5 15.5h15"})]}),Mr=({size:e})=>(0,S.jsx)(Z,{size:e,children:(0,S.jsx)("path",{d:"M4.5 6.5h15M12 6.5v12"})}),Or=({size:e})=>(0,S.jsx)(Z,{size:e,children:(0,S.jsx)("path",{d:"M4 9.5h9.5a5.5 5.5 0 0 1 0 11H9M4 9.5l4-4M4 9.5l4 4"})}),jr=({size:e})=>(0,S.jsx)(Z,{size:e,children:(0,S.jsx)("path",{d:"M20 9.5h-9.5a5.5 5.5 0 0 0 0 11H15M20 9.5l-4-4M20 9.5l-4 4"})}),Fr=({size:e})=>(0,S.jsxs)(Z,{size:e,children:[(0,S.jsx)("path",{d:"M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12Z"}),(0,S.jsx)("circle",{cx:"12",cy:"12",r:"2.6"})]}),_r=({size:e})=>(0,S.jsxs)(Z,{size:e,children:[(0,S.jsx)("path",{d:"M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12Z"}),(0,S.jsx)("path",{d:"M4 4l16 16"})]}),Hr=({size:e})=>(0,S.jsxs)(Z,{size:e,children:[(0,S.jsx)("rect",{x:"5",y:"10.5",width:"14",height:"9.5",rx:"2"}),(0,S.jsx)("path",{d:"M8 10.5V7a4 4 0 0 1 8 0v3.5"})]}),Br=({size:e})=>(0,S.jsxs)(Z,{size:e,children:[(0,S.jsx)("rect",{x:"5",y:"10.5",width:"14",height:"9.5",rx:"2"}),(0,S.jsx)("path",{d:"M8 10.5V7a4 4 0 0 1 7.4-2"})]});var G=require("react/jsx-runtime"),Qt=null;function jo(e){return e===null||typeof e!="object"?!1:typeof{...e}.mountDesignCanvas=="function"}async function Fo(){return Qt??=(async()=>{let e=globalThis.__dshArtifactsRequireAsync;if(typeof e!="function")throw new Error("The canvas loader is unavailable.");let t=await e("./client.canvas.js");if(!jo(t))throw new Error("The canvas engine did not load.");return t})(),Qt.catch(()=>{Qt=null}),Qt}var _o=[{value:"select",label:"canvas.select",icon:(0,G.jsx)(Dr,{size:16})},{value:"hand",label:"canvas.hand",icon:(0,G.jsx)(Pr,{size:16})},{value:"frame",label:"canvas.frame",icon:(0,G.jsx)(Lr,{size:16})},{value:"text",label:"canvas.text",icon:(0,G.jsx)(Mr,{size:16})}];function Vr({t:e,source:t,revision:a,title:r,mode:n,onChange:o,onSave:i,onFailure:s,onHandle:d,onSelection:l,attempt:h,fallback:x}){let b=(0,be.useRef)(null),p=(0,be.useRef)(null),u=(0,be.useRef)(t),y=(0,be.useRef)({onChange:o,onSave:i,onFailure:s,onHandle:d,onSelection:l});y.current={onChange:o,onSave:i,onFailure:s,onHandle:d,onSelection:l};let[g,P]=(0,be.useState)({status:"loading"}),[w,T]=(0,be.useState)(null);(0,be.useEffect)(()=>{let z=b.current;if(z===null)return;let H=!1,W=null;return P({status:"loading"}),T(null),(async()=>{try{let F=await Fo();if(H)return;let L=await F.mountDesignCanvas({element:z,source:u.current,mode:n,onChange:I=>{u.current=I,y.current.onChange(I)},onSave:()=>y.current.onSave(),onFailure:I=>{P({status:"failed"}),y.current.onFailure(I)},t:e});if(H){L.destroy();return}p.current=L,y.current.onFailure(null),y.current.onHandle(L),P({status:"ready"});let v=L.getSnapshot();T(v),y.current.onSelection(v.selection),W=L.subscribe(I=>{T(I),y.current.onSelection(I.selection)})}catch(F){H||(P({status:"failed"}),y.current.onFailure(F instanceof Error?F.message:String(F)))}})(),()=>{H=!0,W?.(),p.current?.destroy(),p.current=null,y.current.onHandle(null)}},[h]),(0,be.useEffect)(()=>{let z=p.current;z===null||t===u.current||(u.current=t,z.setSource(t))},[a,t]),(0,be.useEffect)(()=>{p.current?.setMode(n)},[n]);let A=g.status==="ready",j=_o.map(z=>(0,G.jsx)(Se.Tooltip,{label:e(z.label),side:"top",portal:!0,children:(0,G.jsx)(Se.Button,{size:"sm",className:"art-dock-button","aria-label":e(z.label),"aria-pressed":w?.tool===z.value,onClick:()=>p.current?.setTool(z.value),children:z.icon})},z.value));return(0,G.jsx)("div",{className:"art-canvas",children:(0,G.jsxs)("div",{className:"art-canvas-stage",children:[(0,G.jsx)("div",{className:"art-canvas-mount",ref:b,role:"application","aria-label":r,tabIndex:0,hidden:g.status==="failed","data-ready":A?"1":void 0}),A?null:(0,G.jsx)("div",{className:"art-canvas-fallback",children:x}),g.status==="loading"?(0,G.jsx)("div",{className:"art-canvas-opening",role:"status",children:e("canvas.opening")}):null,A&&w!==null&&w.rows.length===0?(0,G.jsx)("p",{className:"art-canvas-empty",children:e("canvas.empty")}):null,A?(0,G.jsxs)("div",{className:"art-canvas-dock",role:"toolbar","aria-label":e("canvas.toolbar"),children:[n==="edit"?(0,G.jsxs)(G.Fragment,{children:[j,(0,G.jsx)("span",{className:"art-dock-divider","aria-hidden":"true"}),(0,G.jsx)(Se.Tooltip,{label:e("canvas.undo"),side:"top",portal:!0,children:(0,G.jsx)(Se.Button,{size:"sm",className:"art-dock-button","aria-label":e("canvas.undo"),disabled:w?.canUndo===!1,onClick:()=>p.current?.undo(),children:(0,G.jsx)(Or,{size:16})})}),(0,G.jsx)(Se.Tooltip,{label:e("canvas.redo"),side:"top",portal:!0,children:(0,G.jsx)(Se.Button,{size:"sm",className:"art-dock-button","aria-label":e("canvas.redo"),disabled:w?.canRedo===!1,onClick:()=>p.current?.redo(),children:(0,G.jsx)(jr,{size:16})})}),(0,G.jsx)("span",{className:"art-dock-divider","aria-hidden":"true"})]}):null,(0,G.jsx)(Se.ZoomControls,{className:"art-dock-zoom",zoom:w?.zoom??1,fit:{label:e("canvas.fit"),selected:w?.fit??!1,onSelect:()=>p.current?.zoomToFit()},labels:{controls:e("canvas.zoomControls"),out:e("canvas.zoomOut"),into:e("canvas.zoomIn"),menu:e("canvas.zoomMenu"),value:z=>e("canvas.zoomValue",{percent:z})},visible:A,onZoom:z=>p.current?.setZoom(z),onActiveChange:()=>{}})]}):null]})})}var ye=require("react"),_e=require("@deepseek-ai/dsh-client-ui-primitives");var C=require("react/jsx-runtime"),Ho=["Inter","Roboto","Noto Naskh Arabic"],Bo=[400,500,600,700];function Xt(e){switch(e){case"FRAME":case"SECTION":return(0,C.jsx)(Rr,{size:14});case"TEXT":return(0,C.jsx)(Er,{size:14});case"GROUP":case"COMPONENT":case"COMPONENT_SET":case"INSTANCE":return(0,C.jsx)(Ar,{size:14});default:return(0,C.jsx)(Ir,{size:14})}}function Pa(e,t){switch(t){case"FRAME":return e("layer.type.frame");case"SECTION":return e("layer.type.section");case"TEXT":return e("layer.type.text");case"RECTANGLE":return e("layer.type.rectangle");case"ELLIPSE":return e("layer.type.ellipse");case"LINE":return e("layer.type.line");case"VECTOR":case"STAR":case"POLYGON":return e("layer.type.vector");case"GROUP":return e("layer.type.group");case"COMPONENT":case"COMPONENT_SET":return e("layer.type.component");case"INSTANCE":return e("layer.type.instance");default:return e("layer.type.other")}}function Vo({t:e,label:t,value:a,mixed:r,min:n,max:o,step:i=1,onPreview:s,onCommit:d}){let[l,h]=(0,ye.useState)(""),x=(0,ye.useRef)(!1),b=(0,ye.useRef)(0),p=(0,ye.useRef)(!1),u=(0,ye.useRef)(!1),y=a===null?"":String(a);(0,ye.useEffect)(()=>{x.current||h(a===null?"":String(a))},[a]);let g=()=>h(a===null?"":String(a)),P=()=>{x.current=!1;let w=Number(l);if(l.trim()===""||!Number.isFinite(w)){g(),p.current&&d(b.current,b.current),p.current=!1;return}p.current&&d(w,b.current),p.current=!1};return(0,C.jsxs)("label",{className:"art-inspector-field",children:[(0,C.jsx)("span",{className:"art-inspector-field-label",children:t}),(0,C.jsx)(_e.Input,{className:"art-inspector-input","aria-label":t,type:"number",inputMode:"decimal",min:n,max:o,step:i,value:l,placeholder:r||y===""?e("panel.mixed"):void 0,onFocus:()=>{x.current=!0,b.current=a??0,p.current=!1,h(a===null?"":String(a))},onChange:w=>{let T=w.target.value;h(T);let A=Number(T);T.trim()!==""&&Number.isFinite(A)&&(p.current=!0,s(A))},onBlur:()=>{if(u.current){u.current=!1,x.current=!1,g();return}P()},onKeyDown:w=>{w.key==="Enter"?(w.preventDefault(),w.currentTarget.blur()):w.key==="Escape"&&(w.preventDefault(),g(),p.current&&d(b.current,b.current),p.current=!1,u.current=!0,w.currentTarget.blur())}})]})}function Wo({t:e,handle:t,snapshot:a}){let[r,n]=(0,ye.useState)(null),[o,i]=(0,ye.useState)(""),s=a.rows,d=s.findIndex(p=>p.selected),l=p=>{let u=s[p];u!==void 0&&t.select(u.id,"replace")},h=p=>{i(p.name),n(p.id)},x=p=>{let u=o.trim();n(null),u!==""&&u!==p.name&&t.rename(p.id,u)},b=p=>{let u=d===-1?void 0:s[d];if(p.key==="ArrowDown"){p.preventDefault(),l(d===-1?0:Math.min(d+1,s.length-1));return}if(p.key==="ArrowUp"){p.preventDefault(),l(d===-1?s.length-1:Math.max(d-1,0));return}if(u!==void 0){if(p.key==="ArrowLeft"){if(p.preventDefault(),u.hasChildren&&u.expanded){t.toggleExpand(u.id);return}for(let y=d-1;y>=0;y-=1)if(s[y].level<u.level){t.select(s[y].id,"replace");return}return}if(p.key==="ArrowRight"){if(p.preventDefault(),u.hasChildren&&!u.expanded)t.toggleExpand(u.id);else{let y=s[d+1];y!==void 0&&y.level>u.level&&t.select(y.id,"replace")}return}p.key==="Enter"&&(p.preventDefault(),h(u))}};return s.length===0?(0,C.jsx)("p",{className:"art-inspector-empty",children:e("panel.none")}):(0,C.jsx)("div",{className:"art-layer-tree",role:"tree","aria-label":e("panel.layers"),tabIndex:0,onKeyDown:b,children:s.map(p=>(0,C.jsxs)("div",{className:"art-layer-row"+(p.selected?" is-selected":""),"data-layer-id":p.id,role:"treeitem","aria-level":p.level,"aria-selected":p.selected,"aria-expanded":p.hasChildren?p.expanded:void 0,style:{paddingInlineStart:(p.level-1)*14+6},onClick:u=>{u.shiftKey?t.select(p.id,"range"):u.metaKey||u.ctrlKey?t.select(p.id,"add"):t.select(p.id,"replace")},onDoubleClick:()=>h(p),children:[p.hasChildren?(0,C.jsx)("button",{type:"button",className:"art-layer-caret","aria-label":e(p.expanded?"panel.collapse":"panel.expand"),onClick:u=>{u.stopPropagation(),t.toggleExpand(p.id)},children:p.expanded?(0,C.jsx)(_e.IconChevronDownOutlineRegular,{size:12}):(0,C.jsx)(_e.IconChevronRightOutlineRegular,{size:12})}):(0,C.jsx)("span",{className:"art-layer-caret","aria-hidden":"true"}),(0,C.jsx)("span",{className:"art-layer-icon","aria-hidden":"true",children:Xt(p.type)}),r===p.id?(0,C.jsx)("input",{className:"art-layer-rename","aria-label":e("panel.rename"),autoFocus:!0,value:o,onChange:u=>i(u.target.value),onClick:u=>u.stopPropagation(),onBlur:()=>x(p),onKeyDown:u=>{u.key==="Enter"?(u.preventDefault(),x(p)):u.key==="Escape"&&(u.preventDefault(),n(null))}}):(0,C.jsx)("span",{className:"art-layer-name",title:p.name,children:p.name}),(0,C.jsxs)("span",{className:"art-layer-actions",children:[(0,C.jsx)("button",{type:"button",className:"art-layer-action","aria-label":e(p.visible?"panel.hide":"panel.show"),"aria-pressed":!p.visible,onClick:u=>{u.stopPropagation(),t.toggleVisibility(p.id)},children:p.visible?(0,C.jsx)(Fr,{size:13}):(0,C.jsx)(_r,{size:13})}),(0,C.jsx)("button",{type:"button",className:"art-layer-action","aria-label":e(p.locked?"panel.unlock":"panel.lock"),"aria-pressed":p.locked,onClick:u=>{u.stopPropagation(),t.toggleLock(p.id)},children:p.locked?(0,C.jsx)(Hr,{size:13}):(0,C.jsx)(Br,{size:13})})]})]},p.id))})}function Uo({t:e,handle:t,snapshot:a}){let r=a.properties;if(r.ids.length===0)return(0,C.jsx)("p",{className:"art-inspector-empty",children:e("panel.selectLayerHint")});let n=(o,i,s,d={})=>(0,C.jsx)(Vo,{t:e,label:i,value:s,mixed:s===null,...d,onPreview:l=>t.preview(o,l),onCommit:(l,h)=>t.commit(o,l,h)});return(0,C.jsxs)("div",{className:"art-inspector-properties",children:[(0,C.jsxs)("div",{className:"art-inspector-node",children:[(0,C.jsx)("span",{className:"art-inspector-node-icon","aria-hidden":"true",children:Xt(r.type??"")}),(0,C.jsx)("span",{className:"art-inspector-node-name",title:r.name??"",children:r.name}),(0,C.jsx)("span",{className:"art-inspector-node-type",children:Pa(e,r.type??"")})]}),(0,C.jsxs)("section",{className:"art-inspector-group",children:[(0,C.jsx)("h3",{className:"art-inspector-heading",children:e("panel.positionSize")}),(0,C.jsxs)("div",{className:"art-inspector-grid",children:[n("x",e("panel.x"),r.x),n("y",e("panel.y"),r.y),n("width",e("panel.w"),r.width,{min:1}),n("height",e("panel.h"),r.height,{min:1}),n("rotation",e("panel.rotation"),r.rotation),n("radius",e("panel.radius"),r.radius,{min:0})]})]}),(0,C.jsxs)("section",{className:"art-inspector-group",children:[(0,C.jsx)("h3",{className:"art-inspector-heading",children:e("panel.appearance")}),(0,C.jsxs)("div",{className:"art-inspector-appearance",children:[n("opacity",e("panel.opacity"),r.opacity,{min:0,max:100}),(0,C.jsxs)("label",{className:"art-inspector-switch",children:[(0,C.jsx)("span",{className:"art-inspector-field-label",children:e("panel.visible")}),(0,C.jsx)(_e.Switch,{checked:r.visible===!0,label:e("panel.visible"),onChange:o=>t.setVisible(o)})]})]})]}),a.isText&&r.text!==null?(0,C.jsxs)("section",{className:"art-inspector-group",children:[(0,C.jsx)("h3",{className:"art-inspector-heading",children:e("panel.text")}),(0,C.jsxs)("div",{className:"art-inspector-grid",children:[(0,C.jsxs)("label",{className:"art-inspector-field",children:[(0,C.jsx)("span",{className:"art-inspector-field-label",children:e("panel.family")}),(0,C.jsx)("select",{className:"art-inspector-select","aria-label":e("panel.family"),value:r.text.family,onChange:o=>t.setFamily(o.target.value),children:Ho.map(o=>(0,C.jsx)("option",{value:o,children:o},o))})]}),(0,C.jsxs)("label",{className:"art-inspector-field",children:[(0,C.jsx)("span",{className:"art-inspector-field-label",children:e("panel.weight")}),(0,C.jsx)("select",{className:"art-inspector-select","aria-label":e("panel.weight"),value:String(r.text.weight),onChange:o=>t.setWeight(Number(o.target.value)),children:Bo.map(o=>(0,C.jsx)("option",{value:String(o),children:String(o)},o))})]}),n("fontSize",e("panel.fontSize"),r.text.fontSize,{min:1})]})]}):(0,C.jsx)("p",{className:"art-inspector-hint",children:e("panel.selectTextHint")})]})}function Wr({t:e,handle:t,snapshot:a,tab:r}){return t===null||a===null?(0,C.jsx)("p",{className:"art-inspector-empty",children:e("canvas.opening")}):r==="layers"?(0,C.jsx)(Wo,{t:e,handle:t,snapshot:a}):(0,C.jsx)(Uo,{t:e,handle:t,snapshot:a})}var St=require("react"),Ur=require("@deepseek-ai/dsh-client-ui-primitives");var me=require("react/jsx-runtime");function La({t:e,where:t,id:a,version:r,title:n}){let[o,i]=(0,St.useState)({status:"loading"}),[s,d]=(0,St.useState)(0);if((0,St.useEffect)(()=>{let h=new AbortController;return i({status:"loading"}),_.preview(t,a,r,h.signal).then(x=>{h.signal.aborted||i({status:"ready",preview:x})}).catch(x=>{h.signal.aborted||i({status:"failed",message:vr(e,x)})}),()=>h.abort()},[t.scope,t.workspaceId,a,r,s,e]),o.status==="loading")return(0,me.jsx)("div",{className:"art-design-state",role:"status","aria-busy":"true",children:e("preview.loading")});if(o.status==="failed")return(0,me.jsxs)("div",{className:"art-design-state",role:"alert",children:[(0,me.jsx)("span",{className:"art-design-error",children:o.message}),(0,me.jsx)(Ur.Button,{size:"sm",variant:"outline",onClick:()=>d(h=>h+1),children:e("preview.retry")})]});let{preview:l}=o;return(0,me.jsxs)("div",{className:"art-design-preview",children:[(0,me.jsx)("div",{className:"art-design-canvas",children:(0,me.jsx)("img",{className:"art-design-image",src:`data:${l.mediaType};base64,${l.data}`,alt:n,width:l.width,height:l.height})}),l.info.warnings.length===0?null:(0,me.jsxs)("div",{className:"art-design-warnings",role:"note",children:[(0,me.jsx)("span",{className:"art-design-warnings-title",children:e("preview.warnings")}),(0,me.jsx)("ul",{children:l.info.warnings.map(h=>(0,me.jsx)("li",{children:h},h))})]})]})}var J=require("react"),Gr=require("@deepseek-ai/dsh-client-ui-primitives");var Te=require("react/jsx-runtime"),Tt=null;function Go(){if(Tt===null){let e=globalThis.__dshArtifactsRequireAsync;if(typeof e!="function")return Promise.reject(new Error("The document editor loader is unavailable."));Tt=e("./client.doc.js"),Tt.catch(()=>{Tt=null})}return Tt}var $o=["heading","bold","italic","bulletList","orderedList","codeBlock"];function Ko(e){let t=window.getSelection(),a=e.getBoundingClientRect(),n=(t!==null&&t.rangeCount>0?t.getRangeAt(0):null)?.getBoundingClientRect();if(n===void 0||n.width===0&&n.height===0)return{top:e.scrollTop+8,left:16};let o=Math.min(Math.max(n.left-a.left+n.width/2,120),Math.max(a.width-120,120));return{top:Math.max(n.top-a.top+e.scrollTop-46,e.scrollTop+4),left:o}}function Jt({markdown:e,revision:t,editable:a,label:r,loadingLabel:n,failedLabel:o,onChange:i,onSave:s,onSelectionText:d,t:l,design:h,dark:x=!1,selectionAction:b}){let p=(0,J.useRef)(null),u=(0,J.useRef)(null),y=(0,J.useRef)(null),g=(0,J.useRef)(i);g.current=i;let P=(0,J.useRef)(d);P.current=d;let w=(0,J.useRef)({markdown:e,editable:a,label:r});w.current={markdown:e,editable:a,label:r};let[T,A]=(0,J.useState)([]),[j,z]=(0,J.useState)("loading"),[H,W]=(0,J.useState)(null),F=(0,J.useRef)(null);(0,J.useLayoutEffect)(()=>{let D=F.current,$=p.current;if(D===null||$===null||H===null)return;let R=D.offsetWidth/2,X=$.clientWidth,Qe=R*2+16>=X?X/2:Math.min(Math.max(H.left,R+8),X-R-8);D.style.left=Qe+"px"});let L=(0,J.useMemo)(()=>h===void 0?{}:{...Ut(h,x),colorScheme:x?"dark":"light"},[h,x]),v=D=>{P.current?.(D);let $=p.current;W(D===""||$===null?null:Ko($))},I=(0,J.useRef)(v);I.current=v,(0,J.useEffect)(()=>{let D=!1;return Go().then($=>{D||u.current===null||(y.current=$.mountDocEditor({element:u.current,...w.current,onChange:R=>g.current(R),onSelectionChange:A,onSelectionText:R=>I.current(R)}),z("ready"))}).catch(()=>{D||z("failed")}),()=>{D=!0,y.current?.destroy(),y.current=null}},[]),(0,J.useEffect)(()=>{let D=y.current;D!==null&&D.getMarkdown()!==e&&D.setMarkdown(e)},[t,e]),(0,J.useEffect)(()=>{y.current?.setEditable(a)},[a]),(0,J.useEffect)(()=>{let D=()=>{let $=y.current,R=p.current,X=window.getSelection();$===null||R===null||X!==null&&X.anchorNode!==null&&!R.contains(X.anchorNode)||I.current($.getSelectionText())};return document.addEventListener("selectionchange",D),()=>document.removeEventListener("selectionchange",D)},[]);let Q=H!==null&&l!==void 0&&(a||b!=null);return(0,Te.jsxs)("div",{className:"art-doc",ref:p,"data-doc-revision":t,onKeyDown:D=>{(D.ctrlKey||D.metaKey)&&D.key.toLowerCase()==="s"&&(D.preventDefault(),s()),D.key==="Escape"&&H!==null&&W(null)},children:[Q?(0,Te.jsxs)("div",{ref:F,className:"art-doc-toolbar",role:"toolbar","aria-label":l("format.toolbar"),style:{top:H.top,left:H.left},children:[a?$o.map(D=>(0,Te.jsx)(Gr.Button,{size:"sm",variant:"ghost","aria-pressed":T.includes(D),disabled:j!=="ready",onMouseDown:$=>$.preventDefault(),onClick:()=>y.current?.format(D),children:l(`format.${D}`)},D)):null,a&&b!=null?(0,Te.jsx)("span",{className:"art-doc-toolbar-gap","aria-hidden":"true"}):null,b]}):null,j==="loading"?(0,Te.jsx)("p",{className:"art-note",children:n}):null,j==="failed"?(0,Te.jsx)("p",{className:"art-note",children:o}):null,(0,Te.jsx)("div",{className:"art-docpage",style:L,children:(0,Te.jsx)("div",{className:"art-doc-mount",ref:u})})]})}function*$r(e){let t=e.toLowerCase(),a=new Set(["script","style","textarea","title","template","noscript"]),r=0;for(;r<e.length;){let n=e.indexOf("<",r);if(n<0)return;if(e.startsWith("<!--",n)){let l=e.indexOf("-->",n+4);if(l<0)return;r=l+3;continue}let o=n+1,i="";for(;o<e.length;o++){let l=e[o];if(i!=="")l===i&&(i="");else if(l==='"'||l==="'")i=l;else if(l===">")break}if(o===e.length)return;r=o+1;let s=e.slice(n,r),d=/^<([a-z][a-z0-9:-]*)(?=\s|\/?>)/i.exec(s)?.[1]?.toLowerCase();if(d!==void 0&&(yield{name:d,text:s},a.has(d))){let l=t.indexOf("</"+d,r);if(l<0)return;let h=e.indexOf(">",l);if(h<0)return;r=h+1}}}var Kr=["*, *::before, *::after { box-sizing: border-box; }","[hidden] { display: none !important; }","html { background: var(--artifact-color-background); -webkit-text-size-adjust: 100%; }","body { margin: 0; color: var(--artifact-color-text); font: var(--artifact-font-size-2)/1.6 var(--artifact-font-family); overflow-wrap: anywhere; }","::selection { background: color-mix(in srgb, var(--artifact-color-action) 26%, transparent); }",":focus-visible { outline: 2px solid var(--artifact-color-focus); outline-offset: 2px; }",":where(h1, h2, h3, h4):not(:where(.ak-demo, .ak-demo *)) { margin: 0; font-family: var(--artifact-font-display); font-weight: 600; line-height: 1.2; text-wrap: balance; }",":where(h1):not(:where(.ak-demo, .ak-demo *)) { font-size: clamp(1.9rem, 5vw, 2.6rem); letter-spacing: -0.02em; }",":where(h2):not(:where(.ak-demo, .ak-demo *)) { font-size: clamp(1.35rem, 3.2vw, 1.75rem); letter-spacing: -0.01em; }",":where(h3):not(:where(.ak-demo, .ak-demo *)) { font-size: var(--artifact-font-size-3); }",":where(h4):not(:where(.ak-demo, .ak-demo *)) { font-size: var(--artifact-font-size-2); }",":where(p, ul, ol, dl, figure, blockquote):not(:where(.ak-demo, .ak-demo *)) { margin: 0; }",":where(a):not(:where(.ak-demo, .ak-demo *)) { color: var(--artifact-color-primary); text-underline-offset: 0.2em; }",":where(code, kbd, samp, pre):not(:where(.ak-demo, .ak-demo *)) { font-family: var(--artifact-font-mono); font-size: 0.92em; }",":where(:not(pre) > code):not(:where(.ak-demo, .ak-demo *)) { padding: 0.1em 0.35em; border-radius: var(--artifact-radius-sm); background: color-mix(in srgb, var(--artifact-color-text) 7%, transparent); }","button, input, select, textarea { font: inherit; color: inherit; }","img { max-width: 100%; height: auto; }",".ak-page { display: grid; gap: var(--artifact-space-6); width: min(100% - 2 * var(--artifact-space-4), 72rem); margin-inline: auto; padding-block: var(--artifact-space-5) var(--artifact-space-6); }",".ak-page--narrow { width: min(100% - 2 * var(--artifact-space-4), 48rem); }",".ak-page > * { min-width: 0; }",".ak-header { display: grid; gap: var(--artifact-space-3); padding-bottom: var(--artifact-space-5); border-bottom: 1px solid var(--artifact-color-border); }",".ak-eyebrow { color: var(--artifact-color-muted); font-size: var(--artifact-font-size-1); font-weight: 600; letter-spacing: 0.01em; }",".ak-lede { max-width: 60ch; color: var(--artifact-color-muted); font-size: calc((var(--artifact-font-size-2) + var(--artifact-font-size-3)) / 2); line-height: 1.5; }",".ak-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--artifact-space-1) var(--artifact-space-3); padding: 0; list-style: none; color: var(--artifact-color-muted); font-size: var(--artifact-font-size-1); }",".ak-section { display: grid; gap: var(--artifact-space-4); scroll-margin-top: var(--artifact-space-4); }",".ak-section__head { display: grid; gap: var(--artifact-space-1); }",".ak-section__head p { max-width: 68ch; color: var(--artifact-color-muted); }",".ak-prose { display: grid; gap: var(--artifact-space-3); }",".ak-prose > *, .ak-section > p, .ak-section > ul, .ak-section > ol { max-width: 68ch; }",".ak-prose ul, .ak-prose ol, .ak-section > ul, .ak-section > ol { display: grid; gap: var(--artifact-space-1); padding-left: 1.3em; }",".ak-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: var(--artifact-space-4); }",".ak-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: var(--artifact-space-4); align-items: start; }",".ak-card { display: grid; align-content: start; gap: var(--artifact-space-2); padding: var(--artifact-space-4); border: 1px solid var(--artifact-color-border); border-radius: var(--artifact-radius-lg); background: var(--artifact-color-surface); }",".ak-muted { color: var(--artifact-color-muted); }",".ak-small { font-size: var(--artifact-font-size-1); }",".ak-num { font-family: var(--artifact-font-mono); font-variant-numeric: tabular-nums; }",".ak-callout { --ak-tone: var(--artifact-color-accent); display: grid; gap: var(--artifact-space-1); padding: var(--artifact-space-3) var(--artifact-space-4); border-left: 3px solid var(--ak-tone); border-radius: 0 var(--artifact-radius-md) var(--artifact-radius-md) 0; background: var(--artifact-color-raised); }",".ak-callout__title { font-weight: 650; }",".ak-callout--info { --ak-tone: var(--artifact-color-focus); }",".ak-callout--success { --ak-tone: var(--artifact-color-success); }",".ak-callout--warning { --ak-tone: var(--artifact-color-warning); }",".ak-callout--danger { --ak-tone: var(--artifact-color-danger); }",".ak-badge { --ak-tone: var(--artifact-color-muted); display: inline-flex; align-items: center; gap: 0.4em; padding: 0.1em 0.6em; border: 1px solid color-mix(in srgb, var(--ak-tone) 45%, transparent); border-radius: 999px; color: var(--ak-tone); font-size: var(--artifact-font-size-1); font-weight: 600; line-height: 1.5; white-space: nowrap; }",'.ak-badge::before { content: ""; flex: none; width: 0.45em; height: 0.45em; border-radius: 50%; background: currentColor; }',".ak-badge--plain::before { display: none; }",".ak-badge--info { --ak-tone: var(--artifact-color-focus); }",".ak-badge--success { --ak-tone: var(--artifact-color-success); }",".ak-badge--warning { --ak-tone: var(--artifact-color-warning); }",".ak-badge--danger { --ak-tone: var(--artifact-color-danger); }",".ak-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: var(--artifact-space-3); }",".ak-facts > div { display: grid; gap: 2px; padding-top: var(--artifact-space-2); border-top: 1px solid var(--artifact-color-border); }",".ak-facts dt { color: var(--artifact-color-muted); font-size: var(--artifact-font-size-1); }",".ak-facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }",".ak-table { max-width: 100%; overflow-x: auto; border: 1px solid var(--artifact-color-border); border-radius: var(--artifact-radius-md); background: var(--artifact-color-surface); }",".ak-table table { width: 100%; border-collapse: collapse; font-size: var(--artifact-font-size-1); font-variant-numeric: tabular-nums; }",".ak-table caption { padding: var(--artifact-space-3) var(--artifact-space-3) var(--artifact-space-2); color: var(--artifact-color-muted); text-align: left; }",".ak-table caption strong { color: var(--artifact-color-text); }",".ak-table th, .ak-table td { padding: var(--artifact-space-2) var(--artifact-space-3); border-top: 1px solid var(--artifact-color-border); text-align: left; vertical-align: top; }",".ak-table thead th { background: var(--artifact-color-raised); color: var(--artifact-color-muted); font-weight: 600; }",".ak-table tbody th { font-weight: 600; }","@media (max-width: 640px) {"," .ak-table--stack table, .ak-table--stack caption, .ak-table--stack tbody, .ak-table--stack tr, .ak-table--stack th, .ak-table--stack td { display: block; }"," .ak-table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }"," .ak-table--stack tr { padding: var(--artifact-space-2) 0; border-top: 1px solid var(--artifact-color-border); }"," .ak-table--stack th, .ak-table--stack td { padding: var(--artifact-space-1) var(--artifact-space-3); border: 0; }"," .ak-table--stack td[data-label]::before { content: attr(data-label); display: block; color: var(--artifact-color-muted); font-size: var(--artifact-font-size-0); font-weight: 600; }","}",".ak-code { display: grid; overflow: hidden; border: 1px solid var(--artifact-color-border); border-radius: var(--artifact-radius-md); background: var(--artifact-color-surface); }",".ak-code figcaption { padding: var(--artifact-space-1) var(--artifact-space-3); border-bottom: 1px solid var(--artifact-color-border); color: var(--artifact-color-muted); font: 600 var(--artifact-font-size-0)/1.6 var(--artifact-font-mono); }",".ak-code pre { margin: 0; padding: var(--artifact-space-3); overflow-x: auto; font-size: var(--artifact-font-size-1); line-height: 1.55; tab-size: 2; }",".ak-steps { display: grid; gap: var(--artifact-space-3); padding: 0; list-style: none; counter-reset: ak-step; }",".ak-steps > li { position: relative; display: grid; gap: var(--artifact-space-1); min-height: 2rem; padding-left: 2.75rem; counter-increment: ak-step; }",".ak-steps > li::before { content: counter(ak-step); position: absolute; top: 0; left: 0; display: grid; place-items: center; width: 2rem; height: 2rem; border: 1px solid var(--artifact-color-border); border-radius: 50%; background: var(--artifact-color-raised); font: 600 var(--artifact-font-size-1)/1 var(--artifact-font-mono); }",".ak-decision { display: grid; gap: var(--artifact-space-2); padding: var(--artifact-space-4); border: 1px solid var(--artifact-color-border); border-radius: var(--artifact-radius-lg); background: var(--artifact-color-surface); }",".ak-decision__pick { padding: var(--artifact-space-2) var(--artifact-space-3); border-radius: var(--artifact-radius-md); background: color-mix(in srgb, var(--artifact-color-success) 10%, var(--artifact-color-surface)); }",".ak-quote { display: grid; gap: var(--artifact-space-1); max-width: 68ch; padding-left: var(--artifact-space-4); border-left: 3px solid var(--artifact-color-border); }",".ak-quote p { font-family: var(--artifact-font-display); font-size: calc((var(--artifact-font-size-2) + var(--artifact-font-size-3)) / 2); }",".ak-quote cite { color: var(--artifact-color-muted); font-size: var(--artifact-font-size-1); font-style: normal; }",".ak-switch { display: grid; gap: var(--artifact-space-3); }",".ak-switch > * { min-width: 0; }",".ak-switch__bar { display: inline-flex; flex-wrap: wrap; justify-self: start; gap: 2px; padding: 2px; border: 1px solid var(--artifact-color-border); border-radius: var(--artifact-radius-md); background: var(--artifact-color-raised); }",".ak-switch__bar button { min-height: 36px; padding: 0 var(--artifact-space-3); border: 0; border-radius: max(0px, calc(var(--artifact-radius-md) - 2px)); background: transparent; color: var(--artifact-color-muted); font-size: var(--artifact-font-size-1); font-weight: 600; cursor: pointer; }",'.ak-switch__bar button[aria-pressed="true"] { background: var(--artifact-color-surface); color: var(--artifact-color-text); box-shadow: 0 0 0 1px var(--artifact-color-control); text-decoration: underline; text-underline-offset: 0.2em; }',".ak-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: var(--artifact-space-4); }",".ak-compare > * { display: grid; align-content: start; gap: var(--artifact-space-2); min-width: 0; }",".ak-compare__label { color: var(--artifact-color-muted); font-size: var(--artifact-font-size-1); font-weight: 600; }",".ak-frame { display: grid; overflow: hidden; border: 1px solid var(--artifact-color-border); border-radius: var(--artifact-radius-lg); background: var(--artifact-color-surface); box-shadow: 0 1px 3px color-mix(in srgb, var(--artifact-color-text) 10%, transparent); }",".ak-frame__bar { display: flex; align-items: center; gap: var(--artifact-space-2); min-height: 34px; padding: 0 var(--artifact-space-3); overflow: hidden; border-bottom: 1px solid var(--artifact-color-border); background: var(--artifact-color-raised); color: var(--artifact-color-muted); font: var(--artifact-font-size-0)/1.4 var(--artifact-font-mono); white-space: nowrap; text-overflow: ellipsis; }",'.ak-frame__bar::before { content: ""; flex: none; width: 34px; height: 8px; background: radial-gradient(circle, var(--artifact-color-control) 3px, transparent 3.5px) 0 50% / 13px 8px repeat-x; opacity: 0.55; }',".ak-frame__body { min-width: 0; overflow: auto; }",".ak-frame__caption { padding: var(--artifact-space-2) var(--artifact-space-3); border-top: 1px solid var(--artifact-color-border); color: var(--artifact-color-muted); font-size: var(--artifact-font-size-1); }",".ak-demo { color: var(--demo-text, var(--artifact-color-text)); background: var(--demo-bg, transparent); font-family: var(--demo-font, var(--artifact-font-family)); }",".ak-demo { font-size: var(--demo-font-size, 16px); line-height: var(--demo-line-height, 1.5); }",":where(.ak-demo h1, .ak-demo h2, .ak-demo h3, .ak-demo h4, .ak-demo a, .ak-demo code, .ak-demo pre) { font: inherit; color: inherit; letter-spacing: normal; }",".ak-button { display: inline-flex; align-items: center; justify-content: center; gap: var(--artifact-space-1); min-height: 40px; padding: 0 var(--artifact-space-3); border: 1px solid var(--artifact-color-control); border-radius: var(--artifact-radius-sm); background: var(--artifact-color-surface); color: var(--artifact-color-text); font-size: var(--artifact-font-size-1); font-weight: 600; cursor: pointer; }",".ak-button:hover:not(:disabled) { border-color: var(--artifact-color-text); }",".ak-button--primary { border-color: var(--artifact-color-action); background: var(--artifact-color-action); color: var(--artifact-color-action-text); }",".ak-button--primary:hover:not(:disabled) { border-color: var(--artifact-color-action); background: color-mix(in srgb, var(--artifact-color-action) 88%, var(--artifact-color-text)); }",".ak-button:disabled { opacity: 0.5; cursor: not-allowed; }",".ak-actions { display: flex; flex-wrap: wrap; gap: var(--artifact-space-2); }",".ak-field { display: grid; gap: var(--artifact-space-1); font-size: var(--artifact-font-size-1); font-weight: 600; }",".ak-input { width: 100%; min-width: 0; min-height: 40px; padding: var(--artifact-space-1) var(--artifact-space-2); border: 1px solid var(--artifact-color-control); border-radius: var(--artifact-radius-sm); background: var(--artifact-color-surface); font-weight: 400; }",".ak-input::placeholder { color: var(--artifact-color-muted); opacity: 1; }",'.ak-input[aria-invalid="true"] { border-color: var(--artifact-color-danger); }',".ak-footer { padding-top: var(--artifact-space-4); border-top: 1px solid var(--artifact-color-border); color: var(--artifact-color-muted); font-size: var(--artifact-font-size-1); }","@media (prefers-reduced-motion: no-preference) { .ak-button, .ak-switch__bar button { transition: background-color 0.15s ease, border-color 0.15s ease; } }","@media print { .ak-switch__bar { display: none; } .ak-switch [data-ak-panel][hidden] { display: grid !important; } .ak-page { width: auto; } }"].join(`
|
|
22
|
-
`),
|
|
23
|
-
`);function
|
|
21
|
+
`)}function Gt(e,t){let a=t?e.colorsDark:e.colors,r={"--artifact-font-family":e.typography.fontFamily,"--artifact-font-display":e.typography.displayFamily,"--artifact-font-mono":e.typography.monoFamily};for(let n of $e)r[Ra(n)]=a[n];e.typography.scale.forEach((n,o)=>{r[`--artifact-font-size-${o}`]=`${n}px`}),e.spacing.scale.forEach((n,o)=>{r[`--artifact-space-${o}`]=`${n}px`});for(let[n,o]of Object.entries(e.radius))r[`--artifact-radius-${n}`]=`${o}px`;return r}var Uo=/^ds_[a-z0-9]{16}$/,$o=/^sha256:[a-f0-9]{64}$/;function Ut(e){if(e===null||typeof e!="object")return!1;let t={...e};return typeof t.id=="string"&&Uo.test(t.id)&&typeof t.revision=="number"&&Number.isSafeInteger(t.revision)&&t.revision>0&&(t.scope==="workspace"||t.scope==="library")&&typeof t.name=="string"&&t.name.length>0&&t.name.length<=80}function $t(e){if(e===null||typeof e!="object")return!1;let t={...e};return typeof t.hash=="string"&&$o.test(t.hash)&&typeof t.bytes=="number"&&Number.isSafeInteger(t.bytes)&&t.bytes>0&&t.bytes<=65536&&(t.system===null||Ut(t.system))&&(t.recipe===null||typeof t.recipe=="string"&&yr.test(t.recipe))&&(t.kit===null||typeof t.kit=="string"&&t.kit.length<=20)}var Ko="/artifacts-rpc",Ke=class extends Error{code;details;constructor(t,a,r){super(a),this.name="ArtifactCallError",this.code=t,this.details=r}},Da=null;function kr(e){Da=e}async function ne(e,t,a,r){if(Da===null)throw new Ke("artifact/not-ready","The artifact channel is not ready.",{});let n=await Da.rpc.call(Ko,e,t,r);if(!n.ok)throw new Ke(n.error.code,n.error.message,n.error.details);if(!a(n.value))throw new Ke("artifact/bad-response",`The ${e} response has an unexpected shape.`,{});return n.value}function le(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function qo(e){return le(e)&&Array.isArray(e.items)&&e.items.every(Wt)&&typeof e.total=="number"&&typeof e.hasMore=="boolean"}function Yo(e){return le(e)&&Wt(e.manifest)&&typeof e.content=="string"&&typeof e.version=="number"&&typeof e.designCss=="string"&&Sr(e.design)&&(e.generation===void 0||$t(e.generation))&&(e.designInfo===void 0||Aa(e.designInfo))}function bt(e){return le(e)&&Wt(e.manifest)}function Xo(e){return le(e)&&typeof e.version=="number"&&typeof e.createdAt=="string"&&typeof e.contentHash=="string"&&typeof e.contentBytes=="number"&&Ea(e.source)&&(e.generation===void 0||$t(e.generation))}function Qo(e){return le(e)&&Array.isArray(e.versions)&&e.versions.every(Xo)}function Jo(e){return le(e)&&e.trashed===!0&&typeof e.trashPath=="string"}function Zo(e){return le(e)&&typeof e.path=="string"&&typeof e.bytes=="number"&&typeof e.fileName=="string"&&typeof e.mediaType=="string"&&typeof e.data=="string"}function ei(e){return le(e)&&typeof e.html=="string"}function ti(e){return le(e)&&typeof e.mediaType=="string"&&typeof e.data=="string"&&typeof e.width=="number"&&typeof e.height=="number"&&Aa(e.info)}function Sr(e){return le(e)&&e.schemaVersion===1&&typeof e.name=="string"&&le(e.colors)&&le(e.colorsDark)&&le(e.typography)&&le(e.spacing)&&le(e.radius)}function yt(e){return le(e)&&Sr(e.tokens)&&(e.source==="workspace"||e.source==="library"||e.source==="default")&&typeof e.css=="string"&&(e.system===void 0||Ut(e.system))}function ai(e){return le(e)&&(e.scope==="workspace"||e.scope==="library")&&typeof e.revision=="number"&&Number.isSafeInteger(e.revision)&&e.revision>=0&&(e.defaultId===null||typeof e.defaultId=="string")&&Array.isArray(e.systems)&&e.systems.every(Ut)}function pe(e){return{scope:e.scope,...e.workspaceId===null?{}:{workspaceId:e.workspaceId}}}var B={list:(e,t,a)=>ne("list",{...pe(e),...t},qo,a),get:(e,t,a,r)=>ne("get",{...pe(e),id:t,...a===void 0?{}:{version:a}},Yo,r),create:(e,t,a,r)=>ne("create",{...pe(e),type:t,title:a,content:r},bt),update:(e,t,a,r,n)=>ne("update",{...pe(e),id:t,baseVersion:a,content:r,...n===void 0?{}:{title:n}},bt),rename:(e,t,a,r)=>ne("update",{...pe(e),id:t,baseVersion:a,title:r},bt),remove:(e,t)=>ne("delete",{...pe(e),id:t},Jo),history:(e,t,a)=>ne("history",{...pe(e),id:t},Qo,a),restore:(e,t,a,r)=>ne("restore",{...pe(e),id:t,version:a,baseVersion:r},bt),exportFile:(e,t,a,r)=>ne("export",{...pe(e),id:t,format:a,version:r},Zo),printable:(e,t,a)=>ne("printable",{...pe(e),id:t,version:a},ei),preview:(e,t,a,r)=>ne("preview",{...pe(e),id:t,...a===void 0?{}:{version:a}},ti,r),designSystem:(e,t)=>ne("designSystem",e===null?{}:{workspaceId:e},yt,t),selectedDesign:(e,t={},a)=>ne("designSystem",{...pe(e),systemId:t.systemId,systemScope:t.systemScope,systemRevision:t.revision},yt,a),designSystems:(e,t)=>ne("designSystems",pe(e),ai,t),saveDesignSystem:(e,t,a)=>ne("saveDesignSystem",{...pe(e),tokens:t,...a},yt),setDesignDefault:(e,t,a)=>ne("setDesignDefault",{...pe(e),systemId:t,expectedRevision:a},yt),rebase:(e,t,a,r={})=>ne("rebase",{...pe(e),id:t,baseVersion:a,systemId:r.systemId,systemScope:r.systemScope,systemRevision:r.revision},bt),clearDesignSystem:e=>ne("clearDesignSystem",{workspaceId:e,scope:"workspace"},yt)};function Y(e){return e instanceof Ke?e.code:void 0}function X(e){switch(e){case"artifact/not-found":return"error.notFound";case"artifact/stale-catalog":return"error.staleCatalog";case"artifact/writer-busy":return"error.writerBusy";case"artifact/unsupported-kit":return"error.unsupportedKit";case"artifact/stale-version":return"error.stale";case"artifact/too-large":return"error.tooLarge";case"artifact/no-workspace":return"error.noWorkspace";case"artifact/forbidden-path":return"error.forbidden";case"artifact/corrupt":return"error.corrupt";case"artifact/invalid-tokens":return"error.tokens";case"artifact/library-unavailable":return"error.library";case"artifact/design-invalid":return"error.designInvalid";case"artifact/design-icon-unsupported":return"error.designIcon";case"artifact/design-icon-not-found":return"error.designIconNotFound";case"artifact/design-render-failed":return"error.designRender";case"artifact/design-timeout":return"error.designTimeout";case"artifact/design-unavailable":return"error.designUnavailable";case"artifact/unsupported-type":return"error.unsupportedType";case"artifact/invalid-sheet":return"error.sheetInvalid";default:return"error.generic"}}function La(e){if(!(!(e instanceof Ke)||!e.code.startsWith("artifact/design-")))return e.message===""?void 0:e.message}function Tr(e,t){return La(t)??e(X(Y(t)))}function Ma(e){let t=atob(e.data),a=new Uint8Array(t.length);for(let o=0;o<t.length;o+=1)a[o]=t.charCodeAt(o);let r=URL.createObjectURL(new Blob([a],{type:e.mediaType})),n=document.createElement("a");n.href=r,n.download=e.fileName,n.rel="noopener",document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(r),3e4)}var st=require("react");var xt=require("react");function qt(e){let t=e,a=new Set;return{get:()=>t,set(r){t=r;for(let n of a)n()},subscribe(r){return a.add(r),()=>a.delete(r)}}}var ot=qt(new Map);function Me(e,t){if(ot.get().get(e)===t)return;let a=new Map(ot.get());a.set(e,t),ot.set(a)}function Cr(e){return ot.get().get(e)}function Nr(e){return(0,xt.useSyncExternalStore)(ot.subscribe,()=>e===void 0?void 0:ot.get().get(e))}var wt=qt(new Map);function _e(e,t){if((wt.get().get(e)??0)>=t)return;let a=new Map(wt.get());a.set(e,t),wt.set(a)}function zr(e){return(0,xt.useSyncExternalStore)(wt.subscribe,()=>e===void 0?0:wt.get().get(e)??0)}var Kt=qt(0);function Ne(){Kt.set(Kt.get()+1)}function Yt(){return(0,xt.useSyncExternalStore)(Kt.subscribe,Kt.get)}var it=qt(null);function ae(e){it.set({seq:(it.get()?.seq??0)+1,message:e})}function Ir(){return(0,xt.useSyncExternalStore)(it.subscribe,it.get)}function Pa(e){let t=it.get();t===null||e!==void 0&&t.seq!==e||it.set(null)}var Pe=new Map,Oa;function Rr(){Oa?.();let e=t=>{[...Pe.values()].some(a=>a.getSnapshot().draft!==null||a.getSnapshot().saving)&&(t.preventDefault(),t.returnValue="")};return window.addEventListener("beforeunload",e),Oa=()=>window.removeEventListener("beforeunload",e),Oa}var Fa=class{state={payload:null,draft:null,loading:!0,saving:!1,conflict:!1,revision:0};listeners=new Set;pending=null;readSequence=0;mounts=0;renameTo;where;key;address;constructor(t){this.address=t,this.key=te(t),this.where={scope:t.scope,workspaceId:t.scope==="workspace"?t.workspaceId:null}}getSnapshot=()=>this.state;subscribe=t=>(this.listeners.add(t),()=>this.listeners.delete(t));publish(t){this.state={...this.state,...t},this.state.draft!==null||this.state.saving?Pe.set(this.key,this):this.mounts===0&&Pe.get(this.key)===this&&Pe.delete(this.key);for(let a of this.listeners)a()}attach(){return this.mounts+=1,Pe.set(this.key,this),this.mounts===1&&(this.state.payload===null||this.state.draft===null)&&this.load(),()=>{this.mounts-=1,this.mounts===0&&this.state.draft===null&&!this.state.saving&&Pe.get(this.key)===this&&Pe.delete(this.key)}}async load(){let t=++this.readSequence;this.publish({loading:!0,failure:void 0,failureMessage:void 0});try{let a=await B.get(this.where,this.address.id);if(t!==this.readSequence)return;if(this.state.draft!==null&&this.state.payload!==null){this.publish({loading:!1,conflict:a.version!==this.state.payload.version});return}this.publish({payload:a,loading:!1,conflict:!1,failure:void 0,revision:this.state.revision+1}),Me(this.address.id,a.manifest.title),_e(this.address.id,a.version)}catch(a){t===this.readSequence&&this.publish({loading:!1,failure:Y(a)??"artifact/storage-failure",failureMessage:void 0})}}edit(t){this.publish({draft:t,failure:void 0,failureMessage:void 0})}async discardAndReload(){this.pending!==null&&await this.pending,this.publish({draft:null,conflict:!1,failure:void 0,failureMessage:void 0}),await this.load()}externalVersion(t){this.state.payload===null||t<=this.state.payload.version||this.state.saving||(this.state.draft!==null?this.publish({conflict:!0}):this.load())}save(t){return t!==void 0&&(this.renameTo=t),this.pending!==null?this.pending:this.state.conflict||this.state.payload===null?Promise.resolve(!1):(this.pending=Promise.resolve().then(()=>this.drain()),this.pending)}async drain(){this.publish({saving:!0,failure:void 0,failureMessage:void 0});try{for(;this.state.draft!==null||this.renameTo!==void 0;){let t=this.state.payload;if(t===null||this.state.conflict)return!1;let a=this.state.draft,r=a??t.content,n=this.renameTo,{manifest:o}=await B.update(this.where,this.address.id,t.version,r,n);this.renameTo===n&&(this.renameTo=void 0),this.accept(o,r,this.state.draft===a?null:this.state.draft)}return!0}catch(t){let a=Y(t)??"artifact/storage-failure";return this.renameTo=void 0,this.publish({failure:a,failureMessage:a.startsWith("artifact/design-")?La(t):void 0,conflict:a==="artifact/stale-version"}),!1}finally{this.pending=null,this.publish({saving:!1})}}accept(t,a,r){let n=this.state.payload;n!==null&&(++this.readSequence,this.publish({payload:{...n,manifest:t,content:a,version:t.version},draft:r,conflict:!1,loading:!1}),Me(t.id,t.title),_e(t.id,t.version),t.type==="design"&&this.state.draft===null&&B.get(this.where,this.address.id).then(o=>{this.state.draft!==null||o.version!==t.version||this.publish({payload:o,revision:this.state.revision+1})}).catch(()=>{}),Ne())}};function Ar(e){let t=te(e),a=(0,st.useMemo)(()=>{let n=Pe.get(t);if(n!==void 0)return n;let o=new Fa(e);return Pe.set(t,o),o},[t]),r=(0,st.useSyncExternalStore)(a.subscribe,a.getSnapshot,a.getSnapshot);return(0,st.useEffect)(()=>a.attach(),[a]),{model:a,state:r}}var C=require("react"),S=require("@deepseek-ai/dsh-client-ui-primitives");var we=require("react"),xe=require("@deepseek-ai/dsh-client-ui-primitives");var h=require("react/jsx-runtime");function _({children:e,size:t=16}){return(0,h.jsx)("svg",{viewBox:"0 0 24 24",width:t,height:t,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e})}var kt=({size:e})=>(0,h.jsxs)(_,{size:e,children:[(0,h.jsx)("rect",{x:"3.5",y:"3.5",width:"7",height:"7",rx:"1.5"}),(0,h.jsx)("rect",{x:"13.5",y:"3.5",width:"7",height:"7",rx:"1.5"}),(0,h.jsx)("rect",{x:"3.5",y:"13.5",width:"7",height:"7",rx:"1.5"}),(0,h.jsx)("path",{d:"M17 13.5v7M13.5 17h7"})]}),ze=({size:e})=>(0,h.jsxs)(_,{size:e,children:[(0,h.jsx)("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2"}),(0,h.jsx)("path",{d:"M3.5 8.5h17M9 13l-2 1.8L9 16.5M15 13l2 1.8-2 1.7"})]}),Oe=({size:e})=>(0,h.jsxs)(_,{size:e,children:[(0,h.jsx)("path",{d:"M6.5 3.5h7l4 4v13h-11z"}),(0,h.jsx)("path",{d:"M13.5 3.5v4h4M9 12h6M9 15.5h6"})]}),qe=({size:e})=>(0,h.jsxs)(_,{size:e,children:[(0,h.jsx)("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2"}),(0,h.jsx)("path",{d:"M3.5 9.5h17M9.5 9.5v10M15 9.5v10M3.5 14.5h17"})]}),Ye=({size:e})=>(0,h.jsxs)(_,{size:e,children:[(0,h.jsx)("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2"}),(0,h.jsx)("path",{d:"M3.5 14.5l4.5-4.5 4 4 3-3 5 5"}),(0,h.jsx)("circle",{cx:"8.5",cy:"8.5",r:"1.2"})]}),Er=({size:e})=>(0,h.jsxs)(_,{size:e,children:[(0,h.jsx)("path",{d:"M20.5 12a8.5 8.5 0 1 1-8.5-8.5c4.7 0 8.5 3.4 8.5 7.6 0 2.1-1.7 3.8-3.8 3.8h-1.4c-1 0-1.9.8-1.9 1.8 0 .8.5 1.3.5 2.1 0 1-.7 1.7-1.9 1.7Z"}),(0,h.jsx)("circle",{cx:"7.6",cy:"10",r:"1.1",fill:"currentColor",stroke:"none"}),(0,h.jsx)("circle",{cx:"10",cy:"6.8",r:"1.1",fill:"currentColor",stroke:"none"}),(0,h.jsx)("circle",{cx:"14",cy:"7",r:"1.1",fill:"currentColor",stroke:"none"}),(0,h.jsx)("circle",{cx:"17",cy:"10.2",r:"1.1",fill:"currentColor",stroke:"none"})]}),Dr=({size:e})=>(0,h.jsx)(_,{size:e,children:(0,h.jsx)("path",{d:"M7 3v18M17 3v18M3 7h18M3 17h18"})}),Lr=({size:e})=>(0,h.jsx)(_,{size:e,children:(0,h.jsx)("path",{d:"M5 6h14M12 6v13"})}),Mr=({size:e})=>(0,h.jsxs)(_,{size:e,children:[(0,h.jsx)("rect",{x:"3.5",y:"3.5",width:"11",height:"11",rx:"2"}),(0,h.jsx)("circle",{cx:"15.5",cy:"15.5",r:"5"})]}),Pr=({size:e})=>(0,h.jsxs)(_,{size:e,children:[(0,h.jsx)("rect",{x:"3.5",y:"3.5",width:"12",height:"12",rx:"2"}),(0,h.jsx)("path",{d:"M8.5 8.5h12v12h-12z"})]}),Or=({size:e})=>(0,h.jsx)(_,{size:e,children:(0,h.jsx)("path",{d:"M5 3.5l12.5 8.2-5.7 1.2L14 19l-2.4 1-2.1-5.1L5 18.2z"})}),Fr=({size:e})=>(0,h.jsx)(_,{size:e,children:(0,h.jsx)("path",{d:"M8 12V5.5a1.5 1.5 0 0 1 3 0V11M11 10.5V4.5a1.5 1.5 0 0 1 3 0V11M14 10.5V6.5a1.5 1.5 0 0 1 3 0V13c0 4-2.4 7-6 7-3.3 0-4.6-1.6-6.5-5.2L3.2 11.5a1.5 1.5 0 0 1 2.5-1.6L8 12.5"})}),jr=({size:e})=>(0,h.jsxs)(_,{size:e,children:[(0,h.jsx)("rect",{x:"4.5",y:"4.5",width:"15",height:"15",rx:"2"}),(0,h.jsx)("path",{d:"M8.5 4.5v15M15.5 4.5v15M4.5 8.5h15M4.5 15.5h15"})]}),Br=({size:e})=>(0,h.jsx)(_,{size:e,children:(0,h.jsx)("path",{d:"M4.5 6.5h15M12 6.5v12"})}),Hr=({size:e})=>(0,h.jsx)(_,{size:e,children:(0,h.jsx)("rect",{x:"4.5",y:"6",width:"15",height:"12",rx:"1.5"})}),_r=({size:e})=>(0,h.jsx)(_,{size:e,children:(0,h.jsx)("ellipse",{cx:"12",cy:"12",rx:"7.5",ry:"6"})}),Vr=({size:e})=>(0,h.jsx)(_,{size:e,children:(0,h.jsx)("path",{d:"M4.5 19.5l15-15"})}),Wr=({size:e})=>(0,h.jsxs)(_,{size:e,children:[(0,h.jsx)("path",{d:"M12 19.5C8.5 19.5 6 17.3 6 14.3 6 9.9 12 3.5 12 3.5s6 6.4 6 10.8c0 3-2.5 5.2-6 5.2Z"}),(0,h.jsx)("circle",{cx:"12",cy:"14.5",r:"1.6"})]}),Gr=({size:e})=>(0,h.jsxs)(_,{size:e,children:[(0,h.jsx)("rect",{x:"8.5",y:"8.5",width:"11",height:"11",rx:"2"}),(0,h.jsx)("path",{d:"M15.5 4.5h-8a3 3 0 0 0-3 3v8"})]}),Ur=({size:e})=>(0,h.jsxs)(_,{size:e,children:[(0,h.jsx)("rect",{x:"9.5",y:"9.5",width:"10",height:"10",rx:"1.5",fill:"currentColor",stroke:"none"}),(0,h.jsx)("path",{d:"M7.5 7.5h10M7.5 7.5v10M4.5 13v-6a2 2 0 0 1 2-2h6"})]}),$r=({size:e})=>(0,h.jsxs)(_,{size:e,children:[(0,h.jsx)("rect",{x:"4.5",y:"4.5",width:"10",height:"10",rx:"1.5"}),(0,h.jsx)("path",{d:"M16.5 9.5h-6"})]}),Kr=({size:e})=>(0,h.jsxs)(_,{size:e,children:[(0,h.jsx)("rect",{x:"5.5",y:"5.5",width:"10",height:"5.5",rx:"1"}),(0,h.jsx)("rect",{x:"5.5",y:"14.5",width:"6",height:"5.5",rx:"1"}),(0,h.jsx)("path",{d:"M3.5 3.5v17"})]}),qr=({size:e})=>(0,h.jsxs)(_,{size:e,children:[(0,h.jsx)("rect",{x:"6.5",y:"5.5",width:"9",height:"5.5",rx:"1"}),(0,h.jsx)("rect",{x:"9",y:"14.5",width:"4",height:"5.5",rx:"1"}),(0,h.jsx)("path",{d:"M11 3.5v17",strokeDasharray:"3 2"})]}),Yr=({size:e})=>(0,h.jsxs)(_,{size:e,children:[(0,h.jsx)("rect",{x:"8.5",y:"5.5",width:"10",height:"5.5",rx:"1"}),(0,h.jsx)("rect",{x:"12.5",y:"14.5",width:"6",height:"5.5",rx:"1"}),(0,h.jsx)("path",{d:"M20.5 3.5v17"})]}),Xr=({size:e})=>(0,h.jsxs)(_,{size:e,children:[(0,h.jsx)("rect",{x:"5.5",y:"5.5",width:"5.5",height:"10",rx:"1"}),(0,h.jsx)("rect",{x:"14.5",y:"5.5",width:"5.5",height:"6",rx:"1"}),(0,h.jsx)("path",{d:"M3.5 3.5h17"})]}),Qr=({size:e})=>(0,h.jsxs)(_,{size:e,children:[(0,h.jsx)("rect",{x:"5.5",y:"6.5",width:"5.5",height:"9",rx:"1"}),(0,h.jsx)("rect",{x:"14.5",y:"9",width:"5.5",height:"4",rx:"1"}),(0,h.jsx)("path",{d:"M3.5 11h17",strokeDasharray:"3 2"})]}),Jr=({size:e})=>(0,h.jsxs)(_,{size:e,children:[(0,h.jsx)("rect",{x:"5.5",y:"8.5",width:"5.5",height:"10",rx:"1"}),(0,h.jsx)("rect",{x:"14.5",y:"12.5",width:"5.5",height:"6",rx:"1"}),(0,h.jsx)("path",{d:"M3.5 20.5h17"})]}),Zr=({size:e})=>(0,h.jsx)(_,{size:e,children:(0,h.jsx)("path",{d:"M4 9.5h9.5a5.5 5.5 0 0 1 0 11H9M4 9.5l4-4M4 9.5l4 4"})}),en=({size:e})=>(0,h.jsx)(_,{size:e,children:(0,h.jsx)("path",{d:"M20 9.5h-9.5a5.5 5.5 0 0 0 0 11H15M20 9.5l-4-4M20 9.5l-4 4"})}),tn=({size:e})=>(0,h.jsxs)(_,{size:e,children:[(0,h.jsx)("path",{d:"M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12Z"}),(0,h.jsx)("circle",{cx:"12",cy:"12",r:"2.6"})]}),an=({size:e})=>(0,h.jsxs)(_,{size:e,children:[(0,h.jsx)("path",{d:"M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12Z"}),(0,h.jsx)("path",{d:"M4 4l16 16"})]}),rn=({size:e})=>(0,h.jsxs)(_,{size:e,children:[(0,h.jsx)("rect",{x:"5",y:"10.5",width:"14",height:"9.5",rx:"2"}),(0,h.jsx)("path",{d:"M8 10.5V7a4 4 0 0 1 8 0v3.5"})]}),nn=({size:e})=>(0,h.jsxs)(_,{size:e,children:[(0,h.jsx)("rect",{x:"5",y:"10.5",width:"14",height:"9.5",rx:"2"}),(0,h.jsx)("path",{d:"M8 10.5V7a4 4 0 0 1 7.4-2"})]});var V=require("react/jsx-runtime"),Xt=null;function ri(e){return e===null||typeof e!="object"?!1:typeof{...e}.mountDesignCanvas=="function"}async function ni(){return Xt??=(async()=>{let e=globalThis.__dshArtifactsRequireAsync;if(typeof e!="function")throw new Error("The canvas loader is unavailable.");let t=await e("./client.canvas.js");if(!ri(t))throw new Error("The canvas engine did not load.");return t})(),Xt.catch(()=>{Xt=null}),Xt}var oi=[{value:"select",label:"canvas.select",icon:(0,V.jsx)(Or,{size:16})},{value:"hand",label:"canvas.hand",icon:(0,V.jsx)(Fr,{size:16})},{value:"rectangle",label:"canvas.rectangle",icon:(0,V.jsx)(Hr,{size:16})},{value:"ellipse",label:"canvas.ellipse",icon:(0,V.jsx)(_r,{size:16})},{value:"line",label:"canvas.line",icon:(0,V.jsx)(Vr,{size:16})},{value:"pen",label:"canvas.pen",icon:(0,V.jsx)(Wr,{size:16})},{value:"frame",label:"canvas.frame",icon:(0,V.jsx)(jr,{size:16})},{value:"text",label:"canvas.text",icon:(0,V.jsx)(Br,{size:16})}];function on({t:e,source:t,revision:a,title:r,mode:n,onChange:o,onSave:l,onFailure:s,onHandle:c,onSelection:i,attempt:g,fallback:k}){let b=(0,we.useRef)(null),p=(0,we.useRef)(null),u=(0,we.useRef)(t),y=(0,we.useRef)({onChange:o,onSave:l,onFailure:s,onHandle:c,onSelection:i});y.current={onChange:o,onSave:l,onFailure:s,onHandle:c,onSelection:i};let[v,D]=(0,we.useState)({status:"loading"}),[T,N]=(0,we.useState)(null);(0,we.useEffect)(()=>{let z=b.current;if(z===null)return;let W=!1,U=null;return D({status:"loading"}),N(null),(async()=>{try{let H=await ni();if(W)return;let P=await H.mountDesignCanvas({element:z,source:u.current,mode:n,onChange:A=>{u.current=A,y.current.onChange(A)},onSave:()=>y.current.onSave(),onFailure:A=>{D({status:"failed"}),y.current.onFailure(A)},t:e});if(W){P.destroy();return}p.current=P,y.current.onFailure(null),y.current.onHandle(P),D({status:"ready"});let x=P.getSnapshot();N(x),y.current.onSelection(x.selection),U=P.subscribe(A=>{N(A),y.current.onSelection(A.selection)})}catch(H){W||(D({status:"failed"}),y.current.onFailure(H instanceof Error?H.message:String(H)))}})(),()=>{W=!0,U?.(),p.current?.destroy(),p.current=null,y.current.onHandle(null)}},[g]),(0,we.useEffect)(()=>{let z=p.current;z===null||t===u.current||(u.current=t,z.setSource(t))},[a,t]),(0,we.useEffect)(()=>{p.current?.setMode(n)},[n]);let E=v.status==="ready",j=oi.map(z=>(0,V.jsx)(xe.Tooltip,{label:e(z.label),side:"top",portal:!0,children:(0,V.jsx)(xe.Button,{size:"sm",className:"art-dock-button","aria-label":e(z.label),"aria-pressed":T?.tool===z.value,onClick:()=>p.current?.setTool(z.value),children:z.icon})},z.value));return(0,V.jsx)("div",{className:"art-canvas",children:(0,V.jsxs)("div",{className:"art-canvas-stage",children:[(0,V.jsx)("div",{className:"art-canvas-mount",ref:b,role:"application","aria-label":r,tabIndex:0,hidden:v.status==="failed","data-ready":E?"1":void 0}),E?null:(0,V.jsx)("div",{className:"art-canvas-fallback",children:k}),v.status==="loading"?(0,V.jsx)("div",{className:"art-canvas-opening",role:"status",children:(0,V.jsx)(xe.TextShimmer,{active:!0,children:e("canvas.opening")})}):null,E&&T!==null&&T.rows.length===0?(0,V.jsx)("p",{className:"art-canvas-empty",children:e("canvas.empty")}):null,E?(0,V.jsxs)("div",{className:"art-canvas-dock",role:"toolbar","aria-label":e("canvas.toolbar"),children:[n==="edit"?(0,V.jsxs)(V.Fragment,{children:[j,(0,V.jsx)("span",{className:"art-dock-divider","aria-hidden":"true"}),(0,V.jsx)(xe.Tooltip,{label:e("canvas.undo"),side:"top",portal:!0,children:(0,V.jsx)(xe.Button,{size:"sm",className:"art-dock-button","aria-label":e("canvas.undo"),disabled:T?.canUndo===!1,onClick:()=>p.current?.undo(),children:(0,V.jsx)(Zr,{size:16})})}),(0,V.jsx)(xe.Tooltip,{label:e("canvas.redo"),side:"top",portal:!0,children:(0,V.jsx)(xe.Button,{size:"sm",className:"art-dock-button","aria-label":e("canvas.redo"),disabled:T?.canRedo===!1,onClick:()=>p.current?.redo(),children:(0,V.jsx)(en,{size:16})})}),(0,V.jsx)("span",{className:"art-dock-divider","aria-hidden":"true"})]}):null,(0,V.jsx)(xe.ZoomControls,{className:"art-dock-zoom",zoom:T?.zoom??1,fit:{label:e("canvas.fit"),selected:T?.fit??!1,onSelect:()=>p.current?.zoomToFit()},labels:{controls:e("canvas.zoomControls"),out:e("canvas.zoomOut"),into:e("canvas.zoomIn"),menu:e("canvas.zoomMenu"),value:z=>e("canvas.zoomValue",{percent:z})},visible:E,onZoom:z=>p.current?.setZoom(z),onActiveChange:()=>{}})]}):null]})})}var ue=require("react"),ce=require("@deepseek-ai/dsh-client-ui-primitives");var w=require("react/jsx-runtime"),ii=["Inter","Roboto","Noto Naskh Arabic"],si=[400,500,600,700];function Qt(e){switch(e){case"FRAME":case"SECTION":return(0,w.jsx)(Dr,{size:14});case"TEXT":return(0,w.jsx)(Lr,{size:14});case"GROUP":case"COMPONENT":case"COMPONENT_SET":case"INSTANCE":return(0,w.jsx)(Pr,{size:14});default:return(0,w.jsx)(Mr,{size:14})}}function Ba(e,t){switch(t){case"FRAME":return e("layer.type.frame");case"SECTION":return e("layer.type.section");case"TEXT":return e("layer.type.text");case"RECTANGLE":return e("layer.type.rectangle");case"ELLIPSE":return e("layer.type.ellipse");case"LINE":return e("layer.type.line");case"VECTOR":case"STAR":case"POLYGON":return e("layer.type.vector");case"GROUP":return e("layer.type.group");case"COMPONENT":case"COMPONENT_SET":return e("layer.type.component");case"INSTANCE":return e("layer.type.instance");default:return e("layer.type.other")}}function li({t:e,label:t,value:a,mixed:r,min:n,max:o,step:l=1,onPreview:s,onCommit:c}){let[i,g]=(0,ue.useState)(""),k=(0,ue.useRef)(!1),b=(0,ue.useRef)(0),p=(0,ue.useRef)(!1),u=(0,ue.useRef)(!1),y=a===null?"":String(a);(0,ue.useEffect)(()=>{k.current||g(a===null?"":String(a))},[a]);let v=()=>g(a===null?"":String(a)),D=()=>{k.current=!1;let T=Number(i);if(i.trim()===""||!Number.isFinite(T)){v(),p.current&&c(b.current,b.current),p.current=!1;return}p.current&&c(T,b.current),p.current=!1};return(0,w.jsxs)("label",{className:"art-inspector-field",children:[(0,w.jsx)("span",{className:"art-inspector-field-label",children:t}),(0,w.jsx)(ce.Input,{className:"art-inspector-input","aria-label":t,type:"number",inputMode:"decimal",min:n,max:o,step:l,value:i,placeholder:r||y===""?e("panel.mixed"):void 0,onFocus:()=>{k.current=!0,b.current=a??0,p.current=!1,g(a===null?"":String(a))},onChange:T=>{let N=T.target.value;g(N);let E=Number(N);N.trim()!==""&&Number.isFinite(E)&&(p.current=!0,s(E))},onBlur:()=>{if(u.current){u.current=!1,k.current=!1,v();return}D()},onKeyDown:T=>{T.key==="Enter"?(T.preventDefault(),T.currentTarget.blur()):T.key==="Escape"&&(T.preventDefault(),v(),p.current&&c(b.current,b.current),p.current=!1,u.current=!0,T.currentTarget.blur())}})]})}function ci({t:e,handle:t,snapshot:a}){let[r,n]=(0,ue.useState)(null),[o,l]=(0,ue.useState)(""),s=a.rows,c=s.findIndex(p=>p.selected),i=p=>{let u=s[p];u!==void 0&&t.select(u.id,"replace")},g=p=>{l(p.name),n(p.id)},k=p=>{let u=o.trim();n(null),u!==""&&u!==p.name&&t.rename(p.id,u)},b=p=>{let u=c===-1?void 0:s[c];if(p.key==="ArrowDown"){p.preventDefault(),i(c===-1?0:Math.min(c+1,s.length-1));return}if(p.key==="ArrowUp"){p.preventDefault(),i(c===-1?s.length-1:Math.max(c-1,0));return}if(u!==void 0){if(p.key==="ArrowLeft"){if(p.preventDefault(),u.hasChildren&&u.expanded){t.toggleExpand(u.id);return}for(let y=c-1;y>=0;y-=1)if(s[y].level<u.level){t.select(s[y].id,"replace");return}return}if(p.key==="ArrowRight"){if(p.preventDefault(),u.hasChildren&&!u.expanded)t.toggleExpand(u.id);else{let y=s[c+1];y!==void 0&&y.level>u.level&&t.select(y.id,"replace")}return}p.key==="Enter"&&(p.preventDefault(),g(u))}};return s.length===0?(0,w.jsx)("p",{className:"art-inspector-empty",children:e("panel.none")}):(0,w.jsx)("div",{className:"art-layer-tree",role:"tree","aria-label":e("panel.layers"),tabIndex:0,onKeyDown:b,children:s.map(p=>(0,w.jsxs)("div",{className:"art-layer-row"+(p.selected?" is-selected":""),"data-layer-id":p.id,role:"treeitem","aria-level":p.level,"aria-selected":p.selected,"aria-expanded":p.hasChildren?p.expanded:void 0,style:{paddingInlineStart:(p.level-1)*14+6},onClick:u=>{u.shiftKey?t.select(p.id,"range"):u.metaKey||u.ctrlKey?t.select(p.id,"add"):t.select(p.id,"replace")},onDoubleClick:()=>g(p),children:[p.hasChildren?(0,w.jsx)(ce.Button,{size:"sm",className:"art-layer-caret","aria-label":e(p.expanded?"panel.collapse":"panel.expand"),onClick:u=>{u.stopPropagation(),t.toggleExpand(p.id)},children:p.expanded?(0,w.jsx)(ce.IconChevronDownOutlineRegular,{size:12}):(0,w.jsx)(ce.IconChevronRightOutlineRegular,{size:12})}):(0,w.jsx)("span",{className:"art-layer-caret","aria-hidden":"true"}),(0,w.jsx)("span",{className:"art-layer-icon","aria-hidden":"true",children:Qt(p.type)}),r===p.id?(0,w.jsx)(ce.Input,{className:"art-layer-rename","aria-label":e("panel.rename"),autoFocus:!0,value:o,onChange:u=>l(u.target.value),onClick:u=>u.stopPropagation(),onBlur:()=>k(p),onKeyDown:u=>{u.key==="Enter"?(u.preventDefault(),k(p)):u.key==="Escape"&&(u.preventDefault(),n(null))}}):(0,w.jsx)("span",{className:"art-layer-name",title:p.name,children:p.name}),(0,w.jsxs)("span",{className:"art-layer-actions",children:[(0,w.jsx)(ce.Button,{size:"sm",className:"art-layer-action","aria-label":e(p.visible?"panel.hide":"panel.show"),"aria-pressed":!p.visible,onClick:u=>{u.stopPropagation(),t.toggleVisibility(p.id)},children:p.visible?(0,w.jsx)(tn,{size:13}):(0,w.jsx)(an,{size:13})}),(0,w.jsx)(ce.Button,{size:"sm",className:"art-layer-action","aria-label":e(p.locked?"panel.unlock":"panel.lock"),"aria-pressed":p.locked,onClick:u=>{u.stopPropagation(),t.toggleLock(p.id)},children:p.locked?(0,w.jsx)(rn,{size:13}):(0,w.jsx)(nn,{size:13})})]})]},p.id))})}var ja=/^#[0-9a-f]{6}$/;function di({t:e,label:t,hex:a,onInput:r,onCommit:n}){let[o,l]=(0,ue.useState)(""),s=(0,ue.useRef)(!1),c=(0,ue.useRef)(null),i=(0,ue.useRef)(null),g=a??"",k=s.current?o:g,b=p=>{let u=p.trim().toLowerCase();return ja.test(u)?u:null};return(0,ue.useEffect)(()=>{s.current||l("")},[a]),(0,w.jsxs)("label",{className:"art-inspector-field",children:[(0,w.jsx)("span",{className:"art-inspector-field-label",children:t}),(0,w.jsx)("input",{type:"color",className:"art-inspector-color","aria-label":t,value:a!==null&&ja.test(a)?a:"#000000",disabled:a===null,onFocus:()=>{c.current=a},onInput:p=>{let u=p.currentTarget.value.toLowerCase();i.current=u,r(u)},onChange:p=>{let u=p.currentTarget.value.toLowerCase();i.current=u,n(u)}}),(0,w.jsx)(ce.Input,{className:"art-inspector-input","aria-label":t+" CSS",type:"text",value:k,placeholder:a===null?e("panel.mixed"):void 0,onFocus:()=>{s.current=!0,c.current=a,i.current=null,l("")},onChange:p=>{l(p.target.value);let u=b(p.target.value);u!==null&&(i.current=u,r(u))},onBlur:()=>{s.current=!1;let p=b(o)??i.current;l(""),p!==null&&n(p)},onKeyDown:p=>{if(p.key==="Enter")p.preventDefault(),p.currentTarget.blur();else if(p.key==="Escape"){l("");let u=c.current;i.current=null,u!==null&&n(u),p.currentTarget.blur()}}})]})}function pi({t:e,handle:t,snapshot:a,palette:r}){let n=a.properties;if(n.ids.length===0)return(0,w.jsx)("p",{className:"art-inspector-empty",children:e("panel.selectLayerHint")});let o=(c,i,g,k={})=>(0,w.jsx)(li,{t:e,label:i,value:g,mixed:g===null,...k,onPreview:b=>t.preview(c,b),onCommit:(b,p)=>t.commit(c,b,p)}),l=(c,i,g,k)=>(0,w.jsx)(ce.Tooltip,{label:e(c),side:"top",portal:!0,children:(0,w.jsx)(ce.Button,{size:"sm",className:"art-inspector-action","aria-label":e(c),disabled:g,onClick:k,children:i})}),s=c=>i=>t.alignSelection(c,i);return(0,w.jsxs)("div",{className:"art-inspector-properties",children:[(0,w.jsxs)("div",{className:"art-inspector-node",children:[(0,w.jsx)("span",{className:"art-inspector-node-icon","aria-hidden":"true",children:Qt(n.type??"")}),(0,w.jsx)("span",{className:"art-inspector-node-name",title:n.name??"",children:n.name}),(0,w.jsx)("span",{className:"art-inspector-node-type",children:Ba(e,n.type??"")})]}),(0,w.jsxs)("div",{className:"art-inspector-actions",role:"toolbar","aria-label":e("panel.layerActions"),children:[l("panel.duplicate",(0,w.jsx)(Gr,{size:14}),n.ids.length===0,()=>t.duplicateSelection()),l("panel.forward",(0,w.jsx)(Ur,{size:14}),n.ids.length===0,()=>t.changeOrder("forward")),l("panel.backward",(0,w.jsx)($r,{size:14}),n.ids.length===0,()=>t.changeOrder("backward"))]}),n.ids.length<2?null:(0,w.jsxs)("div",{className:"art-inspector-actions",role:"toolbar","aria-label":e("panel.align"),children:[l("panel.alignLeft",(0,w.jsx)(Kr,{size:14}),!1,()=>s("horizontal")("min")),l("panel.alignCenterX",(0,w.jsx)(qr,{size:14}),!1,()=>s("horizontal")("center")),l("panel.alignRight",(0,w.jsx)(Yr,{size:14}),!1,()=>s("horizontal")("max")),l("panel.alignTop",(0,w.jsx)(Xr,{size:14}),!1,()=>s("vertical")("min")),l("panel.alignMiddle",(0,w.jsx)(Qr,{size:14}),!1,()=>s("vertical")("center")),l("panel.alignBottom",(0,w.jsx)(Jr,{size:14}),!1,()=>s("vertical")("max"))]}),["fill","stroke"].map(c=>(0,w.jsxs)("section",{className:"art-inspector-group",children:[(0,w.jsx)("h3",{className:"art-inspector-heading",children:e(c==="fill"?"panel.fill":"panel.stroke")}),(0,w.jsx)(di,{t:e,label:e(c==="fill"?"panel.fill":"panel.stroke"),hex:c==="fill"?n.fill:n.stroke,onInput:i=>t.setColor(c,i,!1),onCommit:i=>t.setColor(c,i,!0)}),(0,w.jsx)("div",{className:"art-inspector-swatches",children:$e.map(i=>{let g=r?.[i];return g===void 0||!ja.test(g)?null:(0,w.jsx)("button",{type:"button",className:"art-inspector-swatch",style:{background:g},title:e(`design.color.${i}`),"aria-label":e(`design.color.${i}`),onClick:()=>t.setColor(c,g,!0)},i)})})]},c)),(0,w.jsxs)("section",{className:"art-inspector-group",children:[(0,w.jsx)("h3",{className:"art-inspector-heading",children:e("panel.positionSize")}),(0,w.jsxs)("div",{className:"art-inspector-grid",children:[o("x",e("panel.x"),n.x),o("y",e("panel.y"),n.y),o("width",e("panel.w"),n.width,{min:1}),o("height",e("panel.h"),n.height,{min:1}),o("rotation",e("panel.rotation"),n.rotation),o("radius",e("panel.radius"),n.radius,{min:0})]})]}),(0,w.jsxs)("section",{className:"art-inspector-group",children:[(0,w.jsx)("h3",{className:"art-inspector-heading",children:e("panel.appearance")}),(0,w.jsxs)("div",{className:"art-inspector-appearance",children:[o("opacity",e("panel.opacity"),n.opacity,{min:0,max:100}),(0,w.jsxs)("label",{className:"art-inspector-switch",children:[(0,w.jsx)("span",{className:"art-inspector-field-label",children:e("panel.visible")}),(0,w.jsx)(ce.Switch,{checked:n.visible===!0,label:e("panel.visible"),onChange:c=>t.setVisible(c)})]})]})]}),a.isText&&n.text!==null?(0,w.jsxs)("section",{className:"art-inspector-group",children:[(0,w.jsx)("h3",{className:"art-inspector-heading",children:e("panel.text")}),(0,w.jsxs)("div",{className:"art-inspector-grid",children:[(0,w.jsxs)("label",{className:"art-inspector-field",children:[(0,w.jsx)("span",{className:"art-inspector-field-label",children:e("panel.family")}),(0,w.jsx)("select",{className:"art-select art-inspector-select","aria-label":e("panel.family"),value:n.text.family,onChange:c=>t.setFamily(c.target.value),children:ii.map(c=>(0,w.jsx)("option",{value:c,children:c},c))})]}),(0,w.jsxs)("label",{className:"art-inspector-field",children:[(0,w.jsx)("span",{className:"art-inspector-field-label",children:e("panel.weight")}),(0,w.jsx)("select",{className:"art-select art-inspector-select","aria-label":e("panel.weight"),value:String(n.text.weight),onChange:c=>t.setWeight(Number(c.target.value)),children:si.map(c=>(0,w.jsx)("option",{value:String(c),children:String(c)},c))})]}),o("fontSize",e("panel.fontSize"),n.text.fontSize,{min:1})]})]}):(0,w.jsx)("p",{className:"art-inspector-hint",children:e("panel.selectTextHint")})]})}function sn({t:e,handle:t,snapshot:a,tab:r,palette:n}){return t===null||a===null?(0,w.jsx)("p",{className:"art-inspector-empty",children:e("canvas.opening")}):r==="layers"?(0,w.jsx)(ci,{t:e,handle:t,snapshot:a}):(0,w.jsx)(pi,{t:e,handle:t,snapshot:a,palette:n})}var St=require("react"),Jt=require("@deepseek-ai/dsh-client-ui-primitives");var ge=require("react/jsx-runtime");function Ha({t:e,where:t,id:a,version:r,title:n}){let[o,l]=(0,St.useState)({status:"loading"}),[s,c]=(0,St.useState)(0);if((0,St.useEffect)(()=>{let g=new AbortController;return l({status:"loading"}),B.preview(t,a,r,g.signal).then(k=>{g.signal.aborted||l({status:"ready",preview:k})}).catch(k=>{g.signal.aborted||l({status:"failed",message:Tr(e,k)})}),()=>g.abort()},[t.scope,t.workspaceId,a,r,s,e]),o.status==="loading")return(0,ge.jsx)("div",{className:"art-state",role:"status","aria-busy":"true",children:(0,ge.jsx)(Jt.TextShimmer,{active:!0,children:e("preview.loading")})});if(o.status==="failed")return(0,ge.jsxs)("div",{className:"art-state",role:"alert",children:[(0,ge.jsx)("span",{className:"art-design-error",children:o.message}),(0,ge.jsx)(Jt.Button,{size:"sm",variant:"outline",onClick:()=>c(g=>g+1),children:e("preview.retry")})]});let{preview:i}=o;return(0,ge.jsxs)("div",{className:"art-design-preview",children:[(0,ge.jsx)("div",{className:"art-design-canvas",children:(0,ge.jsx)("img",{className:"art-design-image",src:`data:${i.mediaType};base64,${i.data}`,alt:n,width:i.width,height:i.height})}),i.info.warnings.length===0?null:(0,ge.jsxs)("div",{className:"art-design-warnings",role:"note",children:[(0,ge.jsx)("span",{className:"art-design-warnings-title",children:e("preview.warnings")}),(0,ge.jsx)("ul",{children:i.info.warnings.map(g=>(0,ge.jsx)("li",{children:g},g))})]})]})}var Z=require("react"),Zt=require("@deepseek-ai/dsh-client-ui-primitives");var Se=require("react/jsx-runtime"),Tt=null;function ui(){if(Tt===null){let e=globalThis.__dshArtifactsRequireAsync;if(typeof e!="function")return Promise.reject(new Error("The document editor loader is unavailable."));Tt=e("./client.doc.js"),Tt.catch(()=>{Tt=null})}return Tt}var fi=["heading","bold","italic","bulletList","orderedList","codeBlock"];function mi(e){let t=window.getSelection(),a=e.getBoundingClientRect(),n=(t!==null&&t.rangeCount>0?t.getRangeAt(0):null)?.getBoundingClientRect();if(n===void 0||n.width===0&&n.height===0)return{top:e.scrollTop+8,left:16};let o=Math.min(Math.max(n.left-a.left+n.width/2,120),Math.max(a.width-120,120));return{top:Math.max(n.top-a.top+e.scrollTop-46,e.scrollTop+4),left:o}}function ea({markdown:e,revision:t,editable:a,label:r,loadingLabel:n,failedLabel:o,onChange:l,onSave:s,onSelectionText:c,t:i,design:g,dark:k=!1,selectionAction:b}){let p=(0,Z.useRef)(null),u=(0,Z.useRef)(null),y=(0,Z.useRef)(null),v=(0,Z.useRef)(l);v.current=l;let D=(0,Z.useRef)(c);D.current=c;let T=(0,Z.useRef)({markdown:e,editable:a,label:r});T.current={markdown:e,editable:a,label:r};let[N,E]=(0,Z.useState)([]),[j,z]=(0,Z.useState)("loading"),[W,U]=(0,Z.useState)(null),H=(0,Z.useRef)(null);(0,Z.useLayoutEffect)(()=>{let L=H.current,q=p.current;if(L===null||q===null||W===null)return;let I=L.offsetWidth/2,J=q.clientWidth,Ze=I*2+16>=J?J/2:Math.min(Math.max(W.left,I+8),J-I-8);L.style.left=Ze+"px"});let P=(0,Z.useMemo)(()=>g===void 0?{}:{...Gt(g,k),colorScheme:k?"dark":"light"},[g,k]),x=L=>{D.current?.(L);let q=p.current;U(L===""||q===null?null:mi(q))},A=(0,Z.useRef)(x);A.current=x,(0,Z.useEffect)(()=>{let L=!1;return ui().then(q=>{L||u.current===null||(y.current=q.mountDocEditor({element:u.current,...T.current,onChange:I=>v.current(I),onSelectionChange:E,onSelectionText:I=>A.current(I)}),z("ready"))}).catch(()=>{L||z("failed")}),()=>{L=!0,y.current?.destroy(),y.current=null}},[]),(0,Z.useEffect)(()=>{let L=y.current;L!==null&&L.getMarkdown()!==e&&L.setMarkdown(e)},[t,e]),(0,Z.useEffect)(()=>{y.current?.setEditable(a)},[a]),(0,Z.useEffect)(()=>{let L=()=>{let q=y.current,I=p.current,J=window.getSelection();q===null||I===null||J!==null&&J.anchorNode!==null&&!I.contains(J.anchorNode)||A.current(q.getSelectionText())};return document.addEventListener("selectionchange",L),()=>document.removeEventListener("selectionchange",L)},[]);let Q=W!==null&&i!==void 0&&(a||b!=null);return(0,Se.jsxs)("div",{className:"art-doc",ref:p,"data-doc-revision":t,onKeyDown:L=>{(L.ctrlKey||L.metaKey)&&L.key.toLowerCase()==="s"&&(L.preventDefault(),s()),L.key==="Escape"&&W!==null&&U(null)},children:[Q?(0,Se.jsxs)("div",{ref:H,className:"art-doc-toolbar",role:"toolbar","aria-label":i("format.toolbar"),style:{top:W.top,left:W.left},children:[a?fi.map(L=>(0,Se.jsx)(Zt.Button,{size:"sm",variant:"ghost","aria-pressed":N.includes(L),disabled:j!=="ready",onMouseDown:q=>q.preventDefault(),onClick:()=>y.current?.format(L),children:i(`format.${L}`)},L)):null,a&&b!=null?(0,Se.jsx)("span",{className:"art-doc-toolbar-gap","aria-hidden":"true"}):null,b]}):null,j==="loading"?(0,Se.jsx)("div",{className:"art-state",role:"status",children:(0,Se.jsx)(Zt.TextShimmer,{active:!0,children:n})}):null,j==="failed"?(0,Se.jsx)("div",{className:"art-state",role:"alert",children:o}):null,(0,Se.jsx)("div",{className:"art-docpage",style:P,hidden:j!=="ready",children:(0,Se.jsx)("div",{className:"art-doc-mount",ref:u})})]})}function*ln(e){let t=e.toLowerCase(),a=new Set(["script","style","textarea","title","template","noscript"]),r=0;for(;r<e.length;){let n=e.indexOf("<",r);if(n<0)return;if(e.startsWith("<!--",n)){let i=e.indexOf("-->",n+4);if(i<0)return;r=i+3;continue}let o=n+1,l="";for(;o<e.length;o++){let i=e[o];if(l!=="")i===l&&(l="");else if(i==='"'||i==="'")l=i;else if(i===">")break}if(o===e.length)return;r=o+1;let s=e.slice(n,r),c=/^<([a-z][a-z0-9:-]*)(?=\s|\/?>)/i.exec(s)?.[1]?.toLowerCase();if(c!==void 0&&(yield{name:c,text:s},a.has(c))){let i=t.indexOf("</"+c,r);if(i<0)return;let g=e.indexOf(">",i);if(g<0)return;r=g+1}}}var cn=["*, *::before, *::after { box-sizing: border-box; }","[hidden] { display: none !important; }","html { background: var(--artifact-color-background); -webkit-text-size-adjust: 100%; }","body { margin: 0; color: var(--artifact-color-text); font: var(--artifact-font-size-2)/1.6 var(--artifact-font-family); overflow-wrap: anywhere; }","::selection { background: color-mix(in srgb, var(--artifact-color-action) 26%, transparent); }",":focus-visible { outline: 2px solid var(--artifact-color-focus); outline-offset: 2px; }",":where(h1, h2, h3, h4):not(:where(.ak-demo, .ak-demo *)) { margin: 0; font-family: var(--artifact-font-display); font-weight: 600; line-height: 1.2; text-wrap: balance; }",":where(h1):not(:where(.ak-demo, .ak-demo *)) { font-size: clamp(1.9rem, 5vw, 2.6rem); letter-spacing: -0.02em; }",":where(h2):not(:where(.ak-demo, .ak-demo *)) { font-size: clamp(1.35rem, 3.2vw, 1.75rem); letter-spacing: -0.01em; }",":where(h3):not(:where(.ak-demo, .ak-demo *)) { font-size: var(--artifact-font-size-3); }",":where(h4):not(:where(.ak-demo, .ak-demo *)) { font-size: var(--artifact-font-size-2); }",":where(p, ul, ol, dl, figure, blockquote):not(:where(.ak-demo, .ak-demo *)) { margin: 0; }",":where(a):not(:where(.ak-demo, .ak-demo *)) { color: var(--artifact-color-primary); text-underline-offset: 0.2em; }",":where(code, kbd, samp, pre):not(:where(.ak-demo, .ak-demo *)) { font-family: var(--artifact-font-mono); font-size: 0.92em; }",":where(:not(pre) > code):not(:where(.ak-demo, .ak-demo *)) { padding: 0.1em 0.35em; border-radius: var(--artifact-radius-sm); background: color-mix(in srgb, var(--artifact-color-text) 7%, transparent); }","button, input, select, textarea { font: inherit; color: inherit; }","img { max-width: 100%; height: auto; }",".ak-page { display: grid; gap: var(--artifact-space-6); width: min(100% - 2 * var(--artifact-space-4), 72rem); margin-inline: auto; padding-block: var(--artifact-space-5) var(--artifact-space-6); }",".ak-page--narrow { width: min(100% - 2 * var(--artifact-space-4), 48rem); }",".ak-page > * { min-width: 0; }",".ak-header { display: grid; gap: var(--artifact-space-3); padding-bottom: var(--artifact-space-5); border-bottom: 1px solid var(--artifact-color-border); }",".ak-eyebrow { color: var(--artifact-color-muted); font-size: var(--artifact-font-size-1); font-weight: 600; letter-spacing: 0.01em; }",".ak-lede { max-width: 60ch; color: var(--artifact-color-muted); font-size: calc((var(--artifact-font-size-2) + var(--artifact-font-size-3)) / 2); line-height: 1.5; }",".ak-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--artifact-space-1) var(--artifact-space-3); padding: 0; list-style: none; color: var(--artifact-color-muted); font-size: var(--artifact-font-size-1); }",".ak-section { display: grid; gap: var(--artifact-space-4); scroll-margin-top: var(--artifact-space-4); }",".ak-section__head { display: grid; gap: var(--artifact-space-1); }",".ak-section__head p { max-width: 68ch; color: var(--artifact-color-muted); }",".ak-prose { display: grid; gap: var(--artifact-space-3); }",".ak-prose > *, .ak-section > p, .ak-section > ul, .ak-section > ol { max-width: 68ch; }",".ak-prose ul, .ak-prose ol, .ak-section > ul, .ak-section > ol { display: grid; gap: var(--artifact-space-1); padding-left: 1.3em; }",".ak-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: var(--artifact-space-4); }",".ak-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: var(--artifact-space-4); align-items: start; }",".ak-card { display: grid; align-content: start; gap: var(--artifact-space-2); padding: var(--artifact-space-4); border: 1px solid var(--artifact-color-border); border-radius: var(--artifact-radius-lg); background: var(--artifact-color-surface); }",".ak-muted { color: var(--artifact-color-muted); }",".ak-small { font-size: var(--artifact-font-size-1); }",".ak-num { font-family: var(--artifact-font-mono); font-variant-numeric: tabular-nums; }",".ak-callout { --ak-tone: var(--artifact-color-accent); display: grid; gap: var(--artifact-space-1); padding: var(--artifact-space-3) var(--artifact-space-4); border-left: 3px solid var(--ak-tone); border-radius: 0 var(--artifact-radius-md) var(--artifact-radius-md) 0; background: var(--artifact-color-raised); }",".ak-callout__title { font-weight: 650; }",".ak-callout--info { --ak-tone: var(--artifact-color-focus); }",".ak-callout--success { --ak-tone: var(--artifact-color-success); }",".ak-callout--warning { --ak-tone: var(--artifact-color-warning); }",".ak-callout--danger { --ak-tone: var(--artifact-color-danger); }",".ak-badge { --ak-tone: var(--artifact-color-muted); display: inline-flex; align-items: center; gap: 0.4em; padding: 0.1em 0.6em; border: 1px solid color-mix(in srgb, var(--ak-tone) 45%, transparent); border-radius: 999px; color: var(--ak-tone); font-size: var(--artifact-font-size-1); font-weight: 600; line-height: 1.5; white-space: nowrap; }",'.ak-badge::before { content: ""; flex: none; width: 0.45em; height: 0.45em; border-radius: 50%; background: currentColor; }',".ak-badge--plain::before { display: none; }",".ak-badge--info { --ak-tone: var(--artifact-color-focus); }",".ak-badge--success { --ak-tone: var(--artifact-color-success); }",".ak-badge--warning { --ak-tone: var(--artifact-color-warning); }",".ak-badge--danger { --ak-tone: var(--artifact-color-danger); }",".ak-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: var(--artifact-space-3); }",".ak-facts > div { display: grid; gap: 2px; padding-top: var(--artifact-space-2); border-top: 1px solid var(--artifact-color-border); }",".ak-facts dt { color: var(--artifact-color-muted); font-size: var(--artifact-font-size-1); }",".ak-facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }",".ak-table { max-width: 100%; overflow-x: auto; border: 1px solid var(--artifact-color-border); border-radius: var(--artifact-radius-md); background: var(--artifact-color-surface); }",".ak-table table { width: 100%; border-collapse: collapse; font-size: var(--artifact-font-size-1); font-variant-numeric: tabular-nums; }",".ak-table caption { padding: var(--artifact-space-3) var(--artifact-space-3) var(--artifact-space-2); color: var(--artifact-color-muted); text-align: left; }",".ak-table caption strong { color: var(--artifact-color-text); }",".ak-table th, .ak-table td { padding: var(--artifact-space-2) var(--artifact-space-3); border-top: 1px solid var(--artifact-color-border); text-align: left; vertical-align: top; }",".ak-table thead th { background: var(--artifact-color-raised); color: var(--artifact-color-muted); font-weight: 600; }",".ak-table tbody th { font-weight: 600; }","@media (max-width: 640px) {"," .ak-table--stack table, .ak-table--stack caption, .ak-table--stack tbody, .ak-table--stack tr, .ak-table--stack th, .ak-table--stack td { display: block; }"," .ak-table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }"," .ak-table--stack tr { padding: var(--artifact-space-2) 0; border-top: 1px solid var(--artifact-color-border); }"," .ak-table--stack th, .ak-table--stack td { padding: var(--artifact-space-1) var(--artifact-space-3); border: 0; }"," .ak-table--stack td[data-label]::before { content: attr(data-label); display: block; color: var(--artifact-color-muted); font-size: var(--artifact-font-size-0); font-weight: 600; }","}",".ak-code { display: grid; overflow: hidden; border: 1px solid var(--artifact-color-border); border-radius: var(--artifact-radius-md); background: var(--artifact-color-surface); }",".ak-code figcaption { padding: var(--artifact-space-1) var(--artifact-space-3); border-bottom: 1px solid var(--artifact-color-border); color: var(--artifact-color-muted); font: 600 var(--artifact-font-size-0)/1.6 var(--artifact-font-mono); }",".ak-code pre { margin: 0; padding: var(--artifact-space-3); overflow-x: auto; font-size: var(--artifact-font-size-1); line-height: 1.55; tab-size: 2; }",".ak-steps { display: grid; gap: var(--artifact-space-3); padding: 0; list-style: none; counter-reset: ak-step; }",".ak-steps > li { position: relative; display: grid; gap: var(--artifact-space-1); min-height: 2rem; padding-left: 2.75rem; counter-increment: ak-step; }",".ak-steps > li::before { content: counter(ak-step); position: absolute; top: 0; left: 0; display: grid; place-items: center; width: 2rem; height: 2rem; border: 1px solid var(--artifact-color-border); border-radius: 50%; background: var(--artifact-color-raised); font: 600 var(--artifact-font-size-1)/1 var(--artifact-font-mono); }",".ak-decision { display: grid; gap: var(--artifact-space-2); padding: var(--artifact-space-4); border: 1px solid var(--artifact-color-border); border-radius: var(--artifact-radius-lg); background: var(--artifact-color-surface); }",".ak-decision__pick { padding: var(--artifact-space-2) var(--artifact-space-3); border-radius: var(--artifact-radius-md); background: color-mix(in srgb, var(--artifact-color-success) 10%, var(--artifact-color-surface)); }",".ak-quote { display: grid; gap: var(--artifact-space-1); max-width: 68ch; padding-left: var(--artifact-space-4); border-left: 3px solid var(--artifact-color-border); }",".ak-quote p { font-family: var(--artifact-font-display); font-size: calc((var(--artifact-font-size-2) + var(--artifact-font-size-3)) / 2); }",".ak-quote cite { color: var(--artifact-color-muted); font-size: var(--artifact-font-size-1); font-style: normal; }",".ak-switch { display: grid; gap: var(--artifact-space-3); }",".ak-switch > * { min-width: 0; }",".ak-switch__bar { display: inline-flex; flex-wrap: wrap; justify-self: start; gap: 2px; padding: 2px; border: 1px solid var(--artifact-color-border); border-radius: var(--artifact-radius-md); background: var(--artifact-color-raised); }",".ak-switch__bar button { min-height: 36px; padding: 0 var(--artifact-space-3); border: 0; border-radius: max(0px, calc(var(--artifact-radius-md) - 2px)); background: transparent; color: var(--artifact-color-muted); font-size: var(--artifact-font-size-1); font-weight: 600; cursor: pointer; }",'.ak-switch__bar button[aria-pressed="true"] { background: var(--artifact-color-surface); color: var(--artifact-color-text); box-shadow: 0 0 0 1px var(--artifact-color-control); text-decoration: underline; text-underline-offset: 0.2em; }',".ak-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: var(--artifact-space-4); }",".ak-compare > * { display: grid; align-content: start; gap: var(--artifact-space-2); min-width: 0; }",".ak-compare__label { color: var(--artifact-color-muted); font-size: var(--artifact-font-size-1); font-weight: 600; }",".ak-frame { display: grid; overflow: hidden; border: 1px solid var(--artifact-color-border); border-radius: var(--artifact-radius-lg); background: var(--artifact-color-surface); box-shadow: 0 1px 3px color-mix(in srgb, var(--artifact-color-text) 10%, transparent); }",".ak-frame__bar { display: flex; align-items: center; gap: var(--artifact-space-2); min-height: 34px; padding: 0 var(--artifact-space-3); overflow: hidden; border-bottom: 1px solid var(--artifact-color-border); background: var(--artifact-color-raised); color: var(--artifact-color-muted); font: var(--artifact-font-size-0)/1.4 var(--artifact-font-mono); white-space: nowrap; text-overflow: ellipsis; }",'.ak-frame__bar::before { content: ""; flex: none; width: 34px; height: 8px; background: radial-gradient(circle, var(--artifact-color-control) 3px, transparent 3.5px) 0 50% / 13px 8px repeat-x; opacity: 0.55; }',".ak-frame__body { min-width: 0; overflow: auto; }",".ak-frame__caption { padding: var(--artifact-space-2) var(--artifact-space-3); border-top: 1px solid var(--artifact-color-border); color: var(--artifact-color-muted); font-size: var(--artifact-font-size-1); }",".ak-demo { color: var(--demo-text, var(--artifact-color-text)); background: var(--demo-bg, transparent); font-family: var(--demo-font, var(--artifact-font-family)); }",".ak-demo { font-size: var(--demo-font-size, 16px); line-height: var(--demo-line-height, 1.5); }",":where(.ak-demo h1, .ak-demo h2, .ak-demo h3, .ak-demo h4, .ak-demo a, .ak-demo code, .ak-demo pre) { font: inherit; color: inherit; letter-spacing: normal; }",".ak-button { display: inline-flex; align-items: center; justify-content: center; gap: var(--artifact-space-1); min-height: 40px; padding: 0 var(--artifact-space-3); border: 1px solid var(--artifact-color-control); border-radius: var(--artifact-radius-sm); background: var(--artifact-color-surface); color: var(--artifact-color-text); font-size: var(--artifact-font-size-1); font-weight: 600; cursor: pointer; }",".ak-button:hover:not(:disabled) { border-color: var(--artifact-color-text); }",".ak-button--primary { border-color: var(--artifact-color-action); background: var(--artifact-color-action); color: var(--artifact-color-action-text); }",".ak-button--primary:hover:not(:disabled) { border-color: var(--artifact-color-action); background: color-mix(in srgb, var(--artifact-color-action) 88%, var(--artifact-color-text)); }",".ak-button:disabled { opacity: 0.5; cursor: not-allowed; }",".ak-actions { display: flex; flex-wrap: wrap; gap: var(--artifact-space-2); }",".ak-field { display: grid; gap: var(--artifact-space-1); font-size: var(--artifact-font-size-1); font-weight: 600; }",".ak-input { width: 100%; min-width: 0; min-height: 40px; padding: var(--artifact-space-1) var(--artifact-space-2); border: 1px solid var(--artifact-color-control); border-radius: var(--artifact-radius-sm); background: var(--artifact-color-surface); font-weight: 400; }",".ak-input::placeholder { color: var(--artifact-color-muted); opacity: 1; }",'.ak-input[aria-invalid="true"] { border-color: var(--artifact-color-danger); }',".ak-footer { padding-top: var(--artifact-space-4); border-top: 1px solid var(--artifact-color-border); color: var(--artifact-color-muted); font-size: var(--artifact-font-size-1); }","@media (prefers-reduced-motion: no-preference) { .ak-button, .ak-switch__bar button { transition: background-color 0.15s ease, border-color 0.15s ease; } }","@media print { .ak-switch__bar { display: none; } .ak-switch [data-ak-panel][hidden] { display: grid !important; } .ak-page { width: auto; } }"].join(`
|
|
22
|
+
`),gi=["(function () {",' var marker = "data-ak-switch-ready";'," if (document.documentElement.hasAttribute(marker)) return;",' document.documentElement.setAttribute(marker, "");',' function own(sw, node) { return node.closest("[data-ak-switch]") === sw; }'," function choose(sw, value) {",' sw.querySelectorAll("[data-ak-option]").forEach(function (b) { if (own(sw, b)) b.setAttribute("aria-pressed", String(b.getAttribute("data-ak-option") === value)); });',' sw.querySelectorAll("[data-ak-panel]").forEach(function (p) { if (own(sw, p)) p.hidden = p.getAttribute("data-ak-panel") !== value; });',' sw.dispatchEvent(new CustomEvent("ak-change", { bubbles: true, detail: { value: value } }));'," }",' document.addEventListener("click", function (event) {'," var target = event.target;"," if (!(target instanceof Element)) return;",' var button = target.closest("button[data-ak-option]:not(:disabled)");',' var sw = button && button.closest("[data-ak-switch]");',' if (sw) choose(sw, button.getAttribute("data-ak-option"));'," });"," function init() {",' document.querySelectorAll("[data-ak-switch]").forEach(function (sw) {',' var options = Array.prototype.filter.call(sw.querySelectorAll("[data-ak-option]"), function (b) { return own(sw, b); });',' var pick = options.find(function (b) { return b.getAttribute("aria-pressed") === "true"; }) || options[0];',' if (pick) choose(sw, pick.getAttribute("data-ak-option"));'," });"," }",' if (document.readyState === "loading") document.addEventListener("DOMContentLoaded", init); else init();',"})();"].join(`
|
|
23
|
+
`);function hi(e){return[...new Set([...e.matchAll(/\.(ak-[a-z0-9_-]+)/g)].map(t=>t[1]??""))].sort()}var dn={1:{css:cn,script:gi,classes:hi(cn)}};function vi(e){return e!==void 0&&Object.hasOwn(dn,e)?dn[e]:void 0}var bi="artifact-kit";function yi(e){for(let{name:t,text:a}of ln(e)){if(t!=="meta")continue;let r=new Map;for(let n of a.slice(5,-1).matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g)){let o=(n[1]??"").toLowerCase();r.has(o)||r.set(o,n[2]??n[3]??n[4]??"")}if(r.get("name")?.toLowerCase()===bi)return r.get("content")??""}}function pn(e){let t=yi(e),a=vi(t);return a===void 0?"":'<style data-artifact-kit="'+t+'">'+a.css+'</style><script data-artifact-kit="'+t+'">'+a.script+"<\/script>"}var al=String.raw`Kit 1. Add <meta name="artifact-kit" content="1"> and the renderer injects these classes and the switch script. The kit already styles body text, headings, links, code, focus, and selection from the tokens, so write no base styles of your own. Page CSS may add layout for content the kit does not cover.
|
|
24
24
|
|
|
25
25
|
Page: <main class="ak-page"> (72rem) or "ak-page ak-page--narrow" (48rem, reading pages).
|
|
26
26
|
Header: <header class="ak-header"><h1>Title</h1><p class="ak-lede">One-paragraph answer.</p><ul class="ak-meta"><li>Date</li><li><span class="ak-badge ak-badge--warning">Draft</span></li></ul></header>
|
|
@@ -39,25 +39,25 @@ Compare (side by side): <div class="ak-compare"><div><p class="ak-compare__label
|
|
|
39
39
|
Product UI replica: <figure class="ak-frame"><div class="ak-frame__bar">app.example.com/settings</div><div class="ak-frame__body ak-demo">...</div><figcaption class="ak-frame__caption">What to notice</figcaption></figure>. Inside .ak-demo, recreate the product's own look: define its colors and fonts once as custom properties on the .ak-demo element (--demo-bg, --demo-text, --demo-font, and any others you need) and use only those variables in the replica's rules. Prefix every replica selector with .ak-demo; this is a styling convention, not CSS isolation. Set --demo-font-size and --demo-line-height when needed.
|
|
40
40
|
Controls: ak-button, ak-button--primary, ak-actions (button row), <label class="ak-field">Label<input class="ak-input" name="..."></label>. Buttons use type="button".
|
|
41
41
|
Small text: ak-muted, ak-small, ak-num (tabular numbers). Footer: <footer class="ak-footer">.
|
|
42
|
-
`;function
|
|
43
|
-
`);var
|
|
42
|
+
`;function wi(e){return/<meta\b[^>]*name\s*=\s*["']?color-scheme["']?[^>]*content\s*=\s*["'][^"']*\bdark\b/i.test(e)||/<meta\b[^>]*content\s*=\s*["'][^"']*\bdark\b[^"']*["'][^>]*name\s*=\s*["']?color-scheme/i.test(e)}var fn="default-src 'none'; img-src data: blob:; media-src data: blob:; style-src 'unsafe-inline'; script-src 'unsafe-inline' 'unsafe-eval'; font-src data:; connect-src 'none'; frame-src 'none'; object-src 'none'; base-uri 'none'; form-action 'none'",mn=["body, .art-docpage { color: var(--artifact-color-text); font-family: var(--artifact-font-family); font-size: 16px; line-height: 1.65; }","h1, h2, h3, h4 { font-family: var(--artifact-font-display); font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; margin: 1.8em 0 0.5em; color: var(--artifact-color-text); text-wrap: balance; }","h1 { font-size: 2.1em; margin-top: 0; }","h2 { font-size: 1.45em; }","h3 { font-size: 1.15em; }","p, ul, ol, blockquote, table, pre { margin: 0 0 1em; }","a { color: var(--artifact-color-primary); text-underline-offset: 2px; }","strong { font-weight: 650; }","code { font-family: var(--artifact-font-mono); font-size: 0.88em; padding: 0.1em 0.35em; border-radius: var(--artifact-radius-sm); background: color-mix(in srgb, var(--artifact-color-text) 7%, transparent); }","pre { font-family: var(--artifact-font-mono); font-size: 0.86em; line-height: 1.55; padding: 14px 16px; border-radius: var(--artifact-radius-md); background: color-mix(in srgb, var(--artifact-color-text) 6%, transparent); overflow: auto; }","pre code { padding: 0; background: none; font-size: 1em; }","blockquote { padding: 0 0 0 16px; border-left: 3px solid var(--artifact-color-accent); color: var(--artifact-color-muted); }","ul, ol { padding-left: 1.4em; }","li + li { margin-top: 0.25em; }","table { border-collapse: collapse; width: 100%; font-size: 0.94em; font-variant-numeric: tabular-nums; }","th, td { padding: 8px 10px; border-bottom: 1px solid color-mix(in srgb, var(--artifact-color-text) 14%, transparent); text-align: left; vertical-align: top; }","th { font-weight: 600; color: var(--artifact-color-muted); border-bottom-color: color-mix(in srgb, var(--artifact-color-text) 28%, transparent); }","hr { border: none; border-top: 1px solid color-mix(in srgb, var(--artifact-color-text) 14%, transparent); margin: 2em 0; }"].join(`
|
|
43
|
+
`);var _a="<script>addEventListener('message',function(e){if(e.source!==parent||e.data!=='dsh-artifact-print')return;addEventListener('afterprint',function(){parent.postMessage('dsh-artifact-printed','*')},{once:true});print()})<\/script>";function un(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function xi(e){return e.replace(/<meta\b[^>]*http-equiv\s*=\s*["']?refresh["']?[^>]*>/gi,"").replace(/<meta\b[^>]*content\s*=\s*["'][^"']*url\s*=[^>]*>/gi,"")}function gn(e,t,a,r,n="",o="auto"){let l=e.replace(/<style\b(?=[^>]*\sdata-artifact-(?:tokens|kit)(?:\s|=|>))[^>]*>[\s\S]*?<\/style\s*>/gi,""),s='<meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">'+(a===null?"":`<meta http-equiv="Content-Security-Policy" content="${un(a)}">`)+`<title>${un(r)}</title><style data-artifact-tokens>${t}</style>`+pn(l)+n;return`<!doctype html><html${wi(e)?` ${Vt}="${o}"`:""}><head>${s}</head><body>${xi(l)}</body></html>`}var hn="allow-scripts",ki="allow-scripts allow-modals",Si=3e4,Ti="<script>(function(){var t;document.addEventListener('selectionchange',function(){clearTimeout(t);t=setTimeout(function(){var s=String(getSelection()||'');parent.postMessage({dshArtifactSelection:s.slice(0,4000)},'*')},150)})})()<\/script>",Ci=4e3;function ta(e,t,a,r="auto",n=!1){return gn(e,t,fn,a,n?Ti:"",r)}function vn(e){if(e===null||typeof e!="object")return;let t={...e};return typeof t.dshArtifactSelection=="string"?t.dshArtifactSelection.slice(0,Ci):void 0}function bn(e){let t=/<\/head>/i.test(e)?e.replace(/<\/head>/i,`${_a}</head>`):`${_a}${e}`,a=URL.createObjectURL(new Blob([t],{type:"text/html"})),r=document.createElement("iframe");r.setAttribute("sandbox",ki),r.setAttribute("aria-hidden","true"),r.tabIndex=-1,r.style.cssText="position:fixed;left:-10000px;top:0;width:800px;height:1000px;border:0;";let n=!1,o=()=>{n||(n=!0,clearTimeout(s),window.removeEventListener("message",l),r.remove(),URL.revokeObjectURL(a))},l=c=>{c.source===r.contentWindow&&c.data==="dsh-artifact-printed"&&o()};window.addEventListener("message",l);let s=setTimeout(o,Si);r.addEventListener("load",()=>{r.contentWindow?.postMessage("dsh-artifact-print","*")},{once:!0}),r.src=a,document.body.appendChild(r)}var ra=require("@deepseek-ai/dsh-client-ui-primitives");var yn={"design.system":"Named system","design.defaultChoice":"Current default","design.copy":"Save as new system","design.saveRevision":"Save new revision","design.useDefault":"Use for new artifacts","design.revision":"{name}, revision {revision}","design.catalogReload":"Reload catalog, keep edits","design.unsavedSelection":"Save or discard these token edits before switching systems.","design.discardEdits":"Discard token edits","design.pinHint":"New artifacts keep these settings. Existing pinned artifacts change only through rebase.","generation.pinned":"Pinned design","generation.legacy":"Live design, legacy version","generation.rebase":"Rebase design","generation.confirm":"Create a new version with this design?","generation.explain":"Your content stays unchanged. Any unsaved edits will be saved first. The selected design revision and current recipe will be pinned in a new version.","generation.apply":"Save and rebase","generation.done":"Design rebased in a new version","error.staleCatalog":"The catalog changed. Reload it and review your edits before saving again.","error.writerBusy":"Another writer or a stale lock owns this store. Finish that writer or recover the lock after a crash.","error.unsupportedKit":"This saved component kit is not installed. Install its version before opening this artifact.","agent.ask":"Edit with agent","agent.reference":'In artifact "{title}" ({id}, v{version}):',"agent.referenceOld":'In artifact "{title}" ({id}, v{version}, the current version is v{current}):',"agent.referenceProject":'In artifact "{title}" ({id}, workspace {workspaceId}, v{version}):',"agent.referenceOldProject":'In artifact "{title}" ({id}, workspace {workspaceId}, v{version}, the current version is v{current}):',"agent.added":"Added to your message. Describe the change, then send.","agent.addedTruncated":"Added to your message. The selection was shortened to 2,000 characters.","agent.insertFailed":"The message box is busy, so the request was copied instead.","agent.copied":"Copied. Paste it into a conversation, then send.","agent.copyTitle":"Copy the request","card.creating":"Creating {title}","card.updating":"Updating {title}","card.updatingUntitled":"Updating the artifact","card.openNamed":"Open {title}","tab.codeHint":"Read-only code. Select text to ask the agent about it.","tab.editSource":"Edit code","tab.deleteTitle":"Move to trash?","code.copy":"Copy code","dialog.close":"Close","dialog.done":"Done","design.colorsDark":"Dark colors","panel.layers":"Layers","panel.properties":"Properties","panel.none":"No layers","panel.mixed":"Mixed","panel.expand":"Expand","panel.collapse":"Collapse","panel.show":"Show","panel.hide":"Hide","panel.lock":"Lock","panel.unlock":"Unlock","panel.rename":"Rename layer","panel.x":"X","panel.y":"Y","panel.rotation":"Rotate","panel.radius":"Radius","panel.opacity":"Opacity","panel.visible":"Visible","panel.hidden":"Hidden","panel.family":"Font family","panel.weight":"Weight","panel.fontSize":"Size","panel.w":"W","panel.h":"H","panel.positionSize":"Position and size","panel.layerActions":"Layer actions","panel.duplicate":"Duplicate","panel.forward":"Bring forward","panel.backward":"Send backward","panel.align":"Align","panel.alignLeft":"Align left","panel.alignCenterX":"Align horizontal centers","panel.alignRight":"Align right","panel.alignTop":"Align top","panel.alignMiddle":"Align vertical centers","panel.alignBottom":"Align bottom","panel.fill":"Fill","panel.stroke":"Stroke","panel.appearance":"Appearance","panel.text":"Text","panel.selectLayerHint":"Select a layer to see its properties.","panel.selectTextHint":"Select a text layer to change its font, weight, and size.","layer.parentLine":"{type} in {parent}","layer.type.frame":"Frame","layer.type.section":"Section","layer.type.text":"Text","layer.type.rectangle":"Rectangle","layer.type.ellipse":"Ellipse","layer.type.line":"Line","layer.type.vector":"Vector","layer.type.group":"Group","layer.type.component":"Component","layer.type.instance":"Instance","layer.type.other":"Layer","canvas.viewMode":"View","canvas.editMode":"Edit","canvas.opening":"Opening the canvas\u2026","canvas.startFailed":"The canvas did not start. Showing the saved image.","canvas.empty":"This mockup has no layers yet. Switch to Edit to draw one.","canvas.zoomControls":"Zoom","canvas.zoomOut":"Zoom out","canvas.zoomIn":"Zoom in","canvas.zoomMenu":"Zoom level","canvas.zoomValue":"{percent}%","canvas.inspector":"Inspector","canvas.closeInspector":"Close inspector","canvas.inspectorTabs":"Inspector sections","canvas.editOldVersion":"Old versions open in View only. Restore this version to edit.","agent.quoteDesign":`Layer "{name}"
|
|
44
44
|
Path: {path}
|
|
45
45
|
|
|
46
|
-
Design JSX:`,"agent.quoteCut":"The Design JSX was shortened to {limit} characters.","agent.addedTruncatedDesign":"Added to your message. The layer's code was shortened to 4,000 characters.","canvas.toolbar":"Canvas tools","canvas.tools":"Tool","canvas.select":"Select","canvas.hand":"Hand","canvas.frame":"Frame","canvas.text":"Text","canvas.undo":"Undo","canvas.redo":"Redo","canvas.fit":"Fit","preview.loading":"Rendering the mockup\u2026","preview.retry":"Render again","preview.warnings":"Preview warnings","error.designIconNotFound":"That icon is not in the bundled set. Use an mdi: name from Material Design Icons.","design.display":"Heading font stack","composer.recent":"This project","composer.empty":"No artifacts yet","composer.start":"Start with","composer.all":"All artifacts","gallery.copyPrompt":"Copy prompt","gallery.copyPromptNamed":"Copy the {name} prompt","gallery.promptCopied":"Prompt copied. Paste it into a conversation.","prompt.dashboard":"Dashboard","prompt.dashboardText":"Create an artifact page: a dashboard that shows ","prompt.explainer":"Explainer","prompt.explainerText":"Create an artifact page: a one-page visual explainer of ","prompt.report":"Report","prompt.reportText":"Create an artifact doc: a report about ","prompt.brief":"Project brief","prompt.briefText":"Create an artifact doc: a project brief with context, goal, scope, and open questions for ","prompt.sheet":"Spreadsheet","prompt.sheetText":"Create an artifact sheet: a spreadsheet that tracks ","filter.type":"Filter by type","tab.mode":"Page view","tab.manualSave":"Page source saves with Save or Ctrl/Cmd+S.","tab.manualSaveDesign":"Mockup source saves with Save or Ctrl/Cmd+S.","tab.versionPicker":"Choose version","tab.currentVersion":"current","tab.allVersions":"All versions","tab.agentUpdate":"Updated to v{version}","tab.viewHistory":"View history","tab.dismiss":"Dismiss","tab.leaveTitle":"Unsaved changes","tab.leaveHint":"Save your changes before continuing, or discard them.","tab.leaveDiscard":"Discard","tab.leaveSave":"Save","tab.copyDraft":"Copy my draft","tab.discardReload":"Discard mine and reload","history.close":"Close history","action.copied":"Copied","action.copyFailed":"Copy was blocked. Select the text and copy it manually.","format.toolbar":"Document formatting","format.heading":"Heading","format.bold":"Bold","format.italic":"Italic","format.bulletList":"Bullet list","format.orderedList":"Numbered list","format.codeBlock":"Code block",panel:"Artifacts","right.guideHint":"Pages, documents, and mockups in this project.","action.back":"Back","scope.label":"Scope","scope.all":"All projects","scope.workspace":"This project","scope.library":"Library","type.page":"Page","type.doc":"Document","type.design":"Mockup","type.sheet":"Spreadsheet","type.all":"All types","gallery.search":"Search artifacts","gallery.searchLabel":"Search by title","gallery.create":"New artifact","gallery.newPage":"New page","gallery.newDoc":"New document","gallery.newDesign":"New mockup","gallery.newSheet":"New spreadsheet","gallery.design":"Design system","gallery.refresh":"Refresh","gallery.more":"Show more","gallery.truncated":"Only the first 500 artifacts are scanned.","gallery.failedProjects":"Some sources could not be loaded.","gallery.version":"v{version}","gallery.updated":"Updated {time}","gallery.count":"{count} artifacts","gallery.pinned":"Pinned","gallery.recent":"Recently updated","gallery.coverTitle":"Preview of {title}","gallery.coverFailed":"Preview unavailable","gallery.pin":"Pin {title}","gallery.unpin":"Unpin {title}","gallery.allPinned":"Everything here is pinned.","empty.workspaceTitle":"No artifacts in this project yet","empty.workspaceHint":"Ask the agent for a dashboard, report, or one-pager, or start one here.","empty.allTitle":"No artifacts yet","empty.allHint":"Artifacts from every project and your library appear here.","empty.libraryTitle":"Your library is empty","empty.libraryHint":"Library artifacts follow you to every project. Ask the agent to save one to the library.","empty.noMatch":"Nothing matches that search.","empty.typeMatch":"No {type} artifacts match the filter.","empty.noWorkspace":"Open a session in a workspace to see its artifacts.","empty.loading":"Loading...","create.title":"New {type}","create.name":"Title","create.scope":"Save to","create.submit":"Create","create.cancel":"Cancel","create.untitledPage":"Untitled page","create.untitledDesign":"Untitled mockup","create.untitledDoc":"Untitled document","create.untitledSheet":"Untitled spreadsheet","sheet.toolbar":"Spreadsheet tools","sheet.selection":"Selected cells","sheet.formulaBar":"Formula bar","sheet.selectColumn":"Select column {name}","sheet.selectRow":"Select row {row}","sheet.undo":"Undo","sheet.redo":"Redo","sheet.bold":"Bold","sheet.italic":"Italic","sheet.underline":"Underline","sheet.alignLeft":"Align left","sheet.alignCenter":"Align center","sheet.alignRight":"Align right","sheet.numberFormat":"Number format","sheet.format.general":"General","sheet.format.number":"Number","sheet.format.integer":"Whole number","sheet.format.currency":"Currency","sheet.format.percent":"Percent","sheet.format.date":"Date","sheet.fillColor":"Fill color","sheet.textColor":"Text color","sheet.invalid":"This sheet cannot be read.","sheet.editCell":"Edit cell {ref}","sheet.sheets":"Sheets","sheet.addSheet":"Add sheet","sheet.sheetName":"Sheet name","sheet.sheetActions":"Sheet actions","sheet.renameSheet":"Rename sheet","sheet.deleteSheet":"Delete sheet","sheet.deleteConfirm":'Delete "{name}"? Its cells are removed in a new version; History keeps the old one.',"sheet.delete":"Delete","sheet.cancel":"Cancel","tab.preview":"Preview","tab.source":"Code","tab.history":"History","tab.export":"Export","tab.reload":"Reload","tab.rename":"Rename","tab.delete":"Move to trash","tab.deleteConfirm":'"{title}" moves to the trash. Its files stay there for 7 days.',"tab.save":"Save","tab.saving":"Saving...","tab.saved":"Saved","tab.readOnly":"Read-only","tab.saveFailed":"Save failed","tab.unsaved":"Unsaved changes","tab.frameTitle":"Artifact preview: {title}","tab.versionOf":"Version {version}","tab.viewingOld":"Viewing version {version}. The current version is {current}.","tab.backToCurrent":"Back to current","tab.restoreThis":"Restore this version","tab.conflictTitle":"This artifact changed","tab.conflictHint":"A newer version was saved while you were editing. Your draft is kept here. Copy it before discarding, then reload the latest version.","tab.deleted":"This artifact is no longer here","tab.deletedHint":"It was moved to the trash or deleted.","tab.close":"Close tab","history.title":"Versions","history.current":"Current","history.byAgent":"Agent","history.byUser":"You","history.restored":"Restored from v{version}","history.created":"Created","history.updated":"Edited","history.empty":"No earlier versions.","export.html":"HTML file","export.png":"PNG image","export.svg":"SVG image","export.fig":"OpenPencil document (.fig)","export.md":"Markdown file","export.docx":"Word document","export.csv":"CSV file","export.xlsx":"Excel workbook","export.print":"Print or save as PDF","export.done":"Saved {name} to {path}","design.title":"Design system","design.hint":"Pages and documents use these values through CSS variables.","design.source.workspace":"This project overrides the library.","design.source.library":"Inherited from your library.","design.source.default":"Built-in defaults. Save to start your own.","design.name":"Name","design.colors":"Colors","design.color.primary":"Primary","design.color.accent":"Accent","design.color.surface":"Surface","design.color.text":"Text","design.color.muted":"Muted","design.color.background":"Page background","design.color.raised":"Raised background","design.color.border":"Divider","design.color.control":"Control border","design.color.action":"Action background","design.color.actionText":"Action text","design.color.focus":"Focus ring","design.color.success":"Success","design.color.warning":"Warning","design.color.danger":"Danger","design.type":"Typography","design.font":"Body font stack","design.mono":"Code font stack","design.radius":"Corner radius","design.radius.sm":"Small","design.radius.md":"Medium","design.radius.lg":"Large","design.notes":"Notes for the agent","design.notesHint":"Tone, layout rules, or brand guidance the agent reads before it designs.","design.saveWorkspace":"Save for this project","design.saveWorkspaceNamed":"Save for {name}","design.saveLibrary":"Save to library","design.clear":"Remove project override","design.saved":"Design system saved","design.preview":"Preview","design.previewHeading":"Quarterly review","design.previewBody":"Revenue grew in every region this quarter.","design.previewButton":"Primary action","card.created":"Created","card.updated":"Updated","card.working":"Writing the artifact...","card.failed":"The artifact was not saved","card.missing":"This result has no artifact details.","composer.label":"Artifacts","error.generic":"Something went wrong. Try again.","error.designInvalid":"The mockup source is not valid.","error.designIcon":"The mockup cannot use that icon.","error.designRender":"The mockup could not be rendered.","error.designTimeout":"The mockup took too long to render.","error.designUnavailable":"This runtime cannot render mockups.","error.unsupportedType":"That action is not available for this artifact.","error.sheetInvalid":"The sheet workbook is not valid.","error.notFound":"This artifact no longer exists.","error.stale":"The artifact changed. Reload to continue.","error.tooLarge":"The content is over the 2 MiB limit.","error.noWorkspace":"This session has no workspace.","error.forbidden":"That path is not allowed.","error.corrupt":"The artifact files are damaged.","error.tokens":"A design value is not valid CSS.","error.library":"The library folder cannot be created.","error.surface":"The artifact panel failed to draw.","error.surfaceHint":"Reload the window. Your artifacts are safe on disk.","action.retry":"Retry","action.reloadWindow":"Reload window","time.justNow":"just now","time.minutes":"{count} min ago","time.hours":"{count} h ago","time.days":"{count} d ago"},nn={"design.system":"\u547D\u540D\u8BBE\u8BA1\u7CFB\u7EDF","design.defaultChoice":"\u5F53\u524D\u9ED8\u8BA4","design.copy":"\u53E6\u5B58\u4E3A\u65B0\u7CFB\u7EDF","design.saveRevision":"\u4FDD\u5B58\u65B0\u4FEE\u8BA2","design.useDefault":"\u7528\u4E8E\u65B0\u4EA7\u7269","design.revision":"{name}\uFF0C\u4FEE\u8BA2 {revision}","design.catalogReload":"\u91CD\u65B0\u52A0\u8F7D\u76EE\u5F55\u5E76\u4FDD\u7559\u7F16\u8F91","design.unsavedSelection":"\u5207\u6362\u7CFB\u7EDF\u524D\u8BF7\u4FDD\u5B58\u6216\u653E\u5F03\u4EE4\u724C\u7F16\u8F91\u3002","design.discardEdits":"\u653E\u5F03\u4EE4\u724C\u7F16\u8F91","design.pinHint":"\u65B0\u4EA7\u7269\u4F1A\u56FA\u5B9A\u8FD9\u4E9B\u8BBE\u7F6E\u3002\u5DF2\u6709\u56FA\u5B9A\u8BBE\u7F6E\u7684\u4EA7\u7269\u53EA\u4F1A\u901A\u8FC7\u91CD\u65B0\u5E94\u7528\u8BBE\u8BA1\u66F4\u6539\u3002","generation.pinned":"\u5DF2\u56FA\u5B9A\u8BBE\u8BA1","generation.legacy":"\u5B9E\u65F6\u8BBE\u8BA1\uFF0C\u65E7\u7248\u672C","generation.rebase":"\u91CD\u65B0\u5E94\u7528\u8BBE\u8BA1","generation.confirm":"\u4F7F\u7528\u6B64\u8BBE\u8BA1\u521B\u5EFA\u65B0\u7248\u672C\uFF1F","generation.explain":"\u5185\u5BB9\u4FDD\u6301\u4E0D\u53D8\u3002\u672A\u4FDD\u5B58\u7684\u7F16\u8F91\u5C06\u5148\u4FDD\u5B58\u3002\u6240\u9009\u8BBE\u8BA1\u4FEE\u8BA2\u548C\u5F53\u524D\u6A21\u677F\u5C06\u56FA\u5B9A\u5728\u65B0\u7248\u672C\u4E2D\u3002","generation.apply":"\u4FDD\u5B58\u5E76\u5E94\u7528\u8BBE\u8BA1","generation.done":"\u8BBE\u8BA1\u5DF2\u5E94\u7528\u5230\u65B0\u7248\u672C","error.staleCatalog":"\u76EE\u5F55\u5DF2\u66F4\u6539\u3002\u8BF7\u91CD\u65B0\u52A0\u8F7D\u5E76\u68C0\u67E5\u7F16\u8F91\u540E\u518D\u4FDD\u5B58\u3002","error.writerBusy":"\u53E6\u4E00\u4E2A\u5199\u5165\u8FDB\u7A0B\u6216\u9057\u7559\u9501\u5360\u7528\u4E86\u6B64\u5B58\u50A8\u3002\u8BF7\u7B49\u5F85\u5199\u5165\u7ED3\u675F\uFF0C\u6216\u5728\u5D29\u6E83\u540E\u6062\u590D\u9501\u3002","error.unsupportedKit":"\u672A\u5B89\u88C5\u6B64\u4EA7\u7269\u4F7F\u7528\u7684\u7EC4\u4EF6\u5957\u4EF6\u3002\u8BF7\u5148\u5B89\u88C5\u5BF9\u5E94\u7248\u672C\u3002","agent.ask":"\u8BA9\u667A\u80FD\u4F53\u4FEE\u6539","agent.reference":"\u5728\u4EA7\u7269\u201C{title}\u201D\uFF08{id}\uFF0Cv{version}\uFF09\u4E2D\uFF1A","agent.referenceOld":"\u5728\u4EA7\u7269\u201C{title}\u201D\uFF08{id}\uFF0Cv{version}\uFF0C\u5F53\u524D\u7248\u672C\u4E3A v{current}\uFF09\u4E2D\uFF1A","agent.referenceProject":"\u5728\u4EA7\u7269\u201C{title}\u201D\uFF08{id}\uFF0C\u5DE5\u4F5C\u533A {workspaceId}\uFF0Cv{version}\uFF09\u4E2D\uFF1A","agent.referenceOldProject":"\u5728\u4EA7\u7269\u201C{title}\u201D\uFF08{id}\uFF0C\u5DE5\u4F5C\u533A {workspaceId}\uFF0Cv{version}\uFF0C\u5F53\u524D\u7248\u672C\u4E3A v{current}\uFF09\u4E2D\uFF1A","agent.added":"\u5DF2\u52A0\u5165\u6D88\u606F\u6846\u3002\u63CF\u8FF0\u8981\u4FEE\u6539\u7684\u5185\u5BB9\u540E\u53D1\u9001\u3002","agent.addedTruncated":"\u5DF2\u52A0\u5165\u6D88\u606F\u6846\u3002\u9009\u4E2D\u7684\u6587\u672C\u5DF2\u7F29\u77ED\u4E3A 2,000 \u4E2A\u5B57\u7B26\u3002","agent.insertFailed":"\u6D88\u606F\u6846\u6B63\u5FD9\uFF0C\u5DF2\u6539\u4E3A\u590D\u5236\u8BF7\u6C42\u3002","agent.copied":"\u5DF2\u590D\u5236\u3002\u7C98\u8D34\u5230\u5BF9\u8BDD\u4E2D\u540E\u53D1\u9001\u3002","agent.copyTitle":"\u590D\u5236\u8BF7\u6C42","card.creating":"\u6B63\u5728\u521B\u5EFA {title}","card.updating":"\u6B63\u5728\u66F4\u65B0 {title}","card.updatingUntitled":"\u6B63\u5728\u66F4\u65B0\u4EA7\u7269","card.openNamed":"\u6253\u5F00 {title}","tab.codeHint":"\u53EA\u8BFB\u4EE3\u7801\u3002\u9009\u4E2D\u6587\u672C\u5373\u53EF\u8BA9\u667A\u80FD\u4F53\u5904\u7406\u3002","tab.editSource":"\u7F16\u8F91\u4EE3\u7801","tab.deleteTitle":"\u79FB\u5230\u56DE\u6536\u7AD9\uFF1F","code.copy":"\u590D\u5236\u4EE3\u7801","dialog.close":"\u5173\u95ED","dialog.done":"\u5B8C\u6210","design.colorsDark":"\u6DF1\u8272\u914D\u8272","panel.layers":"\u56FE\u5C42","panel.properties":"\u5C5E\u6027","panel.none":"\u6CA1\u6709\u56FE\u5C42","panel.mixed":"\u6DF7\u5408","panel.expand":"\u5C55\u5F00","panel.collapse":"\u6298\u53E0","panel.show":"\u663E\u793A","panel.hide":"\u9690\u85CF","panel.lock":"\u9501\u5B9A","panel.unlock":"\u89E3\u9501","panel.rename":"\u91CD\u547D\u540D\u56FE\u5C42","panel.x":"X","panel.y":"Y","panel.rotation":"\u65CB\u8F6C","panel.radius":"\u5706\u89D2","panel.opacity":"\u4E0D\u900F\u660E\u5EA6","panel.visible":"\u53EF\u89C1","panel.hidden":"\u5DF2\u9690\u85CF","panel.family":"\u5B57\u4F53","panel.weight":"\u5B57\u91CD","panel.fontSize":"\u5B57\u53F7","panel.w":"\u5BBD","panel.h":"\u9AD8","panel.positionSize":"\u4F4D\u7F6E\u548C\u5C3A\u5BF8","panel.appearance":"\u5916\u89C2","panel.text":"\u6587\u672C","panel.selectLayerHint":"\u9009\u62E9\u4E00\u4E2A\u56FE\u5C42\u4EE5\u67E5\u770B\u5176\u5C5E\u6027\u3002","panel.selectTextHint":"\u9009\u62E9\u6587\u672C\u56FE\u5C42\u53EF\u4FEE\u6539\u5B57\u4F53\u3001\u5B57\u91CD\u548C\u5B57\u53F7\u3002","layer.parentLine":"{type}\uFF0C\u4F4D\u4E8E {parent}","layer.type.frame":"\u6846\u67B6","layer.type.section":"\u5206\u533A","layer.type.text":"\u6587\u672C","layer.type.rectangle":"\u77E9\u5F62","layer.type.ellipse":"\u692D\u5706","layer.type.line":"\u7EBF","layer.type.vector":"\u77E2\u91CF","layer.type.group":"\u7F16\u7EC4","layer.type.component":"\u7EC4\u4EF6","layer.type.instance":"\u5B9E\u4F8B","layer.type.other":"\u56FE\u5C42","canvas.viewMode":"\u67E5\u770B","canvas.editMode":"\u7F16\u8F91","canvas.opening":"\u6B63\u5728\u6253\u5F00\u753B\u5E03\u2026","canvas.startFailed":"\u753B\u5E03\u672A\u80FD\u542F\u52A8\uFF0C\u73B0\u663E\u793A\u5DF2\u4FDD\u5B58\u7684\u56FE\u7247\u3002","canvas.empty":"\u6B64\u539F\u578B\u8FD8\u6CA1\u6709\u56FE\u5C42\u3002\u5207\u6362\u5230\u7F16\u8F91\u6A21\u5F0F\u5373\u53EF\u7ED8\u5236\u3002","canvas.zoomControls":"\u7F29\u653E","canvas.zoomOut":"\u7F29\u5C0F","canvas.zoomIn":"\u653E\u5927","canvas.zoomMenu":"\u7F29\u653E\u7EA7\u522B","canvas.zoomValue":"{percent}%","canvas.inspector":"\u68C0\u67E5\u5668","canvas.closeInspector":"\u5173\u95ED\u68C0\u67E5\u5668","canvas.inspectorTabs":"\u68C0\u67E5\u5668\u5206\u533A","canvas.editOldVersion":"\u65E7\u7248\u672C\u4EC5\u53EF\u67E5\u770B\u3002\u6062\u590D\u6B64\u7248\u672C\u540E\u624D\u80FD\u7F16\u8F91\u3002","agent.quoteDesign":`\u56FE\u5C42\u201C{name}\u201D
|
|
46
|
+
Design JSX:`,"agent.quoteCut":"The Design JSX was shortened to {limit} characters.","agent.addedTruncatedDesign":"Added to your message. The layer's code was shortened to 4,000 characters.","canvas.toolbar":"Canvas tools","canvas.tools":"Tool","canvas.select":"Select","canvas.hand":"Hand","canvas.frame":"Frame","canvas.text":"Text","canvas.rectangle":"Rectangle","canvas.ellipse":"Ellipse","canvas.line":"Line","canvas.pen":"Pen","canvas.undo":"Undo","canvas.redo":"Redo","canvas.fit":"Fit","preview.loading":"Rendering the mockup\u2026","preview.retry":"Render again","preview.warnings":"Preview warnings","error.designIconNotFound":"That icon is not in the bundled set. Use an mdi: name from Material Design Icons.","design.display":"Heading font stack","composer.recent":"This project","composer.empty":"No artifacts yet","composer.start":"Start with","composer.all":"All artifacts","gallery.copyPrompt":"Copy prompt","gallery.copyPromptNamed":"Copy the {name} prompt","gallery.promptCopied":"Prompt copied. Paste it into a conversation.","prompt.dashboard":"Dashboard","prompt.dashboardText":"Create an artifact page: a dashboard that shows ","prompt.explainer":"Explainer","prompt.explainerText":"Create an artifact page: a one-page visual explainer of ","prompt.report":"Report","prompt.reportText":"Create an artifact doc: a report about ","prompt.brief":"Project brief","prompt.briefText":"Create an artifact doc: a project brief with context, goal, scope, and open questions for ","prompt.sheet":"Spreadsheet","prompt.sheetText":"Create an artifact sheet: a spreadsheet that tracks ","filter.type":"Filter by type","tab.mode":"Page view","tab.manualSave":"Page source saves with Save or Ctrl/Cmd+S.","tab.manualSaveDesign":"Mockup source saves with Save or Ctrl/Cmd+S.","tab.designWarnings":"Design warnings (version {version})","tab.versionPicker":"Choose version","tab.currentVersion":"current","tab.allVersions":"All versions","tab.agentUpdate":"Updated to v{version}","tab.viewHistory":"View history","tab.dismiss":"Dismiss","tab.leaveTitle":"Unsaved changes","tab.leaveHint":"Save your changes before continuing, or discard them.","tab.leaveDiscard":"Discard","tab.leaveSave":"Save","tab.copyDraft":"Copy my draft","tab.discardReload":"Discard mine and reload","history.close":"Close history","action.copied":"Copied","action.copyFailed":"Copy was blocked. Select the text and copy it manually.","format.toolbar":"Document formatting","format.heading":"Heading","format.bold":"Bold","format.italic":"Italic","format.bulletList":"Bullet list","format.orderedList":"Numbered list","format.codeBlock":"Code block",panel:"Artifacts","right.guideHint":"Pages, documents, and mockups in this project.","action.back":"Back","scope.label":"Scope","scope.all":"All projects","scope.workspace":"This project","scope.library":"Library","type.page":"Page","type.doc":"Document","type.design":"Mockup","type.sheet":"Spreadsheet","type.all":"All types","gallery.search":"Search artifacts","gallery.searchLabel":"Search by title","gallery.create":"New artifact","gallery.newPage":"New page","gallery.newDoc":"New document","gallery.newDesign":"New mockup","gallery.newSheet":"New spreadsheet","gallery.design":"Design system","gallery.refresh":"Refresh","gallery.more":"Show more","gallery.truncated":"Only the first 500 artifacts are scanned.","gallery.failedProjects":"Some sources could not be loaded.","gallery.version":"v{version}","gallery.updated":"Updated {time}","gallery.count":"{count} artifacts","gallery.pinned":"Pinned","gallery.recent":"Recently updated","gallery.coverTitle":"Preview of {title}","gallery.coverFailed":"Preview unavailable","gallery.pin":"Pin {title}","gallery.unpin":"Unpin {title}","gallery.allPinned":"Everything here is pinned.","empty.workspaceTitle":"No artifacts in this project yet","empty.workspaceHint":"Ask the agent for a dashboard, report, or one-pager, or start one here.","empty.allTitle":"No artifacts yet","empty.allHint":"Artifacts from every project and your library appear here.","empty.libraryTitle":"Your library is empty","empty.libraryHint":"Library artifacts follow you to every project. Ask the agent to save one to the library.","empty.noMatch":"Nothing matches that search.","empty.typeMatch":"No {type} artifacts match the filter.","empty.noWorkspace":"Open a session in a workspace to see its artifacts.","empty.loading":"Loading...","create.title":"New {type}","create.name":"Title","create.scope":"Save to","create.submit":"Create","create.cancel":"Cancel","create.untitledPage":"Untitled page","create.untitledDesign":"Untitled mockup","create.untitledDoc":"Untitled document","create.untitledSheet":"Untitled spreadsheet","sheet.toolbar":"Spreadsheet tools","sheet.selection":"Selected cells","sheet.formulaBar":"Formula bar","sheet.selectColumn":"Select column {name}","sheet.selectRow":"Select row {row}","sheet.undo":"Undo","sheet.redo":"Redo","sheet.bold":"Bold","sheet.italic":"Italic","sheet.underline":"Underline","sheet.alignLeft":"Align left","sheet.alignCenter":"Align center","sheet.alignRight":"Align right","sheet.numberFormat":"Number format","sheet.format.general":"General","sheet.format.number":"Number","sheet.format.integer":"Whole number","sheet.format.currency":"Currency","sheet.format.percent":"Percent","sheet.format.date":"Date","sheet.fillColor":"Fill color","sheet.textColor":"Text color","sheet.invalid":"This sheet cannot be read.","sheet.editCell":"Edit cell {ref}","sheet.sheets":"Sheets","sheet.addSheet":"Add sheet","sheet.sheetName":"Sheet name","sheet.sheetActions":"Sheet actions","sheet.renameSheet":"Rename sheet","sheet.deleteSheet":"Delete sheet","sheet.deleteConfirm":'Delete "{name}"? Its cells are removed in a new version; History keeps the old one.',"sheet.delete":"Delete","sheet.cancel":"Cancel","tab.preview":"Preview","tab.source":"Code","tab.history":"History","tab.export":"Export","tab.reload":"Reload","tab.rename":"Rename","tab.delete":"Move to trash","tab.deleteConfirm":'"{title}" moves to the trash. Its files stay there for 7 days.',"tab.save":"Save","tab.saving":"Saving...","tab.saved":"Saved","tab.readOnly":"Read-only","tab.saveFailed":"Save failed","tab.unsaved":"Unsaved changes","tab.frameTitle":"Artifact preview: {title}","tab.versionOf":"Version {version}","tab.viewingOld":"Viewing version {version}. The current version is {current}.","tab.backToCurrent":"Back to current","tab.restoreThis":"Restore this version","tab.conflictTitle":"This artifact changed","tab.conflictHint":"A newer version was saved while you were editing. Your draft is kept here. Copy it before discarding, then reload the latest version.","tab.deleted":"This artifact is no longer here","tab.deletedHint":"It was moved to the trash or deleted.","tab.close":"Close tab","history.title":"Versions","history.current":"Current","history.byAgent":"Agent","history.byUser":"You","history.restored":"Restored from v{version}","history.created":"Created","history.updated":"Edited","history.empty":"No earlier versions.","export.html":"HTML file","export.mockupHtml":"Interactive HTML (view-only)","export.mockupSvgHtml":"Static HTML (SVG, smaller)","export.selection":"Export selection","export.failed":"The layer could not be exported.","export.png":"PNG image","export.svg":"SVG image","export.fig":"OpenPencil document (.fig)","export.md":"Markdown file","export.docx":"Word document","export.csv":"CSV file","export.xlsx":"Excel workbook","export.downloaded":"Downloaded {name}.","export.print":"Print or save as PDF","export.done":"Saved {name} to {path}","design.title":"Design system","design.hint":"Pages and documents use these values through CSS variables.","design.source.workspace":"This project overrides the library.","design.source.library":"Inherited from your library.","design.source.default":"Built-in defaults. Save to start your own.","design.name":"Name","design.colors":"Colors","design.color.primary":"Primary","design.color.accent":"Accent","design.color.surface":"Surface","design.color.text":"Text","design.color.muted":"Muted","design.color.background":"Page background","design.color.raised":"Raised background","design.color.border":"Divider","design.color.control":"Control border","design.color.action":"Action background","design.color.actionText":"Action text","design.color.focus":"Focus ring","design.color.success":"Success","design.color.warning":"Warning","design.color.danger":"Danger","design.type":"Typography","design.font":"Body font stack","design.mono":"Code font stack","design.radius":"Corner radius","design.radius.sm":"Small","design.radius.md":"Medium","design.radius.lg":"Large","design.notes":"Notes for the agent","design.notesHint":"Tone, layout rules, or brand guidance the agent reads before it designs.","design.saveWorkspace":"Save for this project","design.saveWorkspaceNamed":"Save for {name}","design.saveLibrary":"Save to library","design.clear":"Remove project override","design.saved":"Design system saved","design.preview":"Preview","design.previewHeading":"Quarterly review","design.previewBody":"Revenue grew in every region this quarter.","design.previewButton":"Primary action","card.created":"Created","card.updated":"Updated","card.working":"Writing the artifact...","card.failed":"The artifact was not saved","card.missing":"This result has no artifact details.","composer.label":"Artifacts","error.generic":"Something went wrong. Try again.","error.designInvalid":"The mockup source is not valid.","error.designIcon":"The mockup cannot use that icon.","error.designRender":"The mockup could not be rendered.","error.designTimeout":"The mockup took too long to render.","error.designUnavailable":"This runtime cannot render mockups.","error.unsupportedType":"That action is not available for this artifact.","error.sheetInvalid":"The sheet workbook is not valid.","error.notFound":"This artifact no longer exists.","error.stale":"The artifact changed. Reload to continue.","error.tooLarge":"The content is over the 2 MiB limit.","error.noWorkspace":"This session has no workspace.","error.forbidden":"That path is not allowed.","error.corrupt":"The artifact files are damaged.","error.tokens":"A design value is not valid CSS.","error.library":"The library folder cannot be created.","error.surface":"The artifact panel failed to draw.","error.surfaceHint":"Reload the window. Your artifacts are safe on disk.","action.retry":"Retry","action.reloadWindow":"Reload window","time.justNow":"just now","time.minutes":"{count} min ago","time.hours":"{count} h ago","time.days":"{count} d ago"},wn={"design.system":"\u547D\u540D\u8BBE\u8BA1\u7CFB\u7EDF","design.defaultChoice":"\u5F53\u524D\u9ED8\u8BA4","design.copy":"\u53E6\u5B58\u4E3A\u65B0\u7CFB\u7EDF","design.saveRevision":"\u4FDD\u5B58\u65B0\u4FEE\u8BA2","design.useDefault":"\u7528\u4E8E\u65B0\u4EA7\u7269","design.revision":"{name}\uFF0C\u4FEE\u8BA2 {revision}","design.catalogReload":"\u91CD\u65B0\u52A0\u8F7D\u76EE\u5F55\u5E76\u4FDD\u7559\u7F16\u8F91","design.unsavedSelection":"\u5207\u6362\u7CFB\u7EDF\u524D\u8BF7\u4FDD\u5B58\u6216\u653E\u5F03\u4EE4\u724C\u7F16\u8F91\u3002","design.discardEdits":"\u653E\u5F03\u4EE4\u724C\u7F16\u8F91","design.pinHint":"\u65B0\u4EA7\u7269\u4F1A\u56FA\u5B9A\u8FD9\u4E9B\u8BBE\u7F6E\u3002\u5DF2\u6709\u56FA\u5B9A\u8BBE\u7F6E\u7684\u4EA7\u7269\u53EA\u4F1A\u901A\u8FC7\u91CD\u65B0\u5E94\u7528\u8BBE\u8BA1\u66F4\u6539\u3002","generation.pinned":"\u5DF2\u56FA\u5B9A\u8BBE\u8BA1","generation.legacy":"\u5B9E\u65F6\u8BBE\u8BA1\uFF0C\u65E7\u7248\u672C","generation.rebase":"\u91CD\u65B0\u5E94\u7528\u8BBE\u8BA1","generation.confirm":"\u4F7F\u7528\u6B64\u8BBE\u8BA1\u521B\u5EFA\u65B0\u7248\u672C\uFF1F","generation.explain":"\u5185\u5BB9\u4FDD\u6301\u4E0D\u53D8\u3002\u672A\u4FDD\u5B58\u7684\u7F16\u8F91\u5C06\u5148\u4FDD\u5B58\u3002\u6240\u9009\u8BBE\u8BA1\u4FEE\u8BA2\u548C\u5F53\u524D\u6A21\u677F\u5C06\u56FA\u5B9A\u5728\u65B0\u7248\u672C\u4E2D\u3002","generation.apply":"\u4FDD\u5B58\u5E76\u5E94\u7528\u8BBE\u8BA1","generation.done":"\u8BBE\u8BA1\u5DF2\u5E94\u7528\u5230\u65B0\u7248\u672C","error.staleCatalog":"\u76EE\u5F55\u5DF2\u66F4\u6539\u3002\u8BF7\u91CD\u65B0\u52A0\u8F7D\u5E76\u68C0\u67E5\u7F16\u8F91\u540E\u518D\u4FDD\u5B58\u3002","error.writerBusy":"\u53E6\u4E00\u4E2A\u5199\u5165\u8FDB\u7A0B\u6216\u9057\u7559\u9501\u5360\u7528\u4E86\u6B64\u5B58\u50A8\u3002\u8BF7\u7B49\u5F85\u5199\u5165\u7ED3\u675F\uFF0C\u6216\u5728\u5D29\u6E83\u540E\u6062\u590D\u9501\u3002","error.unsupportedKit":"\u672A\u5B89\u88C5\u6B64\u4EA7\u7269\u4F7F\u7528\u7684\u7EC4\u4EF6\u5957\u4EF6\u3002\u8BF7\u5148\u5B89\u88C5\u5BF9\u5E94\u7248\u672C\u3002","agent.ask":"\u8BA9\u667A\u80FD\u4F53\u4FEE\u6539","agent.reference":"\u5728\u4EA7\u7269\u201C{title}\u201D\uFF08{id}\uFF0Cv{version}\uFF09\u4E2D\uFF1A","agent.referenceOld":"\u5728\u4EA7\u7269\u201C{title}\u201D\uFF08{id}\uFF0Cv{version}\uFF0C\u5F53\u524D\u7248\u672C\u4E3A v{current}\uFF09\u4E2D\uFF1A","agent.referenceProject":"\u5728\u4EA7\u7269\u201C{title}\u201D\uFF08{id}\uFF0C\u5DE5\u4F5C\u533A {workspaceId}\uFF0Cv{version}\uFF09\u4E2D\uFF1A","agent.referenceOldProject":"\u5728\u4EA7\u7269\u201C{title}\u201D\uFF08{id}\uFF0C\u5DE5\u4F5C\u533A {workspaceId}\uFF0Cv{version}\uFF0C\u5F53\u524D\u7248\u672C\u4E3A v{current}\uFF09\u4E2D\uFF1A","agent.added":"\u5DF2\u52A0\u5165\u6D88\u606F\u6846\u3002\u63CF\u8FF0\u8981\u4FEE\u6539\u7684\u5185\u5BB9\u540E\u53D1\u9001\u3002","agent.addedTruncated":"\u5DF2\u52A0\u5165\u6D88\u606F\u6846\u3002\u9009\u4E2D\u7684\u6587\u672C\u5DF2\u7F29\u77ED\u4E3A 2,000 \u4E2A\u5B57\u7B26\u3002","agent.insertFailed":"\u6D88\u606F\u6846\u6B63\u5FD9\uFF0C\u5DF2\u6539\u4E3A\u590D\u5236\u8BF7\u6C42\u3002","agent.copied":"\u5DF2\u590D\u5236\u3002\u7C98\u8D34\u5230\u5BF9\u8BDD\u4E2D\u540E\u53D1\u9001\u3002","agent.copyTitle":"\u590D\u5236\u8BF7\u6C42","card.creating":"\u6B63\u5728\u521B\u5EFA {title}","card.updating":"\u6B63\u5728\u66F4\u65B0 {title}","card.updatingUntitled":"\u6B63\u5728\u66F4\u65B0\u4EA7\u7269","card.openNamed":"\u6253\u5F00 {title}","tab.codeHint":"\u53EA\u8BFB\u4EE3\u7801\u3002\u9009\u4E2D\u6587\u672C\u5373\u53EF\u8BA9\u667A\u80FD\u4F53\u5904\u7406\u3002","tab.editSource":"\u7F16\u8F91\u4EE3\u7801","tab.deleteTitle":"\u79FB\u5230\u56DE\u6536\u7AD9\uFF1F","code.copy":"\u590D\u5236\u4EE3\u7801","dialog.close":"\u5173\u95ED","dialog.done":"\u5B8C\u6210","design.colorsDark":"\u6DF1\u8272\u914D\u8272","panel.layers":"\u56FE\u5C42","panel.properties":"\u5C5E\u6027","panel.none":"\u6CA1\u6709\u56FE\u5C42","panel.mixed":"\u6DF7\u5408","panel.expand":"\u5C55\u5F00","panel.collapse":"\u6298\u53E0","panel.show":"\u663E\u793A","panel.hide":"\u9690\u85CF","panel.lock":"\u9501\u5B9A","panel.unlock":"\u89E3\u9501","panel.rename":"\u91CD\u547D\u540D\u56FE\u5C42","panel.x":"X","panel.y":"Y","panel.rotation":"\u65CB\u8F6C","panel.radius":"\u5706\u89D2","panel.opacity":"\u4E0D\u900F\u660E\u5EA6","panel.visible":"\u53EF\u89C1","panel.hidden":"\u5DF2\u9690\u85CF","panel.family":"\u5B57\u4F53","panel.weight":"\u5B57\u91CD","panel.fontSize":"\u5B57\u53F7","panel.w":"\u5BBD","panel.h":"\u9AD8","panel.positionSize":"\u4F4D\u7F6E\u548C\u5C3A\u5BF8","panel.layerActions":"\u56FE\u5C42\u64CD\u4F5C","panel.duplicate":"\u590D\u5236","panel.forward":"\u5411\u524D\u79FB\u52A8","panel.backward":"\u5411\u540E\u79FB\u52A8","panel.align":"\u5BF9\u9F50","panel.alignLeft":"\u5DE6\u5BF9\u9F50","panel.alignCenterX":"\u6C34\u5E73\u5C45\u4E2D\u5BF9\u9F50","panel.alignRight":"\u53F3\u5BF9\u9F50","panel.alignTop":"\u9876\u5BF9\u9F50","panel.alignMiddle":"\u5782\u76F4\u5C45\u4E2D\u5BF9\u9F50","panel.alignBottom":"\u5E95\u5BF9\u9F50","panel.fill":"\u586B\u5145","panel.stroke":"\u63CF\u8FB9","panel.appearance":"\u5916\u89C2","panel.text":"\u6587\u672C","panel.selectLayerHint":"\u9009\u62E9\u4E00\u4E2A\u56FE\u5C42\u4EE5\u67E5\u770B\u5176\u5C5E\u6027\u3002","panel.selectTextHint":"\u9009\u62E9\u6587\u672C\u56FE\u5C42\u53EF\u4FEE\u6539\u5B57\u4F53\u3001\u5B57\u91CD\u548C\u5B57\u53F7\u3002","layer.parentLine":"{type}\uFF0C\u4F4D\u4E8E {parent}","layer.type.frame":"\u6846\u67B6","layer.type.section":"\u5206\u533A","layer.type.text":"\u6587\u672C","layer.type.rectangle":"\u77E9\u5F62","layer.type.ellipse":"\u692D\u5706","layer.type.line":"\u7EBF","layer.type.vector":"\u77E2\u91CF","layer.type.group":"\u7F16\u7EC4","layer.type.component":"\u7EC4\u4EF6","layer.type.instance":"\u5B9E\u4F8B","layer.type.other":"\u56FE\u5C42","canvas.viewMode":"\u67E5\u770B","canvas.editMode":"\u7F16\u8F91","canvas.opening":"\u6B63\u5728\u6253\u5F00\u753B\u5E03\u2026","canvas.startFailed":"\u753B\u5E03\u672A\u80FD\u542F\u52A8\uFF0C\u73B0\u663E\u793A\u5DF2\u4FDD\u5B58\u7684\u56FE\u7247\u3002","canvas.empty":"\u6B64\u539F\u578B\u8FD8\u6CA1\u6709\u56FE\u5C42\u3002\u5207\u6362\u5230\u7F16\u8F91\u6A21\u5F0F\u5373\u53EF\u7ED8\u5236\u3002","canvas.zoomControls":"\u7F29\u653E","canvas.zoomOut":"\u7F29\u5C0F","canvas.zoomIn":"\u653E\u5927","canvas.zoomMenu":"\u7F29\u653E\u7EA7\u522B","canvas.zoomValue":"{percent}%","canvas.inspector":"\u68C0\u67E5\u5668","canvas.closeInspector":"\u5173\u95ED\u68C0\u67E5\u5668","canvas.inspectorTabs":"\u68C0\u67E5\u5668\u5206\u533A","canvas.editOldVersion":"\u65E7\u7248\u672C\u4EC5\u53EF\u67E5\u770B\u3002\u6062\u590D\u6B64\u7248\u672C\u540E\u624D\u80FD\u7F16\u8F91\u3002","agent.quoteDesign":`\u56FE\u5C42\u201C{name}\u201D
|
|
47
47
|
\u8DEF\u5F84\uFF1A{path}
|
|
48
48
|
|
|
49
|
-
\u8BBE\u8BA1 JSX\uFF1A`,"agent.quoteCut":"\u8BBE\u8BA1 JSX \u5DF2\u7F29\u77ED\u4E3A {limit} \u4E2A\u5B57\u7B26\u3002","agent.addedTruncatedDesign":"\u5DF2\u52A0\u5165\u6D88\u606F\u6846\u3002\u56FE\u5C42\u4EE3\u7801\u5DF2\u7F29\u77ED\u4E3A 4,000 \u4E2A\u5B57\u7B26\u3002","canvas.toolbar":"\u753B\u5E03\u5DE5\u5177","canvas.tools":"\u5DE5\u5177","canvas.select":"\u9009\u62E9","canvas.hand":"\u6293\u624B","canvas.frame":"\u6846\u67B6","canvas.text":"\u6587\u672C","canvas.undo":"\u64A4\u9500","canvas.redo":"\u91CD\u505A","canvas.fit":"\u9002\u5E94","preview.loading":"\u6B63\u5728\u6E32\u67D3\u539F\u578B\u2026","preview.retry":"\u91CD\u65B0\u6E32\u67D3","preview.warnings":"\u9884\u89C8\u8B66\u544A","error.designIconNotFound":"\u8BE5\u56FE\u6807\u4E0D\u5728\u5185\u7F6E\u56FE\u6807\u96C6\u4E2D\u3002\u8BF7\u4F7F\u7528 Material Design Icons \u7684 mdi: \u540D\u79F0\u3002","design.display":"\u6807\u9898\u5B57\u4F53\u6808","composer.recent":"\u5F53\u524D\u9879\u76EE","composer.empty":"\u8FD8\u6CA1\u6709\u4EA7\u7269","composer.start":"\u4ECE\u8FD9\u91CC\u5F00\u59CB","composer.all":"\u5168\u90E8\u4EA7\u7269","gallery.copyPrompt":"\u590D\u5236\u63D0\u793A\u8BCD","gallery.copyPromptNamed":"\u590D\u5236\u201C{name}\u201D\u63D0\u793A\u8BCD","gallery.promptCopied":"\u63D0\u793A\u8BCD\u5DF2\u590D\u5236\u3002\u7C98\u8D34\u5230\u5BF9\u8BDD\u4E2D\u5373\u53EF\u3002","prompt.dashboard":"\u4EEA\u8868\u76D8","prompt.dashboardText":"\u521B\u5EFA\u4E00\u4E2A artifact \u9875\u9762\uFF1A\u4E00\u4E2A\u4EEA\u8868\u76D8\uFF0C\u5C55\u793A","prompt.explainer":"\u56FE\u89E3\u8BF4\u660E","prompt.explainerText":"\u521B\u5EFA\u4E00\u4E2A artifact \u9875\u9762\uFF1A\u4E00\u9875\u53EF\u89C6\u5316\u8BF4\u660E\uFF0C\u4E3B\u9898\u662F","prompt.report":"\u62A5\u544A","prompt.reportText":"\u521B\u5EFA\u4E00\u4E2A artifact \u6587\u6863\uFF1A\u4E00\u4EFD\u62A5\u544A\uFF0C\u4E3B\u9898\u662F","prompt.brief":"\u9879\u76EE\u7B80\u4ECB","prompt.briefText":"\u521B\u5EFA\u4E00\u4E2A artifact \u6587\u6863\uFF1A\u4E00\u4EFD\u9879\u76EE\u7B80\u4ECB\uFF0C\u5305\u542B\u80CC\u666F\u3001\u76EE\u6807\u3001\u8303\u56F4\u548C\u5F85\u5B9A\u95EE\u9898\uFF0C\u9879\u76EE\u662F","prompt.sheet":"\u8868\u683C","prompt.sheetText":"\u521B\u5EFA\u4E00\u4E2A artifact \u8868\u683C\uFF1A\u4E00\u4E2A\u7528\u4E8E\u8DDF\u8E2A\u4EE5\u4E0B\u5185\u5BB9\u7684\u7535\u5B50\u8868\u683C\uFF1A","filter.type":"\u6309\u7C7B\u578B\u7B5B\u9009","tab.mode":"\u9875\u9762\u89C6\u56FE","tab.manualSave":"\u9875\u9762\u6E90\u7801\u9700\u70B9\u51FB\u4FDD\u5B58\u6216\u6309 Ctrl/Cmd+S\u3002","tab.manualSaveDesign":"\u539F\u578B\u6E90\u7801\u9700\u70B9\u51FB\u4FDD\u5B58\u6216\u6309 Ctrl/Cmd+S\u3002","tab.versionPicker":"\u9009\u62E9\u7248\u672C","tab.currentVersion":"\u5F53\u524D","tab.allVersions":"\u5168\u90E8\u7248\u672C","tab.agentUpdate":"\u5DF2\u66F4\u65B0\u5230 v{version}","tab.viewHistory":"\u67E5\u770B\u5386\u53F2","tab.dismiss":"\u5173\u95ED","tab.leaveTitle":"\u672A\u4FDD\u5B58\u7684\u66F4\u6539","tab.leaveHint":"\u7EE7\u7EED\u524D\u4FDD\u5B58\u66F4\u6539\uFF0C\u6216\u653E\u5F03\u5B83\u4EEC\u3002","tab.leaveDiscard":"\u653E\u5F03","tab.leaveSave":"\u4FDD\u5B58","tab.copyDraft":"\u590D\u5236\u6211\u7684\u8349\u7A3F","tab.discardReload":"\u653E\u5F03\u6211\u7684\u66F4\u6539\u5E76\u91CD\u65B0\u52A0\u8F7D","history.close":"\u5173\u95ED\u5386\u53F2","action.copied":"\u5DF2\u590D\u5236","action.copyFailed":"\u590D\u5236\u88AB\u963B\u6B62\u3002\u8BF7\u9009\u4E2D\u6587\u672C\u540E\u624B\u52A8\u590D\u5236\u3002","format.toolbar":"\u6587\u6863\u683C\u5F0F","format.heading":"\u6807\u9898","format.bold":"\u7C97\u4F53","format.italic":"\u659C\u4F53","format.bulletList":"\u9879\u76EE\u7B26\u53F7\u5217\u8868","format.orderedList":"\u7F16\u53F7\u5217\u8868","format.codeBlock":"\u4EE3\u7801\u5757",panel:"\u4EA7\u7269","right.guideHint":"\u6B64\u9879\u76EE\u4E2D\u7684\u9875\u9762\u3001\u6587\u6863\u548C\u539F\u578B\u3002","action.back":"\u8FD4\u56DE","scope.label":"\u8303\u56F4","scope.all":"\u5168\u90E8\u9879\u76EE","scope.workspace":"\u5F53\u524D\u9879\u76EE","scope.library":"\u8D44\u6599\u5E93","type.page":"\u9875\u9762","type.doc":"\u6587\u6863","type.design":"\u539F\u578B","type.sheet":"\u8868\u683C","type.all":"\u5168\u90E8\u7C7B\u578B","gallery.search":"\u641C\u7D22\u4EA7\u7269","gallery.searchLabel":"\u6309\u6807\u9898\u641C\u7D22","gallery.create":"\u65B0\u5EFA\u4EA7\u7269","gallery.newPage":"\u65B0\u5EFA\u9875\u9762","gallery.newDoc":"\u65B0\u5EFA\u6587\u6863","gallery.newDesign":"\u65B0\u5EFA\u539F\u578B","gallery.newSheet":"\u65B0\u5EFA\u8868\u683C","gallery.design":"\u8BBE\u8BA1\u7CFB\u7EDF","gallery.refresh":"\u5237\u65B0","gallery.more":"\u663E\u793A\u66F4\u591A","gallery.truncated":"\u4EC5\u626B\u63CF\u524D 500 \u4E2A\u4EA7\u7269\u3002","gallery.failedProjects":"\u90E8\u5206\u6765\u6E90\u52A0\u8F7D\u5931\u8D25\u3002","gallery.version":"v{version}","gallery.updated":"\u66F4\u65B0\u4E8E {time}","gallery.count":"{count} \u4E2A\u4EA7\u7269","gallery.pinned":"\u5DF2\u7F6E\u9876","gallery.recent":"\u6700\u8FD1\u66F4\u65B0","gallery.coverTitle":"{title} \u7684\u9884\u89C8","gallery.coverFailed":"\u9884\u89C8\u4E0D\u53EF\u7528","gallery.pin":"\u7F6E\u9876 {title}","gallery.unpin":"\u53D6\u6D88\u7F6E\u9876 {title}","gallery.allPinned":"\u8FD9\u91CC\u7684\u4EA7\u7269\u90FD\u5DF2\u7F6E\u9876\u3002","empty.workspaceTitle":"\u672C\u9879\u76EE\u8FD8\u6CA1\u6709\u4EA7\u7269","empty.workspaceHint":"\u8BA9\u667A\u80FD\u4F53\u751F\u6210\u4EEA\u8868\u76D8\u3001\u62A5\u544A\u6216\u5355\u9875\uFF0C\u6216\u5728\u8FD9\u91CC\u65B0\u5EFA\u3002","empty.allTitle":"\u8FD8\u6CA1\u6709\u4EA7\u7269","empty.allHint":"\u8FD9\u91CC\u663E\u793A\u6240\u6709\u9879\u76EE\u548C\u8D44\u6599\u5E93\u4E2D\u7684\u4EA7\u7269\u3002","empty.libraryTitle":"\u8D44\u6599\u5E93\u4E3A\u7A7A","empty.libraryHint":"\u8D44\u6599\u5E93\u4E2D\u7684\u4EA7\u7269\u5728\u6240\u6709\u9879\u76EE\u53EF\u7528\u3002\u8BA9\u667A\u80FD\u4F53\u628A\u4EA7\u7269\u4FDD\u5B58\u5230\u8D44\u6599\u5E93\u3002","empty.noMatch":"\u6CA1\u6709\u5339\u914D\u7684\u4EA7\u7269\u3002","empty.typeMatch":"\u6CA1\u6709\u7B26\u5408\u7C7B\u578B\u7B5B\u9009\u7684{type}\u4EA7\u7269\u3002","empty.noWorkspace":"\u5728\u5DE5\u4F5C\u533A\u4E2D\u6253\u5F00\u4F1A\u8BDD\u4EE5\u67E5\u770B\u5176\u4EA7\u7269\u3002","empty.loading":"\u52A0\u8F7D\u4E2D...","create.title":"\u65B0\u5EFA{type}","create.name":"\u6807\u9898","create.scope":"\u4FDD\u5B58\u5230","create.submit":"\u521B\u5EFA","create.cancel":"\u53D6\u6D88","create.untitledPage":"\u672A\u547D\u540D\u9875\u9762","create.untitledDesign":"\u672A\u547D\u540D\u539F\u578B","create.untitledDoc":"\u672A\u547D\u540D\u6587\u6863","create.untitledSheet":"\u672A\u547D\u540D\u8868\u683C","sheet.toolbar":"\u8868\u683C\u5DE5\u5177","sheet.selection":"\u9009\u4E2D\u7684\u5355\u5143\u683C","sheet.formulaBar":"\u7F16\u8F91\u680F","sheet.selectColumn":"\u9009\u62E9\u5217 {name}","sheet.selectRow":"\u9009\u62E9\u884C {row}","sheet.undo":"\u64A4\u9500","sheet.redo":"\u91CD\u505A","sheet.bold":"\u7C97\u4F53","sheet.italic":"\u659C\u4F53","sheet.underline":"\u4E0B\u5212\u7EBF","sheet.alignLeft":"\u5DE6\u5BF9\u9F50","sheet.alignCenter":"\u5C45\u4E2D\u5BF9\u9F50","sheet.alignRight":"\u53F3\u5BF9\u9F50","sheet.numberFormat":"\u6570\u5B57\u683C\u5F0F","sheet.format.general":"\u5E38\u89C4","sheet.format.number":"\u6570\u5B57","sheet.format.integer":"\u6574\u6570","sheet.format.currency":"\u8D27\u5E01","sheet.format.percent":"\u767E\u5206\u6BD4","sheet.format.date":"\u65E5\u671F","sheet.fillColor":"\u586B\u5145\u989C\u8272","sheet.textColor":"\u6587\u5B57\u989C\u8272","sheet.invalid":"\u65E0\u6CD5\u8BFB\u53D6\u6B64\u8868\u683C\u3002","sheet.editCell":"\u7F16\u8F91\u5355\u5143\u683C {ref}","sheet.sheets":"\u5DE5\u4F5C\u8868","sheet.addSheet":"\u6DFB\u52A0\u5DE5\u4F5C\u8868","sheet.sheetName":"\u5DE5\u4F5C\u8868\u540D\u79F0","sheet.sheetActions":"\u5DE5\u4F5C\u8868\u64CD\u4F5C","sheet.renameSheet":"\u91CD\u547D\u540D\u5DE5\u4F5C\u8868","sheet.deleteSheet":"\u5220\u9664\u5DE5\u4F5C\u8868","sheet.deleteConfirm":"\u5220\u9664\u201C{name}\u201D\uFF1F\u5176\u5355\u5143\u683C\u4F1A\u5728\u65B0\u7248\u672C\u4E2D\u79FB\u9664\uFF0C\u5386\u53F2\u7248\u672C\u4ECD\u4FDD\u7559\u65E7\u5185\u5BB9\u3002","sheet.delete":"\u5220\u9664","sheet.cancel":"\u53D6\u6D88","tab.preview":"\u9884\u89C8","tab.source":"\u4EE3\u7801","tab.history":"\u5386\u53F2","tab.export":"\u5BFC\u51FA","tab.reload":"\u91CD\u65B0\u52A0\u8F7D","tab.rename":"\u91CD\u547D\u540D","tab.delete":"\u79FB\u5230\u56DE\u6536\u7AD9","tab.deleteConfirm":"\u201C{title}\u201D\u5C06\u79FB\u5230\u56DE\u6536\u7AD9\uFF0C\u6587\u4EF6\u4F1A\u4FDD\u7559 7 \u5929\u3002","tab.save":"\u4FDD\u5B58","tab.saving":"\u6B63\u5728\u4FDD\u5B58...","tab.saved":"\u5DF2\u4FDD\u5B58","tab.readOnly":"\u53EA\u8BFB","tab.saveFailed":"\u4FDD\u5B58\u5931\u8D25","tab.unsaved":"\u6709\u672A\u4FDD\u5B58\u7684\u66F4\u6539","tab.frameTitle":"\u4EA7\u7269\u9884\u89C8\uFF1A{title}","tab.versionOf":"\u7248\u672C {version}","tab.viewingOld":"\u6B63\u5728\u67E5\u770B\u7248\u672C {version}\uFF0C\u5F53\u524D\u7248\u672C\u4E3A {current}\u3002","tab.backToCurrent":"\u56DE\u5230\u5F53\u524D\u7248\u672C","tab.restoreThis":"\u6062\u590D\u6B64\u7248\u672C","tab.conflictTitle":"\u6B64\u4EA7\u7269\u5DF2\u66F4\u6539","tab.conflictHint":"\u7F16\u8F91\u671F\u95F4\u4FDD\u5B58\u4E86\u66F4\u65B0\u7248\u672C\u3002\u8349\u7A3F\u4ECD\u4FDD\u7559\u5728\u8FD9\u91CC\u3002\u653E\u5F03\u524D\u53EF\u5148\u590D\u5236\u8349\u7A3F\uFF0C\u518D\u91CD\u65B0\u52A0\u8F7D\u6700\u65B0\u7248\u672C\u3002","tab.deleted":"\u6B64\u4EA7\u7269\u5DF2\u4E0D\u5B58\u5728","tab.deletedHint":"\u5B83\u5DF2\u88AB\u79FB\u5230\u56DE\u6536\u7AD9\u6216\u5220\u9664\u3002","tab.close":"\u5173\u95ED\u6807\u7B7E\u9875","history.title":"\u7248\u672C","history.current":"\u5F53\u524D","history.byAgent":"\u667A\u80FD\u4F53","history.byUser":"\u4F60","history.restored":"\u4ECE v{version} \u6062\u590D","history.created":"\u521B\u5EFA","history.updated":"\u7F16\u8F91","history.empty":"\u6CA1\u6709\u66F4\u65E9\u7684\u7248\u672C\u3002","export.html":"HTML \u6587\u4EF6","export.png":"PNG \u56FE\u7247","export.svg":"SVG \u56FE\u7247","export.fig":"OpenPencil \u6587\u6863\uFF08.fig\uFF09","export.md":"Markdown \u6587\u4EF6","export.docx":"Word \u6587\u6863","export.csv":"CSV \u6587\u4EF6","export.xlsx":"Excel \u5DE5\u4F5C\u7C3F","export.print":"\u6253\u5370\u6216\u53E6\u5B58\u4E3A PDF","export.done":"\u5DF2\u5C06 {name} \u4FDD\u5B58\u5230 {path}","design.title":"\u8BBE\u8BA1\u7CFB\u7EDF","design.hint":"\u9875\u9762\u548C\u6587\u6863\u901A\u8FC7 CSS \u53D8\u91CF\u4F7F\u7528\u8FD9\u4E9B\u503C\u3002","design.source.workspace":"\u672C\u9879\u76EE\u8986\u76D6\u4E86\u8D44\u6599\u5E93\u8BBE\u7F6E\u3002","design.source.library":"\u7EE7\u627F\u81EA\u8D44\u6599\u5E93\u3002","design.source.default":"\u5185\u7F6E\u9ED8\u8BA4\u503C\u3002\u4FDD\u5B58\u540E\u5373\u53EF\u81EA\u5B9A\u4E49\u3002","design.name":"\u540D\u79F0","design.colors":"\u989C\u8272","design.color.primary":"\u4E3B\u8272","design.color.accent":"\u5F3A\u8C03\u8272","design.color.surface":"\u5E95\u8272","design.color.text":"\u6587\u5B57","design.color.muted":"\u6B21\u8981","design.color.background":"\u9875\u9762\u80CC\u666F","design.color.raised":"\u6B21\u7EA7\u80CC\u666F","design.color.border":"\u5206\u9694\u7EBF","design.color.control":"\u63A7\u4EF6\u8FB9\u6846","design.color.action":"\u64CD\u4F5C\u80CC\u666F","design.color.actionText":"\u64CD\u4F5C\u6587\u5B57","design.color.focus":"\u7126\u70B9\u8F6E\u5ED3","design.color.success":"\u6210\u529F","design.color.warning":"\u8B66\u544A","design.color.danger":"\u5371\u9669","design.type":"\u5B57\u4F53","design.font":"\u6B63\u6587\u5B57\u4F53","design.mono":"\u4EE3\u7801\u5B57\u4F53","design.radius":"\u5706\u89D2","design.radius.sm":"\u5C0F","design.radius.md":"\u4E2D","design.radius.lg":"\u5927","design.notes":"\u7ED9\u667A\u80FD\u4F53\u7684\u8BF4\u660E","design.notesHint":"\u667A\u80FD\u4F53\u8BBE\u8BA1\u524D\u4F1A\u8BFB\u53D6\u7684\u8BED\u6C14\u3001\u6392\u7248\u89C4\u5219\u6216\u54C1\u724C\u89C4\u8303\u3002","design.saveWorkspace":"\u4FDD\u5B58\u5230\u672C\u9879\u76EE","design.saveWorkspaceNamed":"\u4FDD\u5B58\u5230 {name}","design.saveLibrary":"\u4FDD\u5B58\u5230\u8D44\u6599\u5E93","design.clear":"\u79FB\u9664\u9879\u76EE\u8986\u76D6","design.saved":"\u8BBE\u8BA1\u7CFB\u7EDF\u5DF2\u4FDD\u5B58","design.preview":"\u9884\u89C8","design.previewHeading":"\u5B63\u5EA6\u56DE\u987E","design.previewBody":"\u672C\u5B63\u5EA6\u5404\u533A\u57DF\u6536\u5165\u5747\u6709\u589E\u957F\u3002","design.previewButton":"\u4E3B\u8981\u64CD\u4F5C","card.created":"\u5DF2\u521B\u5EFA","card.updated":"\u5DF2\u66F4\u65B0","card.working":"\u6B63\u5728\u5199\u5165\u4EA7\u7269...","card.failed":"\u4EA7\u7269\u672A\u4FDD\u5B58","card.missing":"\u6B64\u7ED3\u679C\u6CA1\u6709\u4EA7\u7269\u4FE1\u606F\u3002","composer.label":"\u4EA7\u7269","error.generic":"\u51FA\u9519\u4E86\uFF0C\u8BF7\u91CD\u8BD5\u3002","error.designInvalid":"\u539F\u578B\u6E90\u7801\u65E0\u6548\u3002","error.designIcon":"\u8BE5\u539F\u578B\u65E0\u6CD5\u4F7F\u7528\u6B64\u56FE\u6807\u3002","error.designRender":"\u539F\u578B\u65E0\u6CD5\u6E32\u67D3\u3002","error.designTimeout":"\u539F\u578B\u6E32\u67D3\u8D85\u65F6\u3002","error.designUnavailable":"\u6B64\u8FD0\u884C\u65F6\u65E0\u6CD5\u6E32\u67D3\u539F\u578B\u3002","error.unsupportedType":"\u8BE5\u4EA7\u7269\u4E0D\u652F\u6301\u6B64\u64CD\u4F5C\u3002","error.sheetInvalid":"\u8868\u683C\u6570\u636E\u65E0\u6548\u3002","error.notFound":"\u6B64\u4EA7\u7269\u5DF2\u4E0D\u5B58\u5728\u3002","error.stale":"\u4EA7\u7269\u5DF2\u66F4\u6539\uFF0C\u8BF7\u91CD\u65B0\u52A0\u8F7D\u3002","error.tooLarge":"\u5185\u5BB9\u8D85\u8FC7 2 MiB \u4E0A\u9650\u3002","error.noWorkspace":"\u6B64\u4F1A\u8BDD\u6CA1\u6709\u5DE5\u4F5C\u533A\u3002","error.forbidden":"\u4E0D\u5141\u8BB8\u8BBF\u95EE\u8BE5\u8DEF\u5F84\u3002","error.corrupt":"\u4EA7\u7269\u6587\u4EF6\u5DF2\u635F\u574F\u3002","error.tokens":"\u67D0\u4E2A\u8BBE\u8BA1\u503C\u4E0D\u662F\u6709\u6548\u7684 CSS\u3002","error.library":"\u65E0\u6CD5\u521B\u5EFA\u8D44\u6599\u5E93\u6587\u4EF6\u5939\u3002","error.surface":"\u4EA7\u7269\u9762\u677F\u7ED8\u5236\u5931\u8D25\u3002","error.surfaceHint":"\u8BF7\u91CD\u65B0\u52A0\u8F7D\u7A97\u53E3\u3002\u4F60\u7684\u4EA7\u7269\u4ECD\u5B89\u5168\u4FDD\u5B58\u5728\u78C1\u76D8\u4E0A\u3002","action.retry":"\u91CD\u8BD5","action.reloadWindow":"\u91CD\u65B0\u52A0\u8F7D\u7A97\u53E3","time.justNow":"\u521A\u521A","time.minutes":"{count} \u5206\u949F\u524D","time.hours":"{count} \u5C0F\u65F6\u524D","time.days":"{count} \u5929\u524D"};function ea(e,t,a=Date.now()){let r=Math.max(0,a-Date.parse(t)),n=Math.floor(r/6e4);if(n<1)return e("time.justNow");if(n<60)return e("time.minutes",{count:n});let o=Math.floor(n/60);if(o<24)return e("time.hours",{count:o});let i=Math.floor(o/24);return i<7?e("time.days",{count:i}):new Date(t).toLocaleDateString()}var ve=require("react/jsx-runtime");function oi(e,t){let a=t.source.origin==="agent"?e("history.byAgent"):e("history.byUser"),r=t.source.action==="restore"&&t.source.restoredFrom!==void 0?e("history.restored",{version:t.source.restoredFrom}):t.source.action==="create"?e("history.created"):e("history.updated");return`${a} \xB7 ${r} \xB7 ${ea(e,t.createdAt)}`}function on({t:e,versions:t,failed:a,current:r,selected:n,onSelect:o}){return(0,ve.jsxs)("div",{className:"art-history-body",children:[t===null?(0,ve.jsx)("p",{className:"art-note",children:e("empty.loading")}):null,a?(0,ve.jsx)("p",{className:"art-note",children:e("error.generic")}):null,!a&&t!==null&&t.length<=1?(0,ve.jsx)("p",{className:"art-note",children:e("history.empty")}):null,t?.map(i=>(0,ve.jsxs)("button",{type:"button",className:"art-version","aria-current":i.version===n?"true":void 0,onClick:()=>o(i.version),children:[(0,ve.jsxs)("span",{className:"art-version-top",children:[(0,ve.jsx)("span",{children:e("tab.versionOf",{version:i.version})}),i.version===r?(0,ve.jsx)("span",{className:"art-badge",children:e("history.current")}):null]}),(0,ve.jsx)("span",{className:"art-version-sub",children:oi(e,i)})]},i.version))]})}var Ce=require("react");var He=require("react/jsx-runtime");function ta({content:e,designCss:t,title:a,frameTitle:r,dark:n=!1,onSelectionText:o}){let[i,s]=(0,Ce.useState)(null),[d,l]=(0,Ce.useState)(!1),h=(0,Ce.useRef)(0),x=(0,Ce.useRef)(null),b=(0,Ce.useRef)(o);b.current=o;let p=o!==void 0;return(0,Ce.useEffect)(()=>{h.current=0,l(!1);let u=URL.createObjectURL(new Blob([Zt(e,t,a,n?"dark":"light",p)],{type:"text/html"}));return s(u),()=>URL.revokeObjectURL(u)},[e,t,a,n,p]),(0,Ce.useEffect)(()=>{if(!p)return;let u=y=>{if(x.current===null||h.current>1||y.source!==x.current.contentWindow)return;let g=tn(y.data);g!==void 0&&b.current?.(g)};return window.addEventListener("message",u),()=>window.removeEventListener("message",u)},[p]),d?(0,He.jsx)("div",{className:"art-center",role:"alert",children:a}):i===null?null:(0,He.jsx)("iframe",{ref:x,className:"art-frame",title:r,sandbox:en,referrerPolicy:"no-referrer",src:i,onLoad:()=>{h.current+=1,h.current>1&&l(!0)}},i)}function sn({value:e,readOnly:t,label:a,hint:r,onChange:n,onSave:o,onSelectionText:i}){let s=d=>{t||i?.(d.value.slice(d.selectionStart,d.selectionEnd))};return(0,He.jsxs)("div",{className:"art-source-wrap",children:[r===void 0?null:(0,He.jsx)("div",{className:"art-code-bar",children:(0,He.jsx)("span",{children:r})}),(0,He.jsx)("textarea",{className:"art-source","aria-label":a,spellCheck:!1,readOnly:t,value:e,autoFocus:!t,onChange:d=>{n(d.target.value),i?.("")},onSelect:d=>s(d.currentTarget),onMouseUp:d=>s(d.currentTarget),onKeyUp:d=>s(d.currentTarget),onKeyDown:d=>{if((d.ctrlKey||d.metaKey)&&d.key.toLowerCase()==="s"){d.preventDefault(),o();return}if(d.key==="Tab"&&!d.shiftKey&&!t){d.preventDefault();let l=d.currentTarget,h=l.selectionStart,x=l.selectionEnd,b=e.slice(0,h)+" "+e.slice(x);n(b),requestAnimationFrame(()=>l.setSelectionRange(h+2,h+2))}}})]})}var ge=require("react");var ot=require("react/jsx-runtime"),Ct=null;function ii(){if(Ct===null){let e=globalThis.__dshArtifactsRequireAsync;if(typeof e!="function")return Promise.reject(new Error("The sheet editor loader is unavailable."));Ct=e("./client.sheet.js"),Ct.catch(()=>{Ct=null})}return Ct}function ln(e){let t=(0,ge.useRef)(null),a=(0,ge.useRef)(null),[r,n]=(0,ge.useState)("loading"),o=(0,ge.useRef)({onChange:e.onChange,onSave:e.onSave,onSelectionText:e.onSelectionText??(()=>{}),t:e.t});o.current.onChange=e.onChange,o.current.onSave=e.onSave,o.current.onSelectionText=e.onSelectionText??(()=>{}),o.current.t=e.t;let i=(0,ge.useMemo)(()=>e.design===void 0?{}:{...Ut(e.design,e.dark===!0),colorScheme:e.dark===!0?"dark":"light"},[e.design,e.dark]);return(0,ge.useEffect)(()=>{let s=!1;return ii().then(d=>{s||t.current===null||(a.current=d.mountSheetEditor({element:t.current,content:e.content,editable:e.editable,label:e.label,...e.design===void 0?{}:{design:e.design},dark:e.dark===!0,live:o}),n("ready"))}).catch(()=>{s||n("failed")}),()=>{s=!0,a.current?.destroy(),a.current=null}},[]),(0,ge.useEffect)(()=>{if(r!=="ready")return;let s=a.current;s!==null&&s.getJson()!==e.content&&s.setContent(e.content)},[e.revision,e.content,r]),(0,ge.useEffect)(()=>{a.current?.setEditable(e.editable)},[e.editable]),(0,ge.useEffect)(()=>{a.current?.setAppearance(e.design,e.dark===!0)},[e.design,e.dark]),(0,ot.jsxs)("div",{className:"art-sheet",style:i,children:[r==="loading"?(0,ot.jsx)("p",{className:"art-note",children:e.loadingLabel}):null,r==="failed"?(0,ot.jsx)("p",{className:"art-note",children:e.failedLabel}):null,(0,ot.jsx)("div",{className:"art-sheet-mount",ref:t})]})}function Oa(e,t=2e3){let a=e.replace(/\r\n/g,`
|
|
49
|
+
\u8BBE\u8BA1 JSX\uFF1A`,"agent.quoteCut":"\u8BBE\u8BA1 JSX \u5DF2\u7F29\u77ED\u4E3A {limit} \u4E2A\u5B57\u7B26\u3002","agent.addedTruncatedDesign":"\u5DF2\u52A0\u5165\u6D88\u606F\u6846\u3002\u56FE\u5C42\u4EE3\u7801\u5DF2\u7F29\u77ED\u4E3A 4,000 \u4E2A\u5B57\u7B26\u3002","canvas.toolbar":"\u753B\u5E03\u5DE5\u5177","canvas.tools":"\u5DE5\u5177","canvas.select":"\u9009\u62E9","canvas.hand":"\u6293\u624B","canvas.frame":"\u6846\u67B6","canvas.text":"\u6587\u672C","canvas.rectangle":"\u77E9\u5F62","canvas.ellipse":"\u692D\u5706","canvas.line":"\u76F4\u7EBF","canvas.pen":"\u94A2\u7B14","canvas.undo":"\u64A4\u9500","canvas.redo":"\u91CD\u505A","canvas.fit":"\u9002\u5E94","preview.loading":"\u6B63\u5728\u6E32\u67D3\u539F\u578B\u2026","preview.retry":"\u91CD\u65B0\u6E32\u67D3","preview.warnings":"\u9884\u89C8\u8B66\u544A","error.designIconNotFound":"\u8BE5\u56FE\u6807\u4E0D\u5728\u5185\u7F6E\u56FE\u6807\u96C6\u4E2D\u3002\u8BF7\u4F7F\u7528 Material Design Icons \u7684 mdi: \u540D\u79F0\u3002","design.display":"\u6807\u9898\u5B57\u4F53\u6808","composer.recent":"\u5F53\u524D\u9879\u76EE","composer.empty":"\u8FD8\u6CA1\u6709\u4EA7\u7269","composer.start":"\u4ECE\u8FD9\u91CC\u5F00\u59CB","composer.all":"\u5168\u90E8\u4EA7\u7269","gallery.copyPrompt":"\u590D\u5236\u63D0\u793A\u8BCD","gallery.copyPromptNamed":"\u590D\u5236\u201C{name}\u201D\u63D0\u793A\u8BCD","gallery.promptCopied":"\u63D0\u793A\u8BCD\u5DF2\u590D\u5236\u3002\u7C98\u8D34\u5230\u5BF9\u8BDD\u4E2D\u5373\u53EF\u3002","prompt.dashboard":"\u4EEA\u8868\u76D8","prompt.dashboardText":"\u521B\u5EFA\u4E00\u4E2A artifact \u9875\u9762\uFF1A\u4E00\u4E2A\u4EEA\u8868\u76D8\uFF0C\u5C55\u793A","prompt.explainer":"\u56FE\u89E3\u8BF4\u660E","prompt.explainerText":"\u521B\u5EFA\u4E00\u4E2A artifact \u9875\u9762\uFF1A\u4E00\u9875\u53EF\u89C6\u5316\u8BF4\u660E\uFF0C\u4E3B\u9898\u662F","prompt.report":"\u62A5\u544A","prompt.reportText":"\u521B\u5EFA\u4E00\u4E2A artifact \u6587\u6863\uFF1A\u4E00\u4EFD\u62A5\u544A\uFF0C\u4E3B\u9898\u662F","prompt.brief":"\u9879\u76EE\u7B80\u4ECB","prompt.briefText":"\u521B\u5EFA\u4E00\u4E2A artifact \u6587\u6863\uFF1A\u4E00\u4EFD\u9879\u76EE\u7B80\u4ECB\uFF0C\u5305\u542B\u80CC\u666F\u3001\u76EE\u6807\u3001\u8303\u56F4\u548C\u5F85\u5B9A\u95EE\u9898\uFF0C\u9879\u76EE\u662F","prompt.sheet":"\u8868\u683C","prompt.sheetText":"\u521B\u5EFA\u4E00\u4E2A artifact \u8868\u683C\uFF1A\u4E00\u4E2A\u7528\u4E8E\u8DDF\u8E2A\u4EE5\u4E0B\u5185\u5BB9\u7684\u7535\u5B50\u8868\u683C\uFF1A","filter.type":"\u6309\u7C7B\u578B\u7B5B\u9009","tab.mode":"\u9875\u9762\u89C6\u56FE","tab.manualSave":"\u9875\u9762\u6E90\u7801\u9700\u70B9\u51FB\u4FDD\u5B58\u6216\u6309 Ctrl/Cmd+S\u3002","tab.manualSaveDesign":"\u539F\u578B\u6E90\u7801\u9700\u70B9\u51FB\u4FDD\u5B58\u6216\u6309 Ctrl/Cmd+S\u3002","tab.designWarnings":"\u8BBE\u8BA1\u8B66\u544A\uFF08\u7248\u672C {version}\uFF09","tab.versionPicker":"\u9009\u62E9\u7248\u672C","tab.currentVersion":"\u5F53\u524D","tab.allVersions":"\u5168\u90E8\u7248\u672C","tab.agentUpdate":"\u5DF2\u66F4\u65B0\u5230 v{version}","tab.viewHistory":"\u67E5\u770B\u5386\u53F2","tab.dismiss":"\u5173\u95ED","tab.leaveTitle":"\u672A\u4FDD\u5B58\u7684\u66F4\u6539","tab.leaveHint":"\u7EE7\u7EED\u524D\u4FDD\u5B58\u66F4\u6539\uFF0C\u6216\u653E\u5F03\u5B83\u4EEC\u3002","tab.leaveDiscard":"\u653E\u5F03","tab.leaveSave":"\u4FDD\u5B58","tab.copyDraft":"\u590D\u5236\u6211\u7684\u8349\u7A3F","tab.discardReload":"\u653E\u5F03\u6211\u7684\u66F4\u6539\u5E76\u91CD\u65B0\u52A0\u8F7D","history.close":"\u5173\u95ED\u5386\u53F2","action.copied":"\u5DF2\u590D\u5236","action.copyFailed":"\u590D\u5236\u88AB\u963B\u6B62\u3002\u8BF7\u9009\u4E2D\u6587\u672C\u540E\u624B\u52A8\u590D\u5236\u3002","format.toolbar":"\u6587\u6863\u683C\u5F0F","format.heading":"\u6807\u9898","format.bold":"\u7C97\u4F53","format.italic":"\u659C\u4F53","format.bulletList":"\u9879\u76EE\u7B26\u53F7\u5217\u8868","format.orderedList":"\u7F16\u53F7\u5217\u8868","format.codeBlock":"\u4EE3\u7801\u5757",panel:"\u4EA7\u7269","right.guideHint":"\u6B64\u9879\u76EE\u4E2D\u7684\u9875\u9762\u3001\u6587\u6863\u548C\u539F\u578B\u3002","action.back":"\u8FD4\u56DE","scope.label":"\u8303\u56F4","scope.all":"\u5168\u90E8\u9879\u76EE","scope.workspace":"\u5F53\u524D\u9879\u76EE","scope.library":"\u8D44\u6599\u5E93","type.page":"\u9875\u9762","type.doc":"\u6587\u6863","type.design":"\u539F\u578B","type.sheet":"\u8868\u683C","type.all":"\u5168\u90E8\u7C7B\u578B","gallery.search":"\u641C\u7D22\u4EA7\u7269","gallery.searchLabel":"\u6309\u6807\u9898\u641C\u7D22","gallery.create":"\u65B0\u5EFA\u4EA7\u7269","gallery.newPage":"\u65B0\u5EFA\u9875\u9762","gallery.newDoc":"\u65B0\u5EFA\u6587\u6863","gallery.newDesign":"\u65B0\u5EFA\u539F\u578B","gallery.newSheet":"\u65B0\u5EFA\u8868\u683C","gallery.design":"\u8BBE\u8BA1\u7CFB\u7EDF","gallery.refresh":"\u5237\u65B0","gallery.more":"\u663E\u793A\u66F4\u591A","gallery.truncated":"\u4EC5\u626B\u63CF\u524D 500 \u4E2A\u4EA7\u7269\u3002","gallery.failedProjects":"\u90E8\u5206\u6765\u6E90\u52A0\u8F7D\u5931\u8D25\u3002","gallery.version":"v{version}","gallery.updated":"\u66F4\u65B0\u4E8E {time}","gallery.count":"{count} \u4E2A\u4EA7\u7269","gallery.pinned":"\u5DF2\u7F6E\u9876","gallery.recent":"\u6700\u8FD1\u66F4\u65B0","gallery.coverTitle":"{title} \u7684\u9884\u89C8","gallery.coverFailed":"\u9884\u89C8\u4E0D\u53EF\u7528","gallery.pin":"\u7F6E\u9876 {title}","gallery.unpin":"\u53D6\u6D88\u7F6E\u9876 {title}","gallery.allPinned":"\u8FD9\u91CC\u7684\u4EA7\u7269\u90FD\u5DF2\u7F6E\u9876\u3002","empty.workspaceTitle":"\u672C\u9879\u76EE\u8FD8\u6CA1\u6709\u4EA7\u7269","empty.workspaceHint":"\u8BA9\u667A\u80FD\u4F53\u751F\u6210\u4EEA\u8868\u76D8\u3001\u62A5\u544A\u6216\u5355\u9875\uFF0C\u6216\u5728\u8FD9\u91CC\u65B0\u5EFA\u3002","empty.allTitle":"\u8FD8\u6CA1\u6709\u4EA7\u7269","empty.allHint":"\u8FD9\u91CC\u663E\u793A\u6240\u6709\u9879\u76EE\u548C\u8D44\u6599\u5E93\u4E2D\u7684\u4EA7\u7269\u3002","empty.libraryTitle":"\u8D44\u6599\u5E93\u4E3A\u7A7A","empty.libraryHint":"\u8D44\u6599\u5E93\u4E2D\u7684\u4EA7\u7269\u5728\u6240\u6709\u9879\u76EE\u53EF\u7528\u3002\u8BA9\u667A\u80FD\u4F53\u628A\u4EA7\u7269\u4FDD\u5B58\u5230\u8D44\u6599\u5E93\u3002","empty.noMatch":"\u6CA1\u6709\u5339\u914D\u7684\u4EA7\u7269\u3002","empty.typeMatch":"\u6CA1\u6709\u7B26\u5408\u7C7B\u578B\u7B5B\u9009\u7684{type}\u4EA7\u7269\u3002","empty.noWorkspace":"\u5728\u5DE5\u4F5C\u533A\u4E2D\u6253\u5F00\u4F1A\u8BDD\u4EE5\u67E5\u770B\u5176\u4EA7\u7269\u3002","empty.loading":"\u52A0\u8F7D\u4E2D...","create.title":"\u65B0\u5EFA{type}","create.name":"\u6807\u9898","create.scope":"\u4FDD\u5B58\u5230","create.submit":"\u521B\u5EFA","create.cancel":"\u53D6\u6D88","create.untitledPage":"\u672A\u547D\u540D\u9875\u9762","create.untitledDesign":"\u672A\u547D\u540D\u539F\u578B","create.untitledDoc":"\u672A\u547D\u540D\u6587\u6863","create.untitledSheet":"\u672A\u547D\u540D\u8868\u683C","sheet.toolbar":"\u8868\u683C\u5DE5\u5177","sheet.selection":"\u9009\u4E2D\u7684\u5355\u5143\u683C","sheet.formulaBar":"\u7F16\u8F91\u680F","sheet.selectColumn":"\u9009\u62E9\u5217 {name}","sheet.selectRow":"\u9009\u62E9\u884C {row}","sheet.undo":"\u64A4\u9500","sheet.redo":"\u91CD\u505A","sheet.bold":"\u7C97\u4F53","sheet.italic":"\u659C\u4F53","sheet.underline":"\u4E0B\u5212\u7EBF","sheet.alignLeft":"\u5DE6\u5BF9\u9F50","sheet.alignCenter":"\u5C45\u4E2D\u5BF9\u9F50","sheet.alignRight":"\u53F3\u5BF9\u9F50","sheet.numberFormat":"\u6570\u5B57\u683C\u5F0F","sheet.format.general":"\u5E38\u89C4","sheet.format.number":"\u6570\u5B57","sheet.format.integer":"\u6574\u6570","sheet.format.currency":"\u8D27\u5E01","sheet.format.percent":"\u767E\u5206\u6BD4","sheet.format.date":"\u65E5\u671F","sheet.fillColor":"\u586B\u5145\u989C\u8272","sheet.textColor":"\u6587\u5B57\u989C\u8272","sheet.invalid":"\u65E0\u6CD5\u8BFB\u53D6\u6B64\u8868\u683C\u3002","sheet.editCell":"\u7F16\u8F91\u5355\u5143\u683C {ref}","sheet.sheets":"\u5DE5\u4F5C\u8868","sheet.addSheet":"\u6DFB\u52A0\u5DE5\u4F5C\u8868","sheet.sheetName":"\u5DE5\u4F5C\u8868\u540D\u79F0","sheet.sheetActions":"\u5DE5\u4F5C\u8868\u64CD\u4F5C","sheet.renameSheet":"\u91CD\u547D\u540D\u5DE5\u4F5C\u8868","sheet.deleteSheet":"\u5220\u9664\u5DE5\u4F5C\u8868","sheet.deleteConfirm":"\u5220\u9664\u201C{name}\u201D\uFF1F\u5176\u5355\u5143\u683C\u4F1A\u5728\u65B0\u7248\u672C\u4E2D\u79FB\u9664\uFF0C\u5386\u53F2\u7248\u672C\u4ECD\u4FDD\u7559\u65E7\u5185\u5BB9\u3002","sheet.delete":"\u5220\u9664","sheet.cancel":"\u53D6\u6D88","tab.preview":"\u9884\u89C8","tab.source":"\u4EE3\u7801","tab.history":"\u5386\u53F2","tab.export":"\u5BFC\u51FA","tab.reload":"\u91CD\u65B0\u52A0\u8F7D","tab.rename":"\u91CD\u547D\u540D","tab.delete":"\u79FB\u5230\u56DE\u6536\u7AD9","tab.deleteConfirm":"\u201C{title}\u201D\u5C06\u79FB\u5230\u56DE\u6536\u7AD9\uFF0C\u6587\u4EF6\u4F1A\u4FDD\u7559 7 \u5929\u3002","tab.save":"\u4FDD\u5B58","tab.saving":"\u6B63\u5728\u4FDD\u5B58...","tab.saved":"\u5DF2\u4FDD\u5B58","tab.readOnly":"\u53EA\u8BFB","tab.saveFailed":"\u4FDD\u5B58\u5931\u8D25","tab.unsaved":"\u6709\u672A\u4FDD\u5B58\u7684\u66F4\u6539","tab.frameTitle":"\u4EA7\u7269\u9884\u89C8\uFF1A{title}","tab.versionOf":"\u7248\u672C {version}","tab.viewingOld":"\u6B63\u5728\u67E5\u770B\u7248\u672C {version}\uFF0C\u5F53\u524D\u7248\u672C\u4E3A {current}\u3002","tab.backToCurrent":"\u56DE\u5230\u5F53\u524D\u7248\u672C","tab.restoreThis":"\u6062\u590D\u6B64\u7248\u672C","tab.conflictTitle":"\u6B64\u4EA7\u7269\u5DF2\u66F4\u6539","tab.conflictHint":"\u7F16\u8F91\u671F\u95F4\u4FDD\u5B58\u4E86\u66F4\u65B0\u7248\u672C\u3002\u8349\u7A3F\u4ECD\u4FDD\u7559\u5728\u8FD9\u91CC\u3002\u653E\u5F03\u524D\u53EF\u5148\u590D\u5236\u8349\u7A3F\uFF0C\u518D\u91CD\u65B0\u52A0\u8F7D\u6700\u65B0\u7248\u672C\u3002","tab.deleted":"\u6B64\u4EA7\u7269\u5DF2\u4E0D\u5B58\u5728","tab.deletedHint":"\u5B83\u5DF2\u88AB\u79FB\u5230\u56DE\u6536\u7AD9\u6216\u5220\u9664\u3002","tab.close":"\u5173\u95ED\u6807\u7B7E\u9875","history.title":"\u7248\u672C","history.current":"\u5F53\u524D","history.byAgent":"\u667A\u80FD\u4F53","history.byUser":"\u4F60","history.restored":"\u4ECE v{version} \u6062\u590D","history.created":"\u521B\u5EFA","history.updated":"\u7F16\u8F91","history.empty":"\u6CA1\u6709\u66F4\u65E9\u7684\u7248\u672C\u3002","export.html":"HTML \u6587\u4EF6","export.mockupHtml":"\u4EA4\u4E92\u5F0F HTML\uFF08\u53EA\u8BFB\uFF09","export.mockupSvgHtml":"\u9759\u6001 HTML\uFF08SVG\uFF0C\u8F83\u5C0F\uFF09","export.selection":"\u5BFC\u51FA\u6240\u9009\u56FE\u5C42","export.failed":"\u65E0\u6CD5\u5BFC\u51FA\u8BE5\u56FE\u5C42\u3002","export.png":"PNG \u56FE\u7247","export.svg":"SVG \u56FE\u7247","export.fig":"OpenPencil \u6587\u6863\uFF08.fig\uFF09","export.md":"Markdown \u6587\u4EF6","export.docx":"Word \u6587\u6863","export.csv":"CSV \u6587\u4EF6","export.xlsx":"Excel \u5DE5\u4F5C\u7C3F","export.downloaded":"\u5DF2\u4E0B\u8F7D {name}\u3002","export.print":"\u6253\u5370\u6216\u53E6\u5B58\u4E3A PDF","export.done":"\u5DF2\u5C06 {name} \u4FDD\u5B58\u5230 {path}","design.title":"\u8BBE\u8BA1\u7CFB\u7EDF","design.hint":"\u9875\u9762\u548C\u6587\u6863\u901A\u8FC7 CSS \u53D8\u91CF\u4F7F\u7528\u8FD9\u4E9B\u503C\u3002","design.source.workspace":"\u672C\u9879\u76EE\u8986\u76D6\u4E86\u8D44\u6599\u5E93\u8BBE\u7F6E\u3002","design.source.library":"\u7EE7\u627F\u81EA\u8D44\u6599\u5E93\u3002","design.source.default":"\u5185\u7F6E\u9ED8\u8BA4\u503C\u3002\u4FDD\u5B58\u540E\u5373\u53EF\u81EA\u5B9A\u4E49\u3002","design.name":"\u540D\u79F0","design.colors":"\u989C\u8272","design.color.primary":"\u4E3B\u8272","design.color.accent":"\u5F3A\u8C03\u8272","design.color.surface":"\u5E95\u8272","design.color.text":"\u6587\u5B57","design.color.muted":"\u6B21\u8981","design.color.background":"\u9875\u9762\u80CC\u666F","design.color.raised":"\u6B21\u7EA7\u80CC\u666F","design.color.border":"\u5206\u9694\u7EBF","design.color.control":"\u63A7\u4EF6\u8FB9\u6846","design.color.action":"\u64CD\u4F5C\u80CC\u666F","design.color.actionText":"\u64CD\u4F5C\u6587\u5B57","design.color.focus":"\u7126\u70B9\u8F6E\u5ED3","design.color.success":"\u6210\u529F","design.color.warning":"\u8B66\u544A","design.color.danger":"\u5371\u9669","design.type":"\u5B57\u4F53","design.font":"\u6B63\u6587\u5B57\u4F53","design.mono":"\u4EE3\u7801\u5B57\u4F53","design.radius":"\u5706\u89D2","design.radius.sm":"\u5C0F","design.radius.md":"\u4E2D","design.radius.lg":"\u5927","design.notes":"\u7ED9\u667A\u80FD\u4F53\u7684\u8BF4\u660E","design.notesHint":"\u667A\u80FD\u4F53\u8BBE\u8BA1\u524D\u4F1A\u8BFB\u53D6\u7684\u8BED\u6C14\u3001\u6392\u7248\u89C4\u5219\u6216\u54C1\u724C\u89C4\u8303\u3002","design.saveWorkspace":"\u4FDD\u5B58\u5230\u672C\u9879\u76EE","design.saveWorkspaceNamed":"\u4FDD\u5B58\u5230 {name}","design.saveLibrary":"\u4FDD\u5B58\u5230\u8D44\u6599\u5E93","design.clear":"\u79FB\u9664\u9879\u76EE\u8986\u76D6","design.saved":"\u8BBE\u8BA1\u7CFB\u7EDF\u5DF2\u4FDD\u5B58","design.preview":"\u9884\u89C8","design.previewHeading":"\u5B63\u5EA6\u56DE\u987E","design.previewBody":"\u672C\u5B63\u5EA6\u5404\u533A\u57DF\u6536\u5165\u5747\u6709\u589E\u957F\u3002","design.previewButton":"\u4E3B\u8981\u64CD\u4F5C","card.created":"\u5DF2\u521B\u5EFA","card.updated":"\u5DF2\u66F4\u65B0","card.working":"\u6B63\u5728\u5199\u5165\u4EA7\u7269...","card.failed":"\u4EA7\u7269\u672A\u4FDD\u5B58","card.missing":"\u6B64\u7ED3\u679C\u6CA1\u6709\u4EA7\u7269\u4FE1\u606F\u3002","composer.label":"\u4EA7\u7269","error.generic":"\u51FA\u9519\u4E86\uFF0C\u8BF7\u91CD\u8BD5\u3002","error.designInvalid":"\u539F\u578B\u6E90\u7801\u65E0\u6548\u3002","error.designIcon":"\u8BE5\u539F\u578B\u65E0\u6CD5\u4F7F\u7528\u6B64\u56FE\u6807\u3002","error.designRender":"\u539F\u578B\u65E0\u6CD5\u6E32\u67D3\u3002","error.designTimeout":"\u539F\u578B\u6E32\u67D3\u8D85\u65F6\u3002","error.designUnavailable":"\u6B64\u8FD0\u884C\u65F6\u65E0\u6CD5\u6E32\u67D3\u539F\u578B\u3002","error.unsupportedType":"\u8BE5\u4EA7\u7269\u4E0D\u652F\u6301\u6B64\u64CD\u4F5C\u3002","error.sheetInvalid":"\u8868\u683C\u6570\u636E\u65E0\u6548\u3002","error.notFound":"\u6B64\u4EA7\u7269\u5DF2\u4E0D\u5B58\u5728\u3002","error.stale":"\u4EA7\u7269\u5DF2\u66F4\u6539\uFF0C\u8BF7\u91CD\u65B0\u52A0\u8F7D\u3002","error.tooLarge":"\u5185\u5BB9\u8D85\u8FC7 2 MiB \u4E0A\u9650\u3002","error.noWorkspace":"\u6B64\u4F1A\u8BDD\u6CA1\u6709\u5DE5\u4F5C\u533A\u3002","error.forbidden":"\u4E0D\u5141\u8BB8\u8BBF\u95EE\u8BE5\u8DEF\u5F84\u3002","error.corrupt":"\u4EA7\u7269\u6587\u4EF6\u5DF2\u635F\u574F\u3002","error.tokens":"\u67D0\u4E2A\u8BBE\u8BA1\u503C\u4E0D\u662F\u6709\u6548\u7684 CSS\u3002","error.library":"\u65E0\u6CD5\u521B\u5EFA\u8D44\u6599\u5E93\u6587\u4EF6\u5939\u3002","error.surface":"\u4EA7\u7269\u9762\u677F\u7ED8\u5236\u5931\u8D25\u3002","error.surfaceHint":"\u8BF7\u91CD\u65B0\u52A0\u8F7D\u7A97\u53E3\u3002\u4F60\u7684\u4EA7\u7269\u4ECD\u5B89\u5168\u4FDD\u5B58\u5728\u78C1\u76D8\u4E0A\u3002","action.retry":"\u91CD\u8BD5","action.reloadWindow":"\u91CD\u65B0\u52A0\u8F7D\u7A97\u53E3","time.justNow":"\u521A\u521A","time.minutes":"{count} \u5206\u949F\u524D","time.hours":"{count} \u5C0F\u65F6\u524D","time.days":"{count} \u5929\u524D"};function aa(e,t,a=Date.now()){let r=Math.max(0,a-Date.parse(t)),n=Math.floor(r/6e4);if(n<1)return e("time.justNow");if(n<60)return e("time.minutes",{count:n});let o=Math.floor(n/60);if(o<24)return e("time.hours",{count:o});let l=Math.floor(o/24);return l<7?e("time.days",{count:l}):new Date(t).toLocaleDateString()}var ke=require("react/jsx-runtime");function Ni(e,t){let a=t.source.origin==="agent"?e("history.byAgent"):e("history.byUser"),r=t.source.action==="restore"&&t.source.restoredFrom!==void 0?e("history.restored",{version:t.source.restoredFrom}):t.source.action==="create"?e("history.created"):e("history.updated");return`${a} \xB7 ${r} \xB7 ${aa(e,t.createdAt)}`}function xn({t:e,versions:t,failed:a,current:r,selected:n,onSelect:o}){return(0,ke.jsxs)("div",{className:"art-history-body",children:[t===null?(0,ke.jsx)("p",{className:"art-note",role:"status",children:(0,ke.jsx)(ra.TextShimmer,{active:!0,children:e("empty.loading")})}):null,a?(0,ke.jsx)("p",{className:"art-note",children:e("error.generic")}):null,!a&&t!==null&&t.length<=1?(0,ke.jsx)("p",{className:"art-note",children:e("history.empty")}):null,t?.map(l=>(0,ke.jsxs)("button",{type:"button",className:"art-version","aria-current":l.version===n?"true":void 0,onClick:()=>o(l.version),children:[(0,ke.jsxs)("span",{className:"art-version-top",children:[(0,ke.jsx)("span",{children:e("tab.versionOf",{version:l.version})}),l.version===r?(0,ke.jsx)(ra.Tag,{tone:"neutral",children:e("history.current")}):null]}),(0,ke.jsx)("span",{className:"art-version-sub",children:Ni(e,l)})]},l.version))]})}var Ie=require("react");var Ve=require("react/jsx-runtime");function na({content:e,designCss:t,title:a,frameTitle:r,dark:n=!1,onSelectionText:o}){let[l,s]=(0,Ie.useState)(null),[c,i]=(0,Ie.useState)(!1),g=(0,Ie.useRef)(0),k=(0,Ie.useRef)(null),b=(0,Ie.useRef)(o);b.current=o;let p=o!==void 0;return(0,Ie.useEffect)(()=>{g.current=0,i(!1);let u=URL.createObjectURL(new Blob([ta(e,t,a,n?"dark":"light",p)],{type:"text/html"}));return s(u),()=>URL.revokeObjectURL(u)},[e,t,a,n,p]),(0,Ie.useEffect)(()=>{if(!p)return;let u=y=>{if(k.current===null||g.current>1||y.source!==k.current.contentWindow)return;let v=vn(y.data);v!==void 0&&b.current?.(v)};return window.addEventListener("message",u),()=>window.removeEventListener("message",u)},[p]),c?(0,Ve.jsx)("div",{className:"art-center",role:"alert",children:a}):l===null?null:(0,Ve.jsx)("iframe",{ref:k,className:"art-frame",title:r,sandbox:hn,referrerPolicy:"no-referrer",src:l,onLoad:()=>{g.current+=1,g.current>1&&i(!0)}},l)}function kn({value:e,readOnly:t,label:a,hint:r,onChange:n,onSave:o,onSelectionText:l}){let s=c=>{t||l?.(c.value.slice(c.selectionStart,c.selectionEnd))};return(0,Ve.jsxs)("div",{className:"art-source-wrap",children:[r===void 0?null:(0,Ve.jsx)("div",{className:"art-code-bar",children:(0,Ve.jsx)("span",{children:r})}),(0,Ve.jsx)("textarea",{className:"art-source","aria-label":a,spellCheck:!1,readOnly:t,value:e,autoFocus:!t,onChange:c=>{n(c.target.value),l?.("")},onSelect:c=>s(c.currentTarget),onMouseUp:c=>s(c.currentTarget),onKeyUp:c=>s(c.currentTarget),onKeyDown:c=>{if((c.ctrlKey||c.metaKey)&&c.key.toLowerCase()==="s"){c.preventDefault(),o();return}if(c.key==="Tab"&&!c.shiftKey&&!t){c.preventDefault();let i=c.currentTarget,g=i.selectionStart,k=i.selectionEnd,b=e.slice(0,g)+" "+e.slice(k);n(b),requestAnimationFrame(()=>i.setSelectionRange(g+2,g+2))}}})]})}var Sn=require("@deepseek-ai/dsh-client-ui-primitives"),be=require("react");var Xe=require("react/jsx-runtime"),Ct=null;function zi(){if(Ct===null){let e=globalThis.__dshArtifactsRequireAsync;if(typeof e!="function")return Promise.reject(new Error("The sheet editor loader is unavailable."));Ct=e("./client.sheet.js"),Ct.catch(()=>{Ct=null})}return Ct}function Tn(e){let t=(0,be.useRef)(null),a=(0,be.useRef)(null),[r,n]=(0,be.useState)("loading"),o=(0,be.useRef)({onChange:e.onChange,onSave:e.onSave,onSelectionText:e.onSelectionText??(()=>{}),t:e.t});o.current.onChange=e.onChange,o.current.onSave=e.onSave,o.current.onSelectionText=e.onSelectionText??(()=>{}),o.current.t=e.t;let l=(0,be.useMemo)(()=>e.design===void 0?{}:{...Gt(e.design,e.dark===!0),colorScheme:e.dark===!0?"dark":"light"},[e.design,e.dark]);return(0,be.useEffect)(()=>{let s=!1;return zi().then(c=>{s||t.current===null||(a.current=c.mountSheetEditor({element:t.current,content:e.content,editable:e.editable,label:e.label,...e.design===void 0?{}:{design:e.design},dark:e.dark===!0,live:o}),n("ready"))}).catch(()=>{s||n("failed")}),()=>{s=!0,a.current?.destroy(),a.current=null}},[]),(0,be.useEffect)(()=>{if(r!=="ready")return;let s=a.current;s!==null&&s.getJson()!==e.content&&s.setContent(e.content)},[e.revision,e.content,r]),(0,be.useEffect)(()=>{a.current?.setEditable(e.editable)},[e.editable]),(0,be.useEffect)(()=>{a.current?.setAppearance(e.design,e.dark===!0)},[e.design,e.dark]),(0,Xe.jsxs)("div",{className:"art-sheet",style:l,children:[r==="loading"?(0,Xe.jsx)("div",{className:"art-state",role:"status",children:(0,Xe.jsx)(Sn.TextShimmer,{active:!0,children:e.loadingLabel})}):null,r==="failed"?(0,Xe.jsx)("div",{className:"art-state",role:"alert",children:e.failedLabel}):null,(0,Xe.jsx)("div",{className:"art-sheet-mount",ref:t})]})}function Va(e,t=2e3){let a=e.replace(/\r\n/g,`
|
|
50
50
|
`).replace(/[ \t]+\n/g,`
|
|
51
51
|
`).replace(/\n{3,}/g,`
|
|
52
52
|
|
|
53
|
-
`).trim();return a.length<=t?{text:a,truncated:!1}:{text:a.slice(0,t).trimEnd(),truncated:!0}}function
|
|
53
|
+
`).trim();return a.length<=t?{text:a,truncated:!1}:{text:a.slice(0,t).trimEnd(),truncated:!0}}function Cn(e,t){let a=t.workspaceId!==void 0&&t.workspaceId!=="",r=t.version===t.current?a?"agent.referenceProject":"agent.reference":a?"agent.referenceOldProject":"agent.referenceOld",n={title:t.title,id:t.id,version:t.version,current:t.current,...a?{workspaceId:t.workspaceId}:{}};return`${e(r,n)} `}function Wa(e,t){let r=e("agent.quoteDesign",{name:t.name,path:t.path})+"\n\n```jsx\n"+t.jsx+"\n```";if(r.length<=4e3)return{text:r,truncated:!1};let n=`
|
|
54
54
|
|
|
55
|
-
`+e("agent.quoteCut",{limit:4e3});return{text:r.slice(0,4e3-n.length).trimEnd()+n,truncated:!0}}function
|
|
55
|
+
`+e("agent.quoteCut",{limit:4e3});return{text:r.slice(0,4e3-n.length).trimEnd()+n,truncated:!0}}function Ga(e,t){return e===""?t:`${e.split(`
|
|
56
56
|
`).map(a=>`> ${a}`).join(`
|
|
57
57
|
`)}
|
|
58
58
|
|
|
59
|
-
${t}`}var Ne=require("react"),it=require("@deepseek-ai/dsh-client-ui-primitives");var ce=require("react/jsx-runtime");function dn({t:e,where:t,onClose:a,onApply:r}){let[n,o]=(0,Ne.useState)(null),[i,s]=(0,Ne.useState)(""),[d,l]=(0,Ne.useState)(null),[h,x]=(0,Ne.useState)(!1),[b,p]=(0,Ne.useState)(null),[u,y]=(0,Ne.useState)(0),g=n?.find(T=>T.scope+":"+T.id===i),P=g?{systemId:g.id,systemScope:g.scope,revision:g.revision}:{};(0,Ne.useEffect)(()=>{let T=new AbortController,A=t.scope==="library"?[t]:[t,{scope:"library",workspaceId:null}];return Promise.all(A.map(j=>_.designSystems(j,T.signal))).then(j=>{T.signal.aborted||o(j.flatMap(z=>z.systems))}).catch(j=>{T.signal.aborted||p(e(Y(q(j))))}),()=>T.abort()},[t.scope,t.workspaceId,u]),(0,Ne.useEffect)(()=>{let T=new AbortController;return l(null),p(null),_.selectedDesign(t,P,T.signal).then(A=>{T.signal.aborted||l(A)}).catch(A=>{T.signal.aborted||p(e(Y(q(A))))}),()=>T.abort()},[i,n,u]);let w=async()=>{if(!(!d||n===null||h)){x(!0),p(null);try{let T=d.system;await r(T?{systemId:T.id,systemScope:T.scope,revision:T.revision}:P),a()}catch(T){p(e(Y(q(T))))}finally{x(!1)}}};return(0,ce.jsxs)(it.Modal,{open:!0,onClose:()=>{h||a()},title:e("generation.confirm"),children:[(0,ce.jsx)("p",{className:"art-note",children:e("generation.explain")}),(0,ce.jsxs)("label",{className:"art-field",children:[e("design.system"),(0,ce.jsxs)("select",{disabled:h||n===null,value:i,onChange:T=>s(T.target.value),children:[(0,ce.jsx)("option",{value:"",children:e("design.defaultChoice")}),n?.map(T=>(0,ce.jsxs)("option",{value:T.scope+":"+T.id,children:[T.scope==="workspace"?e("scope.workspace"):e("scope.library"),": ",e("design.revision",{name:T.name,revision:T.revision})]},T.scope+T.id))]})]}),d?(0,ce.jsx)("p",{className:"art-note",children:d.system?e("design.revision",{name:d.system.name,revision:d.system.revision}):d.tokens.name}):(0,ce.jsx)("p",{role:"status",children:e("empty.loading")}),b?(0,ce.jsxs)("div",{role:"alert",children:[(0,ce.jsx)("p",{children:b}),(0,ce.jsx)(it.Button,{size:"sm",disabled:h,onClick:()=>y(T=>T+1),children:e("action.retry")})]}):null,(0,ce.jsxs)("div",{className:"art-design-actions",children:[(0,ce.jsx)(it.Button,{size:"sm",disabled:h,onClick:a,children:e("create.cancel")}),(0,ce.jsx)(it.Button,{size:"sm",variant:"primary",disabled:h||d===null||n===null||b!==null,onClick:()=>void w(),children:e("generation.apply")})]})]})}var pn=require("react"),un="data-ds-dark-theme";function si(){return typeof document<"u"&&document.body?.hasAttribute(un)===!0}function li(e){if(typeof document>"u"||document.body===null)return()=>{};let t=new MutationObserver(e);return t.observe(document.body,{attributes:!0,attributeFilter:[un]}),()=>t.disconnect()}function st(){return(0,pn.useSyncExternalStore)(li,si,()=>!1)}var c=require("react/jsx-runtime");function qe({label:e,icon:t,onClick:a,pressed:r,disabled:n,buttonRef:o}){return(0,c.jsx)(k.Tooltip,{label:e,side:"bottom",portal:!0,children:(0,c.jsx)(k.Button,{ref:o,size:"sm",className:"art-icon-button","aria-label":e,"aria-pressed":r,disabled:n,onClick:a,children:t})})}function ci({quote:e,askLabel:t,dismissLabel:a,onAsk:r,onDismiss:n}){return(0,c.jsxs)("div",{className:"art-selection-bar",role:"toolbar","aria-label":t,children:[(0,c.jsx)("span",{className:"art-selection-quote",title:e,children:e}),(0,c.jsx)(k.Button,{size:"sm",variant:"primary",className:"art-ask",icon:(0,c.jsx)(k.IconSparkleRegular,{size:14}),onClick:r,children:t}),(0,c.jsx)(qe,{label:a,icon:(0,c.jsx)(k.IconCloseOutlineRegular,{size:14}),onClick:n})]})}function di({t:e,layer:t,askLabel:a,dismissLabel:r,onAsk:n,onDismiss:o}){let i=Pa(e,t.type);return(0,c.jsxs)("div",{className:"art-selection-bar art-layer-bar",role:"toolbar","aria-label":a,children:[(0,c.jsx)("span",{className:"art-layer-bar-glyph","aria-hidden":"true",children:Xt(t.type)}),(0,c.jsxs)("span",{className:"art-layer-bar-text",children:[(0,c.jsx)("span",{className:"art-layer-bar-name",title:t.name,children:t.name}),(0,c.jsx)("span",{className:"art-layer-bar-sub",children:t.parentName===""?i:e("layer.parentLine",{type:i,parent:t.parentName})})]}),(0,c.jsx)(k.Button,{size:"sm",variant:"primary",className:"art-ask",icon:(0,c.jsx)(k.IconSparkleRegular,{size:14}),onClick:n,children:a}),(0,c.jsx)(qe,{label:r,icon:(0,c.jsx)(k.IconCloseOutlineRegular,{size:14}),onClick:o})]})}function pi({label:e,closeLabel:t,overlay:a,onClose:r,head:n,children:o}){let i=(0,N.useRef)(null);return(0,N.useEffect)(()=>{i.current?.querySelector("[data-drawer-initial]")?.focus()??i.current?.querySelector(".art-version, button")?.focus()},[e]),(0,N.useEffect)(()=>{if(!a)return;let s=d=>{let l=i.current;l===null||d.target instanceof Node&&l.contains(d.target)||l.querySelector("button")?.focus()};return document.addEventListener("focusin",s),()=>document.removeEventListener("focusin",s)},[a]),(0,c.jsxs)("div",{className:"art-drawer-layer","data-overlay":a?"true":void 0,children:[a?(0,c.jsx)("div",{className:"art-drawer-scrim","aria-hidden":"true",onPointerDown:r}):null,(0,c.jsxs)("aside",{ref:i,className:"art-drawer",role:"dialog","aria-modal":a?"true":void 0,"aria-label":e,onKeyDown:s=>{if(s.key==="Escape"){s.preventDefault(),s.stopPropagation(),r();return}if(s.key!=="Tab"||!a)return;let d=[...i.current?.querySelectorAll("button:not(:disabled)")??[]],l=d[0],h=d[d.length-1];l===void 0||h===void 0||(s.shiftKey&&document.activeElement===l?(s.preventDefault(),h.focus()):!s.shiftKey&&document.activeElement===h&&(s.preventDefault(),l.focus()))},children:[(0,c.jsxs)("div",{className:"art-drawer-head",children:[n??(0,c.jsx)("h2",{children:e}),(0,c.jsx)(qe,{label:t,icon:(0,c.jsx)(k.IconCloseOutlineRegular,{size:14}),onClick:r})]}),(0,c.jsx)("div",{className:"art-drawer-body",children:o})]})]})}function _a(e){let t=e.useTabInfo(),a=Ie(t.tab.contentId??t.tab.navigation?.address),r=e.useWorkspaces(n=>n.items.find(o=>a?.scope==="workspace"&&o.workspaceId===a.workspaceId)?.title);return a===void 0?(0,c.jsx)("section",{className:"art-root",children:(0,c.jsx)("p",{className:"art-note",children:e.t("error.notFound")})}):(0,c.jsx)(fn,{t:e.t,address:a,useTabInfo:e.useTabInfo,onBack:t.tab.actions?.close,workspaceName:r,inputActions:e.inputActions},te(a))}function Ha({t:e,address:t,onBack:a,workspaceName:r,inputActions:n}){return(0,c.jsx)(fn,{t:e,address:t,onBack:a,workspaceName:r,back:!0,inputActions:n},te(t))}var ui=()=>{};function fn({t:e,address:t,useTabInfo:a,onBack:r,workspaceName:n,back:o,inputActions:i}){let{model:s,state:d}=Nr(t),{payload:l,draft:h,saving:x,conflict:b,failure:p,failureMessage:u}=d,y=s.where,g=t.id,P=st(),[w,T]=(0,N.useState)("view"),[A,j]=(0,N.useState)(!1),[z,H]=(0,N.useState)(!1),[W,F]=(0,N.useState)(!1),[L,v]=(0,N.useState)("layers"),[I,Q]=(0,N.useState)(null),[D,$]=(0,N.useState)(null),[R,X]=(0,N.useState)([]),[Qe,Xe]=(0,N.useState)(null),[ma,It]=(0,N.useState)(0),[pt,Gn]=(0,N.useState)(!1),[Qa,ga]=(0,N.useState)(null),[$n,Xa]=(0,N.useState)(!1),[ut,Ve]=(0,N.useState)(!1),[ne,Je]=(0,N.useState)(null),[ze,ue]=(0,N.useState)(null),[Kn,At]=(0,N.useState)(!1),[qn,Ja]=(0,N.useState)(!1),[ha,Za]=(0,N.useState)(""),[ba,ft]=(0,N.useState)(null),[Yn,Dt]=(0,N.useState)(!1),[he,xe]=(0,N.useState)(!1),[Ze,Re]=(0,N.useState)(null),[er,ya]=(0,N.useState)(null),[tr,mt]=(0,N.useState)(null),Ee=(0,N.useRef)(0),Pt=(0,N.useRef)(null),ar=(0,N.useRef)(null),rr=(0,N.useRef)(null),va=(0,N.useRef)(!1),Lt=Sr(g),nr=(a??ui)();(0,N.useEffect)(()=>{l!==null&&Lt>l.version&&h===null&&!x&&!b&&mt(Lt),s.externalVersion(Lt)},[Lt,s,x,l?.version,h,b]),(0,N.useEffect)(()=>{b&&mt(null)},[b]),(0,N.useEffect)(()=>{Re(null),X([])},[l?.version,ne?.version,d.revision]),(0,N.useEffect)(()=>{if(I===null){$(null);return}return $(I.getSnapshot()),I.subscribe($)},[I]);let or=ne!==null;(0,N.useEffect)(()=>{or&&w==="edit"&&(T("view"),F(!1))},[or,w]);let Qn=l!==null,et=(0,N.useCallback)(()=>{let m=Pt.current,M=m===null?0:m.clientWidth;Gn(M>0?M<=600:window.innerWidth<=600)},[]);(0,N.useEffect)(()=>{let m=Pt.current;if(m===null)return;et();let M=new ResizeObserver(et);return M.observe(m),window.addEventListener("resize",et),()=>{M.disconnect(),window.removeEventListener("resize",et)}},[Qn,et]);let We=(0,N.useCallback)(m=>{s.getSnapshot().draft!==null||s.getSnapshot().saving?ft({run:m}):m()},[s]),Mt=(0,N.useCallback)(()=>{++Ee.current,Ve(!1),Je(null),Re(null),ue(null),mt(null)},[]),Ot=(0,N.useCallback)(async()=>{Mt(),await s.discardAndReload()},[s,Mt]);(0,N.useEffect)(()=>nr?.tab.actions?.bindCommands({refresh:()=>We(Ot)}),[nr?.tab.actions,We,Ot]),(0,N.useEffect)(()=>{if(l?.manifest.type!=="doc"&&l?.manifest.type!=="sheet"||h===null||b||x)return;let m=setTimeout(()=>void s.save(),1200);return()=>clearTimeout(m)},[h,b,x,s,l?.manifest.type]),(0,N.useEffect)(()=>{if(!z||l===null)return;let m=new AbortController;return ga(null),Xa(!1),_.history(y,g,m.signal).then(M=>{m.signal.aborted||ga(M.versions)}).catch(()=>{m.signal.aborted||Xa(!0)}),()=>m.abort()},[z,l?.version,s]),(0,N.useEffect)(()=>()=>{++Ee.current},[]),(0,N.useEffect)(()=>{if(z){va.current=!0;return}va.current&&(va.current=!1,rr.current?.focus())},[z]),(0,N.useEffect)(()=>{if(w!=="source"||l?.manifest.type!=="page")return;let m=()=>{let M=ar.current,oe=window.getSelection();if(M===null||oe===null||oe.anchorNode===null||!M.contains(oe.anchorNode))return;let ht=Oa(oe.toString());Re(ht.text===""?null:ht)};return document.addEventListener("selectionchange",m),()=>document.removeEventListener("selectionchange",m)},[w,l?.manifest.type]);let Xn=(0,N.useCallback)(m=>Q(m),[]),Jn=(0,N.useCallback)(m=>X(m),[]),Zn=(0,N.useCallback)(m=>Xe(m),[]),eo=()=>F(!1),ir=()=>{++Ee.current,Ve(!1),Je(null),H(!1)},xa=()=>{et(),++Ee.current,Ve(!1),Je(null),ue(null),F(!1),H(!0)},sr=async m=>{let M=++Ee.current;if(ue(null),Re(null),m===l?.version){Ve(!1),Je(null);return}Ve(!0);try{let oe=await _.get(y,g,m);M===Ee.current&&Je(oe)}catch(oe){M===Ee.current&&se(e(Y(q(oe))))}finally{M===Ee.current&&Ve(!1)}},lr=async()=>ut?null:ne!==null?ne.version:await s.save()?s.getSnapshot().payload?.version??null:null,cr=async m=>{if(!he){xe(!0);try{let M=await lr();if(M===null)return;if(m==="print")an((await _.printable(y,g,M)).html);else{let oe=await _.exportFile(y,g,m,M);xr(oe),se(e("export.done",{name:oe.fileName,path:oe.path}))}}catch(M){se(e(Y(q(M))))}finally{xe(!1)}}},to=async m=>{if(!(ne!==null||b||he)){xe(!0);try{if(!await s.save())throw new Error(e("error.stale"));let M=s.getSnapshot();if(M.draft!==null||M.conflict||M.payload===null)throw new Error(e("error.stale"));let oe=await _.rebase(y,g,M.payload.version,m);Fe(g,oe.manifest.version),we(),Mt(),await s.load(),se(e("generation.done"))}finally{xe(!1)}}},ao=async()=>{ha.trim()===""||x||await s.save(ha.trim())&&At(!1)},ro=async()=>{if(ne===null||he)return;let m=ne.version;We(async()=>{xe(!0);try{let M=await _.restore(y,g,m,s.getSnapshot().payload?.version??0);Fe(g,M.manifest.version),we(),Mt(),await s.load()}catch(M){se(e(Y(q(M))))}finally{xe(!1)}})},wa=async(m,M)=>{try{await navigator.clipboard.writeText(m),se(e(M))}catch{ya(m)}},gt=async(m,M="agent.addedTruncated")=>{if(!(he||b||ut||l===null)){xe(!0);try{let oe=await lr();if(oe===null)return;let ht=s.getSnapshot().payload??l,Ta=cn(e,{title:ht.manifest.title,id:g,version:oe,current:ht.version,...t.scope==="workspace"?{workspaceId:t.workspaceId}:{}}),Ft=m?.text??"";if(Re(null),X([]),I?.clearSelection(),i===void 0){await wa(Fa(Ft,Ta),"agent.copied");return}if((Ft===""||i.insertQuote(Ft))&&i.insertText(Ta,i.captureInsertion())){se(e(m?.truncated===!0?M:"agent.added"));return}await wa(Fa(Ft,Ta),"agent.insertFailed")}finally{xe(!1)}}},jt=(0,N.useCallback)(m=>{let M=Oa(m);Re(M.text===""?null:M)},[]),no=async()=>{if(ze==="version"){ue(null);return}if(l!==null){try{let m=await _.history(y,g);ga(m.versions)}catch(m){se(e(Y(q(m))));return}ue("version")}};if(l===null)return(0,c.jsx)("section",{className:"art-root","data-dsh-artifact-studio":"",ref:Pt,children:(0,c.jsxs)("div",{className:"art-center",role:p===void 0?"status":"alert",children:[(0,c.jsx)("p",{className:"art-center-hint",children:e(p===void 0?"empty.loading":Y(p))}),(0,c.jsxs)("div",{className:"art-center-actions",children:[p===void 0?null:(0,c.jsx)(k.Button,{size:"sm",variant:"outline",onClick:()=>void s.load(),children:e("action.retry")}),r===void 0?null:(0,c.jsx)(k.Button,{size:"sm",variant:"outline",onClick:r,children:e("tab.close")})]})]})});let K=l.manifest.type,Ue=ne??l,tt=ne?.content??h??l.content,fe=ne!==null,ka=ne?.version??l.version,oo=e(x?"tab.saving":b?"tab.conflictTitle":ut?"empty.loading":ne!==null?"tab.readOnly":p!==void 0?"tab.saveFailed":h!==null?"tab.unsaved":"tab.saved"),io=b||p!==void 0&&!x?"error":x?"warn":void 0,so=t.scope==="workspace"?n??t.workspaceId:e("scope.library"),lo=w==="source"&&!fe&&(A||h!==null),Sa=K==="doc"||K==="sheet",dr=[...fr[K].map(m=>({id:m,label:e(`export.${m}`)})),...K==="design"?[]:[{type:"separator",id:"export-gap"},{id:"print",label:e("export.print")}]],pr=m=>{ue(null),cr(m==="print"?"print":m)},co=[...pt?[...dr,{type:"separator",id:"more-gap"}]:[],...K==="design"||K==="sheet"||fe?[]:[{id:"rebase",label:e("generation.rebase"),disabled:he||x||b}],{id:"rename",label:e("tab.rename")},{id:"reload",label:e("tab.reload")},{type:"separator",id:"danger-gap"},{id:"delete",label:e("tab.delete"),danger:!0}],po=m=>{ue(null),m==="rename"?(Za(l.manifest.title),At(!0)):m==="rebase"?Ja(!0):m==="reload"?We(Ot):m==="delete"?Dt(!0):pr(m)},uo=[...(Qa??[]).map(m=>({id:"v"+m.version,label:e("tab.versionOf",{version:m.version})+(m.version===l.version?" \xB7 "+e("tab.currentVersion"):"")})),{type:"separator",id:"versions-gap"},{id:"all",label:e("tab.allVersions")}],fo=m=>{ue(null),m==="all"?xa():sr(Number(m.slice(1)))},mo=(0,c.jsx)(k.Button,{size:"sm",variant:"primary",className:"art-ask",icon:(0,c.jsx)(k.IconSparkleRegular,{size:14}),disabled:he||b||ut,onClick:()=>{if(K==="design"){let m=I?.quoteSelection();if(m!=null){gt(ja(e,m),"agent.addedTruncatedDesign");return}}gt(Ze)},children:e("agent.ask")});return(0,c.jsxs)("section",{className:"art-root","data-dsh-artifact-studio":"","data-artifact-id":g,"aria-busy":he,ref:Pt,children:[(0,c.jsxs)("header",{className:"art-header art-editor-header",children:[(0,c.jsxs)("div",{className:"art-heading",children:[!o||r===void 0?null:(0,c.jsx)(qe,{label:e("action.back"),icon:(0,c.jsx)(k.IconChevronLeftOutlineRegular,{size:16}),onClick:()=>We(r)}),(0,c.jsxs)("div",{className:"art-identity",children:[(0,c.jsx)("h1",{className:"art-title",title:l.manifest.title,children:l.manifest.title}),(0,c.jsxs)("div",{className:"art-meta",children:[(0,c.jsxs)("span",{className:"art-meta-text",children:[so,t.scope==="workspace"?" \xB7 "+e("scope.workspace"):null]}),(0,c.jsx)("span",{className:"art-meta-dot","aria-hidden":"true",children:"\xB7"}),(0,c.jsx)(k.Menu,{open:ze==="version",onClose:()=>ue(null),items:uo,onSelect:fo,portal:!0,autoFocus:!0,anchor:(0,c.jsxs)("button",{type:"button",className:"art-version-button","aria-label":e("tab.versionPicker"),"aria-haspopup":"menu","aria-expanded":ze==="version",onClick:()=>void no(),children:[e("gallery.version",{version:ka}),(0,c.jsx)(k.IconChevronDownOutlineRegular,{size:12})]})}),(0,c.jsx)("span",{className:"art-meta-dot","aria-hidden":"true",children:"\xB7"}),(0,c.jsx)("span",{className:"art-save-status","data-tone":io,"aria-live":"polite",children:oo})]})]})]}),(0,c.jsxs)("div",{className:"art-actions art-editor-actions",children:[K==="doc"||K==="sheet"?null:(0,c.jsx)(k.SegmentedControl,{id:"art-mode-"+g,className:"art-segment",label:e("tab.mode"),value:w,options:K==="design"?[{value:"view",label:e("canvas.viewMode")},{value:"edit",label:e("canvas.editMode"),disabled:fe,title:fe?e("canvas.editOldVersion"):void 0},{value:"source",label:e("tab.source")}]:[{value:"view",label:e("tab.preview")},{value:"source",label:e("tab.source")}],onChange:m=>{T(m),Re(null),F(K==="design"&&m==="edit"&&!fe)}}),K==="design"&&w==="edit"&&!fe?(0,c.jsx)(qe,{label:e("canvas.inspector"),icon:(0,c.jsx)(k.IconSlidersTwoOutlineRegular,{size:16}),pressed:W,onClick:()=>{W?F(!1):(H(!1),F(!0))}}):null,h===null||fe?null:(0,c.jsx)(qe,{label:e("tab.save"),icon:(0,c.jsx)(k.IconSaveOutlineRegular,{size:16}),disabled:b,onClick:()=>void s.save()}),(0,c.jsx)(qe,{buttonRef:rr,label:e("tab.history"),icon:(0,c.jsx)(k.IconClockOutlineRegular,{size:16}),pressed:z,onClick:()=>{z?ir():xa()}}),pt?null:(0,c.jsx)(k.Menu,{open:ze==="export",onClose:()=>ue(null),items:dr,onSelect:pr,align:"end",portal:!0,autoFocus:!0,anchor:(0,c.jsx)(k.Button,{size:"sm",icon:(0,c.jsx)(k.IconDownloadOutlineRegular,{size:14}),"aria-label":e("tab.export"),"aria-haspopup":"menu","aria-expanded":ze==="export",disabled:he||ut,onClick:()=>ue(ze==="export"?null:"export"),children:e("tab.export")})}),mo,(0,c.jsx)(k.Menu,{open:ze==="more",onClose:()=>ue(null),items:co,onSelect:po,align:"end",portal:!0,autoFocus:!0,anchor:(0,c.jsx)(k.Button,{size:"sm",className:"art-icon-button","aria-label":e("gallery.more"),"aria-haspopup":"menu","aria-expanded":ze==="more",onClick:()=>ue(ze==="more"?null:"more"),children:(0,c.jsx)(k.IconEllipsisOutlineRegular,{size:14})})})]})]}),K==="design"||K==="sheet"?null:(0,c.jsx)("div",{className:"art-bar",children:(0,c.jsxs)("span",{children:[e(Ue.generation?"generation.pinned":"generation.legacy"),Ue.generation?.system?": "+e("design.revision",{name:Ue.generation.system.name,revision:Ue.generation.system.revision}):""]})}),qn?(0,c.jsx)(dn,{t:e,where:y,onClose:()=>Ja(!1),onApply:to}):null,Kn?(0,c.jsxs)("form",{className:"art-inline-form",onSubmit:m=>{m.preventDefault(),ao()},children:[(0,c.jsx)("input",{"aria-label":e("tab.rename"),value:ha,maxLength:120,autoFocus:!0,onChange:m=>Za(m.target.value),onKeyDown:m=>{m.key==="Escape"&&At(!1)}}),(0,c.jsx)(k.Button,{type:"submit",size:"sm",variant:"primary",disabled:x||b,children:e("tab.save")}),(0,c.jsx)(k.Button,{size:"sm",variant:"outline",onClick:()=>At(!1),children:e("create.cancel")})]}):null,tr===null?null:(0,c.jsxs)("div",{className:"art-bar",role:"status",children:[(0,c.jsx)("span",{children:e("tab.agentUpdate",{version:tr})}),(0,c.jsxs)("span",{className:"art-bar-actions",children:[(0,c.jsx)(k.Button,{size:"sm",variant:"outline",onClick:()=>{mt(null),xa()},children:e("tab.viewHistory")}),(0,c.jsx)(k.Button,{size:"sm",onClick:()=>mt(null),children:e("tab.dismiss")})]})]}),b?(0,c.jsxs)("div",{className:"art-bar","data-tone":"warn",role:"alert",children:[(0,c.jsxs)("span",{className:"art-bar-text",children:[(0,c.jsx)("strong",{children:e("tab.conflictTitle")}),(0,c.jsx)("span",{children:e("tab.conflictHint")})]}),(0,c.jsxs)("span",{className:"art-bar-actions",children:[(0,c.jsx)(k.Button,{size:"sm",variant:"outline",onClick:()=>void wa(h??"","action.copied"),children:e("tab.copyDraft")}),(0,c.jsx)(k.Button,{size:"sm",variant:"outline",onClick:()=>We(Ot),children:e("tab.discardReload")})]})]}):null,!b&&p!==void 0?(0,c.jsxs)("div",{className:"art-bar","data-tone":"error",role:"alert",children:[(0,c.jsx)("span",{children:u??e(Y(p))}),(0,c.jsx)(k.Button,{size:"sm",variant:"outline",onClick:()=>void s.save(),children:e("action.retry")})]}):null,ne===null?null:(0,c.jsxs)("div",{className:"art-bar",role:"status",children:[(0,c.jsx)("span",{children:e("tab.viewingOld",{version:ne.version,current:l.version})}),(0,c.jsxs)("span",{className:"art-bar-actions",children:[(0,c.jsx)(k.Button,{size:"sm",variant:"outline",onClick:()=>{++Ee.current,Ve(!1),Je(null),Re(null)},children:e("tab.backToCurrent")}),(0,c.jsx)(k.Button,{size:"sm",variant:"outline",disabled:he,onClick:()=>void ro(),children:e("tab.restoreThis")})]})]}),K!=="design"||Qe===null?null:(0,c.jsxs)("div",{className:"art-bar","data-tone":"error",role:"alert",children:[(0,c.jsx)("span",{children:e("canvas.startFailed")}),(0,c.jsx)("span",{className:"art-bar-actions",children:(0,c.jsx)(k.Button,{size:"sm",variant:"outline",onClick:()=>{Xe(null),It(m=>m+1)},children:e("action.retry")})})]}),(0,c.jsxs)("div",{className:"art-body",children:[(0,c.jsxs)("div",{className:"art-stage",role:Sa?void 0:"tabpanel",id:Sa?void 0:"art-mode-"+g+"-"+w+"-panel","aria-labelledby":Sa?void 0:"art-mode-"+g+"-"+w,children:[(K==="page"||K==="sheet")&&Ze!==null&&!z?(0,c.jsx)(ci,{quote:Ze.text,askLabel:e("agent.ask"),dismissLabel:e("tab.dismiss"),onAsk:()=>void gt(Ze),onDismiss:()=>Re(null)}):null,K==="design"&&w!=="source"&&!fe&&R[0]!==void 0?(0,c.jsx)(di,{t:e,layer:R[0],askLabel:e("agent.ask"),dismissLabel:e("tab.dismiss"),onAsk:()=>{let m=I?.quoteSelection();m!=null&>(ja(e,m),"agent.addedTruncatedDesign")},onDismiss:()=>I?.clearSelection()}):null,K==="sheet"?(0,c.jsx)(ln,{content:tt,revision:(ne?.version??0)+":"+d.revision,editable:!fe&&!b,label:l.manifest.title,loadingLabel:e("empty.loading"),failedLabel:e("error.generic"),design:Ue.design,dark:P,t:e,onChange:m=>s.edit(m),onSave:()=>void s.save(),onSelectionText:jt}):K==="doc"?(0,c.jsx)(Jt,{markdown:tt,revision:(ne?.version??0)+":"+d.revision,editable:!fe&&!b,label:l.manifest.title,loadingLabel:e("empty.loading"),failedLabel:e("error.generic"),design:Ue.design,dark:P,t:e,onChange:m=>s.edit(m),onSave:()=>void s.save(),onSelectionText:jt,selectionAction:Ze===null?null:(0,c.jsx)(k.Button,{size:"sm",variant:"primary",icon:(0,c.jsx)(k.IconSparkleRegular,{size:14}),onMouseDown:m=>m.preventDefault(),onClick:()=>void gt(Ze),children:e("agent.ask")})}):w!=="source"?K==="design"?fe?(0,c.jsx)(La,{t:e,where:y,id:g,version:ka,title:l.manifest.title}):(0,c.jsx)(Vr,{t:e,source:tt,revision:"0:"+d.revision,title:l.manifest.title,mode:w==="edit"?"edit":"view",onChange:m=>s.edit(m),onSave:()=>void s.save(),onFailure:Zn,onHandle:Xn,onSelection:Jn,attempt:ma,fallback:(0,c.jsx)(La,{t:e,where:y,id:g,version:ka,title:l.manifest.title})}):(0,c.jsx)(ta,{content:tt,designCss:Ue.designCss,title:l.manifest.title,frameTitle:e("tab.frameTitle",{title:l.manifest.title}),dark:P,onSelectionText:jt}):lo?(0,c.jsx)(sn,{value:tt,readOnly:!1,label:e("tab.source"),hint:e(K==="design"?"tab.manualSaveDesign":"tab.manualSave"),onChange:m=>s.edit(m),onSave:()=>void s.save(),onSelectionText:jt}):(0,c.jsxs)("div",{className:"art-code",ref:ar,children:[(0,c.jsxs)("div",{className:"art-code-bar",children:[(0,c.jsx)("span",{children:e(fe?"tab.readOnly":"tab.codeHint")}),fe?null:(0,c.jsx)(k.Button,{size:"sm",variant:"outline",icon:(0,c.jsx)(k.IconEditOutlineRegular,{size:14}),onClick:()=>j(!0),children:e("tab.editSource")})]}),(0,c.jsx)(k.CodeBlock,{code:tt,lang:K==="design"?"jsx":"html",lineNumbers:!0,showHeader:!1,wrap:!0,className:"art-code-block",copyLabel:e("code.copy"),copiedLabel:e("action.copied")})]})]}),!z&&!W?null:(0,c.jsx)(pi,{label:e(z?"history.title":"canvas.inspector"),closeLabel:e(z?"history.close":"canvas.closeInspector"),overlay:pt,onClose:z?ir:eo,head:z?void 0:(0,c.jsx)(k.SegmentedTabs,{className:"art-inspector-tabs",items:[{value:"layers",label:e("panel.layers"),id:"art-inspector-"+g+"-layers-tab",panelId:"art-inspector-"+g+"-layers"},{value:"properties",label:e("panel.properties"),id:"art-inspector-"+g+"-properties-tab",panelId:"art-inspector-"+g+"-properties"}],value:L,onChange:v,label:e("canvas.inspectorTabs"),size:"sm"}),children:z?(0,c.jsx)(on,{t:e,versions:Qa,failed:$n,current:l.version,selected:ne?.version??l.version,onSelect:m=>void sr(m)}):(0,c.jsx)("div",{className:"art-inspector",role:"tabpanel",id:"art-inspector-"+g+"-"+L,"aria-labelledby":"art-inspector-"+g+"-"+L+"-tab",children:(0,c.jsx)(Wr,{t:e,handle:I,snapshot:D,tab:L})})})]}),(0,c.jsx)(k.Modal,{open:ba!==null,onClose:()=>ft(null),title:e("tab.leaveTitle"),closeLabel:e("dialog.close"),description:e(b?"tab.conflictHint":"tab.leaveHint"),footer:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(k.Button,{variant:"outline",disabled:he,onClick:()=>ft(null),children:e("create.cancel")}),(0,c.jsx)(k.Button,{variant:"outline",disabled:x||he,onClick:()=>{let m=ba?.run;ft(null),m!==void 0&&s.discardAndReload().then(m)},children:e("tab.leaveDiscard")}),(0,c.jsx)(k.Button,{variant:"primary",disabled:b||he,onClick:async()=>{xe(!0);let m=await s.save();xe(!1);let M=ba?.run;m&&M!==void 0&&(ft(null),await M())},children:e("tab.leaveSave")})]}),children:p===void 0?null:(0,c.jsx)("p",{className:"art-modal-error",role:"alert",children:u??e(Y(p))})}),(0,c.jsx)(k.Modal,{open:Yn,onClose:()=>Dt(!1),title:e("tab.deleteTitle"),closeLabel:e("dialog.close"),description:e("tab.deleteConfirm",{title:l.manifest.title}),footer:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(k.Button,{variant:"outline",onClick:()=>Dt(!1),children:e("create.cancel")}),(0,c.jsx)(k.Button,{variant:"primary",onClick:()=>{Dt(!1),We(async()=>{try{await _.remove(y,g),we(),r?.()}catch(m){se(e(Y(q(m))))}})},children:e("tab.delete")})]})}),(0,c.jsx)(k.Modal,{open:er!==null,onClose:()=>ya(null),title:e("agent.copyTitle"),closeLabel:e("dialog.close"),description:e("action.copyFailed"),footer:(0,c.jsx)(k.Button,{variant:"primary",onClick:()=>ya(null),children:e("dialog.done")}),children:(0,c.jsx)("textarea",{className:"art-fallback",readOnly:!0,value:er??"","aria-label":e("agent.copyTitle"),onFocus:m=>m.currentTarget.select()})})]})}var mn=wo(require("react"),1),gn=require("@deepseek-ai/dsh-client-ui-primitives"),Ye=require("react/jsx-runtime"),aa=class extends mn.default.Component{constructor(t){super(t),this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?(0,Ye.jsx)("section",{className:"art-root","data-dsh-artifact-studio":"",children:(0,Ye.jsxs)("div",{className:"art-center",role:"alert",children:[(0,Ye.jsx)("p",{className:"art-center-title",children:this.props.title}),(0,Ye.jsx)("p",{className:"art-center-hint",children:this.props.hint}),(0,Ye.jsx)(gn.Button,{size:"sm",variant:"outline",onClick:()=>window.location.reload(),children:this.props.reloadLabel})]})}):this.props.children}};var ra=require("react"),lt=require("@deepseek-ai/dsh-client-ui-primitives");var Le={sidebarRight:null,layout:null};var V=require("react/jsx-runtime");function fi(e){if(e===null||typeof e!="object")return null;let t={...e},{id:a,type:r,title:n,version:o,workspaceId:i}=t;if(t.kind!=="artifact"||typeof a!="string"||typeof n!="string"||typeof o!="number"||r!=="page"&&r!=="doc"&&r!=="design"&&r!=="sheet")return null;let s=gr(a);return s===void 0?null:s==="workspace"?typeof i!="string"||i===""?null:{id:a,type:r,title:n,version:o,address:{scope:s,workspaceId:i,id:a}}:{id:a,type:r,title:n,version:o,address:{scope:s,id:a}}}function mi(e){return Array.isArray(e)?e.map(t=>{if(t===null||typeof t!="object")return"";let a={...t};return a.type==="text"&&typeof a.text=="string"?a.text:""}).filter(t=>t!=="").join(`
|
|
60
|
-
`).trim():""}function
|
|
59
|
+
${t}`}var Re=require("react"),We=require("@deepseek-ai/dsh-client-ui-primitives");var re=require("react/jsx-runtime");function Nn({t:e,where:t,onClose:a,onApply:r}){let[n,o]=(0,Re.useState)(null),[l,s]=(0,Re.useState)(""),[c,i]=(0,Re.useState)(null),[g,k]=(0,Re.useState)(!1),[b,p]=(0,Re.useState)(null),[u,y]=(0,Re.useState)(0),v=n?.find(N=>N.scope+":"+N.id===l),D=v?{systemId:v.id,systemScope:v.scope,revision:v.revision}:{};(0,Re.useEffect)(()=>{let N=new AbortController,E=t.scope==="library"?[t]:[t,{scope:"library",workspaceId:null}];return Promise.all(E.map(j=>B.designSystems(j,N.signal))).then(j=>{N.signal.aborted||o(j.flatMap(z=>z.systems))}).catch(j=>{N.signal.aborted||p(e(X(Y(j))))}),()=>N.abort()},[t.scope,t.workspaceId,u]),(0,Re.useEffect)(()=>{let N=new AbortController;return i(null),p(null),B.selectedDesign(t,D,N.signal).then(E=>{N.signal.aborted||i(E)}).catch(E=>{N.signal.aborted||p(e(X(Y(E))))}),()=>N.abort()},[l,n,u]);let T=async()=>{if(!(!c||n===null||g)){k(!0),p(null);try{let N=c.system;await r(N?{systemId:N.id,systemScope:N.scope,revision:N.revision}:D),a()}catch(N){p(e(X(Y(N))))}finally{k(!1)}}};return(0,re.jsxs)(We.Modal,{open:!0,onClose:()=>{g||a()},title:e("generation.confirm"),closeLabel:e("dialog.close"),footer:(0,re.jsxs)(re.Fragment,{children:[(0,re.jsx)(We.Button,{variant:"outline",disabled:g,onClick:a,children:e("create.cancel")}),(0,re.jsx)(We.Button,{variant:"primary",disabled:g||c===null||n===null||b!==null,onClick:()=>void T(),children:e("generation.apply")})]}),children:[(0,re.jsx)("p",{className:"art-note",children:e("generation.explain")}),(0,re.jsxs)("label",{className:"art-field",children:[e("design.system"),(0,re.jsxs)("select",{className:"art-select",disabled:g||n===null,value:l,onChange:N=>s(N.target.value),children:[(0,re.jsx)("option",{value:"",children:e("design.defaultChoice")}),n?.map(N=>(0,re.jsxs)("option",{value:N.scope+":"+N.id,children:[N.scope==="workspace"?e("scope.workspace"):e("scope.library"),": ",e("design.revision",{name:N.name,revision:N.revision})]},N.scope+N.id))]})]}),c?(0,re.jsx)("p",{className:"art-note",children:c.system?e("design.revision",{name:c.system.name,revision:c.system.revision}):c.tokens.name}):(0,re.jsx)("p",{className:"art-note",role:"status",children:(0,re.jsx)(We.TextShimmer,{active:!0,children:e("empty.loading")})}),b?(0,re.jsxs)("div",{role:"alert",children:[(0,re.jsx)("p",{className:"art-modal-error",children:b}),(0,re.jsx)(We.Button,{variant:"outline",size:"sm",disabled:g,onClick:()=>y(N=>N+1),children:e("action.retry")})]}):null]})}var zn=require("react"),In="data-ds-dark-theme";function Ii(){return typeof document<"u"&&document.body?.hasAttribute(In)===!0}function Ri(e){if(typeof document>"u"||document.body===null)return()=>{};let t=new MutationObserver(e);return t.observe(document.body,{attributes:!0,attributeFilter:[In]}),()=>t.disconnect()}function lt(){return(0,zn.useSyncExternalStore)(Ri,Ii,()=>!1)}var d=require("react/jsx-runtime");function Ai(e,t){return(e.toLowerCase().normalize("NFKD").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,60)||"layer")+"."+t}function Qe({label:e,icon:t,onClick:a,pressed:r,disabled:n,buttonRef:o}){return(0,d.jsx)(S.Tooltip,{label:e,side:"bottom",portal:!0,children:(0,d.jsx)(S.Button,{ref:o,size:"sm",className:"art-icon-button","aria-label":e,"aria-pressed":r,disabled:n,onClick:a,children:t})})}function Ei({quote:e,askLabel:t,dismissLabel:a,onAsk:r,onDismiss:n}){return(0,d.jsxs)("div",{className:"art-selection-bar",role:"toolbar","aria-label":t,children:[(0,d.jsx)("span",{className:"art-selection-quote",title:e,children:e}),(0,d.jsx)(S.Button,{size:"sm",variant:"primary",className:"art-ask",icon:(0,d.jsx)(S.IconSparkleRegular,{size:14}),onClick:r,children:t}),(0,d.jsx)(Qe,{label:a,icon:(0,d.jsx)(S.IconCloseOutlineRegular,{size:14}),onClick:n})]})}function Di({t:e,layer:t,exportable:a,busy:r,askLabel:n,dismissLabel:o,onAsk:l,onExport:s,onDismiss:c}){let[i,g]=(0,C.useState)(!1),k=Ba(e,t.type);return(0,d.jsxs)("div",{className:"art-selection-bar art-layer-bar",role:"toolbar","aria-label":n,children:[(0,d.jsx)("span",{className:"art-layer-bar-glyph","aria-hidden":"true",children:Qt(t.type)}),(0,d.jsxs)("span",{className:"art-layer-bar-text",children:[(0,d.jsx)("span",{className:"art-layer-bar-name",title:t.name,children:t.name}),(0,d.jsx)("span",{className:"art-layer-bar-sub",children:t.parentName===""?k:e("layer.parentLine",{type:k,parent:t.parentName})})]}),(0,d.jsx)(S.Button,{size:"sm",variant:"primary",className:"art-ask",icon:(0,d.jsx)(S.IconSparkleRegular,{size:14}),onClick:l,children:n}),a?(0,d.jsx)(S.Menu,{open:i,onClose:()=>g(!1),items:[{id:"png",label:e("export.png")},{id:"svg",label:e("export.svg")}],onSelect:b=>{g(!1),(b==="png"||b==="svg")&&s(b)},align:"end",portal:!0,autoFocus:!0,anchor:(0,d.jsx)(S.Button,{size:"sm",className:"art-icon-button","aria-label":e("export.selection"),"aria-haspopup":"menu","aria-expanded":i,disabled:r,onClick:()=>g(b=>!b),children:(0,d.jsx)(S.IconDownloadOutlineRegular,{size:14})})}):null,(0,d.jsx)(Qe,{label:o,icon:(0,d.jsx)(S.IconCloseOutlineRegular,{size:14}),onClick:c})]})}function Li({label:e,closeLabel:t,overlay:a,onClose:r,head:n,children:o}){let l=(0,C.useRef)(null);return(0,C.useEffect)(()=>{l.current?.querySelector("[data-drawer-initial]")?.focus()??l.current?.querySelector(".art-version, button")?.focus()},[e]),(0,C.useEffect)(()=>{if(!a)return;let s=c=>{let i=l.current;i===null||c.target instanceof Node&&i.contains(c.target)||i.querySelector("button")?.focus()};return document.addEventListener("focusin",s),()=>document.removeEventListener("focusin",s)},[a]),(0,d.jsxs)("div",{className:"art-drawer-layer","data-overlay":a?"true":void 0,children:[a?(0,d.jsx)("div",{className:"art-drawer-scrim","aria-hidden":"true",onPointerDown:r}):null,(0,d.jsxs)("aside",{ref:l,className:"art-drawer",role:"dialog","aria-modal":a?"true":void 0,"aria-label":e,onKeyDown:s=>{if(s.key==="Escape"){s.preventDefault(),s.stopPropagation(),r();return}if(s.key!=="Tab"||!a)return;let c=[...l.current?.querySelectorAll('button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex="0"]')??[]],i=c[0],g=c[c.length-1];i===void 0||g===void 0||(s.shiftKey&&document.activeElement===i?(s.preventDefault(),g.focus()):!s.shiftKey&&document.activeElement===g&&(s.preventDefault(),i.focus()))},children:[(0,d.jsxs)("div",{className:"art-drawer-head",children:[n??(0,d.jsx)("h2",{children:e}),(0,d.jsx)(Qe,{label:t,icon:(0,d.jsx)(S.IconCloseOutlineRegular,{size:14}),onClick:r})]}),(0,d.jsx)("div",{className:"art-drawer-body",children:o})]})]})}function Ua(e){let t=e.useTabInfo(),a=He(t.tab.contentId??t.tab.navigation?.address),r=e.useWorkspaces(n=>n.items.find(o=>a?.scope==="workspace"&&o.workspaceId===a.workspaceId)?.title);return a===void 0?(0,d.jsx)("section",{className:"art-root",children:(0,d.jsx)("p",{className:"art-note",children:e.t("error.notFound")})}):(0,d.jsx)(An,{t:e.t,address:a,useTabInfo:e.useTabInfo,onBack:t.tab.actions?.close,workspaceName:r,inputActions:e.inputActions},te(a))}function Rn({t:e,address:t,onBack:a,workspaceName:r,inputActions:n}){return(0,d.jsx)(An,{t:e,address:t,onBack:a,workspaceName:r,back:!0,inputActions:n},te(t))}var Mi=()=>{};function An({t:e,address:t,useTabInfo:a,onBack:r,workspaceName:n,back:o,inputActions:l}){let{model:s,state:c}=Ar(t),{payload:i,draft:g,saving:k,conflict:b,failure:p,failureMessage:u}=c,y=s.where,v=t.id,D=lt(),[T,N]=(0,C.useState)("view"),[E,j]=(0,C.useState)(!1),[z,W]=(0,C.useState)(!1),[U,H]=(0,C.useState)(!1),[P,x]=(0,C.useState)("layers"),[A,Q]=(0,C.useState)(null),[L,q]=(0,C.useState)(null),[I,J]=(0,C.useState)([]),[Ze,et]=(0,C.useState)(null),[ha,At]=(0,C.useState)(null),[va,lo]=(0,C.useState)(0),[ba,co]=(0,C.useState)(!1),[tr,ya]=(0,C.useState)(null),[po,ar]=(0,C.useState)(!1),[ft,Ge]=(0,C.useState)(!1),[se,tt]=(0,C.useState)(null),[Ae,ve]=(0,C.useState)(null),[uo,Et]=(0,C.useState)(!1),[fo,rr]=(0,C.useState)(!1),[wa,nr]=(0,C.useState)(""),[xa,mt]=(0,C.useState)(null),[mo,Dt]=(0,C.useState)(!1),[fe,ye]=(0,C.useState)(!1),[at,Ee]=(0,C.useState)(null),[or,ka]=(0,C.useState)(null),[ir,gt]=(0,C.useState)(null),De=(0,C.useRef)(0),Lt=(0,C.useRef)(null),sr=(0,C.useRef)(null),lr=(0,C.useRef)(null),Sa=(0,C.useRef)(!1),Mt=zr(v),cr=(a??Mi)();(0,C.useEffect)(()=>{i!==null&&Mt>i.version&&g===null&&!k&&!b&>(Mt),s.externalVersion(Mt)},[Mt,s,k,i?.version,g,b]),(0,C.useEffect)(()=>{b&>(null)},[b]),(0,C.useEffect)(()=>{Ee(null),J([])},[i?.version,se?.version,c.revision]),(0,C.useEffect)(()=>{if(A===null){q(null);return}return q(A.getSnapshot()),A.subscribe(q)},[A]);let dr=se!==null;(0,C.useEffect)(()=>{dr&&T==="edit"&&(N("view"),H(!1))},[dr,T]);let go=i!==null,rt=(0,C.useCallback)(()=>{let f=Lt.current,M=f===null?0:f.clientWidth;co(M>0?M<=600:window.innerWidth<=600)},[]);(0,C.useEffect)(()=>{let f=Lt.current;if(f===null)return;rt();let M=new ResizeObserver(rt);return M.observe(f),window.addEventListener("resize",rt),()=>{M.disconnect(),window.removeEventListener("resize",rt)}},[go,rt]);let Ue=(0,C.useCallback)(f=>{s.getSnapshot().draft!==null||s.getSnapshot().saving?mt({run:f}):f()},[s]),Pt=(0,C.useCallback)(()=>{++De.current,Ge(!1),tt(null),Ee(null),ve(null),gt(null)},[]),Ot=(0,C.useCallback)(async()=>{Pt(),await s.discardAndReload()},[s,Pt]);(0,C.useEffect)(()=>cr?.tab.actions?.bindCommands({refresh:()=>Ue(Ot)}),[cr?.tab.actions,Ue,Ot]),(0,C.useEffect)(()=>{if(i?.manifest.type!=="doc"&&i?.manifest.type!=="sheet"||g===null||b||k)return;let f=setTimeout(()=>void s.save(),1200);return()=>clearTimeout(f)},[g,b,k,s,i?.manifest.type]),(0,C.useEffect)(()=>{if(!z||i===null)return;let f=new AbortController;return ya(null),ar(!1),B.history(y,v,f.signal).then(M=>{f.signal.aborted||ya(M.versions)}).catch(()=>{f.signal.aborted||ar(!0)}),()=>f.abort()},[z,i?.version,s]),(0,C.useEffect)(()=>()=>{++De.current},[]),(0,C.useEffect)(()=>{if(z){Sa.current=!0;return}Sa.current&&(Sa.current=!1,lr.current?.focus())},[z]),(0,C.useEffect)(()=>{if(T!=="source"||i?.manifest.type!=="page")return;let f=()=>{let M=sr.current,ee=window.getSelection();if(M===null||ee===null||ee.anchorNode===null||!M.contains(ee.anchorNode))return;let vt=Va(ee.toString());Ee(vt.text===""?null:vt)};return document.addEventListener("selectionchange",f),()=>document.removeEventListener("selectionchange",f)},[T,i?.manifest.type]);let ho=(0,C.useCallback)(f=>Q(f),[]),vo=(0,C.useCallback)(f=>J(f),[]),bo=(0,C.useCallback)(f=>et(f),[]),yo=()=>H(!1),pr=()=>{++De.current,Ge(!1),tt(null),W(!1)},Ta=()=>{rt(),++De.current,Ge(!1),tt(null),ve(null),H(!1),W(!0)},ur=async f=>{let M=++De.current;if(ve(null),Ee(null),f===i?.version){Ge(!1),tt(null);return}Ge(!0);try{let ee=await B.get(y,v,f);M===De.current&&tt(ee)}catch(ee){M===De.current&&ae(e(X(Y(ee))))}finally{M===De.current&&Ge(!1)}},fr=async()=>ft?null:se!==null?se.version:await s.save()?s.getSnapshot().payload?.version??null:null,mr=async f=>{if(!fe){ye(!0);try{let M=await fr();if(M===null)return;if(f==="print")bn((await B.printable(y,v,M)).html);else{let ee=await B.exportFile(y,v,f,M);Ma(ee),ae(e("export.done",{name:ee.fileName,path:ee.path}))}}catch(M){ae(e(X(Y(M))))}finally{ye(!1)}}},wo=async f=>{if(!fe){ye(!0);try{let M=await A?.exportSelection(f);if(M===void 0)return;let ee=Ai(M.name,f);Ma({data:M.data,mediaType:M.mediaType,fileName:ee}),ae(e("export.downloaded",{name:ee}))}catch{ae(e("export.failed"))}finally{ye(!1)}}},xo=async f=>{if(!(se!==null||b||fe)){ye(!0);try{if(!await s.save())throw new Error(e("error.stale"));let M=s.getSnapshot();if(M.draft!==null||M.conflict||M.payload===null)throw new Error(e("error.stale"));let ee=await B.rebase(y,v,M.payload.version,f);_e(v,ee.manifest.version),Ne(),Pt(),await s.load(),ae(e("generation.done"))}finally{ye(!1)}}},ko=async()=>{wa.trim()===""||k||await s.save(wa.trim())&&Et(!1)},So=async()=>{if(se===null||fe)return;let f=se.version;Ue(async()=>{ye(!0);try{let M=await B.restore(y,v,f,s.getSnapshot().payload?.version??0);_e(v,M.manifest.version),Ne(),Pt(),await s.load()}catch(M){ae(e(X(Y(M))))}finally{ye(!1)}})},Ca=async(f,M)=>{try{await navigator.clipboard.writeText(f),ae(e(M))}catch{ka(f)}},ht=async(f,M="agent.addedTruncated")=>{if(!(fe||b||ft||i===null)){ye(!0);try{let ee=await fr();if(ee===null)return;let vt=s.getSnapshot().payload??i,Ia=Cn(e,{title:vt.manifest.title,id:v,version:ee,current:vt.version,...t.scope==="workspace"?{workspaceId:t.workspaceId}:{}}),jt=f?.text??"";if(Ee(null),J([]),A?.clearSelection(),l===void 0){await Ca(Ga(jt,Ia),"agent.copied");return}if((jt===""||l.insertQuote(jt))&&l.insertText(Ia,l.captureInsertion())){ae(e(f?.truncated===!0?M:"agent.added"));return}await Ca(Ga(jt,Ia),"agent.insertFailed")}finally{ye(!1)}}},Ft=(0,C.useCallback)(f=>{let M=Va(f);Ee(M.text===""?null:M)},[]),To=async()=>{if(Ae==="version"){ve(null);return}if(i!==null){try{let f=await B.history(y,v);ya(f.versions)}catch(f){ae(e(X(Y(f))));return}ve("version")}};if(i===null)return(0,d.jsx)("section",{className:"art-root","data-dsh-artifact-studio":"",ref:Lt,children:(0,d.jsxs)("div",{className:"art-center",role:p===void 0?"status":"alert",children:[(0,d.jsx)("p",{className:"art-center-hint",children:e(p===void 0?"empty.loading":X(p))}),(0,d.jsxs)("div",{className:"art-center-actions",children:[p===void 0?null:(0,d.jsx)(S.Button,{size:"sm",variant:"outline",onClick:()=>void s.load(),children:e("action.retry")}),r===void 0?null:(0,d.jsx)(S.Button,{size:"sm",variant:"outline",onClick:r,children:e("tab.close")})]})]})});let K=i.manifest.type,Le=se??i,nt=se?.content??g??i.content,me=se!==null,Na=se?.version??i.version,Co=e(k?"tab.saving":b?"tab.conflictTitle":ft?"empty.loading":se!==null?"tab.readOnly":p!==void 0?"tab.saveFailed":g!==null?"tab.unsaved":"tab.saved"),No=b||p!==void 0&&!k?"error":k?"warn":void 0,zo=t.scope==="workspace"?n??t.workspaceId:e("scope.library"),Io=T==="source"&&!me&&(E||g!==null),za=K==="doc"||K==="sheet",Ro=f=>e(K==="design"&&f==="html"?"export.mockupHtml":K==="design"&&f==="html-svg"?"export.mockupSvgHtml":`export.${f}`),gr=[...br[K].map(f=>({id:f,label:Ro(f)})),...K==="design"?[]:[{type:"separator",id:"export-gap"},{id:"print",label:e("export.print")}]],hr=f=>{ve(null),mr(f==="print"?"print":f)},Ao=[...ba?[...gr,{type:"separator",id:"more-gap"}]:[],...K==="design"||K==="sheet"||me?[]:[{id:"rebase",label:e("generation.rebase"),disabled:fe||k||b}],{id:"rename",label:e("tab.rename")},{id:"reload",label:e("tab.reload")},{type:"separator",id:"danger-gap"},{id:"delete",label:e("tab.delete"),danger:!0}],Eo=f=>{ve(null),f==="rename"?(nr(i.manifest.title),Et(!0)):f==="rebase"?rr(!0):f==="reload"?Ue(Ot):f==="delete"?Dt(!0):hr(f)},Do=[...(tr??[]).map(f=>({id:"v"+f.version,label:e("tab.versionOf",{version:f.version})+(f.version===i.version?" \xB7 "+e("tab.currentVersion"):"")})),{type:"separator",id:"versions-gap"},{id:"all",label:e("tab.allVersions")}],Lo=f=>{ve(null),f==="all"?Ta():ur(Number(f.slice(1)))},Mo=(0,d.jsx)(S.Button,{size:"sm",variant:"primary",className:"art-ask",icon:(0,d.jsx)(S.IconSparkleRegular,{size:14}),disabled:fe||b||ft,onClick:()=>{if(K==="design"){let f=A?.quoteSelection();if(f!=null){ht(Wa(e,f),"agent.addedTruncatedDesign");return}}ht(at)},children:e("agent.ask")});return(0,d.jsxs)("section",{className:"art-root","data-dsh-artifact-studio":"","data-artifact-id":v,"aria-busy":fe,ref:Lt,children:[(0,d.jsxs)("header",{className:"art-header art-editor-header",children:[(0,d.jsxs)("div",{className:"art-heading",children:[!o||r===void 0?null:(0,d.jsx)(Qe,{label:e("action.back"),icon:(0,d.jsx)(S.IconChevronLeftOutlineRegular,{size:16}),onClick:()=>Ue(r)}),(0,d.jsxs)("div",{className:"art-identity",children:[(0,d.jsx)("h1",{className:"art-title",title:i.manifest.title,children:i.manifest.title}),(0,d.jsxs)("div",{className:"art-meta",children:[(0,d.jsxs)("span",{className:"art-meta-text",children:[zo,t.scope==="workspace"?" \xB7 "+e("scope.workspace"):null]}),(0,d.jsx)("span",{className:"art-meta-dot","aria-hidden":"true",children:"\xB7"}),(0,d.jsx)(S.Menu,{open:Ae==="version",onClose:()=>ve(null),items:Do,onSelect:Lo,portal:!0,autoFocus:!0,anchor:(0,d.jsxs)(S.Button,{size:"sm",className:"art-version-button","aria-label":e("tab.versionPicker"),"aria-haspopup":"menu","aria-expanded":Ae==="version",onClick:()=>void To(),children:[e("gallery.version",{version:Na}),(0,d.jsx)(S.IconChevronDownOutlineRegular,{size:12})]})}),(0,d.jsx)("span",{className:"art-meta-dot","aria-hidden":"true",children:"\xB7"}),(0,d.jsx)("span",{className:"art-save-status","data-tone":No,"aria-live":"polite",children:Co}),K==="design"||K==="sheet"?null:(0,d.jsxs)("span",{className:"art-generation",title:Le.generation?.system?e("design.revision",{name:Le.generation.system.name,revision:Le.generation.system.revision}):void 0,children:[" \xB7 ",e(Le.generation?"generation.pinned":"generation.legacy")]})]})]})]}),(0,d.jsxs)("div",{className:"art-actions art-editor-actions",children:[K==="doc"||K==="sheet"?null:(0,d.jsx)(S.SegmentedControl,{id:"art-mode-"+v,className:"art-segment",label:e("tab.mode"),value:T,options:K==="design"?[{value:"view",label:e("canvas.viewMode")},{value:"edit",label:e("canvas.editMode"),disabled:me,title:me?e("canvas.editOldVersion"):void 0},{value:"source",label:e("tab.source")}]:[{value:"view",label:e("tab.preview")},{value:"source",label:e("tab.source")}],onChange:f=>{N(f),Ee(null),H(K==="design"&&f==="edit"&&!me)}}),K==="design"&&T==="edit"&&!me?(0,d.jsx)(Qe,{label:e("canvas.inspector"),icon:(0,d.jsx)(S.IconSlidersTwoOutlineRegular,{size:16}),pressed:U,onClick:()=>{U?H(!1):(W(!1),H(!0))}}):null,g===null||me?null:(0,d.jsx)(Qe,{label:e("tab.save"),icon:(0,d.jsx)(S.IconSaveOutlineRegular,{size:16}),disabled:b,onClick:()=>void s.save()}),(0,d.jsx)(Qe,{buttonRef:lr,label:e("tab.history"),icon:(0,d.jsx)(S.IconClockOutlineRegular,{size:16}),pressed:z,onClick:()=>{z?pr():Ta()}}),ba?null:(0,d.jsx)(S.Menu,{open:Ae==="export",onClose:()=>ve(null),items:gr,onSelect:hr,align:"end",portal:!0,autoFocus:!0,anchor:(0,d.jsx)(S.Button,{size:"sm",icon:(0,d.jsx)(S.IconDownloadOutlineRegular,{size:14}),"aria-label":e("tab.export"),"aria-haspopup":"menu","aria-expanded":Ae==="export",disabled:fe||ft,onClick:()=>ve(Ae==="export"?null:"export"),children:e("tab.export")})}),Mo,(0,d.jsx)(S.Menu,{open:Ae==="more",onClose:()=>ve(null),items:Ao,onSelect:Eo,align:"end",portal:!0,autoFocus:!0,anchor:(0,d.jsx)(S.Button,{size:"sm",className:"art-icon-button","aria-label":e("gallery.more"),"aria-haspopup":"menu","aria-expanded":Ae==="more",onClick:()=>ve(Ae==="more"?null:"more"),children:(0,d.jsx)(S.IconEllipsisOutlineRegular,{size:14})})})]})]}),fo?(0,d.jsx)(Nn,{t:e,where:y,onClose:()=>rr(!1),onApply:xo}):null,uo?(0,d.jsxs)("form",{className:"art-inline-form",onSubmit:f=>{f.preventDefault(),ko()},children:[(0,d.jsx)(S.Input,{"aria-label":e("tab.rename"),value:wa,maxLength:120,autoFocus:!0,onChange:f=>nr(f.target.value),onKeyDown:f=>{f.key==="Escape"&&Et(!1)}}),(0,d.jsx)(S.Button,{type:"submit",size:"sm",variant:"primary",disabled:k||b,children:e("tab.save")}),(0,d.jsx)(S.Button,{size:"sm",variant:"outline",onClick:()=>Et(!1),children:e("create.cancel")})]}):null,ir===null?null:(0,d.jsxs)("div",{className:"art-bar",role:"status",children:[(0,d.jsx)("span",{children:e("tab.agentUpdate",{version:ir})}),(0,d.jsxs)("span",{className:"art-bar-actions",children:[(0,d.jsx)(S.Button,{size:"sm",variant:"outline",onClick:()=>{gt(null),Ta()},children:e("tab.viewHistory")}),(0,d.jsx)(S.Button,{size:"sm",variant:"outline",onClick:()=>gt(null),children:e("tab.dismiss")})]})]}),b?(0,d.jsxs)("div",{className:"art-bar","data-tone":"warn",role:"alert",children:[(0,d.jsxs)("span",{className:"art-bar-text",children:[(0,d.jsx)("strong",{children:e("tab.conflictTitle")}),(0,d.jsx)("span",{children:e("tab.conflictHint")})]}),(0,d.jsxs)("span",{className:"art-bar-actions",children:[(0,d.jsx)(S.Button,{size:"sm",variant:"outline",onClick:()=>void Ca(g??"","action.copied"),children:e("tab.copyDraft")}),(0,d.jsx)(S.Button,{size:"sm",variant:"outline",onClick:()=>Ue(Ot),children:e("tab.discardReload")})]})]}):null,!b&&p!==void 0?(0,d.jsxs)("div",{className:"art-bar","data-tone":"error",role:"alert",children:[(0,d.jsx)("span",{children:u??e(X(p))}),(0,d.jsx)(S.Button,{size:"sm",variant:"outline",onClick:()=>void s.save(),children:e("action.retry")})]}):null,se===null?null:(0,d.jsxs)("div",{className:"art-bar",role:"status",children:[(0,d.jsx)("span",{children:e("tab.viewingOld",{version:se.version,current:i.version})}),(0,d.jsxs)("span",{className:"art-bar-actions",children:[(0,d.jsx)(S.Button,{size:"sm",variant:"outline",onClick:()=>{++De.current,Ge(!1),tt(null),Ee(null)},children:e("tab.backToCurrent")}),(0,d.jsx)(S.Button,{size:"sm",variant:"outline",disabled:fe,onClick:()=>void So(),children:e("tab.restoreThis")})]})]}),K!=="design"||Ze===null?null:(0,d.jsxs)("div",{className:"art-bar","data-tone":"error",role:"alert",children:[(0,d.jsx)("span",{children:e("canvas.startFailed")}),(0,d.jsx)("span",{className:"art-bar-actions",children:(0,d.jsx)(S.Button,{size:"sm",variant:"outline",onClick:()=>{et(null),lo(f=>f+1)},children:e("action.retry")})})]}),K!=="design"||me||T==="source"?null:(()=>{let f=(i.designInfo?.warnings??[]).filter(Boolean);return f.length===0||ha===v+":"+String(i.version)?null:(0,d.jsxs)("div",{className:"art-bar","data-tone":"warn",role:"note",children:[(0,d.jsxs)("span",{className:"art-bar-text",children:[(0,d.jsx)("strong",{children:e("tab.designWarnings",{version:i.version})}),(0,d.jsx)("span",{children:f.join(" \xB7 ")})]}),(0,d.jsx)("span",{className:"art-bar-actions",children:(0,d.jsx)(S.Button,{size:"sm",variant:"outline",onClick:()=>At(v+":"+String(i.version)),children:e("tab.dismiss")})})]})})(),(0,d.jsxs)("div",{className:"art-body",children:[(0,d.jsxs)("div",{className:"art-stage",role:za?void 0:"tabpanel",id:za?void 0:"art-mode-"+v+"-"+T+"-panel","aria-labelledby":za?void 0:"art-mode-"+v+"-"+T,children:[(K==="page"||K==="sheet")&&at!==null&&!z?(0,d.jsx)(Ei,{quote:at.text,askLabel:e("agent.ask"),dismissLabel:e("tab.dismiss"),onAsk:()=>void ht(at),onDismiss:()=>Ee(null)}):null,K==="design"&&T!=="source"&&!me&&I[0]!==void 0?(0,d.jsx)(Di,{t:e,layer:I[0],exportable:I.length===1,busy:fe,askLabel:e("agent.ask"),dismissLabel:e("tab.dismiss"),onAsk:()=>{let f=A?.quoteSelection();f!=null&&ht(Wa(e,f),"agent.addedTruncatedDesign")},onExport:f=>void wo(f),onDismiss:()=>A?.clearSelection()}):null,K==="sheet"?(0,d.jsx)(Tn,{content:nt,revision:(se?.version??0)+":"+c.revision,editable:!me&&!b,label:i.manifest.title,loadingLabel:e("empty.loading"),failedLabel:e("error.generic"),design:Le.design,dark:D,t:e,onChange:f=>s.edit(f),onSave:()=>void s.save(),onSelectionText:Ft}):K==="doc"?(0,d.jsx)(ea,{markdown:nt,revision:(se?.version??0)+":"+c.revision,editable:!me&&!b,label:i.manifest.title,loadingLabel:e("empty.loading"),failedLabel:e("error.generic"),design:Le.design,dark:D,t:e,onChange:f=>s.edit(f),onSave:()=>void s.save(),onSelectionText:Ft,selectionAction:at===null?null:(0,d.jsx)(S.Button,{size:"sm",variant:"primary",icon:(0,d.jsx)(S.IconSparkleRegular,{size:14}),onMouseDown:f=>f.preventDefault(),onClick:()=>void ht(at),children:e("agent.ask")})}):T!=="source"?K==="design"?me?(0,d.jsx)(Ha,{t:e,where:y,id:v,version:Na,title:i.manifest.title}):(0,d.jsx)(on,{t:e,source:nt,revision:"0:"+c.revision,title:i.manifest.title,mode:T==="edit"?"edit":"view",onChange:f=>s.edit(f),onSave:()=>void s.save(),onFailure:bo,onHandle:ho,onSelection:vo,attempt:va,fallback:(0,d.jsx)(Ha,{t:e,where:y,id:v,version:Na,title:i.manifest.title})}):(0,d.jsx)(na,{content:nt,designCss:Le.designCss,title:i.manifest.title,frameTitle:e("tab.frameTitle",{title:i.manifest.title}),dark:D,onSelectionText:Ft}):Io?(0,d.jsx)(kn,{value:nt,readOnly:!1,label:e("tab.source"),hint:e(K==="design"?"tab.manualSaveDesign":"tab.manualSave"),onChange:f=>s.edit(f),onSave:()=>void s.save(),onSelectionText:Ft}):(0,d.jsxs)("div",{className:"art-code",ref:sr,children:[(0,d.jsxs)("div",{className:"art-code-bar",children:[(0,d.jsx)("span",{children:e(me?"tab.readOnly":"tab.codeHint")}),me?null:(0,d.jsx)(S.Button,{size:"sm",variant:"outline",icon:(0,d.jsx)(S.IconEditOutlineRegular,{size:14}),onClick:()=>j(!0),children:e("tab.editSource")})]}),(0,d.jsx)(S.CodeBlock,{code:nt,lang:K==="design"?"jsx":"html",lineNumbers:!0,showHeader:!1,wrap:!0,className:"art-code-block",copyLabel:e("code.copy"),copiedLabel:e("action.copied")})]})]}),!z&&!U?null:(0,d.jsx)(Li,{label:e(z?"history.title":"canvas.inspector"),closeLabel:e(z?"history.close":"canvas.closeInspector"),overlay:ba,onClose:z?pr:yo,head:z?void 0:(0,d.jsx)(S.SegmentedControl,{id:"art-inspector-"+v,className:"art-inspector-tabs",options:[{value:"layers",label:e("panel.layers")},{value:"properties",label:e("panel.properties")}],value:P,onChange:x,label:e("canvas.inspectorTabs")}),children:z?(0,d.jsx)(xn,{t:e,versions:tr,failed:po,current:i.version,selected:se?.version??i.version,onSelect:f=>void ur(f)}):(0,d.jsx)("div",{className:"art-inspector",role:"tabpanel",id:"art-inspector-"+v+"-"+P+"-panel","aria-labelledby":"art-inspector-"+v+"-"+P,children:(0,d.jsx)(sn,{t:e,handle:A,snapshot:L,tab:P,palette:D?Le.design.colorsDark:Le.design.colors})})})]}),(0,d.jsx)(S.Modal,{open:xa!==null,onClose:()=>mt(null),title:e("tab.leaveTitle"),closeLabel:e("dialog.close"),description:e(b?"tab.conflictHint":"tab.leaveHint"),footer:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(S.Button,{variant:"outline",disabled:fe,onClick:()=>mt(null),children:e("create.cancel")}),(0,d.jsx)(S.Button,{variant:"outline",disabled:k||fe,onClick:()=>{let f=xa?.run;mt(null),f!==void 0&&s.discardAndReload().then(f)},children:e("tab.leaveDiscard")}),(0,d.jsx)(S.Button,{variant:"primary",disabled:b||fe,onClick:async()=>{ye(!0);let f=await s.save();ye(!1);let M=xa?.run;f&&M!==void 0&&(mt(null),await M())},children:e("tab.leaveSave")})]}),children:p===void 0?null:(0,d.jsx)("p",{className:"art-modal-error",role:"alert",children:u??e(X(p))})}),(0,d.jsx)(S.Modal,{open:mo,onClose:()=>Dt(!1),title:e("tab.deleteTitle"),closeLabel:e("dialog.close"),description:e("tab.deleteConfirm",{title:i.manifest.title}),footer:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(S.Button,{variant:"outline",onClick:()=>Dt(!1),children:e("create.cancel")}),(0,d.jsx)(S.Button,{variant:"primary",onClick:()=>{Dt(!1),Ue(async()=>{try{await B.remove(y,v),Ne(),r?.()}catch(f){ae(e(X(Y(f))))}})},children:e("tab.delete")})]})}),(0,d.jsx)(S.Modal,{open:or!==null,onClose:()=>ka(null),title:e("agent.copyTitle"),closeLabel:e("dialog.close"),description:e("action.copyFailed"),footer:(0,d.jsx)(S.Button,{variant:"primary",onClick:()=>ka(null),children:e("dialog.done")}),children:(0,d.jsx)("textarea",{className:"art-fallback",readOnly:!0,value:or??"","aria-label":e("agent.copyTitle"),onFocus:f=>f.currentTarget.select()})})]})}var En=_o(require("react"),1),Dn=require("@deepseek-ai/dsh-client-ui-primitives"),Je=require("react/jsx-runtime"),oa=class extends En.default.Component{constructor(t){super(t),this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?(0,Je.jsx)("section",{className:"art-root","data-dsh-artifact-studio":"",children:(0,Je.jsxs)("div",{className:"art-center",role:"alert",children:[(0,Je.jsx)("p",{className:"art-center-title",children:this.props.title}),(0,Je.jsx)("p",{className:"art-center-hint",children:this.props.hint}),(0,Je.jsx)(Dn.Button,{size:"sm",variant:"outline",onClick:()=>window.location.reload(),children:this.props.reloadLabel})]})}):this.props.children}};var ia=require("react"),ct=require("@deepseek-ai/dsh-client-ui-primitives");var Te={sidebarRight:null,layout:null};var G=require("react/jsx-runtime");function Pi(e){if(e===null||typeof e!="object")return null;let t={...e},{id:a,type:r,title:n,version:o,workspaceId:l}=t;if(t.kind!=="artifact"||typeof a!="string"||typeof n!="string"||typeof o!="number"||r!=="page"&&r!=="doc"&&r!=="design"&&r!=="sheet")return null;let s=wr(a);return s===void 0?null:s==="workspace"?typeof l!="string"||l===""?null:{id:a,type:r,title:n,version:o,address:{scope:s,workspaceId:l,id:a}}:{id:a,type:r,title:n,version:o,address:{scope:s,id:a}}}function Oi(e){return Array.isArray(e)?e.map(t=>{if(t===null||typeof t!="object")return"";let a={...t};return a.type==="text"&&typeof a.text=="string"?a.text:""}).filter(t=>t!=="").join(`
|
|
60
|
+
`).trim():""}function Fi(e){if(e===null||typeof e!="object")return;let t={...e};return typeof t.title=="string"&&t.title.trim()!==""?t.title.trim():void 0}var Ln=new Set;function $a({t:e,phase:t,toolName:a,block:r}){let n=t==="result"&&r?.isError!==!0?Pi(r?.meta):null,o=(0,ia.useRef)(t!=="result");t!=="result"&&(o.current=!0);let l=a==="artifact_update";if((0,ia.useEffect)(()=>{if(n===null)return;Me(n.id,n.title),_e(n.id,n.version),Ne();let c=n.id+":"+n.version;!o.current||Ln.has(c)||(Ln.add(c),Te.sidebarRight?.openResource(te(n.address)))},[n?.id,n?.version,n?.title]),t!=="result"){let c=Fi(r?.args),i=c===void 0?e(l?"card.updatingUntitled":"card.working"):e(l?"card.updating":"card.creating",{title:c});return(0,G.jsxs)("div",{className:"art-card","data-artifact-card":"working",children:[(0,G.jsx)("span",{className:"art-card-icon",children:(0,G.jsx)(ze,{})}),(0,G.jsx)("span",{className:"art-card-text",children:(0,G.jsx)(ct.TextShimmer,{active:!0,className:"art-card-title",children:(0,G.jsx)("span",{role:"status",children:i})})}),(0,G.jsx)(ct.StateDot,{state:"ongoing"})]})}if(r?.isError===!0)return(0,G.jsxs)("div",{className:"art-card","data-artifact-card":"error",children:[(0,G.jsx)("span",{className:"art-card-icon","data-tone":"error",children:(0,G.jsx)(ze,{})}),(0,G.jsxs)("span",{className:"art-card-text",children:[(0,G.jsx)("span",{className:"art-card-title",children:e("card.failed")}),(0,G.jsx)("span",{className:"art-card-sub","data-tone":"error",children:Oi(r.content)})]})]});if(n===null)return(0,G.jsxs)("div",{className:"art-card","data-artifact-card":"missing",children:[(0,G.jsx)("span",{className:"art-card-icon",children:(0,G.jsx)(ze,{})}),(0,G.jsx)("span",{className:"art-card-sub",children:e("card.missing")})]});let s=te(n.address);return(0,G.jsxs)("button",{type:"button",className:"art-card art-card-open","data-artifact-card":"ready","data-artifact-id":n.id,"aria-label":e("card.openNamed",{title:n.title}),onClick:()=>Te.sidebarRight?.openResource(s),children:[(0,G.jsx)("span",{className:"art-card-icon",children:n.type==="page"?(0,G.jsx)(ze,{}):n.type==="doc"?(0,G.jsx)(Oe,{}):n.type==="sheet"?(0,G.jsx)(qe,{}):(0,G.jsx)(Ye,{})}),(0,G.jsxs)("span",{className:"art-card-text",children:[(0,G.jsx)("span",{className:"art-card-title",title:n.title,children:n.title}),(0,G.jsxs)("span",{className:"art-card-sub",children:[e(l?"card.updated":"card.created")," \xB7 ",e(`type.${n.type}`)," \xB7 ",e("gallery.version",{version:n.version}),n.address.scope==="library"?" \xB7 "+e("scope.library"):""]})]}),(0,G.jsx)("span",{className:"art-card-go","aria-hidden":"true",children:(0,G.jsx)(ct.IconChevronRightOutlineRegular,{size:14})})]})}var zt=require("react"),pt=require("@deepseek-ai/dsh-client-ui-primitives");var Mn=require("react");function sa({sessionId:e,useSessions:t,useWorkspaces:a}){let r=a(o=>o.items),n=t(o=>o.byId[e]);return(0,Mn.useMemo)(()=>{let o=typeof n?.cwd=="string"?n.cwd:null,l=r.find(s=>s.sessionIds?.includes(e))??r.find(s=>o!==null&&(o===s.path||o.startsWith(`${s.path}/`)))??null;return{root:o??l?.path??null,workspaceId:l?.workspaceId??null}},[r,n,e])}var Nt="dsh-artifact-studio/artifact",Ka="artifact",dt="dsh-artifact-studio-panel",la="dsh-artifact-studio/artifacts",qa="artifacts";var Fe=require("react/jsx-runtime"),ji=6,Ya=["dashboard","explainer","report","brief","sheet"];function Bi(e,t){let a=e.filter(n=>n.source.sessionId===t),r=e.filter(n=>n.source.sessionId!==t);return[...a,...r].slice(0,ji)}function Pn(e){let{t,sessionId:a,inputActions:r}=e,o=sa(e).workspaceId,l=Yt(),[s,c]=(0,zt.useState)(!1),[i,g]=(0,zt.useState)(null);(0,zt.useEffect)(()=>{if(!s||o===null)return;let u=new AbortController;return B.list({scope:"workspace",workspaceId:o},{},u.signal).then(y=>{u.signal.aborted||g(Bi(y.items,a))}).catch(()=>{u.signal.aborted||g([])}),()=>u.abort()},[s,o,a,l]);let k=o===null?[{type:"label",id:"no-workspace",text:t("empty.noWorkspace")}]:i===null?[{type:"label",id:"loading",text:t("empty.loading")}]:i.length===0?[{type:"label",id:"empty",text:t("composer.empty")}]:i.map(u=>({id:"open:"+u.id,label:u.title,icon:u.type==="page"?(0,Fe.jsx)(ze,{size:14}):u.type==="doc"?(0,Fe.jsx)(Oe,{size:14}):u.type==="sheet"?(0,Fe.jsx)(qe,{size:14}):(0,Fe.jsx)(Ye,{size:14})})),b=[{type:"label",id:"recent",text:t("composer.recent")},...k,...r===void 0?[]:[{type:"separator",id:"start-gap"},{type:"label",id:"start",text:t("composer.start")},...Ya.map(u=>({id:"prompt:"+u,label:t(`prompt.${u}`)}))],{type:"separator",id:"all-gap"},{id:"all",label:t("composer.all")}];return(0,Fe.jsx)(pt.Menu,{open:s,onClose:()=>c(!1),items:b,onSelect:u=>{if(c(!1),u==="all"){Te.layout?.selectPanel(dt);return}if(u.startsWith("prompt:")&&r!==void 0){r.insertText(t(`prompt.${u.slice(7)}Text`),r.captureInsertion());return}let y=i?.find(v=>"open:"+v.id===u);y===void 0||o===null||(Me(y.id,y.title),Te.sidebarRight?.openResource(te({scope:"workspace",workspaceId:o,id:y.id})))},side:"top",portal:!0,autoFocus:!0,anchor:(0,Fe.jsx)(pt.Tooltip,{label:t("composer.label"),side:"top",portal:!0,children:(0,Fe.jsx)(pt.Button,{size:"sm",className:"art-composer","aria-label":t("composer.label"),"aria-haspopup":"menu","aria-expanded":s,onClick:()=>c(u=>!u),children:(0,Fe.jsx)(kt,{})})})})}var ie=require("react");var $=require("react"),O=require("@deepseek-ai/dsh-client-ui-primitives");var he=require("react"),de=require("@deepseek-ai/dsh-client-ui-primitives");var R=require("react/jsx-runtime"),Hi=["sm","md","lg"],_i=e=>`<!doctype html><html><head><meta name="color-scheme" content="light dark"><style>
|
|
61
61
|
body { margin: 0; padding: 20px; font-family: var(--artifact-font-family); background: var(--artifact-color-surface); color: var(--artifact-color-text); }
|
|
62
62
|
h2 { margin: 0 0 6px; font-family: var(--artifact-font-display); font-size: var(--artifact-font-size-4); letter-spacing: -0.02em; }
|
|
63
63
|
p { margin: 0 0 14px; color: var(--artifact-color-muted); }
|
|
@@ -66,7 +66,7 @@ button { padding: 8px 14px; border: 0; border-radius: var(--artifact-radius-md);
|
|
|
66
66
|
.tag { padding: 3px 8px; border-radius: var(--artifact-radius-sm); background: var(--artifact-color-raised); color: var(--artifact-color-success); font-size: 12px; }
|
|
67
67
|
code { font-family: var(--artifact-font-mono); font-size: 12px; }
|
|
68
68
|
</style></head><body><h2>${e("design.previewHeading")}</h2><p>${e("design.previewBody")}</p>
|
|
69
|
-
<div class="row"><button>${e("design.previewButton")}</button><span class="tag">+12%</span><code>var(--artifact-color-primary)</code></div></body></html>`;function xi(e){return/^#[0-9a-f]{6}$/i.test(e)}function vn({t:e,workspaceId:t,workspaceTitle:a}){let[r,n]=(0,pe.useState)(null),[o,i]=(0,pe.useState)(null),[s,d]=(0,pe.useState)(!1),[l,h]=(0,pe.useState)(!1),x=st(),b={workspaceId:t,scope:t===null?"library":"workspace"},[p,u]=(0,pe.useState)(null),[y,g]=(0,pe.useState)(""),[P,w]=(0,pe.useState)(null),T=(0,pe.useRef)(0),A=r!==null&&o!==null&&JSON.stringify(o)!==JSON.stringify(r.tokens);(0,pe.useEffect)(()=>{let v=new AbortController;return n(null),i(null),u(null),d(!1),Promise.all([_.designSystem(t,v.signal),_.designSystems(b,v.signal)]).then(([I,Q])=>{v.signal.aborted||(n(I),i(I.tokens),u(Q))}).catch(()=>{v.signal.aborted||d(!0)}),()=>v.abort()},[t]);let j=(0,pe.useMemo)(()=>o===null?"":hr(o),[o]);if(s)return(0,E.jsx)("p",{className:"art-note",children:e("error.generic")});if(r===null||o===null)return(0,E.jsx)("p",{className:"art-note",children:e("empty.loading")});let z=async(v,I=!1)=>{h(!0);try{let Q={scope:v,workspaceId:v==="library"?null:t},D=v===b.scope?p:await _.designSystems(Q);if(D===null)return;let $=!I&&r.system?.scope===v?r.system.id:void 0,R=I||$?{systemId:$,createNew:$===void 0,expectedRevision:D.revision}:void 0,X=await _.saveDesignSystem(Q,o,R);v===b.scope&&(n(X),i(X.tokens),g(X.system?.id??""),u(await _.designSystems(b))),w(null),se(e("design.saved"))}catch(Q){w(e(Y(q(Q))))}finally{h(!1)}},H=async()=>{if(t!==null){h(!0);try{let v=await _.clearDesignSystem(t);n(v),i(v.tokens)}catch(v){w(e(Y(q(v))))}finally{h(!1)}}},W=async v=>{if(A){w(e("design.unsavedSelection"));return}let I=++T.current;h(!0);try{let Q=await _.selectedDesign(b,v===""?{}:{systemId:v,systemScope:b.scope});I===T.current&&(g(v),n(Q),i(Q.tokens),w(null))}catch(Q){w(e(Y(q(Q))))}finally{I===T.current&&h(!1)}},F=async()=>{try{u(await _.designSystems(b)),w(null)}catch(v){w(e(Y(q(v))))}},L=async()=>{if(!(!p||!r.system||r.system.scope!==b.scope)){h(!0);try{await _.setDesignDefault(b,r.system.id,p.revision),await F(),se(e("design.saved"))}catch(v){w(e(Y(q(v))))}finally{h(!1)}}};return(0,E.jsxs)("div",{className:"art-design",children:[(0,E.jsxs)("label",{className:"art-field",children:[e("design.system"),(0,E.jsxs)("select",{value:y,disabled:l,onChange:v=>void W(v.target.value),children:[(0,E.jsx)("option",{value:"",children:e("design.defaultChoice")}),p?.systems.map(v=>(0,E.jsx)("option",{value:v.id,children:e("design.revision",{name:v.name,revision:v.revision})},v.id))]})]}),(0,E.jsx)("p",{className:"art-note",children:e("design.pinHint")}),r.system?(0,E.jsx)("p",{className:"art-note",children:e("design.revision",{name:r.system.name,revision:r.system.revision})}):null,P?(0,E.jsx)("p",{role:"alert",className:"art-note",children:P}):null,(0,E.jsxs)("div",{className:"art-design-actions",children:[(0,E.jsx)(Be.Button,{size:"sm",disabled:l||!p,onClick:()=>void z(b.scope,!0),children:e("design.copy")}),r.system?.scope===b.scope?(0,E.jsx)(Be.Button,{size:"sm",disabled:l||A||p?.defaultId===r.system.id,onClick:()=>void L(),children:e("design.useDefault")}):null,(0,E.jsx)(Be.Button,{size:"sm",disabled:l,onClick:()=>void F(),children:e("design.catalogReload")}),A?(0,E.jsx)(Be.Button,{size:"sm",disabled:l,onClick:()=>{i(r.tokens),w(null)},children:e("design.discardEdits")}):null]}),(0,E.jsxs)("p",{className:"art-design-source",children:[e("design.hint")," ",e(`design.source.${r.source}`)]}),(0,E.jsxs)("div",{className:"art-design-group",children:[(0,E.jsx)("h3",{children:e("design.preview")}),(0,E.jsx)("div",{className:"art-design-preview",style:{height:150,display:"flex"},children:(0,E.jsx)(ta,{content:vi(e),designCss:j,title:o.name,frameTitle:e("design.preview"),dark:x})})]}),(0,E.jsxs)("fieldset",{disabled:l,style:{border:0,padding:0,margin:0,minWidth:0},children:[(0,E.jsxs)("label",{className:"art-field",children:[e("design.name"),(0,E.jsx)("input",{type:"text",value:o.name,maxLength:80,onChange:v=>i({...o,name:v.target.value})})]}),["colors","colorsDark"].map(v=>(0,E.jsxs)("div",{className:"art-design-group",children:[(0,E.jsx)("h3",{children:e(v==="colors"?"design.colors":"design.colorsDark")}),(0,E.jsx)("div",{className:"art-swatches",children:bt.map(I=>{let Q=D=>{let $={...o[v],[I]:D};i({...o,[v]:$})};return(0,E.jsxs)("div",{className:"art-swatch",children:[(0,E.jsx)("input",{type:"color","aria-label":e(`design.color.${I}`)+" "+e(v==="colors"?"design.colors":"design.colorsDark"),value:xi(o[v][I])?o[v][I]:"#000000",onChange:D=>Q(D.target.value)}),(0,E.jsxs)("span",{className:"art-swatch-text",children:[e(`design.color.${I}`),(0,E.jsx)("input",{type:"text","aria-label":e(`design.color.${I}`)+" "+e(v==="colors"?"design.colors":"design.colorsDark")+" CSS",value:o[v][I],onChange:D=>Q(D.target.value)})]})]},I)})})]},v)),(0,E.jsxs)("div",{className:"art-design-group",children:[(0,E.jsx)("h3",{children:e("design.type")}),(0,E.jsxs)("label",{className:"art-field",children:[e("design.font"),(0,E.jsx)("input",{type:"text",value:o.typography.fontFamily,onChange:v=>i({...o,typography:{...o.typography,fontFamily:v.target.value}})})]}),(0,E.jsxs)("label",{className:"art-field",children:[e("design.display"),(0,E.jsx)("input",{type:"text",value:o.typography.displayFamily,onChange:v=>i({...o,typography:{...o.typography,displayFamily:v.target.value}})})]}),(0,E.jsxs)("label",{className:"art-field",children:[e("design.mono"),(0,E.jsx)("input",{type:"text",value:o.typography.monoFamily,onChange:v=>i({...o,typography:{...o.typography,monoFamily:v.target.value}})})]})]}),(0,E.jsxs)("div",{className:"art-design-group",children:[(0,E.jsx)("h3",{children:e("design.radius")}),(0,E.jsx)("div",{className:"art-radius-row",children:yi.map(v=>(0,E.jsxs)("label",{children:[e(`design.radius.${v}`),(0,E.jsx)("input",{type:"number",min:0,max:64,value:o.radius[v],onChange:I=>i({...o,radius:{...o.radius,[v]:Number(I.target.value)||0}})})]},v))})]}),(0,E.jsxs)("label",{className:"art-field",children:[e("design.notes"),(0,E.jsx)("textarea",{value:o.notes,maxLength:4e3,onChange:v=>i({...o,notes:v.target.value})}),(0,E.jsx)("span",{className:"art-field-hint",children:e("design.notesHint")})]})]}),(0,E.jsxs)("div",{className:"art-design-actions",children:[t===null?null:(0,E.jsx)(Be.Button,{size:"sm",variant:"primary",disabled:l,onClick:()=>void z("workspace"),children:a===void 0?e("design.saveWorkspace"):e("design.saveWorkspaceNamed",{name:a})}),(0,E.jsx)(Be.Button,{size:"sm",variant:t===null?"primary":"outline",disabled:l,onClick:()=>void z("library"),children:e("design.saveLibrary")}),r.source==="workspace"&&t!==null?(0,E.jsx)(Be.Button,{size:"sm",variant:"outline",disabled:l,onClick:()=>void H(),children:e("design.clear")}):null]})]})}var re={maxSheets:20,maxRows:5e3,maxColumns:100,maxCells:2e4,maxFormulaCells:5e3,maxCellText:1e4,maxFormula:2e3,maxName:31,minColumnWidth:24,maxColumnWidth:800,defaultColumnWidth:96,defaultRowHeight:28,maxOperations:200,maxOperationCells:4e3,maxEvaluationCells:2e5,maxSelectionQuote:1500},O=class extends Error{code;constructor(t,a="sheet/invalid"){super(t),this.name="SheetError",this.code=a}},wi=/^\$?([A-Za-z]{1,3})\$?([1-9][0-9]{0,6})$/,ki=/^[A-Za-z]{1,3}$/,Si=/^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i,Ti=/[\\/?*[\]:]/,xn=["general","number","integer","currency","percent","date"],Ci=["left","center","right"],Ni=["bold","italic","underline","strike","align","color","background","numberFormat"],zi=["value","formula","style"],Ri=["name","cells","columnWidths"],Ei=["schemaVersion","sheets"];function dt(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function la(e,t,a){for(let r of Object.keys(e))if(!t.includes(r))throw new O(a+' has an unknown field "'+r+'". Use '+t.join(", ")+".")}function Sn(e){if(!Number.isInteger(e)||e<0)throw new O("A column index must be a non-negative integer.");let t=e+1,a="";for(;t>0;){let r=(t-1)%26;a=String.fromCharCode(65+r)+a,t=Math.floor((t-1)/26)}return a}function Tn(e){if(!ki.test(e))return;let t=0;for(let r of e.toUpperCase())t=t*26+(r.charCodeAt(0)-64);let a=t-1;return a<re.maxColumns?a:void 0}function sa(e){let t=wi.exec(e.trim());if(t===null)return;let a=Tn(t[1]??""),r=Number(t[2]);if(!(a===void 0||!Number.isInteger(r)||r<1||r>re.maxRows))return{row:r,column:a}}function ca(e,t){return Sn(t)+String(e)}function Ii(e,t="The sheet name"){if(typeof e!="string")throw new O(t+" must be a string.");let a=e.trim();if(a===""||a.length>re.maxName)throw new O(t+" must be 1 to "+String(re.maxName)+" characters.");if(Ti.test(a))throw new O(t+" cannot contain \\ / ? * [ ] or : characters.");if(a.startsWith("'")||a.endsWith("'"))throw new O(t+" cannot start or end with an apostrophe.");return a}function wn(e,t){if(typeof e!="string"||!Si.test(e.trim()))throw new O(t+" must be a hex color such as #1f2933.");let a=e.trim().toLowerCase();return a.length===4?"#"+a[1]+a[1]+a[2]+a[2]+a[3]+a[3]:a}function Ai(e,t){if(!dt(e))throw new O(t+" must be an object.");la(e,Ni,t);let a={};for(let r of["bold","italic","underline","strike"]){let n=e[r];if(n!==void 0){if(typeof n!="boolean")throw new O(t+"."+r+" must be true or false.");a[r]=n}}if(e.align!==void 0){if(typeof e.align!="string"||!Ci.includes(e.align))throw new O(t+".align must be left, center, or right.");a.align=e.align}if(e.numberFormat!==void 0){if(typeof e.numberFormat!="string"||!xn.includes(e.numberFormat))throw new O(t+".numberFormat must be "+xn.join(", ")+".");a.numberFormat=e.numberFormat}return e.color!==void 0&&(a.color=wn(e.color,t+".color")),e.background!==void 0&&(a.background=wn(e.background,t+".background")),a}function Di(e){return Object.keys(e).length===0}function kn(e,t){if(e!=null){if(typeof e=="boolean")return e;if(typeof e=="number"){if(!Number.isFinite(e))throw new O(t+" must be a finite number.");return e}if(typeof e=="string"){if(e.length>re.maxCellText)throw new O(t+" is longer than "+String(re.maxCellText)+" characters.");return e}throw new O(t+" must be a string, number, boolean, or null.")}}function Cn(e,t){if(e===null)return;if(typeof e=="string"||typeof e=="number"||typeof e=="boolean"){let i=kn(e,t);return i===void 0?void 0:typeof i=="string"&&i.startsWith("=")?Cn({formula:i},t):{value:i}}if(!dt(e))throw new O(t+" must be a JSON scalar or an object with value, formula, or style.");la(e,zi,t);let a=e.style===void 0?void 0:Ai(e.style,t+".style"),r=e.formula===void 0?void 0:Pi(e.formula,t+".formula");if(r!==void 0&&e.value!==void 0)throw new O(t+" cannot have both value and formula; the value of a formula is computed.");let n=kn(e.value,t+".value"),o={};if(r!==void 0&&(o.formula=r),n!==void 0&&(o.value=n),a!==void 0&&!Di(a)&&(o.style=a),!(o.formula===void 0&&o.value===void 0&&o.style===void 0))return o}function Pi(e,t){if(typeof e!="string")throw new O(t+" must be a string formula.");let a=e.trim();if(a===""||a==="=")throw new O(t+" is empty.");if(a.startsWith("=")||(a="="+a),a.length>re.maxFormula)throw new O(t+" is longer than "+String(re.maxFormula)+" characters.");return a}function Li(e,t){if(e===void 0)return;if(!dt(e))throw new O(t+" must be an object of column letters to pixel widths.");let a={};for(let[r,n]of Object.entries(e)){let o=Tn(r);if(o===void 0)throw new O(t+' has an invalid column "'+r+'".');if(typeof n!="number"||!Number.isFinite(n)||!Number.isInteger(n))throw new O(t+"."+r+" must be a whole number of pixels.");if(n<re.minColumnWidth||n>re.maxColumnWidth)throw new O(t+"."+r+" must be between "+String(re.minColumnWidth)+" and "+String(re.maxColumnWidth)+" pixels.");let i=Sn(o);if(a[i]!==void 0)throw new O(t+" names column "+i+" twice.");a[i]=n}return Object.keys(a).length===0?void 0:a}function Mi(e){if(!dt(e))throw new O("A sheet workbook must be a JSON object.");if(la(e,Ei,"The workbook"),e.schemaVersion!==void 0&&e.schemaVersion!==1)throw new O("Unsupported sheet schemaVersion "+String(e.schemaVersion)+"; this build reads version "+String(1)+".");let t=e.sheets;if(!Array.isArray(t)||t.length===0)throw new O('A sheet workbook needs a "sheets" array with at least one sheet.');if(t.length>re.maxSheets)throw new O("A workbook holds at most "+String(re.maxSheets)+" sheets.");let a=new Set,r=0,n=0;return{schemaVersion:1,sheets:t.map((i,s)=>{let d="sheets["+String(s)+"]";if(!dt(i))throw new O(d+" must be an object.");la(i,Ri,d);let l=Ii(i.name,d+".name");if(a.has(l.toLowerCase()))throw new O('Two sheets are named "'+l+'"; names must be unique.');a.add(l.toLowerCase());let h=i.cells??{};if(!dt(h))throw new O(d+".cells must be an object of cell references to values.");let x={};for(let[y,g]of Object.entries(h)){let P=sa(y);if(P===void 0)throw new O(d+'.cells has an invalid cell reference "'+y+'".');let w=Cn(g,d+".cells."+ca(P.row,P.column));w!==void 0&&(r+=1,w.formula!==void 0&&(n+=1),x[ca(P.row,P.column)]=w)}if(r>re.maxCells)throw new O("A sheet artifact holds at most "+String(re.maxCells)+" cells.");if(n>re.maxFormulaCells)throw new O("A sheet artifact holds at most "+String(re.maxFormulaCells)+" formulas.");let b={},p=Object.keys(x).sort((y,g)=>{let P=sa(y),w=sa(g);return P===void 0||w===void 0?y<g?-1:1:P.row===w.row?P.column-w.column:P.row-w.row});for(let y of p){let g=x[y];g!==void 0&&(b[y]=g)}let u=Li(i.columnWidths,d+".columnWidths");return{name:l,cells:b,...u===void 0?{}:{columnWidths:u}}})}}function Nn(e){let t;try{t=JSON.parse(e)}catch{throw new O("The sheet content is not valid JSON. Send one JSON object with schemaVersion and sheets.")}return Mi(t)}function zn(e){let t=0,a=0;for(let r of Object.keys(e.cells)){let n=sa(r);n!==void 0&&(n.row>t&&(t=n.row),n.column+1>a&&(a=n.column+1))}return{rows:t,columns:a}}var Rn=require("react"),En="dsh-artifact-studio.pins";function Oi(){if(typeof window>"u")return new Set;try{let e=window.localStorage.getItem(En);if(e===null)return new Set;let t=JSON.parse(e);return Array.isArray(t)?new Set(t.filter(a=>typeof a=="string")):new Set}catch{return new Set}}var da=Oi(),Ga=new Set;function ji(e){return Ga.add(e),()=>Ga.delete(e)}function In(){return(0,Rn.useSyncExternalStore)(ji,()=>da,()=>da)}function An(e){let t=new Set(da);t.has(e)?t.delete(e):t.add(e),da=t;try{window.localStorage.setItem(En,JSON.stringify([...t]))}catch{}for(let a of Ga)a()}var Fi=`<!doctype html>
|
|
69
|
+
<div class="row"><button>${e("design.previewButton")}</button><span class="tag">+12%</span><code>var(--artifact-color-primary)</code></div></body></html>`;function Vi(e){return/^#[0-9a-f]{6}$/i.test(e)}function On({t:e,workspaceId:t,workspaceTitle:a}){let[r,n]=(0,he.useState)(null),[o,l]=(0,he.useState)(null),[s,c]=(0,he.useState)(!1),[i,g]=(0,he.useState)(!1),k=lt(),b={workspaceId:t,scope:t===null?"library":"workspace"},[p,u]=(0,he.useState)(null),[y,v]=(0,he.useState)(""),[D,T]=(0,he.useState)(null),N=(0,he.useRef)(0),E=r!==null&&o!==null&&JSON.stringify(o)!==JSON.stringify(r.tokens);(0,he.useEffect)(()=>{let x=new AbortController;return n(null),l(null),u(null),c(!1),Promise.all([B.designSystem(t,x.signal),B.designSystems(b,x.signal)]).then(([A,Q])=>{x.signal.aborted||(n(A),l(A.tokens),u(Q))}).catch(()=>{x.signal.aborted||c(!0)}),()=>x.abort()},[t]);let j=(0,he.useMemo)(()=>o===null?"":xr(o),[o]);if(s)return(0,R.jsx)("div",{className:"art-state",role:"alert",children:e("error.generic")});if(r===null||o===null)return(0,R.jsx)("div",{className:"art-state",role:"status",children:(0,R.jsx)(de.TextShimmer,{active:!0,children:e("empty.loading")})});let z=async(x,A=!1)=>{g(!0);try{let Q={scope:x,workspaceId:x==="library"?null:t},L=x===b.scope?p:await B.designSystems(Q);if(L===null)return;let q=!A&&r.system?.scope===x?r.system.id:void 0,I=A||q?{systemId:q,createNew:q===void 0,expectedRevision:L.revision}:void 0,J=await B.saveDesignSystem(Q,o,I);x===b.scope&&(n(J),l(J.tokens),v(J.system?.id??""),u(await B.designSystems(b))),T(null),ae(e("design.saved"))}catch(Q){T(e(X(Y(Q))))}finally{g(!1)}},W=async()=>{if(t!==null){g(!0);try{let x=await B.clearDesignSystem(t);n(x),l(x.tokens)}catch(x){T(e(X(Y(x))))}finally{g(!1)}}},U=async x=>{if(E){T(e("design.unsavedSelection"));return}let A=++N.current;g(!0);try{let Q=await B.selectedDesign(b,x===""?{}:{systemId:x,systemScope:b.scope});A===N.current&&(v(x),n(Q),l(Q.tokens),T(null))}catch(Q){T(e(X(Y(Q))))}finally{A===N.current&&g(!1)}},H=async()=>{try{u(await B.designSystems(b)),T(null)}catch(x){T(e(X(Y(x))))}},P=async()=>{if(!(!p||!r.system||r.system.scope!==b.scope)){g(!0);try{await B.setDesignDefault(b,r.system.id,p.revision),await H(),ae(e("design.saved"))}catch(x){T(e(X(Y(x))))}finally{g(!1)}}};return(0,R.jsxs)("div",{className:"art-design",children:[(0,R.jsxs)("label",{className:"art-field",children:[e("design.system"),(0,R.jsxs)("select",{className:"art-select",value:y,disabled:i,onChange:x=>void U(x.target.value),children:[(0,R.jsx)("option",{value:"",children:e("design.defaultChoice")}),p?.systems.map(x=>(0,R.jsx)("option",{value:x.id,children:e("design.revision",{name:x.name,revision:x.revision})},x.id))]})]}),(0,R.jsx)("p",{className:"art-note",children:e("design.pinHint")}),r.system?(0,R.jsx)("p",{className:"art-note",children:e("design.revision",{name:r.system.name,revision:r.system.revision})}):null,D?(0,R.jsx)("p",{role:"alert",className:"art-note",children:D}):null,(0,R.jsxs)("div",{className:"art-design-actions",children:[(0,R.jsx)(de.Button,{size:"sm",disabled:i||!p,onClick:()=>void z(b.scope,!0),children:e("design.copy")}),r.system?.scope===b.scope?(0,R.jsx)(de.Button,{size:"sm",disabled:i||E||p?.defaultId===r.system.id,onClick:()=>void P(),children:e("design.useDefault")}):null,(0,R.jsx)(de.Button,{size:"sm",disabled:i,onClick:()=>void H(),children:e("design.catalogReload")}),E?(0,R.jsx)(de.Button,{size:"sm",disabled:i,onClick:()=>{l(r.tokens),T(null)},children:e("design.discardEdits")}):null]}),(0,R.jsxs)("p",{className:"art-design-source",children:[e("design.hint")," ",e(`design.source.${r.source}`)]}),(0,R.jsxs)("div",{className:"art-design-group",children:[(0,R.jsx)("h3",{children:e("design.preview")}),(0,R.jsx)("div",{className:"art-token-preview",children:(0,R.jsx)(na,{content:_i(e),designCss:j,title:o.name,frameTitle:e("design.preview"),dark:k})})]}),(0,R.jsxs)("fieldset",{disabled:i,style:{border:0,padding:0,margin:0,minWidth:0},children:[(0,R.jsxs)("label",{className:"art-field",children:[e("design.name"),(0,R.jsx)(de.Input,{type:"text",value:o.name,maxLength:80,onChange:x=>l({...o,name:x.target.value})})]}),["colors","colorsDark"].map(x=>(0,R.jsxs)("div",{className:"art-design-group",children:[(0,R.jsx)("h3",{children:e(x==="colors"?"design.colors":"design.colorsDark")}),(0,R.jsx)("div",{className:"art-swatches",children:$e.map(A=>{let Q=L=>{let q={...o[x],[A]:L};l({...o,[x]:q})};return(0,R.jsxs)("div",{className:"art-swatch",children:[(0,R.jsx)("input",{type:"color","aria-label":e(`design.color.${A}`)+" "+e(x==="colors"?"design.colors":"design.colorsDark"),value:Vi(o[x][A])?o[x][A]:"#000000",onChange:L=>Q(L.target.value)}),(0,R.jsxs)("span",{className:"art-swatch-text",children:[e(`design.color.${A}`),(0,R.jsx)(de.Input,{type:"text","aria-label":e(`design.color.${A}`)+" "+e(x==="colors"?"design.colors":"design.colorsDark")+" CSS",value:o[x][A],onChange:L=>Q(L.target.value)})]})]},A)})})]},x)),(0,R.jsxs)("div",{className:"art-design-group",children:[(0,R.jsx)("h3",{children:e("design.type")}),(0,R.jsxs)("label",{className:"art-field",children:[e("design.font"),(0,R.jsx)(de.Input,{type:"text",value:o.typography.fontFamily,onChange:x=>l({...o,typography:{...o.typography,fontFamily:x.target.value}})})]}),(0,R.jsxs)("label",{className:"art-field",children:[e("design.display"),(0,R.jsx)(de.Input,{type:"text",value:o.typography.displayFamily,onChange:x=>l({...o,typography:{...o.typography,displayFamily:x.target.value}})})]}),(0,R.jsxs)("label",{className:"art-field",children:[e("design.mono"),(0,R.jsx)(de.Input,{type:"text",value:o.typography.monoFamily,onChange:x=>l({...o,typography:{...o.typography,monoFamily:x.target.value}})})]})]}),(0,R.jsxs)("div",{className:"art-design-group",children:[(0,R.jsx)("h3",{children:e("design.radius")}),(0,R.jsx)("div",{className:"art-radius-row",children:Hi.map(x=>(0,R.jsxs)("label",{children:[e(`design.radius.${x}`),(0,R.jsx)(de.Input,{type:"number",min:0,max:64,value:o.radius[x],onChange:A=>l({...o,radius:{...o.radius,[x]:Number(A.target.value)||0}})})]},x))})]}),(0,R.jsxs)("label",{className:"art-field",children:[e("design.notes"),(0,R.jsx)("textarea",{value:o.notes,maxLength:4e3,onChange:x=>l({...o,notes:x.target.value})}),(0,R.jsx)("span",{className:"art-field-hint",children:e("design.notesHint")})]})]}),(0,R.jsxs)("div",{className:"art-design-actions",children:[t===null?null:(0,R.jsx)(de.Button,{size:"sm",variant:"primary",disabled:i,onClick:()=>void z("workspace"),children:a===void 0?e("design.saveWorkspace"):e("design.saveWorkspaceNamed",{name:a})}),(0,R.jsx)(de.Button,{size:"sm",variant:t===null?"primary":"outline",disabled:i,onClick:()=>void z("library"),children:e("design.saveLibrary")}),r.source==="workspace"&&t!==null?(0,R.jsx)(de.Button,{size:"sm",variant:"outline",disabled:i,onClick:()=>void W(),children:e("design.clear")}):null]})]})}var oe={maxSheets:20,maxRows:5e3,maxColumns:100,maxCells:2e4,maxFormulaCells:5e3,maxCellText:1e4,maxFormula:2e3,maxName:31,minColumnWidth:24,maxColumnWidth:800,defaultColumnWidth:96,defaultRowHeight:28,maxOperations:200,maxOperationCells:4e3,maxEvaluationCells:2e5,maxSelectionQuote:1500},F=class extends Error{code;constructor(t,a="sheet/invalid"){super(t),this.name="SheetError",this.code=a}},Wi=/^\$?([A-Za-z]{1,3})\$?([1-9][0-9]{0,6})$/,Gi=/^[A-Za-z]{1,3}$/,Ui=/^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i,$i=/[\\/?*[\]:]/,Fn=["general","number","integer","currency","percent","date"],Ki=["left","center","right"],qi=["bold","italic","underline","strike","align","color","background","numberFormat"],Yi=["value","formula","style"],Xi=["name","cells","columnWidths"],Qi=["schemaVersion","sheets"];function ut(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function da(e,t,a){for(let r of Object.keys(e))if(!t.includes(r))throw new F(a+' has an unknown field "'+r+'". Use '+t.join(", ")+".")}function Hn(e){if(!Number.isInteger(e)||e<0)throw new F("A column index must be a non-negative integer.");let t=e+1,a="";for(;t>0;){let r=(t-1)%26;a=String.fromCharCode(65+r)+a,t=Math.floor((t-1)/26)}return a}function _n(e){if(!Gi.test(e))return;let t=0;for(let r of e.toUpperCase())t=t*26+(r.charCodeAt(0)-64);let a=t-1;return a<oe.maxColumns?a:void 0}function ca(e){let t=Wi.exec(e.trim());if(t===null)return;let a=_n(t[1]??""),r=Number(t[2]);if(!(a===void 0||!Number.isInteger(r)||r<1||r>oe.maxRows))return{row:r,column:a}}function pa(e,t){return Hn(t)+String(e)}function Ji(e,t="The sheet name"){if(typeof e!="string")throw new F(t+" must be a string.");let a=e.trim();if(a===""||a.length>oe.maxName)throw new F(t+" must be 1 to "+String(oe.maxName)+" characters.");if($i.test(a))throw new F(t+" cannot contain \\ / ? * [ ] or : characters.");if(a.startsWith("'")||a.endsWith("'"))throw new F(t+" cannot start or end with an apostrophe.");return a}function jn(e,t){if(typeof e!="string"||!Ui.test(e.trim()))throw new F(t+" must be a hex color such as #1f2933.");let a=e.trim().toLowerCase();return a.length===4?"#"+a[1]+a[1]+a[2]+a[2]+a[3]+a[3]:a}function Zi(e,t){if(!ut(e))throw new F(t+" must be an object.");da(e,qi,t);let a={};for(let r of["bold","italic","underline","strike"]){let n=e[r];if(n!==void 0){if(typeof n!="boolean")throw new F(t+"."+r+" must be true or false.");a[r]=n}}if(e.align!==void 0){if(typeof e.align!="string"||!Ki.includes(e.align))throw new F(t+".align must be left, center, or right.");a.align=e.align}if(e.numberFormat!==void 0){if(typeof e.numberFormat!="string"||!Fn.includes(e.numberFormat))throw new F(t+".numberFormat must be "+Fn.join(", ")+".");a.numberFormat=e.numberFormat}return e.color!==void 0&&(a.color=jn(e.color,t+".color")),e.background!==void 0&&(a.background=jn(e.background,t+".background")),a}function es(e){return Object.keys(e).length===0}function Bn(e,t){if(e!=null){if(typeof e=="boolean")return e;if(typeof e=="number"){if(!Number.isFinite(e))throw new F(t+" must be a finite number.");return e}if(typeof e=="string"){if(e.length>oe.maxCellText)throw new F(t+" is longer than "+String(oe.maxCellText)+" characters.");return e}throw new F(t+" must be a string, number, boolean, or null.")}}function Vn(e,t){if(e===null)return;if(typeof e=="string"||typeof e=="number"||typeof e=="boolean"){let l=Bn(e,t);return l===void 0?void 0:typeof l=="string"&&l.startsWith("=")?Vn({formula:l},t):{value:l}}if(!ut(e))throw new F(t+" must be a JSON scalar or an object with value, formula, or style.");da(e,Yi,t);let a=e.style===void 0?void 0:Zi(e.style,t+".style"),r=e.formula===void 0?void 0:ts(e.formula,t+".formula");if(r!==void 0&&e.value!==void 0)throw new F(t+" cannot have both value and formula; the value of a formula is computed.");let n=Bn(e.value,t+".value"),o={};if(r!==void 0&&(o.formula=r),n!==void 0&&(o.value=n),a!==void 0&&!es(a)&&(o.style=a),!(o.formula===void 0&&o.value===void 0&&o.style===void 0))return o}function ts(e,t){if(typeof e!="string")throw new F(t+" must be a string formula.");let a=e.trim();if(a===""||a==="=")throw new F(t+" is empty.");if(a.startsWith("=")||(a="="+a),a.length>oe.maxFormula)throw new F(t+" is longer than "+String(oe.maxFormula)+" characters.");return a}function as(e,t){if(e===void 0)return;if(!ut(e))throw new F(t+" must be an object of column letters to pixel widths.");let a={};for(let[r,n]of Object.entries(e)){let o=_n(r);if(o===void 0)throw new F(t+' has an invalid column "'+r+'".');if(typeof n!="number"||!Number.isFinite(n)||!Number.isInteger(n))throw new F(t+"."+r+" must be a whole number of pixels.");if(n<oe.minColumnWidth||n>oe.maxColumnWidth)throw new F(t+"."+r+" must be between "+String(oe.minColumnWidth)+" and "+String(oe.maxColumnWidth)+" pixels.");let l=Hn(o);if(a[l]!==void 0)throw new F(t+" names column "+l+" twice.");a[l]=n}return Object.keys(a).length===0?void 0:a}function rs(e){if(!ut(e))throw new F("A sheet workbook must be a JSON object.");if(da(e,Qi,"The workbook"),e.schemaVersion!==void 0&&e.schemaVersion!==1)throw new F("Unsupported sheet schemaVersion "+String(e.schemaVersion)+"; this build reads version "+String(1)+".");let t=e.sheets;if(!Array.isArray(t)||t.length===0)throw new F('A sheet workbook needs a "sheets" array with at least one sheet.');if(t.length>oe.maxSheets)throw new F("A workbook holds at most "+String(oe.maxSheets)+" sheets.");let a=new Set,r=0,n=0;return{schemaVersion:1,sheets:t.map((l,s)=>{let c="sheets["+String(s)+"]";if(!ut(l))throw new F(c+" must be an object.");da(l,Xi,c);let i=Ji(l.name,c+".name");if(a.has(i.toLowerCase()))throw new F('Two sheets are named "'+i+'"; names must be unique.');a.add(i.toLowerCase());let g=l.cells??{};if(!ut(g))throw new F(c+".cells must be an object of cell references to values.");let k={};for(let[y,v]of Object.entries(g)){let D=ca(y);if(D===void 0)throw new F(c+'.cells has an invalid cell reference "'+y+'".');let T=Vn(v,c+".cells."+pa(D.row,D.column));T!==void 0&&(r+=1,T.formula!==void 0&&(n+=1),k[pa(D.row,D.column)]=T)}if(r>oe.maxCells)throw new F("A sheet artifact holds at most "+String(oe.maxCells)+" cells.");if(n>oe.maxFormulaCells)throw new F("A sheet artifact holds at most "+String(oe.maxFormulaCells)+" formulas.");let b={},p=Object.keys(k).sort((y,v)=>{let D=ca(y),T=ca(v);return D===void 0||T===void 0?y<v?-1:1:D.row===T.row?D.column-T.column:D.row-T.row});for(let y of p){let v=k[y];v!==void 0&&(b[y]=v)}let u=as(l.columnWidths,c+".columnWidths");return{name:i,cells:b,...u===void 0?{}:{columnWidths:u}}})}}function Wn(e){let t;try{t=JSON.parse(e)}catch{throw new F("The sheet content is not valid JSON. Send one JSON object with schemaVersion and sheets.")}return rs(t)}function Gn(e){let t=0,a=0;for(let r of Object.keys(e.cells)){let n=ca(r);n!==void 0&&(n.row>t&&(t=n.row),n.column+1>a&&(a=n.column+1))}return{rows:t,columns:a}}var Un=require("react"),$n="dsh-artifact-studio.pins";function ns(){if(typeof window>"u")return new Set;try{let e=window.localStorage.getItem($n);if(e===null)return new Set;let t=JSON.parse(e);return Array.isArray(t)?new Set(t.filter(a=>typeof a=="string")):new Set}catch{return new Set}}var ua=ns(),Xa=new Set;function os(e){return Xa.add(e),()=>Xa.delete(e)}function Kn(){return(0,Un.useSyncExternalStore)(os,()=>ua,()=>ua)}function qn(e){let t=new Set(ua);t.has(e)?t.delete(e):t.add(e),ua=t;try{window.localStorage.setItem($n,JSON.stringify([...t]))}catch{}for(let a of Xa)a()}var is=`<!doctype html>
|
|
70
70
|
<html lang="en">
|
|
71
71
|
<head>
|
|
72
72
|
<meta charset="utf-8">
|
|
@@ -92,11 +92,11 @@ code { font-family: var(--artifact-font-mono); font-size: 12px; }
|
|
|
92
92
|
</main>
|
|
93
93
|
</body>
|
|
94
94
|
</html>
|
|
95
|
-
`,
|
|
95
|
+
`,ss=`# {{title}}
|
|
96
96
|
|
|
97
97
|
Start writing, or select text and choose Edit with agent.
|
|
98
|
-
`;function
|
|
99
|
-
`}var
|
|
98
|
+
`;function ls(e){return JSON.stringify({schemaVersion:1,sheets:[{name:"Sheet1",cells:{A1:{value:e,style:{bold:!0}},A3:"Item",B3:"Amount",A4:"Example",B4:100,B5:"Total",B6:"=SUM(B4:B5)"},columnWidths:{A:180}}]},null,2)+`
|
|
99
|
+
`}var cs=`<Frame w={720} p={40} bg="#ffffff" flex="col" gap={12}>
|
|
100
100
|
<Text size={13} weight={600} color="#2856c7">DESIGN</Text>
|
|
101
101
|
<Text size={40} weight={700} color="#16181d">{{title}}</Text>
|
|
102
102
|
<Text size={16} color="#5b6170">Edit the source, or ask the agent for a change.</Text>
|
|
@@ -104,10 +104,24 @@ Start writing, or select text and choose Edit with agent.
|
|
|
104
104
|
<Text size={15} weight={600} color="#ffffff">Get started</Text>
|
|
105
105
|
</Frame>
|
|
106
106
|
</Frame>
|
|
107
|
-
`;function Vi(e){return e.replace(/[&<>"']/g,t=>`&#${t.charCodeAt(0)};`)}function Wi(e){return e.replace(/[\\`*_\[\]#]/g,t=>`\\${t}`)}function Ui(e){return e.replace(/[{}<>]/g," ")}function Dn(e,t){return e==="doc"?_i.replace("{{title}}",Wi(t)):e==="design"?Bi.replace("{{title}}",Ui(t)):e==="sheet"?Hi(t):Fi.replace("{{title}}",Vi(t))}var f=require("react/jsx-runtime");function ua(e){return e.kind==="workspace"?"ws:"+e.workspaceId:e.kind}function qa(e){if(e==="all")return{kind:"all"};if(e==="library")return{kind:"library"};if(e==null||!e.startsWith("ws:"))return;let t=e.slice(3);return t===""?void 0:{kind:"workspace",workspaceId:t}}function Mn(e,t,a){return e.scope==="library"?{manifest:e,address:{scope:"library",id:e.id},where:{scope:"library",workspaceId:t},project:null}:a===null?null:{manifest:e,address:{scope:"workspace",workspaceId:a.workspaceId,id:e.id},where:{scope:"workspace",workspaceId:a.workspaceId},project:a.title}}function Gi(e,t){e!==void 0&&(Ae(t.manifest.id,t.manifest.title),e(te(t.address)))}function On(e){let t=te(e.address);return e.manifest.scope==="library"?t+"@"+(e.where.workspaceId??""):t}var Rt=new Map,$a=new Map,$i=2,pa=new Map,Et=[],Ka=0;function Pn(){for(;Ka<$i&&Et.length>0;){let e=Et.shift();if(e===void 0)return;Ka+=1,e.start()}}function Ki(e){let t={start:()=>{e().finally(()=>{Ka-=1,Pn()})}};return Et.push(t),Pn(),()=>{let a=Et.indexOf(t);a!==-1&&Et.splice(a,1)}}function qi(e){let t=On(e),a=Rt.get(t);if(a!==void 0&&a.version>=e.manifest.version)return Promise.resolve(a);let r=t+":"+e.manifest.version,n=$a.get(r);if(n!==void 0)return n;let o=_.get(e.where,e.manifest.id).then(i=>{let s={version:i.version,content:i.content,designCss:i.designCss},d=Rt.get(t);return(d===void 0||d.version<=s.version)&&(Rt.size>=60&&Rt.clear(),Rt.set(t,s)),s}).finally(()=>{$a.delete(r)});return $a.set(r,o),o}function Yi(e){if(typeof DOMParser>"u")return e.replace(/<script\b[^>]*>[\s\S]*?<\/script\s*>/gi,"").replace(/<script\b[^>]*\/?>/gi,"").replace(/\son[a-z]+\s*=\s*"[^"]*"/gi,"");let t=new DOMParser().parseFromString(e,"text/html");for(let a of t.querySelectorAll("script, iframe, object, embed, base"))a.remove();for(let a of t.querySelectorAll("*"))for(let r of[...a.attributes]){let n=r.name.toLowerCase();(n.startsWith("on")||n==="srcdoc")&&a.removeAttribute(r.name)}return"<!doctype html>"+t.documentElement.outerHTML}function Qi(e){let t=e.replace(/\x60{3}[\s\S]*?\x60{3}/g," ").replace(/!\[[^\]]*\]\([^)]*\)/g," ").replace(/\[([^\]]+)\]\([^)]*\)/g,"$1").replace(/<[^>]+>/g," ").replace(/[#>*_\x60~]/g," ").replace(/\s+/g," ").trim();return t.length>220?t.slice(0,220).trimEnd()+"...":t}function Xi(e){try{let a=Nn(e).sheets[0];if(a===void 0)return null;let r=zn(a),n=Math.min(5,Math.max(1,r.rows)),o=Math.min(4,Math.max(1,r.columns)),i=[];for(let s=1;s<=n;s+=1){let d=[];for(let l=0;l<o;l+=1){let h=a.cells[ca(s,l)];h===void 0?d.push(""):h.formula!==void 0?d.push(h.formula):h.value===void 0?d.push(""):d.push(String(h.value))}i.push(d)}return{name:a.name,rows:i}}catch{return null}}function Ji({t:e,view:t}){let[a,r]=(0,U.useState)(null),[n,o]=(0,U.useState)(!1),[i,s]=(0,U.useState)(typeof IntersectionObserver>"u"),[d,l]=(0,U.useState)(null),[h,x]=(0,U.useState)(null),b=(0,U.useRef)(null),p=st(),u=On(t),y=t.manifest.title,g=t.manifest.type,P=t.manifest.version;(0,U.useEffect)(()=>{if(i)return;let A=b.current;if(A===null)return;let j=new IntersectionObserver(z=>{z.some(H=>H.isIntersecting)&&(s(!0),j.disconnect())},{rootMargin:"140px"});return j.observe(A),()=>j.disconnect()},[i]),(0,U.useEffect)(()=>{if(!i||g!=="design")return;let A=u+"@"+P,j=pa.get(A);if(j!==void 0){x(j),o(!1);return}let z=new AbortController,H=!1,W=Ki(async()=>{try{let F=await _.preview(t.where,t.manifest.id,P,z.signal);if(H)return;let L="data:"+F.mediaType+";base64,"+F.data;pa.size>=40&&pa.clear(),pa.set(A,L),x(L),o(!1)}catch{H||o(!0)}});return()=>{H=!0,z.abort(),W()}},[i,u,P,g]),(0,U.useEffect)(()=>{if(!i||g==="design")return;let A=!1;return qi(t).then(j=>{!A&&j.version===P&&(r(j),o(!1))}).catch(()=>{A||o(!0)}),()=>{A=!0}},[i,u,P]),(0,U.useEffect)(()=>{if(g!=="page"||a===null){l(null);return}let A=URL.createObjectURL(new Blob([Yi(Zt(a.content,a.designCss,y,p?"dark":"light"))],{type:"text/html"}));return l(A),()=>URL.revokeObjectURL(A)},[a,g,y,p]);let w=g==="page"?(0,f.jsx)(ke,{}):g==="doc"?(0,f.jsx)(Pe,{}):g==="sheet"?(0,f.jsx)($e,{}):(0,f.jsx)(Ke,{});if(n)return(0,f.jsx)("span",{className:"art-cover",ref:b,"aria-hidden":"true",children:(0,f.jsx)("span",{className:"art-cover-fallback",children:w})});if(g==="design")return(0,f.jsx)("span",{className:"art-cover",ref:b,"aria-hidden":"true",children:h===null?(0,f.jsx)("span",{className:"art-cover-fallback",children:w}):(0,f.jsx)("img",{className:"art-cover-design",src:h,alt:""})});if(g==="page")return(0,f.jsx)("span",{className:"art-cover",ref:b,"aria-hidden":"true",children:d===null?(0,f.jsx)("span",{className:"art-cover-fallback",children:w}):(0,f.jsx)("span",{className:"art-cover-frame-wrap",children:(0,f.jsx)("iframe",{className:"art-cover-frame",src:d,sandbox:"",title:e("gallery.coverTitle",{title:y}),tabIndex:-1,loading:"lazy",referrerPolicy:"no-referrer"})})});if(g==="sheet"){let A=a===null?null:Xi(a.content);return(0,f.jsx)("span",{className:"art-cover",ref:b,"aria-hidden":"true",children:A===null?(0,f.jsx)("span",{className:"art-cover-fallback",children:w}):(0,f.jsxs)("span",{className:"art-cover-sheet",children:[(0,f.jsx)("span",{className:"art-cover-sheet-name",children:A.name}),(0,f.jsx)("span",{className:"art-cover-sheet-table",children:A.rows.map((j,z)=>(0,f.jsxs)("span",{className:"art-cover-sheet-row",children:[(0,f.jsx)("span",{className:"art-cover-sheet-index",children:z+1}),j.map((H,W)=>(0,f.jsx)("span",{className:"art-cover-sheet-cell",children:H},W))]},z))})]})})}let T=a===null?"":Qi(a.content);return(0,f.jsx)("span",{className:"art-cover",ref:b,"aria-hidden":"true",children:T===""?(0,f.jsx)("span",{className:"art-cover-fallback",children:w}):(0,f.jsxs)("span",{className:"art-cover-doc",children:[(0,f.jsx)("span",{className:"art-cover-doc-title",children:y}),(0,f.jsx)("span",{className:"art-cover-doc-text",children:T})]})})}function Zi({t:e,view:t,pinned:a,onOpen:r,showProject:n}){let o=te(t.address),i=e(a?"gallery.unpin":"gallery.pin",{title:t.manifest.title}),s=t.manifest.scope==="library"?" \xB7 "+e("scope.library"):n&&t.project!==null?" \xB7 "+t.project:"";return(0,f.jsxs)("li",{className:"art-tile",children:[(0,f.jsxs)("button",{type:"button",className:"art-tile-open",onClick:()=>r(t),children:[(0,f.jsx)(Ji,{t:e,view:t}),(0,f.jsxs)("span",{className:"art-tile-body",children:[(0,f.jsx)("span",{className:"art-tile-title",title:t.manifest.title,children:t.manifest.title}),(0,f.jsxs)("span",{className:"art-tile-sub",children:[e(`type.${t.manifest.type}`)," \xB7 ",e("gallery.updated",{time:ea(e,t.manifest.updatedAt)})," \xB7 ",e("gallery.version",{version:t.manifest.version}),s]})]})]}),(0,f.jsx)(B.Tooltip,{label:i,side:"left",portal:!0,children:(0,f.jsx)("button",{type:"button",className:"art-tile-pin","aria-label":i,"aria-pressed":a,onClick:()=>An(o),children:a?(0,f.jsx)(B.IconPinFillRegular,{size:14}):(0,f.jsx)(B.IconPinOutlineRegular,{size:14})})})]})}function Ln({t:e,heading:t,views:a,pinned:r,onOpen:n,showProject:o}){let i=(0,U.useId)();return a.length===0?null:(0,f.jsxs)("section",{className:"art-section","aria-labelledby":i,children:[(0,f.jsxs)("div",{className:"art-section-head",children:[(0,f.jsx)("h2",{className:"art-section-title",id:i,children:t}),(0,f.jsx)("span",{className:"art-section-hint",children:e("gallery.count",{count:a.length})})]}),(0,f.jsx)("ul",{className:"art-grid",children:a.map(s=>(0,f.jsx)(Zi,{t:e,view:s,pinned:r.has(te(s.address)),onOpen:n,showProject:o},te(s.address)))})]})}function es(e,t,a){let r={where:{scope:"library",workspaceId:a},project:null};if(e.kind==="library")return[r];if(e.kind==="workspace"){let n=t.find(o=>o.workspaceId===e.workspaceId);return n===void 0?[]:[{where:{scope:"workspace",workspaceId:n.workspaceId},project:n}]}return[...t.map(n=>({where:{scope:"workspace",workspaceId:n.workspaceId},project:n})),r]}var ts=12;function as(e,t,a,r,n,o){let[i,s]=(0,U.useState)(1),[d,l]=(0,U.useState)({key:"",state:{status:"loading"}}),h=t.map(u=>u.workspaceId+":"+u.title).join(","),x=ua(e)+":"+h+":"+(a??"")+":"+r+":"+(n??""),b=e.kind==="all",p=d.key===x?d.state:{status:"loading"};return(0,U.useEffect)(()=>s(1),[x,r]),(0,U.useEffect)(()=>{let u=es(e,t,a);if(u.length===0){l({key:x,state:{status:"ready",items:[],hasMore:!1,truncated:!1,failed:0}});return}let y=new AbortController,g=setTimeout(async()=>{let P=b?ts:void 0,w=await Promise.all(u.map(async W=>{let F=[];for(let L=0;L<i;L+=1)try{let v=await _.list(W.where,{query:r,type:n,offset:L*(P??50),...P===void 0?{}:{limit:P}},y.signal);if(F.push(v),!v.hasMore)break}catch(v){return{loaded:F,failed:!0,code:q(v)}}return{loaded:F,failed:!1}}));if(y.signal.aborted)return;let T=[],A=!1,j=!1,z=0,H;if(w.forEach((W,F)=>{let L=u[F];if(L===void 0)return;W.failed&&(z+=1,H===void 0&&(H=W.code));let v=W.loaded[W.loaded.length-1];if(v!==void 0){v.hasMore&&(A=!0),v.truncated&&(j=!0);for(let I of W.loaded)for(let Q of I.items){let D=Mn(Q,a,L.project);D!==null&&T.push(D)}}}),z===u.length){l({key:x,state:{status:"failed",code:H}});return}T.sort((W,F)=>Date.parse(F.manifest.updatedAt)-Date.parse(W.manifest.updatedAt)),l({key:x,state:{status:"ready",items:T,hasMore:A,truncated:j,failed:z}})},r===""?0:180);return()=>{y.abort(),clearTimeout(g)}},[x,o,i]),{state:p,more:()=>s(u=>u+1)}}function rs({t:e,variant:t}){let a=t==="all"?"empty.allTitle":t==="library"?"empty.libraryTitle":"empty.workspaceTitle",r=t==="all"?"empty.allHint":t==="library"?"empty.libraryHint":"empty.workspaceHint",n=async o=>{try{await navigator.clipboard.writeText(o),se(e("gallery.promptCopied"))}catch{se(e("action.copyFailed"))}};return(0,f.jsxs)("div",{className:"art-empty",children:[(0,f.jsx)("p",{className:"art-empty-title",children:e(a)}),(0,f.jsx)("p",{className:"art-empty-hint",children:e(r)}),(0,f.jsx)("ul",{className:"art-starters",children:Ua.map(o=>(0,f.jsxs)("li",{className:"art-starter",children:[(0,f.jsxs)("span",{className:"art-starter-text",children:[(0,f.jsx)("span",{className:"art-starter-name",children:e(`prompt.${o}`)}),(0,f.jsx)("span",{className:"art-starter-hint",children:e(`prompt.${o}Text`)})]}),(0,f.jsx)(B.Tooltip,{label:e("gallery.copyPrompt"),side:"left",portal:!0,children:(0,f.jsx)(B.Button,{size:"sm",className:"art-icon-button","aria-label":e("gallery.copyPromptNamed",{name:e(`prompt.${o}`)}),onClick:()=>void n(e(`prompt.${o}Text`)),children:(0,f.jsx)(B.IconCopyOutlineRegular,{size:14})})})]},o))})]})}function Ya({t:e,projects:t,scope:a,contextWorkspaceId:r,onScopeChange:n,scopeLocked:o=!1,open:i}){let[s,d]=(0,U.useState)(""),[l,h]=(0,U.useState)(void 0),[x,b]=(0,U.useState)("list"),[p,u]=(0,U.useState)(!1),[y,g]=(0,U.useState)(0),P=Yt()+y,w=In(),T=as(a,t,r,s,l,P),A=(0,U.useId)(),j=t.find(R=>R.workspaceId===r)??null,z=a.kind==="library"?null:r,H=z===null?null:t.find(R=>R.workspaceId===z)??null,W=a.kind==="library"||j===null?"library":"workspace",F=W==="library"?e("scope.library"):j?.title??e("scope.library"),L=T.state,v=L.status==="ready"?L.items:[],I=(0,U.useCallback)(R=>Gi(i,R),[i]),Q=(0,U.useCallback)(async(R,X)=>{if(X==="workspace"&&r===null)return;let Qe=e(R==="page"?"create.untitledPage":R==="doc"?"create.untitledDoc":R==="sheet"?"create.untitledSheet":"create.untitledDesign");try{let{manifest:Xe}=await _.create({scope:X,workspaceId:r},R,Qe,Dn(R,Qe));we();let ma=X==="workspace"?t.find(pt=>pt.workspaceId===r)??null:null,It=Mn(Xe,r,ma);It!==null&&I(It)}catch(Xe){se(e(Y(q(Xe))))}},[r,t,e,I]),D=v.filter(R=>w.has(te(R.address))),$=v.filter(R=>!w.has(te(R.address)));return(0,f.jsxs)("section",{className:"art-root","data-dsh-artifact-studio":"",children:[(0,f.jsxs)("header",{className:"art-header",children:[(0,f.jsxs)("div",{className:"art-heading",children:[x==="design"?(0,f.jsx)(B.Tooltip,{label:e("panel"),side:"bottom",portal:!0,children:(0,f.jsx)(B.Button,{size:"sm",className:"art-icon-button","aria-label":e("panel"),onClick:()=>b("list"),children:(0,f.jsx)(B.IconChevronLeftOutlineRegular,{size:16})})}):null,(0,f.jsx)("span",{className:"art-title",children:e(x==="design"?"design.title":"panel")})]}),x==="list"?o?(0,f.jsx)("span",{className:"art-scope-fixed",title:j?.title??e("scope.workspace"),children:j?.title??e("scope.workspace")}):(0,f.jsxs)("label",{className:"art-workspace",children:[(0,f.jsx)("span",{className:"art-workspace-label",children:e("scope.label")}),(0,f.jsxs)("select",{className:"art-workspace-select","aria-label":e("scope.label"),value:ua(a),onChange:R=>{let X=qa(R.target.value);X!==void 0&&n?.(X)},children:[(0,f.jsx)("option",{value:"all",children:e("scope.all")}),t.map(R=>(0,f.jsx)("option",{value:"ws:"+R.workspaceId,children:R.title},R.workspaceId)),(0,f.jsx)("option",{value:"library",children:e("scope.library")})]})]}):null,x==="list"?(0,f.jsxs)("div",{className:"art-actions",children:[(0,f.jsx)(B.Tooltip,{label:e("gallery.design"),side:"bottom",portal:!0,children:(0,f.jsx)(B.Button,{size:"sm",className:"art-icon-button","aria-label":e("gallery.design"),onClick:()=>b("design"),children:(0,f.jsx)(zr,{size:16})})}),(0,f.jsx)(B.Tooltip,{label:e("gallery.refresh"),side:"bottom",portal:!0,children:(0,f.jsx)(B.Button,{size:"sm",className:"art-icon-button","aria-label":e("gallery.refresh"),onClick:()=>g(R=>R+1),children:(0,f.jsx)(B.IconRefreshOutlineRegular,{size:16})})}),(0,f.jsx)(B.Menu,{open:p,onClose:()=>u(!1),align:"end",portal:!0,autoFocus:!0,items:[{id:"page",label:e("gallery.newPage")+" \xB7 "+F,icon:(0,f.jsx)(ke,{size:14})},{id:"doc",label:e("gallery.newDoc")+" \xB7 "+F,icon:(0,f.jsx)(Pe,{size:14})},{id:"sheet",label:e("gallery.newSheet")+" \xB7 "+F,icon:(0,f.jsx)($e,{size:14})},{id:"design",label:e("gallery.newDesign")+" \xB7 "+F,icon:(0,f.jsx)(Ke,{size:14})}],onSelect:R=>{u(!1),Q(R==="doc"?"doc":R==="design"?"design":R==="sheet"?"sheet":"page",W)},anchor:(0,f.jsx)(B.Button,{size:"sm",variant:"outline",icon:(0,f.jsx)(B.IconPlusOutlineRegular,{size:14}),"aria-haspopup":"menu","aria-expanded":p,onClick:()=>u(R=>!R),children:e("gallery.create")})})]}):null]}),x==="design"?(0,f.jsx)("div",{className:"art-scroll",children:(0,f.jsx)(vn,{t:e,workspaceId:z,workspaceTitle:H?.title})}):(0,f.jsx)("div",{className:"art-scroll",children:(0,f.jsxs)("div",{className:"art-gallery",children:[(0,f.jsxs)("div",{className:"art-toolbar",children:[(0,f.jsx)("input",{className:"art-search",type:"search","aria-label":e("gallery.searchLabel"),placeholder:e("gallery.search"),value:s,onChange:R=>d(R.target.value)}),(0,f.jsx)(B.SegmentedControl,{id:A,className:"art-segment",label:e("filter.type"),value:l??"all",options:[{value:"all",label:e("type.all")},{value:"page",label:e("type.page")},{value:"doc",label:e("type.doc")},{value:"sheet",label:e("type.sheet")},{value:"design",label:e("type.design")}],onChange:R=>h(R==="all"?void 0:R)})]}),(0,f.jsxs)("div",{role:"tabpanel",id:A+"-"+(l??"all")+"-panel","aria-labelledby":A+"-"+(l??"all"),children:[L.status==="loading"?(0,f.jsx)("p",{className:"art-note",children:e("empty.loading")}):null,L.status==="failed"?(0,f.jsxs)("div",{className:"art-empty",role:"alert",children:[(0,f.jsx)("p",{className:"art-empty-title",children:e(Y(L.code))}),(0,f.jsx)(B.Button,{size:"sm",variant:"outline",onClick:()=>g(R=>R+1),children:e("action.retry")})]}):null,L.status==="ready"&&L.failed>0?(0,f.jsxs)("div",{className:"art-bar","data-tone":"warn",role:"status",children:[(0,f.jsx)("span",{children:e("gallery.failedProjects")}),(0,f.jsx)(B.Button,{size:"sm",variant:"outline",onClick:()=>g(R=>R+1),children:e("action.retry")})]}):null,L.status==="ready"&&L.items.length===0&&L.failed===0?s!==""?(0,f.jsx)("p",{className:"art-note",children:e("empty.noMatch")}):l!==void 0?(0,f.jsx)("p",{className:"art-note",children:e("empty.typeMatch",{type:e(`type.${l}`)})}):(0,f.jsx)(rs,{t:e,variant:a.kind}):null,L.status==="ready"&&L.items.length>0?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Ln,{t:e,heading:e("gallery.pinned"),views:D,pinned:w,onOpen:I,showProject:a.kind==="all"}),$.length===0?(0,f.jsx)("p",{className:"art-note",children:e("gallery.allPinned")}):(0,f.jsx)(Ln,{t:e,heading:e("gallery.recent"),views:$,pinned:w,onOpen:I,showProject:a.kind==="all"}),L.hasMore?(0,f.jsx)("div",{className:"art-gallery-more",children:(0,f.jsx)(B.Button,{size:"sm",variant:"outline",onClick:T.more,children:e("gallery.more")})}):null,L.truncated?(0,f.jsx)("p",{className:"art-note",children:e("gallery.truncated")}):null]}):null]})]})})]})}var de=require("react/jsx-runtime"),jn="dsh-artifact-studio.panel.scope",Fn="dsh-artifact-studio.panel.workspace";function _n({t:e,workspaces:t}){let a=(0,ee.useCallback)(g=>t.subscribe(g),[t]),r=(0,ee.useCallback)(()=>t.getSnapshot(),[t]),o=(0,ee.useSyncExternalStore)(a,r,r).items,i=(0,ee.useMemo)(()=>o.map(({workspaceId:g,title:P})=>({workspaceId:g,title:P})),[o]),[s,d]=(0,ee.useState)(()=>qa(window.localStorage.getItem(jn))??{kind:"all"}),[l,h]=(0,ee.useState)(()=>{let g=window.localStorage.getItem(Fn);return g===null||g===""?null:g}),[x,b]=(0,ee.useState)(null),p=s.kind==="workspace"?o.find(g=>g.workspaceId===s.workspaceId):void 0,u=p!==void 0?p.workspaceId:l!==null&&o.some(g=>g.workspaceId===l)?l:o[0]?.workspaceId??null;(0,ee.useEffect)(()=>{if(o.length!==0){if(s.kind==="workspace"&&!o.some(g=>g.workspaceId===s.workspaceId)){d({kind:"all"});return}u!==null&&u!==l&&h(u)}},[o,s,u,l]),(0,ee.useEffect)(()=>{window.localStorage.setItem(jn,ua(s))},[s]),(0,ee.useEffect)(()=>{l!==null&&window.localStorage.setItem(Fn,l)},[l]);let y=(0,ee.useMemo)(()=>x===null?void 0:Ie(x),[x]);return(0,de.jsxs)("div",{className:"art-panel-stack",children:[(0,de.jsx)("div",{className:"art-panel-region",hidden:y!==void 0,children:(0,de.jsx)(Ya,{t:e,projects:i,scope:s,contextWorkspaceId:u,onScopeChange:d,open:g=>b(g)})}),y===void 0?null:(0,de.jsx)("div",{className:"art-panel-region",children:(0,de.jsx)(Ha,{t:e,address:y,workspaceName:o.find(g=>y.scope==="workspace"&&g.workspaceId===y.workspaceId)?.title,onBack:()=>b(null)})})]})}function Hn({t:e,sessionId:t,useSessions:a,useWorkspaces:r,inputActions:n}){let i=na({sessionId:t,useSessions:a,useWorkspaces:r}).workspaceId,s=r(b=>b.items.find(p=>p.workspaceId===i)?.title),[d,l]=(0,ee.useState)(null);(0,ee.useEffect)(()=>{l(null)},[i]);let h=(0,ee.useMemo)(()=>i===null?[]:[{workspaceId:i,title:s??i}],[i,s]),x=(0,ee.useMemo)(()=>d===null?void 0:Ie(d),[d]);return i===null?(0,de.jsx)("section",{className:"art-root","data-dsh-artifact-studio":"",children:(0,de.jsx)("div",{className:"art-center",role:"status",children:(0,de.jsx)("p",{className:"art-center-hint",children:e("empty.noWorkspace")})})}):(0,de.jsxs)("div",{className:"art-panel-stack",children:[(0,de.jsx)("div",{className:"art-panel-region",hidden:x!==void 0,children:(0,de.jsx)(Ya,{t:e,projects:h,scope:{kind:"workspace",workspaceId:i},contextWorkspaceId:i,scopeLocked:!0,open:b=>l(b)})}),x===void 0?null:(0,de.jsx)("div",{className:"art-panel-region",children:(0,de.jsx)(Ha,{t:e,address:x,workspaceName:s,onBack:()=>l(null),...n===void 0?{}:{inputActions:n}})})]})}var Bn="dsh-artifact-studio/styles",ns=Jr.split(`
|
|
107
|
+
`;function ds(e){return e.replace(/[&<>"']/g,t=>`&#${t.charCodeAt(0)};`)}function ps(e){return e.replace(/[\\`*_\[\]#]/g,t=>`\\${t}`)}function us(e){return e.replace(/[{}<>]/g," ")}function Yn(e,t){return e==="doc"?ss.replace("{{title}}",ps(t)):e==="design"?cs.replace("{{title}}",us(t)):e==="sheet"?ls(t):is.replace("{{title}}",ds(t))}var m=require("react/jsx-runtime");function ma(e){return e.kind==="workspace"?"ws:"+e.workspaceId:e.kind}function Za(e){if(e==="all")return{kind:"all"};if(e==="library")return{kind:"library"};if(e==null||!e.startsWith("ws:"))return;let t=e.slice(3);return t===""?void 0:{kind:"workspace",workspaceId:t}}function Jn(e,t,a){return e.scope==="library"?{manifest:e,address:{scope:"library",id:e.id},where:{scope:"library",workspaceId:t},project:null}:a===null?null:{manifest:e,address:{scope:"workspace",workspaceId:a.workspaceId,id:e.id},where:{scope:"workspace",workspaceId:a.workspaceId},project:a.title}}function fs(e,t){e!==void 0&&(Me(t.manifest.id,t.manifest.title),e(te(t.address)))}function Zn(e){let t=te(e.address);return e.manifest.scope==="library"?t+"@"+(e.where.workspaceId??""):t}var It=new Map,Qa=new Map,ms=2,fa=new Map,Rt=[],Ja=0;function Xn(){for(;Ja<ms&&Rt.length>0;){let e=Rt.shift();if(e===void 0)return;Ja+=1,e.start()}}function gs(e){let t={start:()=>{e().finally(()=>{Ja-=1,Xn()})}};return Rt.push(t),Xn(),()=>{let a=Rt.indexOf(t);a!==-1&&Rt.splice(a,1)}}function hs(e){let t=Zn(e),a=It.get(t);if(a!==void 0&&a.version>=e.manifest.version)return Promise.resolve(a);let r=t+":"+e.manifest.version,n=Qa.get(r);if(n!==void 0)return n;let o=B.get(e.where,e.manifest.id).then(l=>{let s={version:l.version,content:l.content,designCss:l.designCss},c=It.get(t);return(c===void 0||c.version<=s.version)&&(It.size>=60&&It.clear(),It.set(t,s)),s}).finally(()=>{Qa.delete(r)});return Qa.set(r,o),o}function vs(e){if(typeof DOMParser>"u")return e.replace(/<script\b[^>]*>[\s\S]*?<\/script\s*>/gi,"").replace(/<script\b[^>]*\/?>/gi,"").replace(/\son[a-z]+\s*=\s*"[^"]*"/gi,"");let t=new DOMParser().parseFromString(e,"text/html");for(let a of t.querySelectorAll("script, iframe, object, embed, base"))a.remove();for(let a of t.querySelectorAll("*"))for(let r of[...a.attributes]){let n=r.name.toLowerCase();(n.startsWith("on")||n==="srcdoc")&&a.removeAttribute(r.name)}return"<!doctype html>"+t.documentElement.outerHTML}function bs(e){let t=e.replace(/\x60{3}[\s\S]*?\x60{3}/g," ").replace(/!\[[^\]]*\]\([^)]*\)/g," ").replace(/\[([^\]]+)\]\([^)]*\)/g,"$1").replace(/<[^>]+>/g," ").replace(/[#>*_\x60~]/g," ").replace(/\s+/g," ").trim();return t.length>220?t.slice(0,220).trimEnd()+"...":t}function ys(e){try{let a=Wn(e).sheets[0];if(a===void 0)return null;let r=Gn(a),n=Math.min(5,Math.max(1,r.rows)),o=Math.min(4,Math.max(1,r.columns)),l=[];for(let s=1;s<=n;s+=1){let c=[];for(let i=0;i<o;i+=1){let g=a.cells[pa(s,i)];g===void 0?c.push(""):g.formula!==void 0?c.push(g.formula):g.value===void 0?c.push(""):c.push(String(g.value))}l.push(c)}return{name:a.name,rows:l}}catch{return null}}function ws({t:e,view:t}){let[a,r]=(0,$.useState)(null),[n,o]=(0,$.useState)(!1),[l,s]=(0,$.useState)(typeof IntersectionObserver>"u"),[c,i]=(0,$.useState)(null),[g,k]=(0,$.useState)(null),b=(0,$.useRef)(null),p=lt(),u=Zn(t),y=t.manifest.title,v=t.manifest.type,D=t.manifest.version;(0,$.useEffect)(()=>{if(l)return;let E=b.current;if(E===null)return;let j=new IntersectionObserver(z=>{z.some(W=>W.isIntersecting)&&(s(!0),j.disconnect())},{rootMargin:"140px"});return j.observe(E),()=>j.disconnect()},[l]),(0,$.useEffect)(()=>{if(!l||v!=="design")return;let E=u+"@"+D,j=fa.get(E);if(j!==void 0){k(j),o(!1);return}let z=new AbortController,W=!1,U=gs(async()=>{try{let H=await B.preview(t.where,t.manifest.id,D,z.signal);if(W)return;let P="data:"+H.mediaType+";base64,"+H.data;fa.size>=40&&fa.clear(),fa.set(E,P),k(P),o(!1)}catch{W||o(!0)}});return()=>{W=!0,z.abort(),U()}},[l,u,D,v]),(0,$.useEffect)(()=>{if(!l||v==="design")return;let E=!1;return hs(t).then(j=>{!E&&j.version===D&&(r(j),o(!1))}).catch(()=>{E||o(!0)}),()=>{E=!0}},[l,u,D]),(0,$.useEffect)(()=>{if(v!=="page"||a===null){i(null);return}let E=URL.createObjectURL(new Blob([vs(ta(a.content,a.designCss,y,p?"dark":"light"))],{type:"text/html"}));return i(E),()=>URL.revokeObjectURL(E)},[a,v,y,p]);let T=v==="page"?(0,m.jsx)(ze,{}):v==="doc"?(0,m.jsx)(Oe,{}):v==="sheet"?(0,m.jsx)(qe,{}):(0,m.jsx)(Ye,{});if(n)return(0,m.jsx)("span",{className:"art-cover",ref:b,"aria-hidden":"true",children:(0,m.jsx)("span",{className:"art-cover-fallback",children:T})});if(v==="design")return(0,m.jsx)("span",{className:"art-cover",ref:b,"aria-hidden":"true",children:g===null?(0,m.jsx)("span",{className:"art-cover-fallback",children:T}):(0,m.jsx)("img",{className:"art-cover-design",src:g,alt:""})});if(v==="page")return(0,m.jsx)("span",{className:"art-cover",ref:b,"aria-hidden":"true",children:c===null?(0,m.jsx)("span",{className:"art-cover-fallback",children:T}):(0,m.jsx)("span",{className:"art-cover-frame-wrap",children:(0,m.jsx)("iframe",{className:"art-cover-frame",src:c,sandbox:"",title:e("gallery.coverTitle",{title:y}),tabIndex:-1,loading:"lazy",referrerPolicy:"no-referrer"})})});if(v==="sheet"){let E=a===null?null:ys(a.content);return(0,m.jsx)("span",{className:"art-cover",ref:b,"aria-hidden":"true",children:E===null?(0,m.jsx)("span",{className:"art-cover-fallback",children:T}):(0,m.jsxs)("span",{className:"art-cover-sheet",children:[(0,m.jsx)("span",{className:"art-cover-sheet-name",children:E.name}),(0,m.jsx)("span",{className:"art-cover-sheet-table",children:E.rows.map((j,z)=>(0,m.jsxs)("span",{className:"art-cover-sheet-row",children:[(0,m.jsx)("span",{className:"art-cover-sheet-index",children:z+1}),j.map((W,U)=>(0,m.jsx)("span",{className:"art-cover-sheet-cell",children:W},U))]},z))})]})})}let N=a===null?"":bs(a.content);return(0,m.jsx)("span",{className:"art-cover",ref:b,"aria-hidden":"true",children:N===""?(0,m.jsx)("span",{className:"art-cover-fallback",children:T}):(0,m.jsxs)("span",{className:"art-cover-doc",children:[(0,m.jsx)("span",{className:"art-cover-doc-title",children:y}),(0,m.jsx)("span",{className:"art-cover-doc-text",children:N})]})})}function xs({t:e,view:t,pinned:a,onOpen:r,showProject:n}){let o=te(t.address),l=e(a?"gallery.unpin":"gallery.pin",{title:t.manifest.title}),s=t.manifest.scope==="library"?" \xB7 "+e("scope.library"):n&&t.project!==null?" \xB7 "+t.project:"";return(0,m.jsxs)("li",{className:"art-tile",children:[(0,m.jsxs)("button",{type:"button",className:"art-tile-open",onClick:()=>r(t),children:[(0,m.jsx)(ws,{t:e,view:t}),(0,m.jsxs)("span",{className:"art-tile-body",children:[(0,m.jsx)("span",{className:"art-tile-title",title:t.manifest.title,children:t.manifest.title}),(0,m.jsxs)("span",{className:"art-tile-sub",children:[e(`type.${t.manifest.type}`)," \xB7 ",e("gallery.updated",{time:aa(e,t.manifest.updatedAt)})," \xB7 ",e("gallery.version",{version:t.manifest.version}),s]})]})]}),(0,m.jsx)(O.Tooltip,{label:l,side:"left",portal:!0,children:(0,m.jsx)(O.Button,{size:"sm",className:"art-tile-pin","aria-label":l,"aria-pressed":a,onClick:()=>qn(o),children:a?(0,m.jsx)(O.IconPinFillRegular,{size:14}):(0,m.jsx)(O.IconPinOutlineRegular,{size:14})})})]})}function Qn({t:e,heading:t,views:a,pinned:r,onOpen:n,showProject:o}){let l=(0,$.useId)();return a.length===0?null:(0,m.jsxs)("section",{className:"art-section","aria-labelledby":l,children:[(0,m.jsxs)("div",{className:"art-section-head",children:[(0,m.jsx)("h2",{className:"art-section-title",id:l,children:t}),(0,m.jsx)("span",{className:"art-section-hint",children:e("gallery.count",{count:a.length})})]}),(0,m.jsx)("ul",{className:"art-grid",children:a.map(s=>(0,m.jsx)(xs,{t:e,view:s,pinned:r.has(te(s.address)),onOpen:n,showProject:o},te(s.address)))})]})}function ks(e,t,a){let r={where:{scope:"library",workspaceId:a},project:null};if(e.kind==="library")return[r];if(e.kind==="workspace"){let n=t.find(o=>o.workspaceId===e.workspaceId);return n===void 0?[]:[{where:{scope:"workspace",workspaceId:n.workspaceId},project:n}]}return[...t.map(n=>({where:{scope:"workspace",workspaceId:n.workspaceId},project:n})),r]}var Ss=12;function Ts(e,t,a,r,n,o){let[l,s]=(0,$.useState)(1),[c,i]=(0,$.useState)({key:"",state:{status:"loading"}}),g=t.map(u=>u.workspaceId+":"+u.title).join(","),k=ma(e)+":"+g+":"+(a??"")+":"+r+":"+(n??""),b=e.kind==="all",p=c.key===k?c.state:{status:"loading"};return(0,$.useEffect)(()=>s(1),[k,r]),(0,$.useEffect)(()=>{let u=ks(e,t,a);if(u.length===0){i({key:k,state:{status:"ready",items:[],hasMore:!1,truncated:!1,failed:0}});return}let y=new AbortController,v=setTimeout(async()=>{let D=b?Ss:void 0,T=await Promise.all(u.map(async U=>{let H=[];for(let P=0;P<l;P+=1)try{let x=await B.list(U.where,{query:r,type:n,offset:P*(D??50),...D===void 0?{}:{limit:D}},y.signal);if(H.push(x),!x.hasMore)break}catch(x){return{loaded:H,failed:!0,code:Y(x)}}return{loaded:H,failed:!1}}));if(y.signal.aborted)return;let N=[],E=!1,j=!1,z=0,W;if(T.forEach((U,H)=>{let P=u[H];if(P===void 0)return;U.failed&&(z+=1,W===void 0&&(W=U.code));let x=U.loaded[U.loaded.length-1];if(x!==void 0){x.hasMore&&(E=!0),x.truncated&&(j=!0);for(let A of U.loaded)for(let Q of A.items){let L=Jn(Q,a,P.project);L!==null&&N.push(L)}}}),z===u.length){i({key:k,state:{status:"failed",code:W}});return}N.sort((U,H)=>Date.parse(H.manifest.updatedAt)-Date.parse(U.manifest.updatedAt)),i({key:k,state:{status:"ready",items:N,hasMore:E,truncated:j,failed:z}})},r===""?0:180);return()=>{y.abort(),clearTimeout(v)}},[k,o,l]),{state:p,more:()=>s(u=>u+1)}}function Cs({t:e,variant:t}){let a=t==="all"?"empty.allTitle":t==="library"?"empty.libraryTitle":"empty.workspaceTitle",r=t==="all"?"empty.allHint":t==="library"?"empty.libraryHint":"empty.workspaceHint",n=async o=>{try{await navigator.clipboard.writeText(o),ae(e("gallery.promptCopied"))}catch{ae(e("action.copyFailed"))}};return(0,m.jsxs)("div",{className:"art-empty",children:[(0,m.jsx)("p",{className:"art-empty-title",children:e(a)}),(0,m.jsx)("p",{className:"art-empty-hint",children:e(r)}),(0,m.jsx)("ul",{className:"art-starters",children:Ya.map(o=>(0,m.jsxs)("li",{className:"art-starter",children:[(0,m.jsxs)("span",{className:"art-starter-text",children:[(0,m.jsx)("span",{className:"art-starter-name",children:e(`prompt.${o}`)}),(0,m.jsx)("span",{className:"art-starter-hint",children:e(`prompt.${o}Text`)})]}),(0,m.jsx)(O.Tooltip,{label:e("gallery.copyPrompt"),side:"left",portal:!0,children:(0,m.jsx)(O.Button,{size:"sm",className:"art-icon-button","aria-label":e("gallery.copyPromptNamed",{name:e(`prompt.${o}`)}),onClick:()=>void n(e(`prompt.${o}Text`)),children:(0,m.jsx)(O.IconCopyOutlineRegular,{size:14})})})]},o))})]})}function er({t:e,projects:t,scope:a,contextWorkspaceId:r,onScopeChange:n,scopeLocked:o=!1,open:l}){let[s,c]=(0,$.useState)(""),[i,g]=(0,$.useState)(void 0),[k,b]=(0,$.useState)("list"),[p,u]=(0,$.useState)(!1),[y,v]=(0,$.useState)(0),D=Yt()+y,T=Kn(),N=Ts(a,t,r,s,i,D),E=(0,$.useId)(),j=t.find(I=>I.workspaceId===r)??null,z=a.kind==="library"?null:r,W=z===null?null:t.find(I=>I.workspaceId===z)??null,U=a.kind==="library"||j===null?"library":"workspace",H=U==="library"?e("scope.library"):j?.title??e("scope.library"),P=N.state,x=P.status==="ready"?P.items:[],A=(0,$.useCallback)(I=>fs(l,I),[l]),Q=(0,$.useCallback)(async(I,J)=>{if(J==="workspace"&&r===null)return;let Ze=e(I==="page"?"create.untitledPage":I==="doc"?"create.untitledDoc":I==="sheet"?"create.untitledSheet":"create.untitledDesign");try{let{manifest:et}=await B.create({scope:J,workspaceId:r},I,Ze,Yn(I,Ze));Ne();let ha=J==="workspace"?t.find(va=>va.workspaceId===r)??null:null,At=Jn(et,r,ha);At!==null&&A(At)}catch(et){ae(e(X(Y(et))))}},[r,t,e,A]),L=x.filter(I=>T.has(te(I.address))),q=x.filter(I=>!T.has(te(I.address)));return(0,m.jsxs)("section",{className:"art-root","data-dsh-artifact-studio":"",children:[(0,m.jsxs)("header",{className:"art-header",children:[(0,m.jsxs)("div",{className:"art-heading",children:[k==="design"?(0,m.jsx)(O.Tooltip,{label:e("panel"),side:"bottom",portal:!0,children:(0,m.jsx)(O.Button,{size:"sm",className:"art-icon-button","aria-label":e("panel"),onClick:()=>b("list"),children:(0,m.jsx)(O.IconChevronLeftOutlineRegular,{size:16})})}):null,(0,m.jsx)("span",{className:"art-title",children:e(k==="design"?"design.title":"panel")})]}),k==="list"?o?(0,m.jsx)("span",{className:"art-scope-fixed",title:j?.title??e("scope.workspace"),children:j?.title??e("scope.workspace")}):(0,m.jsxs)("label",{className:"art-workspace",children:[(0,m.jsx)("span",{className:"art-workspace-label",children:e("scope.label")}),(0,m.jsxs)("select",{className:"art-select art-workspace-select","aria-label":e("scope.label"),value:ma(a),onChange:I=>{let J=Za(I.target.value);J!==void 0&&n?.(J)},children:[(0,m.jsx)("option",{value:"all",children:e("scope.all")}),t.map(I=>(0,m.jsx)("option",{value:"ws:"+I.workspaceId,children:I.title},I.workspaceId)),(0,m.jsx)("option",{value:"library",children:e("scope.library")})]})]}):null,k==="list"?(0,m.jsxs)("div",{className:"art-actions",children:[(0,m.jsx)(O.Tooltip,{label:e("gallery.design"),side:"bottom",portal:!0,children:(0,m.jsx)(O.Button,{size:"sm",className:"art-icon-button","aria-label":e("gallery.design"),onClick:()=>b("design"),children:(0,m.jsx)(Er,{size:16})})}),(0,m.jsx)(O.Tooltip,{label:e("gallery.refresh"),side:"bottom",portal:!0,children:(0,m.jsx)(O.Button,{size:"sm",className:"art-icon-button","aria-label":e("gallery.refresh"),onClick:()=>v(I=>I+1),children:(0,m.jsx)(O.IconRefreshOutlineRegular,{size:16})})}),(0,m.jsx)(O.Menu,{open:p,onClose:()=>u(!1),align:"end",portal:!0,autoFocus:!0,items:[{id:"page",label:e("gallery.newPage")+" \xB7 "+H,icon:(0,m.jsx)(ze,{size:14})},{id:"doc",label:e("gallery.newDoc")+" \xB7 "+H,icon:(0,m.jsx)(Oe,{size:14})},{id:"sheet",label:e("gallery.newSheet")+" \xB7 "+H,icon:(0,m.jsx)(qe,{size:14})},{id:"design",label:e("gallery.newDesign")+" \xB7 "+H,icon:(0,m.jsx)(Ye,{size:14})}],onSelect:I=>{u(!1),Q(I==="doc"?"doc":I==="design"?"design":I==="sheet"?"sheet":"page",U)},anchor:(0,m.jsx)(O.Button,{size:"sm",variant:"outline",icon:(0,m.jsx)(O.IconPlusOutlineRegular,{size:14}),"aria-haspopup":"menu","aria-expanded":p,onClick:()=>u(I=>!I),children:e("gallery.create")})})]}):null]}),k==="design"?(0,m.jsx)("div",{className:"art-scroll",children:(0,m.jsx)(On,{t:e,workspaceId:z,workspaceTitle:W?.title})}):(0,m.jsx)("div",{className:"art-scroll",children:(0,m.jsxs)("div",{className:"art-gallery",children:[(0,m.jsxs)("div",{className:"art-toolbar",children:[(0,m.jsx)(O.Input,{icon:(0,m.jsx)(O.IconSearchOutlineRegular,{size:16}),className:"art-search",type:"search","aria-label":e("gallery.searchLabel"),placeholder:e("gallery.search"),value:s,onChange:I=>c(I.target.value)}),(0,m.jsx)(O.SegmentedControl,{id:E,className:"art-segment",label:e("filter.type"),value:i??"all",options:[{value:"all",label:e("type.all")},{value:"page",label:e("type.page")},{value:"doc",label:e("type.doc")},{value:"sheet",label:e("type.sheet")},{value:"design",label:e("type.design")}],onChange:I=>g(I==="all"?void 0:I)})]}),(0,m.jsxs)("div",{role:"tabpanel",id:E+"-"+(i??"all")+"-panel","aria-labelledby":E+"-"+(i??"all"),children:[P.status==="loading"?(0,m.jsx)("div",{className:"art-state",role:"status",children:(0,m.jsx)(O.TextShimmer,{active:!0,children:e("empty.loading")})}):null,P.status==="failed"?(0,m.jsxs)("div",{className:"art-state",role:"alert",children:[(0,m.jsx)("p",{className:"art-empty-title",children:e(X(P.code))}),(0,m.jsx)(O.Button,{size:"sm",variant:"outline",onClick:()=>v(I=>I+1),children:e("action.retry")})]}):null,P.status==="ready"&&P.failed>0?(0,m.jsxs)("div",{className:"art-bar","data-tone":"warn",role:"status",children:[(0,m.jsx)("span",{children:e("gallery.failedProjects")}),(0,m.jsx)(O.Button,{size:"sm",variant:"outline",onClick:()=>v(I=>I+1),children:e("action.retry")})]}):null,P.status==="ready"&&P.items.length===0&&P.failed===0?s!==""?(0,m.jsx)("p",{className:"art-note",children:e("empty.noMatch")}):i!==void 0?(0,m.jsx)("p",{className:"art-note",children:e("empty.typeMatch",{type:e(`type.${i}`)})}):(0,m.jsx)(Cs,{t:e,variant:a.kind}):null,P.status==="ready"&&P.items.length>0?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(Qn,{t:e,heading:e("gallery.pinned"),views:L,pinned:T,onOpen:A,showProject:a.kind==="all"}),q.length===0?(0,m.jsx)("p",{className:"art-note",children:e("gallery.allPinned")}):(0,m.jsx)(Qn,{t:e,heading:e("gallery.recent"),views:q,pinned:T,onOpen:A,showProject:a.kind==="all"}),P.hasMore?(0,m.jsx)("div",{className:"art-gallery-more",children:(0,m.jsx)(O.Button,{size:"sm",variant:"outline",onClick:N.more,children:e("gallery.more")})}):null,P.truncated?(0,m.jsx)("p",{className:"art-note",children:e("gallery.truncated")}):null]}):null]})]})})]})}var Ce=require("react/jsx-runtime"),eo="dsh-artifact-studio.panel.scope",to="dsh-artifact-studio.panel.workspace";function ao({t:e,workspaces:t}){let a=(0,ie.useCallback)(v=>t.subscribe(v),[t]),r=(0,ie.useCallback)(()=>t.getSnapshot(),[t]),o=(0,ie.useSyncExternalStore)(a,r,r).items,l=(0,ie.useMemo)(()=>o.map(({workspaceId:v,title:D})=>({workspaceId:v,title:D})),[o]),[s,c]=(0,ie.useState)(()=>Za(window.localStorage.getItem(eo))??{kind:"all"}),[i,g]=(0,ie.useState)(()=>{let v=window.localStorage.getItem(to);return v===null||v===""?null:v}),[k,b]=(0,ie.useState)(null),p=s.kind==="workspace"?o.find(v=>v.workspaceId===s.workspaceId):void 0,u=p!==void 0?p.workspaceId:i!==null&&o.some(v=>v.workspaceId===i)?i:o[0]?.workspaceId??null;(0,ie.useEffect)(()=>{if(o.length!==0){if(s.kind==="workspace"&&!o.some(v=>v.workspaceId===s.workspaceId)){c({kind:"all"});return}u!==null&&u!==i&&g(u)}},[o,s,u,i]),(0,ie.useEffect)(()=>{window.localStorage.setItem(eo,ma(s))},[s]),(0,ie.useEffect)(()=>{i!==null&&window.localStorage.setItem(to,i)},[i]);let y=(0,ie.useMemo)(()=>k===null?void 0:He(k),[k]);return(0,Ce.jsxs)("div",{className:"art-panel-stack",children:[(0,Ce.jsx)("div",{className:"art-panel-region",hidden:y!==void 0,children:(0,Ce.jsx)(er,{t:e,projects:l,scope:s,contextWorkspaceId:u,onScopeChange:c,open:v=>b(v)})}),y===void 0?null:(0,Ce.jsx)("div",{className:"art-panel-region",children:(0,Ce.jsx)(Rn,{t:e,address:y,workspaceName:o.find(v=>y.scope==="workspace"&&v.workspaceId===y.workspaceId)?.title,onBack:()=>b(null)})})]})}function ro({t:e,sessionId:t,useSessions:a,useWorkspaces:r}){let o=sa({sessionId:t,useSessions:a,useWorkspaces:r}).workspaceId,l=r(i=>i.items.find(g=>g.workspaceId===o)?.title),s=(0,ie.useCallback)(i=>{Te.sidebarRight?.openResource(i)},[]),c=(0,ie.useMemo)(()=>o===null?[]:[{workspaceId:o,title:l??o}],[o,l]);return o===null?(0,Ce.jsx)("section",{className:"art-root","data-dsh-artifact-studio":"",children:(0,Ce.jsx)("div",{className:"art-center",role:"status",children:(0,Ce.jsx)("p",{className:"art-center-hint",children:e("empty.noWorkspace")})})}):(0,Ce.jsx)(er,{t:e,projects:c,scope:{kind:"workspace",workspaceId:o},contextWorkspaceId:o,scopeLocked:!0,open:s})}var no="dsh-artifact-studio/styles",Ns=mn.split(`
|
|
108
108
|
`).map(e=>{let t=e.indexOf("{"),a=e.slice(0,t).split(",").map(n=>n.trim()).filter(n=>n!=="body"&&n!==".art-docpage");return(a.length===0?".art-docpage":a.map(n=>".art-docpage .art-prose "+n).join(", "))+" "+e.slice(t)}).join(`
|
|
109
|
-
`),
|
|
109
|
+
`),zs=`
|
|
110
|
+
body {
|
|
111
|
+
--art-space-2: 2px;
|
|
112
|
+
--art-space-4: 4px;
|
|
113
|
+
--art-space-6: 6px;
|
|
114
|
+
--art-space-8: 8px;
|
|
115
|
+
--art-space-12: 12px;
|
|
116
|
+
--art-space-16: 16px;
|
|
117
|
+
--art-space-24: 24px;
|
|
118
|
+
--art-control-inline: 20px;
|
|
119
|
+
--art-control-sm: 28px;
|
|
120
|
+
--art-control-md: 36px;
|
|
121
|
+
}
|
|
110
122
|
.art-root {
|
|
123
|
+
position: relative;
|
|
124
|
+
container-type: inline-size;
|
|
111
125
|
box-sizing: border-box;
|
|
112
126
|
display: flex;
|
|
113
127
|
flex-direction: column;
|
|
@@ -116,13 +130,12 @@ Start writing, or select text and choose Edit with agent.
|
|
|
116
130
|
min-width: 0;
|
|
117
131
|
color: var(--dsw-alias-label-primary);
|
|
118
132
|
background: var(--dsw-alias-bg-base);
|
|
119
|
-
font
|
|
120
|
-
line-height: 1.5;
|
|
133
|
+
font: var(--dsw-font-xs-13);
|
|
121
134
|
}
|
|
122
135
|
.art-root *, .art-root *::before, .art-root *::after, .art-card * { box-sizing: border-box; }
|
|
123
|
-
.art-root ::selection { background: color-mix(in srgb, var(--dsw-alias-
|
|
136
|
+
.art-root ::selection { background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 28%, transparent); }
|
|
124
137
|
.art-root :focus-visible, .art-card :focus-visible, .art-composer:focus-visible {
|
|
125
|
-
outline:
|
|
138
|
+
outline: var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary));
|
|
126
139
|
outline-offset: 1px;
|
|
127
140
|
}
|
|
128
141
|
.art-header {
|
|
@@ -130,105 +143,76 @@ Start writing, or select text and choose Edit with agent.
|
|
|
130
143
|
display: flex;
|
|
131
144
|
align-items: center;
|
|
132
145
|
flex-wrap: wrap;
|
|
133
|
-
gap:
|
|
146
|
+
gap: var(--art-space-12);
|
|
134
147
|
min-height: 44px;
|
|
135
|
-
padding:
|
|
148
|
+
padding: var(--art-space-8) var(--art-space-12);
|
|
136
149
|
border-bottom: .5px solid var(--dsw-alias-border-l2);
|
|
137
150
|
}
|
|
138
|
-
.art-heading { flex: 1 1 auto; min-width: 0; overflow: hidden; display: flex; align-items: center; gap:
|
|
151
|
+
.art-heading { flex: 1 1 auto; min-width: 0; overflow: hidden; display: flex; align-items: center; gap: var(--art-space-8); }
|
|
139
152
|
.art-title {
|
|
140
153
|
min-width: 0;
|
|
141
154
|
margin: 0;
|
|
142
155
|
overflow: hidden;
|
|
143
156
|
text-overflow: ellipsis;
|
|
144
157
|
white-space: nowrap;
|
|
145
|
-
font-size:
|
|
146
|
-
font-weight:
|
|
147
|
-
line-height:
|
|
158
|
+
font-size: var(--dsw-font-s-14-font-size);
|
|
159
|
+
font-weight: 500;
|
|
160
|
+
line-height: var(--dsw-font-s-14-line-height);
|
|
148
161
|
color: var(--dsw-alias-label-primary);
|
|
149
162
|
}
|
|
150
|
-
.art-title-input {
|
|
151
|
-
min-width: 0;
|
|
152
|
-
flex: 1;
|
|
153
|
-
height: 26px;
|
|
154
|
-
padding: 0 6px;
|
|
155
|
-
border: 1px solid var(--dsw-alias-brand-primary);
|
|
156
|
-
border-radius: 6px;
|
|
157
|
-
background: var(--dsw-alias-bg-base);
|
|
158
|
-
color: var(--dsw-alias-label-primary);
|
|
159
|
-
font: inherit;
|
|
160
|
-
font-weight: 600;
|
|
161
|
-
}
|
|
162
163
|
.art-meta {
|
|
163
164
|
display: flex;
|
|
164
165
|
align-items: baseline;
|
|
165
|
-
gap:
|
|
166
|
+
gap: var(--art-space-2);
|
|
166
167
|
min-width: 0;
|
|
167
168
|
color: var(--dsw-alias-label-secondary);
|
|
168
|
-
font-size:
|
|
169
|
-
line-height:
|
|
169
|
+
font-size: var(--dsw-font-xxxs-11-font-size);
|
|
170
|
+
line-height: var(--dsw-font-xxxs-11-line-height);
|
|
170
171
|
font-variant-numeric: tabular-nums;
|
|
171
172
|
}
|
|
172
173
|
.art-meta-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
173
174
|
.art-save-status { flex: none; white-space: nowrap; }
|
|
174
175
|
.art-save-status[data-tone="warn"] { color: var(--dsw-alias-state-warn-primary); }
|
|
175
176
|
.art-save-status[data-tone="error"] { color: var(--dsw-alias-state-error-primary); }
|
|
176
|
-
.art-actions { flex: none; display: flex; align-items: center; gap:
|
|
177
|
+
.art-actions { flex: none; display: flex; align-items: center; gap: var(--art-space-4); }
|
|
177
178
|
.art-toolbar {
|
|
178
179
|
flex: none;
|
|
179
180
|
display: flex;
|
|
180
181
|
align-items: center;
|
|
181
182
|
flex-wrap: wrap;
|
|
182
|
-
gap:
|
|
183
|
-
padding:
|
|
183
|
+
gap: var(--art-space-8);
|
|
184
|
+
padding: var(--art-space-8) 0;
|
|
184
185
|
border-bottom: .5px solid var(--dsw-alias-border-l2);
|
|
185
186
|
}
|
|
186
|
-
.art-search {
|
|
187
|
-
|
|
188
|
-
min-width: 0;
|
|
189
|
-
height: 42px;
|
|
190
|
-
padding: 0 10px;
|
|
191
|
-
border: 1px solid var(--dsw-alias-border-l1);
|
|
192
|
-
border-radius: 7px;
|
|
193
|
-
background: var(--dsw-alias-bg-base);
|
|
194
|
-
color: var(--dsw-alias-label-primary);
|
|
195
|
-
font: inherit;
|
|
196
|
-
}
|
|
197
|
-
.art-search::placeholder { color: var(--dsw-alias-label-secondary); }
|
|
198
|
-
.art-search:focus { outline: none; border-color: var(--dsw-alias-brand-primary); }
|
|
187
|
+
.art-search { flex: 1 1 140px; min-width: 140px; height: var(--art-control-md); }
|
|
188
|
+
.art-search input::placeholder { color: var(--dsw-alias-label-secondary); }
|
|
199
189
|
.art-scroll { flex: 1; min-height: 0; overflow: auto; scrollbar-gutter: stable; }
|
|
200
|
-
.art-scroll::-webkit-scrollbar, .art-drawer-body::-webkit-scrollbar { width: 10px; height: 10px; }
|
|
201
|
-
.art-scroll::-webkit-scrollbar-thumb, .art-drawer-body::-webkit-scrollbar-thumb {
|
|
202
|
-
border: 3px solid transparent;
|
|
203
|
-
border-radius: 10px;
|
|
204
|
-
background: color-mix(in srgb, var(--dsw-alias-label-secondary) 40%, transparent) padding-box;
|
|
205
|
-
}
|
|
206
190
|
.art-gallery {
|
|
207
191
|
width: 100%;
|
|
208
192
|
max-width: 860px;
|
|
209
193
|
margin-inline: auto;
|
|
210
|
-
padding: 0
|
|
194
|
+
padding: 0 var(--art-space-12) var(--art-space-24);
|
|
211
195
|
}
|
|
212
|
-
.art-section { padding:
|
|
196
|
+
.art-section { padding: var(--art-space-4) 0 var(--art-space-16); }
|
|
213
197
|
.art-section-head {
|
|
214
198
|
display: flex;
|
|
215
199
|
align-items: baseline;
|
|
216
200
|
justify-content: space-between;
|
|
217
|
-
gap:
|
|
218
|
-
padding:
|
|
201
|
+
gap: var(--art-space-8);
|
|
202
|
+
padding: var(--art-space-8) 0 var(--art-space-6);
|
|
219
203
|
}
|
|
220
|
-
.art-section-title { margin: 0; font-size:
|
|
221
|
-
.art-section-hint { font-size:
|
|
222
|
-
.art-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap:
|
|
204
|
+
.art-section-title { margin: 0; font-size: var(--dsw-font-xxs-12-font-size); font-weight: 500; color: var(--dsw-alias-label-primary); }
|
|
205
|
+
.art-section-hint { font-size: var(--dsw-font-xxxs-11-font-size); color: var(--dsw-alias-label-secondary); }
|
|
206
|
+
.art-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--art-space-8); }
|
|
223
207
|
.art-tile {
|
|
224
208
|
position: relative;
|
|
225
209
|
min-width: 0;
|
|
226
210
|
overflow: hidden;
|
|
227
211
|
border: .5px solid var(--dsw-alias-border-l1);
|
|
228
|
-
border-radius:
|
|
229
|
-
background: var(--dsw-alias-
|
|
212
|
+
border-radius: var(--dsw-radius-md);
|
|
213
|
+
background: var(--dsw-alias-card-fill);
|
|
230
214
|
}
|
|
231
|
-
.art-tile:hover { border-color: var(--dsw-alias-border-l2); background: var(--dsw-alias-
|
|
215
|
+
.art-tile:hover { border-color: var(--dsw-alias-border-l2); background: var(--dsw-alias-card-fill-hover); }
|
|
232
216
|
.art-tile-open {
|
|
233
217
|
display: block;
|
|
234
218
|
width: 100%;
|
|
@@ -241,10 +225,10 @@ Start writing, or select text and choose Edit with agent.
|
|
|
241
225
|
text-align: left;
|
|
242
226
|
cursor: pointer;
|
|
243
227
|
}
|
|
244
|
-
.art-tile-open:focus-visible { outline:
|
|
245
|
-
.art-tile-body { display: flex; flex-direction: column; gap:
|
|
246
|
-
.art-tile-title { min-width: 0; overflow-wrap: anywhere; font-size:
|
|
247
|
-
.art-tile-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size:
|
|
228
|
+
.art-tile-open:focus-visible { outline: var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary)); outline-offset: -2px; }
|
|
229
|
+
.art-tile-body { display: flex; flex-direction: column; gap: var(--art-space-2); padding: var(--art-space-8) var(--art-space-8) var(--art-space-8); }
|
|
230
|
+
.art-tile-title { min-width: 0; overflow-wrap: anywhere; font-size: var(--dsw-font-xxs-12-font-size); font-weight: 500; line-height: var(--dsw-font-xxs-12-line-height); }
|
|
231
|
+
.art-tile-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--dsw-font-xxxs-11-font-size); color: var(--dsw-alias-label-secondary); }
|
|
248
232
|
.art-tile-pin {
|
|
249
233
|
position: absolute;
|
|
250
234
|
z-index: 2;
|
|
@@ -253,11 +237,11 @@ Start writing, or select text and choose Edit with agent.
|
|
|
253
237
|
display: inline-flex;
|
|
254
238
|
align-items: center;
|
|
255
239
|
justify-content: center;
|
|
256
|
-
width:
|
|
257
|
-
height:
|
|
240
|
+
width: var(--art-control-sm);
|
|
241
|
+
height: var(--art-control-sm);
|
|
258
242
|
padding: 0;
|
|
259
243
|
border: none;
|
|
260
|
-
border-radius:
|
|
244
|
+
border-radius: var(--dsw-radius-sm);
|
|
261
245
|
background: color-mix(in srgb, var(--dsw-alias-bg-base) 82%, transparent);
|
|
262
246
|
color: var(--dsw-alias-label-secondary);
|
|
263
247
|
cursor: pointer;
|
|
@@ -265,52 +249,50 @@ Start writing, or select text and choose Edit with agent.
|
|
|
265
249
|
}
|
|
266
250
|
.art-tile-pin:hover, .art-tile-pin:focus-visible { opacity: 1; background: var(--dsw-alias-bg-base); color: var(--dsw-alias-label-primary); }
|
|
267
251
|
.art-tile-pin[aria-pressed="true"] { opacity: 1; color: var(--dsw-alias-brand-primary); }
|
|
268
|
-
.art-tile-pin svg { width: 15px; height: 15px; }
|
|
269
252
|
.art-cover { display: block; position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--dsw-alias-bg-layer-2); border-bottom: .5px solid var(--dsw-alias-border-l1); }
|
|
270
253
|
.art-cover-frame-wrap { display: block; width: 274px; height: 205px; margin: 0 auto; overflow: hidden; }
|
|
271
254
|
.art-cover-frame { display: block; width: 720px; height: 540px; border: 0; transform: scale(.38); transform-origin: top left; pointer-events: none; background: var(--dsw-static-neutral-00); }
|
|
272
255
|
.art-cover-fallback { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: var(--dsw-alias-label-secondary); }
|
|
273
256
|
.art-cover-fallback svg { width: 26px; height: 26px; opacity: .55; }
|
|
274
|
-
.art-cover-design { display: block; width: 100%; height: 100%; object-fit: contain; background: var(--dsw-alias-bg-document-preview
|
|
275
|
-
.art-cover-sheet { display: flex; flex-direction: column; gap:
|
|
276
|
-
.art-cover-sheet-name { flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight:
|
|
277
|
-
.art-cover-sheet-table { display: flex; flex-direction: column; border: .5px solid var(--dsw-alias-border-l1); border-radius:
|
|
257
|
+
.art-cover-design { display: block; width: 100%; height: 100%; object-fit: contain; background: var(--dsw-alias-bg-document-preview); }
|
|
258
|
+
.art-cover-sheet { display: flex; flex-direction: column; gap: var(--art-space-4); height: 100%; padding: var(--art-space-8) var(--art-space-8) var(--art-space-8); background: var(--dsw-alias-bg-base); overflow: hidden; }
|
|
259
|
+
.art-cover-sheet-name { flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 500; color: var(--dsw-alias-label-secondary); }
|
|
260
|
+
.art-cover-sheet-table { display: flex; flex-direction: column; border: .5px solid var(--dsw-alias-border-l1); border-radius: var(--dsw-radius-xs); overflow: hidden; }
|
|
278
261
|
.art-cover-sheet-row { display: flex; min-height: 18px; border-bottom: .5px solid var(--dsw-alias-border-l1); }
|
|
279
262
|
.art-cover-sheet-row:last-child { border-bottom: 0; }
|
|
280
263
|
.art-cover-sheet-index { flex: none; width: 14px; display: flex; align-items: center; justify-content: center; background: var(--dsw-alias-bg-layer-2); color: var(--dsw-alias-label-tertiary); font-size: 8px; }
|
|
281
|
-
.art-cover-sheet-cell { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding:
|
|
282
|
-
.art-cover-doc { display: flex; flex-direction: column; gap:
|
|
283
|
-
.art-cover-doc-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size:
|
|
284
|
-
.art-cover-doc-text { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 6; -webkit-box-orient: vertical; font-size:
|
|
285
|
-
.art-gallery-more { display: flex; justify-content: center; padding:
|
|
264
|
+
.art-cover-sheet-cell { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: var(--art-space-2) var(--art-space-4); border-left: .5px solid var(--dsw-alias-border-l1); font-size: 9px; color: var(--dsw-alias-label-primary); }
|
|
265
|
+
.art-cover-doc { display: flex; flex-direction: column; gap: var(--art-space-6); height: 100%; padding: var(--art-space-12) var(--art-space-12) var(--art-space-8); background: var(--dsw-alias-bg-base); }
|
|
266
|
+
.art-cover-doc-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--dsw-font-xxs-12-font-size); font-weight: 500; }
|
|
267
|
+
.art-cover-doc-text { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 6; -webkit-box-orient: vertical; font-size: var(--dsw-font-xxxs-11-font-size); line-height: var(--dsw-font-xxxs-11-line-height); color: var(--dsw-alias-label-secondary); }
|
|
268
|
+
.art-gallery-more { display: flex; justify-content: center; padding: var(--art-space-4) 0 var(--art-space-8); }
|
|
286
269
|
.art-empty {
|
|
287
270
|
display: flex;
|
|
288
271
|
flex-direction: column;
|
|
289
|
-
align-items:
|
|
290
|
-
gap:
|
|
272
|
+
align-items: stretch;
|
|
273
|
+
gap: var(--art-space-6);
|
|
291
274
|
margin: 2px 0 6px;
|
|
292
|
-
padding:
|
|
275
|
+
padding: var(--art-space-12);
|
|
293
276
|
border: 1px dashed var(--dsw-alias-border-l1);
|
|
294
|
-
border-radius:
|
|
277
|
+
border-radius: var(--dsw-radius-md);
|
|
295
278
|
color: var(--dsw-alias-label-secondary);
|
|
296
279
|
}
|
|
297
|
-
.art-empty-title { margin: 0; font-size:
|
|
298
|
-
.art-empty-hint { margin: 0; font-size:
|
|
299
|
-
.art-empty-actions { display: flex; gap: 6px; margin-top: 4px; }
|
|
280
|
+
.art-empty-title { margin: 0; font-size: var(--dsw-font-xxs-12-font-size); font-weight: 500; color: var(--dsw-alias-label-primary); }
|
|
281
|
+
.art-empty-hint { margin: 0; font-size: var(--dsw-font-xxs-12-font-size); line-height: var(--dsw-font-xxs-12-line-height); max-width: 44ch; }
|
|
300
282
|
.art-center {
|
|
301
283
|
flex: 1;
|
|
302
284
|
display: flex;
|
|
303
285
|
flex-direction: column;
|
|
304
286
|
align-items: center;
|
|
305
287
|
justify-content: center;
|
|
306
|
-
gap:
|
|
307
|
-
padding:
|
|
288
|
+
gap: var(--art-space-8);
|
|
289
|
+
padding: var(--art-space-24);
|
|
308
290
|
text-align: center;
|
|
309
291
|
color: var(--dsw-alias-label-secondary);
|
|
310
292
|
}
|
|
311
|
-
.art-center-title { margin: 0; font-size:
|
|
312
|
-
.art-center-hint { margin: 0; max-width: 40ch; font-size:
|
|
313
|
-
.art-note { margin: 0; padding:
|
|
293
|
+
.art-center-title { margin: 0; font-size: var(--dsw-font-xs-13-font-size); font-weight: 500; color: var(--dsw-alias-label-primary); }
|
|
294
|
+
.art-center-hint { margin: 0; max-width: 40ch; font-size: var(--dsw-font-xxs-12-font-size); line-height: var(--dsw-font-xxs-12-line-height); }
|
|
295
|
+
.art-note { margin: 0; padding: var(--art-space-4) var(--art-space-8); font-size: var(--dsw-font-xxxs-11-font-size); color: var(--dsw-alias-label-secondary); }
|
|
314
296
|
.art-body { flex: 1; min-height: 0; min-width: 0; display: flex; }
|
|
315
297
|
.art-stage { position: relative; flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--dsw-alias-bg-layer-1); }
|
|
316
298
|
.art-drawer-layer { flex: none; display: flex; min-width: 0; min-height: 0; }
|
|
@@ -326,20 +308,19 @@ Start writing, or select text and choose Edit with agent.
|
|
|
326
308
|
background: var(--dsw-alias-bg-base);
|
|
327
309
|
}
|
|
328
310
|
.art-drawer-layer[data-overlay="true"] .art-drawer { position: relative; z-index: 1; width: min(320px, 100%); }
|
|
329
|
-
.art-drawer-scrim { position: absolute; inset: 0; background: var(--dsw-alias-bg-mask-
|
|
330
|
-
.art-drawer-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap:
|
|
331
|
-
.art-drawer-head h2 { margin: 0; font-size:
|
|
311
|
+
.art-drawer-scrim { position: absolute; inset: 0; background: var(--dsw-alias-bg-mask-1); }
|
|
312
|
+
.art-drawer-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: var(--art-space-8); padding: var(--art-space-8) var(--art-space-8) var(--art-space-8) var(--art-space-12); border-bottom: .5px solid var(--dsw-alias-border-l2); }
|
|
313
|
+
.art-drawer-head h2 { margin: 0; font-size: var(--dsw-font-xs-13-font-size); font-weight: 500; line-height: var(--dsw-font-xs-13-line-height); }
|
|
332
314
|
.art-drawer-body { flex: 1; min-height: 0; overflow: auto; }
|
|
333
315
|
|
|
334
316
|
/* Design previews are rendered on the host; the plugin only frames the image. */
|
|
335
|
-
.art-design-preview { flex: 1; min-height: 0; overflow: auto; padding:
|
|
317
|
+
.art-design-preview { flex: 1; min-height: 0; overflow: auto; padding: var(--art-space-16); display: flex; flex-direction: column; align-items: center; gap: var(--art-space-12); background: var(--dsw-alias-bg-layer-1); }
|
|
336
318
|
.art-design-canvas { display: flex; justify-content: center; width: 100%; }
|
|
337
|
-
.art-design-image { display: block; max-width: 100%; height: auto; border-radius:
|
|
338
|
-
.art-design-
|
|
339
|
-
.art-design-
|
|
340
|
-
.art-design-warnings {
|
|
341
|
-
.art-design-warnings
|
|
342
|
-
.art-design-warnings ul { margin: 0; padding-left: 18px; }
|
|
319
|
+
.art-design-image { display: block; max-width: 100%; height: auto; border-radius: var(--dsw-radius-md); background: var(--dsw-static-neutral-00); box-shadow: var(--dsw-shadow-lv2); }
|
|
320
|
+
.art-design-error { max-width: 52ch; color: var(--dsw-alias-label-primary); line-height: var(--dsw-font-xs-13-line-height); }
|
|
321
|
+
.art-design-warnings { width: 100%; max-width: 720px; padding: var(--art-space-8) var(--art-space-12); border: .5px solid var(--dsw-alias-border-l2); border-radius: var(--dsw-radius-sm); background: var(--dsw-alias-bg-base); color: var(--dsw-alias-label-secondary); font-size: var(--dsw-font-xxs-12-font-size); }
|
|
322
|
+
.art-design-warnings-title { display: block; margin-bottom: 4px; font-weight: 500; color: var(--dsw-alias-label-primary); }
|
|
323
|
+
.art-design-warnings ul { margin: 0; padding-left: var(--art-space-16); }
|
|
343
324
|
|
|
344
325
|
/* The iframe canvas is the artifact's, not plugin chrome: HTML paints white by default, so a page that sets no background must not inherit the host theme. */
|
|
345
326
|
.art-frame { flex: 1; width: 100%; min-height: 0; border: none; background: var(--dsw-static-neutral-00); }
|
|
@@ -347,28 +328,24 @@ Start writing, or select text and choose Edit with agent.
|
|
|
347
328
|
flex: 1;
|
|
348
329
|
min-height: 0;
|
|
349
330
|
width: 100%;
|
|
350
|
-
padding:
|
|
331
|
+
padding: var(--art-space-12) var(--art-space-12);
|
|
351
332
|
border: none;
|
|
352
333
|
resize: none;
|
|
353
334
|
background: var(--dsw-alias-bg-base);
|
|
354
335
|
color: var(--dsw-alias-label-primary);
|
|
355
|
-
font-family:
|
|
356
|
-
font-size:
|
|
357
|
-
line-height:
|
|
336
|
+
font-family: var(--ds-font-family-code);
|
|
337
|
+
font-size: var(--dsw-font-xxs-12-font-size);
|
|
338
|
+
line-height: var(--dsw-font-xxs-12-line-height);
|
|
358
339
|
tab-size: 2;
|
|
359
340
|
}
|
|
360
341
|
.art-source:focus { outline: none; }
|
|
361
|
-
.art-prose ul[data-type="taskList"] { list-style: none; padding-left: .2em; }
|
|
362
|
-
.art-prose ul[data-type="taskList"] li { display: flex; gap: 8px; }
|
|
363
|
-
.art-prose ul[data-type="taskList"] li > label { flex: none; margin-top: .2em; }
|
|
364
|
-
.art-prose ul[data-type="taskList"] li > div { flex: 1; }
|
|
365
342
|
.art-history-body { display: flex; flex-direction: column; min-height: 0; }
|
|
366
343
|
.art-version {
|
|
367
344
|
display: flex;
|
|
368
345
|
flex-direction: column;
|
|
369
|
-
gap:
|
|
346
|
+
gap: var(--art-space-2);
|
|
370
347
|
width: 100%;
|
|
371
|
-
padding:
|
|
348
|
+
padding: var(--art-space-8) var(--art-space-12);
|
|
372
349
|
border: none;
|
|
373
350
|
background: transparent;
|
|
374
351
|
color: inherit;
|
|
@@ -376,72 +353,44 @@ Start writing, or select text and choose Edit with agent.
|
|
|
376
353
|
text-align: left;
|
|
377
354
|
cursor: pointer;
|
|
378
355
|
}
|
|
379
|
-
.art-version:hover { background: var(--dsw-alias-bg-
|
|
380
|
-
.art-version[aria-current="true"] { background: var(--dsw-alias-bg-
|
|
381
|
-
.art-version-top { display: flex; align-items: center; justify-content: space-between; gap:
|
|
382
|
-
.art-version-sub { font-size:
|
|
356
|
+
.art-version:hover { background: var(--dsw-alias-interactive-bg-hover); }
|
|
357
|
+
.art-version[aria-current="true"] { background: var(--dsw-alias-interactive-bg-hover-accent); }
|
|
358
|
+
.art-version-top { display: flex; align-items: center; justify-content: space-between; gap: var(--art-space-6); font-size: var(--dsw-font-xxs-12-font-size); font-weight: 500; font-variant-numeric: tabular-nums; }
|
|
359
|
+
.art-version-sub { font-size: var(--dsw-font-xxxs-11-font-size); color: var(--dsw-alias-label-secondary); }
|
|
383
360
|
.art-bar {
|
|
384
361
|
flex: none;
|
|
385
362
|
display: flex;
|
|
386
363
|
align-items: center;
|
|
387
364
|
justify-content: space-between;
|
|
388
|
-
gap:
|
|
389
|
-
padding:
|
|
365
|
+
gap: var(--art-space-8);
|
|
366
|
+
padding: var(--art-space-8) var(--art-space-12);
|
|
390
367
|
border-bottom: .5px solid var(--dsw-alias-border-l2);
|
|
391
368
|
background: var(--dsw-alias-bg-layer-2);
|
|
392
|
-
font-size:
|
|
369
|
+
font-size: var(--dsw-font-xxs-12-font-size);
|
|
393
370
|
}
|
|
394
371
|
.art-bar[data-tone="warn"] { background: color-mix(in srgb, var(--dsw-alias-state-warn-primary) 14%, var(--dsw-alias-bg-base)); }
|
|
395
372
|
.art-bar[data-tone="error"] { background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 12%, var(--dsw-alias-bg-base)); }
|
|
396
373
|
.art-bar-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
|
|
397
|
-
.art-bar-text strong { font-weight:
|
|
398
|
-
.art-bar-actions { flex: none; display: flex; gap:
|
|
399
|
-
.art-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
border-top: .5px solid var(--dsw-alias-border-l2);
|
|
408
|
-
color: var(--dsw-alias-label-secondary);
|
|
409
|
-
font-size: 11px;
|
|
410
|
-
white-space: nowrap;
|
|
411
|
-
}
|
|
412
|
-
.art-status span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
|
|
413
|
-
.art-relative { position: relative; }
|
|
414
|
-
.art-form { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-bottom: .5px solid var(--dsw-alias-border-l2); background: var(--dsw-alias-bg-layer-1); }
|
|
415
|
-
.art-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--dsw-alias-label-secondary); }
|
|
416
|
-
.art-field input[type="text"], .art-field textarea {
|
|
417
|
-
height: 30px;
|
|
418
|
-
padding: 0 9px;
|
|
419
|
-
border: 1px solid var(--dsw-alias-border-l1);
|
|
420
|
-
border-radius: 7px;
|
|
421
|
-
background: var(--dsw-alias-bg-base);
|
|
422
|
-
color: var(--dsw-alias-label-primary);
|
|
423
|
-
font: inherit;
|
|
424
|
-
font-size: 13px;
|
|
425
|
-
}
|
|
426
|
-
.art-field textarea { height: 84px; padding: 8px 9px; resize: vertical; line-height: 1.5; }
|
|
427
|
-
.art-field input:focus, .art-field textarea:focus { outline: none; border-color: var(--dsw-alias-brand-primary); }
|
|
428
|
-
.art-field-hint { font-size: 11px; color: var(--dsw-alias-label-secondary); }
|
|
429
|
-
.art-form-actions { display: flex; justify-content: flex-end; gap: 6px; }
|
|
430
|
-
.art-radio { display: flex; gap: 6px; }
|
|
431
|
-
.art-design { display: flex; flex-direction: column; gap: 18px; padding: 14px 14px 40px; }
|
|
432
|
-
.art-design-group { display: flex; flex-direction: column; gap: 8px; }
|
|
433
|
-
.art-design-group h3 { margin: 0; font-size: 12px; font-weight: 600; color: var(--dsw-alias-label-primary); }
|
|
434
|
-
.art-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
|
|
374
|
+
.art-bar-text strong { font-weight: 500; }
|
|
375
|
+
.art-bar-actions { flex: none; display: flex; gap: var(--art-space-6); }
|
|
376
|
+
.art-field { display: flex; flex-direction: column; gap: var(--art-space-4); font-size: var(--dsw-font-xxs-12-font-size); color: var(--dsw-alias-label-secondary); }
|
|
377
|
+
.art-field textarea { height: 84px; padding: var(--art-space-8); border: .5px solid var(--dsw-alias-border-l4); border-radius: var(--dsw-radius-sm); background: var(--dsw-alias-bg-base); color: var(--dsw-alias-label-primary); font: var(--dsw-font-xs-13); resize: vertical; }
|
|
378
|
+
.art-field input:focus, .art-field textarea:focus { outline: none; border-color: var(--dsw-alias-state-business-primary); }
|
|
379
|
+
.art-field-hint { font-size: var(--dsw-font-xxxs-11-font-size); color: var(--dsw-alias-label-secondary); }
|
|
380
|
+
.art-design { display: flex; flex-direction: column; gap: var(--art-space-16); padding: var(--art-space-12) var(--art-space-12) 40px; }
|
|
381
|
+
.art-design-group { display: flex; flex-direction: column; gap: var(--art-space-8); }
|
|
382
|
+
.art-design-group h3 { margin: 0; font-size: var(--dsw-font-xxs-12-font-size); font-weight: 500; color: var(--dsw-alias-label-primary); }
|
|
383
|
+
.art-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--art-space-8); }
|
|
435
384
|
.art-swatch {
|
|
436
385
|
display: flex;
|
|
437
386
|
align-items: center;
|
|
438
|
-
gap:
|
|
439
|
-
padding:
|
|
387
|
+
gap: var(--art-space-8);
|
|
388
|
+
padding: var(--art-space-6) var(--art-space-8);
|
|
440
389
|
border: 1px solid var(--dsw-alias-border-l1);
|
|
441
|
-
border-radius:
|
|
390
|
+
border-radius: var(--dsw-radius-sm);
|
|
442
391
|
}
|
|
443
|
-
.art-swatch input[type="color"] { flex: none; width:
|
|
444
|
-
.art-swatch-text { display: flex; flex-direction: column; min-width: 0; font-size:
|
|
392
|
+
.art-swatch input[type="color"] { flex: none; width: var(--art-control-sm); height: var(--art-control-sm); padding: 0; border: none; border-radius: var(--dsw-radius-sm); background: none; cursor: pointer; }
|
|
393
|
+
.art-swatch-text { flex: 1; display: flex; flex-direction: column; min-width: 0; font-size: var(--dsw-font-xxxs-11-font-size); color: var(--dsw-alias-label-secondary); }
|
|
445
394
|
.art-swatch-text input {
|
|
446
395
|
width: 100%;
|
|
447
396
|
min-width: 0;
|
|
@@ -449,60 +398,45 @@ Start writing, or select text and choose Edit with agent.
|
|
|
449
398
|
border: none;
|
|
450
399
|
background: transparent;
|
|
451
400
|
color: var(--dsw-alias-label-primary);
|
|
452
|
-
font-family:
|
|
453
|
-
font-size:
|
|
401
|
+
font-family: var(--ds-font-family-code);
|
|
402
|
+
font-size: var(--dsw-font-xxs-12-font-size);
|
|
454
403
|
}
|
|
455
404
|
.art-swatch-text input:focus { outline: none; }
|
|
456
|
-
.art-radius-row { display: grid; grid-template-columns: repeat(3, 1fr); gap:
|
|
457
|
-
.art-radius-row label { display: flex; flex-direction: column; gap:
|
|
458
|
-
.art-radius-row input {
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
border-radius: 6px;
|
|
463
|
-
background: var(--dsw-alias-bg-base);
|
|
464
|
-
color: var(--dsw-alias-label-primary);
|
|
465
|
-
font: inherit;
|
|
466
|
-
font-variant-numeric: tabular-nums;
|
|
467
|
-
}
|
|
468
|
-
.art-design-preview { overflow: hidden; border: 1px solid var(--dsw-alias-border-l1); border-radius: 10px; }
|
|
469
|
-
.art-design-source { font-size: 12px; color: var(--dsw-alias-label-secondary); }
|
|
470
|
-
.art-design-actions { display: flex; flex-wrap: wrap; gap: 6px; }
|
|
405
|
+
.art-radius-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--art-space-8); }
|
|
406
|
+
.art-radius-row label { display: flex; flex-direction: column; gap: var(--art-space-4); font-size: var(--dsw-font-xxxs-11-font-size); color: var(--dsw-alias-label-secondary); }
|
|
407
|
+
.art-radius-row input { width: 100%; font-variant-numeric: tabular-nums; }
|
|
408
|
+
.art-token-preview { height: 150px; display: flex; overflow: hidden; border: .5px solid var(--dsw-alias-border-l2); border-radius: var(--dsw-radius-md); }
|
|
409
|
+
.art-design-source { font-size: var(--dsw-font-xxs-12-font-size); color: var(--dsw-alias-label-secondary); }
|
|
410
|
+
.art-design-actions { display: flex; flex-wrap: wrap; gap: var(--art-space-6); }
|
|
471
411
|
.art-composer {
|
|
472
412
|
display: inline-flex;
|
|
473
413
|
align-items: center;
|
|
474
414
|
justify-content: center;
|
|
475
415
|
width: 28px;
|
|
476
|
-
height:
|
|
416
|
+
height: var(--art-control-sm);
|
|
477
417
|
padding: 0;
|
|
478
418
|
border: none;
|
|
479
|
-
border-radius:
|
|
419
|
+
border-radius: var(--dsw-radius-sm);
|
|
480
420
|
background: transparent;
|
|
481
421
|
color: var(--dsw-alias-label-secondary);
|
|
482
422
|
cursor: pointer;
|
|
483
423
|
}
|
|
484
|
-
.art-composer:hover { background: var(--dsw-alias-bg-
|
|
485
|
-
.art-chip { display: inline-flex; align-items: center; gap:
|
|
424
|
+
.art-composer:hover { background: var(--dsw-alias-interactive-bg-hover); color: var(--dsw-alias-label-primary); }
|
|
425
|
+
.art-chip { display: inline-flex; align-items: center; gap: var(--art-space-6); min-width: 0; }
|
|
486
426
|
.art-chip svg { flex: none; width: 14px; height: 14px; color: var(--dsw-alias-label-secondary); }
|
|
487
427
|
.art-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
488
|
-
.art-workspace { display: flex; align-items: center; gap:
|
|
489
|
-
.art-workspace-label { font-size:
|
|
490
|
-
.art-workspace-select {
|
|
491
|
-
|
|
492
|
-
border: .5px solid var(--dsw-alias-border-l2); border-radius: 6px;
|
|
493
|
-
background: var(--dsw-alias-bg-base); color: var(--dsw-alias-label-primary);
|
|
494
|
-
font: inherit; font-size: 12px;
|
|
495
|
-
}
|
|
496
|
-
.art-scope-fixed { flex: none; max-width: 180px; margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--dsw-alias-label-secondary); }
|
|
428
|
+
.art-workspace { display: flex; align-items: center; gap: var(--art-space-6); margin-left: auto; min-width: 0; }
|
|
429
|
+
.art-workspace-label { font-size: var(--dsw-font-xxxs-11-font-size); color: var(--dsw-alias-label-secondary); white-space: nowrap; }
|
|
430
|
+
.art-workspace-select { max-width: 180px; min-width: 90px; }
|
|
431
|
+
.art-scope-fixed { flex: none; max-width: 180px; margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--dsw-font-xxs-12-font-size); color: var(--dsw-alias-label-secondary); }
|
|
497
432
|
.art-panel-stack, .art-panel-region { height: 100%; min-height: 0; min-width: 0; }
|
|
498
433
|
.art-panel-region[hidden] { display: none; }
|
|
499
|
-
.art-
|
|
500
|
-
.art-editor-header { position: relative; flex-wrap: wrap; padding: 8px 12px; gap: 10px; }
|
|
434
|
+
.art-editor-header { position: relative; flex-wrap: nowrap; padding: var(--art-space-8) var(--art-space-12); gap: var(--art-space-8); }
|
|
501
435
|
.art-identity { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 1px; }
|
|
502
436
|
.art-identity .art-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
503
|
-
.art-editor-actions { margin-left: auto; flex: none; flex-wrap:
|
|
504
|
-
.art-inline-form { display: flex; gap:
|
|
505
|
-
.art-inline-form
|
|
437
|
+
.art-editor-actions { margin-left: auto; flex: none; flex-wrap: nowrap; justify-content: flex-end; }
|
|
438
|
+
.art-inline-form { display: flex; gap: var(--art-space-6); padding: var(--art-space-8) var(--art-space-12); }
|
|
439
|
+
.art-inline-form > span { min-width: 0; flex: 1; }
|
|
506
440
|
.art-selection-bar {
|
|
507
441
|
position: absolute;
|
|
508
442
|
z-index: 12;
|
|
@@ -511,56 +445,54 @@ Start writing, or select text and choose Edit with agent.
|
|
|
511
445
|
transform: translateX(-50%);
|
|
512
446
|
display: flex;
|
|
513
447
|
align-items: center;
|
|
514
|
-
gap:
|
|
448
|
+
gap: var(--art-space-8);
|
|
515
449
|
width: max-content;
|
|
516
450
|
max-width: min(620px, calc(100% - 24px));
|
|
517
|
-
padding:
|
|
518
|
-
border:
|
|
519
|
-
border-radius:
|
|
520
|
-
background: var(--dsw-alias-bg-
|
|
521
|
-
box-shadow:
|
|
451
|
+
padding: var(--art-space-6) var(--art-space-8) var(--art-space-6) var(--art-space-8);
|
|
452
|
+
border: 0;
|
|
453
|
+
border-radius: var(--dsw-radius-md);
|
|
454
|
+
background: var(--dsw-alias-bg-layer-1);
|
|
455
|
+
box-shadow: var(--dsw-elevation-panel);
|
|
522
456
|
}
|
|
523
|
-
.art-selection-quote { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size:
|
|
457
|
+
.art-selection-quote { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--dsw-font-xxs-12-font-size); color: var(--dsw-alias-label-secondary); }
|
|
524
458
|
.art-version-button {
|
|
525
459
|
display: inline-flex;
|
|
526
460
|
align-items: center;
|
|
527
461
|
gap: 1px;
|
|
528
|
-
height:
|
|
529
|
-
padding: 0
|
|
462
|
+
height: var(--art-control-inline);
|
|
463
|
+
padding: 0 var(--art-space-4);
|
|
530
464
|
border: .5px solid var(--dsw-alias-border-l1);
|
|
531
|
-
border-radius:
|
|
465
|
+
border-radius: var(--dsw-radius-xs);
|
|
532
466
|
background: transparent;
|
|
533
467
|
color: var(--dsw-alias-label-secondary);
|
|
534
468
|
font: inherit;
|
|
535
|
-
font-size:
|
|
469
|
+
font-size: var(--dsw-font-xxxs-11-font-size);
|
|
536
470
|
font-variant-numeric: tabular-nums;
|
|
537
471
|
cursor: pointer;
|
|
538
472
|
}
|
|
539
|
-
.art-version-button:hover, .art-version-button[aria-expanded="true"] { background: var(--dsw-alias-bg-
|
|
473
|
+
.art-version-button:hover, .art-version-button[aria-expanded="true"] { background: var(--dsw-alias-interactive-bg-hover-accent); color: var(--dsw-alias-label-primary); }
|
|
540
474
|
.art-version-button svg { width: 12px; height: 12px; }
|
|
541
|
-
.art-root { position: relative; }
|
|
542
475
|
.art-bar { flex-wrap: wrap; }
|
|
543
476
|
.art-bar-actions { flex-wrap: wrap; }
|
|
544
|
-
.art-
|
|
545
|
-
.art-source:focus-visible, .art-prose:focus-visible, .art-swatch-text input:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: -2px; }
|
|
546
|
-
.art-status { height: 28px; padding: 0 12px; }
|
|
477
|
+
.art-source:focus-visible, .art-prose:focus-visible, .art-swatch-text input:focus-visible { outline: var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary)); outline-offset: -2px; }
|
|
547
478
|
@container (max-width: 600px) {
|
|
479
|
+
.art-editor-header { flex-wrap: wrap; }
|
|
548
480
|
.art-editor-header .art-heading { flex-basis: 100%; }
|
|
549
|
-
.art-editor-actions { width: 100%; justify-content: flex-end; }
|
|
481
|
+
.art-editor-actions { width: 100%; flex-wrap: wrap; justify-content: flex-end; }
|
|
550
482
|
.art-editor-actions .art-segment { margin-right: auto; }
|
|
551
483
|
.art-drawer-layer { position: absolute; inset: 0; z-index: 30; justify-content: flex-end; }
|
|
552
484
|
.art-drawer { width: min(320px, 100%); }
|
|
553
485
|
.art-workspace-label { display: none; }
|
|
554
486
|
.art-docpage { padding: 28px 20px 64px; }
|
|
555
|
-
.art-canvas-dock { gap: 0; padding:
|
|
487
|
+
.art-canvas-dock { gap: 0; padding: var(--art-space-2) var(--art-space-4); max-width: calc(100% - 12px); }
|
|
556
488
|
.art-dock-divider { margin: 0 2px; }
|
|
557
489
|
.art-layer-bar { bottom: 54px; }
|
|
558
490
|
}
|
|
559
491
|
@container (max-width: 520px) {
|
|
560
492
|
.art-toolbar { flex-direction: column; align-items: stretch; }
|
|
561
493
|
.art-search { width: 100%; flex: none; }
|
|
562
|
-
.art-toolbar .art-segment { align-self: flex-start; }
|
|
563
|
-
.art-gallery { padding: 0
|
|
494
|
+
.art-toolbar .art-segment { align-self: flex-start; max-width: 100%; overflow-x: auto; }
|
|
495
|
+
.art-gallery { padding: 0 var(--art-space-8) var(--art-space-16); }
|
|
564
496
|
.art-grid { grid-template-columns: 1fr; }
|
|
565
497
|
.art-cover { aspect-ratio: 16 / 10; }
|
|
566
498
|
.art-selection-bar { left: 8px; right: 8px; width: auto; max-width: none; transform: none; }
|
|
@@ -568,72 +500,72 @@ Start writing, or select text and choose Edit with agent.
|
|
|
568
500
|
}
|
|
569
501
|
@media (pointer: coarse) { .art-icon-button, .art-tile-pin, .art-composer { min-height: 44px; min-width: 44px; } }
|
|
570
502
|
@media (prefers-reduced-motion: no-preference) {
|
|
571
|
-
.art-tile, .art-tile-pin, .art-version, .art-card-open { transition: background-color
|
|
572
|
-
.art-doc-toolbar { animation: art-rise
|
|
503
|
+
.art-tile, .art-tile-pin, .art-version, .art-card-open { transition: background-color var(--ds-transition-duration-fast) var(--ds-ease-in-out), color var(--ds-transition-duration-fast) var(--ds-ease-in-out), border-color var(--ds-transition-duration-fast) var(--ds-ease-in-out), opacity var(--ds-transition-duration-fast) var(--ds-ease-in-out); }
|
|
504
|
+
.art-doc-toolbar { animation: art-rise var(--ds-transition-duration-fast) var(--ds-ease-in-out); }
|
|
573
505
|
}
|
|
574
506
|
@keyframes art-rise { from { opacity: 0; transform: translate(-50%, 4px); } to { opacity: 1; transform: translate(-50%, 0); } }
|
|
575
|
-
.art-icon-button { flex: none; }
|
|
576
|
-
.art-icon-button[aria-pressed="true"] { background: var(--dsw-alias-bg-
|
|
577
|
-
.art-meta-dot { color: var(--dsw-alias-label-tertiary
|
|
507
|
+
.art-icon-button { flex: none; width: var(--art-control-sm); padding: 0; }
|
|
508
|
+
.art-icon-button[aria-pressed="true"] { background: var(--dsw-alias-interactive-bg-hover-accent); color: var(--dsw-alias-label-primary); }
|
|
509
|
+
.art-meta-dot { color: var(--dsw-alias-label-tertiary); padding: 0 var(--art-space-2); }
|
|
578
510
|
.art-ask { flex: none; white-space: nowrap; }
|
|
579
|
-
.art-center-actions { display: flex; gap:
|
|
580
|
-
.art-modal-error { margin: 0; color: var(--dsw-alias-state-error-primary); font-size:
|
|
581
|
-
.art-fallback { width: 100%; min-height: 140px; padding:
|
|
511
|
+
.art-center-actions { display: flex; gap: var(--art-space-8); }
|
|
512
|
+
.art-modal-error { margin: 0; color: var(--dsw-alias-state-error-primary); font-size: var(--dsw-font-xs-13-font-size); }
|
|
513
|
+
.art-fallback { width: 100%; min-height: 140px; padding: var(--art-space-8) var(--art-space-12); border: 1px solid var(--dsw-alias-border-l1); border-radius: var(--dsw-radius-sm); background: var(--dsw-alias-bg-layer-1); color: var(--dsw-alias-label-primary); font: var(--dsw-font-xxs-12); font-family: var(--ds-font-family-code); resize: vertical; }
|
|
582
514
|
.art-code, .art-source-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--dsw-alias-bg-base); }
|
|
583
515
|
.art-code { overflow: auto; }
|
|
584
|
-
.art-code-bar { flex: none; position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap:
|
|
516
|
+
.art-code-bar { flex: none; position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: var(--art-space-8); min-height: 40px; padding: var(--art-space-6) var(--art-space-12); border-bottom: .5px solid var(--dsw-alias-border-l2); background: var(--dsw-alias-bg-base); color: var(--dsw-alias-label-secondary); font-size: var(--dsw-font-xxs-12-font-size); }
|
|
585
517
|
.art-code-block { margin: 0; border: none; border-radius: 0; }
|
|
586
|
-
.art-code pre.prim-code { margin: 0; padding:
|
|
518
|
+
.art-code pre.prim-code { margin: 0; padding: var(--art-space-12) var(--art-space-12); white-space: pre-wrap; font: var(--dsw-font-xxs-12); font-family: var(--ds-font-family-code); }
|
|
587
519
|
.art-doc { position: relative; flex: 1; min-height: 0; overflow: auto; background: var(--dsw-alias-bg-layer-1); }
|
|
588
|
-
.art-docpage {
|
|
520
|
+
.art-docpage[hidden] { display: none; }
|
|
521
|
+
.art-docpage { box-sizing: border-box; width: min(100%, 820px); min-height: calc(100% - 32px); margin: 16px auto; padding: 56px 64px 96px; border-radius: var(--dsw-radius-md); background: var(--artifact-color-surface, var(--dsw-alias-bg-base)); box-shadow: var(--dsw-elevation-stroke), var(--dsw-shadow-lv1); }
|
|
589
522
|
.art-doc-mount { max-width: 70ch; margin: 0 auto; }
|
|
590
523
|
.art-prose, .art-prose:focus-visible { outline: none; }
|
|
591
524
|
.art-prose > :first-child { margin-top: 0; }
|
|
592
525
|
.art-prose ul[data-type="taskList"] { list-style: none; padding-left: .2em; }
|
|
593
|
-
.art-prose ul[data-type="taskList"] li { display: flex; gap:
|
|
526
|
+
.art-prose ul[data-type="taskList"] li { display: flex; gap: var(--art-space-8); }
|
|
594
527
|
.art-prose ul[data-type="taskList"] li > label { flex: none; margin-top: .25em; }
|
|
595
528
|
.art-prose ul[data-type="taskList"] li > div { flex: 1; }
|
|
596
529
|
.art-prose ::selection { background: color-mix(in srgb, var(--artifact-color-primary, var(--dsw-alias-brand-primary)) 24%, transparent); }
|
|
597
|
-
.art-doc-toolbar { position: absolute; z-index: 15; display: flex; flex-wrap: wrap; justify-content: center; max-width: calc(100% - 16px); align-items: center; gap:
|
|
598
|
-
.art-doc-toolbar [aria-pressed="true"] { background: var(--dsw-alias-bg-
|
|
599
|
-
.art-doc-toolbar-gap { width: .5px;
|
|
600
|
-
.art-card { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap:
|
|
530
|
+
.art-doc-toolbar { position: absolute; z-index: 15; display: flex; flex-wrap: wrap; justify-content: center; max-width: calc(100% - 16px); align-items: center; gap: var(--art-space-2); padding: var(--art-space-4); border-radius: var(--dsw-radius-md); background: var(--dsw-alias-bg-layer-1); box-shadow: var(--dsw-elevation-panel); transform: translateX(-50%); white-space: nowrap; }
|
|
531
|
+
.art-doc-toolbar [aria-pressed="true"] { background: var(--dsw-alias-interactive-bg-hover-accent); color: var(--dsw-alias-label-primary); }
|
|
532
|
+
.art-doc-toolbar-gap, .art-dock-divider, .art-sheet-divider { flex: none; width: .5px; height: var(--art-control-inline); margin: 0 var(--art-space-4); background: var(--dsw-alias-border-l2); }
|
|
533
|
+
.art-card { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: var(--art-space-12); width: 100%; max-width: 480px; padding: var(--art-space-8) var(--art-space-12) var(--art-space-8) var(--art-space-8); border: .5px solid var(--dsw-alias-border-l1); border-radius: var(--dsw-radius-lg); background: var(--dsw-alias-card-fill); color: var(--dsw-alias-label-primary); font: inherit; font-size: var(--dsw-font-xs-13-font-size); text-align: left; }
|
|
601
534
|
.art-card-open { cursor: pointer; }
|
|
602
|
-
.art-card-open:hover { border-color: var(--dsw-alias-border-l2); background: var(--dsw-alias-
|
|
535
|
+
.art-card-open:hover { border-color: var(--dsw-alias-border-l2); background: var(--dsw-alias-card-fill-hover); }
|
|
603
536
|
.art-card-open:hover .art-card-go { color: var(--dsw-alias-label-primary); transform: translateX(1px); }
|
|
604
|
-
.art-card-icon { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius:
|
|
537
|
+
.art-card-icon { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--dsw-radius-md); border: .5px solid var(--dsw-alias-border-l1); background: var(--dsw-alias-bg-base); color: var(--dsw-alias-label-secondary); }
|
|
605
538
|
.art-card-icon[data-tone="error"] { color: var(--dsw-alias-state-error-primary); }
|
|
606
539
|
.art-card-icon svg { width: 18px; height: 18px; }
|
|
607
|
-
.art-card-text { min-width: 0; display: flex; flex-direction: column; gap:
|
|
608
|
-
.art-card-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight:
|
|
609
|
-
.art-card-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size:
|
|
540
|
+
.art-card-text { min-width: 0; display: flex; flex-direction: column; gap: var(--art-space-2); }
|
|
541
|
+
.art-card-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
|
|
542
|
+
.art-card-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--dsw-font-xxs-12-font-size); color: var(--dsw-alias-label-secondary); }
|
|
610
543
|
.art-card-sub[data-tone="error"] { color: var(--dsw-alias-state-error-primary); white-space: normal; }
|
|
611
|
-
.art-card-go { display: flex; color: var(--dsw-alias-label-secondary); transition: transform
|
|
544
|
+
.art-card-go { display: flex; color: var(--dsw-alias-label-secondary); transition: transform var(--ds-transition-duration-fast) var(--ds-ease-in-out), color var(--ds-transition-duration-fast) var(--ds-ease-in-out); }
|
|
612
545
|
.art-composer svg { width: 16px; height: 16px; }
|
|
613
|
-
.art-
|
|
614
|
-
.art-
|
|
615
|
-
.art-starter {
|
|
616
|
-
.art-starter-
|
|
617
|
-
.art-starter-
|
|
618
|
-
.art-starter-hint { font-size: 12px; line-height: 1.5; color: var(--dsw-alias-label-secondary); }
|
|
546
|
+
.art-starters { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--art-space-8); margin: 10px 0 0; padding: 0; }
|
|
547
|
+
.art-starter { display: flex; align-items: flex-start; gap: var(--art-space-8); padding: var(--art-space-8) var(--art-space-8) var(--art-space-8) var(--art-space-12); border: .5px solid var(--dsw-alias-border-l1); border-radius: var(--dsw-radius-md); background: var(--dsw-alias-bg-base); }
|
|
548
|
+
.art-starter-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--art-space-2); }
|
|
549
|
+
.art-starter-name { font-size: var(--dsw-font-xs-13-font-size); font-weight: 500; color: var(--dsw-alias-label-primary); }
|
|
550
|
+
.art-starter-hint { font-size: var(--dsw-font-xxs-12-font-size); line-height: var(--dsw-font-xxs-12-line-height); color: var(--dsw-alias-label-secondary); }
|
|
619
551
|
.art-tile-pin svg { width: 14px; height: 14px; }
|
|
620
552
|
.art-canvas { flex: 1; min-height: 0; display: flex; flex-direction: column; }
|
|
621
|
-
.art-canvas-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--dsw-alias-bg-document-preview
|
|
553
|
+
.art-canvas-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--dsw-alias-bg-document-preview); }
|
|
622
554
|
.art-canvas-mount { position: absolute; inset: 0; }
|
|
623
555
|
.art-canvas-mount[hidden] { display: none; }
|
|
624
|
-
.art-canvas-mount:focus-visible { outline:
|
|
556
|
+
.art-canvas-mount:focus-visible { outline: var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary)); outline-offset: -2px; }
|
|
625
557
|
.art-canvas-fallback { position: absolute; inset: 0; display: flex; overflow: auto; }
|
|
626
558
|
.art-canvas-opening {
|
|
627
559
|
position: absolute;
|
|
628
560
|
z-index: 3;
|
|
629
561
|
top: 10px;
|
|
630
562
|
left: 12px;
|
|
631
|
-
padding:
|
|
563
|
+
padding: var(--art-space-2) var(--art-space-8);
|
|
632
564
|
border: .5px solid var(--dsw-alias-border-l2);
|
|
633
|
-
border-radius:
|
|
565
|
+
border-radius: var(--dsw-radius-sm);
|
|
634
566
|
background: var(--dsw-alias-bg-base);
|
|
635
567
|
color: var(--dsw-alias-label-secondary);
|
|
636
|
-
font-size:
|
|
568
|
+
font-size: var(--dsw-font-xxs-12-font-size);
|
|
637
569
|
}
|
|
638
570
|
.art-canvas-empty {
|
|
639
571
|
position: absolute;
|
|
@@ -643,9 +575,9 @@ Start writing, or select text and choose Edit with agent.
|
|
|
643
575
|
align-items: center;
|
|
644
576
|
justify-content: center;
|
|
645
577
|
margin: 0;
|
|
646
|
-
padding:
|
|
578
|
+
padding: var(--art-space-24);
|
|
647
579
|
color: var(--dsw-alias-label-secondary);
|
|
648
|
-
font-size:
|
|
580
|
+
font-size: var(--dsw-font-xxs-12-font-size);
|
|
649
581
|
text-align: center;
|
|
650
582
|
pointer-events: none;
|
|
651
583
|
}
|
|
@@ -657,17 +589,16 @@ Start writing, or select text and choose Edit with agent.
|
|
|
657
589
|
transform: translateX(-50%);
|
|
658
590
|
display: flex;
|
|
659
591
|
align-items: center;
|
|
660
|
-
gap:
|
|
592
|
+
gap: var(--art-space-2);
|
|
661
593
|
max-width: calc(100% - 20px);
|
|
662
|
-
padding:
|
|
663
|
-
border:
|
|
664
|
-
border-radius: var(--dsw-radius-
|
|
594
|
+
padding: var(--art-space-4) var(--art-space-6);
|
|
595
|
+
border: 0;
|
|
596
|
+
border-radius: var(--dsw-radius-md);
|
|
665
597
|
background: var(--dsw-alias-bg-layer-1);
|
|
666
|
-
box-shadow:
|
|
598
|
+
box-shadow: var(--dsw-elevation-panel);
|
|
667
599
|
}
|
|
668
600
|
.art-dock-button { flex: none; width: 28px; padding: 0; }
|
|
669
601
|
.art-dock-button[aria-pressed="true"] { background: var(--dsw-alias-interactive-bg-hover-accent); color: var(--dsw-alias-label-primary); }
|
|
670
|
-
.art-dock-divider { flex: none; width: .5px; height: 20px; margin: 0 4px; background: var(--dsw-alias-border-l2); }
|
|
671
602
|
.art-canvas-dock .art-dock-zoom,
|
|
672
603
|
.art-canvas-dock .art-dock-zoom.visible {
|
|
673
604
|
position: static;
|
|
@@ -682,98 +613,112 @@ Start writing, or select text and choose Edit with agent.
|
|
|
682
613
|
box-shadow: none;
|
|
683
614
|
transition: none;
|
|
684
615
|
}
|
|
685
|
-
.art-layer-bar { bottom: 62px; gap:
|
|
616
|
+
.art-layer-bar { bottom: 62px; gap: var(--art-space-8); max-width: min(560px, calc(100% - 24px)); }
|
|
686
617
|
.art-layer-bar-glyph { flex: none; display: flex; color: var(--dsw-alias-label-secondary); }
|
|
687
618
|
.art-layer-bar-text { display: flex; flex-direction: column; min-width: 0; gap: 0; }
|
|
688
|
-
.art-layer-bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size:
|
|
689
|
-
.art-layer-bar-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size:
|
|
619
|
+
.art-layer-bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--dsw-font-xxs-12-font-size); font-weight: 500; color: var(--dsw-alias-label-primary); }
|
|
620
|
+
.art-layer-bar-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--dsw-font-xxxs-11-font-size); color: var(--dsw-alias-label-secondary); }
|
|
690
621
|
.art-inspector { display: flex; flex-direction: column; min-height: 0; height: 100%; }
|
|
691
622
|
.art-inspector-tabs { flex: 1; min-width: 0; }
|
|
692
|
-
.art-layer-tree { flex: 1; min-height: 0; overflow: auto; padding:
|
|
693
|
-
.art-layer-tree:focus-visible { outline:
|
|
694
|
-
.art-layer-row { display: flex; align-items: center; gap:
|
|
623
|
+
.art-layer-tree { flex: 1; min-height: 0; overflow: auto; padding: var(--art-space-4) var(--art-space-6) var(--art-space-8); outline: none; }
|
|
624
|
+
.art-layer-tree:focus-visible { outline: var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary)); outline-offset: -2px; }
|
|
625
|
+
.art-layer-row { display: flex; align-items: center; gap: var(--art-space-4); height: var(--art-control-sm); padding-inline-end: var(--art-space-4); border-radius: var(--dsw-radius-sm); color: var(--dsw-alias-label-primary); font-size: var(--dsw-font-xxs-12-font-size); }
|
|
695
626
|
.art-layer-row:hover, .art-layer-row:focus-within { background: var(--dsw-alias-interactive-bg-hover); }
|
|
696
627
|
.art-layer-row.is-selected { background: var(--dsw-alias-interactive-bg-hover-accent); }
|
|
697
|
-
.art-layer-caret { flex: none; display: flex; align-items: center; justify-content: center; width: 16px; height: 16px; padding: 0; border: 0; border-radius:
|
|
628
|
+
.art-layer-caret { flex: none; display: flex; align-items: center; justify-content: center; width: 16px; height: 16px; padding: 0; border: 0; border-radius: var(--dsw-radius-xs); background: none; color: var(--dsw-alias-label-secondary); cursor: pointer; }
|
|
698
629
|
.art-layer-icon { flex: none; display: flex; color: var(--dsw-alias-label-secondary); }
|
|
699
630
|
.art-layer-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
700
|
-
.art-layer-rename { flex: 1; min-width: 0; height:
|
|
701
|
-
.art-layer-
|
|
631
|
+
.art-layer-rename { flex: 1; min-width: 0; height: var(--art-control-inline); padding: 0 var(--art-space-4); }
|
|
632
|
+
.art-layer-rename input { font: var(--dsw-font-xxs-12); }
|
|
633
|
+
.art-layer-actions { display: none; flex: none; gap: var(--art-space-2); }
|
|
702
634
|
.art-layer-row:hover .art-layer-actions, .art-layer-row:focus-within .art-layer-actions, .art-layer-row.is-selected .art-layer-actions { display: flex; }
|
|
703
|
-
.art-layer-action { display: flex; align-items: center; justify-content: center; width: 20px; height:
|
|
635
|
+
.art-layer-action { display: flex; align-items: center; justify-content: center; width: 20px; height: var(--art-control-inline); padding: 0; border: 0; border-radius: var(--dsw-radius-xs); background: none; color: var(--dsw-alias-label-secondary); cursor: pointer; }
|
|
704
636
|
.art-layer-action:hover { background: var(--dsw-alias-interactive-bg-hover); color: var(--dsw-alias-label-primary); }
|
|
705
|
-
.art-inspector-empty { margin: 0; padding:
|
|
706
|
-
.art-inspector-properties { display: flex; flex-direction: column; gap:
|
|
707
|
-
.art-inspector-node { display: flex; align-items: center; gap:
|
|
637
|
+
.art-inspector-empty { margin: 0; padding: var(--art-space-12) var(--art-space-12); color: var(--dsw-alias-label-secondary); font-size: var(--dsw-font-xxs-12-font-size); line-height: var(--dsw-font-xxs-12-line-height); }
|
|
638
|
+
.art-inspector-properties { display: flex; flex-direction: column; gap: var(--art-space-12); padding: var(--art-space-8) var(--art-space-12) var(--art-space-16); font-variant-numeric: tabular-nums; }
|
|
639
|
+
.art-inspector-node { display: flex; align-items: center; gap: var(--art-space-6); min-width: 0; }
|
|
708
640
|
.art-inspector-node-icon { flex: none; display: flex; color: var(--dsw-alias-label-secondary); }
|
|
709
|
-
.art-inspector-node-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size:
|
|
710
|
-
.art-inspector-node-type { flex: none; color: var(--dsw-alias-label-secondary); font-size:
|
|
711
|
-
.art-inspector-
|
|
712
|
-
.art-inspector-
|
|
713
|
-
.art-inspector-
|
|
714
|
-
.art-inspector-
|
|
715
|
-
.art-inspector-
|
|
716
|
-
.art-inspector
|
|
717
|
-
.art-inspector
|
|
718
|
-
.art-inspector-
|
|
719
|
-
.art-inspector-
|
|
720
|
-
.art-inspector-
|
|
721
|
-
.art-inspector-
|
|
641
|
+
.art-inspector-node-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--dsw-font-xxs-12-font-size); font-weight: 500; }
|
|
642
|
+
.art-inspector-node-type { flex: none; color: var(--dsw-alias-label-secondary); font-size: var(--dsw-font-xxxs-11-font-size); }
|
|
643
|
+
.art-inspector-actions { display: flex; flex-wrap: wrap; gap: var(--art-space-4); }
|
|
644
|
+
.art-inspector .art-inspector-action { flex: none; width: 24px; padding: 0; height: var(--art-control-sm); }
|
|
645
|
+
.art-inspector-color { flex: none; width: 22px; height: 22px; padding: 0; border: none; border-radius: var(--dsw-radius-sm); background: none; cursor: pointer; }
|
|
646
|
+
.art-inspector-swatches { display: flex; flex-wrap: wrap; gap: var(--art-space-4); }
|
|
647
|
+
.art-inspector-swatch { width: 16px; height: 16px; padding: 0; border: 0.5px solid var(--dsw-alias-border-l1); border-radius: var(--dsw-radius-xs); cursor: pointer; }
|
|
648
|
+
.art-inspector-swatch:hover { border-color: var(--dsw-alias-border-l2); }
|
|
649
|
+
.art-inspector-group { display: flex; flex-direction: column; gap: var(--art-space-6); }
|
|
650
|
+
.art-inspector-heading { margin: 0; font-size: var(--dsw-font-xxxs-11-font-size); font-weight: 500; color: var(--dsw-alias-label-secondary); }
|
|
651
|
+
.art-inspector-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--art-space-6); }
|
|
652
|
+
.art-inspector-field { display: flex; align-items: center; gap: var(--art-space-6); min-width: 0; }
|
|
653
|
+
.art-inspector-field-label { flex: none; color: var(--dsw-alias-label-tertiary); font-size: var(--dsw-font-xxxs-11-font-size); }
|
|
654
|
+
.art-inspector .art-inspector-input { flex: 1; min-width: 0; height: var(--art-control-sm); padding: 0 var(--art-space-6); border-radius: var(--dsw-radius-sm); }
|
|
655
|
+
.art-inspector .art-inspector-input input { font-size: var(--dsw-font-xxs-12-font-size); }
|
|
656
|
+
.art-inspector-appearance { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: var(--art-space-8); }
|
|
657
|
+
.art-inspector-switch { display: flex; align-items: center; gap: var(--art-space-6); height: var(--art-control-sm); }
|
|
658
|
+
.art-inspector-select { width: 100%; font-variant-numeric: tabular-nums; }
|
|
659
|
+
.art-inspector-hint { margin: 0; color: var(--dsw-alias-label-secondary); font-size: var(--dsw-font-xxs-12-font-size); line-height: var(--dsw-font-xxs-12-line-height); }
|
|
722
660
|
.op-root { display: flex; width: 100%; height: 100%; min-width: 0; }
|
|
723
661
|
.op-canvas { position: relative; flex: 1; min-width: 0; height: 100%; }
|
|
724
662
|
.op-surface { width: 100%; height: 100%; }
|
|
725
663
|
.op-bridge { display: none; }
|
|
664
|
+
/* The engine's IME textarea hides itself with Tailwind classes, which this shell does not ship. */
|
|
665
|
+
textarea[data-canvas-text-input] { position: fixed; left: 0; top: 0; width: 1px; height: 1px; margin: 0; border: 0; padding: 0; resize: none; overflow: hidden; opacity: 0; pointer-events: none; }
|
|
726
666
|
|
|
727
667
|
/* Sheet editor: Harness chrome around an artifact-token grid. */
|
|
728
668
|
.art-sheet { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--dsw-alias-bg-layer-1); }
|
|
729
669
|
.art-sheet-mount { flex: 1; min-height: 0; display: flex; flex-direction: column; }
|
|
730
670
|
.art-sheet-editor { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--dsw-alias-bg-layer-1); }
|
|
731
|
-
.art-sheet-toolbar { flex: none; display: flex; flex-direction: column; gap:
|
|
732
|
-
.art-sheet-formula { display: flex; align-items: center; gap:
|
|
733
|
-
.art-sheet-ref { flex: none; min-width: 64px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0
|
|
734
|
-
.art-sheet-formula-input { flex: 1; min-width: 0; height:
|
|
735
|
-
.art-sheet-formula-input:focus { outline: none; border-color: var(--dsw-alias-
|
|
671
|
+
.art-sheet-toolbar { flex: none; display: flex; flex-direction: column; gap: var(--art-space-2); padding: var(--art-space-4); border-bottom: .5px solid var(--dsw-alias-border-l2); background: var(--dsw-alias-bg-layer-1); }
|
|
672
|
+
.art-sheet-formula { display: flex; align-items: center; gap: var(--art-space-6); min-width: 0; }
|
|
673
|
+
.art-sheet-ref { flex: none; min-width: 64px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 var(--art-space-6); font-size: var(--dsw-font-xxxs-11-font-size); font-variant-numeric: tabular-nums; color: var(--dsw-alias-label-secondary); }
|
|
674
|
+
.art-sheet-formula-input { flex: 1; min-width: 0; height: var(--art-control-sm); padding: 0 var(--art-space-8); border: .5px solid var(--dsw-alias-border-l2); border-radius: var(--dsw-radius-sm); background: var(--dsw-alias-bg-base); color: var(--dsw-alias-label-primary); font: inherit; font-size: var(--dsw-font-xxs-12-font-size); font-family: var(--ds-font-family-code); }
|
|
675
|
+
.art-sheet-formula-input:focus { outline: none; border-color: var(--dsw-alias-state-business-primary); }
|
|
736
676
|
.art-sheet-formatbar { display: flex; flex-wrap: wrap; align-items: center; gap: 1px; min-width: 0; }
|
|
737
|
-
.art-sheet-tool { flex: none; min-width: 26px; padding: 0
|
|
738
|
-
.art-sheet-tool-text { font-size:
|
|
739
|
-
.art-sheet-format-label { min-width: 64px; justify-content: flex-start; font-size:
|
|
740
|
-
.art-sheet-
|
|
741
|
-
.art-sheet-color { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 6px; cursor: pointer; }
|
|
677
|
+
.art-sheet-tool { flex: none; min-width: 26px; padding: 0 var(--art-space-4); }
|
|
678
|
+
.art-sheet-tool-text { font-size: var(--dsw-font-xs-13-font-size); }
|
|
679
|
+
.art-sheet-format-label { min-width: 64px; justify-content: flex-start; font-size: var(--dsw-font-xxxs-11-font-size); }
|
|
680
|
+
.art-sheet-color { position: relative; display: inline-flex; align-items: center; justify-content: center; width: var(--art-control-sm); height: var(--art-control-sm); border-radius: var(--dsw-radius-sm); cursor: pointer; }
|
|
742
681
|
.art-sheet-color:hover { background: var(--dsw-alias-interactive-bg-hover); }
|
|
743
682
|
.art-sheet-color input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; }
|
|
744
|
-
.art-sheet-color-swatch { width: 16px; height: 16px; border-radius:
|
|
745
|
-
.art-sheet-color-letter { display: inline-flex; align-items: center; justify-content: center; background: var(--dsw-alias-bg-base); font-size:
|
|
746
|
-
.art-sheet-error { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap:
|
|
747
|
-
.art-sheet-error p { margin: 0; font
|
|
748
|
-
.art-sheet-error-detail { max-width: 52ch; color: var(--dsw-alias-label-secondary)
|
|
749
|
-
.art-sheet-gridwrap { position: relative; flex: 1; min-height: 0; min-width: 0; overflow: hidden; background: var(--
|
|
750
|
-
.art-sheet-corner { position: absolute; z-index: 4; top: 0; left: 0; width: 48px; height:
|
|
751
|
-
.art-sheet-colheads { position: absolute; z-index: 3; top: 0; left: 48px; right: 0; height:
|
|
683
|
+
.art-sheet-color-swatch { width: 16px; height: 16px; border-radius: var(--dsw-radius-xs); border: .5px solid var(--dsw-alias-border-l3); }
|
|
684
|
+
.art-sheet-color-letter { display: inline-flex; align-items: center; justify-content: center; background: var(--dsw-alias-bg-base); font-size: var(--dsw-font-xxxs-11-font-size); font-weight: 500; }
|
|
685
|
+
.art-sheet-error { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--art-space-6); padding: var(--art-space-24); text-align: center; }
|
|
686
|
+
.art-sheet-error > p:first-child { margin: 0; font: var(--dsw-font-xs-13); color: var(--dsw-alias-label-primary); }
|
|
687
|
+
.art-sheet-error-detail { margin: 0; max-width: 52ch; color: var(--dsw-alias-label-secondary); font: var(--dsw-font-xxs-12); font-family: var(--ds-font-family-code); }
|
|
688
|
+
.art-sheet-gridwrap { position: relative; flex: 1; min-height: 0; min-width: 0; overflow: hidden; background: var(--dsw-alias-bg-base); }
|
|
689
|
+
.art-sheet-corner { position: absolute; z-index: 4; top: 0; left: 0; width: 48px; height: var(--art-control-sm); border-right: .5px solid var(--dsw-alias-border-l2); border-bottom: .5px solid var(--dsw-alias-border-l2); background: var(--dsw-alias-bg-layer-2); }
|
|
690
|
+
.art-sheet-colheads { position: absolute; z-index: 3; top: 0; left: 48px; right: 0; height: var(--art-control-sm); overflow: hidden; border-bottom: .5px solid var(--dsw-alias-border-l2); background: var(--dsw-alias-bg-layer-2); }
|
|
752
691
|
.art-sheet-colheads-inner, .art-sheet-rowheads-inner { position: absolute; top: 0; left: 0; }
|
|
753
|
-
.art-sheet-colhead { position: absolute; top: 0; height:
|
|
754
|
-
.art-sheet-colhead[data-active="true"], .art-sheet-rowhead[data-active="true"] { background: var(--dsw-alias-interactive-bg-hover-accent); color: var(--dsw-alias-label-primary); font-weight:
|
|
692
|
+
.art-sheet-colhead { position: absolute; top: 0; height: var(--art-control-sm); display: flex; align-items: center; justify-content: center; border-right: .5px solid var(--dsw-alias-border-l2); color: var(--dsw-alias-label-secondary); font-size: var(--dsw-font-xxxs-11-font-size); }
|
|
693
|
+
.art-sheet-colhead[data-active="true"], .art-sheet-rowhead[data-active="true"] { background: var(--dsw-alias-interactive-bg-hover-accent); color: var(--dsw-alias-label-primary); font-weight: 500; }
|
|
755
694
|
.art-sheet-headbutton { width: 100%; height: 100%; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
|
|
756
695
|
.art-sheet-resize { position: absolute; z-index: 1; top: 0; right: -3px; width: 6px; height: 100%; cursor: col-resize; }
|
|
757
696
|
.art-sheet-resize::after { content: ''; position: absolute; top: 25%; left: 2px; width: 1px; height: 50%; background: var(--dsw-alias-border-l3); opacity: 0; }
|
|
758
697
|
.art-sheet-colhead:hover .art-sheet-resize::after { opacity: 1; }
|
|
759
698
|
.art-sheet-rowheads { position: absolute; z-index: 3; top: 28px; left: 0; bottom: 0; width: 48px; overflow: hidden; border-right: .5px solid var(--dsw-alias-border-l2); background: var(--dsw-alias-bg-layer-2); }
|
|
760
|
-
.art-sheet-rowhead { position: absolute; left: 0; width: 48px; display: flex; align-items: center; justify-content: center; border-bottom: .5px solid var(--dsw-alias-border-l2); color: var(--dsw-alias-label-secondary); font-size:
|
|
699
|
+
.art-sheet-rowhead { position: absolute; left: 0; width: 48px; display: flex; align-items: center; justify-content: center; border-bottom: .5px solid var(--dsw-alias-border-l2); color: var(--dsw-alias-label-secondary); font-size: var(--dsw-font-xxxs-11-font-size); }
|
|
761
700
|
.art-sheet-scroll { position: absolute; z-index: 2; top: 28px; left: 48px; right: 0; bottom: 0; overflow: auto; outline: none; }
|
|
762
|
-
.art-sheet-scroll:focus-visible { outline:
|
|
701
|
+
.art-sheet-scroll:focus-visible { outline: var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary)); outline-offset: -2px; }
|
|
763
702
|
.art-sheet-canvas { position: relative; }
|
|
764
|
-
.art-sheet-cell { position: absolute; display: flex; align-items: center; overflow: hidden; padding: 0
|
|
765
|
-
.art-sheet-selected { position: absolute; z-index: 1; pointer-events: none; background: color-mix(in srgb, var(--dsw-alias-
|
|
766
|
-
.art-sheet-active { position: absolute; z-index: 2; pointer-events: none; box-shadow: inset 0 0 0 2px var(--dsw-alias-
|
|
767
|
-
.art-sheet-cell-input { position: absolute; z-index: 3; margin: 0; padding: 0
|
|
768
|
-
.art-sheet-tabs { flex: none; display: flex; align-items: center; gap:
|
|
769
|
-
.art-sheet-tablist { display: flex; align-items: center; gap:
|
|
703
|
+
.art-sheet-cell { position: absolute; display: flex; align-items: center; overflow: hidden; padding: 0 var(--art-space-6); border-right: .5px solid var(--dsw-alias-border-l2); border-bottom: .5px solid var(--dsw-alias-border-l2); background: var(--dsw-alias-bg-base); color: var(--dsw-alias-label-primary); font-size: var(--dsw-font-xxs-12-font-size); line-height: var(--dsw-font-xxs-12-line-height); white-space: nowrap; }
|
|
704
|
+
.art-sheet-selected { position: absolute; z-index: 1; pointer-events: none; background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 12%, transparent); }
|
|
705
|
+
.art-sheet-active { position: absolute; z-index: 2; pointer-events: none; box-shadow: inset 0 0 0 2px var(--dsw-alias-state-business-primary); }
|
|
706
|
+
.art-sheet-cell-input { position: absolute; z-index: 3; margin: 0; padding: 0 var(--art-space-4); border: 2px solid var(--dsw-alias-state-business-primary); border-radius: 0; background: var(--dsw-alias-bg-base); color: var(--dsw-alias-label-primary); font: inherit; font-size: var(--dsw-font-xxs-12-font-size); outline: none; }
|
|
707
|
+
.art-sheet-tabs { flex: none; display: flex; align-items: center; gap: var(--art-space-2); padding: var(--art-space-2) var(--art-space-4); border-top: .5px solid var(--dsw-alias-border-l2); background: var(--dsw-alias-bg-layer-1); overflow-x: auto; }
|
|
708
|
+
.art-sheet-tablist { display: flex; align-items: center; gap: var(--art-space-2); min-width: 0; }
|
|
770
709
|
.art-sheet-tab { flex: none; }
|
|
771
|
-
.art-sheet-tab-button { height:
|
|
772
|
-
.art-sheet-tab-button[aria-selected="true"] { border-color: var(--dsw-alias-border-l2); background: var(--dsw-alias-bg-base); color: var(--dsw-alias-label-primary); font-weight:
|
|
773
|
-
.art-sheet-tab-input { width: 96px; height:
|
|
774
|
-
.art-sheet-add, .art-sheet-tab-more { flex: none; min-width: 24px; padding: 0
|
|
710
|
+
.art-sheet-tab-button { height: var(--art-control-sm); padding: 0 var(--art-space-8); border: .5px solid transparent; border-radius: var(--dsw-radius-xs); background: transparent; color: var(--dsw-alias-label-secondary); font: inherit; font-size: var(--dsw-font-xxxs-11-font-size); white-space: nowrap; cursor: pointer; }
|
|
711
|
+
.art-sheet-tab-button[aria-selected="true"] { border-color: var(--dsw-alias-border-l2); background: var(--dsw-alias-bg-base); color: var(--dsw-alias-label-primary); font-weight: 500; }
|
|
712
|
+
.art-sheet-tab-input { width: 96px; height: var(--art-control-sm); padding: 0 var(--art-space-4); border: .5px solid var(--dsw-alias-state-business-primary); border-radius: var(--dsw-radius-xs); background: var(--dsw-alias-bg-base); color: var(--dsw-alias-label-primary); font: inherit; font-size: var(--dsw-font-xxxs-11-font-size); }
|
|
713
|
+
.art-sheet-add, .art-sheet-tab-more { flex: none; min-width: 24px; padding: 0 var(--art-space-4); }
|
|
775
714
|
@media (max-width: 420px) { .art-sheet-ref { display: none; } .art-sheet-format-label { min-width: 0; } }
|
|
776
|
-
|
|
715
|
+
.art-sheet-tool[aria-pressed="true"] { background: var(--dsw-alias-interactive-bg-hover-accent); color: var(--dsw-alias-label-primary); }
|
|
716
|
+
.art-select { min-width: 0; height: var(--art-control-sm); padding: 0 var(--art-space-8); border: .5px solid var(--dsw-alias-border-l4); border-radius: var(--dsw-radius-sm); background: var(--dsw-alias-bg-layer-1); color: var(--dsw-alias-label-primary); font: var(--dsw-font-xxs-12); }
|
|
717
|
+
.art-select:focus { border-color: var(--dsw-alias-state-business-primary); }
|
|
718
|
+
.art-generation { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
719
|
+
.art-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--art-space-8); min-height: 96px; padding: var(--art-space-24); text-align: center; color: var(--dsw-alias-label-secondary); font: var(--dsw-font-xs-13); }
|
|
720
|
+
.art-state p { margin: 0; max-width: 52ch; }
|
|
721
|
+
`;function oo(){if(typeof document>"u"||document.querySelector(`style[data-plugin-css="${no}"]`)!==null)return;let e=document.createElement("style");e.dataset.plugin="dsh-artifact-studio",e.dataset.pluginCss=no,e.textContent=zs+Ns,document.head.appendChild(e)}var Be=require("react/jsx-runtime");var je="artifacts",so=["artifact_create","artifact_update"],Is=["connection","slots","locale","sidebarRightTabs","sidebarRight","workspaces"];function Rs(e){if(e===null||typeof e!="object"||!("selectPanel"in e))return null;let{selectPanel:t}=e;return typeof t!="function"?null:{selectPanel:a=>{t.call(e,a)}}}function ga(e){return function(a){return(0,Be.jsx)(oa,{title:a.t("error.surface"),hint:a.t("error.surfaceHint"),reloadLabel:a.t("action.reloadWindow"),children:(0,Be.jsx)(e,{...a})})}}function As(){let e=Ir();return e===null?null:(0,Be.jsx)(io.Toast,{text:e.message,onDone:()=>Pa(e.seq)},e.seq)}function Es({useTabInfo:e}){let{tab:t}=e(),a=He(t.contentId??t.navigation?.address),r=Nr(a?.id);return(0,Be.jsxs)("span",{className:"art-chip",children:[(0,Be.jsx)(Oe,{}),(0,Be.jsx)("span",{children:r??a?.id??""})]})}function Ds(e){oo(),e.effect(Rr,"dsh-artifact-studio: unsaved draft guard"),kr(e.connection),Te.sidebarRight=e.sidebarRight,Te.layout=Rs(e.get("layout")),e.locale.register(je,"en",yn),e.locale.register(je,"zh",wn);let t=e.locale.bind(je),a=(l,s)=>t(l,s);e.effect(()=>e.sidebarRightTabs.register({id:Nt,kind:Ka,priority:"extension",patterns:["dsh-resource://artifact/**"],canOpen:l=>He(l)!==void 0,title:l=>{let s=He(l);return s===void 0?"":Cr(s.id)??s.id}}),"dsh-artifact-studio: artifact tab type"),e.effect(()=>e.sidebarRightTabs.register({id:la,kind:qa,priority:"extension",title:()=>a("panel"),guide:[{id:"artifacts",order:30,title:()=>a("panel"),description:()=>a("right.guideHint"),icon:kt}]}),"dsh-artifact-studio: right panel artifacts page");let r=()=>({t:a});e.effect(()=>()=>Pa(),"dsh-artifact-studio: notification cleanup"),e.slots.inject("shell.overlay",()=>e.slots.register({name:"shell.overlay",id:"dsh-artifact-studio.notice"},As)),e.slots.inject("sidebar.right.pane.tab",()=>e.slots.register({name:"sidebar.right.pane.tab",key:Nt,locale:je,inject:r},ga(Ua))),e.slots.inject("sidebar.right.pane.tab.title",()=>e.slots.register({name:"sidebar.right.pane.tab.title",key:Nt,locale:je,inject:r},Es)),e.slots.inject("sidebar.right.pane.tab",()=>e.slots.register({name:"sidebar.right.pane.tab",key:la,locale:je,inject:r},ga(ro)));for(let l of so)e.slots.inject("tool.call.toolview",()=>e.slots.register({name:"tool.call.toolview",key:l,locale:je,inject:r},ga($a)));e.slots.inject("conversation.input.left",()=>e.slots.register({name:"conversation.input.left",id:"dsh-artifact-studio",order:40,locale:je,inject:r},Pn));function n({size:l}){return(0,Be.jsx)(kt,{size:l})}let o=()=>({t:a,workspaces:e.workspaces.list});e.slots.inject("main",()=>e.slots.register({name:"main",key:dt,locale:je,inject:o},ga(ao))),e.slots.inject("sidebar.panellist",()=>e.slots.register({name:"sidebar.panellist",id:dt,order:10,label:()=>a("panel")},n))}
|
|
777
722
|
|
|
778
723
|
return module.exports;
|
|
779
724
|
},
|