@smart-tools/t3-code-pixso-mcp-assistant 1.0.1

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.
@@ -0,0 +1 @@
1
+ import{A as e,B as t,C as n,D as r,E as i,F as a,H as ee,I as te,L as ne,M as o,N as s,O as c,P as l,R as u,S as d,T as f,U as p,V as m,W as h,_ as g,a as _,b as v,c as y,d as re,f as ie,g as b,h as ae,i as x,j as S,k as C,l as w,m as T,n as E,o as D,p as O,r as k,s as A,t as j,u as M,v as N,w as P,x as F,y as I,z as oe}from"../panel-DWzV5ian.mjs";import{t as L}from"../constants-C3TxS7N-.mjs";import*as R from"effect/Schema";import*as z from"effect/unstable/rpc/Rpc";const B={pixsoAssistantSnapshot:`pixsoAssistant.snapshot`,pixsoAssistantCard:`pixsoAssistant.card`,pixsoAssistantCardRaw:`pixsoAssistant.cardRaw`,pixsoAssistantRemoveCard:`pixsoAssistant.removeCard`,pixsoAssistantGroupsMutate:`pixsoAssistant.groupsMutate`,pixsoAssistantReportLatest:`pixsoAssistant.reportLatest`,pixsoAssistantCatalog:`pixsoAssistant.catalog`,pixsoAssistantScanStart:`pixsoAssistant.scanStart`,pixsoAssistantScanSubscribe:`subscribePixsoScan`,pixsoAssistantCheck:`pixsoAssistant.check`,pixsoAssistantProbe:`pixsoAssistant.probe`,pixsoAssistantRescanDebug:`pixsoAssistant.rescanDebug`,pixsoAssistantReparse:`pixsoAssistant.reparse`},V=z.make(B.pixsoAssistantSnapshot,{payload:R.Struct({}),success:_,error:P}),H=z.make(B.pixsoAssistantCard,{payload:R.Struct({id:R.String}),success:f,error:P}),U=z.make(B.pixsoAssistantCardRaw,{payload:R.Struct({id:R.String}),success:R.Struct({raw:R.String}),error:P}),W=z.make(B.pixsoAssistantRemoveCard,{payload:R.Struct({id:R.String}),success:R.Void,error:P}),G=z.make(B.pixsoAssistantGroupsMutate,{payload:R.Struct({mutation:x}),success:R.Void,error:P}),K=z.make(B.pixsoAssistantReportLatest,{payload:R.Struct({}),success:R.NullOr(w),error:P}),q=z.make(B.pixsoAssistantCatalog,{payload:R.Struct({catalogHash:R.String}),success:r,error:P}),J=z.make(B.pixsoAssistantScanStart,{payload:R.Struct({}),success:g,error:P}),Y=z.make(B.pixsoAssistantScanSubscribe,{payload:R.Struct({}),success:g,error:P,stream:!0}),X=z.make(B.pixsoAssistantCheck,{payload:R.Struct({}),success:y,error:P}),Z=z.make(B.pixsoAssistantProbe,{payload:R.Struct({}),success:O,error:P}),Q=z.make(B.pixsoAssistantRescanDebug,{payload:R.Struct({}),success:w,error:P}),$=z.make(B.pixsoAssistantReparse,{payload:R.Struct({}),success:b,error:P}),se=[V,H,U,W,G,K,q,J,Y,X,Z,Q,$];export{f as CardDetail,j as CardIdentityData,E as CardSummary,i as CatalogEntry,r as CatalogSnapshot,y as CheckResult,k as ComplexityBand,x as GroupsMutateOp,w as LatestScanReport,B as PIXSO_ASSISTANT_METHODS,L as PIXSO_MCP_ENDPOINT,_ as PanelSnapshot,M as ParserDiagnostic,P as PixsoAssistantError,c as PixsoBorders,D as PixsoCardGroup,C as PixsoComponentInfo,e as PixsoComponentProp,S as PixsoComponentUsage,o as PixsoConstraints,s as PixsoEffect,l as PixsoFont,a as PixsoGradient,te as PixsoInstanceOverride,ne as PixsoMargin,u as PixsoNode,oe as PixsoNodeLayout,t as PixsoNodeStroke,m as PixsoNodeType,ee as PixsoRadii,p as PixsoSizing,h as PixsoTextMeta,re as PixsoTool,ie as PixsoToolParam,O as ProbeResult,T as ProbeRow,ae as ProbeRowStatus,b as ReparseResult,g as ScanJobState,N as ScanOutcome,I as ScanReportData,v as ScanToolTiming,F as UnknownEnumSample,d as UnknownKeySample,n as UnresolvedLibrary,U as WsPixsoAssistantCardRawRpc,H as WsPixsoAssistantCardRpc,q as WsPixsoAssistantCatalogRpc,X as WsPixsoAssistantCheckRpc,G as WsPixsoAssistantGroupsMutateRpc,Z as WsPixsoAssistantProbeRpc,W as WsPixsoAssistantRemoveCardRpc,$ as WsPixsoAssistantReparseRpc,K as WsPixsoAssistantReportLatestRpc,Q as WsPixsoAssistantRescanDebugRpc,J as WsPixsoAssistantScanStartRpc,Y as WsPixsoAssistantScanSubscribeRpc,V as WsPixsoAssistantSnapshotRpc,A as emptyPanelSnapshot,se as pixsoAssistantRpcs};
@@ -0,0 +1,10 @@
1
+ import * as Schema from "effect/Schema";
2
+ import * as effect_Cause0 from "effect/Cause";
3
+
4
+ declare const PixsoAssistantError_base: Schema.Class<PixsoAssistantError, Schema.TaggedStruct<"PixsoAssistantError", {
5
+ readonly detail: Schema.String;
6
+ }>, effect_Cause0.YieldableError>;
7
+ declare class PixsoAssistantError extends PixsoAssistantError_base {
8
+ get message(): string;
9
+ }
10
+ export { PixsoAssistantError as t };
@@ -0,0 +1,3 @@
1
+ type PixsoAssistantLocale = "ru" | "en";
2
+ declare const configurePixsoAssistantLocale: (getLocale: () => PixsoAssistantLocale) => void;
3
+ export { configurePixsoAssistantLocale as n, PixsoAssistantLocale as t };
@@ -0,0 +1 @@
1
+ import*as e from"effect/Schema";const t=e.Literals([`frame`,`group`,`rect`,`ellipse`,`text`,`vector`,`instance`,`symbol`,`paragraph`,`span`,`line`,`mask`]),n=e.Struct({family:e.optional(e.String),style:e.optional(e.String),size:e.optional(e.Number)}),r=e.Literals([`fixed`,`hug`,`fill`]),i=e.Literals([`flex-start`,`center`,`flex-end`]),a=e.Struct({mode:e.Literals([`horizontal`,`vertical`,`unknown`]),gap:e.NullOr(e.Number),counterGap:e.optional(e.Number),minWidth:e.optional(e.Number),maxWidth:e.optional(e.Number),minHeight:e.optional(e.Number),maxHeight:e.optional(e.Number),padding:e.NullOr(e.Struct({top:e.Number,right:e.Number,bottom:e.Number,left:e.Number})),primaryAlign:e.optional(i),counterAlign:e.optional(i),sizing:e.optional(e.Struct({w:r,h:r})),reverse:e.optional(e.Boolean),summary:e.String}),o=e.Struct({kind:e.Literals([`drop-shadow`,`background-blur`,`foreground-blur`]),color:e.optional(e.String),offsetX:e.optional(e.Number),offsetY:e.optional(e.Number),spread:e.optional(e.Number),radius:e.optional(e.Number)}),s=e.Struct({color:e.String,weight:e.Number,align:e.optional(e.Literals([`inside`,`center`,`outside`])),dashed:e.optional(e.Boolean)}),c=e.Struct({lineHeightPx:e.NullOr(e.Number),letterSpacingPx:e.NullOr(e.Number),upperCase:e.Boolean,letterSpacing:e.optional(e.Struct({value:e.Number,unit:e.Literals([`px`,`%`])})),autoResize:e.optional(e.Literals([`height`,`width-and-height`])),textAlign:e.optional(e.Literals([`center`,`right`,`justify`])),decoration:e.optional(e.String)}),l=e.Struct({kind:e.Literal(`linear`),angle:e.Number,x1:e.Number,y1:e.Number,x2:e.Number,y2:e.Number,stops:e.Array(e.Struct({position:e.Number,color:e.String,alpha:e.Number}))}),u=e.Struct({topLeft:e.Number,topRight:e.Number,bottomRight:e.Number,bottomLeft:e.Number}),d=e.Struct({top:e.optional(e.Number),right:e.optional(e.Number),bottom:e.optional(e.Number),left:e.optional(e.Number),color:e.optional(e.String)}),f=e.Struct({top:e.optional(e.Number),right:e.optional(e.Number),bottom:e.optional(e.Number),left:e.optional(e.Number)}),p=e.Struct({horizontal:e.optional(e.String),vertical:e.optional(e.String)}),m=e.Struct({path:e.Array(e.String),targetId:e.String,componentId:e.optional(e.String),nodeType:e.optional(e.String),name:e.optional(e.String),text:e.optional(e.String),textToken:e.optional(e.String),fillToken:e.optional(e.String),x:e.optional(e.Number),y:e.optional(e.Number),width:e.optional(e.Number),height:e.optional(e.Number),radius:e.optional(e.Number),fill:e.optional(e.String),changed:e.Array(e.String)}),h=e.suspend(()=>g),g=e.Struct({id:e.String,name:e.String,type:t,x:e.Number,y:e.Number,width:e.Number,height:e.Number,radius:e.optional(e.Number),opacity:e.optional(e.Number),fill:e.optional(e.String),text:e.optional(e.String),textColor:e.optional(e.String),font:e.optional(n),stroke:e.optional(s),layout:e.optional(a),textMeta:e.optional(c),hidden:e.optional(e.Boolean),mask:e.optional(e.Boolean),sticky:e.optional(e.Boolean),fillToken:e.optional(e.String),textToken:e.optional(e.String),blendMode:e.optional(e.Literal(`multiply`)),url:e.optional(e.String),effects:e.optional(e.Array(o)),componentRef:e.optional(e.String),rotation:e.optional(e.Number),radii:e.optional(u),gradient:e.optional(l),borders:e.optional(d),constraints:e.optional(p),scrollDirection:e.optional(e.String),descriptionRich:e.optional(e.String),margin:e.optional(f),overrides:e.optional(e.Array(m)),children:e.optional(e.Array(h))}),_=e.Struct({name:e.String,kind:e.Literals([`text`,`visible`]),value:e.String,defaultValue:e.String,overridden:e.Boolean}),v=e.Struct({key:e.String,name:e.String,variantGroup:e.NullOr(e.String),library:e.NullOr(e.String),libraryFileKey:e.NullOr(e.String),pageName:e.NullOr(e.String),description:e.NullOr(e.String),updatedAt:e.NullOr(e.String),deprecated:e.Boolean,resolved:e.Boolean,count:e.Number,props:e.Array(_)}),y=e.Struct({componentKey:e.NullOr(e.String),libraryFile:e.NullOr(e.String),version:e.NullOr(e.String),variants:e.NullOr(e.Record(e.String,e.String)),mainComponent:e.optional(e.String),stateGroup:e.optional(e.String),instanceByFrame:e.optional(e.Boolean),publishId:e.optional(e.String)}),b=e.Struct({component_key:e.String,name:e.String,description:e.String,file_key:e.String,node_id:e.String,containing_frame:e.Struct({pageId:e.String,pageName:e.String,containingStateGroup:e.optional(e.Struct({name:e.String,nodeId:e.String}))}),content_hash:e.String,updated_at:e.NullOr(e.String),min_node_width:e.Number,min_node_height:e.Number,thumbnail_url:e.String}),x=e.Struct({capturedAtIso:e.String,libraryNames:e.Record(e.String,e.String),entries:e.Array(b)}),S=e.Struct({id:e.String,nodeId:e.String,name:e.String,nodeType:t,dslVersion:e.NullOr(e.String),importedAtIso:e.String,pagePath:e.Array(e.String),root:g,component:e.NullOr(y),componentsUsed:e.Array(v),catalogHash:e.NullOr(e.String),parserVersion:e.optional(e.Number),versionUnverified:e.optional(e.Boolean)});var C=class extends e.TaggedErrorClass()(`PixsoAssistantError`,{detail:e.String}){get message(){return this.detail}};const w=e.Literals([`success`,`success-warnings`,`reimport`,`mcp-down`,`tool-timeout`,`dsl-error`,`empty-selection`,`multi-selection`,`parse-error`,`components-error`,`internal-error`]),T=e.Struct({severity:e.Literals([`info`,`warning`]),code:e.String,message:e.String,path:e.optional(e.String)}),E=e.Struct({tool:e.String,ms:e.Number,ok:e.Boolean,detail:e.NullOr(e.String)}),D=e.Struct({key:e.String,sample:e.String,count:e.Number,exampleGuid:e.NullOr(e.String)}),O=e.Struct({field:e.String,value:e.String,count:e.Number,exampleGuid:e.NullOr(e.String)}),k=e.Struct({fileKey:e.String,count:e.Number,exampleGuid:e.NullOr(e.String)}),A=e.Struct({outcome:w,failedStep:e.NullOr(e.Number),nodeId:e.NullOr(e.String),cardName:e.NullOr(e.String),dslVersion:e.NullOr(e.String),converterVersion:e.NullOr(e.String),nodesParsed:e.Number,nodesWithIssues:e.Number,rootGuids:e.Array(e.String),toolTimings:e.Array(E),unknownKeys:e.Array(D),unknownEnums:e.Array(O),unresolvedLibraries:e.Array(k),diagnostics:e.Array(T),catalogStatus:e.Literals([`ok`,`failed`,`skipped`]),duplicate:e.Boolean,excerpts:e.Array(e.String),byteDiff:e.NullOr(e.Struct({identical:e.Boolean,note:e.String}))}),j=e.Struct({atIso:e.String,data:A}),M=e.Struct({name:e.String,type:e.String,required:e.Boolean,description:e.optional(e.String)}),N=e.Struct({name:e.String,description:e.String,write:e.Boolean,params:e.Array(M)}),P=e.Struct({atIso:e.String,tools:e.Array(N)}),F=e.Literals([`ok`,`dead`,`empty`,`skip`,`needs-args`]),I=e.Struct({tool:e.String,args:e.String,status:F,detail:e.String}),L=e.Struct({atIso:e.String,rows:e.Array(I),deviations:e.Array(e.String),savedTo:e.String}),R=e.Struct({total:e.Number,reparsed:e.Number,skippedNoRaw:e.Number,skippedNoCatalog:e.optional(e.Number),failed:e.Number}),z=e.Union([e.Struct({phase:e.Literal(`idle`)}),e.Struct({phase:e.Literal(`running`),step:e.Number,startedAtIso:e.String}),e.Struct({phase:e.Literal(`settled`),outcome:w,failedStep:e.NullOr(e.Number),cardId:e.NullOr(e.String),detail:e.NullOr(e.String),startedAtIso:e.String,settledAtIso:e.String})]),B=e.Literals([`simple`,`medium`,`complex`]),V=e.Struct({componentName:e.NullOr(e.String),library:e.NullOr(e.String),deprecated:e.Boolean}),H=e.Struct({id:e.String,nodeId:e.String,name:e.String,nodeType:t,width:e.Number,height:e.Number,layerCount:e.Number,complexityBand:B,complexityFilled:e.Number,colors:e.Array(e.String),instanceTotal:e.Number,deprecatedUsed:e.Number,identity:V,importedAtIso:e.String,previewSvg:e.String}),U=e.Struct({id:e.String,name:e.String,pinned:e.Boolean,collapsed:e.Boolean}),W=e.Struct({cards:e.Array(H),groups:e.Array(U),groupByCardId:e.Record(e.String,e.String),unsortedPinned:e.Boolean,unsortedCollapsed:e.Boolean,recents:e.Array(e.String),lastCheck:e.NullOr(P),lastProbe:e.NullOr(L),lastScanAtIso:e.NullOr(e.String),supportsReparse:e.optional(e.Boolean)}),G={cards:[],groups:[],groupByCardId:{},unsortedPinned:!0,unsortedCollapsed:!1,recents:[],lastCheck:null,lastProbe:null,lastScanAtIso:null,supportsReparse:!0},K=e.Union([e.Struct({op:e.Literal(`create`),groupId:e.String,name:e.String}),e.Struct({op:e.Literal(`rename`),groupId:e.String,name:e.String}),e.Struct({op:e.Literal(`delete`),groupId:e.String,deleteCards:e.Boolean}),e.Struct({op:e.Literal(`reorder`),activeId:e.String,overId:e.String}),e.Struct({op:e.Literal(`move`),groupId:e.String,direction:e.Literals([`up`,`down`,`top`])}),e.Struct({op:e.Literal(`togglePinned`),groupId:e.String}),e.Struct({op:e.Literal(`toggleCollapsed`),groupId:e.String}),e.Struct({op:e.Literal(`toggleUnsortedPinned`)}),e.Struct({op:e.Literal(`toggleUnsortedCollapsed`)}),e.Struct({op:e.Literal(`moveCardToGroup`),cardId:e.String,groupId:e.NullOr(e.String)})]);export{_ as A,s as B,k as C,x as D,b as E,l as F,u as H,m as I,f as L,p as M,o as N,d as O,n as P,g as R,D as S,S as T,r as U,t as V,c as W,z as _,W as a,E as b,P as c,N as d,M as f,R as g,F as h,K as i,v as j,y as k,j as l,I as m,H as n,U as o,L as p,B as r,G as s,V as t,T as u,w as v,C as w,O as x,A as y,a as z};
@@ -0,0 +1 @@
1
+ let e=()=>{let e=globalThis.process?.env;return e&&e.VITEST?`en`:`ru`};const t=t=>{e=t};function n(t,n){return e()===`en`?t:n}function r(t,n,r){return(e()===`en`?t:n).replace(/\{(\d+)\}/g,(e,t)=>String(r[Number(t)]))}const i=()=>n(`en`,`ru`)===`en`?`en-GB`:`ru-RU`,a=e=>({state:e,removedCardIds:[]}),o=(e,t)=>({state:{...e,groups:t},removedCardIds:[]}),s=(e,t,n)=>{let r=[...e],[i]=r.splice(t,1);return i===void 0?e:(r.splice(n,0,i),r)};function c(e,t){switch(t.op){case`create`:return e.groups.some(e=>e.id===t.groupId)?a(e):o(e,[...e.groups,{id:t.groupId,name:t.name,pinned:!1,collapsed:!1}]);case`rename`:return e.groups.some(e=>e.id===t.groupId)?o(e,e.groups.map(e=>e.id===t.groupId?{...e,name:t.name}:e)):a(e);case`delete`:{if(!e.groups.some(e=>e.id===t.groupId))return a(e);let n=Object.entries(e.groupByCardId).filter(([,e])=>e===t.groupId).map(([e])=>e),r=Object.fromEntries(Object.entries(e.groupByCardId).filter(([,e])=>e!==t.groupId));return{state:{...e,groups:e.groups.filter(e=>e.id!==t.groupId),groupByCardId:r},removedCardIds:t.deleteCards?n:[]}}case`reorder`:{let n=e.groups.findIndex(e=>e.id===t.activeId),r=e.groups.findIndex(e=>e.id===t.overId);return n<0||r<0||n===r?a(e):o(e,s(e.groups,n,r))}case`move`:{let n=e.groups.findIndex(e=>e.id===t.groupId);if(n<0)return a(e);let r=t.direction===`top`?0:t.direction===`up`?Math.max(0,n-1):Math.min(e.groups.length-1,n+1);return r===n?a(e):o(e,s(e.groups,n,r))}case`togglePinned`:{let n=e.groups.find(e=>e.id===t.groupId);return n===void 0?a(e):n.pinned?o(e,e.groups.map(e=>e.id===t.groupId?{...e,pinned:!1}:e)):o(e,[{...n,pinned:!0},...e.groups.filter(e=>e.id!==t.groupId)])}case`toggleCollapsed`:return e.groups.some(e=>e.id===t.groupId)?o(e,e.groups.map(e=>e.id===t.groupId?{...e,collapsed:!e.collapsed}:e)):a(e);case`toggleUnsortedPinned`:return{state:{...e,unsortedPinned:!e.unsortedPinned},removedCardIds:[]};case`toggleUnsortedCollapsed`:return{state:{...e,unsortedCollapsed:!e.unsortedCollapsed},removedCardIds:[]};case`moveCardToGroup`:if(t.groupId===null){let{[t.cardId]:n,...r}=e.groupByCardId;return{state:{...e,groupByCardId:r},removedCardIds:[]}}return e.groups.some(e=>e.id===t.groupId)?{state:{...e,groupByCardId:{...e.groupByCardId,[t.cardId]:t.groupId}},removedCardIds:[]}:a(e);default:return a(e)}}const l=e=>e.startsWith(`#`)?e.toUpperCase():e,u=(e,t)=>Math.min(1,Math.max(0,e*t)),d=1e3;function f(e){return/^#[0-9a-fA-F]{6}$/.test(e)?[Number.parseInt(e.slice(1,3),16),Number.parseInt(e.slice(3,5),16),Number.parseInt(e.slice(5,7),16)]:null}function p(e,t){let n=Math.round(Math.min(1,Math.max(0,t))*d)/d;if(n>=1)return e;let r=f(e);return r===null?e:`rgba(${String(r[0])}, ${String(r[1])}, ${String(r[2])}, ${String(n)})`}function m(e){let t=[],n=(e,r,i,a)=>{t.push({node:e,parent:r,depth:i,isLast:a});let o=e.children??[];o.forEach((t,r)=>n(t,e,i+1,r===o.length-1))};return n(e,null,0,!0),t}function h(e,t){if(e.id===t)return e;for(let n of e.children??[]){let e=h(n,t);if(e!==null)return e}return null}function g(e,t){if(e.id===t)return[e];for(let n of e.children??[]){let r=g(n,t);if(r.length>0)return[e,...r]}return[]}function _(e,t){let n=g(e,t);return n.length>=2?n[n.length-2]??null:null}function v(e,t){return t===null?{x:0,y:0}:{x:e.x-t.x,y:e.y-t.y}}const y=e=>e.reduce((e,t)=>t>e?t:e,-1/0),b=e=>e.reduce((e,t)=>t<e?t:e,1/0);function x(e){return m(e).length}function S(e){return y(m(e).map(e=>e.depth))+1}function C(e){let t=e.children??[];if(t.length===0)return null;let n=b(t.map(e=>e.x)),r=b(t.map(e=>e.y)),i=y(t.map(e=>e.x+e.width)),a=y(t.map(e=>e.y+e.height));return{top:Math.round(r-e.y),right:Math.round(e.x+e.width-i),bottom:Math.round(e.y+e.height-a),left:Math.round(n-e.x)}}function w(e){let t=e.children??[];if(t.length<2)return null;let n=e.layout?.mode,r=y(t.map(e=>e.x+e.width))-b(t.map(e=>e.x)),i=y(t.map(e=>e.y+e.height))-b(t.map(e=>e.y)),a=n===`horizontal`?`x`:n===`vertical`?`y`:r>=i?`x`:`y`,o=[...t].sort((e,t)=>a===`x`?e.x-t.x:e.y-t.y),s=[];for(let e=1;e<o.length;e+=1){let t=o[e-1],n=o[e],r=a===`x`?n.x-(t.x+t.width):n.y-(t.y+t.height);if(r<0)return null;s.push(Math.round(r))}return{axis:a,gaps:s}}function T(e){let t=new Map,n=(e,n,r)=>{let i=l(e),a=t.get(i)??{usedBy:[],seen:new Set,kinds:new Set};a.seen.has(n)||(a.seen.add(n),a.usedBy.push(n)),a.kinds.add(r),t.set(i,a)};for(let{node:t}of m(e))t.fill!==void 0&&n(t.fill,t.name,`fill`),t.textColor!==void 0&&n(t.textColor,t.name,`text`);return[...t.entries()].map(([e,t])=>({color:e,usedBy:t.usedBy,kinds:[...t.kinds]}))}function E(e){let t=new Map;for(let{node:n}of m(e)){if(n.font?.family===void 0)continue;let e=`${n.font.family}|${n.font.style??``}|${String(n.font.size??``)}`,r=t.get(e)??{font:n.font,count:0};r.count+=1,t.set(e,r)}return[...t.values()]}function D(e){let t=x(e),n=S(e),r=t+n*3;return{band:r<25?`simple`:r<60?`medium`:`complex`,filled:Math.min(5,Math.max(1,Math.ceil(r/16))),layers:t,depth:n}}const O={Thin:100,Light:300,Regular:400,Medium:500,Semibold:600,Bold:700,Black:900},k=e=>(e===void 0?void 0:O[e])??400,A=/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g,j=/[\uD800-\uDBFF](?![\uDC00-\uDFFF])/g,M=/(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g;function N(e){return e.replaceAll(A,``).replaceAll(j,`�`).replaceAll(M,`�`).replaceAll(`&`,`&amp;`).replaceAll(`<`,`&lt;`).replaceAll(`>`,`&gt;`).replaceAll(`"`,`&quot;`)}const P=/[^a-zA-Z0-9]+/g;function F(e){return e.replace(P,`-`)}function I(e,t,n){let r=`${t}\0${e}`,i=n.forward.get(r);if(i!==void 0)return i;let a=`${t}-${F(e)}`,o=a,s=2;for(;n.reverse.has(o)&&n.reverse.get(o)!==r;)o=`${a}-${s}`,s++;return n.forward.set(r,o),n.reverse.set(o,r),o}const L=/^[\t\n\r ]+|[\t\n\r ]+$/g;function R(e,t,n){let r=e.rotation;return r===void 0||r===0||(e.children??[]).length>0?``:` transform="rotate(${r} ${t+e.width/2} ${n+e.height/2})"`}function z(e,t,n){let r=[];e.opacity!==void 0&&e.opacity<1&&r.push(`opacity="${e.opacity}"`),e.blendMode===`multiply`&&r.push(`style="mix-blend-mode:multiply"`);let i=R(e,t,n);return i!==``&&r.push(i.trimStart()),r.length>0?` ${r.join(` `)}`:``}function B(e,t,n){let r=e.text??``;if(r===``)return``;let i=e.font?.size??12,a=n+((e.textMeta?.lineHeightPx??Math.round(i*1.4))-i)/2+i*.82,o=k(e.font?.style),s=e.textMeta?.letterSpacing,c=s===void 0?e.textMeta?.letterSpacingPx==null?null:`${e.textMeta.letterSpacingPx}px`:s.unit===`%`?`${(s.value/100*i).toFixed(2)}px`:`${s.value}px`,l=e.textMeta?.upperCase===!0?r.toUpperCase():r,u=e.textMeta?.textAlign,d=u===`center`?`middle`:u===`right`?`end`:null,f=u===`center`?t+e.width/2:u===`right`?t+e.width:t;return`<text ${[`x="${String(f)}"`,d===null?``:`text-anchor="${d}"`,`y="${a.toFixed(1)}"`,`font-family="${N(e.font?.family??`system-ui`)}, system-ui, sans-serif"`,`font-size="${i}"`,o===400?``:`font-weight="${o}"`,`fill="${N(e.textColor??`#000000`)}"`,c===null?``:`letter-spacing="${c}"`].filter(Boolean).join(` `)}${z(e,t,n)}>${N(l.replace(L,``))}</text>`}function V(e,t){let n=e.gradient;if(n===void 0)return null;let r=n.stops.map(e=>`<stop offset="${e.position}" stop-color="${N(e.color)}"${e.alpha<1?` stop-opacity="${e.alpha}"`:``}/>`).join(``);return`<linearGradient id="${I(e.id,`grad`,t)}" x1="${n.x1}" y1="${n.y1}" x2="${n.x2}" y2="${n.y2}">${r}</linearGradient>`}function H(e,t){let n=[];return n.push(e.gradient===void 0?`fill="${N(e.fill??`none`)}"`:`fill="url(#${I(e.id,`grad`,t)})"`),e.stroke!==void 0&&e.borders===void 0&&(n.push(`stroke="${N(e.stroke.color)}"`,`stroke-width="${e.stroke.weight}"`),e.stroke.dashed===!0&&n.push(`stroke-dasharray="4 3"`)),n.join(` `)}function U(e,t,n){let r=e.borders;if(r===void 0)return[];let i=N(r.color??e.stroke?.color??`#000000`),a=t+e.width,o=n+e.height,s=(e,t,n,r,a)=>e===void 0?[]:[`<line x1="${t}" y1="${n}" x2="${r}" y2="${a}" stroke="${i}" stroke-width="${e}"/>`];return[...s(r.top,t,n,a,n),...s(r.right,a,n,a,o),...s(r.bottom,t,o,a,o),...s(r.left,t,n,t,o)]}function W(e,t,n){let r=e.radii,i=(e,t)=>t<=0?1/0:e/t,a=Math.max(0,r.topLeft),o=Math.max(0,r.topRight),s=Math.max(0,r.bottomRight),c=Math.max(0,r.bottomLeft),l=Math.min(1,i(e.width,a+o),i(e.height,o+s),i(e.width,s+c),i(e.height,c+a)),u=a*l,d=o*l,f=s*l,p=c*l,m=t+e.width,h=n+e.height;return[`M${t+u},${n}`,`H${m-d}`,d>0?`A${d},${d} 0 0 1 ${m},${n+d}`:``,`V${h-f}`,f>0?`A${f},${f} 0 0 1 ${m-f},${h}`:``,`H${t+p}`,p>0?`A${p},${p} 0 0 1 ${t},${h-p}`:``,`V${n+u}`,u>0?`A${u},${u} 0 0 1 ${t+u},${n}`:``,`Z`].filter(Boolean).join(` `)}const G=e=>e.mask===!0||e.type===`mask`;function K(e,t,n){return e.type===`ellipse`?`<ellipse cx="${t+e.width/2}" cy="${n+e.height/2}" rx="${e.width/2}" ry="${e.height/2}"/>`:e.radii===void 0?`<rect x="${t}" y="${n}" width="${e.width}" height="${e.height}" rx="${e.radius??0}"/>`:`<path d="${W(e,t,n)}"/>`}function q(e,t,n,r,i){if(e.hidden===!0)return``;let a=e.x+t,o=e.y+n,s=[],c=V(e,i);if(c!==null&&r.push(c),G(e))r.push(`<clipPath id="${I(e.id,`clip`,i)}">${K(e,a,o)}</clipPath>`);else switch(e.type){case`ellipse`:s.push(`<ellipse cx="${a+e.width/2}" cy="${o+e.height/2}" rx="${e.width/2}" ry="${e.height/2}" ${H(e,i)}${z(e,a,o)}/>`);break;case`line`:s.push(`<line x1="${a}" y1="${o+e.height/2}" x2="${a+e.width}" y2="${o+e.height/2}" stroke="${N(e.stroke?.color??e.fill??`#000000`)}" stroke-width="${e.stroke?.weight??1}"${e.stroke?.dashed===!0?` stroke-dasharray="4 3"`:``}${z(e,a,o)}/>`);break;case`text`:case`paragraph`:case`span`:(e.children??[]).length===0&&s.push(B(e,a,o));break;default:e.fill!==void 0||e.stroke!==void 0||e.borders!==void 0?s.push(e.radii===void 0?`<rect x="${a}" y="${o}" width="${e.width}" height="${e.height}" rx="${e.radius??0}" ${H(e,i)}${z(e,a,o)}/>`:`<path d="${W(e,a,o)}" ${H(e,i)}${z(e,a,o)}/>`,...U(e,a,o)):(e.type===`instance`||e.type===`symbol`||e.type===`vector`)&&(e.children??[]).length===0&&s.push(`<rect x="${a}" y="${o}" width="${e.width}" height="${e.height}" rx="${Math.min(4,e.width/4)}" fill="none" stroke="#9096A9" stroke-opacity="0.45" stroke-dasharray="3 2"/>`)}let l=e.children??[],u=l.find(G),d=(e.layout?.reverse===!0?[...l].reverse():l).map(e=>q(e,t,n,r,i)).join(``);return u!==void 0&&l.length>1?s.push(`<g clip-path="url(#${I(u.id,`clip`,i)})">${d}</g>`):s.push(d),s.join(``)}function J(e){let t=[],n={forward:new Map,reverse:new Map},r=q(e,-e.x,-e.y,t,n),i=Math.max(1,e.width),a=Math.max(1,e.height);return`<svg xmlns="http://www.w3.org/2000/svg" width="${i}" height="${a}" viewBox="0 0 ${i} ${a}">${t.length>0?`<defs>${t.join(``)}</defs>`:``}${r}</svg>`}export{i as C,t as S,l as _,D as a,n as b,h as c,m as d,w as f,p as g,v as h,k as i,_ as l,C as m,F as n,T as o,S as p,O as r,E as s,J as t,g as u,u as v,r as x,c as y};