@asymmetric-effort/specifyjs 0.2.169 → 0.2.171
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/dist/esm/components-barrel.js +732 -541
- package/dist/specifyjs-components.cjs.js +3 -3
- package/dist/specifyjs-components.esm.js +732 -541
- package/dist/types/components/page/ide/src/CodeEditor.d.ts +16 -0
- package/dist/types/components/page/ide/src/FileExplorer.d.ts +29 -0
- package/dist/types/components/page/ide/src/MenuBar.d.ts +19 -0
- package/dist/types/components/page/ide/src/Minimap.d.ts +16 -0
- package/dist/types/components/page/ide/src/StatusBar.d.ts +18 -0
- package/dist/types/components/page/ide/src/SyntaxHighlighter.d.ts +26 -0
- package/dist/types/components/page/ide/src/TabBar.d.ts +15 -0
- package/dist/types/components/page/ide/src/TitleBar.d.ts +12 -0
- package/dist/types/components/page/ide/src/index.d.ts +17 -0
- package/dist/types/core/src/components-barrel.d.ts +6 -0
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE */
|
|
2
|
-
"use strict";var Nt=Object.defineProperty;var Ws=Object.getOwnPropertyDescriptor;var _s=Object.getOwnPropertyNames;var Os=Object.prototype.hasOwnProperty;var Hs=(e,t,n)=>t in e?Nt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ys=(e,t)=>{for(var n in t)Nt(e,n,{get:t[n],enumerable:!0})},Vs=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of _s(t))!Os.call(e,i)&&i!==n&&Nt(e,i,{get:()=>t[i],enumerable:!(r=Ws(t,i))||r.enumerable});return e};var Us=e=>Vs(Nt({},"__esModule",{value:!0}),e);var Qe=(e,t,n)=>Hs(e,typeof t!="symbol"?t+"":t,n);var Mu={};Ys(Mu,{Accordion:()=>cr,Alert:()=>Co,AnalogClock:()=>co,AppContextProvider:()=>rt,Avatar:()=>fo,Badge:()=>go,BarGraph:()=>Ar,BigNumber:()=>Qi,BlochSphere:()=>es,BoxPlot:()=>ts,Breadcrumb:()=>dr,BubbleChart:()=>os,Button:()=>qi,CalendarHeatMap:()=>ss,Card:()=>Xo,Carousel:()=>ir,CartesianGraph2D:()=>Or,Checkbox:()=>$o,ChordDiagram:()=>as,ColorPicker:()=>Do,ColorWheel:()=>zo,ComplexGraph2D:()=>Ur,ContextMenu:()=>Ut,DataGrid:()=>xo,DatePicker:()=>Bo,DecompositionTree:()=>ls,DigitalClock:()=>yo,DiscreteCartesian2D:()=>Ns,DragDropProvider:()=>Dt,Drawer:()=>Er,Dropdown:()=>pr,EmptyState:()=>Mo,FileUpload:()=>Fo,FlexContainer:()=>qo,FlexItem:()=>Ko,Footer:()=>ri,ForceGraph:()=>ps,FormFieldWrapper:()=>De,FunnelChart:()=>gs,GanttChart:()=>bs,Gauge:()=>ys,GoogleAnalytics:()=>oi,Grid:()=>Zo,GridItem:()=>Jo,HeatMap:()=>vs,Histogram:()=>ws,HypercubeGraph:()=>ei,IDE:()=>Kt,Image:()=>sr,LineGraph:()=>qr,ListView:()=>So,LollipopChart:()=>ks,Matrix:()=>Cs,Menubar:()=>gr,MessageBusProvider:()=>$t,Modal:()=>Ir,MultilineField:()=>No,NavWrapper:()=>_e,NumberSpinner:()=>Wo,Pagination:()=>hr,Panel:()=>er,Partition:()=>Ms,PieGraph:()=>Kr,PivotTable:()=>Is,PolarGraph2D:()=>Jr,Popover:()=>Pr,ProgressBar:()=>Eo,RadarChart:()=>Rs,RadioGroup:()=>_o,SankeyDiagram:()=>Ps,ScrollContainer:()=>nr,Select:()=>Oo,Sidebar:()=>xr,Skeleton:()=>Io,Slider:()=>Ho,Spinner:()=>Po,Splitter:()=>or,Stepper:()=>yr,Sunburst:()=>$s,Tabs:()=>rr,Tag:()=>vo,TextEditor:()=>Yo,TextField:()=>Vo,ThreeDLayers:()=>Ji,TimePicker:()=>Uo,ToastContainer:()=>Sn,Toggle:()=>jo,Toolbar:()=>vr,Tooltip:()=>Tr,TradingDashboard:()=>Qt,TreeMap:()=>Ds,TreeNav:()=>Cr,TreeNode:()=>xt,USStateMap:()=>Ss,US_STATE_PATHS:()=>Bt,UnityApp:()=>ji,UnityDesktop:()=>Ui,VectorField:()=>Ls,VideoPlayer:()=>lr,VirtualScroll:()=>wo,VizWrapper:()=>ni,WaterfallChart:()=>Bs,WordCloud:()=>Fs,WordProcessor:()=>qt,applyGate:()=>Gn,blochToCartesian:()=>Et,buildInputStyle:()=>je,buildNavItemStyle:()=>bt,buildRotationMatrix:()=>In,cartesianToBloch:()=>on,computeBoxStats:()=>qn,computeMandelbrotGrid:()=>Vr,computeSlices:()=>Cn,createToaster:()=>yn,describeArc:()=>kn,generateEdges:()=>En,generateHypercube:()=>It,generatePalette:()=>Xt,generateVertices:()=>Mn,numRotationAngles:()=>Rt,projectTo2D:()=>Pn,transformVec:()=>Rn,useAppId:()=>vt,useBarGraphScales:()=>vn,useChannel:()=>Tt,useDragDrop:()=>ut,useDraggable:()=>An,useDropZone:()=>zt,useHover:()=>Be,useHypercube:()=>ti,useLineGraphScales:()=>wn,useMessageBus:()=>it,useToast:()=>$r});module.exports=Us(Mu);var Wt=Symbol.for("spec.element"),js=Symbol.for("spec.fragment"),Iu=Symbol.for("spec.portal"),no=Symbol.for("spec.provider"),oo=Symbol.for("spec.consumer"),Gs=Symbol.for("spec.forward_ref"),Xs=Symbol.for("spec.memo"),qs=Symbol.for("spec.lazy"),Ks=Symbol.for("spec.suspense"),Zs=Symbol.for("spec.strict_mode"),Js=Symbol.for("spec.profiler");function o(e,t,...n){let r=null,i=null,s={};if(t!=null){t.key!==void 0&&(r=""+t.key),t.ref!==void 0&&(i=t.ref);for(let a in t)Object.prototype.hasOwnProperty.call(t,a)&&a!=="key"&&a!=="ref"&&a!=="__proto__"&&a!=="constructor"&&a!=="prototype"&&(s[a]=t[a])}if(n.length===1?s.children=n[0]:n.length>1&&(s.children=n),typeof e=="function"&&e.defaultProps){let a=e.defaultProps;for(let l of Object.keys(a))l!=="__proto__"&&l!=="constructor"&&s[l]===void 0&&(s[l]=a[l])}return{$$typeof:Wt,type:e,props:s,key:r,ref:i}}function Ue(e){let t={$$typeof:Symbol.for("spec.context"),Provider:null,Consumer:null,_currentValue:e,_defaultValue:e},n={$$typeof:no,_context:t},r={$$typeof:oo,_context:t};return t.Provider=n,t.Consumer=r,t}var mt=class{constructor(t){this._fiber=null;this._pendingState=[];this._forceUpdate=!1;this.props=t,this.state={},this.context=void 0}setState(t,n){this._pendingState.push(t),this._enqueueUpdate(n)}forceUpdate(t){this._forceUpdate=!0,this._enqueueUpdate(t)}render(){return null}_enqueueUpdate(t){}};mt.prototype.isSpecComponent=!0;var _t=class extends mt{shouldComponentUpdate(t,n){return!io(this.props,t)||!io(this.state,n)}};_t.prototype.isPureSpecComponent=!0;function io(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;let i=e,s=t;for(let a of n)if(!Object.prototype.hasOwnProperty.call(s,a)||!Object.is(i[a],s[a]))return!1;return!0}var so=null;function nt(){if(so===null)throw new Error("Invalid hook call. Hooks can only be called inside the body of a function component.");return so}function j(e){return nt().useState(e)}function re(e,t){return nt().useEffect(e,t)}function Ye(e){return nt().useContext(e)}function pn(e,t,n){return nt().useReducer(e,t,n)}function S(e,t){return nt().useCallback(e,t)}function q(e,t){return nt().useMemo(e,t)}function ne(e){return nt().useRef(e)}function Ce(){return nt().useId()}var ht=Ue({pathname:"/",params:{},navigate:()=>{throw new Error("useNavigate must be used inside a <Router> component.")},basePath:""});function ao(){let t=(typeof window<"u"?window.location.hash:"").replace(/^#\/?/,"/");return t===""?"/":t}var ea={pathname:ao(),hash:typeof window<"u"?window.location.hash:""},ta=new Set;function na(){ea={pathname:ao(),hash:typeof window<"u"?window.location.hash:""};for(let e of ta)e()}typeof window<"u"&&window.addEventListener("hashchange",na);var df=Ue({flags:{},isEnabled:()=>!1,setFlag:()=>{},loading:!1});function lo(e){if(!e)return new Date;let n=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(new Date),r=i=>Number(n.find(s=>s.type===i)?.value??0);return new Date(r("year"),r("month")-1,r("day"),r("hour"),r("minute"),r("second"))}function fa(e,t){let n=e.getFullYear(),r=e.getMonth(),i=e.getDate();switch(t){case"short":{let s=String(r+1).padStart(2,"0"),a=String(i).padStart(2,"0");return`${s}/${a}/${n}`}case"long":return`${["January","February","March","April","May","June","July","August","September","October","November","December"][r]} ${String(i).padStart(2,"0")}, ${n}`;case"iso":{let s=String(r+1).padStart(2,"0"),a=String(i).padStart(2,"0");return`${n}-${s}-${a}`}}}var qe={face:"#f8fafc",border:"#334155",hand:"#1e293b",second:"#ef4444",numbers:"#374151"};function co(e){let{format:t="12h",size:n=200,showDate:r=!1,dateFormat:i="short",showSeconds:s=!0,timezone:a,className:l}=e,[d,u]=j(lo(a));re(()=>{let I=setInterval(()=>{u(lo(a))},1e3);return()=>clearInterval(I)},[a]);let h=d.getHours(),g=d.getMinutes(),c=d.getSeconds(),p=h%12*30+g*.5,f=g*6+c*.1,y=c*6,b=n/2,m=n/2,x=n/2-10,v=x-4,D=x-22,A=[];A.push(o("circle",{cx:String(b),cy:String(m),r:String(x),fill:qe.face,stroke:qe.border,"stroke-width":"3"}));for(let I=0;I<12;I++){let B=(I*30-90)*Math.PI/180,E=v-6;A.push(o("line",{x1:String(b+E*Math.cos(B)),y1:String(m+E*Math.sin(B)),x2:String(b+v*Math.cos(B)),y2:String(m+v*Math.sin(B)),stroke:qe.border,"stroke-width":"2"}));let N=String(I===0?12:I);if(A.push(o("text",{x:String(b+D*Math.cos(B)),y:String(m+D*Math.sin(B)),"text-anchor":"middle","dominant-baseline":"central",fill:qe.numbers,"font-size":String(n*.08),"font-family":"sans-serif","font-weight":"600"},N)),t==="24h"){let z=x-38,k=String(I===0?0:I+12);A.push(o("text",{x:String(b+z*Math.cos(B)),y:String(m+z*Math.sin(B)),"text-anchor":"middle","dominant-baseline":"central",fill:qe.numbers,"font-size":String(n*.055),"font-family":"sans-serif",opacity:"0.6"},k))}}let M=(I,P,B,E)=>{let N=(I-90)*Math.PI/180;return o("line",{x1:String(b),y1:String(m),x2:String(b+P*Math.cos(N)),y2:String(m+P*Math.sin(N)),stroke:E,"stroke-width":B,"stroke-linecap":"round"})};A.push(M(p,x*.5,"4",qe.hand)),A.push(M(f,x*.75,"3",qe.hand)),s&&A.push(M(y,x*.85,"1.5",qe.second)),A.push(o("circle",{cx:String(b),cy:String(m),r:"4",fill:qe.hand}));let L=[o("svg",{width:String(n),height:String(n),viewBox:`0 0 ${n} ${n}`,xmlns:"http://www.w3.org/2000/svg"},...A)];return r&&L.push(o("div",{style:{textAlign:"center",marginTop:"8px",fontFamily:"sans-serif",fontSize:"14px",color:qe.numbers}},fa(d,i))),o("div",{className:l,style:{display:"inline-flex",flexDirection:"column",alignItems:"center"}},...L)}var gn={xs:24,sm:32,md:40,lg:56,xl:80};function ga(e){return e==null?gn.md:typeof e=="number"?e:gn[e]??gn.md}function ma(e){if(!e)return"?";let t=e.trim().split(/\s+/);return t.length===1?t[0].charAt(0).toUpperCase():(t[0].charAt(0)+t[t.length-1].charAt(0)).toUpperCase()}var uo=["#3b82f6","#ef4444","#22c55e","#a855f7","#f97316","#ec4899","#14b8a6","#6366f1","#eab308","#06b6d4"];function ha(e){if(!e)return"#9ca3af";let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return uo[Math.abs(t)%uo.length]}var po={online:"#22c55e",offline:"#9ca3af",busy:"#ef4444",away:"#eab308"};function ba(e,t){let n=`${-t/4}px`;switch(e){case"top-left":return{top:n,left:n};case"bottom-right":return{bottom:n,right:n};case"bottom-left":return{bottom:n,left:n};case"top-right":default:return{top:n,right:n}}}function fo(e){let{src:t,alt:n,name:r,size:i,shape:s="circle",fallbackColor:a,status:l,statusPosition:d="bottom-right"}=e,[u,h]=j(!1),g=ga(i),c=s==="circle"?"50%":`${Math.round(g*.15)}px`,p=a??ha(r),f=`${Math.round(g*.4)}px`,y={position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:`${g}px`,height:`${g}px`,borderRadius:c,overflow:"hidden",flexShrink:"0"},b;if(t&&!u)b=o("img",{src:t,alt:n??r??"avatar",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"},onError:()=>h(!0)});else{let D=ma(r);b=o("span",{style:{fontSize:f,fontWeight:"600",color:"#fff",lineHeight:"1",userSelect:"none",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},"aria-hidden":"true"},D)}let m=o("div",{style:{...y,backgroundColor:t&&!u?"transparent":p},role:"img","aria-label":n??r??"avatar"},b);if(!l)return m;let x=Math.max(8,Math.round(g*.25)),v={position:"absolute",width:`${x}px`,height:`${x}px`,borderRadius:"50%",backgroundColor:po[l]??po.offline,border:"2px solid #fff",boxSizing:"border-box",...ba(d,x)};return o("div",{style:{position:"relative",display:"inline-flex",width:`${g}px`,height:`${g}px`,flexShrink:"0"}},m,o("span",{style:v,"aria-label":l}))}var xa={sm:{minWidth:"16px",height:"16px",fontSize:"10px",padding:"0 4px"},md:{minWidth:"20px",height:"20px",fontSize:"12px",padding:"0 6px"},lg:{minWidth:"24px",height:"24px",fontSize:"14px",padding:"0 8px"}},ya={sm:{width:"6px",height:"6px"},md:{width:"8px",height:"8px"},lg:{width:"10px",height:"10px"}};function go(e){let{count:t,max:n,dot:r=!1,color:i="#ef4444",size:s="md",variant:a="solid",children:l}=e,d=null;!r&&t!=null&&(d=n!=null&&t>n?`${n}+`:String(t));let u=r||t!=null&&t>0,h=r?{...ya[s],borderRadius:"50%",...a==="solid"?{backgroundColor:i}:{backgroundColor:"transparent",border:`2px solid ${i}`}}:{...xa[s],borderRadius:"9999px",display:"inline-flex",alignItems:"center",justifyContent:"center",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontWeight:"600",lineHeight:"1",boxSizing:"border-box",...a==="solid"?{backgroundColor:i,color:"#fff"}:{backgroundColor:"transparent",color:i,border:`2px solid ${i}`}},g=u?o("span",{style:h,"aria-label":r?"notification":`count ${d}`},d):null;if(l==null)return g??o("span",null);let c={...h,position:"absolute",top:"0",right:"0",transform:"translate(50%, -50%)",zIndex:"1"};return o("span",{style:{position:"relative",display:"inline-flex"}},l,u?o("span",{style:c,"aria-label":r?"notification":`count ${d}`},d):null)}var Sa={width:"100%",borderCollapse:"collapse",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",color:"#1f2937"},mo={padding:"10px 12px",textAlign:"left",fontWeight:"600",backgroundColor:"#f9fafb",borderBottom:"2px solid #e5e7eb",userSelect:"none",whiteSpace:"nowrap"},mn={padding:"10px 12px",borderBottom:"1px solid #e5e7eb"},va="6px 8px",wa={marginLeft:"4px",fontSize:"12px",color:"#6b7280"},ka={width:"100%",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",boxSizing:"border-box"},Ca={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",fontSize:"13px",color:"#6b7280"},ct={padding:"4px 10px",margin:"0 2px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#fff",cursor:"pointer",fontSize:"13px"},Ma={...ct,backgroundColor:"#3b82f6",color:"#fff",borderColor:"#3b82f6"},ho={...ct,opacity:"0.5",cursor:"default"},bo={cursor:"pointer",width:"16px",height:"16px"};function Ea(e,t,n){return e!==t?"\u2195":n==="asc"?"\u2191":"\u2193"}function xo(e){let{columns:t,data:n,pageSize:r,currentPage:i,onPageChange:s,sortBy:a,sortDir:l,onSort:d,selectable:u=!1,selectedRows:h,onSelectionChange:g,striped:c=!1,bordered:p=!1,compact:f=!1,stickyHeader:y=!1}=e,[b,m]=j(0),[x,v]=j(void 0),[D,A]=j("asc"),[M,T]=j([]),[L,I]=j({}),P=i??b,B=a??x,E=l??D,N=h??M,z=q(()=>{let J=Object.entries(L).filter(([,se])=>se.length>0);return J.length===0?n:n.filter(se=>J.every(([le,fe])=>String(se[le]??"").toLowerCase().includes(fe.toLowerCase())))},[n,L]),k=q(()=>{if(!B)return z;let J=[...z];return J.sort((se,le)=>{let fe=se[B],oe=le[B];if(fe==null&&oe==null)return 0;if(fe==null)return 1;if(oe==null)return-1;if(typeof fe=="number"&&typeof oe=="number")return E==="asc"?fe-oe:oe-fe;let me=String(fe),he=String(oe),te=me.localeCompare(he);return E==="asc"?te:-te}),J},[z,B,E]),w=k.length,$=r?Math.max(1,Math.ceil(w/r)):1,C=r?k.slice(P*r,(P+1)*r):k,F=S(J=>{s?s(J):m(J)},[s]),R=S(J=>{let se=B===J&&E==="asc"?"desc":"asc";d?d(J,se):(v(J),A(se))},[B,E,d]),W=S(J=>{let se=N.includes(J)?N.filter(le=>le!==J):[...N,J];g?g(se):T(se)},[N,g]),_=S(()=>{let J=C.map((fe,oe)=>r?P*r+oe:oe),le=J.every(fe=>N.includes(fe))?N.filter(fe=>!J.includes(fe)):[...new Set([...N,...J])];g?g(le):T(le)},[C,N,r,P,g]),O=S((J,se)=>{I(le=>({...le,[J]:se})),F(0)},[F]),V=t.some(J=>J.filterable),X=f?va:mn.padding,ee=[];if(u){let J=C.map((le,fe)=>r?P*r+fe:fe),se=J.length>0&&J.every(le=>N.includes(le));ee.push(o("th",{key:"__select_all",style:{...mo,padding:X,width:"40px",textAlign:"center",...y?{position:"sticky",top:"0",zIndex:"2"}:{}}},o("input",{type:"checkbox",checked:se,onChange:_,style:bo,"aria-label":"Select all rows"})))}for(let J of t){let se={...mo,padding:X,...J.width?{width:J.width}:{},...J.sortable?{cursor:"pointer"}:{},...p?{border:"1px solid #e5e7eb"}:{},...y?{position:"sticky",top:"0",zIndex:"2"}:{}},le=[J.header];J.sortable&&le.push(o("span",{style:wa},Ea(J.key,B,E))),ee.push(o("th",{key:J.key,style:se,onClick:J.sortable?()=>R(J.key):void 0,onKeyDown:J.sortable?fe=>{let oe=fe.key;(oe==="Enter"||oe===" ")&&(fe.preventDefault(),R(J.key))}:void 0,tabIndex:J.sortable?0:void 0,role:J.sortable?"columnheader":void 0,"aria-sort":B===J.key?E==="asc"?"ascending":"descending":void 0},...le))}let Z=null;if(V){let J=[];u&&J.push(o("th",{key:"__filter_spacer",style:{padding:X}}));for(let se of t)J.push(o("th",{key:`filter_${se.key}`,style:{padding:"4px 8px",backgroundColor:"#f9fafb"}},se.filterable?o("input",{type:"text",placeholder:`Filter ${se.header}...`,style:ka,value:L[se.key]??"",onInput:le=>O(se.key,le.target.value),"aria-label":`Filter by ${se.header}`}):null));Z=o("tr",{key:"__filter_row"},...J)}let U=[];for(let J=0;J<C.length;J++){let se=C[J],le=r?P*r+J:J,fe=N.includes(le),oe={};c&&J%2===1&&(oe.backgroundColor="#f9fafb"),fe&&(oe.backgroundColor="#eff6ff");let me=[];u&&me.push(o("td",{key:"__select",style:{padding:X,textAlign:"center",...mn,...p?{border:"1px solid #e5e7eb"}:{}}},o("input",{type:"checkbox",checked:fe,onChange:()=>W(le),style:bo,"aria-label":`Select row ${le+1}`})));for(let he of t){let te=se[he.key],de=he.render?he.render(te,se):String(te??"");me.push(o("td",{key:he.key,style:{...mn,padding:X,...p?{border:"1px solid #e5e7eb"}:{}}},de))}U.push(o("tr",{key:String(le),style:oe},...me))}let G=null;if(r){let J=w===0?0:P*r+1,se=Math.min((P+1)*r,w),le=[];le.push(o("button",{key:"prev",style:P===0?ho:ct,onClick:P>0?()=>F(P-1):void 0,disabled:P===0,"aria-label":"Previous page"},"\u2190 Prev"));let fe=7,oe=Math.max(0,P-Math.floor(fe/2)),me=Math.min($,oe+fe);me-oe<fe&&(oe=Math.max(0,me-fe)),oe>0&&(le.push(o("button",{key:"p0",style:ct,onClick:()=>F(0)},"1")),oe>1&&le.push(o("span",{key:"e1",style:{margin:"0 4px"}},"...")));for(let he=oe;he<me;he++)le.push(o("button",{key:`p${he}`,style:he===P?Ma:ct,onClick:he!==P?()=>F(he):void 0,"aria-current":he===P?"page":void 0},String(he+1)));me<$&&(me<$-1&&le.push(o("span",{key:"e2",style:{margin:"0 4px"}},"...")),le.push(o("button",{key:`p${$-1}`,style:ct,onClick:()=>F($-1)},String($)))),le.push(o("button",{key:"next",style:P>=$-1?ho:ct,onClick:P<$-1?()=>F(P+1):void 0,disabled:P>=$-1,"aria-label":"Next page"},"Next \u2192")),G=o("div",{style:Ca},o("span",null,`Showing ${J}\u2013${se} of ${w}`),o("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},...le))}let Y={width:"100%",...y?{overflow:"auto",maxHeight:"600px"}:{}},H={...Sa,...p?{border:"1px solid #e5e7eb"}:{}},K=o("thead",null,o("tr",null,...ee),Z),Q=o("tbody",null,...U),ie=o("table",{style:H,role:"grid","aria-rowcount":String(w)},K,Q);return o("div",{style:Y},ie,G)}function dt(e){return e<10?`0${e}`:String(e)}function Ia(e,t){if(t){let r=new Intl.DateTimeFormat("en-US",{timeZone:t,hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}).formatToParts(e),i=s=>Number(r.find(a=>a.type===s)?.value??0);return{hours:i("hour"),minutes:i("minute"),seconds:i("second")}}return{hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()}}function Ra(e,t,n){if(n){let r={timeZone:n};if(t==="short")return Object.assign(r,{month:"2-digit",day:"2-digit",year:"numeric"}),new Intl.DateTimeFormat("en-US",r).format(e);if(t==="long")return Object.assign(r,{month:"long",day:"numeric",year:"numeric"}),new Intl.DateTimeFormat("en-US",r).format(e);Object.assign(r,{year:"numeric",month:"2-digit",day:"2-digit"});let i=new Intl.DateTimeFormat("en-CA",r).formatToParts(e),s=a=>i.find(l=>l.type===a)?.value??"";return`${s("year")}-${s("month")}-${s("day")}`}return t==="short"?`${dt(e.getMonth()+1)}/${dt(e.getDate())}/${e.getFullYear()}`:t==="long"?new Intl.DateTimeFormat("en-US",{month:"long",day:"numeric",year:"numeric"}).format(e):`${e.getFullYear()}-${dt(e.getMonth()+1)}-${dt(e.getDate())}`}var Pa={fontFamily:'"SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", "Courier New", monospace',backgroundColor:"#1e293b",color:"#e2e8f0",padding:"16px 24px",borderRadius:"8px",display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"4px"},$a={fontSize:"2rem",fontWeight:"600",letterSpacing:"2px",lineHeight:"1"},Ta={fontSize:"0.875rem",fontWeight:"400",marginLeft:"4px",verticalAlign:"super"},Da={fontSize:"0.75rem",color:"#94a3b8",marginTop:"4px"};function yo(e){let{format:t="12h",showDate:n=!1,dateFormat:r="short",showSeconds:i=!0,timezone:s,className:a}=e,[l,d]=j(new Date);re(()=>{let m=setInterval(()=>{d(new Date)},1e3);return()=>clearInterval(m)},[]);let{hours:u,minutes:h,seconds:g}=Ia(l,s),c,p=null;t==="12h"?(p=u>=12?"PM":"AM",c=u%12||12):c=u;let f=`${dt(c)}:${dt(h)}`;i&&(f+=`:${dt(g)}`);let y=[f];p!=null&&y.push(o("span",{style:Ta},p));let b=[o("span",{style:$a},...y)];return n&&b.push(o("span",{style:Da},Ra(l,r,s))),o("div",{style:Pa,...a?{class:a}:{}},...b)}var za={listStyle:"none",margin:"0",padding:"0",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px"},Aa={padding:"10px 14px",color:"var(--color-text, #1f2937)"},La={borderBottom:"1px solid var(--color-border, #e5e7eb)"},Ba={cursor:"pointer",transition:"background-color 0.15s ease"},Fa={backgroundColor:"var(--color-bg-muted, #eff6ff)"},Na={padding:"24px",textAlign:"center",color:"var(--color-text-muted, #9ca3af)",fontSize:"14px"},Ot={padding:"10px 14px",borderBottom:"1px solid var(--color-border, #e5e7eb)",backgroundColor:"var(--color-bg-subtle, #f9fafb)",fontWeight:"600",fontSize:"13px",color:"var(--color-text-muted, #6b7280)"};function So(e){let{items:t,renderItem:n,keyExtractor:r,divider:i=!1,hoverable:s=!1,selectedIndex:a,onSelect:l,emptyMessage:d="No items",header:u,footer:h}=e;if(t.length===0)return o("div",null,u?o("div",{style:Ot},u):null,o("div",{style:Na},d),h?o("div",{style:{...Ot,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},h):null);let g=[];for(let c=0;c<t.length;c++){let p=t[c],f=r(p,c),y=a===c,b=c===t.length-1,m={...Aa,...s?Ba:{},...y?Fa:{},...i&&!b?La:{}};g.push(o("li",{key:f,style:m,onClick:l?()=>l(c):void 0,onKeyDown:l?x=>{let v=x.key;(v==="Enter"||v===" ")&&(x.preventDefault(),l(c))}:void 0,role:l?"option":void 0,tabIndex:l?0:void 0,"aria-selected":l?String(y):void 0},n(p,c)))}return o("div",null,u?o("div",{style:Ot},u):null,o("ul",{style:za,role:l?"listbox":"list"},...g),h?o("div",{style:{...Ot,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},h):null)}function Wa(e){return e??"#3b82f6"}function _a(e,t){let r={red:"#ef4444",blue:"#3b82f6",green:"#22c55e",yellow:"#eab308",purple:"#a855f7",pink:"#ec4899",orange:"#f97316",gray:"#6b7280",indigo:"#6366f1",teal:"#14b8a6",cyan:"#06b6d4"}[e]??e,i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r);return i?`rgba(${parseInt(i[1],16)}, ${parseInt(i[2],16)}, ${parseInt(i[3],16)}, ${t})`:e}var Oa={sm:{fontSize:"11px",padding:"2px 8px",gap:"4px"},md:{fontSize:"13px",padding:"4px 10px",gap:"6px"},lg:{fontSize:"15px",padding:"6px 14px",gap:"8px"}};function Ha(e,t,n,r,i){let s=Oa[n],a={display:"inline-flex",alignItems:"center",gap:s.gap,borderRadius:"9999px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:s.fontSize,fontWeight:"500",padding:s.padding,lineHeight:"1.4",whiteSpace:"nowrap",border:"none",transition:"opacity 0.15s ease, filter 0.15s ease",...r?{cursor:"pointer"}:{},...i?{opacity:"0.5",cursor:"default",pointerEvents:"none"}:{}};switch(t){case"solid":return{...a,backgroundColor:e,color:"#fff",border:"none"};case"outline":return{...a,backgroundColor:"transparent",color:e,border:`1px solid ${e}`};case"subtle":return{...a,backgroundColor:_a(e,.12),color:e,border:"none"};default:return a}}var Ya={display:"inline-flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",padding:"0",marginLeft:"2px",cursor:"pointer",fontSize:"inherit",lineHeight:"1",opacity:"0.7",color:"inherit"};function vo(e){let{label:t,color:n,variant:r="subtle",size:i="md",removable:s=!1,onRemove:a,icon:l,onClick:d,disabled:u=!1}=e,h=Wa(n),g=Ha(h,r,i,!!d,u),c=[];return l&&c.push(o("span",{key:"icon",style:{display:"inline-flex",flexShrink:"0"}},l)),c.push(o("span",{key:"label"},t)),s&&c.push(o("button",{key:"remove",type:"button",style:Ya,onClick:p=>{p.stopPropagation(),!u&&a&&a()},"aria-label":`Remove ${t}`,disabled:u},"\xD7")),o("span",{style:g,role:d?"button":void 0,tabIndex:d&&!u?"0":void 0,onClick:!u&&d?d:void 0,onKeyDown:d&&!u?p=>{let f=p.key;(f==="Enter"||f===" ")&&(p.preventDefault(),d())}:void 0,"aria-disabled":u?"true":void 0},...c)}var Va={overflow:"auto",position:"relative",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'};function wo(e){let{items:t,renderItem:n,itemHeight:r,overscan:i=5,height:s}=e,[a,l]=j(0),d=ne(null),u=t.length*r,h=parseInt(s,10)||400,g=Math.ceil(h/r),c=Math.max(0,Math.floor(a/r)-i),p=Math.min(t.length,Math.floor(a/r)+g+i),f=S(b=>{let m=b.target;l(m.scrollTop)},[]),y=[];for(let b=c;b<p;b++)y.push(o("div",{key:String(b),style:{position:"absolute",top:`${b*r}px`,left:"0",right:"0",height:`${r}px`,overflow:"hidden"}},n(t[b],b)));return o("div",{ref:d,style:{...Va,height:s},onScroll:f},o("div",{style:{height:`${u}px`,position:"relative",width:"100%"}},...y))}var ko={info:{icon:"\u2139\uFE0F",bg:"#eff6ff",border:"#3b82f6",text:"#1e40af",filledBg:"#3b82f6",filledText:"#ffffff"},success:{icon:"\u2705",bg:"#f0fdf4",border:"#22c55e",text:"#166534",filledBg:"#22c55e",filledText:"#ffffff"},warning:{icon:"\u26A0\uFE0F",bg:"#fffbeb",border:"#f59e0b",text:"#92400e",filledBg:"#f59e0b",filledText:"#ffffff"},error:{icon:"\u274C",bg:"#fef2f2",border:"#ef4444",text:"#991b1b",filledBg:"#ef4444",filledText:"#ffffff"}};function Co(e){let[t,n]=j(!0),r=e.type??"info",i=e.variant??"subtle",s=ko[r]??ko.info,a=e.icon??s.icon,l=e.message??e.children,d=q(()=>{let u={display:"flex",alignItems:"flex-start",gap:"12px",padding:"12px 16px",borderRadius:"8px",fontSize:"14px",lineHeight:"1.5"};return i==="filled"?(u.backgroundColor=s.filledBg,u.color=s.filledText):i==="outline"?(u.backgroundColor="transparent",u.border=`1px solid ${s.border}`,u.color=s.text):(u.backgroundColor=s.bg,u.color=s.text),u},[i,s]);return t?o("div",{role:"alert",style:d},o("span",{style:{flexShrink:"0",fontSize:"16px",lineHeight:"1.5"}},a),o("div",{style:{flex:"1",minWidth:"0"}},e.title?o("div",{style:{fontWeight:"600",marginBottom:l?"4px":"0"}},e.title):null,l?o("div",null,l):null,e.action?o("button",{onclick:e.action.onClick,style:{marginTop:"8px",padding:"4px 12px",fontSize:"13px",fontWeight:"500",border:i==="filled"?"1px solid currentColor":`1px solid ${s.border}`,borderRadius:"4px",backgroundColor:"transparent",color:"inherit",cursor:"pointer"}},e.action.label):null),e.closable?o("button",{"aria-label":"Close",onclick:()=>{n(!1),e.onClose&&e.onClose()},style:{flexShrink:"0",background:"none",border:"none",cursor:"pointer",fontSize:"18px",lineHeight:"1",color:"inherit",opacity:"0.7",padding:"0"}},"\xD7"):null):null}function Mo(e){return o("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",padding:"48px 24px",gap:"16px"}},e.image?o("img",{src:e.image,alt:"",style:{maxWidth:"200px",maxHeight:"160px",objectFit:"contain"}}):null,e.icon?o("div",{style:{fontSize:"48px",lineHeight:"1"}},e.icon):null,e.title?o("h3",{style:{margin:"0",fontSize:"20px",fontWeight:"600",color:"#111827",lineHeight:"1.4"}},e.title):null,e.description?o("p",{style:{margin:"0",fontSize:"14px",color:"#6b7280",maxWidth:"360px",lineHeight:"1.6"}},e.description):null,e.action?o("button",{onclick:e.action.onClick,style:{marginTop:"8px",padding:"10px 24px",fontSize:"14px",fontWeight:"500",color:"#ffffff",backgroundColor:"#3b82f6",border:"none",borderRadius:"6px",cursor:"pointer"}},e.action.label):null)}function Eo(e){let t=e.max??100,n=e.indeterminate?0:Math.min(Math.max(e.value??0,0),t),r=t>0?n/t*100:0,i=e.color??"#3b82f6",s=e.backgroundColor??"#e5e7eb",a=e.height??(typeof e.size=="string"?e.size:typeof e.size=="number"?`${e.size}px`:"8px"),l=e.variant??"bar",d=Ce().replace(/[^a-zA-Z0-9_-]/g,"");if(l==="circular"){let p=typeof e.size=="number"?e.size:48,f=Math.max(2,Math.round(p/10)),y=(p-f)/2,b=2*Math.PI*y,m=e.indeterminate?b*.75:b-r/100*b,x=e.indeterminate?`@keyframes liq-spin-${d}{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}`:e.animated?`@keyframes liq-pulse-${d}{0%,100%{opacity:1}50%{opacity:0.6}}`:"";return o("div",{role:"progressbar","aria-valuenow":e.indeterminate?void 0:String(Math.round(r)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Progress",style:{display:"inline-flex",alignItems:"center",gap:"8px"}},x?o("style",null,x):null,o("svg",{width:String(p),height:String(p),viewBox:`0 0 ${p} ${p}`,style:e.indeterminate?{animation:`liq-spin-${d} 1s linear infinite`}:e.animated?{animation:`liq-pulse-${d} 1.5s ease-in-out infinite`}:{}},o("circle",{cx:String(p/2),cy:String(p/2),r:String(y),fill:"none",stroke:s,"stroke-width":String(f)}),o("circle",{cx:String(p/2),cy:String(p/2),r:String(y),fill:"none",stroke:i,"stroke-width":String(f),"stroke-dasharray":String(b),"stroke-dashoffset":String(m),"stroke-linecap":"round",transform:`rotate(-90 ${p/2} ${p/2})`,style:{transition:"stroke-dashoffset 0.3s ease"}})),e.showLabel&&!e.indeterminate?o("span",{style:{fontSize:"14px",color:"#374151"}},`${Math.round(r)}%`):null)}let u=e.animated||e.indeterminate?`@keyframes liq-shimmer-${d}{0%{background-position:-200% 0}100%{background-position:200% 0}}`:"",h=e.indeterminate?`@keyframes liq-indeterminate-${d}{0%{left:-40%;width:40%}50%{left:20%;width:60%}100%{left:100%;width:40%}}`:"",g={width:"100%",height:a,backgroundColor:s,borderRadius:a,overflow:"hidden",position:"relative"},c=q(()=>{let p={height:"100%",borderRadius:a,transition:"width 0.3s ease"};return e.indeterminate?(p.position="absolute",p.animation=`liq-indeterminate-${d} 1.5s ease-in-out infinite`,p.backgroundColor=i):(p.width=`${r}%`,p.backgroundColor=i),e.animated&&!e.indeterminate&&(p.backgroundImage=`linear-gradient(90deg, ${i} 0%, ${Ua(i)} 50%, ${i} 100%)`,p.backgroundSize="200% 100%",p.animation=`liq-shimmer-${d} 1.5s ease-in-out infinite`),p},[r,i,a,e.animated,e.indeterminate,d]);return o("div",{role:"progressbar","aria-valuenow":e.indeterminate?void 0:String(Math.round(r)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Progress",style:{width:"100%"}},u||h?o("style",null,u+h):null,e.showLabel&&!e.indeterminate?o("div",{style:{marginBottom:"4px",fontSize:"12px",color:"#374151",textAlign:"right"}},`${Math.round(r)}%`):null,o("div",{style:g},o("div",{style:c})))}function Ua(e){let t=e.replace("#","");if(t.length!==6)return e;let n=Math.min(255,parseInt(t.slice(0,2),16)+40),r=Math.min(255,parseInt(t.slice(2,4),16)+40),i=Math.min(255,parseInt(t.slice(4,6),16)+40);return`#${n.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}`}function Io(e){let t=e.variant??"text",n=e.animated!==!1,r=Ce().replace(/[^a-zA-Z0-9_-]/g,""),i=q(()=>n?`@keyframes liq-shimmer-${r}{0%{background-position:-200% 0}100%{background-position:200% 0}}`:"",[n,r]),s=typeof e.width=="number"?`${e.width}px`:e.width,a=typeof e.height=="number"?`${e.height}px`:e.height;if(t==="text"){let l=e.lines??1,d=[];for(let u=0;u<l;u++){let h=u===l-1&&l>1;d.push(o("div",{key:String(u),style:hn({width:h?"75%":s??"100%",height:a??"1em",borderRadius:e.borderRadius??"4px",animated:n,animId:r,marginBottom:u<l-1?"8px":"0"})}))}return o("div",{"aria-hidden":"true",style:{width:s??"100%"}},i?o("style",null,i):null,...d)}if(t==="circular"){let l=s??a??"40px";return o("div",{"aria-hidden":"true"},i?o("style",null,i):null,o("div",{style:hn({width:l,height:l,borderRadius:"50%",animated:n,animId:r})}))}return o("div",{"aria-hidden":"true"},i?o("style",null,i):null,o("div",{style:hn({width:s??"100%",height:a??"100px",borderRadius:e.borderRadius??"4px",animated:n,animId:r})}))}function hn(e){let t={width:e.width,height:e.height,borderRadius:e.borderRadius,backgroundColor:"#e5e7eb"};return e.animated&&(t.backgroundImage="linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%)",t.backgroundSize="200% 100%",t.animation=`liq-shimmer-${e.animId} 1.5s ease-in-out infinite`),e.marginBottom&&(t.marginBottom=e.marginBottom),t}var ja={sm:16,md:24,lg:40},Ro={slow:"1.2s",normal:"0.75s",fast:"0.45s"};function Po(e){let t=typeof e.size=="number"?e.size:ja[e.size??"md"]??24,n=e.color??"#3b82f6",r=e.thickness??Math.max(2,Math.round(t/8)),i=Ro[e.speed??"normal"]??Ro.normal,s=e.label??"Loading",l=Ce().replace(/[^a-zA-Z0-9_-]/g,""),d=(t-r)/2,u=2*Math.PI*d,h=q(()=>`@keyframes liq-rotate-${l}{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}`,[l]);return o("span",{role:"status","aria-label":s,style:{display:"inline-flex",alignItems:"center",justifyContent:"center"}},o("style",null,h),o("svg",{width:String(t),height:String(t),viewBox:`0 0 ${t} ${t}`,style:{animation:`liq-rotate-${l} ${i} linear infinite`}},o("circle",{cx:String(t/2),cy:String(t/2),r:String(d),fill:"none",stroke:n,"stroke-width":String(r),"stroke-dasharray":`${u*.7} ${u*.3}`,"stroke-linecap":"round"})),o("span",{style:{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",borderWidth:"0"}},s))}function De(e){let t=e.styling??{},n=!!e.error,r={display:"flex",flexDirection:"column",gap:t.gap??"4px",width:typeof t.width=="number"?`${t.width}px`:t.width??"100%",fontFamily:t.fontFamily??"inherit",fontSize:t.fontSize??"14px",opacity:e.disabled?"0.6":"1",...t.custom??{}},i={color:t.labelColor??"#374151",fontWeight:t.labelFontWeight??"500",fontSize:t.labelFontSize??"14px"},s={fontSize:"12px",color:n?t.errorColor??"#ef4444":t.helpColor??"#6b7280",marginTop:"2px"};return o("div",{className:`form-field ${n?"form-field--error":""} ${e.className??""}`.trim(),style:r},e.label?o("label",{htmlFor:e.htmlFor,style:i},e.label,e.required?o("span",{style:{color:t.errorColor??"#ef4444",marginLeft:"2px"}},"*"):null):null,e.children,e.error?o("div",{className:"form-field__error",style:s,role:"alert"},e.error):e.helpText?o("div",{className:"form-field__help",style:s},e.helpText):null)}function je(e,t){let n=t.error?e.errorBorderColor??"#ef4444":t.focused?e.focusBorderColor??"#3b82f6":void 0;return{padding:e.padding??"8px 12px",border:n?`1px solid ${n}`:e.border??"1px solid #d1d5db",borderRadius:e.borderRadius??"6px",fontSize:e.fontSize??"14px",fontFamily:e.fontFamily??"inherit",backgroundColor:e.backgroundColor??"#ffffff",color:e.color??"#1f2937",outline:"none",transition:e.transition??"border-color 0.15s",width:"100%",boxSizing:"border-box",...t.focused&&n?{boxShadow:`0 0 0 3px ${n}22`}:{},...e.custom??{}}}var Ga={sm:{box:14,icon:10,fontSize:"12px"},md:{box:18,icon:12,fontSize:"14px"},lg:{box:22,icon:16,fontSize:"16px"}};function $o(e){let t=Ce().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{checked:r,onChange:i,label:s,indeterminate:a=!1,disabled:l=!1,error:d,size:u="md"}=e,h=ne(null);re(()=>{h.current&&(h.current.indeterminate=a)},[a]);let g=S(()=>{l||i(!r)},[l,r,i]),c=S(L=>{l||(L.key===" "||L.key==="Enter")&&(L.preventDefault(),i(!r))},[l,r,i]),p=Ga[u],f=`${p.box}px`,y=d?"#ef4444":r||a?"#3b82f6":"#d1d5db",b=r||a?"#3b82f6":"#ffffff",m={width:f,height:f,minWidth:f,borderRadius:"4px",border:`2px solid ${y}`,backgroundColor:b,display:"flex",alignItems:"center",justifyContent:"center",cursor:l?"not-allowed":"pointer",transition:"all 0.15s",boxSizing:"border-box"},x={color:"#ffffff",fontSize:`${p.icon}px`,lineHeight:"1",fontWeight:"700"},v=a?o("span",{style:x},"\u2014"):r?o("span",{style:x},"\u2713"):null,D={display:"inline-flex",alignItems:"center",gap:"8px",cursor:l?"not-allowed":"pointer",opacity:l?"0.6":"1",userSelect:"none"},A=o("input",{ref:h,type:"checkbox",id:n,checked:r,disabled:l,onChange:()=>i(!r),style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},"aria-hidden":"true",tabIndex:-1}),M=o("div",{style:m},v),T=s?o("span",{style:{fontSize:p.fontSize,color:"#374151"}},s):null;return o(De,{error:d,htmlFor:n},o("div",{style:D,onClick:g,onKeyDown:c,tabIndex:l?-1:0,role:"checkbox","aria-checked":a?"mixed":r?"true":"false","aria-disabled":l?"true":void 0,"aria-label":s},A,M,T))}var Xa=["#000000","#434343","#666666","#999999","#b7b7b7","#cccccc","#d9d9d9","#efefef","#f3f3f3","#ffffff","#980000","#ff0000","#ff9900","#ffff00","#00ff00","#00ffff","#4a86e8","#0000ff","#9900ff","#ff00ff","#e6b8af","#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#c9daf8","#cfe2f3","#d9d2e9","#ead1dc"];function To(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e)}function Ht(e){let t=e.startsWith("#")?e:`#${e}`;return/^#[0-9a-fA-F]{3}$/.test(t)&&(t=`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`),t.toLowerCase()}function Do(e){let t=Ce().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,presets:s=Xa,showInput:a=!0,showAlpha:l=!1,disabled:d=!1,label:u}=e,[h,g]=j(!1),[c,p]=j(r),f=ne(null);re(()=>{p(r)},[r]),re(()=>{let I=P=>{f.current&&!f.current.contains(P.target)&&g(!1)};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[]);let y=S(I=>{d||i(Ht(I))},[d,i]),b=S(I=>{let P=I.target.value;p(P);let B=P.startsWith("#")?P:`#${P}`;To(B)&&i(Ht(B))},[i]),m=S(()=>{To(c.startsWith("#")?c:`#${c}`)||p(r)},[c,r]),x={width:"36px",height:"36px",borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:r,cursor:d?"not-allowed":"pointer",flexShrink:"0"},v={display:"flex",alignItems:"center",gap:"8px"},D={position:"absolute",top:"100%",left:"0",marginTop:"4px",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",zIndex:"1000",padding:"12px",width:"240px"},A={display:"grid",gridTemplateColumns:"repeat(10, 1fr)",gap:"4px",marginBottom:a?"8px":"0"},M=s.map(I=>{let P=Ht(I)===Ht(r);return o("div",{key:I,style:{width:"20px",height:"20px",borderRadius:"3px",backgroundColor:I,cursor:d?"not-allowed":"pointer",border:P?"2px solid #1f2937":"1px solid #e5e7eb",boxSizing:"border-box"},onClick:()=>y(I),onKeyDown:E=>{let N=E.key;(N==="Enter"||N===" ")&&(E.preventDefault(),y(I))},role:"button",tabIndex:d?-1:0,title:I,"aria-label":`Select color ${I}`})}),T=a?o("div",{style:{display:"flex",alignItems:"center",gap:"4px"}},o("div",{style:{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:r,border:"1px solid #d1d5db",flexShrink:"0"}}),o("input",{type:"text",value:c,onInput:b,onBlur:m,disabled:d,style:{flex:"1",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"13px",fontFamily:"monospace",outline:"none",color:"#1f2937"},placeholder:"#000000","aria-label":"Hex color value"})):null,L=h?o("div",{style:D},o("div",{style:A},...M),T):null;return o(De,{label:u,disabled:d,htmlFor:n},o("div",{ref:f,style:{position:"relative"}},o("div",{style:v,onClick:d?void 0:()=>g(!h),onKeyDown:d?void 0:I=>{let P=I.key;(P==="Enter"||P===" ")&&(I.preventDefault(),g(!h))},role:"button",tabIndex:d?-1:0,"aria-expanded":h?"true":"false","aria-label":"Toggle color picker"},o("div",{id:n,style:x}),a?o("span",{style:{fontSize:"14px",fontFamily:"monospace",color:"#1f2937"}},r):null),L))}function zo(e){let t=Ce().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`cw-${t}`,{value:r="#000000",onChange:i,size:s=32,showLabel:a=!0,disabled:l=!1,label:d}=e,[u,h]=j(r),g=ne(null),c=S(((...b)=>{let x=b[0].target.value;h(x),i?.(x)}),[i]),p={display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"4px"},f={width:`${s}px`,height:`${s}px`,borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:u,cursor:l?"not-allowed":"pointer",position:"relative",overflow:"hidden"};return o(De,{label:d,htmlFor:n},o("div",{style:p},o("div",{style:f},o("input",{id:n,ref:g,type:"color",value:u,onInput:c,disabled:l,style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",opacity:"0",cursor:l?"not-allowed":"pointer",border:"none",padding:"0"},"aria-label":d||"Color"})),a?o("span",{style:{fontSize:"11px",fontFamily:"monospace",color:"#64748b"}},u):null))}var Ao=["January","February","March","April","May","June","July","August","September","October","November","December"],qa=["Su","Mo","Tu","We","Th","Fr","Sa"];function bn(e){if(!e)return null;if(e instanceof Date)return e;let t=new Date(e);return isNaN(t.getTime())?null:t}function Ka(e,t){let n=e.getFullYear(),r=e.getMonth()+1,i=e.getDate();return t.replace("YYYY",String(n)).replace("MM",String(r).padStart(2,"0")).replace("DD",String(i).padStart(2,"0"))}function Lo(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function Za(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function Bo(e){let t=Ce().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,format:s="YYYY-MM-DD",minDate:a,maxDate:l,disabled:d=!1,placeholder:u="Select date...",label:h,error:g}=e,c=q(()=>bn(r),[r]),p=q(()=>bn(a),[a]),f=q(()=>bn(l),[l]),[y,b]=j(!1),[m,x]=j(()=>c?c.getFullYear():new Date().getFullYear()),[v,D]=j(()=>c?c.getMonth():new Date().getMonth()),A=ne(null),M=q(()=>new Date,[]);re(()=>{let R=W=>{A.current&&!A.current.contains(W.target)&&b(!1)};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[]);let T=S(()=>{D(R=>R===0?(x(W=>W-1),11):R-1)},[]),L=S(()=>{D(R=>R===11?(x(W=>W+1),0):R+1)},[]),I=S(R=>{let W=new Date(m,v,R);p&&W<p||f&&W>f||(i(Za(W)),b(!1))},[m,v,i,p,f]),P=c?Ka(c,s):"",B=q(()=>{let R=new Date(m,v,1).getDay(),W=new Date(m,v+1,0).getDate(),_=[],O=[];for(let V=0;V<R;V++)O.push(null);for(let V=1;V<=W;V++)O.push(V),O.length===7&&(_.push(O),O=[]);for(;O.length>0&&O.length<7;)O.push(null);return O.length&&_.push(O),_},[m,v]),E={...je({},{focused:y,error:!!g}),cursor:d?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",minHeight:"38px",userSelect:"none"},N={position:"absolute",top:"100%",left:"0",marginTop:"4px",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",zIndex:"1000",padding:"12px",width:"280px"},z={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"8px"},k={background:"none",border:"none",cursor:"pointer",fontSize:"16px",padding:"4px 8px",color:"#374151",borderRadius:"4px"},w={display:"grid",gridTemplateColumns:"repeat(7, 1fr)",textAlign:"center",fontSize:"11px",fontWeight:"600",color:"#6b7280",marginBottom:"4px"},$=qa.map(R=>o("div",{key:R,style:{padding:"4px"}},R)),C=B.map((R,W)=>{let _=R.map((O,V)=>{if(O===null)return o("div",{key:`empty-${W}-${V}`,style:{padding:"4px"}});let X=new Date(m,v,O),ee=Lo(X,M),Z=c?Lo(X,c):!1,U=p&&X<p||f&&X>f,G={padding:"4px",textAlign:"center",cursor:U?"not-allowed":"pointer",borderRadius:"4px",fontSize:"13px",fontWeight:ee?"700":"400",backgroundColor:Z?"#3b82f6":"transparent",color:Z?"#ffffff":U?"#d1d5db":ee?"#3b82f6":"#1f2937",border:ee&&!Z?"1px solid #3b82f6":"1px solid transparent",lineHeight:"1.8"};return o("div",{key:`day-${O}`,style:G,onClick:U?void 0:()=>I(O),onKeyDown:U?void 0:Y=>{let H=Y.key;(H==="Enter"||H===" ")&&(Y.preventDefault(),I(O))},role:U?void 0:"button",tabIndex:U?void 0:0,"aria-label":`${Ao[v]} ${O}, ${m}`,"aria-disabled":U?"true":void 0},String(O))});return o("div",{key:`row-${W}`,style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)"}},..._)}),F=y?o("div",{style:N},o("div",{style:z},o("button",{type:"button",style:k,onClick:T},"\u25C0"),o("span",{style:{fontWeight:"600",fontSize:"14px",color:"#1f2937"}},`${Ao[v]} ${m}`),o("button",{type:"button",style:k,onClick:L},"\u25B6")),o("div",{style:w},...$),...C):null;return o(De,{label:h,error:g,disabled:d,htmlFor:n},o("div",{ref:A,style:{position:"relative"}},o("div",{id:n,style:E,onClick:d?void 0:()=>b(!y),onKeyDown:d?void 0:R=>{let W=R.key;(W==="Enter"||W===" ")&&(R.preventDefault(),b(!y))},tabIndex:d?-1:0,role:"button","aria-label":"Pick a date","aria-expanded":y?"true":"false"},o("span",{style:{color:P?"#1f2937":"#9ca3af"}},P||u),o("span",{style:{color:"#6b7280",fontSize:"14px"}},"\u{1F4C5}")),F))}function xn(e){if(e===0)return"0 B";let t=["B","KB","MB","GB"],n=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,n)).toFixed(n===0?0:1)} ${t[n]}`}function Fo(e){let t=Ce().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`fu-${t}`,{onChange:r,accept:i,multiple:s=!1,maxSize:a,disabled:l=!1,label:d,helpText:u}=e,[h,g]=j([]),[c,p]=j(!1),[f,y]=j(""),b=ne(null),m=S(k=>{y("");let w=[];for(let C of k){if(a&&C.size>a){y(`File "${C.name}" exceeds maximum size of ${xn(a)}`);continue}w.push(C)}let $=s?[...h,...w]:w.slice(0,1);g($),r($)},[h,s,a,r]),x=S(k=>{if(k.preventDefault(),k.stopPropagation(),p(!1),l)return;let w=k.dataTransfer;if(!w)return;let $=Array.from(w.files);m($)},[l,m]),v=S(k=>{k.preventDefault(),k.stopPropagation(),l||p(!0)},[l]),D=S(k=>{k.preventDefault(),k.stopPropagation(),p(!1)},[]),A=S(k=>{let w=k.target;w.files&&(m(Array.from(w.files)),w.value="")},[m]),M=S(k=>{let w=h.filter(($,C)=>C!==k);g(w),r(w)},[h,r]),T=S(()=>{l||b.current&&b.current.click()},[l]),L={border:`2px dashed ${c?"#3b82f6":f?"#ef4444":"#d1d5db"}`,borderRadius:"8px",padding:"24px",textAlign:"center",cursor:l?"not-allowed":"pointer",backgroundColor:c?"#eff6ff":"#fafafa",transition:"all 0.15s",opacity:l?"0.6":"1"},I={fontSize:"28px",color:"#9ca3af",marginBottom:"8px"},P={fontSize:"14px",color:"#374151",marginBottom:"4px"},B={fontSize:"12px",color:"#9ca3af"},E=o("input",{id:n,ref:b,type:"file",accept:i,multiple:s,onChange:A,disabled:l,style:{display:"none"},tabIndex:-1}),N=o("div",{style:L,onClick:T,onKeyDown:k=>{let w=k.key;(w==="Enter"||w===" ")&&(k.preventDefault(),T())},onDrop:x,onDragOver:v,onDragLeave:D,role:"button",tabIndex:l?-1:0,"aria-label":"Upload files"},o("div",{style:I},"\u2191"),o("div",{style:P},o("span",{style:{color:"#3b82f6",fontWeight:"500"}},"Click to upload")," or drag and drop"),i?o("div",{style:B},i):null,a?o("div",{style:B},`Max size: ${xn(a)}`):null),z=h.length>0?o("div",{style:{marginTop:"8px",display:"flex",flexDirection:"column",gap:"4px"}},...h.map((k,w)=>{let $={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",backgroundColor:"#f9fafb",borderRadius:"6px",border:"1px solid #e5e7eb",fontSize:"13px"},C={background:"none",border:"none",cursor:"pointer",color:"#ef4444",fontSize:"14px",padding:"2px 6px",borderRadius:"4px"};return o("div",{key:`file-${w}`,style:$},o("div",{style:{display:"flex",alignItems:"center",gap:"8px",overflow:"hidden"}},o("span",{style:{color:"#374151",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},k.name),o("span",{style:{color:"#9ca3af",fontSize:"11px",flexShrink:"0"}},xn(k.size))),o("button",{type:"button",style:C,onClick:F=>{F.stopPropagation(),M(w)},"aria-label":`Remove ${k.name}`},"\u2715"))})):null;return o(De,{label:d,helpText:u,error:f||void 0,disabled:l,htmlFor:n},o("div",null,E,N,z))}function No(e){let[t,n]=j(!1),[r,i]=j((e.value??e.defaultValue??"").length),s=Ce().replace(/[^a-zA-Z0-9_-]/g,""),a=e.id??`ml-${s}`,d={...je(e.inputStyle??{},{focused:t,error:!!e.error}),resize:e.autoResize?"none":"vertical",lineHeight:"1.5",...e.minHeight?{minHeight:e.minHeight}:{},...e.maxHeight?{maxHeight:e.maxHeight}:{}},u=S(c=>{let p=c.target,f=p.value;i(f.length),e.onChange&&e.onChange(f),e.autoResize&&(p.style.height="auto",p.style.height=`${p.scrollHeight}px`)},[e.onChange,e.autoResize]),h=o("textarea",{id:a,name:e.name,value:e.value,placeholder:e.placeholder,rows:String(e.rows??4),maxLength:e.maxLength?String(e.maxLength):void 0,readOnly:e.readOnly,disabled:e.disabled,"aria-invalid":e.error?"true":void 0,"aria-required":e.required?"true":void 0,className:`multiline-input ${e.className??""}`.trim(),style:d,onFocus:()=>n(!0),onBlur:c=>{n(!1),e.onBlur&&e.onBlur(c.target.value)},onInput:u}),g=e.showCount&&e.maxLength?o("div",{style:{fontSize:"11px",color:r>(e.maxLength??1/0)*.9?"#ef4444":"#9ca3af",textAlign:"right",marginTop:"2px"}},`${r}/${e.maxLength}`):e.showCount?o("div",{style:{fontSize:"11px",color:"#9ca3af",textAlign:"right",marginTop:"2px"}},`${r} characters`):null;return o(De,{label:e.label,htmlFor:a,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},h,g)}function Wo(e){let t=Ce().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`ns-${t}`,{value:r,onChange:i,min:s,max:a,step:l=1,disabled:d=!1,prefix:u,suffix:h,label:g,error:c}=e,[p,f]=j(!1),y=S(w=>{let $=w;return s!==void 0&&$<s&&($=s),a!==void 0&&$>a&&($=a),$},[s,a]),b=S(()=>{d||i(y(r+l))},[d,r,l,y,i]),m=S(()=>{d||i(y(r-l))},[d,r,l,y,i]),x=S(w=>{let $=w.target.value;if($===""||$==="-")return;let C=parseFloat($);isNaN(C)||i(y(C))},[y,i]),v=S(w=>{d||(w.key==="ArrowUp"?(w.preventDefault(),b()):w.key==="ArrowDown"&&(w.preventDefault(),m()))},[d,b,m]),D=s===void 0||r>s,A=a===void 0||r<a,M={display:"inline-flex",alignItems:"stretch",borderRadius:"6px",overflow:"hidden",border:`1px solid ${c?"#ef4444":p?"#3b82f6":"var(--color-border, #d1d5db)"}`,transition:"border-color 0.15s",opacity:d?"0.6":"1",...p&&!c?{boxShadow:"0 0 0 3px #3b82f622"}:{}},T=w=>({display:"flex",alignItems:"center",justifyContent:"center",width:"36px",backgroundColor:"var(--color-bg-subtle, #f9fafb)",border:"none",cursor:d||!w?"not-allowed":"pointer",color:d||!w?"#d1d5db":"var(--color-text, #374151)",fontSize:"inherit",fontWeight:"600",userSelect:"none",transition:"background-color 0.1s",borderRight:"none",borderLeft:"none"}),L={flex:"1",minWidth:"32px",textAlign:"center",border:"none",borderLeft:"1px solid var(--color-border, #e5e7eb)",borderRight:"1px solid var(--color-border, #e5e7eb)",outline:"none",fontSize:"inherit",fontFamily:"inherit",backgroundColor:"var(--color-bg, #ffffff)",color:"var(--color-text, #1f2937)",padding:"4px 2px"},I={display:"flex",alignItems:"center",fontSize:"inherit",color:"var(--color-text-muted, #6b7280)",padding:"0 2px",backgroundColor:"var(--color-bg-subtle, #f9fafb)"},P=o("button",{type:"button",style:T(D),onClick:m,disabled:d,"aria-label":"Decrement",tabIndex:-1},"\u2212"),B=u?o("span",{style:I},u):null,E=o("input",{id:n,type:"text",value:String(r),onInput:x,onKeyDown:v,onFocus:()=>f(!0),onBlur:()=>f(!1),disabled:d,style:L,"aria-label":g||"Number",role:"spinbutton","aria-valuenow":String(r),"aria-valuemin":s!==void 0?String(s):void 0,"aria-valuemax":a!==void 0?String(a):void 0}),N=h?o("span",{style:I},h):null,z=o("button",{type:"button",style:T(A),onClick:b,disabled:d,"aria-label":"Increment",tabIndex:-1},"+"),k=[P];return B&&k.push(B),k.push(E),N&&k.push(N),k.push(z),o(De,{label:g,error:c,disabled:d,htmlFor:n},o("div",{style:M},...k))}function _o(e){let t=Ce().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{options:r,value:i,onChange:s,name:a,direction:l="vertical",disabled:d=!1,error:u,label:h}=e,g=S(y=>{d||s(y)},[d,s]),c=S(y=>{if(d)return;let b=r.filter(v=>!v.disabled);if(b.length===0)return;let m=b.findIndex(v=>v.value===i),x=m;if(y.key==="ArrowDown"||y.key==="ArrowRight")y.preventDefault(),x=m<b.length-1?m+1:0;else if(y.key==="ArrowUp"||y.key==="ArrowLeft")y.preventDefault(),x=m>0?m-1:b.length-1;else return;s(b[x].value)},[d,r,i,s]),p={display:"flex",flexDirection:l==="horizontal"?"row":"column",gap:l==="horizontal"?"16px":"8px"},f=r.map((y,b)=>{let m=y.value===i,x=d||!!y.disabled,v=`${n}-opt-${b}`,D={width:"18px",height:"18px",minWidth:"18px",borderRadius:"50%",border:`2px solid ${u?"#ef4444":m?"#3b82f6":"#d1d5db"}`,display:"flex",alignItems:"center",justifyContent:"center",transition:"border-color 0.15s",boxSizing:"border-box"},A={width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"#3b82f6",transition:"transform 0.15s",transform:m?"scale(1)":"scale(0)"},M={display:"inline-flex",alignItems:"center",gap:"8px",cursor:x?"not-allowed":"pointer",opacity:x?"0.5":"1",userSelect:"none"};return o("label",{key:y.value,htmlFor:v,style:M,onClick:x?void 0:T=>{T.preventDefault(),g(y.value)}},o("input",{type:"radio",id:v,name:a,value:y.value,checked:m,disabled:x,style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},tabIndex:-1}),o("div",{style:D},o("div",{style:A})),o("span",{style:{fontSize:"14px",color:"#374151"}},y.label))});return o(De,{label:h,error:u,htmlFor:`${n}-opt-0`},o("div",{id:n,style:p,role:"radiogroup","aria-label":h,onKeyDown:c,tabIndex:d?-1:0},...f))}function Oo(e){let t=Ce().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{options:r,value:i,onChange:s,placeholder:a="Select...",searchable:l=!1,multiple:d=!1,clearable:u=!1,disabled:h=!1,error:g,label:c,helpText:p}=e,[f,y]=j(!1),[b,m]=j(""),[x,v]=j(-1),D=ne(null),A=q(()=>Array.isArray(i)?i:i?[i]:[],[i]),M=q(()=>{if(!l||!b)return r;let R=b.toLowerCase();return r.filter(W=>W.label.toLowerCase().includes(R))},[r,b,l]),T=q(()=>{let R={},W=[];for(let _ of M)_.group?(R[_.group]||(R[_.group]=[]),R[_.group].push(_)):W.push(_);return{groups:R,ungrouped:W}},[M]),L=q(()=>A.length===0?"":A.map(W=>r.find(_=>_.value===W)).filter(Boolean).map(W=>W.label).join(", "),[A,r]);re(()=>{let R=W=>{let _=W.target;D.current&&!D.current.contains(_)&&(y(!1),m(""))};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[]);let I=S(R=>{if(d){let W=A.includes(R)?A.filter(_=>_!==R):[...A,R];s(W)}else s(R),y(!1),m("")},[d,A,s]),P=S(R=>{R.stopPropagation(),s(d?[]:"")},[d,s]),B=S(R=>{if(h)return;let W=R.key;if(!f&&(W==="Enter"||W===" "||W==="ArrowDown")){R.preventDefault(),y(!0),v(0);return}if(f){if(W==="Escape"){y(!1),m("");return}if(W==="ArrowDown")R.preventDefault(),v(_=>Math.min(_+1,M.length-1));else if(W==="ArrowUp")R.preventDefault(),v(_=>Math.max(_-1,0));else if(W==="Enter"&&x>=0&&x<M.length){R.preventDefault();let _=M[x];_.disabled||I(_.value)}}},[h,f,x,M,I]),E={...je({},{focused:f,error:!!g}),display:"flex",alignItems:"center",justifyContent:"space-between",cursor:h?"not-allowed":"pointer",minHeight:"38px",userSelect:"none"},N={position:"absolute",top:"100%",left:"0",right:"0",marginTop:"4px",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",zIndex:"1000",maxHeight:"240px",overflowY:"auto"},z=(R,W)=>{let _=A.includes(R.value),O=W===x,V={padding:"8px 12px",cursor:R.disabled?"not-allowed":"pointer",backgroundColor:O?"#f3f4f6":_?"#eff6ff":"transparent",color:R.disabled?"#9ca3af":"#1f2937",display:"flex",alignItems:"center",gap:"8px",fontSize:"14px"};return o("div",{key:R.value,style:V,onClick:R.disabled?void 0:()=>I(R.value),onMouseEnter:()=>v(W),role:"option","aria-selected":_?"true":"false","aria-disabled":R.disabled?"true":void 0},d&&_?o("span",{style:{color:"#3b82f6",fontWeight:"700"}},"\u2713"):null,R.label)},k=()=>{let R=[],W=0,{groups:_,ungrouped:O}=T;for(let V of O)R.push(z(V,W++));for(let V of Object.keys(_)){R.push(o("div",{key:`group-${V}`,style:{padding:"6px 12px",fontSize:"11px",fontWeight:"600",color:"#6b7280",textTransform:"uppercase",letterSpacing:"0.05em"}},V));for(let X of _[V])R.push(z(X,W++))}return R.length===0&&R.push(o("div",{style:{padding:"8px 12px",color:"#9ca3af",fontSize:"14px"}},"No options")),R},w=o("span",{style:{marginLeft:"8px",fontSize:"10px",transition:"transform 0.15s",transform:f?"rotate(180deg)":"rotate(0deg)",color:"#6b7280"}},"\u25BC"),$=o("div",{style:E,id:n,onClick:h?void 0:()=>{y(!f),v(-1)},onKeyDown:B,tabIndex:h?-1:0,role:"combobox","aria-expanded":f?"true":"false","aria-haspopup":"listbox"},o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:L?"#1f2937":"#9ca3af"}},L||a),o("span",{style:{display:"flex",alignItems:"center",gap:"4px"}},u&&A.length>0?o("span",{onClick:P,onKeyDown:R=>{let W=R.key;(W==="Enter"||W===" ")&&(R.preventDefault(),R.stopPropagation(),P(R))},style:{cursor:"pointer",color:"#9ca3af",fontSize:"14px",lineHeight:"1"},role:"button",tabIndex:0,"aria-label":"Clear selection"},"\u2715"):null,w)),C=l&&f?o("input",{type:"text",value:b,onInput:R=>{m(R.target.value),v(0)},placeholder:"Search...",style:{width:"100%",boxSizing:"border-box",padding:"8px 12px",border:"none",borderBottom:"1px solid #e5e7eb",outline:"none",fontSize:"14px"}}):null,F=f?o("div",{style:N,role:"listbox"},C,...k()):null;return o(De,{label:c,error:g,helpText:p,disabled:h,htmlFor:n},o("div",{ref:D,style:{position:"relative"}},$,F))}function Ho(e){let t=Ce().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,min:s=0,max:a=100,step:l=1,showValue:d=!1,showTicks:u=!1,disabled:h=!1,marks:g,range:c=!1,label:p,error:f}=e,y=ne(null),b=ne(i);b.current=i;let[m,x]=j(null),v=q(()=>{if(c&&Array.isArray(r))return r;let W=typeof r=="number"?r:0;return[W,W]},[r,c]),D=ne(v);D.current=v;let A=W=>{let _=Math.round((W-s)/l)*l+s;return Math.max(s,Math.min(a,_))},M=W=>(W-s)/(a-s)*100,T=S(W=>{if(!y.current)return s;let _=y.current.getBoundingClientRect(),O=Math.max(0,Math.min(1,(W.clientX-_.left)/_.width));return A(s+O*(a-s))},[s,a,l]),L=S(W=>_=>{h||(_.preventDefault(),x(W))},[h]),I=S(W=>{if(h)return;let _=T(W);if(c){let O=Math.abs(_-v[0]),V=Math.abs(_-v[1]);O<=V?i([A(_),v[1]]):i([v[0],A(_)])}else i(A(_))},[h,T,c,v,i,s,a,l]);re(()=>{if(!m)return;let W=O=>{let V=T(O),X=D.current,ee=b.current;m==="single"?ee(A(V)):m==="start"?ee([Math.min(A(V),X[1]),X[1]]):m==="end"&&ee([X[0],Math.max(X[0],A(V))])},_=()=>x(null);return document.addEventListener("mousemove",W),document.addEventListener("mouseup",_),()=>{document.removeEventListener("mousemove",W),document.removeEventListener("mouseup",_)}},[m,T,s,a,l]);let P=S(W=>{if(h)return;let _=0;if(W.key==="ArrowRight"||W.key==="ArrowUp")_=l;else if(W.key==="ArrowLeft"||W.key==="ArrowDown")_=-l;else return;W.preventDefault(),c||i(A((typeof r=="number"?r:0)+_))},[h,l,c,r,i,s,a]),B={position:"relative",width:"100%",height:"6px",backgroundColor:"#e5e7eb",borderRadius:"3px",cursor:h?"not-allowed":"pointer"},E=c?M(v[0]):0,N=M(c?v[1]:v[0]),z={position:"absolute",top:"0",left:`${E}%`,width:`${N-E}%`,height:"100%",backgroundColor:h?"#9ca3af":"#3b82f6",borderRadius:"3px"},k=W=>p?W==="start"?`${p} minimum`:W==="end"?`${p} maximum`:p:W==="start"?"Minimum value":W==="end"?"Maximum value":"Value",w=(W,_,O)=>{let V={position:"absolute",top:"50%",left:`${W}%`,transform:"translate(-50%, -50%)",width:"18px",height:"18px",borderRadius:"50%",backgroundColor:"#ffffff",border:`2px solid ${h?"#9ca3af":"#3b82f6"}`,cursor:h?"not-allowed":"grab",boxShadow:"0 1px 3px rgba(0,0,0,0.15)",zIndex:"2"},X={position:"absolute",bottom:"24px",left:"50%",transform:"translateX(-50%)",backgroundColor:"#1f2937",color:"#ffffff",padding:"2px 6px",borderRadius:"4px",fontSize:"11px",whiteSpace:"nowrap"};return o("div",{id:_==="single"||_==="start"?n:void 0,style:V,onMouseDown:L(_),role:"slider","aria-valuenow":String(O),"aria-valuemin":String(s),"aria-valuemax":String(a),"aria-label":k(_),tabIndex:h?-1:0,onKeyDown:P},d?o("div",{style:X},String(O)):null)},$=[];if(u)for(let W=s;W<=a;W+=l)$.push(o("div",{key:`tick-${W}`,style:{position:"absolute",top:"10px",left:`${M(W)}%`,width:"1px",height:"6px",backgroundColor:"#d1d5db",transform:"translateX(-50%)"}}));let C=[];if(g)for(let W of g)C.push(o("div",{key:`mark-${W.value}`,style:{position:"absolute",top:"18px",left:`${M(W.value)}%`,transform:"translateX(-50%)",fontSize:"11px",color:"#6b7280",whiteSpace:"nowrap"}},W.label));let F={paddingTop:d?"28px":"8px",paddingBottom:g||u?"28px":"8px",opacity:h?"0.6":"1"},R=[];return c?(R.push(w(M(v[0]),"start",v[0])),R.push(w(M(v[1]),"end",v[1]))):R.push(w(M(v[0]),"single",v[0])),o(De,{label:p,error:f,htmlFor:n},o("div",{style:F},o("div",{ref:y,style:B,role:"presentation",onClick:I},o("div",{style:z}),...R,...$,...C)))}var Ja=["bold","italic","underline","strikethrough","heading1","heading2","bulletList","orderedList","blockquote","link","unlink","insertHR","removeFormat","undo","redo"],Qa={bold:{label:"Bold",icon:"B",command:"bold"},italic:{label:"Italic",icon:"I",command:"italic"},underline:{label:"Underline",icon:"U",command:"underline"},strikethrough:{label:"Strikethrough",icon:"S",command:"strikethrough"},heading1:{label:"Heading 1",icon:"H1",command:"formatBlock",value:"h1"},heading2:{label:"Heading 2",icon:"H2",command:"formatBlock",value:"h2"},heading3:{label:"Heading 3",icon:"H3",command:"formatBlock",value:"h3"},bulletList:{label:"Bullet list",icon:"\u2022",command:"insertUnorderedList"},orderedList:{label:"Numbered list",icon:"1.",command:"insertOrderedList"},blockquote:{label:"Blockquote",icon:"\u201C",command:"formatBlock",value:"blockquote"},link:{label:"Insert link",icon:"\u{1F517}",command:"createLink"},unlink:{label:"Remove link",icon:"\u26D4",command:"unlink"},insertHR:{label:"Horizontal rule",icon:"\u2015",command:"insertHorizontalRule"},removeFormat:{label:"Clear format",icon:"\u2718",command:"removeFormat"},undo:{label:"Undo",icon:"\u21A9",command:"undo"},redo:{label:"Redo",icon:"\u21AA",command:"redo"}};function Yo(e){let[t,n]=j(!1),r=ne(null),i=Ce().replace(/[^a-zA-Z0-9_-]/g,""),s=e.id??i,a=e.toolbar??Ja,l=e.toolbarStyle??{},d=e.editorStyle??{};re(()=>{r.current&&e.value!==void 0&&(r.current.innerHTML=e.value)},[]);let u=S((f,y)=>{if(!(e.disabled||e.readOnly)){if(f==="createLink"){let b=prompt("Enter URL:");if(!b)return;document.execCommand(f,!1,b)}else y&&f==="formatBlock"?document.execCommand(f,!1,`<${y}>`):document.execCommand(f,!1,y);r.current&&e.onChange&&e.onChange(r.current.innerHTML)}},[e.disabled,e.readOnly,e.onChange]),h=S(()=>{r.current&&e.onChange&&e.onChange(r.current.innerHTML)},[e.onChange]),g=S(()=>{n(!1),r.current&&e.onBlur&&e.onBlur(r.current.innerHTML)},[e.onBlur]),c=o("div",{className:"texteditor-toolbar",style:{display:"flex",flexWrap:"wrap",gap:"2px",padding:"6px 8px",backgroundColor:l.backgroundColor??"#f9fafb",borderBottom:l.borderBottom??"1px solid #e5e7eb",borderRadius:"6px 6px 0 0"}},...a.map(f=>{let y=Qa[f];return y?o("button",{key:f,type:"button",title:y.label,onClick:()=>u(y.command,y.value),disabled:e.disabled||e.readOnly,style:{padding:"4px 8px",border:"none",borderRadius:"4px",backgroundColor:"transparent",color:l.buttonColor??"#374151",cursor:e.disabled?"not-allowed":"pointer",fontSize:l.buttonSize??"13px",fontWeight:f==="bold"?"700":f==="italic"?"400":"500",fontStyle:f==="italic"?"italic":"normal",textDecoration:f==="underline"?"underline":f==="strikethrough"?"line-through":"none",minWidth:"28px",textAlign:"center",lineHeight:"1.4"}},y.icon):null})),p=o("div",{ref:r,id:s,className:"texteditor-content",contentEditable:e.disabled?"false":"true",role:"textbox","aria-multiline":"true","aria-label":e.label??"Text editor","data-placeholder":e.placeholder??"",style:{padding:d.padding??"12px 14px",minHeight:e.minHeight??"200px",maxHeight:e.maxHeight??"none",overflow:"auto",backgroundColor:d.backgroundColor??"#ffffff",color:d.color??"#1f2937",fontFamily:d.fontFamily??"inherit",fontSize:d.fontSize??"14px",lineHeight:d.lineHeight??"1.6",outline:"none",borderRadius:"0 0 6px 6px",border:t?"1px solid #3b82f6":e.error?"1px solid #ef4444":"1px solid #d1d5db",borderTop:"none",transition:"border-color 0.15s"},onFocus:()=>n(!0),onBlur:g,onInput:h});return o(De,{label:e.label,htmlFor:s,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},o("div",{className:"texteditor",style:{border:t?"1px solid #3b82f6":e.error?"1px solid #ef4444":"1px solid #d1d5db",borderRadius:"6px",overflow:"hidden",transition:"border-color 0.15s"}},c,p))}function Vo(e){let[t,n]=j(!1),r=Ce().replace(/[^a-zA-Z0-9_-]/g,""),i=e.id??`tf-${r}`,s=je(e.inputStyle??{},{focused:t,error:!!e.error}),a=!!(e.prefix||e.suffix),l=o("input",{type:e.type??"text",id:i,name:e.name,value:e.value,placeholder:e.placeholder,maxLength:e.maxLength?String(e.maxLength):void 0,pattern:e.pattern,autoComplete:e.autoComplete,autoFocus:e.autoFocus,readOnly:e.readOnly,disabled:e.disabled,"aria-invalid":e.error?"true":void 0,"aria-required":e.required?"true":void 0,className:`textfield-input ${e.className??""}`.trim(),style:a?{...s,border:"none",boxShadow:"none",flex:"1",minWidth:"0"}:s,onFocus:()=>n(!0),onBlur:u=>{n(!1),e.onBlur&&e.onBlur(u.target.value)},onInput:u=>{let h=u.target.value;e.onInput&&e.onInput(h),e.onChange&&e.onChange(h)},onKeyDown:u=>{u.key==="Enter"&&e.onEnter&&e.onEnter(u.target.value)}}),d=a?o("div",{style:{...s,display:"flex",alignItems:"center",gap:"8px",padding:"0"}},e.prefix?o("span",{style:{paddingLeft:"10px",color:"#9ca3af",flexShrink:"0"}},e.prefix):null,l,e.suffix?o("span",{style:{paddingRight:"10px",color:"#9ca3af",flexShrink:"0"}},e.suffix):null):l;return o(De,{label:e.label,htmlFor:i,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},d)}var el=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Paris","Asia/Tokyo"];function ot(e){return String(e).padStart(2,"0")}function tl(e){let t=e.split(":");return{hour:parseInt(t[0],10)||0,minute:parseInt(t[1],10)||0,second:parseInt(t[2],10)||0}}function Uo(e){let t=Ce().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,format:s="24h",minuteStep:a=1,disabled:l=!1,label:d,error:u,showSeconds:h=!1,timezone:g,showTimezone:c=!1,timezones:p=el,onTimezoneChange:f}=e,[y,b]=j(!1),m=q(()=>tl(r),[r]),x=s==="12h",v=m.hour>=12,D=x?m.hour%12||12:m.hour,A=S((G,Y,H)=>{let K=Math.max(0,Math.min(23,G)),Q=Math.max(0,Math.min(59,Y)),ie=Math.max(0,Math.min(59,H??0));i(h?`${ot(K)}:${ot(Q)}:${ot(ie)}`:`${ot(K)}:${ot(Q)}`)},[i,h]),M=S(G=>{let Y=parseInt(G.target.value,10)||0;x&&(Y=Y%12,v&&(Y+=12)),A(Y,m.minute,m.second)},[x,v,m.minute,m.second,A]),T=S(G=>{let Y=parseInt(G.target.value,10)||0;A(m.hour,Y,m.second)},[m.hour,m.second,A]),L=S(G=>{let Y=parseInt(G.target.value,10)||0;A(m.hour,m.minute,Y)},[m.hour,m.minute,A]),I=S(()=>{if(l)return;let G=v?m.hour-12:m.hour+12;A(G,m.minute,m.second)},[l,v,m.hour,m.minute,m.second,A]),P=S(G=>{l||A(m.hour+G,m.minute,m.second)},[l,m.hour,m.minute,m.second,A]),B=S(G=>{l||A(m.hour,m.minute+G*a,m.second)},[l,m.hour,m.minute,m.second,a,A]),E=S(G=>{l||A(m.hour,m.minute,m.second+G)},[l,m.hour,m.minute,m.second,A]),N=S(G=>{let Y=G.target.value;f&&f(Y)},[f]),z={display:"inline-flex",alignItems:"center",gap:"4px",...je({},{focused:y,error:!!u})},k={display:"flex",flexDirection:"column",alignItems:"center"},w={background:"none",border:"none",cursor:l?"not-allowed":"pointer",fontSize:"10px",padding:"0 4px",color:"#6b7280",lineHeight:"1"},$={width:"32px",textAlign:"center",border:"none",outline:"none",fontSize:"14px",fontFamily:"monospace",backgroundColor:"transparent",color:"#1f2937",padding:"0"},C={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:l?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},F=o("div",{style:k},o("button",{type:"button",style:w,onClick:()=>P(1),disabled:l},"\u25B2"),o("input",{type:"text",value:ot(D),onChange:M,style:$,disabled:l,"aria-label":"Hour",onFocus:()=>b(!0),onBlur:()=>b(!1)}),o("button",{type:"button",style:w,onClick:()=>P(-1),disabled:l},"\u25BC")),R=o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"),W=o("div",{style:k},o("button",{type:"button",style:w,onClick:()=>B(1),disabled:l},"\u25B2"),o("input",{type:"text",value:ot(m.minute),onChange:T,style:$,disabled:l,"aria-label":"Minute",onFocus:()=>b(!0),onBlur:()=>b(!1)}),o("button",{type:"button",style:w,onClick:()=>B(-1),disabled:l},"\u25BC")),_=h?o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"):null,O=h?o("div",{style:k},o("button",{type:"button",style:w,onClick:()=>E(1),disabled:l},"\u25B2"),o("input",{type:"text",value:ot(m.second),onChange:L,style:$,disabled:l,"aria-label":"Second",onFocus:()=>b(!0),onBlur:()=>b(!1)}),o("button",{type:"button",style:w,onClick:()=>E(-1),disabled:l},"\u25BC")):null,V=x?o("button",{type:"button",style:C,onClick:I,disabled:l,"aria-label":"Toggle AM/PM"},v?"PM":"AM"):null,X={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:l?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},ee=g&&!c?o("span",{style:{marginLeft:"8px",fontSize:"12px",fontWeight:"600",color:"#6b7280"}},g):null,Z=c?o("select",{style:X,value:g??p[0],onChange:N,disabled:l,"aria-label":"Timezone"},...p.map(G=>o("option",{key:G,value:G},G))):null,U=[F,R,W];return _&&U.push(_),O&&U.push(O),V&&U.push(V),ee&&U.push(ee),Z&&U.push(Z),o(De,{label:d,error:u,disabled:l,htmlFor:n},o("div",{id:n,style:z},...U))}var nl={sm:{trackW:32,trackH:18,thumbSize:14,offset:2},md:{trackW:44,trackH:24,thumbSize:20,offset:2},lg:{trackW:56,trackH:30,thumbSize:26,offset:2}};function jo(e){let{checked:t,onChange:n,label:r,labelPosition:i="right",disabled:s=!1,size:a="md",onColor:l="#3b82f6",offColor:d="#d1d5db"}=e,u=nl[a],h=S(()=>{s||n(!t)},[s,t,n]),g=S(v=>{s||(v.key===" "||v.key==="Enter")&&(v.preventDefault(),n(!t))},[s,t,n]),c={width:`${u.trackW}px`,height:`${u.trackH}px`,borderRadius:`${u.trackH}px`,backgroundColor:t?l:d,position:"relative",cursor:s?"not-allowed":"pointer",transition:"background-color 0.2s",flexShrink:"0"},p=t?u.trackW-u.thumbSize-u.offset:u.offset,f={width:`${u.thumbSize}px`,height:`${u.thumbSize}px`,borderRadius:"50%",backgroundColor:"#ffffff",position:"absolute",top:`${u.offset}px`,left:`${p}px`,transition:"left 0.2s",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"},y={display:"inline-flex",alignItems:"center",gap:"8px",opacity:s?"0.5":"1",userSelect:"none"},b=r?o("span",{style:{fontSize:"14px",color:"#374151"}},r):null,m=o("div",{style:c},o("div",{style:f}));return o("div",{style:y,onClick:h,onKeyDown:g,tabIndex:s?-1:0,role:"switch","aria-checked":t?"true":"false","aria-disabled":s?"true":void 0,"aria-label":r},...(i==="left"?[b,m]:[m,b]).filter(Boolean))}var Go={none:"none",sm:"0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.06)",md:"0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06)",lg:"0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05)"};function Xo(e){let t=e.bordered!==!1,n=e.shadow??"sm",r=e.padding??"16px",i=e.borderRadius??"8px",s=q(()=>{let h={display:"flex",flexDirection:"column",borderRadius:i,overflow:"hidden",backgroundColor:"#ffffff",transition:"box-shadow 0.2s, transform 0.2s"};return t&&(h.border="1px solid #e5e7eb"),h.boxShadow=Go[n]??Go.sm,e.hoverable&&(h.cursor="pointer"),{...h,...e.style??{}}},[t,n,i,e.hoverable,e.style]),a={display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:r,gap:"12px"},l={padding:r,paddingTop:e.title||e.subtitle?"0":r,flex:"1"},d={padding:r,paddingTop:"0",borderTop:"1px solid #f3f4f6",paddingBottom:r,marginTop:"auto"},u=e.title||e.subtitle||e.headerAction;return o("div",{className:`card ${e.hoverable?"card--hoverable":""} ${e.className??""}`.trim(),style:s},e.image?o("img",{src:e.image,alt:e.imageAlt??"",style:{width:"100%",height:"auto",display:"block",objectFit:"cover"}}):null,u?o("div",{className:"card__header",style:a},o("div",{style:{flex:"1",minWidth:"0"}},e.title?o("div",{className:"card__title",style:{fontSize:"16px",fontWeight:"600",color:"#111827",lineHeight:"1.4"}},e.title):null,e.subtitle?o("div",{className:"card__subtitle",style:{fontSize:"14px",color:"#6b7280",marginTop:"2px",lineHeight:"1.4"}},e.subtitle):null),e.headerAction?o("div",{className:"card__header-action"},e.headerAction):null):null,o("div",{className:"card__body",style:l},e.children),e.footer?o("div",{className:"card__footer",style:d},e.footer):null)}function qo(e){let t=q(()=>{let n={display:e.inline?"inline-flex":"flex"};return e.direction&&(n.flexDirection=e.direction),e.wrap&&(n.flexWrap=e.wrap),e.gap&&(n.gap=e.gap),e.alignItems&&(n.alignItems=e.alignItems),e.justifyContent&&(n.justifyContent=e.justifyContent),{...n,...e.style??{}}},[e.direction,e.wrap,e.gap,e.alignItems,e.justifyContent,e.inline,e.style]);return o("div",{className:`flex-container ${e.className??""}`.trim(),style:t},e.children)}function Ko(e){let t=q(()=>{let n={};return e.flex&&(n.flex=e.flex),e.grow!==void 0&&(n.flexGrow=String(e.grow)),e.shrink!==void 0&&(n.flexShrink=String(e.shrink)),e.basis&&(n.flexBasis=e.basis),e.alignSelf&&(n.alignSelf=e.alignSelf),e.order!==void 0&&(n.order=String(e.order)),{...n,...e.style??{}}},[e.flex,e.grow,e.shrink,e.basis,e.alignSelf,e.order,e.style]);return o("div",{className:`flex-item ${e.className??""}`.trim(),style:t},e.children)}function Zo(e){let t=q(()=>{let n={display:"grid"};return e.minColWidth?n.gridTemplateColumns=`repeat(auto-fit, minmax(${e.minColWidth}, 1fr))`:e.columns!==void 0&&(n.gridTemplateColumns=typeof e.columns=="number"?`repeat(${e.columns}, 1fr)`:e.columns),e.rows&&(n.gridTemplateRows=e.rows),e.gap&&(n.gap=e.gap),e.alignItems&&(n.alignItems=e.alignItems),e.justifyItems&&(n.justifyItems=e.justifyItems),e.areas&&e.areas.length>0&&(n.gridTemplateAreas=e.areas.map(r=>`"${r}"`).join(" ")),{...n,...e.style??{}}},[e.columns,e.rows,e.gap,e.alignItems,e.justifyItems,e.minColWidth,e.areas,e.style]);return o("div",{className:`grid ${e.className??""}`.trim(),style:t},e.children)}function Jo(e){let t=q(()=>{let n={};return e.gridColumn&&(n.gridColumn=e.gridColumn),e.gridRow&&(n.gridRow=e.gridRow),e.gridArea&&(n.gridArea=e.gridArea),e.alignSelf&&(n.alignSelf=e.alignSelf),e.justifySelf&&(n.justifySelf=e.justifySelf),{...n,...e.style??{}}},[e.gridColumn,e.gridRow,e.gridArea,e.alignSelf,e.justifySelf,e.style]);return o("div",{className:`grid-item ${e.className??""}`.trim(),style:t},e.children)}var Qo={none:"none",sm:"0 1px 3px rgba(0,0,0,0.12)",md:"0 4px 6px rgba(0,0,0,0.1)"};function er(e){let t=e.bordered!==!1,n=e.shadow??"none",[r,i]=j(!!e.defaultCollapsed),s=ne(null),[a,l]=j("auto");re(()=>{if(!e.collapsible)return;let y=s.current;y&&l(`${y.scrollHeight}px`)},[e.children,e.collapsible]);let d=S(()=>{e.collapsible&&i(y=>!y)},[e.collapsible]),u=S(y=>{if(!e.collapsible)return;let b=y.key;(b==="Enter"||b===" ")&&(y.preventDefault(),d())},[e.collapsible,d]),h=q(()=>{let y={borderRadius:"6px",overflow:"hidden",backgroundColor:"#ffffff"};return t&&(y.border="1px solid #e5e7eb"),y.boxShadow=Qo[n]??Qo.none,{...y,...e.style??{}}},[t,n,e.style]),g={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",gap:"8px",backgroundColor:"#f9fafb",userSelect:"none",cursor:e.collapsible?"pointer":"default"},c={display:"inline-block",width:"0",height:"0",borderLeft:"5px solid transparent",borderRight:"5px solid transparent",borderTop:"6px solid #6b7280",transition:"transform 0.2s",transform:r?"rotate(-90deg)":"rotate(0deg)",marginRight:"8px",flexShrink:"0"},p={maxHeight:r?"0":a,overflow:"hidden",transition:"max-height 0.3s ease"},f={padding:"16px"};return o("div",{className:`panel ${e.className??""}`.trim(),style:h},o("div",{className:"panel__header",style:g,onClick:d,onKeyDown:u,role:e.collapsible?"button":void 0,tabIndex:e.collapsible?0:void 0,"aria-expanded":e.collapsible?String(!r):void 0},o("div",{style:{display:"flex",alignItems:"center",flex:"1",minWidth:"0",gap:"8px"}},e.collapsible?o("span",{className:"panel__chevron",style:c}):null,e.icon?o("span",{className:"panel__icon"},e.icon):null,e.title?o("span",{className:"panel__title",style:{fontSize:"14px",fontWeight:"600",color:"#111827"}},e.title):null),e.headerRight?o("div",{className:"panel__header-right"},e.headerRight):null),o("div",{className:"panel__body-wrapper",style:e.collapsible?p:{},ref:s},o("div",{className:"panel__body",style:f},e.children)))}function tr(e,t){return e==="both"?"auto":e==="horizontal"?t==="x"?"auto":"hidden":t==="y"?"auto":"hidden"}function ol(e){switch(e){case"never":return{scrollbarWidth:"none"};case"always":return{scrollbarWidth:"thin"};case"hover":return{scrollbarWidth:"thin"};case"auto":default:return{scrollbarWidth:"auto"}}}function nr(e){let t=e.direction??"vertical",n=e.showScrollbar??"auto",r=e.shadow??!1,i=ne(null),[s,a]=j(!0),[l,d]=j(!1),[u,h]=j(!0),[g,c]=j(!1),p=S(()=>{let x=i.current;if(!x)return;let v=2;a(x.scrollTop<=v),d(x.scrollTop+x.clientHeight>=x.scrollHeight-v),h(x.scrollLeft<=v),c(x.scrollLeft+x.clientWidth>=x.scrollWidth-v)},[]);re(()=>{p()},[p]);let f=S(()=>{r&&p()},[r,p]),y=q(()=>{let x={position:"relative",overflowX:tr(t,"x"),overflowY:tr(t,"y"),...ol(n)};return e.maxHeight&&(x.maxHeight=e.maxHeight),e.maxWidth&&(x.maxWidth=e.maxWidth),e.padding&&(x.padding=e.padding),{...x,...e.style??{}}},[t,n,e.maxHeight,e.maxWidth,e.padding,e.style]),b=[];if(r){let x=t==="vertical"||t==="both",v=t==="horizontal"||t==="both";x&&!s&&b.push("inset 0 8px 6px -6px rgba(0,0,0,0.15)"),x&&!l&&b.push("inset 0 -8px 6px -6px rgba(0,0,0,0.15)"),v&&!u&&b.push("inset 8px 0 6px -6px rgba(0,0,0,0.15)"),v&&!g&&b.push("inset -8px 0 6px -6px rgba(0,0,0,0.15)")}let m={...y};return b.length>0&&(m.boxShadow=b.join(", ")),o("div",{className:`scroll-container scroll-container--${t} ${e.className??""}`.trim(),style:m,ref:i,onScroll:f},e.children)}function or(e){let t=e.direction??"horizontal",n=t==="horizontal",r=e.dividerSize??6,i=e.minSize??50,[s,a]=j(e.initialSplit??50),l=ne(null),d=ne(!1),u=S(y=>{y.preventDefault(),d.current=!0,document.body.style.cursor=n?"col-resize":"row-resize",document.body.style.userSelect="none"},[n]);re(()=>{let y=m=>{if(!d.current||!l.current)return;let x=l.current.getBoundingClientRect(),v=n?x.width:x.height,D=n?m.clientX-x.left:m.clientY-x.top;if(v<=0)return;let A=i/v*100,M=e.maxSize?e.maxSize/v*100:100-A,T=D/v*100;T=Math.max(A,Math.min(M,T)),a(T)},b=()=>{d.current&&(d.current=!1,document.body.style.cursor="",document.body.style.userSelect="")};return document.addEventListener("mousemove",y),document.addEventListener("mouseup",b),()=>{document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",b)}},[n,i,e.maxSize]);let h=q(()=>({display:"flex",flexDirection:n?"row":"column",width:"100%",height:"100%",overflow:"hidden",...e.style??{}}),[n,e.style]),g=n?{width:`calc(${s}% - ${r/2}px)`,overflow:"auto",flexShrink:"0"}:{height:`calc(${s}% - ${r/2}px)`,overflow:"auto",flexShrink:"0"},c={flex:"1",overflow:"auto",minWidth:"0",minHeight:"0"},p={flexShrink:"0",backgroundColor:"#e5e7eb",transition:"background-color 0.15s",...n?{width:`${r}px`,cursor:"col-resize",height:"100%"}:{height:`${r}px`,cursor:"row-resize",width:"100%"}},f=Array.isArray(e.children)?e.children:[];return o("div",{className:`splitter splitter--${t} ${e.className??""}`.trim(),style:h,ref:l},o("div",{className:"splitter__pane splitter__pane--first",style:g},f[0]??null),o("div",{className:"splitter__divider",style:p,onMouseDown:u,onKeyDown:y=>{let b=y.key,m=2;n&&(b==="ArrowLeft"||b==="ArrowRight")?(y.preventDefault(),a(x=>{let v=b==="ArrowRight"?m:-m;return Math.max(5,Math.min(95,x+v))})):!n&&(b==="ArrowUp"||b==="ArrowDown")&&(y.preventDefault(),a(x=>{let v=b==="ArrowDown"?m:-m;return Math.max(5,Math.min(95,x+v))}))},role:"separator",tabIndex:0,"aria-orientation":n?"vertical":"horizontal","aria-valuenow":String(Math.round(s)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Resize panels"}),o("div",{className:"splitter__pane splitter__pane--second",style:c},f[1]??null))}function rr(e){let t=e.position??"top",n=e.variant??"line",r=e.tabs.find(m=>!m.disabled)?.id??"",[i,s]=j(e.activeTab??r),a=e.activeTab??i,l=ne(null),d=S(m=>{s(m),e.onChange&&e.onChange(m)},[e.onChange]),u=S(m=>{let x=e.tabs.filter(L=>!L.disabled),v=x.findIndex(L=>L.id===a);if(v===-1)return;let D=t==="left"||t==="right",A=D?"ArrowUp":"ArrowLeft",M=D?"ArrowDown":"ArrowRight",T=-1;if(m.key===A?T=v>0?v-1:x.length-1:m.key===M?T=v<x.length-1?v+1:0:m.key==="Home"?T=0:m.key==="End"&&(T=x.length-1),T>=0){m.preventDefault(),d(x[T].id);let L=l.current;if(L){let P=L.querySelectorAll('[role="tab"]')[e.tabs.indexOf(x[T])];P&&P.focus()}}},[e.tabs,a,t,d]),h=t==="left"||t==="right",g=t==="bottom"||t==="right",c=q(()=>({display:"flex",flexDirection:h?g?"row-reverse":"row":g?"column-reverse":"column",width:"100%",...e.style??{}}),[h,g,e.style]),p={display:"flex",flexDirection:h?"column":"row",gap:n==="pill"?"4px":"0",...n==="line"&&!h?{borderBottom:"2px solid #e5e7eb"}:{},...n==="line"&&h?{borderRight:t==="left"?"2px solid #e5e7eb":"none",borderLeft:t==="right"?"2px solid #e5e7eb":"none"}:{},...n==="card"?{backgroundColor:"#f9fafb"}:{},...n==="pill"?{padding:"4px"}:{},flexShrink:"0"},f={flex:"1",padding:"16px",minWidth:"0",minHeight:"0"},y=e.tabs.find(m=>m.id===a),b=e.tabs.map(m=>{let x=m.id===a,v={padding:"8px 16px",border:"none",background:"none",cursor:m.disabled?"not-allowed":"pointer",opacity:m.disabled?"0.5":"1",fontSize:"14px",fontWeight:x?"600":"400",color:x?"#3b82f6":"#6b7280",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"6px",outline:"none",transition:"color 0.15s, background-color 0.15s"};return n==="line"?h?t==="left"?(v.borderRight=x?"2px solid #3b82f6":"2px solid transparent",v.marginRight="-2px"):(v.borderLeft=x?"2px solid #3b82f6":"2px solid transparent",v.marginLeft="-2px"):(v.borderBottom=x?"2px solid #3b82f6":"2px solid transparent",v.marginBottom="-2px"):n==="card"?(v.backgroundColor=x?"#ffffff":"transparent",v.borderRadius="6px 6px 0 0",x&&(v.border="1px solid #e5e7eb",v.borderBottom="1px solid #ffffff")):n==="pill"&&(v.borderRadius="9999px",v.backgroundColor=x?"#3b82f6":"transparent",v.color=x?"#ffffff":"#6b7280"),o("button",{key:m.id,role:"tab","aria-selected":String(x),"aria-controls":`tabpanel-${m.id}`,"aria-disabled":m.disabled?"true":void 0,id:`tab-${m.id}`,tabIndex:x?"0":"-1",style:v,onClick:m.disabled?void 0:()=>d(m.id),onKeyDown:u},m.icon?o("span",{className:"tabs__tab-icon"},m.icon):null,m.label)});return o("div",{className:`tabs tabs--${t} tabs--${n} ${e.className??""}`.trim(),style:c},o("div",{className:"tabs__list",role:"tablist","aria-label":"Tabs","aria-orientation":h?"vertical":"horizontal",style:p,ref:l},...b),o("div",{className:"tabs__panel",role:"tabpanel",id:`tabpanel-${a}`,"aria-labelledby":`tab-${a}`,style:f,tabIndex:"0"},y?y.content:null))}function ir(e){let t=e.items??[],n=t.length,r=e.loop!==!1,i=e.showDots!==!1,s=e.showArrows!==!1,a=e.animation??"slide",l=e.interval??5e3,d=Ce().replace(/[^a-zA-Z0-9_-]/g,""),[u,h]=j(0),g=ne(null),c=ne(null),p=S(M=>{let T=M;r?T=(M%n+n)%n:T=Math.max(0,Math.min(M,n-1)),h(T),e.onChange&&e.onChange(T)},[n,r,e.onChange]),f=S(()=>p(u+1),[u,p]),y=S(()=>p(u-1),[u,p]);re(()=>{if(!e.autoPlay||n<=1)return;let M=setInterval(f,l);return()=>clearInterval(M)},[e.autoPlay,l,f,n]),re(()=>{let M=L=>{L.key==="ArrowLeft"?y():L.key==="ArrowRight"&&f()},T=c.current;if(T)return T.addEventListener("keydown",M),()=>T.removeEventListener("keydown",M)},[f,y]);let b=a==="fade"?`@keyframes liq-fade-in-${d}{from{opacity:0}to{opacity:1}}`:"",m={position:"relative",overflow:"hidden",width:"100%",outline:"none"},x=q(()=>a==="fade"?{position:"relative",width:"100%"}:{display:"flex",transition:"transform 0.4s ease",transform:`translateX(-${u*100}%)`,width:"100%"},[u,a]),v={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:"2",background:"rgba(255,255,255,0.8)",border:"none",borderRadius:"50%",width:"36px",height:"36px",fontSize:"18px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:"#111827",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"},D=t.map((M,T)=>{let L=a==="fade"?{position:T===u?"relative":"absolute",top:"0",left:"0",width:"100%",opacity:T===u?"1":"0",transition:"opacity 0.4s ease"}:{flex:"0 0 100%",width:"100%"};return o("div",{key:String(T),style:L},M.content,M.caption?o("div",{style:{textAlign:"center",padding:"8px 12px",fontSize:"13px",color:"#6b7280"}},M.caption):null)}),A=i?o("div",{style:{display:"flex",justifyContent:"center",gap:"8px",padding:"12px 0"}},...t.map((M,T)=>o("button",{key:String(T),"aria-label":`Go to slide ${T+1}`,onclick:()=>p(T),style:{width:"10px",height:"10px",borderRadius:"50%",border:"none",cursor:"pointer",backgroundColor:T===u?"#3b82f6":"#d1d5db",transition:"background-color 0.2s",padding:"0"}}))):null;return o("div",{ref:c,tabindex:"0",role:"region","aria-label":"Carousel",style:m,onpointerdown:M=>{g.current=M.clientX},onpointerup:M=>{if(g.current==null)return;let T=M.clientX-g.current;T>50?y():T<-50&&f(),g.current=null}},b?o("style",null,b):null,o("div",{style:x},...D),s&&n>1?o("button",{"aria-label":"Previous slide",onclick:y,style:{...v,left:"8px"}},"\u2039"):null,s&&n>1?o("button",{"aria-label":"Next slide",onclick:f,style:{...v,right:"8px"}},"\u203A"):null,A)}function sr(e){let[t,n]=j("loading"),r=ne(null),i=Ce().replace(/[^a-zA-Z0-9_-]/g,""),s=e.lazy!==!1,a=typeof e.width=="number"?`${e.width}px`:e.width,l=typeof e.height=="number"?`${e.height}px`:e.height;re(()=>{n("loading")},[e.src]);let d=q(()=>{let p={display:"inline-block",position:"relative",overflow:"hidden"};return a&&(p.width=a),l&&(p.height=l),e.borderRadius&&(p.borderRadius=e.borderRadius),p},[a,l,e.borderRadius]),u=q(()=>{let p={display:"block",width:"100%",height:"100%"};return e.objectFit&&(p.objectFit=e.objectFit),t==="loading"&&(p.opacity="0",p.position="absolute"),t==="error"&&(p.display="none"),p},[e.objectFit,t]),h=null;if(t==="loading")if(e.placeholder==="skeleton"){let p=`@keyframes liq-img-shimmer-${i}{0%{background-position:-200% 0}100%{background-position:200% 0}}`;h=o("div",null,o("style",null,p),o("div",{style:{width:a??"100%",height:l??"200px",backgroundColor:"#e5e7eb",backgroundImage:"linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%)",backgroundSize:"200% 100%",animation:`liq-img-shimmer-${i} 1.5s ease-in-out infinite`}}))}else e.placeholder==="blur"?h=o("div",{style:{width:a??"100%",height:l??"200px",backgroundColor:"#d1d5db",filter:"blur(20px)"}}):e.placeholder!=null&&e.placeholder!==!1&&(h=e.placeholder);let g=null;t==="error"&&e.fallback!=null&&(typeof e.fallback=="string"?g=o("img",{src:e.fallback,alt:e.alt??"",style:{display:"block",width:"100%",height:"100%",objectFit:e.objectFit??"cover"}}):g=e.fallback);let c=o("div",{style:d},h,o("img",{ref:r,src:e.src,alt:e.alt??"",loading:s?"lazy":void 0,style:u,onload:()=>n("loaded"),onerror:()=>n("error")}),g);return e.caption?o("figure",{style:{margin:"0",display:"inline-block"}},c,o("figcaption",{style:{fontSize:"13px",color:"#6b7280",marginTop:"6px",textAlign:"center"}},e.caption)):c}function ar(e){if(!isFinite(e)||e<0)return"0:00";let t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n.toString().padStart(2,"0")}`}function lr(e){let t=e.controls!==!1,n=ne(null),r=Ce().replace(/[^a-zA-Z0-9_-]/g,""),[i,s]=j(!1),[a,l]=j(0),[d,u]=j(0),[h,g]=j(e.muted?0:1),[c,p]=j(!!e.muted),[f,y]=j(!0),b=typeof e.width=="number"?`${e.width}px`:e.width??"100%",m=typeof e.height=="number"?`${e.height}px`:e.height??"auto";re(()=>{let I=n.current;if(!I)return;let P=()=>{s(!0),e.onPlay&&e.onPlay()},B=()=>{s(!1),e.onPause&&e.onPause()},E=()=>{s(!1),e.onEnded&&e.onEnded()},N=()=>{l(I.currentTime),u(I.duration),e.onTimeUpdate&&e.onTimeUpdate(I.currentTime,I.duration)},z=()=>{u(I.duration)};return I.addEventListener("play",P),I.addEventListener("pause",B),I.addEventListener("ended",E),I.addEventListener("timeupdate",N),I.addEventListener("loadedmetadata",z),()=>{I.removeEventListener("play",P),I.removeEventListener("pause",B),I.removeEventListener("ended",E),I.removeEventListener("timeupdate",N),I.removeEventListener("loadedmetadata",z)}},[e.onPlay,e.onPause,e.onEnded,e.onTimeUpdate]);let x=S(()=>{let I=n.current;I&&(I.paused?I.play():I.pause())},[]),v=S(I=>{let P=n.current;if(!P||!isFinite(P.duration))return;let B=I.currentTarget.getBoundingClientRect(),E=Math.max(0,Math.min(1,(I.clientX-B.left)/B.width));P.currentTime=E*P.duration},[]),D=S(I=>{let P=n.current,B=parseFloat(I.target.value);P&&(P.volume=B,P.muted=B===0,g(B),p(B===0))},[]),A=S(()=>{let I=n.current;I&&I.requestFullscreen&&I.requestFullscreen()},[]);if(!t)return o("video",{ref:n,src:e.src,poster:e.poster,controls:!0,autoplay:e.autoPlay?!0:void 0,loop:e.loop?!0:void 0,muted:e.muted?!0:void 0,style:{width:b,height:m,display:"block"}});let M=d>0?a/d*100:0,T={background:"none",border:"none",color:"#ffffff",cursor:"pointer",fontSize:"16px",padding:"4px 8px",lineHeight:"1"},L=o("div",{style:{position:"absolute",bottom:"0",left:"0",right:"0",display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",background:"linear-gradient(transparent, rgba(0,0,0,0.7))",opacity:f?"1":"0",transition:"opacity 0.3s"}},o("button",{"aria-label":i?"Pause":"Play",onclick:x,style:T},i?"\u23F8":"\u25B6"),o("div",{onclick:v,style:{flex:"1",height:"4px",backgroundColor:"rgba(255,255,255,0.3)",borderRadius:"2px",cursor:"pointer",position:"relative"}},o("div",{style:{width:`${M}%`,height:"100%",backgroundColor:"#3b82f6",borderRadius:"2px",transition:"width 0.1s linear"}})),o("span",{style:{color:"#ffffff",fontSize:"12px",whiteSpace:"nowrap",fontFamily:"monospace"}},`${ar(a)} / ${ar(d)}`),o("input",{type:"range",min:"0",max:"1",step:"0.05",value:String(c?0:h),oninput:D,"aria-label":"Volume",style:{width:"60px",cursor:"pointer"}}),o("button",{"aria-label":"Fullscreen",onclick:A,style:T},"\u26F6"));return o("div",{style:{position:"relative",width:b,height:m,backgroundColor:"#000",overflow:"hidden"},onmouseenter:()=>y(!0),onmouseleave:()=>{i&&y(!1)}},o("video",{ref:n,src:e.src,poster:e.poster,autoplay:e.autoPlay?!0:void 0,loop:e.loop?!0:void 0,muted:e.muted?!0:void 0,playsinline:!0,onclick:x,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"}}),L)}function _e(e){let t=e.orientation??"vertical",n=e.role??"navigation",r=e.keyboardNav??!0,i=e.styling??{},s=ne(null),a={display:"flex",flexDirection:t==="horizontal"?"row":"column",backgroundColor:i.backgroundColor??"#ffffff",color:i.color??"#1f2937",fontFamily:i.fontFamily??"inherit",fontSize:i.fontSize??"14px",border:i.border??"1px solid #e5e7eb",borderRadius:i.borderRadius??"8px",padding:i.padding??"0",width:typeof i.width=="number"?`${i.width}px`:i.width??"auto",overflow:"auto",boxSizing:"border-box",listStyle:"none",margin:"0",...i.boxShadow?{boxShadow:i.boxShadow}:{},...i.maxHeight?{maxHeight:typeof i.maxHeight=="number"?`${i.maxHeight}px`:i.maxHeight}:{},...i.custom??{}},l=S(d=>{if(!r)return;let u=d,h=s.current;if(!h)return;let g=Array.from(h.querySelectorAll('button, [tabindex]:not([tabindex="-1"]), a[href], [role="menuitem"], [role="treeitem"]')),c=g.indexOf(document.activeElement);if(c<0)return;let p=t==="vertical",f=p?"ArrowDown":"ArrowRight",y=p?"ArrowUp":"ArrowLeft";if(u.key===f){u.preventDefault();let b=g[c+1];b&&b.focus()}else if(u.key===y){u.preventDefault();let b=g[c-1];b&&b.focus()}else u.key==="Home"?(u.preventDefault(),g[0]?.focus()):u.key==="End"&&(u.preventDefault(),g[g.length-1]?.focus())},[r,t]);return o("nav",{ref:s,role:n,"aria-label":e.ariaLabel??void 0,"aria-orientation":t,className:`nav-wrapper ${e.className??""}`.trim(),style:a,onKeyDown:l},e.children)}function bt(e,t){return{display:"flex",alignItems:"center",padding:e.padding??"10px 16px",cursor:e.cursor??"pointer",transition:e.transition??"background-color 0.15s",backgroundColor:t.active?e.activeBackground??"#eff6ff":t.hover?e.hoverBackground??"#f3f4f6":"transparent",color:t.active?e.activeColor??"#2563eb":"inherit",border:"none",outline:"none",width:"100%",textAlign:"left",font:"inherit",...e.separator?{borderBottom:e.separator}:{}}}function Be(){let[e,t]=j(!1);return{hover:e,onMouseEnter:S(()=>t(!0),[]),onMouseLeave:S(()=>t(!1),[])}}function rl(e){let{section:t,expanded:n,onToggle:r,headerStyle:i,expandIcon:s,collapseIcon:a,iconPosition:l}=e,{hover:d,onMouseEnter:u,onMouseLeave:h}=Be(),g=t.disabled===!0,c={display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",boxSizing:"border-box",padding:i.padding??"12px 16px",backgroundColor:g?"#f9fafb":d?i.hoverBackground??"#f3f4f6":i.backgroundColor??"transparent",color:g?"#9ca3af":i.color??"inherit",fontWeight:i.fontWeight??"600",fontSize:i.fontSize??"inherit",border:"none",outline:"none",cursor:g?"not-allowed":"pointer",font:"inherit",textAlign:"left",transition:"background-color 0.15s",...i.borderBottom?{borderBottom:i.borderBottom}:{}};l==="left"&&(c.flexDirection="row");let p=S(v=>{let D=v;g||(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),r())},[g,r]),f=S(()=>{g||r()},[g,r]),b=o("span",{"aria-hidden":"true",style:{display:"inline-block",transition:"transform 0.2s ease",transform:n?"rotate(180deg)":"rotate(0deg)",flexShrink:"0",marginLeft:l==="right"?"auto":"0",marginRight:l==="left"?"8px":"0",paddingLeft:l==="right"?"8px":"0"}},n?a:s),m=t.icon?o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},o("span",{"aria-hidden":"true"},t.icon),t.header):t.header,x=l==="left"?[b,m]:[m,b];return o("button",{id:`accordion-header-${t.id}`,role:"button","aria-expanded":String(n),"aria-controls":`accordion-panel-${t.id}`,"aria-disabled":g?"true":void 0,"data-section-id":t.id,tabIndex:g?-1:0,style:c,onClick:f,onKeyDown:p,onMouseEnter:u,onMouseLeave:h},...x)}function il(e){let{section:t,expanded:n,contentStyle:r,animated:i}=e,s={overflow:"hidden",boxSizing:"border-box",...i?{maxHeight:n?"2000px":"0",transition:"max-height 0.3s ease"}:{display:n?"block":"none"}},a={padding:r.padding??"12px 16px",backgroundColor:r.backgroundColor??"transparent",...r.borderBottom?{borderBottom:r.borderBottom}:{}};return o("div",{id:`accordion-panel-${t.id}`,role:"region","aria-labelledby":`accordion-header-${t.id}`,"aria-hidden":String(!n),"data-section-content":t.id,style:s},o("div",{style:a},t.content))}function cr(e){let{sections:t,defaultExpanded:n,allowMultiple:r=!1,headerStyle:i={},contentStyle:s={},wrapperStyle:a,expandIcon:l="+",collapseIcon:d="\u2212",iconPosition:u="right",animated:h=!0,onChange:g}=e,[c,p]=j(()=>n??[]),f=S(b=>{p(m=>{let x=m.includes(b),v;return x?v=m.filter(D=>D!==b):r?v=[...m,b]:v=[b],g&&g(v),v})},[r,g]),y=q(()=>t.map(b=>{let m=c.includes(b.id),x=o(rl,{key:`header-${b.id}`,section:b,expanded:m,onToggle:()=>f(b.id),headerStyle:i,expandIcon:l,collapseIcon:d,iconPosition:u}),v=o(il,{key:`content-${b.id}`,section:b,expanded:m,contentStyle:s,animated:h});return o("div",{key:b.id,"data-accordion-section":b.id,style:{width:"100%"}},x,v)}),[t,c,i,s,l,d,u,h,f]);return o(_e,{role:"region",ariaLabel:"Accordion",styling:a,keyboardNav:!0},...y)}var sl={sm:{fontSize:"12px",padding:"4px 0"},md:{fontSize:"14px",padding:"6px 0"},lg:{fontSize:"16px",padding:"8px 0"}};function dr(e){let{items:t,separator:n="/",maxItems:r,size:i="md"}=e,[s,a]=j(!1),l=sl[i],d=S(()=>{a(!0)},[]),u=t,h=!1;if(r&&r>1&&t.length>r&&!s){h=!0;let f=1,y=r-1;u=[...t.slice(0,f),{label:"..."},...t.slice(t.length-y)]}let g=f=>typeof f=="string"?o("span",{"aria-hidden":"true",style:{margin:"0 8px",color:"#9ca3af",userSelect:"none"}},f):o("span",{"aria-hidden":"true",style:{margin:"0 8px"}},f),c=(f,y,b)=>{let m=y===b.length-1,x=h&&f.label==="..."&&y===1,v=[];return y>0&&v.push(g(n)),x?v.push(o("button",{type:"button",onClick:d,style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",fontSize:l.fontSize,color:"#6b7280",fontFamily:"inherit"},"aria-label":"Show all breadcrumb items"},"...")):m?v.push(o("span",{"aria-current":"page",style:{color:"#1f2937",fontWeight:"600",fontSize:l.fontSize}},f.label)):f.href?v.push(o("a",{href:f.href,onClick:f.onClick?D=>{D.preventDefault(),f.onClick()}:void 0,style:{color:"#2563eb",textDecoration:"none",fontSize:l.fontSize}},f.label)):f.onClick?v.push(o("button",{type:"button",onClick:f.onClick,style:{background:"none",border:"none",cursor:"pointer",color:"#2563eb",padding:"0",fontSize:l.fontSize,fontFamily:"inherit"}},f.label)):v.push(o("span",{style:{color:"#6b7280",fontSize:l.fontSize}},f.label)),o("li",{key:String(y),style:{display:"inline-flex",alignItems:"center"}},...v)},p=u.map((f,y)=>c(f,y,u));return o(_e,{orientation:"horizontal",role:"navigation",ariaLabel:"Breadcrumb",keyboardNav:!1,styling:{border:"none",borderRadius:"0",padding:l.padding,backgroundColor:"transparent"}},o("ol",{style:{display:"flex",alignItems:"center",listStyle:"none",margin:"0",padding:"0",flexWrap:"wrap"}},...p))}function ur(e){let{item:t,itemStyle:n,closeOnSelect:r,onClose:i}=e,{hover:s,onMouseEnter:a,onMouseLeave:l}=Be(),[d,u]=j(!1),h=t.children&&t.children.length>0;if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let g=t.disabled===!0,p={...bt(n,{hover:!g&&s,active:!1}),position:"relative",justifyContent:"space-between",...g?{color:"#9ca3af",cursor:"default",opacity:"0.6"}:{}},f=S(()=>{if(!g){if(h){u(D=>!D);return}t.onClick&&t.onClick(),r&&i()}},[g,h,t,r,i]),y=S(()=>{a(),h&&u(!0)},[h,a]),b=S(()=>{l(),h&&u(!1)},[h,l]),m=o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},t.icon?o("span",{style:{flexShrink:"0"},"aria-hidden":"true"},t.icon):null,o("span",null,t.label)),x=h?o("span",{style:{marginLeft:"8px",fontSize:"10px",lineHeight:"1"},"aria-hidden":"true"},"\u203A"):null,v=h&&d?o("div",{style:{position:"absolute",left:"100%",top:"0",zIndex:"1000"}},o(_e,{orientation:"vertical",role:"menu",styling:{boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #e5e7eb",borderRadius:"6px",width:"200px",backgroundColor:"#ffffff"}},...t.children.map(D=>o(ur,{key:D.id,item:D,itemStyle:n,closeOnSelect:r,onClose:i})))):null;return o("div",{style:{position:"relative"},onMouseEnter:y,onMouseLeave:b},o("button",{type:"button",role:"menuitem",style:p,onClick:f,disabled:g||void 0,tabIndex:g?-1:0,"aria-disabled":g?"true":void 0,"aria-haspopup":h||void 0,"aria-expanded":h?String(d):void 0},m,x),v)}function pr(e){let{label:t,items:n,triggerStyle:r,menuStyle:i,itemStyle:s={},placement:a="bottom-start",closeOnSelect:l=!0,width:d="220px"}=e,[u,h]=j(!1),g=ne(null),c=S(()=>{h(D=>!D)},[]),p=S(()=>{h(!1)},[]);re(()=>{if(!u)return;let D=A=>{let M=g.current;M&&!M.contains(A.target)&&h(!1)};return document.addEventListener("click",D,!0),()=>{document.removeEventListener("click",D,!0)}},[u]),re(()=>{if(!u)return;let D=A=>{A.key==="Escape"&&h(!1)};return document.addEventListener("keydown",D),()=>{document.removeEventListener("keydown",D)}},[u]);let f={display:"inline-flex",alignItems:"center",gap:"4px",padding:"8px 16px",fontSize:"14px",fontFamily:"inherit",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",color:"#1f2937",cursor:"pointer",outline:"none",...r??{}},y=o("button",{type:"button",style:f,onClick:c,"aria-haspopup":"true","aria-expanded":String(u)},o("span",null,t),o("span",{style:{marginLeft:"4px",fontSize:"10px",transition:"transform 0.15s",transform:u?"rotate(180deg)":"rotate(0deg)"},"aria-hidden":"true"},"\u25BC")),b=typeof d=="number"?`${d}px`:d,m={position:"absolute",top:"100%",...a==="bottom-end"?{right:"0"}:{left:"0"},marginTop:"4px",zIndex:"999"},x={boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #e5e7eb",borderRadius:"6px",padding:"4px 0",width:b,backgroundColor:"#ffffff",...i??{}},v=u?o("div",{style:m},o(_e,{orientation:"vertical",role:"menu",ariaLabel:`${t} menu`,styling:x},...n.map(D=>o(ur,{key:D.id,item:D,itemStyle:s,closeOnSelect:l,onClose:p})))):null;return o("div",{ref:g,style:{position:"relative",display:"inline-block"}},y,v)}function fr(e){let{item:t,onClose:n,index:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:a}=Be(),[l,d]=j(!1),u=t.children&&t.children.length>0;if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let h=t.disabled===!0,g=S(()=>{if(!h){if(u){d(x=>!x);return}t.onClick&&t.onClick(),n()}},[h,u,t,n]),c=S(()=>{s(),u&&d(!0)},[u,s]),p=S(()=>{a(),u&&d(!1)},[u,a]),f={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 16px",fontSize:"13px",fontFamily:"inherit",border:"none",outline:"none",width:"100%",textAlign:"left",cursor:h?"default":"pointer",backgroundColor:!h&&i?"#f3f4f6":"transparent",color:h?"#9ca3af":"#1f2937",opacity:h?"0.6":"1",transition:"background-color 0.1s",boxSizing:"border-box"},y=o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},t.icon?o("span",{style:{width:"16px",textAlign:"center"},"aria-hidden":"true"},t.icon):o("span",{style:{width:"16px"}}),o("span",null,t.label)),b=u?o("span",{style:{fontSize:"10px",color:"#9ca3af"},"aria-hidden":"true"},"\u25B6"):t.shortcut?o("span",{style:{fontSize:"11px",color:"#9ca3af",marginLeft:"24px"}},t.shortcut):null,m=u&&l?o("div",{style:{position:"absolute",left:"100%",top:"0",zIndex:"1001"}},o("div",{role:"menu",style:{backgroundColor:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"180px"}},...t.children.map((x,v)=>o(fr,{key:String(v),item:x,onClose:n,index:v})))):null;return o("div",{style:{position:"relative"},onMouseEnter:c,onMouseLeave:p},o("button",{type:"button",role:"menuitem",style:f,onClick:g,disabled:h||void 0,tabIndex:-1,"aria-disabled":h||void 0,"aria-haspopup":u||void 0,"aria-expanded":u?l:void 0},y,b),m)}function al(e){let{menu:t,index:n,isOpen:r,anyOpen:i,onOpen:s,onClose:a}=e,{hover:l,onMouseEnter:d,onMouseLeave:u}=Be(),h=ne(null),g=S(()=>{r?a():s(n)},[r,n,s,a]),c=S(()=>{d(),i&&!r&&s(n)},[i,r,n,s,d]),p={display:"inline-flex",alignItems:"center",padding:"6px 12px",fontSize:"13px",fontFamily:"inherit",border:"none",outline:"none",cursor:"pointer",backgroundColor:r?"#e5e7eb":l?"#f3f4f6":"transparent",color:"#1f2937",borderRadius:"4px",transition:"background-color 0.1s"},f=r?o("div",{style:{position:"absolute",top:"100%",left:"0",zIndex:"1000",marginTop:"2px"}},o("div",{role:"menu","aria-label":`${t.label} menu`,style:{backgroundColor:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"200px"}},...t.items.map((y,b)=>o(fr,{key:String(b),item:y,onClose:a,index:b})))):null;return o("div",{style:{position:"relative",display:"inline-block"},onMouseEnter:c,onMouseLeave:u},o("button",{ref:h,type:"button",role:"menuitem",style:p,onClick:g,"aria-haspopup":"true","aria-expanded":String(r),tabIndex:0},t.label),f)}function gr(e){let{menus:t}=e,[n,r]=j(null),i=ne(null),s=S(d=>{r(d)},[]),a=S(()=>{r(null)},[]);re(()=>{if(n===null)return;let d=u=>{let h=i.current;h&&!h.contains(u.target)&&r(null)};return document.addEventListener("click",d,!0),()=>{document.removeEventListener("click",d,!0)}},[n]),re(()=>{let d=i.current;if(!d)return;let u=h=>{let g=h;if(g.key==="Escape"){r(null);return}if(g.key==="ArrowRight"){g.preventDefault(),r(c=>c===null?0:(c+1)%t.length);return}if(g.key==="ArrowLeft"){g.preventDefault(),r(c=>c===null?t.length-1:(c-1+t.length)%t.length);return}if(g.key==="ArrowDown"&&n!==null){g.preventDefault();let c=d.querySelector('[role="menu"]');if(c){let p=c.querySelector('[role="menuitem"]');p&&p.focus()}return}g.key==="Enter"||g.key};return d.addEventListener("keydown",u),()=>{d.removeEventListener("keydown",u)}},[n,t.length]);let l=t.map((d,u)=>o(al,{key:String(u),menu:d,index:u,isOpen:n===u,anyOpen:n!==null,onOpen:s,onClose:a}));return o("div",{ref:i,role:"menubar","aria-label":"Menu bar",style:{display:"flex",alignItems:"center",backgroundColor:"#ffffff",borderBottom:"1px solid #e5e7eb",padding:"2px 4px",fontFamily:"inherit",fontSize:"13px",gap:"2px"}},...l)}function Yt(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function ll(e,t,n){let r=n*2+5;if(e<=r)return Yt(1,e);let i=Math.max(t-n,1),s=Math.min(t+n,e),a=i>2,l=s<e-1;return!a&&l?[...Yt(1,n*2+3),"ellipsis",e]:a&&!l?[1,"ellipsis",...Yt(e-n*2-2,e)]:[1,"ellipsis",...Yt(i,s),"ellipsis",e]}var Vt={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"36px",height:"36px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",color:"#374151",fontSize:"14px",fontFamily:"inherit",cursor:"pointer",transition:"background-color 0.15s, color 0.15s",outline:"none",userSelect:"none"},cl={...Vt,backgroundColor:"#2563eb",color:"#ffffff",borderColor:"#2563eb",fontWeight:"600"},mr={...Vt,color:"#9ca3af",cursor:"default",opacity:"0.5"},dl={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"36px",height:"36px",color:"#6b7280",fontSize:"14px",userSelect:"none"};function hr(e){let{total:t,pageSize:n,currentPage:r,onChange:i,siblingCount:s=1,showFirstLast:a=!0,showPrevNext:l=!0,disabled:d=!1}=e,u=Math.max(1,Math.ceil(t/n)),h=Math.min(Math.max(1,r),u),g=S(b=>{!d&&b>=1&&b<=u&&b!==h&&i(b)},[d,u,h,i]),c=(b,m,x)=>{let v=d||m<1||m>u||m===h;return o("button",{type:"button",onClick:()=>g(m),disabled:v||void 0,"aria-label":x,style:v?mr:Vt},b)},p=ll(u,h,s),f=0,y=[];a&&y.push(c("\xAB",1,"Go to first page")),l&&y.push(c("\u2039",h-1,"Go to previous page"));for(let b of p)if(b==="ellipsis")y.push(o("span",{key:`ellipsis-${f++}`,style:dl},"..."));else{let m=b===h;y.push(o("button",{key:String(b),type:"button",onClick:()=>g(b),disabled:d||void 0,"aria-label":`Page ${b}`,"aria-current":m?"page":void 0,style:d?mr:m?cl:Vt},String(b)))}return l&&y.push(c("\u203A",h+1,"Go to next page")),a&&y.push(c("\xBB",u,"Go to last page")),o(_e,{orientation:"horizontal",role:"navigation",ariaLabel:"Pagination",keyboardNav:!0,styling:{border:"none",borderRadius:"0",backgroundColor:"transparent",padding:"0",custom:{gap:"4px"}}},...y)}function br(e){let{item:t,collapsed:n,selectedId:r,onSelect:i,depth:s}=e,{hover:a,onMouseEnter:l,onMouseLeave:d}=Be(),[u,h]=j(!1),g=t.children&&t.children.length>0,c=t.id===r,p=S(()=>{g&&!n&&h(T=>!T),i&&i(t.id)},[g,n,i,t.id]),f=n?"0":`${16+s*16}px`,y={display:"flex",alignItems:"center",padding:n?"10px 0":`10px 12px 10px ${f}`,justifyContent:n?"center":"flex-start",cursor:"pointer",backgroundColor:c?"#eff6ff":a?"#f3f4f6":"transparent",color:c?"#2563eb":"#1f2937",border:"none",outline:"none",width:"100%",textAlign:"left",font:"inherit",fontSize:"14px",transition:"background-color 0.15s",position:"relative",gap:"10px",boxSizing:"border-box"},b=t.icon?o("span",{style:{flexShrink:"0",fontSize:"16px"},"aria-hidden":"true"},t.icon):null,m=n?null:o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.label),x=!n&&t.badge?o("span",{style:{backgroundColor:"#ef4444",color:"#ffffff",fontSize:"11px",fontWeight:"600",padding:"1px 6px",borderRadius:"10px",marginLeft:"4px",flexShrink:"0"}},t.badge):null,v=!n&&g?o("span",{style:{fontSize:"10px",transition:"transform 0.15s",transform:u?"rotate(90deg)":"rotate(0deg)",marginLeft:"4px"},"aria-hidden":"true"},"\u25B6"):null,D=n&&a?o("div",{style:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px",padding:"4px 10px",backgroundColor:"#1f2937",color:"#ffffff",fontSize:"12px",borderRadius:"4px",whiteSpace:"nowrap",zIndex:"1000",pointerEvents:"none"},role:"tooltip"},t.label):null,A=o("button",{type:"button",style:y,onClick:p,onMouseEnter:l,onMouseLeave:d,"aria-selected":c?"true":"false",title:n?t.label:void 0},b,m,x,v,D),M=!n&&g&&u?t.children.map(T=>o(br,{key:T.id,item:T,collapsed:n,selectedId:r,onSelect:i,depth:s+1})):null;return o("div",{key:t.id,style:{position:"relative"}},A,M?o("div",{role:"group"},...M):null)}function xr(e){let{items:t,collapsed:n=!1,onToggleCollapse:r,selectedId:i,onSelect:s,width:a="240px",collapsedWidth:l="56px"}=e,d=n?typeof l=="number"?`${l}px`:l:typeof a=="number"?`${a}px`:a,u=r?o("button",{type:"button",onClick:r,"aria-label":n?"Expand sidebar":"Collapse sidebar",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",padding:"10px 0",border:"none",borderBottom:"1px solid #e5e7eb",backgroundColor:"transparent",cursor:"pointer",fontSize:"14px",color:"#6b7280",fontFamily:"inherit"}},n?"\u25B6":"\u25C0"):null,h=t.map(g=>o(br,{key:g.id,item:g,collapsed:n,selectedId:i,onSelect:s,depth:0}));return o(_e,{orientation:"vertical",role:"navigation",ariaLabel:"Sidebar",keyboardNav:!0,styling:{width:d,border:"1px solid #e5e7eb",borderRadius:"0",padding:"0",backgroundColor:"#ffffff",custom:{height:"100%",transition:"width 0.2s",overflow:"hidden"}}},u,...h)}var Ve={completed:"#2563eb",completedBg:"#2563eb",completedText:"#ffffff",active:"#2563eb",activeBorder:"#2563eb",activeText:"#2563eb",pending:"#d1d5db",pendingText:"#9ca3af",line:"#d1d5db",lineCompleted:"#2563eb",labelActive:"#1f2937",labelPending:"#9ca3af",descriptionColor:"#6b7280"};function yr(e){let{steps:t,currentStep:n,orientation:r="horizontal",onChange:i,clickable:s=!1,variant:a="circle"}=e,l=r==="horizontal",d=a==="circle"?32:12,u=a==="dot"?12:32,h=S(b=>{s&&i&&i(b)},[s,i]),g=b=>b<n?"completed":b===n?"active":"pending",c=(b,m,x)=>{let v=a==="dot"?u:d,D={width:`${v}px`,height:`${v}px`,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:a==="circle"?"14px":"0",fontWeight:"600",flexShrink:"0",transition:"background-color 0.2s, border-color 0.2s"};return x==="completed"?o("div",{style:{...D,backgroundColor:Ve.completedBg,color:Ve.completedText,border:`2px solid ${Ve.completed}`}},a==="circle"?m.icon||"\u2713":null):x==="active"?o("div",{style:{...D,backgroundColor:"#ffffff",color:Ve.activeText,border:`2px solid ${Ve.activeBorder}`,boxShadow:"0 0 0 3px rgba(37, 99, 235, 0.2)"}},a==="circle"?m.icon||String(b+1):o("div",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:Ve.active}})):o("div",{style:{...D,backgroundColor:"#ffffff",color:Ve.pendingText,border:`2px solid ${Ve.pending}`}},a==="circle"?m.icon||String(b+1):null)},p=b=>{if(b>=t.length-1)return null;let x=b<n?Ve.lineCompleted:Ve.line;return l?o("div",{style:{flex:"1",height:"2px",backgroundColor:x,margin:"0 8px",alignSelf:"center",transition:"background-color 0.2s"}}):o("div",{style:{width:"2px",flex:"1",minHeight:"24px",backgroundColor:x,marginLeft:`${(a==="dot"?u:d)/2-1}px`,transition:"background-color 0.2s"}})},f=(b,m)=>{let x=g(m),v=x==="active",D=x==="completed",A=c(m,b,x),M={fontSize:"13px",fontWeight:v?"600":"400",color:v||D?Ve.labelActive:Ve.labelPending,marginTop:l?"8px":"0",marginLeft:l?"0":"12px",textAlign:l?"center":"left",transition:"color 0.2s"},T={fontSize:"11px",color:Ve.descriptionColor,marginTop:"2px",textAlign:l?"center":"left"},L=o("div",{style:l?{display:"flex",flexDirection:"column",alignItems:"center"}:{display:"flex",flexDirection:"column"}},o("span",{style:M},b.label),b.description?o("span",{style:T},b.description):null),I=l?o("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"}},A,L):o("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"}},A,L);return o(s?"button":"div",{key:String(m),onClick:s?()=>h(m):void 0,style:{display:"flex",flexDirection:l?"column":"row",alignItems:l?"center":"flex-start",background:"none",border:"none",padding:"0",cursor:s?"pointer":"default",fontFamily:"inherit",outline:"none"},"aria-current":v?"step":void 0},I)},y=[];return t.forEach((b,m)=>{y.push(f(b,m));let x=p(m);x&&y.push(x)}),o("div",{role:"navigation","aria-label":"Progress steps",style:{display:"flex",flexDirection:l?"row":"column",alignItems:l?"flex-start":"stretch",width:"100%"}},...y)}var Sr={sm:{height:"28px",padding:"4px 8px",fontSize:"12px",iconSize:"14px"},md:{height:"36px",padding:"6px 12px",fontSize:"14px",iconSize:"16px"},lg:{height:"44px",padding:"8px 16px",fontSize:"16px",iconSize:"18px"}};function ul(e){let{item:t,size:n,variant:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:a}=Be(),l=Sr[n],d=t.disabled===!0,u=t.type==="toggle",[h,g]=j(!1),c=u?t.active===!0:h,p=S(()=>{!d&&t.onClick&&t.onClick()},[d,t]),f=S(()=>{!d&&!u&&g(!0)},[d,u]),y=S(()=>{u||g(!1)},[u]),b=S(()=>{a(),u||g(!1)},[u,a]),m={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"6px",height:l.height,padding:l.padding,fontSize:l.fontSize,fontFamily:"inherit",border:r==="raised"?"1px solid #d1d5db":"1px solid transparent",borderRadius:"4px",backgroundColor:c?"#e0e7ff":!d&&i?"#f3f4f6":r==="raised"?"#ffffff":"transparent",color:d?"#9ca3af":c?"#2563eb":"#374151",cursor:d?"default":"pointer",opacity:d?"0.5":"1",outline:"none",transition:"background-color 0.15s"},x=t.icon?o("span",{style:{fontSize:l.iconSize},"aria-hidden":"true"},t.icon):null,v=t.label?o("span",null,t.label):null,D=t.type==="dropdown"?o("span",{style:{fontSize:"10px",marginLeft:"2px"},"aria-hidden":"true"},"\u25BC"):null;return o("button",{type:"button",style:m,onClick:p,onMouseDown:f,onMouseUp:y,onMouseEnter:s,onMouseLeave:b,disabled:d||void 0,"aria-pressed":u?c:void 0,"aria-label":t.label||t.id,title:t.label||t.id},x,v,D)}function vr(e){let{items:t,size:n="md",variant:r="flat"}=e,i=Sr[n],s=t.map(a=>a.type==="separator"?o("div",{key:a.id,role:"separator","aria-orientation":"vertical",style:{width:"1px",height:i.height,backgroundColor:"#d1d5db",margin:"0 4px",flexShrink:"0"}}):a.type==="spacer"?o("div",{key:a.id,style:{flex:"1"},"aria-hidden":"true"}):o(ul,{key:a.id,item:a,size:n,variant:r}));return o(_e,{orientation:"horizontal",role:"toolbar",ariaLabel:"Toolbar",keyboardNav:!0,styling:{border:r==="raised"?"1px solid #e5e7eb":"none",borderRadius:r==="raised"?"8px":"0",padding:"4px",backgroundColor:r==="raised"?"#ffffff":"transparent",boxShadow:r==="raised"?"0 1px 3px rgba(0,0,0,0.1)":void 0,custom:{gap:"2px",alignItems:"center"}}},...s)}var xt=class e{constructor(t,n){Qe(this,"id");Qe(this,"label");Qe(this,"children");Qe(this,"expanded");Qe(this,"icon");Qe(this,"metadata");Qe(this,"parent");Qe(this,"depth");this.id=t.id,this.label=t.label,this.expanded=t.expanded??!1,this.icon=t.icon??null,this.metadata=t.metadata??{},this.parent=n??null,this.depth=n?n.depth+1:0,this.children=(t.children??[]).map(r=>new e(r,this))}static fromData(t){return new e(t)}isLeaf(){return this.children.length===0}isRoot(){return this.parent===null}walk(t){t(this,this.depth);for(let n of this.children)n.walk(t)}find(t){if(this.id===t)return this;for(let n of this.children){let r=n.find(t);if(r)return r}return null}toggle(){this.expanded=!this.expanded}expand(){this.expanded=!0}collapse(){this.expanded=!1}addChild(t){let n=new e(t,this);return this.children.push(n),n}removeChild(t){let n=this.children.findIndex(r=>r.id===t);return n===-1?!1:(this.children.splice(n,1),!0)}};function wr(e){e.expanded=!0;for(let t of e.children)wr(t)}function kr(e,t=[]){if(t.push(e),e.expanded)for(let n of e.children)kr(n,t);return t}function pl(e){if(!e.parent)return!0;let t=e.parent.children;return t[t.length-1]===e}function fl(e){let{node:t,isSelected:n,indentPx:r,lineColor:i,lineWidth:s,iconExpanded:a,iconCollapsed:l,nodeStyle:d,renderNode:u,onToggle:h,onClick:g,focusedId:c}=e,p=Be(),f=ne(null),y=c===t.id;re(()=>{y&&f.current&&f.current.focus()},[y]);let b=t.isLeaf(),m=t.depth,x=[];for(let T=0;T<m;T++){let L=t;for(let P=0;P<m-T;P++)L=L?L.parent:null;let I=L?!pl(L):!1;x.push(o("span",{key:`connector-${T}`,"aria-hidden":"true",style:{display:"inline-block",width:`${r}px`,height:"100%",position:"relative",flexShrink:"0",...I?{borderLeft:`${s}px solid ${i}`}:{}}}))}let v=m>0?o("span",{"aria-hidden":"true",style:{display:"inline-block",width:`${Math.floor(r/2)}px`,height:"0",borderTop:`${s}px solid ${i}`,flexShrink:"0",alignSelf:"center",marginLeft:`-${r}px`}}):null,D=b?o("span",{"aria-hidden":"true",style:{display:"inline-block",width:"18px",flexShrink:"0",marginRight:"4px"}}):o("span",{"aria-hidden":"true",role:"button",tabIndex:0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"18px",height:"18px",fontSize:"14px",lineHeight:"1",cursor:"pointer",userSelect:"none",flexShrink:"0",marginRight:"4px",fontFamily:"monospace"},onClick:T=>{T.stopPropagation(),h(t)}},t.expanded?a:l),A=u?u(t,n):o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.icon?o("span",{style:{marginRight:"6px"}},t.icon):null,t.label),M=bt(d,{hover:p.hover,active:n});return o("div",{ref:f,role:"treeitem","aria-expanded":b?void 0:String(t.expanded),"aria-selected":n?"true":"false","aria-level":m+1,tabIndex:y?0:-1,style:{...M,display:"flex",alignItems:"stretch",padding:"0"},onMouseEnter:p.onMouseEnter,onMouseLeave:p.onMouseLeave,onClick:()=>g(t)},...x,v,o("span",{style:{display:"flex",alignItems:"center",flex:"1",padding:d.padding??"6px 10px",minWidth:"0"}},D,A))}function Cr(e){let{root:t,onNodeClick:n,onNodeExpand:r,onNodeCollapse:i,selectedId:s,expandAll:a=!1,lineColor:l="#000",lineWidth:d=1,indentPx:u=20,iconExpanded:h="\u2212",iconCollapsed:g="+",nodeStyle:c={},wrapperStyle:p,renderNode:f}=e,[y,b]=j(()=>{let I=xt.fromData(t);return a&&wr(I),I}),[m,x]=j(t.id),v=q(()=>kr(y),[y]),D=S(()=>{b(I=>{let P=Object.create(Object.getPrototypeOf(I));return Object.assign(P,I),P})},[]),A=S(I=>{I.toggle(),I.expanded?r?.(I):i?.(I),D()},[r,i,D]),M=S(I=>{x(I.id),n?.(I)},[n]),T=S(I=>{let P=I;if(!m)return;let B=v.findIndex(N=>N.id===m);if(B===-1)return;let E=v[B];switch(P.key){case"ArrowDown":{P.preventDefault();let N=v[B+1];N&&x(N.id);break}case"ArrowUp":{P.preventDefault();let N=v[B-1];N&&x(N.id);break}case"ArrowRight":{P.preventDefault(),E.isLeaf()||(E.expanded?E.children.length>0&&x(E.children[0].id):A(E));break}case"ArrowLeft":{P.preventDefault(),!E.isLeaf()&&E.expanded?A(E):E.parent&&x(E.parent.id);break}case"Enter":{P.preventDefault(),M(E);break}case" ":{P.preventDefault(),E.isLeaf()||A(E);break}case"Home":{P.preventDefault(),v.length>0&&x(v[0].id);break}case"End":{P.preventDefault(),v.length>0&&x(v[v.length-1].id);break}}},[m,v,A,M]),L=v.map(I=>o(fl,{key:I.id,node:I,isSelected:I.id===s,indentPx:u,lineColor:l,lineWidth:d,iconExpanded:h,iconCollapsed:g,nodeStyle:c,renderNode:f,onToggle:A,onClick:M,focusedId:m}));return o(_e,{role:"tree",ariaLabel:"Tree navigation",styling:p,keyboardNav:!1},o("div",{onKeyDown:T,style:{outline:"none"}},...L))}function Mr(e){let{items:t,position:n,onClose:r,depth:i}=e,[s,a]=j(-1),[l,d]=j(null),u=ne(null);re(()=>{if(!u.current)return;u.current.focus();let c=f=>{let y=f,b=t.map((m,x)=>({item:m,i:x})).filter(({item:m})=>!m.divider);if(y.key==="ArrowDown")y.preventDefault(),a(m=>{let v=(b.findIndex(({i:D})=>D===m)+1)%b.length;return b[v].i});else if(y.key==="ArrowUp")y.preventDefault(),a(m=>{let x=b.findIndex(({i:D})=>D===m),v=x<=0?b.length-1:x-1;return b[v].i});else if(y.key==="ArrowRight")s>=0&&t[s]?.children&&d(s);else if(y.key==="ArrowLeft")i>0&&r();else if(y.key==="Enter"){if(y.preventDefault(),s>=0){let m=t[s];m.children?d(s):!m.disabled&&m.onClick&&(m.onClick(),r())}}else y.key==="Escape"&&r()};u.current.addEventListener("keydown",c);let p=u.current;return()=>p.removeEventListener("keydown",c)},[t,s,i,r]);let h={position:"fixed",left:`${n.x}px`,top:`${n.y}px`,backgroundColor:"#fff",border:"1px solid #e5e7eb",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.15)",padding:"4px 0",minWidth:"180px",zIndex:`${10200+i}`,outline:"none",overflow:"visible"},g=t.map((c,p)=>{if(c.divider)return o("div",{key:`divider-${p}`,style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let f=s===p,y=!!c.disabled,b=!!(c.children&&c.children.length>0),m={display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",fontSize:"14px",color:y?"#9ca3af":"#1f2937",cursor:y?"default":"pointer",backgroundColor:f&&!y?"#f3f4f6":"transparent",userSelect:"none",position:"relative"},x=()=>{a(p),d(b?p:null)},v=()=>{if(!y){if(b){d(p);return}c.onClick&&c.onClick(),r()}},D=[];c.icon&&D.push(o("span",{style:{width:"20px",textAlign:"center",flexShrink:"0"}},c.icon)),D.push(o("span",{style:{flex:"1"}},c.label??"")),b&&D.push(o("span",{style:{fontSize:"10px",color:"#9ca3af",marginLeft:"8px"}},"\u25B6"));let A=[o("div",{key:`item-${p}`,style:m,onMouseEnter:x,onClick:v,role:"menuitem","aria-disabled":y?"true":void 0},...D)];return b&&l===p&&A.push(o(Mr,{key:`submenu-${p}`,items:c.children,position:{x:n.x+178,y:n.y+p*36},onClose:()=>d(null),depth:i+1})),o("div",{key:`wrap-${p}`,style:{position:"relative"}},...A)});return o("div",{ref:u,style:h,tabIndex:-1,role:"menu"},...g)}function Ut(e){let{items:t,children:n}=e,[r,i]=j(null),s=S(u=>{u.preventDefault();let h=u;i({x:h.clientX,y:h.clientY})},[]),a=S(()=>{i(null)},[]);re(()=>{if(!r)return;let u=g=>{a()},h=setTimeout(()=>{document.addEventListener("mousedown",u)},0);return()=>{clearTimeout(h),document.removeEventListener("mousedown",u)}},[r,a]),re(()=>{if(!r)return;let u=h=>{h.key==="Escape"&&a()};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[r,a]);let d=[o("div",{onContextMenu:s,style:{display:"contents"}},n)];return r&&d.push(o(Mr,{items:t,position:r,onClose:a,depth:0})),o("div",null,...d)}function gl(e,t){if(t)return"translate3d(0, 0, 0)";switch(e){case"left":return"translate3d(-100%, 0, 0)";case"right":return"translate3d(100%, 0, 0)";case"top":return"translate3d(0, -100%, 0)";case"bottom":return"translate3d(0, 100%, 0)"}}function ml(e,t){let n={position:"fixed",zIndex:"10001",backgroundColor:"#fff",boxShadow:"0 0 24px rgba(0, 0, 0, 0.15)",display:"flex",flexDirection:"column",overflow:"hidden"};switch(e){case"left":return{...n,top:"0",left:"0",bottom:"0",width:t};case"right":return{...n,top:"0",right:"0",bottom:"0",width:t};case"top":return{...n,top:"0",left:"0",right:"0",height:t};case"bottom":return{...n,bottom:"0",left:"0",right:"0",height:t}}}function Er(e){let{open:t,onClose:n,position:r="right",size:i="320px",title:s,overlay:a=!0,closeOnOverlay:l=!0,closeOnEscape:d=!0,children:u}=e,[h,g]=j(!1),[c,p]=j(!1),f=ne(null),y=s?"drawer-title":void 0;if(re(()=>{if(t)g(!0),requestAnimationFrame(()=>p(!0));else{p(!1);let I=setTimeout(()=>g(!1),300);return()=>clearTimeout(I)}},[t]),re(()=>{if(!t||!d)return;let I=P=>{P.key==="Escape"&&n()};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[t,d,n]),re(()=>{if(!t)return;let I=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=I}},[t]),re(()=>{t&&f.current&&f.current.focus()},[t]),!h)return null;let b={position:"fixed",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:"10000",opacity:c?"1":"0",transition:"opacity 0.3s ease"},m={...ml(r,i),transform:gl(r,c),transition:"transform 0.3s ease"},x={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"},v={margin:"0",fontSize:"16px",fontWeight:"600",color:"#111827"},D={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",lineHeight:"1"},A={padding:"20px",overflow:"auto",flex:"1"},M=()=>{l&&n()},T=[];s&&T.push(o("div",{style:x},o("h3",{id:y,style:v},s),o("button",{type:"button",style:D,onClick:n,"aria-label":"Close drawer"},"\xD7"))),T.push(o("div",{style:A},u));let L=[];return a&&L.push(o("div",{style:b,onClick:M})),L.push(o("div",{ref:f,style:m,role:"dialog","aria-modal":"true","aria-labelledby":y,tabIndex:-1},...T)),o("div",null,...L)}var hl={sm:"400px",md:"600px",lg:"800px",full:"100vw"};function Ir(e){let{open:t,onClose:n,title:r,size:i="md",closeOnOverlay:s=!0,closeOnEscape:a=!0,footer:l,showCloseButton:d=!0,children:u}=e,h=ne(null);if(re(()=>{if(!t)return;let M=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=M}},[t]),re(()=>{if(!t||!a)return;let M=T=>{T.key==="Escape"&&n()};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[t,a,n]),re(()=>{t&&h.current&&h.current.focus()},[t]),!t)return null;let g={position:"fixed",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"10000"},c={backgroundColor:"#fff",borderRadius:i==="full"?"0":"8px",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.3)",maxHeight:i==="full"?"100vh":"90vh",width:hl[i],maxWidth:i==="full"?"100vw":"90vw",display:"flex",flexDirection:"column",outline:"none",overflow:"hidden"},p={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 24px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"},f={margin:"0",fontSize:"18px",fontWeight:"600",color:"#111827"},y={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",borderRadius:"4px",lineHeight:"1"},b={padding:"24px",overflow:"auto",flex:"1"},m={padding:"16px 24px",borderTop:"1px solid #e5e7eb",flexShrink:"0"},x=M=>{s&&M.target===M.currentTarget&&n()},v=[],D=r?"modal-title":void 0;r?v.push(o("h2",{id:D,style:f},r)):v.push(o("span",null)),d&&v.push(o("button",{type:"button",style:y,onClick:n,"aria-label":"Close modal"},"\xD7"));let A=[o("div",{style:p},...v),o("div",{style:b},u)];return l&&A.push(o("div",{style:m},l)),o("div",{style:g,onClick:x,"aria-modal":"true",role:"dialog","aria-labelledby":D},o("div",{ref:h,style:c,tabIndex:-1,role:"document"},...A))}var Rr=8;function bl(e,t){let n=t+Rr;switch(e){case"top":return{position:"absolute",bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:`${n}px`};case"bottom":return{position:"absolute",top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:`${n}px`};case"left":return{position:"absolute",right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:`${n}px`};case"right":return{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:`${n}px`}}}function xl(e){let t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n=`${Rr}px`,r="transparent";switch(e){case"top":return{...t,bottom:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`${n} ${n} 0 ${n}`,borderColor:`#fff ${r} ${r} ${r}`};case"bottom":return{...t,top:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`0 ${n} ${n} ${n}`,borderColor:`${r} ${r} #fff ${r}`};case"left":return{...t,right:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} 0 ${n} ${n}`,borderColor:`${r} ${r} ${r} #fff`};case"right":return{...t,left:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} ${n} ${n} 0`,borderColor:`${r} #fff ${r} ${r}`}}}function Pr(e){let{trigger:t,content:n,open:r,placement:i="bottom",offset:s=4,arrow:a=!1,closeOnClickOutside:l=!0,onOpenChange:d}=e,u=r!==void 0,[h,g]=j(!1),c=u?r:h,p=ne(null),f=S(()=>{u?d&&d(!r):g(D=>!D)},[u,r,d]);re(()=>{if(!c||!l)return;let D=A=>{p.current&&!p.current.contains(A.target)&&(u?d&&d(!1):g(!1))};return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[c,l,u,d]);let y={position:"relative",display:"inline-block"},b={...bl(i,s),backgroundColor:"#fff",borderRadius:"8px",boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",border:"1px solid #e5e7eb",padding:"12px 16px",zIndex:"10000",whiteSpace:"nowrap"},m=[n];a&&m.push(o("div",{style:xl(i)}));let x=S(D=>{let A=D.key;(A==="Enter"||A===" ")&&(D.preventDefault(),f())},[f]),v=[o("div",{onClick:f,onKeyDown:x,role:"button",tabIndex:0,style:{display:"inline-block"}},t)];return c&&v.push(o("div",{style:b},...m)),o("div",{ref:p,style:y},...v)}var yl=0;function Sl(){return`toast-${++yl}-${Date.now()}`}function yn(e={}){let t={position:e.position??"top-right",maxToasts:e.maxToasts??5,defaultDuration:e.defaultDuration??4e3},n=[],r=new Set;function i(){r.forEach(d=>d())}function s(d,u={}){let h=Sl();return n=[{id:h,message:d,type:u.type??"info",duration:u.duration??t.defaultDuration,action:u.action,createdAt:Date.now()},...n].slice(0,t.maxToasts),i(),h}function a(d){n=n.filter(u=>u.id!==d),i()}function l(){n=[],i()}return{toast:s,dismiss:a,dismissAll:l,subscribe:d=>(r.add(d),()=>{r.delete(d)}),getToasts:()=>n,config:t}}var vl={info:{bg:"#eff6ff",border:"#3b82f6",icon:"\u2139\uFE0F"},success:{bg:"#f0fdf4",border:"#22c55e",icon:"\u2705"},warning:{bg:"#fffbeb",border:"#f59e0b",icon:"\u26A0\uFE0F"},error:{bg:"#fef2f2",border:"#ef4444",icon:"\u274C"}};function wl(e){let t={position:"fixed",zIndex:"10100",display:"flex",flexDirection:"column",gap:"8px",padding:"16px",pointerEvents:"none"},n=e.startsWith("top"),r=e.startsWith("bottom"),i=e.endsWith("left"),s=e.endsWith("right"),a=e.endsWith("center");return n&&(t.top="0"),r&&(t.bottom="0",t.flexDirection="column-reverse"),i&&(t.left="0"),s&&(t.right="0"),a&&(t.left="50%",t.transform="translateX(-50%)"),t}function kl(e){let{item:t,onDismiss:n}=e,r=vl[t.type];re(()=>{if(t.duration<=0)return;let u=setTimeout(()=>n(t.id),t.duration);return()=>clearTimeout(u)},[t.id,t.duration,n]);let i={backgroundColor:r.bg,borderLeft:`4px solid ${r.border}`,borderRadius:"6px",padding:"12px 16px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.1)",display:"flex",alignItems:"center",gap:"10px",pointerEvents:"auto",minWidth:"280px",maxWidth:"420px",animation:"specifyjs-toast-slide-in 0.3s ease forwards"},s={flex:"1",fontSize:"14px",color:"#1f2937",lineHeight:"1.4"},a={background:"none",border:"none",cursor:"pointer",fontSize:"16px",color:"#9ca3af",padding:"2px 6px",lineHeight:"1",flexShrink:"0"},l={background:"none",border:`1px solid ${r.border}`,borderRadius:"4px",cursor:"pointer",fontSize:"12px",fontWeight:"600",color:r.border,padding:"4px 10px",flexShrink:"0"},d=[o("span",null,r.icon),o("span",{style:s},t.message)];return t.action&&d.push(o("button",{type:"button",style:l,onClick:t.action.onClick},t.action.label)),d.push(o("button",{type:"button",style:a,onClick:()=>n(t.id),"aria-label":"Dismiss toast"},"\xD7")),o("div",{style:i,role:"alert"},...d)}function Sn(e){let{toaster:t}=e,[,n]=j(0);re(()=>t.subscribe(()=>n(l=>l+1)),[t]);let r=t.getToasts();if(r.length===0)return null;let i=wl(t.config.position);re(()=>{let l="specifyjs-toast-keyframes";if(document.getElementById(l))return;let d=document.createElement("style");return d.id=l,d.textContent=`
|
|
2
|
+
"use strict";var Ht=Object.defineProperty;var oa=Object.getOwnPropertyDescriptor;var ra=Object.getOwnPropertyNames;var ia=Object.prototype.hasOwnProperty;var sa=(e,t,n)=>t in e?Ht(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var aa=(e,t)=>{for(var n in t)Ht(e,n,{get:t[n],enumerable:!0})},la=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ra(t))!ia.call(e,i)&&i!==n&&Ht(e,i,{get:()=>t[i],enumerable:!(r=oa(t,i))||r.enumerable});return e};var ca=e=>la(Ht({},"__esModule",{value:!0}),e);var et=(e,t,n)=>sa(e,typeof t!="symbol"?t+"":t,n);var ep={};aa(ep,{Accordion:()=>Dr,Alert:()=>Go,AnalogClock:()=>zo,AppContextProvider:()=>it,Avatar:()=>Bo,Badge:()=>Fo,BarGraph:()=>oi,BigNumber:()=>bs,BlochSphere:()=>xs,Board:()=>Nt,BoxPlot:()=>ys,Breadcrumb:()=>zr,BubbleChart:()=>vs,Button:()=>fs,CARD_TYPE_OPTIONS:()=>Ft,COL_COMMENT:()=>so,COL_DEFAULT:()=>Lt,COL_FUNCTION:()=>ao,COL_KEYWORD:()=>cn,COL_NUMBER:()=>co,COL_PUNCTUATION:()=>lo,COL_STRING:()=>ro,COL_TYPE:()=>io,CalendarHeatMap:()=>Cs,Card:()=>br,CardComponent:()=>xn,CardLinkOverlay:()=>Sn,Carousel:()=>Rr,CartesianGraph2D:()=>di,Checkbox:()=>Qo,ChordDiagram:()=>Ms,CodeEditor:()=>un,ColorPicker:()=>tr,ColorWheel:()=>nr,ComplexGraph2D:()=>mi,ContainerComponent:()=>yn,ContextMenu:()=>Kt,DEFAULT_BOARD_STATE:()=>tt,DataGrid:()=>Oo,DatePicker:()=>ir,DecompositionTree:()=>Es,DesktopBackground:()=>nn,DigitalClock:()=>Ho,DiscreteCartesian2D:()=>na,Dock:()=>tn,DragDropProvider:()=>zt,DraggableWindow:()=>kt,Drawer:()=>Kr,Dropdown:()=>Lr,EmptyState:()=>Xo,FileExplorer:()=>an,FileUpload:()=>sr,FlexContainer:()=>xr,FlexItem:()=>yr,Footer:()=>Ii,ForceGraph:()=>Ts,FormFieldWrapper:()=>ze,FunnelChart:()=>Ds,GanttChart:()=>Ls,Gauge:()=>Fs,GoogleAnalytics:()=>Ei,Grid:()=>Sr,GridItem:()=>vr,HeatMap:()=>Ws,Histogram:()=>_s,HypercubeGraph:()=>ki,IDE:()=>mn,Image:()=>Pr,LineGraph:()=>xi,ListView:()=>Yo,LollipopChart:()=>Os,Matrix:()=>Hs,MenuBar:()=>sn,Menubar:()=>Fr,MessageBusProvider:()=>$t,Minimap:()=>pn,Modal:()=>qr,MultilineField:()=>ar,NavWrapper:()=>_e,NumberSpinner:()=>lr,PRIORITY_COLORS:()=>fo,Pagination:()=>Wr,Panel:()=>kr,Partition:()=>Ys,PieGraph:()=>yi,PivotTable:()=>Us,PolarGraph2D:()=>vi,Popover:()=>Jr,ProgressBar:()=>Ko,RadarChart:()=>js,RadioGroup:()=>cr,SankeyDiagram:()=>Gs,ScrollContainer:()=>Mr,Select:()=>dr,Sidebar:()=>Or,Skeleton:()=>qo,Slider:()=>ur,Spinner:()=>Jo,Splitter:()=>Er,StatusBar:()=>fn,Stepper:()=>Hr,Sunburst:()=>Xs,SystemTray:()=>en,TabBar:()=>ln,Tabs:()=>Ir,Tag:()=>Vo,TextEditor:()=>pr,TextField:()=>fr,ThreeDLayers:()=>hs,TimePicker:()=>mr,TitleBar:()=>rn,ToastContainer:()=>Hn,Toggle:()=>gr,Toolbar:()=>Vr,Tooltip:()=>ei,TradingDashboard:()=>bn,TreeMap:()=>qs,TreeNav:()=>Gr,TreeNode:()=>xt,USStateMap:()=>Ns,US_STATE_PATHS:()=>_t,UnityApp:()=>ls,UnityDesktop:()=>as,VectorField:()=>Qs,VideoPlayer:()=>$r,VirtualScroll:()=>Uo,VizWrapper:()=>Mi,WaterfallChart:()=>ea,WindowManagerProvider:()=>Qt,WordCloud:()=>ta,WordProcessor:()=>on,applyGate:()=>bo,blochToCartesian:()=>Rt,boardReducer:()=>wn,buildInputStyle:()=>je,buildNavItemStyle:()=>bt,buildRotationMatrix:()=>Kn,cartesianToBloch:()=>En,computeBoxStats:()=>yo,computeMandelbrotGrid:()=>fi,computeSlices:()=>jn,createToaster:()=>On,describeArc:()=>Un,generateEdges:()=>Xn,generateHypercube:()=>Pt,generatePalette:()=>Jt,generateUUID:()=>qe,generateVertices:()=>Gn,getItemId:()=>Xe,getItemName:()=>po,historyReducer:()=>kn,isCard:()=>Le,isContainer:()=>$e,numRotationAngles:()=>Tt,projectTo2D:()=>Zn,tokenizeLine:()=>dn,transformVec:()=>qn,useAppId:()=>wt,useBarGraphScales:()=>Yn,useBoardReducer:()=>Wt,useChannel:()=>Dt,useDragDrop:()=>pt,useDraggable:()=>to,useDropZone:()=>At,useHover:()=>Fe,useHypercube:()=>Ci,useLineGraphScales:()=>Vn,useMessageBus:()=>st,useToast:()=>Qr,useWindowManager:()=>vt,validateNameForNesting:()=>ds,validateNameInBoard:()=>cs,validateNameInScope:()=>ho});module.exports=ca(ep);var Yt=Symbol.for("spec.element"),da=Symbol.for("spec.fragment"),np=Symbol.for("spec.portal"),Eo=Symbol.for("spec.provider"),Io=Symbol.for("spec.consumer"),ua=Symbol.for("spec.forward_ref"),pa=Symbol.for("spec.memo"),fa=Symbol.for("spec.lazy"),ma=Symbol.for("spec.suspense"),ga=Symbol.for("spec.strict_mode"),ha=Symbol.for("spec.profiler");function o(e,t,...n){let r=null,i=null,s={};if(t!=null){t.key!==void 0&&(r=""+t.key),t.ref!==void 0&&(i=t.ref);for(let a in t)Object.prototype.hasOwnProperty.call(t,a)&&a!=="key"&&a!=="ref"&&a!=="__proto__"&&a!=="constructor"&&a!=="prototype"&&(s[a]=t[a])}if(n.length===1?s.children=n[0]:n.length>1&&(s.children=n),typeof e=="function"&&e.defaultProps){let a=e.defaultProps;for(let l of Object.keys(a))l!=="__proto__"&&l!=="constructor"&&s[l]===void 0&&(s[l]=a[l])}return{$$typeof:Yt,type:e,props:s,key:r,ref:i}}function Ue(e){let t={$$typeof:Symbol.for("spec.context"),Provider:null,Consumer:null,_currentValue:e,_defaultValue:e},n={$$typeof:Eo,_context:t},r={$$typeof:Io,_context:t};return t.Provider=n,t.Consumer=r,t}var gt=class{constructor(t){this._fiber=null;this._pendingState=[];this._forceUpdate=!1;this.props=t,this.state={},this.context=void 0}setState(t,n){this._pendingState.push(t),this._enqueueUpdate(n)}forceUpdate(t){this._forceUpdate=!0,this._enqueueUpdate(t)}render(){return null}_enqueueUpdate(t){}};gt.prototype.isSpecComponent=!0;var Vt=class extends gt{shouldComponentUpdate(t,n){return!Po(this.props,t)||!Po(this.state,n)}};Vt.prototype.isPureSpecComponent=!0;function Po(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;let i=e,s=t;for(let a of n)if(!Object.prototype.hasOwnProperty.call(s,a)||!Object.is(i[a],s[a]))return!1;return!0}var To=null;function ot(){if(To===null)throw new Error("Invalid hook call. Hooks can only be called inside the body of a function component.");return To}function U(e){return ot().useState(e)}function re(e,t){return ot().useEffect(e,t)}function Ye(e){return ot().useContext(e)}function An(e,t,n){return ot().useReducer(e,t,n)}function v(e,t){return ot().useCallback(e,t)}function X(e,t){return ot().useMemo(e,t)}function ne(e){return ot().useRef(e)}function Ce(){return ot().useId()}var ht=Ue({pathname:"/",params:{},navigate:()=>{throw new Error("useNavigate must be used inside a <Router> component.")},basePath:""});function $o(){let t=(typeof window<"u"?window.location.hash:"").replace(/^#\/?/,"/");return t===""?"/":t}var xa={pathname:$o(),hash:typeof window<"u"?window.location.hash:""},ya=new Set;function Sa(){xa={pathname:$o(),hash:typeof window<"u"?window.location.hash:""};for(let e of ya)e()}typeof window<"u"&&window.addEventListener("hashchange",Sa);var Wf=Ue({flags:{},isEnabled:()=>!1,setFlag:()=>{},loading:!1});function Do(e){if(!e)return new Date;let n=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(new Date),r=i=>Number(n.find(s=>s.type===i)?.value??0);return new Date(r("year"),r("month")-1,r("day"),r("hour"),r("minute"),r("second"))}function $a(e,t){let n=e.getFullYear(),r=e.getMonth(),i=e.getDate();switch(t){case"short":{let s=String(r+1).padStart(2,"0"),a=String(i).padStart(2,"0");return`${s}/${a}/${n}`}case"long":return`${["January","February","March","April","May","June","July","August","September","October","November","December"][r]} ${String(i).padStart(2,"0")}, ${n}`;case"iso":{let s=String(r+1).padStart(2,"0"),a=String(i).padStart(2,"0");return`${n}-${s}-${a}`}}}var Ze={face:"#f8fafc",border:"#334155",hand:"#1e293b",second:"#ef4444",numbers:"#374151"};function zo(e){let{format:t="12h",size:n=200,showDate:r=!1,dateFormat:i="short",showSeconds:s=!0,timezone:a,className:l}=e,[d,u]=U(Do(a));re(()=>{let R=setInterval(()=>{u(Do(a))},1e3);return()=>clearInterval(R)},[a]);let h=d.getHours(),m=d.getMinutes(),c=d.getSeconds(),p=h%12*30+m*.5,f=m*6+c*.1,y=c*6,x=n/2,g=n/2,b=n/2-10,S=b-4,I=b-22,A=[];A.push(o("circle",{cx:String(x),cy:String(g),r:String(b),fill:Ze.face,stroke:Ze.border,"stroke-width":"3"}));for(let R=0;R<12;R++){let B=(R*30-90)*Math.PI/180,E=S-6;A.push(o("line",{x1:String(x+E*Math.cos(B)),y1:String(g+E*Math.sin(B)),x2:String(x+S*Math.cos(B)),y2:String(g+S*Math.sin(B)),stroke:Ze.border,"stroke-width":"2"}));let N=String(R===0?12:R);if(A.push(o("text",{x:String(x+I*Math.cos(B)),y:String(g+I*Math.sin(B)),"text-anchor":"middle","dominant-baseline":"central",fill:Ze.numbers,"font-size":String(n*.08),"font-family":"sans-serif","font-weight":"600"},N)),t==="24h"){let z=b-38,k=String(R===0?0:R+12);A.push(o("text",{x:String(x+z*Math.cos(B)),y:String(g+z*Math.sin(B)),"text-anchor":"middle","dominant-baseline":"central",fill:Ze.numbers,"font-size":String(n*.055),"font-family":"sans-serif",opacity:"0.6"},k))}}let C=(R,$,B,E)=>{let N=(R-90)*Math.PI/180;return o("line",{x1:String(x),y1:String(g),x2:String(x+$*Math.cos(N)),y2:String(g+$*Math.sin(N)),stroke:E,"stroke-width":B,"stroke-linecap":"round"})};A.push(C(p,b*.5,"4",Ze.hand)),A.push(C(f,b*.75,"3",Ze.hand)),s&&A.push(C(y,b*.85,"1.5",Ze.second)),A.push(o("circle",{cx:String(x),cy:String(g),r:"4",fill:Ze.hand}));let L=[o("svg",{width:String(n),height:String(n),viewBox:`0 0 ${n} ${n}`,xmlns:"http://www.w3.org/2000/svg"},...A)];return r&&L.push(o("div",{style:{textAlign:"center",marginTop:"8px",fontFamily:"sans-serif",fontSize:"14px",color:Ze.numbers}},$a(d,i))),o("div",{className:l,style:{display:"inline-flex",flexDirection:"column",alignItems:"center"}},...L)}var Bn={xs:24,sm:32,md:40,lg:56,xl:80};function Da(e){return e==null?Bn.md:typeof e=="number"?e:Bn[e]??Bn.md}function za(e){if(!e)return"?";let t=e.trim().split(/\s+/);return t.length===1?t[0].charAt(0).toUpperCase():(t[0].charAt(0)+t[t.length-1].charAt(0)).toUpperCase()}var Ao=["#3b82f6","#ef4444","#22c55e","#a855f7","#f97316","#ec4899","#14b8a6","#6366f1","#eab308","#06b6d4"];function Aa(e){if(!e)return"#9ca3af";let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return Ao[Math.abs(t)%Ao.length]}var Lo={online:"#22c55e",offline:"#9ca3af",busy:"#ef4444",away:"#eab308"};function La(e,t){let n=`${-t/4}px`;switch(e){case"top-left":return{top:n,left:n};case"bottom-right":return{bottom:n,right:n};case"bottom-left":return{bottom:n,left:n};case"top-right":default:return{top:n,right:n}}}function Bo(e){let{src:t,alt:n,name:r,size:i,shape:s="circle",fallbackColor:a,status:l,statusPosition:d="bottom-right"}=e,[u,h]=U(!1),m=Da(i),c=s==="circle"?"50%":`${Math.round(m*.15)}px`,p=a??Aa(r),f=`${Math.round(m*.4)}px`,y={position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:`${m}px`,height:`${m}px`,borderRadius:c,overflow:"hidden",flexShrink:"0"},x;if(t&&!u)x=o("img",{src:t,alt:n??r??"avatar",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"},onError:()=>h(!0)});else{let I=za(r);x=o("span",{style:{fontSize:f,fontWeight:"600",color:"#fff",lineHeight:"1",userSelect:"none",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},"aria-hidden":"true"},I)}let g=o("div",{style:{...y,backgroundColor:t&&!u?"transparent":p},role:"img","aria-label":n??r??"avatar"},x);if(!l)return g;let b=Math.max(8,Math.round(m*.25)),S={position:"absolute",width:`${b}px`,height:`${b}px`,borderRadius:"50%",backgroundColor:Lo[l]??Lo.offline,border:"2px solid #fff",boxSizing:"border-box",...La(d,b)};return o("div",{style:{position:"relative",display:"inline-flex",width:`${m}px`,height:`${m}px`,flexShrink:"0"}},g,o("span",{style:S,"aria-label":l}))}var Ba={sm:{minWidth:"16px",height:"16px",fontSize:"10px",padding:"0 4px"},md:{minWidth:"20px",height:"20px",fontSize:"12px",padding:"0 6px"},lg:{minWidth:"24px",height:"24px",fontSize:"14px",padding:"0 8px"}},Fa={sm:{width:"6px",height:"6px"},md:{width:"8px",height:"8px"},lg:{width:"10px",height:"10px"}};function Fo(e){let{count:t,max:n,dot:r=!1,color:i="#ef4444",size:s="md",variant:a="solid",children:l}=e,d=null;!r&&t!=null&&(d=n!=null&&t>n?`${n}+`:String(t));let u=r||t!=null&&t>0,h=r?{...Fa[s],borderRadius:"50%",...a==="solid"?{backgroundColor:i}:{backgroundColor:"transparent",border:`2px solid ${i}`}}:{...Ba[s],borderRadius:"9999px",display:"inline-flex",alignItems:"center",justifyContent:"center",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontWeight:"600",lineHeight:"1",boxSizing:"border-box",...a==="solid"?{backgroundColor:i,color:"#fff"}:{backgroundColor:"transparent",color:i,border:`2px solid ${i}`}},m=u?o("span",{style:h,"aria-label":r?"notification":`count ${d}`},d):null;if(l==null)return m??o("span",null);let c={...h,position:"absolute",top:"0",right:"0",transform:"translate(50%, -50%)",zIndex:"1"};return o("span",{style:{position:"relative",display:"inline-flex"}},l,u?o("span",{style:c,"aria-label":r?"notification":`count ${d}`},d):null)}var Na={width:"100%",borderCollapse:"collapse",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",color:"#1f2937"},No={padding:"10px 12px",textAlign:"left",fontWeight:"600",backgroundColor:"#f9fafb",borderBottom:"2px solid #e5e7eb",userSelect:"none",whiteSpace:"nowrap"},Fn={padding:"10px 12px",borderBottom:"1px solid #e5e7eb"},Wa="6px 8px",_a={marginLeft:"4px",fontSize:"12px",color:"#6b7280"},Oa={width:"100%",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",boxSizing:"border-box"},Ha={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",fontSize:"13px",color:"#6b7280"},dt={padding:"4px 10px",margin:"0 2px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#fff",cursor:"pointer",fontSize:"13px"},Ya={...dt,backgroundColor:"#3b82f6",color:"#fff",borderColor:"#3b82f6"},Wo={...dt,opacity:"0.5",cursor:"default"},_o={cursor:"pointer",width:"16px",height:"16px"};function Va(e,t,n){return e!==t?"\u2195":n==="asc"?"\u2191":"\u2193"}function Oo(e){let{columns:t,data:n,pageSize:r,currentPage:i,onPageChange:s,sortBy:a,sortDir:l,onSort:d,selectable:u=!1,selectedRows:h,onSelectionChange:m,striped:c=!1,bordered:p=!1,compact:f=!1,stickyHeader:y=!1}=e,[x,g]=U(0),[b,S]=U(void 0),[I,A]=U("asc"),[C,T]=U([]),[L,R]=U({}),$=i??x,B=a??b,E=l??I,N=h??C,z=X(()=>{let J=Object.entries(L).filter(([,ie])=>ie.length>0);return J.length===0?n:n.filter(ie=>J.every(([le,fe])=>String(ie[le]??"").toLowerCase().includes(fe.toLowerCase())))},[n,L]),k=X(()=>{if(!B)return z;let J=[...z];return J.sort((ie,le)=>{let fe=ie[B],oe=le[B];if(fe==null&&oe==null)return 0;if(fe==null)return 1;if(oe==null)return-1;if(typeof fe=="number"&&typeof oe=="number")return E==="asc"?fe-oe:oe-fe;let ge=String(fe),he=String(oe),ee=ge.localeCompare(he);return E==="asc"?ee:-ee}),J},[z,B,E]),w=k.length,D=r?Math.max(1,Math.ceil(w/r)):1,M=r?k.slice($*r,($+1)*r):k,F=v(J=>{s?s(J):g(J)},[s]),P=v(J=>{let ie=B===J&&E==="asc"?"desc":"asc";d?d(J,ie):(S(J),A(ie))},[B,E,d]),W=v(J=>{let ie=N.includes(J)?N.filter(le=>le!==J):[...N,J];m?m(ie):T(ie)},[N,m]),_=v(()=>{let J=M.map((fe,oe)=>r?$*r+oe:oe),le=J.every(fe=>N.includes(fe))?N.filter(fe=>!J.includes(fe)):[...new Set([...N,...J])];m?m(le):T(le)},[M,N,r,$,m]),O=v((J,ie)=>{R(le=>({...le,[J]:ie})),F(0)},[F]),Y=t.some(J=>J.filterable),K=f?Wa:Fn.padding,Q=[];if(u){let J=M.map((le,fe)=>r?$*r+fe:fe),ie=J.length>0&&J.every(le=>N.includes(le));Q.push(o("th",{key:"__select_all",style:{...No,padding:K,width:"40px",textAlign:"center",...y?{position:"sticky",top:"0",zIndex:"2"}:{}}},o("input",{type:"checkbox",checked:ie,onChange:_,style:_o,"aria-label":"Select all rows"})))}for(let J of t){let ie={...No,padding:K,...J.width?{width:J.width}:{},...J.sortable?{cursor:"pointer"}:{},...p?{border:"1px solid #e5e7eb"}:{},...y?{position:"sticky",top:"0",zIndex:"2"}:{}},le=[J.header];J.sortable&&le.push(o("span",{style:_a},Va(J.key,B,E))),Q.push(o("th",{key:J.key,style:ie,onClick:J.sortable?()=>P(J.key):void 0,onKeyDown:J.sortable?fe=>{let oe=fe.key;(oe==="Enter"||oe===" ")&&(fe.preventDefault(),P(J.key))}:void 0,tabIndex:J.sortable?0:void 0,role:J.sortable?"columnheader":void 0,"aria-sort":B===J.key?E==="asc"?"ascending":"descending":void 0},...le))}let q=null;if(Y){let J=[];u&&J.push(o("th",{key:"__filter_spacer",style:{padding:K}}));for(let ie of t)J.push(o("th",{key:`filter_${ie.key}`,style:{padding:"4px 8px",backgroundColor:"#f9fafb"}},ie.filterable?o("input",{type:"text",placeholder:`Filter ${ie.header}...`,style:Oa,value:L[ie.key]??"",onInput:le=>O(ie.key,le.target.value),"aria-label":`Filter by ${ie.header}`}):null));q=o("tr",{key:"__filter_row"},...J)}let H=[];for(let J=0;J<M.length;J++){let ie=M[J],le=r?$*r+J:J,fe=N.includes(le),oe={};c&&J%2===1&&(oe.backgroundColor="#f9fafb"),fe&&(oe.backgroundColor="#eff6ff");let ge=[];u&&ge.push(o("td",{key:"__select",style:{padding:K,textAlign:"center",...Fn,...p?{border:"1px solid #e5e7eb"}:{}}},o("input",{type:"checkbox",checked:fe,onChange:()=>W(le),style:_o,"aria-label":`Select row ${le+1}`})));for(let he of t){let ee=ie[he.key],de=he.render?he.render(ee,ie):String(ee??"");ge.push(o("td",{key:he.key,style:{...Fn,padding:K,...p?{border:"1px solid #e5e7eb"}:{}}},de))}H.push(o("tr",{key:String(le),style:oe},...ge))}let j=null;if(r){let J=w===0?0:$*r+1,ie=Math.min(($+1)*r,w),le=[];le.push(o("button",{key:"prev",style:$===0?Wo:dt,onClick:$>0?()=>F($-1):void 0,disabled:$===0,"aria-label":"Previous page"},"\u2190 Prev"));let fe=7,oe=Math.max(0,$-Math.floor(fe/2)),ge=Math.min(D,oe+fe);ge-oe<fe&&(oe=Math.max(0,ge-fe)),oe>0&&(le.push(o("button",{key:"p0",style:dt,onClick:()=>F(0)},"1")),oe>1&&le.push(o("span",{key:"e1",style:{margin:"0 4px"}},"...")));for(let he=oe;he<ge;he++)le.push(o("button",{key:`p${he}`,style:he===$?Ya:dt,onClick:he!==$?()=>F(he):void 0,"aria-current":he===$?"page":void 0},String(he+1)));ge<D&&(ge<D-1&&le.push(o("span",{key:"e2",style:{margin:"0 4px"}},"...")),le.push(o("button",{key:`p${D-1}`,style:dt,onClick:()=>F(D-1)},String(D)))),le.push(o("button",{key:"next",style:$>=D-1?Wo:dt,onClick:$<D-1?()=>F($+1):void 0,disabled:$>=D-1,"aria-label":"Next page"},"Next \u2192")),j=o("div",{style:Ha},o("span",null,`Showing ${J}\u2013${ie} of ${w}`),o("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},...le))}let G={width:"100%",...y?{overflow:"auto",maxHeight:"600px"}:{}},V={...Na,...p?{border:"1px solid #e5e7eb"}:{}},Z=o("thead",null,o("tr",null,...Q),q),te=o("tbody",null,...H),ae=o("table",{style:V,role:"grid","aria-rowcount":String(w)},Z,te);return o("div",{style:G},ae,j)}function ut(e){return e<10?`0${e}`:String(e)}function Ua(e,t){if(t){let r=new Intl.DateTimeFormat("en-US",{timeZone:t,hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}).formatToParts(e),i=s=>Number(r.find(a=>a.type===s)?.value??0);return{hours:i("hour"),minutes:i("minute"),seconds:i("second")}}return{hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()}}function ja(e,t,n){if(n){let r={timeZone:n};if(t==="short")return Object.assign(r,{month:"2-digit",day:"2-digit",year:"numeric"}),new Intl.DateTimeFormat("en-US",r).format(e);if(t==="long")return Object.assign(r,{month:"long",day:"numeric",year:"numeric"}),new Intl.DateTimeFormat("en-US",r).format(e);Object.assign(r,{year:"numeric",month:"2-digit",day:"2-digit"});let i=new Intl.DateTimeFormat("en-CA",r).formatToParts(e),s=a=>i.find(l=>l.type===a)?.value??"";return`${s("year")}-${s("month")}-${s("day")}`}return t==="short"?`${ut(e.getMonth()+1)}/${ut(e.getDate())}/${e.getFullYear()}`:t==="long"?new Intl.DateTimeFormat("en-US",{month:"long",day:"numeric",year:"numeric"}).format(e):`${e.getFullYear()}-${ut(e.getMonth()+1)}-${ut(e.getDate())}`}var Ga={fontFamily:'"SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", "Courier New", monospace',backgroundColor:"#1e293b",color:"#e2e8f0",padding:"16px 24px",borderRadius:"8px",display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"4px"},Xa={fontSize:"2rem",fontWeight:"600",letterSpacing:"2px",lineHeight:"1"},Ka={fontSize:"0.875rem",fontWeight:"400",marginLeft:"4px",verticalAlign:"super"},qa={fontSize:"0.75rem",color:"#94a3b8",marginTop:"4px"};function Ho(e){let{format:t="12h",showDate:n=!1,dateFormat:r="short",showSeconds:i=!0,timezone:s,className:a}=e,[l,d]=U(new Date);re(()=>{let g=setInterval(()=>{d(new Date)},1e3);return()=>clearInterval(g)},[]);let{hours:u,minutes:h,seconds:m}=Ua(l,s),c,p=null;t==="12h"?(p=u>=12?"PM":"AM",c=u%12||12):c=u;let f=`${ut(c)}:${ut(h)}`;i&&(f+=`:${ut(m)}`);let y=[f];p!=null&&y.push(o("span",{style:Ka},p));let x=[o("span",{style:Xa},...y)];return n&&x.push(o("span",{style:qa},ja(l,r,s))),o("div",{style:Ga,...a?{class:a}:{}},...x)}var Za={listStyle:"none",margin:"0",padding:"0",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px"},Ja={padding:"10px 14px",color:"var(--color-text, #1f2937)"},Qa={borderBottom:"1px solid var(--color-border, #e5e7eb)"},el={cursor:"pointer",transition:"background-color 0.15s ease"},tl={backgroundColor:"var(--color-bg-muted, #eff6ff)"},nl={padding:"24px",textAlign:"center",color:"var(--color-text-muted, #9ca3af)",fontSize:"14px"},Ut={padding:"10px 14px",borderBottom:"1px solid var(--color-border, #e5e7eb)",backgroundColor:"var(--color-bg-subtle, #f9fafb)",fontWeight:"600",fontSize:"13px",color:"var(--color-text-muted, #6b7280)"};function Yo(e){let{items:t,renderItem:n,keyExtractor:r,divider:i=!1,hoverable:s=!1,selectedIndex:a,onSelect:l,emptyMessage:d="No items",header:u,footer:h}=e;if(t.length===0)return o("div",null,u?o("div",{style:Ut},u):null,o("div",{style:nl},d),h?o("div",{style:{...Ut,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},h):null);let m=[];for(let c=0;c<t.length;c++){let p=t[c],f=r(p,c),y=a===c,x=c===t.length-1,g={...Ja,...s?el:{},...y?tl:{},...i&&!x?Qa:{}};m.push(o("li",{key:f,style:g,onClick:l?()=>l(c):void 0,onKeyDown:l?b=>{let S=b.key;(S==="Enter"||S===" ")&&(b.preventDefault(),l(c))}:void 0,role:l?"option":void 0,tabIndex:l?0:void 0,"aria-selected":l?String(y):void 0},n(p,c)))}return o("div",null,u?o("div",{style:Ut},u):null,o("ul",{style:Za,role:l?"listbox":"list"},...m),h?o("div",{style:{...Ut,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},h):null)}function ol(e){return e??"#3b82f6"}function rl(e,t){let r={red:"#ef4444",blue:"#3b82f6",green:"#22c55e",yellow:"#eab308",purple:"#a855f7",pink:"#ec4899",orange:"#f97316",gray:"#6b7280",indigo:"#6366f1",teal:"#14b8a6",cyan:"#06b6d4"}[e]??e,i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r);return i?`rgba(${parseInt(i[1],16)}, ${parseInt(i[2],16)}, ${parseInt(i[3],16)}, ${t})`:e}var il={sm:{fontSize:"11px",padding:"2px 8px",gap:"4px"},md:{fontSize:"13px",padding:"4px 10px",gap:"6px"},lg:{fontSize:"15px",padding:"6px 14px",gap:"8px"}};function sl(e,t,n,r,i){let s=il[n],a={display:"inline-flex",alignItems:"center",gap:s.gap,borderRadius:"9999px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:s.fontSize,fontWeight:"500",padding:s.padding,lineHeight:"1.4",whiteSpace:"nowrap",border:"none",transition:"opacity 0.15s ease, filter 0.15s ease",...r?{cursor:"pointer"}:{},...i?{opacity:"0.5",cursor:"default",pointerEvents:"none"}:{}};switch(t){case"solid":return{...a,backgroundColor:e,color:"#fff",border:"none"};case"outline":return{...a,backgroundColor:"transparent",color:e,border:`1px solid ${e}`};case"subtle":return{...a,backgroundColor:rl(e,.12),color:e,border:"none"};default:return a}}var al={display:"inline-flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",padding:"0",marginLeft:"2px",cursor:"pointer",fontSize:"inherit",lineHeight:"1",opacity:"0.7",color:"inherit"};function Vo(e){let{label:t,color:n,variant:r="subtle",size:i="md",removable:s=!1,onRemove:a,icon:l,onClick:d,disabled:u=!1}=e,h=ol(n),m=sl(h,r,i,!!d,u),c=[];return l&&c.push(o("span",{key:"icon",style:{display:"inline-flex",flexShrink:"0"}},l)),c.push(o("span",{key:"label"},t)),s&&c.push(o("button",{key:"remove",type:"button",style:al,onClick:p=>{p.stopPropagation(),!u&&a&&a()},"aria-label":`Remove ${t}`,disabled:u},"\xD7")),o("span",{style:m,role:d?"button":void 0,tabIndex:d&&!u?"0":void 0,onClick:!u&&d?d:void 0,onKeyDown:d&&!u?p=>{let f=p.key;(f==="Enter"||f===" ")&&(p.preventDefault(),d())}:void 0,"aria-disabled":u?"true":void 0},...c)}var ll={overflow:"auto",position:"relative",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'};function Uo(e){let{items:t,renderItem:n,itemHeight:r,overscan:i=5,height:s}=e,[a,l]=U(0),d=ne(null),u=t.length*r,h=parseInt(s,10)||400,m=Math.ceil(h/r),c=Math.max(0,Math.floor(a/r)-i),p=Math.min(t.length,Math.floor(a/r)+m+i),f=v(x=>{let g=x.target;l(g.scrollTop)},[]),y=[];for(let x=c;x<p;x++)y.push(o("div",{key:String(x),style:{position:"absolute",top:`${x*r}px`,left:"0",right:"0",height:`${r}px`,overflow:"hidden"}},n(t[x],x)));return o("div",{ref:d,style:{...ll,height:s},onScroll:f},o("div",{style:{height:`${u}px`,position:"relative",width:"100%"}},...y))}var jo={info:{icon:"\u2139\uFE0F",bg:"#eff6ff",border:"#3b82f6",text:"#1e40af",filledBg:"#3b82f6",filledText:"#ffffff"},success:{icon:"\u2705",bg:"#f0fdf4",border:"#22c55e",text:"#166534",filledBg:"#22c55e",filledText:"#ffffff"},warning:{icon:"\u26A0\uFE0F",bg:"#fffbeb",border:"#f59e0b",text:"#92400e",filledBg:"#f59e0b",filledText:"#ffffff"},error:{icon:"\u274C",bg:"#fef2f2",border:"#ef4444",text:"#991b1b",filledBg:"#ef4444",filledText:"#ffffff"}};function Go(e){let[t,n]=U(!0),r=e.type??"info",i=e.variant??"subtle",s=jo[r]??jo.info,a=e.icon??s.icon,l=e.message??e.children,d=X(()=>{let u={display:"flex",alignItems:"flex-start",gap:"12px",padding:"12px 16px",borderRadius:"8px",fontSize:"14px",lineHeight:"1.5"};return i==="filled"?(u.backgroundColor=s.filledBg,u.color=s.filledText):i==="outline"?(u.backgroundColor="transparent",u.border=`1px solid ${s.border}`,u.color=s.text):(u.backgroundColor=s.bg,u.color=s.text),u},[i,s]);return t?o("div",{role:"alert",style:d},o("span",{style:{flexShrink:"0",fontSize:"16px",lineHeight:"1.5"}},a),o("div",{style:{flex:"1",minWidth:"0"}},e.title?o("div",{style:{fontWeight:"600",marginBottom:l?"4px":"0"}},e.title):null,l?o("div",null,l):null,e.action?o("button",{onclick:e.action.onClick,style:{marginTop:"8px",padding:"4px 12px",fontSize:"13px",fontWeight:"500",border:i==="filled"?"1px solid currentColor":`1px solid ${s.border}`,borderRadius:"4px",backgroundColor:"transparent",color:"inherit",cursor:"pointer"}},e.action.label):null),e.closable?o("button",{"aria-label":"Close",onclick:()=>{n(!1),e.onClose&&e.onClose()},style:{flexShrink:"0",background:"none",border:"none",cursor:"pointer",fontSize:"18px",lineHeight:"1",color:"inherit",opacity:"0.7",padding:"0"}},"\xD7"):null):null}function Xo(e){return o("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",padding:"48px 24px",gap:"16px"}},e.image?o("img",{src:e.image,alt:"",style:{maxWidth:"200px",maxHeight:"160px",objectFit:"contain"}}):null,e.icon?o("div",{style:{fontSize:"48px",lineHeight:"1"}},e.icon):null,e.title?o("h3",{style:{margin:"0",fontSize:"20px",fontWeight:"600",color:"#111827",lineHeight:"1.4"}},e.title):null,e.description?o("p",{style:{margin:"0",fontSize:"14px",color:"#6b7280",maxWidth:"360px",lineHeight:"1.6"}},e.description):null,e.action?o("button",{onclick:e.action.onClick,style:{marginTop:"8px",padding:"10px 24px",fontSize:"14px",fontWeight:"500",color:"#ffffff",backgroundColor:"#3b82f6",border:"none",borderRadius:"6px",cursor:"pointer"}},e.action.label):null)}function Ko(e){let t=e.max??100,n=e.indeterminate?0:Math.min(Math.max(e.value??0,0),t),r=t>0?n/t*100:0,i=e.color??"#3b82f6",s=e.backgroundColor??"#e5e7eb",a=e.height??(typeof e.size=="string"?e.size:typeof e.size=="number"?`${e.size}px`:"8px"),l=e.variant??"bar",d=Ce().replace(/[^a-zA-Z0-9_-]/g,"");if(l==="circular"){let p=typeof e.size=="number"?e.size:48,f=Math.max(2,Math.round(p/10)),y=(p-f)/2,x=2*Math.PI*y,g=e.indeterminate?x*.75:x-r/100*x,b=e.indeterminate?`@keyframes liq-spin-${d}{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}`:e.animated?`@keyframes liq-pulse-${d}{0%,100%{opacity:1}50%{opacity:0.6}}`:"";return o("div",{role:"progressbar","aria-valuenow":e.indeterminate?void 0:String(Math.round(r)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Progress",style:{display:"inline-flex",alignItems:"center",gap:"8px"}},b?o("style",null,b):null,o("svg",{width:String(p),height:String(p),viewBox:`0 0 ${p} ${p}`,style:e.indeterminate?{animation:`liq-spin-${d} 1s linear infinite`}:e.animated?{animation:`liq-pulse-${d} 1.5s ease-in-out infinite`}:{}},o("circle",{cx:String(p/2),cy:String(p/2),r:String(y),fill:"none",stroke:s,"stroke-width":String(f)}),o("circle",{cx:String(p/2),cy:String(p/2),r:String(y),fill:"none",stroke:i,"stroke-width":String(f),"stroke-dasharray":String(x),"stroke-dashoffset":String(g),"stroke-linecap":"round",transform:`rotate(-90 ${p/2} ${p/2})`,style:{transition:"stroke-dashoffset 0.3s ease"}})),e.showLabel&&!e.indeterminate?o("span",{style:{fontSize:"14px",color:"#374151"}},`${Math.round(r)}%`):null)}let u=e.animated||e.indeterminate?`@keyframes liq-shimmer-${d}{0%{background-position:-200% 0}100%{background-position:200% 0}}`:"",h=e.indeterminate?`@keyframes liq-indeterminate-${d}{0%{left:-40%;width:40%}50%{left:20%;width:60%}100%{left:100%;width:40%}}`:"",m={width:"100%",height:a,backgroundColor:s,borderRadius:a,overflow:"hidden",position:"relative"},c=X(()=>{let p={height:"100%",borderRadius:a,transition:"width 0.3s ease"};return e.indeterminate?(p.position="absolute",p.animation=`liq-indeterminate-${d} 1.5s ease-in-out infinite`,p.backgroundColor=i):(p.width=`${r}%`,p.backgroundColor=i),e.animated&&!e.indeterminate&&(p.backgroundImage=`linear-gradient(90deg, ${i} 0%, ${cl(i)} 50%, ${i} 100%)`,p.backgroundSize="200% 100%",p.animation=`liq-shimmer-${d} 1.5s ease-in-out infinite`),p},[r,i,a,e.animated,e.indeterminate,d]);return o("div",{role:"progressbar","aria-valuenow":e.indeterminate?void 0:String(Math.round(r)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Progress",style:{width:"100%"}},u||h?o("style",null,u+h):null,e.showLabel&&!e.indeterminate?o("div",{style:{marginBottom:"4px",fontSize:"12px",color:"#374151",textAlign:"right"}},`${Math.round(r)}%`):null,o("div",{style:m},o("div",{style:c})))}function cl(e){let t=e.replace("#","");if(t.length!==6)return e;let n=Math.min(255,parseInt(t.slice(0,2),16)+40),r=Math.min(255,parseInt(t.slice(2,4),16)+40),i=Math.min(255,parseInt(t.slice(4,6),16)+40);return`#${n.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}`}function qo(e){let t=e.variant??"text",n=e.animated!==!1,r=Ce().replace(/[^a-zA-Z0-9_-]/g,""),i=X(()=>n?`@keyframes liq-shimmer-${r}{0%{background-position:-200% 0}100%{background-position:200% 0}}`:"",[n,r]),s=typeof e.width=="number"?`${e.width}px`:e.width,a=typeof e.height=="number"?`${e.height}px`:e.height;if(t==="text"){let l=e.lines??1,d=[];for(let u=0;u<l;u++){let h=u===l-1&&l>1;d.push(o("div",{key:String(u),style:Nn({width:h?"75%":s??"100%",height:a??"1em",borderRadius:e.borderRadius??"4px",animated:n,animId:r,marginBottom:u<l-1?"8px":"0"})}))}return o("div",{"aria-hidden":"true",style:{width:s??"100%"}},i?o("style",null,i):null,...d)}if(t==="circular"){let l=s??a??"40px";return o("div",{"aria-hidden":"true"},i?o("style",null,i):null,o("div",{style:Nn({width:l,height:l,borderRadius:"50%",animated:n,animId:r})}))}return o("div",{"aria-hidden":"true"},i?o("style",null,i):null,o("div",{style:Nn({width:s??"100%",height:a??"100px",borderRadius:e.borderRadius??"4px",animated:n,animId:r})}))}function Nn(e){let t={width:e.width,height:e.height,borderRadius:e.borderRadius,backgroundColor:"#e5e7eb"};return e.animated&&(t.backgroundImage="linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%)",t.backgroundSize="200% 100%",t.animation=`liq-shimmer-${e.animId} 1.5s ease-in-out infinite`),e.marginBottom&&(t.marginBottom=e.marginBottom),t}var dl={sm:16,md:24,lg:40},Zo={slow:"1.2s",normal:"0.75s",fast:"0.45s"};function Jo(e){let t=typeof e.size=="number"?e.size:dl[e.size??"md"]??24,n=e.color??"#3b82f6",r=e.thickness??Math.max(2,Math.round(t/8)),i=Zo[e.speed??"normal"]??Zo.normal,s=e.label??"Loading",l=Ce().replace(/[^a-zA-Z0-9_-]/g,""),d=(t-r)/2,u=2*Math.PI*d,h=X(()=>`@keyframes liq-rotate-${l}{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}`,[l]);return o("span",{role:"status","aria-label":s,style:{display:"inline-flex",alignItems:"center",justifyContent:"center"}},o("style",null,h),o("svg",{width:String(t),height:String(t),viewBox:`0 0 ${t} ${t}`,style:{animation:`liq-rotate-${l} ${i} linear infinite`}},o("circle",{cx:String(t/2),cy:String(t/2),r:String(d),fill:"none",stroke:n,"stroke-width":String(r),"stroke-dasharray":`${u*.7} ${u*.3}`,"stroke-linecap":"round"})),o("span",{style:{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",borderWidth:"0"}},s))}function ze(e){let t=e.styling??{},n=!!e.error,r={display:"flex",flexDirection:"column",gap:t.gap??"4px",width:typeof t.width=="number"?`${t.width}px`:t.width??"100%",fontFamily:t.fontFamily??"inherit",fontSize:t.fontSize??"14px",opacity:e.disabled?"0.6":"1",...t.custom??{}},i={color:t.labelColor??"#374151",fontWeight:t.labelFontWeight??"500",fontSize:t.labelFontSize??"14px"},s={fontSize:"12px",color:n?t.errorColor??"#ef4444":t.helpColor??"#6b7280",marginTop:"2px"};return o("div",{className:`form-field ${n?"form-field--error":""} ${e.className??""}`.trim(),style:r},e.label?o("label",{htmlFor:e.htmlFor,style:i},e.label,e.required?o("span",{style:{color:t.errorColor??"#ef4444",marginLeft:"2px"}},"*"):null):null,e.children,e.error?o("div",{className:"form-field__error",style:s,role:"alert"},e.error):e.helpText?o("div",{className:"form-field__help",style:s},e.helpText):null)}function je(e,t){let n=t.error?e.errorBorderColor??"#ef4444":t.focused?e.focusBorderColor??"#3b82f6":void 0;return{padding:e.padding??"8px 12px",border:n?`1px solid ${n}`:e.border??"1px solid #d1d5db",borderRadius:e.borderRadius??"6px",fontSize:e.fontSize??"14px",fontFamily:e.fontFamily??"inherit",backgroundColor:e.backgroundColor??"#ffffff",color:e.color??"#1f2937",outline:"none",transition:e.transition??"border-color 0.15s",width:"100%",boxSizing:"border-box",...t.focused&&n?{boxShadow:`0 0 0 3px ${n}22`}:{},...e.custom??{}}}var ul={sm:{box:14,icon:10,fontSize:"12px"},md:{box:18,icon:12,fontSize:"14px"},lg:{box:22,icon:16,fontSize:"16px"}};function Qo(e){let t=Ce().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{checked:r,onChange:i,label:s,indeterminate:a=!1,disabled:l=!1,error:d,size:u="md"}=e,h=ne(null);re(()=>{h.current&&(h.current.indeterminate=a)},[a]);let m=v(()=>{l||i(!r)},[l,r,i]),c=v(L=>{l||(L.key===" "||L.key==="Enter")&&(L.preventDefault(),i(!r))},[l,r,i]),p=ul[u],f=`${p.box}px`,y=d?"#ef4444":r||a?"#3b82f6":"#d1d5db",x=r||a?"#3b82f6":"#ffffff",g={width:f,height:f,minWidth:f,borderRadius:"4px",border:`2px solid ${y}`,backgroundColor:x,display:"flex",alignItems:"center",justifyContent:"center",cursor:l?"not-allowed":"pointer",transition:"all 0.15s",boxSizing:"border-box"},b={color:"#ffffff",fontSize:`${p.icon}px`,lineHeight:"1",fontWeight:"700"},S=a?o("span",{style:b},"\u2014"):r?o("span",{style:b},"\u2713"):null,I={display:"inline-flex",alignItems:"center",gap:"8px",cursor:l?"not-allowed":"pointer",opacity:l?"0.6":"1",userSelect:"none"},A=o("input",{ref:h,type:"checkbox",id:n,checked:r,disabled:l,onChange:()=>i(!r),style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},"aria-hidden":"true",tabIndex:-1}),C=o("div",{style:g},S),T=s?o("span",{style:{fontSize:p.fontSize,color:"#374151"}},s):null;return o(ze,{error:d,htmlFor:n},o("div",{style:I,onClick:m,onKeyDown:c,tabIndex:l?-1:0,role:"checkbox","aria-checked":a?"mixed":r?"true":"false","aria-disabled":l?"true":void 0,"aria-label":s},A,C,T))}var pl=["#000000","#434343","#666666","#999999","#b7b7b7","#cccccc","#d9d9d9","#efefef","#f3f3f3","#ffffff","#980000","#ff0000","#ff9900","#ffff00","#00ff00","#00ffff","#4a86e8","#0000ff","#9900ff","#ff00ff","#e6b8af","#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#c9daf8","#cfe2f3","#d9d2e9","#ead1dc"];function er(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e)}function jt(e){let t=e.startsWith("#")?e:`#${e}`;return/^#[0-9a-fA-F]{3}$/.test(t)&&(t=`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`),t.toLowerCase()}function tr(e){let t=Ce().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,presets:s=pl,showInput:a=!0,showAlpha:l=!1,disabled:d=!1,label:u}=e,[h,m]=U(!1),[c,p]=U(r),f=ne(null);re(()=>{p(r)},[r]),re(()=>{let R=$=>{f.current&&!f.current.contains($.target)&&m(!1)};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[]);let y=v(R=>{d||i(jt(R))},[d,i]),x=v(R=>{let $=R.target.value;p($);let B=$.startsWith("#")?$:`#${$}`;er(B)&&i(jt(B))},[i]),g=v(()=>{er(c.startsWith("#")?c:`#${c}`)||p(r)},[c,r]),b={width:"36px",height:"36px",borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:r,cursor:d?"not-allowed":"pointer",flexShrink:"0"},S={display:"flex",alignItems:"center",gap:"8px"},I={position:"absolute",top:"100%",left:"0",marginTop:"4px",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",zIndex:"1000",padding:"12px",width:"240px"},A={display:"grid",gridTemplateColumns:"repeat(10, 1fr)",gap:"4px",marginBottom:a?"8px":"0"},C=s.map(R=>{let $=jt(R)===jt(r);return o("div",{key:R,style:{width:"20px",height:"20px",borderRadius:"3px",backgroundColor:R,cursor:d?"not-allowed":"pointer",border:$?"2px solid #1f2937":"1px solid #e5e7eb",boxSizing:"border-box"},onClick:()=>y(R),onKeyDown:E=>{let N=E.key;(N==="Enter"||N===" ")&&(E.preventDefault(),y(R))},role:"button",tabIndex:d?-1:0,title:R,"aria-label":`Select color ${R}`})}),T=a?o("div",{style:{display:"flex",alignItems:"center",gap:"4px"}},o("div",{style:{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:r,border:"1px solid #d1d5db",flexShrink:"0"}}),o("input",{type:"text",value:c,onInput:x,onBlur:g,disabled:d,style:{flex:"1",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"13px",fontFamily:"monospace",outline:"none",color:"#1f2937"},placeholder:"#000000","aria-label":"Hex color value"})):null,L=h?o("div",{style:I},o("div",{style:A},...C),T):null;return o(ze,{label:u,disabled:d,htmlFor:n},o("div",{ref:f,style:{position:"relative"}},o("div",{style:S,onClick:d?void 0:()=>m(!h),onKeyDown:d?void 0:R=>{let $=R.key;($==="Enter"||$===" ")&&(R.preventDefault(),m(!h))},role:"button",tabIndex:d?-1:0,"aria-expanded":h?"true":"false","aria-label":"Toggle color picker"},o("div",{id:n,style:b}),a?o("span",{style:{fontSize:"14px",fontFamily:"monospace",color:"#1f2937"}},r):null),L))}function nr(e){let t=Ce().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`cw-${t}`,{value:r="#000000",onChange:i,size:s=32,showLabel:a=!0,disabled:l=!1,label:d}=e,[u,h]=U(r),m=ne(null),c=v(((...x)=>{let b=x[0].target.value;h(b),i?.(b)}),[i]),p={display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"4px"},f={width:`${s}px`,height:`${s}px`,borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:u,cursor:l?"not-allowed":"pointer",position:"relative",overflow:"hidden"};return o(ze,{label:d,htmlFor:n},o("div",{style:p},o("div",{style:f},o("input",{id:n,ref:m,type:"color",value:u,onInput:c,disabled:l,style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",opacity:"0",cursor:l?"not-allowed":"pointer",border:"none",padding:"0"},"aria-label":d||"Color"})),a?o("span",{style:{fontSize:"11px",fontFamily:"monospace",color:"#64748b"}},u):null))}var or=["January","February","March","April","May","June","July","August","September","October","November","December"],fl=["Su","Mo","Tu","We","Th","Fr","Sa"];function Wn(e){if(!e)return null;if(e instanceof Date)return e;let t=new Date(e);return isNaN(t.getTime())?null:t}function ml(e,t){let n=e.getFullYear(),r=e.getMonth()+1,i=e.getDate();return t.replace("YYYY",String(n)).replace("MM",String(r).padStart(2,"0")).replace("DD",String(i).padStart(2,"0"))}function rr(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function gl(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function ir(e){let t=Ce().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,format:s="YYYY-MM-DD",minDate:a,maxDate:l,disabled:d=!1,placeholder:u="Select date...",label:h,error:m}=e,c=X(()=>Wn(r),[r]),p=X(()=>Wn(a),[a]),f=X(()=>Wn(l),[l]),[y,x]=U(!1),[g,b]=U(()=>c?c.getFullYear():new Date().getFullYear()),[S,I]=U(()=>c?c.getMonth():new Date().getMonth()),A=ne(null),C=X(()=>new Date,[]);re(()=>{let P=W=>{A.current&&!A.current.contains(W.target)&&x(!1)};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[]);let T=v(()=>{I(P=>P===0?(b(W=>W-1),11):P-1)},[]),L=v(()=>{I(P=>P===11?(b(W=>W+1),0):P+1)},[]),R=v(P=>{let W=new Date(g,S,P);p&&W<p||f&&W>f||(i(gl(W)),x(!1))},[g,S,i,p,f]),$=c?ml(c,s):"",B=X(()=>{let P=new Date(g,S,1).getDay(),W=new Date(g,S+1,0).getDate(),_=[],O=[];for(let Y=0;Y<P;Y++)O.push(null);for(let Y=1;Y<=W;Y++)O.push(Y),O.length===7&&(_.push(O),O=[]);for(;O.length>0&&O.length<7;)O.push(null);return O.length&&_.push(O),_},[g,S]),E={...je({},{focused:y,error:!!m}),cursor:d?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",minHeight:"38px",userSelect:"none"},N={position:"absolute",top:"100%",left:"0",marginTop:"4px",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",zIndex:"1000",padding:"12px",width:"280px"},z={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"8px"},k={background:"none",border:"none",cursor:"pointer",fontSize:"16px",padding:"4px 8px",color:"#374151",borderRadius:"4px"},w={display:"grid",gridTemplateColumns:"repeat(7, 1fr)",textAlign:"center",fontSize:"11px",fontWeight:"600",color:"#6b7280",marginBottom:"4px"},D=fl.map(P=>o("div",{key:P,style:{padding:"4px"}},P)),M=B.map((P,W)=>{let _=P.map((O,Y)=>{if(O===null)return o("div",{key:`empty-${W}-${Y}`,style:{padding:"4px"}});let K=new Date(g,S,O),Q=rr(K,C),q=c?rr(K,c):!1,H=p&&K<p||f&&K>f,j={padding:"4px",textAlign:"center",cursor:H?"not-allowed":"pointer",borderRadius:"4px",fontSize:"13px",fontWeight:Q?"700":"400",backgroundColor:q?"#3b82f6":"transparent",color:q?"#ffffff":H?"#d1d5db":Q?"#3b82f6":"#1f2937",border:Q&&!q?"1px solid #3b82f6":"1px solid transparent",lineHeight:"1.8"};return o("div",{key:`day-${O}`,style:j,onClick:H?void 0:()=>R(O),onKeyDown:H?void 0:G=>{let V=G.key;(V==="Enter"||V===" ")&&(G.preventDefault(),R(O))},role:H?void 0:"button",tabIndex:H?void 0:0,"aria-label":`${or[S]} ${O}, ${g}`,"aria-disabled":H?"true":void 0},String(O))});return o("div",{key:`row-${W}`,style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)"}},..._)}),F=y?o("div",{style:N},o("div",{style:z},o("button",{type:"button",style:k,onClick:T},"\u25C0"),o("span",{style:{fontWeight:"600",fontSize:"14px",color:"#1f2937"}},`${or[S]} ${g}`),o("button",{type:"button",style:k,onClick:L},"\u25B6")),o("div",{style:w},...D),...M):null;return o(ze,{label:h,error:m,disabled:d,htmlFor:n},o("div",{ref:A,style:{position:"relative"}},o("div",{id:n,style:E,onClick:d?void 0:()=>x(!y),onKeyDown:d?void 0:P=>{let W=P.key;(W==="Enter"||W===" ")&&(P.preventDefault(),x(!y))},tabIndex:d?-1:0,role:"button","aria-label":"Pick a date","aria-expanded":y?"true":"false"},o("span",{style:{color:$?"#1f2937":"#9ca3af"}},$||u),o("span",{style:{color:"#6b7280",fontSize:"14px"}},"\u{1F4C5}")),F))}function _n(e){if(e===0)return"0 B";let t=["B","KB","MB","GB"],n=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,n)).toFixed(n===0?0:1)} ${t[n]}`}function sr(e){let t=Ce().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`fu-${t}`,{onChange:r,accept:i,multiple:s=!1,maxSize:a,disabled:l=!1,label:d,helpText:u}=e,[h,m]=U([]),[c,p]=U(!1),[f,y]=U(""),x=ne(null),g=v(k=>{y("");let w=[];for(let M of k){if(a&&M.size>a){y(`File "${M.name}" exceeds maximum size of ${_n(a)}`);continue}w.push(M)}let D=s?[...h,...w]:w.slice(0,1);m(D),r(D)},[h,s,a,r]),b=v(k=>{if(k.preventDefault(),k.stopPropagation(),p(!1),l)return;let w=k.dataTransfer;if(!w)return;let D=Array.from(w.files);g(D)},[l,g]),S=v(k=>{k.preventDefault(),k.stopPropagation(),l||p(!0)},[l]),I=v(k=>{k.preventDefault(),k.stopPropagation(),p(!1)},[]),A=v(k=>{let w=k.target;w.files&&(g(Array.from(w.files)),w.value="")},[g]),C=v(k=>{let w=h.filter((D,M)=>M!==k);m(w),r(w)},[h,r]),T=v(()=>{l||x.current&&x.current.click()},[l]),L={border:`2px dashed ${c?"#3b82f6":f?"#ef4444":"#d1d5db"}`,borderRadius:"8px",padding:"24px",textAlign:"center",cursor:l?"not-allowed":"pointer",backgroundColor:c?"#eff6ff":"#fafafa",transition:"all 0.15s",opacity:l?"0.6":"1"},R={fontSize:"28px",color:"#9ca3af",marginBottom:"8px"},$={fontSize:"14px",color:"#374151",marginBottom:"4px"},B={fontSize:"12px",color:"#9ca3af"},E=o("input",{id:n,ref:x,type:"file",accept:i,multiple:s,onChange:A,disabled:l,style:{display:"none"},tabIndex:-1}),N=o("div",{style:L,onClick:T,onKeyDown:k=>{let w=k.key;(w==="Enter"||w===" ")&&(k.preventDefault(),T())},onDrop:b,onDragOver:S,onDragLeave:I,role:"button",tabIndex:l?-1:0,"aria-label":"Upload files"},o("div",{style:R},"\u2191"),o("div",{style:$},o("span",{style:{color:"#3b82f6",fontWeight:"500"}},"Click to upload")," or drag and drop"),i?o("div",{style:B},i):null,a?o("div",{style:B},`Max size: ${_n(a)}`):null),z=h.length>0?o("div",{style:{marginTop:"8px",display:"flex",flexDirection:"column",gap:"4px"}},...h.map((k,w)=>{let D={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",backgroundColor:"#f9fafb",borderRadius:"6px",border:"1px solid #e5e7eb",fontSize:"13px"},M={background:"none",border:"none",cursor:"pointer",color:"#ef4444",fontSize:"14px",padding:"2px 6px",borderRadius:"4px"};return o("div",{key:`file-${w}`,style:D},o("div",{style:{display:"flex",alignItems:"center",gap:"8px",overflow:"hidden"}},o("span",{style:{color:"#374151",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},k.name),o("span",{style:{color:"#9ca3af",fontSize:"11px",flexShrink:"0"}},_n(k.size))),o("button",{type:"button",style:M,onClick:F=>{F.stopPropagation(),C(w)},"aria-label":`Remove ${k.name}`},"\u2715"))})):null;return o(ze,{label:d,helpText:u,error:f||void 0,disabled:l,htmlFor:n},o("div",null,E,N,z))}function ar(e){let[t,n]=U(!1),[r,i]=U((e.value??e.defaultValue??"").length),s=Ce().replace(/[^a-zA-Z0-9_-]/g,""),a=e.id??`ml-${s}`,d={...je(e.inputStyle??{},{focused:t,error:!!e.error}),resize:e.autoResize?"none":"vertical",lineHeight:"1.5",...e.minHeight?{minHeight:e.minHeight}:{},...e.maxHeight?{maxHeight:e.maxHeight}:{}},u=v(c=>{let p=c.target,f=p.value;i(f.length),e.onChange&&e.onChange(f),e.autoResize&&(p.style.height="auto",p.style.height=`${p.scrollHeight}px`)},[e.onChange,e.autoResize]),h=o("textarea",{id:a,name:e.name,value:e.value,placeholder:e.placeholder,rows:String(e.rows??4),maxLength:e.maxLength?String(e.maxLength):void 0,readOnly:e.readOnly,disabled:e.disabled,"aria-invalid":e.error?"true":void 0,"aria-required":e.required?"true":void 0,className:`multiline-input ${e.className??""}`.trim(),style:d,onFocus:()=>n(!0),onBlur:c=>{n(!1),e.onBlur&&e.onBlur(c.target.value)},onInput:u}),m=e.showCount&&e.maxLength?o("div",{style:{fontSize:"11px",color:r>(e.maxLength??1/0)*.9?"#ef4444":"#9ca3af",textAlign:"right",marginTop:"2px"}},`${r}/${e.maxLength}`):e.showCount?o("div",{style:{fontSize:"11px",color:"#9ca3af",textAlign:"right",marginTop:"2px"}},`${r} characters`):null;return o(ze,{label:e.label,htmlFor:a,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},h,m)}function lr(e){let t=Ce().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`ns-${t}`,{value:r,onChange:i,min:s,max:a,step:l=1,disabled:d=!1,prefix:u,suffix:h,label:m,error:c}=e,[p,f]=U(!1),y=v(w=>{let D=w;return s!==void 0&&D<s&&(D=s),a!==void 0&&D>a&&(D=a),D},[s,a]),x=v(()=>{d||i(y(r+l))},[d,r,l,y,i]),g=v(()=>{d||i(y(r-l))},[d,r,l,y,i]),b=v(w=>{let D=w.target.value;if(D===""||D==="-")return;let M=parseFloat(D);isNaN(M)||i(y(M))},[y,i]),S=v(w=>{d||(w.key==="ArrowUp"?(w.preventDefault(),x()):w.key==="ArrowDown"&&(w.preventDefault(),g()))},[d,x,g]),I=s===void 0||r>s,A=a===void 0||r<a,C={display:"inline-flex",alignItems:"stretch",borderRadius:"6px",overflow:"hidden",border:`1px solid ${c?"#ef4444":p?"#3b82f6":"var(--color-border, #d1d5db)"}`,transition:"border-color 0.15s",opacity:d?"0.6":"1",...p&&!c?{boxShadow:"0 0 0 3px #3b82f622"}:{}},T=w=>({display:"flex",alignItems:"center",justifyContent:"center",width:"36px",backgroundColor:"var(--color-bg-subtle, #f9fafb)",border:"none",cursor:d||!w?"not-allowed":"pointer",color:d||!w?"#d1d5db":"var(--color-text, #374151)",fontSize:"inherit",fontWeight:"600",userSelect:"none",transition:"background-color 0.1s",borderRight:"none",borderLeft:"none"}),L={flex:"1",minWidth:"32px",textAlign:"center",border:"none",borderLeft:"1px solid var(--color-border, #e5e7eb)",borderRight:"1px solid var(--color-border, #e5e7eb)",outline:"none",fontSize:"inherit",fontFamily:"inherit",backgroundColor:"var(--color-bg, #ffffff)",color:"var(--color-text, #1f2937)",padding:"4px 2px"},R={display:"flex",alignItems:"center",fontSize:"inherit",color:"var(--color-text-muted, #6b7280)",padding:"0 2px",backgroundColor:"var(--color-bg-subtle, #f9fafb)"},$=o("button",{type:"button",style:T(I),onClick:g,disabled:d,"aria-label":"Decrement",tabIndex:-1},"\u2212"),B=u?o("span",{style:R},u):null,E=o("input",{id:n,type:"text",value:String(r),onInput:b,onKeyDown:S,onFocus:()=>f(!0),onBlur:()=>f(!1),disabled:d,style:L,"aria-label":m||"Number",role:"spinbutton","aria-valuenow":String(r),"aria-valuemin":s!==void 0?String(s):void 0,"aria-valuemax":a!==void 0?String(a):void 0}),N=h?o("span",{style:R},h):null,z=o("button",{type:"button",style:T(A),onClick:x,disabled:d,"aria-label":"Increment",tabIndex:-1},"+"),k=[$];return B&&k.push(B),k.push(E),N&&k.push(N),k.push(z),o(ze,{label:m,error:c,disabled:d,htmlFor:n},o("div",{style:C},...k))}function cr(e){let t=Ce().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{options:r,value:i,onChange:s,name:a,direction:l="vertical",disabled:d=!1,error:u,label:h}=e,m=v(y=>{d||s(y)},[d,s]),c=v(y=>{if(d)return;let x=r.filter(S=>!S.disabled);if(x.length===0)return;let g=x.findIndex(S=>S.value===i),b=g;if(y.key==="ArrowDown"||y.key==="ArrowRight")y.preventDefault(),b=g<x.length-1?g+1:0;else if(y.key==="ArrowUp"||y.key==="ArrowLeft")y.preventDefault(),b=g>0?g-1:x.length-1;else return;s(x[b].value)},[d,r,i,s]),p={display:"flex",flexDirection:l==="horizontal"?"row":"column",gap:l==="horizontal"?"16px":"8px"},f=r.map((y,x)=>{let g=y.value===i,b=d||!!y.disabled,S=`${n}-opt-${x}`,I={width:"18px",height:"18px",minWidth:"18px",borderRadius:"50%",border:`2px solid ${u?"#ef4444":g?"#3b82f6":"#d1d5db"}`,display:"flex",alignItems:"center",justifyContent:"center",transition:"border-color 0.15s",boxSizing:"border-box"},A={width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"#3b82f6",transition:"transform 0.15s",transform:g?"scale(1)":"scale(0)"},C={display:"inline-flex",alignItems:"center",gap:"8px",cursor:b?"not-allowed":"pointer",opacity:b?"0.5":"1",userSelect:"none"};return o("label",{key:y.value,htmlFor:S,style:C,onClick:b?void 0:T=>{T.preventDefault(),m(y.value)}},o("input",{type:"radio",id:S,name:a,value:y.value,checked:g,disabled:b,style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},tabIndex:-1}),o("div",{style:I},o("div",{style:A})),o("span",{style:{fontSize:"14px",color:"#374151"}},y.label))});return o(ze,{label:h,error:u,htmlFor:`${n}-opt-0`},o("div",{id:n,style:p,role:"radiogroup","aria-label":h,onKeyDown:c,tabIndex:d?-1:0},...f))}function dr(e){let t=Ce().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{options:r,value:i,onChange:s,placeholder:a="Select...",searchable:l=!1,multiple:d=!1,clearable:u=!1,disabled:h=!1,error:m,label:c,helpText:p}=e,[f,y]=U(!1),[x,g]=U(""),[b,S]=U(-1),I=ne(null),A=X(()=>Array.isArray(i)?i:i?[i]:[],[i]),C=X(()=>{if(!l||!x)return r;let P=x.toLowerCase();return r.filter(W=>W.label.toLowerCase().includes(P))},[r,x,l]),T=X(()=>{let P={},W=[];for(let _ of C)_.group?(P[_.group]||(P[_.group]=[]),P[_.group].push(_)):W.push(_);return{groups:P,ungrouped:W}},[C]),L=X(()=>A.length===0?"":A.map(W=>r.find(_=>_.value===W)).filter(Boolean).map(W=>W.label).join(", "),[A,r]);re(()=>{let P=W=>{let _=W.target;I.current&&!I.current.contains(_)&&(y(!1),g(""))};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[]);let R=v(P=>{if(d){let W=A.includes(P)?A.filter(_=>_!==P):[...A,P];s(W)}else s(P),y(!1),g("")},[d,A,s]),$=v(P=>{P.stopPropagation(),s(d?[]:"")},[d,s]),B=v(P=>{if(h)return;let W=P.key;if(!f&&(W==="Enter"||W===" "||W==="ArrowDown")){P.preventDefault(),y(!0),S(0);return}if(f){if(W==="Escape"){y(!1),g("");return}if(W==="ArrowDown")P.preventDefault(),S(_=>Math.min(_+1,C.length-1));else if(W==="ArrowUp")P.preventDefault(),S(_=>Math.max(_-1,0));else if(W==="Enter"&&b>=0&&b<C.length){P.preventDefault();let _=C[b];_.disabled||R(_.value)}}},[h,f,b,C,R]),E={...je({},{focused:f,error:!!m}),display:"flex",alignItems:"center",justifyContent:"space-between",cursor:h?"not-allowed":"pointer",minHeight:"38px",userSelect:"none"},N={position:"absolute",top:"100%",left:"0",right:"0",marginTop:"4px",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",zIndex:"1000",maxHeight:"240px",overflowY:"auto"},z=(P,W)=>{let _=A.includes(P.value),O=W===b,Y={padding:"8px 12px",cursor:P.disabled?"not-allowed":"pointer",backgroundColor:O?"#f3f4f6":_?"#eff6ff":"transparent",color:P.disabled?"#9ca3af":"#1f2937",display:"flex",alignItems:"center",gap:"8px",fontSize:"14px"};return o("div",{key:P.value,style:Y,onClick:P.disabled?void 0:()=>R(P.value),onMouseEnter:()=>S(W),role:"option","aria-selected":_?"true":"false","aria-disabled":P.disabled?"true":void 0},d&&_?o("span",{style:{color:"#3b82f6",fontWeight:"700"}},"\u2713"):null,P.label)},k=()=>{let P=[],W=0,{groups:_,ungrouped:O}=T;for(let Y of O)P.push(z(Y,W++));for(let Y of Object.keys(_)){P.push(o("div",{key:`group-${Y}`,style:{padding:"6px 12px",fontSize:"11px",fontWeight:"600",color:"#6b7280",textTransform:"uppercase",letterSpacing:"0.05em"}},Y));for(let K of _[Y])P.push(z(K,W++))}return P.length===0&&P.push(o("div",{style:{padding:"8px 12px",color:"#9ca3af",fontSize:"14px"}},"No options")),P},w=o("span",{style:{marginLeft:"8px",fontSize:"10px",transition:"transform 0.15s",transform:f?"rotate(180deg)":"rotate(0deg)",color:"#6b7280"}},"\u25BC"),D=o("div",{style:E,id:n,onClick:h?void 0:()=>{y(!f),S(-1)},onKeyDown:B,tabIndex:h?-1:0,role:"combobox","aria-expanded":f?"true":"false","aria-haspopup":"listbox"},o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:L?"#1f2937":"#9ca3af"}},L||a),o("span",{style:{display:"flex",alignItems:"center",gap:"4px"}},u&&A.length>0?o("span",{onClick:$,onKeyDown:P=>{let W=P.key;(W==="Enter"||W===" ")&&(P.preventDefault(),P.stopPropagation(),$(P))},style:{cursor:"pointer",color:"#9ca3af",fontSize:"14px",lineHeight:"1"},role:"button",tabIndex:0,"aria-label":"Clear selection"},"\u2715"):null,w)),M=l&&f?o("input",{type:"text",value:x,onInput:P=>{g(P.target.value),S(0)},placeholder:"Search...",style:{width:"100%",boxSizing:"border-box",padding:"8px 12px",border:"none",borderBottom:"1px solid #e5e7eb",outline:"none",fontSize:"14px"}}):null,F=f?o("div",{style:N,role:"listbox"},M,...k()):null;return o(ze,{label:c,error:m,helpText:p,disabled:h,htmlFor:n},o("div",{ref:I,style:{position:"relative"}},D,F))}function ur(e){let t=Ce().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,min:s=0,max:a=100,step:l=1,showValue:d=!1,showTicks:u=!1,disabled:h=!1,marks:m,range:c=!1,label:p,error:f}=e,y=ne(null),x=ne(i);x.current=i;let[g,b]=U(null),S=X(()=>{if(c&&Array.isArray(r))return r;let W=typeof r=="number"?r:0;return[W,W]},[r,c]),I=ne(S);I.current=S;let A=W=>{let _=Math.round((W-s)/l)*l+s;return Math.max(s,Math.min(a,_))},C=W=>(W-s)/(a-s)*100,T=v(W=>{if(!y.current)return s;let _=y.current.getBoundingClientRect(),O=Math.max(0,Math.min(1,(W.clientX-_.left)/_.width));return A(s+O*(a-s))},[s,a,l]),L=v(W=>_=>{h||(_.preventDefault(),b(W))},[h]),R=v(W=>{if(h)return;let _=T(W);if(c){let O=Math.abs(_-S[0]),Y=Math.abs(_-S[1]);O<=Y?i([A(_),S[1]]):i([S[0],A(_)])}else i(A(_))},[h,T,c,S,i,s,a,l]);re(()=>{if(!g)return;let W=O=>{let Y=T(O),K=I.current,Q=x.current;g==="single"?Q(A(Y)):g==="start"?Q([Math.min(A(Y),K[1]),K[1]]):g==="end"&&Q([K[0],Math.max(K[0],A(Y))])},_=()=>b(null);return document.addEventListener("mousemove",W),document.addEventListener("mouseup",_),()=>{document.removeEventListener("mousemove",W),document.removeEventListener("mouseup",_)}},[g,T,s,a,l]);let $=v(W=>{if(h)return;let _=0;if(W.key==="ArrowRight"||W.key==="ArrowUp")_=l;else if(W.key==="ArrowLeft"||W.key==="ArrowDown")_=-l;else return;W.preventDefault(),c||i(A((typeof r=="number"?r:0)+_))},[h,l,c,r,i,s,a]),B={position:"relative",width:"100%",height:"6px",backgroundColor:"#e5e7eb",borderRadius:"3px",cursor:h?"not-allowed":"pointer"},E=c?C(S[0]):0,N=C(c?S[1]:S[0]),z={position:"absolute",top:"0",left:`${E}%`,width:`${N-E}%`,height:"100%",backgroundColor:h?"#9ca3af":"#3b82f6",borderRadius:"3px"},k=W=>p?W==="start"?`${p} minimum`:W==="end"?`${p} maximum`:p:W==="start"?"Minimum value":W==="end"?"Maximum value":"Value",w=(W,_,O)=>{let Y={position:"absolute",top:"50%",left:`${W}%`,transform:"translate(-50%, -50%)",width:"18px",height:"18px",borderRadius:"50%",backgroundColor:"#ffffff",border:`2px solid ${h?"#9ca3af":"#3b82f6"}`,cursor:h?"not-allowed":"grab",boxShadow:"0 1px 3px rgba(0,0,0,0.15)",zIndex:"2"},K={position:"absolute",bottom:"24px",left:"50%",transform:"translateX(-50%)",backgroundColor:"#1f2937",color:"#ffffff",padding:"2px 6px",borderRadius:"4px",fontSize:"11px",whiteSpace:"nowrap"};return o("div",{id:_==="single"||_==="start"?n:void 0,style:Y,onMouseDown:L(_),role:"slider","aria-valuenow":String(O),"aria-valuemin":String(s),"aria-valuemax":String(a),"aria-label":k(_),tabIndex:h?-1:0,onKeyDown:$},d?o("div",{style:K},String(O)):null)},D=[];if(u)for(let W=s;W<=a;W+=l)D.push(o("div",{key:`tick-${W}`,style:{position:"absolute",top:"10px",left:`${C(W)}%`,width:"1px",height:"6px",backgroundColor:"#d1d5db",transform:"translateX(-50%)"}}));let M=[];if(m)for(let W of m)M.push(o("div",{key:`mark-${W.value}`,style:{position:"absolute",top:"18px",left:`${C(W.value)}%`,transform:"translateX(-50%)",fontSize:"11px",color:"#6b7280",whiteSpace:"nowrap"}},W.label));let F={paddingTop:d?"28px":"8px",paddingBottom:m||u?"28px":"8px",opacity:h?"0.6":"1"},P=[];return c?(P.push(w(C(S[0]),"start",S[0])),P.push(w(C(S[1]),"end",S[1]))):P.push(w(C(S[0]),"single",S[0])),o(ze,{label:p,error:f,htmlFor:n},o("div",{style:F},o("div",{ref:y,style:B,role:"presentation",onClick:R},o("div",{style:z}),...P,...D,...M)))}var hl=["bold","italic","underline","strikethrough","heading1","heading2","bulletList","orderedList","blockquote","link","unlink","insertHR","removeFormat","undo","redo"],bl={bold:{label:"Bold",icon:"B",command:"bold"},italic:{label:"Italic",icon:"I",command:"italic"},underline:{label:"Underline",icon:"U",command:"underline"},strikethrough:{label:"Strikethrough",icon:"S",command:"strikethrough"},heading1:{label:"Heading 1",icon:"H1",command:"formatBlock",value:"h1"},heading2:{label:"Heading 2",icon:"H2",command:"formatBlock",value:"h2"},heading3:{label:"Heading 3",icon:"H3",command:"formatBlock",value:"h3"},bulletList:{label:"Bullet list",icon:"\u2022",command:"insertUnorderedList"},orderedList:{label:"Numbered list",icon:"1.",command:"insertOrderedList"},blockquote:{label:"Blockquote",icon:"\u201C",command:"formatBlock",value:"blockquote"},link:{label:"Insert link",icon:"\u{1F517}",command:"createLink"},unlink:{label:"Remove link",icon:"\u26D4",command:"unlink"},insertHR:{label:"Horizontal rule",icon:"\u2015",command:"insertHorizontalRule"},removeFormat:{label:"Clear format",icon:"\u2718",command:"removeFormat"},undo:{label:"Undo",icon:"\u21A9",command:"undo"},redo:{label:"Redo",icon:"\u21AA",command:"redo"}};function pr(e){let[t,n]=U(!1),r=ne(null),i=Ce().replace(/[^a-zA-Z0-9_-]/g,""),s=e.id??i,a=e.toolbar??hl,l=e.toolbarStyle??{},d=e.editorStyle??{};re(()=>{r.current&&e.value!==void 0&&(r.current.innerHTML=e.value)},[]);let u=v((f,y)=>{if(!(e.disabled||e.readOnly)){if(f==="createLink"){let x=prompt("Enter URL:");if(!x)return;document.execCommand(f,!1,x)}else y&&f==="formatBlock"?document.execCommand(f,!1,`<${y}>`):document.execCommand(f,!1,y);r.current&&e.onChange&&e.onChange(r.current.innerHTML)}},[e.disabled,e.readOnly,e.onChange]),h=v(()=>{r.current&&e.onChange&&e.onChange(r.current.innerHTML)},[e.onChange]),m=v(()=>{n(!1),r.current&&e.onBlur&&e.onBlur(r.current.innerHTML)},[e.onBlur]),c=o("div",{className:"texteditor-toolbar",style:{display:"flex",flexWrap:"wrap",gap:"2px",padding:"6px 8px",backgroundColor:l.backgroundColor??"#f9fafb",borderBottom:l.borderBottom??"1px solid #e5e7eb",borderRadius:"6px 6px 0 0"}},...a.map(f=>{let y=bl[f];return y?o("button",{key:f,type:"button",title:y.label,onClick:()=>u(y.command,y.value),disabled:e.disabled||e.readOnly,style:{padding:"4px 8px",border:"none",borderRadius:"4px",backgroundColor:"transparent",color:l.buttonColor??"#374151",cursor:e.disabled?"not-allowed":"pointer",fontSize:l.buttonSize??"13px",fontWeight:f==="bold"?"700":f==="italic"?"400":"500",fontStyle:f==="italic"?"italic":"normal",textDecoration:f==="underline"?"underline":f==="strikethrough"?"line-through":"none",minWidth:"28px",textAlign:"center",lineHeight:"1.4"}},y.icon):null})),p=o("div",{ref:r,id:s,className:"texteditor-content",contentEditable:e.disabled?"false":"true",role:"textbox","aria-multiline":"true","aria-label":e.label??"Text editor","data-placeholder":e.placeholder??"",style:{padding:d.padding??"12px 14px",minHeight:e.minHeight??"200px",maxHeight:e.maxHeight??"none",overflow:"auto",backgroundColor:d.backgroundColor??"#ffffff",color:d.color??"#1f2937",fontFamily:d.fontFamily??"inherit",fontSize:d.fontSize??"14px",lineHeight:d.lineHeight??"1.6",outline:"none",borderRadius:"0 0 6px 6px",border:t?"1px solid #3b82f6":e.error?"1px solid #ef4444":"1px solid #d1d5db",borderTop:"none",transition:"border-color 0.15s"},onFocus:()=>n(!0),onBlur:m,onInput:h});return o(ze,{label:e.label,htmlFor:s,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},o("div",{className:"texteditor",style:{border:t?"1px solid #3b82f6":e.error?"1px solid #ef4444":"1px solid #d1d5db",borderRadius:"6px",overflow:"hidden",transition:"border-color 0.15s"}},c,p))}function fr(e){let[t,n]=U(!1),r=Ce().replace(/[^a-zA-Z0-9_-]/g,""),i=e.id??`tf-${r}`,s=je(e.inputStyle??{},{focused:t,error:!!e.error}),a=!!(e.prefix||e.suffix),l=o("input",{type:e.type??"text",id:i,name:e.name,value:e.value,placeholder:e.placeholder,maxLength:e.maxLength?String(e.maxLength):void 0,pattern:e.pattern,autoComplete:e.autoComplete,autoFocus:e.autoFocus,readOnly:e.readOnly,disabled:e.disabled,"aria-invalid":e.error?"true":void 0,"aria-required":e.required?"true":void 0,className:`textfield-input ${e.className??""}`.trim(),style:a?{...s,border:"none",boxShadow:"none",flex:"1",minWidth:"0"}:s,onFocus:()=>n(!0),onBlur:u=>{n(!1),e.onBlur&&e.onBlur(u.target.value)},onInput:u=>{let h=u.target.value;e.onInput&&e.onInput(h),e.onChange&&e.onChange(h)},onKeyDown:u=>{u.key==="Enter"&&e.onEnter&&e.onEnter(u.target.value)}}),d=a?o("div",{style:{...s,display:"flex",alignItems:"center",gap:"8px",padding:"0"}},e.prefix?o("span",{style:{paddingLeft:"10px",color:"#9ca3af",flexShrink:"0"}},e.prefix):null,l,e.suffix?o("span",{style:{paddingRight:"10px",color:"#9ca3af",flexShrink:"0"}},e.suffix):null):l;return o(ze,{label:e.label,htmlFor:i,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},d)}var xl=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Paris","Asia/Tokyo"];function rt(e){return String(e).padStart(2,"0")}function yl(e){let t=e.split(":");return{hour:parseInt(t[0],10)||0,minute:parseInt(t[1],10)||0,second:parseInt(t[2],10)||0}}function mr(e){let t=Ce().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,format:s="24h",minuteStep:a=1,disabled:l=!1,label:d,error:u,showSeconds:h=!1,timezone:m,showTimezone:c=!1,timezones:p=xl,onTimezoneChange:f}=e,[y,x]=U(!1),g=X(()=>yl(r),[r]),b=s==="12h",S=g.hour>=12,I=b?g.hour%12||12:g.hour,A=v((j,G,V)=>{let Z=Math.max(0,Math.min(23,j)),te=Math.max(0,Math.min(59,G)),ae=Math.max(0,Math.min(59,V??0));i(h?`${rt(Z)}:${rt(te)}:${rt(ae)}`:`${rt(Z)}:${rt(te)}`)},[i,h]),C=v(j=>{let G=parseInt(j.target.value,10)||0;b&&(G=G%12,S&&(G+=12)),A(G,g.minute,g.second)},[b,S,g.minute,g.second,A]),T=v(j=>{let G=parseInt(j.target.value,10)||0;A(g.hour,G,g.second)},[g.hour,g.second,A]),L=v(j=>{let G=parseInt(j.target.value,10)||0;A(g.hour,g.minute,G)},[g.hour,g.minute,A]),R=v(()=>{if(l)return;let j=S?g.hour-12:g.hour+12;A(j,g.minute,g.second)},[l,S,g.hour,g.minute,g.second,A]),$=v(j=>{l||A(g.hour+j,g.minute,g.second)},[l,g.hour,g.minute,g.second,A]),B=v(j=>{l||A(g.hour,g.minute+j*a,g.second)},[l,g.hour,g.minute,g.second,a,A]),E=v(j=>{l||A(g.hour,g.minute,g.second+j)},[l,g.hour,g.minute,g.second,A]),N=v(j=>{let G=j.target.value;f&&f(G)},[f]),z={display:"inline-flex",alignItems:"center",gap:"4px",...je({},{focused:y,error:!!u})},k={display:"flex",flexDirection:"column",alignItems:"center"},w={background:"none",border:"none",cursor:l?"not-allowed":"pointer",fontSize:"10px",padding:"0 4px",color:"#6b7280",lineHeight:"1"},D={width:"32px",textAlign:"center",border:"none",outline:"none",fontSize:"14px",fontFamily:"monospace",backgroundColor:"transparent",color:"#1f2937",padding:"0"},M={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:l?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},F=o("div",{style:k},o("button",{type:"button",style:w,onClick:()=>$(1),disabled:l},"\u25B2"),o("input",{type:"text",value:rt(I),onChange:C,style:D,disabled:l,"aria-label":"Hour",onFocus:()=>x(!0),onBlur:()=>x(!1)}),o("button",{type:"button",style:w,onClick:()=>$(-1),disabled:l},"\u25BC")),P=o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"),W=o("div",{style:k},o("button",{type:"button",style:w,onClick:()=>B(1),disabled:l},"\u25B2"),o("input",{type:"text",value:rt(g.minute),onChange:T,style:D,disabled:l,"aria-label":"Minute",onFocus:()=>x(!0),onBlur:()=>x(!1)}),o("button",{type:"button",style:w,onClick:()=>B(-1),disabled:l},"\u25BC")),_=h?o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"):null,O=h?o("div",{style:k},o("button",{type:"button",style:w,onClick:()=>E(1),disabled:l},"\u25B2"),o("input",{type:"text",value:rt(g.second),onChange:L,style:D,disabled:l,"aria-label":"Second",onFocus:()=>x(!0),onBlur:()=>x(!1)}),o("button",{type:"button",style:w,onClick:()=>E(-1),disabled:l},"\u25BC")):null,Y=b?o("button",{type:"button",style:M,onClick:R,disabled:l,"aria-label":"Toggle AM/PM"},S?"PM":"AM"):null,K={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:l?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},Q=m&&!c?o("span",{style:{marginLeft:"8px",fontSize:"12px",fontWeight:"600",color:"#6b7280"}},m):null,q=c?o("select",{style:K,value:m??p[0],onChange:N,disabled:l,"aria-label":"Timezone"},...p.map(j=>o("option",{key:j,value:j},j))):null,H=[F,P,W];return _&&H.push(_),O&&H.push(O),Y&&H.push(Y),Q&&H.push(Q),q&&H.push(q),o(ze,{label:d,error:u,disabled:l,htmlFor:n},o("div",{id:n,style:z},...H))}var Sl={sm:{trackW:32,trackH:18,thumbSize:14,offset:2},md:{trackW:44,trackH:24,thumbSize:20,offset:2},lg:{trackW:56,trackH:30,thumbSize:26,offset:2}};function gr(e){let{checked:t,onChange:n,label:r,labelPosition:i="right",disabled:s=!1,size:a="md",onColor:l="#3b82f6",offColor:d="#d1d5db"}=e,u=Sl[a],h=v(()=>{s||n(!t)},[s,t,n]),m=v(S=>{s||(S.key===" "||S.key==="Enter")&&(S.preventDefault(),n(!t))},[s,t,n]),c={width:`${u.trackW}px`,height:`${u.trackH}px`,borderRadius:`${u.trackH}px`,backgroundColor:t?l:d,position:"relative",cursor:s?"not-allowed":"pointer",transition:"background-color 0.2s",flexShrink:"0"},p=t?u.trackW-u.thumbSize-u.offset:u.offset,f={width:`${u.thumbSize}px`,height:`${u.thumbSize}px`,borderRadius:"50%",backgroundColor:"#ffffff",position:"absolute",top:`${u.offset}px`,left:`${p}px`,transition:"left 0.2s",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"},y={display:"inline-flex",alignItems:"center",gap:"8px",opacity:s?"0.5":"1",userSelect:"none"},x=r?o("span",{style:{fontSize:"14px",color:"#374151"}},r):null,g=o("div",{style:c},o("div",{style:f}));return o("div",{style:y,onClick:h,onKeyDown:m,tabIndex:s?-1:0,role:"switch","aria-checked":t?"true":"false","aria-disabled":s?"true":void 0,"aria-label":r},...(i==="left"?[x,g]:[g,x]).filter(Boolean))}var hr={none:"none",sm:"0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.06)",md:"0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06)",lg:"0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05)"};function br(e){let t=e.bordered!==!1,n=e.shadow??"sm",r=e.padding??"16px",i=e.borderRadius??"8px",s=X(()=>{let h={display:"flex",flexDirection:"column",borderRadius:i,overflow:"hidden",backgroundColor:"#ffffff",transition:"box-shadow 0.2s, transform 0.2s"};return t&&(h.border="1px solid #e5e7eb"),h.boxShadow=hr[n]??hr.sm,e.hoverable&&(h.cursor="pointer"),{...h,...e.style??{}}},[t,n,i,e.hoverable,e.style]),a={display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:r,gap:"12px"},l={padding:r,paddingTop:e.title||e.subtitle?"0":r,flex:"1"},d={padding:r,paddingTop:"0",borderTop:"1px solid #f3f4f6",paddingBottom:r,marginTop:"auto"},u=e.title||e.subtitle||e.headerAction;return o("div",{className:`card ${e.hoverable?"card--hoverable":""} ${e.className??""}`.trim(),style:s},e.image?o("img",{src:e.image,alt:e.imageAlt??"",style:{width:"100%",height:"auto",display:"block",objectFit:"cover"}}):null,u?o("div",{className:"card__header",style:a},o("div",{style:{flex:"1",minWidth:"0"}},e.title?o("div",{className:"card__title",style:{fontSize:"16px",fontWeight:"600",color:"#111827",lineHeight:"1.4"}},e.title):null,e.subtitle?o("div",{className:"card__subtitle",style:{fontSize:"14px",color:"#6b7280",marginTop:"2px",lineHeight:"1.4"}},e.subtitle):null),e.headerAction?o("div",{className:"card__header-action"},e.headerAction):null):null,o("div",{className:"card__body",style:l},e.children),e.footer?o("div",{className:"card__footer",style:d},e.footer):null)}function xr(e){let t=X(()=>{let n={display:e.inline?"inline-flex":"flex"};return e.direction&&(n.flexDirection=e.direction),e.wrap&&(n.flexWrap=e.wrap),e.gap&&(n.gap=e.gap),e.alignItems&&(n.alignItems=e.alignItems),e.justifyContent&&(n.justifyContent=e.justifyContent),{...n,...e.style??{}}},[e.direction,e.wrap,e.gap,e.alignItems,e.justifyContent,e.inline,e.style]);return o("div",{className:`flex-container ${e.className??""}`.trim(),style:t},e.children)}function yr(e){let t=X(()=>{let n={};return e.flex&&(n.flex=e.flex),e.grow!==void 0&&(n.flexGrow=String(e.grow)),e.shrink!==void 0&&(n.flexShrink=String(e.shrink)),e.basis&&(n.flexBasis=e.basis),e.alignSelf&&(n.alignSelf=e.alignSelf),e.order!==void 0&&(n.order=String(e.order)),{...n,...e.style??{}}},[e.flex,e.grow,e.shrink,e.basis,e.alignSelf,e.order,e.style]);return o("div",{className:`flex-item ${e.className??""}`.trim(),style:t},e.children)}function Sr(e){let t=X(()=>{let n={display:"grid"};return e.minColWidth?n.gridTemplateColumns=`repeat(auto-fit, minmax(${e.minColWidth}, 1fr))`:e.columns!==void 0&&(n.gridTemplateColumns=typeof e.columns=="number"?`repeat(${e.columns}, 1fr)`:e.columns),e.rows&&(n.gridTemplateRows=e.rows),e.gap&&(n.gap=e.gap),e.alignItems&&(n.alignItems=e.alignItems),e.justifyItems&&(n.justifyItems=e.justifyItems),e.areas&&e.areas.length>0&&(n.gridTemplateAreas=e.areas.map(r=>`"${r}"`).join(" ")),{...n,...e.style??{}}},[e.columns,e.rows,e.gap,e.alignItems,e.justifyItems,e.minColWidth,e.areas,e.style]);return o("div",{className:`grid ${e.className??""}`.trim(),style:t},e.children)}function vr(e){let t=X(()=>{let n={};return e.gridColumn&&(n.gridColumn=e.gridColumn),e.gridRow&&(n.gridRow=e.gridRow),e.gridArea&&(n.gridArea=e.gridArea),e.alignSelf&&(n.alignSelf=e.alignSelf),e.justifySelf&&(n.justifySelf=e.justifySelf),{...n,...e.style??{}}},[e.gridColumn,e.gridRow,e.gridArea,e.alignSelf,e.justifySelf,e.style]);return o("div",{className:`grid-item ${e.className??""}`.trim(),style:t},e.children)}var wr={none:"none",sm:"0 1px 3px rgba(0,0,0,0.12)",md:"0 4px 6px rgba(0,0,0,0.1)"};function kr(e){let t=e.bordered!==!1,n=e.shadow??"none",[r,i]=U(!!e.defaultCollapsed),s=ne(null),[a,l]=U("auto");re(()=>{if(!e.collapsible)return;let y=s.current;y&&l(`${y.scrollHeight}px`)},[e.children,e.collapsible]);let d=v(()=>{e.collapsible&&i(y=>!y)},[e.collapsible]),u=v(y=>{if(!e.collapsible)return;let x=y.key;(x==="Enter"||x===" ")&&(y.preventDefault(),d())},[e.collapsible,d]),h=X(()=>{let y={borderRadius:"6px",overflow:"hidden",backgroundColor:"#ffffff"};return t&&(y.border="1px solid #e5e7eb"),y.boxShadow=wr[n]??wr.none,{...y,...e.style??{}}},[t,n,e.style]),m={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",gap:"8px",backgroundColor:"#f9fafb",userSelect:"none",cursor:e.collapsible?"pointer":"default"},c={display:"inline-block",width:"0",height:"0",borderLeft:"5px solid transparent",borderRight:"5px solid transparent",borderTop:"6px solid #6b7280",transition:"transform 0.2s",transform:r?"rotate(-90deg)":"rotate(0deg)",marginRight:"8px",flexShrink:"0"},p={maxHeight:r?"0":a,overflow:"hidden",transition:"max-height 0.3s ease"},f={padding:"16px"};return o("div",{className:`panel ${e.className??""}`.trim(),style:h},o("div",{className:"panel__header",style:m,onClick:d,onKeyDown:u,role:e.collapsible?"button":void 0,tabIndex:e.collapsible?0:void 0,"aria-expanded":e.collapsible?String(!r):void 0},o("div",{style:{display:"flex",alignItems:"center",flex:"1",minWidth:"0",gap:"8px"}},e.collapsible?o("span",{className:"panel__chevron",style:c}):null,e.icon?o("span",{className:"panel__icon"},e.icon):null,e.title?o("span",{className:"panel__title",style:{fontSize:"14px",fontWeight:"600",color:"#111827"}},e.title):null),e.headerRight?o("div",{className:"panel__header-right"},e.headerRight):null),o("div",{className:"panel__body-wrapper",style:e.collapsible?p:{},ref:s},o("div",{className:"panel__body",style:f},e.children)))}function Cr(e,t){return e==="both"?"auto":e==="horizontal"?t==="x"?"auto":"hidden":t==="y"?"auto":"hidden"}function vl(e){switch(e){case"never":return{scrollbarWidth:"none"};case"always":return{scrollbarWidth:"thin"};case"hover":return{scrollbarWidth:"thin"};case"auto":default:return{scrollbarWidth:"auto"}}}function Mr(e){let t=e.direction??"vertical",n=e.showScrollbar??"auto",r=e.shadow??!1,i=ne(null),[s,a]=U(!0),[l,d]=U(!1),[u,h]=U(!0),[m,c]=U(!1),p=v(()=>{let b=i.current;if(!b)return;let S=2;a(b.scrollTop<=S),d(b.scrollTop+b.clientHeight>=b.scrollHeight-S),h(b.scrollLeft<=S),c(b.scrollLeft+b.clientWidth>=b.scrollWidth-S)},[]);re(()=>{p()},[p]);let f=v(()=>{r&&p()},[r,p]),y=X(()=>{let b={position:"relative",overflowX:Cr(t,"x"),overflowY:Cr(t,"y"),...vl(n)};return e.maxHeight&&(b.maxHeight=e.maxHeight),e.maxWidth&&(b.maxWidth=e.maxWidth),e.padding&&(b.padding=e.padding),{...b,...e.style??{}}},[t,n,e.maxHeight,e.maxWidth,e.padding,e.style]),x=[];if(r){let b=t==="vertical"||t==="both",S=t==="horizontal"||t==="both";b&&!s&&x.push("inset 0 8px 6px -6px rgba(0,0,0,0.15)"),b&&!l&&x.push("inset 0 -8px 6px -6px rgba(0,0,0,0.15)"),S&&!u&&x.push("inset 8px 0 6px -6px rgba(0,0,0,0.15)"),S&&!m&&x.push("inset -8px 0 6px -6px rgba(0,0,0,0.15)")}let g={...y};return x.length>0&&(g.boxShadow=x.join(", ")),o("div",{className:`scroll-container scroll-container--${t} ${e.className??""}`.trim(),style:g,ref:i,onScroll:f},e.children)}function Er(e){let t=e.direction??"horizontal",n=t==="horizontal",r=e.dividerSize??6,i=e.minSize??50,[s,a]=U(e.initialSplit??50),l=ne(null),d=ne(!1),u=v(y=>{y.preventDefault(),d.current=!0,document.body.style.cursor=n?"col-resize":"row-resize",document.body.style.userSelect="none"},[n]);re(()=>{let y=g=>{if(!d.current||!l.current)return;let b=l.current.getBoundingClientRect(),S=n?b.width:b.height,I=n?g.clientX-b.left:g.clientY-b.top;if(S<=0)return;let A=i/S*100,C=e.maxSize?e.maxSize/S*100:100-A,T=I/S*100;T=Math.max(A,Math.min(C,T)),a(T)},x=()=>{d.current&&(d.current=!1,document.body.style.cursor="",document.body.style.userSelect="")};return document.addEventListener("mousemove",y),document.addEventListener("mouseup",x),()=>{document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",x)}},[n,i,e.maxSize]);let h=X(()=>({display:"flex",flexDirection:n?"row":"column",width:"100%",height:"100%",overflow:"hidden",...e.style??{}}),[n,e.style]),m=n?{width:`calc(${s}% - ${r/2}px)`,overflow:"auto",flexShrink:"0"}:{height:`calc(${s}% - ${r/2}px)`,overflow:"auto",flexShrink:"0"},c={flex:"1",overflow:"auto",minWidth:"0",minHeight:"0"},p={flexShrink:"0",backgroundColor:"#e5e7eb",transition:"background-color 0.15s",...n?{width:`${r}px`,cursor:"col-resize",height:"100%"}:{height:`${r}px`,cursor:"row-resize",width:"100%"}},f=Array.isArray(e.children)?e.children:[];return o("div",{className:`splitter splitter--${t} ${e.className??""}`.trim(),style:h,ref:l},o("div",{className:"splitter__pane splitter__pane--first",style:m},f[0]??null),o("div",{className:"splitter__divider",style:p,onMouseDown:u,onKeyDown:y=>{let x=y.key,g=2;n&&(x==="ArrowLeft"||x==="ArrowRight")?(y.preventDefault(),a(b=>{let S=x==="ArrowRight"?g:-g;return Math.max(5,Math.min(95,b+S))})):!n&&(x==="ArrowUp"||x==="ArrowDown")&&(y.preventDefault(),a(b=>{let S=x==="ArrowDown"?g:-g;return Math.max(5,Math.min(95,b+S))}))},role:"separator",tabIndex:0,"aria-orientation":n?"vertical":"horizontal","aria-valuenow":String(Math.round(s)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Resize panels"}),o("div",{className:"splitter__pane splitter__pane--second",style:c},f[1]??null))}function Ir(e){let t=e.position??"top",n=e.variant??"line",r=e.tabs.find(g=>!g.disabled)?.id??"",[i,s]=U(e.activeTab??r),a=e.activeTab??i,l=ne(null),d=v(g=>{s(g),e.onChange&&e.onChange(g)},[e.onChange]),u=v(g=>{let b=e.tabs.filter(L=>!L.disabled),S=b.findIndex(L=>L.id===a);if(S===-1)return;let I=t==="left"||t==="right",A=I?"ArrowUp":"ArrowLeft",C=I?"ArrowDown":"ArrowRight",T=-1;if(g.key===A?T=S>0?S-1:b.length-1:g.key===C?T=S<b.length-1?S+1:0:g.key==="Home"?T=0:g.key==="End"&&(T=b.length-1),T>=0){g.preventDefault(),d(b[T].id);let L=l.current;if(L){let $=L.querySelectorAll('[role="tab"]')[e.tabs.indexOf(b[T])];$&&$.focus()}}},[e.tabs,a,t,d]),h=t==="left"||t==="right",m=t==="bottom"||t==="right",c=X(()=>({display:"flex",flexDirection:h?m?"row-reverse":"row":m?"column-reverse":"column",width:"100%",...e.style??{}}),[h,m,e.style]),p={display:"flex",flexDirection:h?"column":"row",gap:n==="pill"?"4px":"0",...n==="line"&&!h?{borderBottom:"2px solid #e5e7eb"}:{},...n==="line"&&h?{borderRight:t==="left"?"2px solid #e5e7eb":"none",borderLeft:t==="right"?"2px solid #e5e7eb":"none"}:{},...n==="card"?{backgroundColor:"#f9fafb"}:{},...n==="pill"?{padding:"4px"}:{},flexShrink:"0"},f={flex:"1",padding:"16px",minWidth:"0",minHeight:"0"},y=e.tabs.find(g=>g.id===a),x=e.tabs.map(g=>{let b=g.id===a,S={padding:"8px 16px",border:"none",background:"none",cursor:g.disabled?"not-allowed":"pointer",opacity:g.disabled?"0.5":"1",fontSize:"14px",fontWeight:b?"600":"400",color:b?"#3b82f6":"#6b7280",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"6px",outline:"none",transition:"color 0.15s, background-color 0.15s"};return n==="line"?h?t==="left"?(S.borderRight=b?"2px solid #3b82f6":"2px solid transparent",S.marginRight="-2px"):(S.borderLeft=b?"2px solid #3b82f6":"2px solid transparent",S.marginLeft="-2px"):(S.borderBottom=b?"2px solid #3b82f6":"2px solid transparent",S.marginBottom="-2px"):n==="card"?(S.backgroundColor=b?"#ffffff":"transparent",S.borderRadius="6px 6px 0 0",b&&(S.border="1px solid #e5e7eb",S.borderBottom="1px solid #ffffff")):n==="pill"&&(S.borderRadius="9999px",S.backgroundColor=b?"#3b82f6":"transparent",S.color=b?"#ffffff":"#6b7280"),o("button",{key:g.id,role:"tab","aria-selected":String(b),"aria-controls":`tabpanel-${g.id}`,"aria-disabled":g.disabled?"true":void 0,id:`tab-${g.id}`,tabIndex:b?"0":"-1",style:S,onClick:g.disabled?void 0:()=>d(g.id),onKeyDown:u},g.icon?o("span",{className:"tabs__tab-icon"},g.icon):null,g.label)});return o("div",{className:`tabs tabs--${t} tabs--${n} ${e.className??""}`.trim(),style:c},o("div",{className:"tabs__list",role:"tablist","aria-label":"Tabs","aria-orientation":h?"vertical":"horizontal",style:p,ref:l},...x),o("div",{className:"tabs__panel",role:"tabpanel",id:`tabpanel-${a}`,"aria-labelledby":`tab-${a}`,style:f,tabIndex:"0"},y?y.content:null))}function Rr(e){let t=e.items??[],n=t.length,r=e.loop!==!1,i=e.showDots!==!1,s=e.showArrows!==!1,a=e.animation??"slide",l=e.interval??5e3,d=Ce().replace(/[^a-zA-Z0-9_-]/g,""),[u,h]=U(0),m=ne(null),c=ne(null),p=v(C=>{let T=C;r?T=(C%n+n)%n:T=Math.max(0,Math.min(C,n-1)),h(T),e.onChange&&e.onChange(T)},[n,r,e.onChange]),f=v(()=>p(u+1),[u,p]),y=v(()=>p(u-1),[u,p]);re(()=>{if(!e.autoPlay||n<=1)return;let C=setInterval(f,l);return()=>clearInterval(C)},[e.autoPlay,l,f,n]),re(()=>{let C=L=>{L.key==="ArrowLeft"?y():L.key==="ArrowRight"&&f()},T=c.current;if(T)return T.addEventListener("keydown",C),()=>T.removeEventListener("keydown",C)},[f,y]);let x=a==="fade"?`@keyframes liq-fade-in-${d}{from{opacity:0}to{opacity:1}}`:"",g={position:"relative",overflow:"hidden",width:"100%",outline:"none"},b=X(()=>a==="fade"?{position:"relative",width:"100%"}:{display:"flex",transition:"transform 0.4s ease",transform:`translateX(-${u*100}%)`,width:"100%"},[u,a]),S={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:"2",background:"rgba(255,255,255,0.8)",border:"none",borderRadius:"50%",width:"36px",height:"36px",fontSize:"18px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:"#111827",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"},I=t.map((C,T)=>{let L=a==="fade"?{position:T===u?"relative":"absolute",top:"0",left:"0",width:"100%",opacity:T===u?"1":"0",transition:"opacity 0.4s ease"}:{flex:"0 0 100%",width:"100%"};return o("div",{key:String(T),style:L},C.content,C.caption?o("div",{style:{textAlign:"center",padding:"8px 12px",fontSize:"13px",color:"#6b7280"}},C.caption):null)}),A=i?o("div",{style:{display:"flex",justifyContent:"center",gap:"8px",padding:"12px 0"}},...t.map((C,T)=>o("button",{key:String(T),"aria-label":`Go to slide ${T+1}`,onclick:()=>p(T),style:{width:"10px",height:"10px",borderRadius:"50%",border:"none",cursor:"pointer",backgroundColor:T===u?"#3b82f6":"#d1d5db",transition:"background-color 0.2s",padding:"0"}}))):null;return o("div",{ref:c,tabindex:"0",role:"region","aria-label":"Carousel",style:g,onpointerdown:C=>{m.current=C.clientX},onpointerup:C=>{if(m.current==null)return;let T=C.clientX-m.current;T>50?y():T<-50&&f(),m.current=null}},x?o("style",null,x):null,o("div",{style:b},...I),s&&n>1?o("button",{"aria-label":"Previous slide",onclick:y,style:{...S,left:"8px"}},"\u2039"):null,s&&n>1?o("button",{"aria-label":"Next slide",onclick:f,style:{...S,right:"8px"}},"\u203A"):null,A)}function Pr(e){let[t,n]=U("loading"),r=ne(null),i=Ce().replace(/[^a-zA-Z0-9_-]/g,""),s=e.lazy!==!1,a=typeof e.width=="number"?`${e.width}px`:e.width,l=typeof e.height=="number"?`${e.height}px`:e.height;re(()=>{n("loading")},[e.src]);let d=X(()=>{let p={display:"inline-block",position:"relative",overflow:"hidden"};return a&&(p.width=a),l&&(p.height=l),e.borderRadius&&(p.borderRadius=e.borderRadius),p},[a,l,e.borderRadius]),u=X(()=>{let p={display:"block",width:"100%",height:"100%"};return e.objectFit&&(p.objectFit=e.objectFit),t==="loading"&&(p.opacity="0",p.position="absolute"),t==="error"&&(p.display="none"),p},[e.objectFit,t]),h=null;if(t==="loading")if(e.placeholder==="skeleton"){let p=`@keyframes liq-img-shimmer-${i}{0%{background-position:-200% 0}100%{background-position:200% 0}}`;h=o("div",null,o("style",null,p),o("div",{style:{width:a??"100%",height:l??"200px",backgroundColor:"#e5e7eb",backgroundImage:"linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%)",backgroundSize:"200% 100%",animation:`liq-img-shimmer-${i} 1.5s ease-in-out infinite`}}))}else e.placeholder==="blur"?h=o("div",{style:{width:a??"100%",height:l??"200px",backgroundColor:"#d1d5db",filter:"blur(20px)"}}):e.placeholder!=null&&e.placeholder!==!1&&(h=e.placeholder);let m=null;t==="error"&&e.fallback!=null&&(typeof e.fallback=="string"?m=o("img",{src:e.fallback,alt:e.alt??"",style:{display:"block",width:"100%",height:"100%",objectFit:e.objectFit??"cover"}}):m=e.fallback);let c=o("div",{style:d},h,o("img",{ref:r,src:e.src,alt:e.alt??"",loading:s?"lazy":void 0,style:u,onload:()=>n("loaded"),onerror:()=>n("error")}),m);return e.caption?o("figure",{style:{margin:"0",display:"inline-block"}},c,o("figcaption",{style:{fontSize:"13px",color:"#6b7280",marginTop:"6px",textAlign:"center"}},e.caption)):c}function Tr(e){if(!isFinite(e)||e<0)return"0:00";let t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n.toString().padStart(2,"0")}`}function $r(e){let t=e.controls!==!1,n=ne(null),r=Ce().replace(/[^a-zA-Z0-9_-]/g,""),[i,s]=U(!1),[a,l]=U(0),[d,u]=U(0),[h,m]=U(e.muted?0:1),[c,p]=U(!!e.muted),[f,y]=U(!0),x=typeof e.width=="number"?`${e.width}px`:e.width??"100%",g=typeof e.height=="number"?`${e.height}px`:e.height??"auto";re(()=>{let R=n.current;if(!R)return;let $=()=>{s(!0),e.onPlay&&e.onPlay()},B=()=>{s(!1),e.onPause&&e.onPause()},E=()=>{s(!1),e.onEnded&&e.onEnded()},N=()=>{l(R.currentTime),u(R.duration),e.onTimeUpdate&&e.onTimeUpdate(R.currentTime,R.duration)},z=()=>{u(R.duration)};return R.addEventListener("play",$),R.addEventListener("pause",B),R.addEventListener("ended",E),R.addEventListener("timeupdate",N),R.addEventListener("loadedmetadata",z),()=>{R.removeEventListener("play",$),R.removeEventListener("pause",B),R.removeEventListener("ended",E),R.removeEventListener("timeupdate",N),R.removeEventListener("loadedmetadata",z)}},[e.onPlay,e.onPause,e.onEnded,e.onTimeUpdate]);let b=v(()=>{let R=n.current;R&&(R.paused?R.play():R.pause())},[]),S=v(R=>{let $=n.current;if(!$||!isFinite($.duration))return;let B=R.currentTarget.getBoundingClientRect(),E=Math.max(0,Math.min(1,(R.clientX-B.left)/B.width));$.currentTime=E*$.duration},[]),I=v(R=>{let $=n.current,B=parseFloat(R.target.value);$&&($.volume=B,$.muted=B===0,m(B),p(B===0))},[]),A=v(()=>{let R=n.current;R&&R.requestFullscreen&&R.requestFullscreen()},[]);if(!t)return o("video",{ref:n,src:e.src,poster:e.poster,controls:!0,autoplay:e.autoPlay?!0:void 0,loop:e.loop?!0:void 0,muted:e.muted?!0:void 0,style:{width:x,height:g,display:"block"}});let C=d>0?a/d*100:0,T={background:"none",border:"none",color:"#ffffff",cursor:"pointer",fontSize:"16px",padding:"4px 8px",lineHeight:"1"},L=o("div",{style:{position:"absolute",bottom:"0",left:"0",right:"0",display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",background:"linear-gradient(transparent, rgba(0,0,0,0.7))",opacity:f?"1":"0",transition:"opacity 0.3s"}},o("button",{"aria-label":i?"Pause":"Play",onclick:b,style:T},i?"\u23F8":"\u25B6"),o("div",{onclick:S,style:{flex:"1",height:"4px",backgroundColor:"rgba(255,255,255,0.3)",borderRadius:"2px",cursor:"pointer",position:"relative"}},o("div",{style:{width:`${C}%`,height:"100%",backgroundColor:"#3b82f6",borderRadius:"2px",transition:"width 0.1s linear"}})),o("span",{style:{color:"#ffffff",fontSize:"12px",whiteSpace:"nowrap",fontFamily:"monospace"}},`${Tr(a)} / ${Tr(d)}`),o("input",{type:"range",min:"0",max:"1",step:"0.05",value:String(c?0:h),oninput:I,"aria-label":"Volume",style:{width:"60px",cursor:"pointer"}}),o("button",{"aria-label":"Fullscreen",onclick:A,style:T},"\u26F6"));return o("div",{style:{position:"relative",width:x,height:g,backgroundColor:"#000",overflow:"hidden"},onmouseenter:()=>y(!0),onmouseleave:()=>{i&&y(!1)}},o("video",{ref:n,src:e.src,poster:e.poster,autoplay:e.autoPlay?!0:void 0,loop:e.loop?!0:void 0,muted:e.muted?!0:void 0,playsinline:!0,onclick:b,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"}}),L)}function _e(e){let t=e.orientation??"vertical",n=e.role??"navigation",r=e.keyboardNav??!0,i=e.styling??{},s=ne(null),a={display:"flex",flexDirection:t==="horizontal"?"row":"column",backgroundColor:i.backgroundColor??"#ffffff",color:i.color??"#1f2937",fontFamily:i.fontFamily??"inherit",fontSize:i.fontSize??"14px",border:i.border??"1px solid #e5e7eb",borderRadius:i.borderRadius??"8px",padding:i.padding??"0",width:typeof i.width=="number"?`${i.width}px`:i.width??"auto",overflow:"auto",boxSizing:"border-box",listStyle:"none",margin:"0",...i.boxShadow?{boxShadow:i.boxShadow}:{},...i.maxHeight?{maxHeight:typeof i.maxHeight=="number"?`${i.maxHeight}px`:i.maxHeight}:{},...i.custom??{}},l=v(d=>{if(!r)return;let u=d,h=s.current;if(!h)return;let m=Array.from(h.querySelectorAll('button, [tabindex]:not([tabindex="-1"]), a[href], [role="menuitem"], [role="treeitem"]')),c=m.indexOf(document.activeElement);if(c<0)return;let p=t==="vertical",f=p?"ArrowDown":"ArrowRight",y=p?"ArrowUp":"ArrowLeft";if(u.key===f){u.preventDefault();let x=m[c+1];x&&x.focus()}else if(u.key===y){u.preventDefault();let x=m[c-1];x&&x.focus()}else u.key==="Home"?(u.preventDefault(),m[0]?.focus()):u.key==="End"&&(u.preventDefault(),m[m.length-1]?.focus())},[r,t]);return o("nav",{ref:s,role:n,"aria-label":e.ariaLabel??void 0,"aria-orientation":t,className:`nav-wrapper ${e.className??""}`.trim(),style:a,onKeyDown:l},e.children)}function bt(e,t){return{display:"flex",alignItems:"center",padding:e.padding??"10px 16px",cursor:e.cursor??"pointer",transition:e.transition??"background-color 0.15s",backgroundColor:t.active?e.activeBackground??"#eff6ff":t.hover?e.hoverBackground??"#f3f4f6":"transparent",color:t.active?e.activeColor??"#2563eb":"inherit",border:"none",outline:"none",width:"100%",textAlign:"left",font:"inherit",...e.separator?{borderBottom:e.separator}:{}}}function Fe(){let[e,t]=U(!1);return{hover:e,onMouseEnter:v(()=>t(!0),[]),onMouseLeave:v(()=>t(!1),[])}}function wl(e){let{section:t,expanded:n,onToggle:r,headerStyle:i,expandIcon:s,collapseIcon:a,iconPosition:l}=e,{hover:d,onMouseEnter:u,onMouseLeave:h}=Fe(),m=t.disabled===!0,c={display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",boxSizing:"border-box",padding:i.padding??"12px 16px",backgroundColor:m?"#f9fafb":d?i.hoverBackground??"#f3f4f6":i.backgroundColor??"transparent",color:m?"#9ca3af":i.color??"inherit",fontWeight:i.fontWeight??"600",fontSize:i.fontSize??"inherit",border:"none",outline:"none",cursor:m?"not-allowed":"pointer",font:"inherit",textAlign:"left",transition:"background-color 0.15s",...i.borderBottom?{borderBottom:i.borderBottom}:{}};l==="left"&&(c.flexDirection="row");let p=v(S=>{let I=S;m||(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),r())},[m,r]),f=v(()=>{m||r()},[m,r]),x=o("span",{"aria-hidden":"true",style:{display:"inline-block",transition:"transform 0.2s ease",transform:n?"rotate(180deg)":"rotate(0deg)",flexShrink:"0",marginLeft:l==="right"?"auto":"0",marginRight:l==="left"?"8px":"0",paddingLeft:l==="right"?"8px":"0"}},n?a:s),g=t.icon?o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},o("span",{"aria-hidden":"true"},t.icon),t.header):t.header,b=l==="left"?[x,g]:[g,x];return o("button",{id:`accordion-header-${t.id}`,role:"button","aria-expanded":String(n),"aria-controls":`accordion-panel-${t.id}`,"aria-disabled":m?"true":void 0,"data-section-id":t.id,tabIndex:m?-1:0,style:c,onClick:f,onKeyDown:p,onMouseEnter:u,onMouseLeave:h},...b)}function kl(e){let{section:t,expanded:n,contentStyle:r,animated:i}=e,s={overflow:"hidden",boxSizing:"border-box",...i?{maxHeight:n?"2000px":"0",transition:"max-height 0.3s ease"}:{display:n?"block":"none"}},a={padding:r.padding??"12px 16px",backgroundColor:r.backgroundColor??"transparent",...r.borderBottom?{borderBottom:r.borderBottom}:{}};return o("div",{id:`accordion-panel-${t.id}`,role:"region","aria-labelledby":`accordion-header-${t.id}`,"aria-hidden":String(!n),"data-section-content":t.id,style:s},o("div",{style:a},t.content))}function Dr(e){let{sections:t,defaultExpanded:n,allowMultiple:r=!1,headerStyle:i={},contentStyle:s={},wrapperStyle:a,expandIcon:l="+",collapseIcon:d="\u2212",iconPosition:u="right",animated:h=!0,onChange:m}=e,[c,p]=U(()=>n??[]),f=v(x=>{p(g=>{let b=g.includes(x),S;return b?S=g.filter(I=>I!==x):r?S=[...g,x]:S=[x],m&&m(S),S})},[r,m]),y=X(()=>t.map(x=>{let g=c.includes(x.id),b=o(wl,{key:`header-${x.id}`,section:x,expanded:g,onToggle:()=>f(x.id),headerStyle:i,expandIcon:l,collapseIcon:d,iconPosition:u}),S=o(kl,{key:`content-${x.id}`,section:x,expanded:g,contentStyle:s,animated:h});return o("div",{key:x.id,"data-accordion-section":x.id,style:{width:"100%"}},b,S)}),[t,c,i,s,l,d,u,h,f]);return o(_e,{role:"region",ariaLabel:"Accordion",styling:a,keyboardNav:!0},...y)}var Cl={sm:{fontSize:"12px",padding:"4px 0"},md:{fontSize:"14px",padding:"6px 0"},lg:{fontSize:"16px",padding:"8px 0"}};function zr(e){let{items:t,separator:n="/",maxItems:r,size:i="md"}=e,[s,a]=U(!1),l=Cl[i],d=v(()=>{a(!0)},[]),u=t,h=!1;if(r&&r>1&&t.length>r&&!s){h=!0;let f=1,y=r-1;u=[...t.slice(0,f),{label:"..."},...t.slice(t.length-y)]}let m=f=>typeof f=="string"?o("span",{"aria-hidden":"true",style:{margin:"0 8px",color:"#9ca3af",userSelect:"none"}},f):o("span",{"aria-hidden":"true",style:{margin:"0 8px"}},f),c=(f,y,x)=>{let g=y===x.length-1,b=h&&f.label==="..."&&y===1,S=[];return y>0&&S.push(m(n)),b?S.push(o("button",{type:"button",onClick:d,style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",fontSize:l.fontSize,color:"#6b7280",fontFamily:"inherit"},"aria-label":"Show all breadcrumb items"},"...")):g?S.push(o("span",{"aria-current":"page",style:{color:"#1f2937",fontWeight:"600",fontSize:l.fontSize}},f.label)):f.href?S.push(o("a",{href:f.href,onClick:f.onClick?I=>{I.preventDefault(),f.onClick()}:void 0,style:{color:"#2563eb",textDecoration:"none",fontSize:l.fontSize}},f.label)):f.onClick?S.push(o("button",{type:"button",onClick:f.onClick,style:{background:"none",border:"none",cursor:"pointer",color:"#2563eb",padding:"0",fontSize:l.fontSize,fontFamily:"inherit"}},f.label)):S.push(o("span",{style:{color:"#6b7280",fontSize:l.fontSize}},f.label)),o("li",{key:String(y),style:{display:"inline-flex",alignItems:"center"}},...S)},p=u.map((f,y)=>c(f,y,u));return o(_e,{orientation:"horizontal",role:"navigation",ariaLabel:"Breadcrumb",keyboardNav:!1,styling:{border:"none",borderRadius:"0",padding:l.padding,backgroundColor:"transparent"}},o("ol",{style:{display:"flex",alignItems:"center",listStyle:"none",margin:"0",padding:"0",flexWrap:"wrap"}},...p))}function Ar(e){let{item:t,itemStyle:n,closeOnSelect:r,onClose:i}=e,{hover:s,onMouseEnter:a,onMouseLeave:l}=Fe(),[d,u]=U(!1),h=t.children&&t.children.length>0;if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let m=t.disabled===!0,p={...bt(n,{hover:!m&&s,active:!1}),position:"relative",justifyContent:"space-between",...m?{color:"#9ca3af",cursor:"default",opacity:"0.6"}:{}},f=v(()=>{if(!m){if(h){u(I=>!I);return}t.onClick&&t.onClick(),r&&i()}},[m,h,t,r,i]),y=v(()=>{a(),h&&u(!0)},[h,a]),x=v(()=>{l(),h&&u(!1)},[h,l]),g=o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},t.icon?o("span",{style:{flexShrink:"0"},"aria-hidden":"true"},t.icon):null,o("span",null,t.label)),b=h?o("span",{style:{marginLeft:"8px",fontSize:"10px",lineHeight:"1"},"aria-hidden":"true"},"\u203A"):null,S=h&&d?o("div",{style:{position:"absolute",left:"100%",top:"0",zIndex:"1000"}},o(_e,{orientation:"vertical",role:"menu",styling:{boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #e5e7eb",borderRadius:"6px",width:"200px",backgroundColor:"#ffffff"}},...t.children.map(I=>o(Ar,{key:I.id,item:I,itemStyle:n,closeOnSelect:r,onClose:i})))):null;return o("div",{style:{position:"relative"},onMouseEnter:y,onMouseLeave:x},o("button",{type:"button",role:"menuitem",style:p,onClick:f,disabled:m||void 0,tabIndex:m?-1:0,"aria-disabled":m?"true":void 0,"aria-haspopup":h||void 0,"aria-expanded":h?String(d):void 0},g,b),S)}function Lr(e){let{label:t,items:n,triggerStyle:r,menuStyle:i,itemStyle:s={},placement:a="bottom-start",closeOnSelect:l=!0,width:d="220px"}=e,[u,h]=U(!1),m=ne(null),c=v(()=>{h(I=>!I)},[]),p=v(()=>{h(!1)},[]);re(()=>{if(!u)return;let I=A=>{let C=m.current;C&&!C.contains(A.target)&&h(!1)};return document.addEventListener("click",I,!0),()=>{document.removeEventListener("click",I,!0)}},[u]),re(()=>{if(!u)return;let I=A=>{A.key==="Escape"&&h(!1)};return document.addEventListener("keydown",I),()=>{document.removeEventListener("keydown",I)}},[u]);let f={display:"inline-flex",alignItems:"center",gap:"4px",padding:"8px 16px",fontSize:"14px",fontFamily:"inherit",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",color:"#1f2937",cursor:"pointer",outline:"none",...r??{}},y=o("button",{type:"button",style:f,onClick:c,"aria-haspopup":"true","aria-expanded":String(u)},o("span",null,t),o("span",{style:{marginLeft:"4px",fontSize:"10px",transition:"transform 0.15s",transform:u?"rotate(180deg)":"rotate(0deg)"},"aria-hidden":"true"},"\u25BC")),x=typeof d=="number"?`${d}px`:d,g={position:"absolute",top:"100%",...a==="bottom-end"?{right:"0"}:{left:"0"},marginTop:"4px",zIndex:"999"},b={boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #e5e7eb",borderRadius:"6px",padding:"4px 0",width:x,backgroundColor:"#ffffff",...i??{}},S=u?o("div",{style:g},o(_e,{orientation:"vertical",role:"menu",ariaLabel:`${t} menu`,styling:b},...n.map(I=>o(Ar,{key:I.id,item:I,itemStyle:s,closeOnSelect:l,onClose:p})))):null;return o("div",{ref:m,style:{position:"relative",display:"inline-block"}},y,S)}function Br(e){let{item:t,onClose:n,index:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:a}=Fe(),[l,d]=U(!1),u=t.children&&t.children.length>0;if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let h=t.disabled===!0,m=v(()=>{if(!h){if(u){d(b=>!b);return}t.onClick&&t.onClick(),n()}},[h,u,t,n]),c=v(()=>{s(),u&&d(!0)},[u,s]),p=v(()=>{a(),u&&d(!1)},[u,a]),f={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 16px",fontSize:"13px",fontFamily:"inherit",border:"none",outline:"none",width:"100%",textAlign:"left",cursor:h?"default":"pointer",backgroundColor:!h&&i?"#f3f4f6":"transparent",color:h?"#9ca3af":"#1f2937",opacity:h?"0.6":"1",transition:"background-color 0.1s",boxSizing:"border-box"},y=o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},t.icon?o("span",{style:{width:"16px",textAlign:"center"},"aria-hidden":"true"},t.icon):o("span",{style:{width:"16px"}}),o("span",null,t.label)),x=u?o("span",{style:{fontSize:"10px",color:"#9ca3af"},"aria-hidden":"true"},"\u25B6"):t.shortcut?o("span",{style:{fontSize:"11px",color:"#9ca3af",marginLeft:"24px"}},t.shortcut):null,g=u&&l?o("div",{style:{position:"absolute",left:"100%",top:"0",zIndex:"1001"}},o("div",{role:"menu",style:{backgroundColor:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"180px"}},...t.children.map((b,S)=>o(Br,{key:String(S),item:b,onClose:n,index:S})))):null;return o("div",{style:{position:"relative"},onMouseEnter:c,onMouseLeave:p},o("button",{type:"button",role:"menuitem",style:f,onClick:m,disabled:h||void 0,tabIndex:-1,"aria-disabled":h||void 0,"aria-haspopup":u||void 0,"aria-expanded":u?l:void 0},y,x),g)}function Ml(e){let{menu:t,index:n,isOpen:r,anyOpen:i,onOpen:s,onClose:a}=e,{hover:l,onMouseEnter:d,onMouseLeave:u}=Fe(),h=ne(null),m=v(()=>{r?a():s(n)},[r,n,s,a]),c=v(()=>{d(),i&&!r&&s(n)},[i,r,n,s,d]),p={display:"inline-flex",alignItems:"center",padding:"6px 12px",fontSize:"13px",fontFamily:"inherit",border:"none",outline:"none",cursor:"pointer",backgroundColor:r?"#e5e7eb":l?"#f3f4f6":"transparent",color:"#1f2937",borderRadius:"4px",transition:"background-color 0.1s"},f=r?o("div",{style:{position:"absolute",top:"100%",left:"0",zIndex:"1000",marginTop:"2px"}},o("div",{role:"menu","aria-label":`${t.label} menu`,style:{backgroundColor:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"200px"}},...t.items.map((y,x)=>o(Br,{key:String(x),item:y,onClose:a,index:x})))):null;return o("div",{style:{position:"relative",display:"inline-block"},onMouseEnter:c,onMouseLeave:u},o("button",{ref:h,type:"button",role:"menuitem",style:p,onClick:m,"aria-haspopup":"true","aria-expanded":String(r),tabIndex:0},t.label),f)}function Fr(e){let{menus:t}=e,[n,r]=U(null),i=ne(null),s=v(d=>{r(d)},[]),a=v(()=>{r(null)},[]);re(()=>{if(n===null)return;let d=u=>{let h=i.current;h&&!h.contains(u.target)&&r(null)};return document.addEventListener("click",d,!0),()=>{document.removeEventListener("click",d,!0)}},[n]),re(()=>{let d=i.current;if(!d)return;let u=h=>{let m=h;if(m.key==="Escape"){r(null);return}if(m.key==="ArrowRight"){m.preventDefault(),r(c=>c===null?0:(c+1)%t.length);return}if(m.key==="ArrowLeft"){m.preventDefault(),r(c=>c===null?t.length-1:(c-1+t.length)%t.length);return}if(m.key==="ArrowDown"&&n!==null){m.preventDefault();let c=d.querySelector('[role="menu"]');if(c){let p=c.querySelector('[role="menuitem"]');p&&p.focus()}return}m.key==="Enter"||m.key};return d.addEventListener("keydown",u),()=>{d.removeEventListener("keydown",u)}},[n,t.length]);let l=t.map((d,u)=>o(Ml,{key:String(u),menu:d,index:u,isOpen:n===u,anyOpen:n!==null,onOpen:s,onClose:a}));return o("div",{ref:i,role:"menubar","aria-label":"Menu bar",style:{display:"flex",alignItems:"center",backgroundColor:"#ffffff",borderBottom:"1px solid #e5e7eb",padding:"2px 4px",fontFamily:"inherit",fontSize:"13px",gap:"2px"}},...l)}function Gt(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function El(e,t,n){let r=n*2+5;if(e<=r)return Gt(1,e);let i=Math.max(t-n,1),s=Math.min(t+n,e),a=i>2,l=s<e-1;return!a&&l?[...Gt(1,n*2+3),"ellipsis",e]:a&&!l?[1,"ellipsis",...Gt(e-n*2-2,e)]:[1,"ellipsis",...Gt(i,s),"ellipsis",e]}var Xt={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"36px",height:"36px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",color:"#374151",fontSize:"14px",fontFamily:"inherit",cursor:"pointer",transition:"background-color 0.15s, color 0.15s",outline:"none",userSelect:"none"},Il={...Xt,backgroundColor:"#2563eb",color:"#ffffff",borderColor:"#2563eb",fontWeight:"600"},Nr={...Xt,color:"#9ca3af",cursor:"default",opacity:"0.5"},Rl={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"36px",height:"36px",color:"#6b7280",fontSize:"14px",userSelect:"none"};function Wr(e){let{total:t,pageSize:n,currentPage:r,onChange:i,siblingCount:s=1,showFirstLast:a=!0,showPrevNext:l=!0,disabled:d=!1}=e,u=Math.max(1,Math.ceil(t/n)),h=Math.min(Math.max(1,r),u),m=v(x=>{!d&&x>=1&&x<=u&&x!==h&&i(x)},[d,u,h,i]),c=(x,g,b)=>{let S=d||g<1||g>u||g===h;return o("button",{type:"button",onClick:()=>m(g),disabled:S||void 0,"aria-label":b,style:S?Nr:Xt},x)},p=El(u,h,s),f=0,y=[];a&&y.push(c("\xAB",1,"Go to first page")),l&&y.push(c("\u2039",h-1,"Go to previous page"));for(let x of p)if(x==="ellipsis")y.push(o("span",{key:`ellipsis-${f++}`,style:Rl},"..."));else{let g=x===h;y.push(o("button",{key:String(x),type:"button",onClick:()=>m(x),disabled:d||void 0,"aria-label":`Page ${x}`,"aria-current":g?"page":void 0,style:d?Nr:g?Il:Xt},String(x)))}return l&&y.push(c("\u203A",h+1,"Go to next page")),a&&y.push(c("\xBB",u,"Go to last page")),o(_e,{orientation:"horizontal",role:"navigation",ariaLabel:"Pagination",keyboardNav:!0,styling:{border:"none",borderRadius:"0",backgroundColor:"transparent",padding:"0",custom:{gap:"4px"}}},...y)}function _r(e){let{item:t,collapsed:n,selectedId:r,onSelect:i,depth:s}=e,{hover:a,onMouseEnter:l,onMouseLeave:d}=Fe(),[u,h]=U(!1),m=t.children&&t.children.length>0,c=t.id===r,p=v(()=>{m&&!n&&h(T=>!T),i&&i(t.id)},[m,n,i,t.id]),f=n?"0":`${16+s*16}px`,y={display:"flex",alignItems:"center",padding:n?"10px 0":`10px 12px 10px ${f}`,justifyContent:n?"center":"flex-start",cursor:"pointer",backgroundColor:c?"#eff6ff":a?"#f3f4f6":"transparent",color:c?"#2563eb":"#1f2937",border:"none",outline:"none",width:"100%",textAlign:"left",font:"inherit",fontSize:"14px",transition:"background-color 0.15s",position:"relative",gap:"10px",boxSizing:"border-box"},x=t.icon?o("span",{style:{flexShrink:"0",fontSize:"16px"},"aria-hidden":"true"},t.icon):null,g=n?null:o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.label),b=!n&&t.badge?o("span",{style:{backgroundColor:"#ef4444",color:"#ffffff",fontSize:"11px",fontWeight:"600",padding:"1px 6px",borderRadius:"10px",marginLeft:"4px",flexShrink:"0"}},t.badge):null,S=!n&&m?o("span",{style:{fontSize:"10px",transition:"transform 0.15s",transform:u?"rotate(90deg)":"rotate(0deg)",marginLeft:"4px"},"aria-hidden":"true"},"\u25B6"):null,I=n&&a?o("div",{style:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px",padding:"4px 10px",backgroundColor:"#1f2937",color:"#ffffff",fontSize:"12px",borderRadius:"4px",whiteSpace:"nowrap",zIndex:"1000",pointerEvents:"none"},role:"tooltip"},t.label):null,A=o("button",{type:"button",style:y,onClick:p,onMouseEnter:l,onMouseLeave:d,"aria-selected":c?"true":"false",title:n?t.label:void 0},x,g,b,S,I),C=!n&&m&&u?t.children.map(T=>o(_r,{key:T.id,item:T,collapsed:n,selectedId:r,onSelect:i,depth:s+1})):null;return o("div",{key:t.id,style:{position:"relative"}},A,C?o("div",{role:"group"},...C):null)}function Or(e){let{items:t,collapsed:n=!1,onToggleCollapse:r,selectedId:i,onSelect:s,width:a="240px",collapsedWidth:l="56px"}=e,d=n?typeof l=="number"?`${l}px`:l:typeof a=="number"?`${a}px`:a,u=r?o("button",{type:"button",onClick:r,"aria-label":n?"Expand sidebar":"Collapse sidebar",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",padding:"10px 0",border:"none",borderBottom:"1px solid #e5e7eb",backgroundColor:"transparent",cursor:"pointer",fontSize:"14px",color:"#6b7280",fontFamily:"inherit"}},n?"\u25B6":"\u25C0"):null,h=t.map(m=>o(_r,{key:m.id,item:m,collapsed:n,selectedId:i,onSelect:s,depth:0}));return o(_e,{orientation:"vertical",role:"navigation",ariaLabel:"Sidebar",keyboardNav:!0,styling:{width:d,border:"1px solid #e5e7eb",borderRadius:"0",padding:"0",backgroundColor:"#ffffff",custom:{height:"100%",transition:"width 0.2s",overflow:"hidden"}}},u,...h)}var Ve={completed:"#2563eb",completedBg:"#2563eb",completedText:"#ffffff",active:"#2563eb",activeBorder:"#2563eb",activeText:"#2563eb",pending:"#d1d5db",pendingText:"#9ca3af",line:"#d1d5db",lineCompleted:"#2563eb",labelActive:"#1f2937",labelPending:"#9ca3af",descriptionColor:"#6b7280"};function Hr(e){let{steps:t,currentStep:n,orientation:r="horizontal",onChange:i,clickable:s=!1,variant:a="circle"}=e,l=r==="horizontal",d=a==="circle"?32:12,u=a==="dot"?12:32,h=v(x=>{s&&i&&i(x)},[s,i]),m=x=>x<n?"completed":x===n?"active":"pending",c=(x,g,b)=>{let S=a==="dot"?u:d,I={width:`${S}px`,height:`${S}px`,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:a==="circle"?"14px":"0",fontWeight:"600",flexShrink:"0",transition:"background-color 0.2s, border-color 0.2s"};return b==="completed"?o("div",{style:{...I,backgroundColor:Ve.completedBg,color:Ve.completedText,border:`2px solid ${Ve.completed}`}},a==="circle"?g.icon||"\u2713":null):b==="active"?o("div",{style:{...I,backgroundColor:"#ffffff",color:Ve.activeText,border:`2px solid ${Ve.activeBorder}`,boxShadow:"0 0 0 3px rgba(37, 99, 235, 0.2)"}},a==="circle"?g.icon||String(x+1):o("div",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:Ve.active}})):o("div",{style:{...I,backgroundColor:"#ffffff",color:Ve.pendingText,border:`2px solid ${Ve.pending}`}},a==="circle"?g.icon||String(x+1):null)},p=x=>{if(x>=t.length-1)return null;let b=x<n?Ve.lineCompleted:Ve.line;return l?o("div",{style:{flex:"1",height:"2px",backgroundColor:b,margin:"0 8px",alignSelf:"center",transition:"background-color 0.2s"}}):o("div",{style:{width:"2px",flex:"1",minHeight:"24px",backgroundColor:b,marginLeft:`${(a==="dot"?u:d)/2-1}px`,transition:"background-color 0.2s"}})},f=(x,g)=>{let b=m(g),S=b==="active",I=b==="completed",A=c(g,x,b),C={fontSize:"13px",fontWeight:S?"600":"400",color:S||I?Ve.labelActive:Ve.labelPending,marginTop:l?"8px":"0",marginLeft:l?"0":"12px",textAlign:l?"center":"left",transition:"color 0.2s"},T={fontSize:"11px",color:Ve.descriptionColor,marginTop:"2px",textAlign:l?"center":"left"},L=o("div",{style:l?{display:"flex",flexDirection:"column",alignItems:"center"}:{display:"flex",flexDirection:"column"}},o("span",{style:C},x.label),x.description?o("span",{style:T},x.description):null),R=l?o("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"}},A,L):o("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"}},A,L);return o(s?"button":"div",{key:String(g),onClick:s?()=>h(g):void 0,style:{display:"flex",flexDirection:l?"column":"row",alignItems:l?"center":"flex-start",background:"none",border:"none",padding:"0",cursor:s?"pointer":"default",fontFamily:"inherit",outline:"none"},"aria-current":S?"step":void 0},R)},y=[];return t.forEach((x,g)=>{y.push(f(x,g));let b=p(g);b&&y.push(b)}),o("div",{role:"navigation","aria-label":"Progress steps",style:{display:"flex",flexDirection:l?"row":"column",alignItems:l?"flex-start":"stretch",width:"100%"}},...y)}var Yr={sm:{height:"28px",padding:"4px 8px",fontSize:"12px",iconSize:"14px"},md:{height:"36px",padding:"6px 12px",fontSize:"14px",iconSize:"16px"},lg:{height:"44px",padding:"8px 16px",fontSize:"16px",iconSize:"18px"}};function Pl(e){let{item:t,size:n,variant:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:a}=Fe(),l=Yr[n],d=t.disabled===!0,u=t.type==="toggle",[h,m]=U(!1),c=u?t.active===!0:h,p=v(()=>{!d&&t.onClick&&t.onClick()},[d,t]),f=v(()=>{!d&&!u&&m(!0)},[d,u]),y=v(()=>{u||m(!1)},[u]),x=v(()=>{a(),u||m(!1)},[u,a]),g={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"6px",height:l.height,padding:l.padding,fontSize:l.fontSize,fontFamily:"inherit",border:r==="raised"?"1px solid #d1d5db":"1px solid transparent",borderRadius:"4px",backgroundColor:c?"#e0e7ff":!d&&i?"#f3f4f6":r==="raised"?"#ffffff":"transparent",color:d?"#9ca3af":c?"#2563eb":"#374151",cursor:d?"default":"pointer",opacity:d?"0.5":"1",outline:"none",transition:"background-color 0.15s"},b=t.icon?o("span",{style:{fontSize:l.iconSize},"aria-hidden":"true"},t.icon):null,S=t.label?o("span",null,t.label):null,I=t.type==="dropdown"?o("span",{style:{fontSize:"10px",marginLeft:"2px"},"aria-hidden":"true"},"\u25BC"):null;return o("button",{type:"button",style:g,onClick:p,onMouseDown:f,onMouseUp:y,onMouseEnter:s,onMouseLeave:x,disabled:d||void 0,"aria-pressed":u?c:void 0,"aria-label":t.label||t.id,title:t.label||t.id},b,S,I)}function Vr(e){let{items:t,size:n="md",variant:r="flat"}=e,i=Yr[n],s=t.map(a=>a.type==="separator"?o("div",{key:a.id,role:"separator","aria-orientation":"vertical",style:{width:"1px",height:i.height,backgroundColor:"#d1d5db",margin:"0 4px",flexShrink:"0"}}):a.type==="spacer"?o("div",{key:a.id,style:{flex:"1"},"aria-hidden":"true"}):o(Pl,{key:a.id,item:a,size:n,variant:r}));return o(_e,{orientation:"horizontal",role:"toolbar",ariaLabel:"Toolbar",keyboardNav:!0,styling:{border:r==="raised"?"1px solid #e5e7eb":"none",borderRadius:r==="raised"?"8px":"0",padding:"4px",backgroundColor:r==="raised"?"#ffffff":"transparent",boxShadow:r==="raised"?"0 1px 3px rgba(0,0,0,0.1)":void 0,custom:{gap:"2px",alignItems:"center"}}},...s)}var xt=class e{constructor(t,n){et(this,"id");et(this,"label");et(this,"children");et(this,"expanded");et(this,"icon");et(this,"metadata");et(this,"parent");et(this,"depth");this.id=t.id,this.label=t.label,this.expanded=t.expanded??!1,this.icon=t.icon??null,this.metadata=t.metadata??{},this.parent=n??null,this.depth=n?n.depth+1:0,this.children=(t.children??[]).map(r=>new e(r,this))}static fromData(t){return new e(t)}isLeaf(){return this.children.length===0}isRoot(){return this.parent===null}walk(t){t(this,this.depth);for(let n of this.children)n.walk(t)}find(t){if(this.id===t)return this;for(let n of this.children){let r=n.find(t);if(r)return r}return null}toggle(){this.expanded=!this.expanded}expand(){this.expanded=!0}collapse(){this.expanded=!1}addChild(t){let n=new e(t,this);return this.children.push(n),n}removeChild(t){let n=this.children.findIndex(r=>r.id===t);return n===-1?!1:(this.children.splice(n,1),!0)}};function Ur(e){e.expanded=!0;for(let t of e.children)Ur(t)}function jr(e,t=[]){if(t.push(e),e.expanded)for(let n of e.children)jr(n,t);return t}function Tl(e){if(!e.parent)return!0;let t=e.parent.children;return t[t.length-1]===e}function $l(e){let{node:t,isSelected:n,indentPx:r,lineColor:i,lineWidth:s,iconExpanded:a,iconCollapsed:l,nodeStyle:d,renderNode:u,onToggle:h,onClick:m,focusedId:c}=e,p=Fe(),f=ne(null),y=c===t.id;re(()=>{y&&f.current&&f.current.focus()},[y]);let x=t.isLeaf(),g=t.depth,b=[];for(let T=0;T<g;T++){let L=t;for(let $=0;$<g-T;$++)L=L?L.parent:null;let R=L?!Tl(L):!1;b.push(o("span",{key:`connector-${T}`,"aria-hidden":"true",style:{display:"inline-block",width:`${r}px`,height:"100%",position:"relative",flexShrink:"0",...R?{borderLeft:`${s}px solid ${i}`}:{}}}))}let S=g>0?o("span",{"aria-hidden":"true",style:{display:"inline-block",width:`${Math.floor(r/2)}px`,height:"0",borderTop:`${s}px solid ${i}`,flexShrink:"0",alignSelf:"center",marginLeft:`-${r}px`}}):null,I=x?o("span",{"aria-hidden":"true",style:{display:"inline-block",width:"18px",flexShrink:"0",marginRight:"4px"}}):o("span",{"aria-hidden":"true",role:"button",tabIndex:0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"18px",height:"18px",fontSize:"14px",lineHeight:"1",cursor:"pointer",userSelect:"none",flexShrink:"0",marginRight:"4px",fontFamily:"monospace"},onClick:T=>{T.stopPropagation(),h(t)}},t.expanded?a:l),A=u?u(t,n):o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.icon?o("span",{style:{marginRight:"6px"}},t.icon):null,t.label),C=bt(d,{hover:p.hover,active:n});return o("div",{ref:f,role:"treeitem","aria-expanded":x?void 0:String(t.expanded),"aria-selected":n?"true":"false","aria-level":g+1,tabIndex:y?0:-1,style:{...C,display:"flex",alignItems:"stretch",padding:"0"},onMouseEnter:p.onMouseEnter,onMouseLeave:p.onMouseLeave,onClick:()=>m(t)},...b,S,o("span",{style:{display:"flex",alignItems:"center",flex:"1",padding:d.padding??"6px 10px",minWidth:"0"}},I,A))}function Gr(e){let{root:t,onNodeClick:n,onNodeExpand:r,onNodeCollapse:i,selectedId:s,expandAll:a=!1,lineColor:l="#000",lineWidth:d=1,indentPx:u=20,iconExpanded:h="\u2212",iconCollapsed:m="+",nodeStyle:c={},wrapperStyle:p,renderNode:f}=e,[y,x]=U(()=>{let R=xt.fromData(t);return a&&Ur(R),R}),[g,b]=U(t.id),S=X(()=>jr(y),[y]),I=v(()=>{x(R=>{let $=Object.create(Object.getPrototypeOf(R));return Object.assign($,R),$})},[]),A=v(R=>{R.toggle(),R.expanded?r?.(R):i?.(R),I()},[r,i,I]),C=v(R=>{b(R.id),n?.(R)},[n]),T=v(R=>{let $=R;if(!g)return;let B=S.findIndex(N=>N.id===g);if(B===-1)return;let E=S[B];switch($.key){case"ArrowDown":{$.preventDefault();let N=S[B+1];N&&b(N.id);break}case"ArrowUp":{$.preventDefault();let N=S[B-1];N&&b(N.id);break}case"ArrowRight":{$.preventDefault(),E.isLeaf()||(E.expanded?E.children.length>0&&b(E.children[0].id):A(E));break}case"ArrowLeft":{$.preventDefault(),!E.isLeaf()&&E.expanded?A(E):E.parent&&b(E.parent.id);break}case"Enter":{$.preventDefault(),C(E);break}case" ":{$.preventDefault(),E.isLeaf()||A(E);break}case"Home":{$.preventDefault(),S.length>0&&b(S[0].id);break}case"End":{$.preventDefault(),S.length>0&&b(S[S.length-1].id);break}}},[g,S,A,C]),L=S.map(R=>o($l,{key:R.id,node:R,isSelected:R.id===s,indentPx:u,lineColor:l,lineWidth:d,iconExpanded:h,iconCollapsed:m,nodeStyle:c,renderNode:f,onToggle:A,onClick:C,focusedId:g}));return o(_e,{role:"tree",ariaLabel:"Tree navigation",styling:p,keyboardNav:!1},o("div",{onKeyDown:T,style:{outline:"none"}},...L))}function Xr(e){let{items:t,position:n,onClose:r,depth:i}=e,[s,a]=U(-1),[l,d]=U(null),u=ne(null);re(()=>{if(!u.current)return;u.current.focus();let c=f=>{let y=f,x=t.map((g,b)=>({item:g,i:b})).filter(({item:g})=>!g.divider);if(y.key==="ArrowDown")y.preventDefault(),a(g=>{let S=(x.findIndex(({i:I})=>I===g)+1)%x.length;return x[S].i});else if(y.key==="ArrowUp")y.preventDefault(),a(g=>{let b=x.findIndex(({i:I})=>I===g),S=b<=0?x.length-1:b-1;return x[S].i});else if(y.key==="ArrowRight")s>=0&&t[s]?.children&&d(s);else if(y.key==="ArrowLeft")i>0&&r();else if(y.key==="Enter"){if(y.preventDefault(),s>=0){let g=t[s];g.children?d(s):!g.disabled&&g.onClick&&(g.onClick(),r())}}else y.key==="Escape"&&r()};u.current.addEventListener("keydown",c);let p=u.current;return()=>p.removeEventListener("keydown",c)},[t,s,i,r]);let h={position:"fixed",left:`${n.x}px`,top:`${n.y}px`,backgroundColor:"#fff",border:"1px solid #e5e7eb",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.15)",padding:"4px 0",minWidth:"180px",zIndex:`${10200+i}`,outline:"none",overflow:"visible"},m=t.map((c,p)=>{if(c.divider)return o("div",{key:`divider-${p}`,style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let f=s===p,y=!!c.disabled,x=!!(c.children&&c.children.length>0),g={display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",fontSize:"14px",color:y?"#9ca3af":"#1f2937",cursor:y?"default":"pointer",backgroundColor:f&&!y?"#f3f4f6":"transparent",userSelect:"none",position:"relative"},b=()=>{a(p),d(x?p:null)},S=()=>{if(!y){if(x){d(p);return}c.onClick&&c.onClick(),r()}},I=[];c.icon&&I.push(o("span",{style:{width:"20px",textAlign:"center",flexShrink:"0"}},c.icon)),I.push(o("span",{style:{flex:"1"}},c.label??"")),x&&I.push(o("span",{style:{fontSize:"10px",color:"#9ca3af",marginLeft:"8px"}},"\u25B6"));let A=[o("div",{key:`item-${p}`,style:g,onMouseEnter:b,onClick:S,role:"menuitem","aria-disabled":y?"true":void 0},...I)];return x&&l===p&&A.push(o(Xr,{key:`submenu-${p}`,items:c.children,position:{x:n.x+178,y:n.y+p*36},onClose:()=>d(null),depth:i+1})),o("div",{key:`wrap-${p}`,style:{position:"relative"}},...A)});return o("div",{ref:u,style:h,tabIndex:-1,role:"menu"},...m)}function Kt(e){let{items:t,children:n}=e,[r,i]=U(null),s=v(u=>{u.preventDefault();let h=u;i({x:h.clientX,y:h.clientY})},[]),a=v(()=>{i(null)},[]);re(()=>{if(!r)return;let u=m=>{a()},h=setTimeout(()=>{document.addEventListener("mousedown",u)},0);return()=>{clearTimeout(h),document.removeEventListener("mousedown",u)}},[r,a]),re(()=>{if(!r)return;let u=h=>{h.key==="Escape"&&a()};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[r,a]);let d=[o("div",{onContextMenu:s,style:{display:"contents"}},n)];return r&&d.push(o(Xr,{items:t,position:r,onClose:a,depth:0})),o("div",null,...d)}function Dl(e,t){if(t)return"translate3d(0, 0, 0)";switch(e){case"left":return"translate3d(-100%, 0, 0)";case"right":return"translate3d(100%, 0, 0)";case"top":return"translate3d(0, -100%, 0)";case"bottom":return"translate3d(0, 100%, 0)"}}function zl(e,t){let n={position:"fixed",zIndex:"10001",backgroundColor:"#fff",boxShadow:"0 0 24px rgba(0, 0, 0, 0.15)",display:"flex",flexDirection:"column",overflow:"hidden"};switch(e){case"left":return{...n,top:"0",left:"0",bottom:"0",width:t};case"right":return{...n,top:"0",right:"0",bottom:"0",width:t};case"top":return{...n,top:"0",left:"0",right:"0",height:t};case"bottom":return{...n,bottom:"0",left:"0",right:"0",height:t}}}function Kr(e){let{open:t,onClose:n,position:r="right",size:i="320px",title:s,overlay:a=!0,closeOnOverlay:l=!0,closeOnEscape:d=!0,children:u}=e,[h,m]=U(!1),[c,p]=U(!1),f=ne(null),y=s?"drawer-title":void 0;if(re(()=>{if(t)m(!0),requestAnimationFrame(()=>p(!0));else{p(!1);let R=setTimeout(()=>m(!1),300);return()=>clearTimeout(R)}},[t]),re(()=>{if(!t||!d)return;let R=$=>{$.key==="Escape"&&n()};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[t,d,n]),re(()=>{if(!t)return;let R=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=R}},[t]),re(()=>{t&&f.current&&f.current.focus()},[t]),!h)return null;let x={position:"fixed",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:"10000",opacity:c?"1":"0",transition:"opacity 0.3s ease"},g={...zl(r,i),transform:Dl(r,c),transition:"transform 0.3s ease"},b={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"},S={margin:"0",fontSize:"16px",fontWeight:"600",color:"#111827"},I={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",lineHeight:"1"},A={padding:"20px",overflow:"auto",flex:"1"},C=()=>{l&&n()},T=[];s&&T.push(o("div",{style:b},o("h3",{id:y,style:S},s),o("button",{type:"button",style:I,onClick:n,"aria-label":"Close drawer"},"\xD7"))),T.push(o("div",{style:A},u));let L=[];return a&&L.push(o("div",{style:x,onClick:C})),L.push(o("div",{ref:f,style:g,role:"dialog","aria-modal":"true","aria-labelledby":y,tabIndex:-1},...T)),o("div",null,...L)}var Al={sm:"400px",md:"600px",lg:"800px",full:"100vw"};function qr(e){let{open:t,onClose:n,title:r,size:i="md",closeOnOverlay:s=!0,closeOnEscape:a=!0,footer:l,showCloseButton:d=!0,children:u}=e,h=ne(null);if(re(()=>{if(!t)return;let C=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=C}},[t]),re(()=>{if(!t||!a)return;let C=T=>{T.key==="Escape"&&n()};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[t,a,n]),re(()=>{t&&h.current&&h.current.focus()},[t]),!t)return null;let m={position:"fixed",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"10000"},c={backgroundColor:"#fff",borderRadius:i==="full"?"0":"8px",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.3)",maxHeight:i==="full"?"100vh":"90vh",width:Al[i],maxWidth:i==="full"?"100vw":"90vw",display:"flex",flexDirection:"column",outline:"none",overflow:"hidden"},p={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 24px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"},f={margin:"0",fontSize:"18px",fontWeight:"600",color:"#111827"},y={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",borderRadius:"4px",lineHeight:"1"},x={padding:"24px",overflow:"auto",flex:"1"},g={padding:"16px 24px",borderTop:"1px solid #e5e7eb",flexShrink:"0"},b=C=>{s&&C.target===C.currentTarget&&n()},S=[],I=r?"modal-title":void 0;r?S.push(o("h2",{id:I,style:f},r)):S.push(o("span",null)),d&&S.push(o("button",{type:"button",style:y,onClick:n,"aria-label":"Close modal"},"\xD7"));let A=[o("div",{style:p},...S),o("div",{style:x},u)];return l&&A.push(o("div",{style:g},l)),o("div",{style:m,onClick:b,"aria-modal":"true",role:"dialog","aria-labelledby":I},o("div",{ref:h,style:c,tabIndex:-1,role:"document"},...A))}var Zr=8;function Ll(e,t){let n=t+Zr;switch(e){case"top":return{position:"absolute",bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:`${n}px`};case"bottom":return{position:"absolute",top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:`${n}px`};case"left":return{position:"absolute",right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:`${n}px`};case"right":return{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:`${n}px`}}}function Bl(e){let t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n=`${Zr}px`,r="transparent";switch(e){case"top":return{...t,bottom:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`${n} ${n} 0 ${n}`,borderColor:`#fff ${r} ${r} ${r}`};case"bottom":return{...t,top:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`0 ${n} ${n} ${n}`,borderColor:`${r} ${r} #fff ${r}`};case"left":return{...t,right:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} 0 ${n} ${n}`,borderColor:`${r} ${r} ${r} #fff`};case"right":return{...t,left:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} ${n} ${n} 0`,borderColor:`${r} #fff ${r} ${r}`}}}function Jr(e){let{trigger:t,content:n,open:r,placement:i="bottom",offset:s=4,arrow:a=!1,closeOnClickOutside:l=!0,onOpenChange:d}=e,u=r!==void 0,[h,m]=U(!1),c=u?r:h,p=ne(null),f=v(()=>{u?d&&d(!r):m(I=>!I)},[u,r,d]);re(()=>{if(!c||!l)return;let I=A=>{p.current&&!p.current.contains(A.target)&&(u?d&&d(!1):m(!1))};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[c,l,u,d]);let y={position:"relative",display:"inline-block"},x={...Ll(i,s),backgroundColor:"#fff",borderRadius:"8px",boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",border:"1px solid #e5e7eb",padding:"12px 16px",zIndex:"10000",whiteSpace:"nowrap"},g=[n];a&&g.push(o("div",{style:Bl(i)}));let b=v(I=>{let A=I.key;(A==="Enter"||A===" ")&&(I.preventDefault(),f())},[f]),S=[o("div",{onClick:f,onKeyDown:b,role:"button",tabIndex:0,style:{display:"inline-block"}},t)];return c&&S.push(o("div",{style:x},...g)),o("div",{ref:p,style:y},...S)}var Fl=0;function Nl(){return`toast-${++Fl}-${Date.now()}`}function On(e={}){let t={position:e.position??"top-right",maxToasts:e.maxToasts??5,defaultDuration:e.defaultDuration??4e3},n=[],r=new Set;function i(){r.forEach(d=>d())}function s(d,u={}){let h=Nl();return n=[{id:h,message:d,type:u.type??"info",duration:u.duration??t.defaultDuration,action:u.action,createdAt:Date.now()},...n].slice(0,t.maxToasts),i(),h}function a(d){n=n.filter(u=>u.id!==d),i()}function l(){n=[],i()}return{toast:s,dismiss:a,dismissAll:l,subscribe:d=>(r.add(d),()=>{r.delete(d)}),getToasts:()=>n,config:t}}var Wl={info:{bg:"#eff6ff",border:"#3b82f6",icon:"\u2139\uFE0F"},success:{bg:"#f0fdf4",border:"#22c55e",icon:"\u2705"},warning:{bg:"#fffbeb",border:"#f59e0b",icon:"\u26A0\uFE0F"},error:{bg:"#fef2f2",border:"#ef4444",icon:"\u274C"}};function _l(e){let t={position:"fixed",zIndex:"10100",display:"flex",flexDirection:"column",gap:"8px",padding:"16px",pointerEvents:"none"},n=e.startsWith("top"),r=e.startsWith("bottom"),i=e.endsWith("left"),s=e.endsWith("right"),a=e.endsWith("center");return n&&(t.top="0"),r&&(t.bottom="0",t.flexDirection="column-reverse"),i&&(t.left="0"),s&&(t.right="0"),a&&(t.left="50%",t.transform="translateX(-50%)"),t}function Ol(e){let{item:t,onDismiss:n}=e,r=Wl[t.type];re(()=>{if(t.duration<=0)return;let u=setTimeout(()=>n(t.id),t.duration);return()=>clearTimeout(u)},[t.id,t.duration,n]);let i={backgroundColor:r.bg,borderLeft:`4px solid ${r.border}`,borderRadius:"6px",padding:"12px 16px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.1)",display:"flex",alignItems:"center",gap:"10px",pointerEvents:"auto",minWidth:"280px",maxWidth:"420px",animation:"specifyjs-toast-slide-in 0.3s ease forwards"},s={flex:"1",fontSize:"14px",color:"#1f2937",lineHeight:"1.4"},a={background:"none",border:"none",cursor:"pointer",fontSize:"16px",color:"#9ca3af",padding:"2px 6px",lineHeight:"1",flexShrink:"0"},l={background:"none",border:`1px solid ${r.border}`,borderRadius:"4px",cursor:"pointer",fontSize:"12px",fontWeight:"600",color:r.border,padding:"4px 10px",flexShrink:"0"},d=[o("span",null,r.icon),o("span",{style:s},t.message)];return t.action&&d.push(o("button",{type:"button",style:l,onClick:t.action.onClick},t.action.label)),d.push(o("button",{type:"button",style:a,onClick:()=>n(t.id),"aria-label":"Dismiss toast"},"\xD7")),o("div",{style:i,role:"alert"},...d)}function Hn(e){let{toaster:t}=e,[,n]=U(0);re(()=>t.subscribe(()=>n(l=>l+1)),[t]);let r=t.getToasts();if(r.length===0)return null;let i=_l(t.config.position);re(()=>{let l="specifyjs-toast-keyframes";if(document.getElementById(l))return;let d=document.createElement("style");return d.id=l,d.textContent=`
|
|
3
3
|
@keyframes specifyjs-toast-slide-in {
|
|
4
4
|
from { opacity: 0; transform: translateY(-12px); }
|
|
5
5
|
to { opacity: 1; transform: translateY(0); }
|
|
6
6
|
}
|
|
7
|
-
`,document.head.appendChild(d),()=>{let u=document.getElementById(l);u&&u.remove()}},[]);let s=S(l=>t.dismiss(l),[t]),a=r.map(l=>o(kl,{key:l.id,item:l,onDismiss:s}));return o("div",{style:i},...a)}function $r(e={}){let t=ne(null);t.current||(t.current=yn(e));let n=t.current,r=S(()=>o(Sn,{toaster:n}),[n]);return{toast:n.toast,dismiss:n.dismiss,dismissAll:n.dismissAll,ToastContainer:r}}var Cl=6,Ml=8;function El(e,t){let n=window.scrollX||window.pageXOffset,r=window.scrollY||window.pageYOffset,i=Ml;switch(t){case"top":return{position:"fixed",left:`${e.left+e.width/2}px`,top:`${e.top-i}px`,transform:"translate(-50%, -100%)"};case"bottom":return{position:"fixed",left:`${e.left+e.width/2}px`,top:`${e.bottom+i}px`,transform:"translateX(-50%)"};case"left":return{position:"fixed",left:`${e.left-i}px`,top:`${e.top+e.height/2}px`,transform:"translate(-100%, -50%)"};case"right":return{position:"fixed",left:`${e.right+i}px`,top:`${e.top+e.height/2}px`,transform:"translateY(-50%)"}}}function Il(e){let t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n=`${Cl}px`,r="transparent",i="#1f2937";switch(e){case"top":return{...t,bottom:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`${n} ${n} 0 ${n}`,borderColor:`${i} ${r} ${r} ${r}`};case"bottom":return{...t,top:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`0 ${n} ${n} ${n}`,borderColor:`${r} ${r} ${i} ${r}`};case"left":return{...t,right:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} 0 ${n} ${n}`,borderColor:`${r} ${r} ${r} ${i}`};case"right":return{...t,left:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} ${n} ${n} 0`,borderColor:`${r} ${i} ${r} ${r}`}}}function Tr(e){let{text:t,placement:n="top",delay:r=200,maxWidth:i="250px",children:s}=e,[a,l]=j(!1),[d,u]=j(null),h=ne(null),g=ne(null),c=`tooltip-${Math.random().toString(36).slice(2,9)}`,p=S(()=>{g.current=setTimeout(()=>{if(h.current){let x=h.current.getBoundingClientRect();u(El(x,n))}l(!0)},r)},[r,n]),f=S(()=>{g.current&&(clearTimeout(g.current),g.current=null),l(!1)},[]);re(()=>()=>{g.current&&clearTimeout(g.current)},[]);let y={display:"inline-block"},b={...d??{},backgroundColor:"#1f2937",color:"#fff",fontSize:"13px",lineHeight:"1.4",padding:"6px 10px",borderRadius:"6px",maxWidth:i,zIndex:"10002",pointerEvents:"none",whiteSpace:"normal",wordWrap:"break-word"},m=[o("div",{ref:h,style:y,onMouseEnter:p,onMouseLeave:f,onFocus:p,onBlur:f,"aria-describedby":a?c:void 0},s)];return a&&d&&m.push(o("div",{id:c,style:b,role:"tooltip"},t,o("div",{style:Il(n)}))),o("div",{style:{display:"inline-block",position:"relative"}},...m)}function vn(e,t,n,r,i){return q(()=>{let s=Math.max(1,(r-i*(e+1))/e);return{valueScale:d=>t===0?0:d/t*n,categoryScale:d=>i+d*(s+i),barThickness:s,maxValue:t,valueAxisLength:n,categoryAxisLength:r}},[e,t,n,r,i])}function Rl(e,t,n){if(t&&t.length>0){if(n){let s=0;for(let a of t)for(let l of a.values)l.value>s&&(s=l.value);return s}let i=0;for(let s of t){let a=0;for(let l of s.values)a+=l.value;a>i&&(i=a)}return i}let r=0;for(let i of e)i.value>r&&(r=i.value);return r}function Pl(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function $l(e){let t=new Set;for(let n of e)for(let r of n.values)t.add(r.category);return Array.from(t)}var Dr=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function zr(e,t){return t||Dr[e%Dr.length]}function Ar(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",barColor:s="#3b82f6",barGap:a=8,barRadius:l=4,showValues:d=!0,showGrid:u=!0,gridColor:h="#e5e7eb",title:g,padding:c=50,animate:p=!1,stacked:f,grouped:y=!1}=e,b=i==="vertical",m=n-c*2,x=r-c*2,v=b?x:m,D=b?m:x,A=f!==void 0&&f.length>0,M=q(()=>A?$l(f):[],[A,f]),T=A?f.length:t.length,L=q(()=>Rl(t,f,y),[t,f,y]),I=L>0?L:1,P=vn(T,I,v,D,a),B=S(()=>{if(!u)return[];let O=Pl(I),V=[];for(let X=O;X<=I;X+=O){let ee=P.valueScale(X);if(b){let Z=c+x-ee;V.push(o("line",{key:`grid-${X}`,x1:String(c),y1:String(Z),x2:String(c+m),y2:String(Z),stroke:h,"stroke-width":"1","stroke-dasharray":"4 2"})),V.push(o("text",{key:`grid-label-${X}`,x:String(c-6),y:String(Z+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(X)))}else{let Z=c+ee;V.push(o("line",{key:`grid-${X}`,x1:String(Z),y1:String(c),x2:String(Z),y2:String(c+x),stroke:h,"stroke-width":"1","stroke-dasharray":"4 2"})),V.push(o("text",{key:`grid-label-${X}`,x:String(Z),y:String(c+x+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(X)))}}return V},[u,I,P,b,c,m,x,h]),E=S(()=>{let O=[];return b?(O.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"})),O.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+x),x2:String(c+m),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"}))):(O.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+x),x2:String(c+m),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"})),O.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"}))),O},[b,c,m,x]),N=S(()=>{let O=[];for(let V=0;V<t.length;V++){let X=t[V],ee=P.valueScale(X.value),Z=P.categoryScale(V),U=X.color??s,G,Y,H=String(X.value);if(b){let K=c+Z,Q=c+x-ee;G={x:String(K),y:String(Q),width:String(P.barThickness),height:String(ee),rx:String(l),ry:String(l),fill:U},Y={x:String(K+P.barThickness/2),y:String(Q-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"}}else{let K=c+Z,Q=c;G={x:String(Q),y:String(K),width:String(ee),height:String(P.barThickness),rx:String(l),ry:String(l),fill:U},Y={x:String(Q+ee+6),y:String(K+P.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"}}if(p&&(G.style=b?`animation: barGrow 0.6s ease-out ${V*.05}s both`:`animation: barGrow 0.6s ease-out ${V*.05}s both`),O.push(o("rect",{key:`bar-${V}`,...G})),d&&O.push(o("text",{key:`val-${V}`,...Y},H)),b){let K=c+Z+P.barThickness/2,Q=c+x+16;O.push(o("text",{key:`cat-${V}`,x:String(K),y:String(Q),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${K}, ${Q})`},X.label))}else O.push(o("text",{key:`cat-${V}`,x:String(c-6),y:String(c+Z+P.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},X.label))}return O},[t,P,s,l,d,p,b,c,x]),z=S(()=>{if(!f)return[];let O=[];for(let V=0;V<f.length;V++){let X=f[V],ee=P.categoryScale(V),Z=0;for(let U=0;U<X.values.length;U++){let G=X.values[U],Y=P.valueScale(G.value),H=P.valueScale(Z),K=zr(U,G.color);if(b){let Q=c+ee,ie=c+x-H-Y;O.push(o("rect",{key:`sbar-${V}-${U}`,x:String(Q),y:String(ie),width:String(P.barThickness),height:String(Y),rx:U===X.values.length-1?String(l):"0",ry:U===X.values.length-1?String(l):"0",fill:K,...p?{style:`animation: barGrow 0.6s ease-out ${(V*X.values.length+U)*.03}s both`}:{}})),d&&Y>14&&O.push(o("text",{key:`sval-${V}-${U}`,x:String(Q+P.barThickness/2),y:String(ie+Y/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(G.value)))}else{let Q=c+H,ie=c+ee;O.push(o("rect",{key:`sbar-${V}-${U}`,x:String(Q),y:String(ie),width:String(Y),height:String(P.barThickness),rx:U===X.values.length-1?String(l):"0",ry:U===X.values.length-1?String(l):"0",fill:K,...p?{style:`animation: barGrow 0.6s ease-out ${(V*X.values.length+U)*.03}s both`}:{}})),d&&Y>20&&O.push(o("text",{key:`sval-${V}-${U}`,x:String(Q+Y/2),y:String(ie+P.barThickness/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(G.value)))}Z+=G.value}if(d){let U=P.valueScale(Z);b?O.push(o("text",{key:`stotal-${V}`,x:String(c+ee+P.barThickness/2),y:String(c+x-U-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(Z))):O.push(o("text",{key:`stotal-${V}`,x:String(c+U+6),y:String(c+ee+P.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(Z)))}if(b){let U=c+ee+P.barThickness/2,G=c+x+16;O.push(o("text",{key:`scat-${V}`,x:String(U),y:String(G),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${U}, ${G})`},X.label))}else O.push(o("text",{key:`scat-${V}`,x:String(c-6),y:String(c+ee+P.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},X.label))}return O},[f,P,l,d,p,b,c,x]),k=S(()=>{if(!f)return[];let O=M.length,V=[];for(let X=0;X<f.length;X++){let ee=f[X],Z=P.categoryScale(X),U=2,G=Math.max(1,(P.barThickness-U*(O-1))/O);for(let Y=0;Y<ee.values.length;Y++){let H=ee.values[Y],K=M.indexOf(H.category),Q=K*(G+U),ie=P.valueScale(H.value),J=zr(K>=0?K:Y,H.color);if(b){let se=c+Z+Q,le=c+x-ie;V.push(o("rect",{key:`gbar-${X}-${Y}`,x:String(se),y:String(le),width:String(G),height:String(ie),rx:String(l),ry:String(l),fill:J,...p?{style:`animation: barGrow 0.6s ease-out ${(X*O+Y)*.04}s both`}:{}})),d&&V.push(o("text",{key:`gval-${X}-${Y}`,x:String(se+G/2),y:String(le-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(H.value)))}else{let se=c,le=c+Z+Q;V.push(o("rect",{key:`gbar-${X}-${Y}`,x:String(se),y:String(le),width:String(ie),height:String(G),rx:String(l),ry:String(l),fill:J,...p?{style:`animation: barGrow 0.6s ease-out ${(X*O+Y)*.04}s both`}:{}})),d&&V.push(o("text",{key:`gval-${X}-${Y}`,x:String(se+ie+4),y:String(le+G/2+3),"text-anchor":"start","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(H.value)))}}if(b){let Y=c+Z+P.barThickness/2,H=c+x+16;V.push(o("text",{key:`gcat-${X}`,x:String(Y),y:String(H),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${Y}, ${H})`},ee.label))}else V.push(o("text",{key:`gcat-${X}`,x:String(c-6),y:String(c+Z+P.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},ee.label))}return V},[f,M,P,l,d,p,b,c,x]),w=S(()=>g?[o("text",{key:"title",x:String(n/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},g)]:[],[g,n,c]),$=S(()=>p?[o("defs",{key:"anim-defs"},o("style",{key:"anim-style"},b?"@keyframes barGrow { from { transform: scaleY(0); transform-origin: bottom; } to { transform: scaleY(1); transform-origin: bottom; } }":"@keyframes barGrow { from { transform: scaleX(0); transform-origin: left; } to { transform: scaleX(1); transform-origin: left; } }"))]:[],[p,b]),C=B(),F=E(),R=w(),W=$(),_;return A&&y?_=k():A?_=z():_=N(),o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",style:{fontFamily:"sans-serif"}},...W,...R,...C,...F,..._)}function yt(e){let{start:t,end:n,step:r}=e;if(r<=0||!isFinite(r))return[];let i=Math.ceil((n-t)/r)+1;if(i>1e6)return[];let s=[];for(let a=0;a<i;a++){let l=t+a*r;if(l>n+r*.001)break;s.push(l)}return s}function jt(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],s=e(i);isFinite(s)&&n.push({input:i,output:s})}return n}function Gt(e,t,n,r){let i=!1,s=0,a=[],l=()=>{if(i)return;let d=Math.min(s+n,t.length);for(let u=s;u<d;u++){let h=t[u],g=e(h);isFinite(g)&&a.push({input:h,output:g})}if(s=d,s>=t.length){r(a,!0);return}r(a,!1),Lr(l)};return Lr(l),()=>{i=!0}}function Lr(e){typeof requestIdleCallback=="function"?requestIdleCallback(()=>e(),{timeout:16}):setTimeout(e,0)}function Tl(e,t){let n=e/t,r=Math.pow(10,Math.floor(Math.log10(n))),i=n/r;return(i<1.5?1:i<3?2:i<7?5:10)*r}function Br(e,t){let n=t-e;if(n<=0)return[e];let r=Tl(n,8),i=Math.ceil(e/r)*r,s=[];for(let a=i;a<=t+r*.001;a+=r)s.push(Math.round(a*1e10)/1e10);return s}function Fr(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}var $e=40,Nr=1.1,Wr=.01,_r=1e6;function Or(e){let{width:t=400,height:n=300,points:r=[],plotFunction:i,plotResolution:s=200,xStep:a,sync:l=!1,xRange:d=[-5,5],yRange:u=[-5,5],showGrid:h=!0,showAxes:g=!0,pointRadius:c=3,pointColor:p="#3b82f6",curveColor:f="#3b82f6",gridColor:y="#e2e8f0",axisColor:b="#94a3b8",onPointClick:m,onPointDoubleClick:x,onPointContextMenu:v,onPointHover:D}=e,[A,M]=j(d[0]),[T,L]=j(d[1]),[I,P]=j(u[0]),[B,E]=j(u[1]),N=ne(!1),z=ne(null),k=S(H=>$e+(H-A)/(T-A)*(t-2*$e),[A,T,t]),w=S(H=>n-$e-(H-I)/(B-I)*(n-2*$e),[I,B,n]),$=S(H=>A+(H-$e)/(t-2*$e)*(T-A),[A,T,t]),C=S(H=>I+(n-$e-H)/(n-2*$e)*(B-I),[I,B,n]),F=S(H=>{let K=H;N.current=!0,z.current={mx:K.clientX,my:K.clientY,x0:A,x1:T,y0:I,y1:B}},[A,T,I,B]),R=S(H=>{if(!N.current||!z.current)return;let K=H,Q=z.current,ie=K.clientX-Q.mx,J=K.clientY-Q.my,se=ie/(t-2*$e)*(Q.x1-Q.x0),le=J/(n-2*$e)*(Q.y1-Q.y0);M(Q.x0-se),L(Q.x1-se),P(Q.y0+le),E(Q.y1+le)},[t,n]),W=S(()=>{N.current=!1,z.current=null},[]),_=S(H=>{let K=H;K.preventDefault();let Q=K.currentTarget.getBoundingClientRect(),ie=K.clientX-Q.left,J=K.clientY-Q.top,se=$(ie),le=C(J),fe=K.deltaY>0?Nr:1/Nr,oe=(T-A)*fe,me=(B-I)*fe;if(oe<Wr||me<Wr||oe>_r||me>_r)return;let he=(se-A)/(T-A),te=(le-I)/(B-I);M(se-he*oe),L(se+(1-he)*oe),P(le-te*me),E(le+(1-te)*me)},[A,T,I,B,$,C]),O=[];if(O.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),h){let H=Br(A,T),K=Br(I,B);for(let Q=0;Q<H.length;Q++){let ie=k(H[Q]);O.push(o("line",{x1:ie,y1:$e,x2:ie,y2:n-$e,stroke:y,"stroke-width":.5,key:`gx-${Q}`})),O.push(o("text",{x:ie,y:n-$e+14,"text-anchor":"end","font-size":10,fill:b,transform:`rotate(-45, ${ie}, ${n-$e+14})`,key:`lx-${Q}`},Fr(H[Q])))}for(let Q=0;Q<K.length;Q++){let ie=w(K[Q]);O.push(o("line",{x1:$e,y1:ie,x2:t-$e,y2:ie,stroke:y,"stroke-width":.5,key:`gy-${Q}`})),O.push(o("text",{x:$e-6,y:ie+3,"text-anchor":"end","font-size":10,fill:b,key:`ly-${Q}`},Fr(K[Q])))}}if(g){let H=Math.max($e,Math.min(t-$e,k(0))),K=Math.max($e,Math.min(n-$e,w(0)));O.push(o("line",{x1:$e,y1:K,x2:t-$e,y2:K,stroke:b,"stroke-width":1,key:"x-axis"})),O.push(o("line",{x1:H,y1:$e,x2:H,y2:n-$e,stroke:b,"stroke-width":1,key:"y-axis"}))}let V=q(()=>{if(!i||!l)return[];let H=a??(T-A)/s,K=yt({start:A,end:T,step:H});return jt(i,K)},[i,A,T,a,s,l]),[X,ee]=j([]),Z=ne(null);re(()=>{if(!i||l){ee([]);return}let H=a??(T-A)/s,K=yt({start:A,end:T,step:H});return Z.current&&Z.current(),Z.current=Gt(i,K,200,Q=>{ee([...Q])}),()=>{Z.current&&Z.current()}},[i,A,T,a,s,l]);let U=l?V:X;if(U.length>0){let H=[];for(let K=0;K<U.length;K++){let Q=U[K],ie=k(Q.input),J=w(Q.output);H.push(`${H.length===0?"M":"L"}${ie},${J}`)}O.push(o("path",{d:H.join(" "),fill:"none",stroke:f,"stroke-width":1.5,key:"curve"}))}let G=(H,K,Q,ie)=>{if(K)return J=>K({x:ie.x,y:ie.y,index:Q,event:J})};for(let H=0;H<r.length;H++){let K=r[H],Q=k(K.x),ie=w(K.y),J={cx:Q,cy:ie,r:c,fill:p,cursor:"pointer",key:`pt-${H}`};m&&(J.onClick=G("click",m,H,K)),x&&(J.onDblClick=G("dblclick",x,H,K)),v&&(J.onContextMenu=G("contextmenu",v,H,K)),D&&(J.onMouseOver=G("mouseover",D,H,K)),O.push(o("circle",J))}let Y=o("defs",{key:"defs"},o("clipPath",{id:"plot-clip"},o("rect",{x:$e,y:$e,width:t-2*$e,height:n-2*$e})));return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",style:"user-select: none; touch-action: none;",onMouseDown:F,onMouseMove:R,onMouseUp:W,onMouseLeave:W,onWheel:_},Y,...O)}function Yr(e,t,n){let r=0,i=0;for(let s=0;s<n;s++){let a=r*r,l=i*i;if(a+l>4)return s;i=2*r*i+t,r=a-l+e}return n}function Hr(e,t,n){if(e===t)return[0,0,0];let r=e/t;if(n==="fire")return[Math.floor(255*Math.min(1,r*3)),Math.floor(255*Math.max(0,r*3-1)),Math.floor(255*Math.max(0,r*3-2))];if(n==="ocean")return[Math.floor(255*r*.3),Math.floor(255*r*.6),Math.floor(255*(.4+r*.6))];let i=r*360%360,s=1,a=.5,l=(1-Math.abs(2*a-1))*s,d=l*(1-Math.abs(i/60%2-1)),u=a-l/2,h=0,g=0,c=0;return i<60?(h=l,g=d):i<120?(h=d,g=l):i<180?(g=l,c=d):i<240?(g=d,c=l):i<300?(h=d,c=l):(h=l,c=d),[Math.floor((h+u)*255),Math.floor((g+u)*255),Math.floor((c+u)*255)]}function Vr(e,t,n=[-2.5,1],r=[-1.25,1.25],i=80,s=Yr){let a=[];for(let l=0;l<t;l++){let d=[],u=r[1]-l/t*(r[1]-r[0]);for(let h=0;h<e;h++){let g=n[0]+h/e*(n[1]-n[0]);d.push(s(g,u,i))}a.push(d)}return a}function Ur(e){let{width:t=400,height:n=300,realRange:r=[-2.5,1],imagRange:i=[-1.25,1.25],maxIterations:s=100,colorScheme:a="classic",computeFunction:l=Yr,data:d,resolution:u=2,onPointClick:h,onPointHover:g,onPointDoubleClick:c,onPointContextMenu:p}=e;if(d){let C=d.length,F=C>0?d[0].length:0,R=F>0?t/F:1,W=C>0?n/C:1,_=[];for(let O=0;O<C;O++){let V=d[O];for(let X=0;X<F;X++){let ee=V[X]??0,[Z,U,G]=Hr(ee,s,a);_.push(o("rect",{key:`${O}-${X}`,x:String(X*R),y:String(O*W),width:String(Math.ceil(R)),height:String(Math.ceil(W)),fill:`rgb(${Z},${U},${G})`}))}}return o("svg",{width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Complex plane visualization",style:{cursor:"crosshair",borderRadius:"6px",maxWidth:"100%"}},..._)}let[f,y]=j(r[0]),[b,m]=j(r[1]),[x,v]=j(i[0]),[D,A]=j(i[1]),M=ne(null),T=ne(!1),L=ne(null),I=S((C,F)=>{let R=f+C/t*(b-f),W=D-F/n*(D-x);return{re:R,im:W}},[f,b,x,D,t,n]);re(()=>{let C=M.current;if(!C)return;let F=C.getContext("2d");if(!F)return;let R=F.createImageData(t,n),W=R.data;for(let _=0;_<n;_++)for(let O=0;O<t;O++){let{re:V,im:X}=I(O,_),ee=l(V,X,s),[Z,U,G]=Hr(ee,s,a),Y=(_*t+O)*4;W[Y]=Z,W[Y+1]=U,W[Y+2]=G,W[Y+3]=255}F.putImageData(R,0,0)},[f,b,x,D,t,n,s,a,l,I]);let P=S(C=>{let F=C.target.getBoundingClientRect(),R=C.clientX-F.left,W=C.clientY-F.top,{re:_,im:O}=I(R,W),V=l(_,O,s);return{re:_,im:O,iterations:V,event:C}},[I,l,s]),B=S(C=>{T.current=!0,L.current={x:C.clientX,y:C.clientY,rMin:f,rMax:b,iMin:x,iMax:D}},[f,b,x,D]),E=S(C=>{if(g&&g(P(C)),!T.current||!L.current)return;let F=L.current,R=C.clientX-F.x,W=C.clientY-F.y,_=(F.rMax-F.rMin)/t,O=(F.iMax-F.iMin)/n;y(F.rMin-R*_),m(F.rMax-R*_),v(F.iMin+W*O),A(F.iMax+W*O)},[t,n,g,P]),N=S(()=>{T.current=!1},[]),z=S(C=>{C.preventDefault();let F=C.deltaY>0?1.15:1/1.15,R=C.target.getBoundingClientRect(),W=C.clientX-R.left,_=C.clientY-R.top,{re:O,im:V}=I(W,_);y(O+(f-O)*F),m(O+(b-O)*F),v(V+(x-V)*F),A(V+(D-V)*F)},[I,f,b,x,D]),k=S(C=>{h&&h(P(C))},[h,P]),w=S(C=>{c&&c(P(C))},[c,P]),$=S(C=>{C.preventDefault(),p&&p(P(C))},[p,P]);return o("canvas",{ref:M,width:t,height:n,style:{cursor:"crosshair"},onMouseDown:B,onMouseMove:E,onMouseUp:N,onMouseLeave:N,onWheel:z,onClick:k,onDblClick:w,onContextMenu:$})}function jr(e,t,n){if(e===t)return[e];let r=(t-e)/(n-1),i=[];for(let s=0;s<n;s++){let a=e+r*s;i.push(Math.round(a*1e10)/1e10)}return i}function Dl(e,t,n,r){if(e.length===0)return{xScale:()=>r,yScale:()=>n-r,xTicks:[],yTicks:[],xMin:0,xMax:0,yMin:0,yMax:0};let i=1/0,s=-1/0,a=1/0,l=-1/0;for(let y of e)y.x<i&&(i=y.x),y.x>s&&(s=y.x),y.y<a&&(a=y.y),y.y>l&&(l=y.y);i===s&&(i-=1,s+=1),a===l&&(a-=1,l+=1);let d=t-r*2,u=n-r*2,h=y=>r+(y-i)/(s-i)*d,g=y=>n-r-(y-a)/(l-a)*u,c=6,p=jr(i,s,c),f=jr(a,l,c);return{xScale:h,yScale:g,xTicks:p,yTicks:f,xMin:i,xMax:s,yMin:a,yMax:l}}function wn(e,t,n,r){return q(()=>Dl(e,t,n,r),[e,t,n,r])}function Gr(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function Xr(e,t,n,r,i,s,a){let l={fill:i,key:s,...a};switch(e){case"square":return o("rect",{...l,x:t-r,y:n-r,width:r*2,height:r*2});case"diamond":{let d=`${t},${n-r} ${t+r},${n} ${t},${n+r} ${t-r},${n}`;return o("polygon",{...l,points:d})}case"triangle":{let d=r*1.15,u=`${t},${n-d} ${t+r},${n+r*.6} ${t-r},${n+r*.6}`;return o("polygon",{...l,points:u})}case"triangle-down":{let d=r*1.15,u=`${t-r},${n-r*.6} ${t+r},${n-r*.6} ${t},${n+d}`;return o("polygon",{...l,points:u})}case"cross":{let d=r*.35;return o("path",{...l,fill:"none",stroke:i,"stroke-width":String(d*2),"stroke-linecap":"round",d:`M${t-r},${n-r}L${t+r},${n+r}M${t+r},${n-r}L${t-r},${n+r}`})}case"plus":{let d=r*.35;return o("path",{...l,fill:"none",stroke:i,"stroke-width":String(d*2),"stroke-linecap":"round",d:`M${t},${n-r}L${t},${n+r}M${t-r},${n}L${t+r},${n}`})}case"circle":default:return o("circle",{...l,cx:t,cy:n,r})}}function qr(e){let{data:t,width:n=600,height:r=400,lineColor:i="#3b82f6",lineWidth:s=2,pointRadius:a=4,pointColor:l="#3b82f6",pointShape:d="circle",showPoints:u=!0,showGrid:h=!0,showArea:g=!1,areaColor:c="rgba(59,130,246,0.15)",xLabel:p,yLabel:f,title:y,padding:b=50,animate:m=!1,multiLine:x}=e,v=q(()=>{let B=[...t];if(x)for(let E of x)B.push(...E.data);return B},[t,x]),D=wn(v,n,r,b),{xScale:A,yScale:M,xTicks:T,yTicks:L}=D,I=[];if(I.push(o("rect",{x:0,y:0,width:"100%",fill:"white",key:"bg"})),h){for(let B=0;B<T.length;B++){let E=A(T[B]);I.push(o("line",{x1:E,y1:b,x2:E,y2:r-b,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-x-${B}`}))}for(let B=0;B<L.length;B++){let E=M(L[B]);I.push(o("line",{x1:b,y1:E,x2:n-b,y2:E,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-y-${B}`}))}}I.push(o("line",{x1:b,y1:r-b,x2:n-b,y2:r-b,stroke:"#374151","stroke-width":1,key:"x-axis"})),I.push(o("line",{x1:b,y1:b,x2:b,y2:r-b,stroke:"#374151","stroke-width":1,key:"y-axis"}));for(let B=0;B<T.length;B++){let E=A(T[B]);I.push(o("line",{x1:E,y1:r-b,x2:E,y2:r-b+5,stroke:"#374151",key:`xtick-${B}`})),I.push(o("text",{x:E,y:r-b+18,"text-anchor":"end","font-size":11,fill:"#6b7280",transform:`rotate(-45, ${E}, ${r-b+18})`,key:`xlabel-${B}`},Gr(T[B])))}for(let B=0;B<L.length;B++){let E=M(L[B]);I.push(o("line",{x1:b-5,y1:E,x2:b,y2:E,stroke:"#374151",key:`ytick-${B}`})),I.push(o("text",{x:b-10,y:E+4,"text-anchor":"end","font-size":11,fill:"#6b7280",key:`ylabel-${B}`},Gr(L[B])))}function P(B,E,N,z,k,w,$,C,F,R){if(B.length===0)return;let W=[...B].sort((V,X)=>V.x-X.x);if(z){let V=M(D.yMin),X=W.map(G=>`${A(G.x)},${M(G.y)}`).join(" "),ee=A(W[0].x),Z=A(W[W.length-1].x),U=`${ee},${V} ${X} ${Z},${V}`;I.push(o("polygon",{points:U,fill:k,key:`${R}-area`}))}let O={points:W.map(V=>`${A(V.x)},${M(V.y)}`).join(" "),fill:"none",stroke:E,"stroke-width":N,"stroke-linejoin":"round","stroke-linecap":"round",key:`${R}-line`};if(m?(O["stroke-dasharray"]="1000",O["stroke-dashoffset"]="1000",I.push(o("polyline",O,o("animate",{attributeName:"stroke-dashoffset",from:1e3,to:0,dur:"1.5s",fill:"freeze"})))):I.push(o("polyline",O)),w)for(let V=0;V<W.length;V++){let X=A(W[V].x),ee=M(W[V].y),Z=W[V].shape??F,U=W[V].radius??C,G=`${R}-pt-${V}`;if(m){let Y=Xr(Z,X,ee,U,$,G,{opacity:0});I.push(o("g",{key:`${G}-g`},Y,o("animate",{attributeName:"opacity",from:0,to:1,dur:"0.3s",begin:"1.2s",fill:"freeze"})))}else I.push(Xr(Z,X,ee,U,$,G))}}if(P(t,i,s,g,c,u,l,a,d,"primary"),x)for(let B=0;B<x.length;B++){let E=x[B];P(E.data,E.color,s,!1,"transparent",u,E.color,E.pointRadius??a,E.pointShape??d,`series-${B}`)}if(x&&x.length>0){let B=[],E=[{color:i,label:"Primary"},...x.map((_,O)=>({color:_.color,label:_.label??`Series ${O+1}`}))],N=b+10,z=16,k=22,w=7.2,$=14,C=6,F=n-b*2-20,R=0,W=0;for(let _=0;_<E.length;_++){let O=E[_].label.length*w,V=$+C+O;R>0&&R+V>F&&(R=0,W+=k);let X=N+R,ee=b-30-W;B.push(o("rect",{x:X,y:ee,width:$,height:14,fill:E[_].color,rx:2,key:`legend-rect-${_}`})),B.push(o("text",{x:X+$+C,y:ee+12,"font-size":12,fill:"#374151",key:`legend-text-${_}`},E[_].label)),R+=V+z}I.push(o("g",{key:"legend"},...B))}return p&&I.push(o("text",{x:n/2,y:r-8,"text-anchor":"middle","font-size":13,fill:"#374151",key:"x-axis-label"},p)),f&&I.push(o("text",{x:14,y:r/2,"text-anchor":"middle","font-size":13,fill:"#374151",transform:`rotate(-90, 14, ${r/2})`,key:"y-axis-label"},f)),y&&I.push(o("text",{x:n/2,y:20,"text-anchor":"middle","font-size":16,"font-weight":"bold",fill:"#111827",key:"title"},y)),o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...I)}function zl(e){let t=[];for(let n=0;n<e;n++){let r=Math.round(360*n/e);t.push(`hsl(${r}, 70%, 55%)`)}return t}function Al(e,t){let n=t??zl(e.length);return e.map((r,i)=>r.color??n[i%n.length])}function St(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function kn(e,t,n,r,i,s){let a=i-Math.PI/2,l=s-Math.PI/2,d=St(e,t,r,a),u=St(e,t,r,l),h=s-i>Math.PI?1:0;if(n<=0)return[`M ${e} ${t}`,`L ${d.x} ${d.y}`,`A ${r} ${r} 0 ${h} 1 ${u.x} ${u.y}`,"Z"].join(" ");let g=St(e,t,n,l),c=St(e,t,n,a);return[`M ${d.x} ${d.y}`,`A ${r} ${r} 0 ${h} 1 ${u.x} ${u.y}`,`L ${g.x} ${g.y}`,`A ${n} ${n} 0 ${h} 0 ${c.x} ${c.y}`,"Z"].join(" ")}function Cn(e,t){let n=t?.padAngle??0,r=Al(e,t?.colors),i=e.reduce((u,h)=>u+h.value,0);if(i<=0)return[];let s=n*e.length,a=Math.PI*2-s,l=[],d=0;for(let u=0;u<e.length;u++){let h=e[u],g=h.value/i*a,c=d+n/2,p=c+g;l.push({label:h.label,value:h.value,startAngle:c,endAngle:p,percentage:h.value/i*100,color:r[u]}),d=p+n/2}return l}function Kr(e){let{data:t,width:n=400,height:r=400,innerRadius:i=0,padAngle:s=.02,showLabels:a=!0,showValues:l=!0,showLegend:d=!0,legendPosition:u="right",title:h,centerLabel:g,colors:c,strokeColor:p="#fff",strokeWidth:f=2,textColor:y="currentColor"}=e,b=d&&u==="right"?140:0,m=h?30:0,x=d&&u==="bottom"?Math.ceil(t.length/2)*22+10:0,v=n-b,D=r-m-x,A=v/2,M=m+D/2,T=Math.min(v,D)/2-10,L=e.outerRadius??T,I=q(()=>Cn(t,{padAngle:s,colors:c}),[t,s,c]),P=[];h&&P.push(o("text",{key:"title",x:v/2,y:20,textAnchor:"middle",fontFamily:"sans-serif",fontSize:16,fontWeight:"bold",fill:y},h));for(let B=0;B<I.length;B++){let E=I[B],N=kn(A,M,i,L,E.startAngle,E.endAngle);if(P.push(o("path",{key:`slice-${B}`,d:N,fill:E.color,stroke:p,strokeWidth:f})),a||l){let z=(E.startAngle+E.endAngle)/2,k=E.percentage<5,w=k?L+14:i+(L-i)*.65,$=St(A,M,w,z-Math.PI/2),C=k?y:"#fff",F=k?11:12,R=[];if(a&&R.push(E.label),l&&R.push(`${E.percentage.toFixed(1)}%`),k){let W=St(A,M,L+2,z-Math.PI/2);P.push(o("line",{key:`connector-${B}`,x1:W.x,y1:W.y,x2:$.x,y2:$.y,stroke:"#999",strokeWidth:1}))}a&&P.push(o("text",{key:`label-${B}`,x:$.x,y:$.y-(l?6:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:F,fill:C,pointerEvents:"none"},E.label)),l&&P.push(o("text",{key:`value-${B}`,x:$.x,y:$.y+(a?10:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:F-1,fill:C,pointerEvents:"none"},`${E.percentage.toFixed(1)}%`))}}if(g&&i>0&&P.push(o("text",{key:"center-label",x:A,y:M,textAnchor:"middle",dominantBaseline:"central",fontFamily:"sans-serif",fontSize:14,fontWeight:"bold",fill:y},g)),d){let B=[];if(u==="right"){let E=v+10,N=m+20;for(let z=0;z<I.length;z++){let k=I[z],w=N+z*22;B.push(o("circle",{key:`legend-dot-${z}`,cx:E+6,cy:w,r:6,fill:k.color})),B.push(o("text",{key:`legend-text-${z}`,x:E+18,y:w,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:y},`${k.label} (${k.percentage.toFixed(1)}%)`))}}else{let E=r-x+10;for(let N=0;N<I.length;N++){let z=I[N],k=N%2,w=Math.floor(N/2),$=k*(n/2)+10,C=E+w*22;B.push(o("circle",{key:`legend-dot-${N}`,cx:$+6,cy:C,r:6,fill:z.color})),B.push(o("text",{key:`legend-text-${N}`,x:$+18,y:C,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:y},`${z.label} (${z.percentage.toFixed(1)}%)`))}}P.push(...B)}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...P)}function Zr(e,t,n,r,i){return{x:n+e*Math.cos(t)*i,y:r-e*Math.sin(t)*i}}function Jr(e){let{width:t=400,height:n=400,rRange:r=[0,2],plotFunction:i,plotResolution:s=360,thetaStep:a,sync:l=!1,points:d=[],showGrid:u=!0,pointRadius:h=3,pointColor:g="#3b82f6",curveColor:c="#3b82f6",onPointClick:p,onPointDoubleClick:f,onPointContextMenu:y,onPointHover:b}=e,[m,x]=j(r[1]),[v,D]=j(0),[A,M]=j(0),[T,L]=j(null),I=t/2+v,P=n/2+A,E=Math.min(t,n)/2-30,N=E/m,z=q(()=>{let U=Math.max(1,Math.ceil(m)),G=[],Y=m/U;for(let H=1;H<=U;H++)G.push(Y*H);return G},[m]),k=q(()=>{let U=[];for(let G=0;G<360;G+=30)U.push(G*Math.PI/180);return U},[]),w=q(()=>{if(!i||!l)return[];let U=a??2*Math.PI/s,G=yt({start:0,end:2*Math.PI,step:U});return jt(i,G)},[i,s,a,l]),[$,C]=j([]),F=ne(null);re(()=>{if(!i||l){C([]);return}let U=a??2*Math.PI/s,G=yt({start:0,end:2*Math.PI,step:U});return F.current&&F.current(),F.current=Gt(i,G,200,Y=>{C([...Y])}),()=>{F.current&&F.current()}},[i,s,a,l]);let R=l?w:$,W=q(()=>{if(R.length===0)return"";let U=[];for(let G=0;G<R.length;G++){let Y=R[G],H=Y.output;if(H<0||!isFinite(H))continue;let{x:K,y:Q}=Zr(H,Y.input,I,P,N);U.push(`${U.length===0?"M":"L"}${K.toFixed(2)},${Q.toFixed(2)}`)}return U.join(" ")},[R,I,P,N]),_=S(U=>{L({x:U.clientX,y:U.clientY,px:v,py:A})},[v,A]),O=S(U=>{T&&(D(T.px+(U.clientX-T.x)),M(T.py+(U.clientY-T.y)))},[T]),V=S(()=>{L(null)},[]),X=S(U=>{U.preventDefault();let G=U.deltaY>0?1.15:1/1.15;x(Math.max(.1,m*G))},[m]),ee=S((U,G,Y)=>{if(U)return H=>U({r:G.r,theta:G.theta,index:Y,event:H})},[]),Z=[];if(Z.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),u){for(let U=0;U<z.length;U++){let G=z[U]*N;Z.push(o("circle",{cx:I,cy:P,r:G,fill:"none",stroke:"#e5e7eb","stroke-width":1,key:`gc-${U}`})),Z.push(o("text",{x:I+G+2,y:P-4,"font-size":10,fill:"#9ca3af",key:`gl-${U}`},z[U].toFixed(1)))}for(let U=0;U<k.length;U++){let G=k[U],Y=z[z.length-1]*N,H=I+Y*Math.cos(G),K=P-Y*Math.sin(G);Z.push(o("line",{x1:I,y1:P,x2:H,y2:K,stroke:"#e5e7eb","stroke-width":1,key:`al-${U}`}));let Q=Math.round(G*180/Math.PI),ie=I+(Y+14)*Math.cos(G),J=P-(Y+14)*Math.sin(G);Z.push(o("text",{x:ie,y:J+4,"text-anchor":"middle","font-size":10,fill:"#9ca3af",key:`at-${U}`},`${Q}\xB0`))}}Z.push(o("line",{x1:I-E,y1:P,x2:I+E,y2:P,stroke:"#d1d5db","stroke-width":1,key:"x-axis"})),Z.push(o("line",{x1:I,y1:P-E,x2:I,y2:P+E,stroke:"#d1d5db","stroke-width":1,key:"y-axis"})),W&&Z.push(o("path",{d:W,fill:"none",stroke:c,"stroke-width":2,key:"curve"}));for(let U=0;U<d.length;U++){let G=d[U],{x:Y,y:H}=Zr(G.r,G.theta,I,P,N);Z.push(o("circle",{cx:Y,cy:H,r:h,fill:g,key:`pt-${U}`,style:{cursor:"pointer"},onClick:ee(p,G,U),onDblClick:ee(f,G,U),onContextMenu:ee(y,G,U),onMouseEnter:ee(b,G,U)}))}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",style:{cursor:T?"grabbing":"grab"},onMouseDown:_,onMouseMove:O,onMouseUp:V,onMouseLeave:V,onWheel:X},...Z)}function Mn(e){let t=1<<e,n=[];for(let r=0;r<t;r++){let i=[];for(let s=0;s<e;s++)i.push((r>>s&1)*2-1);n.push({coords:i})}return n}function En(e){let t=1<<e,n=[];for(let r=0;r<t;r++)for(let i=0;i<e;i++){let s=r^1<<i;s>r&&n.push({source:r,target:s})}return n}function In(e,t){let n=Qr(e),r=0;for(let i=0;i<e;i++)for(let s=i+1;s<e;s++){if(r<t.length){let a=t[r];n=Bl(n,Ll(e,i,s,a))}r++}return n}function Qr(e){let t=[];for(let n=0;n<e;n++){let r=new Array(e).fill(0);r[n]=1,t.push(r)}return t}function Ll(e,t,n,r){let i=Qr(e),s=Math.cos(r),a=Math.sin(r);return i[t][t]=s,i[t][n]=-a,i[n][t]=a,i[n][n]=s,i}function Bl(e,t){let n=e.length,r=[];for(let i=0;i<n;i++){let s=new Array(n).fill(0);for(let a=0;a<n;a++)for(let l=0;l<n;l++)s[a]+=e[i][l]*t[l][a];r.push(s)}return r}function Rn(e,t){let n=e.length,r=new Array(n).fill(0);for(let i=0;i<n;i++)for(let s=0;s<n;s++)r[i]+=e[i][s]*t.coords[s];return r}function Pn(e,t=0){let n=e[0]??0,r=e[1]??0,i=0;for(let s=2;s<e.length;s++)i+=e[s]??0;if(e.length>2&&(i/=e.length-2),t>0){let s=1/(1+t*(i+2));return{x:n*s,y:r*s,depth:i}}return{x:n,y:r,depth:i}}function It(e,t=[],n=.3,r=1){let i=Mn(e),s=En(e),a=In(e,t);return{vertices:i.map((d,u)=>{let h=Rn(a,d),g=Pn(h,n);return{id:u,position:d,x:g.x*r,y:g.y*r,depth:g.depth}}),edges:s,dimension:e}}function Rt(e){return e*(e-1)/2}function Xt(e,t=70,n=55){let r=[];for(let i=0;i<e;i++){let s=Math.round(360*i/e);r.push(`hsl(${s}, ${t}%, ${n}%)`)}return r}function ei(e){let t=e.dimension??4,n=e.width??600,r=e.height??600,i=e.vertexRadius??10,s=e.edgeWidth??3,a=e.edgeColor??"#111",l=e.perspective??.25,d=e.rotationSpeed??.008,u=e.showLabels??!1,h=e.backgroundColor??"transparent",g=e.scale??Math.min(n,r)*.3,c=Rt(t),p=1<<t,f=q(()=>e.vertexColors==="auto"||e.vertexColors===void 0?Xt(p):e.vertexColors,[p,e.vertexColors]),[y,b]=j(()=>{let C=[];for(let F=0;F<c;F++)C.push(0);return C}),[m,x]=j(!1),v=ne({x:0,y:0}),D=ne([]),A=ne(0);re(()=>{if(d===0)return;let C=!0,F=()=>{C&&(b(R=>{let W=R.slice();for(let _=0;_<W.length;_++)W[_]=(W[_]??0)+d*(1+_*.3);return W}),A.current=requestAnimationFrame(F))};return A.current=requestAnimationFrame(F),()=>{C=!1,cancelAnimationFrame(A.current)}},[d]);let M=q(()=>It(t,y,l,g),[t,y,l,g]),T=n/2,L=r/2,I=q(()=>M.edges.map(C=>{let F=M.vertices[C.source],R=M.vertices[C.target],W=(F.depth+R.depth)/2;return{...C,avgDepth:W,sv:F,tv:R}}).sort((C,F)=>C.avgDepth-F.avgDepth),[M]),P=q(()=>M.vertices.slice().sort((C,F)=>C.depth-F.depth),[M]),B=S(C=>{let F=C;x(!0),v.current={x:F.clientX,y:F.clientY},D.current=y.slice()},[y]),E=S(C=>{if(!m)return;let F=C,R=(F.clientX-v.current.x)*.01,W=(F.clientY-v.current.y)*.01;b(()=>{let _=D.current.slice();return _.length>0&&(_[0]=(_[0]??0)+R),_.length>1&&(_[1]=(_[1]??0)+W),_})},[m]),N=S(()=>{x(!1)},[]),z=C=>{let F=(C+2)/4;return .3+.7*Math.max(0,Math.min(1,F))},k=C=>{let F=(C+2)/4;return .6+.4*Math.max(0,Math.min(1,F))},w=I.map((C,F)=>{let R=z(C.avgDepth);return o("line",{key:`e-${C.source}-${C.target}`,x1:String(T+C.sv.x),y1:String(L+C.sv.y),x2:String(T+C.tv.x),y2:String(L+C.tv.y),stroke:a,"stroke-width":String(s),"stroke-opacity":String(R),"stroke-linecap":"round"})}),$=P.map(C=>{let F=i*k(C.depth),R=f[C.id%f.length]??"#3b82f6",W=[o("circle",{key:`v-${C.id}-circle`,cx:String(T+C.x),cy:String(L+C.y),r:String(F),fill:R,stroke:"#000","stroke-width":"1.5",style:{filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.3))"}})];return u&&W.push(o("text",{key:`v-${C.id}-label`,x:String(T+C.x),y:String(L+C.y+F+14),"text-anchor":"middle","font-size":"11","font-family":"monospace",fill:"#555"},C.id.toString(2).padStart(t,"0"))),W});return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",style:{backgroundColor:h,cursor:m?"grabbing":"grab",userSelect:"none"},onMouseDown:B,onMouseMove:E,onMouseUp:N,onMouseLeave:N},...w,...$.flat())}function ti(e={}){let t=e.dimension??4,n=e.rotationSpeed??.008,r=e.perspective??.25,i=e.scale??200,s=Rt(t),[a,l]=j(()=>new Array(s).fill(0));return re(()=>{if(n===0)return;let u=!0,h=0,g=()=>{u&&(l(c=>c.map((p,f)=>p+n*(1+f*.3))),h=requestAnimationFrame(g))};return h=requestAnimationFrame(g),()=>{u=!1,cancelAnimationFrame(h)}},[n]),{data:q(()=>It(t,a,r,i),[t,a,r,i]),angles:a,setAngles:l}}function ni(e){let t=e.titlePosition??"top",n=e.legendPosition??"bottom",r=e.titleAlign??"center",i=e.legendAlign??"center",s=e.gap??"12px",a=e.contain??"layout style paint",l={display:"flex",flexDirection:Fl(t,n),gap:s,width:typeof e.width=="number"?`${e.width}px`:e.width??"auto",height:typeof e.height=="number"?`${e.height}px`:e.height??"auto",backgroundColor:e.backgroundColor??"#ffffff",border:e.border??"1px solid #e5e7eb",borderRadius:e.borderRadius??"8px",padding:e.padding??"16px",fontFamily:e.fontFamily??"inherit",contain:a,overflow:"hidden",position:"relative",boxSizing:"border-box",...e.boxShadow?{boxShadow:e.boxShadow}:{},...e.style??{}},d=e.title?o("div",{className:"viz-title",style:{fontSize:e.titleFontSize??"16px",fontWeight:e.titleFontWeight??"600",color:e.titleColor??"#1f2937",textAlign:r,flexShrink:"0"}},e.title):null,u=e.legend&&e.legend.length>0?Wl(e.legend,{align:i,fontSize:e.legendFontSize??"12px",gap:e.legendGap??16,direction:n==="left"||n==="right"?"column":"row"}):null,h=o("div",{className:"viz-content",style:{flex:"1",minWidth:"0",minHeight:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}},e.children),g=Nl(d,h,u,t,n);return o("div",{className:`viz-wrapper ${e.className??""}`.trim(),style:l},...g)}function Fl(e,t){return"column"}function Nl(e,t,n,r,i){let s=[];if(r==="top"&&e&&s.push(e),i==="left"||i==="right"){let a=[];i==="left"&&n&&a.push(n),r==="left"&&e&&a.push(e),a.push(t),r==="right"&&e&&a.push(e),i==="right"&&n&&a.push(n),s.push(o("div",{style:{display:"flex",flexDirection:"row",flex:"1",gap:"12px",minHeight:"0",alignItems:"stretch"}},...a))}else if(r==="left"||r==="right"){i==="top"&&n&&s.push(n);let a=[];r==="left"&&e&&a.push(e),a.push(t),r==="right"&&e&&a.push(e),s.push(o("div",{style:{display:"flex",flexDirection:"row",flex:"1",gap:"12px",minHeight:"0",alignItems:"center"}},...a)),i==="bottom"&&n&&s.push(n)}else i==="top"&&n&&s.push(n),s.push(t),i==="bottom"&&n&&s.push(n);return r==="bottom"&&e&&s.push(e),s}function Wl(e,t){return o("div",{className:"viz-legend",style:{display:"flex",flexDirection:t.direction,flexWrap:"wrap",gap:`${t.gap}px`,justifyContent:t.align,alignItems:"center",fontSize:t.fontSize,color:"#6b7280",flexShrink:"0"}},...e.map((n,r)=>o("div",{key:`legend-${r}`,style:{display:"flex",alignItems:"center",gap:"6px"}},_l(n),o("span",null,n.label))))}function _l(e){let t=e.shape??"circle";return t==="line"?o("svg",{width:"20",height:"12",viewBox:"0 0 20 12"},o("line",{x1:"0",y1:"6",x2:"20",y2:"6",stroke:e.color,"stroke-width":"2","stroke-dasharray":e.dash??""})):t==="square"?o("div",{style:{width:"12px",height:"12px",backgroundColor:e.color,borderRadius:"2px",flexShrink:"0"}}):o("div",{style:{width:"10px",height:"10px",backgroundColor:e.color,borderRadius:"50%",flexShrink:"0"}})}function Ol(e){if(typeof document>"u")return;let t="specifyjs-gtag";if(document.getElementById(t))return;let n=document.createElement("script");n.id=t,n.async=!0,n.src=`https://www.googletagmanager.com/gtag/js?id=${encodeURIComponent(e)}`,document.head.appendChild(n)}function Hl(){typeof window>"u"||(window.dataLayer=window.dataLayer||[],window.gtag||(window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date)))}function oi(e){let{measurementId:t,disabled:n=!1,debug:r=!1,anonymizeIp:i=!1,config:s}=e;return re(()=>{if(n||typeof window>"u")return;Ol(t),Hl();let a={...s};return i&&(a.anonymize_ip=!0),r&&(a.debug_mode=!0),window.gtag&&window.gtag("config",t,a),()=>{let l=document.getElementById("specifyjs-gtag");l&&l.remove()}},[t,n,r,i]),null}function ri(e){let{left:t,center:n,right:r,borderTop:i="1px solid var(--color-border, #e2e8f0)",background:s="var(--color-bg, transparent)",color:a="var(--color-text-muted, #64748b)",fontSize:l="13px",padding:d="24px",maxWidth:u="1200px",className:h,ariaLabel:g="Site footer"}=e;return o("footer",{className:h,role:"contentinfo","aria-label":g,style:{borderTop:i,background:s,color:a,fontSize:l,padding:d,marginTop:"48px"}},o("div",{className:"footer-inner",style:{maxWidth:u,margin:"0 auto",display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:"12px"}},o("div",{className:"footer-section",style:{flex:"1",textAlign:"left",minWidth:"150px"}},t??null),o("div",{className:"footer-section",style:{flex:"1",textAlign:"center",minWidth:"150px"}},n??null),o("div",{className:"footer-section",style:{flex:"1",textAlign:"right",minWidth:"150px"}},r??null)))}var ai=Ue({windows:[],openWindow:()=>{},closeWindow:()=>{},focusWindow:()=>{},minimizeWindow:()=>{},maximizeWindow:()=>{},restoreWindow:()=>{},moveWindow:()=>{},resizeWindow:()=>{},tileWindows:()=>{},cascadeWindows:()=>{},minimizeAll:()=>{},focusedWindowId:null,setMenuBar:()=>{},clearMenuBar:()=>{},activeMenuBar:null,signalDock:()=>{},dockSignals:new Map}),Yl={width:600,height:400},Vl={x:30,y:30},Ul={top:0,left:0,width:1920,height:1080},$n=1e3;function ii(e,t,n,r){let i=n.left+e*t.x,s=n.top+e*t.y,a=n.left+n.width-r.width,l=n.top+n.height-r.height;return a>n.left&&i>a&&(i=n.left+(i-n.left)%Math.max(1,a-n.left)),l>n.top&&s>l&&(s=n.top+(s-n.top)%Math.max(1,l-n.top)),{x:i,y:s}}function Tn(e){let t=[...e].sort((r,i)=>r.zIndex-i.zIndex),n=[];for(let r=0;r<t.length;r++)n.push({...t[r],zIndex:r+1});return n}function si(e,t){let n=null;for(let r=0;r<e.length;r++){let i=e[r];i.id!==t&&i.windowState!=="minimized"&&(n===null||i.zIndex>n.zIndex)&&(n=i)}return n}function Dn(e){let t=0;for(let n=0;n<e.length;n++)e[n].zIndex>t&&(t=e[n].zIndex);return t}function zn(e){let t=e.workspaceBounds??Ul,n=e.defaultWindowSize??Yl,r=e.cascadeOffset??Vl,[i,s]=j([]),a=S(((...B)=>{let E=B[0];s(N=>{if(N.find(W=>W.id===E.id)){let _=Dn(N)+1,O=N.map(V=>V.id===E.id?{...V,focused:!0,zIndex:_,windowState:V.windowState==="minimized"?"normal":V.windowState}:{...V,focused:!1});return _>$n&&(O=Tn(O)),O}let k=E.size??n,w=E.position??ii(N.length,r,t,k),C=Dn(N)+1,F={id:E.id,title:E.title,icon:E.icon,position:w,size:k,windowState:"normal",zIndex:C,focused:!0,appProps:E.appProps},R=N.map(W=>({...W,focused:!1}));return R.push(F),C>$n&&(R=Tn(R)),e.onWindowOpen&&e.onWindowOpen(E.id),e.onFocusChange&&e.onFocusChange(E.id),R})}),[n,r,t,e.onWindowOpen,e.onFocusChange]),l=S(((...B)=>{let E=B[0];v(N=>{if(N[E]){let z={...N};return delete z[E],z}return N}),A(N=>{if(N.has(E)){let z=new Map(N);return z.delete(E),z}return N}),s(N=>{let z=N.find(w=>w.id===E);if(!z)return N;let k=N.filter(w=>w.id!==E);if(z.focused&&k.length>0){let w=si(k,E);if(w){let $=k.map(C=>({...C,focused:C.id===w.id}));return e.onWindowClose&&e.onWindowClose(E),e.onFocusChange&&e.onFocusChange(w.id),$}}return e.onWindowClose&&e.onWindowClose(E),k.length===0&&e.onFocusChange&&e.onFocusChange(null),k})}),[e.onWindowClose,e.onFocusChange]),d=S(((...B)=>{let E=B[0];s(N=>{if(!N.find(C=>C.id===E))return N;let w=Dn(N)+1,$=N.map(C=>C.id===E?{...C,focused:!0,zIndex:w}:{...C,focused:!1});return w>$n&&($=Tn($)),e.onFocusChange&&e.onFocusChange(E),$})}),[e.onFocusChange]),u=S(((...B)=>{let E=B[0];s(N=>{let z=N.find(w=>w.id===E);if(!z)return N;let k=N.map(w=>w.id===E?{...w,windowState:"minimized",focused:!1}:w);if(z.focused){let w=si(k,E);w?(k=k.map($=>({...$,focused:$.id===w.id})),e.onFocusChange&&e.onFocusChange(w.id)):e.onFocusChange&&e.onFocusChange(null)}return k})}),[e.onFocusChange]),h=S(((...B)=>{let E=B[0];s(N=>N.map(z=>z.id===E?{...z,windowState:"maximized"}:z))}),[]),g=S(((...B)=>{let E=B[0];s(N=>N.map(z=>z.id===E?{...z,windowState:"normal"}:z))}),[]),c=S(((...B)=>{let E=B[0],N=B[1];s(z=>z.map(k=>k.id===E?{...k,position:N}:k))}),[]),p=S(((...B)=>{let E=B[0],N=B[1];s(z=>z.map(k=>k.id===E?{...k,size:N}:k))}),[]),f=S(((...B)=>{s(E=>{let N=E.filter(w=>w.windowState!=="minimized");if(N.length===0)return E;let z=N.length,k=new Map;if(z===1)k.set(N[0].id,{position:{x:t.left,y:t.top},size:{width:t.width,height:t.height}});else if(z===2){let w=Math.floor(t.width/2);k.set(N[0].id,{position:{x:t.left,y:t.top},size:{width:w,height:t.height}}),k.set(N[1].id,{position:{x:t.left+w,y:t.top},size:{width:t.width-w,height:t.height}})}else if(z===3){let w=Math.floor(t.width/2),$=Math.floor(t.height/2);k.set(N[0].id,{position:{x:t.left,y:t.top},size:{width:w,height:t.height}}),k.set(N[1].id,{position:{x:t.left+w,y:t.top},size:{width:t.width-w,height:$}}),k.set(N[2].id,{position:{x:t.left+w,y:t.top+$},size:{width:t.width-w,height:t.height-$}})}else{let w=Math.ceil(Math.sqrt(z)),$=Math.ceil(z/w),C=Math.floor(t.width/w),F=Math.floor(t.height/$);for(let R=0;R<N.length;R++){let W=Math.floor(R/w),_=R%w;k.set(N[R].id,{position:{x:t.left+_*C,y:t.top+W*F},size:{width:C,height:F}})}}return E.map(w=>{let $=k.get(w.id);return $?{...w,position:$.position,size:$.size,windowState:"normal"}:w})})}),[t]),y=S(((...B)=>{s(E=>{let N=E.filter(w=>w.windowState!=="minimized");if(N.length===0)return E;let z=[...N].sort((w,$)=>w.zIndex-$.zIndex),k=new Map;for(let w=0;w<z.length;w++){let $=ii(w,r,t,z[w].size);k.set(z[w].id,{position:$,zIndex:w+1})}return E.map(w=>{let $=k.get(w.id);return $?{...w,position:$.position,zIndex:$.zIndex,windowState:"normal"}:w})})}),[r,t]),b=S(((...B)=>{s(E=>{let N=E.map(z=>({...z,windowState:"minimized",focused:!1}));return e.onFocusChange&&e.onFocusChange(null),N})}),[e.onFocusChange]),m=q(()=>{let B=i.find(E=>E.focused);return B?B.id:null},[i]),[x,v]=j({}),[D,A]=j(new Map),M=S(((...B)=>{let E=B[0],N=B[1];v(z=>({...z,[E]:N}))}),[]),T=S(((...B)=>{let E=B[0];v(N=>{let z={...N};return delete z[E],z})}),[]),L=q(()=>m&&x[m]?x[m]:null,[m,x]),I=S(((...B)=>{let E=B[0],N=B[1];A(z=>{let k=new Map(z),w=k.get(E);return k.set(E,{...w,...N}),k})}),[]),P=q(()=>({windows:i,openWindow:a,closeWindow:l,focusWindow:d,minimizeWindow:u,maximizeWindow:h,restoreWindow:g,moveWindow:c,resizeWindow:p,tileWindows:f,cascadeWindows:y,minimizeAll:b,focusedWindowId:m,setMenuBar:M,clearMenuBar:T,activeMenuBar:L,signalDock:I,dockSignals:D}),[i,a,l,d,u,h,g,c,p,f,y,b,m,M,T,L,I,D]);return o(ai.Provider,{value:P},e.children)}function Pt(){return Ye(ai)}var li=Ue({appId:""});function rt(e){let t=q(()=>({appId:e.appId}),[e.appId]);return o(li.Provider,{value:t},e.children)}function vt(){return Ye(li).appId}var ci=Ue({publish:()=>{},subscribe:()=>()=>{},subscribeAll:()=>()=>{}});function $t(e){let t=ne([]),n=ne([]),r=S(((...l)=>{let d=l[0],u=l[1],h=l[2],g=l[3]||"",c={channel:d,from:g,to:h||null,payload:u,timestamp:Date.now()},p=t.current;for(let y=0;y<p.length;y++){let b=p[y];b.channel===d&&(c.to&&b.appId!==c.to||!c.to&&b.appId===g||b.handler(c))}let f=n.current;for(let y=0;y<f.length;y++)f[y].handler(c)}),[]),i=S(((...l)=>{let d=l[0],u=l[1],h=l[2]||"",g={channel:d,handler:u,appId:h};return t.current=[...t.current,g],()=>{t.current=t.current.filter(c=>c!==g)}}),[]),s=S(((...l)=>{let u={handler:l[0]};return n.current=[...n.current,u],()=>{n.current=n.current.filter(h=>h!==u)}}),[]),a=q(()=>({publish:r,subscribe:i,subscribeAll:s}),[r,i,s]);return o(ci.Provider,{value:a},e.children)}function it(){let e=Ye(ci),t=vt(),n=S(((...i)=>{let s=i[0],a=i[1],l=i[2];e.publish(s,a,l,t)}),[e.publish,t]),r=S(((...i)=>{let s=i[0],a=i[1];return e.subscribe(s,a,t)}),[e.subscribe,t]);return q(()=>({publish:n,subscribe:r,subscribeAll:e.subscribeAll}),[n,r,e.subscribeAll])}function Tt(e,t){let n=it(),r=ne(t);r.current=t,re(()=>n.subscribe(e,s=>{r.current(s)}),[n,e])}var di=Ue({startDrag:()=>{},cancelDrag:()=>{},registerDropZone:()=>()=>{},currentDrag:null,isDragging:!1});function Dt(e){let[t,n]=j(null),[r,i]=j({x:0,y:0}),s=ne(new Map),a=ne(null),l=t!==null,d=S(((...p)=>{let f=p[0];n(f)}),[]),u=S(((...p)=>{if(a.current){let f=s.current.get(a.current);f&&f.onDragLeave&&f.onDragLeave(),a.current=null}n(null)}),[]),h=S(((...p)=>{let f=p[0],y=p[1];return s.current=new Map(s.current),s.current.set(f,y),()=>{s.current=new Map(s.current),s.current.delete(f),a.current===f&&(a.current=null)}}),[]);re(()=>{if(!l)return;let p=b=>{let m=b;i({x:m.clientX,y:m.clientY});let x=document.elementFromPoint(m.clientX,m.clientY);if(!x)return;let v=null,D=s.current;D.forEach((M,T)=>{let L=document.querySelector(`[data-dropzone-id="${T}"]`);L&&L.contains(x)&&(v=T)});let A=a.current;if(v!==A){if(A){let M=D.get(A);M&&M.onDragLeave&&M.onDragLeave()}if(v){let M=D.get(v);M&&M.onDragEnter&&t&&M.acceptTypes.indexOf(t.type)!==-1&&M.onDragEnter(t)}a.current=v}},f=b=>{let m=a.current;if(m&&t){let x=s.current.get(m);x&&x.acceptTypes.indexOf(t.type)!==-1&&x.onDrop(t)}a.current=null,n(null)},y=b=>{b.key==="Escape"&&u()};return document.addEventListener("mousemove",p),document.addEventListener("mouseup",f),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",f),document.removeEventListener("keydown",y)}},[l,t,u]);let g=q(()=>({startDrag:d,cancelDrag:u,registerDropZone:h,currentDrag:t,isDragging:l}),[d,u,h,t,l]),c=l?o("div",{className:"drag-drop-preview",style:{position:"fixed",left:`${r.x+12}px`,top:`${r.y+12}px`,pointerEvents:"none",zIndex:"10000",opacity:"0.8",padding:"6px 10px",backgroundColor:"rgba(50, 50, 50, 0.9)",color:"#ffffff",borderRadius:"4px",fontSize:"12px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",whiteSpace:"nowrap"}},t&&t.preview?String(t.preview):`Dragging ${t?t.type:""}`):null;return o(di.Provider,{value:g},e.children,c)}function ut(){return Ye(di)}function An(e,t){let n=ut(),r=vt(),i=ne(t);i.current=t;let s=S(l=>{l.preventDefault(),n.startDrag({type:e,data:i.current,sourceAppId:r||""})},[n,e,r]),a=n.isDragging&&n.currentDrag!==null&&n.currentDrag.type===e;return q(()=>({onMouseDown:s,isDragging:a}),[s,a])}function zt(e){let t=ut(),[n,r]=j(!1),i=ne(e.zoneId||`zone-${Math.random().toString(36).slice(2,10)}`),s=ne(e);s.current=e,re(()=>t.registerDropZone(i.current,{acceptTypes:s.current.acceptTypes,onDragEnter:d=>{r(!0),s.current.onDragEnter&&s.current.onDragEnter(d)},onDragLeave:()=>{r(!1),s.current.onDragLeave&&s.current.onDragLeave()},onDrop:d=>{r(!1),s.current.onDrop(d)}}),[t]);let a=t.isDragging&&t.currentDrag!==null&&e.acceptTypes.indexOf(t.currentDrag.type)!==-1;return q(()=>({isOver:n,canDrop:a,zoneId:i.current}),[n,a])}var jl=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Gl=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ln(e){return e<10?"0"+String(e):String(e)}function Xl(e,t,n){let r=e.getHours(),i=Ln(e.getMinutes()),s=Ln(e.getSeconds());if(t==="12h"){let l=r>=12?"PM":"AM";return r=r%12,r===0&&(r=12),`${n?`${String(r)}:${i}:${s}`:`${String(r)}:${i}`} ${l}`}let a=Ln(r);return n?`${a}:${i}:${s}`:`${a}:${i}`}function ql(e){let t=jl[e.getDay()],n=Gl[e.getMonth()],r=e.getDate();return`${t}, ${n} ${String(r)}`}function Kl(e){let{label:t,onClick:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=Be(),a=S(()=>{n()},[n]),l=S(d=>{let u=d;(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),n())},[n]);return o("button",{type:"button",role:"button","aria-label":t,tabIndex:0,onClick:a,onKeyDown:l,onMouseEnter:i,onMouseLeave:s,style:{display:"inline-flex",alignItems:"center",padding:"0 12px",height:"100%",border:"none",outline:"none",backgroundColor:r?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",fontWeight:"700",cursor:"pointer",transition:"background-color 0.15s"}},t)}function Zl(e){let{format:t,showSeconds:n,showDate:r}=e,[i,s]=j(new Date);re(()=>{let u=setInterval(()=>{s(new Date)},1e3);return()=>{clearInterval(u)}},[]);let a=q(()=>Xl(i,t,n),[i,t,n]),l=q(()=>ql(i),[i]),d=r?o("span",{style:{fontSize:"11px",opacity:"0.85"}},l):null;return o("div",{role:"timer","aria-live":"polite","aria-label":"System clock",style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"6px",lineHeight:"1",padding:"0 8px"}},d,o("span",{style:{fontSize:"13px",fontWeight:"500"}},a))}function Jl(e){let{indicator:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=Be(),s=S(()=>{t.onClick&&t.onClick()},[t]),a=S(l=>{let d=l;(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),t.onClick&&t.onClick())},[t]);return o("button",{type:"button",role:"button","aria-label":t.label||t.icon,tabIndex:0,onClick:s,onKeyDown:a,onMouseEnter:r,onMouseLeave:i,style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"0 4px",height:"100%",border:"none",outline:"none",backgroundColor:n?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",cursor:t.onClick?"pointer":"default",transition:"background-color 0.15s"}},o("span",{"aria-hidden":"true"},t.icon),t.label?o("span",null,t.label):null)}function Ql(e){let{item:t,onClose:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=Be();if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"var(--panel-divider, #555555)",margin:"4px 0"}});let a=S(()=>{t.onClick(),n()},[t,n]),l=S(d=>{let u=d;(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),t.onClick(),n())},[t,n]);return o("button",{type:"button",role:"menuitem",tabIndex:-1,onClick:a,onKeyDown:l,onMouseEnter:i,onMouseLeave:s,style:{display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"6px 16px",border:"none",outline:"none",backgroundColor:r?"var(--panel-hover, rgba(255,255,255,0.15))":"transparent",color:"var(--panel-text, #ffffff)",fontFamily:"inherit",fontSize:"13px",textAlign:"left",cursor:"pointer",boxSizing:"border-box",transition:"background-color 0.1s"}},t.icon?o("span",{style:{width:"16px",textAlign:"center"},"aria-hidden":"true"},t.icon):null,o("span",null,t.label))}function ec(e){let{user:t,menuItems:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=Be(),[a,l]=j(!1),d=ne(null),u=S(()=>{l(b=>!b)},[]),h=S(()=>{l(!1)},[]),g=S(b=>{let m=b;(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),l(x=>!x)),m.key==="Escape"&&l(!1)},[]);re(()=>{if(!a)return;let b=m=>{let x=d.current;x&&!x.contains(m.target)&&l(!1)};return document.addEventListener("click",b,!0),()=>{document.removeEventListener("click",b,!0)}},[a]);let c={width:"24px",height:"24px",borderRadius:"50%",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"12px",fontWeight:"700",backgroundColor:"rgba(255,255,255,0.2)",color:"inherit",overflow:"hidden",flexShrink:"0"},p=t.avatar?o("img",{src:t.avatar,alt:t.name,style:{width:"100%",height:"100%",objectFit:"cover"}}):t.name.charAt(0).toUpperCase(),f=o("span",{style:c,"aria-hidden":"true"},p),y=a&&n&&n.length>0?o("div",{role:"menu","aria-label":"User menu",style:{position:"absolute",top:"100%",right:"0",marginTop:"2px",backgroundColor:"var(--panel-bg, #2c2c2c)",border:"1px solid var(--panel-divider, #555555)",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",padding:"4px 0",minWidth:"180px",zIndex:"1000"}},...n.map((b,m)=>o(Ql,{key:String(m),item:b,onClose:h}))):null;return o("div",{ref:d,style:{position:"relative",display:"inline-flex",height:"100%"}},o("button",{type:"button","aria-haspopup":"true","aria-expanded":String(a),tabIndex:0,onClick:u,onKeyDown:g,onMouseEnter:i,onMouseLeave:s,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"0 8px",height:"100%",border:"none",outline:"none",backgroundColor:r||a?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",cursor:"pointer",transition:"background-color 0.15s"}},f,o("span",null,t.name),o("span",{"aria-hidden":"true",style:{fontSize:"10px"}},"\u25BE")),y)}function tc(e){let{menu:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=Be(),[s,a]=j(!1),l=ne(null),d=S(()=>{a(c=>!c)},[]),u=S(()=>{a(!1)},[]),h=S(c=>{let p=c;(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),a(f=>!f)),p.key==="Escape"&&a(!1)},[]);re(()=>{if(!s)return;let c=p=>{let f=l.current;f&&!f.contains(p.target)&&a(!1)};return document.addEventListener("click",c,!0),()=>{document.removeEventListener("click",c,!0)}},[s]);let g=s&&t.items.length>0?o("div",{role:"menu","aria-label":t.label+" menu",style:{position:"absolute",top:"100%",left:"0",marginTop:"2px",backgroundColor:"var(--panel-bg, #2c2c2c)",border:"1px solid var(--panel-divider, #555555)",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",padding:"4px 0",minWidth:"180px",zIndex:"1000"}},...t.items.map((c,p)=>c.divider?o("div",{key:"div-"+String(p),role:"separator",style:{height:"1px",backgroundColor:"var(--panel-divider, #555555)",margin:"4px 0"}}):o("button",{key:String(p),type:"button",role:"menuitem",tabIndex:-1,disabled:c.disabled??!1,onClick:()=>{c.onClick&&c.onClick(),u()},style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"6px 16px",border:"none",outline:"none",backgroundColor:"transparent",color:c.disabled?"rgba(255,255,255,0.4)":"var(--panel-text, #ffffff)",fontFamily:"inherit",fontSize:"13px",textAlign:"left",cursor:c.disabled?"default":"pointer",boxSizing:"border-box"}},o("span",null,c.checked?"\u2713 ":"",c.label||""),c.shortcut?o("span",{style:{fontSize:"11px",opacity:"0.6",marginLeft:"16px"}},c.shortcut):null))):null;return o("div",{ref:l,className:"system-tray__app-menu",style:{position:"relative",display:"inline-flex",height:"100%"}},o("button",{type:"button","aria-haspopup":"true","aria-expanded":String(s),tabIndex:0,onClick:d,onKeyDown:h,onMouseEnter:r,onMouseLeave:i,style:{display:"inline-flex",alignItems:"center",padding:"0 10px",height:"100%",border:"none",outline:"none",backgroundColor:n||s?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",fontWeight:"500",cursor:"pointer",transition:"background-color 0.15s"}},t.label),g)}function Bn(e){let{activeAppName:t,activitiesButton:n,appMenuBar:r,clockFormat:i="24h",showSeconds:s=!0,showDate:a=!0,indicators:l,user:d,userMenuItems:u,height:h=28,children:g}=e,c=String(h)+"px",p=[];if(n&&p.push(o(Kl,{key:"activities",label:n.label,onClick:n.onClick})),t&&p.push(o("span",{key:"appname",style:{padding:"0 12px",fontSize:"13px",fontWeight:"700",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"200px"}},t)),r&&r.menus.length>0)for(let v=0;v<r.menus.length;v++)p.push(o(tc,{key:"appmenu-"+String(v),menu:r.menus[v]}));let f=o("div",{style:{display:"flex",alignItems:"center",height:"100%",flex:"1",minWidth:"0"}},...p),y=[];y.push(o(Zl,{key:"clock",format:i,showSeconds:s,showDate:a})),g&&y.push(g);let b=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}},...y),m=[];if(l&&l.length>0){let v=l.map(D=>o(Jl,{key:D.id,indicator:D}));m.push(o("div",{key:"indicators",style:{display:"flex",alignItems:"center",gap:"8px",height:"100%"}},...v))}d&&m.push(o(ec,{key:"user",user:d,menuItems:u}));let x=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",height:"100%",flex:"1",gap:"4px"}},...m);return o("div",{role:"menubar","aria-label":"System panel","data-theme":"dark",style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",height:c,backgroundColor:"var(--panel-bg, #2c2c2c)",color:"var(--panel-text, #ffffff)",fontFamily:"inherit",fontSize:"13px",boxSizing:"border-box",position:"relative"}},f,b,x)}function nc(e){return e.startsWith("http")||e.startsWith("/")||e.startsWith(".")}var ui=["#3465a4","#e67e22","#2ecc71","#3498db","#e74c3c","#9b59b6","#f39c12","#1abc9c","#e91e63","#00bcd4"];function oc(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return ui[Math.abs(t)%ui.length]}function rc(e){return e>99?"99+":String(e)}function ic(e){return e.badge&&e.badge>0?`${e.label}, ${e.badge} unread`:e.label}function sc(e){switch(e){case"left":return{left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px"};case"right":return{right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:"8px"};case"top":return{top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:"8px"};case"bottom":return{bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:"8px"};default:return{left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px"}}}function ac(e,t){return t==="vertical"?e==="right"?{position:"absolute",right:"0",top:"50%",transform:"translateY(-50%)"}:{position:"absolute",left:"0",top:"50%",transform:"translateY(-50%)"}:e==="bottom"?{position:"absolute",top:"0",left:"50%",transform:"translateX(-50%)"}:{position:"absolute",bottom:"0",left:"50%",transform:"translateX(-50%)"}}function lc(e){let{item:t,iconSize:n,position:r,orientation:i,onItemClick:s,onItemContextMenu:a}=e,[l,d]=j(!1),u=t.disabled??!1,h=S(()=>{u||d(!0)},[u]),g=S(()=>{d(!1)},[]),c=S(()=>{!u&&s&&s(t.id)},[u,s,t.id]),p=S(A=>{if(!u&&a){let M=A;M.preventDefault(),a(t.id,{x:M.clientX,y:M.clientY})}},[u,a,t.id]),f=`${n}px`,y=nc(t.icon)?o("img",{src:t.icon,alt:t.label,style:{width:f,height:f,objectFit:"contain",display:"block"}}):o("span",{style:{width:f,height:f,display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.round(n*.6)}px`,fontWeight:"700",userSelect:"none",backgroundColor:oc(t.icon),color:"#ffffff",borderRadius:"8px"},"aria-hidden":"true"},t.icon),b=t.badge!=null&&t.badge>0?o("span",{style:{position:"absolute",top:"0",right:"0",backgroundColor:"var(--dock-badge-bg, #e74c3c)",color:"#ffffff",fontSize:"9px",fontWeight:"700",lineHeight:"1",minWidth:"14px",height:"14px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"7px",padding:"0 3px",pointerEvents:"none",zIndex:"2"},"aria-hidden":"true"},rc(t.badge)):null,m=t.active?o("span",{style:{...ac(r,i),width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"var(--dock-active-color, #ffffff)",pointerEvents:"none",zIndex:"2"},"aria-hidden":"true"}):null,x=t.progress!=null&&t.progress>0?o("div",{style:{position:"absolute",bottom:"2px",left:"6px",right:"6px",height:"3px",backgroundColor:"rgba(255,255,255,0.2)",borderRadius:"2px",overflow:"hidden",pointerEvents:"none",zIndex:"2"},"aria-hidden":"true"},o("div",{style:{width:`${Math.min(1,Math.max(0,t.progress))*100}%`,height:"100%",backgroundColor:"var(--dock-progress-color, #3b82f6)",borderRadius:"2px",transition:"width 200ms ease"}})):null,v=l?o("div",{role:"tooltip",style:{position:"absolute",...sc(r),padding:"4px 10px",backgroundColor:"#1f2937",color:"#ffffff",fontSize:"12px",borderRadius:"4px",whiteSpace:"nowrap",zIndex:"1000",pointerEvents:"none"}},t.label):null,D={position:"relative",display:"flex",alignItems:"center",justifyContent:"center",padding:"6px",border:"none",backgroundColor:"transparent",cursor:u?"default":"pointer",opacity:u?"0.4":"1",pointerEvents:u?"none":"auto",transition:"transform 100ms, background-color 100ms",borderRadius:"8px",outline:"none",...l&&!u?{transform:"scale(1.1)",backgroundColor:"rgba(255,255,255,0.15)"}:{},...t.urgent&&!u?{animation:"dock-urgent-pulse 0.6s ease-in-out infinite alternate"}:{}};return o("button",{type:"button",role:"button",style:D,"aria-label":ic(t),"aria-pressed":t.active?"true":"false","aria-disabled":u?"true":void 0,tabIndex:u?-1:0,onClick:c,onContextMenu:p,onMouseEnter:h,onMouseLeave:g,"data-dock-item-id":t.id,"data-urgent":t.urgent?"true":void 0},y,b,m,x,v)}function Fn(e){let{items:t,orientation:n="vertical",position:r="left",iconSize:i=36,autoHide:s=!1,showTrailingSeparator:a=!1,onItemClick:l,onItemContextMenu:d,children:u}=e,[h,g]=j(!s),c=ne(null),p=S(()=>{s&&(c.current!=null&&(clearTimeout(c.current),c.current=null),g(!0))},[s]),f=S(()=>{s&&(c.current=setTimeout(()=>{g(!1)},300))},[s]),y=S(D=>{let A=D,M=A.target,T=M.closest('[role="toolbar"]');if(!T)return;let L=Array.from(T.querySelectorAll("button[data-dock-item-id]")),I=L.indexOf(M);if(I<0)return;let P=n==="vertical",B=P?"ArrowDown":"ArrowRight",E=P?"ArrowUp":"ArrowLeft";if(A.key===B){A.preventDefault();let N=L[I+1];N&&N.focus()}else if(A.key===E){A.preventDefault();let N=L[I-1];N&&N.focus()}else A.key==="Home"?(A.preventDefault(),L[0]?.focus()):A.key==="End"?(A.preventDefault(),L[L.length-1]?.focus()):(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),M.click())},[n]),b=n==="vertical",m={display:"flex",flexDirection:b?"column":"row",alignItems:"center",gap:"2px",padding:"4px",backgroundColor:"var(--dock-bg, rgba(0, 0, 0, 0.7))",color:"#ffffff",border:"1px solid var(--dock-border, rgba(255, 255, 255, 0.1))",borderRadius:"8px",boxSizing:"border-box",position:"relative",transition:"transform 200ms ease, opacity 200ms ease"};s&&!h&&(r==="left"?(m.transform="translateX(-100%)",m.opacity="0"):r==="right"?(m.transform="translateX(100%)",m.opacity="0"):r==="top"?(m.transform="translateY(-100%)",m.opacity="0"):r==="bottom"&&(m.transform="translateY(100%)",m.opacity="0"));let x=[];for(let D=0;D<t.length;D++){if(a&&D===t.length-1&&t.length>1){let A=b?{width:"60%",height:"1px",backgroundColor:"rgba(255,255,255,0.2)",margin:"4px auto",flexShrink:"0"}:{height:"60%",width:"1px",backgroundColor:"rgba(255,255,255,0.2)",margin:"auto 4px",flexShrink:"0"};x.push(o("div",{key:`sep-${D}`,style:A,"aria-hidden":"true",role:"separator"}))}x.push(o(lc,{key:t[D].id,item:t[D],iconSize:i,position:r,orientation:n,onItemClick:l,onItemContextMenu:d}))}let v=s&&!h?o("div",{style:{position:"absolute",...r==="left"?{left:"0",top:"0",width:"4px",height:"100%"}:{},...r==="right"?{right:"0",top:"0",width:"4px",height:"100%"}:{},...r==="top"?{top:"0",left:"0",height:"4px",width:"100%"}:{},...r==="bottom"?{bottom:"0",left:"0",height:"4px",width:"100%"}:{},zIndex:"10"},"aria-hidden":"true"}):null;return o("div",{role:"toolbar","aria-label":"Application launcher","aria-orientation":n,style:m,onMouseEnter:p,onMouseLeave:f,onKeyDown:y},v,...x,u??null)}var cc="#2c001e";function Nn(e){let{backgroundColor:t=cc,backgroundGradient:n,backgroundImage:r,backgroundImageOpacity:i=1,contextMenuItems:s,onClick:a,onDoubleClick:l,overflow:d="visible",children:u}=e,h=S(m=>{let x=m;x.target===x.currentTarget&&a&&a()},[a]),g=S(m=>{let x=m;x.target===x.currentTarget&&l&&l()},[l]),c=q(()=>{let m={position:"relative",width:"100%",height:"100%",overflow:d,cursor:"default",margin:"0",padding:"0"};return m.backgroundColor=t,n&&(m.background=n),r&&i>=1&&(m.backgroundImage=`url(${r})`,m.backgroundSize="cover",m.backgroundPosition="center"),m},[t,n,r,i]),p=q(()=>!r||i>=1?null:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",backgroundImage:`url(${r})`,backgroundSize:"cover",backgroundPosition:"center",opacity:String(i),pointerEvents:"none",zIndex:"0"},[r,i]),f={position:"relative",width:"100%",height:"100%",zIndex:"1"},y=[];p&&y.push(o("div",{className:"desktop-background__image-overlay",style:p,"aria-hidden":"true"})),y.push(o("div",{className:"desktop-background__content",style:f},u));let b=o("div",{className:"desktop-background",style:c,onClick:h,onDblClick:g,role:"application","aria-label":"Desktop workspace","data-theme":"dark"},...y);return s&&s.length>0?o(Ut,{items:s},b):b}var dc={width:200,height:150},uc={x:50,y:50},pc={width:400,height:300},We=8,Wn=20,fc={n:"n-resize",s:"s-resize",e:"e-resize",w:"w-resize",ne:"ne-resize",nw:"nw-resize",se:"se-resize",sw:"sw-resize"};function At(e){let{id:t,title:n,icon:r,defaultPosition:i=uc,defaultSize:s=pc,minSize:a=dc,maxSize:l,resizable:d=!0,draggable:u=!0,windowState:h="normal",focused:g=!0,zIndex:c,onClose:p,onMinimize:f,onMaximize:y,onFocus:b,onMove:m,onResize:x,children:v}=e,[D,A]=j(i.x),[M,T]=j(i.y),[L,I]=j(s.width),[P,B]=j(s.height),[E,N]=j(!1),[z,k]=j(!1),[w,$]=j(null),C=ne(null),F=ne(null),R=ne(null),W=S((oe,me)=>{let he=Math.max(oe,a.width),te=Math.max(me,a.height);return l&&(he=Math.min(he,l.width),te=Math.min(te,l.height)),{width:he,height:te}},[a,l]),_=S(()=>{let oe=R.current;return oe&&oe.parentElement?{width:oe.parentElement.clientWidth,height:oe.parentElement.clientHeight}:{width:window.innerWidth,height:window.innerHeight}},[]),O=S((oe,me,he,te)=>{let de=_(),ge=Math.max(0,Math.min(oe,de.width-he)),xe=Math.max(0,Math.min(me,de.height-te));return{x:ge,y:xe}},[_]),V=S(oe=>{if(!u||h==="maximized")return;let me=oe;me.target.closest("button")||(me.preventDefault(),C.current={startMouseX:me.clientX,startMouseY:me.clientY,startPosX:D,startPosY:M},N(!0))},[u,h,D,M]),X=S(oe=>{oe.target.closest("button")||y&&y()},[y]);re(()=>{if(!E)return;let oe=he=>{let te=he,de=C.current;if(!de)return;let ge=te.clientX-de.startMouseX,xe=te.clientY-de.startMouseY,ye=de.startPosX+ge,Me=de.startPosY+xe,ce=_();ye=Math.max(0,Math.min(ye,ce.width-L)),Me=Math.max(0,Math.min(Me,ce.height-P)),A(ye),T(Me),te.clientX<=Wn?$("left"):te.clientX>=ce.width-Wn?$("right"):te.clientY<=Wn?$("top"):$(null)},me=he=>{let te=he;N(!1);let de=_();if(w==="left"){A(0),T(0),I(Math.floor(de.width/2)),B(de.height),$(null),m&&m({x:0,y:0}),x&&x({width:Math.floor(de.width/2),height:de.height});return}if(w==="right"){let xe=Math.floor(de.width/2);A(xe),T(0),I(xe),B(de.height),$(null),m&&m({x:xe,y:0}),x&&x({width:xe,height:de.height});return}if(w==="top"){$(null),y&&y();return}$(null);let ge=C.current;if(ge&&m){let xe=te.clientX-ge.startMouseX,ye=te.clientY-ge.startMouseY,Me=ge.startPosX+xe,ce=ge.startPosY+ye;Me=Math.max(0,Math.min(Me,de.width-L)),ce=Math.max(0,Math.min(ce,de.height-P)),m({x:Me,y:ce})}C.current=null};return document.addEventListener("mousemove",oe),document.addEventListener("mouseup",me),()=>{document.removeEventListener("mousemove",oe),document.removeEventListener("mouseup",me)}},[E,w,L,P,_,m,x,y]);let ee=S(oe=>me=>{if(!d||h!=="normal")return;let he=me;he.preventDefault(),he.stopPropagation(),F.current={direction:oe,startMouseX:he.clientX,startMouseY:he.clientY,startPosX:D,startPosY:M,startWidth:L,startHeight:P},k(!0)},[d,h,D,M,L,P]);re(()=>{if(!z)return;let oe=he=>{let te=he,de=F.current;if(!de)return;let ge=te.clientX-de.startMouseX,xe=te.clientY-de.startMouseY,ye=de.direction,Me=de.startWidth,ce=de.startHeight,be=de.startPosX,Ee=de.startPosY;ye.includes("e")&&(Me=de.startWidth+ge),ye.includes("w")&&(Me=de.startWidth-ge,be=de.startPosX+ge),ye.includes("s")&&(ce=de.startHeight+xe),ye.includes("n")&&(ce=de.startHeight-xe,Ee=de.startPosY+xe);let Re=W(Me,ce);ye.includes("w")&&(be=de.startPosX+(de.startWidth-Re.width)),ye.includes("n")&&(Ee=de.startPosY+(de.startHeight-Re.height)),I(Re.width),B(Re.height),A(be),T(Ee)},me=()=>{k(!1),x&&x({width:L,height:P}),F.current=null};return document.addEventListener("mousemove",oe),document.addEventListener("mouseup",me),()=>{document.removeEventListener("mousemove",oe),document.removeEventListener("mouseup",me)}},[z,L,P,W,x]),re(()=>{if(!g||!p)return;let oe=me=>{me.key==="Escape"&&p()};return document.addEventListener("keydown",oe),()=>document.removeEventListener("keydown",oe)},[g,p]);let Z=S(oe=>{b&&b()},[b]);if(h==="minimized")return null;let U=h==="maximized",G=q(()=>{let oe={position:"absolute",display:"flex",flexDirection:"column",border:"1px solid var(--window-border, #555555)",borderRadius:U?"0":"6px",overflow:"hidden",backgroundColor:"var(--window-body-bg, #1e1e1e)",boxShadow:g?"0 8px 32px rgba(0, 0, 0, 0.4)":"0 4px 16px rgba(0, 0, 0, 0.2)",transition:U?"all 200ms ease":"box-shadow 200ms ease",outline:"none"};return U?(oe.top="0",oe.left="0",oe.width="100%",oe.height="100%"):(oe.top=`${M}px`,oe.left=`${D}px`,oe.width=`${L}px`,oe.height=`${P}px`),c!==void 0&&(oe.zIndex=String(c)),E&&(oe.cursor="grabbing",oe.userSelect="none"),oe},[U,D,M,L,P,c,g,E]),Y=q(()=>{let oe={display:"flex",alignItems:"center",padding:"0 8px",height:"32px",backgroundColor:"var(--window-title-bg, #2c2c2c)",color:"var(--window-title-text, #ffffff)",userSelect:"none",flexShrink:"0",cursor:u&&!U?"grab":"default",opacity:g?"1":"0.6"};return E&&(oe.cursor="grabbing"),oe},[g,u,U,E]),H={flex:"1",overflow:"auto",backgroundColor:"var(--window-body-bg, #1e1e1e)"},K={width:"14px",height:"14px",borderRadius:"50%",border:"none",cursor:"pointer",padding:"0",marginLeft:"6px",fontSize:"0",lineHeight:"0",display:"inline-flex",alignItems:"center",justifyContent:"center"},Q=[];r&&(r.startsWith("http")||r.startsWith("/")||r.startsWith("data:")?Q.push(o("img",{src:r,alt:"",style:{width:"16px",height:"16px",marginRight:"6px",flexShrink:"0"},className:"draggable-window__icon"})):Q.push(o("span",{style:{marginRight:"6px",fontSize:"14px",flexShrink:"0"},className:"draggable-window__icon"},r))),Q.push(o("span",{className:"draggable-window__title-text",style:{flex:"1",fontSize:"13px",fontWeight:"500",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},n));let ie=o("div",{style:{display:"flex",alignItems:"center",flexShrink:"0"},className:"draggable-window__controls"},o("button",{type:"button","aria-label":"Minimize",className:"draggable-window__btn-minimize",style:{...K,backgroundColor:"var(--window-button-minimize, #f39c12)"},onClick:oe=>{oe.stopPropagation(),f&&f()}}),o("button",{type:"button","aria-label":U?"Restore":"Maximize",className:"draggable-window__btn-maximize",style:{...K,backgroundColor:"var(--window-button-maximize, #2ecc71)"},onClick:oe=>{oe.stopPropagation(),y&&y()}}),o("button",{type:"button","aria-label":"Close",className:"draggable-window__btn-close",style:{...K,backgroundColor:"var(--window-button-close, #e74c3c)"},onClick:oe=>{oe.stopPropagation(),p&&p()}}));Q.push(ie);let J=[];if(d&&!U){let oe=["n","s","e","w","ne","nw","se","sw"];for(let me=0;me<oe.length;me++){let he=oe[me],te={position:"absolute",zIndex:"1"};he==="n"?(te.top="0",te.left=`${We}px`,te.right=`${We}px`,te.height=`${We}px`):he==="s"?(te.bottom="0",te.left=`${We}px`,te.right=`${We}px`,te.height=`${We}px`):he==="e"?(te.top=`${We}px`,te.right="0",te.bottom=`${We}px`,te.width=`${We}px`):he==="w"?(te.top=`${We}px`,te.left="0",te.bottom=`${We}px`,te.width=`${We}px`):he==="ne"?(te.top="0",te.right="0",te.width=`${We}px`,te.height=`${We}px`):he==="nw"?(te.top="0",te.left="0",te.width=`${We}px`,te.height=`${We}px`):he==="se"?(te.bottom="0",te.right="0",te.width=`${We}px`,te.height=`${We}px`):he==="sw"&&(te.bottom="0",te.left="0",te.width=`${We}px`,te.height=`${We}px`),te.cursor=fc[he],J.push(o("div",{className:`draggable-window__resize-handle draggable-window__resize-${he}`,style:te,onMouseDown:ee(he)}))}}let se=null;if(w){let oe={position:"fixed",backgroundColor:"rgba(66, 133, 244, 0.2)",border:"2px solid rgba(66, 133, 244, 0.5)",borderRadius:"4px",zIndex:"999999",pointerEvents:"none",transition:"all 150ms ease"};w==="left"?(oe.top="0",oe.left="0",oe.width="50%",oe.height="100%"):w==="right"?(oe.top="0",oe.right="0",oe.width="50%",oe.height="100%"):w==="top"&&(oe.top="0",oe.left="0",oe.width="100%",oe.height="100%"),se=o("div",{className:"draggable-window__snap-preview",style:oe})}let le=[];for(let oe=0;oe<J.length;oe++)le.push(J[oe]);le.push(o("div",{className:"draggable-window__title-bar",style:Y,onMouseDown:V,onDblClick:X,role:"toolbar","aria-label":`${n} window controls`},...Q)),le.push(o("div",{className:"draggable-window__body",style:H},v));let fe=[o("div",{ref:R,id:`draggable-window-${t}`,className:`draggable-window ${g?"draggable-window--focused":"draggable-window--unfocused"} draggable-window--${h}`,style:G,role:"dialog","aria-label":n,tabIndex:-1,onMouseDown:Z},...le)];return se&&fe.push(se),fe.length===1?fe[0]:o("div",{style:{display:"contents"}},...fe)}var gc=["File","Edit","View","Insert","Format","Tools","Help"],pi={File:[{label:"New",action:"new"},{label:"Open",action:"open"},{label:"Save",action:"save"},{label:"Print",action:"print"}],Edit:[{label:"Undo",action:"undo"},{label:"Redo",action:"redo"},{label:"Cut",action:"cut"},{label:"Copy",action:"copy"},{label:"Paste",action:"paste"}],View:[{label:"Zoom In",action:"zoomIn"},{label:"Zoom Out",action:"zoomOut"},{label:"Full Screen",action:"fullScreen"}],Insert:[{label:"Image",action:"insertImage"},{label:"Table",action:"insertTable"},{label:"Link",action:"insertLink"}],Format:[{label:"Bold",action:"bold"},{label:"Italic",action:"italic"},{label:"Underline",action:"underline"}],Tools:[{label:"Word Count",action:"wordCount"},{label:"Spell Check",action:"spellCheck"}],Help:[{label:"About",action:"about"},{label:"Keyboard Shortcuts",action:"shortcuts"}]},mc=[{id:"bold",label:"Bold",text:"B",shortcut:"Ctrl+B",style:{fontWeight:"700"}},{id:"italic",label:"Italic",text:"I",shortcut:"Ctrl+I",style:{fontStyle:"italic"}},{id:"underline",label:"Underline",text:"U",shortcut:"Ctrl+U",style:{textDecoration:"underline"}}],hc=[{label:"Align left",text:"\u2261",command:"justifyLeft"},{label:"Align center",text:"\u2263",command:"justifyCenter"},{label:"Align right",text:"\u2262",command:"justifyRight"}],bc=["1","2","3","4","5","6","7"],xc={1:"8",2:"10",3:"12",4:"14",5:"18",6:"24",7:"36"};function yc(){let e=[];for(let t=0;t<=20;t++){let n=t%2===0;e.push(o("div",{key:String(t),style:{position:"absolute",left:`${t/20*100}%`,bottom:"0",width:"1px",height:n?"10px":"5px",backgroundColor:"#999"}})),n&&e.push(o("span",{key:`l${t}`,style:{position:"absolute",left:`${t/20*100}%`,top:"1px",fontSize:"8px",color:"#666",transform:"translateX(-50%)"}},String(t/2)))}return e}function fi(e){return e.trim().split(/\s+/).filter(t=>t.length>0).length}function qt(e){let[t,n]=j(!1),[r,i]=j(!1),[s,a]=j(!1),[l,d]=j(-1),[u,h]=j(""),[g,c]=j(-1),[p,f]=j(0),[y,b]=j("3"),m=ne(null),x=S(()=>{document.execCommand("bold",!1),n(H=>!H),m.current&&m.current.focus()},[]),v=S(()=>{document.execCommand("italic",!1),i(H=>!H),m.current&&m.current.focus()},[]),D=S(()=>{document.execCommand("underline",!1),a(H=>!H),m.current&&m.current.focus()},[]),A={bold:x,italic:v,underline:D},M={bold:t,italic:r,underline:s},T=S(H=>{document.execCommand(H,!1),m.current&&m.current.focus()},[]),L=S(H=>{document.execCommand("fontSize",!1,H),b(H),m.current&&m.current.focus()},[]),I=S(H=>{c(K=>K===H?-1:H)},[]),P=S(H=>{switch(H){case"undo":document.execCommand("undo",!1);break;case"redo":document.execCommand("redo",!1);break;case"cut":document.execCommand("cut",!1);break;case"copy":document.execCommand("copy",!1);break;case"paste":document.execCommand("paste",!1);break;case"bold":document.execCommand("bold",!1);break;case"italic":document.execCommand("italic",!1);break;case"underline":document.execCommand("underline",!1);break;case"print":typeof window<"u"&&window.print&&window.print();break;case"new":m.current&&(m.current.innerHTML="",f(0));break;default:break}c(-1),m.current&&m.current.focus()},[]),B=S(()=>{if(m.current){let H=m.current.textContent??"";f(fi(H))}},[]),E=S(()=>{c(-1)},[]),N=q(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'"Segoe UI", Roboto, Arial, sans-serif',fontSize:"13px",color:"var(--color-text, #333)",backgroundColor:"#f0f0f0",overflow:"hidden"}),[]),z={display:"flex",alignItems:"center",height:"30px",backgroundColor:"var(--color-bg-subtle, #ffffff)",borderBottom:"1px solid var(--color-border, #d0d0d0)",padding:"0 8px",gap:"2px",flexShrink:"0",position:"relative"},k={display:"flex",alignItems:"center",height:"36px",backgroundColor:"var(--color-bg-subtle, #f8f9fa)",borderBottom:"1px solid var(--color-border, #d0d0d0)",padding:"0 12px",gap:"12px",flexShrink:"0"},w={height:"20px",backgroundColor:"#e8e8e8",borderBottom:"1px solid #ccc",position:"relative",flexShrink:"0",margin:"0 60px"},$={flex:"1",display:"flex",justifyContent:"center",alignItems:"flex-start",padding:"30px 40px",overflow:"auto",backgroundColor:"#e0e0e0",cursor:"text"},C={width:"680px",minHeight:"880px",backgroundColor:"#ffffff",boxShadow:"0 2px 12px rgba(0,0,0,0.18), 0 0 1px rgba(0,0,0,0.1)",padding:"72px 72px 96px 72px",boxSizing:"border-box",fontSize:"14px",lineHeight:"1.6",color:"#222",fontFamily:'"Times New Roman", Georgia, serif',cursor:"text",outline:"none"},F={height:"24px",backgroundColor:"var(--color-bg-subtle, #f0f0f0)",borderTop:"1px solid var(--color-border, #ccc)",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",fontSize:"11px",color:"#666",flexShrink:"0"},R=q(()=>yc(),[]),W=e.content??"Start typing...",_=fi(W),O=p>0?p:_;function V(H){return{padding:"4px 10px",cursor:"pointer",borderRadius:"3px",fontSize:"13px",color:"var(--color-text, #333)",backgroundColor:g===H?"rgba(0,0,0,0.12)":l===H?"rgba(0,0,0,0.08)":"transparent",border:"none",lineHeight:"1",transition:"background 0.15s",position:"relative"}}let X={position:"absolute",top:"100%",left:"0",minWidth:"160px",backgroundColor:"#ffffff",border:"1px solid #d0d0d0",borderRadius:"4px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",zIndex:"1000"},ee={display:"block",width:"100%",padding:"6px 16px",fontSize:"13px",color:"#333",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"};function Z(H,K){return{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid transparent",borderRadius:"3px",cursor:"pointer",fontSize:"13px",backgroundColor:M[H]??!1?"rgba(0,0,0,0.12)":u===H?"rgba(0,0,0,0.06)":"transparent",color:"var(--color-text, #444)",transition:"background 0.15s",...K??{}}}let U={display:"flex",alignItems:"center",padding:"2px 8px",border:"1px solid var(--color-border, #ccc)",borderRadius:"3px",fontSize:"12px",color:"var(--color-text, #444)",backgroundColor:"transparent",cursor:"default",height:"24px",gap:"4px"},G={padding:"2px 4px",border:"1px solid var(--color-border, #ccc)",borderRadius:"3px",fontSize:"12px",color:"var(--color-text, #444)",backgroundColor:"transparent",cursor:"pointer",height:"24px",outline:"none"},Y=gc.map((H,K)=>{let Q=[H];return g===K&&pi[H]&&Q.push(o("div",{key:"dropdown",style:X,className:"word-processor__menu-dropdown"},...pi[H].map((ie,J)=>o("button",{key:String(J),style:ee,onClick:se=>{se.stopPropagation(),P(ie.action)},role:"menuitem"},ie.label)))),o("button",{key:String(K),style:V(K),role:"menuitem","aria-label":H,onClick:()=>I(K),onMouseEnter:()=>{d(K)},onMouseLeave:()=>d(-1)},...Q)});return o("div",{className:`word-processor ${e.className??""}`.trim(),style:N},o("div",{className:"word-processor__menu-bar",style:z,role:"menubar"},...Y),o("div",{className:"word-processor__toolbar",style:k,role:"toolbar","aria-label":"Formatting toolbar"},o("div",{style:U,"aria-label":"Font family"},o("span",null,"Arial"),o("span",{style:{fontSize:"10px",color:"#999"}},"\u25BC")),o("div",{key:"0",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},...mc.map(H=>o("button",{key:H.id,style:Z(H.id,H.style),title:H.shortcut?`${H.label} (${H.shortcut})`:H.label,"aria-label":H.label,"aria-pressed":String(M[H.id]??!1),onClick:A[H.id],onMouseEnter:()=>h(H.id),onMouseLeave:()=>h("")},H.text))),o("div",{key:"1",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px",alignItems:"center"}},o("select",{style:G,"aria-label":"Font size",value:y,onChange:H=>{let K=H.target;L(K.value)}},...bc.map(H=>o("option",{key:H,value:H},xc[H])))),o("div",{key:"2",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},...hc.map((H,K)=>o("button",{key:String(K),style:Z(`align-${K}`),title:H.label,"aria-label":H.label,onClick:()=>T(H.command),onMouseEnter:()=>h(`align-${K}`),onMouseLeave:()=>h("")},H.text)))),o("div",{className:"word-processor__ruler",style:w,"aria-hidden":"true"},...R),o("main",{className:"word-processor__document-area",style:$,onClick:E},o("div",{className:"word-processor__page",style:C,contentEditable:"true",ref:m,onInput:B,suppressContentEditableWarning:!0},W)),o("div",{className:"word-processor__status-bar",style:F},o("span",null,"Page 1 of 1"),o("span",null,`${O} words`),o("span",null,"100%")))}var Sc=["File","Edit","Selection","View","Go","Run","Terminal","Help"],gi={File:[{label:"New File",action:"newFile"},{label:"Open",action:"open"},{label:"Save",action:"save"},{label:"Save As",action:"saveAs"}],Edit:[{label:"Undo",action:"undo"},{label:"Redo",action:"redo"},{label:"Cut",action:"cut"},{label:"Copy",action:"copy"},{label:"Paste",action:"paste"}],View:[{label:"Command Palette",action:"commandPalette"},{label:"Explorer",action:"explorer"},{label:"Search",action:"search"}]},mi=[{name:"src",indent:0,isFolder:!0},{name:"components",indent:1,isFolder:!0,parent:"src"},{name:"App.ts",indent:2,isFolder:!1,parent:"components"},{name:"Header.ts",indent:2,isFolder:!1,parent:"components"},{name:"hooks",indent:1,isFolder:!0,parent:"src"},{name:"useAuth.ts",indent:2,isFolder:!1,parent:"hooks"},{name:"index.ts",indent:1,isFolder:!1,parent:"src"},{name:"main.ts",indent:1,isFolder:!1,parent:"src"},{name:"types.ts",indent:1,isFolder:!1,parent:"src"},{name:"package.json",indent:0,isFolder:!1},{name:"tsconfig.json",indent:0,isFolder:!1}],On={"App.ts":['import { createElement, useState } from "specifyjs";',"","interface AppProps {"," title: string;"," version?: number;","}","","export function App(props: AppProps) {"," const [count, setCount] = useState(0);",""," const increment = () => {"," setCount((prev: number) => prev + 1);"," };",""," return createElement(",' "div",',' { className: "app" },',' createElement("h1", null, props.title),',' createElement("p", null, `Count: ${count}`),'," createElement(",' "button",'," { onClick: increment },",' "Increment",'," ),"," );","}"],"Header.ts":['import { createElement } from "specifyjs";',"","interface HeaderProps {"," title: string;"," subtitle?: string;","}","","export function Header(props: HeaderProps) {"," return createElement(",' "header",',' { className: "header" },',' createElement("h1", null, props.title),'," props.subtitle",' ? createElement("p", null, props.subtitle)'," : null,"," );","}"],"useAuth.ts":['import { useState, useCallback } from "specifyjs";',"","interface AuthState {"," user: string | null;"," isLoggedIn: boolean;","}","","export function useAuth() {"," const [auth, setAuth] = useState<AuthState>({"," user: null,"," isLoggedIn: false,"," });",""," const login = useCallback((username: string) => {"," setAuth({ user: username, isLoggedIn: true });"," }, []);",""," const logout = useCallback(() => {"," setAuth({ user: null, isLoggedIn: false });"," }, []);",""," return { ...auth, login, logout };","}"],"index.ts":['export { App } from "./components/App";','export { Header } from "./components/Header";','export { useAuth } from "./hooks/useAuth";'],"main.ts":['import { createElement, createRoot } from "specifyjs";','import { App } from "./components/App";',"","const root = createRoot(",' document.getElementById("root")!',");","","root.render("," createElement(App, {",' title: "My SpecifyJS App",'," version: 1,"," }),",");"],"types.ts":["export interface User {"," id: string;"," name: string;"," email: string;",' role: "admin" | "user" | "guest";',"}","","export interface Config {"," apiUrl: string;"," debug: boolean;"," maxRetries: number;","}","","export type EventHandler<T = void> = (event: T) => void;"],"package.json":["{",' "name": "specifyjs-app",',' "version": "1.0.0",',' "scripts": {',' "dev": "vite",',' "build": "tsc && vite build",',' "preview": "vite preview"'," }","}"],"tsconfig.json":["{",' "compilerOptions": {',' "target": "ES2020",',' "module": "ESNext",',' "strict": true,',' "jsx": "preserve"'," },",' "include": ["src"]',"}"]},hi=On["App.ts"],vc=new Set(["import","export","from","const","let","var","function","return","if","else","for","while","class","new","throw","try","catch","finally","typeof","instanceof","in","of","default","switch","case","break","continue","do","void","delete","yield","async","await"]),wc=new Set(["string","number","boolean","void","null","undefined","any","never","unknown","object","interface","type","enum"]),bi="#569cd6",kc="#ce9178",Cc="#4ec9b0",Mc="#6a9955",Ec="#dcdcaa",_n="#d4d4d4",Ic="#d4d4d4",Rc="#b5cea8";function Pc(e){if(!e.trim())return[{text:"\xA0",color:_n}];let t=[],n=0;for(;n<e.length;){if(e[n]==="/"&&e[n+1]==="/"){t.push({text:e.slice(n),color:Mc});break}if(e[n]==='"'||e[n]==="'"||e[n]==="`"){let r=e[n],i=n+1;for(;i<e.length&&e[i]!==r;)e[i]==="\\"&&i++,i++;i=Math.min(i+1,e.length),t.push({text:e.slice(n,i),color:kc}),n=i;continue}if(/[0-9]/.test(e[n])&&(n===0||/[\s(,=:[\]{}+\-*/]/.test(e[n-1]))){let r=n;for(;r<e.length&&/[0-9.]/.test(e[r]);)r++;t.push({text:e.slice(n,r),color:Rc}),n=r;continue}if(/[a-zA-Z_$]/.test(e[n])){let r=n;for(;r<e.length&&/[a-zA-Z0-9_$]/.test(e[r]);)r++;let i=e.slice(n,r),s=r;for(;s<e.length&&e[s]===" ";)s++;let a=s<e.length&&e[s]==="(",l=_n;vc.has(i)?l=bi:wc.has(i)?l=Cc:a?l=Ec:(i==="true"||i==="false")&&(l=bi),t.push({text:i,color:l}),n=r;continue}if(e[n]===" "||e[n]===" "){let r=n;for(;r<e.length&&(e[r]===" "||e[r]===" ");)r++;t.push({text:e.slice(n,r),color:_n}),n=r;continue}t.push({text:e[n],color:Ic}),n++}return t}function Kt(e){let[t,n]=j("App.ts"),[r,i]=j({src:!0,components:!0,hooks:!0}),[s,a]=j(-1),[l,d]=j(hi.length),u=ne(null),h=S(Y=>{n(Y);let H=On[Y];H&&d(H.length)},[]),g=S(Y=>{i(H=>{let K={},Q=Object.keys(H);for(let ie=0;ie<Q.length;ie++)K[Q[ie]]=H[Q[ie]];return K[Y]=!H[Y],K})},[]),c=S(Y=>{a(H=>H===Y?-1:Y)},[]),p=S(Y=>{switch(Y){case"undo":document.execCommand("undo",!1);break;case"redo":document.execCommand("redo",!1);break;case"cut":document.execCommand("cut",!1);break;case"copy":document.execCommand("copy",!1);break;case"paste":document.execCommand("paste",!1);break;case"newFile":u.current&&(u.current.textContent="",d(1));break;default:break}a(-1),u.current&&u.current.focus()},[]),f=S(()=>{if(u.current){let H=(u.current.textContent??"").split(`
|
|
8
|
-
`);d(Math.max(H.length,1))}},[]),y=q(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'"Segoe UI", Roboto, Arial, sans-serif',fontSize:"13px",color:"#cccccc",backgroundColor:"#1e1e1e",overflow:"hidden"}),[]),b={height:"30px",backgroundColor:"#323233",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",color:"#999",flexShrink:"0",borderBottom:"1px solid var(--color-border, #252526)"},m={height:"28px",backgroundColor:"#3c3c3c",display:"flex",alignItems:"center",padding:"0 8px",gap:"2px",flexShrink:"0",position:"relative"},x={padding:"3px 8px",fontSize:"12px",color:"#cccccc",cursor:"pointer",borderRadius:"3px",backgroundColor:"transparent",border:"none",position:"relative"},v={...x,backgroundColor:"rgba(255,255,255,0.1)"},D={position:"absolute",top:"100%",left:"0",minWidth:"180px",backgroundColor:"#2d2d2d",border:"1px solid #454545",borderRadius:"4px",boxShadow:"0 4px 12px rgba(0,0,0,0.4)",padding:"4px 0",zIndex:"1000"},A={display:"block",width:"100%",padding:"6px 16px",fontSize:"12px",color:"#cccccc",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"},M={flex:"1",display:"flex",overflow:"hidden"},T={width:"220px",backgroundColor:"#252526",borderRight:"none",display:"flex",flexDirection:"column",flexShrink:"0",overflowY:"auto"},L={width:"1px",backgroundColor:"#007acc",cursor:"col-resize",flexShrink:"0",opacity:"0.4",transition:"opacity 0.2s"},I={padding:"8px 12px",fontSize:"11px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#bbbbbb"},P=(Y,H,K)=>({padding:"3px 8px",paddingLeft:`${12+Y*16}px`,fontSize:"13px",cursor:"pointer",color:H?"#cccccc":"#d4d4d4",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",borderRadius:"3px",margin:"0 4px",transition:"background-color 0.1s",backgroundColor:K?"rgba(255,255,255,0.08)":"transparent"}),B={flex:"1",display:"flex",flexDirection:"column",overflow:"hidden"},E={height:"35px",backgroundColor:"#252526",display:"flex",alignItems:"center",flexShrink:"0"},N={padding:"0 16px",height:"35px",lineHeight:"35px",backgroundColor:"#1e1e1e",color:"#ffffff",fontSize:"13px",cursor:"pointer",border:"none",borderBottom:"2px solid #007acc",boxSizing:"border-box"},z={flex:"1",display:"flex",overflow:"auto",backgroundColor:"#1e1e1e",fontFamily:'"Cascadia Code", "Fira Code", "Consolas", monospace',fontSize:"13px",lineHeight:"20px"},k={padding:"8px 0",textAlign:"right",color:"#858585",userSelect:"none",minWidth:"48px",paddingRight:"12px",paddingLeft:"12px",flexShrink:"0"},w={padding:"8px 0",flex:"1",whiteSpace:"pre",overflowX:"auto",outline:"none",color:"#d4d4d4"},$={width:"60px",backgroundColor:"#1e1e1e",borderLeft:"1px solid var(--color-border, #252526)",flexShrink:"0",padding:"8px 4px",display:"flex",flexDirection:"column",gap:"2px",position:"relative"},C={height:"22px",backgroundColor:"#007acc",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 12px",fontSize:"12px",color:"#ffffff",flexShrink:"0"},F={cursor:"pointer",padding:"0 6px",borderRadius:"3px",transition:"background-color 0.15s"},R=8,W=30,_=On[t]??hi,O=_.map((Y,H)=>{let K=Pc(Y),Q=[],ie=0;for(let J of K)Q.push(o("span",{key:String(ie++),style:{color:J.color}},J.text));return o("div",{key:String(H),style:{minHeight:"20px"}},...Q)}),V=Math.max(l,_.length),X=[];for(let Y=0;Y<V;Y++)X.push(o("div",{key:String(Y)},String(Y+1)));let ee=Y=>{if(!Y.parent)return!0;if(!r[Y.parent])return!1;let H=mi.find(K=>K.name===Y.parent&&K.isFolder);return H?ee(H):!0},Z=Sc.map((Y,H)=>{let K=[Y],Q=s===H;return Q&&gi[Y]&&K.push(o("div",{key:"dropdown",style:D,className:"ide__menu-dropdown"},...gi[Y].map((ie,J)=>o("button",{key:String(J),style:A,onClick:se=>{se.stopPropagation(),p(ie.action)},role:"menuitem"},ie.label)))),o("button",{key:String(H),style:Q?v:x,role:"menuitem","aria-label":Y,onClick:()=>c(H)},...K)}),G=mi.map((Y,H)=>{if(!ee(Y))return null;let K=!Y.isFolder&&Y.name===t,Q=Y.isFolder?r[Y.name]?"\u{1F4C2} ":"\u{1F4C1} ":"\u{1F4C4} ";return o("div",{key:String(H),style:P(Y.indent,Y.isFolder,K),onClick:Y.isFolder?()=>g(Y.name):()=>h(Y.name)},Q,Y.name)}).filter(Y=>Y!==null);return o("div",{className:`ide ${e.className??""}`.trim(),style:y},o("div",{className:"ide__title-bar",style:b},"SpecifyJS IDE"),o("div",{className:"ide__menu-bar",style:m,role:"menubar"},...Z),o("div",{style:M},o("nav",{className:"ide__sidebar",style:T,"aria-label":"File explorer"},o("div",{style:I},"Explorer"),...G),o("div",{style:L}),o("div",{style:B},o("div",{style:E},o("button",{style:N,"aria-label":t},t)),o("div",{style:z},o("div",{style:k,"aria-hidden":"true"},...X),o("code",{style:w,contentEditable:"true",ref:u,onInput:f,suppressContentEditableWarning:!0},...O))),o("div",{className:"ide__minimap",style:$,"aria-hidden":"true"},o("div",{style:{position:"absolute",top:`${R}px`,left:"0",right:"0",height:`${W}px`,backgroundColor:"rgba(100, 100, 200, 0.15)",border:"1px solid rgba(100, 100, 200, 0.3)",borderRadius:"2px",pointerEvents:"none"}}),..._.map((Y,H)=>o("div",{key:String(H),style:{height:"2px",backgroundColor:Y.trim()?"#555555":"transparent",borderRadius:"1px",width:`${Math.min(100,Y.length*2)}%`}})))),o("div",{className:"ide__status-bar",style:C},o("div",{style:{display:"flex",gap:"16px"}},o("span",{style:F},"\u2387 main"),o("span",{style:F},"0 errors"),o("span",{style:F},"0 warnings")),o("div",{style:{display:"flex",gap:"16px"}},o("span",{style:F},"Ln 1, Col 1"),o("span",{style:F},"UTF-8"),o("span",{style:F},"TypeScript"))))}var $c=[{symbol:"AAPL",price:189.42,change:1.23,volume:523e5,spark:[186,187,188,187,189]},{symbol:"GOOGL",price:141.8,change:-.87,volume:231e5,spark:[143,142,141,142,141]},{symbol:"MSFT",price:378.91,change:2.45,volume:187e5,spark:[375,376,378,377,379]},{symbol:"AMZN",price:185.63,change:-1.12,volume:314e5,spark:[187,186,186,185,185]},{symbol:"TSLA",price:248.5,change:3.78,volume:672e5,spark:[244,245,247,246,249]},{symbol:"NVDA",price:875.3,change:12.5,volume:418e5,spark:[860,865,870,868,876]}],xi=[{price:189.4,qty:1200},{price:189.38,qty:3400},{price:189.35,qty:800},{price:189.32,qty:5600},{price:189.3,qty:2100},{price:189.28,qty:4300}],yi=[{price:189.44,qty:900},{price:189.47,qty:2200},{price:189.5,qty:1500},{price:189.53,qty:3800},{price:189.55,qty:1100},{price:189.58,qty:2700}],Si=[{symbol:"AAPL",qty:100,avgPrice:185.2,currentPrice:189.42,pnl:422},{symbol:"MSFT",qty:50,avgPrice:382.1,currentPrice:378.91,pnl:-159.5},{symbol:"NVDA",qty:25,avgPrice:850,currentPrice:875.3,pnl:632.5}],Tc=[{time:"14:32:01",symbol:"AAPL",side:"BUY",qty:50,price:189.42},{time:"14:31:45",symbol:"MSFT",side:"SELL",qty:25,price:378.95},{time:"14:30:22",symbol:"TSLA",side:"BUY",qty:100,price:247.8},{time:"14:29:58",symbol:"NVDA",side:"BUY",qty:10,price:874.5},{time:"14:28:33",symbol:"GOOGL",side:"SELL",qty:75,price:142.1}],Dc=[185.2,186.1,185.8,187.5,188.2,187.9,186.5,187.8,188.4,189.1,188.6,187.2,188.5,189.8,189.2,188.9,189.5,190.1,189.4,188.8,189.6,190.3,189.9,189.42],vi=[{price:189.4,volume:1200},{price:189.35,volume:3400},{price:189.3,volume:2800},{price:189.25,volume:5100},{price:189.2,volume:4200}],wi=[{price:189.45,volume:900},{price:189.5,volume:2600},{price:189.55,volume:1800},{price:189.6,volume:4400},{price:189.65,volume:3100}],ki=["09:30","10:00","10:30","11:00","11:30","12:00"];function zc(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function Lt(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function Ge(e){return e.toFixed(2)}var wt={backgroundColor:"#1a1a2e",borderRadius:"4px",padding:"12px",border:"1px solid #2a2a4a",overflow:"auto",display:"flex",flexDirection:"column"},kt={fontSize:"12px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#8888aa",marginBottom:"8px",flexShrink:"0"},Zt={width:"100%",borderCollapse:"collapse",fontSize:"12px"},Oe={textAlign:"left",padding:"4px 6px",borderBottom:"1px solid #2a2a4a",color:"#8888aa",fontWeight:"600",fontSize:"11px"},He={padding:"3px 6px",borderBottom:"1px solid #16162a",color:"#ccccdd",fontSize:"12px"},Jt={cursor:"default",transition:"background-color 0.1s"};function Ac(e,t){let i=Math.min(...e),a=Math.max(...e)-i||1,l=e.map((u,h)=>{let g=h/(e.length-1)*40,c=14-(u-i)/a*14;return`${g.toFixed(1)},${c.toFixed(1)}`}).join(" ");return o("svg",{viewBox:"0 0 40 14",style:{width:"40px",height:"14px",display:"inline-block",verticalAlign:"middle",marginLeft:"4px"},"aria-hidden":"true"},o("polyline",{points:l,fill:"none",stroke:t?"#00c853":"#ff1744",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))}function Lc(e,t){let u=Math.min(...e),h=Math.max(...e),g=h-u||1,c=310/(e.length-1),p=e.map((M,T)=>{let L=40+T*c,I=15+(1-(M-u)/g)*120;return{x:L,y:I}}),f=p.map(M=>`${M.x.toFixed(1)},${M.y.toFixed(1)}`).join(" "),y="M40,135 "+p.map(M=>`L${M.x.toFixed(1)},${M.y.toFixed(1)}`).join(" ")+` L${p[p.length-1].x.toFixed(1)},135 Z`,b=[];for(let M=1;M<e.length;M++){let T=e[M]>=e[M-1]?"#00c853":"#ff1744";b.push(o("line",{key:String(M),x1:String(p[M-1].x.toFixed(1)),y1:String(p[M-1].y.toFixed(1)),x2:String(p[M].x.toFixed(1)),y2:String(p[M].y.toFixed(1)),stroke:T,strokeWidth:"2",strokeLinecap:"round"}))}let m=[];for(let M=0;M<5;M++){let T=15+M/4*120,L=h-M/4*g;m.push(o("line",{key:`g${M}`,x1:String(40),y1:String(T.toFixed(1)),x2:String(350),y2:String(T.toFixed(1)),stroke:"#2a2a4a",strokeWidth:"0.5",strokeDasharray:"3,3"})),m.push(o("text",{key:`yl${M}`,x:String(36),y:String((T+3).toFixed(1)),fill:"#6666aa",fontSize:"8",textAnchor:"end",fontFamily:"monospace"},Ge(L)))}let x=[],v=Math.min(ki.length,e.length),D=(e.length-1)/(v-1);for(let M=0;M<v;M++){let L=40+Math.round(M*D)*c;x.push(o("text",{key:`tl${M}`,x:String(L.toFixed(1)),y:String(156),fill:"#6666aa",fontSize:"8",textAnchor:"middle",fontFamily:"monospace"},ki[M]))}let A="chartGrad";return o("div",{style:wt},o("div",{style:kt},"AAPL ",o("span",{style:{color:"#00c853",fontSize:"14px",fontWeight:"700"}},`$${Ge(t)}`),o("span",{style:{color:"#00c853",fontSize:"11px",marginLeft:"8px"}},"+1.23%")),o("svg",{viewBox:"0 0 360 160",style:{width:"100%",flex:"1",minHeight:"0"},"aria-label":"Price chart",role:"img"},o("defs",null,o("linearGradient",{id:A,x1:"0",y1:"0",x2:"0",y2:"1"},o("stop",{offset:"0%",stopColor:"#00c853",stopOpacity:"0.3"}),o("stop",{offset:"100%",stopColor:"#00c853",stopOpacity:"0.02"}))),o("path",{d:y,fill:`url(#${A})`}),...m,...x,...b,o("line",{x1:String(40),y1:String((15+(1-(t-u)/g)*120).toFixed(1)),x2:String(350),y2:String((15+(1-(t-u)/g)*120).toFixed(1)),stroke:"#00c853",strokeWidth:"0.5",strokeDasharray:"4,2",opacity:"0.6"})))}function Bc(){let e=Math.max(...xi.map(t=>t.qty),...yi.map(t=>t.qty));return o("div",{style:wt},o("div",{style:kt},"Order Book"),o("table",{style:Zt},o("thead",null,o("tr",null,o("th",{style:Oe},"Bid Price"),o("th",{style:Oe},"Qty"),o("th",{style:Oe},"Ask Price"),o("th",{style:Oe},"Qty"))),o("tbody",null,...xi.map((t,n)=>{let r=yi[n],i=t.qty/e*.25,s=(r?.qty??0)/e*.25;return o("tr",{key:String(n),style:Jt},o("td",{style:{...He,color:"#00c853",backgroundColor:`rgba(0,200,83,${i.toFixed(3)})`,fontFamily:"monospace"}},Ge(t.price)),o("td",{style:{...He,backgroundColor:`rgba(0,200,83,${(i*.5).toFixed(3)})`,fontFamily:"monospace"}},Lt(t.qty)),o("td",{style:{...He,color:"#ff1744",backgroundColor:`rgba(255,23,68,${s.toFixed(3)})`,fontFamily:"monospace"}},r?Ge(r.price):""),o("td",{style:{...He,backgroundColor:`rgba(255,23,68,${(s*.5).toFixed(3)})`,fontFamily:"monospace"}},r?Lt(r.qty):""))}))))}function Fc(e){return o("div",{style:wt},o("div",{style:kt},"Watchlist"),o("table",{style:Zt},o("thead",null,o("tr",null,o("th",{style:Oe},"Symbol"),o("th",{style:Oe},"Price"),o("th",{style:Oe},"Chg%"),o("th",{style:Oe},"Volume"))),o("tbody",null,...$c.map((t,n)=>{let r=t.price+(n===0?e:0),i=t.change>=0;return o("tr",{key:String(n),style:Jt},o("td",{style:{...He,fontWeight:"600",color:"#ffffff"}},t.symbol,Ac(t.spark,i)),o("td",{style:{...He,fontFamily:"monospace"}},Ge(r)),o("td",{style:{...He,color:i?"#00c853":"#ff1744",fontWeight:"600"}},`${i?"+":""}${Ge(t.change)}%`),o("td",{style:{...He,fontFamily:"monospace",color:"#8888aa"}},zc(t.volume)))}))))}function Nc(){let e=Si.reduce((n,r)=>n+r.pnl,0),t=e>=0;return o("div",{style:wt},o("div",{style:kt},"Positions",o("span",{style:{marginLeft:"12px",color:t?"#00c853":"#ff1744",fontWeight:"700",fontSize:"12px"}},`${t?"+":""}$${Ge(e)}`)),o("table",{style:Zt},o("thead",null,o("tr",null,o("th",{style:Oe},"Symbol"),o("th",{style:Oe},"Qty"),o("th",{style:Oe},"Avg"),o("th",{style:Oe},"P&L"))),o("tbody",null,...Si.map((n,r)=>{let i=n.pnl>=0;return o("tr",{key:String(r),style:{...Jt,backgroundColor:i?"rgba(0,200,83,0.04)":"rgba(255,23,68,0.04)"}},o("td",{style:{...He,fontWeight:"600",color:"#ffffff"}},n.symbol),o("td",{style:{...He,fontFamily:"monospace"}},String(n.qty)),o("td",{style:{...He,fontFamily:"monospace"}},Ge(n.avgPrice)),o("td",{style:{...He,color:i?"#00c853":"#ff1744",fontWeight:"700",fontFamily:"monospace"}},`${i?"+":""}$${Ge(n.pnl)}`))}))))}function Wc(){return o("div",{style:wt},o("div",{style:kt},"Recent Trades"),o("table",{style:Zt},o("thead",null,o("tr",null,o("th",{style:Oe},"Time"),o("th",{style:Oe},"Sym"),o("th",{style:Oe},"Side"),o("th",{style:Oe},"Qty"),o("th",{style:Oe},"Price"))),o("tbody",null,...Tc.map((e,t)=>{let n=e.side==="BUY";return o("tr",{key:String(t),style:Jt},o("td",{style:{...He,color:"#8888aa",fontFamily:"monospace"}},e.time),o("td",{style:{...He,fontWeight:"600",color:"#ffffff"}},e.symbol),o("td",{style:{...He,color:n?"#00c853":"#ff1744",fontWeight:"600"}},e.side),o("td",{style:{...He,fontFamily:"monospace"}},Lt(e.qty)),o("td",{style:{...He,fontFamily:"monospace"}},Ge(e.price)))}))))}function _c(){let e=Math.max(...vi.map(n=>n.volume),...wi.map(n=>n.volume)),t="16px";return o("div",{style:wt},o("div",{style:kt},"Market Depth"),o("div",{style:{flex:"1",display:"flex",flexDirection:"column",gap:"2px",justifyContent:"center"}},...vi.map((n,r)=>o("div",{key:`b${r}`,style:{display:"flex",alignItems:"center",gap:"6px"}},o("span",{style:{width:"52px",fontSize:"11px",color:"#8888aa",textAlign:"right",fontFamily:"monospace"}},Ge(n.price)),o("div",{style:{height:t,width:`${n.volume/e*100}%`,backgroundColor:"#00c853",opacity:"0.6",borderRadius:"2px",maxWidth:"60%",transition:"width 0.3s"}}),o("span",{style:{fontSize:"11px",color:"#ccccdd",fontFamily:"monospace"}},Lt(n.volume)))),o("div",{style:{height:"1px",backgroundColor:"#2a2a4a",margin:"4px 0"}}),...wi.map((n,r)=>o("div",{key:`a${r}`,style:{display:"flex",alignItems:"center",gap:"6px"}},o("span",{style:{width:"52px",fontSize:"11px",color:"#8888aa",textAlign:"right",fontFamily:"monospace"}},Ge(n.price)),o("div",{style:{height:t,width:`${n.volume/e*100}%`,backgroundColor:"#ff1744",opacity:"0.6",borderRadius:"2px",maxWidth:"60%",transition:"width 0.3s"}}),o("span",{style:{fontSize:"11px",color:"#ccccdd",fontFamily:"monospace"}},Lt(n.volume))))))}function Qt(e){let[t,n]=j(0),[r,i]=j("--:--:--"),[s,a]=j(!0);re(()=>{let p=setInterval(()=>{n(f=>{let y=(Math.random()-.5)*.5;return Math.round(y*100)/100})},2e3);return()=>clearInterval(p)},[]),re(()=>{let p=()=>{let y=new Date,b=String(y.getHours()).padStart(2,"0"),m=String(y.getMinutes()).padStart(2,"0"),x=String(y.getSeconds()).padStart(2,"0");i(`${b}:${m}:${x}`)};p();let f=setInterval(p,1e3);return()=>clearInterval(f)},[]),re(()=>{let p=setInterval(()=>{a(f=>!f)},800);return()=>clearInterval(p)},[]);let l=q(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'"Inter", "Segoe UI", Roboto, sans-serif',fontSize:"13px",color:"#ccccdd",backgroundColor:"#0d0d1a",overflow:"hidden"}),[]),d={height:"40px",backgroundColor:"#12122a",borderBottom:"1px solid #2a2a4a",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",flexShrink:"0"},u={fontSize:"14px",fontWeight:"700",color:"#ffffff",letterSpacing:"0.5px",display:"flex",alignItems:"center",gap:"8px"},h={flex:"1",display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gridTemplateRows:"1fr 1fr",gap:"8px",padding:"8px",overflow:"hidden"},g=189.42+t,c={width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"#00c853",display:"inline-block",marginRight:"4px",opacity:s?"1":"0.3",transition:"opacity 0.3s"};return o("div",{className:`trading-dashboard ${e.className??""}`.trim(),style:l},o("header",{className:"trading-dashboard__header",style:d},o("span",{style:u},"SpecifyJS Trading Platform",o("span",{style:{display:"flex",alignItems:"center",fontSize:"11px",color:"#00c853",fontWeight:"600",marginLeft:"8px"}},o("span",{style:c}),"LIVE")),o("div",{style:{display:"flex",alignItems:"center",gap:"16px",fontSize:"12px"}},o("span",{style:{color:"#ffffff",fontFamily:"monospace",fontWeight:"600",fontSize:"13px"}},r),o("span",{style:{color:"#8888aa"}},"Account: SJS-28401"),o("span",{style:{color:"#00c853"}},"Balance: $124,582.30"),o("span",{style:{color:"#8888aa"}},"Status: Connected"))),o("div",{className:"trading-dashboard__grid",style:h},Lc(Dc,g),Bc(),Fc(t),Nc(),Wc(),_c()))}function Fe(e){return e.type==="card"}function Ae(e){return e.type==="container"}function et(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function Ke(e){return Fe(e)?e.card_id:e.container_id}var Oc={low:"#22c55e",medium:"#f59e0b",high:"#f97316",critical:"#ef4444"},Hn=[{label:"Text",value:"text"},{label:"JSON",value:"json"},{label:"Task",value:"task"},{label:"Project",value:"project"}];function Hc(e){let t=e.content;return o("div",{style:{fontSize:"12px",color:"#555555",lineHeight:"1.4",overflow:"hidden",flex:"1"},"data-testid":`card-text-content-${e.card_id}`},t.text||"")}function Yc(e){let t=e.content,r=Object.entries(t).map(([i,s],a)=>o("div",{key:String(a),style:{display:"flex",gap:"4px",fontSize:"11px",lineHeight:"1.6",borderBottom:"1px solid rgba(0,0,0,0.05)",padding:"2px 0"}},o("span",{style:{fontWeight:"600",color:"#374151",minWidth:"60px"}},`${i}:`),o("span",{style:{color:"#555555"}},String(s??""))));return o("div",{style:{flex:"1",overflow:"auto"},"data-testid":`card-json-content-${e.card_id}`},...r)}function Vc(e){return o("div",{style:{fontSize:"12px",color:"#9ca3af",fontStyle:"italic",flex:"1",display:"flex",alignItems:"center",justifyContent:"center"},"data-testid":`card-task-content-${e.card_id}`},"Task card (coming soon)")}function Uc(e,t){let n=e.content;return o("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:"4px 16px",borderRadius:"999px",backgroundColor:e.color||"#e0e7ff",fontSize:"13px",fontWeight:"600",color:"#1e3a5f",cursor:"pointer",flex:"1"},onDblClick:r=>{r.preventDefault(),r.stopPropagation(),t&&n.project_id&&t(n.project_id)},"data-testid":`card-project-content-${e.card_id}`},n.project_name||"Untitled Project")}function Ci(e){let{card:t,selected:n=!1,onSelect:r,onMove:i,onResize:s,onDelete:a,dispatch:l,onOpenProject:d,onCardContextMenu:u,onUpdate:h,onDragStart:g,onDragEnd:c,onAnchorDragStart:p}=e,[f,y]=j(!1),[b,m]=j(!1),[x,v]=j(null),[D,A]=j(!1),[M,T]=j(!1),[L,I]=j(!1),[P,B]=j(t.card_title||""),[E,N]=j(""),z=ne(null),k=ne(null),w=t.priority?Oc[t.priority]||"#94a3b8":"transparent",$=S(ce=>{let be=ce;be.preventDefault(),be.stopPropagation(),v({x:be.clientX,y:be.clientY}),A(!1),u&&u(t.card_id,{x:be.clientX,y:be.clientY})},[u,t.card_id]),C=S(()=>{v(null),A(!1)},[]),F=S(ce=>{let be=ce,Ee=be.target;if(Ee.dataset&&(Ee.dataset.role==="delete"||Ee.dataset.role==="resize"||Ee.dataset.role==="drag-handle"||Ee.dataset.role==="inline-edit"||Ee.dataset.role==="anchor"))return;be.preventDefault(),be.stopPropagation(),r&&r(t.card_id),z.current={x:be.clientX,y:be.clientY,cardX:t.position.x,cardY:t.position.y},g&&g(t.card_id),m(!0);let Re=ae=>{let pe=ae;if(!z.current)return;let Se=pe.clientX-z.current.x,we=pe.clientY-z.current.y;i&&i(t.card_id,{x:z.current.cardX+Se,y:z.current.cardY+we})},Ne=()=>{z.current=null,m(!1),c&&c(t.card_id),document.removeEventListener("mousemove",Re),document.removeEventListener("mouseup",Ne)};document.addEventListener("mousemove",Re),document.addEventListener("mouseup",Ne)},[t.card_id,t.position.x,t.position.y,r,i,g,c]),R=S(ce=>{let be=ce;be.preventDefault(),be.stopPropagation(),k.current={x:be.clientX,y:be.clientY,w:t.size.width,h:t.size.height};let Ee=Ne=>{let ae=Ne;if(!k.current)return;let pe=ae.clientX-k.current.x,Se=ae.clientY-k.current.y,we=Math.max(120,k.current.w+pe),Ie=Math.max(80,k.current.h+Se);s&&s(t.card_id,{width:we,height:Ie})},Re=()=>{k.current=null,document.removeEventListener("mousemove",Ee),document.removeEventListener("mouseup",Re)};document.addEventListener("mousemove",Ee),document.addEventListener("mouseup",Re)},[t.card_id,t.size.width,t.size.height,s]),W=S(ce=>{ce.preventDefault(),ce.stopPropagation(),a&&a(t.card_id)},[t.card_id,a]),_=S(ce=>{let be=ce;be.preventDefault(),be.stopPropagation();let Re=be.target.dataset.anchor;if(!Re||!p)return;let Ne=t.position.x,ae=t.position.y,pe=t.size.width,Se=t.size.height,we=Ne+pe/2,Ie=ae+Se/2;Re==="top"?(we=Ne+pe/2,Ie=ae):Re==="right"?(we=Ne+pe,Ie=ae+Se/2):Re==="bottom"?(we=Ne+pe/2,Ie=ae+Se):Re==="left"&&(we=Ne,Ie=ae+Se/2),p(t.card_id,Re,{x:we,y:Ie})},[t.card_id,t.position.x,t.position.y,t.size.width,t.size.height,p]),O=S(ce=>{l&&l({type:"CHANGE_CARD_TYPE",cardId:t.card_id,newType:ce}),C()},[t.card_id,l,C]),V=S(ce=>{ce.preventDefault(),ce.stopPropagation(),B(t.card_title||""),T(!0)},[t.card_title]),X=S(()=>{T(!1),h&&P!==t.card_title&&h(t.card_id,{card_title:P})},[h,t.card_id,t.card_title,P]),ee=S(ce=>{let be=ce;be.key==="Enter"?(be.preventDefault(),X()):be.key==="Escape"&&(be.preventDefault(),T(!1),B(t.card_title||""))},[X,t.card_title]),Z=S(ce=>{let be=ce.target;B(be.value)},[]),U=S(ce=>{ce.stopPropagation();let be=t.content;N(be.text||""),I(!0)},[t.content]),G=S(()=>{I(!1),h&&h(t.card_id,{content:{text:E}})},[h,t.card_id,E]),Y=S(ce=>{let be=ce;if(be.key==="Escape"){be.preventDefault(),I(!1);let Ee=t.content;N(Ee.text||"")}},[t.content]),H=S(ce=>{let be=ce.target;N(be.value)},[]),K;switch(t.card_type){case"text":L?K=o("textarea",{"data-role":"inline-edit","data-testid":`card-desc-edit-${t.card_id}`,value:E,onInput:H,onBlur:G,onKeyDown:Y,onFocus:ce=>{let be=ce.target;be.setSelectionRange(be.value.length,be.value.length)},style:{fontSize:"12px",color:"#555555",lineHeight:"1.4",flex:"1",border:"1px solid #3b82f6",borderRadius:"3px",padding:"2px 4px",resize:"none",outline:"none",fontFamily:"inherit",backgroundColor:"#fff",width:"100%",boxSizing:"border-box"}}):K=o("div",{style:{fontSize:"12px",color:"#555555",lineHeight:"1.4",overflow:"hidden",flex:"1",cursor:"text"},"data-testid":`card-text-content-${t.card_id}`,onClick:U},t.content.text||"");break;case"json":K=Yc(t);break;case"task":K=Vc(t);break;case"project":K=Uc(t,d);break;default:K=Hc(t)}let Q=t.card_type==="project",ie={position:"absolute",left:`${t.position.x}px`,top:`${t.position.y}px`,width:`${t.size.width}px`,height:`${t.size.height}px`,backgroundColor:t.color||"#fef9c3",borderRadius:Q?"999px":"6px",borderLeft:`4px solid ${w}`,boxShadow:n?"0 0 0 2px #3b82f6, 0 4px 12px rgba(0,0,0,0.15)":"0 2px 8px rgba(0,0,0,0.1)",cursor:"grab",userSelect:"none",overflow:"hidden",display:"flex",flexDirection:"column",padding:"8px 10px",boxSizing:"border-box",transition:"box-shadow 150ms ease",zIndex:b?"9999":"1"},J={fontWeight:"600",fontSize:"14px",color:"#1a1a1a",marginBottom:"4px",lineHeight:"1.3",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},se={position:"absolute",top:"4px",right:"4px",width:"18px",height:"18px",borderRadius:"50%",backgroundColor:"rgba(0,0,0,0.15)",color:"#333",fontSize:"12px",lineHeight:"18px",textAlign:"center",cursor:"pointer",display:f?"block":"none",border:"none",padding:"0"},le={position:"absolute",bottom:"0",right:"0",width:"12px",height:"12px",cursor:"nwse-resize",opacity:"0.4",background:"linear-gradient(135deg, transparent 50%, #666 50%)"},fe={position:"absolute",top:"4px",right:"24px",width:"18px",height:"18px",borderRadius:"3px",backgroundColor:"rgba(0,0,0,0.1)",color:"#333",fontSize:"10px",lineHeight:"18px",textAlign:"center",cursor:"grab",display:f?"block":"none",border:"none",padding:"0"},oe=8,me={position:"absolute",width:`${oe}px`,height:`${oe}px`,borderRadius:"50%",backgroundColor:"#3b82f6",border:"2px solid #fff",boxSizing:"border-box",cursor:"crosshair",display:f?"block":"none",zIndex:"10"},te=[{anchor:"top",style:{...me,top:`${-oe/2}px`,left:"50%",marginLeft:`${-oe/2}px`}},{anchor:"right",style:{...me,top:"50%",right:`${-oe/2}px`,marginTop:`${-oe/2}px`}},{anchor:"bottom",style:{...me,bottom:`${-oe/2}px`,left:"50%",marginLeft:`${-oe/2}px`}},{anchor:"left",style:{...me,top:"50%",left:`${-oe/2}px`,marginTop:`${-oe/2}px`}}].map((ce,be)=>o("div",{key:`anchor-${ce.anchor}`,style:ce.style,"data-role":"anchor","data-anchor":ce.anchor,"data-testid":`card-anchor-${ce.anchor}-${t.card_id}`,onMouseDown:_})),de=t.assignee?o("div",{style:{display:"flex",alignItems:"center",gap:"4px",marginTop:"4px",fontSize:"10px",color:"#555"},"data-testid":`card-assignee-${t.card_id}`},o("span",{style:{width:"16px",height:"16px",borderRadius:"50%",backgroundColor:"#3b82f6",color:"#fff",fontSize:"9px",fontWeight:"700",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:"0"}},t.assignee.charAt(0).toUpperCase()),o("span",{},t.assignee)):null,ge=t.tags&&t.tags.length>0?o("div",{style:{display:"flex",gap:"4px",flexWrap:"wrap",marginTop:"4px"}},...t.tags.map((ce,be)=>o("span",{key:String(be),style:{fontSize:"10px",padding:"1px 4px",borderRadius:"3px",backgroundColor:"rgba(0,0,0,0.08)",color:"#444"}},ce))):null,xe={padding:"6px 12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",whiteSpace:"nowrap"},ye={position:"absolute",left:"100%",top:"0",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 16px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"120px"},Me=x?o("div",{className:"card-context-menu",style:{position:"fixed",left:`${x.x}px`,top:`${x.y}px`,backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 16px rgba(0,0,0,0.15)",padding:"4px 0",zIndex:"10000",minWidth:"160px",fontSize:"13px",color:"#1a1a1a"},"data-testid":`card-context-menu-${t.card_id}`,role:"menu","aria-label":"Card context menu",onClick:ce=>ce.stopPropagation()},o("div",{style:xe,onClick:ce=>{ce.stopPropagation(),a&&a(t.card_id),C()},role:"menuitem","data-testid":`ctx-delete-${t.card_id}`},"Delete"),o("div",{style:{...xe,position:"relative"},onMouseEnter:()=>A(!0),role:"menuitem","aria-haspopup":"true","data-testid":`ctx-change-type-${t.card_id}`},"Change Type",o("span",{style:{marginLeft:"8px"}},"\u25B6"),D?o("div",{style:ye,role:"menu","data-testid":`ctx-type-submenu-${t.card_id}`},...Hn.map(ce=>o("div",{key:ce.value,style:{...xe,fontWeight:t.card_type===ce.value?"700":"400"},onClick:be=>{be.stopPropagation(),O(ce.value)},role:"menuitem","data-testid":`ctx-type-${ce.value}-${t.card_id}`},ce.label,t.card_type===ce.value?" \u2713":""))):null)):null;return Q?o("div",{className:"board-card board-card--project",style:ie,onMouseDown:F,onContextMenu:$,onMouseEnter:()=>y(!0),onMouseLeave:()=>{y(!1),C()},"data-card-id":t.card_id,"data-testid":`card-${t.card_id}`,role:"button","aria-label":`Project card: ${t.card_title}`,tabIndex:0},K,o("div",{style:fe,"data-role":"drag-handle","data-testid":`card-drag-handle-${t.card_id}`,"aria-label":"Export drag handle",title:"Drag to export card"},"\u2630"),...te,Me):o("div",{className:"board-card",style:ie,onMouseDown:F,onContextMenu:$,onMouseEnter:()=>y(!0),onMouseLeave:()=>{y(!1),C()},"data-card-id":t.card_id,"data-testid":`card-${t.card_id}`,role:"button","aria-label":`Card: ${t.card_title}`,tabIndex:0},M?o("input",{"data-role":"inline-edit","data-testid":`card-title-edit-${t.card_id}`,value:P,onInput:Z,onBlur:X,onKeyDown:ee,onFocus:ce=>{let be=ce.target;be.setSelectionRange(be.value.length,be.value.length)},style:{...J,border:"1px solid #3b82f6",borderRadius:"3px",padding:"1px 4px",outline:"none",width:"100%",boxSizing:"border-box",backgroundColor:"#fff"}}):o("div",{style:J,"data-testid":`card-title-${t.card_id}`,onDblClick:V},t.card_title||"Untitled"),K,ge,de,o("div",{style:fe,"data-role":"drag-handle","data-testid":`card-drag-handle-${t.card_id}`,"aria-label":`Export drag handle for ${t.card_title}`,title:"Drag to export card"},"\u2630"),o("button",{style:se,"data-role":"delete","data-testid":`card-delete-${t.card_id}`,onClick:W,"aria-label":`Delete ${t.card_title}`,tabIndex:-1},"\xD7"),o("div",{style:le,"data-role":"resize",onMouseDown:R,"aria-label":"Resize card"}),...te,Me)}function Mi(e){let{container:t,selected:n=!1,highlighted:r=!1,onSelect:i,onMove:s,onResize:a,onDelete:l,onDrop:d,onDragStart:u,onDragEnd:h,onContainerContextMenu:g,children:c}=e,[p,f]=j(!1),[y,b]=j(!1),[m,x]=j(!1),v=ne(null),D=ne(null),A=S(C=>{C.stopPropagation(),l&&l(t.container_id)},[t.container_id,l]),M=S(C=>{C.stopPropagation(),b(F=>!F)},[]),T=S(C=>{let F=C;F.preventDefault(),F.stopPropagation(),g&&g(t.container_id,{x:F.clientX,y:F.clientY})},[t.container_id,g]),L=S(C=>{let F=C;F.preventDefault(),F.stopPropagation(),i&&i(t.container_id),u&&u(t.container_id),x(!0),v.current={x:F.clientX,y:F.clientY,posX:t.position.x,posY:t.position.y};let R=_=>{let O=_;if(!v.current)return;let V=O.clientX-v.current.x,X=O.clientY-v.current.y;s&&s(t.container_id,{x:v.current.posX+V,y:v.current.posY+X})},W=()=>{v.current=null,x(!1),h&&h(t.container_id),document.removeEventListener("mousemove",R),document.removeEventListener("mouseup",W)};document.addEventListener("mousemove",R),document.addEventListener("mouseup",W)},[t.container_id,t.position.x,t.position.y,i,s,u,h]),I=S(C=>{let F=C;F.preventDefault(),F.stopPropagation(),D.current={x:F.clientX,y:F.clientY,w:t.size.width,h:t.size.height};let R=_=>{let O=_;if(!D.current)return;let V=O.clientX-D.current.x,X=O.clientY-D.current.y,ee=Math.max(160,D.current.w+V),Z=Math.max(120,D.current.h+X);a&&a(t.container_id,{width:ee,height:Z})},W=()=>{D.current=null,document.removeEventListener("mousemove",R),document.removeEventListener("mouseup",W)};document.addEventListener("mousemove",R),document.addEventListener("mouseup",W)},[t.container_id,t.size.width,t.size.height,a]),P=S(C=>{C.preventDefault(),f(!0)},[]),B=S(()=>{f(!1)},[]),E=S(C=>{let F=C;if(F.preventDefault(),f(!1),d&&F.dataTransfer){let R=F.dataTransfer.getData("text/plain");R&&d(R,t.container_id)}},[t.container_id,d]),N=r||p,z={position:"absolute",left:`${t.position.x}px`,top:`${t.position.y}px`,width:`${t.size.width}px`,height:`${t.size.height}px`,backgroundColor:r?"#eff6ff":"#ffffff",border:r?"2px dashed #3b82f6":n?"2px solid #3b82f6":"2px solid #d1d5db",borderRadius:"8px",boxShadow:N?"0 0 0 3px rgba(59,130,246,0.3), 0 4px 16px rgba(0,0,0,0.1)":"0 2px 8px rgba(0,0,0,0.08)",display:"flex",flexDirection:"column",overflow:"hidden",zIndex:m?"9999":"0",boxSizing:"border-box",transition:"border 150ms ease, background-color 150ms ease, box-shadow 150ms ease"},k={padding:"6px 12px",borderBottom:"1px solid #e5e7eb",backgroundColor:"#f9fafb",cursor:"grab",userSelect:"none",textAlign:"center",fontWeight:"700",fontSize:"15px",color:"#1f2937",flexShrink:"0"},w={flex:"1",overflow:"auto",position:"relative",padding:"4px"},$={position:"absolute",bottom:"0",right:"0",width:"14px",height:"14px",cursor:"nwse-resize",opacity:"0.4",background:"linear-gradient(135deg, transparent 50%, #666 50%)"};return o("div",{className:"board-container",style:z,"data-container-id":t.container_id,"data-testid":`container-${t.container_id}`,role:"group","aria-label":`Container: ${t.name}`,onDragOver:P,onDragLeave:B,onDrop:E,onContextMenu:T},o("div",{className:"board-container__title",style:{...k,display:"flex",alignItems:"center",justifyContent:"space-between"},onMouseDown:L,"data-testid":`container-title-${t.container_id}`},o("span",null,t.name),o("span",{style:{display:"flex",gap:"4px"}},o("button",{style:{border:"none",backgroundColor:"transparent",cursor:"pointer",color:"#94a3b8",fontSize:"12px",padding:"0 2px",lineHeight:"1"},onClick:M,"aria-label":y?"Expand container":"Minimize container",title:y?"Expand":"Minimize"},y?"\u25B2":"\u2014"),o("button",{style:{border:"none",backgroundColor:"transparent",cursor:"pointer",color:"#94a3b8",fontSize:"14px",padding:"0 2px",lineHeight:"1"},onClick:A,"aria-label":"Delete container",title:"Delete"},"\xD7"))),y?null:o("div",{className:"board-container__contents",style:w,"data-testid":`container-contents-${t.container_id}`},c),y?null:o("div",{style:$,"data-role":"resize",onMouseDown:I,"aria-label":"Resize container"}))}function Ei(e){let t=e.position.x+e.size.width/2,n=e.position.y+e.size.height/2;return{top:{x:t,y:e.position.y},right:{x:e.position.x+e.size.width,y:n},bottom:{x:t,y:e.position.y+e.size.height},left:{x:e.position.x,y:n}}}function jc(e,t){let n=Ei(e),r=Ei(t),i=[n.top,n.right,n.bottom,n.left],s=[r.top,r.right,r.bottom,r.left],a=1/0,l=n.right,d=r.left;for(let u=0;u<i.length;u++)for(let h=0;h<s.length;h++){let g=s[h].x-i[u].x,c=s[h].y-i[u].y,p=g*g+c*c;p<a&&(a=p,l=i[u],d=s[h])}return{from:l,to:d}}var Ii="board-card-link-arrowhead";function Ri(e){let{links:t,cards:n,selectedLinkId:r,onSelectLink:i,onLinkContextMenu:s,canvasWidth:a,canvasHeight:l}=e,d=new Map;for(let p=0;p<n.length;p++)d.set(n[p].card_id,n[p]);let u=S(p=>{i(p)},[i]),h=[];for(let p=0;p<t.length;p++){let{source:f,link:y}=t[p],b=d.get(y.target_card_id);if(!b)continue;let{from:m,to:x}=jc(f,b),v=y.link_id===r,D=v?"#3b82f6":y.color||"#94a3b8",A=x.x-m.x,M=x.y-m.y,T=Math.sqrt(A*A+M*M),L=Math.min(40,T*.15),I=T>0?-M/T:0,P=T>0?A/T:0,B=(m.x+x.x)/2,E=(m.y+x.y)/2,N=B+I*L,z=E+P*L,k=`M ${m.x} ${m.y} Q ${N} ${z} ${x.x} ${x.y}`,w=f.card_id;h.push(o("path",{key:`hit-${y.link_id}`,d:k,fill:"none",stroke:"transparent","stroke-width":"12",style:{cursor:"pointer",pointerEvents:"stroke"},onClick:()=>u(y.link_id),onContextMenu:$=>{let C=$;C.preventDefault(),C.stopPropagation(),s&&s(y.link_id,w,{x:C.clientX,y:C.clientY})},"data-testid":`link-hit-${y.link_id}`})),h.push(o("path",{key:y.link_id,d:k,fill:"none",stroke:D,"stroke-width":v?"3":"2","pointer-events":"none","marker-end":`url(#${Ii})`,"data-testid":`link-${y.link_id}`})),y.link_name&&h.push(o("text",{key:`label-${y.link_id}`,x:String(N),y:String(z-6),"text-anchor":"middle",fill:"#64748b","font-size":"11","pointer-events":"none","data-testid":`link-label-${y.link_id}`},y.link_name))}let g={position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none",overflow:"visible",zIndex:"9999"},c=o("defs",{},o("marker",{id:Ii,viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto-start-reverse"},o("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"#94a3b8"})));return o("svg",{style:g,width:String(a),height:String(l),className:"card-link-overlay","data-testid":"card-link-overlay",role:"img","aria-label":"Card links"},c,o("g",{style:{pointerEvents:"auto"}},...h))}var Gc=[{value:"#fef9c3",label:"Yellow"},{value:"#fecaca",label:"Red"},{value:"#fed7aa",label:"Orange"},{value:"#bbf7d0",label:"Green"},{value:"#bfdbfe",label:"Blue"},{value:"#ddd6fe",label:"Purple"},{value:"#fbcfe8",label:"Pink"},{value:"#e5e7eb",label:"Gray"}],Yn=20,Ct=5e3;function Xc(e,t){let n=new Set,r=[...e],i=null;for(;r.length>0;){let a=r.pop();if(Ae(a)&&a.container_id===t){i=a;break}if(Ae(a))for(let l=0;l<a.contents.length;l++)r.push(a.contents[l])}if(!i||!Ae(i))return n;let s=[...i.contents];for(;s.length>0;){let a=s.pop();if(Ae(a)){n.add(a.container_id);for(let l=0;l<a.contents.length;l++)s.push(a.contents[l])}}return n}function qc(e,t,n,r){let i=new Set;if(r){i.add(r);let d=Xc(e,r);for(let u of d)i.add(u)}let s=null,a=-1,l=[[e,0,0,0]];for(;l.length>0;){let[d,u,h,g]=l.pop();for(let c=0;c<d.length;c++){let p=d[c];if(!Ae(p)||i.has(p.container_id))continue;let f=p.position.x+u,y=p.position.y+h;t>=f&&t<=f+p.size.width&&n>=y&&n<=y+p.size.height&&(g>a&&(s=p.container_id,a=g),p.contents.length>0&&l.push([p.contents,f,y+30,g+1]))}}return s}function $i(e,t){return{x:Math.round(e.x/t)*t,y:Math.round(e.y/t)*t}}function Pi(e,t){let n=[[e,null]];for(;n.length>0;){let[r,i]=n.pop();for(let s=0;s<r.length;s++){let a=r[s];if(Ke(a)===t)return i;Ae(a)&&n.push([a.contents,a.container_id])}}return null}function Ti(e,t,n){return{x:(e-n.panX)/n.zoom,y:(t-n.panY)/n.zoom}}function Kc(e){let t=[],n=[],r=[];for(let i=e.length-1;i>=0;i--)r.push([e[i],0,0]);for(;r.length>0;){let[i,s,a]=r.pop();if(Fe(i)){let l={...i,position:{x:i.position.x+s,y:i.position.y+a}};t.push(l);for(let d=0;d<i.card_link.length;d++)n.push({source:l,link:i.card_link[d]})}else if(Ae(i)){let l=s+i.position.x,d=a+i.position.y+30;for(let u=i.contents.length-1;u>=0;u--)r.push([i.contents[u],l,d])}}return{cards:t,links:n}}function Vn(e){let{state:t,dispatch:n,selectedId:r=null,onSelectItem:i,gridEnabled:s=!1,searchQuery:a="",colorFilter:l=null,onOpenProject:d,onCardContextMenu:u,onUpdateItem:h}=e,{collection:g,viewport:c}=t,p=ne(null),f=ne(!1),y=ne(null),[b,m]=j(null),[x,v]=j(null),[D,A]=j(null),[M,T]=j(null),[L,I]=j(!1),[P,B]=j(!1),[E,N]=j(null),[z,k]=j(null),w=S(ae=>{let pe=ae,Se=pe.target;if(Se.closest(".board-card")||Se.closest(".board-container"))return;let we=pe.button===1,Ie=pe.button===0&&pe.shiftKey;we||Ie?(pe.preventDefault(),f.current=!0,y.current={x:pe.clientX,y:pe.clientY,panX:c.panX,panY:c.panY}):pe.button===0&&i&&i(null)},[c.panX,c.panY,i]);re(()=>{let ae=Se=>{if(!f.current||!y.current)return;let we=Se,Ie=we.clientX-y.current.x,Le=we.clientY-y.current.y;n({type:"PAN",panX:y.current.panX+Ie,panY:y.current.panY+Le})},pe=()=>{f.current=!1,y.current=null};return document.addEventListener("mousemove",ae),document.addEventListener("mouseup",pe),()=>{document.removeEventListener("mousemove",ae),document.removeEventListener("mouseup",pe)}},[n]);let $=S(ae=>{let pe=ae;if(!pe.ctrlKey)return;pe.preventDefault();let Se=pe.deltaY>0?-.1:.1;n({type:"ZOOM",zoom:c.zoom+Se})},[c.zoom,n]),C=ne(null);re(()=>{let ae=p.current;if(!ae)return;let pe=ze=>{let Te=[];for(let ue=0;ue<ze.touches.length;ue++)Te.push({x:ze.touches[ue].clientX,y:ze.touches[ue].clientY});return Te},Se=(ze,Te)=>Math.sqrt((ze.x-Te.x)**2+(ze.y-Te.y)**2),we=ze=>{let Te=ze;if(Te.touches.length===2){Te.preventDefault();let ue=pe(Te);C.current={touches:ue,panX:c.panX,panY:c.panY,zoom:c.zoom,dist:Se(ue[0],ue[1])}}},Ie=ze=>{let Te=ze;if(Te.touches.length!==2||!C.current)return;Te.preventDefault();let ue=pe(Te),ve=C.current,ke=(ve.touches[0].x+ve.touches[1].x)/2,Pe=(ve.touches[0].y+ve.touches[1].y)/2,Xe=(ue[0].x+ue[1].x)/2,Je=(ue[0].y+ue[1].y)/2;n({type:"PAN",panX:ve.panX+(Xe-ke),panY:ve.panY+(Je-Pe)});let lt=Se(ue[0],ue[1]);ve.dist>0&&n({type:"ZOOM",zoom:ve.zoom*(lt/ve.dist)})},Le=()=>{C.current=null};return ae.addEventListener("touchstart",we,{passive:!1}),ae.addEventListener("touchmove",Ie,{passive:!1}),ae.addEventListener("touchend",Le),()=>{ae.removeEventListener("touchstart",we),ae.removeEventListener("touchmove",Ie),ae.removeEventListener("touchend",Le)}},[c.panX,c.panY,c.zoom,n]);let F=S((ae,pe)=>{T({cardId:ae,x:pe.x,y:pe.y}),I(!1),B(!1),u&&u(ae,pe)},[u]),R=S(()=>{T(null),I(!1),B(!1)},[]);re(()=>{if(!M)return;let ae=()=>{R()};return document.addEventListener("click",ae),()=>{document.removeEventListener("click",ae)}},[M,R]);let W=S((ae,pe,Se)=>{k({linkId:ae,cardId:pe,x:Se.x,y:Se.y}),R()},[R]),_=S(()=>{k(null)},[]);re(()=>{if(!z)return;let ae=()=>_();return document.addEventListener("click",ae),()=>document.removeEventListener("click",ae)},[z,_]);let O=S((ae,pe)=>{N({containerId:ae,x:pe.x,y:pe.y}),R(),_()},[R,_]),V=S(()=>{N(null)},[]);re(()=>{if(!E)return;let ae=()=>V();return document.addEventListener("click",ae),()=>document.removeEventListener("click",ae)},[E,V]);let X=S(ae=>{i&&i(ae)},[i]),ee=S((ae,pe)=>{let Se=pe;if(s&&(Se=$i(pe,Yn)),n({type:"MOVE_ITEM",itemId:ae,position:Se}),H.current===ae){let Ie=0,Le=0,ze=[...g];for(;ze.length>0;){let ke=ze.pop();if(Ke(ke)===ae){Ie=ke.size.width,Le=ke.size.height;break}if(Ae(ke))for(let Pe=0;Pe<ke.contents.length;Pe++)ze.push(ke.contents[Pe])}let Te=Se.x+Ie/2,ue=Se.y+Le/2,ve=qc(g,Te,ue,ae);m(ve)}},[n,s,g]),Z=S((ae,pe)=>{n({type:"RESIZE_ITEM",itemId:ae,size:pe})},[n]),U=S(ae=>{n({type:"REMOVE_ITEM",itemId:ae}),i&&r===ae&&i(null)},[n,r,i]),G=S((ae,pe)=>{n({type:"NEST_ITEM",itemId:ae,containerId:pe})},[n]),Y=S(ae=>{v(ae),H.current=ae,m(null)},[]),H=ne(null);H.current=x;let K=ne(null);K.current=b;let Q=S(ae=>{let pe=K.current;pe&&n({type:"NEST_ITEM",itemId:ae,containerId:pe}),v(null),H.current=null,m(null)},[n]),ie=S((ae,pe,Se)=>{A({fromCardId:ae,fromAnchor:pe,fromPos:Se,currentPos:Se})},[]),J=ne(null);J.current=D,re(()=>{if(!D)return;let ae=Se=>{let we=Se,Ie=0,Le=0;if(p.current){let Te=p.current.getBoundingClientRect();Ie=Te.left,Le=Te.top}let ze=Ti(we.clientX-Ie,we.clientY-Le,c);A(Te=>Te?{...Te,currentPos:ze}:null)},pe=Se=>{let we=Se,Ie=J.current;if(!Ie){A(null);return}let Le=document.elementFromPoint(we.clientX,we.clientY);if(Le&&Le.dataset&&Le.dataset.role==="anchor"&&Le.dataset.anchor){let ze=Le.closest("[data-card-id]");if(ze&&ze.dataset.cardId&&ze.dataset.cardId!==Ie.fromCardId){let Te=ze.dataset.cardId;n({type:"ADD_LINK",cardId:Ie.fromCardId,link:{link_id:et(),link_name:"relates to",target_card_id:Te,color:"#94a3b8",attributes:{}}})}}A(null)};return document.addEventListener("mousemove",ae),document.addEventListener("mouseup",pe),()=>{document.removeEventListener("mousemove",ae),document.removeEventListener("mouseup",pe)}},[D!==null,c.panX,c.panY,c.zoom,n]);let se=a.toLowerCase(),le=new Set,fe=[],oe=[...g];for(;oe.length>0;){let ae=oe.pop();if(fe.push(ae),Ae(ae))for(let pe=0;pe<ae.contents.length;pe++)oe.push(ae.contents[pe])}if(se)for(let ae=0;ae<fe.length;ae++){let pe=fe[ae];(Fe(pe)?pe.card_title:pe.name).toLowerCase().includes(se)||le.add(Ke(pe))}if(l)for(let ae=0;ae<fe.length;ae++){let pe=fe[ae];Fe(pe)&&pe.color!==l&&le.add(pe.card_id)}let{cards:me,links:he}=Kc(g);function te(ae){let pe=Ke(ae),Se=le.has(pe),we;if(Fe(ae))we=o(Ci,{key:pe,card:ae,selected:pe===r,onSelect:X,onMove:ee,onResize:Z,onDelete:U,dispatch:n,onOpenProject:d,onCardContextMenu:F,onUpdate:h,onDragStart:Y,onDragEnd:Q,onAnchorDragStart:ie});else{let Ie=ae.contents.map(Le=>te(Le));we=o(Mi,{key:pe,container:ae,selected:pe===r,highlighted:b===ae.container_id,onSelect:X,onMove:ee,onResize:Z,onDelete:U,onDrop:G,onDragStart:Y,onDragEnd:Q,onContainerContextMenu:O},...Ie)}return Se?o("div",{key:`dim-${pe}`,style:{opacity:"0.3"}},we):we}let de=g.map(ae=>te(ae)),ge={flex:"1",overflow:"hidden",position:"relative",backgroundColor:"#f8fafc",cursor:"default",backgroundImage:s?"radial-gradient(circle, #d1d5db 1px, transparent 1px)":"none",backgroundSize:`${Yn}px ${Yn}px`},xe={transform:`translate(${c.panX}px, ${c.panY}px) scale(${c.zoom})`,transformOrigin:"0 0",position:"relative",width:`${Ct}px`,height:`${Ct}px`},ye={padding:"6px 12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",whiteSpace:"nowrap",fontSize:"13px",color:"#1a1a1a"},Me={position:"absolute",left:"100%",top:"0",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 16px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"120px"},ce={height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"},be=M?o("div",{className:"board-context-menu",style:{position:"fixed",left:`${M.x}px`,top:`${M.y}px`,backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 16px rgba(0,0,0,0.15)",padding:"4px 0",zIndex:"10000",minWidth:"160px",fontSize:"13px",color:"#1a1a1a"},"data-testid":`board-context-menu-${M.cardId}`,role:"menu","aria-label":"Card context menu",onClick:ae=>ae.stopPropagation()},o("div",{style:{...ye,position:"relative"},onMouseEnter:()=>{I(!0),B(!1)},role:"menuitem","aria-haspopup":"true","data-testid":`board-ctx-change-color-${M.cardId}`},"Change Color",o("span",{style:{marginLeft:"8px"}},"\u25B6"),L?o("div",{style:Me,role:"menu","data-testid":`board-ctx-color-submenu-${M.cardId}`},...Gc.map(ae=>o("div",{key:ae.value,style:{...ye,gap:"8px"},onClick:pe=>{pe.stopPropagation(),n({type:"UPDATE_CARD",cardId:M.cardId,updates:{color:ae.value}}),R()},role:"menuitem","data-testid":`board-ctx-color-${ae.label.toLowerCase()}-${M.cardId}`},o("span",{style:{display:"inline-block",width:"14px",height:"14px",borderRadius:"3px",backgroundColor:ae.value,border:"1px solid #d1d5db",flexShrink:"0"}}),ae.label))):null),o("div",{style:{...ye,position:"relative"},onMouseEnter:()=>{B(!0),I(!1)},role:"menuitem","aria-haspopup":"true","data-testid":`board-ctx-change-type-${M.cardId}`},"Change Type",o("span",{style:{marginLeft:"8px"}},"\u25B6"),P?o("div",{style:Me,role:"menu","data-testid":`board-ctx-type-submenu-${M.cardId}`},...Hn.map(ae=>o("div",{key:ae.value,style:ye,onClick:pe=>{pe.stopPropagation(),n({type:"CHANGE_CARD_TYPE",cardId:M.cardId,newType:ae.value}),R()},role:"menuitem","data-testid":`board-ctx-type-${ae.value}-${M.cardId}`},ae.label))):null),(()=>{let ae=Pi(g,M.cardId);return ae?o("div",{style:ye,onClick:pe=>{pe.stopPropagation(),n({type:"UNNEST_ITEM",itemId:M.cardId,containerId:ae}),R()},role:"menuitem","data-testid":`board-ctx-detach-${M.cardId}`},"Detach Card"):null})(),o("div",{style:ce,role:"separator"}),o("div",{style:{...ye,color:"#dc2626"},onClick:ae=>{ae.stopPropagation(),n({type:"REMOVE_ITEM",itemId:M.cardId}),i&&r===M.cardId&&i(null),R()},role:"menuitem","data-testid":`board-ctx-delete-${M.cardId}`},"Delete")):null,Ee=E?o("div",{className:"board-container-context-menu",role:"menu",style:{position:"fixed",left:`${E.x}px`,top:`${E.y}px`,backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 16px rgba(0,0,0,0.15)",padding:"4px 0",zIndex:"10001",minWidth:"160px"},"data-testid":`board-container-ctx-menu-${E.containerId}`},(()=>{let ae=Pi(g,E.containerId);return ae?o("div",{style:ye,onClick:pe=>{pe.stopPropagation(),n({type:"UNNEST_ITEM",itemId:E.containerId,containerId:ae}),V()},role:"menuitem","data-testid":`board-ctx-detach-container-${E.containerId}`},"Detach Container"):null})(),o("div",{style:ce,role:"separator"}),o("div",{style:{...ye,color:"#dc2626"},onClick:ae=>{ae.stopPropagation(),n({type:"REMOVE_ITEM",itemId:E.containerId}),i&&r===E.containerId&&i(null),V()},role:"menuitem","data-testid":`board-ctx-delete-container-${E.containerId}`},"Delete")):null,Re=["relates to","depends on","blocks","is blocked by","implements","is implemented by","extends","includes","references","duplicates","parent of","child of"],Ne=z?o("div",{className:"board-link-context-menu",style:{position:"fixed",left:`${z.x}px`,top:`${z.y}px`,backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 16px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"180px",maxHeight:"240px",overflowY:"auto",zIndex:"10001",fontSize:"13px"},onClick:ae=>ae.stopPropagation()},o("div",{style:{padding:"4px 14px",fontSize:"11px",color:"#94a3b8",fontWeight:"600"}},"Edge Type"),...Re.map(ae=>o("button",{key:ae,style:{display:"block",width:"100%",padding:"6px 14px",border:"none",backgroundColor:"transparent",textAlign:"left",cursor:"pointer",fontSize:"13px",color:"#334155",fontFamily:"inherit",boxSizing:"border-box"},onClick:()=>{n({type:"UPDATE_CARD",cardId:z.cardId,updates:{card_link:(()=>{let pe=null,Se=[...g];for(;Se.length>0;){let we=Se.pop();if(Fe(we)&&we.card_id===z.cardId){pe=we;break}if(Ae(we))for(let Ie of we.contents)Se.push(Ie)}return pe?pe.card_link.map(we=>we.link_id===z.linkId?{...we,link_name:ae}:we):[]})()}}),_()},role:"menuitem"},ae)),o("div",{style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}}),o("button",{style:{display:"block",width:"100%",padding:"6px 14px",border:"none",backgroundColor:"transparent",textAlign:"left",cursor:"pointer",fontSize:"13px",color:"#ef4444",fontFamily:"inherit"},onClick:()=>{n({type:"REMOVE_LINK",cardId:z.cardId,linkId:z.linkId}),_()},role:"menuitem"},"Delete Link")):null;return o("div",{ref:p,className:"board-canvas",style:ge,onMouseDown:w,onWheel:$,"data-testid":"board-canvas",role:"application","aria-label":`Board: ${t.name}`,tabIndex:0},o("div",{className:"board-canvas__inner",style:xe,"data-testid":"board-canvas-inner"},o(Ri,{links:he,cards:me,selectedLinkId:null,onSelectLink:()=>{},onLinkContextMenu:W,canvasWidth:Ct,canvasHeight:Ct}),D?o("svg",{style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none",overflow:"visible"},width:String(Ct),height:String(Ct),className:"link-drag-overlay","data-testid":"link-drag-overlay"},o("line",{x1:String(D.fromPos.x),y1:String(D.fromPos.y),x2:String(D.currentPos.x),y2:String(D.currentPos.y),stroke:"#3b82f6","stroke-width":"2","stroke-dasharray":"6 4","pointer-events":"none","data-testid":"link-drag-line"})):null,...de),be,Ee,Ne)}function Zc(e){let t=[],n=[...e];for(;n.length>0;){let r=n.pop();if(Fe(r))t.push(r);else if(Ae(r))for(let i=r.contents.length-1;i>=0;i--)n.push(r.contents[i])}return t}function Di(e,t,n,r){let i=r??40,s=Zc(e);if(s.length===0)return{panX:0,panY:0,zoom:1};let a=1/0,l=1/0,d=-1/0,u=-1/0;for(let m=0;m<s.length;m++){let x=s[m];x.position.x<a&&(a=x.position.x),x.position.y<l&&(l=x.position.y);let v=x.position.x+x.size.width,D=x.position.y+x.size.height;v>d&&(d=v),D>u&&(u=D)}let h=d-a+i*2,g=u-l+i*2,c=t/h,p=n/g,f=Math.max(.25,Math.min(4,Math.min(c,p))),y=-a*f+(t-(d-a)*f)/2,b=-l*f+(n-(u-l)*f)/2;return{panX:y,panY:b,zoom:f}}var Un=["#fef9c3","#fecaca","#fed7aa","#bbf7d0","#bfdbfe","#ddd6fe","#fbcfe8","#e5e7eb"];function zi(e){let{zoom:t,gridEnabled:n,selectedColor:r,colorFilter:i,onNewCard:s,onZoomIn:a,onZoomOut:l,onZoomReset:d,onColorSelect:u,onColorFilter:h,onGridToggle:g,onSearch:c}=e,[p,f]=j(""),y=S(T=>{let L=T.target.value;f(L),c(L)},[c]),b={display:"flex",alignItems:"center",gap:"8px",padding:"6px 12px",backgroundColor:"rgba(255,255,255,0.95)",borderBottom:"1px solid #e2e8f0",fontSize:"12px",flexShrink:"0",flexWrap:"wrap"},m={padding:"4px 10px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#ffffff",cursor:"pointer",fontSize:"12px",color:"#374151",lineHeight:"1.4"},x={...m,backgroundColor:"#3b82f6",color:"#ffffff",borderColor:"#3b82f6"},v={fontSize:"12px",color:"#64748b",minWidth:"40px",textAlign:"center",cursor:"pointer"},D={width:"1px",height:"20px",backgroundColor:"#e2e8f0",margin:"0 4px"},A={padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",width:"120px",outline:"none"},M=Un.map(T=>{let L=T===r,I=T===i,P=()=>{L&&h?h(I?null:T):u(T)},B="1px solid rgba(0,0,0,0.15)";return I?B="3px solid #ef4444":L&&(B="2px solid #3b82f6"),o("button",{key:T,title:T,style:{width:"18px",height:"18px",borderRadius:"50%",backgroundColor:T,border:B,cursor:"pointer",padding:"0",flexShrink:"0",opacity:I?"1":i?"0.5":"1"},onClick:P,"aria-label":I?`Clear color filter ${T}`:`Select color ${T}`,"data-testid":`color-swatch-${T}`})});return o("div",{className:"board-toolbar",style:b,role:"toolbar","aria-label":"Board toolbar","data-testid":"board-toolbar"},o("button",{style:m,onClick:s,"data-testid":"btn-new-card","aria-label":"New card"},"+ New Card"),o("div",{style:D}),o("button",{style:m,onClick:l,"data-testid":"btn-zoom-out","aria-label":"Zoom out"},"-"),o("span",{style:v,onClick:d,"data-testid":"zoom-level",role:"status","aria-label":`Zoom ${Math.round(t*100)}%`},`${Math.round(t*100)}%`),o("button",{style:m,onClick:a,"data-testid":"btn-zoom-in","aria-label":"Zoom in"},"+"),o("div",{style:D}),...M,o("div",{style:D}),o("button",{style:n?x:m,onClick:g,"data-testid":"btn-grid-toggle","aria-label":n?"Disable grid snapping":"Enable grid snapping","aria-pressed":String(n)},"Grid"),o("div",{style:D}),o("input",{type:"text",placeholder:"Search cards...",value:p,onInput:y,style:A,"data-testid":"search-input","aria-label":"Search cards"}))}var Ai=50,ft={id:et(),name:"Untitled",collection:[],viewport:{panX:0,panY:0,zoom:1}};function Li(e,t){let n=null;function r(s){let a=[];for(let l=0;l<s.length;l++){let d=s[l];if(Ke(d)===t){n=d;continue}if(Ae(d)){let h=r(d.contents);a.push({...d,contents:h})}else a.push(d)}return a}return[r(e),n]}function pt(e,t,n){let r=[];for(let i=0;i<e.length;i++){let s=e[i];Ke(s)===t?r.push(n(s)):Ae(s)?r.push({...s,contents:pt(s.contents,t,n)}):r.push(s)}return r}function en(e,t,n){let r=[];for(let i=0;i<e.length;i++){let s=e[i];Ae(s)&&s.container_id===t?r.push({...s,contents:[...s.contents,n]}):Ae(s)?r.push({...s,contents:en(s.contents,t,n)}):r.push(s)}return r}function Bi(e,t){let n=[...e];for(;n.length>0;){let r=n.pop();if(Ae(r)){if(r.container_id===t)return r;for(let i=0;i<r.contents.length;i++)n.push(r.contents[i])}}return null}function Jc(e,t,n){let r=null;function i(a){let l=[];for(let d=0;d<a.length;d++){let u=a[d];if(Ae(u)&&u.container_id===t){let h=[];for(let g=0;g<u.contents.length;g++){let c=u.contents[g];Ke(c)===n?r=c:h.push(c)}l.push({...u,contents:h})}else Ae(u)?l.push({...u,contents:i(u.contents)}):l.push(u)}return l}return[i(e),r]}function Qc(e){switch(e){case"text":return{text:""};case"json":return{};case"task":return{};case"project":return{project_id:"",project_name:""}}}function Fi(e,t){switch(t.type){case"ADD_ITEM":return t.containerId?{...e,collection:en(e.collection,t.containerId,t.item)}:{...e,collection:[...e.collection,t.item]};case"REMOVE_ITEM":{let[n]=Li(e.collection,t.itemId);return{...e,collection:n}}case"MOVE_ITEM":return{...e,collection:pt(e.collection,t.itemId,n=>({...n,position:t.position,...Fe(n)?{updatedAt:Date.now()}:{}}))};case"RESIZE_ITEM":return{...e,collection:pt(e.collection,t.itemId,n=>({...n,size:t.size,...Fe(n)?{updatedAt:Date.now()}:{}}))};case"UPDATE_CARD":return{...e,collection:pt(e.collection,t.cardId,n=>Fe(n)?{...n,...t.updates,updatedAt:Date.now()}:n)};case"CHANGE_CARD_TYPE":return{...e,collection:pt(e.collection,t.cardId,n=>Fe(n)?{...n,card_type:t.newType,content:Qc(t.newType),updatedAt:Date.now()}:n)};case"ADD_CONTAINER":return t.parentContainerId?{...e,collection:en(e.collection,t.parentContainerId,t.container)}:{...e,collection:[...e.collection,t.container]};case"NEST_ITEM":{let n=Bi(e.collection,t.containerId);if(!n)return e;let[r,i]=Li(e.collection,t.itemId);if(!i)return e;let s={...i,position:{x:i.position.x-n.position.x,y:i.position.y-n.position.y-30}};return{...e,collection:en(r,t.containerId,s)}}case"UNNEST_ITEM":{let n=Bi(e.collection,t.containerId),[r,i]=Jc(e.collection,t.containerId,t.itemId);if(!i)return e;let s=n?{...i,position:{x:i.position.x+n.position.x,y:i.position.y+n.position.y+30}}:i;return{...e,collection:[...r,s]}}case"ADD_LINK":return{...e,collection:pt(e.collection,t.cardId,n=>Fe(n)?{...n,card_link:[...n.card_link,t.link],updatedAt:Date.now()}:n)};case"REMOVE_LINK":return{...e,collection:pt(e.collection,t.cardId,n=>Fe(n)?{...n,card_link:n.card_link.filter(r=>r.link_id!==t.linkId),updatedAt:Date.now()}:n)};case"PAN":return{...e,viewport:{...e.viewport,panX:t.panX,panY:t.panY}};case"ZOOM":{let n=Math.max(.25,Math.min(4,t.zoom));return{...e,viewport:{...e.viewport,zoom:n}}}case"SET_BOARD":return t.state;case"RENAME_BOARD":return{...e,name:t.name};default:return e}}function ed(e){return e.type==="PAN"||e.type==="ZOOM"}function Ni(e,t){switch(t.type){case"UNDO":{if(e.past.length===0)return e;let n=e.past[e.past.length-1];return{past:e.past.slice(0,e.past.length-1),present:n,future:[e.present,...e.future]}}case"REDO":{if(e.future.length===0)return e;let n=e.future[0],r=e.future.slice(1);return{past:[...e.past,e.present],present:n,future:r}}case"BOARD_ACTION":{let n=Fi(e.present,t.action);if(n===e.present)return e;if(ed(t.action))return{...e,present:n};if(t.action.type==="SET_BOARD")return{past:[],present:n,future:[]};let r=[...e.past,e.present];return r.length>Ai&&r.splice(0,r.length-Ai),{past:r,present:n,future:[]}}default:return e}}function jn(e){let t={past:[],present:e||ft,future:[]},[n,r]=pn(Ni,t),i=S(l=>{r({type:"BOARD_ACTION",action:l})},[r]),s=S(()=>{r({type:"UNDO"})},[r]),a=S(()=>{r({type:"REDO"})},[r]);return{state:n.present,dispatch:i,undo:s,redo:a,canUndo:n.past.length>0,canRedo:n.future.length>0}}function Wi(e,t){let{state:n,dispatch:r,undo:i,redo:s,canUndo:a,canRedo:l}=jn(),d=ne(!1);re(()=>{e&&t&&!d.current&&(d.current=!0,e.load(t).then(g=>{r({type:"SET_BOARD",state:g})}).catch(()=>{}))},[e,t,r]);let u=ne(null),h=ne(n);return h.current=n,re(()=>{if(!(!e||!t))return u.current!==null&&clearTimeout(u.current),u.current=setTimeout(()=>{e.save(t,h.current).catch(()=>{}),u.current=null},500),()=>{u.current!==null&&clearTimeout(u.current)}},[e,t,n]),{state:n,dispatch:r,undo:i,redo:s,canUndo:a,canRedo:l}}var tn=class{async load(t){try{let n=localStorage.getItem("board:"+t);return n?JSON.parse(n):{...ft}}catch{return{...ft}}}async save(t,n){try{localStorage.setItem("board:"+t,JSON.stringify(n))}catch{}}};function td(e){let t=[],n=[...e];for(;n.length>0;){let r=n.pop();if(Fe(r))t.push(r);else for(let i=r.contents.length-1;i>=0;i--)n.push(r.contents[i])}return t}function _i(e){let{collection:t,onCardDropped:n,children:r}=e,i=it(),s=ne([]);re(()=>{let u=td(t),h=s.current,g=new Set(h.map(p=>p.card_id)),c=new Set(u.map(p=>p.card_id));for(let p of u)g.has(p.card_id)||i.publish("project-board",{event:"card-created",card:p});for(let p of h)c.has(p.card_id)||i.publish("project-board",{event:"card-deleted",cardId:p.card_id});for(let p of u)if(g.has(p.card_id)){let f=h.find(y=>y.card_id===p.card_id);f&&f.updatedAt!==p.updatedAt&&i.publish("project-board",{event:"card-updated",card:p})}s.current=u},[t,i]);let a=S(u=>{if(u.type==="text/plain"&&typeof u.data=="string")n(u.data,"");else if(u.type==="application/json"){let h=u.data;n(String(h.title||"Dropped Item"),String(h.description||""))}},[n]),{isOver:l}=zt({acceptTypes:["text/plain","application/json","application/project-card"],onDrop:a}),d={width:"100%",height:"100%",...l?{outline:"2px dashed #3b82f6",outlineOffset:"-2px"}:{}};return o("div",{style:d,"data-dropzone-id":"project-board-dropzone"},r)}var nd=new tn;function Oi(e){let t=[],n=[...e];for(;n.length>0;){let r=n.pop();if(Fe(r))t.push(r);else if(Ae(r))for(let i=r.contents.length-1;i>=0;i--)n.push(r.contents[i])}return t}var st=Date.now(),od={id:"sample-board-001",name:"Sample Project",collection:[{type:"card",card_id:"sample-1",card_type:"text",card_title:"Auth API",card_link:[{link_id:"link-1",link_name:"blocks",target_card_id:"sample-2",color:"#94a3b8",attributes:{}}],content:{text:"Design the auth flow"},position:{x:50,y:50},size:{width:180,height:120},color:"#3b82f6",priority:"high",assignee:"Alice",createdAt:st,updatedAt:st},{type:"card",card_id:"sample-2",card_type:"text",card_title:"Dashboard",card_link:[],content:{text:"Build the main dashboard"},position:{x:300,y:80},size:{width:180,height:120},color:"#22c55e",priority:"medium",assignee:"Bob",createdAt:st,updatedAt:st},{type:"card",card_id:"sample-3",card_type:"text",card_title:"Deploy",card_link:[],content:{text:"Set up CI pipeline"},position:{x:150,y:250},size:{width:180,height:120},color:"#f59e0b",priority:"low",createdAt:st,updatedAt:st},{type:"card",card_id:"sample-4",card_type:"text",card_title:"Docs",card_link:[],content:{text:"Write API reference"},position:{x:400,y:280},size:{width:180,height:120},color:"#a855f7",priority:"medium",assignee:"Carol",createdAt:st,updatedAt:st}],viewport:{panX:0,panY:0,zoom:1}};function rd(e){return e.collection.length===0}function Hi(e){let t=e.boardId||"default",{state:n,dispatch:r,undo:i,redo:s,canUndo:a,canRedo:l}=Wi(nd,t),[d,u]=j(Un[0]),[h,g]=j(!1),[c,p]=j(""),[f,y]=j(null),[b,m]=j(null),[x,v]=j(n.name||"Untitled"),[D,A]=j(!1),[M,T]=j(""),[L,I]=j(null),[P,B]=j(!0),[E,N]=j([{name:"relates to",weight:1},{name:"depends on",weight:2},{name:"blocks",weight:3},{name:"is blocked by",weight:3},{name:"implements",weight:2},{name:"references",weight:1}]),[z,k]=j(null),[w,$]=j(""),[C,F]=j("1"),[R,W]=j([]),_=ne(!1);re(()=>{!_.current&&rd(n)?(_.current=!0,r({type:"SET_BOARD",state:od})):n.collection.length>0&&(_.current=!0)},[n,r]);let O=S(()=>{let ue=(-n.viewport.panX+300)/n.viewport.zoom,ve=(-n.viewport.panY+200)/n.viewport.zoom,ke=(Math.random()-.5)*300,Pe=(Math.random()-.5)*200,Xe={type:"card",card_id:et(),card_type:"text",card_title:"New Card",card_link:[],content:{text:""},color:d,position:{x:Math.round(ue+ke),y:Math.round(ve+Pe)},size:{width:180,height:120},priority:"medium",createdAt:Date.now(),updatedAt:Date.now()};r({type:"ADD_ITEM",item:Xe})},[n.viewport,d,r]),V=S(()=>{r({type:"ZOOM",zoom:n.viewport.zoom+.1})},[n.viewport.zoom,r]),X=S(()=>{r({type:"ZOOM",zoom:n.viewport.zoom-.1})},[n.viewport.zoom,r]),ee=S(()=>{r({type:"ZOOM",zoom:1})},[r]),Z=S(()=>{g(ue=>!ue)},[]),U=S(ue=>{p(ue)},[]),G=S(ue=>{y(ue)},[]),Y=S(ue=>{m(ue)},[]),H=S(()=>{B(ue=>!ue)},[]),K=S(()=>{r({type:"SET_BOARD",state:ft}),y(null)},[r]),Q=S(()=>{let ue=JSON.stringify(n,null,2),ve=new Blob([ue],{type:"application/json"}),ke=URL.createObjectURL(ve),Pe=document.createElement("a");Pe.href=ke,Pe.download=`board-${t}.json`,Pe.style.display="none",document.body.appendChild(Pe),Pe.click(),document.body.removeChild(Pe),URL.revokeObjectURL(ke)},[n,t]),ie=S(()=>{let ue=document.createElement("input");ue.type="file",ue.accept=".json,application/json",ue.style.display="none",ue.addEventListener("change",()=>{let ve=ue.files&&ue.files[0];if(!ve)return;let ke=new FileReader;ke.onload=()=>{try{let Pe=JSON.parse(ke.result);Pe&&Pe.collection&&Pe.viewport&&r({type:"SET_BOARD",state:Pe})}catch{}},ke.readAsText(ve)}),document.body.appendChild(ue),ue.click(),document.body.removeChild(ue)},[r]),J=S(()=>{window.print()},[]),se=Oi(n.collection),le=S(()=>{let ue=Oi(n.collection);ue.length>0&&y(ue[0].card_id)},[n.collection]),fe=S(()=>{f&&(r({type:"REMOVE_ITEM",itemId:f}),y(null))},[f,r]),oe=S(()=>{if(n.collection.length===0)return;let ke=Di(n.collection,800,600);r({type:"PAN",panX:ke.panX,panY:ke.panY}),r({type:"ZOOM",zoom:ke.zoom})},[n.collection,r]);re(()=>{let ue={menus:[{label:"File",items:[{label:"New Board",onClick:K},{label:"Export JSON",onClick:Q},{label:"Import JSON",onClick:ie},{divider:!0},{label:"Print",onClick:J}]},{label:"Edit",items:[{label:"Undo",shortcut:"Ctrl+Z",onClick:i,disabled:!a},{label:"Redo",shortcut:"Ctrl+Y",onClick:s,disabled:!l},{divider:!0},{label:"Select All",shortcut:"Ctrl+A",onClick:le},{label:"Delete Selected",onClick:fe}]},{label:"View",items:[{label:"Zoom In",onClick:V},{label:"Zoom Out",onClick:X},{label:"Fit All",onClick:oe},{divider:!0},{label:"Toggle Grid",onClick:Z}]}]}},[K,Q,ie,J,i,s,a,l,le,fe,V,X,oe,Z]),re(()=>{let ue=ve=>{let ke=ve;ke.ctrlKey&&ke.key==="z"?(ke.preventDefault(),i()):ke.ctrlKey&&ke.key==="y"&&(ke.preventDefault(),s())};return document.addEventListener("keydown",ue),()=>document.removeEventListener("keydown",ue)},[i,s]),re(()=>{if(!L)return;let ue=()=>I(null),ve=setTimeout(()=>document.addEventListener("click",ue),0);return()=>{clearTimeout(ve),document.removeEventListener("click",ue)}},[L]);let me=S(()=>{T(x),A(!0)},[x]),he=S(()=>{let ue=M.trim();ue&&(v(ue),r({type:"RENAME_BOARD",name:ue}),e.onTitleChange&&e.onTitleChange(`Project Board: ${ue}`)),A(!1)},[M,r,e.onTitleChange]),te=S(()=>{A(!1)},[]),de=S(ue=>{T(ue.target.value)},[]),ge=S(ue=>{let ve=ue;ve.key==="Enter"&&(ve.preventDefault(),he()),ve.key==="Escape"&&(ve.preventDefault(),te())},[he,te]),xe={display:"flex",flexDirection:"column",width:"100%",height:"100%",backgroundColor:"#f8fafc",overflow:"hidden"},ye=S((ue,ve)=>{let ke=(-n.viewport.panX+300)/n.viewport.zoom,Pe=(-n.viewport.panY+200)/n.viewport.zoom,Xe=(Math.random()-.5)*300,Je=(Math.random()-.5)*200,lt={type:"card",card_id:et(),card_type:"text",card_title:ue,card_link:[],content:{text:ve},color:d,position:{x:Math.round(ke+Xe),y:Math.round(Pe+Je)},size:{width:180,height:120},priority:"medium",createdAt:Date.now(),updatedAt:Date.now()};r({type:"ADD_ITEM",item:lt})},[n.viewport,d,r]),Me={display:"flex",alignItems:"center",height:"28px",backgroundColor:"#f1f5f9",borderBottom:"1px solid #e2e8f0",padding:"0 8px",fontSize:"13px",flexShrink:"0"},ce={padding:"2px 10px",border:"none",backgroundColor:"transparent",cursor:"pointer",fontSize:"13px",color:"#334155",borderRadius:"4px",fontFamily:"inherit"},be=S(()=>{let ue=(-n.viewport.panX+300)/n.viewport.zoom,ve=(-n.viewport.panY+200)/n.viewport.zoom,ke=(Math.random()-.5)*300,Pe=(Math.random()-.5)*200;r({type:"ADD_CONTAINER",container:{type:"container",container_id:et(),name:"New Container",position:{x:Math.round(ue+ke),y:Math.round(ve+Pe)},size:{width:300,height:250},contents:[]}}),I(null)},[n.viewport,r]),Ee={position:"absolute",top:"100%",left:"0",marginTop:"2px",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"180px",zIndex:"1000"},Re={display:"block",width:"100%",padding:"6px 14px",border:"none",backgroundColor:"transparent",textAlign:"left",cursor:"pointer",fontSize:"13px",color:"#334155",fontFamily:"inherit",boxSizing:"border-box"},Ne=o("div",{style:Me,"data-testid":"app-menu-bar"},o("div",{style:{position:"relative",display:"inline-flex"}},o("button",{style:ce,onClick:()=>I(L==="project"?null:"project")},"Project"),L==="project"?o("div",{style:Ee},o("button",{style:Re,onClick:()=>{me(),I(null)}},"Rename Project..."),o("div",{style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}}),o("button",{style:Re,onClick:()=>{be()}},"New Container"),o("button",{style:Re,onClick:()=>{O(),I(null)}},"New Card")):null),o("div",{style:{position:"relative",display:"inline-flex"}},o("button",{style:ce,onClick:()=>I(L==="graphs"?null:"graphs")},"Graphs"),L==="graphs"?o("div",{style:Ee},o("button",{style:Re,onClick:()=>{$(""),F("1"),k("add"),I(null)}},"Add Attribute..."),o("button",{style:Re,onClick:()=>{k("delete"),I(null)}},"Delete Attribute..."),o("button",{style:Re,onClick:()=>{W(E.map(ue=>({...ue}))),k("edit"),I(null)}},"Edit Attributes...")):null),o("div",{style:{position:"relative",display:"inline-flex"}},o("button",{style:ce,onClick:()=>I(L==="settings"?null:"settings")},"Settings"),L==="settings"?o("div",{style:Ee},o("button",{style:Re,onClick:()=>{Z(),I(null)}},h?"Disable Grid Snap":"Enable Grid Snap"),o("button",{style:Re,onClick:()=>{H(),I(null)}},P?"Hide Links":"Show Links")):null),o("div",{style:{position:"relative",display:"inline-flex"}},o("button",{style:ce,onClick:()=>I(L==="help"?null:"help")},"Help"),L==="help"?o("div",{style:Ee},o("button",{style:Re,onClick:()=>I(null)},"About Project Board"),o("button",{style:Re,onClick:()=>I(null)},"Keyboard Shortcuts")):null),o("span",{style:{marginLeft:"auto",fontSize:"12px",color:"#94a3b8"}},`Project Board: ${x}`)),ae=D?o("div",{style:{position:"absolute",inset:"0",backgroundColor:"rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"200"},onClick:te},o("div",{style:{backgroundColor:"#ffffff",borderRadius:"8px",padding:"20px",boxShadow:"0 8px 24px rgba(0,0,0,0.2)",minWidth:"300px"},onClick:ue=>ue.stopPropagation(),role:"dialog","aria-label":"Rename project"},o("div",{style:{fontWeight:"600",fontSize:"14px",marginBottom:"12px",color:"#1a1a1a"}},"Rename Project"),o("input",{type:"text",value:M,onInput:de,onKeyDown:ge,autoFocus:!0,style:{width:"100%",padding:"8px 10px",border:"1px solid #d1d5db",borderRadius:"6px",fontSize:"14px",boxSizing:"border-box",outline:"none",fontFamily:"inherit"},"data-testid":"rename-input"}),o("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"12px"}},o("button",{onClick:te,style:{padding:"6px 14px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",cursor:"pointer",fontSize:"13px",fontFamily:"inherit"}},"Cancel"),o("button",{onClick:he,style:{padding:"6px 14px",border:"none",borderRadius:"6px",backgroundColor:"#3b82f6",color:"#ffffff",cursor:"pointer",fontSize:"13px",fontWeight:"600",fontFamily:"inherit"},"data-testid":"rename-confirm"},"Rename")))):null,pe={position:"absolute",inset:"0",backgroundColor:"rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"200"},Se={backgroundColor:"#ffffff",borderRadius:"8px",padding:"20px",boxShadow:"0 8px 24px rgba(0,0,0,0.2)",minWidth:"320px",maxHeight:"400px",overflow:"auto"},we={fontWeight:"600",fontSize:"14px",marginBottom:"12px",color:"#1a1a1a"},Ie={width:"100%",padding:"8px 10px",border:"1px solid #d1d5db",borderRadius:"6px",fontSize:"14px",boxSizing:"border-box",outline:"none",fontFamily:"inherit"},Le={padding:"6px 14px",border:"none",borderRadius:"6px",backgroundColor:"#3b82f6",color:"#ffffff",cursor:"pointer",fontSize:"13px",fontWeight:"600",fontFamily:"inherit"},ze={padding:"6px 14px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",cursor:"pointer",fontSize:"13px",fontFamily:"inherit"},Te=null;return z==="add"&&(Te=o("div",{style:pe,onClick:()=>k(null)},o("div",{style:Se,onClick:ue=>ue.stopPropagation(),role:"dialog","aria-label":"Add edge attribute"},o("div",{style:we},"Add Edge Attribute"),o("div",{style:{marginBottom:"8px"}},o("label",{style:{fontSize:"12px",color:"#64748b",display:"block",marginBottom:"4px"}},"Name"),o("input",{type:"text",value:w,style:Ie,placeholder:"e.g. depends on",onInput:ue=>$(ue.target.value)})),o("div",{style:{marginBottom:"12px"}},o("label",{style:{fontSize:"12px",color:"#64748b",display:"block",marginBottom:"4px"}},"Weight"),o("input",{type:"number",value:C,style:Ie,min:"0",step:"1",onInput:ue=>F(ue.target.value)})),o("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px"}},o("button",{style:ze,onClick:()=>k(null)},"Cancel"),o("button",{style:Le,onClick:()=>{let ue=w.trim(),ve=parseFloat(C)||1;ue&&N(ke=>[...ke,{name:ue,weight:ve}]),k(null)}},"Add"))))),z==="delete"&&(Te=o("div",{style:pe,onClick:()=>k(null)},o("div",{style:Se,onClick:ue=>ue.stopPropagation(),role:"dialog","aria-label":"Delete edge attribute"},o("div",{style:we},"Delete Edge Attribute"),E.length===0?o("div",{style:{color:"#94a3b8",padding:"8px 0"}},"No attributes defined."):o("div",{style:{display:"flex",flexDirection:"column",gap:"4px"}},...E.map((ue,ve)=>o("div",{key:String(ve),style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 8px",borderRadius:"4px",border:"1px solid #e5e7eb"}},o("span",{style:{fontSize:"13px"}},`${ue.name} (weight: ${ue.weight})`),o("button",{style:{border:"none",backgroundColor:"transparent",color:"#ef4444",cursor:"pointer",fontSize:"16px"},onClick:()=>N(ke=>ke.filter((Pe,Xe)=>Xe!==ve))},"\xD7")))),o("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"12px"}},o("button",{style:ze,onClick:()=>k(null)},"Done"))))),z==="edit"&&(Te=o("div",{style:pe,onClick:()=>k(null)},o("div",{style:{...Se,minWidth:"400px"},onClick:ue=>ue.stopPropagation(),role:"dialog","aria-label":"Edit edge attributes"},o("div",{style:we},"Edit Edge Attributes"),R.length===0?o("div",{style:{color:"#94a3b8",padding:"8px 0"}},"No attributes defined."):o("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},...R.map((ue,ve)=>o("div",{key:String(ve),style:{display:"flex",alignItems:"center",gap:"8px"}},o("input",{type:"text",value:ue.name,style:{...Ie,flex:"1"},onInput:ke=>{let Pe=ke.target.value;W(Xe=>Xe.map((Je,lt)=>lt===ve?{...Je,name:Pe}:Je))}}),o("input",{type:"number",value:String(ue.weight),min:"0",step:"1",style:{...Ie,width:"80px"},onInput:ke=>{let Pe=parseFloat(ke.target.value)||0;W(Xe=>Xe.map((Je,lt)=>lt===ve?{...Je,weight:Pe}:Je))}})))),o("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"12px"}},o("button",{style:ze,onClick:()=>k(null)},"Cancel"),o("button",{style:Le,onClick:()=>{N(R.filter(ue=>ue.name.trim())),k(null)}},"Save"))))),o("div",{className:"project-manager-app",style:xe,"data-testid":"project-manager-app"},Ne,o(zi,{zoom:n.viewport.zoom,gridEnabled:h,selectedColor:d,colorFilter:b,onNewCard:O,onZoomIn:V,onZoomOut:X,onZoomReset:ee,onColorSelect:u,onColorFilter:Y,onGridToggle:Z,onSearch:U}),o(_i,{collection:n.collection,onCardDropped:ye},o(Vn,{state:n,dispatch:r,searchQuery:c,gridEnabled:h,selectedId:f,onSelectItem:G,colorFilter:b,onUpdateItem:(ue,ve)=>{r({type:"UPDATE_CARD",cardId:ue,updates:ve})},onCardContextMenu:(ue,ve)=>{}})),ae,Te)}var id=28,sd=5e3;var Yi=0;function Vi(e){return Yi++,`${e}-${Yi}`}function ad(e){return e.replace(/\s*\(\d+\)$/,"")}function ld(e){let{toasts:t,onDismiss:n}=e;if(t.length===0)return null;let r={position:"absolute",top:"8px",right:"8px",zIndex:"9999",display:"flex",flexDirection:"column",gap:"8px",pointerEvents:"none",maxWidth:"320px"},i=t.map(s=>{let a="rgba(50, 50, 50, 0.95)",l="#555";return s.severity==="warning"?(a="rgba(60, 40, 10, 0.95)",l="#f39c12"):s.severity==="error"&&(a="rgba(60, 10, 10, 0.95)",l="#e74c3c"),o("div",{key:String(s.id),className:`unity-desktop__toast unity-desktop__toast--${s.severity}`,style:{backgroundColor:a,border:`1px solid ${l}`,borderRadius:"6px",padding:"10px 14px",color:"#ffffff",fontSize:"13px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",pointerEvents:"auto",cursor:"pointer",transition:"opacity 200ms ease"},onClick:()=>n(s.id),role:"alert","aria-live":"polite"},s.message)});return o("div",{className:"unity-desktop__toast-container",style:r,"aria-label":"Notifications"},...i)}function cd(){let e=it(),t=ne(!1);return re(()=>{t.current||(t.current=!0,e.publish("terminal-output",{text:"Terminal session started",pid:1}))},[e]),o("div",{style:{padding:"16px",fontSize:"12px",color:"#00ff41",height:"100%",overflow:"auto",backgroundColor:"#1a1a2e",fontFamily:"monospace"}},o("div",null,"$ whoami"),o("div",null,"operator"),o("div",null,"$ uname -a"),o("div",null,"Linux specifyjs 6.1.0 #1 SMP x86_64 GNU/Linux"),o("div",{style:{opacity:"0.6",marginTop:"8px",fontSize:"10px"}},"[Published terminal-output message]"),o("div",null,"$ _"))}function dd(){let[e,t]=j([]),n=ut();Tt("terminal-output",s=>{t(a=>[...a,`[terminal] ${s.payload.text}`])});let r=S(s=>{s.preventDefault(),n.startDrag({type:"application/file",data:{name:"readme.txt",size:1024},sourceAppId:"files",preview:"readme.txt"})},[n]);return o("div",{style:{padding:"16px",fontSize:"13px",color:"var(--color-text, #333)",height:"100%",overflow:"auto"}},o("div",{style:{fontWeight:"600",marginBottom:"12px"}},"Home"),o("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},...["\u{1F4C1} Documents","\u{1F4C1} Downloads","\u{1F4C1} Music","\u{1F4C1} Pictures","\u{1F4C1} Videos"].map(s=>o("span",{style:{cursor:"pointer"}},s)),o("span",{style:{cursor:"grab",padding:"4px 8px",border:"1px dashed #94a3b8",borderRadius:"4px",backgroundColor:"rgba(148, 163, 184, 0.1)"},onMouseDown:r,"aria-label":"Drag readme.txt"},"\u{1F4C4} readme.txt (drag me)")),e.length>0?o("div",{style:{marginTop:"12px",padding:"8px",backgroundColor:"rgba(0,0,0,0.05)",borderRadius:"4px",fontSize:"11px",fontFamily:"monospace"}},o("div",{style:{fontWeight:"600",marginBottom:"4px"}},"Messages received:"),...e.map((s,a)=>o("div",{key:String(a),style:{color:"#64748b"}},s))):null)}function ud(e,t,n){let r={padding:"16px",fontSize:"13px",color:"var(--color-text, #333)",height:"100%",overflow:"auto"};switch(ad(e)){case"Files":return o(rt,{appId:"files"},o(dd,null));case"Terminal":return o(rt,{appId:"terminal"},o(cd,null));case"Browser":return o("div",{style:r},o("div",{style:{padding:"6px 10px",backgroundColor:"#f1f5f9",borderRadius:"4px",marginBottom:"12px",fontSize:"12px",color:"#64748b"}},"https://specifyjs.asymmetric-effort.com"),o("div",{style:{textAlign:"center",padding:"32px",color:"#94a3b8"}},"Web page content area"));case"Mail":return o("div",{style:r},o("div",{style:{fontWeight:"600",marginBottom:"8px"}},"Inbox (3)"),...["Build passed \u2014 CI/CD Pipeline","PR Review: feat/unity-desktop","Weekly sync notes"].map(s=>o("div",{style:{padding:"8px",borderBottom:"1px solid #e2e8f0",cursor:"pointer"}},s)));case"Settings":return o("div",{style:r},o("div",{style:{fontWeight:"600",marginBottom:"12px"}},"System Settings"),...["Appearance","Network","Sound","Power","Users","About"].map(s=>o("div",{style:{padding:"8px 0",borderBottom:"1px solid #e2e8f0"}},s)));case"Word Processor":return o(qt,null);case"IDE":return o(Kt,null);case"Trading":return o(Qt,null);case"Project Board":return o(Hi,{boardId:t||"default",onTitleChange:n||void 0});default:return o("div",{style:r},o("div",{style:{textAlign:"center",padding:"32px",color:"#94a3b8"}},`${e} application content`))}}function pd(e){let{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s="dark",children:a}=e,l=Pt(),d=l.activeMenuBar,u=l.dockSignals,h=ne(l);h.current=l;let[g,c]=j([]),[p,f]=j([]),[y,b]=j(!1),[m,x]=j(!1),[v,D]=j(null),[A,M]=j({x:0,y:0}),[T,L]=j(null),I=S(()=>{b(te=>!te)},[]),P=S(te=>{f(de=>de.filter(ge=>ge.id!==te))},[]);re(()=>{if(p.length===0)return;let te=p[0],de=Date.now()-te.timestamp,ge=Math.max(0,sd-de),xe=setTimeout(()=>{f(ye=>ye.filter(Me=>Me.id!==te.id))},ge);return()=>clearTimeout(xe)},[p]);let B=ne(t);B.current=t;let E=ne(r);E.current=r;let N=ne({});for(let te of g)if(!N.current[te.id]){let de=te.id;N.current[de]=ge=>{c(xe=>xe.map(ye=>ye.id===de?{...ye,title:ge}:ye))}}let z=S(te=>{let ge=B.current.find(xe=>xe.id===te);ge&&(c(xe=>{let Me=xe.filter(Ne=>Ne.appId===te).length+1,ce=Me===1?ge.label:`${ge.label} (${Me})`,be=Vi(te),Ee=xe.length>0?Math.max(...xe.map(Ne=>Ne.zIndex))+1:1,Re={id:be,appId:ge.id,title:ce,icon:ge.icon,x:60+xe.length*30,y:40+xe.length*30,width:600,height:400,zIndex:Ee,focused:!0,windowState:"normal"};return[...xe.map(Ne=>({...Ne,focused:!1})),Re]}),te==="files"&&h.current.setMenuBar("files",{menus:[{label:"File",items:[{label:"New",shortcut:"Ctrl+N",onClick:()=>{}},{label:"Open",shortcut:"Ctrl+O",onClick:()=>{}},{label:"Save",shortcut:"Ctrl+S",onClick:()=>{}}]},{label:"Edit",items:[{label:"Cut",shortcut:"Ctrl+X",onClick:()=>{}},{label:"Copy",shortcut:"Ctrl+C",onClick:()=>{}},{label:"Paste",shortcut:"Ctrl+V",onClick:()=>{}}]}]}),te==="terminal"&&h.current.signalDock("terminal",{badge:3}),E.current&&E.current(te))},[]),k=S(te=>{c(de=>{if(!de.find(ye=>ye.id===te))return de;let xe=Math.max(...de.map(ye=>ye.zIndex))+1;return de.map(ye=>ye.id===te?{...ye,focused:!0,zIndex:xe,windowState:ye.windowState==="minimized"?"normal":ye.windowState}:{...ye,focused:!1})})},[]),w=S(te=>{c(de=>{let ge=de.filter(ce=>ce.appId===te);if(ge.length===0)return de;let ye=[...ge].sort((ce,be)=>be.zIndex-ce.zIndex)[0],Me=Math.max(...de.map(ce=>ce.zIndex))+1;return de.map(ce=>ce.id===ye.id?{...ce,focused:!0,zIndex:Me,windowState:ce.windowState==="minimized"?"normal":ce.windowState}:{...ce,focused:!1})}),c(de=>{if(de.filter(xe=>xe.appId===te).length===0){let ye=B.current.find(Ee=>Ee.id===te);if(!ye)return de;let Me=Vi(te),ce=de.length>0?Math.max(...de.map(Ee=>Ee.zIndex))+1:1,be={id:Me,appId:ye.id,title:ye.label,icon:ye.icon,x:60+de.length*30,y:40+de.length*30,width:600,height:400,zIndex:ce,focused:!0,windowState:"normal"};return te==="files"&&h.current.setMenuBar("files",{menus:[{label:"File",items:[{label:"New",shortcut:"Ctrl+N",onClick:()=>{}},{label:"Open",shortcut:"Ctrl+O",onClick:()=>{}},{label:"Save",shortcut:"Ctrl+S",onClick:()=>{}}]},{label:"Edit",items:[{label:"Cut",shortcut:"Ctrl+X",onClick:()=>{}},{label:"Copy",shortcut:"Ctrl+C",onClick:()=>{}},{label:"Paste",shortcut:"Ctrl+V",onClick:()=>{}}]}]}),te==="terminal"&&h.current.signalDock("terminal",{badge:3}),E.current&&E.current(te),[...de.map(Ee=>({...Ee,focused:!1})),be]}return de})},[]),$=t.map(te=>{let de=g.some(ye=>ye.appId===te.id),ge=u.get(te.id),xe={id:te.id,icon:te.icon,label:ge?.tooltip||te.label,active:de};return ge&&(ge.badge!=null&&(xe.badge=ge.badge>0?ge.badge:void 0),ge.progress!=null&&(xe.progress=ge.progress>0?ge.progress:void 0),ge.urgent&&(xe.urgent=!0)),xe}),C=g.find(te=>te.focused),F=C?C.title:void 0,R=S(()=>{x(!0)},[]),W=S(()=>{x(!1)},[]),_=S((te,de)=>{D(te),M(de)},[]),O=S(()=>{D(null)},[]),V=S(()=>{},[]),X=S(()=>{i&&i()},[i]),ee=[];n&&(ee.push({label:n.name,icon:void 0,onClick:V,divider:!1}),ee.push({label:"",icon:void 0,onClick:V,divider:!0})),ee.push({label:"Lock",icon:void 0,onClick:R,divider:!1}),ee.push({label:"Logout",icon:void 0,onClick:X,divider:!1});let Z=q(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'Ubuntu, "Segoe UI", sans-serif',fontSize:"13px",color:s==="dark"?"#ffffff":"#1a1a1a",overflow:"hidden",position:"relative"}),[s]),U={display:"flex",flex:"1",overflow:"hidden"},G={display:"flex",flexDirection:"column",height:"100%",backgroundColor:s==="dark"?"var(--dock-bg, rgba(0, 0, 0, 0.7))":"var(--dock-bg, rgba(200, 200, 200, 0.9))",borderRight:s==="dark"?"1px solid rgba(255, 255, 255, 0.1)":"1px solid rgba(0, 0, 0, 0.1)",flexShrink:"0"},Y={width:"100%",height:"100%",position:"relative"},H=o(Bn,{activeAppName:F,activitiesButton:{label:"Activities",onClick:I},appMenuBar:d||void 0,clockFormat:"24h",showSeconds:!0,showDate:!0,user:n?{name:n.name,avatar:n.avatar}:void 0,userMenuItems:ee.length>0?ee:void 0,height:id}),K=o(Fn,{items:$,orientation:"vertical",position:"left",iconSize:36,onItemClick:w,onItemContextMenu:_}),Q=o(ld,{toasts:p,onDismiss:P}),ie=g.filter(te=>te.windowState!=="minimized").map(te=>o(At,{key:te.id,id:te.id,title:te.title,icon:te.icon,defaultPosition:{x:te.x,y:te.y},defaultSize:{width:te.width,height:te.height},zIndex:te.zIndex,focused:te.focused,windowState:te.windowState,onClose:()=>{c(de=>de.filter(ge=>ge.id!==te.id))},onFocus:()=>{c(de=>{let ge=Math.max(...de.map(xe=>xe.zIndex))+1;return de.map(xe=>xe.id===te.id?{...xe,focused:!0,zIndex:ge}:{...xe,focused:!1})})},onMinimize:()=>{c(de=>de.map(ge=>ge.id===te.id?{...ge,windowState:"minimized"}:ge))},onMaximize:()=>{c(de=>de.map(ge=>ge.id===te.id?{...ge,windowState:ge.windowState==="maximized"?"normal":"maximized"}:ge))}},ud(t.find(de=>de.id===te.appId)?.label||te.title,te.id,N.current[te.id]))),J=[];a&&J.push(a),J.push(...ie),J.push(Q);let se=o(Nn,{backgroundColor:s==="dark"?"#2c001e":"#e8e0e4",backgroundGradient:s==="dark"?"linear-gradient(135deg, #2c001e 0%, #5e2750 50%, #2c001e 100%)":"linear-gradient(135deg, #e8e0e4 0%, #d4c4d0 50%, #e8e0e4 100%)"},o("div",{className:"unity-desktop__workspace",style:Y},...J)),le=y?o("div",{style:{position:"absolute",inset:"0",zIndex:"100",backgroundColor:"rgba(0, 0, 0, 0.85)",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(80px, 1fr))",gap:"24px",padding:"48px",alignContent:"start",overflowY:"auto"},onClick:I},...t.map(te=>o("button",{key:te.id,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",color:"#ffffff",cursor:"pointer",padding:"12px",borderRadius:"8px",fontSize:"12px"},onClick:de=>{de.stopPropagation(),b(!1),w(te.id)}},o("span",{style:{fontSize:"32px",display:"block"}},te.icon),o("span",null,te.label)))):null,fe=m?o("div",{className:"unity-desktop__lock-overlay",style:{position:"absolute",inset:"0",zIndex:"9999",backgroundColor:"rgba(0,0,0,0.85)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#ffffff"},onClick:W},o("div",{style:{fontSize:"64px",marginBottom:"16px"}},"\u{1F512}"),o("div",{style:{fontSize:"24px",fontWeight:"600",marginBottom:"8px"}},"Locked"),o("div",{style:{fontSize:"14px",opacity:"0.7"}},"Click to unlock")):null,oe=(()=>{if(!v)return null;let te=t.find(ce=>ce.id===v),de=g.filter(ce=>ce.appId===v),ge={padding:"6px 14px",cursor:"pointer"},xe={onMouseEnter:ce=>{ce.currentTarget.style.backgroundColor="#444"},onMouseLeave:ce=>{ce.currentTarget.style.backgroundColor="transparent"}},ye={borderBottom:"1px solid #444",margin:"4px 0"},Me=[];return Me.push(o("div",{key:"new",style:ge,...xe,onClick:()=>{z(v),D(null)},role:"menuitem"},"\u25CF New")),de.length>0&&(Me.push(o("div",{key:"sep-1",style:ye})),de.forEach((ce,be)=>{let Ee=ce.title;Me.push(o("div",{key:`inst-${ce.id}`,style:ge,...xe,onClick:()=>{k(ce.id),D(null)},role:"menuitem"},Ee))})),Me.push(o("div",{key:"sep-2",style:ye})),Me.push(o("div",{key:"about",style:ge,...xe,onClick:()=>{L(v),D(null)},role:"menuitem"},"About")),o("div",{className:"unity-desktop__context-menu-backdrop",style:{position:"absolute",inset:"0",zIndex:"9000"},onClick:O},o("div",{className:"unity-desktop__context-menu",style:{position:"absolute",top:`${A.y}px`,left:`${A.x}px`,backgroundColor:"#2d2d2d",border:"1px solid #555",borderRadius:"6px",padding:"4px 0",minWidth:"160px",boxShadow:"0 4px 12px rgba(0,0,0,0.4)",zIndex:"9001",color:"#ffffff",fontSize:"13px"},onClick:ce=>ce.stopPropagation()},...Me))})(),me=T?t.find(te=>te.id===T):null,he=me?o("div",{className:"unity-desktop__about-backdrop",style:{position:"absolute",inset:"0",zIndex:"9500",backgroundColor:"rgba(0,0,0,0.5)",display:"flex",alignItems:"center",justifyContent:"center"},onClick:()=>L(null)},o("div",{style:{backgroundColor:"#2d2d2d",border:"1px solid #555",borderRadius:"8px",padding:"24px",minWidth:"280px",color:"#ffffff",textAlign:"center"},onClick:te=>te.stopPropagation()},o("div",{style:{fontSize:"18px",fontWeight:"600",marginBottom:"8px"}},me.label),o("div",{style:{fontSize:"13px",marginBottom:"4px",color:"#aaa"}},"SpecifyJS Demo App"),o("div",{style:{fontSize:"13px",marginBottom:"4px",color:"#aaa"}},"MIT License"),o("div",{style:{fontSize:"13px",color:"#aaa"}},"v0.2.47"),o("button",{style:{marginTop:"16px",padding:"6px 16px",border:"1px solid #555",borderRadius:"4px",backgroundColor:"#444",color:"#fff",cursor:"pointer"},onClick:()=>L(null)},"Close"))):null;return o("div",{className:"unity-desktop",style:Z,"data-theme":s},o("div",{className:"unity-desktop__top-panel",style:{flexShrink:"0",zIndex:"10"}},H),o("div",{style:U},o("div",{className:"unity-desktop__dock",style:G},K),o("main",{className:"unity-desktop__desktop",style:{flex:"1",position:"relative",overflow:"hidden",minHeight:"0"}},se,le)),oe,he,fe)}function Ui(e){let{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s="dark",children:a}=e;return o(zn,{onWindowOpen:r},o($t,null,o(Dt,null,o(pd,{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s,children:a}))))}function ji(e){let{id:t,title:n,icon:r,defaultPosition:i,defaultSize:s,minSize:a,resizable:l=!0,onClose:d,menuBar:u,onActivate:h,onDeactivate:g,children:c}=e,p=Pt(),f=q(()=>p.windows.find(T=>T.id===t),[p.windows,t]);re(()=>(u?p.setMenuBar(t,u):p.clearMenuBar(t),()=>{p.clearMenuBar(t)}),[u,t,p]);let y=ne(!1),b=f?f.focused:!1;re(()=>{let T=y.current;y.current=b,b&&!T?h&&h():!b&&T&&g&&g()},[b,h,g]);let m=S(()=>{p.closeWindow(t),d&&d()},[p,t,d]),x=S(()=>{p.focusWindow(t)},[p,t]),v=S(T=>{p.moveWindow(t,T)},[p,t]),D=S(T=>{p.resizeWindow(t,T)},[p,t]),A=S(()=>{p.minimizeWindow(t)},[p,t]),M=S(()=>{f&&f.windowState==="maximized"?p.restoreWindow(t):p.maximizeWindow(t)},[p,t,f]);return f?o(rt,{appId:t},o(At,{id:t,title:n,icon:r,defaultPosition:f.position,defaultSize:f.size,minSize:a,resizable:l,windowState:f.windowState,focused:f.focused,zIndex:f.zIndex,onClose:m,onFocus:x,onMove:v,onResize:D,onMinimize:A,onMaximize:M,children:c})):(p.openWindow({id:t,title:n,icon:r,position:i,size:s}),null)}var Gi={sm:{padding:"3px 10px",fontSize:"12px",borderRadius:"4px"},md:{padding:"6px 14px",fontSize:"13px",borderRadius:"6px"},lg:{padding:"8px 20px",fontSize:"15px",borderRadius:"6px"}},Xi={primary:{bg:"#3b82f6",color:"white",border:"#3b82f6"},secondary:{bg:"#f8fafc",color:"#0f172a",border:"#d1d5db"},outline:{bg:"transparent",color:"#0f172a",border:"#d1d5db"},ghost:{bg:"transparent",color:"#0f172a",border:"transparent"},danger:{bg:"#ef4444",color:"white",border:"#ef4444"}};function qi(e){let{children:t,onClick:n,variant:r="secondary",size:i="md",disabled:s=!1,fullWidth:a=!1,type:l="button",className:d,style:u,ariaLabel:h,active:g=!1}=e,c=q(()=>{let p=Gi[i]??Gi.md,f=Xi[r]??Xi.secondary,y={padding:p.padding,fontSize:p.fontSize,borderRadius:p.borderRadius,border:`1px solid ${f.border}`,backgroundColor:g?"#3b82f6":f.bg,color:g?"white":f.color,cursor:s?"default":"pointer",fontFamily:"inherit",lineHeight:"1.4",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"4px",transition:"background-color 0.15s, opacity 0.15s",opacity:s?"0.5":"1"};return a&&(y.width="100%"),u&&Object.assign(y,u),y},[r,i,s,a,g,u]);return o("button",{type:l,onClick:s?void 0:n,disabled:s,className:d,style:c,"aria-label":h,"aria-pressed":g?"true":void 0},t)}var fd=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],Mt=Math.PI/180;function gd(e,t,n,r,i,s,a,l,d,u){let h=Math.cos(r*Mt),g=Math.sin(r*Mt),c=Math.cos(i*Mt),p=Math.sin(i*Mt),f=Math.cos(s*Mt),y=Math.sin(s*Mt),b=e*f-t*y,m=e*y+t*f,x=b*c-m*p,v=b*p+m*c,D=n,A=x,M=v*h-D*g,T=v*g+D*h,L=1+a*.001*T,I=l+A*u*L,P=d-M*u*L;return{sx:I,sy:P,depth:T}}function Ki(e,t){let n=e.replace("#",""),r,i,s;return n.length===3?(r=parseInt(n[0]+n[0],16),i=parseInt(n[1]+n[1],16),s=parseInt(n[2]+n[2],16)):(r=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16)),r=isNaN(r)?0:r,i=isNaN(i)?0:i,s=isNaN(s)?0:s,`rgba(${r},${i},${s},${t})`}function Zi(e,t){let n=e.replace("#",""),r,i,s;n.length===3?(r=parseInt(n[0]+n[0],16),i=parseInt(n[1]+n[1],16),s=parseInt(n[2]+n[2],16)):(r=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16)),r=isNaN(r)?0:r,i=isNaN(i)?0:i,s=isNaN(s)?0:s;let a=d=>Math.max(0,Math.min(255,Math.round(d*t))),l=d=>a(d).toString(16).padStart(2,"0");return"#"+l(r)+l(i)+l(s)}function Ji(e){let{layers:t,width:n=700,height:r=500,perspective:i=.5,rotateX:s=35,rotateY:a=45,rotateZ:l=0,showLabels:d=!0,showAxes:u=!0,layerSpacing:h=2,colorScale:g=fd,gridColor:c="#94a3b8",title:p}=e,f=q(()=>{let z=0,k=0,w=0;for(let $=0;$<t.length;$++){let C=t[$],F=C.data.length;F>z&&(z=F);for(let R=0;R<F;R++){let W=C.data[R].length;W>k&&(k=W);for(let _=0;_<W;_++){let O=Math.abs(C.data[R][_]??0);O>w&&(w=O)}}}return{maxRows:Math.max(z,1),maxCols:Math.max(k,1),maxHeight:w>0?w:1}},[t]),y=q(()=>{let z=f.maxHeight+(t.length-1)*h+f.maxHeight,k=Math.sqrt(f.maxCols*f.maxCols+f.maxRows*f.maxRows+z*z),w=Math.min(n,r)*.75;return k>0?w/k:1},[f,t.length,h,n,r]),b=n/2,m=r/2,x=S((z,k,w)=>gd(z,k,w,s,a,l,i,b,m,y),[s,a,l,i,b,m,y]),v=S(()=>{if(!u)return[];let z=[],k=Math.max(f.maxCols,f.maxRows),w=f.maxCols/2,$=f.maxRows/2,C=x(-w,-$,0),F=x(w,-$,0);z.push(o("line",{key:"axis-x",x1:String(C.sx),y1:String(C.sy),x2:String(F.sx),y2:String(F.sy),stroke:"#374151","stroke-width":"1.5"})),z.push(o("text",{key:"axis-x-label",x:String(F.sx+8),y:String(F.sy+4),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"X"));let R=x(-w,$,0);z.push(o("line",{key:"axis-y",x1:String(C.sx),y1:String(C.sy),x2:String(R.sx),y2:String(R.sy),stroke:"#374151","stroke-width":"1.5"})),z.push(o("text",{key:"axis-y-label",x:String(R.sx-12),y:String(R.sy+4),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Y"));let W=f.maxHeight+(t.length-1)*h,_=x(-w,-$,W);return z.push(o("line",{key:"axis-z",x1:String(C.sx),y1:String(C.sy),x2:String(_.sx),y2:String(_.sy),stroke:"#374151","stroke-width":"1.5"})),z.push(o("text",{key:"axis-z-label",x:String(_.sx-4),y:String(_.sy-8),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Z")),z},[u,f,t.length,h,x]),D=S(()=>{let z=[],k=f.maxCols/2,w=f.maxRows/2,$=[];for(let C=0;C<t.length;C++){let F=t[C],R=F.color??g[C%g.length],W=F.opacity??.7,_=C*h,O=F.data.length;for(let V=0;V<O-1;V++){let X=F.data[V],ee=F.data[V+1],Z=Math.min(X.length,ee.length);for(let U=0;U<Z-1;U++){let G=U-k,Y=U+1-k,H=V-w,K=V+1-w,Q=(X[U]??0)+_,ie=(X[U+1]??0)+_,J=(ee[U]??0)+_,se=(ee[U+1]??0)+_,le=x(G,H,Q),fe=x(Y,H,ie),oe=x(G,K,J),me=x(Y,K,se),he=(le.depth+fe.depth+oe.depth+me.depth)/4,te=`${le.sx},${le.sy} ${fe.sx},${fe.sy} ${me.sx},${me.sy} ${oe.sx},${oe.sy}`;$.push({points:te,fill:Ki(R,W),stroke:Zi(R,.7),strokeWidth:"0.5",depth:he,key:`quad-${C}-${V}-${U}`})}}if(O===1||O>0&&F.data[0].length===1)for(let V=0;V<O;V++){let X=F.data[V];for(let ee=0;ee<X.length;ee++){let Z=ee-k,U=V-w,G=(X[ee]??0)+_,Y=x(Z,U,G),H=3,K=`${Y.sx},${Y.sy-H} ${Y.sx+H},${Y.sy} ${Y.sx},${Y.sy+H} ${Y.sx-H},${Y.sy}`;$.push({points:K,fill:Ki(R,W),stroke:Zi(R,.7),strokeWidth:"0.5",depth:Y.depth,key:`point-${C}-${V}-${ee}`})}}}$.sort((C,F)=>C.depth-F.depth);for(let C=0;C<$.length;C++){let F=$[C];z.push(o("polygon",{key:F.key,points:F.points,fill:F.fill,stroke:F.stroke,"stroke-width":F.strokeWidth,"stroke-linejoin":"round"}))}return z},[t,f,h,g,x]),A=S(()=>{let z=[],k=f.maxCols/2,w=f.maxRows/2;for(let $=0;$<=f.maxRows;$++){let C=$-w,F=x(-k,C,0),R=x(k,C,0);z.push(o("line",{key:`base-h-${$}`,x1:String(F.sx),y1:String(F.sy),x2:String(R.sx),y2:String(R.sy),stroke:c,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}for(let $=0;$<=f.maxCols;$++){let C=$-k,F=x(C,-w,0),R=x(C,w,0);z.push(o("line",{key:`base-v-${$}`,x1:String(F.sx),y1:String(F.sy),x2:String(R.sx),y2:String(R.sy),stroke:c,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}return z},[f,c,x]),M=S(()=>{if(!d)return[];let z=[],k=f.maxCols/2,w=f.maxRows/2;for(let $=0;$<t.length;$++){let C=t[$],F=$*h,R=0,W=0;for(let X=0;X<C.data.length;X++){let ee=C.data[X];for(let Z=0;Z<ee.length;Z++)R+=ee[Z]??0,W++}let _=W>0?R/W:0,O=x(k+1,0,_+F),V=C.color??g[$%g.length];z.push(o("text",{key:`layer-label-${$}`,x:String(O.sx+8),y:String(O.sy+4),"font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:V},C.label))}return z},[d,t,f,h,g,x]),L=S(()=>p?[o("text",{key:"title",x:String(n/2),y:String(24),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},p)]:[],[p,n])(),I=A(),P=v(),B=D(),E=M(),N=t.length===0?[o("text",{key:"empty-msg",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No layer data")]:[];return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"3D layer visualization",style:{fontFamily:"sans-serif",maxWidth:"100%"}},...L,...N,...I,...P,...B,...E)}function md(e){if(typeof e=="string")return e;if(!isFinite(e)||isNaN(e))return"--";let t=e.toString().split("."),n=t[0],r=t.length>1?"."+t[1]:"",i=n.startsWith("-"),s=i?n.slice(1):n,a="";for(let l=0;l<s.length;l++)l>0&&(s.length-l)%3===0&&(a+=","),a+=s[l];return(i?"-":"")+a+r}function hd(e){if(!isFinite(e)||isNaN(e))return"--";let t=Math.abs(e);return t<100&&t!==Math.floor(t)?t.toFixed(1):String(Math.round(t))}function Qi(e){let{value:t,label:n,prefix:r="",suffix:i="",trend:s,trendLabel:a,sparkline:l,width:d=280,height:u=160,valueColor:h="currentColor",trendUpColor:g="#22c55e",trendDownColor:c="#ef4444",backgroundColor:p="#ffffff"}=e,f=q(()=>md(t),[t]),y=s!=null&&isFinite(s)&&!isNaN(s),b=l!=null&&l.length>1,m=n!=null&&n.length>0,x=y&&s>=0?g:c,v=20,D=m?u*.38:u*.45,A=Math.min(d*.15,48),M=A*.55,T=D+A*.4+8,L=m?T+22:D+A*.4+22,I=b?Math.min(u*.22,36):0,P=u-v-I,B=d-v*2,E=S(()=>[o("rect",{key:"bg",x:"0",y:"0",width:"100%",rx:"8",ry:"8",fill:p,stroke:"#e5e7eb","stroke-width":"1"})],[d,u,p]),N=S(()=>{let O=[],V=r+f+i;return O.push(o("text",{key:"value",x:String(d/2),y:String(D),"text-anchor":"middle","dominant-baseline":"central","font-size":String(A),"font-weight":"bold","font-family":"sans-serif",fill:h,"aria-label":`Value: ${V}`},r?o("tspan",{key:"prefix","font-size":String(M),"font-weight":"normal"},r):null,f,i?o("tspan",{key:"suffix","font-size":String(M),"font-weight":"normal"},i):null)),O},[d,D,A,M,f,r,i,h]),z=S(()=>m?[o("text",{key:"label",x:String(d/2),y:String(T),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},n)]:[],[m,d,T,n]),k=S(()=>{if(!y)return[];let O=[],V=s,X=V>=0,ee=8,Z=hd(V),U=(X?"+":"-")+Z+(a?" "+a:""),G=d/2-40,Y=L;if(X){let H=`${G},${Y} ${G-ee/2},${Y+ee} ${G+ee/2},${Y+ee}`;O.push(o("polygon",{key:"trend-arrow",points:H,fill:x}))}else{let H=`${G},${Y+ee} ${G-ee/2},${Y} ${G+ee/2},${Y}`;O.push(o("polygon",{key:"trend-arrow",points:H,fill:x}))}return O.push(o("text",{key:"trend-text",x:String(G+ee+4),y:String(Y+ee*.7),"text-anchor":"start","font-size":"12","font-family":"sans-serif",fill:x,"aria-label":`Trend: ${U}`},U)),O},[y,s,a,x,d,L]),w=S(()=>{if(!b)return[];let O=[],V=l,X=[];for(let Q of V)typeof Q=="number"&&isFinite(Q)&&!isNaN(Q)&&X.push(Q);if(X.length<2)return[];let ee=1/0,Z=-1/0;for(let Q of X)Q<ee&&(ee=Q),Q>Z&&(Z=Q);ee===Z&&(ee-=1,Z+=1);let U=Z-ee,G=B/(X.length-1),Y="";for(let Q=0;Q<X.length;Q++){let ie=v+Q*G,J=P+I-(X[Q]-ee)/U*I;Q===0?Y+=`M ${ie} ${J}`:Y+=` L ${ie} ${J}`}let H=v+(X.length-1)*G,K=Y+` L ${H} ${P+I} L ${v} ${P+I} Z`;return O.push(o("defs",{key:"spark-defs"},o("linearGradient",{key:"spark-grad",id:"sparkGrad",x1:"0",y1:"0",x2:"0",y2:"1"},o("stop",{key:"stop1",offset:"0%","stop-color":"#3b82f6","stop-opacity":"0.3"}),o("stop",{key:"stop2",offset:"100%","stop-color":"#3b82f6","stop-opacity":"0.05"})))),O.push(o("path",{key:"spark-fill",d:K,fill:"url(#sparkGrad)"})),O.push(o("path",{key:"spark-line",d:Y,fill:"none",stroke:"#3b82f6","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})),O},[b,l,B,P,I,v]),$=E(),C=N(),F=z(),R=k(),W=w(),_=`${r}${f}${i}${m?`, ${n}`:""}`;return o("svg",{width:"100%",viewBox:`0 0 ${d} ${u}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":_,style:{fontFamily:"sans-serif"}},...$,...W,...C,...F,...R)}var nn=Math.PI/180;function bd(e,t,n,r,i,s,a,l){let d=Math.cos(r*nn),u=Math.sin(r*nn),h=Math.cos(i*nn),g=Math.sin(i*nn),c=e*h+n*g,p=-e*g+n*h,f=t*d-p*u,y=t*u+p*d;return{sx:s+c*l,sy:a-f*l,depth:y}}function Et(e){return{x:Math.sin(e.theta)*Math.cos(e.phi),y:Math.sin(e.theta)*Math.sin(e.phi),z:Math.cos(e.theta)}}function on(e,t,n){let r=Math.sqrt(e*e+t*t+n*n);if(r<1e-10)return{theta:0,phi:0};let i=e/r,s=t/r,a=n/r,l=Math.acos(Math.max(-1,Math.min(1,a))),d=Math.atan2(s,i);return{theta:l,phi:d<0?d+2*Math.PI:d}}function at(e,t,n){let{x:r,y:i,z:s}=Et(e),a=Math.cos(n),l=Math.sin(n),d,u,h;return t==="x"?(d=r,u=i*a-s*l,h=i*l+s*a):t==="y"?(d=r*a+s*l,u=i,h=-r*l+s*a):(d=r*a-i*l,u=r*l+i*a,h=s),on(d,u,h)}function Gn(e,t){let n=t.angle??Math.PI;switch(t.gate){case"X":return at(e,"x",Math.PI);case"Y":return at(e,"y",Math.PI);case"Z":return at(e,"z",Math.PI);case"H":{let{x:r,y:i,z:s}=Et(e);return on(s,-i,r)}case"S":return at(e,"z",Math.PI/2);case"T":return at(e,"z",Math.PI/4);case"Rx":return at(e,"x",n);case"Ry":return at(e,"y",n);case"Rz":return at(e,"z",n)}}function es(e){let{state:t,gates:n,width:r=400,height:i=400,rotateY:s=-25,rotateX:a=15,zoom:l=1,interactive:d=!0,zoomable:u=!0,showVector:h=!0,showLabels:g=!0,showWireframe:c=!0,showTrail:p=!0,trailMaxPoints:f=200,trailColor:y="#ef4444",wireframeColor:b="#cbd5e1",vectorColor:m="#3b82f6",backgroundColor:x,sphereRadius:v=130,title:D,onStateChange:A}=e,[M,T]=j(t??{theta:0,phi:0}),[L,I]=j(s),[P,B]=j(a),[E,N]=j(l),z=ne([]),k=ne(!1),w=ne(null),$=ne(null);re(()=>{t&&T(t)},[t?.theta,t?.phi]);let C=ne(0);re(()=>{if(!n||n.length===0)return;C.current=0;let G=0,Y=()=>{C.current>=n.length||(T(H=>{let K=Gn(H,n[C.current]);return C.current++,A&&A(K),K}),G=requestAnimationFrame(Y))};return G=requestAnimationFrame(Y),()=>cancelAnimationFrame(G)},[n]),re(()=>{let G=Et(M);z.current.push(G),z.current.length>f&&z.current.splice(0,z.current.length-f)},[M.theta,M.phi]);let F=v*E,R=r/2,W=i/2,_=S((G,Y,H)=>bd(G,Y,H,P,L,R,W,F),[P,L,R,W,F]),O=S(G=>{if(!d)return;let Y=G;k.current=!0,w.current={mx:Y.clientX,my:Y.clientY,rx:P,ry:L}},[d,P,L]),V=S(G=>{if(!k.current||!w.current)return;let Y=G,H=w.current;I(H.ry+(Y.clientX-H.mx)*.5),B(H.rx-(Y.clientY-H.my)*.5)},[]),X=S(()=>{k.current=!1},[]),ee=S(G=>{if(!u)return;let Y=G;Y.preventDefault(),N(H=>Math.max(.5,Math.min(3,H*(Y.deltaY>0?.95:1.05))))},[u]),Z=[];if(x&&Z.push(o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:x,rx:"6"})),D&&Z.push(o("text",{key:"title",x:String(R),y:"24","text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},D)),c){let Y=[];for(let Q=0;Q<=60;Q++){let ie=Q/60*2*Math.PI,J=_(Math.cos(ie),Math.sin(ie),0);Y.push(`${Q===0?"M":"L"}${J.sx.toFixed(1)},${J.sy.toFixed(1)}`)}Z.push(o("path",{key:"eq",d:Y.join(" "),fill:"none",stroke:b,"stroke-width":"0.8",opacity:"0.5"}));let H=[];for(let Q=0;Q<=60;Q++){let ie=Q/60*2*Math.PI,J=_(Math.cos(ie),0,Math.sin(ie));H.push(`${Q===0?"M":"L"}${J.sx.toFixed(1)},${J.sy.toFixed(1)}`)}Z.push(o("path",{key:"xz",d:H.join(" "),fill:"none",stroke:b,"stroke-width":"0.8",opacity:"0.4"}));let K=[];for(let Q=0;Q<=60;Q++){let ie=Q/60*2*Math.PI,J=_(0,Math.cos(ie),Math.sin(ie));K.push(`${Q===0?"M":"L"}${J.sx.toFixed(1)},${J.sy.toFixed(1)}`)}Z.push(o("path",{key:"yz",d:K.join(" "),fill:"none",stroke:b,"stroke-width":"0.8",opacity:"0.4"}))}let U=[{id:"x",dir:[1,0,0],color:"#ef4444"},{id:"y",dir:[0,1,0],color:"#22c55e"},{id:"z",dir:[0,0,1],color:"#3b82f6"}];for(let G of U){let Y=_(G.dir[0]*1.15,G.dir[1]*1.15,G.dir[2]*1.15),H=_(-G.dir[0]*1.15,-G.dir[1]*1.15,-G.dir[2]*1.15),K=_(0,0,0);Z.push(o("line",{key:`axis-${G.id}`,x1:String(H.sx),y1:String(H.sy),x2:String(Y.sx),y2:String(Y.sy),stroke:G.color,"stroke-width":"0.8",opacity:"0.4","stroke-dasharray":"3 3"}))}if(g){let G=[{text:"|0\u27E9",pos:[0,0,1.3]},{text:"|1\u27E9",pos:[0,0,-1.3]},{text:"|+\u27E9",pos:[1.3,0,0]},{text:"|-\u27E9",pos:[-1.3,0,0]},{text:"|+i\u27E9",pos:[0,1.3,0]},{text:"|-i\u27E9",pos:[0,-1.3,0]}];for(let Y of G){let H=_(Y.pos[0],Y.pos[1],Y.pos[2]);Z.push(o("text",{key:`lbl-${Y.text}`,x:String(H.sx),y:String(H.sy),"text-anchor":"middle","dominant-baseline":"central","font-size":"11","font-family":"serif",fill:"#475569",style:{pointerEvents:"none"}},Y.text))}}if(p&&z.current.length>1){let G=z.current,Y=[];for(let H=0;H<G.length;H++){let K=G[H],Q=_(K.x,K.y,K.z);Y.push(`${H===0?"M":"L"}${Q.sx.toFixed(1)},${Q.sy.toFixed(1)}`)}Z.push(o("path",{key:"trail",d:Y.join(" "),fill:"none",stroke:y,"stroke-width":"1.5",opacity:"0.5","stroke-linecap":"round","stroke-linejoin":"round"}))}if(h){let G=Et(M),Y=_(0,0,0),H=_(G.x,G.y,G.z);Z.push(o("line",{key:"vec-line",x1:String(Y.sx),y1:String(Y.sy),x2:String(H.sx),y2:String(H.sy),stroke:m,"stroke-width":"2.5","stroke-linecap":"round"})),Z.push(o("circle",{key:"vec-point",cx:String(H.sx),cy:String(H.sy),r:"5",fill:m,stroke:"#fff","stroke-width":"1.5"}));let K=(M.theta*180/Math.PI).toFixed(0),Q=(M.phi*180/Math.PI).toFixed(0);Z.push(o("text",{key:"state-label",x:String(r-10),y:String(i-10),"text-anchor":"end","font-size":"10","font-family":"monospace",fill:"#64748b"},`\u03B8=${K}\xB0 \u03C6=${Q}\xB0`))}return o("svg",{ref:$,width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":D??"Bloch sphere quantum state visualization",style:{fontFamily:"sans-serif",cursor:d?k.current?"grabbing":"grab":"default"},onMouseDown:d?O:void 0,onMouseMove:d?V:void 0,onMouseUp:d?X:void 0,onMouseLeave:d?X:void 0,onWheel:u?ee:void 0},...Z)}function xd(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];typeof r=="number"&&isFinite(r)&&!isNaN(r)&&t.push(r)}return t.sort((n,r)=>n-r),t}function Xn(e,t){if(e.length===0)return 0;if(e.length===1)return e[0];let n=t/100*(e.length-1),r=Math.floor(n),i=Math.ceil(n);if(r===i)return e[r];let s=n-r;return e[r]+s*(e[i]-e[r])}function qn(e){let t=xd(e);if(t.length===0)return null;let n=Xn(t,25),r=Xn(t,50),i=Xn(t,75),s=i-n,a=n-1.5*s,l=i+1.5*s,d=t[0];for(let p of t)if(p>=a){d=p;break}let u=t[t.length-1];for(let p=t.length-1;p>=0;p--)if(t[p]<=l){u=t[p];break}let h=0;for(let p of t)h+=p;let g=h/t.length,c=[];for(let p of t)(p<a||p>l)&&c.push(p);return{q1:n,median:r,q3:i,iqr:s,whiskerLow:d,whiskerHigh:u,mean:g,outliers:c,min:t[0],max:t[t.length-1]}}function yd(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function ts(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",showOutliers:s=!0,showMean:a=!1,whiskerColor:l="#374151",boxWidth:d=.6,showGrid:u=!0,title:h,padding:g=60}=e,c=i==="vertical",p=n-g*2,f=r-g*2,y=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],b=q(()=>{let w=[];for(let $ of t)w.push(qn($.values));return w},[t]),m=q(()=>{let w=1/0,$=-1/0;for(let R of b){if(R===null)continue;let W=s&&R.outliers.length>0?Math.min(R.whiskerLow,R.outliers[0]):R.whiskerLow,_=s&&R.outliers.length>0?Math.max(R.whiskerHigh,R.outliers[R.outliers.length-1]):R.whiskerHigh;W<w&&(w=W),_>$&&($=_)}isFinite(w)||(w=0,$=1);let C=$-w,F=C>0?C*.05:.5;return{min:w-F,max:$+F}},[b,s]),x=c?f:p,v=c?p:f,D=t.length>0?t.length:1,A=v/D,M=A*Math.min(Math.max(d,.1),.95),T=S(w=>{let $=m.max-m.min;return $===0?x/2:(w-m.min)/$*x},[m,x]),L=S(()=>{if(!u)return[];let w=[],$=m.max-m.min,C=yd($),F=Math.ceil(m.min/C)*C;for(let R=F;R<=m.max;R+=C){let W=T(R),_=String(Math.round(R*1e3)/1e3);if(c){let O=g+f-W;w.push(o("line",{key:`grid-${R}`,x1:String(g),y1:String(O),x2:String(g+p),y2:String(O),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`glabel-${R}`,x:String(g-6),y:String(O+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},_))}else{let O=g+W;w.push(o("line",{key:`grid-${R}`,x1:String(O),y1:String(g),x2:String(O),y2:String(g+f),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`glabel-${R}`,x:String(O),y:String(g+f+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},_))}}return w},[u,m,T,c,g,p,f]),I=S(()=>{let w=[];return w.push(o("line",{key:"axis-value",x1:String(g),y1:String(c?g:g+f),x2:String(g),y2:String(g+f),stroke:"#374151","stroke-width":"1.5"})),w.push(o("line",{key:"axis-category",x1:String(g),y1:String(g+f),x2:String(g+p),y2:String(g+f),stroke:"#374151","stroke-width":"1.5"})),w},[g,p,f,c]),P=S(()=>{let w=[];for(let $=0;$<t.length;$++){let C=b[$];if(C===null)continue;let F=t[$],R=F.color??y[$%y.length],W=A*$+A/2,_=M/2;if(c){let O=g+f-T(C.q1),V=g+f-T(C.q3),X=g+f-T(C.median),ee=g+f-T(C.whiskerLow),Z=g+f-T(C.whiskerHigh),U=g+W;w.push(o("line",{key:`wl-${$}`,x1:String(U),y1:String(O),x2:String(U),y2:String(ee),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wlc-${$}`,x1:String(U-_*.4),y1:String(ee),x2:String(U+_*.4),y2:String(ee),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wh-${$}`,x1:String(U),y1:String(V),x2:String(U),y2:String(Z),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`whc-${$}`,x1:String(U-_*.4),y1:String(Z),x2:String(U+_*.4),y2:String(Z),stroke:l,"stroke-width":"1.5"}));let G=Math.min(O,V),Y=Math.abs(O-V);if(w.push(o("rect",{key:`box-${$}`,x:String(U-_),y:String(G),width:String(M),height:String(Math.max(Y,1)),fill:R,stroke:l,"stroke-width":"1.5",opacity:"0.8","aria-label":`${F.label}: Q1=${C.q1.toFixed(1)}, median=${C.median.toFixed(1)}, Q3=${C.q3.toFixed(1)}`,role:"img"})),w.push(o("line",{key:`med-${$}`,x1:String(U-_),y1:String(X),x2:String(U+_),y2:String(X),stroke:"#fff","stroke-width":"2.5"})),a){let H=g+f-T(C.mean);w.push(o("circle",{key:`mean-${$}`,cx:String(U),cy:String(H),r:"3.5",fill:"#fff",stroke:l,"stroke-width":"1.5","aria-label":`Mean: ${C.mean.toFixed(1)}`}))}if(s)for(let H=0;H<C.outliers.length;H++){let K=g+f-T(C.outliers[H]);w.push(o("circle",{key:`out-${$}-${H}`,cx:String(U),cy:String(K),r:"3",fill:"none",stroke:l,"stroke-width":"1.5","aria-label":`Outlier: ${C.outliers[H]}`}))}w.push(o("text",{key:`cat-${$}`,x:String(U),y:String(g+f+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},F.label))}else{let O=g+T(C.q1),V=g+T(C.q3),X=g+T(C.median),ee=g+T(C.whiskerLow),Z=g+T(C.whiskerHigh),U=g+W;w.push(o("line",{key:`wl-${$}`,x1:String(O),y1:String(U),x2:String(ee),y2:String(U),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wlc-${$}`,x1:String(ee),y1:String(U-_*.4),x2:String(ee),y2:String(U+_*.4),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wh-${$}`,x1:String(V),y1:String(U),x2:String(Z),y2:String(U),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`whc-${$}`,x1:String(Z),y1:String(U-_*.4),x2:String(Z),y2:String(U+_*.4),stroke:l,"stroke-width":"1.5"}));let G=Math.min(O,V),Y=Math.abs(V-O);if(w.push(o("rect",{key:`box-${$}`,x:String(G),y:String(U-_),width:String(Math.max(Y,1)),height:String(M),fill:R,stroke:l,"stroke-width":"1.5",opacity:"0.8","aria-label":`${F.label}: Q1=${C.q1.toFixed(1)}, median=${C.median.toFixed(1)}, Q3=${C.q3.toFixed(1)}`,role:"img"})),w.push(o("line",{key:`med-${$}`,x1:String(X),y1:String(U-_),x2:String(X),y2:String(U+_),stroke:"#fff","stroke-width":"2.5"})),a){let H=g+T(C.mean);w.push(o("circle",{key:`mean-${$}`,cx:String(H),cy:String(U),r:"3.5",fill:"#fff",stroke:l,"stroke-width":"1.5","aria-label":`Mean: ${C.mean.toFixed(1)}`}))}if(s)for(let H=0;H<C.outliers.length;H++){let K=g+T(C.outliers[H]);w.push(o("circle",{key:`out-${$}-${H}`,cx:String(K),cy:String(U),r:"3",fill:"none",stroke:l,"stroke-width":"1.5","aria-label":`Outlier: ${C.outliers[H]}`}))}w.push(o("text",{key:`cat-${$}`,x:String(g-6),y:String(U+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},F.label))}}return w},[t,b,T,c,g,p,f,A,M,l,s,a,y]),B=S(()=>h?[o("text",{key:"title",x:String(n/2),y:String(g/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,n,g]),E=L(),N=I(),z=P(),k=B();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Box plot",style:{fontFamily:"sans-serif"}},...k,...E,...N,...z)}function ns(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function Sd(e,t,n){return e<t?t:e>n?n:e}function Kn(e){return typeof e=="number"&&isFinite(e)&&!isNaN(e)}function os(e){let{data:t=[],width:n=600,height:r=400,xLabel:i,yLabel:s,showGrid:a=!0,showAxes:l=!0,showLabels:d=!1,maxBubbleRadius:u=40,minBubbleRadius:h=4,defaultColor:g="#3b82f6",opacity:c=.7,title:p,padding:f=60}=e,y=q(()=>{let z=[];for(let k=0;k<t.length;k++){let w=t[k];Kn(w.x)&&Kn(w.y)&&Kn(w.r)&&z.push(w)}return z},[t]),b=n-f*2,m=r-f*2,x=q(()=>{if(y.length===0)return{xMin:0,xMax:1,yMin:0,yMax:1,rMin:0,rMax:1};let z=1/0,k=-1/0,w=1/0,$=-1/0,C=1/0,F=-1/0;for(let R of y)R.x<z&&(z=R.x),R.x>k&&(k=R.x),R.y<w&&(w=R.y),R.y>$&&($=R.y),R.r<C&&(C=R.r),R.r>F&&(F=R.r);return z===k&&(z-=1,k+=1),w===$&&(w-=1,$+=1),C===F&&(C=0,F=F>0?F:1),{xMin:z,xMax:k,yMin:w,yMax:$,rMin:C,rMax:F}},[y]),v=S(z=>{let k=x.xMax-x.xMin;return f+(z-x.xMin)/k*b},[x,f,b]),D=S(z=>{let k=x.yMax-x.yMin;return f+m-(z-x.yMin)/k*m},[x,f,m]),A=S(z=>{let k=x.rMax-x.rMin;if(k===0)return(h+u)/2;let w=(z-x.rMin)/k;return h+w*(u-h)},[x,h,u]),M=S(()=>{if(!a)return[];let z=[],k=ns(x.xMax-x.xMin),w=Math.ceil(x.xMin/k)*k;for(let F=w;F<=x.xMax;F+=k){let R=v(F);z.push(o("line",{key:`grid-x-${F}`,x1:String(R),y1:String(f),x2:String(R),y2:String(f+m),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),z.push(o("text",{key:`grid-xlabel-${F}`,x:String(R),y:String(f+m+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(F*1e3)/1e3)))}let $=ns(x.yMax-x.yMin),C=Math.ceil(x.yMin/$)*$;for(let F=C;F<=x.yMax;F+=$){let R=D(F);z.push(o("line",{key:`grid-y-${F}`,x1:String(f),y1:String(R),x2:String(f+b),y2:String(R),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),z.push(o("text",{key:`grid-ylabel-${F}`,x:String(f-6),y:String(R+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(F*1e3)/1e3)))}return z},[a,x,v,D,f,b,m]),T=S(()=>{if(!l)return[];let z=[];return z.push(o("line",{key:"axis-y",x1:String(f),y1:String(f),x2:String(f),y2:String(f+m),stroke:"#374151","stroke-width":"1.5"})),z.push(o("line",{key:"axis-x",x1:String(f),y1:String(f+m),x2:String(f+b),y2:String(f+m),stroke:"#374151","stroke-width":"1.5"})),i&&z.push(o("text",{key:"x-label",x:String(f+b/2),y:String(f+m+40),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151"},i)),s&&z.push(o("text",{key:"y-label",x:String(f-40),y:String(f+m/2),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90, ${f-40}, ${f+m/2})`},s)),z},[l,f,b,m,i,s]),L=S(()=>{let z=[];for(let k=0;k<y.length;k++){let w=y[k],$=v(w.x),C=D(w.y),F=Sd(A(w.r),h,u),R=w.color??g;z.push(o("circle",{key:`bubble-${k}`,cx:String($),cy:String(C),r:String(F),fill:R,opacity:String(c),stroke:R,"stroke-width":"1","stroke-opacity":"0.8","aria-label":w.label??`Bubble at (${w.x}, ${w.y}) size ${w.r}`,role:"img"})),d&&w.label&&z.push(o("text",{key:`label-${k}`,x:String($),y:String(C-F-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},w.label))}return z},[y,v,D,A,g,c,d,h,u]),I=S(()=>p?[o("text",{key:"title",x:String(n/2),y:String(f/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},p)]:[],[p,n,f]),P=M(),B=T(),E=L(),N=I();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Bubble chart",style:{fontFamily:"sans-serif"}},...N,...P,...B,...E)}var vd=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wd=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function kd(e){let t=e.split("-");return t.length!==3?new Date(NaN):new Date(parseInt(t[0],10),parseInt(t[1],10)-1,parseInt(t[2],10))}function rs(e){let t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${r}`}function is(e){let t=e.replace("#",""),n=t.length===3?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,r=parseInt(n,16);return{r:r>>16&255,g:r>>8&255,b:r&255}}function Cd(e,t,n){let r=i=>{let s=Math.max(0,Math.min(255,Math.round(i))).toString(16);return s.length===1?"0"+s:s};return`#${r(e)}${r(t)}${r(n)}`}function Md(e,t){if(t.length===0)return"#000000";if(t.length===1)return t[0];let n=Math.max(0,Math.min(1,e)),r=t.length-1,i=Math.min(Math.floor(n*r),r-1),s=n*r-i,a=is(t[i]),l=is(t[i+1]);return Cd(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}var Ed=["#9be9a8","#40c463","#30a14e","#216e39"];function ss(e){let{data:t=[],width:n=800,height:r=160,colorScale:i=Ed,cellSize:s=12,cellGap:a=2,showMonthLabels:l=!0,showDayLabels:d=!0,emptyColor:u="#ebedf0",title:h}=e,{dateMap:g,startDate:c,endDate:p,maxVal:f}=q(()=>{let E=new Map,N=0,z=null,k=null;for(let C of t){let F=kd(C.date);if(isNaN(F.getTime()))continue;let R=rs(F);E.set(R,(E.get(R)??0)+C.value);let W=E.get(R);W>N&&(N=W),(z===null||F<z)&&(z=F),(k===null||F>k)&&(k=F)}if(z===null||k===null){let C=new Date;z=new Date(C.getFullYear(),0,1),k=new Date(C.getFullYear(),11,31)}let w=new Date(z);w.setDate(w.getDate()-w.getDay());let $=new Date(k);return $.setDate($.getDate()+(6-$.getDay())),{dateMap:E,startDate:w,endDate:$,maxVal:N>0?N:1}},[t]),y=d?30:0,b=l?16:0,m=h?28:0,x=y+10,v=m+b+4,D=S(()=>{let E=[],N=new Date(c),z=0;for(;N<=p;){let k=N.getDay();k===0&&N>c&&z++;let w=rs(N),$=g.get(w),C=$!==void 0&&$>0?Md($/f,i):u,F=x+z*(s+a),R=v+k*(s+a);E.push(o("rect",{key:`day-${w}`,x:String(F),y:String(R),width:String(s),height:String(s),rx:"2",ry:"2",fill:C,"aria-label":`${w}: ${$??0}`})),N.setDate(N.getDate()+1)}return E},[c,p,g,f,i,u,s,a,x,v]),A=S(()=>{if(!l)return[];let E=[],N=new Date(c),z=0,k=-1;for(;N<=p;){let w=N.getDay();w===0&&N>c&&z++;let $=N.getMonth();if($!==k&&w===0){k=$;let C=x+z*(s+a);E.push(o("text",{key:`month-${z}`,x:String(C),y:String(m+b-2),"font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},vd[$]))}N.setDate(N.getDate()+1)}return E},[l,c,p,s,a,x,m,b]),M=S(()=>{if(!d)return[];let E=[],N=[1,3,5];for(let z of N){let k=v+z*(s+a)+s/2;E.push(o("text",{key:`day-label-${z}`,x:String(y),y:String(k),"text-anchor":"end","dominant-baseline":"central","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},wd[z]))}return E},[d,s,a,v,y]),T=S(()=>h?[o("text",{key:"title",x:String(n/2),y:"18","text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},h)]:[],[h,n]);if(t.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Calendar heat map \u2014 no data"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"No data to display."));let L=T(),I=A(),P=M(),B=D();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Calendar heat map",style:{fontFamily:"sans-serif"}},...L,...I,...P,...B)}var Id=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function tt(e,t,n,r){let i=r-Math.PI/2;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function Rd(e,t,n,r,i,s){let a=tt(e,t,n,i),l=tt(e,t,n,s),d=tt(e,t,r,i),u=tt(e,t,r,s),g=s-i>Math.PI?1:0;return[`M ${a.x} ${a.y}`,`A ${n} ${n} 0 ${g} 1 ${l.x} ${l.y}`,`L ${u.x} ${u.y}`,`A ${r} ${r} 0 ${g} 0 ${d.x} ${d.y}`,"Z"].join(" ")}function Pd(e,t,n,r,i,s,a){let l=tt(e,t,n,r),d=tt(e,t,n,i),u=tt(e,t,n,s),h=tt(e,t,n,a),g=i-r,c=a-s,p=g>Math.PI?1:0,f=c>Math.PI?1:0;return[`M ${l.x} ${l.y}`,`A ${n} ${n} 0 ${p} 1 ${d.x} ${d.y}`,`Q ${e} ${t} ${u.x} ${u.y}`,`A ${n} ${n} 0 ${f} 1 ${h.x} ${h.y}`,`Q ${e} ${t} ${l.x} ${l.y}`,"Z"].join(" ")}function $d(e,t,n,r){let i=e.length;if(i===0)return{groups:[],chords:[]};let s=[],a=0;for(let c=0;c<i;c++){let p=0;for(let f=0;f<i;f++){let y=e[c]?.[f]??0;p+=Math.max(0,y)}s.push(p),a+=p}if(a===0){let c=(2*Math.PI-i*r)/Math.max(i,1),p=[],f=0;for(let y=0;y<i;y++)p.push({index:y,label:t[y]??`Group ${y}`,color:n[y%n.length],startAngle:f,endAngle:f+c,value:0}),f+=c+r;return{groups:p,chords:[]}}let l=2*Math.PI-i*r,d=[],u=0;for(let c=0;c<i;c++){let p=s[c]/a*l;d.push({index:c,label:t[c]??`Group ${c}`,color:n[c%n.length],startAngle:u,endAngle:u+p,value:s[c]}),u+=p+r}let h=[];for(let c=0;c<i;c++)h.push(d[c].startAngle);let g=[];for(let c=0;c<i;c++)for(let p=c;p<i;p++){let f=Math.max(0,e[c]?.[p]??0),y=c===p?0:Math.max(0,e[p]?.[c]??0);if(f===0&&y===0)continue;let b=f+y,m=s[c]>0?f/a*l:0,x=h[c],v=x+m;h[c]=v;let D=s[p]>0?f/a*l:0,A=h[p],M=A+D;if(h[p]=M,c===p){f>0&&g.push({sourceIndex:c,targetIndex:p,sourceStartAngle:x,sourceEndAngle:v,targetStartAngle:A,targetEndAngle:M,value:f,color:d[c].color});continue}let T=s[p]>0?y/a*l:0,I=h[p]+T;h[p]=I;let P=s[c]>0?y/a*l:0,E=h[c]+P;h[c]=E,(f>0||y>0)&&g.push({sourceIndex:c,targetIndex:p,sourceStartAngle:x,sourceEndAngle:Math.max(v,x+.001),targetStartAngle:A,targetEndAngle:Math.max(M,A+.001),value:b,color:d[c].color})}return{groups:d,chords:g}}function as(e){let{matrix:t,labels:n,width:r=600,height:i=600,colors:s=Id,padAngle:a=.05,showLabels:l=!0,showValues:d=!1,ribbonOpacity:u=.5,innerRadiusRatio:h=.9,title:g}=e;if(!t||t.length===0||!n||n.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Empty chord diagram"},o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let c=r/2,p=i/2,f=Math.min(r,i)/2-40,y=f*Math.max(.5,Math.min(.99,h)),b=f+16,m=q(()=>$d(t,n,s,a),[t,n,s,a]),x=S(()=>{let L=[];for(let I=0;I<m.groups.length;I++){let P=m.groups[I];if(P.endAngle-P.startAngle<.001)continue;let E=Rd(c,p,f,y,P.startAngle,P.endAngle);if(L.push(o("path",{key:`arc-${I}`,d:E,fill:P.color,stroke:"#fff","stroke-width":"1",role:"img","aria-label":`${P.label}: ${P.value}`})),l){let N=(P.startAngle+P.endAngle)/2,z=tt(c,p,b,N),$=((N-Math.PI/2)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)<Math.PI,C=$?"start":"end",F=N*180/Math.PI-90;$||(F+=180);let R=d?`${P.label} (${P.value})`:P.label;L.push(o("text",{key:`label-${I}`,x:String(z.x),y:String(z.y),"text-anchor":C,"font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(${F}, ${z.x}, ${z.y})`,"dominant-baseline":"central","pointer-events":"none"},R))}}return L},[m,c,p,f,y,b,l,d]),v=S(()=>{let L=[];for(let I=0;I<m.chords.length;I++){let P=m.chords[I],B=Pd(c,p,y,P.sourceStartAngle,P.sourceEndAngle,P.targetStartAngle,P.targetEndAngle);L.push(o("path",{key:`ribbon-${I}`,d:B,fill:P.color,"fill-opacity":String(u),stroke:P.color,"stroke-width":"0.5","stroke-opacity":"0.3"}))}return L},[m,c,p,y,u]),D=S(()=>g?[o("text",{key:"title",x:String(r/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},g)]:[],[g,r]),A=v(),M=x(),T=D();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Chord diagram",style:{fontFamily:"sans-serif"}},...T,...A,...M)}var Td=["#3b82f6","#22c55e","#f59e0b","#8b5cf6","#ef4444","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Dd(e){let t=[],n=0,r=[];r.push([e,0,null]);let i=0;for(;r.length>0;){let[s,a,l]=r.shift(),d=n++;i=Math.max(i,a);let u=s.children??[],h=[];for(let g=0;g<u.length;g++)h.push(n+r.length+g);t.push({id:d,node:s,depth:a,parentId:l,childIndices:h});for(let g=0;g<u.length;g++)r.push([u[g],a+1,d])}return{flatNodes:t,maxDepth:i}}function zd(e){let t=e.length,n=new Array(t).fill(0);for(let r=t-1;r>=0;r--){let i=e[r];if(i.childIndices.length===0)n[r]=1;else{let s=0;for(let a of i.childIndices)a<t&&(s+=n[a]);n[r]=Math.max(s,1)}}return n}function Ad(e,t,n,r,i,s,a,l){let{flatNodes:d,maxDepth:u}=Dd(e);if(d.length===0)return[];let h=zd(d),g=t-s*2,c=n-s*2,p=a==="horizontal",f=u+1,y=p?f>1?(g-r)/u:0:f>1?(c-i)/u:0,b=new Array(d.length),m=h[0],x=p?c:g,v=m>0?x/m:x,D=new Array(d.length);D[0]=[0,m];let A=[0],M=0;for(;M<A.length;){let T=A[M];M++;let L=d[T],[I,P]=D[T],B=(I+P)/2,E=s+L.depth*y,N=s+(B-.5)*v,z=p?E:N,k=p?N:E,w=L.node.color??l[L.depth%l.length];b[T]={id:L.id,label:L.node.label,value:L.node.value!==void 0?String(L.node.value):"",color:w,depth:L.depth,x:z,y:k,parentId:L.parentId,childCount:L.childIndices.length,subtreeLeafCount:h[T]};let $=I;for(let C of L.childIndices)if(C<d.length){let F=h[C],R=$+F;D[C]=[$,R],$=R,A.push(C)}}return b}function ls(e){let{data:t,width:n=800,height:r=500,orientation:i="horizontal",nodeWidth:s=120,nodeHeight:a=40,showValues:l=!0,showConnectors:d=!0,connectorColor:u="#94a3b8",colors:h=Td,title:g,padding:c=40}=e;if(!t)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Empty decomposition tree"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let p=i==="horizontal",f=q(()=>Ad(t,n,r,s,a,c,i,h),[t,n,r,s,a,c,i,h]),y=q(()=>{let M=new Map;for(let T=0;T<f.length;T++){let L=f[T];M.set(L.id,L)}return M},[f]),b=S(()=>{if(!d)return[];let M=[];for(let T=0;T<f.length;T++){let L=f[T];if(L.parentId===null)continue;let I=y.get(L.parentId);if(!I)continue;let P,B,E,N;p?(P=I.x+s,B=I.y+a/2,E=L.x,N=L.y+a/2):(P=I.x+s/2,B=I.y+a,E=L.x+s/2,N=L.y);let z=(P+E)/2,k=(B+N)/2,w;p?w=`M ${P} ${B} C ${z} ${B}, ${z} ${N}, ${E} ${N}`:w=`M ${P} ${B} C ${P} ${k}, ${E} ${k}, ${E} ${N}`,M.push(o("path",{key:`conn-${T}`,d:w,fill:"none",stroke:u,"stroke-width":"1.5","stroke-opacity":"0.7"}))}return M},[f,y,p,s,a,d,u]),m=S(()=>{let M=[];for(let T=0;T<f.length;T++){let L=f[T];M.push(o("rect",{key:`node-rect-${L.id}`,x:String(L.x),y:String(L.y),width:String(s),height:String(a),rx:"4",ry:"4",fill:L.color,stroke:"#374151","stroke-width":"1",role:"img","aria-label":L.value?`${L.label}: ${L.value}`:L.label}));let I=l&&L.value?L.y+a/2-2:L.y+a/2+4;M.push(o("text",{key:`node-label-${L.id}`,x:String(L.x+s/2),y:String(I),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#fff","pointer-events":"none"},L.label)),l&&L.value&&M.push(o("text",{key:`node-value-${L.id}`,x:String(L.x+s/2),y:String(L.y+a/2+12),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.85)","pointer-events":"none"},L.value))}return M},[f,s,a,l]),x=S(()=>g?[o("text",{key:"title",x:String(n/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},g)]:[],[g,n]),v=b(),D=m(),A=x();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Decomposition tree",style:{fontFamily:"sans-serif"}},...A,...v,...D)}var cs=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Ld(e){return cs[e%cs.length]}function ds(e,t,n){let r=t/2,i=n/2,s=Math.min(t,n)*.3,a=e.length,l=[];for(let d=0;d<a;d++){let u=e[d],h=2*Math.PI*d/Math.max(a,1);l.push({id:u.id,label:u.label??u.id,color:u.color??Ld(d),x:u.x??r+s*Math.cos(h),y:u.y??i+s*Math.sin(h),vx:0,vy:0,fixed:u.fixed??!1,solid:u.solid??!0})}return l}function us(e,t){let n=t*2;for(let r=0;r<e.length;r++){let i=e[r];if(i.solid)for(let s=r+1;s<e.length;s++){let a=e[s];if(!a.solid)continue;let l=a.x-i.x,d=a.y-i.y,u=l*l+d*d;if(u>=n*n||u<1e-4)continue;let h=Math.sqrt(u),g=l/h,c=d/h,p=n-h;if(i.fixed&&a.fixed)continue;i.fixed?(a.x+=g*p,a.y+=c*p):a.fixed?(i.x-=g*p,i.y-=c*p):(i.x-=g*p*.5,i.y-=c*p*.5,a.x+=g*p*.5,a.y+=c*p*.5);let f=i.vx-a.vx,y=i.vy-a.vy,b=f*g+y*c;b<=0||(i.fixed?(a.vx+=b*g,a.vy+=b*c):a.fixed?(i.vx-=b*g,i.vy-=b*c):(i.vx-=b*g,i.vy-=b*c,a.vx+=b*g,a.vy+=b*c))}}}function Bd(e,t,n,r,i,s,a,l,d=12){let u=e.length;if(u===0)return e;let h=new Map;for(let x=0;x<u;x++)h.set(e[x].id,x);let g=new Float64Array(u),c=new Float64Array(u);for(let x=0;x<u;x++){let v=e[x];for(let D=x+1;D<u;D++){let A=e[D],M=v.x-A.x,T=v.y-A.y,L=M*M+T*T;L<1&&(L=1);let I=Math.sqrt(L),P=i/L,B=M/I*P,E=T/I*P;g[x]+=B,c[x]+=E,g[D]-=B,c[D]-=E}}for(let x=0;x<t.length;x++){let v=t[x],D=h.get(v.source),A=h.get(v.target);if(D===void 0||A===void 0)continue;let M=e[D],T=e[A],L=T.x-M.x,I=T.y-M.y,P=Math.sqrt(L*L+I*I);if(P<.1)continue;let B=v.weight??1,E=P-l,N=s*E*B,z=L/P*N,k=I/P*N;g[D]+=z,c[D]+=k,g[A]-=z,c[A]-=k}let p=n/2,f=r/2,y=.001;for(let x=0;x<u;x++){let v=e[x];g[x]+=(p-v.x)*y,c[x]+=(f-v.y)*y}let b=20,m=[];for(let x=0;x<u;x++){let v=e[x];if(v.fixed){m.push({...v,vx:0,vy:0});continue}let D=(v.vx+g[x])*a,A=(v.vy+c[x])*a,M=Math.sqrt(D*D+A*A),T=10;M>T&&(D=D/M*T,A=A/M*T);let L=v.x+D,I=v.y+A;L=Math.max(b,Math.min(n-b,L)),I=Math.max(b,Math.min(r-b,I)),m.push({...v,x:L,y:I,vx:D,vy:A})}return us(m,d),m}function Fd(e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];t+=r.vx*r.vx+r.vy*r.vy}return t}function ps(e){let{nodes:t,edges:n,width:r=600,height:i=400,nodeRadius:s=12,nodeStrokeWidth:a=2,solidNodes:l=!0,showLabels:d=!0,showArrows:u=!1,repulsionForce:h=300,attractionForce:g=.01,damping:c=.9,edgeLength:p=100,edgeColor:f="#94a3b8",edgeWidth:y=1.5,title:b,customForce:m,trails:x}=e;if(!t||t.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Empty force-directed graph"},b?o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},b):o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let v=ne(ds(t,r,i)),[D,A]=j(0),M=ne(!0),T=ne(!1),L=ne(n);L.current=n;let I=ne(m);I.current=m;let P=ne(null),B=ne({repulsionForce:h,attractionForce:g,damping:c,edgeLength:p,width:r,height:i,nodeRadius:s,solidNodes:l});B.current={repulsionForce:h,attractionForce:g,damping:c,edgeLength:p,width:r,height:i,nodeRadius:s,solidNodes:l};let E=ne(new Map);re(()=>{v.current=ds(t,r,i),T.current=!1,M.current=!0,E.current=new Map,A(ie=>ie+1)},[t.length]),re(()=>{let ie=0,J=()=>{if(!M.current)return;let se=B.current,le=I.current,fe;if(le?(fe=le(v.current,L.current,se.width,se.height,P.current),se.solidNodes&&us(fe,se.nodeRadius)):fe=Bd(v.current,L.current,se.width,se.height,se.repulsionForce,se.attractionForce,se.damping,se.edgeLength,se.nodeRadius),v.current=fe,x)for(let oe=0;oe<x.length;oe++){let me=x[oe],he=fe.find(ge=>ge.id===me.nodeId);if(!he)continue;let te=E.current.get(me.nodeId);te||(te=[],E.current.set(me.nodeId,te)),te.push({x:he.x,y:he.y});let de=me.maxPoints??200;te.length>de&&te.splice(0,te.length-de)}if(!le&&Fd(fe)<.01){T.current=!0,A(oe=>oe+1);return}A(oe=>oe+1),ie=requestAnimationFrame(J)};return ie=requestAnimationFrame(J),()=>{M.current=!1,cancelAnimationFrame(ie)}},[]);let N=v.current,z=S(ie=>{v.current=v.current.map(J=>J.id===ie?{...J,fixed:!J.fixed,vx:0,vy:0}:J),T.current&&(T.current=!1,M.current=!0,A(J=>J+1))},[]),k=ne(null),w=ne(null),$=S(ie=>{let J=ie,se=w.current;if(!se)return{x:J.clientX,y:J.clientY};let le=se.getBoundingClientRect(),fe=r/le.width,oe=i/le.height;return{x:(J.clientX-le.left)*fe,y:(J.clientY-le.top)*oe}},[r,i]),C=ne(!1),F=S((ie,J)=>{J.stopPropagation(),k.current=ie;let se=v.current.find(le=>le.id===ie);C.current=se?.fixed??!1,v.current=v.current.map(le=>le.id===ie?{...le,fixed:!0,vx:0,vy:0}:le)},[]),R=S(ie=>{let J=$(ie);if(P.current={x:J.x,y:J.y},!k.current)return;let se=k.current,le=20;v.current=v.current.map(fe=>fe.id===se?{...fe,x:Math.max(le,Math.min(r-le,J.x)),y:Math.max(le,Math.min(i-le,J.y))}:fe),T.current&&(T.current=!1,M.current=!0),A(fe=>fe+1)},[r,i,$]),W=S(()=>{let ie=k.current;ie&&(v.current=v.current.map(J=>J.id===ie?{...J,fixed:C.current}:J)),k.current=null},[]),_=S(()=>{k.current=null,P.current=null},[]),O=q(()=>{let ie=new Map;for(let J=0;J<N.length;J++)ie.set(N[J].id,N[J]);return ie},[D]),V=S(()=>u?[o("defs",{key:"arrow-defs"},o("marker",{key:"arrowhead",id:"arrowhead",markerWidth:"10",markerHeight:"7",refX:String(10+s),refY:"3.5",orient:"auto",markerUnits:"userSpaceOnUse"},o("polygon",{key:"arrow-poly",points:"0 0, 10 3.5, 0 7",fill:f})))]:[],[u,s,f]),X=S(()=>{let ie=[];for(let J=0;J<n.length;J++){let se=n[J],le=O.get(se.source),fe=O.get(se.target);if(!le||!fe||se.weight!==void 0&&se.weight<=0)continue;let oe=se.weight?Math.max(.5,Math.min(6,y*se.weight)):y,me={key:`edge-${J}`,x1:String(le.x),y1:String(le.y),x2:String(fe.x),y2:String(fe.y),stroke:se.color??f,"stroke-width":String(oe),"stroke-opacity":"0.6"};u&&(me["marker-end"]="url(#arrowhead)"),ie.push(o("line",me))}return ie},[D,f,y,u]),ee=S(()=>{let ie=[];for(let J=0;J<N.length;J++){let se=N[J];ie.push(o("circle",{key:`node-${se.id}`,cx:String(se.x),cy:String(se.y),r:String(s),fill:se.color,stroke:se.fixed?"#0f172a":"#fff","stroke-width":se.fixed?"3":String(a),style:{cursor:k.current===se.id?"grabbing":"grab"},onMouseDown:le=>F(se.id,le),onDblClick:()=>z(se.id),role:"button",tabIndex:0,"aria-label":`Node: ${se.label}${se.fixed?" (locked)":""} \u2014 drag to move, double-click to lock`})),d&&ie.push(o("text",{key:`label-${se.id}`,x:String(se.x),y:String(se.y+s+14),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},se.label))}return ie},[D,s,d,z]),Z=S(()=>b?[o("text",{key:"title",x:String(r/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},b)]:[],[b,r]),U=S(()=>{if(!x||x.length===0)return[];let ie=[];for(let J=0;J<x.length;J++){let se=x[J],le=E.current.get(se.nodeId);if(!le||le.length<2)continue;let fe=[];for(let oe=0;oe<le.length;oe++){let me=le[oe];fe.push(`${oe===0?"M":"L"}${me.x.toFixed(1)},${me.y.toFixed(1)}`)}ie.push(o("path",{key:`trail-${se.nodeId}`,d:fe.join(" "),fill:"none",stroke:se.color??"#3b82f6","stroke-width":String(se.width??1),opacity:String(se.opacity??.5),"stroke-linecap":"round","stroke-linejoin":"round"}))}return ie},[D,x]),G=V(),Y=U(),H=X(),K=ee(),Q=Z();return o("svg",{ref:w,width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Force-directed graph \u2014 drag nodes to move, double-click to lock",style:{fontFamily:"sans-serif",cursor:k.current?"grabbing":"default"},onMouseMove:R,onMouseUp:W,onMouseLeave:_},...G,...Q,...Y,...H,...K)}var fs=["#3b82f6","#6366f1","#8b5cf6","#a855f7","#c084fc","#d8b4fe","#e9d5ff","#f3e8ff"];function gs(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",showLabels:s=!0,showValues:a=!0,showPercentage:l=!0,gapSize:d=2,colors:u=fs,title:h}=e,g=i==="vertical",c=h?30:0,p=120,f=q(()=>{let L=0;for(let I=0;I<t.length;I++)t[I].value>L&&(L=t[I].value);return L>0?L:1},[t]),y=S(L=>f===0?0:Math.max(.05,L/f),[f]),b=S((L,I)=>I||(u[L%u.length]??fs[0]),[u]),m=S(()=>{if(t.length===0)return[];let L=[],I=40,P=n-I*2-p,B=r-c-I*2,E=d*(t.length-1),N=Math.max(1,(B-E)/t.length),z=I+P/2;for(let k=0;k<t.length;k++){let w=t[k],$=k<t.length-1?t[k+1]:null,C=b(k,w.color),F=y(w.value),R=$!==null?y($.value):F*.6,W=P/2*F,_=P/2*R,O=c+I+k*(N+d),V=z-W,X=z+W,ee=z+_,Z=z-_,U=`${V},${O} ${X},${O} ${ee},${O+N} ${Z},${O+N}`;L.push(o("polygon",{key:`section-${k}`,points:U,fill:C,stroke:"#fff","stroke-width":"1"}));let G=I+P+12,Y=O+N/2;if(s&&L.push(o("text",{key:`label-${k}`,x:String(G),y:String(Y-(a||l?6:0)),"text-anchor":"start","font-size":"12","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},w.label)),a||l){let H="";if(a&&(H=String(w.value)),l&&t.length>0){let K=t[0].value,Q=K>0?Math.round(w.value/K*100):0;H+=a?` (${Q}%)`:`${Q}%`}L.push(o("text",{key:`value-${k}`,x:String(G),y:String(Y+(s?10:4)),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},H))}}return L},[t,n,r,c,d,s,a,l,b,y,p]),x=S(()=>{if(t.length===0)return[];let L=[],I=40,P=n-I*2,E=r-c-I*2-40,N=d*(t.length-1),z=Math.max(1,(P-N)/t.length),k=c+I+E/2;for(let w=0;w<t.length;w++){let $=t[w],C=w<t.length-1?t[w+1]:null,F=b(w,$.color),R=y($.value),W=C!==null?y(C.value):R*.6,_=E/2*R,O=E/2*W,V=I+w*(z+d),X=k-_,ee=k-O,Z=k+O,U=k+_,G=`${V},${X} ${V+z},${ee} ${V+z},${Z} ${V},${U}`;L.push(o("polygon",{key:`section-${w}`,points:G,fill:F,stroke:"#fff","stroke-width":"1"}));let Y=V+z/2,H=c+I+E+14;if(s&&L.push(o("text",{key:`label-${w}`,x:String(Y),y:String(H),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},$.label)),a||l){let K="";if(a&&(K=String($.value)),l&&t.length>0){let Q=t[0].value,ie=Q>0?Math.round($.value/Q*100):0;K+=a?` (${ie}%)`:`${ie}%`}L.push(o("text",{key:`value-${w}`,x:String(Y),y:String(H+14),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#6b7280"},K))}}return L},[t,n,r,c,d,s,a,l,b,y]),v=S(()=>h?[o("text",{key:"title",x:String(n/2),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,n]),D=S(()=>t.length>0?[]:[o("text",{key:"empty",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,n,r]),A=v(),M=g?m():x(),T=D();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Funnel chart",style:{fontFamily:"sans-serif"}},...A,...M,...T)}var ms=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function hs(e){if(e<=0)return 1;let t=e/6,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function Nd(e,t){return t||ms[e%ms.length]}function bs(e){let{tasks:t=[],width:n=800,height:r,barHeight:i=24,barGap:s=8,showGrid:a=!0,showLabels:l=!0,showProgress:d=!1,timeUnit:u="days",title:h,padding:g=50}=e;if(t.length===0)return o("svg",{width:"100%",height:String(r??100),viewBox:`0 0 ${n} ${r??100}`,xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Empty Gantt chart"},o("text",{x:String(n/2),y:String((r??100)/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.4"},"No tasks to display"));let c=l?120:0,p=q(()=>{let B=1/0,E=-1/0;for(let N of t){N.start<B&&(B=N.start);let z=N.start+N.duration;z>E&&(E=z)}return B===1/0&&(B=0,E=1),{min:B,max:E,range:E-B}},[t]),f=q(()=>{let B=t.slice();return B.sort((E,N)=>E.group!==N.group?(E.group??"").localeCompare(N.group??""):E.start-N.start),B},[t]),y=r??g*2+f.length*(i+s)+s+20,b=n-g-c-g,m=g+(h?20:0),x=S(B=>p.range===0?c+g:c+g+(B-p.min)/p.range*b,[p,b,c,g]),v=S(()=>{if(!a)return[];let B=[],E=hs(p.range),N=Math.ceil(p.min/E)*E,z=m+f.length*(i+s)+s;for(let k=N;k<=p.max;k+=E){let w=x(k);B.push(o("line",{key:`grid-${k}`,x1:String(w),y1:String(m),x2:String(w),y2:String(z),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"}))}return B},[a,p,m,f.length,i,s,x]),D=S(()=>{let B=[],E=hs(p.range),N=Math.ceil(p.min/E)*E,z=m-8;for(let k=N;k<=p.max;k+=E){let w=x(k);B.push(o("text",{key:`taxis-${k}`,x:String(w),y:String(z),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},String(k)))}return B.push(o("text",{key:"time-unit",x:String(n-g),y:String(z),"text-anchor":"end","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.4","font-style":"italic"},u)),B},[p,m,x,u,n,g]),A=S(()=>{let B=[],E="";for(let N=0;N<f.length;N++){let z=f[N],k=m+N*(i+s)+s,w=x(z.start),$=Math.max(2,x(z.start+z.duration)-w),C=Nd(N,z.color);z.group&&z.group!==E&&(E=z.group,l&&B.push(o("text",{key:`group-${N}`,x:String(g),y:String(k+i/2-12),"font-size":"9","font-family":"sans-serif","font-weight":"bold",fill:"currentColor",opacity:"0.4","text-transform":"uppercase"},z.group))),B.push(o("rect",{key:`bar-${z.id}`,x:String(w),y:String(k),width:String($),height:String(i),rx:"4",ry:"4",fill:C,role:"graphics-symbol","aria-label":`${z.label}: start ${z.start}, duration ${z.duration}`})),l&&B.push(o("text",{key:`label-${z.id}`,x:String(c+g-8),y:String(k+i/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"currentColor"},z.label.length>16?z.label.substring(0,14)+"..":z.label)),d&&$>30&&B.push(o("text",{key:`prog-${z.id}`,x:String(w+$/2),y:String(k+i/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#ffffff"},`${z.start}-${z.start+z.duration}`))}return B},[f,m,i,s,x,l,d,c,g]),M=S(()=>h?[o("text",{key:"title",x:String(n/2),y:String(g/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},h)]:[],[h,n,g]),T=v(),L=D(),I=A(),P=M();return o("svg",{width:"100%",height:String(y),viewBox:`0 0 ${n} ${y}`,xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Gantt chart",style:{fontFamily:"sans-serif"}},...P,...T,...L,...I)}var Wd=Math.PI/180;function _d(e){return e*Wd}function Ze(e,t,n,r){let i=_d(r);return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function xs(e,t,n,r,i){let s=Ze(e,t,n,i),a=Ze(e,t,n,r),l=i-r,d=Math.abs(l)>180?1:0,u=l>0?1:0;return`M ${s.x} ${s.y} A ${n} ${n} 0 ${d} ${u===1?0:1} ${a.x} ${a.y}`}function Od(e,t,n){return e<t?t:e>n?n:e}function gt(e){return!isFinite(e)||isNaN(e)?"--":Math.abs(e)>=1e3?Math.round(e).toString():e===Math.floor(e)?e.toString():e.toFixed(1)}function ys(e){let{value:t,min:n=0,max:r=100,width:i=300,height:s=200,startAngle:a=-135,endAngle:l=135,arcWidth:d=20,showValue:u=!0,showMinMax:h=!0,showTicks:g=!0,tickCount:c=10,label:p,unit:f,colors:y=["#22c55e","#f59e0b","#ef4444"],needleColor:b="#374151",backgroundColor:m="#e5e7eb"}=e,x=isFinite(n)&&!isNaN(n)?n:0,v=isFinite(r)&&!isNaN(r)&&r>x?r:x+100,D=isFinite(t)&&!isNaN(t)?Od(t,x,v):x,A=(u?24:0)+(p?18:0),M=i/2,T=(s-A)*.6,L=Math.min(i/2,(s-A)*.55)-d/2-10,I=L-d,P=L-d/2,B=l-a,E=S(U=>{let G=v-x;if(G===0)return a;let Y=(U-x)/G;return a+Y*B},[x,v,a,B]),N=S(()=>{let U=xs(M,T,P,a,l);return[o("path",{key:"bg-arc",d:U,fill:"none",stroke:m,"stroke-width":String(d),"stroke-linecap":"round"})]},[M,T,P,a,l,m,d]),z=S(()=>{if(y.length===0)return[];let U=[],G=B/y.length;for(let Y=0;Y<y.length;Y++){let H=a+Y*G,K=H+G,Q=xs(M,T,P,H,K);U.push(o("path",{key:`seg-${Y}`,d:Q,fill:"none",stroke:y[Y],"stroke-width":String(d),"stroke-linecap":Y===0||Y===y.length-1?"round":"butt",opacity:"0.85"}))}return U},[y,B,a,M,T,P,d]),k=S(()=>{if(!g||c<=0)return[];let U=[],G=Math.max(1,Math.min(c,100));for(let Y=0;Y<=G;Y++){let H=Y/G,K=a+H*B,Q=Y%2===0,ie=Q?10:6,J=Ze(M,T,L+4,K),se=Ze(M,T,L+4+ie,K);if(U.push(o("line",{key:`tick-${Y}`,x1:String(J.x),y1:String(J.y),x2:String(se.x),y2:String(se.y),stroke:"currentColor",opacity:"0.4","stroke-width":Q?"2":"1"})),Q){let le=x+H*(v-x),fe=Ze(M,T,L+4+ie+12,K);U.push(o("text",{key:`tick-label-${Y}`,x:String(fe.x),y:String(fe.y+3),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},gt(le)))}}return U},[g,c,a,B,M,T,L,x,v]),w=S(()=>{let U=[],G=E(D),Y=I-8,H=Ze(M,T,Y,G),K=6,Q=G+90,ie=G-90,J=Ze(M,T,K,Q),se=Ze(M,T,K,ie);return U.push(o("polygon",{key:"needle",points:`${H.x},${H.y} ${J.x},${J.y} ${se.x},${se.y}`,fill:b,stroke:"none"})),U.push(o("circle",{key:"needle-cap",cx:String(M),cy:String(T),r:"8",fill:b,stroke:"#fff","stroke-width":"2"})),U},[D,E,M,T,I,b]),$=S(()=>{if(!u)return[];let U=[],G=gt(D),Y=G+(f?" "+f:""),H=T+P+20;return U.push(o("text",{key:"value-text",x:String(M),y:String(H),"text-anchor":"middle","font-size":"22","font-weight":"bold","font-family":"sans-serif",fill:"currentColor","aria-label":`Value: ${Y}`},G,f?o("tspan",{key:"unit","font-size":"14","font-weight":"normal",opacity:"0.6",fill:"currentColor"}," "+f):null)),U},[u,D,f,M,T,P]),C=S(()=>{if(!p)return[];let U=T+P+(u?40:20);return[o("text",{key:"label",x:String(M),y:String(U),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},p)]},[p,M,T,P,u]),F=S(()=>{if(!h)return[];let U=[],G=Ze(M,T,P,a),Y=Ze(M,T,P,l);return U.push(o("text",{key:"min-label",x:String(G.x-4),y:String(G.y+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},gt(x))),U.push(o("text",{key:"max-label",x:String(Y.x+4),y:String(Y.y+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},gt(v))),U},[h,M,T,P,a,l,x,v]),R=N(),W=z(),_=k(),O=w(),V=$(),X=C(),ee=F(),Z=`Gauge: ${gt(D)}${f?" "+f:""}, range ${gt(x)} to ${gt(v)}${p?", "+p:""}`;return o("svg",{width:"100%",viewBox:`0 0 ${i} ${s}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"meter","aria-valuenow":String(D),"aria-valuemin":String(x),"aria-valuemax":String(v),"aria-label":Z,style:{fontFamily:"sans-serif"}},...R,...W,..._,...O,...V,...X,...ee)}var Bt={AL:{name:"Alabama",path:"m 643,467.4 .4,-7.3 -.9,-1.2 -1.7,-.7 -2.5,-2.8 .5,-2.9 48.8,-5.1 -.7,-2.2 -1.5,-1.5 -.5,-1.4 .6,-6.3 -2.4,-5.7 .5,-2.6 .3,-3.7 2.2,-3.8 -.2,-1.1 -1.7,-1 v -3.2 l -1.8,-1.9 -2.9,-6.1 -12.9,-45.8 -45.7,4 1.3,2 -1.3,67 4.4,33.2 .9,-.5 1.3,.1 .6,.4 .8,-.1 2,-3.8 v -2.3 l 1.1,-1.1 1.4,.5 3.4,6.4 v .9 l -3.3,2.2 3.5,-.4 4.9,-1.6 z"},AK:{name:"Alaska",path:"m 15.8,572 h 2.4 l .7,.7 -1,1.2 -1.9,.2 -2.5,1.3 -3.7,-.1 2.2,-.9 .3,-1.1 2.5,-.3 z m 8.3,-1.7 1.3,.5 h .9 l .5,1.2 .3,-.6 .9,.2 1.1,1.5 0,.5 -4.2,1.9 -2.4,-.1 -1,-.5 -1.1,.7 -2,0 -1.1,-1.4 4.7,-.5 z m 5.4,-.1 1,.1 .7,.7 v 1 l -1.3,.1 -.9,-1.1 z m 2.5,.3 1.3,-.1 -.1,1 -1.1,.6 z m .3,2.2 3.4,-.1 .2,1.1 -1.3,.1 -.3,-.5 -.8,.6 -.4,-.6 -.9,-.2 z m 166.3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5 -1,1 .8,.8 3.8,.7 1.2,1.2 .1,4.4 -1.3,2.8 2,.1 1,-.8 .9,.8 -1.1,3.1 1,1.6 1.2,.3 z m -49.5,-37.3 -.5,.1 -1.5,1.6 .2,.5 1.5,-.6 v -.6 l .9,-.3 z m 1.6,-1.1 -1,.3 -.2,.7 .9,-.1 z m -1.3,-1.6 -.2,.9 h 1.7 l .6,-.4 .1,-1 z m 2.8,-3 -.3,1.9 1.2,-.5 .1,-1.4 z m 58.3,31.9 -2,.3 -.4,1.3 1.3,1.7 z"},WY:{name:"Wyoming",path:"m 355.3,143.7 -51,-5.3 -57.3,-7.9 -2,10.7 -8.5,54.8 -3.3,21.9 32.1,4.8 44.9,5.7 37.5,3.4 3.7,-44.2 z"},DC:{name:"District of Columbia",path:"m 803.5,252 -2.6,-1.8 -1,1.7 .5,.4 .4,.1 .6,.5 .3,.7 -.1,.5 .2,.5 z"}};function Ss(e){let{width:t=959,height:n=593,stateColors:r={},defaultColor:i="#D0D0D0",strokeColor:s="#FFFFFF",strokeWidth:a=1,onStateClick:l,onStateHover:d,hoverColor:u="#FFD700",title:h="Map of the United States"}=e,g=q(()=>Object.keys(Bt),[]),c=S(m=>{l&&l(m)},[l]),p=S((m,x)=>{let v=x.currentTarget;v&&v.setAttribute("fill",u),d&&d(m)},[d,u]),f=S((m,x)=>{let v=x.currentTarget;if(v){let D=r[m]??i;v.setAttribute("fill",D)}d&&d(null)},[d,r,i]),y=q(()=>{let m=[];for(let x=0;x<g.length;x++){let v=g[x],D=Bt[v],A=r[v]??i,M={key:`state-${v}`,d:D.path,fill:A,stroke:s,"stroke-width":String(a),"stroke-linejoin":"round","data-state":v,role:"img","aria-label":D.name,style:{cursor:l?"pointer":"default"}};if(l){let L=v;M.onClick=()=>c(L),M.onKeyDown=I=>{(I.key==="Enter"||I.key===" ")&&c(L)},M.tabindex=0,M.role="button",M["aria-label"]=D.name}let T=v;M.onMouseOver=L=>p(T,L),M.onMouseOut=L=>f(T,L),m.push(o("path",M))}return m},[g,r,i,s,a,l,c,p,f]),b=o("title",{key:"map-title"},h);return o("svg",{width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h,style:{fontFamily:"sans-serif"}},b,...y)}function Zn(e){let t=e.replace("#",""),n=t.length===3?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,r=parseInt(n,16);return{r:r>>16&255,g:r>>8&255,b:r&255}}function Hd(e,t,n){let r=i=>{let s=Math.max(0,Math.min(255,Math.round(i))).toString(16);return s.length===1?"0"+s:s};return`#${r(e)}${r(t)}${r(n)}`}function Yd(e,t){if(t.length===0)return"#000000";if(t.length===1)return t[0];let n=Math.max(0,Math.min(1,e)),r=t.length-1,i=Math.min(Math.floor(n*r),r-1),s=n*r-i,a=Zn(t[i]),l=Zn(t[i+1]);return Hd(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}function Vd(e){let{r:t,g:n,b:r}=Zn(e);return(.299*t+.587*n+.114*r)/255}var Ud=["#3b82f6","#fbbf24","#ef4444"];function vs(e){let{data:t=[],rowLabels:n,columnLabels:r,width:i=600,height:s=400,colorScale:a=Ud,minValue:l,maxValue:d,showValues:u=!1,cellBorderColor:h="#fff",cellBorderWidth:g=1,title:c,padding:p=60}=e,f=t.length,y=q(()=>{let k=0;for(let w of t)w.length>k&&(k=w.length);return k},[t]),{minVal:b,maxVal:m}=q(()=>{let k=l??1/0,w=d??-1/0;for(let $ of t)for(let C of $)l===void 0&&C<k&&(k=C),d===void 0&&C>w&&(w=C);return k===1/0&&(k=0),w===-1/0&&(w=1),k===w&&(w=k+1),{minVal:k,maxVal:w}},[t,l,d]),x=c?30:0,v=n?p:20,D=r?p:20,A=i-v-20,M=s-x-D-20,T=y>0?A/y:0,L=f>0?M/f:0,I=S(()=>{let k=[];for(let w=0;w<f;w++){let $=t[w];for(let C=0;C<y;C++){let F=C<$.length?$[C]:0,R=(F-b)/(m-b),W=Yd(R,a),_=v+C*T,O=x+20+w*L;if(k.push(o("rect",{key:`cell-${w}-${C}`,x:String(_),y:String(O),width:String(T),height:String(L),fill:W,stroke:h,"stroke-width":String(g)})),u){let V=Vd(W)>.5?"#111827":"#ffffff";k.push(o("text",{key:`val-${w}-${C}`,x:String(_+T/2),y:String(O+L/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.min(11,T*.3,L*.4)),"font-family":"sans-serif",fill:V},String(Math.round(F*100)/100)))}}}return k},[t,f,y,b,m,a,T,L,v,x,u,h,g]),P=S(()=>{let k=[];if(n)for(let w=0;w<f;w++){let $=w<n.length?n[w]:"",C=x+20+w*L+L/2;k.push(o("text",{key:`row-label-${w}`,x:String(v-8),y:String(C),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},$))}if(r)for(let w=0;w<y;w++){let $=w<r.length?r[w]:"",C=v+w*T+T/2,F=x+20+f*L+16;k.push(o("text",{key:`col-label-${w}`,x:String(C),y:String(F),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},$))}return k},[n,r,f,y,T,L,v,x]),B=S(()=>c?[o("text",{key:"title",x:String(i/2),y:"22","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},c)]:[],[c,i]);if(f===0||y===0)return o("svg",{width:"100%",viewBox:`0 0 ${i} ${s}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":c??"Heat map \u2014 no data"},o("text",{x:String(i/2),y:String(s/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"No data to display."));let E=B(),N=I(),z=P();return o("svg",{width:"100%",viewBox:`0 0 ${i} ${s}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":c??"Heat map",style:{fontFamily:"sans-serif"}},...E,...N,...z)}function jd(e,t){if(e.length===0)return[];let n=e[0],r=e[0];for(let a=1;a<e.length;a++){let l=e[a];l<n&&(n=l),l>r&&(r=l)}if(n===r)return[{min:n,max:r+1,count:e.length}];let i=(r-n)/t,s=[];for(let a=0;a<t;a++)s.push({min:n+a*i,max:n+(a+1)*i,count:0});for(let a=0;a<e.length;a++){let l=e[a],d=Math.floor((l-n)/i);d>=t&&(d=t-1),s[d].count++}return s}function Gd(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function Jn(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function ws(e){let{data:t=[],bins:n=10,width:r=600,height:i=400,barColor:s="#3b82f6",barGap:a=2,showGrid:l=!0,showValues:d=!0,title:u,xLabel:h,yLabel:g,padding:c=60}=e,p=Math.max(1,Math.round(n)),f=q(()=>jd(t,p),[t,p]),y=q(()=>{let E=0;for(let N=0;N<f.length;N++)f[N].count>E&&(E=f[N].count);return E>0?E:1},[f]),b=r-c*2,m=i-c*2,x=S(()=>{if(!l)return[];let E=Gd(y),N=[];for(let z=E;z<=y;z+=E){let k=c+m-z/y*m;N.push(o("line",{key:`grid-${z}`,x1:String(c),y1:String(k),x2:String(c+b),y2:String(k),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),N.push(o("text",{key:`grid-label-${z}`,x:String(c-8),y:String(k+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(z)))}return N},[l,y,c,b,m]),v=S(()=>{let E=[];return E.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+m),stroke:"#374151","stroke-width":"1.5"})),E.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+m),x2:String(c+b),y2:String(c+m),stroke:"#374151","stroke-width":"1.5"})),E},[c,b,m]),D=S(()=>{if(f.length===0)return[];let E=[],N=a*(f.length-1),z=Math.max(1,(b-N)/f.length);for(let k=0;k<f.length;k++){let w=f[k],$=w.count/y*m,C=c+k*(z+a),F=c+m-$;if(E.push(o("rect",{key:`bar-${k}`,x:String(C),y:String(F),width:String(z),height:String($),fill:s})),d&&w.count>0&&E.push(o("text",{key:`val-${k}`,x:String(C+z/2),y:String(F-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},String(w.count))),f.length<=15||k%2===0||k===f.length-1){let W=(f.length===1,Jn(w.min));E.push(o("text",{key:`xlabel-${k}`,x:String(C+z/2),y:String(c+m+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},W))}}if(f.length>0){let k=f[f.length-1],w=c+b;E.push(o("text",{key:"xlabel-end",x:String(w),y:String(c+m+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},Jn(k.max)))}return E},[f,y,a,s,d,c,b,m]),A=S(()=>{let E=[];return u&&E.push(o("text",{key:"title",x:String(r/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},u)),h&&E.push(o("text",{key:"x-label",x:String(c+b/2),y:String(i-8),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151"},h)),g&&E.push(o("text",{key:"y-label",x:String(14),y:String(c+m/2),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90 14 ${c+m/2})`},g)),E},[u,h,g,r,i,c,b,m]),M=S(()=>t.length>0?[]:[o("text",{key:"empty",x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,r,i]),T=x(),L=v(),I=D(),P=A(),B=M();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":u??"Histogram",style:{fontFamily:"sans-serif"}},...P,...T,...L,...I,...B)}function Xd(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function ks(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",stemColor:s="#94a3b8",stemWidth:a=2,dotRadius:l=6,dotColor:d="#3b82f6",showGrid:u=!0,showValues:h=!0,title:g,padding:c=60}=e,p=i==="vertical",f=p?30:0,y=n-c*2,b=r-c*2-f,m=p?b:y,x=p?y:b,v=q(()=>{let k=0;for(let w=0;w<t.length;w++)t[w].value>k&&(k=t[w].value);return k>0?k:1},[t]),D=q(()=>t.length===0?0:x/t.length,[t.length,x]),A=S(()=>{if(!u)return[];let k=Xd(v),w=[];for(let $=k;$<=v;$+=k){let C=$/v*m;if(p){let F=c+b-C;w.push(o("line",{key:`grid-${$}`,x1:String(c),y1:String(F),x2:String(c+y),y2:String(F),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`grid-label-${$}`,x:String(c-8),y:String(F+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String($)))}else{let F=c+C;w.push(o("line",{key:`grid-${$}`,x1:String(F),y1:String(c),x2:String(F),y2:String(c+b),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`grid-label-${$}`,x:String(F),y:String(c+b+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String($)))}}return w},[u,v,p,c,y,b,m]),M=S(()=>{let k=[];return p?k.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+b),stroke:"#374151","stroke-width":"1.5"})):k.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+b),stroke:"#374151","stroke-width":"1.5"})),k.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+b),x2:String(c+y),y2:String(c+b),stroke:"#374151","stroke-width":"1.5"})),k},[p,c,y,b]),T=S(()=>{if(t.length===0)return[];let k=[];for(let w=0;w<t.length;w++){let $=t[w],C=$.value/v*m,F=D*w+D/2,R=$.color??d;if(p){let W=c+F,_=c+b,O=c+b-C;k.push(o("line",{key:`stem-${w}`,x1:String(W),y1:String(_),x2:String(W),y2:String(O),stroke:s,"stroke-width":String(a)})),k.push(o("circle",{key:`dot-${w}`,cx:String(W),cy:String(O),r:String(l),fill:R})),h&&k.push(o("text",{key:`val-${w}`,x:String(W),y:String(O-l-4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String($.value)));let V=W,X=c+b+16;k.push(o("text",{key:`cat-${w}`,x:String(V),y:String(X),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${V}, ${X})`},$.label))}else{let W=c+F,_=c,O=c+C;k.push(o("line",{key:`stem-${w}`,x1:String(_),y1:String(W),x2:String(O),y2:String(W),stroke:s,"stroke-width":String(a)})),k.push(o("circle",{key:`dot-${w}`,cx:String(O),cy:String(W),r:String(l),fill:R})),h&&k.push(o("text",{key:`val-${w}`,x:String(O+l+4),y:String(W+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String($.value))),k.push(o("text",{key:`cat-${w}`,x:String(c-8),y:String(W+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},$.label))}}return k},[t,v,D,d,l,s,a,h,p,c,y,b,m]),L=S(()=>g?[o("text",{key:"title",x:String(n/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},g)]:[],[g,n,c]),I=S(()=>t.length>0?[]:[o("text",{key:"empty",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,n,r]),P=A(),B=M(),E=T(),N=L(),z=I();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Lollipop chart",style:{fontFamily:"sans-serif"}},...N,...P,...B,...E,...z)}function Qn(e){let t=e.replace("#",""),n=t.length===3?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,r=parseInt(n,16);return{r:r>>16&255,g:r>>8&255,b:r&255}}function qd(e,t,n){let r=i=>{let s=Math.max(0,Math.min(255,Math.round(i))).toString(16);return s.length===1?"0"+s:s};return`#${r(e)}${r(t)}${r(n)}`}function Kd(e,t){if(t.length===0)return"#000000";if(t.length===1)return t[0];let n=Math.max(0,Math.min(1,e)),r=t.length-1,i=Math.min(Math.floor(n*r),r-1),s=n*r-i,a=Qn(t[i]),l=Qn(t[i+1]);return qd(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}function Zd(e){let{r:t,g:n,b:r}=Qn(e);return(.299*t+.587*n+.114*r)/255}var Jd=["#f0f9ff","#3b82f6","#1e3a8a"];function Cs(e){let{data:t=[],labels:n,rowLabels:r,columnLabels:i,width:s=500,height:a=500,colorScale:l=Jd,showValues:d=!0,showDiagonal:u=!0,cellBorderColor:h="#e5e7eb",title:g,padding:c=70,symmetric:p=!1}=e,f=r??n,y=i??n,b=t.length,m=q(()=>{let R=0;for(let W of t)W.length>R&&(R=W.length);return R},[t]),x=q(()=>{if(!p||b===0)return t;let R=[],W=Math.max(b,m);for(let _=0;_<W;_++){let O=[];for(let V=0;V<W;V++){let X=t[_],ee=X&&V<X.length?X[V]:0,Z=t[V],U=Z&&_<Z.length?Z[_]:0;ee!==0?O.push(ee):O.push(U)}R.push(O)}return R},[t,p,b,m]),v=x.length,D=q(()=>{let R=0;for(let W of x)W.length>R&&(R=W.length);return R},[x]),{minVal:A,maxVal:M}=q(()=>{let R=1/0,W=-1/0;for(let _ of x)for(let O of _)O<R&&(R=O),O>W&&(W=O);return R===1/0&&(R=0),W===-1/0&&(W=1),R===W&&(W=R+1),{minVal:R,maxVal:W}},[x]),T=g?30:0,L=f?c:20,I=y?c:20,P=s-L-20,B=a-T-I-20,E=D>0?P/D:0,N=v>0?B/v:0,z=S(()=>{let R=[];for(let W=0;W<v;W++){let _=x[W];for(let O=0;O<D;O++){let V=O<_.length?_[O]:0,X=(V-A)/(M-A),ee=Kd(X,l),Z=L+O*E,U=T+20+W*N,G=W===O,Y=G&&u?"currentColor":h,H=G&&u?"2":"1";if(R.push(o("rect",{key:`cell-${W}-${O}`,x:String(Z),y:String(U),width:String(E),height:String(N),fill:ee,stroke:Y,"stroke-width":H})),d){let K=Zd(ee)>.5?"#111827":"#ffffff",Q=Math.min(12,E*.3,N*.35);R.push(o("text",{key:`val-${W}-${O}`,x:String(Z+E/2),y:String(U+N/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.max(8,Q)),"font-weight":G&&u?"bold":"normal","font-family":"sans-serif",fill:K},String(Math.round(V*100)/100)))}}}return R},[x,v,D,A,M,l,E,N,L,T,d,u,h]),k=S(()=>{let R=[];if(f)for(let W=0;W<v;W++){let _=W<f.length?f[W]:"",O=T+20+W*N+N/2;R.push(o("text",{key:`row-label-${W}`,x:String(L-8),y:String(O),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},_))}if(y)for(let W=0;W<D;W++){let _=W<y.length?y[W]:"",O=L+W*E+E/2,V=T+20+v*N+12;R.push(o("text",{key:`col-label-${W}`,x:String(O),y:String(V),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},_))}return R},[f,y,v,D,E,N,L,T]),w=S(()=>g?[o("text",{key:"title",x:String(s/2),y:"22","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},g)]:[],[g,s]);if(v===0||D===0)return o("svg",{width:"100%",viewBox:`0 0 ${s} ${a}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Matrix \u2014 no data"},o("text",{x:String(s/2),y:String(a/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"No data to display."));let $=w(),C=z(),F=k();return o("svg",{width:"100%",viewBox:`0 0 ${s} ${a}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Matrix visualization",style:{fontFamily:"sans-serif"}},...$,...C,...F)}var Qd=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function rn(e){if(!e.children||e.children.length===0)return Math.max(0,e.value??0);let t=0,n=[e];for(;n.length>0;){let r=n.pop();if(!r.children||r.children.length===0)t+=Math.max(0,r.value??0);else for(let i=r.children.length-1;i>=0;i--)n.push(r.children[i])}return t}function eu(e){let t=0,n=[{node:e,depth:0}];for(;n.length>0;){let{node:r,depth:i}=n.pop();if(i>t&&(t=i),r.children)for(let s=r.children.length-1;s>=0;s--)n.push({node:r.children[s],depth:i+1})}return t}function tu(e,t,n,r,i,s,a){let l=[];if(rn(e)<=0)return l;let h=eu(e)+1,g=s==="horizontal",c=g?i/h:r/h,p=[];for(p.push({node:e,depth:0,spanStart:g?t:n,spanEnd:g?t+r:n+i,colorIndex:0});p.length>0;){let f=p.shift(),{node:y,depth:b,spanStart:m,spanEnd:x,colorIndex:v}=f,D=rn(y);if(D<=0)continue;let A=x-m,M,T,L,I;if(g?(M=m,T=n+b*c,L=A,I=c):(M=t+b*c,T=m,L=c,I=A),l.push({x:M,y:T,w:L,h:I,label:y.label,value:D,color:y.color??a[v%a.length],depth:b}),y.children&&y.children.length>0){let P=m;for(let B=0;B<y.children.length;B++){let E=y.children[B],N=rn(E);if(N<=0)continue;let z=N/D*A;p.push({node:E,depth:b+1,spanStart:P,spanEnd:P+z,colorIndex:b===0?B:v}),P+=z}}}return l}function Ms(e){let{data:t,width:n=600,height:r=400,orientation:i="horizontal",showLabels:s=!0,showValues:a=!0,colors:l=Qd,borderColor:d="#ffffff",borderWidth:u=1,title:h,padding:g=10}=e,c=h?30:0,p=g,f=g+c,y=n-g*2,b=r-g*2-c;if(q(()=>rn(t),[t])<=0||y<=0||b<=0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Empty partition diagram"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let x=q(()=>tu(t,p,f,y,b,i,l),[t,p,f,y,b,i,l]),v=[];h&&v.push(o("text",{key:"title",x:String(n/2),y:String(g+16),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h));for(let D=0;D<x.length;D++){let A=x[D];if(v.push(o("rect",{key:`cell-${D}`,x:String(A.x),y:String(A.y),width:String(Math.max(0,A.w)),height:String(Math.max(0,A.h)),fill:A.color,stroke:d,"stroke-width":String(u),role:"graphics-symbol","aria-label":`${A.label}: ${A.value}`})),s&&A.w>20&&A.h>14){let M=Math.floor(A.w/7),T=A.label.length>M?A.label.substring(0,Math.max(1,M-2))+"..":A.label;v.push(o("text",{key:`label-${D}`,x:String(A.x+A.w/2),y:String(A.y+A.h/2+(a?-2:4)),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},T))}a&&A.w>30&&A.h>28&&v.push(o("text",{key:`value-${D}`,x:String(A.x+A.w/2),y:String(A.y+A.h/2+12),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(A.value)))}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Partition diagram",style:{fontFamily:"sans-serif"}},...v)}function eo(e,t){let n=[];for(let r of t)n.push(String(e[r]??""));return n.join(" | ")}function Es(e,t){let n=new Set;for(let i of e)n.add(eo(i,t));let r=Array.from(n);return r.sort(),r}function sn(e,t){if(e.length===0)return 0;switch(t){case"count":return e.length;case"sum":{let n=0;for(let r of e)n+=r;return n}case"avg":{let n=0;for(let r of e)n+=r;return n/e.length}case"min":{let n=e[0];for(let r=1;r<e.length;r++)e[r]<n&&(n=e[r]);return n}case"max":{let n=e[0];for(let r=1;r<e.length;r++)e[r]>n&&(n=e[r]);return n}}}function an(e){return Number.isInteger(e)?String(e):e.toFixed(2)}function nu(e,t,n,r,i){let s=Es(e,t),a=Es(e,n),l=new Map;for(let p of e){let f=eo(p,t),y=eo(p,n),b=`${f}::${y}`;l.has(b)||l.set(b,[]);let m=l.get(b),x=0;for(let v of r){let D=p[v];if(typeof D=="number")x+=D;else if(typeof D=="string"){let A=parseFloat(D);isNaN(A)||(x+=A)}}m.push(x)}let d=new Map;for(let[p,f]of l)d.set(p,sn(f,i));let u=new Map;for(let p of s){let f=[];for(let y of a){let b=d.get(`${p}::${y}`);b!==void 0&&f.push(b)}u.set(p,sn(f,i==="count"?"sum":i))}let h=new Map;for(let p of a){let f=[];for(let y of s){let b=d.get(`${y}::${p}`);b!==void 0&&f.push(b)}h.set(p,sn(f,i==="count"?"sum":i))}let g=[];for(let p of u.values())g.push(p);let c=sn(g,i==="count"?"sum":i);return{rowKeys:s,colKeys:a,cells:d,rowTotals:u,colTotals:h,grandTotal:c}}function Is(e){let{data:t=[],rows:n=[],columns:r=[],values:i=[],aggregation:s="sum",width:a=600,height:l=400,showTotals:d=!0,title:u,headerColor:h="#3b82f6",cellPadding:g=8}=e;if(t.length===0||n.length===0&&r.length===0||i.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${a} ${l}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"table","aria-label":u??"Empty pivot table"},o("text",{x:String(a/2),y:String(l/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.4"},"No data to display"));let c=q(()=>nu(t,n,r,i,s),[t,n,r,i,s]),{rowKeys:p,colKeys:f,cells:y,rowTotals:b,colTotals:m,grandTotal:x}=c,v=u?30:0,D=f.length+(d?1:0),A=p.length+(d?1:0),M=1+D,T=1+A,L=Math.max(40,(a-g*2)/M),I=Math.max(20,Math.min(36,(l-v-g*2)/T)),P=L*M,B=I*T,E=Math.max(0,(a-P)/2),N=v+Math.max(0,(l-v-B)/2),z=[];u&&z.push(o("text",{key:"title",x:String(a/2),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},u)),z.push(o("rect",{key:"header-row-bg",x:String(E),y:String(N),width:String(P),height:String(I),fill:h})),z.push(o("rect",{key:"header-col-bg",x:String(E),y:String(N+I),width:String(L),height:String(I*A),fill:h,opacity:"0.85"})),z.push(o("text",{key:"corner",x:String(E+L/2),y:String(N+I/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},s.toUpperCase()));for(let k=0;k<f.length;k++){let w=E+(k+1)*L,$=Math.floor(L/7),C=f[k],F=C.length>$?C.substring(0,Math.max(1,$-2))+"..":C;z.push(o("text",{key:`ch-${k}`,x:String(w+L/2),y:String(N+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},F))}d&&z.push(o("text",{key:"ch-total",x:String(E+(f.length+1)*L+L/2),y:String(N+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},"Total"));for(let k=0;k<p.length;k++){let w=p[k],$=N+(k+1)*I;k%2===0&&z.push(o("rect",{key:`row-bg-${k}`,x:String(E+L),y:String($),width:String(L*D),height:String(I),fill:"#f9fafb"}));let C=Math.floor(L/7),F=w.length>C?w.substring(0,Math.max(1,C-2))+"..":w;z.push(o("text",{key:`rh-${k}`,x:String(E+L/2),y:String($+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},F));for(let R=0;R<f.length;R++){let W=f[R],_=`${w}::${W}`,O=y.get(_),V=E+(R+1)*L;z.push(o("rect",{key:`border-${k}-${R}`,x:String(V),y:String($),width:String(L),height:String(I),fill:"none",stroke:"#e5e7eb","stroke-width":"0.5"})),z.push(o("text",{key:`cell-${k}-${R}`,x:String(V+L/2),y:String($+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},O!==void 0?an(O):"-"))}if(d){let R=E+(f.length+1)*L,W=b.get(w)??0;z.push(o("rect",{key:`rt-bg-${k}`,x:String(R),y:String($),width:String(L),height:String(I),fill:"#eff6ff"})),z.push(o("text",{key:`rt-${k}`,x:String(R+L/2),y:String($+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},an(W)))}}if(d){let k=N+(p.length+1)*I;z.push(o("rect",{key:"total-row-bg",x:String(E),y:String(k),width:String(P),height:String(I),fill:"#eff6ff"})),z.push(o("text",{key:"total-label",x:String(E+L/2),y:String(k+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},"Total"));for(let $=0;$<f.length;$++){let C=f[$],F=m.get(C)??0,R=E+($+1)*L;z.push(o("text",{key:`ct-${$}`,x:String(R+L/2),y:String(k+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},an(F)))}let w=E+(f.length+1)*L;z.push(o("text",{key:"grand-total",x:String(w+L/2),y:String(k+I/2+4),"text-anchor":"middle","font-size":"12","font-family":"sans-serif","font-weight":"bold",fill:"#1e3a8a"},an(x)))}return z.push(o("rect",{key:"outer-border",x:String(E),y:String(N),width:String(P),height:String(B),fill:"none",stroke:"#d1d5db","stroke-width":"1"})),o("svg",{width:"100%",viewBox:`0 0 ${a} ${l}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"table","aria-label":u??"Pivot table",style:{fontFamily:"sans-serif"}},...z)}function ln(e,t){return Math.PI*2*e/t-Math.PI/2}function cn(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function Rs(e){let{axes:t=[],series:n=[],width:r=500,height:i=500,levels:s=5,showLabels:a=!0,showValues:l=!1,showLegend:d=!0,showDots:u=!0,gridColor:h="#d1d5db",title:g}=e,c=t.length,p=g?30:0,f=d&&n.length>0?30:0,y=60,b=Math.min((r-y*2)/2,(i-y*2-p-f)/2),m=r/2,x=y+p+b,v=q(()=>{let z=[];for(let k=0;k<c;k++){let w=t[k]?.max;if(w!==void 0&&w>0){z.push(w);continue}let $=0;for(let C of n){let F=C.values[k];F!==void 0&&F>$&&($=F)}z.push($>0?$:1)}return z},[t,n,c]),D=S(()=>{if(c<3)return[];let z=[];for(let k=1;k<=s;k++){let w=b*k/s,$=[];for(let C=0;C<c;C++){let F=ln(C,c),R=cn(m,x,w,F);$.push(`${R.x},${R.y}`)}z.push(o("polygon",{key:`ring-${k}`,points:$.join(" "),fill:"none",stroke:h,"stroke-width":k===s?"1.5":"0.5","stroke-dasharray":k===s?"none":"3 2"}))}for(let k=0;k<c;k++){let w=ln(k,c),$=cn(m,x,b,w);z.push(o("line",{key:`spoke-${k}`,x1:String(m),y1:String(x),x2:String($.x),y2:String($.y),stroke:h,"stroke-width":"0.75"}))}return z},[c,s,b,m,x,h]),A=S(()=>{if(!a||c<3)return[];let z=[],k=16;for(let w=0;w<c;w++){let $=ln(w,c),C=cn(m,x,b+k,$),F="middle";C.x<m-5?F="end":C.x>m+5&&(F="start");let R=Math.abs(C.y-x)<5?"0.35em":C.y<x?"0em":"0.7em";z.push(o("text",{key:`label-${w}`,x:String(C.x),y:String(C.y),"text-anchor":F,dy:R,"font-size":"12","font-family":"sans-serif",fill:"currentColor"},t[w]?.label??`Axis ${w}`))}return z},[a,c,t,b,m,x]),M=S(()=>{if(c<3||n.length===0)return[];let z=[];for(let k=0;k<n.length;k++){let w=n[k],$=[],C=[],F=[];for(let R=0;R<c;R++){let W=w.values[R]??0,_=v[R],O=Math.min(W/_,1),V=b*O,X=ln(R,c),ee=cn(m,x,V,X);$.push(`${ee.x},${ee.y}`),u&&C.push(o("circle",{key:`dot-${k}-${R}`,cx:String(ee.x),cy:String(ee.y),r:"3.5",fill:w.color,stroke:"#fff","stroke-width":"1.5"})),l&&F.push(o("text",{key:`val-${k}-${R}`,x:String(ee.x),y:String(ee.y-8),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:w.color},String(Math.round(W*100)/100)))}z.push(o("polygon",{key:`series-fill-${k}`,points:$.join(" "),fill:w.color,"fill-opacity":String(w.fillOpacity??.15),stroke:"none"})),z.push(o("polygon",{key:`series-line-${k}`,points:$.join(" "),fill:"none",stroke:w.color,"stroke-width":"2","stroke-linejoin":"round"}));for(let R of C)z.push(R);for(let R of F)z.push(R)}return z},[c,n,v,b,m,x,u,l]),T=S(()=>{if(!d||n.length===0)return[];let z=[],k=x+b+40,w=100,$=n.length*w,C=m-$/2;for(let F=0;F<n.length;F++){let R=n[F],W=C+F*w;z.push(o("rect",{key:`legend-swatch-${F}`,x:String(W),y:String(k),width:"12",height:"12",rx:"2",fill:R.color})),z.push(o("text",{key:`legend-text-${F}`,x:String(W+16),y:String(k+10),"font-size":"12","font-family":"sans-serif",fill:"currentColor"},R.label))}return z},[d,n,m,x,b]),L=S(()=>g?[o("text",{key:"title",x:String(r/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},g)]:[],[g,r]);if(c<3)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Radar chart \u2014 insufficient axes"},o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"Radar chart requires at least 3 axes."));let I=D(),P=A(),B=M(),E=T(),N=L();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Radar chart",style:{fontFamily:"sans-serif"}},...N,...I,...P,...B,...E)}var ou=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function ru(e,t){let n=new Map,r=new Map,i=new Map;for(let l of e)r.set(l,new Set),i.set(l,[]);for(let l of t){if(l.value<=0)continue;let d=r.get(l.target);d&&d.add(l.source);let u=i.get(l.source);u&&u.push(l.target)}let s=[];for(let l of e)r.get(l).size===0&&(n.set(l,0),s.push(l));if(s.length===0){for(let l of e)n.set(l,0);return n}let a=0;for(;a<s.length;){let l=s[a];a++;let d=n.get(l),u=i.get(l)??[];for(let h of u){let g=n.get(h),c=d+1;(g===void 0||c>g)&&n.set(h,c),s.includes(h)||s.push(h)}}for(let l of e)n.has(l)||n.set(l,0);return n}function iu(e,t,n,r,i,s,a,l){if(e.length===0)return{layoutNodes:[],layoutLinks:[]};let d=n-a*2,u=r-a*2,h=t.filter(P=>P.value>0),g=e.map(P=>P.id),c=ru(g,h),p=new Map,f=new Map;for(let P of g)p.set(P,0),f.set(P,0);for(let P of h)f.set(P.source,(f.get(P.source)??0)+P.value),p.set(P.target,(p.get(P.target)??0)+P.value);let y=0;for(let P of c.values())P>y&&(y=P);let b=new Map;for(let P=0;P<=y;P++)b.set(P,[]);for(let[P,B]of c)b.get(B).push(P);let m=new Map,x=y>0?(d-i)/y:0;for(let P=0;P<=y;P++)m.set(P,a+P*x);let v=new Map;for(let P=0;P<e.length;P++)v.set(e[P].id,e[P]);let D=[],A=new Map;for(let P=0;P<=y;P++){let B=b.get(P);if(B.length===0)continue;let E=0;for(let w of B){let $=p.get(w)??0,C=f.get(w)??0;E+=Math.max($,C,1)}let N=u-s*(B.length-1),z=E>0?N/E:1,k=a;for(let w=0;w<B.length;w++){let $=B[w],C=v.get($),F=p.get($)??0,R=f.get($)??0,W=Math.max(F,R,1),_=Math.max(4,W*z),O=e.findIndex(X=>X.id===$),V={id:$,label:C.label,color:C.color??l[O%l.length],column:P,x:m.get(P),y:k,height:_,totalIn:F,totalOut:R,totalValue:W};D.push(V),A.set($,V),k+=_+s}}let M=new Map,T=new Map;for(let P of g)M.set(P,0),T.set(P,0);let L=[...h].sort((P,B)=>B.value-P.value),I=[];for(let P of L){let B=A.get(P.source),E=A.get(P.target);if(!B||!E)continue;let N=B.totalOut||1,z=E.totalIn||1,k=P.value/N*B.height,w=P.value/z*E.height,$=Math.max(1,(k+w)/2),C=M.get(P.source),F=T.get(P.target),R=B.y+C+k/2,W=E.y+F+w/2;M.set(P.source,C+k),T.set(P.target,F+w);let _=v.get(P.source);I.push({source:P.source,target:P.target,value:P.value,color:P.color??_?.color??B.color,sourceY:R,targetY:W,width:$})}return{layoutNodes:D,layoutLinks:I}}function Ps(e){let{nodes:t,links:n,width:r=800,height:i=500,nodeWidth:s=20,nodePadding:a=10,showLabels:l=!0,showValues:d=!1,linkOpacity:u=.4,colors:h=ou,title:g,padding:c=40}=e;if(!t||t.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Empty Sankey diagram"},o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let p=q(()=>iu(t,n,r,i,s,a,c,h),[t,n,r,i,s,a,c,h]),f=S(()=>{let D=[];for(let A=0;A<p.layoutLinks.length;A++){let M=p.layoutLinks[A],T=p.layoutNodes.find(N=>N.id===M.source),L=p.layoutNodes.find(N=>N.id===M.target);if(!T||!L)continue;let I=T.x+s,P=L.x,B=(I+P)/2,E=`M ${I} ${M.sourceY} C ${B} ${M.sourceY}, ${B} ${M.targetY}, ${P} ${M.targetY}`;D.push(o("path",{key:`link-${A}`,d:E,fill:"none",stroke:M.color,"stroke-width":String(Math.max(1,M.width)),"stroke-opacity":String(u),"stroke-linecap":"butt"})),d&&M.value>0&&D.push(o("text",{key:`link-val-${A}`,x:String(B),y:String((M.sourceY+M.targetY)/2-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280","pointer-events":"none"},String(M.value)))}return D},[p,s,u,d]),y=S(()=>{let D=[];for(let A=0;A<p.layoutNodes.length;A++){let M=p.layoutNodes[A];if(D.push(o("rect",{key:`node-${M.id}`,x:String(M.x),y:String(M.y),width:String(s),height:String(M.height),fill:M.color,stroke:"#374151","stroke-width":"0.5",role:"img","aria-label":`${M.label}: ${M.totalValue}`})),l){let T=p.layoutNodes.reduce((z,k)=>Math.max(z,k.column),0),L=M.column===T,I=L?M.x+s+6:M.x-6,P=L?"start":"end",B=M.column===0,E=B?M.x-6:I,N=B?"end":P;D.push(o("text",{key:`label-${M.id}`,x:String(E),y:String(M.y+M.height/2+4),"text-anchor":N,"font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},M.label))}}return D},[p,s,l]),b=S(()=>g?[o("text",{key:"title",x:String(r/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},g)]:[],[g,r,c]),m=f(),x=y(),v=b();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Sankey diagram",style:{fontFamily:"sans-serif"}},...v,...m,...x)}var su=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],to=2*Math.PI;function Ft(e){if(!e.children||e.children.length===0)return Math.max(0,e.value??0);let t=0,n=[e];for(;n.length>0;){let r=n.pop();if(!r.children||r.children.length===0)t+=Math.max(0,r.value??0);else for(let i=r.children.length-1;i>=0;i--)n.push(r.children[i])}return t}function au(e){let t=0,n=[{node:e,depth:0}];for(;n.length>0;){let{node:r,depth:i}=n.pop();if(i>t&&(t=i),r.children)for(let s=r.children.length-1;s>=0;s--)n.push({node:r.children[s],depth:i+1})}return t}function lu(e,t,n,r,i,s){let a=s-i,l=a>Math.PI?1:0,d=i-Math.PI/2,u=s-Math.PI/2,h=e+r*Math.cos(d),g=t+r*Math.sin(d),c=e+r*Math.cos(u),p=t+r*Math.sin(u),f=e+n*Math.cos(u),y=t+n*Math.sin(u),b=e+n*Math.cos(d),m=t+n*Math.sin(d);if(a>=to-.001){let x=d+Math.PI,v=e+r*Math.cos(x),D=t+r*Math.sin(x),A=e+n*Math.cos(x),M=t+n*Math.sin(x);return[`M ${h} ${g}`,`A ${r} ${r} 0 1 1 ${v} ${D}`,`A ${r} ${r} 0 1 1 ${h} ${g}`,`L ${b} ${m}`,`A ${n} ${n} 0 1 0 ${A} ${M}`,`A ${n} ${n} 0 1 0 ${b} ${m}`,"Z"].join(" ")}return[`M ${h} ${g}`,`A ${r} ${r} 0 ${l} 1 ${c} ${p}`,`L ${f} ${y}`,`A ${n} ${n} 0 ${l} 0 ${b} ${m}`,"Z"].join(" ")}function cu(e,t,n,r){let i=[],s=Ft(e);if(s<=0)return i;let a=au(e),l=a>0?(n-t)/(a+1):n-t,d=[];if(e.children&&e.children.length>0){let u=0;for(let h=0;h<e.children.length;h++){let g=e.children[h],c=Ft(g);if(c<=0)continue;let p=c/s*to;d.push({node:g,startAngle:u,endAngle:u+p,depth:0,colorIndex:h}),u+=p}}else return i.push({startAngle:0,endAngle:to,innerR:t,outerR:t+l,label:e.label,value:s,color:e.color??r[0],depth:0}),i;for(;d.length>0;){let u=d.shift(),{node:h,startAngle:g,endAngle:c,depth:p,colorIndex:f}=u,y=Ft(h);if(y<=0)continue;let b=t+p*l,m=b+l;if(i.push({startAngle:g,endAngle:c,innerR:b,outerR:m,label:h.label,value:y,color:h.color??r[f%r.length],depth:p}),h.children&&h.children.length>0){let x=g,v=c-g;for(let D=0;D<h.children.length;D++){let A=h.children[D],M=Ft(A);if(M<=0)continue;let T=M/y*v;d.push({node:A,startAngle:x,endAngle:x+T,depth:p+1,colorIndex:f}),x+=T}}}return i}function $s(e){let{data:t,width:n=500,height:r=500,innerRadius:i=40,showLabels:s=!0,colors:a=su,strokeColor:l="#ffffff",strokeWidth:d=1,title:u}=e,h=n/2,g=r/2,c=u?20:0,p=Math.min(h,g-c)-10;if(q(()=>Ft(t),[t])<=0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":u??"Empty sunburst chart"},o("text",{x:String(h),y:String(g),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let y=q(()=>cu(t,i,p,a),[t,i,p,a]),b=[];u&&b.push(o("text",{key:"title",x:String(h),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},u));let m=g+c/2;for(let x=0;x<y.length;x++){let v=y[x],D=lu(h,m,v.innerR,v.outerR,v.startAngle,v.endAngle);if(b.push(o("path",{key:`arc-${x}`,d:D,fill:v.color,stroke:l,"stroke-width":String(d),role:"graphics-symbol","aria-label":`${v.label}: ${v.value}`})),s){let A=v.endAngle-v.startAngle,M=v.startAngle+A/2-Math.PI/2,T=(v.innerR+v.outerR)/2,L=v.outerR-v.innerR,I=A*T;if(I>20&&L>14){let P=h+T*Math.cos(M),B=m+T*Math.sin(M),E=Math.floor(Math.min(I,L)/7),N=v.label.length>E?v.label.substring(0,Math.max(1,E-1))+"..":v.label;b.push(o("text",{key:`label-${x}`,x:String(P),y:String(B+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},N))}}}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":u??"Sunburst chart",style:{fontFamily:"sans-serif"}},...b)}var du=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function dn(e){if(!e.children||e.children.length===0)return Math.max(0,e.value);let t=0,n=[e];for(;n.length>0;){let r=n.pop();if(!r.children||r.children.length===0)t+=Math.max(0,r.value);else for(let i=r.children.length-1;i>=0;i--)n.push(r.children[i])}return t}function Ts(e,t){if(e.length===0||t<=0)return 1/0;let n=0;for(let s of e)n+=s;if(n<=0)return 1/0;let r=n/t,i=0;for(let s of e){if(s<=0)continue;let a=s/r,l=Math.max(a/r,r/a);l>i&&(i=l)}return i}function uu(e,t,n,r,i,s){let a=[],l=[],d=dn(e);if(d<=0||r<=0||i<=0)return a;let u=e.children&&e.children.length>0?e.children:[e],h=r*i,g=[];for(let c=0;c<u.length;c++){let p=u[c],f=dn(p);f<=0||g.push({label:p.label,value:f,area:f/d*h,color:p.color??s[c%s.length],node:p})}for(g.sort((c,p)=>p.area-c.area),l.push({nodes:g,rect:{x:t,y:n,w:r,h:i},depth:0});l.length>0;){let c=l.shift(),{nodes:p,rect:f,depth:y}=c;if(p.length===0)continue;let b={...f},m=0;for(;m<p.length&&b.w>0&&b.h>0;){let x=b.w>=b.h,v=x?b.h:b.w,D=[],A=[];D.push(p[m]),A.push(p[m].area),m++;let M=Ts(A,v);for(;m<p.length;){let P=[...A,p[m].area],B=Ts(P,v);if(B>M)break;D.push(p[m]),A.push(p[m].area),M=B,m++}let T=0;for(let P of A)T+=P;let L=v>0?T/v:0,I=0;for(let P=0;P<D.length;P++){let B=D[P],E=L>0?B.area/L:0,N,z,k,w;if(x?(N=b.x,z=b.y+I,k=L,w=E):(N=b.x+I,z=b.y,k=E,w=L),a.push({x:N,y:z,w:k,h:w,label:B.label,value:B.value,color:B.color,depth:y}),B.node.children&&B.node.children.length>0){let C=N+2,F=z+2+14,R=k-4,W=w-4-14;if(R>4&&W>4){let _=[],O=B.value,V=R*W;for(let X=0;X<B.node.children.length;X++){let ee=B.node.children[X],Z=dn(ee);Z<=0||_.push({label:ee.label,value:Z,area:Z/O*V,color:ee.color??s[(X+y+1)%s.length],node:ee})}_.sort((X,ee)=>ee.area-X.area),l.push({nodes:_,rect:{x:C,y:F,w:R,h:W},depth:y+1})}}I+=E}x?b={x:b.x+L,y:b.y,w:b.w-L,h:b.h}:b={x:b.x,y:b.y+L,w:b.w,h:b.h-L}}}return a}function Ds(e){let{data:t,width:n=600,height:r=400,showLabels:i=!0,showValues:s=!0,colors:a=du,borderColor:l="#ffffff",borderWidth:d=2,padding:u=2,title:h}=e,g=h?30:0,c=u,p=u+g,f=n-u*2,y=r-u*2-g;if(q(()=>dn(t),[t])<=0||f<=0||y<=0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Empty treemap"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let m=q(()=>uu(t,c,p,f,y,a),[t,c,p,f,y,a]),x=[];h&&x.push(o("text",{key:"title",x:String(n/2),y:String(u+16),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h));for(let v=0;v<m.length;v++){let D=m[v];if(x.push(o("rect",{key:`cell-${v}`,x:String(D.x),y:String(D.y),width:String(Math.max(0,D.w)),height:String(Math.max(0,D.h)),fill:D.color,stroke:l,"stroke-width":String(d),role:"graphics-symbol","aria-label":`${D.label}: ${D.value}`})),i&&D.w>20&&D.h>14){let A=Math.floor(D.w/7),M=D.label.length>A?D.label.substring(0,Math.max(1,A-2))+"..":D.label;x.push(o("text",{key:`label-${v}`,x:String(D.x+4),y:String(D.y+12),"font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},M))}s&&D.w>30&&D.h>28&&x.push(o("text",{key:`value-${v}`,x:String(D.x+4),y:String(D.y+24),"font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(D.value)))}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Treemap chart",style:{fontFamily:"sans-serif"}},...x)}function zs(e){let t=e.replace("#",""),n,r,i;return t.length===3?(n=parseInt(t[0]+t[0],16),r=parseInt(t[1]+t[1],16),i=parseInt(t[2]+t[2],16)):(n=parseInt(t.substring(0,2),16),r=parseInt(t.substring(2,4),16),i=parseInt(t.substring(4,6),16)),{r:isNaN(n)?0:n,g:isNaN(r)?0:r,b:isNaN(i)?0:i}}function pu(e,t,n){let r=s=>Math.max(0,Math.min(255,Math.round(s))),i=s=>r(s).toString(16).padStart(2,"0");return"#"+i(e)+i(t)+i(n)}function As(e,t){if(t.length===0)return"#3b82f6";if(t.length===1)return t[0];let n=Math.max(0,Math.min(1,e)),r=t.length-1,i=n*r,s=Math.floor(i),a=Math.min(s+1,r),l=i-s,d=zs(t[s]),u=zs(t[a]);return pu(d.r+(u.r-d.r)*l,d.g+(u.g-d.g)*l,d.b+(u.b-d.b)*l)}function un(e,t){if(e<=0)return 1;let n=e/t,r=Math.pow(10,Math.floor(Math.log10(n))),i=n/r;return i<=1.5?r:i<=3.5?2*r:i<=7.5?5*r:10*r}function fu(e,t,n,r,i,s,a,l,d,u){if(e&&e.length>0)return e;let h=Math.max(2,Math.min(50,r)),g=d/(h-1),c=u/(h-1);if(n){let f=[];for(let x=0;x<h;x++)for(let v=0;v<h;v++)f.push({x:i+v*g,y:a+x*c});let b=n(f,{gridSize:h,xMin:i,xMax:s,yMin:a,yMax:l}),m=[];for(let x=0;x<f.length;x++){let v=f[x],D=b[x]??{dx:0,dy:0},A=Math.sqrt(D.dx*D.dx+D.dy*D.dy);m.push({x:v.x,y:v.y,dx:D.dx,dy:D.dy,magnitude:A})}return m}if(!t)return[];let p=[];for(let f=0;f<h;f++)for(let y=0;y<h;y++){let b=i+y*g,m=a+f*c,x=t(b,m),v=Math.sqrt(x.dx*x.dx+x.dy*x.dy);p.push({x:b,y:m,dx:x.dx,dy:x.dy,magnitude:v})}return p}function gu(e,t,n,r,i){let{padding:s,chartWidth:a,chartHeight:l,xMin:d,xMax:u,yMin:h,yMax:g,xSpan:c,ySpan:p,showGrid:f,showAxes:y,colorByMagnitude:b,colorScale:m,arrowColor:x,arrowWidth:v,effectiveArrowScale:D,maxMagnitude:A,title:M,tickFontSize:T}=i,L=B=>s+(B-d)/c*a,I=B=>s+(g-B)/p*l;if(e.clearRect(0,0,t,n),M&&(e.save(),e.font="bold 16px sans-serif",e.fillStyle="#111827",e.textAlign="center",e.textBaseline="middle",e.fillText(M,t/2,s/2+4),e.restore()),f){e.save(),e.strokeStyle="#e5e7eb",e.lineWidth=.5,e.font=`${T}px sans-serif`,e.fillStyle="#6b7280";let B=un(c,10),E=Math.ceil(d/B)*B;for(let k=E;k<=u;k+=B){let w=L(k);e.beginPath(),e.moveTo(w,s),e.lineTo(w,s+l),e.stroke(),e.textAlign="center",e.textBaseline="top",e.fillText(String(Math.round(k*100)/100),w,s+l+4)}let N=un(p,10),z=Math.ceil(h/N)*N;for(let k=z;k<=g;k+=N){let w=I(k);e.beginPath(),e.moveTo(s,w),e.lineTo(s+a,w),e.stroke(),e.textAlign="right",e.textBaseline="middle",e.fillText(String(Math.round(k*100)/100),s-6,w)}e.restore()}if(y){if(e.save(),e.strokeStyle="#374151",e.lineWidth=v,h<=0&&g>=0){let B=I(0);e.beginPath(),e.moveTo(s,B),e.lineTo(s+a,B),e.stroke()}if(d<=0&&u>=0){let B=L(0);e.beginPath(),e.moveTo(B,s),e.lineTo(B,s+l),e.stroke()}e.strokeStyle="#d1d5db",e.lineWidth=1,e.strokeRect(s,s,a,l),e.restore()}let P=4;for(let B=0;B<r.length;B++){let E=r[B],N=E.magnitude??Math.sqrt(E.dx*E.dx+E.dy*E.dy);if(N<1e-10)continue;let z=L(E.x),k=I(E.y),w=E.dx*D,$=-E.dy*D,C=z+w,F=k+$,R;if(b){let _=N/A;R=As(_,m)}else R=x;e.save(),e.strokeStyle=R,e.lineWidth=v,e.lineCap="round",e.beginPath(),e.moveTo(z,k),e.lineTo(C,F),e.stroke();let W=Math.sqrt(w*w+$*$);if(W>2){let _=w/W,O=$/W,V=-O,X=_,ee=Math.min(P,W*.4),Z=C-_*ee+V*ee*.5,U=F-O*ee+X*ee*.5,G=C-_*ee-V*ee*.5,Y=F-O*ee-X*ee*.5;e.fillStyle=R,e.beginPath(),e.moveTo(C,F),e.lineTo(Z,U),e.lineTo(G,Y),e.closePath(),e.fill()}e.restore()}}function Ls(e){let{data:t,vectorFunction:n,width:r=600,height:i=600,gridSize:s=15,xRange:a=[-5,5],yRange:l=[-5,5],arrowScale:d=1,arrowColor:u="#3b82f6",showGrid:h=!0,showAxes:g=!0,colorByMagnitude:c=!1,colorScale:p=["#3b82f6","#8b5cf6","#ef4444"],title:f,padding:y=50,tickFontSize:b=10,arrowWidth:m=1.5,renderer:x="svg",useGPU:v=!1,computeWorker:D}=e,A=Math.max(2,Math.min(50,s)),M=r-y*2,T=i-y*2,L=a[0],I=a[1],P=l[0],B=l[1],E=I-L,N=B-P,z=q(()=>Z=>y+(Z-L)/E*M,[y,L,E,M]),k=q(()=>Z=>y+(B-Z)/N*T,[y,B,N,T]),w=q(()=>fu(t,n,D,A,L,I,P,B,E,N),[t,n,D,A,L,I,P,B,E,N]),$=q(()=>{let Z=0;for(let U=0;U<w.length;U++){let G=w[U],Y=G.magnitude??Math.sqrt(G.dx*G.dx+G.dy*G.dy);Y>Z&&(Z=Y)}return Z>0?Z:1},[w]),C=q(()=>Math.min(M,T)/Math.max(A,2)/(2*$)*d,[M,T,A,$,d]);if(x==="canvas"){let Z=ne(null),U=ne(0);return re(()=>{let G=Z.current;if(!G)return;let Y=G.getContext("2d");if(Y)return U.current&&cancelAnimationFrame(U.current),U.current=requestAnimationFrame(()=>{gu(Y,r,i,w,{padding:y,chartWidth:M,chartHeight:T,xMin:L,xMax:I,yMin:P,yMax:B,xSpan:E,ySpan:N,showGrid:h,showAxes:g,colorByMagnitude:c,colorScale:p,arrowColor:u,arrowWidth:m,effectiveArrowScale:C,maxMagnitude:$,title:f,tickFontSize:b})}),()=>{U.current&&cancelAnimationFrame(U.current)}},[w,r,i,y,M,T,L,I,P,B,E,N,h,g,c,p,u,m,C,$,f,b]),o("canvas",{ref:Z,width:r,height:i,role:"img","aria-label":f??"Vector field plot",style:{fontFamily:"sans-serif",maxWidth:"100%"}})}let F=S(()=>{if(!h)return[];let Z=[],U=un(E,10),G=Math.ceil(L/U)*U;for(let K=G;K<=I;K+=U){let Q=z(K);Z.push(o("line",{key:`gridv-${K}`,x1:String(Q),y1:String(y),x2:String(Q),y2:String(y+T),stroke:"#e5e7eb","stroke-width":"0.5"})),Z.push(o("text",{key:`xtick-${K}`,x:String(Q),y:String(y+T+16),"text-anchor":"middle","font-size":String(b),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(K*100)/100)))}let Y=un(N,10),H=Math.ceil(P/Y)*Y;for(let K=H;K<=B;K+=Y){let Q=k(K);Z.push(o("line",{key:`gridh-${K}`,x1:String(y),y1:String(Q),x2:String(y+M),y2:String(Q),stroke:"#e5e7eb","stroke-width":"0.5"})),Z.push(o("text",{key:`ytick-${K}`,x:String(y-6),y:String(Q+4),"text-anchor":"end","font-size":String(b),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(K*100)/100)))}return Z},[h,L,I,P,B,E,N,z,k,y,M,T]),R=S(()=>{if(!g)return[];let Z=[];if(P<=0&&B>=0){let U=k(0);Z.push(o("line",{key:"axis-x",x1:String(y),y1:String(U),x2:String(y+M),y2:String(U),stroke:"#374151","stroke-width":String(m)}))}if(L<=0&&I>=0){let U=z(0);Z.push(o("line",{key:"axis-y",x1:String(U),y1:String(y),x2:String(U),y2:String(y+T),stroke:"#374151","stroke-width":String(m)}))}return Z.push(o("rect",{key:"chart-border",x:String(y),y:String(y),width:String(M),height:String(T),fill:"none",stroke:"#d1d5db","stroke-width":"1"})),Z},[g,L,I,P,B,z,k,y,M,T]),W=S(()=>{let Z=[];for(let G=0;G<w.length;G++){let Y=w[G],H=Y.magnitude??Math.sqrt(Y.dx*Y.dx+Y.dy*Y.dy);if(H<1e-10)continue;let K=z(Y.x),Q=k(Y.y),ie=Y.dx*C,J=-Y.dy*C,se=K+ie,le=Q+J,fe;if(c){let me=H/$;fe=As(me,p)}else fe=u;Z.push(o("line",{key:`arrow-line-${G}`,x1:String(K),y1:String(Q),x2:String(se),y2:String(le),stroke:fe,"stroke-width":String(m),"stroke-linecap":"round"}));let oe=Math.sqrt(ie*ie+J*J);if(oe>2){let me=ie/oe,he=J/oe,te=-he,de=me,ge=Math.min(4,oe*.4),xe=se-me*ge+te*ge*.5,ye=le-he*ge+de*ge*.5,Me=se-me*ge-te*ge*.5,ce=le-he*ge-de*ge*.5;Z.push(o("polygon",{key:`arrow-head-${G}`,points:`${se},${le} ${xe},${ye} ${Me},${ce}`,fill:fe}))}}return Z},[w,z,k,C,c,$,p,u]),_=S(()=>f?[o("text",{key:"title",x:String(r/2),y:String(y/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},f)]:[],[f,r,y]),O=F(),V=R(),X=W(),ee=_();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":f??"Vector field plot",style:{fontFamily:"sans-serif"}},...ee,...O,...V,...X)}function mu(e){let t=[],n=0;for(let r=0;r<e.length;r++){let i=e[r],s=i.type??(i.value>=0?"increase":"decrease");if(s==="total")t.push({label:i.label,value:n,type:"total",start:0,end:n});else{let a=n;n+=i.value,t.push({label:i.label,value:i.value,type:s,start:a,end:n})}}return t}function hu(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function Bs(e){let{data:t=[],width:n=600,height:r=400,increaseColor:i="#10b981",decreaseColor:s="#ef4444",totalColor:a="#3b82f6",connectorColor:l="#94a3b8",showValues:d=!0,showGrid:u=!0,showConnectors:h=!0,title:g,padding:c=60}=e,p=n-c*2,f=r-c*2,y=q(()=>mu(t),[t]),{minVal:b,maxVal:m}=q(()=>{let $=0,C=0;for(let F=0;F<y.length;F++){let R=y[F];R.start<$&&($=R.start),R.end<$&&($=R.end),R.start>C&&(C=R.start),R.end>C&&(C=R.end)}return $===C&&(C=$+1),{minVal:$,maxVal:C}},[y]),x=m-b,v=S($=>c+f-($-b)/x*f,[c,f,b,x]),D=q(()=>y.length===0?0:p/y.length,[y.length,p]),A=6,M=Math.max(1,D-A),T=S(()=>{if(!u)return[];let $=hu(x),C=[],F=Math.ceil(b/$)*$;for(let R=F;R<=m;R+=$){let W=v(R);C.push(o("line",{key:`grid-${R}`,x1:String(c),y1:String(W),x2:String(c+p),y2:String(W),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),C.push(o("text",{key:`grid-label-${R}`,x:String(c-8),y:String(W+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(R)))}return C},[u,x,b,m,v,c,p]),L=S(()=>{let $=[];$.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+f),stroke:"#374151","stroke-width":"1.5"}));let C=b<=0&&m>=0?v(0):c+f;return $.push(o("line",{key:"axis-x",x1:String(c),y1:String(C),x2:String(c+p),y2:String(C),stroke:"#374151","stroke-width":"1.5"})),$},[c,p,f,b,m,v]),I=S(()=>{if(y.length===0)return[];let $=[];for(let C=0;C<y.length;C++){let F=y[C],R=c+C*D+A/2,W=Math.max(F.start,F.end),_=Math.min(F.start,F.end),O=v(W),V=v(_),X=Math.max(0,V-O),ee;if(F.type==="total"?ee=a:F.type==="decrease"?ee=s:ee=i,$.push(o("rect",{key:`bar-${C}`,x:String(R),y:String(O),width:String(M),height:String(X),fill:ee,rx:"2",ry:"2"})),d){let Z=F.type==="decrease"||F.value<0?V+14:O-4,U=F.type==="total"?String(F.value):(F.value>=0?"+":"")+String(F.value);$.push(o("text",{key:`val-${C}`,x:String(R+M/2),y:String(Z),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},U))}if($.push(o("text",{key:`cat-${C}`,x:String(R+M/2),y:String(c+f+16),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},F.label)),h&&C<y.length-1){let Z=y[C+1],U=v(F.end),G=c+(C+1)*D+A/2;Z.type!=="total"&&$.push(o("line",{key:`conn-${C}`,x1:String(R+M),y1:String(U),x2:String(G),y2:String(U),stroke:l,"stroke-width":"1","stroke-dasharray":"3 2"}))}}return $},[y,D,M,v,i,s,a,l,d,h,c,f]),P=S(()=>g?[o("text",{key:"title",x:String(n/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},g)]:[],[g,n,c]),B=S(()=>t.length>0?[]:[o("text",{key:"empty",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,n,r]),E=T(),N=L(),z=I(),k=P(),w=B();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Waterfall chart",style:{fontFamily:"sans-serif"}},...k,...E,...N,...z,...w)}var bu=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],xu=[0,-45,45,90];function yu(e,t,n,r,i){let s=t*.6,a=e.length*s,l=t,d=n*Math.PI/180,u=Math.abs(Math.cos(d)),h=Math.abs(Math.sin(d)),g=a*u+l*h,c=a*h+l*u;return{x:r-g/2,y:i-c/2,w:g,h:c}}function Su(e,t){return!(e.x+e.w<t.x||t.x+t.w<e.x||e.y+e.h<t.y||t.y+t.h<e.y)}function vu(e,t,n){return e.x>=0&&e.y>=0&&e.x+e.w<=t&&e.y+e.h<=n}function wu(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return Math.abs(t)}function Fs(e){let{words:t=[],width:n=600,height:r=400,minFontSize:i=10,maxFontSize:s=64,fontFamily:a="sans-serif",colors:l=bu,rotations:d=xu,padding:u=4,spiral:h="archimedean",title:g}=e,c=q(()=>{if(t.length===0)return[];let f=t.map((M,T)=>({...M,originalIndex:T})).filter(M=>M.text.length>0&&M.weight>0).sort((M,T)=>T.weight-M.weight);if(f.length===0)return[];let y=f[f.length-1].weight,m=f[0].weight-y;function x(M){if(m===0)return(i+s)/2;let T=(M-y)/m;return i+T*(s-i)}let v=[],D=n/2,A=r/2;for(let M=0;M<f.length;M++){let T=f[M],L=x(T.weight),I=d[wu(T.text)%d.length],P=T.color??l[M%l.length],B=!1,E=500,N=h==="archimedean"?4:5;for(let z=0;z<E;z++){let k,w;if(h==="archimedean"){let _=z*.1,O=N*_;k=O*Math.cos(_),w=O*Math.sin(_)}else{let _=Math.floor(z/4)+1,O=z%4,V=(z%4===0?0:z)*N;switch(O){case 0:k=_*N*4,w=V;break;case 1:k=-V,w=_*N*4;break;case 2:k=-_*N*4,w=-V;break;default:k=V,w=-_*N*4;break}}let $=D+k,C=A+w,F=yu(T.text,L,I,$,C),R={x:F.x-u,y:F.y-u,w:F.w+u*2,h:F.h+u*2};if(!vu(R,n,r))continue;let W=!1;for(let _ of v)if(Su(R,_.bbox)){W=!0;break}if(!W){v.push({text:T.text,x:$,y:C,fontSize:L,rotation:I,color:P,bbox:R}),B=!0;break}}}return v},[t,n,r,i,s,l,d,u,h]);if(t.length===0||c.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Word cloud \u2014 no data"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":a,fill:"currentColor",opacity:"0.6"},"No words to display."));let p=[];g&&p.push(o("text",{key:"title",x:String(n/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":a,fill:"currentColor"},g));for(let f=0;f<c.length;f++){let y=c[f],b=y.rotation!==0?`translate(${y.x},${y.y}) rotate(${y.rotation})`:`translate(${y.x},${y.y})`;p.push(o("text",{key:`word-${f}`,transform:b,"text-anchor":"middle","dominant-baseline":"central","font-size":String(y.fontSize),"font-family":a,fill:y.color,"aria-label":y.text},y.text))}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Word cloud",style:{fontFamily:a}},...p)}var ku={0:"#1e293b",1:"#3b82f6"},Cu="#666";function Ns(e){let{data:t=[],colorMap:n,width:r=600,height:i=600,cellGap:s=1,cellRadius:a=0,showGrid:l=!1,gridColor:d="#334155",showIndices:u=!1,backgroundColor:h="#0f172a",padding:g=10,onCellClick:c,onCellHover:p,title:f}=e,y=n??ku,b=t.length,m=q(()=>{let $=0;for(let C=0;C<t.length;C++){let F=t[C];F!==void 0&&F.length>$&&($=F.length)}return $},[t]),x=u?20:0,v=f?24:0,D=q(()=>{let $=r-g*2-x,C=i-g*2-x-v;if(b===0||m===0)return{cellWidth:0,cellHeight:0};let F=Math.max(0,($-s*(m-1))/m),R=Math.max(0,(C-s*(b-1))/b);return{cellWidth:F,cellHeight:R}},[r,i,g,b,m,s,x,v]),A=S($=>{let C=y[$];return C!==void 0?C:Cu},[y]),M=S(()=>o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:h}),[r,i,h]),T=S(()=>f?[o("text",{key:"title",x:String(r/2),y:String(g+14),"text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#e2e8f0"},f)]:[],[f,r,g]),L=S(()=>{if(!l||b===0||m===0)return[];let{cellWidth:$,cellHeight:C}=D,F=g+x,R=g+x+v,W=m*$+(m-1)*s,_=b*C+(b-1)*s,O=[];for(let V=0;V<=m;V++){let X=F+V*($+s)-s/2;O.push(o("line",{key:`vgrid-${V}`,x1:String(X),y1:String(R-s/2),x2:String(X),y2:String(R+_+s/2),stroke:d,"stroke-width":"0.5"}))}for(let V=0;V<=b;V++){let X=R+V*(C+s)-s/2;O.push(o("line",{key:`hgrid-${V}`,x1:String(F-s/2),y1:String(X),x2:String(F+W+s/2),y2:String(X),stroke:d,"stroke-width":"0.5"}))}return O},[l,b,m,D,g,x,v,s,d]),I=S(()=>{if(!u||b===0||m===0)return[];let{cellWidth:$,cellHeight:C}=D,F=g+x,R=g+x+v,W=[];for(let _=0;_<m;_++){let O=F+_*($+s)+$/2,V=R-6;W.push(o("text",{key:`col-idx-${_}`,x:String(O),y:String(V),"text-anchor":"middle","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(_)))}for(let _=0;_<b;_++){let O=F-6,V=R+_*(C+s)+C/2+3;W.push(o("text",{key:`row-idx-${_}`,x:String(O),y:String(V),"text-anchor":"end","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(_)))}return W},[u,b,m,D,g,x,v,s]),P=S(()=>{if(b===0||m===0)return[];let{cellWidth:$,cellHeight:C}=D,F=g+x,R=g+x+v,W=[];for(let _=0;_<b;_++){let O=t[_];if(O!==void 0)for(let V=0;V<m;V++){let X=V<O.length?O[V]:0,ee=F+V*($+s),Z=R+_*(C+s),U=A(X),G={key:`cell-${_}-${V}`,x:String(ee),y:String(Z),width:String($),height:String(C),fill:U,rx:String(a),ry:String(a)};if(c){let Y=_,H=V,K=X;G.onClick=()=>c(Y,H,K),G.role="button",G.tabIndex=0}if(p){let Y=_,H=V,K=X;G.onMouseEnter=()=>p(Y,H,K)}W.push(o("rect",G))}}return W},[b,m,t,D,g,x,v,s,a,A,c,p]),B=M(),E=T(),N=L(),z=I(),k=P(),w=f?`${f} \u2014 ${b}x${m} discrete grid`:`${b}x${m} discrete grid`;return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":w},B,...E,...N,...z,...k)}
|
|
7
|
+
`,document.head.appendChild(d),()=>{let u=document.getElementById(l);u&&u.remove()}},[]);let s=v(l=>t.dismiss(l),[t]),a=r.map(l=>o(Ol,{key:l.id,item:l,onDismiss:s}));return o("div",{style:i},...a)}function Qr(e={}){let t=ne(null);t.current||(t.current=On(e));let n=t.current,r=v(()=>o(Hn,{toaster:n}),[n]);return{toast:n.toast,dismiss:n.dismiss,dismissAll:n.dismissAll,ToastContainer:r}}var Hl=6,Yl=8;function Vl(e,t){let n=window.scrollX||window.pageXOffset,r=window.scrollY||window.pageYOffset,i=Yl;switch(t){case"top":return{position:"fixed",left:`${e.left+e.width/2}px`,top:`${e.top-i}px`,transform:"translate(-50%, -100%)"};case"bottom":return{position:"fixed",left:`${e.left+e.width/2}px`,top:`${e.bottom+i}px`,transform:"translateX(-50%)"};case"left":return{position:"fixed",left:`${e.left-i}px`,top:`${e.top+e.height/2}px`,transform:"translate(-100%, -50%)"};case"right":return{position:"fixed",left:`${e.right+i}px`,top:`${e.top+e.height/2}px`,transform:"translateY(-50%)"}}}function Ul(e){let t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n=`${Hl}px`,r="transparent",i="#1f2937";switch(e){case"top":return{...t,bottom:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`${n} ${n} 0 ${n}`,borderColor:`${i} ${r} ${r} ${r}`};case"bottom":return{...t,top:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`0 ${n} ${n} ${n}`,borderColor:`${r} ${r} ${i} ${r}`};case"left":return{...t,right:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} 0 ${n} ${n}`,borderColor:`${r} ${r} ${r} ${i}`};case"right":return{...t,left:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} ${n} ${n} 0`,borderColor:`${r} ${i} ${r} ${r}`}}}function ei(e){let{text:t,placement:n="top",delay:r=200,maxWidth:i="250px",children:s}=e,[a,l]=U(!1),[d,u]=U(null),h=ne(null),m=ne(null),c=`tooltip-${Math.random().toString(36).slice(2,9)}`,p=v(()=>{m.current=setTimeout(()=>{if(h.current){let b=h.current.getBoundingClientRect();u(Vl(b,n))}l(!0)},r)},[r,n]),f=v(()=>{m.current&&(clearTimeout(m.current),m.current=null),l(!1)},[]);re(()=>()=>{m.current&&clearTimeout(m.current)},[]);let y={display:"inline-block"},x={...d??{},backgroundColor:"#1f2937",color:"#fff",fontSize:"13px",lineHeight:"1.4",padding:"6px 10px",borderRadius:"6px",maxWidth:i,zIndex:"10002",pointerEvents:"none",whiteSpace:"normal",wordWrap:"break-word"},g=[o("div",{ref:h,style:y,onMouseEnter:p,onMouseLeave:f,onFocus:p,onBlur:f,"aria-describedby":a?c:void 0},s)];return a&&d&&g.push(o("div",{id:c,style:x,role:"tooltip"},t,o("div",{style:Ul(n)}))),o("div",{style:{display:"inline-block",position:"relative"}},...g)}function Yn(e,t,n,r,i){return X(()=>{let s=Math.max(1,(r-i*(e+1))/e);return{valueScale:d=>t===0?0:d/t*n,categoryScale:d=>i+d*(s+i),barThickness:s,maxValue:t,valueAxisLength:n,categoryAxisLength:r}},[e,t,n,r,i])}function jl(e,t,n){if(t&&t.length>0){if(n){let s=0;for(let a of t)for(let l of a.values)l.value>s&&(s=l.value);return s}let i=0;for(let s of t){let a=0;for(let l of s.values)a+=l.value;a>i&&(i=a)}return i}let r=0;for(let i of e)i.value>r&&(r=i.value);return r}function Gl(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function Xl(e){let t=new Set;for(let n of e)for(let r of n.values)t.add(r.category);return Array.from(t)}var ti=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function ni(e,t){return t||ti[e%ti.length]}function oi(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",barColor:s="#3b82f6",barGap:a=8,barRadius:l=4,showValues:d=!0,showGrid:u=!0,gridColor:h="#e5e7eb",title:m,padding:c=50,animate:p=!1,stacked:f,grouped:y=!1}=e,x=i==="vertical",g=n-c*2,b=r-c*2,S=x?b:g,I=x?g:b,A=f!==void 0&&f.length>0,C=X(()=>A?Xl(f):[],[A,f]),T=A?f.length:t.length,L=X(()=>jl(t,f,y),[t,f,y]),R=L>0?L:1,$=Yn(T,R,S,I,a),B=v(()=>{if(!u)return[];let O=Gl(R),Y=[];for(let K=O;K<=R;K+=O){let Q=$.valueScale(K);if(x){let q=c+b-Q;Y.push(o("line",{key:`grid-${K}`,x1:String(c),y1:String(q),x2:String(c+g),y2:String(q),stroke:h,"stroke-width":"1","stroke-dasharray":"4 2"})),Y.push(o("text",{key:`grid-label-${K}`,x:String(c-6),y:String(q+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(K)))}else{let q=c+Q;Y.push(o("line",{key:`grid-${K}`,x1:String(q),y1:String(c),x2:String(q),y2:String(c+b),stroke:h,"stroke-width":"1","stroke-dasharray":"4 2"})),Y.push(o("text",{key:`grid-label-${K}`,x:String(q),y:String(c+b+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(K)))}}return Y},[u,R,$,x,c,g,b,h]),E=v(()=>{let O=[];return x?(O.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+b),stroke:"#374151","stroke-width":"1.5"})),O.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+b),x2:String(c+g),y2:String(c+b),stroke:"#374151","stroke-width":"1.5"}))):(O.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+b),x2:String(c+g),y2:String(c+b),stroke:"#374151","stroke-width":"1.5"})),O.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+b),stroke:"#374151","stroke-width":"1.5"}))),O},[x,c,g,b]),N=v(()=>{let O=[];for(let Y=0;Y<t.length;Y++){let K=t[Y],Q=$.valueScale(K.value),q=$.categoryScale(Y),H=K.color??s,j,G,V=String(K.value);if(x){let Z=c+q,te=c+b-Q;j={x:String(Z),y:String(te),width:String($.barThickness),height:String(Q),rx:String(l),ry:String(l),fill:H},G={x:String(Z+$.barThickness/2),y:String(te-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"}}else{let Z=c+q,te=c;j={x:String(te),y:String(Z),width:String(Q),height:String($.barThickness),rx:String(l),ry:String(l),fill:H},G={x:String(te+Q+6),y:String(Z+$.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"}}if(p&&(j.style=x?`animation: barGrow 0.6s ease-out ${Y*.05}s both`:`animation: barGrow 0.6s ease-out ${Y*.05}s both`),O.push(o("rect",{key:`bar-${Y}`,...j})),d&&O.push(o("text",{key:`val-${Y}`,...G},V)),x){let Z=c+q+$.barThickness/2,te=c+b+16;O.push(o("text",{key:`cat-${Y}`,x:String(Z),y:String(te),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${Z}, ${te})`},K.label))}else O.push(o("text",{key:`cat-${Y}`,x:String(c-6),y:String(c+q+$.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},K.label))}return O},[t,$,s,l,d,p,x,c,b]),z=v(()=>{if(!f)return[];let O=[];for(let Y=0;Y<f.length;Y++){let K=f[Y],Q=$.categoryScale(Y),q=0;for(let H=0;H<K.values.length;H++){let j=K.values[H],G=$.valueScale(j.value),V=$.valueScale(q),Z=ni(H,j.color);if(x){let te=c+Q,ae=c+b-V-G;O.push(o("rect",{key:`sbar-${Y}-${H}`,x:String(te),y:String(ae),width:String($.barThickness),height:String(G),rx:H===K.values.length-1?String(l):"0",ry:H===K.values.length-1?String(l):"0",fill:Z,...p?{style:`animation: barGrow 0.6s ease-out ${(Y*K.values.length+H)*.03}s both`}:{}})),d&&G>14&&O.push(o("text",{key:`sval-${Y}-${H}`,x:String(te+$.barThickness/2),y:String(ae+G/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(j.value)))}else{let te=c+V,ae=c+Q;O.push(o("rect",{key:`sbar-${Y}-${H}`,x:String(te),y:String(ae),width:String(G),height:String($.barThickness),rx:H===K.values.length-1?String(l):"0",ry:H===K.values.length-1?String(l):"0",fill:Z,...p?{style:`animation: barGrow 0.6s ease-out ${(Y*K.values.length+H)*.03}s both`}:{}})),d&&G>20&&O.push(o("text",{key:`sval-${Y}-${H}`,x:String(te+G/2),y:String(ae+$.barThickness/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(j.value)))}q+=j.value}if(d){let H=$.valueScale(q);x?O.push(o("text",{key:`stotal-${Y}`,x:String(c+Q+$.barThickness/2),y:String(c+b-H-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(q))):O.push(o("text",{key:`stotal-${Y}`,x:String(c+H+6),y:String(c+Q+$.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(q)))}if(x){let H=c+Q+$.barThickness/2,j=c+b+16;O.push(o("text",{key:`scat-${Y}`,x:String(H),y:String(j),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${H}, ${j})`},K.label))}else O.push(o("text",{key:`scat-${Y}`,x:String(c-6),y:String(c+Q+$.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},K.label))}return O},[f,$,l,d,p,x,c,b]),k=v(()=>{if(!f)return[];let O=C.length,Y=[];for(let K=0;K<f.length;K++){let Q=f[K],q=$.categoryScale(K),H=2,j=Math.max(1,($.barThickness-H*(O-1))/O);for(let G=0;G<Q.values.length;G++){let V=Q.values[G],Z=C.indexOf(V.category),te=Z*(j+H),ae=$.valueScale(V.value),J=ni(Z>=0?Z:G,V.color);if(x){let ie=c+q+te,le=c+b-ae;Y.push(o("rect",{key:`gbar-${K}-${G}`,x:String(ie),y:String(le),width:String(j),height:String(ae),rx:String(l),ry:String(l),fill:J,...p?{style:`animation: barGrow 0.6s ease-out ${(K*O+G)*.04}s both`}:{}})),d&&Y.push(o("text",{key:`gval-${K}-${G}`,x:String(ie+j/2),y:String(le-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(V.value)))}else{let ie=c,le=c+q+te;Y.push(o("rect",{key:`gbar-${K}-${G}`,x:String(ie),y:String(le),width:String(ae),height:String(j),rx:String(l),ry:String(l),fill:J,...p?{style:`animation: barGrow 0.6s ease-out ${(K*O+G)*.04}s both`}:{}})),d&&Y.push(o("text",{key:`gval-${K}-${G}`,x:String(ie+ae+4),y:String(le+j/2+3),"text-anchor":"start","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(V.value)))}}if(x){let G=c+q+$.barThickness/2,V=c+b+16;Y.push(o("text",{key:`gcat-${K}`,x:String(G),y:String(V),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${G}, ${V})`},Q.label))}else Y.push(o("text",{key:`gcat-${K}`,x:String(c-6),y:String(c+q+$.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},Q.label))}return Y},[f,C,$,l,d,p,x,c,b]),w=v(()=>m?[o("text",{key:"title",x:String(n/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},m)]:[],[m,n,c]),D=v(()=>p?[o("defs",{key:"anim-defs"},o("style",{key:"anim-style"},x?"@keyframes barGrow { from { transform: scaleY(0); transform-origin: bottom; } to { transform: scaleY(1); transform-origin: bottom; } }":"@keyframes barGrow { from { transform: scaleX(0); transform-origin: left; } to { transform: scaleX(1); transform-origin: left; } }"))]:[],[p,x]),M=B(),F=E(),P=w(),W=D(),_;return A&&y?_=k():A?_=z():_=N(),o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",style:{fontFamily:"sans-serif"}},...W,...P,...M,...F,..._)}function yt(e){let{start:t,end:n,step:r}=e;if(r<=0||!isFinite(r))return[];let i=Math.ceil((n-t)/r)+1;if(i>1e6)return[];let s=[];for(let a=0;a<i;a++){let l=t+a*r;if(l>n+r*.001)break;s.push(l)}return s}function qt(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],s=e(i);isFinite(s)&&n.push({input:i,output:s})}return n}function Zt(e,t,n,r){let i=!1,s=0,a=[],l=()=>{if(i)return;let d=Math.min(s+n,t.length);for(let u=s;u<d;u++){let h=t[u],m=e(h);isFinite(m)&&a.push({input:h,output:m})}if(s=d,s>=t.length){r(a,!0);return}r(a,!1),ri(l)};return ri(l),()=>{i=!0}}function ri(e){typeof requestIdleCallback=="function"?requestIdleCallback(()=>e(),{timeout:16}):setTimeout(e,0)}function Kl(e,t){let n=e/t,r=Math.pow(10,Math.floor(Math.log10(n))),i=n/r;return(i<1.5?1:i<3?2:i<7?5:10)*r}function ii(e,t){let n=t-e;if(n<=0)return[e];let r=Kl(n,8),i=Math.ceil(e/r)*r,s=[];for(let a=i;a<=t+r*.001;a+=r)s.push(Math.round(a*1e10)/1e10);return s}function si(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}var Te=40,ai=1.1,li=.01,ci=1e6;function di(e){let{width:t=400,height:n=300,points:r=[],plotFunction:i,plotResolution:s=200,xStep:a,sync:l=!1,xRange:d=[-5,5],yRange:u=[-5,5],showGrid:h=!0,showAxes:m=!0,pointRadius:c=3,pointColor:p="#3b82f6",curveColor:f="#3b82f6",gridColor:y="#e2e8f0",axisColor:x="#94a3b8",onPointClick:g,onPointDoubleClick:b,onPointContextMenu:S,onPointHover:I}=e,[A,C]=U(d[0]),[T,L]=U(d[1]),[R,$]=U(u[0]),[B,E]=U(u[1]),N=ne(!1),z=ne(null),k=v(V=>Te+(V-A)/(T-A)*(t-2*Te),[A,T,t]),w=v(V=>n-Te-(V-R)/(B-R)*(n-2*Te),[R,B,n]),D=v(V=>A+(V-Te)/(t-2*Te)*(T-A),[A,T,t]),M=v(V=>R+(n-Te-V)/(n-2*Te)*(B-R),[R,B,n]),F=v(V=>{let Z=V;N.current=!0,z.current={mx:Z.clientX,my:Z.clientY,x0:A,x1:T,y0:R,y1:B}},[A,T,R,B]),P=v(V=>{if(!N.current||!z.current)return;let Z=V,te=z.current,ae=Z.clientX-te.mx,J=Z.clientY-te.my,ie=ae/(t-2*Te)*(te.x1-te.x0),le=J/(n-2*Te)*(te.y1-te.y0);C(te.x0-ie),L(te.x1-ie),$(te.y0+le),E(te.y1+le)},[t,n]),W=v(()=>{N.current=!1,z.current=null},[]),_=v(V=>{let Z=V;Z.preventDefault();let te=Z.currentTarget.getBoundingClientRect(),ae=Z.clientX-te.left,J=Z.clientY-te.top,ie=D(ae),le=M(J),fe=Z.deltaY>0?ai:1/ai,oe=(T-A)*fe,ge=(B-R)*fe;if(oe<li||ge<li||oe>ci||ge>ci)return;let he=(ie-A)/(T-A),ee=(le-R)/(B-R);C(ie-he*oe),L(ie+(1-he)*oe),$(le-ee*ge),E(le+(1-ee)*ge)},[A,T,R,B,D,M]),O=[];if(O.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),h){let V=ii(A,T),Z=ii(R,B);for(let te=0;te<V.length;te++){let ae=k(V[te]);O.push(o("line",{x1:ae,y1:Te,x2:ae,y2:n-Te,stroke:y,"stroke-width":.5,key:`gx-${te}`})),O.push(o("text",{x:ae,y:n-Te+14,"text-anchor":"end","font-size":10,fill:x,transform:`rotate(-45, ${ae}, ${n-Te+14})`,key:`lx-${te}`},si(V[te])))}for(let te=0;te<Z.length;te++){let ae=w(Z[te]);O.push(o("line",{x1:Te,y1:ae,x2:t-Te,y2:ae,stroke:y,"stroke-width":.5,key:`gy-${te}`})),O.push(o("text",{x:Te-6,y:ae+3,"text-anchor":"end","font-size":10,fill:x,key:`ly-${te}`},si(Z[te])))}}if(m){let V=Math.max(Te,Math.min(t-Te,k(0))),Z=Math.max(Te,Math.min(n-Te,w(0)));O.push(o("line",{x1:Te,y1:Z,x2:t-Te,y2:Z,stroke:x,"stroke-width":1,key:"x-axis"})),O.push(o("line",{x1:V,y1:Te,x2:V,y2:n-Te,stroke:x,"stroke-width":1,key:"y-axis"}))}let Y=X(()=>{if(!i||!l)return[];let V=a??(T-A)/s,Z=yt({start:A,end:T,step:V});return qt(i,Z)},[i,A,T,a,s,l]),[K,Q]=U([]),q=ne(null);re(()=>{if(!i||l){Q([]);return}let V=a??(T-A)/s,Z=yt({start:A,end:T,step:V});return q.current&&q.current(),q.current=Zt(i,Z,200,te=>{Q([...te])}),()=>{q.current&&q.current()}},[i,A,T,a,s,l]);let H=l?Y:K;if(H.length>0){let V=[];for(let Z=0;Z<H.length;Z++){let te=H[Z],ae=k(te.input),J=w(te.output);V.push(`${V.length===0?"M":"L"}${ae},${J}`)}O.push(o("path",{d:V.join(" "),fill:"none",stroke:f,"stroke-width":1.5,key:"curve"}))}let j=(V,Z,te,ae)=>{if(Z)return J=>Z({x:ae.x,y:ae.y,index:te,event:J})};for(let V=0;V<r.length;V++){let Z=r[V],te=k(Z.x),ae=w(Z.y),J={cx:te,cy:ae,r:c,fill:p,cursor:"pointer",key:`pt-${V}`};g&&(J.onClick=j("click",g,V,Z)),b&&(J.onDblClick=j("dblclick",b,V,Z)),S&&(J.onContextMenu=j("contextmenu",S,V,Z)),I&&(J.onMouseOver=j("mouseover",I,V,Z)),O.push(o("circle",J))}let G=o("defs",{key:"defs"},o("clipPath",{id:"plot-clip"},o("rect",{x:Te,y:Te,width:t-2*Te,height:n-2*Te})));return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",style:"user-select: none; touch-action: none;",onMouseDown:F,onMouseMove:P,onMouseUp:W,onMouseLeave:W,onWheel:_},G,...O)}function pi(e,t,n){let r=0,i=0;for(let s=0;s<n;s++){let a=r*r,l=i*i;if(a+l>4)return s;i=2*r*i+t,r=a-l+e}return n}function ui(e,t,n){if(e===t)return[0,0,0];let r=e/t;if(n==="fire")return[Math.floor(255*Math.min(1,r*3)),Math.floor(255*Math.max(0,r*3-1)),Math.floor(255*Math.max(0,r*3-2))];if(n==="ocean")return[Math.floor(255*r*.3),Math.floor(255*r*.6),Math.floor(255*(.4+r*.6))];let i=r*360%360,s=1,a=.5,l=(1-Math.abs(2*a-1))*s,d=l*(1-Math.abs(i/60%2-1)),u=a-l/2,h=0,m=0,c=0;return i<60?(h=l,m=d):i<120?(h=d,m=l):i<180?(m=l,c=d):i<240?(m=d,c=l):i<300?(h=d,c=l):(h=l,c=d),[Math.floor((h+u)*255),Math.floor((m+u)*255),Math.floor((c+u)*255)]}function fi(e,t,n=[-2.5,1],r=[-1.25,1.25],i=80,s=pi){let a=[];for(let l=0;l<t;l++){let d=[],u=r[1]-l/t*(r[1]-r[0]);for(let h=0;h<e;h++){let m=n[0]+h/e*(n[1]-n[0]);d.push(s(m,u,i))}a.push(d)}return a}function mi(e){let{width:t=400,height:n=300,realRange:r=[-2.5,1],imagRange:i=[-1.25,1.25],maxIterations:s=100,colorScheme:a="classic",computeFunction:l=pi,data:d,resolution:u=2,onPointClick:h,onPointHover:m,onPointDoubleClick:c,onPointContextMenu:p}=e;if(d){let M=d.length,F=M>0?d[0].length:0,P=F>0?t/F:1,W=M>0?n/M:1,_=[];for(let O=0;O<M;O++){let Y=d[O];for(let K=0;K<F;K++){let Q=Y[K]??0,[q,H,j]=ui(Q,s,a);_.push(o("rect",{key:`${O}-${K}`,x:String(K*P),y:String(O*W),width:String(Math.ceil(P)),height:String(Math.ceil(W)),fill:`rgb(${q},${H},${j})`}))}}return o("svg",{width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Complex plane visualization",style:{cursor:"crosshair",borderRadius:"6px",maxWidth:"100%"}},..._)}let[f,y]=U(r[0]),[x,g]=U(r[1]),[b,S]=U(i[0]),[I,A]=U(i[1]),C=ne(null),T=ne(!1),L=ne(null),R=v((M,F)=>{let P=f+M/t*(x-f),W=I-F/n*(I-b);return{re:P,im:W}},[f,x,b,I,t,n]);re(()=>{let M=C.current;if(!M)return;let F=M.getContext("2d");if(!F)return;let P=F.createImageData(t,n),W=P.data;for(let _=0;_<n;_++)for(let O=0;O<t;O++){let{re:Y,im:K}=R(O,_),Q=l(Y,K,s),[q,H,j]=ui(Q,s,a),G=(_*t+O)*4;W[G]=q,W[G+1]=H,W[G+2]=j,W[G+3]=255}F.putImageData(P,0,0)},[f,x,b,I,t,n,s,a,l,R]);let $=v(M=>{let F=M.target.getBoundingClientRect(),P=M.clientX-F.left,W=M.clientY-F.top,{re:_,im:O}=R(P,W),Y=l(_,O,s);return{re:_,im:O,iterations:Y,event:M}},[R,l,s]),B=v(M=>{T.current=!0,L.current={x:M.clientX,y:M.clientY,rMin:f,rMax:x,iMin:b,iMax:I}},[f,x,b,I]),E=v(M=>{if(m&&m($(M)),!T.current||!L.current)return;let F=L.current,P=M.clientX-F.x,W=M.clientY-F.y,_=(F.rMax-F.rMin)/t,O=(F.iMax-F.iMin)/n;y(F.rMin-P*_),g(F.rMax-P*_),S(F.iMin+W*O),A(F.iMax+W*O)},[t,n,m,$]),N=v(()=>{T.current=!1},[]),z=v(M=>{M.preventDefault();let F=M.deltaY>0?1.15:1/1.15,P=M.target.getBoundingClientRect(),W=M.clientX-P.left,_=M.clientY-P.top,{re:O,im:Y}=R(W,_);y(O+(f-O)*F),g(O+(x-O)*F),S(Y+(b-Y)*F),A(Y+(I-Y)*F)},[R,f,x,b,I]),k=v(M=>{h&&h($(M))},[h,$]),w=v(M=>{c&&c($(M))},[c,$]),D=v(M=>{M.preventDefault(),p&&p($(M))},[p,$]);return o("canvas",{ref:C,width:t,height:n,style:{cursor:"crosshair"},onMouseDown:B,onMouseMove:E,onMouseUp:N,onMouseLeave:N,onWheel:z,onClick:k,onDblClick:w,onContextMenu:D})}function gi(e,t,n){if(e===t)return[e];let r=(t-e)/(n-1),i=[];for(let s=0;s<n;s++){let a=e+r*s;i.push(Math.round(a*1e10)/1e10)}return i}function ql(e,t,n,r){if(e.length===0)return{xScale:()=>r,yScale:()=>n-r,xTicks:[],yTicks:[],xMin:0,xMax:0,yMin:0,yMax:0};let i=1/0,s=-1/0,a=1/0,l=-1/0;for(let y of e)y.x<i&&(i=y.x),y.x>s&&(s=y.x),y.y<a&&(a=y.y),y.y>l&&(l=y.y);i===s&&(i-=1,s+=1),a===l&&(a-=1,l+=1);let d=t-r*2,u=n-r*2,h=y=>r+(y-i)/(s-i)*d,m=y=>n-r-(y-a)/(l-a)*u,c=6,p=gi(i,s,c),f=gi(a,l,c);return{xScale:h,yScale:m,xTicks:p,yTicks:f,xMin:i,xMax:s,yMin:a,yMax:l}}function Vn(e,t,n,r){return X(()=>ql(e,t,n,r),[e,t,n,r])}function hi(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function bi(e,t,n,r,i,s,a){let l={fill:i,key:s,...a};switch(e){case"square":return o("rect",{...l,x:t-r,y:n-r,width:r*2,height:r*2});case"diamond":{let d=`${t},${n-r} ${t+r},${n} ${t},${n+r} ${t-r},${n}`;return o("polygon",{...l,points:d})}case"triangle":{let d=r*1.15,u=`${t},${n-d} ${t+r},${n+r*.6} ${t-r},${n+r*.6}`;return o("polygon",{...l,points:u})}case"triangle-down":{let d=r*1.15,u=`${t-r},${n-r*.6} ${t+r},${n-r*.6} ${t},${n+d}`;return o("polygon",{...l,points:u})}case"cross":{let d=r*.35;return o("path",{...l,fill:"none",stroke:i,"stroke-width":String(d*2),"stroke-linecap":"round",d:`M${t-r},${n-r}L${t+r},${n+r}M${t+r},${n-r}L${t-r},${n+r}`})}case"plus":{let d=r*.35;return o("path",{...l,fill:"none",stroke:i,"stroke-width":String(d*2),"stroke-linecap":"round",d:`M${t},${n-r}L${t},${n+r}M${t-r},${n}L${t+r},${n}`})}case"circle":default:return o("circle",{...l,cx:t,cy:n,r})}}function xi(e){let{data:t,width:n=600,height:r=400,lineColor:i="#3b82f6",lineWidth:s=2,pointRadius:a=4,pointColor:l="#3b82f6",pointShape:d="circle",showPoints:u=!0,showGrid:h=!0,showArea:m=!1,areaColor:c="rgba(59,130,246,0.15)",xLabel:p,yLabel:f,title:y,padding:x=50,animate:g=!1,multiLine:b}=e,S=X(()=>{let B=[...t];if(b)for(let E of b)B.push(...E.data);return B},[t,b]),I=Vn(S,n,r,x),{xScale:A,yScale:C,xTicks:T,yTicks:L}=I,R=[];if(R.push(o("rect",{x:0,y:0,width:"100%",fill:"white",key:"bg"})),h){for(let B=0;B<T.length;B++){let E=A(T[B]);R.push(o("line",{x1:E,y1:x,x2:E,y2:r-x,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-x-${B}`}))}for(let B=0;B<L.length;B++){let E=C(L[B]);R.push(o("line",{x1:x,y1:E,x2:n-x,y2:E,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-y-${B}`}))}}R.push(o("line",{x1:x,y1:r-x,x2:n-x,y2:r-x,stroke:"#374151","stroke-width":1,key:"x-axis"})),R.push(o("line",{x1:x,y1:x,x2:x,y2:r-x,stroke:"#374151","stroke-width":1,key:"y-axis"}));for(let B=0;B<T.length;B++){let E=A(T[B]);R.push(o("line",{x1:E,y1:r-x,x2:E,y2:r-x+5,stroke:"#374151",key:`xtick-${B}`})),R.push(o("text",{x:E,y:r-x+18,"text-anchor":"end","font-size":11,fill:"#6b7280",transform:`rotate(-45, ${E}, ${r-x+18})`,key:`xlabel-${B}`},hi(T[B])))}for(let B=0;B<L.length;B++){let E=C(L[B]);R.push(o("line",{x1:x-5,y1:E,x2:x,y2:E,stroke:"#374151",key:`ytick-${B}`})),R.push(o("text",{x:x-10,y:E+4,"text-anchor":"end","font-size":11,fill:"#6b7280",key:`ylabel-${B}`},hi(L[B])))}function $(B,E,N,z,k,w,D,M,F,P){if(B.length===0)return;let W=[...B].sort((Y,K)=>Y.x-K.x);if(z){let Y=C(I.yMin),K=W.map(j=>`${A(j.x)},${C(j.y)}`).join(" "),Q=A(W[0].x),q=A(W[W.length-1].x),H=`${Q},${Y} ${K} ${q},${Y}`;R.push(o("polygon",{points:H,fill:k,key:`${P}-area`}))}let O={points:W.map(Y=>`${A(Y.x)},${C(Y.y)}`).join(" "),fill:"none",stroke:E,"stroke-width":N,"stroke-linejoin":"round","stroke-linecap":"round",key:`${P}-line`};if(g?(O["stroke-dasharray"]="1000",O["stroke-dashoffset"]="1000",R.push(o("polyline",O,o("animate",{attributeName:"stroke-dashoffset",from:1e3,to:0,dur:"1.5s",fill:"freeze"})))):R.push(o("polyline",O)),w)for(let Y=0;Y<W.length;Y++){let K=A(W[Y].x),Q=C(W[Y].y),q=W[Y].shape??F,H=W[Y].radius??M,j=`${P}-pt-${Y}`;if(g){let G=bi(q,K,Q,H,D,j,{opacity:0});R.push(o("g",{key:`${j}-g`},G,o("animate",{attributeName:"opacity",from:0,to:1,dur:"0.3s",begin:"1.2s",fill:"freeze"})))}else R.push(bi(q,K,Q,H,D,j))}}if($(t,i,s,m,c,u,l,a,d,"primary"),b)for(let B=0;B<b.length;B++){let E=b[B];$(E.data,E.color,s,!1,"transparent",u,E.color,E.pointRadius??a,E.pointShape??d,`series-${B}`)}if(b&&b.length>0){let B=[],E=[{color:i,label:"Primary"},...b.map((_,O)=>({color:_.color,label:_.label??`Series ${O+1}`}))],N=x+10,z=16,k=22,w=7.2,D=14,M=6,F=n-x*2-20,P=0,W=0;for(let _=0;_<E.length;_++){let O=E[_].label.length*w,Y=D+M+O;P>0&&P+Y>F&&(P=0,W+=k);let K=N+P,Q=x-30-W;B.push(o("rect",{x:K,y:Q,width:D,height:14,fill:E[_].color,rx:2,key:`legend-rect-${_}`})),B.push(o("text",{x:K+D+M,y:Q+12,"font-size":12,fill:"#374151",key:`legend-text-${_}`},E[_].label)),P+=Y+z}R.push(o("g",{key:"legend"},...B))}return p&&R.push(o("text",{x:n/2,y:r-8,"text-anchor":"middle","font-size":13,fill:"#374151",key:"x-axis-label"},p)),f&&R.push(o("text",{x:14,y:r/2,"text-anchor":"middle","font-size":13,fill:"#374151",transform:`rotate(-90, 14, ${r/2})`,key:"y-axis-label"},f)),y&&R.push(o("text",{x:n/2,y:20,"text-anchor":"middle","font-size":16,"font-weight":"bold",fill:"#111827",key:"title"},y)),o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...R)}function Zl(e){let t=[];for(let n=0;n<e;n++){let r=Math.round(360*n/e);t.push(`hsl(${r}, 70%, 55%)`)}return t}function Jl(e,t){let n=t??Zl(e.length);return e.map((r,i)=>r.color??n[i%n.length])}function St(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function Un(e,t,n,r,i,s){let a=i-Math.PI/2,l=s-Math.PI/2,d=St(e,t,r,a),u=St(e,t,r,l),h=s-i>Math.PI?1:0;if(n<=0)return[`M ${e} ${t}`,`L ${d.x} ${d.y}`,`A ${r} ${r} 0 ${h} 1 ${u.x} ${u.y}`,"Z"].join(" ");let m=St(e,t,n,l),c=St(e,t,n,a);return[`M ${d.x} ${d.y}`,`A ${r} ${r} 0 ${h} 1 ${u.x} ${u.y}`,`L ${m.x} ${m.y}`,`A ${n} ${n} 0 ${h} 0 ${c.x} ${c.y}`,"Z"].join(" ")}function jn(e,t){let n=t?.padAngle??0,r=Jl(e,t?.colors),i=e.reduce((u,h)=>u+h.value,0);if(i<=0)return[];let s=n*e.length,a=Math.PI*2-s,l=[],d=0;for(let u=0;u<e.length;u++){let h=e[u],m=h.value/i*a,c=d+n/2,p=c+m;l.push({label:h.label,value:h.value,startAngle:c,endAngle:p,percentage:h.value/i*100,color:r[u]}),d=p+n/2}return l}function yi(e){let{data:t,width:n=400,height:r=400,innerRadius:i=0,padAngle:s=.02,showLabels:a=!0,showValues:l=!0,showLegend:d=!0,legendPosition:u="right",title:h,centerLabel:m,colors:c,strokeColor:p="#fff",strokeWidth:f=2,textColor:y="currentColor"}=e,x=d&&u==="right"?140:0,g=h?30:0,b=d&&u==="bottom"?Math.ceil(t.length/2)*22+10:0,S=n-x,I=r-g-b,A=S/2,C=g+I/2,T=Math.min(S,I)/2-10,L=e.outerRadius??T,R=X(()=>jn(t,{padAngle:s,colors:c}),[t,s,c]),$=[];h&&$.push(o("text",{key:"title",x:S/2,y:20,textAnchor:"middle",fontFamily:"sans-serif",fontSize:16,fontWeight:"bold",fill:y},h));for(let B=0;B<R.length;B++){let E=R[B],N=Un(A,C,i,L,E.startAngle,E.endAngle);if($.push(o("path",{key:`slice-${B}`,d:N,fill:E.color,stroke:p,strokeWidth:f})),a||l){let z=(E.startAngle+E.endAngle)/2,k=E.percentage<5,w=k?L+14:i+(L-i)*.65,D=St(A,C,w,z-Math.PI/2),M=k?y:"#fff",F=k?11:12,P=[];if(a&&P.push(E.label),l&&P.push(`${E.percentage.toFixed(1)}%`),k){let W=St(A,C,L+2,z-Math.PI/2);$.push(o("line",{key:`connector-${B}`,x1:W.x,y1:W.y,x2:D.x,y2:D.y,stroke:"#999",strokeWidth:1}))}a&&$.push(o("text",{key:`label-${B}`,x:D.x,y:D.y-(l?6:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:F,fill:M,pointerEvents:"none"},E.label)),l&&$.push(o("text",{key:`value-${B}`,x:D.x,y:D.y+(a?10:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:F-1,fill:M,pointerEvents:"none"},`${E.percentage.toFixed(1)}%`))}}if(m&&i>0&&$.push(o("text",{key:"center-label",x:A,y:C,textAnchor:"middle",dominantBaseline:"central",fontFamily:"sans-serif",fontSize:14,fontWeight:"bold",fill:y},m)),d){let B=[];if(u==="right"){let E=S+10,N=g+20;for(let z=0;z<R.length;z++){let k=R[z],w=N+z*22;B.push(o("circle",{key:`legend-dot-${z}`,cx:E+6,cy:w,r:6,fill:k.color})),B.push(o("text",{key:`legend-text-${z}`,x:E+18,y:w,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:y},`${k.label} (${k.percentage.toFixed(1)}%)`))}}else{let E=r-b+10;for(let N=0;N<R.length;N++){let z=R[N],k=N%2,w=Math.floor(N/2),D=k*(n/2)+10,M=E+w*22;B.push(o("circle",{key:`legend-dot-${N}`,cx:D+6,cy:M,r:6,fill:z.color})),B.push(o("text",{key:`legend-text-${N}`,x:D+18,y:M,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:y},`${z.label} (${z.percentage.toFixed(1)}%)`))}}$.push(...B)}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...$)}function Si(e,t,n,r,i){return{x:n+e*Math.cos(t)*i,y:r-e*Math.sin(t)*i}}function vi(e){let{width:t=400,height:n=400,rRange:r=[0,2],plotFunction:i,plotResolution:s=360,thetaStep:a,sync:l=!1,points:d=[],showGrid:u=!0,pointRadius:h=3,pointColor:m="#3b82f6",curveColor:c="#3b82f6",onPointClick:p,onPointDoubleClick:f,onPointContextMenu:y,onPointHover:x}=e,[g,b]=U(r[1]),[S,I]=U(0),[A,C]=U(0),[T,L]=U(null),R=t/2+S,$=n/2+A,E=Math.min(t,n)/2-30,N=E/g,z=X(()=>{let H=Math.max(1,Math.ceil(g)),j=[],G=g/H;for(let V=1;V<=H;V++)j.push(G*V);return j},[g]),k=X(()=>{let H=[];for(let j=0;j<360;j+=30)H.push(j*Math.PI/180);return H},[]),w=X(()=>{if(!i||!l)return[];let H=a??2*Math.PI/s,j=yt({start:0,end:2*Math.PI,step:H});return qt(i,j)},[i,s,a,l]),[D,M]=U([]),F=ne(null);re(()=>{if(!i||l){M([]);return}let H=a??2*Math.PI/s,j=yt({start:0,end:2*Math.PI,step:H});return F.current&&F.current(),F.current=Zt(i,j,200,G=>{M([...G])}),()=>{F.current&&F.current()}},[i,s,a,l]);let P=l?w:D,W=X(()=>{if(P.length===0)return"";let H=[];for(let j=0;j<P.length;j++){let G=P[j],V=G.output;if(V<0||!isFinite(V))continue;let{x:Z,y:te}=Si(V,G.input,R,$,N);H.push(`${H.length===0?"M":"L"}${Z.toFixed(2)},${te.toFixed(2)}`)}return H.join(" ")},[P,R,$,N]),_=v(H=>{L({x:H.clientX,y:H.clientY,px:S,py:A})},[S,A]),O=v(H=>{T&&(I(T.px+(H.clientX-T.x)),C(T.py+(H.clientY-T.y)))},[T]),Y=v(()=>{L(null)},[]),K=v(H=>{H.preventDefault();let j=H.deltaY>0?1.15:1/1.15;b(Math.max(.1,g*j))},[g]),Q=v((H,j,G)=>{if(H)return V=>H({r:j.r,theta:j.theta,index:G,event:V})},[]),q=[];if(q.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),u){for(let H=0;H<z.length;H++){let j=z[H]*N;q.push(o("circle",{cx:R,cy:$,r:j,fill:"none",stroke:"#e5e7eb","stroke-width":1,key:`gc-${H}`})),q.push(o("text",{x:R+j+2,y:$-4,"font-size":10,fill:"#9ca3af",key:`gl-${H}`},z[H].toFixed(1)))}for(let H=0;H<k.length;H++){let j=k[H],G=z[z.length-1]*N,V=R+G*Math.cos(j),Z=$-G*Math.sin(j);q.push(o("line",{x1:R,y1:$,x2:V,y2:Z,stroke:"#e5e7eb","stroke-width":1,key:`al-${H}`}));let te=Math.round(j*180/Math.PI),ae=R+(G+14)*Math.cos(j),J=$-(G+14)*Math.sin(j);q.push(o("text",{x:ae,y:J+4,"text-anchor":"middle","font-size":10,fill:"#9ca3af",key:`at-${H}`},`${te}\xB0`))}}q.push(o("line",{x1:R-E,y1:$,x2:R+E,y2:$,stroke:"#d1d5db","stroke-width":1,key:"x-axis"})),q.push(o("line",{x1:R,y1:$-E,x2:R,y2:$+E,stroke:"#d1d5db","stroke-width":1,key:"y-axis"})),W&&q.push(o("path",{d:W,fill:"none",stroke:c,"stroke-width":2,key:"curve"}));for(let H=0;H<d.length;H++){let j=d[H],{x:G,y:V}=Si(j.r,j.theta,R,$,N);q.push(o("circle",{cx:G,cy:V,r:h,fill:m,key:`pt-${H}`,style:{cursor:"pointer"},onClick:Q(p,j,H),onDblClick:Q(f,j,H),onContextMenu:Q(y,j,H),onMouseEnter:Q(x,j,H)}))}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",style:{cursor:T?"grabbing":"grab"},onMouseDown:_,onMouseMove:O,onMouseUp:Y,onMouseLeave:Y,onWheel:K},...q)}function Gn(e){let t=1<<e,n=[];for(let r=0;r<t;r++){let i=[];for(let s=0;s<e;s++)i.push((r>>s&1)*2-1);n.push({coords:i})}return n}function Xn(e){let t=1<<e,n=[];for(let r=0;r<t;r++)for(let i=0;i<e;i++){let s=r^1<<i;s>r&&n.push({source:r,target:s})}return n}function Kn(e,t){let n=wi(e),r=0;for(let i=0;i<e;i++)for(let s=i+1;s<e;s++){if(r<t.length){let a=t[r];n=ec(n,Ql(e,i,s,a))}r++}return n}function wi(e){let t=[];for(let n=0;n<e;n++){let r=new Array(e).fill(0);r[n]=1,t.push(r)}return t}function Ql(e,t,n,r){let i=wi(e),s=Math.cos(r),a=Math.sin(r);return i[t][t]=s,i[t][n]=-a,i[n][t]=a,i[n][n]=s,i}function ec(e,t){let n=e.length,r=[];for(let i=0;i<n;i++){let s=new Array(n).fill(0);for(let a=0;a<n;a++)for(let l=0;l<n;l++)s[a]+=e[i][l]*t[l][a];r.push(s)}return r}function qn(e,t){let n=e.length,r=new Array(n).fill(0);for(let i=0;i<n;i++)for(let s=0;s<n;s++)r[i]+=e[i][s]*t.coords[s];return r}function Zn(e,t=0){let n=e[0]??0,r=e[1]??0,i=0;for(let s=2;s<e.length;s++)i+=e[s]??0;if(e.length>2&&(i/=e.length-2),t>0){let s=1/(1+t*(i+2));return{x:n*s,y:r*s,depth:i}}return{x:n,y:r,depth:i}}function Pt(e,t=[],n=.3,r=1){let i=Gn(e),s=Xn(e),a=Kn(e,t);return{vertices:i.map((d,u)=>{let h=qn(a,d),m=Zn(h,n);return{id:u,position:d,x:m.x*r,y:m.y*r,depth:m.depth}}),edges:s,dimension:e}}function Tt(e){return e*(e-1)/2}function Jt(e,t=70,n=55){let r=[];for(let i=0;i<e;i++){let s=Math.round(360*i/e);r.push(`hsl(${s}, ${t}%, ${n}%)`)}return r}function ki(e){let t=e.dimension??4,n=e.width??600,r=e.height??600,i=e.vertexRadius??10,s=e.edgeWidth??3,a=e.edgeColor??"#111",l=e.perspective??.25,d=e.rotationSpeed??.008,u=e.showLabels??!1,h=e.backgroundColor??"transparent",m=e.scale??Math.min(n,r)*.3,c=Tt(t),p=1<<t,f=X(()=>e.vertexColors==="auto"||e.vertexColors===void 0?Jt(p):e.vertexColors,[p,e.vertexColors]),[y,x]=U(()=>{let M=[];for(let F=0;F<c;F++)M.push(0);return M}),[g,b]=U(!1),S=ne({x:0,y:0}),I=ne([]),A=ne(0);re(()=>{if(d===0)return;let M=!0,F=()=>{M&&(x(P=>{let W=P.slice();for(let _=0;_<W.length;_++)W[_]=(W[_]??0)+d*(1+_*.3);return W}),A.current=requestAnimationFrame(F))};return A.current=requestAnimationFrame(F),()=>{M=!1,cancelAnimationFrame(A.current)}},[d]);let C=X(()=>Pt(t,y,l,m),[t,y,l,m]),T=n/2,L=r/2,R=X(()=>C.edges.map(M=>{let F=C.vertices[M.source],P=C.vertices[M.target],W=(F.depth+P.depth)/2;return{...M,avgDepth:W,sv:F,tv:P}}).sort((M,F)=>M.avgDepth-F.avgDepth),[C]),$=X(()=>C.vertices.slice().sort((M,F)=>M.depth-F.depth),[C]),B=v(M=>{let F=M;b(!0),S.current={x:F.clientX,y:F.clientY},I.current=y.slice()},[y]),E=v(M=>{if(!g)return;let F=M,P=(F.clientX-S.current.x)*.01,W=(F.clientY-S.current.y)*.01;x(()=>{let _=I.current.slice();return _.length>0&&(_[0]=(_[0]??0)+P),_.length>1&&(_[1]=(_[1]??0)+W),_})},[g]),N=v(()=>{b(!1)},[]),z=M=>{let F=(M+2)/4;return .3+.7*Math.max(0,Math.min(1,F))},k=M=>{let F=(M+2)/4;return .6+.4*Math.max(0,Math.min(1,F))},w=R.map((M,F)=>{let P=z(M.avgDepth);return o("line",{key:`e-${M.source}-${M.target}`,x1:String(T+M.sv.x),y1:String(L+M.sv.y),x2:String(T+M.tv.x),y2:String(L+M.tv.y),stroke:a,"stroke-width":String(s),"stroke-opacity":String(P),"stroke-linecap":"round"})}),D=$.map(M=>{let F=i*k(M.depth),P=f[M.id%f.length]??"#3b82f6",W=[o("circle",{key:`v-${M.id}-circle`,cx:String(T+M.x),cy:String(L+M.y),r:String(F),fill:P,stroke:"#000","stroke-width":"1.5",style:{filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.3))"}})];return u&&W.push(o("text",{key:`v-${M.id}-label`,x:String(T+M.x),y:String(L+M.y+F+14),"text-anchor":"middle","font-size":"11","font-family":"monospace",fill:"#555"},M.id.toString(2).padStart(t,"0"))),W});return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",style:{backgroundColor:h,cursor:g?"grabbing":"grab",userSelect:"none"},onMouseDown:B,onMouseMove:E,onMouseUp:N,onMouseLeave:N},...w,...D.flat())}function Ci(e={}){let t=e.dimension??4,n=e.rotationSpeed??.008,r=e.perspective??.25,i=e.scale??200,s=Tt(t),[a,l]=U(()=>new Array(s).fill(0));return re(()=>{if(n===0)return;let u=!0,h=0,m=()=>{u&&(l(c=>c.map((p,f)=>p+n*(1+f*.3))),h=requestAnimationFrame(m))};return h=requestAnimationFrame(m),()=>{u=!1,cancelAnimationFrame(h)}},[n]),{data:X(()=>Pt(t,a,r,i),[t,a,r,i]),angles:a,setAngles:l}}function Mi(e){let t=e.titlePosition??"top",n=e.legendPosition??"bottom",r=e.titleAlign??"center",i=e.legendAlign??"center",s=e.gap??"12px",a=e.contain??"layout style paint",l={display:"flex",flexDirection:tc(t,n),gap:s,width:typeof e.width=="number"?`${e.width}px`:e.width??"auto",height:typeof e.height=="number"?`${e.height}px`:e.height??"auto",backgroundColor:e.backgroundColor??"#ffffff",border:e.border??"1px solid #e5e7eb",borderRadius:e.borderRadius??"8px",padding:e.padding??"16px",fontFamily:e.fontFamily??"inherit",contain:a,overflow:"hidden",position:"relative",boxSizing:"border-box",...e.boxShadow?{boxShadow:e.boxShadow}:{},...e.style??{}},d=e.title?o("div",{className:"viz-title",style:{fontSize:e.titleFontSize??"16px",fontWeight:e.titleFontWeight??"600",color:e.titleColor??"#1f2937",textAlign:r,flexShrink:"0"}},e.title):null,u=e.legend&&e.legend.length>0?oc(e.legend,{align:i,fontSize:e.legendFontSize??"12px",gap:e.legendGap??16,direction:n==="left"||n==="right"?"column":"row"}):null,h=o("div",{className:"viz-content",style:{flex:"1",minWidth:"0",minHeight:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}},e.children),m=nc(d,h,u,t,n);return o("div",{className:`viz-wrapper ${e.className??""}`.trim(),style:l},...m)}function tc(e,t){return"column"}function nc(e,t,n,r,i){let s=[];if(r==="top"&&e&&s.push(e),i==="left"||i==="right"){let a=[];i==="left"&&n&&a.push(n),r==="left"&&e&&a.push(e),a.push(t),r==="right"&&e&&a.push(e),i==="right"&&n&&a.push(n),s.push(o("div",{style:{display:"flex",flexDirection:"row",flex:"1",gap:"12px",minHeight:"0",alignItems:"stretch"}},...a))}else if(r==="left"||r==="right"){i==="top"&&n&&s.push(n);let a=[];r==="left"&&e&&a.push(e),a.push(t),r==="right"&&e&&a.push(e),s.push(o("div",{style:{display:"flex",flexDirection:"row",flex:"1",gap:"12px",minHeight:"0",alignItems:"center"}},...a)),i==="bottom"&&n&&s.push(n)}else i==="top"&&n&&s.push(n),s.push(t),i==="bottom"&&n&&s.push(n);return r==="bottom"&&e&&s.push(e),s}function oc(e,t){return o("div",{className:"viz-legend",style:{display:"flex",flexDirection:t.direction,flexWrap:"wrap",gap:`${t.gap}px`,justifyContent:t.align,alignItems:"center",fontSize:t.fontSize,color:"#6b7280",flexShrink:"0"}},...e.map((n,r)=>o("div",{key:`legend-${r}`,style:{display:"flex",alignItems:"center",gap:"6px"}},rc(n),o("span",null,n.label))))}function rc(e){let t=e.shape??"circle";return t==="line"?o("svg",{width:"20",height:"12",viewBox:"0 0 20 12"},o("line",{x1:"0",y1:"6",x2:"20",y2:"6",stroke:e.color,"stroke-width":"2","stroke-dasharray":e.dash??""})):t==="square"?o("div",{style:{width:"12px",height:"12px",backgroundColor:e.color,borderRadius:"2px",flexShrink:"0"}}):o("div",{style:{width:"10px",height:"10px",backgroundColor:e.color,borderRadius:"50%",flexShrink:"0"}})}function ic(e){if(typeof document>"u")return;let t="specifyjs-gtag";if(document.getElementById(t))return;let n=document.createElement("script");n.id=t,n.async=!0,n.src=`https://www.googletagmanager.com/gtag/js?id=${encodeURIComponent(e)}`,document.head.appendChild(n)}function sc(){typeof window>"u"||(window.dataLayer=window.dataLayer||[],window.gtag||(window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date)))}function Ei(e){let{measurementId:t,disabled:n=!1,debug:r=!1,anonymizeIp:i=!1,config:s}=e;return re(()=>{if(n||typeof window>"u")return;ic(t),sc();let a={...s};return i&&(a.anonymize_ip=!0),r&&(a.debug_mode=!0),window.gtag&&window.gtag("config",t,a),()=>{let l=document.getElementById("specifyjs-gtag");l&&l.remove()}},[t,n,r,i]),null}function Ii(e){let{left:t,center:n,right:r,borderTop:i="1px solid var(--color-border, #e2e8f0)",background:s="var(--color-bg, transparent)",color:a="var(--color-text-muted, #64748b)",fontSize:l="13px",padding:d="24px",maxWidth:u="1200px",className:h,ariaLabel:m="Site footer"}=e;return o("footer",{className:h,role:"contentinfo","aria-label":m,style:{borderTop:i,background:s,color:a,fontSize:l,padding:d,marginTop:"48px"}},o("div",{className:"footer-inner",style:{maxWidth:u,margin:"0 auto",display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:"12px"}},o("div",{className:"footer-section",style:{flex:"1",textAlign:"left",minWidth:"150px"}},t??null),o("div",{className:"footer-section",style:{flex:"1",textAlign:"center",minWidth:"150px"}},n??null),o("div",{className:"footer-section",style:{flex:"1",textAlign:"right",minWidth:"150px"}},r??null)))}var Ti=Ue({windows:[],openWindow:()=>{},closeWindow:()=>{},focusWindow:()=>{},minimizeWindow:()=>{},maximizeWindow:()=>{},restoreWindow:()=>{},moveWindow:()=>{},resizeWindow:()=>{},tileWindows:()=>{},cascadeWindows:()=>{},minimizeAll:()=>{},focusedWindowId:null,setMenuBar:()=>{},clearMenuBar:()=>{},activeMenuBar:null,signalDock:()=>{},dockSignals:new Map}),ac={width:600,height:400},lc={x:30,y:30},cc={top:0,left:0,width:1920,height:1080},Jn=1e3;function Ri(e,t,n,r){let i=n.left+e*t.x,s=n.top+e*t.y,a=n.left+n.width-r.width,l=n.top+n.height-r.height;return a>n.left&&i>a&&(i=n.left+(i-n.left)%Math.max(1,a-n.left)),l>n.top&&s>l&&(s=n.top+(s-n.top)%Math.max(1,l-n.top)),{x:i,y:s}}function Qn(e){let t=[...e].sort((r,i)=>r.zIndex-i.zIndex),n=[];for(let r=0;r<t.length;r++)n.push({...t[r],zIndex:r+1});return n}function Pi(e,t){let n=null;for(let r=0;r<e.length;r++){let i=e[r];i.id!==t&&i.windowState!=="minimized"&&(n===null||i.zIndex>n.zIndex)&&(n=i)}return n}function eo(e){let t=0;for(let n=0;n<e.length;n++)e[n].zIndex>t&&(t=e[n].zIndex);return t}function Qt(e){let t=e.workspaceBounds??cc,n=e.defaultWindowSize??ac,r=e.cascadeOffset??lc,[i,s]=U([]),a=v(((...B)=>{let E=B[0];s(N=>{if(N.find(W=>W.id===E.id)){let _=eo(N)+1,O=N.map(Y=>Y.id===E.id?{...Y,focused:!0,zIndex:_,windowState:Y.windowState==="minimized"?"normal":Y.windowState}:{...Y,focused:!1});return _>Jn&&(O=Qn(O)),O}let k=E.size??n,w=E.position??Ri(N.length,r,t,k),M=eo(N)+1,F={id:E.id,title:E.title,icon:E.icon,position:w,size:k,windowState:"normal",zIndex:M,focused:!0,appProps:E.appProps},P=N.map(W=>({...W,focused:!1}));return P.push(F),M>Jn&&(P=Qn(P)),e.onWindowOpen&&e.onWindowOpen(E.id),e.onFocusChange&&e.onFocusChange(E.id),P})}),[n,r,t,e.onWindowOpen,e.onFocusChange]),l=v(((...B)=>{let E=B[0];S(N=>{if(N[E]){let z={...N};return delete z[E],z}return N}),A(N=>{if(N.has(E)){let z=new Map(N);return z.delete(E),z}return N}),s(N=>{let z=N.find(w=>w.id===E);if(!z)return N;let k=N.filter(w=>w.id!==E);if(z.focused&&k.length>0){let w=Pi(k,E);if(w){let D=k.map(M=>({...M,focused:M.id===w.id}));return e.onWindowClose&&e.onWindowClose(E),e.onFocusChange&&e.onFocusChange(w.id),D}}return e.onWindowClose&&e.onWindowClose(E),k.length===0&&e.onFocusChange&&e.onFocusChange(null),k})}),[e.onWindowClose,e.onFocusChange]),d=v(((...B)=>{let E=B[0];s(N=>{if(!N.find(M=>M.id===E))return N;let w=eo(N)+1,D=N.map(M=>M.id===E?{...M,focused:!0,zIndex:w}:{...M,focused:!1});return w>Jn&&(D=Qn(D)),e.onFocusChange&&e.onFocusChange(E),D})}),[e.onFocusChange]),u=v(((...B)=>{let E=B[0];s(N=>{let z=N.find(w=>w.id===E);if(!z)return N;let k=N.map(w=>w.id===E?{...w,windowState:"minimized",focused:!1}:w);if(z.focused){let w=Pi(k,E);w?(k=k.map(D=>({...D,focused:D.id===w.id})),e.onFocusChange&&e.onFocusChange(w.id)):e.onFocusChange&&e.onFocusChange(null)}return k})}),[e.onFocusChange]),h=v(((...B)=>{let E=B[0];s(N=>N.map(z=>z.id===E?{...z,windowState:"maximized"}:z))}),[]),m=v(((...B)=>{let E=B[0];s(N=>N.map(z=>z.id===E?{...z,windowState:"normal"}:z))}),[]),c=v(((...B)=>{let E=B[0],N=B[1];s(z=>z.map(k=>k.id===E?{...k,position:N}:k))}),[]),p=v(((...B)=>{let E=B[0],N=B[1];s(z=>z.map(k=>k.id===E?{...k,size:N}:k))}),[]),f=v(((...B)=>{s(E=>{let N=E.filter(w=>w.windowState!=="minimized");if(N.length===0)return E;let z=N.length,k=new Map;if(z===1)k.set(N[0].id,{position:{x:t.left,y:t.top},size:{width:t.width,height:t.height}});else if(z===2){let w=Math.floor(t.width/2);k.set(N[0].id,{position:{x:t.left,y:t.top},size:{width:w,height:t.height}}),k.set(N[1].id,{position:{x:t.left+w,y:t.top},size:{width:t.width-w,height:t.height}})}else if(z===3){let w=Math.floor(t.width/2),D=Math.floor(t.height/2);k.set(N[0].id,{position:{x:t.left,y:t.top},size:{width:w,height:t.height}}),k.set(N[1].id,{position:{x:t.left+w,y:t.top},size:{width:t.width-w,height:D}}),k.set(N[2].id,{position:{x:t.left+w,y:t.top+D},size:{width:t.width-w,height:t.height-D}})}else{let w=Math.ceil(Math.sqrt(z)),D=Math.ceil(z/w),M=Math.floor(t.width/w),F=Math.floor(t.height/D);for(let P=0;P<N.length;P++){let W=Math.floor(P/w),_=P%w;k.set(N[P].id,{position:{x:t.left+_*M,y:t.top+W*F},size:{width:M,height:F}})}}return E.map(w=>{let D=k.get(w.id);return D?{...w,position:D.position,size:D.size,windowState:"normal"}:w})})}),[t]),y=v(((...B)=>{s(E=>{let N=E.filter(w=>w.windowState!=="minimized");if(N.length===0)return E;let z=[...N].sort((w,D)=>w.zIndex-D.zIndex),k=new Map;for(let w=0;w<z.length;w++){let D=Ri(w,r,t,z[w].size);k.set(z[w].id,{position:D,zIndex:w+1})}return E.map(w=>{let D=k.get(w.id);return D?{...w,position:D.position,zIndex:D.zIndex,windowState:"normal"}:w})})}),[r,t]),x=v(((...B)=>{s(E=>{let N=E.map(z=>({...z,windowState:"minimized",focused:!1}));return e.onFocusChange&&e.onFocusChange(null),N})}),[e.onFocusChange]),g=X(()=>{let B=i.find(E=>E.focused);return B?B.id:null},[i]),[b,S]=U({}),[I,A]=U(new Map),C=v(((...B)=>{let E=B[0],N=B[1];S(z=>({...z,[E]:N}))}),[]),T=v(((...B)=>{let E=B[0];S(N=>{let z={...N};return delete z[E],z})}),[]),L=X(()=>g&&b[g]?b[g]:null,[g,b]),R=v(((...B)=>{let E=B[0],N=B[1];A(z=>{let k=new Map(z),w=k.get(E);return k.set(E,{...w,...N}),k})}),[]),$=X(()=>({windows:i,openWindow:a,closeWindow:l,focusWindow:d,minimizeWindow:u,maximizeWindow:h,restoreWindow:m,moveWindow:c,resizeWindow:p,tileWindows:f,cascadeWindows:y,minimizeAll:x,focusedWindowId:g,setMenuBar:C,clearMenuBar:T,activeMenuBar:L,signalDock:R,dockSignals:I}),[i,a,l,d,u,h,m,c,p,f,y,x,g,C,T,L,R,I]);return o(Ti.Provider,{value:$},e.children)}function vt(){return Ye(Ti)}var $i=Ue({appId:""});function it(e){let t=X(()=>({appId:e.appId}),[e.appId]);return o($i.Provider,{value:t},e.children)}function wt(){return Ye($i).appId}var Di=Ue({publish:()=>{},subscribe:()=>()=>{},subscribeAll:()=>()=>{}});function $t(e){let t=ne([]),n=ne([]),r=v(((...l)=>{let d=l[0],u=l[1],h=l[2],m=l[3]||"",c={channel:d,from:m,to:h||null,payload:u,timestamp:Date.now()},p=t.current;for(let y=0;y<p.length;y++){let x=p[y];x.channel===d&&(c.to&&x.appId!==c.to||!c.to&&x.appId===m||x.handler(c))}let f=n.current;for(let y=0;y<f.length;y++)f[y].handler(c)}),[]),i=v(((...l)=>{let d=l[0],u=l[1],h=l[2]||"",m={channel:d,handler:u,appId:h};return t.current=[...t.current,m],()=>{t.current=t.current.filter(c=>c!==m)}}),[]),s=v(((...l)=>{let u={handler:l[0]};return n.current=[...n.current,u],()=>{n.current=n.current.filter(h=>h!==u)}}),[]),a=X(()=>({publish:r,subscribe:i,subscribeAll:s}),[r,i,s]);return o(Di.Provider,{value:a},e.children)}function st(){let e=Ye(Di),t=wt(),n=v(((...i)=>{let s=i[0],a=i[1],l=i[2];e.publish(s,a,l,t)}),[e.publish,t]),r=v(((...i)=>{let s=i[0],a=i[1];return e.subscribe(s,a,t)}),[e.subscribe,t]);return X(()=>({publish:n,subscribe:r,subscribeAll:e.subscribeAll}),[n,r,e.subscribeAll])}function Dt(e,t){let n=st(),r=ne(t);r.current=t,re(()=>n.subscribe(e,s=>{r.current(s)}),[n,e])}var zi=Ue({startDrag:()=>{},cancelDrag:()=>{},registerDropZone:()=>()=>{},currentDrag:null,isDragging:!1});function zt(e){let[t,n]=U(null),[r,i]=U({x:0,y:0}),s=ne(new Map),a=ne(null),l=t!==null,d=v(((...p)=>{let f=p[0];n(f)}),[]),u=v(((...p)=>{if(a.current){let f=s.current.get(a.current);f&&f.onDragLeave&&f.onDragLeave(),a.current=null}n(null)}),[]),h=v(((...p)=>{let f=p[0],y=p[1];return s.current=new Map(s.current),s.current.set(f,y),()=>{s.current=new Map(s.current),s.current.delete(f),a.current===f&&(a.current=null)}}),[]);re(()=>{if(!l)return;let p=x=>{let g=x;i({x:g.clientX,y:g.clientY});let b=document.elementFromPoint(g.clientX,g.clientY);if(!b)return;let S=null,I=s.current;I.forEach((C,T)=>{let L=document.querySelector(`[data-dropzone-id="${T}"]`);L&&L.contains(b)&&(S=T)});let A=a.current;if(S!==A){if(A){let C=I.get(A);C&&C.onDragLeave&&C.onDragLeave()}if(S){let C=I.get(S);C&&C.onDragEnter&&t&&C.acceptTypes.indexOf(t.type)!==-1&&C.onDragEnter(t)}a.current=S}},f=x=>{let g=a.current;if(g&&t){let b=s.current.get(g);b&&b.acceptTypes.indexOf(t.type)!==-1&&b.onDrop(t)}a.current=null,n(null)},y=x=>{x.key==="Escape"&&u()};return document.addEventListener("mousemove",p),document.addEventListener("mouseup",f),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",f),document.removeEventListener("keydown",y)}},[l,t,u]);let m=X(()=>({startDrag:d,cancelDrag:u,registerDropZone:h,currentDrag:t,isDragging:l}),[d,u,h,t,l]),c=l?o("div",{className:"drag-drop-preview",style:{position:"fixed",left:`${r.x+12}px`,top:`${r.y+12}px`,pointerEvents:"none",zIndex:"10000",opacity:"0.8",padding:"6px 10px",backgroundColor:"rgba(50, 50, 50, 0.9)",color:"#ffffff",borderRadius:"4px",fontSize:"12px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",whiteSpace:"nowrap"}},t&&t.preview?String(t.preview):`Dragging ${t?t.type:""}`):null;return o(zi.Provider,{value:m},e.children,c)}function pt(){return Ye(zi)}function to(e,t){let n=pt(),r=wt(),i=ne(t);i.current=t;let s=v(l=>{l.preventDefault(),n.startDrag({type:e,data:i.current,sourceAppId:r||""})},[n,e,r]),a=n.isDragging&&n.currentDrag!==null&&n.currentDrag.type===e;return X(()=>({onMouseDown:s,isDragging:a}),[s,a])}function At(e){let t=pt(),[n,r]=U(!1),i=ne(e.zoneId||`zone-${Math.random().toString(36).slice(2,10)}`),s=ne(e);s.current=e,re(()=>t.registerDropZone(i.current,{acceptTypes:s.current.acceptTypes,onDragEnter:d=>{r(!0),s.current.onDragEnter&&s.current.onDragEnter(d)},onDragLeave:()=>{r(!1),s.current.onDragLeave&&s.current.onDragLeave()},onDrop:d=>{r(!1),s.current.onDrop(d)}}),[t]);let a=t.isDragging&&t.currentDrag!==null&&e.acceptTypes.indexOf(t.currentDrag.type)!==-1;return X(()=>({isOver:n,canDrop:a,zoneId:i.current}),[n,a])}var dc=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],uc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function no(e){return e<10?"0"+String(e):String(e)}function pc(e,t,n){let r=e.getHours(),i=no(e.getMinutes()),s=no(e.getSeconds());if(t==="12h"){let l=r>=12?"PM":"AM";return r=r%12,r===0&&(r=12),`${n?`${String(r)}:${i}:${s}`:`${String(r)}:${i}`} ${l}`}let a=no(r);return n?`${a}:${i}:${s}`:`${a}:${i}`}function fc(e){let t=dc[e.getDay()],n=uc[e.getMonth()],r=e.getDate();return`${t}, ${n} ${String(r)}`}function mc(e){let{label:t,onClick:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=Fe(),a=v(()=>{n()},[n]),l=v(d=>{let u=d;(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),n())},[n]);return o("button",{type:"button",role:"button","aria-label":t,tabIndex:0,onClick:a,onKeyDown:l,onMouseEnter:i,onMouseLeave:s,style:{display:"inline-flex",alignItems:"center",padding:"0 12px",height:"100%",border:"none",outline:"none",backgroundColor:r?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",fontWeight:"700",cursor:"pointer",transition:"background-color 0.15s"}},t)}function gc(e){let{format:t,showSeconds:n,showDate:r}=e,[i,s]=U(new Date);re(()=>{let u=setInterval(()=>{s(new Date)},1e3);return()=>{clearInterval(u)}},[]);let a=X(()=>pc(i,t,n),[i,t,n]),l=X(()=>fc(i),[i]),d=r?o("span",{style:{fontSize:"11px",opacity:"0.85"}},l):null;return o("div",{role:"timer","aria-live":"polite","aria-label":"System clock",style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"6px",lineHeight:"1",padding:"0 8px"}},d,o("span",{style:{fontSize:"13px",fontWeight:"500"}},a))}function hc(e){let{indicator:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=Fe(),s=v(()=>{t.onClick&&t.onClick()},[t]),a=v(l=>{let d=l;(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),t.onClick&&t.onClick())},[t]);return o("button",{type:"button",role:"button","aria-label":t.label||t.icon,tabIndex:0,onClick:s,onKeyDown:a,onMouseEnter:r,onMouseLeave:i,style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"0 4px",height:"100%",border:"none",outline:"none",backgroundColor:n?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",cursor:t.onClick?"pointer":"default",transition:"background-color 0.15s"}},o("span",{"aria-hidden":"true"},t.icon),t.label?o("span",null,t.label):null)}function bc(e){let{item:t,onClose:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=Fe();if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"var(--panel-divider, #555555)",margin:"4px 0"}});let a=v(()=>{t.onClick(),n()},[t,n]),l=v(d=>{let u=d;(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),t.onClick(),n())},[t,n]);return o("button",{type:"button",role:"menuitem",tabIndex:-1,onClick:a,onKeyDown:l,onMouseEnter:i,onMouseLeave:s,style:{display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"6px 16px",border:"none",outline:"none",backgroundColor:r?"var(--panel-hover, rgba(255,255,255,0.15))":"transparent",color:"var(--panel-text, #ffffff)",fontFamily:"inherit",fontSize:"13px",textAlign:"left",cursor:"pointer",boxSizing:"border-box",transition:"background-color 0.1s"}},t.icon?o("span",{style:{width:"16px",textAlign:"center"},"aria-hidden":"true"},t.icon):null,o("span",null,t.label))}function xc(e){let{user:t,menuItems:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=Fe(),[a,l]=U(!1),d=ne(null),u=v(()=>{l(x=>!x)},[]),h=v(()=>{l(!1)},[]),m=v(x=>{let g=x;(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),l(b=>!b)),g.key==="Escape"&&l(!1)},[]);re(()=>{if(!a)return;let x=g=>{let b=d.current;b&&!b.contains(g.target)&&l(!1)};return document.addEventListener("click",x,!0),()=>{document.removeEventListener("click",x,!0)}},[a]);let c={width:"24px",height:"24px",borderRadius:"50%",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"12px",fontWeight:"700",backgroundColor:"rgba(255,255,255,0.2)",color:"inherit",overflow:"hidden",flexShrink:"0"},p=t.avatar?o("img",{src:t.avatar,alt:t.name,style:{width:"100%",height:"100%",objectFit:"cover"}}):t.name.charAt(0).toUpperCase(),f=o("span",{style:c,"aria-hidden":"true"},p),y=a&&n&&n.length>0?o("div",{role:"menu","aria-label":"User menu",style:{position:"absolute",top:"100%",right:"0",marginTop:"2px",backgroundColor:"var(--panel-bg, #2c2c2c)",border:"1px solid var(--panel-divider, #555555)",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",padding:"4px 0",minWidth:"180px",zIndex:"1000"}},...n.map((x,g)=>o(bc,{key:String(g),item:x,onClose:h}))):null;return o("div",{ref:d,style:{position:"relative",display:"inline-flex",height:"100%"}},o("button",{type:"button","aria-haspopup":"true","aria-expanded":String(a),tabIndex:0,onClick:u,onKeyDown:m,onMouseEnter:i,onMouseLeave:s,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"0 8px",height:"100%",border:"none",outline:"none",backgroundColor:r||a?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",cursor:"pointer",transition:"background-color 0.15s"}},f,o("span",null,t.name),o("span",{"aria-hidden":"true",style:{fontSize:"10px"}},"\u25BE")),y)}function yc(e){let{menu:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=Fe(),[s,a]=U(!1),l=ne(null),d=v(()=>{a(c=>!c)},[]),u=v(()=>{a(!1)},[]),h=v(c=>{let p=c;(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),a(f=>!f)),p.key==="Escape"&&a(!1)},[]);re(()=>{if(!s)return;let c=p=>{let f=l.current;f&&!f.contains(p.target)&&a(!1)};return document.addEventListener("click",c,!0),()=>{document.removeEventListener("click",c,!0)}},[s]);let m=s&&t.items.length>0?o("div",{role:"menu","aria-label":t.label+" menu",style:{position:"absolute",top:"100%",left:"0",marginTop:"2px",backgroundColor:"var(--panel-bg, #2c2c2c)",border:"1px solid var(--panel-divider, #555555)",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",padding:"4px 0",minWidth:"180px",zIndex:"1000"}},...t.items.map((c,p)=>c.divider?o("div",{key:"div-"+String(p),role:"separator",style:{height:"1px",backgroundColor:"var(--panel-divider, #555555)",margin:"4px 0"}}):o("button",{key:String(p),type:"button",role:"menuitem",tabIndex:-1,disabled:c.disabled??!1,onClick:()=>{c.onClick&&c.onClick(),u()},style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"6px 16px",border:"none",outline:"none",backgroundColor:"transparent",color:c.disabled?"rgba(255,255,255,0.4)":"var(--panel-text, #ffffff)",fontFamily:"inherit",fontSize:"13px",textAlign:"left",cursor:c.disabled?"default":"pointer",boxSizing:"border-box"}},o("span",null,c.checked?"\u2713 ":"",c.label||""),c.shortcut?o("span",{style:{fontSize:"11px",opacity:"0.6",marginLeft:"16px"}},c.shortcut):null))):null;return o("div",{ref:l,className:"system-tray__app-menu",style:{position:"relative",display:"inline-flex",height:"100%"}},o("button",{type:"button","aria-haspopup":"true","aria-expanded":String(s),tabIndex:0,onClick:d,onKeyDown:h,onMouseEnter:r,onMouseLeave:i,style:{display:"inline-flex",alignItems:"center",padding:"0 10px",height:"100%",border:"none",outline:"none",backgroundColor:n||s?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",fontWeight:"500",cursor:"pointer",transition:"background-color 0.15s"}},t.label),m)}function en(e){let{activeAppName:t,activitiesButton:n,appMenuBar:r,clockFormat:i="24h",showSeconds:s=!0,showDate:a=!0,indicators:l,user:d,userMenuItems:u,height:h=28,children:m}=e,c=String(h)+"px",p=[];if(n&&p.push(o(mc,{key:"activities",label:n.label,onClick:n.onClick})),t&&p.push(o("span",{key:"appname",style:{padding:"0 12px",fontSize:"13px",fontWeight:"700",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"200px"}},t)),r&&r.menus.length>0)for(let S=0;S<r.menus.length;S++)p.push(o(yc,{key:"appmenu-"+String(S),menu:r.menus[S]}));let f=o("div",{style:{display:"flex",alignItems:"center",height:"100%",flex:"1",minWidth:"0"}},...p),y=[];y.push(o(gc,{key:"clock",format:i,showSeconds:s,showDate:a})),m&&y.push(m);let x=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}},...y),g=[];if(l&&l.length>0){let S=l.map(I=>o(hc,{key:I.id,indicator:I}));g.push(o("div",{key:"indicators",style:{display:"flex",alignItems:"center",gap:"8px",height:"100%"}},...S))}d&&g.push(o(xc,{key:"user",user:d,menuItems:u}));let b=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",height:"100%",flex:"1",gap:"4px"}},...g);return o("div",{role:"menubar","aria-label":"System panel","data-theme":"dark",style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",height:c,backgroundColor:"var(--panel-bg, #2c2c2c)",color:"var(--panel-text, #ffffff)",fontFamily:"inherit",fontSize:"13px",boxSizing:"border-box",position:"relative"}},f,x,b)}function Sc(e){return e.startsWith("http")||e.startsWith("/")||e.startsWith(".")}var Ai=["#3465a4","#e67e22","#2ecc71","#3498db","#e74c3c","#9b59b6","#f39c12","#1abc9c","#e91e63","#00bcd4"];function vc(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return Ai[Math.abs(t)%Ai.length]}function wc(e){return e>99?"99+":String(e)}function kc(e){return e.badge&&e.badge>0?`${e.label}, ${e.badge} unread`:e.label}function Cc(e){switch(e){case"left":return{left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px"};case"right":return{right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:"8px"};case"top":return{top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:"8px"};case"bottom":return{bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:"8px"};default:return{left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px"}}}function Mc(e,t){return t==="vertical"?e==="right"?{position:"absolute",right:"0",top:"50%",transform:"translateY(-50%)"}:{position:"absolute",left:"0",top:"50%",transform:"translateY(-50%)"}:e==="bottom"?{position:"absolute",top:"0",left:"50%",transform:"translateX(-50%)"}:{position:"absolute",bottom:"0",left:"50%",transform:"translateX(-50%)"}}function Ec(e){let{item:t,iconSize:n,position:r,orientation:i,onItemClick:s,onItemContextMenu:a}=e,[l,d]=U(!1),u=t.disabled??!1,h=v(()=>{u||d(!0)},[u]),m=v(()=>{d(!1)},[]),c=v(()=>{!u&&s&&s(t.id)},[u,s,t.id]),p=v(A=>{if(!u&&a){let C=A;C.preventDefault(),a(t.id,{x:C.clientX,y:C.clientY})}},[u,a,t.id]),f=`${n}px`,y=Sc(t.icon)?o("img",{src:t.icon,alt:t.label,style:{width:f,height:f,objectFit:"contain",display:"block"}}):o("span",{style:{width:f,height:f,display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.round(n*.6)}px`,fontWeight:"700",userSelect:"none",backgroundColor:vc(t.icon),color:"#ffffff",borderRadius:"8px"},"aria-hidden":"true"},t.icon),x=t.badge!=null&&t.badge>0?o("span",{style:{position:"absolute",top:"0",right:"0",backgroundColor:"var(--dock-badge-bg, #e74c3c)",color:"#ffffff",fontSize:"9px",fontWeight:"700",lineHeight:"1",minWidth:"14px",height:"14px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"7px",padding:"0 3px",pointerEvents:"none",zIndex:"2"},"aria-hidden":"true"},wc(t.badge)):null,g=t.active?o("span",{style:{...Mc(r,i),width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"var(--dock-active-color, #ffffff)",pointerEvents:"none",zIndex:"2"},"aria-hidden":"true"}):null,b=t.progress!=null&&t.progress>0?o("div",{style:{position:"absolute",bottom:"2px",left:"6px",right:"6px",height:"3px",backgroundColor:"rgba(255,255,255,0.2)",borderRadius:"2px",overflow:"hidden",pointerEvents:"none",zIndex:"2"},"aria-hidden":"true"},o("div",{style:{width:`${Math.min(1,Math.max(0,t.progress))*100}%`,height:"100%",backgroundColor:"var(--dock-progress-color, #3b82f6)",borderRadius:"2px",transition:"width 200ms ease"}})):null,S=l?o("div",{role:"tooltip",style:{position:"absolute",...Cc(r),padding:"4px 10px",backgroundColor:"#1f2937",color:"#ffffff",fontSize:"12px",borderRadius:"4px",whiteSpace:"nowrap",zIndex:"1000",pointerEvents:"none"}},t.label):null,I={position:"relative",display:"flex",alignItems:"center",justifyContent:"center",padding:"6px",border:"none",backgroundColor:"transparent",cursor:u?"default":"pointer",opacity:u?"0.4":"1",pointerEvents:u?"none":"auto",transition:"transform 100ms, background-color 100ms",borderRadius:"8px",outline:"none",...l&&!u?{transform:"scale(1.1)",backgroundColor:"rgba(255,255,255,0.15)"}:{},...t.urgent&&!u?{animation:"dock-urgent-pulse 0.6s ease-in-out infinite alternate"}:{}};return o("button",{type:"button",role:"button",style:I,"aria-label":kc(t),"aria-pressed":t.active?"true":"false","aria-disabled":u?"true":void 0,tabIndex:u?-1:0,onClick:c,onContextMenu:p,onMouseEnter:h,onMouseLeave:m,"data-dock-item-id":t.id,"data-urgent":t.urgent?"true":void 0},y,x,g,b,S)}function tn(e){let{items:t,orientation:n="vertical",position:r="left",iconSize:i=36,autoHide:s=!1,showTrailingSeparator:a=!1,onItemClick:l,onItemContextMenu:d,children:u}=e,[h,m]=U(!s),c=ne(null),p=v(()=>{s&&(c.current!=null&&(clearTimeout(c.current),c.current=null),m(!0))},[s]),f=v(()=>{s&&(c.current=setTimeout(()=>{m(!1)},300))},[s]),y=v(I=>{let A=I,C=A.target,T=C.closest('[role="toolbar"]');if(!T)return;let L=Array.from(T.querySelectorAll("button[data-dock-item-id]")),R=L.indexOf(C);if(R<0)return;let $=n==="vertical",B=$?"ArrowDown":"ArrowRight",E=$?"ArrowUp":"ArrowLeft";if(A.key===B){A.preventDefault();let N=L[R+1];N&&N.focus()}else if(A.key===E){A.preventDefault();let N=L[R-1];N&&N.focus()}else A.key==="Home"?(A.preventDefault(),L[0]?.focus()):A.key==="End"?(A.preventDefault(),L[L.length-1]?.focus()):(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),C.click())},[n]),x=n==="vertical",g={display:"flex",flexDirection:x?"column":"row",alignItems:"center",gap:"2px",padding:"4px",backgroundColor:"var(--dock-bg, rgba(0, 0, 0, 0.7))",color:"#ffffff",border:"1px solid var(--dock-border, rgba(255, 255, 255, 0.1))",borderRadius:"8px",boxSizing:"border-box",position:"relative",transition:"transform 200ms ease, opacity 200ms ease"};s&&!h&&(r==="left"?(g.transform="translateX(-100%)",g.opacity="0"):r==="right"?(g.transform="translateX(100%)",g.opacity="0"):r==="top"?(g.transform="translateY(-100%)",g.opacity="0"):r==="bottom"&&(g.transform="translateY(100%)",g.opacity="0"));let b=[];for(let I=0;I<t.length;I++){if(a&&I===t.length-1&&t.length>1){let A=x?{width:"60%",height:"1px",backgroundColor:"rgba(255,255,255,0.2)",margin:"4px auto",flexShrink:"0"}:{height:"60%",width:"1px",backgroundColor:"rgba(255,255,255,0.2)",margin:"auto 4px",flexShrink:"0"};b.push(o("div",{key:`sep-${I}`,style:A,"aria-hidden":"true",role:"separator"}))}b.push(o(Ec,{key:t[I].id,item:t[I],iconSize:i,position:r,orientation:n,onItemClick:l,onItemContextMenu:d}))}let S=s&&!h?o("div",{style:{position:"absolute",...r==="left"?{left:"0",top:"0",width:"4px",height:"100%"}:{},...r==="right"?{right:"0",top:"0",width:"4px",height:"100%"}:{},...r==="top"?{top:"0",left:"0",height:"4px",width:"100%"}:{},...r==="bottom"?{bottom:"0",left:"0",height:"4px",width:"100%"}:{},zIndex:"10"},"aria-hidden":"true"}):null;return o("div",{role:"toolbar","aria-label":"Application launcher","aria-orientation":n,style:g,onMouseEnter:p,onMouseLeave:f,onKeyDown:y},S,...b,u??null)}var Ic="#2c001e";function nn(e){let{backgroundColor:t=Ic,backgroundGradient:n,backgroundImage:r,backgroundImageOpacity:i=1,contextMenuItems:s,onClick:a,onDoubleClick:l,overflow:d="visible",children:u}=e,h=v(g=>{let b=g;b.target===b.currentTarget&&a&&a()},[a]),m=v(g=>{let b=g;b.target===b.currentTarget&&l&&l()},[l]),c=X(()=>{let g={position:"relative",width:"100%",height:"100%",overflow:d,cursor:"default",margin:"0",padding:"0"};return g.backgroundColor=t,n&&(g.background=n),r&&i>=1&&(g.backgroundImage=`url(${r})`,g.backgroundSize="cover",g.backgroundPosition="center"),g},[t,n,r,i]),p=X(()=>!r||i>=1?null:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",backgroundImage:`url(${r})`,backgroundSize:"cover",backgroundPosition:"center",opacity:String(i),pointerEvents:"none",zIndex:"0"},[r,i]),f={position:"relative",width:"100%",height:"100%",zIndex:"1"},y=[];p&&y.push(o("div",{className:"desktop-background__image-overlay",style:p,"aria-hidden":"true"})),y.push(o("div",{className:"desktop-background__content",style:f},u));let x=o("div",{className:"desktop-background",style:c,onClick:h,onDblClick:m,role:"application","aria-label":"Desktop workspace","data-theme":"dark"},...y);return s&&s.length>0?o(Kt,{items:s},x):x}var Rc={width:200,height:150},Pc={x:50,y:50},Tc={width:400,height:300},We=8,oo=20,$c={n:"n-resize",s:"s-resize",e:"e-resize",w:"w-resize",ne:"ne-resize",nw:"nw-resize",se:"se-resize",sw:"sw-resize"};function kt(e){let{id:t,title:n,icon:r,defaultPosition:i=Pc,defaultSize:s=Tc,minSize:a=Rc,maxSize:l,resizable:d=!0,draggable:u=!0,windowState:h="normal",focused:m=!0,zIndex:c,onClose:p,onMinimize:f,onMaximize:y,onFocus:x,onMove:g,onResize:b,children:S}=e,[I,A]=U(i.x),[C,T]=U(i.y),[L,R]=U(s.width),[$,B]=U(s.height),[E,N]=U(!1),[z,k]=U(!1),[w,D]=U(null),M=ne(null),F=ne(null),P=ne(null),W=v((oe,ge)=>{let he=Math.max(oe,a.width),ee=Math.max(ge,a.height);return l&&(he=Math.min(he,l.width),ee=Math.min(ee,l.height)),{width:he,height:ee}},[a,l]),_=v(()=>{let oe=P.current;return oe&&oe.parentElement?{width:oe.parentElement.clientWidth,height:oe.parentElement.clientHeight}:{width:window.innerWidth,height:window.innerHeight}},[]),O=v((oe,ge,he,ee)=>{let de=_(),me=Math.max(0,Math.min(oe,de.width-he)),xe=Math.max(0,Math.min(ge,de.height-ee));return{x:me,y:xe}},[_]),Y=v(oe=>{if(!u||h==="maximized")return;let ge=oe;ge.target.closest("button")||(ge.preventDefault(),M.current={startMouseX:ge.clientX,startMouseY:ge.clientY,startPosX:I,startPosY:C},N(!0))},[u,h,I,C]),K=v(oe=>{oe.target.closest("button")||y&&y()},[y]);re(()=>{if(!E)return;let oe=he=>{let ee=he,de=M.current;if(!de)return;let me=ee.clientX-de.startMouseX,xe=ee.clientY-de.startMouseY,ye=de.startPosX+me,Me=de.startPosY+xe,ce=_();ye=Math.max(0,Math.min(ye,ce.width-L)),Me=Math.max(0,Math.min(Me,ce.height-$)),A(ye),T(Me),ee.clientX<=oo?D("left"):ee.clientX>=ce.width-oo?D("right"):ee.clientY<=oo?D("top"):D(null)},ge=he=>{let ee=he;N(!1);let de=_();if(w==="left"){A(0),T(0),R(Math.floor(de.width/2)),B(de.height),D(null),g&&g({x:0,y:0}),b&&b({width:Math.floor(de.width/2),height:de.height});return}if(w==="right"){let xe=Math.floor(de.width/2);A(xe),T(0),R(xe),B(de.height),D(null),g&&g({x:xe,y:0}),b&&b({width:xe,height:de.height});return}if(w==="top"){D(null),y&&y();return}D(null);let me=M.current;if(me&&g){let xe=ee.clientX-me.startMouseX,ye=ee.clientY-me.startMouseY,Me=me.startPosX+xe,ce=me.startPosY+ye;Me=Math.max(0,Math.min(Me,de.width-L)),ce=Math.max(0,Math.min(ce,de.height-$)),g({x:Me,y:ce})}M.current=null};return document.addEventListener("mousemove",oe),document.addEventListener("mouseup",ge),()=>{document.removeEventListener("mousemove",oe),document.removeEventListener("mouseup",ge)}},[E,w,L,$,_,g,b,y]);let Q=v(oe=>ge=>{if(!d||h!=="normal")return;let he=ge;he.preventDefault(),he.stopPropagation(),F.current={direction:oe,startMouseX:he.clientX,startMouseY:he.clientY,startPosX:I,startPosY:C,startWidth:L,startHeight:$},k(!0)},[d,h,I,C,L,$]);re(()=>{if(!z)return;let oe=he=>{let ee=he,de=F.current;if(!de)return;let me=ee.clientX-de.startMouseX,xe=ee.clientY-de.startMouseY,ye=de.direction,Me=de.startWidth,ce=de.startHeight,be=de.startPosX,Ee=de.startPosY;ye.includes("e")&&(Me=de.startWidth+me),ye.includes("w")&&(Me=de.startWidth-me,be=de.startPosX+me),ye.includes("s")&&(ce=de.startHeight+xe),ye.includes("n")&&(ce=de.startHeight-xe,Ee=de.startPosY+xe);let Re=W(Me,ce);ye.includes("w")&&(be=de.startPosX+(de.startWidth-Re.width)),ye.includes("n")&&(Ee=de.startPosY+(de.startHeight-Re.height)),R(Re.width),B(Re.height),A(be),T(Ee)},ge=()=>{k(!1),b&&b({width:L,height:$}),F.current=null};return document.addEventListener("mousemove",oe),document.addEventListener("mouseup",ge),()=>{document.removeEventListener("mousemove",oe),document.removeEventListener("mouseup",ge)}},[z,L,$,W,b]),re(()=>{if(!m||!p)return;let oe=ge=>{ge.key==="Escape"&&p()};return document.addEventListener("keydown",oe),()=>document.removeEventListener("keydown",oe)},[m,p]);let q=v(oe=>{x&&x()},[x]);if(h==="minimized")return null;let H=h==="maximized",j=X(()=>{let oe={position:"absolute",display:"flex",flexDirection:"column",border:"1px solid var(--window-border, #555555)",borderRadius:H?"0":"6px",overflow:"hidden",backgroundColor:"var(--window-body-bg, #1e1e1e)",boxShadow:m?"0 8px 32px rgba(0, 0, 0, 0.4)":"0 4px 16px rgba(0, 0, 0, 0.2)",transition:H?"all 200ms ease":"box-shadow 200ms ease",outline:"none"};return H?(oe.top="0",oe.left="0",oe.width="100%",oe.height="100%"):(oe.top=`${C}px`,oe.left=`${I}px`,oe.width=`${L}px`,oe.height=`${$}px`),c!==void 0&&(oe.zIndex=String(c)),E&&(oe.cursor="grabbing",oe.userSelect="none"),oe},[H,I,C,L,$,c,m,E]),G=X(()=>{let oe={display:"flex",alignItems:"center",padding:"0 8px",height:"32px",backgroundColor:"var(--window-title-bg, #2c2c2c)",color:"var(--window-title-text, #ffffff)",userSelect:"none",flexShrink:"0",cursor:u&&!H?"grab":"default",opacity:m?"1":"0.6"};return E&&(oe.cursor="grabbing"),oe},[m,u,H,E]),V={flex:"1",overflow:"auto",backgroundColor:"var(--window-body-bg, #1e1e1e)"},Z={width:"14px",height:"14px",borderRadius:"50%",border:"none",cursor:"pointer",padding:"0",marginLeft:"6px",fontSize:"0",lineHeight:"0",display:"inline-flex",alignItems:"center",justifyContent:"center"},te=[];r&&(r.startsWith("http")||r.startsWith("/")||r.startsWith("data:")?te.push(o("img",{src:r,alt:"",style:{width:"16px",height:"16px",marginRight:"6px",flexShrink:"0"},className:"draggable-window__icon"})):te.push(o("span",{style:{marginRight:"6px",fontSize:"14px",flexShrink:"0"},className:"draggable-window__icon"},r))),te.push(o("span",{className:"draggable-window__title-text",style:{flex:"1",fontSize:"13px",fontWeight:"500",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},n));let ae=o("div",{style:{display:"flex",alignItems:"center",flexShrink:"0"},className:"draggable-window__controls"},o("button",{type:"button","aria-label":"Minimize",className:"draggable-window__btn-minimize",style:{...Z,backgroundColor:"var(--window-button-minimize, #f39c12)"},onClick:oe=>{oe.stopPropagation(),f&&f()}}),o("button",{type:"button","aria-label":H?"Restore":"Maximize",className:"draggable-window__btn-maximize",style:{...Z,backgroundColor:"var(--window-button-maximize, #2ecc71)"},onClick:oe=>{oe.stopPropagation(),y&&y()}}),o("button",{type:"button","aria-label":"Close",className:"draggable-window__btn-close",style:{...Z,backgroundColor:"var(--window-button-close, #e74c3c)"},onClick:oe=>{oe.stopPropagation(),p&&p()}}));te.push(ae);let J=[];if(d&&!H){let oe=["n","s","e","w","ne","nw","se","sw"];for(let ge=0;ge<oe.length;ge++){let he=oe[ge],ee={position:"absolute",zIndex:"1"};he==="n"?(ee.top="0",ee.left=`${We}px`,ee.right=`${We}px`,ee.height=`${We}px`):he==="s"?(ee.bottom="0",ee.left=`${We}px`,ee.right=`${We}px`,ee.height=`${We}px`):he==="e"?(ee.top=`${We}px`,ee.right="0",ee.bottom=`${We}px`,ee.width=`${We}px`):he==="w"?(ee.top=`${We}px`,ee.left="0",ee.bottom=`${We}px`,ee.width=`${We}px`):he==="ne"?(ee.top="0",ee.right="0",ee.width=`${We}px`,ee.height=`${We}px`):he==="nw"?(ee.top="0",ee.left="0",ee.width=`${We}px`,ee.height=`${We}px`):he==="se"?(ee.bottom="0",ee.right="0",ee.width=`${We}px`,ee.height=`${We}px`):he==="sw"&&(ee.bottom="0",ee.left="0",ee.width=`${We}px`,ee.height=`${We}px`),ee.cursor=$c[he],J.push(o("div",{className:`draggable-window__resize-handle draggable-window__resize-${he}`,style:ee,onMouseDown:Q(he)}))}}let ie=null;if(w){let oe={position:"fixed",backgroundColor:"rgba(66, 133, 244, 0.2)",border:"2px solid rgba(66, 133, 244, 0.5)",borderRadius:"4px",zIndex:"999999",pointerEvents:"none",transition:"all 150ms ease"};w==="left"?(oe.top="0",oe.left="0",oe.width="50%",oe.height="100%"):w==="right"?(oe.top="0",oe.right="0",oe.width="50%",oe.height="100%"):w==="top"&&(oe.top="0",oe.left="0",oe.width="100%",oe.height="100%"),ie=o("div",{className:"draggable-window__snap-preview",style:oe})}let le=[];for(let oe=0;oe<J.length;oe++)le.push(J[oe]);le.push(o("div",{className:"draggable-window__title-bar",style:G,onMouseDown:Y,onDblClick:K,role:"toolbar","aria-label":`${n} window controls`},...te)),le.push(o("div",{className:"draggable-window__body",style:V},S));let fe=[o("div",{ref:P,id:`draggable-window-${t}`,className:`draggable-window ${m?"draggable-window--focused":"draggable-window--unfocused"} draggable-window--${h}`,style:j,role:"dialog","aria-label":n,tabIndex:-1,onMouseDown:q},...le)];return ie&&fe.push(ie),fe.length===1?fe[0]:o("div",{style:{display:"contents"}},...fe)}var Dc=["File","Edit","View","Insert","Format","Tools","Help"],Li={File:[{label:"New",action:"new"},{label:"Open",action:"open"},{label:"Save",action:"save"},{label:"Print",action:"print"}],Edit:[{label:"Undo",action:"undo"},{label:"Redo",action:"redo"},{label:"Cut",action:"cut"},{label:"Copy",action:"copy"},{label:"Paste",action:"paste"}],View:[{label:"Zoom In",action:"zoomIn"},{label:"Zoom Out",action:"zoomOut"},{label:"Full Screen",action:"fullScreen"}],Insert:[{label:"Image",action:"insertImage"},{label:"Table",action:"insertTable"},{label:"Link",action:"insertLink"}],Format:[{label:"Bold",action:"bold"},{label:"Italic",action:"italic"},{label:"Underline",action:"underline"}],Tools:[{label:"Word Count",action:"wordCount"},{label:"Spell Check",action:"spellCheck"}],Help:[{label:"About",action:"about"},{label:"Keyboard Shortcuts",action:"shortcuts"}]},zc=[{id:"bold",label:"Bold",text:"B",shortcut:"Ctrl+B",style:{fontWeight:"700"}},{id:"italic",label:"Italic",text:"I",shortcut:"Ctrl+I",style:{fontStyle:"italic"}},{id:"underline",label:"Underline",text:"U",shortcut:"Ctrl+U",style:{textDecoration:"underline"}}],Ac=[{label:"Align left",text:"\u2261",command:"justifyLeft"},{label:"Align center",text:"\u2263",command:"justifyCenter"},{label:"Align right",text:"\u2262",command:"justifyRight"}],Lc=["1","2","3","4","5","6","7"],Bc={1:"8",2:"10",3:"12",4:"14",5:"18",6:"24",7:"36"};function Fc(){let e=[];for(let t=0;t<=20;t++){let n=t%2===0;e.push(o("div",{key:String(t),style:{position:"absolute",left:`${t/20*100}%`,bottom:"0",width:"1px",height:n?"10px":"5px",backgroundColor:"#999"}})),n&&e.push(o("span",{key:`l${t}`,style:{position:"absolute",left:`${t/20*100}%`,top:"1px",fontSize:"8px",color:"#666",transform:"translateX(-50%)"}},String(t/2)))}return e}function Bi(e){return e.trim().split(/\s+/).filter(t=>t.length>0).length}function on(e){let[t,n]=U(!1),[r,i]=U(!1),[s,a]=U(!1),[l,d]=U(-1),[u,h]=U(""),[m,c]=U(-1),[p,f]=U(0),[y,x]=U("3"),g=ne(null),b=v(()=>{document.execCommand("bold",!1),n(V=>!V),g.current&&g.current.focus()},[]),S=v(()=>{document.execCommand("italic",!1),i(V=>!V),g.current&&g.current.focus()},[]),I=v(()=>{document.execCommand("underline",!1),a(V=>!V),g.current&&g.current.focus()},[]),A={bold:b,italic:S,underline:I},C={bold:t,italic:r,underline:s},T=v(V=>{document.execCommand(V,!1),g.current&&g.current.focus()},[]),L=v(V=>{document.execCommand("fontSize",!1,V),x(V),g.current&&g.current.focus()},[]),R=v(V=>{c(Z=>Z===V?-1:V)},[]),$=v(V=>{switch(V){case"undo":document.execCommand("undo",!1);break;case"redo":document.execCommand("redo",!1);break;case"cut":document.execCommand("cut",!1);break;case"copy":document.execCommand("copy",!1);break;case"paste":document.execCommand("paste",!1);break;case"bold":document.execCommand("bold",!1);break;case"italic":document.execCommand("italic",!1);break;case"underline":document.execCommand("underline",!1);break;case"print":typeof window<"u"&&window.print&&window.print();break;case"new":g.current&&(g.current.innerHTML="",f(0));break;default:break}c(-1),g.current&&g.current.focus()},[]),B=v(()=>{if(g.current){let V=g.current.textContent??"";f(Bi(V))}},[]),E=v(()=>{c(-1)},[]),N=X(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'"Segoe UI", Roboto, Arial, sans-serif',fontSize:"13px",color:"var(--color-text, #333)",backgroundColor:"#f0f0f0",overflow:"hidden"}),[]),z={display:"flex",alignItems:"center",height:"30px",backgroundColor:"var(--color-bg-subtle, #ffffff)",borderBottom:"1px solid var(--color-border, #d0d0d0)",padding:"0 8px",gap:"2px",flexShrink:"0",position:"relative"},k={display:"flex",alignItems:"center",height:"36px",backgroundColor:"var(--color-bg-subtle, #f8f9fa)",borderBottom:"1px solid var(--color-border, #d0d0d0)",padding:"0 12px",gap:"12px",flexShrink:"0"},w={height:"20px",backgroundColor:"#e8e8e8",borderBottom:"1px solid #ccc",position:"relative",flexShrink:"0",margin:"0 60px"},D={flex:"1",display:"flex",justifyContent:"center",alignItems:"flex-start",padding:"30px 40px",overflow:"auto",backgroundColor:"#e0e0e0",cursor:"text"},M={width:"680px",minHeight:"880px",backgroundColor:"#ffffff",boxShadow:"0 2px 12px rgba(0,0,0,0.18), 0 0 1px rgba(0,0,0,0.1)",padding:"72px 72px 96px 72px",boxSizing:"border-box",fontSize:"14px",lineHeight:"1.6",color:"#222",fontFamily:'"Times New Roman", Georgia, serif',cursor:"text",outline:"none"},F={height:"24px",backgroundColor:"var(--color-bg-subtle, #f0f0f0)",borderTop:"1px solid var(--color-border, #ccc)",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",fontSize:"11px",color:"#666",flexShrink:"0"},P=X(()=>Fc(),[]),W=e.content??"Start typing...",_=Bi(W),O=p>0?p:_;function Y(V){return{padding:"4px 10px",cursor:"pointer",borderRadius:"3px",fontSize:"13px",color:"var(--color-text, #333)",backgroundColor:m===V?"rgba(0,0,0,0.12)":l===V?"rgba(0,0,0,0.08)":"transparent",border:"none",lineHeight:"1",transition:"background 0.15s",position:"relative"}}let K={position:"absolute",top:"100%",left:"0",minWidth:"160px",backgroundColor:"#ffffff",border:"1px solid #d0d0d0",borderRadius:"4px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",zIndex:"1000"},Q={display:"block",width:"100%",padding:"6px 16px",fontSize:"13px",color:"#333",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"};function q(V,Z){return{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid transparent",borderRadius:"3px",cursor:"pointer",fontSize:"13px",backgroundColor:C[V]??!1?"rgba(0,0,0,0.12)":u===V?"rgba(0,0,0,0.06)":"transparent",color:"var(--color-text, #444)",transition:"background 0.15s",...Z??{}}}let H={display:"flex",alignItems:"center",padding:"2px 8px",border:"1px solid var(--color-border, #ccc)",borderRadius:"3px",fontSize:"12px",color:"var(--color-text, #444)",backgroundColor:"transparent",cursor:"default",height:"24px",gap:"4px"},j={padding:"2px 4px",border:"1px solid var(--color-border, #ccc)",borderRadius:"3px",fontSize:"12px",color:"var(--color-text, #444)",backgroundColor:"transparent",cursor:"pointer",height:"24px",outline:"none"},G=Dc.map((V,Z)=>{let te=[V];return m===Z&&Li[V]&&te.push(o("div",{key:"dropdown",style:K,className:"word-processor__menu-dropdown"},...Li[V].map((ae,J)=>o("button",{key:String(J),style:Q,onClick:ie=>{ie.stopPropagation(),$(ae.action)},role:"menuitem"},ae.label)))),o("button",{key:String(Z),style:Y(Z),role:"menuitem","aria-label":V,onClick:()=>R(Z),onMouseEnter:()=>{d(Z)},onMouseLeave:()=>d(-1)},...te)});return o("div",{className:`word-processor ${e.className??""}`.trim(),style:N},o("div",{className:"word-processor__menu-bar",style:z,role:"menubar"},...G),o("div",{className:"word-processor__toolbar",style:k,role:"toolbar","aria-label":"Formatting toolbar"},o("div",{style:H,"aria-label":"Font family"},o("span",null,"Arial"),o("span",{style:{fontSize:"10px",color:"#999"}},"\u25BC")),o("div",{key:"0",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},...zc.map(V=>o("button",{key:V.id,style:q(V.id,V.style),title:V.shortcut?`${V.label} (${V.shortcut})`:V.label,"aria-label":V.label,"aria-pressed":String(C[V.id]??!1),onClick:A[V.id],onMouseEnter:()=>h(V.id),onMouseLeave:()=>h("")},V.text))),o("div",{key:"1",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px",alignItems:"center"}},o("select",{style:j,"aria-label":"Font size",value:y,onChange:V=>{let Z=V.target;L(Z.value)}},...Lc.map(V=>o("option",{key:V,value:V},Bc[V])))),o("div",{key:"2",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},...Ac.map((V,Z)=>o("button",{key:String(Z),style:q(`align-${Z}`),title:V.label,"aria-label":V.label,onClick:()=>T(V.command),onMouseEnter:()=>h(`align-${Z}`),onMouseLeave:()=>h("")},V.text)))),o("div",{className:"word-processor__ruler",style:w,"aria-hidden":"true"},...P),o("main",{className:"word-processor__document-area",style:D,onClick:E},o("div",{className:"word-processor__page",style:M,contentEditable:"true",ref:g,onInput:B,suppressContentEditableWarning:!0},W)),o("div",{className:"word-processor__status-bar",style:F},o("span",null,"Page 1 of 1"),o("span",null,`${O} words`),o("span",null,"100%")))}function rn(e){let t=X(()=>({height:"30px",backgroundColor:"#323233",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",color:"#999",flexShrink:"0",borderBottom:"1px solid var(--color-border, #252526)"}),[]),n=e.style?{...t,...e.style}:t;return o("div",{className:"ide__title-bar",style:n},e.title)}var Nc={height:"28px",backgroundColor:"#3c3c3c",display:"flex",alignItems:"center",padding:"0 8px",gap:"2px",flexShrink:"0",position:"relative"},Fi={padding:"3px 8px",fontSize:"12px",color:"#cccccc",cursor:"pointer",borderRadius:"3px",backgroundColor:"transparent",border:"none",position:"relative"},Wc={...Fi,backgroundColor:"rgba(255,255,255,0.1)"},_c={position:"absolute",top:"100%",left:"0",minWidth:"180px",backgroundColor:"#2d2d2d",border:"1px solid #454545",borderRadius:"4px",boxShadow:"0 4px 12px rgba(0,0,0,0.4)",padding:"4px 0",zIndex:"1000"},Oc={display:"block",width:"100%",padding:"6px 16px",fontSize:"12px",color:"#cccccc",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"};function sn(e){let[t,n]=U(-1),r=v(a=>{n(l=>l===a?-1:a)},[]),i=v(a=>{e.onAction(a),n(-1)},[e.onAction]),s=e.menus.map((a,l)=>{let d=[a],u=t===l;return u&&e.menuItems[a]&&d.push(o("div",{key:"dropdown",style:_c,className:"ide__menu-dropdown"},...e.menuItems[a].map((h,m)=>o("button",{key:String(m),style:Oc,onClick:c=>{c.stopPropagation(),i(h.action)},role:"menuitem"},h.label)))),o("button",{key:String(l),style:u?Wc:Fi,role:"menuitem","aria-label":a,onClick:()=>r(l)},...d)});return o("div",{className:"ide__menu-bar",style:Nc,role:"menubar"},...s)}var Hc={width:"220px",backgroundColor:"#252526",borderRight:"none",display:"flex",flexDirection:"column",flexShrink:"0",overflowY:"auto"},Yc={padding:"8px 12px",fontSize:"11px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#bbbbbb"};function Vc(e,t,n){return{padding:"3px 8px",paddingLeft:`${12+e*16}px`,fontSize:"13px",cursor:"pointer",color:t?"#cccccc":"#d4d4d4",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",borderRadius:"3px",margin:"0 4px",transition:"background-color 0.1s",backgroundColor:n?"rgba(255,255,255,0.08)":"transparent"}}function an(e){let t=i=>{if(!i.parent)return!0;if(!e.expandedFolders[i.parent])return!1;let s=e.files.find(a=>a.name===i.parent&&a.isFolder);return s?t(s):!0},r=e.files.map((i,s)=>{if(!t(i))return null;let a=!i.isFolder&&i.name===e.activeFile,l=i.isFolder?e.expandedFolders[i.name]?"\u{1F4C2} ":"\u{1F4C1} ":"\u{1F4C4} ";return o("div",{key:String(s),style:Vc(i.indent,i.isFolder,a),onClick:i.isFolder?()=>e.onFolderToggle(i.name):()=>e.onFileClick(i.name)},l,i.name)}).filter(i=>i!==null);return o("nav",{className:"ide__sidebar",style:Hc,"aria-label":"File explorer"},o("div",{style:Yc},"Explorer"),...r)}var Uc={height:"35px",backgroundColor:"#252526",display:"flex",alignItems:"center",flexShrink:"0"},jc={padding:"0 16px",height:"35px",lineHeight:"35px",backgroundColor:"#1e1e1e",color:"#ffffff",fontSize:"13px",cursor:"pointer",border:"none",borderBottom:"2px solid #007acc",boxSizing:"border-box"},Gc={padding:"0 16px",height:"35px",lineHeight:"35px",backgroundColor:"#2d2d2d",color:"#999999",fontSize:"13px",cursor:"pointer",border:"none",borderBottom:"2px solid transparent",boxSizing:"border-box"};function ln(e){let t=e.tabs.map((n,r)=>{let i=n===e.activeTab;return o("button",{key:String(r),style:i?jc:Gc,"aria-label":n,onClick:()=>e.onTabClick(n)},n)});return o("div",{style:Uc},...t)}var cn="#569cd6",ro="#ce9178",io="#4ec9b0",so="#6a9955",ao="#dcdcaa",Lt="#d4d4d4",lo="#d4d4d4",co="#b5cea8",Xc=new Set(["import","export","from","const","let","var","function","return","if","else","for","while","class","new","throw","try","catch","finally","typeof","instanceof","in","of","default","switch","case","break","continue","do","void","delete","yield","async","await"]),Kc=new Set(["string","number","boolean","void","null","undefined","any","never","unknown","object","interface","type","enum"]);function dn(e){if(!e.trim())return[{text:"\xA0",color:Lt}];let t=[],n=0;for(;n<e.length;){if(e[n]==="/"&&e[n+1]==="/"){t.push({text:e.slice(n),color:so});break}if(e[n]==='"'||e[n]==="'"||e[n]==="`"){let r=e[n],i=n+1;for(;i<e.length&&e[i]!==r;)e[i]==="\\"&&i++,i++;i=Math.min(i+1,e.length),t.push({text:e.slice(n,i),color:ro}),n=i;continue}if(/[0-9]/.test(e[n])&&(n===0||/[\s(,=:[\]{}+\-*/]/.test(e[n-1]))){let r=n;for(;r<e.length&&/[0-9.]/.test(e[r]);)r++;t.push({text:e.slice(n,r),color:co}),n=r;continue}if(/[a-zA-Z_$]/.test(e[n])){let r=n;for(;r<e.length&&/[a-zA-Z0-9_$]/.test(e[r]);)r++;let i=e.slice(n,r),s=r;for(;s<e.length&&e[s]===" ";)s++;let a=s<e.length&&e[s]==="(",l=Lt;Xc.has(i)?l=cn:Kc.has(i)?l=io:a?l=ao:(i==="true"||i==="false")&&(l=cn),t.push({text:i,color:l}),n=r;continue}if(e[n]===" "||e[n]===" "){let r=n;for(;r<e.length&&(e[r]===" "||e[r]===" ");)r++;t.push({text:e.slice(n,r),color:Lt}),n=r;continue}t.push({text:e[n],color:lo}),n++}return t}var qc={flex:"1",display:"flex",overflow:"auto",backgroundColor:"#1e1e1e",fontFamily:'"Cascadia Code", "Fira Code", "Consolas", monospace',fontSize:"13px",lineHeight:"20px"},Zc={padding:"8px 0",textAlign:"right",color:"#858585",userSelect:"none",minWidth:"48px",paddingRight:"12px",paddingLeft:"12px",flexShrink:"0"},Jc={padding:"8px 0",flex:"1",whiteSpace:"pre",overflowX:"auto",outline:"none",color:"#d4d4d4"};function un(e){let t=e.content.map((r,i)=>{let s=dn(r),a=[],l=0;for(let d of s)a.push(o("span",{key:String(l++),style:{color:d.color}},d.text));return o("div",{key:String(i),style:{minHeight:"20px"}},...a)}),n=[];for(let r=0;r<e.content.length;r++)n.push(o("div",{key:String(r)},String(r+1)));return o("div",{style:qc},o("div",{style:Zc,"aria-hidden":"true"},...n),o("code",{style:Jc,contentEditable:"true",ref:e.editorRef,onInput:e.onInput,suppressContentEditableWarning:!0},...t))}var Qc={width:"60px",backgroundColor:"#1e1e1e",borderLeft:"1px solid var(--color-border, #252526)",flexShrink:"0",padding:"8px 4px",display:"flex",flexDirection:"column",gap:"2px",position:"relative"};function pn(e){return o("div",{className:"ide__minimap",style:Qc,"aria-hidden":"true"},o("div",{style:{position:"absolute",top:`${e.visibleStart}px`,left:"0",right:"0",height:`${e.visibleEnd}px`,backgroundColor:"rgba(100, 100, 200, 0.15)",border:"1px solid rgba(100, 100, 200, 0.3)",borderRadius:"2px",pointerEvents:"none"}}),...e.lines.map((t,n)=>o("div",{key:String(n),style:{height:"2px",backgroundColor:t.trim()?"#555555":"transparent",borderRadius:"1px",width:`${Math.min(100,t.length*2)}%`}})))}var ed={height:"22px",backgroundColor:"#007acc",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 12px",fontSize:"12px",color:"#ffffff",flexShrink:"0"},td={cursor:"pointer",padding:"0 6px",borderRadius:"3px",transition:"background-color 0.15s"};function fn(e){let t=n=>n.map((r,i)=>o("span",{key:String(i),style:td,onClick:r.onClick},r.label));return o("div",{className:"ide__status-bar",style:ed},o("div",{style:{display:"flex",gap:"16px"}},...t(e.items)),o("div",{style:{display:"flex",gap:"16px"}},...t(e.rightItems)))}var nd=["File","Edit","Selection","View","Go","Run","Terminal","Help"],od={File:[{label:"New File",action:"newFile"},{label:"Open",action:"open"},{label:"Save",action:"save"},{label:"Save As",action:"saveAs"}],Edit:[{label:"Undo",action:"undo"},{label:"Redo",action:"redo"},{label:"Cut",action:"cut"},{label:"Copy",action:"copy"},{label:"Paste",action:"paste"}],View:[{label:"Command Palette",action:"commandPalette"},{label:"Explorer",action:"explorer"},{label:"Search",action:"search"}]},rd=[{name:"src",indent:0,isFolder:!0},{name:"components",indent:1,isFolder:!0,parent:"src"},{name:"App.ts",indent:2,isFolder:!1,parent:"components"},{name:"Header.ts",indent:2,isFolder:!1,parent:"components"},{name:"hooks",indent:1,isFolder:!0,parent:"src"},{name:"useAuth.ts",indent:2,isFolder:!1,parent:"hooks"},{name:"index.ts",indent:1,isFolder:!1,parent:"src"},{name:"main.ts",indent:1,isFolder:!1,parent:"src"},{name:"types.ts",indent:1,isFolder:!1,parent:"src"},{name:"package.json",indent:0,isFolder:!1},{name:"tsconfig.json",indent:0,isFolder:!1}],uo={"App.ts":['import { createElement, useState } from "specifyjs";',"","interface AppProps {"," title: string;"," version?: number;","}","","export function App(props: AppProps) {"," const [count, setCount] = useState(0);",""," const increment = () => {"," setCount((prev: number) => prev + 1);"," };",""," return createElement(",' "div",',' { className: "app" },',' createElement("h1", null, props.title),',' createElement("p", null, `Count: ${count}`),'," createElement(",' "button",'," { onClick: increment },",' "Increment",'," ),"," );","}"],"Header.ts":['import { createElement } from "specifyjs";',"","interface HeaderProps {"," title: string;"," subtitle?: string;","}","","export function Header(props: HeaderProps) {"," return createElement(",' "header",',' { className: "header" },',' createElement("h1", null, props.title),'," props.subtitle",' ? createElement("p", null, props.subtitle)'," : null,"," );","}"],"useAuth.ts":['import { useState, useCallback } from "specifyjs";',"","interface AuthState {"," user: string | null;"," isLoggedIn: boolean;","}","","export function useAuth() {"," const [auth, setAuth] = useState<AuthState>({"," user: null,"," isLoggedIn: false,"," });",""," const login = useCallback((username: string) => {"," setAuth({ user: username, isLoggedIn: true });"," }, []);",""," const logout = useCallback(() => {"," setAuth({ user: null, isLoggedIn: false });"," }, []);",""," return { ...auth, login, logout };","}"],"index.ts":['export { App } from "./components/App";','export { Header } from "./components/Header";','export { useAuth } from "./hooks/useAuth";'],"main.ts":['import { createElement, createRoot } from "specifyjs";','import { App } from "./components/App";',"","const root = createRoot(",' document.getElementById("root")!',");","","root.render("," createElement(App, {",' title: "My SpecifyJS App",'," version: 1,"," }),",");"],"types.ts":["export interface User {"," id: string;"," name: string;"," email: string;",' role: "admin" | "user" | "guest";',"}","","export interface Config {"," apiUrl: string;"," debug: boolean;"," maxRetries: number;","}","","export type EventHandler<T = void> = (event: T) => void;"],"package.json":["{",' "name": "specifyjs-app",',' "version": "1.0.0",',' "scripts": {',' "dev": "vite",',' "build": "tsc && vite build",',' "preview": "vite preview"'," }","}"],"tsconfig.json":["{",' "compilerOptions": {',' "target": "ES2020",',' "module": "ESNext",',' "strict": true,',' "jsx": "preserve"'," },",' "include": ["src"]',"}"]},Ni=uo["App.ts"];function mn(e){let[t,n]=U("App.ts"),[r,i]=U({src:!0,components:!0,hooks:!0}),[s,a]=U(Ni.length),l=ne(null),d=v(S=>{n(S);let I=uo[S];I&&a(I.length)},[]),u=v(S=>{i(I=>{let A={},C=Object.keys(I);for(let T=0;T<C.length;T++)A[C[T]]=I[C[T]];return A[S]=!I[S],A})},[]),h=v(S=>{switch(S){case"undo":document.execCommand("undo",!1);break;case"redo":document.execCommand("redo",!1);break;case"cut":document.execCommand("cut",!1);break;case"copy":document.execCommand("copy",!1);break;case"paste":document.execCommand("paste",!1);break;case"newFile":l.current&&(l.current.textContent="",a(1));break;default:break}l.current&&l.current.focus()},[]),m=v(()=>{if(l.current){let I=(l.current.textContent??"").split(`
|
|
8
|
+
`);a(Math.max(I.length,1))}},[]),c=X(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'"Segoe UI", Roboto, Arial, sans-serif',fontSize:"13px",color:"#cccccc",backgroundColor:"#1e1e1e",overflow:"hidden"}),[]),p={flex:"1",display:"flex",overflow:"hidden"},f={width:"1px",backgroundColor:"#007acc",cursor:"col-resize",flexShrink:"0",opacity:"0.4",transition:"opacity 0.2s"},y={flex:"1",display:"flex",flexDirection:"column",overflow:"hidden"},x=8,g=30,b=uo[t]??Ni;return o("div",{className:`ide ${e.className??""}`.trim(),style:c},o(rn,{title:"SpecifyJS IDE"}),o(sn,{menus:nd,menuItems:od,onAction:h}),o("div",{style:p},o(an,{files:rd,activeFile:t,expandedFolders:r,onFileClick:d,onFolderToggle:u}),o("div",{style:f}),o("div",{style:y},o(ln,{tabs:[t],activeTab:t,onTabClick:d}),o(un,{content:b,onInput:m,editorRef:l})),o(pn,{lines:b,visibleStart:x,visibleEnd:g,totalLines:b.length})),o(fn,{items:[{label:"\u2387 main"},{label:"0 errors"},{label:"0 warnings"}],rightItems:[{label:"Ln 1, Col 1"},{label:"UTF-8"},{label:"TypeScript"}]}))}var id=[{symbol:"AAPL",price:189.42,change:1.23,volume:523e5,spark:[186,187,188,187,189]},{symbol:"GOOGL",price:141.8,change:-.87,volume:231e5,spark:[143,142,141,142,141]},{symbol:"MSFT",price:378.91,change:2.45,volume:187e5,spark:[375,376,378,377,379]},{symbol:"AMZN",price:185.63,change:-1.12,volume:314e5,spark:[187,186,186,185,185]},{symbol:"TSLA",price:248.5,change:3.78,volume:672e5,spark:[244,245,247,246,249]},{symbol:"NVDA",price:875.3,change:12.5,volume:418e5,spark:[860,865,870,868,876]}],Wi=[{price:189.4,qty:1200},{price:189.38,qty:3400},{price:189.35,qty:800},{price:189.32,qty:5600},{price:189.3,qty:2100},{price:189.28,qty:4300}],_i=[{price:189.44,qty:900},{price:189.47,qty:2200},{price:189.5,qty:1500},{price:189.53,qty:3800},{price:189.55,qty:1100},{price:189.58,qty:2700}],Oi=[{symbol:"AAPL",qty:100,avgPrice:185.2,currentPrice:189.42,pnl:422},{symbol:"MSFT",qty:50,avgPrice:382.1,currentPrice:378.91,pnl:-159.5},{symbol:"NVDA",qty:25,avgPrice:850,currentPrice:875.3,pnl:632.5}],sd=[{time:"14:32:01",symbol:"AAPL",side:"BUY",qty:50,price:189.42},{time:"14:31:45",symbol:"MSFT",side:"SELL",qty:25,price:378.95},{time:"14:30:22",symbol:"TSLA",side:"BUY",qty:100,price:247.8},{time:"14:29:58",symbol:"NVDA",side:"BUY",qty:10,price:874.5},{time:"14:28:33",symbol:"GOOGL",side:"SELL",qty:75,price:142.1}],ad=[185.2,186.1,185.8,187.5,188.2,187.9,186.5,187.8,188.4,189.1,188.6,187.2,188.5,189.8,189.2,188.9,189.5,190.1,189.4,188.8,189.6,190.3,189.9,189.42],Hi=[{price:189.4,volume:1200},{price:189.35,volume:3400},{price:189.3,volume:2800},{price:189.25,volume:5100},{price:189.2,volume:4200}],Yi=[{price:189.45,volume:900},{price:189.5,volume:2600},{price:189.55,volume:1800},{price:189.6,volume:4400},{price:189.65,volume:3100}],Vi=["09:30","10:00","10:30","11:00","11:30","12:00"];function ld(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function Bt(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function Ge(e){return e.toFixed(2)}var Ct={backgroundColor:"#1a1a2e",borderRadius:"4px",padding:"12px",border:"1px solid #2a2a4a",overflow:"auto",display:"flex",flexDirection:"column"},Mt={fontSize:"12px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#8888aa",marginBottom:"8px",flexShrink:"0"},gn={width:"100%",borderCollapse:"collapse",fontSize:"12px"},Oe={textAlign:"left",padding:"4px 6px",borderBottom:"1px solid #2a2a4a",color:"#8888aa",fontWeight:"600",fontSize:"11px"},He={padding:"3px 6px",borderBottom:"1px solid #16162a",color:"#ccccdd",fontSize:"12px"},hn={cursor:"default",transition:"background-color 0.1s"};function cd(e,t){let i=Math.min(...e),a=Math.max(...e)-i||1,l=e.map((u,h)=>{let m=h/(e.length-1)*40,c=14-(u-i)/a*14;return`${m.toFixed(1)},${c.toFixed(1)}`}).join(" ");return o("svg",{viewBox:"0 0 40 14",style:{width:"40px",height:"14px",display:"inline-block",verticalAlign:"middle",marginLeft:"4px"},"aria-hidden":"true"},o("polyline",{points:l,fill:"none",stroke:t?"#00c853":"#ff1744",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))}function dd(e,t){let u=Math.min(...e),h=Math.max(...e),m=h-u||1,c=310/(e.length-1),p=e.map((C,T)=>{let L=40+T*c,R=15+(1-(C-u)/m)*120;return{x:L,y:R}}),f=p.map(C=>`${C.x.toFixed(1)},${C.y.toFixed(1)}`).join(" "),y="M40,135 "+p.map(C=>`L${C.x.toFixed(1)},${C.y.toFixed(1)}`).join(" ")+` L${p[p.length-1].x.toFixed(1)},135 Z`,x=[];for(let C=1;C<e.length;C++){let T=e[C]>=e[C-1]?"#00c853":"#ff1744";x.push(o("line",{key:String(C),x1:String(p[C-1].x.toFixed(1)),y1:String(p[C-1].y.toFixed(1)),x2:String(p[C].x.toFixed(1)),y2:String(p[C].y.toFixed(1)),stroke:T,strokeWidth:"2",strokeLinecap:"round"}))}let g=[];for(let C=0;C<5;C++){let T=15+C/4*120,L=h-C/4*m;g.push(o("line",{key:`g${C}`,x1:String(40),y1:String(T.toFixed(1)),x2:String(350),y2:String(T.toFixed(1)),stroke:"#2a2a4a",strokeWidth:"0.5",strokeDasharray:"3,3"})),g.push(o("text",{key:`yl${C}`,x:String(36),y:String((T+3).toFixed(1)),fill:"#6666aa",fontSize:"8",textAnchor:"end",fontFamily:"monospace"},Ge(L)))}let b=[],S=Math.min(Vi.length,e.length),I=(e.length-1)/(S-1);for(let C=0;C<S;C++){let L=40+Math.round(C*I)*c;b.push(o("text",{key:`tl${C}`,x:String(L.toFixed(1)),y:String(156),fill:"#6666aa",fontSize:"8",textAnchor:"middle",fontFamily:"monospace"},Vi[C]))}let A="chartGrad";return o("div",{style:Ct},o("div",{style:Mt},"AAPL ",o("span",{style:{color:"#00c853",fontSize:"14px",fontWeight:"700"}},`$${Ge(t)}`),o("span",{style:{color:"#00c853",fontSize:"11px",marginLeft:"8px"}},"+1.23%")),o("svg",{viewBox:"0 0 360 160",style:{width:"100%",flex:"1",minHeight:"0"},"aria-label":"Price chart",role:"img"},o("defs",null,o("linearGradient",{id:A,x1:"0",y1:"0",x2:"0",y2:"1"},o("stop",{offset:"0%",stopColor:"#00c853",stopOpacity:"0.3"}),o("stop",{offset:"100%",stopColor:"#00c853",stopOpacity:"0.02"}))),o("path",{d:y,fill:`url(#${A})`}),...g,...b,...x,o("line",{x1:String(40),y1:String((15+(1-(t-u)/m)*120).toFixed(1)),x2:String(350),y2:String((15+(1-(t-u)/m)*120).toFixed(1)),stroke:"#00c853",strokeWidth:"0.5",strokeDasharray:"4,2",opacity:"0.6"})))}function ud(){let e=Math.max(...Wi.map(t=>t.qty),..._i.map(t=>t.qty));return o("div",{style:Ct},o("div",{style:Mt},"Order Book"),o("table",{style:gn},o("thead",null,o("tr",null,o("th",{style:Oe},"Bid Price"),o("th",{style:Oe},"Qty"),o("th",{style:Oe},"Ask Price"),o("th",{style:Oe},"Qty"))),o("tbody",null,...Wi.map((t,n)=>{let r=_i[n],i=t.qty/e*.25,s=(r?.qty??0)/e*.25;return o("tr",{key:String(n),style:hn},o("td",{style:{...He,color:"#00c853",backgroundColor:`rgba(0,200,83,${i.toFixed(3)})`,fontFamily:"monospace"}},Ge(t.price)),o("td",{style:{...He,backgroundColor:`rgba(0,200,83,${(i*.5).toFixed(3)})`,fontFamily:"monospace"}},Bt(t.qty)),o("td",{style:{...He,color:"#ff1744",backgroundColor:`rgba(255,23,68,${s.toFixed(3)})`,fontFamily:"monospace"}},r?Ge(r.price):""),o("td",{style:{...He,backgroundColor:`rgba(255,23,68,${(s*.5).toFixed(3)})`,fontFamily:"monospace"}},r?Bt(r.qty):""))}))))}function pd(e){return o("div",{style:Ct},o("div",{style:Mt},"Watchlist"),o("table",{style:gn},o("thead",null,o("tr",null,o("th",{style:Oe},"Symbol"),o("th",{style:Oe},"Price"),o("th",{style:Oe},"Chg%"),o("th",{style:Oe},"Volume"))),o("tbody",null,...id.map((t,n)=>{let r=t.price+(n===0?e:0),i=t.change>=0;return o("tr",{key:String(n),style:hn},o("td",{style:{...He,fontWeight:"600",color:"#ffffff"}},t.symbol,cd(t.spark,i)),o("td",{style:{...He,fontFamily:"monospace"}},Ge(r)),o("td",{style:{...He,color:i?"#00c853":"#ff1744",fontWeight:"600"}},`${i?"+":""}${Ge(t.change)}%`),o("td",{style:{...He,fontFamily:"monospace",color:"#8888aa"}},ld(t.volume)))}))))}function fd(){let e=Oi.reduce((n,r)=>n+r.pnl,0),t=e>=0;return o("div",{style:Ct},o("div",{style:Mt},"Positions",o("span",{style:{marginLeft:"12px",color:t?"#00c853":"#ff1744",fontWeight:"700",fontSize:"12px"}},`${t?"+":""}$${Ge(e)}`)),o("table",{style:gn},o("thead",null,o("tr",null,o("th",{style:Oe},"Symbol"),o("th",{style:Oe},"Qty"),o("th",{style:Oe},"Avg"),o("th",{style:Oe},"P&L"))),o("tbody",null,...Oi.map((n,r)=>{let i=n.pnl>=0;return o("tr",{key:String(r),style:{...hn,backgroundColor:i?"rgba(0,200,83,0.04)":"rgba(255,23,68,0.04)"}},o("td",{style:{...He,fontWeight:"600",color:"#ffffff"}},n.symbol),o("td",{style:{...He,fontFamily:"monospace"}},String(n.qty)),o("td",{style:{...He,fontFamily:"monospace"}},Ge(n.avgPrice)),o("td",{style:{...He,color:i?"#00c853":"#ff1744",fontWeight:"700",fontFamily:"monospace"}},`${i?"+":""}$${Ge(n.pnl)}`))}))))}function md(){return o("div",{style:Ct},o("div",{style:Mt},"Recent Trades"),o("table",{style:gn},o("thead",null,o("tr",null,o("th",{style:Oe},"Time"),o("th",{style:Oe},"Sym"),o("th",{style:Oe},"Side"),o("th",{style:Oe},"Qty"),o("th",{style:Oe},"Price"))),o("tbody",null,...sd.map((e,t)=>{let n=e.side==="BUY";return o("tr",{key:String(t),style:hn},o("td",{style:{...He,color:"#8888aa",fontFamily:"monospace"}},e.time),o("td",{style:{...He,fontWeight:"600",color:"#ffffff"}},e.symbol),o("td",{style:{...He,color:n?"#00c853":"#ff1744",fontWeight:"600"}},e.side),o("td",{style:{...He,fontFamily:"monospace"}},Bt(e.qty)),o("td",{style:{...He,fontFamily:"monospace"}},Ge(e.price)))}))))}function gd(){let e=Math.max(...Hi.map(n=>n.volume),...Yi.map(n=>n.volume)),t="16px";return o("div",{style:Ct},o("div",{style:Mt},"Market Depth"),o("div",{style:{flex:"1",display:"flex",flexDirection:"column",gap:"2px",justifyContent:"center"}},...Hi.map((n,r)=>o("div",{key:`b${r}`,style:{display:"flex",alignItems:"center",gap:"6px"}},o("span",{style:{width:"52px",fontSize:"11px",color:"#8888aa",textAlign:"right",fontFamily:"monospace"}},Ge(n.price)),o("div",{style:{height:t,width:`${n.volume/e*100}%`,backgroundColor:"#00c853",opacity:"0.6",borderRadius:"2px",maxWidth:"60%",transition:"width 0.3s"}}),o("span",{style:{fontSize:"11px",color:"#ccccdd",fontFamily:"monospace"}},Bt(n.volume)))),o("div",{style:{height:"1px",backgroundColor:"#2a2a4a",margin:"4px 0"}}),...Yi.map((n,r)=>o("div",{key:`a${r}`,style:{display:"flex",alignItems:"center",gap:"6px"}},o("span",{style:{width:"52px",fontSize:"11px",color:"#8888aa",textAlign:"right",fontFamily:"monospace"}},Ge(n.price)),o("div",{style:{height:t,width:`${n.volume/e*100}%`,backgroundColor:"#ff1744",opacity:"0.6",borderRadius:"2px",maxWidth:"60%",transition:"width 0.3s"}}),o("span",{style:{fontSize:"11px",color:"#ccccdd",fontFamily:"monospace"}},Bt(n.volume))))))}function bn(e){let[t,n]=U(0),[r,i]=U("--:--:--"),[s,a]=U(!0);re(()=>{let p=setInterval(()=>{n(f=>{let y=(Math.random()-.5)*.5;return Math.round(y*100)/100})},2e3);return()=>clearInterval(p)},[]),re(()=>{let p=()=>{let y=new Date,x=String(y.getHours()).padStart(2,"0"),g=String(y.getMinutes()).padStart(2,"0"),b=String(y.getSeconds()).padStart(2,"0");i(`${x}:${g}:${b}`)};p();let f=setInterval(p,1e3);return()=>clearInterval(f)},[]),re(()=>{let p=setInterval(()=>{a(f=>!f)},800);return()=>clearInterval(p)},[]);let l=X(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'"Inter", "Segoe UI", Roboto, sans-serif',fontSize:"13px",color:"#ccccdd",backgroundColor:"#0d0d1a",overflow:"hidden"}),[]),d={height:"40px",backgroundColor:"#12122a",borderBottom:"1px solid #2a2a4a",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",flexShrink:"0"},u={fontSize:"14px",fontWeight:"700",color:"#ffffff",letterSpacing:"0.5px",display:"flex",alignItems:"center",gap:"8px"},h={flex:"1",display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gridTemplateRows:"1fr 1fr",gap:"8px",padding:"8px",overflow:"hidden"},m=189.42+t,c={width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"#00c853",display:"inline-block",marginRight:"4px",opacity:s?"1":"0.3",transition:"opacity 0.3s"};return o("div",{className:`trading-dashboard ${e.className??""}`.trim(),style:l},o("header",{className:"trading-dashboard__header",style:d},o("span",{style:u},"SpecifyJS Trading Platform",o("span",{style:{display:"flex",alignItems:"center",fontSize:"11px",color:"#00c853",fontWeight:"600",marginLeft:"8px"}},o("span",{style:c}),"LIVE")),o("div",{style:{display:"flex",alignItems:"center",gap:"16px",fontSize:"12px"}},o("span",{style:{color:"#ffffff",fontFamily:"monospace",fontWeight:"600",fontSize:"13px"}},r),o("span",{style:{color:"#8888aa"}},"Account: SJS-28401"),o("span",{style:{color:"#00c853"}},"Balance: $124,582.30"),o("span",{style:{color:"#8888aa"}},"Status: Connected"))),o("div",{className:"trading-dashboard__grid",style:h},dd(ad,m),ud(),pd(t),fd(),md(),gd()))}function Le(e){return e.type==="card"}function $e(e){return e.type==="container"}function qe(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function Xe(e){return Le(e)?e.card_id:e.container_id}function po(e){return Le(e)?e.card_title:e.name}var fo={low:"#22c55e",medium:"#f59e0b",high:"#f97316",critical:"#ef4444"},Ft=[{label:"Text",value:"text"},{label:"JSON",value:"json"},{label:"Task",value:"task"},{label:"Project",value:"project"}];function hd(e){let t=e.content;return o("div",{style:{fontSize:"12px",color:"#555555",lineHeight:"1.4",overflow:"hidden",flex:"1"},"data-testid":`card-text-content-${e.card_id}`},t.text||"")}function bd(e){let t=e.content,r=Object.entries(t).map(([i,s],a)=>o("div",{key:String(a),style:{display:"flex",gap:"4px",fontSize:"11px",lineHeight:"1.6",borderBottom:"1px solid rgba(0,0,0,0.05)",padding:"2px 0"}},o("span",{style:{fontWeight:"600",color:"#374151",minWidth:"60px"}},`${i}:`),o("span",{style:{color:"#555555"}},String(s??""))));return o("div",{style:{flex:"1",overflow:"auto"},"data-testid":`card-json-content-${e.card_id}`},...r)}function xd(e){return o("div",{style:{fontSize:"12px",color:"#9ca3af",fontStyle:"italic",flex:"1",display:"flex",alignItems:"center",justifyContent:"center"},"data-testid":`card-task-content-${e.card_id}`},"Task card (coming soon)")}function yd(e,t){let n=e.content;return o("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:"4px 16px",borderRadius:"999px",backgroundColor:e.color||"#e0e7ff",fontSize:"13px",fontWeight:"600",color:"#1e3a5f",cursor:"pointer",flex:"1"},onDblClick:r=>{r.preventDefault(),r.stopPropagation(),t&&n.project_id&&t(n.project_id)},"data-testid":`card-project-content-${e.card_id}`},n.project_name||"Untitled Project")}function xn(e){let{card:t,selected:n=!1,onSelect:r,onMove:i,onResize:s,onDelete:a,dispatch:l,onOpenProject:d,onCardContextMenu:u,onUpdate:h,onDragStart:m,onDragEnd:c,onAnchorDragStart:p}=e,[f,y]=U(!1),[x,g]=U(!1),[b,S]=U(null),[I,A]=U(!1),[C,T]=U(!1),[L,R]=U(!1),[$,B]=U(t.card_title||""),[E,N]=U(""),z=ne(null),k=ne(null),w=t.priority?fo[t.priority]||"#94a3b8":"transparent",D=v(ce=>{let be=ce;be.preventDefault(),be.stopPropagation(),S({x:be.clientX,y:be.clientY}),A(!1),u&&u(t.card_id,{x:be.clientX,y:be.clientY})},[u,t.card_id]),M=v(()=>{S(null),A(!1)},[]),F=v(ce=>{let be=ce,Ee=be.target;if(Ee.dataset&&(Ee.dataset.role==="delete"||Ee.dataset.role==="resize"||Ee.dataset.role==="drag-handle"||Ee.dataset.role==="inline-edit"||Ee.dataset.role==="anchor"))return;be.preventDefault(),be.stopPropagation(),r&&r(t.card_id),z.current={x:be.clientX,y:be.clientY,cardX:t.position.x,cardY:t.position.y},m&&m(t.card_id),g(!0);let Re=se=>{let pe=se;if(!z.current)return;let Se=pe.clientX-z.current.x,we=pe.clientY-z.current.y;i&&i(t.card_id,{x:z.current.cardX+Se,y:z.current.cardY+we})},Ne=()=>{z.current=null,g(!1),c&&c(t.card_id),document.removeEventListener("mousemove",Re),document.removeEventListener("mouseup",Ne)};document.addEventListener("mousemove",Re),document.addEventListener("mouseup",Ne)},[t.card_id,t.position.x,t.position.y,r,i,m,c]),P=v(ce=>{let be=ce;be.preventDefault(),be.stopPropagation(),k.current={x:be.clientX,y:be.clientY,w:t.size.width,h:t.size.height};let Ee=Ne=>{let se=Ne;if(!k.current)return;let pe=se.clientX-k.current.x,Se=se.clientY-k.current.y,we=Math.max(120,k.current.w+pe),Ie=Math.max(80,k.current.h+Se);s&&s(t.card_id,{width:we,height:Ie})},Re=()=>{k.current=null,document.removeEventListener("mousemove",Ee),document.removeEventListener("mouseup",Re)};document.addEventListener("mousemove",Ee),document.addEventListener("mouseup",Re)},[t.card_id,t.size.width,t.size.height,s]),W=v(ce=>{ce.preventDefault(),ce.stopPropagation(),a&&a(t.card_id)},[t.card_id,a]),_=v(ce=>{let be=ce;be.preventDefault(),be.stopPropagation();let Re=be.target.dataset.anchor;if(!Re||!p)return;let Ne=t.position.x,se=t.position.y,pe=t.size.width,Se=t.size.height,we=Ne+pe/2,Ie=se+Se/2;Re==="top"?(we=Ne+pe/2,Ie=se):Re==="right"?(we=Ne+pe,Ie=se+Se/2):Re==="bottom"?(we=Ne+pe/2,Ie=se+Se):Re==="left"&&(we=Ne,Ie=se+Se/2),p(t.card_id,Re,{x:we,y:Ie})},[t.card_id,t.position.x,t.position.y,t.size.width,t.size.height,p]),O=v(ce=>{l&&l({type:"CHANGE_CARD_TYPE",cardId:t.card_id,newType:ce}),M()},[t.card_id,l,M]),Y=v(ce=>{ce.preventDefault(),ce.stopPropagation(),B(t.card_title||""),T(!0)},[t.card_title]),K=v(()=>{T(!1),h&&$!==t.card_title&&h(t.card_id,{card_title:$})},[h,t.card_id,t.card_title,$]),Q=v(ce=>{let be=ce;be.key==="Enter"?(be.preventDefault(),K()):be.key==="Escape"&&(be.preventDefault(),T(!1),B(t.card_title||""))},[K,t.card_title]),q=v(ce=>{let be=ce.target;B(be.value)},[]),H=v(ce=>{ce.stopPropagation();let be=t.content;N(be.text||""),R(!0)},[t.content]),j=v(()=>{R(!1),h&&h(t.card_id,{content:{text:E}})},[h,t.card_id,E]),G=v(ce=>{let be=ce;if(be.key==="Escape"){be.preventDefault(),R(!1);let Ee=t.content;N(Ee.text||"")}},[t.content]),V=v(ce=>{let be=ce.target;N(be.value)},[]),Z;switch(t.card_type){case"text":L?Z=o("textarea",{"data-role":"inline-edit","data-testid":`card-desc-edit-${t.card_id}`,value:E,onInput:V,onBlur:j,onKeyDown:G,onFocus:ce=>{let be=ce.target;be.setSelectionRange(be.value.length,be.value.length)},style:{fontSize:"12px",color:"#555555",lineHeight:"1.4",flex:"1",border:"1px solid #3b82f6",borderRadius:"3px",padding:"2px 4px",resize:"none",outline:"none",fontFamily:"inherit",backgroundColor:"#fff",width:"100%",boxSizing:"border-box"}}):Z=o("div",{style:{fontSize:"12px",color:"#555555",lineHeight:"1.4",overflow:"hidden",flex:"1",cursor:"text"},"data-testid":`card-text-content-${t.card_id}`,onClick:H},t.content.text||"");break;case"json":Z=bd(t);break;case"task":Z=xd(t);break;case"project":Z=yd(t,d);break;default:Z=hd(t)}let te=t.card_type==="project",ae={position:"absolute",left:`${t.position.x}px`,top:`${t.position.y}px`,width:`${t.size.width}px`,height:`${t.size.height}px`,backgroundColor:t.color||"#fef9c3",borderRadius:te?"999px":"6px",borderLeft:`4px solid ${w}`,boxShadow:n?"0 0 0 2px #3b82f6, 0 4px 12px rgba(0,0,0,0.15)":"0 2px 8px rgba(0,0,0,0.1)",cursor:"grab",userSelect:"none",overflow:"hidden",display:"flex",flexDirection:"column",padding:"8px 10px",boxSizing:"border-box",transition:"box-shadow 150ms ease",zIndex:x?"9999":"1"},J={fontWeight:"600",fontSize:"14px",color:"#1a1a1a",marginBottom:"4px",lineHeight:"1.3",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},ie={position:"absolute",top:"4px",right:"4px",width:"18px",height:"18px",borderRadius:"50%",backgroundColor:"rgba(0,0,0,0.15)",color:"#333",fontSize:"12px",lineHeight:"18px",textAlign:"center",cursor:"pointer",display:f?"block":"none",border:"none",padding:"0"},le={position:"absolute",bottom:"0",right:"0",width:"12px",height:"12px",cursor:"nwse-resize",opacity:"0.4",background:"linear-gradient(135deg, transparent 50%, #666 50%)"},fe={position:"absolute",top:"4px",right:"24px",width:"18px",height:"18px",borderRadius:"3px",backgroundColor:"rgba(0,0,0,0.1)",color:"#333",fontSize:"10px",lineHeight:"18px",textAlign:"center",cursor:"grab",display:f?"block":"none",border:"none",padding:"0"},oe=8,ge={position:"absolute",width:`${oe}px`,height:`${oe}px`,borderRadius:"50%",backgroundColor:"#3b82f6",border:"2px solid #fff",boxSizing:"border-box",cursor:"crosshair",display:f?"block":"none",zIndex:"10"},ee=[{anchor:"top",style:{...ge,top:`${-oe/2}px`,left:"50%",marginLeft:`${-oe/2}px`}},{anchor:"right",style:{...ge,top:"50%",right:`${-oe/2}px`,marginTop:`${-oe/2}px`}},{anchor:"bottom",style:{...ge,bottom:`${-oe/2}px`,left:"50%",marginLeft:`${-oe/2}px`}},{anchor:"left",style:{...ge,top:"50%",left:`${-oe/2}px`,marginTop:`${-oe/2}px`}}].map((ce,be)=>o("div",{key:`anchor-${ce.anchor}`,style:ce.style,"data-role":"anchor","data-anchor":ce.anchor,"data-testid":`card-anchor-${ce.anchor}-${t.card_id}`,onMouseDown:_})),de=t.assignee?o("div",{style:{display:"flex",alignItems:"center",gap:"4px",marginTop:"4px",fontSize:"10px",color:"#555"},"data-testid":`card-assignee-${t.card_id}`},o("span",{style:{width:"16px",height:"16px",borderRadius:"50%",backgroundColor:"#3b82f6",color:"#fff",fontSize:"9px",fontWeight:"700",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:"0"}},t.assignee.charAt(0).toUpperCase()),o("span",{},t.assignee)):null,me=t.tags&&t.tags.length>0?o("div",{style:{display:"flex",gap:"4px",flexWrap:"wrap",marginTop:"4px"}},...t.tags.map((ce,be)=>o("span",{key:String(be),style:{fontSize:"10px",padding:"1px 4px",borderRadius:"3px",backgroundColor:"rgba(0,0,0,0.08)",color:"#444"}},ce))):null,xe={padding:"6px 12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",whiteSpace:"nowrap"},ye={position:"absolute",left:"100%",top:"0",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 16px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"120px"},Me=b?o("div",{className:"card-context-menu",style:{position:"fixed",left:`${b.x}px`,top:`${b.y}px`,backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 16px rgba(0,0,0,0.15)",padding:"4px 0",zIndex:"10000",minWidth:"160px",fontSize:"13px",color:"#1a1a1a"},"data-testid":`card-context-menu-${t.card_id}`,role:"menu","aria-label":"Card context menu",onClick:ce=>ce.stopPropagation()},o("div",{style:xe,onClick:ce=>{ce.stopPropagation(),a&&a(t.card_id),M()},role:"menuitem","data-testid":`ctx-delete-${t.card_id}`},"Delete"),o("div",{style:{...xe,position:"relative"},onMouseEnter:()=>A(!0),role:"menuitem","aria-haspopup":"true","data-testid":`ctx-change-type-${t.card_id}`},"Change Type",o("span",{style:{marginLeft:"8px"}},"\u25B6"),I?o("div",{style:ye,role:"menu","data-testid":`ctx-type-submenu-${t.card_id}`},...Ft.map(ce=>o("div",{key:ce.value,style:{...xe,fontWeight:t.card_type===ce.value?"700":"400"},onClick:be=>{be.stopPropagation(),O(ce.value)},role:"menuitem","data-testid":`ctx-type-${ce.value}-${t.card_id}`},ce.label,t.card_type===ce.value?" \u2713":""))):null)):null;return te?o("div",{className:"board-card board-card--project",style:ae,onMouseDown:F,onContextMenu:D,onMouseEnter:()=>y(!0),onMouseLeave:()=>{y(!1),M()},"data-card-id":t.card_id,"data-testid":`card-${t.card_id}`,role:"button","aria-label":`Project card: ${t.card_title}`,tabIndex:0},Z,o("div",{style:fe,"data-role":"drag-handle","data-testid":`card-drag-handle-${t.card_id}`,"aria-label":"Export drag handle",title:"Drag to export card"},"\u2630"),...ee,Me):o("div",{className:"board-card",style:ae,onMouseDown:F,onContextMenu:D,onMouseEnter:()=>y(!0),onMouseLeave:()=>{y(!1),M()},"data-card-id":t.card_id,"data-testid":`card-${t.card_id}`,role:"button","aria-label":`Card: ${t.card_title}`,tabIndex:0},C?o("input",{"data-role":"inline-edit","data-testid":`card-title-edit-${t.card_id}`,value:$,onInput:q,onBlur:K,onKeyDown:Q,onFocus:ce=>{let be=ce.target;be.setSelectionRange(be.value.length,be.value.length)},style:{...J,border:"1px solid #3b82f6",borderRadius:"3px",padding:"1px 4px",outline:"none",width:"100%",boxSizing:"border-box",backgroundColor:"#fff"}}):o("div",{style:J,"data-testid":`card-title-${t.card_id}`,onDblClick:Y},t.card_title||"Untitled"),Z,me,de,o("div",{style:fe,"data-role":"drag-handle","data-testid":`card-drag-handle-${t.card_id}`,"aria-label":`Export drag handle for ${t.card_title}`,title:"Drag to export card"},"\u2630"),o("button",{style:ie,"data-role":"delete","data-testid":`card-delete-${t.card_id}`,onClick:W,"aria-label":`Delete ${t.card_title}`,tabIndex:-1},"\xD7"),o("div",{style:le,"data-role":"resize",onMouseDown:P,"aria-label":"Resize card"}),...ee,Me)}function yn(e){let{container:t,selected:n=!1,highlighted:r=!1,onSelect:i,onMove:s,onResize:a,onDelete:l,onDrop:d,onDragStart:u,onDragEnd:h,onContainerContextMenu:m,children:c}=e,[p,f]=U(!1),[y,x]=U(!1),[g,b]=U(!1),S=ne(null),I=ne(null),A=v(M=>{M.stopPropagation(),l&&l(t.container_id)},[t.container_id,l]),C=v(M=>{M.stopPropagation(),x(F=>!F)},[]),T=v(M=>{let F=M;F.preventDefault(),F.stopPropagation(),m&&m(t.container_id,{x:F.clientX,y:F.clientY})},[t.container_id,m]),L=v(M=>{let F=M;F.preventDefault(),F.stopPropagation(),i&&i(t.container_id),u&&u(t.container_id),b(!0),S.current={x:F.clientX,y:F.clientY,posX:t.position.x,posY:t.position.y};let P=_=>{let O=_;if(!S.current)return;let Y=O.clientX-S.current.x,K=O.clientY-S.current.y;s&&s(t.container_id,{x:S.current.posX+Y,y:S.current.posY+K})},W=()=>{S.current=null,b(!1),h&&h(t.container_id),document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",W)};document.addEventListener("mousemove",P),document.addEventListener("mouseup",W)},[t.container_id,t.position.x,t.position.y,i,s,u,h]),R=v(M=>{let F=M;F.preventDefault(),F.stopPropagation(),I.current={x:F.clientX,y:F.clientY,w:t.size.width,h:t.size.height};let P=_=>{let O=_;if(!I.current)return;let Y=O.clientX-I.current.x,K=O.clientY-I.current.y,Q=Math.max(160,I.current.w+Y),q=Math.max(120,I.current.h+K);a&&a(t.container_id,{width:Q,height:q})},W=()=>{I.current=null,document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",W)};document.addEventListener("mousemove",P),document.addEventListener("mouseup",W)},[t.container_id,t.size.width,t.size.height,a]),$=v(M=>{M.preventDefault(),f(!0)},[]),B=v(()=>{f(!1)},[]),E=v(M=>{let F=M;if(F.preventDefault(),f(!1),d&&F.dataTransfer){let P=F.dataTransfer.getData("text/plain");P&&d(P,t.container_id)}},[t.container_id,d]),N=r||p,z={position:"absolute",left:`${t.position.x}px`,top:`${t.position.y}px`,width:`${t.size.width}px`,height:`${t.size.height}px`,backgroundColor:r?"#eff6ff":"#ffffff",border:r?"2px dashed #3b82f6":n?"2px solid #3b82f6":"2px solid #d1d5db",borderRadius:"8px",boxShadow:N?"0 0 0 3px rgba(59,130,246,0.3), 0 4px 16px rgba(0,0,0,0.1)":"0 2px 8px rgba(0,0,0,0.08)",display:"flex",flexDirection:"column",overflow:"hidden",zIndex:g?"9999":"0",boxSizing:"border-box",transition:"border 150ms ease, background-color 150ms ease, box-shadow 150ms ease"},k={padding:"6px 12px",borderBottom:"1px solid #e5e7eb",backgroundColor:"#f9fafb",cursor:"grab",userSelect:"none",textAlign:"center",fontWeight:"700",fontSize:"15px",color:"#1f2937",flexShrink:"0"},w={flex:"1",overflow:"auto",position:"relative",padding:"4px"},D={position:"absolute",bottom:"0",right:"0",width:"14px",height:"14px",cursor:"nwse-resize",opacity:"0.4",background:"linear-gradient(135deg, transparent 50%, #666 50%)"};return o("div",{className:"board-container",style:z,"data-container-id":t.container_id,"data-testid":`container-${t.container_id}`,role:"group","aria-label":`Container: ${t.name}`,onDragOver:$,onDragLeave:B,onDrop:E,onContextMenu:T},o("div",{className:"board-container__title",style:{...k,display:"flex",alignItems:"center",justifyContent:"space-between"},onMouseDown:L,"data-testid":`container-title-${t.container_id}`},o("span",null,t.name),o("span",{style:{display:"flex",gap:"4px"}},o("button",{style:{border:"none",backgroundColor:"transparent",cursor:"pointer",color:"#94a3b8",fontSize:"12px",padding:"0 2px",lineHeight:"1"},onClick:C,"aria-label":y?"Expand container":"Minimize container",title:y?"Expand":"Minimize"},y?"\u25B2":"\u2014"),o("button",{style:{border:"none",backgroundColor:"transparent",cursor:"pointer",color:"#94a3b8",fontSize:"14px",padding:"0 2px",lineHeight:"1"},onClick:A,"aria-label":"Delete container",title:"Delete"},"\xD7"))),y?null:o("div",{className:"board-container__contents",style:w,"data-testid":`container-contents-${t.container_id}`},c),y?null:o("div",{style:D,"data-role":"resize",onMouseDown:R,"aria-label":"Resize container"}))}function Ui(e){let t=e.position.x+e.size.width/2,n=e.position.y+e.size.height/2;return{top:{x:t,y:e.position.y},right:{x:e.position.x+e.size.width,y:n},bottom:{x:t,y:e.position.y+e.size.height},left:{x:e.position.x,y:n}}}function Sd(e,t){let n=Ui(e),r=Ui(t),i=[n.top,n.right,n.bottom,n.left],s=[r.top,r.right,r.bottom,r.left],a=1/0,l=n.right,d=r.left;for(let u=0;u<i.length;u++)for(let h=0;h<s.length;h++){let m=s[h].x-i[u].x,c=s[h].y-i[u].y,p=m*m+c*c;p<a&&(a=p,l=i[u],d=s[h])}return{from:l,to:d}}var ji="board-card-link-arrowhead";function Sn(e){let{links:t,cards:n,selectedLinkId:r,onSelectLink:i,onLinkContextMenu:s,canvasWidth:a,canvasHeight:l}=e,d=new Map;for(let p=0;p<n.length;p++)d.set(n[p].card_id,n[p]);let u=v(p=>{i(p)},[i]),h=[];for(let p=0;p<t.length;p++){let{source:f,link:y}=t[p],x=d.get(y.target_card_id);if(!x)continue;let{from:g,to:b}=Sd(f,x),S=y.link_id===r,I=S?"#3b82f6":y.color||"#94a3b8",A=b.x-g.x,C=b.y-g.y,T=Math.sqrt(A*A+C*C),L=Math.min(40,T*.15),R=T>0?-C/T:0,$=T>0?A/T:0,B=(g.x+b.x)/2,E=(g.y+b.y)/2,N=B+R*L,z=E+$*L,k=`M ${g.x} ${g.y} Q ${N} ${z} ${b.x} ${b.y}`,w=f.card_id;h.push(o("path",{key:`hit-${y.link_id}`,d:k,fill:"none",stroke:"transparent","stroke-width":"12",style:{cursor:"pointer",pointerEvents:"stroke"},onClick:()=>u(y.link_id),onContextMenu:D=>{let M=D;M.preventDefault(),M.stopPropagation(),s&&s(y.link_id,w,{x:M.clientX,y:M.clientY})},"data-testid":`link-hit-${y.link_id}`})),h.push(o("path",{key:y.link_id,d:k,fill:"none",stroke:I,"stroke-width":S?"3":"2","pointer-events":"none","marker-end":`url(#${ji})`,"data-testid":`link-${y.link_id}`})),y.link_name&&h.push(o("text",{key:`label-${y.link_id}`,x:String(N),y:String(z-6),"text-anchor":"middle",fill:"#64748b","font-size":"11","pointer-events":"none","data-testid":`link-label-${y.link_id}`},y.link_name))}let m={position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none",overflow:"visible",zIndex:"9999"},c=o("defs",{},o("marker",{id:ji,viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto-start-reverse"},o("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"#94a3b8"})));return o("svg",{style:m,width:String(a),height:String(l),className:"card-link-overlay","data-testid":"card-link-overlay",role:"img","aria-label":"Card links"},c,o("g",{style:{pointerEvents:"auto"}},...h))}var vd=[{value:"#fef9c3",label:"Yellow"},{value:"#fecaca",label:"Red"},{value:"#fed7aa",label:"Orange"},{value:"#bbf7d0",label:"Green"},{value:"#bfdbfe",label:"Blue"},{value:"#ddd6fe",label:"Purple"},{value:"#fbcfe8",label:"Pink"},{value:"#e5e7eb",label:"Gray"}],mo=20,Et=5e3;function wd(e,t){let n=new Set,r=[...e],i=null;for(;r.length>0;){let a=r.pop();if($e(a)&&a.container_id===t){i=a;break}if($e(a))for(let l=0;l<a.contents.length;l++)r.push(a.contents[l])}if(!i||!$e(i))return n;let s=[...i.contents];for(;s.length>0;){let a=s.pop();if($e(a)){n.add(a.container_id);for(let l=0;l<a.contents.length;l++)s.push(a.contents[l])}}return n}function kd(e,t,n,r){let i=new Set;if(r){i.add(r);let d=wd(e,r);for(let u of d)i.add(u)}let s=null,a=-1,l=[[e,0,0,0]];for(;l.length>0;){let[d,u,h,m]=l.pop();for(let c=0;c<d.length;c++){let p=d[c];if(!$e(p)||i.has(p.container_id))continue;let f=p.position.x+u,y=p.position.y+h;t>=f&&t<=f+p.size.width&&n>=y&&n<=y+p.size.height&&(m>a&&(s=p.container_id,a=m),p.contents.length>0&&l.push([p.contents,f,y+30,m+1]))}}return s}function Xi(e,t){return{x:Math.round(e.x/t)*t,y:Math.round(e.y/t)*t}}function Gi(e,t){let n=[[e,null]];for(;n.length>0;){let[r,i]=n.pop();for(let s=0;s<r.length;s++){let a=r[s];if(Xe(a)===t)return i;$e(a)&&n.push([a.contents,a.container_id])}}return null}function Ki(e,t,n){return{x:(e-n.panX)/n.zoom,y:(t-n.panY)/n.zoom}}function Cd(e){let t=[],n=[],r=[];for(let i=e.length-1;i>=0;i--)r.push([e[i],0,0]);for(;r.length>0;){let[i,s,a]=r.pop();if(Le(i)){let l={...i,position:{x:i.position.x+s,y:i.position.y+a}};t.push(l);for(let d=0;d<i.card_link.length;d++)n.push({source:l,link:i.card_link[d]})}else if($e(i)){let l=s+i.position.x,d=a+i.position.y+30;for(let u=i.contents.length-1;u>=0;u--)r.push([i.contents[u],l,d])}}return{cards:t,links:n}}function Nt(e){let{state:t,dispatch:n,selectedId:r=null,onSelectItem:i,gridEnabled:s=!1,searchQuery:a="",colorFilter:l=null,onOpenProject:d,onCardContextMenu:u,onUpdateItem:h}=e,{collection:m,viewport:c}=t,p=ne(null),f=ne(!1),y=ne(null),[x,g]=U(null),[b,S]=U(null),[I,A]=U(null),[C,T]=U(null),[L,R]=U(!1),[$,B]=U(!1),[E,N]=U(null),[z,k]=U(null),w=v(se=>{let pe=se,Se=pe.target;if(Se.closest(".board-card")||Se.closest(".board-container"))return;let we=pe.button===1,Ie=pe.button===0&&pe.shiftKey;we||Ie?(pe.preventDefault(),f.current=!0,y.current={x:pe.clientX,y:pe.clientY,panX:c.panX,panY:c.panY}):pe.button===0&&i&&i(null)},[c.panX,c.panY,i]);re(()=>{let se=Se=>{if(!f.current||!y.current)return;let we=Se,Ie=we.clientX-y.current.x,Be=we.clientY-y.current.y;n({type:"PAN",panX:y.current.panX+Ie,panY:y.current.panY+Be})},pe=()=>{f.current=!1,y.current=null};return document.addEventListener("mousemove",se),document.addEventListener("mouseup",pe),()=>{document.removeEventListener("mousemove",se),document.removeEventListener("mouseup",pe)}},[n]);let D=v(se=>{let pe=se;if(!pe.ctrlKey)return;pe.preventDefault();let Se=pe.deltaY>0?-.1:.1;n({type:"ZOOM",zoom:c.zoom+Se})},[c.zoom,n]),M=ne(null);re(()=>{let se=p.current;if(!se)return;let pe=Ae=>{let De=[];for(let ue=0;ue<Ae.touches.length;ue++)De.push({x:Ae.touches[ue].clientX,y:Ae.touches[ue].clientY});return De},Se=(Ae,De)=>Math.sqrt((Ae.x-De.x)**2+(Ae.y-De.y)**2),we=Ae=>{let De=Ae;if(De.touches.length===2){De.preventDefault();let ue=pe(De);M.current={touches:ue,panX:c.panX,panY:c.panY,zoom:c.zoom,dist:Se(ue[0],ue[1])}}},Ie=Ae=>{let De=Ae;if(De.touches.length!==2||!M.current)return;De.preventDefault();let ue=pe(De),ve=M.current,ke=(ve.touches[0].x+ve.touches[1].x)/2,Pe=(ve.touches[0].y+ve.touches[1].y)/2,Ke=(ue[0].x+ue[1].x)/2,Qe=(ue[0].y+ue[1].y)/2;n({type:"PAN",panX:ve.panX+(Ke-ke),panY:ve.panY+(Qe-Pe)});let ct=Se(ue[0],ue[1]);ve.dist>0&&n({type:"ZOOM",zoom:ve.zoom*(ct/ve.dist)})},Be=()=>{M.current=null};return se.addEventListener("touchstart",we,{passive:!1}),se.addEventListener("touchmove",Ie,{passive:!1}),se.addEventListener("touchend",Be),()=>{se.removeEventListener("touchstart",we),se.removeEventListener("touchmove",Ie),se.removeEventListener("touchend",Be)}},[c.panX,c.panY,c.zoom,n]);let F=v((se,pe)=>{T({cardId:se,x:pe.x,y:pe.y}),R(!1),B(!1),u&&u(se,pe)},[u]),P=v(()=>{T(null),R(!1),B(!1)},[]);re(()=>{if(!C)return;let se=()=>{P()};return document.addEventListener("click",se),()=>{document.removeEventListener("click",se)}},[C,P]);let W=v((se,pe,Se)=>{k({linkId:se,cardId:pe,x:Se.x,y:Se.y}),P()},[P]),_=v(()=>{k(null)},[]);re(()=>{if(!z)return;let se=()=>_();return document.addEventListener("click",se),()=>document.removeEventListener("click",se)},[z,_]);let O=v((se,pe)=>{N({containerId:se,x:pe.x,y:pe.y}),P(),_()},[P,_]),Y=v(()=>{N(null)},[]);re(()=>{if(!E)return;let se=()=>Y();return document.addEventListener("click",se),()=>document.removeEventListener("click",se)},[E,Y]);let K=v(se=>{i&&i(se)},[i]),Q=v((se,pe)=>{let Se=pe;if(s&&(Se=Xi(pe,mo)),n({type:"MOVE_ITEM",itemId:se,position:Se}),V.current===se){let Ie=0,Be=0,Ae=[...m];for(;Ae.length>0;){let ke=Ae.pop();if(Xe(ke)===se){Ie=ke.size.width,Be=ke.size.height;break}if($e(ke))for(let Pe=0;Pe<ke.contents.length;Pe++)Ae.push(ke.contents[Pe])}let De=Se.x+Ie/2,ue=Se.y+Be/2,ve=kd(m,De,ue,se);g(ve)}},[n,s,m]),q=v((se,pe)=>{n({type:"RESIZE_ITEM",itemId:se,size:pe})},[n]),H=v(se=>{n({type:"REMOVE_ITEM",itemId:se}),i&&r===se&&i(null)},[n,r,i]),j=v((se,pe)=>{n({type:"NEST_ITEM",itemId:se,containerId:pe})},[n]),G=v(se=>{S(se),V.current=se,g(null)},[]),V=ne(null);V.current=b;let Z=ne(null);Z.current=x;let te=v(se=>{let pe=Z.current;pe&&n({type:"NEST_ITEM",itemId:se,containerId:pe}),S(null),V.current=null,g(null)},[n]),ae=v((se,pe,Se)=>{A({fromCardId:se,fromAnchor:pe,fromPos:Se,currentPos:Se})},[]),J=ne(null);J.current=I,re(()=>{if(!I)return;let se=Se=>{let we=Se,Ie=0,Be=0;if(p.current){let De=p.current.getBoundingClientRect();Ie=De.left,Be=De.top}let Ae=Ki(we.clientX-Ie,we.clientY-Be,c);A(De=>De?{...De,currentPos:Ae}:null)},pe=Se=>{let we=Se,Ie=J.current;if(!Ie){A(null);return}let Be=document.elementFromPoint(we.clientX,we.clientY);if(Be&&Be.dataset&&Be.dataset.role==="anchor"&&Be.dataset.anchor){let Ae=Be.closest("[data-card-id]");if(Ae&&Ae.dataset.cardId&&Ae.dataset.cardId!==Ie.fromCardId){let De=Ae.dataset.cardId;n({type:"ADD_LINK",cardId:Ie.fromCardId,link:{link_id:qe(),link_name:"relates to",target_card_id:De,color:"#94a3b8",attributes:{}}})}}A(null)};return document.addEventListener("mousemove",se),document.addEventListener("mouseup",pe),()=>{document.removeEventListener("mousemove",se),document.removeEventListener("mouseup",pe)}},[I!==null,c.panX,c.panY,c.zoom,n]);let ie=a.toLowerCase(),le=new Set,fe=[],oe=[...m];for(;oe.length>0;){let se=oe.pop();if(fe.push(se),$e(se))for(let pe=0;pe<se.contents.length;pe++)oe.push(se.contents[pe])}if(ie)for(let se=0;se<fe.length;se++){let pe=fe[se];(Le(pe)?pe.card_title:pe.name).toLowerCase().includes(ie)||le.add(Xe(pe))}if(l)for(let se=0;se<fe.length;se++){let pe=fe[se];Le(pe)&&pe.color!==l&&le.add(pe.card_id)}let{cards:ge,links:he}=Cd(m);function ee(se){let pe=Xe(se),Se=le.has(pe),we;if(Le(se))we=o(xn,{key:pe,card:se,selected:pe===r,onSelect:K,onMove:Q,onResize:q,onDelete:H,dispatch:n,onOpenProject:d,onCardContextMenu:F,onUpdate:h,onDragStart:G,onDragEnd:te,onAnchorDragStart:ae});else{let Ie=se.contents.map(Be=>ee(Be));we=o(yn,{key:pe,container:se,selected:pe===r,highlighted:x===se.container_id,onSelect:K,onMove:Q,onResize:q,onDelete:H,onDrop:j,onDragStart:G,onDragEnd:te,onContainerContextMenu:O},...Ie)}return Se?o("div",{key:`dim-${pe}`,style:{opacity:"0.3"}},we):we}let de=m.map(se=>ee(se)),me={flex:"1",overflow:"hidden",position:"relative",backgroundColor:"#f8fafc",cursor:"default",backgroundImage:s?"radial-gradient(circle, #d1d5db 1px, transparent 1px)":"none",backgroundSize:`${mo}px ${mo}px`},xe={transform:`translate(${c.panX}px, ${c.panY}px) scale(${c.zoom})`,transformOrigin:"0 0",position:"relative",width:`${Et}px`,height:`${Et}px`},ye={padding:"6px 12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",whiteSpace:"nowrap",fontSize:"13px",color:"#1a1a1a"},Me={position:"absolute",left:"100%",top:"0",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 16px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"120px"},ce={height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"},be=C?o("div",{className:"board-context-menu",style:{position:"fixed",left:`${C.x}px`,top:`${C.y}px`,backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 16px rgba(0,0,0,0.15)",padding:"4px 0",zIndex:"10000",minWidth:"160px",fontSize:"13px",color:"#1a1a1a"},"data-testid":`board-context-menu-${C.cardId}`,role:"menu","aria-label":"Card context menu",onClick:se=>se.stopPropagation()},o("div",{style:{...ye,position:"relative"},onMouseEnter:()=>{R(!0),B(!1)},role:"menuitem","aria-haspopup":"true","data-testid":`board-ctx-change-color-${C.cardId}`},"Change Color",o("span",{style:{marginLeft:"8px"}},"\u25B6"),L?o("div",{style:Me,role:"menu","data-testid":`board-ctx-color-submenu-${C.cardId}`},...vd.map(se=>o("div",{key:se.value,style:{...ye,gap:"8px"},onClick:pe=>{pe.stopPropagation(),n({type:"UPDATE_CARD",cardId:C.cardId,updates:{color:se.value}}),P()},role:"menuitem","data-testid":`board-ctx-color-${se.label.toLowerCase()}-${C.cardId}`},o("span",{style:{display:"inline-block",width:"14px",height:"14px",borderRadius:"3px",backgroundColor:se.value,border:"1px solid #d1d5db",flexShrink:"0"}}),se.label))):null),o("div",{style:{...ye,position:"relative"},onMouseEnter:()=>{B(!0),R(!1)},role:"menuitem","aria-haspopup":"true","data-testid":`board-ctx-change-type-${C.cardId}`},"Change Type",o("span",{style:{marginLeft:"8px"}},"\u25B6"),$?o("div",{style:Me,role:"menu","data-testid":`board-ctx-type-submenu-${C.cardId}`},...Ft.map(se=>o("div",{key:se.value,style:ye,onClick:pe=>{pe.stopPropagation(),n({type:"CHANGE_CARD_TYPE",cardId:C.cardId,newType:se.value}),P()},role:"menuitem","data-testid":`board-ctx-type-${se.value}-${C.cardId}`},se.label))):null),(()=>{let se=Gi(m,C.cardId);return se?o("div",{style:ye,onClick:pe=>{pe.stopPropagation(),n({type:"UNNEST_ITEM",itemId:C.cardId,containerId:se}),P()},role:"menuitem","data-testid":`board-ctx-detach-${C.cardId}`},"Detach Card"):null})(),o("div",{style:ce,role:"separator"}),o("div",{style:{...ye,color:"#dc2626"},onClick:se=>{se.stopPropagation(),n({type:"REMOVE_ITEM",itemId:C.cardId}),i&&r===C.cardId&&i(null),P()},role:"menuitem","data-testid":`board-ctx-delete-${C.cardId}`},"Delete")):null,Ee=E?o("div",{className:"board-container-context-menu",role:"menu",style:{position:"fixed",left:`${E.x}px`,top:`${E.y}px`,backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 16px rgba(0,0,0,0.15)",padding:"4px 0",zIndex:"10001",minWidth:"160px"},"data-testid":`board-container-ctx-menu-${E.containerId}`},(()=>{let se=Gi(m,E.containerId);return se?o("div",{style:ye,onClick:pe=>{pe.stopPropagation(),n({type:"UNNEST_ITEM",itemId:E.containerId,containerId:se}),Y()},role:"menuitem","data-testid":`board-ctx-detach-container-${E.containerId}`},"Detach Container"):null})(),o("div",{style:ce,role:"separator"}),o("div",{style:{...ye,color:"#dc2626"},onClick:se=>{se.stopPropagation(),n({type:"REMOVE_ITEM",itemId:E.containerId}),i&&r===E.containerId&&i(null),Y()},role:"menuitem","data-testid":`board-ctx-delete-container-${E.containerId}`},"Delete")):null,Re=["relates to","depends on","blocks","is blocked by","implements","is implemented by","extends","includes","references","duplicates","parent of","child of"],Ne=z?o("div",{className:"board-link-context-menu",style:{position:"fixed",left:`${z.x}px`,top:`${z.y}px`,backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 16px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"180px",maxHeight:"240px",overflowY:"auto",zIndex:"10001",fontSize:"13px"},onClick:se=>se.stopPropagation()},o("div",{style:{padding:"4px 14px",fontSize:"11px",color:"#94a3b8",fontWeight:"600"}},"Edge Type"),...Re.map(se=>o("button",{key:se,style:{display:"block",width:"100%",padding:"6px 14px",border:"none",backgroundColor:"transparent",textAlign:"left",cursor:"pointer",fontSize:"13px",color:"#334155",fontFamily:"inherit",boxSizing:"border-box"},onClick:()=>{n({type:"UPDATE_CARD",cardId:z.cardId,updates:{card_link:(()=>{let pe=null,Se=[...m];for(;Se.length>0;){let we=Se.pop();if(Le(we)&&we.card_id===z.cardId){pe=we;break}if($e(we))for(let Ie of we.contents)Se.push(Ie)}return pe?pe.card_link.map(we=>we.link_id===z.linkId?{...we,link_name:se}:we):[]})()}}),_()},role:"menuitem"},se)),o("div",{style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}}),o("button",{style:{display:"block",width:"100%",padding:"6px 14px",border:"none",backgroundColor:"transparent",textAlign:"left",cursor:"pointer",fontSize:"13px",color:"#ef4444",fontFamily:"inherit"},onClick:()=>{n({type:"REMOVE_LINK",cardId:z.cardId,linkId:z.linkId}),_()},role:"menuitem"},"Delete Link")):null;return o("div",{ref:p,className:"board-canvas",style:me,onMouseDown:w,onWheel:D,"data-testid":"board-canvas",role:"application","aria-label":`Board: ${t.name}`,tabIndex:0},o("div",{className:"board-canvas__inner",style:xe,"data-testid":"board-canvas-inner"},o(Sn,{links:he,cards:ge,selectedLinkId:null,onSelectLink:()=>{},onLinkContextMenu:W,canvasWidth:Et,canvasHeight:Et}),I?o("svg",{style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none",overflow:"visible"},width:String(Et),height:String(Et),className:"link-drag-overlay","data-testid":"link-drag-overlay"},o("line",{x1:String(I.fromPos.x),y1:String(I.fromPos.y),x2:String(I.currentPos.x),y2:String(I.currentPos.y),stroke:"#3b82f6","stroke-width":"2","stroke-dasharray":"6 4","pointer-events":"none","data-testid":"link-drag-line"})):null,...de),be,Ee,Ne)}function Md(e){let t=[],n=[...e];for(;n.length>0;){let r=n.pop();if(Le(r))t.push(r);else if($e(r))for(let i=r.contents.length-1;i>=0;i--)n.push(r.contents[i])}return t}function qi(e,t,n,r){let i=r??40,s=Md(e);if(s.length===0)return{panX:0,panY:0,zoom:1};let a=1/0,l=1/0,d=-1/0,u=-1/0;for(let g=0;g<s.length;g++){let b=s[g];b.position.x<a&&(a=b.position.x),b.position.y<l&&(l=b.position.y);let S=b.position.x+b.size.width,I=b.position.y+b.size.height;S>d&&(d=S),I>u&&(u=I)}let h=d-a+i*2,m=u-l+i*2,c=t/h,p=n/m,f=Math.max(.25,Math.min(4,Math.min(c,p))),y=-a*f+(t-(d-a)*f)/2,x=-l*f+(n-(u-l)*f)/2;return{panX:y,panY:x,zoom:f}}var go=["#fef9c3","#fecaca","#fed7aa","#bbf7d0","#bfdbfe","#ddd6fe","#fbcfe8","#e5e7eb"];function Zi(e){let{zoom:t,gridEnabled:n,selectedColor:r,colorFilter:i,onNewCard:s,onZoomIn:a,onZoomOut:l,onZoomReset:d,onColorSelect:u,onColorFilter:h,onGridToggle:m,onSearch:c}=e,[p,f]=U(""),y=v(T=>{let L=T.target.value;f(L),c(L)},[c]),x={display:"flex",alignItems:"center",gap:"8px",padding:"6px 12px",backgroundColor:"rgba(255,255,255,0.95)",borderBottom:"1px solid #e2e8f0",fontSize:"12px",flexShrink:"0",flexWrap:"wrap"},g={padding:"4px 10px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#ffffff",cursor:"pointer",fontSize:"12px",color:"#374151",lineHeight:"1.4"},b={...g,backgroundColor:"#3b82f6",color:"#ffffff",borderColor:"#3b82f6"},S={fontSize:"12px",color:"#64748b",minWidth:"40px",textAlign:"center",cursor:"pointer"},I={width:"1px",height:"20px",backgroundColor:"#e2e8f0",margin:"0 4px"},A={padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",width:"120px",outline:"none"},C=go.map(T=>{let L=T===r,R=T===i,$=()=>{L&&h?h(R?null:T):u(T)},B="1px solid rgba(0,0,0,0.15)";return R?B="3px solid #ef4444":L&&(B="2px solid #3b82f6"),o("button",{key:T,title:T,style:{width:"18px",height:"18px",borderRadius:"50%",backgroundColor:T,border:B,cursor:"pointer",padding:"0",flexShrink:"0",opacity:R?"1":i?"0.5":"1"},onClick:$,"aria-label":R?`Clear color filter ${T}`:`Select color ${T}`,"data-testid":`color-swatch-${T}`})});return o("div",{className:"board-toolbar",style:x,role:"toolbar","aria-label":"Board toolbar","data-testid":"board-toolbar"},o("button",{style:g,onClick:s,"data-testid":"btn-new-card","aria-label":"New card"},"+ New Card"),o("div",{style:I}),o("button",{style:g,onClick:l,"data-testid":"btn-zoom-out","aria-label":"Zoom out"},"-"),o("span",{style:S,onClick:d,"data-testid":"zoom-level",role:"status","aria-label":`Zoom ${Math.round(t*100)}%`},`${Math.round(t*100)}%`),o("button",{style:g,onClick:a,"data-testid":"btn-zoom-in","aria-label":"Zoom in"},"+"),o("div",{style:I}),...C,o("div",{style:I}),o("button",{style:n?b:g,onClick:m,"data-testid":"btn-grid-toggle","aria-label":n?"Disable grid snapping":"Enable grid snapping","aria-pressed":String(n)},"Grid"),o("div",{style:I}),o("input",{type:"text",placeholder:"Search cards...",value:p,onInput:y,style:A,"data-testid":"search-input","aria-label":"Search cards"}))}var Ji=50,tt={id:qe(),name:"Untitled",collection:[],viewport:{panX:0,panY:0,zoom:1}};function Qi(e,t){let n=null;function r(s){let a=[];for(let l=0;l<s.length;l++){let d=s[l];if(Xe(d)===t){n=d;continue}if($e(d)){let h=r(d.contents);a.push({...d,contents:h})}else a.push(d)}return a}return[r(e),n]}function ft(e,t,n){let r=[];for(let i=0;i<e.length;i++){let s=e[i];Xe(s)===t?r.push(n(s)):$e(s)?r.push({...s,contents:ft(s.contents,t,n)}):r.push(s)}return r}function vn(e,t,n){let r=[];for(let i=0;i<e.length;i++){let s=e[i];$e(s)&&s.container_id===t?r.push({...s,contents:[...s.contents,n]}):$e(s)?r.push({...s,contents:vn(s.contents,t,n)}):r.push(s)}return r}function es(e,t){let n=[...e];for(;n.length>0;){let r=n.pop();if($e(r)){if(r.container_id===t)return r;for(let i=0;i<r.contents.length;i++)n.push(r.contents[i])}}return null}function Ed(e,t,n){let r=null;function i(a){let l=[];for(let d=0;d<a.length;d++){let u=a[d];if($e(u)&&u.container_id===t){let h=[];for(let m=0;m<u.contents.length;m++){let c=u.contents[m];Xe(c)===n?r=c:h.push(c)}l.push({...u,contents:h})}else $e(u)?l.push({...u,contents:i(u.contents)}):l.push(u)}return l}return[i(e),r]}function Id(e){switch(e){case"text":return{text:""};case"json":return{};case"task":return{};case"project":return{project_id:"",project_name:""}}}function wn(e,t){switch(t.type){case"ADD_ITEM":return t.containerId?{...e,collection:vn(e.collection,t.containerId,t.item)}:{...e,collection:[...e.collection,t.item]};case"REMOVE_ITEM":{let[n]=Qi(e.collection,t.itemId);return{...e,collection:n}}case"MOVE_ITEM":return{...e,collection:ft(e.collection,t.itemId,n=>({...n,position:t.position,...Le(n)?{updatedAt:Date.now()}:{}}))};case"RESIZE_ITEM":return{...e,collection:ft(e.collection,t.itemId,n=>({...n,size:t.size,...Le(n)?{updatedAt:Date.now()}:{}}))};case"UPDATE_CARD":return{...e,collection:ft(e.collection,t.cardId,n=>Le(n)?{...n,...t.updates,updatedAt:Date.now()}:n)};case"CHANGE_CARD_TYPE":return{...e,collection:ft(e.collection,t.cardId,n=>Le(n)?{...n,card_type:t.newType,content:Id(t.newType),updatedAt:Date.now()}:n)};case"ADD_CONTAINER":return t.parentContainerId?{...e,collection:vn(e.collection,t.parentContainerId,t.container)}:{...e,collection:[...e.collection,t.container]};case"NEST_ITEM":{let n=es(e.collection,t.containerId);if(!n)return e;let[r,i]=Qi(e.collection,t.itemId);if(!i)return e;let s={...i,position:{x:i.position.x-n.position.x,y:i.position.y-n.position.y-30}};return{...e,collection:vn(r,t.containerId,s)}}case"UNNEST_ITEM":{let n=es(e.collection,t.containerId),[r,i]=Ed(e.collection,t.containerId,t.itemId);if(!i)return e;let s=n?{...i,position:{x:i.position.x+n.position.x,y:i.position.y+n.position.y+30}}:i;return{...e,collection:[...r,s]}}case"ADD_LINK":return{...e,collection:ft(e.collection,t.cardId,n=>Le(n)?{...n,card_link:[...n.card_link,t.link],updatedAt:Date.now()}:n)};case"REMOVE_LINK":return{...e,collection:ft(e.collection,t.cardId,n=>Le(n)?{...n,card_link:n.card_link.filter(r=>r.link_id!==t.linkId),updatedAt:Date.now()}:n)};case"PAN":return{...e,viewport:{...e.viewport,panX:t.panX,panY:t.panY}};case"ZOOM":{let n=Math.max(.25,Math.min(4,t.zoom));return{...e,viewport:{...e.viewport,zoom:n}}}case"SET_BOARD":return t.state;case"RENAME_BOARD":return{...e,name:t.name};default:return e}}function Rd(e){return e.type==="PAN"||e.type==="ZOOM"}function kn(e,t){switch(t.type){case"UNDO":{if(e.past.length===0)return e;let n=e.past[e.past.length-1];return{past:e.past.slice(0,e.past.length-1),present:n,future:[e.present,...e.future]}}case"REDO":{if(e.future.length===0)return e;let n=e.future[0],r=e.future.slice(1);return{past:[...e.past,e.present],present:n,future:r}}case"BOARD_ACTION":{let n=wn(e.present,t.action);if(n===e.present)return e;if(Rd(t.action))return{...e,present:n};if(t.action.type==="SET_BOARD")return{past:[],present:n,future:[]};let r=[...e.past,e.present];return r.length>Ji&&r.splice(0,r.length-Ji),{past:r,present:n,future:[]}}default:return e}}function Wt(e){let t={past:[],present:e||tt,future:[]},[n,r]=An(kn,t),i=v(l=>{r({type:"BOARD_ACTION",action:l})},[r]),s=v(()=>{r({type:"UNDO"})},[r]),a=v(()=>{r({type:"REDO"})},[r]);return{state:n.present,dispatch:i,undo:s,redo:a,canUndo:n.past.length>0,canRedo:n.future.length>0}}function ts(e,t){let{state:n,dispatch:r,undo:i,redo:s,canUndo:a,canRedo:l}=Wt(),d=ne(!1);re(()=>{e&&t&&!d.current&&(d.current=!0,e.load(t).then(m=>{r({type:"SET_BOARD",state:m})}).catch(()=>{}))},[e,t,r]);let u=ne(null),h=ne(n);return h.current=n,re(()=>{if(!(!e||!t))return u.current!==null&&clearTimeout(u.current),u.current=setTimeout(()=>{e.save(t,h.current).catch(()=>{}),u.current=null},500),()=>{u.current!==null&&clearTimeout(u.current)}},[e,t,n]),{state:n,dispatch:r,undo:i,redo:s,canUndo:a,canRedo:l}}var Cn=class{async load(t){try{let n=localStorage.getItem("board:"+t);return n?JSON.parse(n):{...tt}}catch{return{...tt}}}async save(t,n){try{localStorage.setItem("board:"+t,JSON.stringify(n))}catch{}}};function Pd(e){let t=[],n=[...e];for(;n.length>0;){let r=n.pop();if(Le(r))t.push(r);else for(let i=r.contents.length-1;i>=0;i--)n.push(r.contents[i])}return t}function ns(e){let{collection:t,onCardDropped:n,children:r}=e,i=st(),s=ne([]);re(()=>{let u=Pd(t),h=s.current,m=new Set(h.map(p=>p.card_id)),c=new Set(u.map(p=>p.card_id));for(let p of u)m.has(p.card_id)||i.publish("project-board",{event:"card-created",card:p});for(let p of h)c.has(p.card_id)||i.publish("project-board",{event:"card-deleted",cardId:p.card_id});for(let p of u)if(m.has(p.card_id)){let f=h.find(y=>y.card_id===p.card_id);f&&f.updatedAt!==p.updatedAt&&i.publish("project-board",{event:"card-updated",card:p})}s.current=u},[t,i]);let a=v(u=>{if(u.type==="text/plain"&&typeof u.data=="string")n(u.data,"");else if(u.type==="application/json"){let h=u.data;n(String(h.title||"Dropped Item"),String(h.description||""))}},[n]),{isOver:l}=At({acceptTypes:["text/plain","application/json","application/project-card"],onDrop:a}),d={width:"100%",height:"100%",...l?{outline:"2px dashed #3b82f6",outlineOffset:"-2px"}:{}};return o("div",{style:d,"data-dropzone-id":"project-board-dropzone"},r)}var Td=new Cn;function os(e){let t=[],n=[...e];for(;n.length>0;){let r=n.pop();if(Le(r))t.push(r);else if($e(r))for(let i=r.contents.length-1;i>=0;i--)n.push(r.contents[i])}return t}var at=Date.now(),$d={id:"sample-board-001",name:"Sample Project",collection:[{type:"card",card_id:"sample-1",card_type:"text",card_title:"Auth API",card_link:[{link_id:"link-1",link_name:"blocks",target_card_id:"sample-2",color:"#94a3b8",attributes:{}}],content:{text:"Design the auth flow"},position:{x:50,y:50},size:{width:180,height:120},color:"#3b82f6",priority:"high",assignee:"Alice",createdAt:at,updatedAt:at},{type:"card",card_id:"sample-2",card_type:"text",card_title:"Dashboard",card_link:[],content:{text:"Build the main dashboard"},position:{x:300,y:80},size:{width:180,height:120},color:"#22c55e",priority:"medium",assignee:"Bob",createdAt:at,updatedAt:at},{type:"card",card_id:"sample-3",card_type:"text",card_title:"Deploy",card_link:[],content:{text:"Set up CI pipeline"},position:{x:150,y:250},size:{width:180,height:120},color:"#f59e0b",priority:"low",createdAt:at,updatedAt:at},{type:"card",card_id:"sample-4",card_type:"text",card_title:"Docs",card_link:[],content:{text:"Write API reference"},position:{x:400,y:280},size:{width:180,height:120},color:"#a855f7",priority:"medium",assignee:"Carol",createdAt:at,updatedAt:at}],viewport:{panX:0,panY:0,zoom:1}};function Dd(e){return e.collection.length===0}function rs(e){let t=e.boardId||"default",{state:n,dispatch:r,undo:i,redo:s,canUndo:a,canRedo:l}=ts(Td,t),[d,u]=U(go[0]),[h,m]=U(!1),[c,p]=U(""),[f,y]=U(null),[x,g]=U(null),[b,S]=U(n.name||"Untitled"),[I,A]=U(!1),[C,T]=U(""),[L,R]=U(null),[$,B]=U(!0),[E,N]=U([{name:"relates to",weight:1},{name:"depends on",weight:2},{name:"blocks",weight:3},{name:"is blocked by",weight:3},{name:"implements",weight:2},{name:"references",weight:1}]),[z,k]=U(null),[w,D]=U(""),[M,F]=U("1"),[P,W]=U([]),_=ne(!1);re(()=>{!_.current&&Dd(n)?(_.current=!0,r({type:"SET_BOARD",state:$d})):n.collection.length>0&&(_.current=!0)},[n,r]);let O=v(()=>{let ue=(-n.viewport.panX+300)/n.viewport.zoom,ve=(-n.viewport.panY+200)/n.viewport.zoom,ke=(Math.random()-.5)*300,Pe=(Math.random()-.5)*200,Ke={type:"card",card_id:qe(),card_type:"text",card_title:"New Card",card_link:[],content:{text:""},color:d,position:{x:Math.round(ue+ke),y:Math.round(ve+Pe)},size:{width:180,height:120},priority:"medium",createdAt:Date.now(),updatedAt:Date.now()};r({type:"ADD_ITEM",item:Ke})},[n.viewport,d,r]),Y=v(()=>{r({type:"ZOOM",zoom:n.viewport.zoom+.1})},[n.viewport.zoom,r]),K=v(()=>{r({type:"ZOOM",zoom:n.viewport.zoom-.1})},[n.viewport.zoom,r]),Q=v(()=>{r({type:"ZOOM",zoom:1})},[r]),q=v(()=>{m(ue=>!ue)},[]),H=v(ue=>{p(ue)},[]),j=v(ue=>{y(ue)},[]),G=v(ue=>{g(ue)},[]),V=v(()=>{B(ue=>!ue)},[]),Z=v(()=>{r({type:"SET_BOARD",state:tt}),y(null)},[r]),te=v(()=>{let ue=JSON.stringify(n,null,2),ve=new Blob([ue],{type:"application/json"}),ke=URL.createObjectURL(ve),Pe=document.createElement("a");Pe.href=ke,Pe.download=`board-${t}.json`,Pe.style.display="none",document.body.appendChild(Pe),Pe.click(),document.body.removeChild(Pe),URL.revokeObjectURL(ke)},[n,t]),ae=v(()=>{let ue=document.createElement("input");ue.type="file",ue.accept=".json,application/json",ue.style.display="none",ue.addEventListener("change",()=>{let ve=ue.files&&ue.files[0];if(!ve)return;let ke=new FileReader;ke.onload=()=>{try{let Pe=JSON.parse(ke.result);Pe&&Pe.collection&&Pe.viewport&&r({type:"SET_BOARD",state:Pe})}catch{}},ke.readAsText(ve)}),document.body.appendChild(ue),ue.click(),document.body.removeChild(ue)},[r]),J=v(()=>{window.print()},[]),ie=os(n.collection),le=v(()=>{let ue=os(n.collection);ue.length>0&&y(ue[0].card_id)},[n.collection]),fe=v(()=>{f&&(r({type:"REMOVE_ITEM",itemId:f}),y(null))},[f,r]),oe=v(()=>{if(n.collection.length===0)return;let ke=qi(n.collection,800,600);r({type:"PAN",panX:ke.panX,panY:ke.panY}),r({type:"ZOOM",zoom:ke.zoom})},[n.collection,r]);re(()=>{let ue={menus:[{label:"File",items:[{label:"New Board",onClick:Z},{label:"Export JSON",onClick:te},{label:"Import JSON",onClick:ae},{divider:!0},{label:"Print",onClick:J}]},{label:"Edit",items:[{label:"Undo",shortcut:"Ctrl+Z",onClick:i,disabled:!a},{label:"Redo",shortcut:"Ctrl+Y",onClick:s,disabled:!l},{divider:!0},{label:"Select All",shortcut:"Ctrl+A",onClick:le},{label:"Delete Selected",onClick:fe}]},{label:"View",items:[{label:"Zoom In",onClick:Y},{label:"Zoom Out",onClick:K},{label:"Fit All",onClick:oe},{divider:!0},{label:"Toggle Grid",onClick:q}]}]}},[Z,te,ae,J,i,s,a,l,le,fe,Y,K,oe,q]),re(()=>{let ue=ve=>{let ke=ve;ke.ctrlKey&&ke.key==="z"?(ke.preventDefault(),i()):ke.ctrlKey&&ke.key==="y"&&(ke.preventDefault(),s())};return document.addEventListener("keydown",ue),()=>document.removeEventListener("keydown",ue)},[i,s]),re(()=>{if(!L)return;let ue=()=>R(null),ve=setTimeout(()=>document.addEventListener("click",ue),0);return()=>{clearTimeout(ve),document.removeEventListener("click",ue)}},[L]);let ge=v(()=>{T(b),A(!0)},[b]),he=v(()=>{let ue=C.trim();ue&&(S(ue),r({type:"RENAME_BOARD",name:ue}),e.onTitleChange&&e.onTitleChange(`Project Board: ${ue}`)),A(!1)},[C,r,e.onTitleChange]),ee=v(()=>{A(!1)},[]),de=v(ue=>{T(ue.target.value)},[]),me=v(ue=>{let ve=ue;ve.key==="Enter"&&(ve.preventDefault(),he()),ve.key==="Escape"&&(ve.preventDefault(),ee())},[he,ee]),xe={display:"flex",flexDirection:"column",width:"100%",height:"100%",backgroundColor:"#f8fafc",overflow:"hidden"},ye=v((ue,ve)=>{let ke=(-n.viewport.panX+300)/n.viewport.zoom,Pe=(-n.viewport.panY+200)/n.viewport.zoom,Ke=(Math.random()-.5)*300,Qe=(Math.random()-.5)*200,ct={type:"card",card_id:qe(),card_type:"text",card_title:ue,card_link:[],content:{text:ve},color:d,position:{x:Math.round(ke+Ke),y:Math.round(Pe+Qe)},size:{width:180,height:120},priority:"medium",createdAt:Date.now(),updatedAt:Date.now()};r({type:"ADD_ITEM",item:ct})},[n.viewport,d,r]),Me={display:"flex",alignItems:"center",height:"28px",backgroundColor:"#f1f5f9",borderBottom:"1px solid #e2e8f0",padding:"0 8px",fontSize:"13px",flexShrink:"0"},ce={padding:"2px 10px",border:"none",backgroundColor:"transparent",cursor:"pointer",fontSize:"13px",color:"#334155",borderRadius:"4px",fontFamily:"inherit"},be=v(()=>{let ue=(-n.viewport.panX+300)/n.viewport.zoom,ve=(-n.viewport.panY+200)/n.viewport.zoom,ke=(Math.random()-.5)*300,Pe=(Math.random()-.5)*200;r({type:"ADD_CONTAINER",container:{type:"container",container_id:qe(),name:"New Container",position:{x:Math.round(ue+ke),y:Math.round(ve+Pe)},size:{width:300,height:250},contents:[]}}),R(null)},[n.viewport,r]),Ee={position:"absolute",top:"100%",left:"0",marginTop:"2px",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"180px",zIndex:"1000"},Re={display:"block",width:"100%",padding:"6px 14px",border:"none",backgroundColor:"transparent",textAlign:"left",cursor:"pointer",fontSize:"13px",color:"#334155",fontFamily:"inherit",boxSizing:"border-box"},Ne=o("div",{style:Me,"data-testid":"app-menu-bar"},o("div",{style:{position:"relative",display:"inline-flex"}},o("button",{style:ce,onClick:()=>R(L==="project"?null:"project")},"Project"),L==="project"?o("div",{style:Ee},o("button",{style:Re,onClick:()=>{ge(),R(null)}},"Rename Project..."),o("div",{style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}}),o("button",{style:Re,onClick:()=>{be()}},"New Container"),o("button",{style:Re,onClick:()=>{O(),R(null)}},"New Card")):null),o("div",{style:{position:"relative",display:"inline-flex"}},o("button",{style:ce,onClick:()=>R(L==="graphs"?null:"graphs")},"Graphs"),L==="graphs"?o("div",{style:Ee},o("button",{style:Re,onClick:()=>{D(""),F("1"),k("add"),R(null)}},"Add Attribute..."),o("button",{style:Re,onClick:()=>{k("delete"),R(null)}},"Delete Attribute..."),o("button",{style:Re,onClick:()=>{W(E.map(ue=>({...ue}))),k("edit"),R(null)}},"Edit Attributes...")):null),o("div",{style:{position:"relative",display:"inline-flex"}},o("button",{style:ce,onClick:()=>R(L==="settings"?null:"settings")},"Settings"),L==="settings"?o("div",{style:Ee},o("button",{style:Re,onClick:()=>{q(),R(null)}},h?"Disable Grid Snap":"Enable Grid Snap"),o("button",{style:Re,onClick:()=>{V(),R(null)}},$?"Hide Links":"Show Links")):null),o("div",{style:{position:"relative",display:"inline-flex"}},o("button",{style:ce,onClick:()=>R(L==="help"?null:"help")},"Help"),L==="help"?o("div",{style:Ee},o("button",{style:Re,onClick:()=>R(null)},"About Project Board"),o("button",{style:Re,onClick:()=>R(null)},"Keyboard Shortcuts")):null),o("span",{style:{marginLeft:"auto",fontSize:"12px",color:"#94a3b8"}},`Project Board: ${b}`)),se=I?o("div",{style:{position:"absolute",inset:"0",backgroundColor:"rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"200"},onClick:ee},o("div",{style:{backgroundColor:"#ffffff",borderRadius:"8px",padding:"20px",boxShadow:"0 8px 24px rgba(0,0,0,0.2)",minWidth:"300px"},onClick:ue=>ue.stopPropagation(),role:"dialog","aria-label":"Rename project"},o("div",{style:{fontWeight:"600",fontSize:"14px",marginBottom:"12px",color:"#1a1a1a"}},"Rename Project"),o("input",{type:"text",value:C,onInput:de,onKeyDown:me,autoFocus:!0,style:{width:"100%",padding:"8px 10px",border:"1px solid #d1d5db",borderRadius:"6px",fontSize:"14px",boxSizing:"border-box",outline:"none",fontFamily:"inherit"},"data-testid":"rename-input"}),o("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"12px"}},o("button",{onClick:ee,style:{padding:"6px 14px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",cursor:"pointer",fontSize:"13px",fontFamily:"inherit"}},"Cancel"),o("button",{onClick:he,style:{padding:"6px 14px",border:"none",borderRadius:"6px",backgroundColor:"#3b82f6",color:"#ffffff",cursor:"pointer",fontSize:"13px",fontWeight:"600",fontFamily:"inherit"},"data-testid":"rename-confirm"},"Rename")))):null,pe={position:"absolute",inset:"0",backgroundColor:"rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"200"},Se={backgroundColor:"#ffffff",borderRadius:"8px",padding:"20px",boxShadow:"0 8px 24px rgba(0,0,0,0.2)",minWidth:"320px",maxHeight:"400px",overflow:"auto"},we={fontWeight:"600",fontSize:"14px",marginBottom:"12px",color:"#1a1a1a"},Ie={width:"100%",padding:"8px 10px",border:"1px solid #d1d5db",borderRadius:"6px",fontSize:"14px",boxSizing:"border-box",outline:"none",fontFamily:"inherit"},Be={padding:"6px 14px",border:"none",borderRadius:"6px",backgroundColor:"#3b82f6",color:"#ffffff",cursor:"pointer",fontSize:"13px",fontWeight:"600",fontFamily:"inherit"},Ae={padding:"6px 14px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",cursor:"pointer",fontSize:"13px",fontFamily:"inherit"},De=null;return z==="add"&&(De=o("div",{style:pe,onClick:()=>k(null)},o("div",{style:Se,onClick:ue=>ue.stopPropagation(),role:"dialog","aria-label":"Add edge attribute"},o("div",{style:we},"Add Edge Attribute"),o("div",{style:{marginBottom:"8px"}},o("label",{style:{fontSize:"12px",color:"#64748b",display:"block",marginBottom:"4px"}},"Name"),o("input",{type:"text",value:w,style:Ie,placeholder:"e.g. depends on",onInput:ue=>D(ue.target.value)})),o("div",{style:{marginBottom:"12px"}},o("label",{style:{fontSize:"12px",color:"#64748b",display:"block",marginBottom:"4px"}},"Weight"),o("input",{type:"number",value:M,style:Ie,min:"0",step:"1",onInput:ue=>F(ue.target.value)})),o("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px"}},o("button",{style:Ae,onClick:()=>k(null)},"Cancel"),o("button",{style:Be,onClick:()=>{let ue=w.trim(),ve=parseFloat(M)||1;ue&&N(ke=>[...ke,{name:ue,weight:ve}]),k(null)}},"Add"))))),z==="delete"&&(De=o("div",{style:pe,onClick:()=>k(null)},o("div",{style:Se,onClick:ue=>ue.stopPropagation(),role:"dialog","aria-label":"Delete edge attribute"},o("div",{style:we},"Delete Edge Attribute"),E.length===0?o("div",{style:{color:"#94a3b8",padding:"8px 0"}},"No attributes defined."):o("div",{style:{display:"flex",flexDirection:"column",gap:"4px"}},...E.map((ue,ve)=>o("div",{key:String(ve),style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 8px",borderRadius:"4px",border:"1px solid #e5e7eb"}},o("span",{style:{fontSize:"13px"}},`${ue.name} (weight: ${ue.weight})`),o("button",{style:{border:"none",backgroundColor:"transparent",color:"#ef4444",cursor:"pointer",fontSize:"16px"},onClick:()=>N(ke=>ke.filter((Pe,Ke)=>Ke!==ve))},"\xD7")))),o("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"12px"}},o("button",{style:Ae,onClick:()=>k(null)},"Done"))))),z==="edit"&&(De=o("div",{style:pe,onClick:()=>k(null)},o("div",{style:{...Se,minWidth:"400px"},onClick:ue=>ue.stopPropagation(),role:"dialog","aria-label":"Edit edge attributes"},o("div",{style:we},"Edit Edge Attributes"),P.length===0?o("div",{style:{color:"#94a3b8",padding:"8px 0"}},"No attributes defined."):o("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},...P.map((ue,ve)=>o("div",{key:String(ve),style:{display:"flex",alignItems:"center",gap:"8px"}},o("input",{type:"text",value:ue.name,style:{...Ie,flex:"1"},onInput:ke=>{let Pe=ke.target.value;W(Ke=>Ke.map((Qe,ct)=>ct===ve?{...Qe,name:Pe}:Qe))}}),o("input",{type:"number",value:String(ue.weight),min:"0",step:"1",style:{...Ie,width:"80px"},onInput:ke=>{let Pe=parseFloat(ke.target.value)||0;W(Ke=>Ke.map((Qe,ct)=>ct===ve?{...Qe,weight:Pe}:Qe))}})))),o("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"12px"}},o("button",{style:Ae,onClick:()=>k(null)},"Cancel"),o("button",{style:Be,onClick:()=>{N(P.filter(ue=>ue.name.trim())),k(null)}},"Save"))))),o("div",{className:"project-manager-app",style:xe,"data-testid":"project-manager-app"},Ne,o(Zi,{zoom:n.viewport.zoom,gridEnabled:h,selectedColor:d,colorFilter:x,onNewCard:O,onZoomIn:Y,onZoomOut:K,onZoomReset:Q,onColorSelect:u,onColorFilter:G,onGridToggle:q,onSearch:H}),o(ns,{collection:n.collection,onCardDropped:ye},o(Nt,{state:n,dispatch:r,searchQuery:c,gridEnabled:h,selectedId:f,onSelectItem:j,colorFilter:x,onUpdateItem:(ue,ve)=>{r({type:"UPDATE_CARD",cardId:ue,updates:ve})},onCardContextMenu:(ue,ve)=>{}})),se,De)}var zd=28,Ad=5e3;var is=0;function ss(e){return is++,`${e}-${is}`}function Ld(e){return e.replace(/\s*\(\d+\)$/,"")}function Bd(e){let{toasts:t,onDismiss:n}=e;if(t.length===0)return null;let r={position:"absolute",top:"8px",right:"8px",zIndex:"9999",display:"flex",flexDirection:"column",gap:"8px",pointerEvents:"none",maxWidth:"320px"},i=t.map(s=>{let a="rgba(50, 50, 50, 0.95)",l="#555";return s.severity==="warning"?(a="rgba(60, 40, 10, 0.95)",l="#f39c12"):s.severity==="error"&&(a="rgba(60, 10, 10, 0.95)",l="#e74c3c"),o("div",{key:String(s.id),className:`unity-desktop__toast unity-desktop__toast--${s.severity}`,style:{backgroundColor:a,border:`1px solid ${l}`,borderRadius:"6px",padding:"10px 14px",color:"#ffffff",fontSize:"13px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",pointerEvents:"auto",cursor:"pointer",transition:"opacity 200ms ease"},onClick:()=>n(s.id),role:"alert","aria-live":"polite"},s.message)});return o("div",{className:"unity-desktop__toast-container",style:r,"aria-label":"Notifications"},...i)}function Fd(){let e=st(),t=ne(!1);return re(()=>{t.current||(t.current=!0,e.publish("terminal-output",{text:"Terminal session started",pid:1}))},[e]),o("div",{style:{padding:"16px",fontSize:"12px",color:"#00ff41",height:"100%",overflow:"auto",backgroundColor:"#1a1a2e",fontFamily:"monospace"}},o("div",null,"$ whoami"),o("div",null,"operator"),o("div",null,"$ uname -a"),o("div",null,"Linux specifyjs 6.1.0 #1 SMP x86_64 GNU/Linux"),o("div",{style:{opacity:"0.6",marginTop:"8px",fontSize:"10px"}},"[Published terminal-output message]"),o("div",null,"$ _"))}function Nd(){let[e,t]=U([]),n=pt();Dt("terminal-output",s=>{t(a=>[...a,`[terminal] ${s.payload.text}`])});let r=v(s=>{s.preventDefault(),n.startDrag({type:"application/file",data:{name:"readme.txt",size:1024},sourceAppId:"files",preview:"readme.txt"})},[n]);return o("div",{style:{padding:"16px",fontSize:"13px",color:"var(--color-text, #333)",height:"100%",overflow:"auto"}},o("div",{style:{fontWeight:"600",marginBottom:"12px"}},"Home"),o("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},...["\u{1F4C1} Documents","\u{1F4C1} Downloads","\u{1F4C1} Music","\u{1F4C1} Pictures","\u{1F4C1} Videos"].map(s=>o("span",{style:{cursor:"pointer"}},s)),o("span",{style:{cursor:"grab",padding:"4px 8px",border:"1px dashed #94a3b8",borderRadius:"4px",backgroundColor:"rgba(148, 163, 184, 0.1)"},onMouseDown:r,"aria-label":"Drag readme.txt"},"\u{1F4C4} readme.txt (drag me)")),e.length>0?o("div",{style:{marginTop:"12px",padding:"8px",backgroundColor:"rgba(0,0,0,0.05)",borderRadius:"4px",fontSize:"11px",fontFamily:"monospace"}},o("div",{style:{fontWeight:"600",marginBottom:"4px"}},"Messages received:"),...e.map((s,a)=>o("div",{key:String(a),style:{color:"#64748b"}},s))):null)}function Wd(e,t,n){let r={padding:"16px",fontSize:"13px",color:"var(--color-text, #333)",height:"100%",overflow:"auto"};switch(Ld(e)){case"Files":return o(it,{appId:"files"},o(Nd,null));case"Terminal":return o(it,{appId:"terminal"},o(Fd,null));case"Browser":return o("div",{style:r},o("div",{style:{padding:"6px 10px",backgroundColor:"#f1f5f9",borderRadius:"4px",marginBottom:"12px",fontSize:"12px",color:"#64748b"}},"https://specifyjs.asymmetric-effort.com"),o("div",{style:{textAlign:"center",padding:"32px",color:"#94a3b8"}},"Web page content area"));case"Mail":return o("div",{style:r},o("div",{style:{fontWeight:"600",marginBottom:"8px"}},"Inbox (3)"),...["Build passed \u2014 CI/CD Pipeline","PR Review: feat/unity-desktop","Weekly sync notes"].map(s=>o("div",{style:{padding:"8px",borderBottom:"1px solid #e2e8f0",cursor:"pointer"}},s)));case"Settings":return o("div",{style:r},o("div",{style:{fontWeight:"600",marginBottom:"12px"}},"System Settings"),...["Appearance","Network","Sound","Power","Users","About"].map(s=>o("div",{style:{padding:"8px 0",borderBottom:"1px solid #e2e8f0"}},s)));case"Word Processor":return o(on,null);case"IDE":return o(mn,null);case"Trading":return o(bn,null);case"Project Board":return o(rs,{boardId:t||"default",onTitleChange:n||void 0});default:return o("div",{style:r},o("div",{style:{textAlign:"center",padding:"32px",color:"#94a3b8"}},`${e} application content`))}}function _d(e){let{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s="dark",children:a}=e,l=vt(),d=l.activeMenuBar,u=l.dockSignals,h=ne(l);h.current=l;let[m,c]=U([]),[p,f]=U([]),[y,x]=U(!1),[g,b]=U(!1),[S,I]=U(null),[A,C]=U({x:0,y:0}),[T,L]=U(null),R=v(()=>{x(ee=>!ee)},[]),$=v(ee=>{f(de=>de.filter(me=>me.id!==ee))},[]);re(()=>{if(p.length===0)return;let ee=p[0],de=Date.now()-ee.timestamp,me=Math.max(0,Ad-de),xe=setTimeout(()=>{f(ye=>ye.filter(Me=>Me.id!==ee.id))},me);return()=>clearTimeout(xe)},[p]);let B=ne(t);B.current=t;let E=ne(r);E.current=r;let N=ne({});for(let ee of m)if(!N.current[ee.id]){let de=ee.id;N.current[de]=me=>{c(xe=>xe.map(ye=>ye.id===de?{...ye,title:me}:ye))}}let z=v(ee=>{let me=B.current.find(xe=>xe.id===ee);me&&(c(xe=>{let Me=xe.filter(Ne=>Ne.appId===ee).length+1,ce=Me===1?me.label:`${me.label} (${Me})`,be=ss(ee),Ee=xe.length>0?Math.max(...xe.map(Ne=>Ne.zIndex))+1:1,Re={id:be,appId:me.id,title:ce,icon:me.icon,x:60+xe.length*30,y:40+xe.length*30,width:600,height:400,zIndex:Ee,focused:!0,windowState:"normal"};return[...xe.map(Ne=>({...Ne,focused:!1})),Re]}),ee==="files"&&h.current.setMenuBar("files",{menus:[{label:"File",items:[{label:"New",shortcut:"Ctrl+N",onClick:()=>{}},{label:"Open",shortcut:"Ctrl+O",onClick:()=>{}},{label:"Save",shortcut:"Ctrl+S",onClick:()=>{}}]},{label:"Edit",items:[{label:"Cut",shortcut:"Ctrl+X",onClick:()=>{}},{label:"Copy",shortcut:"Ctrl+C",onClick:()=>{}},{label:"Paste",shortcut:"Ctrl+V",onClick:()=>{}}]}]}),ee==="terminal"&&h.current.signalDock("terminal",{badge:3}),E.current&&E.current(ee))},[]),k=v(ee=>{c(de=>{if(!de.find(ye=>ye.id===ee))return de;let xe=Math.max(...de.map(ye=>ye.zIndex))+1;return de.map(ye=>ye.id===ee?{...ye,focused:!0,zIndex:xe,windowState:ye.windowState==="minimized"?"normal":ye.windowState}:{...ye,focused:!1})})},[]),w=v(ee=>{c(de=>{let me=de.filter(ce=>ce.appId===ee);if(me.length===0)return de;let ye=[...me].sort((ce,be)=>be.zIndex-ce.zIndex)[0],Me=Math.max(...de.map(ce=>ce.zIndex))+1;return de.map(ce=>ce.id===ye.id?{...ce,focused:!0,zIndex:Me,windowState:ce.windowState==="minimized"?"normal":ce.windowState}:{...ce,focused:!1})}),c(de=>{if(de.filter(xe=>xe.appId===ee).length===0){let ye=B.current.find(Ee=>Ee.id===ee);if(!ye)return de;let Me=ss(ee),ce=de.length>0?Math.max(...de.map(Ee=>Ee.zIndex))+1:1,be={id:Me,appId:ye.id,title:ye.label,icon:ye.icon,x:60+de.length*30,y:40+de.length*30,width:600,height:400,zIndex:ce,focused:!0,windowState:"normal"};return ee==="files"&&h.current.setMenuBar("files",{menus:[{label:"File",items:[{label:"New",shortcut:"Ctrl+N",onClick:()=>{}},{label:"Open",shortcut:"Ctrl+O",onClick:()=>{}},{label:"Save",shortcut:"Ctrl+S",onClick:()=>{}}]},{label:"Edit",items:[{label:"Cut",shortcut:"Ctrl+X",onClick:()=>{}},{label:"Copy",shortcut:"Ctrl+C",onClick:()=>{}},{label:"Paste",shortcut:"Ctrl+V",onClick:()=>{}}]}]}),ee==="terminal"&&h.current.signalDock("terminal",{badge:3}),E.current&&E.current(ee),[...de.map(Ee=>({...Ee,focused:!1})),be]}return de})},[]),D=t.map(ee=>{let de=m.some(ye=>ye.appId===ee.id),me=u.get(ee.id),xe={id:ee.id,icon:ee.icon,label:me?.tooltip||ee.label,active:de};return me&&(me.badge!=null&&(xe.badge=me.badge>0?me.badge:void 0),me.progress!=null&&(xe.progress=me.progress>0?me.progress:void 0),me.urgent&&(xe.urgent=!0)),xe}),M=m.find(ee=>ee.focused),F=M?M.title:void 0,P=v(()=>{b(!0)},[]),W=v(()=>{b(!1)},[]),_=v((ee,de)=>{I(ee),C(de)},[]),O=v(()=>{I(null)},[]),Y=v(()=>{},[]),K=v(()=>{i&&i()},[i]),Q=[];n&&(Q.push({label:n.name,icon:void 0,onClick:Y,divider:!1}),Q.push({label:"",icon:void 0,onClick:Y,divider:!0})),Q.push({label:"Lock",icon:void 0,onClick:P,divider:!1}),Q.push({label:"Logout",icon:void 0,onClick:K,divider:!1});let q=X(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'Ubuntu, "Segoe UI", sans-serif',fontSize:"13px",color:s==="dark"?"#ffffff":"#1a1a1a",overflow:"hidden",position:"relative"}),[s]),H={display:"flex",flex:"1",overflow:"hidden"},j={display:"flex",flexDirection:"column",height:"100%",backgroundColor:s==="dark"?"var(--dock-bg, rgba(0, 0, 0, 0.7))":"var(--dock-bg, rgba(200, 200, 200, 0.9))",borderRight:s==="dark"?"1px solid rgba(255, 255, 255, 0.1)":"1px solid rgba(0, 0, 0, 0.1)",flexShrink:"0"},G={width:"100%",height:"100%",position:"relative"},V=o(en,{activeAppName:F,activitiesButton:{label:"Activities",onClick:R},appMenuBar:d||void 0,clockFormat:"24h",showSeconds:!0,showDate:!0,user:n?{name:n.name,avatar:n.avatar}:void 0,userMenuItems:Q.length>0?Q:void 0,height:zd}),Z=o(tn,{items:D,orientation:"vertical",position:"left",iconSize:36,onItemClick:w,onItemContextMenu:_}),te=o(Bd,{toasts:p,onDismiss:$}),ae=m.filter(ee=>ee.windowState!=="minimized").map(ee=>o(kt,{key:ee.id,id:ee.id,title:ee.title,icon:ee.icon,defaultPosition:{x:ee.x,y:ee.y},defaultSize:{width:ee.width,height:ee.height},zIndex:ee.zIndex,focused:ee.focused,windowState:ee.windowState,onClose:()=>{c(de=>de.filter(me=>me.id!==ee.id))},onFocus:()=>{c(de=>{let me=Math.max(...de.map(xe=>xe.zIndex))+1;return de.map(xe=>xe.id===ee.id?{...xe,focused:!0,zIndex:me}:{...xe,focused:!1})})},onMinimize:()=>{c(de=>de.map(me=>me.id===ee.id?{...me,windowState:"minimized"}:me))},onMaximize:()=>{c(de=>de.map(me=>me.id===ee.id?{...me,windowState:me.windowState==="maximized"?"normal":"maximized"}:me))}},Wd(t.find(de=>de.id===ee.appId)?.label||ee.title,ee.id,N.current[ee.id]))),J=[];a&&J.push(a),J.push(...ae),J.push(te);let ie=o(nn,{backgroundColor:s==="dark"?"#2c001e":"#e8e0e4",backgroundGradient:s==="dark"?"linear-gradient(135deg, #2c001e 0%, #5e2750 50%, #2c001e 100%)":"linear-gradient(135deg, #e8e0e4 0%, #d4c4d0 50%, #e8e0e4 100%)"},o("div",{className:"unity-desktop__workspace",style:G},...J)),le=y?o("div",{style:{position:"absolute",inset:"0",zIndex:"100",backgroundColor:"rgba(0, 0, 0, 0.85)",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(80px, 1fr))",gap:"24px",padding:"48px",alignContent:"start",overflowY:"auto"},onClick:R},...t.map(ee=>o("button",{key:ee.id,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",color:"#ffffff",cursor:"pointer",padding:"12px",borderRadius:"8px",fontSize:"12px"},onClick:de=>{de.stopPropagation(),x(!1),w(ee.id)}},o("span",{style:{fontSize:"32px",display:"block"}},ee.icon),o("span",null,ee.label)))):null,fe=g?o("div",{className:"unity-desktop__lock-overlay",style:{position:"absolute",inset:"0",zIndex:"9999",backgroundColor:"rgba(0,0,0,0.85)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#ffffff"},onClick:W},o("div",{style:{fontSize:"64px",marginBottom:"16px"}},"\u{1F512}"),o("div",{style:{fontSize:"24px",fontWeight:"600",marginBottom:"8px"}},"Locked"),o("div",{style:{fontSize:"14px",opacity:"0.7"}},"Click to unlock")):null,oe=(()=>{if(!S)return null;let ee=t.find(ce=>ce.id===S),de=m.filter(ce=>ce.appId===S),me={padding:"6px 14px",cursor:"pointer"},xe={onMouseEnter:ce=>{ce.currentTarget.style.backgroundColor="#444"},onMouseLeave:ce=>{ce.currentTarget.style.backgroundColor="transparent"}},ye={borderBottom:"1px solid #444",margin:"4px 0"},Me=[];return Me.push(o("div",{key:"new",style:me,...xe,onClick:()=>{z(S),I(null)},role:"menuitem"},"\u25CF New")),de.length>0&&(Me.push(o("div",{key:"sep-1",style:ye})),de.forEach((ce,be)=>{let Ee=ce.title;Me.push(o("div",{key:`inst-${ce.id}`,style:me,...xe,onClick:()=>{k(ce.id),I(null)},role:"menuitem"},Ee))})),Me.push(o("div",{key:"sep-2",style:ye})),Me.push(o("div",{key:"about",style:me,...xe,onClick:()=>{L(S),I(null)},role:"menuitem"},"About")),o("div",{className:"unity-desktop__context-menu-backdrop",style:{position:"absolute",inset:"0",zIndex:"9000"},onClick:O},o("div",{className:"unity-desktop__context-menu",style:{position:"absolute",top:`${A.y}px`,left:`${A.x}px`,backgroundColor:"#2d2d2d",border:"1px solid #555",borderRadius:"6px",padding:"4px 0",minWidth:"160px",boxShadow:"0 4px 12px rgba(0,0,0,0.4)",zIndex:"9001",color:"#ffffff",fontSize:"13px"},onClick:ce=>ce.stopPropagation()},...Me))})(),ge=T?t.find(ee=>ee.id===T):null,he=ge?o("div",{className:"unity-desktop__about-backdrop",style:{position:"absolute",inset:"0",zIndex:"9500",backgroundColor:"rgba(0,0,0,0.5)",display:"flex",alignItems:"center",justifyContent:"center"},onClick:()=>L(null)},o("div",{style:{backgroundColor:"#2d2d2d",border:"1px solid #555",borderRadius:"8px",padding:"24px",minWidth:"280px",color:"#ffffff",textAlign:"center"},onClick:ee=>ee.stopPropagation()},o("div",{style:{fontSize:"18px",fontWeight:"600",marginBottom:"8px"}},ge.label),o("div",{style:{fontSize:"13px",marginBottom:"4px",color:"#aaa"}},"SpecifyJS Demo App"),o("div",{style:{fontSize:"13px",marginBottom:"4px",color:"#aaa"}},"MIT License"),o("div",{style:{fontSize:"13px",color:"#aaa"}},"v0.2.47"),o("button",{style:{marginTop:"16px",padding:"6px 16px",border:"1px solid #555",borderRadius:"4px",backgroundColor:"#444",color:"#fff",cursor:"pointer"},onClick:()=>L(null)},"Close"))):null;return o("div",{className:"unity-desktop",style:q,"data-theme":s},o("div",{className:"unity-desktop__top-panel",style:{flexShrink:"0",zIndex:"10"}},V),o("div",{style:H},o("div",{className:"unity-desktop__dock",style:j},Z),o("main",{className:"unity-desktop__desktop",style:{flex:"1",position:"relative",overflow:"hidden",minHeight:"0"}},ie,le)),oe,he,fe)}function as(e){let{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s="dark",children:a}=e;return o(Qt,{onWindowOpen:r},o($t,null,o(zt,null,o(_d,{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s,children:a}))))}function ls(e){let{id:t,title:n,icon:r,defaultPosition:i,defaultSize:s,minSize:a,resizable:l=!0,onClose:d,menuBar:u,onActivate:h,onDeactivate:m,children:c}=e,p=vt(),f=X(()=>p.windows.find(T=>T.id===t),[p.windows,t]);re(()=>(u?p.setMenuBar(t,u):p.clearMenuBar(t),()=>{p.clearMenuBar(t)}),[u,t,p]);let y=ne(!1),x=f?f.focused:!1;re(()=>{let T=y.current;y.current=x,x&&!T?h&&h():!x&&T&&m&&m()},[x,h,m]);let g=v(()=>{p.closeWindow(t),d&&d()},[p,t,d]),b=v(()=>{p.focusWindow(t)},[p,t]),S=v(T=>{p.moveWindow(t,T)},[p,t]),I=v(T=>{p.resizeWindow(t,T)},[p,t]),A=v(()=>{p.minimizeWindow(t)},[p,t]),C=v(()=>{f&&f.windowState==="maximized"?p.restoreWindow(t):p.maximizeWindow(t)},[p,t,f]);return f?o(it,{appId:t},o(kt,{id:t,title:n,icon:r,defaultPosition:f.position,defaultSize:f.size,minSize:a,resizable:l,windowState:f.windowState,focused:f.focused,zIndex:f.zIndex,onClose:g,onFocus:b,onMove:S,onResize:I,onMinimize:A,onMaximize:C,children:c})):(p.openWindow({id:t,title:n,icon:r,position:i,size:s}),null)}function Od(e,t){let n=new Set,r=[];for(let i=e.length-1;i>=0;i--)r.push(e[i]);for(;r.length>0;){let i=r.pop();if($e(i)){if(t&&i.container_id===t)continue;i.name&&n.add(i.name);for(let s=i.contents.length-1;s>=0;s--)r.push(i.contents[s])}}return n}function ho(e,t,n){return!e||(!n||t.container_id!==n)&&t.name===e?!1:!Od(t.contents,n).has(e)}function cs(e,t,n){if(!e)return!1;for(let r=0;r<t.length;r++){let i=t[r];if($e(i)&&!(n&&i.container_id===n)&&i.name===e)return!1}return!0}function ds(e,t,n){return ho(e,t,n)}var us={sm:{padding:"3px 10px",fontSize:"12px",borderRadius:"4px"},md:{padding:"6px 14px",fontSize:"13px",borderRadius:"6px"},lg:{padding:"8px 20px",fontSize:"15px",borderRadius:"6px"}},ps={primary:{bg:"#3b82f6",color:"white",border:"#3b82f6"},secondary:{bg:"#f8fafc",color:"#0f172a",border:"#d1d5db"},outline:{bg:"transparent",color:"#0f172a",border:"#d1d5db"},ghost:{bg:"transparent",color:"#0f172a",border:"transparent"},danger:{bg:"#ef4444",color:"white",border:"#ef4444"}};function fs(e){let{children:t,onClick:n,variant:r="secondary",size:i="md",disabled:s=!1,fullWidth:a=!1,type:l="button",className:d,style:u,ariaLabel:h,active:m=!1}=e,c=X(()=>{let p=us[i]??us.md,f=ps[r]??ps.secondary,y={padding:p.padding,fontSize:p.fontSize,borderRadius:p.borderRadius,border:`1px solid ${f.border}`,backgroundColor:m?"#3b82f6":f.bg,color:m?"white":f.color,cursor:s?"default":"pointer",fontFamily:"inherit",lineHeight:"1.4",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"4px",transition:"background-color 0.15s, opacity 0.15s",opacity:s?"0.5":"1"};return a&&(y.width="100%"),u&&Object.assign(y,u),y},[r,i,s,a,m,u]);return o("button",{type:l,onClick:s?void 0:n,disabled:s,className:d,style:c,"aria-label":h,"aria-pressed":m?"true":void 0},t)}var Hd=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],It=Math.PI/180;function Yd(e,t,n,r,i,s,a,l,d,u){let h=Math.cos(r*It),m=Math.sin(r*It),c=Math.cos(i*It),p=Math.sin(i*It),f=Math.cos(s*It),y=Math.sin(s*It),x=e*f-t*y,g=e*y+t*f,b=x*c-g*p,S=x*p+g*c,I=n,A=b,C=S*h-I*m,T=S*m+I*h,L=1+a*.001*T,R=l+A*u*L,$=d-C*u*L;return{sx:R,sy:$,depth:T}}function ms(e,t){let n=e.replace("#",""),r,i,s;return n.length===3?(r=parseInt(n[0]+n[0],16),i=parseInt(n[1]+n[1],16),s=parseInt(n[2]+n[2],16)):(r=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16)),r=isNaN(r)?0:r,i=isNaN(i)?0:i,s=isNaN(s)?0:s,`rgba(${r},${i},${s},${t})`}function gs(e,t){let n=e.replace("#",""),r,i,s;n.length===3?(r=parseInt(n[0]+n[0],16),i=parseInt(n[1]+n[1],16),s=parseInt(n[2]+n[2],16)):(r=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16)),r=isNaN(r)?0:r,i=isNaN(i)?0:i,s=isNaN(s)?0:s;let a=d=>Math.max(0,Math.min(255,Math.round(d*t))),l=d=>a(d).toString(16).padStart(2,"0");return"#"+l(r)+l(i)+l(s)}function hs(e){let{layers:t,width:n=700,height:r=500,perspective:i=.5,rotateX:s=35,rotateY:a=45,rotateZ:l=0,showLabels:d=!0,showAxes:u=!0,layerSpacing:h=2,colorScale:m=Hd,gridColor:c="#94a3b8",title:p}=e,f=X(()=>{let z=0,k=0,w=0;for(let D=0;D<t.length;D++){let M=t[D],F=M.data.length;F>z&&(z=F);for(let P=0;P<F;P++){let W=M.data[P].length;W>k&&(k=W);for(let _=0;_<W;_++){let O=Math.abs(M.data[P][_]??0);O>w&&(w=O)}}}return{maxRows:Math.max(z,1),maxCols:Math.max(k,1),maxHeight:w>0?w:1}},[t]),y=X(()=>{let z=f.maxHeight+(t.length-1)*h+f.maxHeight,k=Math.sqrt(f.maxCols*f.maxCols+f.maxRows*f.maxRows+z*z),w=Math.min(n,r)*.75;return k>0?w/k:1},[f,t.length,h,n,r]),x=n/2,g=r/2,b=v((z,k,w)=>Yd(z,k,w,s,a,l,i,x,g,y),[s,a,l,i,x,g,y]),S=v(()=>{if(!u)return[];let z=[],k=Math.max(f.maxCols,f.maxRows),w=f.maxCols/2,D=f.maxRows/2,M=b(-w,-D,0),F=b(w,-D,0);z.push(o("line",{key:"axis-x",x1:String(M.sx),y1:String(M.sy),x2:String(F.sx),y2:String(F.sy),stroke:"#374151","stroke-width":"1.5"})),z.push(o("text",{key:"axis-x-label",x:String(F.sx+8),y:String(F.sy+4),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"X"));let P=b(-w,D,0);z.push(o("line",{key:"axis-y",x1:String(M.sx),y1:String(M.sy),x2:String(P.sx),y2:String(P.sy),stroke:"#374151","stroke-width":"1.5"})),z.push(o("text",{key:"axis-y-label",x:String(P.sx-12),y:String(P.sy+4),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Y"));let W=f.maxHeight+(t.length-1)*h,_=b(-w,-D,W);return z.push(o("line",{key:"axis-z",x1:String(M.sx),y1:String(M.sy),x2:String(_.sx),y2:String(_.sy),stroke:"#374151","stroke-width":"1.5"})),z.push(o("text",{key:"axis-z-label",x:String(_.sx-4),y:String(_.sy-8),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Z")),z},[u,f,t.length,h,b]),I=v(()=>{let z=[],k=f.maxCols/2,w=f.maxRows/2,D=[];for(let M=0;M<t.length;M++){let F=t[M],P=F.color??m[M%m.length],W=F.opacity??.7,_=M*h,O=F.data.length;for(let Y=0;Y<O-1;Y++){let K=F.data[Y],Q=F.data[Y+1],q=Math.min(K.length,Q.length);for(let H=0;H<q-1;H++){let j=H-k,G=H+1-k,V=Y-w,Z=Y+1-w,te=(K[H]??0)+_,ae=(K[H+1]??0)+_,J=(Q[H]??0)+_,ie=(Q[H+1]??0)+_,le=b(j,V,te),fe=b(G,V,ae),oe=b(j,Z,J),ge=b(G,Z,ie),he=(le.depth+fe.depth+oe.depth+ge.depth)/4,ee=`${le.sx},${le.sy} ${fe.sx},${fe.sy} ${ge.sx},${ge.sy} ${oe.sx},${oe.sy}`;D.push({points:ee,fill:ms(P,W),stroke:gs(P,.7),strokeWidth:"0.5",depth:he,key:`quad-${M}-${Y}-${H}`})}}if(O===1||O>0&&F.data[0].length===1)for(let Y=0;Y<O;Y++){let K=F.data[Y];for(let Q=0;Q<K.length;Q++){let q=Q-k,H=Y-w,j=(K[Q]??0)+_,G=b(q,H,j),V=3,Z=`${G.sx},${G.sy-V} ${G.sx+V},${G.sy} ${G.sx},${G.sy+V} ${G.sx-V},${G.sy}`;D.push({points:Z,fill:ms(P,W),stroke:gs(P,.7),strokeWidth:"0.5",depth:G.depth,key:`point-${M}-${Y}-${Q}`})}}}D.sort((M,F)=>M.depth-F.depth);for(let M=0;M<D.length;M++){let F=D[M];z.push(o("polygon",{key:F.key,points:F.points,fill:F.fill,stroke:F.stroke,"stroke-width":F.strokeWidth,"stroke-linejoin":"round"}))}return z},[t,f,h,m,b]),A=v(()=>{let z=[],k=f.maxCols/2,w=f.maxRows/2;for(let D=0;D<=f.maxRows;D++){let M=D-w,F=b(-k,M,0),P=b(k,M,0);z.push(o("line",{key:`base-h-${D}`,x1:String(F.sx),y1:String(F.sy),x2:String(P.sx),y2:String(P.sy),stroke:c,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}for(let D=0;D<=f.maxCols;D++){let M=D-k,F=b(M,-w,0),P=b(M,w,0);z.push(o("line",{key:`base-v-${D}`,x1:String(F.sx),y1:String(F.sy),x2:String(P.sx),y2:String(P.sy),stroke:c,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}return z},[f,c,b]),C=v(()=>{if(!d)return[];let z=[],k=f.maxCols/2,w=f.maxRows/2;for(let D=0;D<t.length;D++){let M=t[D],F=D*h,P=0,W=0;for(let K=0;K<M.data.length;K++){let Q=M.data[K];for(let q=0;q<Q.length;q++)P+=Q[q]??0,W++}let _=W>0?P/W:0,O=b(k+1,0,_+F),Y=M.color??m[D%m.length];z.push(o("text",{key:`layer-label-${D}`,x:String(O.sx+8),y:String(O.sy+4),"font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:Y},M.label))}return z},[d,t,f,h,m,b]),L=v(()=>p?[o("text",{key:"title",x:String(n/2),y:String(24),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},p)]:[],[p,n])(),R=A(),$=S(),B=I(),E=C(),N=t.length===0?[o("text",{key:"empty-msg",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No layer data")]:[];return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"3D layer visualization",style:{fontFamily:"sans-serif",maxWidth:"100%"}},...L,...N,...R,...$,...B,...E)}function Vd(e){if(typeof e=="string")return e;if(!isFinite(e)||isNaN(e))return"--";let t=e.toString().split("."),n=t[0],r=t.length>1?"."+t[1]:"",i=n.startsWith("-"),s=i?n.slice(1):n,a="";for(let l=0;l<s.length;l++)l>0&&(s.length-l)%3===0&&(a+=","),a+=s[l];return(i?"-":"")+a+r}function Ud(e){if(!isFinite(e)||isNaN(e))return"--";let t=Math.abs(e);return t<100&&t!==Math.floor(t)?t.toFixed(1):String(Math.round(t))}function bs(e){let{value:t,label:n,prefix:r="",suffix:i="",trend:s,trendLabel:a,sparkline:l,width:d=280,height:u=160,valueColor:h="currentColor",trendUpColor:m="#22c55e",trendDownColor:c="#ef4444",backgroundColor:p="#ffffff"}=e,f=X(()=>Vd(t),[t]),y=s!=null&&isFinite(s)&&!isNaN(s),x=l!=null&&l.length>1,g=n!=null&&n.length>0,b=y&&s>=0?m:c,S=20,I=g?u*.38:u*.45,A=Math.min(d*.15,48),C=A*.55,T=I+A*.4+8,L=g?T+22:I+A*.4+22,R=x?Math.min(u*.22,36):0,$=u-S-R,B=d-S*2,E=v(()=>[o("rect",{key:"bg",x:"0",y:"0",width:"100%",rx:"8",ry:"8",fill:p,stroke:"#e5e7eb","stroke-width":"1"})],[d,u,p]),N=v(()=>{let O=[],Y=r+f+i;return O.push(o("text",{key:"value",x:String(d/2),y:String(I),"text-anchor":"middle","dominant-baseline":"central","font-size":String(A),"font-weight":"bold","font-family":"sans-serif",fill:h,"aria-label":`Value: ${Y}`},r?o("tspan",{key:"prefix","font-size":String(C),"font-weight":"normal"},r):null,f,i?o("tspan",{key:"suffix","font-size":String(C),"font-weight":"normal"},i):null)),O},[d,I,A,C,f,r,i,h]),z=v(()=>g?[o("text",{key:"label",x:String(d/2),y:String(T),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},n)]:[],[g,d,T,n]),k=v(()=>{if(!y)return[];let O=[],Y=s,K=Y>=0,Q=8,q=Ud(Y),H=(K?"+":"-")+q+(a?" "+a:""),j=d/2-40,G=L;if(K){let V=`${j},${G} ${j-Q/2},${G+Q} ${j+Q/2},${G+Q}`;O.push(o("polygon",{key:"trend-arrow",points:V,fill:b}))}else{let V=`${j},${G+Q} ${j-Q/2},${G} ${j+Q/2},${G}`;O.push(o("polygon",{key:"trend-arrow",points:V,fill:b}))}return O.push(o("text",{key:"trend-text",x:String(j+Q+4),y:String(G+Q*.7),"text-anchor":"start","font-size":"12","font-family":"sans-serif",fill:b,"aria-label":`Trend: ${H}`},H)),O},[y,s,a,b,d,L]),w=v(()=>{if(!x)return[];let O=[],Y=l,K=[];for(let te of Y)typeof te=="number"&&isFinite(te)&&!isNaN(te)&&K.push(te);if(K.length<2)return[];let Q=1/0,q=-1/0;for(let te of K)te<Q&&(Q=te),te>q&&(q=te);Q===q&&(Q-=1,q+=1);let H=q-Q,j=B/(K.length-1),G="";for(let te=0;te<K.length;te++){let ae=S+te*j,J=$+R-(K[te]-Q)/H*R;te===0?G+=`M ${ae} ${J}`:G+=` L ${ae} ${J}`}let V=S+(K.length-1)*j,Z=G+` L ${V} ${$+R} L ${S} ${$+R} Z`;return O.push(o("defs",{key:"spark-defs"},o("linearGradient",{key:"spark-grad",id:"sparkGrad",x1:"0",y1:"0",x2:"0",y2:"1"},o("stop",{key:"stop1",offset:"0%","stop-color":"#3b82f6","stop-opacity":"0.3"}),o("stop",{key:"stop2",offset:"100%","stop-color":"#3b82f6","stop-opacity":"0.05"})))),O.push(o("path",{key:"spark-fill",d:Z,fill:"url(#sparkGrad)"})),O.push(o("path",{key:"spark-line",d:G,fill:"none",stroke:"#3b82f6","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})),O},[x,l,B,$,R,S]),D=E(),M=N(),F=z(),P=k(),W=w(),_=`${r}${f}${i}${g?`, ${n}`:""}`;return o("svg",{width:"100%",viewBox:`0 0 ${d} ${u}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":_,style:{fontFamily:"sans-serif"}},...D,...W,...M,...F,...P)}var Mn=Math.PI/180;function jd(e,t,n,r,i,s,a,l){let d=Math.cos(r*Mn),u=Math.sin(r*Mn),h=Math.cos(i*Mn),m=Math.sin(i*Mn),c=e*h+n*m,p=-e*m+n*h,f=t*d-p*u,y=t*u+p*d;return{sx:s+c*l,sy:a-f*l,depth:y}}function Rt(e){return{x:Math.sin(e.theta)*Math.cos(e.phi),y:Math.sin(e.theta)*Math.sin(e.phi),z:Math.cos(e.theta)}}function En(e,t,n){let r=Math.sqrt(e*e+t*t+n*n);if(r<1e-10)return{theta:0,phi:0};let i=e/r,s=t/r,a=n/r,l=Math.acos(Math.max(-1,Math.min(1,a))),d=Math.atan2(s,i);return{theta:l,phi:d<0?d+2*Math.PI:d}}function lt(e,t,n){let{x:r,y:i,z:s}=Rt(e),a=Math.cos(n),l=Math.sin(n),d,u,h;return t==="x"?(d=r,u=i*a-s*l,h=i*l+s*a):t==="y"?(d=r*a+s*l,u=i,h=-r*l+s*a):(d=r*a-i*l,u=r*l+i*a,h=s),En(d,u,h)}function bo(e,t){let n=t.angle??Math.PI;switch(t.gate){case"X":return lt(e,"x",Math.PI);case"Y":return lt(e,"y",Math.PI);case"Z":return lt(e,"z",Math.PI);case"H":{let{x:r,y:i,z:s}=Rt(e);return En(s,-i,r)}case"S":return lt(e,"z",Math.PI/2);case"T":return lt(e,"z",Math.PI/4);case"Rx":return lt(e,"x",n);case"Ry":return lt(e,"y",n);case"Rz":return lt(e,"z",n)}}function xs(e){let{state:t,gates:n,width:r=400,height:i=400,rotateY:s=-25,rotateX:a=15,zoom:l=1,interactive:d=!0,zoomable:u=!0,showVector:h=!0,showLabels:m=!0,showWireframe:c=!0,showTrail:p=!0,trailMaxPoints:f=200,trailColor:y="#ef4444",wireframeColor:x="#cbd5e1",vectorColor:g="#3b82f6",backgroundColor:b,sphereRadius:S=130,title:I,onStateChange:A}=e,[C,T]=U(t??{theta:0,phi:0}),[L,R]=U(s),[$,B]=U(a),[E,N]=U(l),z=ne([]),k=ne(!1),w=ne(null),D=ne(null);re(()=>{t&&T(t)},[t?.theta,t?.phi]);let M=ne(0);re(()=>{if(!n||n.length===0)return;M.current=0;let j=0,G=()=>{M.current>=n.length||(T(V=>{let Z=bo(V,n[M.current]);return M.current++,A&&A(Z),Z}),j=requestAnimationFrame(G))};return j=requestAnimationFrame(G),()=>cancelAnimationFrame(j)},[n]),re(()=>{let j=Rt(C);z.current.push(j),z.current.length>f&&z.current.splice(0,z.current.length-f)},[C.theta,C.phi]);let F=S*E,P=r/2,W=i/2,_=v((j,G,V)=>jd(j,G,V,$,L,P,W,F),[$,L,P,W,F]),O=v(j=>{if(!d)return;let G=j;k.current=!0,w.current={mx:G.clientX,my:G.clientY,rx:$,ry:L}},[d,$,L]),Y=v(j=>{if(!k.current||!w.current)return;let G=j,V=w.current;R(V.ry+(G.clientX-V.mx)*.5),B(V.rx-(G.clientY-V.my)*.5)},[]),K=v(()=>{k.current=!1},[]),Q=v(j=>{if(!u)return;let G=j;G.preventDefault(),N(V=>Math.max(.5,Math.min(3,V*(G.deltaY>0?.95:1.05))))},[u]),q=[];if(b&&q.push(o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:b,rx:"6"})),I&&q.push(o("text",{key:"title",x:String(P),y:"24","text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},I)),c){let G=[];for(let te=0;te<=60;te++){let ae=te/60*2*Math.PI,J=_(Math.cos(ae),Math.sin(ae),0);G.push(`${te===0?"M":"L"}${J.sx.toFixed(1)},${J.sy.toFixed(1)}`)}q.push(o("path",{key:"eq",d:G.join(" "),fill:"none",stroke:x,"stroke-width":"0.8",opacity:"0.5"}));let V=[];for(let te=0;te<=60;te++){let ae=te/60*2*Math.PI,J=_(Math.cos(ae),0,Math.sin(ae));V.push(`${te===0?"M":"L"}${J.sx.toFixed(1)},${J.sy.toFixed(1)}`)}q.push(o("path",{key:"xz",d:V.join(" "),fill:"none",stroke:x,"stroke-width":"0.8",opacity:"0.4"}));let Z=[];for(let te=0;te<=60;te++){let ae=te/60*2*Math.PI,J=_(0,Math.cos(ae),Math.sin(ae));Z.push(`${te===0?"M":"L"}${J.sx.toFixed(1)},${J.sy.toFixed(1)}`)}q.push(o("path",{key:"yz",d:Z.join(" "),fill:"none",stroke:x,"stroke-width":"0.8",opacity:"0.4"}))}let H=[{id:"x",dir:[1,0,0],color:"#ef4444"},{id:"y",dir:[0,1,0],color:"#22c55e"},{id:"z",dir:[0,0,1],color:"#3b82f6"}];for(let j of H){let G=_(j.dir[0]*1.15,j.dir[1]*1.15,j.dir[2]*1.15),V=_(-j.dir[0]*1.15,-j.dir[1]*1.15,-j.dir[2]*1.15),Z=_(0,0,0);q.push(o("line",{key:`axis-${j.id}`,x1:String(V.sx),y1:String(V.sy),x2:String(G.sx),y2:String(G.sy),stroke:j.color,"stroke-width":"0.8",opacity:"0.4","stroke-dasharray":"3 3"}))}if(m){let j=[{text:"|0\u27E9",pos:[0,0,1.3]},{text:"|1\u27E9",pos:[0,0,-1.3]},{text:"|+\u27E9",pos:[1.3,0,0]},{text:"|-\u27E9",pos:[-1.3,0,0]},{text:"|+i\u27E9",pos:[0,1.3,0]},{text:"|-i\u27E9",pos:[0,-1.3,0]}];for(let G of j){let V=_(G.pos[0],G.pos[1],G.pos[2]);q.push(o("text",{key:`lbl-${G.text}`,x:String(V.sx),y:String(V.sy),"text-anchor":"middle","dominant-baseline":"central","font-size":"11","font-family":"serif",fill:"#475569",style:{pointerEvents:"none"}},G.text))}}if(p&&z.current.length>1){let j=z.current,G=[];for(let V=0;V<j.length;V++){let Z=j[V],te=_(Z.x,Z.y,Z.z);G.push(`${V===0?"M":"L"}${te.sx.toFixed(1)},${te.sy.toFixed(1)}`)}q.push(o("path",{key:"trail",d:G.join(" "),fill:"none",stroke:y,"stroke-width":"1.5",opacity:"0.5","stroke-linecap":"round","stroke-linejoin":"round"}))}if(h){let j=Rt(C),G=_(0,0,0),V=_(j.x,j.y,j.z);q.push(o("line",{key:"vec-line",x1:String(G.sx),y1:String(G.sy),x2:String(V.sx),y2:String(V.sy),stroke:g,"stroke-width":"2.5","stroke-linecap":"round"})),q.push(o("circle",{key:"vec-point",cx:String(V.sx),cy:String(V.sy),r:"5",fill:g,stroke:"#fff","stroke-width":"1.5"}));let Z=(C.theta*180/Math.PI).toFixed(0),te=(C.phi*180/Math.PI).toFixed(0);q.push(o("text",{key:"state-label",x:String(r-10),y:String(i-10),"text-anchor":"end","font-size":"10","font-family":"monospace",fill:"#64748b"},`\u03B8=${Z}\xB0 \u03C6=${te}\xB0`))}return o("svg",{ref:D,width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":I??"Bloch sphere quantum state visualization",style:{fontFamily:"sans-serif",cursor:d?k.current?"grabbing":"grab":"default"},onMouseDown:d?O:void 0,onMouseMove:d?Y:void 0,onMouseUp:d?K:void 0,onMouseLeave:d?K:void 0,onWheel:u?Q:void 0},...q)}function Gd(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];typeof r=="number"&&isFinite(r)&&!isNaN(r)&&t.push(r)}return t.sort((n,r)=>n-r),t}function xo(e,t){if(e.length===0)return 0;if(e.length===1)return e[0];let n=t/100*(e.length-1),r=Math.floor(n),i=Math.ceil(n);if(r===i)return e[r];let s=n-r;return e[r]+s*(e[i]-e[r])}function yo(e){let t=Gd(e);if(t.length===0)return null;let n=xo(t,25),r=xo(t,50),i=xo(t,75),s=i-n,a=n-1.5*s,l=i+1.5*s,d=t[0];for(let p of t)if(p>=a){d=p;break}let u=t[t.length-1];for(let p=t.length-1;p>=0;p--)if(t[p]<=l){u=t[p];break}let h=0;for(let p of t)h+=p;let m=h/t.length,c=[];for(let p of t)(p<a||p>l)&&c.push(p);return{q1:n,median:r,q3:i,iqr:s,whiskerLow:d,whiskerHigh:u,mean:m,outliers:c,min:t[0],max:t[t.length-1]}}function Xd(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function ys(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",showOutliers:s=!0,showMean:a=!1,whiskerColor:l="#374151",boxWidth:d=.6,showGrid:u=!0,title:h,padding:m=60}=e,c=i==="vertical",p=n-m*2,f=r-m*2,y=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],x=X(()=>{let w=[];for(let D of t)w.push(yo(D.values));return w},[t]),g=X(()=>{let w=1/0,D=-1/0;for(let P of x){if(P===null)continue;let W=s&&P.outliers.length>0?Math.min(P.whiskerLow,P.outliers[0]):P.whiskerLow,_=s&&P.outliers.length>0?Math.max(P.whiskerHigh,P.outliers[P.outliers.length-1]):P.whiskerHigh;W<w&&(w=W),_>D&&(D=_)}isFinite(w)||(w=0,D=1);let M=D-w,F=M>0?M*.05:.5;return{min:w-F,max:D+F}},[x,s]),b=c?f:p,S=c?p:f,I=t.length>0?t.length:1,A=S/I,C=A*Math.min(Math.max(d,.1),.95),T=v(w=>{let D=g.max-g.min;return D===0?b/2:(w-g.min)/D*b},[g,b]),L=v(()=>{if(!u)return[];let w=[],D=g.max-g.min,M=Xd(D),F=Math.ceil(g.min/M)*M;for(let P=F;P<=g.max;P+=M){let W=T(P),_=String(Math.round(P*1e3)/1e3);if(c){let O=m+f-W;w.push(o("line",{key:`grid-${P}`,x1:String(m),y1:String(O),x2:String(m+p),y2:String(O),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`glabel-${P}`,x:String(m-6),y:String(O+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},_))}else{let O=m+W;w.push(o("line",{key:`grid-${P}`,x1:String(O),y1:String(m),x2:String(O),y2:String(m+f),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`glabel-${P}`,x:String(O),y:String(m+f+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},_))}}return w},[u,g,T,c,m,p,f]),R=v(()=>{let w=[];return w.push(o("line",{key:"axis-value",x1:String(m),y1:String(c?m:m+f),x2:String(m),y2:String(m+f),stroke:"#374151","stroke-width":"1.5"})),w.push(o("line",{key:"axis-category",x1:String(m),y1:String(m+f),x2:String(m+p),y2:String(m+f),stroke:"#374151","stroke-width":"1.5"})),w},[m,p,f,c]),$=v(()=>{let w=[];for(let D=0;D<t.length;D++){let M=x[D];if(M===null)continue;let F=t[D],P=F.color??y[D%y.length],W=A*D+A/2,_=C/2;if(c){let O=m+f-T(M.q1),Y=m+f-T(M.q3),K=m+f-T(M.median),Q=m+f-T(M.whiskerLow),q=m+f-T(M.whiskerHigh),H=m+W;w.push(o("line",{key:`wl-${D}`,x1:String(H),y1:String(O),x2:String(H),y2:String(Q),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wlc-${D}`,x1:String(H-_*.4),y1:String(Q),x2:String(H+_*.4),y2:String(Q),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wh-${D}`,x1:String(H),y1:String(Y),x2:String(H),y2:String(q),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`whc-${D}`,x1:String(H-_*.4),y1:String(q),x2:String(H+_*.4),y2:String(q),stroke:l,"stroke-width":"1.5"}));let j=Math.min(O,Y),G=Math.abs(O-Y);if(w.push(o("rect",{key:`box-${D}`,x:String(H-_),y:String(j),width:String(C),height:String(Math.max(G,1)),fill:P,stroke:l,"stroke-width":"1.5",opacity:"0.8","aria-label":`${F.label}: Q1=${M.q1.toFixed(1)}, median=${M.median.toFixed(1)}, Q3=${M.q3.toFixed(1)}`,role:"img"})),w.push(o("line",{key:`med-${D}`,x1:String(H-_),y1:String(K),x2:String(H+_),y2:String(K),stroke:"#fff","stroke-width":"2.5"})),a){let V=m+f-T(M.mean);w.push(o("circle",{key:`mean-${D}`,cx:String(H),cy:String(V),r:"3.5",fill:"#fff",stroke:l,"stroke-width":"1.5","aria-label":`Mean: ${M.mean.toFixed(1)}`}))}if(s)for(let V=0;V<M.outliers.length;V++){let Z=m+f-T(M.outliers[V]);w.push(o("circle",{key:`out-${D}-${V}`,cx:String(H),cy:String(Z),r:"3",fill:"none",stroke:l,"stroke-width":"1.5","aria-label":`Outlier: ${M.outliers[V]}`}))}w.push(o("text",{key:`cat-${D}`,x:String(H),y:String(m+f+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},F.label))}else{let O=m+T(M.q1),Y=m+T(M.q3),K=m+T(M.median),Q=m+T(M.whiskerLow),q=m+T(M.whiskerHigh),H=m+W;w.push(o("line",{key:`wl-${D}`,x1:String(O),y1:String(H),x2:String(Q),y2:String(H),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wlc-${D}`,x1:String(Q),y1:String(H-_*.4),x2:String(Q),y2:String(H+_*.4),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wh-${D}`,x1:String(Y),y1:String(H),x2:String(q),y2:String(H),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`whc-${D}`,x1:String(q),y1:String(H-_*.4),x2:String(q),y2:String(H+_*.4),stroke:l,"stroke-width":"1.5"}));let j=Math.min(O,Y),G=Math.abs(Y-O);if(w.push(o("rect",{key:`box-${D}`,x:String(j),y:String(H-_),width:String(Math.max(G,1)),height:String(C),fill:P,stroke:l,"stroke-width":"1.5",opacity:"0.8","aria-label":`${F.label}: Q1=${M.q1.toFixed(1)}, median=${M.median.toFixed(1)}, Q3=${M.q3.toFixed(1)}`,role:"img"})),w.push(o("line",{key:`med-${D}`,x1:String(K),y1:String(H-_),x2:String(K),y2:String(H+_),stroke:"#fff","stroke-width":"2.5"})),a){let V=m+T(M.mean);w.push(o("circle",{key:`mean-${D}`,cx:String(V),cy:String(H),r:"3.5",fill:"#fff",stroke:l,"stroke-width":"1.5","aria-label":`Mean: ${M.mean.toFixed(1)}`}))}if(s)for(let V=0;V<M.outliers.length;V++){let Z=m+T(M.outliers[V]);w.push(o("circle",{key:`out-${D}-${V}`,cx:String(Z),cy:String(H),r:"3",fill:"none",stroke:l,"stroke-width":"1.5","aria-label":`Outlier: ${M.outliers[V]}`}))}w.push(o("text",{key:`cat-${D}`,x:String(m-6),y:String(H+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},F.label))}}return w},[t,x,T,c,m,p,f,A,C,l,s,a,y]),B=v(()=>h?[o("text",{key:"title",x:String(n/2),y:String(m/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,n,m]),E=L(),N=R(),z=$(),k=B();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Box plot",style:{fontFamily:"sans-serif"}},...k,...E,...N,...z)}function Ss(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function Kd(e,t,n){return e<t?t:e>n?n:e}function So(e){return typeof e=="number"&&isFinite(e)&&!isNaN(e)}function vs(e){let{data:t=[],width:n=600,height:r=400,xLabel:i,yLabel:s,showGrid:a=!0,showAxes:l=!0,showLabels:d=!1,maxBubbleRadius:u=40,minBubbleRadius:h=4,defaultColor:m="#3b82f6",opacity:c=.7,title:p,padding:f=60}=e,y=X(()=>{let z=[];for(let k=0;k<t.length;k++){let w=t[k];So(w.x)&&So(w.y)&&So(w.r)&&z.push(w)}return z},[t]),x=n-f*2,g=r-f*2,b=X(()=>{if(y.length===0)return{xMin:0,xMax:1,yMin:0,yMax:1,rMin:0,rMax:1};let z=1/0,k=-1/0,w=1/0,D=-1/0,M=1/0,F=-1/0;for(let P of y)P.x<z&&(z=P.x),P.x>k&&(k=P.x),P.y<w&&(w=P.y),P.y>D&&(D=P.y),P.r<M&&(M=P.r),P.r>F&&(F=P.r);return z===k&&(z-=1,k+=1),w===D&&(w-=1,D+=1),M===F&&(M=0,F=F>0?F:1),{xMin:z,xMax:k,yMin:w,yMax:D,rMin:M,rMax:F}},[y]),S=v(z=>{let k=b.xMax-b.xMin;return f+(z-b.xMin)/k*x},[b,f,x]),I=v(z=>{let k=b.yMax-b.yMin;return f+g-(z-b.yMin)/k*g},[b,f,g]),A=v(z=>{let k=b.rMax-b.rMin;if(k===0)return(h+u)/2;let w=(z-b.rMin)/k;return h+w*(u-h)},[b,h,u]),C=v(()=>{if(!a)return[];let z=[],k=Ss(b.xMax-b.xMin),w=Math.ceil(b.xMin/k)*k;for(let F=w;F<=b.xMax;F+=k){let P=S(F);z.push(o("line",{key:`grid-x-${F}`,x1:String(P),y1:String(f),x2:String(P),y2:String(f+g),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),z.push(o("text",{key:`grid-xlabel-${F}`,x:String(P),y:String(f+g+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(F*1e3)/1e3)))}let D=Ss(b.yMax-b.yMin),M=Math.ceil(b.yMin/D)*D;for(let F=M;F<=b.yMax;F+=D){let P=I(F);z.push(o("line",{key:`grid-y-${F}`,x1:String(f),y1:String(P),x2:String(f+x),y2:String(P),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),z.push(o("text",{key:`grid-ylabel-${F}`,x:String(f-6),y:String(P+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(F*1e3)/1e3)))}return z},[a,b,S,I,f,x,g]),T=v(()=>{if(!l)return[];let z=[];return z.push(o("line",{key:"axis-y",x1:String(f),y1:String(f),x2:String(f),y2:String(f+g),stroke:"#374151","stroke-width":"1.5"})),z.push(o("line",{key:"axis-x",x1:String(f),y1:String(f+g),x2:String(f+x),y2:String(f+g),stroke:"#374151","stroke-width":"1.5"})),i&&z.push(o("text",{key:"x-label",x:String(f+x/2),y:String(f+g+40),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151"},i)),s&&z.push(o("text",{key:"y-label",x:String(f-40),y:String(f+g/2),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90, ${f-40}, ${f+g/2})`},s)),z},[l,f,x,g,i,s]),L=v(()=>{let z=[];for(let k=0;k<y.length;k++){let w=y[k],D=S(w.x),M=I(w.y),F=Kd(A(w.r),h,u),P=w.color??m;z.push(o("circle",{key:`bubble-${k}`,cx:String(D),cy:String(M),r:String(F),fill:P,opacity:String(c),stroke:P,"stroke-width":"1","stroke-opacity":"0.8","aria-label":w.label??`Bubble at (${w.x}, ${w.y}) size ${w.r}`,role:"img"})),d&&w.label&&z.push(o("text",{key:`label-${k}`,x:String(D),y:String(M-F-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},w.label))}return z},[y,S,I,A,m,c,d,h,u]),R=v(()=>p?[o("text",{key:"title",x:String(n/2),y:String(f/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},p)]:[],[p,n,f]),$=C(),B=T(),E=L(),N=R();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Bubble chart",style:{fontFamily:"sans-serif"}},...N,...$,...B,...E)}var qd=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Zd=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function Jd(e){let t=e.split("-");return t.length!==3?new Date(NaN):new Date(parseInt(t[0],10),parseInt(t[1],10)-1,parseInt(t[2],10))}function ws(e){let t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${r}`}function ks(e){let t=e.replace("#",""),n=t.length===3?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,r=parseInt(n,16);return{r:r>>16&255,g:r>>8&255,b:r&255}}function Qd(e,t,n){let r=i=>{let s=Math.max(0,Math.min(255,Math.round(i))).toString(16);return s.length===1?"0"+s:s};return`#${r(e)}${r(t)}${r(n)}`}function eu(e,t){if(t.length===0)return"#000000";if(t.length===1)return t[0];let n=Math.max(0,Math.min(1,e)),r=t.length-1,i=Math.min(Math.floor(n*r),r-1),s=n*r-i,a=ks(t[i]),l=ks(t[i+1]);return Qd(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}var tu=["#9be9a8","#40c463","#30a14e","#216e39"];function Cs(e){let{data:t=[],width:n=800,height:r=160,colorScale:i=tu,cellSize:s=12,cellGap:a=2,showMonthLabels:l=!0,showDayLabels:d=!0,emptyColor:u="#ebedf0",title:h}=e,{dateMap:m,startDate:c,endDate:p,maxVal:f}=X(()=>{let E=new Map,N=0,z=null,k=null;for(let M of t){let F=Jd(M.date);if(isNaN(F.getTime()))continue;let P=ws(F);E.set(P,(E.get(P)??0)+M.value);let W=E.get(P);W>N&&(N=W),(z===null||F<z)&&(z=F),(k===null||F>k)&&(k=F)}if(z===null||k===null){let M=new Date;z=new Date(M.getFullYear(),0,1),k=new Date(M.getFullYear(),11,31)}let w=new Date(z);w.setDate(w.getDate()-w.getDay());let D=new Date(k);return D.setDate(D.getDate()+(6-D.getDay())),{dateMap:E,startDate:w,endDate:D,maxVal:N>0?N:1}},[t]),y=d?30:0,x=l?16:0,g=h?28:0,b=y+10,S=g+x+4,I=v(()=>{let E=[],N=new Date(c),z=0;for(;N<=p;){let k=N.getDay();k===0&&N>c&&z++;let w=ws(N),D=m.get(w),M=D!==void 0&&D>0?eu(D/f,i):u,F=b+z*(s+a),P=S+k*(s+a);E.push(o("rect",{key:`day-${w}`,x:String(F),y:String(P),width:String(s),height:String(s),rx:"2",ry:"2",fill:M,"aria-label":`${w}: ${D??0}`})),N.setDate(N.getDate()+1)}return E},[c,p,m,f,i,u,s,a,b,S]),A=v(()=>{if(!l)return[];let E=[],N=new Date(c),z=0,k=-1;for(;N<=p;){let w=N.getDay();w===0&&N>c&&z++;let D=N.getMonth();if(D!==k&&w===0){k=D;let M=b+z*(s+a);E.push(o("text",{key:`month-${z}`,x:String(M),y:String(g+x-2),"font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},qd[D]))}N.setDate(N.getDate()+1)}return E},[l,c,p,s,a,b,g,x]),C=v(()=>{if(!d)return[];let E=[],N=[1,3,5];for(let z of N){let k=S+z*(s+a)+s/2;E.push(o("text",{key:`day-label-${z}`,x:String(y),y:String(k),"text-anchor":"end","dominant-baseline":"central","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},Zd[z]))}return E},[d,s,a,S,y]),T=v(()=>h?[o("text",{key:"title",x:String(n/2),y:"18","text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},h)]:[],[h,n]);if(t.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Calendar heat map \u2014 no data"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"No data to display."));let L=T(),R=A(),$=C(),B=I();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Calendar heat map",style:{fontFamily:"sans-serif"}},...L,...R,...$,...B)}var nu=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function nt(e,t,n,r){let i=r-Math.PI/2;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function ou(e,t,n,r,i,s){let a=nt(e,t,n,i),l=nt(e,t,n,s),d=nt(e,t,r,i),u=nt(e,t,r,s),m=s-i>Math.PI?1:0;return[`M ${a.x} ${a.y}`,`A ${n} ${n} 0 ${m} 1 ${l.x} ${l.y}`,`L ${u.x} ${u.y}`,`A ${r} ${r} 0 ${m} 0 ${d.x} ${d.y}`,"Z"].join(" ")}function ru(e,t,n,r,i,s,a){let l=nt(e,t,n,r),d=nt(e,t,n,i),u=nt(e,t,n,s),h=nt(e,t,n,a),m=i-r,c=a-s,p=m>Math.PI?1:0,f=c>Math.PI?1:0;return[`M ${l.x} ${l.y}`,`A ${n} ${n} 0 ${p} 1 ${d.x} ${d.y}`,`Q ${e} ${t} ${u.x} ${u.y}`,`A ${n} ${n} 0 ${f} 1 ${h.x} ${h.y}`,`Q ${e} ${t} ${l.x} ${l.y}`,"Z"].join(" ")}function iu(e,t,n,r){let i=e.length;if(i===0)return{groups:[],chords:[]};let s=[],a=0;for(let c=0;c<i;c++){let p=0;for(let f=0;f<i;f++){let y=e[c]?.[f]??0;p+=Math.max(0,y)}s.push(p),a+=p}if(a===0){let c=(2*Math.PI-i*r)/Math.max(i,1),p=[],f=0;for(let y=0;y<i;y++)p.push({index:y,label:t[y]??`Group ${y}`,color:n[y%n.length],startAngle:f,endAngle:f+c,value:0}),f+=c+r;return{groups:p,chords:[]}}let l=2*Math.PI-i*r,d=[],u=0;for(let c=0;c<i;c++){let p=s[c]/a*l;d.push({index:c,label:t[c]??`Group ${c}`,color:n[c%n.length],startAngle:u,endAngle:u+p,value:s[c]}),u+=p+r}let h=[];for(let c=0;c<i;c++)h.push(d[c].startAngle);let m=[];for(let c=0;c<i;c++)for(let p=c;p<i;p++){let f=Math.max(0,e[c]?.[p]??0),y=c===p?0:Math.max(0,e[p]?.[c]??0);if(f===0&&y===0)continue;let x=f+y,g=s[c]>0?f/a*l:0,b=h[c],S=b+g;h[c]=S;let I=s[p]>0?f/a*l:0,A=h[p],C=A+I;if(h[p]=C,c===p){f>0&&m.push({sourceIndex:c,targetIndex:p,sourceStartAngle:b,sourceEndAngle:S,targetStartAngle:A,targetEndAngle:C,value:f,color:d[c].color});continue}let T=s[p]>0?y/a*l:0,R=h[p]+T;h[p]=R;let $=s[c]>0?y/a*l:0,E=h[c]+$;h[c]=E,(f>0||y>0)&&m.push({sourceIndex:c,targetIndex:p,sourceStartAngle:b,sourceEndAngle:Math.max(S,b+.001),targetStartAngle:A,targetEndAngle:Math.max(C,A+.001),value:x,color:d[c].color})}return{groups:d,chords:m}}function Ms(e){let{matrix:t,labels:n,width:r=600,height:i=600,colors:s=nu,padAngle:a=.05,showLabels:l=!0,showValues:d=!1,ribbonOpacity:u=.5,innerRadiusRatio:h=.9,title:m}=e;if(!t||t.length===0||!n||n.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Empty chord diagram"},o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let c=r/2,p=i/2,f=Math.min(r,i)/2-40,y=f*Math.max(.5,Math.min(.99,h)),x=f+16,g=X(()=>iu(t,n,s,a),[t,n,s,a]),b=v(()=>{let L=[];for(let R=0;R<g.groups.length;R++){let $=g.groups[R];if($.endAngle-$.startAngle<.001)continue;let E=ou(c,p,f,y,$.startAngle,$.endAngle);if(L.push(o("path",{key:`arc-${R}`,d:E,fill:$.color,stroke:"#fff","stroke-width":"1",role:"img","aria-label":`${$.label}: ${$.value}`})),l){let N=($.startAngle+$.endAngle)/2,z=nt(c,p,x,N),D=((N-Math.PI/2)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)<Math.PI,M=D?"start":"end",F=N*180/Math.PI-90;D||(F+=180);let P=d?`${$.label} (${$.value})`:$.label;L.push(o("text",{key:`label-${R}`,x:String(z.x),y:String(z.y),"text-anchor":M,"font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(${F}, ${z.x}, ${z.y})`,"dominant-baseline":"central","pointer-events":"none"},P))}}return L},[g,c,p,f,y,x,l,d]),S=v(()=>{let L=[];for(let R=0;R<g.chords.length;R++){let $=g.chords[R],B=ru(c,p,y,$.sourceStartAngle,$.sourceEndAngle,$.targetStartAngle,$.targetEndAngle);L.push(o("path",{key:`ribbon-${R}`,d:B,fill:$.color,"fill-opacity":String(u),stroke:$.color,"stroke-width":"0.5","stroke-opacity":"0.3"}))}return L},[g,c,p,y,u]),I=v(()=>m?[o("text",{key:"title",x:String(r/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},m)]:[],[m,r]),A=S(),C=b(),T=I();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Chord diagram",style:{fontFamily:"sans-serif"}},...T,...A,...C)}var su=["#3b82f6","#22c55e","#f59e0b","#8b5cf6","#ef4444","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function au(e){let t=[],n=0,r=[];r.push([e,0,null]);let i=0;for(;r.length>0;){let[s,a,l]=r.shift(),d=n++;i=Math.max(i,a);let u=s.children??[],h=[];for(let m=0;m<u.length;m++)h.push(n+r.length+m);t.push({id:d,node:s,depth:a,parentId:l,childIndices:h});for(let m=0;m<u.length;m++)r.push([u[m],a+1,d])}return{flatNodes:t,maxDepth:i}}function lu(e){let t=e.length,n=new Array(t).fill(0);for(let r=t-1;r>=0;r--){let i=e[r];if(i.childIndices.length===0)n[r]=1;else{let s=0;for(let a of i.childIndices)a<t&&(s+=n[a]);n[r]=Math.max(s,1)}}return n}function cu(e,t,n,r,i,s,a,l){let{flatNodes:d,maxDepth:u}=au(e);if(d.length===0)return[];let h=lu(d),m=t-s*2,c=n-s*2,p=a==="horizontal",f=u+1,y=p?f>1?(m-r)/u:0:f>1?(c-i)/u:0,x=new Array(d.length),g=h[0],b=p?c:m,S=g>0?b/g:b,I=new Array(d.length);I[0]=[0,g];let A=[0],C=0;for(;C<A.length;){let T=A[C];C++;let L=d[T],[R,$]=I[T],B=(R+$)/2,E=s+L.depth*y,N=s+(B-.5)*S,z=p?E:N,k=p?N:E,w=L.node.color??l[L.depth%l.length];x[T]={id:L.id,label:L.node.label,value:L.node.value!==void 0?String(L.node.value):"",color:w,depth:L.depth,x:z,y:k,parentId:L.parentId,childCount:L.childIndices.length,subtreeLeafCount:h[T]};let D=R;for(let M of L.childIndices)if(M<d.length){let F=h[M],P=D+F;I[M]=[D,P],D=P,A.push(M)}}return x}function Es(e){let{data:t,width:n=800,height:r=500,orientation:i="horizontal",nodeWidth:s=120,nodeHeight:a=40,showValues:l=!0,showConnectors:d=!0,connectorColor:u="#94a3b8",colors:h=su,title:m,padding:c=40}=e;if(!t)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Empty decomposition tree"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let p=i==="horizontal",f=X(()=>cu(t,n,r,s,a,c,i,h),[t,n,r,s,a,c,i,h]),y=X(()=>{let C=new Map;for(let T=0;T<f.length;T++){let L=f[T];C.set(L.id,L)}return C},[f]),x=v(()=>{if(!d)return[];let C=[];for(let T=0;T<f.length;T++){let L=f[T];if(L.parentId===null)continue;let R=y.get(L.parentId);if(!R)continue;let $,B,E,N;p?($=R.x+s,B=R.y+a/2,E=L.x,N=L.y+a/2):($=R.x+s/2,B=R.y+a,E=L.x+s/2,N=L.y);let z=($+E)/2,k=(B+N)/2,w;p?w=`M ${$} ${B} C ${z} ${B}, ${z} ${N}, ${E} ${N}`:w=`M ${$} ${B} C ${$} ${k}, ${E} ${k}, ${E} ${N}`,C.push(o("path",{key:`conn-${T}`,d:w,fill:"none",stroke:u,"stroke-width":"1.5","stroke-opacity":"0.7"}))}return C},[f,y,p,s,a,d,u]),g=v(()=>{let C=[];for(let T=0;T<f.length;T++){let L=f[T];C.push(o("rect",{key:`node-rect-${L.id}`,x:String(L.x),y:String(L.y),width:String(s),height:String(a),rx:"4",ry:"4",fill:L.color,stroke:"#374151","stroke-width":"1",role:"img","aria-label":L.value?`${L.label}: ${L.value}`:L.label}));let R=l&&L.value?L.y+a/2-2:L.y+a/2+4;C.push(o("text",{key:`node-label-${L.id}`,x:String(L.x+s/2),y:String(R),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#fff","pointer-events":"none"},L.label)),l&&L.value&&C.push(o("text",{key:`node-value-${L.id}`,x:String(L.x+s/2),y:String(L.y+a/2+12),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.85)","pointer-events":"none"},L.value))}return C},[f,s,a,l]),b=v(()=>m?[o("text",{key:"title",x:String(n/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},m)]:[],[m,n]),S=x(),I=g(),A=b();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Decomposition tree",style:{fontFamily:"sans-serif"}},...A,...S,...I)}var Is=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function du(e){return Is[e%Is.length]}function Rs(e,t,n){let r=t/2,i=n/2,s=Math.min(t,n)*.3,a=e.length,l=[];for(let d=0;d<a;d++){let u=e[d],h=2*Math.PI*d/Math.max(a,1);l.push({id:u.id,label:u.label??u.id,color:u.color??du(d),x:u.x??r+s*Math.cos(h),y:u.y??i+s*Math.sin(h),vx:0,vy:0,fixed:u.fixed??!1,solid:u.solid??!0})}return l}function Ps(e,t){let n=t*2;for(let r=0;r<e.length;r++){let i=e[r];if(i.solid)for(let s=r+1;s<e.length;s++){let a=e[s];if(!a.solid)continue;let l=a.x-i.x,d=a.y-i.y,u=l*l+d*d;if(u>=n*n||u<1e-4)continue;let h=Math.sqrt(u),m=l/h,c=d/h,p=n-h;if(i.fixed&&a.fixed)continue;i.fixed?(a.x+=m*p,a.y+=c*p):a.fixed?(i.x-=m*p,i.y-=c*p):(i.x-=m*p*.5,i.y-=c*p*.5,a.x+=m*p*.5,a.y+=c*p*.5);let f=i.vx-a.vx,y=i.vy-a.vy,x=f*m+y*c;x<=0||(i.fixed?(a.vx+=x*m,a.vy+=x*c):a.fixed?(i.vx-=x*m,i.vy-=x*c):(i.vx-=x*m,i.vy-=x*c,a.vx+=x*m,a.vy+=x*c))}}}function uu(e,t,n,r,i,s,a,l,d=12){let u=e.length;if(u===0)return e;let h=new Map;for(let b=0;b<u;b++)h.set(e[b].id,b);let m=new Float64Array(u),c=new Float64Array(u);for(let b=0;b<u;b++){let S=e[b];for(let I=b+1;I<u;I++){let A=e[I],C=S.x-A.x,T=S.y-A.y,L=C*C+T*T;L<1&&(L=1);let R=Math.sqrt(L),$=i/L,B=C/R*$,E=T/R*$;m[b]+=B,c[b]+=E,m[I]-=B,c[I]-=E}}for(let b=0;b<t.length;b++){let S=t[b],I=h.get(S.source),A=h.get(S.target);if(I===void 0||A===void 0)continue;let C=e[I],T=e[A],L=T.x-C.x,R=T.y-C.y,$=Math.sqrt(L*L+R*R);if($<.1)continue;let B=S.weight??1,E=$-l,N=s*E*B,z=L/$*N,k=R/$*N;m[I]+=z,c[I]+=k,m[A]-=z,c[A]-=k}let p=n/2,f=r/2,y=.001;for(let b=0;b<u;b++){let S=e[b];m[b]+=(p-S.x)*y,c[b]+=(f-S.y)*y}let x=20,g=[];for(let b=0;b<u;b++){let S=e[b];if(S.fixed){g.push({...S,vx:0,vy:0});continue}let I=(S.vx+m[b])*a,A=(S.vy+c[b])*a,C=Math.sqrt(I*I+A*A),T=10;C>T&&(I=I/C*T,A=A/C*T);let L=S.x+I,R=S.y+A;L=Math.max(x,Math.min(n-x,L)),R=Math.max(x,Math.min(r-x,R)),g.push({...S,x:L,y:R,vx:I,vy:A})}return Ps(g,d),g}function pu(e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];t+=r.vx*r.vx+r.vy*r.vy}return t}function Ts(e){let{nodes:t,edges:n,width:r=600,height:i=400,nodeRadius:s=12,nodeStrokeWidth:a=2,solidNodes:l=!0,showLabels:d=!0,showArrows:u=!1,repulsionForce:h=300,attractionForce:m=.01,damping:c=.9,edgeLength:p=100,edgeColor:f="#94a3b8",edgeWidth:y=1.5,title:x,customForce:g,trails:b}=e;if(!t||t.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":x??"Empty force-directed graph"},x?o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},x):o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let S=ne(Rs(t,r,i)),[I,A]=U(0),C=ne(!0),T=ne(!1),L=ne(n);L.current=n;let R=ne(g);R.current=g;let $=ne(null),B=ne({repulsionForce:h,attractionForce:m,damping:c,edgeLength:p,width:r,height:i,nodeRadius:s,solidNodes:l});B.current={repulsionForce:h,attractionForce:m,damping:c,edgeLength:p,width:r,height:i,nodeRadius:s,solidNodes:l};let E=ne(new Map);re(()=>{S.current=Rs(t,r,i),T.current=!1,C.current=!0,E.current=new Map,A(ae=>ae+1)},[t.length]),re(()=>{let ae=0,J=()=>{if(!C.current)return;let ie=B.current,le=R.current,fe;if(le?(fe=le(S.current,L.current,ie.width,ie.height,$.current),ie.solidNodes&&Ps(fe,ie.nodeRadius)):fe=uu(S.current,L.current,ie.width,ie.height,ie.repulsionForce,ie.attractionForce,ie.damping,ie.edgeLength,ie.nodeRadius),S.current=fe,b)for(let oe=0;oe<b.length;oe++){let ge=b[oe],he=fe.find(me=>me.id===ge.nodeId);if(!he)continue;let ee=E.current.get(ge.nodeId);ee||(ee=[],E.current.set(ge.nodeId,ee)),ee.push({x:he.x,y:he.y});let de=ge.maxPoints??200;ee.length>de&&ee.splice(0,ee.length-de)}if(!le&&pu(fe)<.01){T.current=!0,A(oe=>oe+1);return}A(oe=>oe+1),ae=requestAnimationFrame(J)};return ae=requestAnimationFrame(J),()=>{C.current=!1,cancelAnimationFrame(ae)}},[]);let N=S.current,z=v(ae=>{S.current=S.current.map(J=>J.id===ae?{...J,fixed:!J.fixed,vx:0,vy:0}:J),T.current&&(T.current=!1,C.current=!0,A(J=>J+1))},[]),k=ne(null),w=ne(null),D=v(ae=>{let J=ae,ie=w.current;if(!ie)return{x:J.clientX,y:J.clientY};let le=ie.getBoundingClientRect(),fe=r/le.width,oe=i/le.height;return{x:(J.clientX-le.left)*fe,y:(J.clientY-le.top)*oe}},[r,i]),M=ne(!1),F=v((ae,J)=>{J.stopPropagation(),k.current=ae;let ie=S.current.find(le=>le.id===ae);M.current=ie?.fixed??!1,S.current=S.current.map(le=>le.id===ae?{...le,fixed:!0,vx:0,vy:0}:le)},[]),P=v(ae=>{let J=D(ae);if($.current={x:J.x,y:J.y},!k.current)return;let ie=k.current,le=20;S.current=S.current.map(fe=>fe.id===ie?{...fe,x:Math.max(le,Math.min(r-le,J.x)),y:Math.max(le,Math.min(i-le,J.y))}:fe),T.current&&(T.current=!1,C.current=!0),A(fe=>fe+1)},[r,i,D]),W=v(()=>{let ae=k.current;ae&&(S.current=S.current.map(J=>J.id===ae?{...J,fixed:M.current}:J)),k.current=null},[]),_=v(()=>{k.current=null,$.current=null},[]),O=X(()=>{let ae=new Map;for(let J=0;J<N.length;J++)ae.set(N[J].id,N[J]);return ae},[I]),Y=v(()=>u?[o("defs",{key:"arrow-defs"},o("marker",{key:"arrowhead",id:"arrowhead",markerWidth:"10",markerHeight:"7",refX:String(10+s),refY:"3.5",orient:"auto",markerUnits:"userSpaceOnUse"},o("polygon",{key:"arrow-poly",points:"0 0, 10 3.5, 0 7",fill:f})))]:[],[u,s,f]),K=v(()=>{let ae=[];for(let J=0;J<n.length;J++){let ie=n[J],le=O.get(ie.source),fe=O.get(ie.target);if(!le||!fe||ie.weight!==void 0&&ie.weight<=0)continue;let oe=ie.weight?Math.max(.5,Math.min(6,y*ie.weight)):y,ge={key:`edge-${J}`,x1:String(le.x),y1:String(le.y),x2:String(fe.x),y2:String(fe.y),stroke:ie.color??f,"stroke-width":String(oe),"stroke-opacity":"0.6"};u&&(ge["marker-end"]="url(#arrowhead)"),ae.push(o("line",ge))}return ae},[I,f,y,u]),Q=v(()=>{let ae=[];for(let J=0;J<N.length;J++){let ie=N[J];ae.push(o("circle",{key:`node-${ie.id}`,cx:String(ie.x),cy:String(ie.y),r:String(s),fill:ie.color,stroke:ie.fixed?"#0f172a":"#fff","stroke-width":ie.fixed?"3":String(a),style:{cursor:k.current===ie.id?"grabbing":"grab"},onMouseDown:le=>F(ie.id,le),onDblClick:()=>z(ie.id),role:"button",tabIndex:0,"aria-label":`Node: ${ie.label}${ie.fixed?" (locked)":""} \u2014 drag to move, double-click to lock`})),d&&ae.push(o("text",{key:`label-${ie.id}`,x:String(ie.x),y:String(ie.y+s+14),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},ie.label))}return ae},[I,s,d,z]),q=v(()=>x?[o("text",{key:"title",x:String(r/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},x)]:[],[x,r]),H=v(()=>{if(!b||b.length===0)return[];let ae=[];for(let J=0;J<b.length;J++){let ie=b[J],le=E.current.get(ie.nodeId);if(!le||le.length<2)continue;let fe=[];for(let oe=0;oe<le.length;oe++){let ge=le[oe];fe.push(`${oe===0?"M":"L"}${ge.x.toFixed(1)},${ge.y.toFixed(1)}`)}ae.push(o("path",{key:`trail-${ie.nodeId}`,d:fe.join(" "),fill:"none",stroke:ie.color??"#3b82f6","stroke-width":String(ie.width??1),opacity:String(ie.opacity??.5),"stroke-linecap":"round","stroke-linejoin":"round"}))}return ae},[I,b]),j=Y(),G=H(),V=K(),Z=Q(),te=q();return o("svg",{ref:w,width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":x??"Force-directed graph \u2014 drag nodes to move, double-click to lock",style:{fontFamily:"sans-serif",cursor:k.current?"grabbing":"default"},onMouseMove:P,onMouseUp:W,onMouseLeave:_},...j,...te,...G,...V,...Z)}var $s=["#3b82f6","#6366f1","#8b5cf6","#a855f7","#c084fc","#d8b4fe","#e9d5ff","#f3e8ff"];function Ds(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",showLabels:s=!0,showValues:a=!0,showPercentage:l=!0,gapSize:d=2,colors:u=$s,title:h}=e,m=i==="vertical",c=h?30:0,p=120,f=X(()=>{let L=0;for(let R=0;R<t.length;R++)t[R].value>L&&(L=t[R].value);return L>0?L:1},[t]),y=v(L=>f===0?0:Math.max(.05,L/f),[f]),x=v((L,R)=>R||(u[L%u.length]??$s[0]),[u]),g=v(()=>{if(t.length===0)return[];let L=[],R=40,$=n-R*2-p,B=r-c-R*2,E=d*(t.length-1),N=Math.max(1,(B-E)/t.length),z=R+$/2;for(let k=0;k<t.length;k++){let w=t[k],D=k<t.length-1?t[k+1]:null,M=x(k,w.color),F=y(w.value),P=D!==null?y(D.value):F*.6,W=$/2*F,_=$/2*P,O=c+R+k*(N+d),Y=z-W,K=z+W,Q=z+_,q=z-_,H=`${Y},${O} ${K},${O} ${Q},${O+N} ${q},${O+N}`;L.push(o("polygon",{key:`section-${k}`,points:H,fill:M,stroke:"#fff","stroke-width":"1"}));let j=R+$+12,G=O+N/2;if(s&&L.push(o("text",{key:`label-${k}`,x:String(j),y:String(G-(a||l?6:0)),"text-anchor":"start","font-size":"12","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},w.label)),a||l){let V="";if(a&&(V=String(w.value)),l&&t.length>0){let Z=t[0].value,te=Z>0?Math.round(w.value/Z*100):0;V+=a?` (${te}%)`:`${te}%`}L.push(o("text",{key:`value-${k}`,x:String(j),y:String(G+(s?10:4)),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},V))}}return L},[t,n,r,c,d,s,a,l,x,y,p]),b=v(()=>{if(t.length===0)return[];let L=[],R=40,$=n-R*2,E=r-c-R*2-40,N=d*(t.length-1),z=Math.max(1,($-N)/t.length),k=c+R+E/2;for(let w=0;w<t.length;w++){let D=t[w],M=w<t.length-1?t[w+1]:null,F=x(w,D.color),P=y(D.value),W=M!==null?y(M.value):P*.6,_=E/2*P,O=E/2*W,Y=R+w*(z+d),K=k-_,Q=k-O,q=k+O,H=k+_,j=`${Y},${K} ${Y+z},${Q} ${Y+z},${q} ${Y},${H}`;L.push(o("polygon",{key:`section-${w}`,points:j,fill:F,stroke:"#fff","stroke-width":"1"}));let G=Y+z/2,V=c+R+E+14;if(s&&L.push(o("text",{key:`label-${w}`,x:String(G),y:String(V),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},D.label)),a||l){let Z="";if(a&&(Z=String(D.value)),l&&t.length>0){let te=t[0].value,ae=te>0?Math.round(D.value/te*100):0;Z+=a?` (${ae}%)`:`${ae}%`}L.push(o("text",{key:`value-${w}`,x:String(G),y:String(V+14),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#6b7280"},Z))}}return L},[t,n,r,c,d,s,a,l,x,y]),S=v(()=>h?[o("text",{key:"title",x:String(n/2),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,n]),I=v(()=>t.length>0?[]:[o("text",{key:"empty",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,n,r]),A=S(),C=m?g():b(),T=I();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Funnel chart",style:{fontFamily:"sans-serif"}},...A,...C,...T)}var zs=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function As(e){if(e<=0)return 1;let t=e/6,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function fu(e,t){return t||zs[e%zs.length]}function Ls(e){let{tasks:t=[],width:n=800,height:r,barHeight:i=24,barGap:s=8,showGrid:a=!0,showLabels:l=!0,showProgress:d=!1,timeUnit:u="days",title:h,padding:m=50}=e;if(t.length===0)return o("svg",{width:"100%",height:String(r??100),viewBox:`0 0 ${n} ${r??100}`,xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Empty Gantt chart"},o("text",{x:String(n/2),y:String((r??100)/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.4"},"No tasks to display"));let c=l?120:0,p=X(()=>{let B=1/0,E=-1/0;for(let N of t){N.start<B&&(B=N.start);let z=N.start+N.duration;z>E&&(E=z)}return B===1/0&&(B=0,E=1),{min:B,max:E,range:E-B}},[t]),f=X(()=>{let B=t.slice();return B.sort((E,N)=>E.group!==N.group?(E.group??"").localeCompare(N.group??""):E.start-N.start),B},[t]),y=r??m*2+f.length*(i+s)+s+20,x=n-m-c-m,g=m+(h?20:0),b=v(B=>p.range===0?c+m:c+m+(B-p.min)/p.range*x,[p,x,c,m]),S=v(()=>{if(!a)return[];let B=[],E=As(p.range),N=Math.ceil(p.min/E)*E,z=g+f.length*(i+s)+s;for(let k=N;k<=p.max;k+=E){let w=b(k);B.push(o("line",{key:`grid-${k}`,x1:String(w),y1:String(g),x2:String(w),y2:String(z),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"}))}return B},[a,p,g,f.length,i,s,b]),I=v(()=>{let B=[],E=As(p.range),N=Math.ceil(p.min/E)*E,z=g-8;for(let k=N;k<=p.max;k+=E){let w=b(k);B.push(o("text",{key:`taxis-${k}`,x:String(w),y:String(z),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},String(k)))}return B.push(o("text",{key:"time-unit",x:String(n-m),y:String(z),"text-anchor":"end","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.4","font-style":"italic"},u)),B},[p,g,b,u,n,m]),A=v(()=>{let B=[],E="";for(let N=0;N<f.length;N++){let z=f[N],k=g+N*(i+s)+s,w=b(z.start),D=Math.max(2,b(z.start+z.duration)-w),M=fu(N,z.color);z.group&&z.group!==E&&(E=z.group,l&&B.push(o("text",{key:`group-${N}`,x:String(m),y:String(k+i/2-12),"font-size":"9","font-family":"sans-serif","font-weight":"bold",fill:"currentColor",opacity:"0.4","text-transform":"uppercase"},z.group))),B.push(o("rect",{key:`bar-${z.id}`,x:String(w),y:String(k),width:String(D),height:String(i),rx:"4",ry:"4",fill:M,role:"graphics-symbol","aria-label":`${z.label}: start ${z.start}, duration ${z.duration}`})),l&&B.push(o("text",{key:`label-${z.id}`,x:String(c+m-8),y:String(k+i/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"currentColor"},z.label.length>16?z.label.substring(0,14)+"..":z.label)),d&&D>30&&B.push(o("text",{key:`prog-${z.id}`,x:String(w+D/2),y:String(k+i/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#ffffff"},`${z.start}-${z.start+z.duration}`))}return B},[f,g,i,s,b,l,d,c,m]),C=v(()=>h?[o("text",{key:"title",x:String(n/2),y:String(m/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},h)]:[],[h,n,m]),T=S(),L=I(),R=A(),$=C();return o("svg",{width:"100%",height:String(y),viewBox:`0 0 ${n} ${y}`,xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Gantt chart",style:{fontFamily:"sans-serif"}},...$,...T,...L,...R)}var mu=Math.PI/180;function gu(e){return e*mu}function Je(e,t,n,r){let i=gu(r);return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function Bs(e,t,n,r,i){let s=Je(e,t,n,i),a=Je(e,t,n,r),l=i-r,d=Math.abs(l)>180?1:0,u=l>0?1:0;return`M ${s.x} ${s.y} A ${n} ${n} 0 ${d} ${u===1?0:1} ${a.x} ${a.y}`}function hu(e,t,n){return e<t?t:e>n?n:e}function mt(e){return!isFinite(e)||isNaN(e)?"--":Math.abs(e)>=1e3?Math.round(e).toString():e===Math.floor(e)?e.toString():e.toFixed(1)}function Fs(e){let{value:t,min:n=0,max:r=100,width:i=300,height:s=200,startAngle:a=-135,endAngle:l=135,arcWidth:d=20,showValue:u=!0,showMinMax:h=!0,showTicks:m=!0,tickCount:c=10,label:p,unit:f,colors:y=["#22c55e","#f59e0b","#ef4444"],needleColor:x="#374151",backgroundColor:g="#e5e7eb"}=e,b=isFinite(n)&&!isNaN(n)?n:0,S=isFinite(r)&&!isNaN(r)&&r>b?r:b+100,I=isFinite(t)&&!isNaN(t)?hu(t,b,S):b,A=(u?24:0)+(p?18:0),C=i/2,T=(s-A)*.6,L=Math.min(i/2,(s-A)*.55)-d/2-10,R=L-d,$=L-d/2,B=l-a,E=v(H=>{let j=S-b;if(j===0)return a;let G=(H-b)/j;return a+G*B},[b,S,a,B]),N=v(()=>{let H=Bs(C,T,$,a,l);return[o("path",{key:"bg-arc",d:H,fill:"none",stroke:g,"stroke-width":String(d),"stroke-linecap":"round"})]},[C,T,$,a,l,g,d]),z=v(()=>{if(y.length===0)return[];let H=[],j=B/y.length;for(let G=0;G<y.length;G++){let V=a+G*j,Z=V+j,te=Bs(C,T,$,V,Z);H.push(o("path",{key:`seg-${G}`,d:te,fill:"none",stroke:y[G],"stroke-width":String(d),"stroke-linecap":G===0||G===y.length-1?"round":"butt",opacity:"0.85"}))}return H},[y,B,a,C,T,$,d]),k=v(()=>{if(!m||c<=0)return[];let H=[],j=Math.max(1,Math.min(c,100));for(let G=0;G<=j;G++){let V=G/j,Z=a+V*B,te=G%2===0,ae=te?10:6,J=Je(C,T,L+4,Z),ie=Je(C,T,L+4+ae,Z);if(H.push(o("line",{key:`tick-${G}`,x1:String(J.x),y1:String(J.y),x2:String(ie.x),y2:String(ie.y),stroke:"currentColor",opacity:"0.4","stroke-width":te?"2":"1"})),te){let le=b+V*(S-b),fe=Je(C,T,L+4+ae+12,Z);H.push(o("text",{key:`tick-label-${G}`,x:String(fe.x),y:String(fe.y+3),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},mt(le)))}}return H},[m,c,a,B,C,T,L,b,S]),w=v(()=>{let H=[],j=E(I),G=R-8,V=Je(C,T,G,j),Z=6,te=j+90,ae=j-90,J=Je(C,T,Z,te),ie=Je(C,T,Z,ae);return H.push(o("polygon",{key:"needle",points:`${V.x},${V.y} ${J.x},${J.y} ${ie.x},${ie.y}`,fill:x,stroke:"none"})),H.push(o("circle",{key:"needle-cap",cx:String(C),cy:String(T),r:"8",fill:x,stroke:"#fff","stroke-width":"2"})),H},[I,E,C,T,R,x]),D=v(()=>{if(!u)return[];let H=[],j=mt(I),G=j+(f?" "+f:""),V=T+$+20;return H.push(o("text",{key:"value-text",x:String(C),y:String(V),"text-anchor":"middle","font-size":"22","font-weight":"bold","font-family":"sans-serif",fill:"currentColor","aria-label":`Value: ${G}`},j,f?o("tspan",{key:"unit","font-size":"14","font-weight":"normal",opacity:"0.6",fill:"currentColor"}," "+f):null)),H},[u,I,f,C,T,$]),M=v(()=>{if(!p)return[];let H=T+$+(u?40:20);return[o("text",{key:"label",x:String(C),y:String(H),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},p)]},[p,C,T,$,u]),F=v(()=>{if(!h)return[];let H=[],j=Je(C,T,$,a),G=Je(C,T,$,l);return H.push(o("text",{key:"min-label",x:String(j.x-4),y:String(j.y+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},mt(b))),H.push(o("text",{key:"max-label",x:String(G.x+4),y:String(G.y+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},mt(S))),H},[h,C,T,$,a,l,b,S]),P=N(),W=z(),_=k(),O=w(),Y=D(),K=M(),Q=F(),q=`Gauge: ${mt(I)}${f?" "+f:""}, range ${mt(b)} to ${mt(S)}${p?", "+p:""}`;return o("svg",{width:"100%",viewBox:`0 0 ${i} ${s}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"meter","aria-valuenow":String(I),"aria-valuemin":String(b),"aria-valuemax":String(S),"aria-label":q,style:{fontFamily:"sans-serif"}},...P,...W,..._,...O,...Y,...K,...Q)}var _t={AL:{name:"Alabama",path:"m 643,467.4 .4,-7.3 -.9,-1.2 -1.7,-.7 -2.5,-2.8 .5,-2.9 48.8,-5.1 -.7,-2.2 -1.5,-1.5 -.5,-1.4 .6,-6.3 -2.4,-5.7 .5,-2.6 .3,-3.7 2.2,-3.8 -.2,-1.1 -1.7,-1 v -3.2 l -1.8,-1.9 -2.9,-6.1 -12.9,-45.8 -45.7,4 1.3,2 -1.3,67 4.4,33.2 .9,-.5 1.3,.1 .6,.4 .8,-.1 2,-3.8 v -2.3 l 1.1,-1.1 1.4,.5 3.4,6.4 v .9 l -3.3,2.2 3.5,-.4 4.9,-1.6 z"},AK:{name:"Alaska",path:"m 15.8,572 h 2.4 l .7,.7 -1,1.2 -1.9,.2 -2.5,1.3 -3.7,-.1 2.2,-.9 .3,-1.1 2.5,-.3 z m 8.3,-1.7 1.3,.5 h .9 l .5,1.2 .3,-.6 .9,.2 1.1,1.5 0,.5 -4.2,1.9 -2.4,-.1 -1,-.5 -1.1,.7 -2,0 -1.1,-1.4 4.7,-.5 z m 5.4,-.1 1,.1 .7,.7 v 1 l -1.3,.1 -.9,-1.1 z m 2.5,.3 1.3,-.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-1.1 v -1.4 l 3.3,1.9 1.9,.7 1.9,.7 3,3.8 17,3.8 1.4,1 4,.8 .7,.5 2.8,-.2 4.9,.8 1.4,1.5 -1,1 .8,.8 3.8,.7 1.2,1.2 .1,4.4 -1.3,2.8 2,.1 1,-.8 .9,.8 -1.1,3.1 1,1.6 1.2,.3 z m -49.5,-37.3 -.5,.1 -1.5,1.6 .2,.5 1.5,-.6 v -.6 l .9,-.3 z m 1.6,-1.1 -1,.3 -.2,.7 .9,-.1 z m -1.3,-1.6 -.2,.9 h 1.7 l .6,-.4 .1,-1 z m 2.8,-3 -.3,1.9 1.2,-.5 .1,-1.4 z m 58.3,31.9 -2,.3 -.4,1.3 1.3,1.7 z"},WY:{name:"Wyoming",path:"m 355.3,143.7 -51,-5.3 -57.3,-7.9 -2,10.7 -8.5,54.8 -3.3,21.9 32.1,4.8 44.9,5.7 37.5,3.4 3.7,-44.2 z"},DC:{name:"District of Columbia",path:"m 803.5,252 -2.6,-1.8 -1,1.7 .5,.4 .4,.1 .6,.5 .3,.7 -.1,.5 .2,.5 z"}};function Ns(e){let{width:t=959,height:n=593,stateColors:r={},defaultColor:i="#D0D0D0",strokeColor:s="#FFFFFF",strokeWidth:a=1,onStateClick:l,onStateHover:d,hoverColor:u="#FFD700",title:h="Map of the United States"}=e,m=X(()=>Object.keys(_t),[]),c=v(g=>{l&&l(g)},[l]),p=v((g,b)=>{let S=b.currentTarget;S&&S.setAttribute("fill",u),d&&d(g)},[d,u]),f=v((g,b)=>{let S=b.currentTarget;if(S){let I=r[g]??i;S.setAttribute("fill",I)}d&&d(null)},[d,r,i]),y=X(()=>{let g=[];for(let b=0;b<m.length;b++){let S=m[b],I=_t[S],A=r[S]??i,C={key:`state-${S}`,d:I.path,fill:A,stroke:s,"stroke-width":String(a),"stroke-linejoin":"round","data-state":S,role:"img","aria-label":I.name,style:{cursor:l?"pointer":"default"}};if(l){let L=S;C.onClick=()=>c(L),C.onKeyDown=R=>{(R.key==="Enter"||R.key===" ")&&c(L)},C.tabindex=0,C.role="button",C["aria-label"]=I.name}let T=S;C.onMouseOver=L=>p(T,L),C.onMouseOut=L=>f(T,L),g.push(o("path",C))}return g},[m,r,i,s,a,l,c,p,f]),x=o("title",{key:"map-title"},h);return o("svg",{width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h,style:{fontFamily:"sans-serif"}},x,...y)}function vo(e){let t=e.replace("#",""),n=t.length===3?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,r=parseInt(n,16);return{r:r>>16&255,g:r>>8&255,b:r&255}}function bu(e,t,n){let r=i=>{let s=Math.max(0,Math.min(255,Math.round(i))).toString(16);return s.length===1?"0"+s:s};return`#${r(e)}${r(t)}${r(n)}`}function xu(e,t){if(t.length===0)return"#000000";if(t.length===1)return t[0];let n=Math.max(0,Math.min(1,e)),r=t.length-1,i=Math.min(Math.floor(n*r),r-1),s=n*r-i,a=vo(t[i]),l=vo(t[i+1]);return bu(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}function yu(e){let{r:t,g:n,b:r}=vo(e);return(.299*t+.587*n+.114*r)/255}var Su=["#3b82f6","#fbbf24","#ef4444"];function Ws(e){let{data:t=[],rowLabels:n,columnLabels:r,width:i=600,height:s=400,colorScale:a=Su,minValue:l,maxValue:d,showValues:u=!1,cellBorderColor:h="#fff",cellBorderWidth:m=1,title:c,padding:p=60}=e,f=t.length,y=X(()=>{let k=0;for(let w of t)w.length>k&&(k=w.length);return k},[t]),{minVal:x,maxVal:g}=X(()=>{let k=l??1/0,w=d??-1/0;for(let D of t)for(let M of D)l===void 0&&M<k&&(k=M),d===void 0&&M>w&&(w=M);return k===1/0&&(k=0),w===-1/0&&(w=1),k===w&&(w=k+1),{minVal:k,maxVal:w}},[t,l,d]),b=c?30:0,S=n?p:20,I=r?p:20,A=i-S-20,C=s-b-I-20,T=y>0?A/y:0,L=f>0?C/f:0,R=v(()=>{let k=[];for(let w=0;w<f;w++){let D=t[w];for(let M=0;M<y;M++){let F=M<D.length?D[M]:0,P=(F-x)/(g-x),W=xu(P,a),_=S+M*T,O=b+20+w*L;if(k.push(o("rect",{key:`cell-${w}-${M}`,x:String(_),y:String(O),width:String(T),height:String(L),fill:W,stroke:h,"stroke-width":String(m)})),u){let Y=yu(W)>.5?"#111827":"#ffffff";k.push(o("text",{key:`val-${w}-${M}`,x:String(_+T/2),y:String(O+L/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.min(11,T*.3,L*.4)),"font-family":"sans-serif",fill:Y},String(Math.round(F*100)/100)))}}}return k},[t,f,y,x,g,a,T,L,S,b,u,h,m]),$=v(()=>{let k=[];if(n)for(let w=0;w<f;w++){let D=w<n.length?n[w]:"",M=b+20+w*L+L/2;k.push(o("text",{key:`row-label-${w}`,x:String(S-8),y:String(M),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},D))}if(r)for(let w=0;w<y;w++){let D=w<r.length?r[w]:"",M=S+w*T+T/2,F=b+20+f*L+16;k.push(o("text",{key:`col-label-${w}`,x:String(M),y:String(F),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},D))}return k},[n,r,f,y,T,L,S,b]),B=v(()=>c?[o("text",{key:"title",x:String(i/2),y:"22","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},c)]:[],[c,i]);if(f===0||y===0)return o("svg",{width:"100%",viewBox:`0 0 ${i} ${s}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":c??"Heat map \u2014 no data"},o("text",{x:String(i/2),y:String(s/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"No data to display."));let E=B(),N=R(),z=$();return o("svg",{width:"100%",viewBox:`0 0 ${i} ${s}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":c??"Heat map",style:{fontFamily:"sans-serif"}},...E,...N,...z)}function vu(e,t){if(e.length===0)return[];let n=e[0],r=e[0];for(let a=1;a<e.length;a++){let l=e[a];l<n&&(n=l),l>r&&(r=l)}if(n===r)return[{min:n,max:r+1,count:e.length}];let i=(r-n)/t,s=[];for(let a=0;a<t;a++)s.push({min:n+a*i,max:n+(a+1)*i,count:0});for(let a=0;a<e.length;a++){let l=e[a],d=Math.floor((l-n)/i);d>=t&&(d=t-1),s[d].count++}return s}function wu(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function wo(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function _s(e){let{data:t=[],bins:n=10,width:r=600,height:i=400,barColor:s="#3b82f6",barGap:a=2,showGrid:l=!0,showValues:d=!0,title:u,xLabel:h,yLabel:m,padding:c=60}=e,p=Math.max(1,Math.round(n)),f=X(()=>vu(t,p),[t,p]),y=X(()=>{let E=0;for(let N=0;N<f.length;N++)f[N].count>E&&(E=f[N].count);return E>0?E:1},[f]),x=r-c*2,g=i-c*2,b=v(()=>{if(!l)return[];let E=wu(y),N=[];for(let z=E;z<=y;z+=E){let k=c+g-z/y*g;N.push(o("line",{key:`grid-${z}`,x1:String(c),y1:String(k),x2:String(c+x),y2:String(k),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),N.push(o("text",{key:`grid-label-${z}`,x:String(c-8),y:String(k+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(z)))}return N},[l,y,c,x,g]),S=v(()=>{let E=[];return E.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+g),stroke:"#374151","stroke-width":"1.5"})),E.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+g),x2:String(c+x),y2:String(c+g),stroke:"#374151","stroke-width":"1.5"})),E},[c,x,g]),I=v(()=>{if(f.length===0)return[];let E=[],N=a*(f.length-1),z=Math.max(1,(x-N)/f.length);for(let k=0;k<f.length;k++){let w=f[k],D=w.count/y*g,M=c+k*(z+a),F=c+g-D;if(E.push(o("rect",{key:`bar-${k}`,x:String(M),y:String(F),width:String(z),height:String(D),fill:s})),d&&w.count>0&&E.push(o("text",{key:`val-${k}`,x:String(M+z/2),y:String(F-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},String(w.count))),f.length<=15||k%2===0||k===f.length-1){let W=(f.length===1,wo(w.min));E.push(o("text",{key:`xlabel-${k}`,x:String(M+z/2),y:String(c+g+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},W))}}if(f.length>0){let k=f[f.length-1],w=c+x;E.push(o("text",{key:"xlabel-end",x:String(w),y:String(c+g+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},wo(k.max)))}return E},[f,y,a,s,d,c,x,g]),A=v(()=>{let E=[];return u&&E.push(o("text",{key:"title",x:String(r/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},u)),h&&E.push(o("text",{key:"x-label",x:String(c+x/2),y:String(i-8),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151"},h)),m&&E.push(o("text",{key:"y-label",x:String(14),y:String(c+g/2),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90 14 ${c+g/2})`},m)),E},[u,h,m,r,i,c,x,g]),C=v(()=>t.length>0?[]:[o("text",{key:"empty",x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,r,i]),T=b(),L=S(),R=I(),$=A(),B=C();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":u??"Histogram",style:{fontFamily:"sans-serif"}},...$,...T,...L,...R,...B)}function ku(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function Os(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",stemColor:s="#94a3b8",stemWidth:a=2,dotRadius:l=6,dotColor:d="#3b82f6",showGrid:u=!0,showValues:h=!0,title:m,padding:c=60}=e,p=i==="vertical",f=p?30:0,y=n-c*2,x=r-c*2-f,g=p?x:y,b=p?y:x,S=X(()=>{let k=0;for(let w=0;w<t.length;w++)t[w].value>k&&(k=t[w].value);return k>0?k:1},[t]),I=X(()=>t.length===0?0:b/t.length,[t.length,b]),A=v(()=>{if(!u)return[];let k=ku(S),w=[];for(let D=k;D<=S;D+=k){let M=D/S*g;if(p){let F=c+x-M;w.push(o("line",{key:`grid-${D}`,x1:String(c),y1:String(F),x2:String(c+y),y2:String(F),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`grid-label-${D}`,x:String(c-8),y:String(F+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(D)))}else{let F=c+M;w.push(o("line",{key:`grid-${D}`,x1:String(F),y1:String(c),x2:String(F),y2:String(c+x),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`grid-label-${D}`,x:String(F),y:String(c+x+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(D)))}}return w},[u,S,p,c,y,x,g]),C=v(()=>{let k=[];return p?k.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"})):k.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"})),k.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+x),x2:String(c+y),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"})),k},[p,c,y,x]),T=v(()=>{if(t.length===0)return[];let k=[];for(let w=0;w<t.length;w++){let D=t[w],M=D.value/S*g,F=I*w+I/2,P=D.color??d;if(p){let W=c+F,_=c+x,O=c+x-M;k.push(o("line",{key:`stem-${w}`,x1:String(W),y1:String(_),x2:String(W),y2:String(O),stroke:s,"stroke-width":String(a)})),k.push(o("circle",{key:`dot-${w}`,cx:String(W),cy:String(O),r:String(l),fill:P})),h&&k.push(o("text",{key:`val-${w}`,x:String(W),y:String(O-l-4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(D.value)));let Y=W,K=c+x+16;k.push(o("text",{key:`cat-${w}`,x:String(Y),y:String(K),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${Y}, ${K})`},D.label))}else{let W=c+F,_=c,O=c+M;k.push(o("line",{key:`stem-${w}`,x1:String(_),y1:String(W),x2:String(O),y2:String(W),stroke:s,"stroke-width":String(a)})),k.push(o("circle",{key:`dot-${w}`,cx:String(O),cy:String(W),r:String(l),fill:P})),h&&k.push(o("text",{key:`val-${w}`,x:String(O+l+4),y:String(W+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(D.value))),k.push(o("text",{key:`cat-${w}`,x:String(c-8),y:String(W+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},D.label))}}return k},[t,S,I,d,l,s,a,h,p,c,y,x,g]),L=v(()=>m?[o("text",{key:"title",x:String(n/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},m)]:[],[m,n,c]),R=v(()=>t.length>0?[]:[o("text",{key:"empty",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,n,r]),$=A(),B=C(),E=T(),N=L(),z=R();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Lollipop chart",style:{fontFamily:"sans-serif"}},...N,...$,...B,...E,...z)}function ko(e){let t=e.replace("#",""),n=t.length===3?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,r=parseInt(n,16);return{r:r>>16&255,g:r>>8&255,b:r&255}}function Cu(e,t,n){let r=i=>{let s=Math.max(0,Math.min(255,Math.round(i))).toString(16);return s.length===1?"0"+s:s};return`#${r(e)}${r(t)}${r(n)}`}function Mu(e,t){if(t.length===0)return"#000000";if(t.length===1)return t[0];let n=Math.max(0,Math.min(1,e)),r=t.length-1,i=Math.min(Math.floor(n*r),r-1),s=n*r-i,a=ko(t[i]),l=ko(t[i+1]);return Cu(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}function Eu(e){let{r:t,g:n,b:r}=ko(e);return(.299*t+.587*n+.114*r)/255}var Iu=["#f0f9ff","#3b82f6","#1e3a8a"];function Hs(e){let{data:t=[],labels:n,rowLabels:r,columnLabels:i,width:s=500,height:a=500,colorScale:l=Iu,showValues:d=!0,showDiagonal:u=!0,cellBorderColor:h="#e5e7eb",title:m,padding:c=70,symmetric:p=!1}=e,f=r??n,y=i??n,x=t.length,g=X(()=>{let P=0;for(let W of t)W.length>P&&(P=W.length);return P},[t]),b=X(()=>{if(!p||x===0)return t;let P=[],W=Math.max(x,g);for(let _=0;_<W;_++){let O=[];for(let Y=0;Y<W;Y++){let K=t[_],Q=K&&Y<K.length?K[Y]:0,q=t[Y],H=q&&_<q.length?q[_]:0;Q!==0?O.push(Q):O.push(H)}P.push(O)}return P},[t,p,x,g]),S=b.length,I=X(()=>{let P=0;for(let W of b)W.length>P&&(P=W.length);return P},[b]),{minVal:A,maxVal:C}=X(()=>{let P=1/0,W=-1/0;for(let _ of b)for(let O of _)O<P&&(P=O),O>W&&(W=O);return P===1/0&&(P=0),W===-1/0&&(W=1),P===W&&(W=P+1),{minVal:P,maxVal:W}},[b]),T=m?30:0,L=f?c:20,R=y?c:20,$=s-L-20,B=a-T-R-20,E=I>0?$/I:0,N=S>0?B/S:0,z=v(()=>{let P=[];for(let W=0;W<S;W++){let _=b[W];for(let O=0;O<I;O++){let Y=O<_.length?_[O]:0,K=(Y-A)/(C-A),Q=Mu(K,l),q=L+O*E,H=T+20+W*N,j=W===O,G=j&&u?"currentColor":h,V=j&&u?"2":"1";if(P.push(o("rect",{key:`cell-${W}-${O}`,x:String(q),y:String(H),width:String(E),height:String(N),fill:Q,stroke:G,"stroke-width":V})),d){let Z=Eu(Q)>.5?"#111827":"#ffffff",te=Math.min(12,E*.3,N*.35);P.push(o("text",{key:`val-${W}-${O}`,x:String(q+E/2),y:String(H+N/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.max(8,te)),"font-weight":j&&u?"bold":"normal","font-family":"sans-serif",fill:Z},String(Math.round(Y*100)/100)))}}}return P},[b,S,I,A,C,l,E,N,L,T,d,u,h]),k=v(()=>{let P=[];if(f)for(let W=0;W<S;W++){let _=W<f.length?f[W]:"",O=T+20+W*N+N/2;P.push(o("text",{key:`row-label-${W}`,x:String(L-8),y:String(O),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},_))}if(y)for(let W=0;W<I;W++){let _=W<y.length?y[W]:"",O=L+W*E+E/2,Y=T+20+S*N+12;P.push(o("text",{key:`col-label-${W}`,x:String(O),y:String(Y),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},_))}return P},[f,y,S,I,E,N,L,T]),w=v(()=>m?[o("text",{key:"title",x:String(s/2),y:"22","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},m)]:[],[m,s]);if(S===0||I===0)return o("svg",{width:"100%",viewBox:`0 0 ${s} ${a}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Matrix \u2014 no data"},o("text",{x:String(s/2),y:String(a/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"No data to display."));let D=w(),M=z(),F=k();return o("svg",{width:"100%",viewBox:`0 0 ${s} ${a}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Matrix visualization",style:{fontFamily:"sans-serif"}},...D,...M,...F)}var Ru=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function In(e){if(!e.children||e.children.length===0)return Math.max(0,e.value??0);let t=0,n=[e];for(;n.length>0;){let r=n.pop();if(!r.children||r.children.length===0)t+=Math.max(0,r.value??0);else for(let i=r.children.length-1;i>=0;i--)n.push(r.children[i])}return t}function Pu(e){let t=0,n=[{node:e,depth:0}];for(;n.length>0;){let{node:r,depth:i}=n.pop();if(i>t&&(t=i),r.children)for(let s=r.children.length-1;s>=0;s--)n.push({node:r.children[s],depth:i+1})}return t}function Tu(e,t,n,r,i,s,a){let l=[];if(In(e)<=0)return l;let h=Pu(e)+1,m=s==="horizontal",c=m?i/h:r/h,p=[];for(p.push({node:e,depth:0,spanStart:m?t:n,spanEnd:m?t+r:n+i,colorIndex:0});p.length>0;){let f=p.shift(),{node:y,depth:x,spanStart:g,spanEnd:b,colorIndex:S}=f,I=In(y);if(I<=0)continue;let A=b-g,C,T,L,R;if(m?(C=g,T=n+x*c,L=A,R=c):(C=t+x*c,T=g,L=c,R=A),l.push({x:C,y:T,w:L,h:R,label:y.label,value:I,color:y.color??a[S%a.length],depth:x}),y.children&&y.children.length>0){let $=g;for(let B=0;B<y.children.length;B++){let E=y.children[B],N=In(E);if(N<=0)continue;let z=N/I*A;p.push({node:E,depth:x+1,spanStart:$,spanEnd:$+z,colorIndex:x===0?B:S}),$+=z}}}return l}function Ys(e){let{data:t,width:n=600,height:r=400,orientation:i="horizontal",showLabels:s=!0,showValues:a=!0,colors:l=Ru,borderColor:d="#ffffff",borderWidth:u=1,title:h,padding:m=10}=e,c=h?30:0,p=m,f=m+c,y=n-m*2,x=r-m*2-c;if(X(()=>In(t),[t])<=0||y<=0||x<=0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Empty partition diagram"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let b=X(()=>Tu(t,p,f,y,x,i,l),[t,p,f,y,x,i,l]),S=[];h&&S.push(o("text",{key:"title",x:String(n/2),y:String(m+16),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h));for(let I=0;I<b.length;I++){let A=b[I];if(S.push(o("rect",{key:`cell-${I}`,x:String(A.x),y:String(A.y),width:String(Math.max(0,A.w)),height:String(Math.max(0,A.h)),fill:A.color,stroke:d,"stroke-width":String(u),role:"graphics-symbol","aria-label":`${A.label}: ${A.value}`})),s&&A.w>20&&A.h>14){let C=Math.floor(A.w/7),T=A.label.length>C?A.label.substring(0,Math.max(1,C-2))+"..":A.label;S.push(o("text",{key:`label-${I}`,x:String(A.x+A.w/2),y:String(A.y+A.h/2+(a?-2:4)),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},T))}a&&A.w>30&&A.h>28&&S.push(o("text",{key:`value-${I}`,x:String(A.x+A.w/2),y:String(A.y+A.h/2+12),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(A.value)))}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Partition diagram",style:{fontFamily:"sans-serif"}},...S)}function Co(e,t){let n=[];for(let r of t)n.push(String(e[r]??""));return n.join(" | ")}function Vs(e,t){let n=new Set;for(let i of e)n.add(Co(i,t));let r=Array.from(n);return r.sort(),r}function Rn(e,t){if(e.length===0)return 0;switch(t){case"count":return e.length;case"sum":{let n=0;for(let r of e)n+=r;return n}case"avg":{let n=0;for(let r of e)n+=r;return n/e.length}case"min":{let n=e[0];for(let r=1;r<e.length;r++)e[r]<n&&(n=e[r]);return n}case"max":{let n=e[0];for(let r=1;r<e.length;r++)e[r]>n&&(n=e[r]);return n}}}function Pn(e){return Number.isInteger(e)?String(e):e.toFixed(2)}function $u(e,t,n,r,i){let s=Vs(e,t),a=Vs(e,n),l=new Map;for(let p of e){let f=Co(p,t),y=Co(p,n),x=`${f}::${y}`;l.has(x)||l.set(x,[]);let g=l.get(x),b=0;for(let S of r){let I=p[S];if(typeof I=="number")b+=I;else if(typeof I=="string"){let A=parseFloat(I);isNaN(A)||(b+=A)}}g.push(b)}let d=new Map;for(let[p,f]of l)d.set(p,Rn(f,i));let u=new Map;for(let p of s){let f=[];for(let y of a){let x=d.get(`${p}::${y}`);x!==void 0&&f.push(x)}u.set(p,Rn(f,i==="count"?"sum":i))}let h=new Map;for(let p of a){let f=[];for(let y of s){let x=d.get(`${y}::${p}`);x!==void 0&&f.push(x)}h.set(p,Rn(f,i==="count"?"sum":i))}let m=[];for(let p of u.values())m.push(p);let c=Rn(m,i==="count"?"sum":i);return{rowKeys:s,colKeys:a,cells:d,rowTotals:u,colTotals:h,grandTotal:c}}function Us(e){let{data:t=[],rows:n=[],columns:r=[],values:i=[],aggregation:s="sum",width:a=600,height:l=400,showTotals:d=!0,title:u,headerColor:h="#3b82f6",cellPadding:m=8}=e;if(t.length===0||n.length===0&&r.length===0||i.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${a} ${l}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"table","aria-label":u??"Empty pivot table"},o("text",{x:String(a/2),y:String(l/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.4"},"No data to display"));let c=X(()=>$u(t,n,r,i,s),[t,n,r,i,s]),{rowKeys:p,colKeys:f,cells:y,rowTotals:x,colTotals:g,grandTotal:b}=c,S=u?30:0,I=f.length+(d?1:0),A=p.length+(d?1:0),C=1+I,T=1+A,L=Math.max(40,(a-m*2)/C),R=Math.max(20,Math.min(36,(l-S-m*2)/T)),$=L*C,B=R*T,E=Math.max(0,(a-$)/2),N=S+Math.max(0,(l-S-B)/2),z=[];u&&z.push(o("text",{key:"title",x:String(a/2),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},u)),z.push(o("rect",{key:"header-row-bg",x:String(E),y:String(N),width:String($),height:String(R),fill:h})),z.push(o("rect",{key:"header-col-bg",x:String(E),y:String(N+R),width:String(L),height:String(R*A),fill:h,opacity:"0.85"})),z.push(o("text",{key:"corner",x:String(E+L/2),y:String(N+R/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},s.toUpperCase()));for(let k=0;k<f.length;k++){let w=E+(k+1)*L,D=Math.floor(L/7),M=f[k],F=M.length>D?M.substring(0,Math.max(1,D-2))+"..":M;z.push(o("text",{key:`ch-${k}`,x:String(w+L/2),y:String(N+R/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},F))}d&&z.push(o("text",{key:"ch-total",x:String(E+(f.length+1)*L+L/2),y:String(N+R/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},"Total"));for(let k=0;k<p.length;k++){let w=p[k],D=N+(k+1)*R;k%2===0&&z.push(o("rect",{key:`row-bg-${k}`,x:String(E+L),y:String(D),width:String(L*I),height:String(R),fill:"#f9fafb"}));let M=Math.floor(L/7),F=w.length>M?w.substring(0,Math.max(1,M-2))+"..":w;z.push(o("text",{key:`rh-${k}`,x:String(E+L/2),y:String(D+R/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},F));for(let P=0;P<f.length;P++){let W=f[P],_=`${w}::${W}`,O=y.get(_),Y=E+(P+1)*L;z.push(o("rect",{key:`border-${k}-${P}`,x:String(Y),y:String(D),width:String(L),height:String(R),fill:"none",stroke:"#e5e7eb","stroke-width":"0.5"})),z.push(o("text",{key:`cell-${k}-${P}`,x:String(Y+L/2),y:String(D+R/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},O!==void 0?Pn(O):"-"))}if(d){let P=E+(f.length+1)*L,W=x.get(w)??0;z.push(o("rect",{key:`rt-bg-${k}`,x:String(P),y:String(D),width:String(L),height:String(R),fill:"#eff6ff"})),z.push(o("text",{key:`rt-${k}`,x:String(P+L/2),y:String(D+R/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},Pn(W)))}}if(d){let k=N+(p.length+1)*R;z.push(o("rect",{key:"total-row-bg",x:String(E),y:String(k),width:String($),height:String(R),fill:"#eff6ff"})),z.push(o("text",{key:"total-label",x:String(E+L/2),y:String(k+R/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},"Total"));for(let D=0;D<f.length;D++){let M=f[D],F=g.get(M)??0,P=E+(D+1)*L;z.push(o("text",{key:`ct-${D}`,x:String(P+L/2),y:String(k+R/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},Pn(F)))}let w=E+(f.length+1)*L;z.push(o("text",{key:"grand-total",x:String(w+L/2),y:String(k+R/2+4),"text-anchor":"middle","font-size":"12","font-family":"sans-serif","font-weight":"bold",fill:"#1e3a8a"},Pn(b)))}return z.push(o("rect",{key:"outer-border",x:String(E),y:String(N),width:String($),height:String(B),fill:"none",stroke:"#d1d5db","stroke-width":"1"})),o("svg",{width:"100%",viewBox:`0 0 ${a} ${l}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"table","aria-label":u??"Pivot table",style:{fontFamily:"sans-serif"}},...z)}function Tn(e,t){return Math.PI*2*e/t-Math.PI/2}function $n(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function js(e){let{axes:t=[],series:n=[],width:r=500,height:i=500,levels:s=5,showLabels:a=!0,showValues:l=!1,showLegend:d=!0,showDots:u=!0,gridColor:h="#d1d5db",title:m}=e,c=t.length,p=m?30:0,f=d&&n.length>0?30:0,y=60,x=Math.min((r-y*2)/2,(i-y*2-p-f)/2),g=r/2,b=y+p+x,S=X(()=>{let z=[];for(let k=0;k<c;k++){let w=t[k]?.max;if(w!==void 0&&w>0){z.push(w);continue}let D=0;for(let M of n){let F=M.values[k];F!==void 0&&F>D&&(D=F)}z.push(D>0?D:1)}return z},[t,n,c]),I=v(()=>{if(c<3)return[];let z=[];for(let k=1;k<=s;k++){let w=x*k/s,D=[];for(let M=0;M<c;M++){let F=Tn(M,c),P=$n(g,b,w,F);D.push(`${P.x},${P.y}`)}z.push(o("polygon",{key:`ring-${k}`,points:D.join(" "),fill:"none",stroke:h,"stroke-width":k===s?"1.5":"0.5","stroke-dasharray":k===s?"none":"3 2"}))}for(let k=0;k<c;k++){let w=Tn(k,c),D=$n(g,b,x,w);z.push(o("line",{key:`spoke-${k}`,x1:String(g),y1:String(b),x2:String(D.x),y2:String(D.y),stroke:h,"stroke-width":"0.75"}))}return z},[c,s,x,g,b,h]),A=v(()=>{if(!a||c<3)return[];let z=[],k=16;for(let w=0;w<c;w++){let D=Tn(w,c),M=$n(g,b,x+k,D),F="middle";M.x<g-5?F="end":M.x>g+5&&(F="start");let P=Math.abs(M.y-b)<5?"0.35em":M.y<b?"0em":"0.7em";z.push(o("text",{key:`label-${w}`,x:String(M.x),y:String(M.y),"text-anchor":F,dy:P,"font-size":"12","font-family":"sans-serif",fill:"currentColor"},t[w]?.label??`Axis ${w}`))}return z},[a,c,t,x,g,b]),C=v(()=>{if(c<3||n.length===0)return[];let z=[];for(let k=0;k<n.length;k++){let w=n[k],D=[],M=[],F=[];for(let P=0;P<c;P++){let W=w.values[P]??0,_=S[P],O=Math.min(W/_,1),Y=x*O,K=Tn(P,c),Q=$n(g,b,Y,K);D.push(`${Q.x},${Q.y}`),u&&M.push(o("circle",{key:`dot-${k}-${P}`,cx:String(Q.x),cy:String(Q.y),r:"3.5",fill:w.color,stroke:"#fff","stroke-width":"1.5"})),l&&F.push(o("text",{key:`val-${k}-${P}`,x:String(Q.x),y:String(Q.y-8),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:w.color},String(Math.round(W*100)/100)))}z.push(o("polygon",{key:`series-fill-${k}`,points:D.join(" "),fill:w.color,"fill-opacity":String(w.fillOpacity??.15),stroke:"none"})),z.push(o("polygon",{key:`series-line-${k}`,points:D.join(" "),fill:"none",stroke:w.color,"stroke-width":"2","stroke-linejoin":"round"}));for(let P of M)z.push(P);for(let P of F)z.push(P)}return z},[c,n,S,x,g,b,u,l]),T=v(()=>{if(!d||n.length===0)return[];let z=[],k=b+x+40,w=100,D=n.length*w,M=g-D/2;for(let F=0;F<n.length;F++){let P=n[F],W=M+F*w;z.push(o("rect",{key:`legend-swatch-${F}`,x:String(W),y:String(k),width:"12",height:"12",rx:"2",fill:P.color})),z.push(o("text",{key:`legend-text-${F}`,x:String(W+16),y:String(k+10),"font-size":"12","font-family":"sans-serif",fill:"currentColor"},P.label))}return z},[d,n,g,b,x]),L=v(()=>m?[o("text",{key:"title",x:String(r/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},m)]:[],[m,r]);if(c<3)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Radar chart \u2014 insufficient axes"},o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"Radar chart requires at least 3 axes."));let R=I(),$=A(),B=C(),E=T(),N=L();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Radar chart",style:{fontFamily:"sans-serif"}},...N,...R,...$,...B,...E)}var Du=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function zu(e,t){let n=new Map,r=new Map,i=new Map;for(let l of e)r.set(l,new Set),i.set(l,[]);for(let l of t){if(l.value<=0)continue;let d=r.get(l.target);d&&d.add(l.source);let u=i.get(l.source);u&&u.push(l.target)}let s=[];for(let l of e)r.get(l).size===0&&(n.set(l,0),s.push(l));if(s.length===0){for(let l of e)n.set(l,0);return n}let a=0;for(;a<s.length;){let l=s[a];a++;let d=n.get(l),u=i.get(l)??[];for(let h of u){let m=n.get(h),c=d+1;(m===void 0||c>m)&&n.set(h,c),s.includes(h)||s.push(h)}}for(let l of e)n.has(l)||n.set(l,0);return n}function Au(e,t,n,r,i,s,a,l){if(e.length===0)return{layoutNodes:[],layoutLinks:[]};let d=n-a*2,u=r-a*2,h=t.filter($=>$.value>0),m=e.map($=>$.id),c=zu(m,h),p=new Map,f=new Map;for(let $ of m)p.set($,0),f.set($,0);for(let $ of h)f.set($.source,(f.get($.source)??0)+$.value),p.set($.target,(p.get($.target)??0)+$.value);let y=0;for(let $ of c.values())$>y&&(y=$);let x=new Map;for(let $=0;$<=y;$++)x.set($,[]);for(let[$,B]of c)x.get(B).push($);let g=new Map,b=y>0?(d-i)/y:0;for(let $=0;$<=y;$++)g.set($,a+$*b);let S=new Map;for(let $=0;$<e.length;$++)S.set(e[$].id,e[$]);let I=[],A=new Map;for(let $=0;$<=y;$++){let B=x.get($);if(B.length===0)continue;let E=0;for(let w of B){let D=p.get(w)??0,M=f.get(w)??0;E+=Math.max(D,M,1)}let N=u-s*(B.length-1),z=E>0?N/E:1,k=a;for(let w=0;w<B.length;w++){let D=B[w],M=S.get(D),F=p.get(D)??0,P=f.get(D)??0,W=Math.max(F,P,1),_=Math.max(4,W*z),O=e.findIndex(K=>K.id===D),Y={id:D,label:M.label,color:M.color??l[O%l.length],column:$,x:g.get($),y:k,height:_,totalIn:F,totalOut:P,totalValue:W};I.push(Y),A.set(D,Y),k+=_+s}}let C=new Map,T=new Map;for(let $ of m)C.set($,0),T.set($,0);let L=[...h].sort(($,B)=>B.value-$.value),R=[];for(let $ of L){let B=A.get($.source),E=A.get($.target);if(!B||!E)continue;let N=B.totalOut||1,z=E.totalIn||1,k=$.value/N*B.height,w=$.value/z*E.height,D=Math.max(1,(k+w)/2),M=C.get($.source),F=T.get($.target),P=B.y+M+k/2,W=E.y+F+w/2;C.set($.source,M+k),T.set($.target,F+w);let _=S.get($.source);R.push({source:$.source,target:$.target,value:$.value,color:$.color??_?.color??B.color,sourceY:P,targetY:W,width:D})}return{layoutNodes:I,layoutLinks:R}}function Gs(e){let{nodes:t,links:n,width:r=800,height:i=500,nodeWidth:s=20,nodePadding:a=10,showLabels:l=!0,showValues:d=!1,linkOpacity:u=.4,colors:h=Du,title:m,padding:c=40}=e;if(!t||t.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Empty Sankey diagram"},o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let p=X(()=>Au(t,n,r,i,s,a,c,h),[t,n,r,i,s,a,c,h]),f=v(()=>{let I=[];for(let A=0;A<p.layoutLinks.length;A++){let C=p.layoutLinks[A],T=p.layoutNodes.find(N=>N.id===C.source),L=p.layoutNodes.find(N=>N.id===C.target);if(!T||!L)continue;let R=T.x+s,$=L.x,B=(R+$)/2,E=`M ${R} ${C.sourceY} C ${B} ${C.sourceY}, ${B} ${C.targetY}, ${$} ${C.targetY}`;I.push(o("path",{key:`link-${A}`,d:E,fill:"none",stroke:C.color,"stroke-width":String(Math.max(1,C.width)),"stroke-opacity":String(u),"stroke-linecap":"butt"})),d&&C.value>0&&I.push(o("text",{key:`link-val-${A}`,x:String(B),y:String((C.sourceY+C.targetY)/2-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280","pointer-events":"none"},String(C.value)))}return I},[p,s,u,d]),y=v(()=>{let I=[];for(let A=0;A<p.layoutNodes.length;A++){let C=p.layoutNodes[A];if(I.push(o("rect",{key:`node-${C.id}`,x:String(C.x),y:String(C.y),width:String(s),height:String(C.height),fill:C.color,stroke:"#374151","stroke-width":"0.5",role:"img","aria-label":`${C.label}: ${C.totalValue}`})),l){let T=p.layoutNodes.reduce((z,k)=>Math.max(z,k.column),0),L=C.column===T,R=L?C.x+s+6:C.x-6,$=L?"start":"end",B=C.column===0,E=B?C.x-6:R,N=B?"end":$;I.push(o("text",{key:`label-${C.id}`,x:String(E),y:String(C.y+C.height/2+4),"text-anchor":N,"font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},C.label))}}return I},[p,s,l]),x=v(()=>m?[o("text",{key:"title",x:String(r/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},m)]:[],[m,r,c]),g=f(),b=y(),S=x();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Sankey diagram",style:{fontFamily:"sans-serif"}},...S,...g,...b)}var Lu=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],Mo=2*Math.PI;function Ot(e){if(!e.children||e.children.length===0)return Math.max(0,e.value??0);let t=0,n=[e];for(;n.length>0;){let r=n.pop();if(!r.children||r.children.length===0)t+=Math.max(0,r.value??0);else for(let i=r.children.length-1;i>=0;i--)n.push(r.children[i])}return t}function Bu(e){let t=0,n=[{node:e,depth:0}];for(;n.length>0;){let{node:r,depth:i}=n.pop();if(i>t&&(t=i),r.children)for(let s=r.children.length-1;s>=0;s--)n.push({node:r.children[s],depth:i+1})}return t}function Fu(e,t,n,r,i,s){let a=s-i,l=a>Math.PI?1:0,d=i-Math.PI/2,u=s-Math.PI/2,h=e+r*Math.cos(d),m=t+r*Math.sin(d),c=e+r*Math.cos(u),p=t+r*Math.sin(u),f=e+n*Math.cos(u),y=t+n*Math.sin(u),x=e+n*Math.cos(d),g=t+n*Math.sin(d);if(a>=Mo-.001){let b=d+Math.PI,S=e+r*Math.cos(b),I=t+r*Math.sin(b),A=e+n*Math.cos(b),C=t+n*Math.sin(b);return[`M ${h} ${m}`,`A ${r} ${r} 0 1 1 ${S} ${I}`,`A ${r} ${r} 0 1 1 ${h} ${m}`,`L ${x} ${g}`,`A ${n} ${n} 0 1 0 ${A} ${C}`,`A ${n} ${n} 0 1 0 ${x} ${g}`,"Z"].join(" ")}return[`M ${h} ${m}`,`A ${r} ${r} 0 ${l} 1 ${c} ${p}`,`L ${f} ${y}`,`A ${n} ${n} 0 ${l} 0 ${x} ${g}`,"Z"].join(" ")}function Nu(e,t,n,r){let i=[],s=Ot(e);if(s<=0)return i;let a=Bu(e),l=a>0?(n-t)/(a+1):n-t,d=[];if(e.children&&e.children.length>0){let u=0;for(let h=0;h<e.children.length;h++){let m=e.children[h],c=Ot(m);if(c<=0)continue;let p=c/s*Mo;d.push({node:m,startAngle:u,endAngle:u+p,depth:0,colorIndex:h}),u+=p}}else return i.push({startAngle:0,endAngle:Mo,innerR:t,outerR:t+l,label:e.label,value:s,color:e.color??r[0],depth:0}),i;for(;d.length>0;){let u=d.shift(),{node:h,startAngle:m,endAngle:c,depth:p,colorIndex:f}=u,y=Ot(h);if(y<=0)continue;let x=t+p*l,g=x+l;if(i.push({startAngle:m,endAngle:c,innerR:x,outerR:g,label:h.label,value:y,color:h.color??r[f%r.length],depth:p}),h.children&&h.children.length>0){let b=m,S=c-m;for(let I=0;I<h.children.length;I++){let A=h.children[I],C=Ot(A);if(C<=0)continue;let T=C/y*S;d.push({node:A,startAngle:b,endAngle:b+T,depth:p+1,colorIndex:f}),b+=T}}}return i}function Xs(e){let{data:t,width:n=500,height:r=500,innerRadius:i=40,showLabels:s=!0,colors:a=Lu,strokeColor:l="#ffffff",strokeWidth:d=1,title:u}=e,h=n/2,m=r/2,c=u?20:0,p=Math.min(h,m-c)-10;if(X(()=>Ot(t),[t])<=0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":u??"Empty sunburst chart"},o("text",{x:String(h),y:String(m),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let y=X(()=>Nu(t,i,p,a),[t,i,p,a]),x=[];u&&x.push(o("text",{key:"title",x:String(h),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},u));let g=m+c/2;for(let b=0;b<y.length;b++){let S=y[b],I=Fu(h,g,S.innerR,S.outerR,S.startAngle,S.endAngle);if(x.push(o("path",{key:`arc-${b}`,d:I,fill:S.color,stroke:l,"stroke-width":String(d),role:"graphics-symbol","aria-label":`${S.label}: ${S.value}`})),s){let A=S.endAngle-S.startAngle,C=S.startAngle+A/2-Math.PI/2,T=(S.innerR+S.outerR)/2,L=S.outerR-S.innerR,R=A*T;if(R>20&&L>14){let $=h+T*Math.cos(C),B=g+T*Math.sin(C),E=Math.floor(Math.min(R,L)/7),N=S.label.length>E?S.label.substring(0,Math.max(1,E-1))+"..":S.label;x.push(o("text",{key:`label-${b}`,x:String($),y:String(B+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},N))}}}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":u??"Sunburst chart",style:{fontFamily:"sans-serif"}},...x)}var Wu=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Dn(e){if(!e.children||e.children.length===0)return Math.max(0,e.value);let t=0,n=[e];for(;n.length>0;){let r=n.pop();if(!r.children||r.children.length===0)t+=Math.max(0,r.value);else for(let i=r.children.length-1;i>=0;i--)n.push(r.children[i])}return t}function Ks(e,t){if(e.length===0||t<=0)return 1/0;let n=0;for(let s of e)n+=s;if(n<=0)return 1/0;let r=n/t,i=0;for(let s of e){if(s<=0)continue;let a=s/r,l=Math.max(a/r,r/a);l>i&&(i=l)}return i}function _u(e,t,n,r,i,s){let a=[],l=[],d=Dn(e);if(d<=0||r<=0||i<=0)return a;let u=e.children&&e.children.length>0?e.children:[e],h=r*i,m=[];for(let c=0;c<u.length;c++){let p=u[c],f=Dn(p);f<=0||m.push({label:p.label,value:f,area:f/d*h,color:p.color??s[c%s.length],node:p})}for(m.sort((c,p)=>p.area-c.area),l.push({nodes:m,rect:{x:t,y:n,w:r,h:i},depth:0});l.length>0;){let c=l.shift(),{nodes:p,rect:f,depth:y}=c;if(p.length===0)continue;let x={...f},g=0;for(;g<p.length&&x.w>0&&x.h>0;){let b=x.w>=x.h,S=b?x.h:x.w,I=[],A=[];I.push(p[g]),A.push(p[g].area),g++;let C=Ks(A,S);for(;g<p.length;){let $=[...A,p[g].area],B=Ks($,S);if(B>C)break;I.push(p[g]),A.push(p[g].area),C=B,g++}let T=0;for(let $ of A)T+=$;let L=S>0?T/S:0,R=0;for(let $=0;$<I.length;$++){let B=I[$],E=L>0?B.area/L:0,N,z,k,w;if(b?(N=x.x,z=x.y+R,k=L,w=E):(N=x.x+R,z=x.y,k=E,w=L),a.push({x:N,y:z,w:k,h:w,label:B.label,value:B.value,color:B.color,depth:y}),B.node.children&&B.node.children.length>0){let M=N+2,F=z+2+14,P=k-4,W=w-4-14;if(P>4&&W>4){let _=[],O=B.value,Y=P*W;for(let K=0;K<B.node.children.length;K++){let Q=B.node.children[K],q=Dn(Q);q<=0||_.push({label:Q.label,value:q,area:q/O*Y,color:Q.color??s[(K+y+1)%s.length],node:Q})}_.sort((K,Q)=>Q.area-K.area),l.push({nodes:_,rect:{x:M,y:F,w:P,h:W},depth:y+1})}}R+=E}b?x={x:x.x+L,y:x.y,w:x.w-L,h:x.h}:x={x:x.x,y:x.y+L,w:x.w,h:x.h-L}}}return a}function qs(e){let{data:t,width:n=600,height:r=400,showLabels:i=!0,showValues:s=!0,colors:a=Wu,borderColor:l="#ffffff",borderWidth:d=2,padding:u=2,title:h}=e,m=h?30:0,c=u,p=u+m,f=n-u*2,y=r-u*2-m;if(X(()=>Dn(t),[t])<=0||f<=0||y<=0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Empty treemap"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let g=X(()=>_u(t,c,p,f,y,a),[t,c,p,f,y,a]),b=[];h&&b.push(o("text",{key:"title",x:String(n/2),y:String(u+16),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h));for(let S=0;S<g.length;S++){let I=g[S];if(b.push(o("rect",{key:`cell-${S}`,x:String(I.x),y:String(I.y),width:String(Math.max(0,I.w)),height:String(Math.max(0,I.h)),fill:I.color,stroke:l,"stroke-width":String(d),role:"graphics-symbol","aria-label":`${I.label}: ${I.value}`})),i&&I.w>20&&I.h>14){let A=Math.floor(I.w/7),C=I.label.length>A?I.label.substring(0,Math.max(1,A-2))+"..":I.label;b.push(o("text",{key:`label-${S}`,x:String(I.x+4),y:String(I.y+12),"font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},C))}s&&I.w>30&&I.h>28&&b.push(o("text",{key:`value-${S}`,x:String(I.x+4),y:String(I.y+24),"font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(I.value)))}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Treemap chart",style:{fontFamily:"sans-serif"}},...b)}function Zs(e){let t=e.replace("#",""),n,r,i;return t.length===3?(n=parseInt(t[0]+t[0],16),r=parseInt(t[1]+t[1],16),i=parseInt(t[2]+t[2],16)):(n=parseInt(t.substring(0,2),16),r=parseInt(t.substring(2,4),16),i=parseInt(t.substring(4,6),16)),{r:isNaN(n)?0:n,g:isNaN(r)?0:r,b:isNaN(i)?0:i}}function Ou(e,t,n){let r=s=>Math.max(0,Math.min(255,Math.round(s))),i=s=>r(s).toString(16).padStart(2,"0");return"#"+i(e)+i(t)+i(n)}function Js(e,t){if(t.length===0)return"#3b82f6";if(t.length===1)return t[0];let n=Math.max(0,Math.min(1,e)),r=t.length-1,i=n*r,s=Math.floor(i),a=Math.min(s+1,r),l=i-s,d=Zs(t[s]),u=Zs(t[a]);return Ou(d.r+(u.r-d.r)*l,d.g+(u.g-d.g)*l,d.b+(u.b-d.b)*l)}function zn(e,t){if(e<=0)return 1;let n=e/t,r=Math.pow(10,Math.floor(Math.log10(n))),i=n/r;return i<=1.5?r:i<=3.5?2*r:i<=7.5?5*r:10*r}function Hu(e,t,n,r,i,s,a,l,d,u){if(e&&e.length>0)return e;let h=Math.max(2,Math.min(50,r)),m=d/(h-1),c=u/(h-1);if(n){let f=[];for(let b=0;b<h;b++)for(let S=0;S<h;S++)f.push({x:i+S*m,y:a+b*c});let x=n(f,{gridSize:h,xMin:i,xMax:s,yMin:a,yMax:l}),g=[];for(let b=0;b<f.length;b++){let S=f[b],I=x[b]??{dx:0,dy:0},A=Math.sqrt(I.dx*I.dx+I.dy*I.dy);g.push({x:S.x,y:S.y,dx:I.dx,dy:I.dy,magnitude:A})}return g}if(!t)return[];let p=[];for(let f=0;f<h;f++)for(let y=0;y<h;y++){let x=i+y*m,g=a+f*c,b=t(x,g),S=Math.sqrt(b.dx*b.dx+b.dy*b.dy);p.push({x,y:g,dx:b.dx,dy:b.dy,magnitude:S})}return p}function Yu(e,t,n,r,i){let{padding:s,chartWidth:a,chartHeight:l,xMin:d,xMax:u,yMin:h,yMax:m,xSpan:c,ySpan:p,showGrid:f,showAxes:y,colorByMagnitude:x,colorScale:g,arrowColor:b,arrowWidth:S,effectiveArrowScale:I,maxMagnitude:A,title:C,tickFontSize:T}=i,L=B=>s+(B-d)/c*a,R=B=>s+(m-B)/p*l;if(e.clearRect(0,0,t,n),C&&(e.save(),e.font="bold 16px sans-serif",e.fillStyle="#111827",e.textAlign="center",e.textBaseline="middle",e.fillText(C,t/2,s/2+4),e.restore()),f){e.save(),e.strokeStyle="#e5e7eb",e.lineWidth=.5,e.font=`${T}px sans-serif`,e.fillStyle="#6b7280";let B=zn(c,10),E=Math.ceil(d/B)*B;for(let k=E;k<=u;k+=B){let w=L(k);e.beginPath(),e.moveTo(w,s),e.lineTo(w,s+l),e.stroke(),e.textAlign="center",e.textBaseline="top",e.fillText(String(Math.round(k*100)/100),w,s+l+4)}let N=zn(p,10),z=Math.ceil(h/N)*N;for(let k=z;k<=m;k+=N){let w=R(k);e.beginPath(),e.moveTo(s,w),e.lineTo(s+a,w),e.stroke(),e.textAlign="right",e.textBaseline="middle",e.fillText(String(Math.round(k*100)/100),s-6,w)}e.restore()}if(y){if(e.save(),e.strokeStyle="#374151",e.lineWidth=S,h<=0&&m>=0){let B=R(0);e.beginPath(),e.moveTo(s,B),e.lineTo(s+a,B),e.stroke()}if(d<=0&&u>=0){let B=L(0);e.beginPath(),e.moveTo(B,s),e.lineTo(B,s+l),e.stroke()}e.strokeStyle="#d1d5db",e.lineWidth=1,e.strokeRect(s,s,a,l),e.restore()}let $=4;for(let B=0;B<r.length;B++){let E=r[B],N=E.magnitude??Math.sqrt(E.dx*E.dx+E.dy*E.dy);if(N<1e-10)continue;let z=L(E.x),k=R(E.y),w=E.dx*I,D=-E.dy*I,M=z+w,F=k+D,P;if(x){let _=N/A;P=Js(_,g)}else P=b;e.save(),e.strokeStyle=P,e.lineWidth=S,e.lineCap="round",e.beginPath(),e.moveTo(z,k),e.lineTo(M,F),e.stroke();let W=Math.sqrt(w*w+D*D);if(W>2){let _=w/W,O=D/W,Y=-O,K=_,Q=Math.min($,W*.4),q=M-_*Q+Y*Q*.5,H=F-O*Q+K*Q*.5,j=M-_*Q-Y*Q*.5,G=F-O*Q-K*Q*.5;e.fillStyle=P,e.beginPath(),e.moveTo(M,F),e.lineTo(q,H),e.lineTo(j,G),e.closePath(),e.fill()}e.restore()}}function Qs(e){let{data:t,vectorFunction:n,width:r=600,height:i=600,gridSize:s=15,xRange:a=[-5,5],yRange:l=[-5,5],arrowScale:d=1,arrowColor:u="#3b82f6",showGrid:h=!0,showAxes:m=!0,colorByMagnitude:c=!1,colorScale:p=["#3b82f6","#8b5cf6","#ef4444"],title:f,padding:y=50,tickFontSize:x=10,arrowWidth:g=1.5,renderer:b="svg",useGPU:S=!1,computeWorker:I}=e,A=Math.max(2,Math.min(50,s)),C=r-y*2,T=i-y*2,L=a[0],R=a[1],$=l[0],B=l[1],E=R-L,N=B-$,z=X(()=>q=>y+(q-L)/E*C,[y,L,E,C]),k=X(()=>q=>y+(B-q)/N*T,[y,B,N,T]),w=X(()=>Hu(t,n,I,A,L,R,$,B,E,N),[t,n,I,A,L,R,$,B,E,N]),D=X(()=>{let q=0;for(let H=0;H<w.length;H++){let j=w[H],G=j.magnitude??Math.sqrt(j.dx*j.dx+j.dy*j.dy);G>q&&(q=G)}return q>0?q:1},[w]),M=X(()=>Math.min(C,T)/Math.max(A,2)/(2*D)*d,[C,T,A,D,d]);if(b==="canvas"){let q=ne(null),H=ne(0);return re(()=>{let j=q.current;if(!j)return;let G=j.getContext("2d");if(G)return H.current&&cancelAnimationFrame(H.current),H.current=requestAnimationFrame(()=>{Yu(G,r,i,w,{padding:y,chartWidth:C,chartHeight:T,xMin:L,xMax:R,yMin:$,yMax:B,xSpan:E,ySpan:N,showGrid:h,showAxes:m,colorByMagnitude:c,colorScale:p,arrowColor:u,arrowWidth:g,effectiveArrowScale:M,maxMagnitude:D,title:f,tickFontSize:x})}),()=>{H.current&&cancelAnimationFrame(H.current)}},[w,r,i,y,C,T,L,R,$,B,E,N,h,m,c,p,u,g,M,D,f,x]),o("canvas",{ref:q,width:r,height:i,role:"img","aria-label":f??"Vector field plot",style:{fontFamily:"sans-serif",maxWidth:"100%"}})}let F=v(()=>{if(!h)return[];let q=[],H=zn(E,10),j=Math.ceil(L/H)*H;for(let Z=j;Z<=R;Z+=H){let te=z(Z);q.push(o("line",{key:`gridv-${Z}`,x1:String(te),y1:String(y),x2:String(te),y2:String(y+T),stroke:"#e5e7eb","stroke-width":"0.5"})),q.push(o("text",{key:`xtick-${Z}`,x:String(te),y:String(y+T+16),"text-anchor":"middle","font-size":String(x),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(Z*100)/100)))}let G=zn(N,10),V=Math.ceil($/G)*G;for(let Z=V;Z<=B;Z+=G){let te=k(Z);q.push(o("line",{key:`gridh-${Z}`,x1:String(y),y1:String(te),x2:String(y+C),y2:String(te),stroke:"#e5e7eb","stroke-width":"0.5"})),q.push(o("text",{key:`ytick-${Z}`,x:String(y-6),y:String(te+4),"text-anchor":"end","font-size":String(x),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(Z*100)/100)))}return q},[h,L,R,$,B,E,N,z,k,y,C,T]),P=v(()=>{if(!m)return[];let q=[];if($<=0&&B>=0){let H=k(0);q.push(o("line",{key:"axis-x",x1:String(y),y1:String(H),x2:String(y+C),y2:String(H),stroke:"#374151","stroke-width":String(g)}))}if(L<=0&&R>=0){let H=z(0);q.push(o("line",{key:"axis-y",x1:String(H),y1:String(y),x2:String(H),y2:String(y+T),stroke:"#374151","stroke-width":String(g)}))}return q.push(o("rect",{key:"chart-border",x:String(y),y:String(y),width:String(C),height:String(T),fill:"none",stroke:"#d1d5db","stroke-width":"1"})),q},[m,L,R,$,B,z,k,y,C,T]),W=v(()=>{let q=[];for(let j=0;j<w.length;j++){let G=w[j],V=G.magnitude??Math.sqrt(G.dx*G.dx+G.dy*G.dy);if(V<1e-10)continue;let Z=z(G.x),te=k(G.y),ae=G.dx*M,J=-G.dy*M,ie=Z+ae,le=te+J,fe;if(c){let ge=V/D;fe=Js(ge,p)}else fe=u;q.push(o("line",{key:`arrow-line-${j}`,x1:String(Z),y1:String(te),x2:String(ie),y2:String(le),stroke:fe,"stroke-width":String(g),"stroke-linecap":"round"}));let oe=Math.sqrt(ae*ae+J*J);if(oe>2){let ge=ae/oe,he=J/oe,ee=-he,de=ge,me=Math.min(4,oe*.4),xe=ie-ge*me+ee*me*.5,ye=le-he*me+de*me*.5,Me=ie-ge*me-ee*me*.5,ce=le-he*me-de*me*.5;q.push(o("polygon",{key:`arrow-head-${j}`,points:`${ie},${le} ${xe},${ye} ${Me},${ce}`,fill:fe}))}}return q},[w,z,k,M,c,D,p,u]),_=v(()=>f?[o("text",{key:"title",x:String(r/2),y:String(y/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},f)]:[],[f,r,y]),O=F(),Y=P(),K=W(),Q=_();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":f??"Vector field plot",style:{fontFamily:"sans-serif"}},...Q,...O,...Y,...K)}function Vu(e){let t=[],n=0;for(let r=0;r<e.length;r++){let i=e[r],s=i.type??(i.value>=0?"increase":"decrease");if(s==="total")t.push({label:i.label,value:n,type:"total",start:0,end:n});else{let a=n;n+=i.value,t.push({label:i.label,value:i.value,type:s,start:a,end:n})}}return t}function Uu(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function ea(e){let{data:t=[],width:n=600,height:r=400,increaseColor:i="#10b981",decreaseColor:s="#ef4444",totalColor:a="#3b82f6",connectorColor:l="#94a3b8",showValues:d=!0,showGrid:u=!0,showConnectors:h=!0,title:m,padding:c=60}=e,p=n-c*2,f=r-c*2,y=X(()=>Vu(t),[t]),{minVal:x,maxVal:g}=X(()=>{let D=0,M=0;for(let F=0;F<y.length;F++){let P=y[F];P.start<D&&(D=P.start),P.end<D&&(D=P.end),P.start>M&&(M=P.start),P.end>M&&(M=P.end)}return D===M&&(M=D+1),{minVal:D,maxVal:M}},[y]),b=g-x,S=v(D=>c+f-(D-x)/b*f,[c,f,x,b]),I=X(()=>y.length===0?0:p/y.length,[y.length,p]),A=6,C=Math.max(1,I-A),T=v(()=>{if(!u)return[];let D=Uu(b),M=[],F=Math.ceil(x/D)*D;for(let P=F;P<=g;P+=D){let W=S(P);M.push(o("line",{key:`grid-${P}`,x1:String(c),y1:String(W),x2:String(c+p),y2:String(W),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),M.push(o("text",{key:`grid-label-${P}`,x:String(c-8),y:String(W+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(P)))}return M},[u,b,x,g,S,c,p]),L=v(()=>{let D=[];D.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+f),stroke:"#374151","stroke-width":"1.5"}));let M=x<=0&&g>=0?S(0):c+f;return D.push(o("line",{key:"axis-x",x1:String(c),y1:String(M),x2:String(c+p),y2:String(M),stroke:"#374151","stroke-width":"1.5"})),D},[c,p,f,x,g,S]),R=v(()=>{if(y.length===0)return[];let D=[];for(let M=0;M<y.length;M++){let F=y[M],P=c+M*I+A/2,W=Math.max(F.start,F.end),_=Math.min(F.start,F.end),O=S(W),Y=S(_),K=Math.max(0,Y-O),Q;if(F.type==="total"?Q=a:F.type==="decrease"?Q=s:Q=i,D.push(o("rect",{key:`bar-${M}`,x:String(P),y:String(O),width:String(C),height:String(K),fill:Q,rx:"2",ry:"2"})),d){let q=F.type==="decrease"||F.value<0?Y+14:O-4,H=F.type==="total"?String(F.value):(F.value>=0?"+":"")+String(F.value);D.push(o("text",{key:`val-${M}`,x:String(P+C/2),y:String(q),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},H))}if(D.push(o("text",{key:`cat-${M}`,x:String(P+C/2),y:String(c+f+16),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},F.label)),h&&M<y.length-1){let q=y[M+1],H=S(F.end),j=c+(M+1)*I+A/2;q.type!=="total"&&D.push(o("line",{key:`conn-${M}`,x1:String(P+C),y1:String(H),x2:String(j),y2:String(H),stroke:l,"stroke-width":"1","stroke-dasharray":"3 2"}))}}return D},[y,I,C,S,i,s,a,l,d,h,c,f]),$=v(()=>m?[o("text",{key:"title",x:String(n/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},m)]:[],[m,n,c]),B=v(()=>t.length>0?[]:[o("text",{key:"empty",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,n,r]),E=T(),N=L(),z=R(),k=$(),w=B();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Waterfall chart",style:{fontFamily:"sans-serif"}},...k,...E,...N,...z,...w)}var ju=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],Gu=[0,-45,45,90];function Xu(e,t,n,r,i){let s=t*.6,a=e.length*s,l=t,d=n*Math.PI/180,u=Math.abs(Math.cos(d)),h=Math.abs(Math.sin(d)),m=a*u+l*h,c=a*h+l*u;return{x:r-m/2,y:i-c/2,w:m,h:c}}function Ku(e,t){return!(e.x+e.w<t.x||t.x+t.w<e.x||e.y+e.h<t.y||t.y+t.h<e.y)}function qu(e,t,n){return e.x>=0&&e.y>=0&&e.x+e.w<=t&&e.y+e.h<=n}function Zu(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return Math.abs(t)}function ta(e){let{words:t=[],width:n=600,height:r=400,minFontSize:i=10,maxFontSize:s=64,fontFamily:a="sans-serif",colors:l=ju,rotations:d=Gu,padding:u=4,spiral:h="archimedean",title:m}=e,c=X(()=>{if(t.length===0)return[];let f=t.map((C,T)=>({...C,originalIndex:T})).filter(C=>C.text.length>0&&C.weight>0).sort((C,T)=>T.weight-C.weight);if(f.length===0)return[];let y=f[f.length-1].weight,g=f[0].weight-y;function b(C){if(g===0)return(i+s)/2;let T=(C-y)/g;return i+T*(s-i)}let S=[],I=n/2,A=r/2;for(let C=0;C<f.length;C++){let T=f[C],L=b(T.weight),R=d[Zu(T.text)%d.length],$=T.color??l[C%l.length],B=!1,E=500,N=h==="archimedean"?4:5;for(let z=0;z<E;z++){let k,w;if(h==="archimedean"){let _=z*.1,O=N*_;k=O*Math.cos(_),w=O*Math.sin(_)}else{let _=Math.floor(z/4)+1,O=z%4,Y=(z%4===0?0:z)*N;switch(O){case 0:k=_*N*4,w=Y;break;case 1:k=-Y,w=_*N*4;break;case 2:k=-_*N*4,w=-Y;break;default:k=Y,w=-_*N*4;break}}let D=I+k,M=A+w,F=Xu(T.text,L,R,D,M),P={x:F.x-u,y:F.y-u,w:F.w+u*2,h:F.h+u*2};if(!qu(P,n,r))continue;let W=!1;for(let _ of S)if(Ku(P,_.bbox)){W=!0;break}if(!W){S.push({text:T.text,x:D,y:M,fontSize:L,rotation:R,color:$,bbox:P}),B=!0;break}}}return S},[t,n,r,i,s,l,d,u,h]);if(t.length===0||c.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Word cloud \u2014 no data"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":a,fill:"currentColor",opacity:"0.6"},"No words to display."));let p=[];m&&p.push(o("text",{key:"title",x:String(n/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":a,fill:"currentColor"},m));for(let f=0;f<c.length;f++){let y=c[f],x=y.rotation!==0?`translate(${y.x},${y.y}) rotate(${y.rotation})`:`translate(${y.x},${y.y})`;p.push(o("text",{key:`word-${f}`,transform:x,"text-anchor":"middle","dominant-baseline":"central","font-size":String(y.fontSize),"font-family":a,fill:y.color,"aria-label":y.text},y.text))}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Word cloud",style:{fontFamily:a}},...p)}var Ju={0:"#1e293b",1:"#3b82f6"},Qu="#666";function na(e){let{data:t=[],colorMap:n,width:r=600,height:i=600,cellGap:s=1,cellRadius:a=0,showGrid:l=!1,gridColor:d="#334155",showIndices:u=!1,backgroundColor:h="#0f172a",padding:m=10,onCellClick:c,onCellHover:p,title:f}=e,y=n??Ju,x=t.length,g=X(()=>{let D=0;for(let M=0;M<t.length;M++){let F=t[M];F!==void 0&&F.length>D&&(D=F.length)}return D},[t]),b=u?20:0,S=f?24:0,I=X(()=>{let D=r-m*2-b,M=i-m*2-b-S;if(x===0||g===0)return{cellWidth:0,cellHeight:0};let F=Math.max(0,(D-s*(g-1))/g),P=Math.max(0,(M-s*(x-1))/x);return{cellWidth:F,cellHeight:P}},[r,i,m,x,g,s,b,S]),A=v(D=>{let M=y[D];return M!==void 0?M:Qu},[y]),C=v(()=>o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:h}),[r,i,h]),T=v(()=>f?[o("text",{key:"title",x:String(r/2),y:String(m+14),"text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#e2e8f0"},f)]:[],[f,r,m]),L=v(()=>{if(!l||x===0||g===0)return[];let{cellWidth:D,cellHeight:M}=I,F=m+b,P=m+b+S,W=g*D+(g-1)*s,_=x*M+(x-1)*s,O=[];for(let Y=0;Y<=g;Y++){let K=F+Y*(D+s)-s/2;O.push(o("line",{key:`vgrid-${Y}`,x1:String(K),y1:String(P-s/2),x2:String(K),y2:String(P+_+s/2),stroke:d,"stroke-width":"0.5"}))}for(let Y=0;Y<=x;Y++){let K=P+Y*(M+s)-s/2;O.push(o("line",{key:`hgrid-${Y}`,x1:String(F-s/2),y1:String(K),x2:String(F+W+s/2),y2:String(K),stroke:d,"stroke-width":"0.5"}))}return O},[l,x,g,I,m,b,S,s,d]),R=v(()=>{if(!u||x===0||g===0)return[];let{cellWidth:D,cellHeight:M}=I,F=m+b,P=m+b+S,W=[];for(let _=0;_<g;_++){let O=F+_*(D+s)+D/2,Y=P-6;W.push(o("text",{key:`col-idx-${_}`,x:String(O),y:String(Y),"text-anchor":"middle","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(_)))}for(let _=0;_<x;_++){let O=F-6,Y=P+_*(M+s)+M/2+3;W.push(o("text",{key:`row-idx-${_}`,x:String(O),y:String(Y),"text-anchor":"end","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(_)))}return W},[u,x,g,I,m,b,S,s]),$=v(()=>{if(x===0||g===0)return[];let{cellWidth:D,cellHeight:M}=I,F=m+b,P=m+b+S,W=[];for(let _=0;_<x;_++){let O=t[_];if(O!==void 0)for(let Y=0;Y<g;Y++){let K=Y<O.length?O[Y]:0,Q=F+Y*(D+s),q=P+_*(M+s),H=A(K),j={key:`cell-${_}-${Y}`,x:String(Q),y:String(q),width:String(D),height:String(M),fill:H,rx:String(a),ry:String(a)};if(c){let G=_,V=Y,Z=K;j.onClick=()=>c(G,V,Z),j.role="button",j.tabIndex=0}if(p){let G=_,V=Y,Z=K;j.onMouseEnter=()=>p(G,V,Z)}W.push(o("rect",j))}}return W},[x,g,t,I,m,b,S,s,a,A,c,p]),B=C(),E=T(),N=L(),z=R(),k=$(),w=f?`${f} \u2014 ${x}x${g} discrete grid`:`${x}x${g} discrete grid`;return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":w},B,...E,...N,...z,...k)}
|