@asymmetric-effort/specifyjs 0.2.45 → 0.2.49
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=Symbol.for("spec.element"),t=Symbol.for("spec.provider"),n=Symbol.for("spec.consumer");function o(t,n,...o){let r=null,i=null;const l={};if(null!=n){void 0!==n.key&&(r=""+n.key),void 0!==n.ref&&(i=n.ref);for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&"key"!==e&&"ref"!==e&&"__proto__"!==e&&"constructor"!==e&&"prototype"!==e&&(l[e]=n[e])}if(1===o.length?l.children=o[0]:o.length>1&&(l.children=o),"function"==typeof t&&t.defaultProps){const e=t.defaultProps;for(const t of Object.keys(e))"__proto__"!==t&&"constructor"!==t&&void 0===l[t]&&(l[t]=e[t])}return{$$typeof:e,type:t,props:l,key:r,ref:i}}function r(e){const o={$$typeof:Symbol.for("spec.context"),Provider:null,Consumer:null,_currentValue:e,_defaultValue:e},r={$$typeof:t,_context:o},i={$$typeof:n,_context:o};return o.Provider=r,o.Consumer=i,o}function i(){throw new Error("Invalid hook call. Hooks can only be called inside the body of a function component.")}function l(e){return i().useState(e)}function a(e,t){return i().useEffect(e,t)}function s(e,t){return i().useCallback(e,t)}function d(e,t){return i().useMemo(e,t)}function c(e){return i().useRef(e)}function f(){return i().useId()}function u(){const e=("undefined"!=typeof window?window.location.hash:"").replace(/^#\/?/,"/");return""===e?"/":e}r({pathname:"/",params:{},navigate:()=>{throw new Error("useNavigate must be used inside a <Router> component.")},basePath:""}),u();const p=new Set;function h(e){if(!e)return new Date;const t=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),n=e=>Number(t.find(t=>t.type===e)?.value??0);return new Date(n("year"),n("month")-1,n("day"),n("hour"),n("minute"),n("second"))}"undefined"!=typeof window&&window.addEventListener("hashchange",function(){u(),"undefined"!=typeof window&&window.location.hash;for(const e of p)e()}),r({flags:{},isEnabled:()=>!1,setFlag:()=>{},loading:!1});const g="#334155",x="#1e293b",m="#374151";function y(e){const{format:t="12h",size:n=200,showDate:r=!1,dateFormat:i="short",showSeconds:s=!0,timezone:d,className:c}=e,[f,u]=l(h(d));a(()=>{const e=setInterval(()=>{u(h(d))},1e3);return()=>clearInterval(e)},[d]);const p=f.getHours(),y=f.getMinutes(),b=f.getSeconds(),v=p%12*30+.5*y,w=6*y+.1*b,k=6*b,S=n/2,$=n/2,M=n/2-10,z=M-4,C=M-22,I=[];I.push(o("circle",{cx:String(S),cy:String($),r:String(M),fill:"#f8fafc",stroke:g,"stroke-width":"3"}));for(let e=0;e<12;e++){const r=(30*e-90)*Math.PI/180,i=z-6;I.push(o("line",{x1:String(S+i*Math.cos(r)),y1:String($+i*Math.sin(r)),x2:String(S+z*Math.cos(r)),y2:String($+z*Math.sin(r)),stroke:g,"stroke-width":"2"}));const l=String(0===e?12:e);if(I.push(o("text",{x:String(S+C*Math.cos(r)),y:String($+C*Math.sin(r)),"text-anchor":"middle","dominant-baseline":"central",fill:m,"font-size":String(.08*n),"font-family":"sans-serif","font-weight":"600"},l)),"24h"===t){const t=M-38,i=String(0===e?0:e+12);I.push(o("text",{x:String(S+t*Math.cos(r)),y:String($+t*Math.sin(r)),"text-anchor":"middle","dominant-baseline":"central",fill:m,"font-size":String(.055*n),"font-family":"sans-serif",opacity:"0.6"},i))}}const A=(e,t,n,r)=>{const i=(e-90)*Math.PI/180;return o("line",{x1:String(S),y1:String($),x2:String(S+t*Math.cos(i)),y2:String($+t*Math.sin(i)),stroke:r,"stroke-width":n,"stroke-linecap":"round"})};I.push(A(v,.5*M,"4",x)),I.push(A(w,.75*M,"3",x)),s&&I.push(A(k,.85*M,"1.5","#ef4444")),I.push(o("circle",{cx:String(S),cy:String($),r:"4",fill:x}));const F=[o("svg",{width:String(n),height:String(n),viewBox:`0 0 ${n} ${n}`,xmlns:"http://www.w3.org/2000/svg"},...I)];return r&&F.push(o("div",{style:{textAlign:"center",marginTop:"8px",fontFamily:"sans-serif",fontSize:"14px",color:m}},function(e,t){const n=e.getFullYear(),o=e.getMonth(),r=e.getDate();switch(t){case"short":return`${String(o+1).padStart(2,"0")}/${String(r).padStart(2,"0")}/${n}`;case"long":return`${["January","February","March","April","May","June","July","August","September","October","November","December"][o]} ${String(r).padStart(2,"0")}, ${n}`;case"iso":return`${n}-${String(o+1).padStart(2,"0")}-${String(r).padStart(2,"0")}`}}(f,i))),o("div",{className:c,style:{display:"inline-flex",flexDirection:"column",alignItems:"center"}},...F)}const b={xs:24,sm:32,md:40,lg:56,xl:80},v=["#3b82f6","#ef4444","#22c55e","#a855f7","#f97316","#ec4899","#14b8a6","#6366f1","#eab308","#06b6d4"],w={online:"#22c55e",offline:"#9ca3af",busy:"#ef4444",away:"#eab308"};function k(e,t){const 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};default:return{top:n,right:n}}}function S(e){const{src:t,alt:n,name:r,size:i,shape:a="circle",fallbackColor:s,status:d,statusPosition:c="bottom-right"}=e,[f,u]=l(!1),p=function(e){return null==e?b.md:"number"==typeof e?e:b[e]??b.md}(i),h="circle"===a?"50%":`${Math.round(.15*p)}px`,g=s??function(e){if(!e)return"#9ca3af";let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return v[Math.abs(t)%v.length]}(r),x=`${Math.round(.4*p)}px`,m={position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:`${p}px`,height:`${p}px`,borderRadius:h,overflow:"hidden",flexShrink:"0"};let y;if(t&&!f)y=o("img",{src:t,alt:n??r??"avatar",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"},onError:()=>u(!0)});else{const e=function(e){if(!e)return"?";const t=e.trim().split(/\s+/);return 1===t.length?t[0].charAt(0).toUpperCase():(t[0].charAt(0)+t[t.length-1].charAt(0)).toUpperCase()}(r);y=o("span",{style:{fontSize:x,fontWeight:"600",color:"#fff",lineHeight:"1",userSelect:"none",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},"aria-hidden":"true"},e)}const S=o("div",{style:{...m,backgroundColor:t&&!f?"transparent":g},role:"img","aria-label":n??r??"avatar"},y);if(!d)return S;const $=Math.max(8,Math.round(.25*p));return o("div",{style:{position:"relative",display:"inline-flex",width:`${p}px`,height:`${p}px`,flexShrink:"0"}},S,o("span",{style:{position:"absolute",width:`${$}px`,height:`${$}px`,borderRadius:"50%",backgroundColor:w[d]??w.offline,border:"2px solid #fff",boxSizing:"border-box",...k(c,$)},"aria-label":d}))}const $={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"}},M={sm:{width:"6px",height:"6px"},md:{width:"8px",height:"8px"},lg:{width:"10px",height:"10px"}};function z(e){const{count:t,max:n,dot:r=!1,color:i="#ef4444",size:l="md",variant:a="solid",children:s}=e;let d=null;r||null==t||(d=null!=n&&t>n?`${n}+`:String(t));const c=r||null!=t&&t>0,f=r?{...M[l],borderRadius:"50%",..."solid"===a?{backgroundColor:i}:{backgroundColor:"transparent",border:`2px solid ${i}`}}:{...$[l],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",..."solid"===a?{backgroundColor:i,color:"#fff"}:{backgroundColor:"transparent",color:i,border:`2px solid ${i}`}},u=c?o("span",{style:f,"aria-label":r?"notification":`count ${d}`},d):null;if(null==s)return u??o("span",null);const p={...f,position:"absolute",top:"0",right:"0",transform:"translate(50%, -50%)",zIndex:"1"};return o("span",{style:{position:"relative",display:"inline-flex"}},s,c?o("span",{style:p,"aria-label":r?"notification":`count ${d}`},d):null)}const C={width:"100%",borderCollapse:"collapse",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",color:"#1f2937"},I={padding:"10px 12px",textAlign:"left",fontWeight:"600",backgroundColor:"#f9fafb",borderBottom:"2px solid #e5e7eb",userSelect:"none",whiteSpace:"nowrap"},A={padding:"10px 12px",borderBottom:"1px solid #e5e7eb"},F={marginLeft:"4px",fontSize:"12px",color:"#6b7280"},R={width:"100%",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",boxSizing:"border-box"},D={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",fontSize:"13px",color:"#6b7280"},L={padding:"4px 10px",margin:"0 2px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#fff",cursor:"pointer",fontSize:"13px"},W={...L,backgroundColor:"#3b82f6",color:"#fff",borderColor:"#3b82f6"},N={...L,opacity:"0.5",cursor:"default"},E={cursor:"pointer",width:"16px",height:"16px"};function T(e,t,n){return e!==t?"↕":"asc"===n?"↑":"↓"}function P(e){const{columns:t,data:n,pageSize:r,currentPage:i,onPageChange:a,sortBy:c,sortDir:f,onSort:u,selectable:p=!1,selectedRows:h,onSelectionChange:g,striped:x=!1,bordered:m=!1,compact:y=!1,stickyHeader:b=!1}=e,[v,w]=l(0),[k,S]=l(void 0),[$,M]=l("asc"),[z,P]=l([]),[B,_]=l({}),H=i??v,Y=c??k,j=f??$,q=h??z,O=d(()=>{const e=Object.entries(B).filter(([,e])=>e.length>0);return 0===e.length?n:n.filter(t=>e.every(([e,n])=>String(t[e]??"").toLowerCase().includes(n.toLowerCase())))},[n,B]),U=d(()=>{if(!Y)return O;const e=[...O];return e.sort((e,t)=>{const n=e[Y],o=t[Y];if(null==n&&null==o)return 0;if(null==n)return 1;if(null==o)return-1;if("number"==typeof n&&"number"==typeof o)return"asc"===j?n-o:o-n;const r=String(n),i=String(o),l=r.localeCompare(i);return"asc"===j?l:-l}),e},[O,Y,j]),X=U.length,V=r?Math.max(1,Math.ceil(X/r)):1,G=r?U.slice(H*r,(H+1)*r):U,K=s(e=>{a?a(e):w(e)},[a]),Z=s(e=>{const t=Y===e&&"asc"===j?"desc":"asc";u?u(e,t):(S(e),M(t))},[Y,j,u]),J=s(e=>{const t=q.includes(e)?q.filter(t=>t!==e):[...q,e];g?g(t):P(t)},[q,g]),Q=s(()=>{const e=G.map((e,t)=>r?H*r+t:t),t=e.every(e=>q.includes(e))?q.filter(t=>!e.includes(t)):[...new Set([...q,...e])];g?g(t):P(t)},[G,q,r,H,g]),ee=s((e,t)=>{_(n=>({...n,[e]:t})),K(0)},[K]),te=t.some(e=>e.filterable),ne=y?"6px 8px":A.padding,oe=[];if(p){const e=G.map((e,t)=>r?H*r+t:t),t=e.length>0&&e.every(e=>q.includes(e));oe.push(o("th",{key:"__select_all",style:{...I,padding:ne,width:"40px",textAlign:"center",...b?{position:"sticky",top:"0",zIndex:"2"}:{}}},o("input",{type:"checkbox",checked:t,onChange:Q,style:E,"aria-label":"Select all rows"})))}for(const e of t){const t={...I,padding:ne,...e.width?{width:e.width}:{},...e.sortable?{cursor:"pointer"}:{},...m?{border:"1px solid #e5e7eb"}:{},...b?{position:"sticky",top:"0",zIndex:"2"}:{}},n=[e.header];e.sortable&&n.push(o("span",{style:F},T(e.key,Y,j))),oe.push(o("th",{key:e.key,style:t,onClick:e.sortable?()=>Z(e.key):void 0,onKeyDown:e.sortable?t=>{const n=t.key;"Enter"!==n&&" "!==n||(t.preventDefault(),Z(e.key))}:void 0,tabIndex:e.sortable?0:void 0,role:e.sortable?"columnheader":void 0,"aria-sort":Y===e.key?"asc"===j?"ascending":"descending":void 0},...n))}let re=null;if(te){const e=[];p&&e.push(o("th",{key:"__filter_spacer",style:{padding:ne}}));for(const n of t)e.push(o("th",{key:`filter_${n.key}`,style:{padding:"4px 8px",backgroundColor:"#f9fafb"}},n.filterable?o("input",{type:"text",placeholder:`Filter ${n.header}...`,style:R,value:B[n.key]??"",onInput:e=>ee(n.key,e.target.value),"aria-label":`Filter by ${n.header}`}):null));re=o("tr",{key:"__filter_row"},...e)}const ie=[];for(let e=0;e<G.length;e++){const n=G[e],i=r?H*r+e:e,l=q.includes(i),a={};x&&e%2==1&&(a.backgroundColor="#f9fafb"),l&&(a.backgroundColor="#eff6ff");const s=[];p&&s.push(o("td",{key:"__select",style:{padding:ne,textAlign:"center",...A,...m?{border:"1px solid #e5e7eb"}:{}}},o("input",{type:"checkbox",checked:l,onChange:()=>J(i),style:E,"aria-label":`Select row ${i+1}`})));for(const e of t){const t=n[e.key],r=e.render?e.render(t,n):String(t??"");s.push(o("td",{key:e.key,style:{...A,padding:ne,...m?{border:"1px solid #e5e7eb"}:{}}},r))}ie.push(o("tr",{key:String(i),style:a},...s))}let le=null;if(r){const e=0===X?0:H*r+1,t=Math.min((H+1)*r,X),n=[];n.push(o("button",{key:"prev",style:0===H?N:L,onClick:H>0?()=>K(H-1):void 0,disabled:0===H,"aria-label":"Previous page"},"← Prev"));const i=7;let l=Math.max(0,H-Math.floor(i/2));const a=Math.min(V,l+i);a-l<i&&(l=Math.max(0,a-i)),l>0&&(n.push(o("button",{key:"p0",style:L,onClick:()=>K(0)},"1")),l>1&&n.push(o("span",{key:"e1",style:{margin:"0 4px"}},"...")));for(let e=l;e<a;e++)n.push(o("button",{key:`p${e}`,style:e===H?W:L,onClick:e!==H?()=>K(e):void 0,"aria-current":e===H?"page":void 0},String(e+1)));a<V&&(a<V-1&&n.push(o("span",{key:"e2",style:{margin:"0 4px"}},"...")),n.push(o("button",{key:"p"+(V-1),style:L,onClick:()=>K(V-1)},String(V)))),n.push(o("button",{key:"next",style:H>=V-1?N:L,onClick:H<V-1?()=>K(H+1):void 0,disabled:H>=V-1,"aria-label":"Next page"},"Next →")),le=o("div",{style:D},o("span",null,`Showing ${e}–${t} of ${X}`),o("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},...n))}const ae={width:"100%",...b?{overflow:"auto",maxHeight:"600px"}:{}},se={...C,...m?{border:"1px solid #e5e7eb"}:{}},de=o("thead",null,o("tr",null,...oe),re),ce=o("tbody",null,...ie),fe=o("table",{style:se,role:"grid","aria-rowcount":String(X)},de,ce);return o("div",{style:ae},fe,le)}function B(e){return e<10?`0${e}`:String(e)}const _={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"},H={fontSize:"2rem",fontWeight:"600",letterSpacing:"2px",lineHeight:"1"},Y={fontSize:"0.875rem",fontWeight:"400",marginLeft:"4px",verticalAlign:"super"},j={fontSize:"0.75rem",color:"#94a3b8",marginTop:"4px"};function q(e){const{format:t="12h",showDate:n=!1,dateFormat:r="short",showSeconds:i=!0,timezone:s,className:d}=e,[c,f]=l(new Date);a(()=>{const e=setInterval(()=>{f(new Date)},1e3);return()=>clearInterval(e)},[]);const{hours:u,minutes:p,seconds:h}=function(e,t){if(t){const n=new Intl.DateTimeFormat("en-US",{timeZone:t,hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}).formatToParts(e),o=e=>Number(n.find(t=>t.type===e)?.value??0);return{hours:o("hour"),minutes:o("minute"),seconds:o("second")}}return{hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()}}(c,s);let g,x=null;"12h"===t?(x=u>=12?"PM":"AM",g=u%12||12):g=u;let m=`${B(g)}:${B(p)}`;i&&(m+=`:${B(h)}`);const y=[m];null!=x&&y.push(o("span",{style:Y},x));const b=[o("span",{style:H},...y)];return n&&b.push(o("span",{style:j},function(e,t,n){if(n){const o={timeZone:n};if("short"===t)return Object.assign(o,{month:"2-digit",day:"2-digit",year:"numeric"}),new Intl.DateTimeFormat("en-US",o).format(e);if("long"===t)return Object.assign(o,{month:"long",day:"numeric",year:"numeric"}),new Intl.DateTimeFormat("en-US",o).format(e);Object.assign(o,{year:"numeric",month:"2-digit",day:"2-digit"});const r=new Intl.DateTimeFormat("en-CA",o).formatToParts(e),i=e=>r.find(t=>t.type===e)?.value??"";return`${i("year")}-${i("month")}-${i("day")}`}return"short"===t?`${B(e.getMonth()+1)}/${B(e.getDate())}/${e.getFullYear()}`:"long"===t?new Intl.DateTimeFormat("en-US",{month:"long",day:"numeric",year:"numeric"}).format(e):`${e.getFullYear()}-${B(e.getMonth()+1)}-${B(e.getDate())}`}(c,r,s))),o("div",{style:_,...d?{class:d}:{}},...b)}const O={listStyle:"none",margin:"0",padding:"0",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px"},U={padding:"10px 14px",color:"var(--color-text, #1f2937)"},X={borderBottom:"1px solid var(--color-border, #e5e7eb)"},V={cursor:"pointer",transition:"background-color 0.15s ease"},G={backgroundColor:"var(--color-bg-muted, #eff6ff)"},K={padding:"24px",textAlign:"center",color:"var(--color-text-muted, #9ca3af)",fontSize:"14px"},Z={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 J(e){const{items:t,renderItem:n,keyExtractor:r,divider:i=!1,hoverable:l=!1,selectedIndex:a,onSelect:s,emptyMessage:d="No items",header:c,footer:f}=e;if(0===t.length)return o("div",null,c?o("div",{style:Z},c):null,o("div",{style:K},d),f?o("div",{style:{...Z,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},f):null);const u=[];for(let e=0;e<t.length;e++){const d=t[e],c=r(d,e),f=a===e,p=e===t.length-1,h={...U,...l?V:{},...f?G:{},...i&&!p?X:{}};u.push(o("li",{key:c,style:h,onClick:s?()=>s(e):void 0,onKeyDown:s?t=>{const n=t.key;"Enter"!==n&&" "!==n||(t.preventDefault(),s(e))}:void 0,role:s?"option":void 0,tabIndex:s?0:void 0,"aria-selected":s?String(f):void 0},n(d,e)))}return o("div",null,c?o("div",{style:Z},c):null,o("ul",{style:O,role:s?"listbox":"list"},...u),f?o("div",{style:{...Z,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},f):null)}function Q(e,t){const n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec({red:"#ef4444",blue:"#3b82f6",green:"#22c55e",yellow:"#eab308",purple:"#a855f7",pink:"#ec4899",orange:"#f97316",gray:"#6b7280",indigo:"#6366f1",teal:"#14b8a6",cyan:"#06b6d4"}[e]??e);return n?`rgba(${parseInt(n[1],16)}, ${parseInt(n[2],16)}, ${parseInt(n[3],16)}, ${t})`:e}const ee={sm:{fontSize:"11px",padding:"2px 8px",gap:"4px"},md:{fontSize:"13px",padding:"4px 10px",gap:"6px"},lg:{fontSize:"15px",padding:"6px 14px",gap:"8px"}},te={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 ne(e){const{label:t,color:n,variant:r="subtle",size:i="md",removable:l=!1,onRemove:a,icon:s,onClick:d,disabled:c=!1}=e,f=function(e){return e??"#3b82f6"}(n),u=function(e,t,n,o,r){const i=ee[n],l={display:"inline-flex",alignItems:"center",gap:i.gap,borderRadius:"9999px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:i.fontSize,fontWeight:"500",padding:i.padding,lineHeight:"1.4",whiteSpace:"nowrap",border:"none",transition:"opacity 0.15s ease, filter 0.15s ease",...o?{cursor:"pointer"}:{},...r?{opacity:"0.5",cursor:"default",pointerEvents:"none"}:{}};switch(t){case"solid":return{...l,backgroundColor:e,color:"#fff",border:"none"};case"outline":return{...l,backgroundColor:"transparent",color:e,border:`1px solid ${e}`};case"subtle":return{...l,backgroundColor:Q(e,.12),color:e,border:"none"};default:return l}}(f,r,i,!!d,c),p=[];return s&&p.push(o("span",{key:"icon",style:{display:"inline-flex",flexShrink:"0"}},s)),p.push(o("span",{key:"label"},t)),l&&p.push(o("button",{key:"remove",type:"button",style:te,onClick:e=>{e.stopPropagation(),!c&&a&&a()},"aria-label":`Remove ${t}`,disabled:c},"×")),o("span",{style:u,role:d?"button":void 0,tabIndex:d&&!c?"0":void 0,onClick:!c&&d?d:void 0,onKeyDown:d&&!c?e=>{const t=e.key;"Enter"!==t&&" "!==t||(e.preventDefault(),d())}:void 0,"aria-disabled":c?"true":void 0},...p)}const oe={overflow:"auto",position:"relative",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'};function re(e){const{items:t,renderItem:n,itemHeight:r,overscan:i=5,height:a}=e,[d,f]=l(0),u=c(null),p=t.length*r,h=parseInt(a,10)||400,g=Math.ceil(h/r),x=Math.max(0,Math.floor(d/r)-i),m=Math.min(t.length,Math.floor(d/r)+g+i),y=s(e=>{const t=e.target;f(t.scrollTop)},[]),b=[];for(let e=x;e<m;e++)b.push(o("div",{key:String(e),style:{position:"absolute",top:e*r+"px",left:"0",right:"0",height:`${r}px`,overflow:"hidden"}},n(t[e],e)));return o("div",{ref:u,style:{...oe,height:a},onScroll:y},o("div",{style:{height:`${p}px`,position:"relative",width:"100%"}},...b))}const ie={info:{icon:"ℹ️",bg:"#eff6ff",border:"#3b82f6",text:"#1e40af",filledBg:"#3b82f6",filledText:"#ffffff"},success:{icon:"✅",bg:"#f0fdf4",border:"#22c55e",text:"#166534",filledBg:"#22c55e",filledText:"#ffffff"},warning:{icon:"⚠️",bg:"#fffbeb",border:"#f59e0b",text:"#92400e",filledBg:"#f59e0b",filledText:"#ffffff"},error:{icon:"❌",bg:"#fef2f2",border:"#ef4444",text:"#991b1b",filledBg:"#ef4444",filledText:"#ffffff"}};function le(e){const[t,n]=l(!0),r=e.type??"info",i=e.variant??"subtle",a=ie[r]??ie.info,s=e.icon??a.icon,c=e.message??e.children,f=d(()=>{const e={display:"flex",alignItems:"flex-start",gap:"12px",padding:"12px 16px",borderRadius:"8px",fontSize:"14px",lineHeight:"1.5"};return"filled"===i?(e.backgroundColor=a.filledBg,e.color=a.filledText):"outline"===i?(e.backgroundColor="transparent",e.border=`1px solid ${a.border}`,e.color=a.text):(e.backgroundColor=a.bg,e.color=a.text),e},[i,a]);return t?o("div",{role:"alert",style:f},o("span",{style:{flexShrink:"0",fontSize:"16px",lineHeight:"1.5"}},s),o("div",{style:{flex:"1",minWidth:"0"}},e.title?o("div",{style:{fontWeight:"600",marginBottom:c?"4px":"0"}},e.title):null,c?o("div",null,c):null,e.action?o("button",{onclick:e.action.onClick,style:{marginTop:"8px",padding:"4px 12px",fontSize:"13px",fontWeight:"500",border:"filled"===i?"1px solid currentColor":`1px solid ${a.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"}},"×"):null):null}function ae(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 se(e){const 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",l=e.backgroundColor??"#e5e7eb",a=e.height??("string"==typeof e.size?e.size:"number"==typeof e.size?`${e.size}px`:"8px"),s=e.variant??"bar",c=f().replace(/[^a-zA-Z0-9_-]/g,"");if("circular"===s){const t="number"==typeof e.size?e.size:48,n=Math.max(2,Math.round(t/10)),a=(t-n)/2,s=2*Math.PI*a,d=e.indeterminate?.75*s:s-r/100*s,f=e.indeterminate?`@keyframes liq-spin-${c}{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}`:e.animated?`@keyframes liq-pulse-${c}{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"}},f?o("style",null,f):null,o("svg",{width:String(t),height:String(t),viewBox:`0 0 ${t} ${t}`,style:e.indeterminate?{animation:`liq-spin-${c} 1s linear infinite`}:e.animated?{animation:`liq-pulse-${c} 1.5s ease-in-out infinite`}:{}},o("circle",{cx:String(t/2),cy:String(t/2),r:String(a),fill:"none",stroke:l,"stroke-width":String(n)}),o("circle",{cx:String(t/2),cy:String(t/2),r:String(a),fill:"none",stroke:i,"stroke-width":String(n),"stroke-dasharray":String(s),"stroke-dashoffset":String(d),"stroke-linecap":"round",transform:`rotate(-90 ${t/2} ${t/2})`,style:{transition:"stroke-dashoffset 0.3s ease"}})),e.showLabel&&!e.indeterminate?o("span",{style:{fontSize:"14px",color:"#374151"}},`${Math.round(r)}%`):null)}const u=e.animated||e.indeterminate?`@keyframes liq-shimmer-${c}{0%{background-position:-200% 0}100%{background-position:200% 0}}`:"",p=e.indeterminate?`@keyframes liq-indeterminate-${c}{0%{left:-40%;width:40%}50%{left:20%;width:60%}100%{left:100%;width:40%}}`:"",h={width:"100%",height:a,backgroundColor:l,borderRadius:a,overflow:"hidden",position:"relative"},g=d(()=>{const t={height:"100%",borderRadius:a,transition:"width 0.3s ease"};return e.indeterminate?(t.position="absolute",t.animation=`liq-indeterminate-${c} 1.5s ease-in-out infinite`,t.backgroundColor=i):(t.width=`${r}%`,t.backgroundColor=i),e.animated&&!e.indeterminate&&(t.backgroundImage=`linear-gradient(90deg, ${i} 0%, ${function(e){const t=e.replace("#","");if(6!==t.length)return e;const n=Math.min(255,parseInt(t.slice(0,2),16)+40),o=Math.min(255,parseInt(t.slice(2,4),16)+40),r=Math.min(255,parseInt(t.slice(4,6),16)+40);return`#${n.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}`}(i)} 50%, ${i} 100%)`,t.backgroundSize="200% 100%",t.animation=`liq-shimmer-${c} 1.5s ease-in-out infinite`),t},[r,i,a,e.animated,e.indeterminate,c]);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||p?o("style",null,u+p):null,e.showLabel&&!e.indeterminate?o("div",{style:{marginBottom:"4px",fontSize:"12px",color:"#374151",textAlign:"right"}},`${Math.round(r)}%`):null,o("div",{style:h},o("div",{style:g})))}function de(e){const t=e.variant??"text",n=!1!==e.animated,r=f().replace(/[^a-zA-Z0-9_-]/g,""),i=d(()=>n?`@keyframes liq-shimmer-${r}{0%{background-position:-200% 0}100%{background-position:200% 0}}`:"",[n,r]),l="number"==typeof e.width?`${e.width}px`:e.width,a="number"==typeof e.height?`${e.height}px`:e.height;if("text"===t){const t=e.lines??1,s=[];for(let i=0;i<t;i++){const d=i===t-1&&t>1;s.push(o("div",{key:String(i),style:ce({width:d?"75%":l??"100%",height:a??"1em",borderRadius:e.borderRadius??"4px",animated:n,animId:r,marginBottom:i<t-1?"8px":"0"})}))}return o("div",{"aria-hidden":"true",style:{width:l??"100%"}},i?o("style",null,i):null,...s)}if("circular"===t){const e=l??a??"40px";return o("div",{"aria-hidden":"true"},i?o("style",null,i):null,o("div",{style:ce({width:e,height:e,borderRadius:"50%",animated:n,animId:r})}))}return o("div",{"aria-hidden":"true"},i?o("style",null,i):null,o("div",{style:ce({width:l??"100%",height:a??"100px",borderRadius:e.borderRadius??"4px",animated:n,animId:r})}))}function ce(e){const 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}const fe={sm:16,md:24,lg:40},ue={slow:"1.2s",normal:"0.75s",fast:"0.45s"};function pe(e){const t="number"==typeof e.size?e.size:fe[e.size??"md"]??24,n=e.color??"#3b82f6",r=e.thickness??Math.max(2,Math.round(t/8)),i=ue[e.speed??"normal"]??ue.normal,l=e.label??"Loading",a=f().replace(/[^a-zA-Z0-9_-]/g,""),s=(t-r)/2,c=2*Math.PI*s;return o("span",{role:"status","aria-label":l,style:{display:"inline-flex",alignItems:"center",justifyContent:"center"}},o("style",null,d(()=>`@keyframes liq-rotate-${a}{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}`,[a])),o("svg",{width:String(t),height:String(t),viewBox:`0 0 ${t} ${t}`,style:{animation:`liq-rotate-${a} ${i} linear infinite`}},o("circle",{cx:String(t/2),cy:String(t/2),r:String(s),fill:"none",stroke:n,"stroke-width":String(r),"stroke-dasharray":`${.7*c} ${.3*c}`,"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"}},l))}function he(e){const t=e.styling??{},n=!!e.error,r={display:"flex",flexDirection:"column",gap:t.gap??"4px",width:"number"==typeof t.width?`${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"},l={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:l,role:"alert"},e.error):e.helpText?o("div",{className:"form-field__help",style:l},e.helpText):null)}function ge(e,t){const 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??{}}}const xe={sm:{box:14,icon:10,fontSize:"12px"},md:{box:18,icon:12,fontSize:"14px"},lg:{box:22,icon:16,fontSize:"16px"}};function me(e){const t=f().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{checked:r,onChange:i,label:l,indeterminate:d=!1,disabled:u=!1,error:p,size:h="md"}=e,g=c(null);a(()=>{g.current&&(g.current.indeterminate=d)},[d]);const x=s(()=>{u||i(!r)},[u,r,i]),m=s(e=>{u||" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),i(!r))},[u,r,i]),y=xe[h],b=`${y.box}px`,v={width:b,height:b,minWidth:b,borderRadius:"4px",border:"2px solid "+(p?"#ef4444":r||d?"#3b82f6":"#d1d5db"),backgroundColor:r||d?"#3b82f6":"#ffffff",display:"flex",alignItems:"center",justifyContent:"center",cursor:u?"not-allowed":"pointer",transition:"all 0.15s",boxSizing:"border-box"},w={color:"#ffffff",fontSize:`${y.icon}px`,lineHeight:"1",fontWeight:"700"},k=d?o("span",{style:w},"—"):r?o("span",{style:w},"✓"):null,S={display:"inline-flex",alignItems:"center",gap:"8px",cursor:u?"not-allowed":"pointer",opacity:u?"0.6":"1",userSelect:"none"},$=o("input",{ref:g,type:"checkbox",id:n,checked:r,disabled:u,onChange:()=>i(!r),style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},"aria-hidden":"true",tabIndex:-1}),M=o("div",{style:v},k),z=l?o("span",{style:{fontSize:y.fontSize,color:"#374151"}},l):null;return o(he,{error:p,htmlFor:n},o("div",{style:S,onClick:x,onKeyDown:m,tabIndex:u?-1:0,role:"checkbox","aria-checked":d?"mixed":r?"true":"false","aria-disabled":u?"true":void 0,"aria-label":l},$,M,z))}const ye=["#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 be(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e)}function ve(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 we(e){const t=f().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,presets:d=ye,showInput:u=!0,showAlpha:p=!1,disabled:h=!1,label:g}=e,[x,m]=l(!1),[y,b]=l(r),v=c(null);a(()=>{b(r)},[r]),a(()=>{const e=e=>{v.current&&!v.current.contains(e.target)&&m(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const w=s(e=>{h||i(ve(e))},[h,i]),k=s(e=>{const t=e.target.value;b(t);const n=t.startsWith("#")?t:`#${t}`;be(n)&&i(ve(n))},[i]),S=s(()=>{be(y.startsWith("#")?y:`#${y}`)||b(r)},[y,r]),$={width:"36px",height:"36px",borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:r,cursor:h?"not-allowed":"pointer",flexShrink:"0"},M={display:"grid",gridTemplateColumns:"repeat(10, 1fr)",gap:"4px",marginBottom:u?"8px":"0"},z=d.map(e=>{const t=ve(e)===ve(r);return o("div",{key:e,style:{width:"20px",height:"20px",borderRadius:"3px",backgroundColor:e,cursor:h?"not-allowed":"pointer",border:t?"2px solid #1f2937":"1px solid #e5e7eb",boxSizing:"border-box"},onClick:()=>w(e),onKeyDown:t=>{const n=t.key;"Enter"!==n&&" "!==n||(t.preventDefault(),w(e))},role:"button",tabIndex:h?-1:0,title:e,"aria-label":`Select color ${e}`})}),C=u?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:y,onInput:k,onBlur:S,disabled:h,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,I=x?o("div",{style:{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"}},o("div",{style:M},...z),C):null;return o(he,{label:g,disabled:h,htmlFor:n},o("div",{ref:v,style:{position:"relative"}},o("div",{style:{display:"flex",alignItems:"center",gap:"8px"},onClick:h?void 0:()=>m(!x),onKeyDown:h?void 0:e=>{const t=e.key;"Enter"!==t&&" "!==t||(e.preventDefault(),m(!x))},role:"button",tabIndex:h?-1:0,"aria-expanded":x?"true":"false","aria-label":"Toggle color picker"},o("div",{id:n,style:$}),u?o("span",{style:{fontSize:"14px",fontFamily:"monospace",color:"#1f2937"}},r):null),I))}function ke(e){const t=f().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`cw-${t}`,{value:r="#000000",onChange:i,size:a=32,showLabel:d=!0,disabled:u=!1,label:p}=e,[h,g]=l(r);return o(he,{label:p,htmlFor:n},o("div",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"4px"}},o("div",{style:{width:`${a}px`,height:`${a}px`,borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:h,cursor:u?"not-allowed":"pointer",position:"relative",overflow:"hidden"}},o("input",{id:n,ref:c(null),type:"color",value:h,onInput:s((...e)=>{const t=e[0].target.value;g(t),i?.(t)},[i]),disabled:u,style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",opacity:"0",cursor:u?"not-allowed":"pointer",border:"none",padding:"0"},"aria-label":p||"Color"})),d?o("span",{style:{fontSize:"11px",fontFamily:"monospace",color:"#64748b"}},h):null))}const Se=["January","February","March","April","May","June","July","August","September","October","November","December"],$e=["Su","Mo","Tu","We","Th","Fr","Sa"];function Me(e){if(!e)return null;if(e instanceof Date)return e;const t=new Date(e);return isNaN(t.getTime())?null:t}function ze(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function Ce(e){const t=f().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,format:u="YYYY-MM-DD",minDate:p,maxDate:h,disabled:g=!1,placeholder:x="Select date...",label:m,error:y}=e,b=d(()=>Me(r),[r]),v=d(()=>Me(p),[p]),w=d(()=>Me(h),[h]),[k,S]=l(!1),[$,M]=l(()=>b?b.getFullYear():(new Date).getFullYear()),[z,C]=l(()=>b?b.getMonth():(new Date).getMonth()),I=c(null),A=d(()=>new Date,[]);a(()=>{const e=e=>{I.current&&!I.current.contains(e.target)&&S(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const F=s(()=>{C(e=>0===e?(M(e=>e-1),11):e-1)},[]),R=s(()=>{C(e=>11===e?(M(e=>e+1),0):e+1)},[]),D=s(e=>{const t=new Date($,z,e);v&&t<v||w&&t>w||(i(function(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}(t)),S(!1))},[$,z,i,v,w]),L=b?function(e,t){const n=e.getFullYear(),o=e.getMonth()+1,r=e.getDate();return t.replace("YYYY",String(n)).replace("MM",String(o).padStart(2,"0")).replace("DD",String(r).padStart(2,"0"))}(b,u):"",W=d(()=>{const e=new Date($,z,1).getDay(),t=new Date($,z+1,0).getDate(),n=[];let o=[];for(let t=0;t<e;t++)o.push(null);for(let e=1;e<=t;e++)o.push(e),7===o.length&&(n.push(o),o=[]);for(;o.length>0&&o.length<7;)o.push(null);return o.length&&n.push(o),n},[$,z]),N={...ge({},{focused:k,error:!!y}),cursor:g?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",minHeight:"38px",userSelect:"none"},E={background:"none",border:"none",cursor:"pointer",fontSize:"16px",padding:"4px 8px",color:"#374151",borderRadius:"4px"},T=$e.map(e=>o("div",{key:e,style:{padding:"4px"}},e)),P=W.map((e,t)=>{const n=e.map((e,n)=>{if(null===e)return o("div",{key:`empty-${t}-${n}`,style:{padding:"4px"}});const r=new Date($,z,e),i=ze(r,A),l=!!b&&ze(r,b),a=v&&r<v||w&&r>w;return o("div",{key:`day-${e}`,style:{padding:"4px",textAlign:"center",cursor:a?"not-allowed":"pointer",borderRadius:"4px",fontSize:"13px",fontWeight:i?"700":"400",backgroundColor:l?"#3b82f6":"transparent",color:l?"#ffffff":a?"#d1d5db":i?"#3b82f6":"#1f2937",border:i&&!l?"1px solid #3b82f6":"1px solid transparent",lineHeight:"1.8"},onClick:a?void 0:()=>D(e),onKeyDown:a?void 0:t=>{const n=t.key;"Enter"!==n&&" "!==n||(t.preventDefault(),D(e))},role:a?void 0:"button",tabIndex:a?void 0:0,"aria-label":`${Se[z]} ${e}, ${$}`,"aria-disabled":a?"true":void 0},String(e))});return o("div",{key:`row-${t}`,style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)"}},...n)}),B=k?o("div",{style:{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"}},o("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"8px"}},o("button",{type:"button",style:E,onClick:F},"◀"),o("span",{style:{fontWeight:"600",fontSize:"14px",color:"#1f2937"}},`${Se[z]} ${$}`),o("button",{type:"button",style:E,onClick:R},"▶")),o("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",textAlign:"center",fontSize:"11px",fontWeight:"600",color:"#6b7280",marginBottom:"4px"}},...T),...P):null;return o(he,{label:m,error:y,disabled:g,htmlFor:n},o("div",{ref:I,style:{position:"relative"}},o("div",{id:n,style:N,onClick:g?void 0:()=>S(!k),onKeyDown:g?void 0:e=>{const t=e.key;"Enter"!==t&&" "!==t||(e.preventDefault(),S(!k))},tabIndex:g?-1:0,role:"button","aria-label":"Pick a date","aria-expanded":k?"true":"false"},o("span",{style:{color:L?"#1f2937":"#9ca3af"}},L||x),o("span",{style:{color:"#6b7280",fontSize:"14px"}},"📅")),B))}function Ie(e){if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(0===t?0:1)} ${["B","KB","MB","GB"][t]}`}function Ae(e){const t=f().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`fu-${t}`,{onChange:r,accept:i,multiple:a=!1,maxSize:d,disabled:u=!1,label:p,helpText:h}=e,[g,x]=l([]),[m,y]=l(!1),[b,v]=l(""),w=c(null),k=s(e=>{v("");const t=[];for(const n of e)d&&n.size>d?v(`File "${n.name}" exceeds maximum size of ${Ie(d)}`):t.push(n);const n=a?[...g,...t]:t.slice(0,1);x(n),r(n)},[g,a,d,r]),S=s(e=>{if(e.preventDefault(),e.stopPropagation(),y(!1),u)return;const t=e.dataTransfer;if(!t)return;const n=Array.from(t.files);k(n)},[u,k]),$=s(e=>{e.preventDefault(),e.stopPropagation(),u||y(!0)},[u]),M=s(e=>{e.preventDefault(),e.stopPropagation(),y(!1)},[]),z=s(e=>{const t=e.target;t.files&&(k(Array.from(t.files)),t.value="")},[k]),C=s(e=>{const t=g.filter((t,n)=>n!==e);x(t),r(t)},[g,r]),I=s(()=>{u||w.current&&w.current.click()},[u]),A={border:"2px dashed "+(m?"#3b82f6":b?"#ef4444":"#d1d5db"),borderRadius:"8px",padding:"24px",textAlign:"center",cursor:u?"not-allowed":"pointer",backgroundColor:m?"#eff6ff":"#fafafa",transition:"all 0.15s",opacity:u?"0.6":"1"},F={fontSize:"12px",color:"#9ca3af"},R=o("input",{id:n,ref:w,type:"file",accept:i,multiple:a,onChange:z,disabled:u,style:{display:"none"},tabIndex:-1}),D=o("div",{style:A,onClick:I,onKeyDown:e=>{const t=e.key;"Enter"!==t&&" "!==t||(e.preventDefault(),I())},onDrop:S,onDragOver:$,onDragLeave:M,role:"button",tabIndex:u?-1:0,"aria-label":"Upload files"},o("div",{style:{fontSize:"28px",color:"#9ca3af",marginBottom:"8px"}},"↑"),o("div",{style:{fontSize:"14px",color:"#374151",marginBottom:"4px"}},o("span",{style:{color:"#3b82f6",fontWeight:"500"}},"Click to upload")," or drag and drop"),i?o("div",{style:F},i):null,d?o("div",{style:F},`Max size: ${Ie(d)}`):null),L=g.length>0?o("div",{style:{marginTop:"8px",display:"flex",flexDirection:"column",gap:"4px"}},...g.map((e,t)=>o("div",{key:`file-${t}`,style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",backgroundColor:"#f9fafb",borderRadius:"6px",border:"1px solid #e5e7eb",fontSize:"13px"}},o("div",{style:{display:"flex",alignItems:"center",gap:"8px",overflow:"hidden"}},o("span",{style:{color:"#374151",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},e.name),o("span",{style:{color:"#9ca3af",fontSize:"11px",flexShrink:"0"}},Ie(e.size))),o("button",{type:"button",style:{background:"none",border:"none",cursor:"pointer",color:"#ef4444",fontSize:"14px",padding:"2px 6px",borderRadius:"4px"},onClick:e=>{e.stopPropagation(),C(t)},"aria-label":`Remove ${e.name}`},"✕")))):null;return o(he,{label:p,helpText:h,error:b||void 0,disabled:u,htmlFor:n},o("div",null,R,D,L))}function Fe(e){const[t,n]=l(!1),[r,i]=l((e.value??e.defaultValue??"").length),a=f().replace(/[^a-zA-Z0-9_-]/g,""),d=e.id??`ml-${a}`,c={...ge(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(t=>{const n=t.target,o=n.value;i(o.length),e.onChange&&e.onChange(o),e.autoResize&&(n.style.height="auto",n.style.height=`${n.scrollHeight}px`)},[e.onChange,e.autoResize]),p=o("textarea",{id:d,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:c,onFocus:()=>n(!0),onBlur:t=>{n(!1),e.onBlur&&e.onBlur(t.target.value)},onInput:u}),h=e.showCount&&e.maxLength?o("div",{style:{fontSize:"11px",color:r>.9*(e.maxLength??1/0)?"#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(he,{label:e.label,htmlFor:d,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},p,h)}function Re(e){const t=f().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`ns-${t}`,{value:r,onChange:i,min:a,max:d,step:c=1,disabled:u=!1,prefix:p,suffix:h,label:g,error:x}=e,[m,y]=l(!1),b=s(e=>{let t=e;return void 0!==a&&t<a&&(t=a),void 0!==d&&t>d&&(t=d),t},[a,d]),v=s(()=>{u||i(b(r+c))},[u,r,c,b,i]),w=s(()=>{u||i(b(r-c))},[u,r,c,b,i]),k=s(e=>{const t=e.target.value;if(""===t||"-"===t)return;const n=parseFloat(t);isNaN(n)||i(b(n))},[b,i]),S=s(e=>{u||("ArrowUp"===e.key?(e.preventDefault(),v()):"ArrowDown"===e.key&&(e.preventDefault(),w()))},[u,v,w]),$=void 0===d||r<d,M={display:"inline-flex",alignItems:"stretch",borderRadius:"6px",overflow:"hidden",border:"1px solid "+(x?"#ef4444":m?"#3b82f6":"var(--color-border, #d1d5db)"),transition:"border-color 0.15s",opacity:u?"0.6":"1",...m&&!x?{boxShadow:"0 0 0 3px #3b82f622"}:{}},z=e=>({display:"flex",alignItems:"center",justifyContent:"center",width:"36px",backgroundColor:"var(--color-bg-subtle, #f9fafb)",border:"none",cursor:u||!e?"not-allowed":"pointer",color:u||!e?"#d1d5db":"var(--color-text, #374151)",fontSize:"inherit",fontWeight:"600",userSelect:"none",transition:"background-color 0.1s",borderRight:"none",borderLeft:"none"}),C={display:"flex",alignItems:"center",fontSize:"inherit",color:"var(--color-text-muted, #6b7280)",padding:"0 2px",backgroundColor:"var(--color-bg-subtle, #f9fafb)"},I=o("button",{type:"button",style:z(void 0===a||r>a),onClick:w,disabled:u,"aria-label":"Decrement",tabIndex:-1},"−"),A=p?o("span",{style:C},p):null,F=o("input",{id:n,type:"text",value:String(r),onInput:k,onKeyDown:S,onFocus:()=>y(!0),onBlur:()=>y(!1),disabled:u,style:{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"},"aria-label":g||"Number",role:"spinbutton","aria-valuenow":String(r),"aria-valuemin":void 0!==a?String(a):void 0,"aria-valuemax":void 0!==d?String(d):void 0}),R=h?o("span",{style:C},h):null,D=o("button",{type:"button",style:z($),onClick:v,disabled:u,"aria-label":"Increment",tabIndex:-1},"+"),L=[I];return A&&L.push(A),L.push(F),R&&L.push(R),L.push(D),o(he,{label:g,error:x,disabled:u,htmlFor:n},o("div",{style:M},...L))}function De(e){const t=f().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{options:r,value:i,onChange:l,name:a,direction:d="vertical",disabled:c=!1,error:u,label:p}=e,h=s(e=>{c||l(e)},[c,l]),g=s(e=>{if(c)return;const t=r.filter(e=>!e.disabled);if(0===t.length)return;const n=t.findIndex(e=>e.value===i);let o=n;if("ArrowDown"===e.key||"ArrowRight"===e.key)e.preventDefault(),o=n<t.length-1?n+1:0;else{if("ArrowUp"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault(),o=n>0?n-1:t.length-1}l(t[o].value)},[c,r,i,l]),x={display:"flex",flexDirection:"horizontal"===d?"row":"column",gap:"horizontal"===d?"16px":"8px"},m=r.map((e,t)=>{const r=e.value===i,l=c||!!e.disabled,s=`${n}-opt-${t}`,d={width:"18px",height:"18px",minWidth:"18px",borderRadius:"50%",border:"2px solid "+(u?"#ef4444":r?"#3b82f6":"#d1d5db"),display:"flex",alignItems:"center",justifyContent:"center",transition:"border-color 0.15s",boxSizing:"border-box"},f={width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"#3b82f6",transition:"transform 0.15s",transform:r?"scale(1)":"scale(0)"},p={display:"inline-flex",alignItems:"center",gap:"8px",cursor:l?"not-allowed":"pointer",opacity:l?"0.5":"1",userSelect:"none"};return o("label",{key:e.value,htmlFor:s,style:p,onClick:l?void 0:t=>{t.preventDefault(),h(e.value)}},o("input",{type:"radio",id:s,name:a,value:e.value,checked:r,disabled:l,style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},tabIndex:-1}),o("div",{style:d},o("div",{style:f})),o("span",{style:{fontSize:"14px",color:"#374151"}},e.label))});return o(he,{label:p,error:u,htmlFor:`${n}-opt-0`},o("div",{id:n,style:x,role:"radiogroup","aria-label":p,onKeyDown:g,tabIndex:c?-1:0},...m))}function Le(e){const t=f().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{options:r,value:i,onChange:u,placeholder:p="Select...",searchable:h=!1,multiple:g=!1,clearable:x=!1,disabled:m=!1,error:y,label:b,helpText:v}=e,[w,k]=l(!1),[S,$]=l(""),[M,z]=l(-1),C=c(null),I=d(()=>Array.isArray(i)?i:i?[i]:[],[i]),A=d(()=>{if(!h||!S)return r;const e=S.toLowerCase();return r.filter(t=>t.label.toLowerCase().includes(e))},[r,S,h]),F=d(()=>{const e={},t=[];for(const n of A)n.group?(e[n.group]||(e[n.group]=[]),e[n.group].push(n)):t.push(n);return{groups:e,ungrouped:t}},[A]),R=d(()=>0===I.length?"":I.map(e=>r.find(t=>t.value===e)).filter(Boolean).map(e=>e.label).join(", "),[I,r]);a(()=>{const e=e=>{const t=e.target;C.current&&!C.current.contains(t)&&(k(!1),$(""))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const D=s(e=>{if(g){const t=I.includes(e)?I.filter(t=>t!==e):[...I,e];u(t)}else u(e),k(!1),$("")},[g,I,u]),L=s(e=>{e.stopPropagation(),u(g?[]:"")},[g,u]),W=s(e=>{if(m)return;const t=e.key;if(!w&&("Enter"===t||" "===t||"ArrowDown"===t))return e.preventDefault(),k(!0),void z(0);if(w){if("Escape"===t)return k(!1),void $("");if("ArrowDown"===t)e.preventDefault(),z(e=>Math.min(e+1,A.length-1));else if("ArrowUp"===t)e.preventDefault(),z(e=>Math.max(e-1,0));else if("Enter"===t&&M>=0&&M<A.length){e.preventDefault();const t=A[M];t.disabled||D(t.value)}}},[m,w,M,A,D]),N={...ge({},{focused:w,error:!!y}),display:"flex",alignItems:"center",justifyContent:"space-between",cursor:m?"not-allowed":"pointer",minHeight:"38px",userSelect:"none"},E=(e,t)=>{const n=I.includes(e.value),r=t===M,i={padding:"8px 12px",cursor:e.disabled?"not-allowed":"pointer",backgroundColor:r?"#f3f4f6":n?"#eff6ff":"transparent",color:e.disabled?"#9ca3af":"#1f2937",display:"flex",alignItems:"center",gap:"8px",fontSize:"14px"};return o("div",{key:e.value,style:i,onClick:e.disabled?void 0:()=>D(e.value),onMouseEnter:()=>z(t),role:"option","aria-selected":n?"true":"false","aria-disabled":e.disabled?"true":void 0},g&&n?o("span",{style:{color:"#3b82f6",fontWeight:"700"}},"✓"):null,e.label)},T=o("span",{style:{marginLeft:"8px",fontSize:"10px",transition:"transform 0.15s",transform:w?"rotate(180deg)":"rotate(0deg)",color:"#6b7280"}},"▼"),P=o("div",{style:N,id:n,onClick:m?void 0:()=>{k(!w),z(-1)},onKeyDown:W,tabIndex:m?-1:0,role:"combobox","aria-expanded":w?"true":"false","aria-haspopup":"listbox"},o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:R?"#1f2937":"#9ca3af"}},R||p),o("span",{style:{display:"flex",alignItems:"center",gap:"4px"}},x&&I.length>0?o("span",{onClick:L,onKeyDown:e=>{const t=e.key;"Enter"!==t&&" "!==t||(e.preventDefault(),e.stopPropagation(),L(e))},style:{cursor:"pointer",color:"#9ca3af",fontSize:"14px",lineHeight:"1"},role:"button",tabIndex:0,"aria-label":"Clear selection"},"✕"):null,T)),B=h&&w?o("input",{type:"text",value:S,onInput:e=>{$(e.target.value),z(0)},placeholder:"Search...",style:{width:"100%",boxSizing:"border-box",padding:"8px 12px",border:"none",borderBottom:"1px solid #e5e7eb",outline:"none",fontSize:"14px"}}):null,_=w?o("div",{style:{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"},role:"listbox"},B,...(()=>{const e=[];let t=0;const{groups:n,ungrouped:r}=F;for(const n of r)e.push(E(n,t++));for(const r of Object.keys(n)){e.push(o("div",{key:`group-${r}`,style:{padding:"6px 12px",fontSize:"11px",fontWeight:"600",color:"#6b7280",textTransform:"uppercase",letterSpacing:"0.05em"}},r));for(const o of n[r])e.push(E(o,t++))}return 0===e.length&&e.push(o("div",{style:{padding:"8px 12px",color:"#9ca3af",fontSize:"14px"}},"No options")),e})()):null;return o(he,{label:b,error:y,helpText:v,disabled:m,htmlFor:n},o("div",{ref:C,style:{position:"relative"}},P,_))}function We(e){const t=f().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,min:u=0,max:p=100,step:h=1,showValue:g=!1,showTicks:x=!1,disabled:m=!1,marks:y,range:b=!1,label:v,error:w}=e,k=c(null),S=c(i);S.current=i;const[$,M]=l(null),z=d(()=>{if(b&&Array.isArray(r))return r;const e="number"==typeof r?r:0;return[e,e]},[r,b]),C=c(z);C.current=z;const I=e=>{const t=Math.round((e-u)/h)*h+u;return Math.max(u,Math.min(p,t))},A=e=>(e-u)/(p-u)*100,F=s(e=>{if(!k.current)return u;const t=k.current.getBoundingClientRect(),n=Math.max(0,Math.min(1,(e.clientX-t.left)/t.width));return I(u+n*(p-u))},[u,p,h]),R=s(e=>t=>{m||(t.preventDefault(),M(e))},[m]),D=s(e=>{if(m)return;const t=F(e);if(b){const e=Math.abs(t-z[0]),n=Math.abs(t-z[1]);i(e<=n?[I(t),z[1]]:[z[0],I(t)])}else i(I(t))},[m,F,b,z,i,u,p,h]);a(()=>{if(!$)return;const e=e=>{const t=F(e),n=C.current,o=S.current;"single"===$?o(I(t)):"start"===$?o([Math.min(I(t),n[1]),n[1]]):"end"===$&&o([n[0],Math.max(n[0],I(t))])},t=()=>M(null);return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[$,F,u,p,h]);const L=s(e=>{if(m)return;let t=0;if("ArrowRight"===e.key||"ArrowUp"===e.key)t=h;else{if("ArrowLeft"!==e.key&&"ArrowDown"!==e.key)return;t=-h}e.preventDefault(),b||i(I(("number"==typeof r?r:0)+t))},[m,h,b,r,i,u,p]),W={position:"relative",width:"100%",height:"6px",backgroundColor:"#e5e7eb",borderRadius:"3px",cursor:m?"not-allowed":"pointer"},N=b?A(z[0]):0,E={position:"absolute",top:"0",left:`${N}%`,width:A(b?z[1]:z[0])-N+"%",height:"100%",backgroundColor:m?"#9ca3af":"#3b82f6",borderRadius:"3px"},T=e=>v?"start"===e?`${v} minimum`:"end"===e?`${v} maximum`:v:"start"===e?"Minimum value":"end"===e?"Maximum value":"Value",P=(e,t,r)=>o("div",{id:"single"===t||"start"===t?n:void 0,style:{position:"absolute",top:"50%",left:`${e}%`,transform:"translate(-50%, -50%)",width:"18px",height:"18px",borderRadius:"50%",backgroundColor:"#ffffff",border:"2px solid "+(m?"#9ca3af":"#3b82f6"),cursor:m?"not-allowed":"grab",boxShadow:"0 1px 3px rgba(0,0,0,0.15)",zIndex:"2"},onMouseDown:R(t),role:"slider","aria-valuenow":String(r),"aria-valuemin":String(u),"aria-valuemax":String(p),"aria-label":T(t),tabIndex:m?-1:0,onKeyDown:L},g?o("div",{style:{position:"absolute",bottom:"24px",left:"50%",transform:"translateX(-50%)",backgroundColor:"#1f2937",color:"#ffffff",padding:"2px 6px",borderRadius:"4px",fontSize:"11px",whiteSpace:"nowrap"}},String(r)):null),B=[];if(x)for(let e=u;e<=p;e+=h)B.push(o("div",{key:`tick-${e}`,style:{position:"absolute",top:"10px",left:`${A(e)}%`,width:"1px",height:"6px",backgroundColor:"#d1d5db",transform:"translateX(-50%)"}}));const _=[];if(y)for(const e of y)_.push(o("div",{key:`mark-${e.value}`,style:{position:"absolute",top:"18px",left:`${A(e.value)}%`,transform:"translateX(-50%)",fontSize:"11px",color:"#6b7280",whiteSpace:"nowrap"}},e.label));const H={paddingTop:g?"28px":"8px",paddingBottom:y||x?"28px":"8px",opacity:m?"0.6":"1"},Y=[];return b?(Y.push(P(A(z[0]),"start",z[0])),Y.push(P(A(z[1]),"end",z[1]))):Y.push(P(A(z[0]),"single",z[0])),o(he,{label:v,error:w,htmlFor:n},o("div",{style:H},o("div",{ref:k,style:W,role:"presentation",onClick:D},o("div",{style:E}),...Y,...B,..._)))}const Ne=["bold","italic","underline","strikethrough","heading1","heading2","bulletList","orderedList","blockquote","link","unlink","insertHR","removeFormat","undo","redo"],Ee={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:"•",command:"insertUnorderedList"},orderedList:{label:"Numbered list",icon:"1.",command:"insertOrderedList"},blockquote:{label:"Blockquote",icon:"“",command:"formatBlock",value:"blockquote"},link:{label:"Insert link",icon:"🔗",command:"createLink"},unlink:{label:"Remove link",icon:"⛔",command:"unlink"},insertHR:{label:"Horizontal rule",icon:"―",command:"insertHorizontalRule"},removeFormat:{label:"Clear format",icon:"✘",command:"removeFormat"},undo:{label:"Undo",icon:"↩",command:"undo"},redo:{label:"Redo",icon:"↪",command:"redo"}};function Te(e){const[t,n]=l(!1),r=c(null),i=f().replace(/[^a-zA-Z0-9_-]/g,""),d=e.id??i,u=e.toolbar??Ne,p=e.toolbarStyle??{},h=e.editorStyle??{};a(()=>{r.current&&void 0!==e.value&&(r.current.innerHTML=e.value)},[]);const g=s((t,n)=>{if(!e.disabled&&!e.readOnly){if("createLink"===t){const e=prompt("Enter URL:");if(!e)return;document.execCommand(t,!1,e)}else n&&"formatBlock"===t?document.execCommand(t,!1,`<${n}>`):document.execCommand(t,!1,n);r.current&&e.onChange&&e.onChange(r.current.innerHTML)}},[e.disabled,e.readOnly,e.onChange]),x=s(()=>{r.current&&e.onChange&&e.onChange(r.current.innerHTML)},[e.onChange]),m=s(()=>{n(!1),r.current&&e.onBlur&&e.onBlur(r.current.innerHTML)},[e.onBlur]),y=o("div",{className:"texteditor-toolbar",style:{display:"flex",flexWrap:"wrap",gap:"2px",padding:"6px 8px",backgroundColor:p.backgroundColor??"#f9fafb",borderBottom:p.borderBottom??"1px solid #e5e7eb",borderRadius:"6px 6px 0 0"}},...u.map(t=>{const n=Ee[t];return n?o("button",{key:t,type:"button",title:n.label,onClick:()=>g(n.command,n.value),disabled:e.disabled||e.readOnly,style:{padding:"4px 8px",border:"none",borderRadius:"4px",backgroundColor:"transparent",color:p.buttonColor??"#374151",cursor:e.disabled?"not-allowed":"pointer",fontSize:p.buttonSize??"13px",fontWeight:"bold"===t?"700":"italic"===t?"400":"500",fontStyle:"italic"===t?"italic":"normal",textDecoration:"underline"===t?"underline":"strikethrough"===t?"line-through":"none",minWidth:"28px",textAlign:"center",lineHeight:"1.4"}},n.icon):null})),b=o("div",{ref:r,id:d,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:h.padding??"12px 14px",minHeight:e.minHeight??"200px",maxHeight:e.maxHeight??"none",overflow:"auto",backgroundColor:h.backgroundColor??"#ffffff",color:h.color??"#1f2937",fontFamily:h.fontFamily??"inherit",fontSize:h.fontSize??"14px",lineHeight:h.lineHeight??"1.6",outline:"none",borderRadius:"0 0 6px 6px",border:t?"1px solid #3b82f6":e.error?"1px solid #ef4444":"1px solid #d1d5db",borderTop:"none",transition:"border-color 0.15s"},onFocus:()=>n(!0),onBlur:m,onInput:x});return o(he,{label:e.label,htmlFor:d,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"}},y,b))}function Pe(e){const[t,n]=l(!1),r=f().replace(/[^a-zA-Z0-9_-]/g,""),i=e.id??`tf-${r}`,a=ge(e.inputStyle??{},{focused:t,error:!!e.error}),s=!(!e.prefix&&!e.suffix),d=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:s?{...a,border:"none",boxShadow:"none",flex:"1",minWidth:"0"}:a,onFocus:()=>n(!0),onBlur:t=>{n(!1),e.onBlur&&e.onBlur(t.target.value)},onInput:t=>{const n=t.target.value;e.onInput&&e.onInput(n),e.onChange&&e.onChange(n)},onKeyDown:t=>{"Enter"===t.key&&e.onEnter&&e.onEnter(t.target.value)}}),c=s?o("div",{style:{...a,display:"flex",alignItems:"center",gap:"8px",padding:"0"}},e.prefix?o("span",{style:{paddingLeft:"10px",color:"#9ca3af",flexShrink:"0"}},e.prefix):null,d,e.suffix?o("span",{style:{paddingRight:"10px",color:"#9ca3af",flexShrink:"0"}},e.suffix):null):d;return o(he,{label:e.label,htmlFor:i,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},c)}const Be=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Paris","Asia/Tokyo"];function _e(e){return String(e).padStart(2,"0")}function He(e){const t=f().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,format:a="24h",minuteStep:c=1,disabled:u=!1,label:p,error:h,showSeconds:g=!1,timezone:x,showTimezone:m=!1,timezones:y=Be,onTimezoneChange:b}=e,[v,w]=l(!1),k=d(()=>function(e){const t=e.split(":");return{hour:parseInt(t[0],10)||0,minute:parseInt(t[1],10)||0,second:parseInt(t[2],10)||0}}(r),[r]),S="12h"===a,$=k.hour>=12,M=S?k.hour%12||12:k.hour,z=s((e,t,n)=>{const o=Math.max(0,Math.min(23,e)),r=Math.max(0,Math.min(59,t)),l=Math.max(0,Math.min(59,n??0));i(g?`${_e(o)}:${_e(r)}:${_e(l)}`:`${_e(o)}:${_e(r)}`)},[i,g]),C=s(e=>{let t=parseInt(e.target.value,10)||0;S&&(t%=12,$&&(t+=12)),z(t,k.minute,k.second)},[S,$,k.minute,k.second,z]),I=s(e=>{const t=parseInt(e.target.value,10)||0;z(k.hour,t,k.second)},[k.hour,k.second,z]),A=s(e=>{const t=parseInt(e.target.value,10)||0;z(k.hour,k.minute,t)},[k.hour,k.minute,z]),F=s(()=>{if(u)return;const e=$?k.hour-12:k.hour+12;z(e,k.minute,k.second)},[u,$,k.hour,k.minute,k.second,z]),R=s(e=>{u||z(k.hour+e,k.minute,k.second)},[u,k.hour,k.minute,k.second,z]),D=s(e=>{u||z(k.hour,k.minute+e*c,k.second)},[u,k.hour,k.minute,k.second,c,z]),L=s(e=>{u||z(k.hour,k.minute,k.second+e)},[u,k.hour,k.minute,k.second,z]),W=s(e=>{const t=e.target.value;b&&b(t)},[b]),N={display:"inline-flex",alignItems:"center",gap:"4px",...ge({},{focused:v,error:!!h})},E={display:"flex",flexDirection:"column",alignItems:"center"},T={background:"none",border:"none",cursor:u?"not-allowed":"pointer",fontSize:"10px",padding:"0 4px",color:"#6b7280",lineHeight:"1"},P={width:"32px",textAlign:"center",border:"none",outline:"none",fontSize:"14px",fontFamily:"monospace",backgroundColor:"transparent",color:"#1f2937",padding:"0"},B={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:u?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},_=o("div",{style:E},o("button",{type:"button",style:T,onClick:()=>R(1),disabled:u},"▲"),o("input",{type:"text",value:_e(M),onChange:C,style:P,disabled:u,"aria-label":"Hour",onFocus:()=>w(!0),onBlur:()=>w(!1)}),o("button",{type:"button",style:T,onClick:()=>R(-1),disabled:u},"▼")),H=o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"),Y=o("div",{style:E},o("button",{type:"button",style:T,onClick:()=>D(1),disabled:u},"▲"),o("input",{type:"text",value:_e(k.minute),onChange:I,style:P,disabled:u,"aria-label":"Minute",onFocus:()=>w(!0),onBlur:()=>w(!1)}),o("button",{type:"button",style:T,onClick:()=>D(-1),disabled:u},"▼")),j=g?o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"):null,q=g?o("div",{style:E},o("button",{type:"button",style:T,onClick:()=>L(1),disabled:u},"▲"),o("input",{type:"text",value:_e(k.second),onChange:A,style:P,disabled:u,"aria-label":"Second",onFocus:()=>w(!0),onBlur:()=>w(!1)}),o("button",{type:"button",style:T,onClick:()=>L(-1),disabled:u},"▼")):null,O=S?o("button",{type:"button",style:B,onClick:F,disabled:u,"aria-label":"Toggle AM/PM"},$?"PM":"AM"):null,U={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:u?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},X=x&&!m?o("span",{style:{marginLeft:"8px",fontSize:"12px",fontWeight:"600",color:"#6b7280"}},x):null,V=m?o("select",{style:U,value:x??y[0],onChange:W,disabled:u,"aria-label":"Timezone"},...y.map(e=>o("option",{key:e,value:e},e))):null,G=[_,H,Y];return j&&G.push(j),q&&G.push(q),O&&G.push(O),X&&G.push(X),V&&G.push(V),o(he,{label:p,error:h,disabled:u,htmlFor:n},o("div",{id:n,style:N},...G))}const Ye={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 je(e){const{checked:t,onChange:n,label:r,labelPosition:i="right",disabled:l=!1,size:a="md",onColor:d="#3b82f6",offColor:c="#d1d5db"}=e,f=Ye[a],u=s(()=>{l||n(!t)},[l,t,n]),p=s(e=>{l||" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),n(!t))},[l,t,n]),h={width:`${f.trackW}px`,height:`${f.trackH}px`,borderRadius:`${f.trackH}px`,backgroundColor:t?d:c,position:"relative",cursor:l?"not-allowed":"pointer",transition:"background-color 0.2s",flexShrink:"0"},g=t?f.trackW-f.thumbSize-f.offset:f.offset,x={width:`${f.thumbSize}px`,height:`${f.thumbSize}px`,borderRadius:"50%",backgroundColor:"#ffffff",position:"absolute",top:`${f.offset}px`,left:`${g}px`,transition:"left 0.2s",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"},m={display:"inline-flex",alignItems:"center",gap:"8px",opacity:l?"0.5":"1",userSelect:"none"},y=r?o("span",{style:{fontSize:"14px",color:"#374151"}},r):null,b=o("div",{style:h},o("div",{style:x}));return o("div",{style:m,onClick:u,onKeyDown:p,tabIndex:l?-1:0,role:"switch","aria-checked":t?"true":"false","aria-disabled":l?"true":void 0,"aria-label":r},...("left"===i?[y,b]:[b,y]).filter(Boolean))}const qe={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 Oe(e){const t=!1!==e.bordered,n=e.shadow??"sm",r=e.padding??"16px",i=e.borderRadius??"8px",l=d(()=>{const o={display:"flex",flexDirection:"column",borderRadius:i,overflow:"hidden",backgroundColor:"#ffffff",transition:"box-shadow 0.2s, transform 0.2s"};return t&&(o.border="1px solid #e5e7eb"),o.boxShadow=qe[n]??qe.sm,e.hoverable&&(o.cursor="pointer"),{...o,...e.style??{}}},[t,n,i,e.hoverable,e.style]),a={display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:r,gap:"12px"},s={padding:r,paddingTop:e.title||e.subtitle?"0":r,flex:"1"},c={padding:r,paddingTop:"0",borderTop:"1px solid #f3f4f6",paddingBottom:r,marginTop:"auto"},f=e.title||e.subtitle||e.headerAction;return o("div",{className:`card ${e.hoverable?"card--hoverable":""} ${e.className??""}`.trim(),style:l},e.image?o("img",{src:e.image,alt:e.imageAlt??"",style:{width:"100%",height:"auto",display:"block",objectFit:"cover"}}):null,f?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:s},e.children),e.footer?o("div",{className:"card__footer",style:c},e.footer):null)}function Ue(e){const t=d(()=>{const t={display:e.inline?"inline-flex":"flex"};return e.direction&&(t.flexDirection=e.direction),e.wrap&&(t.flexWrap=e.wrap),e.gap&&(t.gap=e.gap),e.alignItems&&(t.alignItems=e.alignItems),e.justifyContent&&(t.justifyContent=e.justifyContent),{...t,...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 Xe(e){const t=d(()=>{const t={};return e.flex&&(t.flex=e.flex),void 0!==e.grow&&(t.flexGrow=String(e.grow)),void 0!==e.shrink&&(t.flexShrink=String(e.shrink)),e.basis&&(t.flexBasis=e.basis),e.alignSelf&&(t.alignSelf=e.alignSelf),void 0!==e.order&&(t.order=String(e.order)),{...t,...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 Ve(e){const t=d(()=>{const t={display:"grid"};return e.minColWidth?t.gridTemplateColumns=`repeat(auto-fit, minmax(${e.minColWidth}, 1fr))`:void 0!==e.columns&&(t.gridTemplateColumns="number"==typeof e.columns?`repeat(${e.columns}, 1fr)`:e.columns),e.rows&&(t.gridTemplateRows=e.rows),e.gap&&(t.gap=e.gap),e.alignItems&&(t.alignItems=e.alignItems),e.justifyItems&&(t.justifyItems=e.justifyItems),e.areas&&e.areas.length>0&&(t.gridTemplateAreas=e.areas.map(e=>`"${e}"`).join(" ")),{...t,...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 Ge(e){const t=d(()=>{const t={};return e.gridColumn&&(t.gridColumn=e.gridColumn),e.gridRow&&(t.gridRow=e.gridRow),e.gridArea&&(t.gridArea=e.gridArea),e.alignSelf&&(t.alignSelf=e.alignSelf),e.justifySelf&&(t.justifySelf=e.justifySelf),{...t,...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)}const Ke={none:"none",sm:"0 1px 3px rgba(0,0,0,0.12)",md:"0 4px 6px rgba(0,0,0,0.1)"};function Ze(e){const t=!1!==e.bordered,n=e.shadow??"none",[r,i]=l(!!e.defaultCollapsed),f=c(null),[u,p]=l("auto");a(()=>{if(!e.collapsible)return;const t=f.current;t&&p(`${t.scrollHeight}px`)},[e.children,e.collapsible]);const h=s(()=>{e.collapsible&&i(e=>!e)},[e.collapsible]),g=s(t=>{if(!e.collapsible)return;const n=t.key;"Enter"!==n&&" "!==n||(t.preventDefault(),h())},[e.collapsible,h]),x=d(()=>{const o={borderRadius:"6px",overflow:"hidden",backgroundColor:"#ffffff"};return t&&(o.border="1px solid #e5e7eb"),o.boxShadow=Ke[n]??Ke.none,{...o,...e.style??{}}},[t,n,e.style]),m={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",gap:"8px",backgroundColor:"#f9fafb",userSelect:"none",cursor:e.collapsible?"pointer":"default"},y={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"},b={maxHeight:r?"0":u,overflow:"hidden",transition:"max-height 0.3s ease"};return o("div",{className:`panel ${e.className??""}`.trim(),style:x},o("div",{className:"panel__header",style:m,onClick:h,onKeyDown:g,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:y}):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?b:{},ref:f},o("div",{className:"panel__body",style:{padding:"16px"}},e.children)))}function Je(e,t){return"both"===e?"auto":"horizontal"===e?"x"===t?"auto":"hidden":"y"===t?"auto":"hidden"}function Qe(e){switch(e){case"never":return{scrollbarWidth:"none"};case"always":case"hover":return{scrollbarWidth:"thin"};default:return{scrollbarWidth:"auto"}}}function et(e){const t=e.direction??"vertical",n=e.showScrollbar??"auto",r=e.shadow??!1,i=c(null),[f,u]=l(!0),[p,h]=l(!1),[g,x]=l(!0),[m,y]=l(!1),b=s(()=>{const e=i.current;e&&(u(e.scrollTop<=2),h(e.scrollTop+e.clientHeight>=e.scrollHeight-2),x(e.scrollLeft<=2),y(e.scrollLeft+e.clientWidth>=e.scrollWidth-2))},[]);a(()=>{b()},[b]);const v=s(()=>{r&&b()},[r,b]),w=d(()=>{const o={position:"relative",overflowX:Je(t,"x"),overflowY:Je(t,"y"),...Qe(n)};return e.maxHeight&&(o.maxHeight=e.maxHeight),e.maxWidth&&(o.maxWidth=e.maxWidth),e.padding&&(o.padding=e.padding),{...o,...e.style??{}}},[t,n,e.maxHeight,e.maxWidth,e.padding,e.style]),k=[];if(r){const e="vertical"===t||"both"===t,n="horizontal"===t||"both"===t;e&&!f&&k.push("inset 0 8px 6px -6px rgba(0,0,0,0.15)"),e&&!p&&k.push("inset 0 -8px 6px -6px rgba(0,0,0,0.15)"),n&&!g&&k.push("inset 8px 0 6px -6px rgba(0,0,0,0.15)"),n&&!m&&k.push("inset -8px 0 6px -6px rgba(0,0,0,0.15)")}const S={...w};return k.length>0&&(S.boxShadow=k.join(", ")),o("div",{className:`scroll-container scroll-container--${t} ${e.className??""}`.trim(),style:S,ref:i,onScroll:v},e.children)}function tt(e){const t=e.direction??"horizontal",n="horizontal"===t,r=e.dividerSize??6,i=e.minSize??50,[f,u]=l(e.initialSplit??50),p=c(null),h=c(!1),g=s(e=>{e.preventDefault(),h.current=!0,document.body.style.cursor=n?"col-resize":"row-resize",document.body.style.userSelect="none"},[n]);a(()=>{const t=t=>{if(!h.current||!p.current)return;const o=p.current.getBoundingClientRect(),r=n?o.width:o.height,l=n?t.clientX-o.left:t.clientY-o.top;if(r<=0)return;const a=i/r*100,s=e.maxSize?e.maxSize/r*100:100-a;let d=l/r*100;d=Math.max(a,Math.min(s,d)),u(d)},o=()=>{h.current&&(h.current=!1,document.body.style.cursor="",document.body.style.userSelect="")};return document.addEventListener("mousemove",t),document.addEventListener("mouseup",o),()=>{document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",o)}},[n,i,e.maxSize]);const x=d(()=>({display:"flex",flexDirection:n?"row":"column",width:"100%",height:"100%",overflow:"hidden",...e.style??{}}),[n,e.style]),m=n?{width:`calc(${f}% - ${r/2}px)`,overflow:"auto",flexShrink:"0"}:{height:`calc(${f}% - ${r/2}px)`,overflow:"auto",flexShrink:"0"},y={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%"}},b=Array.isArray(e.children)?e.children:[];return o("div",{className:`splitter splitter--${t} ${e.className??""}`.trim(),style:x,ref:p},o("div",{className:"splitter__pane splitter__pane--first",style:m},b[0]??null),o("div",{className:"splitter__divider",style:y,onMouseDown:g,onKeyDown:e=>{const t=e.key;!n||"ArrowLeft"!==t&&"ArrowRight"!==t?n||"ArrowUp"!==t&&"ArrowDown"!==t||(e.preventDefault(),u(e=>{const n="ArrowDown"===t?2:-2;return Math.max(5,Math.min(95,e+n))})):(e.preventDefault(),u(e=>{const n="ArrowRight"===t?2:-2;return Math.max(5,Math.min(95,e+n))}))},role:"separator",tabIndex:0,"aria-orientation":n?"vertical":"horizontal","aria-valuenow":String(Math.round(f)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Resize panels"}),o("div",{className:"splitter__pane splitter__pane--second",style:{flex:"1",overflow:"auto",minWidth:"0",minHeight:"0"}},b[1]??null))}function nt(e){const t=e.position??"top",n=e.variant??"line",r=e.tabs.find(e=>!e.disabled)?.id??"",[i,a]=l(e.activeTab??r),f=e.activeTab??i,u=c(null),p=s(t=>{a(t),e.onChange&&e.onChange(t)},[e.onChange]),h=s(n=>{const o=e.tabs.filter(e=>!e.disabled),r=o.findIndex(e=>e.id===f);if(-1===r)return;const i="left"===t||"right"===t,l=i?"ArrowUp":"ArrowLeft",a=i?"ArrowDown":"ArrowRight";let s=-1;if(n.key===l?s=r>0?r-1:o.length-1:n.key===a?s=r<o.length-1?r+1:0:"Home"===n.key?s=0:"End"===n.key&&(s=o.length-1),s>=0){n.preventDefault(),p(o[s].id);const t=u.current;if(t){const n=t.querySelectorAll('[role="tab"]')[e.tabs.indexOf(o[s])];n&&n.focus()}}},[e.tabs,f,t,p]),g="left"===t||"right"===t,x="bottom"===t||"right"===t,m=d(()=>({display:"flex",flexDirection:g?x?"row-reverse":"row":x?"column-reverse":"column",width:"100%",...e.style??{}}),[g,x,e.style]),y={display:"flex",flexDirection:g?"column":"row",gap:"pill"===n?"4px":"0",..."line"!==n||g?{}:{borderBottom:"2px solid #e5e7eb"},..."line"===n&&g?{borderRight:"left"===t?"2px solid #e5e7eb":"none",borderLeft:"right"===t?"2px solid #e5e7eb":"none"}:{},..."card"===n?{backgroundColor:"#f9fafb"}:{},..."pill"===n?{padding:"4px"}:{},flexShrink:"0"},b=e.tabs.find(e=>e.id===f),v=e.tabs.map(e=>{const r=e.id===f,i={padding:"8px 16px",border:"none",background:"none",cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?"0.5":"1",fontSize:"14px",fontWeight:r?"600":"400",color:r?"#3b82f6":"#6b7280",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"6px",outline:"none",transition:"color 0.15s, background-color 0.15s"};return"line"===n?g?"left"===t?(i.borderRight=r?"2px solid #3b82f6":"2px solid transparent",i.marginRight="-2px"):(i.borderLeft=r?"2px solid #3b82f6":"2px solid transparent",i.marginLeft="-2px"):(i.borderBottom=r?"2px solid #3b82f6":"2px solid transparent",i.marginBottom="-2px"):"card"===n?(i.backgroundColor=r?"#ffffff":"transparent",i.borderRadius="6px 6px 0 0",r&&(i.border="1px solid #e5e7eb",i.borderBottom="1px solid #ffffff")):"pill"===n&&(i.borderRadius="9999px",i.backgroundColor=r?"#3b82f6":"transparent",i.color=r?"#ffffff":"#6b7280"),o("button",{key:e.id,role:"tab","aria-selected":String(r),"aria-controls":`tabpanel-${e.id}`,"aria-disabled":e.disabled?"true":void 0,id:`tab-${e.id}`,tabIndex:r?"0":"-1",style:i,onClick:e.disabled?void 0:()=>p(e.id),onKeyDown:h},e.icon?o("span",{className:"tabs__tab-icon"},e.icon):null,e.label)});return o("div",{className:`tabs tabs--${t} tabs--${n} ${e.className??""}`.trim(),style:m},o("div",{className:"tabs__list",role:"tablist","aria-label":"Tabs","aria-orientation":g?"vertical":"horizontal",style:y,ref:u},...v),o("div",{className:"tabs__panel",role:"tabpanel",id:`tabpanel-${f}`,"aria-labelledby":`tab-${f}`,style:{flex:"1",padding:"16px",minWidth:"0",minHeight:"0"},tabIndex:"0"},b?b.content:null))}function ot(e){const t=e.items??[],n=t.length,r=!1!==e.loop,i=!1!==e.showDots,u=!1!==e.showArrows,p=e.animation??"slide",h=e.interval??5e3,g=f().replace(/[^a-zA-Z0-9_-]/g,""),[x,m]=l(0),y=c(null),b=c(null),v=s(t=>{let o=t;o=r?(t%n+n)%n:Math.max(0,Math.min(t,n-1)),m(o),e.onChange&&e.onChange(o)},[n,r,e.onChange]),w=s(()=>v(x+1),[x,v]),k=s(()=>v(x-1),[x,v]);a(()=>{if(!e.autoPlay||n<=1)return;const t=setInterval(w,h);return()=>clearInterval(t)},[e.autoPlay,h,w,n]),a(()=>{const e=e=>{"ArrowLeft"===e.key?k():"ArrowRight"===e.key&&w()},t=b.current;if(t)return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)},[w,k]);const S="fade"===p?`@keyframes liq-fade-in-${g}{from{opacity:0}to{opacity:1}}`:"",$=d(()=>"fade"===p?{position:"relative",width:"100%"}:{display:"flex",transition:"transform 0.4s ease",transform:`translateX(-${100*x}%)`,width:"100%"},[x,p]),M={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)"},z=t.map((e,t)=>{const n="fade"===p?{position:t===x?"relative":"absolute",top:"0",left:"0",width:"100%",opacity:t===x?"1":"0",transition:"opacity 0.4s ease"}:{flex:"0 0 100%",width:"100%"};return o("div",{key:String(t),style:n},e.content,e.caption?o("div",{style:{textAlign:"center",padding:"8px 12px",fontSize:"13px",color:"#6b7280"}},e.caption):null)}),C=i?o("div",{style:{display:"flex",justifyContent:"center",gap:"8px",padding:"12px 0"}},...t.map((e,t)=>o("button",{key:String(t),"aria-label":`Go to slide ${t+1}`,onclick:()=>v(t),style:{width:"10px",height:"10px",borderRadius:"50%",border:"none",cursor:"pointer",backgroundColor:t===x?"#3b82f6":"#d1d5db",transition:"background-color 0.2s",padding:"0"}}))):null;return o("div",{ref:b,tabindex:"0",role:"region","aria-label":"Carousel",style:{position:"relative",overflow:"hidden",width:"100%",outline:"none"},onpointerdown:e=>{y.current=e.clientX},onpointerup:e=>{if(null==y.current)return;const t=e.clientX-y.current;t>50?k():t<-50&&w(),y.current=null}},S?o("style",null,S):null,o("div",{style:$},...z),u&&n>1?o("button",{"aria-label":"Previous slide",onclick:k,style:{...M,left:"8px"}},"‹"):null,u&&n>1?o("button",{"aria-label":"Next slide",onclick:w,style:{...M,right:"8px"}},"›"):null,C)}function rt(e){const[t,n]=l("loading"),r=c(null),i=f().replace(/[^a-zA-Z0-9_-]/g,""),s=!1!==e.lazy,u="number"==typeof e.width?`${e.width}px`:e.width,p="number"==typeof e.height?`${e.height}px`:e.height;a(()=>{n("loading")},[e.src]);const h=d(()=>{const t={display:"inline-block",position:"relative",overflow:"hidden"};return u&&(t.width=u),p&&(t.height=p),e.borderRadius&&(t.borderRadius=e.borderRadius),t},[u,p,e.borderRadius]),g=d(()=>{const n={display:"block",width:"100%",height:"100%"};return e.objectFit&&(n.objectFit=e.objectFit),"loading"===t&&(n.opacity="0",n.position="absolute"),"error"===t&&(n.display="none"),n},[e.objectFit,t]);let x=null;"loading"===t&&("skeleton"===e.placeholder?x=o("div",null,o("style",null,`@keyframes liq-img-shimmer-${i}{0%{background-position:-200% 0}100%{background-position:200% 0}}`),o("div",{style:{width:u??"100%",height:p??"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`}})):"blur"===e.placeholder?x=o("div",{style:{width:u??"100%",height:p??"200px",backgroundColor:"#d1d5db",filter:"blur(20px)"}}):null!=e.placeholder&&!1!==e.placeholder&&(x=e.placeholder));let m=null;"error"===t&&null!=e.fallback&&(m="string"==typeof e.fallback?o("img",{src:e.fallback,alt:e.alt??"",style:{display:"block",width:"100%",height:"100%",objectFit:e.objectFit??"cover"}}):e.fallback);const y=o("div",{style:h},x,o("img",{ref:r,src:e.src,alt:e.alt??"",loading:s?"lazy":void 0,style:g,onload:()=>n("loaded"),onerror:()=>n("error")}),m);return e.caption?o("figure",{style:{margin:"0",display:"inline-block"}},y,o("figcaption",{style:{fontSize:"13px",color:"#6b7280",marginTop:"6px",textAlign:"center"}},e.caption)):y}function it(e){return!isFinite(e)||e<0?"0:00":`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,"0")}`}function lt(e){const t=!1!==e.controls,n=c(null);f().replace(/[^a-zA-Z0-9_-]/g,"");const[r,i]=l(!1),[d,u]=l(0),[p,h]=l(0),[g,x]=l(e.muted?0:1),[m,y]=l(!!e.muted),[b,v]=l(!0),w="number"==typeof e.width?`${e.width}px`:e.width??"100%",k="number"==typeof e.height?`${e.height}px`:e.height??"auto";a(()=>{const t=n.current;if(!t)return;const o=()=>{i(!0),e.onPlay&&e.onPlay()},r=()=>{i(!1),e.onPause&&e.onPause()},l=()=>{i(!1),e.onEnded&&e.onEnded()},a=()=>{u(t.currentTime),h(t.duration),e.onTimeUpdate&&e.onTimeUpdate(t.currentTime,t.duration)},s=()=>{h(t.duration)};return t.addEventListener("play",o),t.addEventListener("pause",r),t.addEventListener("ended",l),t.addEventListener("timeupdate",a),t.addEventListener("loadedmetadata",s),()=>{t.removeEventListener("play",o),t.removeEventListener("pause",r),t.removeEventListener("ended",l),t.removeEventListener("timeupdate",a),t.removeEventListener("loadedmetadata",s)}},[e.onPlay,e.onPause,e.onEnded,e.onTimeUpdate]);const S=s(()=>{const e=n.current;e&&(e.paused?e.play():e.pause())},[]),$=s(e=>{const t=n.current;if(!t||!isFinite(t.duration))return;const o=e.currentTarget.getBoundingClientRect(),r=Math.max(0,Math.min(1,(e.clientX-o.left)/o.width));t.currentTime=r*t.duration},[]),M=s(e=>{const t=n.current,o=parseFloat(e.target.value);t&&(t.volume=o,t.muted=0===o,x(o),y(0===o))},[]),z=s(()=>{const e=n.current;e&&e.requestFullscreen&&e.requestFullscreen()},[]);if(!t)return o("video",{ref:n,src:e.src,poster:e.poster,controls:!0,autoplay:!!e.autoPlay||void 0,loop:!!e.loop||void 0,muted:!!e.muted||void 0,style:{width:w,height:k,display:"block"}});const C=p>0?d/p*100:0,I={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:b?"1":"0",transition:"opacity 0.3s"}},o("button",{"aria-label":r?"Pause":"Play",onclick:S,style:I},r?"⏸":"▶"),o("div",{onclick:$,style:{flex:"1",height:"4px",backgroundColor:"rgba(255,255,255,0.3)",borderRadius:"2px",cursor:"pointer",position:"relative"}},o("div",{style:{width:`${C}%`,height:"100%",backgroundColor:"#3b82f6",borderRadius:"2px",transition:"width 0.1s linear"}})),o("span",{style:{color:"#ffffff",fontSize:"12px",whiteSpace:"nowrap",fontFamily:"monospace"}},`${it(d)} / ${it(p)}`),o("input",{type:"range",min:"0",max:"1",step:"0.05",value:String(m?0:g),oninput:M,"aria-label":"Volume",style:{width:"60px",cursor:"pointer"}}),o("button",{"aria-label":"Fullscreen",onclick:z,style:I},"⛶"));return o("div",{style:{position:"relative",width:w,height:k,backgroundColor:"#000",overflow:"hidden"},onmouseenter:()=>v(!0),onmouseleave:()=>{r&&v(!1)}},o("video",{ref:n,src:e.src,poster:e.poster,autoplay:!!e.autoPlay||void 0,loop:!!e.loop||void 0,muted:!!e.muted||void 0,playsinline:!0,onclick:S,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"}}),A)}function at(e){const t=e.orientation??"vertical",n=e.role??"navigation",r=e.keyboardNav??!0,i=e.styling??{},l=c(null),a={display:"flex",flexDirection:"horizontal"===t?"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:"number"==typeof i.width?`${i.width}px`:i.width??"auto",overflow:"auto",boxSizing:"border-box",listStyle:"none",margin:"0",...i.boxShadow?{boxShadow:i.boxShadow}:{},...i.maxHeight?{maxHeight:"number"==typeof i.maxHeight?`${i.maxHeight}px`:i.maxHeight}:{},...i.custom??{}},d=s(e=>{if(!r)return;const n=e,o=l.current;if(!o)return;const i=Array.from(o.querySelectorAll('button, [tabindex]:not([tabindex="-1"]), a[href], [role="menuitem"], [role="treeitem"]')),a=i.indexOf(document.activeElement);if(a<0)return;const s="vertical"===t,d=s?"ArrowDown":"ArrowRight",c=s?"ArrowUp":"ArrowLeft";if(n.key===d){n.preventDefault();const e=i[a+1];e&&e.focus()}else if(n.key===c){n.preventDefault();const e=i[a-1];e&&e.focus()}else"Home"===n.key?(n.preventDefault(),i[0]?.focus()):"End"===n.key&&(n.preventDefault(),i[i.length-1]?.focus())},[r,t]);return o("nav",{ref:l,role:n,"aria-label":e.ariaLabel??void 0,"aria-orientation":t,className:`nav-wrapper ${e.className??""}`.trim(),style:a,onKeyDown:d},e.children)}function st(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 dt(){const[e,t]=l(!1);return{hover:e,onMouseEnter:s(()=>t(!0),[]),onMouseLeave:s(()=>t(!1),[])}}function ct(e){const{section:t,expanded:n,onToggle:r,headerStyle:i,expandIcon:l,collapseIcon:a,iconPosition:d}=e,{hover:c,onMouseEnter:f,onMouseLeave:u}=dt(),p=!0===t.disabled,h={display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",boxSizing:"border-box",padding:i.padding??"12px 16px",backgroundColor:p?"#f9fafb":c?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}:{}};"left"===d&&(h.flexDirection="row");const g=s(e=>{const t=e;p||"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),r())},[p,r]),x=s(()=>{p||r()},[p,r]),m=o("span",{"aria-hidden":"true",style:{display:"inline-block",transition:"transform 0.2s ease",transform:n?"rotate(180deg)":"rotate(0deg)",flexShrink:"0",marginLeft:"right"===d?"auto":"0",marginRight:"left"===d?"8px":"0",paddingLeft:"right"===d?"8px":"0"}},n?a:l),y=t.icon?o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},o("span",{"aria-hidden":"true"},t.icon),t.header):t.header,b="left"===d?[m,y]:[y,m];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:h,onClick:x,onKeyDown:g,onMouseEnter:f,onMouseLeave:u},...b)}function ft(e){const{section:t,expanded:n,contentStyle:r,animated:i}=e,l={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:l},o("div",{style:a},t.content))}function ut(e){const{sections:t,defaultExpanded:n,allowMultiple:r=!1,headerStyle:i={},contentStyle:a={},wrapperStyle:c,expandIcon:f="+",collapseIcon:u="−",iconPosition:p="right",animated:h=!0,onChange:g}=e,[x,m]=l(()=>n??[]),y=s(e=>{m(t=>{let n;return n=t.includes(e)?t.filter(t=>t!==e):r?[...t,e]:[e],g&&g(n),n})},[r,g]),b=d(()=>t.map(e=>{const t=x.includes(e.id),n=o(ct,{key:`header-${e.id}`,section:e,expanded:t,onToggle:()=>y(e.id),headerStyle:i,expandIcon:f,collapseIcon:u,iconPosition:p}),r=o(ft,{key:`content-${e.id}`,section:e,expanded:t,contentStyle:a,animated:h});return o("div",{key:e.id,"data-accordion-section":e.id,style:{width:"100%"}},n,r)}),[t,x,i,a,f,u,p,h,y]);return o(at,{role:"region",ariaLabel:"Accordion",styling:c,keyboardNav:!0},...b)}const pt={sm:{fontSize:"12px",padding:"4px 0"},md:{fontSize:"14px",padding:"6px 0"},lg:{fontSize:"16px",padding:"8px 0"}};function ht(e){const{items:t,separator:n="/",maxItems:r,size:i="md"}=e,[a,d]=l(!1),c=pt[i],f=s(()=>{d(!0)},[]);let u=t,p=!1;if(r&&r>1&&t.length>r&&!a){p=!0;const e=1,n=r-1;u=[...t.slice(0,e),{label:"..."},...t.slice(t.length-n)]}const h=u.map((e,t)=>((e,t,r)=>{const i=t===r.length-1,l=p&&"..."===e.label&&1===t,a=[];var s;return t>0&&a.push(o("span","string"==typeof(s=n)?{"aria-hidden":"true",style:{margin:"0 8px",color:"#9ca3af",userSelect:"none"}}:{"aria-hidden":"true",style:{margin:"0 8px"}},s)),l?a.push(o("button",{type:"button",onClick:f,style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",fontSize:c.fontSize,color:"#6b7280",fontFamily:"inherit"},"aria-label":"Show all breadcrumb items"},"...")):i?a.push(o("span",{"aria-current":"page",style:{color:"#1f2937",fontWeight:"600",fontSize:c.fontSize}},e.label)):e.href?a.push(o("a",{href:e.href,onClick:e.onClick?t=>{t.preventDefault(),e.onClick()}:void 0,style:{color:"#2563eb",textDecoration:"none",fontSize:c.fontSize}},e.label)):e.onClick?a.push(o("button",{type:"button",onClick:e.onClick,style:{background:"none",border:"none",cursor:"pointer",color:"#2563eb",padding:"0",fontSize:c.fontSize,fontFamily:"inherit"}},e.label)):a.push(o("span",{style:{color:"#6b7280",fontSize:c.fontSize}},e.label)),o("li",{key:String(t),style:{display:"inline-flex",alignItems:"center"}},...a)})(e,t,u));return o(at,{orientation:"horizontal",role:"navigation",ariaLabel:"Breadcrumb",keyboardNav:!1,styling:{border:"none",borderRadius:"0",padding:c.padding,backgroundColor:"transparent"}},o("ol",{style:{display:"flex",alignItems:"center",listStyle:"none",margin:"0",padding:"0",flexWrap:"wrap"}},...h))}function gt(e){const{item:t,itemStyle:n,closeOnSelect:r,onClose:i}=e,{hover:a,onMouseEnter:d,onMouseLeave:c}=dt(),[f,u]=l(!1),p=t.children&&t.children.length>0;if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});const h=!0===t.disabled,g={...st(n,{hover:!h&&a,active:!1}),position:"relative",justifyContent:"space-between",...h?{color:"#9ca3af",cursor:"default",opacity:"0.6"}:{}},x=s(()=>{h||(p?u(e=>!e):(t.onClick&&t.onClick(),r&&i()))},[h,p,t,r,i]),m=s(()=>{d(),p&&u(!0)},[p,d]),y=s(()=>{c(),p&&u(!1)},[p,c]),b=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)),v=p?o("span",{style:{marginLeft:"8px",fontSize:"10px",lineHeight:"1"},"aria-hidden":"true"},"›"):null,w=p&&f?o("div",{style:{position:"absolute",left:"100%",top:"0",zIndex:"1000"}},o(at,{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(e=>o(gt,{key:e.id,item:e,itemStyle:n,closeOnSelect:r,onClose:i})))):null;return o("div",{style:{position:"relative"},onMouseEnter:m,onMouseLeave:y},o("button",{type:"button",role:"menuitem",style:g,onClick:x,disabled:h||void 0,tabIndex:h?-1:0,"aria-disabled":h?"true":void 0,"aria-haspopup":p||void 0,"aria-expanded":p?String(f):void 0},b,v),w)}function xt(e){const{label:t,items:n,triggerStyle:r,menuStyle:i,itemStyle:d={},placement:f="bottom-start",closeOnSelect:u=!0,width:p="220px"}=e,[h,g]=l(!1),x=c(null),m=s(()=>{g(e=>!e)},[]),y=s(()=>{g(!1)},[]);a(()=>{if(!h)return;const e=e=>{const t=x.current;t&&!t.contains(e.target)&&g(!1)};return document.addEventListener("click",e,!0),()=>{document.removeEventListener("click",e,!0)}},[h]),a(()=>{if(!h)return;const e=e=>{"Escape"===e.key&&g(!1)};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[h]);const b=o("button",{type:"button",style:{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??{}},onClick:m,"aria-haspopup":"true","aria-expanded":String(h)},o("span",null,t),o("span",{style:{marginLeft:"4px",fontSize:"10px",transition:"transform 0.15s",transform:h?"rotate(180deg)":"rotate(0deg)"},"aria-hidden":"true"},"▼")),v={position:"absolute",top:"100%",..."bottom-end"===f?{right:"0"}:{left:"0"},marginTop:"4px",zIndex:"999"},w={boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #e5e7eb",borderRadius:"6px",padding:"4px 0",width:"number"==typeof p?`${p}px`:p,backgroundColor:"#ffffff",...i??{}},k=h?o("div",{style:v},o(at,{orientation:"vertical",role:"menu",ariaLabel:`${t} menu`,styling:w},...n.map(e=>o(gt,{key:e.id,item:e,itemStyle:d,closeOnSelect:u,onClose:y})))):null;return o("div",{ref:x,style:{position:"relative",display:"inline-block"}},b,k)}function mt(e){const{item:t,onClose:n,index:r}=e,{hover:i,onMouseEnter:a,onMouseLeave:d}=dt(),[c,f]=l(!1),u=t.children&&t.children.length>0;if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});const p=!0===t.disabled,h=s(()=>{p||(u?f(e=>!e):(t.onClick&&t.onClick(),n()))},[p,u,t,n]),g=s(()=>{a(),u&&f(!0)},[u,a]),x=s(()=>{d(),u&&f(!1)},[u,d]),m={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 16px",fontSize:"13px",fontFamily:"inherit",border:"none",outline:"none",width:"100%",textAlign:"left",cursor:p?"default":"pointer",backgroundColor:!p&&i?"#f3f4f6":"transparent",color:p?"#9ca3af":"#1f2937",opacity:p?"0.6":"1",transition:"background-color 0.1s",boxSizing:"border-box"},y=o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},t.icon?o("span",{style:{width:"16px",textAlign:"center"},"aria-hidden":"true"},t.icon):o("span",{style:{width:"16px"}}),o("span",null,t.label)),b=u?o("span",{style:{fontSize:"10px",color:"#9ca3af"},"aria-hidden":"true"},"▶"):t.shortcut?o("span",{style:{fontSize:"11px",color:"#9ca3af",marginLeft:"24px"}},t.shortcut):null,v=u&&c?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((e,t)=>o(mt,{key:String(t),item:e,onClose:n,index:t})))):null;return o("div",{style:{position:"relative"},onMouseEnter:g,onMouseLeave:x},o("button",{type:"button",role:"menuitem",style:m,onClick:h,disabled:p||void 0,tabIndex:-1,"aria-disabled":p||void 0,"aria-haspopup":u||void 0,"aria-expanded":u?c:void 0},y,b),v)}function yt(e){const{menu:t,index:n,isOpen:r,anyOpen:i,onOpen:l,onClose:a}=e,{hover:d,onMouseEnter:f,onMouseLeave:u}=dt(),p=c(null),h=s(()=>{r?a():l(n)},[r,n,l,a]),g=s(()=>{f(),i&&!r&&l(n)},[i,r,n,l,f]),x={display:"inline-flex",alignItems:"center",padding:"6px 12px",fontSize:"13px",fontFamily:"inherit",border:"none",outline:"none",cursor:"pointer",backgroundColor:r?"#e5e7eb":d?"#f3f4f6":"transparent",color:"#1f2937",borderRadius:"4px",transition:"background-color 0.1s"},m=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((e,t)=>o(mt,{key:String(t),item:e,onClose:a,index:t})))):null;return o("div",{style:{position:"relative",display:"inline-block"},onMouseEnter:g,onMouseLeave:u},o("button",{ref:p,type:"button",role:"menuitem",style:x,onClick:h,"aria-haspopup":"true","aria-expanded":String(r),tabIndex:0},t.label),m)}function bt(e){const{menus:t}=e,[n,r]=l(null),i=c(null),d=s(e=>{r(e)},[]),f=s(()=>{r(null)},[]);a(()=>{if(null===n)return;const e=e=>{const t=i.current;t&&!t.contains(e.target)&&r(null)};return document.addEventListener("click",e,!0),()=>{document.removeEventListener("click",e,!0)}},[n]),a(()=>{const e=i.current;if(!e)return;const o=o=>{const i=o;if("Escape"!==i.key){if("ArrowRight"===i.key)return i.preventDefault(),void r(e=>null===e?0:(e+1)%t.length);if("ArrowLeft"===i.key)return i.preventDefault(),void r(e=>null===e?t.length-1:(e-1+t.length)%t.length);if("ArrowDown"===i.key&&null!==n){i.preventDefault();const t=e.querySelector('[role="menu"]');if(t){const e=t.querySelector('[role="menuitem"]');e&&e.focus()}return}"Enter"!==i.key&&i.key}else r(null)};return e.addEventListener("keydown",o),()=>{e.removeEventListener("keydown",o)}},[n,t.length]);const u=t.map((e,t)=>o(yt,{key:String(t),menu:e,index:t,isOpen:n===t,anyOpen:null!==n,onOpen:d,onClose:f}));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"}},...u)}function vt(e,t){const n=[];for(let o=e;o<=t;o++)n.push(o);return n}const wt={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"},kt={...wt,backgroundColor:"#2563eb",color:"#ffffff",borderColor:"#2563eb",fontWeight:"600"},St={...wt,color:"#9ca3af",cursor:"default",opacity:"0.5"},$t={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"36px",height:"36px",color:"#6b7280",fontSize:"14px",userSelect:"none"};function Mt(e){const{total:t,pageSize:n,currentPage:r,onChange:i,siblingCount:l=1,showFirstLast:a=!0,showPrevNext:d=!0,disabled:c=!1}=e,f=Math.max(1,Math.ceil(t/n)),u=Math.min(Math.max(1,r),f),p=s(e=>{!c&&e>=1&&e<=f&&e!==u&&i(e)},[c,f,u,i]),h=(e,t,n)=>{const r=c||t<1||t>f||t===u;return o("button",{type:"button",onClick:()=>p(t),disabled:r||void 0,"aria-label":n,style:r?St:wt},e)},g=function(e,t,n){if(e<=2*n+5)return vt(1,e);const o=Math.max(t-n,1),r=Math.min(t+n,e),i=o>2,l=r<e-1;return!i&&l?[...vt(1,2*n+3),"ellipsis",e]:i&&!l?[1,"ellipsis",...vt(e-2*n-2,e)]:[1,"ellipsis",...vt(o,r),"ellipsis",e]}(f,u,l);let x=0;const m=[];a&&m.push(h("«",1,"Go to first page")),d&&m.push(h("‹",u-1,"Go to previous page"));for(const e of g)if("ellipsis"===e)m.push(o("span",{key:"ellipsis-"+x++,style:$t},"..."));else{const t=e===u;m.push(o("button",{key:String(e),type:"button",onClick:()=>p(e),disabled:c||void 0,"aria-label":`Page ${e}`,"aria-current":t?"page":void 0,style:c?St:t?kt:wt},String(e)))}return d&&m.push(h("›",u+1,"Go to next page")),a&&m.push(h("»",f,"Go to last page")),o(at,{orientation:"horizontal",role:"navigation",ariaLabel:"Pagination",keyboardNav:!0,styling:{border:"none",borderRadius:"0",backgroundColor:"transparent",padding:"0",custom:{gap:"4px"}}},...m)}function zt(e){const{item:t,collapsed:n,selectedId:r,onSelect:i,depth:a}=e,{hover:d,onMouseEnter:c,onMouseLeave:f}=dt(),[u,p]=l(!1),h=t.children&&t.children.length>0,g=t.id===r,x=s(()=>{h&&!n&&p(e=>!e),i&&i(t.id)},[h,n,i,t.id]),m={display:"flex",alignItems:"center",padding:n?"10px 0":"10px 12px 10px "+(n?"0":16+16*a+"px"),justifyContent:n?"center":"flex-start",cursor:"pointer",backgroundColor:g?"#eff6ff":d?"#f3f4f6":"transparent",color:g?"#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,b=n?null:o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.label),v=!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,w=!n&&h?o("span",{style:{fontSize:"10px",transition:"transform 0.15s",transform:u?"rotate(90deg)":"rotate(0deg)",marginLeft:"4px"},"aria-hidden":"true"},"▶"):null,k=n&&d?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,S=o("button",{type:"button",style:m,onClick:x,onMouseEnter:c,onMouseLeave:f,"aria-selected":g?"true":"false",title:n?t.label:void 0},y,b,v,w,k),$=!n&&h&&u?t.children.map(e=>o(zt,{key:e.id,item:e,collapsed:n,selectedId:r,onSelect:i,depth:a+1})):null;return o("div",{key:t.id,style:{position:"relative"}},S,$?o("div",{role:"group"},...$):null)}function Ct(e){const{items:t,collapsed:n=!1,onToggleCollapse:r,selectedId:i,onSelect:l,width:a="240px",collapsedWidth:s="56px"}=e,d=n?"number"==typeof s?`${s}px`:s:"number"==typeof a?`${a}px`:a,c=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?"▶":"◀"):null,f=t.map(e=>o(zt,{key:e.id,item:e,collapsed:n,selectedId:i,onSelect:l,depth:0}));return o(at,{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"}}},c,...f)}function It(e){const{steps:t,currentStep:n,orientation:r="horizontal",onChange:i,clickable:l=!1,variant:a="circle"}=e,d="horizontal"===r,c="circle"===a?32:12,f="dot"===a?12:32,u=s(e=>{l&&i&&i(e)},[l,i]),p=[];return t.forEach((e,r)=>{p.push(((e,t)=>{const r=(e=>e<n?"completed":e===n?"active":"pending")(t),i="active"===r,s="completed"===r,p=((e,t,n)=>{const r="dot"===a?f:c,i={width:`${r}px`,height:`${r}px`,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"circle"===a?"14px":"0",fontWeight:"600",flexShrink:"0",transition:"background-color 0.2s, border-color 0.2s"};return"completed"===n?o("div",{style:{...i,backgroundColor:"#2563eb",color:"#ffffff",border:"2px solid #2563eb"}},"circle"===a?t.icon||"✓":null):"active"===n?o("div",{style:{...i,backgroundColor:"#ffffff",color:"#2563eb",border:"2px solid #2563eb",boxShadow:"0 0 0 3px rgba(37, 99, 235, 0.2)"}},"circle"===a?t.icon||String(e+1):o("div",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"#2563eb"}})):o("div",{style:{...i,backgroundColor:"#ffffff",color:"#9ca3af",border:"2px solid #d1d5db"}},"circle"===a?t.icon||String(e+1):null)})(t,e,r),h={fontSize:"11px",color:"#6b7280",marginTop:"2px",textAlign:d?"center":"left"},g=o("div",{style:d?{display:"flex",flexDirection:"column",alignItems:"center"}:{display:"flex",flexDirection:"column"}},o("span",{style:{fontSize:"13px",fontWeight:i?"600":"400",color:i||s?"#1f2937":"#9ca3af",marginTop:d?"8px":"0",marginLeft:d?"0":"12px",textAlign:d?"center":"left",transition:"color 0.2s"}},e.label),e.description?o("span",{style:h},e.description):null),x=o("div",d?{style:{display:"flex",flexDirection:"column",alignItems:"center"}}:{style:{display:"flex",flexDirection:"row",alignItems:"center"}},p,g);return o(l?"button":"div",{key:String(t),onClick:l?()=>u(t):void 0,style:{display:"flex",flexDirection:d?"column":"row",alignItems:d?"center":"flex-start",background:"none",border:"none",padding:"0",cursor:l?"pointer":"default",fontFamily:"inherit",outline:"none"},"aria-current":i?"step":void 0},x)})(e,r));const i=(e=>{if(e>=t.length-1)return null;const r=e<n?"#2563eb":"#d1d5db";return o("div",d?{style:{flex:"1",height:"2px",backgroundColor:r,margin:"0 8px",alignSelf:"center",transition:"background-color 0.2s"}}:{style:{width:"2px",flex:"1",minHeight:"24px",backgroundColor:r,marginLeft:("dot"===a?f:c)/2-1+"px",transition:"background-color 0.2s"}})})(r);i&&p.push(i)}),o("div",{role:"navigation","aria-label":"Progress steps",style:{display:"flex",flexDirection:d?"row":"column",alignItems:d?"flex-start":"stretch",width:"100%"}},...p)}const At={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 Ft(e){const{item:t,size:n,variant:r}=e,{hover:i,onMouseEnter:a,onMouseLeave:d}=dt(),c=At[n],f=!0===t.disabled,u="toggle"===t.type,[p,h]=l(!1),g=u?!0===t.active:p,x=s(()=>{!f&&t.onClick&&t.onClick()},[f,t]),m=s(()=>{f||u||h(!0)},[f,u]),y=s(()=>{u||h(!1)},[u]),b=s(()=>{d(),u||h(!1)},[u,d]),v={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"6px",height:c.height,padding:c.padding,fontSize:c.fontSize,fontFamily:"inherit",border:"raised"===r?"1px solid #d1d5db":"1px solid transparent",borderRadius:"4px",backgroundColor:g?"#e0e7ff":!f&&i?"#f3f4f6":"raised"===r?"#ffffff":"transparent",color:f?"#9ca3af":g?"#2563eb":"#374151",cursor:f?"default":"pointer",opacity:f?"0.5":"1",outline:"none",transition:"background-color 0.15s"},w=t.icon?o("span",{style:{fontSize:c.iconSize},"aria-hidden":"true"},t.icon):null,k=t.label?o("span",null,t.label):null,S="dropdown"===t.type?o("span",{style:{fontSize:"10px",marginLeft:"2px"},"aria-hidden":"true"},"▼"):null;return o("button",{type:"button",style:v,onClick:x,onMouseDown:m,onMouseUp:y,onMouseEnter:a,onMouseLeave:b,disabled:f||void 0,"aria-pressed":u?g:void 0,"aria-label":t.label||t.id,title:t.label||t.id},w,k,S)}function Rt(e){const{items:t,size:n="md",variant:r="flat"}=e,i=At[n],l=t.map(e=>"separator"===e.type?o("div",{key:e.id,role:"separator","aria-orientation":"vertical",style:{width:"1px",height:i.height,backgroundColor:"#d1d5db",margin:"0 4px",flexShrink:"0"}}):"spacer"===e.type?o("div",{key:e.id,style:{flex:"1"},"aria-hidden":"true"}):o(Ft,{key:e.id,item:e,size:n,variant:r}));return o(at,{orientation:"horizontal",role:"toolbar",ariaLabel:"Toolbar",keyboardNav:!0,styling:{border:"raised"===r?"1px solid #e5e7eb":"none",borderRadius:"raised"===r?"8px":"0",padding:"4px",backgroundColor:"raised"===r?"#ffffff":"transparent",boxShadow:"raised"===r?"0 1px 3px rgba(0,0,0,0.1)":void 0,custom:{gap:"2px",alignItems:"center"}}},...l)}class Dt{constructor(e,t){this.id=e.id,this.label=e.label,this.expanded=e.expanded??!1,this.icon=e.icon??null,this.metadata=e.metadata??{},this.parent=t??null,this.depth=t?t.depth+1:0,this.children=(e.children??[]).map(e=>new Dt(e,this))}static fromData(e){return new Dt(e)}isLeaf(){return 0===this.children.length}isRoot(){return null===this.parent}walk(e){e(this,this.depth);for(const t of this.children)t.walk(e)}find(e){if(this.id===e)return this;for(const t of this.children){const n=t.find(e);if(n)return n}return null}toggle(){this.expanded=!this.expanded}expand(){this.expanded=!0}collapse(){this.expanded=!1}addChild(e){const t=new Dt(e,this);return this.children.push(t),t}removeChild(e){const t=this.children.findIndex(t=>t.id===e);return-1!==t&&(this.children.splice(t,1),!0)}}function Lt(e){e.expanded=!0;for(const t of e.children)Lt(t)}function Wt(e,t=[]){if(t.push(e),e.expanded)for(const n of e.children)Wt(n,t);return t}function Nt(e){if(!e.parent)return!0;const t=e.parent.children;return t[t.length-1]===e}function Et(e){const{node:t,isSelected:n,indentPx:r,lineColor:i,lineWidth:l,iconExpanded:s,iconCollapsed:d,nodeStyle:f,renderNode:u,onToggle:p,onClick:h,focusedId:g}=e,x=dt(),m=c(null),y=g===t.id;a(()=>{y&&m.current&&m.current.focus()},[y]);const b=t.isLeaf(),v=t.depth,w=[];for(let e=0;e<v;e++){let n=t;for(let t=0;t<v-e;t++)n=n?n.parent:null;const a=!!n&&!Nt(n);w.push(o("span",{key:`connector-${e}`,"aria-hidden":"true",style:{display:"inline-block",width:`${r}px`,height:"100%",position:"relative",flexShrink:"0",...a?{borderLeft:`${l}px solid ${i}`}:{}}}))}const k=v>0?o("span",{"aria-hidden":"true",style:{display:"inline-block",width:`${Math.floor(r/2)}px`,height:"0",borderTop:`${l}px solid ${i}`,flexShrink:"0",alignSelf:"center",marginLeft:`-${r}px`}}):null,S=b?o("span",{"aria-hidden":"true",style:{display:"inline-block",width:"18px",flexShrink:"0",marginRight:"4px"}}):o("span",{"aria-hidden":"true",role:"button",tabIndex:0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"18px",height:"18px",fontSize:"14px",lineHeight:"1",cursor:"pointer",userSelect:"none",flexShrink:"0",marginRight:"4px",fontFamily:"monospace"},onClick:e=>{e.stopPropagation(),p(t)}},t.expanded?s: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=st(f,{hover:x.hover,active:n});return o("div",{ref:m,role:"treeitem","aria-expanded":b?void 0:String(t.expanded),"aria-selected":n?"true":"false","aria-level":v+1,tabIndex:y?0:-1,style:{...M,display:"flex",alignItems:"stretch",padding:"0"},onMouseEnter:x.onMouseEnter,onMouseLeave:x.onMouseLeave,onClick:()=>h(t)},...w,k,o("span",{style:{display:"flex",alignItems:"center",flex:"1",padding:f.padding??"6px 10px",minWidth:"0"}},S,$))}function Tt(e){const{root:t,onNodeClick:n,onNodeExpand:r,onNodeCollapse:i,selectedId:a,expandAll:c=!1,lineColor:f="#000",lineWidth:u=1,indentPx:p=20,iconExpanded:h="−",iconCollapsed:g="+",nodeStyle:x={},wrapperStyle:m,renderNode:y}=e,[b,v]=l(()=>{const e=Dt.fromData(t);return c&&Lt(e),e}),[w,k]=l(t.id),S=d(()=>Wt(b),[b]),$=s(()=>{v(e=>{const t=Object.create(Object.getPrototypeOf(e));return Object.assign(t,e),t})},[]),M=s(e=>{e.toggle(),e.expanded?r?.(e):i?.(e),$()},[r,i,$]),z=s(e=>{k(e.id),n?.(e)},[n]),C=s(e=>{const t=e;if(!w)return;const n=S.findIndex(e=>e.id===w);if(-1===n)return;const o=S[n];switch(t.key){case"ArrowDown":{t.preventDefault();const e=S[n+1];e&&k(e.id);break}case"ArrowUp":{t.preventDefault();const e=S[n-1];e&&k(e.id);break}case"ArrowRight":t.preventDefault(),o.isLeaf()||(o.expanded?o.children.length>0&&k(o.children[0].id):M(o));break;case"ArrowLeft":t.preventDefault(),!o.isLeaf()&&o.expanded?M(o):o.parent&&k(o.parent.id);break;case"Enter":t.preventDefault(),z(o);break;case" ":t.preventDefault(),o.isLeaf()||M(o);break;case"Home":t.preventDefault(),S.length>0&&k(S[0].id);break;case"End":t.preventDefault(),S.length>0&&k(S[S.length-1].id)}},[w,S,M,z]),I=S.map(e=>o(Et,{key:e.id,node:e,isSelected:e.id===a,indentPx:p,lineColor:f,lineWidth:u,iconExpanded:h,iconCollapsed:g,nodeStyle:x,renderNode:y,onToggle:M,onClick:z,focusedId:w}));return o(at,{role:"tree",ariaLabel:"Tree navigation",styling:m,keyboardNav:!1},o("div",{onKeyDown:C,style:{outline:"none"}},...I))}function Pt(e){const{items:t,position:n,onClose:r,depth:i}=e,[s,d]=l(-1),[f,u]=l(null),p=c(null);a(()=>{if(!p.current)return;p.current.focus();const e=e=>{const n=e,o=t.map((e,t)=>({item:e,i:t})).filter(({item:e})=>!e.divider);if("ArrowDown"===n.key)n.preventDefault(),d(e=>{const t=(o.findIndex(({i:t})=>t===e)+1)%o.length;return o[t].i});else if("ArrowUp"===n.key)n.preventDefault(),d(e=>{const t=o.findIndex(({i:t})=>t===e),n=t<=0?o.length-1:t-1;return o[n].i});else if("ArrowRight"===n.key)s>=0&&t[s]?.children&&u(s);else if("ArrowLeft"===n.key)i>0&&r();else if("Enter"===n.key){if(n.preventDefault(),s>=0){const e=t[s];e.children?u(s):!e.disabled&&e.onClick&&(e.onClick(),r())}}else"Escape"===n.key&&r()};p.current.addEventListener("keydown",e);const n=p.current;return()=>n.removeEventListener("keydown",e)},[t,s,i,r]);const h={position:"fixed",left:`${n.x}px`,top:`${n.y}px`,backgroundColor:"#fff",border:"1px solid #e5e7eb",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.15)",padding:"4px 0",minWidth:"180px",zIndex:`${10200+i}`,outline:"none",overflow:"visible"},g=t.map((e,t)=>{if(e.divider)return o("div",{key:`divider-${t}`,style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});const l=s===t,a=!!e.disabled,c=!!(e.children&&e.children.length>0),p={display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",fontSize:"14px",color:a?"#9ca3af":"#1f2937",cursor:a?"default":"pointer",backgroundColor:l&&!a?"#f3f4f6":"transparent",userSelect:"none",position:"relative"},h=[];e.icon&&h.push(o("span",{style:{width:"20px",textAlign:"center",flexShrink:"0"}},e.icon)),h.push(o("span",{style:{flex:"1"}},e.label??"")),c&&h.push(o("span",{style:{fontSize:"10px",color:"#9ca3af",marginLeft:"8px"}},"▶"));const g=[o("div",{key:`item-${t}`,style:p,onMouseEnter:()=>{d(t),u(c?t:null)},onClick:()=>{a||(c?u(t):(e.onClick&&e.onClick(),r()))},role:"menuitem","aria-disabled":a?"true":void 0},...h)];return c&&f===t&&g.push(o(Pt,{key:`submenu-${t}`,items:e.children,position:{x:n.x+178,y:n.y+36*t},onClose:()=>u(null),depth:i+1})),o("div",{key:`wrap-${t}`,style:{position:"relative"}},...g)});return o("div",{ref:p,style:h,tabIndex:-1,role:"menu"},...g)}function Bt(e){const{items:t,children:n}=e,[r,i]=l(null),d=s(e=>{e.preventDefault();const t=e;i({x:t.clientX,y:t.clientY})},[]),c=s(()=>{i(null)},[]);a(()=>{if(!r)return;const e=e=>{c()},t=setTimeout(()=>{document.addEventListener("mousedown",e)},0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[r,c]),a(()=>{if(!r)return;const e=e=>{"Escape"===e.key&&c()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[r,c]);const f=[o("div",{onContextMenu:d,style:{display:"contents"}},n)];return r&&f.push(o(Pt,{items:t,position:r,onClose:c,depth:0})),o("div",null,...f)}function _t(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 Ht(e,t){const 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 Yt(e){const{open:t,onClose:n,position:r="right",size:i="320px",title:s,overlay:d=!0,closeOnOverlay:f=!0,closeOnEscape:u=!0,children:p}=e,[h,g]=l(!1),[x,m]=l(!1),y=c(null),b=s?"drawer-title":void 0;if(a(()=>{if(!t){m(!1);const e=setTimeout(()=>g(!1),300);return()=>clearTimeout(e)}g(!0),requestAnimationFrame(()=>m(!0))},[t]),a(()=>{if(!t||!u)return;const e=e=>{"Escape"===e.key&&n()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t,u,n]),a(()=>{if(!t)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[t]),a(()=>{t&&y.current&&y.current.focus()},[t]),!h)return null;const v={position:"fixed",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:"10000",opacity:x?"1":"0",transition:"opacity 0.3s ease"},w={...Ht(r,i),transform:_t(r,x),transition:"transform 0.3s ease"},k=[];s&&k.push(o("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"}},o("h3",{id:b,style:{margin:"0",fontSize:"16px",fontWeight:"600",color:"#111827"}},s),o("button",{type:"button",style:{background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",lineHeight:"1"},onClick:n,"aria-label":"Close drawer"},"×"))),k.push(o("div",{style:{padding:"20px",overflow:"auto",flex:"1"}},p));const S=[];return d&&S.push(o("div",{style:v,onClick:()=>{f&&n()}})),S.push(o("div",{ref:y,style:w,role:"dialog","aria-modal":"true","aria-labelledby":b,tabIndex:-1},...k)),o("div",null,...S)}const jt={sm:"400px",md:"600px",lg:"800px",full:"100vw"};function qt(e){const{open:t,onClose:n,title:r,size:i="md",closeOnOverlay:l=!0,closeOnEscape:s=!0,footer:d,showCloseButton:f=!0,children:u}=e,p=c(null);if(a(()=>{if(!t)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[t]),a(()=>{if(!t||!s)return;const e=e=>{"Escape"===e.key&&n()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t,s,n]),a(()=>{t&&p.current&&p.current.focus()},[t]),!t)return null;const h={backgroundColor:"#fff",borderRadius:"full"===i?"0":"8px",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.3)",maxHeight:"full"===i?"100vh":"90vh",width:jt[i],maxWidth:"full"===i?"100vw":"90vw",display:"flex",flexDirection:"column",outline:"none",overflow:"hidden"},g=[],x=r?"modal-title":void 0;r?g.push(o("h2",{id:x,style:{margin:"0",fontSize:"18px",fontWeight:"600",color:"#111827"}},r)):g.push(o("span",null)),f&&g.push(o("button",{type:"button",style:{background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",borderRadius:"4px",lineHeight:"1"},onClick:n,"aria-label":"Close modal"},"×"));const m=[o("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 24px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"}},...g),o("div",{style:{padding:"24px",overflow:"auto",flex:"1"}},u)];return d&&m.push(o("div",{style:{padding:"16px 24px",borderTop:"1px solid #e5e7eb",flexShrink:"0"}},d)),o("div",{style:{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"},onClick:e=>{l&&e.target===e.currentTarget&&n()},"aria-modal":"true",role:"dialog","aria-labelledby":x},o("div",{ref:p,style:h,tabIndex:-1,role:"document"},...m))}function Ot(e,t){const n=t+8;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 Ut(e){const t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n="8px",o="transparent";switch(e){case"top":return{...t,bottom:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`${n} ${n} 0 ${n}`,borderColor:`#fff ${o} ${o} ${o}`};case"bottom":return{...t,top:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`0 ${n} ${n} ${n}`,borderColor:`${o} ${o} #fff ${o}`};case"left":return{...t,right:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} 0 ${n} ${n}`,borderColor:`${o} ${o} ${o} #fff`};case"right":return{...t,left:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} ${n} ${n} 0`,borderColor:`${o} #fff ${o} ${o}`}}}function Xt(e){const{trigger:t,content:n,open:r,placement:i="bottom",offset:d=4,arrow:f=!1,closeOnClickOutside:u=!0,onOpenChange:p}=e,h=void 0!==r,[g,x]=l(!1),m=h?r:g,y=c(null),b=s(()=>{h?p&&p(!r):x(e=>!e)},[h,r,p]);a(()=>{if(!m||!u)return;const e=e=>{y.current&&!y.current.contains(e.target)&&(h?p&&p(!1):x(!1))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[m,u,h,p]);const v={...Ot(i,d),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"},w=[n];f&&w.push(o("div",{style:Ut(i)}));const k=s(e=>{const t=e.key;"Enter"!==t&&" "!==t||(e.preventDefault(),b())},[b]),S=[o("div",{onClick:b,onKeyDown:k,role:"button",tabIndex:0,style:{display:"inline-block"}},t)];return m&&S.push(o("div",{style:v},...w)),o("div",{ref:y,style:{position:"relative",display:"inline-block"}},...S)}let Vt=0;function Gt(e={}){const t={position:e.position??"top-right",maxToasts:e.maxToasts??5,defaultDuration:e.defaultDuration??4e3};let n=[];const o=new Set;function r(){o.forEach(e=>e())}return{toast:function(e,o={}){const i=`toast-${++Vt}-${Date.now()}`,l={id:i,message:e,type:o.type??"info",duration:o.duration??t.defaultDuration,action:o.action,createdAt:Date.now()};return n=[l,...n].slice(0,t.maxToasts),r(),i},dismiss:function(e){n=n.filter(t=>t.id!==e),r()},dismissAll:function(){n=[],r()},subscribe:e=>(o.add(e),()=>{o.delete(e)}),getToasts:()=>n,config:t}}const Kt={info:{bg:"#eff6ff",border:"#3b82f6",icon:"ℹ️"},success:{bg:"#f0fdf4",border:"#22c55e",icon:"✅"},warning:{bg:"#fffbeb",border:"#f59e0b",icon:"⚠️"},error:{bg:"#fef2f2",border:"#ef4444",icon:"❌"}};function Zt(e){const{item:t,onDismiss:n}=e,r=Kt[t.type];a(()=>{if(t.duration<=0)return;const e=setTimeout(()=>n(t.id),t.duration);return()=>clearTimeout(e)},[t.id,t.duration,n]);const 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"},l={background:"none",border:`1px solid ${r.border}`,borderRadius:"4px",cursor:"pointer",fontSize:"12px",fontWeight:"600",color:r.border,padding:"4px 10px",flexShrink:"0"},s=[o("span",null,r.icon),o("span",{style:{flex:"1",fontSize:"14px",color:"#1f2937",lineHeight:"1.4"}},t.message)];return t.action&&s.push(o("button",{type:"button",style:l,onClick:t.action.onClick},t.action.label)),s.push(o("button",{type:"button",style:{background:"none",border:"none",cursor:"pointer",fontSize:"16px",color:"#9ca3af",padding:"2px 6px",lineHeight:"1",flexShrink:"0"},onClick:()=>n(t.id),"aria-label":"Dismiss toast"},"×")),o("div",{style:i,role:"alert"},...s)}function Jt(e){const{toaster:t}=e,[,n]=l(0);a(()=>t.subscribe(()=>n(e=>e+1)),[t]);const r=t.getToasts();if(0===r.length)return null;const i=function(e){const t={position:"fixed",zIndex:"10100",display:"flex",flexDirection:"column",gap:"8px",padding:"16px",pointerEvents:"none"},n=e.startsWith("top"),o=e.startsWith("bottom"),r=e.endsWith("left"),i=e.endsWith("right"),l=e.endsWith("center");return n&&(t.top="0"),o&&(t.bottom="0",t.flexDirection="column-reverse"),r&&(t.left="0"),i&&(t.right="0"),l&&(t.left="50%",t.transform="translateX(-50%)"),t}(t.config.position);a(()=>{const e="specifyjs-toast-keyframes";if(document.getElementById(e))return;const t=document.createElement("style");return t.id=e,t.textContent="\n @keyframes specifyjs-toast-slide-in {\n from { opacity: 0; transform: translateY(-12px); }\n to { opacity: 1; transform: translateY(0); }\n }\n ",document.head.appendChild(t),()=>{const t=document.getElementById(e);t&&t.remove()}},[]);const d=s(e=>t.dismiss(e),[t]),c=r.map(e=>o(Zt,{key:e.id,item:e,onDismiss:d}));return o("div",{style:i},...c)}function Qt(e={}){const t=c(null);t.current||(t.current=Gt(e));const n=t.current,r=s(()=>o(Jt,{toaster:n}),[n]);return{toast:n.toast,dismiss:n.dismiss,dismissAll:n.dismissAll,ToastContainer:r}}function en(e){const t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n="6px",o="transparent",r="#1f2937";switch(e){case"top":return{...t,bottom:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`${n} ${n} 0 ${n}`,borderColor:`${r} ${o} ${o} ${o}`};case"bottom":return{...t,top:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`0 ${n} ${n} ${n}`,borderColor:`${o} ${o} ${r} ${o}`};case"left":return{...t,right:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} 0 ${n} ${n}`,borderColor:`${o} ${o} ${o} ${r}`};case"right":return{...t,left:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} ${n} ${n} 0`,borderColor:`${o} ${r} ${o} ${o}`}}}function tn(e){const{text:t,placement:n="top",delay:r=200,maxWidth:i="250px",children:d}=e,[f,u]=l(!1),[p,h]=l(null),g=c(null),x=c(null),m=`tooltip-${Math.random().toString(36).slice(2,9)}`,y=s(()=>{x.current=setTimeout(()=>{if(g.current){const e=g.current.getBoundingClientRect();h(function(e,t){switch(t){case"top":return{position:"fixed",left:`${e.left+e.width/2}px`,top:e.top-8+"px",transform:"translate(-50%, -100%)"};case"bottom":return{position:"fixed",left:`${e.left+e.width/2}px`,top:`${e.bottom+8}px`,transform:"translateX(-50%)"};case"left":return{position:"fixed",left:e.left-8+"px",top:`${e.top+e.height/2}px`,transform:"translate(-100%, -50%)"};case"right":return{position:"fixed",left:`${e.right+8}px`,top:`${e.top+e.height/2}px`,transform:"translateY(-50%)"}}}(e,n))}u(!0)},r)},[r,n]),b=s(()=>{x.current&&(clearTimeout(x.current),x.current=null),u(!1)},[]);a(()=>()=>{x.current&&clearTimeout(x.current)},[]);const v={...p??{},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"},w=[o("div",{ref:g,style:{display:"inline-block"},onMouseEnter:y,onMouseLeave:b,onFocus:y,onBlur:b,"aria-describedby":f?m:void 0},d)];return f&&p&&w.push(o("div",{id:m,style:v,role:"tooltip"},t,o("div",{style:en(n)}))),o("div",{style:{display:"inline-block",position:"relative"}},...w)}function nn(e,t,n,o,r){return d(()=>{const i=Math.max(1,(o-r*(e+1))/e);return{valueScale:e=>0===t?0:e/t*n,categoryScale:e=>r+e*(i+r),barThickness:i,maxValue:t,valueAxisLength:n,categoryAxisLength:o}},[e,t,n,o,r])}const on=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function rn(e,t){return t||on[e%on.length]}function ln(e){const{data:t=[],width:n=600,height:r=400,orientation:i="vertical",barColor:l="#3b82f6",barGap:a=8,barRadius:c=4,showValues:f=!0,showGrid:u=!0,gridColor:p="#e5e7eb",title:h,padding:g=50,animate:x=!1,stacked:m,grouped:y=!1}=e,b="vertical"===i,v=n-2*g,w=r-2*g,k=b?w:v,S=b?v:w,$=void 0!==m&&m.length>0,M=d(()=>$?function(e){const t=new Set;for(const n of e)for(const e of n.values)t.add(e.category);return Array.from(t)}(m):[],[$,m]),z=$?m.length:t.length,C=d(()=>function(e,t,n){if(t&&t.length>0){if(n){let e=0;for(const n of t)for(const t of n.values)t.value>e&&(e=t.value);return e}let e=0;for(const n of t){let t=0;for(const e of n.values)t+=e.value;t>e&&(e=t)}return e}let o=0;for(const t of e)t.value>o&&(o=t.value);return o}(t,m,y),[t,m,y]),I=C>0?C:1,A=nn(z,I,k,S,a),F=s(()=>{if(!u)return[];const e=function(e){if(e<=0)return 1;const t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),o=t/n;return o<=1.5?n:o<=3.5?2*n:o<=7.5?5*n:10*n}(I),t=[];for(let n=e;n<=I;n+=e){const e=A.valueScale(n);if(b){const r=g+w-e;t.push(o("line",{key:`grid-${n}`,x1:String(g),y1:String(r),x2:String(g+v),y2:String(r),stroke:p,"stroke-width":"1","stroke-dasharray":"4 2"})),t.push(o("text",{key:`grid-label-${n}`,x:String(g-6),y:String(r+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(n)))}else{const r=g+e;t.push(o("line",{key:`grid-${n}`,x1:String(r),y1:String(g),x2:String(r),y2:String(g+w),stroke:p,"stroke-width":"1","stroke-dasharray":"4 2"})),t.push(o("text",{key:`grid-label-${n}`,x:String(r),y:String(g+w+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(n)))}}return t},[u,I,A,b,g,v,w,p]),R=s(()=>{const e=[];return b?(e.push(o("line",{key:"axis-y",x1:String(g),y1:String(g),x2:String(g),y2:String(g+w),stroke:"#374151","stroke-width":"1.5"})),e.push(o("line",{key:"axis-x",x1:String(g),y1:String(g+w),x2:String(g+v),y2:String(g+w),stroke:"#374151","stroke-width":"1.5"}))):(e.push(o("line",{key:"axis-x",x1:String(g),y1:String(g+w),x2:String(g+v),y2:String(g+w),stroke:"#374151","stroke-width":"1.5"})),e.push(o("line",{key:"axis-y",x1:String(g),y1:String(g),x2:String(g),y2:String(g+w),stroke:"#374151","stroke-width":"1.5"}))),e},[b,g,v,w]),D=s(()=>{const e=[];for(let n=0;n<t.length;n++){const r=t[n],i=A.valueScale(r.value),a=A.categoryScale(n),s=r.color??l;let d,u,p=String(r.value);if(b){const e=g+a,t=g+w-i;d={x:String(e),y:String(t),width:String(A.barThickness),height:String(i),rx:String(c),ry:String(c),fill:s},u={x:String(e+A.barThickness/2),y:String(t-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"}}else{const e=g+a,t=g;d={x:String(t),y:String(e),width:String(i),height:String(A.barThickness),rx:String(c),ry:String(c),fill:s},u={x:String(t+i+6),y:String(e+A.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"}}if(x&&(d.style=`animation: barGrow 0.6s ease-out ${.05*n}s both`),e.push(o("rect",{key:`bar-${n}`,...d})),f&&e.push(o("text",{key:`val-${n}`,...u},p)),b){const t=g+a+A.barThickness/2,i=g+w+16;e.push(o("text",{key:`cat-${n}`,x:String(t),y:String(i),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${t}, ${i})`},r.label))}else e.push(o("text",{key:`cat-${n}`,x:String(g-6),y:String(g+a+A.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},r.label))}return e},[t,A,l,c,f,x,b,g,w]),L=s(()=>{if(!m)return[];const e=[];for(let t=0;t<m.length;t++){const n=m[t],r=A.categoryScale(t);let i=0;for(let l=0;l<n.values.length;l++){const a=n.values[l],s=A.valueScale(a.value),d=A.valueScale(i),u=rn(l,a.color);if(b){const i=g+r,p=g+w-d-s;e.push(o("rect",{key:`sbar-${t}-${l}`,x:String(i),y:String(p),width:String(A.barThickness),height:String(s),rx:l===n.values.length-1?String(c):"0",ry:l===n.values.length-1?String(c):"0",fill:u,...x?{style:`animation: barGrow 0.6s ease-out ${.03*(t*n.values.length+l)}s both`}:{}})),f&&s>14&&e.push(o("text",{key:`sval-${t}-${l}`,x:String(i+A.barThickness/2),y:String(p+s/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(a.value)))}else{const i=g+d,p=g+r;e.push(o("rect",{key:`sbar-${t}-${l}`,x:String(i),y:String(p),width:String(s),height:String(A.barThickness),rx:l===n.values.length-1?String(c):"0",ry:l===n.values.length-1?String(c):"0",fill:u,...x?{style:`animation: barGrow 0.6s ease-out ${.03*(t*n.values.length+l)}s both`}:{}})),f&&s>20&&e.push(o("text",{key:`sval-${t}-${l}`,x:String(i+s/2),y:String(p+A.barThickness/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(a.value)))}i+=a.value}if(f){const n=A.valueScale(i);b?e.push(o("text",{key:`stotal-${t}`,x:String(g+r+A.barThickness/2),y:String(g+w-n-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(i))):e.push(o("text",{key:`stotal-${t}`,x:String(g+n+6),y:String(g+r+A.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(i)))}if(b){const i=g+r+A.barThickness/2,l=g+w+16;e.push(o("text",{key:`scat-${t}`,x:String(i),y:String(l),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${i}, ${l})`},n.label))}else e.push(o("text",{key:`scat-${t}`,x:String(g-6),y:String(g+r+A.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},n.label))}return e},[m,A,c,f,x,b,g,w]),W=s(()=>{if(!m)return[];const e=M.length,t=[];for(let n=0;n<m.length;n++){const r=m[n],i=A.categoryScale(n),l=2,a=Math.max(1,(A.barThickness-l*(e-1))/e);for(let s=0;s<r.values.length;s++){const d=r.values[s],u=M.indexOf(d.category),p=u*(a+l),h=A.valueScale(d.value),m=rn(u>=0?u:s,d.color);if(b){const r=g+i+p,l=g+w-h;t.push(o("rect",{key:`gbar-${n}-${s}`,x:String(r),y:String(l),width:String(a),height:String(h),rx:String(c),ry:String(c),fill:m,...x?{style:`animation: barGrow 0.6s ease-out ${.04*(n*e+s)}s both`}:{}})),f&&t.push(o("text",{key:`gval-${n}-${s}`,x:String(r+a/2),y:String(l-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(d.value)))}else{const r=g,l=g+i+p;t.push(o("rect",{key:`gbar-${n}-${s}`,x:String(r),y:String(l),width:String(h),height:String(a),rx:String(c),ry:String(c),fill:m,...x?{style:`animation: barGrow 0.6s ease-out ${.04*(n*e+s)}s both`}:{}})),f&&t.push(o("text",{key:`gval-${n}-${s}`,x:String(r+h+4),y:String(l+a/2+3),"text-anchor":"start","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(d.value)))}}if(b){const e=g+i+A.barThickness/2,l=g+w+16;t.push(o("text",{key:`gcat-${n}`,x:String(e),y:String(l),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${e}, ${l})`},r.label))}else t.push(o("text",{key:`gcat-${n}`,x:String(g-6),y:String(g+i+A.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},r.label))}return t},[m,M,A,c,f,x,b,g,w]),N=s(()=>h?[o("text",{key:"title",x:String(n/2),y:String(g/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,n,g]),E=s(()=>x?[o("defs",{key:"anim-defs"},o("style",{key:"anim-style"},b?"@keyframes barGrow { from { transform: scaleY(0); transform-origin: bottom; } to { transform: scaleY(1); transform-origin: bottom; } }":"@keyframes barGrow { from { transform: scaleX(0); transform-origin: left; } to { transform: scaleX(1); transform-origin: left; } }"))]:[],[x,b]),T=F(),P=R(),B=N(),_=E();let H;return H=$&&y?W():$?L():D(),o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",style:{fontFamily:"sans-serif"}},..._,...B,...T,...P,...H)}function an(e){const{start:t,end:n,step:o}=e;if(o<=0||!isFinite(o))return[];const r=Math.ceil((n-t)/o)+1;if(r>1e6)return[];const i=[];for(let e=0;e<r;e++){const r=t+e*o;if(r>n+.001*o)break;i.push(r)}return i}function sn(e,t){const n=[];for(let o=0;o<t.length;o++){const r=t[o],i=e(r);isFinite(i)&&n.push({input:r,output:i})}return n}function dn(e,t,n,o){let r=!1,i=0;const l=[],a=()=>{if(r)return;const s=Math.min(i+n,t.length);for(let n=i;n<s;n++){const o=t[n],r=e(o);isFinite(r)&&l.push({input:o,output:r})}i=s,i>=t.length?o(l,!0):(o(l,!1),cn(a))};return cn(a),()=>{r=!0}}function cn(e){"function"==typeof requestIdleCallback?requestIdleCallback(()=>e(),{timeout:16}):setTimeout(e,0)}function fn(e,t){const n=t-e;if(n<=0)return[e];const o=function(e){const t=e/8,n=Math.pow(10,Math.floor(Math.log10(t))),o=t/n;return(o<1.5?1:o<3?2:o<7?5:10)*n}(n),r=[];for(let n=Math.ceil(e/o)*o;n<=t+.001*o;n+=o)r.push(Math.round(1e10*n)/1e10);return r}function un(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}const pn=40,hn=1e6;function gn(e){const{width:t=400,height:n=300,points:r=[],plotFunction:i,plotResolution:f=200,xStep:u,sync:p=!1,xRange:h=[-5,5],yRange:g=[-5,5],showGrid:x=!0,showAxes:m=!0,pointRadius:y=3,pointColor:b="#3b82f6",curveColor:v="#3b82f6",gridColor:w="#e2e8f0",axisColor:k="#94a3b8",onPointClick:S,onPointDoubleClick:$,onPointContextMenu:M,onPointHover:z}=e,[C,I]=l(h[0]),[A,F]=l(h[1]),[R,D]=l(g[0]),[L,W]=l(g[1]),N=c(!1),E=c(null),T=s(e=>pn+(e-C)/(A-C)*(t-80),[C,A,t]),P=s(e=>n-pn-(e-R)/(L-R)*(n-80),[R,L,n]),B=s(e=>C+(e-pn)/(t-80)*(A-C),[C,A,t]),_=s(e=>R+(n-pn-e)/(n-80)*(L-R),[R,L,n]),H=s(e=>{const t=e;N.current=!0,E.current={mx:t.clientX,my:t.clientY,x0:C,x1:A,y0:R,y1:L}},[C,A,R,L]),Y=s(e=>{if(!N.current||!E.current)return;const o=e,r=E.current,i=o.clientX-r.mx,l=o.clientY-r.my,a=i/(t-80)*(r.x1-r.x0),s=l/(n-80)*(r.y1-r.y0);I(r.x0-a),F(r.x1-a),D(r.y0+s),W(r.y1+s)},[t,n]),j=s(()=>{N.current=!1,E.current=null},[]),q=s(e=>{const t=e;t.preventDefault();const n=t.currentTarget.getBoundingClientRect(),o=t.clientX-n.left,r=t.clientY-n.top,i=B(o),l=_(r),a=t.deltaY>0?1.1:1/1.1,s=(A-C)*a,d=(L-R)*a;if(s<.01||d<.01||s>hn||d>hn)return;const c=(i-C)/(A-C),f=(l-R)/(L-R);I(i-c*s),F(i+(1-c)*s),D(l-f*d),W(l+(1-f)*d)},[C,A,R,L,B,_]),O=[];if(O.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),x){const e=fn(C,A),r=fn(R,L);for(let t=0;t<e.length;t++){const r=T(e[t]);O.push(o("line",{x1:r,y1:pn,x2:r,y2:n-pn,stroke:w,"stroke-width":.5,key:`gx-${t}`})),O.push(o("text",{x:r,y:n-pn+14,"text-anchor":"end","font-size":10,fill:k,transform:`rotate(-45, ${r}, ${n-pn+14})`,key:`lx-${t}`},un(e[t])))}for(let e=0;e<r.length;e++){const n=P(r[e]);O.push(o("line",{x1:pn,y1:n,x2:t-pn,y2:n,stroke:w,"stroke-width":.5,key:`gy-${e}`})),O.push(o("text",{x:34,y:n+3,"text-anchor":"end","font-size":10,fill:k,key:`ly-${e}`},un(r[e])))}}if(m){const e=Math.max(pn,Math.min(t-pn,T(0))),r=Math.max(pn,Math.min(n-pn,P(0)));O.push(o("line",{x1:pn,y1:r,x2:t-pn,y2:r,stroke:k,"stroke-width":1,key:"x-axis"})),O.push(o("line",{x1:e,y1:pn,x2:e,y2:n-pn,stroke:k,"stroke-width":1,key:"y-axis"}))}const U=d(()=>{if(!i||!p)return[];const e=an({start:C,end:A,step:u??(A-C)/f});return sn(i,e)},[i,C,A,u,f,p]),[X,V]=l([]),G=c(null);a(()=>{if(!i||p)return void V([]);const e=an({start:C,end:A,step:u??(A-C)/f});return G.current&&G.current(),G.current=dn(i,e,200,e=>{V([...e])}),()=>{G.current&&G.current()}},[i,C,A,u,f,p]);const K=p?U:X;if(K.length>0){const e=[];for(let t=0;t<K.length;t++){const n=K[t],o=T(n.input),r=P(n.output);e.push(`${0===e.length?"M":"L"}${o},${r}`)}O.push(o("path",{d:e.join(" "),fill:"none",stroke:v,"stroke-width":1.5,key:"curve"}))}const Z=(e,t,n,o)=>{if(t)return e=>t({x:o.x,y:o.y,index:n,event:e})};for(let e=0;e<r.length;e++){const t=r[e],n={cx:T(t.x),cy:P(t.y),r:y,fill:b,cursor:"pointer",key:`pt-${e}`};S&&(n.onClick=Z(0,S,e,t)),$&&(n.onDblClick=Z(0,$,e,t)),M&&(n.onContextMenu=Z(0,M,e,t)),z&&(n.onMouseOver=Z(0,z,e,t)),O.push(o("circle",n))}const J=o("defs",{key:"defs"},o("clipPath",{id:"plot-clip"},o("rect",{x:pn,y:pn,width:t-80,height:n-80})));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:H,onMouseMove:Y,onMouseUp:j,onMouseLeave:j,onWheel:q},J,...O)}function xn(e,t,n){let o=0,r=0;for(let i=0;i<n;i++){const n=o*o,l=r*r;if(n+l>4)return i;r=2*o*r+t,o=n-l+e}return n}function mn(e,t,n){if(e===t)return[0,0,0];const o=e/t;if("fire"===n)return[Math.floor(255*Math.min(1,3*o)),Math.floor(255*Math.max(0,3*o-1)),Math.floor(255*Math.max(0,3*o-2))];if("ocean"===n)return[Math.floor(255*o*.3),Math.floor(255*o*.6),Math.floor(255*(.4+.6*o))];const r=360*o%360,i=1*(1-Math.abs(0)),l=i*(1-Math.abs(r/60%2-1)),a=.5-i/2;let s=0,d=0,c=0;return r<60?(s=i,d=l):r<120?(s=l,d=i):r<180?(d=i,c=l):r<240?(d=l,c=i):r<300?(s=l,c=i):(s=i,c=l),[Math.floor(255*(s+a)),Math.floor(255*(d+a)),Math.floor(255*(c+a))]}function yn(e,t,n=[-2.5,1],o=[-1.25,1.25],r=80,i=xn){const l=[];for(let a=0;a<t;a++){const s=[],d=o[1]-a/t*(o[1]-o[0]);for(let t=0;t<e;t++){const o=n[0]+t/e*(n[1]-n[0]);s.push(i(o,d,r))}l.push(s)}return l}function bn(e){const{width:t=400,height:n=300,realRange:r=[-2.5,1],imagRange:i=[-1.25,1.25],maxIterations:d=100,colorScheme:f="classic",computeFunction:u=xn,data:p,resolution:h=2,onPointClick:g,onPointHover:x,onPointDoubleClick:m,onPointContextMenu:y}=e;if(p){const e=p.length,r=e>0?p[0].length:0,i=r>0?t/r:1,l=e>0?n/e:1,a=[];for(let t=0;t<e;t++){const e=p[t];for(let n=0;n<r;n++){const r=e[n]??0,[s,c,u]=mn(r,d,f);a.push(o("rect",{key:`${t}-${n}`,x:String(n*i),y:String(t*l),width:String(Math.ceil(i)),height:String(Math.ceil(l)),fill:`rgb(${s},${c},${u})`}))}}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%"}},...a)}const[b,v]=l(r[0]),[w,k]=l(r[1]),[S,$]=l(i[0]),[M,z]=l(i[1]),C=c(null),I=c(!1),A=c(null),F=s((e,o)=>({re:b+e/t*(w-b),im:M-o/n*(M-S)}),[b,w,S,M,t,n]);a(()=>{const e=C.current;if(!e)return;const o=e.getContext("2d");if(!o)return;const r=o.createImageData(t,n),i=r.data;for(let e=0;e<n;e++)for(let n=0;n<t;n++){const{re:o,im:r}=F(n,e),l=u(o,r,d),[a,s,c]=mn(l,d,f),p=4*(e*t+n);i[p]=a,i[p+1]=s,i[p+2]=c,i[p+3]=255}o.putImageData(r,0,0)},[b,w,S,M,t,n,d,f,u,F]);const R=s(e=>{const t=e.target.getBoundingClientRect(),n=e.clientX-t.left,o=e.clientY-t.top,{re:r,im:i}=F(n,o);return{re:r,im:i,iterations:u(r,i,d),event:e}},[F,u,d]),D=s(e=>{I.current=!0,A.current={x:e.clientX,y:e.clientY,rMin:b,rMax:w,iMin:S,iMax:M}},[b,w,S,M]),L=s(e=>{if(x&&x(R(e)),!I.current||!A.current)return;const o=A.current,r=e.clientX-o.x,i=e.clientY-o.y,l=(o.rMax-o.rMin)/t,a=(o.iMax-o.iMin)/n;v(o.rMin-r*l),k(o.rMax-r*l),$(o.iMin+i*a),z(o.iMax+i*a)},[t,n,x,R]),W=s(()=>{I.current=!1},[]),N=s(e=>{e.preventDefault();const t=e.deltaY>0?1.15:1/1.15,n=e.target.getBoundingClientRect(),o=e.clientX-n.left,r=e.clientY-n.top,{re:i,im:l}=F(o,r);v(i+(b-i)*t),k(i+(w-i)*t),$(l+(S-l)*t),z(l+(M-l)*t)},[F,b,w,S,M]),E=s(e=>{g&&g(R(e))},[g,R]),T=s(e=>{m&&m(R(e))},[m,R]),P=s(e=>{e.preventDefault(),y&&y(R(e))},[y,R]);return o("canvas",{ref:C,width:t,height:n,style:{cursor:"crosshair"},onMouseDown:D,onMouseMove:L,onMouseUp:W,onMouseLeave:W,onWheel:N,onClick:E,onDblClick:T,onContextMenu:P})}function vn(e,t,n){if(e===t)return[e];const o=(t-e)/(n-1),r=[];for(let t=0;t<n;t++){const n=e+o*t;r.push(Math.round(1e10*n)/1e10)}return r}function wn(e,t,n,o){return d(()=>function(e,t,n,o){if(0===e.length)return{xScale:()=>o,yScale:()=>n-o,xTicks:[],yTicks:[],xMin:0,xMax:0,yMin:0,yMax:0};let r=1/0,i=-1/0,l=1/0,a=-1/0;for(const t of e)t.x<r&&(r=t.x),t.x>i&&(i=t.x),t.y<l&&(l=t.y),t.y>a&&(a=t.y);r===i&&(r-=1,i+=1),l===a&&(l-=1,a+=1);const s=t-2*o,d=n-2*o;return{xScale:e=>o+(e-r)/(i-r)*s,yScale:e=>n-o-(e-l)/(a-l)*d,xTicks:vn(r,i,6),yTicks:vn(l,a,6),xMin:r,xMax:i,yMin:l,yMax:a}}(e,t,n,o),[e,t,n,o])}function kn(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function Sn(e,t,n,r,i,l,a){const s={fill:i,key:l,...a};switch(e){case"square":return o("rect",{...s,x:t-r,y:n-r,width:2*r,height:2*r});case"diamond":{const e=`${t},${n-r} ${t+r},${n} ${t},${n+r} ${t-r},${n}`;return o("polygon",{...s,points:e})}case"triangle":{const e=`${t},${n-1.15*r} ${t+r},${n+.6*r} ${t-r},${n+.6*r}`;return o("polygon",{...s,points:e})}case"triangle-down":{const e=`${t-r},${n-.6*r} ${t+r},${n-.6*r} ${t},${n+1.15*r}`;return o("polygon",{...s,points:e})}case"cross":{const e=.35*r;return o("path",{...s,fill:"none",stroke:i,"stroke-width":String(2*e),"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":{const e=.35*r;return o("path",{...s,fill:"none",stroke:i,"stroke-width":String(2*e),"stroke-linecap":"round",d:`M${t},${n-r}L${t},${n+r}M${t-r},${n}L${t+r},${n}`})}default:return o("circle",{...s,cx:t,cy:n,r:r})}}function $n(e){const{data:t,width:n=600,height:r=400,lineColor:i="#3b82f6",lineWidth:l=2,pointRadius:a=4,pointColor:s="#3b82f6",pointShape:c="circle",showPoints:f=!0,showGrid:u=!0,showArea:p=!1,areaColor:h="rgba(59,130,246,0.15)",xLabel:g,yLabel:x,title:m,padding:y=50,animate:b=!1,multiLine:v}=e,w=wn(d(()=>{const e=[...t];if(v)for(const t of v)e.push(...t.data);return e},[t,v]),n,r,y),{xScale:k,yScale:S,xTicks:$,yTicks:M}=w,z=[];if(z.push(o("rect",{x:0,y:0,width:"100%",fill:"white",key:"bg"})),u){for(let e=0;e<$.length;e++){const t=k($[e]);z.push(o("line",{x1:t,y1:y,x2:t,y2:r-y,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-x-${e}`}))}for(let e=0;e<M.length;e++){const t=S(M[e]);z.push(o("line",{x1:y,y1:t,x2:n-y,y2:t,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-y-${e}`}))}}z.push(o("line",{x1:y,y1:r-y,x2:n-y,y2:r-y,stroke:"#374151","stroke-width":1,key:"x-axis"})),z.push(o("line",{x1:y,y1:y,x2:y,y2:r-y,stroke:"#374151","stroke-width":1,key:"y-axis"}));for(let e=0;e<$.length;e++){const t=k($[e]);z.push(o("line",{x1:t,y1:r-y,x2:t,y2:r-y+5,stroke:"#374151",key:`xtick-${e}`})),z.push(o("text",{x:t,y:r-y+18,"text-anchor":"end","font-size":11,fill:"#6b7280",transform:`rotate(-45, ${t}, ${r-y+18})`,key:`xlabel-${e}`},kn($[e])))}for(let e=0;e<M.length;e++){const t=S(M[e]);z.push(o("line",{x1:y-5,y1:t,x2:y,y2:t,stroke:"#374151",key:`ytick-${e}`})),z.push(o("text",{x:y-10,y:t+4,"text-anchor":"end","font-size":11,fill:"#6b7280",key:`ylabel-${e}`},kn(M[e])))}function C(e,t,n,r,i,l,a,s,d,c){if(0===e.length)return;const f=[...e].sort((e,t)=>e.x-t.x);if(r){const e=S(w.yMin),t=f.map(e=>`${k(e.x)},${S(e.y)}`).join(" "),n=`${k(f[0].x)},${e} ${t} ${k(f[f.length-1].x)},${e}`;z.push(o("polygon",{points:n,fill:i,key:`${c}-area`}))}const u={points:f.map(e=>`${k(e.x)},${S(e.y)}`).join(" "),fill:"none",stroke:t,"stroke-width":n,"stroke-linejoin":"round","stroke-linecap":"round",key:`${c}-line`};if(b?(u["stroke-dasharray"]="1000",u["stroke-dashoffset"]="1000",z.push(o("polyline",u,o("animate",{attributeName:"stroke-dashoffset",from:1e3,to:0,dur:"1.5s",fill:"freeze"})))):z.push(o("polyline",u)),l)for(let e=0;e<f.length;e++){const t=k(f[e].x),n=S(f[e].y),r=f[e].shape??d,i=f[e].radius??s,l=`${c}-pt-${e}`;if(b){const e=Sn(r,t,n,i,a,l,{opacity:0});z.push(o("g",{key:`${l}-g`},e,o("animate",{attributeName:"opacity",from:0,to:1,dur:"0.3s",begin:"1.2s",fill:"freeze"})))}else z.push(Sn(r,t,n,i,a,l))}}if(C(t,i,l,p,h,f,s,a,c,"primary"),v)for(let e=0;e<v.length;e++){const t=v[e];C(t.data,t.color,l,!1,"transparent",f,t.color,t.pointRadius??a,t.pointShape??c,`series-${e}`)}if(v&&v.length>0){const e=[],t=[{color:i,label:"Primary"},...v.map((e,t)=>({color:e.color,label:e.label??`Series ${t+1}`}))],r=y+10,l=16,a=22,s=7.2,d=14,c=6,f=n-2*y-20;let u=0,p=0;for(let n=0;n<t.length;n++){const i=d+c+t[n].label.length*s;u>0&&u+i>f&&(u=0,p+=a);const h=r+u,g=y-30-p;e.push(o("rect",{x:h,y:g,width:d,height:14,fill:t[n].color,rx:2,key:`legend-rect-${n}`})),e.push(o("text",{x:h+d+c,y:g+12,"font-size":12,fill:"#374151",key:`legend-text-${n}`},t[n].label)),u+=i+l}z.push(o("g",{key:"legend"},...e))}return g&&z.push(o("text",{x:n/2,y:r-8,"text-anchor":"middle","font-size":13,fill:"#374151",key:"x-axis-label"},g)),x&&z.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"},x)),m&&z.push(o("text",{x:n/2,y:20,"text-anchor":"middle","font-size":16,"font-weight":"bold",fill:"#111827",key:"title"},m)),o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...z)}function Mn(e,t,n,o){return{x:e+n*Math.cos(o),y:t+n*Math.sin(o)}}function zn(e,t,n,o,r,i){const l=r-Math.PI/2,a=i-Math.PI/2,s=Mn(e,t,o,l),d=Mn(e,t,o,a),c=i-r>Math.PI?1:0;if(n<=0)return[`M ${e} ${t}`,`L ${s.x} ${s.y}`,`A ${o} ${o} 0 ${c} 1 ${d.x} ${d.y}`,"Z"].join(" ");const f=Mn(e,t,n,a),u=Mn(e,t,n,l);return[`M ${s.x} ${s.y}`,`A ${o} ${o} 0 ${c} 1 ${d.x} ${d.y}`,`L ${f.x} ${f.y}`,`A ${n} ${n} 0 ${c} 0 ${u.x} ${u.y}`,"Z"].join(" ")}function Cn(e,t){const n=t?.padAngle??0,o=function(e,t){const n=t??function(e){const t=[];for(let n=0;n<e;n++){const o=Math.round(360*n/e);t.push(`hsl(${o}, 70%, 55%)`)}return t}(e.length);return e.map((e,t)=>e.color??n[t%n.length])}(e,t?.colors),r=e.reduce((e,t)=>e+t.value,0);if(r<=0)return[];const i=n*e.length,l=2*Math.PI-i,a=[];let s=0;for(let t=0;t<e.length;t++){const i=e[t],d=s+n/2,c=d+i.value/r*l;a.push({label:i.label,value:i.value,startAngle:d,endAngle:c,percentage:i.value/r*100,color:o[t]}),s=c+n/2}return a}function In(e){const{data:t,width:n=400,height:r=400,innerRadius:i=0,padAngle:l=.02,showLabels:a=!0,showValues:s=!0,showLegend:c=!0,legendPosition:f="right",title:u,centerLabel:p,colors:h,strokeColor:g="#fff",strokeWidth:x=2,textColor:m="currentColor"}=e,y=c&&"right"===f?140:0,b=u?30:0,v=c&&"bottom"===f?22*Math.ceil(t.length/2)+10:0,w=n-y,k=r-b-v,S=w/2,$=b+k/2,M=Math.min(w,k)/2-10,z=e.outerRadius??M,C=d(()=>Cn(t,{padAngle:l,colors:h}),[t,l,h]),I=[];u&&I.push(o("text",{key:"title",x:w/2,y:20,textAnchor:"middle",fontFamily:"sans-serif",fontSize:16,fontWeight:"bold",fill:m},u));for(let e=0;e<C.length;e++){const t=C[e],n=zn(S,$,i,z,t.startAngle,t.endAngle);if(I.push(o("path",{key:`slice-${e}`,d:n,fill:t.color,stroke:g,strokeWidth:x})),a||s){const n=(t.startAngle+t.endAngle)/2,r=t.percentage<5,l=Mn(S,$,r?z+14:i+.65*(z-i),n-Math.PI/2),d=r?m:"#fff",c=r?11:12,f=[];if(a&&f.push(t.label),s&&f.push(`${t.percentage.toFixed(1)}%`),r){const t=Mn(S,$,z+2,n-Math.PI/2);I.push(o("line",{key:`connector-${e}`,x1:t.x,y1:t.y,x2:l.x,y2:l.y,stroke:"#999",strokeWidth:1}))}a&&I.push(o("text",{key:`label-${e}`,x:l.x,y:l.y-(s?6:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:c,fill:d,pointerEvents:"none"},t.label)),s&&I.push(o("text",{key:`value-${e}`,x:l.x,y:l.y+(a?10:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:c-1,fill:d,pointerEvents:"none"},`${t.percentage.toFixed(1)}%`))}}if(p&&i>0&&I.push(o("text",{key:"center-label",x:S,y:$,textAnchor:"middle",dominantBaseline:"central",fontFamily:"sans-serif",fontSize:14,fontWeight:"bold",fill:m},p)),c){const e=[];if("right"===f){const t=w+10,n=b+20;for(let r=0;r<C.length;r++){const i=C[r],l=n+22*r;e.push(o("circle",{key:`legend-dot-${r}`,cx:t+6,cy:l,r:6,fill:i.color})),e.push(o("text",{key:`legend-text-${r}`,x:t+18,y:l,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:m},`${i.label} (${i.percentage.toFixed(1)}%)`))}}else{const t=r-v+10;for(let r=0;r<C.length;r++){const i=C[r],l=r%2*(n/2)+10,a=t+22*Math.floor(r/2);e.push(o("circle",{key:`legend-dot-${r}`,cx:l+6,cy:a,r:6,fill:i.color})),e.push(o("text",{key:`legend-text-${r}`,x:l+18,y:a,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:m},`${i.label} (${i.percentage.toFixed(1)}%)`))}}I.push(...e)}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...I)}function An(e,t,n,o,r){return{x:n+e*Math.cos(t)*r,y:o-e*Math.sin(t)*r}}function Fn(e){const{width:t=400,height:n=400,rRange:r=[0,2],plotFunction:i,plotResolution:f=360,thetaStep:u,sync:p=!1,points:h=[],showGrid:g=!0,pointRadius:x=3,pointColor:m="#3b82f6",curveColor:y="#3b82f6",onPointClick:b,onPointDoubleClick:v,onPointContextMenu:w,onPointHover:k}=e,[S,$]=l(r[1]),[M,z]=l(0),[C,I]=l(0),[A,F]=l(null),R=t/2+M,D=n/2+C,L=Math.min(t,n)/2-30,W=L/S,N=d(()=>{const e=Math.max(1,Math.ceil(S)),t=[],n=S/e;for(let o=1;o<=e;o++)t.push(n*o);return t},[S]),E=d(()=>{const e=[];for(let t=0;t<360;t+=30)e.push(t*Math.PI/180);return e},[]),T=d(()=>{if(!i||!p)return[];const e=u??2*Math.PI/f,t=an({start:0,end:2*Math.PI,step:e});return sn(i,t)},[i,f,u,p]),[P,B]=l([]),_=c(null);a(()=>{if(!i||p)return void B([]);const e=u??2*Math.PI/f,t=an({start:0,end:2*Math.PI,step:e});return _.current&&_.current(),_.current=dn(i,t,200,e=>{B([...e])}),()=>{_.current&&_.current()}},[i,f,u,p]);const H=p?T:P,Y=d(()=>{if(0===H.length)return"";const e=[];for(let t=0;t<H.length;t++){const n=H[t],o=n.output;if(o<0||!isFinite(o))continue;const{x:r,y:i}=An(o,n.input,R,D,W);e.push(`${0===e.length?"M":"L"}${r.toFixed(2)},${i.toFixed(2)}`)}return e.join(" ")},[H,R,D,W]),j=s(e=>{F({x:e.clientX,y:e.clientY,px:M,py:C})},[M,C]),q=s(e=>{A&&(z(A.px+(e.clientX-A.x)),I(A.py+(e.clientY-A.y)))},[A]),O=s(()=>{F(null)},[]),U=s(e=>{e.preventDefault();const t=e.deltaY>0?1.15:1/1.15;$(Math.max(.1,S*t))},[S]),X=s((e,t,n)=>{if(e)return o=>e({r:t.r,theta:t.theta,index:n,event:o})},[]),V=[];if(V.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),g){for(let e=0;e<N.length;e++){const t=N[e]*W;V.push(o("circle",{cx:R,cy:D,r:t,fill:"none",stroke:"#e5e7eb","stroke-width":1,key:`gc-${e}`})),V.push(o("text",{x:R+t+2,y:D-4,"font-size":10,fill:"#9ca3af",key:`gl-${e}`},N[e].toFixed(1)))}for(let e=0;e<E.length;e++){const t=E[e],n=N[N.length-1]*W,r=R+n*Math.cos(t),i=D-n*Math.sin(t);V.push(o("line",{x1:R,y1:D,x2:r,y2:i,stroke:"#e5e7eb","stroke-width":1,key:`al-${e}`}));const l=Math.round(180*t/Math.PI),a=R+(n+14)*Math.cos(t),s=D-(n+14)*Math.sin(t);V.push(o("text",{x:a,y:s+4,"text-anchor":"middle","font-size":10,fill:"#9ca3af",key:`at-${e}`},`${l}°`))}}V.push(o("line",{x1:R-L,y1:D,x2:R+L,y2:D,stroke:"#d1d5db","stroke-width":1,key:"x-axis"})),V.push(o("line",{x1:R,y1:D-L,x2:R,y2:D+L,stroke:"#d1d5db","stroke-width":1,key:"y-axis"})),Y&&V.push(o("path",{d:Y,fill:"none",stroke:y,"stroke-width":2,key:"curve"}));for(let e=0;e<h.length;e++){const t=h[e],{x:n,y:r}=An(t.r,t.theta,R,D,W);V.push(o("circle",{cx:n,cy:r,r:x,fill:m,key:`pt-${e}`,style:{cursor:"pointer"},onClick:X(b,t,e),onDblClick:X(v,t,e),onContextMenu:X(w,t,e),onMouseEnter:X(k,t,e)}))}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",style:{cursor:A?"grabbing":"grab"},onMouseDown:j,onMouseMove:q,onMouseUp:O,onMouseLeave:O,onWheel:U},...V)}function Rn(e){const t=1<<e,n=[];for(let o=0;o<t;o++){const t=[];for(let n=0;n<e;n++)t.push(2*(o>>n&1)-1);n.push({coords:t})}return n}function Dn(e){const t=1<<e,n=[];for(let o=0;o<t;o++)for(let t=0;t<e;t++){const e=o^1<<t;e>o&&n.push({source:o,target:e})}return n}function Ln(e,t){let n=Wn(e),o=0;for(let r=0;r<e;r++)for(let i=r+1;i<e;i++)o<t.length&&(n=En(n,Nn(e,r,i,t[o]))),o++;return n}function Wn(e){const t=[];for(let n=0;n<e;n++){const o=new Array(e).fill(0);o[n]=1,t.push(o)}return t}function Nn(e,t,n,o){const r=Wn(e),i=Math.cos(o),l=Math.sin(o);return r[t][t]=i,r[t][n]=-l,r[n][t]=l,r[n][n]=i,r}function En(e,t){const n=e.length,o=[];for(let r=0;r<n;r++){const i=new Array(n).fill(0);for(let o=0;o<n;o++)for(let l=0;l<n;l++)i[o]+=e[r][l]*t[l][o];o.push(i)}return o}function Tn(e,t){const n=e.length,o=new Array(n).fill(0);for(let r=0;r<n;r++)for(let i=0;i<n;i++)o[r]+=e[r][i]*t.coords[i];return o}function Pn(e,t=0){const n=e[0]??0,o=e[1]??0;let r=0;for(let t=2;t<e.length;t++)r+=e[t]??0;if(e.length>2&&(r/=e.length-2),t>0){const e=1/(1+t*(r+2));return{x:n*e,y:o*e,depth:r}}return{x:n,y:o,depth:r}}function Bn(e,t=[],n=.3,o=1){const r=Rn(e),i=Dn(e),l=Ln(e,t);return{vertices:r.map((e,t)=>{const r=Pn(Tn(l,e),n);return{id:t,position:e,x:r.x*o,y:r.y*o,depth:r.depth}}),edges:i,dimension:e}}function _n(e){return e*(e-1)/2}function Hn(e,t=70,n=55){const o=[];for(let r=0;r<e;r++){const i=Math.round(360*r/e);o.push(`hsl(${i}, ${t}%, ${n}%)`)}return o}function Yn(e){const t=e.dimension??4,n=e.width??600,r=e.height??600,i=e.vertexRadius??10,f=e.edgeWidth??3,u=e.edgeColor??"#111",p=e.perspective??.25,h=e.rotationSpeed??.008,g=e.showLabels??!1,x=e.backgroundColor??"transparent",m=e.scale??.3*Math.min(n,r),y=_n(t),b=1<<t,v=d(()=>"auto"===e.vertexColors||void 0===e.vertexColors?Hn(b):e.vertexColors,[b,e.vertexColors]),[w,k]=l(()=>{const e=[];for(let t=0;t<y;t++)e.push(0);return e}),[S,$]=l(!1),M=c({x:0,y:0}),z=c([]),C=c(0);a(()=>{if(0===h)return;let e=!0;const t=()=>{e&&(k(e=>{const t=e.slice();for(let e=0;e<t.length;e++)t[e]=(t[e]??0)+h*(1+.3*e);return t}),C.current=requestAnimationFrame(t))};return C.current=requestAnimationFrame(t),()=>{e=!1,cancelAnimationFrame(C.current)}},[h]);const I=d(()=>Bn(t,w,p,m),[t,w,p,m]),A=n/2,F=r/2,R=d(()=>I.edges.map(e=>{const t=I.vertices[e.source],n=I.vertices[e.target],o=(t.depth+n.depth)/2;return{...e,avgDepth:o,sv:t,tv:n}}).sort((e,t)=>e.avgDepth-t.avgDepth),[I]),D=d(()=>I.vertices.slice().sort((e,t)=>e.depth-t.depth),[I]),L=s(e=>{const t=e;$(!0),M.current={x:t.clientX,y:t.clientY},z.current=w.slice()},[w]),W=s(e=>{if(!S)return;const t=e,n=.01*(t.clientX-M.current.x),o=.01*(t.clientY-M.current.y);k(()=>{const e=z.current.slice();return e.length>0&&(e[0]=(e[0]??0)+n),e.length>1&&(e[1]=(e[1]??0)+o),e})},[S]),N=s(()=>{$(!1)},[]),E=R.map((e,t)=>{const n=(e=>{const t=(e+2)/4;return.3+.7*Math.max(0,Math.min(1,t))})(e.avgDepth);return o("line",{key:`e-${e.source}-${e.target}`,x1:String(A+e.sv.x),y1:String(F+e.sv.y),x2:String(A+e.tv.x),y2:String(F+e.tv.y),stroke:u,"stroke-width":String(f),"stroke-opacity":String(n),"stroke-linecap":"round"})}),T=D.map(e=>{const n=i*(e=>{const t=(e+2)/4;return.6+.4*Math.max(0,Math.min(1,t))})(e.depth),r=v[e.id%v.length]??"#3b82f6",l=[o("circle",{key:`v-${e.id}-circle`,cx:String(A+e.x),cy:String(F+e.y),r:String(n),fill:r,stroke:"#000","stroke-width":"1.5",style:{filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.3))"}})];return g&&l.push(o("text",{key:`v-${e.id}-label`,x:String(A+e.x),y:String(F+e.y+n+14),"text-anchor":"middle","font-size":"11","font-family":"monospace",fill:"#555"},e.id.toString(2).padStart(t,"0"))),l});return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",style:{backgroundColor:x,cursor:S?"grabbing":"grab",userSelect:"none"},onMouseDown:L,onMouseMove:W,onMouseUp:N,onMouseLeave:N},...E,...T.flat())}function jn(e={}){const t=e.dimension??4,n=e.rotationSpeed??.008,o=e.perspective??.25,r=e.scale??200,i=_n(t),[s,c]=l(()=>new Array(i).fill(0));return a(()=>{if(0===n)return;let e=!0,t=0;const o=()=>{e&&(c(e=>e.map((e,t)=>e+n*(1+.3*t))),t=requestAnimationFrame(o))};return t=requestAnimationFrame(o),()=>{e=!1,cancelAnimationFrame(t)}},[n]),{data:d(()=>Bn(t,s,o,r),[t,s,o,r]),angles:s,setAngles:c}}function qn(e){const t=e.titlePosition??"top",n=e.legendPosition??"bottom",r=e.titleAlign??"center",i=e.legendAlign??"center",l=e.gap??"12px",a=e.contain??"layout style paint",s={display:"flex",flexDirection:"column",gap:l,width:"number"==typeof e.width?`${e.width}px`:e.width??"auto",height:"number"==typeof e.height?`${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,c=e.legend&&e.legend.length>0?(f=e.legend,o("div",{className:"viz-legend",style:{display:"flex",flexDirection:(u={align:i,fontSize:e.legendFontSize??"12px",gap:e.legendGap??16,direction:"left"===n||"right"===n?"column":"row"}).direction,flexWrap:"wrap",gap:`${u.gap}px`,justifyContent:u.align,alignItems:"center",fontSize:u.fontSize,color:"#6b7280",flexShrink:"0"}},...f.map((e,t)=>o("div",{key:`legend-${t}`,style:{display:"flex",alignItems:"center",gap:"6px"}},function(e){const t=e.shape??"circle";return"line"===t?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??""})):o("div","square"===t?{style:{width:"12px",height:"12px",backgroundColor:e.color,borderRadius:"2px",flexShrink:"0"}}:{style:{width:"10px",height:"10px",backgroundColor:e.color,borderRadius:"50%",flexShrink:"0"}})}(e),o("span",null,e.label))))):null;var f,u;const p=function(e,t,n,r,i){const l=[];if("top"===r&&e&&l.push(e),"left"===i||"right"===i){const a=[];"left"===i&&n&&a.push(n),"left"===r&&e&&a.push(e),a.push(t),"right"===r&&e&&a.push(e),"right"===i&&n&&a.push(n),l.push(o("div",{style:{display:"flex",flexDirection:"row",flex:"1",gap:"12px",minHeight:"0",alignItems:"stretch"}},...a))}else if("left"===r||"right"===r){"top"===i&&n&&l.push(n);const a=[];"left"===r&&e&&a.push(e),a.push(t),"right"===r&&e&&a.push(e),l.push(o("div",{style:{display:"flex",flexDirection:"row",flex:"1",gap:"12px",minHeight:"0",alignItems:"center"}},...a)),"bottom"===i&&n&&l.push(n)}else"top"===i&&n&&l.push(n),l.push(t),"bottom"===i&&n&&l.push(n);return"bottom"===r&&e&&l.push(e),l}(d,o("div",{className:"viz-content",style:{flex:"1",minWidth:"0",minHeight:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}},e.children),c,t,n);return o("div",{className:`viz-wrapper ${e.className??""}`.trim(),style:s},...p)}function On(e){const{measurementId:t,disabled:n=!1,debug:o=!1,anonymizeIp:r=!1,config:i}=e;return a(()=>{if(n||"undefined"==typeof window)return;!function(e){if("undefined"==typeof document)return;const t="specifyjs-gtag";if(document.getElementById(t))return;const 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)}(t),"undefined"!=typeof window&&(window.dataLayer=window.dataLayer||[],window.gtag||(window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date)));const e={...i};return r&&(e.anonymize_ip=!0),o&&(e.debug_mode=!0),window.gtag&&window.gtag("config",t,e),()=>{const e=document.getElementById("specifyjs-gtag");e&&e.remove()}},[t,n,o,r]),null}function Un(e){const{left:t,center:n,right:r,borderTop:i="1px solid var(--color-border, #e2e8f0)",background:l="var(--color-bg, transparent)",color:a="var(--color-text-muted, #64748b)",fontSize:s="13px",padding:d="24px",maxWidth:c="1200px",className:f,ariaLabel:u="Site footer"}=e;return o("footer",{className:f,role:"contentinfo","aria-label":u,style:{borderTop:i,background:l,color:a,fontSize:s,padding:d,marginTop:"48px"}},o("div",{style:{maxWidth:c,margin:"0 auto",display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:"12px"}},o("div",{style:{flex:"1",textAlign:"left",minWidth:"150px"}},t??null),o("div",{style:{flex:"1",textAlign:"center",minWidth:"150px"}},n??null),o("div",{style:{flex:"1",textAlign:"right",minWidth:"150px"}},r??null)))}const Xn=r({windows:[],openWindow:()=>{},closeWindow:()=>{},focusWindow:()=>{},minimizeWindow:()=>{},maximizeWindow:()=>{},restoreWindow:()=>{},moveWindow:()=>{},resizeWindow:()=>{},tileWindows:()=>{},cascadeWindows:()=>{},minimizeAll:()=>{},focusedWindowId:null}),Vn={width:600,height:400},Gn={x:30,y:30},Kn={top:0,left:0,width:1920,height:1080},Zn=1e3;function Jn(e,t,n,o){let r=n.left+e*t.x,i=n.top+e*t.y;const l=n.left+n.width-o.width,a=n.top+n.height-o.height;return l>n.left&&r>l&&(r=n.left+(r-n.left)%Math.max(1,l-n.left)),a>n.top&&i>a&&(i=n.top+(i-n.top)%Math.max(1,a-n.top)),{x:r,y:i}}function Qn(e){const t=[...e].sort((e,t)=>e.zIndex-t.zIndex),n=[];for(let e=0;e<t.length;e++)n.push({...t[e],zIndex:e+1});return n}function eo(e,t){let n=null;for(let o=0;o<e.length;o++){const r=e[o];r.id!==t&&"minimized"!==r.windowState&&(null===n||r.zIndex>n.zIndex)&&(n=r)}return n}function to(e){let t=0;for(let n=0;n<e.length;n++)e[n].zIndex>t&&(t=e[n].zIndex);return t}function no(e){const t=e.workspaceBounds??Kn,n=e.defaultWindowSize??Vn,r=e.cascadeOffset??Gn,[i,a]=l([]),c=s((...o)=>{const i=o[0];a(o=>{if(o.find(e=>e.id===i.id)){const e=to(o)+1;let t=o.map(t=>t.id===i.id?{...t,focused:!0,zIndex:e,windowState:"minimized"===t.windowState?"normal":t.windowState}:{...t,focused:!1});return e>Zn&&(t=Qn(t)),t}const l=i.size??n,a=i.position??Jn(o.length,r,t,l),s=to(o)+1,d={id:i.id,title:i.title,icon:i.icon,position:a,size:l,windowState:"normal",zIndex:s,focused:!0,appProps:i.appProps};let c=o.map(e=>({...e,focused:!1}));return c.push(d),s>Zn&&(c=Qn(c)),e.onWindowOpen&&e.onWindowOpen(i.id),e.onFocusChange&&e.onFocusChange(i.id),c})},[n,r,t,e.onWindowOpen,e.onFocusChange]),f=s((...t)=>{const n=t[0];a(t=>{const o=t.find(e=>e.id===n);if(!o)return t;const r=t.filter(e=>e.id!==n);if(o.focused&&r.length>0){const t=eo(r,n);if(t){const o=r.map(e=>({...e,focused:e.id===t.id}));return e.onWindowClose&&e.onWindowClose(n),e.onFocusChange&&e.onFocusChange(t.id),o}}return e.onWindowClose&&e.onWindowClose(n),0===r.length&&e.onFocusChange&&e.onFocusChange(null),r})},[e.onWindowClose,e.onFocusChange]),u=s((...t)=>{const n=t[0];a(t=>{if(!t.find(e=>e.id===n))return t;const o=to(t)+1;let r=t.map(e=>e.id===n?{...e,focused:!0,zIndex:o}:{...e,focused:!1});return o>Zn&&(r=Qn(r)),e.onFocusChange&&e.onFocusChange(n),r})},[e.onFocusChange]),p=s((...t)=>{const n=t[0];a(t=>{const o=t.find(e=>e.id===n);if(!o)return t;let r=t.map(e=>e.id===n?{...e,windowState:"minimized",focused:!1}:e);if(o.focused){const t=eo(r,n);t?(r=r.map(e=>({...e,focused:e.id===t.id})),e.onFocusChange&&e.onFocusChange(t.id)):e.onFocusChange&&e.onFocusChange(null)}return r})},[e.onFocusChange]),h=s((...e)=>{const t=e[0];a(e=>e.map(e=>e.id===t?{...e,windowState:"maximized"}:e))},[]),g=s((...e)=>{const t=e[0];a(e=>e.map(e=>e.id===t?{...e,windowState:"normal"}:e))},[]),x=s((...e)=>{const t=e[0],n=e[1];a(e=>e.map(e=>e.id===t?{...e,position:n}:e))},[]),m=s((...e)=>{const t=e[0],n=e[1];a(e=>e.map(e=>e.id===t?{...e,size:n}:e))},[]),y=s((...e)=>{a(e=>{const n=e.filter(e=>"minimized"!==e.windowState);if(0===n.length)return e;const o=n.length,r=new Map;if(1===o)r.set(n[0].id,{position:{x:t.left,y:t.top},size:{width:t.width,height:t.height}});else if(2===o){const e=Math.floor(t.width/2);r.set(n[0].id,{position:{x:t.left,y:t.top},size:{width:e,height:t.height}}),r.set(n[1].id,{position:{x:t.left+e,y:t.top},size:{width:t.width-e,height:t.height}})}else if(3===o){const e=Math.floor(t.width/2),o=Math.floor(t.height/2);r.set(n[0].id,{position:{x:t.left,y:t.top},size:{width:e,height:t.height}}),r.set(n[1].id,{position:{x:t.left+e,y:t.top},size:{width:t.width-e,height:o}}),r.set(n[2].id,{position:{x:t.left+e,y:t.top+o},size:{width:t.width-e,height:t.height-o}})}else{const e=Math.ceil(Math.sqrt(o)),i=Math.ceil(o/e),l=Math.floor(t.width/e),a=Math.floor(t.height/i);for(let o=0;o<n.length;o++){const i=Math.floor(o/e),s=o%e;r.set(n[o].id,{position:{x:t.left+s*l,y:t.top+i*a},size:{width:l,height:a}})}}return e.map(e=>{const t=r.get(e.id);return t?{...e,position:t.position,size:t.size,windowState:"normal"}:e})})},[t]),b=s((...e)=>{a(e=>{const n=e.filter(e=>"minimized"!==e.windowState);if(0===n.length)return e;const o=[...n].sort((e,t)=>e.zIndex-t.zIndex),i=new Map;for(let e=0;e<o.length;e++){const n=Jn(e,r,t,o[e].size);i.set(o[e].id,{position:n,zIndex:e+1})}return e.map(e=>{const t=i.get(e.id);return t?{...e,position:t.position,zIndex:t.zIndex,windowState:"normal"}:e})})},[r,t]),v=s((...t)=>{a(t=>{const n=t.map(e=>({...e,windowState:"minimized",focused:!1}));return e.onFocusChange&&e.onFocusChange(null),n})},[e.onFocusChange]),w=d(()=>{const e=i.find(e=>e.focused);return e?e.id:null},[i]),k=d(()=>({windows:i,openWindow:c,closeWindow:f,focusWindow:u,minimizeWindow:p,maximizeWindow:h,restoreWindow:g,moveWindow:x,resizeWindow:m,tileWindows:y,cascadeWindows:b,minimizeAll:v,focusedWindowId:w}),[i,c,f,u,p,h,g,x,m,y,b,v,w]);return o(Xn.Provider,{value:k},e.children)}function oo(){return e=Xn,i().useContext(e);var e}const ro=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],io=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function lo(e){return e<10?"0"+String(e):String(e)}function ao(e){const{label:t,onClick:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:l}=dt();return o("button",{type:"button",role:"button","aria-label":t,tabIndex:0,onClick:s(()=>{n()},[n]),onKeyDown:s(e=>{const t=e;"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),n())},[n]),onMouseEnter:i,onMouseLeave:l,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 so(e){const{format:t,showSeconds:n,showDate:r}=e,[i,s]=l(new Date);a(()=>{const e=setInterval(()=>{s(new Date)},1e3);return()=>{clearInterval(e)}},[]);const c=d(()=>function(e,t,n){let o=e.getHours();const r=lo(e.getMinutes()),i=lo(e.getSeconds());if("12h"===t){const e=o>=12?"PM":"AM";return o%=12,0===o&&(o=12),`${n?`${String(o)}:${r}:${i}`:`${String(o)}:${r}`} ${e}`}const l=lo(o);return n?`${l}:${r}:${i}`:`${l}:${r}`}(i,t,n),[i,t,n]),f=d(()=>function(e){const t=ro[e.getDay()],n=io[e.getMonth()],o=e.getDate();return`${t}, ${n} ${String(o)}`}(i),[i]),u=r?o("span",{style:{fontSize:"11px",opacity:"0.85"}},f):null;return o("div",{role:"timer","aria-live":"polite","aria-label":"System clock",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",lineHeight:"1.2",padding:"0 8px"}},u,o("span",{style:{fontSize:"13px",fontWeight:"500"}},c))}function co(e){const{indicator:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=dt(),l=s(()=>{t.onClick&&t.onClick()},[t]),a=s(e=>{const n=e;"Enter"!==n.key&&" "!==n.key||(n.preventDefault(),t.onClick&&t.onClick())},[t]);return o("button",{type:"button",role:"button","aria-label":t.label||t.icon,tabIndex:0,onClick:l,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 fo(e){const{item:t,onClose:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:l}=dt();return t.divider?o("div",{role:"separator",style:{height:"1px",backgroundColor:"var(--panel-divider, #555555)",margin:"4px 0"}}):o("button",{type:"button",role:"menuitem",tabIndex:-1,onClick:s(()=>{t.onClick(),n()},[t,n]),onKeyDown:s(e=>{const o=e;"Enter"!==o.key&&" "!==o.key||(o.preventDefault(),t.onClick(),n())},[t,n]),onMouseEnter:i,onMouseLeave:l,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 uo(e){const{user:t,menuItems:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:d}=dt(),[f,u]=l(!1),p=c(null),h=s(()=>{u(e=>!e)},[]),g=s(()=>{u(!1)},[]),x=s(e=>{const t=e;"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),u(e=>!e)),"Escape"===t.key&&u(!1)},[]);a(()=>{if(!f)return;const e=e=>{const t=p.current;t&&!t.contains(e.target)&&u(!1)};return document.addEventListener("click",e,!0),()=>{document.removeEventListener("click",e,!0)}},[f]);const m=t.avatar?o("img",{src:t.avatar,alt:t.name,style:{width:"100%",height:"100%",objectFit:"cover"}}):t.name.charAt(0).toUpperCase(),y=o("span",{style:{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"},"aria-hidden":"true"},m),b=f&&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((e,t)=>o(fo,{key:String(t),item:e,onClose:g}))):null;return o("div",{ref:p,style:{position:"relative",display:"inline-flex",height:"100%"}},o("button",{type:"button","aria-haspopup":"true","aria-expanded":String(f),tabIndex:0,onClick:h,onKeyDown:x,onMouseEnter:i,onMouseLeave:d,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"0 8px",height:"100%",border:"none",outline:"none",backgroundColor:r||f?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",cursor:"pointer",transition:"background-color 0.15s"}},y,o("span",null,t.name),o("span",{"aria-hidden":"true",style:{fontSize:"10px"}},"▾")),b)}function po(e){const{activeAppName:t,activitiesButton:n,clockFormat:r="24h",showSeconds:i=!0,showDate:l=!0,indicators:a,user:s,userMenuItems:d,height:c=28,children:f}=e,u=String(c)+"px",p=[];n&&p.push(o(ao,{key:"activities",label:n.label,onClick:n.onClick})),t&&p.push(o("span",{key:"appname",style:{padding:"0 12px",fontSize:"13px",fontWeight:"700",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"200px"}},t));const h=o("div",{style:{display:"flex",alignItems:"center",height:"100%",flex:"1",minWidth:"0"}},...p),g=[];g.push(o(so,{key:"clock",format:r,showSeconds:i,showDate:l})),f&&g.push(f);const x=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}},...g),m=[];if(a&&a.length>0){const e=a.map(e=>o(co,{key:e.id,indicator:e}));m.push(o("div",{key:"indicators",style:{display:"flex",alignItems:"center",gap:"8px",height:"100%"}},...e))}s&&m.push(o(uo,{key:"user",user:s,menuItems:d}));const y=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",height:"100%",flex:"1",gap:"4px"}},...m);return o("div",{role:"menubar","aria-label":"System panel","data-theme":"dark",style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",height:u,backgroundColor:"var(--panel-bg, #2c2c2c)",color:"var(--panel-text, #ffffff)",fontFamily:"inherit",fontSize:"13px",boxSizing:"border-box",position:"relative"}},h,x,y)}function ho(e){return e.badge&&e.badge>0?`${e.label}, ${e.badge} unread`:e.label}function go(e){switch(e){case"left":default: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"}}}function xo(e,t){return"vertical"===t?"right"===e?{position:"absolute",right:"0",top:"50%",transform:"translateY(-50%)"}:{position:"absolute",left:"0",top:"50%",transform:"translateY(-50%)"}:"bottom"===e?{position:"absolute",top:"0",left:"50%",transform:"translateX(-50%)"}:{position:"absolute",bottom:"0",left:"50%",transform:"translateX(-50%)"}}function mo(e){const{item:t,iconSize:n,position:r,orientation:i,onItemClick:a,onItemContextMenu:d}=e,[c,f]=l(!1),u=t.disabled??!1,p=s(()=>{u||f(!0)},[u]),h=s(()=>{f(!1)},[]),g=s(()=>{!u&&a&&a(t.id)},[u,a,t.id]),x=s(e=>{if(!u&&d){const n=e;n.preventDefault(),d(t.id,{x:n.clientX,y:n.clientY})}},[u,d,t.id]),m=`${n}px`,y=(b=t.icon).startsWith("http")||b.startsWith("/")||b.startsWith(".")?o("img",{src:t.icon,alt:t.label,style:{width:m,height:m,objectFit:"contain",display:"block"}}):o("span",{style:{width:m,height:m,display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.round(.6*n)}px`,userSelect:"none"},"aria-hidden":"true"},t.icon);var b;const v=null!=t.badge&&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"},(w=t.badge)>99?"99+":String(w)):null;var w;const k=t.active?o("span",{style:{...xo(r,i),width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"var(--dock-active-color, #ffffff)",pointerEvents:"none",zIndex:"2"},"aria-hidden":"true"}):null,S=c?o("div",{role:"tooltip",style:{position:"absolute",...go(r),padding:"4px 10px",backgroundColor:"#1f2937",color:"#ffffff",fontSize:"12px",borderRadius:"4px",whiteSpace:"nowrap",zIndex:"1000",pointerEvents:"none"}},t.label):null;return o("button",{type:"button",role:"button",style:{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",...c&&!u?{transform:"scale(1.1)",backgroundColor:"rgba(255,255,255,0.15)"}:{}},"aria-label":ho(t),"aria-pressed":t.active?"true":"false","aria-disabled":u?"true":void 0,tabIndex:u?-1:0,onClick:g,onContextMenu:x,onMouseEnter:p,onMouseLeave:h,"data-dock-item-id":t.id},y,v,k,S)}function yo(e){const{items:t,orientation:n="vertical",position:r="left",iconSize:i=36,autoHide:a=!1,showTrailingSeparator:d=!1,onItemClick:f,onItemContextMenu:u,children:p}=e,[h,g]=l(!a),x=c(null),m=s(()=>{a&&(null!=x.current&&(clearTimeout(x.current),x.current=null),g(!0))},[a]),y=s(()=>{a&&(x.current=setTimeout(()=>{g(!1)},300))},[a]),b=s(e=>{const t=e,o=t.target,r=o.closest('[role="toolbar"]');if(!r)return;const i=Array.from(r.querySelectorAll("button[data-dock-item-id]")),l=i.indexOf(o);if(l<0)return;const a="vertical"===n,s=a?"ArrowDown":"ArrowRight",d=a?"ArrowUp":"ArrowLeft";if(t.key===s){t.preventDefault();const e=i[l+1];e&&e.focus()}else if(t.key===d){t.preventDefault();const e=i[l-1];e&&e.focus()}else"Home"===t.key?(t.preventDefault(),i[0]?.focus()):"End"===t.key?(t.preventDefault(),i[i.length-1]?.focus()):"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),o.click())},[n]),v="vertical"===n,w={display:"flex",flexDirection:v?"column":"row",alignItems:"center",gap:"2px",padding:"4px",backgroundColor:"var(--dock-bg, rgba(0, 0, 0, 0.7))",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"};a&&!h&&("left"===r?(w.transform="translateX(-100%)",w.opacity="0"):"right"===r?(w.transform="translateX(100%)",w.opacity="0"):"top"===r?(w.transform="translateY(-100%)",w.opacity="0"):"bottom"===r&&(w.transform="translateY(100%)",w.opacity="0"));const k=[];for(let e=0;e<t.length;e++){if(d&&e===t.length-1&&t.length>1){const t=v?{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"};k.push(o("div",{key:`sep-${e}`,style:t,"aria-hidden":"true",role:"separator"}))}k.push(o(mo,{key:t[e].id,item:t[e],iconSize:i,position:r,orientation:n,onItemClick:f,onItemContextMenu:u}))}const S=a&&!h?o("div",{style:{position:"absolute",..."left"===r?{left:"0",top:"0",width:"4px",height:"100%"}:{},..."right"===r?{right:"0",top:"0",width:"4px",height:"100%"}:{},..."top"===r?{top:"0",left:"0",height:"4px",width:"100%"}:{},..."bottom"===r?{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:w,onMouseEnter:m,onMouseLeave:y,onKeyDown:b},S,...k,null!=p?p:null)}const bo="#2c001e";function vo(e){const{backgroundColor:t=bo,backgroundGradient:n,backgroundImage:r,backgroundImageOpacity:i=1,contextMenuItems:l,onClick:a,onDoubleClick:c,children:f}=e,u=s(e=>{const t=e;t.target===t.currentTarget&&a&&a()},[a]),p=s(e=>{const t=e;t.target===t.currentTarget&&c&&c()},[c]),h=d(()=>{const e={position:"relative",width:"100%",height:"100%",overflow:"hidden",cursor:"default",margin:"0",padding:"0"};return e.backgroundColor=t,n&&(e.background=n),r&&i>=1&&(e.backgroundImage=`url(${r})`,e.backgroundSize="cover",e.backgroundPosition="center"),e},[t,n,r,i]),g=d(()=>!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]),x=[];g&&x.push(o("div",{className:"desktop-background__image-overlay",style:g,"aria-hidden":"true"})),x.push(o("div",{className:"desktop-background__content",style:{position:"relative",width:"100%",height:"100%",zIndex:"1"}},f));const m=o("div",{className:"desktop-background",style:h,onClick:u,onDblClick:p,role:"application","aria-label":"Desktop workspace","data-theme":"dark"},...x);return l&&l.length>0?o(Bt,{items:l},m):m}function wo(e){const{toasts:t,onDismiss:n}=e;if(0===t.length)return null;const r=t.map(e=>{let t="rgba(50, 50, 50, 0.95)",r="#555";return"warning"===e.severity?(t="rgba(60, 40, 10, 0.95)",r="#f39c12"):"error"===e.severity&&(t="rgba(60, 10, 10, 0.95)",r="#e74c3c"),o("div",{key:String(e.id),className:`unity-desktop__toast unity-desktop__toast--${e.severity}`,style:{backgroundColor:t,border:`1px solid ${r}`,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(e.id),role:"alert","aria-live":"polite"},e.message)});return o("div",{className:"unity-desktop__toast-container",style:{position:"absolute",top:"8px",right:"8px",zIndex:"9999",display:"flex",flexDirection:"column",gap:"8px",pointerEvents:"none",maxWidth:"320px"},"aria-label":"Notifications"},...r)}function ko(e){const{apps:t,user:n,onAppOpen:r,onLogout:i,theme:c="dark",children:f}=e,u=oo(),[p,h]=l([]),g=s(e=>{h(t=>t.filter(t=>t.id!==e))},[]);a(()=>{if(0===p.length)return;const e=p[0],t=Date.now()-e.timestamp,n=Math.max(0,5e3-t),o=setTimeout(()=>{h(t=>t.filter(t=>t.id!==e.id))},n);return()=>clearTimeout(o)},[p]);const x=s(e=>{const n=u.windows.find(t=>t.id===e);if(n)"minimized"===n.windowState&&u.restoreWindow(e),u.focusWindow(e);else{const n=t.find(t=>t.id===e);n&&u.openWindow({id:n.id,title:n.label,icon:n.icon})}r&&r(e)},[u,t,r]),m=d(()=>t.map(e=>{const t=u.windows.some(t=>t.id===e.id);return{id:e.id,icon:e.icon,label:e.label,active:t}}),[t,u.windows]),y=d(()=>{if(!u.focusedWindowId)return;const e=u.windows.find(e=>e.id===u.focusedWindowId);return e?e.title:void 0},[u.focusedWindowId,u.windows]),b=d(()=>{const e=[];return n&&(e.push({label:n.name,icon:void 0,onClick:()=>{},divider:!1}),e.push({label:"",icon:void 0,onClick:()=>{},divider:!0})),i&&e.push({label:"Log Out",icon:void 0,onClick:i,divider:!1}),e},[n,i]),v=d(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'Ubuntu, "Segoe UI", sans-serif',fontSize:"13px",color:"dark"===c?"#ffffff":"#1a1a1a",overflow:"hidden",position:"relative"}),[c]),w={display:"flex",flexDirection:"column",height:"100%",backgroundColor:"dark"===c?"var(--dock-bg, rgba(0, 0, 0, 0.7))":"var(--dock-bg, rgba(200, 200, 200, 0.9))",borderRight:"dark"===c?"1px solid rgba(255, 255, 255, 0.1)":"1px solid rgba(0, 0, 0, 0.1)",flexShrink:"0"},k=o(po,{activeAppName:y,activitiesButton:{label:"Activities",onClick:()=>{}},clockFormat:"24h",showSeconds:!0,showDate:!0,user:n?{name:n.name,avatar:n.avatar}:void 0,userMenuItems:b.length>0?b:void 0,height:28}),S=o(yo,{items:m,orientation:"vertical",position:"left",iconSize:36,onItemClick:x}),$=o(wo,{toasts:p,onDismiss:g}),M=[];f&&M.push(f),M.push($);const z=o(vo,{backgroundColor:"dark"===c?"#2c001e":"#e8e0e4",backgroundGradient:"dark"===c?"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:{flex:"1",position:"relative",overflow:"hidden"}},...M));return o("div",{className:"unity-desktop",style:v,"data-theme":c},o("div",{className:"unity-desktop__top-panel",style:{flexShrink:"0",zIndex:"10"}},k),o("div",{style:{display:"flex",flex:"1",overflow:"hidden"}},o("div",{className:"unity-desktop__dock",style:w},S),o("main",{className:"unity-desktop__desktop",style:{flex:"1",position:"relative",overflow:"hidden"}},z)))}function So(e){const{apps:t,user:n,onAppOpen:r,onLogout:i,theme:l="dark",children:a}=e;return o(no,{onWindowOpen:r},o(ko,{apps:t,user:n,onAppOpen:r,onLogout:i,theme:l,children:a}))}const $o={width:200,height:150},Mo={x:50,y:50},zo={width:400,height:300},Co={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 Io(e){const{id:t,title:n,icon:r,defaultPosition:i=Mo,defaultSize:f=zo,minSize:u=$o,maxSize:p,resizable:h=!0,draggable:g=!0,windowState:x="normal",focused:m=!0,zIndex:y,onClose:b,onMinimize:v,onMaximize:w,onFocus:k,onMove:S,onResize:$,children:M}=e,[z,C]=l(i.x),[I,A]=l(i.y),[F,R]=l(f.width),[D,L]=l(f.height),[W,N]=l(!1),[E,T]=l(!1),[P,B]=l(null),_=c(null),H=c(null),Y=c(null),j=s((e,t)=>{let n=Math.max(e,u.width),o=Math.max(t,u.height);return p&&(n=Math.min(n,p.width),o=Math.min(o,p.height)),{width:n,height:o}},[u,p]),q=s(()=>{const e=Y.current;return e&&e.parentElement?{width:e.parentElement.clientWidth,height:e.parentElement.clientHeight}:{width:window.innerWidth,height:window.innerHeight}},[]);s((e,t,n,o)=>{const r=q();return{x:Math.max(0,Math.min(e,r.width-n)),y:Math.max(0,Math.min(t,r.height-o))}},[q]);const O=s(e=>{if(!g||"maximized"===x)return;const t=e;t.target.closest("button")||(t.preventDefault(),_.current={startMouseX:t.clientX,startMouseY:t.clientY,startPosX:z,startPosY:I},N(!0))},[g,x,z,I]),U=s(e=>{e.target.closest("button")||w&&w()},[w]);a(()=>{if(!W)return;const e=e=>{const t=e,n=_.current;if(!n)return;const o=t.clientX-n.startMouseX,r=t.clientY-n.startMouseY;let i=n.startPosX+o,l=n.startPosY+r;const a=q();i=Math.max(0,Math.min(i,a.width-F)),l=Math.max(0,Math.min(l,a.height-D)),C(i),A(l),t.clientX<=20?B("left"):t.clientX>=a.width-20?B("right"):t.clientY<=20?B("top"):B(null)},t=e=>{const t=e;N(!1);const n=q();if("left"===P)return C(0),A(0),R(Math.floor(n.width/2)),L(n.height),B(null),S&&S({x:0,y:0}),void($&&$({width:Math.floor(n.width/2),height:n.height}));if("right"===P){const e=Math.floor(n.width/2);return C(e),A(0),R(e),L(n.height),B(null),S&&S({x:e,y:0}),void($&&$({width:e,height:n.height}))}if("top"===P)return B(null),void(w&&w());B(null);const o=_.current;if(o&&S){const e=t.clientX-o.startMouseX,r=t.clientY-o.startMouseY;let i=o.startPosX+e,l=o.startPosY+r;i=Math.max(0,Math.min(i,n.width-F)),l=Math.max(0,Math.min(l,n.height-D)),S({x:i,y:l})}_.current=null};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[W,P,F,D,q,S,$,w]);const X=s(e=>t=>{if(!h||"normal"!==x)return;const n=t;n.preventDefault(),n.stopPropagation(),H.current={direction:e,startMouseX:n.clientX,startMouseY:n.clientY,startPosX:z,startPosY:I,startWidth:F,startHeight:D},T(!0)},[h,x,z,I,F,D]);a(()=>{if(!E)return;const e=e=>{const t=e,n=H.current;if(!n)return;const o=t.clientX-n.startMouseX,r=t.clientY-n.startMouseY,i=n.direction;let l=n.startWidth,a=n.startHeight,s=n.startPosX,d=n.startPosY;i.includes("e")&&(l=n.startWidth+o),i.includes("w")&&(l=n.startWidth-o,s=n.startPosX+o),i.includes("s")&&(a=n.startHeight+r),i.includes("n")&&(a=n.startHeight-r,d=n.startPosY+r);const c=j(l,a);i.includes("w")&&(s=n.startPosX+(n.startWidth-c.width)),i.includes("n")&&(d=n.startPosY+(n.startHeight-c.height)),R(c.width),L(c.height),C(s),A(d)},t=()=>{T(!1),$&&$({width:F,height:D}),H.current=null};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[E,F,D,j,$]),a(()=>{if(!m||!b)return;const e=e=>{"Escape"===e.key&&b()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[m,b]);const V=s(e=>{k&&k()},[k]);if("minimized"===x)return null;const G="maximized"===x,K=d(()=>{const e={position:"absolute",display:"flex",flexDirection:"column",border:"1px solid var(--window-border, #555555)",borderRadius:G?"0":"6px",overflow:"hidden",backgroundColor:"var(--window-body-bg, #1e1e1e)",boxShadow:m?"0 8px 32px rgba(0, 0, 0, 0.4)":"0 4px 16px rgba(0, 0, 0, 0.2)",transition:G?"all 200ms ease":"box-shadow 200ms ease",outline:"none"};return G?(e.top="0",e.left="0",e.width="100%",e.height="100%"):(e.top=`${I}px`,e.left=`${z}px`,e.width=`${F}px`,e.height=`${D}px`),void 0!==y&&(e.zIndex=String(y)),W&&(e.cursor="grabbing",e.userSelect="none"),e},[G,z,I,F,D,y,m,W]),Z=d(()=>{const e={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:g&&!G?"grab":"default",opacity:m?"1":"0.6"};return W&&(e.cursor="grabbing"),e},[m,g,G,W]),J={width:"14px",height:"14px",borderRadius:"50%",border:"none",cursor:"pointer",padding:"0",marginLeft:"6px",fontSize:"0",lineHeight:"0",display:"inline-flex",alignItems:"center",justifyContent:"center"},Q=[];r&&(r.startsWith("http")||r.startsWith("/")||r.startsWith("data:")?Q.push(o("img",{src:r,alt:"",style:{width:"16px",height:"16px",marginRight:"6px",flexShrink:"0"},className:"draggable-window__icon"})):Q.push(o("span",{style:{marginRight:"6px",fontSize:"14px",flexShrink:"0"},className:"draggable-window__icon"},r))),Q.push(o("span",{className:"draggable-window__title-text",style:{flex:"1",fontSize:"13px",fontWeight:"500",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},n));const ee=o("div",{style:{display:"flex",alignItems:"center",flexShrink:"0"},className:"draggable-window__controls"},o("button",{type:"button","aria-label":"Minimize",className:"draggable-window__btn-minimize",style:{...J,backgroundColor:"var(--window-button-minimize, #f39c12)"},onClick:e=>{e.stopPropagation(),v&&v()}}),o("button",{type:"button","aria-label":G?"Restore":"Maximize",className:"draggable-window__btn-maximize",style:{...J,backgroundColor:"var(--window-button-maximize, #2ecc71)"},onClick:e=>{e.stopPropagation(),w&&w()}}),o("button",{type:"button","aria-label":"Close",className:"draggable-window__btn-close",style:{...J,backgroundColor:"var(--window-button-close, #e74c3c)"},onClick:e=>{e.stopPropagation(),b&&b()}}));Q.push(ee);const te=[];if(h&&!G){const e=["n","s","e","w","ne","nw","se","sw"];for(let t=0;t<e.length;t++){const n=e[t],r={position:"absolute",zIndex:"1"};"n"===n?(r.top="0",r.left="8px",r.right="8px",r.height="8px"):"s"===n?(r.bottom="0",r.left="8px",r.right="8px",r.height="8px"):"e"===n?(r.top="8px",r.right="0",r.bottom="8px",r.width="8px"):"w"===n?(r.top="8px",r.left="0",r.bottom="8px",r.width="8px"):"ne"===n?(r.top="0",r.right="0",r.width="8px",r.height="8px"):"nw"===n?(r.top="0",r.left="0",r.width="8px",r.height="8px"):"se"===n?(r.bottom="0",r.right="0",r.width="8px",r.height="8px"):"sw"===n&&(r.bottom="0",r.left="0",r.width="8px",r.height="8px"),r.cursor=Co[n],te.push(o("div",{className:`draggable-window__resize-handle draggable-window__resize-${n}`,style:r,onMouseDown:X(n)}))}}let ne=null;if(P){const e={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"};"left"===P?(e.top="0",e.left="0",e.width="50%",e.height="100%"):"right"===P?(e.top="0",e.right="0",e.width="50%",e.height="100%"):"top"===P&&(e.top="0",e.left="0",e.width="100%",e.height="100%"),ne=o("div",{className:"draggable-window__snap-preview",style:e})}const oe=[];for(let e=0;e<te.length;e++)oe.push(te[e]);oe.push(o("div",{className:"draggable-window__title-bar",style:Z,onMouseDown:O,onDblClick:U,role:"toolbar","aria-label":`${n} window controls`},...Q)),oe.push(o("div",{className:"draggable-window__body",style:{flex:"1",overflow:"auto",backgroundColor:"var(--window-body-bg, #1e1e1e)"}},M));const re=[o("div",{ref:Y,id:`draggable-window-${t}`,className:`draggable-window ${m?"draggable-window--focused":"draggable-window--unfocused"} draggable-window--${x}`,style:K,role:"dialog","aria-label":n,tabIndex:-1,onMouseDown:V},...oe)];return ne&&re.push(ne),1===re.length?re[0]:o("div",{style:{display:"contents"}},...re)}function Ao(e){const{id:t,title:n,icon:r,defaultPosition:i,defaultSize:l,minSize:a,resizable:c=!0,onClose:f,children:u}=e,p=oo(),h=d(()=>p.windows.find(e=>e.id===t),[p.windows,t]);if(!h)return p.openWindow({id:t,title:n,icon:r,position:i,size:l}),null;const g=s(()=>{p.closeWindow(t),f&&f()},[p,t,f]),x=s(()=>{p.focusWindow(t)},[p,t]),m=s(e=>{p.moveWindow(t,e)},[p,t]),y=s(e=>{p.resizeWindow(t,e)},[p,t]),b=s(()=>{p.minimizeWindow(t)},[p,t]),v=s(()=>{h&&"maximized"===h.windowState?p.restoreWindow(t):p.maximizeWindow(t)},[p,t,h]);return o(Io,{id:t,title:n,icon:r,defaultPosition:h.position,defaultSize:h.size,minSize:a,resizable:c,windowState:h.windowState,focused:h.focused,zIndex:h.zIndex,onClose:g,onFocus:x,onMove:m,onResize:y,onMinimize:b,onMaximize:v,children:u})}const Fo=["File","Edit","View","Insert","Format","Tools","Help"],Ro={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"}]},Do=[{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"}}],Lo=[{label:"Align left",text:"≡",command:"justifyLeft"},{label:"Align center",text:"≣",command:"justifyCenter"},{label:"Align right",text:"≢",command:"justifyRight"}],Wo=["1","2","3","4","5","6","7"],No={1:"8",2:"10",3:"12",4:"14",5:"18",6:"24",7:"36"};function Eo(e){return e.trim().split(/\s+/).filter(e=>e.length>0).length}function To(e){const[t,n]=l(!1),[r,i]=l(!1),[a,f]=l(!1),[u,p]=l(-1),[h,g]=l(""),[x,m]=l(-1),[y,b]=l(0),[v,w]=l("3"),k=c(null),S={bold:s(()=>{document.execCommand("bold",!1),n(e=>!e),k.current&&k.current.focus()},[]),italic:s(()=>{document.execCommand("italic",!1),i(e=>!e),k.current&&k.current.focus()},[]),underline:s(()=>{document.execCommand("underline",!1),f(e=>!e),k.current&&k.current.focus()},[])},$={bold:t,italic:r,underline:a},M=s(e=>{document.execCommand(e,!1),k.current&&k.current.focus()},[]),z=s(e=>{document.execCommand("fontSize",!1,e),w(e),k.current&&k.current.focus()},[]),C=s(e=>{m(t=>t===e?-1:e)},[]),I=s(e=>{switch(e){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":"undefined"!=typeof window&&window.print&&window.print();break;case"new":k.current&&(k.current.innerHTML="",b(0))}m(-1),k.current&&k.current.focus()},[]),A=s(()=>{if(k.current){const e=k.current.textContent??"";b(Eo(e))}},[]),F=s(()=>{m(-1)},[]),R=d(()=>({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"}),[]),D=d(()=>function(){const e=[];for(let t=0;t<=20;t++){const 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}(),[]),L=e.content??"Start typing...",W=Eo(L),N=y>0?y:W,E={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"},T={display:"block",width:"100%",padding:"6px 16px",fontSize:"13px",color:"#333",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"};function P(e,t){return{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid transparent",borderRadius:"3px",cursor:"pointer",fontSize:"13px",backgroundColor:$[e]?"rgba(0,0,0,0.12)":h===e?"rgba(0,0,0,0.06)":"transparent",color:"var(--color-text, #444)",transition:"background 0.15s",...t??{}}}const B=Fo.map((e,t)=>{const n=[e];return x===t&&Ro[e]&&n.push(o("div",{key:"dropdown",style:E,className:"word-processor__menu-dropdown"},...Ro[e].map((e,t)=>o("button",{key:String(t),style:T,onClick:t=>{t.stopPropagation(),I(e.action)},role:"menuitem"},e.label)))),o("button",{key:String(t),style:(r=t,{padding:"4px 10px",cursor:"pointer",borderRadius:"3px",fontSize:"13px",color:"var(--color-text, #333)",backgroundColor:x===r?"rgba(0,0,0,0.12)":u===r?"rgba(0,0,0,0.08)":"transparent",border:"none",lineHeight:"1",transition:"background 0.15s",position:"relative"}),role:"menuitem","aria-label":e,onClick:()=>C(t),onMouseEnter:()=>{p(t)},onMouseLeave:()=>p(-1)},...n);var r});return o("div",{className:`word-processor ${e.className??""}`.trim(),style:R},o("div",{className:"word-processor__menu-bar",style:{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"},role:"menubar"},...B),o("div",{className:"word-processor__toolbar",style:{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"},role:"toolbar","aria-label":"Formatting toolbar"},o("div",{style:{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"},"aria-label":"Font family"},o("span",null,"Arial"),o("span",{style:{fontSize:"10px",color:"#999"}},"▼")),o("div",{key:"0",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},...Do.map(e=>o("button",{key:e.id,style:P(e.id,e.style),title:e.shortcut?`${e.label} (${e.shortcut})`:e.label,"aria-label":e.label,"aria-pressed":String($[e.id]??!1),onClick:S[e.id],onMouseEnter:()=>g(e.id),onMouseLeave:()=>g("")},e.text))),o("div",{key:"1",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px",alignItems:"center"}},o("select",{style:{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"},"aria-label":"Font size",value:v,onChange:e=>{const t=e.target;z(t.value)}},...Wo.map(e=>o("option",{key:e,value:e},No[e])))),o("div",{key:"2",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},...Lo.map((e,t)=>o("button",{key:String(t),style:P(`align-${t}`),title:e.label,"aria-label":e.label,onClick:()=>M(e.command),onMouseEnter:()=>g(`align-${t}`),onMouseLeave:()=>g("")},e.text)))),o("div",{className:"word-processor__ruler",style:{height:"20px",backgroundColor:"#e8e8e8",borderBottom:"1px solid #ccc",position:"relative",flexShrink:"0",margin:"0 60px"},"aria-hidden":"true"},...D),o("main",{className:"word-processor__document-area",style:{flex:"1",display:"flex",justifyContent:"center",alignItems:"flex-start",padding:"30px 40px",overflow:"auto",backgroundColor:"#e0e0e0",cursor:"text"},onClick:F},o("div",{className:"word-processor__page",style:{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"},contentEditable:"true",ref:k,onInput:A,suppressContentEditableWarning:!0},L)),o("div",{className:"word-processor__status-bar",style:{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"}},o("span",null,"Page 1 of 1"),o("span",null,`${N} words`),o("span",null,"100%")))}const Po=["File","Edit","Selection","View","Go","Run","Terminal","Help"],Bo={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"}]},_o=[{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}],Ho={"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"]',"}"]},Yo=Ho["App.ts"],jo=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"]),qo=new Set(["string","number","boolean","void","null","undefined","any","never","unknown","object","interface","type","enum"]),Oo="#569cd6",Uo="#d4d4d4";function Xo(e){const[t,n]=l("App.ts"),[r,i]=l({src:!0,components:!0,hooks:!0}),[a,f]=l(-1),[u,p]=l(Yo.length),h=c(null),g=s(e=>{n(e);const t=Ho[e];t&&p(t.length)},[]),x=s(e=>{i(t=>{const n={},o=Object.keys(t);for(let e=0;e<o.length;e++)n[o[e]]=t[o[e]];return n[e]=!t[e],n})},[]),m=s(e=>{f(t=>t===e?-1:e)},[]),y=s(e=>{switch(e){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":h.current&&(h.current.textContent="",p(1))}f(-1),h.current&&h.current.focus()},[]),b=s(()=>{if(h.current){const e=(h.current.textContent??"").split("\n");p(Math.max(e.length,1))}},[]),v=d(()=>({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"}),[]),w={padding:"3px 8px",fontSize:"12px",color:"#cccccc",cursor:"pointer",borderRadius:"3px",backgroundColor:"transparent",border:"none",position:"relative"},k={...w,backgroundColor:"rgba(255,255,255,0.1)"},S={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"},$={display:"block",width:"100%",padding:"6px 16px",fontSize:"12px",color:"#cccccc",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"},M={cursor:"pointer",padding:"0 6px",borderRadius:"3px",transition:"background-color 0.15s"},z=Ho[t]??Yo,C=z.map((e,t)=>{const n=function(e){if(!e.trim())return[{text:" ",color:Uo}];const t=[];let n=0;for(;n<e.length;){if("/"===e[n]&&"/"===e[n+1]){t.push({text:e.slice(n),color:"#6a9955"});break}if('"'===e[n]||"'"===e[n]||"`"===e[n]){const o=e[n];let r=n+1;for(;r<e.length&&e[r]!==o;)"\\"===e[r]&&r++,r++;r=Math.min(r+1,e.length),t.push({text:e.slice(n,r),color:"#ce9178"}),n=r;continue}if(/[0-9]/.test(e[n])&&(0===n||/[\s(,=:[\]{}+\-*/]/.test(e[n-1]))){let o=n;for(;o<e.length&&/[0-9.]/.test(e[o]);)o++;t.push({text:e.slice(n,o),color:"#b5cea8"}),n=o;continue}if(/[a-zA-Z_$]/.test(e[n])){let o=n;for(;o<e.length&&/[a-zA-Z0-9_$]/.test(e[o]);)o++;const r=e.slice(n,o);let i=o;for(;i<e.length&&" "===e[i];)i++;const l=i<e.length&&"("===e[i];let a=Uo;jo.has(r)?a=Oo:qo.has(r)?a="#4ec9b0":l?a="#dcdcaa":"true"!==r&&"false"!==r||(a=Oo),t.push({text:r,color:a}),n=o;continue}if(" "===e[n]||"\t"===e[n]){let o=n;for(;o<e.length&&(" "===e[o]||"\t"===e[o]);)o++;t.push({text:e.slice(n,o),color:Uo}),n=o;continue}t.push({text:e[n],color:"#d4d4d4"}),n++}return t}(e),r=[];let i=0;for(const e of n)r.push(o("span",{key:String(i++),style:{color:e.color}},e.text));return o("div",{key:String(t),style:{minHeight:"20px"}},...r)}),I=Math.max(u,z.length),A=[];for(let e=0;e<I;e++)A.push(o("div",{key:String(e)},String(e+1)));const F=e=>{if(!e.parent)return!0;if(!r[e.parent])return!1;const t=_o.find(t=>t.name===e.parent&&t.isFolder);return!t||F(t)},R=Po.map((e,t)=>{const n=[e],r=a===t;return r&&Bo[e]&&n.push(o("div",{key:"dropdown",style:S,className:"ide__menu-dropdown"},...Bo[e].map((e,t)=>o("button",{key:String(t),style:$,onClick:t=>{t.stopPropagation(),y(e.action)},role:"menuitem"},e.label)))),o("button",{key:String(t),style:r?k:w,role:"menuitem","aria-label":e,onClick:()=>m(t)},...n)}),D=_o.map((e,n)=>{if(!F(e))return null;const i=!e.isFolder&&e.name===t,l=e.isFolder?r[e.name]?"📂 ":"📁 ":"📄 ";return o("div",{key:String(n),style:(a=e.indent,s=e.isFolder,d=i,{padding:"3px 8px",paddingLeft:12+16*a+"px",fontSize:"13px",cursor:"pointer",color:s?"#cccccc":"#d4d4d4",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",borderRadius:"3px",margin:"0 4px",transition:"background-color 0.1s",backgroundColor:d?"rgba(255,255,255,0.08)":"transparent"}),onClick:e.isFolder?()=>x(e.name):()=>g(e.name)},l,e.name);var a,s,d}).filter(e=>null!==e);return o("div",{className:`ide ${e.className??""}`.trim(),style:v},o("div",{className:"ide__title-bar",style:{height:"30px",backgroundColor:"#323233",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",color:"#999",flexShrink:"0",borderBottom:"1px solid var(--color-border, #252526)"}},"SpecifyJS IDE"),o("div",{className:"ide__menu-bar",style:{height:"28px",backgroundColor:"#3c3c3c",display:"flex",alignItems:"center",padding:"0 8px",gap:"2px",flexShrink:"0",position:"relative"},role:"menubar"},...R),o("div",{style:{flex:"1",display:"flex",overflow:"hidden"}},o("nav",{className:"ide__sidebar",style:{width:"220px",backgroundColor:"#252526",borderRight:"none",display:"flex",flexDirection:"column",flexShrink:"0",overflowY:"auto"},"aria-label":"File explorer"},o("div",{style:{padding:"8px 12px",fontSize:"11px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#bbbbbb"}},"Explorer"),...D),o("div",{style:{width:"1px",backgroundColor:"#007acc",cursor:"col-resize",flexShrink:"0",opacity:"0.4",transition:"opacity 0.2s"}}),o("div",{style:{flex:"1",display:"flex",flexDirection:"column",overflow:"hidden"}},o("div",{style:{height:"35px",backgroundColor:"#252526",display:"flex",alignItems:"center",flexShrink:"0"}},o("button",{style:{padding:"0 16px",height:"35px",lineHeight:"35px",backgroundColor:"#1e1e1e",color:"#ffffff",fontSize:"13px",cursor:"pointer",border:"none",borderBottom:"2px solid #007acc",boxSizing:"border-box"},"aria-label":t},t)),o("div",{style:{flex:"1",display:"flex",overflow:"auto",backgroundColor:"#1e1e1e",fontFamily:'"Cascadia Code", "Fira Code", "Consolas", monospace',fontSize:"13px",lineHeight:"20px"}},o("div",{style:{padding:"8px 0",textAlign:"right",color:"#858585",userSelect:"none",minWidth:"48px",paddingRight:"12px",paddingLeft:"12px",flexShrink:"0"},"aria-hidden":"true"},...A),o("code",{style:{padding:"8px 0",flex:"1",whiteSpace:"pre",overflowX:"auto",outline:"none",color:"#d4d4d4"},contentEditable:"true",ref:h,onInput:b,suppressContentEditableWarning:!0},...C))),o("div",{className:"ide__minimap",style:{width:"60px",backgroundColor:"#1e1e1e",borderLeft:"1px solid var(--color-border, #252526)",flexShrink:"0",padding:"8px 4px",display:"flex",flexDirection:"column",gap:"2px",position:"relative"},"aria-hidden":"true"},o("div",{style:{position:"absolute",top:"8px",left:"0",right:"0",height:"30px",backgroundColor:"rgba(100, 100, 200, 0.15)",border:"1px solid rgba(100, 100, 200, 0.3)",borderRadius:"2px",pointerEvents:"none"}}),...z.map((e,t)=>o("div",{key:String(t),style:{height:"2px",backgroundColor:e.trim()?"#555555":"transparent",borderRadius:"1px",width:`${Math.min(100,2*e.length)}%`}})))),o("div",{className:"ide__status-bar",style:{height:"22px",backgroundColor:"#007acc",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 12px",fontSize:"12px",color:"#ffffff",flexShrink:"0"}},o("div",{style:{display:"flex",gap:"16px"}},o("span",{style:M},"⎇ main"),o("span",{style:M},"0 errors"),o("span",{style:M},"0 warnings")),o("div",{style:{display:"flex",gap:"16px"}},o("span",{style:M},"Ln 1, Col 1"),o("span",{style:M},"UTF-8"),o("span",{style:M},"TypeScript"))))}const Vo=[{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]}],Go=[{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}],Ko=[{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}],Zo=[{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}],Jo=[{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}],Qo=[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],er=[{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}],tr=[{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}],nr=["09:30","10:00","10:30","11:00","11:30","12:00"];function or(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function rr(e){return e.toFixed(2)}const ir={backgroundColor:"#1a1a2e",borderRadius:"4px",padding:"12px",border:"1px solid #2a2a4a",overflow:"auto",display:"flex",flexDirection:"column"},lr={fontSize:"12px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#8888aa",marginBottom:"8px",flexShrink:"0"},ar={width:"100%",borderCollapse:"collapse",fontSize:"12px"},sr={textAlign:"left",padding:"4px 6px",borderBottom:"1px solid #2a2a4a",color:"#8888aa",fontWeight:"600",fontSize:"11px"},dr={padding:"3px 6px",borderBottom:"1px solid #16162a",color:"#ccccdd",fontSize:"12px"},cr={cursor:"default",transition:"background-color 0.1s"};function fr(e){const[t,n]=l(0),[r,i]=l("--:--:--"),[s,c]=l(!0);a(()=>{const e=setInterval(()=>{n(e=>{const t=.5*(Math.random()-.5);return Math.round(100*t)/100})},2e3);return()=>clearInterval(e)},[]),a(()=>{const e=()=>{const e=new Date,t=String(e.getHours()).padStart(2,"0"),n=String(e.getMinutes()).padStart(2,"0"),o=String(e.getSeconds()).padStart(2,"0");i(`${t}:${n}:${o}`)};e();const t=setInterval(e,1e3);return()=>clearInterval(t)},[]),a(()=>{const e=setInterval(()=>{c(e=>!e)},800);return()=>clearInterval(e)},[]);const f=d(()=>({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"}),[]),u=189.42+t,p={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:f},o("header",{className:"trading-dashboard__header",style:{height:"40px",backgroundColor:"#12122a",borderBottom:"1px solid #2a2a4a",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",flexShrink:"0"}},o("span",{style:{fontSize:"14px",fontWeight:"700",color:"#ffffff",letterSpacing:"0.5px",display:"flex",alignItems:"center",gap:"8px"}},"SpecifyJS Trading Platform",o("span",{style:{display:"flex",alignItems:"center",fontSize:"11px",color:"#00c853",fontWeight:"600",marginLeft:"8px"}},o("span",{style:p}),"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:{flex:"1",display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gridTemplateRows:"1fr 1fr",gap:"8px",padding:"8px",overflow:"hidden"}},function(e,t){const n=120,r=Math.min(...e),i=Math.max(...e),l=i-r||1,a=310/(e.length-1),s=e.map((e,t)=>({x:40+t*a,y:15+(1-(e-r)/l)*n}));s.map(e=>`${e.x.toFixed(1)},${e.y.toFixed(1)}`).join(" ");const d="M40,135 "+s.map(e=>`L${e.x.toFixed(1)},${e.y.toFixed(1)}`).join(" ")+` L${s[s.length-1].x.toFixed(1)},135 Z`,c=[];for(let t=1;t<e.length;t++){const n=e[t]>=e[t-1]?"#00c853":"#ff1744";c.push(o("line",{key:String(t),x1:String(s[t-1].x.toFixed(1)),y1:String(s[t-1].y.toFixed(1)),x2:String(s[t].x.toFixed(1)),y2:String(s[t].y.toFixed(1)),stroke:n,strokeWidth:"2",strokeLinecap:"round"}))}const f=[];for(let e=0;e<5;e++){const t=15+e/4*n,r=i-e/4*l;f.push(o("line",{key:`g${e}`,x1:String(40),y1:String(t.toFixed(1)),x2:String(350),y2:String(t.toFixed(1)),stroke:"#2a2a4a",strokeWidth:"0.5",strokeDasharray:"3,3"})),f.push(o("text",{key:`yl${e}`,x:String(36),y:String((t+3).toFixed(1)),fill:"#6666aa",fontSize:"8",textAnchor:"end",fontFamily:"monospace"},rr(r)))}const u=[],p=Math.min(nr.length,e.length),h=(e.length-1)/(p-1);for(let e=0;e<p;e++){const t=40+Math.round(e*h)*a;u.push(o("text",{key:`tl${e}`,x:String(t.toFixed(1)),y:String(156),fill:"#6666aa",fontSize:"8",textAnchor:"middle",fontFamily:"monospace"},nr[e]))}const g="chartGrad";return o("div",{style:ir},o("div",{style:lr},"AAPL ",o("span",{style:{color:"#00c853",fontSize:"14px",fontWeight:"700"}},`$${rr(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:g,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:d,fill:`url(#${g})`}),...f,...u,...c,o("line",{x1:String(40),y1:String((15+(1-(t-r)/l)*n).toFixed(1)),x2:String(350),y2:String((15+(1-(t-r)/l)*n).toFixed(1)),stroke:"#00c853",strokeWidth:"0.5",strokeDasharray:"4,2",opacity:"0.6"})))}(Qo,u),function(){const e=Math.max(...Go.map(e=>e.qty),...Ko.map(e=>e.qty));return o("div",{style:ir},o("div",{style:lr},"Order Book"),o("table",{style:ar},o("thead",null,o("tr",null,o("th",{style:sr},"Bid Price"),o("th",{style:sr},"Qty"),o("th",{style:sr},"Ask Price"),o("th",{style:sr},"Qty"))),o("tbody",null,...Go.map((t,n)=>{const r=Ko[n],i=t.qty/e*.25,l=(r?.qty??0)/e*.25;return o("tr",{key:String(n),style:cr},o("td",{style:{...dr,color:"#00c853",backgroundColor:`rgba(0,200,83,${i.toFixed(3)})`,fontFamily:"monospace"}},rr(t.price)),o("td",{style:{...dr,backgroundColor:`rgba(0,200,83,${(.5*i).toFixed(3)})`,fontFamily:"monospace"}},or(t.qty)),o("td",{style:{...dr,color:"#ff1744",backgroundColor:`rgba(255,23,68,${l.toFixed(3)})`,fontFamily:"monospace"}},r?rr(r.price):""),o("td",{style:{...dr,backgroundColor:`rgba(255,23,68,${(.5*l).toFixed(3)})`,fontFamily:"monospace"}},r?or(r.qty):""))}))))}(),function(e){return o("div",{style:ir},o("div",{style:lr},"Watchlist"),o("table",{style:ar},o("thead",null,o("tr",null,o("th",{style:sr},"Symbol"),o("th",{style:sr},"Price"),o("th",{style:sr},"Chg%"),o("th",{style:sr},"Volume"))),o("tbody",null,...Vo.map((t,n)=>{const r=t.price+(0===n?e:0),i=t.change>=0;return o("tr",{key:String(n),style:cr},o("td",{style:{...dr,fontWeight:"600",color:"#ffffff"}},t.symbol,function(e,t){const n=Math.min(...e),r=Math.max(...e)-n||1;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:e.map((t,o)=>{const i=o/(e.length-1)*40,l=14-(t-n)/r*14;return`${i.toFixed(1)},${l.toFixed(1)}`}).join(" "),fill:"none",stroke:t?"#00c853":"#ff1744",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))}(t.spark,i)),o("td",{style:{...dr,fontFamily:"monospace"}},rr(r)),o("td",{style:{...dr,color:i?"#00c853":"#ff1744",fontWeight:"600"}},`${i?"+":""}${rr(t.change)}%`),o("td",{style:{...dr,fontFamily:"monospace",color:"#8888aa"}},(l=t.volume)>=1e6?`${(l/1e6).toFixed(1)}M`:l>=1e3?`${(l/1e3).toFixed(1)}K`:String(l)));var l}))))}(t),function(){const e=Zo.reduce((e,t)=>e+t.pnl,0),t=e>=0;return o("div",{style:ir},o("div",{style:lr},"Positions",o("span",{style:{marginLeft:"12px",color:t?"#00c853":"#ff1744",fontWeight:"700",fontSize:"12px"}},`${t?"+":""}$${rr(e)}`)),o("table",{style:ar},o("thead",null,o("tr",null,o("th",{style:sr},"Symbol"),o("th",{style:sr},"Qty"),o("th",{style:sr},"Avg"),o("th",{style:sr},"P&L"))),o("tbody",null,...Zo.map((e,t)=>{const n=e.pnl>=0;return o("tr",{key:String(t),style:{...cr,backgroundColor:n?"rgba(0,200,83,0.04)":"rgba(255,23,68,0.04)"}},o("td",{style:{...dr,fontWeight:"600",color:"#ffffff"}},e.symbol),o("td",{style:{...dr,fontFamily:"monospace"}},String(e.qty)),o("td",{style:{...dr,fontFamily:"monospace"}},rr(e.avgPrice)),o("td",{style:{...dr,color:n?"#00c853":"#ff1744",fontWeight:"700",fontFamily:"monospace"}},`${n?"+":""}$${rr(e.pnl)}`))}))))}(),o("div",{style:ir},o("div",{style:lr},"Recent Trades"),o("table",{style:ar},o("thead",null,o("tr",null,o("th",{style:sr},"Time"),o("th",{style:sr},"Sym"),o("th",{style:sr},"Side"),o("th",{style:sr},"Qty"),o("th",{style:sr},"Price"))),o("tbody",null,...Jo.map((e,t)=>{const n="BUY"===e.side;return o("tr",{key:String(t),style:cr},o("td",{style:{...dr,color:"#8888aa",fontFamily:"monospace"}},e.time),o("td",{style:{...dr,fontWeight:"600",color:"#ffffff"}},e.symbol),o("td",{style:{...dr,color:n?"#00c853":"#ff1744",fontWeight:"600"}},e.side),o("td",{style:{...dr,fontFamily:"monospace"}},or(e.qty)),o("td",{style:{...dr,fontFamily:"monospace"}},rr(e.price)))})))),function(){const e=Math.max(...er.map(e=>e.volume),...tr.map(e=>e.volume)),t="16px";return o("div",{style:ir},o("div",{style:lr},"Market Depth"),o("div",{style:{flex:"1",display:"flex",flexDirection:"column",gap:"2px",justifyContent:"center"}},...er.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"}},rr(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"}},or(n.volume)))),o("div",{style:{height:"1px",backgroundColor:"#2a2a4a",margin:"4px 0"}}),...tr.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"}},rr(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"}},or(n.volume))))))}()))}const ur={sm:{padding:"3px 10px",fontSize:"12px",borderRadius:"4px"},md:{padding:"6px 14px",fontSize:"13px",borderRadius:"6px"},lg:{padding:"8px 20px",fontSize:"15px",borderRadius:"6px"}},pr={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 hr(e){const{children:t,onClick:n,variant:r="secondary",size:i="md",disabled:l=!1,fullWidth:a=!1,type:s="button",className:c,style:f,ariaLabel:u,active:p=!1}=e,h=d(()=>{const e=ur[i]??ur.md,t=pr[r]??pr.secondary,n={padding:e.padding,fontSize:e.fontSize,borderRadius:e.borderRadius,border:`1px solid ${t.border}`,backgroundColor:p?"#3b82f6":t.bg,color:p?"white":t.color,cursor:l?"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:l?"0.5":"1"};return a&&(n.width="100%"),f&&Object.assign(n,f),n},[r,i,l,a,p,f]);return o("button",{type:s,onClick:l?void 0:n,disabled:l,className:c,style:h,"aria-label":u,"aria-pressed":p?"true":void 0},t)}const gr=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],xr=Math.PI/180;function mr(e,t){const n=e.replace("#","");let o,r,i;return 3===n.length?(o=parseInt(n[0]+n[0],16),r=parseInt(n[1]+n[1],16),i=parseInt(n[2]+n[2],16)):(o=parseInt(n.substring(0,2),16),r=parseInt(n.substring(2,4),16),i=parseInt(n.substring(4,6),16)),o=isNaN(o)?0:o,r=isNaN(r)?0:r,i=isNaN(i)?0:i,`rgba(${o},${r},${i},${t})`}function yr(e,t){const n=e.replace("#","");let o,r,i;3===n.length?(o=parseInt(n[0]+n[0],16),r=parseInt(n[1]+n[1],16),i=parseInt(n[2]+n[2],16)):(o=parseInt(n.substring(0,2),16),r=parseInt(n.substring(2,4),16),i=parseInt(n.substring(4,6),16)),o=isNaN(o)?0:o,r=isNaN(r)?0:r,i=isNaN(i)?0:i;const l=e=>(e=>Math.max(0,Math.min(255,Math.round(e*t))))(e).toString(16).padStart(2,"0");return"#"+l(o)+l(r)+l(i)}function br(e){const{layers:t,width:n=700,height:r=500,perspective:i=.5,rotateX:l=35,rotateY:a=45,rotateZ:c=0,showLabels:f=!0,showAxes:u=!0,layerSpacing:p=2,colorScale:h=gr,gridColor:g="#94a3b8",title:x}=e,m=d(()=>{let e=0,n=0,o=0;for(let r=0;r<t.length;r++){const i=t[r],l=i.data.length;l>e&&(e=l);for(let e=0;e<l;e++){const t=i.data[e].length;t>n&&(n=t);for(let n=0;n<t;n++){const t=Math.abs(i.data[e][n]??0);t>o&&(o=t)}}}return{maxRows:Math.max(e,1),maxCols:Math.max(n,1),maxHeight:o>0?o:1}},[t]),y=d(()=>{const e=m.maxHeight+(t.length-1)*p+m.maxHeight,o=Math.sqrt(m.maxCols*m.maxCols+m.maxRows*m.maxRows+e*e),i=.75*Math.min(n,r);return o>0?i/o:1},[m,t.length,p,n,r]),b=n/2,v=r/2,w=s((e,t,n)=>function(e,t,n,o,r,i,l,a,s,d){const c=Math.cos(o*xr),f=Math.sin(o*xr),u=Math.cos(r*xr),p=Math.sin(r*xr),h=Math.cos(i*xr),g=Math.sin(i*xr),x=e*h-t*g,m=e*g+t*h,y=x*p+m*u,b=y*f+n*c,v=1+.001*l*b;return{sx:a+(x*u-m*p)*d*v,sy:s-(y*c-n*f)*d*v,depth:b}}(e,t,n,l,a,c,i,b,v,y),[l,a,c,i,b,v,y]),k=s(()=>{if(!u)return[];const e=[];Math.max(m.maxCols,m.maxRows);const n=m.maxCols/2,r=m.maxRows/2,i=w(-n,-r,0),l=w(n,-r,0);e.push(o("line",{key:"axis-x",x1:String(i.sx),y1:String(i.sy),x2:String(l.sx),y2:String(l.sy),stroke:"#374151","stroke-width":"1.5"})),e.push(o("text",{key:"axis-x-label",x:String(l.sx+8),y:String(l.sy+4),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"X"));const a=w(-n,r,0);e.push(o("line",{key:"axis-y",x1:String(i.sx),y1:String(i.sy),x2:String(a.sx),y2:String(a.sy),stroke:"#374151","stroke-width":"1.5"})),e.push(o("text",{key:"axis-y-label",x:String(a.sx-12),y:String(a.sy+4),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Y"));const s=m.maxHeight+(t.length-1)*p,d=w(-n,-r,s);return e.push(o("line",{key:"axis-z",x1:String(i.sx),y1:String(i.sy),x2:String(d.sx),y2:String(d.sy),stroke:"#374151","stroke-width":"1.5"})),e.push(o("text",{key:"axis-z-label",x:String(d.sx-4),y:String(d.sy-8),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Z")),e},[u,m,t.length,p,w]),S=s(()=>{const e=[],n=m.maxCols/2,r=m.maxRows/2,i=[];for(let e=0;e<t.length;e++){const o=t[e],l=o.color??h[e%h.length],a=o.opacity??.7,s=e*p,d=o.data.length;for(let t=0;t<d-1;t++){const d=o.data[t],c=o.data[t+1],f=Math.min(d.length,c.length);for(let o=0;o<f-1;o++){const f=o-n,u=o+1-n,p=t-r,h=t+1-r,g=(d[o]??0)+s,x=(d[o+1]??0)+s,m=(c[o]??0)+s,y=(c[o+1]??0)+s,b=w(f,p,g),v=w(u,p,x),k=w(f,h,m),S=w(u,h,y),$=(b.depth+v.depth+k.depth+S.depth)/4,M=`${b.sx},${b.sy} ${v.sx},${v.sy} ${S.sx},${S.sy} ${k.sx},${k.sy}`;i.push({points:M,fill:mr(l,a),stroke:yr(l,.7),strokeWidth:"0.5",depth:$,key:`quad-${e}-${t}-${o}`})}}if(1===d||d>0&&1===o.data[0].length)for(let t=0;t<d;t++){const d=o.data[t];for(let o=0;o<d.length;o++){const c=o-n,f=t-r,u=(d[o]??0)+s,p=w(c,f,u),h=3,g=`${p.sx},${p.sy-h} ${p.sx+h},${p.sy} ${p.sx},${p.sy+h} ${p.sx-h},${p.sy}`;i.push({points:g,fill:mr(l,a),stroke:yr(l,.7),strokeWidth:"0.5",depth:p.depth,key:`point-${e}-${t}-${o}`})}}}i.sort((e,t)=>e.depth-t.depth);for(let t=0;t<i.length;t++){const n=i[t];e.push(o("polygon",{key:n.key,points:n.points,fill:n.fill,stroke:n.stroke,"stroke-width":n.strokeWidth,"stroke-linejoin":"round"}))}return e},[t,m,p,h,w]),$=s(()=>{const e=[],t=m.maxCols/2,n=m.maxRows/2;for(let r=0;r<=m.maxRows;r++){const i=r-n,l=w(-t,i,0),a=w(t,i,0);e.push(o("line",{key:`base-h-${r}`,x1:String(l.sx),y1:String(l.sy),x2:String(a.sx),y2:String(a.sy),stroke:g,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}for(let r=0;r<=m.maxCols;r++){const i=r-t,l=w(i,-n,0),a=w(i,n,0);e.push(o("line",{key:`base-v-${r}`,x1:String(l.sx),y1:String(l.sy),x2:String(a.sx),y2:String(a.sy),stroke:g,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}return e},[m,g,w]),M=s(()=>{if(!f)return[];const e=[],n=m.maxCols/2;m.maxRows;for(let r=0;r<t.length;r++){const i=t[r],l=r*p;let a=0,s=0;for(let e=0;e<i.data.length;e++){const t=i.data[e];for(let e=0;e<t.length;e++)a+=t[e]??0,s++}const d=w(n+1,0,(s>0?a/s:0)+l),c=i.color??h[r%h.length];e.push(o("text",{key:`layer-label-${r}`,x:String(d.sx+8),y:String(d.sy+4),"font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:c},i.label))}return e},[f,t,m,p,h,w]),z=s(()=>x?[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"},x)]:[],[x,n])(),C=$(),I=k(),A=S(),F=M(),R=0===t.length?[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":x??"3D layer visualization",style:{fontFamily:"sans-serif",maxWidth:"100%"}},...z,...R,...C,...I,...A,...F)}function vr(e){const{value:t,label:n,prefix:r="",suffix:i="",trend:l,trendLabel:a,sparkline:c,width:f=280,height:u=160,valueColor:p="currentColor",trendUpColor:h="#22c55e",trendDownColor:g="#ef4444",backgroundColor:x="#ffffff"}=e,m=d(()=>function(e){if("string"==typeof e)return e;if(!isFinite(e)||isNaN(e))return"--";const t=e.toString().split("."),n=t[0],o=t.length>1?"."+t[1]:"",r=n.startsWith("-"),i=r?n.slice(1):n;let l="";for(let e=0;e<i.length;e++)e>0&&(i.length-e)%3==0&&(l+=","),l+=i[e];return(r?"-":"")+l+o}(t),[t]),y=null!=l&&isFinite(l)&&!isNaN(l),b=null!=c&&c.length>1,v=null!=n&&n.length>0,w=y&&l>=0?h:g,k=v?.38*u:.45*u,S=Math.min(.15*f,48),$=.55*S,M=k+.4*S+8,z=v?M+22:k+.4*S+22,C=b?Math.min(.22*u,36):0,I=u-20-C,A=f-40,F=s(()=>[o("rect",{key:"bg",x:"0",y:"0",width:"100%",rx:"8",ry:"8",fill:x,stroke:"#e5e7eb","stroke-width":"1"})],[f,u,x]),R=s(()=>{const e=[],t=r+m+i;return e.push(o("text",{key:"value",x:String(f/2),y:String(k),"text-anchor":"middle","dominant-baseline":"central","font-size":String(S),"font-weight":"bold","font-family":"sans-serif",fill:p,"aria-label":`Value: ${t}`},r?o("tspan",{key:"prefix","font-size":String($),"font-weight":"normal"},r):null,m,i?o("tspan",{key:"suffix","font-size":String($),"font-weight":"normal"},i):null)),e},[f,k,S,$,m,r,i,p]),D=s(()=>v?[o("text",{key:"label",x:String(f/2),y:String(M),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},n)]:[],[v,f,M,n]),L=s(()=>{if(!y)return[];const e=[],t=l>=0,n=function(e){if(!isFinite(e)||isNaN(e))return"--";const t=Math.abs(e);return t<100&&t!==Math.floor(t)?t.toFixed(1):String(Math.round(t))}(l),r=(t?"+":"-")+n+(a?" "+a:""),i=f/2-40,s=z;if(t){const t=`${i},${s} ${i-4},${s+8} ${i+4},${s+8}`;e.push(o("polygon",{key:"trend-arrow",points:t,fill:w}))}else{const t=`${i},${s+8} ${i-4},${s} ${i+4},${s}`;e.push(o("polygon",{key:"trend-arrow",points:t,fill:w}))}return e.push(o("text",{key:"trend-text",x:String(i+8+4),y:String(s+5.6),"text-anchor":"start","font-size":"12","font-family":"sans-serif",fill:w,"aria-label":`Trend: ${r}`},r)),e},[y,l,a,w,f,z]),W=s(()=>{if(!b)return[];const e=[],t=c,n=[];for(const e of t)"number"==typeof e&&isFinite(e)&&!isNaN(e)&&n.push(e);if(n.length<2)return[];let r=1/0,i=-1/0;for(const e of n)e<r&&(r=e),e>i&&(i=e);r===i&&(r-=1,i+=1);const l=i-r,a=A/(n.length-1);let s="";for(let e=0;e<n.length;e++){const t=20+e*a,o=I+C-(n[e]-r)/l*C;s+=0===e?`M ${t} ${o}`:` L ${t} ${o}`}const d=s+` L ${20+(n.length-1)*a} ${I+C} L 20 ${I+C} Z`;return e.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"})))),e.push(o("path",{key:"spark-fill",d:d,fill:"url(#sparkGrad)"})),e.push(o("path",{key:"spark-line",d:s,fill:"none",stroke:"#3b82f6","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})),e},[b,c,A,I,C,20]),N=F(),E=R(),T=D(),P=L(),B=W();return o("svg",{width:"100%",viewBox:`0 0 ${f} ${u}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":`${r}${m}${i}${v?`, ${n}`:""}`,style:{fontFamily:"sans-serif"}},...N,...B,...E,...T,...P)}const wr=Math.PI/180;function kr(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 Sr(e,t,n){const o=Math.sqrt(e*e+t*t+n*n);if(o<1e-10)return{theta:0,phi:0};const r=e/o,i=t/o,l=n/o,a=Math.acos(Math.max(-1,Math.min(1,l))),s=Math.atan2(i,r);return{theta:a,phi:s<0?s+2*Math.PI:s}}function $r(e,t,n){const{x:o,y:r,z:i}=kr(e),l=Math.cos(n),a=Math.sin(n);let s,d,c;return"x"===t?(s=o,d=r*l-i*a,c=r*a+i*l):"y"===t?(s=o*l+i*a,d=r,c=-o*a+i*l):(s=o*l-r*a,d=o*a+r*l,c=i),Sr(s,d,c)}function Mr(e,t){const n=t.angle??Math.PI;switch(t.gate){case"X":return $r(e,"x",Math.PI);case"Y":return $r(e,"y",Math.PI);case"Z":return $r(e,"z",Math.PI);case"H":{const{x:t,y:n,z:o}=kr(e);return Sr(o,-n,t)}case"S":return $r(e,"z",Math.PI/2);case"T":return $r(e,"z",Math.PI/4);case"Rx":return $r(e,"x",n);case"Ry":return $r(e,"y",n);case"Rz":return $r(e,"z",n)}}function zr(e){const{state:t,gates:n,width:r=400,height:i=400,rotateY:d=-25,rotateX:f=15,zoom:u=1,interactive:p=!0,zoomable:h=!0,showVector:g=!0,showLabels:x=!0,showWireframe:m=!0,showTrail:y=!0,trailMaxPoints:b=200,trailColor:v="#ef4444",wireframeColor:w="#cbd5e1",vectorColor:k="#3b82f6",backgroundColor:S,sphereRadius:$=130,title:M,onStateChange:z}=e,[C,I]=l(t??{theta:0,phi:0}),[A,F]=l(d),[R,D]=l(f),[L,W]=l(u),N=c([]),E=c(!1),T=c(null),P=c(null);a(()=>{t&&I(t)},[t?.theta,t?.phi]);const B=c(0);a(()=>{if(!n||0===n.length)return;B.current=0;let e=0;const t=()=>{B.current>=n.length||(I(e=>{const t=Mr(e,n[B.current]);return B.current++,z&&z(t),t}),e=requestAnimationFrame(t))};return e=requestAnimationFrame(t),()=>cancelAnimationFrame(e)},[n]),a(()=>{const e=kr(C);N.current.push(e),N.current.length>b&&N.current.splice(0,N.current.length-b)},[C.theta,C.phi]);const _=$*L,H=r/2,Y=i/2,j=s((e,t,n)=>function(e,t,n,o,r,i,l,a){const s=Math.cos(o*wr),d=Math.sin(o*wr),c=Math.cos(r*wr),f=Math.sin(r*wr),u=-e*f+n*c;return{sx:i+(e*c+n*f)*a,sy:l-(t*s-u*d)*a,depth:t*d+u*s}}(e,t,n,R,A,H,Y,_),[R,A,H,Y,_]),q=s(e=>{if(!p)return;const t=e;E.current=!0,T.current={mx:t.clientX,my:t.clientY,rx:R,ry:A}},[p,R,A]),O=s(e=>{if(!E.current||!T.current)return;const t=e,n=T.current;F(n.ry+.5*(t.clientX-n.mx)),D(n.rx-.5*(t.clientY-n.my))},[]),U=s(()=>{E.current=!1},[]),X=s(e=>{if(!h)return;const t=e;t.preventDefault(),W(e=>Math.max(.5,Math.min(3,e*(t.deltaY>0?.95:1.05))))},[h]),V=[];if(S&&V.push(o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:S,rx:"6"})),M&&V.push(o("text",{key:"title",x:String(H),y:"24","text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},M)),m){const e=60,t=[];for(let n=0;n<=e;n++){const o=n/e*2*Math.PI,r=j(Math.cos(o),Math.sin(o),0);t.push(`${0===n?"M":"L"}${r.sx.toFixed(1)},${r.sy.toFixed(1)}`)}V.push(o("path",{key:"eq",d:t.join(" "),fill:"none",stroke:w,"stroke-width":"0.8",opacity:"0.5"}));const n=[];for(let t=0;t<=e;t++){const o=t/e*2*Math.PI,r=j(Math.cos(o),0,Math.sin(o));n.push(`${0===t?"M":"L"}${r.sx.toFixed(1)},${r.sy.toFixed(1)}`)}V.push(o("path",{key:"xz",d:n.join(" "),fill:"none",stroke:w,"stroke-width":"0.8",opacity:"0.4"}));const r=[];for(let t=0;t<=e;t++){const n=t/e*2*Math.PI,o=j(0,Math.cos(n),Math.sin(n));r.push(`${0===t?"M":"L"}${o.sx.toFixed(1)},${o.sy.toFixed(1)}`)}V.push(o("path",{key:"yz",d:r.join(" "),fill:"none",stroke:w,"stroke-width":"0.8",opacity:"0.4"}))}const G=[{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(const e of G){const t=j(1.15*e.dir[0],1.15*e.dir[1],1.15*e.dir[2]),n=j(1.15*-e.dir[0],1.15*-e.dir[1],1.15*-e.dir[2]);j(0,0,0),V.push(o("line",{key:`axis-${e.id}`,x1:String(n.sx),y1:String(n.sy),x2:String(t.sx),y2:String(t.sy),stroke:e.color,"stroke-width":"0.8",opacity:"0.4","stroke-dasharray":"3 3"}))}if(x){const e=[{text:"|0⟩",pos:[0,0,1.3]},{text:"|1⟩",pos:[0,0,-1.3]},{text:"|+⟩",pos:[1.3,0,0]},{text:"|-⟩",pos:[-1.3,0,0]},{text:"|+i⟩",pos:[0,1.3,0]},{text:"|-i⟩",pos:[0,-1.3,0]}];for(const t of e){const e=j(t.pos[0],t.pos[1],t.pos[2]);V.push(o("text",{key:`lbl-${t.text}`,x:String(e.sx),y:String(e.sy),"text-anchor":"middle","dominant-baseline":"central","font-size":"11","font-family":"serif",fill:"#475569",style:{pointerEvents:"none"}},t.text))}}if(y&&N.current.length>1){const e=N.current,t=[];for(let n=0;n<e.length;n++){const o=e[n],r=j(o.x,o.y,o.z);t.push(`${0===n?"M":"L"}${r.sx.toFixed(1)},${r.sy.toFixed(1)}`)}V.push(o("path",{key:"trail",d:t.join(" "),fill:"none",stroke:v,"stroke-width":"1.5",opacity:"0.5","stroke-linecap":"round","stroke-linejoin":"round"}))}if(g){const e=kr(C),t=j(0,0,0),n=j(e.x,e.y,e.z);V.push(o("line",{key:"vec-line",x1:String(t.sx),y1:String(t.sy),x2:String(n.sx),y2:String(n.sy),stroke:k,"stroke-width":"2.5","stroke-linecap":"round"})),V.push(o("circle",{key:"vec-point",cx:String(n.sx),cy:String(n.sy),r:"5",fill:k,stroke:"#fff","stroke-width":"1.5"}));const l=(180*C.theta/Math.PI).toFixed(0),a=(180*C.phi/Math.PI).toFixed(0);V.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"},`θ=${l}° φ=${a}°`))}return o("svg",{ref:P,width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":M??"Bloch sphere quantum state visualization",style:{fontFamily:"sans-serif",cursor:p?E.current?"grabbing":"grab":"default"},onMouseDown:p?q:void 0,onMouseMove:p?O:void 0,onMouseUp:p?U:void 0,onMouseLeave:p?U:void 0,onWheel:h?X:void 0},...V)}function Cr(e,t){if(0===e.length)return 0;if(1===e.length)return e[0];const n=t/100*(e.length-1),o=Math.floor(n),r=Math.ceil(n);if(o===r)return e[o];const i=n-o;return e[o]+i*(e[r]-e[o])}function Ir(e){const t=function(e){const t=[];for(let n=0;n<e.length;n++){const o=e[n];"number"==typeof o&&isFinite(o)&&!isNaN(o)&&t.push(o)}return t.sort((e,t)=>e-t),t}(e);if(0===t.length)return null;const n=Cr(t,25),o=Cr(t,50),r=Cr(t,75),i=r-n,l=n-1.5*i,a=r+1.5*i;let s=t[0];for(const e of t)if(e>=l){s=e;break}let d=t[t.length-1];for(let e=t.length-1;e>=0;e--)if(t[e]<=a){d=t[e];break}let c=0;for(const e of t)c+=e;const f=c/t.length,u=[];for(const e of t)(e<l||e>a)&&u.push(e);return{q1:n,median:o,q3:r,iqr:i,whiskerLow:s,whiskerHigh:d,mean:f,outliers:u,min:t[0],max:t[t.length-1]}}function Ar(e){const{data:t=[],width:n=600,height:r=400,orientation:i="vertical",showOutliers:l=!0,showMean:a=!1,whiskerColor:c="#374151",boxWidth:f=.6,showGrid:u=!0,title:p,padding:h=60}=e,g="vertical"===i,x=n-2*h,m=r-2*h,y=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],b=d(()=>{const e=[];for(const n of t)e.push(Ir(n.values));return e},[t]),v=d(()=>{let e=1/0,t=-1/0;for(const n of b){if(null===n)continue;const o=l&&n.outliers.length>0?Math.min(n.whiskerLow,n.outliers[0]):n.whiskerLow,r=l&&n.outliers.length>0?Math.max(n.whiskerHigh,n.outliers[n.outliers.length-1]):n.whiskerHigh;o<e&&(e=o),r>t&&(t=r)}isFinite(e)||(e=0,t=1);const n=t-e,o=n>0?.05*n:.5;return{min:e-o,max:t+o}},[b,l]),w=g?m:x,k=(g?x:m)/(t.length>0?t.length:1),S=k*Math.min(Math.max(f,.1),.95),$=s(e=>{const t=v.max-v.min;return 0===t?w/2:(e-v.min)/t*w},[v,w]),M=s(()=>{if(!u)return[];const e=[],t=function(e){if(e<=0)return 1;const t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),o=t/n;return o<=1.5?n:o<=3.5?2*n:o<=7.5?5*n:10*n}(v.max-v.min);for(let n=Math.ceil(v.min/t)*t;n<=v.max;n+=t){const t=$(n),r=String(Math.round(1e3*n)/1e3);if(g){const i=h+m-t;e.push(o("line",{key:`grid-${n}`,x1:String(h),y1:String(i),x2:String(h+x),y2:String(i),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),e.push(o("text",{key:`glabel-${n}`,x:String(h-6),y:String(i+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},r))}else{const i=h+t;e.push(o("line",{key:`grid-${n}`,x1:String(i),y1:String(h),x2:String(i),y2:String(h+m),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),e.push(o("text",{key:`glabel-${n}`,x:String(i),y:String(h+m+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},r))}}return e},[u,v,$,g,h,x,m]),z=s(()=>{const e=[];return e.push(o("line",{key:"axis-value",x1:String(h),y1:String(g?h:h+m),x2:String(h),y2:String(h+m),stroke:"#374151","stroke-width":"1.5"})),e.push(o("line",{key:"axis-category",x1:String(h),y1:String(h+m),x2:String(h+x),y2:String(h+m),stroke:"#374151","stroke-width":"1.5"})),e},[h,x,m,g]),C=s(()=>{const e=[];for(let n=0;n<t.length;n++){const r=b[n];if(null===r)continue;const i=t[n],s=i.color??y[n%y.length],d=k*n+k/2,f=S/2;if(g){const t=h+m-$(r.q1),u=h+m-$(r.q3),p=h+m-$(r.median),g=h+m-$(r.whiskerLow),x=h+m-$(r.whiskerHigh),y=h+d;e.push(o("line",{key:`wl-${n}`,x1:String(y),y1:String(t),x2:String(y),y2:String(g),stroke:c,"stroke-width":"1.5"})),e.push(o("line",{key:`wlc-${n}`,x1:String(y-.4*f),y1:String(g),x2:String(y+.4*f),y2:String(g),stroke:c,"stroke-width":"1.5"})),e.push(o("line",{key:`wh-${n}`,x1:String(y),y1:String(u),x2:String(y),y2:String(x),stroke:c,"stroke-width":"1.5"})),e.push(o("line",{key:`whc-${n}`,x1:String(y-.4*f),y1:String(x),x2:String(y+.4*f),y2:String(x),stroke:c,"stroke-width":"1.5"}));const b=Math.min(t,u),v=Math.abs(t-u);if(e.push(o("rect",{key:`box-${n}`,x:String(y-f),y:String(b),width:String(S),height:String(Math.max(v,1)),fill:s,stroke:c,"stroke-width":"1.5",opacity:"0.8","aria-label":`${i.label}: Q1=${r.q1.toFixed(1)}, median=${r.median.toFixed(1)}, Q3=${r.q3.toFixed(1)}`,role:"img"})),e.push(o("line",{key:`med-${n}`,x1:String(y-f),y1:String(p),x2:String(y+f),y2:String(p),stroke:"#fff","stroke-width":"2.5"})),a){const t=h+m-$(r.mean);e.push(o("circle",{key:`mean-${n}`,cx:String(y),cy:String(t),r:"3.5",fill:"#fff",stroke:c,"stroke-width":"1.5","aria-label":`Mean: ${r.mean.toFixed(1)}`}))}if(l)for(let t=0;t<r.outliers.length;t++){const i=h+m-$(r.outliers[t]);e.push(o("circle",{key:`out-${n}-${t}`,cx:String(y),cy:String(i),r:"3",fill:"none",stroke:c,"stroke-width":"1.5","aria-label":`Outlier: ${r.outliers[t]}`}))}e.push(o("text",{key:`cat-${n}`,x:String(y),y:String(h+m+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},i.label))}else{const t=h+$(r.q1),u=h+$(r.q3),p=h+$(r.median),g=h+$(r.whiskerLow),x=h+$(r.whiskerHigh),m=h+d;e.push(o("line",{key:`wl-${n}`,x1:String(t),y1:String(m),x2:String(g),y2:String(m),stroke:c,"stroke-width":"1.5"})),e.push(o("line",{key:`wlc-${n}`,x1:String(g),y1:String(m-.4*f),x2:String(g),y2:String(m+.4*f),stroke:c,"stroke-width":"1.5"})),e.push(o("line",{key:`wh-${n}`,x1:String(u),y1:String(m),x2:String(x),y2:String(m),stroke:c,"stroke-width":"1.5"})),e.push(o("line",{key:`whc-${n}`,x1:String(x),y1:String(m-.4*f),x2:String(x),y2:String(m+.4*f),stroke:c,"stroke-width":"1.5"}));const y=Math.min(t,u),b=Math.abs(u-t);if(e.push(o("rect",{key:`box-${n}`,x:String(y),y:String(m-f),width:String(Math.max(b,1)),height:String(S),fill:s,stroke:c,"stroke-width":"1.5",opacity:"0.8","aria-label":`${i.label}: Q1=${r.q1.toFixed(1)}, median=${r.median.toFixed(1)}, Q3=${r.q3.toFixed(1)}`,role:"img"})),e.push(o("line",{key:`med-${n}`,x1:String(p),y1:String(m-f),x2:String(p),y2:String(m+f),stroke:"#fff","stroke-width":"2.5"})),a){const t=h+$(r.mean);e.push(o("circle",{key:`mean-${n}`,cx:String(t),cy:String(m),r:"3.5",fill:"#fff",stroke:c,"stroke-width":"1.5","aria-label":`Mean: ${r.mean.toFixed(1)}`}))}if(l)for(let t=0;t<r.outliers.length;t++){const i=h+$(r.outliers[t]);e.push(o("circle",{key:`out-${n}-${t}`,cx:String(i),cy:String(m),r:"3",fill:"none",stroke:c,"stroke-width":"1.5","aria-label":`Outlier: ${r.outliers[t]}`}))}e.push(o("text",{key:`cat-${n}`,x:String(h-6),y:String(m+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},i.label))}}return e},[t,b,$,g,h,x,m,k,S,c,l,a,y]),I=s(()=>p?[o("text",{key:"title",x:String(n/2),y:String(h/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},p)]:[],[p,n,h]),A=M(),F=z(),R=C(),D=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??"Box plot",style:{fontFamily:"sans-serif"}},...D,...A,...F,...R)}function Fr(e){if(e<=0)return 1;const t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),o=t/n;return o<=1.5?n:o<=3.5?2*n:o<=7.5?5*n:10*n}function Rr(e,t,n){return e<t?t:e>n?n:e}function Dr(e){return"number"==typeof e&&isFinite(e)&&!isNaN(e)}function Lr(e){const{data:t=[],width:n=600,height:r=400,xLabel:i,yLabel:l,showGrid:a=!0,showAxes:c=!0,showLabels:f=!1,maxBubbleRadius:u=40,minBubbleRadius:p=4,defaultColor:h="#3b82f6",opacity:g=.7,title:x,padding:m=60}=e,y=d(()=>{const e=[];for(let n=0;n<t.length;n++){const o=t[n];Dr(o.x)&&Dr(o.y)&&Dr(o.r)&&e.push(o)}return e},[t]),b=n-2*m,v=r-2*m,w=d(()=>{if(0===y.length)return{xMin:0,xMax:1,yMin:0,yMax:1,rMin:0,rMax:1};let e=1/0,t=-1/0,n=1/0,o=-1/0,r=1/0,i=-1/0;for(const l of y)l.x<e&&(e=l.x),l.x>t&&(t=l.x),l.y<n&&(n=l.y),l.y>o&&(o=l.y),l.r<r&&(r=l.r),l.r>i&&(i=l.r);return e===t&&(e-=1,t+=1),n===o&&(n-=1,o+=1),r===i&&(r=0,i=i>0?i:1),{xMin:e,xMax:t,yMin:n,yMax:o,rMin:r,rMax:i}},[y]),k=s(e=>{const t=w.xMax-w.xMin;return m+(e-w.xMin)/t*b},[w,m,b]),S=s(e=>{const t=w.yMax-w.yMin;return m+v-(e-w.yMin)/t*v},[w,m,v]),$=s(e=>{const t=w.rMax-w.rMin;if(0===t)return(p+u)/2;const n=(e-w.rMin)/t;return p+n*(u-p)},[w,p,u]),M=s(()=>{if(!a)return[];const e=[],t=Fr(w.xMax-w.xMin);for(let n=Math.ceil(w.xMin/t)*t;n<=w.xMax;n+=t){const t=k(n);e.push(o("line",{key:`grid-x-${n}`,x1:String(t),y1:String(m),x2:String(t),y2:String(m+v),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),e.push(o("text",{key:`grid-xlabel-${n}`,x:String(t),y:String(m+v+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(1e3*n)/1e3)))}const n=Fr(w.yMax-w.yMin);for(let t=Math.ceil(w.yMin/n)*n;t<=w.yMax;t+=n){const n=S(t);e.push(o("line",{key:`grid-y-${t}`,x1:String(m),y1:String(n),x2:String(m+b),y2:String(n),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),e.push(o("text",{key:`grid-ylabel-${t}`,x:String(m-6),y:String(n+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(1e3*t)/1e3)))}return e},[a,w,k,S,m,b,v]),z=s(()=>{if(!c)return[];const e=[];return e.push(o("line",{key:"axis-y",x1:String(m),y1:String(m),x2:String(m),y2:String(m+v),stroke:"#374151","stroke-width":"1.5"})),e.push(o("line",{key:"axis-x",x1:String(m),y1:String(m+v),x2:String(m+b),y2:String(m+v),stroke:"#374151","stroke-width":"1.5"})),i&&e.push(o("text",{key:"x-label",x:String(m+b/2),y:String(m+v+40),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151"},i)),l&&e.push(o("text",{key:"y-label",x:String(m-40),y:String(m+v/2),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90, ${m-40}, ${m+v/2})`},l)),e},[c,m,b,v,i,l]),C=s(()=>{const e=[];for(let t=0;t<y.length;t++){const n=y[t],r=k(n.x),i=S(n.y),l=Rr($(n.r),p,u),a=n.color??h;e.push(o("circle",{key:`bubble-${t}`,cx:String(r),cy:String(i),r:String(l),fill:a,opacity:String(g),stroke:a,"stroke-width":"1","stroke-opacity":"0.8","aria-label":n.label??`Bubble at (${n.x}, ${n.y}) size ${n.r}`,role:"img"})),f&&n.label&&e.push(o("text",{key:`label-${t}`,x:String(r),y:String(i-l-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},n.label))}return e},[y,k,S,$,h,g,f,p,u]),I=s(()=>x?[o("text",{key:"title",x:String(n/2),y:String(m/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},x)]:[],[x,n,m]),A=M(),F=z(),R=C(),D=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":x??"Bubble chart",style:{fontFamily:"sans-serif"}},...D,...A,...F,...R)}const Wr=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Nr=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function Er(e){const t=e.split("-");return 3!==t.length?new Date(NaN):new Date(parseInt(t[0],10),parseInt(t[1],10)-1,parseInt(t[2],10))}function Tr(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function Pr(e){const t=e.replace("#",""),n=3===t.length?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,o=parseInt(n,16);return{r:o>>16&255,g:o>>8&255,b:255&o}}function Br(e,t){if(0===t.length)return"#000000";if(1===t.length)return t[0];const n=Math.max(0,Math.min(1,e)),o=t.length-1,r=Math.min(Math.floor(n*o),o-1),i=n*o-r,l=Pr(t[r]),a=Pr(t[r+1]);return function(e,t,n){const o=e=>{const t=Math.max(0,Math.min(255,Math.round(e))).toString(16);return 1===t.length?"0"+t:t};return`#${o(e)}${o(t)}${o(n)}`}(l.r+(a.r-l.r)*i,l.g+(a.g-l.g)*i,l.b+(a.b-l.b)*i)}const _r=["#9be9a8","#40c463","#30a14e","#216e39"];function Hr(e){const{data:t=[],width:n=800,height:r=160,colorScale:i=_r,cellSize:l=12,cellGap:a=2,showMonthLabels:c=!0,showDayLabels:f=!0,emptyColor:u="#ebedf0",title:p}=e,{dateMap:h,startDate:g,endDate:x,maxVal:m}=d(()=>{const e=new Map;let n=0,o=null,r=null;for(const i of t){const t=Er(i.date);if(isNaN(t.getTime()))continue;const l=Tr(t);e.set(l,(e.get(l)??0)+i.value);const a=e.get(l);a>n&&(n=a),(null===o||t<o)&&(o=t),(null===r||t>r)&&(r=t)}if(null===o||null===r){const e=new Date;o=new Date(e.getFullYear(),0,1),r=new Date(e.getFullYear(),11,31)}const i=new Date(o);i.setDate(i.getDate()-i.getDay());const l=new Date(r);return l.setDate(l.getDate()+(6-l.getDay())),{dateMap:e,startDate:i,endDate:l,maxVal:n>0?n:1}},[t]),y=f?30:0,b=c?16:0,v=p?28:0,w=y+10,k=v+b+4,S=s(()=>{const e=[],t=new Date(g);let n=0;for(;t<=x;){const r=t.getDay();0===r&&t>g&&n++;const s=Tr(t),d=h.get(s),c=void 0!==d&&d>0?Br(d/m,i):u,f=w+n*(l+a),p=k+r*(l+a);e.push(o("rect",{key:`day-${s}`,x:String(f),y:String(p),width:String(l),height:String(l),rx:"2",ry:"2",fill:c,"aria-label":`${s}: ${d??0}`})),t.setDate(t.getDate()+1)}return e},[g,x,h,m,i,u,l,a,w,k]),$=s(()=>{if(!c)return[];const e=[],t=new Date(g);let n=0,r=-1;for(;t<=x;){const i=t.getDay();0===i&&t>g&&n++;const s=t.getMonth();if(s!==r&&0===i){r=s;const t=w+n*(l+a);e.push(o("text",{key:`month-${n}`,x:String(t),y:String(v+b-2),"font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},Wr[s]))}t.setDate(t.getDate()+1)}return e},[c,g,x,l,a,w,v,b]),M=s(()=>{if(!f)return[];const e=[],t=[1,3,5];for(const n of t){const t=k+n*(l+a)+l/2;e.push(o("text",{key:`day-label-${n}`,x:String(y),y:String(t),"text-anchor":"end","dominant-baseline":"central","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},Nr[n]))}return e},[f,l,a,k,y]),z=s(()=>p?[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"},p)]:[],[p,n]);if(0===t.length)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??"Calendar heat map — 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."));const C=z(),I=$(),A=M(),F=S();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??"Calendar heat map",style:{fontFamily:"sans-serif"}},...C,...I,...A,...F)}const Yr=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function jr(e,t,n,o){const r=o-Math.PI/2;return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function qr(e,t,n,o,r,i){const l=jr(e,t,n,r),a=jr(e,t,n,i),s=jr(e,t,o,r),d=jr(e,t,o,i),c=i-r>Math.PI?1:0;return[`M ${l.x} ${l.y}`,`A ${n} ${n} 0 ${c} 1 ${a.x} ${a.y}`,`L ${d.x} ${d.y}`,`A ${o} ${o} 0 ${c} 0 ${s.x} ${s.y}`,"Z"].join(" ")}function Or(e,t,n,o,r,i,l){const a=jr(e,t,n,o),s=jr(e,t,n,r),d=jr(e,t,n,i),c=jr(e,t,n,l),f=l-i,u=r-o>Math.PI?1:0,p=f>Math.PI?1:0;return[`M ${a.x} ${a.y}`,`A ${n} ${n} 0 ${u} 1 ${s.x} ${s.y}`,`Q ${e} ${t} ${d.x} ${d.y}`,`A ${n} ${n} 0 ${p} 1 ${c.x} ${c.y}`,`Q ${e} ${t} ${a.x} ${a.y}`,"Z"].join(" ")}function Ur(e){const{matrix:t,labels:n,width:r=600,height:i=600,colors:l=Yr,padAngle:a=.05,showLabels:c=!0,showValues:f=!1,ribbonOpacity:u=.5,innerRadiusRatio:p=.9,title:h}=e;if(!t||0===t.length||!n||0===n.length)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"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"));const g=r/2,x=i/2,m=Math.min(r,i)/2-40,y=m*Math.max(.5,Math.min(.99,p)),b=m+16,v=d(()=>function(e,t,n,o){const r=e.length;if(0===r)return{groups:[],chords:[]};const i=[];let l=0;for(let t=0;t<r;t++){let n=0;for(let o=0;o<r;o++){const r=e[t]?.[o]??0;n+=Math.max(0,r)}i.push(n),l+=n}if(0===l){const e=(2*Math.PI-r*o)/Math.max(r,1),i=[];let l=0;for(let a=0;a<r;a++)i.push({index:a,label:t[a]??`Group ${a}`,color:n[a%n.length],startAngle:l,endAngle:l+e,value:0}),l+=e+o;return{groups:i,chords:[]}}const a=2*Math.PI-r*o,s=[];let d=0;for(let e=0;e<r;e++){const r=i[e]/l*a;s.push({index:e,label:t[e]??`Group ${e}`,color:n[e%n.length],startAngle:d,endAngle:d+r,value:i[e]}),d+=r+o}const c=[];for(let e=0;e<r;e++)c.push(s[e].startAngle);const f=[];for(let t=0;t<r;t++)for(let n=t;n<r;n++){const o=Math.max(0,e[t]?.[n]??0),r=t===n?0:Math.max(0,e[n]?.[t]??0);if(0===o&&0===r)continue;const d=o+r,u=i[t]>0?o/l*a:0,p=c[t],h=p+u;c[t]=h;const g=i[n]>0?o/l*a:0,x=c[n],m=x+g;if(c[n]=m,t===n){o>0&&f.push({sourceIndex:t,targetIndex:n,sourceStartAngle:p,sourceEndAngle:h,targetStartAngle:x,targetEndAngle:m,value:o,color:s[t].color});continue}const y=i[n]>0?r/l*a:0,b=c[n]+y;c[n]=b;const v=i[t]>0?r/l*a:0,w=c[t]+v;c[t]=w,(o>0||r>0)&&f.push({sourceIndex:t,targetIndex:n,sourceStartAngle:p,sourceEndAngle:Math.max(h,p+.001),targetStartAngle:x,targetEndAngle:Math.max(m,x+.001),value:d,color:s[t].color})}return{groups:s,chords:f}}(t,n,l,a),[t,n,l,a]),w=s(()=>{const e=[];for(let t=0;t<v.groups.length;t++){const n=v.groups[t];if(n.endAngle-n.startAngle<.001)continue;const r=qr(g,x,m,y,n.startAngle,n.endAngle);if(e.push(o("path",{key:`arc-${t}`,d:r,fill:n.color,stroke:"#fff","stroke-width":"1",role:"img","aria-label":`${n.label}: ${n.value}`})),c){const r=(n.startAngle+n.endAngle)/2,i=jr(g,x,b,r),l=((r-Math.PI/2)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)<Math.PI,a=l?"start":"end";let s=180*r/Math.PI-90;l||(s+=180);const d=f?`${n.label} (${n.value})`:n.label;e.push(o("text",{key:`label-${t}`,x:String(i.x),y:String(i.y),"text-anchor":a,"font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(${s}, ${i.x}, ${i.y})`,"dominant-baseline":"central","pointer-events":"none"},d))}}return e},[v,g,x,m,y,b,c,f]),k=s(()=>{const e=[];for(let t=0;t<v.chords.length;t++){const n=v.chords[t],r=Or(g,x,y,n.sourceStartAngle,n.sourceEndAngle,n.targetStartAngle,n.targetEndAngle);e.push(o("path",{key:`ribbon-${t}`,d:r,fill:n.color,"fill-opacity":String(u),stroke:n.color,"stroke-width":"0.5","stroke-opacity":"0.3"}))}return e},[v,g,x,y,u]),S=s(()=>h?[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"},h)]:[],[h,r]),$=k(),M=w(),z=S();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Chord diagram",style:{fontFamily:"sans-serif"}},...z,...$,...M)}const Xr=["#3b82f6","#22c55e","#f59e0b","#8b5cf6","#ef4444","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Vr(e){const{data:t,width:n=800,height:r=500,orientation:i="horizontal",nodeWidth:l=120,nodeHeight:a=40,showValues:c=!0,showConnectors:f=!0,connectorColor:u="#94a3b8",colors:p=Xr,title:h,padding:g=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":h??"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"));const x="horizontal"===i,m=d(()=>function(e,t,n,o,r,i,l,a){const{flatNodes:s,maxDepth:d}=function(e){const t=[];let n=0;const o=[];o.push([e,0,null]);let r=0;for(;o.length>0;){const[e,i,l]=o.shift(),a=n++;r=Math.max(r,i);const s=e.children??[],d=[];for(let e=0;e<s.length;e++)d.push(n+o.length+e);t.push({id:a,node:e,depth:i,parentId:l,childIndices:d});for(let e=0;e<s.length;e++)o.push([s[e],i+1,a])}return{flatNodes:t,maxDepth:r}}(e);if(0===s.length)return[];const c=function(e){const t=e.length,n=new Array(t).fill(0);for(let o=t-1;o>=0;o--){const r=e[o];if(0===r.childIndices.length)n[o]=1;else{let e=0;for(const o of r.childIndices)o<t&&(e+=n[o]);n[o]=Math.max(e,1)}}return n}(s),f=t-2*i,u=n-2*i,p="horizontal"===l,h=d+1,g=p?h>1?(f-o)/d:0:h>1?(u-r)/d:0,x=new Array(s.length),m=c[0],y=p?u:f,b=m>0?y/m:y,v=new Array(s.length);v[0]=[0,m];const w=[0];let k=0;for(;k<w.length;){const e=w[k];k++;const t=s[e],[n,o]=v[e],r=(n+o)/2,l=i+t.depth*g,d=i+(r-.5)*b,f=p?l:d,u=p?d:l,h=t.node.color??a[t.depth%a.length];x[e]={id:t.id,label:t.node.label,value:void 0!==t.node.value?String(t.node.value):"",color:h,depth:t.depth,x:f,y:u,parentId:t.parentId,childCount:t.childIndices.length,subtreeLeafCount:c[e]};let m=n;for(const e of t.childIndices)if(e<s.length){const t=m+c[e];v[e]=[m,t],m=t,w.push(e)}}return x}(t,n,r,l,a,g,i,p),[t,n,r,l,a,g,i,p]),y=d(()=>{const e=new Map;for(let t=0;t<m.length;t++){const n=m[t];e.set(n.id,n)}return e},[m]),b=s(()=>{if(!f)return[];const e=[];for(let t=0;t<m.length;t++){const n=m[t];if(null===n.parentId)continue;const r=y.get(n.parentId);if(!r)continue;let i,s,d,c;x?(i=r.x+l,s=r.y+a/2,d=n.x,c=n.y+a/2):(i=r.x+l/2,s=r.y+a,d=n.x+l/2,c=n.y);const f=(i+d)/2,p=(s+c)/2;let h;h=x?`M ${i} ${s} C ${f} ${s}, ${f} ${c}, ${d} ${c}`:`M ${i} ${s} C ${i} ${p}, ${d} ${p}, ${d} ${c}`,e.push(o("path",{key:`conn-${t}`,d:h,fill:"none",stroke:u,"stroke-width":"1.5","stroke-opacity":"0.7"}))}return e},[m,y,x,l,a,f,u]),v=s(()=>{const e=[];for(let t=0;t<m.length;t++){const n=m[t];e.push(o("rect",{key:`node-rect-${n.id}`,x:String(n.x),y:String(n.y),width:String(l),height:String(a),rx:"4",ry:"4",fill:n.color,stroke:"#374151","stroke-width":"1",role:"img","aria-label":n.value?`${n.label}: ${n.value}`:n.label}));const r=c&&n.value?n.y+a/2-2:n.y+a/2+4;e.push(o("text",{key:`node-label-${n.id}`,x:String(n.x+l/2),y:String(r),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#fff","pointer-events":"none"},n.label)),c&&n.value&&e.push(o("text",{key:`node-value-${n.id}`,x:String(n.x+l/2),y:String(n.y+a/2+12),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.85)","pointer-events":"none"},n.value))}return e},[m,l,a,c]),w=s(()=>h?[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"},h)]:[],[h,n]),k=b(),S=v(),$=w();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??"Decomposition tree",style:{fontFamily:"sans-serif"}},...$,...k,...S)}const Gr=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Kr(e){return Gr[e%Gr.length]}function Zr(e,t,n){const o=t/2,r=n/2,i=.3*Math.min(t,n),l=e.length,a=[];for(let t=0;t<l;t++){const n=e[t],s=2*Math.PI*t/Math.max(l,1);a.push({id:n.id,label:n.label??n.id,color:n.color??Kr(t),x:n.x??o+i*Math.cos(s),y:n.y??r+i*Math.sin(s),vx:0,vy:0,fixed:n.fixed??!1,solid:n.solid??!0})}return a}function Jr(e,t){const n=2*t;for(let t=0;t<e.length;t++){const o=e[t];if(o.solid)for(let r=t+1;r<e.length;r++){const t=e[r];if(!t.solid)continue;const i=t.x-o.x,l=t.y-o.y,a=i*i+l*l;if(a>=n*n||a<1e-4)continue;const s=Math.sqrt(a),d=i/s,c=l/s,f=n-s;if(o.fixed&&t.fixed)continue;o.fixed?(t.x+=d*f,t.y+=c*f):t.fixed?(o.x-=d*f,o.y-=c*f):(o.x-=d*f*.5,o.y-=c*f*.5,t.x+=d*f*.5,t.y+=c*f*.5);const u=(o.vx-t.vx)*d+(o.vy-t.vy)*c;u<=0||(o.fixed?(t.vx+=u*d,t.vy+=u*c):t.fixed?(o.vx-=u*d,o.vy-=u*c):(o.vx-=u*d,o.vy-=u*c,t.vx+=u*d,t.vy+=u*c))}}}function Qr(e){const{nodes:t,edges:n,width:r=600,height:i=400,nodeRadius:f=12,nodeStrokeWidth:u=2,solidNodes:p=!0,showLabels:h=!0,showArrows:g=!1,repulsionForce:x=300,attractionForce:m=.01,damping:y=.9,edgeLength:b=100,edgeColor:v="#94a3b8",edgeWidth:w=1.5,title:k,customForce:S,trails:$}=e;if(!t||0===t.length)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":k??"Empty force-directed graph"},k?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"},k):o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));const M=c(Zr(t,r,i)),[z,C]=l(0),I=c(!0),A=c(!1),F=c(n);F.current=n;const R=c(S);R.current=S;const D=c(null),L=c({repulsionForce:x,attractionForce:m,damping:y,edgeLength:b,width:r,height:i,nodeRadius:f,solidNodes:p});L.current={repulsionForce:x,attractionForce:m,damping:y,edgeLength:b,width:r,height:i,nodeRadius:f,solidNodes:p};const W=c(new Map);a(()=>{M.current=Zr(t,r,i),A.current=!1,I.current=!0,W.current=new Map,C(e=>e+1)},[t.length]),a(()=>{let e=0;const t=()=>{if(!I.current)return;const n=L.current,o=R.current;let r;if(o?(r=o(M.current,F.current,n.width,n.height,D.current),n.solidNodes&&Jr(r,n.nodeRadius)):r=function(e,t,n,o,r,i,l,a,s=12){const d=e.length;if(0===d)return e;const c=new Map;for(let t=0;t<d;t++)c.set(e[t].id,t);const f=new Float64Array(d),u=new Float64Array(d);for(let t=0;t<d;t++){const n=e[t];for(let o=t+1;o<d;o++){const i=e[o];let l=n.x-i.x,a=n.y-i.y,s=l*l+a*a;s<1&&(s=1);const d=Math.sqrt(s),c=r/s,p=l/d*c,h=a/d*c;f[t]+=p,u[t]+=h,f[o]-=p,u[o]-=h}}for(let n=0;n<t.length;n++){const o=t[n],r=c.get(o.source),l=c.get(o.target);if(void 0===r||void 0===l)continue;const s=e[r],d=e[l],p=d.x-s.x,h=d.y-s.y,g=Math.sqrt(p*p+h*h);if(g<.1)continue;const x=i*(g-a)*(o.weight??1),m=p/g*x,y=h/g*x;f[r]+=m,u[r]+=y,f[l]-=m,u[l]-=y}const p=n/2,h=o/2;for(let t=0;t<d;t++){const n=e[t];f[t]+=.001*(p-n.x),u[t]+=.001*(h-n.y)}const g=[];for(let t=0;t<d;t++){const r=e[t];if(r.fixed){g.push({...r,vx:0,vy:0});continue}let i=(r.vx+f[t])*l,a=(r.vy+u[t])*l;const s=Math.sqrt(i*i+a*a),d=10;s>d&&(i=i/s*d,a=a/s*d);let c=r.x+i,p=r.y+a;c=Math.max(20,Math.min(n-20,c)),p=Math.max(20,Math.min(o-20,p)),g.push({...r,x:c,y:p,vx:i,vy:a})}return Jr(g,s),g}(M.current,F.current,n.width,n.height,n.repulsionForce,n.attractionForce,n.damping,n.edgeLength,n.nodeRadius),M.current=r,$)for(let e=0;e<$.length;e++){const t=$[e],n=r.find(e=>e.id===t.nodeId);if(!n)continue;let o=W.current.get(t.nodeId);o||(o=[],W.current.set(t.nodeId,o)),o.push({x:n.x,y:n.y});const i=t.maxPoints??200;o.length>i&&o.splice(0,o.length-i)}if(!o&&function(e){let t=0;for(let n=0;n<e.length;n++){const o=e[n];t+=o.vx*o.vx+o.vy*o.vy}return t}(r)<.01)return A.current=!0,void C(e=>e+1);C(e=>e+1),e=requestAnimationFrame(t)};return e=requestAnimationFrame(t),()=>{I.current=!1,cancelAnimationFrame(e)}},[]);const N=M.current,E=s(e=>{M.current=M.current.map(t=>t.id===e?{...t,fixed:!t.fixed,vx:0,vy:0}:t),A.current&&(A.current=!1,I.current=!0,C(e=>e+1))},[]),T=c(null),P=c(null),B=s(e=>{const t=e,n=P.current;if(!n)return{x:t.clientX,y:t.clientY};const o=n.getBoundingClientRect(),l=r/o.width,a=i/o.height;return{x:(t.clientX-o.left)*l,y:(t.clientY-o.top)*a}},[r,i]),_=c(!1),H=s((e,t)=>{t.stopPropagation(),T.current=e;const n=M.current.find(t=>t.id===e);_.current=n?.fixed??!1,M.current=M.current.map(t=>t.id===e?{...t,fixed:!0,vx:0,vy:0}:t)},[]),Y=s(e=>{const t=B(e);if(D.current={x:t.x,y:t.y},!T.current)return;const n=T.current;M.current=M.current.map(e=>e.id===n?{...e,x:Math.max(20,Math.min(r-20,t.x)),y:Math.max(20,Math.min(i-20,t.y))}:e),A.current&&(A.current=!1,I.current=!0),C(e=>e+1)},[r,i,B]),j=s(()=>{const e=T.current;e&&(M.current=M.current.map(t=>t.id===e?{...t,fixed:_.current}:t)),T.current=null},[]),q=s(()=>{T.current=null,D.current=null},[]),O=d(()=>{const e=new Map;for(let t=0;t<N.length;t++)e.set(N[t].id,N[t]);return e},[z]),U=s(()=>g?[o("defs",{key:"arrow-defs"},o("marker",{key:"arrowhead",id:"arrowhead",markerWidth:"10",markerHeight:"7",refX:String(10+f),refY:"3.5",orient:"auto",markerUnits:"userSpaceOnUse"},o("polygon",{key:"arrow-poly",points:"0 0, 10 3.5, 0 7",fill:v})))]:[],[g,f,v]),X=s(()=>{const e=[];for(let t=0;t<n.length;t++){const r=n[t],i=O.get(r.source),l=O.get(r.target);if(!i||!l)continue;if(void 0!==r.weight&&r.weight<=0)continue;const a=r.weight?Math.max(.5,Math.min(6,w*r.weight)):w,s={key:`edge-${t}`,x1:String(i.x),y1:String(i.y),x2:String(l.x),y2:String(l.y),stroke:r.color??v,"stroke-width":String(a),"stroke-opacity":"0.6"};g&&(s["marker-end"]="url(#arrowhead)"),e.push(o("line",s))}return e},[z,v,w,g]),V=s(()=>{const e=[];for(let t=0;t<N.length;t++){const n=N[t];e.push(o("circle",{key:`node-${n.id}`,cx:String(n.x),cy:String(n.y),r:String(f),fill:n.color,stroke:n.fixed?"#0f172a":"#fff","stroke-width":n.fixed?"3":String(u),style:{cursor:T.current===n.id?"grabbing":"grab"},onMouseDown:e=>H(n.id,e),onDblClick:()=>E(n.id),role:"button",tabIndex:0,"aria-label":`Node: ${n.label}${n.fixed?" (locked)":""} — drag to move, double-click to lock`})),h&&e.push(o("text",{key:`label-${n.id}`,x:String(n.x),y:String(n.y+f+14),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},n.label))}return e},[z,f,h,E]),G=s(()=>k?[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"},k)]:[],[k,r]),K=s(()=>{if(!$||0===$.length)return[];const e=[];for(let t=0;t<$.length;t++){const n=$[t],r=W.current.get(n.nodeId);if(!r||r.length<2)continue;const i=[];for(let e=0;e<r.length;e++){const t=r[e];i.push(`${0===e?"M":"L"}${t.x.toFixed(1)},${t.y.toFixed(1)}`)}e.push(o("path",{key:`trail-${n.nodeId}`,d:i.join(" "),fill:"none",stroke:n.color??"#3b82f6","stroke-width":String(n.width??1),opacity:String(n.opacity??.5),"stroke-linecap":"round","stroke-linejoin":"round"}))}return e},[z,$]),Z=U(),J=K(),Q=X(),ee=V(),te=G();return o("svg",{ref:P,width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":k??"Force-directed graph — drag nodes to move, double-click to lock",style:{fontFamily:"sans-serif",cursor:T.current?"grabbing":"default"},onMouseMove:Y,onMouseUp:j,onMouseLeave:q},...Z,...te,...J,...Q,...ee)}const ei=["#3b82f6","#6366f1","#8b5cf6","#a855f7","#c084fc","#d8b4fe","#e9d5ff","#f3e8ff"];function ti(e){const{data:t=[],width:n=600,height:r=400,orientation:i="vertical",showLabels:l=!0,showValues:a=!0,showPercentage:c=!0,gapSize:f=2,colors:u=ei,title:p}=e,h="vertical"===i,g=p?30:0,x=d(()=>{let e=0;for(let n=0;n<t.length;n++)t[n].value>e&&(e=t[n].value);return e>0?e:1},[t]),m=s(e=>0===x?0:Math.max(.05,e/x),[x]),y=s((e,t)=>t||(u[e%u.length]??ei[0]),[u]),b=s(()=>{if(0===t.length)return[];const e=[],i=n-80-120,s=r-g-80,d=f*(t.length-1),u=Math.max(1,(s-d)/t.length),p=40+i/2;for(let n=0;n<t.length;n++){const r=t[n],s=n<t.length-1?t[n+1]:null,d=y(n,r.color),h=m(r.value),x=i/2*h,b=i/2*(null!==s?m(s.value):.6*h),v=g+40+n*(u+f),w=`${p-x},${v} ${p+x},${v} ${p+b},${v+u} ${p-b},${v+u}`;e.push(o("polygon",{key:`section-${n}`,points:w,fill:d,stroke:"#fff","stroke-width":"1"}));const k=40+i+12,S=v+u/2;if(l&&e.push(o("text",{key:`label-${n}`,x:String(k),y:String(S-(a||c?6:0)),"text-anchor":"start","font-size":"12","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},r.label)),a||c){let i="";if(a&&(i=String(r.value)),c&&t.length>0){const e=t[0].value,n=e>0?Math.round(r.value/e*100):0;i+=a?` (${n}%)`:`${n}%`}e.push(o("text",{key:`value-${n}`,x:String(k),y:String(S+(l?10:4)),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},i))}}return e},[t,n,r,g,f,l,a,c,y,m,120]),v=s(()=>{if(0===t.length)return[];const e=[],i=n-80,s=r-g-80-40,d=f*(t.length-1),u=Math.max(1,(i-d)/t.length),p=g+40+s/2;for(let n=0;n<t.length;n++){const r=t[n],i=n<t.length-1?t[n+1]:null,d=y(n,r.color),h=m(r.value),x=s/2*h,b=s/2*(null!==i?m(i.value):.6*h),v=40+n*(u+f),w=`${v},${p-x} ${v+u},${p-b} ${v+u},${p+b} ${v},${p+x}`;e.push(o("polygon",{key:`section-${n}`,points:w,fill:d,stroke:"#fff","stroke-width":"1"}));const k=v+u/2,S=g+40+s+14;if(l&&e.push(o("text",{key:`label-${n}`,x:String(k),y:String(S),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},r.label)),a||c){let i="";if(a&&(i=String(r.value)),c&&t.length>0){const e=t[0].value,n=e>0?Math.round(r.value/e*100):0;i+=a?` (${n}%)`:`${n}%`}e.push(o("text",{key:`value-${n}`,x:String(k),y:String(S+14),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#6b7280"},i))}}return e},[t,n,r,g,f,l,a,c,y,m]),w=s(()=>p?[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"},p)]:[],[p,n]),k=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]),S=w(),$=h?b():v(),M=k();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??"Funnel chart",style:{fontFamily:"sans-serif"}},...S,...$,...M)}const ni=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function oi(e){if(e<=0)return 1;const t=e/6,n=Math.pow(10,Math.floor(Math.log10(t))),o=t/n;return o<=1.5?n:o<=3.5?2*n:o<=7.5?5*n:10*n}function ri(e,t){return t||ni[e%ni.length]}function ii(e){const{tasks:t=[],width:n=800,height:r,barHeight:i=24,barGap:l=8,showGrid:a=!0,showLabels:c=!0,showProgress:f=!1,timeUnit:u="days",title:p,padding:h=50}=e;if(0===t.length)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":p??"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"));const g=c?120:0,x=d(()=>{let e=1/0,n=-1/0;for(const o of t){o.start<e&&(e=o.start);const t=o.start+o.duration;t>n&&(n=t)}return e===1/0&&(e=0,n=1),{min:e,max:n,range:n-e}},[t]),m=d(()=>{const e=t.slice();return e.sort((e,t)=>e.group!==t.group?(e.group??"").localeCompare(t.group??""):e.start-t.start),e},[t]),y=r??2*h+m.length*(i+l)+l+20,b=n-h-g-h,v=h+(p?20:0),w=s(e=>0===x.range?g+h:g+h+(e-x.min)/x.range*b,[x,b,g,h]),k=s(()=>{if(!a)return[];const e=[],t=oi(x.range),n=Math.ceil(x.min/t)*t,r=v+m.length*(i+l)+l;for(let i=n;i<=x.max;i+=t){const t=w(i);e.push(o("line",{key:`grid-${i}`,x1:String(t),y1:String(v),x2:String(t),y2:String(r),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"}))}return e},[a,x,v,m.length,i,l,w]),S=s(()=>{const e=[],t=oi(x.range),r=Math.ceil(x.min/t)*t,i=v-8;for(let n=r;n<=x.max;n+=t){const t=w(n);e.push(o("text",{key:`taxis-${n}`,x:String(t),y:String(i),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},String(n)))}return e.push(o("text",{key:"time-unit",x:String(n-h),y:String(i),"text-anchor":"end","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.4","font-style":"italic"},u)),e},[x,v,w,u,n,h]),$=s(()=>{const e=[];let t="";for(let n=0;n<m.length;n++){const r=m[n],a=v+n*(i+l)+l,s=w(r.start),d=Math.max(2,w(r.start+r.duration)-s),u=ri(n,r.color);r.group&&r.group!==t&&(t=r.group,c&&e.push(o("text",{key:`group-${n}`,x:String(h),y:String(a+i/2-12),"font-size":"9","font-family":"sans-serif","font-weight":"bold",fill:"currentColor",opacity:"0.4","text-transform":"uppercase"},r.group))),e.push(o("rect",{key:`bar-${r.id}`,x:String(s),y:String(a),width:String(d),height:String(i),rx:"4",ry:"4",fill:u,role:"graphics-symbol","aria-label":`${r.label}: start ${r.start}, duration ${r.duration}`})),c&&e.push(o("text",{key:`label-${r.id}`,x:String(g+h-8),y:String(a+i/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"currentColor"},r.label.length>16?r.label.substring(0,14)+"..":r.label)),f&&d>30&&e.push(o("text",{key:`prog-${r.id}`,x:String(s+d/2),y:String(a+i/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#ffffff"},`${r.start}-${r.start+r.duration}`))}return e},[m,v,i,l,w,c,f,g,h]),M=s(()=>p?[o("text",{key:"title",x:String(n/2),y:String(h/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},p)]:[],[p,n,h]),z=k(),C=S(),I=$(),A=M();return o("svg",{width:"100%",height:String(y),viewBox:`0 0 ${n} ${y}`,xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Gantt chart",style:{fontFamily:"sans-serif"}},...A,...z,...C,...I)}const li=Math.PI/180;function ai(e,t,n,o){const r=o*li;return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function si(e,t,n,o,r){const i=ai(e,t,n,r),l=ai(e,t,n,o),a=r-o,s=Math.abs(a)>180?1:0,d=a>0?1:0;return`M ${i.x} ${i.y} A ${n} ${n} 0 ${s} ${1===d?0:1} ${l.x} ${l.y}`}function di(e){return!isFinite(e)||isNaN(e)?"--":Math.abs(e)>=1e3?Math.round(e).toString():e===Math.floor(e)?e.toString():e.toFixed(1)}function ci(e){const{value:t,min:n=0,max:r=100,width:i=300,height:l=200,startAngle:a=-135,endAngle:d=135,arcWidth:c=20,showValue:f=!0,showMinMax:u=!0,showTicks:p=!0,tickCount:h=10,label:g,unit:x,colors:m=["#22c55e","#f59e0b","#ef4444"],needleColor:y="#374151",backgroundColor:b="#e5e7eb"}=e,v=isFinite(n)&&!isNaN(n)?n:0,w=isFinite(r)&&!isNaN(r)&&r>v?r:v+100,k=isFinite(t)&&!isNaN(t)?function(e,t,n){return e<t?t:e>n?n:e}(t,v,w):v,S=(f?24:0)+(g?18:0),$=i/2,M=.6*(l-S),z=Math.min(i/2,.55*(l-S))-c/2-10,C=z-c,I=z-c/2,A=d-a,F=s(e=>{const t=w-v;return 0===t?a:a+(e-v)/t*A},[v,w,a,A]),R=s(()=>[o("path",{key:"bg-arc",d:si($,M,I,a,d),fill:"none",stroke:b,"stroke-width":String(c),"stroke-linecap":"round"})],[$,M,I,a,d,b,c]),D=s(()=>{if(0===m.length)return[];const e=[],t=A/m.length;for(let n=0;n<m.length;n++){const r=a+n*t,i=si($,M,I,r,r+t);e.push(o("path",{key:`seg-${n}`,d:i,fill:"none",stroke:m[n],"stroke-width":String(c),"stroke-linecap":0===n||n===m.length-1?"round":"butt",opacity:"0.85"}))}return e},[m,A,a,$,M,I,c]),L=s(()=>{if(!p||h<=0)return[];const e=[],t=Math.max(1,Math.min(h,100));for(let n=0;n<=t;n++){const r=n/t,i=a+r*A,l=n%2==0,s=l?10:6,d=ai($,M,z+4,i),c=ai($,M,z+4+s,i);if(e.push(o("line",{key:`tick-${n}`,x1:String(d.x),y1:String(d.y),x2:String(c.x),y2:String(c.y),stroke:"currentColor",opacity:"0.4","stroke-width":l?"2":"1"})),l){const t=v+r*(w-v),l=ai($,M,z+4+s+12,i);e.push(o("text",{key:`tick-label-${n}`,x:String(l.x),y:String(l.y+3),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},di(t)))}}return e},[p,h,a,A,$,M,z,v,w]),W=s(()=>{const e=[],t=F(k),n=ai($,M,C-8,t),r=t-90,i=ai($,M,6,t+90),l=ai($,M,6,r);return e.push(o("polygon",{key:"needle",points:`${n.x},${n.y} ${i.x},${i.y} ${l.x},${l.y}`,fill:y,stroke:"none"})),e.push(o("circle",{key:"needle-cap",cx:String($),cy:String(M),r:"8",fill:y,stroke:"#fff","stroke-width":"2"})),e},[k,F,$,M,C,y]),N=s(()=>{if(!f)return[];const e=[],t=di(k),n=t+(x?" "+x:""),r=M+I+20;return e.push(o("text",{key:"value-text",x:String($),y:String(r),"text-anchor":"middle","font-size":"22","font-weight":"bold","font-family":"sans-serif",fill:"currentColor","aria-label":`Value: ${n}`},t,x?o("tspan",{key:"unit","font-size":"14","font-weight":"normal",opacity:"0.6",fill:"currentColor"}," "+x):null)),e},[f,k,x,$,M,I]),E=s(()=>{if(!g)return[];const e=M+I+(f?40:20);return[o("text",{key:"label",x:String($),y:String(e),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},g)]},[g,$,M,I,f]),T=s(()=>{if(!u)return[];const e=[],t=ai($,M,I,a),n=ai($,M,I,d);return e.push(o("text",{key:"min-label",x:String(t.x-4),y:String(t.y+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},di(v))),e.push(o("text",{key:"max-label",x:String(n.x+4),y:String(n.y+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},di(w))),e},[u,$,M,I,a,d,v,w]),P=R(),B=D(),_=L(),H=W(),Y=N(),j=E(),q=T(),O=`Gauge: ${di(k)}${x?" "+x:""}, range ${di(v)} to ${di(w)}${g?", "+g:""}`;return o("svg",{width:"100%",viewBox:`0 0 ${i} ${l}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"meter","aria-valuenow":String(k),"aria-valuemin":String(v),"aria-valuemax":String(w),"aria-label":O,style:{fontFamily:"sans-serif"}},...P,...B,..._,...H,...Y,...j,...q)}const fi={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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e){const{width:t=959,height:n=593,stateColors:r={},defaultColor:i="#D0D0D0",strokeColor:l="#FFFFFF",strokeWidth:a=1,onStateClick:c,onStateHover:f,hoverColor:u="#FFD700",title:p="Map of the United States"}=e,h=d(()=>Object.keys(fi),[]),g=s(e=>{c&&c(e)},[c]),x=s((e,t)=>{const n=t.currentTarget;n&&n.setAttribute("fill",u),f&&f(e)},[f,u]),m=s((e,t)=>{const n=t.currentTarget;if(n){const t=r[e]??i;n.setAttribute("fill",t)}f&&f(null)},[f,r,i]),y=d(()=>{const e=[];for(let t=0;t<h.length;t++){const n=h[t],s=fi[n],d=r[n]??i,f={key:`state-${n}`,d:s.path,fill:d,stroke:l,"stroke-width":String(a),"stroke-linejoin":"round","data-state":n,role:"img","aria-label":s.name,style:{cursor:c?"pointer":"default"}};if(c){const e=n;f.onClick=()=>g(e),f.onKeyDown=t=>{"Enter"!==t.key&&" "!==t.key||g(e)},f.tabindex=0,f.role="button",f["aria-label"]=s.name}const u=n;f.onMouseOver=e=>x(u,e),f.onMouseOut=e=>m(u,e),e.push(o("path",f))}return e},[h,r,i,l,a,c,g,x,m]),b=o("title",{key:"map-title"},p);return o("svg",{width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p,style:{fontFamily:"sans-serif"}},b,...y)}function pi(e){const t=e.replace("#",""),n=3===t.length?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,o=parseInt(n,16);return{r:o>>16&255,g:o>>8&255,b:255&o}}function hi(e,t){if(0===t.length)return"#000000";if(1===t.length)return t[0];const n=Math.max(0,Math.min(1,e)),o=t.length-1,r=Math.min(Math.floor(n*o),o-1),i=n*o-r,l=pi(t[r]),a=pi(t[r+1]);return function(e,t,n){const o=e=>{const t=Math.max(0,Math.min(255,Math.round(e))).toString(16);return 1===t.length?"0"+t:t};return`#${o(e)}${o(t)}${o(n)}`}(l.r+(a.r-l.r)*i,l.g+(a.g-l.g)*i,l.b+(a.b-l.b)*i)}function gi(e){const{r:t,g:n,b:o}=pi(e);return(.299*t+.587*n+.114*o)/255}const xi=["#3b82f6","#fbbf24","#ef4444"];function mi(e){const{data:t=[],rowLabels:n,columnLabels:r,width:i=600,height:l=400,colorScale:a=xi,minValue:c,maxValue:f,showValues:u=!1,cellBorderColor:p="#fff",cellBorderWidth:h=1,title:g,padding:x=60}=e,m=t.length,y=d(()=>{let e=0;for(const n of t)n.length>e&&(e=n.length);return e},[t]),{minVal:b,maxVal:v}=d(()=>{let e=c??1/0,n=f??-1/0;for(const o of t)for(const t of o)void 0===c&&t<e&&(e=t),void 0===f&&t>n&&(n=t);return e===1/0&&(e=0),n===-1/0&&(n=1),e===n&&(n=e+1),{minVal:e,maxVal:n}},[t,c,f]),w=g?30:0,k=n?x:20,S=y>0?(i-k-20)/y:0,$=m>0?(l-w-(r?x:20)-20)/m:0,M=s(()=>{const e=[];for(let n=0;n<m;n++){const r=t[n];for(let t=0;t<y;t++){const i=t<r.length?r[t]:0,l=hi((i-b)/(v-b),a),s=k+t*S,d=w+20+n*$;if(e.push(o("rect",{key:`cell-${n}-${t}`,x:String(s),y:String(d),width:String(S),height:String($),fill:l,stroke:p,"stroke-width":String(h)})),u){const r=gi(l)>.5?"#111827":"#ffffff";e.push(o("text",{key:`val-${n}-${t}`,x:String(s+S/2),y:String(d+$/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.min(11,.3*S,.4*$)),"font-family":"sans-serif",fill:r},String(Math.round(100*i)/100)))}}}return e},[t,m,y,b,v,a,S,$,k,w,u,p,h]),z=s(()=>{const e=[];if(n)for(let t=0;t<m;t++){const r=t<n.length?n[t]:"",i=w+20+t*$+$/2;e.push(o("text",{key:`row-label-${t}`,x:String(k-8),y:String(i),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},r))}if(r)for(let t=0;t<y;t++){const n=t<r.length?r[t]:"",i=k+t*S+S/2,l=w+20+m*$+16;e.push(o("text",{key:`col-label-${t}`,x:String(i),y:String(l),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},n))}return e},[n,r,m,y,S,$,k,w]),C=s(()=>g?[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"},g)]:[],[g,i]);if(0===m||0===y)return o("svg",{width:"100%",viewBox:`0 0 ${i} ${l}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Heat map — no data"},o("text",{x:String(i/2),y:String(l/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"No data to display."));const I=C(),A=M(),F=z();return o("svg",{width:"100%",viewBox:`0 0 ${i} ${l}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Heat map",style:{fontFamily:"sans-serif"}},...I,...A,...F)}function yi(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function bi(e){const{data:t=[],bins:n=10,width:r=600,height:i=400,barColor:l="#3b82f6",barGap:a=2,showGrid:c=!0,showValues:f=!0,title:u,xLabel:p,yLabel:h,padding:g=60}=e,x=Math.max(1,Math.round(n)),m=d(()=>function(e,t){if(0===e.length)return[];let n=e[0],o=e[0];for(let t=1;t<e.length;t++){const r=e[t];r<n&&(n=r),r>o&&(o=r)}if(n===o)return[{min:n,max:o+1,count:e.length}];const r=(o-n)/t,i=[];for(let e=0;e<t;e++)i.push({min:n+e*r,max:n+(e+1)*r,count:0});for(let o=0;o<e.length;o++){const l=e[o];let a=Math.floor((l-n)/r);a>=t&&(a=t-1),i[a].count++}return i}(t,x),[t,x]),y=d(()=>{let e=0;for(let t=0;t<m.length;t++)m[t].count>e&&(e=m[t].count);return e>0?e:1},[m]),b=r-2*g,v=i-2*g,w=s(()=>{if(!c)return[];const e=function(e){if(e<=0)return 1;const t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),o=t/n;return o<=1.5?n:o<=3.5?2*n:o<=7.5?5*n:10*n}(y),t=[];for(let n=e;n<=y;n+=e){const e=g+v-n/y*v;t.push(o("line",{key:`grid-${n}`,x1:String(g),y1:String(e),x2:String(g+b),y2:String(e),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),t.push(o("text",{key:`grid-label-${n}`,x:String(g-8),y:String(e+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(n)))}return t},[c,y,g,b,v]),k=s(()=>{const e=[];return e.push(o("line",{key:"axis-y",x1:String(g),y1:String(g),x2:String(g),y2:String(g+v),stroke:"#374151","stroke-width":"1.5"})),e.push(o("line",{key:"axis-x",x1:String(g),y1:String(g+v),x2:String(g+b),y2:String(g+v),stroke:"#374151","stroke-width":"1.5"})),e},[g,b,v]),S=s(()=>{if(0===m.length)return[];const e=[],t=a*(m.length-1),n=Math.max(1,(b-t)/m.length);for(let t=0;t<m.length;t++){const r=m[t],i=r.count/y*v,s=g+t*(n+a),d=g+v-i;if(e.push(o("rect",{key:`bar-${t}`,x:String(s),y:String(d),width:String(n),height:String(i),fill:l})),f&&r.count>0&&e.push(o("text",{key:`val-${t}`,x:String(s+n/2),y:String(d-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},String(r.count))),m.length<=15||t%2==0||t===m.length-1){const i=(m.length,yi(r.min));e.push(o("text",{key:`xlabel-${t}`,x:String(s+n/2),y:String(g+v+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},i))}}if(m.length>0){const t=m[m.length-1],n=g+b;e.push(o("text",{key:"xlabel-end",x:String(n),y:String(g+v+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},yi(t.max)))}return e},[m,y,a,l,f,g,b,v]),$=s(()=>{const e=[];return u&&e.push(o("text",{key:"title",x:String(r/2),y:String(g/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},u)),p&&e.push(o("text",{key:"x-label",x:String(g+b/2),y:String(i-8),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151"},p)),h&&e.push(o("text",{key:"y-label",x:String(14),y:String(g+v/2),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90 14 ${g+v/2})`},h)),e},[u,p,h,r,i,g,b,v]),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]),z=w(),C=k(),I=S(),A=$(),F=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"}},...A,...z,...C,...I,...F)}function vi(e){const{data:t=[],width:n=600,height:r=400,orientation:i="vertical",stemColor:l="#94a3b8",stemWidth:a=2,dotRadius:c=6,dotColor:f="#3b82f6",showGrid:u=!0,showValues:p=!0,title:h,padding:g=60}=e,x="vertical"===i,m=n-2*g,y=r-2*g-(x?30:0),b=x?y:m,v=x?m:y,w=d(()=>{let e=0;for(let n=0;n<t.length;n++)t[n].value>e&&(e=t[n].value);return e>0?e:1},[t]),k=d(()=>0===t.length?0:v/t.length,[t.length,v]),S=s(()=>{if(!u)return[];const e=function(e){if(e<=0)return 1;const t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),o=t/n;return o<=1.5?n:o<=3.5?2*n:o<=7.5?5*n:10*n}(w),t=[];for(let n=e;n<=w;n+=e){const e=n/w*b;if(x){const r=g+y-e;t.push(o("line",{key:`grid-${n}`,x1:String(g),y1:String(r),x2:String(g+m),y2:String(r),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),t.push(o("text",{key:`grid-label-${n}`,x:String(g-8),y:String(r+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(n)))}else{const r=g+e;t.push(o("line",{key:`grid-${n}`,x1:String(r),y1:String(g),x2:String(r),y2:String(g+y),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),t.push(o("text",{key:`grid-label-${n}`,x:String(r),y:String(g+y+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(n)))}}return t},[u,w,x,g,m,y,b]),$=s(()=>{const e=[];return e.push(o("line",{key:"axis-y",x1:String(g),y1:String(g),x2:String(g),y2:String(g+y),stroke:"#374151","stroke-width":"1.5"})),e.push(o("line",{key:"axis-x",x1:String(g),y1:String(g+y),x2:String(g+m),y2:String(g+y),stroke:"#374151","stroke-width":"1.5"})),e},[x,g,m,y]),M=s(()=>{if(0===t.length)return[];const e=[];for(let n=0;n<t.length;n++){const r=t[n],i=r.value/w*b,s=k*n+k/2,d=r.color??f;if(x){const t=g+s,f=g+y,u=g+y-i;e.push(o("line",{key:`stem-${n}`,x1:String(t),y1:String(f),x2:String(t),y2:String(u),stroke:l,"stroke-width":String(a)})),e.push(o("circle",{key:`dot-${n}`,cx:String(t),cy:String(u),r:String(c),fill:d})),p&&e.push(o("text",{key:`val-${n}`,x:String(t),y:String(u-c-4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(r.value)));const h=t,x=g+y+16;e.push(o("text",{key:`cat-${n}`,x:String(h),y:String(x),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${h}, ${x})`},r.label))}else{const t=g+s,f=g,u=g+i;e.push(o("line",{key:`stem-${n}`,x1:String(f),y1:String(t),x2:String(u),y2:String(t),stroke:l,"stroke-width":String(a)})),e.push(o("circle",{key:`dot-${n}`,cx:String(u),cy:String(t),r:String(c),fill:d})),p&&e.push(o("text",{key:`val-${n}`,x:String(u+c+4),y:String(t+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(r.value))),e.push(o("text",{key:`cat-${n}`,x:String(g-8),y:String(t+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},r.label))}}return e},[t,w,k,f,c,l,a,p,x,g,m,y,b]),z=s(()=>h?[o("text",{key:"title",x:String(n/2),y:String(g/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,n,g]),C=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]),I=S(),A=$(),F=M(),R=z(),D=C();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??"Lollipop chart",style:{fontFamily:"sans-serif"}},...R,...I,...A,...F,...D)}function wi(e){const t=e.replace("#",""),n=3===t.length?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,o=parseInt(n,16);return{r:o>>16&255,g:o>>8&255,b:255&o}}function ki(e,t){if(0===t.length)return"#000000";if(1===t.length)return t[0];const n=Math.max(0,Math.min(1,e)),o=t.length-1,r=Math.min(Math.floor(n*o),o-1),i=n*o-r,l=wi(t[r]),a=wi(t[r+1]);return function(e,t,n){const o=e=>{const t=Math.max(0,Math.min(255,Math.round(e))).toString(16);return 1===t.length?"0"+t:t};return`#${o(e)}${o(t)}${o(n)}`}(l.r+(a.r-l.r)*i,l.g+(a.g-l.g)*i,l.b+(a.b-l.b)*i)}function Si(e){const{r:t,g:n,b:o}=wi(e);return(.299*t+.587*n+.114*o)/255}const $i=["#f0f9ff","#3b82f6","#1e3a8a"];function Mi(e){const{data:t=[],labels:n,rowLabels:r,columnLabels:i,width:l=500,height:a=500,colorScale:c=$i,showValues:f=!0,showDiagonal:u=!0,cellBorderColor:p="#e5e7eb",title:h,padding:g=70,symmetric:x=!1}=e,m=r??n,y=i??n,b=t.length,v=d(()=>{let e=0;for(const n of t)n.length>e&&(e=n.length);return e},[t]),w=d(()=>{if(!x||0===b)return t;const e=[],n=Math.max(b,v);for(let o=0;o<n;o++){const r=[];for(let e=0;e<n;e++){const n=t[o],i=n&&e<n.length?n[e]:0,l=t[e],a=l&&o<l.length?l[o]:0;0!==i?r.push(i):r.push(a)}e.push(r)}return e},[t,x,b,v]),k=w.length,S=d(()=>{let e=0;for(const t of w)t.length>e&&(e=t.length);return e},[w]),{minVal:$,maxVal:M}=d(()=>{let e=1/0,t=-1/0;for(const n of w)for(const o of n)o<e&&(e=o),o>t&&(t=o);return e===1/0&&(e=0),t===-1/0&&(t=1),e===t&&(t=e+1),{minVal:e,maxVal:t}},[w]),z=h?30:0,C=m?g:20,I=S>0?(l-C-20)/S:0,A=k>0?(a-z-(y?g:20)-20)/k:0,F=s(()=>{const e=[];for(let t=0;t<k;t++){const n=w[t];for(let r=0;r<S;r++){const i=r<n.length?n[r]:0,l=ki((i-$)/(M-$),c),a=C+r*I,s=z+20+t*A,d=t===r,h=d&&u?"currentColor":p,g=d&&u?"2":"1";if(e.push(o("rect",{key:`cell-${t}-${r}`,x:String(a),y:String(s),width:String(I),height:String(A),fill:l,stroke:h,"stroke-width":g})),f){const n=Si(l)>.5?"#111827":"#ffffff",c=Math.min(12,.3*I,.35*A);e.push(o("text",{key:`val-${t}-${r}`,x:String(a+I/2),y:String(s+A/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.max(8,c)),"font-weight":d&&u?"bold":"normal","font-family":"sans-serif",fill:n},String(Math.round(100*i)/100)))}}}return e},[w,k,S,$,M,c,I,A,C,z,f,u,p]),R=s(()=>{const e=[];if(m)for(let t=0;t<k;t++){const n=t<m.length?m[t]:"",r=z+20+t*A+A/2;e.push(o("text",{key:`row-label-${t}`,x:String(C-8),y:String(r),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},n))}if(y)for(let t=0;t<S;t++){const n=t<y.length?y[t]:"",r=C+t*I+I/2,i=z+20+k*A+12;e.push(o("text",{key:`col-label-${t}`,x:String(r),y:String(i),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},n))}return e},[m,y,k,S,I,A,C,z]),D=s(()=>h?[o("text",{key:"title",x:String(l/2),y:"22","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},h)]:[],[h,l]);if(0===k||0===S)return o("svg",{width:"100%",viewBox:`0 0 ${l} ${a}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Matrix — no data"},o("text",{x:String(l/2),y:String(a/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"No data to display."));const L=D(),W=F(),N=R();return o("svg",{width:"100%",viewBox:`0 0 ${l} ${a}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Matrix visualization",style:{fontFamily:"sans-serif"}},...L,...W,...N)}const zi=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Ci(e){if(!e.children||0===e.children.length)return Math.max(0,e.value??0);let t=0;const n=[e];for(;n.length>0;){const e=n.pop();if(e.children&&0!==e.children.length)for(let t=e.children.length-1;t>=0;t--)n.push(e.children[t]);else t+=Math.max(0,e.value??0)}return t}function Ii(e){const{data:t,width:n=600,height:r=400,orientation:i="horizontal",showLabels:l=!0,showValues:a=!0,colors:s=zi,borderColor:c="#ffffff",borderWidth:f=1,title:u,padding:p=10}=e,h=u?30:0,g=p,x=p+h,m=n-2*p,y=r-2*p-h;if(d(()=>Ci(t),[t])<=0||m<=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":u??"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"));const b=d(()=>function(e,t,n,o,r,i,l){const a=[];if(Ci(e)<=0)return a;const s=function(e){let t=0;const n=[{node:e,depth:0}];for(;n.length>0;){const{node:e,depth:o}=n.pop();if(o>t&&(t=o),e.children)for(let t=e.children.length-1;t>=0;t--)n.push({node:e.children[t],depth:o+1})}return t}(e)+1,d="horizontal"===i,c=d?r/s:o/s,f=[];for(f.push({node:e,depth:0,spanStart:d?t:n,spanEnd:d?t+o:n+r,colorIndex:0});f.length>0;){const e=f.shift(),{node:o,depth:r,spanStart:i,spanEnd:s,colorIndex:u}=e,p=Ci(o);if(p<=0)continue;const h=s-i;let g,x,m,y;if(d?(g=i,x=n+r*c,m=h,y=c):(g=t+r*c,x=i,m=c,y=h),a.push({x:g,y:x,w:m,h:y,label:o.label,value:p,color:o.color??l[u%l.length],depth:r}),o.children&&o.children.length>0){let e=i;for(let t=0;t<o.children.length;t++){const n=o.children[t],i=Ci(n);if(i<=0)continue;const l=i/p*h;f.push({node:n,depth:r+1,spanStart:e,spanEnd:e+l,colorIndex:0===r?t:u}),e+=l}}}return a}(t,g,x,m,y,i,s),[t,g,x,m,y,i,s]),v=[];u&&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"},u));for(let e=0;e<b.length;e++){const t=b[e];if(v.push(o("rect",{key:`cell-${e}`,x:String(t.x),y:String(t.y),width:String(Math.max(0,t.w)),height:String(Math.max(0,t.h)),fill:t.color,stroke:c,"stroke-width":String(f),role:"graphics-symbol","aria-label":`${t.label}: ${t.value}`})),l&&t.w>20&&t.h>14){const n=Math.floor(t.w/7),r=t.label.length>n?t.label.substring(0,Math.max(1,n-2))+"..":t.label;v.push(o("text",{key:`label-${e}`,x:String(t.x+t.w/2),y:String(t.y+t.h/2+(a?-2:4)),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},r))}a&&t.w>30&&t.h>28&&v.push(o("text",{key:`value-${e}`,x:String(t.x+t.w/2),y:String(t.y+t.h/2+12),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(t.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":u??"Partition diagram",style:{fontFamily:"sans-serif"}},...v)}function Ai(e,t){const n=[];for(const o of t)n.push(String(e[o]??""));return n.join(" | ")}function Fi(e,t){const n=new Set;for(const o of e)n.add(Ai(o,t));const o=Array.from(n);return o.sort(),o}function Ri(e,t){if(0===e.length)return 0;switch(t){case"count":return e.length;case"sum":{let t=0;for(const n of e)t+=n;return t}case"avg":{let t=0;for(const n of e)t+=n;return t/e.length}case"min":{let t=e[0];for(let n=1;n<e.length;n++)e[n]<t&&(t=e[n]);return t}case"max":{let t=e[0];for(let n=1;n<e.length;n++)e[n]>t&&(t=e[n]);return t}}}function Di(e){return Number.isInteger(e)?String(e):e.toFixed(2)}function Li(e){const{data:t=[],rows:n=[],columns:r=[],values:i=[],aggregation:l="sum",width:a=600,height:s=400,showTotals:c=!0,title:f,headerColor:u="#3b82f6",cellPadding:p=8}=e;if(0===t.length||0===n.length&&0===r.length||0===i.length)return o("svg",{width:"100%",viewBox:`0 0 ${a} ${s}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"table","aria-label":f??"Empty pivot table"},o("text",{x:String(a/2),y:String(s/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.4"},"No data to display"));const h=d(()=>function(e,t,n,o,r){const i=Fi(e,t),l=Fi(e,n),a=new Map;for(const r of e){const e=`${Ai(r,t)}::${Ai(r,n)}`;a.has(e)||a.set(e,[]);const i=a.get(e);let l=0;for(const e of o){const t=r[e];if("number"==typeof t)l+=t;else if("string"==typeof t){const e=parseFloat(t);isNaN(e)||(l+=e)}}i.push(l)}const s=new Map;for(const[e,t]of a)s.set(e,Ri(t,r));const d=new Map;for(const e of i){const t=[];for(const n of l){const o=s.get(`${e}::${n}`);void 0!==o&&t.push(o)}d.set(e,Ri(t,"count"===r?"sum":r))}const c=new Map;for(const e of l){const t=[];for(const n of i){const o=s.get(`${n}::${e}`);void 0!==o&&t.push(o)}c.set(e,Ri(t,"count"===r?"sum":r))}const f=[];for(const e of d.values())f.push(e);return{rowKeys:i,colKeys:l,cells:s,rowTotals:d,colTotals:c,grandTotal:Ri(f,"count"===r?"sum":r)}}(t,n,r,i,l),[t,n,r,i,l]),{rowKeys:g,colKeys:x,cells:m,rowTotals:y,colTotals:b,grandTotal:v}=h,w=f?30:0,k=x.length+(c?1:0),S=g.length+(c?1:0),$=1+k,M=1+S,z=Math.max(40,(a-2*p)/$),C=Math.max(20,Math.min(36,(s-w-2*p)/M)),I=z*$,A=C*M,F=Math.max(0,(a-I)/2),R=w+Math.max(0,(s-w-A)/2),D=[];f&&D.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"},f)),D.push(o("rect",{key:"header-row-bg",x:String(F),y:String(R),width:String(I),height:String(C),fill:u})),D.push(o("rect",{key:"header-col-bg",x:String(F),y:String(R+C),width:String(z),height:String(C*S),fill:u,opacity:"0.85"})),D.push(o("text",{key:"corner",x:String(F+z/2),y:String(R+C/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},l.toUpperCase()));for(let e=0;e<x.length;e++){const t=F+(e+1)*z,n=Math.floor(z/7),r=x[e],i=r.length>n?r.substring(0,Math.max(1,n-2))+"..":r;D.push(o("text",{key:`ch-${e}`,x:String(t+z/2),y:String(R+C/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},i))}c&&D.push(o("text",{key:"ch-total",x:String(F+(x.length+1)*z+z/2),y:String(R+C/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},"Total"));for(let e=0;e<g.length;e++){const t=g[e],n=R+(e+1)*C;e%2==0&&D.push(o("rect",{key:`row-bg-${e}`,x:String(F+z),y:String(n),width:String(z*k),height:String(C),fill:"#f9fafb"}));const r=Math.floor(z/7),i=t.length>r?t.substring(0,Math.max(1,r-2))+"..":t;D.push(o("text",{key:`rh-${e}`,x:String(F+z/2),y:String(n+C/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},i));for(let r=0;r<x.length;r++){const i=`${t}::${x[r]}`,l=m.get(i),a=F+(r+1)*z;D.push(o("rect",{key:`border-${e}-${r}`,x:String(a),y:String(n),width:String(z),height:String(C),fill:"none",stroke:"#e5e7eb","stroke-width":"0.5"})),D.push(o("text",{key:`cell-${e}-${r}`,x:String(a+z/2),y:String(n+C/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},void 0!==l?Di(l):"-"))}if(c){const r=F+(x.length+1)*z,i=y.get(t)??0;D.push(o("rect",{key:`rt-bg-${e}`,x:String(r),y:String(n),width:String(z),height:String(C),fill:"#eff6ff"})),D.push(o("text",{key:`rt-${e}`,x:String(r+z/2),y:String(n+C/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},Di(i)))}}if(c){const e=R+(g.length+1)*C;D.push(o("rect",{key:"total-row-bg",x:String(F),y:String(e),width:String(I),height:String(C),fill:"#eff6ff"})),D.push(o("text",{key:"total-label",x:String(F+z/2),y:String(e+C/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},"Total"));for(let t=0;t<x.length;t++){const n=x[t],r=b.get(n)??0,i=F+(t+1)*z;D.push(o("text",{key:`ct-${t}`,x:String(i+z/2),y:String(e+C/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},Di(r)))}const t=F+(x.length+1)*z;D.push(o("text",{key:"grand-total",x:String(t+z/2),y:String(e+C/2+4),"text-anchor":"middle","font-size":"12","font-family":"sans-serif","font-weight":"bold",fill:"#1e3a8a"},Di(v)))}return D.push(o("rect",{key:"outer-border",x:String(F),y:String(R),width:String(I),height:String(A),fill:"none",stroke:"#d1d5db","stroke-width":"1"})),o("svg",{width:"100%",viewBox:`0 0 ${a} ${s}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"table","aria-label":f??"Pivot table",style:{fontFamily:"sans-serif"}},...D)}function Wi(e,t){return 2*Math.PI*e/t-Math.PI/2}function Ni(e,t,n,o){return{x:e+n*Math.cos(o),y:t+n*Math.sin(o)}}function Ei(e){const{axes:t=[],series:n=[],width:r=500,height:i=500,levels:l=5,showLabels:a=!0,showValues:c=!1,showLegend:f=!0,showDots:u=!0,gridColor:p="#d1d5db",title:h}=e,g=t.length,x=h?30:0,m=f&&n.length>0?30:0,y=Math.min((r-120)/2,(i-120-x-m)/2),b=r/2,v=60+x+y,w=d(()=>{const e=[];for(let o=0;o<g;o++){const r=t[o]?.max;if(void 0!==r&&r>0){e.push(r);continue}let i=0;for(const e of n){const t=e.values[o];void 0!==t&&t>i&&(i=t)}e.push(i>0?i:1)}return e},[t,n,g]),k=s(()=>{if(g<3)return[];const e=[];for(let t=1;t<=l;t++){const n=y*t/l,r=[];for(let e=0;e<g;e++){const t=Wi(e,g),o=Ni(b,v,n,t);r.push(`${o.x},${o.y}`)}e.push(o("polygon",{key:`ring-${t}`,points:r.join(" "),fill:"none",stroke:p,"stroke-width":t===l?"1.5":"0.5","stroke-dasharray":t===l?"none":"3 2"}))}for(let t=0;t<g;t++){const n=Wi(t,g),r=Ni(b,v,y,n);e.push(o("line",{key:`spoke-${t}`,x1:String(b),y1:String(v),x2:String(r.x),y2:String(r.y),stroke:p,"stroke-width":"0.75"}))}return e},[g,l,y,b,v,p]),S=s(()=>{if(!a||g<3)return[];const e=[];for(let n=0;n<g;n++){const r=Wi(n,g),i=Ni(b,v,y+16,r);let l="middle";i.x<b-5?l="end":i.x>b+5&&(l="start");const a=Math.abs(i.y-v)<5?"0.35em":i.y<v?"0em":"0.7em";e.push(o("text",{key:`label-${n}`,x:String(i.x),y:String(i.y),"text-anchor":l,dy:a,"font-size":"12","font-family":"sans-serif",fill:"currentColor"},t[n]?.label??`Axis ${n}`))}return e},[a,g,t,y,b,v]),$=s(()=>{if(g<3||0===n.length)return[];const e=[];for(let t=0;t<n.length;t++){const r=n[t],i=[],l=[],a=[];for(let e=0;e<g;e++){const n=r.values[e]??0,s=w[e],d=Math.min(n/s,1),f=y*d,p=Wi(e,g),h=Ni(b,v,f,p);i.push(`${h.x},${h.y}`),u&&l.push(o("circle",{key:`dot-${t}-${e}`,cx:String(h.x),cy:String(h.y),r:"3.5",fill:r.color,stroke:"#fff","stroke-width":"1.5"})),c&&a.push(o("text",{key:`val-${t}-${e}`,x:String(h.x),y:String(h.y-8),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:r.color},String(Math.round(100*n)/100)))}e.push(o("polygon",{key:`series-fill-${t}`,points:i.join(" "),fill:r.color,"fill-opacity":String(r.fillOpacity??.15),stroke:"none"})),e.push(o("polygon",{key:`series-line-${t}`,points:i.join(" "),fill:"none",stroke:r.color,"stroke-width":"2","stroke-linejoin":"round"}));for(const t of l)e.push(t);for(const t of a)e.push(t)}return e},[g,n,w,y,b,v,u,c]),M=s(()=>{if(!f||0===n.length)return[];const e=[],t=v+y+40,r=100*n.length,i=b-r/2;for(let r=0;r<n.length;r++){const l=n[r],a=i+100*r;e.push(o("rect",{key:`legend-swatch-${r}`,x:String(a),y:String(t),width:"12",height:"12",rx:"2",fill:l.color})),e.push(o("text",{key:`legend-text-${r}`,x:String(a+16),y:String(t+10),"font-size":"12","font-family":"sans-serif",fill:"currentColor"},l.label))}return e},[f,n,b,v,y]),z=s(()=>h?[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"},h)]:[],[h,r]);if(g<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":h??"Radar chart — 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."));const C=k(),I=S(),A=$(),F=M(),R=z();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Radar chart",style:{fontFamily:"sans-serif"}},...R,...C,...I,...A,...F)}const Ti=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Pi(e){const{nodes:t,links:n,width:r=800,height:i=500,nodeWidth:l=20,nodePadding:a=10,showLabels:c=!0,showValues:f=!1,linkOpacity:u=.4,colors:p=Ti,title:h,padding:g=40}=e;if(!t||0===t.length)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"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"));const x=d(()=>function(e,t,n,o,r,i,l,a){if(0===e.length)return{layoutNodes:[],layoutLinks:[]};const s=n-2*l,d=o-2*l,c=t.filter(e=>e.value>0),f=e.map(e=>e.id),u=function(e,t){const n=new Map,o=new Map,r=new Map;for(const t of e)o.set(t,new Set),r.set(t,[]);for(const e of t){if(e.value<=0)continue;const t=o.get(e.target);t&&t.add(e.source);const n=r.get(e.source);n&&n.push(e.target)}const i=[];for(const t of e)0===o.get(t).size&&(n.set(t,0),i.push(t));if(0===i.length){for(const t of e)n.set(t,0);return n}let l=0;for(;l<i.length;){const e=i[l];l++;const t=n.get(e),o=r.get(e)??[];for(const e of o){const o=n.get(e),r=t+1;(void 0===o||r>o)&&n.set(e,r),i.includes(e)||i.push(e)}}for(const t of e)n.has(t)||n.set(t,0);return n}(f,c),p=new Map,h=new Map;for(const e of f)p.set(e,0),h.set(e,0);for(const e of c)h.set(e.source,(h.get(e.source)??0)+e.value),p.set(e.target,(p.get(e.target)??0)+e.value);let g=0;for(const e of u.values())e>g&&(g=e);const x=new Map;for(let e=0;e<=g;e++)x.set(e,[]);for(const[e,t]of u)x.get(t).push(e);const m=new Map,y=g>0?(s-r)/g:0;for(let e=0;e<=g;e++)m.set(e,l+e*y);const b=new Map;for(let t=0;t<e.length;t++)b.set(e[t].id,e[t]);const v=[],w=new Map;for(let t=0;t<=g;t++){const n=x.get(t);if(0===n.length)continue;let o=0;for(const e of n){const t=p.get(e)??0,n=h.get(e)??0;o+=Math.max(t,n,1)}const r=d-i*(n.length-1),s=o>0?r/o:1;let c=l;for(let o=0;o<n.length;o++){const r=n[o],l=b.get(r),d=p.get(r)??0,f=h.get(r)??0,u=Math.max(d,f,1),g=Math.max(4,u*s),x=e.findIndex(e=>e.id===r),y={id:r,label:l.label,color:l.color??a[x%a.length],column:t,x:m.get(t),y:c,height:g,totalIn:d,totalOut:f,totalValue:u};v.push(y),w.set(r,y),c+=g+i}}const k=new Map,S=new Map;for(const e of f)k.set(e,0),S.set(e,0);const $=[...c].sort((e,t)=>t.value-e.value),M=[];for(const e of $){const t=w.get(e.source),n=w.get(e.target);if(!t||!n)continue;const o=t.totalOut||1,r=n.totalIn||1,i=e.value/o*t.height,l=e.value/r*n.height,a=Math.max(1,(i+l)/2),s=k.get(e.source),d=S.get(e.target),c=t.y+s+i/2,f=n.y+d+l/2;k.set(e.source,s+i),S.set(e.target,d+l);const u=b.get(e.source);M.push({source:e.source,target:e.target,value:e.value,color:e.color??u?.color??t.color,sourceY:c,targetY:f,width:a})}return{layoutNodes:v,layoutLinks:M}}(t,n,r,i,l,a,g,p),[t,n,r,i,l,a,g,p]),m=s(()=>{const e=[];for(let t=0;t<x.layoutLinks.length;t++){const n=x.layoutLinks[t],r=x.layoutNodes.find(e=>e.id===n.source),i=x.layoutNodes.find(e=>e.id===n.target);if(!r||!i)continue;const a=r.x+l,s=i.x,d=(a+s)/2,c=`M ${a} ${n.sourceY} C ${d} ${n.sourceY}, ${d} ${n.targetY}, ${s} ${n.targetY}`;e.push(o("path",{key:`link-${t}`,d:c,fill:"none",stroke:n.color,"stroke-width":String(Math.max(1,n.width)),"stroke-opacity":String(u),"stroke-linecap":"butt"})),f&&n.value>0&&e.push(o("text",{key:`link-val-${t}`,x:String(d),y:String((n.sourceY+n.targetY)/2-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280","pointer-events":"none"},String(n.value)))}return e},[x,l,u,f]),y=s(()=>{const e=[];for(let t=0;t<x.layoutNodes.length;t++){const n=x.layoutNodes[t];if(e.push(o("rect",{key:`node-${n.id}`,x:String(n.x),y:String(n.y),width:String(l),height:String(n.height),fill:n.color,stroke:"#374151","stroke-width":"0.5",role:"img","aria-label":`${n.label}: ${n.totalValue}`})),c){const t=x.layoutNodes.reduce((e,t)=>Math.max(e,t.column),0),r=n.column===t,i=r?n.x+l+6:n.x-6,a=r?"start":"end",s=0===n.column,d=s?n.x-6:i,c=s?"end":a;e.push(o("text",{key:`label-${n.id}`,x:String(d),y:String(n.y+n.height/2+4),"text-anchor":c,"font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},n.label))}}return e},[x,l,c]),b=s(()=>h?[o("text",{key:"title",x:String(r/2),y:String(g/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,r,g]),v=m(),w=y(),k=b();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Sankey diagram",style:{fontFamily:"sans-serif"}},...k,...v,...w)}const Bi=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],_i=2*Math.PI;function Hi(e){if(!e.children||0===e.children.length)return Math.max(0,e.value??0);let t=0;const n=[e];for(;n.length>0;){const e=n.pop();if(e.children&&0!==e.children.length)for(let t=e.children.length-1;t>=0;t--)n.push(e.children[t]);else t+=Math.max(0,e.value??0)}return t}function Yi(e,t,n,o,r,i){const l=i-r,a=l>Math.PI?1:0,s=r-Math.PI/2,d=i-Math.PI/2,c=e+o*Math.cos(s),f=t+o*Math.sin(s),u=e+o*Math.cos(d),p=t+o*Math.sin(d),h=e+n*Math.cos(d),g=t+n*Math.sin(d),x=e+n*Math.cos(s),m=t+n*Math.sin(s);if(l>=_i-.001){const r=s+Math.PI;return[`M ${c} ${f}`,`A ${o} ${o} 0 1 1 ${e+o*Math.cos(r)} ${t+o*Math.sin(r)}`,`A ${o} ${o} 0 1 1 ${c} ${f}`,`L ${x} ${m}`,`A ${n} ${n} 0 1 0 ${e+n*Math.cos(r)} ${t+n*Math.sin(r)}`,`A ${n} ${n} 0 1 0 ${x} ${m}`,"Z"].join(" ")}return[`M ${c} ${f}`,`A ${o} ${o} 0 ${a} 1 ${u} ${p}`,`L ${h} ${g}`,`A ${n} ${n} 0 ${a} 0 ${x} ${m}`,"Z"].join(" ")}function ji(e){const{data:t,width:n=500,height:r=500,innerRadius:i=40,showLabels:l=!0,colors:a=Bi,strokeColor:s="#ffffff",strokeWidth:c=1,title:f}=e,u=n/2,p=r/2,h=f?20:0,g=Math.min(u,p-h)-10;if(d(()=>Hi(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":f??"Empty sunburst chart"},o("text",{x:String(u),y:String(p),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));const x=d(()=>function(e,t,n,o){const r=[],i=Hi(e);if(i<=0)return r;const l=function(e){let t=0;const n=[{node:e,depth:0}];for(;n.length>0;){const{node:e,depth:o}=n.pop();if(o>t&&(t=o),e.children)for(let t=e.children.length-1;t>=0;t--)n.push({node:e.children[t],depth:o+1})}return t}(e),a=l>0?(n-t)/(l+1):n-t,s=[];if(!(e.children&&e.children.length>0))return r.push({startAngle:0,endAngle:_i,innerR:t,outerR:t+a,label:e.label,value:i,color:e.color??o[0],depth:0}),r;{let t=0;for(let n=0;n<e.children.length;n++){const o=e.children[n],r=Hi(o);if(r<=0)continue;const l=r/i*_i;s.push({node:o,startAngle:t,endAngle:t+l,depth:0,colorIndex:n}),t+=l}}for(;s.length>0;){const e=s.shift(),{node:n,startAngle:i,endAngle:l,depth:d,colorIndex:c}=e,f=Hi(n);if(f<=0)continue;const u=t+d*a,p=u+a;if(r.push({startAngle:i,endAngle:l,innerR:u,outerR:p,label:n.label,value:f,color:n.color??o[c%o.length],depth:d}),n.children&&n.children.length>0){let e=i;const t=l-i;for(let o=0;o<n.children.length;o++){const r=n.children[o],i=Hi(r);if(i<=0)continue;const l=i/f*t;s.push({node:r,startAngle:e,endAngle:e+l,depth:d+1,colorIndex:c}),e+=l}}}return r}(t,i,g,a),[t,i,g,a]),m=[];f&&m.push(o("text",{key:"title",x:String(u),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},f));const y=p+h/2;for(let e=0;e<x.length;e++){const t=x[e],n=Yi(u,y,t.innerR,t.outerR,t.startAngle,t.endAngle);if(m.push(o("path",{key:`arc-${e}`,d:n,fill:t.color,stroke:s,"stroke-width":String(c),role:"graphics-symbol","aria-label":`${t.label}: ${t.value}`})),l){const n=t.endAngle-t.startAngle,r=t.startAngle+n/2-Math.PI/2,i=(t.innerR+t.outerR)/2,l=t.outerR-t.innerR,a=n*i;if(a>20&&l>14){const n=u+i*Math.cos(r),s=y+i*Math.sin(r),d=Math.floor(Math.min(a,l)/7),c=t.label.length>d?t.label.substring(0,Math.max(1,d-1))+"..":t.label;m.push(o("text",{key:`label-${e}`,x:String(n),y:String(s+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},c))}}}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":f??"Sunburst chart",style:{fontFamily:"sans-serif"}},...m)}const qi=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Oi(e){if(!e.children||0===e.children.length)return Math.max(0,e.value);let t=0;const n=[e];for(;n.length>0;){const e=n.pop();if(e.children&&0!==e.children.length)for(let t=e.children.length-1;t>=0;t--)n.push(e.children[t]);else t+=Math.max(0,e.value)}return t}function Ui(e,t){if(0===e.length||t<=0)return 1/0;let n=0;for(const t of e)n+=t;if(n<=0)return 1/0;const o=n/t;let r=0;for(const t of e){if(t<=0)continue;const e=t/o,n=Math.max(e/o,o/e);n>r&&(r=n)}return r}function Xi(e){const{data:t,width:n=600,height:r=400,showLabels:i=!0,showValues:l=!0,colors:a=qi,borderColor:s="#ffffff",borderWidth:c=2,padding:f=2,title:u}=e,p=u?30:0,h=f,g=f+p,x=n-2*f,m=r-2*f-p;if(d(()=>Oi(t),[t])<=0||x<=0||m<=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 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"));const y=d(()=>function(e,t,n,o,r,i){const l=[],a=[],s=Oi(e);if(s<=0||o<=0||r<=0)return l;const d=e.children&&e.children.length>0?e.children:[e],c=o*r,f=[];for(let e=0;e<d.length;e++){const t=d[e],n=Oi(t);n<=0||f.push({label:t.label,value:n,area:n/s*c,color:t.color??i[e%i.length],node:t})}for(f.sort((e,t)=>t.area-e.area),a.push({nodes:f,rect:{x:t,y:n,w:o,h:r},depth:0});a.length>0;){const e=a.shift(),{nodes:t,rect:n,depth:o}=e;if(0===t.length)continue;let r={...n},s=0;for(;s<t.length&&r.w>0&&r.h>0;){const e=r.w>=r.h,n=e?r.h:r.w,d=[],c=[];d.push(t[s]),c.push(t[s].area),s++;let f=Ui(c,n);for(;s<t.length;){const e=Ui([...c,t[s].area],n);if(e>f)break;d.push(t[s]),c.push(t[s].area),f=e,s++}let u=0;for(const e of c)u+=e;const p=n>0?u/n:0;let h=0;for(let t=0;t<d.length;t++){const n=d[t],s=p>0?n.area/p:0;let c,f,u,g;if(e?(c=r.x,f=r.y+h,u=p,g=s):(c=r.x+h,f=r.y,u=s,g=p),l.push({x:c,y:f,w:u,h:g,label:n.label,value:n.value,color:n.color,depth:o}),n.node.children&&n.node.children.length>0){const e=2,t=c+e,r=f+e+14,l=u-2*e,s=g-2*e-14;if(l>4&&s>4){const e=[],d=n.value,c=l*s;for(let t=0;t<n.node.children.length;t++){const r=n.node.children[t],l=Oi(r);l<=0||e.push({label:r.label,value:l,area:l/d*c,color:r.color??i[(t+o+1)%i.length],node:r})}e.sort((e,t)=>t.area-e.area),a.push({nodes:e,rect:{x:t,y:r,w:l,h:s},depth:o+1})}}h+=s}r=e?{x:r.x+p,y:r.y,w:r.w-p,h:r.h}:{x:r.x,y:r.y+p,w:r.w,h:r.h-p}}}return l}(t,h,g,x,m,a),[t,h,g,x,m,a]),b=[];u&&b.push(o("text",{key:"title",x:String(n/2),y:String(f+16),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},u));for(let e=0;e<y.length;e++){const t=y[e];if(b.push(o("rect",{key:`cell-${e}`,x:String(t.x),y:String(t.y),width:String(Math.max(0,t.w)),height:String(Math.max(0,t.h)),fill:t.color,stroke:s,"stroke-width":String(c),role:"graphics-symbol","aria-label":`${t.label}: ${t.value}`})),i&&t.w>20&&t.h>14){const n=Math.floor(t.w/7),r=t.label.length>n?t.label.substring(0,Math.max(1,n-2))+"..":t.label;b.push(o("text",{key:`label-${e}`,x:String(t.x+4),y:String(t.y+12),"font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},r))}l&&t.w>30&&t.h>28&&b.push(o("text",{key:`value-${e}`,x:String(t.x+4),y:String(t.y+24),"font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(t.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":u??"Treemap chart",style:{fontFamily:"sans-serif"}},...b)}function Vi(e){const t=e.replace("#","");let n,o,r;return 3===t.length?(n=parseInt(t[0]+t[0],16),o=parseInt(t[1]+t[1],16),r=parseInt(t[2]+t[2],16)):(n=parseInt(t.substring(0,2),16),o=parseInt(t.substring(2,4),16),r=parseInt(t.substring(4,6),16)),{r:isNaN(n)?0:n,g:isNaN(o)?0:o,b:isNaN(r)?0:r}}function Gi(e,t){if(0===t.length)return"#3b82f6";if(1===t.length)return t[0];const n=Math.max(0,Math.min(1,e)),o=t.length-1,r=n*o,i=Math.floor(r),l=Math.min(i+1,o),a=r-i,s=Vi(t[i]),d=Vi(t[l]);return function(e,t,n){const o=e=>(e=>Math.max(0,Math.min(255,Math.round(e))))(e).toString(16).padStart(2,"0");return"#"+o(e)+o(t)+o(n)}(s.r+(d.r-s.r)*a,s.g+(d.g-s.g)*a,s.b+(d.b-s.b)*a)}function Ki(e,t){if(e<=0)return 1;const n=e/t,o=Math.pow(10,Math.floor(Math.log10(n))),r=n/o;return r<=1.5?o:r<=3.5?2*o:r<=7.5?5*o:10*o}function Zi(e){const{data:t,vectorFunction:n,width:r=600,height:i=600,gridSize:l=15,xRange:f=[-5,5],yRange:u=[-5,5],arrowScale:p=1,arrowColor:h="#3b82f6",showGrid:g=!0,showAxes:x=!0,colorByMagnitude:m=!1,colorScale:y=["#3b82f6","#8b5cf6","#ef4444"],title:b,padding:v=50,tickFontSize:w=10,arrowWidth:k=1.5,renderer:S="svg",useGPU:$=!1,computeWorker:M}=e,z=Math.max(2,Math.min(50,l)),C=r-2*v,I=i-2*v,A=f[0],F=f[1],R=u[0],D=u[1],L=F-A,W=D-R,N=d(()=>e=>v+(e-A)/L*C,[v,A,L,C]),E=d(()=>e=>v+(D-e)/W*I,[v,D,W,I]),T=d(()=>function(e,t,n,o,r,i,l,a,s,d){if(e&&e.length>0)return e;const c=Math.max(2,Math.min(50,o)),f=s/(c-1),u=d/(c-1);if(n){const e=[];for(let t=0;t<c;t++)for(let n=0;n<c;n++)e.push({x:r+n*f,y:l+t*u});const t=n(e,{gridSize:c,xMin:r,xMax:i,yMin:l,yMax:a}),o=[];for(let n=0;n<e.length;n++){const r=e[n],i=t[n]??{dx:0,dy:0},l=Math.sqrt(i.dx*i.dx+i.dy*i.dy);o.push({x:r.x,y:r.y,dx:i.dx,dy:i.dy,magnitude:l})}return o}if(!t)return[];const p=[];for(let e=0;e<c;e++)for(let n=0;n<c;n++){const o=r+n*f,i=l+e*u,a=t(o,i),s=Math.sqrt(a.dx*a.dx+a.dy*a.dy);p.push({x:o,y:i,dx:a.dx,dy:a.dy,magnitude:s})}return p}(t,n,M,z,A,F,R,D,L,W),[t,n,M,z,A,F,R,D,L,W]),P=d(()=>{let e=0;for(let t=0;t<T.length;t++){const n=T[t],o=n.magnitude??Math.sqrt(n.dx*n.dx+n.dy*n.dy);o>e&&(e=o)}return e>0?e:1},[T]),B=d(()=>Math.min(C,I)/Math.max(z,2)/(2*P)*p,[C,I,z,P,p]);if("canvas"===S){const e=c(null),t=c(0);return a(()=>{const n=e.current;if(!n)return;const o=n.getContext("2d");return o?(t.current&&cancelAnimationFrame(t.current),t.current=requestAnimationFrame(()=>{!function(e,t,n,o,r){const{padding:i,chartWidth:l,chartHeight:a,xMin:s,xMax:d,yMin:c,yMax:f,xSpan:u,ySpan:p,showGrid:h,showAxes:g,colorByMagnitude:x,colorScale:m,arrowColor:y,arrowWidth:b,effectiveArrowScale:v,maxMagnitude:w,title:k,tickFontSize:S}=r,$=e=>i+(e-s)/u*l,M=e=>i+(f-e)/p*a;if(e.clearRect(0,0,t,n),k&&(e.save(),e.font="bold 16px sans-serif",e.fillStyle="#111827",e.textAlign="center",e.textBaseline="middle",e.fillText(k,t/2,i/2+4),e.restore()),h){e.save(),e.strokeStyle="#e5e7eb",e.lineWidth=.5,e.font=`${S}px sans-serif`,e.fillStyle="#6b7280";const t=Ki(u,10);for(let n=Math.ceil(s/t)*t;n<=d;n+=t){const t=$(n);e.beginPath(),e.moveTo(t,i),e.lineTo(t,i+a),e.stroke(),e.textAlign="center",e.textBaseline="top",e.fillText(String(Math.round(100*n)/100),t,i+a+4)}const n=Ki(p,10);for(let t=Math.ceil(c/n)*n;t<=f;t+=n){const n=M(t);e.beginPath(),e.moveTo(i,n),e.lineTo(i+l,n),e.stroke(),e.textAlign="right",e.textBaseline="middle",e.fillText(String(Math.round(100*t)/100),i-6,n)}e.restore()}if(g){if(e.save(),e.strokeStyle="#374151",e.lineWidth=b,c<=0&&f>=0){const t=M(0);e.beginPath(),e.moveTo(i,t),e.lineTo(i+l,t),e.stroke()}if(s<=0&&d>=0){const t=$(0);e.beginPath(),e.moveTo(t,i),e.lineTo(t,i+a),e.stroke()}e.strokeStyle="#d1d5db",e.lineWidth=1,e.strokeRect(i,i,l,a),e.restore()}for(let t=0;t<o.length;t++){const n=o[t],r=n.magnitude??Math.sqrt(n.dx*n.dx+n.dy*n.dy);if(r<1e-10)continue;const i=$(n.x),l=M(n.y),a=n.dx*v,s=-n.dy*v,d=i+a,c=l+s;let f;f=x?Gi(r/w,m):y,e.save(),e.strokeStyle=f,e.lineWidth=b,e.lineCap="round",e.beginPath(),e.moveTo(i,l),e.lineTo(d,c),e.stroke();const u=Math.sqrt(a*a+s*s);if(u>2){const t=a/u,n=s/u,o=-n,r=t,i=Math.min(4,.4*u),l=d-t*i+o*i*.5,p=c-n*i+r*i*.5,h=d-t*i-o*i*.5,g=c-n*i-r*i*.5;e.fillStyle=f,e.beginPath(),e.moveTo(d,c),e.lineTo(l,p),e.lineTo(h,g),e.closePath(),e.fill()}e.restore()}}(o,r,i,T,{padding:v,chartWidth:C,chartHeight:I,xMin:A,xMax:F,yMin:R,yMax:D,xSpan:L,ySpan:W,showGrid:g,showAxes:x,colorByMagnitude:m,colorScale:y,arrowColor:h,arrowWidth:k,effectiveArrowScale:B,maxMagnitude:P,title:b,tickFontSize:w})}),()=>{t.current&&cancelAnimationFrame(t.current)}):void 0},[T,r,i,v,C,I,A,F,R,D,L,W,g,x,m,y,h,k,B,P,b,w]),o("canvas",{ref:e,width:r,height:i,role:"img","aria-label":b??"Vector field plot",style:{fontFamily:"sans-serif",maxWidth:"100%"}})}const _=s(()=>{if(!g)return[];const e=[],t=Ki(L,10);for(let n=Math.ceil(A/t)*t;n<=F;n+=t){const t=N(n);e.push(o("line",{key:`gridv-${n}`,x1:String(t),y1:String(v),x2:String(t),y2:String(v+I),stroke:"#e5e7eb","stroke-width":"0.5"})),e.push(o("text",{key:`xtick-${n}`,x:String(t),y:String(v+I+16),"text-anchor":"middle","font-size":String(w),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(100*n)/100)))}const n=Ki(W,10);for(let t=Math.ceil(R/n)*n;t<=D;t+=n){const n=E(t);e.push(o("line",{key:`gridh-${t}`,x1:String(v),y1:String(n),x2:String(v+C),y2:String(n),stroke:"#e5e7eb","stroke-width":"0.5"})),e.push(o("text",{key:`ytick-${t}`,x:String(v-6),y:String(n+4),"text-anchor":"end","font-size":String(w),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(100*t)/100)))}return e},[g,A,F,R,D,L,W,N,E,v,C,I]),H=s(()=>{if(!x)return[];const e=[];if(R<=0&&D>=0){const t=E(0);e.push(o("line",{key:"axis-x",x1:String(v),y1:String(t),x2:String(v+C),y2:String(t),stroke:"#374151","stroke-width":String(k)}))}if(A<=0&&F>=0){const t=N(0);e.push(o("line",{key:"axis-y",x1:String(t),y1:String(v),x2:String(t),y2:String(v+I),stroke:"#374151","stroke-width":String(k)}))}return e.push(o("rect",{key:"chart-border",x:String(v),y:String(v),width:String(C),height:String(I),fill:"none",stroke:"#d1d5db","stroke-width":"1"})),e},[x,A,F,R,D,N,E,v,C,I]),Y=s(()=>{const e=[];for(let t=0;t<T.length;t++){const n=T[t],r=n.magnitude??Math.sqrt(n.dx*n.dx+n.dy*n.dy);if(r<1e-10)continue;const i=N(n.x),l=E(n.y),a=n.dx*B,s=-n.dy*B,d=i+a,c=l+s;let f;f=m?Gi(r/P,y):h,e.push(o("line",{key:`arrow-line-${t}`,x1:String(i),y1:String(l),x2:String(d),y2:String(c),stroke:f,"stroke-width":String(k),"stroke-linecap":"round"}));const u=Math.sqrt(a*a+s*s);if(u>2){const n=a/u,r=s/u,i=-r,l=n,p=Math.min(4,.4*u),h=d-n*p+i*p*.5,g=c-r*p+l*p*.5,x=d-n*p-i*p*.5,m=c-r*p-l*p*.5;e.push(o("polygon",{key:`arrow-head-${t}`,points:`${d},${c} ${h},${g} ${x},${m}`,fill:f}))}}return e},[T,N,E,B,m,P,y,h]),j=s(()=>b?[o("text",{key:"title",x:String(r/2),y:String(v/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},b)]:[],[b,r,v]),q=_(),O=H(),U=Y(),X=j();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Vector field plot",style:{fontFamily:"sans-serif"}},...X,...q,...O,...U)}function Ji(e){const{data:t=[],width:n=600,height:r=400,increaseColor:i="#10b981",decreaseColor:l="#ef4444",totalColor:a="#3b82f6",connectorColor:c="#94a3b8",showValues:f=!0,showGrid:u=!0,showConnectors:p=!0,title:h,padding:g=60}=e,x=n-2*g,m=r-2*g,y=d(()=>function(e){const t=[];let n=0;for(let o=0;o<e.length;o++){const r=e[o],i=r.type??(r.value>=0?"increase":"decrease");if("total"===i)t.push({label:r.label,value:n,type:"total",start:0,end:n});else{const e=n;n+=r.value,t.push({label:r.label,value:r.value,type:i,start:e,end:n})}}return t}(t),[t]),{minVal:b,maxVal:v}=d(()=>{let e=0,t=0;for(let n=0;n<y.length;n++){const o=y[n];o.start<e&&(e=o.start),o.end<e&&(e=o.end),o.start>t&&(t=o.start),o.end>t&&(t=o.end)}return e===t&&(t=e+1),{minVal:e,maxVal:t}},[y]),w=v-b,k=s(e=>g+m-(e-b)/w*m,[g,m,b,w]),S=d(()=>0===y.length?0:x/y.length,[y.length,x]),$=Math.max(1,S-6),M=s(()=>{if(!u)return[];const e=function(e){if(e<=0)return 1;const t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),o=t/n;return o<=1.5?n:o<=3.5?2*n:o<=7.5?5*n:10*n}(w),t=[];for(let n=Math.ceil(b/e)*e;n<=v;n+=e){const e=k(n);t.push(o("line",{key:`grid-${n}`,x1:String(g),y1:String(e),x2:String(g+x),y2:String(e),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),t.push(o("text",{key:`grid-label-${n}`,x:String(g-8),y:String(e+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(n)))}return t},[u,w,b,v,k,g,x]),z=s(()=>{const e=[];e.push(o("line",{key:"axis-y",x1:String(g),y1:String(g),x2:String(g),y2:String(g+m),stroke:"#374151","stroke-width":"1.5"}));const t=b<=0&&v>=0?k(0):g+m;return e.push(o("line",{key:"axis-x",x1:String(g),y1:String(t),x2:String(g+x),y2:String(t),stroke:"#374151","stroke-width":"1.5"})),e},[g,x,m,b,v,k]),C=s(()=>{if(0===y.length)return[];const e=[];for(let t=0;t<y.length;t++){const n=y[t],r=g+t*S+3,s=Math.max(n.start,n.end),d=Math.min(n.start,n.end),u=k(s),h=k(d),x=Math.max(0,h-u);let b;if(b="total"===n.type?a:"decrease"===n.type?l:i,e.push(o("rect",{key:`bar-${t}`,x:String(r),y:String(u),width:String($),height:String(x),fill:b,rx:"2",ry:"2"})),f){const i="decrease"===n.type||n.value<0?h+14:u-4,l="total"===n.type?String(n.value):(n.value>=0?"+":"")+String(n.value);e.push(o("text",{key:`val-${t}`,x:String(r+$/2),y:String(i),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},l))}if(e.push(o("text",{key:`cat-${t}`,x:String(r+$/2),y:String(g+m+16),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},n.label)),p&&t<y.length-1){const i=y[t+1],l=k(n.end),a=g+(t+1)*S+3;"total"!==i.type&&e.push(o("line",{key:`conn-${t}`,x1:String(r+$),y1:String(l),x2:String(a),y2:String(l),stroke:c,"stroke-width":"1","stroke-dasharray":"3 2"}))}}return e},[y,S,$,k,i,l,a,c,f,p,g,m]),I=s(()=>h?[o("text",{key:"title",x:String(n/2),y:String(g/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,n,g]),A=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]),F=M(),R=z(),D=C(),L=I(),W=A();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??"Waterfall chart",style:{fontFamily:"sans-serif"}},...L,...F,...R,...D,...W)}const Qi=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],el=[0,-45,45,90];function tl(e,t,n,o,r){const i=.6*t,l=e.length*i,a=t,s=n*Math.PI/180,d=Math.abs(Math.cos(s)),c=Math.abs(Math.sin(s)),f=l*d+a*c,u=l*c+a*d;return{x:o-f/2,y:r-u/2,w:f,h:u}}function nl(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 ol(e,t,n){return e.x>=0&&e.y>=0&&e.x+e.w<=t&&e.y+e.h<=n}function rl(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 il(e){const{words:t=[],width:n=600,height:r=400,minFontSize:i=10,maxFontSize:l=64,fontFamily:a="sans-serif",colors:s=Qi,rotations:c=el,padding:f=4,spiral:u="archimedean",title:p}=e,h=d(()=>{if(0===t.length)return[];const e=t.map((e,t)=>({...e,originalIndex:t})).filter(e=>e.text.length>0&&e.weight>0).sort((e,t)=>t.weight-e.weight);if(0===e.length)return[];const o=e[e.length-1].weight,a=e[0].weight-o;function d(e){return 0===a?(i+l)/2:i+(e-o)/a*(l-i)}const p=[],h=n/2,g=r/2;for(let t=0;t<e.length;t++){const o=e[t],i=d(o.weight),l=c[rl(o.text)%c.length],a=o.color??s[t%s.length];let x=!1;const m=500,y="archimedean"===u?4:5;for(let e=0;e<m;e++){let t,s;if("archimedean"===u){const n=.1*e,o=y*n;t=o*Math.cos(n),s=o*Math.sin(n)}else{const n=Math.floor(e/4)+1,o=(e%4==0?0:e)*y;switch(e%4){case 0:t=n*y*4,s=o;break;case 1:t=-o,s=n*y*4;break;case 2:t=-n*y*4,s=-o;break;default:t=o,s=-n*y*4}}const d=h+t,c=g+s,m=tl(o.text,i,l,d,c),b={x:m.x-f,y:m.y-f,w:m.w+2*f,h:m.h+2*f};if(!ol(b,n,r))continue;let v=!1;for(const e of p)if(nl(b,e.bbox)){v=!0;break}if(!v){p.push({text:o.text,x:d,y:c,fontSize:i,rotation:l,color:a,bbox:b}),x=!0;break}}}return p},[t,n,r,i,l,s,c,f,u]);if(0===t.length||0===h.length)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 — 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."));const g=[];p&&g.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 e=0;e<h.length;e++){const t=h[e],n=0!==t.rotation?`translate(${t.x},${t.y}) rotate(${t.rotation})`:`translate(${t.x},${t.y})`;g.push(o("text",{key:`word-${e}`,transform:n,"text-anchor":"middle","dominant-baseline":"central","font-size":String(t.fontSize),"font-family":a,fill:t.color,"aria-label":t.text},t.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}},...g)}const ll={0:"#1e293b",1:"#3b82f6"};function al(e){const{data:t=[],colorMap:n,width:r=600,height:i=600,cellGap:l=1,cellRadius:a=0,showGrid:c=!1,gridColor:f="#334155",showIndices:u=!1,backgroundColor:p="#0f172a",padding:h=10,onCellClick:g,onCellHover:x,title:m}=e,y=n??ll,b=t.length,v=d(()=>{let e=0;for(let n=0;n<t.length;n++){const o=t[n];void 0!==o&&o.length>e&&(e=o.length)}return e},[t]),w=u?20:0,k=m?24:0,S=d(()=>{const e=r-2*h-w,t=i-2*h-w-k;return 0===b||0===v?{cellWidth:0,cellHeight:0}:{cellWidth:Math.max(0,(e-l*(v-1))/v),cellHeight:Math.max(0,(t-l*(b-1))/b)}},[r,i,h,b,v,l,w,k]),$=s(e=>{const t=y[e];return void 0!==t?t:"#666"},[y]),M=s(()=>o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:p}),[r,i,p]),z=s(()=>m?[o("text",{key:"title",x:String(r/2),y:String(h+14),"text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#e2e8f0"},m)]:[],[m,r,h]),C=s(()=>{if(!c||0===b||0===v)return[];const{cellWidth:e,cellHeight:t}=S,n=h+w,r=h+w+k,i=v*e+(v-1)*l,a=b*t+(b-1)*l,s=[];for(let t=0;t<=v;t++){const i=n+t*(e+l)-l/2;s.push(o("line",{key:`vgrid-${t}`,x1:String(i),y1:String(r-l/2),x2:String(i),y2:String(r+a+l/2),stroke:f,"stroke-width":"0.5"}))}for(let e=0;e<=b;e++){const a=r+e*(t+l)-l/2;s.push(o("line",{key:`hgrid-${e}`,x1:String(n-l/2),y1:String(a),x2:String(n+i+l/2),y2:String(a),stroke:f,"stroke-width":"0.5"}))}return s},[c,b,v,S,h,w,k,l,f]),I=s(()=>{if(!u||0===b||0===v)return[];const{cellWidth:e,cellHeight:t}=S,n=h+w,r=h+w+k,i=[];for(let t=0;t<v;t++){const a=n+t*(e+l)+e/2,s=r-6;i.push(o("text",{key:`col-idx-${t}`,x:String(a),y:String(s),"text-anchor":"middle","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(t)))}for(let e=0;e<b;e++){const a=n-6,s=r+e*(t+l)+t/2+3;i.push(o("text",{key:`row-idx-${e}`,x:String(a),y:String(s),"text-anchor":"end","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(e)))}return i},[u,b,v,S,h,w,k,l]),A=s(()=>{if(0===b||0===v)return[];const{cellWidth:e,cellHeight:n}=S,r=h+w,i=h+w+k,s=[];for(let d=0;d<b;d++){const c=t[d];if(void 0!==c)for(let t=0;t<v;t++){const f=t<c.length?c[t]:0,u=r+t*(e+l),p=i+d*(n+l),h=$(f),m={key:`cell-${d}-${t}`,x:String(u),y:String(p),width:String(e),height:String(n),fill:h,rx:String(a),ry:String(a)};if(g){const e=d,n=t,o=f;m.onClick=()=>g(e,n,o),m.role="button",m.tabIndex=0}if(x){const e=d,n=t,o=f;m.onMouseEnter=()=>x(e,n,o)}s.push(o("rect",m))}}return s},[b,v,t,S,h,w,k,l,a,$,g,x]),F=M(),R=z(),D=C(),L=I(),W=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":m?`${m} — ${b}x${v} discrete grid`:`${b}x${v} discrete grid`},F,...R,...D,...L,...W)}export{ut as Accordion,le as Alert,y as AnalogClock,S as Avatar,z as Badge,ln as BarGraph,vr as BigNumber,zr as BlochSphere,Ar as BoxPlot,ht as Breadcrumb,Lr as BubbleChart,hr as Button,Hr as CalendarHeatMap,Oe as Card,ot as Carousel,gn as CartesianGraph2D,me as Checkbox,Ur as ChordDiagram,we as ColorPicker,ke as ColorWheel,bn as ComplexGraph2D,Bt as ContextMenu,P as DataGrid,Ce as DatePicker,Vr as DecompositionTree,q as DigitalClock,al as DiscreteCartesian2D,Yt as Drawer,xt as Dropdown,ae as EmptyState,Ae as FileUpload,Ue as FlexContainer,Xe as FlexItem,Un as Footer,Qr as ForceGraph,he as FormFieldWrapper,ti as FunnelChart,ii as GanttChart,ci as Gauge,On as GoogleAnalytics,Ve as Grid,Ge as GridItem,mi as HeatMap,bi as Histogram,Yn as HypercubeGraph,Xo as IDE,rt as Image,$n as LineGraph,J as ListView,vi as LollipopChart,Mi as Matrix,bt as Menubar,qt as Modal,Fe as MultilineField,at as NavWrapper,Re as NumberSpinner,Mt as Pagination,Ze as Panel,Ii as Partition,In as PieGraph,Li as PivotTable,Fn as PolarGraph2D,Xt as Popover,se as ProgressBar,Ei as RadarChart,De as RadioGroup,Pi as SankeyDiagram,et as ScrollContainer,Le as Select,Ct as Sidebar,de as Skeleton,We as Slider,pe as Spinner,tt as Splitter,It as Stepper,ji as Sunburst,nt as Tabs,ne as Tag,Te as TextEditor,Pe as TextField,br as ThreeDLayers,He as TimePicker,Jt as ToastContainer,je as Toggle,Rt as Toolbar,tn as Tooltip,fr as TradingDashboard,Xi as TreeMap,Tt as TreeNav,Dt as TreeNode,ui as USStateMap,fi as US_STATE_PATHS,Ao as UnityApp,So as UnityDesktop,Zi as VectorField,lt as VideoPlayer,re as VirtualScroll,qn as VizWrapper,Ji as WaterfallChart,il as WordCloud,To as WordProcessor,Mr as applyGate,kr as blochToCartesian,ge as buildInputStyle,st as buildNavItemStyle,Ln as buildRotationMatrix,Sr as cartesianToBloch,Ir as computeBoxStats,yn as computeMandelbrotGrid,Cn as computeSlices,Gt as createToaster,zn as describeArc,Dn as generateEdges,Bn as generateHypercube,Hn as generatePalette,Rn as generateVertices,_n as numRotationAngles,Pn as projectTo2D,Tn as transformVec,nn as useBarGraphScales,dt as useHover,jn as useHypercube,wn as useLineGraphScales,Qt as useToast};
|
|
1
|
+
const e=Symbol.for("spec.element"),t=Symbol.for("spec.provider"),n=Symbol.for("spec.consumer");function o(t,n,...o){let r=null,i=null;const l={};if(null!=n){void 0!==n.key&&(r=""+n.key),void 0!==n.ref&&(i=n.ref);for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&"key"!==e&&"ref"!==e&&"__proto__"!==e&&"constructor"!==e&&"prototype"!==e&&(l[e]=n[e])}if(1===o.length?l.children=o[0]:o.length>1&&(l.children=o),"function"==typeof t&&t.defaultProps){const e=t.defaultProps;for(const t of Object.keys(e))"__proto__"!==t&&"constructor"!==t&&void 0===l[t]&&(l[t]=e[t])}return{$$typeof:e,type:t,props:l,key:r,ref:i}}function r(e){const o={$$typeof:Symbol.for("spec.context"),Provider:null,Consumer:null,_currentValue:e,_defaultValue:e},r={$$typeof:t,_context:o},i={$$typeof:n,_context:o};return o.Provider=r,o.Consumer=i,o}function i(){throw new Error("Invalid hook call. Hooks can only be called inside the body of a function component.")}function l(e){return i().useState(e)}function a(e,t){return i().useEffect(e,t)}function s(e,t){return i().useCallback(e,t)}function d(e,t){return i().useMemo(e,t)}function c(e){return i().useRef(e)}function f(){return i().useId()}function u(){const e=("undefined"!=typeof window?window.location.hash:"").replace(/^#\/?/,"/");return""===e?"/":e}r({pathname:"/",params:{},navigate:()=>{throw new Error("useNavigate must be used inside a <Router> component.")},basePath:""}),u();const p=new Set;function h(e){if(!e)return new Date;const t=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),n=e=>Number(t.find(t=>t.type===e)?.value??0);return new Date(n("year"),n("month")-1,n("day"),n("hour"),n("minute"),n("second"))}"undefined"!=typeof window&&window.addEventListener("hashchange",function(){u(),"undefined"!=typeof window&&window.location.hash;for(const e of p)e()}),r({flags:{},isEnabled:()=>!1,setFlag:()=>{},loading:!1});const g="#334155",x="#1e293b",m="#374151";function y(e){const{format:t="12h",size:n=200,showDate:r=!1,dateFormat:i="short",showSeconds:s=!0,timezone:d,className:c}=e,[f,u]=l(h(d));a(()=>{const e=setInterval(()=>{u(h(d))},1e3);return()=>clearInterval(e)},[d]);const p=f.getHours(),y=f.getMinutes(),b=f.getSeconds(),v=p%12*30+.5*y,w=6*y+.1*b,k=6*b,S=n/2,$=n/2,M=n/2-10,z=M-4,C=M-22,I=[];I.push(o("circle",{cx:String(S),cy:String($),r:String(M),fill:"#f8fafc",stroke:g,"stroke-width":"3"}));for(let e=0;e<12;e++){const r=(30*e-90)*Math.PI/180,i=z-6;I.push(o("line",{x1:String(S+i*Math.cos(r)),y1:String($+i*Math.sin(r)),x2:String(S+z*Math.cos(r)),y2:String($+z*Math.sin(r)),stroke:g,"stroke-width":"2"}));const l=String(0===e?12:e);if(I.push(o("text",{x:String(S+C*Math.cos(r)),y:String($+C*Math.sin(r)),"text-anchor":"middle","dominant-baseline":"central",fill:m,"font-size":String(.08*n),"font-family":"sans-serif","font-weight":"600"},l)),"24h"===t){const t=M-38,i=String(0===e?0:e+12);I.push(o("text",{x:String(S+t*Math.cos(r)),y:String($+t*Math.sin(r)),"text-anchor":"middle","dominant-baseline":"central",fill:m,"font-size":String(.055*n),"font-family":"sans-serif",opacity:"0.6"},i))}}const A=(e,t,n,r)=>{const i=(e-90)*Math.PI/180;return o("line",{x1:String(S),y1:String($),x2:String(S+t*Math.cos(i)),y2:String($+t*Math.sin(i)),stroke:r,"stroke-width":n,"stroke-linecap":"round"})};I.push(A(v,.5*M,"4",x)),I.push(A(w,.75*M,"3",x)),s&&I.push(A(k,.85*M,"1.5","#ef4444")),I.push(o("circle",{cx:String(S),cy:String($),r:"4",fill:x}));const F=[o("svg",{width:String(n),height:String(n),viewBox:`0 0 ${n} ${n}`,xmlns:"http://www.w3.org/2000/svg"},...I)];return r&&F.push(o("div",{style:{textAlign:"center",marginTop:"8px",fontFamily:"sans-serif",fontSize:"14px",color:m}},function(e,t){const n=e.getFullYear(),o=e.getMonth(),r=e.getDate();switch(t){case"short":return`${String(o+1).padStart(2,"0")}/${String(r).padStart(2,"0")}/${n}`;case"long":return`${["January","February","March","April","May","June","July","August","September","October","November","December"][o]} ${String(r).padStart(2,"0")}, ${n}`;case"iso":return`${n}-${String(o+1).padStart(2,"0")}-${String(r).padStart(2,"0")}`}}(f,i))),o("div",{className:c,style:{display:"inline-flex",flexDirection:"column",alignItems:"center"}},...F)}const b={xs:24,sm:32,md:40,lg:56,xl:80},v=["#3b82f6","#ef4444","#22c55e","#a855f7","#f97316","#ec4899","#14b8a6","#6366f1","#eab308","#06b6d4"],w={online:"#22c55e",offline:"#9ca3af",busy:"#ef4444",away:"#eab308"};function k(e,t){const 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};default:return{top:n,right:n}}}function S(e){const{src:t,alt:n,name:r,size:i,shape:a="circle",fallbackColor:s,status:d,statusPosition:c="bottom-right"}=e,[f,u]=l(!1),p=function(e){return null==e?b.md:"number"==typeof e?e:b[e]??b.md}(i),h="circle"===a?"50%":`${Math.round(.15*p)}px`,g=s??function(e){if(!e)return"#9ca3af";let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return v[Math.abs(t)%v.length]}(r),x=`${Math.round(.4*p)}px`,m={position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:`${p}px`,height:`${p}px`,borderRadius:h,overflow:"hidden",flexShrink:"0"};let y;if(t&&!f)y=o("img",{src:t,alt:n??r??"avatar",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"},onError:()=>u(!0)});else{const e=function(e){if(!e)return"?";const t=e.trim().split(/\s+/);return 1===t.length?t[0].charAt(0).toUpperCase():(t[0].charAt(0)+t[t.length-1].charAt(0)).toUpperCase()}(r);y=o("span",{style:{fontSize:x,fontWeight:"600",color:"#fff",lineHeight:"1",userSelect:"none",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},"aria-hidden":"true"},e)}const S=o("div",{style:{...m,backgroundColor:t&&!f?"transparent":g},role:"img","aria-label":n??r??"avatar"},y);if(!d)return S;const $=Math.max(8,Math.round(.25*p));return o("div",{style:{position:"relative",display:"inline-flex",width:`${p}px`,height:`${p}px`,flexShrink:"0"}},S,o("span",{style:{position:"absolute",width:`${$}px`,height:`${$}px`,borderRadius:"50%",backgroundColor:w[d]??w.offline,border:"2px solid #fff",boxSizing:"border-box",...k(c,$)},"aria-label":d}))}const $={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"}},M={sm:{width:"6px",height:"6px"},md:{width:"8px",height:"8px"},lg:{width:"10px",height:"10px"}};function z(e){const{count:t,max:n,dot:r=!1,color:i="#ef4444",size:l="md",variant:a="solid",children:s}=e;let d=null;r||null==t||(d=null!=n&&t>n?`${n}+`:String(t));const c=r||null!=t&&t>0,f=r?{...M[l],borderRadius:"50%",..."solid"===a?{backgroundColor:i}:{backgroundColor:"transparent",border:`2px solid ${i}`}}:{...$[l],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",..."solid"===a?{backgroundColor:i,color:"#fff"}:{backgroundColor:"transparent",color:i,border:`2px solid ${i}`}},u=c?o("span",{style:f,"aria-label":r?"notification":`count ${d}`},d):null;if(null==s)return u??o("span",null);const p={...f,position:"absolute",top:"0",right:"0",transform:"translate(50%, -50%)",zIndex:"1"};return o("span",{style:{position:"relative",display:"inline-flex"}},s,c?o("span",{style:p,"aria-label":r?"notification":`count ${d}`},d):null)}const C={width:"100%",borderCollapse:"collapse",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",color:"#1f2937"},I={padding:"10px 12px",textAlign:"left",fontWeight:"600",backgroundColor:"#f9fafb",borderBottom:"2px solid #e5e7eb",userSelect:"none",whiteSpace:"nowrap"},A={padding:"10px 12px",borderBottom:"1px solid #e5e7eb"},F={marginLeft:"4px",fontSize:"12px",color:"#6b7280"},R={width:"100%",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",boxSizing:"border-box"},D={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",fontSize:"13px",color:"#6b7280"},L={padding:"4px 10px",margin:"0 2px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#fff",cursor:"pointer",fontSize:"13px"},W={...L,backgroundColor:"#3b82f6",color:"#fff",borderColor:"#3b82f6"},N={...L,opacity:"0.5",cursor:"default"},E={cursor:"pointer",width:"16px",height:"16px"};function T(e,t,n){return e!==t?"↕":"asc"===n?"↑":"↓"}function B(e){const{columns:t,data:n,pageSize:r,currentPage:i,onPageChange:a,sortBy:c,sortDir:f,onSort:u,selectable:p=!1,selectedRows:h,onSelectionChange:g,striped:x=!1,bordered:m=!1,compact:y=!1,stickyHeader:b=!1}=e,[v,w]=l(0),[k,S]=l(void 0),[$,M]=l("asc"),[z,B]=l([]),[P,_]=l({}),H=i??v,Y=c??k,j=f??$,q=h??z,O=d(()=>{const e=Object.entries(P).filter(([,e])=>e.length>0);return 0===e.length?n:n.filter(t=>e.every(([e,n])=>String(t[e]??"").toLowerCase().includes(n.toLowerCase())))},[n,P]),U=d(()=>{if(!Y)return O;const e=[...O];return e.sort((e,t)=>{const n=e[Y],o=t[Y];if(null==n&&null==o)return 0;if(null==n)return 1;if(null==o)return-1;if("number"==typeof n&&"number"==typeof o)return"asc"===j?n-o:o-n;const r=String(n),i=String(o),l=r.localeCompare(i);return"asc"===j?l:-l}),e},[O,Y,j]),X=U.length,V=r?Math.max(1,Math.ceil(X/r)):1,G=r?U.slice(H*r,(H+1)*r):U,K=s(e=>{a?a(e):w(e)},[a]),Z=s(e=>{const t=Y===e&&"asc"===j?"desc":"asc";u?u(e,t):(S(e),M(t))},[Y,j,u]),J=s(e=>{const t=q.includes(e)?q.filter(t=>t!==e):[...q,e];g?g(t):B(t)},[q,g]),Q=s(()=>{const e=G.map((e,t)=>r?H*r+t:t),t=e.every(e=>q.includes(e))?q.filter(t=>!e.includes(t)):[...new Set([...q,...e])];g?g(t):B(t)},[G,q,r,H,g]),ee=s((e,t)=>{_(n=>({...n,[e]:t})),K(0)},[K]),te=t.some(e=>e.filterable),ne=y?"6px 8px":A.padding,oe=[];if(p){const e=G.map((e,t)=>r?H*r+t:t),t=e.length>0&&e.every(e=>q.includes(e));oe.push(o("th",{key:"__select_all",style:{...I,padding:ne,width:"40px",textAlign:"center",...b?{position:"sticky",top:"0",zIndex:"2"}:{}}},o("input",{type:"checkbox",checked:t,onChange:Q,style:E,"aria-label":"Select all rows"})))}for(const e of t){const t={...I,padding:ne,...e.width?{width:e.width}:{},...e.sortable?{cursor:"pointer"}:{},...m?{border:"1px solid #e5e7eb"}:{},...b?{position:"sticky",top:"0",zIndex:"2"}:{}},n=[e.header];e.sortable&&n.push(o("span",{style:F},T(e.key,Y,j))),oe.push(o("th",{key:e.key,style:t,onClick:e.sortable?()=>Z(e.key):void 0,onKeyDown:e.sortable?t=>{const n=t.key;"Enter"!==n&&" "!==n||(t.preventDefault(),Z(e.key))}:void 0,tabIndex:e.sortable?0:void 0,role:e.sortable?"columnheader":void 0,"aria-sort":Y===e.key?"asc"===j?"ascending":"descending":void 0},...n))}let re=null;if(te){const e=[];p&&e.push(o("th",{key:"__filter_spacer",style:{padding:ne}}));for(const n of t)e.push(o("th",{key:`filter_${n.key}`,style:{padding:"4px 8px",backgroundColor:"#f9fafb"}},n.filterable?o("input",{type:"text",placeholder:`Filter ${n.header}...`,style:R,value:P[n.key]??"",onInput:e=>ee(n.key,e.target.value),"aria-label":`Filter by ${n.header}`}):null));re=o("tr",{key:"__filter_row"},...e)}const ie=[];for(let e=0;e<G.length;e++){const n=G[e],i=r?H*r+e:e,l=q.includes(i),a={};x&&e%2==1&&(a.backgroundColor="#f9fafb"),l&&(a.backgroundColor="#eff6ff");const s=[];p&&s.push(o("td",{key:"__select",style:{padding:ne,textAlign:"center",...A,...m?{border:"1px solid #e5e7eb"}:{}}},o("input",{type:"checkbox",checked:l,onChange:()=>J(i),style:E,"aria-label":`Select row ${i+1}`})));for(const e of t){const t=n[e.key],r=e.render?e.render(t,n):String(t??"");s.push(o("td",{key:e.key,style:{...A,padding:ne,...m?{border:"1px solid #e5e7eb"}:{}}},r))}ie.push(o("tr",{key:String(i),style:a},...s))}let le=null;if(r){const e=0===X?0:H*r+1,t=Math.min((H+1)*r,X),n=[];n.push(o("button",{key:"prev",style:0===H?N:L,onClick:H>0?()=>K(H-1):void 0,disabled:0===H,"aria-label":"Previous page"},"← Prev"));const i=7;let l=Math.max(0,H-Math.floor(i/2));const a=Math.min(V,l+i);a-l<i&&(l=Math.max(0,a-i)),l>0&&(n.push(o("button",{key:"p0",style:L,onClick:()=>K(0)},"1")),l>1&&n.push(o("span",{key:"e1",style:{margin:"0 4px"}},"...")));for(let e=l;e<a;e++)n.push(o("button",{key:`p${e}`,style:e===H?W:L,onClick:e!==H?()=>K(e):void 0,"aria-current":e===H?"page":void 0},String(e+1)));a<V&&(a<V-1&&n.push(o("span",{key:"e2",style:{margin:"0 4px"}},"...")),n.push(o("button",{key:"p"+(V-1),style:L,onClick:()=>K(V-1)},String(V)))),n.push(o("button",{key:"next",style:H>=V-1?N:L,onClick:H<V-1?()=>K(H+1):void 0,disabled:H>=V-1,"aria-label":"Next page"},"Next →")),le=o("div",{style:D},o("span",null,`Showing ${e}–${t} of ${X}`),o("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},...n))}const ae={width:"100%",...b?{overflow:"auto",maxHeight:"600px"}:{}},se={...C,...m?{border:"1px solid #e5e7eb"}:{}},de=o("thead",null,o("tr",null,...oe),re),ce=o("tbody",null,...ie),fe=o("table",{style:se,role:"grid","aria-rowcount":String(X)},de,ce);return o("div",{style:ae},fe,le)}function P(e){return e<10?`0${e}`:String(e)}const _={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"},H={fontSize:"2rem",fontWeight:"600",letterSpacing:"2px",lineHeight:"1"},Y={fontSize:"0.875rem",fontWeight:"400",marginLeft:"4px",verticalAlign:"super"},j={fontSize:"0.75rem",color:"#94a3b8",marginTop:"4px"};function q(e){const{format:t="12h",showDate:n=!1,dateFormat:r="short",showSeconds:i=!0,timezone:s,className:d}=e,[c,f]=l(new Date);a(()=>{const e=setInterval(()=>{f(new Date)},1e3);return()=>clearInterval(e)},[]);const{hours:u,minutes:p,seconds:h}=function(e,t){if(t){const n=new Intl.DateTimeFormat("en-US",{timeZone:t,hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}).formatToParts(e),o=e=>Number(n.find(t=>t.type===e)?.value??0);return{hours:o("hour"),minutes:o("minute"),seconds:o("second")}}return{hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()}}(c,s);let g,x=null;"12h"===t?(x=u>=12?"PM":"AM",g=u%12||12):g=u;let m=`${P(g)}:${P(p)}`;i&&(m+=`:${P(h)}`);const y=[m];null!=x&&y.push(o("span",{style:Y},x));const b=[o("span",{style:H},...y)];return n&&b.push(o("span",{style:j},function(e,t,n){if(n){const o={timeZone:n};if("short"===t)return Object.assign(o,{month:"2-digit",day:"2-digit",year:"numeric"}),new Intl.DateTimeFormat("en-US",o).format(e);if("long"===t)return Object.assign(o,{month:"long",day:"numeric",year:"numeric"}),new Intl.DateTimeFormat("en-US",o).format(e);Object.assign(o,{year:"numeric",month:"2-digit",day:"2-digit"});const r=new Intl.DateTimeFormat("en-CA",o).formatToParts(e),i=e=>r.find(t=>t.type===e)?.value??"";return`${i("year")}-${i("month")}-${i("day")}`}return"short"===t?`${P(e.getMonth()+1)}/${P(e.getDate())}/${e.getFullYear()}`:"long"===t?new Intl.DateTimeFormat("en-US",{month:"long",day:"numeric",year:"numeric"}).format(e):`${e.getFullYear()}-${P(e.getMonth()+1)}-${P(e.getDate())}`}(c,r,s))),o("div",{style:_,...d?{class:d}:{}},...b)}const O={listStyle:"none",margin:"0",padding:"0",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px"},U={padding:"10px 14px",color:"var(--color-text, #1f2937)"},X={borderBottom:"1px solid var(--color-border, #e5e7eb)"},V={cursor:"pointer",transition:"background-color 0.15s ease"},G={backgroundColor:"var(--color-bg-muted, #eff6ff)"},K={padding:"24px",textAlign:"center",color:"var(--color-text-muted, #9ca3af)",fontSize:"14px"},Z={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 J(e){const{items:t,renderItem:n,keyExtractor:r,divider:i=!1,hoverable:l=!1,selectedIndex:a,onSelect:s,emptyMessage:d="No items",header:c,footer:f}=e;if(0===t.length)return o("div",null,c?o("div",{style:Z},c):null,o("div",{style:K},d),f?o("div",{style:{...Z,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},f):null);const u=[];for(let e=0;e<t.length;e++){const d=t[e],c=r(d,e),f=a===e,p=e===t.length-1,h={...U,...l?V:{},...f?G:{},...i&&!p?X:{}};u.push(o("li",{key:c,style:h,onClick:s?()=>s(e):void 0,onKeyDown:s?t=>{const n=t.key;"Enter"!==n&&" "!==n||(t.preventDefault(),s(e))}:void 0,role:s?"option":void 0,tabIndex:s?0:void 0,"aria-selected":s?String(f):void 0},n(d,e)))}return o("div",null,c?o("div",{style:Z},c):null,o("ul",{style:O,role:s?"listbox":"list"},...u),f?o("div",{style:{...Z,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},f):null)}function Q(e,t){const n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec({red:"#ef4444",blue:"#3b82f6",green:"#22c55e",yellow:"#eab308",purple:"#a855f7",pink:"#ec4899",orange:"#f97316",gray:"#6b7280",indigo:"#6366f1",teal:"#14b8a6",cyan:"#06b6d4"}[e]??e);return n?`rgba(${parseInt(n[1],16)}, ${parseInt(n[2],16)}, ${parseInt(n[3],16)}, ${t})`:e}const ee={sm:{fontSize:"11px",padding:"2px 8px",gap:"4px"},md:{fontSize:"13px",padding:"4px 10px",gap:"6px"},lg:{fontSize:"15px",padding:"6px 14px",gap:"8px"}},te={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 ne(e){const{label:t,color:n,variant:r="subtle",size:i="md",removable:l=!1,onRemove:a,icon:s,onClick:d,disabled:c=!1}=e,f=function(e){return e??"#3b82f6"}(n),u=function(e,t,n,o,r){const i=ee[n],l={display:"inline-flex",alignItems:"center",gap:i.gap,borderRadius:"9999px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:i.fontSize,fontWeight:"500",padding:i.padding,lineHeight:"1.4",whiteSpace:"nowrap",border:"none",transition:"opacity 0.15s ease, filter 0.15s ease",...o?{cursor:"pointer"}:{},...r?{opacity:"0.5",cursor:"default",pointerEvents:"none"}:{}};switch(t){case"solid":return{...l,backgroundColor:e,color:"#fff",border:"none"};case"outline":return{...l,backgroundColor:"transparent",color:e,border:`1px solid ${e}`};case"subtle":return{...l,backgroundColor:Q(e,.12),color:e,border:"none"};default:return l}}(f,r,i,!!d,c),p=[];return s&&p.push(o("span",{key:"icon",style:{display:"inline-flex",flexShrink:"0"}},s)),p.push(o("span",{key:"label"},t)),l&&p.push(o("button",{key:"remove",type:"button",style:te,onClick:e=>{e.stopPropagation(),!c&&a&&a()},"aria-label":`Remove ${t}`,disabled:c},"×")),o("span",{style:u,role:d?"button":void 0,tabIndex:d&&!c?"0":void 0,onClick:!c&&d?d:void 0,onKeyDown:d&&!c?e=>{const t=e.key;"Enter"!==t&&" "!==t||(e.preventDefault(),d())}:void 0,"aria-disabled":c?"true":void 0},...p)}const oe={overflow:"auto",position:"relative",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'};function re(e){const{items:t,renderItem:n,itemHeight:r,overscan:i=5,height:a}=e,[d,f]=l(0),u=c(null),p=t.length*r,h=parseInt(a,10)||400,g=Math.ceil(h/r),x=Math.max(0,Math.floor(d/r)-i),m=Math.min(t.length,Math.floor(d/r)+g+i),y=s(e=>{const t=e.target;f(t.scrollTop)},[]),b=[];for(let e=x;e<m;e++)b.push(o("div",{key:String(e),style:{position:"absolute",top:e*r+"px",left:"0",right:"0",height:`${r}px`,overflow:"hidden"}},n(t[e],e)));return o("div",{ref:u,style:{...oe,height:a},onScroll:y},o("div",{style:{height:`${p}px`,position:"relative",width:"100%"}},...b))}const ie={info:{icon:"ℹ️",bg:"#eff6ff",border:"#3b82f6",text:"#1e40af",filledBg:"#3b82f6",filledText:"#ffffff"},success:{icon:"✅",bg:"#f0fdf4",border:"#22c55e",text:"#166534",filledBg:"#22c55e",filledText:"#ffffff"},warning:{icon:"⚠️",bg:"#fffbeb",border:"#f59e0b",text:"#92400e",filledBg:"#f59e0b",filledText:"#ffffff"},error:{icon:"❌",bg:"#fef2f2",border:"#ef4444",text:"#991b1b",filledBg:"#ef4444",filledText:"#ffffff"}};function le(e){const[t,n]=l(!0),r=e.type??"info",i=e.variant??"subtle",a=ie[r]??ie.info,s=e.icon??a.icon,c=e.message??e.children,f=d(()=>{const e={display:"flex",alignItems:"flex-start",gap:"12px",padding:"12px 16px",borderRadius:"8px",fontSize:"14px",lineHeight:"1.5"};return"filled"===i?(e.backgroundColor=a.filledBg,e.color=a.filledText):"outline"===i?(e.backgroundColor="transparent",e.border=`1px solid ${a.border}`,e.color=a.text):(e.backgroundColor=a.bg,e.color=a.text),e},[i,a]);return t?o("div",{role:"alert",style:f},o("span",{style:{flexShrink:"0",fontSize:"16px",lineHeight:"1.5"}},s),o("div",{style:{flex:"1",minWidth:"0"}},e.title?o("div",{style:{fontWeight:"600",marginBottom:c?"4px":"0"}},e.title):null,c?o("div",null,c):null,e.action?o("button",{onclick:e.action.onClick,style:{marginTop:"8px",padding:"4px 12px",fontSize:"13px",fontWeight:"500",border:"filled"===i?"1px solid currentColor":`1px solid ${a.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"}},"×"):null):null}function ae(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 se(e){const 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",l=e.backgroundColor??"#e5e7eb",a=e.height??("string"==typeof e.size?e.size:"number"==typeof e.size?`${e.size}px`:"8px"),s=e.variant??"bar",c=f().replace(/[^a-zA-Z0-9_-]/g,"");if("circular"===s){const t="number"==typeof e.size?e.size:48,n=Math.max(2,Math.round(t/10)),a=(t-n)/2,s=2*Math.PI*a,d=e.indeterminate?.75*s:s-r/100*s,f=e.indeterminate?`@keyframes liq-spin-${c}{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}`:e.animated?`@keyframes liq-pulse-${c}{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"}},f?o("style",null,f):null,o("svg",{width:String(t),height:String(t),viewBox:`0 0 ${t} ${t}`,style:e.indeterminate?{animation:`liq-spin-${c} 1s linear infinite`}:e.animated?{animation:`liq-pulse-${c} 1.5s ease-in-out infinite`}:{}},o("circle",{cx:String(t/2),cy:String(t/2),r:String(a),fill:"none",stroke:l,"stroke-width":String(n)}),o("circle",{cx:String(t/2),cy:String(t/2),r:String(a),fill:"none",stroke:i,"stroke-width":String(n),"stroke-dasharray":String(s),"stroke-dashoffset":String(d),"stroke-linecap":"round",transform:`rotate(-90 ${t/2} ${t/2})`,style:{transition:"stroke-dashoffset 0.3s ease"}})),e.showLabel&&!e.indeterminate?o("span",{style:{fontSize:"14px",color:"#374151"}},`${Math.round(r)}%`):null)}const u=e.animated||e.indeterminate?`@keyframes liq-shimmer-${c}{0%{background-position:-200% 0}100%{background-position:200% 0}}`:"",p=e.indeterminate?`@keyframes liq-indeterminate-${c}{0%{left:-40%;width:40%}50%{left:20%;width:60%}100%{left:100%;width:40%}}`:"",h={width:"100%",height:a,backgroundColor:l,borderRadius:a,overflow:"hidden",position:"relative"},g=d(()=>{const t={height:"100%",borderRadius:a,transition:"width 0.3s ease"};return e.indeterminate?(t.position="absolute",t.animation=`liq-indeterminate-${c} 1.5s ease-in-out infinite`,t.backgroundColor=i):(t.width=`${r}%`,t.backgroundColor=i),e.animated&&!e.indeterminate&&(t.backgroundImage=`linear-gradient(90deg, ${i} 0%, ${function(e){const t=e.replace("#","");if(6!==t.length)return e;const n=Math.min(255,parseInt(t.slice(0,2),16)+40),o=Math.min(255,parseInt(t.slice(2,4),16)+40),r=Math.min(255,parseInt(t.slice(4,6),16)+40);return`#${n.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}`}(i)} 50%, ${i} 100%)`,t.backgroundSize="200% 100%",t.animation=`liq-shimmer-${c} 1.5s ease-in-out infinite`),t},[r,i,a,e.animated,e.indeterminate,c]);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||p?o("style",null,u+p):null,e.showLabel&&!e.indeterminate?o("div",{style:{marginBottom:"4px",fontSize:"12px",color:"#374151",textAlign:"right"}},`${Math.round(r)}%`):null,o("div",{style:h},o("div",{style:g})))}function de(e){const t=e.variant??"text",n=!1!==e.animated,r=f().replace(/[^a-zA-Z0-9_-]/g,""),i=d(()=>n?`@keyframes liq-shimmer-${r}{0%{background-position:-200% 0}100%{background-position:200% 0}}`:"",[n,r]),l="number"==typeof e.width?`${e.width}px`:e.width,a="number"==typeof e.height?`${e.height}px`:e.height;if("text"===t){const t=e.lines??1,s=[];for(let i=0;i<t;i++){const d=i===t-1&&t>1;s.push(o("div",{key:String(i),style:ce({width:d?"75%":l??"100%",height:a??"1em",borderRadius:e.borderRadius??"4px",animated:n,animId:r,marginBottom:i<t-1?"8px":"0"})}))}return o("div",{"aria-hidden":"true",style:{width:l??"100%"}},i?o("style",null,i):null,...s)}if("circular"===t){const e=l??a??"40px";return o("div",{"aria-hidden":"true"},i?o("style",null,i):null,o("div",{style:ce({width:e,height:e,borderRadius:"50%",animated:n,animId:r})}))}return o("div",{"aria-hidden":"true"},i?o("style",null,i):null,o("div",{style:ce({width:l??"100%",height:a??"100px",borderRadius:e.borderRadius??"4px",animated:n,animId:r})}))}function ce(e){const 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}const fe={sm:16,md:24,lg:40},ue={slow:"1.2s",normal:"0.75s",fast:"0.45s"};function pe(e){const t="number"==typeof e.size?e.size:fe[e.size??"md"]??24,n=e.color??"#3b82f6",r=e.thickness??Math.max(2,Math.round(t/8)),i=ue[e.speed??"normal"]??ue.normal,l=e.label??"Loading",a=f().replace(/[^a-zA-Z0-9_-]/g,""),s=(t-r)/2,c=2*Math.PI*s;return o("span",{role:"status","aria-label":l,style:{display:"inline-flex",alignItems:"center",justifyContent:"center"}},o("style",null,d(()=>`@keyframes liq-rotate-${a}{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}`,[a])),o("svg",{width:String(t),height:String(t),viewBox:`0 0 ${t} ${t}`,style:{animation:`liq-rotate-${a} ${i} linear infinite`}},o("circle",{cx:String(t/2),cy:String(t/2),r:String(s),fill:"none",stroke:n,"stroke-width":String(r),"stroke-dasharray":`${.7*c} ${.3*c}`,"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"}},l))}function he(e){const t=e.styling??{},n=!!e.error,r={display:"flex",flexDirection:"column",gap:t.gap??"4px",width:"number"==typeof t.width?`${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"},l={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:l,role:"alert"},e.error):e.helpText?o("div",{className:"form-field__help",style:l},e.helpText):null)}function ge(e,t){const 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??{}}}const xe={sm:{box:14,icon:10,fontSize:"12px"},md:{box:18,icon:12,fontSize:"14px"},lg:{box:22,icon:16,fontSize:"16px"}};function me(e){const t=f().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{checked:r,onChange:i,label:l,indeterminate:d=!1,disabled:u=!1,error:p,size:h="md"}=e,g=c(null);a(()=>{g.current&&(g.current.indeterminate=d)},[d]);const x=s(()=>{u||i(!r)},[u,r,i]),m=s(e=>{u||" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),i(!r))},[u,r,i]),y=xe[h],b=`${y.box}px`,v={width:b,height:b,minWidth:b,borderRadius:"4px",border:"2px solid "+(p?"#ef4444":r||d?"#3b82f6":"#d1d5db"),backgroundColor:r||d?"#3b82f6":"#ffffff",display:"flex",alignItems:"center",justifyContent:"center",cursor:u?"not-allowed":"pointer",transition:"all 0.15s",boxSizing:"border-box"},w={color:"#ffffff",fontSize:`${y.icon}px`,lineHeight:"1",fontWeight:"700"},k=d?o("span",{style:w},"—"):r?o("span",{style:w},"✓"):null,S={display:"inline-flex",alignItems:"center",gap:"8px",cursor:u?"not-allowed":"pointer",opacity:u?"0.6":"1",userSelect:"none"},$=o("input",{ref:g,type:"checkbox",id:n,checked:r,disabled:u,onChange:()=>i(!r),style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},"aria-hidden":"true",tabIndex:-1}),M=o("div",{style:v},k),z=l?o("span",{style:{fontSize:y.fontSize,color:"#374151"}},l):null;return o(he,{error:p,htmlFor:n},o("div",{style:S,onClick:x,onKeyDown:m,tabIndex:u?-1:0,role:"checkbox","aria-checked":d?"mixed":r?"true":"false","aria-disabled":u?"true":void 0,"aria-label":l},$,M,z))}const ye=["#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 be(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e)}function ve(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 we(e){const t=f().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,presets:d=ye,showInput:u=!0,showAlpha:p=!1,disabled:h=!1,label:g}=e,[x,m]=l(!1),[y,b]=l(r),v=c(null);a(()=>{b(r)},[r]),a(()=>{const e=e=>{v.current&&!v.current.contains(e.target)&&m(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const w=s(e=>{h||i(ve(e))},[h,i]),k=s(e=>{const t=e.target.value;b(t);const n=t.startsWith("#")?t:`#${t}`;be(n)&&i(ve(n))},[i]),S=s(()=>{be(y.startsWith("#")?y:`#${y}`)||b(r)},[y,r]),$={width:"36px",height:"36px",borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:r,cursor:h?"not-allowed":"pointer",flexShrink:"0"},M={display:"grid",gridTemplateColumns:"repeat(10, 1fr)",gap:"4px",marginBottom:u?"8px":"0"},z=d.map(e=>{const t=ve(e)===ve(r);return o("div",{key:e,style:{width:"20px",height:"20px",borderRadius:"3px",backgroundColor:e,cursor:h?"not-allowed":"pointer",border:t?"2px solid #1f2937":"1px solid #e5e7eb",boxSizing:"border-box"},onClick:()=>w(e),onKeyDown:t=>{const n=t.key;"Enter"!==n&&" "!==n||(t.preventDefault(),w(e))},role:"button",tabIndex:h?-1:0,title:e,"aria-label":`Select color ${e}`})}),C=u?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:y,onInput:k,onBlur:S,disabled:h,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,I=x?o("div",{style:{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"}},o("div",{style:M},...z),C):null;return o(he,{label:g,disabled:h,htmlFor:n},o("div",{ref:v,style:{position:"relative"}},o("div",{style:{display:"flex",alignItems:"center",gap:"8px"},onClick:h?void 0:()=>m(!x),onKeyDown:h?void 0:e=>{const t=e.key;"Enter"!==t&&" "!==t||(e.preventDefault(),m(!x))},role:"button",tabIndex:h?-1:0,"aria-expanded":x?"true":"false","aria-label":"Toggle color picker"},o("div",{id:n,style:$}),u?o("span",{style:{fontSize:"14px",fontFamily:"monospace",color:"#1f2937"}},r):null),I))}function ke(e){const t=f().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`cw-${t}`,{value:r="#000000",onChange:i,size:a=32,showLabel:d=!0,disabled:u=!1,label:p}=e,[h,g]=l(r);return o(he,{label:p,htmlFor:n},o("div",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"4px"}},o("div",{style:{width:`${a}px`,height:`${a}px`,borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:h,cursor:u?"not-allowed":"pointer",position:"relative",overflow:"hidden"}},o("input",{id:n,ref:c(null),type:"color",value:h,onInput:s((...e)=>{const t=e[0].target.value;g(t),i?.(t)},[i]),disabled:u,style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",opacity:"0",cursor:u?"not-allowed":"pointer",border:"none",padding:"0"},"aria-label":p||"Color"})),d?o("span",{style:{fontSize:"11px",fontFamily:"monospace",color:"#64748b"}},h):null))}const Se=["January","February","March","April","May","June","July","August","September","October","November","December"],$e=["Su","Mo","Tu","We","Th","Fr","Sa"];function Me(e){if(!e)return null;if(e instanceof Date)return e;const t=new Date(e);return isNaN(t.getTime())?null:t}function ze(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function Ce(e){const t=f().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,format:u="YYYY-MM-DD",minDate:p,maxDate:h,disabled:g=!1,placeholder:x="Select date...",label:m,error:y}=e,b=d(()=>Me(r),[r]),v=d(()=>Me(p),[p]),w=d(()=>Me(h),[h]),[k,S]=l(!1),[$,M]=l(()=>b?b.getFullYear():(new Date).getFullYear()),[z,C]=l(()=>b?b.getMonth():(new Date).getMonth()),I=c(null),A=d(()=>new Date,[]);a(()=>{const e=e=>{I.current&&!I.current.contains(e.target)&&S(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const F=s(()=>{C(e=>0===e?(M(e=>e-1),11):e-1)},[]),R=s(()=>{C(e=>11===e?(M(e=>e+1),0):e+1)},[]),D=s(e=>{const t=new Date($,z,e);v&&t<v||w&&t>w||(i(function(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}(t)),S(!1))},[$,z,i,v,w]),L=b?function(e,t){const n=e.getFullYear(),o=e.getMonth()+1,r=e.getDate();return t.replace("YYYY",String(n)).replace("MM",String(o).padStart(2,"0")).replace("DD",String(r).padStart(2,"0"))}(b,u):"",W=d(()=>{const e=new Date($,z,1).getDay(),t=new Date($,z+1,0).getDate(),n=[];let o=[];for(let t=0;t<e;t++)o.push(null);for(let e=1;e<=t;e++)o.push(e),7===o.length&&(n.push(o),o=[]);for(;o.length>0&&o.length<7;)o.push(null);return o.length&&n.push(o),n},[$,z]),N={...ge({},{focused:k,error:!!y}),cursor:g?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",minHeight:"38px",userSelect:"none"},E={background:"none",border:"none",cursor:"pointer",fontSize:"16px",padding:"4px 8px",color:"#374151",borderRadius:"4px"},T=$e.map(e=>o("div",{key:e,style:{padding:"4px"}},e)),B=W.map((e,t)=>{const n=e.map((e,n)=>{if(null===e)return o("div",{key:`empty-${t}-${n}`,style:{padding:"4px"}});const r=new Date($,z,e),i=ze(r,A),l=!!b&&ze(r,b),a=v&&r<v||w&&r>w;return o("div",{key:`day-${e}`,style:{padding:"4px",textAlign:"center",cursor:a?"not-allowed":"pointer",borderRadius:"4px",fontSize:"13px",fontWeight:i?"700":"400",backgroundColor:l?"#3b82f6":"transparent",color:l?"#ffffff":a?"#d1d5db":i?"#3b82f6":"#1f2937",border:i&&!l?"1px solid #3b82f6":"1px solid transparent",lineHeight:"1.8"},onClick:a?void 0:()=>D(e),onKeyDown:a?void 0:t=>{const n=t.key;"Enter"!==n&&" "!==n||(t.preventDefault(),D(e))},role:a?void 0:"button",tabIndex:a?void 0:0,"aria-label":`${Se[z]} ${e}, ${$}`,"aria-disabled":a?"true":void 0},String(e))});return o("div",{key:`row-${t}`,style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)"}},...n)}),P=k?o("div",{style:{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"}},o("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"8px"}},o("button",{type:"button",style:E,onClick:F},"◀"),o("span",{style:{fontWeight:"600",fontSize:"14px",color:"#1f2937"}},`${Se[z]} ${$}`),o("button",{type:"button",style:E,onClick:R},"▶")),o("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",textAlign:"center",fontSize:"11px",fontWeight:"600",color:"#6b7280",marginBottom:"4px"}},...T),...B):null;return o(he,{label:m,error:y,disabled:g,htmlFor:n},o("div",{ref:I,style:{position:"relative"}},o("div",{id:n,style:N,onClick:g?void 0:()=>S(!k),onKeyDown:g?void 0:e=>{const t=e.key;"Enter"!==t&&" "!==t||(e.preventDefault(),S(!k))},tabIndex:g?-1:0,role:"button","aria-label":"Pick a date","aria-expanded":k?"true":"false"},o("span",{style:{color:L?"#1f2937":"#9ca3af"}},L||x),o("span",{style:{color:"#6b7280",fontSize:"14px"}},"📅")),P))}function Ie(e){if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(0===t?0:1)} ${["B","KB","MB","GB"][t]}`}function Ae(e){const t=f().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`fu-${t}`,{onChange:r,accept:i,multiple:a=!1,maxSize:d,disabled:u=!1,label:p,helpText:h}=e,[g,x]=l([]),[m,y]=l(!1),[b,v]=l(""),w=c(null),k=s(e=>{v("");const t=[];for(const n of e)d&&n.size>d?v(`File "${n.name}" exceeds maximum size of ${Ie(d)}`):t.push(n);const n=a?[...g,...t]:t.slice(0,1);x(n),r(n)},[g,a,d,r]),S=s(e=>{if(e.preventDefault(),e.stopPropagation(),y(!1),u)return;const t=e.dataTransfer;if(!t)return;const n=Array.from(t.files);k(n)},[u,k]),$=s(e=>{e.preventDefault(),e.stopPropagation(),u||y(!0)},[u]),M=s(e=>{e.preventDefault(),e.stopPropagation(),y(!1)},[]),z=s(e=>{const t=e.target;t.files&&(k(Array.from(t.files)),t.value="")},[k]),C=s(e=>{const t=g.filter((t,n)=>n!==e);x(t),r(t)},[g,r]),I=s(()=>{u||w.current&&w.current.click()},[u]),A={border:"2px dashed "+(m?"#3b82f6":b?"#ef4444":"#d1d5db"),borderRadius:"8px",padding:"24px",textAlign:"center",cursor:u?"not-allowed":"pointer",backgroundColor:m?"#eff6ff":"#fafafa",transition:"all 0.15s",opacity:u?"0.6":"1"},F={fontSize:"12px",color:"#9ca3af"},R=o("input",{id:n,ref:w,type:"file",accept:i,multiple:a,onChange:z,disabled:u,style:{display:"none"},tabIndex:-1}),D=o("div",{style:A,onClick:I,onKeyDown:e=>{const t=e.key;"Enter"!==t&&" "!==t||(e.preventDefault(),I())},onDrop:S,onDragOver:$,onDragLeave:M,role:"button",tabIndex:u?-1:0,"aria-label":"Upload files"},o("div",{style:{fontSize:"28px",color:"#9ca3af",marginBottom:"8px"}},"↑"),o("div",{style:{fontSize:"14px",color:"#374151",marginBottom:"4px"}},o("span",{style:{color:"#3b82f6",fontWeight:"500"}},"Click to upload")," or drag and drop"),i?o("div",{style:F},i):null,d?o("div",{style:F},`Max size: ${Ie(d)}`):null),L=g.length>0?o("div",{style:{marginTop:"8px",display:"flex",flexDirection:"column",gap:"4px"}},...g.map((e,t)=>o("div",{key:`file-${t}`,style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",backgroundColor:"#f9fafb",borderRadius:"6px",border:"1px solid #e5e7eb",fontSize:"13px"}},o("div",{style:{display:"flex",alignItems:"center",gap:"8px",overflow:"hidden"}},o("span",{style:{color:"#374151",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},e.name),o("span",{style:{color:"#9ca3af",fontSize:"11px",flexShrink:"0"}},Ie(e.size))),o("button",{type:"button",style:{background:"none",border:"none",cursor:"pointer",color:"#ef4444",fontSize:"14px",padding:"2px 6px",borderRadius:"4px"},onClick:e=>{e.stopPropagation(),C(t)},"aria-label":`Remove ${e.name}`},"✕")))):null;return o(he,{label:p,helpText:h,error:b||void 0,disabled:u,htmlFor:n},o("div",null,R,D,L))}function Fe(e){const[t,n]=l(!1),[r,i]=l((e.value??e.defaultValue??"").length),a=f().replace(/[^a-zA-Z0-9_-]/g,""),d=e.id??`ml-${a}`,c={...ge(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(t=>{const n=t.target,o=n.value;i(o.length),e.onChange&&e.onChange(o),e.autoResize&&(n.style.height="auto",n.style.height=`${n.scrollHeight}px`)},[e.onChange,e.autoResize]),p=o("textarea",{id:d,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:c,onFocus:()=>n(!0),onBlur:t=>{n(!1),e.onBlur&&e.onBlur(t.target.value)},onInput:u}),h=e.showCount&&e.maxLength?o("div",{style:{fontSize:"11px",color:r>.9*(e.maxLength??1/0)?"#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(he,{label:e.label,htmlFor:d,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},p,h)}function Re(e){const t=f().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`ns-${t}`,{value:r,onChange:i,min:a,max:d,step:c=1,disabled:u=!1,prefix:p,suffix:h,label:g,error:x}=e,[m,y]=l(!1),b=s(e=>{let t=e;return void 0!==a&&t<a&&(t=a),void 0!==d&&t>d&&(t=d),t},[a,d]),v=s(()=>{u||i(b(r+c))},[u,r,c,b,i]),w=s(()=>{u||i(b(r-c))},[u,r,c,b,i]),k=s(e=>{const t=e.target.value;if(""===t||"-"===t)return;const n=parseFloat(t);isNaN(n)||i(b(n))},[b,i]),S=s(e=>{u||("ArrowUp"===e.key?(e.preventDefault(),v()):"ArrowDown"===e.key&&(e.preventDefault(),w()))},[u,v,w]),$=void 0===d||r<d,M={display:"inline-flex",alignItems:"stretch",borderRadius:"6px",overflow:"hidden",border:"1px solid "+(x?"#ef4444":m?"#3b82f6":"var(--color-border, #d1d5db)"),transition:"border-color 0.15s",opacity:u?"0.6":"1",...m&&!x?{boxShadow:"0 0 0 3px #3b82f622"}:{}},z=e=>({display:"flex",alignItems:"center",justifyContent:"center",width:"36px",backgroundColor:"var(--color-bg-subtle, #f9fafb)",border:"none",cursor:u||!e?"not-allowed":"pointer",color:u||!e?"#d1d5db":"var(--color-text, #374151)",fontSize:"inherit",fontWeight:"600",userSelect:"none",transition:"background-color 0.1s",borderRight:"none",borderLeft:"none"}),C={display:"flex",alignItems:"center",fontSize:"inherit",color:"var(--color-text-muted, #6b7280)",padding:"0 2px",backgroundColor:"var(--color-bg-subtle, #f9fafb)"},I=o("button",{type:"button",style:z(void 0===a||r>a),onClick:w,disabled:u,"aria-label":"Decrement",tabIndex:-1},"−"),A=p?o("span",{style:C},p):null,F=o("input",{id:n,type:"text",value:String(r),onInput:k,onKeyDown:S,onFocus:()=>y(!0),onBlur:()=>y(!1),disabled:u,style:{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"},"aria-label":g||"Number",role:"spinbutton","aria-valuenow":String(r),"aria-valuemin":void 0!==a?String(a):void 0,"aria-valuemax":void 0!==d?String(d):void 0}),R=h?o("span",{style:C},h):null,D=o("button",{type:"button",style:z($),onClick:v,disabled:u,"aria-label":"Increment",tabIndex:-1},"+"),L=[I];return A&&L.push(A),L.push(F),R&&L.push(R),L.push(D),o(he,{label:g,error:x,disabled:u,htmlFor:n},o("div",{style:M},...L))}function De(e){const t=f().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{options:r,value:i,onChange:l,name:a,direction:d="vertical",disabled:c=!1,error:u,label:p}=e,h=s(e=>{c||l(e)},[c,l]),g=s(e=>{if(c)return;const t=r.filter(e=>!e.disabled);if(0===t.length)return;const n=t.findIndex(e=>e.value===i);let o=n;if("ArrowDown"===e.key||"ArrowRight"===e.key)e.preventDefault(),o=n<t.length-1?n+1:0;else{if("ArrowUp"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault(),o=n>0?n-1:t.length-1}l(t[o].value)},[c,r,i,l]),x={display:"flex",flexDirection:"horizontal"===d?"row":"column",gap:"horizontal"===d?"16px":"8px"},m=r.map((e,t)=>{const r=e.value===i,l=c||!!e.disabled,s=`${n}-opt-${t}`,d={width:"18px",height:"18px",minWidth:"18px",borderRadius:"50%",border:"2px solid "+(u?"#ef4444":r?"#3b82f6":"#d1d5db"),display:"flex",alignItems:"center",justifyContent:"center",transition:"border-color 0.15s",boxSizing:"border-box"},f={width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"#3b82f6",transition:"transform 0.15s",transform:r?"scale(1)":"scale(0)"},p={display:"inline-flex",alignItems:"center",gap:"8px",cursor:l?"not-allowed":"pointer",opacity:l?"0.5":"1",userSelect:"none"};return o("label",{key:e.value,htmlFor:s,style:p,onClick:l?void 0:t=>{t.preventDefault(),h(e.value)}},o("input",{type:"radio",id:s,name:a,value:e.value,checked:r,disabled:l,style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},tabIndex:-1}),o("div",{style:d},o("div",{style:f})),o("span",{style:{fontSize:"14px",color:"#374151"}},e.label))});return o(he,{label:p,error:u,htmlFor:`${n}-opt-0`},o("div",{id:n,style:x,role:"radiogroup","aria-label":p,onKeyDown:g,tabIndex:c?-1:0},...m))}function Le(e){const t=f().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{options:r,value:i,onChange:u,placeholder:p="Select...",searchable:h=!1,multiple:g=!1,clearable:x=!1,disabled:m=!1,error:y,label:b,helpText:v}=e,[w,k]=l(!1),[S,$]=l(""),[M,z]=l(-1),C=c(null),I=d(()=>Array.isArray(i)?i:i?[i]:[],[i]),A=d(()=>{if(!h||!S)return r;const e=S.toLowerCase();return r.filter(t=>t.label.toLowerCase().includes(e))},[r,S,h]),F=d(()=>{const e={},t=[];for(const n of A)n.group?(e[n.group]||(e[n.group]=[]),e[n.group].push(n)):t.push(n);return{groups:e,ungrouped:t}},[A]),R=d(()=>0===I.length?"":I.map(e=>r.find(t=>t.value===e)).filter(Boolean).map(e=>e.label).join(", "),[I,r]);a(()=>{const e=e=>{const t=e.target;C.current&&!C.current.contains(t)&&(k(!1),$(""))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const D=s(e=>{if(g){const t=I.includes(e)?I.filter(t=>t!==e):[...I,e];u(t)}else u(e),k(!1),$("")},[g,I,u]),L=s(e=>{e.stopPropagation(),u(g?[]:"")},[g,u]),W=s(e=>{if(m)return;const t=e.key;if(!w&&("Enter"===t||" "===t||"ArrowDown"===t))return e.preventDefault(),k(!0),void z(0);if(w){if("Escape"===t)return k(!1),void $("");if("ArrowDown"===t)e.preventDefault(),z(e=>Math.min(e+1,A.length-1));else if("ArrowUp"===t)e.preventDefault(),z(e=>Math.max(e-1,0));else if("Enter"===t&&M>=0&&M<A.length){e.preventDefault();const t=A[M];t.disabled||D(t.value)}}},[m,w,M,A,D]),N={...ge({},{focused:w,error:!!y}),display:"flex",alignItems:"center",justifyContent:"space-between",cursor:m?"not-allowed":"pointer",minHeight:"38px",userSelect:"none"},E=(e,t)=>{const n=I.includes(e.value),r=t===M,i={padding:"8px 12px",cursor:e.disabled?"not-allowed":"pointer",backgroundColor:r?"#f3f4f6":n?"#eff6ff":"transparent",color:e.disabled?"#9ca3af":"#1f2937",display:"flex",alignItems:"center",gap:"8px",fontSize:"14px"};return o("div",{key:e.value,style:i,onClick:e.disabled?void 0:()=>D(e.value),onMouseEnter:()=>z(t),role:"option","aria-selected":n?"true":"false","aria-disabled":e.disabled?"true":void 0},g&&n?o("span",{style:{color:"#3b82f6",fontWeight:"700"}},"✓"):null,e.label)},T=o("span",{style:{marginLeft:"8px",fontSize:"10px",transition:"transform 0.15s",transform:w?"rotate(180deg)":"rotate(0deg)",color:"#6b7280"}},"▼"),B=o("div",{style:N,id:n,onClick:m?void 0:()=>{k(!w),z(-1)},onKeyDown:W,tabIndex:m?-1:0,role:"combobox","aria-expanded":w?"true":"false","aria-haspopup":"listbox"},o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:R?"#1f2937":"#9ca3af"}},R||p),o("span",{style:{display:"flex",alignItems:"center",gap:"4px"}},x&&I.length>0?o("span",{onClick:L,onKeyDown:e=>{const t=e.key;"Enter"!==t&&" "!==t||(e.preventDefault(),e.stopPropagation(),L(e))},style:{cursor:"pointer",color:"#9ca3af",fontSize:"14px",lineHeight:"1"},role:"button",tabIndex:0,"aria-label":"Clear selection"},"✕"):null,T)),P=h&&w?o("input",{type:"text",value:S,onInput:e=>{$(e.target.value),z(0)},placeholder:"Search...",style:{width:"100%",boxSizing:"border-box",padding:"8px 12px",border:"none",borderBottom:"1px solid #e5e7eb",outline:"none",fontSize:"14px"}}):null,_=w?o("div",{style:{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"},role:"listbox"},P,...(()=>{const e=[];let t=0;const{groups:n,ungrouped:r}=F;for(const n of r)e.push(E(n,t++));for(const r of Object.keys(n)){e.push(o("div",{key:`group-${r}`,style:{padding:"6px 12px",fontSize:"11px",fontWeight:"600",color:"#6b7280",textTransform:"uppercase",letterSpacing:"0.05em"}},r));for(const o of n[r])e.push(E(o,t++))}return 0===e.length&&e.push(o("div",{style:{padding:"8px 12px",color:"#9ca3af",fontSize:"14px"}},"No options")),e})()):null;return o(he,{label:b,error:y,helpText:v,disabled:m,htmlFor:n},o("div",{ref:C,style:{position:"relative"}},B,_))}function We(e){const t=f().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,min:u=0,max:p=100,step:h=1,showValue:g=!1,showTicks:x=!1,disabled:m=!1,marks:y,range:b=!1,label:v,error:w}=e,k=c(null),S=c(i);S.current=i;const[$,M]=l(null),z=d(()=>{if(b&&Array.isArray(r))return r;const e="number"==typeof r?r:0;return[e,e]},[r,b]),C=c(z);C.current=z;const I=e=>{const t=Math.round((e-u)/h)*h+u;return Math.max(u,Math.min(p,t))},A=e=>(e-u)/(p-u)*100,F=s(e=>{if(!k.current)return u;const t=k.current.getBoundingClientRect(),n=Math.max(0,Math.min(1,(e.clientX-t.left)/t.width));return I(u+n*(p-u))},[u,p,h]),R=s(e=>t=>{m||(t.preventDefault(),M(e))},[m]),D=s(e=>{if(m)return;const t=F(e);if(b){const e=Math.abs(t-z[0]),n=Math.abs(t-z[1]);i(e<=n?[I(t),z[1]]:[z[0],I(t)])}else i(I(t))},[m,F,b,z,i,u,p,h]);a(()=>{if(!$)return;const e=e=>{const t=F(e),n=C.current,o=S.current;"single"===$?o(I(t)):"start"===$?o([Math.min(I(t),n[1]),n[1]]):"end"===$&&o([n[0],Math.max(n[0],I(t))])},t=()=>M(null);return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[$,F,u,p,h]);const L=s(e=>{if(m)return;let t=0;if("ArrowRight"===e.key||"ArrowUp"===e.key)t=h;else{if("ArrowLeft"!==e.key&&"ArrowDown"!==e.key)return;t=-h}e.preventDefault(),b||i(I(("number"==typeof r?r:0)+t))},[m,h,b,r,i,u,p]),W={position:"relative",width:"100%",height:"6px",backgroundColor:"#e5e7eb",borderRadius:"3px",cursor:m?"not-allowed":"pointer"},N=b?A(z[0]):0,E={position:"absolute",top:"0",left:`${N}%`,width:A(b?z[1]:z[0])-N+"%",height:"100%",backgroundColor:m?"#9ca3af":"#3b82f6",borderRadius:"3px"},T=e=>v?"start"===e?`${v} minimum`:"end"===e?`${v} maximum`:v:"start"===e?"Minimum value":"end"===e?"Maximum value":"Value",B=(e,t,r)=>o("div",{id:"single"===t||"start"===t?n:void 0,style:{position:"absolute",top:"50%",left:`${e}%`,transform:"translate(-50%, -50%)",width:"18px",height:"18px",borderRadius:"50%",backgroundColor:"#ffffff",border:"2px solid "+(m?"#9ca3af":"#3b82f6"),cursor:m?"not-allowed":"grab",boxShadow:"0 1px 3px rgba(0,0,0,0.15)",zIndex:"2"},onMouseDown:R(t),role:"slider","aria-valuenow":String(r),"aria-valuemin":String(u),"aria-valuemax":String(p),"aria-label":T(t),tabIndex:m?-1:0,onKeyDown:L},g?o("div",{style:{position:"absolute",bottom:"24px",left:"50%",transform:"translateX(-50%)",backgroundColor:"#1f2937",color:"#ffffff",padding:"2px 6px",borderRadius:"4px",fontSize:"11px",whiteSpace:"nowrap"}},String(r)):null),P=[];if(x)for(let e=u;e<=p;e+=h)P.push(o("div",{key:`tick-${e}`,style:{position:"absolute",top:"10px",left:`${A(e)}%`,width:"1px",height:"6px",backgroundColor:"#d1d5db",transform:"translateX(-50%)"}}));const _=[];if(y)for(const e of y)_.push(o("div",{key:`mark-${e.value}`,style:{position:"absolute",top:"18px",left:`${A(e.value)}%`,transform:"translateX(-50%)",fontSize:"11px",color:"#6b7280",whiteSpace:"nowrap"}},e.label));const H={paddingTop:g?"28px":"8px",paddingBottom:y||x?"28px":"8px",opacity:m?"0.6":"1"},Y=[];return b?(Y.push(B(A(z[0]),"start",z[0])),Y.push(B(A(z[1]),"end",z[1]))):Y.push(B(A(z[0]),"single",z[0])),o(he,{label:v,error:w,htmlFor:n},o("div",{style:H},o("div",{ref:k,style:W,role:"presentation",onClick:D},o("div",{style:E}),...Y,...P,..._)))}const Ne=["bold","italic","underline","strikethrough","heading1","heading2","bulletList","orderedList","blockquote","link","unlink","insertHR","removeFormat","undo","redo"],Ee={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:"•",command:"insertUnorderedList"},orderedList:{label:"Numbered list",icon:"1.",command:"insertOrderedList"},blockquote:{label:"Blockquote",icon:"“",command:"formatBlock",value:"blockquote"},link:{label:"Insert link",icon:"🔗",command:"createLink"},unlink:{label:"Remove link",icon:"⛔",command:"unlink"},insertHR:{label:"Horizontal rule",icon:"―",command:"insertHorizontalRule"},removeFormat:{label:"Clear format",icon:"✘",command:"removeFormat"},undo:{label:"Undo",icon:"↩",command:"undo"},redo:{label:"Redo",icon:"↪",command:"redo"}};function Te(e){const[t,n]=l(!1),r=c(null),i=f().replace(/[^a-zA-Z0-9_-]/g,""),d=e.id??i,u=e.toolbar??Ne,p=e.toolbarStyle??{},h=e.editorStyle??{};a(()=>{r.current&&void 0!==e.value&&(r.current.innerHTML=e.value)},[]);const g=s((t,n)=>{if(!e.disabled&&!e.readOnly){if("createLink"===t){const e=prompt("Enter URL:");if(!e)return;document.execCommand(t,!1,e)}else n&&"formatBlock"===t?document.execCommand(t,!1,`<${n}>`):document.execCommand(t,!1,n);r.current&&e.onChange&&e.onChange(r.current.innerHTML)}},[e.disabled,e.readOnly,e.onChange]),x=s(()=>{r.current&&e.onChange&&e.onChange(r.current.innerHTML)},[e.onChange]),m=s(()=>{n(!1),r.current&&e.onBlur&&e.onBlur(r.current.innerHTML)},[e.onBlur]),y=o("div",{className:"texteditor-toolbar",style:{display:"flex",flexWrap:"wrap",gap:"2px",padding:"6px 8px",backgroundColor:p.backgroundColor??"#f9fafb",borderBottom:p.borderBottom??"1px solid #e5e7eb",borderRadius:"6px 6px 0 0"}},...u.map(t=>{const n=Ee[t];return n?o("button",{key:t,type:"button",title:n.label,onClick:()=>g(n.command,n.value),disabled:e.disabled||e.readOnly,style:{padding:"4px 8px",border:"none",borderRadius:"4px",backgroundColor:"transparent",color:p.buttonColor??"#374151",cursor:e.disabled?"not-allowed":"pointer",fontSize:p.buttonSize??"13px",fontWeight:"bold"===t?"700":"italic"===t?"400":"500",fontStyle:"italic"===t?"italic":"normal",textDecoration:"underline"===t?"underline":"strikethrough"===t?"line-through":"none",minWidth:"28px",textAlign:"center",lineHeight:"1.4"}},n.icon):null})),b=o("div",{ref:r,id:d,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:h.padding??"12px 14px",minHeight:e.minHeight??"200px",maxHeight:e.maxHeight??"none",overflow:"auto",backgroundColor:h.backgroundColor??"#ffffff",color:h.color??"#1f2937",fontFamily:h.fontFamily??"inherit",fontSize:h.fontSize??"14px",lineHeight:h.lineHeight??"1.6",outline:"none",borderRadius:"0 0 6px 6px",border:t?"1px solid #3b82f6":e.error?"1px solid #ef4444":"1px solid #d1d5db",borderTop:"none",transition:"border-color 0.15s"},onFocus:()=>n(!0),onBlur:m,onInput:x});return o(he,{label:e.label,htmlFor:d,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"}},y,b))}function Be(e){const[t,n]=l(!1),r=f().replace(/[^a-zA-Z0-9_-]/g,""),i=e.id??`tf-${r}`,a=ge(e.inputStyle??{},{focused:t,error:!!e.error}),s=!(!e.prefix&&!e.suffix),d=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:s?{...a,border:"none",boxShadow:"none",flex:"1",minWidth:"0"}:a,onFocus:()=>n(!0),onBlur:t=>{n(!1),e.onBlur&&e.onBlur(t.target.value)},onInput:t=>{const n=t.target.value;e.onInput&&e.onInput(n),e.onChange&&e.onChange(n)},onKeyDown:t=>{"Enter"===t.key&&e.onEnter&&e.onEnter(t.target.value)}}),c=s?o("div",{style:{...a,display:"flex",alignItems:"center",gap:"8px",padding:"0"}},e.prefix?o("span",{style:{paddingLeft:"10px",color:"#9ca3af",flexShrink:"0"}},e.prefix):null,d,e.suffix?o("span",{style:{paddingRight:"10px",color:"#9ca3af",flexShrink:"0"}},e.suffix):null):d;return o(he,{label:e.label,htmlFor:i,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},c)}const Pe=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Paris","Asia/Tokyo"];function _e(e){return String(e).padStart(2,"0")}function He(e){const t=f().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,format:a="24h",minuteStep:c=1,disabled:u=!1,label:p,error:h,showSeconds:g=!1,timezone:x,showTimezone:m=!1,timezones:y=Pe,onTimezoneChange:b}=e,[v,w]=l(!1),k=d(()=>function(e){const t=e.split(":");return{hour:parseInt(t[0],10)||0,minute:parseInt(t[1],10)||0,second:parseInt(t[2],10)||0}}(r),[r]),S="12h"===a,$=k.hour>=12,M=S?k.hour%12||12:k.hour,z=s((e,t,n)=>{const o=Math.max(0,Math.min(23,e)),r=Math.max(0,Math.min(59,t)),l=Math.max(0,Math.min(59,n??0));i(g?`${_e(o)}:${_e(r)}:${_e(l)}`:`${_e(o)}:${_e(r)}`)},[i,g]),C=s(e=>{let t=parseInt(e.target.value,10)||0;S&&(t%=12,$&&(t+=12)),z(t,k.minute,k.second)},[S,$,k.minute,k.second,z]),I=s(e=>{const t=parseInt(e.target.value,10)||0;z(k.hour,t,k.second)},[k.hour,k.second,z]),A=s(e=>{const t=parseInt(e.target.value,10)||0;z(k.hour,k.minute,t)},[k.hour,k.minute,z]),F=s(()=>{if(u)return;const e=$?k.hour-12:k.hour+12;z(e,k.minute,k.second)},[u,$,k.hour,k.minute,k.second,z]),R=s(e=>{u||z(k.hour+e,k.minute,k.second)},[u,k.hour,k.minute,k.second,z]),D=s(e=>{u||z(k.hour,k.minute+e*c,k.second)},[u,k.hour,k.minute,k.second,c,z]),L=s(e=>{u||z(k.hour,k.minute,k.second+e)},[u,k.hour,k.minute,k.second,z]),W=s(e=>{const t=e.target.value;b&&b(t)},[b]),N={display:"inline-flex",alignItems:"center",gap:"4px",...ge({},{focused:v,error:!!h})},E={display:"flex",flexDirection:"column",alignItems:"center"},T={background:"none",border:"none",cursor:u?"not-allowed":"pointer",fontSize:"10px",padding:"0 4px",color:"#6b7280",lineHeight:"1"},B={width:"32px",textAlign:"center",border:"none",outline:"none",fontSize:"14px",fontFamily:"monospace",backgroundColor:"transparent",color:"#1f2937",padding:"0"},P={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:u?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},_=o("div",{style:E},o("button",{type:"button",style:T,onClick:()=>R(1),disabled:u},"▲"),o("input",{type:"text",value:_e(M),onChange:C,style:B,disabled:u,"aria-label":"Hour",onFocus:()=>w(!0),onBlur:()=>w(!1)}),o("button",{type:"button",style:T,onClick:()=>R(-1),disabled:u},"▼")),H=o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"),Y=o("div",{style:E},o("button",{type:"button",style:T,onClick:()=>D(1),disabled:u},"▲"),o("input",{type:"text",value:_e(k.minute),onChange:I,style:B,disabled:u,"aria-label":"Minute",onFocus:()=>w(!0),onBlur:()=>w(!1)}),o("button",{type:"button",style:T,onClick:()=>D(-1),disabled:u},"▼")),j=g?o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"):null,q=g?o("div",{style:E},o("button",{type:"button",style:T,onClick:()=>L(1),disabled:u},"▲"),o("input",{type:"text",value:_e(k.second),onChange:A,style:B,disabled:u,"aria-label":"Second",onFocus:()=>w(!0),onBlur:()=>w(!1)}),o("button",{type:"button",style:T,onClick:()=>L(-1),disabled:u},"▼")):null,O=S?o("button",{type:"button",style:P,onClick:F,disabled:u,"aria-label":"Toggle AM/PM"},$?"PM":"AM"):null,U={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:u?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},X=x&&!m?o("span",{style:{marginLeft:"8px",fontSize:"12px",fontWeight:"600",color:"#6b7280"}},x):null,V=m?o("select",{style:U,value:x??y[0],onChange:W,disabled:u,"aria-label":"Timezone"},...y.map(e=>o("option",{key:e,value:e},e))):null,G=[_,H,Y];return j&&G.push(j),q&&G.push(q),O&&G.push(O),X&&G.push(X),V&&G.push(V),o(he,{label:p,error:h,disabled:u,htmlFor:n},o("div",{id:n,style:N},...G))}const Ye={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 je(e){const{checked:t,onChange:n,label:r,labelPosition:i="right",disabled:l=!1,size:a="md",onColor:d="#3b82f6",offColor:c="#d1d5db"}=e,f=Ye[a],u=s(()=>{l||n(!t)},[l,t,n]),p=s(e=>{l||" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),n(!t))},[l,t,n]),h={width:`${f.trackW}px`,height:`${f.trackH}px`,borderRadius:`${f.trackH}px`,backgroundColor:t?d:c,position:"relative",cursor:l?"not-allowed":"pointer",transition:"background-color 0.2s",flexShrink:"0"},g=t?f.trackW-f.thumbSize-f.offset:f.offset,x={width:`${f.thumbSize}px`,height:`${f.thumbSize}px`,borderRadius:"50%",backgroundColor:"#ffffff",position:"absolute",top:`${f.offset}px`,left:`${g}px`,transition:"left 0.2s",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"},m={display:"inline-flex",alignItems:"center",gap:"8px",opacity:l?"0.5":"1",userSelect:"none"},y=r?o("span",{style:{fontSize:"14px",color:"#374151"}},r):null,b=o("div",{style:h},o("div",{style:x}));return o("div",{style:m,onClick:u,onKeyDown:p,tabIndex:l?-1:0,role:"switch","aria-checked":t?"true":"false","aria-disabled":l?"true":void 0,"aria-label":r},...("left"===i?[y,b]:[b,y]).filter(Boolean))}const qe={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 Oe(e){const t=!1!==e.bordered,n=e.shadow??"sm",r=e.padding??"16px",i=e.borderRadius??"8px",l=d(()=>{const o={display:"flex",flexDirection:"column",borderRadius:i,overflow:"hidden",backgroundColor:"#ffffff",transition:"box-shadow 0.2s, transform 0.2s"};return t&&(o.border="1px solid #e5e7eb"),o.boxShadow=qe[n]??qe.sm,e.hoverable&&(o.cursor="pointer"),{...o,...e.style??{}}},[t,n,i,e.hoverable,e.style]),a={display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:r,gap:"12px"},s={padding:r,paddingTop:e.title||e.subtitle?"0":r,flex:"1"},c={padding:r,paddingTop:"0",borderTop:"1px solid #f3f4f6",paddingBottom:r,marginTop:"auto"},f=e.title||e.subtitle||e.headerAction;return o("div",{className:`card ${e.hoverable?"card--hoverable":""} ${e.className??""}`.trim(),style:l},e.image?o("img",{src:e.image,alt:e.imageAlt??"",style:{width:"100%",height:"auto",display:"block",objectFit:"cover"}}):null,f?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:s},e.children),e.footer?o("div",{className:"card__footer",style:c},e.footer):null)}function Ue(e){const t=d(()=>{const t={display:e.inline?"inline-flex":"flex"};return e.direction&&(t.flexDirection=e.direction),e.wrap&&(t.flexWrap=e.wrap),e.gap&&(t.gap=e.gap),e.alignItems&&(t.alignItems=e.alignItems),e.justifyContent&&(t.justifyContent=e.justifyContent),{...t,...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 Xe(e){const t=d(()=>{const t={};return e.flex&&(t.flex=e.flex),void 0!==e.grow&&(t.flexGrow=String(e.grow)),void 0!==e.shrink&&(t.flexShrink=String(e.shrink)),e.basis&&(t.flexBasis=e.basis),e.alignSelf&&(t.alignSelf=e.alignSelf),void 0!==e.order&&(t.order=String(e.order)),{...t,...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 Ve(e){const t=d(()=>{const t={display:"grid"};return e.minColWidth?t.gridTemplateColumns=`repeat(auto-fit, minmax(${e.minColWidth}, 1fr))`:void 0!==e.columns&&(t.gridTemplateColumns="number"==typeof e.columns?`repeat(${e.columns}, 1fr)`:e.columns),e.rows&&(t.gridTemplateRows=e.rows),e.gap&&(t.gap=e.gap),e.alignItems&&(t.alignItems=e.alignItems),e.justifyItems&&(t.justifyItems=e.justifyItems),e.areas&&e.areas.length>0&&(t.gridTemplateAreas=e.areas.map(e=>`"${e}"`).join(" ")),{...t,...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 Ge(e){const t=d(()=>{const t={};return e.gridColumn&&(t.gridColumn=e.gridColumn),e.gridRow&&(t.gridRow=e.gridRow),e.gridArea&&(t.gridArea=e.gridArea),e.alignSelf&&(t.alignSelf=e.alignSelf),e.justifySelf&&(t.justifySelf=e.justifySelf),{...t,...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)}const Ke={none:"none",sm:"0 1px 3px rgba(0,0,0,0.12)",md:"0 4px 6px rgba(0,0,0,0.1)"};function Ze(e){const t=!1!==e.bordered,n=e.shadow??"none",[r,i]=l(!!e.defaultCollapsed),f=c(null),[u,p]=l("auto");a(()=>{if(!e.collapsible)return;const t=f.current;t&&p(`${t.scrollHeight}px`)},[e.children,e.collapsible]);const h=s(()=>{e.collapsible&&i(e=>!e)},[e.collapsible]),g=s(t=>{if(!e.collapsible)return;const n=t.key;"Enter"!==n&&" "!==n||(t.preventDefault(),h())},[e.collapsible,h]),x=d(()=>{const o={borderRadius:"6px",overflow:"hidden",backgroundColor:"#ffffff"};return t&&(o.border="1px solid #e5e7eb"),o.boxShadow=Ke[n]??Ke.none,{...o,...e.style??{}}},[t,n,e.style]),m={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",gap:"8px",backgroundColor:"#f9fafb",userSelect:"none",cursor:e.collapsible?"pointer":"default"},y={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"},b={maxHeight:r?"0":u,overflow:"hidden",transition:"max-height 0.3s ease"};return o("div",{className:`panel ${e.className??""}`.trim(),style:x},o("div",{className:"panel__header",style:m,onClick:h,onKeyDown:g,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:y}):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?b:{},ref:f},o("div",{className:"panel__body",style:{padding:"16px"}},e.children)))}function Je(e,t){return"both"===e?"auto":"horizontal"===e?"x"===t?"auto":"hidden":"y"===t?"auto":"hidden"}function Qe(e){switch(e){case"never":return{scrollbarWidth:"none"};case"always":case"hover":return{scrollbarWidth:"thin"};default:return{scrollbarWidth:"auto"}}}function et(e){const t=e.direction??"vertical",n=e.showScrollbar??"auto",r=e.shadow??!1,i=c(null),[f,u]=l(!0),[p,h]=l(!1),[g,x]=l(!0),[m,y]=l(!1),b=s(()=>{const e=i.current;e&&(u(e.scrollTop<=2),h(e.scrollTop+e.clientHeight>=e.scrollHeight-2),x(e.scrollLeft<=2),y(e.scrollLeft+e.clientWidth>=e.scrollWidth-2))},[]);a(()=>{b()},[b]);const v=s(()=>{r&&b()},[r,b]),w=d(()=>{const o={position:"relative",overflowX:Je(t,"x"),overflowY:Je(t,"y"),...Qe(n)};return e.maxHeight&&(o.maxHeight=e.maxHeight),e.maxWidth&&(o.maxWidth=e.maxWidth),e.padding&&(o.padding=e.padding),{...o,...e.style??{}}},[t,n,e.maxHeight,e.maxWidth,e.padding,e.style]),k=[];if(r){const e="vertical"===t||"both"===t,n="horizontal"===t||"both"===t;e&&!f&&k.push("inset 0 8px 6px -6px rgba(0,0,0,0.15)"),e&&!p&&k.push("inset 0 -8px 6px -6px rgba(0,0,0,0.15)"),n&&!g&&k.push("inset 8px 0 6px -6px rgba(0,0,0,0.15)"),n&&!m&&k.push("inset -8px 0 6px -6px rgba(0,0,0,0.15)")}const S={...w};return k.length>0&&(S.boxShadow=k.join(", ")),o("div",{className:`scroll-container scroll-container--${t} ${e.className??""}`.trim(),style:S,ref:i,onScroll:v},e.children)}function tt(e){const t=e.direction??"horizontal",n="horizontal"===t,r=e.dividerSize??6,i=e.minSize??50,[f,u]=l(e.initialSplit??50),p=c(null),h=c(!1),g=s(e=>{e.preventDefault(),h.current=!0,document.body.style.cursor=n?"col-resize":"row-resize",document.body.style.userSelect="none"},[n]);a(()=>{const t=t=>{if(!h.current||!p.current)return;const o=p.current.getBoundingClientRect(),r=n?o.width:o.height,l=n?t.clientX-o.left:t.clientY-o.top;if(r<=0)return;const a=i/r*100,s=e.maxSize?e.maxSize/r*100:100-a;let d=l/r*100;d=Math.max(a,Math.min(s,d)),u(d)},o=()=>{h.current&&(h.current=!1,document.body.style.cursor="",document.body.style.userSelect="")};return document.addEventListener("mousemove",t),document.addEventListener("mouseup",o),()=>{document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",o)}},[n,i,e.maxSize]);const x=d(()=>({display:"flex",flexDirection:n?"row":"column",width:"100%",height:"100%",overflow:"hidden",...e.style??{}}),[n,e.style]),m=n?{width:`calc(${f}% - ${r/2}px)`,overflow:"auto",flexShrink:"0"}:{height:`calc(${f}% - ${r/2}px)`,overflow:"auto",flexShrink:"0"},y={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%"}},b=Array.isArray(e.children)?e.children:[];return o("div",{className:`splitter splitter--${t} ${e.className??""}`.trim(),style:x,ref:p},o("div",{className:"splitter__pane splitter__pane--first",style:m},b[0]??null),o("div",{className:"splitter__divider",style:y,onMouseDown:g,onKeyDown:e=>{const t=e.key;!n||"ArrowLeft"!==t&&"ArrowRight"!==t?n||"ArrowUp"!==t&&"ArrowDown"!==t||(e.preventDefault(),u(e=>{const n="ArrowDown"===t?2:-2;return Math.max(5,Math.min(95,e+n))})):(e.preventDefault(),u(e=>{const n="ArrowRight"===t?2:-2;return Math.max(5,Math.min(95,e+n))}))},role:"separator",tabIndex:0,"aria-orientation":n?"vertical":"horizontal","aria-valuenow":String(Math.round(f)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Resize panels"}),o("div",{className:"splitter__pane splitter__pane--second",style:{flex:"1",overflow:"auto",minWidth:"0",minHeight:"0"}},b[1]??null))}function nt(e){const t=e.position??"top",n=e.variant??"line",r=e.tabs.find(e=>!e.disabled)?.id??"",[i,a]=l(e.activeTab??r),f=e.activeTab??i,u=c(null),p=s(t=>{a(t),e.onChange&&e.onChange(t)},[e.onChange]),h=s(n=>{const o=e.tabs.filter(e=>!e.disabled),r=o.findIndex(e=>e.id===f);if(-1===r)return;const i="left"===t||"right"===t,l=i?"ArrowUp":"ArrowLeft",a=i?"ArrowDown":"ArrowRight";let s=-1;if(n.key===l?s=r>0?r-1:o.length-1:n.key===a?s=r<o.length-1?r+1:0:"Home"===n.key?s=0:"End"===n.key&&(s=o.length-1),s>=0){n.preventDefault(),p(o[s].id);const t=u.current;if(t){const n=t.querySelectorAll('[role="tab"]')[e.tabs.indexOf(o[s])];n&&n.focus()}}},[e.tabs,f,t,p]),g="left"===t||"right"===t,x="bottom"===t||"right"===t,m=d(()=>({display:"flex",flexDirection:g?x?"row-reverse":"row":x?"column-reverse":"column",width:"100%",...e.style??{}}),[g,x,e.style]),y={display:"flex",flexDirection:g?"column":"row",gap:"pill"===n?"4px":"0",..."line"!==n||g?{}:{borderBottom:"2px solid #e5e7eb"},..."line"===n&&g?{borderRight:"left"===t?"2px solid #e5e7eb":"none",borderLeft:"right"===t?"2px solid #e5e7eb":"none"}:{},..."card"===n?{backgroundColor:"#f9fafb"}:{},..."pill"===n?{padding:"4px"}:{},flexShrink:"0"},b=e.tabs.find(e=>e.id===f),v=e.tabs.map(e=>{const r=e.id===f,i={padding:"8px 16px",border:"none",background:"none",cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?"0.5":"1",fontSize:"14px",fontWeight:r?"600":"400",color:r?"#3b82f6":"#6b7280",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"6px",outline:"none",transition:"color 0.15s, background-color 0.15s"};return"line"===n?g?"left"===t?(i.borderRight=r?"2px solid #3b82f6":"2px solid transparent",i.marginRight="-2px"):(i.borderLeft=r?"2px solid #3b82f6":"2px solid transparent",i.marginLeft="-2px"):(i.borderBottom=r?"2px solid #3b82f6":"2px solid transparent",i.marginBottom="-2px"):"card"===n?(i.backgroundColor=r?"#ffffff":"transparent",i.borderRadius="6px 6px 0 0",r&&(i.border="1px solid #e5e7eb",i.borderBottom="1px solid #ffffff")):"pill"===n&&(i.borderRadius="9999px",i.backgroundColor=r?"#3b82f6":"transparent",i.color=r?"#ffffff":"#6b7280"),o("button",{key:e.id,role:"tab","aria-selected":String(r),"aria-controls":`tabpanel-${e.id}`,"aria-disabled":e.disabled?"true":void 0,id:`tab-${e.id}`,tabIndex:r?"0":"-1",style:i,onClick:e.disabled?void 0:()=>p(e.id),onKeyDown:h},e.icon?o("span",{className:"tabs__tab-icon"},e.icon):null,e.label)});return o("div",{className:`tabs tabs--${t} tabs--${n} ${e.className??""}`.trim(),style:m},o("div",{className:"tabs__list",role:"tablist","aria-label":"Tabs","aria-orientation":g?"vertical":"horizontal",style:y,ref:u},...v),o("div",{className:"tabs__panel",role:"tabpanel",id:`tabpanel-${f}`,"aria-labelledby":`tab-${f}`,style:{flex:"1",padding:"16px",minWidth:"0",minHeight:"0"},tabIndex:"0"},b?b.content:null))}function ot(e){const t=e.items??[],n=t.length,r=!1!==e.loop,i=!1!==e.showDots,u=!1!==e.showArrows,p=e.animation??"slide",h=e.interval??5e3,g=f().replace(/[^a-zA-Z0-9_-]/g,""),[x,m]=l(0),y=c(null),b=c(null),v=s(t=>{let o=t;o=r?(t%n+n)%n:Math.max(0,Math.min(t,n-1)),m(o),e.onChange&&e.onChange(o)},[n,r,e.onChange]),w=s(()=>v(x+1),[x,v]),k=s(()=>v(x-1),[x,v]);a(()=>{if(!e.autoPlay||n<=1)return;const t=setInterval(w,h);return()=>clearInterval(t)},[e.autoPlay,h,w,n]),a(()=>{const e=e=>{"ArrowLeft"===e.key?k():"ArrowRight"===e.key&&w()},t=b.current;if(t)return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)},[w,k]);const S="fade"===p?`@keyframes liq-fade-in-${g}{from{opacity:0}to{opacity:1}}`:"",$=d(()=>"fade"===p?{position:"relative",width:"100%"}:{display:"flex",transition:"transform 0.4s ease",transform:`translateX(-${100*x}%)`,width:"100%"},[x,p]),M={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)"},z=t.map((e,t)=>{const n="fade"===p?{position:t===x?"relative":"absolute",top:"0",left:"0",width:"100%",opacity:t===x?"1":"0",transition:"opacity 0.4s ease"}:{flex:"0 0 100%",width:"100%"};return o("div",{key:String(t),style:n},e.content,e.caption?o("div",{style:{textAlign:"center",padding:"8px 12px",fontSize:"13px",color:"#6b7280"}},e.caption):null)}),C=i?o("div",{style:{display:"flex",justifyContent:"center",gap:"8px",padding:"12px 0"}},...t.map((e,t)=>o("button",{key:String(t),"aria-label":`Go to slide ${t+1}`,onclick:()=>v(t),style:{width:"10px",height:"10px",borderRadius:"50%",border:"none",cursor:"pointer",backgroundColor:t===x?"#3b82f6":"#d1d5db",transition:"background-color 0.2s",padding:"0"}}))):null;return o("div",{ref:b,tabindex:"0",role:"region","aria-label":"Carousel",style:{position:"relative",overflow:"hidden",width:"100%",outline:"none"},onpointerdown:e=>{y.current=e.clientX},onpointerup:e=>{if(null==y.current)return;const t=e.clientX-y.current;t>50?k():t<-50&&w(),y.current=null}},S?o("style",null,S):null,o("div",{style:$},...z),u&&n>1?o("button",{"aria-label":"Previous slide",onclick:k,style:{...M,left:"8px"}},"‹"):null,u&&n>1?o("button",{"aria-label":"Next slide",onclick:w,style:{...M,right:"8px"}},"›"):null,C)}function rt(e){const[t,n]=l("loading"),r=c(null),i=f().replace(/[^a-zA-Z0-9_-]/g,""),s=!1!==e.lazy,u="number"==typeof e.width?`${e.width}px`:e.width,p="number"==typeof e.height?`${e.height}px`:e.height;a(()=>{n("loading")},[e.src]);const h=d(()=>{const t={display:"inline-block",position:"relative",overflow:"hidden"};return u&&(t.width=u),p&&(t.height=p),e.borderRadius&&(t.borderRadius=e.borderRadius),t},[u,p,e.borderRadius]),g=d(()=>{const n={display:"block",width:"100%",height:"100%"};return e.objectFit&&(n.objectFit=e.objectFit),"loading"===t&&(n.opacity="0",n.position="absolute"),"error"===t&&(n.display="none"),n},[e.objectFit,t]);let x=null;"loading"===t&&("skeleton"===e.placeholder?x=o("div",null,o("style",null,`@keyframes liq-img-shimmer-${i}{0%{background-position:-200% 0}100%{background-position:200% 0}}`),o("div",{style:{width:u??"100%",height:p??"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`}})):"blur"===e.placeholder?x=o("div",{style:{width:u??"100%",height:p??"200px",backgroundColor:"#d1d5db",filter:"blur(20px)"}}):null!=e.placeholder&&!1!==e.placeholder&&(x=e.placeholder));let m=null;"error"===t&&null!=e.fallback&&(m="string"==typeof e.fallback?o("img",{src:e.fallback,alt:e.alt??"",style:{display:"block",width:"100%",height:"100%",objectFit:e.objectFit??"cover"}}):e.fallback);const y=o("div",{style:h},x,o("img",{ref:r,src:e.src,alt:e.alt??"",loading:s?"lazy":void 0,style:g,onload:()=>n("loaded"),onerror:()=>n("error")}),m);return e.caption?o("figure",{style:{margin:"0",display:"inline-block"}},y,o("figcaption",{style:{fontSize:"13px",color:"#6b7280",marginTop:"6px",textAlign:"center"}},e.caption)):y}function it(e){return!isFinite(e)||e<0?"0:00":`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,"0")}`}function lt(e){const t=!1!==e.controls,n=c(null);f().replace(/[^a-zA-Z0-9_-]/g,"");const[r,i]=l(!1),[d,u]=l(0),[p,h]=l(0),[g,x]=l(e.muted?0:1),[m,y]=l(!!e.muted),[b,v]=l(!0),w="number"==typeof e.width?`${e.width}px`:e.width??"100%",k="number"==typeof e.height?`${e.height}px`:e.height??"auto";a(()=>{const t=n.current;if(!t)return;const o=()=>{i(!0),e.onPlay&&e.onPlay()},r=()=>{i(!1),e.onPause&&e.onPause()},l=()=>{i(!1),e.onEnded&&e.onEnded()},a=()=>{u(t.currentTime),h(t.duration),e.onTimeUpdate&&e.onTimeUpdate(t.currentTime,t.duration)},s=()=>{h(t.duration)};return t.addEventListener("play",o),t.addEventListener("pause",r),t.addEventListener("ended",l),t.addEventListener("timeupdate",a),t.addEventListener("loadedmetadata",s),()=>{t.removeEventListener("play",o),t.removeEventListener("pause",r),t.removeEventListener("ended",l),t.removeEventListener("timeupdate",a),t.removeEventListener("loadedmetadata",s)}},[e.onPlay,e.onPause,e.onEnded,e.onTimeUpdate]);const S=s(()=>{const e=n.current;e&&(e.paused?e.play():e.pause())},[]),$=s(e=>{const t=n.current;if(!t||!isFinite(t.duration))return;const o=e.currentTarget.getBoundingClientRect(),r=Math.max(0,Math.min(1,(e.clientX-o.left)/o.width));t.currentTime=r*t.duration},[]),M=s(e=>{const t=n.current,o=parseFloat(e.target.value);t&&(t.volume=o,t.muted=0===o,x(o),y(0===o))},[]),z=s(()=>{const e=n.current;e&&e.requestFullscreen&&e.requestFullscreen()},[]);if(!t)return o("video",{ref:n,src:e.src,poster:e.poster,controls:!0,autoplay:!!e.autoPlay||void 0,loop:!!e.loop||void 0,muted:!!e.muted||void 0,style:{width:w,height:k,display:"block"}});const C=p>0?d/p*100:0,I={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:b?"1":"0",transition:"opacity 0.3s"}},o("button",{"aria-label":r?"Pause":"Play",onclick:S,style:I},r?"⏸":"▶"),o("div",{onclick:$,style:{flex:"1",height:"4px",backgroundColor:"rgba(255,255,255,0.3)",borderRadius:"2px",cursor:"pointer",position:"relative"}},o("div",{style:{width:`${C}%`,height:"100%",backgroundColor:"#3b82f6",borderRadius:"2px",transition:"width 0.1s linear"}})),o("span",{style:{color:"#ffffff",fontSize:"12px",whiteSpace:"nowrap",fontFamily:"monospace"}},`${it(d)} / ${it(p)}`),o("input",{type:"range",min:"0",max:"1",step:"0.05",value:String(m?0:g),oninput:M,"aria-label":"Volume",style:{width:"60px",cursor:"pointer"}}),o("button",{"aria-label":"Fullscreen",onclick:z,style:I},"⛶"));return o("div",{style:{position:"relative",width:w,height:k,backgroundColor:"#000",overflow:"hidden"},onmouseenter:()=>v(!0),onmouseleave:()=>{r&&v(!1)}},o("video",{ref:n,src:e.src,poster:e.poster,autoplay:!!e.autoPlay||void 0,loop:!!e.loop||void 0,muted:!!e.muted||void 0,playsinline:!0,onclick:S,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"}}),A)}function at(e){const t=e.orientation??"vertical",n=e.role??"navigation",r=e.keyboardNav??!0,i=e.styling??{},l=c(null),a={display:"flex",flexDirection:"horizontal"===t?"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:"number"==typeof i.width?`${i.width}px`:i.width??"auto",overflow:"auto",boxSizing:"border-box",listStyle:"none",margin:"0",...i.boxShadow?{boxShadow:i.boxShadow}:{},...i.maxHeight?{maxHeight:"number"==typeof i.maxHeight?`${i.maxHeight}px`:i.maxHeight}:{},...i.custom??{}},d=s(e=>{if(!r)return;const n=e,o=l.current;if(!o)return;const i=Array.from(o.querySelectorAll('button, [tabindex]:not([tabindex="-1"]), a[href], [role="menuitem"], [role="treeitem"]')),a=i.indexOf(document.activeElement);if(a<0)return;const s="vertical"===t,d=s?"ArrowDown":"ArrowRight",c=s?"ArrowUp":"ArrowLeft";if(n.key===d){n.preventDefault();const e=i[a+1];e&&e.focus()}else if(n.key===c){n.preventDefault();const e=i[a-1];e&&e.focus()}else"Home"===n.key?(n.preventDefault(),i[0]?.focus()):"End"===n.key&&(n.preventDefault(),i[i.length-1]?.focus())},[r,t]);return o("nav",{ref:l,role:n,"aria-label":e.ariaLabel??void 0,"aria-orientation":t,className:`nav-wrapper ${e.className??""}`.trim(),style:a,onKeyDown:d},e.children)}function st(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 dt(){const[e,t]=l(!1);return{hover:e,onMouseEnter:s(()=>t(!0),[]),onMouseLeave:s(()=>t(!1),[])}}function ct(e){const{section:t,expanded:n,onToggle:r,headerStyle:i,expandIcon:l,collapseIcon:a,iconPosition:d}=e,{hover:c,onMouseEnter:f,onMouseLeave:u}=dt(),p=!0===t.disabled,h={display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",boxSizing:"border-box",padding:i.padding??"12px 16px",backgroundColor:p?"#f9fafb":c?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}:{}};"left"===d&&(h.flexDirection="row");const g=s(e=>{const t=e;p||"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),r())},[p,r]),x=s(()=>{p||r()},[p,r]),m=o("span",{"aria-hidden":"true",style:{display:"inline-block",transition:"transform 0.2s ease",transform:n?"rotate(180deg)":"rotate(0deg)",flexShrink:"0",marginLeft:"right"===d?"auto":"0",marginRight:"left"===d?"8px":"0",paddingLeft:"right"===d?"8px":"0"}},n?a:l),y=t.icon?o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},o("span",{"aria-hidden":"true"},t.icon),t.header):t.header,b="left"===d?[m,y]:[y,m];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:h,onClick:x,onKeyDown:g,onMouseEnter:f,onMouseLeave:u},...b)}function ft(e){const{section:t,expanded:n,contentStyle:r,animated:i}=e,l={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:l},o("div",{style:a},t.content))}function ut(e){const{sections:t,defaultExpanded:n,allowMultiple:r=!1,headerStyle:i={},contentStyle:a={},wrapperStyle:c,expandIcon:f="+",collapseIcon:u="−",iconPosition:p="right",animated:h=!0,onChange:g}=e,[x,m]=l(()=>n??[]),y=s(e=>{m(t=>{let n;return n=t.includes(e)?t.filter(t=>t!==e):r?[...t,e]:[e],g&&g(n),n})},[r,g]),b=d(()=>t.map(e=>{const t=x.includes(e.id),n=o(ct,{key:`header-${e.id}`,section:e,expanded:t,onToggle:()=>y(e.id),headerStyle:i,expandIcon:f,collapseIcon:u,iconPosition:p}),r=o(ft,{key:`content-${e.id}`,section:e,expanded:t,contentStyle:a,animated:h});return o("div",{key:e.id,"data-accordion-section":e.id,style:{width:"100%"}},n,r)}),[t,x,i,a,f,u,p,h,y]);return o(at,{role:"region",ariaLabel:"Accordion",styling:c,keyboardNav:!0},...b)}const pt={sm:{fontSize:"12px",padding:"4px 0"},md:{fontSize:"14px",padding:"6px 0"},lg:{fontSize:"16px",padding:"8px 0"}};function ht(e){const{items:t,separator:n="/",maxItems:r,size:i="md"}=e,[a,d]=l(!1),c=pt[i],f=s(()=>{d(!0)},[]);let u=t,p=!1;if(r&&r>1&&t.length>r&&!a){p=!0;const e=1,n=r-1;u=[...t.slice(0,e),{label:"..."},...t.slice(t.length-n)]}const h=u.map((e,t)=>((e,t,r)=>{const i=t===r.length-1,l=p&&"..."===e.label&&1===t,a=[];var s;return t>0&&a.push(o("span","string"==typeof(s=n)?{"aria-hidden":"true",style:{margin:"0 8px",color:"#9ca3af",userSelect:"none"}}:{"aria-hidden":"true",style:{margin:"0 8px"}},s)),l?a.push(o("button",{type:"button",onClick:f,style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",fontSize:c.fontSize,color:"#6b7280",fontFamily:"inherit"},"aria-label":"Show all breadcrumb items"},"...")):i?a.push(o("span",{"aria-current":"page",style:{color:"#1f2937",fontWeight:"600",fontSize:c.fontSize}},e.label)):e.href?a.push(o("a",{href:e.href,onClick:e.onClick?t=>{t.preventDefault(),e.onClick()}:void 0,style:{color:"#2563eb",textDecoration:"none",fontSize:c.fontSize}},e.label)):e.onClick?a.push(o("button",{type:"button",onClick:e.onClick,style:{background:"none",border:"none",cursor:"pointer",color:"#2563eb",padding:"0",fontSize:c.fontSize,fontFamily:"inherit"}},e.label)):a.push(o("span",{style:{color:"#6b7280",fontSize:c.fontSize}},e.label)),o("li",{key:String(t),style:{display:"inline-flex",alignItems:"center"}},...a)})(e,t,u));return o(at,{orientation:"horizontal",role:"navigation",ariaLabel:"Breadcrumb",keyboardNav:!1,styling:{border:"none",borderRadius:"0",padding:c.padding,backgroundColor:"transparent"}},o("ol",{style:{display:"flex",alignItems:"center",listStyle:"none",margin:"0",padding:"0",flexWrap:"wrap"}},...h))}function gt(e){const{item:t,itemStyle:n,closeOnSelect:r,onClose:i}=e,{hover:a,onMouseEnter:d,onMouseLeave:c}=dt(),[f,u]=l(!1),p=t.children&&t.children.length>0;if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});const h=!0===t.disabled,g={...st(n,{hover:!h&&a,active:!1}),position:"relative",justifyContent:"space-between",...h?{color:"#9ca3af",cursor:"default",opacity:"0.6"}:{}},x=s(()=>{h||(p?u(e=>!e):(t.onClick&&t.onClick(),r&&i()))},[h,p,t,r,i]),m=s(()=>{d(),p&&u(!0)},[p,d]),y=s(()=>{c(),p&&u(!1)},[p,c]),b=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)),v=p?o("span",{style:{marginLeft:"8px",fontSize:"10px",lineHeight:"1"},"aria-hidden":"true"},"›"):null,w=p&&f?o("div",{style:{position:"absolute",left:"100%",top:"0",zIndex:"1000"}},o(at,{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(e=>o(gt,{key:e.id,item:e,itemStyle:n,closeOnSelect:r,onClose:i})))):null;return o("div",{style:{position:"relative"},onMouseEnter:m,onMouseLeave:y},o("button",{type:"button",role:"menuitem",style:g,onClick:x,disabled:h||void 0,tabIndex:h?-1:0,"aria-disabled":h?"true":void 0,"aria-haspopup":p||void 0,"aria-expanded":p?String(f):void 0},b,v),w)}function xt(e){const{label:t,items:n,triggerStyle:r,menuStyle:i,itemStyle:d={},placement:f="bottom-start",closeOnSelect:u=!0,width:p="220px"}=e,[h,g]=l(!1),x=c(null),m=s(()=>{g(e=>!e)},[]),y=s(()=>{g(!1)},[]);a(()=>{if(!h)return;const e=e=>{const t=x.current;t&&!t.contains(e.target)&&g(!1)};return document.addEventListener("click",e,!0),()=>{document.removeEventListener("click",e,!0)}},[h]),a(()=>{if(!h)return;const e=e=>{"Escape"===e.key&&g(!1)};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[h]);const b=o("button",{type:"button",style:{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??{}},onClick:m,"aria-haspopup":"true","aria-expanded":String(h)},o("span",null,t),o("span",{style:{marginLeft:"4px",fontSize:"10px",transition:"transform 0.15s",transform:h?"rotate(180deg)":"rotate(0deg)"},"aria-hidden":"true"},"▼")),v={position:"absolute",top:"100%",..."bottom-end"===f?{right:"0"}:{left:"0"},marginTop:"4px",zIndex:"999"},w={boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #e5e7eb",borderRadius:"6px",padding:"4px 0",width:"number"==typeof p?`${p}px`:p,backgroundColor:"#ffffff",...i??{}},k=h?o("div",{style:v},o(at,{orientation:"vertical",role:"menu",ariaLabel:`${t} menu`,styling:w},...n.map(e=>o(gt,{key:e.id,item:e,itemStyle:d,closeOnSelect:u,onClose:y})))):null;return o("div",{ref:x,style:{position:"relative",display:"inline-block"}},b,k)}function mt(e){const{item:t,onClose:n,index:r}=e,{hover:i,onMouseEnter:a,onMouseLeave:d}=dt(),[c,f]=l(!1),u=t.children&&t.children.length>0;if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});const p=!0===t.disabled,h=s(()=>{p||(u?f(e=>!e):(t.onClick&&t.onClick(),n()))},[p,u,t,n]),g=s(()=>{a(),u&&f(!0)},[u,a]),x=s(()=>{d(),u&&f(!1)},[u,d]),m={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 16px",fontSize:"13px",fontFamily:"inherit",border:"none",outline:"none",width:"100%",textAlign:"left",cursor:p?"default":"pointer",backgroundColor:!p&&i?"#f3f4f6":"transparent",color:p?"#9ca3af":"#1f2937",opacity:p?"0.6":"1",transition:"background-color 0.1s",boxSizing:"border-box"},y=o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},t.icon?o("span",{style:{width:"16px",textAlign:"center"},"aria-hidden":"true"},t.icon):o("span",{style:{width:"16px"}}),o("span",null,t.label)),b=u?o("span",{style:{fontSize:"10px",color:"#9ca3af"},"aria-hidden":"true"},"▶"):t.shortcut?o("span",{style:{fontSize:"11px",color:"#9ca3af",marginLeft:"24px"}},t.shortcut):null,v=u&&c?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((e,t)=>o(mt,{key:String(t),item:e,onClose:n,index:t})))):null;return o("div",{style:{position:"relative"},onMouseEnter:g,onMouseLeave:x},o("button",{type:"button",role:"menuitem",style:m,onClick:h,disabled:p||void 0,tabIndex:-1,"aria-disabled":p||void 0,"aria-haspopup":u||void 0,"aria-expanded":u?c:void 0},y,b),v)}function yt(e){const{menu:t,index:n,isOpen:r,anyOpen:i,onOpen:l,onClose:a}=e,{hover:d,onMouseEnter:f,onMouseLeave:u}=dt(),p=c(null),h=s(()=>{r?a():l(n)},[r,n,l,a]),g=s(()=>{f(),i&&!r&&l(n)},[i,r,n,l,f]),x={display:"inline-flex",alignItems:"center",padding:"6px 12px",fontSize:"13px",fontFamily:"inherit",border:"none",outline:"none",cursor:"pointer",backgroundColor:r?"#e5e7eb":d?"#f3f4f6":"transparent",color:"#1f2937",borderRadius:"4px",transition:"background-color 0.1s"},m=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((e,t)=>o(mt,{key:String(t),item:e,onClose:a,index:t})))):null;return o("div",{style:{position:"relative",display:"inline-block"},onMouseEnter:g,onMouseLeave:u},o("button",{ref:p,type:"button",role:"menuitem",style:x,onClick:h,"aria-haspopup":"true","aria-expanded":String(r),tabIndex:0},t.label),m)}function bt(e){const{menus:t}=e,[n,r]=l(null),i=c(null),d=s(e=>{r(e)},[]),f=s(()=>{r(null)},[]);a(()=>{if(null===n)return;const e=e=>{const t=i.current;t&&!t.contains(e.target)&&r(null)};return document.addEventListener("click",e,!0),()=>{document.removeEventListener("click",e,!0)}},[n]),a(()=>{const e=i.current;if(!e)return;const o=o=>{const i=o;if("Escape"!==i.key){if("ArrowRight"===i.key)return i.preventDefault(),void r(e=>null===e?0:(e+1)%t.length);if("ArrowLeft"===i.key)return i.preventDefault(),void r(e=>null===e?t.length-1:(e-1+t.length)%t.length);if("ArrowDown"===i.key&&null!==n){i.preventDefault();const t=e.querySelector('[role="menu"]');if(t){const e=t.querySelector('[role="menuitem"]');e&&e.focus()}return}"Enter"!==i.key&&i.key}else r(null)};return e.addEventListener("keydown",o),()=>{e.removeEventListener("keydown",o)}},[n,t.length]);const u=t.map((e,t)=>o(yt,{key:String(t),menu:e,index:t,isOpen:n===t,anyOpen:null!==n,onOpen:d,onClose:f}));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"}},...u)}function vt(e,t){const n=[];for(let o=e;o<=t;o++)n.push(o);return n}const wt={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"},kt={...wt,backgroundColor:"#2563eb",color:"#ffffff",borderColor:"#2563eb",fontWeight:"600"},St={...wt,color:"#9ca3af",cursor:"default",opacity:"0.5"},$t={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"36px",height:"36px",color:"#6b7280",fontSize:"14px",userSelect:"none"};function Mt(e){const{total:t,pageSize:n,currentPage:r,onChange:i,siblingCount:l=1,showFirstLast:a=!0,showPrevNext:d=!0,disabled:c=!1}=e,f=Math.max(1,Math.ceil(t/n)),u=Math.min(Math.max(1,r),f),p=s(e=>{!c&&e>=1&&e<=f&&e!==u&&i(e)},[c,f,u,i]),h=(e,t,n)=>{const r=c||t<1||t>f||t===u;return o("button",{type:"button",onClick:()=>p(t),disabled:r||void 0,"aria-label":n,style:r?St:wt},e)},g=function(e,t,n){if(e<=2*n+5)return vt(1,e);const o=Math.max(t-n,1),r=Math.min(t+n,e),i=o>2,l=r<e-1;return!i&&l?[...vt(1,2*n+3),"ellipsis",e]:i&&!l?[1,"ellipsis",...vt(e-2*n-2,e)]:[1,"ellipsis",...vt(o,r),"ellipsis",e]}(f,u,l);let x=0;const m=[];a&&m.push(h("«",1,"Go to first page")),d&&m.push(h("‹",u-1,"Go to previous page"));for(const e of g)if("ellipsis"===e)m.push(o("span",{key:"ellipsis-"+x++,style:$t},"..."));else{const t=e===u;m.push(o("button",{key:String(e),type:"button",onClick:()=>p(e),disabled:c||void 0,"aria-label":`Page ${e}`,"aria-current":t?"page":void 0,style:c?St:t?kt:wt},String(e)))}return d&&m.push(h("›",u+1,"Go to next page")),a&&m.push(h("»",f,"Go to last page")),o(at,{orientation:"horizontal",role:"navigation",ariaLabel:"Pagination",keyboardNav:!0,styling:{border:"none",borderRadius:"0",backgroundColor:"transparent",padding:"0",custom:{gap:"4px"}}},...m)}function zt(e){const{item:t,collapsed:n,selectedId:r,onSelect:i,depth:a}=e,{hover:d,onMouseEnter:c,onMouseLeave:f}=dt(),[u,p]=l(!1),h=t.children&&t.children.length>0,g=t.id===r,x=s(()=>{h&&!n&&p(e=>!e),i&&i(t.id)},[h,n,i,t.id]),m={display:"flex",alignItems:"center",padding:n?"10px 0":"10px 12px 10px "+(n?"0":16+16*a+"px"),justifyContent:n?"center":"flex-start",cursor:"pointer",backgroundColor:g?"#eff6ff":d?"#f3f4f6":"transparent",color:g?"#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,b=n?null:o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.label),v=!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,w=!n&&h?o("span",{style:{fontSize:"10px",transition:"transform 0.15s",transform:u?"rotate(90deg)":"rotate(0deg)",marginLeft:"4px"},"aria-hidden":"true"},"▶"):null,k=n&&d?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,S=o("button",{type:"button",style:m,onClick:x,onMouseEnter:c,onMouseLeave:f,"aria-selected":g?"true":"false",title:n?t.label:void 0},y,b,v,w,k),$=!n&&h&&u?t.children.map(e=>o(zt,{key:e.id,item:e,collapsed:n,selectedId:r,onSelect:i,depth:a+1})):null;return o("div",{key:t.id,style:{position:"relative"}},S,$?o("div",{role:"group"},...$):null)}function Ct(e){const{items:t,collapsed:n=!1,onToggleCollapse:r,selectedId:i,onSelect:l,width:a="240px",collapsedWidth:s="56px"}=e,d=n?"number"==typeof s?`${s}px`:s:"number"==typeof a?`${a}px`:a,c=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?"▶":"◀"):null,f=t.map(e=>o(zt,{key:e.id,item:e,collapsed:n,selectedId:i,onSelect:l,depth:0}));return o(at,{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"}}},c,...f)}function It(e){const{steps:t,currentStep:n,orientation:r="horizontal",onChange:i,clickable:l=!1,variant:a="circle"}=e,d="horizontal"===r,c="circle"===a?32:12,f="dot"===a?12:32,u=s(e=>{l&&i&&i(e)},[l,i]),p=[];return t.forEach((e,r)=>{p.push(((e,t)=>{const r=(e=>e<n?"completed":e===n?"active":"pending")(t),i="active"===r,s="completed"===r,p=((e,t,n)=>{const r="dot"===a?f:c,i={width:`${r}px`,height:`${r}px`,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"circle"===a?"14px":"0",fontWeight:"600",flexShrink:"0",transition:"background-color 0.2s, border-color 0.2s"};return"completed"===n?o("div",{style:{...i,backgroundColor:"#2563eb",color:"#ffffff",border:"2px solid #2563eb"}},"circle"===a?t.icon||"✓":null):"active"===n?o("div",{style:{...i,backgroundColor:"#ffffff",color:"#2563eb",border:"2px solid #2563eb",boxShadow:"0 0 0 3px rgba(37, 99, 235, 0.2)"}},"circle"===a?t.icon||String(e+1):o("div",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"#2563eb"}})):o("div",{style:{...i,backgroundColor:"#ffffff",color:"#9ca3af",border:"2px solid #d1d5db"}},"circle"===a?t.icon||String(e+1):null)})(t,e,r),h={fontSize:"11px",color:"#6b7280",marginTop:"2px",textAlign:d?"center":"left"},g=o("div",{style:d?{display:"flex",flexDirection:"column",alignItems:"center"}:{display:"flex",flexDirection:"column"}},o("span",{style:{fontSize:"13px",fontWeight:i?"600":"400",color:i||s?"#1f2937":"#9ca3af",marginTop:d?"8px":"0",marginLeft:d?"0":"12px",textAlign:d?"center":"left",transition:"color 0.2s"}},e.label),e.description?o("span",{style:h},e.description):null),x=o("div",d?{style:{display:"flex",flexDirection:"column",alignItems:"center"}}:{style:{display:"flex",flexDirection:"row",alignItems:"center"}},p,g);return o(l?"button":"div",{key:String(t),onClick:l?()=>u(t):void 0,style:{display:"flex",flexDirection:d?"column":"row",alignItems:d?"center":"flex-start",background:"none",border:"none",padding:"0",cursor:l?"pointer":"default",fontFamily:"inherit",outline:"none"},"aria-current":i?"step":void 0},x)})(e,r));const i=(e=>{if(e>=t.length-1)return null;const r=e<n?"#2563eb":"#d1d5db";return o("div",d?{style:{flex:"1",height:"2px",backgroundColor:r,margin:"0 8px",alignSelf:"center",transition:"background-color 0.2s"}}:{style:{width:"2px",flex:"1",minHeight:"24px",backgroundColor:r,marginLeft:("dot"===a?f:c)/2-1+"px",transition:"background-color 0.2s"}})})(r);i&&p.push(i)}),o("div",{role:"navigation","aria-label":"Progress steps",style:{display:"flex",flexDirection:d?"row":"column",alignItems:d?"flex-start":"stretch",width:"100%"}},...p)}const At={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 Ft(e){const{item:t,size:n,variant:r}=e,{hover:i,onMouseEnter:a,onMouseLeave:d}=dt(),c=At[n],f=!0===t.disabled,u="toggle"===t.type,[p,h]=l(!1),g=u?!0===t.active:p,x=s(()=>{!f&&t.onClick&&t.onClick()},[f,t]),m=s(()=>{f||u||h(!0)},[f,u]),y=s(()=>{u||h(!1)},[u]),b=s(()=>{d(),u||h(!1)},[u,d]),v={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"6px",height:c.height,padding:c.padding,fontSize:c.fontSize,fontFamily:"inherit",border:"raised"===r?"1px solid #d1d5db":"1px solid transparent",borderRadius:"4px",backgroundColor:g?"#e0e7ff":!f&&i?"#f3f4f6":"raised"===r?"#ffffff":"transparent",color:f?"#9ca3af":g?"#2563eb":"#374151",cursor:f?"default":"pointer",opacity:f?"0.5":"1",outline:"none",transition:"background-color 0.15s"},w=t.icon?o("span",{style:{fontSize:c.iconSize},"aria-hidden":"true"},t.icon):null,k=t.label?o("span",null,t.label):null,S="dropdown"===t.type?o("span",{style:{fontSize:"10px",marginLeft:"2px"},"aria-hidden":"true"},"▼"):null;return o("button",{type:"button",style:v,onClick:x,onMouseDown:m,onMouseUp:y,onMouseEnter:a,onMouseLeave:b,disabled:f||void 0,"aria-pressed":u?g:void 0,"aria-label":t.label||t.id,title:t.label||t.id},w,k,S)}function Rt(e){const{items:t,size:n="md",variant:r="flat"}=e,i=At[n],l=t.map(e=>"separator"===e.type?o("div",{key:e.id,role:"separator","aria-orientation":"vertical",style:{width:"1px",height:i.height,backgroundColor:"#d1d5db",margin:"0 4px",flexShrink:"0"}}):"spacer"===e.type?o("div",{key:e.id,style:{flex:"1"},"aria-hidden":"true"}):o(Ft,{key:e.id,item:e,size:n,variant:r}));return o(at,{orientation:"horizontal",role:"toolbar",ariaLabel:"Toolbar",keyboardNav:!0,styling:{border:"raised"===r?"1px solid #e5e7eb":"none",borderRadius:"raised"===r?"8px":"0",padding:"4px",backgroundColor:"raised"===r?"#ffffff":"transparent",boxShadow:"raised"===r?"0 1px 3px rgba(0,0,0,0.1)":void 0,custom:{gap:"2px",alignItems:"center"}}},...l)}class Dt{constructor(e,t){this.id=e.id,this.label=e.label,this.expanded=e.expanded??!1,this.icon=e.icon??null,this.metadata=e.metadata??{},this.parent=t??null,this.depth=t?t.depth+1:0,this.children=(e.children??[]).map(e=>new Dt(e,this))}static fromData(e){return new Dt(e)}isLeaf(){return 0===this.children.length}isRoot(){return null===this.parent}walk(e){e(this,this.depth);for(const t of this.children)t.walk(e)}find(e){if(this.id===e)return this;for(const t of this.children){const n=t.find(e);if(n)return n}return null}toggle(){this.expanded=!this.expanded}expand(){this.expanded=!0}collapse(){this.expanded=!1}addChild(e){const t=new Dt(e,this);return this.children.push(t),t}removeChild(e){const t=this.children.findIndex(t=>t.id===e);return-1!==t&&(this.children.splice(t,1),!0)}}function Lt(e){e.expanded=!0;for(const t of e.children)Lt(t)}function Wt(e,t=[]){if(t.push(e),e.expanded)for(const n of e.children)Wt(n,t);return t}function Nt(e){if(!e.parent)return!0;const t=e.parent.children;return t[t.length-1]===e}function Et(e){const{node:t,isSelected:n,indentPx:r,lineColor:i,lineWidth:l,iconExpanded:s,iconCollapsed:d,nodeStyle:f,renderNode:u,onToggle:p,onClick:h,focusedId:g}=e,x=dt(),m=c(null),y=g===t.id;a(()=>{y&&m.current&&m.current.focus()},[y]);const b=t.isLeaf(),v=t.depth,w=[];for(let e=0;e<v;e++){let n=t;for(let t=0;t<v-e;t++)n=n?n.parent:null;const a=!!n&&!Nt(n);w.push(o("span",{key:`connector-${e}`,"aria-hidden":"true",style:{display:"inline-block",width:`${r}px`,height:"100%",position:"relative",flexShrink:"0",...a?{borderLeft:`${l}px solid ${i}`}:{}}}))}const k=v>0?o("span",{"aria-hidden":"true",style:{display:"inline-block",width:`${Math.floor(r/2)}px`,height:"0",borderTop:`${l}px solid ${i}`,flexShrink:"0",alignSelf:"center",marginLeft:`-${r}px`}}):null,S=b?o("span",{"aria-hidden":"true",style:{display:"inline-block",width:"18px",flexShrink:"0",marginRight:"4px"}}):o("span",{"aria-hidden":"true",role:"button",tabIndex:0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"18px",height:"18px",fontSize:"14px",lineHeight:"1",cursor:"pointer",userSelect:"none",flexShrink:"0",marginRight:"4px",fontFamily:"monospace"},onClick:e=>{e.stopPropagation(),p(t)}},t.expanded?s: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=st(f,{hover:x.hover,active:n});return o("div",{ref:m,role:"treeitem","aria-expanded":b?void 0:String(t.expanded),"aria-selected":n?"true":"false","aria-level":v+1,tabIndex:y?0:-1,style:{...M,display:"flex",alignItems:"stretch",padding:"0"},onMouseEnter:x.onMouseEnter,onMouseLeave:x.onMouseLeave,onClick:()=>h(t)},...w,k,o("span",{style:{display:"flex",alignItems:"center",flex:"1",padding:f.padding??"6px 10px",minWidth:"0"}},S,$))}function Tt(e){const{root:t,onNodeClick:n,onNodeExpand:r,onNodeCollapse:i,selectedId:a,expandAll:c=!1,lineColor:f="#000",lineWidth:u=1,indentPx:p=20,iconExpanded:h="−",iconCollapsed:g="+",nodeStyle:x={},wrapperStyle:m,renderNode:y}=e,[b,v]=l(()=>{const e=Dt.fromData(t);return c&&Lt(e),e}),[w,k]=l(t.id),S=d(()=>Wt(b),[b]),$=s(()=>{v(e=>{const t=Object.create(Object.getPrototypeOf(e));return Object.assign(t,e),t})},[]),M=s(e=>{e.toggle(),e.expanded?r?.(e):i?.(e),$()},[r,i,$]),z=s(e=>{k(e.id),n?.(e)},[n]),C=s(e=>{const t=e;if(!w)return;const n=S.findIndex(e=>e.id===w);if(-1===n)return;const o=S[n];switch(t.key){case"ArrowDown":{t.preventDefault();const e=S[n+1];e&&k(e.id);break}case"ArrowUp":{t.preventDefault();const e=S[n-1];e&&k(e.id);break}case"ArrowRight":t.preventDefault(),o.isLeaf()||(o.expanded?o.children.length>0&&k(o.children[0].id):M(o));break;case"ArrowLeft":t.preventDefault(),!o.isLeaf()&&o.expanded?M(o):o.parent&&k(o.parent.id);break;case"Enter":t.preventDefault(),z(o);break;case" ":t.preventDefault(),o.isLeaf()||M(o);break;case"Home":t.preventDefault(),S.length>0&&k(S[0].id);break;case"End":t.preventDefault(),S.length>0&&k(S[S.length-1].id)}},[w,S,M,z]),I=S.map(e=>o(Et,{key:e.id,node:e,isSelected:e.id===a,indentPx:p,lineColor:f,lineWidth:u,iconExpanded:h,iconCollapsed:g,nodeStyle:x,renderNode:y,onToggle:M,onClick:z,focusedId:w}));return o(at,{role:"tree",ariaLabel:"Tree navigation",styling:m,keyboardNav:!1},o("div",{onKeyDown:C,style:{outline:"none"}},...I))}function Bt(e){const{items:t,position:n,onClose:r,depth:i}=e,[s,d]=l(-1),[f,u]=l(null),p=c(null);a(()=>{if(!p.current)return;p.current.focus();const e=e=>{const n=e,o=t.map((e,t)=>({item:e,i:t})).filter(({item:e})=>!e.divider);if("ArrowDown"===n.key)n.preventDefault(),d(e=>{const t=(o.findIndex(({i:t})=>t===e)+1)%o.length;return o[t].i});else if("ArrowUp"===n.key)n.preventDefault(),d(e=>{const t=o.findIndex(({i:t})=>t===e),n=t<=0?o.length-1:t-1;return o[n].i});else if("ArrowRight"===n.key)s>=0&&t[s]?.children&&u(s);else if("ArrowLeft"===n.key)i>0&&r();else if("Enter"===n.key){if(n.preventDefault(),s>=0){const e=t[s];e.children?u(s):!e.disabled&&e.onClick&&(e.onClick(),r())}}else"Escape"===n.key&&r()};p.current.addEventListener("keydown",e);const n=p.current;return()=>n.removeEventListener("keydown",e)},[t,s,i,r]);const h={position:"fixed",left:`${n.x}px`,top:`${n.y}px`,backgroundColor:"#fff",border:"1px solid #e5e7eb",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.15)",padding:"4px 0",minWidth:"180px",zIndex:`${10200+i}`,outline:"none",overflow:"visible"},g=t.map((e,t)=>{if(e.divider)return o("div",{key:`divider-${t}`,style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});const l=s===t,a=!!e.disabled,c=!!(e.children&&e.children.length>0),p={display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",fontSize:"14px",color:a?"#9ca3af":"#1f2937",cursor:a?"default":"pointer",backgroundColor:l&&!a?"#f3f4f6":"transparent",userSelect:"none",position:"relative"},h=[];e.icon&&h.push(o("span",{style:{width:"20px",textAlign:"center",flexShrink:"0"}},e.icon)),h.push(o("span",{style:{flex:"1"}},e.label??"")),c&&h.push(o("span",{style:{fontSize:"10px",color:"#9ca3af",marginLeft:"8px"}},"▶"));const g=[o("div",{key:`item-${t}`,style:p,onMouseEnter:()=>{d(t),u(c?t:null)},onClick:()=>{a||(c?u(t):(e.onClick&&e.onClick(),r()))},role:"menuitem","aria-disabled":a?"true":void 0},...h)];return c&&f===t&&g.push(o(Bt,{key:`submenu-${t}`,items:e.children,position:{x:n.x+178,y:n.y+36*t},onClose:()=>u(null),depth:i+1})),o("div",{key:`wrap-${t}`,style:{position:"relative"}},...g)});return o("div",{ref:p,style:h,tabIndex:-1,role:"menu"},...g)}function Pt(e){const{items:t,children:n}=e,[r,i]=l(null),d=s(e=>{e.preventDefault();const t=e;i({x:t.clientX,y:t.clientY})},[]),c=s(()=>{i(null)},[]);a(()=>{if(!r)return;const e=e=>{c()},t=setTimeout(()=>{document.addEventListener("mousedown",e)},0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[r,c]),a(()=>{if(!r)return;const e=e=>{"Escape"===e.key&&c()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[r,c]);const f=[o("div",{onContextMenu:d,style:{display:"contents"}},n)];return r&&f.push(o(Bt,{items:t,position:r,onClose:c,depth:0})),o("div",null,...f)}function _t(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 Ht(e,t){const 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 Yt(e){const{open:t,onClose:n,position:r="right",size:i="320px",title:s,overlay:d=!0,closeOnOverlay:f=!0,closeOnEscape:u=!0,children:p}=e,[h,g]=l(!1),[x,m]=l(!1),y=c(null),b=s?"drawer-title":void 0;if(a(()=>{if(!t){m(!1);const e=setTimeout(()=>g(!1),300);return()=>clearTimeout(e)}g(!0),requestAnimationFrame(()=>m(!0))},[t]),a(()=>{if(!t||!u)return;const e=e=>{"Escape"===e.key&&n()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t,u,n]),a(()=>{if(!t)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[t]),a(()=>{t&&y.current&&y.current.focus()},[t]),!h)return null;const v={position:"fixed",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:"10000",opacity:x?"1":"0",transition:"opacity 0.3s ease"},w={...Ht(r,i),transform:_t(r,x),transition:"transform 0.3s ease"},k=[];s&&k.push(o("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"}},o("h3",{id:b,style:{margin:"0",fontSize:"16px",fontWeight:"600",color:"#111827"}},s),o("button",{type:"button",style:{background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",lineHeight:"1"},onClick:n,"aria-label":"Close drawer"},"×"))),k.push(o("div",{style:{padding:"20px",overflow:"auto",flex:"1"}},p));const S=[];return d&&S.push(o("div",{style:v,onClick:()=>{f&&n()}})),S.push(o("div",{ref:y,style:w,role:"dialog","aria-modal":"true","aria-labelledby":b,tabIndex:-1},...k)),o("div",null,...S)}const jt={sm:"400px",md:"600px",lg:"800px",full:"100vw"};function qt(e){const{open:t,onClose:n,title:r,size:i="md",closeOnOverlay:l=!0,closeOnEscape:s=!0,footer:d,showCloseButton:f=!0,children:u}=e,p=c(null);if(a(()=>{if(!t)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[t]),a(()=>{if(!t||!s)return;const e=e=>{"Escape"===e.key&&n()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t,s,n]),a(()=>{t&&p.current&&p.current.focus()},[t]),!t)return null;const h={backgroundColor:"#fff",borderRadius:"full"===i?"0":"8px",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.3)",maxHeight:"full"===i?"100vh":"90vh",width:jt[i],maxWidth:"full"===i?"100vw":"90vw",display:"flex",flexDirection:"column",outline:"none",overflow:"hidden"},g=[],x=r?"modal-title":void 0;r?g.push(o("h2",{id:x,style:{margin:"0",fontSize:"18px",fontWeight:"600",color:"#111827"}},r)):g.push(o("span",null)),f&&g.push(o("button",{type:"button",style:{background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",borderRadius:"4px",lineHeight:"1"},onClick:n,"aria-label":"Close modal"},"×"));const m=[o("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 24px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"}},...g),o("div",{style:{padding:"24px",overflow:"auto",flex:"1"}},u)];return d&&m.push(o("div",{style:{padding:"16px 24px",borderTop:"1px solid #e5e7eb",flexShrink:"0"}},d)),o("div",{style:{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"},onClick:e=>{l&&e.target===e.currentTarget&&n()},"aria-modal":"true",role:"dialog","aria-labelledby":x},o("div",{ref:p,style:h,tabIndex:-1,role:"document"},...m))}function Ot(e,t){const n=t+8;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 Ut(e){const t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n="8px",o="transparent";switch(e){case"top":return{...t,bottom:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`${n} ${n} 0 ${n}`,borderColor:`#fff ${o} ${o} ${o}`};case"bottom":return{...t,top:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`0 ${n} ${n} ${n}`,borderColor:`${o} ${o} #fff ${o}`};case"left":return{...t,right:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} 0 ${n} ${n}`,borderColor:`${o} ${o} ${o} #fff`};case"right":return{...t,left:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} ${n} ${n} 0`,borderColor:`${o} #fff ${o} ${o}`}}}function Xt(e){const{trigger:t,content:n,open:r,placement:i="bottom",offset:d=4,arrow:f=!1,closeOnClickOutside:u=!0,onOpenChange:p}=e,h=void 0!==r,[g,x]=l(!1),m=h?r:g,y=c(null),b=s(()=>{h?p&&p(!r):x(e=>!e)},[h,r,p]);a(()=>{if(!m||!u)return;const e=e=>{y.current&&!y.current.contains(e.target)&&(h?p&&p(!1):x(!1))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[m,u,h,p]);const v={...Ot(i,d),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"},w=[n];f&&w.push(o("div",{style:Ut(i)}));const k=s(e=>{const t=e.key;"Enter"!==t&&" "!==t||(e.preventDefault(),b())},[b]),S=[o("div",{onClick:b,onKeyDown:k,role:"button",tabIndex:0,style:{display:"inline-block"}},t)];return m&&S.push(o("div",{style:v},...w)),o("div",{ref:y,style:{position:"relative",display:"inline-block"}},...S)}let Vt=0;function Gt(e={}){const t={position:e.position??"top-right",maxToasts:e.maxToasts??5,defaultDuration:e.defaultDuration??4e3};let n=[];const o=new Set;function r(){o.forEach(e=>e())}return{toast:function(e,o={}){const i=`toast-${++Vt}-${Date.now()}`,l={id:i,message:e,type:o.type??"info",duration:o.duration??t.defaultDuration,action:o.action,createdAt:Date.now()};return n=[l,...n].slice(0,t.maxToasts),r(),i},dismiss:function(e){n=n.filter(t=>t.id!==e),r()},dismissAll:function(){n=[],r()},subscribe:e=>(o.add(e),()=>{o.delete(e)}),getToasts:()=>n,config:t}}const Kt={info:{bg:"#eff6ff",border:"#3b82f6",icon:"ℹ️"},success:{bg:"#f0fdf4",border:"#22c55e",icon:"✅"},warning:{bg:"#fffbeb",border:"#f59e0b",icon:"⚠️"},error:{bg:"#fef2f2",border:"#ef4444",icon:"❌"}};function Zt(e){const{item:t,onDismiss:n}=e,r=Kt[t.type];a(()=>{if(t.duration<=0)return;const e=setTimeout(()=>n(t.id),t.duration);return()=>clearTimeout(e)},[t.id,t.duration,n]);const 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"},l={background:"none",border:`1px solid ${r.border}`,borderRadius:"4px",cursor:"pointer",fontSize:"12px",fontWeight:"600",color:r.border,padding:"4px 10px",flexShrink:"0"},s=[o("span",null,r.icon),o("span",{style:{flex:"1",fontSize:"14px",color:"#1f2937",lineHeight:"1.4"}},t.message)];return t.action&&s.push(o("button",{type:"button",style:l,onClick:t.action.onClick},t.action.label)),s.push(o("button",{type:"button",style:{background:"none",border:"none",cursor:"pointer",fontSize:"16px",color:"#9ca3af",padding:"2px 6px",lineHeight:"1",flexShrink:"0"},onClick:()=>n(t.id),"aria-label":"Dismiss toast"},"×")),o("div",{style:i,role:"alert"},...s)}function Jt(e){const{toaster:t}=e,[,n]=l(0);a(()=>t.subscribe(()=>n(e=>e+1)),[t]);const r=t.getToasts();if(0===r.length)return null;const i=function(e){const t={position:"fixed",zIndex:"10100",display:"flex",flexDirection:"column",gap:"8px",padding:"16px",pointerEvents:"none"},n=e.startsWith("top"),o=e.startsWith("bottom"),r=e.endsWith("left"),i=e.endsWith("right"),l=e.endsWith("center");return n&&(t.top="0"),o&&(t.bottom="0",t.flexDirection="column-reverse"),r&&(t.left="0"),i&&(t.right="0"),l&&(t.left="50%",t.transform="translateX(-50%)"),t}(t.config.position);a(()=>{const e="specifyjs-toast-keyframes";if(document.getElementById(e))return;const t=document.createElement("style");return t.id=e,t.textContent="\n @keyframes specifyjs-toast-slide-in {\n from { opacity: 0; transform: translateY(-12px); }\n to { opacity: 1; transform: translateY(0); }\n }\n ",document.head.appendChild(t),()=>{const t=document.getElementById(e);t&&t.remove()}},[]);const d=s(e=>t.dismiss(e),[t]),c=r.map(e=>o(Zt,{key:e.id,item:e,onDismiss:d}));return o("div",{style:i},...c)}function Qt(e={}){const t=c(null);t.current||(t.current=Gt(e));const n=t.current,r=s(()=>o(Jt,{toaster:n}),[n]);return{toast:n.toast,dismiss:n.dismiss,dismissAll:n.dismissAll,ToastContainer:r}}function en(e){const t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n="6px",o="transparent",r="#1f2937";switch(e){case"top":return{...t,bottom:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`${n} ${n} 0 ${n}`,borderColor:`${r} ${o} ${o} ${o}`};case"bottom":return{...t,top:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`0 ${n} ${n} ${n}`,borderColor:`${o} ${o} ${r} ${o}`};case"left":return{...t,right:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} 0 ${n} ${n}`,borderColor:`${o} ${o} ${o} ${r}`};case"right":return{...t,left:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} ${n} ${n} 0`,borderColor:`${o} ${r} ${o} ${o}`}}}function tn(e){const{text:t,placement:n="top",delay:r=200,maxWidth:i="250px",children:d}=e,[f,u]=l(!1),[p,h]=l(null),g=c(null),x=c(null),m=`tooltip-${Math.random().toString(36).slice(2,9)}`,y=s(()=>{x.current=setTimeout(()=>{if(g.current){const e=g.current.getBoundingClientRect();h(function(e,t){switch(t){case"top":return{position:"fixed",left:`${e.left+e.width/2}px`,top:e.top-8+"px",transform:"translate(-50%, -100%)"};case"bottom":return{position:"fixed",left:`${e.left+e.width/2}px`,top:`${e.bottom+8}px`,transform:"translateX(-50%)"};case"left":return{position:"fixed",left:e.left-8+"px",top:`${e.top+e.height/2}px`,transform:"translate(-100%, -50%)"};case"right":return{position:"fixed",left:`${e.right+8}px`,top:`${e.top+e.height/2}px`,transform:"translateY(-50%)"}}}(e,n))}u(!0)},r)},[r,n]),b=s(()=>{x.current&&(clearTimeout(x.current),x.current=null),u(!1)},[]);a(()=>()=>{x.current&&clearTimeout(x.current)},[]);const v={...p??{},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"},w=[o("div",{ref:g,style:{display:"inline-block"},onMouseEnter:y,onMouseLeave:b,onFocus:y,onBlur:b,"aria-describedby":f?m:void 0},d)];return f&&p&&w.push(o("div",{id:m,style:v,role:"tooltip"},t,o("div",{style:en(n)}))),o("div",{style:{display:"inline-block",position:"relative"}},...w)}function nn(e,t,n,o,r){return d(()=>{const i=Math.max(1,(o-r*(e+1))/e);return{valueScale:e=>0===t?0:e/t*n,categoryScale:e=>r+e*(i+r),barThickness:i,maxValue:t,valueAxisLength:n,categoryAxisLength:o}},[e,t,n,o,r])}const on=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function rn(e,t){return t||on[e%on.length]}function ln(e){const{data:t=[],width:n=600,height:r=400,orientation:i="vertical",barColor:l="#3b82f6",barGap:a=8,barRadius:c=4,showValues:f=!0,showGrid:u=!0,gridColor:p="#e5e7eb",title:h,padding:g=50,animate:x=!1,stacked:m,grouped:y=!1}=e,b="vertical"===i,v=n-2*g,w=r-2*g,k=b?w:v,S=b?v:w,$=void 0!==m&&m.length>0,M=d(()=>$?function(e){const t=new Set;for(const n of e)for(const e of n.values)t.add(e.category);return Array.from(t)}(m):[],[$,m]),z=$?m.length:t.length,C=d(()=>function(e,t,n){if(t&&t.length>0){if(n){let e=0;for(const n of t)for(const t of n.values)t.value>e&&(e=t.value);return e}let e=0;for(const n of t){let t=0;for(const e of n.values)t+=e.value;t>e&&(e=t)}return e}let o=0;for(const t of e)t.value>o&&(o=t.value);return o}(t,m,y),[t,m,y]),I=C>0?C:1,A=nn(z,I,k,S,a),F=s(()=>{if(!u)return[];const e=function(e){if(e<=0)return 1;const t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),o=t/n;return o<=1.5?n:o<=3.5?2*n:o<=7.5?5*n:10*n}(I),t=[];for(let n=e;n<=I;n+=e){const e=A.valueScale(n);if(b){const r=g+w-e;t.push(o("line",{key:`grid-${n}`,x1:String(g),y1:String(r),x2:String(g+v),y2:String(r),stroke:p,"stroke-width":"1","stroke-dasharray":"4 2"})),t.push(o("text",{key:`grid-label-${n}`,x:String(g-6),y:String(r+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(n)))}else{const r=g+e;t.push(o("line",{key:`grid-${n}`,x1:String(r),y1:String(g),x2:String(r),y2:String(g+w),stroke:p,"stroke-width":"1","stroke-dasharray":"4 2"})),t.push(o("text",{key:`grid-label-${n}`,x:String(r),y:String(g+w+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(n)))}}return t},[u,I,A,b,g,v,w,p]),R=s(()=>{const e=[];return b?(e.push(o("line",{key:"axis-y",x1:String(g),y1:String(g),x2:String(g),y2:String(g+w),stroke:"#374151","stroke-width":"1.5"})),e.push(o("line",{key:"axis-x",x1:String(g),y1:String(g+w),x2:String(g+v),y2:String(g+w),stroke:"#374151","stroke-width":"1.5"}))):(e.push(o("line",{key:"axis-x",x1:String(g),y1:String(g+w),x2:String(g+v),y2:String(g+w),stroke:"#374151","stroke-width":"1.5"})),e.push(o("line",{key:"axis-y",x1:String(g),y1:String(g),x2:String(g),y2:String(g+w),stroke:"#374151","stroke-width":"1.5"}))),e},[b,g,v,w]),D=s(()=>{const e=[];for(let n=0;n<t.length;n++){const r=t[n],i=A.valueScale(r.value),a=A.categoryScale(n),s=r.color??l;let d,u,p=String(r.value);if(b){const e=g+a,t=g+w-i;d={x:String(e),y:String(t),width:String(A.barThickness),height:String(i),rx:String(c),ry:String(c),fill:s},u={x:String(e+A.barThickness/2),y:String(t-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"}}else{const e=g+a,t=g;d={x:String(t),y:String(e),width:String(i),height:String(A.barThickness),rx:String(c),ry:String(c),fill:s},u={x:String(t+i+6),y:String(e+A.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"}}if(x&&(d.style=`animation: barGrow 0.6s ease-out ${.05*n}s both`),e.push(o("rect",{key:`bar-${n}`,...d})),f&&e.push(o("text",{key:`val-${n}`,...u},p)),b){const t=g+a+A.barThickness/2,i=g+w+16;e.push(o("text",{key:`cat-${n}`,x:String(t),y:String(i),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${t}, ${i})`},r.label))}else e.push(o("text",{key:`cat-${n}`,x:String(g-6),y:String(g+a+A.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},r.label))}return e},[t,A,l,c,f,x,b,g,w]),L=s(()=>{if(!m)return[];const e=[];for(let t=0;t<m.length;t++){const n=m[t],r=A.categoryScale(t);let i=0;for(let l=0;l<n.values.length;l++){const a=n.values[l],s=A.valueScale(a.value),d=A.valueScale(i),u=rn(l,a.color);if(b){const i=g+r,p=g+w-d-s;e.push(o("rect",{key:`sbar-${t}-${l}`,x:String(i),y:String(p),width:String(A.barThickness),height:String(s),rx:l===n.values.length-1?String(c):"0",ry:l===n.values.length-1?String(c):"0",fill:u,...x?{style:`animation: barGrow 0.6s ease-out ${.03*(t*n.values.length+l)}s both`}:{}})),f&&s>14&&e.push(o("text",{key:`sval-${t}-${l}`,x:String(i+A.barThickness/2),y:String(p+s/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(a.value)))}else{const i=g+d,p=g+r;e.push(o("rect",{key:`sbar-${t}-${l}`,x:String(i),y:String(p),width:String(s),height:String(A.barThickness),rx:l===n.values.length-1?String(c):"0",ry:l===n.values.length-1?String(c):"0",fill:u,...x?{style:`animation: barGrow 0.6s ease-out ${.03*(t*n.values.length+l)}s both`}:{}})),f&&s>20&&e.push(o("text",{key:`sval-${t}-${l}`,x:String(i+s/2),y:String(p+A.barThickness/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(a.value)))}i+=a.value}if(f){const n=A.valueScale(i);b?e.push(o("text",{key:`stotal-${t}`,x:String(g+r+A.barThickness/2),y:String(g+w-n-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(i))):e.push(o("text",{key:`stotal-${t}`,x:String(g+n+6),y:String(g+r+A.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(i)))}if(b){const i=g+r+A.barThickness/2,l=g+w+16;e.push(o("text",{key:`scat-${t}`,x:String(i),y:String(l),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${i}, ${l})`},n.label))}else e.push(o("text",{key:`scat-${t}`,x:String(g-6),y:String(g+r+A.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},n.label))}return e},[m,A,c,f,x,b,g,w]),W=s(()=>{if(!m)return[];const e=M.length,t=[];for(let n=0;n<m.length;n++){const r=m[n],i=A.categoryScale(n),l=2,a=Math.max(1,(A.barThickness-l*(e-1))/e);for(let s=0;s<r.values.length;s++){const d=r.values[s],u=M.indexOf(d.category),p=u*(a+l),h=A.valueScale(d.value),m=rn(u>=0?u:s,d.color);if(b){const r=g+i+p,l=g+w-h;t.push(o("rect",{key:`gbar-${n}-${s}`,x:String(r),y:String(l),width:String(a),height:String(h),rx:String(c),ry:String(c),fill:m,...x?{style:`animation: barGrow 0.6s ease-out ${.04*(n*e+s)}s both`}:{}})),f&&t.push(o("text",{key:`gval-${n}-${s}`,x:String(r+a/2),y:String(l-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(d.value)))}else{const r=g,l=g+i+p;t.push(o("rect",{key:`gbar-${n}-${s}`,x:String(r),y:String(l),width:String(h),height:String(a),rx:String(c),ry:String(c),fill:m,...x?{style:`animation: barGrow 0.6s ease-out ${.04*(n*e+s)}s both`}:{}})),f&&t.push(o("text",{key:`gval-${n}-${s}`,x:String(r+h+4),y:String(l+a/2+3),"text-anchor":"start","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(d.value)))}}if(b){const e=g+i+A.barThickness/2,l=g+w+16;t.push(o("text",{key:`gcat-${n}`,x:String(e),y:String(l),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${e}, ${l})`},r.label))}else t.push(o("text",{key:`gcat-${n}`,x:String(g-6),y:String(g+i+A.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},r.label))}return t},[m,M,A,c,f,x,b,g,w]),N=s(()=>h?[o("text",{key:"title",x:String(n/2),y:String(g/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,n,g]),E=s(()=>x?[o("defs",{key:"anim-defs"},o("style",{key:"anim-style"},b?"@keyframes barGrow { from { transform: scaleY(0); transform-origin: bottom; } to { transform: scaleY(1); transform-origin: bottom; } }":"@keyframes barGrow { from { transform: scaleX(0); transform-origin: left; } to { transform: scaleX(1); transform-origin: left; } }"))]:[],[x,b]),T=F(),B=R(),P=N(),_=E();let H;return H=$&&y?W():$?L():D(),o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",style:{fontFamily:"sans-serif"}},..._,...P,...T,...B,...H)}function an(e){const{start:t,end:n,step:o}=e;if(o<=0||!isFinite(o))return[];const r=Math.ceil((n-t)/o)+1;if(r>1e6)return[];const i=[];for(let e=0;e<r;e++){const r=t+e*o;if(r>n+.001*o)break;i.push(r)}return i}function sn(e,t){const n=[];for(let o=0;o<t.length;o++){const r=t[o],i=e(r);isFinite(i)&&n.push({input:r,output:i})}return n}function dn(e,t,n,o){let r=!1,i=0;const l=[],a=()=>{if(r)return;const s=Math.min(i+n,t.length);for(let n=i;n<s;n++){const o=t[n],r=e(o);isFinite(r)&&l.push({input:o,output:r})}i=s,i>=t.length?o(l,!0):(o(l,!1),cn(a))};return cn(a),()=>{r=!0}}function cn(e){"function"==typeof requestIdleCallback?requestIdleCallback(()=>e(),{timeout:16}):setTimeout(e,0)}function fn(e,t){const n=t-e;if(n<=0)return[e];const o=function(e){const t=e/8,n=Math.pow(10,Math.floor(Math.log10(t))),o=t/n;return(o<1.5?1:o<3?2:o<7?5:10)*n}(n),r=[];for(let n=Math.ceil(e/o)*o;n<=t+.001*o;n+=o)r.push(Math.round(1e10*n)/1e10);return r}function un(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}const pn=40,hn=1e6;function gn(e){const{width:t=400,height:n=300,points:r=[],plotFunction:i,plotResolution:f=200,xStep:u,sync:p=!1,xRange:h=[-5,5],yRange:g=[-5,5],showGrid:x=!0,showAxes:m=!0,pointRadius:y=3,pointColor:b="#3b82f6",curveColor:v="#3b82f6",gridColor:w="#e2e8f0",axisColor:k="#94a3b8",onPointClick:S,onPointDoubleClick:$,onPointContextMenu:M,onPointHover:z}=e,[C,I]=l(h[0]),[A,F]=l(h[1]),[R,D]=l(g[0]),[L,W]=l(g[1]),N=c(!1),E=c(null),T=s(e=>pn+(e-C)/(A-C)*(t-80),[C,A,t]),B=s(e=>n-pn-(e-R)/(L-R)*(n-80),[R,L,n]),P=s(e=>C+(e-pn)/(t-80)*(A-C),[C,A,t]),_=s(e=>R+(n-pn-e)/(n-80)*(L-R),[R,L,n]),H=s(e=>{const t=e;N.current=!0,E.current={mx:t.clientX,my:t.clientY,x0:C,x1:A,y0:R,y1:L}},[C,A,R,L]),Y=s(e=>{if(!N.current||!E.current)return;const o=e,r=E.current,i=o.clientX-r.mx,l=o.clientY-r.my,a=i/(t-80)*(r.x1-r.x0),s=l/(n-80)*(r.y1-r.y0);I(r.x0-a),F(r.x1-a),D(r.y0+s),W(r.y1+s)},[t,n]),j=s(()=>{N.current=!1,E.current=null},[]),q=s(e=>{const t=e;t.preventDefault();const n=t.currentTarget.getBoundingClientRect(),o=t.clientX-n.left,r=t.clientY-n.top,i=P(o),l=_(r),a=t.deltaY>0?1.1:1/1.1,s=(A-C)*a,d=(L-R)*a;if(s<.01||d<.01||s>hn||d>hn)return;const c=(i-C)/(A-C),f=(l-R)/(L-R);I(i-c*s),F(i+(1-c)*s),D(l-f*d),W(l+(1-f)*d)},[C,A,R,L,P,_]),O=[];if(O.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),x){const e=fn(C,A),r=fn(R,L);for(let t=0;t<e.length;t++){const r=T(e[t]);O.push(o("line",{x1:r,y1:pn,x2:r,y2:n-pn,stroke:w,"stroke-width":.5,key:`gx-${t}`})),O.push(o("text",{x:r,y:n-pn+14,"text-anchor":"end","font-size":10,fill:k,transform:`rotate(-45, ${r}, ${n-pn+14})`,key:`lx-${t}`},un(e[t])))}for(let e=0;e<r.length;e++){const n=B(r[e]);O.push(o("line",{x1:pn,y1:n,x2:t-pn,y2:n,stroke:w,"stroke-width":.5,key:`gy-${e}`})),O.push(o("text",{x:34,y:n+3,"text-anchor":"end","font-size":10,fill:k,key:`ly-${e}`},un(r[e])))}}if(m){const e=Math.max(pn,Math.min(t-pn,T(0))),r=Math.max(pn,Math.min(n-pn,B(0)));O.push(o("line",{x1:pn,y1:r,x2:t-pn,y2:r,stroke:k,"stroke-width":1,key:"x-axis"})),O.push(o("line",{x1:e,y1:pn,x2:e,y2:n-pn,stroke:k,"stroke-width":1,key:"y-axis"}))}const U=d(()=>{if(!i||!p)return[];const e=an({start:C,end:A,step:u??(A-C)/f});return sn(i,e)},[i,C,A,u,f,p]),[X,V]=l([]),G=c(null);a(()=>{if(!i||p)return void V([]);const e=an({start:C,end:A,step:u??(A-C)/f});return G.current&&G.current(),G.current=dn(i,e,200,e=>{V([...e])}),()=>{G.current&&G.current()}},[i,C,A,u,f,p]);const K=p?U:X;if(K.length>0){const e=[];for(let t=0;t<K.length;t++){const n=K[t],o=T(n.input),r=B(n.output);e.push(`${0===e.length?"M":"L"}${o},${r}`)}O.push(o("path",{d:e.join(" "),fill:"none",stroke:v,"stroke-width":1.5,key:"curve"}))}const Z=(e,t,n,o)=>{if(t)return e=>t({x:o.x,y:o.y,index:n,event:e})};for(let e=0;e<r.length;e++){const t=r[e],n={cx:T(t.x),cy:B(t.y),r:y,fill:b,cursor:"pointer",key:`pt-${e}`};S&&(n.onClick=Z(0,S,e,t)),$&&(n.onDblClick=Z(0,$,e,t)),M&&(n.onContextMenu=Z(0,M,e,t)),z&&(n.onMouseOver=Z(0,z,e,t)),O.push(o("circle",n))}const J=o("defs",{key:"defs"},o("clipPath",{id:"plot-clip"},o("rect",{x:pn,y:pn,width:t-80,height:n-80})));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:H,onMouseMove:Y,onMouseUp:j,onMouseLeave:j,onWheel:q},J,...O)}function xn(e,t,n){let o=0,r=0;for(let i=0;i<n;i++){const n=o*o,l=r*r;if(n+l>4)return i;r=2*o*r+t,o=n-l+e}return n}function mn(e,t,n){if(e===t)return[0,0,0];const o=e/t;if("fire"===n)return[Math.floor(255*Math.min(1,3*o)),Math.floor(255*Math.max(0,3*o-1)),Math.floor(255*Math.max(0,3*o-2))];if("ocean"===n)return[Math.floor(255*o*.3),Math.floor(255*o*.6),Math.floor(255*(.4+.6*o))];const r=360*o%360,i=1*(1-Math.abs(0)),l=i*(1-Math.abs(r/60%2-1)),a=.5-i/2;let s=0,d=0,c=0;return r<60?(s=i,d=l):r<120?(s=l,d=i):r<180?(d=i,c=l):r<240?(d=l,c=i):r<300?(s=l,c=i):(s=i,c=l),[Math.floor(255*(s+a)),Math.floor(255*(d+a)),Math.floor(255*(c+a))]}function yn(e,t,n=[-2.5,1],o=[-1.25,1.25],r=80,i=xn){const l=[];for(let a=0;a<t;a++){const s=[],d=o[1]-a/t*(o[1]-o[0]);for(let t=0;t<e;t++){const o=n[0]+t/e*(n[1]-n[0]);s.push(i(o,d,r))}l.push(s)}return l}function bn(e){const{width:t=400,height:n=300,realRange:r=[-2.5,1],imagRange:i=[-1.25,1.25],maxIterations:d=100,colorScheme:f="classic",computeFunction:u=xn,data:p,resolution:h=2,onPointClick:g,onPointHover:x,onPointDoubleClick:m,onPointContextMenu:y}=e;if(p){const e=p.length,r=e>0?p[0].length:0,i=r>0?t/r:1,l=e>0?n/e:1,a=[];for(let t=0;t<e;t++){const e=p[t];for(let n=0;n<r;n++){const r=e[n]??0,[s,c,u]=mn(r,d,f);a.push(o("rect",{key:`${t}-${n}`,x:String(n*i),y:String(t*l),width:String(Math.ceil(i)),height:String(Math.ceil(l)),fill:`rgb(${s},${c},${u})`}))}}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%"}},...a)}const[b,v]=l(r[0]),[w,k]=l(r[1]),[S,$]=l(i[0]),[M,z]=l(i[1]),C=c(null),I=c(!1),A=c(null),F=s((e,o)=>({re:b+e/t*(w-b),im:M-o/n*(M-S)}),[b,w,S,M,t,n]);a(()=>{const e=C.current;if(!e)return;const o=e.getContext("2d");if(!o)return;const r=o.createImageData(t,n),i=r.data;for(let e=0;e<n;e++)for(let n=0;n<t;n++){const{re:o,im:r}=F(n,e),l=u(o,r,d),[a,s,c]=mn(l,d,f),p=4*(e*t+n);i[p]=a,i[p+1]=s,i[p+2]=c,i[p+3]=255}o.putImageData(r,0,0)},[b,w,S,M,t,n,d,f,u,F]);const R=s(e=>{const t=e.target.getBoundingClientRect(),n=e.clientX-t.left,o=e.clientY-t.top,{re:r,im:i}=F(n,o);return{re:r,im:i,iterations:u(r,i,d),event:e}},[F,u,d]),D=s(e=>{I.current=!0,A.current={x:e.clientX,y:e.clientY,rMin:b,rMax:w,iMin:S,iMax:M}},[b,w,S,M]),L=s(e=>{if(x&&x(R(e)),!I.current||!A.current)return;const o=A.current,r=e.clientX-o.x,i=e.clientY-o.y,l=(o.rMax-o.rMin)/t,a=(o.iMax-o.iMin)/n;v(o.rMin-r*l),k(o.rMax-r*l),$(o.iMin+i*a),z(o.iMax+i*a)},[t,n,x,R]),W=s(()=>{I.current=!1},[]),N=s(e=>{e.preventDefault();const t=e.deltaY>0?1.15:1/1.15,n=e.target.getBoundingClientRect(),o=e.clientX-n.left,r=e.clientY-n.top,{re:i,im:l}=F(o,r);v(i+(b-i)*t),k(i+(w-i)*t),$(l+(S-l)*t),z(l+(M-l)*t)},[F,b,w,S,M]),E=s(e=>{g&&g(R(e))},[g,R]),T=s(e=>{m&&m(R(e))},[m,R]),B=s(e=>{e.preventDefault(),y&&y(R(e))},[y,R]);return o("canvas",{ref:C,width:t,height:n,style:{cursor:"crosshair"},onMouseDown:D,onMouseMove:L,onMouseUp:W,onMouseLeave:W,onWheel:N,onClick:E,onDblClick:T,onContextMenu:B})}function vn(e,t,n){if(e===t)return[e];const o=(t-e)/(n-1),r=[];for(let t=0;t<n;t++){const n=e+o*t;r.push(Math.round(1e10*n)/1e10)}return r}function wn(e,t,n,o){return d(()=>function(e,t,n,o){if(0===e.length)return{xScale:()=>o,yScale:()=>n-o,xTicks:[],yTicks:[],xMin:0,xMax:0,yMin:0,yMax:0};let r=1/0,i=-1/0,l=1/0,a=-1/0;for(const t of e)t.x<r&&(r=t.x),t.x>i&&(i=t.x),t.y<l&&(l=t.y),t.y>a&&(a=t.y);r===i&&(r-=1,i+=1),l===a&&(l-=1,a+=1);const s=t-2*o,d=n-2*o;return{xScale:e=>o+(e-r)/(i-r)*s,yScale:e=>n-o-(e-l)/(a-l)*d,xTicks:vn(r,i,6),yTicks:vn(l,a,6),xMin:r,xMax:i,yMin:l,yMax:a}}(e,t,n,o),[e,t,n,o])}function kn(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function Sn(e,t,n,r,i,l,a){const s={fill:i,key:l,...a};switch(e){case"square":return o("rect",{...s,x:t-r,y:n-r,width:2*r,height:2*r});case"diamond":{const e=`${t},${n-r} ${t+r},${n} ${t},${n+r} ${t-r},${n}`;return o("polygon",{...s,points:e})}case"triangle":{const e=`${t},${n-1.15*r} ${t+r},${n+.6*r} ${t-r},${n+.6*r}`;return o("polygon",{...s,points:e})}case"triangle-down":{const e=`${t-r},${n-.6*r} ${t+r},${n-.6*r} ${t},${n+1.15*r}`;return o("polygon",{...s,points:e})}case"cross":{const e=.35*r;return o("path",{...s,fill:"none",stroke:i,"stroke-width":String(2*e),"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":{const e=.35*r;return o("path",{...s,fill:"none",stroke:i,"stroke-width":String(2*e),"stroke-linecap":"round",d:`M${t},${n-r}L${t},${n+r}M${t-r},${n}L${t+r},${n}`})}default:return o("circle",{...s,cx:t,cy:n,r:r})}}function $n(e){const{data:t,width:n=600,height:r=400,lineColor:i="#3b82f6",lineWidth:l=2,pointRadius:a=4,pointColor:s="#3b82f6",pointShape:c="circle",showPoints:f=!0,showGrid:u=!0,showArea:p=!1,areaColor:h="rgba(59,130,246,0.15)",xLabel:g,yLabel:x,title:m,padding:y=50,animate:b=!1,multiLine:v}=e,w=wn(d(()=>{const e=[...t];if(v)for(const t of v)e.push(...t.data);return e},[t,v]),n,r,y),{xScale:k,yScale:S,xTicks:$,yTicks:M}=w,z=[];if(z.push(o("rect",{x:0,y:0,width:"100%",fill:"white",key:"bg"})),u){for(let e=0;e<$.length;e++){const t=k($[e]);z.push(o("line",{x1:t,y1:y,x2:t,y2:r-y,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-x-${e}`}))}for(let e=0;e<M.length;e++){const t=S(M[e]);z.push(o("line",{x1:y,y1:t,x2:n-y,y2:t,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-y-${e}`}))}}z.push(o("line",{x1:y,y1:r-y,x2:n-y,y2:r-y,stroke:"#374151","stroke-width":1,key:"x-axis"})),z.push(o("line",{x1:y,y1:y,x2:y,y2:r-y,stroke:"#374151","stroke-width":1,key:"y-axis"}));for(let e=0;e<$.length;e++){const t=k($[e]);z.push(o("line",{x1:t,y1:r-y,x2:t,y2:r-y+5,stroke:"#374151",key:`xtick-${e}`})),z.push(o("text",{x:t,y:r-y+18,"text-anchor":"end","font-size":11,fill:"#6b7280",transform:`rotate(-45, ${t}, ${r-y+18})`,key:`xlabel-${e}`},kn($[e])))}for(let e=0;e<M.length;e++){const t=S(M[e]);z.push(o("line",{x1:y-5,y1:t,x2:y,y2:t,stroke:"#374151",key:`ytick-${e}`})),z.push(o("text",{x:y-10,y:t+4,"text-anchor":"end","font-size":11,fill:"#6b7280",key:`ylabel-${e}`},kn(M[e])))}function C(e,t,n,r,i,l,a,s,d,c){if(0===e.length)return;const f=[...e].sort((e,t)=>e.x-t.x);if(r){const e=S(w.yMin),t=f.map(e=>`${k(e.x)},${S(e.y)}`).join(" "),n=`${k(f[0].x)},${e} ${t} ${k(f[f.length-1].x)},${e}`;z.push(o("polygon",{points:n,fill:i,key:`${c}-area`}))}const u={points:f.map(e=>`${k(e.x)},${S(e.y)}`).join(" "),fill:"none",stroke:t,"stroke-width":n,"stroke-linejoin":"round","stroke-linecap":"round",key:`${c}-line`};if(b?(u["stroke-dasharray"]="1000",u["stroke-dashoffset"]="1000",z.push(o("polyline",u,o("animate",{attributeName:"stroke-dashoffset",from:1e3,to:0,dur:"1.5s",fill:"freeze"})))):z.push(o("polyline",u)),l)for(let e=0;e<f.length;e++){const t=k(f[e].x),n=S(f[e].y),r=f[e].shape??d,i=f[e].radius??s,l=`${c}-pt-${e}`;if(b){const e=Sn(r,t,n,i,a,l,{opacity:0});z.push(o("g",{key:`${l}-g`},e,o("animate",{attributeName:"opacity",from:0,to:1,dur:"0.3s",begin:"1.2s",fill:"freeze"})))}else z.push(Sn(r,t,n,i,a,l))}}if(C(t,i,l,p,h,f,s,a,c,"primary"),v)for(let e=0;e<v.length;e++){const t=v[e];C(t.data,t.color,l,!1,"transparent",f,t.color,t.pointRadius??a,t.pointShape??c,`series-${e}`)}if(v&&v.length>0){const e=[],t=[{color:i,label:"Primary"},...v.map((e,t)=>({color:e.color,label:e.label??`Series ${t+1}`}))],r=y+10,l=16,a=22,s=7.2,d=14,c=6,f=n-2*y-20;let u=0,p=0;for(let n=0;n<t.length;n++){const i=d+c+t[n].label.length*s;u>0&&u+i>f&&(u=0,p+=a);const h=r+u,g=y-30-p;e.push(o("rect",{x:h,y:g,width:d,height:14,fill:t[n].color,rx:2,key:`legend-rect-${n}`})),e.push(o("text",{x:h+d+c,y:g+12,"font-size":12,fill:"#374151",key:`legend-text-${n}`},t[n].label)),u+=i+l}z.push(o("g",{key:"legend"},...e))}return g&&z.push(o("text",{x:n/2,y:r-8,"text-anchor":"middle","font-size":13,fill:"#374151",key:"x-axis-label"},g)),x&&z.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"},x)),m&&z.push(o("text",{x:n/2,y:20,"text-anchor":"middle","font-size":16,"font-weight":"bold",fill:"#111827",key:"title"},m)),o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...z)}function Mn(e,t,n,o){return{x:e+n*Math.cos(o),y:t+n*Math.sin(o)}}function zn(e,t,n,o,r,i){const l=r-Math.PI/2,a=i-Math.PI/2,s=Mn(e,t,o,l),d=Mn(e,t,o,a),c=i-r>Math.PI?1:0;if(n<=0)return[`M ${e} ${t}`,`L ${s.x} ${s.y}`,`A ${o} ${o} 0 ${c} 1 ${d.x} ${d.y}`,"Z"].join(" ");const f=Mn(e,t,n,a),u=Mn(e,t,n,l);return[`M ${s.x} ${s.y}`,`A ${o} ${o} 0 ${c} 1 ${d.x} ${d.y}`,`L ${f.x} ${f.y}`,`A ${n} ${n} 0 ${c} 0 ${u.x} ${u.y}`,"Z"].join(" ")}function Cn(e,t){const n=t?.padAngle??0,o=function(e,t){const n=t??function(e){const t=[];for(let n=0;n<e;n++){const o=Math.round(360*n/e);t.push(`hsl(${o}, 70%, 55%)`)}return t}(e.length);return e.map((e,t)=>e.color??n[t%n.length])}(e,t?.colors),r=e.reduce((e,t)=>e+t.value,0);if(r<=0)return[];const i=n*e.length,l=2*Math.PI-i,a=[];let s=0;for(let t=0;t<e.length;t++){const i=e[t],d=s+n/2,c=d+i.value/r*l;a.push({label:i.label,value:i.value,startAngle:d,endAngle:c,percentage:i.value/r*100,color:o[t]}),s=c+n/2}return a}function In(e){const{data:t,width:n=400,height:r=400,innerRadius:i=0,padAngle:l=.02,showLabels:a=!0,showValues:s=!0,showLegend:c=!0,legendPosition:f="right",title:u,centerLabel:p,colors:h,strokeColor:g="#fff",strokeWidth:x=2,textColor:m="currentColor"}=e,y=c&&"right"===f?140:0,b=u?30:0,v=c&&"bottom"===f?22*Math.ceil(t.length/2)+10:0,w=n-y,k=r-b-v,S=w/2,$=b+k/2,M=Math.min(w,k)/2-10,z=e.outerRadius??M,C=d(()=>Cn(t,{padAngle:l,colors:h}),[t,l,h]),I=[];u&&I.push(o("text",{key:"title",x:w/2,y:20,textAnchor:"middle",fontFamily:"sans-serif",fontSize:16,fontWeight:"bold",fill:m},u));for(let e=0;e<C.length;e++){const t=C[e],n=zn(S,$,i,z,t.startAngle,t.endAngle);if(I.push(o("path",{key:`slice-${e}`,d:n,fill:t.color,stroke:g,strokeWidth:x})),a||s){const n=(t.startAngle+t.endAngle)/2,r=t.percentage<5,l=Mn(S,$,r?z+14:i+.65*(z-i),n-Math.PI/2),d=r?m:"#fff",c=r?11:12,f=[];if(a&&f.push(t.label),s&&f.push(`${t.percentage.toFixed(1)}%`),r){const t=Mn(S,$,z+2,n-Math.PI/2);I.push(o("line",{key:`connector-${e}`,x1:t.x,y1:t.y,x2:l.x,y2:l.y,stroke:"#999",strokeWidth:1}))}a&&I.push(o("text",{key:`label-${e}`,x:l.x,y:l.y-(s?6:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:c,fill:d,pointerEvents:"none"},t.label)),s&&I.push(o("text",{key:`value-${e}`,x:l.x,y:l.y+(a?10:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:c-1,fill:d,pointerEvents:"none"},`${t.percentage.toFixed(1)}%`))}}if(p&&i>0&&I.push(o("text",{key:"center-label",x:S,y:$,textAnchor:"middle",dominantBaseline:"central",fontFamily:"sans-serif",fontSize:14,fontWeight:"bold",fill:m},p)),c){const e=[];if("right"===f){const t=w+10,n=b+20;for(let r=0;r<C.length;r++){const i=C[r],l=n+22*r;e.push(o("circle",{key:`legend-dot-${r}`,cx:t+6,cy:l,r:6,fill:i.color})),e.push(o("text",{key:`legend-text-${r}`,x:t+18,y:l,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:m},`${i.label} (${i.percentage.toFixed(1)}%)`))}}else{const t=r-v+10;for(let r=0;r<C.length;r++){const i=C[r],l=r%2*(n/2)+10,a=t+22*Math.floor(r/2);e.push(o("circle",{key:`legend-dot-${r}`,cx:l+6,cy:a,r:6,fill:i.color})),e.push(o("text",{key:`legend-text-${r}`,x:l+18,y:a,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:m},`${i.label} (${i.percentage.toFixed(1)}%)`))}}I.push(...e)}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...I)}function An(e,t,n,o,r){return{x:n+e*Math.cos(t)*r,y:o-e*Math.sin(t)*r}}function Fn(e){const{width:t=400,height:n=400,rRange:r=[0,2],plotFunction:i,plotResolution:f=360,thetaStep:u,sync:p=!1,points:h=[],showGrid:g=!0,pointRadius:x=3,pointColor:m="#3b82f6",curveColor:y="#3b82f6",onPointClick:b,onPointDoubleClick:v,onPointContextMenu:w,onPointHover:k}=e,[S,$]=l(r[1]),[M,z]=l(0),[C,I]=l(0),[A,F]=l(null),R=t/2+M,D=n/2+C,L=Math.min(t,n)/2-30,W=L/S,N=d(()=>{const e=Math.max(1,Math.ceil(S)),t=[],n=S/e;for(let o=1;o<=e;o++)t.push(n*o);return t},[S]),E=d(()=>{const e=[];for(let t=0;t<360;t+=30)e.push(t*Math.PI/180);return e},[]),T=d(()=>{if(!i||!p)return[];const e=u??2*Math.PI/f,t=an({start:0,end:2*Math.PI,step:e});return sn(i,t)},[i,f,u,p]),[B,P]=l([]),_=c(null);a(()=>{if(!i||p)return void P([]);const e=u??2*Math.PI/f,t=an({start:0,end:2*Math.PI,step:e});return _.current&&_.current(),_.current=dn(i,t,200,e=>{P([...e])}),()=>{_.current&&_.current()}},[i,f,u,p]);const H=p?T:B,Y=d(()=>{if(0===H.length)return"";const e=[];for(let t=0;t<H.length;t++){const n=H[t],o=n.output;if(o<0||!isFinite(o))continue;const{x:r,y:i}=An(o,n.input,R,D,W);e.push(`${0===e.length?"M":"L"}${r.toFixed(2)},${i.toFixed(2)}`)}return e.join(" ")},[H,R,D,W]),j=s(e=>{F({x:e.clientX,y:e.clientY,px:M,py:C})},[M,C]),q=s(e=>{A&&(z(A.px+(e.clientX-A.x)),I(A.py+(e.clientY-A.y)))},[A]),O=s(()=>{F(null)},[]),U=s(e=>{e.preventDefault();const t=e.deltaY>0?1.15:1/1.15;$(Math.max(.1,S*t))},[S]),X=s((e,t,n)=>{if(e)return o=>e({r:t.r,theta:t.theta,index:n,event:o})},[]),V=[];if(V.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),g){for(let e=0;e<N.length;e++){const t=N[e]*W;V.push(o("circle",{cx:R,cy:D,r:t,fill:"none",stroke:"#e5e7eb","stroke-width":1,key:`gc-${e}`})),V.push(o("text",{x:R+t+2,y:D-4,"font-size":10,fill:"#9ca3af",key:`gl-${e}`},N[e].toFixed(1)))}for(let e=0;e<E.length;e++){const t=E[e],n=N[N.length-1]*W,r=R+n*Math.cos(t),i=D-n*Math.sin(t);V.push(o("line",{x1:R,y1:D,x2:r,y2:i,stroke:"#e5e7eb","stroke-width":1,key:`al-${e}`}));const l=Math.round(180*t/Math.PI),a=R+(n+14)*Math.cos(t),s=D-(n+14)*Math.sin(t);V.push(o("text",{x:a,y:s+4,"text-anchor":"middle","font-size":10,fill:"#9ca3af",key:`at-${e}`},`${l}°`))}}V.push(o("line",{x1:R-L,y1:D,x2:R+L,y2:D,stroke:"#d1d5db","stroke-width":1,key:"x-axis"})),V.push(o("line",{x1:R,y1:D-L,x2:R,y2:D+L,stroke:"#d1d5db","stroke-width":1,key:"y-axis"})),Y&&V.push(o("path",{d:Y,fill:"none",stroke:y,"stroke-width":2,key:"curve"}));for(let e=0;e<h.length;e++){const t=h[e],{x:n,y:r}=An(t.r,t.theta,R,D,W);V.push(o("circle",{cx:n,cy:r,r:x,fill:m,key:`pt-${e}`,style:{cursor:"pointer"},onClick:X(b,t,e),onDblClick:X(v,t,e),onContextMenu:X(w,t,e),onMouseEnter:X(k,t,e)}))}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",style:{cursor:A?"grabbing":"grab"},onMouseDown:j,onMouseMove:q,onMouseUp:O,onMouseLeave:O,onWheel:U},...V)}function Rn(e){const t=1<<e,n=[];for(let o=0;o<t;o++){const t=[];for(let n=0;n<e;n++)t.push(2*(o>>n&1)-1);n.push({coords:t})}return n}function Dn(e){const t=1<<e,n=[];for(let o=0;o<t;o++)for(let t=0;t<e;t++){const e=o^1<<t;e>o&&n.push({source:o,target:e})}return n}function Ln(e,t){let n=Wn(e),o=0;for(let r=0;r<e;r++)for(let i=r+1;i<e;i++)o<t.length&&(n=En(n,Nn(e,r,i,t[o]))),o++;return n}function Wn(e){const t=[];for(let n=0;n<e;n++){const o=new Array(e).fill(0);o[n]=1,t.push(o)}return t}function Nn(e,t,n,o){const r=Wn(e),i=Math.cos(o),l=Math.sin(o);return r[t][t]=i,r[t][n]=-l,r[n][t]=l,r[n][n]=i,r}function En(e,t){const n=e.length,o=[];for(let r=0;r<n;r++){const i=new Array(n).fill(0);for(let o=0;o<n;o++)for(let l=0;l<n;l++)i[o]+=e[r][l]*t[l][o];o.push(i)}return o}function Tn(e,t){const n=e.length,o=new Array(n).fill(0);for(let r=0;r<n;r++)for(let i=0;i<n;i++)o[r]+=e[r][i]*t.coords[i];return o}function Bn(e,t=0){const n=e[0]??0,o=e[1]??0;let r=0;for(let t=2;t<e.length;t++)r+=e[t]??0;if(e.length>2&&(r/=e.length-2),t>0){const e=1/(1+t*(r+2));return{x:n*e,y:o*e,depth:r}}return{x:n,y:o,depth:r}}function Pn(e,t=[],n=.3,o=1){const r=Rn(e),i=Dn(e),l=Ln(e,t);return{vertices:r.map((e,t)=>{const r=Bn(Tn(l,e),n);return{id:t,position:e,x:r.x*o,y:r.y*o,depth:r.depth}}),edges:i,dimension:e}}function _n(e){return e*(e-1)/2}function Hn(e,t=70,n=55){const o=[];for(let r=0;r<e;r++){const i=Math.round(360*r/e);o.push(`hsl(${i}, ${t}%, ${n}%)`)}return o}function Yn(e){const t=e.dimension??4,n=e.width??600,r=e.height??600,i=e.vertexRadius??10,f=e.edgeWidth??3,u=e.edgeColor??"#111",p=e.perspective??.25,h=e.rotationSpeed??.008,g=e.showLabels??!1,x=e.backgroundColor??"transparent",m=e.scale??.3*Math.min(n,r),y=_n(t),b=1<<t,v=d(()=>"auto"===e.vertexColors||void 0===e.vertexColors?Hn(b):e.vertexColors,[b,e.vertexColors]),[w,k]=l(()=>{const e=[];for(let t=0;t<y;t++)e.push(0);return e}),[S,$]=l(!1),M=c({x:0,y:0}),z=c([]),C=c(0);a(()=>{if(0===h)return;let e=!0;const t=()=>{e&&(k(e=>{const t=e.slice();for(let e=0;e<t.length;e++)t[e]=(t[e]??0)+h*(1+.3*e);return t}),C.current=requestAnimationFrame(t))};return C.current=requestAnimationFrame(t),()=>{e=!1,cancelAnimationFrame(C.current)}},[h]);const I=d(()=>Pn(t,w,p,m),[t,w,p,m]),A=n/2,F=r/2,R=d(()=>I.edges.map(e=>{const t=I.vertices[e.source],n=I.vertices[e.target],o=(t.depth+n.depth)/2;return{...e,avgDepth:o,sv:t,tv:n}}).sort((e,t)=>e.avgDepth-t.avgDepth),[I]),D=d(()=>I.vertices.slice().sort((e,t)=>e.depth-t.depth),[I]),L=s(e=>{const t=e;$(!0),M.current={x:t.clientX,y:t.clientY},z.current=w.slice()},[w]),W=s(e=>{if(!S)return;const t=e,n=.01*(t.clientX-M.current.x),o=.01*(t.clientY-M.current.y);k(()=>{const e=z.current.slice();return e.length>0&&(e[0]=(e[0]??0)+n),e.length>1&&(e[1]=(e[1]??0)+o),e})},[S]),N=s(()=>{$(!1)},[]),E=R.map((e,t)=>{const n=(e=>{const t=(e+2)/4;return.3+.7*Math.max(0,Math.min(1,t))})(e.avgDepth);return o("line",{key:`e-${e.source}-${e.target}`,x1:String(A+e.sv.x),y1:String(F+e.sv.y),x2:String(A+e.tv.x),y2:String(F+e.tv.y),stroke:u,"stroke-width":String(f),"stroke-opacity":String(n),"stroke-linecap":"round"})}),T=D.map(e=>{const n=i*(e=>{const t=(e+2)/4;return.6+.4*Math.max(0,Math.min(1,t))})(e.depth),r=v[e.id%v.length]??"#3b82f6",l=[o("circle",{key:`v-${e.id}-circle`,cx:String(A+e.x),cy:String(F+e.y),r:String(n),fill:r,stroke:"#000","stroke-width":"1.5",style:{filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.3))"}})];return g&&l.push(o("text",{key:`v-${e.id}-label`,x:String(A+e.x),y:String(F+e.y+n+14),"text-anchor":"middle","font-size":"11","font-family":"monospace",fill:"#555"},e.id.toString(2).padStart(t,"0"))),l});return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",style:{backgroundColor:x,cursor:S?"grabbing":"grab",userSelect:"none"},onMouseDown:L,onMouseMove:W,onMouseUp:N,onMouseLeave:N},...E,...T.flat())}function jn(e={}){const t=e.dimension??4,n=e.rotationSpeed??.008,o=e.perspective??.25,r=e.scale??200,i=_n(t),[s,c]=l(()=>new Array(i).fill(0));return a(()=>{if(0===n)return;let e=!0,t=0;const o=()=>{e&&(c(e=>e.map((e,t)=>e+n*(1+.3*t))),t=requestAnimationFrame(o))};return t=requestAnimationFrame(o),()=>{e=!1,cancelAnimationFrame(t)}},[n]),{data:d(()=>Pn(t,s,o,r),[t,s,o,r]),angles:s,setAngles:c}}function qn(e){const t=e.titlePosition??"top",n=e.legendPosition??"bottom",r=e.titleAlign??"center",i=e.legendAlign??"center",l=e.gap??"12px",a=e.contain??"layout style paint",s={display:"flex",flexDirection:"column",gap:l,width:"number"==typeof e.width?`${e.width}px`:e.width??"auto",height:"number"==typeof e.height?`${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,c=e.legend&&e.legend.length>0?(f=e.legend,o("div",{className:"viz-legend",style:{display:"flex",flexDirection:(u={align:i,fontSize:e.legendFontSize??"12px",gap:e.legendGap??16,direction:"left"===n||"right"===n?"column":"row"}).direction,flexWrap:"wrap",gap:`${u.gap}px`,justifyContent:u.align,alignItems:"center",fontSize:u.fontSize,color:"#6b7280",flexShrink:"0"}},...f.map((e,t)=>o("div",{key:`legend-${t}`,style:{display:"flex",alignItems:"center",gap:"6px"}},function(e){const t=e.shape??"circle";return"line"===t?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??""})):o("div","square"===t?{style:{width:"12px",height:"12px",backgroundColor:e.color,borderRadius:"2px",flexShrink:"0"}}:{style:{width:"10px",height:"10px",backgroundColor:e.color,borderRadius:"50%",flexShrink:"0"}})}(e),o("span",null,e.label))))):null;var f,u;const p=function(e,t,n,r,i){const l=[];if("top"===r&&e&&l.push(e),"left"===i||"right"===i){const a=[];"left"===i&&n&&a.push(n),"left"===r&&e&&a.push(e),a.push(t),"right"===r&&e&&a.push(e),"right"===i&&n&&a.push(n),l.push(o("div",{style:{display:"flex",flexDirection:"row",flex:"1",gap:"12px",minHeight:"0",alignItems:"stretch"}},...a))}else if("left"===r||"right"===r){"top"===i&&n&&l.push(n);const a=[];"left"===r&&e&&a.push(e),a.push(t),"right"===r&&e&&a.push(e),l.push(o("div",{style:{display:"flex",flexDirection:"row",flex:"1",gap:"12px",minHeight:"0",alignItems:"center"}},...a)),"bottom"===i&&n&&l.push(n)}else"top"===i&&n&&l.push(n),l.push(t),"bottom"===i&&n&&l.push(n);return"bottom"===r&&e&&l.push(e),l}(d,o("div",{className:"viz-content",style:{flex:"1",minWidth:"0",minHeight:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}},e.children),c,t,n);return o("div",{className:`viz-wrapper ${e.className??""}`.trim(),style:s},...p)}function On(e){const{measurementId:t,disabled:n=!1,debug:o=!1,anonymizeIp:r=!1,config:i}=e;return a(()=>{if(n||"undefined"==typeof window)return;!function(e){if("undefined"==typeof document)return;const t="specifyjs-gtag";if(document.getElementById(t))return;const 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)}(t),"undefined"!=typeof window&&(window.dataLayer=window.dataLayer||[],window.gtag||(window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date)));const e={...i};return r&&(e.anonymize_ip=!0),o&&(e.debug_mode=!0),window.gtag&&window.gtag("config",t,e),()=>{const e=document.getElementById("specifyjs-gtag");e&&e.remove()}},[t,n,o,r]),null}function Un(e){const{left:t,center:n,right:r,borderTop:i="1px solid var(--color-border, #e2e8f0)",background:l="var(--color-bg, transparent)",color:a="var(--color-text-muted, #64748b)",fontSize:s="13px",padding:d="24px",maxWidth:c="1200px",className:f,ariaLabel:u="Site footer"}=e;return o("footer",{className:f,role:"contentinfo","aria-label":u,style:{borderTop:i,background:l,color:a,fontSize:s,padding:d,marginTop:"48px"}},o("div",{style:{maxWidth:c,margin:"0 auto",display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:"12px"}},o("div",{style:{flex:"1",textAlign:"left",minWidth:"150px"}},t??null),o("div",{style:{flex:"1",textAlign:"center",minWidth:"150px"}},n??null),o("div",{style:{flex:"1",textAlign:"right",minWidth:"150px"}},r??null)))}const Xn=r({windows:[],openWindow:()=>{},closeWindow:()=>{},focusWindow:()=>{},minimizeWindow:()=>{},maximizeWindow:()=>{},restoreWindow:()=>{},moveWindow:()=>{},resizeWindow:()=>{},tileWindows:()=>{},cascadeWindows:()=>{},minimizeAll:()=>{},focusedWindowId:null}),Vn={width:600,height:400},Gn={x:30,y:30},Kn={top:0,left:0,width:1920,height:1080},Zn=1e3;function Jn(e,t,n,o){let r=n.left+e*t.x,i=n.top+e*t.y;const l=n.left+n.width-o.width,a=n.top+n.height-o.height;return l>n.left&&r>l&&(r=n.left+(r-n.left)%Math.max(1,l-n.left)),a>n.top&&i>a&&(i=n.top+(i-n.top)%Math.max(1,a-n.top)),{x:r,y:i}}function Qn(e){const t=[...e].sort((e,t)=>e.zIndex-t.zIndex),n=[];for(let e=0;e<t.length;e++)n.push({...t[e],zIndex:e+1});return n}function eo(e,t){let n=null;for(let o=0;o<e.length;o++){const r=e[o];r.id!==t&&"minimized"!==r.windowState&&(null===n||r.zIndex>n.zIndex)&&(n=r)}return n}function to(e){let t=0;for(let n=0;n<e.length;n++)e[n].zIndex>t&&(t=e[n].zIndex);return t}function no(e){const t=e.workspaceBounds??Kn,n=e.defaultWindowSize??Vn,r=e.cascadeOffset??Gn,[i,a]=l([]),c=s((...o)=>{const i=o[0];a(o=>{if(o.find(e=>e.id===i.id)){const e=to(o)+1;let t=o.map(t=>t.id===i.id?{...t,focused:!0,zIndex:e,windowState:"minimized"===t.windowState?"normal":t.windowState}:{...t,focused:!1});return e>Zn&&(t=Qn(t)),t}const l=i.size??n,a=i.position??Jn(o.length,r,t,l),s=to(o)+1,d={id:i.id,title:i.title,icon:i.icon,position:a,size:l,windowState:"normal",zIndex:s,focused:!0,appProps:i.appProps};let c=o.map(e=>({...e,focused:!1}));return c.push(d),s>Zn&&(c=Qn(c)),e.onWindowOpen&&e.onWindowOpen(i.id),e.onFocusChange&&e.onFocusChange(i.id),c})},[n,r,t,e.onWindowOpen,e.onFocusChange]),f=s((...t)=>{const n=t[0];a(t=>{const o=t.find(e=>e.id===n);if(!o)return t;const r=t.filter(e=>e.id!==n);if(o.focused&&r.length>0){const t=eo(r,n);if(t){const o=r.map(e=>({...e,focused:e.id===t.id}));return e.onWindowClose&&e.onWindowClose(n),e.onFocusChange&&e.onFocusChange(t.id),o}}return e.onWindowClose&&e.onWindowClose(n),0===r.length&&e.onFocusChange&&e.onFocusChange(null),r})},[e.onWindowClose,e.onFocusChange]),u=s((...t)=>{const n=t[0];a(t=>{if(!t.find(e=>e.id===n))return t;const o=to(t)+1;let r=t.map(e=>e.id===n?{...e,focused:!0,zIndex:o}:{...e,focused:!1});return o>Zn&&(r=Qn(r)),e.onFocusChange&&e.onFocusChange(n),r})},[e.onFocusChange]),p=s((...t)=>{const n=t[0];a(t=>{const o=t.find(e=>e.id===n);if(!o)return t;let r=t.map(e=>e.id===n?{...e,windowState:"minimized",focused:!1}:e);if(o.focused){const t=eo(r,n);t?(r=r.map(e=>({...e,focused:e.id===t.id})),e.onFocusChange&&e.onFocusChange(t.id)):e.onFocusChange&&e.onFocusChange(null)}return r})},[e.onFocusChange]),h=s((...e)=>{const t=e[0];a(e=>e.map(e=>e.id===t?{...e,windowState:"maximized"}:e))},[]),g=s((...e)=>{const t=e[0];a(e=>e.map(e=>e.id===t?{...e,windowState:"normal"}:e))},[]),x=s((...e)=>{const t=e[0],n=e[1];a(e=>e.map(e=>e.id===t?{...e,position:n}:e))},[]),m=s((...e)=>{const t=e[0],n=e[1];a(e=>e.map(e=>e.id===t?{...e,size:n}:e))},[]),y=s((...e)=>{a(e=>{const n=e.filter(e=>"minimized"!==e.windowState);if(0===n.length)return e;const o=n.length,r=new Map;if(1===o)r.set(n[0].id,{position:{x:t.left,y:t.top},size:{width:t.width,height:t.height}});else if(2===o){const e=Math.floor(t.width/2);r.set(n[0].id,{position:{x:t.left,y:t.top},size:{width:e,height:t.height}}),r.set(n[1].id,{position:{x:t.left+e,y:t.top},size:{width:t.width-e,height:t.height}})}else if(3===o){const e=Math.floor(t.width/2),o=Math.floor(t.height/2);r.set(n[0].id,{position:{x:t.left,y:t.top},size:{width:e,height:t.height}}),r.set(n[1].id,{position:{x:t.left+e,y:t.top},size:{width:t.width-e,height:o}}),r.set(n[2].id,{position:{x:t.left+e,y:t.top+o},size:{width:t.width-e,height:t.height-o}})}else{const e=Math.ceil(Math.sqrt(o)),i=Math.ceil(o/e),l=Math.floor(t.width/e),a=Math.floor(t.height/i);for(let o=0;o<n.length;o++){const i=Math.floor(o/e),s=o%e;r.set(n[o].id,{position:{x:t.left+s*l,y:t.top+i*a},size:{width:l,height:a}})}}return e.map(e=>{const t=r.get(e.id);return t?{...e,position:t.position,size:t.size,windowState:"normal"}:e})})},[t]),b=s((...e)=>{a(e=>{const n=e.filter(e=>"minimized"!==e.windowState);if(0===n.length)return e;const o=[...n].sort((e,t)=>e.zIndex-t.zIndex),i=new Map;for(let e=0;e<o.length;e++){const n=Jn(e,r,t,o[e].size);i.set(o[e].id,{position:n,zIndex:e+1})}return e.map(e=>{const t=i.get(e.id);return t?{...e,position:t.position,zIndex:t.zIndex,windowState:"normal"}:e})})},[r,t]),v=s((...t)=>{a(t=>{const n=t.map(e=>({...e,windowState:"minimized",focused:!1}));return e.onFocusChange&&e.onFocusChange(null),n})},[e.onFocusChange]),w=d(()=>{const e=i.find(e=>e.focused);return e?e.id:null},[i]),k=d(()=>({windows:i,openWindow:c,closeWindow:f,focusWindow:u,minimizeWindow:p,maximizeWindow:h,restoreWindow:g,moveWindow:x,resizeWindow:m,tileWindows:y,cascadeWindows:b,minimizeAll:v,focusedWindowId:w}),[i,c,f,u,p,h,g,x,m,y,b,v,w]);return o(Xn.Provider,{value:k},e.children)}function oo(){return e=Xn,i().useContext(e);var e}const ro=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],io=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function lo(e){return e<10?"0"+String(e):String(e)}function ao(e){const{label:t,onClick:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:l}=dt();return o("button",{type:"button",role:"button","aria-label":t,tabIndex:0,onClick:s(()=>{n()},[n]),onKeyDown:s(e=>{const t=e;"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),n())},[n]),onMouseEnter:i,onMouseLeave:l,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 so(e){const{format:t,showSeconds:n,showDate:r}=e,[i,s]=l(new Date);a(()=>{const e=setInterval(()=>{s(new Date)},1e3);return()=>{clearInterval(e)}},[]);const c=d(()=>function(e,t,n){let o=e.getHours();const r=lo(e.getMinutes()),i=lo(e.getSeconds());if("12h"===t){const e=o>=12?"PM":"AM";return o%=12,0===o&&(o=12),`${n?`${String(o)}:${r}:${i}`:`${String(o)}:${r}`} ${e}`}const l=lo(o);return n?`${l}:${r}:${i}`:`${l}:${r}`}(i,t,n),[i,t,n]),f=d(()=>function(e){const t=ro[e.getDay()],n=io[e.getMonth()],o=e.getDate();return`${t}, ${n} ${String(o)}`}(i),[i]),u=r?o("span",{style:{fontSize:"11px",opacity:"0.85"}},f):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"}},u,o("span",{style:{fontSize:"13px",fontWeight:"500"}},c))}function co(e){const{indicator:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=dt(),l=s(()=>{t.onClick&&t.onClick()},[t]),a=s(e=>{const n=e;"Enter"!==n.key&&" "!==n.key||(n.preventDefault(),t.onClick&&t.onClick())},[t]);return o("button",{type:"button",role:"button","aria-label":t.label||t.icon,tabIndex:0,onClick:l,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 fo(e){const{item:t,onClose:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:l}=dt();return t.divider?o("div",{role:"separator",style:{height:"1px",backgroundColor:"var(--panel-divider, #555555)",margin:"4px 0"}}):o("button",{type:"button",role:"menuitem",tabIndex:-1,onClick:s(()=>{t.onClick(),n()},[t,n]),onKeyDown:s(e=>{const o=e;"Enter"!==o.key&&" "!==o.key||(o.preventDefault(),t.onClick(),n())},[t,n]),onMouseEnter:i,onMouseLeave:l,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 uo(e){const{user:t,menuItems:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:d}=dt(),[f,u]=l(!1),p=c(null),h=s(()=>{u(e=>!e)},[]),g=s(()=>{u(!1)},[]),x=s(e=>{const t=e;"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),u(e=>!e)),"Escape"===t.key&&u(!1)},[]);a(()=>{if(!f)return;const e=e=>{const t=p.current;t&&!t.contains(e.target)&&u(!1)};return document.addEventListener("click",e,!0),()=>{document.removeEventListener("click",e,!0)}},[f]);const m=t.avatar?o("img",{src:t.avatar,alt:t.name,style:{width:"100%",height:"100%",objectFit:"cover"}}):t.name.charAt(0).toUpperCase(),y=o("span",{style:{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"},"aria-hidden":"true"},m),b=f&&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((e,t)=>o(fo,{key:String(t),item:e,onClose:g}))):null;return o("div",{ref:p,style:{position:"relative",display:"inline-flex",height:"100%"}},o("button",{type:"button","aria-haspopup":"true","aria-expanded":String(f),tabIndex:0,onClick:h,onKeyDown:x,onMouseEnter:i,onMouseLeave:d,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"0 8px",height:"100%",border:"none",outline:"none",backgroundColor:r||f?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",cursor:"pointer",transition:"background-color 0.15s"}},y,o("span",null,t.name),o("span",{"aria-hidden":"true",style:{fontSize:"10px"}},"▾")),b)}function po(e){const{activeAppName:t,activitiesButton:n,clockFormat:r="24h",showSeconds:i=!0,showDate:l=!0,indicators:a,user:s,userMenuItems:d,height:c=28,children:f}=e,u=String(c)+"px",p=[];n&&p.push(o(ao,{key:"activities",label:n.label,onClick:n.onClick})),t&&p.push(o("span",{key:"appname",style:{padding:"0 12px",fontSize:"13px",fontWeight:"700",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"200px"}},t));const h=o("div",{style:{display:"flex",alignItems:"center",height:"100%",flex:"1",minWidth:"0"}},...p),g=[];g.push(o(so,{key:"clock",format:r,showSeconds:i,showDate:l})),f&&g.push(f);const x=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}},...g),m=[];if(a&&a.length>0){const e=a.map(e=>o(co,{key:e.id,indicator:e}));m.push(o("div",{key:"indicators",style:{display:"flex",alignItems:"center",gap:"8px",height:"100%"}},...e))}s&&m.push(o(uo,{key:"user",user:s,menuItems:d}));const y=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",height:"100%",flex:"1",gap:"4px"}},...m);return o("div",{role:"menubar","aria-label":"System panel","data-theme":"dark",style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",height:u,backgroundColor:"var(--panel-bg, #2c2c2c)",color:"var(--panel-text, #ffffff)",fontFamily:"inherit",fontSize:"13px",boxSizing:"border-box",position:"relative"}},h,x,y)}const ho=["#3465a4","#e67e22","#2ecc71","#3498db","#e74c3c","#9b59b6","#f39c12","#1abc9c","#e91e63","#00bcd4"];function go(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return ho[Math.abs(t)%ho.length]}function xo(e){return e.badge&&e.badge>0?`${e.label}, ${e.badge} unread`:e.label}function mo(e){switch(e){case"left":default: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"}}}function yo(e,t){return"vertical"===t?"right"===e?{position:"absolute",right:"0",top:"50%",transform:"translateY(-50%)"}:{position:"absolute",left:"0",top:"50%",transform:"translateY(-50%)"}:"bottom"===e?{position:"absolute",top:"0",left:"50%",transform:"translateX(-50%)"}:{position:"absolute",bottom:"0",left:"50%",transform:"translateX(-50%)"}}function bo(e){const{item:t,iconSize:n,position:r,orientation:i,onItemClick:a,onItemContextMenu:d}=e,[c,f]=l(!1),u=t.disabled??!1,p=s(()=>{u||f(!0)},[u]),h=s(()=>{f(!1)},[]),g=s(()=>{!u&&a&&a(t.id)},[u,a,t.id]),x=s(e=>{if(!u&&d){const n=e;n.preventDefault(),d(t.id,{x:n.clientX,y:n.clientY})}},[u,d,t.id]),m=`${n}px`,y=(b=t.icon).startsWith("http")||b.startsWith("/")||b.startsWith(".")?o("img",{src:t.icon,alt:t.label,style:{width:m,height:m,objectFit:"contain",display:"block"}}):o("span",{style:{width:m,height:m,display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.round(.6*n)}px`,fontWeight:"700",userSelect:"none",backgroundColor:go(t.icon),color:"#ffffff",borderRadius:"8px"},"aria-hidden":"true"},t.icon);var b;const v=null!=t.badge&&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"},(w=t.badge)>99?"99+":String(w)):null;var w;const k=t.active?o("span",{style:{...yo(r,i),width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"var(--dock-active-color, #ffffff)",pointerEvents:"none",zIndex:"2"},"aria-hidden":"true"}):null,S=c?o("div",{role:"tooltip",style:{position:"absolute",...mo(r),padding:"4px 10px",backgroundColor:"#1f2937",color:"#ffffff",fontSize:"12px",borderRadius:"4px",whiteSpace:"nowrap",zIndex:"1000",pointerEvents:"none"}},t.label):null;return o("button",{type:"button",role:"button",style:{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",...c&&!u?{transform:"scale(1.1)",backgroundColor:"rgba(255,255,255,0.15)"}:{}},"aria-label":xo(t),"aria-pressed":t.active?"true":"false","aria-disabled":u?"true":void 0,tabIndex:u?-1:0,onClick:g,onContextMenu:x,onMouseEnter:p,onMouseLeave:h,"data-dock-item-id":t.id},y,v,k,S)}function vo(e){const{items:t,orientation:n="vertical",position:r="left",iconSize:i=36,autoHide:a=!1,showTrailingSeparator:d=!1,onItemClick:f,onItemContextMenu:u,children:p}=e,[h,g]=l(!a),x=c(null),m=s(()=>{a&&(null!=x.current&&(clearTimeout(x.current),x.current=null),g(!0))},[a]),y=s(()=>{a&&(x.current=setTimeout(()=>{g(!1)},300))},[a]),b=s(e=>{const t=e,o=t.target,r=o.closest('[role="toolbar"]');if(!r)return;const i=Array.from(r.querySelectorAll("button[data-dock-item-id]")),l=i.indexOf(o);if(l<0)return;const a="vertical"===n,s=a?"ArrowDown":"ArrowRight",d=a?"ArrowUp":"ArrowLeft";if(t.key===s){t.preventDefault();const e=i[l+1];e&&e.focus()}else if(t.key===d){t.preventDefault();const e=i[l-1];e&&e.focus()}else"Home"===t.key?(t.preventDefault(),i[0]?.focus()):"End"===t.key?(t.preventDefault(),i[i.length-1]?.focus()):"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),o.click())},[n]),v="vertical"===n,w={display:"flex",flexDirection:v?"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"};a&&!h&&("left"===r?(w.transform="translateX(-100%)",w.opacity="0"):"right"===r?(w.transform="translateX(100%)",w.opacity="0"):"top"===r?(w.transform="translateY(-100%)",w.opacity="0"):"bottom"===r&&(w.transform="translateY(100%)",w.opacity="0"));const k=[];for(let e=0;e<t.length;e++){if(d&&e===t.length-1&&t.length>1){const t=v?{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"};k.push(o("div",{key:`sep-${e}`,style:t,"aria-hidden":"true",role:"separator"}))}k.push(o(bo,{key:t[e].id,item:t[e],iconSize:i,position:r,orientation:n,onItemClick:f,onItemContextMenu:u}))}const S=a&&!h?o("div",{style:{position:"absolute",..."left"===r?{left:"0",top:"0",width:"4px",height:"100%"}:{},..."right"===r?{right:"0",top:"0",width:"4px",height:"100%"}:{},..."top"===r?{top:"0",left:"0",height:"4px",width:"100%"}:{},..."bottom"===r?{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:w,onMouseEnter:m,onMouseLeave:y,onKeyDown:b},S,...k,null!=p?p:null)}const wo="#2c001e";function ko(e){const{backgroundColor:t=wo,backgroundGradient:n,backgroundImage:r,backgroundImageOpacity:i=1,contextMenuItems:l,onClick:a,onDoubleClick:c,children:f}=e,u=s(e=>{const t=e;t.target===t.currentTarget&&a&&a()},[a]),p=s(e=>{const t=e;t.target===t.currentTarget&&c&&c()},[c]),h=d(()=>{const e={position:"relative",width:"100%",height:"100%",overflow:"hidden",cursor:"default",margin:"0",padding:"0"};return e.backgroundColor=t,n&&(e.background=n),r&&i>=1&&(e.backgroundImage=`url(${r})`,e.backgroundSize="cover",e.backgroundPosition="center"),e},[t,n,r,i]),g=d(()=>!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]),x=[];g&&x.push(o("div",{className:"desktop-background__image-overlay",style:g,"aria-hidden":"true"})),x.push(o("div",{className:"desktop-background__content",style:{position:"relative",width:"100%",height:"100%",zIndex:"1"}},f));const m=o("div",{className:"desktop-background",style:h,onClick:u,onDblClick:p,role:"application","aria-label":"Desktop workspace","data-theme":"dark"},...x);return l&&l.length>0?o(Pt,{items:l},m):m}const So={width:200,height:150},$o={x:50,y:50},Mo={width:400,height:300},zo={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 Co(e){const{id:t,title:n,icon:r,defaultPosition:i=$o,defaultSize:f=Mo,minSize:u=So,maxSize:p,resizable:h=!0,draggable:g=!0,windowState:x="normal",focused:m=!0,zIndex:y,onClose:b,onMinimize:v,onMaximize:w,onFocus:k,onMove:S,onResize:$,children:M}=e,[z,C]=l(i.x),[I,A]=l(i.y),[F,R]=l(f.width),[D,L]=l(f.height),[W,N]=l(!1),[E,T]=l(!1),[B,P]=l(null),_=c(null),H=c(null),Y=c(null),j=s((e,t)=>{let n=Math.max(e,u.width),o=Math.max(t,u.height);return p&&(n=Math.min(n,p.width),o=Math.min(o,p.height)),{width:n,height:o}},[u,p]),q=s(()=>{const e=Y.current;return e&&e.parentElement?{width:e.parentElement.clientWidth,height:e.parentElement.clientHeight}:{width:window.innerWidth,height:window.innerHeight}},[]);s((e,t,n,o)=>{const r=q();return{x:Math.max(0,Math.min(e,r.width-n)),y:Math.max(0,Math.min(t,r.height-o))}},[q]);const O=s(e=>{if(!g||"maximized"===x)return;const t=e;t.target.closest("button")||(t.preventDefault(),_.current={startMouseX:t.clientX,startMouseY:t.clientY,startPosX:z,startPosY:I},N(!0))},[g,x,z,I]),U=s(e=>{e.target.closest("button")||w&&w()},[w]);a(()=>{if(!W)return;const e=e=>{const t=e,n=_.current;if(!n)return;const o=t.clientX-n.startMouseX,r=t.clientY-n.startMouseY;let i=n.startPosX+o,l=n.startPosY+r;const a=q();i=Math.max(0,Math.min(i,a.width-F)),l=Math.max(0,Math.min(l,a.height-D)),C(i),A(l),t.clientX<=20?P("left"):t.clientX>=a.width-20?P("right"):t.clientY<=20?P("top"):P(null)},t=e=>{const t=e;N(!1);const n=q();if("left"===B)return C(0),A(0),R(Math.floor(n.width/2)),L(n.height),P(null),S&&S({x:0,y:0}),void($&&$({width:Math.floor(n.width/2),height:n.height}));if("right"===B){const e=Math.floor(n.width/2);return C(e),A(0),R(e),L(n.height),P(null),S&&S({x:e,y:0}),void($&&$({width:e,height:n.height}))}if("top"===B)return P(null),void(w&&w());P(null);const o=_.current;if(o&&S){const e=t.clientX-o.startMouseX,r=t.clientY-o.startMouseY;let i=o.startPosX+e,l=o.startPosY+r;i=Math.max(0,Math.min(i,n.width-F)),l=Math.max(0,Math.min(l,n.height-D)),S({x:i,y:l})}_.current=null};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[W,B,F,D,q,S,$,w]);const X=s(e=>t=>{if(!h||"normal"!==x)return;const n=t;n.preventDefault(),n.stopPropagation(),H.current={direction:e,startMouseX:n.clientX,startMouseY:n.clientY,startPosX:z,startPosY:I,startWidth:F,startHeight:D},T(!0)},[h,x,z,I,F,D]);a(()=>{if(!E)return;const e=e=>{const t=e,n=H.current;if(!n)return;const o=t.clientX-n.startMouseX,r=t.clientY-n.startMouseY,i=n.direction;let l=n.startWidth,a=n.startHeight,s=n.startPosX,d=n.startPosY;i.includes("e")&&(l=n.startWidth+o),i.includes("w")&&(l=n.startWidth-o,s=n.startPosX+o),i.includes("s")&&(a=n.startHeight+r),i.includes("n")&&(a=n.startHeight-r,d=n.startPosY+r);const c=j(l,a);i.includes("w")&&(s=n.startPosX+(n.startWidth-c.width)),i.includes("n")&&(d=n.startPosY+(n.startHeight-c.height)),R(c.width),L(c.height),C(s),A(d)},t=()=>{T(!1),$&&$({width:F,height:D}),H.current=null};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[E,F,D,j,$]),a(()=>{if(!m||!b)return;const e=e=>{"Escape"===e.key&&b()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[m,b]);const V=s(e=>{k&&k()},[k]);if("minimized"===x)return null;const G="maximized"===x,K=d(()=>{const e={position:"absolute",display:"flex",flexDirection:"column",border:"1px solid var(--window-border, #555555)",borderRadius:G?"0":"6px",overflow:"hidden",backgroundColor:"var(--window-body-bg, #1e1e1e)",boxShadow:m?"0 8px 32px rgba(0, 0, 0, 0.4)":"0 4px 16px rgba(0, 0, 0, 0.2)",transition:G?"all 200ms ease":"box-shadow 200ms ease",outline:"none"};return G?(e.top="0",e.left="0",e.width="100%",e.height="100%"):(e.top=`${I}px`,e.left=`${z}px`,e.width=`${F}px`,e.height=`${D}px`),void 0!==y&&(e.zIndex=String(y)),W&&(e.cursor="grabbing",e.userSelect="none"),e},[G,z,I,F,D,y,m,W]),Z=d(()=>{const e={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:g&&!G?"grab":"default",opacity:m?"1":"0.6"};return W&&(e.cursor="grabbing"),e},[m,g,G,W]),J={width:"14px",height:"14px",borderRadius:"50%",border:"none",cursor:"pointer",padding:"0",marginLeft:"6px",fontSize:"0",lineHeight:"0",display:"inline-flex",alignItems:"center",justifyContent:"center"},Q=[];r&&(r.startsWith("http")||r.startsWith("/")||r.startsWith("data:")?Q.push(o("img",{src:r,alt:"",style:{width:"16px",height:"16px",marginRight:"6px",flexShrink:"0"},className:"draggable-window__icon"})):Q.push(o("span",{style:{marginRight:"6px",fontSize:"14px",flexShrink:"0"},className:"draggable-window__icon"},r))),Q.push(o("span",{className:"draggable-window__title-text",style:{flex:"1",fontSize:"13px",fontWeight:"500",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},n));const ee=o("div",{style:{display:"flex",alignItems:"center",flexShrink:"0"},className:"draggable-window__controls"},o("button",{type:"button","aria-label":"Minimize",className:"draggable-window__btn-minimize",style:{...J,backgroundColor:"var(--window-button-minimize, #f39c12)"},onClick:e=>{e.stopPropagation(),v&&v()}}),o("button",{type:"button","aria-label":G?"Restore":"Maximize",className:"draggable-window__btn-maximize",style:{...J,backgroundColor:"var(--window-button-maximize, #2ecc71)"},onClick:e=>{e.stopPropagation(),w&&w()}}),o("button",{type:"button","aria-label":"Close",className:"draggable-window__btn-close",style:{...J,backgroundColor:"var(--window-button-close, #e74c3c)"},onClick:e=>{e.stopPropagation(),b&&b()}}));Q.push(ee);const te=[];if(h&&!G){const e=["n","s","e","w","ne","nw","se","sw"];for(let t=0;t<e.length;t++){const n=e[t],r={position:"absolute",zIndex:"1"};"n"===n?(r.top="0",r.left="8px",r.right="8px",r.height="8px"):"s"===n?(r.bottom="0",r.left="8px",r.right="8px",r.height="8px"):"e"===n?(r.top="8px",r.right="0",r.bottom="8px",r.width="8px"):"w"===n?(r.top="8px",r.left="0",r.bottom="8px",r.width="8px"):"ne"===n?(r.top="0",r.right="0",r.width="8px",r.height="8px"):"nw"===n?(r.top="0",r.left="0",r.width="8px",r.height="8px"):"se"===n?(r.bottom="0",r.right="0",r.width="8px",r.height="8px"):"sw"===n&&(r.bottom="0",r.left="0",r.width="8px",r.height="8px"),r.cursor=zo[n],te.push(o("div",{className:`draggable-window__resize-handle draggable-window__resize-${n}`,style:r,onMouseDown:X(n)}))}}let ne=null;if(B){const e={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"};"left"===B?(e.top="0",e.left="0",e.width="50%",e.height="100%"):"right"===B?(e.top="0",e.right="0",e.width="50%",e.height="100%"):"top"===B&&(e.top="0",e.left="0",e.width="100%",e.height="100%"),ne=o("div",{className:"draggable-window__snap-preview",style:e})}const oe=[];for(let e=0;e<te.length;e++)oe.push(te[e]);oe.push(o("div",{className:"draggable-window__title-bar",style:Z,onMouseDown:O,onDblClick:U,role:"toolbar","aria-label":`${n} window controls`},...Q)),oe.push(o("div",{className:"draggable-window__body",style:{flex:"1",overflow:"auto",backgroundColor:"var(--window-body-bg, #1e1e1e)"}},M));const re=[o("div",{ref:Y,id:`draggable-window-${t}`,className:`draggable-window ${m?"draggable-window--focused":"draggable-window--unfocused"} draggable-window--${x}`,style:K,role:"dialog","aria-label":n,tabIndex:-1,onMouseDown:V},...oe)];return ne&&re.push(ne),1===re.length?re[0]:o("div",{style:{display:"contents"}},...re)}const Io=["File","Edit","View","Insert","Format","Tools","Help"],Ao={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"}]},Fo=[{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"}}],Ro=[{label:"Align left",text:"≡",command:"justifyLeft"},{label:"Align center",text:"≣",command:"justifyCenter"},{label:"Align right",text:"≢",command:"justifyRight"}],Do=["1","2","3","4","5","6","7"],Lo={1:"8",2:"10",3:"12",4:"14",5:"18",6:"24",7:"36"};function Wo(e){return e.trim().split(/\s+/).filter(e=>e.length>0).length}function No(e){const[t,n]=l(!1),[r,i]=l(!1),[a,f]=l(!1),[u,p]=l(-1),[h,g]=l(""),[x,m]=l(-1),[y,b]=l(0),[v,w]=l("3"),k=c(null),S={bold:s(()=>{document.execCommand("bold",!1),n(e=>!e),k.current&&k.current.focus()},[]),italic:s(()=>{document.execCommand("italic",!1),i(e=>!e),k.current&&k.current.focus()},[]),underline:s(()=>{document.execCommand("underline",!1),f(e=>!e),k.current&&k.current.focus()},[])},$={bold:t,italic:r,underline:a},M=s(e=>{document.execCommand(e,!1),k.current&&k.current.focus()},[]),z=s(e=>{document.execCommand("fontSize",!1,e),w(e),k.current&&k.current.focus()},[]),C=s(e=>{m(t=>t===e?-1:e)},[]),I=s(e=>{switch(e){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":"undefined"!=typeof window&&window.print&&window.print();break;case"new":k.current&&(k.current.innerHTML="",b(0))}m(-1),k.current&&k.current.focus()},[]),A=s(()=>{if(k.current){const e=k.current.textContent??"";b(Wo(e))}},[]),F=s(()=>{m(-1)},[]),R=d(()=>({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"}),[]),D=d(()=>function(){const e=[];for(let t=0;t<=20;t++){const 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}(),[]),L=e.content??"Start typing...",W=Wo(L),N=y>0?y:W,E={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"},T={display:"block",width:"100%",padding:"6px 16px",fontSize:"13px",color:"#333",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"};function B(e,t){return{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid transparent",borderRadius:"3px",cursor:"pointer",fontSize:"13px",backgroundColor:$[e]?"rgba(0,0,0,0.12)":h===e?"rgba(0,0,0,0.06)":"transparent",color:"var(--color-text, #444)",transition:"background 0.15s",...t??{}}}const P=Io.map((e,t)=>{const n=[e];return x===t&&Ao[e]&&n.push(o("div",{key:"dropdown",style:E,className:"word-processor__menu-dropdown"},...Ao[e].map((e,t)=>o("button",{key:String(t),style:T,onClick:t=>{t.stopPropagation(),I(e.action)},role:"menuitem"},e.label)))),o("button",{key:String(t),style:(r=t,{padding:"4px 10px",cursor:"pointer",borderRadius:"3px",fontSize:"13px",color:"var(--color-text, #333)",backgroundColor:x===r?"rgba(0,0,0,0.12)":u===r?"rgba(0,0,0,0.08)":"transparent",border:"none",lineHeight:"1",transition:"background 0.15s",position:"relative"}),role:"menuitem","aria-label":e,onClick:()=>C(t),onMouseEnter:()=>{p(t)},onMouseLeave:()=>p(-1)},...n);var r});return o("div",{className:`word-processor ${e.className??""}`.trim(),style:R},o("div",{className:"word-processor__menu-bar",style:{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"},role:"menubar"},...P),o("div",{className:"word-processor__toolbar",style:{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"},role:"toolbar","aria-label":"Formatting toolbar"},o("div",{style:{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"},"aria-label":"Font family"},o("span",null,"Arial"),o("span",{style:{fontSize:"10px",color:"#999"}},"▼")),o("div",{key:"0",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},...Fo.map(e=>o("button",{key:e.id,style:B(e.id,e.style),title:e.shortcut?`${e.label} (${e.shortcut})`:e.label,"aria-label":e.label,"aria-pressed":String($[e.id]??!1),onClick:S[e.id],onMouseEnter:()=>g(e.id),onMouseLeave:()=>g("")},e.text))),o("div",{key:"1",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px",alignItems:"center"}},o("select",{style:{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"},"aria-label":"Font size",value:v,onChange:e=>{const t=e.target;z(t.value)}},...Do.map(e=>o("option",{key:e,value:e},Lo[e])))),o("div",{key:"2",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},...Ro.map((e,t)=>o("button",{key:String(t),style:B(`align-${t}`),title:e.label,"aria-label":e.label,onClick:()=>M(e.command),onMouseEnter:()=>g(`align-${t}`),onMouseLeave:()=>g("")},e.text)))),o("div",{className:"word-processor__ruler",style:{height:"20px",backgroundColor:"#e8e8e8",borderBottom:"1px solid #ccc",position:"relative",flexShrink:"0",margin:"0 60px"},"aria-hidden":"true"},...D),o("main",{className:"word-processor__document-area",style:{flex:"1",display:"flex",justifyContent:"center",alignItems:"flex-start",padding:"30px 40px",overflow:"auto",backgroundColor:"#e0e0e0",cursor:"text"},onClick:F},o("div",{className:"word-processor__page",style:{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"},contentEditable:"true",ref:k,onInput:A,suppressContentEditableWarning:!0},L)),o("div",{className:"word-processor__status-bar",style:{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"}},o("span",null,"Page 1 of 1"),o("span",null,`${N} words`),o("span",null,"100%")))}const Eo=["File","Edit","Selection","View","Go","Run","Terminal","Help"],To={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"}]},Bo=[{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"]',"}"]},_o=Po["App.ts"],Ho=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"]),Yo=new Set(["string","number","boolean","void","null","undefined","any","never","unknown","object","interface","type","enum"]),jo="#569cd6",qo="#d4d4d4";function Oo(e){const[t,n]=l("App.ts"),[r,i]=l({src:!0,components:!0,hooks:!0}),[a,f]=l(-1),[u,p]=l(_o.length),h=c(null),g=s(e=>{n(e);const t=Po[e];t&&p(t.length)},[]),x=s(e=>{i(t=>{const n={},o=Object.keys(t);for(let e=0;e<o.length;e++)n[o[e]]=t[o[e]];return n[e]=!t[e],n})},[]),m=s(e=>{f(t=>t===e?-1:e)},[]),y=s(e=>{switch(e){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":h.current&&(h.current.textContent="",p(1))}f(-1),h.current&&h.current.focus()},[]),b=s(()=>{if(h.current){const e=(h.current.textContent??"").split("\n");p(Math.max(e.length,1))}},[]),v=d(()=>({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"}),[]),w={padding:"3px 8px",fontSize:"12px",color:"#cccccc",cursor:"pointer",borderRadius:"3px",backgroundColor:"transparent",border:"none",position:"relative"},k={...w,backgroundColor:"rgba(255,255,255,0.1)"},S={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"},$={display:"block",width:"100%",padding:"6px 16px",fontSize:"12px",color:"#cccccc",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"},M={cursor:"pointer",padding:"0 6px",borderRadius:"3px",transition:"background-color 0.15s"},z=Po[t]??_o,C=z.map((e,t)=>{const n=function(e){if(!e.trim())return[{text:" ",color:qo}];const t=[];let n=0;for(;n<e.length;){if("/"===e[n]&&"/"===e[n+1]){t.push({text:e.slice(n),color:"#6a9955"});break}if('"'===e[n]||"'"===e[n]||"`"===e[n]){const o=e[n];let r=n+1;for(;r<e.length&&e[r]!==o;)"\\"===e[r]&&r++,r++;r=Math.min(r+1,e.length),t.push({text:e.slice(n,r),color:"#ce9178"}),n=r;continue}if(/[0-9]/.test(e[n])&&(0===n||/[\s(,=:[\]{}+\-*/]/.test(e[n-1]))){let o=n;for(;o<e.length&&/[0-9.]/.test(e[o]);)o++;t.push({text:e.slice(n,o),color:"#b5cea8"}),n=o;continue}if(/[a-zA-Z_$]/.test(e[n])){let o=n;for(;o<e.length&&/[a-zA-Z0-9_$]/.test(e[o]);)o++;const r=e.slice(n,o);let i=o;for(;i<e.length&&" "===e[i];)i++;const l=i<e.length&&"("===e[i];let a=qo;Ho.has(r)?a=jo:Yo.has(r)?a="#4ec9b0":l?a="#dcdcaa":"true"!==r&&"false"!==r||(a=jo),t.push({text:r,color:a}),n=o;continue}if(" "===e[n]||"\t"===e[n]){let o=n;for(;o<e.length&&(" "===e[o]||"\t"===e[o]);)o++;t.push({text:e.slice(n,o),color:qo}),n=o;continue}t.push({text:e[n],color:"#d4d4d4"}),n++}return t}(e),r=[];let i=0;for(const e of n)r.push(o("span",{key:String(i++),style:{color:e.color}},e.text));return o("div",{key:String(t),style:{minHeight:"20px"}},...r)}),I=Math.max(u,z.length),A=[];for(let e=0;e<I;e++)A.push(o("div",{key:String(e)},String(e+1)));const F=e=>{if(!e.parent)return!0;if(!r[e.parent])return!1;const t=Bo.find(t=>t.name===e.parent&&t.isFolder);return!t||F(t)},R=Eo.map((e,t)=>{const n=[e],r=a===t;return r&&To[e]&&n.push(o("div",{key:"dropdown",style:S,className:"ide__menu-dropdown"},...To[e].map((e,t)=>o("button",{key:String(t),style:$,onClick:t=>{t.stopPropagation(),y(e.action)},role:"menuitem"},e.label)))),o("button",{key:String(t),style:r?k:w,role:"menuitem","aria-label":e,onClick:()=>m(t)},...n)}),D=Bo.map((e,n)=>{if(!F(e))return null;const i=!e.isFolder&&e.name===t,l=e.isFolder?r[e.name]?"📂 ":"📁 ":"📄 ";return o("div",{key:String(n),style:(a=e.indent,s=e.isFolder,d=i,{padding:"3px 8px",paddingLeft:12+16*a+"px",fontSize:"13px",cursor:"pointer",color:s?"#cccccc":"#d4d4d4",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",borderRadius:"3px",margin:"0 4px",transition:"background-color 0.1s",backgroundColor:d?"rgba(255,255,255,0.08)":"transparent"}),onClick:e.isFolder?()=>x(e.name):()=>g(e.name)},l,e.name);var a,s,d}).filter(e=>null!==e);return o("div",{className:`ide ${e.className??""}`.trim(),style:v},o("div",{className:"ide__title-bar",style:{height:"30px",backgroundColor:"#323233",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",color:"#999",flexShrink:"0",borderBottom:"1px solid var(--color-border, #252526)"}},"SpecifyJS IDE"),o("div",{className:"ide__menu-bar",style:{height:"28px",backgroundColor:"#3c3c3c",display:"flex",alignItems:"center",padding:"0 8px",gap:"2px",flexShrink:"0",position:"relative"},role:"menubar"},...R),o("div",{style:{flex:"1",display:"flex",overflow:"hidden"}},o("nav",{className:"ide__sidebar",style:{width:"220px",backgroundColor:"#252526",borderRight:"none",display:"flex",flexDirection:"column",flexShrink:"0",overflowY:"auto"},"aria-label":"File explorer"},o("div",{style:{padding:"8px 12px",fontSize:"11px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#bbbbbb"}},"Explorer"),...D),o("div",{style:{width:"1px",backgroundColor:"#007acc",cursor:"col-resize",flexShrink:"0",opacity:"0.4",transition:"opacity 0.2s"}}),o("div",{style:{flex:"1",display:"flex",flexDirection:"column",overflow:"hidden"}},o("div",{style:{height:"35px",backgroundColor:"#252526",display:"flex",alignItems:"center",flexShrink:"0"}},o("button",{style:{padding:"0 16px",height:"35px",lineHeight:"35px",backgroundColor:"#1e1e1e",color:"#ffffff",fontSize:"13px",cursor:"pointer",border:"none",borderBottom:"2px solid #007acc",boxSizing:"border-box"},"aria-label":t},t)),o("div",{style:{flex:"1",display:"flex",overflow:"auto",backgroundColor:"#1e1e1e",fontFamily:'"Cascadia Code", "Fira Code", "Consolas", monospace',fontSize:"13px",lineHeight:"20px"}},o("div",{style:{padding:"8px 0",textAlign:"right",color:"#858585",userSelect:"none",minWidth:"48px",paddingRight:"12px",paddingLeft:"12px",flexShrink:"0"},"aria-hidden":"true"},...A),o("code",{style:{padding:"8px 0",flex:"1",whiteSpace:"pre",overflowX:"auto",outline:"none",color:"#d4d4d4"},contentEditable:"true",ref:h,onInput:b,suppressContentEditableWarning:!0},...C))),o("div",{className:"ide__minimap",style:{width:"60px",backgroundColor:"#1e1e1e",borderLeft:"1px solid var(--color-border, #252526)",flexShrink:"0",padding:"8px 4px",display:"flex",flexDirection:"column",gap:"2px",position:"relative"},"aria-hidden":"true"},o("div",{style:{position:"absolute",top:"8px",left:"0",right:"0",height:"30px",backgroundColor:"rgba(100, 100, 200, 0.15)",border:"1px solid rgba(100, 100, 200, 0.3)",borderRadius:"2px",pointerEvents:"none"}}),...z.map((e,t)=>o("div",{key:String(t),style:{height:"2px",backgroundColor:e.trim()?"#555555":"transparent",borderRadius:"1px",width:`${Math.min(100,2*e.length)}%`}})))),o("div",{className:"ide__status-bar",style:{height:"22px",backgroundColor:"#007acc",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 12px",fontSize:"12px",color:"#ffffff",flexShrink:"0"}},o("div",{style:{display:"flex",gap:"16px"}},o("span",{style:M},"⎇ main"),o("span",{style:M},"0 errors"),o("span",{style:M},"0 warnings")),o("div",{style:{display:"flex",gap:"16px"}},o("span",{style:M},"Ln 1, Col 1"),o("span",{style:M},"UTF-8"),o("span",{style:M},"TypeScript"))))}const Uo=[{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]}],Xo=[{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}],Vo=[{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}],Go=[{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}],Ko=[{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}],Zo=[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],Jo=[{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}],Qo=[{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}],er=["09:30","10:00","10:30","11:00","11:30","12:00"];function tr(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function nr(e){return e.toFixed(2)}const or={backgroundColor:"#1a1a2e",borderRadius:"4px",padding:"12px",border:"1px solid #2a2a4a",overflow:"auto",display:"flex",flexDirection:"column"},rr={fontSize:"12px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#8888aa",marginBottom:"8px",flexShrink:"0"},ir={width:"100%",borderCollapse:"collapse",fontSize:"12px"},lr={textAlign:"left",padding:"4px 6px",borderBottom:"1px solid #2a2a4a",color:"#8888aa",fontWeight:"600",fontSize:"11px"},ar={padding:"3px 6px",borderBottom:"1px solid #16162a",color:"#ccccdd",fontSize:"12px"},sr={cursor:"default",transition:"background-color 0.1s"};function dr(e){const[t,n]=l(0),[r,i]=l("--:--:--"),[s,c]=l(!0);a(()=>{const e=setInterval(()=>{n(e=>{const t=.5*(Math.random()-.5);return Math.round(100*t)/100})},2e3);return()=>clearInterval(e)},[]),a(()=>{const e=()=>{const e=new Date,t=String(e.getHours()).padStart(2,"0"),n=String(e.getMinutes()).padStart(2,"0"),o=String(e.getSeconds()).padStart(2,"0");i(`${t}:${n}:${o}`)};e();const t=setInterval(e,1e3);return()=>clearInterval(t)},[]),a(()=>{const e=setInterval(()=>{c(e=>!e)},800);return()=>clearInterval(e)},[]);const f=d(()=>({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"}),[]),u=189.42+t,p={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:f},o("header",{className:"trading-dashboard__header",style:{height:"40px",backgroundColor:"#12122a",borderBottom:"1px solid #2a2a4a",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",flexShrink:"0"}},o("span",{style:{fontSize:"14px",fontWeight:"700",color:"#ffffff",letterSpacing:"0.5px",display:"flex",alignItems:"center",gap:"8px"}},"SpecifyJS Trading Platform",o("span",{style:{display:"flex",alignItems:"center",fontSize:"11px",color:"#00c853",fontWeight:"600",marginLeft:"8px"}},o("span",{style:p}),"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:{flex:"1",display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gridTemplateRows:"1fr 1fr",gap:"8px",padding:"8px",overflow:"hidden"}},function(e,t){const n=120,r=Math.min(...e),i=Math.max(...e),l=i-r||1,a=310/(e.length-1),s=e.map((e,t)=>({x:40+t*a,y:15+(1-(e-r)/l)*n}));s.map(e=>`${e.x.toFixed(1)},${e.y.toFixed(1)}`).join(" ");const d="M40,135 "+s.map(e=>`L${e.x.toFixed(1)},${e.y.toFixed(1)}`).join(" ")+` L${s[s.length-1].x.toFixed(1)},135 Z`,c=[];for(let t=1;t<e.length;t++){const n=e[t]>=e[t-1]?"#00c853":"#ff1744";c.push(o("line",{key:String(t),x1:String(s[t-1].x.toFixed(1)),y1:String(s[t-1].y.toFixed(1)),x2:String(s[t].x.toFixed(1)),y2:String(s[t].y.toFixed(1)),stroke:n,strokeWidth:"2",strokeLinecap:"round"}))}const f=[];for(let e=0;e<5;e++){const t=15+e/4*n,r=i-e/4*l;f.push(o("line",{key:`g${e}`,x1:String(40),y1:String(t.toFixed(1)),x2:String(350),y2:String(t.toFixed(1)),stroke:"#2a2a4a",strokeWidth:"0.5",strokeDasharray:"3,3"})),f.push(o("text",{key:`yl${e}`,x:String(36),y:String((t+3).toFixed(1)),fill:"#6666aa",fontSize:"8",textAnchor:"end",fontFamily:"monospace"},nr(r)))}const u=[],p=Math.min(er.length,e.length),h=(e.length-1)/(p-1);for(let e=0;e<p;e++){const t=40+Math.round(e*h)*a;u.push(o("text",{key:`tl${e}`,x:String(t.toFixed(1)),y:String(156),fill:"#6666aa",fontSize:"8",textAnchor:"middle",fontFamily:"monospace"},er[e]))}const g="chartGrad";return o("div",{style:or},o("div",{style:rr},"AAPL ",o("span",{style:{color:"#00c853",fontSize:"14px",fontWeight:"700"}},`$${nr(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:g,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:d,fill:`url(#${g})`}),...f,...u,...c,o("line",{x1:String(40),y1:String((15+(1-(t-r)/l)*n).toFixed(1)),x2:String(350),y2:String((15+(1-(t-r)/l)*n).toFixed(1)),stroke:"#00c853",strokeWidth:"0.5",strokeDasharray:"4,2",opacity:"0.6"})))}(Zo,u),function(){const e=Math.max(...Xo.map(e=>e.qty),...Vo.map(e=>e.qty));return o("div",{style:or},o("div",{style:rr},"Order Book"),o("table",{style:ir},o("thead",null,o("tr",null,o("th",{style:lr},"Bid Price"),o("th",{style:lr},"Qty"),o("th",{style:lr},"Ask Price"),o("th",{style:lr},"Qty"))),o("tbody",null,...Xo.map((t,n)=>{const r=Vo[n],i=t.qty/e*.25,l=(r?.qty??0)/e*.25;return o("tr",{key:String(n),style:sr},o("td",{style:{...ar,color:"#00c853",backgroundColor:`rgba(0,200,83,${i.toFixed(3)})`,fontFamily:"monospace"}},nr(t.price)),o("td",{style:{...ar,backgroundColor:`rgba(0,200,83,${(.5*i).toFixed(3)})`,fontFamily:"monospace"}},tr(t.qty)),o("td",{style:{...ar,color:"#ff1744",backgroundColor:`rgba(255,23,68,${l.toFixed(3)})`,fontFamily:"monospace"}},r?nr(r.price):""),o("td",{style:{...ar,backgroundColor:`rgba(255,23,68,${(.5*l).toFixed(3)})`,fontFamily:"monospace"}},r?tr(r.qty):""))}))))}(),function(e){return o("div",{style:or},o("div",{style:rr},"Watchlist"),o("table",{style:ir},o("thead",null,o("tr",null,o("th",{style:lr},"Symbol"),o("th",{style:lr},"Price"),o("th",{style:lr},"Chg%"),o("th",{style:lr},"Volume"))),o("tbody",null,...Uo.map((t,n)=>{const r=t.price+(0===n?e:0),i=t.change>=0;return o("tr",{key:String(n),style:sr},o("td",{style:{...ar,fontWeight:"600",color:"#ffffff"}},t.symbol,function(e,t){const n=Math.min(...e),r=Math.max(...e)-n||1;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:e.map((t,o)=>{const i=o/(e.length-1)*40,l=14-(t-n)/r*14;return`${i.toFixed(1)},${l.toFixed(1)}`}).join(" "),fill:"none",stroke:t?"#00c853":"#ff1744",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))}(t.spark,i)),o("td",{style:{...ar,fontFamily:"monospace"}},nr(r)),o("td",{style:{...ar,color:i?"#00c853":"#ff1744",fontWeight:"600"}},`${i?"+":""}${nr(t.change)}%`),o("td",{style:{...ar,fontFamily:"monospace",color:"#8888aa"}},(l=t.volume)>=1e6?`${(l/1e6).toFixed(1)}M`:l>=1e3?`${(l/1e3).toFixed(1)}K`:String(l)));var l}))))}(t),function(){const e=Go.reduce((e,t)=>e+t.pnl,0),t=e>=0;return o("div",{style:or},o("div",{style:rr},"Positions",o("span",{style:{marginLeft:"12px",color:t?"#00c853":"#ff1744",fontWeight:"700",fontSize:"12px"}},`${t?"+":""}$${nr(e)}`)),o("table",{style:ir},o("thead",null,o("tr",null,o("th",{style:lr},"Symbol"),o("th",{style:lr},"Qty"),o("th",{style:lr},"Avg"),o("th",{style:lr},"P&L"))),o("tbody",null,...Go.map((e,t)=>{const n=e.pnl>=0;return o("tr",{key:String(t),style:{...sr,backgroundColor:n?"rgba(0,200,83,0.04)":"rgba(255,23,68,0.04)"}},o("td",{style:{...ar,fontWeight:"600",color:"#ffffff"}},e.symbol),o("td",{style:{...ar,fontFamily:"monospace"}},String(e.qty)),o("td",{style:{...ar,fontFamily:"monospace"}},nr(e.avgPrice)),o("td",{style:{...ar,color:n?"#00c853":"#ff1744",fontWeight:"700",fontFamily:"monospace"}},`${n?"+":""}$${nr(e.pnl)}`))}))))}(),o("div",{style:or},o("div",{style:rr},"Recent Trades"),o("table",{style:ir},o("thead",null,o("tr",null,o("th",{style:lr},"Time"),o("th",{style:lr},"Sym"),o("th",{style:lr},"Side"),o("th",{style:lr},"Qty"),o("th",{style:lr},"Price"))),o("tbody",null,...Ko.map((e,t)=>{const n="BUY"===e.side;return o("tr",{key:String(t),style:sr},o("td",{style:{...ar,color:"#8888aa",fontFamily:"monospace"}},e.time),o("td",{style:{...ar,fontWeight:"600",color:"#ffffff"}},e.symbol),o("td",{style:{...ar,color:n?"#00c853":"#ff1744",fontWeight:"600"}},e.side),o("td",{style:{...ar,fontFamily:"monospace"}},tr(e.qty)),o("td",{style:{...ar,fontFamily:"monospace"}},nr(e.price)))})))),function(){const e=Math.max(...Jo.map(e=>e.volume),...Qo.map(e=>e.volume)),t="16px";return o("div",{style:or},o("div",{style:rr},"Market Depth"),o("div",{style:{flex:"1",display:"flex",flexDirection:"column",gap:"2px",justifyContent:"center"}},...Jo.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"}},nr(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"}},tr(n.volume)))),o("div",{style:{height:"1px",backgroundColor:"#2a2a4a",margin:"4px 0"}}),...Qo.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"}},nr(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"}},tr(n.volume))))))}()))}function cr(e){const{toasts:t,onDismiss:n}=e;if(0===t.length)return null;const r=t.map(e=>{let t="rgba(50, 50, 50, 0.95)",r="#555";return"warning"===e.severity?(t="rgba(60, 40, 10, 0.95)",r="#f39c12"):"error"===e.severity&&(t="rgba(60, 10, 10, 0.95)",r="#e74c3c"),o("div",{key:String(e.id),className:`unity-desktop__toast unity-desktop__toast--${e.severity}`,style:{backgroundColor:t,border:`1px solid ${r}`,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(e.id),role:"alert","aria-live":"polite"},e.message)});return o("div",{className:"unity-desktop__toast-container",style:{position:"absolute",top:"8px",right:"8px",zIndex:"9999",display:"flex",flexDirection:"column",gap:"8px",pointerEvents:"none",maxWidth:"320px"},"aria-label":"Notifications"},...r)}function fr(e){const{apps:t,user:n,onAppOpen:r,onLogout:i,theme:c="dark",children:f}=e,u=oo(),[p,h]=l([]),[g,x]=l(!1),[m,y]=l(!1),[b,v]=l(null),[w,k]=l({x:0,y:0}),[S,$]=l(null),M=s(()=>{x(e=>!e)},[]),z=s(e=>{h(t=>t.filter(t=>t.id!==e))},[]);a(()=>{if(0===p.length)return;const e=p[0],t=Date.now()-e.timestamp,n=Math.max(0,5e3-t),o=setTimeout(()=>{h(t=>t.filter(t=>t.id!==e.id))},n);return()=>clearTimeout(o)},[p]);const C=s(e=>{const n=u.windows.find(t=>t.id===e);if(n)"minimized"===n.windowState&&u.restoreWindow(e),u.focusWindow(e);else{const n=t.find(t=>t.id===e);n&&u.openWindow({id:n.id,title:n.label,icon:n.icon})}r&&r(e)},[u,t,r]),I=d(()=>t.map(e=>{const t=u.windows.some(t=>t.id===e.id);return{id:e.id,icon:e.icon,label:e.label,active:t}}),[t,u.windows]),A=d(()=>{if(!u.focusedWindowId)return;const e=u.windows.find(e=>e.id===u.focusedWindowId);return e?e.title:void 0},[u.focusedWindowId,u.windows]),F=s(()=>{y(!0)},[]),R=s(()=>{y(!1)},[]),D=s((e,t)=>{v(e),k(t)},[]),L=s(()=>{v(null)},[]),W=d(()=>{const e=[];return n&&(e.push({label:n.name,icon:void 0,onClick:()=>{},divider:!1}),e.push({label:"",icon:void 0,onClick:()=>{},divider:!0})),e.push({label:"Lock",icon:void 0,onClick:F,divider:!1}),e.push({label:"Logout",icon:void 0,onClick:i||(()=>{}),divider:!1}),e},[n,i,F]),N=d(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'Ubuntu, "Segoe UI", sans-serif',fontSize:"13px",color:"dark"===c?"#ffffff":"#1a1a1a",overflow:"hidden",position:"relative"}),[c]),E={display:"flex",flexDirection:"column",height:"100%",backgroundColor:"dark"===c?"var(--dock-bg, rgba(0, 0, 0, 0.7))":"var(--dock-bg, rgba(200, 200, 200, 0.9))",borderRight:"dark"===c?"1px solid rgba(255, 255, 255, 0.1)":"1px solid rgba(0, 0, 0, 0.1)",flexShrink:"0"},T=o(po,{activeAppName:A,activitiesButton:{label:"Activities",onClick:M},clockFormat:"24h",showSeconds:!0,showDate:!0,user:n?{name:n.name,avatar:n.avatar}:void 0,userMenuItems:W.length>0?W:void 0,height:28}),B=o(vo,{items:I,orientation:"vertical",position:"left",iconSize:36,onItemClick:C,onItemContextMenu:D}),P=o(cr,{toasts:p,onDismiss:z}),_=u.windows.filter(e=>"minimized"!==e.windowState).map(e=>o(Co,{key:e.id,id:e.id,title:e.title,icon:e.icon,defaultPosition:e.position,defaultSize:e.size,zIndex:e.zIndex,focused:e.focused,windowState:e.windowState,onClose:()=>u.closeWindow(e.id),onFocus:()=>u.focusWindow(e.id),onMinimize:()=>u.minimizeWindow(e.id),onMaximize:()=>{"maximized"===e.windowState?u.restoreWindow(e.id):u.maximizeWindow(e.id)},onMove:t=>u.moveWindow(e.id,t),onResize:t=>u.resizeWindow(e.id,t)},function(e){const t={padding:"16px",fontSize:"13px",color:"var(--color-text, #333)",height:"100%",overflow:"auto"};switch(e){case"Files":return o("div",{style:t},o("div",{style:{fontWeight:"600",marginBottom:"12px"}},"Home"),o("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},...["📁 Documents","📁 Downloads","📁 Music","📁 Pictures","📁 Videos","📄 readme.txt"].map(e=>o("span",{style:{cursor:"pointer"}},e))));case"Terminal":return o("div",{style:{...t,backgroundColor:"#1a1a2e",color:"#00ff41",fontFamily:"monospace",fontSize:"12px"}},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",null,"$ _"));case"Browser":return o("div",{style:t},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:t},o("div",{style:{fontWeight:"600",marginBottom:"8px"}},"Inbox (3)"),...["Build passed — CI/CD Pipeline","PR Review: feat/unity-desktop","Weekly sync notes"].map(e=>o("div",{style:{padding:"8px",borderBottom:"1px solid #e2e8f0",cursor:"pointer"}},e)));case"Settings":return o("div",{style:t},o("div",{style:{fontWeight:"600",marginBottom:"12px"}},"System Settings"),...["Appearance","Network","Sound","Power","Users","About"].map(e=>o("div",{style:{padding:"8px 0",borderBottom:"1px solid #e2e8f0"}},e)));case"Word Processor":return o(No,null);case"IDE":return o(Oo,null);case"Trading":return o(dr,null);default:return o("div",{style:t},o("div",{style:{textAlign:"center",padding:"32px",color:"#94a3b8"}},`${e} application content`))}}(e.title))),H=[];f&&H.push(f),H.push(..._),H.push(P);const Y=o(ko,{backgroundColor:"dark"===c?"#2c001e":"#e8e0e4",backgroundGradient:"dark"===c?"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:{flex:"1",position:"relative",overflow:"hidden"}},...H)),j=g?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:M},...t.map(e=>o("button",{key:e.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:t=>{t.stopPropagation(),x(!1),C(e.id)}},o("span",{style:{fontSize:"32px",display:"block"}},e.icon),o("span",null,e.label)))):null,q=m?o("div",{className:"unity-desktop__lock-overlay",style:{position:"absolute",inset:"0",zIndex:"9999",backgroundColor:"rgba(0,0,0,0.85)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#ffffff"},onClick:R},o("div",{style:{fontSize:"64px",marginBottom:"16px"}},"🔒"),o("div",{style:{fontSize:"24px",fontWeight:"600",marginBottom:"8px"}},"Locked"),o("div",{style:{fontSize:"14px",opacity:"0.7"}},"Click to unlock")):null,O=b?o("div",{className:"unity-desktop__context-menu-backdrop",style:{position:"absolute",inset:"0",zIndex:"9000"},onClick:L},o("div",{className:"unity-desktop__context-menu",style:{position:"absolute",top:`${w.y}px`,left:`${w.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:e=>e.stopPropagation()},o("div",{style:{padding:"6px 14px",fontWeight:"600",borderBottom:"1px solid #444",marginBottom:"4px"}},t.find(e=>e.id===b)?.label||b),o("div",{style:{padding:"6px 14px",cursor:"pointer"},onClick:()=>{$(b),v(null)},role:"menuitem"},"About"))):null,U=S?t.find(e=>e.id===S):null,X=U?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:()=>$(null)},o("div",{style:{backgroundColor:"#2d2d2d",border:"1px solid #555",borderRadius:"8px",padding:"24px",minWidth:"280px",color:"#ffffff",textAlign:"center"},onClick:e=>e.stopPropagation()},o("div",{style:{fontSize:"18px",fontWeight:"600",marginBottom:"8px"}},U.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:()=>$(null)},"Close"))):null;return o("div",{className:"unity-desktop",style:N,"data-theme":c},o("div",{className:"unity-desktop__top-panel",style:{flexShrink:"0",zIndex:"10"}},T),o("div",{style:{display:"flex",flex:"1",overflow:"hidden"}},o("div",{className:"unity-desktop__dock",style:E},B),o("main",{className:"unity-desktop__desktop",style:{flex:"1",position:"relative",overflow:"hidden"}},Y,j)),O,X,q)}function ur(e){const{apps:t,user:n,onAppOpen:r,onLogout:i,theme:l="dark",children:a}=e;return o(no,{onWindowOpen:r},o(fr,{apps:t,user:n,onAppOpen:r,onLogout:i,theme:l,children:a}))}function pr(e){const{id:t,title:n,icon:r,defaultPosition:i,defaultSize:l,minSize:a,resizable:c=!0,onClose:f,children:u}=e,p=oo(),h=d(()=>p.windows.find(e=>e.id===t),[p.windows,t]);if(!h)return p.openWindow({id:t,title:n,icon:r,position:i,size:l}),null;const g=s(()=>{p.closeWindow(t),f&&f()},[p,t,f]),x=s(()=>{p.focusWindow(t)},[p,t]),m=s(e=>{p.moveWindow(t,e)},[p,t]),y=s(e=>{p.resizeWindow(t,e)},[p,t]),b=s(()=>{p.minimizeWindow(t)},[p,t]),v=s(()=>{h&&"maximized"===h.windowState?p.restoreWindow(t):p.maximizeWindow(t)},[p,t,h]);return o(Co,{id:t,title:n,icon:r,defaultPosition:h.position,defaultSize:h.size,minSize:a,resizable:c,windowState:h.windowState,focused:h.focused,zIndex:h.zIndex,onClose:g,onFocus:x,onMove:m,onResize:y,onMinimize:b,onMaximize:v,children:u})}const hr={sm:{padding:"3px 10px",fontSize:"12px",borderRadius:"4px"},md:{padding:"6px 14px",fontSize:"13px",borderRadius:"6px"},lg:{padding:"8px 20px",fontSize:"15px",borderRadius:"6px"}},gr={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 xr(e){const{children:t,onClick:n,variant:r="secondary",size:i="md",disabled:l=!1,fullWidth:a=!1,type:s="button",className:c,style:f,ariaLabel:u,active:p=!1}=e,h=d(()=>{const e=hr[i]??hr.md,t=gr[r]??gr.secondary,n={padding:e.padding,fontSize:e.fontSize,borderRadius:e.borderRadius,border:`1px solid ${t.border}`,backgroundColor:p?"#3b82f6":t.bg,color:p?"white":t.color,cursor:l?"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:l?"0.5":"1"};return a&&(n.width="100%"),f&&Object.assign(n,f),n},[r,i,l,a,p,f]);return o("button",{type:s,onClick:l?void 0:n,disabled:l,className:c,style:h,"aria-label":u,"aria-pressed":p?"true":void 0},t)}const mr=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],yr=Math.PI/180;function br(e,t){const n=e.replace("#","");let o,r,i;return 3===n.length?(o=parseInt(n[0]+n[0],16),r=parseInt(n[1]+n[1],16),i=parseInt(n[2]+n[2],16)):(o=parseInt(n.substring(0,2),16),r=parseInt(n.substring(2,4),16),i=parseInt(n.substring(4,6),16)),o=isNaN(o)?0:o,r=isNaN(r)?0:r,i=isNaN(i)?0:i,`rgba(${o},${r},${i},${t})`}function vr(e,t){const n=e.replace("#","");let o,r,i;3===n.length?(o=parseInt(n[0]+n[0],16),r=parseInt(n[1]+n[1],16),i=parseInt(n[2]+n[2],16)):(o=parseInt(n.substring(0,2),16),r=parseInt(n.substring(2,4),16),i=parseInt(n.substring(4,6),16)),o=isNaN(o)?0:o,r=isNaN(r)?0:r,i=isNaN(i)?0:i;const l=e=>(e=>Math.max(0,Math.min(255,Math.round(e*t))))(e).toString(16).padStart(2,"0");return"#"+l(o)+l(r)+l(i)}function wr(e){const{layers:t,width:n=700,height:r=500,perspective:i=.5,rotateX:l=35,rotateY:a=45,rotateZ:c=0,showLabels:f=!0,showAxes:u=!0,layerSpacing:p=2,colorScale:h=mr,gridColor:g="#94a3b8",title:x}=e,m=d(()=>{let e=0,n=0,o=0;for(let r=0;r<t.length;r++){const i=t[r],l=i.data.length;l>e&&(e=l);for(let e=0;e<l;e++){const t=i.data[e].length;t>n&&(n=t);for(let n=0;n<t;n++){const t=Math.abs(i.data[e][n]??0);t>o&&(o=t)}}}return{maxRows:Math.max(e,1),maxCols:Math.max(n,1),maxHeight:o>0?o:1}},[t]),y=d(()=>{const e=m.maxHeight+(t.length-1)*p+m.maxHeight,o=Math.sqrt(m.maxCols*m.maxCols+m.maxRows*m.maxRows+e*e),i=.75*Math.min(n,r);return o>0?i/o:1},[m,t.length,p,n,r]),b=n/2,v=r/2,w=s((e,t,n)=>function(e,t,n,o,r,i,l,a,s,d){const c=Math.cos(o*yr),f=Math.sin(o*yr),u=Math.cos(r*yr),p=Math.sin(r*yr),h=Math.cos(i*yr),g=Math.sin(i*yr),x=e*h-t*g,m=e*g+t*h,y=x*p+m*u,b=y*f+n*c,v=1+.001*l*b;return{sx:a+(x*u-m*p)*d*v,sy:s-(y*c-n*f)*d*v,depth:b}}(e,t,n,l,a,c,i,b,v,y),[l,a,c,i,b,v,y]),k=s(()=>{if(!u)return[];const e=[];Math.max(m.maxCols,m.maxRows);const n=m.maxCols/2,r=m.maxRows/2,i=w(-n,-r,0),l=w(n,-r,0);e.push(o("line",{key:"axis-x",x1:String(i.sx),y1:String(i.sy),x2:String(l.sx),y2:String(l.sy),stroke:"#374151","stroke-width":"1.5"})),e.push(o("text",{key:"axis-x-label",x:String(l.sx+8),y:String(l.sy+4),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"X"));const a=w(-n,r,0);e.push(o("line",{key:"axis-y",x1:String(i.sx),y1:String(i.sy),x2:String(a.sx),y2:String(a.sy),stroke:"#374151","stroke-width":"1.5"})),e.push(o("text",{key:"axis-y-label",x:String(a.sx-12),y:String(a.sy+4),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Y"));const s=m.maxHeight+(t.length-1)*p,d=w(-n,-r,s);return e.push(o("line",{key:"axis-z",x1:String(i.sx),y1:String(i.sy),x2:String(d.sx),y2:String(d.sy),stroke:"#374151","stroke-width":"1.5"})),e.push(o("text",{key:"axis-z-label",x:String(d.sx-4),y:String(d.sy-8),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Z")),e},[u,m,t.length,p,w]),S=s(()=>{const e=[],n=m.maxCols/2,r=m.maxRows/2,i=[];for(let e=0;e<t.length;e++){const o=t[e],l=o.color??h[e%h.length],a=o.opacity??.7,s=e*p,d=o.data.length;for(let t=0;t<d-1;t++){const d=o.data[t],c=o.data[t+1],f=Math.min(d.length,c.length);for(let o=0;o<f-1;o++){const f=o-n,u=o+1-n,p=t-r,h=t+1-r,g=(d[o]??0)+s,x=(d[o+1]??0)+s,m=(c[o]??0)+s,y=(c[o+1]??0)+s,b=w(f,p,g),v=w(u,p,x),k=w(f,h,m),S=w(u,h,y),$=(b.depth+v.depth+k.depth+S.depth)/4,M=`${b.sx},${b.sy} ${v.sx},${v.sy} ${S.sx},${S.sy} ${k.sx},${k.sy}`;i.push({points:M,fill:br(l,a),stroke:vr(l,.7),strokeWidth:"0.5",depth:$,key:`quad-${e}-${t}-${o}`})}}if(1===d||d>0&&1===o.data[0].length)for(let t=0;t<d;t++){const d=o.data[t];for(let o=0;o<d.length;o++){const c=o-n,f=t-r,u=(d[o]??0)+s,p=w(c,f,u),h=3,g=`${p.sx},${p.sy-h} ${p.sx+h},${p.sy} ${p.sx},${p.sy+h} ${p.sx-h},${p.sy}`;i.push({points:g,fill:br(l,a),stroke:vr(l,.7),strokeWidth:"0.5",depth:p.depth,key:`point-${e}-${t}-${o}`})}}}i.sort((e,t)=>e.depth-t.depth);for(let t=0;t<i.length;t++){const n=i[t];e.push(o("polygon",{key:n.key,points:n.points,fill:n.fill,stroke:n.stroke,"stroke-width":n.strokeWidth,"stroke-linejoin":"round"}))}return e},[t,m,p,h,w]),$=s(()=>{const e=[],t=m.maxCols/2,n=m.maxRows/2;for(let r=0;r<=m.maxRows;r++){const i=r-n,l=w(-t,i,0),a=w(t,i,0);e.push(o("line",{key:`base-h-${r}`,x1:String(l.sx),y1:String(l.sy),x2:String(a.sx),y2:String(a.sy),stroke:g,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}for(let r=0;r<=m.maxCols;r++){const i=r-t,l=w(i,-n,0),a=w(i,n,0);e.push(o("line",{key:`base-v-${r}`,x1:String(l.sx),y1:String(l.sy),x2:String(a.sx),y2:String(a.sy),stroke:g,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}return e},[m,g,w]),M=s(()=>{if(!f)return[];const e=[],n=m.maxCols/2;m.maxRows;for(let r=0;r<t.length;r++){const i=t[r],l=r*p;let a=0,s=0;for(let e=0;e<i.data.length;e++){const t=i.data[e];for(let e=0;e<t.length;e++)a+=t[e]??0,s++}const d=w(n+1,0,(s>0?a/s:0)+l),c=i.color??h[r%h.length];e.push(o("text",{key:`layer-label-${r}`,x:String(d.sx+8),y:String(d.sy+4),"font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:c},i.label))}return e},[f,t,m,p,h,w]),z=s(()=>x?[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"},x)]:[],[x,n])(),C=$(),I=k(),A=S(),F=M(),R=0===t.length?[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":x??"3D layer visualization",style:{fontFamily:"sans-serif",maxWidth:"100%"}},...z,...R,...C,...I,...A,...F)}function kr(e){const{value:t,label:n,prefix:r="",suffix:i="",trend:l,trendLabel:a,sparkline:c,width:f=280,height:u=160,valueColor:p="currentColor",trendUpColor:h="#22c55e",trendDownColor:g="#ef4444",backgroundColor:x="#ffffff"}=e,m=d(()=>function(e){if("string"==typeof e)return e;if(!isFinite(e)||isNaN(e))return"--";const t=e.toString().split("."),n=t[0],o=t.length>1?"."+t[1]:"",r=n.startsWith("-"),i=r?n.slice(1):n;let l="";for(let e=0;e<i.length;e++)e>0&&(i.length-e)%3==0&&(l+=","),l+=i[e];return(r?"-":"")+l+o}(t),[t]),y=null!=l&&isFinite(l)&&!isNaN(l),b=null!=c&&c.length>1,v=null!=n&&n.length>0,w=y&&l>=0?h:g,k=v?.38*u:.45*u,S=Math.min(.15*f,48),$=.55*S,M=k+.4*S+8,z=v?M+22:k+.4*S+22,C=b?Math.min(.22*u,36):0,I=u-20-C,A=f-40,F=s(()=>[o("rect",{key:"bg",x:"0",y:"0",width:"100%",rx:"8",ry:"8",fill:x,stroke:"#e5e7eb","stroke-width":"1"})],[f,u,x]),R=s(()=>{const e=[],t=r+m+i;return e.push(o("text",{key:"value",x:String(f/2),y:String(k),"text-anchor":"middle","dominant-baseline":"central","font-size":String(S),"font-weight":"bold","font-family":"sans-serif",fill:p,"aria-label":`Value: ${t}`},r?o("tspan",{key:"prefix","font-size":String($),"font-weight":"normal"},r):null,m,i?o("tspan",{key:"suffix","font-size":String($),"font-weight":"normal"},i):null)),e},[f,k,S,$,m,r,i,p]),D=s(()=>v?[o("text",{key:"label",x:String(f/2),y:String(M),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},n)]:[],[v,f,M,n]),L=s(()=>{if(!y)return[];const e=[],t=l>=0,n=function(e){if(!isFinite(e)||isNaN(e))return"--";const t=Math.abs(e);return t<100&&t!==Math.floor(t)?t.toFixed(1):String(Math.round(t))}(l),r=(t?"+":"-")+n+(a?" "+a:""),i=f/2-40,s=z;if(t){const t=`${i},${s} ${i-4},${s+8} ${i+4},${s+8}`;e.push(o("polygon",{key:"trend-arrow",points:t,fill:w}))}else{const t=`${i},${s+8} ${i-4},${s} ${i+4},${s}`;e.push(o("polygon",{key:"trend-arrow",points:t,fill:w}))}return e.push(o("text",{key:"trend-text",x:String(i+8+4),y:String(s+5.6),"text-anchor":"start","font-size":"12","font-family":"sans-serif",fill:w,"aria-label":`Trend: ${r}`},r)),e},[y,l,a,w,f,z]),W=s(()=>{if(!b)return[];const e=[],t=c,n=[];for(const e of t)"number"==typeof e&&isFinite(e)&&!isNaN(e)&&n.push(e);if(n.length<2)return[];let r=1/0,i=-1/0;for(const e of n)e<r&&(r=e),e>i&&(i=e);r===i&&(r-=1,i+=1);const l=i-r,a=A/(n.length-1);let s="";for(let e=0;e<n.length;e++){const t=20+e*a,o=I+C-(n[e]-r)/l*C;s+=0===e?`M ${t} ${o}`:` L ${t} ${o}`}const d=s+` L ${20+(n.length-1)*a} ${I+C} L 20 ${I+C} Z`;return e.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"})))),e.push(o("path",{key:"spark-fill",d:d,fill:"url(#sparkGrad)"})),e.push(o("path",{key:"spark-line",d:s,fill:"none",stroke:"#3b82f6","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})),e},[b,c,A,I,C,20]),N=F(),E=R(),T=D(),B=L(),P=W();return o("svg",{width:"100%",viewBox:`0 0 ${f} ${u}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":`${r}${m}${i}${v?`, ${n}`:""}`,style:{fontFamily:"sans-serif"}},...N,...P,...E,...T,...B)}const Sr=Math.PI/180;function $r(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 Mr(e,t,n){const o=Math.sqrt(e*e+t*t+n*n);if(o<1e-10)return{theta:0,phi:0};const r=e/o,i=t/o,l=n/o,a=Math.acos(Math.max(-1,Math.min(1,l))),s=Math.atan2(i,r);return{theta:a,phi:s<0?s+2*Math.PI:s}}function zr(e,t,n){const{x:o,y:r,z:i}=$r(e),l=Math.cos(n),a=Math.sin(n);let s,d,c;return"x"===t?(s=o,d=r*l-i*a,c=r*a+i*l):"y"===t?(s=o*l+i*a,d=r,c=-o*a+i*l):(s=o*l-r*a,d=o*a+r*l,c=i),Mr(s,d,c)}function Cr(e,t){const n=t.angle??Math.PI;switch(t.gate){case"X":return zr(e,"x",Math.PI);case"Y":return zr(e,"y",Math.PI);case"Z":return zr(e,"z",Math.PI);case"H":{const{x:t,y:n,z:o}=$r(e);return Mr(o,-n,t)}case"S":return zr(e,"z",Math.PI/2);case"T":return zr(e,"z",Math.PI/4);case"Rx":return zr(e,"x",n);case"Ry":return zr(e,"y",n);case"Rz":return zr(e,"z",n)}}function Ir(e){const{state:t,gates:n,width:r=400,height:i=400,rotateY:d=-25,rotateX:f=15,zoom:u=1,interactive:p=!0,zoomable:h=!0,showVector:g=!0,showLabels:x=!0,showWireframe:m=!0,showTrail:y=!0,trailMaxPoints:b=200,trailColor:v="#ef4444",wireframeColor:w="#cbd5e1",vectorColor:k="#3b82f6",backgroundColor:S,sphereRadius:$=130,title:M,onStateChange:z}=e,[C,I]=l(t??{theta:0,phi:0}),[A,F]=l(d),[R,D]=l(f),[L,W]=l(u),N=c([]),E=c(!1),T=c(null),B=c(null);a(()=>{t&&I(t)},[t?.theta,t?.phi]);const P=c(0);a(()=>{if(!n||0===n.length)return;P.current=0;let e=0;const t=()=>{P.current>=n.length||(I(e=>{const t=Cr(e,n[P.current]);return P.current++,z&&z(t),t}),e=requestAnimationFrame(t))};return e=requestAnimationFrame(t),()=>cancelAnimationFrame(e)},[n]),a(()=>{const e=$r(C);N.current.push(e),N.current.length>b&&N.current.splice(0,N.current.length-b)},[C.theta,C.phi]);const _=$*L,H=r/2,Y=i/2,j=s((e,t,n)=>function(e,t,n,o,r,i,l,a){const s=Math.cos(o*Sr),d=Math.sin(o*Sr),c=Math.cos(r*Sr),f=Math.sin(r*Sr),u=-e*f+n*c;return{sx:i+(e*c+n*f)*a,sy:l-(t*s-u*d)*a,depth:t*d+u*s}}(e,t,n,R,A,H,Y,_),[R,A,H,Y,_]),q=s(e=>{if(!p)return;const t=e;E.current=!0,T.current={mx:t.clientX,my:t.clientY,rx:R,ry:A}},[p,R,A]),O=s(e=>{if(!E.current||!T.current)return;const t=e,n=T.current;F(n.ry+.5*(t.clientX-n.mx)),D(n.rx-.5*(t.clientY-n.my))},[]),U=s(()=>{E.current=!1},[]),X=s(e=>{if(!h)return;const t=e;t.preventDefault(),W(e=>Math.max(.5,Math.min(3,e*(t.deltaY>0?.95:1.05))))},[h]),V=[];if(S&&V.push(o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:S,rx:"6"})),M&&V.push(o("text",{key:"title",x:String(H),y:"24","text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},M)),m){const e=60,t=[];for(let n=0;n<=e;n++){const o=n/e*2*Math.PI,r=j(Math.cos(o),Math.sin(o),0);t.push(`${0===n?"M":"L"}${r.sx.toFixed(1)},${r.sy.toFixed(1)}`)}V.push(o("path",{key:"eq",d:t.join(" "),fill:"none",stroke:w,"stroke-width":"0.8",opacity:"0.5"}));const n=[];for(let t=0;t<=e;t++){const o=t/e*2*Math.PI,r=j(Math.cos(o),0,Math.sin(o));n.push(`${0===t?"M":"L"}${r.sx.toFixed(1)},${r.sy.toFixed(1)}`)}V.push(o("path",{key:"xz",d:n.join(" "),fill:"none",stroke:w,"stroke-width":"0.8",opacity:"0.4"}));const r=[];for(let t=0;t<=e;t++){const n=t/e*2*Math.PI,o=j(0,Math.cos(n),Math.sin(n));r.push(`${0===t?"M":"L"}${o.sx.toFixed(1)},${o.sy.toFixed(1)}`)}V.push(o("path",{key:"yz",d:r.join(" "),fill:"none",stroke:w,"stroke-width":"0.8",opacity:"0.4"}))}const G=[{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(const e of G){const t=j(1.15*e.dir[0],1.15*e.dir[1],1.15*e.dir[2]),n=j(1.15*-e.dir[0],1.15*-e.dir[1],1.15*-e.dir[2]);j(0,0,0),V.push(o("line",{key:`axis-${e.id}`,x1:String(n.sx),y1:String(n.sy),x2:String(t.sx),y2:String(t.sy),stroke:e.color,"stroke-width":"0.8",opacity:"0.4","stroke-dasharray":"3 3"}))}if(x){const e=[{text:"|0⟩",pos:[0,0,1.3]},{text:"|1⟩",pos:[0,0,-1.3]},{text:"|+⟩",pos:[1.3,0,0]},{text:"|-⟩",pos:[-1.3,0,0]},{text:"|+i⟩",pos:[0,1.3,0]},{text:"|-i⟩",pos:[0,-1.3,0]}];for(const t of e){const e=j(t.pos[0],t.pos[1],t.pos[2]);V.push(o("text",{key:`lbl-${t.text}`,x:String(e.sx),y:String(e.sy),"text-anchor":"middle","dominant-baseline":"central","font-size":"11","font-family":"serif",fill:"#475569",style:{pointerEvents:"none"}},t.text))}}if(y&&N.current.length>1){const e=N.current,t=[];for(let n=0;n<e.length;n++){const o=e[n],r=j(o.x,o.y,o.z);t.push(`${0===n?"M":"L"}${r.sx.toFixed(1)},${r.sy.toFixed(1)}`)}V.push(o("path",{key:"trail",d:t.join(" "),fill:"none",stroke:v,"stroke-width":"1.5",opacity:"0.5","stroke-linecap":"round","stroke-linejoin":"round"}))}if(g){const e=$r(C),t=j(0,0,0),n=j(e.x,e.y,e.z);V.push(o("line",{key:"vec-line",x1:String(t.sx),y1:String(t.sy),x2:String(n.sx),y2:String(n.sy),stroke:k,"stroke-width":"2.5","stroke-linecap":"round"})),V.push(o("circle",{key:"vec-point",cx:String(n.sx),cy:String(n.sy),r:"5",fill:k,stroke:"#fff","stroke-width":"1.5"}));const l=(180*C.theta/Math.PI).toFixed(0),a=(180*C.phi/Math.PI).toFixed(0);V.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"},`θ=${l}° φ=${a}°`))}return o("svg",{ref:B,width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":M??"Bloch sphere quantum state visualization",style:{fontFamily:"sans-serif",cursor:p?E.current?"grabbing":"grab":"default"},onMouseDown:p?q:void 0,onMouseMove:p?O:void 0,onMouseUp:p?U:void 0,onMouseLeave:p?U:void 0,onWheel:h?X:void 0},...V)}function Ar(e,t){if(0===e.length)return 0;if(1===e.length)return e[0];const n=t/100*(e.length-1),o=Math.floor(n),r=Math.ceil(n);if(o===r)return e[o];const i=n-o;return e[o]+i*(e[r]-e[o])}function Fr(e){const t=function(e){const t=[];for(let n=0;n<e.length;n++){const o=e[n];"number"==typeof o&&isFinite(o)&&!isNaN(o)&&t.push(o)}return t.sort((e,t)=>e-t),t}(e);if(0===t.length)return null;const n=Ar(t,25),o=Ar(t,50),r=Ar(t,75),i=r-n,l=n-1.5*i,a=r+1.5*i;let s=t[0];for(const e of t)if(e>=l){s=e;break}let d=t[t.length-1];for(let e=t.length-1;e>=0;e--)if(t[e]<=a){d=t[e];break}let c=0;for(const e of t)c+=e;const f=c/t.length,u=[];for(const e of t)(e<l||e>a)&&u.push(e);return{q1:n,median:o,q3:r,iqr:i,whiskerLow:s,whiskerHigh:d,mean:f,outliers:u,min:t[0],max:t[t.length-1]}}function Rr(e){const{data:t=[],width:n=600,height:r=400,orientation:i="vertical",showOutliers:l=!0,showMean:a=!1,whiskerColor:c="#374151",boxWidth:f=.6,showGrid:u=!0,title:p,padding:h=60}=e,g="vertical"===i,x=n-2*h,m=r-2*h,y=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],b=d(()=>{const e=[];for(const n of t)e.push(Fr(n.values));return e},[t]),v=d(()=>{let e=1/0,t=-1/0;for(const n of b){if(null===n)continue;const o=l&&n.outliers.length>0?Math.min(n.whiskerLow,n.outliers[0]):n.whiskerLow,r=l&&n.outliers.length>0?Math.max(n.whiskerHigh,n.outliers[n.outliers.length-1]):n.whiskerHigh;o<e&&(e=o),r>t&&(t=r)}isFinite(e)||(e=0,t=1);const n=t-e,o=n>0?.05*n:.5;return{min:e-o,max:t+o}},[b,l]),w=g?m:x,k=(g?x:m)/(t.length>0?t.length:1),S=k*Math.min(Math.max(f,.1),.95),$=s(e=>{const t=v.max-v.min;return 0===t?w/2:(e-v.min)/t*w},[v,w]),M=s(()=>{if(!u)return[];const e=[],t=function(e){if(e<=0)return 1;const t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),o=t/n;return o<=1.5?n:o<=3.5?2*n:o<=7.5?5*n:10*n}(v.max-v.min);for(let n=Math.ceil(v.min/t)*t;n<=v.max;n+=t){const t=$(n),r=String(Math.round(1e3*n)/1e3);if(g){const i=h+m-t;e.push(o("line",{key:`grid-${n}`,x1:String(h),y1:String(i),x2:String(h+x),y2:String(i),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),e.push(o("text",{key:`glabel-${n}`,x:String(h-6),y:String(i+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},r))}else{const i=h+t;e.push(o("line",{key:`grid-${n}`,x1:String(i),y1:String(h),x2:String(i),y2:String(h+m),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),e.push(o("text",{key:`glabel-${n}`,x:String(i),y:String(h+m+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},r))}}return e},[u,v,$,g,h,x,m]),z=s(()=>{const e=[];return e.push(o("line",{key:"axis-value",x1:String(h),y1:String(g?h:h+m),x2:String(h),y2:String(h+m),stroke:"#374151","stroke-width":"1.5"})),e.push(o("line",{key:"axis-category",x1:String(h),y1:String(h+m),x2:String(h+x),y2:String(h+m),stroke:"#374151","stroke-width":"1.5"})),e},[h,x,m,g]),C=s(()=>{const e=[];for(let n=0;n<t.length;n++){const r=b[n];if(null===r)continue;const i=t[n],s=i.color??y[n%y.length],d=k*n+k/2,f=S/2;if(g){const t=h+m-$(r.q1),u=h+m-$(r.q3),p=h+m-$(r.median),g=h+m-$(r.whiskerLow),x=h+m-$(r.whiskerHigh),y=h+d;e.push(o("line",{key:`wl-${n}`,x1:String(y),y1:String(t),x2:String(y),y2:String(g),stroke:c,"stroke-width":"1.5"})),e.push(o("line",{key:`wlc-${n}`,x1:String(y-.4*f),y1:String(g),x2:String(y+.4*f),y2:String(g),stroke:c,"stroke-width":"1.5"})),e.push(o("line",{key:`wh-${n}`,x1:String(y),y1:String(u),x2:String(y),y2:String(x),stroke:c,"stroke-width":"1.5"})),e.push(o("line",{key:`whc-${n}`,x1:String(y-.4*f),y1:String(x),x2:String(y+.4*f),y2:String(x),stroke:c,"stroke-width":"1.5"}));const b=Math.min(t,u),v=Math.abs(t-u);if(e.push(o("rect",{key:`box-${n}`,x:String(y-f),y:String(b),width:String(S),height:String(Math.max(v,1)),fill:s,stroke:c,"stroke-width":"1.5",opacity:"0.8","aria-label":`${i.label}: Q1=${r.q1.toFixed(1)}, median=${r.median.toFixed(1)}, Q3=${r.q3.toFixed(1)}`,role:"img"})),e.push(o("line",{key:`med-${n}`,x1:String(y-f),y1:String(p),x2:String(y+f),y2:String(p),stroke:"#fff","stroke-width":"2.5"})),a){const t=h+m-$(r.mean);e.push(o("circle",{key:`mean-${n}`,cx:String(y),cy:String(t),r:"3.5",fill:"#fff",stroke:c,"stroke-width":"1.5","aria-label":`Mean: ${r.mean.toFixed(1)}`}))}if(l)for(let t=0;t<r.outliers.length;t++){const i=h+m-$(r.outliers[t]);e.push(o("circle",{key:`out-${n}-${t}`,cx:String(y),cy:String(i),r:"3",fill:"none",stroke:c,"stroke-width":"1.5","aria-label":`Outlier: ${r.outliers[t]}`}))}e.push(o("text",{key:`cat-${n}`,x:String(y),y:String(h+m+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},i.label))}else{const t=h+$(r.q1),u=h+$(r.q3),p=h+$(r.median),g=h+$(r.whiskerLow),x=h+$(r.whiskerHigh),m=h+d;e.push(o("line",{key:`wl-${n}`,x1:String(t),y1:String(m),x2:String(g),y2:String(m),stroke:c,"stroke-width":"1.5"})),e.push(o("line",{key:`wlc-${n}`,x1:String(g),y1:String(m-.4*f),x2:String(g),y2:String(m+.4*f),stroke:c,"stroke-width":"1.5"})),e.push(o("line",{key:`wh-${n}`,x1:String(u),y1:String(m),x2:String(x),y2:String(m),stroke:c,"stroke-width":"1.5"})),e.push(o("line",{key:`whc-${n}`,x1:String(x),y1:String(m-.4*f),x2:String(x),y2:String(m+.4*f),stroke:c,"stroke-width":"1.5"}));const y=Math.min(t,u),b=Math.abs(u-t);if(e.push(o("rect",{key:`box-${n}`,x:String(y),y:String(m-f),width:String(Math.max(b,1)),height:String(S),fill:s,stroke:c,"stroke-width":"1.5",opacity:"0.8","aria-label":`${i.label}: Q1=${r.q1.toFixed(1)}, median=${r.median.toFixed(1)}, Q3=${r.q3.toFixed(1)}`,role:"img"})),e.push(o("line",{key:`med-${n}`,x1:String(p),y1:String(m-f),x2:String(p),y2:String(m+f),stroke:"#fff","stroke-width":"2.5"})),a){const t=h+$(r.mean);e.push(o("circle",{key:`mean-${n}`,cx:String(t),cy:String(m),r:"3.5",fill:"#fff",stroke:c,"stroke-width":"1.5","aria-label":`Mean: ${r.mean.toFixed(1)}`}))}if(l)for(let t=0;t<r.outliers.length;t++){const i=h+$(r.outliers[t]);e.push(o("circle",{key:`out-${n}-${t}`,cx:String(i),cy:String(m),r:"3",fill:"none",stroke:c,"stroke-width":"1.5","aria-label":`Outlier: ${r.outliers[t]}`}))}e.push(o("text",{key:`cat-${n}`,x:String(h-6),y:String(m+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},i.label))}}return e},[t,b,$,g,h,x,m,k,S,c,l,a,y]),I=s(()=>p?[o("text",{key:"title",x:String(n/2),y:String(h/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},p)]:[],[p,n,h]),A=M(),F=z(),R=C(),D=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??"Box plot",style:{fontFamily:"sans-serif"}},...D,...A,...F,...R)}function Dr(e){if(e<=0)return 1;const t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),o=t/n;return o<=1.5?n:o<=3.5?2*n:o<=7.5?5*n:10*n}function Lr(e,t,n){return e<t?t:e>n?n:e}function Wr(e){return"number"==typeof e&&isFinite(e)&&!isNaN(e)}function Nr(e){const{data:t=[],width:n=600,height:r=400,xLabel:i,yLabel:l,showGrid:a=!0,showAxes:c=!0,showLabels:f=!1,maxBubbleRadius:u=40,minBubbleRadius:p=4,defaultColor:h="#3b82f6",opacity:g=.7,title:x,padding:m=60}=e,y=d(()=>{const e=[];for(let n=0;n<t.length;n++){const o=t[n];Wr(o.x)&&Wr(o.y)&&Wr(o.r)&&e.push(o)}return e},[t]),b=n-2*m,v=r-2*m,w=d(()=>{if(0===y.length)return{xMin:0,xMax:1,yMin:0,yMax:1,rMin:0,rMax:1};let e=1/0,t=-1/0,n=1/0,o=-1/0,r=1/0,i=-1/0;for(const l of y)l.x<e&&(e=l.x),l.x>t&&(t=l.x),l.y<n&&(n=l.y),l.y>o&&(o=l.y),l.r<r&&(r=l.r),l.r>i&&(i=l.r);return e===t&&(e-=1,t+=1),n===o&&(n-=1,o+=1),r===i&&(r=0,i=i>0?i:1),{xMin:e,xMax:t,yMin:n,yMax:o,rMin:r,rMax:i}},[y]),k=s(e=>{const t=w.xMax-w.xMin;return m+(e-w.xMin)/t*b},[w,m,b]),S=s(e=>{const t=w.yMax-w.yMin;return m+v-(e-w.yMin)/t*v},[w,m,v]),$=s(e=>{const t=w.rMax-w.rMin;if(0===t)return(p+u)/2;const n=(e-w.rMin)/t;return p+n*(u-p)},[w,p,u]),M=s(()=>{if(!a)return[];const e=[],t=Dr(w.xMax-w.xMin);for(let n=Math.ceil(w.xMin/t)*t;n<=w.xMax;n+=t){const t=k(n);e.push(o("line",{key:`grid-x-${n}`,x1:String(t),y1:String(m),x2:String(t),y2:String(m+v),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),e.push(o("text",{key:`grid-xlabel-${n}`,x:String(t),y:String(m+v+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(1e3*n)/1e3)))}const n=Dr(w.yMax-w.yMin);for(let t=Math.ceil(w.yMin/n)*n;t<=w.yMax;t+=n){const n=S(t);e.push(o("line",{key:`grid-y-${t}`,x1:String(m),y1:String(n),x2:String(m+b),y2:String(n),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),e.push(o("text",{key:`grid-ylabel-${t}`,x:String(m-6),y:String(n+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(1e3*t)/1e3)))}return e},[a,w,k,S,m,b,v]),z=s(()=>{if(!c)return[];const e=[];return e.push(o("line",{key:"axis-y",x1:String(m),y1:String(m),x2:String(m),y2:String(m+v),stroke:"#374151","stroke-width":"1.5"})),e.push(o("line",{key:"axis-x",x1:String(m),y1:String(m+v),x2:String(m+b),y2:String(m+v),stroke:"#374151","stroke-width":"1.5"})),i&&e.push(o("text",{key:"x-label",x:String(m+b/2),y:String(m+v+40),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151"},i)),l&&e.push(o("text",{key:"y-label",x:String(m-40),y:String(m+v/2),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90, ${m-40}, ${m+v/2})`},l)),e},[c,m,b,v,i,l]),C=s(()=>{const e=[];for(let t=0;t<y.length;t++){const n=y[t],r=k(n.x),i=S(n.y),l=Lr($(n.r),p,u),a=n.color??h;e.push(o("circle",{key:`bubble-${t}`,cx:String(r),cy:String(i),r:String(l),fill:a,opacity:String(g),stroke:a,"stroke-width":"1","stroke-opacity":"0.8","aria-label":n.label??`Bubble at (${n.x}, ${n.y}) size ${n.r}`,role:"img"})),f&&n.label&&e.push(o("text",{key:`label-${t}`,x:String(r),y:String(i-l-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},n.label))}return e},[y,k,S,$,h,g,f,p,u]),I=s(()=>x?[o("text",{key:"title",x:String(n/2),y:String(m/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},x)]:[],[x,n,m]),A=M(),F=z(),R=C(),D=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":x??"Bubble chart",style:{fontFamily:"sans-serif"}},...D,...A,...F,...R)}const Er=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Tr=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function Br(e){const t=e.split("-");return 3!==t.length?new Date(NaN):new Date(parseInt(t[0],10),parseInt(t[1],10)-1,parseInt(t[2],10))}function Pr(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function _r(e){const t=e.replace("#",""),n=3===t.length?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,o=parseInt(n,16);return{r:o>>16&255,g:o>>8&255,b:255&o}}function Hr(e,t){if(0===t.length)return"#000000";if(1===t.length)return t[0];const n=Math.max(0,Math.min(1,e)),o=t.length-1,r=Math.min(Math.floor(n*o),o-1),i=n*o-r,l=_r(t[r]),a=_r(t[r+1]);return function(e,t,n){const o=e=>{const t=Math.max(0,Math.min(255,Math.round(e))).toString(16);return 1===t.length?"0"+t:t};return`#${o(e)}${o(t)}${o(n)}`}(l.r+(a.r-l.r)*i,l.g+(a.g-l.g)*i,l.b+(a.b-l.b)*i)}const Yr=["#9be9a8","#40c463","#30a14e","#216e39"];function jr(e){const{data:t=[],width:n=800,height:r=160,colorScale:i=Yr,cellSize:l=12,cellGap:a=2,showMonthLabels:c=!0,showDayLabels:f=!0,emptyColor:u="#ebedf0",title:p}=e,{dateMap:h,startDate:g,endDate:x,maxVal:m}=d(()=>{const e=new Map;let n=0,o=null,r=null;for(const i of t){const t=Br(i.date);if(isNaN(t.getTime()))continue;const l=Pr(t);e.set(l,(e.get(l)??0)+i.value);const a=e.get(l);a>n&&(n=a),(null===o||t<o)&&(o=t),(null===r||t>r)&&(r=t)}if(null===o||null===r){const e=new Date;o=new Date(e.getFullYear(),0,1),r=new Date(e.getFullYear(),11,31)}const i=new Date(o);i.setDate(i.getDate()-i.getDay());const l=new Date(r);return l.setDate(l.getDate()+(6-l.getDay())),{dateMap:e,startDate:i,endDate:l,maxVal:n>0?n:1}},[t]),y=f?30:0,b=c?16:0,v=p?28:0,w=y+10,k=v+b+4,S=s(()=>{const e=[],t=new Date(g);let n=0;for(;t<=x;){const r=t.getDay();0===r&&t>g&&n++;const s=Pr(t),d=h.get(s),c=void 0!==d&&d>0?Hr(d/m,i):u,f=w+n*(l+a),p=k+r*(l+a);e.push(o("rect",{key:`day-${s}`,x:String(f),y:String(p),width:String(l),height:String(l),rx:"2",ry:"2",fill:c,"aria-label":`${s}: ${d??0}`})),t.setDate(t.getDate()+1)}return e},[g,x,h,m,i,u,l,a,w,k]),$=s(()=>{if(!c)return[];const e=[],t=new Date(g);let n=0,r=-1;for(;t<=x;){const i=t.getDay();0===i&&t>g&&n++;const s=t.getMonth();if(s!==r&&0===i){r=s;const t=w+n*(l+a);e.push(o("text",{key:`month-${n}`,x:String(t),y:String(v+b-2),"font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},Er[s]))}t.setDate(t.getDate()+1)}return e},[c,g,x,l,a,w,v,b]),M=s(()=>{if(!f)return[];const e=[],t=[1,3,5];for(const n of t){const t=k+n*(l+a)+l/2;e.push(o("text",{key:`day-label-${n}`,x:String(y),y:String(t),"text-anchor":"end","dominant-baseline":"central","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},Tr[n]))}return e},[f,l,a,k,y]),z=s(()=>p?[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"},p)]:[],[p,n]);if(0===t.length)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??"Calendar heat map — 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."));const C=z(),I=$(),A=M(),F=S();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??"Calendar heat map",style:{fontFamily:"sans-serif"}},...C,...I,...A,...F)}const qr=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Or(e,t,n,o){const r=o-Math.PI/2;return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function Ur(e,t,n,o,r,i){const l=Or(e,t,n,r),a=Or(e,t,n,i),s=Or(e,t,o,r),d=Or(e,t,o,i),c=i-r>Math.PI?1:0;return[`M ${l.x} ${l.y}`,`A ${n} ${n} 0 ${c} 1 ${a.x} ${a.y}`,`L ${d.x} ${d.y}`,`A ${o} ${o} 0 ${c} 0 ${s.x} ${s.y}`,"Z"].join(" ")}function Xr(e,t,n,o,r,i,l){const a=Or(e,t,n,o),s=Or(e,t,n,r),d=Or(e,t,n,i),c=Or(e,t,n,l),f=l-i,u=r-o>Math.PI?1:0,p=f>Math.PI?1:0;return[`M ${a.x} ${a.y}`,`A ${n} ${n} 0 ${u} 1 ${s.x} ${s.y}`,`Q ${e} ${t} ${d.x} ${d.y}`,`A ${n} ${n} 0 ${p} 1 ${c.x} ${c.y}`,`Q ${e} ${t} ${a.x} ${a.y}`,"Z"].join(" ")}function Vr(e){const{matrix:t,labels:n,width:r=600,height:i=600,colors:l=qr,padAngle:a=.05,showLabels:c=!0,showValues:f=!1,ribbonOpacity:u=.5,innerRadiusRatio:p=.9,title:h}=e;if(!t||0===t.length||!n||0===n.length)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"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"));const g=r/2,x=i/2,m=Math.min(r,i)/2-40,y=m*Math.max(.5,Math.min(.99,p)),b=m+16,v=d(()=>function(e,t,n,o){const r=e.length;if(0===r)return{groups:[],chords:[]};const i=[];let l=0;for(let t=0;t<r;t++){let n=0;for(let o=0;o<r;o++){const r=e[t]?.[o]??0;n+=Math.max(0,r)}i.push(n),l+=n}if(0===l){const e=(2*Math.PI-r*o)/Math.max(r,1),i=[];let l=0;for(let a=0;a<r;a++)i.push({index:a,label:t[a]??`Group ${a}`,color:n[a%n.length],startAngle:l,endAngle:l+e,value:0}),l+=e+o;return{groups:i,chords:[]}}const a=2*Math.PI-r*o,s=[];let d=0;for(let e=0;e<r;e++){const r=i[e]/l*a;s.push({index:e,label:t[e]??`Group ${e}`,color:n[e%n.length],startAngle:d,endAngle:d+r,value:i[e]}),d+=r+o}const c=[];for(let e=0;e<r;e++)c.push(s[e].startAngle);const f=[];for(let t=0;t<r;t++)for(let n=t;n<r;n++){const o=Math.max(0,e[t]?.[n]??0),r=t===n?0:Math.max(0,e[n]?.[t]??0);if(0===o&&0===r)continue;const d=o+r,u=i[t]>0?o/l*a:0,p=c[t],h=p+u;c[t]=h;const g=i[n]>0?o/l*a:0,x=c[n],m=x+g;if(c[n]=m,t===n){o>0&&f.push({sourceIndex:t,targetIndex:n,sourceStartAngle:p,sourceEndAngle:h,targetStartAngle:x,targetEndAngle:m,value:o,color:s[t].color});continue}const y=i[n]>0?r/l*a:0,b=c[n]+y;c[n]=b;const v=i[t]>0?r/l*a:0,w=c[t]+v;c[t]=w,(o>0||r>0)&&f.push({sourceIndex:t,targetIndex:n,sourceStartAngle:p,sourceEndAngle:Math.max(h,p+.001),targetStartAngle:x,targetEndAngle:Math.max(m,x+.001),value:d,color:s[t].color})}return{groups:s,chords:f}}(t,n,l,a),[t,n,l,a]),w=s(()=>{const e=[];for(let t=0;t<v.groups.length;t++){const n=v.groups[t];if(n.endAngle-n.startAngle<.001)continue;const r=Ur(g,x,m,y,n.startAngle,n.endAngle);if(e.push(o("path",{key:`arc-${t}`,d:r,fill:n.color,stroke:"#fff","stroke-width":"1",role:"img","aria-label":`${n.label}: ${n.value}`})),c){const r=(n.startAngle+n.endAngle)/2,i=Or(g,x,b,r),l=((r-Math.PI/2)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)<Math.PI,a=l?"start":"end";let s=180*r/Math.PI-90;l||(s+=180);const d=f?`${n.label} (${n.value})`:n.label;e.push(o("text",{key:`label-${t}`,x:String(i.x),y:String(i.y),"text-anchor":a,"font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(${s}, ${i.x}, ${i.y})`,"dominant-baseline":"central","pointer-events":"none"},d))}}return e},[v,g,x,m,y,b,c,f]),k=s(()=>{const e=[];for(let t=0;t<v.chords.length;t++){const n=v.chords[t],r=Xr(g,x,y,n.sourceStartAngle,n.sourceEndAngle,n.targetStartAngle,n.targetEndAngle);e.push(o("path",{key:`ribbon-${t}`,d:r,fill:n.color,"fill-opacity":String(u),stroke:n.color,"stroke-width":"0.5","stroke-opacity":"0.3"}))}return e},[v,g,x,y,u]),S=s(()=>h?[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"},h)]:[],[h,r]),$=k(),M=w(),z=S();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Chord diagram",style:{fontFamily:"sans-serif"}},...z,...$,...M)}const Gr=["#3b82f6","#22c55e","#f59e0b","#8b5cf6","#ef4444","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Kr(e){const{data:t,width:n=800,height:r=500,orientation:i="horizontal",nodeWidth:l=120,nodeHeight:a=40,showValues:c=!0,showConnectors:f=!0,connectorColor:u="#94a3b8",colors:p=Gr,title:h,padding:g=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":h??"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"));const x="horizontal"===i,m=d(()=>function(e,t,n,o,r,i,l,a){const{flatNodes:s,maxDepth:d}=function(e){const t=[];let n=0;const o=[];o.push([e,0,null]);let r=0;for(;o.length>0;){const[e,i,l]=o.shift(),a=n++;r=Math.max(r,i);const s=e.children??[],d=[];for(let e=0;e<s.length;e++)d.push(n+o.length+e);t.push({id:a,node:e,depth:i,parentId:l,childIndices:d});for(let e=0;e<s.length;e++)o.push([s[e],i+1,a])}return{flatNodes:t,maxDepth:r}}(e);if(0===s.length)return[];const c=function(e){const t=e.length,n=new Array(t).fill(0);for(let o=t-1;o>=0;o--){const r=e[o];if(0===r.childIndices.length)n[o]=1;else{let e=0;for(const o of r.childIndices)o<t&&(e+=n[o]);n[o]=Math.max(e,1)}}return n}(s),f=t-2*i,u=n-2*i,p="horizontal"===l,h=d+1,g=p?h>1?(f-o)/d:0:h>1?(u-r)/d:0,x=new Array(s.length),m=c[0],y=p?u:f,b=m>0?y/m:y,v=new Array(s.length);v[0]=[0,m];const w=[0];let k=0;for(;k<w.length;){const e=w[k];k++;const t=s[e],[n,o]=v[e],r=(n+o)/2,l=i+t.depth*g,d=i+(r-.5)*b,f=p?l:d,u=p?d:l,h=t.node.color??a[t.depth%a.length];x[e]={id:t.id,label:t.node.label,value:void 0!==t.node.value?String(t.node.value):"",color:h,depth:t.depth,x:f,y:u,parentId:t.parentId,childCount:t.childIndices.length,subtreeLeafCount:c[e]};let m=n;for(const e of t.childIndices)if(e<s.length){const t=m+c[e];v[e]=[m,t],m=t,w.push(e)}}return x}(t,n,r,l,a,g,i,p),[t,n,r,l,a,g,i,p]),y=d(()=>{const e=new Map;for(let t=0;t<m.length;t++){const n=m[t];e.set(n.id,n)}return e},[m]),b=s(()=>{if(!f)return[];const e=[];for(let t=0;t<m.length;t++){const n=m[t];if(null===n.parentId)continue;const r=y.get(n.parentId);if(!r)continue;let i,s,d,c;x?(i=r.x+l,s=r.y+a/2,d=n.x,c=n.y+a/2):(i=r.x+l/2,s=r.y+a,d=n.x+l/2,c=n.y);const f=(i+d)/2,p=(s+c)/2;let h;h=x?`M ${i} ${s} C ${f} ${s}, ${f} ${c}, ${d} ${c}`:`M ${i} ${s} C ${i} ${p}, ${d} ${p}, ${d} ${c}`,e.push(o("path",{key:`conn-${t}`,d:h,fill:"none",stroke:u,"stroke-width":"1.5","stroke-opacity":"0.7"}))}return e},[m,y,x,l,a,f,u]),v=s(()=>{const e=[];for(let t=0;t<m.length;t++){const n=m[t];e.push(o("rect",{key:`node-rect-${n.id}`,x:String(n.x),y:String(n.y),width:String(l),height:String(a),rx:"4",ry:"4",fill:n.color,stroke:"#374151","stroke-width":"1",role:"img","aria-label":n.value?`${n.label}: ${n.value}`:n.label}));const r=c&&n.value?n.y+a/2-2:n.y+a/2+4;e.push(o("text",{key:`node-label-${n.id}`,x:String(n.x+l/2),y:String(r),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#fff","pointer-events":"none"},n.label)),c&&n.value&&e.push(o("text",{key:`node-value-${n.id}`,x:String(n.x+l/2),y:String(n.y+a/2+12),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.85)","pointer-events":"none"},n.value))}return e},[m,l,a,c]),w=s(()=>h?[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"},h)]:[],[h,n]),k=b(),S=v(),$=w();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??"Decomposition tree",style:{fontFamily:"sans-serif"}},...$,...k,...S)}const Zr=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Jr(e){return Zr[e%Zr.length]}function Qr(e,t,n){const o=t/2,r=n/2,i=.3*Math.min(t,n),l=e.length,a=[];for(let t=0;t<l;t++){const n=e[t],s=2*Math.PI*t/Math.max(l,1);a.push({id:n.id,label:n.label??n.id,color:n.color??Jr(t),x:n.x??o+i*Math.cos(s),y:n.y??r+i*Math.sin(s),vx:0,vy:0,fixed:n.fixed??!1,solid:n.solid??!0})}return a}function ei(e,t){const n=2*t;for(let t=0;t<e.length;t++){const o=e[t];if(o.solid)for(let r=t+1;r<e.length;r++){const t=e[r];if(!t.solid)continue;const i=t.x-o.x,l=t.y-o.y,a=i*i+l*l;if(a>=n*n||a<1e-4)continue;const s=Math.sqrt(a),d=i/s,c=l/s,f=n-s;if(o.fixed&&t.fixed)continue;o.fixed?(t.x+=d*f,t.y+=c*f):t.fixed?(o.x-=d*f,o.y-=c*f):(o.x-=d*f*.5,o.y-=c*f*.5,t.x+=d*f*.5,t.y+=c*f*.5);const u=(o.vx-t.vx)*d+(o.vy-t.vy)*c;u<=0||(o.fixed?(t.vx+=u*d,t.vy+=u*c):t.fixed?(o.vx-=u*d,o.vy-=u*c):(o.vx-=u*d,o.vy-=u*c,t.vx+=u*d,t.vy+=u*c))}}}function ti(e){const{nodes:t,edges:n,width:r=600,height:i=400,nodeRadius:f=12,nodeStrokeWidth:u=2,solidNodes:p=!0,showLabels:h=!0,showArrows:g=!1,repulsionForce:x=300,attractionForce:m=.01,damping:y=.9,edgeLength:b=100,edgeColor:v="#94a3b8",edgeWidth:w=1.5,title:k,customForce:S,trails:$}=e;if(!t||0===t.length)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":k??"Empty force-directed graph"},k?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"},k):o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));const M=c(Qr(t,r,i)),[z,C]=l(0),I=c(!0),A=c(!1),F=c(n);F.current=n;const R=c(S);R.current=S;const D=c(null),L=c({repulsionForce:x,attractionForce:m,damping:y,edgeLength:b,width:r,height:i,nodeRadius:f,solidNodes:p});L.current={repulsionForce:x,attractionForce:m,damping:y,edgeLength:b,width:r,height:i,nodeRadius:f,solidNodes:p};const W=c(new Map);a(()=>{M.current=Qr(t,r,i),A.current=!1,I.current=!0,W.current=new Map,C(e=>e+1)},[t.length]),a(()=>{let e=0;const t=()=>{if(!I.current)return;const n=L.current,o=R.current;let r;if(o?(r=o(M.current,F.current,n.width,n.height,D.current),n.solidNodes&&ei(r,n.nodeRadius)):r=function(e,t,n,o,r,i,l,a,s=12){const d=e.length;if(0===d)return e;const c=new Map;for(let t=0;t<d;t++)c.set(e[t].id,t);const f=new Float64Array(d),u=new Float64Array(d);for(let t=0;t<d;t++){const n=e[t];for(let o=t+1;o<d;o++){const i=e[o];let l=n.x-i.x,a=n.y-i.y,s=l*l+a*a;s<1&&(s=1);const d=Math.sqrt(s),c=r/s,p=l/d*c,h=a/d*c;f[t]+=p,u[t]+=h,f[o]-=p,u[o]-=h}}for(let n=0;n<t.length;n++){const o=t[n],r=c.get(o.source),l=c.get(o.target);if(void 0===r||void 0===l)continue;const s=e[r],d=e[l],p=d.x-s.x,h=d.y-s.y,g=Math.sqrt(p*p+h*h);if(g<.1)continue;const x=i*(g-a)*(o.weight??1),m=p/g*x,y=h/g*x;f[r]+=m,u[r]+=y,f[l]-=m,u[l]-=y}const p=n/2,h=o/2;for(let t=0;t<d;t++){const n=e[t];f[t]+=.001*(p-n.x),u[t]+=.001*(h-n.y)}const g=[];for(let t=0;t<d;t++){const r=e[t];if(r.fixed){g.push({...r,vx:0,vy:0});continue}let i=(r.vx+f[t])*l,a=(r.vy+u[t])*l;const s=Math.sqrt(i*i+a*a),d=10;s>d&&(i=i/s*d,a=a/s*d);let c=r.x+i,p=r.y+a;c=Math.max(20,Math.min(n-20,c)),p=Math.max(20,Math.min(o-20,p)),g.push({...r,x:c,y:p,vx:i,vy:a})}return ei(g,s),g}(M.current,F.current,n.width,n.height,n.repulsionForce,n.attractionForce,n.damping,n.edgeLength,n.nodeRadius),M.current=r,$)for(let e=0;e<$.length;e++){const t=$[e],n=r.find(e=>e.id===t.nodeId);if(!n)continue;let o=W.current.get(t.nodeId);o||(o=[],W.current.set(t.nodeId,o)),o.push({x:n.x,y:n.y});const i=t.maxPoints??200;o.length>i&&o.splice(0,o.length-i)}if(!o&&function(e){let t=0;for(let n=0;n<e.length;n++){const o=e[n];t+=o.vx*o.vx+o.vy*o.vy}return t}(r)<.01)return A.current=!0,void C(e=>e+1);C(e=>e+1),e=requestAnimationFrame(t)};return e=requestAnimationFrame(t),()=>{I.current=!1,cancelAnimationFrame(e)}},[]);const N=M.current,E=s(e=>{M.current=M.current.map(t=>t.id===e?{...t,fixed:!t.fixed,vx:0,vy:0}:t),A.current&&(A.current=!1,I.current=!0,C(e=>e+1))},[]),T=c(null),B=c(null),P=s(e=>{const t=e,n=B.current;if(!n)return{x:t.clientX,y:t.clientY};const o=n.getBoundingClientRect(),l=r/o.width,a=i/o.height;return{x:(t.clientX-o.left)*l,y:(t.clientY-o.top)*a}},[r,i]),_=c(!1),H=s((e,t)=>{t.stopPropagation(),T.current=e;const n=M.current.find(t=>t.id===e);_.current=n?.fixed??!1,M.current=M.current.map(t=>t.id===e?{...t,fixed:!0,vx:0,vy:0}:t)},[]),Y=s(e=>{const t=P(e);if(D.current={x:t.x,y:t.y},!T.current)return;const n=T.current;M.current=M.current.map(e=>e.id===n?{...e,x:Math.max(20,Math.min(r-20,t.x)),y:Math.max(20,Math.min(i-20,t.y))}:e),A.current&&(A.current=!1,I.current=!0),C(e=>e+1)},[r,i,P]),j=s(()=>{const e=T.current;e&&(M.current=M.current.map(t=>t.id===e?{...t,fixed:_.current}:t)),T.current=null},[]),q=s(()=>{T.current=null,D.current=null},[]),O=d(()=>{const e=new Map;for(let t=0;t<N.length;t++)e.set(N[t].id,N[t]);return e},[z]),U=s(()=>g?[o("defs",{key:"arrow-defs"},o("marker",{key:"arrowhead",id:"arrowhead",markerWidth:"10",markerHeight:"7",refX:String(10+f),refY:"3.5",orient:"auto",markerUnits:"userSpaceOnUse"},o("polygon",{key:"arrow-poly",points:"0 0, 10 3.5, 0 7",fill:v})))]:[],[g,f,v]),X=s(()=>{const e=[];for(let t=0;t<n.length;t++){const r=n[t],i=O.get(r.source),l=O.get(r.target);if(!i||!l)continue;if(void 0!==r.weight&&r.weight<=0)continue;const a=r.weight?Math.max(.5,Math.min(6,w*r.weight)):w,s={key:`edge-${t}`,x1:String(i.x),y1:String(i.y),x2:String(l.x),y2:String(l.y),stroke:r.color??v,"stroke-width":String(a),"stroke-opacity":"0.6"};g&&(s["marker-end"]="url(#arrowhead)"),e.push(o("line",s))}return e},[z,v,w,g]),V=s(()=>{const e=[];for(let t=0;t<N.length;t++){const n=N[t];e.push(o("circle",{key:`node-${n.id}`,cx:String(n.x),cy:String(n.y),r:String(f),fill:n.color,stroke:n.fixed?"#0f172a":"#fff","stroke-width":n.fixed?"3":String(u),style:{cursor:T.current===n.id?"grabbing":"grab"},onMouseDown:e=>H(n.id,e),onDblClick:()=>E(n.id),role:"button",tabIndex:0,"aria-label":`Node: ${n.label}${n.fixed?" (locked)":""} — drag to move, double-click to lock`})),h&&e.push(o("text",{key:`label-${n.id}`,x:String(n.x),y:String(n.y+f+14),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},n.label))}return e},[z,f,h,E]),G=s(()=>k?[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"},k)]:[],[k,r]),K=s(()=>{if(!$||0===$.length)return[];const e=[];for(let t=0;t<$.length;t++){const n=$[t],r=W.current.get(n.nodeId);if(!r||r.length<2)continue;const i=[];for(let e=0;e<r.length;e++){const t=r[e];i.push(`${0===e?"M":"L"}${t.x.toFixed(1)},${t.y.toFixed(1)}`)}e.push(o("path",{key:`trail-${n.nodeId}`,d:i.join(" "),fill:"none",stroke:n.color??"#3b82f6","stroke-width":String(n.width??1),opacity:String(n.opacity??.5),"stroke-linecap":"round","stroke-linejoin":"round"}))}return e},[z,$]),Z=U(),J=K(),Q=X(),ee=V(),te=G();return o("svg",{ref:B,width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":k??"Force-directed graph — drag nodes to move, double-click to lock",style:{fontFamily:"sans-serif",cursor:T.current?"grabbing":"default"},onMouseMove:Y,onMouseUp:j,onMouseLeave:q},...Z,...te,...J,...Q,...ee)}const ni=["#3b82f6","#6366f1","#8b5cf6","#a855f7","#c084fc","#d8b4fe","#e9d5ff","#f3e8ff"];function oi(e){const{data:t=[],width:n=600,height:r=400,orientation:i="vertical",showLabels:l=!0,showValues:a=!0,showPercentage:c=!0,gapSize:f=2,colors:u=ni,title:p}=e,h="vertical"===i,g=p?30:0,x=d(()=>{let e=0;for(let n=0;n<t.length;n++)t[n].value>e&&(e=t[n].value);return e>0?e:1},[t]),m=s(e=>0===x?0:Math.max(.05,e/x),[x]),y=s((e,t)=>t||(u[e%u.length]??ni[0]),[u]),b=s(()=>{if(0===t.length)return[];const e=[],i=n-80-120,s=r-g-80,d=f*(t.length-1),u=Math.max(1,(s-d)/t.length),p=40+i/2;for(let n=0;n<t.length;n++){const r=t[n],s=n<t.length-1?t[n+1]:null,d=y(n,r.color),h=m(r.value),x=i/2*h,b=i/2*(null!==s?m(s.value):.6*h),v=g+40+n*(u+f),w=`${p-x},${v} ${p+x},${v} ${p+b},${v+u} ${p-b},${v+u}`;e.push(o("polygon",{key:`section-${n}`,points:w,fill:d,stroke:"#fff","stroke-width":"1"}));const k=40+i+12,S=v+u/2;if(l&&e.push(o("text",{key:`label-${n}`,x:String(k),y:String(S-(a||c?6:0)),"text-anchor":"start","font-size":"12","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},r.label)),a||c){let i="";if(a&&(i=String(r.value)),c&&t.length>0){const e=t[0].value,n=e>0?Math.round(r.value/e*100):0;i+=a?` (${n}%)`:`${n}%`}e.push(o("text",{key:`value-${n}`,x:String(k),y:String(S+(l?10:4)),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},i))}}return e},[t,n,r,g,f,l,a,c,y,m,120]),v=s(()=>{if(0===t.length)return[];const e=[],i=n-80,s=r-g-80-40,d=f*(t.length-1),u=Math.max(1,(i-d)/t.length),p=g+40+s/2;for(let n=0;n<t.length;n++){const r=t[n],i=n<t.length-1?t[n+1]:null,d=y(n,r.color),h=m(r.value),x=s/2*h,b=s/2*(null!==i?m(i.value):.6*h),v=40+n*(u+f),w=`${v},${p-x} ${v+u},${p-b} ${v+u},${p+b} ${v},${p+x}`;e.push(o("polygon",{key:`section-${n}`,points:w,fill:d,stroke:"#fff","stroke-width":"1"}));const k=v+u/2,S=g+40+s+14;if(l&&e.push(o("text",{key:`label-${n}`,x:String(k),y:String(S),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},r.label)),a||c){let i="";if(a&&(i=String(r.value)),c&&t.length>0){const e=t[0].value,n=e>0?Math.round(r.value/e*100):0;i+=a?` (${n}%)`:`${n}%`}e.push(o("text",{key:`value-${n}`,x:String(k),y:String(S+14),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#6b7280"},i))}}return e},[t,n,r,g,f,l,a,c,y,m]),w=s(()=>p?[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"},p)]:[],[p,n]),k=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]),S=w(),$=h?b():v(),M=k();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??"Funnel chart",style:{fontFamily:"sans-serif"}},...S,...$,...M)}const ri=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function ii(e){if(e<=0)return 1;const t=e/6,n=Math.pow(10,Math.floor(Math.log10(t))),o=t/n;return o<=1.5?n:o<=3.5?2*n:o<=7.5?5*n:10*n}function li(e,t){return t||ri[e%ri.length]}function ai(e){const{tasks:t=[],width:n=800,height:r,barHeight:i=24,barGap:l=8,showGrid:a=!0,showLabels:c=!0,showProgress:f=!1,timeUnit:u="days",title:p,padding:h=50}=e;if(0===t.length)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":p??"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"));const g=c?120:0,x=d(()=>{let e=1/0,n=-1/0;for(const o of t){o.start<e&&(e=o.start);const t=o.start+o.duration;t>n&&(n=t)}return e===1/0&&(e=0,n=1),{min:e,max:n,range:n-e}},[t]),m=d(()=>{const e=t.slice();return e.sort((e,t)=>e.group!==t.group?(e.group??"").localeCompare(t.group??""):e.start-t.start),e},[t]),y=r??2*h+m.length*(i+l)+l+20,b=n-h-g-h,v=h+(p?20:0),w=s(e=>0===x.range?g+h:g+h+(e-x.min)/x.range*b,[x,b,g,h]),k=s(()=>{if(!a)return[];const e=[],t=ii(x.range),n=Math.ceil(x.min/t)*t,r=v+m.length*(i+l)+l;for(let i=n;i<=x.max;i+=t){const t=w(i);e.push(o("line",{key:`grid-${i}`,x1:String(t),y1:String(v),x2:String(t),y2:String(r),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"}))}return e},[a,x,v,m.length,i,l,w]),S=s(()=>{const e=[],t=ii(x.range),r=Math.ceil(x.min/t)*t,i=v-8;for(let n=r;n<=x.max;n+=t){const t=w(n);e.push(o("text",{key:`taxis-${n}`,x:String(t),y:String(i),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},String(n)))}return e.push(o("text",{key:"time-unit",x:String(n-h),y:String(i),"text-anchor":"end","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.4","font-style":"italic"},u)),e},[x,v,w,u,n,h]),$=s(()=>{const e=[];let t="";for(let n=0;n<m.length;n++){const r=m[n],a=v+n*(i+l)+l,s=w(r.start),d=Math.max(2,w(r.start+r.duration)-s),u=li(n,r.color);r.group&&r.group!==t&&(t=r.group,c&&e.push(o("text",{key:`group-${n}`,x:String(h),y:String(a+i/2-12),"font-size":"9","font-family":"sans-serif","font-weight":"bold",fill:"currentColor",opacity:"0.4","text-transform":"uppercase"},r.group))),e.push(o("rect",{key:`bar-${r.id}`,x:String(s),y:String(a),width:String(d),height:String(i),rx:"4",ry:"4",fill:u,role:"graphics-symbol","aria-label":`${r.label}: start ${r.start}, duration ${r.duration}`})),c&&e.push(o("text",{key:`label-${r.id}`,x:String(g+h-8),y:String(a+i/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"currentColor"},r.label.length>16?r.label.substring(0,14)+"..":r.label)),f&&d>30&&e.push(o("text",{key:`prog-${r.id}`,x:String(s+d/2),y:String(a+i/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#ffffff"},`${r.start}-${r.start+r.duration}`))}return e},[m,v,i,l,w,c,f,g,h]),M=s(()=>p?[o("text",{key:"title",x:String(n/2),y:String(h/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},p)]:[],[p,n,h]),z=k(),C=S(),I=$(),A=M();return o("svg",{width:"100%",height:String(y),viewBox:`0 0 ${n} ${y}`,xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Gantt chart",style:{fontFamily:"sans-serif"}},...A,...z,...C,...I)}const si=Math.PI/180;function di(e,t,n,o){const r=o*si;return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function ci(e,t,n,o,r){const i=di(e,t,n,r),l=di(e,t,n,o),a=r-o,s=Math.abs(a)>180?1:0,d=a>0?1:0;return`M ${i.x} ${i.y} A ${n} ${n} 0 ${s} ${1===d?0:1} ${l.x} ${l.y}`}function fi(e){return!isFinite(e)||isNaN(e)?"--":Math.abs(e)>=1e3?Math.round(e).toString():e===Math.floor(e)?e.toString():e.toFixed(1)}function ui(e){const{value:t,min:n=0,max:r=100,width:i=300,height:l=200,startAngle:a=-135,endAngle:d=135,arcWidth:c=20,showValue:f=!0,showMinMax:u=!0,showTicks:p=!0,tickCount:h=10,label:g,unit:x,colors:m=["#22c55e","#f59e0b","#ef4444"],needleColor:y="#374151",backgroundColor:b="#e5e7eb"}=e,v=isFinite(n)&&!isNaN(n)?n:0,w=isFinite(r)&&!isNaN(r)&&r>v?r:v+100,k=isFinite(t)&&!isNaN(t)?function(e,t,n){return e<t?t:e>n?n:e}(t,v,w):v,S=(f?24:0)+(g?18:0),$=i/2,M=.6*(l-S),z=Math.min(i/2,.55*(l-S))-c/2-10,C=z-c,I=z-c/2,A=d-a,F=s(e=>{const t=w-v;return 0===t?a:a+(e-v)/t*A},[v,w,a,A]),R=s(()=>[o("path",{key:"bg-arc",d:ci($,M,I,a,d),fill:"none",stroke:b,"stroke-width":String(c),"stroke-linecap":"round"})],[$,M,I,a,d,b,c]),D=s(()=>{if(0===m.length)return[];const e=[],t=A/m.length;for(let n=0;n<m.length;n++){const r=a+n*t,i=ci($,M,I,r,r+t);e.push(o("path",{key:`seg-${n}`,d:i,fill:"none",stroke:m[n],"stroke-width":String(c),"stroke-linecap":0===n||n===m.length-1?"round":"butt",opacity:"0.85"}))}return e},[m,A,a,$,M,I,c]),L=s(()=>{if(!p||h<=0)return[];const e=[],t=Math.max(1,Math.min(h,100));for(let n=0;n<=t;n++){const r=n/t,i=a+r*A,l=n%2==0,s=l?10:6,d=di($,M,z+4,i),c=di($,M,z+4+s,i);if(e.push(o("line",{key:`tick-${n}`,x1:String(d.x),y1:String(d.y),x2:String(c.x),y2:String(c.y),stroke:"currentColor",opacity:"0.4","stroke-width":l?"2":"1"})),l){const t=v+r*(w-v),l=di($,M,z+4+s+12,i);e.push(o("text",{key:`tick-label-${n}`,x:String(l.x),y:String(l.y+3),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},fi(t)))}}return e},[p,h,a,A,$,M,z,v,w]),W=s(()=>{const e=[],t=F(k),n=di($,M,C-8,t),r=t-90,i=di($,M,6,t+90),l=di($,M,6,r);return e.push(o("polygon",{key:"needle",points:`${n.x},${n.y} ${i.x},${i.y} ${l.x},${l.y}`,fill:y,stroke:"none"})),e.push(o("circle",{key:"needle-cap",cx:String($),cy:String(M),r:"8",fill:y,stroke:"#fff","stroke-width":"2"})),e},[k,F,$,M,C,y]),N=s(()=>{if(!f)return[];const e=[],t=fi(k),n=t+(x?" "+x:""),r=M+I+20;return e.push(o("text",{key:"value-text",x:String($),y:String(r),"text-anchor":"middle","font-size":"22","font-weight":"bold","font-family":"sans-serif",fill:"currentColor","aria-label":`Value: ${n}`},t,x?o("tspan",{key:"unit","font-size":"14","font-weight":"normal",opacity:"0.6",fill:"currentColor"}," "+x):null)),e},[f,k,x,$,M,I]),E=s(()=>{if(!g)return[];const e=M+I+(f?40:20);return[o("text",{key:"label",x:String($),y:String(e),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},g)]},[g,$,M,I,f]),T=s(()=>{if(!u)return[];const e=[],t=di($,M,I,a),n=di($,M,I,d);return e.push(o("text",{key:"min-label",x:String(t.x-4),y:String(t.y+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},fi(v))),e.push(o("text",{key:"max-label",x:String(n.x+4),y:String(n.y+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},fi(w))),e},[u,$,M,I,a,d,v,w]),B=R(),P=D(),_=L(),H=W(),Y=N(),j=E(),q=T(),O=`Gauge: ${fi(k)}${x?" "+x:""}, range ${fi(v)} to ${fi(w)}${g?", "+g:""}`;return o("svg",{width:"100%",viewBox:`0 0 ${i} ${l}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"meter","aria-valuenow":String(k),"aria-valuemin":String(v),"aria-valuemax":String(w),"aria-label":O,style:{fontFamily:"sans-serif"}},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,-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 hi(e){const{width:t=959,height:n=593,stateColors:r={},defaultColor:i="#D0D0D0",strokeColor:l="#FFFFFF",strokeWidth:a=1,onStateClick:c,onStateHover:f,hoverColor:u="#FFD700",title:p="Map of the United States"}=e,h=d(()=>Object.keys(pi),[]),g=s(e=>{c&&c(e)},[c]),x=s((e,t)=>{const n=t.currentTarget;n&&n.setAttribute("fill",u),f&&f(e)},[f,u]),m=s((e,t)=>{const n=t.currentTarget;if(n){const t=r[e]??i;n.setAttribute("fill",t)}f&&f(null)},[f,r,i]),y=d(()=>{const e=[];for(let t=0;t<h.length;t++){const n=h[t],s=pi[n],d=r[n]??i,f={key:`state-${n}`,d:s.path,fill:d,stroke:l,"stroke-width":String(a),"stroke-linejoin":"round","data-state":n,role:"img","aria-label":s.name,style:{cursor:c?"pointer":"default"}};if(c){const e=n;f.onClick=()=>g(e),f.onKeyDown=t=>{"Enter"!==t.key&&" "!==t.key||g(e)},f.tabindex=0,f.role="button",f["aria-label"]=s.name}const u=n;f.onMouseOver=e=>x(u,e),f.onMouseOut=e=>m(u,e),e.push(o("path",f))}return e},[h,r,i,l,a,c,g,x,m]),b=o("title",{key:"map-title"},p);return o("svg",{width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p,style:{fontFamily:"sans-serif"}},b,...y)}function gi(e){const t=e.replace("#",""),n=3===t.length?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,o=parseInt(n,16);return{r:o>>16&255,g:o>>8&255,b:255&o}}function xi(e,t){if(0===t.length)return"#000000";if(1===t.length)return t[0];const n=Math.max(0,Math.min(1,e)),o=t.length-1,r=Math.min(Math.floor(n*o),o-1),i=n*o-r,l=gi(t[r]),a=gi(t[r+1]);return function(e,t,n){const o=e=>{const t=Math.max(0,Math.min(255,Math.round(e))).toString(16);return 1===t.length?"0"+t:t};return`#${o(e)}${o(t)}${o(n)}`}(l.r+(a.r-l.r)*i,l.g+(a.g-l.g)*i,l.b+(a.b-l.b)*i)}function mi(e){const{r:t,g:n,b:o}=gi(e);return(.299*t+.587*n+.114*o)/255}const yi=["#3b82f6","#fbbf24","#ef4444"];function bi(e){const{data:t=[],rowLabels:n,columnLabels:r,width:i=600,height:l=400,colorScale:a=yi,minValue:c,maxValue:f,showValues:u=!1,cellBorderColor:p="#fff",cellBorderWidth:h=1,title:g,padding:x=60}=e,m=t.length,y=d(()=>{let e=0;for(const n of t)n.length>e&&(e=n.length);return e},[t]),{minVal:b,maxVal:v}=d(()=>{let e=c??1/0,n=f??-1/0;for(const o of t)for(const t of o)void 0===c&&t<e&&(e=t),void 0===f&&t>n&&(n=t);return e===1/0&&(e=0),n===-1/0&&(n=1),e===n&&(n=e+1),{minVal:e,maxVal:n}},[t,c,f]),w=g?30:0,k=n?x:20,S=y>0?(i-k-20)/y:0,$=m>0?(l-w-(r?x:20)-20)/m:0,M=s(()=>{const e=[];for(let n=0;n<m;n++){const r=t[n];for(let t=0;t<y;t++){const i=t<r.length?r[t]:0,l=xi((i-b)/(v-b),a),s=k+t*S,d=w+20+n*$;if(e.push(o("rect",{key:`cell-${n}-${t}`,x:String(s),y:String(d),width:String(S),height:String($),fill:l,stroke:p,"stroke-width":String(h)})),u){const r=mi(l)>.5?"#111827":"#ffffff";e.push(o("text",{key:`val-${n}-${t}`,x:String(s+S/2),y:String(d+$/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.min(11,.3*S,.4*$)),"font-family":"sans-serif",fill:r},String(Math.round(100*i)/100)))}}}return e},[t,m,y,b,v,a,S,$,k,w,u,p,h]),z=s(()=>{const e=[];if(n)for(let t=0;t<m;t++){const r=t<n.length?n[t]:"",i=w+20+t*$+$/2;e.push(o("text",{key:`row-label-${t}`,x:String(k-8),y:String(i),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},r))}if(r)for(let t=0;t<y;t++){const n=t<r.length?r[t]:"",i=k+t*S+S/2,l=w+20+m*$+16;e.push(o("text",{key:`col-label-${t}`,x:String(i),y:String(l),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},n))}return e},[n,r,m,y,S,$,k,w]),C=s(()=>g?[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"},g)]:[],[g,i]);if(0===m||0===y)return o("svg",{width:"100%",viewBox:`0 0 ${i} ${l}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Heat map — no data"},o("text",{x:String(i/2),y:String(l/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"No data to display."));const I=C(),A=M(),F=z();return o("svg",{width:"100%",viewBox:`0 0 ${i} ${l}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Heat map",style:{fontFamily:"sans-serif"}},...I,...A,...F)}function vi(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function wi(e){const{data:t=[],bins:n=10,width:r=600,height:i=400,barColor:l="#3b82f6",barGap:a=2,showGrid:c=!0,showValues:f=!0,title:u,xLabel:p,yLabel:h,padding:g=60}=e,x=Math.max(1,Math.round(n)),m=d(()=>function(e,t){if(0===e.length)return[];let n=e[0],o=e[0];for(let t=1;t<e.length;t++){const r=e[t];r<n&&(n=r),r>o&&(o=r)}if(n===o)return[{min:n,max:o+1,count:e.length}];const r=(o-n)/t,i=[];for(let e=0;e<t;e++)i.push({min:n+e*r,max:n+(e+1)*r,count:0});for(let o=0;o<e.length;o++){const l=e[o];let a=Math.floor((l-n)/r);a>=t&&(a=t-1),i[a].count++}return i}(t,x),[t,x]),y=d(()=>{let e=0;for(let t=0;t<m.length;t++)m[t].count>e&&(e=m[t].count);return e>0?e:1},[m]),b=r-2*g,v=i-2*g,w=s(()=>{if(!c)return[];const e=function(e){if(e<=0)return 1;const t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),o=t/n;return o<=1.5?n:o<=3.5?2*n:o<=7.5?5*n:10*n}(y),t=[];for(let n=e;n<=y;n+=e){const e=g+v-n/y*v;t.push(o("line",{key:`grid-${n}`,x1:String(g),y1:String(e),x2:String(g+b),y2:String(e),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),t.push(o("text",{key:`grid-label-${n}`,x:String(g-8),y:String(e+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(n)))}return t},[c,y,g,b,v]),k=s(()=>{const e=[];return e.push(o("line",{key:"axis-y",x1:String(g),y1:String(g),x2:String(g),y2:String(g+v),stroke:"#374151","stroke-width":"1.5"})),e.push(o("line",{key:"axis-x",x1:String(g),y1:String(g+v),x2:String(g+b),y2:String(g+v),stroke:"#374151","stroke-width":"1.5"})),e},[g,b,v]),S=s(()=>{if(0===m.length)return[];const e=[],t=a*(m.length-1),n=Math.max(1,(b-t)/m.length);for(let t=0;t<m.length;t++){const r=m[t],i=r.count/y*v,s=g+t*(n+a),d=g+v-i;if(e.push(o("rect",{key:`bar-${t}`,x:String(s),y:String(d),width:String(n),height:String(i),fill:l})),f&&r.count>0&&e.push(o("text",{key:`val-${t}`,x:String(s+n/2),y:String(d-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},String(r.count))),m.length<=15||t%2==0||t===m.length-1){const i=(m.length,vi(r.min));e.push(o("text",{key:`xlabel-${t}`,x:String(s+n/2),y:String(g+v+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},i))}}if(m.length>0){const t=m[m.length-1],n=g+b;e.push(o("text",{key:"xlabel-end",x:String(n),y:String(g+v+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},vi(t.max)))}return e},[m,y,a,l,f,g,b,v]),$=s(()=>{const e=[];return u&&e.push(o("text",{key:"title",x:String(r/2),y:String(g/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},u)),p&&e.push(o("text",{key:"x-label",x:String(g+b/2),y:String(i-8),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151"},p)),h&&e.push(o("text",{key:"y-label",x:String(14),y:String(g+v/2),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90 14 ${g+v/2})`},h)),e},[u,p,h,r,i,g,b,v]),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]),z=w(),C=k(),I=S(),A=$(),F=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"}},...A,...z,...C,...I,...F)}function ki(e){const{data:t=[],width:n=600,height:r=400,orientation:i="vertical",stemColor:l="#94a3b8",stemWidth:a=2,dotRadius:c=6,dotColor:f="#3b82f6",showGrid:u=!0,showValues:p=!0,title:h,padding:g=60}=e,x="vertical"===i,m=n-2*g,y=r-2*g-(x?30:0),b=x?y:m,v=x?m:y,w=d(()=>{let e=0;for(let n=0;n<t.length;n++)t[n].value>e&&(e=t[n].value);return e>0?e:1},[t]),k=d(()=>0===t.length?0:v/t.length,[t.length,v]),S=s(()=>{if(!u)return[];const e=function(e){if(e<=0)return 1;const t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),o=t/n;return o<=1.5?n:o<=3.5?2*n:o<=7.5?5*n:10*n}(w),t=[];for(let n=e;n<=w;n+=e){const e=n/w*b;if(x){const r=g+y-e;t.push(o("line",{key:`grid-${n}`,x1:String(g),y1:String(r),x2:String(g+m),y2:String(r),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),t.push(o("text",{key:`grid-label-${n}`,x:String(g-8),y:String(r+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(n)))}else{const r=g+e;t.push(o("line",{key:`grid-${n}`,x1:String(r),y1:String(g),x2:String(r),y2:String(g+y),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),t.push(o("text",{key:`grid-label-${n}`,x:String(r),y:String(g+y+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(n)))}}return t},[u,w,x,g,m,y,b]),$=s(()=>{const e=[];return e.push(o("line",{key:"axis-y",x1:String(g),y1:String(g),x2:String(g),y2:String(g+y),stroke:"#374151","stroke-width":"1.5"})),e.push(o("line",{key:"axis-x",x1:String(g),y1:String(g+y),x2:String(g+m),y2:String(g+y),stroke:"#374151","stroke-width":"1.5"})),e},[x,g,m,y]),M=s(()=>{if(0===t.length)return[];const e=[];for(let n=0;n<t.length;n++){const r=t[n],i=r.value/w*b,s=k*n+k/2,d=r.color??f;if(x){const t=g+s,f=g+y,u=g+y-i;e.push(o("line",{key:`stem-${n}`,x1:String(t),y1:String(f),x2:String(t),y2:String(u),stroke:l,"stroke-width":String(a)})),e.push(o("circle",{key:`dot-${n}`,cx:String(t),cy:String(u),r:String(c),fill:d})),p&&e.push(o("text",{key:`val-${n}`,x:String(t),y:String(u-c-4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(r.value)));const h=t,x=g+y+16;e.push(o("text",{key:`cat-${n}`,x:String(h),y:String(x),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${h}, ${x})`},r.label))}else{const t=g+s,f=g,u=g+i;e.push(o("line",{key:`stem-${n}`,x1:String(f),y1:String(t),x2:String(u),y2:String(t),stroke:l,"stroke-width":String(a)})),e.push(o("circle",{key:`dot-${n}`,cx:String(u),cy:String(t),r:String(c),fill:d})),p&&e.push(o("text",{key:`val-${n}`,x:String(u+c+4),y:String(t+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(r.value))),e.push(o("text",{key:`cat-${n}`,x:String(g-8),y:String(t+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},r.label))}}return e},[t,w,k,f,c,l,a,p,x,g,m,y,b]),z=s(()=>h?[o("text",{key:"title",x:String(n/2),y:String(g/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,n,g]),C=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]),I=S(),A=$(),F=M(),R=z(),D=C();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??"Lollipop chart",style:{fontFamily:"sans-serif"}},...R,...I,...A,...F,...D)}function Si(e){const t=e.replace("#",""),n=3===t.length?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,o=parseInt(n,16);return{r:o>>16&255,g:o>>8&255,b:255&o}}function $i(e,t){if(0===t.length)return"#000000";if(1===t.length)return t[0];const n=Math.max(0,Math.min(1,e)),o=t.length-1,r=Math.min(Math.floor(n*o),o-1),i=n*o-r,l=Si(t[r]),a=Si(t[r+1]);return function(e,t,n){const o=e=>{const t=Math.max(0,Math.min(255,Math.round(e))).toString(16);return 1===t.length?"0"+t:t};return`#${o(e)}${o(t)}${o(n)}`}(l.r+(a.r-l.r)*i,l.g+(a.g-l.g)*i,l.b+(a.b-l.b)*i)}function Mi(e){const{r:t,g:n,b:o}=Si(e);return(.299*t+.587*n+.114*o)/255}const zi=["#f0f9ff","#3b82f6","#1e3a8a"];function Ci(e){const{data:t=[],labels:n,rowLabels:r,columnLabels:i,width:l=500,height:a=500,colorScale:c=zi,showValues:f=!0,showDiagonal:u=!0,cellBorderColor:p="#e5e7eb",title:h,padding:g=70,symmetric:x=!1}=e,m=r??n,y=i??n,b=t.length,v=d(()=>{let e=0;for(const n of t)n.length>e&&(e=n.length);return e},[t]),w=d(()=>{if(!x||0===b)return t;const e=[],n=Math.max(b,v);for(let o=0;o<n;o++){const r=[];for(let e=0;e<n;e++){const n=t[o],i=n&&e<n.length?n[e]:0,l=t[e],a=l&&o<l.length?l[o]:0;0!==i?r.push(i):r.push(a)}e.push(r)}return e},[t,x,b,v]),k=w.length,S=d(()=>{let e=0;for(const t of w)t.length>e&&(e=t.length);return e},[w]),{minVal:$,maxVal:M}=d(()=>{let e=1/0,t=-1/0;for(const n of w)for(const o of n)o<e&&(e=o),o>t&&(t=o);return e===1/0&&(e=0),t===-1/0&&(t=1),e===t&&(t=e+1),{minVal:e,maxVal:t}},[w]),z=h?30:0,C=m?g:20,I=S>0?(l-C-20)/S:0,A=k>0?(a-z-(y?g:20)-20)/k:0,F=s(()=>{const e=[];for(let t=0;t<k;t++){const n=w[t];for(let r=0;r<S;r++){const i=r<n.length?n[r]:0,l=$i((i-$)/(M-$),c),a=C+r*I,s=z+20+t*A,d=t===r,h=d&&u?"currentColor":p,g=d&&u?"2":"1";if(e.push(o("rect",{key:`cell-${t}-${r}`,x:String(a),y:String(s),width:String(I),height:String(A),fill:l,stroke:h,"stroke-width":g})),f){const n=Mi(l)>.5?"#111827":"#ffffff",c=Math.min(12,.3*I,.35*A);e.push(o("text",{key:`val-${t}-${r}`,x:String(a+I/2),y:String(s+A/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.max(8,c)),"font-weight":d&&u?"bold":"normal","font-family":"sans-serif",fill:n},String(Math.round(100*i)/100)))}}}return e},[w,k,S,$,M,c,I,A,C,z,f,u,p]),R=s(()=>{const e=[];if(m)for(let t=0;t<k;t++){const n=t<m.length?m[t]:"",r=z+20+t*A+A/2;e.push(o("text",{key:`row-label-${t}`,x:String(C-8),y:String(r),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},n))}if(y)for(let t=0;t<S;t++){const n=t<y.length?y[t]:"",r=C+t*I+I/2,i=z+20+k*A+12;e.push(o("text",{key:`col-label-${t}`,x:String(r),y:String(i),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},n))}return e},[m,y,k,S,I,A,C,z]),D=s(()=>h?[o("text",{key:"title",x:String(l/2),y:"22","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},h)]:[],[h,l]);if(0===k||0===S)return o("svg",{width:"100%",viewBox:`0 0 ${l} ${a}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Matrix — no data"},o("text",{x:String(l/2),y:String(a/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"No data to display."));const L=D(),W=F(),N=R();return o("svg",{width:"100%",viewBox:`0 0 ${l} ${a}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Matrix visualization",style:{fontFamily:"sans-serif"}},...L,...W,...N)}const Ii=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Ai(e){if(!e.children||0===e.children.length)return Math.max(0,e.value??0);let t=0;const n=[e];for(;n.length>0;){const e=n.pop();if(e.children&&0!==e.children.length)for(let t=e.children.length-1;t>=0;t--)n.push(e.children[t]);else t+=Math.max(0,e.value??0)}return t}function Fi(e){const{data:t,width:n=600,height:r=400,orientation:i="horizontal",showLabels:l=!0,showValues:a=!0,colors:s=Ii,borderColor:c="#ffffff",borderWidth:f=1,title:u,padding:p=10}=e,h=u?30:0,g=p,x=p+h,m=n-2*p,y=r-2*p-h;if(d(()=>Ai(t),[t])<=0||m<=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":u??"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"));const b=d(()=>function(e,t,n,o,r,i,l){const a=[];if(Ai(e)<=0)return a;const s=function(e){let t=0;const n=[{node:e,depth:0}];for(;n.length>0;){const{node:e,depth:o}=n.pop();if(o>t&&(t=o),e.children)for(let t=e.children.length-1;t>=0;t--)n.push({node:e.children[t],depth:o+1})}return t}(e)+1,d="horizontal"===i,c=d?r/s:o/s,f=[];for(f.push({node:e,depth:0,spanStart:d?t:n,spanEnd:d?t+o:n+r,colorIndex:0});f.length>0;){const e=f.shift(),{node:o,depth:r,spanStart:i,spanEnd:s,colorIndex:u}=e,p=Ai(o);if(p<=0)continue;const h=s-i;let g,x,m,y;if(d?(g=i,x=n+r*c,m=h,y=c):(g=t+r*c,x=i,m=c,y=h),a.push({x:g,y:x,w:m,h:y,label:o.label,value:p,color:o.color??l[u%l.length],depth:r}),o.children&&o.children.length>0){let e=i;for(let t=0;t<o.children.length;t++){const n=o.children[t],i=Ai(n);if(i<=0)continue;const l=i/p*h;f.push({node:n,depth:r+1,spanStart:e,spanEnd:e+l,colorIndex:0===r?t:u}),e+=l}}}return a}(t,g,x,m,y,i,s),[t,g,x,m,y,i,s]),v=[];u&&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"},u));for(let e=0;e<b.length;e++){const t=b[e];if(v.push(o("rect",{key:`cell-${e}`,x:String(t.x),y:String(t.y),width:String(Math.max(0,t.w)),height:String(Math.max(0,t.h)),fill:t.color,stroke:c,"stroke-width":String(f),role:"graphics-symbol","aria-label":`${t.label}: ${t.value}`})),l&&t.w>20&&t.h>14){const n=Math.floor(t.w/7),r=t.label.length>n?t.label.substring(0,Math.max(1,n-2))+"..":t.label;v.push(o("text",{key:`label-${e}`,x:String(t.x+t.w/2),y:String(t.y+t.h/2+(a?-2:4)),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},r))}a&&t.w>30&&t.h>28&&v.push(o("text",{key:`value-${e}`,x:String(t.x+t.w/2),y:String(t.y+t.h/2+12),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(t.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":u??"Partition diagram",style:{fontFamily:"sans-serif"}},...v)}function Ri(e,t){const n=[];for(const o of t)n.push(String(e[o]??""));return n.join(" | ")}function Di(e,t){const n=new Set;for(const o of e)n.add(Ri(o,t));const o=Array.from(n);return o.sort(),o}function Li(e,t){if(0===e.length)return 0;switch(t){case"count":return e.length;case"sum":{let t=0;for(const n of e)t+=n;return t}case"avg":{let t=0;for(const n of e)t+=n;return t/e.length}case"min":{let t=e[0];for(let n=1;n<e.length;n++)e[n]<t&&(t=e[n]);return t}case"max":{let t=e[0];for(let n=1;n<e.length;n++)e[n]>t&&(t=e[n]);return t}}}function Wi(e){return Number.isInteger(e)?String(e):e.toFixed(2)}function Ni(e){const{data:t=[],rows:n=[],columns:r=[],values:i=[],aggregation:l="sum",width:a=600,height:s=400,showTotals:c=!0,title:f,headerColor:u="#3b82f6",cellPadding:p=8}=e;if(0===t.length||0===n.length&&0===r.length||0===i.length)return o("svg",{width:"100%",viewBox:`0 0 ${a} ${s}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"table","aria-label":f??"Empty pivot table"},o("text",{x:String(a/2),y:String(s/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.4"},"No data to display"));const h=d(()=>function(e,t,n,o,r){const i=Di(e,t),l=Di(e,n),a=new Map;for(const r of e){const e=`${Ri(r,t)}::${Ri(r,n)}`;a.has(e)||a.set(e,[]);const i=a.get(e);let l=0;for(const e of o){const t=r[e];if("number"==typeof t)l+=t;else if("string"==typeof t){const e=parseFloat(t);isNaN(e)||(l+=e)}}i.push(l)}const s=new Map;for(const[e,t]of a)s.set(e,Li(t,r));const d=new Map;for(const e of i){const t=[];for(const n of l){const o=s.get(`${e}::${n}`);void 0!==o&&t.push(o)}d.set(e,Li(t,"count"===r?"sum":r))}const c=new Map;for(const e of l){const t=[];for(const n of i){const o=s.get(`${n}::${e}`);void 0!==o&&t.push(o)}c.set(e,Li(t,"count"===r?"sum":r))}const f=[];for(const e of d.values())f.push(e);return{rowKeys:i,colKeys:l,cells:s,rowTotals:d,colTotals:c,grandTotal:Li(f,"count"===r?"sum":r)}}(t,n,r,i,l),[t,n,r,i,l]),{rowKeys:g,colKeys:x,cells:m,rowTotals:y,colTotals:b,grandTotal:v}=h,w=f?30:0,k=x.length+(c?1:0),S=g.length+(c?1:0),$=1+k,M=1+S,z=Math.max(40,(a-2*p)/$),C=Math.max(20,Math.min(36,(s-w-2*p)/M)),I=z*$,A=C*M,F=Math.max(0,(a-I)/2),R=w+Math.max(0,(s-w-A)/2),D=[];f&&D.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"},f)),D.push(o("rect",{key:"header-row-bg",x:String(F),y:String(R),width:String(I),height:String(C),fill:u})),D.push(o("rect",{key:"header-col-bg",x:String(F),y:String(R+C),width:String(z),height:String(C*S),fill:u,opacity:"0.85"})),D.push(o("text",{key:"corner",x:String(F+z/2),y:String(R+C/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},l.toUpperCase()));for(let e=0;e<x.length;e++){const t=F+(e+1)*z,n=Math.floor(z/7),r=x[e],i=r.length>n?r.substring(0,Math.max(1,n-2))+"..":r;D.push(o("text",{key:`ch-${e}`,x:String(t+z/2),y:String(R+C/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},i))}c&&D.push(o("text",{key:"ch-total",x:String(F+(x.length+1)*z+z/2),y:String(R+C/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},"Total"));for(let e=0;e<g.length;e++){const t=g[e],n=R+(e+1)*C;e%2==0&&D.push(o("rect",{key:`row-bg-${e}`,x:String(F+z),y:String(n),width:String(z*k),height:String(C),fill:"#f9fafb"}));const r=Math.floor(z/7),i=t.length>r?t.substring(0,Math.max(1,r-2))+"..":t;D.push(o("text",{key:`rh-${e}`,x:String(F+z/2),y:String(n+C/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},i));for(let r=0;r<x.length;r++){const i=`${t}::${x[r]}`,l=m.get(i),a=F+(r+1)*z;D.push(o("rect",{key:`border-${e}-${r}`,x:String(a),y:String(n),width:String(z),height:String(C),fill:"none",stroke:"#e5e7eb","stroke-width":"0.5"})),D.push(o("text",{key:`cell-${e}-${r}`,x:String(a+z/2),y:String(n+C/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},void 0!==l?Wi(l):"-"))}if(c){const r=F+(x.length+1)*z,i=y.get(t)??0;D.push(o("rect",{key:`rt-bg-${e}`,x:String(r),y:String(n),width:String(z),height:String(C),fill:"#eff6ff"})),D.push(o("text",{key:`rt-${e}`,x:String(r+z/2),y:String(n+C/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},Wi(i)))}}if(c){const e=R+(g.length+1)*C;D.push(o("rect",{key:"total-row-bg",x:String(F),y:String(e),width:String(I),height:String(C),fill:"#eff6ff"})),D.push(o("text",{key:"total-label",x:String(F+z/2),y:String(e+C/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},"Total"));for(let t=0;t<x.length;t++){const n=x[t],r=b.get(n)??0,i=F+(t+1)*z;D.push(o("text",{key:`ct-${t}`,x:String(i+z/2),y:String(e+C/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},Wi(r)))}const t=F+(x.length+1)*z;D.push(o("text",{key:"grand-total",x:String(t+z/2),y:String(e+C/2+4),"text-anchor":"middle","font-size":"12","font-family":"sans-serif","font-weight":"bold",fill:"#1e3a8a"},Wi(v)))}return D.push(o("rect",{key:"outer-border",x:String(F),y:String(R),width:String(I),height:String(A),fill:"none",stroke:"#d1d5db","stroke-width":"1"})),o("svg",{width:"100%",viewBox:`0 0 ${a} ${s}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"table","aria-label":f??"Pivot table",style:{fontFamily:"sans-serif"}},...D)}function Ei(e,t){return 2*Math.PI*e/t-Math.PI/2}function Ti(e,t,n,o){return{x:e+n*Math.cos(o),y:t+n*Math.sin(o)}}function Bi(e){const{axes:t=[],series:n=[],width:r=500,height:i=500,levels:l=5,showLabels:a=!0,showValues:c=!1,showLegend:f=!0,showDots:u=!0,gridColor:p="#d1d5db",title:h}=e,g=t.length,x=h?30:0,m=f&&n.length>0?30:0,y=Math.min((r-120)/2,(i-120-x-m)/2),b=r/2,v=60+x+y,w=d(()=>{const e=[];for(let o=0;o<g;o++){const r=t[o]?.max;if(void 0!==r&&r>0){e.push(r);continue}let i=0;for(const e of n){const t=e.values[o];void 0!==t&&t>i&&(i=t)}e.push(i>0?i:1)}return e},[t,n,g]),k=s(()=>{if(g<3)return[];const e=[];for(let t=1;t<=l;t++){const n=y*t/l,r=[];for(let e=0;e<g;e++){const t=Ei(e,g),o=Ti(b,v,n,t);r.push(`${o.x},${o.y}`)}e.push(o("polygon",{key:`ring-${t}`,points:r.join(" "),fill:"none",stroke:p,"stroke-width":t===l?"1.5":"0.5","stroke-dasharray":t===l?"none":"3 2"}))}for(let t=0;t<g;t++){const n=Ei(t,g),r=Ti(b,v,y,n);e.push(o("line",{key:`spoke-${t}`,x1:String(b),y1:String(v),x2:String(r.x),y2:String(r.y),stroke:p,"stroke-width":"0.75"}))}return e},[g,l,y,b,v,p]),S=s(()=>{if(!a||g<3)return[];const e=[];for(let n=0;n<g;n++){const r=Ei(n,g),i=Ti(b,v,y+16,r);let l="middle";i.x<b-5?l="end":i.x>b+5&&(l="start");const a=Math.abs(i.y-v)<5?"0.35em":i.y<v?"0em":"0.7em";e.push(o("text",{key:`label-${n}`,x:String(i.x),y:String(i.y),"text-anchor":l,dy:a,"font-size":"12","font-family":"sans-serif",fill:"currentColor"},t[n]?.label??`Axis ${n}`))}return e},[a,g,t,y,b,v]),$=s(()=>{if(g<3||0===n.length)return[];const e=[];for(let t=0;t<n.length;t++){const r=n[t],i=[],l=[],a=[];for(let e=0;e<g;e++){const n=r.values[e]??0,s=w[e],d=Math.min(n/s,1),f=y*d,p=Ei(e,g),h=Ti(b,v,f,p);i.push(`${h.x},${h.y}`),u&&l.push(o("circle",{key:`dot-${t}-${e}`,cx:String(h.x),cy:String(h.y),r:"3.5",fill:r.color,stroke:"#fff","stroke-width":"1.5"})),c&&a.push(o("text",{key:`val-${t}-${e}`,x:String(h.x),y:String(h.y-8),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:r.color},String(Math.round(100*n)/100)))}e.push(o("polygon",{key:`series-fill-${t}`,points:i.join(" "),fill:r.color,"fill-opacity":String(r.fillOpacity??.15),stroke:"none"})),e.push(o("polygon",{key:`series-line-${t}`,points:i.join(" "),fill:"none",stroke:r.color,"stroke-width":"2","stroke-linejoin":"round"}));for(const t of l)e.push(t);for(const t of a)e.push(t)}return e},[g,n,w,y,b,v,u,c]),M=s(()=>{if(!f||0===n.length)return[];const e=[],t=v+y+40,r=100*n.length,i=b-r/2;for(let r=0;r<n.length;r++){const l=n[r],a=i+100*r;e.push(o("rect",{key:`legend-swatch-${r}`,x:String(a),y:String(t),width:"12",height:"12",rx:"2",fill:l.color})),e.push(o("text",{key:`legend-text-${r}`,x:String(a+16),y:String(t+10),"font-size":"12","font-family":"sans-serif",fill:"currentColor"},l.label))}return e},[f,n,b,v,y]),z=s(()=>h?[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"},h)]:[],[h,r]);if(g<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":h??"Radar chart — 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."));const C=k(),I=S(),A=$(),F=M(),R=z();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Radar chart",style:{fontFamily:"sans-serif"}},...R,...C,...I,...A,...F)}const Pi=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function _i(e){const{nodes:t,links:n,width:r=800,height:i=500,nodeWidth:l=20,nodePadding:a=10,showLabels:c=!0,showValues:f=!1,linkOpacity:u=.4,colors:p=Pi,title:h,padding:g=40}=e;if(!t||0===t.length)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"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"));const x=d(()=>function(e,t,n,o,r,i,l,a){if(0===e.length)return{layoutNodes:[],layoutLinks:[]};const s=n-2*l,d=o-2*l,c=t.filter(e=>e.value>0),f=e.map(e=>e.id),u=function(e,t){const n=new Map,o=new Map,r=new Map;for(const t of e)o.set(t,new Set),r.set(t,[]);for(const e of t){if(e.value<=0)continue;const t=o.get(e.target);t&&t.add(e.source);const n=r.get(e.source);n&&n.push(e.target)}const i=[];for(const t of e)0===o.get(t).size&&(n.set(t,0),i.push(t));if(0===i.length){for(const t of e)n.set(t,0);return n}let l=0;for(;l<i.length;){const e=i[l];l++;const t=n.get(e),o=r.get(e)??[];for(const e of o){const o=n.get(e),r=t+1;(void 0===o||r>o)&&n.set(e,r),i.includes(e)||i.push(e)}}for(const t of e)n.has(t)||n.set(t,0);return n}(f,c),p=new Map,h=new Map;for(const e of f)p.set(e,0),h.set(e,0);for(const e of c)h.set(e.source,(h.get(e.source)??0)+e.value),p.set(e.target,(p.get(e.target)??0)+e.value);let g=0;for(const e of u.values())e>g&&(g=e);const x=new Map;for(let e=0;e<=g;e++)x.set(e,[]);for(const[e,t]of u)x.get(t).push(e);const m=new Map,y=g>0?(s-r)/g:0;for(let e=0;e<=g;e++)m.set(e,l+e*y);const b=new Map;for(let t=0;t<e.length;t++)b.set(e[t].id,e[t]);const v=[],w=new Map;for(let t=0;t<=g;t++){const n=x.get(t);if(0===n.length)continue;let o=0;for(const e of n){const t=p.get(e)??0,n=h.get(e)??0;o+=Math.max(t,n,1)}const r=d-i*(n.length-1),s=o>0?r/o:1;let c=l;for(let o=0;o<n.length;o++){const r=n[o],l=b.get(r),d=p.get(r)??0,f=h.get(r)??0,u=Math.max(d,f,1),g=Math.max(4,u*s),x=e.findIndex(e=>e.id===r),y={id:r,label:l.label,color:l.color??a[x%a.length],column:t,x:m.get(t),y:c,height:g,totalIn:d,totalOut:f,totalValue:u};v.push(y),w.set(r,y),c+=g+i}}const k=new Map,S=new Map;for(const e of f)k.set(e,0),S.set(e,0);const $=[...c].sort((e,t)=>t.value-e.value),M=[];for(const e of $){const t=w.get(e.source),n=w.get(e.target);if(!t||!n)continue;const o=t.totalOut||1,r=n.totalIn||1,i=e.value/o*t.height,l=e.value/r*n.height,a=Math.max(1,(i+l)/2),s=k.get(e.source),d=S.get(e.target),c=t.y+s+i/2,f=n.y+d+l/2;k.set(e.source,s+i),S.set(e.target,d+l);const u=b.get(e.source);M.push({source:e.source,target:e.target,value:e.value,color:e.color??u?.color??t.color,sourceY:c,targetY:f,width:a})}return{layoutNodes:v,layoutLinks:M}}(t,n,r,i,l,a,g,p),[t,n,r,i,l,a,g,p]),m=s(()=>{const e=[];for(let t=0;t<x.layoutLinks.length;t++){const n=x.layoutLinks[t],r=x.layoutNodes.find(e=>e.id===n.source),i=x.layoutNodes.find(e=>e.id===n.target);if(!r||!i)continue;const a=r.x+l,s=i.x,d=(a+s)/2,c=`M ${a} ${n.sourceY} C ${d} ${n.sourceY}, ${d} ${n.targetY}, ${s} ${n.targetY}`;e.push(o("path",{key:`link-${t}`,d:c,fill:"none",stroke:n.color,"stroke-width":String(Math.max(1,n.width)),"stroke-opacity":String(u),"stroke-linecap":"butt"})),f&&n.value>0&&e.push(o("text",{key:`link-val-${t}`,x:String(d),y:String((n.sourceY+n.targetY)/2-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280","pointer-events":"none"},String(n.value)))}return e},[x,l,u,f]),y=s(()=>{const e=[];for(let t=0;t<x.layoutNodes.length;t++){const n=x.layoutNodes[t];if(e.push(o("rect",{key:`node-${n.id}`,x:String(n.x),y:String(n.y),width:String(l),height:String(n.height),fill:n.color,stroke:"#374151","stroke-width":"0.5",role:"img","aria-label":`${n.label}: ${n.totalValue}`})),c){const t=x.layoutNodes.reduce((e,t)=>Math.max(e,t.column),0),r=n.column===t,i=r?n.x+l+6:n.x-6,a=r?"start":"end",s=0===n.column,d=s?n.x-6:i,c=s?"end":a;e.push(o("text",{key:`label-${n.id}`,x:String(d),y:String(n.y+n.height/2+4),"text-anchor":c,"font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},n.label))}}return e},[x,l,c]),b=s(()=>h?[o("text",{key:"title",x:String(r/2),y:String(g/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,r,g]),v=m(),w=y(),k=b();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Sankey diagram",style:{fontFamily:"sans-serif"}},...k,...v,...w)}const Hi=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],Yi=2*Math.PI;function ji(e){if(!e.children||0===e.children.length)return Math.max(0,e.value??0);let t=0;const n=[e];for(;n.length>0;){const e=n.pop();if(e.children&&0!==e.children.length)for(let t=e.children.length-1;t>=0;t--)n.push(e.children[t]);else t+=Math.max(0,e.value??0)}return t}function qi(e,t,n,o,r,i){const l=i-r,a=l>Math.PI?1:0,s=r-Math.PI/2,d=i-Math.PI/2,c=e+o*Math.cos(s),f=t+o*Math.sin(s),u=e+o*Math.cos(d),p=t+o*Math.sin(d),h=e+n*Math.cos(d),g=t+n*Math.sin(d),x=e+n*Math.cos(s),m=t+n*Math.sin(s);if(l>=Yi-.001){const r=s+Math.PI;return[`M ${c} ${f}`,`A ${o} ${o} 0 1 1 ${e+o*Math.cos(r)} ${t+o*Math.sin(r)}`,`A ${o} ${o} 0 1 1 ${c} ${f}`,`L ${x} ${m}`,`A ${n} ${n} 0 1 0 ${e+n*Math.cos(r)} ${t+n*Math.sin(r)}`,`A ${n} ${n} 0 1 0 ${x} ${m}`,"Z"].join(" ")}return[`M ${c} ${f}`,`A ${o} ${o} 0 ${a} 1 ${u} ${p}`,`L ${h} ${g}`,`A ${n} ${n} 0 ${a} 0 ${x} ${m}`,"Z"].join(" ")}function Oi(e){const{data:t,width:n=500,height:r=500,innerRadius:i=40,showLabels:l=!0,colors:a=Hi,strokeColor:s="#ffffff",strokeWidth:c=1,title:f}=e,u=n/2,p=r/2,h=f?20:0,g=Math.min(u,p-h)-10;if(d(()=>ji(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":f??"Empty sunburst chart"},o("text",{x:String(u),y:String(p),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));const x=d(()=>function(e,t,n,o){const r=[],i=ji(e);if(i<=0)return r;const l=function(e){let t=0;const n=[{node:e,depth:0}];for(;n.length>0;){const{node:e,depth:o}=n.pop();if(o>t&&(t=o),e.children)for(let t=e.children.length-1;t>=0;t--)n.push({node:e.children[t],depth:o+1})}return t}(e),a=l>0?(n-t)/(l+1):n-t,s=[];if(!(e.children&&e.children.length>0))return r.push({startAngle:0,endAngle:Yi,innerR:t,outerR:t+a,label:e.label,value:i,color:e.color??o[0],depth:0}),r;{let t=0;for(let n=0;n<e.children.length;n++){const o=e.children[n],r=ji(o);if(r<=0)continue;const l=r/i*Yi;s.push({node:o,startAngle:t,endAngle:t+l,depth:0,colorIndex:n}),t+=l}}for(;s.length>0;){const e=s.shift(),{node:n,startAngle:i,endAngle:l,depth:d,colorIndex:c}=e,f=ji(n);if(f<=0)continue;const u=t+d*a,p=u+a;if(r.push({startAngle:i,endAngle:l,innerR:u,outerR:p,label:n.label,value:f,color:n.color??o[c%o.length],depth:d}),n.children&&n.children.length>0){let e=i;const t=l-i;for(let o=0;o<n.children.length;o++){const r=n.children[o],i=ji(r);if(i<=0)continue;const l=i/f*t;s.push({node:r,startAngle:e,endAngle:e+l,depth:d+1,colorIndex:c}),e+=l}}}return r}(t,i,g,a),[t,i,g,a]),m=[];f&&m.push(o("text",{key:"title",x:String(u),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},f));const y=p+h/2;for(let e=0;e<x.length;e++){const t=x[e],n=qi(u,y,t.innerR,t.outerR,t.startAngle,t.endAngle);if(m.push(o("path",{key:`arc-${e}`,d:n,fill:t.color,stroke:s,"stroke-width":String(c),role:"graphics-symbol","aria-label":`${t.label}: ${t.value}`})),l){const n=t.endAngle-t.startAngle,r=t.startAngle+n/2-Math.PI/2,i=(t.innerR+t.outerR)/2,l=t.outerR-t.innerR,a=n*i;if(a>20&&l>14){const n=u+i*Math.cos(r),s=y+i*Math.sin(r),d=Math.floor(Math.min(a,l)/7),c=t.label.length>d?t.label.substring(0,Math.max(1,d-1))+"..":t.label;m.push(o("text",{key:`label-${e}`,x:String(n),y:String(s+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},c))}}}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":f??"Sunburst chart",style:{fontFamily:"sans-serif"}},...m)}const Ui=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Xi(e){if(!e.children||0===e.children.length)return Math.max(0,e.value);let t=0;const n=[e];for(;n.length>0;){const e=n.pop();if(e.children&&0!==e.children.length)for(let t=e.children.length-1;t>=0;t--)n.push(e.children[t]);else t+=Math.max(0,e.value)}return t}function Vi(e,t){if(0===e.length||t<=0)return 1/0;let n=0;for(const t of e)n+=t;if(n<=0)return 1/0;const o=n/t;let r=0;for(const t of e){if(t<=0)continue;const e=t/o,n=Math.max(e/o,o/e);n>r&&(r=n)}return r}function Gi(e){const{data:t,width:n=600,height:r=400,showLabels:i=!0,showValues:l=!0,colors:a=Ui,borderColor:s="#ffffff",borderWidth:c=2,padding:f=2,title:u}=e,p=u?30:0,h=f,g=f+p,x=n-2*f,m=r-2*f-p;if(d(()=>Xi(t),[t])<=0||x<=0||m<=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 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"));const y=d(()=>function(e,t,n,o,r,i){const l=[],a=[],s=Xi(e);if(s<=0||o<=0||r<=0)return l;const d=e.children&&e.children.length>0?e.children:[e],c=o*r,f=[];for(let e=0;e<d.length;e++){const t=d[e],n=Xi(t);n<=0||f.push({label:t.label,value:n,area:n/s*c,color:t.color??i[e%i.length],node:t})}for(f.sort((e,t)=>t.area-e.area),a.push({nodes:f,rect:{x:t,y:n,w:o,h:r},depth:0});a.length>0;){const e=a.shift(),{nodes:t,rect:n,depth:o}=e;if(0===t.length)continue;let r={...n},s=0;for(;s<t.length&&r.w>0&&r.h>0;){const e=r.w>=r.h,n=e?r.h:r.w,d=[],c=[];d.push(t[s]),c.push(t[s].area),s++;let f=Vi(c,n);for(;s<t.length;){const e=Vi([...c,t[s].area],n);if(e>f)break;d.push(t[s]),c.push(t[s].area),f=e,s++}let u=0;for(const e of c)u+=e;const p=n>0?u/n:0;let h=0;for(let t=0;t<d.length;t++){const n=d[t],s=p>0?n.area/p:0;let c,f,u,g;if(e?(c=r.x,f=r.y+h,u=p,g=s):(c=r.x+h,f=r.y,u=s,g=p),l.push({x:c,y:f,w:u,h:g,label:n.label,value:n.value,color:n.color,depth:o}),n.node.children&&n.node.children.length>0){const e=2,t=c+e,r=f+e+14,l=u-2*e,s=g-2*e-14;if(l>4&&s>4){const e=[],d=n.value,c=l*s;for(let t=0;t<n.node.children.length;t++){const r=n.node.children[t],l=Xi(r);l<=0||e.push({label:r.label,value:l,area:l/d*c,color:r.color??i[(t+o+1)%i.length],node:r})}e.sort((e,t)=>t.area-e.area),a.push({nodes:e,rect:{x:t,y:r,w:l,h:s},depth:o+1})}}h+=s}r=e?{x:r.x+p,y:r.y,w:r.w-p,h:r.h}:{x:r.x,y:r.y+p,w:r.w,h:r.h-p}}}return l}(t,h,g,x,m,a),[t,h,g,x,m,a]),b=[];u&&b.push(o("text",{key:"title",x:String(n/2),y:String(f+16),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},u));for(let e=0;e<y.length;e++){const t=y[e];if(b.push(o("rect",{key:`cell-${e}`,x:String(t.x),y:String(t.y),width:String(Math.max(0,t.w)),height:String(Math.max(0,t.h)),fill:t.color,stroke:s,"stroke-width":String(c),role:"graphics-symbol","aria-label":`${t.label}: ${t.value}`})),i&&t.w>20&&t.h>14){const n=Math.floor(t.w/7),r=t.label.length>n?t.label.substring(0,Math.max(1,n-2))+"..":t.label;b.push(o("text",{key:`label-${e}`,x:String(t.x+4),y:String(t.y+12),"font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},r))}l&&t.w>30&&t.h>28&&b.push(o("text",{key:`value-${e}`,x:String(t.x+4),y:String(t.y+24),"font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(t.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":u??"Treemap chart",style:{fontFamily:"sans-serif"}},...b)}function Ki(e){const t=e.replace("#","");let n,o,r;return 3===t.length?(n=parseInt(t[0]+t[0],16),o=parseInt(t[1]+t[1],16),r=parseInt(t[2]+t[2],16)):(n=parseInt(t.substring(0,2),16),o=parseInt(t.substring(2,4),16),r=parseInt(t.substring(4,6),16)),{r:isNaN(n)?0:n,g:isNaN(o)?0:o,b:isNaN(r)?0:r}}function Zi(e,t){if(0===t.length)return"#3b82f6";if(1===t.length)return t[0];const n=Math.max(0,Math.min(1,e)),o=t.length-1,r=n*o,i=Math.floor(r),l=Math.min(i+1,o),a=r-i,s=Ki(t[i]),d=Ki(t[l]);return function(e,t,n){const o=e=>(e=>Math.max(0,Math.min(255,Math.round(e))))(e).toString(16).padStart(2,"0");return"#"+o(e)+o(t)+o(n)}(s.r+(d.r-s.r)*a,s.g+(d.g-s.g)*a,s.b+(d.b-s.b)*a)}function Ji(e,t){if(e<=0)return 1;const n=e/t,o=Math.pow(10,Math.floor(Math.log10(n))),r=n/o;return r<=1.5?o:r<=3.5?2*o:r<=7.5?5*o:10*o}function Qi(e){const{data:t,vectorFunction:n,width:r=600,height:i=600,gridSize:l=15,xRange:f=[-5,5],yRange:u=[-5,5],arrowScale:p=1,arrowColor:h="#3b82f6",showGrid:g=!0,showAxes:x=!0,colorByMagnitude:m=!1,colorScale:y=["#3b82f6","#8b5cf6","#ef4444"],title:b,padding:v=50,tickFontSize:w=10,arrowWidth:k=1.5,renderer:S="svg",useGPU:$=!1,computeWorker:M}=e,z=Math.max(2,Math.min(50,l)),C=r-2*v,I=i-2*v,A=f[0],F=f[1],R=u[0],D=u[1],L=F-A,W=D-R,N=d(()=>e=>v+(e-A)/L*C,[v,A,L,C]),E=d(()=>e=>v+(D-e)/W*I,[v,D,W,I]),T=d(()=>function(e,t,n,o,r,i,l,a,s,d){if(e&&e.length>0)return e;const c=Math.max(2,Math.min(50,o)),f=s/(c-1),u=d/(c-1);if(n){const e=[];for(let t=0;t<c;t++)for(let n=0;n<c;n++)e.push({x:r+n*f,y:l+t*u});const t=n(e,{gridSize:c,xMin:r,xMax:i,yMin:l,yMax:a}),o=[];for(let n=0;n<e.length;n++){const r=e[n],i=t[n]??{dx:0,dy:0},l=Math.sqrt(i.dx*i.dx+i.dy*i.dy);o.push({x:r.x,y:r.y,dx:i.dx,dy:i.dy,magnitude:l})}return o}if(!t)return[];const p=[];for(let e=0;e<c;e++)for(let n=0;n<c;n++){const o=r+n*f,i=l+e*u,a=t(o,i),s=Math.sqrt(a.dx*a.dx+a.dy*a.dy);p.push({x:o,y:i,dx:a.dx,dy:a.dy,magnitude:s})}return p}(t,n,M,z,A,F,R,D,L,W),[t,n,M,z,A,F,R,D,L,W]),B=d(()=>{let e=0;for(let t=0;t<T.length;t++){const n=T[t],o=n.magnitude??Math.sqrt(n.dx*n.dx+n.dy*n.dy);o>e&&(e=o)}return e>0?e:1},[T]),P=d(()=>Math.min(C,I)/Math.max(z,2)/(2*B)*p,[C,I,z,B,p]);if("canvas"===S){const e=c(null),t=c(0);return a(()=>{const n=e.current;if(!n)return;const o=n.getContext("2d");return o?(t.current&&cancelAnimationFrame(t.current),t.current=requestAnimationFrame(()=>{!function(e,t,n,o,r){const{padding:i,chartWidth:l,chartHeight:a,xMin:s,xMax:d,yMin:c,yMax:f,xSpan:u,ySpan:p,showGrid:h,showAxes:g,colorByMagnitude:x,colorScale:m,arrowColor:y,arrowWidth:b,effectiveArrowScale:v,maxMagnitude:w,title:k,tickFontSize:S}=r,$=e=>i+(e-s)/u*l,M=e=>i+(f-e)/p*a;if(e.clearRect(0,0,t,n),k&&(e.save(),e.font="bold 16px sans-serif",e.fillStyle="#111827",e.textAlign="center",e.textBaseline="middle",e.fillText(k,t/2,i/2+4),e.restore()),h){e.save(),e.strokeStyle="#e5e7eb",e.lineWidth=.5,e.font=`${S}px sans-serif`,e.fillStyle="#6b7280";const t=Ji(u,10);for(let n=Math.ceil(s/t)*t;n<=d;n+=t){const t=$(n);e.beginPath(),e.moveTo(t,i),e.lineTo(t,i+a),e.stroke(),e.textAlign="center",e.textBaseline="top",e.fillText(String(Math.round(100*n)/100),t,i+a+4)}const n=Ji(p,10);for(let t=Math.ceil(c/n)*n;t<=f;t+=n){const n=M(t);e.beginPath(),e.moveTo(i,n),e.lineTo(i+l,n),e.stroke(),e.textAlign="right",e.textBaseline="middle",e.fillText(String(Math.round(100*t)/100),i-6,n)}e.restore()}if(g){if(e.save(),e.strokeStyle="#374151",e.lineWidth=b,c<=0&&f>=0){const t=M(0);e.beginPath(),e.moveTo(i,t),e.lineTo(i+l,t),e.stroke()}if(s<=0&&d>=0){const t=$(0);e.beginPath(),e.moveTo(t,i),e.lineTo(t,i+a),e.stroke()}e.strokeStyle="#d1d5db",e.lineWidth=1,e.strokeRect(i,i,l,a),e.restore()}for(let t=0;t<o.length;t++){const n=o[t],r=n.magnitude??Math.sqrt(n.dx*n.dx+n.dy*n.dy);if(r<1e-10)continue;const i=$(n.x),l=M(n.y),a=n.dx*v,s=-n.dy*v,d=i+a,c=l+s;let f;f=x?Zi(r/w,m):y,e.save(),e.strokeStyle=f,e.lineWidth=b,e.lineCap="round",e.beginPath(),e.moveTo(i,l),e.lineTo(d,c),e.stroke();const u=Math.sqrt(a*a+s*s);if(u>2){const t=a/u,n=s/u,o=-n,r=t,i=Math.min(4,.4*u),l=d-t*i+o*i*.5,p=c-n*i+r*i*.5,h=d-t*i-o*i*.5,g=c-n*i-r*i*.5;e.fillStyle=f,e.beginPath(),e.moveTo(d,c),e.lineTo(l,p),e.lineTo(h,g),e.closePath(),e.fill()}e.restore()}}(o,r,i,T,{padding:v,chartWidth:C,chartHeight:I,xMin:A,xMax:F,yMin:R,yMax:D,xSpan:L,ySpan:W,showGrid:g,showAxes:x,colorByMagnitude:m,colorScale:y,arrowColor:h,arrowWidth:k,effectiveArrowScale:P,maxMagnitude:B,title:b,tickFontSize:w})}),()=>{t.current&&cancelAnimationFrame(t.current)}):void 0},[T,r,i,v,C,I,A,F,R,D,L,W,g,x,m,y,h,k,P,B,b,w]),o("canvas",{ref:e,width:r,height:i,role:"img","aria-label":b??"Vector field plot",style:{fontFamily:"sans-serif",maxWidth:"100%"}})}const _=s(()=>{if(!g)return[];const e=[],t=Ji(L,10);for(let n=Math.ceil(A/t)*t;n<=F;n+=t){const t=N(n);e.push(o("line",{key:`gridv-${n}`,x1:String(t),y1:String(v),x2:String(t),y2:String(v+I),stroke:"#e5e7eb","stroke-width":"0.5"})),e.push(o("text",{key:`xtick-${n}`,x:String(t),y:String(v+I+16),"text-anchor":"middle","font-size":String(w),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(100*n)/100)))}const n=Ji(W,10);for(let t=Math.ceil(R/n)*n;t<=D;t+=n){const n=E(t);e.push(o("line",{key:`gridh-${t}`,x1:String(v),y1:String(n),x2:String(v+C),y2:String(n),stroke:"#e5e7eb","stroke-width":"0.5"})),e.push(o("text",{key:`ytick-${t}`,x:String(v-6),y:String(n+4),"text-anchor":"end","font-size":String(w),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(100*t)/100)))}return e},[g,A,F,R,D,L,W,N,E,v,C,I]),H=s(()=>{if(!x)return[];const e=[];if(R<=0&&D>=0){const t=E(0);e.push(o("line",{key:"axis-x",x1:String(v),y1:String(t),x2:String(v+C),y2:String(t),stroke:"#374151","stroke-width":String(k)}))}if(A<=0&&F>=0){const t=N(0);e.push(o("line",{key:"axis-y",x1:String(t),y1:String(v),x2:String(t),y2:String(v+I),stroke:"#374151","stroke-width":String(k)}))}return e.push(o("rect",{key:"chart-border",x:String(v),y:String(v),width:String(C),height:String(I),fill:"none",stroke:"#d1d5db","stroke-width":"1"})),e},[x,A,F,R,D,N,E,v,C,I]),Y=s(()=>{const e=[];for(let t=0;t<T.length;t++){const n=T[t],r=n.magnitude??Math.sqrt(n.dx*n.dx+n.dy*n.dy);if(r<1e-10)continue;const i=N(n.x),l=E(n.y),a=n.dx*P,s=-n.dy*P,d=i+a,c=l+s;let f;f=m?Zi(r/B,y):h,e.push(o("line",{key:`arrow-line-${t}`,x1:String(i),y1:String(l),x2:String(d),y2:String(c),stroke:f,"stroke-width":String(k),"stroke-linecap":"round"}));const u=Math.sqrt(a*a+s*s);if(u>2){const n=a/u,r=s/u,i=-r,l=n,p=Math.min(4,.4*u),h=d-n*p+i*p*.5,g=c-r*p+l*p*.5,x=d-n*p-i*p*.5,m=c-r*p-l*p*.5;e.push(o("polygon",{key:`arrow-head-${t}`,points:`${d},${c} ${h},${g} ${x},${m}`,fill:f}))}}return e},[T,N,E,P,m,B,y,h]),j=s(()=>b?[o("text",{key:"title",x:String(r/2),y:String(v/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},b)]:[],[b,r,v]),q=_(),O=H(),U=Y(),X=j();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Vector field plot",style:{fontFamily:"sans-serif"}},...X,...q,...O,...U)}function el(e){const{data:t=[],width:n=600,height:r=400,increaseColor:i="#10b981",decreaseColor:l="#ef4444",totalColor:a="#3b82f6",connectorColor:c="#94a3b8",showValues:f=!0,showGrid:u=!0,showConnectors:p=!0,title:h,padding:g=60}=e,x=n-2*g,m=r-2*g,y=d(()=>function(e){const t=[];let n=0;for(let o=0;o<e.length;o++){const r=e[o],i=r.type??(r.value>=0?"increase":"decrease");if("total"===i)t.push({label:r.label,value:n,type:"total",start:0,end:n});else{const e=n;n+=r.value,t.push({label:r.label,value:r.value,type:i,start:e,end:n})}}return t}(t),[t]),{minVal:b,maxVal:v}=d(()=>{let e=0,t=0;for(let n=0;n<y.length;n++){const o=y[n];o.start<e&&(e=o.start),o.end<e&&(e=o.end),o.start>t&&(t=o.start),o.end>t&&(t=o.end)}return e===t&&(t=e+1),{minVal:e,maxVal:t}},[y]),w=v-b,k=s(e=>g+m-(e-b)/w*m,[g,m,b,w]),S=d(()=>0===y.length?0:x/y.length,[y.length,x]),$=Math.max(1,S-6),M=s(()=>{if(!u)return[];const e=function(e){if(e<=0)return 1;const t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),o=t/n;return o<=1.5?n:o<=3.5?2*n:o<=7.5?5*n:10*n}(w),t=[];for(let n=Math.ceil(b/e)*e;n<=v;n+=e){const e=k(n);t.push(o("line",{key:`grid-${n}`,x1:String(g),y1:String(e),x2:String(g+x),y2:String(e),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),t.push(o("text",{key:`grid-label-${n}`,x:String(g-8),y:String(e+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(n)))}return t},[u,w,b,v,k,g,x]),z=s(()=>{const e=[];e.push(o("line",{key:"axis-y",x1:String(g),y1:String(g),x2:String(g),y2:String(g+m),stroke:"#374151","stroke-width":"1.5"}));const t=b<=0&&v>=0?k(0):g+m;return e.push(o("line",{key:"axis-x",x1:String(g),y1:String(t),x2:String(g+x),y2:String(t),stroke:"#374151","stroke-width":"1.5"})),e},[g,x,m,b,v,k]),C=s(()=>{if(0===y.length)return[];const e=[];for(let t=0;t<y.length;t++){const n=y[t],r=g+t*S+3,s=Math.max(n.start,n.end),d=Math.min(n.start,n.end),u=k(s),h=k(d),x=Math.max(0,h-u);let b;if(b="total"===n.type?a:"decrease"===n.type?l:i,e.push(o("rect",{key:`bar-${t}`,x:String(r),y:String(u),width:String($),height:String(x),fill:b,rx:"2",ry:"2"})),f){const i="decrease"===n.type||n.value<0?h+14:u-4,l="total"===n.type?String(n.value):(n.value>=0?"+":"")+String(n.value);e.push(o("text",{key:`val-${t}`,x:String(r+$/2),y:String(i),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},l))}if(e.push(o("text",{key:`cat-${t}`,x:String(r+$/2),y:String(g+m+16),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},n.label)),p&&t<y.length-1){const i=y[t+1],l=k(n.end),a=g+(t+1)*S+3;"total"!==i.type&&e.push(o("line",{key:`conn-${t}`,x1:String(r+$),y1:String(l),x2:String(a),y2:String(l),stroke:c,"stroke-width":"1","stroke-dasharray":"3 2"}))}}return e},[y,S,$,k,i,l,a,c,f,p,g,m]),I=s(()=>h?[o("text",{key:"title",x:String(n/2),y:String(g/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,n,g]),A=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]),F=M(),R=z(),D=C(),L=I(),W=A();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??"Waterfall chart",style:{fontFamily:"sans-serif"}},...L,...F,...R,...D,...W)}const tl=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],nl=[0,-45,45,90];function ol(e,t,n,o,r){const i=.6*t,l=e.length*i,a=t,s=n*Math.PI/180,d=Math.abs(Math.cos(s)),c=Math.abs(Math.sin(s)),f=l*d+a*c,u=l*c+a*d;return{x:o-f/2,y:r-u/2,w:f,h:u}}function rl(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 il(e,t,n){return e.x>=0&&e.y>=0&&e.x+e.w<=t&&e.y+e.h<=n}function ll(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 al(e){const{words:t=[],width:n=600,height:r=400,minFontSize:i=10,maxFontSize:l=64,fontFamily:a="sans-serif",colors:s=tl,rotations:c=nl,padding:f=4,spiral:u="archimedean",title:p}=e,h=d(()=>{if(0===t.length)return[];const e=t.map((e,t)=>({...e,originalIndex:t})).filter(e=>e.text.length>0&&e.weight>0).sort((e,t)=>t.weight-e.weight);if(0===e.length)return[];const o=e[e.length-1].weight,a=e[0].weight-o;function d(e){return 0===a?(i+l)/2:i+(e-o)/a*(l-i)}const p=[],h=n/2,g=r/2;for(let t=0;t<e.length;t++){const o=e[t],i=d(o.weight),l=c[ll(o.text)%c.length],a=o.color??s[t%s.length];let x=!1;const m=500,y="archimedean"===u?4:5;for(let e=0;e<m;e++){let t,s;if("archimedean"===u){const n=.1*e,o=y*n;t=o*Math.cos(n),s=o*Math.sin(n)}else{const n=Math.floor(e/4)+1,o=(e%4==0?0:e)*y;switch(e%4){case 0:t=n*y*4,s=o;break;case 1:t=-o,s=n*y*4;break;case 2:t=-n*y*4,s=-o;break;default:t=o,s=-n*y*4}}const d=h+t,c=g+s,m=ol(o.text,i,l,d,c),b={x:m.x-f,y:m.y-f,w:m.w+2*f,h:m.h+2*f};if(!il(b,n,r))continue;let v=!1;for(const e of p)if(rl(b,e.bbox)){v=!0;break}if(!v){p.push({text:o.text,x:d,y:c,fontSize:i,rotation:l,color:a,bbox:b}),x=!0;break}}}return p},[t,n,r,i,l,s,c,f,u]);if(0===t.length||0===h.length)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 — 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."));const g=[];p&&g.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 e=0;e<h.length;e++){const t=h[e],n=0!==t.rotation?`translate(${t.x},${t.y}) rotate(${t.rotation})`:`translate(${t.x},${t.y})`;g.push(o("text",{key:`word-${e}`,transform:n,"text-anchor":"middle","dominant-baseline":"central","font-size":String(t.fontSize),"font-family":a,fill:t.color,"aria-label":t.text},t.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}},...g)}const sl={0:"#1e293b",1:"#3b82f6"};function dl(e){const{data:t=[],colorMap:n,width:r=600,height:i=600,cellGap:l=1,cellRadius:a=0,showGrid:c=!1,gridColor:f="#334155",showIndices:u=!1,backgroundColor:p="#0f172a",padding:h=10,onCellClick:g,onCellHover:x,title:m}=e,y=n??sl,b=t.length,v=d(()=>{let e=0;for(let n=0;n<t.length;n++){const o=t[n];void 0!==o&&o.length>e&&(e=o.length)}return e},[t]),w=u?20:0,k=m?24:0,S=d(()=>{const e=r-2*h-w,t=i-2*h-w-k;return 0===b||0===v?{cellWidth:0,cellHeight:0}:{cellWidth:Math.max(0,(e-l*(v-1))/v),cellHeight:Math.max(0,(t-l*(b-1))/b)}},[r,i,h,b,v,l,w,k]),$=s(e=>{const t=y[e];return void 0!==t?t:"#666"},[y]),M=s(()=>o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:p}),[r,i,p]),z=s(()=>m?[o("text",{key:"title",x:String(r/2),y:String(h+14),"text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#e2e8f0"},m)]:[],[m,r,h]),C=s(()=>{if(!c||0===b||0===v)return[];const{cellWidth:e,cellHeight:t}=S,n=h+w,r=h+w+k,i=v*e+(v-1)*l,a=b*t+(b-1)*l,s=[];for(let t=0;t<=v;t++){const i=n+t*(e+l)-l/2;s.push(o("line",{key:`vgrid-${t}`,x1:String(i),y1:String(r-l/2),x2:String(i),y2:String(r+a+l/2),stroke:f,"stroke-width":"0.5"}))}for(let e=0;e<=b;e++){const a=r+e*(t+l)-l/2;s.push(o("line",{key:`hgrid-${e}`,x1:String(n-l/2),y1:String(a),x2:String(n+i+l/2),y2:String(a),stroke:f,"stroke-width":"0.5"}))}return s},[c,b,v,S,h,w,k,l,f]),I=s(()=>{if(!u||0===b||0===v)return[];const{cellWidth:e,cellHeight:t}=S,n=h+w,r=h+w+k,i=[];for(let t=0;t<v;t++){const a=n+t*(e+l)+e/2,s=r-6;i.push(o("text",{key:`col-idx-${t}`,x:String(a),y:String(s),"text-anchor":"middle","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(t)))}for(let e=0;e<b;e++){const a=n-6,s=r+e*(t+l)+t/2+3;i.push(o("text",{key:`row-idx-${e}`,x:String(a),y:String(s),"text-anchor":"end","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(e)))}return i},[u,b,v,S,h,w,k,l]),A=s(()=>{if(0===b||0===v)return[];const{cellWidth:e,cellHeight:n}=S,r=h+w,i=h+w+k,s=[];for(let d=0;d<b;d++){const c=t[d];if(void 0!==c)for(let t=0;t<v;t++){const f=t<c.length?c[t]:0,u=r+t*(e+l),p=i+d*(n+l),h=$(f),m={key:`cell-${d}-${t}`,x:String(u),y:String(p),width:String(e),height:String(n),fill:h,rx:String(a),ry:String(a)};if(g){const e=d,n=t,o=f;m.onClick=()=>g(e,n,o),m.role="button",m.tabIndex=0}if(x){const e=d,n=t,o=f;m.onMouseEnter=()=>x(e,n,o)}s.push(o("rect",m))}}return s},[b,v,t,S,h,w,k,l,a,$,g,x]),F=M(),R=z(),D=C(),L=I(),W=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":m?`${m} — ${b}x${v} discrete grid`:`${b}x${v} discrete grid`},F,...R,...D,...L,...W)}export{ut as Accordion,le as Alert,y as AnalogClock,S as Avatar,z as Badge,ln as BarGraph,kr as BigNumber,Ir as BlochSphere,Rr as BoxPlot,ht as Breadcrumb,Nr as BubbleChart,xr as Button,jr as CalendarHeatMap,Oe as Card,ot as Carousel,gn as CartesianGraph2D,me as Checkbox,Vr as ChordDiagram,we as ColorPicker,ke as ColorWheel,bn as ComplexGraph2D,Pt as ContextMenu,B as DataGrid,Ce as DatePicker,Kr as DecompositionTree,q as DigitalClock,dl as DiscreteCartesian2D,Yt as Drawer,xt as Dropdown,ae as EmptyState,Ae as FileUpload,Ue as FlexContainer,Xe as FlexItem,Un as Footer,ti as ForceGraph,he as FormFieldWrapper,oi as FunnelChart,ai as GanttChart,ui as Gauge,On as GoogleAnalytics,Ve as Grid,Ge as GridItem,bi as HeatMap,wi as Histogram,Yn as HypercubeGraph,Oo as IDE,rt as Image,$n as LineGraph,J as ListView,ki as LollipopChart,Ci as Matrix,bt as Menubar,qt as Modal,Fe as MultilineField,at as NavWrapper,Re as NumberSpinner,Mt as Pagination,Ze as Panel,Fi as Partition,In as PieGraph,Ni as PivotTable,Fn as PolarGraph2D,Xt as Popover,se as ProgressBar,Bi as RadarChart,De as RadioGroup,_i as SankeyDiagram,et as ScrollContainer,Le as Select,Ct as Sidebar,de as Skeleton,We as Slider,pe as Spinner,tt as Splitter,It as Stepper,Oi as Sunburst,nt as Tabs,ne as Tag,Te as TextEditor,Be as TextField,wr as ThreeDLayers,He as TimePicker,Jt as ToastContainer,je as Toggle,Rt as Toolbar,tn as Tooltip,dr as TradingDashboard,Gi as TreeMap,Tt as TreeNav,Dt as TreeNode,hi as USStateMap,pi as US_STATE_PATHS,pr as UnityApp,ur as UnityDesktop,Qi as VectorField,lt as VideoPlayer,re as VirtualScroll,qn as VizWrapper,el as WaterfallChart,al as WordCloud,No as WordProcessor,Cr as applyGate,$r as blochToCartesian,ge as buildInputStyle,st as buildNavItemStyle,Ln as buildRotationMatrix,Mr as cartesianToBloch,Fr as computeBoxStats,yn as computeMandelbrotGrid,Cn as computeSlices,Gt as createToaster,zn as describeArc,Dn as generateEdges,Pn as generateHypercube,Hn as generatePalette,Rn as generateVertices,_n as numRotationAngles,Bn as projectTo2D,Tn as transformVec,nn as useBarGraphScales,dt as useHover,jn as useHypercube,wn as useLineGraphScales,Qt as useToast};
|
|
2
2
|
//# sourceMappingURL=specifyjs-components.esm.js.map
|