@asymmetric-effort/specifyjs 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/chunks/{chunk-H7ZJ2I3D.js → chunk-6IZ45RD4.js} +1 -1
- package/dist/esm/chunks/{chunk-4TF5WXQG.js → chunk-LCSK4XUC.js} +7 -1
- package/dist/esm/chunks/{chunk-45EBJMQH.js → chunk-MWYZOVHI.js} +1 -1
- package/dist/esm/chunks/{metrics-ELQJ4BZ7.js → metrics-J42I3W3C.js} +2 -2
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/components-barrel.js +122 -6
- package/dist/esm/index.js +2 -2
- package/dist/esm/server/index.js +2 -1
- package/dist/esm/telemetry/index.js +3 -3
- package/dist/specifyjs-client.cjs.js +1 -1
- package/dist/specifyjs-client.esm.js +1 -1
- package/dist/specifyjs-components.cjs.js +4 -4
- package/dist/specifyjs-components.esm.js +122 -6
- package/dist/specifyjs-server.cjs.js +1 -1
- package/dist/specifyjs-server.esm.js +2 -1
- package/dist/specifyjs-telemetry.cjs.js +1 -1
- package/dist/specifyjs-telemetry.esm.js +3 -3
- package/dist/specifyjs.cjs.js +1 -1
- package/dist/specifyjs.esm.js +2 -2
- package/package.json +2 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/* (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE */
|
|
2
|
-
"use strict";var Ht=Object.defineProperty;var ia=Object.getOwnPropertyDescriptor;var sa=Object.getOwnPropertyNames;var aa=Object.prototype.hasOwnProperty;var la=(e,t,n)=>t in e?Ht(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ca=(e,t)=>{for(var n in t)Ht(e,n,{get:t[n],enumerable:!0})},da=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of sa(t))!aa.call(e,i)&&i!==n&&Ht(e,i,{get:()=>t[i],enumerable:!(r=ia(t,i))||r.enumerable});return e};var ua=e=>da(Ht({},"__esModule",{value:!0}),e);var et=(e,t,n)=>la(e,typeof t!="symbol"?t+"":t,n);var sp={};ca(sp,{Accordion:()=>zr,Alert:()=>Xo,AnalogClock:()=>Ao,AppContextProvider:()=>it,Avatar:()=>Fo,Badge:()=>No,BarGraph:()=>ri,BigNumber:()=>ys,BlochSphere:()=>Ss,Board:()=>Nt,BoxPlot:()=>vs,Breadcrumb:()=>Ar,BubbleChart:()=>ks,BuildableList:()=>ps,Button:()=>gs,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:()=>Es,Card:()=>xr,CardComponent:()=>bn,CardLinkOverlay:()=>yn,Carousel:()=>Pr,CartesianGraph2D:()=>ui,Checkbox:()=>er,ChordDiagram:()=>Is,CodeEditor:()=>un,ColorPicker:()=>nr,ColorWheel:()=>or,ComplexGraph2D:()=>gi,ContainerComponent:()=>xn,ContextMenu:()=>Kt,DEFAULT_BOARD_STATE:()=>tt,DataGrid:()=>Ho,DatePicker:()=>sr,DecompositionTree:()=>Rs,DesktopBackground:()=>nn,DigitalClock:()=>Yo,DiscreteCartesian2D:()=>ra,Dock:()=>tn,DragDropProvider:()=>zt,DraggableWindow:()=>kt,Drawer:()=>qr,Dropdown:()=>Br,EmptyState:()=>Ko,FileExplorer:()=>an,FileUpload:()=>ar,FlexContainer:()=>yr,FlexItem:()=>Sr,Footer:()=>Ri,ForceGraph:()=>$s,FormFieldWrapper:()=>Pe,FunnelChart:()=>As,GanttChart:()=>Fs,Gauge:()=>_s,GoogleAnalytics:()=>Ii,Grid:()=>vr,GridItem:()=>wr,HeatMap:()=>Os,Histogram:()=>Hs,HypercubeGraph:()=>Ci,IDE:()=>fn,Image:()=>Tr,LineGraph:()=>yi,ListView:()=>Vo,LollipopChart:()=>Ys,Matrix:()=>Vs,MenuBar:()=>sn,Menubar:()=>Nr,MessageBusProvider:()=>Dt,Minimap:()=>pn,Modal:()=>Zr,MultilineField:()=>lr,NavWrapper:()=>We,NumberSpinner:()=>cr,PRIORITY_COLORS:()=>mo,Pagination:()=>Wr,Panel:()=>Cr,Partition:()=>Us,PieGraph:()=>Si,PivotTable:()=>Gs,PolarGraph2D:()=>wi,Popover:()=>Qr,ProgressBar:()=>qo,RadarChart:()=>Xs,RadioGroup:()=>dr,SankeyDiagram:()=>Ks,ScrollContainer:()=>Er,Select:()=>ur,Sidebar:()=>Hr,Skeleton:()=>Zo,Slider:()=>pr,Spinner:()=>Qo,Splitter:()=>Ir,Stepper:()=>Yr,Sunburst:()=>qs,SystemTray:()=>en,TabBar:()=>ln,Tabs:()=>Rr,Tag:()=>Uo,TextEditor:()=>fr,TextField:()=>mr,ThreeDLayers:()=>xs,TimePicker:()=>gr,TitleBar:()=>rn,ToastContainer:()=>On,Toggle:()=>hr,Toolbar:()=>Ur,Tooltip:()=>ti,TradingDashboard:()=>hn,TreeMap:()=>Js,TreeNav:()=>Xr,TreeNode:()=>xt,USStateMap:()=>Ws,US_STATE_PATHS:()=>Wt,UnityApp:()=>cs,UnityDesktop:()=>ls,VectorField:()=>ta,VideoPlayer:()=>$r,VirtualScroll:()=>jo,VizWrapper:()=>Ei,WaterfallChart:()=>na,WindowManagerProvider:()=>Qt,WordCloud:()=>oa,WordProcessor:()=>on,applyGate:()=>xo,blochToCartesian:()=>Rt,boardReducer:()=>vn,buildInputStyle:()=>Ve,buildNavItemStyle:()=>bt,buildRotationMatrix:()=>Xn,cartesianToBloch:()=>Mn,computeBoxStats:()=>So,computeMandelbrotGrid:()=>mi,computeSlices:()=>Un,createToaster:()=>Wn,describeArc:()=>Vn,generateEdges:()=>Gn,generateHypercube:()=>Pt,generatePalette:()=>Jt,generateUUID:()=>qe,generateVertices:()=>jn,getItemId:()=>Xe,getItemName:()=>fo,historyReducer:()=>wn,isCard:()=>Be,isContainer:()=>$e,numRotationAngles:()=>Tt,projectTo2D:()=>qn,tokenizeLine:()=>dn,transformVec:()=>Kn,useAppId:()=>wt,useBarGraphScales:()=>Hn,useBoardReducer:()=>_t,useChannel:()=>$t,useDragDrop:()=>pt,useDraggable:()=>eo,useDropZone:()=>At,useHover:()=>Ne,useHypercube:()=>Mi,useLineGraphScales:()=>Yn,useMessageBus:()=>st,useToast:()=>ei,useWindowManager:()=>vt,validateNameForNesting:()=>us,validateNameInBoard:()=>ds,validateNameInScope:()=>bo});module.exports=ua(sp);var Yt=Symbol.for("spec.element"),pa=Symbol.for("spec.fragment"),lp=Symbol.for("spec.portal"),Io=Symbol.for("spec.provider"),Ro=Symbol.for("spec.consumer"),fa=Symbol.for("spec.forward_ref"),ma=Symbol.for("spec.memo"),ga=Symbol.for("spec.lazy"),ha=Symbol.for("spec.suspense"),ba=Symbol.for("spec.strict_mode"),xa=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 je(e){let t={$$typeof:Symbol.for("spec.context"),Provider:null,Consumer:null,_currentValue:e,_defaultValue:e},n={$$typeof:Io,_context:t},r={$$typeof:Ro,_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!To(this.props,t)||!To(this.state,n)}};Vt.prototype.isPureSpecComponent=!0;function To(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 Do=null;function ot(){if(Do===null)throw new Error("Invalid hook call. Hooks can only be called inside the body of a function component.");return Do}function j(e){return ot().useState(e)}function re(e,t){return ot().useEffect(e,t)}function Ye(e){return ot().useContext(e)}function zn(e,t,n){return ot().useReducer(e,t,n)}function S(e,t){return ot().useCallback(e,t)}function q(e,t){return ot().useMemo(e,t)}function te(e){return ot().useRef(e)}function Ee(){return ot().useId()}var ht=je({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 Sa={pathname:$o(),hash:typeof window<"u"?window.location.hash:""},va=new Set;function wa(){Sa={pathname:$o(),hash:typeof window<"u"?window.location.hash:""};for(let e of va)e()}typeof window<"u"&&window.addEventListener("hashchange",wa);var Uf=je({flags:{},isEnabled:()=>!1,setFlag:()=>{},loading:!1});function zo(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 za(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 Ao(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(zo(a));re(()=>{let I=setInterval(()=>{u(zo(a))},1e3);return()=>clearInterval(I)},[a]);let h=d.getHours(),p=d.getMinutes(),c=d.getSeconds(),m=h%12*30+p*.5,f=p*6+c*.1,b=c*6,y=n/2,g=n/2,x=n/2-10,v=x-4,R=x-22,D=[];D.push(o("circle",{cx:String(y),cy:String(g),r:String(x),fill:Ze.face,stroke:Ze.border,"stroke-width":"3"}));for(let I=0;I<12;I++){let L=(I*30-90)*Math.PI/180,E=v-6;D.push(o("line",{x1:String(y+E*Math.cos(L)),y1:String(g+E*Math.sin(L)),x2:String(y+v*Math.cos(L)),y2:String(g+v*Math.sin(L)),stroke:Ze.border,"stroke-width":"2"}));let B=String(I===0?12:I);if(D.push(o("text",{x:String(y+R*Math.cos(L)),y:String(g+R*Math.sin(L)),"text-anchor":"middle","dominant-baseline":"central",fill:Ze.numbers,"font-size":String(n*.08),"font-family":"sans-serif","font-weight":"600"},B)),t==="24h"){let z=x-38,k=String(I===0?0:I+12);D.push(o("text",{x:String(y+z*Math.cos(L)),y:String(g+z*Math.sin(L)),"text-anchor":"middle","dominant-baseline":"central",fill:Ze.numbers,"font-size":String(n*.055),"font-family":"sans-serif",opacity:"0.6"},k))}}let M=(I,P,L,E)=>{let B=(I-90)*Math.PI/180;return o("line",{x1:String(y),y1:String(g),x2:String(y+P*Math.cos(B)),y2:String(g+P*Math.sin(B)),stroke:E,"stroke-width":L,"stroke-linecap":"round"})};D.push(M(m,x*.5,"4",Ze.hand)),D.push(M(f,x*.75,"3",Ze.hand)),s&&D.push(M(b,x*.85,"1.5",Ze.second)),D.push(o("circle",{cx:String(y),cy:String(g),r:"4",fill:Ze.hand}));let A=[o("svg",{width:String(n),height:String(n),viewBox:`0 0 ${n} ${n}`,xmlns:"http://www.w3.org/2000/svg"},...D)];return r&&A.push(o("div",{style:{textAlign:"center",marginTop:"8px",fontFamily:"sans-serif",fontSize:"14px",color:Ze.numbers}},za(d,i))),o("div",{className:l,style:{display:"inline-flex",flexDirection:"column",alignItems:"center"}},...A)}var Ln={xs:24,sm:32,md:40,lg:56,xl:80};function Aa(e){return e==null?Ln.md:typeof e=="number"?e:Ln[e]??Ln.md}function La(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 Lo=["#3b82f6","#ef4444","#22c55e","#a855f7","#f97316","#ec4899","#14b8a6","#6366f1","#eab308","#06b6d4"];function Ba(e){if(!e)return"#9ca3af";let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return Lo[Math.abs(t)%Lo.length]}var Bo={online:"#22c55e",offline:"#9ca3af",busy:"#ef4444",away:"#eab308"};function Fa(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),p=Aa(i),c=s==="circle"?"50%":`${Math.round(p*.15)}px`,m=a??Ba(r),f=`${Math.round(p*.4)}px`,b={position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:`${p}px`,height:`${p}px`,borderRadius:c,overflow:"hidden",flexShrink:"0"},y;if(t&&!u)y=o("img",{src:t,alt:n??r??"avatar",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"},onError:()=>h(!0)});else{let R=La(r);y=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"},R)}let g=o("div",{style:{...b,backgroundColor:t&&!u?"transparent":m},role:"img","aria-label":n??r??"avatar"},y);if(!l)return g;let x=Math.max(8,Math.round(p*.25)),v={position:"absolute",width:`${x}px`,height:`${x}px`,borderRadius:"50%",backgroundColor:Bo[l]??Bo.offline,border:"2px solid #fff",boxSizing:"border-box",...Fa(d,x)};return o("div",{style:{position:"relative",display:"inline-flex",width:`${p}px`,height:`${p}px`,flexShrink:"0"}},g,o("span",{style:v,"aria-label":l}))}var Na={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"}},_a={sm:{width:"6px",height:"6px"},md:{width:"8px",height:"8px"},lg:{width:"10px",height:"10px"}};function No(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?{..._a[s],borderRadius:"50%",...a==="solid"?{backgroundColor:i}:{backgroundColor:"transparent",border:`2px solid ${i}`}}:{...Na[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}`}},p=u?o("span",{style:h,"aria-label":r?"notification":`count ${d}`},d):null;if(l==null)return p??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 Wa={width:"100%",borderCollapse:"collapse",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",color:"#1f2937"},_o={padding:"10px 12px",textAlign:"left",fontWeight:"600",backgroundColor:"#f9fafb",borderBottom:"2px solid #e5e7eb",userSelect:"none",whiteSpace:"nowrap"},Bn={padding:"10px 12px",borderBottom:"1px solid #e5e7eb"},Oa="6px 8px",Ha={marginLeft:"4px",fontSize:"12px",color:"#6b7280"},Ya={width:"100%",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",boxSizing:"border-box"},Va={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"},Ua={...dt,backgroundColor:"#3b82f6",color:"#fff",borderColor:"#3b82f6"},Wo={...dt,opacity:"0.5",cursor:"default"},Oo={cursor:"pointer",width:"16px",height:"16px"};function ja(e,t,n){return e!==t?"\u2195":n==="asc"?"\u2191":"\u2193"}function Ho(e){let{columns:t,data:n,pageSize:r,currentPage:i,onPageChange:s,sortBy:a,sortDir:l,onSort:d,selectable:u=!1,selectedRows:h,onSelectionChange:p,striped:c=!1,bordered:m=!1,compact:f=!1,stickyHeader:b=!1}=e,[y,g]=j(0),[x,v]=j(void 0),[R,D]=j("asc"),[M,$]=j([]),[A,I]=j({}),P=i??y,L=a??x,E=l??R,B=h??M,z=q(()=>{let J=Object.entries(A).filter(([,se])=>se.length>0);return J.length===0?n:n.filter(se=>J.every(([ce,me])=>String(se[ce]??"").toLowerCase().includes(me.toLowerCase())))},[n,A]),k=q(()=>{if(!L)return z;let J=[...z];return J.sort((se,ce)=>{let me=se[L],ge=ce[L];if(me==null&&ge==null)return 0;if(me==null)return 1;if(ge==null)return-1;if(typeof me=="number"&&typeof ge=="number")return E==="asc"?me-ge:ge-me;let ye=String(me),le=String(ge),ne=ye.localeCompare(le);return E==="asc"?ne:-ne}),J},[z,L,E]),w=k.length,T=r?Math.max(1,Math.ceil(w/r)):1,C=r?k.slice(P*r,(P+1)*r):k,N=S(J=>{s?s(J):g(J)},[s]),F=S(J=>{let se=L===J&&E==="asc"?"desc":"asc";d?d(J,se):(v(J),D(se))},[L,E,d]),W=S(J=>{let se=B.includes(J)?B.filter(ce=>ce!==J):[...B,J];p?p(se):$(se)},[B,p]),H=S(()=>{let J=C.map((me,ge)=>r?P*r+ge:ge),ce=J.every(me=>B.includes(me))?B.filter(me=>!J.includes(me)):[...new Set([...B,...J])];p?p(ce):$(ce)},[C,B,r,P,p]),_=S((J,se)=>{I(ce=>({...ce,[J]:se})),N(0)},[N]),V=t.some(J=>J.filterable),K=f?Oa:Bn.padding,Q=[];if(u){let J=C.map((ce,me)=>r?P*r+me:me),se=J.length>0&&J.every(ce=>B.includes(ce));Q.push(o("th",{key:"__select_all",style:{..._o,padding:K,width:"40px",textAlign:"center",...b?{position:"sticky",top:"0",zIndex:"2"}:{}}},o("input",{type:"checkbox",checked:se,onChange:H,style:Oo,"aria-label":"Select all rows"})))}for(let J of t){let se={..._o,padding:K,...J.width?{width:J.width}:{},...J.sortable?{cursor:"pointer"}:{},...m?{border:"1px solid #e5e7eb"}:{},...b?{position:"sticky",top:"0",zIndex:"2"}:{}},ce=[J.header];J.sortable&&ce.push(o("span",{style:Ha},ja(J.key,L,E))),Q.push(o("th",{key:J.key,style:se,onClick:J.sortable?()=>F(J.key):void 0,onKeyDown:J.sortable?me=>{let ge=me.key;(ge==="Enter"||ge===" ")&&(me.preventDefault(),F(J.key))}:void 0,tabIndex:J.sortable?0:void 0,role:J.sortable?"columnheader":void 0,"aria-sort":L===J.key?E==="asc"?"ascending":"descending":void 0},...ce))}let G=null;if(V){let J=[];u&&J.push(o("th",{key:"__filter_spacer",style:{padding:K}}));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:Ya,value:A[se.key]??"",onInput:ce=>_(se.key,ce.target.value),"aria-label":`Filter by ${se.header}`}):null));G=o("tr",{key:"__filter_row"},...J)}let O=[];for(let J=0;J<C.length;J++){let se=C[J],ce=r?P*r+J:J,me=B.includes(ce),ge={};c&&J%2===1&&(ge.backgroundColor="#f9fafb"),me&&(ge.backgroundColor="#eff6ff");let ye=[];u&&ye.push(o("td",{key:"__select",style:{padding:K,textAlign:"center",...Bn,...m?{border:"1px solid #e5e7eb"}:{}}},o("input",{type:"checkbox",checked:me,onChange:()=>W(ce),style:Oo,"aria-label":`Select row ${ce+1}`})));for(let le of t){let ne=se[le.key],pe=le.render?le.render(ne,se):String(ne??"");ye.push(o("td",{key:le.key,style:{...Bn,padding:K,...m?{border:"1px solid #e5e7eb"}:{}}},pe))}O.push(o("tr",{key:String(ce),style:ge},...ye))}let Y=null;if(r){let J=w===0?0:P*r+1,se=Math.min((P+1)*r,w),ce=[];ce.push(o("button",{key:"prev",style:P===0?Wo:dt,onClick:P>0?()=>N(P-1):void 0,disabled:P===0,"aria-label":"Previous page"},"\u2190 Prev"));let me=7,ge=Math.max(0,P-Math.floor(me/2)),ye=Math.min(T,ge+me);ye-ge<me&&(ge=Math.max(0,ye-me)),ge>0&&(ce.push(o("button",{key:"p0",style:dt,onClick:()=>N(0)},"1")),ge>1&&ce.push(o("span",{key:"e1",style:{margin:"0 4px"}},"...")));for(let le=ge;le<ye;le++)ce.push(o("button",{key:`p${le}`,style:le===P?Ua:dt,onClick:le!==P?()=>N(le):void 0,"aria-current":le===P?"page":void 0},String(le+1)));ye<T&&(ye<T-1&&ce.push(o("span",{key:"e2",style:{margin:"0 4px"}},"...")),ce.push(o("button",{key:`p${T-1}`,style:dt,onClick:()=>N(T-1)},String(T)))),ce.push(o("button",{key:"next",style:P>=T-1?Wo:dt,onClick:P<T-1?()=>N(P+1):void 0,disabled:P>=T-1,"aria-label":"Next page"},"Next \u2192")),Y=o("div",{style:Va},o("span",null,`Showing ${J}\u2013${se} of ${w}`),o("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},...ce))}let X={width:"100%",...b?{overflow:"auto",maxHeight:"600px"}:{}},U={...Wa,...m?{border:"1px solid #e5e7eb"}:{}},Z=o("thead",null,o("tr",null,...Q),G),ee=o("tbody",null,...O),ae=o("table",{style:U,role:"grid","aria-rowcount":String(w)},Z,ee);return o("div",{style:X},ae,Y)}function ut(e){return e<10?`0${e}`:String(e)}function Ga(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 Xa(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 Ka={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"},qa={fontSize:"2rem",fontWeight:"600",letterSpacing:"2px",lineHeight:"1"},Za={fontSize:"0.875rem",fontWeight:"400",marginLeft:"4px",verticalAlign:"super"},Ja={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 g=setInterval(()=>{d(new Date)},1e3);return()=>clearInterval(g)},[]);let{hours:u,minutes:h,seconds:p}=Ga(l,s),c,m=null;t==="12h"?(m=u>=12?"PM":"AM",c=u%12||12):c=u;let f=`${ut(c)}:${ut(h)}`;i&&(f+=`:${ut(p)}`);let b=[f];m!=null&&b.push(o("span",{style:Za},m));let y=[o("span",{style:qa},...b)];return n&&y.push(o("span",{style:Ja},Xa(l,r,s))),o("div",{style:Ka,...a?{class:a}:{}},...y)}var Qa={listStyle:"none",margin:"0",padding:"0",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px"},el={padding:"10px 14px",color:"var(--color-text, #1f2937)"},tl={borderBottom:"1px solid var(--color-border, #e5e7eb)"},nl={cursor:"pointer",transition:"background-color 0.15s ease"},ol={backgroundColor:"var(--color-bg-muted, #eff6ff)"},rl={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 Vo(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:rl},d),h?o("div",{style:{...Ut,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},h):null);let p=[];for(let c=0;c<t.length;c++){let m=t[c],f=r(m,c),b=a===c,y=c===t.length-1,g={...el,...s?nl:{},...b?ol:{},...i&&!y?tl:{}};p.push(o("li",{key:f,style:g,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(b):void 0},n(m,c)))}return o("div",null,u?o("div",{style:Ut},u):null,o("ul",{style:Qa,role:l?"listbox":"list"},...p),h?o("div",{style:{...Ut,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},h):null)}function il(e){return e??"#3b82f6"}function sl(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 al={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 ll(e,t,n,r,i){let s=al[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:sl(e,.12),color:e,border:"none"};default:return a}}var cl={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 Uo(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=il(n),p=ll(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:cl,onClick:m=>{m.stopPropagation(),!u&&a&&a()},"aria-label":`Remove ${t}`,disabled:u},"\xD7")),o("span",{style:p,role:d?"button":void 0,tabIndex:d&&!u?"0":void 0,onClick:!u&&d?d:void 0,onKeyDown:d&&!u?m=>{let f=m.key;(f==="Enter"||f===" ")&&(m.preventDefault(),d())}:void 0,"aria-disabled":u?"true":void 0},...c)}var dl={overflow:"auto",position:"relative",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'};function jo(e){let{items:t,renderItem:n,itemHeight:r,overscan:i=5,height:s}=e,[a,l]=j(0),d=te(null),u=t.length*r,h=parseInt(s,10)||400,p=Math.ceil(h/r),c=Math.max(0,Math.floor(a/r)-i),m=Math.min(t.length,Math.floor(a/r)+p+i),f=S(y=>{let g=y.target;l(g.scrollTop)},[]),b=[];for(let y=c;y<m;y++)b.push(o("div",{key:String(y),style:{position:"absolute",top:`${y*r}px`,left:"0",right:"0",height:`${r}px`,overflow:"hidden"}},n(t[y],y)));return o("div",{ref:d,style:{...dl,height:s},onScroll:f},o("div",{style:{height:`${u}px`,position:"relative",width:"100%"}},...b))}var Go={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 Xo(e){let[t,n]=j(!0),r=e.type??"info",i=e.variant??"subtle",s=Go[r]??Go.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 Ko(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 qo(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=Ee().replace(/[^a-zA-Z0-9_-]/g,"");if(l==="circular"){let m=typeof e.size=="number"?e.size:48,f=Math.max(2,Math.round(m/10)),b=(m-f)/2,y=2*Math.PI*b,g=e.indeterminate?y*.75:y-r/100*y,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(m),height:String(m),viewBox:`0 0 ${m} ${m}`,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(m/2),cy:String(m/2),r:String(b),fill:"none",stroke:s,"stroke-width":String(f)}),o("circle",{cx:String(m/2),cy:String(m/2),r:String(b),fill:"none",stroke:i,"stroke-width":String(f),"stroke-dasharray":String(y),"stroke-dashoffset":String(g),"stroke-linecap":"round",transform:`rotate(-90 ${m/2} ${m/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%}}`:"",p={width:"100%",height:a,backgroundColor:s,borderRadius:a,overflow:"hidden",position:"relative"},c=q(()=>{let m={height:"100%",borderRadius:a,transition:"width 0.3s ease"};return e.indeterminate?(m.position="absolute",m.animation=`liq-indeterminate-${d} 1.5s ease-in-out infinite`,m.backgroundColor=i):(m.width=`${r}%`,m.backgroundColor=i),e.animated&&!e.indeterminate&&(m.backgroundImage=`linear-gradient(90deg, ${i} 0%, ${ul(i)} 50%, ${i} 100%)`,m.backgroundSize="200% 100%",m.animation=`liq-shimmer-${d} 1.5s ease-in-out infinite`),m},[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:p},o("div",{style:c})))}function ul(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 Zo(e){let t=e.variant??"text",n=e.animated!==!1,r=Ee().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:Fn({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:Fn({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:Fn({width:s??"100%",height:a??"100px",borderRadius:e.borderRadius??"4px",animated:n,animId:r})}))}function Fn(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 pl={sm:16,md:24,lg:40},Jo={slow:"1.2s",normal:"0.75s",fast:"0.45s"};function Qo(e){let t=typeof e.size=="number"?e.size:pl[e.size??"md"]??24,n=e.color??"#3b82f6",r=e.thickness??Math.max(2,Math.round(t/8)),i=Jo[e.speed??"normal"]??Jo.normal,s=e.label??"Loading",l=Ee().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 Pe(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 Ve(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 fl={sm:{box:14,icon:10,fontSize:"12px"},md:{box:18,icon:12,fontSize:"14px"},lg:{box:22,icon:16,fontSize:"16px"}};function er(e){let t=Ee().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=te(null);re(()=>{h.current&&(h.current.indeterminate=a)},[a]);let p=S(()=>{l||i(!r)},[l,r,i]),c=S(A=>{l||(A.key===" "||A.key==="Enter")&&(A.preventDefault(),i(!r))},[l,r,i]),m=fl[u],f=`${m.box}px`,b=d?"#ef4444":r||a?"#3b82f6":"#d1d5db",y=r||a?"#3b82f6":"#ffffff",g={width:f,height:f,minWidth:f,borderRadius:"4px",border:`2px solid ${b}`,backgroundColor:y,display:"flex",alignItems:"center",justifyContent:"center",cursor:l?"not-allowed":"pointer",transition:"all 0.15s",boxSizing:"border-box"},x={color:"#ffffff",fontSize:`${m.icon}px`,lineHeight:"1",fontWeight:"700"},v=a?o("span",{style:x},"\u2014"):r?o("span",{style:x},"\u2713"):null,R={display:"inline-flex",alignItems:"center",gap:"8px",cursor:l?"not-allowed":"pointer",opacity:l?"0.6":"1",userSelect:"none"},D=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:g},v),$=s?o("span",{style:{fontSize:m.fontSize,color:"#374151"}},s):null;return o(Pe,{error:d,htmlFor:n},o("div",{style:R,onClick:p,onKeyDown:c,tabIndex:l?-1:0,role:"checkbox","aria-checked":a?"mixed":r?"true":"false","aria-disabled":l?"true":void 0,"aria-label":s},D,M,$))}var ml=["#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 tr(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 nr(e){let t=Ee().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,presets:s=ml,showInput:a=!0,showAlpha:l=!1,disabled:d=!1,label:u}=e,[h,p]=j(!1),[c,m]=j(r),f=te(null);re(()=>{m(r)},[r]),re(()=>{let I=P=>{f.current&&!f.current.contains(P.target)&&p(!1)};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[]);let b=S(I=>{d||i(jt(I))},[d,i]),y=S(I=>{let P=I.target.value;m(P);let L=P.startsWith("#")?P:`#${P}`;tr(L)&&i(jt(L))},[i]),g=S(()=>{tr(c.startsWith("#")?c:`#${c}`)||m(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"},R={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"},D={display:"grid",gridTemplateColumns:"repeat(10, 1fr)",gap:"4px",marginBottom:a?"8px":"0"},M=s.map(I=>{let P=jt(I)===jt(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:()=>b(I),onKeyDown:E=>{let B=E.key;(B==="Enter"||B===" ")&&(E.preventDefault(),b(I))},role:"button",tabIndex:d?-1:0,title:I,"aria-label":`Select color ${I}`})}),$=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:y,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,A=h?o("div",{style:R},o("div",{style:D},...M),$):null;return o(Pe,{label:u,disabled:d,htmlFor:n},o("div",{ref:f,style:{position:"relative"}},o("div",{style:v,onClick:d?void 0:()=>p(!h),onKeyDown:d?void 0:I=>{let P=I.key;(P==="Enter"||P===" ")&&(I.preventDefault(),p(!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),A))}function or(e){let t=Ee().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),p=te(null),c=S(((...y)=>{let x=y[0].target.value;h(x),i?.(x)}),[i]),m={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(Pe,{label:d,htmlFor:n},o("div",{style:m},o("div",{style:f},o("input",{id:n,ref:p,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 rr=["January","February","March","April","May","June","July","August","September","October","November","December"],gl=["Su","Mo","Tu","We","Th","Fr","Sa"];function Nn(e){if(!e)return null;if(e instanceof Date)return e;let t=new Date(e);return isNaN(t.getTime())?null:t}function hl(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 ir(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function bl(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function sr(e){let t=Ee().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:p}=e,c=q(()=>Nn(r),[r]),m=q(()=>Nn(a),[a]),f=q(()=>Nn(l),[l]),[b,y]=j(!1),[g,x]=j(()=>c?c.getFullYear():new Date().getFullYear()),[v,R]=j(()=>c?c.getMonth():new Date().getMonth()),D=te(null),M=q(()=>new Date,[]);re(()=>{let F=W=>{D.current&&!D.current.contains(W.target)&&y(!1)};return document.addEventListener("mousedown",F),()=>document.removeEventListener("mousedown",F)},[]);let $=S(()=>{R(F=>F===0?(x(W=>W-1),11):F-1)},[]),A=S(()=>{R(F=>F===11?(x(W=>W+1),0):F+1)},[]),I=S(F=>{let W=new Date(g,v,F);m&&W<m||f&&W>f||(i(bl(W)),y(!1))},[g,v,i,m,f]),P=c?hl(c,s):"",L=q(()=>{let F=new Date(g,v,1).getDay(),W=new Date(g,v+1,0).getDate(),H=[],_=[];for(let V=0;V<F;V++)_.push(null);for(let V=1;V<=W;V++)_.push(V),_.length===7&&(H.push(_),_=[]);for(;_.length>0&&_.length<7;)_.push(null);return _.length&&H.push(_),H},[g,v]),E={...Ve({},{focused:b,error:!!p}),cursor:d?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",minHeight:"38px",userSelect:"none"},B={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"},T=gl.map(F=>o("div",{key:F,style:{padding:"4px"}},F)),C=L.map((F,W)=>{let H=F.map((_,V)=>{if(_===null)return o("div",{key:`empty-${W}-${V}`,style:{padding:"4px"}});let K=new Date(g,v,_),Q=ir(K,M),G=c?ir(K,c):!1,O=m&&K<m||f&&K>f,Y={padding:"4px",textAlign:"center",cursor:O?"not-allowed":"pointer",borderRadius:"4px",fontSize:"13px",fontWeight:Q?"700":"400",backgroundColor:G?"#3b82f6":"transparent",color:G?"#ffffff":O?"#d1d5db":Q?"#3b82f6":"#1f2937",border:Q&&!G?"1px solid #3b82f6":"1px solid transparent",lineHeight:"1.8"};return o("div",{key:`day-${_}`,style:Y,onClick:O?void 0:()=>I(_),onKeyDown:O?void 0:X=>{let U=X.key;(U==="Enter"||U===" ")&&(X.preventDefault(),I(_))},role:O?void 0:"button",tabIndex:O?void 0:0,"aria-label":`${rr[v]} ${_}, ${g}`,"aria-disabled":O?"true":void 0},String(_))});return o("div",{key:`row-${W}`,style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)"}},...H)}),N=b?o("div",{style:B},o("div",{style:z},o("button",{type:"button",style:k,onClick:$},"\u25C0"),o("span",{style:{fontWeight:"600",fontSize:"14px",color:"#1f2937"}},`${rr[v]} ${g}`),o("button",{type:"button",style:k,onClick:A},"\u25B6")),o("div",{style:w},...T),...C):null;return o(Pe,{label:h,error:p,disabled:d,htmlFor:n},o("div",{ref:D,style:{position:"relative"}},o("div",{id:n,style:E,onClick:d?void 0:()=>y(!b),onKeyDown:d?void 0:F=>{let W=F.key;(W==="Enter"||W===" ")&&(F.preventDefault(),y(!b))},tabIndex:d?-1:0,role:"button","aria-label":"Pick a date","aria-expanded":b?"true":"false"},o("span",{style:{color:P?"#1f2937":"#9ca3af"}},P||u),o("span",{style:{color:"#6b7280",fontSize:"14px"}},"\u{1F4C5}")),N))}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 ar(e){let t=Ee().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,p]=j([]),[c,m]=j(!1),[f,b]=j(""),y=te(null),g=S(k=>{b("");let w=[];for(let C of k){if(a&&C.size>a){b(`File "${C.name}" exceeds maximum size of ${_n(a)}`);continue}w.push(C)}let T=s?[...h,...w]:w.slice(0,1);p(T),r(T)},[h,s,a,r]),x=S(k=>{if(k.preventDefault(),k.stopPropagation(),m(!1),l)return;let w=k.dataTransfer;if(!w)return;let T=Array.from(w.files);g(T)},[l,g]),v=S(k=>{k.preventDefault(),k.stopPropagation(),l||m(!0)},[l]),R=S(k=>{k.preventDefault(),k.stopPropagation(),m(!1)},[]),D=S(k=>{let w=k.target;w.files&&(g(Array.from(w.files)),w.value="")},[g]),M=S(k=>{let w=h.filter((T,C)=>C!==k);p(w),r(w)},[h,r]),$=S(()=>{l||y.current&&y.current.click()},[l]),A={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"},L={fontSize:"12px",color:"#9ca3af"},E=o("input",{id:n,ref:y,type:"file",accept:i,multiple:s,onChange:D,disabled:l,style:{display:"none"},tabIndex:-1}),B=o("div",{style:A,onClick:$,onKeyDown:k=>{let w=k.key;(w==="Enter"||w===" ")&&(k.preventDefault(),$())},onDrop:x,onDragOver:v,onDragLeave:R,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:L},i):null,a?o("div",{style:L},`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 T={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:T},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:C,onClick:N=>{N.stopPropagation(),M(w)},"aria-label":`Remove ${k.name}`},"\u2715"))})):null;return o(Pe,{label:d,helpText:u,error:f||void 0,disabled:l,htmlFor:n},o("div",null,E,B,z))}function lr(e){let[t,n]=j(!1),[r,i]=j((e.value??e.defaultValue??"").length),s=Ee().replace(/[^a-zA-Z0-9_-]/g,""),a=e.id??`ml-${s}`,d={...Ve(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 m=c.target,f=m.value;i(f.length),e.onChange&&e.onChange(f),e.autoResize&&(m.style.height="auto",m.style.height=`${m.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}),p=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(Pe,{label:e.label,htmlFor:a,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},h,p)}function cr(e){let t=Ee().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:p,error:c}=e,[m,f]=j(!1),b=S(w=>{let T=w;return s!==void 0&&T<s&&(T=s),a!==void 0&&T>a&&(T=a),T},[s,a]),y=S(()=>{d||i(b(r+l))},[d,r,l,b,i]),g=S(()=>{d||i(b(r-l))},[d,r,l,b,i]),x=S(w=>{let T=w.target.value;if(T===""||T==="-")return;let C=parseFloat(T);isNaN(C)||i(b(C))},[b,i]),v=S(w=>{d||(w.key==="ArrowUp"?(w.preventDefault(),y()):w.key==="ArrowDown"&&(w.preventDefault(),g()))},[d,y,g]),R=s===void 0||r>s,D=a===void 0||r<a,M={display:"inline-flex",alignItems:"stretch",borderRadius:"6px",overflow:"hidden",border:`1px solid ${c?"#ef4444":m?"#3b82f6":"var(--color-border, #d1d5db)"}`,transition:"border-color 0.15s",opacity:d?"0.6":"1",...m&&!c?{boxShadow:"0 0 0 3px #3b82f622"}:{}},$=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"}),A={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:$(R),onClick:g,disabled:d,"aria-label":"Decrement",tabIndex:-1},"\u2212"),L=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:A,"aria-label":p||"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}),B=h?o("span",{style:I},h):null,z=o("button",{type:"button",style:$(D),onClick:y,disabled:d,"aria-label":"Increment",tabIndex:-1},"+"),k=[P];return L&&k.push(L),k.push(E),B&&k.push(B),k.push(z),o(Pe,{label:p,error:c,disabled:d,htmlFor:n},o("div",{style:M},...k))}function dr(e){let t=Ee().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,p=S(b=>{d||s(b)},[d,s]),c=S(b=>{if(d)return;let y=r.filter(v=>!v.disabled);if(y.length===0)return;let g=y.findIndex(v=>v.value===i),x=g;if(b.key==="ArrowDown"||b.key==="ArrowRight")b.preventDefault(),x=g<y.length-1?g+1:0;else if(b.key==="ArrowUp"||b.key==="ArrowLeft")b.preventDefault(),x=g>0?g-1:y.length-1;else return;s(y[x].value)},[d,r,i,s]),m={display:"flex",flexDirection:l==="horizontal"?"row":"column",gap:l==="horizontal"?"16px":"8px"},f=r.map((b,y)=>{let g=b.value===i,x=d||!!b.disabled,v=`${n}-opt-${y}`,R={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"},D={width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"#3b82f6",transition:"transform 0.15s",transform:g?"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:b.value,htmlFor:v,style:M,onClick:x?void 0:$=>{$.preventDefault(),p(b.value)}},o("input",{type:"radio",id:v,name:a,value:b.value,checked:g,disabled:x,style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},tabIndex:-1}),o("div",{style:R},o("div",{style:D})),o("span",{style:{fontSize:"14px",color:"#374151"}},b.label))});return o(Pe,{label:h,error:u,htmlFor:`${n}-opt-0`},o("div",{id:n,style:m,role:"radiogroup","aria-label":h,onKeyDown:c,tabIndex:d?-1:0},...f))}function ur(e){let t=Ee().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:p,label:c,helpText:m,creatable:f=!1,onCreate:b,createLabel:y="+ Create new..."}=e,[g,x]=j(!1),[v,R]=j(""),[D,M]=j(-1),[$,A]=j(!1),[I,P]=j(""),L=te(null),E=q(()=>Array.isArray(i)?i:i?[i]:[],[i]),B=q(()=>{if(!l||!v)return r;let G=v.toLowerCase();return r.filter(O=>O.label.toLowerCase().includes(G))},[r,v,l]),z=q(()=>{let G={},O=[];for(let Y of B)Y.group?(G[Y.group]||(G[Y.group]=[]),G[Y.group].push(Y)):O.push(Y);return{groups:G,ungrouped:O}},[B]),k=q(()=>E.length===0?"":E.map(O=>r.find(Y=>Y.value===O)).filter(Boolean).map(O=>O.label).join(", "),[E,r]);re(()=>{let G=O=>{let Y=O.target;L.current&&!L.current.contains(Y)&&(x(!1),R(""),A(!1),P(""))};return document.addEventListener("mousedown",G),()=>document.removeEventListener("mousedown",G)},[]);let w=S(G=>{if(d){let O=E.includes(G)?E.filter(Y=>Y!==G):[...E,G];s(O)}else s(G),x(!1),R("")},[d,E,s]),T=S(G=>{G.stopPropagation(),s(d?[]:"")},[d,s]),C=S(G=>{if(h)return;let O=G.key;if(!g&&(O==="Enter"||O===" "||O==="ArrowDown")){G.preventDefault(),x(!0),M(0);return}if(g){if(O==="Escape"){x(!1),R("");return}if(O==="ArrowDown")G.preventDefault(),M(Y=>Math.min(Y+1,B.length-1));else if(O==="ArrowUp")G.preventDefault(),M(Y=>Math.max(Y-1,0));else if(O==="Enter"&&D>=0&&D<B.length){G.preventDefault();let Y=B[D];Y.disabled||w(Y.value)}}},[h,g,D,B,w]),N={...Ve({},{focused:g,error:!!p}),display:"flex",alignItems:"center",justifyContent:"space-between",cursor:h?"not-allowed":"pointer",minHeight:"38px",userSelect:"none"},F={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"},W=(G,O)=>{let Y=E.includes(G.value),X=O===D,U={padding:"8px 12px",cursor:G.disabled?"not-allowed":"pointer",backgroundColor:X?"#f3f4f6":Y?"#eff6ff":"transparent",color:G.disabled?"#9ca3af":"#1f2937",display:"flex",alignItems:"center",gap:"8px",fontSize:"14px"};return o("div",{key:G.value,style:U,onClick:G.disabled?void 0:()=>w(G.value),onMouseEnter:()=>M(O),role:"option","aria-selected":Y?"true":"false","aria-disabled":G.disabled?"true":void 0},d&&Y?o("span",{style:{color:"#3b82f6",fontWeight:"700"}},"\u2713"):null,G.label)},H=()=>{let G=[],O=0,{groups:Y,ungrouped:X}=z;for(let U of X)G.push(W(U,O++));for(let U of Object.keys(Y)){G.push(o("div",{key:`group-${U}`,style:{padding:"6px 12px",fontSize:"11px",fontWeight:"600",color:"#6b7280",textTransform:"uppercase",letterSpacing:"0.05em"}},U));for(let Z of Y[U])G.push(W(Z,O++))}return G.length===0&&!f&&G.push(o("div",{style:{padding:"8px 12px",color:"#9ca3af",fontSize:"14px"}},"No options")),f&&($?G.push(o("div",{key:"__create-input__",style:{padding:"4px 8px",borderTop:G.length>0?"1px solid #e5e7eb":"none"}},o("input",{type:"text",value:I,placeholder:"Type new value...",autoFocus:!0,onInput:U=>{P(U.target.value)},onKeyDown:U=>{let Z=U.key;if(Z==="Enter"){U.preventDefault();let ee=I.trim();ee&&(b&&b(ee),d||(s(ee),x(!1)),P(""),A(!1))}else Z==="Escape"&&(P(""),A(!1))},style:{width:"100%",boxSizing:"border-box",padding:"6px 8px",border:"1px solid #d1d5db",borderRadius:"4px",outline:"none",fontSize:"14px"}}))):G.push(o("div",{key:"__create-new__",style:{padding:"8px 12px",cursor:"pointer",color:"#3b82f6",fontSize:"14px",borderTop:G.length>0?"1px solid #e5e7eb":"none"},onClick:()=>{A(!0),P("")},role:"option","aria-label":"Create new option"},y))),G},_=o("span",{style:{marginLeft:"8px",fontSize:"10px",transition:"transform 0.15s",transform:g?"rotate(180deg)":"rotate(0deg)",color:"#6b7280"}},"\u25BC"),V=o("div",{style:N,id:n,onClick:h?void 0:()=>{x(!g),M(-1)},onKeyDown:C,tabIndex:h?-1:0,role:"combobox","aria-expanded":g?"true":"false","aria-haspopup":"listbox"},o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:k?"#1f2937":"#9ca3af"}},k||a),o("span",{style:{display:"flex",alignItems:"center",gap:"4px"}},u&&E.length>0?o("span",{onClick:T,onKeyDown:G=>{let O=G.key;(O==="Enter"||O===" ")&&(G.preventDefault(),G.stopPropagation(),T(G))},style:{cursor:"pointer",color:"#9ca3af",fontSize:"14px",lineHeight:"1"},role:"button",tabIndex:0,"aria-label":"Clear selection"},"\u2715"):null,_)),K=l&&g?o("input",{type:"text",value:v,onInput:G=>{R(G.target.value),M(0)},placeholder:"Search...",style:{width:"100%",boxSizing:"border-box",padding:"8px 12px",border:"none",borderBottom:"1px solid #e5e7eb",outline:"none",fontSize:"14px"}}):null,Q=g?o("div",{style:F,role:"listbox"},K,...H()):null;return o(Pe,{label:c,error:p,helpText:m,disabled:h,htmlFor:n},o("div",{ref:L,style:{position:"relative"}},V,Q))}function pr(e){let t=Ee().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:p,range:c=!1,label:m,error:f}=e,b=te(null),y=te(i);y.current=i;let[g,x]=j(null),v=q(()=>{if(c&&Array.isArray(r))return r;let W=typeof r=="number"?r:0;return[W,W]},[r,c]),R=te(v);R.current=v;let D=W=>{let H=Math.round((W-s)/l)*l+s;return Math.max(s,Math.min(a,H))},M=W=>(W-s)/(a-s)*100,$=S(W=>{if(!b.current)return s;let H=b.current.getBoundingClientRect(),_=Math.max(0,Math.min(1,(W.clientX-H.left)/H.width));return D(s+_*(a-s))},[s,a,l]),A=S(W=>H=>{h||(H.preventDefault(),x(W))},[h]),I=S(W=>{if(h)return;let H=$(W);if(c){let _=Math.abs(H-v[0]),V=Math.abs(H-v[1]);_<=V?i([D(H),v[1]]):i([v[0],D(H)])}else i(D(H))},[h,$,c,v,i,s,a,l]);re(()=>{if(!g)return;let W=_=>{let V=$(_),K=R.current,Q=y.current;g==="single"?Q(D(V)):g==="start"?Q([Math.min(D(V),K[1]),K[1]]):g==="end"&&Q([K[0],Math.max(K[0],D(V))])},H=()=>x(null);return document.addEventListener("mousemove",W),document.addEventListener("mouseup",H),()=>{document.removeEventListener("mousemove",W),document.removeEventListener("mouseup",H)}},[g,$,s,a,l]);let P=S(W=>{if(h)return;let H=0;if(W.key==="ArrowRight"||W.key==="ArrowUp")H=l;else if(W.key==="ArrowLeft"||W.key==="ArrowDown")H=-l;else return;W.preventDefault(),c||i(D((typeof r=="number"?r:0)+H))},[h,l,c,r,i,s,a]),L={position:"relative",width:"100%",height:"6px",backgroundColor:"#e5e7eb",borderRadius:"3px",cursor:h?"not-allowed":"pointer"},E=c?M(v[0]):0,B=M(c?v[1]:v[0]),z={position:"absolute",top:"0",left:`${E}%`,width:`${B-E}%`,height:"100%",backgroundColor:h?"#9ca3af":"#3b82f6",borderRadius:"3px"},k=W=>m?W==="start"?`${m} minimum`:W==="end"?`${m} maximum`:m:W==="start"?"Minimum value":W==="end"?"Maximum value":"Value",w=(W,H,_)=>{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"},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:H==="single"||H==="start"?n:void 0,style:V,onMouseDown:A(H),role:"slider","aria-valuenow":String(_),"aria-valuemin":String(s),"aria-valuemax":String(a),"aria-label":k(H),tabIndex:h?-1:0,onKeyDown:P},d?o("div",{style:K},String(_)):null)},T=[];if(u)for(let W=s;W<=a;W+=l)T.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(p)for(let W of p)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 N={paddingTop:d?"28px":"8px",paddingBottom:p||u?"28px":"8px",opacity:h?"0.6":"1"},F=[];return c?(F.push(w(M(v[0]),"start",v[0])),F.push(w(M(v[1]),"end",v[1]))):F.push(w(M(v[0]),"single",v[0])),o(Pe,{label:m,error:f,htmlFor:n},o("div",{style:N},o("div",{ref:b,style:L,role:"presentation",onClick:I},o("div",{style:z}),...F,...T,...C)))}var xl=["bold","italic","underline","strikethrough","heading1","heading2","bulletList","orderedList","blockquote","link","unlink","insertHR","removeFormat","undo","redo"],yl={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"}},Sl=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,vl=/\s+on\w+\s*=\s*(['"])[^'"]*\1/gi,wl=/\s+on\w+\s*=\s*[^\s>]+/gi;function kl(e){return e.replace(Sl,"").replace(vl,"").replace(wl,"")}function fr(e){let[t,n]=j(!1),r=te(null),i=Ee().replace(/[^a-zA-Z0-9_-]/g,""),s=e.id??i,a=e.toolbar??xl,l=e.toolbarStyle??{},d=e.editorStyle??{};re(()=>{r.current&&e.value!==void 0&&(r.current.innerHTML=kl(e.value))},[]);let u=S((f,b)=>{if(!(e.disabled||e.readOnly)){if(f==="createLink"){let y=prompt("Enter URL:");if(!y||/^(javascript|vbscript|data:text\/html)/i.test(y.trim()))return;document.execCommand(f,!1,y)}else b&&f==="formatBlock"?document.execCommand(f,!1,`<${b}>`):document.execCommand(f,!1,b);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]),p=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 b=yl[f];return b?o("button",{key:f,type:"button",title:b.label,onClick:()=>u(b.command,b.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"}},b.icon):null})),m=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:p,onInput:h});return o(Pe,{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,m))}function mr(e){let[t,n]=j(!1),r=Ee().replace(/[^a-zA-Z0-9_-]/g,""),i=e.id??`tf-${r}`,s=Ve(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(Pe,{label:e.label,htmlFor:i,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},d)}var Cl=["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 Ml(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 gr(e){let t=Ee().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:p,showTimezone:c=!1,timezones:m=Cl,onTimezoneChange:f}=e,[b,y]=j(!1),g=q(()=>Ml(r),[r]),x=s==="12h",v=g.hour>=12,R=x?g.hour%12||12:g.hour,D=S((Y,X,U)=>{let Z=Math.max(0,Math.min(23,Y)),ee=Math.max(0,Math.min(59,X)),ae=Math.max(0,Math.min(59,U??0));i(h?`${rt(Z)}:${rt(ee)}:${rt(ae)}`:`${rt(Z)}:${rt(ee)}`)},[i,h]),M=S(Y=>{let X=parseInt(Y.target.value,10)||0;x&&(X=X%12,v&&(X+=12)),D(X,g.minute,g.second)},[x,v,g.minute,g.second,D]),$=S(Y=>{let X=parseInt(Y.target.value,10)||0;D(g.hour,X,g.second)},[g.hour,g.second,D]),A=S(Y=>{let X=parseInt(Y.target.value,10)||0;D(g.hour,g.minute,X)},[g.hour,g.minute,D]),I=S(()=>{if(l)return;let Y=v?g.hour-12:g.hour+12;D(Y,g.minute,g.second)},[l,v,g.hour,g.minute,g.second,D]),P=S(Y=>{l||D(g.hour+Y,g.minute,g.second)},[l,g.hour,g.minute,g.second,D]),L=S(Y=>{l||D(g.hour,g.minute+Y*a,g.second)},[l,g.hour,g.minute,g.second,a,D]),E=S(Y=>{l||D(g.hour,g.minute,g.second+Y)},[l,g.hour,g.minute,g.second,D]),B=S(Y=>{let X=Y.target.value;f&&f(X)},[f]),z={display:"inline-flex",alignItems:"center",gap:"4px",...Ve({},{focused:b,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"},T={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"},N=o("div",{style:k},o("button",{type:"button",style:w,onClick:()=>P(1),disabled:l},"\u25B2"),o("input",{type:"text",value:rt(R),onChange:M,style:T,disabled:l,"aria-label":"Hour",onFocus:()=>y(!0),onBlur:()=>y(!1)}),o("button",{type:"button",style:w,onClick:()=>P(-1),disabled:l},"\u25BC")),F=o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"),W=o("div",{style:k},o("button",{type:"button",style:w,onClick:()=>L(1),disabled:l},"\u25B2"),o("input",{type:"text",value:rt(g.minute),onChange:$,style:T,disabled:l,"aria-label":"Minute",onFocus:()=>y(!0),onBlur:()=>y(!1)}),o("button",{type:"button",style:w,onClick:()=>L(-1),disabled:l},"\u25BC")),H=h?o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"):null,_=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:A,style:T,disabled:l,"aria-label":"Second",onFocus:()=>y(!0),onBlur:()=>y(!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,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=p&&!c?o("span",{style:{marginLeft:"8px",fontSize:"12px",fontWeight:"600",color:"#6b7280"}},p):null,G=c?o("select",{style:K,value:p??m[0],onChange:B,disabled:l,"aria-label":"Timezone"},...m.map(Y=>o("option",{key:Y,value:Y},Y))):null,O=[N,F,W];return H&&O.push(H),_&&O.push(_),V&&O.push(V),Q&&O.push(Q),G&&O.push(G),o(Pe,{label:d,error:u,disabled:l,htmlFor:n},o("div",{id:n,style:z},...O))}var El={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 hr(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=El[a],h=S(()=>{s||n(!t)},[s,t,n]),p=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"},m=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:`${m}px`,transition:"left 0.2s",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"},b={display:"inline-flex",alignItems:"center",gap:"8px",opacity:s?"0.5":"1",userSelect:"none"},y=r?o("span",{style:{fontSize:"14px",color:"#374151"}},r):null,g=o("div",{style:c},o("div",{style:f}));return o("div",{style:b,onClick:h,onKeyDown:p,tabIndex:s?-1:0,role:"switch","aria-checked":t?"true":"false","aria-disabled":s?"true":void 0,"aria-label":r},...(i==="left"?[y,g]:[g,y]).filter(Boolean))}var br={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 xr(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=br[n]??br.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 yr(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 Sr(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 vr(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 wr(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 kr={none:"none",sm:"0 1px 3px rgba(0,0,0,0.12)",md:"0 4px 6px rgba(0,0,0,0.1)"};function Cr(e){let t=e.bordered!==!1,n=e.shadow??"none",[r,i]=j(!!e.defaultCollapsed),s=te(null),[a,l]=j("auto");re(()=>{if(!e.collapsible)return;let b=s.current;b&&l(`${b.scrollHeight}px`)},[e.children,e.collapsible]);let d=S(()=>{e.collapsible&&i(b=>!b)},[e.collapsible]),u=S(b=>{if(!e.collapsible)return;let y=b.key;(y==="Enter"||y===" ")&&(b.preventDefault(),d())},[e.collapsible,d]),h=q(()=>{let b={borderRadius:"6px",overflow:"hidden",backgroundColor:"#ffffff"};return t&&(b.border="1px solid #e5e7eb"),b.boxShadow=kr[n]??kr.none,{...b,...e.style??{}}},[t,n,e.style]),p={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"},m={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:p,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?m:{},ref:s},o("div",{className:"panel__body",style:f},e.children)))}function Mr(e,t){return e==="both"?"auto":e==="horizontal"?t==="x"?"auto":"hidden":t==="y"?"auto":"hidden"}function Il(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 Er(e){let t=e.direction??"vertical",n=e.showScrollbar??"auto",r=e.shadow??!1,i=te(null),[s,a]=j(!0),[l,d]=j(!1),[u,h]=j(!0),[p,c]=j(!1),m=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(()=>{m()},[m]);let f=S(()=>{r&&m()},[r,m]),b=q(()=>{let x={position:"relative",overflowX:Mr(t,"x"),overflowY:Mr(t,"y"),...Il(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]),y=[];if(r){let x=t==="vertical"||t==="both",v=t==="horizontal"||t==="both";x&&!s&&y.push("inset 0 8px 6px -6px rgba(0,0,0,0.15)"),x&&!l&&y.push("inset 0 -8px 6px -6px rgba(0,0,0,0.15)"),v&&!u&&y.push("inset 8px 0 6px -6px rgba(0,0,0,0.15)"),v&&!p&&y.push("inset -8px 0 6px -6px rgba(0,0,0,0.15)")}let g={...b};return y.length>0&&(g.boxShadow=y.join(", ")),o("div",{className:`scroll-container scroll-container--${t} ${e.className??""}`.trim(),style:g,ref:i,onScroll:f},e.children)}function Ir(e){let t=e.direction??"horizontal",n=t==="horizontal",r=e.dividerSize??6,i=e.minSize??50,[s,a]=j(e.initialSplit??50),l=te(null),d=te(!1),u=S(b=>{b.preventDefault(),d.current=!0,document.body.style.cursor=n?"col-resize":"row-resize",document.body.style.userSelect="none"},[n]);re(()=>{let b=g=>{if(!d.current||!l.current)return;let x=l.current.getBoundingClientRect(),v=n?x.width:x.height,R=n?g.clientX-x.left:g.clientY-x.top;if(v<=0)return;let D=i/v*100,M=e.maxSize?e.maxSize/v*100:100-D,$=R/v*100;$=Math.max(D,Math.min(M,$)),a($)},y=()=>{d.current&&(d.current=!1,document.body.style.cursor="",document.body.style.userSelect="")};return document.addEventListener("mousemove",b),document.addEventListener("mouseup",y),()=>{document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",y)}},[n,i,e.maxSize]);let h=q(()=>({display:"flex",flexDirection:n?"row":"column",width:"100%",height:"100%",overflow:"hidden",...e.style??{}}),[n,e.style]),p=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"},m={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:p},f[0]??null),o("div",{className:"splitter__divider",style:m,onMouseDown:u,onKeyDown:b=>{let y=b.key,g=2;n&&(y==="ArrowLeft"||y==="ArrowRight")?(b.preventDefault(),a(x=>{let v=y==="ArrowRight"?g:-g;return Math.max(5,Math.min(95,x+v))})):!n&&(y==="ArrowUp"||y==="ArrowDown")&&(b.preventDefault(),a(x=>{let v=y==="ArrowDown"?g:-g;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(g=>!g.disabled)?.id??"",[i,s]=j(e.activeTab??r),a=e.activeTab??i,l=te(null),d=S(g=>{s(g),e.onChange&&e.onChange(g)},[e.onChange]),u=S(g=>{let x=e.tabs.filter(A=>!A.disabled),v=x.findIndex(A=>A.id===a);if(v===-1)return;let R=t==="left"||t==="right",D=R?"ArrowUp":"ArrowLeft",M=R?"ArrowDown":"ArrowRight",$=-1;if(g.key===D?$=v>0?v-1:x.length-1:g.key===M?$=v<x.length-1?v+1:0:g.key==="Home"?$=0:g.key==="End"&&($=x.length-1),$>=0){g.preventDefault(),d(x[$].id);let A=l.current;if(A){let P=A.querySelectorAll('[role="tab"]')[e.tabs.indexOf(x[$])];P&&P.focus()}}},[e.tabs,a,t,d]),h=t==="left"||t==="right",p=t==="bottom"||t==="right",c=q(()=>({display:"flex",flexDirection:h?p?"row-reverse":"row":p?"column-reverse":"column",width:"100%",...e.style??{}}),[h,p,e.style]),m={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"},b=e.tabs.find(g=>g.id===a),y=e.tabs.map(g=>{let x=g.id===a,v={padding:"8px 16px",border:"none",background:"none",cursor:g.disabled?"not-allowed":"pointer",opacity:g.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:g.id,role:"tab","aria-selected":String(x),"aria-controls":`tabpanel-${g.id}`,"aria-disabled":g.disabled?"true":void 0,id:`tab-${g.id}`,tabIndex:x?"0":"-1",style:v,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:m,ref:l},...y),o("div",{className:"tabs__panel",role:"tabpanel",id:`tabpanel-${a}`,"aria-labelledby":`tab-${a}`,style:f,tabIndex:"0"},b?b.content:null))}function Pr(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=Ee().replace(/[^a-zA-Z0-9_-]/g,""),[u,h]=j(0),p=te(null),c=te(null),m=S(M=>{let $=M;r?$=(M%n+n)%n:$=Math.max(0,Math.min(M,n-1)),h($),e.onChange&&e.onChange($)},[n,r,e.onChange]),f=S(()=>m(u+1),[u,m]),b=S(()=>m(u-1),[u,m]);re(()=>{if(!e.autoPlay||n<=1)return;let M=setInterval(f,l);return()=>clearInterval(M)},[e.autoPlay,l,f,n]),re(()=>{let M=A=>{A.key==="ArrowLeft"?b():A.key==="ArrowRight"&&f()},$=c.current;if($)return $.addEventListener("keydown",M),()=>$.removeEventListener("keydown",M)},[f,b]);let y=a==="fade"?`@keyframes liq-fade-in-${d}{from{opacity:0}to{opacity:1}}`:"",g={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)"},R=t.map((M,$)=>{let A=a==="fade"?{position:$===u?"relative":"absolute",top:"0",left:"0",width:"100%",opacity:$===u?"1":"0",transition:"opacity 0.4s ease"}:{flex:"0 0 100%",width:"100%"};return o("div",{key:String($),style:A},M.content,M.caption?o("div",{style:{textAlign:"center",padding:"8px 12px",fontSize:"13px",color:"#6b7280"}},M.caption):null)}),D=i?o("div",{style:{display:"flex",justifyContent:"center",gap:"8px",padding:"12px 0"}},...t.map((M,$)=>o("button",{key:String($),"aria-label":`Go to slide ${$+1}`,onclick:()=>m($),style:{width:"10px",height:"10px",borderRadius:"50%",border:"none",cursor:"pointer",backgroundColor:$===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:M=>{p.current=M.clientX},onpointerup:M=>{if(p.current==null)return;let $=M.clientX-p.current;$>50?b():$<-50&&f(),p.current=null}},y?o("style",null,y):null,o("div",{style:x},...R),s&&n>1?o("button",{"aria-label":"Previous slide",onclick:b,style:{...v,left:"8px"}},"\u2039"):null,s&&n>1?o("button",{"aria-label":"Next slide",onclick:f,style:{...v,right:"8px"}},"\u203A"):null,D)}function Tr(e){let[t,n]=j("loading"),r=te(null),i=Ee().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 m={display:"inline-block",position:"relative",overflow:"hidden"};return a&&(m.width=a),l&&(m.height=l),e.borderRadius&&(m.borderRadius=e.borderRadius),m},[a,l,e.borderRadius]),u=q(()=>{let m={display:"block",width:"100%",height:"100%"};return e.objectFit&&(m.objectFit=e.objectFit),t==="loading"&&(m.opacity="0",m.position="absolute"),t==="error"&&(m.display="none"),m},[e.objectFit,t]),h=null;if(t==="loading")if(e.placeholder==="skeleton"){let m=`@keyframes liq-img-shimmer-${i}{0%{background-position:-200% 0}100%{background-position:200% 0}}`;h=o("div",null,o("style",null,m),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 p=null;t==="error"&&e.fallback!=null&&(typeof e.fallback=="string"?p=o("img",{src:e.fallback,alt:e.alt??"",style:{display:"block",width:"100%",height:"100%",objectFit:e.objectFit??"cover"}}):p=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")}),p);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 Dr(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=te(null),r=Ee().replace(/[^a-zA-Z0-9_-]/g,""),[i,s]=j(!1),[a,l]=j(0),[d,u]=j(0),[h,p]=j(e.muted?0:1),[c,m]=j(!!e.muted),[f,b]=j(!0),y=typeof e.width=="number"?`${e.width}px`:e.width??"100%",g=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()},L=()=>{s(!1),e.onPause&&e.onPause()},E=()=>{s(!1),e.onEnded&&e.onEnded()},B=()=>{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",L),I.addEventListener("ended",E),I.addEventListener("timeupdate",B),I.addEventListener("loadedmetadata",z),()=>{I.removeEventListener("play",P),I.removeEventListener("pause",L),I.removeEventListener("ended",E),I.removeEventListener("timeupdate",B),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 L=I.currentTarget.getBoundingClientRect(),E=Math.max(0,Math.min(1,(I.clientX-L.left)/L.width));P.currentTime=E*P.duration},[]),R=S(I=>{let P=n.current,L=parseFloat(I.target.value);P&&(P.volume=L,P.muted=L===0,p(L),m(L===0))},[]),D=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:y,height:g,display:"block"}});let M=d>0?a/d*100:0,$={background:"none",border:"none",color:"#ffffff",cursor:"pointer",fontSize:"16px",padding:"4px 8px",lineHeight:"1"},A=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:$},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"}},`${Dr(a)} / ${Dr(d)}`),o("input",{type:"range",min:"0",max:"1",step:"0.05",value:String(c?0:h),oninput:R,"aria-label":"Volume",style:{width:"60px",cursor:"pointer"}}),o("button",{"aria-label":"Fullscreen",onclick:D,style:$},"\u26F6"));return o("div",{style:{position:"relative",width:y,height:g,backgroundColor:"#000",overflow:"hidden"},onmouseenter:()=>b(!0),onmouseleave:()=>{i&&b(!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"}}),A)}function We(e){let t=e.orientation??"vertical",n=e.role??"navigation",r=e.keyboardNav??!0,i=e.styling??{},s=te(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 p=Array.from(h.querySelectorAll('button, [tabindex]:not([tabindex="-1"]), a[href], [role="menuitem"], [role="treeitem"]')),c=p.indexOf(document.activeElement);if(c<0)return;let m=t==="vertical",f=m?"ArrowDown":"ArrowRight",b=m?"ArrowUp":"ArrowLeft";if(u.key===f){u.preventDefault();let y=p[c+1];y&&y.focus()}else if(u.key===b){u.preventDefault();let y=p[c-1];y&&y.focus()}else u.key==="Home"?(u.preventDefault(),p[0]?.focus()):u.key==="End"&&(u.preventDefault(),p[p.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 Ne(){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}=Ne(),p=t.disabled===!0,c={display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",boxSizing:"border-box",padding:i.padding??"12px 16px",backgroundColor:p?"#f9fafb":d?i.hoverBackground??"#f3f4f6":i.backgroundColor??"transparent",color:p?"#9ca3af":i.color??"inherit",fontWeight:i.fontWeight??"600",fontSize:i.fontSize??"inherit",border:"none",outline:"none",cursor:p?"not-allowed":"pointer",font:"inherit",textAlign:"left",transition:"background-color 0.15s",...i.borderBottom?{borderBottom:i.borderBottom}:{}};l==="left"&&(c.flexDirection="row");let m=S(v=>{let R=v;p||(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),r())},[p,r]),f=S(()=>{p||r()},[p,r]),y=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,x=l==="left"?[y,g]:[g,y];return o("button",{id:`accordion-header-${t.id}`,role:"button","aria-expanded":String(n),"aria-controls":`accordion-panel-${t.id}`,"aria-disabled":p?"true":void 0,"data-section-id":t.id,tabIndex:p?-1:0,style:c,onClick:f,onKeyDown:m,onMouseEnter:u,onMouseLeave:h},...x)}function Pl(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 zr(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:p}=e,[c,m]=j(()=>n??[]),f=S(y=>{m(g=>{let x=g.includes(y),v;return x?v=g.filter(R=>R!==y):r?v=[...g,y]:v=[y],p&&p(v),v})},[r,p]),b=q(()=>t.map(y=>{let g=c.includes(y.id),x=o(Rl,{key:`header-${y.id}`,section:y,expanded:g,onToggle:()=>f(y.id),headerStyle:i,expandIcon:l,collapseIcon:d,iconPosition:u}),v=o(Pl,{key:`content-${y.id}`,section:y,expanded:g,contentStyle:s,animated:h});return o("div",{key:y.id,"data-accordion-section":y.id,style:{width:"100%"}},x,v)}),[t,c,i,s,l,d,u,h,f]);return o(We,{role:"region",ariaLabel:"Accordion",styling:a,keyboardNav:!0},...b)}var Tl={sm:{fontSize:"12px",padding:"4px 0"},md:{fontSize:"14px",padding:"6px 0"},lg:{fontSize:"16px",padding:"8px 0"}};function Ar(e){let{items:t,separator:n="/",maxItems:r,size:i="md"}=e,[s,a]=j(!1),l=Tl[i],d=S(()=>{a(!0)},[]),u=t,h=!1;if(r&&r>1&&t.length>r&&!s){h=!0;let f=1,b=r-1;u=[...t.slice(0,f),{label:"..."},...t.slice(t.length-b)]}let p=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,b,y)=>{let g=b===y.length-1,x=h&&f.label==="..."&&b===1,v=[];return b>0&&v.push(p(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"},"...")):g?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?R=>{R.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(b),style:{display:"inline-flex",alignItems:"center"}},...v)},m=u.map((f,b)=>c(f,b,u));return o(We,{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"}},...m))}function Lr(e){let{item:t,itemStyle:n,closeOnSelect:r,onClose:i}=e,{hover:s,onMouseEnter:a,onMouseLeave:l}=Ne(),[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 p=t.disabled===!0,m={...bt(n,{hover:!p&&s,active:!1}),position:"relative",justifyContent:"space-between",...p?{color:"#9ca3af",cursor:"default",opacity:"0.6"}:{}},f=S(()=>{if(!p){if(h){u(R=>!R);return}t.onClick&&t.onClick(),r&&i()}},[p,h,t,r,i]),b=S(()=>{a(),h&&u(!0)},[h,a]),y=S(()=>{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)),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(We,{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(R=>o(Lr,{key:R.id,item:R,itemStyle:n,closeOnSelect:r,onClose:i})))):null;return o("div",{style:{position:"relative"},onMouseEnter:b,onMouseLeave:y},o("button",{type:"button",role:"menuitem",style:m,onClick:f,disabled:p||void 0,tabIndex:p?-1:0,"aria-disabled":p?"true":void 0,"aria-haspopup":h||void 0,"aria-expanded":h?String(d):void 0},g,x),v)}function Br(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),p=te(null),c=S(()=>{h(R=>!R)},[]),m=S(()=>{h(!1)},[]);re(()=>{if(!u)return;let R=D=>{let M=p.current;M&&!M.contains(D.target)&&h(!1)};return document.addEventListener("click",R,!0),()=>{document.removeEventListener("click",R,!0)}},[u]),re(()=>{if(!u)return;let R=D=>{D.key==="Escape"&&h(!1)};return document.addEventListener("keydown",R),()=>{document.removeEventListener("keydown",R)}},[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??{}},b=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")),y=typeof d=="number"?`${d}px`:d,g={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:y,backgroundColor:"#ffffff",...i??{}},v=u?o("div",{style:g},o(We,{orientation:"vertical",role:"menu",ariaLabel:`${t} menu`,styling:x},...n.map(R=>o(Lr,{key:R.id,item:R,itemStyle:s,closeOnSelect:l,onClose:m})))):null;return o("div",{ref:p,style:{position:"relative",display:"inline-block"}},b,v)}function Fr(e){let{item:t,onClose:n,index:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:a}=Ne(),[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,p=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]),m=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"},b=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)),y=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((x,v)=>o(Fr,{key:String(v),item:x,onClose:n,index:v})))):null;return o("div",{style:{position:"relative"},onMouseEnter:c,onMouseLeave:m},o("button",{type:"button",role:"menuitem",style:f,onClick:p,disabled:h||void 0,tabIndex:-1,"aria-disabled":h||void 0,"aria-haspopup":u||void 0,"aria-expanded":u?l:void 0},b,y),g)}function Dl(e){let{menu:t,index:n,isOpen:r,anyOpen:i,onOpen:s,onClose:a}=e,{hover:l,onMouseEnter:d,onMouseLeave:u}=Ne(),h=te(null),p=S(()=>{r?a():s(n)},[r,n,s,a]),c=S(()=>{d(),i&&!r&&s(n)},[i,r,n,s,d]),m={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((b,y)=>o(Fr,{key:String(y),item:b,onClose:a,index:y})))):null;return o("div",{style:{position:"relative",display:"inline-block"},onMouseEnter:c,onMouseLeave:u},o("button",{ref:h,type:"button",role:"menuitem",style:m,onClick:p,"aria-haspopup":"true","aria-expanded":String(r),tabIndex:0},t.label),f)}function Nr(e){let{menus:t}=e,[n,r]=j(null),i=te(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 p=h;if(p.key==="Escape"){r(null);return}if(p.key==="ArrowRight"){p.preventDefault(),r(c=>c===null?0:(c+1)%t.length);return}if(p.key==="ArrowLeft"){p.preventDefault(),r(c=>c===null?t.length-1:(c-1+t.length)%t.length);return}if(p.key==="ArrowDown"&&n!==null){p.preventDefault();let c=d.querySelector('[role="menu"]');if(c){let m=c.querySelector('[role="menuitem"]');m&&m.focus()}return}p.key==="Enter"||p.key};return d.addEventListener("keydown",u),()=>{d.removeEventListener("keydown",u)}},[n,t.length]);let l=t.map((d,u)=>o(Dl,{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 $l(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"},zl={...Xt,backgroundColor:"#2563eb",color:"#ffffff",borderColor:"#2563eb",fontWeight:"600"},_r={...Xt,color:"#9ca3af",cursor:"default",opacity:"0.5"},Al={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),p=S(y=>{!d&&y>=1&&y<=u&&y!==h&&i(y)},[d,u,h,i]),c=(y,g,x)=>{let v=d||g<1||g>u||g===h;return o("button",{type:"button",onClick:()=>p(g),disabled:v||void 0,"aria-label":x,style:v?_r:Xt},y)},m=$l(u,h,s),f=0,b=[];a&&b.push(c("\xAB",1,"Go to first page")),l&&b.push(c("\u2039",h-1,"Go to previous page"));for(let y of m)if(y==="ellipsis")b.push(o("span",{key:`ellipsis-${f++}`,style:Al},"..."));else{let g=y===h;b.push(o("button",{key:String(y),type:"button",onClick:()=>p(y),disabled:d||void 0,"aria-label":`Page ${y}`,"aria-current":g?"page":void 0,style:d?_r:g?zl:Xt},String(y)))}return l&&b.push(c("\u203A",h+1,"Go to next page")),a&&b.push(c("\xBB",u,"Go to last page")),o(We,{orientation:"horizontal",role:"navigation",ariaLabel:"Pagination",keyboardNav:!0,styling:{border:"none",borderRadius:"0",backgroundColor:"transparent",padding:"0",custom:{gap:"4px"}}},...b)}function Or(e){let{item:t,collapsed:n,selectedId:r,onSelect:i,depth:s}=e,{hover:a,onMouseEnter:l,onMouseLeave:d}=Ne(),[u,h]=j(!1),p=t.children&&t.children.length>0,c=t.id===r,m=S(()=>{p&&!n&&h($=>!$),i&&i(t.id)},[p,n,i,t.id]),f=n?"0":`${16+s*16}px`,b={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"},y=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),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&&p?o("span",{style:{fontSize:"10px",transition:"transform 0.15s",transform:u?"rotate(90deg)":"rotate(0deg)",marginLeft:"4px"},"aria-hidden":"true"},"\u25B6"):null,R=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,D=o("button",{type:"button",style:b,onClick:m,onMouseEnter:l,onMouseLeave:d,"aria-selected":c?"true":"false",title:n?t.label:void 0},y,g,x,v,R),M=!n&&p&&u?t.children.map($=>o(Or,{key:$.id,item:$,collapsed:n,selectedId:r,onSelect:i,depth:s+1})):null;return o("div",{key:t.id,style:{position:"relative"}},D,M?o("div",{role:"group"},...M):null)}function Hr(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(p=>o(Or,{key:p.id,item:p,collapsed:n,selectedId:i,onSelect:s,depth:0}));return o(We,{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 Ue={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(y=>{s&&i&&i(y)},[s,i]),p=y=>y<n?"completed":y===n?"active":"pending",c=(y,g,x)=>{let v=a==="dot"?u:d,R={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:{...R,backgroundColor:Ue.completedBg,color:Ue.completedText,border:`2px solid ${Ue.completed}`}},a==="circle"?g.icon||"\u2713":null):x==="active"?o("div",{style:{...R,backgroundColor:"#ffffff",color:Ue.activeText,border:`2px solid ${Ue.activeBorder}`,boxShadow:"0 0 0 3px rgba(37, 99, 235, 0.2)"}},a==="circle"?g.icon||String(y+1):o("div",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:Ue.active}})):o("div",{style:{...R,backgroundColor:"#ffffff",color:Ue.pendingText,border:`2px solid ${Ue.pending}`}},a==="circle"?g.icon||String(y+1):null)},m=y=>{if(y>=t.length-1)return null;let x=y<n?Ue.lineCompleted:Ue.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=(y,g)=>{let x=p(g),v=x==="active",R=x==="completed",D=c(g,y,x),M={fontSize:"13px",fontWeight:v?"600":"400",color:v||R?Ue.labelActive:Ue.labelPending,marginTop:l?"8px":"0",marginLeft:l?"0":"12px",textAlign:l?"center":"left",transition:"color 0.2s"},$={fontSize:"11px",color:Ue.descriptionColor,marginTop:"2px",textAlign:l?"center":"left"},A=o("div",{style:l?{display:"flex",flexDirection:"column",alignItems:"center"}:{display:"flex",flexDirection:"column"}},o("span",{style:M},y.label),y.description?o("span",{style:$},y.description):null),I=l?o("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"}},D,A):o("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"}},D,A);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":v?"step":void 0},I)},b=[];return t.forEach((y,g)=>{b.push(f(y,g));let x=m(g);x&&b.push(x)}),o("div",{role:"navigation","aria-label":"Progress steps",style:{display:"flex",flexDirection:l?"row":"column",alignItems:l?"flex-start":"stretch",width:"100%"}},...b)}var Vr={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 Ll(e){let{item:t,size:n,variant:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:a}=Ne(),l=Vr[n],d=t.disabled===!0,u=t.type==="toggle",[h,p]=j(!1),c=u?t.active===!0:h,m=S(()=>{!d&&t.onClick&&t.onClick()},[d,t]),f=S(()=>{!d&&!u&&p(!0)},[d,u]),b=S(()=>{u||p(!1)},[u]),y=S(()=>{a(),u||p(!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"},x=t.icon?o("span",{style:{fontSize:l.iconSize},"aria-hidden":"true"},t.icon):null,v=t.label?o("span",null,t.label):null,R=t.type==="dropdown"?o("span",{style:{fontSize:"10px",marginLeft:"2px"},"aria-hidden":"true"},"\u25BC"):null;return o("button",{type:"button",style:g,onClick:m,onMouseDown:f,onMouseUp:b,onMouseEnter:s,onMouseLeave:y,disabled:d||void 0,"aria-pressed":u?c:void 0,"aria-label":t.label||t.id,title:t.label||t.id},x,v,R)}function Ur(e){let{items:t,size:n="md",variant:r="flat"}=e,i=Vr[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(Ll,{key:a.id,item:a,size:n,variant:r}));return o(We,{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 jr(e){e.expanded=!0;for(let t of e.children)jr(t)}function Gr(e,t=[]){if(t.push(e),e.expanded)for(let n of e.children)Gr(n,t);return t}function Bl(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:p,focusedId:c}=e,m=Ne(),f=te(null),b=c===t.id;re(()=>{b&&f.current&&f.current.focus()},[b]);let y=t.isLeaf(),g=t.depth,x=[];for(let $=0;$<g;$++){let A=t;for(let P=0;P<g-$;P++)A=A?A.parent:null;let I=A?!Bl(A):!1;x.push(o("span",{key:`connector-${$}`,"aria-hidden":"true",style:{display:"inline-block",width:`${r}px`,height:"100%",position:"relative",flexShrink:"0",...I?{borderLeft:`${s}px solid ${i}`}:{}}}))}let v=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,R=y?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:$=>{$.stopPropagation(),h(t)}},t.expanded?a:l),D=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:m.hover,active:n});return o("div",{ref:f,role:"treeitem","aria-expanded":y?void 0:String(t.expanded),"aria-selected":n?"true":"false","aria-level":g+1,tabIndex:b?0:-1,style:{...M,display:"flex",alignItems:"stretch",padding:"0"},onMouseEnter:m.onMouseEnter,onMouseLeave:m.onMouseLeave,onClick:()=>p(t)},...x,v,o("span",{style:{display:"flex",alignItems:"center",flex:"1",padding:d.padding??"6px 10px",minWidth:"0"}},R,D))}function Xr(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:p="+",nodeStyle:c={},wrapperStyle:m,renderNode:f}=e,[b,y]=j(()=>{let I=xt.fromData(t);return a&&jr(I),I}),[g,x]=j(t.id),v=q(()=>Gr(b),[b]),R=S(()=>{y(I=>{let P=Object.create(Object.getPrototypeOf(I));return Object.assign(P,I),P})},[]),D=S(I=>{I.toggle(),I.expanded?r?.(I):i?.(I),R()},[r,i,R]),M=S(I=>{x(I.id),n?.(I)},[n]),$=S(I=>{let P=I;if(!g)return;let L=v.findIndex(B=>B.id===g);if(L===-1)return;let E=v[L];switch(P.key){case"ArrowDown":{P.preventDefault();let B=v[L+1];B&&x(B.id);break}case"ArrowUp":{P.preventDefault();let B=v[L-1];B&&x(B.id);break}case"ArrowRight":{P.preventDefault(),E.isLeaf()||(E.expanded?E.children.length>0&&x(E.children[0].id):D(E));break}case"ArrowLeft":{P.preventDefault(),!E.isLeaf()&&E.expanded?D(E):E.parent&&x(E.parent.id);break}case"Enter":{P.preventDefault(),M(E);break}case" ":{P.preventDefault(),E.isLeaf()||D(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}}},[g,v,D,M]),A=v.map(I=>o(Fl,{key:I.id,node:I,isSelected:I.id===s,indentPx:u,lineColor:l,lineWidth:d,iconExpanded:h,iconCollapsed:p,nodeStyle:c,renderNode:f,onToggle:D,onClick:M,focusedId:g}));return o(We,{role:"tree",ariaLabel:"Tree navigation",styling:m,keyboardNav:!1},o("div",{onKeyDown:$,style:{outline:"none"}},...A))}function Kr(e){let{items:t,position:n,onClose:r,depth:i}=e,[s,a]=j(-1),[l,d]=j(null),u=te(null);re(()=>{if(!u.current)return;u.current.focus();let c=f=>{let b=f,y=t.map((g,x)=>({item:g,i:x})).filter(({item:g})=>!g.divider);if(b.key==="ArrowDown")b.preventDefault(),a(g=>{let v=(y.findIndex(({i:R})=>R===g)+1)%y.length;return y[v].i});else if(b.key==="ArrowUp")b.preventDefault(),a(g=>{let x=y.findIndex(({i:R})=>R===g),v=x<=0?y.length-1:x-1;return y[v].i});else if(b.key==="ArrowRight")s>=0&&t[s]?.children&&d(s);else if(b.key==="ArrowLeft")i>0&&r();else if(b.key==="Enter"){if(b.preventDefault(),s>=0){let g=t[s];g.children?d(s):!g.disabled&&g.onClick&&(g.onClick(),r())}}else b.key==="Escape"&&r()};u.current.addEventListener("keydown",c);let m=u.current;return()=>m.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"},p=t.map((c,m)=>{if(c.divider)return o("div",{key:`divider-${m}`,style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let f=s===m,b=!!c.disabled,y=!!(c.children&&c.children.length>0),g={display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",fontSize:"14px",color:b?"#9ca3af":"#1f2937",cursor:b?"default":"pointer",backgroundColor:f&&!b?"#f3f4f6":"transparent",userSelect:"none",position:"relative"},x=()=>{a(m),d(y?m:null)},v=()=>{if(!b){if(y){d(m);return}c.onClick&&c.onClick(),r()}},R=[];c.icon&&R.push(o("span",{style:{width:"20px",textAlign:"center",flexShrink:"0"}},c.icon)),R.push(o("span",{style:{flex:"1"}},c.label??"")),y&&R.push(o("span",{style:{fontSize:"10px",color:"#9ca3af",marginLeft:"8px"}},"\u25B6"));let D=[o("div",{key:`item-${m}`,style:g,onMouseEnter:x,onClick:v,role:"menuitem","aria-disabled":b?"true":void 0},...R)];return y&&l===m&&D.push(o(Kr,{key:`submenu-${m}`,items:c.children,position:{x:n.x+178,y:n.y+m*36},onClose:()=>d(null),depth:i+1})),o("div",{key:`wrap-${m}`,style:{position:"relative"}},...D)});return o("div",{ref:u,style:h,tabIndex:-1,role:"menu"},...p)}function Kt(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=p=>{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(Kr,{items:t,position:r,onClose:a,depth:0})),o("div",null,...d)}function Nl(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 _l(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 qr(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,p]=j(!1),[c,m]=j(!1),f=te(null),b=s?"drawer-title":void 0;if(re(()=>{if(t)p(!0),requestAnimationFrame(()=>m(!0));else{m(!1);let I=setTimeout(()=>p(!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 y={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={..._l(r,i),transform:Nl(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"},R={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",lineHeight:"1"},D={padding:"20px",overflow:"auto",flex:"1"},M=()=>{l&&n()},$=[];s&&$.push(o("div",{style:x},o("h3",{id:b,style:v},s),o("button",{type:"button",style:R,onClick:n,"aria-label":"Close drawer"},"\xD7"))),$.push(o("div",{style:D},u));let A=[];return a&&A.push(o("div",{style:y,onClick:M})),A.push(o("div",{ref:f,style:g,role:"dialog","aria-modal":"true","aria-labelledby":b,tabIndex:-1},...$)),o("div",null,...A)}var Wl={sm:"400px",md:"600px",lg:"800px",full:"100vw"};function Zr(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=te(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=$=>{$.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 p={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:Wl[i],maxWidth:i==="full"?"100vw":"90vw",display:"flex",flexDirection:"column",outline:"none",overflow:"hidden"},m={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"},b={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",borderRadius:"4px",lineHeight:"1"},y={padding:"24px",overflow:"auto",flex:"1"},g={padding:"16px 24px",borderTop:"1px solid #e5e7eb",flexShrink:"0"},x=M=>{s&&M.target===M.currentTarget&&n()},v=[],R=r?"modal-title":void 0;r?v.push(o("h2",{id:R,style:f},r)):v.push(o("span",null)),d&&v.push(o("button",{type:"button",style:b,onClick:n,"aria-label":"Close modal"},"\xD7"));let D=[o("div",{style:m},...v),o("div",{style:y},u)];return l&&D.push(o("div",{style:g},l)),o("div",{style:p,onClick:x,"aria-modal":"true",role:"dialog","aria-labelledby":R},o("div",{ref:h,style:c,tabIndex:-1,role:"document"},...D))}var Jr=8;function Ol(e,t){let n=t+Jr;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 Hl(e){let t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n=`${Jr}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 Qr(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,p]=j(!1),c=u?r:h,m=te(null),f=S(()=>{u?d&&d(!r):p(R=>!R)},[u,r,d]);re(()=>{if(!c||!l)return;let R=D=>{m.current&&!m.current.contains(D.target)&&(u?d&&d(!1):p(!1))};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[c,l,u,d]);let b={position:"relative",display:"inline-block"},y={...Ol(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:Hl(i)}));let x=S(R=>{let D=R.key;(D==="Enter"||D===" ")&&(R.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:y},...g)),o("div",{ref:m,style:b},...v)}var Yl=0;function Vl(){return`toast-${++Yl}-${Date.now()}`}function Wn(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=Vl();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 Ul={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 jl(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 Gl(e){let{item:t,onDismiss:n}=e,r=Ul[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 On(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=jl(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 sa=Object.getOwnPropertyDescriptor;var aa=Object.getOwnPropertyNames;var la=Object.prototype.hasOwnProperty;var ca=(e,t,n)=>t in e?Ht(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var da=(e,t)=>{for(var n in t)Ht(e,n,{get:t[n],enumerable:!0})},ua=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of aa(t))!la.call(e,i)&&i!==n&&Ht(e,i,{get:()=>t[i],enumerable:!(r=sa(t,i))||r.enumerable});return e};var pa=e=>ua(Ht({},"__esModule",{value:!0}),e);var et=(e,t,n)=>ca(e,typeof t!="symbol"?t+"":t,n);var sp={};da(sp,{Accordion:()=>Ar,Alert:()=>Xo,AnalogClock:()=>Ao,AppContextProvider:()=>it,Avatar:()=>Fo,Badge:()=>No,BarGraph:()=>ii,BigNumber:()=>Ss,BlochSphere:()=>vs,Board:()=>Nt,BoxPlot:()=>ws,Breadcrumb:()=>Lr,BubbleChart:()=>Cs,BuildableList:()=>fs,Button:()=>hs,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:()=>Is,Card:()=>yr,CardComponent:()=>bn,CardLinkOverlay:()=>yn,Carousel:()=>Tr,CartesianGraph2D:()=>pi,Checkbox:()=>er,ChordDiagram:()=>Rs,CodeEditor:()=>un,ColorPicker:()=>nr,ColorWheel:()=>or,ComplexGraph2D:()=>hi,ContainerComponent:()=>xn,ContextMenu:()=>Kt,DEFAULT_BOARD_STATE:()=>tt,DataGrid:()=>Ho,DatePicker:()=>sr,DecompositionTree:()=>Ps,DesktopBackground:()=>nn,DigitalClock:()=>Yo,DiscreteCartesian2D:()=>ia,Dock:()=>tn,DragDropProvider:()=>zt,DraggableWindow:()=>kt,Drawer:()=>Zr,Dropdown:()=>Fr,EmptyState:()=>Ko,FileExplorer:()=>an,FileUpload:()=>ar,FlexContainer:()=>Sr,FlexItem:()=>vr,Footer:()=>Pi,ForceGraph:()=>zs,FormFieldWrapper:()=>Pe,FunnelChart:()=>Ls,GanttChart:()=>Ns,Gauge:()=>_s,GoogleAnalytics:()=>Ri,Grid:()=>wr,GridItem:()=>kr,HeatMap:()=>Hs,Histogram:()=>Ys,HypercubeGraph:()=>Mi,IDE:()=>fn,Image:()=>Dr,LineGraph:()=>Si,ListView:()=>Vo,LollipopChart:()=>Vs,Matrix:()=>Us,MenuBar:()=>sn,Menubar:()=>Wr,MessageBusProvider:()=>Dt,Minimap:()=>pn,Modal:()=>Jr,MultilineField:()=>lr,NavWrapper:()=>_e,NumberSpinner:()=>cr,PRIORITY_COLORS:()=>mo,Pagination:()=>Or,Panel:()=>Mr,Partition:()=>js,PieGraph:()=>vi,PivotTable:()=>Xs,PolarGraph2D:()=>ki,Popover:()=>ei,ProgressBar:()=>qo,RadarChart:()=>Ks,RadioGroup:()=>dr,SankeyDiagram:()=>qs,ScrollContainer:()=>Ir,Select:()=>ur,Sidebar:()=>Yr,Skeleton:()=>Zo,Slider:()=>pr,Spinner:()=>Qo,Splitter:()=>Rr,Stepper:()=>Vr,Sunburst:()=>Zs,SystemTray:()=>en,TabBar:()=>ln,Tabs:()=>Pr,Tag:()=>Uo,TextEditor:()=>mr,TextField:()=>gr,ThreeDLayers:()=>ys,TimePicker:()=>hr,TitleBar:()=>rn,ToastContainer:()=>On,Toggle:()=>br,Toolbar:()=>jr,Tooltip:()=>ni,TradingDashboard:()=>hn,TreeMap:()=>Qs,TreeNav:()=>Kr,TreeNode:()=>xt,USStateMap:()=>Os,US_STATE_PATHS:()=>_t,UnityApp:()=>ds,UnityDesktop:()=>cs,VectorField:()=>na,VideoPlayer:()=>zr,VirtualScroll:()=>jo,VizWrapper:()=>Ii,WaterfallChart:()=>oa,WindowManagerProvider:()=>Qt,WordCloud:()=>ra,WordProcessor:()=>on,applyGate:()=>xo,blochToCartesian:()=>Rt,boardReducer:()=>vn,buildInputStyle:()=>Ve,buildNavItemStyle:()=>bt,buildRotationMatrix:()=>Xn,cartesianToBloch:()=>Mn,computeBoxStats:()=>So,computeMandelbrotGrid:()=>gi,computeSlices:()=>Un,createToaster:()=>_n,describeArc:()=>Vn,generateEdges:()=>Gn,generateHypercube:()=>Pt,generatePalette:()=>Jt,generateUUID:()=>qe,generateVertices:()=>jn,getItemId:()=>Xe,getItemName:()=>fo,historyReducer:()=>wn,isCard:()=>Be,isContainer:()=>$e,numRotationAngles:()=>Tt,projectTo2D:()=>qn,tokenizeLine:()=>dn,transformVec:()=>Kn,useAppId:()=>wt,useBarGraphScales:()=>Hn,useBoardReducer:()=>Wt,useChannel:()=>$t,useDragDrop:()=>pt,useDraggable:()=>eo,useDropZone:()=>At,useHover:()=>Ne,useHypercube:()=>Ei,useLineGraphScales:()=>Yn,useMessageBus:()=>st,useToast:()=>ti,useWindowManager:()=>vt,validateNameForNesting:()=>ps,validateNameInBoard:()=>us,validateNameInScope:()=>bo});module.exports=pa(sp);var Yt=Symbol.for("spec.element"),fa=Symbol.for("spec.fragment"),lp=Symbol.for("spec.portal"),Io=Symbol.for("spec.provider"),Ro=Symbol.for("spec.consumer"),ma=Symbol.for("spec.forward_ref"),ga=Symbol.for("spec.memo"),ha=Symbol.for("spec.lazy"),ba=Symbol.for("spec.suspense"),xa=Symbol.for("spec.strict_mode"),ya=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 je(e){let t={$$typeof:Symbol.for("spec.context"),Provider:null,Consumer:null,_currentValue:e,_defaultValue:e},n={$$typeof:Io,_context:t},r={$$typeof:Ro,_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!To(this.props,t)||!To(this.state,n)}};Vt.prototype.isPureSpecComponent=!0;function To(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 Do=null;function ot(){if(Do===null)throw new Error("Invalid hook call. Hooks can only be called inside the body of a function component.");return Do}function j(e){return ot().useState(e)}function re(e,t){return ot().useEffect(e,t)}function Ye(e){return ot().useContext(e)}function zn(e,t,n){return ot().useReducer(e,t,n)}function S(e,t){return ot().useCallback(e,t)}function q(e,t){return ot().useMemo(e,t)}function te(e){return ot().useRef(e)}function Ee(){return ot().useId()}var ht=je({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 va={pathname:$o(),hash:typeof window<"u"?window.location.hash:""},wa=new Set;function ka(){va={pathname:$o(),hash:typeof window<"u"?window.location.hash:""};for(let e of wa)e()}typeof window<"u"&&window.addEventListener("hashchange",ka);var Uf=je({flags:{},isEnabled:()=>!1,setFlag:()=>{},loading:!1});function zo(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 Aa(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 Ao(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(zo(a));re(()=>{let I=setInterval(()=>{u(zo(a))},1e3);return()=>clearInterval(I)},[a]);let h=d.getHours(),p=d.getMinutes(),c=d.getSeconds(),m=h%12*30+p*.5,f=p*6+c*.1,b=c*6,y=n/2,g=n/2,x=n/2-10,v=x-4,R=x-22,D=[];D.push(o("circle",{cx:String(y),cy:String(g),r:String(x),fill:Ze.face,stroke:Ze.border,"stroke-width":"3"}));for(let I=0;I<12;I++){let L=(I*30-90)*Math.PI/180,E=v-6;D.push(o("line",{x1:String(y+E*Math.cos(L)),y1:String(g+E*Math.sin(L)),x2:String(y+v*Math.cos(L)),y2:String(g+v*Math.sin(L)),stroke:Ze.border,"stroke-width":"2"}));let B=String(I===0?12:I);if(D.push(o("text",{x:String(y+R*Math.cos(L)),y:String(g+R*Math.sin(L)),"text-anchor":"middle","dominant-baseline":"central",fill:Ze.numbers,"font-size":String(n*.08),"font-family":"sans-serif","font-weight":"600"},B)),t==="24h"){let z=x-38,k=String(I===0?0:I+12);D.push(o("text",{x:String(y+z*Math.cos(L)),y:String(g+z*Math.sin(L)),"text-anchor":"middle","dominant-baseline":"central",fill:Ze.numbers,"font-size":String(n*.055),"font-family":"sans-serif",opacity:"0.6"},k))}}let M=(I,P,L,E)=>{let B=(I-90)*Math.PI/180;return o("line",{x1:String(y),y1:String(g),x2:String(y+P*Math.cos(B)),y2:String(g+P*Math.sin(B)),stroke:E,"stroke-width":L,"stroke-linecap":"round"})};D.push(M(m,x*.5,"4",Ze.hand)),D.push(M(f,x*.75,"3",Ze.hand)),s&&D.push(M(b,x*.85,"1.5",Ze.second)),D.push(o("circle",{cx:String(y),cy:String(g),r:"4",fill:Ze.hand}));let A=[o("svg",{width:String(n),height:String(n),viewBox:`0 0 ${n} ${n}`,xmlns:"http://www.w3.org/2000/svg"},...D)];return r&&A.push(o("div",{style:{textAlign:"center",marginTop:"8px",fontFamily:"sans-serif",fontSize:"14px",color:Ze.numbers}},Aa(d,i))),o("div",{className:l,style:{display:"inline-flex",flexDirection:"column",alignItems:"center"}},...A)}var Ln={xs:24,sm:32,md:40,lg:56,xl:80};function La(e){return e==null?Ln.md:typeof e=="number"?e:Ln[e]??Ln.md}function Ba(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 Lo=["#3b82f6","#ef4444","#22c55e","#a855f7","#f97316","#ec4899","#14b8a6","#6366f1","#eab308","#06b6d4"];function Fa(e){if(!e)return"#9ca3af";let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return Lo[Math.abs(t)%Lo.length]}var Bo={online:"#22c55e",offline:"#9ca3af",busy:"#ef4444",away:"#eab308"};function Na(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),p=La(i),c=s==="circle"?"50%":`${Math.round(p*.15)}px`,m=a??Fa(r),f=`${Math.round(p*.4)}px`,b={position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:`${p}px`,height:`${p}px`,borderRadius:c,overflow:"hidden",flexShrink:"0"},y;if(t&&!u)y=o("img",{src:t,alt:n??r??"avatar",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"},onError:()=>h(!0)});else{let R=Ba(r);y=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"},R)}let g=o("div",{style:{...b,backgroundColor:t&&!u?"transparent":m},role:"img","aria-label":n??r??"avatar"},y);if(!l)return g;let x=Math.max(8,Math.round(p*.25)),v={position:"absolute",width:`${x}px`,height:`${x}px`,borderRadius:"50%",backgroundColor:Bo[l]??Bo.offline,border:"2px solid #fff",boxSizing:"border-box",...Na(d,x)};return o("div",{style:{position:"relative",display:"inline-flex",width:`${p}px`,height:`${p}px`,flexShrink:"0"}},g,o("span",{style:v,"aria-label":l}))}var Wa={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"}},_a={sm:{width:"6px",height:"6px"},md:{width:"8px",height:"8px"},lg:{width:"10px",height:"10px"}};function No(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?{..._a[s],borderRadius:"50%",...a==="solid"?{backgroundColor:i}:{backgroundColor:"transparent",border:`2px solid ${i}`}}:{...Wa[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}`}},p=u?o("span",{style:h,"aria-label":r?"notification":`count ${d}`},d):null;if(l==null)return p??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 Oa={width:"100%",borderCollapse:"collapse",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",color:"#1f2937"},Wo={padding:"10px 12px",textAlign:"left",fontWeight:"600",backgroundColor:"#f9fafb",borderBottom:"2px solid #e5e7eb",userSelect:"none",whiteSpace:"nowrap"},Bn={padding:"10px 12px",borderBottom:"1px solid #e5e7eb"},Ha="6px 8px",Ya={marginLeft:"4px",fontSize:"12px",color:"#6b7280"},Va={width:"100%",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",boxSizing:"border-box"},Ua={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"},ja={...dt,backgroundColor:"#3b82f6",color:"#fff",borderColor:"#3b82f6"},_o={...dt,opacity:"0.5",cursor:"default"},Oo={cursor:"pointer",width:"16px",height:"16px"};function Ga(e,t,n){return e!==t?"\u2195":n==="asc"?"\u2191":"\u2193"}function Ho(e){let{columns:t,data:n,pageSize:r,currentPage:i,onPageChange:s,sortBy:a,sortDir:l,onSort:d,selectable:u=!1,selectedRows:h,onSelectionChange:p,striped:c=!1,bordered:m=!1,compact:f=!1,stickyHeader:b=!1}=e,[y,g]=j(0),[x,v]=j(void 0),[R,D]=j("asc"),[M,$]=j([]),[A,I]=j({}),P=i??y,L=a??x,E=l??R,B=h??M,z=q(()=>{let J=Object.entries(A).filter(([,se])=>se.length>0);return J.length===0?n:n.filter(se=>J.every(([ce,me])=>String(se[ce]??"").toLowerCase().includes(me.toLowerCase())))},[n,A]),k=q(()=>{if(!L)return z;let J=[...z];return J.sort((se,ce)=>{let me=se[L],ge=ce[L];if(me==null&&ge==null)return 0;if(me==null)return 1;if(ge==null)return-1;if(typeof me=="number"&&typeof ge=="number")return E==="asc"?me-ge:ge-me;let ye=String(me),le=String(ge),ne=ye.localeCompare(le);return E==="asc"?ne:-ne}),J},[z,L,E]),w=k.length,T=r?Math.max(1,Math.ceil(w/r)):1,C=r?k.slice(P*r,(P+1)*r):k,N=S(J=>{s?s(J):g(J)},[s]),F=S(J=>{let se=L===J&&E==="asc"?"desc":"asc";d?d(J,se):(v(J),D(se))},[L,E,d]),_=S(J=>{let se=B.includes(J)?B.filter(ce=>ce!==J):[...B,J];p?p(se):$(se)},[B,p]),H=S(()=>{let J=C.map((me,ge)=>r?P*r+ge:ge),ce=J.every(me=>B.includes(me))?B.filter(me=>!J.includes(me)):[...new Set([...B,...J])];p?p(ce):$(ce)},[C,B,r,P,p]),W=S((J,se)=>{I(ce=>({...ce,[J]:se})),N(0)},[N]),V=t.some(J=>J.filterable),K=f?Ha:Bn.padding,Q=[];if(u){let J=C.map((ce,me)=>r?P*r+me:me),se=J.length>0&&J.every(ce=>B.includes(ce));Q.push(o("th",{key:"__select_all",style:{...Wo,padding:K,width:"40px",textAlign:"center",...b?{position:"sticky",top:"0",zIndex:"2"}:{}}},o("input",{type:"checkbox",checked:se,onChange:H,style:Oo,"aria-label":"Select all rows"})))}for(let J of t){let se={...Wo,padding:K,...J.width?{width:J.width}:{},...J.sortable?{cursor:"pointer"}:{},...m?{border:"1px solid #e5e7eb"}:{},...b?{position:"sticky",top:"0",zIndex:"2"}:{}},ce=[J.header];J.sortable&&ce.push(o("span",{style:Ya},Ga(J.key,L,E))),Q.push(o("th",{key:J.key,style:se,onClick:J.sortable?()=>F(J.key):void 0,onKeyDown:J.sortable?me=>{let ge=me.key;(ge==="Enter"||ge===" ")&&(me.preventDefault(),F(J.key))}:void 0,tabIndex:J.sortable?0:void 0,role:J.sortable?"columnheader":void 0,"aria-sort":L===J.key?E==="asc"?"ascending":"descending":void 0},...ce))}let G=null;if(V){let J=[];u&&J.push(o("th",{key:"__filter_spacer",style:{padding:K}}));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:Va,value:A[se.key]??"",onInput:ce=>W(se.key,ce.target.value),"aria-label":`Filter by ${se.header}`}):null));G=o("tr",{key:"__filter_row"},...J)}let O=[];for(let J=0;J<C.length;J++){let se=C[J],ce=r?P*r+J:J,me=B.includes(ce),ge={};c&&J%2===1&&(ge.backgroundColor="#f9fafb"),me&&(ge.backgroundColor="#eff6ff");let ye=[];u&&ye.push(o("td",{key:"__select",style:{padding:K,textAlign:"center",...Bn,...m?{border:"1px solid #e5e7eb"}:{}}},o("input",{type:"checkbox",checked:me,onChange:()=>_(ce),style:Oo,"aria-label":`Select row ${ce+1}`})));for(let le of t){let ne=se[le.key],pe=le.render?le.render(ne,se):String(ne??"");ye.push(o("td",{key:le.key,style:{...Bn,padding:K,...m?{border:"1px solid #e5e7eb"}:{}}},pe))}O.push(o("tr",{key:String(ce),style:ge},...ye))}let Y=null;if(r){let J=w===0?0:P*r+1,se=Math.min((P+1)*r,w),ce=[];ce.push(o("button",{key:"prev",style:P===0?_o:dt,onClick:P>0?()=>N(P-1):void 0,disabled:P===0,"aria-label":"Previous page"},"\u2190 Prev"));let me=7,ge=Math.max(0,P-Math.floor(me/2)),ye=Math.min(T,ge+me);ye-ge<me&&(ge=Math.max(0,ye-me)),ge>0&&(ce.push(o("button",{key:"p0",style:dt,onClick:()=>N(0)},"1")),ge>1&&ce.push(o("span",{key:"e1",style:{margin:"0 4px"}},"...")));for(let le=ge;le<ye;le++)ce.push(o("button",{key:`p${le}`,style:le===P?ja:dt,onClick:le!==P?()=>N(le):void 0,"aria-current":le===P?"page":void 0},String(le+1)));ye<T&&(ye<T-1&&ce.push(o("span",{key:"e2",style:{margin:"0 4px"}},"...")),ce.push(o("button",{key:`p${T-1}`,style:dt,onClick:()=>N(T-1)},String(T)))),ce.push(o("button",{key:"next",style:P>=T-1?_o:dt,onClick:P<T-1?()=>N(P+1):void 0,disabled:P>=T-1,"aria-label":"Next page"},"Next \u2192")),Y=o("div",{style:Ua},o("span",null,`Showing ${J}\u2013${se} of ${w}`),o("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},...ce))}let X={width:"100%",...b?{overflow:"auto",maxHeight:"600px"}:{}},U={...Oa,...m?{border:"1px solid #e5e7eb"}:{}},Z=o("thead",null,o("tr",null,...Q),G),ee=o("tbody",null,...O),ae=o("table",{style:U,role:"grid","aria-rowcount":String(w)},Z,ee);return o("div",{style:X},ae,Y)}function ut(e){return e<10?`0${e}`:String(e)}function Xa(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 Ka(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 qa={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"},Za={fontSize:"2rem",fontWeight:"600",letterSpacing:"2px",lineHeight:"1"},Ja={fontSize:"0.875rem",fontWeight:"400",marginLeft:"4px",verticalAlign:"super"},Qa={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 g=setInterval(()=>{d(new Date)},1e3);return()=>clearInterval(g)},[]);let{hours:u,minutes:h,seconds:p}=Xa(l,s),c,m=null;t==="12h"?(m=u>=12?"PM":"AM",c=u%12||12):c=u;let f=`${ut(c)}:${ut(h)}`;i&&(f+=`:${ut(p)}`);let b=[f];m!=null&&b.push(o("span",{style:Ja},m));let y=[o("span",{style:Za},...b)];return n&&y.push(o("span",{style:Qa},Ka(l,r,s))),o("div",{style:qa,...a?{class:a}:{}},...y)}var el={listStyle:"none",margin:"0",padding:"0",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px"},tl={padding:"10px 14px",color:"var(--color-text, #1f2937)"},nl={borderBottom:"1px solid var(--color-border, #e5e7eb)"},ol={cursor:"pointer",transition:"background-color 0.15s ease"},rl={backgroundColor:"var(--color-bg-muted, #eff6ff)"},il={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 Vo(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:il},d),h?o("div",{style:{...Ut,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},h):null);let p=[];for(let c=0;c<t.length;c++){let m=t[c],f=r(m,c),b=a===c,y=c===t.length-1,g={...tl,...s?ol:{},...b?rl:{},...i&&!y?nl:{}};p.push(o("li",{key:f,style:g,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(b):void 0},n(m,c)))}return o("div",null,u?o("div",{style:Ut},u):null,o("ul",{style:el,role:l?"listbox":"list"},...p),h?o("div",{style:{...Ut,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},h):null)}function sl(e){return e??"#3b82f6"}function al(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 ll={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 cl(e,t,n,r,i){let s=ll[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:al(e,.12),color:e,border:"none"};default:return a}}var dl={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 Uo(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=sl(n),p=cl(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:dl,onClick:m=>{m.stopPropagation(),!u&&a&&a()},"aria-label":`Remove ${t}`,disabled:u},"\xD7")),o("span",{style:p,role:d?"button":void 0,tabIndex:d&&!u?"0":void 0,onClick:!u&&d?d:void 0,onKeyDown:d&&!u?m=>{let f=m.key;(f==="Enter"||f===" ")&&(m.preventDefault(),d())}:void 0,"aria-disabled":u?"true":void 0},...c)}var ul={overflow:"auto",position:"relative",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'};function jo(e){let{items:t,renderItem:n,itemHeight:r,overscan:i=5,height:s}=e,[a,l]=j(0),d=te(null),u=t.length*r,h=parseInt(s,10)||400,p=Math.ceil(h/r),c=Math.max(0,Math.floor(a/r)-i),m=Math.min(t.length,Math.floor(a/r)+p+i),f=S(y=>{let g=y.target;l(g.scrollTop)},[]),b=[];for(let y=c;y<m;y++)b.push(o("div",{key:String(y),style:{position:"absolute",top:`${y*r}px`,left:"0",right:"0",height:`${r}px`,overflow:"hidden"}},n(t[y],y)));return o("div",{ref:d,style:{...ul,height:s},onScroll:f},o("div",{style:{height:`${u}px`,position:"relative",width:"100%"}},...b))}var Go={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 Xo(e){let[t,n]=j(!0),r=e.type??"info",i=e.variant??"subtle",s=Go[r]??Go.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 Ko(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 qo(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=Ee().replace(/[^a-zA-Z0-9_-]/g,"");if(l==="circular"){let m=typeof e.size=="number"?e.size:48,f=Math.max(2,Math.round(m/10)),b=(m-f)/2,y=2*Math.PI*b,g=e.indeterminate?y*.75:y-r/100*y,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(m),height:String(m),viewBox:`0 0 ${m} ${m}`,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(m/2),cy:String(m/2),r:String(b),fill:"none",stroke:s,"stroke-width":String(f)}),o("circle",{cx:String(m/2),cy:String(m/2),r:String(b),fill:"none",stroke:i,"stroke-width":String(f),"stroke-dasharray":String(y),"stroke-dashoffset":String(g),"stroke-linecap":"round",transform:`rotate(-90 ${m/2} ${m/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%}}`:"",p={width:"100%",height:a,backgroundColor:s,borderRadius:a,overflow:"hidden",position:"relative"},c=q(()=>{let m={height:"100%",borderRadius:a,transition:"width 0.3s ease"};return e.indeterminate?(m.position="absolute",m.animation=`liq-indeterminate-${d} 1.5s ease-in-out infinite`,m.backgroundColor=i):(m.width=`${r}%`,m.backgroundColor=i),e.animated&&!e.indeterminate&&(m.backgroundImage=`linear-gradient(90deg, ${i} 0%, ${pl(i)} 50%, ${i} 100%)`,m.backgroundSize="200% 100%",m.animation=`liq-shimmer-${d} 1.5s ease-in-out infinite`),m},[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:p},o("div",{style:c})))}function pl(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 Zo(e){let t=e.variant??"text",n=e.animated!==!1,r=Ee().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:Fn({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:Fn({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:Fn({width:s??"100%",height:a??"100px",borderRadius:e.borderRadius??"4px",animated:n,animId:r})}))}function Fn(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 fl={sm:16,md:24,lg:40},Jo={slow:"1.2s",normal:"0.75s",fast:"0.45s"};function Qo(e){let t=typeof e.size=="number"?e.size:fl[e.size??"md"]??24,n=e.color??"#3b82f6",r=e.thickness??Math.max(2,Math.round(t/8)),i=Jo[e.speed??"normal"]??Jo.normal,s=e.label??"Loading",l=Ee().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 Pe(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 Ve(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 ml={sm:{box:14,icon:10,fontSize:"12px"},md:{box:18,icon:12,fontSize:"14px"},lg:{box:22,icon:16,fontSize:"16px"}};function er(e){let t=Ee().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=te(null);re(()=>{h.current&&(h.current.indeterminate=a)},[a]);let p=S(()=>{l||i(!r)},[l,r,i]),c=S(A=>{l||(A.key===" "||A.key==="Enter")&&(A.preventDefault(),i(!r))},[l,r,i]),m=ml[u],f=`${m.box}px`,b=d?"#ef4444":r||a?"#3b82f6":"#d1d5db",y=r||a?"#3b82f6":"#ffffff",g={width:f,height:f,minWidth:f,borderRadius:"4px",border:`2px solid ${b}`,backgroundColor:y,display:"flex",alignItems:"center",justifyContent:"center",cursor:l?"not-allowed":"pointer",transition:"all 0.15s",boxSizing:"border-box"},x={color:"#ffffff",fontSize:`${m.icon}px`,lineHeight:"1",fontWeight:"700"},v=a?o("span",{style:x},"\u2014"):r?o("span",{style:x},"\u2713"):null,R={display:"inline-flex",alignItems:"center",gap:"8px",cursor:l?"not-allowed":"pointer",opacity:l?"0.6":"1",userSelect:"none"},D=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:g},v),$=s?o("span",{style:{fontSize:m.fontSize,color:"#374151"}},s):null;return o(Pe,{error:d,htmlFor:n},o("div",{style:R,onClick:p,onKeyDown:c,tabIndex:l?-1:0,role:"checkbox","aria-checked":a?"mixed":r?"true":"false","aria-disabled":l?"true":void 0,"aria-label":s},D,M,$))}var gl=["#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 tr(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 nr(e){let t=Ee().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,presets:s=gl,showInput:a=!0,showAlpha:l=!1,disabled:d=!1,label:u}=e,[h,p]=j(!1),[c,m]=j(r),f=te(null);re(()=>{m(r)},[r]),re(()=>{let I=P=>{f.current&&!f.current.contains(P.target)&&p(!1)};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[]);let b=S(I=>{d||i(jt(I))},[d,i]),y=S(I=>{let P=I.target.value;m(P);let L=P.startsWith("#")?P:`#${P}`;tr(L)&&i(jt(L))},[i]),g=S(()=>{tr(c.startsWith("#")?c:`#${c}`)||m(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"},R={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"},D={display:"grid",gridTemplateColumns:"repeat(10, 1fr)",gap:"4px",marginBottom:a?"8px":"0"},M=s.map(I=>{let P=jt(I)===jt(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:()=>b(I),onKeyDown:E=>{let B=E.key;(B==="Enter"||B===" ")&&(E.preventDefault(),b(I))},role:"button",tabIndex:d?-1:0,title:I,"aria-label":`Select color ${I}`})}),$=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:y,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,A=h?o("div",{style:R},o("div",{style:D},...M),$):null;return o(Pe,{label:u,disabled:d,htmlFor:n},o("div",{ref:f,style:{position:"relative"}},o("div",{style:v,onClick:d?void 0:()=>p(!h),onKeyDown:d?void 0:I=>{let P=I.key;(P==="Enter"||P===" ")&&(I.preventDefault(),p(!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),A))}function or(e){let t=Ee().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),p=te(null),c=S(((...y)=>{let x=y[0].target.value;h(x),i?.(x)}),[i]),m={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(Pe,{label:d,htmlFor:n},o("div",{style:m},o("div",{style:f},o("input",{id:n,ref:p,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 rr=["January","February","March","April","May","June","July","August","September","October","November","December"],hl=["Su","Mo","Tu","We","Th","Fr","Sa"];function Nn(e){if(!e)return null;if(e instanceof Date)return e;let t=new Date(e);return isNaN(t.getTime())?null:t}function bl(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 ir(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function xl(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function sr(e){let t=Ee().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:p}=e,c=q(()=>Nn(r),[r]),m=q(()=>Nn(a),[a]),f=q(()=>Nn(l),[l]),[b,y]=j(!1),[g,x]=j(()=>c?c.getFullYear():new Date().getFullYear()),[v,R]=j(()=>c?c.getMonth():new Date().getMonth()),D=te(null),M=q(()=>new Date,[]);re(()=>{let F=_=>{D.current&&!D.current.contains(_.target)&&y(!1)};return document.addEventListener("mousedown",F),()=>document.removeEventListener("mousedown",F)},[]);let $=S(()=>{R(F=>F===0?(x(_=>_-1),11):F-1)},[]),A=S(()=>{R(F=>F===11?(x(_=>_+1),0):F+1)},[]),I=S(F=>{let _=new Date(g,v,F);m&&_<m||f&&_>f||(i(xl(_)),y(!1))},[g,v,i,m,f]),P=c?bl(c,s):"",L=q(()=>{let F=new Date(g,v,1).getDay(),_=new Date(g,v+1,0).getDate(),H=[],W=[];for(let V=0;V<F;V++)W.push(null);for(let V=1;V<=_;V++)W.push(V),W.length===7&&(H.push(W),W=[]);for(;W.length>0&&W.length<7;)W.push(null);return W.length&&H.push(W),H},[g,v]),E={...Ve({},{focused:b,error:!!p}),cursor:d?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",minHeight:"38px",userSelect:"none"},B={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"},T=hl.map(F=>o("div",{key:F,style:{padding:"4px"}},F)),C=L.map((F,_)=>{let H=F.map((W,V)=>{if(W===null)return o("div",{key:`empty-${_}-${V}`,style:{padding:"4px"}});let K=new Date(g,v,W),Q=ir(K,M),G=c?ir(K,c):!1,O=m&&K<m||f&&K>f,Y={padding:"4px",textAlign:"center",cursor:O?"not-allowed":"pointer",borderRadius:"4px",fontSize:"13px",fontWeight:Q?"700":"400",backgroundColor:G?"#3b82f6":"transparent",color:G?"#ffffff":O?"#d1d5db":Q?"#3b82f6":"#1f2937",border:Q&&!G?"1px solid #3b82f6":"1px solid transparent",lineHeight:"1.8"};return o("div",{key:`day-${W}`,style:Y,onClick:O?void 0:()=>I(W),onKeyDown:O?void 0:X=>{let U=X.key;(U==="Enter"||U===" ")&&(X.preventDefault(),I(W))},role:O?void 0:"button",tabIndex:O?void 0:0,"aria-label":`${rr[v]} ${W}, ${g}`,"aria-disabled":O?"true":void 0},String(W))});return o("div",{key:`row-${_}`,style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)"}},...H)}),N=b?o("div",{style:B},o("div",{style:z},o("button",{type:"button",style:k,onClick:$},"\u25C0"),o("span",{style:{fontWeight:"600",fontSize:"14px",color:"#1f2937"}},`${rr[v]} ${g}`),o("button",{type:"button",style:k,onClick:A},"\u25B6")),o("div",{style:w},...T),...C):null;return o(Pe,{label:h,error:p,disabled:d,htmlFor:n},o("div",{ref:D,style:{position:"relative"}},o("div",{id:n,style:E,onClick:d?void 0:()=>y(!b),onKeyDown:d?void 0:F=>{let _=F.key;(_==="Enter"||_===" ")&&(F.preventDefault(),y(!b))},tabIndex:d?-1:0,role:"button","aria-label":"Pick a date","aria-expanded":b?"true":"false"},o("span",{style:{color:P?"#1f2937":"#9ca3af"}},P||u),o("span",{style:{color:"#6b7280",fontSize:"14px"}},"\u{1F4C5}")),N))}function Wn(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 ar(e){let t=Ee().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,p]=j([]),[c,m]=j(!1),[f,b]=j(""),y=te(null),g=S(k=>{b("");let w=[];for(let C of k){if(a&&C.size>a){b(`File "${C.name}" exceeds maximum size of ${Wn(a)}`);continue}w.push(C)}let T=s?[...h,...w]:w.slice(0,1);p(T),r(T)},[h,s,a,r]),x=S(k=>{if(k.preventDefault(),k.stopPropagation(),m(!1),l)return;let w=k.dataTransfer;if(!w)return;let T=Array.from(w.files);g(T)},[l,g]),v=S(k=>{k.preventDefault(),k.stopPropagation(),l||m(!0)},[l]),R=S(k=>{k.preventDefault(),k.stopPropagation(),m(!1)},[]),D=S(k=>{let w=k.target;w.files&&(g(Array.from(w.files)),w.value="")},[g]),M=S(k=>{let w=h.filter((T,C)=>C!==k);p(w),r(w)},[h,r]),$=S(()=>{l||y.current&&y.current.click()},[l]),A={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"},L={fontSize:"12px",color:"#9ca3af"},E=o("input",{id:n,ref:y,type:"file",accept:i,multiple:s,onChange:D,disabled:l,style:{display:"none"},tabIndex:-1}),B=o("div",{style:A,onClick:$,onKeyDown:k=>{let w=k.key;(w==="Enter"||w===" ")&&(k.preventDefault(),$())},onDrop:x,onDragOver:v,onDragLeave:R,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:L},i):null,a?o("div",{style:L},`Max size: ${Wn(a)}`):null),z=h.length>0?o("div",{style:{marginTop:"8px",display:"flex",flexDirection:"column",gap:"4px"}},...h.map((k,w)=>{let T={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:T},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"}},Wn(k.size))),o("button",{type:"button",style:C,onClick:N=>{N.stopPropagation(),M(w)},"aria-label":`Remove ${k.name}`},"\u2715"))})):null;return o(Pe,{label:d,helpText:u,error:f||void 0,disabled:l,htmlFor:n},o("div",null,E,B,z))}function lr(e){let[t,n]=j(!1),[r,i]=j((e.value??e.defaultValue??"").length),s=Ee().replace(/[^a-zA-Z0-9_-]/g,""),a=e.id??`ml-${s}`,d={...Ve(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 m=c.target,f=m.value;i(f.length),e.onChange&&e.onChange(f),e.autoResize&&(m.style.height="auto",m.style.height=`${m.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}),p=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(Pe,{label:e.label,htmlFor:a,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},h,p)}function cr(e){let t=Ee().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:p,error:c}=e,[m,f]=j(!1),b=S(w=>{let T=w;return s!==void 0&&T<s&&(T=s),a!==void 0&&T>a&&(T=a),T},[s,a]),y=S(()=>{d||i(b(r+l))},[d,r,l,b,i]),g=S(()=>{d||i(b(r-l))},[d,r,l,b,i]),x=S(w=>{let T=w.target.value;if(T===""||T==="-")return;let C=parseFloat(T);isNaN(C)||i(b(C))},[b,i]),v=S(w=>{d||(w.key==="ArrowUp"?(w.preventDefault(),y()):w.key==="ArrowDown"&&(w.preventDefault(),g()))},[d,y,g]),R=s===void 0||r>s,D=a===void 0||r<a,M={display:"inline-flex",alignItems:"stretch",borderRadius:"6px",overflow:"hidden",border:`1px solid ${c?"#ef4444":m?"#3b82f6":"var(--color-border, #d1d5db)"}`,transition:"border-color 0.15s",opacity:d?"0.6":"1",...m&&!c?{boxShadow:"0 0 0 3px #3b82f622"}:{}},$=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"}),A={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:$(R),onClick:g,disabled:d,"aria-label":"Decrement",tabIndex:-1},"\u2212"),L=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:A,"aria-label":p||"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}),B=h?o("span",{style:I},h):null,z=o("button",{type:"button",style:$(D),onClick:y,disabled:d,"aria-label":"Increment",tabIndex:-1},"+"),k=[P];return L&&k.push(L),k.push(E),B&&k.push(B),k.push(z),o(Pe,{label:p,error:c,disabled:d,htmlFor:n},o("div",{style:M},...k))}function dr(e){let t=Ee().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,p=S(b=>{d||s(b)},[d,s]),c=S(b=>{if(d)return;let y=r.filter(v=>!v.disabled);if(y.length===0)return;let g=y.findIndex(v=>v.value===i),x=g;if(b.key==="ArrowDown"||b.key==="ArrowRight")b.preventDefault(),x=g<y.length-1?g+1:0;else if(b.key==="ArrowUp"||b.key==="ArrowLeft")b.preventDefault(),x=g>0?g-1:y.length-1;else return;s(y[x].value)},[d,r,i,s]),m={display:"flex",flexDirection:l==="horizontal"?"row":"column",gap:l==="horizontal"?"16px":"8px"},f=r.map((b,y)=>{let g=b.value===i,x=d||!!b.disabled,v=`${n}-opt-${y}`,R={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"},D={width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"#3b82f6",transition:"transform 0.15s",transform:g?"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:b.value,htmlFor:v,style:M,onClick:x?void 0:$=>{$.preventDefault(),p(b.value)}},o("input",{type:"radio",id:v,name:a,value:b.value,checked:g,disabled:x,style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},tabIndex:-1}),o("div",{style:R},o("div",{style:D})),o("span",{style:{fontSize:"14px",color:"#374151"}},b.label))});return o(Pe,{label:h,error:u,htmlFor:`${n}-opt-0`},o("div",{id:n,style:m,role:"radiogroup","aria-label":h,onKeyDown:c,tabIndex:d?-1:0},...f))}function ur(e){let t=Ee().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:p,label:c,helpText:m,creatable:f=!1,onCreate:b,createLabel:y="+ Create new..."}=e,[g,x]=j(!1),[v,R]=j(""),[D,M]=j(-1),[$,A]=j(!1),[I,P]=j(""),L=te(null),E=q(()=>Array.isArray(i)?i:i?[i]:[],[i]),B=q(()=>{if(!l||!v)return r;let G=v.toLowerCase();return r.filter(O=>O.label.toLowerCase().includes(G))},[r,v,l]),z=q(()=>{let G={},O=[];for(let Y of B)Y.group?(G[Y.group]||(G[Y.group]=[]),G[Y.group].push(Y)):O.push(Y);return{groups:G,ungrouped:O}},[B]),k=q(()=>E.length===0?"":E.map(O=>r.find(Y=>Y.value===O)).filter(Boolean).map(O=>O.label).join(", "),[E,r]);re(()=>{let G=O=>{let Y=O.target;L.current&&!L.current.contains(Y)&&(x(!1),R(""),A(!1),P(""))};return document.addEventListener("mousedown",G),()=>document.removeEventListener("mousedown",G)},[]);let w=S(G=>{if(d){let O=E.includes(G)?E.filter(Y=>Y!==G):[...E,G];s(O)}else s(G),x(!1),R("")},[d,E,s]),T=S(G=>{G.stopPropagation(),s(d?[]:"")},[d,s]),C=S(G=>{if(h)return;let O=G.key;if(!g&&(O==="Enter"||O===" "||O==="ArrowDown")){G.preventDefault(),x(!0),M(0);return}if(g){if(O==="Escape"){x(!1),R("");return}if(O==="ArrowDown")G.preventDefault(),M(Y=>Math.min(Y+1,B.length-1));else if(O==="ArrowUp")G.preventDefault(),M(Y=>Math.max(Y-1,0));else if(O==="Enter"&&D>=0&&D<B.length){G.preventDefault();let Y=B[D];Y.disabled||w(Y.value)}}},[h,g,D,B,w]),N={...Ve({},{focused:g,error:!!p}),display:"flex",alignItems:"center",justifyContent:"space-between",cursor:h?"not-allowed":"pointer",minHeight:"38px",userSelect:"none"},F={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"},_=(G,O)=>{let Y=E.includes(G.value),X=O===D,U={padding:"8px 12px",cursor:G.disabled?"not-allowed":"pointer",backgroundColor:X?"#f3f4f6":Y?"#eff6ff":"transparent",color:G.disabled?"#9ca3af":"#1f2937",display:"flex",alignItems:"center",gap:"8px",fontSize:"14px"};return o("div",{key:G.value,style:U,onClick:G.disabled?void 0:()=>w(G.value),onMouseEnter:()=>M(O),role:"option","aria-selected":Y?"true":"false","aria-disabled":G.disabled?"true":void 0},d&&Y?o("span",{style:{color:"#3b82f6",fontWeight:"700"}},"\u2713"):null,G.label)},H=()=>{let G=[],O=0,{groups:Y,ungrouped:X}=z;for(let U of X)G.push(_(U,O++));for(let U of Object.keys(Y)){G.push(o("div",{key:`group-${U}`,style:{padding:"6px 12px",fontSize:"11px",fontWeight:"600",color:"#6b7280",textTransform:"uppercase",letterSpacing:"0.05em"}},U));for(let Z of Y[U])G.push(_(Z,O++))}return G.length===0&&!f&&G.push(o("div",{style:{padding:"8px 12px",color:"#9ca3af",fontSize:"14px"}},"No options")),f&&($?G.push(o("div",{key:"__create-input__",style:{padding:"4px 8px",borderTop:G.length>0?"1px solid #e5e7eb":"none"}},o("input",{type:"text",value:I,placeholder:"Type new value...",autoFocus:!0,onInput:U=>{P(U.target.value)},onKeyDown:U=>{let Z=U.key;if(Z==="Enter"){U.preventDefault();let ee=I.trim();ee&&(b&&b(ee),d||(s(ee),x(!1)),P(""),A(!1))}else Z==="Escape"&&(P(""),A(!1))},style:{width:"100%",boxSizing:"border-box",padding:"6px 8px",border:"1px solid #d1d5db",borderRadius:"4px",outline:"none",fontSize:"14px"}}))):G.push(o("div",{key:"__create-new__",style:{padding:"8px 12px",cursor:"pointer",color:"#3b82f6",fontSize:"14px",borderTop:G.length>0?"1px solid #e5e7eb":"none"},onClick:()=>{A(!0),P("")},role:"option","aria-label":"Create new option"},y))),G},W=o("span",{style:{marginLeft:"8px",fontSize:"10px",transition:"transform 0.15s",transform:g?"rotate(180deg)":"rotate(0deg)",color:"#6b7280"}},"\u25BC"),V=o("div",{style:N,id:n,onClick:h?void 0:()=>{x(!g),M(-1)},onKeyDown:C,tabIndex:h?-1:0,role:"combobox","aria-expanded":g?"true":"false","aria-haspopup":"listbox"},o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:k?"#1f2937":"#9ca3af"}},k||a),o("span",{style:{display:"flex",alignItems:"center",gap:"4px"}},u&&E.length>0?o("span",{onClick:T,onKeyDown:G=>{let O=G.key;(O==="Enter"||O===" ")&&(G.preventDefault(),G.stopPropagation(),T(G))},style:{cursor:"pointer",color:"#9ca3af",fontSize:"14px",lineHeight:"1"},role:"button",tabIndex:0,"aria-label":"Clear selection"},"\u2715"):null,W)),K=l&&g?o("input",{type:"text",value:v,onInput:G=>{R(G.target.value),M(0)},placeholder:"Search...",style:{width:"100%",boxSizing:"border-box",padding:"8px 12px",border:"none",borderBottom:"1px solid #e5e7eb",outline:"none",fontSize:"14px"}}):null,Q=g?o("div",{style:F,role:"listbox"},K,...H()):null;return o(Pe,{label:c,error:p,helpText:m,disabled:h,htmlFor:n},o("div",{ref:L,style:{position:"relative"}},V,Q))}function pr(e){let t=Ee().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:p,range:c=!1,label:m,error:f}=e,b=te(null),y=te(i);y.current=i;let[g,x]=j(null),v=q(()=>{if(c&&Array.isArray(r))return r;let _=typeof r=="number"?r:0;return[_,_]},[r,c]),R=te(v);R.current=v;let D=_=>{let H=Math.round((_-s)/l)*l+s;return Math.max(s,Math.min(a,H))},M=_=>(_-s)/(a-s)*100,$=S(_=>{if(!b.current)return s;let H=b.current.getBoundingClientRect(),W=Math.max(0,Math.min(1,(_.clientX-H.left)/H.width));return D(s+W*(a-s))},[s,a,l]),A=S(_=>H=>{h||(H.preventDefault(),x(_))},[h]),I=S(_=>{if(h)return;let H=$(_);if(c){let W=Math.abs(H-v[0]),V=Math.abs(H-v[1]);W<=V?i([D(H),v[1]]):i([v[0],D(H)])}else i(D(H))},[h,$,c,v,i,s,a,l]);re(()=>{if(!g)return;let _=W=>{let V=$(W),K=R.current,Q=y.current;g==="single"?Q(D(V)):g==="start"?Q([Math.min(D(V),K[1]),K[1]]):g==="end"&&Q([K[0],Math.max(K[0],D(V))])},H=()=>x(null);return document.addEventListener("mousemove",_),document.addEventListener("mouseup",H),()=>{document.removeEventListener("mousemove",_),document.removeEventListener("mouseup",H)}},[g,$,s,a,l]);let P=S(_=>{if(h)return;let H=0;if(_.key==="ArrowRight"||_.key==="ArrowUp")H=l;else if(_.key==="ArrowLeft"||_.key==="ArrowDown")H=-l;else return;_.preventDefault(),c||i(D((typeof r=="number"?r:0)+H))},[h,l,c,r,i,s,a]),L={position:"relative",width:"100%",height:"6px",backgroundColor:"#e5e7eb",borderRadius:"3px",cursor:h?"not-allowed":"pointer"},E=c?M(v[0]):0,B=M(c?v[1]:v[0]),z={position:"absolute",top:"0",left:`${E}%`,width:`${B-E}%`,height:"100%",backgroundColor:h?"#9ca3af":"#3b82f6",borderRadius:"3px"},k=_=>m?_==="start"?`${m} minimum`:_==="end"?`${m} maximum`:m:_==="start"?"Minimum value":_==="end"?"Maximum value":"Value",w=(_,H,W)=>{let V={position:"absolute",top:"50%",left:`${_}%`,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:H==="single"||H==="start"?n:void 0,style:V,onMouseDown:A(H),role:"slider","aria-valuenow":String(W),"aria-valuemin":String(s),"aria-valuemax":String(a),"aria-label":k(H),tabIndex:h?-1:0,onKeyDown:P},d?o("div",{style:K},String(W)):null)},T=[];if(u)for(let _=s;_<=a;_+=l)T.push(o("div",{key:`tick-${_}`,style:{position:"absolute",top:"10px",left:`${M(_)}%`,width:"1px",height:"6px",backgroundColor:"#d1d5db",transform:"translateX(-50%)"}}));let C=[];if(p)for(let _ of p)C.push(o("div",{key:`mark-${_.value}`,style:{position:"absolute",top:"18px",left:`${M(_.value)}%`,transform:"translateX(-50%)",fontSize:"11px",color:"#6b7280",whiteSpace:"nowrap"}},_.label));let N={paddingTop:d?"28px":"8px",paddingBottom:p||u?"28px":"8px",opacity:h?"0.6":"1"},F=[];return c?(F.push(w(M(v[0]),"start",v[0])),F.push(w(M(v[1]),"end",v[1]))):F.push(w(M(v[0]),"single",v[0])),o(Pe,{label:m,error:f,htmlFor:n},o("div",{style:N},o("div",{ref:b,style:L,role:"presentation",onClick:I},o("div",{style:z}),...F,...T,...C)))}var yl=["bold","italic","underline","strikethrough","heading1","heading2","bulletList","orderedList","blockquote","link","unlink","insertHR","removeFormat","undo","redo"],Sl={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"}},vl=new Set(["p","br","b","strong","i","em","u","s","strike","del","sub","sup","h1","h2","h3","h4","h5","h6","ul","ol","li","blockquote","pre","code","a","img","span","div","table","thead","tbody","tr","th","td","hr","abbr","mark","small","figure","figcaption"]),wl=new Set(["href","src","alt","title","width","height","class","id","style","colspan","rowspan","scope","target","rel"]),fr=/^\s*(javascript|vbscript|data\s*:(?!image\/))/i;function kl(e){if(typeof document>"u")return"";let t=document.createElement("div");t.innerHTML=e;let n=[];for(let r=t.childNodes.length-1;r>=0;r--)n.push(t.childNodes[r]);for(;n.length>0;){let r=n.pop();if(r.nodeType===3)continue;if(r.nodeType!==1){r.parentNode?.removeChild(r);continue}let i=r,s=i.tagName.toLowerCase();if(!vl.has(s)){let h=i.parentNode;if(h){for(;i.firstChild;)h.insertBefore(i.firstChild,i);let p=h.firstChild,c=[];for(;p;)p!==i&&c.push(p),p=p.nextSibling;h.removeChild(i);for(let m=c.length-1;m>=0;m--)n.push(c[m])}continue}let a=i.attributes,l=[];for(let h=0;h<a.length;h++){let p=a[h].name.toLowerCase();p.startsWith("on")?l.push(a[h].name):wl.has(p)||l.push(a[h].name)}for(let h of l)i.removeAttribute(h);let d=i.getAttribute("href");d&&fr.test(d)&&i.removeAttribute("href");let u=i.getAttribute("src");u&&fr.test(u)&&i.removeAttribute("src");for(let h=i.childNodes.length-1;h>=0;h--)n.push(i.childNodes[h])}return t.innerHTML}function mr(e){let[t,n]=j(!1),r=te(null),i=Ee().replace(/[^a-zA-Z0-9_-]/g,""),s=e.id??i,a=e.toolbar??yl,l=e.toolbarStyle??{},d=e.editorStyle??{};re(()=>{r.current&&e.value!==void 0&&(r.current.innerHTML=kl(e.value))},[]);let u=S((f,b)=>{if(!(e.disabled||e.readOnly)){if(f==="createLink"){let y=prompt("Enter URL:");if(!y||/^(javascript|vbscript|data:text\/html)/i.test(y.trim()))return;document.execCommand(f,!1,y)}else b&&f==="formatBlock"?document.execCommand(f,!1,`<${b}>`):document.execCommand(f,!1,b);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]),p=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 b=Sl[f];return b?o("button",{key:f,type:"button",title:b.label,onClick:()=>u(b.command,b.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"}},b.icon):null})),m=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:p,onInput:h});return o(Pe,{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,m))}function gr(e){let[t,n]=j(!1),r=Ee().replace(/[^a-zA-Z0-9_-]/g,""),i=e.id??`tf-${r}`,s=Ve(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(Pe,{label:e.label,htmlFor:i,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},d)}var Cl=["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 Ml(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 hr(e){let t=Ee().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:p,showTimezone:c=!1,timezones:m=Cl,onTimezoneChange:f}=e,[b,y]=j(!1),g=q(()=>Ml(r),[r]),x=s==="12h",v=g.hour>=12,R=x?g.hour%12||12:g.hour,D=S((Y,X,U)=>{let Z=Math.max(0,Math.min(23,Y)),ee=Math.max(0,Math.min(59,X)),ae=Math.max(0,Math.min(59,U??0));i(h?`${rt(Z)}:${rt(ee)}:${rt(ae)}`:`${rt(Z)}:${rt(ee)}`)},[i,h]),M=S(Y=>{let X=parseInt(Y.target.value,10)||0;x&&(X=X%12,v&&(X+=12)),D(X,g.minute,g.second)},[x,v,g.minute,g.second,D]),$=S(Y=>{let X=parseInt(Y.target.value,10)||0;D(g.hour,X,g.second)},[g.hour,g.second,D]),A=S(Y=>{let X=parseInt(Y.target.value,10)||0;D(g.hour,g.minute,X)},[g.hour,g.minute,D]),I=S(()=>{if(l)return;let Y=v?g.hour-12:g.hour+12;D(Y,g.minute,g.second)},[l,v,g.hour,g.minute,g.second,D]),P=S(Y=>{l||D(g.hour+Y,g.minute,g.second)},[l,g.hour,g.minute,g.second,D]),L=S(Y=>{l||D(g.hour,g.minute+Y*a,g.second)},[l,g.hour,g.minute,g.second,a,D]),E=S(Y=>{l||D(g.hour,g.minute,g.second+Y)},[l,g.hour,g.minute,g.second,D]),B=S(Y=>{let X=Y.target.value;f&&f(X)},[f]),z={display:"inline-flex",alignItems:"center",gap:"4px",...Ve({},{focused:b,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"},T={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"},N=o("div",{style:k},o("button",{type:"button",style:w,onClick:()=>P(1),disabled:l},"\u25B2"),o("input",{type:"text",value:rt(R),onChange:M,style:T,disabled:l,"aria-label":"Hour",onFocus:()=>y(!0),onBlur:()=>y(!1)}),o("button",{type:"button",style:w,onClick:()=>P(-1),disabled:l},"\u25BC")),F=o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"),_=o("div",{style:k},o("button",{type:"button",style:w,onClick:()=>L(1),disabled:l},"\u25B2"),o("input",{type:"text",value:rt(g.minute),onChange:$,style:T,disabled:l,"aria-label":"Minute",onFocus:()=>y(!0),onBlur:()=>y(!1)}),o("button",{type:"button",style:w,onClick:()=>L(-1),disabled:l},"\u25BC")),H=h?o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"):null,W=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:A,style:T,disabled:l,"aria-label":"Second",onFocus:()=>y(!0),onBlur:()=>y(!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,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=p&&!c?o("span",{style:{marginLeft:"8px",fontSize:"12px",fontWeight:"600",color:"#6b7280"}},p):null,G=c?o("select",{style:K,value:p??m[0],onChange:B,disabled:l,"aria-label":"Timezone"},...m.map(Y=>o("option",{key:Y,value:Y},Y))):null,O=[N,F,_];return H&&O.push(H),W&&O.push(W),V&&O.push(V),Q&&O.push(Q),G&&O.push(G),o(Pe,{label:d,error:u,disabled:l,htmlFor:n},o("div",{id:n,style:z},...O))}var El={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 br(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=El[a],h=S(()=>{s||n(!t)},[s,t,n]),p=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"},m=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:`${m}px`,transition:"left 0.2s",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"},b={display:"inline-flex",alignItems:"center",gap:"8px",opacity:s?"0.5":"1",userSelect:"none"},y=r?o("span",{style:{fontSize:"14px",color:"#374151"}},r):null,g=o("div",{style:c},o("div",{style:f}));return o("div",{style:b,onClick:h,onKeyDown:p,tabIndex:s?-1:0,role:"switch","aria-checked":t?"true":"false","aria-disabled":s?"true":void 0,"aria-label":r},...(i==="left"?[y,g]:[g,y]).filter(Boolean))}var xr={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 yr(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=xr[n]??xr.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 Sr(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 vr(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 wr(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 kr(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 Cr={none:"none",sm:"0 1px 3px rgba(0,0,0,0.12)",md:"0 4px 6px rgba(0,0,0,0.1)"};function Mr(e){let t=e.bordered!==!1,n=e.shadow??"none",[r,i]=j(!!e.defaultCollapsed),s=te(null),[a,l]=j("auto");re(()=>{if(!e.collapsible)return;let b=s.current;b&&l(`${b.scrollHeight}px`)},[e.children,e.collapsible]);let d=S(()=>{e.collapsible&&i(b=>!b)},[e.collapsible]),u=S(b=>{if(!e.collapsible)return;let y=b.key;(y==="Enter"||y===" ")&&(b.preventDefault(),d())},[e.collapsible,d]),h=q(()=>{let b={borderRadius:"6px",overflow:"hidden",backgroundColor:"#ffffff"};return t&&(b.border="1px solid #e5e7eb"),b.boxShadow=Cr[n]??Cr.none,{...b,...e.style??{}}},[t,n,e.style]),p={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"},m={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:p,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?m:{},ref:s},o("div",{className:"panel__body",style:f},e.children)))}function Er(e,t){return e==="both"?"auto":e==="horizontal"?t==="x"?"auto":"hidden":t==="y"?"auto":"hidden"}function Il(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 Ir(e){let t=e.direction??"vertical",n=e.showScrollbar??"auto",r=e.shadow??!1,i=te(null),[s,a]=j(!0),[l,d]=j(!1),[u,h]=j(!0),[p,c]=j(!1),m=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(()=>{m()},[m]);let f=S(()=>{r&&m()},[r,m]),b=q(()=>{let x={position:"relative",overflowX:Er(t,"x"),overflowY:Er(t,"y"),...Il(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]),y=[];if(r){let x=t==="vertical"||t==="both",v=t==="horizontal"||t==="both";x&&!s&&y.push("inset 0 8px 6px -6px rgba(0,0,0,0.15)"),x&&!l&&y.push("inset 0 -8px 6px -6px rgba(0,0,0,0.15)"),v&&!u&&y.push("inset 8px 0 6px -6px rgba(0,0,0,0.15)"),v&&!p&&y.push("inset -8px 0 6px -6px rgba(0,0,0,0.15)")}let g={...b};return y.length>0&&(g.boxShadow=y.join(", ")),o("div",{className:`scroll-container scroll-container--${t} ${e.className??""}`.trim(),style:g,ref:i,onScroll:f},e.children)}function Rr(e){let t=e.direction??"horizontal",n=t==="horizontal",r=e.dividerSize??6,i=e.minSize??50,[s,a]=j(e.initialSplit??50),l=te(null),d=te(!1),u=S(b=>{b.preventDefault(),d.current=!0,document.body.style.cursor=n?"col-resize":"row-resize",document.body.style.userSelect="none"},[n]);re(()=>{let b=g=>{if(!d.current||!l.current)return;let x=l.current.getBoundingClientRect(),v=n?x.width:x.height,R=n?g.clientX-x.left:g.clientY-x.top;if(v<=0)return;let D=i/v*100,M=e.maxSize?e.maxSize/v*100:100-D,$=R/v*100;$=Math.max(D,Math.min(M,$)),a($)},y=()=>{d.current&&(d.current=!1,document.body.style.cursor="",document.body.style.userSelect="")};return document.addEventListener("mousemove",b),document.addEventListener("mouseup",y),()=>{document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",y)}},[n,i,e.maxSize]);let h=q(()=>({display:"flex",flexDirection:n?"row":"column",width:"100%",height:"100%",overflow:"hidden",...e.style??{}}),[n,e.style]),p=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"},m={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:p},f[0]??null),o("div",{className:"splitter__divider",style:m,onMouseDown:u,onKeyDown:b=>{let y=b.key,g=2;n&&(y==="ArrowLeft"||y==="ArrowRight")?(b.preventDefault(),a(x=>{let v=y==="ArrowRight"?g:-g;return Math.max(5,Math.min(95,x+v))})):!n&&(y==="ArrowUp"||y==="ArrowDown")&&(b.preventDefault(),a(x=>{let v=y==="ArrowDown"?g:-g;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 Pr(e){let t=e.position??"top",n=e.variant??"line",r=e.tabs.find(g=>!g.disabled)?.id??"",[i,s]=j(e.activeTab??r),a=e.activeTab??i,l=te(null),d=S(g=>{s(g),e.onChange&&e.onChange(g)},[e.onChange]),u=S(g=>{let x=e.tabs.filter(A=>!A.disabled),v=x.findIndex(A=>A.id===a);if(v===-1)return;let R=t==="left"||t==="right",D=R?"ArrowUp":"ArrowLeft",M=R?"ArrowDown":"ArrowRight",$=-1;if(g.key===D?$=v>0?v-1:x.length-1:g.key===M?$=v<x.length-1?v+1:0:g.key==="Home"?$=0:g.key==="End"&&($=x.length-1),$>=0){g.preventDefault(),d(x[$].id);let A=l.current;if(A){let P=A.querySelectorAll('[role="tab"]')[e.tabs.indexOf(x[$])];P&&P.focus()}}},[e.tabs,a,t,d]),h=t==="left"||t==="right",p=t==="bottom"||t==="right",c=q(()=>({display:"flex",flexDirection:h?p?"row-reverse":"row":p?"column-reverse":"column",width:"100%",...e.style??{}}),[h,p,e.style]),m={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"},b=e.tabs.find(g=>g.id===a),y=e.tabs.map(g=>{let x=g.id===a,v={padding:"8px 16px",border:"none",background:"none",cursor:g.disabled?"not-allowed":"pointer",opacity:g.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:g.id,role:"tab","aria-selected":String(x),"aria-controls":`tabpanel-${g.id}`,"aria-disabled":g.disabled?"true":void 0,id:`tab-${g.id}`,tabIndex:x?"0":"-1",style:v,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:m,ref:l},...y),o("div",{className:"tabs__panel",role:"tabpanel",id:`tabpanel-${a}`,"aria-labelledby":`tab-${a}`,style:f,tabIndex:"0"},b?b.content:null))}function Tr(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=Ee().replace(/[^a-zA-Z0-9_-]/g,""),[u,h]=j(0),p=te(null),c=te(null),m=S(M=>{let $=M;r?$=(M%n+n)%n:$=Math.max(0,Math.min(M,n-1)),h($),e.onChange&&e.onChange($)},[n,r,e.onChange]),f=S(()=>m(u+1),[u,m]),b=S(()=>m(u-1),[u,m]);re(()=>{if(!e.autoPlay||n<=1)return;let M=setInterval(f,l);return()=>clearInterval(M)},[e.autoPlay,l,f,n]),re(()=>{let M=A=>{A.key==="ArrowLeft"?b():A.key==="ArrowRight"&&f()},$=c.current;if($)return $.addEventListener("keydown",M),()=>$.removeEventListener("keydown",M)},[f,b]);let y=a==="fade"?`@keyframes liq-fade-in-${d}{from{opacity:0}to{opacity:1}}`:"",g={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)"},R=t.map((M,$)=>{let A=a==="fade"?{position:$===u?"relative":"absolute",top:"0",left:"0",width:"100%",opacity:$===u?"1":"0",transition:"opacity 0.4s ease"}:{flex:"0 0 100%",width:"100%"};return o("div",{key:String($),style:A},M.content,M.caption?o("div",{style:{textAlign:"center",padding:"8px 12px",fontSize:"13px",color:"#6b7280"}},M.caption):null)}),D=i?o("div",{style:{display:"flex",justifyContent:"center",gap:"8px",padding:"12px 0"}},...t.map((M,$)=>o("button",{key:String($),"aria-label":`Go to slide ${$+1}`,onclick:()=>m($),style:{width:"10px",height:"10px",borderRadius:"50%",border:"none",cursor:"pointer",backgroundColor:$===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:M=>{p.current=M.clientX},onpointerup:M=>{if(p.current==null)return;let $=M.clientX-p.current;$>50?b():$<-50&&f(),p.current=null}},y?o("style",null,y):null,o("div",{style:x},...R),s&&n>1?o("button",{"aria-label":"Previous slide",onclick:b,style:{...v,left:"8px"}},"\u2039"):null,s&&n>1?o("button",{"aria-label":"Next slide",onclick:f,style:{...v,right:"8px"}},"\u203A"):null,D)}function Dr(e){let[t,n]=j("loading"),r=te(null),i=Ee().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 m={display:"inline-block",position:"relative",overflow:"hidden"};return a&&(m.width=a),l&&(m.height=l),e.borderRadius&&(m.borderRadius=e.borderRadius),m},[a,l,e.borderRadius]),u=q(()=>{let m={display:"block",width:"100%",height:"100%"};return e.objectFit&&(m.objectFit=e.objectFit),t==="loading"&&(m.opacity="0",m.position="absolute"),t==="error"&&(m.display="none"),m},[e.objectFit,t]),h=null;if(t==="loading")if(e.placeholder==="skeleton"){let m=`@keyframes liq-img-shimmer-${i}{0%{background-position:-200% 0}100%{background-position:200% 0}}`;h=o("div",null,o("style",null,m),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 p=null;t==="error"&&e.fallback!=null&&(typeof e.fallback=="string"?p=o("img",{src:e.fallback,alt:e.alt??"",style:{display:"block",width:"100%",height:"100%",objectFit:e.objectFit??"cover"}}):p=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")}),p);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 $r(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 zr(e){let t=e.controls!==!1,n=te(null),r=Ee().replace(/[^a-zA-Z0-9_-]/g,""),[i,s]=j(!1),[a,l]=j(0),[d,u]=j(0),[h,p]=j(e.muted?0:1),[c,m]=j(!!e.muted),[f,b]=j(!0),y=typeof e.width=="number"?`${e.width}px`:e.width??"100%",g=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()},L=()=>{s(!1),e.onPause&&e.onPause()},E=()=>{s(!1),e.onEnded&&e.onEnded()},B=()=>{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",L),I.addEventListener("ended",E),I.addEventListener("timeupdate",B),I.addEventListener("loadedmetadata",z),()=>{I.removeEventListener("play",P),I.removeEventListener("pause",L),I.removeEventListener("ended",E),I.removeEventListener("timeupdate",B),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 L=I.currentTarget.getBoundingClientRect(),E=Math.max(0,Math.min(1,(I.clientX-L.left)/L.width));P.currentTime=E*P.duration},[]),R=S(I=>{let P=n.current,L=parseFloat(I.target.value);P&&(P.volume=L,P.muted=L===0,p(L),m(L===0))},[]),D=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:y,height:g,display:"block"}});let M=d>0?a/d*100:0,$={background:"none",border:"none",color:"#ffffff",cursor:"pointer",fontSize:"16px",padding:"4px 8px",lineHeight:"1"},A=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:$},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"}},`${$r(a)} / ${$r(d)}`),o("input",{type:"range",min:"0",max:"1",step:"0.05",value:String(c?0:h),oninput:R,"aria-label":"Volume",style:{width:"60px",cursor:"pointer"}}),o("button",{"aria-label":"Fullscreen",onclick:D,style:$},"\u26F6"));return o("div",{style:{position:"relative",width:y,height:g,backgroundColor:"#000",overflow:"hidden"},onmouseenter:()=>b(!0),onmouseleave:()=>{i&&b(!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"}}),A)}function _e(e){let t=e.orientation??"vertical",n=e.role??"navigation",r=e.keyboardNav??!0,i=e.styling??{},s=te(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 p=Array.from(h.querySelectorAll('button, [tabindex]:not([tabindex="-1"]), a[href], [role="menuitem"], [role="treeitem"]')),c=p.indexOf(document.activeElement);if(c<0)return;let m=t==="vertical",f=m?"ArrowDown":"ArrowRight",b=m?"ArrowUp":"ArrowLeft";if(u.key===f){u.preventDefault();let y=p[c+1];y&&y.focus()}else if(u.key===b){u.preventDefault();let y=p[c-1];y&&y.focus()}else u.key==="Home"?(u.preventDefault(),p[0]?.focus()):u.key==="End"&&(u.preventDefault(),p[p.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 Ne(){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}=Ne(),p=t.disabled===!0,c={display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",boxSizing:"border-box",padding:i.padding??"12px 16px",backgroundColor:p?"#f9fafb":d?i.hoverBackground??"#f3f4f6":i.backgroundColor??"transparent",color:p?"#9ca3af":i.color??"inherit",fontWeight:i.fontWeight??"600",fontSize:i.fontSize??"inherit",border:"none",outline:"none",cursor:p?"not-allowed":"pointer",font:"inherit",textAlign:"left",transition:"background-color 0.15s",...i.borderBottom?{borderBottom:i.borderBottom}:{}};l==="left"&&(c.flexDirection="row");let m=S(v=>{let R=v;p||(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),r())},[p,r]),f=S(()=>{p||r()},[p,r]),y=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,x=l==="left"?[y,g]:[g,y];return o("button",{id:`accordion-header-${t.id}`,role:"button","aria-expanded":String(n),"aria-controls":`accordion-panel-${t.id}`,"aria-disabled":p?"true":void 0,"data-section-id":t.id,tabIndex:p?-1:0,style:c,onClick:f,onKeyDown:m,onMouseEnter:u,onMouseLeave:h},...x)}function Pl(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 Ar(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:p}=e,[c,m]=j(()=>n??[]),f=S(y=>{m(g=>{let x=g.includes(y),v;return x?v=g.filter(R=>R!==y):r?v=[...g,y]:v=[y],p&&p(v),v})},[r,p]),b=q(()=>t.map(y=>{let g=c.includes(y.id),x=o(Rl,{key:`header-${y.id}`,section:y,expanded:g,onToggle:()=>f(y.id),headerStyle:i,expandIcon:l,collapseIcon:d,iconPosition:u}),v=o(Pl,{key:`content-${y.id}`,section:y,expanded:g,contentStyle:s,animated:h});return o("div",{key:y.id,"data-accordion-section":y.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},...b)}var Tl={sm:{fontSize:"12px",padding:"4px 0"},md:{fontSize:"14px",padding:"6px 0"},lg:{fontSize:"16px",padding:"8px 0"}};function Lr(e){let{items:t,separator:n="/",maxItems:r,size:i="md"}=e,[s,a]=j(!1),l=Tl[i],d=S(()=>{a(!0)},[]),u=t,h=!1;if(r&&r>1&&t.length>r&&!s){h=!0;let f=1,b=r-1;u=[...t.slice(0,f),{label:"..."},...t.slice(t.length-b)]}let p=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,b,y)=>{let g=b===y.length-1,x=h&&f.label==="..."&&b===1,v=[];return b>0&&v.push(p(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"},"...")):g?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?R=>{R.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(b),style:{display:"inline-flex",alignItems:"center"}},...v)},m=u.map((f,b)=>c(f,b,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"}},...m))}function Br(e){let{item:t,itemStyle:n,closeOnSelect:r,onClose:i}=e,{hover:s,onMouseEnter:a,onMouseLeave:l}=Ne(),[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 p=t.disabled===!0,m={...bt(n,{hover:!p&&s,active:!1}),position:"relative",justifyContent:"space-between",...p?{color:"#9ca3af",cursor:"default",opacity:"0.6"}:{}},f=S(()=>{if(!p){if(h){u(R=>!R);return}t.onClick&&t.onClick(),r&&i()}},[p,h,t,r,i]),b=S(()=>{a(),h&&u(!0)},[h,a]),y=S(()=>{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)),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(R=>o(Br,{key:R.id,item:R,itemStyle:n,closeOnSelect:r,onClose:i})))):null;return o("div",{style:{position:"relative"},onMouseEnter:b,onMouseLeave:y},o("button",{type:"button",role:"menuitem",style:m,onClick:f,disabled:p||void 0,tabIndex:p?-1:0,"aria-disabled":p?"true":void 0,"aria-haspopup":h||void 0,"aria-expanded":h?String(d):void 0},g,x),v)}function Fr(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),p=te(null),c=S(()=>{h(R=>!R)},[]),m=S(()=>{h(!1)},[]);re(()=>{if(!u)return;let R=D=>{let M=p.current;M&&!M.contains(D.target)&&h(!1)};return document.addEventListener("click",R,!0),()=>{document.removeEventListener("click",R,!0)}},[u]),re(()=>{if(!u)return;let R=D=>{D.key==="Escape"&&h(!1)};return document.addEventListener("keydown",R),()=>{document.removeEventListener("keydown",R)}},[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??{}},b=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")),y=typeof d=="number"?`${d}px`:d,g={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:y,backgroundColor:"#ffffff",...i??{}},v=u?o("div",{style:g},o(_e,{orientation:"vertical",role:"menu",ariaLabel:`${t} menu`,styling:x},...n.map(R=>o(Br,{key:R.id,item:R,itemStyle:s,closeOnSelect:l,onClose:m})))):null;return o("div",{ref:p,style:{position:"relative",display:"inline-block"}},b,v)}function Nr(e){let{item:t,onClose:n,index:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:a}=Ne(),[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,p=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]),m=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"},b=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)),y=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((x,v)=>o(Nr,{key:String(v),item:x,onClose:n,index:v})))):null;return o("div",{style:{position:"relative"},onMouseEnter:c,onMouseLeave:m},o("button",{type:"button",role:"menuitem",style:f,onClick:p,disabled:h||void 0,tabIndex:-1,"aria-disabled":h||void 0,"aria-haspopup":u||void 0,"aria-expanded":u?l:void 0},b,y),g)}function Dl(e){let{menu:t,index:n,isOpen:r,anyOpen:i,onOpen:s,onClose:a}=e,{hover:l,onMouseEnter:d,onMouseLeave:u}=Ne(),h=te(null),p=S(()=>{r?a():s(n)},[r,n,s,a]),c=S(()=>{d(),i&&!r&&s(n)},[i,r,n,s,d]),m={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((b,y)=>o(Nr,{key:String(y),item:b,onClose:a,index:y})))):null;return o("div",{style:{position:"relative",display:"inline-block"},onMouseEnter:c,onMouseLeave:u},o("button",{ref:h,type:"button",role:"menuitem",style:m,onClick:p,"aria-haspopup":"true","aria-expanded":String(r),tabIndex:0},t.label),f)}function Wr(e){let{menus:t}=e,[n,r]=j(null),i=te(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 p=h;if(p.key==="Escape"){r(null);return}if(p.key==="ArrowRight"){p.preventDefault(),r(c=>c===null?0:(c+1)%t.length);return}if(p.key==="ArrowLeft"){p.preventDefault(),r(c=>c===null?t.length-1:(c-1+t.length)%t.length);return}if(p.key==="ArrowDown"&&n!==null){p.preventDefault();let c=d.querySelector('[role="menu"]');if(c){let m=c.querySelector('[role="menuitem"]');m&&m.focus()}return}p.key==="Enter"||p.key};return d.addEventListener("keydown",u),()=>{d.removeEventListener("keydown",u)}},[n,t.length]);let l=t.map((d,u)=>o(Dl,{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 $l(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"},zl={...Xt,backgroundColor:"#2563eb",color:"#ffffff",borderColor:"#2563eb",fontWeight:"600"},_r={...Xt,color:"#9ca3af",cursor:"default",opacity:"0.5"},Al={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"36px",height:"36px",color:"#6b7280",fontSize:"14px",userSelect:"none"};function Or(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),p=S(y=>{!d&&y>=1&&y<=u&&y!==h&&i(y)},[d,u,h,i]),c=(y,g,x)=>{let v=d||g<1||g>u||g===h;return o("button",{type:"button",onClick:()=>p(g),disabled:v||void 0,"aria-label":x,style:v?_r:Xt},y)},m=$l(u,h,s),f=0,b=[];a&&b.push(c("\xAB",1,"Go to first page")),l&&b.push(c("\u2039",h-1,"Go to previous page"));for(let y of m)if(y==="ellipsis")b.push(o("span",{key:`ellipsis-${f++}`,style:Al},"..."));else{let g=y===h;b.push(o("button",{key:String(y),type:"button",onClick:()=>p(y),disabled:d||void 0,"aria-label":`Page ${y}`,"aria-current":g?"page":void 0,style:d?_r:g?zl:Xt},String(y)))}return l&&b.push(c("\u203A",h+1,"Go to next page")),a&&b.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"}}},...b)}function Hr(e){let{item:t,collapsed:n,selectedId:r,onSelect:i,depth:s}=e,{hover:a,onMouseEnter:l,onMouseLeave:d}=Ne(),[u,h]=j(!1),p=t.children&&t.children.length>0,c=t.id===r,m=S(()=>{p&&!n&&h($=>!$),i&&i(t.id)},[p,n,i,t.id]),f=n?"0":`${16+s*16}px`,b={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"},y=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),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&&p?o("span",{style:{fontSize:"10px",transition:"transform 0.15s",transform:u?"rotate(90deg)":"rotate(0deg)",marginLeft:"4px"},"aria-hidden":"true"},"\u25B6"):null,R=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,D=o("button",{type:"button",style:b,onClick:m,onMouseEnter:l,onMouseLeave:d,"aria-selected":c?"true":"false",title:n?t.label:void 0},y,g,x,v,R),M=!n&&p&&u?t.children.map($=>o(Hr,{key:$.id,item:$,collapsed:n,selectedId:r,onSelect:i,depth:s+1})):null;return o("div",{key:t.id,style:{position:"relative"}},D,M?o("div",{role:"group"},...M):null)}function Yr(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(p=>o(Hr,{key:p.id,item:p,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 Ue={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 Vr(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(y=>{s&&i&&i(y)},[s,i]),p=y=>y<n?"completed":y===n?"active":"pending",c=(y,g,x)=>{let v=a==="dot"?u:d,R={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:{...R,backgroundColor:Ue.completedBg,color:Ue.completedText,border:`2px solid ${Ue.completed}`}},a==="circle"?g.icon||"\u2713":null):x==="active"?o("div",{style:{...R,backgroundColor:"#ffffff",color:Ue.activeText,border:`2px solid ${Ue.activeBorder}`,boxShadow:"0 0 0 3px rgba(37, 99, 235, 0.2)"}},a==="circle"?g.icon||String(y+1):o("div",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:Ue.active}})):o("div",{style:{...R,backgroundColor:"#ffffff",color:Ue.pendingText,border:`2px solid ${Ue.pending}`}},a==="circle"?g.icon||String(y+1):null)},m=y=>{if(y>=t.length-1)return null;let x=y<n?Ue.lineCompleted:Ue.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=(y,g)=>{let x=p(g),v=x==="active",R=x==="completed",D=c(g,y,x),M={fontSize:"13px",fontWeight:v?"600":"400",color:v||R?Ue.labelActive:Ue.labelPending,marginTop:l?"8px":"0",marginLeft:l?"0":"12px",textAlign:l?"center":"left",transition:"color 0.2s"},$={fontSize:"11px",color:Ue.descriptionColor,marginTop:"2px",textAlign:l?"center":"left"},A=o("div",{style:l?{display:"flex",flexDirection:"column",alignItems:"center"}:{display:"flex",flexDirection:"column"}},o("span",{style:M},y.label),y.description?o("span",{style:$},y.description):null),I=l?o("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"}},D,A):o("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"}},D,A);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":v?"step":void 0},I)},b=[];return t.forEach((y,g)=>{b.push(f(y,g));let x=m(g);x&&b.push(x)}),o("div",{role:"navigation","aria-label":"Progress steps",style:{display:"flex",flexDirection:l?"row":"column",alignItems:l?"flex-start":"stretch",width:"100%"}},...b)}var Ur={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 Ll(e){let{item:t,size:n,variant:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:a}=Ne(),l=Ur[n],d=t.disabled===!0,u=t.type==="toggle",[h,p]=j(!1),c=u?t.active===!0:h,m=S(()=>{!d&&t.onClick&&t.onClick()},[d,t]),f=S(()=>{!d&&!u&&p(!0)},[d,u]),b=S(()=>{u||p(!1)},[u]),y=S(()=>{a(),u||p(!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"},x=t.icon?o("span",{style:{fontSize:l.iconSize},"aria-hidden":"true"},t.icon):null,v=t.label?o("span",null,t.label):null,R=t.type==="dropdown"?o("span",{style:{fontSize:"10px",marginLeft:"2px"},"aria-hidden":"true"},"\u25BC"):null;return o("button",{type:"button",style:g,onClick:m,onMouseDown:f,onMouseUp:b,onMouseEnter:s,onMouseLeave:y,disabled:d||void 0,"aria-pressed":u?c:void 0,"aria-label":t.label||t.id,title:t.label||t.id},x,v,R)}function jr(e){let{items:t,size:n="md",variant:r="flat"}=e,i=Ur[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(Ll,{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 Gr(e){e.expanded=!0;for(let t of e.children)Gr(t)}function Xr(e,t=[]){if(t.push(e),e.expanded)for(let n of e.children)Xr(n,t);return t}function Bl(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:p,focusedId:c}=e,m=Ne(),f=te(null),b=c===t.id;re(()=>{b&&f.current&&f.current.focus()},[b]);let y=t.isLeaf(),g=t.depth,x=[];for(let $=0;$<g;$++){let A=t;for(let P=0;P<g-$;P++)A=A?A.parent:null;let I=A?!Bl(A):!1;x.push(o("span",{key:`connector-${$}`,"aria-hidden":"true",style:{display:"inline-block",width:`${r}px`,height:"100%",position:"relative",flexShrink:"0",...I?{borderLeft:`${s}px solid ${i}`}:{}}}))}let v=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,R=y?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:$=>{$.stopPropagation(),h(t)}},t.expanded?a:l),D=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:m.hover,active:n});return o("div",{ref:f,role:"treeitem","aria-expanded":y?void 0:String(t.expanded),"aria-selected":n?"true":"false","aria-level":g+1,tabIndex:b?0:-1,style:{...M,display:"flex",alignItems:"stretch",padding:"0"},onMouseEnter:m.onMouseEnter,onMouseLeave:m.onMouseLeave,onClick:()=>p(t)},...x,v,o("span",{style:{display:"flex",alignItems:"center",flex:"1",padding:d.padding??"6px 10px",minWidth:"0"}},R,D))}function Kr(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:p="+",nodeStyle:c={},wrapperStyle:m,renderNode:f}=e,[b,y]=j(()=>{let I=xt.fromData(t);return a&&Gr(I),I}),[g,x]=j(t.id),v=q(()=>Xr(b),[b]),R=S(()=>{y(I=>{let P=Object.create(Object.getPrototypeOf(I));return Object.assign(P,I),P})},[]),D=S(I=>{I.toggle(),I.expanded?r?.(I):i?.(I),R()},[r,i,R]),M=S(I=>{x(I.id),n?.(I)},[n]),$=S(I=>{let P=I;if(!g)return;let L=v.findIndex(B=>B.id===g);if(L===-1)return;let E=v[L];switch(P.key){case"ArrowDown":{P.preventDefault();let B=v[L+1];B&&x(B.id);break}case"ArrowUp":{P.preventDefault();let B=v[L-1];B&&x(B.id);break}case"ArrowRight":{P.preventDefault(),E.isLeaf()||(E.expanded?E.children.length>0&&x(E.children[0].id):D(E));break}case"ArrowLeft":{P.preventDefault(),!E.isLeaf()&&E.expanded?D(E):E.parent&&x(E.parent.id);break}case"Enter":{P.preventDefault(),M(E);break}case" ":{P.preventDefault(),E.isLeaf()||D(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}}},[g,v,D,M]),A=v.map(I=>o(Fl,{key:I.id,node:I,isSelected:I.id===s,indentPx:u,lineColor:l,lineWidth:d,iconExpanded:h,iconCollapsed:p,nodeStyle:c,renderNode:f,onToggle:D,onClick:M,focusedId:g}));return o(_e,{role:"tree",ariaLabel:"Tree navigation",styling:m,keyboardNav:!1},o("div",{onKeyDown:$,style:{outline:"none"}},...A))}function qr(e){let{items:t,position:n,onClose:r,depth:i}=e,[s,a]=j(-1),[l,d]=j(null),u=te(null);re(()=>{if(!u.current)return;u.current.focus();let c=f=>{let b=f,y=t.map((g,x)=>({item:g,i:x})).filter(({item:g})=>!g.divider);if(b.key==="ArrowDown")b.preventDefault(),a(g=>{let v=(y.findIndex(({i:R})=>R===g)+1)%y.length;return y[v].i});else if(b.key==="ArrowUp")b.preventDefault(),a(g=>{let x=y.findIndex(({i:R})=>R===g),v=x<=0?y.length-1:x-1;return y[v].i});else if(b.key==="ArrowRight")s>=0&&t[s]?.children&&d(s);else if(b.key==="ArrowLeft")i>0&&r();else if(b.key==="Enter"){if(b.preventDefault(),s>=0){let g=t[s];g.children?d(s):!g.disabled&&g.onClick&&(g.onClick(),r())}}else b.key==="Escape"&&r()};u.current.addEventListener("keydown",c);let m=u.current;return()=>m.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"},p=t.map((c,m)=>{if(c.divider)return o("div",{key:`divider-${m}`,style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let f=s===m,b=!!c.disabled,y=!!(c.children&&c.children.length>0),g={display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",fontSize:"14px",color:b?"#9ca3af":"#1f2937",cursor:b?"default":"pointer",backgroundColor:f&&!b?"#f3f4f6":"transparent",userSelect:"none",position:"relative"},x=()=>{a(m),d(y?m:null)},v=()=>{if(!b){if(y){d(m);return}c.onClick&&c.onClick(),r()}},R=[];c.icon&&R.push(o("span",{style:{width:"20px",textAlign:"center",flexShrink:"0"}},c.icon)),R.push(o("span",{style:{flex:"1"}},c.label??"")),y&&R.push(o("span",{style:{fontSize:"10px",color:"#9ca3af",marginLeft:"8px"}},"\u25B6"));let D=[o("div",{key:`item-${m}`,style:g,onMouseEnter:x,onClick:v,role:"menuitem","aria-disabled":b?"true":void 0},...R)];return y&&l===m&&D.push(o(qr,{key:`submenu-${m}`,items:c.children,position:{x:n.x+178,y:n.y+m*36},onClose:()=>d(null),depth:i+1})),o("div",{key:`wrap-${m}`,style:{position:"relative"}},...D)});return o("div",{ref:u,style:h,tabIndex:-1,role:"menu"},...p)}function Kt(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=p=>{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(qr,{items:t,position:r,onClose:a,depth:0})),o("div",null,...d)}function Nl(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 Wl(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 Zr(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,p]=j(!1),[c,m]=j(!1),f=te(null),b=s?"drawer-title":void 0;if(re(()=>{if(t)p(!0),requestAnimationFrame(()=>m(!0));else{m(!1);let I=setTimeout(()=>p(!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 y={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={...Wl(r,i),transform:Nl(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"},R={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",lineHeight:"1"},D={padding:"20px",overflow:"auto",flex:"1"},M=()=>{l&&n()},$=[];s&&$.push(o("div",{style:x},o("h3",{id:b,style:v},s),o("button",{type:"button",style:R,onClick:n,"aria-label":"Close drawer"},"\xD7"))),$.push(o("div",{style:D},u));let A=[];return a&&A.push(o("div",{style:y,onClick:M})),A.push(o("div",{ref:f,style:g,role:"dialog","aria-modal":"true","aria-labelledby":b,tabIndex:-1},...$)),o("div",null,...A)}var _l={sm:"400px",md:"600px",lg:"800px",full:"100vw"};function Jr(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=te(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=$=>{$.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 p={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:_l[i],maxWidth:i==="full"?"100vw":"90vw",display:"flex",flexDirection:"column",outline:"none",overflow:"hidden"},m={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"},b={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",borderRadius:"4px",lineHeight:"1"},y={padding:"24px",overflow:"auto",flex:"1"},g={padding:"16px 24px",borderTop:"1px solid #e5e7eb",flexShrink:"0"},x=M=>{s&&M.target===M.currentTarget&&n()},v=[],R=r?"modal-title":void 0;r?v.push(o("h2",{id:R,style:f},r)):v.push(o("span",null)),d&&v.push(o("button",{type:"button",style:b,onClick:n,"aria-label":"Close modal"},"\xD7"));let D=[o("div",{style:m},...v),o("div",{style:y},u)];return l&&D.push(o("div",{style:g},l)),o("div",{style:p,onClick:x,"aria-modal":"true",role:"dialog","aria-labelledby":R},o("div",{ref:h,style:c,tabIndex:-1,role:"document"},...D))}var Qr=8;function Ol(e,t){let n=t+Qr;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 Hl(e){let t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n=`${Qr}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 ei(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,p]=j(!1),c=u?r:h,m=te(null),f=S(()=>{u?d&&d(!r):p(R=>!R)},[u,r,d]);re(()=>{if(!c||!l)return;let R=D=>{m.current&&!m.current.contains(D.target)&&(u?d&&d(!1):p(!1))};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[c,l,u,d]);let b={position:"relative",display:"inline-block"},y={...Ol(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:Hl(i)}));let x=S(R=>{let D=R.key;(D==="Enter"||D===" ")&&(R.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:y},...g)),o("div",{ref:m,style:b},...v)}var Yl=0;function Vl(){return`toast-${++Yl}-${Date.now()}`}function _n(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=Vl();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 Ul={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 jl(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 Gl(e){let{item:t,onDismiss:n}=e,r=Ul[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 On(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=jl(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(Gl,{key:l.id,item:l,onDismiss:s}));return o("div",{style:i},...a)}function ei(e={}){let t=te(null);t.current||(t.current=Wn(e));let n=t.current,r=S(()=>o(On,{toaster:n}),[n]);return{toast:n.toast,dismiss:n.dismiss,dismissAll:n.dismissAll,ToastContainer:r}}var Xl=6,Kl=8;function ql(e,t){let n=window.scrollX||window.pageXOffset,r=window.scrollY||window.pageYOffset,i=Kl;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 Zl(e){let t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n=`${Xl}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 ti(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=te(null),p=te(null),c=`tooltip-${Math.random().toString(36).slice(2,9)}`,m=S(()=>{p.current=setTimeout(()=>{if(h.current){let x=h.current.getBoundingClientRect();u(ql(x,n))}l(!0)},r)},[r,n]),f=S(()=>{p.current&&(clearTimeout(p.current),p.current=null),l(!1)},[]);re(()=>()=>{p.current&&clearTimeout(p.current)},[]);let b={display:"inline-block"},y={...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:b,onMouseEnter:m,onMouseLeave:f,onFocus:m,onBlur:f,"aria-describedby":a?c:void 0},s)];return a&&d&&g.push(o("div",{id:c,style:y,role:"tooltip"},t,o("div",{style:Zl(n)}))),o("div",{style:{display:"inline-block",position:"relative"}},...g)}function Hn(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 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 Ql(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 ec(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 ni=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function oi(e,t){return t||ni[e%ni.length]}function ri(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:p,padding:c=50,animate:m=!1,stacked:f,grouped:b=!1}=e,y=i==="vertical",g=n-c*2,x=r-c*2,v=y?x:g,R=y?g:x,D=f!==void 0&&f.length>0,M=q(()=>D?ec(f):[],[D,f]),$=D?f.length:t.length,A=q(()=>Jl(t,f,b),[t,f,b]),I=A>0?A:1,P=Hn($,I,v,R,a),L=S(()=>{if(!u)return[];let _=Ql(I),V=[];for(let K=_;K<=I;K+=_){let Q=P.valueScale(K);if(y){let G=c+x-Q;V.push(o("line",{key:`grid-${K}`,x1:String(c),y1:String(G),x2:String(c+g),y2:String(G),stroke:h,"stroke-width":"1","stroke-dasharray":"4 2"})),V.push(o("text",{key:`grid-label-${K}`,x:String(c-6),y:String(G+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(K)))}else{let G=c+Q;V.push(o("line",{key:`grid-${K}`,x1:String(G),y1:String(c),x2:String(G),y2:String(c+x),stroke:h,"stroke-width":"1","stroke-dasharray":"4 2"})),V.push(o("text",{key:`grid-label-${K}`,x:String(G),y:String(c+x+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(K)))}}return V},[u,I,P,y,c,g,x,h]),E=S(()=>{let _=[];return y?(_.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"})),_.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+x),x2:String(c+g),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"}))):(_.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+x),x2:String(c+g),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"})),_.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"}))),_},[y,c,g,x]),B=S(()=>{let _=[];for(let V=0;V<t.length;V++){let K=t[V],Q=P.valueScale(K.value),G=P.categoryScale(V),O=K.color??s,Y,X,U=String(K.value);if(y){let Z=c+G,ee=c+x-Q;Y={x:String(Z),y:String(ee),width:String(P.barThickness),height:String(Q),rx:String(l),ry:String(l),fill:O},X={x:String(Z+P.barThickness/2),y:String(ee-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"}}else{let Z=c+G,ee=c;Y={x:String(ee),y:String(Z),width:String(Q),height:String(P.barThickness),rx:String(l),ry:String(l),fill:O},X={x:String(ee+Q+6),y:String(Z+P.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"}}if(m&&(Y.style=y?`animation: barGrow 0.6s ease-out ${V*.05}s both`:`animation: barGrow 0.6s ease-out ${V*.05}s both`),_.push(o("rect",{key:`bar-${V}`,...Y})),d&&_.push(o("text",{key:`val-${V}`,...X},U)),y){let Z=c+G+P.barThickness/2,ee=c+x+16;_.push(o("text",{key:`cat-${V}`,x:String(Z),y:String(ee),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${Z}, ${ee})`},K.label))}else _.push(o("text",{key:`cat-${V}`,x:String(c-6),y:String(c+G+P.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},K.label))}return _},[t,P,s,l,d,m,y,c,x]),z=S(()=>{if(!f)return[];let _=[];for(let V=0;V<f.length;V++){let K=f[V],Q=P.categoryScale(V),G=0;for(let O=0;O<K.values.length;O++){let Y=K.values[O],X=P.valueScale(Y.value),U=P.valueScale(G),Z=oi(O,Y.color);if(y){let ee=c+Q,ae=c+x-U-X;_.push(o("rect",{key:`sbar-${V}-${O}`,x:String(ee),y:String(ae),width:String(P.barThickness),height:String(X),rx:O===K.values.length-1?String(l):"0",ry:O===K.values.length-1?String(l):"0",fill:Z,...m?{style:`animation: barGrow 0.6s ease-out ${(V*K.values.length+O)*.03}s both`}:{}})),d&&X>14&&_.push(o("text",{key:`sval-${V}-${O}`,x:String(ee+P.barThickness/2),y:String(ae+X/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(Y.value)))}else{let ee=c+U,ae=c+Q;_.push(o("rect",{key:`sbar-${V}-${O}`,x:String(ee),y:String(ae),width:String(X),height:String(P.barThickness),rx:O===K.values.length-1?String(l):"0",ry:O===K.values.length-1?String(l):"0",fill:Z,...m?{style:`animation: barGrow 0.6s ease-out ${(V*K.values.length+O)*.03}s both`}:{}})),d&&X>20&&_.push(o("text",{key:`sval-${V}-${O}`,x:String(ee+X/2),y:String(ae+P.barThickness/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(Y.value)))}G+=Y.value}if(d){let O=P.valueScale(G);y?_.push(o("text",{key:`stotal-${V}`,x:String(c+Q+P.barThickness/2),y:String(c+x-O-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(G))):_.push(o("text",{key:`stotal-${V}`,x:String(c+O+6),y:String(c+Q+P.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(G)))}if(y){let O=c+Q+P.barThickness/2,Y=c+x+16;_.push(o("text",{key:`scat-${V}`,x:String(O),y:String(Y),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${O}, ${Y})`},K.label))}else _.push(o("text",{key:`scat-${V}`,x:String(c-6),y:String(c+Q+P.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},K.label))}return _},[f,P,l,d,m,y,c,x]),k=S(()=>{if(!f)return[];let _=M.length,V=[];for(let K=0;K<f.length;K++){let Q=f[K],G=P.categoryScale(K),O=2,Y=Math.max(1,(P.barThickness-O*(_-1))/_);for(let X=0;X<Q.values.length;X++){let U=Q.values[X],Z=M.indexOf(U.category),ee=Z*(Y+O),ae=P.valueScale(U.value),J=oi(Z>=0?Z:X,U.color);if(y){let se=c+G+ee,ce=c+x-ae;V.push(o("rect",{key:`gbar-${K}-${X}`,x:String(se),y:String(ce),width:String(Y),height:String(ae),rx:String(l),ry:String(l),fill:J,...m?{style:`animation: barGrow 0.6s ease-out ${(K*_+X)*.04}s both`}:{}})),d&&V.push(o("text",{key:`gval-${K}-${X}`,x:String(se+Y/2),y:String(ce-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(U.value)))}else{let se=c,ce=c+G+ee;V.push(o("rect",{key:`gbar-${K}-${X}`,x:String(se),y:String(ce),width:String(ae),height:String(Y),rx:String(l),ry:String(l),fill:J,...m?{style:`animation: barGrow 0.6s ease-out ${(K*_+X)*.04}s both`}:{}})),d&&V.push(o("text",{key:`gval-${K}-${X}`,x:String(se+ae+4),y:String(ce+Y/2+3),"text-anchor":"start","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(U.value)))}}if(y){let X=c+G+P.barThickness/2,U=c+x+16;V.push(o("text",{key:`gcat-${K}`,x:String(X),y:String(U),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${X}, ${U})`},Q.label))}else V.push(o("text",{key:`gcat-${K}`,x:String(c-6),y:String(c+G+P.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},Q.label))}return V},[f,M,P,l,d,m,y,c,x]),w=S(()=>p?[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"},p)]:[],[p,n,c]),T=S(()=>m?[o("defs",{key:"anim-defs"},o("style",{key:"anim-style"},y?"@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; } }"))]:[],[m,y]),C=L(),N=E(),F=w(),W=T(),H;return D&&b?H=k():D?H=z():H=B(),o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",style:{fontFamily:"sans-serif"}},...W,...F,...C,...N,...H)}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],p=e(h);isFinite(p)&&a.push({input:h,output:p})}if(s=d,s>=t.length){r(a,!0);return}r(a,!1),ii(l)};return ii(l),()=>{i=!0}}function ii(e){typeof requestIdleCallback=="function"?requestIdleCallback(()=>e(),{timeout:16}):setTimeout(e,0)}function tc(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 si(e,t){let n=t-e;if(n<=0)return[e];let r=tc(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 ai(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}var De=40,li=1.1,ci=.01,di=1e6;function ui(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:p=!0,pointRadius:c=3,pointColor:m="#3b82f6",curveColor:f="#3b82f6",gridColor:b="#e2e8f0",axisColor:y="#94a3b8",onPointClick:g,onPointDoubleClick:x,onPointContextMenu:v,onPointHover:R}=e,[D,M]=j(d[0]),[$,A]=j(d[1]),[I,P]=j(u[0]),[L,E]=j(u[1]),B=te(!1),z=te(null),k=S(U=>De+(U-D)/($-D)*(t-2*De),[D,$,t]),w=S(U=>n-De-(U-I)/(L-I)*(n-2*De),[I,L,n]),T=S(U=>D+(U-De)/(t-2*De)*($-D),[D,$,t]),C=S(U=>I+(n-De-U)/(n-2*De)*(L-I),[I,L,n]),N=S(U=>{let Z=U;B.current=!0,z.current={mx:Z.clientX,my:Z.clientY,x0:D,x1:$,y0:I,y1:L}},[D,$,I,L]),F=S(U=>{if(!B.current||!z.current)return;let Z=U,ee=z.current,ae=Z.clientX-ee.mx,J=Z.clientY-ee.my,se=ae/(t-2*De)*(ee.x1-ee.x0),ce=J/(n-2*De)*(ee.y1-ee.y0);M(ee.x0-se),A(ee.x1-se),P(ee.y0+ce),E(ee.y1+ce)},[t,n]),W=S(()=>{B.current=!1,z.current=null},[]),H=S(U=>{let Z=U;Z.preventDefault();let ee=Z.currentTarget.getBoundingClientRect(),ae=Z.clientX-ee.left,J=Z.clientY-ee.top,se=T(ae),ce=C(J),me=Z.deltaY>0?li:1/li,ge=($-D)*me,ye=(L-I)*me;if(ge<ci||ye<ci||ge>di||ye>di)return;let le=(se-D)/($-D),ne=(ce-I)/(L-I);M(se-le*ge),A(se+(1-le)*ge),P(ce-ne*ye),E(ce+(1-ne)*ye)},[D,$,I,L,T,C]),_=[];if(_.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),h){let U=si(D,$),Z=si(I,L);for(let ee=0;ee<U.length;ee++){let ae=k(U[ee]);_.push(o("line",{x1:ae,y1:De,x2:ae,y2:n-De,stroke:b,"stroke-width":.5,key:`gx-${ee}`})),_.push(o("text",{x:ae,y:n-De+14,"text-anchor":"end","font-size":10,fill:y,transform:`rotate(-45, ${ae}, ${n-De+14})`,key:`lx-${ee}`},ai(U[ee])))}for(let ee=0;ee<Z.length;ee++){let ae=w(Z[ee]);_.push(o("line",{x1:De,y1:ae,x2:t-De,y2:ae,stroke:b,"stroke-width":.5,key:`gy-${ee}`})),_.push(o("text",{x:De-6,y:ae+3,"text-anchor":"end","font-size":10,fill:y,key:`ly-${ee}`},ai(Z[ee])))}}if(p){let U=Math.max(De,Math.min(t-De,k(0))),Z=Math.max(De,Math.min(n-De,w(0)));_.push(o("line",{x1:De,y1:Z,x2:t-De,y2:Z,stroke:y,"stroke-width":1,key:"x-axis"})),_.push(o("line",{x1:U,y1:De,x2:U,y2:n-De,stroke:y,"stroke-width":1,key:"y-axis"}))}let V=q(()=>{if(!i||!l)return[];let U=a??($-D)/s,Z=yt({start:D,end:$,step:U});return qt(i,Z)},[i,D,$,a,s,l]),[K,Q]=j([]),G=te(null);re(()=>{if(!i||l){Q([]);return}let U=a??($-D)/s,Z=yt({start:D,end:$,step:U});return G.current&&G.current(),G.current=Zt(i,Z,200,ee=>{Q([...ee])}),()=>{G.current&&G.current()}},[i,D,$,a,s,l]);let O=l?V:K;if(O.length>0){let U=[];for(let Z=0;Z<O.length;Z++){let ee=O[Z],ae=k(ee.input),J=w(ee.output);U.push(`${U.length===0?"M":"L"}${ae},${J}`)}_.push(o("path",{d:U.join(" "),fill:"none",stroke:f,"stroke-width":1.5,key:"curve"}))}let Y=(U,Z,ee,ae)=>{if(Z)return J=>Z({x:ae.x,y:ae.y,index:ee,event:J})};for(let U=0;U<r.length;U++){let Z=r[U],ee=k(Z.x),ae=w(Z.y),J={cx:ee,cy:ae,r:c,fill:m,cursor:"pointer",key:`pt-${U}`};g&&(J.onClick=Y("click",g,U,Z)),x&&(J.onDblClick=Y("dblclick",x,U,Z)),v&&(J.onContextMenu=Y("contextmenu",v,U,Z)),R&&(J.onMouseOver=Y("mouseover",R,U,Z)),_.push(o("circle",J))}let X=o("defs",{key:"defs"},o("clipPath",{id:"plot-clip"},o("rect",{x:De,y:De,width:t-2*De,height:n-2*De})));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:N,onMouseMove:F,onMouseUp:W,onMouseLeave:W,onWheel:H},X,..._)}function fi(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 pi(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,p=0,c=0;return i<60?(h=l,p=d):i<120?(h=d,p=l):i<180?(p=l,c=d):i<240?(p=d,c=l):i<300?(h=d,c=l):(h=l,c=d),[Math.floor((h+u)*255),Math.floor((p+u)*255),Math.floor((c+u)*255)]}function mi(e,t,n=[-2.5,1],r=[-1.25,1.25],i=80,s=fi){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 p=n[0]+h/e*(n[1]-n[0]);d.push(s(p,u,i))}a.push(d)}return a}function gi(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=fi,data:d,resolution:u=2,onPointClick:h,onPointHover:p,onPointDoubleClick:c,onPointContextMenu:m}=e;if(d){let C=d.length,N=C>0?d[0].length:0,F=N>0?t/N:1,W=C>0?n/C:1,H=[];for(let _=0;_<C;_++){let V=d[_];for(let K=0;K<N;K++){let Q=V[K]??0,[G,O,Y]=pi(Q,s,a);H.push(o("rect",{key:`${_}-${K}`,x:String(K*F),y:String(_*W),width:String(Math.ceil(F)),height:String(Math.ceil(W)),fill:`rgb(${G},${O},${Y})`}))}}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%"}},...H)}let[f,b]=j(r[0]),[y,g]=j(r[1]),[x,v]=j(i[0]),[R,D]=j(i[1]),M=te(null),$=te(!1),A=te(null),I=S((C,N)=>{let F=f+C/t*(y-f),W=R-N/n*(R-x);return{re:F,im:W}},[f,y,x,R,t,n]);re(()=>{let C=M.current;if(!C)return;let N=C.getContext("2d");if(!N)return;let F=N.createImageData(t,n),W=F.data;for(let H=0;H<n;H++)for(let _=0;_<t;_++){let{re:V,im:K}=I(_,H),Q=l(V,K,s),[G,O,Y]=pi(Q,s,a),X=(H*t+_)*4;W[X]=G,W[X+1]=O,W[X+2]=Y,W[X+3]=255}N.putImageData(F,0,0)},[f,y,x,R,t,n,s,a,l,I]);let P=S(C=>{let N=C.target.getBoundingClientRect(),F=C.clientX-N.left,W=C.clientY-N.top,{re:H,im:_}=I(F,W),V=l(H,_,s);return{re:H,im:_,iterations:V,event:C}},[I,l,s]),L=S(C=>{$.current=!0,A.current={x:C.clientX,y:C.clientY,rMin:f,rMax:y,iMin:x,iMax:R}},[f,y,x,R]),E=S(C=>{if(p&&p(P(C)),!$.current||!A.current)return;let N=A.current,F=C.clientX-N.x,W=C.clientY-N.y,H=(N.rMax-N.rMin)/t,_=(N.iMax-N.iMin)/n;b(N.rMin-F*H),g(N.rMax-F*H),v(N.iMin+W*_),D(N.iMax+W*_)},[t,n,p,P]),B=S(()=>{$.current=!1},[]),z=S(C=>{C.preventDefault();let N=C.deltaY>0?1.15:1/1.15,F=C.target.getBoundingClientRect(),W=C.clientX-F.left,H=C.clientY-F.top,{re:_,im:V}=I(W,H);b(_+(f-_)*N),g(_+(y-_)*N),v(V+(x-V)*N),D(V+(R-V)*N)},[I,f,y,x,R]),k=S(C=>{h&&h(P(C))},[h,P]),w=S(C=>{c&&c(P(C))},[c,P]),T=S(C=>{C.preventDefault(),m&&m(P(C))},[m,P]);return o("canvas",{ref:M,width:t,height:n,style:{cursor:"crosshair"},onMouseDown:L,onMouseMove:E,onMouseUp:B,onMouseLeave:B,onWheel:z,onClick:k,onDblClick:w,onContextMenu:T})}function hi(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 nc(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 b of e)b.x<i&&(i=b.x),b.x>s&&(s=b.x),b.y<a&&(a=b.y),b.y>l&&(l=b.y);i===s&&(i-=1,s+=1),a===l&&(a-=1,l+=1);let d=t-r*2,u=n-r*2,h=b=>r+(b-i)/(s-i)*d,p=b=>n-r-(b-a)/(l-a)*u,c=6,m=hi(i,s,c),f=hi(a,l,c);return{xScale:h,yScale:p,xTicks:m,yTicks:f,xMin:i,xMax:s,yMin:a,yMax:l}}function Yn(e,t,n,r){return q(()=>nc(e,t,n,r),[e,t,n,r])}function bi(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function xi(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 yi(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:p=!1,areaColor:c="rgba(59,130,246,0.15)",xLabel:m,yLabel:f,title:b,padding:y=50,animate:g=!1,multiLine:x}=e,v=q(()=>{let L=[...t];if(x)for(let E of x)L.push(...E.data);return L},[t,x]),R=Yn(v,n,r,y),{xScale:D,yScale:M,xTicks:$,yTicks:A}=R,I=[];if(I.push(o("rect",{x:0,y:0,width:"100%",fill:"white",key:"bg"})),h){for(let L=0;L<$.length;L++){let E=D($[L]);I.push(o("line",{x1:E,y1:y,x2:E,y2:r-y,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-x-${L}`}))}for(let L=0;L<A.length;L++){let E=M(A[L]);I.push(o("line",{x1:y,y1:E,x2:n-y,y2:E,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-y-${L}`}))}}I.push(o("line",{x1:y,y1:r-y,x2:n-y,y2:r-y,stroke:"#374151","stroke-width":1,key:"x-axis"})),I.push(o("line",{x1:y,y1:y,x2:y,y2:r-y,stroke:"#374151","stroke-width":1,key:"y-axis"}));for(let L=0;L<$.length;L++){let E=D($[L]);I.push(o("line",{x1:E,y1:r-y,x2:E,y2:r-y+5,stroke:"#374151",key:`xtick-${L}`})),I.push(o("text",{x:E,y:r-y+18,"text-anchor":"end","font-size":11,fill:"#6b7280",transform:`rotate(-45, ${E}, ${r-y+18})`,key:`xlabel-${L}`},bi($[L])))}for(let L=0;L<A.length;L++){let E=M(A[L]);I.push(o("line",{x1:y-5,y1:E,x2:y,y2:E,stroke:"#374151",key:`ytick-${L}`})),I.push(o("text",{x:y-10,y:E+4,"text-anchor":"end","font-size":11,fill:"#6b7280",key:`ylabel-${L}`},bi(A[L])))}function P(L,E,B,z,k,w,T,C,N,F){if(L.length===0)return;let W=[...L].sort((V,K)=>V.x-K.x);if(z){let V=M(R.yMin),K=W.map(Y=>`${D(Y.x)},${M(Y.y)}`).join(" "),Q=D(W[0].x),G=D(W[W.length-1].x),O=`${Q},${V} ${K} ${G},${V}`;I.push(o("polygon",{points:O,fill:k,key:`${F}-area`}))}let _={points:W.map(V=>`${D(V.x)},${M(V.y)}`).join(" "),fill:"none",stroke:E,"stroke-width":B,"stroke-linejoin":"round","stroke-linecap":"round",key:`${F}-line`};if(g?(_["stroke-dasharray"]="1000",_["stroke-dashoffset"]="1000",I.push(o("polyline",_,o("animate",{attributeName:"stroke-dashoffset",from:1e3,to:0,dur:"1.5s",fill:"freeze"})))):I.push(o("polyline",_)),w)for(let V=0;V<W.length;V++){let K=D(W[V].x),Q=M(W[V].y),G=W[V].shape??N,O=W[V].radius??C,Y=`${F}-pt-${V}`;if(g){let X=xi(G,K,Q,O,T,Y,{opacity:0});I.push(o("g",{key:`${Y}-g`},X,o("animate",{attributeName:"opacity",from:0,to:1,dur:"0.3s",begin:"1.2s",fill:"freeze"})))}else I.push(xi(G,K,Q,O,T,Y))}}if(P(t,i,s,p,c,u,l,a,d,"primary"),x)for(let L=0;L<x.length;L++){let E=x[L];P(E.data,E.color,s,!1,"transparent",u,E.color,E.pointRadius??a,E.pointShape??d,`series-${L}`)}if(x&&x.length>0){let L=[],E=[{color:i,label:"Primary"},...x.map((H,_)=>({color:H.color,label:H.label??`Series ${_+1}`}))],B=y+10,z=16,k=22,w=7.2,T=14,C=6,N=n-y*2-20,F=0,W=0;for(let H=0;H<E.length;H++){let _=E[H].label.length*w,V=T+C+_;F>0&&F+V>N&&(F=0,W+=k);let K=B+F,Q=y-30-W;L.push(o("rect",{x:K,y:Q,width:T,height:14,fill:E[H].color,rx:2,key:`legend-rect-${H}`})),L.push(o("text",{x:K+T+C,y:Q+12,"font-size":12,fill:"#374151",key:`legend-text-${H}`},E[H].label)),F+=V+z}I.push(o("g",{key:"legend"},...L))}return m&&I.push(o("text",{x:n/2,y:r-8,"text-anchor":"middle","font-size":13,fill:"#374151",key:"x-axis-label"},m)),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)),b&&I.push(o("text",{x:n/2,y:20,"text-anchor":"middle","font-size":16,"font-weight":"bold",fill:"#111827",key:"title"},b)),o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...I)}function oc(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 rc(e,t){let n=t??oc(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 Vn(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 p=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 ${p.x} ${p.y}`,`A ${n} ${n} 0 ${h} 0 ${c.x} ${c.y}`,"Z"].join(" ")}function Un(e,t){let n=t?.padAngle??0,r=rc(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],p=h.value/i*a,c=d+n/2,m=c+p;l.push({label:h.label,value:h.value,startAngle:c,endAngle:m,percentage:h.value/i*100,color:r[u]}),d=m+n/2}return l}function Si(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:p,colors:c,strokeColor:m="#fff",strokeWidth:f=2,textColor:b="currentColor"}=e,y=d&&u==="right"?140:0,g=h?30:0,x=d&&u==="bottom"?Math.ceil(t.length/2)*22+10:0,v=n-y,R=r-g-x,D=v/2,M=g+R/2,$=Math.min(v,R)/2-10,A=e.outerRadius??$,I=q(()=>Un(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:b},h));for(let L=0;L<I.length;L++){let E=I[L],B=Vn(D,M,i,A,E.startAngle,E.endAngle);if(P.push(o("path",{key:`slice-${L}`,d:B,fill:E.color,stroke:m,strokeWidth:f})),a||l){let z=(E.startAngle+E.endAngle)/2,k=E.percentage<5,w=k?A+14:i+(A-i)*.65,T=St(D,M,w,z-Math.PI/2),C=k?b:"#fff",N=k?11:12,F=[];if(a&&F.push(E.label),l&&F.push(`${E.percentage.toFixed(1)}%`),k){let W=St(D,M,A+2,z-Math.PI/2);P.push(o("line",{key:`connector-${L}`,x1:W.x,y1:W.y,x2:T.x,y2:T.y,stroke:"#999",strokeWidth:1}))}a&&P.push(o("text",{key:`label-${L}`,x:T.x,y:T.y-(l?6:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:N,fill:C,pointerEvents:"none"},E.label)),l&&P.push(o("text",{key:`value-${L}`,x:T.x,y:T.y+(a?10:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:N-1,fill:C,pointerEvents:"none"},`${E.percentage.toFixed(1)}%`))}}if(p&&i>0&&P.push(o("text",{key:"center-label",x:D,y:M,textAnchor:"middle",dominantBaseline:"central",fontFamily:"sans-serif",fontSize:14,fontWeight:"bold",fill:b},p)),d){let L=[];if(u==="right"){let E=v+10,B=g+20;for(let z=0;z<I.length;z++){let k=I[z],w=B+z*22;L.push(o("circle",{key:`legend-dot-${z}`,cx:E+6,cy:w,r:6,fill:k.color})),L.push(o("text",{key:`legend-text-${z}`,x:E+18,y:w,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:b},`${k.label} (${k.percentage.toFixed(1)}%)`))}}else{let E=r-x+10;for(let B=0;B<I.length;B++){let z=I[B],k=B%2,w=Math.floor(B/2),T=k*(n/2)+10,C=E+w*22;L.push(o("circle",{key:`legend-dot-${B}`,cx:T+6,cy:C,r:6,fill:z.color})),L.push(o("text",{key:`legend-text-${B}`,x:T+18,y:C,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:b},`${z.label} (${z.percentage.toFixed(1)}%)`))}}P.push(...L)}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...P)}function vi(e,t,n,r,i){return{x:n+e*Math.cos(t)*i,y:r-e*Math.sin(t)*i}}function wi(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:p="#3b82f6",curveColor:c="#3b82f6",onPointClick:m,onPointDoubleClick:f,onPointContextMenu:b,onPointHover:y}=e,[g,x]=j(r[1]),[v,R]=j(0),[D,M]=j(0),[$,A]=j(null),I=t/2+v,P=n/2+D,E=Math.min(t,n)/2-30,B=E/g,z=q(()=>{let O=Math.max(1,Math.ceil(g)),Y=[],X=g/O;for(let U=1;U<=O;U++)Y.push(X*U);return Y},[g]),k=q(()=>{let O=[];for(let Y=0;Y<360;Y+=30)O.push(Y*Math.PI/180);return O},[]),w=q(()=>{if(!i||!l)return[];let O=a??2*Math.PI/s,Y=yt({start:0,end:2*Math.PI,step:O});return qt(i,Y)},[i,s,a,l]),[T,C]=j([]),N=te(null);re(()=>{if(!i||l){C([]);return}let O=a??2*Math.PI/s,Y=yt({start:0,end:2*Math.PI,step:O});return N.current&&N.current(),N.current=Zt(i,Y,200,X=>{C([...X])}),()=>{N.current&&N.current()}},[i,s,a,l]);let F=l?w:T,W=q(()=>{if(F.length===0)return"";let O=[];for(let Y=0;Y<F.length;Y++){let X=F[Y],U=X.output;if(U<0||!isFinite(U))continue;let{x:Z,y:ee}=vi(U,X.input,I,P,B);O.push(`${O.length===0?"M":"L"}${Z.toFixed(2)},${ee.toFixed(2)}`)}return O.join(" ")},[F,I,P,B]),H=S(O=>{A({x:O.clientX,y:O.clientY,px:v,py:D})},[v,D]),_=S(O=>{$&&(R($.px+(O.clientX-$.x)),M($.py+(O.clientY-$.y)))},[$]),V=S(()=>{A(null)},[]),K=S(O=>{O.preventDefault();let Y=O.deltaY>0?1.15:1/1.15;x(Math.max(.1,g*Y))},[g]),Q=S((O,Y,X)=>{if(O)return U=>O({r:Y.r,theta:Y.theta,index:X,event:U})},[]),G=[];if(G.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),u){for(let O=0;O<z.length;O++){let Y=z[O]*B;G.push(o("circle",{cx:I,cy:P,r:Y,fill:"none",stroke:"#e5e7eb","stroke-width":1,key:`gc-${O}`})),G.push(o("text",{x:I+Y+2,y:P-4,"font-size":10,fill:"#9ca3af",key:`gl-${O}`},z[O].toFixed(1)))}for(let O=0;O<k.length;O++){let Y=k[O],X=z[z.length-1]*B,U=I+X*Math.cos(Y),Z=P-X*Math.sin(Y);G.push(o("line",{x1:I,y1:P,x2:U,y2:Z,stroke:"#e5e7eb","stroke-width":1,key:`al-${O}`}));let ee=Math.round(Y*180/Math.PI),ae=I+(X+14)*Math.cos(Y),J=P-(X+14)*Math.sin(Y);G.push(o("text",{x:ae,y:J+4,"text-anchor":"middle","font-size":10,fill:"#9ca3af",key:`at-${O}`},`${ee}\xB0`))}}G.push(o("line",{x1:I-E,y1:P,x2:I+E,y2:P,stroke:"#d1d5db","stroke-width":1,key:"x-axis"})),G.push(o("line",{x1:I,y1:P-E,x2:I,y2:P+E,stroke:"#d1d5db","stroke-width":1,key:"y-axis"})),W&&G.push(o("path",{d:W,fill:"none",stroke:c,"stroke-width":2,key:"curve"}));for(let O=0;O<d.length;O++){let Y=d[O],{x:X,y:U}=vi(Y.r,Y.theta,I,P,B);G.push(o("circle",{cx:X,cy:U,r:h,fill:p,key:`pt-${O}`,style:{cursor:"pointer"},onClick:Q(m,Y,O),onDblClick:Q(f,Y,O),onContextMenu:Q(b,Y,O),onMouseEnter:Q(y,Y,O)}))}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",style:{cursor:$?"grabbing":"grab"},onMouseDown:H,onMouseMove:_,onMouseUp:V,onMouseLeave:V,onWheel:K},...G)}function jn(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 Gn(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 Xn(e,t){let n=ki(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=sc(n,ic(e,i,s,a))}r++}return n}function ki(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 ic(e,t,n,r){let i=ki(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 sc(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 Kn(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 qn(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=jn(e),s=Gn(e),a=Xn(e,t);return{vertices:i.map((d,u)=>{let h=Kn(a,d),p=qn(h,n);return{id:u,position:d,x:p.x*r,y:p.y*r,depth:p.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 Ci(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",p=e.scale??Math.min(n,r)*.3,c=Tt(t),m=1<<t,f=q(()=>e.vertexColors==="auto"||e.vertexColors===void 0?Jt(m):e.vertexColors,[m,e.vertexColors]),[b,y]=j(()=>{let C=[];for(let N=0;N<c;N++)C.push(0);return C}),[g,x]=j(!1),v=te({x:0,y:0}),R=te([]),D=te(0);re(()=>{if(d===0)return;let C=!0,N=()=>{C&&(y(F=>{let W=F.slice();for(let H=0;H<W.length;H++)W[H]=(W[H]??0)+d*(1+H*.3);return W}),D.current=requestAnimationFrame(N))};return D.current=requestAnimationFrame(N),()=>{C=!1,cancelAnimationFrame(D.current)}},[d]);let M=q(()=>Pt(t,b,l,p),[t,b,l,p]),$=n/2,A=r/2,I=q(()=>M.edges.map(C=>{let N=M.vertices[C.source],F=M.vertices[C.target],W=(N.depth+F.depth)/2;return{...C,avgDepth:W,sv:N,tv:F}}).sort((C,N)=>C.avgDepth-N.avgDepth),[M]),P=q(()=>M.vertices.slice().sort((C,N)=>C.depth-N.depth),[M]),L=S(C=>{let N=C;x(!0),v.current={x:N.clientX,y:N.clientY},R.current=b.slice()},[b]),E=S(C=>{if(!g)return;let N=C,F=(N.clientX-v.current.x)*.01,W=(N.clientY-v.current.y)*.01;y(()=>{let H=R.current.slice();return H.length>0&&(H[0]=(H[0]??0)+F),H.length>1&&(H[1]=(H[1]??0)+W),H})},[g]),B=S(()=>{x(!1)},[]),z=C=>{let N=(C+2)/4;return .3+.7*Math.max(0,Math.min(1,N))},k=C=>{let N=(C+2)/4;return .6+.4*Math.max(0,Math.min(1,N))},w=I.map((C,N)=>{let F=z(C.avgDepth);return o("line",{key:`e-${C.source}-${C.target}`,x1:String($+C.sv.x),y1:String(A+C.sv.y),x2:String($+C.tv.x),y2:String(A+C.tv.y),stroke:a,"stroke-width":String(s),"stroke-opacity":String(F),"stroke-linecap":"round"})}),T=P.map(C=>{let N=i*k(C.depth),F=f[C.id%f.length]??"#3b82f6",W=[o("circle",{key:`v-${C.id}-circle`,cx:String($+C.x),cy:String(A+C.y),r:String(N),fill:F,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($+C.x),y:String(A+C.y+N+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:g?"grabbing":"grab",userSelect:"none"},onMouseDown:L,onMouseMove:E,onMouseUp:B,onMouseLeave:B},...w,...T.flat())}function Mi(e={}){let t=e.dimension??4,n=e.rotationSpeed??.008,r=e.perspective??.25,i=e.scale??200,s=Tt(t),[a,l]=j(()=>new Array(s).fill(0));return re(()=>{if(n===0)return;let u=!0,h=0,p=()=>{u&&(l(c=>c.map((m,f)=>m+n*(1+f*.3))),h=requestAnimationFrame(p))};return h=requestAnimationFrame(p),()=>{u=!1,cancelAnimationFrame(h)}},[n]),{data:q(()=>Pt(t,a,r,i),[t,a,r,i]),angles:a,setAngles:l}}function Ei(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:ac(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?cc(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),p=lc(d,h,u,t,n);return o("div",{className:`viz-wrapper ${e.className??""}`.trim(),style:l},...p)}function ac(e,t){return"column"}function lc(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 cc(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"}},dc(n),o("span",null,n.label))))}function dc(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 uc(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 pc(){typeof window>"u"||(window.dataLayer=window.dataLayer||[],window.gtag||(window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date)))}function Ii(e){let{measurementId:t,disabled:n=!1,debug:r=!1,anonymizeIp:i=!1,config:s}=e;return re(()=>{if(n||typeof window>"u")return;uc(t),pc();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:p="Site footer"}=e;return o("footer",{className:h,role:"contentinfo","aria-label":p,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 Di=je({windows:[],openWindow:()=>{},closeWindow:()=>{},focusWindow:()=>{},minimizeWindow:()=>{},maximizeWindow:()=>{},restoreWindow:()=>{},moveWindow:()=>{},resizeWindow:()=>{},tileWindows:()=>{},cascadeWindows:()=>{},minimizeAll:()=>{},focusedWindowId:null,setMenuBar:()=>{},clearMenuBar:()=>{},activeMenuBar:null,signalDock:()=>{},dockSignals:new Map}),fc={width:600,height:400},mc={x:30,y:30},gc={top:0,left:0,width:1920,height:1080},Zn=1e3;function Pi(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 Jn(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 Ti(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 Qn(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??gc,n=e.defaultWindowSize??fc,r=e.cascadeOffset??mc,[i,s]=j([]),a=S(((...L)=>{let E=L[0];s(B=>{if(B.find(W=>W.id===E.id)){let H=Qn(B)+1,_=B.map(V=>V.id===E.id?{...V,focused:!0,zIndex:H,windowState:V.windowState==="minimized"?"normal":V.windowState}:{...V,focused:!1});return H>Zn&&(_=Jn(_)),_}let k=E.size??n,w=E.position??Pi(B.length,r,t,k),C=Qn(B)+1,N={id:E.id,title:E.title,icon:E.icon,position:w,size:k,windowState:"normal",zIndex:C,focused:!0,appProps:E.appProps},F=B.map(W=>({...W,focused:!1}));return F.push(N),C>Zn&&(F=Jn(F)),e.onWindowOpen&&e.onWindowOpen(E.id),e.onFocusChange&&e.onFocusChange(E.id),F})}),[n,r,t,e.onWindowOpen,e.onFocusChange]),l=S(((...L)=>{let E=L[0];v(B=>{if(B[E]){let z={...B};return delete z[E],z}return B}),D(B=>{if(B.has(E)){let z=new Map(B);return z.delete(E),z}return B}),s(B=>{let z=B.find(w=>w.id===E);if(!z)return B;let k=B.filter(w=>w.id!==E);if(z.focused&&k.length>0){let w=Ti(k,E);if(w){let T=k.map(C=>({...C,focused:C.id===w.id}));return e.onWindowClose&&e.onWindowClose(E),e.onFocusChange&&e.onFocusChange(w.id),T}}return e.onWindowClose&&e.onWindowClose(E),k.length===0&&e.onFocusChange&&e.onFocusChange(null),k})}),[e.onWindowClose,e.onFocusChange]),d=S(((...L)=>{let E=L[0];s(B=>{if(!B.find(C=>C.id===E))return B;let w=Qn(B)+1,T=B.map(C=>C.id===E?{...C,focused:!0,zIndex:w}:{...C,focused:!1});return w>Zn&&(T=Jn(T)),e.onFocusChange&&e.onFocusChange(E),T})}),[e.onFocusChange]),u=S(((...L)=>{let E=L[0];s(B=>{let z=B.find(w=>w.id===E);if(!z)return B;let k=B.map(w=>w.id===E?{...w,windowState:"minimized",focused:!1}:w);if(z.focused){let w=Ti(k,E);w?(k=k.map(T=>({...T,focused:T.id===w.id})),e.onFocusChange&&e.onFocusChange(w.id)):e.onFocusChange&&e.onFocusChange(null)}return k})}),[e.onFocusChange]),h=S(((...L)=>{let E=L[0];s(B=>B.map(z=>z.id===E?{...z,windowState:"maximized"}:z))}),[]),p=S(((...L)=>{let E=L[0];s(B=>B.map(z=>z.id===E?{...z,windowState:"normal"}:z))}),[]),c=S(((...L)=>{let E=L[0],B=L[1];s(z=>z.map(k=>k.id===E?{...k,position:B}:k))}),[]),m=S(((...L)=>{let E=L[0],B=L[1];s(z=>z.map(k=>k.id===E?{...k,size:B}:k))}),[]),f=S(((...L)=>{s(E=>{let B=E.filter(w=>w.windowState!=="minimized");if(B.length===0)return E;let z=B.length,k=new Map;if(z===1)k.set(B[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(B[0].id,{position:{x:t.left,y:t.top},size:{width:w,height:t.height}}),k.set(B[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),T=Math.floor(t.height/2);k.set(B[0].id,{position:{x:t.left,y:t.top},size:{width:w,height:t.height}}),k.set(B[1].id,{position:{x:t.left+w,y:t.top},size:{width:t.width-w,height:T}}),k.set(B[2].id,{position:{x:t.left+w,y:t.top+T},size:{width:t.width-w,height:t.height-T}})}else{let w=Math.ceil(Math.sqrt(z)),T=Math.ceil(z/w),C=Math.floor(t.width/w),N=Math.floor(t.height/T);for(let F=0;F<B.length;F++){let W=Math.floor(F/w),H=F%w;k.set(B[F].id,{position:{x:t.left+H*C,y:t.top+W*N},size:{width:C,height:N}})}}return E.map(w=>{let T=k.get(w.id);return T?{...w,position:T.position,size:T.size,windowState:"normal"}:w})})}),[t]),b=S(((...L)=>{s(E=>{let B=E.filter(w=>w.windowState!=="minimized");if(B.length===0)return E;let z=[...B].sort((w,T)=>w.zIndex-T.zIndex),k=new Map;for(let w=0;w<z.length;w++){let T=Pi(w,r,t,z[w].size);k.set(z[w].id,{position:T,zIndex:w+1})}return E.map(w=>{let T=k.get(w.id);return T?{...w,position:T.position,zIndex:T.zIndex,windowState:"normal"}:w})})}),[r,t]),y=S(((...L)=>{s(E=>{let B=E.map(z=>({...z,windowState:"minimized",focused:!1}));return e.onFocusChange&&e.onFocusChange(null),B})}),[e.onFocusChange]),g=q(()=>{let L=i.find(E=>E.focused);return L?L.id:null},[i]),[x,v]=j({}),[R,D]=j(new Map),M=S(((...L)=>{let E=L[0],B=L[1];v(z=>({...z,[E]:B}))}),[]),$=S(((...L)=>{let E=L[0];v(B=>{let z={...B};return delete z[E],z})}),[]),A=q(()=>g&&x[g]?x[g]:null,[g,x]),I=S(((...L)=>{let E=L[0],B=L[1];D(z=>{let k=new Map(z),w=k.get(E);return k.set(E,{...w,...B}),k})}),[]),P=q(()=>({windows:i,openWindow:a,closeWindow:l,focusWindow:d,minimizeWindow:u,maximizeWindow:h,restoreWindow:p,moveWindow:c,resizeWindow:m,tileWindows:f,cascadeWindows:b,minimizeAll:y,focusedWindowId:g,setMenuBar:M,clearMenuBar:$,activeMenuBar:A,signalDock:I,dockSignals:R}),[i,a,l,d,u,h,p,c,m,f,b,y,g,M,$,A,I,R]);return o(Di.Provider,{value:P},e.children)}function vt(){return Ye(Di)}var $i=je({appId:""});function it(e){let t=q(()=>({appId:e.appId}),[e.appId]);return o($i.Provider,{value:t},e.children)}function wt(){return Ye($i).appId}var zi=je({publish:()=>{},subscribe:()=>()=>{},subscribeAll:()=>()=>{}});function Dt(e){let t=te([]),n=te([]),r=S(((...l)=>{let d=l[0],u=l[1],h=l[2],p=l[3]||"",c={channel:d,from:p,to:h||null,payload:u,timestamp:Date.now()},m=t.current;for(let b=0;b<m.length;b++){let y=m[b];y.channel===d&&(c.to&&y.appId!==c.to||!c.to&&y.appId===p||y.handler(c))}let f=n.current;for(let b=0;b<f.length;b++)f[b].handler(c)}),[]),i=S(((...l)=>{let d=l[0],u=l[1],h=l[2]||"",p={channel:d,handler:u,appId:h};return t.current=[...t.current,p],()=>{t.current=t.current.filter(c=>c!==p)}}),[]),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(zi.Provider,{value:a},e.children)}function st(){let e=Ye(zi),t=wt(),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 $t(e,t){let n=st(),r=te(t);r.current=t,re(()=>n.subscribe(e,s=>{r.current(s)}),[n,e])}var Ai=je({startDrag:()=>{},cancelDrag:()=>{},registerDropZone:()=>()=>{},currentDrag:null,isDragging:!1});function zt(e){let[t,n]=j(null),[r,i]=j({x:0,y:0}),s=te(new Map),a=te(null),l=t!==null,d=S(((...m)=>{let f=m[0];n(f)}),[]),u=S(((...m)=>{if(a.current){let f=s.current.get(a.current);f&&f.onDragLeave&&f.onDragLeave(),a.current=null}n(null)}),[]),h=S(((...m)=>{let f=m[0],b=m[1];return s.current=new Map(s.current),s.current.set(f,b),()=>{s.current=new Map(s.current),s.current.delete(f),a.current===f&&(a.current=null)}}),[]);re(()=>{if(!l)return;let m=y=>{let g=y;i({x:g.clientX,y:g.clientY});let x=document.elementFromPoint(g.clientX,g.clientY);if(!x)return;let v=null,R=s.current;R.forEach((M,$)=>{let A=document.querySelector(`[data-dropzone-id="${$}"]`);A&&A.contains(x)&&(v=$)});let D=a.current;if(v!==D){if(D){let M=R.get(D);M&&M.onDragLeave&&M.onDragLeave()}if(v){let M=R.get(v);M&&M.onDragEnter&&t&&M.acceptTypes.indexOf(t.type)!==-1&&M.onDragEnter(t)}a.current=v}},f=y=>{let g=a.current;if(g&&t){let x=s.current.get(g);x&&x.acceptTypes.indexOf(t.type)!==-1&&x.onDrop(t)}a.current=null,n(null)},b=y=>{y.key==="Escape"&&u()};return document.addEventListener("mousemove",m),document.addEventListener("mouseup",f),document.addEventListener("keydown",b),()=>{document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",f),document.removeEventListener("keydown",b)}},[l,t,u]);let p=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(Ai.Provider,{value:p},e.children,c)}function pt(){return Ye(Ai)}function eo(e,t){let n=pt(),r=wt(),i=te(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 At(e){let t=pt(),[n,r]=j(!1),i=te(e.zoneId||`zone-${Math.random().toString(36).slice(2,10)}`),s=te(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 hc=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],bc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function to(e){return e<10?"0"+String(e):String(e)}function xc(e,t,n){let r=e.getHours(),i=to(e.getMinutes()),s=to(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=to(r);return n?`${a}:${i}:${s}`:`${a}:${i}`}function yc(e){let t=hc[e.getDay()],n=bc[e.getMonth()],r=e.getDate();return`${t}, ${n} ${String(r)}`}function Sc(e){let{label:t,onClick:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=Ne(),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 vc(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(()=>xc(i,t,n),[i,t,n]),l=q(()=>yc(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 wc(e){let{indicator:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=Ne(),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 kc(e){let{item:t,onClose:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=Ne();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 Cc(e){let{user:t,menuItems:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=Ne(),[a,l]=j(!1),d=te(null),u=S(()=>{l(y=>!y)},[]),h=S(()=>{l(!1)},[]),p=S(y=>{let g=y;(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),l(x=>!x)),g.key==="Escape"&&l(!1)},[]);re(()=>{if(!a)return;let y=g=>{let x=d.current;x&&!x.contains(g.target)&&l(!1)};return document.addEventListener("click",y,!0),()=>{document.removeEventListener("click",y,!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"},m=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"},m),b=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((y,g)=>o(kc,{key:String(g),item:y,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:p,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")),b)}function Mc(e){let{menu:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=Ne(),[s,a]=j(!1),l=te(null),d=S(()=>{a(c=>!c)},[]),u=S(()=>{a(!1)},[]),h=S(c=>{let m=c;(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),a(f=>!f)),m.key==="Escape"&&a(!1)},[]);re(()=>{if(!s)return;let c=m=>{let f=l.current;f&&!f.contains(m.target)&&a(!1)};return document.addEventListener("click",c,!0),()=>{document.removeEventListener("click",c,!0)}},[s]);let p=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,m)=>c.divider?o("div",{key:"div-"+String(m),role:"separator",style:{height:"1px",backgroundColor:"var(--panel-divider, #555555)",margin:"4px 0"}}):o("button",{key:String(m),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),p)}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:p}=e,c=String(h)+"px",m=[];if(n&&m.push(o(Sc,{key:"activities",label:n.label,onClick:n.onClick})),t&&m.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++)m.push(o(Mc,{key:"appmenu-"+String(v),menu:r.menus[v]}));let f=o("div",{style:{display:"flex",alignItems:"center",height:"100%",flex:"1",minWidth:"0"}},...m),b=[];b.push(o(vc,{key:"clock",format:i,showSeconds:s,showDate:a})),p&&b.push(p);let y=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}},...b),g=[];if(l&&l.length>0){let v=l.map(R=>o(wc,{key:R.id,indicator:R}));g.push(o("div",{key:"indicators",style:{display:"flex",alignItems:"center",gap:"8px",height:"100%"}},...v))}d&&g.push(o(Cc,{key:"user",user:d,menuItems:u}));let x=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,y,x)}function Ec(e){return e.startsWith("http")||e.startsWith("/")||e.startsWith(".")}var Li=["#3465a4","#e67e22","#2ecc71","#3498db","#e74c3c","#9b59b6","#f39c12","#1abc9c","#e91e63","#00bcd4"];function Ic(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return Li[Math.abs(t)%Li.length]}function Rc(e){return e>99?"99+":String(e)}function Pc(e){return e.badge&&e.badge>0?`${e.label}, ${e.badge} unread`:e.label}function Tc(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 Dc(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 $c(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]),p=S(()=>{d(!1)},[]),c=S(()=>{!u&&s&&s(t.id)},[u,s,t.id]),m=S(D=>{if(!u&&a){let M=D;M.preventDefault(),a(t.id,{x:M.clientX,y:M.clientY})}},[u,a,t.id]),f=`${n}px`,b=Ec(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:Ic(t.icon),color:"#ffffff",borderRadius:"8px"},"aria-hidden":"true"},t.icon),y=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,g=t.active?o("span",{style:{...Dc(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",...Tc(r),padding:"4px 10px",backgroundColor:"#1f2937",color:"#ffffff",fontSize:"12px",borderRadius:"4px",whiteSpace:"nowrap",zIndex:"1000",pointerEvents:"none"}},t.label):null,R={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:R,"aria-label":Pc(t),"aria-pressed":t.active?"true":"false","aria-disabled":u?"true":void 0,tabIndex:u?-1:0,onClick:c,onContextMenu:m,onMouseEnter:h,onMouseLeave:p,"data-dock-item-id":t.id,"data-urgent":t.urgent?"true":void 0},b,y,g,x,v)}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,p]=j(!s),c=te(null),m=S(()=>{s&&(c.current!=null&&(clearTimeout(c.current),c.current=null),p(!0))},[s]),f=S(()=>{s&&(c.current=setTimeout(()=>{p(!1)},300))},[s]),b=S(R=>{let D=R,M=D.target,$=M.closest('[role="toolbar"]');if(!$)return;let A=Array.from($.querySelectorAll("button[data-dock-item-id]")),I=A.indexOf(M);if(I<0)return;let P=n==="vertical",L=P?"ArrowDown":"ArrowRight",E=P?"ArrowUp":"ArrowLeft";if(D.key===L){D.preventDefault();let B=A[I+1];B&&B.focus()}else if(D.key===E){D.preventDefault();let B=A[I-1];B&&B.focus()}else D.key==="Home"?(D.preventDefault(),A[0]?.focus()):D.key==="End"?(D.preventDefault(),A[A.length-1]?.focus()):(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),M.click())},[n]),y=n==="vertical",g={display:"flex",flexDirection:y?"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 x=[];for(let R=0;R<t.length;R++){if(a&&R===t.length-1&&t.length>1){let D=y?{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-${R}`,style:D,"aria-hidden":"true",role:"separator"}))}x.push(o($c,{key:t[R].id,item:t[R],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:g,onMouseEnter:m,onMouseLeave:f,onKeyDown:b},v,...x,u??null)}var zc="#2c001e";function nn(e){let{backgroundColor:t=zc,backgroundGradient:n,backgroundImage:r,backgroundImageOpacity:i=1,contextMenuItems:s,onClick:a,onDoubleClick:l,overflow:d="visible",children:u}=e,h=S(g=>{let x=g;x.target===x.currentTarget&&a&&a()},[a]),p=S(g=>{let x=g;x.target===x.currentTarget&&l&&l()},[l]),c=q(()=>{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]),m=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"},b=[];m&&b.push(o("div",{className:"desktop-background__image-overlay",style:m,"aria-hidden":"true"})),b.push(o("div",{className:"desktop-background__content",style:f},u));let y=o("div",{className:"desktop-background",style:c,onClick:h,onDblClick:p,role:"application","aria-label":"Desktop workspace","data-theme":"dark"},...b);return s&&s.length>0?o(Kt,{items:s},y):y}function no(e){let{items:t,backgroundColor:n="#007acc",color:r="#ffffff",height:i=22}=e,s=t.filter(p=>p.align!=="right"),a=t.filter(p=>p.align==="right"),l={display:"flex",alignItems:"center",justifyContent:"space-between",height:`${i}px`,backgroundColor:n,color:r,fontSize:"12px",flexShrink:"0",padding:"0 8px",overflow:"hidden",userSelect:"none"};function d(p){let c=typeof p.onClick=="function",m={display:"inline-flex",alignItems:"center",gap:"4px",padding:"0 6px",height:"100%",whiteSpace:"nowrap",cursor:c?"pointer":"default"},f=[];p.icon&&f.push(o("span",{className:"status-bar__item-icon",style:{fontSize:"12px",lineHeight:"1"}},p.icon)),f.push(o("span",{className:"status-bar__item-label"},p.label));let b={key:p.key,className:`status-bar__item${c?" status-bar__item--clickable":""}`,style:m};return c&&(b.onClick=p.onClick,b.onMouseEnter=y=>{y.currentTarget.style.backgroundColor="rgba(255, 255, 255, 0.15)"},b.onMouseLeave=y=>{y.currentTarget.style.backgroundColor=""}),o("span",b,...f)}let u=o("div",{className:"status-bar__left",style:{display:"flex",alignItems:"center",height:"100%",overflow:"hidden"}},...s.map(d)),h=o("div",{className:"status-bar__right",style:{display:"flex",alignItems:"center",height:"100%",overflow:"hidden"}},...a.map(d));return o("div",{className:"status-bar",style:l,role:"status","aria-label":"Status bar"},u,h)}var Ac={width:200,height:150},Lc={x:50,y:50},Bc={width:400,height:300},_e=8,oo=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 kt(e){let{id:t,title:n,icon:r,defaultPosition:i=Lc,defaultSize:s=Bc,minSize:a=Ac,maxSize:l,resizable:d=!0,draggable:u=!0,windowState:h="normal",focused:p=!0,zIndex:c,onClose:m,onMinimize:f,onMaximize:b,onFocus:y,onMove:g,onResize:x,statusBar:v,children:R}=e,[D,M]=j(i.x),[$,A]=j(i.y),[I,P]=j(s.width),[L,E]=j(s.height),[B,z]=j(!1),[k,w]=j(!1),[T,C]=j(null),N=te(null),F=te(null),W=te(null),H=S((le,ne)=>{let pe=Math.max(le,a.width),ie=Math.max(ne,a.height);return l&&(pe=Math.min(pe,l.width),ie=Math.min(ie,l.height)),{width:pe,height:ie}},[a,l]),_=S(()=>{let le=W.current;return le&&le.parentElement?{width:le.parentElement.clientWidth,height:le.parentElement.clientHeight}:{width:window.innerWidth,height:window.innerHeight}},[]),V=S((le,ne,pe,ie)=>{let he=_(),xe=Math.max(0,Math.min(le,he.width-pe)),Ce=Math.max(0,Math.min(ne,he.height-ie));return{x:xe,y:Ce}},[_]),K=S(le=>{if(!u||h==="maximized")return;let ne=le;ne.target.closest("button")||(ne.preventDefault(),N.current={startMouseX:ne.clientX,startMouseY:ne.clientY,startPosX:D,startPosY:$},z(!0))},[u,h,D,$]),Q=S(le=>{le.target.closest("button")||d&&b&&b()},[b,d]);re(()=>{if(!B)return;let le=pe=>{let ie=pe,he=N.current;if(!he)return;let xe=ie.clientX-he.startMouseX,Ce=ie.clientY-he.startMouseY,de=he.startPosX+xe,be=he.startPosY+Ce,ke=_();de=Math.max(0,Math.min(de,ke.width-I)),be=Math.max(0,Math.min(be,ke.height-L)),M(de),A(be),ie.clientX<=oo?C("left"):ie.clientX>=ke.width-oo?C("right"):ie.clientY<=oo?C("top"):C(null)},ne=pe=>{let ie=pe;z(!1);let he=_();if(T==="left"){M(0),A(0),P(Math.floor(he.width/2)),E(he.height),C(null),g&&g({x:0,y:0}),x&&x({width:Math.floor(he.width/2),height:he.height});return}if(T==="right"){let Ce=Math.floor(he.width/2);M(Ce),A(0),P(Ce),E(he.height),C(null),g&&g({x:Ce,y:0}),x&&x({width:Ce,height:he.height});return}if(T==="top"){C(null),b&&b();return}C(null);let xe=N.current;if(xe&&g){let Ce=ie.clientX-xe.startMouseX,de=ie.clientY-xe.startMouseY,be=xe.startPosX+Ce,ke=xe.startPosY+de;be=Math.max(0,Math.min(be,he.width-I)),ke=Math.max(0,Math.min(ke,he.height-L)),g({x:be,y:ke})}N.current=null};return document.addEventListener("mousemove",le),document.addEventListener("mouseup",ne),()=>{document.removeEventListener("mousemove",le),document.removeEventListener("mouseup",ne)}},[B,T,I,L,_,g,x,b]);let G=S(le=>ne=>{if(!d||h!=="normal")return;let pe=ne;pe.preventDefault(),pe.stopPropagation(),F.current={direction:le,startMouseX:pe.clientX,startMouseY:pe.clientY,startPosX:D,startPosY:$,startWidth:I,startHeight:L},w(!0)},[d,h,D,$,I,L]);re(()=>{if(!k)return;let le=pe=>{let ie=pe,he=F.current;if(!he)return;let xe=ie.clientX-he.startMouseX,Ce=ie.clientY-he.startMouseY,de=he.direction,be=he.startWidth,ke=he.startHeight,Re=he.startPosX,Le=he.startPosY;de.includes("e")&&(be=he.startWidth+xe),de.includes("w")&&(be=he.startWidth-xe,Re=he.startPosX+xe),de.includes("s")&&(ke=he.startHeight+Ce),de.includes("n")&&(ke=he.startHeight-Ce,Le=he.startPosY+Ce);let oe=H(be,ke);de.includes("w")&&(Re=he.startPosX+(he.startWidth-oe.width)),de.includes("n")&&(Le=he.startPosY+(he.startHeight-oe.height)),P(oe.width),E(oe.height),M(Re),A(Le)},ne=()=>{w(!1),x&&x({width:I,height:L}),F.current=null};return document.addEventListener("mousemove",le),document.addEventListener("mouseup",ne),()=>{document.removeEventListener("mousemove",le),document.removeEventListener("mouseup",ne)}},[k,I,L,H,x]),re(()=>{if(!p||!m)return;let le=ne=>{ne.key==="Escape"&&m()};return document.addEventListener("keydown",le),()=>document.removeEventListener("keydown",le)},[p,m]);let O=S(le=>{y&&y()},[y]);if(h==="minimized")return null;let Y=h==="maximized",X=q(()=>{let le={position:"absolute",display:"flex",flexDirection:"column",border:"1px solid var(--window-border, #555555)",borderRadius:Y?"0":"6px",overflow:"hidden",backgroundColor:"var(--window-body-bg, #1e1e1e)",boxShadow:p?"0 8px 32px rgba(0, 0, 0, 0.4)":"0 4px 16px rgba(0, 0, 0, 0.2)",transition:Y?"all 200ms ease":"box-shadow 200ms ease",outline:"none"};return Y?(le.top="0",le.left="0",le.width="100%",le.height="100%"):(le.top=`${$}px`,le.left=`${D}px`,le.width=`${I}px`,le.height=`${L}px`),c!==void 0&&(le.zIndex=String(c)),B&&(le.cursor="grabbing",le.userSelect="none"),le},[Y,D,$,I,L,c,p,B]),U=q(()=>{let le={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&&!Y?"grab":"default",opacity:p?"1":"0.6"};return B&&(le.cursor="grabbing"),le},[p,u,Y,B]),Z={flex:"1",overflow:"auto",backgroundColor:"var(--window-body-bg, #1e1e1e)"},ee={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"},ae=[];r&&(r.startsWith("http")||r.startsWith("/")||r.startsWith("data:")?ae.push(o("img",{src:r,alt:"",style:{width:"16px",height:"16px",marginRight:"6px",flexShrink:"0"},className:"draggable-window__icon"})):ae.push(o("span",{style:{marginRight:"6px",fontSize:"14px",flexShrink:"0"},className:"draggable-window__icon"},r))),ae.push(o("span",{className:"draggable-window__title-text",style:{flex:"1",fontSize:"13px",fontWeight:"500",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},n));let J=[];J.push(o("button",{type:"button","aria-label":"Minimize",className:"draggable-window__btn-minimize",style:{...ee,backgroundColor:"var(--window-button-minimize, #f39c12)"},onClick:le=>{le.stopPropagation(),f&&f()}})),d&&J.push(o("button",{type:"button","aria-label":Y?"Restore":"Maximize",className:"draggable-window__btn-maximize",style:{...ee,backgroundColor:"var(--window-button-maximize, #2ecc71)"},onClick:le=>{le.stopPropagation(),b&&b()}})),J.push(o("button",{type:"button","aria-label":"Close",className:"draggable-window__btn-close",style:{...ee,backgroundColor:"var(--window-button-close, #e74c3c)"},onClick:le=>{le.stopPropagation(),m&&m()}}));let se=o("div",{style:{display:"flex",alignItems:"center",flexShrink:"0"},className:"draggable-window__controls"},...J);ae.push(se);let ce=[];if(d&&!Y){let le=["n","s","e","w","ne","nw","se","sw"];for(let ne=0;ne<le.length;ne++){let pe=le[ne],ie={position:"absolute",zIndex:"1"};pe==="n"?(ie.top="0",ie.left=`${_e}px`,ie.right=`${_e}px`,ie.height=`${_e}px`):pe==="s"?(ie.bottom="0",ie.left=`${_e}px`,ie.right=`${_e}px`,ie.height=`${_e}px`):pe==="e"?(ie.top=`${_e}px`,ie.right="0",ie.bottom=`${_e}px`,ie.width=`${_e}px`):pe==="w"?(ie.top=`${_e}px`,ie.left="0",ie.bottom=`${_e}px`,ie.width=`${_e}px`):pe==="ne"?(ie.top="0",ie.right="0",ie.width=`${_e}px`,ie.height=`${_e}px`):pe==="nw"?(ie.top="0",ie.left="0",ie.width=`${_e}px`,ie.height=`${_e}px`):pe==="se"?(ie.bottom="0",ie.right="0",ie.width=`${_e}px`,ie.height=`${_e}px`):pe==="sw"&&(ie.bottom="0",ie.left="0",ie.width=`${_e}px`,ie.height=`${_e}px`),ie.cursor=Fc[pe],ce.push(o("div",{className:`draggable-window__resize-handle draggable-window__resize-${pe}`,style:ie,onMouseDown:G(pe)}))}}let me=null;if(T){let le={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"};T==="left"?(le.top="0",le.left="0",le.width="50%",le.height="100%"):T==="right"?(le.top="0",le.right="0",le.width="50%",le.height="100%"):T==="top"&&(le.top="0",le.left="0",le.width="100%",le.height="100%"),me=o("div",{className:"draggable-window__snap-preview",style:le})}let ge=[];for(let le=0;le<ce.length;le++)ge.push(ce[le]);ge.push(o("div",{className:"draggable-window__title-bar",style:U,onMouseDown:K,onDblClick:Q,role:"toolbar","aria-label":`${n} window controls`},...ae)),ge.push(o("div",{className:"draggable-window__body",style:Z},R)),v&&v!==!1&&ge.push(o(no,v));let ye=[o("div",{ref:W,id:`draggable-window-${t}`,className:`draggable-window ${p?"draggable-window--focused":"draggable-window--unfocused"} draggable-window--${h}`,style:X,role:"dialog","aria-label":n,tabIndex:-1,onMouseDown:O},...ge)];return me&&ye.push(me),ye.length===1?ye[0]:o("div",{style:{display:"contents"}},...ye)}var Nc=["File","Edit","View","Insert","Format","Tools","Help"],Bi={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"}]},_c=[{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"}}],Wc=[{label:"Align left",text:"\u2261",command:"justifyLeft"},{label:"Align center",text:"\u2263",command:"justifyCenter"},{label:"Align right",text:"\u2262",command:"justifyRight"}],Oc=["1","2","3","4","5","6","7"],Hc={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 on(e){let[t,n]=j(!1),[r,i]=j(!1),[s,a]=j(!1),[l,d]=j(-1),[u,h]=j(""),[p,c]=j(-1),[m,f]=j(0),[b,y]=j("3"),g=te(null),x=S(()=>{document.execCommand("bold",!1),n(U=>!U),g.current&&g.current.focus()},[]),v=S(()=>{document.execCommand("italic",!1),i(U=>!U),g.current&&g.current.focus()},[]),R=S(()=>{document.execCommand("underline",!1),a(U=>!U),g.current&&g.current.focus()},[]),D={bold:x,italic:v,underline:R},M={bold:t,italic:r,underline:s},$=S(U=>{document.execCommand(U,!1),g.current&&g.current.focus()},[]),A=S(U=>{document.execCommand("fontSize",!1,U),y(U),g.current&&g.current.focus()},[]),I=S(U=>{c(Z=>Z===U?-1:U)},[]),P=S(U=>{switch(U){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()},[]),L=S(()=>{if(g.current){let U=g.current.textContent??"";f(Fi(U))}},[]),E=S(()=>{c(-1)},[]),B=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"},T={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"},N={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"},F=q(()=>Yc(),[]),W=e.content??"Start typing...",H=Fi(W),_=m>0?m:H;function V(U){return{padding:"4px 10px",cursor:"pointer",borderRadius:"3px",fontSize:"13px",color:"var(--color-text, #333)",backgroundColor:p===U?"rgba(0,0,0,0.12)":l===U?"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 G(U,Z){return{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid transparent",borderRadius:"3px",cursor:"pointer",fontSize:"13px",backgroundColor:M[U]??!1?"rgba(0,0,0,0.12)":u===U?"rgba(0,0,0,0.06)":"transparent",color:"var(--color-text, #444)",transition:"background 0.15s",...Z??{}}}let O={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"},Y={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"},X=Nc.map((U,Z)=>{let ee=[U];return p===Z&&Bi[U]&&ee.push(o("div",{key:"dropdown",style:K,className:"word-processor__menu-dropdown"},...Bi[U].map((ae,J)=>o("button",{key:String(J),style:Q,onClick:se=>{se.stopPropagation(),P(ae.action)},role:"menuitem"},ae.label)))),o("button",{key:String(Z),style:V(Z),role:"menuitem","aria-label":U,onClick:()=>I(Z),onMouseEnter:()=>{d(Z)},onMouseLeave:()=>d(-1)},...ee)});return o("div",{className:`word-processor ${e.className??""}`.trim(),style:B},o("div",{className:"word-processor__menu-bar",style:z,role:"menubar"},...X),o("div",{className:"word-processor__toolbar",style:k,role:"toolbar","aria-label":"Formatting toolbar"},o("div",{style:O,"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"}},..._c.map(U=>o("button",{key:U.id,style:G(U.id,U.style),title:U.shortcut?`${U.label} (${U.shortcut})`:U.label,"aria-label":U.label,"aria-pressed":String(M[U.id]??!1),onClick:D[U.id],onMouseEnter:()=>h(U.id),onMouseLeave:()=>h("")},U.text))),o("div",{key:"1",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px",alignItems:"center"}},o("select",{style:Y,"aria-label":"Font size",value:b,onChange:U=>{let Z=U.target;A(Z.value)}},...Oc.map(U=>o("option",{key:U,value:U},Hc[U])))),o("div",{key:"2",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},...Wc.map((U,Z)=>o("button",{key:String(Z),style:G(`align-${Z}`),title:U.label,"aria-label":U.label,onClick:()=>$(U.command),onMouseEnter:()=>h(`align-${Z}`),onMouseLeave:()=>h("")},U.text)))),o("div",{className:"word-processor__ruler",style:w,"aria-hidden":"true"},...F),o("main",{className:"word-processor__document-area",style:T,onClick:E},o("div",{className:"word-processor__page",style:C,contentEditable:"true",ref:g,onInput:L,suppressContentEditableWarning:!0},W)),o("div",{className:"word-processor__status-bar",style:N},o("span",null,"Page 1 of 1"),o("span",null,`${_} words`),o("span",null,"100%")))}function rn(e){let t=q(()=>({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 Vc={height:"28px",backgroundColor:"#3c3c3c",display:"flex",alignItems:"center",padding:"0 8px",gap:"2px",flexShrink:"0",position:"relative"},Ni={padding:"3px 8px",fontSize:"12px",color:"#cccccc",cursor:"pointer",borderRadius:"3px",backgroundColor:"transparent",border:"none",position:"relative"},Uc={...Ni,backgroundColor:"rgba(255,255,255,0.1)"},jc={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"},Gc={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]=j(-1),r=S(a=>{n(l=>l===a?-1:a)},[]),i=S(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:jc,className:"ide__menu-dropdown"},...e.menuItems[a].map((h,p)=>o("button",{key:String(p),style:Gc,onClick:c=>{c.stopPropagation(),i(h.action)},role:"menuitem"},h.label)))),o("button",{key:String(l),style:u?Uc:Ni,role:"menuitem","aria-label":a,onClick:()=>r(l)},...d)});return o("div",{className:"ide__menu-bar",style:Vc,role:"menubar"},...s)}var Xc={width:"220px",backgroundColor:"#252526",borderRight:"none",display:"flex",flexDirection:"column",flexShrink:"0",overflowY:"auto"},Kc={padding:"8px 12px",fontSize:"11px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#bbbbbb"};function qc(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:qc(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:Xc,"aria-label":"File explorer"},o("div",{style:Kc},"Explorer"),...r)}var Zc={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"},Qc={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:Qc,"aria-label":n,onClick:()=>e.onTabClick(n)},n)});return o("div",{style:Zc},...t)}var cn="#569cd6",ro="#ce9178",io="#4ec9b0",so="#6a9955",ao="#dcdcaa",Lt="#d4d4d4",lo="#d4d4d4",co="#b5cea8",ed=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"]),td=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;ed.has(i)?l=cn:td.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 nd={flex:"1",display:"flex",overflow:"auto",backgroundColor:"#1e1e1e",fontFamily:'"Cascadia Code", "Fira Code", "Consolas", monospace',fontSize:"13px",lineHeight:"20px"},od={padding:"8px 0",textAlign:"right",color:"#858585",userSelect:"none",minWidth:"48px",paddingRight:"12px",paddingLeft:"12px",flexShrink:"0"},rd={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:nd},o("div",{style:od,"aria-hidden":"true"},...n),o("code",{style:rd,contentEditable:"true",ref:e.editorRef,onInput:e.onInput,suppressContentEditableWarning:!0},...t))}var id={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:id,"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 sd={height:"22px",backgroundColor:"#007acc",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 12px",fontSize:"12px",color:"#ffffff",flexShrink:"0"},ad={cursor:"pointer",padding:"0 6px",borderRadius:"3px",transition:"background-color 0.15s"};function uo(e){let t=n=>n.map((r,i)=>o("span",{key:String(i),style:ad,onClick:r.onClick},r.label));return o("div",{className:"ide__status-bar",style:sd},o("div",{style:{display:"flex",gap:"16px"}},...t(e.items)),o("div",{style:{display:"flex",gap:"16px"}},...t(e.rightItems)))}var ld=["File","Edit","Selection","View","Go","Run","Terminal","Help"],cd={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"}]},dd=[{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}],po={"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"]',"}"]},_i=po["App.ts"];function fn(e){let[t,n]=j("App.ts"),[r,i]=j({src:!0,components:!0,hooks:!0}),[s,a]=j(_i.length),l=te(null),d=S(v=>{n(v);let R=po[v];R&&a(R.length)},[]),u=S(v=>{i(R=>{let D={},M=Object.keys(R);for(let $=0;$<M.length;$++)D[M[$]]=R[M[$]];return D[v]=!R[v],D})},[]),h=S(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"newFile":l.current&&(l.current.textContent="",a(1));break;default:break}l.current&&l.current.focus()},[]),p=S(()=>{if(l.current){let R=(l.current.textContent??"").split(`
|
|
8
|
-
`);a(Math.max(R.length,1))}},[]),c=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"}),[]),m={flex:"1",display:"flex",overflow:"hidden"},f={width:"1px",backgroundColor:"#007acc",cursor:"col-resize",flexShrink:"0",opacity:"0.4",transition:"opacity 0.2s"},b={flex:"1",display:"flex",flexDirection:"column",overflow:"hidden"},y=8,g=30,x=po[t]??_i;return o("div",{className:`ide ${e.className??""}`.trim(),style:c},o(rn,{title:"SpecifyJS IDE"}),o(sn,{menus:ld,menuItems:cd,onAction:h}),o("div",{style:m},o(an,{files:dd,activeFile:t,expandedFolders:r,onFileClick:d,onFolderToggle:u}),o("div",{style:f}),o("div",{style:b},o(ln,{tabs:[t],activeTab:t,onTabClick:d}),o(un,{content:x,onInput:p,editorRef:l})),o(pn,{lines:x,visibleStart:y,visibleEnd:g,totalLines:x.length})),o(uo,{items:[{label:"\u2387 main"},{label:"0 errors"},{label:"0 warnings"}],rightItems:[{label:"Ln 1, Col 1"},{label:"UTF-8"},{label:"TypeScript"}]}))}var ud=[{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}],Oi=[{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}],Hi=[{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}],pd=[{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}],fd=[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],Yi=[{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}],Vi=[{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}],Ui=["09:30","10:00","10:30","11:00","11:30","12:00"];function md(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"},mn={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"},gn={cursor:"default",transition:"background-color 0.1s"};function gd(e,t){let i=Math.min(...e),a=Math.max(...e)-i||1,l=e.map((u,h)=>{let p=h/(e.length-1)*40,c=14-(u-i)/a*14;return`${p.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 hd(e,t){let u=Math.min(...e),h=Math.max(...e),p=h-u||1,c=310/(e.length-1),m=e.map((M,$)=>{let A=40+$*c,I=15+(1-(M-u)/p)*120;return{x:A,y:I}}),f=m.map(M=>`${M.x.toFixed(1)},${M.y.toFixed(1)}`).join(" "),b="M40,135 "+m.map(M=>`L${M.x.toFixed(1)},${M.y.toFixed(1)}`).join(" ")+` L${m[m.length-1].x.toFixed(1)},135 Z`,y=[];for(let M=1;M<e.length;M++){let $=e[M]>=e[M-1]?"#00c853":"#ff1744";y.push(o("line",{key:String(M),x1:String(m[M-1].x.toFixed(1)),y1:String(m[M-1].y.toFixed(1)),x2:String(m[M].x.toFixed(1)),y2:String(m[M].y.toFixed(1)),stroke:$,strokeWidth:"2",strokeLinecap:"round"}))}let g=[];for(let M=0;M<5;M++){let $=15+M/4*120,A=h-M/4*p;g.push(o("line",{key:`g${M}`,x1:String(40),y1:String($.toFixed(1)),x2:String(350),y2:String($.toFixed(1)),stroke:"#2a2a4a",strokeWidth:"0.5",strokeDasharray:"3,3"})),g.push(o("text",{key:`yl${M}`,x:String(36),y:String(($+3).toFixed(1)),fill:"#6666aa",fontSize:"8",textAnchor:"end",fontFamily:"monospace"},Ge(A)))}let x=[],v=Math.min(Ui.length,e.length),R=(e.length-1)/(v-1);for(let M=0;M<v;M++){let A=40+Math.round(M*R)*c;x.push(o("text",{key:`tl${M}`,x:String(A.toFixed(1)),y:String(156),fill:"#6666aa",fontSize:"8",textAnchor:"middle",fontFamily:"monospace"},Ui[M]))}let D="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:D,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:b,fill:`url(#${D})`}),...g,...x,...y,o("line",{x1:String(40),y1:String((15+(1-(t-u)/p)*120).toFixed(1)),x2:String(350),y2:String((15+(1-(t-u)/p)*120).toFixed(1)),stroke:"#00c853",strokeWidth:"0.5",strokeDasharray:"4,2",opacity:"0.6"})))}function bd(){let e=Math.max(...Wi.map(t=>t.qty),...Oi.map(t=>t.qty));return o("div",{style:Ct},o("div",{style:Mt},"Order Book"),o("table",{style:mn},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=Oi[n],i=t.qty/e*.25,s=(r?.qty??0)/e*.25;return o("tr",{key:String(n),style:gn},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 xd(e){return o("div",{style:Ct},o("div",{style:Mt},"Watchlist"),o("table",{style:mn},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,...ud.map((t,n)=>{let r=t.price+(n===0?e:0),i=t.change>=0;return o("tr",{key:String(n),style:gn},o("td",{style:{...He,fontWeight:"600",color:"#ffffff"}},t.symbol,gd(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"}},md(t.volume)))}))))}function yd(){let e=Hi.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:mn},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,...Hi.map((n,r)=>{let i=n.pnl>=0;return o("tr",{key:String(r),style:{...gn,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 Sd(){return o("div",{style:Ct},o("div",{style:Mt},"Recent Trades"),o("table",{style:mn},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,...pd.map((e,t)=>{let n=e.side==="BUY";return o("tr",{key:String(t),style:gn},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 vd(){let e=Math.max(...Yi.map(n=>n.volume),...Vi.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"}},...Yi.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"}}),...Vi.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 hn(e){let[t,n]=j(0),[r,i]=j("--:--:--"),[s,a]=j(!0);re(()=>{let m=setInterval(()=>{n(f=>{let b=(Math.random()-.5)*.5;return Math.round(b*100)/100})},2e3);return()=>clearInterval(m)},[]),re(()=>{let m=()=>{let b=new Date,y=String(b.getHours()).padStart(2,"0"),g=String(b.getMinutes()).padStart(2,"0"),x=String(b.getSeconds()).padStart(2,"0");i(`${y}:${g}:${x}`)};m();let f=setInterval(m,1e3);return()=>clearInterval(f)},[]),re(()=>{let m=setInterval(()=>{a(f=>!f)},800);return()=>clearInterval(m)},[]);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"},p=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},hd(fd,p),bd(),xd(t),yd(),Sd(),vd()))}function Be(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 Be(e)?e.card_id:e.container_id}function fo(e){return Be(e)?e.card_title:e.name}var mo={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 wd(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 kd(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 Cd(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 Md(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 bn(e){let{card:t,selected:n=!1,onSelect:r,onMove:i,onResize:s,onDelete:a,dispatch:l,onOpenProject:d,onCardContextMenu:u,onUpdate:h,onDragStart:p,onDragEnd:c,onAnchorDragStart:m}=e,[f,b]=j(!1),[y,g]=j(!1),[x,v]=j(null),[R,D]=j(!1),[M,$]=j(!1),[A,I]=j(!1),[P,L]=j(t.card_title||""),[E,B]=j(""),z=te(null),k=te(null),w=t.priority?mo[t.priority]||"#94a3b8":"transparent",T=S(de=>{let be=de;be.preventDefault(),be.stopPropagation(),v({x:be.clientX,y:be.clientY}),D(!1),u&&u(t.card_id,{x:be.clientX,y:be.clientY})},[u,t.card_id]),C=S(()=>{v(null),D(!1)},[]),N=S(de=>{let be=de,ke=be.target;if(ke.dataset&&(ke.dataset.role==="delete"||ke.dataset.role==="resize"||ke.dataset.role==="drag-handle"||ke.dataset.role==="inline-edit"||ke.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},p&&p(t.card_id),g(!0);let Re=oe=>{let fe=oe;if(!z.current)return;let Se=fe.clientX-z.current.x,we=fe.clientY-z.current.y;i&&i(t.card_id,{x:z.current.cardX+Se,y:z.current.cardY+we})},Le=()=>{z.current=null,g(!1),c&&c(t.card_id),document.removeEventListener("mousemove",Re),document.removeEventListener("mouseup",Le)};document.addEventListener("mousemove",Re),document.addEventListener("mouseup",Le)},[t.card_id,t.position.x,t.position.y,r,i,p,c]),F=S(de=>{let be=de;be.preventDefault(),be.stopPropagation(),k.current={x:be.clientX,y:be.clientY,w:t.size.width,h:t.size.height};let ke=Le=>{let oe=Le;if(!k.current)return;let fe=oe.clientX-k.current.x,Se=oe.clientY-k.current.y,we=Math.max(120,k.current.w+fe),Ie=Math.max(80,k.current.h+Se);s&&s(t.card_id,{width:we,height:Ie})},Re=()=>{k.current=null,document.removeEventListener("mousemove",ke),document.removeEventListener("mouseup",Re)};document.addEventListener("mousemove",ke),document.addEventListener("mouseup",Re)},[t.card_id,t.size.width,t.size.height,s]),W=S(de=>{de.preventDefault(),de.stopPropagation(),a&&a(t.card_id)},[t.card_id,a]),H=S(de=>{let be=de;be.preventDefault(),be.stopPropagation();let Re=be.target.dataset.anchor;if(!Re||!m)return;let Le=t.position.x,oe=t.position.y,fe=t.size.width,Se=t.size.height,we=Le+fe/2,Ie=oe+Se/2;Re==="top"?(we=Le+fe/2,Ie=oe):Re==="right"?(we=Le+fe,Ie=oe+Se/2):Re==="bottom"?(we=Le+fe/2,Ie=oe+Se):Re==="left"&&(we=Le,Ie=oe+Se/2),m(t.card_id,Re,{x:we,y:Ie})},[t.card_id,t.position.x,t.position.y,t.size.width,t.size.height,m]),_=S(de=>{l&&l({type:"CHANGE_CARD_TYPE",cardId:t.card_id,newType:de}),C()},[t.card_id,l,C]),V=S(de=>{de.preventDefault(),de.stopPropagation(),L(t.card_title||""),$(!0)},[t.card_title]),K=S(()=>{$(!1),h&&P!==t.card_title&&h(t.card_id,{card_title:P})},[h,t.card_id,t.card_title,P]),Q=S(de=>{let be=de;be.key==="Enter"?(be.preventDefault(),K()):be.key==="Escape"&&(be.preventDefault(),$(!1),L(t.card_title||""))},[K,t.card_title]),G=S(de=>{let be=de.target;L(be.value)},[]),O=S(de=>{de.stopPropagation();let be=t.content;B(be.text||""),I(!0)},[t.content]),Y=S(()=>{I(!1),h&&h(t.card_id,{content:{text:E}})},[h,t.card_id,E]),X=S(de=>{let be=de;if(be.key==="Escape"){be.preventDefault(),I(!1);let ke=t.content;B(ke.text||"")}},[t.content]),U=S(de=>{let be=de.target;B(be.value)},[]),Z;switch(t.card_type){case"text":A?Z=o("textarea",{"data-role":"inline-edit","data-testid":`card-desc-edit-${t.card_id}`,value:E,onInput:U,onBlur:Y,onKeyDown:X,onFocus:de=>{let be=de.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:O},t.content.text||"");break;case"json":Z=kd(t);break;case"task":Z=Cd(t);break;case"project":Z=Md(t,d);break;default:Z=wd(t)}let ee=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:ee?"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:y?"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"},ce={position:"absolute",bottom:"0",right:"0",width:"12px",height:"12px",cursor:"nwse-resize",opacity:"0.4",background:"linear-gradient(135deg, transparent 50%, #666 50%)"},me={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"},ge=8,ye={position:"absolute",width:`${ge}px`,height:`${ge}px`,borderRadius:"50%",backgroundColor:"#3b82f6",border:"2px solid #fff",boxSizing:"border-box",cursor:"crosshair",display:f?"block":"none",zIndex:"10"},ne=[{anchor:"top",style:{...ye,top:`${-ge/2}px`,left:"50%",marginLeft:`${-ge/2}px`}},{anchor:"right",style:{...ye,top:"50%",right:`${-ge/2}px`,marginTop:`${-ge/2}px`}},{anchor:"bottom",style:{...ye,bottom:`${-ge/2}px`,left:"50%",marginLeft:`${-ge/2}px`}},{anchor:"left",style:{...ye,top:"50%",left:`${-ge/2}px`,marginTop:`${-ge/2}px`}}].map((de,be)=>o("div",{key:`anchor-${de.anchor}`,style:de.style,"data-role":"anchor","data-anchor":de.anchor,"data-testid":`card-anchor-${de.anchor}-${t.card_id}`,onMouseDown:H})),pe=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,ie=t.tags&&t.tags.length>0?o("div",{style:{display:"flex",gap:"4px",flexWrap:"wrap",marginTop:"4px"}},...t.tags.map((de,be)=>o("span",{key:String(be),style:{fontSize:"10px",padding:"1px 4px",borderRadius:"3px",backgroundColor:"rgba(0,0,0,0.08)",color:"#444"}},de))):null,he={padding:"6px 12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",whiteSpace:"nowrap"},xe={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=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:de=>de.stopPropagation()},o("div",{style:he,onClick:de=>{de.stopPropagation(),a&&a(t.card_id),C()},role:"menuitem","data-testid":`ctx-delete-${t.card_id}`},"Delete"),o("div",{style:{...he,position:"relative"},onMouseEnter:()=>D(!0),role:"menuitem","aria-haspopup":"true","data-testid":`ctx-change-type-${t.card_id}`},"Change Type",o("span",{style:{marginLeft:"8px"}},"\u25B6"),R?o("div",{style:xe,role:"menu","data-testid":`ctx-type-submenu-${t.card_id}`},...Ft.map(de=>o("div",{key:de.value,style:{...he,fontWeight:t.card_type===de.value?"700":"400"},onClick:be=>{be.stopPropagation(),_(de.value)},role:"menuitem","data-testid":`ctx-type-${de.value}-${t.card_id}`},de.label,t.card_type===de.value?" \u2713":""))):null)):null;return ee?o("div",{className:"board-card board-card--project",style:ae,onMouseDown:N,onContextMenu:T,onMouseEnter:()=>b(!0),onMouseLeave:()=>{b(!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},Z,o("div",{style:me,"data-role":"drag-handle","data-testid":`card-drag-handle-${t.card_id}`,"aria-label":"Export drag handle",title:"Drag to export card"},"\u2630"),...ne,Ce):o("div",{className:"board-card",style:ae,onMouseDown:N,onContextMenu:T,onMouseEnter:()=>b(!0),onMouseLeave:()=>{b(!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:G,onBlur:K,onKeyDown:Q,onFocus:de=>{let be=de.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"),Z,ie,pe,o("div",{style:me,"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:ce,"data-role":"resize",onMouseDown:F,"aria-label":"Resize card"}),...ne,Ce)}function xn(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:p,children:c}=e,[m,f]=j(!1),[b,y]=j(!1),[g,x]=j(!1),v=te(null),R=te(null),D=S(C=>{C.stopPropagation(),l&&l(t.container_id)},[t.container_id,l]),M=S(C=>{C.stopPropagation(),y(N=>!N)},[]),$=S(C=>{let N=C;N.preventDefault(),N.stopPropagation(),p&&p(t.container_id,{x:N.clientX,y:N.clientY})},[t.container_id,p]),A=S(C=>{let N=C;N.preventDefault(),N.stopPropagation(),i&&i(t.container_id),u&&u(t.container_id),x(!0),v.current={x:N.clientX,y:N.clientY,posX:t.position.x,posY:t.position.y};let F=H=>{let _=H;if(!v.current)return;let V=_.clientX-v.current.x,K=_.clientY-v.current.y;s&&s(t.container_id,{x:v.current.posX+V,y:v.current.posY+K})},W=()=>{v.current=null,x(!1),h&&h(t.container_id),document.removeEventListener("mousemove",F),document.removeEventListener("mouseup",W)};document.addEventListener("mousemove",F),document.addEventListener("mouseup",W)},[t.container_id,t.position.x,t.position.y,i,s,u,h]),I=S(C=>{let N=C;N.preventDefault(),N.stopPropagation(),R.current={x:N.clientX,y:N.clientY,w:t.size.width,h:t.size.height};let F=H=>{let _=H;if(!R.current)return;let V=_.clientX-R.current.x,K=_.clientY-R.current.y,Q=Math.max(160,R.current.w+V),G=Math.max(120,R.current.h+K);a&&a(t.container_id,{width:Q,height:G})},W=()=>{R.current=null,document.removeEventListener("mousemove",F),document.removeEventListener("mouseup",W)};document.addEventListener("mousemove",F),document.addEventListener("mouseup",W)},[t.container_id,t.size.width,t.size.height,a]),P=S(C=>{C.preventDefault(),f(!0)},[]),L=S(()=>{f(!1)},[]),E=S(C=>{let N=C;if(N.preventDefault(),f(!1),d&&N.dataTransfer){let F=N.dataTransfer.getData("text/plain");F&&d(F,t.container_id)}},[t.container_id,d]),B=r||m,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:B?"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"},T={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:L,onDrop:E,onContextMenu:$},o("div",{className:"board-container__title",style:{...k,display:"flex",alignItems:"center",justifyContent:"space-between"},onMouseDown:A,"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":b?"Expand container":"Minimize container",title:b?"Expand":"Minimize"},b?"\u25B2":"\u2014"),o("button",{style:{border:"none",backgroundColor:"transparent",cursor:"pointer",color:"#94a3b8",fontSize:"14px",padding:"0 2px",lineHeight:"1"},onClick:D,"aria-label":"Delete container",title:"Delete"},"\xD7"))),b?null:o("div",{className:"board-container__contents",style:w,"data-testid":`container-contents-${t.container_id}`},c),b?null:o("div",{style:T,"data-role":"resize",onMouseDown:I,"aria-label":"Resize container"}))}function ji(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 Ed(e,t){let n=ji(e),r=ji(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 p=s[h].x-i[u].x,c=s[h].y-i[u].y,m=p*p+c*c;m<a&&(a=m,l=i[u],d=s[h])}return{from:l,to:d}}var Gi="board-card-link-arrowhead";function yn(e){let{links:t,cards:n,selectedLinkId:r,onSelectLink:i,onLinkContextMenu:s,canvasWidth:a,canvasHeight:l}=e,d=new Map;for(let m=0;m<n.length;m++)d.set(n[m].card_id,n[m]);let u=S(m=>{i(m)},[i]),h=[];for(let m=0;m<t.length;m++){let{source:f,link:b}=t[m],y=d.get(b.target_card_id);if(!y)continue;let{from:g,to:x}=Ed(f,y),v=b.link_id===r,R=v?"#3b82f6":b.color||"#94a3b8",D=x.x-g.x,M=x.y-g.y,$=Math.sqrt(D*D+M*M),A=Math.min(40,$*.15),I=$>0?-M/$:0,P=$>0?D/$:0,L=(g.x+x.x)/2,E=(g.y+x.y)/2,B=L+I*A,z=E+P*A,k=`M ${g.x} ${g.y} Q ${B} ${z} ${x.x} ${x.y}`,w=f.card_id;h.push(o("path",{key:`hit-${b.link_id}`,d:k,fill:"none",stroke:"transparent","stroke-width":"12",style:{cursor:"pointer",pointerEvents:"stroke"},onClick:()=>u(b.link_id),onContextMenu:T=>{let C=T;C.preventDefault(),C.stopPropagation(),s&&s(b.link_id,w,{x:C.clientX,y:C.clientY})},"data-testid":`link-hit-${b.link_id}`})),h.push(o("path",{key:b.link_id,d:k,fill:"none",stroke:R,"stroke-width":v?"3":"2","pointer-events":"none","marker-end":`url(#${Gi})`,"data-testid":`link-${b.link_id}`})),b.link_name&&h.push(o("text",{key:`label-${b.link_id}`,x:String(B),y:String(z-6),"text-anchor":"middle",fill:"#64748b","font-size":"11","pointer-events":"none","data-testid":`link-label-${b.link_id}`},b.link_name))}let p={position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none",overflow:"visible",zIndex:"9999"},c=o("defs",{},o("marker",{id:Gi,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:p,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 Id=[{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"}],go=20,Et=5e3;function Rd(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 Pd(e,t,n,r){let i=new Set;if(r){i.add(r);let d=Rd(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,p]=l.pop();for(let c=0;c<d.length;c++){let m=d[c];if(!$e(m)||i.has(m.container_id))continue;let f=m.position.x+u,b=m.position.y+h;t>=f&&t<=f+m.size.width&&n>=b&&n<=b+m.size.height&&(p>a&&(s=m.container_id,a=p),m.contents.length>0&&l.push([m.contents,f,b+30,p+1]))}}return s}function Ki(e,t){return{x:Math.round(e.x/t)*t,y:Math.round(e.y/t)*t}}function Xi(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 qi(e,t,n){return{x:(e-n.panX)/n.zoom,y:(t-n.panY)/n.zoom}}function Td(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(Be(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:p,viewport:c}=t,m=te(null),f=te(!1),b=te(null),[y,g]=j(null),[x,v]=j(null),[R,D]=j(null),[M,$]=j(null),[A,I]=j(!1),[P,L]=j(!1),[E,B]=j(null),[z,k]=j(null),w=S(oe=>{let fe=oe,Se=fe.target;if(Se.closest(".board-card")||Se.closest(".board-container"))return;let we=fe.button===1,Ie=fe.button===0&&fe.shiftKey;we||Ie?(fe.preventDefault(),f.current=!0,b.current={x:fe.clientX,y:fe.clientY,panX:c.panX,panY:c.panY}):fe.button===0&&i&&i(null)},[c.panX,c.panY,i]);re(()=>{let oe=Se=>{if(!f.current||!b.current)return;let we=Se,Ie=we.clientX-b.current.x,Fe=we.clientY-b.current.y;n({type:"PAN",panX:b.current.panX+Ie,panY:b.current.panY+Fe})},fe=()=>{f.current=!1,b.current=null};return document.addEventListener("mousemove",oe),document.addEventListener("mouseup",fe),()=>{document.removeEventListener("mousemove",oe),document.removeEventListener("mouseup",fe)}},[n]);let T=S(oe=>{let fe=oe;if(!fe.ctrlKey)return;fe.preventDefault();let Se=fe.deltaY>0?-.1:.1;n({type:"ZOOM",zoom:c.zoom+Se})},[c.zoom,n]),C=te(null);re(()=>{let oe=m.current;if(!oe)return;let fe=Ae=>{let ze=[];for(let ue=0;ue<Ae.touches.length;ue++)ze.push({x:Ae.touches[ue].clientX,y:Ae.touches[ue].clientY});return ze},Se=(Ae,ze)=>Math.sqrt((Ae.x-ze.x)**2+(Ae.y-ze.y)**2),we=Ae=>{let ze=Ae;if(ze.touches.length===2){ze.preventDefault();let ue=fe(ze);C.current={touches:ue,panX:c.panX,panY:c.panY,zoom:c.zoom,dist:Se(ue[0],ue[1])}}},Ie=Ae=>{let ze=Ae;if(ze.touches.length!==2||!C.current)return;ze.preventDefault();let ue=fe(ze),ve=C.current,Me=(ve.touches[0].x+ve.touches[1].x)/2,Te=(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-Me),panY:ve.panY+(Qe-Te)});let ct=Se(ue[0],ue[1]);ve.dist>0&&n({type:"ZOOM",zoom:ve.zoom*(ct/ve.dist)})},Fe=()=>{C.current=null};return oe.addEventListener("touchstart",we,{passive:!1}),oe.addEventListener("touchmove",Ie,{passive:!1}),oe.addEventListener("touchend",Fe),()=>{oe.removeEventListener("touchstart",we),oe.removeEventListener("touchmove",Ie),oe.removeEventListener("touchend",Fe)}},[c.panX,c.panY,c.zoom,n]);let N=S((oe,fe)=>{$({cardId:oe,x:fe.x,y:fe.y}),I(!1),L(!1),u&&u(oe,fe)},[u]),F=S(()=>{$(null),I(!1),L(!1)},[]);re(()=>{if(!M)return;let oe=()=>{F()};return document.addEventListener("click",oe),()=>{document.removeEventListener("click",oe)}},[M,F]);let W=S((oe,fe,Se)=>{k({linkId:oe,cardId:fe,x:Se.x,y:Se.y}),F()},[F]),H=S(()=>{k(null)},[]);re(()=>{if(!z)return;let oe=()=>H();return document.addEventListener("click",oe),()=>document.removeEventListener("click",oe)},[z,H]);let _=S((oe,fe)=>{B({containerId:oe,x:fe.x,y:fe.y}),F(),H()},[F,H]),V=S(()=>{B(null)},[]);re(()=>{if(!E)return;let oe=()=>V();return document.addEventListener("click",oe),()=>document.removeEventListener("click",oe)},[E,V]);let K=S(oe=>{i&&i(oe)},[i]),Q=S((oe,fe)=>{let Se=fe;if(s&&(Se=Ki(fe,go)),n({type:"MOVE_ITEM",itemId:oe,position:Se}),U.current===oe){let Ie=0,Fe=0,Ae=[...p];for(;Ae.length>0;){let Me=Ae.pop();if(Xe(Me)===oe){Ie=Me.size.width,Fe=Me.size.height;break}if($e(Me))for(let Te=0;Te<Me.contents.length;Te++)Ae.push(Me.contents[Te])}let ze=Se.x+Ie/2,ue=Se.y+Fe/2,ve=Pd(p,ze,ue,oe);g(ve)}},[n,s,p]),G=S((oe,fe)=>{n({type:"RESIZE_ITEM",itemId:oe,size:fe})},[n]),O=S(oe=>{n({type:"REMOVE_ITEM",itemId:oe}),i&&r===oe&&i(null)},[n,r,i]),Y=S((oe,fe)=>{n({type:"NEST_ITEM",itemId:oe,containerId:fe})},[n]),X=S(oe=>{v(oe),U.current=oe,g(null)},[]),U=te(null);U.current=x;let Z=te(null);Z.current=y;let ee=S(oe=>{let fe=Z.current;fe&&n({type:"NEST_ITEM",itemId:oe,containerId:fe}),v(null),U.current=null,g(null)},[n]),ae=S((oe,fe,Se)=>{D({fromCardId:oe,fromAnchor:fe,fromPos:Se,currentPos:Se})},[]),J=te(null);J.current=R,re(()=>{if(!R)return;let oe=Se=>{let we=Se,Ie=0,Fe=0;if(m.current){let ze=m.current.getBoundingClientRect();Ie=ze.left,Fe=ze.top}let Ae=qi(we.clientX-Ie,we.clientY-Fe,c);D(ze=>ze?{...ze,currentPos:Ae}:null)},fe=Se=>{let we=Se,Ie=J.current;if(!Ie){D(null);return}let Fe=document.elementFromPoint(we.clientX,we.clientY);if(Fe&&Fe.dataset&&Fe.dataset.role==="anchor"&&Fe.dataset.anchor){let Ae=Fe.closest("[data-card-id]");if(Ae&&Ae.dataset.cardId&&Ae.dataset.cardId!==Ie.fromCardId){let ze=Ae.dataset.cardId;n({type:"ADD_LINK",cardId:Ie.fromCardId,link:{link_id:qe(),link_name:"relates to",target_card_id:ze,color:"#94a3b8",attributes:{}}})}}D(null)};return document.addEventListener("mousemove",oe),document.addEventListener("mouseup",fe),()=>{document.removeEventListener("mousemove",oe),document.removeEventListener("mouseup",fe)}},[R!==null,c.panX,c.panY,c.zoom,n]);let se=a.toLowerCase(),ce=new Set,me=[],ge=[...p];for(;ge.length>0;){let oe=ge.pop();if(me.push(oe),$e(oe))for(let fe=0;fe<oe.contents.length;fe++)ge.push(oe.contents[fe])}if(se)for(let oe=0;oe<me.length;oe++){let fe=me[oe];(Be(fe)?fe.card_title:fe.name).toLowerCase().includes(se)||ce.add(Xe(fe))}if(l)for(let oe=0;oe<me.length;oe++){let fe=me[oe];Be(fe)&&fe.color!==l&&ce.add(fe.card_id)}let{cards:ye,links:le}=Td(p);function ne(oe){let fe=Xe(oe),Se=ce.has(fe),we;if(Be(oe))we=o(bn,{key:fe,card:oe,selected:fe===r,onSelect:K,onMove:Q,onResize:G,onDelete:O,dispatch:n,onOpenProject:d,onCardContextMenu:N,onUpdate:h,onDragStart:X,onDragEnd:ee,onAnchorDragStart:ae});else{let Ie=oe.contents.map(Fe=>ne(Fe));we=o(xn,{key:fe,container:oe,selected:fe===r,highlighted:y===oe.container_id,onSelect:K,onMove:Q,onResize:G,onDelete:O,onDrop:Y,onDragStart:X,onDragEnd:ee,onContainerContextMenu:_},...Ie)}return Se?o("div",{key:`dim-${fe}`,style:{opacity:"0.3"}},we):we}let pe=p.map(oe=>ne(oe)),ie={flex:"1",overflow:"hidden",position:"relative",backgroundColor:"#f8fafc",cursor:"default",backgroundImage:s?"radial-gradient(circle, #d1d5db 1px, transparent 1px)":"none",backgroundSize:`${go}px ${go}px`},he={transform:`translate(${c.panX}px, ${c.panY}px) scale(${c.zoom})`,transformOrigin:"0 0",position:"relative",width:`${Et}px`,height:`${Et}px`},xe={padding:"6px 12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",whiteSpace:"nowrap",fontSize:"13px",color:"#1a1a1a"},Ce={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"},de={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:oe=>oe.stopPropagation()},o("div",{style:{...xe,position:"relative"},onMouseEnter:()=>{I(!0),L(!1)},role:"menuitem","aria-haspopup":"true","data-testid":`board-ctx-change-color-${M.cardId}`},"Change Color",o("span",{style:{marginLeft:"8px"}},"\u25B6"),A?o("div",{style:Ce,role:"menu","data-testid":`board-ctx-color-submenu-${M.cardId}`},...Id.map(oe=>o("div",{key:oe.value,style:{...xe,gap:"8px"},onClick:fe=>{fe.stopPropagation(),n({type:"UPDATE_CARD",cardId:M.cardId,updates:{color:oe.value}}),F()},role:"menuitem","data-testid":`board-ctx-color-${oe.label.toLowerCase()}-${M.cardId}`},o("span",{style:{display:"inline-block",width:"14px",height:"14px",borderRadius:"3px",backgroundColor:oe.value,border:"1px solid #d1d5db",flexShrink:"0"}}),oe.label))):null),o("div",{style:{...xe,position:"relative"},onMouseEnter:()=>{L(!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:Ce,role:"menu","data-testid":`board-ctx-type-submenu-${M.cardId}`},...Ft.map(oe=>o("div",{key:oe.value,style:xe,onClick:fe=>{fe.stopPropagation(),n({type:"CHANGE_CARD_TYPE",cardId:M.cardId,newType:oe.value}),F()},role:"menuitem","data-testid":`board-ctx-type-${oe.value}-${M.cardId}`},oe.label))):null),(()=>{let oe=Xi(p,M.cardId);return oe?o("div",{style:xe,onClick:fe=>{fe.stopPropagation(),n({type:"UNNEST_ITEM",itemId:M.cardId,containerId:oe}),F()},role:"menuitem","data-testid":`board-ctx-detach-${M.cardId}`},"Detach Card"):null})(),o("div",{style:de,role:"separator"}),o("div",{style:{...xe,color:"#dc2626"},onClick:oe=>{oe.stopPropagation(),n({type:"REMOVE_ITEM",itemId:M.cardId}),i&&r===M.cardId&&i(null),F()},role:"menuitem","data-testid":`board-ctx-delete-${M.cardId}`},"Delete")):null,ke=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 oe=Xi(p,E.containerId);return oe?o("div",{style:xe,onClick:fe=>{fe.stopPropagation(),n({type:"UNNEST_ITEM",itemId:E.containerId,containerId:oe}),V()},role:"menuitem","data-testid":`board-ctx-detach-container-${E.containerId}`},"Detach Container"):null})(),o("div",{style:de,role:"separator"}),o("div",{style:{...xe,color:"#dc2626"},onClick:oe=>{oe.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"],Le=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:oe=>oe.stopPropagation()},o("div",{style:{padding:"4px 14px",fontSize:"11px",color:"#94a3b8",fontWeight:"600"}},"Edge Type"),...Re.map(oe=>o("button",{key:oe,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 fe=null,Se=[...p];for(;Se.length>0;){let we=Se.pop();if(Be(we)&&we.card_id===z.cardId){fe=we;break}if($e(we))for(let Ie of we.contents)Se.push(Ie)}return fe?fe.card_link.map(we=>we.link_id===z.linkId?{...we,link_name:oe}:we):[]})()}}),H()},role:"menuitem"},oe)),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}),H()},role:"menuitem"},"Delete Link")):null;return o("div",{ref:m,className:"board-canvas",style:ie,onMouseDown:w,onWheel:T,"data-testid":"board-canvas",role:"application","aria-label":`Board: ${t.name}`,tabIndex:0},o("div",{className:"board-canvas__inner",style:he,"data-testid":"board-canvas-inner"},o(yn,{links:le,cards:ye,selectedLinkId:null,onSelectLink:()=>{},onLinkContextMenu:W,canvasWidth:Et,canvasHeight:Et}),R?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(R.fromPos.x),y1:String(R.fromPos.y),x2:String(R.currentPos.x),y2:String(R.currentPos.y),stroke:"#3b82f6","stroke-width":"2","stroke-dasharray":"6 4","pointer-events":"none","data-testid":"link-drag-line"})):null,...pe),be,ke,Le)}function Dd(e){let t=[],n=[...e];for(;n.length>0;){let r=n.pop();if(Be(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 Zi(e,t,n,r){let i=r??40,s=Dd(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 x=s[g];x.position.x<a&&(a=x.position.x),x.position.y<l&&(l=x.position.y);let v=x.position.x+x.size.width,R=x.position.y+x.size.height;v>d&&(d=v),R>u&&(u=R)}let h=d-a+i*2,p=u-l+i*2,c=t/h,m=n/p,f=Math.max(.25,Math.min(4,Math.min(c,m))),b=-a*f+(t-(d-a)*f)/2,y=-l*f+(n-(u-l)*f)/2;return{panX:b,panY:y,zoom:f}}var ho=["#fef9c3","#fecaca","#fed7aa","#bbf7d0","#bfdbfe","#ddd6fe","#fbcfe8","#e5e7eb"];function Ji(e){let{zoom:t,gridEnabled:n,selectedColor:r,colorFilter:i,onNewCard:s,onZoomIn:a,onZoomOut:l,onZoomReset:d,onColorSelect:u,onColorFilter:h,onGridToggle:p,onSearch:c}=e,[m,f]=j(""),b=S($=>{let A=$.target.value;f(A),c(A)},[c]),y={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"},x={...g,backgroundColor:"#3b82f6",color:"#ffffff",borderColor:"#3b82f6"},v={fontSize:"12px",color:"#64748b",minWidth:"40px",textAlign:"center",cursor:"pointer"},R={width:"1px",height:"20px",backgroundColor:"#e2e8f0",margin:"0 4px"},D={padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",width:"120px",outline:"none"},M=ho.map($=>{let A=$===r,I=$===i,P=()=>{A&&h?h(I?null:$):u($)},L="1px solid rgba(0,0,0,0.15)";return I?L="3px solid #ef4444":A&&(L="2px solid #3b82f6"),o("button",{key:$,title:$,style:{width:"18px",height:"18px",borderRadius:"50%",backgroundColor:$,border:L,cursor:"pointer",padding:"0",flexShrink:"0",opacity:I?"1":i?"0.5":"1"},onClick:P,"aria-label":I?`Clear color filter ${$}`:`Select color ${$}`,"data-testid":`color-swatch-${$}`})});return o("div",{className:"board-toolbar",style:y,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:R}),o("button",{style:g,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:g,onClick:a,"data-testid":"btn-zoom-in","aria-label":"Zoom in"},"+"),o("div",{style:R}),...M,o("div",{style:R}),o("button",{style:n?x:g,onClick:p,"data-testid":"btn-grid-toggle","aria-label":n?"Disable grid snapping":"Enable grid snapping","aria-pressed":String(n)},"Grid"),o("div",{style:R}),o("input",{type:"text",placeholder:"Search cards...",value:m,onInput:b,style:D,"data-testid":"search-input","aria-label":"Search cards"}))}var Qi=50,tt={id:qe(),name:"Untitled",collection:[],viewport:{panX:0,panY:0,zoom:1}};function es(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 Sn(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:Sn(s.contents,t,n)}):r.push(s)}return r}function ts(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 $d(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 p=0;p<u.contents.length;p++){let c=u.contents[p];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 zd(e){switch(e){case"text":return{text:""};case"json":return{};case"task":return{};case"project":return{project_id:"",project_name:""}}}function vn(e,t){switch(t.type){case"ADD_ITEM":return t.containerId?{...e,collection:Sn(e.collection,t.containerId,t.item)}:{...e,collection:[...e.collection,t.item]};case"REMOVE_ITEM":{let[n]=es(e.collection,t.itemId);return{...e,collection:n}}case"MOVE_ITEM":return{...e,collection:ft(e.collection,t.itemId,n=>({...n,position:t.position,...Be(n)?{updatedAt:Date.now()}:{}}))};case"RESIZE_ITEM":return{...e,collection:ft(e.collection,t.itemId,n=>({...n,size:t.size,...Be(n)?{updatedAt:Date.now()}:{}}))};case"UPDATE_CARD":return{...e,collection:ft(e.collection,t.cardId,n=>Be(n)?{...n,...t.updates,updatedAt:Date.now()}:n)};case"CHANGE_CARD_TYPE":return{...e,collection:ft(e.collection,t.cardId,n=>Be(n)?{...n,card_type:t.newType,content:zd(t.newType),updatedAt:Date.now()}:n)};case"ADD_CONTAINER":return t.parentContainerId?{...e,collection:Sn(e.collection,t.parentContainerId,t.container)}:{...e,collection:[...e.collection,t.container]};case"NEST_ITEM":{let n=ts(e.collection,t.containerId);if(!n)return e;let[r,i]=es(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:Sn(r,t.containerId,s)}}case"UNNEST_ITEM":{let n=ts(e.collection,t.containerId),[r,i]=$d(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=>Be(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=>Be(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 Ad(e){return e.type==="PAN"||e.type==="ZOOM"}function wn(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=vn(e.present,t.action);if(n===e.present)return e;if(Ad(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>Qi&&r.splice(0,r.length-Qi),{past:r,present:n,future:[]}}default:return e}}function _t(e){let t={past:[],present:e||tt,future:[]},[n,r]=zn(wn,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 ns(e,t){let{state:n,dispatch:r,undo:i,redo:s,canUndo:a,canRedo:l}=_t(),d=te(!1);re(()=>{e&&t&&!d.current&&(d.current=!0,e.load(t).then(p=>{r({type:"SET_BOARD",state:p})}).catch(()=>{}))},[e,t,r]);let u=te(null),h=te(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 kn=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 Ld(e){let t=[],n=[...e];for(;n.length>0;){let r=n.pop();if(Be(r))t.push(r);else for(let i=r.contents.length-1;i>=0;i--)n.push(r.contents[i])}return t}function os(e){let{collection:t,onCardDropped:n,children:r}=e,i=st(),s=te([]);re(()=>{let u=Ld(t),h=s.current,p=new Set(h.map(m=>m.card_id)),c=new Set(u.map(m=>m.card_id));for(let m of u)p.has(m.card_id)||i.publish("project-board",{event:"card-created",card:m});for(let m of h)c.has(m.card_id)||i.publish("project-board",{event:"card-deleted",cardId:m.card_id});for(let m of u)if(p.has(m.card_id)){let f=h.find(b=>b.card_id===m.card_id);f&&f.updatedAt!==m.updatedAt&&i.publish("project-board",{event:"card-updated",card:m})}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}=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 Bd=new kn;function rs(e){let t=[],n=[...e];for(;n.length>0;){let r=n.pop();if(Be(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(),Fd={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 Nd(e){return e.collection.length===0}function is(e){let t=e.boardId||"default",{state:n,dispatch:r,undo:i,redo:s,canUndo:a,canRedo:l}=ns(Bd,t),[d,u]=j(ho[0]),[h,p]=j(!1),[c,m]=j(""),[f,b]=j(null),[y,g]=j(null),[x,v]=j(n.name||"Untitled"),[R,D]=j(!1),[M,$]=j(""),[A,I]=j(null),[P,L]=j(!0),[E,B]=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,T]=j(""),[C,N]=j("1"),[F,W]=j([]),H=te(!1);re(()=>{!H.current&&Nd(n)?(H.current=!0,r({type:"SET_BOARD",state:Fd})):n.collection.length>0&&(H.current=!0)},[n,r]);let _=S(()=>{let ue=(-n.viewport.panX+300)/n.viewport.zoom,ve=(-n.viewport.panY+200)/n.viewport.zoom,Me=(Math.random()-.5)*300,Te=(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+Me),y:Math.round(ve+Te)},size:{width:180,height:120},priority:"medium",createdAt:Date.now(),updatedAt:Date.now()};r({type:"ADD_ITEM",item:Ke})},[n.viewport,d,r]),V=S(()=>{r({type:"ZOOM",zoom:n.viewport.zoom+.1})},[n.viewport.zoom,r]),K=S(()=>{r({type:"ZOOM",zoom:n.viewport.zoom-.1})},[n.viewport.zoom,r]),Q=S(()=>{r({type:"ZOOM",zoom:1})},[r]),G=S(()=>{p(ue=>!ue)},[]),O=S(ue=>{m(ue)},[]),Y=S(ue=>{b(ue)},[]),X=S(ue=>{g(ue)},[]),U=S(()=>{L(ue=>!ue)},[]),Z=S(()=>{r({type:"SET_BOARD",state:tt}),b(null)},[r]),ee=S(()=>{let ue=JSON.stringify(n,null,2),ve=new Blob([ue],{type:"application/json"}),Me=URL.createObjectURL(ve),Te=document.createElement("a");Te.href=Me,Te.download=`board-${t}.json`,Te.style.display="none",document.body.appendChild(Te),Te.click(),document.body.removeChild(Te),URL.revokeObjectURL(Me)},[n,t]),ae=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 Me=new FileReader;Me.onload=()=>{try{let Te=JSON.parse(Me.result);Te&&Te.collection&&Te.viewport&&r({type:"SET_BOARD",state:Te})}catch{}},Me.readAsText(ve)}),document.body.appendChild(ue),ue.click(),document.body.removeChild(ue)},[r]),J=S(()=>{window.print()},[]),se=rs(n.collection),ce=S(()=>{let ue=rs(n.collection);ue.length>0&&b(ue[0].card_id)},[n.collection]),me=S(()=>{f&&(r({type:"REMOVE_ITEM",itemId:f}),b(null))},[f,r]),ge=S(()=>{if(n.collection.length===0)return;let Me=Zi(n.collection,800,600);r({type:"PAN",panX:Me.panX,panY:Me.panY}),r({type:"ZOOM",zoom:Me.zoom})},[n.collection,r]);re(()=>{let ue={menus:[{label:"File",items:[{label:"New Board",onClick:Z},{label:"Export JSON",onClick:ee},{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:ce},{label:"Delete Selected",onClick:me}]},{label:"View",items:[{label:"Zoom In",onClick:V},{label:"Zoom Out",onClick:K},{label:"Fit All",onClick:ge},{divider:!0},{label:"Toggle Grid",onClick:G}]}]}},[Z,ee,ae,J,i,s,a,l,ce,me,V,K,ge,G]),re(()=>{let ue=ve=>{let Me=ve;Me.ctrlKey&&Me.key==="z"?(Me.preventDefault(),i()):Me.ctrlKey&&Me.key==="y"&&(Me.preventDefault(),s())};return document.addEventListener("keydown",ue),()=>document.removeEventListener("keydown",ue)},[i,s]),re(()=>{if(!A)return;let ue=()=>I(null),ve=setTimeout(()=>document.addEventListener("click",ue),0);return()=>{clearTimeout(ve),document.removeEventListener("click",ue)}},[A]);let ye=S(()=>{$(x),D(!0)},[x]),le=S(()=>{let ue=M.trim();ue&&(v(ue),r({type:"RENAME_BOARD",name:ue}),e.onTitleChange&&e.onTitleChange(`Project Board: ${ue}`)),D(!1)},[M,r,e.onTitleChange]),ne=S(()=>{D(!1)},[]),pe=S(ue=>{$(ue.target.value)},[]),ie=S(ue=>{let ve=ue;ve.key==="Enter"&&(ve.preventDefault(),le()),ve.key==="Escape"&&(ve.preventDefault(),ne())},[le,ne]),he={display:"flex",flexDirection:"column",width:"100%",height:"100%",backgroundColor:"#f8fafc",overflow:"hidden"},xe=S((ue,ve)=>{let Me=(-n.viewport.panX+300)/n.viewport.zoom,Te=(-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(Me+Ke),y:Math.round(Te+Qe)},size:{width:180,height:120},priority:"medium",createdAt:Date.now(),updatedAt:Date.now()};r({type:"ADD_ITEM",item:ct})},[n.viewport,d,r]),Ce={display:"flex",alignItems:"center",height:"28px",backgroundColor:"#f1f5f9",borderBottom:"1px solid #e2e8f0",padding:"0 8px",fontSize:"13px",flexShrink:"0"},de={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,Me=(Math.random()-.5)*300,Te=(Math.random()-.5)*200;r({type:"ADD_CONTAINER",container:{type:"container",container_id:qe(),name:"New Container",position:{x:Math.round(ue+Me),y:Math.round(ve+Te)},size:{width:300,height:250},contents:[]}}),I(null)},[n.viewport,r]),ke={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"},Le=o("div",{style:Ce,"data-testid":"app-menu-bar"},o("div",{style:{position:"relative",display:"inline-flex"}},o("button",{style:de,onClick:()=>I(A==="project"?null:"project")},"Project"),A==="project"?o("div",{style:ke},o("button",{style:Re,onClick:()=>{ye(),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:()=>{_(),I(null)}},"New Card")):null),o("div",{style:{position:"relative",display:"inline-flex"}},o("button",{style:de,onClick:()=>I(A==="graphs"?null:"graphs")},"Graphs"),A==="graphs"?o("div",{style:ke},o("button",{style:Re,onClick:()=>{T(""),N("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:de,onClick:()=>I(A==="settings"?null:"settings")},"Settings"),A==="settings"?o("div",{style:ke},o("button",{style:Re,onClick:()=>{G(),I(null)}},h?"Disable Grid Snap":"Enable Grid Snap"),o("button",{style:Re,onClick:()=>{U(),I(null)}},P?"Hide Links":"Show Links")):null),o("div",{style:{position:"relative",display:"inline-flex"}},o("button",{style:de,onClick:()=>I(A==="help"?null:"help")},"Help"),A==="help"?o("div",{style:ke},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}`)),oe=R?o("div",{style:{position:"absolute",inset:"0",backgroundColor:"rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"200"},onClick:ne},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:pe,onKeyDown:ie,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:ne,style:{padding:"6px 14px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",cursor:"pointer",fontSize:"13px",fontFamily:"inherit"}},"Cancel"),o("button",{onClick:le,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,fe={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"},Fe={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"},ze=null;return z==="add"&&(ze=o("div",{style:fe,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=>T(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=>N(ue.target.value)})),o("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px"}},o("button",{style:Ae,onClick:()=>k(null)},"Cancel"),o("button",{style:Fe,onClick:()=>{let ue=w.trim(),ve=parseFloat(C)||1;ue&&B(Me=>[...Me,{name:ue,weight:ve}]),k(null)}},"Add"))))),z==="delete"&&(ze=o("div",{style:fe,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:()=>B(Me=>Me.filter((Te,Ke)=>Ke!==ve))},"\xD7")))),o("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"12px"}},o("button",{style:Ae,onClick:()=>k(null)},"Done"))))),z==="edit"&&(ze=o("div",{style:fe,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"),F.length===0?o("div",{style:{color:"#94a3b8",padding:"8px 0"}},"No attributes defined."):o("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},...F.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:Me=>{let Te=Me.target.value;W(Ke=>Ke.map((Qe,ct)=>ct===ve?{...Qe,name:Te}:Qe))}}),o("input",{type:"number",value:String(ue.weight),min:"0",step:"1",style:{...Ie,width:"80px"},onInput:Me=>{let Te=parseFloat(Me.target.value)||0;W(Ke=>Ke.map((Qe,ct)=>ct===ve?{...Qe,weight:Te}:Qe))}})))),o("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"12px"}},o("button",{style:Ae,onClick:()=>k(null)},"Cancel"),o("button",{style:Fe,onClick:()=>{B(F.filter(ue=>ue.name.trim())),k(null)}},"Save"))))),o("div",{className:"project-manager-app",style:he,"data-testid":"project-manager-app"},Le,o(Ji,{zoom:n.viewport.zoom,gridEnabled:h,selectedColor:d,colorFilter:y,onNewCard:_,onZoomIn:V,onZoomOut:K,onZoomReset:Q,onColorSelect:u,onColorFilter:X,onGridToggle:G,onSearch:O}),o(os,{collection:n.collection,onCardDropped:xe},o(Nt,{state:n,dispatch:r,searchQuery:c,gridEnabled:h,selectedId:f,onSelectItem:Y,colorFilter:y,onUpdateItem:(ue,ve)=>{r({type:"UPDATE_CARD",cardId:ue,updates:ve})},onCardContextMenu:(ue,ve)=>{}})),oe,ze)}var _d=28,Wd=5e3;var ss=0;function as(e){return ss++,`${e}-${ss}`}function Od(e){return e.replace(/\s*\(\d+\)$/,"")}function Hd(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 Yd(){let e=st(),t=te(!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 Vd(){let[e,t]=j([]),n=pt();$t("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(Od(e)){case"Files":return o(it,{appId:"files"},o(Vd,null));case"Terminal":return o(it,{appId:"terminal"},o(Yd,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(fn,null);case"Trading":return o(hn,null);case"Project Board":return o(is,{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 jd(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=te(l);h.current=l;let[p,c]=j([]),[m,f]=j([]),[b,y]=j(!1),[g,x]=j(!1),[v,R]=j(null),[D,M]=j({x:0,y:0}),[$,A]=j(null),I=S(()=>{y(ne=>!ne)},[]),P=S(ne=>{f(pe=>pe.filter(ie=>ie.id!==ne))},[]);re(()=>{if(m.length===0)return;let ne=m[0],pe=Date.now()-ne.timestamp,ie=Math.max(0,Wd-pe),he=setTimeout(()=>{f(xe=>xe.filter(Ce=>Ce.id!==ne.id))},ie);return()=>clearTimeout(he)},[m]);let L=te(t);L.current=t;let E=te(r);E.current=r;let B=te({});for(let ne of p)if(!B.current[ne.id]){let pe=ne.id;B.current[pe]=ie=>{c(he=>he.map(xe=>xe.id===pe?{...xe,title:ie}:xe))}}let z=S(ne=>{let ie=L.current.find(he=>he.id===ne);ie&&(c(he=>{let Ce=he.filter(Le=>Le.appId===ne).length+1,de=Ce===1?ie.label:`${ie.label} (${Ce})`,be=as(ne),ke=he.length>0?Math.max(...he.map(Le=>Le.zIndex))+1:1,Re={id:be,appId:ie.id,title:de,icon:ie.icon,x:60+he.length*30,y:40+he.length*30,width:ie.defaultSize?.width??600,height:ie.defaultSize?.height??400,zIndex:ke,focused:!0,windowState:"normal",resizable:ie.resizable!==!1,statusBar:ie.statusBar};return[...he.map(Le=>({...Le,focused:!1})),Re]}),ne==="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:()=>{}}]}]}),ne==="terminal"&&h.current.signalDock("terminal",{badge:3}),E.current&&E.current(ne))},[]),k=S(ne=>{c(pe=>{if(!pe.find(xe=>xe.id===ne))return pe;let he=Math.max(...pe.map(xe=>xe.zIndex))+1;return pe.map(xe=>xe.id===ne?{...xe,focused:!0,zIndex:he,windowState:xe.windowState==="minimized"?"normal":xe.windowState}:{...xe,focused:!1})})},[]),w=S(ne=>{c(pe=>{let ie=pe.filter(de=>de.appId===ne);if(ie.length===0)return pe;let xe=[...ie].sort((de,be)=>be.zIndex-de.zIndex)[0],Ce=Math.max(...pe.map(de=>de.zIndex))+1;return pe.map(de=>de.id===xe.id?{...de,focused:!0,zIndex:Ce,windowState:de.windowState==="minimized"?"normal":de.windowState}:{...de,focused:!1})}),c(pe=>{if(pe.filter(he=>he.appId===ne).length===0){let xe=L.current.find(ke=>ke.id===ne);if(!xe)return pe;let Ce=as(ne),de=pe.length>0?Math.max(...pe.map(ke=>ke.zIndex))+1:1,be={id:Ce,appId:xe.id,title:xe.label,icon:xe.icon,x:60+pe.length*30,y:40+pe.length*30,width:xe.defaultSize?.width??600,height:xe.defaultSize?.height??400,zIndex:de,focused:!0,windowState:"normal",resizable:xe.resizable!==!1,statusBar:xe.statusBar};return ne==="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:()=>{}}]}]}),ne==="terminal"&&h.current.signalDock("terminal",{badge:3}),E.current&&E.current(ne),[...pe.map(ke=>({...ke,focused:!1})),be]}return pe})},[]),T=t.map(ne=>{let pe=p.some(xe=>xe.appId===ne.id),ie=u.get(ne.id),he={id:ne.id,icon:ne.icon,label:ie?.tooltip||ne.label,active:pe};return ie&&(ie.badge!=null&&(he.badge=ie.badge>0?ie.badge:void 0),ie.progress!=null&&(he.progress=ie.progress>0?ie.progress:void 0),ie.urgent&&(he.urgent=!0)),he}),C=p.find(ne=>ne.focused),N=C?C.title:void 0,F=S(()=>{x(!0)},[]),W=S(()=>{x(!1)},[]),H=S((ne,pe)=>{R(ne),M(pe)},[]),_=S(()=>{R(null)},[]),V=S(()=>{},[]),K=S(()=>{i&&i()},[i]),Q=[];n&&(Q.push({label:n.name,icon:void 0,onClick:V,divider:!1}),Q.push({label:"",icon:void 0,onClick:V,divider:!0})),Q.push({label:"Lock",icon:void 0,onClick:F,divider:!1}),Q.push({label:"Logout",icon:void 0,onClick:K,divider:!1});let G=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]),O={display:"flex",flex:"1",overflow:"hidden"},Y={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"},X={width:"100%",height:"100%",position:"relative"},U=o(en,{activeAppName:N,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:Q.length>0?Q:void 0,height:_d}),Z=o(tn,{items:T,orientation:"vertical",position:"left",iconSize:36,onItemClick:w,onItemContextMenu:H}),ee=o(Hd,{toasts:m,onDismiss:P}),ae=p.filter(ne=>ne.windowState!=="minimized").map(ne=>o(kt,{key:ne.id,id:ne.id,title:ne.title,icon:ne.icon,defaultPosition:{x:ne.x,y:ne.y},defaultSize:{width:ne.width,height:ne.height},resizable:ne.resizable,statusBar:ne.statusBar,zIndex:ne.zIndex,focused:ne.focused,windowState:ne.windowState,onClose:()=>{c(pe=>pe.filter(ie=>ie.id!==ne.id))},onFocus:()=>{c(pe=>{let ie=Math.max(...pe.map(he=>he.zIndex))+1;return pe.map(he=>he.id===ne.id?{...he,focused:!0,zIndex:ie}:{...he,focused:!1})})},onMinimize:()=>{c(pe=>pe.map(ie=>ie.id===ne.id?{...ie,windowState:"minimized"}:ie))},onMaximize:()=>{c(pe=>pe.map(ie=>ie.id===ne.id?{...ie,windowState:ie.windowState==="maximized"?"normal":"maximized"}:ie))}},(()=>{let pe=t.find(ie=>ie.id===ne.appId);return pe?.render?pe.render(ne.id):Ud(pe?.label||ne.title,ne.id,B.current[ne.id])})())),J=[];a&&J.push(a),J.push(...ae),J.push(ee);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:X},...J)),ce=b?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(ne=>o("button",{key:ne.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:pe=>{pe.stopPropagation(),y(!1),w(ne.id)}},o("span",{style:{fontSize:"32px",display:"block"}},ne.icon),o("span",null,ne.label)))):null,me=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,ge=(()=>{if(!v)return null;let ne=t.find(de=>de.id===v),pe=p.filter(de=>de.appId===v),ie={padding:"6px 14px",cursor:"pointer"},he={onMouseEnter:de=>{de.currentTarget.style.backgroundColor="#444"},onMouseLeave:de=>{de.currentTarget.style.backgroundColor="transparent"}},xe={borderBottom:"1px solid #444",margin:"4px 0"},Ce=[];return Ce.push(o("div",{key:"new",style:ie,...he,onClick:()=>{z(v),R(null)},role:"menuitem"},"\u25CF New")),pe.length>0&&(Ce.push(o("div",{key:"sep-1",style:xe})),pe.forEach((de,be)=>{let ke=de.title;Ce.push(o("div",{key:`inst-${de.id}`,style:ie,...he,onClick:()=>{k(de.id),R(null)},role:"menuitem"},ke))})),Ce.push(o("div",{key:"sep-2",style:xe})),Ce.push(o("div",{key:"about",style:ie,...he,onClick:()=>{A(v),R(null)},role:"menuitem"},"About")),o("div",{className:"unity-desktop__context-menu-backdrop",style:{position:"absolute",inset:"0",zIndex:"9000"},onClick:_},o("div",{className:"unity-desktop__context-menu",style:{position:"absolute",top:`${D.y}px`,left:`${D.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:de=>de.stopPropagation()},...Ce))})(),ye=$?t.find(ne=>ne.id===$):null,le=ye?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:()=>A(null)},o("div",{style:{backgroundColor:"#2d2d2d",border:"1px solid #555",borderRadius:"8px",padding:"24px",minWidth:"280px",color:"#ffffff",textAlign:"center"},onClick:ne=>ne.stopPropagation()},o("div",{style:{fontSize:"18px",fontWeight:"600",marginBottom:"8px"}},ye.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:()=>A(null)},"Close"))):null;return o("div",{className:"unity-desktop",style:G,"data-theme":s},o("div",{className:"unity-desktop__top-panel",style:{flexShrink:"0",zIndex:"10"}},U),o("div",{style:O},o("div",{className:"unity-desktop__dock",style:Y},Z),o("main",{className:"unity-desktop__desktop",style:{flex:"1",position:"relative",overflow:"hidden",minHeight:"0"}},se,ce)),ge,le,me)}function ls(e){let{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s="dark",children:a}=e;return o(Qt,{onWindowOpen:r},o(Dt,null,o(zt,null,o(jd,{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s,children:a}))))}function cs(e){let{id:t,title:n,icon:r,defaultPosition:i,defaultSize:s,minSize:a,resizable:l=!0,onClose:d,menuBar:u,statusBar:h,onActivate:p,onDeactivate:c,children:m}=e,f=vt(),b=q(()=>f.windows.find(A=>A.id===t),[f.windows,t]);re(()=>(u?f.setMenuBar(t,u):f.clearMenuBar(t),()=>{f.clearMenuBar(t)}),[u,t,f]);let y=te(!1),g=b?b.focused:!1;re(()=>{let A=y.current;y.current=g,g&&!A?p&&p():!g&&A&&c&&c()},[g,p,c]);let x=S(()=>{f.closeWindow(t),d&&d()},[f,t,d]),v=S(()=>{f.focusWindow(t)},[f,t]),R=S(A=>{f.moveWindow(t,A)},[f,t]),D=S(A=>{f.resizeWindow(t,A)},[f,t]),M=S(()=>{f.minimizeWindow(t)},[f,t]),$=S(()=>{b&&b.windowState==="maximized"?f.restoreWindow(t):f.maximizeWindow(t)},[f,t,b]);return b?o(it,{appId:t},o(kt,{id:t,title:n,icon:r,defaultPosition:b.position,defaultSize:b.size,minSize:a,resizable:l,windowState:b.windowState,focused:b.focused,zIndex:b.zIndex,onClose:x,onFocus:v,onMove:R,onResize:D,onMinimize:M,onMaximize:$,statusBar:h,children:m})):(f.openWindow({id:t,title:n,icon:r,position:i,size:s}),null)}function Gd(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 bo(e,t,n){return!e||(!n||t.container_id!==n)&&t.name===e?!1:!Gd(t.contents,n).has(e)}function ds(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 us(e,t,n){return bo(e,t,n)}function ps(e){let{value:t,onChange:n,orientation:r="vertical",inputPosition:i="below",delimiter:s,placeholder:a="Add item...",disabled:l=!1,label:d,maxItems:u}=e,h=s??(r==="horizontal"?", ":`
|
|
9
|
-
`),p=q(()=>Array.from(new Set(t)),[t]),[c,m]=j({type:"closed"}),[f,b]=j(""),[y,g]=j(!1),x=te(null),v=S(()=>{l||u!==void 0&&p.length>=u||(m({type:"add"}),b(""),g(!1))},[l,u,p.length]),R=S(_=>{l||(m({type:"edit",index:_,original:p[_]}),b(p[_]),g(!1))},[l,p]),D=S(()=>{m({type:"closed"}),b(""),g(!1)},[]),M=S(()=>{let _=f.trim();if(_){if(c.type==="add"){if(p.includes(_)){g(!0),b("");return}n([...p,_]),b(""),g(!1)}else if(c.type==="edit"){if(_===c.original){D();return}if(p.includes(_)){g(!0);return}let V=p.slice();V[c.index]=_,n(V),D()}}},[f,c,p,n,D]),$=S(()=>{if(c.type==="edit"){let _=p.filter((V,K)=>K!==c.index);n(_),D()}},[c,p,n,D]),A=S(_=>{let V=_.key;V==="Enter"?(_.preventDefault(),M()):V==="Escape"&&(_.preventDefault(),D())},[M,D]),I=S(_=>{if(l)return;_.key==="+"&&c.type==="closed"&&(_.preventDefault(),v())},[l,c,v]),P={display:"flex",flexDirection:"column",gap:"4px"},L={display:"flex",flexDirection:r==="vertical"?"column":"row",flexWrap:r==="horizontal"?"wrap":"nowrap",gap:r==="vertical"?"2px":"0",alignItems:r==="horizontal"?"center":"stretch"},E={padding:"4px 8px",cursor:l?"default":"pointer",borderRadius:"4px",fontSize:"14px",color:"#1f2937",backgroundColor:"transparent",transition:"background-color 0.1s",border:"1px solid transparent",userSelect:"none"},B={display:"inline-flex",alignItems:"center",justifyContent:"center",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",cursor:l?"not-allowed":"pointer",fontSize:"16px",fontWeight:"700",lineHeight:"1",padding:"4px 10px",color:"#374151",transition:"background-color 0.15s, border-color 0.15s"},z={display:"flex",alignItems:"center",gap:"4px"},k=Ve({},{focused:!1,error:y}),w=[];for(let _=0;_<p.length;_++){let V=p[_];r==="horizontal"&&_>0&&w.push(o("span",{key:`delim-${_}`,style:{color:"#9ca3af",fontSize:"14px",userSelect:"none"},"aria-hidden":"true"},h)),w.push(o("span",{key:`item-${_}`,role:"listitem",tabIndex:l?-1:0,style:E,onClick:l?void 0:()=>R(_),onKeyDown:l?void 0:K=>{K.key==="Enter"&&R(_)}},V))}let T=o("div",{role:"list",style:L},...w),C=l||u!==void 0&&p.length>=u,N=o("button",{type:"button","aria-label":"Add item",style:{...B,opacity:C?"0.5":"1",cursor:C?"not-allowed":"pointer"},disabled:C,onClick:C?void 0:v},"+"),F=null;if(c.type!=="closed"){let _=o("button",{type:"button","aria-label":"Confirm",style:{...B,fontSize:"13px",padding:"4px 8px"},onClick:M},"OK"),V=c.type==="edit"?o("button",{type:"button","aria-label":"Delete",style:{...B,fontSize:"13px",padding:"4px 8px",color:"#ef4444"},onClick:$},"X"):null;F=o("div",{style:z,className:"buildable-list__input-row"},o("input",{ref:x,type:"text",value:f,placeholder:a,"aria-label":c.type==="edit"?"Edit item":"New item",style:{...k,flex:"1",minWidth:"0"},autoFocus:!0,onInput:K=>{b(K.target.value),g(!1)},onKeyDown:A}),_,V)}let W=[];c.type!=="closed"&&i==="above"&&W.push(F),W.push(o("div",{style:{display:"flex",alignItems:"flex-start",gap:"8px"}},T,N)),c.type!=="closed"&&i==="below"&&W.push(F);let H=o("div",{style:P,tabIndex:0,onKeyDown:I,className:"buildable-list"},...W);return o(Pe,{label:d,disabled:l},H)}var fs={sm:{padding:"3px 10px",fontSize:"12px",borderRadius:"4px"},md:{padding:"6px 14px",fontSize:"13px",borderRadius:"6px"},lg:{padding:"8px 20px",fontSize:"15px",borderRadius:"6px"}},ms={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 gs(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:p=!1}=e,c=q(()=>{let m=fs[i]??fs.md,f=ms[r]??ms.secondary,b={padding:m.padding,fontSize:m.fontSize,borderRadius:m.borderRadius,border:`1px solid ${f.border}`,backgroundColor:p?"#3b82f6":f.bg,color:p?"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&&(b.width="100%"),u&&Object.assign(b,u),b},[r,i,s,a,p,u]);return o("button",{type:l,onClick:s?void 0:n,disabled:s,className:d,style:c,"aria-label":h,"aria-pressed":p?"true":void 0},t)}var Xd=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],It=Math.PI/180;function Kd(e,t,n,r,i,s,a,l,d,u){let h=Math.cos(r*It),p=Math.sin(r*It),c=Math.cos(i*It),m=Math.sin(i*It),f=Math.cos(s*It),b=Math.sin(s*It),y=e*f-t*b,g=e*b+t*f,x=y*c-g*m,v=y*m+g*c,R=n,D=x,M=v*h-R*p,$=v*p+R*h,A=1+a*.001*$,I=l+D*u*A,P=d-M*u*A;return{sx:I,sy:P,depth:$}}function hs(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 bs(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 xs(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:p=Xd,gridColor:c="#94a3b8",title:m}=e,f=q(()=>{let z=0,k=0,w=0;for(let T=0;T<t.length;T++){let C=t[T],N=C.data.length;N>z&&(z=N);for(let F=0;F<N;F++){let W=C.data[F].length;W>k&&(k=W);for(let H=0;H<W;H++){let _=Math.abs(C.data[F][H]??0);_>w&&(w=_)}}}return{maxRows:Math.max(z,1),maxCols:Math.max(k,1),maxHeight:w>0?w:1}},[t]),b=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]),y=n/2,g=r/2,x=S((z,k,w)=>Kd(z,k,w,s,a,l,i,y,g,b),[s,a,l,i,y,g,b]),v=S(()=>{if(!u)return[];let z=[],k=Math.max(f.maxCols,f.maxRows),w=f.maxCols/2,T=f.maxRows/2,C=x(-w,-T,0),N=x(w,-T,0);z.push(o("line",{key:"axis-x",x1:String(C.sx),y1:String(C.sy),x2:String(N.sx),y2:String(N.sy),stroke:"#374151","stroke-width":"1.5"})),z.push(o("text",{key:"axis-x-label",x:String(N.sx+8),y:String(N.sy+4),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"X"));let F=x(-w,T,0);z.push(o("line",{key:"axis-y",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-y-label",x:String(F.sx-12),y:String(F.sy+4),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Y"));let W=f.maxHeight+(t.length-1)*h,H=x(-w,-T,W);return z.push(o("line",{key:"axis-z",x1:String(C.sx),y1:String(C.sy),x2:String(H.sx),y2:String(H.sy),stroke:"#374151","stroke-width":"1.5"})),z.push(o("text",{key:"axis-z-label",x:String(H.sx-4),y:String(H.sy-8),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Z")),z},[u,f,t.length,h,x]),R=S(()=>{let z=[],k=f.maxCols/2,w=f.maxRows/2,T=[];for(let C=0;C<t.length;C++){let N=t[C],F=N.color??p[C%p.length],W=N.opacity??.7,H=C*h,_=N.data.length;for(let V=0;V<_-1;V++){let K=N.data[V],Q=N.data[V+1],G=Math.min(K.length,Q.length);for(let O=0;O<G-1;O++){let Y=O-k,X=O+1-k,U=V-w,Z=V+1-w,ee=(K[O]??0)+H,ae=(K[O+1]??0)+H,J=(Q[O]??0)+H,se=(Q[O+1]??0)+H,ce=x(Y,U,ee),me=x(X,U,ae),ge=x(Y,Z,J),ye=x(X,Z,se),le=(ce.depth+me.depth+ge.depth+ye.depth)/4,ne=`${ce.sx},${ce.sy} ${me.sx},${me.sy} ${ye.sx},${ye.sy} ${ge.sx},${ge.sy}`;T.push({points:ne,fill:hs(F,W),stroke:bs(F,.7),strokeWidth:"0.5",depth:le,key:`quad-${C}-${V}-${O}`})}}if(_===1||_>0&&N.data[0].length===1)for(let V=0;V<_;V++){let K=N.data[V];for(let Q=0;Q<K.length;Q++){let G=Q-k,O=V-w,Y=(K[Q]??0)+H,X=x(G,O,Y),U=3,Z=`${X.sx},${X.sy-U} ${X.sx+U},${X.sy} ${X.sx},${X.sy+U} ${X.sx-U},${X.sy}`;T.push({points:Z,fill:hs(F,W),stroke:bs(F,.7),strokeWidth:"0.5",depth:X.depth,key:`point-${C}-${V}-${Q}`})}}}T.sort((C,N)=>C.depth-N.depth);for(let C=0;C<T.length;C++){let N=T[C];z.push(o("polygon",{key:N.key,points:N.points,fill:N.fill,stroke:N.stroke,"stroke-width":N.strokeWidth,"stroke-linejoin":"round"}))}return z},[t,f,h,p,x]),D=S(()=>{let z=[],k=f.maxCols/2,w=f.maxRows/2;for(let T=0;T<=f.maxRows;T++){let C=T-w,N=x(-k,C,0),F=x(k,C,0);z.push(o("line",{key:`base-h-${T}`,x1:String(N.sx),y1:String(N.sy),x2:String(F.sx),y2:String(F.sy),stroke:c,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}for(let T=0;T<=f.maxCols;T++){let C=T-k,N=x(C,-w,0),F=x(C,w,0);z.push(o("line",{key:`base-v-${T}`,x1:String(N.sx),y1:String(N.sy),x2:String(F.sx),y2:String(F.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 T=0;T<t.length;T++){let C=t[T],N=T*h,F=0,W=0;for(let K=0;K<C.data.length;K++){let Q=C.data[K];for(let G=0;G<Q.length;G++)F+=Q[G]??0,W++}let H=W>0?F/W:0,_=x(k+1,0,H+N),V=C.color??p[T%p.length];z.push(o("text",{key:`layer-label-${T}`,x:String(_.sx+8),y:String(_.sy+4),"font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:V},C.label))}return z},[d,t,f,h,p,x]),A=S(()=>m?[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"},m)]:[],[m,n])(),I=D(),P=v(),L=R(),E=M(),B=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":m??"3D layer visualization",style:{fontFamily:"sans-serif",maxWidth:"100%"}},...A,...B,...I,...P,...L,...E)}function qd(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 Zd(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 ys(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:p="#22c55e",trendDownColor:c="#ef4444",backgroundColor:m="#ffffff"}=e,f=q(()=>qd(t),[t]),b=s!=null&&isFinite(s)&&!isNaN(s),y=l!=null&&l.length>1,g=n!=null&&n.length>0,x=b&&s>=0?p:c,v=20,R=g?u*.38:u*.45,D=Math.min(d*.15,48),M=D*.55,$=R+D*.4+8,A=g?$+22:R+D*.4+22,I=y?Math.min(u*.22,36):0,P=u-v-I,L=d-v*2,E=S(()=>[o("rect",{key:"bg",x:"0",y:"0",width:"100%",rx:"8",ry:"8",fill:m,stroke:"#e5e7eb","stroke-width":"1"})],[d,u,m]),B=S(()=>{let _=[],V=r+f+i;return _.push(o("text",{key:"value",x:String(d/2),y:String(R),"text-anchor":"middle","dominant-baseline":"central","font-size":String(D),"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)),_},[d,R,D,M,f,r,i,h]),z=S(()=>g?[o("text",{key:"label",x:String(d/2),y:String($),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},n)]:[],[g,d,$,n]),k=S(()=>{if(!b)return[];let _=[],V=s,K=V>=0,Q=8,G=Zd(V),O=(K?"+":"-")+G+(a?" "+a:""),Y=d/2-40,X=A;if(K){let U=`${Y},${X} ${Y-Q/2},${X+Q} ${Y+Q/2},${X+Q}`;_.push(o("polygon",{key:"trend-arrow",points:U,fill:x}))}else{let U=`${Y},${X+Q} ${Y-Q/2},${X} ${Y+Q/2},${X}`;_.push(o("polygon",{key:"trend-arrow",points:U,fill:x}))}return _.push(o("text",{key:"trend-text",x:String(Y+Q+4),y:String(X+Q*.7),"text-anchor":"start","font-size":"12","font-family":"sans-serif",fill:x,"aria-label":`Trend: ${O}`},O)),_},[b,s,a,x,d,A]),w=S(()=>{if(!y)return[];let _=[],V=l,K=[];for(let ee of V)typeof ee=="number"&&isFinite(ee)&&!isNaN(ee)&&K.push(ee);if(K.length<2)return[];let Q=1/0,G=-1/0;for(let ee of K)ee<Q&&(Q=ee),ee>G&&(G=ee);Q===G&&(Q-=1,G+=1);let O=G-Q,Y=L/(K.length-1),X="";for(let ee=0;ee<K.length;ee++){let ae=v+ee*Y,J=P+I-(K[ee]-Q)/O*I;ee===0?X+=`M ${ae} ${J}`:X+=` L ${ae} ${J}`}let U=v+(K.length-1)*Y,Z=X+` L ${U} ${P+I} L ${v} ${P+I} Z`;return _.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"})))),_.push(o("path",{key:"spark-fill",d:Z,fill:"url(#sparkGrad)"})),_.push(o("path",{key:"spark-line",d:X,fill:"none",stroke:"#3b82f6","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})),_},[y,l,L,P,I,v]),T=E(),C=B(),N=z(),F=k(),W=w(),H=`${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":H,style:{fontFamily:"sans-serif"}},...T,...W,...C,...N,...F)}var Cn=Math.PI/180;function Jd(e,t,n,r,i,s,a,l){let d=Math.cos(r*Cn),u=Math.sin(r*Cn),h=Math.cos(i*Cn),p=Math.sin(i*Cn),c=e*h+n*p,m=-e*p+n*h,f=t*d-m*u,b=t*u+m*d;return{sx:s+c*l,sy:a-f*l,depth:b}}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 Mn(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),Mn(d,u,h)}function xo(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 Mn(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 Ss(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:p=!0,showWireframe:c=!0,showTrail:m=!0,trailMaxPoints:f=200,trailColor:b="#ef4444",wireframeColor:y="#cbd5e1",vectorColor:g="#3b82f6",backgroundColor:x,sphereRadius:v=130,title:R,onStateChange:D}=e,[M,$]=j(t??{theta:0,phi:0}),[A,I]=j(s),[P,L]=j(a),[E,B]=j(l),z=te([]),k=te(!1),w=te(null),T=te(null);re(()=>{t&&$(t)},[t?.theta,t?.phi]);let C=te(0);re(()=>{if(!n||n.length===0)return;C.current=0;let Y=0,X=()=>{C.current>=n.length||($(U=>{let Z=xo(U,n[C.current]);return C.current++,D&&D(Z),Z}),Y=requestAnimationFrame(X))};return Y=requestAnimationFrame(X),()=>cancelAnimationFrame(Y)},[n]),re(()=>{let Y=Rt(M);z.current.push(Y),z.current.length>f&&z.current.splice(0,z.current.length-f)},[M.theta,M.phi]);let N=v*E,F=r/2,W=i/2,H=S((Y,X,U)=>Jd(Y,X,U,P,A,F,W,N),[P,A,F,W,N]),_=S(Y=>{if(!d)return;let X=Y;k.current=!0,w.current={mx:X.clientX,my:X.clientY,rx:P,ry:A}},[d,P,A]),V=S(Y=>{if(!k.current||!w.current)return;let X=Y,U=w.current;I(U.ry+(X.clientX-U.mx)*.5),L(U.rx-(X.clientY-U.my)*.5)},[]),K=S(()=>{k.current=!1},[]),Q=S(Y=>{if(!u)return;let X=Y;X.preventDefault(),B(U=>Math.max(.5,Math.min(3,U*(X.deltaY>0?.95:1.05))))},[u]),G=[];if(x&&G.push(o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:x,rx:"6"})),R&&G.push(o("text",{key:"title",x:String(F),y:"24","text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},R)),c){let X=[];for(let ee=0;ee<=60;ee++){let ae=ee/60*2*Math.PI,J=H(Math.cos(ae),Math.sin(ae),0);X.push(`${ee===0?"M":"L"}${J.sx.toFixed(1)},${J.sy.toFixed(1)}`)}G.push(o("path",{key:"eq",d:X.join(" "),fill:"none",stroke:y,"stroke-width":"0.8",opacity:"0.5"}));let U=[];for(let ee=0;ee<=60;ee++){let ae=ee/60*2*Math.PI,J=H(Math.cos(ae),0,Math.sin(ae));U.push(`${ee===0?"M":"L"}${J.sx.toFixed(1)},${J.sy.toFixed(1)}`)}G.push(o("path",{key:"xz",d:U.join(" "),fill:"none",stroke:y,"stroke-width":"0.8",opacity:"0.4"}));let Z=[];for(let ee=0;ee<=60;ee++){let ae=ee/60*2*Math.PI,J=H(0,Math.cos(ae),Math.sin(ae));Z.push(`${ee===0?"M":"L"}${J.sx.toFixed(1)},${J.sy.toFixed(1)}`)}G.push(o("path",{key:"yz",d:Z.join(" "),fill:"none",stroke:y,"stroke-width":"0.8",opacity:"0.4"}))}let O=[{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 Y of O){let X=H(Y.dir[0]*1.15,Y.dir[1]*1.15,Y.dir[2]*1.15),U=H(-Y.dir[0]*1.15,-Y.dir[1]*1.15,-Y.dir[2]*1.15),Z=H(0,0,0);G.push(o("line",{key:`axis-${Y.id}`,x1:String(U.sx),y1:String(U.sy),x2:String(X.sx),y2:String(X.sy),stroke:Y.color,"stroke-width":"0.8",opacity:"0.4","stroke-dasharray":"3 3"}))}if(p){let Y=[{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 X of Y){let U=H(X.pos[0],X.pos[1],X.pos[2]);G.push(o("text",{key:`lbl-${X.text}`,x:String(U.sx),y:String(U.sy),"text-anchor":"middle","dominant-baseline":"central","font-size":"11","font-family":"serif",fill:"#475569",style:{pointerEvents:"none"}},X.text))}}if(m&&z.current.length>1){let Y=z.current,X=[];for(let U=0;U<Y.length;U++){let Z=Y[U],ee=H(Z.x,Z.y,Z.z);X.push(`${U===0?"M":"L"}${ee.sx.toFixed(1)},${ee.sy.toFixed(1)}`)}G.push(o("path",{key:"trail",d:X.join(" "),fill:"none",stroke:b,"stroke-width":"1.5",opacity:"0.5","stroke-linecap":"round","stroke-linejoin":"round"}))}if(h){let Y=Rt(M),X=H(0,0,0),U=H(Y.x,Y.y,Y.z);G.push(o("line",{key:"vec-line",x1:String(X.sx),y1:String(X.sy),x2:String(U.sx),y2:String(U.sy),stroke:g,"stroke-width":"2.5","stroke-linecap":"round"})),G.push(o("circle",{key:"vec-point",cx:String(U.sx),cy:String(U.sy),r:"5",fill:g,stroke:"#fff","stroke-width":"1.5"}));let Z=(M.theta*180/Math.PI).toFixed(0),ee=(M.phi*180/Math.PI).toFixed(0);G.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=${ee}\xB0`))}return o("svg",{ref:T,width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":R??"Bloch sphere quantum state visualization",style:{fontFamily:"sans-serif",cursor:d?k.current?"grabbing":"grab":"default"},onMouseDown:d?_:void 0,onMouseMove:d?V:void 0,onMouseUp:d?K:void 0,onMouseLeave:d?K:void 0,onWheel:u?Q:void 0},...G)}function Qd(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 yo(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 So(e){let t=Qd(e);if(t.length===0)return null;let n=yo(t,25),r=yo(t,50),i=yo(t,75),s=i-n,a=n-1.5*s,l=i+1.5*s,d=t[0];for(let m of t)if(m>=a){d=m;break}let u=t[t.length-1];for(let m=t.length-1;m>=0;m--)if(t[m]<=l){u=t[m];break}let h=0;for(let m of t)h+=m;let p=h/t.length,c=[];for(let m of t)(m<a||m>l)&&c.push(m);return{q1:n,median:r,q3:i,iqr:s,whiskerLow:d,whiskerHigh:u,mean:p,outliers:c,min:t[0],max:t[t.length-1]}}function eu(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 vs(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:p=60}=e,c=i==="vertical",m=n-p*2,f=r-p*2,b=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],y=q(()=>{let w=[];for(let T of t)w.push(So(T.values));return w},[t]),g=q(()=>{let w=1/0,T=-1/0;for(let F of y){if(F===null)continue;let W=s&&F.outliers.length>0?Math.min(F.whiskerLow,F.outliers[0]):F.whiskerLow,H=s&&F.outliers.length>0?Math.max(F.whiskerHigh,F.outliers[F.outliers.length-1]):F.whiskerHigh;W<w&&(w=W),H>T&&(T=H)}isFinite(w)||(w=0,T=1);let C=T-w,N=C>0?C*.05:.5;return{min:w-N,max:T+N}},[y,s]),x=c?f:m,v=c?m:f,R=t.length>0?t.length:1,D=v/R,M=D*Math.min(Math.max(d,.1),.95),$=S(w=>{let T=g.max-g.min;return T===0?x/2:(w-g.min)/T*x},[g,x]),A=S(()=>{if(!u)return[];let w=[],T=g.max-g.min,C=eu(T),N=Math.ceil(g.min/C)*C;for(let F=N;F<=g.max;F+=C){let W=$(F),H=String(Math.round(F*1e3)/1e3);if(c){let _=p+f-W;w.push(o("line",{key:`grid-${F}`,x1:String(p),y1:String(_),x2:String(p+m),y2:String(_),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`glabel-${F}`,x:String(p-6),y:String(_+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},H))}else{let _=p+W;w.push(o("line",{key:`grid-${F}`,x1:String(_),y1:String(p),x2:String(_),y2:String(p+f),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`glabel-${F}`,x:String(_),y:String(p+f+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},H))}}return w},[u,g,$,c,p,m,f]),I=S(()=>{let w=[];return w.push(o("line",{key:"axis-value",x1:String(p),y1:String(c?p:p+f),x2:String(p),y2:String(p+f),stroke:"#374151","stroke-width":"1.5"})),w.push(o("line",{key:"axis-category",x1:String(p),y1:String(p+f),x2:String(p+m),y2:String(p+f),stroke:"#374151","stroke-width":"1.5"})),w},[p,m,f,c]),P=S(()=>{let w=[];for(let T=0;T<t.length;T++){let C=y[T];if(C===null)continue;let N=t[T],F=N.color??b[T%b.length],W=D*T+D/2,H=M/2;if(c){let _=p+f-$(C.q1),V=p+f-$(C.q3),K=p+f-$(C.median),Q=p+f-$(C.whiskerLow),G=p+f-$(C.whiskerHigh),O=p+W;w.push(o("line",{key:`wl-${T}`,x1:String(O),y1:String(_),x2:String(O),y2:String(Q),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wlc-${T}`,x1:String(O-H*.4),y1:String(Q),x2:String(O+H*.4),y2:String(Q),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wh-${T}`,x1:String(O),y1:String(V),x2:String(O),y2:String(G),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`whc-${T}`,x1:String(O-H*.4),y1:String(G),x2:String(O+H*.4),y2:String(G),stroke:l,"stroke-width":"1.5"}));let Y=Math.min(_,V),X=Math.abs(_-V);if(w.push(o("rect",{key:`box-${T}`,x:String(O-H),y:String(Y),width:String(M),height:String(Math.max(X,1)),fill:F,stroke:l,"stroke-width":"1.5",opacity:"0.8","aria-label":`${N.label}: Q1=${C.q1.toFixed(1)}, median=${C.median.toFixed(1)}, Q3=${C.q3.toFixed(1)}`,role:"img"})),w.push(o("line",{key:`med-${T}`,x1:String(O-H),y1:String(K),x2:String(O+H),y2:String(K),stroke:"#fff","stroke-width":"2.5"})),a){let U=p+f-$(C.mean);w.push(o("circle",{key:`mean-${T}`,cx:String(O),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 U=0;U<C.outliers.length;U++){let Z=p+f-$(C.outliers[U]);w.push(o("circle",{key:`out-${T}-${U}`,cx:String(O),cy:String(Z),r:"3",fill:"none",stroke:l,"stroke-width":"1.5","aria-label":`Outlier: ${C.outliers[U]}`}))}w.push(o("text",{key:`cat-${T}`,x:String(O),y:String(p+f+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},N.label))}else{let _=p+$(C.q1),V=p+$(C.q3),K=p+$(C.median),Q=p+$(C.whiskerLow),G=p+$(C.whiskerHigh),O=p+W;w.push(o("line",{key:`wl-${T}`,x1:String(_),y1:String(O),x2:String(Q),y2:String(O),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wlc-${T}`,x1:String(Q),y1:String(O-H*.4),x2:String(Q),y2:String(O+H*.4),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wh-${T}`,x1:String(V),y1:String(O),x2:String(G),y2:String(O),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`whc-${T}`,x1:String(G),y1:String(O-H*.4),x2:String(G),y2:String(O+H*.4),stroke:l,"stroke-width":"1.5"}));let Y=Math.min(_,V),X=Math.abs(V-_);if(w.push(o("rect",{key:`box-${T}`,x:String(Y),y:String(O-H),width:String(Math.max(X,1)),height:String(M),fill:F,stroke:l,"stroke-width":"1.5",opacity:"0.8","aria-label":`${N.label}: Q1=${C.q1.toFixed(1)}, median=${C.median.toFixed(1)}, Q3=${C.q3.toFixed(1)}`,role:"img"})),w.push(o("line",{key:`med-${T}`,x1:String(K),y1:String(O-H),x2:String(K),y2:String(O+H),stroke:"#fff","stroke-width":"2.5"})),a){let U=p+$(C.mean);w.push(o("circle",{key:`mean-${T}`,cx:String(U),cy:String(O),r:"3.5",fill:"#fff",stroke:l,"stroke-width":"1.5","aria-label":`Mean: ${C.mean.toFixed(1)}`}))}if(s)for(let U=0;U<C.outliers.length;U++){let Z=p+$(C.outliers[U]);w.push(o("circle",{key:`out-${T}-${U}`,cx:String(Z),cy:String(O),r:"3",fill:"none",stroke:l,"stroke-width":"1.5","aria-label":`Outlier: ${C.outliers[U]}`}))}w.push(o("text",{key:`cat-${T}`,x:String(p-6),y:String(O+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},N.label))}}return w},[t,y,$,c,p,m,f,D,M,l,s,a,b]),L=S(()=>h?[o("text",{key:"title",x:String(n/2),y:String(p/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,n,p]),E=A(),B=I(),z=P(),k=L();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,...B,...z)}function ws(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 tu(e,t,n){return e<t?t:e>n?n:e}function vo(e){return typeof e=="number"&&isFinite(e)&&!isNaN(e)}function ks(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:p="#3b82f6",opacity:c=.7,title:m,padding:f=60}=e,b=q(()=>{let z=[];for(let k=0;k<t.length;k++){let w=t[k];vo(w.x)&&vo(w.y)&&vo(w.r)&&z.push(w)}return z},[t]),y=n-f*2,g=r-f*2,x=q(()=>{if(b.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,T=-1/0,C=1/0,N=-1/0;for(let F of b)F.x<z&&(z=F.x),F.x>k&&(k=F.x),F.y<w&&(w=F.y),F.y>T&&(T=F.y),F.r<C&&(C=F.r),F.r>N&&(N=F.r);return z===k&&(z-=1,k+=1),w===T&&(w-=1,T+=1),C===N&&(C=0,N=N>0?N:1),{xMin:z,xMax:k,yMin:w,yMax:T,rMin:C,rMax:N}},[b]),v=S(z=>{let k=x.xMax-x.xMin;return f+(z-x.xMin)/k*y},[x,f,y]),R=S(z=>{let k=x.yMax-x.yMin;return f+g-(z-x.yMin)/k*g},[x,f,g]),D=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=ws(x.xMax-x.xMin),w=Math.ceil(x.xMin/k)*k;for(let N=w;N<=x.xMax;N+=k){let F=v(N);z.push(o("line",{key:`grid-x-${N}`,x1:String(F),y1:String(f),x2:String(F),y2:String(f+g),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),z.push(o("text",{key:`grid-xlabel-${N}`,x:String(F),y:String(f+g+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(N*1e3)/1e3)))}let T=ws(x.yMax-x.yMin),C=Math.ceil(x.yMin/T)*T;for(let N=C;N<=x.yMax;N+=T){let F=R(N);z.push(o("line",{key:`grid-y-${N}`,x1:String(f),y1:String(F),x2:String(f+y),y2:String(F),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),z.push(o("text",{key:`grid-ylabel-${N}`,x:String(f-6),y:String(F+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(N*1e3)/1e3)))}return z},[a,x,v,R,f,y,g]),$=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+g),stroke:"#374151","stroke-width":"1.5"})),z.push(o("line",{key:"axis-x",x1:String(f),y1:String(f+g),x2:String(f+y),y2:String(f+g),stroke:"#374151","stroke-width":"1.5"})),i&&z.push(o("text",{key:"x-label",x:String(f+y/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,y,g,i,s]),A=S(()=>{let z=[];for(let k=0;k<b.length;k++){let w=b[k],T=v(w.x),C=R(w.y),N=tu(D(w.r),h,u),F=w.color??p;z.push(o("circle",{key:`bubble-${k}`,cx:String(T),cy:String(C),r:String(N),fill:F,opacity:String(c),stroke:F,"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(T),y:String(C-N-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},w.label))}return z},[b,v,R,D,p,c,d,h,u]),I=S(()=>m?[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"},m)]:[],[m,n,f]),P=M(),L=$(),E=A(),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":m??"Bubble chart",style:{fontFamily:"sans-serif"}},...B,...P,...L,...E)}var nu=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ou=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function ru(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 Cs(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 Ms(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 iu(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 su(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=Ms(t[i]),l=Ms(t[i+1]);return iu(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}var au=["#9be9a8","#40c463","#30a14e","#216e39"];function Es(e){let{data:t=[],width:n=800,height:r=160,colorScale:i=au,cellSize:s=12,cellGap:a=2,showMonthLabels:l=!0,showDayLabels:d=!0,emptyColor:u="#ebedf0",title:h}=e,{dateMap:p,startDate:c,endDate:m,maxVal:f}=q(()=>{let E=new Map,B=0,z=null,k=null;for(let C of t){let N=ru(C.date);if(isNaN(N.getTime()))continue;let F=Cs(N);E.set(F,(E.get(F)??0)+C.value);let W=E.get(F);W>B&&(B=W),(z===null||N<z)&&(z=N),(k===null||N>k)&&(k=N)}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 T=new Date(k);return T.setDate(T.getDate()+(6-T.getDay())),{dateMap:E,startDate:w,endDate:T,maxVal:B>0?B:1}},[t]),b=d?30:0,y=l?16:0,g=h?28:0,x=b+10,v=g+y+4,R=S(()=>{let E=[],B=new Date(c),z=0;for(;B<=m;){let k=B.getDay();k===0&&B>c&&z++;let w=Cs(B),T=p.get(w),C=T!==void 0&&T>0?su(T/f,i):u,N=x+z*(s+a),F=v+k*(s+a);E.push(o("rect",{key:`day-${w}`,x:String(N),y:String(F),width:String(s),height:String(s),rx:"2",ry:"2",fill:C,"aria-label":`${w}: ${T??0}`})),B.setDate(B.getDate()+1)}return E},[c,m,p,f,i,u,s,a,x,v]),D=S(()=>{if(!l)return[];let E=[],B=new Date(c),z=0,k=-1;for(;B<=m;){let w=B.getDay();w===0&&B>c&&z++;let T=B.getMonth();if(T!==k&&w===0){k=T;let C=x+z*(s+a);E.push(o("text",{key:`month-${z}`,x:String(C),y:String(g+y-2),"font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},nu[T]))}B.setDate(B.getDate()+1)}return E},[l,c,m,s,a,x,g,y]),M=S(()=>{if(!d)return[];let E=[],B=[1,3,5];for(let z of B){let k=v+z*(s+a)+s/2;E.push(o("text",{key:`day-label-${z}`,x:String(b),y:String(k),"text-anchor":"end","dominant-baseline":"central","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},ou[z]))}return E},[d,s,a,v,b]),$=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 A=$(),I=D(),P=M(),L=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":h??"Calendar heat map",style:{fontFamily:"sans-serif"}},...A,...I,...P,...L)}var lu=["#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 cu(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),p=s-i>Math.PI?1:0;return[`M ${a.x} ${a.y}`,`A ${n} ${n} 0 ${p} 1 ${l.x} ${l.y}`,`L ${u.x} ${u.y}`,`A ${r} ${r} 0 ${p} 0 ${d.x} ${d.y}`,"Z"].join(" ")}function du(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),p=i-r,c=a-s,m=p>Math.PI?1:0,f=c>Math.PI?1:0;return[`M ${l.x} ${l.y}`,`A ${n} ${n} 0 ${m} 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 uu(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 m=0;for(let f=0;f<i;f++){let b=e[c]?.[f]??0;m+=Math.max(0,b)}s.push(m),a+=m}if(a===0){let c=(2*Math.PI-i*r)/Math.max(i,1),m=[],f=0;for(let b=0;b<i;b++)m.push({index:b,label:t[b]??`Group ${b}`,color:n[b%n.length],startAngle:f,endAngle:f+c,value:0}),f+=c+r;return{groups:m,chords:[]}}let l=2*Math.PI-i*r,d=[],u=0;for(let c=0;c<i;c++){let m=s[c]/a*l;d.push({index:c,label:t[c]??`Group ${c}`,color:n[c%n.length],startAngle:u,endAngle:u+m,value:s[c]}),u+=m+r}let h=[];for(let c=0;c<i;c++)h.push(d[c].startAngle);let p=[];for(let c=0;c<i;c++)for(let m=c;m<i;m++){let f=Math.max(0,e[c]?.[m]??0),b=c===m?0:Math.max(0,e[m]?.[c]??0);if(f===0&&b===0)continue;let y=f+b,g=s[c]>0?f/a*l:0,x=h[c],v=x+g;h[c]=v;let R=s[m]>0?f/a*l:0,D=h[m],M=D+R;if(h[m]=M,c===m){f>0&&p.push({sourceIndex:c,targetIndex:m,sourceStartAngle:x,sourceEndAngle:v,targetStartAngle:D,targetEndAngle:M,value:f,color:d[c].color});continue}let $=s[m]>0?b/a*l:0,I=h[m]+$;h[m]=I;let P=s[c]>0?b/a*l:0,E=h[c]+P;h[c]=E,(f>0||b>0)&&p.push({sourceIndex:c,targetIndex:m,sourceStartAngle:x,sourceEndAngle:Math.max(v,x+.001),targetStartAngle:D,targetEndAngle:Math.max(M,D+.001),value:y,color:d[c].color})}return{groups:d,chords:p}}function Is(e){let{matrix:t,labels:n,width:r=600,height:i=600,colors:s=lu,padAngle:a=.05,showLabels:l=!0,showValues:d=!1,ribbonOpacity:u=.5,innerRadiusRatio:h=.9,title:p}=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":p??"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,m=i/2,f=Math.min(r,i)/2-40,b=f*Math.max(.5,Math.min(.99,h)),y=f+16,g=q(()=>uu(t,n,s,a),[t,n,s,a]),x=S(()=>{let A=[];for(let I=0;I<g.groups.length;I++){let P=g.groups[I];if(P.endAngle-P.startAngle<.001)continue;let E=cu(c,m,f,b,P.startAngle,P.endAngle);if(A.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 B=(P.startAngle+P.endAngle)/2,z=nt(c,m,y,B),T=((B-Math.PI/2)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)<Math.PI,C=T?"start":"end",N=B*180/Math.PI-90;T||(N+=180);let F=d?`${P.label} (${P.value})`:P.label;A.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(${N}, ${z.x}, ${z.y})`,"dominant-baseline":"central","pointer-events":"none"},F))}}return A},[g,c,m,f,b,y,l,d]),v=S(()=>{let A=[];for(let I=0;I<g.chords.length;I++){let P=g.chords[I],L=du(c,m,b,P.sourceStartAngle,P.sourceEndAngle,P.targetStartAngle,P.targetEndAngle);A.push(o("path",{key:`ribbon-${I}`,d:L,fill:P.color,"fill-opacity":String(u),stroke:P.color,"stroke-width":"0.5","stroke-opacity":"0.3"}))}return A},[g,c,m,b,u]),R=S(()=>p?[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"},p)]:[],[p,r]),D=v(),M=x(),$=R();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Chord diagram",style:{fontFamily:"sans-serif"}},...$,...D,...M)}var pu=["#3b82f6","#22c55e","#f59e0b","#8b5cf6","#ef4444","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function fu(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 p=0;p<u.length;p++)h.push(n+r.length+p);t.push({id:d,node:s,depth:a,parentId:l,childIndices:h});for(let p=0;p<u.length;p++)r.push([u[p],a+1,d])}return{flatNodes:t,maxDepth:i}}function mu(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 gu(e,t,n,r,i,s,a,l){let{flatNodes:d,maxDepth:u}=fu(e);if(d.length===0)return[];let h=mu(d),p=t-s*2,c=n-s*2,m=a==="horizontal",f=u+1,b=m?f>1?(p-r)/u:0:f>1?(c-i)/u:0,y=new Array(d.length),g=h[0],x=m?c:p,v=g>0?x/g:x,R=new Array(d.length);R[0]=[0,g];let D=[0],M=0;for(;M<D.length;){let $=D[M];M++;let A=d[$],[I,P]=R[$],L=(I+P)/2,E=s+A.depth*b,B=s+(L-.5)*v,z=m?E:B,k=m?B:E,w=A.node.color??l[A.depth%l.length];y[$]={id:A.id,label:A.node.label,value:A.node.value!==void 0?String(A.node.value):"",color:w,depth:A.depth,x:z,y:k,parentId:A.parentId,childCount:A.childIndices.length,subtreeLeafCount:h[$]};let T=I;for(let C of A.childIndices)if(C<d.length){let N=h[C],F=T+N;R[C]=[T,F],T=F,D.push(C)}}return y}function Rs(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=pu,title:p,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":p??"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 m=i==="horizontal",f=q(()=>gu(t,n,r,s,a,c,i,h),[t,n,r,s,a,c,i,h]),b=q(()=>{let M=new Map;for(let $=0;$<f.length;$++){let A=f[$];M.set(A.id,A)}return M},[f]),y=S(()=>{if(!d)return[];let M=[];for(let $=0;$<f.length;$++){let A=f[$];if(A.parentId===null)continue;let I=b.get(A.parentId);if(!I)continue;let P,L,E,B;m?(P=I.x+s,L=I.y+a/2,E=A.x,B=A.y+a/2):(P=I.x+s/2,L=I.y+a,E=A.x+s/2,B=A.y);let z=(P+E)/2,k=(L+B)/2,w;m?w=`M ${P} ${L} C ${z} ${L}, ${z} ${B}, ${E} ${B}`:w=`M ${P} ${L} C ${P} ${k}, ${E} ${k}, ${E} ${B}`,M.push(o("path",{key:`conn-${$}`,d:w,fill:"none",stroke:u,"stroke-width":"1.5","stroke-opacity":"0.7"}))}return M},[f,b,m,s,a,d,u]),g=S(()=>{let M=[];for(let $=0;$<f.length;$++){let A=f[$];M.push(o("rect",{key:`node-rect-${A.id}`,x:String(A.x),y:String(A.y),width:String(s),height:String(a),rx:"4",ry:"4",fill:A.color,stroke:"#374151","stroke-width":"1",role:"img","aria-label":A.value?`${A.label}: ${A.value}`:A.label}));let I=l&&A.value?A.y+a/2-2:A.y+a/2+4;M.push(o("text",{key:`node-label-${A.id}`,x:String(A.x+s/2),y:String(I),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#fff","pointer-events":"none"},A.label)),l&&A.value&&M.push(o("text",{key:`node-value-${A.id}`,x:String(A.x+s/2),y:String(A.y+a/2+12),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.85)","pointer-events":"none"},A.value))}return M},[f,s,a,l]),x=S(()=>p?[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"},p)]:[],[p,n]),v=y(),R=g(),D=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":p??"Decomposition tree",style:{fontFamily:"sans-serif"}},...D,...v,...R)}var Ps=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function hu(e){return Ps[e%Ps.length]}function Ts(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??hu(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 Ds(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),p=l/h,c=d/h,m=n-h;if(i.fixed&&a.fixed)continue;i.fixed?(a.x+=p*m,a.y+=c*m):a.fixed?(i.x-=p*m,i.y-=c*m):(i.x-=p*m*.5,i.y-=c*m*.5,a.x+=p*m*.5,a.y+=c*m*.5);let f=i.vx-a.vx,b=i.vy-a.vy,y=f*p+b*c;y<=0||(i.fixed?(a.vx+=y*p,a.vy+=y*c):a.fixed?(i.vx-=y*p,i.vy-=y*c):(i.vx-=y*p,i.vy-=y*c,a.vx+=y*p,a.vy+=y*c))}}}function bu(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 p=new Float64Array(u),c=new Float64Array(u);for(let x=0;x<u;x++){let v=e[x];for(let R=x+1;R<u;R++){let D=e[R],M=v.x-D.x,$=v.y-D.y,A=M*M+$*$;A<1&&(A=1);let I=Math.sqrt(A),P=i/A,L=M/I*P,E=$/I*P;p[x]+=L,c[x]+=E,p[R]-=L,c[R]-=E}}for(let x=0;x<t.length;x++){let v=t[x],R=h.get(v.source),D=h.get(v.target);if(R===void 0||D===void 0)continue;let M=e[R],$=e[D],A=$.x-M.x,I=$.y-M.y,P=Math.sqrt(A*A+I*I);if(P<.1)continue;let L=v.weight??1,E=P-l,B=s*E*L,z=A/P*B,k=I/P*B;p[R]+=z,c[R]+=k,p[D]-=z,c[D]-=k}let m=n/2,f=r/2,b=.001;for(let x=0;x<u;x++){let v=e[x];p[x]+=(m-v.x)*b,c[x]+=(f-v.y)*b}let y=20,g=[];for(let x=0;x<u;x++){let v=e[x];if(v.fixed){g.push({...v,vx:0,vy:0});continue}let R=(v.vx+p[x])*a,D=(v.vy+c[x])*a,M=Math.sqrt(R*R+D*D),$=10;M>$&&(R=R/M*$,D=D/M*$);let A=v.x+R,I=v.y+D;A=Math.max(y,Math.min(n-y,A)),I=Math.max(y,Math.min(r-y,I)),g.push({...v,x:A,y:I,vx:R,vy:D})}return Ds(g,d),g}function xu(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 $s(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:p=.01,damping:c=.9,edgeLength:m=100,edgeColor:f="#94a3b8",edgeWidth:b=1.5,title:y,customForce:g,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":y??"Empty force-directed graph"},y?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"},y):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=te(Ts(t,r,i)),[R,D]=j(0),M=te(!0),$=te(!1),A=te(n);A.current=n;let I=te(g);I.current=g;let P=te(null),L=te({repulsionForce:h,attractionForce:p,damping:c,edgeLength:m,width:r,height:i,nodeRadius:s,solidNodes:l});L.current={repulsionForce:h,attractionForce:p,damping:c,edgeLength:m,width:r,height:i,nodeRadius:s,solidNodes:l};let E=te(new Map);re(()=>{v.current=Ts(t,r,i),$.current=!1,M.current=!0,E.current=new Map,D(ae=>ae+1)},[t.length]),re(()=>{let ae=0,J=()=>{if(!M.current)return;let se=L.current,ce=I.current,me;if(ce?(me=ce(v.current,A.current,se.width,se.height,P.current),se.solidNodes&&Ds(me,se.nodeRadius)):me=bu(v.current,A.current,se.width,se.height,se.repulsionForce,se.attractionForce,se.damping,se.edgeLength,se.nodeRadius),v.current=me,x)for(let ge=0;ge<x.length;ge++){let ye=x[ge],le=me.find(ie=>ie.id===ye.nodeId);if(!le)continue;let ne=E.current.get(ye.nodeId);ne||(ne=[],E.current.set(ye.nodeId,ne)),ne.push({x:le.x,y:le.y});let pe=ye.maxPoints??200;ne.length>pe&&ne.splice(0,ne.length-pe)}if(!ce&&xu(me)<.01){$.current=!0,D(ge=>ge+1);return}D(ge=>ge+1),ae=requestAnimationFrame(J)};return ae=requestAnimationFrame(J),()=>{M.current=!1,cancelAnimationFrame(ae)}},[]);let B=v.current,z=S(ae=>{v.current=v.current.map(J=>J.id===ae?{...J,fixed:!J.fixed,vx:0,vy:0}:J),$.current&&($.current=!1,M.current=!0,D(J=>J+1))},[]),k=te(null),w=te(null),T=S(ae=>{let J=ae,se=w.current;if(!se)return{x:J.clientX,y:J.clientY};let ce=se.getBoundingClientRect(),me=r/ce.width,ge=i/ce.height;return{x:(J.clientX-ce.left)*me,y:(J.clientY-ce.top)*ge}},[r,i]),C=te(!1),N=S((ae,J)=>{J.stopPropagation(),k.current=ae;let se=v.current.find(ce=>ce.id===ae);C.current=se?.fixed??!1,v.current=v.current.map(ce=>ce.id===ae?{...ce,fixed:!0,vx:0,vy:0}:ce)},[]),F=S(ae=>{let J=T(ae);if(P.current={x:J.x,y:J.y},!k.current)return;let se=k.current,ce=20;v.current=v.current.map(me=>me.id===se?{...me,x:Math.max(ce,Math.min(r-ce,J.x)),y:Math.max(ce,Math.min(i-ce,J.y))}:me),$.current&&($.current=!1,M.current=!0),D(me=>me+1)},[r,i,T]),W=S(()=>{let ae=k.current;ae&&(v.current=v.current.map(J=>J.id===ae?{...J,fixed:C.current}:J)),k.current=null},[]),H=S(()=>{k.current=null,P.current=null},[]),_=q(()=>{let ae=new Map;for(let J=0;J<B.length;J++)ae.set(B[J].id,B[J]);return ae},[R]),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]),K=S(()=>{let ae=[];for(let J=0;J<n.length;J++){let se=n[J],ce=_.get(se.source),me=_.get(se.target);if(!ce||!me||se.weight!==void 0&&se.weight<=0)continue;let ge=se.weight?Math.max(.5,Math.min(6,b*se.weight)):b,ye={key:`edge-${J}`,x1:String(ce.x),y1:String(ce.y),x2:String(me.x),y2:String(me.y),stroke:se.color??f,"stroke-width":String(ge),"stroke-opacity":"0.6"};u&&(ye["marker-end"]="url(#arrowhead)"),ae.push(o("line",ye))}return ae},[R,f,b,u]),Q=S(()=>{let ae=[];for(let J=0;J<B.length;J++){let se=B[J];ae.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:ce=>N(se.id,ce),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&&ae.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 ae},[R,s,d,z]),G=S(()=>y?[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"},y)]:[],[y,r]),O=S(()=>{if(!x||x.length===0)return[];let ae=[];for(let J=0;J<x.length;J++){let se=x[J],ce=E.current.get(se.nodeId);if(!ce||ce.length<2)continue;let me=[];for(let ge=0;ge<ce.length;ge++){let ye=ce[ge];me.push(`${ge===0?"M":"L"}${ye.x.toFixed(1)},${ye.y.toFixed(1)}`)}ae.push(o("path",{key:`trail-${se.nodeId}`,d:me.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 ae},[R,x]),Y=V(),X=O(),U=K(),Z=Q(),ee=G();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":y??"Force-directed graph \u2014 drag nodes to move, double-click to lock",style:{fontFamily:"sans-serif",cursor:k.current?"grabbing":"default"},onMouseMove:F,onMouseUp:W,onMouseLeave:H},...Y,...ee,...X,...U,...Z)}var zs=["#3b82f6","#6366f1","#8b5cf6","#a855f7","#c084fc","#d8b4fe","#e9d5ff","#f3e8ff"];function As(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=zs,title:h}=e,p=i==="vertical",c=h?30:0,m=120,f=q(()=>{let A=0;for(let I=0;I<t.length;I++)t[I].value>A&&(A=t[I].value);return A>0?A:1},[t]),b=S(A=>f===0?0:Math.max(.05,A/f),[f]),y=S((A,I)=>I||(u[A%u.length]??zs[0]),[u]),g=S(()=>{if(t.length===0)return[];let A=[],I=40,P=n-I*2-m,L=r-c-I*2,E=d*(t.length-1),B=Math.max(1,(L-E)/t.length),z=I+P/2;for(let k=0;k<t.length;k++){let w=t[k],T=k<t.length-1?t[k+1]:null,C=y(k,w.color),N=b(w.value),F=T!==null?b(T.value):N*.6,W=P/2*N,H=P/2*F,_=c+I+k*(B+d),V=z-W,K=z+W,Q=z+H,G=z-H,O=`${V},${_} ${K},${_} ${Q},${_+B} ${G},${_+B}`;A.push(o("polygon",{key:`section-${k}`,points:O,fill:C,stroke:"#fff","stroke-width":"1"}));let Y=I+P+12,X=_+B/2;if(s&&A.push(o("text",{key:`label-${k}`,x:String(Y),y:String(X-(a||l?6:0)),"text-anchor":"start","font-size":"12","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},w.label)),a||l){let U="";if(a&&(U=String(w.value)),l&&t.length>0){let Z=t[0].value,ee=Z>0?Math.round(w.value/Z*100):0;U+=a?` (${ee}%)`:`${ee}%`}A.push(o("text",{key:`value-${k}`,x:String(Y),y:String(X+(s?10:4)),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},U))}}return A},[t,n,r,c,d,s,a,l,y,b,m]),x=S(()=>{if(t.length===0)return[];let A=[],I=40,P=n-I*2,E=r-c-I*2-40,B=d*(t.length-1),z=Math.max(1,(P-B)/t.length),k=c+I+E/2;for(let w=0;w<t.length;w++){let T=t[w],C=w<t.length-1?t[w+1]:null,N=y(w,T.color),F=b(T.value),W=C!==null?b(C.value):F*.6,H=E/2*F,_=E/2*W,V=I+w*(z+d),K=k-H,Q=k-_,G=k+_,O=k+H,Y=`${V},${K} ${V+z},${Q} ${V+z},${G} ${V},${O}`;A.push(o("polygon",{key:`section-${w}`,points:Y,fill:N,stroke:"#fff","stroke-width":"1"}));let X=V+z/2,U=c+I+E+14;if(s&&A.push(o("text",{key:`label-${w}`,x:String(X),y:String(U),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},T.label)),a||l){let Z="";if(a&&(Z=String(T.value)),l&&t.length>0){let ee=t[0].value,ae=ee>0?Math.round(T.value/ee*100):0;Z+=a?` (${ae}%)`:`${ae}%`}A.push(o("text",{key:`value-${w}`,x:String(X),y:String(U+14),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#6b7280"},Z))}}return A},[t,n,r,c,d,s,a,l,y,b]),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]),R=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]),D=v(),M=p?g():x(),$=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":h??"Funnel chart",style:{fontFamily:"sans-serif"}},...D,...M,...$)}var Ls=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Bs(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 yu(e,t){return t||Ls[e%Ls.length]}function Fs(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:p=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,m=q(()=>{let L=1/0,E=-1/0;for(let B of t){B.start<L&&(L=B.start);let z=B.start+B.duration;z>E&&(E=z)}return L===1/0&&(L=0,E=1),{min:L,max:E,range:E-L}},[t]),f=q(()=>{let L=t.slice();return L.sort((E,B)=>E.group!==B.group?(E.group??"").localeCompare(B.group??""):E.start-B.start),L},[t]),b=r??p*2+f.length*(i+s)+s+20,y=n-p-c-p,g=p+(h?20:0),x=S(L=>m.range===0?c+p:c+p+(L-m.min)/m.range*y,[m,y,c,p]),v=S(()=>{if(!a)return[];let L=[],E=Bs(m.range),B=Math.ceil(m.min/E)*E,z=g+f.length*(i+s)+s;for(let k=B;k<=m.max;k+=E){let w=x(k);L.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 L},[a,m,g,f.length,i,s,x]),R=S(()=>{let L=[],E=Bs(m.range),B=Math.ceil(m.min/E)*E,z=g-8;for(let k=B;k<=m.max;k+=E){let w=x(k);L.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 L.push(o("text",{key:"time-unit",x:String(n-p),y:String(z),"text-anchor":"end","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.4","font-style":"italic"},u)),L},[m,g,x,u,n,p]),D=S(()=>{let L=[],E="";for(let B=0;B<f.length;B++){let z=f[B],k=g+B*(i+s)+s,w=x(z.start),T=Math.max(2,x(z.start+z.duration)-w),C=yu(B,z.color);z.group&&z.group!==E&&(E=z.group,l&&L.push(o("text",{key:`group-${B}`,x:String(p),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))),L.push(o("rect",{key:`bar-${z.id}`,x:String(w),y:String(k),width:String(T),height:String(i),rx:"4",ry:"4",fill:C,role:"graphics-symbol","aria-label":`${z.label}: start ${z.start}, duration ${z.duration}`})),l&&L.push(o("text",{key:`label-${z.id}`,x:String(c+p-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&&T>30&&L.push(o("text",{key:`prog-${z.id}`,x:String(w+T/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 L},[f,g,i,s,x,l,d,c,p]),M=S(()=>h?[o("text",{key:"title",x:String(n/2),y:String(p/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},h)]:[],[h,n,p]),$=v(),A=R(),I=D(),P=M();return o("svg",{width:"100%",height:String(b),viewBox:`0 0 ${n} ${b}`,xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Gantt chart",style:{fontFamily:"sans-serif"}},...P,...$,...A,...I)}var Su=Math.PI/180;function vu(e){return e*Su}function Je(e,t,n,r){let i=vu(r);return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function Ns(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 wu(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 _s(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:p=!0,tickCount:c=10,label:m,unit:f,colors:b=["#22c55e","#f59e0b","#ef4444"],needleColor:y="#374151",backgroundColor:g="#e5e7eb"}=e,x=isFinite(n)&&!isNaN(n)?n:0,v=isFinite(r)&&!isNaN(r)&&r>x?r:x+100,R=isFinite(t)&&!isNaN(t)?wu(t,x,v):x,D=(u?24:0)+(m?18:0),M=i/2,$=(s-D)*.6,A=Math.min(i/2,(s-D)*.55)-d/2-10,I=A-d,P=A-d/2,L=l-a,E=S(O=>{let Y=v-x;if(Y===0)return a;let X=(O-x)/Y;return a+X*L},[x,v,a,L]),B=S(()=>{let O=Ns(M,$,P,a,l);return[o("path",{key:"bg-arc",d:O,fill:"none",stroke:g,"stroke-width":String(d),"stroke-linecap":"round"})]},[M,$,P,a,l,g,d]),z=S(()=>{if(b.length===0)return[];let O=[],Y=L/b.length;for(let X=0;X<b.length;X++){let U=a+X*Y,Z=U+Y,ee=Ns(M,$,P,U,Z);O.push(o("path",{key:`seg-${X}`,d:ee,fill:"none",stroke:b[X],"stroke-width":String(d),"stroke-linecap":X===0||X===b.length-1?"round":"butt",opacity:"0.85"}))}return O},[b,L,a,M,$,P,d]),k=S(()=>{if(!p||c<=0)return[];let O=[],Y=Math.max(1,Math.min(c,100));for(let X=0;X<=Y;X++){let U=X/Y,Z=a+U*L,ee=X%2===0,ae=ee?10:6,J=Je(M,$,A+4,Z),se=Je(M,$,A+4+ae,Z);if(O.push(o("line",{key:`tick-${X}`,x1:String(J.x),y1:String(J.y),x2:String(se.x),y2:String(se.y),stroke:"currentColor",opacity:"0.4","stroke-width":ee?"2":"1"})),ee){let ce=x+U*(v-x),me=Je(M,$,A+4+ae+12,Z);O.push(o("text",{key:`tick-label-${X}`,x:String(me.x),y:String(me.y+3),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},mt(ce)))}}return O},[p,c,a,L,M,$,A,x,v]),w=S(()=>{let O=[],Y=E(R),X=I-8,U=Je(M,$,X,Y),Z=6,ee=Y+90,ae=Y-90,J=Je(M,$,Z,ee),se=Je(M,$,Z,ae);return O.push(o("polygon",{key:"needle",points:`${U.x},${U.y} ${J.x},${J.y} ${se.x},${se.y}`,fill:y,stroke:"none"})),O.push(o("circle",{key:"needle-cap",cx:String(M),cy:String($),r:"8",fill:y,stroke:"#fff","stroke-width":"2"})),O},[R,E,M,$,I,y]),T=S(()=>{if(!u)return[];let O=[],Y=mt(R),X=Y+(f?" "+f:""),U=$+P+20;return O.push(o("text",{key:"value-text",x:String(M),y:String(U),"text-anchor":"middle","font-size":"22","font-weight":"bold","font-family":"sans-serif",fill:"currentColor","aria-label":`Value: ${X}`},Y,f?o("tspan",{key:"unit","font-size":"14","font-weight":"normal",opacity:"0.6",fill:"currentColor"}," "+f):null)),O},[u,R,f,M,$,P]),C=S(()=>{if(!m)return[];let O=$+P+(u?40:20);return[o("text",{key:"label",x:String(M),y:String(O),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},m)]},[m,M,$,P,u]),N=S(()=>{if(!h)return[];let O=[],Y=Je(M,$,P,a),X=Je(M,$,P,l);return O.push(o("text",{key:"min-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"},mt(x))),O.push(o("text",{key:"max-label",x:String(X.x+4),y:String(X.y+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},mt(v))),O},[h,M,$,P,a,l,x,v]),F=B(),W=z(),H=k(),_=w(),V=T(),K=C(),Q=N(),G=`Gauge: ${mt(R)}${f?" "+f:""}, range ${mt(x)} to ${mt(v)}${m?", "+m:""}`;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(R),"aria-valuemin":String(x),"aria-valuemax":String(v),"aria-label":G,style:{fontFamily:"sans-serif"}},...F,...W,...H,..._,...V,...K,...Q)}var Wt={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 -.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1.5 -1.4,1.6 .4,.9 2.3,-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 Ws(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,p=q(()=>Object.keys(Wt),[]),c=S(g=>{l&&l(g)},[l]),m=S((g,x)=>{let v=x.currentTarget;v&&v.setAttribute("fill",u),d&&d(g)},[d,u]),f=S((g,x)=>{let v=x.currentTarget;if(v){let R=r[g]??i;v.setAttribute("fill",R)}d&&d(null)},[d,r,i]),b=q(()=>{let g=[];for(let x=0;x<p.length;x++){let v=p[x],R=Wt[v],D=r[v]??i,M={key:`state-${v}`,d:R.path,fill:D,stroke:s,"stroke-width":String(a),"stroke-linejoin":"round","data-state":v,role:"img","aria-label":R.name,style:{cursor:l?"pointer":"default"}};if(l){let A=v;M.onClick=()=>c(A),M.onKeyDown=I=>{(I.key==="Enter"||I.key===" ")&&c(A)},M.tabindex=0,M.role="button",M["aria-label"]=R.name}let $=v;M.onMouseOver=A=>m($,A),M.onMouseOut=A=>f($,A),g.push(o("path",M))}return g},[p,r,i,s,a,l,c,m,f]),y=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"}},y,...b)}function wo(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 ku(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 Cu(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=wo(t[i]),l=wo(t[i+1]);return ku(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}function Mu(e){let{r:t,g:n,b:r}=wo(e);return(.299*t+.587*n+.114*r)/255}var Eu=["#3b82f6","#fbbf24","#ef4444"];function Os(e){let{data:t=[],rowLabels:n,columnLabels:r,width:i=600,height:s=400,colorScale:a=Eu,minValue:l,maxValue:d,showValues:u=!1,cellBorderColor:h="#fff",cellBorderWidth:p=1,title:c,padding:m=60}=e,f=t.length,b=q(()=>{let k=0;for(let w of t)w.length>k&&(k=w.length);return k},[t]),{minVal:y,maxVal:g}=q(()=>{let k=l??1/0,w=d??-1/0;for(let T of t)for(let C of T)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?m:20,R=r?m:20,D=i-v-20,M=s-x-R-20,$=b>0?D/b:0,A=f>0?M/f:0,I=S(()=>{let k=[];for(let w=0;w<f;w++){let T=t[w];for(let C=0;C<b;C++){let N=C<T.length?T[C]:0,F=(N-y)/(g-y),W=Cu(F,a),H=v+C*$,_=x+20+w*A;if(k.push(o("rect",{key:`cell-${w}-${C}`,x:String(H),y:String(_),width:String($),height:String(A),fill:W,stroke:h,"stroke-width":String(p)})),u){let V=Mu(W)>.5?"#111827":"#ffffff";k.push(o("text",{key:`val-${w}-${C}`,x:String(H+$/2),y:String(_+A/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.min(11,$*.3,A*.4)),"font-family":"sans-serif",fill:V},String(Math.round(N*100)/100)))}}}return k},[t,f,b,y,g,a,$,A,v,x,u,h,p]),P=S(()=>{let k=[];if(n)for(let w=0;w<f;w++){let T=w<n.length?n[w]:"",C=x+20+w*A+A/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"},T))}if(r)for(let w=0;w<b;w++){let T=w<r.length?r[w]:"",C=v+w*$+$/2,N=x+20+f*A+16;k.push(o("text",{key:`col-label-${w}`,x:String(C),y:String(N),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},T))}return k},[n,r,f,b,$,A,v,x]),L=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||b===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=L(),B=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,...B,...z)}function Iu(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 Ru(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 ko(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function Hs(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:p,padding:c=60}=e,m=Math.max(1,Math.round(n)),f=q(()=>Iu(t,m),[t,m]),b=q(()=>{let E=0;for(let B=0;B<f.length;B++)f[B].count>E&&(E=f[B].count);return E>0?E:1},[f]),y=r-c*2,g=i-c*2,x=S(()=>{if(!l)return[];let E=Ru(b),B=[];for(let z=E;z<=b;z+=E){let k=c+g-z/b*g;B.push(o("line",{key:`grid-${z}`,x1:String(c),y1:String(k),x2:String(c+y),y2:String(k),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),B.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 B},[l,b,c,y,g]),v=S(()=>{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+y),y2:String(c+g),stroke:"#374151","stroke-width":"1.5"})),E},[c,y,g]),R=S(()=>{if(f.length===0)return[];let E=[],B=a*(f.length-1),z=Math.max(1,(y-B)/f.length);for(let k=0;k<f.length;k++){let w=f[k],T=w.count/b*g,C=c+k*(z+a),N=c+g-T;if(E.push(o("rect",{key:`bar-${k}`,x:String(C),y:String(N),width:String(z),height:String(T),fill:s})),d&&w.count>0&&E.push(o("text",{key:`val-${k}`,x:String(C+z/2),y:String(N-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,ko(w.min));E.push(o("text",{key:`xlabel-${k}`,x:String(C+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+y;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"},ko(k.max)))}return E},[f,b,a,s,d,c,y,g]),D=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+y/2),y:String(i-8),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151"},h)),p&&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})`},p)),E},[u,h,p,r,i,c,y,g]),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]),$=x(),A=v(),I=R(),P=D(),L=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,...$,...A,...I,...L)}function Pu(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",stemColor:s="#94a3b8",stemWidth:a=2,dotRadius:l=6,dotColor:d="#3b82f6",showGrid:u=!0,showValues:h=!0,title:p,padding:c=60}=e,m=i==="vertical",f=m?30:0,b=n-c*2,y=r-c*2-f,g=m?y:b,x=m?b:y,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]),R=q(()=>t.length===0?0:x/t.length,[t.length,x]),D=S(()=>{if(!u)return[];let k=Pu(v),w=[];for(let T=k;T<=v;T+=k){let C=T/v*g;if(m){let N=c+y-C;w.push(o("line",{key:`grid-${T}`,x1:String(c),y1:String(N),x2:String(c+b),y2:String(N),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`grid-label-${T}`,x:String(c-8),y:String(N+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(T)))}else{let N=c+C;w.push(o("line",{key:`grid-${T}`,x1:String(N),y1:String(c),x2:String(N),y2:String(c+y),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`grid-label-${T}`,x:String(N),y:String(c+y+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(T)))}}return w},[u,v,m,c,b,y,g]),M=S(()=>{let k=[];return m?k.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+y),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+y),stroke:"#374151","stroke-width":"1.5"})),k.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+y),x2:String(c+b),y2:String(c+y),stroke:"#374151","stroke-width":"1.5"})),k},[m,c,b,y]),$=S(()=>{if(t.length===0)return[];let k=[];for(let w=0;w<t.length;w++){let T=t[w],C=T.value/v*g,N=R*w+R/2,F=T.color??d;if(m){let W=c+N,H=c+y,_=c+y-C;k.push(o("line",{key:`stem-${w}`,x1:String(W),y1:String(H),x2:String(W),y2:String(_),stroke:s,"stroke-width":String(a)})),k.push(o("circle",{key:`dot-${w}`,cx:String(W),cy:String(_),r:String(l),fill:F})),h&&k.push(o("text",{key:`val-${w}`,x:String(W),y:String(_-l-4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(T.value)));let V=W,K=c+y+16;k.push(o("text",{key:`cat-${w}`,x:String(V),y:String(K),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${V}, ${K})`},T.label))}else{let W=c+N,H=c,_=c+C;k.push(o("line",{key:`stem-${w}`,x1:String(H),y1:String(W),x2:String(_),y2:String(W),stroke:s,"stroke-width":String(a)})),k.push(o("circle",{key:`dot-${w}`,cx:String(_),cy:String(W),r:String(l),fill:F})),h&&k.push(o("text",{key:`val-${w}`,x:String(_+l+4),y:String(W+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(T.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"},T.label))}}return k},[t,v,R,d,l,s,a,h,m,c,b,y,g]),A=S(()=>p?[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"},p)]:[],[p,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=D(),L=M(),E=$(),B=A(),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":p??"Lollipop chart",style:{fontFamily:"sans-serif"}},...B,...P,...L,...E,...z)}function Co(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 Tu(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 Du(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=Co(t[i]),l=Co(t[i+1]);return Tu(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}function $u(e){let{r:t,g:n,b:r}=Co(e);return(.299*t+.587*n+.114*r)/255}var zu=["#f0f9ff","#3b82f6","#1e3a8a"];function Vs(e){let{data:t=[],labels:n,rowLabels:r,columnLabels:i,width:s=500,height:a=500,colorScale:l=zu,showValues:d=!0,showDiagonal:u=!0,cellBorderColor:h="#e5e7eb",title:p,padding:c=70,symmetric:m=!1}=e,f=r??n,b=i??n,y=t.length,g=q(()=>{let F=0;for(let W of t)W.length>F&&(F=W.length);return F},[t]),x=q(()=>{if(!m||y===0)return t;let F=[],W=Math.max(y,g);for(let H=0;H<W;H++){let _=[];for(let V=0;V<W;V++){let K=t[H],Q=K&&V<K.length?K[V]:0,G=t[V],O=G&&H<G.length?G[H]:0;Q!==0?_.push(Q):_.push(O)}F.push(_)}return F},[t,m,y,g]),v=x.length,R=q(()=>{let F=0;for(let W of x)W.length>F&&(F=W.length);return F},[x]),{minVal:D,maxVal:M}=q(()=>{let F=1/0,W=-1/0;for(let H of x)for(let _ of H)_<F&&(F=_),_>W&&(W=_);return F===1/0&&(F=0),W===-1/0&&(W=1),F===W&&(W=F+1),{minVal:F,maxVal:W}},[x]),$=p?30:0,A=f?c:20,I=b?c:20,P=s-A-20,L=a-$-I-20,E=R>0?P/R:0,B=v>0?L/v:0,z=S(()=>{let F=[];for(let W=0;W<v;W++){let H=x[W];for(let _=0;_<R;_++){let V=_<H.length?H[_]:0,K=(V-D)/(M-D),Q=Du(K,l),G=A+_*E,O=$+20+W*B,Y=W===_,X=Y&&u?"currentColor":h,U=Y&&u?"2":"1";if(F.push(o("rect",{key:`cell-${W}-${_}`,x:String(G),y:String(O),width:String(E),height:String(B),fill:Q,stroke:X,"stroke-width":U})),d){let Z=$u(Q)>.5?"#111827":"#ffffff",ee=Math.min(12,E*.3,B*.35);F.push(o("text",{key:`val-${W}-${_}`,x:String(G+E/2),y:String(O+B/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.max(8,ee)),"font-weight":Y&&u?"bold":"normal","font-family":"sans-serif",fill:Z},String(Math.round(V*100)/100)))}}}return F},[x,v,R,D,M,l,E,B,A,$,d,u,h]),k=S(()=>{let F=[];if(f)for(let W=0;W<v;W++){let H=W<f.length?f[W]:"",_=$+20+W*B+B/2;F.push(o("text",{key:`row-label-${W}`,x:String(A-8),y:String(_),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},H))}if(b)for(let W=0;W<R;W++){let H=W<b.length?b[W]:"",_=A+W*E+E/2,V=$+20+v*B+12;F.push(o("text",{key:`col-label-${W}`,x:String(_),y:String(V),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},H))}return F},[f,b,v,R,E,B,A,$]),w=S(()=>p?[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"},p)]:[],[p,s]);if(v===0||R===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":p??"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 T=w(),C=z(),N=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":p??"Matrix visualization",style:{fontFamily:"sans-serif"}},...T,...C,...N)}var Au=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function En(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 Lu(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 Bu(e,t,n,r,i,s,a){let l=[];if(En(e)<=0)return l;let h=Lu(e)+1,p=s==="horizontal",c=p?i/h:r/h,m=[];for(m.push({node:e,depth:0,spanStart:p?t:n,spanEnd:p?t+r:n+i,colorIndex:0});m.length>0;){let f=m.shift(),{node:b,depth:y,spanStart:g,spanEnd:x,colorIndex:v}=f,R=En(b);if(R<=0)continue;let D=x-g,M,$,A,I;if(p?(M=g,$=n+y*c,A=D,I=c):(M=t+y*c,$=g,A=c,I=D),l.push({x:M,y:$,w:A,h:I,label:b.label,value:R,color:b.color??a[v%a.length],depth:y}),b.children&&b.children.length>0){let P=g;for(let L=0;L<b.children.length;L++){let E=b.children[L],B=En(E);if(B<=0)continue;let z=B/R*D;m.push({node:E,depth:y+1,spanStart:P,spanEnd:P+z,colorIndex:y===0?L:v}),P+=z}}}return l}function Us(e){let{data:t,width:n=600,height:r=400,orientation:i="horizontal",showLabels:s=!0,showValues:a=!0,colors:l=Au,borderColor:d="#ffffff",borderWidth:u=1,title:h,padding:p=10}=e,c=h?30:0,m=p,f=p+c,b=n-p*2,y=r-p*2-c;if(q(()=>En(t),[t])<=0||b<=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 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(()=>Bu(t,m,f,b,y,i,l),[t,m,f,b,y,i,l]),v=[];h&&v.push(o("text",{key:"title",x:String(n/2),y:String(p+16),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h));for(let R=0;R<x.length;R++){let D=x[R];if(v.push(o("rect",{key:`cell-${R}`,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:d,"stroke-width":String(u),role:"graphics-symbol","aria-label":`${D.label}: ${D.value}`})),s&&D.w>20&&D.h>14){let M=Math.floor(D.w/7),$=D.label.length>M?D.label.substring(0,Math.max(1,M-2))+"..":D.label;v.push(o("text",{key:`label-${R}`,x:String(D.x+D.w/2),y:String(D.y+D.h/2+(a?-2:4)),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},$))}a&&D.w>30&&D.h>28&&v.push(o("text",{key:`value-${R}`,x:String(D.x+D.w/2),y:String(D.y+D.h/2+12),"text-anchor":"middle","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??"Partition diagram",style:{fontFamily:"sans-serif"}},...v)}function Mo(e,t){let n=[];for(let r of t)n.push(String(e[r]??""));return n.join(" | ")}function js(e,t){let n=new Set;for(let i of e)n.add(Mo(i,t));let r=Array.from(n);return r.sort(),r}function In(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 Rn(e){return Number.isInteger(e)?String(e):e.toFixed(2)}function Fu(e,t,n,r,i){let s=js(e,t),a=js(e,n),l=new Map;for(let m of e){let f=Mo(m,t),b=Mo(m,n),y=`${f}::${b}`;l.has(y)||l.set(y,[]);let g=l.get(y),x=0;for(let v of r){let R=m[v];if(typeof R=="number")x+=R;else if(typeof R=="string"){let D=parseFloat(R);isNaN(D)||(x+=D)}}g.push(x)}let d=new Map;for(let[m,f]of l)d.set(m,In(f,i));let u=new Map;for(let m of s){let f=[];for(let b of a){let y=d.get(`${m}::${b}`);y!==void 0&&f.push(y)}u.set(m,In(f,i==="count"?"sum":i))}let h=new Map;for(let m of a){let f=[];for(let b of s){let y=d.get(`${b}::${m}`);y!==void 0&&f.push(y)}h.set(m,In(f,i==="count"?"sum":i))}let p=[];for(let m of u.values())p.push(m);let c=In(p,i==="count"?"sum":i);return{rowKeys:s,colKeys:a,cells:d,rowTotals:u,colTotals:h,grandTotal:c}}function Gs(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:p=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(()=>Fu(t,n,r,i,s),[t,n,r,i,s]),{rowKeys:m,colKeys:f,cells:b,rowTotals:y,colTotals:g,grandTotal:x}=c,v=u?30:0,R=f.length+(d?1:0),D=m.length+(d?1:0),M=1+R,$=1+D,A=Math.max(40,(a-p*2)/M),I=Math.max(20,Math.min(36,(l-v-p*2)/$)),P=A*M,L=I*$,E=Math.max(0,(a-P)/2),B=v+Math.max(0,(l-v-L)/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(B),width:String(P),height:String(I),fill:h})),z.push(o("rect",{key:"header-col-bg",x:String(E),y:String(B+I),width:String(A),height:String(I*D),fill:h,opacity:"0.85"})),z.push(o("text",{key:"corner",x:String(E+A/2),y:String(B+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)*A,T=Math.floor(A/7),C=f[k],N=C.length>T?C.substring(0,Math.max(1,T-2))+"..":C;z.push(o("text",{key:`ch-${k}`,x:String(w+A/2),y:String(B+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},N))}d&&z.push(o("text",{key:"ch-total",x:String(E+(f.length+1)*A+A/2),y:String(B+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},"Total"));for(let k=0;k<m.length;k++){let w=m[k],T=B+(k+1)*I;k%2===0&&z.push(o("rect",{key:`row-bg-${k}`,x:String(E+A),y:String(T),width:String(A*R),height:String(I),fill:"#f9fafb"}));let C=Math.floor(A/7),N=w.length>C?w.substring(0,Math.max(1,C-2))+"..":w;z.push(o("text",{key:`rh-${k}`,x:String(E+A/2),y:String(T+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},N));for(let F=0;F<f.length;F++){let W=f[F],H=`${w}::${W}`,_=b.get(H),V=E+(F+1)*A;z.push(o("rect",{key:`border-${k}-${F}`,x:String(V),y:String(T),width:String(A),height:String(I),fill:"none",stroke:"#e5e7eb","stroke-width":"0.5"})),z.push(o("text",{key:`cell-${k}-${F}`,x:String(V+A/2),y:String(T+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},_!==void 0?Rn(_):"-"))}if(d){let F=E+(f.length+1)*A,W=y.get(w)??0;z.push(o("rect",{key:`rt-bg-${k}`,x:String(F),y:String(T),width:String(A),height:String(I),fill:"#eff6ff"})),z.push(o("text",{key:`rt-${k}`,x:String(F+A/2),y:String(T+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},Rn(W)))}}if(d){let k=B+(m.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+A/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 T=0;T<f.length;T++){let C=f[T],N=g.get(C)??0,F=E+(T+1)*A;z.push(o("text",{key:`ct-${T}`,x:String(F+A/2),y:String(k+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},Rn(N)))}let w=E+(f.length+1)*A;z.push(o("text",{key:"grand-total",x:String(w+A/2),y:String(k+I/2+4),"text-anchor":"middle","font-size":"12","font-family":"sans-serif","font-weight":"bold",fill:"#1e3a8a"},Rn(x)))}return z.push(o("rect",{key:"outer-border",x:String(E),y:String(B),width:String(P),height:String(L),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 Pn(e,t){return Math.PI*2*e/t-Math.PI/2}function Tn(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function Xs(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:p}=e,c=t.length,m=p?30:0,f=d&&n.length>0?30:0,b=60,y=Math.min((r-b*2)/2,(i-b*2-m-f)/2),g=r/2,x=b+m+y,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 T=0;for(let C of n){let N=C.values[k];N!==void 0&&N>T&&(T=N)}z.push(T>0?T:1)}return z},[t,n,c]),R=S(()=>{if(c<3)return[];let z=[];for(let k=1;k<=s;k++){let w=y*k/s,T=[];for(let C=0;C<c;C++){let N=Pn(C,c),F=Tn(g,x,w,N);T.push(`${F.x},${F.y}`)}z.push(o("polygon",{key:`ring-${k}`,points:T.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=Pn(k,c),T=Tn(g,x,y,w);z.push(o("line",{key:`spoke-${k}`,x1:String(g),y1:String(x),x2:String(T.x),y2:String(T.y),stroke:h,"stroke-width":"0.75"}))}return z},[c,s,y,g,x,h]),D=S(()=>{if(!a||c<3)return[];let z=[],k=16;for(let w=0;w<c;w++){let T=Pn(w,c),C=Tn(g,x,y+k,T),N="middle";C.x<g-5?N="end":C.x>g+5&&(N="start");let F=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":N,dy:F,"font-size":"12","font-family":"sans-serif",fill:"currentColor"},t[w]?.label??`Axis ${w}`))}return z},[a,c,t,y,g,x]),M=S(()=>{if(c<3||n.length===0)return[];let z=[];for(let k=0;k<n.length;k++){let w=n[k],T=[],C=[],N=[];for(let F=0;F<c;F++){let W=w.values[F]??0,H=v[F],_=Math.min(W/H,1),V=y*_,K=Pn(F,c),Q=Tn(g,x,V,K);T.push(`${Q.x},${Q.y}`),u&&C.push(o("circle",{key:`dot-${k}-${F}`,cx:String(Q.x),cy:String(Q.y),r:"3.5",fill:w.color,stroke:"#fff","stroke-width":"1.5"})),l&&N.push(o("text",{key:`val-${k}-${F}`,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:T.join(" "),fill:w.color,"fill-opacity":String(w.fillOpacity??.15),stroke:"none"})),z.push(o("polygon",{key:`series-line-${k}`,points:T.join(" "),fill:"none",stroke:w.color,"stroke-width":"2","stroke-linejoin":"round"}));for(let F of C)z.push(F);for(let F of N)z.push(F)}return z},[c,n,v,y,g,x,u,l]),$=S(()=>{if(!d||n.length===0)return[];let z=[],k=x+y+40,w=100,T=n.length*w,C=g-T/2;for(let N=0;N<n.length;N++){let F=n[N],W=C+N*w;z.push(o("rect",{key:`legend-swatch-${N}`,x:String(W),y:String(k),width:"12",height:"12",rx:"2",fill:F.color})),z.push(o("text",{key:`legend-text-${N}`,x:String(W+16),y:String(k+10),"font-size":"12","font-family":"sans-serif",fill:"currentColor"},F.label))}return z},[d,n,g,x,y]),A=S(()=>p?[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"},p)]:[],[p,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":p??"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=R(),P=D(),L=M(),E=$(),B=A();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Radar chart",style:{fontFamily:"sans-serif"}},...B,...I,...P,...L,...E)}var Nu=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function _u(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 p=n.get(h),c=d+1;(p===void 0||c>p)&&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 Wu(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),p=e.map(P=>P.id),c=_u(p,h),m=new Map,f=new Map;for(let P of p)m.set(P,0),f.set(P,0);for(let P of h)f.set(P.source,(f.get(P.source)??0)+P.value),m.set(P.target,(m.get(P.target)??0)+P.value);let b=0;for(let P of c.values())P>b&&(b=P);let y=new Map;for(let P=0;P<=b;P++)y.set(P,[]);for(let[P,L]of c)y.get(L).push(P);let g=new Map,x=b>0?(d-i)/b:0;for(let P=0;P<=b;P++)g.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 R=[],D=new Map;for(let P=0;P<=b;P++){let L=y.get(P);if(L.length===0)continue;let E=0;for(let w of L){let T=m.get(w)??0,C=f.get(w)??0;E+=Math.max(T,C,1)}let B=u-s*(L.length-1),z=E>0?B/E:1,k=a;for(let w=0;w<L.length;w++){let T=L[w],C=v.get(T),N=m.get(T)??0,F=f.get(T)??0,W=Math.max(N,F,1),H=Math.max(4,W*z),_=e.findIndex(K=>K.id===T),V={id:T,label:C.label,color:C.color??l[_%l.length],column:P,x:g.get(P),y:k,height:H,totalIn:N,totalOut:F,totalValue:W};R.push(V),D.set(T,V),k+=H+s}}let M=new Map,$=new Map;for(let P of p)M.set(P,0),$.set(P,0);let A=[...h].sort((P,L)=>L.value-P.value),I=[];for(let P of A){let L=D.get(P.source),E=D.get(P.target);if(!L||!E)continue;let B=L.totalOut||1,z=E.totalIn||1,k=P.value/B*L.height,w=P.value/z*E.height,T=Math.max(1,(k+w)/2),C=M.get(P.source),N=$.get(P.target),F=L.y+C+k/2,W=E.y+N+w/2;M.set(P.source,C+k),$.set(P.target,N+w);let H=v.get(P.source);I.push({source:P.source,target:P.target,value:P.value,color:P.color??H?.color??L.color,sourceY:F,targetY:W,width:T})}return{layoutNodes:R,layoutLinks:I}}function Ks(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=Nu,title:p,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":p??"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 m=q(()=>Wu(t,n,r,i,s,a,c,h),[t,n,r,i,s,a,c,h]),f=S(()=>{let R=[];for(let D=0;D<m.layoutLinks.length;D++){let M=m.layoutLinks[D],$=m.layoutNodes.find(B=>B.id===M.source),A=m.layoutNodes.find(B=>B.id===M.target);if(!$||!A)continue;let I=$.x+s,P=A.x,L=(I+P)/2,E=`M ${I} ${M.sourceY} C ${L} ${M.sourceY}, ${L} ${M.targetY}, ${P} ${M.targetY}`;R.push(o("path",{key:`link-${D}`,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&&R.push(o("text",{key:`link-val-${D}`,x:String(L),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 R},[m,s,u,d]),b=S(()=>{let R=[];for(let D=0;D<m.layoutNodes.length;D++){let M=m.layoutNodes[D];if(R.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 $=m.layoutNodes.reduce((z,k)=>Math.max(z,k.column),0),A=M.column===$,I=A?M.x+s+6:M.x-6,P=A?"start":"end",L=M.column===0,E=L?M.x-6:I,B=L?"end":P;R.push(o("text",{key:`label-${M.id}`,x:String(E),y:String(M.y+M.height/2+4),"text-anchor":B,"font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},M.label))}}return R},[m,s,l]),y=S(()=>p?[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"},p)]:[],[p,r,c]),g=f(),x=b(),v=y();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Sankey diagram",style:{fontFamily:"sans-serif"}},...v,...g,...x)}var Ou=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],Eo=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 Hu(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 Yu(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),p=t+r*Math.sin(d),c=e+r*Math.cos(u),m=t+r*Math.sin(u),f=e+n*Math.cos(u),b=t+n*Math.sin(u),y=e+n*Math.cos(d),g=t+n*Math.sin(d);if(a>=Eo-.001){let x=d+Math.PI,v=e+r*Math.cos(x),R=t+r*Math.sin(x),D=e+n*Math.cos(x),M=t+n*Math.sin(x);return[`M ${h} ${p}`,`A ${r} ${r} 0 1 1 ${v} ${R}`,`A ${r} ${r} 0 1 1 ${h} ${p}`,`L ${y} ${g}`,`A ${n} ${n} 0 1 0 ${D} ${M}`,`A ${n} ${n} 0 1 0 ${y} ${g}`,"Z"].join(" ")}return[`M ${h} ${p}`,`A ${r} ${r} 0 ${l} 1 ${c} ${m}`,`L ${f} ${b}`,`A ${n} ${n} 0 ${l} 0 ${y} ${g}`,"Z"].join(" ")}function Vu(e,t,n,r){let i=[],s=Ot(e);if(s<=0)return i;let a=Hu(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 p=e.children[h],c=Ot(p);if(c<=0)continue;let m=c/s*Eo;d.push({node:p,startAngle:u,endAngle:u+m,depth:0,colorIndex:h}),u+=m}}else return i.push({startAngle:0,endAngle:Eo,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:p,endAngle:c,depth:m,colorIndex:f}=u,b=Ot(h);if(b<=0)continue;let y=t+m*l,g=y+l;if(i.push({startAngle:p,endAngle:c,innerR:y,outerR:g,label:h.label,value:b,color:h.color??r[f%r.length],depth:m}),h.children&&h.children.length>0){let x=p,v=c-p;for(let R=0;R<h.children.length;R++){let D=h.children[R],M=Ot(D);if(M<=0)continue;let $=M/b*v;d.push({node:D,startAngle:x,endAngle:x+$,depth:m+1,colorIndex:f}),x+=$}}}return i}function qs(e){let{data:t,width:n=500,height:r=500,innerRadius:i=40,showLabels:s=!0,colors:a=Ou,strokeColor:l="#ffffff",strokeWidth:d=1,title:u}=e,h=n/2,p=r/2,c=u?20:0,m=Math.min(h,p-c)-10;if(q(()=>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(p),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let b=q(()=>Vu(t,i,m,a),[t,i,m,a]),y=[];u&&y.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=p+c/2;for(let x=0;x<b.length;x++){let v=b[x],R=Yu(h,g,v.innerR,v.outerR,v.startAngle,v.endAngle);if(y.push(o("path",{key:`arc-${x}`,d:R,fill:v.color,stroke:l,"stroke-width":String(d),role:"graphics-symbol","aria-label":`${v.label}: ${v.value}`})),s){let D=v.endAngle-v.startAngle,M=v.startAngle+D/2-Math.PI/2,$=(v.innerR+v.outerR)/2,A=v.outerR-v.innerR,I=D*$;if(I>20&&A>14){let P=h+$*Math.cos(M),L=g+$*Math.sin(M),E=Math.floor(Math.min(I,A)/7),B=v.label.length>E?v.label.substring(0,Math.max(1,E-1))+"..":v.label;y.push(o("text",{key:`label-${x}`,x:String(P),y:String(L+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},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":u??"Sunburst chart",style:{fontFamily:"sans-serif"}},...y)}var Uu=["#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 Zs(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 ju(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,p=[];for(let c=0;c<u.length;c++){let m=u[c],f=Dn(m);f<=0||p.push({label:m.label,value:f,area:f/d*h,color:m.color??s[c%s.length],node:m})}for(p.sort((c,m)=>m.area-c.area),l.push({nodes:p,rect:{x:t,y:n,w:r,h:i},depth:0});l.length>0;){let c=l.shift(),{nodes:m,rect:f,depth:b}=c;if(m.length===0)continue;let y={...f},g=0;for(;g<m.length&&y.w>0&&y.h>0;){let x=y.w>=y.h,v=x?y.h:y.w,R=[],D=[];R.push(m[g]),D.push(m[g].area),g++;let M=Zs(D,v);for(;g<m.length;){let P=[...D,m[g].area],L=Zs(P,v);if(L>M)break;R.push(m[g]),D.push(m[g].area),M=L,g++}let $=0;for(let P of D)$+=P;let A=v>0?$/v:0,I=0;for(let P=0;P<R.length;P++){let L=R[P],E=A>0?L.area/A:0,B,z,k,w;if(x?(B=y.x,z=y.y+I,k=A,w=E):(B=y.x+I,z=y.y,k=E,w=A),a.push({x:B,y:z,w:k,h:w,label:L.label,value:L.value,color:L.color,depth:b}),L.node.children&&L.node.children.length>0){let C=B+2,N=z+2+14,F=k-4,W=w-4-14;if(F>4&&W>4){let H=[],_=L.value,V=F*W;for(let K=0;K<L.node.children.length;K++){let Q=L.node.children[K],G=Dn(Q);G<=0||H.push({label:Q.label,value:G,area:G/_*V,color:Q.color??s[(K+b+1)%s.length],node:Q})}H.sort((K,Q)=>Q.area-K.area),l.push({nodes:H,rect:{x:C,y:N,w:F,h:W},depth:b+1})}}I+=E}x?y={x:y.x+A,y:y.y,w:y.w-A,h:y.h}:y={x:y.x,y:y.y+A,w:y.w,h:y.h-A}}}return a}function Js(e){let{data:t,width:n=600,height:r=400,showLabels:i=!0,showValues:s=!0,colors:a=Uu,borderColor:l="#ffffff",borderWidth:d=2,padding:u=2,title:h}=e,p=h?30:0,c=u,m=u+p,f=n-u*2,b=r-u*2-p;if(q(()=>Dn(t),[t])<=0||f<=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 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=q(()=>ju(t,c,m,f,b,a),[t,c,m,f,b,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<g.length;v++){let R=g[v];if(x.push(o("rect",{key:`cell-${v}`,x:String(R.x),y:String(R.y),width:String(Math.max(0,R.w)),height:String(Math.max(0,R.h)),fill:R.color,stroke:l,"stroke-width":String(d),role:"graphics-symbol","aria-label":`${R.label}: ${R.value}`})),i&&R.w>20&&R.h>14){let D=Math.floor(R.w/7),M=R.label.length>D?R.label.substring(0,Math.max(1,D-2))+"..":R.label;x.push(o("text",{key:`label-${v}`,x:String(R.x+4),y:String(R.y+12),"font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},M))}s&&R.w>30&&R.h>28&&x.push(o("text",{key:`value-${v}`,x:String(R.x+4),y:String(R.y+24),"font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(R.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 Qs(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 Gu(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 ea(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=Qs(t[s]),u=Qs(t[a]);return Gu(d.r+(u.r-d.r)*l,d.g+(u.g-d.g)*l,d.b+(u.b-d.b)*l)}function $n(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 Xu(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)),p=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*p,y:a+x*c});let y=n(f,{gridSize:h,xMin:i,xMax:s,yMin:a,yMax:l}),g=[];for(let x=0;x<f.length;x++){let v=f[x],R=y[x]??{dx:0,dy:0},D=Math.sqrt(R.dx*R.dx+R.dy*R.dy);g.push({x:v.x,y:v.y,dx:R.dx,dy:R.dy,magnitude:D})}return g}if(!t)return[];let m=[];for(let f=0;f<h;f++)for(let b=0;b<h;b++){let y=i+b*p,g=a+f*c,x=t(y,g),v=Math.sqrt(x.dx*x.dx+x.dy*x.dy);m.push({x:y,y:g,dx:x.dx,dy:x.dy,magnitude:v})}return m}function Ku(e,t,n,r,i){let{padding:s,chartWidth:a,chartHeight:l,xMin:d,xMax:u,yMin:h,yMax:p,xSpan:c,ySpan:m,showGrid:f,showAxes:b,colorByMagnitude:y,colorScale:g,arrowColor:x,arrowWidth:v,effectiveArrowScale:R,maxMagnitude:D,title:M,tickFontSize:$}=i,A=L=>s+(L-d)/c*a,I=L=>s+(p-L)/m*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=`${$}px sans-serif`,e.fillStyle="#6b7280";let L=$n(c,10),E=Math.ceil(d/L)*L;for(let k=E;k<=u;k+=L){let w=A(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 B=$n(m,10),z=Math.ceil(h/B)*B;for(let k=z;k<=p;k+=B){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(b){if(e.save(),e.strokeStyle="#374151",e.lineWidth=v,h<=0&&p>=0){let L=I(0);e.beginPath(),e.moveTo(s,L),e.lineTo(s+a,L),e.stroke()}if(d<=0&&u>=0){let L=A(0);e.beginPath(),e.moveTo(L,s),e.lineTo(L,s+l),e.stroke()}e.strokeStyle="#d1d5db",e.lineWidth=1,e.strokeRect(s,s,a,l),e.restore()}let P=4;for(let L=0;L<r.length;L++){let E=r[L],B=E.magnitude??Math.sqrt(E.dx*E.dx+E.dy*E.dy);if(B<1e-10)continue;let z=A(E.x),k=I(E.y),w=E.dx*R,T=-E.dy*R,C=z+w,N=k+T,F;if(y){let H=B/D;F=ea(H,g)}else F=x;e.save(),e.strokeStyle=F,e.lineWidth=v,e.lineCap="round",e.beginPath(),e.moveTo(z,k),e.lineTo(C,N),e.stroke();let W=Math.sqrt(w*w+T*T);if(W>2){let H=w/W,_=T/W,V=-_,K=H,Q=Math.min(P,W*.4),G=C-H*Q+V*Q*.5,O=N-_*Q+K*Q*.5,Y=C-H*Q-V*Q*.5,X=N-_*Q-K*Q*.5;e.fillStyle=F,e.beginPath(),e.moveTo(C,N),e.lineTo(G,O),e.lineTo(Y,X),e.closePath(),e.fill()}e.restore()}}function ta(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:p=!0,colorByMagnitude:c=!1,colorScale:m=["#3b82f6","#8b5cf6","#ef4444"],title:f,padding:b=50,tickFontSize:y=10,arrowWidth:g=1.5,renderer:x="svg",useGPU:v=!1,computeWorker:R}=e,D=Math.max(2,Math.min(50,s)),M=r-b*2,$=i-b*2,A=a[0],I=a[1],P=l[0],L=l[1],E=I-A,B=L-P,z=q(()=>G=>b+(G-A)/E*M,[b,A,E,M]),k=q(()=>G=>b+(L-G)/B*$,[b,L,B,$]),w=q(()=>Xu(t,n,R,D,A,I,P,L,E,B),[t,n,R,D,A,I,P,L,E,B]),T=q(()=>{let G=0;for(let O=0;O<w.length;O++){let Y=w[O],X=Y.magnitude??Math.sqrt(Y.dx*Y.dx+Y.dy*Y.dy);X>G&&(G=X)}return G>0?G:1},[w]),C=q(()=>Math.min(M,$)/Math.max(D,2)/(2*T)*d,[M,$,D,T,d]);if(x==="canvas"){let G=te(null),O=te(0);return re(()=>{let Y=G.current;if(!Y)return;let X=Y.getContext("2d");if(X)return O.current&&cancelAnimationFrame(O.current),O.current=requestAnimationFrame(()=>{Ku(X,r,i,w,{padding:b,chartWidth:M,chartHeight:$,xMin:A,xMax:I,yMin:P,yMax:L,xSpan:E,ySpan:B,showGrid:h,showAxes:p,colorByMagnitude:c,colorScale:m,arrowColor:u,arrowWidth:g,effectiveArrowScale:C,maxMagnitude:T,title:f,tickFontSize:y})}),()=>{O.current&&cancelAnimationFrame(O.current)}},[w,r,i,b,M,$,A,I,P,L,E,B,h,p,c,m,u,g,C,T,f,y]),o("canvas",{ref:G,width:r,height:i,role:"img","aria-label":f??"Vector field plot",style:{fontFamily:"sans-serif",maxWidth:"100%"}})}let N=S(()=>{if(!h)return[];let G=[],O=$n(E,10),Y=Math.ceil(A/O)*O;for(let Z=Y;Z<=I;Z+=O){let ee=z(Z);G.push(o("line",{key:`gridv-${Z}`,x1:String(ee),y1:String(b),x2:String(ee),y2:String(b+$),stroke:"#e5e7eb","stroke-width":"0.5"})),G.push(o("text",{key:`xtick-${Z}`,x:String(ee),y:String(b+$+16),"text-anchor":"middle","font-size":String(y),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(Z*100)/100)))}let X=$n(B,10),U=Math.ceil(P/X)*X;for(let Z=U;Z<=L;Z+=X){let ee=k(Z);G.push(o("line",{key:`gridh-${Z}`,x1:String(b),y1:String(ee),x2:String(b+M),y2:String(ee),stroke:"#e5e7eb","stroke-width":"0.5"})),G.push(o("text",{key:`ytick-${Z}`,x:String(b-6),y:String(ee+4),"text-anchor":"end","font-size":String(y),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(Z*100)/100)))}return G},[h,A,I,P,L,E,B,z,k,b,M,$]),F=S(()=>{if(!p)return[];let G=[];if(P<=0&&L>=0){let O=k(0);G.push(o("line",{key:"axis-x",x1:String(b),y1:String(O),x2:String(b+M),y2:String(O),stroke:"#374151","stroke-width":String(g)}))}if(A<=0&&I>=0){let O=z(0);G.push(o("line",{key:"axis-y",x1:String(O),y1:String(b),x2:String(O),y2:String(b+$),stroke:"#374151","stroke-width":String(g)}))}return G.push(o("rect",{key:"chart-border",x:String(b),y:String(b),width:String(M),height:String($),fill:"none",stroke:"#d1d5db","stroke-width":"1"})),G},[p,A,I,P,L,z,k,b,M,$]),W=S(()=>{let G=[];for(let Y=0;Y<w.length;Y++){let X=w[Y],U=X.magnitude??Math.sqrt(X.dx*X.dx+X.dy*X.dy);if(U<1e-10)continue;let Z=z(X.x),ee=k(X.y),ae=X.dx*C,J=-X.dy*C,se=Z+ae,ce=ee+J,me;if(c){let ye=U/T;me=ea(ye,m)}else me=u;G.push(o("line",{key:`arrow-line-${Y}`,x1:String(Z),y1:String(ee),x2:String(se),y2:String(ce),stroke:me,"stroke-width":String(g),"stroke-linecap":"round"}));let ge=Math.sqrt(ae*ae+J*J);if(ge>2){let ye=ae/ge,le=J/ge,ne=-le,pe=ye,ie=Math.min(4,ge*.4),he=se-ye*ie+ne*ie*.5,xe=ce-le*ie+pe*ie*.5,Ce=se-ye*ie-ne*ie*.5,de=ce-le*ie-pe*ie*.5;G.push(o("polygon",{key:`arrow-head-${Y}`,points:`${se},${ce} ${he},${xe} ${Ce},${de}`,fill:me}))}}return G},[w,z,k,C,c,T,m,u]),H=S(()=>f?[o("text",{key:"title",x:String(r/2),y:String(b/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},f)]:[],[f,r,b]),_=N(),V=F(),K=W(),Q=H();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,..._,...V,...K)}function qu(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 Zu(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 na(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:p,padding:c=60}=e,m=n-c*2,f=r-c*2,b=q(()=>qu(t),[t]),{minVal:y,maxVal:g}=q(()=>{let T=0,C=0;for(let N=0;N<b.length;N++){let F=b[N];F.start<T&&(T=F.start),F.end<T&&(T=F.end),F.start>C&&(C=F.start),F.end>C&&(C=F.end)}return T===C&&(C=T+1),{minVal:T,maxVal:C}},[b]),x=g-y,v=S(T=>c+f-(T-y)/x*f,[c,f,y,x]),R=q(()=>b.length===0?0:m/b.length,[b.length,m]),D=6,M=Math.max(1,R-D),$=S(()=>{if(!u)return[];let T=Zu(x),C=[],N=Math.ceil(y/T)*T;for(let F=N;F<=g;F+=T){let W=v(F);C.push(o("line",{key:`grid-${F}`,x1:String(c),y1:String(W),x2:String(c+m),y2:String(W),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),C.push(o("text",{key:`grid-label-${F}`,x:String(c-8),y:String(W+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(F)))}return C},[u,x,y,g,v,c,m]),A=S(()=>{let T=[];T.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=y<=0&&g>=0?v(0):c+f;return T.push(o("line",{key:"axis-x",x1:String(c),y1:String(C),x2:String(c+m),y2:String(C),stroke:"#374151","stroke-width":"1.5"})),T},[c,m,f,y,g,v]),I=S(()=>{if(b.length===0)return[];let T=[];for(let C=0;C<b.length;C++){let N=b[C],F=c+C*R+D/2,W=Math.max(N.start,N.end),H=Math.min(N.start,N.end),_=v(W),V=v(H),K=Math.max(0,V-_),Q;if(N.type==="total"?Q=a:N.type==="decrease"?Q=s:Q=i,T.push(o("rect",{key:`bar-${C}`,x:String(F),y:String(_),width:String(M),height:String(K),fill:Q,rx:"2",ry:"2"})),d){let G=N.type==="decrease"||N.value<0?V+14:_-4,O=N.type==="total"?String(N.value):(N.value>=0?"+":"")+String(N.value);T.push(o("text",{key:`val-${C}`,x:String(F+M/2),y:String(G),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},O))}if(T.push(o("text",{key:`cat-${C}`,x:String(F+M/2),y:String(c+f+16),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},N.label)),h&&C<b.length-1){let G=b[C+1],O=v(N.end),Y=c+(C+1)*R+D/2;G.type!=="total"&&T.push(o("line",{key:`conn-${C}`,x1:String(F+M),y1:String(O),x2:String(Y),y2:String(O),stroke:l,"stroke-width":"1","stroke-dasharray":"3 2"}))}}return T},[b,R,M,v,i,s,a,l,d,h,c,f]),P=S(()=>p?[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"},p)]:[],[p,n,c]),L=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=$(),B=A(),z=I(),k=P(),w=L();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??"Waterfall chart",style:{fontFamily:"sans-serif"}},...k,...E,...B,...z,...w)}var Ju=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],Qu=[0,-45,45,90];function ep(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)),p=a*u+l*h,c=a*h+l*u;return{x:r-p/2,y:i-c/2,w:p,h:c}}function tp(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 np(e,t,n){return e.x>=0&&e.y>=0&&e.x+e.w<=t&&e.y+e.h<=n}function op(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 oa(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=Qu,padding:u=4,spiral:h="archimedean",title:p}=e,c=q(()=>{if(t.length===0)return[];let f=t.map((M,$)=>({...M,originalIndex:$})).filter(M=>M.text.length>0&&M.weight>0).sort((M,$)=>$.weight-M.weight);if(f.length===0)return[];let b=f[f.length-1].weight,g=f[0].weight-b;function x(M){if(g===0)return(i+s)/2;let $=(M-b)/g;return i+$*(s-i)}let v=[],R=n/2,D=r/2;for(let M=0;M<f.length;M++){let $=f[M],A=x($.weight),I=d[op($.text)%d.length],P=$.color??l[M%l.length],L=!1,E=500,B=h==="archimedean"?4:5;for(let z=0;z<E;z++){let k,w;if(h==="archimedean"){let H=z*.1,_=B*H;k=_*Math.cos(H),w=_*Math.sin(H)}else{let H=Math.floor(z/4)+1,_=z%4,V=(z%4===0?0:z)*B;switch(_){case 0:k=H*B*4,w=V;break;case 1:k=-V,w=H*B*4;break;case 2:k=-H*B*4,w=-V;break;default:k=V,w=-H*B*4;break}}let T=R+k,C=D+w,N=ep($.text,A,I,T,C),F={x:N.x-u,y:N.y-u,w:N.w+u*2,h:N.h+u*2};if(!np(F,n,r))continue;let W=!1;for(let H of v)if(tp(F,H.bbox)){W=!0;break}if(!W){v.push({text:$.text,x:T,y:C,fontSize:A,rotation:I,color:P,bbox:F}),L=!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":p??"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 m=[];p&&m.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"},p));for(let f=0;f<c.length;f++){let b=c[f],y=b.rotation!==0?`translate(${b.x},${b.y}) rotate(${b.rotation})`:`translate(${b.x},${b.y})`;m.push(o("text",{key:`word-${f}`,transform:y,"text-anchor":"middle","dominant-baseline":"central","font-size":String(b.fontSize),"font-family":a,fill:b.color,"aria-label":b.text},b.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":p??"Word cloud",style:{fontFamily:a}},...m)}var rp={0:"#1e293b",1:"#3b82f6"},ip="#666";function ra(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:p=10,onCellClick:c,onCellHover:m,title:f}=e,b=n??rp,y=t.length,g=q(()=>{let T=0;for(let C=0;C<t.length;C++){let N=t[C];N!==void 0&&N.length>T&&(T=N.length)}return T},[t]),x=u?20:0,v=f?24:0,R=q(()=>{let T=r-p*2-x,C=i-p*2-x-v;if(y===0||g===0)return{cellWidth:0,cellHeight:0};let N=Math.max(0,(T-s*(g-1))/g),F=Math.max(0,(C-s*(y-1))/y);return{cellWidth:N,cellHeight:F}},[r,i,p,y,g,s,x,v]),D=S(T=>{let C=b[T];return C!==void 0?C:ip},[b]),M=S(()=>o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:h}),[r,i,h]),$=S(()=>f?[o("text",{key:"title",x:String(r/2),y:String(p+14),"text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#e2e8f0"},f)]:[],[f,r,p]),A=S(()=>{if(!l||y===0||g===0)return[];let{cellWidth:T,cellHeight:C}=R,N=p+x,F=p+x+v,W=g*T+(g-1)*s,H=y*C+(y-1)*s,_=[];for(let V=0;V<=g;V++){let K=N+V*(T+s)-s/2;_.push(o("line",{key:`vgrid-${V}`,x1:String(K),y1:String(F-s/2),x2:String(K),y2:String(F+H+s/2),stroke:d,"stroke-width":"0.5"}))}for(let V=0;V<=y;V++){let K=F+V*(C+s)-s/2;_.push(o("line",{key:`hgrid-${V}`,x1:String(N-s/2),y1:String(K),x2:String(N+W+s/2),y2:String(K),stroke:d,"stroke-width":"0.5"}))}return _},[l,y,g,R,p,x,v,s,d]),I=S(()=>{if(!u||y===0||g===0)return[];let{cellWidth:T,cellHeight:C}=R,N=p+x,F=p+x+v,W=[];for(let H=0;H<g;H++){let _=N+H*(T+s)+T/2,V=F-6;W.push(o("text",{key:`col-idx-${H}`,x:String(_),y:String(V),"text-anchor":"middle","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(H)))}for(let H=0;H<y;H++){let _=N-6,V=F+H*(C+s)+C/2+3;W.push(o("text",{key:`row-idx-${H}`,x:String(_),y:String(V),"text-anchor":"end","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(H)))}return W},[u,y,g,R,p,x,v,s]),P=S(()=>{if(y===0||g===0)return[];let{cellWidth:T,cellHeight:C}=R,N=p+x,F=p+x+v,W=[];for(let H=0;H<y;H++){let _=t[H];if(_!==void 0)for(let V=0;V<g;V++){let K=V<_.length?_[V]:0,Q=N+V*(T+s),G=F+H*(C+s),O=D(K),Y={key:`cell-${H}-${V}`,x:String(Q),y:String(G),width:String(T),height:String(C),fill:O,rx:String(a),ry:String(a)};if(c){let X=H,U=V,Z=K;Y.onClick=()=>c(X,U,Z),Y.role="button",Y.tabIndex=0}if(m){let X=H,U=V,Z=K;Y.onMouseEnter=()=>m(X,U,Z)}W.push(o("rect",Y))}}return W},[y,g,t,R,p,x,v,s,a,D,c,m]),L=M(),E=$(),B=A(),z=I(),k=P(),w=f?`${f} \u2014 ${y}x${g} discrete grid`:`${y}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},L,...E,...B,...z,...k)}
|
|
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(Gl,{key:l.id,item:l,onDismiss:s}));return o("div",{style:i},...a)}function ti(e={}){let t=te(null);t.current||(t.current=_n(e));let n=t.current,r=S(()=>o(On,{toaster:n}),[n]);return{toast:n.toast,dismiss:n.dismiss,dismissAll:n.dismissAll,ToastContainer:r}}var Xl=6,Kl=8;function ql(e,t){let n=window.scrollX||window.pageXOffset,r=window.scrollY||window.pageYOffset,i=Kl;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 Zl(e){let t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n=`${Xl}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 ni(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=te(null),p=te(null),c=`tooltip-${Math.random().toString(36).slice(2,9)}`,m=S(()=>{p.current=setTimeout(()=>{if(h.current){let x=h.current.getBoundingClientRect();u(ql(x,n))}l(!0)},r)},[r,n]),f=S(()=>{p.current&&(clearTimeout(p.current),p.current=null),l(!1)},[]);re(()=>()=>{p.current&&clearTimeout(p.current)},[]);let b={display:"inline-block"},y={...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:b,onMouseEnter:m,onMouseLeave:f,onFocus:m,onBlur:f,"aria-describedby":a?c:void 0},s)];return a&&d&&g.push(o("div",{id:c,style:y,role:"tooltip"},t,o("div",{style:Zl(n)}))),o("div",{style:{display:"inline-block",position:"relative"}},...g)}function Hn(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 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 Ql(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 ec(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 oi=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function ri(e,t){return t||oi[e%oi.length]}function ii(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:p,padding:c=50,animate:m=!1,stacked:f,grouped:b=!1}=e,y=i==="vertical",g=n-c*2,x=r-c*2,v=y?x:g,R=y?g:x,D=f!==void 0&&f.length>0,M=q(()=>D?ec(f):[],[D,f]),$=D?f.length:t.length,A=q(()=>Jl(t,f,b),[t,f,b]),I=A>0?A:1,P=Hn($,I,v,R,a),L=S(()=>{if(!u)return[];let W=Ql(I),V=[];for(let K=W;K<=I;K+=W){let Q=P.valueScale(K);if(y){let G=c+x-Q;V.push(o("line",{key:`grid-${K}`,x1:String(c),y1:String(G),x2:String(c+g),y2:String(G),stroke:h,"stroke-width":"1","stroke-dasharray":"4 2"})),V.push(o("text",{key:`grid-label-${K}`,x:String(c-6),y:String(G+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(K)))}else{let G=c+Q;V.push(o("line",{key:`grid-${K}`,x1:String(G),y1:String(c),x2:String(G),y2:String(c+x),stroke:h,"stroke-width":"1","stroke-dasharray":"4 2"})),V.push(o("text",{key:`grid-label-${K}`,x:String(G),y:String(c+x+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(K)))}}return V},[u,I,P,y,c,g,x,h]),E=S(()=>{let W=[];return y?(W.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"})),W.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+x),x2:String(c+g),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"}))):(W.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+x),x2:String(c+g),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"})),W.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"}))),W},[y,c,g,x]),B=S(()=>{let W=[];for(let V=0;V<t.length;V++){let K=t[V],Q=P.valueScale(K.value),G=P.categoryScale(V),O=K.color??s,Y,X,U=String(K.value);if(y){let Z=c+G,ee=c+x-Q;Y={x:String(Z),y:String(ee),width:String(P.barThickness),height:String(Q),rx:String(l),ry:String(l),fill:O},X={x:String(Z+P.barThickness/2),y:String(ee-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"}}else{let Z=c+G,ee=c;Y={x:String(ee),y:String(Z),width:String(Q),height:String(P.barThickness),rx:String(l),ry:String(l),fill:O},X={x:String(ee+Q+6),y:String(Z+P.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"}}if(m&&(Y.style=y?`animation: barGrow 0.6s ease-out ${V*.05}s both`:`animation: barGrow 0.6s ease-out ${V*.05}s both`),W.push(o("rect",{key:`bar-${V}`,...Y})),d&&W.push(o("text",{key:`val-${V}`,...X},U)),y){let Z=c+G+P.barThickness/2,ee=c+x+16;W.push(o("text",{key:`cat-${V}`,x:String(Z),y:String(ee),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${Z}, ${ee})`},K.label))}else W.push(o("text",{key:`cat-${V}`,x:String(c-6),y:String(c+G+P.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},K.label))}return W},[t,P,s,l,d,m,y,c,x]),z=S(()=>{if(!f)return[];let W=[];for(let V=0;V<f.length;V++){let K=f[V],Q=P.categoryScale(V),G=0;for(let O=0;O<K.values.length;O++){let Y=K.values[O],X=P.valueScale(Y.value),U=P.valueScale(G),Z=ri(O,Y.color);if(y){let ee=c+Q,ae=c+x-U-X;W.push(o("rect",{key:`sbar-${V}-${O}`,x:String(ee),y:String(ae),width:String(P.barThickness),height:String(X),rx:O===K.values.length-1?String(l):"0",ry:O===K.values.length-1?String(l):"0",fill:Z,...m?{style:`animation: barGrow 0.6s ease-out ${(V*K.values.length+O)*.03}s both`}:{}})),d&&X>14&&W.push(o("text",{key:`sval-${V}-${O}`,x:String(ee+P.barThickness/2),y:String(ae+X/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(Y.value)))}else{let ee=c+U,ae=c+Q;W.push(o("rect",{key:`sbar-${V}-${O}`,x:String(ee),y:String(ae),width:String(X),height:String(P.barThickness),rx:O===K.values.length-1?String(l):"0",ry:O===K.values.length-1?String(l):"0",fill:Z,...m?{style:`animation: barGrow 0.6s ease-out ${(V*K.values.length+O)*.03}s both`}:{}})),d&&X>20&&W.push(o("text",{key:`sval-${V}-${O}`,x:String(ee+X/2),y:String(ae+P.barThickness/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(Y.value)))}G+=Y.value}if(d){let O=P.valueScale(G);y?W.push(o("text",{key:`stotal-${V}`,x:String(c+Q+P.barThickness/2),y:String(c+x-O-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(G))):W.push(o("text",{key:`stotal-${V}`,x:String(c+O+6),y:String(c+Q+P.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(G)))}if(y){let O=c+Q+P.barThickness/2,Y=c+x+16;W.push(o("text",{key:`scat-${V}`,x:String(O),y:String(Y),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${O}, ${Y})`},K.label))}else W.push(o("text",{key:`scat-${V}`,x:String(c-6),y:String(c+Q+P.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},K.label))}return W},[f,P,l,d,m,y,c,x]),k=S(()=>{if(!f)return[];let W=M.length,V=[];for(let K=0;K<f.length;K++){let Q=f[K],G=P.categoryScale(K),O=2,Y=Math.max(1,(P.barThickness-O*(W-1))/W);for(let X=0;X<Q.values.length;X++){let U=Q.values[X],Z=M.indexOf(U.category),ee=Z*(Y+O),ae=P.valueScale(U.value),J=ri(Z>=0?Z:X,U.color);if(y){let se=c+G+ee,ce=c+x-ae;V.push(o("rect",{key:`gbar-${K}-${X}`,x:String(se),y:String(ce),width:String(Y),height:String(ae),rx:String(l),ry:String(l),fill:J,...m?{style:`animation: barGrow 0.6s ease-out ${(K*W+X)*.04}s both`}:{}})),d&&V.push(o("text",{key:`gval-${K}-${X}`,x:String(se+Y/2),y:String(ce-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(U.value)))}else{let se=c,ce=c+G+ee;V.push(o("rect",{key:`gbar-${K}-${X}`,x:String(se),y:String(ce),width:String(ae),height:String(Y),rx:String(l),ry:String(l),fill:J,...m?{style:`animation: barGrow 0.6s ease-out ${(K*W+X)*.04}s both`}:{}})),d&&V.push(o("text",{key:`gval-${K}-${X}`,x:String(se+ae+4),y:String(ce+Y/2+3),"text-anchor":"start","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(U.value)))}}if(y){let X=c+G+P.barThickness/2,U=c+x+16;V.push(o("text",{key:`gcat-${K}`,x:String(X),y:String(U),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${X}, ${U})`},Q.label))}else V.push(o("text",{key:`gcat-${K}`,x:String(c-6),y:String(c+G+P.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},Q.label))}return V},[f,M,P,l,d,m,y,c,x]),w=S(()=>p?[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"},p)]:[],[p,n,c]),T=S(()=>m?[o("defs",{key:"anim-defs"},o("style",{key:"anim-style"},y?"@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; } }"))]:[],[m,y]),C=L(),N=E(),F=w(),_=T(),H;return D&&b?H=k():D?H=z():H=B(),o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",style:{fontFamily:"sans-serif"}},..._,...F,...C,...N,...H)}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],p=e(h);isFinite(p)&&a.push({input:h,output:p})}if(s=d,s>=t.length){r(a,!0);return}r(a,!1),si(l)};return si(l),()=>{i=!0}}function si(e){typeof requestIdleCallback=="function"?requestIdleCallback(()=>e(),{timeout:16}):setTimeout(e,0)}function tc(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 ai(e,t){let n=t-e;if(n<=0)return[e];let r=tc(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 li(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}var De=40,ci=1.1,di=.01,ui=1e6;function pi(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:p=!0,pointRadius:c=3,pointColor:m="#3b82f6",curveColor:f="#3b82f6",gridColor:b="#e2e8f0",axisColor:y="#94a3b8",onPointClick:g,onPointDoubleClick:x,onPointContextMenu:v,onPointHover:R}=e,[D,M]=j(d[0]),[$,A]=j(d[1]),[I,P]=j(u[0]),[L,E]=j(u[1]),B=te(!1),z=te(null),k=S(U=>De+(U-D)/($-D)*(t-2*De),[D,$,t]),w=S(U=>n-De-(U-I)/(L-I)*(n-2*De),[I,L,n]),T=S(U=>D+(U-De)/(t-2*De)*($-D),[D,$,t]),C=S(U=>I+(n-De-U)/(n-2*De)*(L-I),[I,L,n]),N=S(U=>{let Z=U;B.current=!0,z.current={mx:Z.clientX,my:Z.clientY,x0:D,x1:$,y0:I,y1:L}},[D,$,I,L]),F=S(U=>{if(!B.current||!z.current)return;let Z=U,ee=z.current,ae=Z.clientX-ee.mx,J=Z.clientY-ee.my,se=ae/(t-2*De)*(ee.x1-ee.x0),ce=J/(n-2*De)*(ee.y1-ee.y0);M(ee.x0-se),A(ee.x1-se),P(ee.y0+ce),E(ee.y1+ce)},[t,n]),_=S(()=>{B.current=!1,z.current=null},[]),H=S(U=>{let Z=U;Z.preventDefault();let ee=Z.currentTarget.getBoundingClientRect(),ae=Z.clientX-ee.left,J=Z.clientY-ee.top,se=T(ae),ce=C(J),me=Z.deltaY>0?ci:1/ci,ge=($-D)*me,ye=(L-I)*me;if(ge<di||ye<di||ge>ui||ye>ui)return;let le=(se-D)/($-D),ne=(ce-I)/(L-I);M(se-le*ge),A(se+(1-le)*ge),P(ce-ne*ye),E(ce+(1-ne)*ye)},[D,$,I,L,T,C]),W=[];if(W.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),h){let U=ai(D,$),Z=ai(I,L);for(let ee=0;ee<U.length;ee++){let ae=k(U[ee]);W.push(o("line",{x1:ae,y1:De,x2:ae,y2:n-De,stroke:b,"stroke-width":.5,key:`gx-${ee}`})),W.push(o("text",{x:ae,y:n-De+14,"text-anchor":"end","font-size":10,fill:y,transform:`rotate(-45, ${ae}, ${n-De+14})`,key:`lx-${ee}`},li(U[ee])))}for(let ee=0;ee<Z.length;ee++){let ae=w(Z[ee]);W.push(o("line",{x1:De,y1:ae,x2:t-De,y2:ae,stroke:b,"stroke-width":.5,key:`gy-${ee}`})),W.push(o("text",{x:De-6,y:ae+3,"text-anchor":"end","font-size":10,fill:y,key:`ly-${ee}`},li(Z[ee])))}}if(p){let U=Math.max(De,Math.min(t-De,k(0))),Z=Math.max(De,Math.min(n-De,w(0)));W.push(o("line",{x1:De,y1:Z,x2:t-De,y2:Z,stroke:y,"stroke-width":1,key:"x-axis"})),W.push(o("line",{x1:U,y1:De,x2:U,y2:n-De,stroke:y,"stroke-width":1,key:"y-axis"}))}let V=q(()=>{if(!i||!l)return[];let U=a??($-D)/s,Z=yt({start:D,end:$,step:U});return qt(i,Z)},[i,D,$,a,s,l]),[K,Q]=j([]),G=te(null);re(()=>{if(!i||l){Q([]);return}let U=a??($-D)/s,Z=yt({start:D,end:$,step:U});return G.current&&G.current(),G.current=Zt(i,Z,200,ee=>{Q([...ee])}),()=>{G.current&&G.current()}},[i,D,$,a,s,l]);let O=l?V:K;if(O.length>0){let U=[];for(let Z=0;Z<O.length;Z++){let ee=O[Z],ae=k(ee.input),J=w(ee.output);U.push(`${U.length===0?"M":"L"}${ae},${J}`)}W.push(o("path",{d:U.join(" "),fill:"none",stroke:f,"stroke-width":1.5,key:"curve"}))}let Y=(U,Z,ee,ae)=>{if(Z)return J=>Z({x:ae.x,y:ae.y,index:ee,event:J})};for(let U=0;U<r.length;U++){let Z=r[U],ee=k(Z.x),ae=w(Z.y),J={cx:ee,cy:ae,r:c,fill:m,cursor:"pointer",key:`pt-${U}`};g&&(J.onClick=Y("click",g,U,Z)),x&&(J.onDblClick=Y("dblclick",x,U,Z)),v&&(J.onContextMenu=Y("contextmenu",v,U,Z)),R&&(J.onMouseOver=Y("mouseover",R,U,Z)),W.push(o("circle",J))}let X=o("defs",{key:"defs"},o("clipPath",{id:"plot-clip"},o("rect",{x:De,y:De,width:t-2*De,height:n-2*De})));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:N,onMouseMove:F,onMouseUp:_,onMouseLeave:_,onWheel:H},X,...W)}function mi(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 fi(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,p=0,c=0;return i<60?(h=l,p=d):i<120?(h=d,p=l):i<180?(p=l,c=d):i<240?(p=d,c=l):i<300?(h=d,c=l):(h=l,c=d),[Math.floor((h+u)*255),Math.floor((p+u)*255),Math.floor((c+u)*255)]}function gi(e,t,n=[-2.5,1],r=[-1.25,1.25],i=80,s=mi){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 p=n[0]+h/e*(n[1]-n[0]);d.push(s(p,u,i))}a.push(d)}return a}function hi(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=mi,data:d,resolution:u=2,onPointClick:h,onPointHover:p,onPointDoubleClick:c,onPointContextMenu:m}=e;if(d){let C=d.length,N=C>0?d[0].length:0,F=N>0?t/N:1,_=C>0?n/C:1,H=[];for(let W=0;W<C;W++){let V=d[W];for(let K=0;K<N;K++){let Q=V[K]??0,[G,O,Y]=fi(Q,s,a);H.push(o("rect",{key:`${W}-${K}`,x:String(K*F),y:String(W*_),width:String(Math.ceil(F)),height:String(Math.ceil(_)),fill:`rgb(${G},${O},${Y})`}))}}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%"}},...H)}let[f,b]=j(r[0]),[y,g]=j(r[1]),[x,v]=j(i[0]),[R,D]=j(i[1]),M=te(null),$=te(!1),A=te(null),I=S((C,N)=>{let F=f+C/t*(y-f),_=R-N/n*(R-x);return{re:F,im:_}},[f,y,x,R,t,n]);re(()=>{let C=M.current;if(!C)return;let N=C.getContext("2d");if(!N)return;let F=N.createImageData(t,n),_=F.data;for(let H=0;H<n;H++)for(let W=0;W<t;W++){let{re:V,im:K}=I(W,H),Q=l(V,K,s),[G,O,Y]=fi(Q,s,a),X=(H*t+W)*4;_[X]=G,_[X+1]=O,_[X+2]=Y,_[X+3]=255}N.putImageData(F,0,0)},[f,y,x,R,t,n,s,a,l,I]);let P=S(C=>{let N=C.target.getBoundingClientRect(),F=C.clientX-N.left,_=C.clientY-N.top,{re:H,im:W}=I(F,_),V=l(H,W,s);return{re:H,im:W,iterations:V,event:C}},[I,l,s]),L=S(C=>{$.current=!0,A.current={x:C.clientX,y:C.clientY,rMin:f,rMax:y,iMin:x,iMax:R}},[f,y,x,R]),E=S(C=>{if(p&&p(P(C)),!$.current||!A.current)return;let N=A.current,F=C.clientX-N.x,_=C.clientY-N.y,H=(N.rMax-N.rMin)/t,W=(N.iMax-N.iMin)/n;b(N.rMin-F*H),g(N.rMax-F*H),v(N.iMin+_*W),D(N.iMax+_*W)},[t,n,p,P]),B=S(()=>{$.current=!1},[]),z=S(C=>{C.preventDefault();let N=C.deltaY>0?1.15:1/1.15,F=C.target.getBoundingClientRect(),_=C.clientX-F.left,H=C.clientY-F.top,{re:W,im:V}=I(_,H);b(W+(f-W)*N),g(W+(y-W)*N),v(V+(x-V)*N),D(V+(R-V)*N)},[I,f,y,x,R]),k=S(C=>{h&&h(P(C))},[h,P]),w=S(C=>{c&&c(P(C))},[c,P]),T=S(C=>{C.preventDefault(),m&&m(P(C))},[m,P]);return o("canvas",{ref:M,width:t,height:n,style:{cursor:"crosshair"},onMouseDown:L,onMouseMove:E,onMouseUp:B,onMouseLeave:B,onWheel:z,onClick:k,onDblClick:w,onContextMenu:T})}function bi(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 nc(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 b of e)b.x<i&&(i=b.x),b.x>s&&(s=b.x),b.y<a&&(a=b.y),b.y>l&&(l=b.y);i===s&&(i-=1,s+=1),a===l&&(a-=1,l+=1);let d=t-r*2,u=n-r*2,h=b=>r+(b-i)/(s-i)*d,p=b=>n-r-(b-a)/(l-a)*u,c=6,m=bi(i,s,c),f=bi(a,l,c);return{xScale:h,yScale:p,xTicks:m,yTicks:f,xMin:i,xMax:s,yMin:a,yMax:l}}function Yn(e,t,n,r){return q(()=>nc(e,t,n,r),[e,t,n,r])}function xi(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function yi(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 Si(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:p=!1,areaColor:c="rgba(59,130,246,0.15)",xLabel:m,yLabel:f,title:b,padding:y=50,animate:g=!1,multiLine:x}=e,v=q(()=>{let L=[...t];if(x)for(let E of x)L.push(...E.data);return L},[t,x]),R=Yn(v,n,r,y),{xScale:D,yScale:M,xTicks:$,yTicks:A}=R,I=[];if(I.push(o("rect",{x:0,y:0,width:"100%",fill:"white",key:"bg"})),h){for(let L=0;L<$.length;L++){let E=D($[L]);I.push(o("line",{x1:E,y1:y,x2:E,y2:r-y,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-x-${L}`}))}for(let L=0;L<A.length;L++){let E=M(A[L]);I.push(o("line",{x1:y,y1:E,x2:n-y,y2:E,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-y-${L}`}))}}I.push(o("line",{x1:y,y1:r-y,x2:n-y,y2:r-y,stroke:"#374151","stroke-width":1,key:"x-axis"})),I.push(o("line",{x1:y,y1:y,x2:y,y2:r-y,stroke:"#374151","stroke-width":1,key:"y-axis"}));for(let L=0;L<$.length;L++){let E=D($[L]);I.push(o("line",{x1:E,y1:r-y,x2:E,y2:r-y+5,stroke:"#374151",key:`xtick-${L}`})),I.push(o("text",{x:E,y:r-y+18,"text-anchor":"end","font-size":11,fill:"#6b7280",transform:`rotate(-45, ${E}, ${r-y+18})`,key:`xlabel-${L}`},xi($[L])))}for(let L=0;L<A.length;L++){let E=M(A[L]);I.push(o("line",{x1:y-5,y1:E,x2:y,y2:E,stroke:"#374151",key:`ytick-${L}`})),I.push(o("text",{x:y-10,y:E+4,"text-anchor":"end","font-size":11,fill:"#6b7280",key:`ylabel-${L}`},xi(A[L])))}function P(L,E,B,z,k,w,T,C,N,F){if(L.length===0)return;let _=[...L].sort((V,K)=>V.x-K.x);if(z){let V=M(R.yMin),K=_.map(Y=>`${D(Y.x)},${M(Y.y)}`).join(" "),Q=D(_[0].x),G=D(_[_.length-1].x),O=`${Q},${V} ${K} ${G},${V}`;I.push(o("polygon",{points:O,fill:k,key:`${F}-area`}))}let W={points:_.map(V=>`${D(V.x)},${M(V.y)}`).join(" "),fill:"none",stroke:E,"stroke-width":B,"stroke-linejoin":"round","stroke-linecap":"round",key:`${F}-line`};if(g?(W["stroke-dasharray"]="1000",W["stroke-dashoffset"]="1000",I.push(o("polyline",W,o("animate",{attributeName:"stroke-dashoffset",from:1e3,to:0,dur:"1.5s",fill:"freeze"})))):I.push(o("polyline",W)),w)for(let V=0;V<_.length;V++){let K=D(_[V].x),Q=M(_[V].y),G=_[V].shape??N,O=_[V].radius??C,Y=`${F}-pt-${V}`;if(g){let X=yi(G,K,Q,O,T,Y,{opacity:0});I.push(o("g",{key:`${Y}-g`},X,o("animate",{attributeName:"opacity",from:0,to:1,dur:"0.3s",begin:"1.2s",fill:"freeze"})))}else I.push(yi(G,K,Q,O,T,Y))}}if(P(t,i,s,p,c,u,l,a,d,"primary"),x)for(let L=0;L<x.length;L++){let E=x[L];P(E.data,E.color,s,!1,"transparent",u,E.color,E.pointRadius??a,E.pointShape??d,`series-${L}`)}if(x&&x.length>0){let L=[],E=[{color:i,label:"Primary"},...x.map((H,W)=>({color:H.color,label:H.label??`Series ${W+1}`}))],B=y+10,z=16,k=22,w=7.2,T=14,C=6,N=n-y*2-20,F=0,_=0;for(let H=0;H<E.length;H++){let W=E[H].label.length*w,V=T+C+W;F>0&&F+V>N&&(F=0,_+=k);let K=B+F,Q=y-30-_;L.push(o("rect",{x:K,y:Q,width:T,height:14,fill:E[H].color,rx:2,key:`legend-rect-${H}`})),L.push(o("text",{x:K+T+C,y:Q+12,"font-size":12,fill:"#374151",key:`legend-text-${H}`},E[H].label)),F+=V+z}I.push(o("g",{key:"legend"},...L))}return m&&I.push(o("text",{x:n/2,y:r-8,"text-anchor":"middle","font-size":13,fill:"#374151",key:"x-axis-label"},m)),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)),b&&I.push(o("text",{x:n/2,y:20,"text-anchor":"middle","font-size":16,"font-weight":"bold",fill:"#111827",key:"title"},b)),o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...I)}function oc(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 rc(e,t){let n=t??oc(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 Vn(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 p=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 ${p.x} ${p.y}`,`A ${n} ${n} 0 ${h} 0 ${c.x} ${c.y}`,"Z"].join(" ")}function Un(e,t){let n=t?.padAngle??0,r=rc(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],p=h.value/i*a,c=d+n/2,m=c+p;l.push({label:h.label,value:h.value,startAngle:c,endAngle:m,percentage:h.value/i*100,color:r[u]}),d=m+n/2}return l}function vi(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:p,colors:c,strokeColor:m="#fff",strokeWidth:f=2,textColor:b="currentColor"}=e,y=d&&u==="right"?140:0,g=h?30:0,x=d&&u==="bottom"?Math.ceil(t.length/2)*22+10:0,v=n-y,R=r-g-x,D=v/2,M=g+R/2,$=Math.min(v,R)/2-10,A=e.outerRadius??$,I=q(()=>Un(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:b},h));for(let L=0;L<I.length;L++){let E=I[L],B=Vn(D,M,i,A,E.startAngle,E.endAngle);if(P.push(o("path",{key:`slice-${L}`,d:B,fill:E.color,stroke:m,strokeWidth:f})),a||l){let z=(E.startAngle+E.endAngle)/2,k=E.percentage<5,w=k?A+14:i+(A-i)*.65,T=St(D,M,w,z-Math.PI/2),C=k?b:"#fff",N=k?11:12,F=[];if(a&&F.push(E.label),l&&F.push(`${E.percentage.toFixed(1)}%`),k){let _=St(D,M,A+2,z-Math.PI/2);P.push(o("line",{key:`connector-${L}`,x1:_.x,y1:_.y,x2:T.x,y2:T.y,stroke:"#999",strokeWidth:1}))}a&&P.push(o("text",{key:`label-${L}`,x:T.x,y:T.y-(l?6:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:N,fill:C,pointerEvents:"none"},E.label)),l&&P.push(o("text",{key:`value-${L}`,x:T.x,y:T.y+(a?10:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:N-1,fill:C,pointerEvents:"none"},`${E.percentage.toFixed(1)}%`))}}if(p&&i>0&&P.push(o("text",{key:"center-label",x:D,y:M,textAnchor:"middle",dominantBaseline:"central",fontFamily:"sans-serif",fontSize:14,fontWeight:"bold",fill:b},p)),d){let L=[];if(u==="right"){let E=v+10,B=g+20;for(let z=0;z<I.length;z++){let k=I[z],w=B+z*22;L.push(o("circle",{key:`legend-dot-${z}`,cx:E+6,cy:w,r:6,fill:k.color})),L.push(o("text",{key:`legend-text-${z}`,x:E+18,y:w,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:b},`${k.label} (${k.percentage.toFixed(1)}%)`))}}else{let E=r-x+10;for(let B=0;B<I.length;B++){let z=I[B],k=B%2,w=Math.floor(B/2),T=k*(n/2)+10,C=E+w*22;L.push(o("circle",{key:`legend-dot-${B}`,cx:T+6,cy:C,r:6,fill:z.color})),L.push(o("text",{key:`legend-text-${B}`,x:T+18,y:C,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:b},`${z.label} (${z.percentage.toFixed(1)}%)`))}}P.push(...L)}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...P)}function wi(e,t,n,r,i){return{x:n+e*Math.cos(t)*i,y:r-e*Math.sin(t)*i}}function ki(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:p="#3b82f6",curveColor:c="#3b82f6",onPointClick:m,onPointDoubleClick:f,onPointContextMenu:b,onPointHover:y}=e,[g,x]=j(r[1]),[v,R]=j(0),[D,M]=j(0),[$,A]=j(null),I=t/2+v,P=n/2+D,E=Math.min(t,n)/2-30,B=E/g,z=q(()=>{let O=Math.max(1,Math.ceil(g)),Y=[],X=g/O;for(let U=1;U<=O;U++)Y.push(X*U);return Y},[g]),k=q(()=>{let O=[];for(let Y=0;Y<360;Y+=30)O.push(Y*Math.PI/180);return O},[]),w=q(()=>{if(!i||!l)return[];let O=a??2*Math.PI/s,Y=yt({start:0,end:2*Math.PI,step:O});return qt(i,Y)},[i,s,a,l]),[T,C]=j([]),N=te(null);re(()=>{if(!i||l){C([]);return}let O=a??2*Math.PI/s,Y=yt({start:0,end:2*Math.PI,step:O});return N.current&&N.current(),N.current=Zt(i,Y,200,X=>{C([...X])}),()=>{N.current&&N.current()}},[i,s,a,l]);let F=l?w:T,_=q(()=>{if(F.length===0)return"";let O=[];for(let Y=0;Y<F.length;Y++){let X=F[Y],U=X.output;if(U<0||!isFinite(U))continue;let{x:Z,y:ee}=wi(U,X.input,I,P,B);O.push(`${O.length===0?"M":"L"}${Z.toFixed(2)},${ee.toFixed(2)}`)}return O.join(" ")},[F,I,P,B]),H=S(O=>{A({x:O.clientX,y:O.clientY,px:v,py:D})},[v,D]),W=S(O=>{$&&(R($.px+(O.clientX-$.x)),M($.py+(O.clientY-$.y)))},[$]),V=S(()=>{A(null)},[]),K=S(O=>{O.preventDefault();let Y=O.deltaY>0?1.15:1/1.15;x(Math.max(.1,g*Y))},[g]),Q=S((O,Y,X)=>{if(O)return U=>O({r:Y.r,theta:Y.theta,index:X,event:U})},[]),G=[];if(G.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),u){for(let O=0;O<z.length;O++){let Y=z[O]*B;G.push(o("circle",{cx:I,cy:P,r:Y,fill:"none",stroke:"#e5e7eb","stroke-width":1,key:`gc-${O}`})),G.push(o("text",{x:I+Y+2,y:P-4,"font-size":10,fill:"#9ca3af",key:`gl-${O}`},z[O].toFixed(1)))}for(let O=0;O<k.length;O++){let Y=k[O],X=z[z.length-1]*B,U=I+X*Math.cos(Y),Z=P-X*Math.sin(Y);G.push(o("line",{x1:I,y1:P,x2:U,y2:Z,stroke:"#e5e7eb","stroke-width":1,key:`al-${O}`}));let ee=Math.round(Y*180/Math.PI),ae=I+(X+14)*Math.cos(Y),J=P-(X+14)*Math.sin(Y);G.push(o("text",{x:ae,y:J+4,"text-anchor":"middle","font-size":10,fill:"#9ca3af",key:`at-${O}`},`${ee}\xB0`))}}G.push(o("line",{x1:I-E,y1:P,x2:I+E,y2:P,stroke:"#d1d5db","stroke-width":1,key:"x-axis"})),G.push(o("line",{x1:I,y1:P-E,x2:I,y2:P+E,stroke:"#d1d5db","stroke-width":1,key:"y-axis"})),_&&G.push(o("path",{d:_,fill:"none",stroke:c,"stroke-width":2,key:"curve"}));for(let O=0;O<d.length;O++){let Y=d[O],{x:X,y:U}=wi(Y.r,Y.theta,I,P,B);G.push(o("circle",{cx:X,cy:U,r:h,fill:p,key:`pt-${O}`,style:{cursor:"pointer"},onClick:Q(m,Y,O),onDblClick:Q(f,Y,O),onContextMenu:Q(b,Y,O),onMouseEnter:Q(y,Y,O)}))}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",style:{cursor:$?"grabbing":"grab"},onMouseDown:H,onMouseMove:W,onMouseUp:V,onMouseLeave:V,onWheel:K},...G)}function jn(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 Gn(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 Xn(e,t){let n=Ci(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=sc(n,ic(e,i,s,a))}r++}return n}function Ci(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 ic(e,t,n,r){let i=Ci(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 sc(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 Kn(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 qn(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=jn(e),s=Gn(e),a=Xn(e,t);return{vertices:i.map((d,u)=>{let h=Kn(a,d),p=qn(h,n);return{id:u,position:d,x:p.x*r,y:p.y*r,depth:p.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 Mi(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",p=e.scale??Math.min(n,r)*.3,c=Tt(t),m=1<<t,f=q(()=>e.vertexColors==="auto"||e.vertexColors===void 0?Jt(m):e.vertexColors,[m,e.vertexColors]),[b,y]=j(()=>{let C=[];for(let N=0;N<c;N++)C.push(0);return C}),[g,x]=j(!1),v=te({x:0,y:0}),R=te([]),D=te(0);re(()=>{if(d===0)return;let C=!0,N=()=>{C&&(y(F=>{let _=F.slice();for(let H=0;H<_.length;H++)_[H]=(_[H]??0)+d*(1+H*.3);return _}),D.current=requestAnimationFrame(N))};return D.current=requestAnimationFrame(N),()=>{C=!1,cancelAnimationFrame(D.current)}},[d]);let M=q(()=>Pt(t,b,l,p),[t,b,l,p]),$=n/2,A=r/2,I=q(()=>M.edges.map(C=>{let N=M.vertices[C.source],F=M.vertices[C.target],_=(N.depth+F.depth)/2;return{...C,avgDepth:_,sv:N,tv:F}}).sort((C,N)=>C.avgDepth-N.avgDepth),[M]),P=q(()=>M.vertices.slice().sort((C,N)=>C.depth-N.depth),[M]),L=S(C=>{let N=C;x(!0),v.current={x:N.clientX,y:N.clientY},R.current=b.slice()},[b]),E=S(C=>{if(!g)return;let N=C,F=(N.clientX-v.current.x)*.01,_=(N.clientY-v.current.y)*.01;y(()=>{let H=R.current.slice();return H.length>0&&(H[0]=(H[0]??0)+F),H.length>1&&(H[1]=(H[1]??0)+_),H})},[g]),B=S(()=>{x(!1)},[]),z=C=>{let N=(C+2)/4;return .3+.7*Math.max(0,Math.min(1,N))},k=C=>{let N=(C+2)/4;return .6+.4*Math.max(0,Math.min(1,N))},w=I.map((C,N)=>{let F=z(C.avgDepth);return o("line",{key:`e-${C.source}-${C.target}`,x1:String($+C.sv.x),y1:String(A+C.sv.y),x2:String($+C.tv.x),y2:String(A+C.tv.y),stroke:a,"stroke-width":String(s),"stroke-opacity":String(F),"stroke-linecap":"round"})}),T=P.map(C=>{let N=i*k(C.depth),F=f[C.id%f.length]??"#3b82f6",_=[o("circle",{key:`v-${C.id}-circle`,cx:String($+C.x),cy:String(A+C.y),r:String(N),fill:F,stroke:"#000","stroke-width":"1.5",style:{filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.3))"}})];return u&&_.push(o("text",{key:`v-${C.id}-label`,x:String($+C.x),y:String(A+C.y+N+14),"text-anchor":"middle","font-size":"11","font-family":"monospace",fill:"#555"},C.id.toString(2).padStart(t,"0"))),_});return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",style:{backgroundColor:h,cursor:g?"grabbing":"grab",userSelect:"none"},onMouseDown:L,onMouseMove:E,onMouseUp:B,onMouseLeave:B},...w,...T.flat())}function Ei(e={}){let t=e.dimension??4,n=e.rotationSpeed??.008,r=e.perspective??.25,i=e.scale??200,s=Tt(t),[a,l]=j(()=>new Array(s).fill(0));return re(()=>{if(n===0)return;let u=!0,h=0,p=()=>{u&&(l(c=>c.map((m,f)=>m+n*(1+f*.3))),h=requestAnimationFrame(p))};return h=requestAnimationFrame(p),()=>{u=!1,cancelAnimationFrame(h)}},[n]),{data:q(()=>Pt(t,a,r,i),[t,a,r,i]),angles:a,setAngles:l}}function Ii(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:ac(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?cc(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),p=lc(d,h,u,t,n);return o("div",{className:`viz-wrapper ${e.className??""}`.trim(),style:l},...p)}function ac(e,t){return"column"}function lc(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 cc(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"}},dc(n),o("span",null,n.label))))}function dc(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 uc(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 pc(){typeof window>"u"||(window.dataLayer=window.dataLayer||[],window.gtag||(window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date)))}function Ri(e){let{measurementId:t,disabled:n=!1,debug:r=!1,anonymizeIp:i=!1,config:s}=e;return re(()=>{if(n||typeof window>"u")return;uc(t),pc();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 Pi(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:p="Site footer"}=e;return o("footer",{className:h,role:"contentinfo","aria-label":p,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 $i=je({windows:[],openWindow:()=>{},closeWindow:()=>{},focusWindow:()=>{},minimizeWindow:()=>{},maximizeWindow:()=>{},restoreWindow:()=>{},moveWindow:()=>{},resizeWindow:()=>{},tileWindows:()=>{},cascadeWindows:()=>{},minimizeAll:()=>{},focusedWindowId:null,setMenuBar:()=>{},clearMenuBar:()=>{},activeMenuBar:null,signalDock:()=>{},dockSignals:new Map}),fc={width:600,height:400},mc={x:30,y:30},gc={top:0,left:0,width:1920,height:1080},Zn=1e3;function Ti(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 Jn(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 Di(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 Qn(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??gc,n=e.defaultWindowSize??fc,r=e.cascadeOffset??mc,[i,s]=j([]),a=S(((...L)=>{let E=L[0];s(B=>{if(B.find(_=>_.id===E.id)){let H=Qn(B)+1,W=B.map(V=>V.id===E.id?{...V,focused:!0,zIndex:H,windowState:V.windowState==="minimized"?"normal":V.windowState}:{...V,focused:!1});return H>Zn&&(W=Jn(W)),W}let k=E.size??n,w=E.position??Ti(B.length,r,t,k),C=Qn(B)+1,N={id:E.id,title:E.title,icon:E.icon,position:w,size:k,windowState:"normal",zIndex:C,focused:!0,appProps:E.appProps},F=B.map(_=>({..._,focused:!1}));return F.push(N),C>Zn&&(F=Jn(F)),e.onWindowOpen&&e.onWindowOpen(E.id),e.onFocusChange&&e.onFocusChange(E.id),F})}),[n,r,t,e.onWindowOpen,e.onFocusChange]),l=S(((...L)=>{let E=L[0];v(B=>{if(B[E]){let z={...B};return delete z[E],z}return B}),D(B=>{if(B.has(E)){let z=new Map(B);return z.delete(E),z}return B}),s(B=>{let z=B.find(w=>w.id===E);if(!z)return B;let k=B.filter(w=>w.id!==E);if(z.focused&&k.length>0){let w=Di(k,E);if(w){let T=k.map(C=>({...C,focused:C.id===w.id}));return e.onWindowClose&&e.onWindowClose(E),e.onFocusChange&&e.onFocusChange(w.id),T}}return e.onWindowClose&&e.onWindowClose(E),k.length===0&&e.onFocusChange&&e.onFocusChange(null),k})}),[e.onWindowClose,e.onFocusChange]),d=S(((...L)=>{let E=L[0];s(B=>{if(!B.find(C=>C.id===E))return B;let w=Qn(B)+1,T=B.map(C=>C.id===E?{...C,focused:!0,zIndex:w}:{...C,focused:!1});return w>Zn&&(T=Jn(T)),e.onFocusChange&&e.onFocusChange(E),T})}),[e.onFocusChange]),u=S(((...L)=>{let E=L[0];s(B=>{let z=B.find(w=>w.id===E);if(!z)return B;let k=B.map(w=>w.id===E?{...w,windowState:"minimized",focused:!1}:w);if(z.focused){let w=Di(k,E);w?(k=k.map(T=>({...T,focused:T.id===w.id})),e.onFocusChange&&e.onFocusChange(w.id)):e.onFocusChange&&e.onFocusChange(null)}return k})}),[e.onFocusChange]),h=S(((...L)=>{let E=L[0];s(B=>B.map(z=>z.id===E?{...z,windowState:"maximized"}:z))}),[]),p=S(((...L)=>{let E=L[0];s(B=>B.map(z=>z.id===E?{...z,windowState:"normal"}:z))}),[]),c=S(((...L)=>{let E=L[0],B=L[1];s(z=>z.map(k=>k.id===E?{...k,position:B}:k))}),[]),m=S(((...L)=>{let E=L[0],B=L[1];s(z=>z.map(k=>k.id===E?{...k,size:B}:k))}),[]),f=S(((...L)=>{s(E=>{let B=E.filter(w=>w.windowState!=="minimized");if(B.length===0)return E;let z=B.length,k=new Map;if(z===1)k.set(B[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(B[0].id,{position:{x:t.left,y:t.top},size:{width:w,height:t.height}}),k.set(B[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),T=Math.floor(t.height/2);k.set(B[0].id,{position:{x:t.left,y:t.top},size:{width:w,height:t.height}}),k.set(B[1].id,{position:{x:t.left+w,y:t.top},size:{width:t.width-w,height:T}}),k.set(B[2].id,{position:{x:t.left+w,y:t.top+T},size:{width:t.width-w,height:t.height-T}})}else{let w=Math.ceil(Math.sqrt(z)),T=Math.ceil(z/w),C=Math.floor(t.width/w),N=Math.floor(t.height/T);for(let F=0;F<B.length;F++){let _=Math.floor(F/w),H=F%w;k.set(B[F].id,{position:{x:t.left+H*C,y:t.top+_*N},size:{width:C,height:N}})}}return E.map(w=>{let T=k.get(w.id);return T?{...w,position:T.position,size:T.size,windowState:"normal"}:w})})}),[t]),b=S(((...L)=>{s(E=>{let B=E.filter(w=>w.windowState!=="minimized");if(B.length===0)return E;let z=[...B].sort((w,T)=>w.zIndex-T.zIndex),k=new Map;for(let w=0;w<z.length;w++){let T=Ti(w,r,t,z[w].size);k.set(z[w].id,{position:T,zIndex:w+1})}return E.map(w=>{let T=k.get(w.id);return T?{...w,position:T.position,zIndex:T.zIndex,windowState:"normal"}:w})})}),[r,t]),y=S(((...L)=>{s(E=>{let B=E.map(z=>({...z,windowState:"minimized",focused:!1}));return e.onFocusChange&&e.onFocusChange(null),B})}),[e.onFocusChange]),g=q(()=>{let L=i.find(E=>E.focused);return L?L.id:null},[i]),[x,v]=j({}),[R,D]=j(new Map),M=S(((...L)=>{let E=L[0],B=L[1];v(z=>({...z,[E]:B}))}),[]),$=S(((...L)=>{let E=L[0];v(B=>{let z={...B};return delete z[E],z})}),[]),A=q(()=>g&&x[g]?x[g]:null,[g,x]),I=S(((...L)=>{let E=L[0],B=L[1];D(z=>{let k=new Map(z),w=k.get(E);return k.set(E,{...w,...B}),k})}),[]),P=q(()=>({windows:i,openWindow:a,closeWindow:l,focusWindow:d,minimizeWindow:u,maximizeWindow:h,restoreWindow:p,moveWindow:c,resizeWindow:m,tileWindows:f,cascadeWindows:b,minimizeAll:y,focusedWindowId:g,setMenuBar:M,clearMenuBar:$,activeMenuBar:A,signalDock:I,dockSignals:R}),[i,a,l,d,u,h,p,c,m,f,b,y,g,M,$,A,I,R]);return o($i.Provider,{value:P},e.children)}function vt(){return Ye($i)}var zi=je({appId:""});function it(e){let t=q(()=>({appId:e.appId}),[e.appId]);return o(zi.Provider,{value:t},e.children)}function wt(){return Ye(zi).appId}var Ai=je({publish:()=>{},subscribe:()=>()=>{},subscribeAll:()=>()=>{}});function Dt(e){let t=te([]),n=te([]),r=S(((...l)=>{let d=l[0],u=l[1],h=l[2],p=l[3]||"",c={channel:d,from:p,to:h||null,payload:u,timestamp:Date.now()},m=t.current;for(let b=0;b<m.length;b++){let y=m[b];y.channel===d&&(c.to&&y.appId!==c.to||!c.to&&y.appId===p||y.handler(c))}let f=n.current;for(let b=0;b<f.length;b++)f[b].handler(c)}),[]),i=S(((...l)=>{let d=l[0],u=l[1],h=l[2]||"",p={channel:d,handler:u,appId:h};return t.current=[...t.current,p],()=>{t.current=t.current.filter(c=>c!==p)}}),[]),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(Ai.Provider,{value:a},e.children)}function st(){let e=Ye(Ai),t=wt(),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 $t(e,t){let n=st(),r=te(t);r.current=t,re(()=>n.subscribe(e,s=>{r.current(s)}),[n,e])}var Li=je({startDrag:()=>{},cancelDrag:()=>{},registerDropZone:()=>()=>{},currentDrag:null,isDragging:!1});function zt(e){let[t,n]=j(null),[r,i]=j({x:0,y:0}),s=te(new Map),a=te(null),l=t!==null,d=S(((...m)=>{let f=m[0];n(f)}),[]),u=S(((...m)=>{if(a.current){let f=s.current.get(a.current);f&&f.onDragLeave&&f.onDragLeave(),a.current=null}n(null)}),[]),h=S(((...m)=>{let f=m[0],b=m[1];return s.current=new Map(s.current),s.current.set(f,b),()=>{s.current=new Map(s.current),s.current.delete(f),a.current===f&&(a.current=null)}}),[]);re(()=>{if(!l)return;let m=y=>{let g=y;i({x:g.clientX,y:g.clientY});let x=document.elementFromPoint(g.clientX,g.clientY);if(!x)return;let v=null,R=s.current;R.forEach((M,$)=>{let A=document.querySelector(`[data-dropzone-id="${$}"]`);A&&A.contains(x)&&(v=$)});let D=a.current;if(v!==D){if(D){let M=R.get(D);M&&M.onDragLeave&&M.onDragLeave()}if(v){let M=R.get(v);M&&M.onDragEnter&&t&&M.acceptTypes.indexOf(t.type)!==-1&&M.onDragEnter(t)}a.current=v}},f=y=>{let g=a.current;if(g&&t){let x=s.current.get(g);x&&x.acceptTypes.indexOf(t.type)!==-1&&x.onDrop(t)}a.current=null,n(null)},b=y=>{y.key==="Escape"&&u()};return document.addEventListener("mousemove",m),document.addEventListener("mouseup",f),document.addEventListener("keydown",b),()=>{document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",f),document.removeEventListener("keydown",b)}},[l,t,u]);let p=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(Li.Provider,{value:p},e.children,c)}function pt(){return Ye(Li)}function eo(e,t){let n=pt(),r=wt(),i=te(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 At(e){let t=pt(),[n,r]=j(!1),i=te(e.zoneId||`zone-${Math.random().toString(36).slice(2,10)}`),s=te(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 hc=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],bc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function to(e){return e<10?"0"+String(e):String(e)}function xc(e,t,n){let r=e.getHours(),i=to(e.getMinutes()),s=to(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=to(r);return n?`${a}:${i}:${s}`:`${a}:${i}`}function yc(e){let t=hc[e.getDay()],n=bc[e.getMonth()],r=e.getDate();return`${t}, ${n} ${String(r)}`}function Sc(e){let{label:t,onClick:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=Ne(),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 vc(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(()=>xc(i,t,n),[i,t,n]),l=q(()=>yc(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 wc(e){let{indicator:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=Ne(),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 kc(e){let{item:t,onClose:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=Ne();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 Cc(e){let{user:t,menuItems:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=Ne(),[a,l]=j(!1),d=te(null),u=S(()=>{l(y=>!y)},[]),h=S(()=>{l(!1)},[]),p=S(y=>{let g=y;(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),l(x=>!x)),g.key==="Escape"&&l(!1)},[]);re(()=>{if(!a)return;let y=g=>{let x=d.current;x&&!x.contains(g.target)&&l(!1)};return document.addEventListener("click",y,!0),()=>{document.removeEventListener("click",y,!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"},m=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"},m),b=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((y,g)=>o(kc,{key:String(g),item:y,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:p,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")),b)}function Mc(e){let{menu:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=Ne(),[s,a]=j(!1),l=te(null),d=S(()=>{a(c=>!c)},[]),u=S(()=>{a(!1)},[]),h=S(c=>{let m=c;(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),a(f=>!f)),m.key==="Escape"&&a(!1)},[]);re(()=>{if(!s)return;let c=m=>{let f=l.current;f&&!f.contains(m.target)&&a(!1)};return document.addEventListener("click",c,!0),()=>{document.removeEventListener("click",c,!0)}},[s]);let p=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,m)=>c.divider?o("div",{key:"div-"+String(m),role:"separator",style:{height:"1px",backgroundColor:"var(--panel-divider, #555555)",margin:"4px 0"}}):o("button",{key:String(m),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),p)}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:p}=e,c=String(h)+"px",m=[];if(n&&m.push(o(Sc,{key:"activities",label:n.label,onClick:n.onClick})),t&&m.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++)m.push(o(Mc,{key:"appmenu-"+String(v),menu:r.menus[v]}));let f=o("div",{style:{display:"flex",alignItems:"center",height:"100%",flex:"1",minWidth:"0"}},...m),b=[];b.push(o(vc,{key:"clock",format:i,showSeconds:s,showDate:a})),p&&b.push(p);let y=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}},...b),g=[];if(l&&l.length>0){let v=l.map(R=>o(wc,{key:R.id,indicator:R}));g.push(o("div",{key:"indicators",style:{display:"flex",alignItems:"center",gap:"8px",height:"100%"}},...v))}d&&g.push(o(Cc,{key:"user",user:d,menuItems:u}));let x=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,y,x)}function Ec(e){return e.startsWith("http")||e.startsWith("/")||e.startsWith(".")}var Bi=["#3465a4","#e67e22","#2ecc71","#3498db","#e74c3c","#9b59b6","#f39c12","#1abc9c","#e91e63","#00bcd4"];function Ic(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return Bi[Math.abs(t)%Bi.length]}function Rc(e){return e>99?"99+":String(e)}function Pc(e){return e.badge&&e.badge>0?`${e.label}, ${e.badge} unread`:e.label}function Tc(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 Dc(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 $c(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]),p=S(()=>{d(!1)},[]),c=S(()=>{!u&&s&&s(t.id)},[u,s,t.id]),m=S(D=>{if(!u&&a){let M=D;M.preventDefault(),a(t.id,{x:M.clientX,y:M.clientY})}},[u,a,t.id]),f=`${n}px`,b=Ec(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:Ic(t.icon),color:"#ffffff",borderRadius:"8px"},"aria-hidden":"true"},t.icon),y=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,g=t.active?o("span",{style:{...Dc(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",...Tc(r),padding:"4px 10px",backgroundColor:"#1f2937",color:"#ffffff",fontSize:"12px",borderRadius:"4px",whiteSpace:"nowrap",zIndex:"1000",pointerEvents:"none"}},t.label):null,R={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:R,"aria-label":Pc(t),"aria-pressed":t.active?"true":"false","aria-disabled":u?"true":void 0,tabIndex:u?-1:0,onClick:c,onContextMenu:m,onMouseEnter:h,onMouseLeave:p,"data-dock-item-id":t.id,"data-urgent":t.urgent?"true":void 0},b,y,g,x,v)}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,p]=j(!s),c=te(null),m=S(()=>{s&&(c.current!=null&&(clearTimeout(c.current),c.current=null),p(!0))},[s]),f=S(()=>{s&&(c.current=setTimeout(()=>{p(!1)},300))},[s]),b=S(R=>{let D=R,M=D.target,$=M.closest('[role="toolbar"]');if(!$)return;let A=Array.from($.querySelectorAll("button[data-dock-item-id]")),I=A.indexOf(M);if(I<0)return;let P=n==="vertical",L=P?"ArrowDown":"ArrowRight",E=P?"ArrowUp":"ArrowLeft";if(D.key===L){D.preventDefault();let B=A[I+1];B&&B.focus()}else if(D.key===E){D.preventDefault();let B=A[I-1];B&&B.focus()}else D.key==="Home"?(D.preventDefault(),A[0]?.focus()):D.key==="End"?(D.preventDefault(),A[A.length-1]?.focus()):(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),M.click())},[n]),y=n==="vertical",g={display:"flex",flexDirection:y?"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 x=[];for(let R=0;R<t.length;R++){if(a&&R===t.length-1&&t.length>1){let D=y?{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-${R}`,style:D,"aria-hidden":"true",role:"separator"}))}x.push(o($c,{key:t[R].id,item:t[R],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:g,onMouseEnter:m,onMouseLeave:f,onKeyDown:b},v,...x,u??null)}var zc="#2c001e";function nn(e){let{backgroundColor:t=zc,backgroundGradient:n,backgroundImage:r,backgroundImageOpacity:i=1,contextMenuItems:s,onClick:a,onDoubleClick:l,overflow:d="visible",children:u}=e,h=S(g=>{let x=g;x.target===x.currentTarget&&a&&a()},[a]),p=S(g=>{let x=g;x.target===x.currentTarget&&l&&l()},[l]),c=q(()=>{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]),m=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"},b=[];m&&b.push(o("div",{className:"desktop-background__image-overlay",style:m,"aria-hidden":"true"})),b.push(o("div",{className:"desktop-background__content",style:f},u));let y=o("div",{className:"desktop-background",style:c,onClick:h,onDblClick:p,role:"application","aria-label":"Desktop workspace","data-theme":"dark"},...b);return s&&s.length>0?o(Kt,{items:s},y):y}function no(e){let{items:t,backgroundColor:n="#007acc",color:r="#ffffff",height:i=22}=e,s=t.filter(p=>p.align!=="right"),a=t.filter(p=>p.align==="right"),l={display:"flex",alignItems:"center",justifyContent:"space-between",height:`${i}px`,backgroundColor:n,color:r,fontSize:"12px",flexShrink:"0",padding:"0 8px",overflow:"hidden",userSelect:"none"};function d(p){let c=typeof p.onClick=="function",m={display:"inline-flex",alignItems:"center",gap:"4px",padding:"0 6px",height:"100%",whiteSpace:"nowrap",cursor:c?"pointer":"default"},f=[];p.icon&&f.push(o("span",{className:"status-bar__item-icon",style:{fontSize:"12px",lineHeight:"1"}},p.icon)),f.push(o("span",{className:"status-bar__item-label"},p.label));let b={key:p.key,className:`status-bar__item${c?" status-bar__item--clickable":""}`,style:m};return c&&(b.onClick=p.onClick,b.onMouseEnter=y=>{y.currentTarget.style.backgroundColor="rgba(255, 255, 255, 0.15)"},b.onMouseLeave=y=>{y.currentTarget.style.backgroundColor=""}),o("span",b,...f)}let u=o("div",{className:"status-bar__left",style:{display:"flex",alignItems:"center",height:"100%",overflow:"hidden"}},...s.map(d)),h=o("div",{className:"status-bar__right",style:{display:"flex",alignItems:"center",height:"100%",overflow:"hidden"}},...a.map(d));return o("div",{className:"status-bar",style:l,role:"status","aria-label":"Status bar"},u,h)}var Ac={width:200,height:150},Lc={x:50,y:50},Bc={width:400,height:300},We=8,oo=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 kt(e){let{id:t,title:n,icon:r,defaultPosition:i=Lc,defaultSize:s=Bc,minSize:a=Ac,maxSize:l,resizable:d=!0,draggable:u=!0,windowState:h="normal",focused:p=!0,zIndex:c,onClose:m,onMinimize:f,onMaximize:b,onFocus:y,onMove:g,onResize:x,statusBar:v,children:R}=e,[D,M]=j(i.x),[$,A]=j(i.y),[I,P]=j(s.width),[L,E]=j(s.height),[B,z]=j(!1),[k,w]=j(!1),[T,C]=j(null),N=te(null),F=te(null),_=te(null),H=S((le,ne)=>{let pe=Math.max(le,a.width),ie=Math.max(ne,a.height);return l&&(pe=Math.min(pe,l.width),ie=Math.min(ie,l.height)),{width:pe,height:ie}},[a,l]),W=S(()=>{let le=_.current;return le&&le.parentElement?{width:le.parentElement.clientWidth,height:le.parentElement.clientHeight}:{width:window.innerWidth,height:window.innerHeight}},[]),V=S((le,ne,pe,ie)=>{let he=W(),xe=Math.max(0,Math.min(le,he.width-pe)),Ce=Math.max(0,Math.min(ne,he.height-ie));return{x:xe,y:Ce}},[W]),K=S(le=>{if(!u||h==="maximized")return;let ne=le;ne.target.closest("button")||(ne.preventDefault(),N.current={startMouseX:ne.clientX,startMouseY:ne.clientY,startPosX:D,startPosY:$},z(!0))},[u,h,D,$]),Q=S(le=>{le.target.closest("button")||d&&b&&b()},[b,d]);re(()=>{if(!B)return;let le=pe=>{let ie=pe,he=N.current;if(!he)return;let xe=ie.clientX-he.startMouseX,Ce=ie.clientY-he.startMouseY,de=he.startPosX+xe,be=he.startPosY+Ce,ke=W();de=Math.max(0,Math.min(de,ke.width-I)),be=Math.max(0,Math.min(be,ke.height-L)),M(de),A(be),ie.clientX<=oo?C("left"):ie.clientX>=ke.width-oo?C("right"):ie.clientY<=oo?C("top"):C(null)},ne=pe=>{let ie=pe;z(!1);let he=W();if(T==="left"){M(0),A(0),P(Math.floor(he.width/2)),E(he.height),C(null),g&&g({x:0,y:0}),x&&x({width:Math.floor(he.width/2),height:he.height});return}if(T==="right"){let Ce=Math.floor(he.width/2);M(Ce),A(0),P(Ce),E(he.height),C(null),g&&g({x:Ce,y:0}),x&&x({width:Ce,height:he.height});return}if(T==="top"){C(null),b&&b();return}C(null);let xe=N.current;if(xe&&g){let Ce=ie.clientX-xe.startMouseX,de=ie.clientY-xe.startMouseY,be=xe.startPosX+Ce,ke=xe.startPosY+de;be=Math.max(0,Math.min(be,he.width-I)),ke=Math.max(0,Math.min(ke,he.height-L)),g({x:be,y:ke})}N.current=null};return document.addEventListener("mousemove",le),document.addEventListener("mouseup",ne),()=>{document.removeEventListener("mousemove",le),document.removeEventListener("mouseup",ne)}},[B,T,I,L,W,g,x,b]);let G=S(le=>ne=>{if(!d||h!=="normal")return;let pe=ne;pe.preventDefault(),pe.stopPropagation(),F.current={direction:le,startMouseX:pe.clientX,startMouseY:pe.clientY,startPosX:D,startPosY:$,startWidth:I,startHeight:L},w(!0)},[d,h,D,$,I,L]);re(()=>{if(!k)return;let le=pe=>{let ie=pe,he=F.current;if(!he)return;let xe=ie.clientX-he.startMouseX,Ce=ie.clientY-he.startMouseY,de=he.direction,be=he.startWidth,ke=he.startHeight,Re=he.startPosX,Le=he.startPosY;de.includes("e")&&(be=he.startWidth+xe),de.includes("w")&&(be=he.startWidth-xe,Re=he.startPosX+xe),de.includes("s")&&(ke=he.startHeight+Ce),de.includes("n")&&(ke=he.startHeight-Ce,Le=he.startPosY+Ce);let oe=H(be,ke);de.includes("w")&&(Re=he.startPosX+(he.startWidth-oe.width)),de.includes("n")&&(Le=he.startPosY+(he.startHeight-oe.height)),P(oe.width),E(oe.height),M(Re),A(Le)},ne=()=>{w(!1),x&&x({width:I,height:L}),F.current=null};return document.addEventListener("mousemove",le),document.addEventListener("mouseup",ne),()=>{document.removeEventListener("mousemove",le),document.removeEventListener("mouseup",ne)}},[k,I,L,H,x]),re(()=>{if(!p||!m)return;let le=ne=>{ne.key==="Escape"&&m()};return document.addEventListener("keydown",le),()=>document.removeEventListener("keydown",le)},[p,m]);let O=S(le=>{y&&y()},[y]);if(h==="minimized")return null;let Y=h==="maximized",X=q(()=>{let le={position:"absolute",display:"flex",flexDirection:"column",border:"1px solid var(--window-border, #555555)",borderRadius:Y?"0":"6px",overflow:"hidden",backgroundColor:"var(--window-body-bg, #1e1e1e)",boxShadow:p?"0 8px 32px rgba(0, 0, 0, 0.4)":"0 4px 16px rgba(0, 0, 0, 0.2)",transition:Y?"all 200ms ease":"box-shadow 200ms ease",outline:"none"};return Y?(le.top="0",le.left="0",le.width="100%",le.height="100%"):(le.top=`${$}px`,le.left=`${D}px`,le.width=`${I}px`,le.height=`${L}px`),c!==void 0&&(le.zIndex=String(c)),B&&(le.cursor="grabbing",le.userSelect="none"),le},[Y,D,$,I,L,c,p,B]),U=q(()=>{let le={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&&!Y?"grab":"default",opacity:p?"1":"0.6"};return B&&(le.cursor="grabbing"),le},[p,u,Y,B]),Z={flex:"1",overflow:"auto",backgroundColor:"var(--window-body-bg, #1e1e1e)"},ee={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"},ae=[];r&&(r.startsWith("http")||r.startsWith("/")||r.startsWith("data:")?ae.push(o("img",{src:r,alt:"",style:{width:"16px",height:"16px",marginRight:"6px",flexShrink:"0"},className:"draggable-window__icon"})):ae.push(o("span",{style:{marginRight:"6px",fontSize:"14px",flexShrink:"0"},className:"draggable-window__icon"},r))),ae.push(o("span",{className:"draggable-window__title-text",style:{flex:"1",fontSize:"13px",fontWeight:"500",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},n));let J=[];J.push(o("button",{type:"button","aria-label":"Minimize",className:"draggable-window__btn-minimize",style:{...ee,backgroundColor:"var(--window-button-minimize, #f39c12)"},onClick:le=>{le.stopPropagation(),f&&f()}})),d&&J.push(o("button",{type:"button","aria-label":Y?"Restore":"Maximize",className:"draggable-window__btn-maximize",style:{...ee,backgroundColor:"var(--window-button-maximize, #2ecc71)"},onClick:le=>{le.stopPropagation(),b&&b()}})),J.push(o("button",{type:"button","aria-label":"Close",className:"draggable-window__btn-close",style:{...ee,backgroundColor:"var(--window-button-close, #e74c3c)"},onClick:le=>{le.stopPropagation(),m&&m()}}));let se=o("div",{style:{display:"flex",alignItems:"center",flexShrink:"0"},className:"draggable-window__controls"},...J);ae.push(se);let ce=[];if(d&&!Y){let le=["n","s","e","w","ne","nw","se","sw"];for(let ne=0;ne<le.length;ne++){let pe=le[ne],ie={position:"absolute",zIndex:"1"};pe==="n"?(ie.top="0",ie.left=`${We}px`,ie.right=`${We}px`,ie.height=`${We}px`):pe==="s"?(ie.bottom="0",ie.left=`${We}px`,ie.right=`${We}px`,ie.height=`${We}px`):pe==="e"?(ie.top=`${We}px`,ie.right="0",ie.bottom=`${We}px`,ie.width=`${We}px`):pe==="w"?(ie.top=`${We}px`,ie.left="0",ie.bottom=`${We}px`,ie.width=`${We}px`):pe==="ne"?(ie.top="0",ie.right="0",ie.width=`${We}px`,ie.height=`${We}px`):pe==="nw"?(ie.top="0",ie.left="0",ie.width=`${We}px`,ie.height=`${We}px`):pe==="se"?(ie.bottom="0",ie.right="0",ie.width=`${We}px`,ie.height=`${We}px`):pe==="sw"&&(ie.bottom="0",ie.left="0",ie.width=`${We}px`,ie.height=`${We}px`),ie.cursor=Fc[pe],ce.push(o("div",{className:`draggable-window__resize-handle draggable-window__resize-${pe}`,style:ie,onMouseDown:G(pe)}))}}let me=null;if(T){let le={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"};T==="left"?(le.top="0",le.left="0",le.width="50%",le.height="100%"):T==="right"?(le.top="0",le.right="0",le.width="50%",le.height="100%"):T==="top"&&(le.top="0",le.left="0",le.width="100%",le.height="100%"),me=o("div",{className:"draggable-window__snap-preview",style:le})}let ge=[];for(let le=0;le<ce.length;le++)ge.push(ce[le]);ge.push(o("div",{className:"draggable-window__title-bar",style:U,onMouseDown:K,onDblClick:Q,role:"toolbar","aria-label":`${n} window controls`},...ae)),ge.push(o("div",{className:"draggable-window__body",style:Z},R)),v&&v!==!1&&ge.push(o(no,v));let ye=[o("div",{ref:_,id:`draggable-window-${t}`,className:`draggable-window ${p?"draggable-window--focused":"draggable-window--unfocused"} draggable-window--${h}`,style:X,role:"dialog","aria-label":n,tabIndex:-1,onMouseDown:O},...ge)];return me&&ye.push(me),ye.length===1?ye[0]:o("div",{style:{display:"contents"}},...ye)}var Nc=["File","Edit","View","Insert","Format","Tools","Help"],Fi={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"}]},Wc=[{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"}}],_c=[{label:"Align left",text:"\u2261",command:"justifyLeft"},{label:"Align center",text:"\u2263",command:"justifyCenter"},{label:"Align right",text:"\u2262",command:"justifyRight"}],Oc=["1","2","3","4","5","6","7"],Hc={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 Ni(e){return e.trim().split(/\s+/).filter(t=>t.length>0).length}function on(e){let[t,n]=j(!1),[r,i]=j(!1),[s,a]=j(!1),[l,d]=j(-1),[u,h]=j(""),[p,c]=j(-1),[m,f]=j(0),[b,y]=j("3"),g=te(null),x=S(()=>{document.execCommand("bold",!1),n(U=>!U),g.current&&g.current.focus()},[]),v=S(()=>{document.execCommand("italic",!1),i(U=>!U),g.current&&g.current.focus()},[]),R=S(()=>{document.execCommand("underline",!1),a(U=>!U),g.current&&g.current.focus()},[]),D={bold:x,italic:v,underline:R},M={bold:t,italic:r,underline:s},$=S(U=>{document.execCommand(U,!1),g.current&&g.current.focus()},[]),A=S(U=>{document.execCommand("fontSize",!1,U),y(U),g.current&&g.current.focus()},[]),I=S(U=>{c(Z=>Z===U?-1:U)},[]),P=S(U=>{switch(U){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()},[]),L=S(()=>{if(g.current){let U=g.current.textContent??"";f(Ni(U))}},[]),E=S(()=>{c(-1)},[]),B=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"},T={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"},N={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"},F=q(()=>Yc(),[]),_=e.content??"Start typing...",H=Ni(_),W=m>0?m:H;function V(U){return{padding:"4px 10px",cursor:"pointer",borderRadius:"3px",fontSize:"13px",color:"var(--color-text, #333)",backgroundColor:p===U?"rgba(0,0,0,0.12)":l===U?"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 G(U,Z){return{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid transparent",borderRadius:"3px",cursor:"pointer",fontSize:"13px",backgroundColor:M[U]??!1?"rgba(0,0,0,0.12)":u===U?"rgba(0,0,0,0.06)":"transparent",color:"var(--color-text, #444)",transition:"background 0.15s",...Z??{}}}let O={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"},Y={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"},X=Nc.map((U,Z)=>{let ee=[U];return p===Z&&Fi[U]&&ee.push(o("div",{key:"dropdown",style:K,className:"word-processor__menu-dropdown"},...Fi[U].map((ae,J)=>o("button",{key:String(J),style:Q,onClick:se=>{se.stopPropagation(),P(ae.action)},role:"menuitem"},ae.label)))),o("button",{key:String(Z),style:V(Z),role:"menuitem","aria-label":U,onClick:()=>I(Z),onMouseEnter:()=>{d(Z)},onMouseLeave:()=>d(-1)},...ee)});return o("div",{className:`word-processor ${e.className??""}`.trim(),style:B},o("div",{className:"word-processor__menu-bar",style:z,role:"menubar"},...X),o("div",{className:"word-processor__toolbar",style:k,role:"toolbar","aria-label":"Formatting toolbar"},o("div",{style:O,"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"}},...Wc.map(U=>o("button",{key:U.id,style:G(U.id,U.style),title:U.shortcut?`${U.label} (${U.shortcut})`:U.label,"aria-label":U.label,"aria-pressed":String(M[U.id]??!1),onClick:D[U.id],onMouseEnter:()=>h(U.id),onMouseLeave:()=>h("")},U.text))),o("div",{key:"1",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px",alignItems:"center"}},o("select",{style:Y,"aria-label":"Font size",value:b,onChange:U=>{let Z=U.target;A(Z.value)}},...Oc.map(U=>o("option",{key:U,value:U},Hc[U])))),o("div",{key:"2",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},..._c.map((U,Z)=>o("button",{key:String(Z),style:G(`align-${Z}`),title:U.label,"aria-label":U.label,onClick:()=>$(U.command),onMouseEnter:()=>h(`align-${Z}`),onMouseLeave:()=>h("")},U.text)))),o("div",{className:"word-processor__ruler",style:w,"aria-hidden":"true"},...F),o("main",{className:"word-processor__document-area",style:T,onClick:E},o("div",{className:"word-processor__page",style:C,contentEditable:"true",ref:g,onInput:L,suppressContentEditableWarning:!0},_)),o("div",{className:"word-processor__status-bar",style:N},o("span",null,"Page 1 of 1"),o("span",null,`${W} words`),o("span",null,"100%")))}function rn(e){let t=q(()=>({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 Vc={height:"28px",backgroundColor:"#3c3c3c",display:"flex",alignItems:"center",padding:"0 8px",gap:"2px",flexShrink:"0",position:"relative"},Wi={padding:"3px 8px",fontSize:"12px",color:"#cccccc",cursor:"pointer",borderRadius:"3px",backgroundColor:"transparent",border:"none",position:"relative"},Uc={...Wi,backgroundColor:"rgba(255,255,255,0.1)"},jc={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"},Gc={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]=j(-1),r=S(a=>{n(l=>l===a?-1:a)},[]),i=S(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:jc,className:"ide__menu-dropdown"},...e.menuItems[a].map((h,p)=>o("button",{key:String(p),style:Gc,onClick:c=>{c.stopPropagation(),i(h.action)},role:"menuitem"},h.label)))),o("button",{key:String(l),style:u?Uc:Wi,role:"menuitem","aria-label":a,onClick:()=>r(l)},...d)});return o("div",{className:"ide__menu-bar",style:Vc,role:"menubar"},...s)}var Xc={width:"220px",backgroundColor:"#252526",borderRight:"none",display:"flex",flexDirection:"column",flexShrink:"0",overflowY:"auto"},Kc={padding:"8px 12px",fontSize:"11px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#bbbbbb"};function qc(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:qc(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:Xc,"aria-label":"File explorer"},o("div",{style:Kc},"Explorer"),...r)}var Zc={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"},Qc={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:Qc,"aria-label":n,onClick:()=>e.onTabClick(n)},n)});return o("div",{style:Zc},...t)}var cn="#569cd6",ro="#ce9178",io="#4ec9b0",so="#6a9955",ao="#dcdcaa",Lt="#d4d4d4",lo="#d4d4d4",co="#b5cea8",ed=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"]),td=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;ed.has(i)?l=cn:td.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 nd={flex:"1",display:"flex",overflow:"auto",backgroundColor:"#1e1e1e",fontFamily:'"Cascadia Code", "Fira Code", "Consolas", monospace',fontSize:"13px",lineHeight:"20px"},od={padding:"8px 0",textAlign:"right",color:"#858585",userSelect:"none",minWidth:"48px",paddingRight:"12px",paddingLeft:"12px",flexShrink:"0"},rd={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:nd},o("div",{style:od,"aria-hidden":"true"},...n),o("code",{style:rd,contentEditable:"true",ref:e.editorRef,onInput:e.onInput,suppressContentEditableWarning:!0},...t))}var id={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:id,"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 sd={height:"22px",backgroundColor:"#007acc",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 12px",fontSize:"12px",color:"#ffffff",flexShrink:"0"},ad={cursor:"pointer",padding:"0 6px",borderRadius:"3px",transition:"background-color 0.15s"};function uo(e){let t=n=>n.map((r,i)=>o("span",{key:String(i),style:ad,onClick:r.onClick},r.label));return o("div",{className:"ide__status-bar",style:sd},o("div",{style:{display:"flex",gap:"16px"}},...t(e.items)),o("div",{style:{display:"flex",gap:"16px"}},...t(e.rightItems)))}var ld=["File","Edit","Selection","View","Go","Run","Terminal","Help"],cd={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"}]},dd=[{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}],po={"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"]',"}"]},_i=po["App.ts"];function fn(e){let[t,n]=j("App.ts"),[r,i]=j({src:!0,components:!0,hooks:!0}),[s,a]=j(_i.length),l=te(null),d=S(v=>{n(v);let R=po[v];R&&a(R.length)},[]),u=S(v=>{i(R=>{let D={},M=Object.keys(R);for(let $=0;$<M.length;$++)D[M[$]]=R[M[$]];return D[v]=!R[v],D})},[]),h=S(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"newFile":l.current&&(l.current.textContent="",a(1));break;default:break}l.current&&l.current.focus()},[]),p=S(()=>{if(l.current){let R=(l.current.textContent??"").split(`
|
|
8
|
+
`);a(Math.max(R.length,1))}},[]),c=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"}),[]),m={flex:"1",display:"flex",overflow:"hidden"},f={width:"1px",backgroundColor:"#007acc",cursor:"col-resize",flexShrink:"0",opacity:"0.4",transition:"opacity 0.2s"},b={flex:"1",display:"flex",flexDirection:"column",overflow:"hidden"},y=8,g=30,x=po[t]??_i;return o("div",{className:`ide ${e.className??""}`.trim(),style:c},o(rn,{title:"SpecifyJS IDE"}),o(sn,{menus:ld,menuItems:cd,onAction:h}),o("div",{style:m},o(an,{files:dd,activeFile:t,expandedFolders:r,onFileClick:d,onFolderToggle:u}),o("div",{style:f}),o("div",{style:b},o(ln,{tabs:[t],activeTab:t,onTabClick:d}),o(un,{content:x,onInput:p,editorRef:l})),o(pn,{lines:x,visibleStart:y,visibleEnd:g,totalLines:x.length})),o(uo,{items:[{label:"\u2387 main"},{label:"0 errors"},{label:"0 warnings"}],rightItems:[{label:"Ln 1, Col 1"},{label:"UTF-8"},{label:"TypeScript"}]}))}var ud=[{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]}],Oi=[{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}],Hi=[{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}],Yi=[{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}],pd=[{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}],fd=[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}],Ui=[{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}],ji=["09:30","10:00","10:30","11:00","11:30","12:00"];function md(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"},mn={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"},gn={cursor:"default",transition:"background-color 0.1s"};function gd(e,t){let i=Math.min(...e),a=Math.max(...e)-i||1,l=e.map((u,h)=>{let p=h/(e.length-1)*40,c=14-(u-i)/a*14;return`${p.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 hd(e,t){let u=Math.min(...e),h=Math.max(...e),p=h-u||1,c=310/(e.length-1),m=e.map((M,$)=>{let A=40+$*c,I=15+(1-(M-u)/p)*120;return{x:A,y:I}}),f=m.map(M=>`${M.x.toFixed(1)},${M.y.toFixed(1)}`).join(" "),b="M40,135 "+m.map(M=>`L${M.x.toFixed(1)},${M.y.toFixed(1)}`).join(" ")+` L${m[m.length-1].x.toFixed(1)},135 Z`,y=[];for(let M=1;M<e.length;M++){let $=e[M]>=e[M-1]?"#00c853":"#ff1744";y.push(o("line",{key:String(M),x1:String(m[M-1].x.toFixed(1)),y1:String(m[M-1].y.toFixed(1)),x2:String(m[M].x.toFixed(1)),y2:String(m[M].y.toFixed(1)),stroke:$,strokeWidth:"2",strokeLinecap:"round"}))}let g=[];for(let M=0;M<5;M++){let $=15+M/4*120,A=h-M/4*p;g.push(o("line",{key:`g${M}`,x1:String(40),y1:String($.toFixed(1)),x2:String(350),y2:String($.toFixed(1)),stroke:"#2a2a4a",strokeWidth:"0.5",strokeDasharray:"3,3"})),g.push(o("text",{key:`yl${M}`,x:String(36),y:String(($+3).toFixed(1)),fill:"#6666aa",fontSize:"8",textAnchor:"end",fontFamily:"monospace"},Ge(A)))}let x=[],v=Math.min(ji.length,e.length),R=(e.length-1)/(v-1);for(let M=0;M<v;M++){let A=40+Math.round(M*R)*c;x.push(o("text",{key:`tl${M}`,x:String(A.toFixed(1)),y:String(156),fill:"#6666aa",fontSize:"8",textAnchor:"middle",fontFamily:"monospace"},ji[M]))}let D="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:D,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:b,fill:`url(#${D})`}),...g,...x,...y,o("line",{x1:String(40),y1:String((15+(1-(t-u)/p)*120).toFixed(1)),x2:String(350),y2:String((15+(1-(t-u)/p)*120).toFixed(1)),stroke:"#00c853",strokeWidth:"0.5",strokeDasharray:"4,2",opacity:"0.6"})))}function bd(){let e=Math.max(...Oi.map(t=>t.qty),...Hi.map(t=>t.qty));return o("div",{style:Ct},o("div",{style:Mt},"Order Book"),o("table",{style:mn},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,...Oi.map((t,n)=>{let r=Hi[n],i=t.qty/e*.25,s=(r?.qty??0)/e*.25;return o("tr",{key:String(n),style:gn},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 xd(e){return o("div",{style:Ct},o("div",{style:Mt},"Watchlist"),o("table",{style:mn},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,...ud.map((t,n)=>{let r=t.price+(n===0?e:0),i=t.change>=0;return o("tr",{key:String(n),style:gn},o("td",{style:{...He,fontWeight:"600",color:"#ffffff"}},t.symbol,gd(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"}},md(t.volume)))}))))}function yd(){let e=Yi.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:mn},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,...Yi.map((n,r)=>{let i=n.pnl>=0;return o("tr",{key:String(r),style:{...gn,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 Sd(){return o("div",{style:Ct},o("div",{style:Mt},"Recent Trades"),o("table",{style:mn},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,...pd.map((e,t)=>{let n=e.side==="BUY";return o("tr",{key:String(t),style:gn},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 vd(){let e=Math.max(...Vi.map(n=>n.volume),...Ui.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"}},...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"}},Bt(n.volume)))),o("div",{style:{height:"1px",backgroundColor:"#2a2a4a",margin:"4px 0"}}),...Ui.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 hn(e){let[t,n]=j(0),[r,i]=j("--:--:--"),[s,a]=j(!0);re(()=>{let m=setInterval(()=>{n(f=>{let b=(Math.random()-.5)*.5;return Math.round(b*100)/100})},2e3);return()=>clearInterval(m)},[]),re(()=>{let m=()=>{let b=new Date,y=String(b.getHours()).padStart(2,"0"),g=String(b.getMinutes()).padStart(2,"0"),x=String(b.getSeconds()).padStart(2,"0");i(`${y}:${g}:${x}`)};m();let f=setInterval(m,1e3);return()=>clearInterval(f)},[]),re(()=>{let m=setInterval(()=>{a(f=>!f)},800);return()=>clearInterval(m)},[]);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"},p=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},hd(fd,p),bd(),xd(t),yd(),Sd(),vd()))}function Be(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 Be(e)?e.card_id:e.container_id}function fo(e){return Be(e)?e.card_title:e.name}var mo={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 wd(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 kd(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 Cd(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 Md(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 bn(e){let{card:t,selected:n=!1,onSelect:r,onMove:i,onResize:s,onDelete:a,dispatch:l,onOpenProject:d,onCardContextMenu:u,onUpdate:h,onDragStart:p,onDragEnd:c,onAnchorDragStart:m}=e,[f,b]=j(!1),[y,g]=j(!1),[x,v]=j(null),[R,D]=j(!1),[M,$]=j(!1),[A,I]=j(!1),[P,L]=j(t.card_title||""),[E,B]=j(""),z=te(null),k=te(null),w=t.priority?mo[t.priority]||"#94a3b8":"transparent",T=S(de=>{let be=de;be.preventDefault(),be.stopPropagation(),v({x:be.clientX,y:be.clientY}),D(!1),u&&u(t.card_id,{x:be.clientX,y:be.clientY})},[u,t.card_id]),C=S(()=>{v(null),D(!1)},[]),N=S(de=>{let be=de,ke=be.target;if(ke.dataset&&(ke.dataset.role==="delete"||ke.dataset.role==="resize"||ke.dataset.role==="drag-handle"||ke.dataset.role==="inline-edit"||ke.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},p&&p(t.card_id),g(!0);let Re=oe=>{let fe=oe;if(!z.current)return;let Se=fe.clientX-z.current.x,we=fe.clientY-z.current.y;i&&i(t.card_id,{x:z.current.cardX+Se,y:z.current.cardY+we})},Le=()=>{z.current=null,g(!1),c&&c(t.card_id),document.removeEventListener("mousemove",Re),document.removeEventListener("mouseup",Le)};document.addEventListener("mousemove",Re),document.addEventListener("mouseup",Le)},[t.card_id,t.position.x,t.position.y,r,i,p,c]),F=S(de=>{let be=de;be.preventDefault(),be.stopPropagation(),k.current={x:be.clientX,y:be.clientY,w:t.size.width,h:t.size.height};let ke=Le=>{let oe=Le;if(!k.current)return;let fe=oe.clientX-k.current.x,Se=oe.clientY-k.current.y,we=Math.max(120,k.current.w+fe),Ie=Math.max(80,k.current.h+Se);s&&s(t.card_id,{width:we,height:Ie})},Re=()=>{k.current=null,document.removeEventListener("mousemove",ke),document.removeEventListener("mouseup",Re)};document.addEventListener("mousemove",ke),document.addEventListener("mouseup",Re)},[t.card_id,t.size.width,t.size.height,s]),_=S(de=>{de.preventDefault(),de.stopPropagation(),a&&a(t.card_id)},[t.card_id,a]),H=S(de=>{let be=de;be.preventDefault(),be.stopPropagation();let Re=be.target.dataset.anchor;if(!Re||!m)return;let Le=t.position.x,oe=t.position.y,fe=t.size.width,Se=t.size.height,we=Le+fe/2,Ie=oe+Se/2;Re==="top"?(we=Le+fe/2,Ie=oe):Re==="right"?(we=Le+fe,Ie=oe+Se/2):Re==="bottom"?(we=Le+fe/2,Ie=oe+Se):Re==="left"&&(we=Le,Ie=oe+Se/2),m(t.card_id,Re,{x:we,y:Ie})},[t.card_id,t.position.x,t.position.y,t.size.width,t.size.height,m]),W=S(de=>{l&&l({type:"CHANGE_CARD_TYPE",cardId:t.card_id,newType:de}),C()},[t.card_id,l,C]),V=S(de=>{de.preventDefault(),de.stopPropagation(),L(t.card_title||""),$(!0)},[t.card_title]),K=S(()=>{$(!1),h&&P!==t.card_title&&h(t.card_id,{card_title:P})},[h,t.card_id,t.card_title,P]),Q=S(de=>{let be=de;be.key==="Enter"?(be.preventDefault(),K()):be.key==="Escape"&&(be.preventDefault(),$(!1),L(t.card_title||""))},[K,t.card_title]),G=S(de=>{let be=de.target;L(be.value)},[]),O=S(de=>{de.stopPropagation();let be=t.content;B(be.text||""),I(!0)},[t.content]),Y=S(()=>{I(!1),h&&h(t.card_id,{content:{text:E}})},[h,t.card_id,E]),X=S(de=>{let be=de;if(be.key==="Escape"){be.preventDefault(),I(!1);let ke=t.content;B(ke.text||"")}},[t.content]),U=S(de=>{let be=de.target;B(be.value)},[]),Z;switch(t.card_type){case"text":A?Z=o("textarea",{"data-role":"inline-edit","data-testid":`card-desc-edit-${t.card_id}`,value:E,onInput:U,onBlur:Y,onKeyDown:X,onFocus:de=>{let be=de.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:O},t.content.text||"");break;case"json":Z=kd(t);break;case"task":Z=Cd(t);break;case"project":Z=Md(t,d);break;default:Z=wd(t)}let ee=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:ee?"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:y?"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"},ce={position:"absolute",bottom:"0",right:"0",width:"12px",height:"12px",cursor:"nwse-resize",opacity:"0.4",background:"linear-gradient(135deg, transparent 50%, #666 50%)"},me={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"},ge=8,ye={position:"absolute",width:`${ge}px`,height:`${ge}px`,borderRadius:"50%",backgroundColor:"#3b82f6",border:"2px solid #fff",boxSizing:"border-box",cursor:"crosshair",display:f?"block":"none",zIndex:"10"},ne=[{anchor:"top",style:{...ye,top:`${-ge/2}px`,left:"50%",marginLeft:`${-ge/2}px`}},{anchor:"right",style:{...ye,top:"50%",right:`${-ge/2}px`,marginTop:`${-ge/2}px`}},{anchor:"bottom",style:{...ye,bottom:`${-ge/2}px`,left:"50%",marginLeft:`${-ge/2}px`}},{anchor:"left",style:{...ye,top:"50%",left:`${-ge/2}px`,marginTop:`${-ge/2}px`}}].map((de,be)=>o("div",{key:`anchor-${de.anchor}`,style:de.style,"data-role":"anchor","data-anchor":de.anchor,"data-testid":`card-anchor-${de.anchor}-${t.card_id}`,onMouseDown:H})),pe=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,ie=t.tags&&t.tags.length>0?o("div",{style:{display:"flex",gap:"4px",flexWrap:"wrap",marginTop:"4px"}},...t.tags.map((de,be)=>o("span",{key:String(be),style:{fontSize:"10px",padding:"1px 4px",borderRadius:"3px",backgroundColor:"rgba(0,0,0,0.08)",color:"#444"}},de))):null,he={padding:"6px 12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",whiteSpace:"nowrap"},xe={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=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:de=>de.stopPropagation()},o("div",{style:he,onClick:de=>{de.stopPropagation(),a&&a(t.card_id),C()},role:"menuitem","data-testid":`ctx-delete-${t.card_id}`},"Delete"),o("div",{style:{...he,position:"relative"},onMouseEnter:()=>D(!0),role:"menuitem","aria-haspopup":"true","data-testid":`ctx-change-type-${t.card_id}`},"Change Type",o("span",{style:{marginLeft:"8px"}},"\u25B6"),R?o("div",{style:xe,role:"menu","data-testid":`ctx-type-submenu-${t.card_id}`},...Ft.map(de=>o("div",{key:de.value,style:{...he,fontWeight:t.card_type===de.value?"700":"400"},onClick:be=>{be.stopPropagation(),W(de.value)},role:"menuitem","data-testid":`ctx-type-${de.value}-${t.card_id}`},de.label,t.card_type===de.value?" \u2713":""))):null)):null;return ee?o("div",{className:"board-card board-card--project",style:ae,onMouseDown:N,onContextMenu:T,onMouseEnter:()=>b(!0),onMouseLeave:()=>{b(!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},Z,o("div",{style:me,"data-role":"drag-handle","data-testid":`card-drag-handle-${t.card_id}`,"aria-label":"Export drag handle",title:"Drag to export card"},"\u2630"),...ne,Ce):o("div",{className:"board-card",style:ae,onMouseDown:N,onContextMenu:T,onMouseEnter:()=>b(!0),onMouseLeave:()=>{b(!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:G,onBlur:K,onKeyDown:Q,onFocus:de=>{let be=de.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"),Z,ie,pe,o("div",{style:me,"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:_,"aria-label":`Delete ${t.card_title}`,tabIndex:-1},"\xD7"),o("div",{style:ce,"data-role":"resize",onMouseDown:F,"aria-label":"Resize card"}),...ne,Ce)}function xn(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:p,children:c}=e,[m,f]=j(!1),[b,y]=j(!1),[g,x]=j(!1),v=te(null),R=te(null),D=S(C=>{C.stopPropagation(),l&&l(t.container_id)},[t.container_id,l]),M=S(C=>{C.stopPropagation(),y(N=>!N)},[]),$=S(C=>{let N=C;N.preventDefault(),N.stopPropagation(),p&&p(t.container_id,{x:N.clientX,y:N.clientY})},[t.container_id,p]),A=S(C=>{let N=C;N.preventDefault(),N.stopPropagation(),i&&i(t.container_id),u&&u(t.container_id),x(!0),v.current={x:N.clientX,y:N.clientY,posX:t.position.x,posY:t.position.y};let F=H=>{let W=H;if(!v.current)return;let V=W.clientX-v.current.x,K=W.clientY-v.current.y;s&&s(t.container_id,{x:v.current.posX+V,y:v.current.posY+K})},_=()=>{v.current=null,x(!1),h&&h(t.container_id),document.removeEventListener("mousemove",F),document.removeEventListener("mouseup",_)};document.addEventListener("mousemove",F),document.addEventListener("mouseup",_)},[t.container_id,t.position.x,t.position.y,i,s,u,h]),I=S(C=>{let N=C;N.preventDefault(),N.stopPropagation(),R.current={x:N.clientX,y:N.clientY,w:t.size.width,h:t.size.height};let F=H=>{let W=H;if(!R.current)return;let V=W.clientX-R.current.x,K=W.clientY-R.current.y,Q=Math.max(160,R.current.w+V),G=Math.max(120,R.current.h+K);a&&a(t.container_id,{width:Q,height:G})},_=()=>{R.current=null,document.removeEventListener("mousemove",F),document.removeEventListener("mouseup",_)};document.addEventListener("mousemove",F),document.addEventListener("mouseup",_)},[t.container_id,t.size.width,t.size.height,a]),P=S(C=>{C.preventDefault(),f(!0)},[]),L=S(()=>{f(!1)},[]),E=S(C=>{let N=C;if(N.preventDefault(),f(!1),d&&N.dataTransfer){let F=N.dataTransfer.getData("text/plain");F&&d(F,t.container_id)}},[t.container_id,d]),B=r||m,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:B?"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"},T={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:L,onDrop:E,onContextMenu:$},o("div",{className:"board-container__title",style:{...k,display:"flex",alignItems:"center",justifyContent:"space-between"},onMouseDown:A,"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":b?"Expand container":"Minimize container",title:b?"Expand":"Minimize"},b?"\u25B2":"\u2014"),o("button",{style:{border:"none",backgroundColor:"transparent",cursor:"pointer",color:"#94a3b8",fontSize:"14px",padding:"0 2px",lineHeight:"1"},onClick:D,"aria-label":"Delete container",title:"Delete"},"\xD7"))),b?null:o("div",{className:"board-container__contents",style:w,"data-testid":`container-contents-${t.container_id}`},c),b?null:o("div",{style:T,"data-role":"resize",onMouseDown:I,"aria-label":"Resize container"}))}function Gi(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 Ed(e,t){let n=Gi(e),r=Gi(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 p=s[h].x-i[u].x,c=s[h].y-i[u].y,m=p*p+c*c;m<a&&(a=m,l=i[u],d=s[h])}return{from:l,to:d}}var Xi="board-card-link-arrowhead";function yn(e){let{links:t,cards:n,selectedLinkId:r,onSelectLink:i,onLinkContextMenu:s,canvasWidth:a,canvasHeight:l}=e,d=new Map;for(let m=0;m<n.length;m++)d.set(n[m].card_id,n[m]);let u=S(m=>{i(m)},[i]),h=[];for(let m=0;m<t.length;m++){let{source:f,link:b}=t[m],y=d.get(b.target_card_id);if(!y)continue;let{from:g,to:x}=Ed(f,y),v=b.link_id===r,R=v?"#3b82f6":b.color||"#94a3b8",D=x.x-g.x,M=x.y-g.y,$=Math.sqrt(D*D+M*M),A=Math.min(40,$*.15),I=$>0?-M/$:0,P=$>0?D/$:0,L=(g.x+x.x)/2,E=(g.y+x.y)/2,B=L+I*A,z=E+P*A,k=`M ${g.x} ${g.y} Q ${B} ${z} ${x.x} ${x.y}`,w=f.card_id;h.push(o("path",{key:`hit-${b.link_id}`,d:k,fill:"none",stroke:"transparent","stroke-width":"12",style:{cursor:"pointer",pointerEvents:"stroke"},onClick:()=>u(b.link_id),onContextMenu:T=>{let C=T;C.preventDefault(),C.stopPropagation(),s&&s(b.link_id,w,{x:C.clientX,y:C.clientY})},"data-testid":`link-hit-${b.link_id}`})),h.push(o("path",{key:b.link_id,d:k,fill:"none",stroke:R,"stroke-width":v?"3":"2","pointer-events":"none","marker-end":`url(#${Xi})`,"data-testid":`link-${b.link_id}`})),b.link_name&&h.push(o("text",{key:`label-${b.link_id}`,x:String(B),y:String(z-6),"text-anchor":"middle",fill:"#64748b","font-size":"11","pointer-events":"none","data-testid":`link-label-${b.link_id}`},b.link_name))}let p={position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none",overflow:"visible",zIndex:"9999"},c=o("defs",{},o("marker",{id:Xi,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:p,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 Id=[{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"}],go=20,Et=5e3;function Rd(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 Pd(e,t,n,r){let i=new Set;if(r){i.add(r);let d=Rd(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,p]=l.pop();for(let c=0;c<d.length;c++){let m=d[c];if(!$e(m)||i.has(m.container_id))continue;let f=m.position.x+u,b=m.position.y+h;t>=f&&t<=f+m.size.width&&n>=b&&n<=b+m.size.height&&(p>a&&(s=m.container_id,a=p),m.contents.length>0&&l.push([m.contents,f,b+30,p+1]))}}return s}function qi(e,t){return{x:Math.round(e.x/t)*t,y:Math.round(e.y/t)*t}}function Ki(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 Zi(e,t,n){return{x:(e-n.panX)/n.zoom,y:(t-n.panY)/n.zoom}}function Td(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(Be(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:p,viewport:c}=t,m=te(null),f=te(!1),b=te(null),[y,g]=j(null),[x,v]=j(null),[R,D]=j(null),[M,$]=j(null),[A,I]=j(!1),[P,L]=j(!1),[E,B]=j(null),[z,k]=j(null),w=S(oe=>{let fe=oe,Se=fe.target;if(Se.closest(".board-card")||Se.closest(".board-container"))return;let we=fe.button===1,Ie=fe.button===0&&fe.shiftKey;we||Ie?(fe.preventDefault(),f.current=!0,b.current={x:fe.clientX,y:fe.clientY,panX:c.panX,panY:c.panY}):fe.button===0&&i&&i(null)},[c.panX,c.panY,i]);re(()=>{let oe=Se=>{if(!f.current||!b.current)return;let we=Se,Ie=we.clientX-b.current.x,Fe=we.clientY-b.current.y;n({type:"PAN",panX:b.current.panX+Ie,panY:b.current.panY+Fe})},fe=()=>{f.current=!1,b.current=null};return document.addEventListener("mousemove",oe),document.addEventListener("mouseup",fe),()=>{document.removeEventListener("mousemove",oe),document.removeEventListener("mouseup",fe)}},[n]);let T=S(oe=>{let fe=oe;if(!fe.ctrlKey)return;fe.preventDefault();let Se=fe.deltaY>0?-.1:.1;n({type:"ZOOM",zoom:c.zoom+Se})},[c.zoom,n]),C=te(null);re(()=>{let oe=m.current;if(!oe)return;let fe=Ae=>{let ze=[];for(let ue=0;ue<Ae.touches.length;ue++)ze.push({x:Ae.touches[ue].clientX,y:Ae.touches[ue].clientY});return ze},Se=(Ae,ze)=>Math.sqrt((Ae.x-ze.x)**2+(Ae.y-ze.y)**2),we=Ae=>{let ze=Ae;if(ze.touches.length===2){ze.preventDefault();let ue=fe(ze);C.current={touches:ue,panX:c.panX,panY:c.panY,zoom:c.zoom,dist:Se(ue[0],ue[1])}}},Ie=Ae=>{let ze=Ae;if(ze.touches.length!==2||!C.current)return;ze.preventDefault();let ue=fe(ze),ve=C.current,Me=(ve.touches[0].x+ve.touches[1].x)/2,Te=(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-Me),panY:ve.panY+(Qe-Te)});let ct=Se(ue[0],ue[1]);ve.dist>0&&n({type:"ZOOM",zoom:ve.zoom*(ct/ve.dist)})},Fe=()=>{C.current=null};return oe.addEventListener("touchstart",we,{passive:!1}),oe.addEventListener("touchmove",Ie,{passive:!1}),oe.addEventListener("touchend",Fe),()=>{oe.removeEventListener("touchstart",we),oe.removeEventListener("touchmove",Ie),oe.removeEventListener("touchend",Fe)}},[c.panX,c.panY,c.zoom,n]);let N=S((oe,fe)=>{$({cardId:oe,x:fe.x,y:fe.y}),I(!1),L(!1),u&&u(oe,fe)},[u]),F=S(()=>{$(null),I(!1),L(!1)},[]);re(()=>{if(!M)return;let oe=()=>{F()};return document.addEventListener("click",oe),()=>{document.removeEventListener("click",oe)}},[M,F]);let _=S((oe,fe,Se)=>{k({linkId:oe,cardId:fe,x:Se.x,y:Se.y}),F()},[F]),H=S(()=>{k(null)},[]);re(()=>{if(!z)return;let oe=()=>H();return document.addEventListener("click",oe),()=>document.removeEventListener("click",oe)},[z,H]);let W=S((oe,fe)=>{B({containerId:oe,x:fe.x,y:fe.y}),F(),H()},[F,H]),V=S(()=>{B(null)},[]);re(()=>{if(!E)return;let oe=()=>V();return document.addEventListener("click",oe),()=>document.removeEventListener("click",oe)},[E,V]);let K=S(oe=>{i&&i(oe)},[i]),Q=S((oe,fe)=>{let Se=fe;if(s&&(Se=qi(fe,go)),n({type:"MOVE_ITEM",itemId:oe,position:Se}),U.current===oe){let Ie=0,Fe=0,Ae=[...p];for(;Ae.length>0;){let Me=Ae.pop();if(Xe(Me)===oe){Ie=Me.size.width,Fe=Me.size.height;break}if($e(Me))for(let Te=0;Te<Me.contents.length;Te++)Ae.push(Me.contents[Te])}let ze=Se.x+Ie/2,ue=Se.y+Fe/2,ve=Pd(p,ze,ue,oe);g(ve)}},[n,s,p]),G=S((oe,fe)=>{n({type:"RESIZE_ITEM",itemId:oe,size:fe})},[n]),O=S(oe=>{n({type:"REMOVE_ITEM",itemId:oe}),i&&r===oe&&i(null)},[n,r,i]),Y=S((oe,fe)=>{n({type:"NEST_ITEM",itemId:oe,containerId:fe})},[n]),X=S(oe=>{v(oe),U.current=oe,g(null)},[]),U=te(null);U.current=x;let Z=te(null);Z.current=y;let ee=S(oe=>{let fe=Z.current;fe&&n({type:"NEST_ITEM",itemId:oe,containerId:fe}),v(null),U.current=null,g(null)},[n]),ae=S((oe,fe,Se)=>{D({fromCardId:oe,fromAnchor:fe,fromPos:Se,currentPos:Se})},[]),J=te(null);J.current=R,re(()=>{if(!R)return;let oe=Se=>{let we=Se,Ie=0,Fe=0;if(m.current){let ze=m.current.getBoundingClientRect();Ie=ze.left,Fe=ze.top}let Ae=Zi(we.clientX-Ie,we.clientY-Fe,c);D(ze=>ze?{...ze,currentPos:Ae}:null)},fe=Se=>{let we=Se,Ie=J.current;if(!Ie){D(null);return}let Fe=document.elementFromPoint(we.clientX,we.clientY);if(Fe&&Fe.dataset&&Fe.dataset.role==="anchor"&&Fe.dataset.anchor){let Ae=Fe.closest("[data-card-id]");if(Ae&&Ae.dataset.cardId&&Ae.dataset.cardId!==Ie.fromCardId){let ze=Ae.dataset.cardId;n({type:"ADD_LINK",cardId:Ie.fromCardId,link:{link_id:qe(),link_name:"relates to",target_card_id:ze,color:"#94a3b8",attributes:{}}})}}D(null)};return document.addEventListener("mousemove",oe),document.addEventListener("mouseup",fe),()=>{document.removeEventListener("mousemove",oe),document.removeEventListener("mouseup",fe)}},[R!==null,c.panX,c.panY,c.zoom,n]);let se=a.toLowerCase(),ce=new Set,me=[],ge=[...p];for(;ge.length>0;){let oe=ge.pop();if(me.push(oe),$e(oe))for(let fe=0;fe<oe.contents.length;fe++)ge.push(oe.contents[fe])}if(se)for(let oe=0;oe<me.length;oe++){let fe=me[oe];(Be(fe)?fe.card_title:fe.name).toLowerCase().includes(se)||ce.add(Xe(fe))}if(l)for(let oe=0;oe<me.length;oe++){let fe=me[oe];Be(fe)&&fe.color!==l&&ce.add(fe.card_id)}let{cards:ye,links:le}=Td(p);function ne(oe){let fe=Xe(oe),Se=ce.has(fe),we;if(Be(oe))we=o(bn,{key:fe,card:oe,selected:fe===r,onSelect:K,onMove:Q,onResize:G,onDelete:O,dispatch:n,onOpenProject:d,onCardContextMenu:N,onUpdate:h,onDragStart:X,onDragEnd:ee,onAnchorDragStart:ae});else{let Ie=oe.contents.map(Fe=>ne(Fe));we=o(xn,{key:fe,container:oe,selected:fe===r,highlighted:y===oe.container_id,onSelect:K,onMove:Q,onResize:G,onDelete:O,onDrop:Y,onDragStart:X,onDragEnd:ee,onContainerContextMenu:W},...Ie)}return Se?o("div",{key:`dim-${fe}`,style:{opacity:"0.3"}},we):we}let pe=p.map(oe=>ne(oe)),ie={flex:"1",overflow:"hidden",position:"relative",backgroundColor:"#f8fafc",cursor:"default",backgroundImage:s?"radial-gradient(circle, #d1d5db 1px, transparent 1px)":"none",backgroundSize:`${go}px ${go}px`},he={transform:`translate(${c.panX}px, ${c.panY}px) scale(${c.zoom})`,transformOrigin:"0 0",position:"relative",width:`${Et}px`,height:`${Et}px`},xe={padding:"6px 12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",whiteSpace:"nowrap",fontSize:"13px",color:"#1a1a1a"},Ce={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"},de={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:oe=>oe.stopPropagation()},o("div",{style:{...xe,position:"relative"},onMouseEnter:()=>{I(!0),L(!1)},role:"menuitem","aria-haspopup":"true","data-testid":`board-ctx-change-color-${M.cardId}`},"Change Color",o("span",{style:{marginLeft:"8px"}},"\u25B6"),A?o("div",{style:Ce,role:"menu","data-testid":`board-ctx-color-submenu-${M.cardId}`},...Id.map(oe=>o("div",{key:oe.value,style:{...xe,gap:"8px"},onClick:fe=>{fe.stopPropagation(),n({type:"UPDATE_CARD",cardId:M.cardId,updates:{color:oe.value}}),F()},role:"menuitem","data-testid":`board-ctx-color-${oe.label.toLowerCase()}-${M.cardId}`},o("span",{style:{display:"inline-block",width:"14px",height:"14px",borderRadius:"3px",backgroundColor:oe.value,border:"1px solid #d1d5db",flexShrink:"0"}}),oe.label))):null),o("div",{style:{...xe,position:"relative"},onMouseEnter:()=>{L(!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:Ce,role:"menu","data-testid":`board-ctx-type-submenu-${M.cardId}`},...Ft.map(oe=>o("div",{key:oe.value,style:xe,onClick:fe=>{fe.stopPropagation(),n({type:"CHANGE_CARD_TYPE",cardId:M.cardId,newType:oe.value}),F()},role:"menuitem","data-testid":`board-ctx-type-${oe.value}-${M.cardId}`},oe.label))):null),(()=>{let oe=Ki(p,M.cardId);return oe?o("div",{style:xe,onClick:fe=>{fe.stopPropagation(),n({type:"UNNEST_ITEM",itemId:M.cardId,containerId:oe}),F()},role:"menuitem","data-testid":`board-ctx-detach-${M.cardId}`},"Detach Card"):null})(),o("div",{style:de,role:"separator"}),o("div",{style:{...xe,color:"#dc2626"},onClick:oe=>{oe.stopPropagation(),n({type:"REMOVE_ITEM",itemId:M.cardId}),i&&r===M.cardId&&i(null),F()},role:"menuitem","data-testid":`board-ctx-delete-${M.cardId}`},"Delete")):null,ke=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 oe=Ki(p,E.containerId);return oe?o("div",{style:xe,onClick:fe=>{fe.stopPropagation(),n({type:"UNNEST_ITEM",itemId:E.containerId,containerId:oe}),V()},role:"menuitem","data-testid":`board-ctx-detach-container-${E.containerId}`},"Detach Container"):null})(),o("div",{style:de,role:"separator"}),o("div",{style:{...xe,color:"#dc2626"},onClick:oe=>{oe.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"],Le=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:oe=>oe.stopPropagation()},o("div",{style:{padding:"4px 14px",fontSize:"11px",color:"#94a3b8",fontWeight:"600"}},"Edge Type"),...Re.map(oe=>o("button",{key:oe,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 fe=null,Se=[...p];for(;Se.length>0;){let we=Se.pop();if(Be(we)&&we.card_id===z.cardId){fe=we;break}if($e(we))for(let Ie of we.contents)Se.push(Ie)}return fe?fe.card_link.map(we=>we.link_id===z.linkId?{...we,link_name:oe}:we):[]})()}}),H()},role:"menuitem"},oe)),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}),H()},role:"menuitem"},"Delete Link")):null;return o("div",{ref:m,className:"board-canvas",style:ie,onMouseDown:w,onWheel:T,"data-testid":"board-canvas",role:"application","aria-label":`Board: ${t.name}`,tabIndex:0},o("div",{className:"board-canvas__inner",style:he,"data-testid":"board-canvas-inner"},o(yn,{links:le,cards:ye,selectedLinkId:null,onSelectLink:()=>{},onLinkContextMenu:_,canvasWidth:Et,canvasHeight:Et}),R?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(R.fromPos.x),y1:String(R.fromPos.y),x2:String(R.currentPos.x),y2:String(R.currentPos.y),stroke:"#3b82f6","stroke-width":"2","stroke-dasharray":"6 4","pointer-events":"none","data-testid":"link-drag-line"})):null,...pe),be,ke,Le)}function Dd(e){let t=[],n=[...e];for(;n.length>0;){let r=n.pop();if(Be(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 Ji(e,t,n,r){let i=r??40,s=Dd(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 x=s[g];x.position.x<a&&(a=x.position.x),x.position.y<l&&(l=x.position.y);let v=x.position.x+x.size.width,R=x.position.y+x.size.height;v>d&&(d=v),R>u&&(u=R)}let h=d-a+i*2,p=u-l+i*2,c=t/h,m=n/p,f=Math.max(.25,Math.min(4,Math.min(c,m))),b=-a*f+(t-(d-a)*f)/2,y=-l*f+(n-(u-l)*f)/2;return{panX:b,panY:y,zoom:f}}var ho=["#fef9c3","#fecaca","#fed7aa","#bbf7d0","#bfdbfe","#ddd6fe","#fbcfe8","#e5e7eb"];function Qi(e){let{zoom:t,gridEnabled:n,selectedColor:r,colorFilter:i,onNewCard:s,onZoomIn:a,onZoomOut:l,onZoomReset:d,onColorSelect:u,onColorFilter:h,onGridToggle:p,onSearch:c}=e,[m,f]=j(""),b=S($=>{let A=$.target.value;f(A),c(A)},[c]),y={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"},x={...g,backgroundColor:"#3b82f6",color:"#ffffff",borderColor:"#3b82f6"},v={fontSize:"12px",color:"#64748b",minWidth:"40px",textAlign:"center",cursor:"pointer"},R={width:"1px",height:"20px",backgroundColor:"#e2e8f0",margin:"0 4px"},D={padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",width:"120px",outline:"none"},M=ho.map($=>{let A=$===r,I=$===i,P=()=>{A&&h?h(I?null:$):u($)},L="1px solid rgba(0,0,0,0.15)";return I?L="3px solid #ef4444":A&&(L="2px solid #3b82f6"),o("button",{key:$,title:$,style:{width:"18px",height:"18px",borderRadius:"50%",backgroundColor:$,border:L,cursor:"pointer",padding:"0",flexShrink:"0",opacity:I?"1":i?"0.5":"1"},onClick:P,"aria-label":I?`Clear color filter ${$}`:`Select color ${$}`,"data-testid":`color-swatch-${$}`})});return o("div",{className:"board-toolbar",style:y,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:R}),o("button",{style:g,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:g,onClick:a,"data-testid":"btn-zoom-in","aria-label":"Zoom in"},"+"),o("div",{style:R}),...M,o("div",{style:R}),o("button",{style:n?x:g,onClick:p,"data-testid":"btn-grid-toggle","aria-label":n?"Disable grid snapping":"Enable grid snapping","aria-pressed":String(n)},"Grid"),o("div",{style:R}),o("input",{type:"text",placeholder:"Search cards...",value:m,onInput:b,style:D,"data-testid":"search-input","aria-label":"Search cards"}))}var es=50,tt={id:qe(),name:"Untitled",collection:[],viewport:{panX:0,panY:0,zoom:1}};function ts(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 Sn(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:Sn(s.contents,t,n)}):r.push(s)}return r}function ns(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 $d(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 p=0;p<u.contents.length;p++){let c=u.contents[p];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 zd(e){switch(e){case"text":return{text:""};case"json":return{};case"task":return{};case"project":return{project_id:"",project_name:""}}}function vn(e,t){switch(t.type){case"ADD_ITEM":return t.containerId?{...e,collection:Sn(e.collection,t.containerId,t.item)}:{...e,collection:[...e.collection,t.item]};case"REMOVE_ITEM":{let[n]=ts(e.collection,t.itemId);return{...e,collection:n}}case"MOVE_ITEM":return{...e,collection:ft(e.collection,t.itemId,n=>({...n,position:t.position,...Be(n)?{updatedAt:Date.now()}:{}}))};case"RESIZE_ITEM":return{...e,collection:ft(e.collection,t.itemId,n=>({...n,size:t.size,...Be(n)?{updatedAt:Date.now()}:{}}))};case"UPDATE_CARD":return{...e,collection:ft(e.collection,t.cardId,n=>Be(n)?{...n,...t.updates,updatedAt:Date.now()}:n)};case"CHANGE_CARD_TYPE":return{...e,collection:ft(e.collection,t.cardId,n=>Be(n)?{...n,card_type:t.newType,content:zd(t.newType),updatedAt:Date.now()}:n)};case"ADD_CONTAINER":return t.parentContainerId?{...e,collection:Sn(e.collection,t.parentContainerId,t.container)}:{...e,collection:[...e.collection,t.container]};case"NEST_ITEM":{let n=ns(e.collection,t.containerId);if(!n)return e;let[r,i]=ts(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:Sn(r,t.containerId,s)}}case"UNNEST_ITEM":{let n=ns(e.collection,t.containerId),[r,i]=$d(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=>Be(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=>Be(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 Ad(e){return e.type==="PAN"||e.type==="ZOOM"}function wn(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=vn(e.present,t.action);if(n===e.present)return e;if(Ad(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>es&&r.splice(0,r.length-es),{past:r,present:n,future:[]}}default:return e}}function Wt(e){let t={past:[],present:e||tt,future:[]},[n,r]=zn(wn,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 os(e,t){let{state:n,dispatch:r,undo:i,redo:s,canUndo:a,canRedo:l}=Wt(),d=te(!1);re(()=>{e&&t&&!d.current&&(d.current=!0,e.load(t).then(p=>{r({type:"SET_BOARD",state:p})}).catch(()=>{}))},[e,t,r]);let u=te(null),h=te(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 kn=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 Ld(e){let t=[],n=[...e];for(;n.length>0;){let r=n.pop();if(Be(r))t.push(r);else for(let i=r.contents.length-1;i>=0;i--)n.push(r.contents[i])}return t}function rs(e){let{collection:t,onCardDropped:n,children:r}=e,i=st(),s=te([]);re(()=>{let u=Ld(t),h=s.current,p=new Set(h.map(m=>m.card_id)),c=new Set(u.map(m=>m.card_id));for(let m of u)p.has(m.card_id)||i.publish("project-board",{event:"card-created",card:m});for(let m of h)c.has(m.card_id)||i.publish("project-board",{event:"card-deleted",cardId:m.card_id});for(let m of u)if(p.has(m.card_id)){let f=h.find(b=>b.card_id===m.card_id);f&&f.updatedAt!==m.updatedAt&&i.publish("project-board",{event:"card-updated",card:m})}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}=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 Bd=new kn;function is(e){let t=[],n=[...e];for(;n.length>0;){let r=n.pop();if(Be(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(),Fd={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 Nd(e){return e.collection.length===0}function ss(e){let t=e.boardId||"default",{state:n,dispatch:r,undo:i,redo:s,canUndo:a,canRedo:l}=os(Bd,t),[d,u]=j(ho[0]),[h,p]=j(!1),[c,m]=j(""),[f,b]=j(null),[y,g]=j(null),[x,v]=j(n.name||"Untitled"),[R,D]=j(!1),[M,$]=j(""),[A,I]=j(null),[P,L]=j(!0),[E,B]=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,T]=j(""),[C,N]=j("1"),[F,_]=j([]),H=te(!1);re(()=>{!H.current&&Nd(n)?(H.current=!0,r({type:"SET_BOARD",state:Fd})):n.collection.length>0&&(H.current=!0)},[n,r]);let W=S(()=>{let ue=(-n.viewport.panX+300)/n.viewport.zoom,ve=(-n.viewport.panY+200)/n.viewport.zoom,Me=(Math.random()-.5)*300,Te=(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+Me),y:Math.round(ve+Te)},size:{width:180,height:120},priority:"medium",createdAt:Date.now(),updatedAt:Date.now()};r({type:"ADD_ITEM",item:Ke})},[n.viewport,d,r]),V=S(()=>{r({type:"ZOOM",zoom:n.viewport.zoom+.1})},[n.viewport.zoom,r]),K=S(()=>{r({type:"ZOOM",zoom:n.viewport.zoom-.1})},[n.viewport.zoom,r]),Q=S(()=>{r({type:"ZOOM",zoom:1})},[r]),G=S(()=>{p(ue=>!ue)},[]),O=S(ue=>{m(ue)},[]),Y=S(ue=>{b(ue)},[]),X=S(ue=>{g(ue)},[]),U=S(()=>{L(ue=>!ue)},[]),Z=S(()=>{r({type:"SET_BOARD",state:tt}),b(null)},[r]),ee=S(()=>{let ue=JSON.stringify(n,null,2),ve=new Blob([ue],{type:"application/json"}),Me=URL.createObjectURL(ve),Te=document.createElement("a");Te.href=Me,Te.download=`board-${t}.json`,Te.style.display="none",document.body.appendChild(Te),Te.click(),document.body.removeChild(Te),URL.revokeObjectURL(Me)},[n,t]),ae=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 Me=new FileReader;Me.onload=()=>{try{let Te=JSON.parse(Me.result);Te&&Te.collection&&Te.viewport&&r({type:"SET_BOARD",state:Te})}catch{}},Me.readAsText(ve)}),document.body.appendChild(ue),ue.click(),document.body.removeChild(ue)},[r]),J=S(()=>{window.print()},[]),se=is(n.collection),ce=S(()=>{let ue=is(n.collection);ue.length>0&&b(ue[0].card_id)},[n.collection]),me=S(()=>{f&&(r({type:"REMOVE_ITEM",itemId:f}),b(null))},[f,r]),ge=S(()=>{if(n.collection.length===0)return;let Me=Ji(n.collection,800,600);r({type:"PAN",panX:Me.panX,panY:Me.panY}),r({type:"ZOOM",zoom:Me.zoom})},[n.collection,r]);re(()=>{let ue={menus:[{label:"File",items:[{label:"New Board",onClick:Z},{label:"Export JSON",onClick:ee},{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:ce},{label:"Delete Selected",onClick:me}]},{label:"View",items:[{label:"Zoom In",onClick:V},{label:"Zoom Out",onClick:K},{label:"Fit All",onClick:ge},{divider:!0},{label:"Toggle Grid",onClick:G}]}]}},[Z,ee,ae,J,i,s,a,l,ce,me,V,K,ge,G]),re(()=>{let ue=ve=>{let Me=ve;Me.ctrlKey&&Me.key==="z"?(Me.preventDefault(),i()):Me.ctrlKey&&Me.key==="y"&&(Me.preventDefault(),s())};return document.addEventListener("keydown",ue),()=>document.removeEventListener("keydown",ue)},[i,s]),re(()=>{if(!A)return;let ue=()=>I(null),ve=setTimeout(()=>document.addEventListener("click",ue),0);return()=>{clearTimeout(ve),document.removeEventListener("click",ue)}},[A]);let ye=S(()=>{$(x),D(!0)},[x]),le=S(()=>{let ue=M.trim();ue&&(v(ue),r({type:"RENAME_BOARD",name:ue}),e.onTitleChange&&e.onTitleChange(`Project Board: ${ue}`)),D(!1)},[M,r,e.onTitleChange]),ne=S(()=>{D(!1)},[]),pe=S(ue=>{$(ue.target.value)},[]),ie=S(ue=>{let ve=ue;ve.key==="Enter"&&(ve.preventDefault(),le()),ve.key==="Escape"&&(ve.preventDefault(),ne())},[le,ne]),he={display:"flex",flexDirection:"column",width:"100%",height:"100%",backgroundColor:"#f8fafc",overflow:"hidden"},xe=S((ue,ve)=>{let Me=(-n.viewport.panX+300)/n.viewport.zoom,Te=(-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(Me+Ke),y:Math.round(Te+Qe)},size:{width:180,height:120},priority:"medium",createdAt:Date.now(),updatedAt:Date.now()};r({type:"ADD_ITEM",item:ct})},[n.viewport,d,r]),Ce={display:"flex",alignItems:"center",height:"28px",backgroundColor:"#f1f5f9",borderBottom:"1px solid #e2e8f0",padding:"0 8px",fontSize:"13px",flexShrink:"0"},de={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,Me=(Math.random()-.5)*300,Te=(Math.random()-.5)*200;r({type:"ADD_CONTAINER",container:{type:"container",container_id:qe(),name:"New Container",position:{x:Math.round(ue+Me),y:Math.round(ve+Te)},size:{width:300,height:250},contents:[]}}),I(null)},[n.viewport,r]),ke={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"},Le=o("div",{style:Ce,"data-testid":"app-menu-bar"},o("div",{style:{position:"relative",display:"inline-flex"}},o("button",{style:de,onClick:()=>I(A==="project"?null:"project")},"Project"),A==="project"?o("div",{style:ke},o("button",{style:Re,onClick:()=>{ye(),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:()=>{W(),I(null)}},"New Card")):null),o("div",{style:{position:"relative",display:"inline-flex"}},o("button",{style:de,onClick:()=>I(A==="graphs"?null:"graphs")},"Graphs"),A==="graphs"?o("div",{style:ke},o("button",{style:Re,onClick:()=>{T(""),N("1"),k("add"),I(null)}},"Add Attribute..."),o("button",{style:Re,onClick:()=>{k("delete"),I(null)}},"Delete Attribute..."),o("button",{style:Re,onClick:()=>{_(E.map(ue=>({...ue}))),k("edit"),I(null)}},"Edit Attributes...")):null),o("div",{style:{position:"relative",display:"inline-flex"}},o("button",{style:de,onClick:()=>I(A==="settings"?null:"settings")},"Settings"),A==="settings"?o("div",{style:ke},o("button",{style:Re,onClick:()=>{G(),I(null)}},h?"Disable Grid Snap":"Enable Grid Snap"),o("button",{style:Re,onClick:()=>{U(),I(null)}},P?"Hide Links":"Show Links")):null),o("div",{style:{position:"relative",display:"inline-flex"}},o("button",{style:de,onClick:()=>I(A==="help"?null:"help")},"Help"),A==="help"?o("div",{style:ke},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}`)),oe=R?o("div",{style:{position:"absolute",inset:"0",backgroundColor:"rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"200"},onClick:ne},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:pe,onKeyDown:ie,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:ne,style:{padding:"6px 14px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",cursor:"pointer",fontSize:"13px",fontFamily:"inherit"}},"Cancel"),o("button",{onClick:le,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,fe={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"},Fe={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"},ze=null;return z==="add"&&(ze=o("div",{style:fe,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=>T(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=>N(ue.target.value)})),o("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px"}},o("button",{style:Ae,onClick:()=>k(null)},"Cancel"),o("button",{style:Fe,onClick:()=>{let ue=w.trim(),ve=parseFloat(C)||1;ue&&B(Me=>[...Me,{name:ue,weight:ve}]),k(null)}},"Add"))))),z==="delete"&&(ze=o("div",{style:fe,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:()=>B(Me=>Me.filter((Te,Ke)=>Ke!==ve))},"\xD7")))),o("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"12px"}},o("button",{style:Ae,onClick:()=>k(null)},"Done"))))),z==="edit"&&(ze=o("div",{style:fe,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"),F.length===0?o("div",{style:{color:"#94a3b8",padding:"8px 0"}},"No attributes defined."):o("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},...F.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:Me=>{let Te=Me.target.value;_(Ke=>Ke.map((Qe,ct)=>ct===ve?{...Qe,name:Te}:Qe))}}),o("input",{type:"number",value:String(ue.weight),min:"0",step:"1",style:{...Ie,width:"80px"},onInput:Me=>{let Te=parseFloat(Me.target.value)||0;_(Ke=>Ke.map((Qe,ct)=>ct===ve?{...Qe,weight:Te}:Qe))}})))),o("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"12px"}},o("button",{style:Ae,onClick:()=>k(null)},"Cancel"),o("button",{style:Fe,onClick:()=>{B(F.filter(ue=>ue.name.trim())),k(null)}},"Save"))))),o("div",{className:"project-manager-app",style:he,"data-testid":"project-manager-app"},Le,o(Qi,{zoom:n.viewport.zoom,gridEnabled:h,selectedColor:d,colorFilter:y,onNewCard:W,onZoomIn:V,onZoomOut:K,onZoomReset:Q,onColorSelect:u,onColorFilter:X,onGridToggle:G,onSearch:O}),o(rs,{collection:n.collection,onCardDropped:xe},o(Nt,{state:n,dispatch:r,searchQuery:c,gridEnabled:h,selectedId:f,onSelectItem:Y,colorFilter:y,onUpdateItem:(ue,ve)=>{r({type:"UPDATE_CARD",cardId:ue,updates:ve})},onCardContextMenu:(ue,ve)=>{}})),oe,ze)}var Wd=28,_d=5e3;var as=0;function ls(e){return as++,`${e}-${as}`}function Od(e){return e.replace(/\s*\(\d+\)$/,"")}function Hd(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 Yd(){let e=st(),t=te(!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 Vd(){let[e,t]=j([]),n=pt();$t("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(Od(e)){case"Files":return o(it,{appId:"files"},o(Vd,null));case"Terminal":return o(it,{appId:"terminal"},o(Yd,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(fn,null);case"Trading":return o(hn,null);case"Project Board":return o(ss,{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 jd(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=te(l);h.current=l;let[p,c]=j([]),[m,f]=j([]),[b,y]=j(!1),[g,x]=j(!1),[v,R]=j(null),[D,M]=j({x:0,y:0}),[$,A]=j(null),I=S(()=>{y(ne=>!ne)},[]),P=S(ne=>{f(pe=>pe.filter(ie=>ie.id!==ne))},[]);re(()=>{if(m.length===0)return;let ne=m[0],pe=Date.now()-ne.timestamp,ie=Math.max(0,_d-pe),he=setTimeout(()=>{f(xe=>xe.filter(Ce=>Ce.id!==ne.id))},ie);return()=>clearTimeout(he)},[m]);let L=te(t);L.current=t;let E=te(r);E.current=r;let B=te({});for(let ne of p)if(!B.current[ne.id]){let pe=ne.id;B.current[pe]=ie=>{c(he=>he.map(xe=>xe.id===pe?{...xe,title:ie}:xe))}}let z=S(ne=>{let ie=L.current.find(he=>he.id===ne);ie&&(c(he=>{let Ce=he.filter(Le=>Le.appId===ne).length+1,de=Ce===1?ie.label:`${ie.label} (${Ce})`,be=ls(ne),ke=he.length>0?Math.max(...he.map(Le=>Le.zIndex))+1:1,Re={id:be,appId:ie.id,title:de,icon:ie.icon,x:60+he.length*30,y:40+he.length*30,width:ie.defaultSize?.width??600,height:ie.defaultSize?.height??400,zIndex:ke,focused:!0,windowState:"normal",resizable:ie.resizable!==!1,statusBar:ie.statusBar};return[...he.map(Le=>({...Le,focused:!1})),Re]}),ne==="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:()=>{}}]}]}),ne==="terminal"&&h.current.signalDock("terminal",{badge:3}),E.current&&E.current(ne))},[]),k=S(ne=>{c(pe=>{if(!pe.find(xe=>xe.id===ne))return pe;let he=Math.max(...pe.map(xe=>xe.zIndex))+1;return pe.map(xe=>xe.id===ne?{...xe,focused:!0,zIndex:he,windowState:xe.windowState==="minimized"?"normal":xe.windowState}:{...xe,focused:!1})})},[]),w=S(ne=>{c(pe=>{let ie=pe.filter(de=>de.appId===ne);if(ie.length===0)return pe;let xe=[...ie].sort((de,be)=>be.zIndex-de.zIndex)[0],Ce=Math.max(...pe.map(de=>de.zIndex))+1;return pe.map(de=>de.id===xe.id?{...de,focused:!0,zIndex:Ce,windowState:de.windowState==="minimized"?"normal":de.windowState}:{...de,focused:!1})}),c(pe=>{if(pe.filter(he=>he.appId===ne).length===0){let xe=L.current.find(ke=>ke.id===ne);if(!xe)return pe;let Ce=ls(ne),de=pe.length>0?Math.max(...pe.map(ke=>ke.zIndex))+1:1,be={id:Ce,appId:xe.id,title:xe.label,icon:xe.icon,x:60+pe.length*30,y:40+pe.length*30,width:xe.defaultSize?.width??600,height:xe.defaultSize?.height??400,zIndex:de,focused:!0,windowState:"normal",resizable:xe.resizable!==!1,statusBar:xe.statusBar};return ne==="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:()=>{}}]}]}),ne==="terminal"&&h.current.signalDock("terminal",{badge:3}),E.current&&E.current(ne),[...pe.map(ke=>({...ke,focused:!1})),be]}return pe})},[]),T=t.map(ne=>{let pe=p.some(xe=>xe.appId===ne.id),ie=u.get(ne.id),he={id:ne.id,icon:ne.icon,label:ie?.tooltip||ne.label,active:pe};return ie&&(ie.badge!=null&&(he.badge=ie.badge>0?ie.badge:void 0),ie.progress!=null&&(he.progress=ie.progress>0?ie.progress:void 0),ie.urgent&&(he.urgent=!0)),he}),C=p.find(ne=>ne.focused),N=C?C.title:void 0,F=S(()=>{x(!0)},[]),_=S(()=>{x(!1)},[]),H=S((ne,pe)=>{R(ne),M(pe)},[]),W=S(()=>{R(null)},[]),V=S(()=>{},[]),K=S(()=>{i&&i()},[i]),Q=[];n&&(Q.push({label:n.name,icon:void 0,onClick:V,divider:!1}),Q.push({label:"",icon:void 0,onClick:V,divider:!0})),Q.push({label:"Lock",icon:void 0,onClick:F,divider:!1}),Q.push({label:"Logout",icon:void 0,onClick:K,divider:!1});let G=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]),O={display:"flex",flex:"1",overflow:"hidden"},Y={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"},X={width:"100%",height:"100%",position:"relative"},U=o(en,{activeAppName:N,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:Q.length>0?Q:void 0,height:Wd}),Z=o(tn,{items:T,orientation:"vertical",position:"left",iconSize:36,onItemClick:w,onItemContextMenu:H}),ee=o(Hd,{toasts:m,onDismiss:P}),ae=p.filter(ne=>ne.windowState!=="minimized").map(ne=>o(kt,{key:ne.id,id:ne.id,title:ne.title,icon:ne.icon,defaultPosition:{x:ne.x,y:ne.y},defaultSize:{width:ne.width,height:ne.height},resizable:ne.resizable,statusBar:ne.statusBar,zIndex:ne.zIndex,focused:ne.focused,windowState:ne.windowState,onClose:()=>{c(pe=>pe.filter(ie=>ie.id!==ne.id))},onFocus:()=>{c(pe=>{let ie=Math.max(...pe.map(he=>he.zIndex))+1;return pe.map(he=>he.id===ne.id?{...he,focused:!0,zIndex:ie}:{...he,focused:!1})})},onMinimize:()=>{c(pe=>pe.map(ie=>ie.id===ne.id?{...ie,windowState:"minimized"}:ie))},onMaximize:()=>{c(pe=>pe.map(ie=>ie.id===ne.id?{...ie,windowState:ie.windowState==="maximized"?"normal":"maximized"}:ie))}},(()=>{let pe=t.find(ie=>ie.id===ne.appId);return pe?.render?pe.render(ne.id):Ud(pe?.label||ne.title,ne.id,B.current[ne.id])})())),J=[];a&&J.push(a),J.push(...ae),J.push(ee);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:X},...J)),ce=b?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(ne=>o("button",{key:ne.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:pe=>{pe.stopPropagation(),y(!1),w(ne.id)}},o("span",{style:{fontSize:"32px",display:"block"}},ne.icon),o("span",null,ne.label)))):null,me=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:_},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,ge=(()=>{if(!v)return null;let ne=t.find(de=>de.id===v),pe=p.filter(de=>de.appId===v),ie={padding:"6px 14px",cursor:"pointer"},he={onMouseEnter:de=>{de.currentTarget.style.backgroundColor="#444"},onMouseLeave:de=>{de.currentTarget.style.backgroundColor="transparent"}},xe={borderBottom:"1px solid #444",margin:"4px 0"},Ce=[];return Ce.push(o("div",{key:"new",style:ie,...he,onClick:()=>{z(v),R(null)},role:"menuitem"},"\u25CF New")),pe.length>0&&(Ce.push(o("div",{key:"sep-1",style:xe})),pe.forEach((de,be)=>{let ke=de.title;Ce.push(o("div",{key:`inst-${de.id}`,style:ie,...he,onClick:()=>{k(de.id),R(null)},role:"menuitem"},ke))})),Ce.push(o("div",{key:"sep-2",style:xe})),Ce.push(o("div",{key:"about",style:ie,...he,onClick:()=>{A(v),R(null)},role:"menuitem"},"About")),o("div",{className:"unity-desktop__context-menu-backdrop",style:{position:"absolute",inset:"0",zIndex:"9000"},onClick:W},o("div",{className:"unity-desktop__context-menu",style:{position:"absolute",top:`${D.y}px`,left:`${D.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:de=>de.stopPropagation()},...Ce))})(),ye=$?t.find(ne=>ne.id===$):null,le=ye?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:()=>A(null)},o("div",{style:{backgroundColor:"#2d2d2d",border:"1px solid #555",borderRadius:"8px",padding:"24px",minWidth:"280px",color:"#ffffff",textAlign:"center"},onClick:ne=>ne.stopPropagation()},o("div",{style:{fontSize:"18px",fontWeight:"600",marginBottom:"8px"}},ye.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:()=>A(null)},"Close"))):null;return o("div",{className:"unity-desktop",style:G,"data-theme":s},o("div",{className:"unity-desktop__top-panel",style:{flexShrink:"0",zIndex:"10"}},U),o("div",{style:O},o("div",{className:"unity-desktop__dock",style:Y},Z),o("main",{className:"unity-desktop__desktop",style:{flex:"1",position:"relative",overflow:"hidden",minHeight:"0"}},se,ce)),ge,le,me)}function cs(e){let{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s="dark",children:a}=e;return o(Qt,{onWindowOpen:r},o(Dt,null,o(zt,null,o(jd,{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s,children:a}))))}function ds(e){let{id:t,title:n,icon:r,defaultPosition:i,defaultSize:s,minSize:a,resizable:l=!0,onClose:d,menuBar:u,statusBar:h,onActivate:p,onDeactivate:c,children:m}=e,f=vt(),b=q(()=>f.windows.find(A=>A.id===t),[f.windows,t]);re(()=>(u?f.setMenuBar(t,u):f.clearMenuBar(t),()=>{f.clearMenuBar(t)}),[u,t,f]);let y=te(!1),g=b?b.focused:!1;re(()=>{let A=y.current;y.current=g,g&&!A?p&&p():!g&&A&&c&&c()},[g,p,c]);let x=S(()=>{f.closeWindow(t),d&&d()},[f,t,d]),v=S(()=>{f.focusWindow(t)},[f,t]),R=S(A=>{f.moveWindow(t,A)},[f,t]),D=S(A=>{f.resizeWindow(t,A)},[f,t]),M=S(()=>{f.minimizeWindow(t)},[f,t]),$=S(()=>{b&&b.windowState==="maximized"?f.restoreWindow(t):f.maximizeWindow(t)},[f,t,b]);return b?o(it,{appId:t},o(kt,{id:t,title:n,icon:r,defaultPosition:b.position,defaultSize:b.size,minSize:a,resizable:l,windowState:b.windowState,focused:b.focused,zIndex:b.zIndex,onClose:x,onFocus:v,onMove:R,onResize:D,onMinimize:M,onMaximize:$,statusBar:h,children:m})):(f.openWindow({id:t,title:n,icon:r,position:i,size:s}),null)}function Gd(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 bo(e,t,n){return!e||(!n||t.container_id!==n)&&t.name===e?!1:!Gd(t.contents,n).has(e)}function us(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 ps(e,t,n){return bo(e,t,n)}function fs(e){let{value:t,onChange:n,orientation:r="vertical",inputPosition:i="below",delimiter:s,placeholder:a="Add item...",disabled:l=!1,label:d,maxItems:u}=e,h=s??(r==="horizontal"?", ":`
|
|
9
|
+
`),p=q(()=>Array.from(new Set(t)),[t]),[c,m]=j({type:"closed"}),[f,b]=j(""),[y,g]=j(!1),x=te(null),v=S(()=>{l||u!==void 0&&p.length>=u||(m({type:"add"}),b(""),g(!1))},[l,u,p.length]),R=S(W=>{l||(m({type:"edit",index:W,original:p[W]}),b(p[W]),g(!1))},[l,p]),D=S(()=>{m({type:"closed"}),b(""),g(!1)},[]),M=S(()=>{let W=f.trim();if(W){if(c.type==="add"){if(p.includes(W)){g(!0),b("");return}n([...p,W]),b(""),g(!1)}else if(c.type==="edit"){if(W===c.original){D();return}if(p.includes(W)){g(!0);return}let V=p.slice();V[c.index]=W,n(V),D()}}},[f,c,p,n,D]),$=S(()=>{if(c.type==="edit"){let W=p.filter((V,K)=>K!==c.index);n(W),D()}},[c,p,n,D]),A=S(W=>{let V=W.key;V==="Enter"?(W.preventDefault(),M()):V==="Escape"&&(W.preventDefault(),D())},[M,D]),I=S(W=>{if(l)return;W.key==="+"&&c.type==="closed"&&(W.preventDefault(),v())},[l,c,v]),P={display:"flex",flexDirection:"column",gap:"4px"},L={display:"flex",flexDirection:r==="vertical"?"column":"row",flexWrap:r==="horizontal"?"wrap":"nowrap",gap:r==="vertical"?"2px":"0",alignItems:r==="horizontal"?"center":"stretch"},E={padding:"4px 8px",cursor:l?"default":"pointer",borderRadius:"4px",fontSize:"14px",color:"#1f2937",backgroundColor:"transparent",transition:"background-color 0.1s",border:"1px solid transparent",userSelect:"none"},B={display:"inline-flex",alignItems:"center",justifyContent:"center",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",cursor:l?"not-allowed":"pointer",fontSize:"16px",fontWeight:"700",lineHeight:"1",padding:"4px 10px",color:"#374151",transition:"background-color 0.15s, border-color 0.15s"},z={display:"flex",alignItems:"center",gap:"4px"},k=Ve({},{focused:!1,error:y}),w=[];for(let W=0;W<p.length;W++){let V=p[W];r==="horizontal"&&W>0&&w.push(o("span",{key:`delim-${W}`,style:{color:"#9ca3af",fontSize:"14px",userSelect:"none"},"aria-hidden":"true"},h)),w.push(o("span",{key:`item-${W}`,role:"listitem",tabIndex:l?-1:0,style:E,onClick:l?void 0:()=>R(W),onKeyDown:l?void 0:K=>{K.key==="Enter"&&R(W)}},V))}let T=o("div",{role:"list",style:L},...w),C=l||u!==void 0&&p.length>=u,N=o("button",{type:"button","aria-label":"Add item",style:{...B,opacity:C?"0.5":"1",cursor:C?"not-allowed":"pointer"},disabled:C,onClick:C?void 0:v},"+"),F=null;if(c.type!=="closed"){let W=o("button",{type:"button","aria-label":"Confirm",style:{...B,fontSize:"13px",padding:"4px 8px"},onClick:M},"OK"),V=c.type==="edit"?o("button",{type:"button","aria-label":"Delete",style:{...B,fontSize:"13px",padding:"4px 8px",color:"#ef4444"},onClick:$},"X"):null;F=o("div",{style:z,className:"buildable-list__input-row"},o("input",{ref:x,type:"text",value:f,placeholder:a,"aria-label":c.type==="edit"?"Edit item":"New item",style:{...k,flex:"1",minWidth:"0"},autoFocus:!0,onInput:K=>{b(K.target.value),g(!1)},onKeyDown:A}),W,V)}let _=[];c.type!=="closed"&&i==="above"&&_.push(F),_.push(o("div",{style:{display:"flex",alignItems:"flex-start",gap:"8px"}},T,N)),c.type!=="closed"&&i==="below"&&_.push(F);let H=o("div",{style:P,tabIndex:0,onKeyDown:I,className:"buildable-list"},..._);return o(Pe,{label:d,disabled:l},H)}var ms={sm:{padding:"3px 10px",fontSize:"12px",borderRadius:"4px"},md:{padding:"6px 14px",fontSize:"13px",borderRadius:"6px"},lg:{padding:"8px 20px",fontSize:"15px",borderRadius:"6px"}},gs={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 hs(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:p=!1}=e,c=q(()=>{let m=ms[i]??ms.md,f=gs[r]??gs.secondary,b={padding:m.padding,fontSize:m.fontSize,borderRadius:m.borderRadius,border:`1px solid ${f.border}`,backgroundColor:p?"#3b82f6":f.bg,color:p?"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&&(b.width="100%"),u&&Object.assign(b,u),b},[r,i,s,a,p,u]);return o("button",{type:l,onClick:s?void 0:n,disabled:s,className:d,style:c,"aria-label":h,"aria-pressed":p?"true":void 0},t)}var Xd=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],It=Math.PI/180;function Kd(e,t,n,r,i,s,a,l,d,u){let h=Math.cos(r*It),p=Math.sin(r*It),c=Math.cos(i*It),m=Math.sin(i*It),f=Math.cos(s*It),b=Math.sin(s*It),y=e*f-t*b,g=e*b+t*f,x=y*c-g*m,v=y*m+g*c,R=n,D=x,M=v*h-R*p,$=v*p+R*h,A=1+a*.001*$,I=l+D*u*A,P=d-M*u*A;return{sx:I,sy:P,depth:$}}function bs(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 xs(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 ys(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:p=Xd,gridColor:c="#94a3b8",title:m}=e,f=q(()=>{let z=0,k=0,w=0;for(let T=0;T<t.length;T++){let C=t[T],N=C.data.length;N>z&&(z=N);for(let F=0;F<N;F++){let _=C.data[F].length;_>k&&(k=_);for(let H=0;H<_;H++){let W=Math.abs(C.data[F][H]??0);W>w&&(w=W)}}}return{maxRows:Math.max(z,1),maxCols:Math.max(k,1),maxHeight:w>0?w:1}},[t]),b=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]),y=n/2,g=r/2,x=S((z,k,w)=>Kd(z,k,w,s,a,l,i,y,g,b),[s,a,l,i,y,g,b]),v=S(()=>{if(!u)return[];let z=[],k=Math.max(f.maxCols,f.maxRows),w=f.maxCols/2,T=f.maxRows/2,C=x(-w,-T,0),N=x(w,-T,0);z.push(o("line",{key:"axis-x",x1:String(C.sx),y1:String(C.sy),x2:String(N.sx),y2:String(N.sy),stroke:"#374151","stroke-width":"1.5"})),z.push(o("text",{key:"axis-x-label",x:String(N.sx+8),y:String(N.sy+4),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"X"));let F=x(-w,T,0);z.push(o("line",{key:"axis-y",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-y-label",x:String(F.sx-12),y:String(F.sy+4),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Y"));let _=f.maxHeight+(t.length-1)*h,H=x(-w,-T,_);return z.push(o("line",{key:"axis-z",x1:String(C.sx),y1:String(C.sy),x2:String(H.sx),y2:String(H.sy),stroke:"#374151","stroke-width":"1.5"})),z.push(o("text",{key:"axis-z-label",x:String(H.sx-4),y:String(H.sy-8),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Z")),z},[u,f,t.length,h,x]),R=S(()=>{let z=[],k=f.maxCols/2,w=f.maxRows/2,T=[];for(let C=0;C<t.length;C++){let N=t[C],F=N.color??p[C%p.length],_=N.opacity??.7,H=C*h,W=N.data.length;for(let V=0;V<W-1;V++){let K=N.data[V],Q=N.data[V+1],G=Math.min(K.length,Q.length);for(let O=0;O<G-1;O++){let Y=O-k,X=O+1-k,U=V-w,Z=V+1-w,ee=(K[O]??0)+H,ae=(K[O+1]??0)+H,J=(Q[O]??0)+H,se=(Q[O+1]??0)+H,ce=x(Y,U,ee),me=x(X,U,ae),ge=x(Y,Z,J),ye=x(X,Z,se),le=(ce.depth+me.depth+ge.depth+ye.depth)/4,ne=`${ce.sx},${ce.sy} ${me.sx},${me.sy} ${ye.sx},${ye.sy} ${ge.sx},${ge.sy}`;T.push({points:ne,fill:bs(F,_),stroke:xs(F,.7),strokeWidth:"0.5",depth:le,key:`quad-${C}-${V}-${O}`})}}if(W===1||W>0&&N.data[0].length===1)for(let V=0;V<W;V++){let K=N.data[V];for(let Q=0;Q<K.length;Q++){let G=Q-k,O=V-w,Y=(K[Q]??0)+H,X=x(G,O,Y),U=3,Z=`${X.sx},${X.sy-U} ${X.sx+U},${X.sy} ${X.sx},${X.sy+U} ${X.sx-U},${X.sy}`;T.push({points:Z,fill:bs(F,_),stroke:xs(F,.7),strokeWidth:"0.5",depth:X.depth,key:`point-${C}-${V}-${Q}`})}}}T.sort((C,N)=>C.depth-N.depth);for(let C=0;C<T.length;C++){let N=T[C];z.push(o("polygon",{key:N.key,points:N.points,fill:N.fill,stroke:N.stroke,"stroke-width":N.strokeWidth,"stroke-linejoin":"round"}))}return z},[t,f,h,p,x]),D=S(()=>{let z=[],k=f.maxCols/2,w=f.maxRows/2;for(let T=0;T<=f.maxRows;T++){let C=T-w,N=x(-k,C,0),F=x(k,C,0);z.push(o("line",{key:`base-h-${T}`,x1:String(N.sx),y1:String(N.sy),x2:String(F.sx),y2:String(F.sy),stroke:c,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}for(let T=0;T<=f.maxCols;T++){let C=T-k,N=x(C,-w,0),F=x(C,w,0);z.push(o("line",{key:`base-v-${T}`,x1:String(N.sx),y1:String(N.sy),x2:String(F.sx),y2:String(F.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 T=0;T<t.length;T++){let C=t[T],N=T*h,F=0,_=0;for(let K=0;K<C.data.length;K++){let Q=C.data[K];for(let G=0;G<Q.length;G++)F+=Q[G]??0,_++}let H=_>0?F/_:0,W=x(k+1,0,H+N),V=C.color??p[T%p.length];z.push(o("text",{key:`layer-label-${T}`,x:String(W.sx+8),y:String(W.sy+4),"font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:V},C.label))}return z},[d,t,f,h,p,x]),A=S(()=>m?[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"},m)]:[],[m,n])(),I=D(),P=v(),L=R(),E=M(),B=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":m??"3D layer visualization",style:{fontFamily:"sans-serif",maxWidth:"100%"}},...A,...B,...I,...P,...L,...E)}function qd(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 Zd(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 Ss(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:p="#22c55e",trendDownColor:c="#ef4444",backgroundColor:m="#ffffff"}=e,f=q(()=>qd(t),[t]),b=s!=null&&isFinite(s)&&!isNaN(s),y=l!=null&&l.length>1,g=n!=null&&n.length>0,x=b&&s>=0?p:c,v=20,R=g?u*.38:u*.45,D=Math.min(d*.15,48),M=D*.55,$=R+D*.4+8,A=g?$+22:R+D*.4+22,I=y?Math.min(u*.22,36):0,P=u-v-I,L=d-v*2,E=S(()=>[o("rect",{key:"bg",x:"0",y:"0",width:"100%",rx:"8",ry:"8",fill:m,stroke:"#e5e7eb","stroke-width":"1"})],[d,u,m]),B=S(()=>{let W=[],V=r+f+i;return W.push(o("text",{key:"value",x:String(d/2),y:String(R),"text-anchor":"middle","dominant-baseline":"central","font-size":String(D),"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)),W},[d,R,D,M,f,r,i,h]),z=S(()=>g?[o("text",{key:"label",x:String(d/2),y:String($),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},n)]:[],[g,d,$,n]),k=S(()=>{if(!b)return[];let W=[],V=s,K=V>=0,Q=8,G=Zd(V),O=(K?"+":"-")+G+(a?" "+a:""),Y=d/2-40,X=A;if(K){let U=`${Y},${X} ${Y-Q/2},${X+Q} ${Y+Q/2},${X+Q}`;W.push(o("polygon",{key:"trend-arrow",points:U,fill:x}))}else{let U=`${Y},${X+Q} ${Y-Q/2},${X} ${Y+Q/2},${X}`;W.push(o("polygon",{key:"trend-arrow",points:U,fill:x}))}return W.push(o("text",{key:"trend-text",x:String(Y+Q+4),y:String(X+Q*.7),"text-anchor":"start","font-size":"12","font-family":"sans-serif",fill:x,"aria-label":`Trend: ${O}`},O)),W},[b,s,a,x,d,A]),w=S(()=>{if(!y)return[];let W=[],V=l,K=[];for(let ee of V)typeof ee=="number"&&isFinite(ee)&&!isNaN(ee)&&K.push(ee);if(K.length<2)return[];let Q=1/0,G=-1/0;for(let ee of K)ee<Q&&(Q=ee),ee>G&&(G=ee);Q===G&&(Q-=1,G+=1);let O=G-Q,Y=L/(K.length-1),X="";for(let ee=0;ee<K.length;ee++){let ae=v+ee*Y,J=P+I-(K[ee]-Q)/O*I;ee===0?X+=`M ${ae} ${J}`:X+=` L ${ae} ${J}`}let U=v+(K.length-1)*Y,Z=X+` L ${U} ${P+I} L ${v} ${P+I} Z`;return W.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"})))),W.push(o("path",{key:"spark-fill",d:Z,fill:"url(#sparkGrad)"})),W.push(o("path",{key:"spark-line",d:X,fill:"none",stroke:"#3b82f6","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})),W},[y,l,L,P,I,v]),T=E(),C=B(),N=z(),F=k(),_=w(),H=`${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":H,style:{fontFamily:"sans-serif"}},...T,..._,...C,...N,...F)}var Cn=Math.PI/180;function Jd(e,t,n,r,i,s,a,l){let d=Math.cos(r*Cn),u=Math.sin(r*Cn),h=Math.cos(i*Cn),p=Math.sin(i*Cn),c=e*h+n*p,m=-e*p+n*h,f=t*d-m*u,b=t*u+m*d;return{sx:s+c*l,sy:a-f*l,depth:b}}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 Mn(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),Mn(d,u,h)}function xo(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 Mn(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 vs(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:p=!0,showWireframe:c=!0,showTrail:m=!0,trailMaxPoints:f=200,trailColor:b="#ef4444",wireframeColor:y="#cbd5e1",vectorColor:g="#3b82f6",backgroundColor:x,sphereRadius:v=130,title:R,onStateChange:D}=e,[M,$]=j(t??{theta:0,phi:0}),[A,I]=j(s),[P,L]=j(a),[E,B]=j(l),z=te([]),k=te(!1),w=te(null),T=te(null);re(()=>{t&&$(t)},[t?.theta,t?.phi]);let C=te(0);re(()=>{if(!n||n.length===0)return;C.current=0;let Y=0,X=()=>{C.current>=n.length||($(U=>{let Z=xo(U,n[C.current]);return C.current++,D&&D(Z),Z}),Y=requestAnimationFrame(X))};return Y=requestAnimationFrame(X),()=>cancelAnimationFrame(Y)},[n]),re(()=>{let Y=Rt(M);z.current.push(Y),z.current.length>f&&z.current.splice(0,z.current.length-f)},[M.theta,M.phi]);let N=v*E,F=r/2,_=i/2,H=S((Y,X,U)=>Jd(Y,X,U,P,A,F,_,N),[P,A,F,_,N]),W=S(Y=>{if(!d)return;let X=Y;k.current=!0,w.current={mx:X.clientX,my:X.clientY,rx:P,ry:A}},[d,P,A]),V=S(Y=>{if(!k.current||!w.current)return;let X=Y,U=w.current;I(U.ry+(X.clientX-U.mx)*.5),L(U.rx-(X.clientY-U.my)*.5)},[]),K=S(()=>{k.current=!1},[]),Q=S(Y=>{if(!u)return;let X=Y;X.preventDefault(),B(U=>Math.max(.5,Math.min(3,U*(X.deltaY>0?.95:1.05))))},[u]),G=[];if(x&&G.push(o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:x,rx:"6"})),R&&G.push(o("text",{key:"title",x:String(F),y:"24","text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},R)),c){let X=[];for(let ee=0;ee<=60;ee++){let ae=ee/60*2*Math.PI,J=H(Math.cos(ae),Math.sin(ae),0);X.push(`${ee===0?"M":"L"}${J.sx.toFixed(1)},${J.sy.toFixed(1)}`)}G.push(o("path",{key:"eq",d:X.join(" "),fill:"none",stroke:y,"stroke-width":"0.8",opacity:"0.5"}));let U=[];for(let ee=0;ee<=60;ee++){let ae=ee/60*2*Math.PI,J=H(Math.cos(ae),0,Math.sin(ae));U.push(`${ee===0?"M":"L"}${J.sx.toFixed(1)},${J.sy.toFixed(1)}`)}G.push(o("path",{key:"xz",d:U.join(" "),fill:"none",stroke:y,"stroke-width":"0.8",opacity:"0.4"}));let Z=[];for(let ee=0;ee<=60;ee++){let ae=ee/60*2*Math.PI,J=H(0,Math.cos(ae),Math.sin(ae));Z.push(`${ee===0?"M":"L"}${J.sx.toFixed(1)},${J.sy.toFixed(1)}`)}G.push(o("path",{key:"yz",d:Z.join(" "),fill:"none",stroke:y,"stroke-width":"0.8",opacity:"0.4"}))}let O=[{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 Y of O){let X=H(Y.dir[0]*1.15,Y.dir[1]*1.15,Y.dir[2]*1.15),U=H(-Y.dir[0]*1.15,-Y.dir[1]*1.15,-Y.dir[2]*1.15),Z=H(0,0,0);G.push(o("line",{key:`axis-${Y.id}`,x1:String(U.sx),y1:String(U.sy),x2:String(X.sx),y2:String(X.sy),stroke:Y.color,"stroke-width":"0.8",opacity:"0.4","stroke-dasharray":"3 3"}))}if(p){let Y=[{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 X of Y){let U=H(X.pos[0],X.pos[1],X.pos[2]);G.push(o("text",{key:`lbl-${X.text}`,x:String(U.sx),y:String(U.sy),"text-anchor":"middle","dominant-baseline":"central","font-size":"11","font-family":"serif",fill:"#475569",style:{pointerEvents:"none"}},X.text))}}if(m&&z.current.length>1){let Y=z.current,X=[];for(let U=0;U<Y.length;U++){let Z=Y[U],ee=H(Z.x,Z.y,Z.z);X.push(`${U===0?"M":"L"}${ee.sx.toFixed(1)},${ee.sy.toFixed(1)}`)}G.push(o("path",{key:"trail",d:X.join(" "),fill:"none",stroke:b,"stroke-width":"1.5",opacity:"0.5","stroke-linecap":"round","stroke-linejoin":"round"}))}if(h){let Y=Rt(M),X=H(0,0,0),U=H(Y.x,Y.y,Y.z);G.push(o("line",{key:"vec-line",x1:String(X.sx),y1:String(X.sy),x2:String(U.sx),y2:String(U.sy),stroke:g,"stroke-width":"2.5","stroke-linecap":"round"})),G.push(o("circle",{key:"vec-point",cx:String(U.sx),cy:String(U.sy),r:"5",fill:g,stroke:"#fff","stroke-width":"1.5"}));let Z=(M.theta*180/Math.PI).toFixed(0),ee=(M.phi*180/Math.PI).toFixed(0);G.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=${ee}\xB0`))}return o("svg",{ref:T,width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":R??"Bloch sphere quantum state visualization",style:{fontFamily:"sans-serif",cursor:d?k.current?"grabbing":"grab":"default"},onMouseDown:d?W:void 0,onMouseMove:d?V:void 0,onMouseUp:d?K:void 0,onMouseLeave:d?K:void 0,onWheel:u?Q:void 0},...G)}function Qd(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 yo(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 So(e){let t=Qd(e);if(t.length===0)return null;let n=yo(t,25),r=yo(t,50),i=yo(t,75),s=i-n,a=n-1.5*s,l=i+1.5*s,d=t[0];for(let m of t)if(m>=a){d=m;break}let u=t[t.length-1];for(let m=t.length-1;m>=0;m--)if(t[m]<=l){u=t[m];break}let h=0;for(let m of t)h+=m;let p=h/t.length,c=[];for(let m of t)(m<a||m>l)&&c.push(m);return{q1:n,median:r,q3:i,iqr:s,whiskerLow:d,whiskerHigh:u,mean:p,outliers:c,min:t[0],max:t[t.length-1]}}function eu(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 ws(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:p=60}=e,c=i==="vertical",m=n-p*2,f=r-p*2,b=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],y=q(()=>{let w=[];for(let T of t)w.push(So(T.values));return w},[t]),g=q(()=>{let w=1/0,T=-1/0;for(let F of y){if(F===null)continue;let _=s&&F.outliers.length>0?Math.min(F.whiskerLow,F.outliers[0]):F.whiskerLow,H=s&&F.outliers.length>0?Math.max(F.whiskerHigh,F.outliers[F.outliers.length-1]):F.whiskerHigh;_<w&&(w=_),H>T&&(T=H)}isFinite(w)||(w=0,T=1);let C=T-w,N=C>0?C*.05:.5;return{min:w-N,max:T+N}},[y,s]),x=c?f:m,v=c?m:f,R=t.length>0?t.length:1,D=v/R,M=D*Math.min(Math.max(d,.1),.95),$=S(w=>{let T=g.max-g.min;return T===0?x/2:(w-g.min)/T*x},[g,x]),A=S(()=>{if(!u)return[];let w=[],T=g.max-g.min,C=eu(T),N=Math.ceil(g.min/C)*C;for(let F=N;F<=g.max;F+=C){let _=$(F),H=String(Math.round(F*1e3)/1e3);if(c){let W=p+f-_;w.push(o("line",{key:`grid-${F}`,x1:String(p),y1:String(W),x2:String(p+m),y2:String(W),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`glabel-${F}`,x:String(p-6),y:String(W+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},H))}else{let W=p+_;w.push(o("line",{key:`grid-${F}`,x1:String(W),y1:String(p),x2:String(W),y2:String(p+f),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`glabel-${F}`,x:String(W),y:String(p+f+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},H))}}return w},[u,g,$,c,p,m,f]),I=S(()=>{let w=[];return w.push(o("line",{key:"axis-value",x1:String(p),y1:String(c?p:p+f),x2:String(p),y2:String(p+f),stroke:"#374151","stroke-width":"1.5"})),w.push(o("line",{key:"axis-category",x1:String(p),y1:String(p+f),x2:String(p+m),y2:String(p+f),stroke:"#374151","stroke-width":"1.5"})),w},[p,m,f,c]),P=S(()=>{let w=[];for(let T=0;T<t.length;T++){let C=y[T];if(C===null)continue;let N=t[T],F=N.color??b[T%b.length],_=D*T+D/2,H=M/2;if(c){let W=p+f-$(C.q1),V=p+f-$(C.q3),K=p+f-$(C.median),Q=p+f-$(C.whiskerLow),G=p+f-$(C.whiskerHigh),O=p+_;w.push(o("line",{key:`wl-${T}`,x1:String(O),y1:String(W),x2:String(O),y2:String(Q),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wlc-${T}`,x1:String(O-H*.4),y1:String(Q),x2:String(O+H*.4),y2:String(Q),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wh-${T}`,x1:String(O),y1:String(V),x2:String(O),y2:String(G),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`whc-${T}`,x1:String(O-H*.4),y1:String(G),x2:String(O+H*.4),y2:String(G),stroke:l,"stroke-width":"1.5"}));let Y=Math.min(W,V),X=Math.abs(W-V);if(w.push(o("rect",{key:`box-${T}`,x:String(O-H),y:String(Y),width:String(M),height:String(Math.max(X,1)),fill:F,stroke:l,"stroke-width":"1.5",opacity:"0.8","aria-label":`${N.label}: Q1=${C.q1.toFixed(1)}, median=${C.median.toFixed(1)}, Q3=${C.q3.toFixed(1)}`,role:"img"})),w.push(o("line",{key:`med-${T}`,x1:String(O-H),y1:String(K),x2:String(O+H),y2:String(K),stroke:"#fff","stroke-width":"2.5"})),a){let U=p+f-$(C.mean);w.push(o("circle",{key:`mean-${T}`,cx:String(O),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 U=0;U<C.outliers.length;U++){let Z=p+f-$(C.outliers[U]);w.push(o("circle",{key:`out-${T}-${U}`,cx:String(O),cy:String(Z),r:"3",fill:"none",stroke:l,"stroke-width":"1.5","aria-label":`Outlier: ${C.outliers[U]}`}))}w.push(o("text",{key:`cat-${T}`,x:String(O),y:String(p+f+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},N.label))}else{let W=p+$(C.q1),V=p+$(C.q3),K=p+$(C.median),Q=p+$(C.whiskerLow),G=p+$(C.whiskerHigh),O=p+_;w.push(o("line",{key:`wl-${T}`,x1:String(W),y1:String(O),x2:String(Q),y2:String(O),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wlc-${T}`,x1:String(Q),y1:String(O-H*.4),x2:String(Q),y2:String(O+H*.4),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wh-${T}`,x1:String(V),y1:String(O),x2:String(G),y2:String(O),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`whc-${T}`,x1:String(G),y1:String(O-H*.4),x2:String(G),y2:String(O+H*.4),stroke:l,"stroke-width":"1.5"}));let Y=Math.min(W,V),X=Math.abs(V-W);if(w.push(o("rect",{key:`box-${T}`,x:String(Y),y:String(O-H),width:String(Math.max(X,1)),height:String(M),fill:F,stroke:l,"stroke-width":"1.5",opacity:"0.8","aria-label":`${N.label}: Q1=${C.q1.toFixed(1)}, median=${C.median.toFixed(1)}, Q3=${C.q3.toFixed(1)}`,role:"img"})),w.push(o("line",{key:`med-${T}`,x1:String(K),y1:String(O-H),x2:String(K),y2:String(O+H),stroke:"#fff","stroke-width":"2.5"})),a){let U=p+$(C.mean);w.push(o("circle",{key:`mean-${T}`,cx:String(U),cy:String(O),r:"3.5",fill:"#fff",stroke:l,"stroke-width":"1.5","aria-label":`Mean: ${C.mean.toFixed(1)}`}))}if(s)for(let U=0;U<C.outliers.length;U++){let Z=p+$(C.outliers[U]);w.push(o("circle",{key:`out-${T}-${U}`,cx:String(Z),cy:String(O),r:"3",fill:"none",stroke:l,"stroke-width":"1.5","aria-label":`Outlier: ${C.outliers[U]}`}))}w.push(o("text",{key:`cat-${T}`,x:String(p-6),y:String(O+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},N.label))}}return w},[t,y,$,c,p,m,f,D,M,l,s,a,b]),L=S(()=>h?[o("text",{key:"title",x:String(n/2),y:String(p/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,n,p]),E=A(),B=I(),z=P(),k=L();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,...B,...z)}function ks(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 tu(e,t,n){return e<t?t:e>n?n:e}function vo(e){return typeof e=="number"&&isFinite(e)&&!isNaN(e)}function Cs(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:p="#3b82f6",opacity:c=.7,title:m,padding:f=60}=e,b=q(()=>{let z=[];for(let k=0;k<t.length;k++){let w=t[k];vo(w.x)&&vo(w.y)&&vo(w.r)&&z.push(w)}return z},[t]),y=n-f*2,g=r-f*2,x=q(()=>{if(b.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,T=-1/0,C=1/0,N=-1/0;for(let F of b)F.x<z&&(z=F.x),F.x>k&&(k=F.x),F.y<w&&(w=F.y),F.y>T&&(T=F.y),F.r<C&&(C=F.r),F.r>N&&(N=F.r);return z===k&&(z-=1,k+=1),w===T&&(w-=1,T+=1),C===N&&(C=0,N=N>0?N:1),{xMin:z,xMax:k,yMin:w,yMax:T,rMin:C,rMax:N}},[b]),v=S(z=>{let k=x.xMax-x.xMin;return f+(z-x.xMin)/k*y},[x,f,y]),R=S(z=>{let k=x.yMax-x.yMin;return f+g-(z-x.yMin)/k*g},[x,f,g]),D=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=ks(x.xMax-x.xMin),w=Math.ceil(x.xMin/k)*k;for(let N=w;N<=x.xMax;N+=k){let F=v(N);z.push(o("line",{key:`grid-x-${N}`,x1:String(F),y1:String(f),x2:String(F),y2:String(f+g),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),z.push(o("text",{key:`grid-xlabel-${N}`,x:String(F),y:String(f+g+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(N*1e3)/1e3)))}let T=ks(x.yMax-x.yMin),C=Math.ceil(x.yMin/T)*T;for(let N=C;N<=x.yMax;N+=T){let F=R(N);z.push(o("line",{key:`grid-y-${N}`,x1:String(f),y1:String(F),x2:String(f+y),y2:String(F),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),z.push(o("text",{key:`grid-ylabel-${N}`,x:String(f-6),y:String(F+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(N*1e3)/1e3)))}return z},[a,x,v,R,f,y,g]),$=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+g),stroke:"#374151","stroke-width":"1.5"})),z.push(o("line",{key:"axis-x",x1:String(f),y1:String(f+g),x2:String(f+y),y2:String(f+g),stroke:"#374151","stroke-width":"1.5"})),i&&z.push(o("text",{key:"x-label",x:String(f+y/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,y,g,i,s]),A=S(()=>{let z=[];for(let k=0;k<b.length;k++){let w=b[k],T=v(w.x),C=R(w.y),N=tu(D(w.r),h,u),F=w.color??p;z.push(o("circle",{key:`bubble-${k}`,cx:String(T),cy:String(C),r:String(N),fill:F,opacity:String(c),stroke:F,"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(T),y:String(C-N-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},w.label))}return z},[b,v,R,D,p,c,d,h,u]),I=S(()=>m?[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"},m)]:[],[m,n,f]),P=M(),L=$(),E=A(),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":m??"Bubble chart",style:{fontFamily:"sans-serif"}},...B,...P,...L,...E)}var nu=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ou=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function ru(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 Ms(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 Es(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 iu(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 su(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=Es(t[i]),l=Es(t[i+1]);return iu(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}var au=["#9be9a8","#40c463","#30a14e","#216e39"];function Is(e){let{data:t=[],width:n=800,height:r=160,colorScale:i=au,cellSize:s=12,cellGap:a=2,showMonthLabels:l=!0,showDayLabels:d=!0,emptyColor:u="#ebedf0",title:h}=e,{dateMap:p,startDate:c,endDate:m,maxVal:f}=q(()=>{let E=new Map,B=0,z=null,k=null;for(let C of t){let N=ru(C.date);if(isNaN(N.getTime()))continue;let F=Ms(N);E.set(F,(E.get(F)??0)+C.value);let _=E.get(F);_>B&&(B=_),(z===null||N<z)&&(z=N),(k===null||N>k)&&(k=N)}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 T=new Date(k);return T.setDate(T.getDate()+(6-T.getDay())),{dateMap:E,startDate:w,endDate:T,maxVal:B>0?B:1}},[t]),b=d?30:0,y=l?16:0,g=h?28:0,x=b+10,v=g+y+4,R=S(()=>{let E=[],B=new Date(c),z=0;for(;B<=m;){let k=B.getDay();k===0&&B>c&&z++;let w=Ms(B),T=p.get(w),C=T!==void 0&&T>0?su(T/f,i):u,N=x+z*(s+a),F=v+k*(s+a);E.push(o("rect",{key:`day-${w}`,x:String(N),y:String(F),width:String(s),height:String(s),rx:"2",ry:"2",fill:C,"aria-label":`${w}: ${T??0}`})),B.setDate(B.getDate()+1)}return E},[c,m,p,f,i,u,s,a,x,v]),D=S(()=>{if(!l)return[];let E=[],B=new Date(c),z=0,k=-1;for(;B<=m;){let w=B.getDay();w===0&&B>c&&z++;let T=B.getMonth();if(T!==k&&w===0){k=T;let C=x+z*(s+a);E.push(o("text",{key:`month-${z}`,x:String(C),y:String(g+y-2),"font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},nu[T]))}B.setDate(B.getDate()+1)}return E},[l,c,m,s,a,x,g,y]),M=S(()=>{if(!d)return[];let E=[],B=[1,3,5];for(let z of B){let k=v+z*(s+a)+s/2;E.push(o("text",{key:`day-label-${z}`,x:String(b),y:String(k),"text-anchor":"end","dominant-baseline":"central","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},ou[z]))}return E},[d,s,a,v,b]),$=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 A=$(),I=D(),P=M(),L=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":h??"Calendar heat map",style:{fontFamily:"sans-serif"}},...A,...I,...P,...L)}var lu=["#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 cu(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),p=s-i>Math.PI?1:0;return[`M ${a.x} ${a.y}`,`A ${n} ${n} 0 ${p} 1 ${l.x} ${l.y}`,`L ${u.x} ${u.y}`,`A ${r} ${r} 0 ${p} 0 ${d.x} ${d.y}`,"Z"].join(" ")}function du(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),p=i-r,c=a-s,m=p>Math.PI?1:0,f=c>Math.PI?1:0;return[`M ${l.x} ${l.y}`,`A ${n} ${n} 0 ${m} 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 uu(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 m=0;for(let f=0;f<i;f++){let b=e[c]?.[f]??0;m+=Math.max(0,b)}s.push(m),a+=m}if(a===0){let c=(2*Math.PI-i*r)/Math.max(i,1),m=[],f=0;for(let b=0;b<i;b++)m.push({index:b,label:t[b]??`Group ${b}`,color:n[b%n.length],startAngle:f,endAngle:f+c,value:0}),f+=c+r;return{groups:m,chords:[]}}let l=2*Math.PI-i*r,d=[],u=0;for(let c=0;c<i;c++){let m=s[c]/a*l;d.push({index:c,label:t[c]??`Group ${c}`,color:n[c%n.length],startAngle:u,endAngle:u+m,value:s[c]}),u+=m+r}let h=[];for(let c=0;c<i;c++)h.push(d[c].startAngle);let p=[];for(let c=0;c<i;c++)for(let m=c;m<i;m++){let f=Math.max(0,e[c]?.[m]??0),b=c===m?0:Math.max(0,e[m]?.[c]??0);if(f===0&&b===0)continue;let y=f+b,g=s[c]>0?f/a*l:0,x=h[c],v=x+g;h[c]=v;let R=s[m]>0?f/a*l:0,D=h[m],M=D+R;if(h[m]=M,c===m){f>0&&p.push({sourceIndex:c,targetIndex:m,sourceStartAngle:x,sourceEndAngle:v,targetStartAngle:D,targetEndAngle:M,value:f,color:d[c].color});continue}let $=s[m]>0?b/a*l:0,I=h[m]+$;h[m]=I;let P=s[c]>0?b/a*l:0,E=h[c]+P;h[c]=E,(f>0||b>0)&&p.push({sourceIndex:c,targetIndex:m,sourceStartAngle:x,sourceEndAngle:Math.max(v,x+.001),targetStartAngle:D,targetEndAngle:Math.max(M,D+.001),value:y,color:d[c].color})}return{groups:d,chords:p}}function Rs(e){let{matrix:t,labels:n,width:r=600,height:i=600,colors:s=lu,padAngle:a=.05,showLabels:l=!0,showValues:d=!1,ribbonOpacity:u=.5,innerRadiusRatio:h=.9,title:p}=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":p??"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,m=i/2,f=Math.min(r,i)/2-40,b=f*Math.max(.5,Math.min(.99,h)),y=f+16,g=q(()=>uu(t,n,s,a),[t,n,s,a]),x=S(()=>{let A=[];for(let I=0;I<g.groups.length;I++){let P=g.groups[I];if(P.endAngle-P.startAngle<.001)continue;let E=cu(c,m,f,b,P.startAngle,P.endAngle);if(A.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 B=(P.startAngle+P.endAngle)/2,z=nt(c,m,y,B),T=((B-Math.PI/2)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)<Math.PI,C=T?"start":"end",N=B*180/Math.PI-90;T||(N+=180);let F=d?`${P.label} (${P.value})`:P.label;A.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(${N}, ${z.x}, ${z.y})`,"dominant-baseline":"central","pointer-events":"none"},F))}}return A},[g,c,m,f,b,y,l,d]),v=S(()=>{let A=[];for(let I=0;I<g.chords.length;I++){let P=g.chords[I],L=du(c,m,b,P.sourceStartAngle,P.sourceEndAngle,P.targetStartAngle,P.targetEndAngle);A.push(o("path",{key:`ribbon-${I}`,d:L,fill:P.color,"fill-opacity":String(u),stroke:P.color,"stroke-width":"0.5","stroke-opacity":"0.3"}))}return A},[g,c,m,b,u]),R=S(()=>p?[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"},p)]:[],[p,r]),D=v(),M=x(),$=R();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Chord diagram",style:{fontFamily:"sans-serif"}},...$,...D,...M)}var pu=["#3b82f6","#22c55e","#f59e0b","#8b5cf6","#ef4444","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function fu(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 p=0;p<u.length;p++)h.push(n+r.length+p);t.push({id:d,node:s,depth:a,parentId:l,childIndices:h});for(let p=0;p<u.length;p++)r.push([u[p],a+1,d])}return{flatNodes:t,maxDepth:i}}function mu(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 gu(e,t,n,r,i,s,a,l){let{flatNodes:d,maxDepth:u}=fu(e);if(d.length===0)return[];let h=mu(d),p=t-s*2,c=n-s*2,m=a==="horizontal",f=u+1,b=m?f>1?(p-r)/u:0:f>1?(c-i)/u:0,y=new Array(d.length),g=h[0],x=m?c:p,v=g>0?x/g:x,R=new Array(d.length);R[0]=[0,g];let D=[0],M=0;for(;M<D.length;){let $=D[M];M++;let A=d[$],[I,P]=R[$],L=(I+P)/2,E=s+A.depth*b,B=s+(L-.5)*v,z=m?E:B,k=m?B:E,w=A.node.color??l[A.depth%l.length];y[$]={id:A.id,label:A.node.label,value:A.node.value!==void 0?String(A.node.value):"",color:w,depth:A.depth,x:z,y:k,parentId:A.parentId,childCount:A.childIndices.length,subtreeLeafCount:h[$]};let T=I;for(let C of A.childIndices)if(C<d.length){let N=h[C],F=T+N;R[C]=[T,F],T=F,D.push(C)}}return y}function Ps(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=pu,title:p,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":p??"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 m=i==="horizontal",f=q(()=>gu(t,n,r,s,a,c,i,h),[t,n,r,s,a,c,i,h]),b=q(()=>{let M=new Map;for(let $=0;$<f.length;$++){let A=f[$];M.set(A.id,A)}return M},[f]),y=S(()=>{if(!d)return[];let M=[];for(let $=0;$<f.length;$++){let A=f[$];if(A.parentId===null)continue;let I=b.get(A.parentId);if(!I)continue;let P,L,E,B;m?(P=I.x+s,L=I.y+a/2,E=A.x,B=A.y+a/2):(P=I.x+s/2,L=I.y+a,E=A.x+s/2,B=A.y);let z=(P+E)/2,k=(L+B)/2,w;m?w=`M ${P} ${L} C ${z} ${L}, ${z} ${B}, ${E} ${B}`:w=`M ${P} ${L} C ${P} ${k}, ${E} ${k}, ${E} ${B}`,M.push(o("path",{key:`conn-${$}`,d:w,fill:"none",stroke:u,"stroke-width":"1.5","stroke-opacity":"0.7"}))}return M},[f,b,m,s,a,d,u]),g=S(()=>{let M=[];for(let $=0;$<f.length;$++){let A=f[$];M.push(o("rect",{key:`node-rect-${A.id}`,x:String(A.x),y:String(A.y),width:String(s),height:String(a),rx:"4",ry:"4",fill:A.color,stroke:"#374151","stroke-width":"1",role:"img","aria-label":A.value?`${A.label}: ${A.value}`:A.label}));let I=l&&A.value?A.y+a/2-2:A.y+a/2+4;M.push(o("text",{key:`node-label-${A.id}`,x:String(A.x+s/2),y:String(I),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#fff","pointer-events":"none"},A.label)),l&&A.value&&M.push(o("text",{key:`node-value-${A.id}`,x:String(A.x+s/2),y:String(A.y+a/2+12),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.85)","pointer-events":"none"},A.value))}return M},[f,s,a,l]),x=S(()=>p?[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"},p)]:[],[p,n]),v=y(),R=g(),D=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":p??"Decomposition tree",style:{fontFamily:"sans-serif"}},...D,...v,...R)}var Ts=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function hu(e){return Ts[e%Ts.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??hu(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 $s(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),p=l/h,c=d/h,m=n-h;if(i.fixed&&a.fixed)continue;i.fixed?(a.x+=p*m,a.y+=c*m):a.fixed?(i.x-=p*m,i.y-=c*m):(i.x-=p*m*.5,i.y-=c*m*.5,a.x+=p*m*.5,a.y+=c*m*.5);let f=i.vx-a.vx,b=i.vy-a.vy,y=f*p+b*c;y<=0||(i.fixed?(a.vx+=y*p,a.vy+=y*c):a.fixed?(i.vx-=y*p,i.vy-=y*c):(i.vx-=y*p,i.vy-=y*c,a.vx+=y*p,a.vy+=y*c))}}}function bu(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 p=new Float64Array(u),c=new Float64Array(u);for(let x=0;x<u;x++){let v=e[x];for(let R=x+1;R<u;R++){let D=e[R],M=v.x-D.x,$=v.y-D.y,A=M*M+$*$;A<1&&(A=1);let I=Math.sqrt(A),P=i/A,L=M/I*P,E=$/I*P;p[x]+=L,c[x]+=E,p[R]-=L,c[R]-=E}}for(let x=0;x<t.length;x++){let v=t[x],R=h.get(v.source),D=h.get(v.target);if(R===void 0||D===void 0)continue;let M=e[R],$=e[D],A=$.x-M.x,I=$.y-M.y,P=Math.sqrt(A*A+I*I);if(P<.1)continue;let L=v.weight??1,E=P-l,B=s*E*L,z=A/P*B,k=I/P*B;p[R]+=z,c[R]+=k,p[D]-=z,c[D]-=k}let m=n/2,f=r/2,b=.001;for(let x=0;x<u;x++){let v=e[x];p[x]+=(m-v.x)*b,c[x]+=(f-v.y)*b}let y=20,g=[];for(let x=0;x<u;x++){let v=e[x];if(v.fixed){g.push({...v,vx:0,vy:0});continue}let R=(v.vx+p[x])*a,D=(v.vy+c[x])*a,M=Math.sqrt(R*R+D*D),$=10;M>$&&(R=R/M*$,D=D/M*$);let A=v.x+R,I=v.y+D;A=Math.max(y,Math.min(n-y,A)),I=Math.max(y,Math.min(r-y,I)),g.push({...v,x:A,y:I,vx:R,vy:D})}return $s(g,d),g}function xu(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 zs(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:p=.01,damping:c=.9,edgeLength:m=100,edgeColor:f="#94a3b8",edgeWidth:b=1.5,title:y,customForce:g,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":y??"Empty force-directed graph"},y?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"},y):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=te(Ds(t,r,i)),[R,D]=j(0),M=te(!0),$=te(!1),A=te(n);A.current=n;let I=te(g);I.current=g;let P=te(null),L=te({repulsionForce:h,attractionForce:p,damping:c,edgeLength:m,width:r,height:i,nodeRadius:s,solidNodes:l});L.current={repulsionForce:h,attractionForce:p,damping:c,edgeLength:m,width:r,height:i,nodeRadius:s,solidNodes:l};let E=te(new Map);re(()=>{v.current=Ds(t,r,i),$.current=!1,M.current=!0,E.current=new Map,D(ae=>ae+1)},[t.length]),re(()=>{let ae=0,J=()=>{if(!M.current)return;let se=L.current,ce=I.current,me;if(ce?(me=ce(v.current,A.current,se.width,se.height,P.current),se.solidNodes&&$s(me,se.nodeRadius)):me=bu(v.current,A.current,se.width,se.height,se.repulsionForce,se.attractionForce,se.damping,se.edgeLength,se.nodeRadius),v.current=me,x)for(let ge=0;ge<x.length;ge++){let ye=x[ge],le=me.find(ie=>ie.id===ye.nodeId);if(!le)continue;let ne=E.current.get(ye.nodeId);ne||(ne=[],E.current.set(ye.nodeId,ne)),ne.push({x:le.x,y:le.y});let pe=ye.maxPoints??200;ne.length>pe&&ne.splice(0,ne.length-pe)}if(!ce&&xu(me)<.01){$.current=!0,D(ge=>ge+1);return}D(ge=>ge+1),ae=requestAnimationFrame(J)};return ae=requestAnimationFrame(J),()=>{M.current=!1,cancelAnimationFrame(ae)}},[]);let B=v.current,z=S(ae=>{v.current=v.current.map(J=>J.id===ae?{...J,fixed:!J.fixed,vx:0,vy:0}:J),$.current&&($.current=!1,M.current=!0,D(J=>J+1))},[]),k=te(null),w=te(null),T=S(ae=>{let J=ae,se=w.current;if(!se)return{x:J.clientX,y:J.clientY};let ce=se.getBoundingClientRect(),me=r/ce.width,ge=i/ce.height;return{x:(J.clientX-ce.left)*me,y:(J.clientY-ce.top)*ge}},[r,i]),C=te(!1),N=S((ae,J)=>{J.stopPropagation(),k.current=ae;let se=v.current.find(ce=>ce.id===ae);C.current=se?.fixed??!1,v.current=v.current.map(ce=>ce.id===ae?{...ce,fixed:!0,vx:0,vy:0}:ce)},[]),F=S(ae=>{let J=T(ae);if(P.current={x:J.x,y:J.y},!k.current)return;let se=k.current,ce=20;v.current=v.current.map(me=>me.id===se?{...me,x:Math.max(ce,Math.min(r-ce,J.x)),y:Math.max(ce,Math.min(i-ce,J.y))}:me),$.current&&($.current=!1,M.current=!0),D(me=>me+1)},[r,i,T]),_=S(()=>{let ae=k.current;ae&&(v.current=v.current.map(J=>J.id===ae?{...J,fixed:C.current}:J)),k.current=null},[]),H=S(()=>{k.current=null,P.current=null},[]),W=q(()=>{let ae=new Map;for(let J=0;J<B.length;J++)ae.set(B[J].id,B[J]);return ae},[R]),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]),K=S(()=>{let ae=[];for(let J=0;J<n.length;J++){let se=n[J],ce=W.get(se.source),me=W.get(se.target);if(!ce||!me||se.weight!==void 0&&se.weight<=0)continue;let ge=se.weight?Math.max(.5,Math.min(6,b*se.weight)):b,ye={key:`edge-${J}`,x1:String(ce.x),y1:String(ce.y),x2:String(me.x),y2:String(me.y),stroke:se.color??f,"stroke-width":String(ge),"stroke-opacity":"0.6"};u&&(ye["marker-end"]="url(#arrowhead)"),ae.push(o("line",ye))}return ae},[R,f,b,u]),Q=S(()=>{let ae=[];for(let J=0;J<B.length;J++){let se=B[J];ae.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:ce=>N(se.id,ce),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&&ae.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 ae},[R,s,d,z]),G=S(()=>y?[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"},y)]:[],[y,r]),O=S(()=>{if(!x||x.length===0)return[];let ae=[];for(let J=0;J<x.length;J++){let se=x[J],ce=E.current.get(se.nodeId);if(!ce||ce.length<2)continue;let me=[];for(let ge=0;ge<ce.length;ge++){let ye=ce[ge];me.push(`${ge===0?"M":"L"}${ye.x.toFixed(1)},${ye.y.toFixed(1)}`)}ae.push(o("path",{key:`trail-${se.nodeId}`,d:me.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 ae},[R,x]),Y=V(),X=O(),U=K(),Z=Q(),ee=G();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":y??"Force-directed graph \u2014 drag nodes to move, double-click to lock",style:{fontFamily:"sans-serif",cursor:k.current?"grabbing":"default"},onMouseMove:F,onMouseUp:_,onMouseLeave:H},...Y,...ee,...X,...U,...Z)}var As=["#3b82f6","#6366f1","#8b5cf6","#a855f7","#c084fc","#d8b4fe","#e9d5ff","#f3e8ff"];function Ls(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=As,title:h}=e,p=i==="vertical",c=h?30:0,m=120,f=q(()=>{let A=0;for(let I=0;I<t.length;I++)t[I].value>A&&(A=t[I].value);return A>0?A:1},[t]),b=S(A=>f===0?0:Math.max(.05,A/f),[f]),y=S((A,I)=>I||(u[A%u.length]??As[0]),[u]),g=S(()=>{if(t.length===0)return[];let A=[],I=40,P=n-I*2-m,L=r-c-I*2,E=d*(t.length-1),B=Math.max(1,(L-E)/t.length),z=I+P/2;for(let k=0;k<t.length;k++){let w=t[k],T=k<t.length-1?t[k+1]:null,C=y(k,w.color),N=b(w.value),F=T!==null?b(T.value):N*.6,_=P/2*N,H=P/2*F,W=c+I+k*(B+d),V=z-_,K=z+_,Q=z+H,G=z-H,O=`${V},${W} ${K},${W} ${Q},${W+B} ${G},${W+B}`;A.push(o("polygon",{key:`section-${k}`,points:O,fill:C,stroke:"#fff","stroke-width":"1"}));let Y=I+P+12,X=W+B/2;if(s&&A.push(o("text",{key:`label-${k}`,x:String(Y),y:String(X-(a||l?6:0)),"text-anchor":"start","font-size":"12","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},w.label)),a||l){let U="";if(a&&(U=String(w.value)),l&&t.length>0){let Z=t[0].value,ee=Z>0?Math.round(w.value/Z*100):0;U+=a?` (${ee}%)`:`${ee}%`}A.push(o("text",{key:`value-${k}`,x:String(Y),y:String(X+(s?10:4)),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},U))}}return A},[t,n,r,c,d,s,a,l,y,b,m]),x=S(()=>{if(t.length===0)return[];let A=[],I=40,P=n-I*2,E=r-c-I*2-40,B=d*(t.length-1),z=Math.max(1,(P-B)/t.length),k=c+I+E/2;for(let w=0;w<t.length;w++){let T=t[w],C=w<t.length-1?t[w+1]:null,N=y(w,T.color),F=b(T.value),_=C!==null?b(C.value):F*.6,H=E/2*F,W=E/2*_,V=I+w*(z+d),K=k-H,Q=k-W,G=k+W,O=k+H,Y=`${V},${K} ${V+z},${Q} ${V+z},${G} ${V},${O}`;A.push(o("polygon",{key:`section-${w}`,points:Y,fill:N,stroke:"#fff","stroke-width":"1"}));let X=V+z/2,U=c+I+E+14;if(s&&A.push(o("text",{key:`label-${w}`,x:String(X),y:String(U),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},T.label)),a||l){let Z="";if(a&&(Z=String(T.value)),l&&t.length>0){let ee=t[0].value,ae=ee>0?Math.round(T.value/ee*100):0;Z+=a?` (${ae}%)`:`${ae}%`}A.push(o("text",{key:`value-${w}`,x:String(X),y:String(U+14),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#6b7280"},Z))}}return A},[t,n,r,c,d,s,a,l,y,b]),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]),R=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]),D=v(),M=p?g():x(),$=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":h??"Funnel chart",style:{fontFamily:"sans-serif"}},...D,...M,...$)}var Bs=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Fs(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 yu(e,t){return t||Bs[e%Bs.length]}function Ns(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:p=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,m=q(()=>{let L=1/0,E=-1/0;for(let B of t){B.start<L&&(L=B.start);let z=B.start+B.duration;z>E&&(E=z)}return L===1/0&&(L=0,E=1),{min:L,max:E,range:E-L}},[t]),f=q(()=>{let L=t.slice();return L.sort((E,B)=>E.group!==B.group?(E.group??"").localeCompare(B.group??""):E.start-B.start),L},[t]),b=r??p*2+f.length*(i+s)+s+20,y=n-p-c-p,g=p+(h?20:0),x=S(L=>m.range===0?c+p:c+p+(L-m.min)/m.range*y,[m,y,c,p]),v=S(()=>{if(!a)return[];let L=[],E=Fs(m.range),B=Math.ceil(m.min/E)*E,z=g+f.length*(i+s)+s;for(let k=B;k<=m.max;k+=E){let w=x(k);L.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 L},[a,m,g,f.length,i,s,x]),R=S(()=>{let L=[],E=Fs(m.range),B=Math.ceil(m.min/E)*E,z=g-8;for(let k=B;k<=m.max;k+=E){let w=x(k);L.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 L.push(o("text",{key:"time-unit",x:String(n-p),y:String(z),"text-anchor":"end","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.4","font-style":"italic"},u)),L},[m,g,x,u,n,p]),D=S(()=>{let L=[],E="";for(let B=0;B<f.length;B++){let z=f[B],k=g+B*(i+s)+s,w=x(z.start),T=Math.max(2,x(z.start+z.duration)-w),C=yu(B,z.color);z.group&&z.group!==E&&(E=z.group,l&&L.push(o("text",{key:`group-${B}`,x:String(p),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))),L.push(o("rect",{key:`bar-${z.id}`,x:String(w),y:String(k),width:String(T),height:String(i),rx:"4",ry:"4",fill:C,role:"graphics-symbol","aria-label":`${z.label}: start ${z.start}, duration ${z.duration}`})),l&&L.push(o("text",{key:`label-${z.id}`,x:String(c+p-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&&T>30&&L.push(o("text",{key:`prog-${z.id}`,x:String(w+T/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 L},[f,g,i,s,x,l,d,c,p]),M=S(()=>h?[o("text",{key:"title",x:String(n/2),y:String(p/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},h)]:[],[h,n,p]),$=v(),A=R(),I=D(),P=M();return o("svg",{width:"100%",height:String(b),viewBox:`0 0 ${n} ${b}`,xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Gantt chart",style:{fontFamily:"sans-serif"}},...P,...$,...A,...I)}var Su=Math.PI/180;function vu(e){return e*Su}function Je(e,t,n,r){let i=vu(r);return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function Ws(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 wu(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 _s(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:p=!0,tickCount:c=10,label:m,unit:f,colors:b=["#22c55e","#f59e0b","#ef4444"],needleColor:y="#374151",backgroundColor:g="#e5e7eb"}=e,x=isFinite(n)&&!isNaN(n)?n:0,v=isFinite(r)&&!isNaN(r)&&r>x?r:x+100,R=isFinite(t)&&!isNaN(t)?wu(t,x,v):x,D=(u?24:0)+(m?18:0),M=i/2,$=(s-D)*.6,A=Math.min(i/2,(s-D)*.55)-d/2-10,I=A-d,P=A-d/2,L=l-a,E=S(O=>{let Y=v-x;if(Y===0)return a;let X=(O-x)/Y;return a+X*L},[x,v,a,L]),B=S(()=>{let O=Ws(M,$,P,a,l);return[o("path",{key:"bg-arc",d:O,fill:"none",stroke:g,"stroke-width":String(d),"stroke-linecap":"round"})]},[M,$,P,a,l,g,d]),z=S(()=>{if(b.length===0)return[];let O=[],Y=L/b.length;for(let X=0;X<b.length;X++){let U=a+X*Y,Z=U+Y,ee=Ws(M,$,P,U,Z);O.push(o("path",{key:`seg-${X}`,d:ee,fill:"none",stroke:b[X],"stroke-width":String(d),"stroke-linecap":X===0||X===b.length-1?"round":"butt",opacity:"0.85"}))}return O},[b,L,a,M,$,P,d]),k=S(()=>{if(!p||c<=0)return[];let O=[],Y=Math.max(1,Math.min(c,100));for(let X=0;X<=Y;X++){let U=X/Y,Z=a+U*L,ee=X%2===0,ae=ee?10:6,J=Je(M,$,A+4,Z),se=Je(M,$,A+4+ae,Z);if(O.push(o("line",{key:`tick-${X}`,x1:String(J.x),y1:String(J.y),x2:String(se.x),y2:String(se.y),stroke:"currentColor",opacity:"0.4","stroke-width":ee?"2":"1"})),ee){let ce=x+U*(v-x),me=Je(M,$,A+4+ae+12,Z);O.push(o("text",{key:`tick-label-${X}`,x:String(me.x),y:String(me.y+3),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},mt(ce)))}}return O},[p,c,a,L,M,$,A,x,v]),w=S(()=>{let O=[],Y=E(R),X=I-8,U=Je(M,$,X,Y),Z=6,ee=Y+90,ae=Y-90,J=Je(M,$,Z,ee),se=Je(M,$,Z,ae);return O.push(o("polygon",{key:"needle",points:`${U.x},${U.y} ${J.x},${J.y} ${se.x},${se.y}`,fill:y,stroke:"none"})),O.push(o("circle",{key:"needle-cap",cx:String(M),cy:String($),r:"8",fill:y,stroke:"#fff","stroke-width":"2"})),O},[R,E,M,$,I,y]),T=S(()=>{if(!u)return[];let O=[],Y=mt(R),X=Y+(f?" "+f:""),U=$+P+20;return O.push(o("text",{key:"value-text",x:String(M),y:String(U),"text-anchor":"middle","font-size":"22","font-weight":"bold","font-family":"sans-serif",fill:"currentColor","aria-label":`Value: ${X}`},Y,f?o("tspan",{key:"unit","font-size":"14","font-weight":"normal",opacity:"0.6",fill:"currentColor"}," "+f):null)),O},[u,R,f,M,$,P]),C=S(()=>{if(!m)return[];let O=$+P+(u?40:20);return[o("text",{key:"label",x:String(M),y:String(O),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},m)]},[m,M,$,P,u]),N=S(()=>{if(!h)return[];let O=[],Y=Je(M,$,P,a),X=Je(M,$,P,l);return O.push(o("text",{key:"min-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"},mt(x))),O.push(o("text",{key:"max-label",x:String(X.x+4),y:String(X.y+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},mt(v))),O},[h,M,$,P,a,l,x,v]),F=B(),_=z(),H=k(),W=w(),V=T(),K=C(),Q=N(),G=`Gauge: ${mt(R)}${f?" "+f:""}, range ${mt(x)} to ${mt(v)}${m?", "+m:""}`;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(R),"aria-valuemin":String(x),"aria-valuemax":String(v),"aria-label":G,style:{fontFamily:"sans-serif"}},...F,..._,...H,...W,...V,...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,-.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,7.6 2.1,.1 -1,1.9 -1.1,-.1 -.4,-.8 .5,-1.3 m -1.1,-2.9 .6,-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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 Os(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,p=q(()=>Object.keys(_t),[]),c=S(g=>{l&&l(g)},[l]),m=S((g,x)=>{let v=x.currentTarget;v&&v.setAttribute("fill",u),d&&d(g)},[d,u]),f=S((g,x)=>{let v=x.currentTarget;if(v){let R=r[g]??i;v.setAttribute("fill",R)}d&&d(null)},[d,r,i]),b=q(()=>{let g=[];for(let x=0;x<p.length;x++){let v=p[x],R=_t[v],D=r[v]??i,M={key:`state-${v}`,d:R.path,fill:D,stroke:s,"stroke-width":String(a),"stroke-linejoin":"round","data-state":v,role:"img","aria-label":R.name,style:{cursor:l?"pointer":"default"}};if(l){let A=v;M.onClick=()=>c(A),M.onKeyDown=I=>{(I.key==="Enter"||I.key===" ")&&c(A)},M.tabindex=0,M.role="button",M["aria-label"]=R.name}let $=v;M.onMouseOver=A=>m($,A),M.onMouseOut=A=>f($,A),g.push(o("path",M))}return g},[p,r,i,s,a,l,c,m,f]),y=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"}},y,...b)}function wo(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 ku(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 Cu(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=wo(t[i]),l=wo(t[i+1]);return ku(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}function Mu(e){let{r:t,g:n,b:r}=wo(e);return(.299*t+.587*n+.114*r)/255}var Eu=["#3b82f6","#fbbf24","#ef4444"];function Hs(e){let{data:t=[],rowLabels:n,columnLabels:r,width:i=600,height:s=400,colorScale:a=Eu,minValue:l,maxValue:d,showValues:u=!1,cellBorderColor:h="#fff",cellBorderWidth:p=1,title:c,padding:m=60}=e,f=t.length,b=q(()=>{let k=0;for(let w of t)w.length>k&&(k=w.length);return k},[t]),{minVal:y,maxVal:g}=q(()=>{let k=l??1/0,w=d??-1/0;for(let T of t)for(let C of T)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?m:20,R=r?m:20,D=i-v-20,M=s-x-R-20,$=b>0?D/b:0,A=f>0?M/f:0,I=S(()=>{let k=[];for(let w=0;w<f;w++){let T=t[w];for(let C=0;C<b;C++){let N=C<T.length?T[C]:0,F=(N-y)/(g-y),_=Cu(F,a),H=v+C*$,W=x+20+w*A;if(k.push(o("rect",{key:`cell-${w}-${C}`,x:String(H),y:String(W),width:String($),height:String(A),fill:_,stroke:h,"stroke-width":String(p)})),u){let V=Mu(_)>.5?"#111827":"#ffffff";k.push(o("text",{key:`val-${w}-${C}`,x:String(H+$/2),y:String(W+A/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.min(11,$*.3,A*.4)),"font-family":"sans-serif",fill:V},String(Math.round(N*100)/100)))}}}return k},[t,f,b,y,g,a,$,A,v,x,u,h,p]),P=S(()=>{let k=[];if(n)for(let w=0;w<f;w++){let T=w<n.length?n[w]:"",C=x+20+w*A+A/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"},T))}if(r)for(let w=0;w<b;w++){let T=w<r.length?r[w]:"",C=v+w*$+$/2,N=x+20+f*A+16;k.push(o("text",{key:`col-label-${w}`,x:String(C),y:String(N),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},T))}return k},[n,r,f,b,$,A,v,x]),L=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||b===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=L(),B=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,...B,...z)}function Iu(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 Ru(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 ko(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function Ys(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:p,padding:c=60}=e,m=Math.max(1,Math.round(n)),f=q(()=>Iu(t,m),[t,m]),b=q(()=>{let E=0;for(let B=0;B<f.length;B++)f[B].count>E&&(E=f[B].count);return E>0?E:1},[f]),y=r-c*2,g=i-c*2,x=S(()=>{if(!l)return[];let E=Ru(b),B=[];for(let z=E;z<=b;z+=E){let k=c+g-z/b*g;B.push(o("line",{key:`grid-${z}`,x1:String(c),y1:String(k),x2:String(c+y),y2:String(k),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),B.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 B},[l,b,c,y,g]),v=S(()=>{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+y),y2:String(c+g),stroke:"#374151","stroke-width":"1.5"})),E},[c,y,g]),R=S(()=>{if(f.length===0)return[];let E=[],B=a*(f.length-1),z=Math.max(1,(y-B)/f.length);for(let k=0;k<f.length;k++){let w=f[k],T=w.count/b*g,C=c+k*(z+a),N=c+g-T;if(E.push(o("rect",{key:`bar-${k}`,x:String(C),y:String(N),width:String(z),height:String(T),fill:s})),d&&w.count>0&&E.push(o("text",{key:`val-${k}`,x:String(C+z/2),y:String(N-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 _=(f.length===1,ko(w.min));E.push(o("text",{key:`xlabel-${k}`,x:String(C+z/2),y:String(c+g+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},_))}}if(f.length>0){let k=f[f.length-1],w=c+y;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"},ko(k.max)))}return E},[f,b,a,s,d,c,y,g]),D=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+y/2),y:String(i-8),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151"},h)),p&&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})`},p)),E},[u,h,p,r,i,c,y,g]),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]),$=x(),A=v(),I=R(),P=D(),L=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,...$,...A,...I,...L)}function Pu(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 Vs(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:p,padding:c=60}=e,m=i==="vertical",f=m?30:0,b=n-c*2,y=r-c*2-f,g=m?y:b,x=m?b:y,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]),R=q(()=>t.length===0?0:x/t.length,[t.length,x]),D=S(()=>{if(!u)return[];let k=Pu(v),w=[];for(let T=k;T<=v;T+=k){let C=T/v*g;if(m){let N=c+y-C;w.push(o("line",{key:`grid-${T}`,x1:String(c),y1:String(N),x2:String(c+b),y2:String(N),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`grid-label-${T}`,x:String(c-8),y:String(N+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(T)))}else{let N=c+C;w.push(o("line",{key:`grid-${T}`,x1:String(N),y1:String(c),x2:String(N),y2:String(c+y),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`grid-label-${T}`,x:String(N),y:String(c+y+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(T)))}}return w},[u,v,m,c,b,y,g]),M=S(()=>{let k=[];return m?k.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+y),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+y),stroke:"#374151","stroke-width":"1.5"})),k.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+y),x2:String(c+b),y2:String(c+y),stroke:"#374151","stroke-width":"1.5"})),k},[m,c,b,y]),$=S(()=>{if(t.length===0)return[];let k=[];for(let w=0;w<t.length;w++){let T=t[w],C=T.value/v*g,N=R*w+R/2,F=T.color??d;if(m){let _=c+N,H=c+y,W=c+y-C;k.push(o("line",{key:`stem-${w}`,x1:String(_),y1:String(H),x2:String(_),y2:String(W),stroke:s,"stroke-width":String(a)})),k.push(o("circle",{key:`dot-${w}`,cx:String(_),cy:String(W),r:String(l),fill:F})),h&&k.push(o("text",{key:`val-${w}`,x:String(_),y:String(W-l-4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(T.value)));let V=_,K=c+y+16;k.push(o("text",{key:`cat-${w}`,x:String(V),y:String(K),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${V}, ${K})`},T.label))}else{let _=c+N,H=c,W=c+C;k.push(o("line",{key:`stem-${w}`,x1:String(H),y1:String(_),x2:String(W),y2:String(_),stroke:s,"stroke-width":String(a)})),k.push(o("circle",{key:`dot-${w}`,cx:String(W),cy:String(_),r:String(l),fill:F})),h&&k.push(o("text",{key:`val-${w}`,x:String(W+l+4),y:String(_+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(T.value))),k.push(o("text",{key:`cat-${w}`,x:String(c-8),y:String(_+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},T.label))}}return k},[t,v,R,d,l,s,a,h,m,c,b,y,g]),A=S(()=>p?[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"},p)]:[],[p,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=D(),L=M(),E=$(),B=A(),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":p??"Lollipop chart",style:{fontFamily:"sans-serif"}},...B,...P,...L,...E,...z)}function Co(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 Tu(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 Du(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=Co(t[i]),l=Co(t[i+1]);return Tu(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}function $u(e){let{r:t,g:n,b:r}=Co(e);return(.299*t+.587*n+.114*r)/255}var zu=["#f0f9ff","#3b82f6","#1e3a8a"];function Us(e){let{data:t=[],labels:n,rowLabels:r,columnLabels:i,width:s=500,height:a=500,colorScale:l=zu,showValues:d=!0,showDiagonal:u=!0,cellBorderColor:h="#e5e7eb",title:p,padding:c=70,symmetric:m=!1}=e,f=r??n,b=i??n,y=t.length,g=q(()=>{let F=0;for(let _ of t)_.length>F&&(F=_.length);return F},[t]),x=q(()=>{if(!m||y===0)return t;let F=[],_=Math.max(y,g);for(let H=0;H<_;H++){let W=[];for(let V=0;V<_;V++){let K=t[H],Q=K&&V<K.length?K[V]:0,G=t[V],O=G&&H<G.length?G[H]:0;Q!==0?W.push(Q):W.push(O)}F.push(W)}return F},[t,m,y,g]),v=x.length,R=q(()=>{let F=0;for(let _ of x)_.length>F&&(F=_.length);return F},[x]),{minVal:D,maxVal:M}=q(()=>{let F=1/0,_=-1/0;for(let H of x)for(let W of H)W<F&&(F=W),W>_&&(_=W);return F===1/0&&(F=0),_===-1/0&&(_=1),F===_&&(_=F+1),{minVal:F,maxVal:_}},[x]),$=p?30:0,A=f?c:20,I=b?c:20,P=s-A-20,L=a-$-I-20,E=R>0?P/R:0,B=v>0?L/v:0,z=S(()=>{let F=[];for(let _=0;_<v;_++){let H=x[_];for(let W=0;W<R;W++){let V=W<H.length?H[W]:0,K=(V-D)/(M-D),Q=Du(K,l),G=A+W*E,O=$+20+_*B,Y=_===W,X=Y&&u?"currentColor":h,U=Y&&u?"2":"1";if(F.push(o("rect",{key:`cell-${_}-${W}`,x:String(G),y:String(O),width:String(E),height:String(B),fill:Q,stroke:X,"stroke-width":U})),d){let Z=$u(Q)>.5?"#111827":"#ffffff",ee=Math.min(12,E*.3,B*.35);F.push(o("text",{key:`val-${_}-${W}`,x:String(G+E/2),y:String(O+B/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.max(8,ee)),"font-weight":Y&&u?"bold":"normal","font-family":"sans-serif",fill:Z},String(Math.round(V*100)/100)))}}}return F},[x,v,R,D,M,l,E,B,A,$,d,u,h]),k=S(()=>{let F=[];if(f)for(let _=0;_<v;_++){let H=_<f.length?f[_]:"",W=$+20+_*B+B/2;F.push(o("text",{key:`row-label-${_}`,x:String(A-8),y:String(W),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},H))}if(b)for(let _=0;_<R;_++){let H=_<b.length?b[_]:"",W=A+_*E+E/2,V=$+20+v*B+12;F.push(o("text",{key:`col-label-${_}`,x:String(W),y:String(V),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},H))}return F},[f,b,v,R,E,B,A,$]),w=S(()=>p?[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"},p)]:[],[p,s]);if(v===0||R===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":p??"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 T=w(),C=z(),N=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":p??"Matrix visualization",style:{fontFamily:"sans-serif"}},...T,...C,...N)}var Au=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function En(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 Lu(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 Bu(e,t,n,r,i,s,a){let l=[];if(En(e)<=0)return l;let h=Lu(e)+1,p=s==="horizontal",c=p?i/h:r/h,m=[];for(m.push({node:e,depth:0,spanStart:p?t:n,spanEnd:p?t+r:n+i,colorIndex:0});m.length>0;){let f=m.shift(),{node:b,depth:y,spanStart:g,spanEnd:x,colorIndex:v}=f,R=En(b);if(R<=0)continue;let D=x-g,M,$,A,I;if(p?(M=g,$=n+y*c,A=D,I=c):(M=t+y*c,$=g,A=c,I=D),l.push({x:M,y:$,w:A,h:I,label:b.label,value:R,color:b.color??a[v%a.length],depth:y}),b.children&&b.children.length>0){let P=g;for(let L=0;L<b.children.length;L++){let E=b.children[L],B=En(E);if(B<=0)continue;let z=B/R*D;m.push({node:E,depth:y+1,spanStart:P,spanEnd:P+z,colorIndex:y===0?L:v}),P+=z}}}return l}function js(e){let{data:t,width:n=600,height:r=400,orientation:i="horizontal",showLabels:s=!0,showValues:a=!0,colors:l=Au,borderColor:d="#ffffff",borderWidth:u=1,title:h,padding:p=10}=e,c=h?30:0,m=p,f=p+c,b=n-p*2,y=r-p*2-c;if(q(()=>En(t),[t])<=0||b<=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 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(()=>Bu(t,m,f,b,y,i,l),[t,m,f,b,y,i,l]),v=[];h&&v.push(o("text",{key:"title",x:String(n/2),y:String(p+16),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h));for(let R=0;R<x.length;R++){let D=x[R];if(v.push(o("rect",{key:`cell-${R}`,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:d,"stroke-width":String(u),role:"graphics-symbol","aria-label":`${D.label}: ${D.value}`})),s&&D.w>20&&D.h>14){let M=Math.floor(D.w/7),$=D.label.length>M?D.label.substring(0,Math.max(1,M-2))+"..":D.label;v.push(o("text",{key:`label-${R}`,x:String(D.x+D.w/2),y:String(D.y+D.h/2+(a?-2:4)),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},$))}a&&D.w>30&&D.h>28&&v.push(o("text",{key:`value-${R}`,x:String(D.x+D.w/2),y:String(D.y+D.h/2+12),"text-anchor":"middle","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??"Partition diagram",style:{fontFamily:"sans-serif"}},...v)}function Mo(e,t){let n=[];for(let r of t)n.push(String(e[r]??""));return n.join(" | ")}function Gs(e,t){let n=new Set;for(let i of e)n.add(Mo(i,t));let r=Array.from(n);return r.sort(),r}function In(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 Rn(e){return Number.isInteger(e)?String(e):e.toFixed(2)}function Fu(e,t,n,r,i){let s=Gs(e,t),a=Gs(e,n),l=new Map;for(let m of e){let f=Mo(m,t),b=Mo(m,n),y=`${f}::${b}`;l.has(y)||l.set(y,[]);let g=l.get(y),x=0;for(let v of r){let R=m[v];if(typeof R=="number")x+=R;else if(typeof R=="string"){let D=parseFloat(R);isNaN(D)||(x+=D)}}g.push(x)}let d=new Map;for(let[m,f]of l)d.set(m,In(f,i));let u=new Map;for(let m of s){let f=[];for(let b of a){let y=d.get(`${m}::${b}`);y!==void 0&&f.push(y)}u.set(m,In(f,i==="count"?"sum":i))}let h=new Map;for(let m of a){let f=[];for(let b of s){let y=d.get(`${b}::${m}`);y!==void 0&&f.push(y)}h.set(m,In(f,i==="count"?"sum":i))}let p=[];for(let m of u.values())p.push(m);let c=In(p,i==="count"?"sum":i);return{rowKeys:s,colKeys:a,cells:d,rowTotals:u,colTotals:h,grandTotal:c}}function Xs(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:p=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(()=>Fu(t,n,r,i,s),[t,n,r,i,s]),{rowKeys:m,colKeys:f,cells:b,rowTotals:y,colTotals:g,grandTotal:x}=c,v=u?30:0,R=f.length+(d?1:0),D=m.length+(d?1:0),M=1+R,$=1+D,A=Math.max(40,(a-p*2)/M),I=Math.max(20,Math.min(36,(l-v-p*2)/$)),P=A*M,L=I*$,E=Math.max(0,(a-P)/2),B=v+Math.max(0,(l-v-L)/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(B),width:String(P),height:String(I),fill:h})),z.push(o("rect",{key:"header-col-bg",x:String(E),y:String(B+I),width:String(A),height:String(I*D),fill:h,opacity:"0.85"})),z.push(o("text",{key:"corner",x:String(E+A/2),y:String(B+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)*A,T=Math.floor(A/7),C=f[k],N=C.length>T?C.substring(0,Math.max(1,T-2))+"..":C;z.push(o("text",{key:`ch-${k}`,x:String(w+A/2),y:String(B+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},N))}d&&z.push(o("text",{key:"ch-total",x:String(E+(f.length+1)*A+A/2),y:String(B+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},"Total"));for(let k=0;k<m.length;k++){let w=m[k],T=B+(k+1)*I;k%2===0&&z.push(o("rect",{key:`row-bg-${k}`,x:String(E+A),y:String(T),width:String(A*R),height:String(I),fill:"#f9fafb"}));let C=Math.floor(A/7),N=w.length>C?w.substring(0,Math.max(1,C-2))+"..":w;z.push(o("text",{key:`rh-${k}`,x:String(E+A/2),y:String(T+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},N));for(let F=0;F<f.length;F++){let _=f[F],H=`${w}::${_}`,W=b.get(H),V=E+(F+1)*A;z.push(o("rect",{key:`border-${k}-${F}`,x:String(V),y:String(T),width:String(A),height:String(I),fill:"none",stroke:"#e5e7eb","stroke-width":"0.5"})),z.push(o("text",{key:`cell-${k}-${F}`,x:String(V+A/2),y:String(T+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},W!==void 0?Rn(W):"-"))}if(d){let F=E+(f.length+1)*A,_=y.get(w)??0;z.push(o("rect",{key:`rt-bg-${k}`,x:String(F),y:String(T),width:String(A),height:String(I),fill:"#eff6ff"})),z.push(o("text",{key:`rt-${k}`,x:String(F+A/2),y:String(T+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},Rn(_)))}}if(d){let k=B+(m.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+A/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 T=0;T<f.length;T++){let C=f[T],N=g.get(C)??0,F=E+(T+1)*A;z.push(o("text",{key:`ct-${T}`,x:String(F+A/2),y:String(k+I/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},Rn(N)))}let w=E+(f.length+1)*A;z.push(o("text",{key:"grand-total",x:String(w+A/2),y:String(k+I/2+4),"text-anchor":"middle","font-size":"12","font-family":"sans-serif","font-weight":"bold",fill:"#1e3a8a"},Rn(x)))}return z.push(o("rect",{key:"outer-border",x:String(E),y:String(B),width:String(P),height:String(L),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 Pn(e,t){return Math.PI*2*e/t-Math.PI/2}function Tn(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function Ks(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:p}=e,c=t.length,m=p?30:0,f=d&&n.length>0?30:0,b=60,y=Math.min((r-b*2)/2,(i-b*2-m-f)/2),g=r/2,x=b+m+y,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 T=0;for(let C of n){let N=C.values[k];N!==void 0&&N>T&&(T=N)}z.push(T>0?T:1)}return z},[t,n,c]),R=S(()=>{if(c<3)return[];let z=[];for(let k=1;k<=s;k++){let w=y*k/s,T=[];for(let C=0;C<c;C++){let N=Pn(C,c),F=Tn(g,x,w,N);T.push(`${F.x},${F.y}`)}z.push(o("polygon",{key:`ring-${k}`,points:T.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=Pn(k,c),T=Tn(g,x,y,w);z.push(o("line",{key:`spoke-${k}`,x1:String(g),y1:String(x),x2:String(T.x),y2:String(T.y),stroke:h,"stroke-width":"0.75"}))}return z},[c,s,y,g,x,h]),D=S(()=>{if(!a||c<3)return[];let z=[],k=16;for(let w=0;w<c;w++){let T=Pn(w,c),C=Tn(g,x,y+k,T),N="middle";C.x<g-5?N="end":C.x>g+5&&(N="start");let F=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":N,dy:F,"font-size":"12","font-family":"sans-serif",fill:"currentColor"},t[w]?.label??`Axis ${w}`))}return z},[a,c,t,y,g,x]),M=S(()=>{if(c<3||n.length===0)return[];let z=[];for(let k=0;k<n.length;k++){let w=n[k],T=[],C=[],N=[];for(let F=0;F<c;F++){let _=w.values[F]??0,H=v[F],W=Math.min(_/H,1),V=y*W,K=Pn(F,c),Q=Tn(g,x,V,K);T.push(`${Q.x},${Q.y}`),u&&C.push(o("circle",{key:`dot-${k}-${F}`,cx:String(Q.x),cy:String(Q.y),r:"3.5",fill:w.color,stroke:"#fff","stroke-width":"1.5"})),l&&N.push(o("text",{key:`val-${k}-${F}`,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(_*100)/100)))}z.push(o("polygon",{key:`series-fill-${k}`,points:T.join(" "),fill:w.color,"fill-opacity":String(w.fillOpacity??.15),stroke:"none"})),z.push(o("polygon",{key:`series-line-${k}`,points:T.join(" "),fill:"none",stroke:w.color,"stroke-width":"2","stroke-linejoin":"round"}));for(let F of C)z.push(F);for(let F of N)z.push(F)}return z},[c,n,v,y,g,x,u,l]),$=S(()=>{if(!d||n.length===0)return[];let z=[],k=x+y+40,w=100,T=n.length*w,C=g-T/2;for(let N=0;N<n.length;N++){let F=n[N],_=C+N*w;z.push(o("rect",{key:`legend-swatch-${N}`,x:String(_),y:String(k),width:"12",height:"12",rx:"2",fill:F.color})),z.push(o("text",{key:`legend-text-${N}`,x:String(_+16),y:String(k+10),"font-size":"12","font-family":"sans-serif",fill:"currentColor"},F.label))}return z},[d,n,g,x,y]),A=S(()=>p?[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"},p)]:[],[p,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":p??"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=R(),P=D(),L=M(),E=$(),B=A();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Radar chart",style:{fontFamily:"sans-serif"}},...B,...I,...P,...L,...E)}var Nu=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Wu(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 p=n.get(h),c=d+1;(p===void 0||c>p)&&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 _u(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),p=e.map(P=>P.id),c=Wu(p,h),m=new Map,f=new Map;for(let P of p)m.set(P,0),f.set(P,0);for(let P of h)f.set(P.source,(f.get(P.source)??0)+P.value),m.set(P.target,(m.get(P.target)??0)+P.value);let b=0;for(let P of c.values())P>b&&(b=P);let y=new Map;for(let P=0;P<=b;P++)y.set(P,[]);for(let[P,L]of c)y.get(L).push(P);let g=new Map,x=b>0?(d-i)/b:0;for(let P=0;P<=b;P++)g.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 R=[],D=new Map;for(let P=0;P<=b;P++){let L=y.get(P);if(L.length===0)continue;let E=0;for(let w of L){let T=m.get(w)??0,C=f.get(w)??0;E+=Math.max(T,C,1)}let B=u-s*(L.length-1),z=E>0?B/E:1,k=a;for(let w=0;w<L.length;w++){let T=L[w],C=v.get(T),N=m.get(T)??0,F=f.get(T)??0,_=Math.max(N,F,1),H=Math.max(4,_*z),W=e.findIndex(K=>K.id===T),V={id:T,label:C.label,color:C.color??l[W%l.length],column:P,x:g.get(P),y:k,height:H,totalIn:N,totalOut:F,totalValue:_};R.push(V),D.set(T,V),k+=H+s}}let M=new Map,$=new Map;for(let P of p)M.set(P,0),$.set(P,0);let A=[...h].sort((P,L)=>L.value-P.value),I=[];for(let P of A){let L=D.get(P.source),E=D.get(P.target);if(!L||!E)continue;let B=L.totalOut||1,z=E.totalIn||1,k=P.value/B*L.height,w=P.value/z*E.height,T=Math.max(1,(k+w)/2),C=M.get(P.source),N=$.get(P.target),F=L.y+C+k/2,_=E.y+N+w/2;M.set(P.source,C+k),$.set(P.target,N+w);let H=v.get(P.source);I.push({source:P.source,target:P.target,value:P.value,color:P.color??H?.color??L.color,sourceY:F,targetY:_,width:T})}return{layoutNodes:R,layoutLinks:I}}function qs(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=Nu,title:p,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":p??"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 m=q(()=>_u(t,n,r,i,s,a,c,h),[t,n,r,i,s,a,c,h]),f=S(()=>{let R=[];for(let D=0;D<m.layoutLinks.length;D++){let M=m.layoutLinks[D],$=m.layoutNodes.find(B=>B.id===M.source),A=m.layoutNodes.find(B=>B.id===M.target);if(!$||!A)continue;let I=$.x+s,P=A.x,L=(I+P)/2,E=`M ${I} ${M.sourceY} C ${L} ${M.sourceY}, ${L} ${M.targetY}, ${P} ${M.targetY}`;R.push(o("path",{key:`link-${D}`,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&&R.push(o("text",{key:`link-val-${D}`,x:String(L),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 R},[m,s,u,d]),b=S(()=>{let R=[];for(let D=0;D<m.layoutNodes.length;D++){let M=m.layoutNodes[D];if(R.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 $=m.layoutNodes.reduce((z,k)=>Math.max(z,k.column),0),A=M.column===$,I=A?M.x+s+6:M.x-6,P=A?"start":"end",L=M.column===0,E=L?M.x-6:I,B=L?"end":P;R.push(o("text",{key:`label-${M.id}`,x:String(E),y:String(M.y+M.height/2+4),"text-anchor":B,"font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},M.label))}}return R},[m,s,l]),y=S(()=>p?[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"},p)]:[],[p,r,c]),g=f(),x=b(),v=y();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Sankey diagram",style:{fontFamily:"sans-serif"}},...v,...g,...x)}var Ou=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],Eo=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 Hu(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 Yu(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),p=t+r*Math.sin(d),c=e+r*Math.cos(u),m=t+r*Math.sin(u),f=e+n*Math.cos(u),b=t+n*Math.sin(u),y=e+n*Math.cos(d),g=t+n*Math.sin(d);if(a>=Eo-.001){let x=d+Math.PI,v=e+r*Math.cos(x),R=t+r*Math.sin(x),D=e+n*Math.cos(x),M=t+n*Math.sin(x);return[`M ${h} ${p}`,`A ${r} ${r} 0 1 1 ${v} ${R}`,`A ${r} ${r} 0 1 1 ${h} ${p}`,`L ${y} ${g}`,`A ${n} ${n} 0 1 0 ${D} ${M}`,`A ${n} ${n} 0 1 0 ${y} ${g}`,"Z"].join(" ")}return[`M ${h} ${p}`,`A ${r} ${r} 0 ${l} 1 ${c} ${m}`,`L ${f} ${b}`,`A ${n} ${n} 0 ${l} 0 ${y} ${g}`,"Z"].join(" ")}function Vu(e,t,n,r){let i=[],s=Ot(e);if(s<=0)return i;let a=Hu(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 p=e.children[h],c=Ot(p);if(c<=0)continue;let m=c/s*Eo;d.push({node:p,startAngle:u,endAngle:u+m,depth:0,colorIndex:h}),u+=m}}else return i.push({startAngle:0,endAngle:Eo,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:p,endAngle:c,depth:m,colorIndex:f}=u,b=Ot(h);if(b<=0)continue;let y=t+m*l,g=y+l;if(i.push({startAngle:p,endAngle:c,innerR:y,outerR:g,label:h.label,value:b,color:h.color??r[f%r.length],depth:m}),h.children&&h.children.length>0){let x=p,v=c-p;for(let R=0;R<h.children.length;R++){let D=h.children[R],M=Ot(D);if(M<=0)continue;let $=M/b*v;d.push({node:D,startAngle:x,endAngle:x+$,depth:m+1,colorIndex:f}),x+=$}}}return i}function Zs(e){let{data:t,width:n=500,height:r=500,innerRadius:i=40,showLabels:s=!0,colors:a=Ou,strokeColor:l="#ffffff",strokeWidth:d=1,title:u}=e,h=n/2,p=r/2,c=u?20:0,m=Math.min(h,p-c)-10;if(q(()=>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(p),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let b=q(()=>Vu(t,i,m,a),[t,i,m,a]),y=[];u&&y.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=p+c/2;for(let x=0;x<b.length;x++){let v=b[x],R=Yu(h,g,v.innerR,v.outerR,v.startAngle,v.endAngle);if(y.push(o("path",{key:`arc-${x}`,d:R,fill:v.color,stroke:l,"stroke-width":String(d),role:"graphics-symbol","aria-label":`${v.label}: ${v.value}`})),s){let D=v.endAngle-v.startAngle,M=v.startAngle+D/2-Math.PI/2,$=(v.innerR+v.outerR)/2,A=v.outerR-v.innerR,I=D*$;if(I>20&&A>14){let P=h+$*Math.cos(M),L=g+$*Math.sin(M),E=Math.floor(Math.min(I,A)/7),B=v.label.length>E?v.label.substring(0,Math.max(1,E-1))+"..":v.label;y.push(o("text",{key:`label-${x}`,x:String(P),y:String(L+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},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":u??"Sunburst chart",style:{fontFamily:"sans-serif"}},...y)}var Uu=["#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 Js(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 ju(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,p=[];for(let c=0;c<u.length;c++){let m=u[c],f=Dn(m);f<=0||p.push({label:m.label,value:f,area:f/d*h,color:m.color??s[c%s.length],node:m})}for(p.sort((c,m)=>m.area-c.area),l.push({nodes:p,rect:{x:t,y:n,w:r,h:i},depth:0});l.length>0;){let c=l.shift(),{nodes:m,rect:f,depth:b}=c;if(m.length===0)continue;let y={...f},g=0;for(;g<m.length&&y.w>0&&y.h>0;){let x=y.w>=y.h,v=x?y.h:y.w,R=[],D=[];R.push(m[g]),D.push(m[g].area),g++;let M=Js(D,v);for(;g<m.length;){let P=[...D,m[g].area],L=Js(P,v);if(L>M)break;R.push(m[g]),D.push(m[g].area),M=L,g++}let $=0;for(let P of D)$+=P;let A=v>0?$/v:0,I=0;for(let P=0;P<R.length;P++){let L=R[P],E=A>0?L.area/A:0,B,z,k,w;if(x?(B=y.x,z=y.y+I,k=A,w=E):(B=y.x+I,z=y.y,k=E,w=A),a.push({x:B,y:z,w:k,h:w,label:L.label,value:L.value,color:L.color,depth:b}),L.node.children&&L.node.children.length>0){let C=B+2,N=z+2+14,F=k-4,_=w-4-14;if(F>4&&_>4){let H=[],W=L.value,V=F*_;for(let K=0;K<L.node.children.length;K++){let Q=L.node.children[K],G=Dn(Q);G<=0||H.push({label:Q.label,value:G,area:G/W*V,color:Q.color??s[(K+b+1)%s.length],node:Q})}H.sort((K,Q)=>Q.area-K.area),l.push({nodes:H,rect:{x:C,y:N,w:F,h:_},depth:b+1})}}I+=E}x?y={x:y.x+A,y:y.y,w:y.w-A,h:y.h}:y={x:y.x,y:y.y+A,w:y.w,h:y.h-A}}}return a}function Qs(e){let{data:t,width:n=600,height:r=400,showLabels:i=!0,showValues:s=!0,colors:a=Uu,borderColor:l="#ffffff",borderWidth:d=2,padding:u=2,title:h}=e,p=h?30:0,c=u,m=u+p,f=n-u*2,b=r-u*2-p;if(q(()=>Dn(t),[t])<=0||f<=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 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=q(()=>ju(t,c,m,f,b,a),[t,c,m,f,b,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<g.length;v++){let R=g[v];if(x.push(o("rect",{key:`cell-${v}`,x:String(R.x),y:String(R.y),width:String(Math.max(0,R.w)),height:String(Math.max(0,R.h)),fill:R.color,stroke:l,"stroke-width":String(d),role:"graphics-symbol","aria-label":`${R.label}: ${R.value}`})),i&&R.w>20&&R.h>14){let D=Math.floor(R.w/7),M=R.label.length>D?R.label.substring(0,Math.max(1,D-2))+"..":R.label;x.push(o("text",{key:`label-${v}`,x:String(R.x+4),y:String(R.y+12),"font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},M))}s&&R.w>30&&R.h>28&&x.push(o("text",{key:`value-${v}`,x:String(R.x+4),y:String(R.y+24),"font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(R.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 ea(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 Gu(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 ta(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=ea(t[s]),u=ea(t[a]);return Gu(d.r+(u.r-d.r)*l,d.g+(u.g-d.g)*l,d.b+(u.b-d.b)*l)}function $n(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 Xu(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)),p=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*p,y:a+x*c});let y=n(f,{gridSize:h,xMin:i,xMax:s,yMin:a,yMax:l}),g=[];for(let x=0;x<f.length;x++){let v=f[x],R=y[x]??{dx:0,dy:0},D=Math.sqrt(R.dx*R.dx+R.dy*R.dy);g.push({x:v.x,y:v.y,dx:R.dx,dy:R.dy,magnitude:D})}return g}if(!t)return[];let m=[];for(let f=0;f<h;f++)for(let b=0;b<h;b++){let y=i+b*p,g=a+f*c,x=t(y,g),v=Math.sqrt(x.dx*x.dx+x.dy*x.dy);m.push({x:y,y:g,dx:x.dx,dy:x.dy,magnitude:v})}return m}function Ku(e,t,n,r,i){let{padding:s,chartWidth:a,chartHeight:l,xMin:d,xMax:u,yMin:h,yMax:p,xSpan:c,ySpan:m,showGrid:f,showAxes:b,colorByMagnitude:y,colorScale:g,arrowColor:x,arrowWidth:v,effectiveArrowScale:R,maxMagnitude:D,title:M,tickFontSize:$}=i,A=L=>s+(L-d)/c*a,I=L=>s+(p-L)/m*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=`${$}px sans-serif`,e.fillStyle="#6b7280";let L=$n(c,10),E=Math.ceil(d/L)*L;for(let k=E;k<=u;k+=L){let w=A(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 B=$n(m,10),z=Math.ceil(h/B)*B;for(let k=z;k<=p;k+=B){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(b){if(e.save(),e.strokeStyle="#374151",e.lineWidth=v,h<=0&&p>=0){let L=I(0);e.beginPath(),e.moveTo(s,L),e.lineTo(s+a,L),e.stroke()}if(d<=0&&u>=0){let L=A(0);e.beginPath(),e.moveTo(L,s),e.lineTo(L,s+l),e.stroke()}e.strokeStyle="#d1d5db",e.lineWidth=1,e.strokeRect(s,s,a,l),e.restore()}let P=4;for(let L=0;L<r.length;L++){let E=r[L],B=E.magnitude??Math.sqrt(E.dx*E.dx+E.dy*E.dy);if(B<1e-10)continue;let z=A(E.x),k=I(E.y),w=E.dx*R,T=-E.dy*R,C=z+w,N=k+T,F;if(y){let H=B/D;F=ta(H,g)}else F=x;e.save(),e.strokeStyle=F,e.lineWidth=v,e.lineCap="round",e.beginPath(),e.moveTo(z,k),e.lineTo(C,N),e.stroke();let _=Math.sqrt(w*w+T*T);if(_>2){let H=w/_,W=T/_,V=-W,K=H,Q=Math.min(P,_*.4),G=C-H*Q+V*Q*.5,O=N-W*Q+K*Q*.5,Y=C-H*Q-V*Q*.5,X=N-W*Q-K*Q*.5;e.fillStyle=F,e.beginPath(),e.moveTo(C,N),e.lineTo(G,O),e.lineTo(Y,X),e.closePath(),e.fill()}e.restore()}}function na(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:p=!0,colorByMagnitude:c=!1,colorScale:m=["#3b82f6","#8b5cf6","#ef4444"],title:f,padding:b=50,tickFontSize:y=10,arrowWidth:g=1.5,renderer:x="svg",useGPU:v=!1,computeWorker:R}=e,D=Math.max(2,Math.min(50,s)),M=r-b*2,$=i-b*2,A=a[0],I=a[1],P=l[0],L=l[1],E=I-A,B=L-P,z=q(()=>G=>b+(G-A)/E*M,[b,A,E,M]),k=q(()=>G=>b+(L-G)/B*$,[b,L,B,$]),w=q(()=>Xu(t,n,R,D,A,I,P,L,E,B),[t,n,R,D,A,I,P,L,E,B]),T=q(()=>{let G=0;for(let O=0;O<w.length;O++){let Y=w[O],X=Y.magnitude??Math.sqrt(Y.dx*Y.dx+Y.dy*Y.dy);X>G&&(G=X)}return G>0?G:1},[w]),C=q(()=>Math.min(M,$)/Math.max(D,2)/(2*T)*d,[M,$,D,T,d]);if(x==="canvas"){let G=te(null),O=te(0);return re(()=>{let Y=G.current;if(!Y)return;let X=Y.getContext("2d");if(X)return O.current&&cancelAnimationFrame(O.current),O.current=requestAnimationFrame(()=>{Ku(X,r,i,w,{padding:b,chartWidth:M,chartHeight:$,xMin:A,xMax:I,yMin:P,yMax:L,xSpan:E,ySpan:B,showGrid:h,showAxes:p,colorByMagnitude:c,colorScale:m,arrowColor:u,arrowWidth:g,effectiveArrowScale:C,maxMagnitude:T,title:f,tickFontSize:y})}),()=>{O.current&&cancelAnimationFrame(O.current)}},[w,r,i,b,M,$,A,I,P,L,E,B,h,p,c,m,u,g,C,T,f,y]),o("canvas",{ref:G,width:r,height:i,role:"img","aria-label":f??"Vector field plot",style:{fontFamily:"sans-serif",maxWidth:"100%"}})}let N=S(()=>{if(!h)return[];let G=[],O=$n(E,10),Y=Math.ceil(A/O)*O;for(let Z=Y;Z<=I;Z+=O){let ee=z(Z);G.push(o("line",{key:`gridv-${Z}`,x1:String(ee),y1:String(b),x2:String(ee),y2:String(b+$),stroke:"#e5e7eb","stroke-width":"0.5"})),G.push(o("text",{key:`xtick-${Z}`,x:String(ee),y:String(b+$+16),"text-anchor":"middle","font-size":String(y),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(Z*100)/100)))}let X=$n(B,10),U=Math.ceil(P/X)*X;for(let Z=U;Z<=L;Z+=X){let ee=k(Z);G.push(o("line",{key:`gridh-${Z}`,x1:String(b),y1:String(ee),x2:String(b+M),y2:String(ee),stroke:"#e5e7eb","stroke-width":"0.5"})),G.push(o("text",{key:`ytick-${Z}`,x:String(b-6),y:String(ee+4),"text-anchor":"end","font-size":String(y),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(Z*100)/100)))}return G},[h,A,I,P,L,E,B,z,k,b,M,$]),F=S(()=>{if(!p)return[];let G=[];if(P<=0&&L>=0){let O=k(0);G.push(o("line",{key:"axis-x",x1:String(b),y1:String(O),x2:String(b+M),y2:String(O),stroke:"#374151","stroke-width":String(g)}))}if(A<=0&&I>=0){let O=z(0);G.push(o("line",{key:"axis-y",x1:String(O),y1:String(b),x2:String(O),y2:String(b+$),stroke:"#374151","stroke-width":String(g)}))}return G.push(o("rect",{key:"chart-border",x:String(b),y:String(b),width:String(M),height:String($),fill:"none",stroke:"#d1d5db","stroke-width":"1"})),G},[p,A,I,P,L,z,k,b,M,$]),_=S(()=>{let G=[];for(let Y=0;Y<w.length;Y++){let X=w[Y],U=X.magnitude??Math.sqrt(X.dx*X.dx+X.dy*X.dy);if(U<1e-10)continue;let Z=z(X.x),ee=k(X.y),ae=X.dx*C,J=-X.dy*C,se=Z+ae,ce=ee+J,me;if(c){let ye=U/T;me=ta(ye,m)}else me=u;G.push(o("line",{key:`arrow-line-${Y}`,x1:String(Z),y1:String(ee),x2:String(se),y2:String(ce),stroke:me,"stroke-width":String(g),"stroke-linecap":"round"}));let ge=Math.sqrt(ae*ae+J*J);if(ge>2){let ye=ae/ge,le=J/ge,ne=-le,pe=ye,ie=Math.min(4,ge*.4),he=se-ye*ie+ne*ie*.5,xe=ce-le*ie+pe*ie*.5,Ce=se-ye*ie-ne*ie*.5,de=ce-le*ie-pe*ie*.5;G.push(o("polygon",{key:`arrow-head-${Y}`,points:`${se},${ce} ${he},${xe} ${Ce},${de}`,fill:me}))}}return G},[w,z,k,C,c,T,m,u]),H=S(()=>f?[o("text",{key:"title",x:String(r/2),y:String(b/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},f)]:[],[f,r,b]),W=N(),V=F(),K=_(),Q=H();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,...W,...V,...K)}function qu(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 Zu(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 oa(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:p,padding:c=60}=e,m=n-c*2,f=r-c*2,b=q(()=>qu(t),[t]),{minVal:y,maxVal:g}=q(()=>{let T=0,C=0;for(let N=0;N<b.length;N++){let F=b[N];F.start<T&&(T=F.start),F.end<T&&(T=F.end),F.start>C&&(C=F.start),F.end>C&&(C=F.end)}return T===C&&(C=T+1),{minVal:T,maxVal:C}},[b]),x=g-y,v=S(T=>c+f-(T-y)/x*f,[c,f,y,x]),R=q(()=>b.length===0?0:m/b.length,[b.length,m]),D=6,M=Math.max(1,R-D),$=S(()=>{if(!u)return[];let T=Zu(x),C=[],N=Math.ceil(y/T)*T;for(let F=N;F<=g;F+=T){let _=v(F);C.push(o("line",{key:`grid-${F}`,x1:String(c),y1:String(_),x2:String(c+m),y2:String(_),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),C.push(o("text",{key:`grid-label-${F}`,x:String(c-8),y:String(_+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(F)))}return C},[u,x,y,g,v,c,m]),A=S(()=>{let T=[];T.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=y<=0&&g>=0?v(0):c+f;return T.push(o("line",{key:"axis-x",x1:String(c),y1:String(C),x2:String(c+m),y2:String(C),stroke:"#374151","stroke-width":"1.5"})),T},[c,m,f,y,g,v]),I=S(()=>{if(b.length===0)return[];let T=[];for(let C=0;C<b.length;C++){let N=b[C],F=c+C*R+D/2,_=Math.max(N.start,N.end),H=Math.min(N.start,N.end),W=v(_),V=v(H),K=Math.max(0,V-W),Q;if(N.type==="total"?Q=a:N.type==="decrease"?Q=s:Q=i,T.push(o("rect",{key:`bar-${C}`,x:String(F),y:String(W),width:String(M),height:String(K),fill:Q,rx:"2",ry:"2"})),d){let G=N.type==="decrease"||N.value<0?V+14:W-4,O=N.type==="total"?String(N.value):(N.value>=0?"+":"")+String(N.value);T.push(o("text",{key:`val-${C}`,x:String(F+M/2),y:String(G),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},O))}if(T.push(o("text",{key:`cat-${C}`,x:String(F+M/2),y:String(c+f+16),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},N.label)),h&&C<b.length-1){let G=b[C+1],O=v(N.end),Y=c+(C+1)*R+D/2;G.type!=="total"&&T.push(o("line",{key:`conn-${C}`,x1:String(F+M),y1:String(O),x2:String(Y),y2:String(O),stroke:l,"stroke-width":"1","stroke-dasharray":"3 2"}))}}return T},[b,R,M,v,i,s,a,l,d,h,c,f]),P=S(()=>p?[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"},p)]:[],[p,n,c]),L=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=$(),B=A(),z=I(),k=P(),w=L();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??"Waterfall chart",style:{fontFamily:"sans-serif"}},...k,...E,...B,...z,...w)}var Ju=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],Qu=[0,-45,45,90];function ep(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)),p=a*u+l*h,c=a*h+l*u;return{x:r-p/2,y:i-c/2,w:p,h:c}}function tp(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 np(e,t,n){return e.x>=0&&e.y>=0&&e.x+e.w<=t&&e.y+e.h<=n}function op(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 ra(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=Qu,padding:u=4,spiral:h="archimedean",title:p}=e,c=q(()=>{if(t.length===0)return[];let f=t.map((M,$)=>({...M,originalIndex:$})).filter(M=>M.text.length>0&&M.weight>0).sort((M,$)=>$.weight-M.weight);if(f.length===0)return[];let b=f[f.length-1].weight,g=f[0].weight-b;function x(M){if(g===0)return(i+s)/2;let $=(M-b)/g;return i+$*(s-i)}let v=[],R=n/2,D=r/2;for(let M=0;M<f.length;M++){let $=f[M],A=x($.weight),I=d[op($.text)%d.length],P=$.color??l[M%l.length],L=!1,E=500,B=h==="archimedean"?4:5;for(let z=0;z<E;z++){let k,w;if(h==="archimedean"){let H=z*.1,W=B*H;k=W*Math.cos(H),w=W*Math.sin(H)}else{let H=Math.floor(z/4)+1,W=z%4,V=(z%4===0?0:z)*B;switch(W){case 0:k=H*B*4,w=V;break;case 1:k=-V,w=H*B*4;break;case 2:k=-H*B*4,w=-V;break;default:k=V,w=-H*B*4;break}}let T=R+k,C=D+w,N=ep($.text,A,I,T,C),F={x:N.x-u,y:N.y-u,w:N.w+u*2,h:N.h+u*2};if(!np(F,n,r))continue;let _=!1;for(let H of v)if(tp(F,H.bbox)){_=!0;break}if(!_){v.push({text:$.text,x:T,y:C,fontSize:A,rotation:I,color:P,bbox:F}),L=!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":p??"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 m=[];p&&m.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"},p));for(let f=0;f<c.length;f++){let b=c[f],y=b.rotation!==0?`translate(${b.x},${b.y}) rotate(${b.rotation})`:`translate(${b.x},${b.y})`;m.push(o("text",{key:`word-${f}`,transform:y,"text-anchor":"middle","dominant-baseline":"central","font-size":String(b.fontSize),"font-family":a,fill:b.color,"aria-label":b.text},b.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":p??"Word cloud",style:{fontFamily:a}},...m)}var rp={0:"#1e293b",1:"#3b82f6"},ip="#666";function ia(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:p=10,onCellClick:c,onCellHover:m,title:f}=e,b=n??rp,y=t.length,g=q(()=>{let T=0;for(let C=0;C<t.length;C++){let N=t[C];N!==void 0&&N.length>T&&(T=N.length)}return T},[t]),x=u?20:0,v=f?24:0,R=q(()=>{let T=r-p*2-x,C=i-p*2-x-v;if(y===0||g===0)return{cellWidth:0,cellHeight:0};let N=Math.max(0,(T-s*(g-1))/g),F=Math.max(0,(C-s*(y-1))/y);return{cellWidth:N,cellHeight:F}},[r,i,p,y,g,s,x,v]),D=S(T=>{let C=b[T];return C!==void 0?C:ip},[b]),M=S(()=>o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:h}),[r,i,h]),$=S(()=>f?[o("text",{key:"title",x:String(r/2),y:String(p+14),"text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#e2e8f0"},f)]:[],[f,r,p]),A=S(()=>{if(!l||y===0||g===0)return[];let{cellWidth:T,cellHeight:C}=R,N=p+x,F=p+x+v,_=g*T+(g-1)*s,H=y*C+(y-1)*s,W=[];for(let V=0;V<=g;V++){let K=N+V*(T+s)-s/2;W.push(o("line",{key:`vgrid-${V}`,x1:String(K),y1:String(F-s/2),x2:String(K),y2:String(F+H+s/2),stroke:d,"stroke-width":"0.5"}))}for(let V=0;V<=y;V++){let K=F+V*(C+s)-s/2;W.push(o("line",{key:`hgrid-${V}`,x1:String(N-s/2),y1:String(K),x2:String(N+_+s/2),y2:String(K),stroke:d,"stroke-width":"0.5"}))}return W},[l,y,g,R,p,x,v,s,d]),I=S(()=>{if(!u||y===0||g===0)return[];let{cellWidth:T,cellHeight:C}=R,N=p+x,F=p+x+v,_=[];for(let H=0;H<g;H++){let W=N+H*(T+s)+T/2,V=F-6;_.push(o("text",{key:`col-idx-${H}`,x:String(W),y:String(V),"text-anchor":"middle","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(H)))}for(let H=0;H<y;H++){let W=N-6,V=F+H*(C+s)+C/2+3;_.push(o("text",{key:`row-idx-${H}`,x:String(W),y:String(V),"text-anchor":"end","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(H)))}return _},[u,y,g,R,p,x,v,s]),P=S(()=>{if(y===0||g===0)return[];let{cellWidth:T,cellHeight:C}=R,N=p+x,F=p+x+v,_=[];for(let H=0;H<y;H++){let W=t[H];if(W!==void 0)for(let V=0;V<g;V++){let K=V<W.length?W[V]:0,Q=N+V*(T+s),G=F+H*(C+s),O=D(K),Y={key:`cell-${H}-${V}`,x:String(Q),y:String(G),width:String(T),height:String(C),fill:O,rx:String(a),ry:String(a)};if(c){let X=H,U=V,Z=K;Y.onClick=()=>c(X,U,Z),Y.role="button",Y.tabIndex=0}if(m){let X=H,U=V,Z=K;Y.onMouseEnter=()=>m(X,U,Z)}_.push(o("rect",Y))}}return _},[y,g,t,R,p,x,v,s,a,D,c,m]),L=M(),E=$(),B=A(),z=I(),k=P(),w=f?`${f} \u2014 ${y}x${g} discrete grid`:`${y}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},L,...E,...B,...z,...k)}
|