@asymmetric-effort/specifyjs 0.2.15 → 0.2.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/specifyjs-build.cjs.js +1 -1
- package/dist/specifyjs-build.cjs.js.map +1 -1
- package/dist/specifyjs-build.d.ts +5 -6
- package/dist/specifyjs-build.esm.js +1 -1
- package/dist/specifyjs-build.esm.js.map +1 -1
- package/dist/specifyjs-components.cjs.js +1 -1
- package/dist/specifyjs-components.cjs.js.map +1 -1
- package/dist/specifyjs-components.d.ts +1056 -2
- package/dist/specifyjs-components.esm.js +1 -1
- package/dist/specifyjs-components.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=Symbol.for("spec.element"),t=Symbol.for("spec.provider"),o=Symbol.for("spec.consumer");function n(t,o,...n){let r=null,i=null;const l={};if(null!=o){void 0!==o.key&&(r=""+o.key),void 0!==o.ref&&(i=o.ref);for(const e in o)Object.prototype.hasOwnProperty.call(o,e)&&"key"!==e&&"ref"!==e&&"__proto__"!==e&&"constructor"!==e&&"prototype"!==e&&(l[e]=o[e])}if(1===n.length?l.children=n[0]:n.length>1&&(l.children=n),"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 n={$$typeof:Symbol.for("spec.context"),Provider:null,Consumer:null,_currentValue:e,_defaultValue:e},r={$$typeof:t,_context:n},i={$$typeof:o,_context:n};return n.Provider=r,n.Consumer=i,n}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 p(){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 f=new Set;function g(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),o=e=>Number(t.find(t=>t.type===e)?.value??0);return new Date(o("year"),o("month")-1,o("day"),o("hour"),o("minute"),o("second"))}"undefined"!=typeof window&&window.addEventListener("hashchange",function(){u(),"undefined"!=typeof window&&window.location.hash;for(const e of f)e()}),r({flags:{},isEnabled:()=>!1,setFlag:()=>{},loading:!1});const x="#334155",h="#1e293b",b="#374151",m={xs:24,sm:32,md:40,lg:56,xl:80},y=["#3b82f6","#ef4444","#22c55e","#a855f7","#f97316","#ec4899","#14b8a6","#6366f1","#eab308","#06b6d4"],v={online:"#22c55e",offline:"#9ca3af",busy:"#ef4444",away:"#eab308"};function k(e,t){const o=-t/4+"px";switch(e){case"top-left":return{top:o,left:o};case"bottom-right":return{bottom:o,right:o};case"bottom-left":return{bottom:o,left:o};default:return{top:o,right:o}}}const S={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"}},w={sm:{width:"6px",height:"6px"},md:{width:"8px",height:"8px"},lg:{width:"10px",height:"10px"}},C={width:"100%",borderCollapse:"collapse",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",color:"#1f2937"},$={padding:"10px 12px",textAlign:"left",fontWeight:"600",backgroundColor:"#f9fafb",borderBottom:"2px solid #e5e7eb",userSelect:"none",whiteSpace:"nowrap"},z={padding:"10px 12px",borderBottom:"1px solid #e5e7eb"},M={marginLeft:"4px",fontSize:"12px",color:"#6b7280"},I={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"},F={padding:"4px 10px",margin:"0 2px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#fff",cursor:"pointer",fontSize:"13px"},R={...F,backgroundColor:"#3b82f6",color:"#fff",borderColor:"#3b82f6"},L={...F,opacity:"0.5",cursor:"default"},A={cursor:"pointer",width:"16px",height:"16px"};function T(e,t,o){return e!==t?"↕":"asc"===o?"↑":"↓"}function E(e){return e<10?`0${e}`:String(e)}const W={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"},B={fontSize:"2rem",fontWeight:"600",letterSpacing:"2px",lineHeight:"1"},N={fontSize:"0.875rem",fontWeight:"400",marginLeft:"4px",verticalAlign:"super"},P={fontSize:"0.75rem",color:"#94a3b8",marginTop:"4px"},H={listStyle:"none",margin:"0",padding:"0",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px"},j={padding:"10px 14px",color:"var(--color-text, #1f2937)"},_={borderBottom:"1px solid var(--color-border, #e5e7eb)"},q={cursor:"pointer",transition:"background-color 0.15s ease"},O={backgroundColor:"var(--color-bg-muted, #eff6ff)"},Y={padding:"24px",textAlign:"center",color:"var(--color-text-muted, #9ca3af)",fontSize:"14px"},U={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 G(e,t){const o=/^#?([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 o?`rgba(${parseInt(o[1],16)}, ${parseInt(o[2],16)}, ${parseInt(o[3],16)}, ${t})`:e}const X={sm:{fontSize:"11px",padding:"2px 8px",gap:"4px"},md:{fontSize:"13px",padding:"4px 10px",gap:"6px"},lg:{fontSize:"15px",padding:"6px 14px",gap:"8px"}},K={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"},V={overflow:"auto",position:"relative",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},J={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 Z(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 Q={sm:16,md:24,lg:40},ee={slow:"1.2s",normal:"0.75s",fast:"0.45s"};function te(e){const t=e.styling??{},o=!!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:o?t.errorColor??"#ef4444":t.helpColor??"#6b7280",marginTop:"2px"};return n("div",{className:`form-field ${o?"form-field--error":""} ${e.className??""}`.trim(),style:r},e.label?n("label",{htmlFor:e.htmlFor,style:i},e.label,e.required?n("span",{style:{color:t.errorColor??"#ef4444",marginLeft:"2px"}},"*"):null):null,e.children,e.error?n("div",{className:"form-field__error",style:l,role:"alert"},e.error):e.helpText?n("div",{className:"form-field__help",style:l},e.helpText):null)}function oe(e,t){const o=t.error?e.errorBorderColor??"#ef4444":t.focused?e.focusBorderColor??"#3b82f6":void 0;return{padding:e.padding??"8px 12px",border:o?`1px solid ${o}`: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&&o?{boxShadow:`0 0 0 3px ${o}22`}:{},...e.custom??{}}}const ne={sm:{box:14,icon:10,fontSize:"12px"},md:{box:18,icon:12,fontSize:"14px"},lg:{box:22,icon:16,fontSize:"16px"}},re=["#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 ie(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e)}function le(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()}const ae=["January","February","March","April","May","June","July","August","September","October","November","December"],se=["Su","Mo","Tu","We","Th","Fr","Sa"];function de(e){if(!e)return null;if(e instanceof Date)return e;const t=new Date(e);return isNaN(t.getTime())?null:t}function ce(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function pe(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]}`}const ue=["bold","italic","underline","strikethrough","heading1","heading2","bulletList","orderedList","blockquote","link","unlink","insertHR","removeFormat","undo","redo"],fe={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"}},ge=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Paris","Asia/Tokyo"];function xe(e){return String(e).padStart(2,"0")}const he={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}},be={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)"},me={none:"none",sm:"0 1px 3px rgba(0,0,0,0.12)",md:"0 4px 6px rgba(0,0,0,0.1)"};function ye(e,t){return"both"===e?"auto":"horizontal"===e?"x"===t?"auto":"hidden":"y"===t?"auto":"hidden"}function ve(e){switch(e){case"never":return{scrollbarWidth:"none"};case"always":case"hover":return{scrollbarWidth:"thin"};default:return{scrollbarWidth:"auto"}}}function ke(e){return!isFinite(e)||e<0?"0:00":`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,"0")}`}function Se(e){const t=e.orientation??"vertical",o=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 o=e,n=l.current;if(!n)return;const i=Array.from(n.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(o.key===d){o.preventDefault();const e=i[a+1];e&&e.focus()}else if(o.key===c){o.preventDefault();const e=i[a-1];e&&e.focus()}else"Home"===o.key?(o.preventDefault(),i[0]?.focus()):"End"===o.key&&(o.preventDefault(),i[i.length-1]?.focus())},[r,t]);return n("nav",{ref:l,role:o,"aria-label":e.ariaLabel??void 0,"aria-orientation":t,className:`nav-wrapper ${e.className??""}`.trim(),style:a,onKeyDown:d},e.children)}function we(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 Ce(){const[e,t]=l(!1);return{hover:e,onMouseEnter:s(()=>t(!0),[]),onMouseLeave:s(()=>t(!1),[])}}function $e(e){const{section:t,expanded:o,onToggle:r,headerStyle:i,expandIcon:l,collapseIcon:a,iconPosition:d}=e,{hover:c,onMouseEnter:p,onMouseLeave:u}=Ce(),f=!0===t.disabled,g={display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",boxSizing:"border-box",padding:i.padding??"12px 16px",backgroundColor:f?"#f9fafb":c?i.hoverBackground??"#f3f4f6":i.backgroundColor??"transparent",color:f?"#9ca3af":i.color??"inherit",fontWeight:i.fontWeight??"600",fontSize:i.fontSize??"inherit",border:"none",outline:"none",cursor:f?"not-allowed":"pointer",font:"inherit",textAlign:"left",transition:"background-color 0.15s",...i.borderBottom?{borderBottom:i.borderBottom}:{}};"left"===d&&(g.flexDirection="row");const x=s(e=>{const t=e;f||"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),r())},[f,r]),h=s(()=>{f||r()},[f,r]),b=n("span",{"aria-hidden":"true",style:{display:"inline-block",transition:"transform 0.2s ease",transform:o?"rotate(180deg)":"rotate(0deg)",flexShrink:"0",marginLeft:"right"===d?"auto":"0",marginRight:"left"===d?"8px":"0",paddingLeft:"right"===d?"8px":"0"}},o?a:l),m=t.icon?n("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},n("span",{"aria-hidden":"true"},t.icon),t.header):t.header,y="left"===d?[b,m]:[m,b];return n("button",{id:`accordion-header-${t.id}`,role:"button","aria-expanded":String(o),"aria-controls":`accordion-panel-${t.id}`,"aria-disabled":f?"true":void 0,"data-section-id":t.id,tabIndex:f?-1:0,style:g,onClick:h,onKeyDown:x,onMouseEnter:p,onMouseLeave:u},...y)}function ze(e){const{section:t,expanded:o,contentStyle:r,animated:i}=e,l={overflow:"hidden",boxSizing:"border-box",...i?{maxHeight:o?"2000px":"0",transition:"max-height 0.3s ease"}:{display:o?"block":"none"}},a={padding:r.padding??"12px 16px",backgroundColor:r.backgroundColor??"transparent",...r.borderBottom?{borderBottom:r.borderBottom}:{}};return n("div",{id:`accordion-panel-${t.id}`,role:"region","aria-labelledby":`accordion-header-${t.id}`,"aria-hidden":String(!o),"data-section-content":t.id,style:l},n("div",{style:a},t.content))}const Me={sm:{fontSize:"12px",padding:"4px 0"},md:{fontSize:"14px",padding:"6px 0"},lg:{fontSize:"16px",padding:"8px 0"}};function Ie(e){const{item:t,itemStyle:o,closeOnSelect:r,onClose:i}=e,{hover:a,onMouseEnter:d,onMouseLeave:c}=Ce(),[p,u]=l(!1),f=t.children&&t.children.length>0;if(t.divider)return n("div",{role:"separator",style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});const g=!0===t.disabled,x={...we(o,{hover:!g&&a,active:!1}),position:"relative",justifyContent:"space-between",...g?{color:"#9ca3af",cursor:"default",opacity:"0.6"}:{}},h=s(()=>{g||(f?u(e=>!e):(t.onClick&&t.onClick(),r&&i()))},[g,f,t,r,i]),b=s(()=>{d(),f&&u(!0)},[f,d]),m=s(()=>{c(),f&&u(!1)},[f,c]),y=n("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},t.icon?n("span",{style:{flexShrink:"0"},"aria-hidden":"true"},t.icon):null,n("span",null,t.label)),v=f?n("span",{style:{marginLeft:"8px",fontSize:"10px",lineHeight:"1"},"aria-hidden":"true"},"›"):null,k=f&&p?n("div",{style:{position:"absolute",left:"100%",top:"0",zIndex:"1000"}},n(Se,{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=>n(Ie,{key:e.id,item:e,itemStyle:o,closeOnSelect:r,onClose:i})))):null;return n("div",{style:{position:"relative"},onMouseEnter:b,onMouseLeave:m},n("button",{type:"button",role:"menuitem",style:x,onClick:h,disabled:g||void 0,tabIndex:g?-1:0,"aria-disabled":g?"true":void 0,"aria-haspopup":f||void 0,"aria-expanded":f?String(p):void 0},y,v),k)}function De(e){const{item:t,onClose:o,index:r}=e,{hover:i,onMouseEnter:a,onMouseLeave:d}=Ce(),[c,p]=l(!1),u=t.children&&t.children.length>0;if(t.divider)return n("div",{role:"separator",style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});const f=!0===t.disabled,g=s(()=>{f||(u?p(e=>!e):(t.onClick&&t.onClick(),o()))},[f,u,t,o]),x=s(()=>{a(),u&&p(!0)},[u,a]),h=s(()=>{d(),u&&p(!1)},[u,d]),b={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 16px",fontSize:"13px",fontFamily:"inherit",border:"none",outline:"none",width:"100%",textAlign:"left",cursor:f?"default":"pointer",backgroundColor:!f&&i?"#f3f4f6":"transparent",color:f?"#9ca3af":"#1f2937",opacity:f?"0.6":"1",transition:"background-color 0.1s",boxSizing:"border-box"},m=n("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},t.icon?n("span",{style:{width:"16px",textAlign:"center"},"aria-hidden":"true"},t.icon):n("span",{style:{width:"16px"}}),n("span",null,t.label)),y=u?n("span",{style:{fontSize:"10px",color:"#9ca3af"},"aria-hidden":"true"},"▶"):t.shortcut?n("span",{style:{fontSize:"11px",color:"#9ca3af",marginLeft:"24px"}},t.shortcut):null,v=u&&c?n("div",{style:{position:"absolute",left:"100%",top:"0",zIndex:"1001"}},n("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)=>n(De,{key:String(t),item:e,onClose:o,index:t})))):null;return n("div",{style:{position:"relative"},onMouseEnter:x,onMouseLeave:h},n("button",{type:"button",role:"menuitem",style:b,onClick:g,disabled:f||void 0,tabIndex:-1,"aria-disabled":f||void 0,"aria-haspopup":u||void 0,"aria-expanded":u?c:void 0},m,y),v)}function Fe(e){const{menu:t,index:o,isOpen:r,anyOpen:i,onOpen:l,onClose:a}=e,{hover:d,onMouseEnter:p,onMouseLeave:u}=Ce(),f=c(null),g=s(()=>{r?a():l(o)},[r,o,l,a]),x=s(()=>{p(),i&&!r&&l(o)},[i,r,o,l,p]),h={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"},b=r?n("div",{style:{position:"absolute",top:"100%",left:"0",zIndex:"1000",marginTop:"2px"}},n("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)=>n(De,{key:String(t),item:e,onClose:a,index:t})))):null;return n("div",{style:{position:"relative",display:"inline-block"},onMouseEnter:x,onMouseLeave:u},n("button",{ref:f,type:"button",role:"menuitem",style:h,onClick:g,"aria-haspopup":"true","aria-expanded":String(r),tabIndex:0},t.label),b)}function Re(e,t){const o=[];for(let n=e;n<=t;n++)o.push(n);return o}const Le={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"},Ae={...Le,backgroundColor:"#2563eb",color:"#ffffff",borderColor:"#2563eb",fontWeight:"600"},Te={...Le,color:"#9ca3af",cursor:"default",opacity:"0.5"},Ee={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"36px",height:"36px",color:"#6b7280",fontSize:"14px",userSelect:"none"};function We(e){const{item:t,collapsed:o,selectedId:r,onSelect:i,depth:a}=e,{hover:d,onMouseEnter:c,onMouseLeave:p}=Ce(),[u,f]=l(!1),g=t.children&&t.children.length>0,x=t.id===r,h=s(()=>{g&&!o&&f(e=>!e),i&&i(t.id)},[g,o,i,t.id]),b={display:"flex",alignItems:"center",padding:o?"10px 0":"10px 12px 10px "+(o?"0":16+16*a+"px"),justifyContent:o?"center":"flex-start",cursor:"pointer",backgroundColor:x?"#eff6ff":d?"#f3f4f6":"transparent",color:x?"#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"},m=t.icon?n("span",{style:{flexShrink:"0",fontSize:"16px"},"aria-hidden":"true"},t.icon):null,y=o?null:n("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.label),v=!o&&t.badge?n("span",{style:{backgroundColor:"#ef4444",color:"#ffffff",fontSize:"11px",fontWeight:"600",padding:"1px 6px",borderRadius:"10px",marginLeft:"4px",flexShrink:"0"}},t.badge):null,k=!o&&g?n("span",{style:{fontSize:"10px",transition:"transform 0.15s",transform:u?"rotate(90deg)":"rotate(0deg)",marginLeft:"4px"},"aria-hidden":"true"},"▶"):null,S=o&&d?n("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,w=n("button",{type:"button",style:b,onClick:h,onMouseEnter:c,onMouseLeave:p,"aria-selected":x?"true":"false",title:o?t.label:void 0},m,y,v,k,S),C=!o&&g&&u?t.children.map(e=>n(We,{key:e.id,item:e,collapsed:o,selectedId:r,onSelect:i,depth:a+1})):null;return n("div",{key:t.id,style:{position:"relative"}},w,C?n("div",{role:"group"},...C):null)}const Be={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 Ne(e){const{item:t,size:o,variant:r}=e,{hover:i,onMouseEnter:a,onMouseLeave:d}=Ce(),c=Be[o],p=!0===t.disabled,u="toggle"===t.type,[f,g]=l(!1),x=u?!0===t.active:f,h=s(()=>{!p&&t.onClick&&t.onClick()},[p,t]),b=s(()=>{p||u||g(!0)},[p,u]),m=s(()=>{u||g(!1)},[u]),y=s(()=>{d(),u||g(!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:x?"#e0e7ff":!p&&i?"#f3f4f6":"raised"===r?"#ffffff":"transparent",color:p?"#9ca3af":x?"#2563eb":"#374151",cursor:p?"default":"pointer",opacity:p?"0.5":"1",outline:"none",transition:"background-color 0.15s"},k=t.icon?n("span",{style:{fontSize:c.iconSize},"aria-hidden":"true"},t.icon):null,S=t.label?n("span",null,t.label):null,w="dropdown"===t.type?n("span",{style:{fontSize:"10px",marginLeft:"2px"},"aria-hidden":"true"},"▼"):null;return n("button",{type:"button",style:v,onClick:h,onMouseDown:b,onMouseUp:m,onMouseEnter:a,onMouseLeave:y,disabled:p||void 0,"aria-pressed":u?x:void 0,"aria-label":t.label||t.id,title:t.label||t.id},k,S,w)}class Pe{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 Pe(e,this))}static fromData(e){return new Pe(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 o=t.find(e);if(o)return o}return null}toggle(){this.expanded=!this.expanded}expand(){this.expanded=!0}collapse(){this.expanded=!1}addChild(e){const t=new Pe(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 He(e){e.expanded=!0;for(const t of e.children)He(t)}function je(e,t=[]){if(t.push(e),e.expanded)for(const o of e.children)je(o,t);return t}function _e(e){if(!e.parent)return!0;const t=e.parent.children;return t[t.length-1]===e}function qe(e){const{node:t,isSelected:o,indentPx:r,lineColor:i,lineWidth:l,iconExpanded:s,iconCollapsed:d,nodeStyle:p,renderNode:u,onToggle:f,onClick:g,focusedId:x}=e,h=Ce(),b=c(null),m=x===t.id;a(()=>{m&&b.current&&b.current.focus()},[m]);const y=t.isLeaf(),v=t.depth,k=[];for(let e=0;e<v;e++){let o=t;for(let t=0;t<v-e;t++)o=o?o.parent:null;const a=!!o&&!_e(o);k.push(n("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 S=v>0?n("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,w=y?n("span",{"aria-hidden":"true",style:{display:"inline-block",width:"18px",flexShrink:"0",marginRight:"4px"}}):n("span",{"aria-hidden":"true",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(),f(t)}},t.expanded?s:d),C=u?u(t,o):n("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.icon?n("span",{style:{marginRight:"6px"}},t.icon):null,t.label),$=we(p,{hover:h.hover,active:o});return n("div",{ref:b,role:"treeitem","aria-expanded":y?void 0:String(t.expanded),"aria-selected":o?"true":"false","aria-level":v+1,tabIndex:m?0:-1,style:{...$,display:"flex",alignItems:"stretch",padding:"0"},onMouseEnter:h.onMouseEnter,onMouseLeave:h.onMouseLeave,onClick:()=>g(t)},...k,S,n("span",{style:{display:"flex",alignItems:"center",flex:"1",padding:p.padding??"6px 10px",minWidth:"0"}},w,C))}function Oe(e){const{items:t,position:o,onClose:r,depth:i}=e,[s,d]=l(-1),[p,u]=l(null),f=c(null);a(()=>{if(!f.current)return;f.current.focus();const e=e=>{const o=e,n=t.map((e,t)=>({item:e,i:t})).filter(({item:e})=>!e.divider);if("ArrowDown"===o.key)o.preventDefault(),d(e=>{const t=(n.findIndex(({i:t})=>t===e)+1)%n.length;return n[t].i});else if("ArrowUp"===o.key)o.preventDefault(),d(e=>{const t=n.findIndex(({i:t})=>t===e),o=t<=0?n.length-1:t-1;return n[o].i});else if("ArrowRight"===o.key)s>=0&&t[s]?.children&&u(s);else if("ArrowLeft"===o.key)i>0&&r();else if("Enter"===o.key){if(o.preventDefault(),s>=0){const e=t[s];e.children?u(s):!e.disabled&&e.onClick&&(e.onClick(),r())}}else"Escape"===o.key&&r()};f.current.addEventListener("keydown",e);const o=f.current;return()=>o.removeEventListener("keydown",e)},[t,s,i,r]);const g={position:"fixed",left:`${o.x}px`,top:`${o.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"},x=t.map((e,t)=>{if(e.divider)return n("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),f={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"},g=[];e.icon&&g.push(n("span",{style:{width:"20px",textAlign:"center",flexShrink:"0"}},e.icon)),g.push(n("span",{style:{flex:"1"}},e.label??"")),c&&g.push(n("span",{style:{fontSize:"10px",color:"#9ca3af",marginLeft:"8px"}},"▶"));const x=[n("div",{key:`item-${t}`,style:f,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},...g)];return c&&p===t&&x.push(n(Oe,{key:`submenu-${t}`,items:e.children,position:{x:o.x+178,y:o.y+36*t},onClose:()=>u(null),depth:i+1})),n("div",{key:`wrap-${t}`,style:{position:"relative"}},...x)});return n("div",{ref:f,style:g,tabIndex:-1,role:"menu"},...x)}function Ye(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 Ue(e,t){const o={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{...o,top:"0",left:"0",bottom:"0",width:t};case"right":return{...o,top:"0",right:"0",bottom:"0",width:t};case"top":return{...o,top:"0",left:"0",right:"0",height:t};case"bottom":return{...o,bottom:"0",left:"0",right:"0",height:t}}}const Ge={sm:"400px",md:"600px",lg:"800px",full:"100vw"};function Xe(e,t){const o=t+8;switch(e){case"top":return{position:"absolute",bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:`${o}px`};case"bottom":return{position:"absolute",top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:`${o}px`};case"left":return{position:"absolute",right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:`${o}px`};case"right":return{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:`${o}px`}}}function Ke(e){const t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},o="8px",n="transparent";switch(e){case"top":return{...t,bottom:`-${o}`,left:"50%",transform:"translateX(-50%)",borderWidth:`${o} ${o} 0 ${o}`,borderColor:`#fff ${n} ${n} ${n}`};case"bottom":return{...t,top:`-${o}`,left:"50%",transform:"translateX(-50%)",borderWidth:`0 ${o} ${o} ${o}`,borderColor:`${n} ${n} #fff ${n}`};case"left":return{...t,right:`-${o}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${o} 0 ${o} ${o}`,borderColor:`${n} ${n} ${n} #fff`};case"right":return{...t,left:`-${o}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${o} ${o} ${o} 0`,borderColor:`${n} #fff ${n} ${n}`}}}let Ve=0;function Je(e={}){const t={position:e.position??"top-right",maxToasts:e.maxToasts??5,defaultDuration:e.defaultDuration??4e3};let o=[];const n=new Set;function r(){n.forEach(e=>e())}return{toast:function(e,n={}){const i=`toast-${++Ve}-${Date.now()}`,l={id:i,message:e,type:n.type??"info",duration:n.duration??t.defaultDuration,action:n.action,createdAt:Date.now()};return o=[l,...o].slice(0,t.maxToasts),r(),i},dismiss:function(e){o=o.filter(t=>t.id!==e),r()},dismissAll:function(){o=[],r()},subscribe:e=>(n.add(e),()=>{n.delete(e)}),getToasts:()=>o,config:t}}const Ze={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 Qe(e){const{item:t,onDismiss:o}=e,r=Ze[t.type];a(()=>{if(t.duration<=0)return;const e=setTimeout(()=>o(t.id),t.duration);return()=>clearTimeout(e)},[t.id,t.duration,o]);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=[n("span",null,r.icon),n("span",{style:{flex:"1",fontSize:"14px",color:"#1f2937",lineHeight:"1.4"}},t.message)];return t.action&&s.push(n("button",{type:"button",style:l,onClick:t.action.onClick},t.action.label)),s.push(n("button",{type:"button",style:{background:"none",border:"none",cursor:"pointer",fontSize:"16px",color:"#9ca3af",padding:"2px 6px",lineHeight:"1",flexShrink:"0"},onClick:()=>o(t.id),"aria-label":"Dismiss toast"},"×")),n("div",{style:i,role:"alert"},...s)}function et(e){const{toaster:t}=e,[,o]=l(0);a(()=>t.subscribe(()=>o(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"},o=e.startsWith("top"),n=e.startsWith("bottom"),r=e.endsWith("left"),i=e.endsWith("right"),l=e.endsWith("center");return o&&(t.top="0"),n&&(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=>n(Qe,{key:e.id,item:e,onDismiss:d}));return n("div",{style:i},...c)}function tt(e){const t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},o="6px",n="transparent",r="#1f2937";switch(e){case"top":return{...t,bottom:`-${o}`,left:"50%",transform:"translateX(-50%)",borderWidth:`${o} ${o} 0 ${o}`,borderColor:`${r} ${n} ${n} ${n}`};case"bottom":return{...t,top:`-${o}`,left:"50%",transform:"translateX(-50%)",borderWidth:`0 ${o} ${o} ${o}`,borderColor:`${n} ${n} ${r} ${n}`};case"left":return{...t,right:`-${o}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${o} 0 ${o} ${o}`,borderColor:`${n} ${n} ${n} ${r}`};case"right":return{...t,left:`-${o}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${o} ${o} ${o} 0`,borderColor:`${n} ${r} ${n} ${n}`}}}function ot(e,t,o,n,r){return d(()=>{const i=Math.max(1,(n-r*(e+1))/e);return{valueScale:e=>0===t?0:e/t*o,categoryScale:e=>r+e*(i+r),barThickness:i,maxValue:t,valueAxisLength:o,categoryAxisLength:n}},[e,t,o,n,r])}const nt=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function rt(e,t){return t||nt[e%nt.length]}function it(e){const{start:t,end:o,step:n}=e;if(n<=0||!isFinite(n))return[];const r=Math.ceil((o-t)/n)+1;if(r>1e6)return[];const i=[];for(let e=0;e<r;e++){const r=t+e*n;if(r>o+.001*n)break;i.push(r)}return i}function lt(e,t){const o=[];for(let n=0;n<t.length;n++){const r=t[n],i=e(r);isFinite(i)&&o.push({input:r,output:i})}return o}function at(e,t,o,n){let r=!1,i=0;const l=[],a=()=>{if(r)return;const s=Math.min(i+o,t.length);for(let o=i;o<s;o++){const n=t[o],r=e(n);isFinite(r)&&l.push({input:n,output:r})}i=s,i>=t.length?n(l,!0):(n(l,!1),st(a))};return st(a),()=>{r=!0}}function st(e){"function"==typeof requestIdleCallback?requestIdleCallback(()=>e(),{timeout:16}):setTimeout(e,0)}function dt(e,t){const o=t-e;if(o<=0)return[e];const n=function(e){const t=e/8,o=Math.pow(10,Math.floor(Math.log10(t))),n=t/o;return(n<1.5?1:n<3?2:n<7?5:10)*o}(o),r=[];for(let o=Math.ceil(e/n)*n;o<=t+.001*n;o+=n)r.push(Math.round(1e10*o)/1e10);return r}function ct(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}const pt=40,ut=1e6;function ft(e,t,o){let n=0,r=0;for(let i=0;i<o;i++){const o=n*n,l=r*r;if(o+l>4)return i;r=2*n*r+t,n=o-l+e}return o}function gt(e,t,o){if(e===t)return[0,0,0];const n=e/t;if("fire"===o)return[Math.floor(255*Math.min(1,3*n)),Math.floor(255*Math.max(0,3*n-1)),Math.floor(255*Math.max(0,3*n-2))];if("ocean"===o)return[Math.floor(255*n*.3),Math.floor(255*n*.6),Math.floor(255*(.4+.6*n))];const r=360*n%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 xt(e,t,o){if(e===t)return[e];const n=(t-e)/(o-1),r=[];for(let t=0;t<o;t++){const o=e+n*t;r.push(Math.round(1e10*o)/1e10)}return r}function ht(e,t,o,n){return d(()=>function(e,t,o,n){if(0===e.length)return{xScale:()=>n,yScale:()=>o-n,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*n,d=o-2*n;return{xScale:e=>n+(e-r)/(i-r)*s,yScale:e=>o-n-(e-l)/(a-l)*d,xTicks:xt(r,i,6),yTicks:xt(l,a,6),xMin:r,xMax:i,yMin:l,yMax:a}}(e,t,o,n),[e,t,o,n])}function bt(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function mt(e,t,o,r,i,l,a){const s={fill:i,key:l,...a};switch(e){case"square":return n("rect",{...s,x:t-r,y:o-r,width:2*r,height:2*r});case"diamond":{const e=`${t},${o-r} ${t+r},${o} ${t},${o+r} ${t-r},${o}`;return n("polygon",{...s,points:e})}case"triangle":{const e=`${t},${o-1.15*r} ${t+r},${o+.6*r} ${t-r},${o+.6*r}`;return n("polygon",{...s,points:e})}case"triangle-down":{const e=`${t-r},${o-.6*r} ${t+r},${o-.6*r} ${t},${o+1.15*r}`;return n("polygon",{...s,points:e})}case"cross":{const e=.35*r;return n("path",{...s,fill:"none",stroke:i,"stroke-width":String(2*e),"stroke-linecap":"round",d:`M${t-r},${o-r}L${t+r},${o+r}M${t+r},${o-r}L${t-r},${o+r}`})}case"plus":{const e=.35*r;return n("path",{...s,fill:"none",stroke:i,"stroke-width":String(2*e),"stroke-linecap":"round",d:`M${t},${o-r}L${t},${o+r}M${t-r},${o}L${t+r},${o}`})}default:return n("circle",{...s,cx:t,cy:o,r:r})}}function yt(e,t,o,n){return{x:e+o*Math.cos(n),y:t+o*Math.sin(n)}}function vt(e,t,o,n,r,i){const l=r-Math.PI/2,a=i-Math.PI/2,s=yt(e,t,n,l),d=yt(e,t,n,a),c=i-r>Math.PI?1:0;if(o<=0)return[`M ${e} ${t}`,`L ${s.x} ${s.y}`,`A ${n} ${n} 0 ${c} 1 ${d.x} ${d.y}`,"Z"].join(" ");const p=yt(e,t,o,a),u=yt(e,t,o,l);return[`M ${s.x} ${s.y}`,`A ${n} ${n} 0 ${c} 1 ${d.x} ${d.y}`,`L ${p.x} ${p.y}`,`A ${o} ${o} 0 ${c} 0 ${u.x} ${u.y}`,"Z"].join(" ")}function kt(e,t){const o=t?.padAngle??0,n=function(e,t){const o=t??function(e){const t=[];for(let o=0;o<e;o++){const n=Math.round(360*o/e);t.push(`hsl(${n}, 70%, 55%)`)}return t}(e.length);return e.map((e,t)=>e.color??o[t%o.length])}(e,t?.colors),r=e.reduce((e,t)=>e+t.value,0);if(r<=0)return[];const i=o*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+o/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:n[t]}),s=c+o/2}return a}function St(e,t,o,n,r){return{x:o+e*Math.cos(t)*r,y:n-e*Math.sin(t)*r}}function wt(e){const t=1<<e,o=[];for(let n=0;n<t;n++){const t=[];for(let o=0;o<e;o++)t.push(2*(n>>o&1)-1);o.push({coords:t})}return o}function Ct(e){const t=1<<e,o=[];for(let n=0;n<t;n++)for(let t=0;t<e;t++){const e=n^1<<t;e>n&&o.push({source:n,target:e})}return o}function $t(e,t){let o=zt(e),n=0;for(let r=0;r<e;r++)for(let i=r+1;i<e;i++)n<t.length&&(o=It(o,Mt(e,r,i,t[n]))),n++;return o}function zt(e){const t=[];for(let o=0;o<e;o++){const n=new Array(e).fill(0);n[o]=1,t.push(n)}return t}function Mt(e,t,o,n){const r=zt(e),i=Math.cos(n),l=Math.sin(n);return r[t][t]=i,r[t][o]=-l,r[o][t]=l,r[o][o]=i,r}function It(e,t){const o=e.length,n=[];for(let r=0;r<o;r++){const i=new Array(o).fill(0);for(let n=0;n<o;n++)for(let l=0;l<o;l++)i[n]+=e[r][l]*t[l][n];n.push(i)}return n}function Dt(e,t){const o=e.length,n=new Array(o).fill(0);for(let r=0;r<o;r++)for(let i=0;i<o;i++)n[r]+=e[r][i]*t.coords[i];return n}function Ft(e,t=0){const o=e[0]??0,n=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:o*e,y:n*e,depth:r}}return{x:o,y:n,depth:r}}function Rt(e,t=[],o=.3,n=1){const r=wt(e),i=Ct(e),l=$t(e,t);return{vertices:r.map((e,t)=>{const r=Ft(Dt(l,e),o);return{id:t,position:e,x:r.x*n,y:r.y*n,depth:r.depth}}),edges:i,dimension:e}}function Lt(e){return e*(e-1)/2}function At(e,t=70,o=55){const n=[];for(let r=0;r<e;r++){const i=Math.round(360*r/e);n.push(`hsl(${i}, ${t}%, ${o}%)`)}return n}const Tt=[{letter:"F",color:"#3465a4",label:"Files"},{letter:"W",color:"#e67e22",label:"Browser"},{letter:"T",color:"#2ecc71",label:"Terminal"},{letter:"M",color:"#3498db",label:"Mail"},{letter:"N",color:"#e74c3c",label:"Music"},{letter:"P",color:"#9b59b6",label:"Photos"},{letter:"S",color:"#f39c12",label:"Software"},{letter:"G",color:"#7f8c8d",label:"Settings"}],Et=["🔊","📶","🔋"];let Wt=1;const Bt=["File","Edit","View","Insert","Format","Tools","Help"],Nt={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"}]},Pt=[{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"}}],Ht=[{label:"Align left",text:"≡",command:"justifyLeft"},{label:"Align center",text:"≣",command:"justifyCenter"},{label:"Align right",text:"≢",command:"justifyRight"}],jt=["1","2","3","4","5","6","7"],_t={1:"8",2:"10",3:"12",4:"14",5:"18",6:"24",7:"36"};function qt(e){return e.trim().split(/\s+/).filter(e=>e.length>0).length}const Ot=["File","Edit","Selection","View","Go","Run","Terminal","Help"],Yt={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"}]},Ut=[{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}],Gt={"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"]',"}"]},Xt=Gt["App.ts"],Kt=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"]),Vt=new Set(["string","number","boolean","void","null","undefined","any","never","unknown","object","interface","type","enum"]),Jt="#569cd6",Zt="#d4d4d4",Qt=[{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]}],eo=[{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}],to=[{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}],oo=[{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}],no=[{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}],ro=[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],io=[{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}],lo=[{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}],ao=["09:30","10:00","10:30","11:00","11:30","12:00"];function so(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function co(e){return e.toFixed(2)}const po={backgroundColor:"#1a1a2e",borderRadius:"4px",padding:"12px",border:"1px solid #2a2a4a",overflow:"auto",display:"flex",flexDirection:"column"},uo={fontSize:"12px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#8888aa",marginBottom:"8px",flexShrink:"0"},fo={width:"100%",borderCollapse:"collapse",fontSize:"12px"},go={textAlign:"left",padding:"4px 6px",borderBottom:"1px solid #2a2a4a",color:"#8888aa",fontWeight:"600",fontSize:"11px"},xo={padding:"3px 6px",borderBottom:"1px solid #16162a",color:"#ccccdd",fontSize:"12px"},ho={cursor:"default",transition:"background-color 0.1s"};exports.Accordion=function(e){const{sections:t,defaultExpanded:o,allowMultiple:r=!1,headerStyle:i={},contentStyle:a={},wrapperStyle:c,expandIcon:p="+",collapseIcon:u="−",iconPosition:f="right",animated:g=!0,onChange:x}=e,[h,b]=l(()=>o??[]),m=s(e=>{b(t=>{let o;return o=t.includes(e)?t.filter(t=>t!==e):r?[...t,e]:[e],x&&x(o),o})},[r,x]),y=d(()=>t.map(e=>{const t=h.includes(e.id),o=n($e,{key:`header-${e.id}`,section:e,expanded:t,onToggle:()=>m(e.id),headerStyle:i,expandIcon:p,collapseIcon:u,iconPosition:f}),r=n(ze,{key:`content-${e.id}`,section:e,expanded:t,contentStyle:a,animated:g});return n("div",{key:e.id,"data-accordion-section":e.id,style:{width:"100%"}},o,r)}),[t,h,i,a,p,u,f,g,m]);return n(Se,{role:"region",ariaLabel:"Accordion",styling:c,keyboardNav:!0},...y)},exports.Alert=function(e){const[t,o]=l(!0),r=e.type??"info",i=e.variant??"subtle",a=J[r]??J.info,s=e.icon??a.icon,c=e.message??e.children,p=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?n("div",{role:"alert",style:p},n("span",{style:{flexShrink:"0",fontSize:"16px",lineHeight:"1.5"}},s),n("div",{style:{flex:"1",minWidth:"0"}},e.title?n("div",{style:{fontWeight:"600",marginBottom:c?"4px":"0"}},e.title):null,c?n("div",null,c):null,e.action?n("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?n("button",{"aria-label":"Close",onclick:()=>{o(!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},exports.AnalogClock=function(e){const{format:t="12h",size:o=200,showDate:r=!1,dateFormat:i="short",showSeconds:s=!0,timezone:d,className:c}=e,[p,u]=l(g(d));a(()=>{const e=setInterval(()=>{u(g(d))},1e3);return()=>clearInterval(e)},[d]);const f=p.getHours(),m=p.getMinutes(),y=p.getSeconds(),v=f%12*30+.5*m,k=6*m+.1*y,S=6*y,w=o/2,C=o/2,$=o/2-10,z=$-4,M=$-22,I=[];I.push(n("circle",{cx:String(w),cy:String(C),r:String($),fill:"#f8fafc",stroke:x,"stroke-width":"3"}));for(let e=0;e<12;e++){const r=(30*e-90)*Math.PI/180,i=z-6;I.push(n("line",{x1:String(w+i*Math.cos(r)),y1:String(C+i*Math.sin(r)),x2:String(w+z*Math.cos(r)),y2:String(C+z*Math.sin(r)),stroke:x,"stroke-width":"2"}));const l=String(0===e?12:e);if(I.push(n("text",{x:String(w+M*Math.cos(r)),y:String(C+M*Math.sin(r)),"text-anchor":"middle","dominant-baseline":"central",fill:b,"font-size":String(.08*o),"font-family":"sans-serif","font-weight":"600"},l)),"24h"===t){const t=$-38,i=String(0===e?0:e+12);I.push(n("text",{x:String(w+t*Math.cos(r)),y:String(C+t*Math.sin(r)),"text-anchor":"middle","dominant-baseline":"central",fill:b,"font-size":String(.055*o),"font-family":"sans-serif",opacity:"0.6"},i))}}const D=(e,t,o,r)=>{const i=(e-90)*Math.PI/180;return n("line",{x1:String(w),y1:String(C),x2:String(w+t*Math.cos(i)),y2:String(C+t*Math.sin(i)),stroke:r,"stroke-width":o,"stroke-linecap":"round"})};I.push(D(v,.5*$,"4",h)),I.push(D(k,.75*$,"3",h)),s&&I.push(D(S,.85*$,"1.5","#ef4444")),I.push(n("circle",{cx:String(w),cy:String(C),r:"4",fill:h}));const F=[n("svg",{width:String(o),height:String(o),viewBox:`0 0 ${o} ${o}`,xmlns:"http://www.w3.org/2000/svg"},...I)];return r&&F.push(n("div",{style:{textAlign:"center",marginTop:"8px",fontFamily:"sans-serif",fontSize:"14px",color:b}},function(e,t){const o=e.getFullYear(),n=e.getMonth(),r=e.getDate();switch(t){case"short":return`${String(n+1).padStart(2,"0")}/${String(r).padStart(2,"0")}/${o}`;case"long":return`${["January","February","March","April","May","June","July","August","September","October","November","December"][n]} ${String(r).padStart(2,"0")}, ${o}`;case"iso":return`${o}-${String(n+1).padStart(2,"0")}-${String(r).padStart(2,"0")}`}}(p,i))),n("div",{className:c,style:{display:"inline-flex",flexDirection:"column",alignItems:"center"}},...F)},exports.Avatar=function(e){const{src:t,alt:o,name:r,size:i,shape:a="circle",fallbackColor:s,status:d,statusPosition:c="bottom-right"}=e,[p,u]=l(!1),f=function(e){return null==e?m.md:"number"==typeof e?e:m[e]??m.md}(i),g="circle"===a?"50%":`${Math.round(.15*f)}px`,x=s??function(e){if(!e)return"#9ca3af";let t=0;for(let o=0;o<e.length;o++)t=e.charCodeAt(o)+((t<<5)-t);return y[Math.abs(t)%y.length]}(r),h=`${Math.round(.4*f)}px`,b={position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:`${f}px`,height:`${f}px`,borderRadius:g,overflow:"hidden",flexShrink:"0"};let S;if(t&&!p)S=n("img",{src:t,alt:o??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);S=n("span",{style:{fontSize:h,fontWeight:"600",color:"#fff",lineHeight:"1",userSelect:"none",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},"aria-hidden":"true"},e)}const w=n("div",{style:{...b,backgroundColor:t&&!p?"transparent":x},role:"img","aria-label":o??r??"avatar"},S);if(!d)return w;const C=Math.max(8,Math.round(.25*f));return n("div",{style:{position:"relative",display:"inline-flex",width:`${f}px`,height:`${f}px`,flexShrink:"0"}},w,n("span",{style:{position:"absolute",width:`${C}px`,height:`${C}px`,borderRadius:"50%",backgroundColor:v[d]??v.offline,border:"2px solid #fff",boxSizing:"border-box",...k(c,C)},"aria-label":d}))},exports.Badge=function(e){const{count:t,max:o,dot:r=!1,color:i="#ef4444",size:l="md",variant:a="solid",children:s}=e;let d=null;r||null==t||(d=null!=o&&t>o?`${o}+`:String(t));const c=r||null!=t&&t>0,p=r?{...w[l],borderRadius:"50%",..."solid"===a?{backgroundColor:i}:{backgroundColor:"transparent",border:`2px solid ${i}`}}:{...S[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?n("span",{style:p,"aria-label":r?"notification":`count ${d}`},d):null;if(null==s)return u??n("span",null);const f={...p,position:"absolute",top:"0",right:"0",transform:"translate(50%, -50%)",zIndex:"1"};return n("span",{style:{position:"relative",display:"inline-flex"}},s,c?n("span",{style:f,"aria-label":r?"notification":`count ${d}`},d):null)},exports.BarGraph=function(e){const{data:t=[],width:o=600,height:r=400,orientation:i="vertical",barColor:l="#3b82f6",barGap:a=8,barRadius:c=4,showValues:p=!0,showGrid:u=!0,gridColor:f="#e5e7eb",title:g,padding:x=50,animate:h=!1,stacked:b,grouped:m=!1}=e,y="vertical"===i,v=o-2*x,k=r-2*x,S=y?k:v,w=y?v:k,C=void 0!==b&&b.length>0,$=d(()=>C?function(e){const t=new Set;for(const o of e)for(const e of o.values)t.add(e.category);return Array.from(t)}(b):[],[C,b]),z=C?b.length:t.length,M=d(()=>function(e,t,o){if(t&&t.length>0){if(o){let e=0;for(const o of t)for(const t of o.values)t.value>e&&(e=t.value);return e}let e=0;for(const o of t){let t=0;for(const e of o.values)t+=e.value;t>e&&(e=t)}return e}let n=0;for(const t of e)t.value>n&&(n=t.value);return n}(t,b,m),[t,b,m]),I=M>0?M:1,D=ot(z,I,S,w,a),F=s(()=>{if(!u)return[];const e=function(e){if(e<=0)return 1;const t=e/5,o=Math.pow(10,Math.floor(Math.log10(t))),n=t/o;return n<=1.5?o:n<=3.5?2*o:n<=7.5?5*o:10*o}(I),t=[];for(let o=e;o<=I;o+=e){const e=D.valueScale(o);if(y){const r=x+k-e;t.push(n("line",{key:`grid-${o}`,x1:String(x),y1:String(r),x2:String(x+v),y2:String(r),stroke:f,"stroke-width":"1","stroke-dasharray":"4 2"})),t.push(n("text",{key:`grid-label-${o}`,x:String(x-6),y:String(r+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(o)))}else{const r=x+e;t.push(n("line",{key:`grid-${o}`,x1:String(r),y1:String(x),x2:String(r),y2:String(x+k),stroke:f,"stroke-width":"1","stroke-dasharray":"4 2"})),t.push(n("text",{key:`grid-label-${o}`,x:String(r),y:String(x+k+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(o)))}}return t},[u,I,D,y,x,v,k,f]),R=s(()=>{const e=[];return y?(e.push(n("line",{key:"axis-y",x1:String(x),y1:String(x),x2:String(x),y2:String(x+k),stroke:"#374151","stroke-width":"1.5"})),e.push(n("line",{key:"axis-x",x1:String(x),y1:String(x+k),x2:String(x+v),y2:String(x+k),stroke:"#374151","stroke-width":"1.5"}))):(e.push(n("line",{key:"axis-x",x1:String(x),y1:String(x+k),x2:String(x+v),y2:String(x+k),stroke:"#374151","stroke-width":"1.5"})),e.push(n("line",{key:"axis-y",x1:String(x),y1:String(x),x2:String(x),y2:String(x+k),stroke:"#374151","stroke-width":"1.5"}))),e},[y,x,v,k]),L=s(()=>{const e=[];for(let o=0;o<t.length;o++){const r=t[o],i=D.valueScale(r.value),a=D.categoryScale(o),s=r.color??l;let d,u,f=String(r.value);if(y){const e=x+a,t=x+k-i;d={x:String(e),y:String(t),width:String(D.barThickness),height:String(i),rx:String(c),ry:String(c),fill:s},u={x:String(e+D.barThickness/2),y:String(t-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"}}else{const e=x+a,t=x;d={x:String(t),y:String(e),width:String(i),height:String(D.barThickness),rx:String(c),ry:String(c),fill:s},u={x:String(t+i+6),y:String(e+D.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"}}h&&(d.style=`animation: barGrow 0.6s ease-out ${.05*o}s both`),e.push(n("rect",{key:`bar-${o}`,...d})),p&&e.push(n("text",{key:`val-${o}`,...u},f)),y?e.push(n("text",{key:`cat-${o}`,x:String(x+a+D.barThickness/2),y:String(x+k+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},r.label)):e.push(n("text",{key:`cat-${o}`,x:String(x-6),y:String(x+a+D.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},r.label))}return e},[t,D,l,c,p,h,y,x,k]),A=s(()=>{if(!b)return[];const e=[];for(let t=0;t<b.length;t++){const o=b[t],r=D.categoryScale(t);let i=0;for(let l=0;l<o.values.length;l++){const a=o.values[l],s=D.valueScale(a.value),d=D.valueScale(i),u=rt(l,a.color);if(y){const i=x+r,f=x+k-d-s;e.push(n("rect",{key:`sbar-${t}-${l}`,x:String(i),y:String(f),width:String(D.barThickness),height:String(s),rx:l===o.values.length-1?String(c):"0",ry:l===o.values.length-1?String(c):"0",fill:u,...h?{style:`animation: barGrow 0.6s ease-out ${.03*(t*o.values.length+l)}s both`}:{}})),p&&s>14&&e.push(n("text",{key:`sval-${t}-${l}`,x:String(i+D.barThickness/2),y:String(f+s/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(a.value)))}else{const i=x+d,f=x+r;e.push(n("rect",{key:`sbar-${t}-${l}`,x:String(i),y:String(f),width:String(s),height:String(D.barThickness),rx:l===o.values.length-1?String(c):"0",ry:l===o.values.length-1?String(c):"0",fill:u,...h?{style:`animation: barGrow 0.6s ease-out ${.03*(t*o.values.length+l)}s both`}:{}})),p&&s>20&&e.push(n("text",{key:`sval-${t}-${l}`,x:String(i+s/2),y:String(f+D.barThickness/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(a.value)))}i+=a.value}if(p){const o=D.valueScale(i);y?e.push(n("text",{key:`stotal-${t}`,x:String(x+r+D.barThickness/2),y:String(x+k-o-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(i))):e.push(n("text",{key:`stotal-${t}`,x:String(x+o+6),y:String(x+r+D.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(i)))}y?e.push(n("text",{key:`scat-${t}`,x:String(x+r+D.barThickness/2),y:String(x+k+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},o.label)):e.push(n("text",{key:`scat-${t}`,x:String(x-6),y:String(x+r+D.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},o.label))}return e},[b,D,c,p,h,y,x,k]),T=s(()=>{if(!b)return[];const e=$.length,t=[];for(let o=0;o<b.length;o++){const r=b[o],i=D.categoryScale(o),l=2,a=Math.max(1,(D.barThickness-l*(e-1))/e);for(let s=0;s<r.values.length;s++){const d=r.values[s],u=$.indexOf(d.category),f=u*(a+l),g=D.valueScale(d.value),b=rt(u>=0?u:s,d.color);if(y){const r=x+i+f,l=x+k-g;t.push(n("rect",{key:`gbar-${o}-${s}`,x:String(r),y:String(l),width:String(a),height:String(g),rx:String(c),ry:String(c),fill:b,...h?{style:`animation: barGrow 0.6s ease-out ${.04*(o*e+s)}s both`}:{}})),p&&t.push(n("text",{key:`gval-${o}-${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=x,l=x+i+f;t.push(n("rect",{key:`gbar-${o}-${s}`,x:String(r),y:String(l),width:String(g),height:String(a),rx:String(c),ry:String(c),fill:b,...h?{style:`animation: barGrow 0.6s ease-out ${.04*(o*e+s)}s both`}:{}})),p&&t.push(n("text",{key:`gval-${o}-${s}`,x:String(r+g+4),y:String(l+a/2+3),"text-anchor":"start","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(d.value)))}}y?t.push(n("text",{key:`gcat-${o}`,x:String(x+i+D.barThickness/2),y:String(x+k+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},r.label)):t.push(n("text",{key:`gcat-${o}`,x:String(x-6),y:String(x+i+D.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},r.label))}return t},[b,$,D,c,p,h,y,x,k]),E=s(()=>g?[n("text",{key:"title",x:String(o/2),y:String(x/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},g)]:[],[g,o,x]),W=s(()=>h?[n("defs",{key:"anim-defs"},n("style",{key:"anim-style"},y?"@keyframes barGrow { from { transform: scaleY(0); transform-origin: bottom; } to { transform: scaleY(1); transform-origin: bottom; } }":"@keyframes barGrow { from { transform: scaleX(0); transform-origin: left; } to { transform: scaleX(1); transform-origin: left; } }"))]:[],[h,y]),B=F(),N=R(),P=E(),H=W();let j;return j=C&&m?T():C?A():L(),n("svg",{width:"100%",viewBox:`0 0 ${o} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",style:{fontFamily:"sans-serif"}},...H,...P,...B,...N,...j)},exports.Breadcrumb=function(e){const{items:t,separator:o="/",maxItems:r,size:i="md"}=e,[a,d]=l(!1),c=Me[i],p=s(()=>{d(!0)},[]);let u=t,f=!1;if(r&&r>1&&t.length>r&&!a){f=!0;const e=1,o=r-1;u=[...t.slice(0,e),{label:"..."},...t.slice(t.length-o)]}const g=u.map((e,t)=>((e,t,r)=>{const i=t===r.length-1,l=f&&"..."===e.label&&1===t,a=[];var s;return t>0&&a.push(n("span","string"==typeof(s=o)?{"aria-hidden":"true",style:{margin:"0 8px",color:"#9ca3af",userSelect:"none"}}:{"aria-hidden":"true",style:{margin:"0 8px"}},s)),l?a.push(n("button",{type:"button",onClick:p,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(n("span",{"aria-current":"page",style:{color:"#1f2937",fontWeight:"600",fontSize:c.fontSize}},e.label)):e.href?a.push(n("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(n("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(n("span",{style:{color:"#6b7280",fontSize:c.fontSize}},e.label)),n("li",{key:String(t),style:{display:"inline-flex",alignItems:"center"}},...a)})(e,t,u));return n(Se,{orientation:"horizontal",role:"navigation",ariaLabel:"Breadcrumb",keyboardNav:!1,styling:{border:"none",borderRadius:"0",padding:c.padding,backgroundColor:"transparent"}},n("ol",{style:{display:"flex",alignItems:"center",listStyle:"none",margin:"0",padding:"0",flexWrap:"wrap"}},...g))},exports.Card=function(e){const t=!1!==e.bordered,o=e.shadow??"sm",r=e.padding??"16px",i=e.borderRadius??"8px",l=d(()=>{const n={display:"flex",flexDirection:"column",borderRadius:i,overflow:"hidden",backgroundColor:"#ffffff",transition:"box-shadow 0.2s, transform 0.2s"};return t&&(n.border="1px solid #e5e7eb"),n.boxShadow=be[o]??be.sm,e.hoverable&&(n.cursor="pointer"),{...n,...e.style??{}}},[t,o,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"},p=e.title||e.subtitle||e.headerAction;return n("div",{className:`card ${e.hoverable?"card--hoverable":""} ${e.className??""}`.trim(),style:l},e.image?n("img",{src:e.image,alt:e.imageAlt??"",style:{width:"100%",height:"auto",display:"block",objectFit:"cover"}}):null,p?n("div",{className:"card__header",style:a},n("div",{style:{flex:"1",minWidth:"0"}},e.title?n("div",{className:"card__title",style:{fontSize:"16px",fontWeight:"600",color:"#111827",lineHeight:"1.4"}},e.title):null,e.subtitle?n("div",{className:"card__subtitle",style:{fontSize:"14px",color:"#6b7280",marginTop:"2px",lineHeight:"1.4"}},e.subtitle):null),e.headerAction?n("div",{className:"card__header-action"},e.headerAction):null):null,n("div",{className:"card__body",style:s},e.children),e.footer?n("div",{className:"card__footer",style:c},e.footer):null)},exports.Carousel=function(e){const t=e.items??[],o=t.length,r=!1!==e.loop,i=!1!==e.showDots,u=!1!==e.showArrows,f=e.animation??"slide",g=e.interval??5e3,x=p(),[h,b]=l(0),m=c(null),y=c(null),v=s(t=>{let n=t;n=r?(t%o+o)%o:Math.max(0,Math.min(t,o-1)),b(n),e.onChange&&e.onChange(n)},[o,r,e.onChange]),k=s(()=>v(h+1),[h,v]),S=s(()=>v(h-1),[h,v]);a(()=>{if(!e.autoPlay||o<=1)return;const t=setInterval(k,g);return()=>clearInterval(t)},[e.autoPlay,g,k,o]),a(()=>{const e=e=>{"ArrowLeft"===e.key?S():"ArrowRight"===e.key&&k()},t=y.current;if(t)return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)},[k,S]);const w="fade"===f?`@keyframes liq-fade-in-${x}{from{opacity:0}to{opacity:1}}`:"",C=d(()=>"fade"===f?{position:"relative",width:"100%"}:{display:"flex",transition:"transform 0.4s ease",transform:`translateX(-${100*h}%)`,width:"100%"},[h,f]),$={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 o="fade"===f?{position:t===h?"relative":"absolute",top:"0",left:"0",width:"100%",opacity:t===h?"1":"0",transition:"opacity 0.4s ease"}:{flex:"0 0 100%",width:"100%"};return n("div",{key:String(t),style:o},e.content,e.caption?n("div",{style:{textAlign:"center",padding:"8px 12px",fontSize:"13px",color:"#6b7280"}},e.caption):null)}),M=i?n("div",{style:{display:"flex",justifyContent:"center",gap:"8px",padding:"12px 0"}},...t.map((e,t)=>n("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===h?"#3b82f6":"#d1d5db",transition:"background-color 0.2s",padding:"0"}}))):null;return n("div",{ref:y,tabindex:"0",role:"region","aria-label":"Carousel",style:{position:"relative",overflow:"hidden",width:"100%",outline:"none"},onpointerdown:e=>{m.current=e.clientX},onpointerup:e=>{if(null==m.current)return;const t=e.clientX-m.current;t>50?S():t<-50&&k(),m.current=null}},w?n("style",null,w):null,n("div",{style:C},...z),u&&o>1?n("button",{"aria-label":"Previous slide",onclick:S,style:{...$,left:"8px"}},"‹"):null,u&&o>1?n("button",{"aria-label":"Next slide",onclick:k,style:{...$,right:"8px"}},"›"):null,M)},exports.CartesianGraph2D=function(e){const{width:t=400,height:o=300,points:r=[],plotFunction:i,plotResolution:p=200,xStep:u,sync:f=!1,xRange:g=[-5,5],yRange:x=[-5,5],showGrid:h=!0,showAxes:b=!0,pointRadius:m=3,pointColor:y="#3b82f6",curveColor:v="#3b82f6",gridColor:k="#e2e8f0",axisColor:S="#94a3b8",onPointClick:w,onPointDoubleClick:C,onPointContextMenu:$,onPointHover:z}=e,[M,I]=l(g[0]),[D,F]=l(g[1]),[R,L]=l(x[0]),[A,T]=l(x[1]),E=c(!1),W=c(null),B=s(e=>pt+(e-M)/(D-M)*(t-80),[M,D,t]),N=s(e=>o-pt-(e-R)/(A-R)*(o-80),[R,A,o]),P=s(e=>M+(e-pt)/(t-80)*(D-M),[M,D,t]),H=s(e=>R+(o-pt-e)/(o-80)*(A-R),[R,A,o]),j=s(e=>{const t=e;E.current=!0,W.current={mx:t.clientX,my:t.clientY,x0:M,x1:D,y0:R,y1:A}},[M,D,R,A]),_=s(e=>{if(!E.current||!W.current)return;const n=e,r=W.current,i=n.clientX-r.mx,l=n.clientY-r.my,a=i/(t-80)*(r.x1-r.x0),s=l/(o-80)*(r.y1-r.y0);I(r.x0-a),F(r.x1-a),L(r.y0+s),T(r.y1+s)},[t,o]),q=s(()=>{E.current=!1,W.current=null},[]),O=s(e=>{const t=e;t.preventDefault();const o=t.currentTarget.getBoundingClientRect(),n=t.clientX-o.left,r=t.clientY-o.top,i=P(n),l=H(r),a=t.deltaY>0?1.1:1/1.1,s=(D-M)*a,d=(A-R)*a;if(s<.01||d<.01||s>ut||d>ut)return;const c=(i-M)/(D-M),p=(l-R)/(A-R);I(i-c*s),F(i+(1-c)*s),L(l-p*d),T(l+(1-p)*d)},[M,D,R,A,P,H]),Y=[];if(Y.push(n("rect",{x:0,y:0,width:t,height:o,fill:"white",key:"bg"})),h){const e=dt(M,D),r=dt(R,A);for(let t=0;t<e.length;t++){const r=B(e[t]);Y.push(n("line",{x1:r,y1:pt,x2:r,y2:o-pt,stroke:k,"stroke-width":.5,key:`gx-${t}`})),Y.push(n("text",{x:r,y:o-pt+14,"text-anchor":"middle","font-size":10,fill:S,key:`lx-${t}`},ct(e[t])))}for(let e=0;e<r.length;e++){const o=N(r[e]);Y.push(n("line",{x1:pt,y1:o,x2:t-pt,y2:o,stroke:k,"stroke-width":.5,key:`gy-${e}`})),Y.push(n("text",{x:34,y:o+3,"text-anchor":"end","font-size":10,fill:S,key:`ly-${e}`},ct(r[e])))}}if(b){const e=Math.max(pt,Math.min(t-pt,B(0))),r=Math.max(pt,Math.min(o-pt,N(0)));Y.push(n("line",{x1:pt,y1:r,x2:t-pt,y2:r,stroke:S,"stroke-width":1,key:"x-axis"})),Y.push(n("line",{x1:e,y1:pt,x2:e,y2:o-pt,stroke:S,"stroke-width":1,key:"y-axis"}))}const U=d(()=>{if(!i||!f)return[];const e=it({start:M,end:D,step:u??(D-M)/p});return lt(i,e)},[i,M,D,u,p,f]),[G,X]=l([]),K=c(null);a(()=>{if(!i||f)return void X([]);const e=it({start:M,end:D,step:u??(D-M)/p});return K.current&&K.current(),K.current=at(i,e,200,e=>{X([...e])}),()=>{K.current&&K.current()}},[i,M,D,u,p,f]);const V=f?U:G;if(V.length>0){const e=[];for(let t=0;t<V.length;t++){const o=V[t],n=B(o.input),r=N(o.output);e.push(`${0===e.length?"M":"L"}${n},${r}`)}Y.push(n("path",{d:e.join(" "),fill:"none",stroke:v,"stroke-width":1.5,key:"curve"}))}const J=(e,t,o,n)=>{if(t)return e=>t({x:n.x,y:n.y,index:o,event:e})};for(let e=0;e<r.length;e++){const t=r[e],o={cx:B(t.x),cy:N(t.y),r:m,fill:y,cursor:"pointer",key:`pt-${e}`};w&&(o.onClick=J(0,w,e,t)),C&&(o.onDblClick=J(0,C,e,t)),$&&(o.onContextMenu=J(0,$,e,t)),z&&(o.onMouseOver=J(0,z,e,t)),Y.push(n("circle",o))}const Z=n("defs",{key:"defs"},n("clipPath",{id:"plot-clip"},n("rect",{x:pt,y:pt,width:t-80,height:o-80})));return n("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${t} ${o}`,preserveAspectRatio:"xMidYMid meet",style:"user-select: none; touch-action: none;",onMouseDown:j,onMouseMove:_,onMouseUp:q,onMouseLeave:q,onWheel:O},Z,...Y)},exports.Checkbox=function(e){const{checked:t,onChange:o,label:r,indeterminate:i=!1,disabled:l=!1,error:d,size:p="md"}=e,u=c(null);a(()=>{u.current&&(u.current.indeterminate=i)},[i]);const f=s(()=>{l||o(!t)},[l,t,o]),g=s(e=>{l||" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),o(!t))},[l,t,o]),x=ne[p],h=`${x.box}px`,b={width:h,height:h,minWidth:h,borderRadius:"4px",border:"2px solid "+(d?"#ef4444":t||i?"#3b82f6":"#d1d5db"),backgroundColor:t||i?"#3b82f6":"#ffffff",display:"flex",alignItems:"center",justifyContent:"center",cursor:l?"not-allowed":"pointer",transition:"all 0.15s",boxSizing:"border-box"},m={color:"#ffffff",fontSize:`${x.icon}px`,lineHeight:"1",fontWeight:"700"},y=i?n("span",{style:m},"—"):t?n("span",{style:m},"✓"):null,v={display:"inline-flex",alignItems:"center",gap:"8px",cursor:l?"not-allowed":"pointer",opacity:l?"0.6":"1",userSelect:"none"},k=n("input",{ref:u,type:"checkbox",checked:t,disabled:l,onChange:()=>o(!t),style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},"aria-hidden":"true",tabIndex:-1}),S=n("div",{style:b},y),w=r?n("span",{style:{fontSize:x.fontSize,color:"#374151"}},r):null;return n(te,{error:d},n("div",{style:v,onClick:f,onKeyDown:g,tabIndex:l?-1:0,role:"checkbox","aria-checked":i?"mixed":t?"true":"false","aria-disabled":l?"true":void 0,"aria-label":r},k,S,w))},exports.ColorPicker=function(e){const t=e.id??`cp-${Math.random().toString(36).slice(2,8)}`,{value:o,onChange:r,presets:i=re,showInput:d=!0,showAlpha:p=!1,disabled:u=!1,label:f}=e,[g,x]=l(!1),[h,b]=l(o),m=c(null);a(()=>{b(o)},[o]),a(()=>{const e=e=>{m.current&&!m.current.contains(e.target)&&x(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const y=s(e=>{u||r(le(e))},[u,r]),v=s(e=>{const t=e.target.value;b(t);const o=t.startsWith("#")?t:`#${t}`;ie(o)&&r(le(o))},[r]),k=s(()=>{ie(h.startsWith("#")?h:`#${h}`)||b(o)},[h,o]),S={width:"36px",height:"36px",borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:o,cursor:u?"not-allowed":"pointer",flexShrink:"0"},w={display:"grid",gridTemplateColumns:"repeat(10, 1fr)",gap:"4px",marginBottom:d?"8px":"0"},C=i.map(e=>{const t=le(e)===le(o);return n("div",{key:e,style:{width:"20px",height:"20px",borderRadius:"3px",backgroundColor:e,cursor:u?"not-allowed":"pointer",border:t?"2px solid #1f2937":"1px solid #e5e7eb",boxSizing:"border-box"},onClick:()=>y(e),onKeyDown:t=>{const o=t.key;"Enter"!==o&&" "!==o||(t.preventDefault(),y(e))},role:"button",tabIndex:u?-1:0,title:e,"aria-label":`Select color ${e}`})}),$=d?n("div",{style:{display:"flex",alignItems:"center",gap:"4px"}},n("div",{style:{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:o,border:"1px solid #d1d5db",flexShrink:"0"}}),n("input",{type:"text",value:h,onInput:v,onBlur:k,disabled:u,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,z=g?n("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"}},n("div",{style:w},...C),$):null;return n(te,{label:f,disabled:u,htmlFor:t},n("div",{ref:m,style:{position:"relative"}},n("div",{style:{display:"flex",alignItems:"center",gap:"8px"},onClick:u?void 0:()=>x(!g),onKeyDown:u?void 0:e=>{const t=e.key;"Enter"!==t&&" "!==t||(e.preventDefault(),x(!g))},role:"button",tabIndex:u?-1:0,"aria-expanded":g?"true":"false","aria-label":"Toggle color picker"},n("div",{id:t,style:S}),d?n("span",{style:{fontSize:"14px",fontFamily:"monospace",color:"#1f2937"}},o):null),z))},exports.ColorWheel=function(e){const t=e.id??`cw-${Math.random().toString(36).slice(2,8)}`,{value:o="#000000",onChange:r,size:i=32,showLabel:a=!0,disabled:d=!1,label:p}=e,[u,f]=l(o);return n(te,{label:p,htmlFor:t},n("div",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"4px"}},n("div",{style:{width:`${i}px`,height:`${i}px`,borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:u,cursor:d?"not-allowed":"pointer",position:"relative",overflow:"hidden"}},n("input",{id:t,ref:c(null),type:"color",value:u,onInput:s((...e)=>{const t=e[0].target.value;f(t),r?.(t)},[r]),disabled:d,style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",opacity:"0",cursor:d?"not-allowed":"pointer",border:"none",padding:"0"},"aria-label":p||"Color"})),a?n("span",{style:{fontSize:"11px",fontFamily:"monospace",color:"#64748b"}},u):null))},exports.ComplexGraph2D=function(e){const{width:t=400,height:o=300,realRange:r=[-2.5,1],imagRange:i=[-1.25,1.25],maxIterations:d=100,colorScheme:p="classic",computeFunction:u=ft,data:f,resolution:g=2,onPointClick:x,onPointHover:h,onPointDoubleClick:b,onPointContextMenu:m}=e;if(f){const e=f.length,r=e>0?f[0].length:0,i=r>0?t/r:1,l=e>0?o/e:1,a=[];for(let t=0;t<e;t++){const e=f[t];for(let o=0;o<r;o++){const r=e[o]??0,[s,c,u]=gt(r,d,p);a.push(n("rect",{key:`${t}-${o}`,x:String(o*i),y:String(t*l),width:String(Math.ceil(i)),height:String(Math.ceil(l)),fill:`rgb(${s},${c},${u})`}))}}return n("svg",{width:"100%",viewBox:`0 0 ${t} ${o}`,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[y,v]=l(r[0]),[k,S]=l(r[1]),[w,C]=l(i[0]),[$,z]=l(i[1]),M=c(null),I=c(!1),D=c(null),F=s((e,n)=>({re:y+e/t*(k-y),im:$-n/o*($-w)}),[y,k,w,$,t,o]);a(()=>{const e=M.current;if(!e)return;const n=e.getContext("2d");if(!n)return;const r=n.createImageData(t,o),i=r.data;for(let e=0;e<o;e++)for(let o=0;o<t;o++){const{re:n,im:r}=F(o,e),l=u(n,r,d),[a,s,c]=gt(l,d,p),f=4*(e*t+o);i[f]=a,i[f+1]=s,i[f+2]=c,i[f+3]=255}n.putImageData(r,0,0)},[y,k,w,$,t,o,d,p,u,F]);const R=s(e=>{const t=e.target.getBoundingClientRect(),o=e.clientX-t.left,n=e.clientY-t.top,{re:r,im:i}=F(o,n);return{re:r,im:i,iterations:u(r,i,d),event:e}},[F,u,d]),L=s(e=>{I.current=!0,D.current={x:e.clientX,y:e.clientY,rMin:y,rMax:k,iMin:w,iMax:$}},[y,k,w,$]),A=s(e=>{if(h&&h(R(e)),!I.current||!D.current)return;const n=D.current,r=e.clientX-n.x,i=e.clientY-n.y,l=(n.rMax-n.rMin)/t,a=(n.iMax-n.iMin)/o;v(n.rMin-r*l),S(n.rMax-r*l),C(n.iMin+i*a),z(n.iMax+i*a)},[t,o,h,R]),T=s(()=>{I.current=!1},[]),E=s(e=>{e.preventDefault();const t=e.deltaY>0?1.15:1/1.15,o=e.target.getBoundingClientRect(),n=e.clientX-o.left,r=e.clientY-o.top,{re:i,im:l}=F(n,r);v(i+(y-i)*t),S(i+(k-i)*t),C(l+(w-l)*t),z(l+($-l)*t)},[F,y,k,w,$]),W=s(e=>{x&&x(R(e))},[x,R]),B=s(e=>{b&&b(R(e))},[b,R]),N=s(e=>{e.preventDefault(),m&&m(R(e))},[m,R]);return n("canvas",{ref:M,width:t,height:o,style:{cursor:"crosshair"},onMouseDown:L,onMouseMove:A,onMouseUp:T,onMouseLeave:T,onWheel:E,onClick:W,onDblClick:B,onContextMenu:N})},exports.ContextMenu=function(e){const{items:t,children:o}=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 p=[n("div",{onContextMenu:d,style:{display:"contents"}},o)];return r&&p.push(n(Oe,{items:t,position:r,onClose:c,depth:0})),n("div",null,...p)},exports.DataGrid=function(e){const{columns:t,data:o,pageSize:r,currentPage:i,onPageChange:a,sortBy:c,sortDir:p,onSort:u,selectable:f=!1,selectedRows:g,onSelectionChange:x,striped:h=!1,bordered:b=!1,compact:m=!1,stickyHeader:y=!1}=e,[v,k]=l(0),[S,w]=l(void 0),[E,W]=l("asc"),[B,N]=l([]),[P,H]=l({}),j=i??v,_=c??S,q=p??E,O=g??B,Y=d(()=>{const e=Object.entries(P).filter(([,e])=>e.length>0);return 0===e.length?o:o.filter(t=>e.every(([e,o])=>String(t[e]??"").toLowerCase().includes(o.toLowerCase())))},[o,P]),U=d(()=>{if(!_)return Y;const e=[...Y];return e.sort((e,t)=>{const o=e[_],n=t[_];if(null==o&&null==n)return 0;if(null==o)return 1;if(null==n)return-1;if("number"==typeof o&&"number"==typeof n)return"asc"===q?o-n:n-o;const r=String(o),i=String(n),l=r.localeCompare(i);return"asc"===q?l:-l}),e},[Y,_,q]),G=U.length,X=r?Math.max(1,Math.ceil(G/r)):1,K=r?U.slice(j*r,(j+1)*r):U,V=s(e=>{a?a(e):k(e)},[a]),J=s(e=>{const t=_===e&&"asc"===q?"desc":"asc";u?u(e,t):(w(e),W(t))},[_,q,u]),Z=s(e=>{const t=O.includes(e)?O.filter(t=>t!==e):[...O,e];x?x(t):N(t)},[O,x]),Q=s(()=>{const e=K.map((e,t)=>r?j*r+t:t),t=e.every(e=>O.includes(e))?O.filter(t=>!e.includes(t)):[...new Set([...O,...e])];x?x(t):N(t)},[K,O,r,j,x]),ee=s((e,t)=>{H(o=>({...o,[e]:t})),V(0)},[V]),te=t.some(e=>e.filterable),oe=m?"6px 8px":z.padding,ne=[];if(f){const e=K.map((e,t)=>r?j*r+t:t),t=e.length>0&&e.every(e=>O.includes(e));ne.push(n("th",{key:"__select_all",style:{...$,padding:oe,width:"40px",textAlign:"center",...y?{position:"sticky",top:"0",zIndex:"2"}:{}}},n("input",{type:"checkbox",checked:t,onChange:Q,style:A,"aria-label":"Select all rows"})))}for(const e of t){const t={...$,padding:oe,...e.width?{width:e.width}:{},...e.sortable?{cursor:"pointer"}:{},...b?{border:"1px solid #e5e7eb"}:{},...y?{position:"sticky",top:"0",zIndex:"2"}:{}},o=[e.header];e.sortable&&o.push(n("span",{style:M},T(e.key,_,q))),ne.push(n("th",{key:e.key,style:t,onClick:e.sortable?()=>J(e.key):void 0,onKeyDown:e.sortable?t=>{const o=t.key;"Enter"!==o&&" "!==o||(t.preventDefault(),J(e.key))}:void 0,tabIndex:e.sortable?0:void 0,role:e.sortable?"columnheader":void 0,"aria-sort":_===e.key?"asc"===q?"ascending":"descending":void 0},...o))}let re=null;if(te){const e=[];f&&e.push(n("th",{key:"__filter_spacer",style:{padding:oe}}));for(const o of t)e.push(n("th",{key:`filter_${o.key}`,style:{padding:"4px 8px",backgroundColor:"#f9fafb"}},o.filterable?n("input",{type:"text",placeholder:`Filter ${o.header}...`,style:I,value:P[o.key]??"",onInput:e=>ee(o.key,e.target.value),"aria-label":`Filter by ${o.header}`}):null));re=n("tr",{key:"__filter_row"},...e)}const ie=[];for(let e=0;e<K.length;e++){const o=K[e],i=r?j*r+e:e,l=O.includes(i),a={};h&&e%2==1&&(a.backgroundColor="#f9fafb"),l&&(a.backgroundColor="#eff6ff");const s=[];f&&s.push(n("td",{key:"__select",style:{padding:oe,textAlign:"center",...z,...b?{border:"1px solid #e5e7eb"}:{}}},n("input",{type:"checkbox",checked:l,onChange:()=>Z(i),style:A,"aria-label":`Select row ${i+1}`})));for(const e of t){const t=o[e.key],r=e.render?e.render(t,o):String(t??"");s.push(n("td",{key:e.key,style:{...z,padding:oe,...b?{border:"1px solid #e5e7eb"}:{}}},r))}ie.push(n("tr",{key:String(i),style:a},...s))}let le=null;if(r){const e=0===G?0:j*r+1,t=Math.min((j+1)*r,G),o=[];o.push(n("button",{key:"prev",style:0===j?L:F,onClick:j>0?()=>V(j-1):void 0,disabled:0===j,"aria-label":"Previous page"},"← Prev"));const i=7;let l=Math.max(0,j-Math.floor(i/2));const a=Math.min(X,l+i);a-l<i&&(l=Math.max(0,a-i)),l>0&&(o.push(n("button",{key:"p0",style:F,onClick:()=>V(0)},"1")),l>1&&o.push(n("span",{key:"e1",style:{margin:"0 4px"}},"...")));for(let e=l;e<a;e++)o.push(n("button",{key:`p${e}`,style:e===j?R:F,onClick:e!==j?()=>V(e):void 0,"aria-current":e===j?"page":void 0},String(e+1)));a<X&&(a<X-1&&o.push(n("span",{key:"e2",style:{margin:"0 4px"}},"...")),o.push(n("button",{key:"p"+(X-1),style:F,onClick:()=>V(X-1)},String(X)))),o.push(n("button",{key:"next",style:j>=X-1?L:F,onClick:j<X-1?()=>V(j+1):void 0,disabled:j>=X-1,"aria-label":"Next page"},"Next →")),le=n("div",{style:D},n("span",null,`Showing ${e}–${t} of ${G}`),n("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},...o))}const ae={width:"100%",...y?{overflow:"auto",maxHeight:"600px"}:{}},se={...C,...b?{border:"1px solid #e5e7eb"}:{}},de=n("thead",null,n("tr",null,...ne),re),ce=n("tbody",null,...ie),pe=n("table",{style:se,role:"grid","aria-rowcount":String(G)},de,ce);return n("div",{style:ae},pe,le)},exports.DatePicker=function(e){const t=e.id??`dp-${Math.random().toString(36).slice(2,8)}`,{value:o,onChange:r,format:i="YYYY-MM-DD",minDate:p,maxDate:u,disabled:f=!1,placeholder:g="Select date...",label:x,error:h}=e,b=d(()=>de(o),[o]),m=d(()=>de(p),[p]),y=d(()=>de(u),[u]),[v,k]=l(!1),[S,w]=l(()=>b?b.getFullYear():(new Date).getFullYear()),[C,$]=l(()=>b?b.getMonth():(new Date).getMonth()),z=c(null),M=d(()=>new Date,[]);a(()=>{const e=e=>{z.current&&!z.current.contains(e.target)&&k(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const I=s(()=>{$(e=>0===e?(w(e=>e-1),11):e-1)},[]),D=s(()=>{$(e=>11===e?(w(e=>e+1),0):e+1)},[]),F=s(e=>{const t=new Date(S,C,e);m&&t<m||y&&t>y||(r(function(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}(t)),k(!1))},[S,C,r,m,y]),R=b?function(e,t){const o=e.getFullYear(),n=e.getMonth()+1,r=e.getDate();return t.replace("YYYY",String(o)).replace("MM",String(n).padStart(2,"0")).replace("DD",String(r).padStart(2,"0"))}(b,i):"",L=d(()=>{const e=new Date(S,C,1).getDay(),t=new Date(S,C+1,0).getDate(),o=[];let n=[];for(let t=0;t<e;t++)n.push(null);for(let e=1;e<=t;e++)n.push(e),7===n.length&&(o.push(n),n=[]);for(;n.length>0&&n.length<7;)n.push(null);return n.length&&o.push(n),o},[S,C]),A={...oe({},{focused:v,error:!!h}),cursor:f?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",minHeight:"38px",userSelect:"none"},T={background:"none",border:"none",cursor:"pointer",fontSize:"16px",padding:"4px 8px",color:"#374151",borderRadius:"4px"},E=se.map(e=>n("div",{key:e,style:{padding:"4px"}},e)),W=L.map((e,t)=>{const o=e.map((e,o)=>{if(null===e)return n("div",{key:`empty-${t}-${o}`,style:{padding:"4px"}});const r=new Date(S,C,e),i=ce(r,M),l=!!b&&ce(r,b),a=m&&r<m||y&&r>y;return n("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:()=>F(e),onKeyDown:a?void 0:t=>{const o=t.key;"Enter"!==o&&" "!==o||(t.preventDefault(),F(e))},role:a?void 0:"button",tabIndex:a?void 0:0,"aria-label":`${ae[C]} ${e}, ${S}`,"aria-disabled":a?"true":void 0},String(e))});return n("div",{key:`row-${t}`,style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)"}},...o)}),B=v?n("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"}},n("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"8px"}},n("button",{type:"button",style:T,onClick:I},"◀"),n("span",{style:{fontWeight:"600",fontSize:"14px",color:"#1f2937"}},`${ae[C]} ${S}`),n("button",{type:"button",style:T,onClick:D},"▶")),n("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",textAlign:"center",fontSize:"11px",fontWeight:"600",color:"#6b7280",marginBottom:"4px"}},...E),...W):null;return n(te,{label:x,error:h,disabled:f,htmlFor:t},n("div",{ref:z,style:{position:"relative"}},n("div",{id:t,style:A,onClick:f?void 0:()=>k(!v),onKeyDown:f?void 0:e=>{const t=e.key;"Enter"!==t&&" "!==t||(e.preventDefault(),k(!v))},tabIndex:f?-1:0,role:"button","aria-label":"Pick a date","aria-expanded":v?"true":"false"},n("span",{style:{color:R?"#1f2937":"#9ca3af"}},R||g),n("span",{style:{color:"#6b7280",fontSize:"14px"}},"📅")),B))},exports.DigitalClock=function(e){const{format:t="12h",showDate:o=!1,dateFormat:r="short",showSeconds:i=!0,timezone:s,className:d}=e,[c,p]=l(new Date);a(()=>{const e=setInterval(()=>{p(new Date)},1e3);return()=>clearInterval(e)},[]);const{hours:u,minutes:f,seconds:g}=function(e,t){if(t){const o=new Intl.DateTimeFormat("en-US",{timeZone:t,hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}).formatToParts(e),n=e=>Number(o.find(t=>t.type===e)?.value??0);return{hours:n("hour"),minutes:n("minute"),seconds:n("second")}}return{hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()}}(c,s);let x,h=null;"12h"===t?(h=u>=12?"PM":"AM",x=u%12||12):x=u;let b=`${E(x)}:${E(f)}`;i&&(b+=`:${E(g)}`);const m=[b];null!=h&&m.push(n("span",{style:N},h));const y=[n("span",{style:B},...m)];return o&&y.push(n("span",{style:P},function(e,t,o){if(o){const n={timeZone:o};if("short"===t)return Object.assign(n,{month:"2-digit",day:"2-digit",year:"numeric"}),new Intl.DateTimeFormat("en-US",n).format(e);if("long"===t)return Object.assign(n,{month:"long",day:"numeric",year:"numeric"}),new Intl.DateTimeFormat("en-US",n).format(e);Object.assign(n,{year:"numeric",month:"2-digit",day:"2-digit"});const r=new Intl.DateTimeFormat("en-CA",n).formatToParts(e),i=e=>r.find(t=>t.type===e)?.value??"";return`${i("year")}-${i("month")}-${i("day")}`}return"short"===t?`${E(e.getMonth()+1)}/${E(e.getDate())}/${e.getFullYear()}`:"long"===t?new Intl.DateTimeFormat("en-US",{month:"long",day:"numeric",year:"numeric"}).format(e):`${e.getFullYear()}-${E(e.getMonth()+1)}-${E(e.getDate())}`}(c,r,s))),n("div",{style:W,...d?{class:d}:{}},...y)},exports.Drawer=function(e){const{open:t,onClose:o,position:r="right",size:i="320px",title:s,overlay:d=!0,closeOnOverlay:p=!0,closeOnEscape:u=!0,children:f}=e,[g,x]=l(!1),[h,b]=l(!1),m=c(null),y=s?"drawer-title":void 0;if(a(()=>{if(!t){b(!1);const e=setTimeout(()=>x(!1),300);return()=>clearTimeout(e)}x(!0),requestAnimationFrame(()=>b(!0))},[t]),a(()=>{if(!t||!u)return;const e=e=>{"Escape"===e.key&&o()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t,u,o]),a(()=>{if(!t)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[t]),a(()=>{t&&m.current&&m.current.focus()},[t]),!g)return null;const v={position:"fixed",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:"10000",opacity:h?"1":"0",transition:"opacity 0.3s ease"},k={...Ue(r,i),transform:Ye(r,h),transition:"transform 0.3s ease"},S=[];s&&S.push(n("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"}},n("h3",{id:y,style:{margin:"0",fontSize:"16px",fontWeight:"600",color:"#111827"}},s),n("button",{type:"button",style:{background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",lineHeight:"1"},onClick:o,"aria-label":"Close drawer"},"×"))),S.push(n("div",{style:{padding:"20px",overflow:"auto",flex:"1"}},f));const w=[];return d&&w.push(n("div",{style:v,onClick:()=>{p&&o()}})),w.push(n("div",{ref:m,style:k,role:"dialog","aria-modal":"true","aria-labelledby":y,tabIndex:-1},...S)),n("div",null,...w)},exports.Dropdown=function(e){const{label:t,items:o,triggerStyle:r,menuStyle:i,itemStyle:d={},placement:p="bottom-start",closeOnSelect:u=!0,width:f="220px"}=e,[g,x]=l(!1),h=c(null),b=s(()=>{x(e=>!e)},[]),m=s(()=>{x(!1)},[]);a(()=>{if(!g)return;const e=e=>{const t=h.current;t&&!t.contains(e.target)&&x(!1)};return document.addEventListener("click",e,!0),()=>{document.removeEventListener("click",e,!0)}},[g]),a(()=>{if(!g)return;const e=e=>{"Escape"===e.key&&x(!1)};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[g]);const y=n("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:b,"aria-haspopup":"true","aria-expanded":String(g)},n("span",null,t),n("span",{style:{marginLeft:"4px",fontSize:"10px",transition:"transform 0.15s",transform:g?"rotate(180deg)":"rotate(0deg)"},"aria-hidden":"true"},"▼")),v={position:"absolute",top:"100%",..."bottom-end"===p?{right:"0"}:{left:"0"},marginTop:"4px",zIndex:"999"},k={boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #e5e7eb",borderRadius:"6px",padding:"4px 0",width:"number"==typeof f?`${f}px`:f,backgroundColor:"#ffffff",...i??{}},S=g?n("div",{style:v},n(Se,{orientation:"vertical",role:"menu",ariaLabel:`${t} menu`,styling:k},...o.map(e=>n(Ie,{key:e.id,item:e,itemStyle:d,closeOnSelect:u,onClose:m})))):null;return n("div",{ref:h,style:{position:"relative",display:"inline-block"}},y,S)},exports.EmptyState=function(e){return n("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",padding:"48px 24px",gap:"16px"}},e.image?n("img",{src:e.image,alt:"",style:{maxWidth:"200px",maxHeight:"160px",objectFit:"contain"}}):null,e.icon?n("div",{style:{fontSize:"48px",lineHeight:"1"}},e.icon):null,e.title?n("h3",{style:{margin:"0",fontSize:"20px",fontWeight:"600",color:"#111827",lineHeight:"1.4"}},e.title):null,e.description?n("p",{style:{margin:"0",fontSize:"14px",color:"#6b7280",maxWidth:"360px",lineHeight:"1.6"}},e.description):null,e.action?n("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)},exports.FileUpload=function(e){const t=e.id??`fu-${Math.random().toString(36).slice(2,8)}`,{onChange:o,accept:r,multiple:i=!1,maxSize:a,disabled:d=!1,label:p,helpText:u}=e,[f,g]=l([]),[x,h]=l(!1),[b,m]=l(""),y=c(null),v=s(e=>{m("");const t=[];for(const o of e)a&&o.size>a?m(`File "${o.name}" exceeds maximum size of ${pe(a)}`):t.push(o);const n=i?[...f,...t]:t.slice(0,1);g(n),o(n)},[f,i,a,o]),k=s(e=>{if(e.preventDefault(),e.stopPropagation(),h(!1),d)return;const t=e.dataTransfer;if(!t)return;const o=Array.from(t.files);v(o)},[d,v]),S=s(e=>{e.preventDefault(),e.stopPropagation(),d||h(!0)},[d]),w=s(e=>{e.preventDefault(),e.stopPropagation(),h(!1)},[]),C=s(e=>{const t=e.target;t.files&&(v(Array.from(t.files)),t.value="")},[v]),$=s(e=>{const t=f.filter((t,o)=>o!==e);g(t),o(t)},[f,o]),z=s(()=>{d||y.current&&y.current.click()},[d]),M={border:"2px dashed "+(x?"#3b82f6":b?"#ef4444":"#d1d5db"),borderRadius:"8px",padding:"24px",textAlign:"center",cursor:d?"not-allowed":"pointer",backgroundColor:x?"#eff6ff":"#fafafa",transition:"all 0.15s",opacity:d?"0.6":"1"},I={fontSize:"12px",color:"#9ca3af"},D=n("input",{id:t,ref:y,type:"file",accept:r,multiple:i,onChange:C,disabled:d,style:{display:"none"},tabIndex:-1}),F=n("div",{style:M,onClick:z,onKeyDown:e=>{const t=e.key;"Enter"!==t&&" "!==t||(e.preventDefault(),z())},onDrop:k,onDragOver:S,onDragLeave:w,role:"button",tabIndex:d?-1:0,"aria-label":"Upload files"},n("div",{style:{fontSize:"28px",color:"#9ca3af",marginBottom:"8px"}},"↑"),n("div",{style:{fontSize:"14px",color:"#374151",marginBottom:"4px"}},n("span",{style:{color:"#3b82f6",fontWeight:"500"}},"Click to upload")," or drag and drop"),r?n("div",{style:I},r):null,a?n("div",{style:I},`Max size: ${pe(a)}`):null),R=f.length>0?n("div",{style:{marginTop:"8px",display:"flex",flexDirection:"column",gap:"4px"}},...f.map((e,t)=>n("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"}},n("div",{style:{display:"flex",alignItems:"center",gap:"8px",overflow:"hidden"}},n("span",{style:{color:"#374151",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},e.name),n("span",{style:{color:"#9ca3af",fontSize:"11px",flexShrink:"0"}},pe(e.size))),n("button",{type:"button",style:{background:"none",border:"none",cursor:"pointer",color:"#ef4444",fontSize:"14px",padding:"2px 6px",borderRadius:"4px"},onClick:e=>{e.stopPropagation(),$(t)},"aria-label":`Remove ${e.name}`},"✕")))):null;return n(te,{label:p,helpText:u,error:b||void 0,disabled:d,htmlFor:t},n("div",null,D,F,R))},exports.FlexContainer=function(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 n("div",{className:`flex-container ${e.className??""}`.trim(),style:t},e.children)},exports.FlexItem=function(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 n("div",{className:`flex-item ${e.className??""}`.trim(),style:t},e.children)},exports.Footer=function(e){const{left:t,center:o,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:p,ariaLabel:u="Site footer"}=e;return n("footer",{className:p,role:"contentinfo","aria-label":u,style:{borderTop:i,background:l,color:a,fontSize:s,padding:d,marginTop:"48px"}},n("div",{style:{maxWidth:c,margin:"0 auto",display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:"12px"}},n("div",{style:{flex:"1",textAlign:"left",minWidth:"150px"}},t??null),n("div",{style:{flex:"1",textAlign:"center",minWidth:"150px"}},o??null),n("div",{style:{flex:"1",textAlign:"right",minWidth:"150px"}},r??null)))},exports.FormFieldWrapper=te,exports.GoogleAnalytics=function(e){const{measurementId:t,disabled:o=!1,debug:n=!1,anonymizeIp:r=!1,config:i}=e;return a(()=>{if(o||"undefined"==typeof window)return;!function(e){if("undefined"==typeof document)return;const t="specifyjs-gtag";if(document.getElementById(t))return;const o=document.createElement("script");o.id=t,o.async=!0,o.src=`https://www.googletagmanager.com/gtag/js?id=${encodeURIComponent(e)}`,document.head.appendChild(o)}(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),n&&(e.debug_mode=!0),window.gtag&&window.gtag("config",t,e),()=>{const e=document.getElementById("specifyjs-gtag");e&&e.remove()}},[t,o,n,r]),null},exports.Grid=function(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 n("div",{className:`grid ${e.className??""}`.trim(),style:t},e.children)},exports.GridItem=function(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 n("div",{className:`grid-item ${e.className??""}`.trim(),style:t},e.children)},exports.HypercubeGraph=function(e){const t=e.dimension??4,o=e.width??600,r=e.height??600,i=e.vertexRadius??10,p=e.edgeWidth??3,u=e.edgeColor??"#111",f=e.perspective??.25,g=e.rotationSpeed??.008,x=e.showLabels??!1,h=e.backgroundColor??"transparent",b=e.scale??.3*Math.min(o,r),m=Lt(t),y=1<<t,v=d(()=>"auto"===e.vertexColors||void 0===e.vertexColors?At(y):e.vertexColors,[y,e.vertexColors]),[k,S]=l(()=>{const e=[];for(let t=0;t<m;t++)e.push(0);return e}),[w,C]=l(!1),$=c({x:0,y:0}),z=c([]),M=c(0);a(()=>{if(0===g)return;let e=!0;const t=()=>{e&&(S(e=>{const t=e.slice();for(let e=0;e<t.length;e++)t[e]=(t[e]??0)+g*(1+.3*e);return t}),M.current=requestAnimationFrame(t))};return M.current=requestAnimationFrame(t),()=>{e=!1,cancelAnimationFrame(M.current)}},[g]);const I=d(()=>Rt(t,k,f,b),[t,k,f,b]),D=o/2,F=r/2,R=d(()=>I.edges.map(e=>{const t=I.vertices[e.source],o=I.vertices[e.target],n=(t.depth+o.depth)/2;return{...e,avgDepth:n,sv:t,tv:o}}).sort((e,t)=>e.avgDepth-t.avgDepth),[I]),L=d(()=>I.vertices.slice().sort((e,t)=>e.depth-t.depth),[I]),A=s(e=>{const t=e;C(!0),$.current={x:t.clientX,y:t.clientY},z.current=k.slice()},[k]),T=s(e=>{if(!w)return;const t=e,o=.01*(t.clientX-$.current.x),n=.01*(t.clientY-$.current.y);S(()=>{const e=z.current.slice();return e.length>0&&(e[0]=(e[0]??0)+o),e.length>1&&(e[1]=(e[1]??0)+n),e})},[w]),E=s(()=>{C(!1)},[]),W=R.map((e,t)=>{const o=(e=>{const t=(e+2)/4;return.3+.7*Math.max(0,Math.min(1,t))})(e.avgDepth);return n("line",{key:`e-${e.source}-${e.target}`,x1:String(D+e.sv.x),y1:String(F+e.sv.y),x2:String(D+e.tv.x),y2:String(F+e.tv.y),stroke:u,"stroke-width":String(p),"stroke-opacity":String(o),"stroke-linecap":"round"})}),B=L.map(e=>{const o=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=[n("circle",{key:`v-${e.id}-circle`,cx:String(D+e.x),cy:String(F+e.y),r:String(o),fill:r,stroke:"#000","stroke-width":"1.5",style:{filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.3))"}})];return x&&l.push(n("text",{key:`v-${e.id}-label`,x:String(D+e.x),y:String(F+e.y+o+14),"text-anchor":"middle","font-size":"11","font-family":"monospace",fill:"#555"},e.id.toString(2).padStart(t,"0"))),l});return n("svg",{width:"100%",viewBox:`0 0 ${o} ${r}`,preserveAspectRatio:"xMidYMid meet",style:{backgroundColor:h,cursor:w?"grabbing":"grab",userSelect:"none"},onMouseDown:A,onMouseMove:T,onMouseUp:E,onMouseLeave:E},...W,...B.flat())},exports.IDE=function(e){const[t,o]=l("App.ts"),[r,i]=l({src:!0,components:!0,hooks:!0}),[a,p]=l(-1),[u,f]=l(Xt.length),g=c(null),x=s(e=>{o(e);const t=Gt[e];t&&f(t.length)},[]),h=s(e=>{i(t=>{const o={},n=Object.keys(t);for(let e=0;e<n.length;e++)o[n[e]]=t[n[e]];return o[e]=!t[e],o})},[]),b=s(e=>{p(t=>t===e?-1:e)},[]),m=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":g.current&&(g.current.textContent="",f(1))}p(-1),g.current&&g.current.focus()},[]),y=s(()=>{if(g.current){const e=(g.current.textContent??"").split("\n");f(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"}),[]),k={padding:"3px 8px",fontSize:"12px",color:"#cccccc",cursor:"pointer",borderRadius:"3px",backgroundColor:"transparent",border:"none",position:"relative"},S={...k,backgroundColor:"rgba(255,255,255,0.1)"},w={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"},C={display:"block",width:"100%",padding:"6px 16px",fontSize:"12px",color:"#cccccc",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"},$={cursor:"pointer",padding:"0 6px",borderRadius:"3px",transition:"background-color 0.15s"},z=Gt[t]??Xt,M=z.map((e,t)=>{const o=function(e){if(!e.trim())return[{text:" ",color:Zt}];const t=[];let o=0;for(;o<e.length;){if("/"===e[o]&&"/"===e[o+1]){t.push({text:e.slice(o),color:"#6a9955"});break}if('"'===e[o]||"'"===e[o]||"`"===e[o]){const n=e[o];let r=o+1;for(;r<e.length&&e[r]!==n;)"\\"===e[r]&&r++,r++;r=Math.min(r+1,e.length),t.push({text:e.slice(o,r),color:"#ce9178"}),o=r;continue}if(/[0-9]/.test(e[o])&&(0===o||/[\s(,=:[\]{}+\-*/]/.test(e[o-1]))){let n=o;for(;n<e.length&&/[0-9.]/.test(e[n]);)n++;t.push({text:e.slice(o,n),color:"#b5cea8"}),o=n;continue}if(/[a-zA-Z_$]/.test(e[o])){let n=o;for(;n<e.length&&/[a-zA-Z0-9_$]/.test(e[n]);)n++;const r=e.slice(o,n);let i=n;for(;i<e.length&&" "===e[i];)i++;const l=i<e.length&&"("===e[i];let a=Zt;Kt.has(r)?a=Jt:Vt.has(r)?a="#4ec9b0":l?a="#dcdcaa":"true"!==r&&"false"!==r||(a=Jt),t.push({text:r,color:a}),o=n;continue}if(" "===e[o]||"\t"===e[o]){let n=o;for(;n<e.length&&(" "===e[n]||"\t"===e[n]);)n++;t.push({text:e.slice(o,n),color:Zt}),o=n;continue}t.push({text:e[o],color:"#d4d4d4"}),o++}return t}(e),r=[];let i=0;for(const e of o)r.push(n("span",{key:String(i++),style:{color:e.color}},e.text));return n("div",{key:String(t),style:{minHeight:"20px"}},...r)}),I=Math.max(u,z.length),D=[];for(let e=0;e<I;e++)D.push(n("div",{key:String(e)},String(e+1)));const F=e=>{if(!e.parent)return!0;if(!r[e.parent])return!1;const t=Ut.find(t=>t.name===e.parent&&t.isFolder);return!t||F(t)},R=Ot.map((e,t)=>{const o=[e],r=a===t;return r&&Yt[e]&&o.push(n("div",{key:"dropdown",style:w,className:"ide__menu-dropdown"},...Yt[e].map((e,t)=>n("button",{key:String(t),style:C,onClick:t=>{t.stopPropagation(),m(e.action)},role:"menuitem"},e.label)))),n("button",{key:String(t),style:r?S:k,role:"menuitem","aria-label":e,onClick:()=>b(t)},...o)}),L=Ut.map((e,o)=>{if(!F(e))return null;const i=!e.isFolder&&e.name===t,l=e.isFolder?r[e.name]?"📂 ":"📁 ":"📄 ";return n("div",{key:String(o),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?()=>h(e.name):()=>x(e.name)},l,e.name);var a,s,d}).filter(e=>null!==e);return n("div",{className:`ide ${e.className??""}`.trim(),style:v},n("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"),n("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),n("div",{style:{flex:"1",display:"flex",overflow:"hidden"}},n("nav",{className:"ide__sidebar",style:{width:"220px",backgroundColor:"#252526",borderRight:"none",display:"flex",flexDirection:"column",flexShrink:"0",overflowY:"auto"},"aria-label":"File explorer"},n("div",{style:{padding:"8px 12px",fontSize:"11px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#bbbbbb"}},"Explorer"),...L),n("div",{style:{width:"1px",backgroundColor:"#007acc",cursor:"col-resize",flexShrink:"0",opacity:"0.4",transition:"opacity 0.2s"}}),n("div",{style:{flex:"1",display:"flex",flexDirection:"column",overflow:"hidden"}},n("div",{style:{height:"35px",backgroundColor:"#252526",display:"flex",alignItems:"center",flexShrink:"0"}},n("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)),n("div",{style:{flex:"1",display:"flex",overflow:"auto",backgroundColor:"#1e1e1e",fontFamily:'"Cascadia Code", "Fira Code", "Consolas", monospace',fontSize:"13px",lineHeight:"20px"}},n("div",{style:{padding:"8px 0",textAlign:"right",color:"#858585",userSelect:"none",minWidth:"48px",paddingRight:"12px",paddingLeft:"12px",flexShrink:"0"},"aria-hidden":"true"},...D),n("code",{style:{padding:"8px 0",flex:"1",whiteSpace:"pre",overflowX:"auto",outline:"none",color:"#d4d4d4"},contentEditable:"true",ref:g,onInput:y,suppressContentEditableWarning:!0},...M))),n("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"},n("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)=>n("div",{key:String(t),style:{height:"2px",backgroundColor:e.trim()?"#555555":"transparent",borderRadius:"1px",width:`${Math.min(100,2*e.length)}%`}})))),n("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"}},n("div",{style:{display:"flex",gap:"16px"}},n("span",{style:$},"⎇ main"),n("span",{style:$},"0 errors"),n("span",{style:$},"0 warnings")),n("div",{style:{display:"flex",gap:"16px"}},n("span",{style:$},"Ln 1, Col 1"),n("span",{style:$},"UTF-8"),n("span",{style:$},"TypeScript"))))},exports.Image=function(e){const[t,o]=l("loading"),r=c(null),i=p(),s=!1!==e.lazy,u="number"==typeof e.width?`${e.width}px`:e.width,f="number"==typeof e.height?`${e.height}px`:e.height;a(()=>{o("loading")},[e.src]);const g=d(()=>{const t={display:"inline-block",position:"relative",overflow:"hidden"};return u&&(t.width=u),f&&(t.height=f),e.borderRadius&&(t.borderRadius=e.borderRadius),t},[u,f,e.borderRadius]),x=d(()=>{const o={display:"block",width:"100%",height:"100%"};return e.objectFit&&(o.objectFit=e.objectFit),"loading"===t&&(o.opacity="0",o.position="absolute"),"error"===t&&(o.display="none"),o},[e.objectFit,t]);let h=null;"loading"===t&&("skeleton"===e.placeholder?h=n("div",null,n("style",null,`@keyframes liq-img-shimmer-${i}{0%{background-position:-200% 0}100%{background-position:200% 0}}`),n("div",{style:{width:u??"100%",height:f??"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?h=n("div",{style:{width:u??"100%",height:f??"200px",backgroundColor:"#d1d5db",filter:"blur(20px)"}}):null!=e.placeholder&&!1!==e.placeholder&&(h=e.placeholder));let b=null;"error"===t&&null!=e.fallback&&(b="string"==typeof e.fallback?n("img",{src:e.fallback,alt:e.alt??"",style:{display:"block",width:"100%",height:"100%",objectFit:e.objectFit??"cover"}}):e.fallback);const m=n("div",{style:g},h,n("img",{ref:r,src:e.src,alt:e.alt??"",loading:s?"lazy":void 0,style:x,onload:()=>o("loaded"),onerror:()=>o("error")}),b);return e.caption?n("figure",{style:{margin:"0",display:"inline-block"}},m,n("figcaption",{style:{fontSize:"13px",color:"#6b7280",marginTop:"6px",textAlign:"center"}},e.caption)):m},exports.LineGraph=function(e){const{data:t,width:o=600,height:r=400,lineColor:i="#3b82f6",lineWidth:l=2,pointRadius:a=4,pointColor:s="#3b82f6",pointShape:c="circle",showPoints:p=!0,showGrid:u=!0,showArea:f=!1,areaColor:g="rgba(59,130,246,0.15)",xLabel:x,yLabel:h,title:b,padding:m=50,animate:y=!1,multiLine:v}=e,k=ht(d(()=>{const e=[...t];if(v)for(const t of v)e.push(...t.data);return e},[t,v]),o,r,m),{xScale:S,yScale:w,xTicks:C,yTicks:$}=k,z=[];if(z.push(n("rect",{x:0,y:0,width:"100%",fill:"white",key:"bg"})),u){for(let e=0;e<C.length;e++){const t=S(C[e]);z.push(n("line",{x1:t,y1:m,x2:t,y2:r-m,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-x-${e}`}))}for(let e=0;e<$.length;e++){const t=w($[e]);z.push(n("line",{x1:m,y1:t,x2:o-m,y2:t,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-y-${e}`}))}}z.push(n("line",{x1:m,y1:r-m,x2:o-m,y2:r-m,stroke:"#374151","stroke-width":1,key:"x-axis"})),z.push(n("line",{x1:m,y1:m,x2:m,y2:r-m,stroke:"#374151","stroke-width":1,key:"y-axis"}));for(let e=0;e<C.length;e++){const t=S(C[e]);z.push(n("line",{x1:t,y1:r-m,x2:t,y2:r-m+5,stroke:"#374151",key:`xtick-${e}`})),z.push(n("text",{x:t,y:r-m+18,"text-anchor":"middle","font-size":11,fill:"#6b7280",key:`xlabel-${e}`},bt(C[e])))}for(let e=0;e<$.length;e++){const t=w($[e]);z.push(n("line",{x1:m-5,y1:t,x2:m,y2:t,stroke:"#374151",key:`ytick-${e}`})),z.push(n("text",{x:m-10,y:t+4,"text-anchor":"end","font-size":11,fill:"#6b7280",key:`ylabel-${e}`},bt($[e])))}function M(e,t,o,r,i,l,a,s,d,c){if(0===e.length)return;const p=[...e].sort((e,t)=>e.x-t.x);if(r){const e=w(k.yMin),t=p.map(e=>`${S(e.x)},${w(e.y)}`).join(" "),o=`${S(p[0].x)},${e} ${t} ${S(p[p.length-1].x)},${e}`;z.push(n("polygon",{points:o,fill:i,key:`${c}-area`}))}const u={points:p.map(e=>`${S(e.x)},${w(e.y)}`).join(" "),fill:"none",stroke:t,"stroke-width":o,"stroke-linejoin":"round","stroke-linecap":"round",key:`${c}-line`};if(y?(u["stroke-dasharray"]="1000",u["stroke-dashoffset"]="1000",z.push(n("polyline",u,n("animate",{attributeName:"stroke-dashoffset",from:1e3,to:0,dur:"1.5s",fill:"freeze"})))):z.push(n("polyline",u)),l)for(let e=0;e<p.length;e++){const t=S(p[e].x),o=w(p[e].y),r=p[e].shape??d,i=p[e].radius??s,l=`${c}-pt-${e}`;if(y){const e=mt(r,t,o,i,a,l,{opacity:0});z.push(n("g",{key:`${l}-g`},e,n("animate",{attributeName:"opacity",from:0,to:1,dur:"0.3s",begin:"1.2s",fill:"freeze"})))}else z.push(mt(r,t,o,i,a,l))}}if(M(t,i,l,f,g,p,s,a,c,"primary"),v)for(let e=0;e<v.length;e++){const t=v[e];M(t.data,t.color,l,!1,"transparent",p,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}`}))];for(let o=0;o<t.length;o++){const r=m+10+120*o,i=m-30;e.push(n("rect",{x:r,y:i,width:14,height:14,fill:t[o].color,rx:2,key:`legend-rect-${o}`})),e.push(n("text",{x:r+20,y:i+12,"font-size":12,fill:"#374151",key:`legend-text-${o}`},t[o].label))}z.push(n("g",{key:"legend"},...e))}return x&&z.push(n("text",{x:o/2,y:r-8,"text-anchor":"middle","font-size":13,fill:"#374151",key:"x-axis-label"},x)),h&&z.push(n("text",{x:14,y:r/2,"text-anchor":"middle","font-size":13,fill:"#374151",transform:`rotate(-90, 14, ${r/2})`,key:"y-axis-label"},h)),b&&z.push(n("text",{x:o/2,y:20,"text-anchor":"middle","font-size":16,"font-weight":"bold",fill:"#111827",key:"title"},b)),n("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${o} ${r}`,preserveAspectRatio:"xMidYMid meet"},...z)},exports.ListView=function(e){const{items:t,renderItem:o,keyExtractor:r,divider:i=!1,hoverable:l=!1,selectedIndex:a,onSelect:s,emptyMessage:d="No items",header:c,footer:p}=e;if(0===t.length)return n("div",null,c?n("div",{style:U},c):null,n("div",{style:Y},d),p?n("div",{style:{...U,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},p):null);const u=[];for(let e=0;e<t.length;e++){const d=t[e],c=r(d,e),p=a===e,f=e===t.length-1,g={...j,...l?q:{},...p?O:{},...i&&!f?_:{}};u.push(n("li",{key:c,style:g,onClick:s?()=>s(e):void 0,onKeyDown:s?t=>{const o=t.key;"Enter"!==o&&" "!==o||(t.preventDefault(),s(e))}:void 0,role:s?"option":void 0,tabIndex:s?0:void 0,"aria-selected":s?String(p):void 0},o(d,e)))}return n("div",null,c?n("div",{style:U},c):null,n("ul",{style:H,role:s?"listbox":"list"},...u),p?n("div",{style:{...U,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},p):null)},exports.Menubar=function(e){const{menus:t}=e,[o,r]=l(null),i=c(null),d=s(e=>{r(e)},[]),p=s(()=>{r(null)},[]);a(()=>{if(null===o)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)}},[o]),a(()=>{const e=i.current;if(!e)return;const n=n=>{const i=n;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!==o){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",n),()=>{e.removeEventListener("keydown",n)}},[o,t.length]);const u=t.map((e,t)=>n(Fe,{key:String(t),menu:e,index:t,isOpen:o===t,anyOpen:null!==o,onOpen:d,onClose:p}));return n("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)},exports.Modal=function(e){const{open:t,onClose:o,title:r,size:i="md",closeOnOverlay:l=!0,closeOnEscape:s=!0,footer:d,showCloseButton:p=!0,children:u}=e,f=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&&o()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t,s,o]),a(()=>{t&&f.current&&f.current.focus()},[t]),!t)return null;const g={backgroundColor:"#fff",borderRadius:"full"===i?"0":"8px",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.3)",maxHeight:"full"===i?"100vh":"90vh",width:Ge[i],maxWidth:"full"===i?"100vw":"90vw",display:"flex",flexDirection:"column",outline:"none",overflow:"hidden"},x=[],h=r?"modal-title":void 0;r?x.push(n("h2",{id:h,style:{margin:"0",fontSize:"18px",fontWeight:"600",color:"#111827"}},r)):x.push(n("span",null)),p&&x.push(n("button",{type:"button",style:{background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",borderRadius:"4px",lineHeight:"1"},onClick:o,"aria-label":"Close modal"},"×"));const b=[n("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 24px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"}},...x),n("div",{style:{padding:"24px",overflow:"auto",flex:"1"}},u)];return d&&b.push(n("div",{style:{padding:"16px 24px",borderTop:"1px solid #e5e7eb",flexShrink:"0"}},d)),n("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&&o()},"aria-modal":"true",role:"dialog","aria-labelledby":h},n("div",{ref:f,style:g,tabIndex:-1,role:"document"},...b))},exports.MultilineField=function(e){const[t,o]=l(!1),[r,i]=l((e.value??e.defaultValue??"").length),a=e.id??`ml-${Math.random().toString(36).slice(2,8)}`,d={...oe(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}:{}},c=s(t=>{const o=t.target,n=o.value;i(n.length),e.onChange&&e.onChange(n),e.autoResize&&(o.style.height="auto",o.style.height=`${o.scrollHeight}px`)},[e.onChange,e.autoResize]),p=n("textarea",{id:a,name:e.name,value:e.value,placeholder:e.placeholder,rows:String(e.rows??4),maxLength:e.maxLength?String(e.maxLength):void 0,readOnly:e.readOnly,disabled:e.disabled,"aria-invalid":e.error?"true":void 0,"aria-required":e.required?"true":void 0,className:`multiline-input ${e.className??""}`.trim(),style:d,onFocus:()=>o(!0),onBlur:t=>{o(!1),e.onBlur&&e.onBlur(t.target.value)},onInput:c}),u=e.showCount&&e.maxLength?n("div",{style:{fontSize:"11px",color:r>.9*(e.maxLength??1/0)?"#ef4444":"#9ca3af",textAlign:"right",marginTop:"2px"}},`${r}/${e.maxLength}`):e.showCount?n("div",{style:{fontSize:"11px",color:"#9ca3af",textAlign:"right",marginTop:"2px"}},`${r} characters`):null;return n(te,{label:e.label,htmlFor:a,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},p,u)},exports.NavWrapper=Se,exports.NumberSpinner=function(e){const t=e.id??`ns-${Math.random().toString(36).slice(2,8)}`,{value:o,onChange:r,min:i,max:a,step:d=1,disabled:c=!1,prefix:p,suffix:u,label:f,error:g}=e,[x,h]=l(!1),b=s(e=>{let t=e;return void 0!==i&&t<i&&(t=i),void 0!==a&&t>a&&(t=a),t},[i,a]),m=s(()=>{c||r(b(o+d))},[c,o,d,b,r]),y=s(()=>{c||r(b(o-d))},[c,o,d,b,r]),v=s(e=>{const t=e.target.value;if(""===t||"-"===t)return;const o=parseFloat(t);isNaN(o)||r(b(o))},[b,r]),k=s(e=>{c||("ArrowUp"===e.key?(e.preventDefault(),m()):"ArrowDown"===e.key&&(e.preventDefault(),y()))},[c,m,y]),S=void 0===a||o<a,w={display:"inline-flex",alignItems:"stretch",borderRadius:"6px",overflow:"hidden",border:"1px solid "+(g?"#ef4444":x?"#3b82f6":"var(--color-border, #d1d5db)"),transition:"border-color 0.15s",opacity:c?"0.6":"1",...x&&!g?{boxShadow:"0 0 0 3px #3b82f622"}:{}},C=e=>({display:"flex",alignItems:"center",justifyContent:"center",width:"36px",backgroundColor:"var(--color-bg-subtle, #f9fafb)",border:"none",cursor:c||!e?"not-allowed":"pointer",color:c||!e?"#d1d5db":"var(--color-text, #374151)",fontSize:"inherit",fontWeight:"600",userSelect:"none",transition:"background-color 0.1s",borderRight:"none",borderLeft:"none"}),$={display:"flex",alignItems:"center",fontSize:"inherit",color:"var(--color-text-muted, #6b7280)",padding:"0 2px",backgroundColor:"var(--color-bg-subtle, #f9fafb)"},z=n("button",{type:"button",style:C(void 0===i||o>i),onClick:y,disabled:c,"aria-label":"Decrement",tabIndex:-1},"−"),M=p?n("span",{style:$},p):null,I=n("input",{id:t,type:"text",value:String(o),onInput:v,onKeyDown:k,onFocus:()=>h(!0),onBlur:()=>h(!1),disabled:c,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":f||"Number",role:"spinbutton","aria-valuenow":String(o),"aria-valuemin":void 0!==i?String(i):void 0,"aria-valuemax":void 0!==a?String(a):void 0}),D=u?n("span",{style:$},u):null,F=n("button",{type:"button",style:C(S),onClick:m,disabled:c,"aria-label":"Increment",tabIndex:-1},"+"),R=[z];return M&&R.push(M),R.push(I),D&&R.push(D),R.push(F),n(te,{label:f,error:g,disabled:c,htmlFor:t},n("div",{style:w},...R))},exports.Pagination=function(e){const{total:t,pageSize:o,currentPage:r,onChange:i,siblingCount:l=1,showFirstLast:a=!0,showPrevNext:d=!0,disabled:c=!1}=e,p=Math.max(1,Math.ceil(t/o)),u=Math.min(Math.max(1,r),p),f=s(e=>{!c&&e>=1&&e<=p&&e!==u&&i(e)},[c,p,u,i]),g=(e,t,o)=>{const r=c||t<1||t>p||t===u;return n("button",{type:"button",onClick:()=>f(t),disabled:r||void 0,"aria-label":o,style:r?Te:Le},e)},x=function(e,t,o){if(e<=2*o+5)return Re(1,e);const n=Math.max(t-o,1),r=Math.min(t+o,e),i=n>2,l=r<e-1;return!i&&l?[...Re(1,2*o+3),"ellipsis",e]:i&&!l?[1,"ellipsis",...Re(e-2*o-2,e)]:[1,"ellipsis",...Re(n,r),"ellipsis",e]}(p,u,l);let h=0;const b=[];a&&b.push(g("«",1,"Go to first page")),d&&b.push(g("‹",u-1,"Go to previous page"));for(const e of x)if("ellipsis"===e)b.push(n("span",{key:"ellipsis-"+h++,style:Ee},"..."));else{const t=e===u;b.push(n("button",{key:String(e),type:"button",onClick:()=>f(e),disabled:c||void 0,"aria-label":`Page ${e}`,"aria-current":t?"page":void 0,style:c?Te:t?Ae:Le},String(e)))}return d&&b.push(g("›",u+1,"Go to next page")),a&&b.push(g("»",p,"Go to last page")),n(Se,{orientation:"horizontal",role:"navigation",ariaLabel:"Pagination",keyboardNav:!0,styling:{border:"none",borderRadius:"0",backgroundColor:"transparent",padding:"0",custom:{gap:"4px"}}},...b)},exports.Panel=function(e){const t=!1!==e.bordered,o=e.shadow??"none",[r,i]=l(!!e.defaultCollapsed),p=c(null),[u,f]=l("auto");a(()=>{if(!e.collapsible)return;const t=p.current;t&&f(`${t.scrollHeight}px`)},[e.children,e.collapsible]);const g=s(()=>{e.collapsible&&i(e=>!e)},[e.collapsible]),x=s(t=>{if(!e.collapsible)return;const o=t.key;"Enter"!==o&&" "!==o||(t.preventDefault(),g())},[e.collapsible,g]),h=d(()=>{const n={borderRadius:"6px",overflow:"hidden",backgroundColor:"#ffffff"};return t&&(n.border="1px solid #e5e7eb"),n.boxShadow=me[o]??me.none,{...n,...e.style??{}}},[t,o,e.style]),b={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",gap:"8px",backgroundColor:"#f9fafb",userSelect:"none",cursor:e.collapsible?"pointer":"default"},m={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"},y={maxHeight:r?"0":u,overflow:"hidden",transition:"max-height 0.3s ease"};return n("div",{className:`panel ${e.className??""}`.trim(),style:h},n("div",{className:"panel__header",style:b,onClick:g,onKeyDown:x,role:e.collapsible?"button":void 0,tabIndex:e.collapsible?0:void 0,"aria-expanded":e.collapsible?String(!r):void 0},n("div",{style:{display:"flex",alignItems:"center",flex:"1",minWidth:"0",gap:"8px"}},e.collapsible?n("span",{className:"panel__chevron",style:m}):null,e.icon?n("span",{className:"panel__icon"},e.icon):null,e.title?n("span",{className:"panel__title",style:{fontSize:"14px",fontWeight:"600",color:"#111827"}},e.title):null),e.headerRight?n("div",{className:"panel__header-right"},e.headerRight):null),n("div",{className:"panel__body-wrapper",style:e.collapsible?y:{},ref:p},n("div",{className:"panel__body",style:{padding:"16px"}},e.children)))},exports.PieGraph=function(e){const{data:t,width:o=400,height:r=400,innerRadius:i=0,padAngle:l=.02,showLabels:a=!0,showValues:s=!0,showLegend:c=!0,legendPosition:p="right",title:u,centerLabel:f,colors:g,strokeColor:x="#fff",strokeWidth:h=2}=e,b=c&&"right"===p?140:0,m=u?30:0,y=c&&"bottom"===p?22*Math.ceil(t.length/2)+10:0,v=o-b,k=r-m-y,S=v/2,w=m+k/2,C=Math.min(v,k)/2-10,$=e.outerRadius??C,z=d(()=>kt(t,{padAngle:l,colors:g}),[t,l,g]),M=[];u&&M.push(n("text",{key:"title",x:v/2,y:20,textAnchor:"middle",fontFamily:"sans-serif",fontSize:16,fontWeight:"bold",fill:"#333"},u));for(let e=0;e<z.length;e++){const t=z[e],o=vt(S,w,i,$,t.startAngle,t.endAngle);if(M.push(n("path",{key:`slice-${e}`,d:o,fill:t.color,stroke:x,strokeWidth:h})),a||s){const o=(t.startAngle+t.endAngle)/2,r=t.percentage<5,l=yt(S,w,r?$+14:i+.65*($-i),o-Math.PI/2),d=r?"#333":"#fff",c=r?11:12,p=[];if(a&&p.push(t.label),s&&p.push(`${t.percentage.toFixed(1)}%`),r){const t=yt(S,w,$+2,o-Math.PI/2);M.push(n("line",{key:`connector-${e}`,x1:t.x,y1:t.y,x2:l.x,y2:l.y,stroke:"#999",strokeWidth:1}))}a&&M.push(n("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&&M.push(n("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(f&&i>0&&M.push(n("text",{key:"center-label",x:S,y:w,textAnchor:"middle",dominantBaseline:"central",fontFamily:"sans-serif",fontSize:14,fontWeight:"bold",fill:"#333"},f)),c){const e=[];if("right"===p){const t=v+10,o=m+20;for(let r=0;r<z.length;r++){const i=z[r],l=o+22*r;e.push(n("circle",{key:`legend-dot-${r}`,cx:t+6,cy:l,r:6,fill:i.color})),e.push(n("text",{key:`legend-text-${r}`,x:t+18,y:l,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:"#333"},`${i.label} (${i.percentage.toFixed(1)}%)`))}}else{const t=r-y+10;for(let r=0;r<z.length;r++){const i=z[r],l=r%2*(o/2)+10,a=t+22*Math.floor(r/2);e.push(n("circle",{key:`legend-dot-${r}`,cx:l+6,cy:a,r:6,fill:i.color})),e.push(n("text",{key:`legend-text-${r}`,x:l+18,y:a,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:"#333"},`${i.label} (${i.percentage.toFixed(1)}%)`))}}M.push(...e)}return n("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${o} ${r}`,preserveAspectRatio:"xMidYMid meet"},...M)},exports.PolarGraph2D=function(e){const{width:t=400,height:o=400,rRange:r=[0,2],plotFunction:i,plotResolution:p=360,thetaStep:u,sync:f=!1,points:g=[],showGrid:x=!0,pointRadius:h=3,pointColor:b="#3b82f6",curveColor:m="#3b82f6",onPointClick:y,onPointDoubleClick:v,onPointContextMenu:k,onPointHover:S}=e,[w,C]=l(r[1]),[$,z]=l(0),[M,I]=l(0),[D,F]=l(null),R=t/2+$,L=o/2+M,A=Math.min(t,o)/2-30,T=A/w,E=d(()=>{const e=Math.max(1,Math.ceil(w)),t=[],o=w/e;for(let n=1;n<=e;n++)t.push(o*n);return t},[w]),W=d(()=>{const e=[];for(let t=0;t<360;t+=30)e.push(t*Math.PI/180);return e},[]),B=d(()=>{if(!i||!f)return[];const e=u??2*Math.PI/p,t=it({start:0,end:2*Math.PI,step:e});return lt(i,t)},[i,p,u,f]),[N,P]=l([]),H=c(null);a(()=>{if(!i||f)return void P([]);const e=u??2*Math.PI/p,t=it({start:0,end:2*Math.PI,step:e});return H.current&&H.current(),H.current=at(i,t,200,e=>{P([...e])}),()=>{H.current&&H.current()}},[i,p,u,f]);const j=f?B:N,_=d(()=>{if(0===j.length)return"";const e=[];for(let t=0;t<j.length;t++){const o=j[t],n=o.output;if(n<0||!isFinite(n))continue;const{x:r,y:i}=St(n,o.input,R,L,T);e.push(`${0===e.length?"M":"L"}${r.toFixed(2)},${i.toFixed(2)}`)}return e.join(" ")},[j,R,L,T]),q=s(e=>{F({x:e.clientX,y:e.clientY,px:$,py:M})},[$,M]),O=s(e=>{D&&(z(D.px+(e.clientX-D.x)),I(D.py+(e.clientY-D.y)))},[D]),Y=s(()=>{F(null)},[]),U=s(e=>{e.preventDefault();const t=e.deltaY>0?1.15:1/1.15;C(Math.max(.1,w*t))},[w]),G=s((e,t,o)=>{if(e)return n=>e({r:t.r,theta:t.theta,index:o,event:n})},[]),X=[];if(X.push(n("rect",{x:0,y:0,width:t,height:o,fill:"white",key:"bg"})),x){for(let e=0;e<E.length;e++){const t=E[e]*T;X.push(n("circle",{cx:R,cy:L,r:t,fill:"none",stroke:"#e5e7eb","stroke-width":1,key:`gc-${e}`})),X.push(n("text",{x:R+t+2,y:L-4,"font-size":10,fill:"#9ca3af",key:`gl-${e}`},E[e].toFixed(1)))}for(let e=0;e<W.length;e++){const t=W[e],o=E[E.length-1]*T,r=R+o*Math.cos(t),i=L-o*Math.sin(t);X.push(n("line",{x1:R,y1:L,x2:r,y2:i,stroke:"#e5e7eb","stroke-width":1,key:`al-${e}`}));const l=Math.round(180*t/Math.PI),a=R+(o+14)*Math.cos(t),s=L-(o+14)*Math.sin(t);X.push(n("text",{x:a,y:s+4,"text-anchor":"middle","font-size":10,fill:"#9ca3af",key:`at-${e}`},`${l}°`))}}X.push(n("line",{x1:R-A,y1:L,x2:R+A,y2:L,stroke:"#d1d5db","stroke-width":1,key:"x-axis"})),X.push(n("line",{x1:R,y1:L-A,x2:R,y2:L+A,stroke:"#d1d5db","stroke-width":1,key:"y-axis"})),_&&X.push(n("path",{d:_,fill:"none",stroke:m,"stroke-width":2,key:"curve"}));for(let e=0;e<g.length;e++){const t=g[e],{x:o,y:r}=St(t.r,t.theta,R,L,T);X.push(n("circle",{cx:o,cy:r,r:h,fill:b,key:`pt-${e}`,style:{cursor:"pointer"},onClick:G(y,t,e),onDblClick:G(v,t,e),onContextMenu:G(k,t,e),onMouseEnter:G(S,t,e)}))}return n("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${t} ${o}`,preserveAspectRatio:"xMidYMid meet",style:{cursor:D?"grabbing":"grab"},onMouseDown:q,onMouseMove:O,onMouseUp:Y,onMouseLeave:Y,onWheel:U},...X)},exports.Popover=function(e){const{trigger:t,content:o,open:r,placement:i="bottom",offset:d=4,arrow:p=!1,closeOnClickOutside:u=!0,onOpenChange:f}=e,g=void 0!==r,[x,h]=l(!1),b=g?r:x,m=c(null),y=s(()=>{g?f&&f(!r):h(e=>!e)},[g,r,f]);a(()=>{if(!b||!u)return;const e=e=>{m.current&&!m.current.contains(e.target)&&(g?f&&f(!1):h(!1))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[b,u,g,f]);const v={...Xe(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"},k=[o];p&&k.push(n("div",{style:Ke(i)}));const S=s(e=>{const t=e.key;"Enter"!==t&&" "!==t||(e.preventDefault(),y())},[y]),w=[n("div",{onClick:y,onKeyDown:S,role:"button",tabIndex:0,style:{display:"inline-block"}},t)];return b&&w.push(n("div",{style:v},...k)),n("div",{ref:m,style:{position:"relative",display:"inline-block"}},...w)},exports.ProgressBar=function(e){const t=e.max??100,o=e.indeterminate?0:Math.min(Math.max(e.value??0,0),t),r=t>0?o/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=p();if("circular"===s){const t="number"==typeof e.size?e.size:48,o=Math.max(2,Math.round(t/10)),a=(t-o)/2,s=2*Math.PI*a,d=e.indeterminate?.75*s:s-r/100*s,p=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 n("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"}},p?n("style",null,p):null,n("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`}:{}},n("circle",{cx:String(t/2),cy:String(t/2),r:String(a),fill:"none",stroke:l,"stroke-width":String(o)}),n("circle",{cx:String(t/2),cy:String(t/2),r:String(a),fill:"none",stroke:i,"stroke-width":String(o),"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?n("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}}`:"",f=e.indeterminate?`@keyframes liq-indeterminate-${c}{0%{left:-40%;width:40%}50%{left:20%;width:60%}100%{left:100%;width:40%}}`:"",g={width:"100%",height:a,backgroundColor:l,borderRadius:a,overflow:"hidden",position:"relative"},x=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 o=Math.min(255,parseInt(t.slice(0,2),16)+40),n=Math.min(255,parseInt(t.slice(2,4),16)+40),r=Math.min(255,parseInt(t.slice(4,6),16)+40);return`#${o.toString(16).padStart(2,"0")}${n.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 n("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||f?n("style",null,u+f):null,e.showLabel&&!e.indeterminate?n("div",{style:{marginBottom:"4px",fontSize:"12px",color:"#374151",textAlign:"right"}},`${Math.round(r)}%`):null,n("div",{style:g},n("div",{style:x})))},exports.RadioGroup=function(e){const{options:t,value:o,onChange:r,name:i,direction:l="vertical",disabled:a=!1,error:d,label:c}=e,p=s(e=>{a||r(e)},[a,r]),u=s(e=>{if(a)return;const n=t.filter(e=>!e.disabled);if(0===n.length)return;const i=n.findIndex(e=>e.value===o);let l=i;if("ArrowDown"===e.key||"ArrowRight"===e.key)e.preventDefault(),l=i<n.length-1?i+1:0;else{if("ArrowUp"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault(),l=i>0?i-1:n.length-1}r(n[l].value)},[a,t,o,r]),f={display:"flex",flexDirection:"horizontal"===l?"row":"column",gap:"horizontal"===l?"16px":"8px"},g=t.map(e=>{const t=e.value===o,r=a||!!e.disabled,l={width:"18px",height:"18px",minWidth:"18px",borderRadius:"50%",border:"2px solid "+(d?"#ef4444":t?"#3b82f6":"#d1d5db"),display:"flex",alignItems:"center",justifyContent:"center",transition:"border-color 0.15s",boxSizing:"border-box"},s={width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"#3b82f6",transition:"transform 0.15s",transform:t?"scale(1)":"scale(0)"},c={display:"inline-flex",alignItems:"center",gap:"8px",cursor:r?"not-allowed":"pointer",opacity:r?"0.5":"1",userSelect:"none"};return n("label",{key:e.value,style:c,onClick:r?void 0:t=>{t.preventDefault(),p(e.value)}},n("input",{type:"radio",name:i,value:e.value,checked:t,disabled:r,style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},tabIndex:-1}),n("div",{style:l},n("div",{style:s})),n("span",{style:{fontSize:"14px",color:"#374151"}},e.label))});return n(te,{label:c,error:d},n("div",{style:f,role:"radiogroup","aria-label":c,onKeyDown:u,tabIndex:a?-1:0},...g))},exports.ScrollContainer=function(e){const t=e.direction??"vertical",o=e.showScrollbar??"auto",r=e.shadow??!1,i=c(null),[p,u]=l(!0),[f,g]=l(!1),[x,h]=l(!0),[b,m]=l(!1),y=s(()=>{const e=i.current;e&&(u(e.scrollTop<=2),g(e.scrollTop+e.clientHeight>=e.scrollHeight-2),h(e.scrollLeft<=2),m(e.scrollLeft+e.clientWidth>=e.scrollWidth-2))},[]);a(()=>{y()},[y]);const v=s(()=>{r&&y()},[r,y]),k=d(()=>{const n={position:"relative",overflowX:ye(t,"x"),overflowY:ye(t,"y"),...ve(o)};return e.maxHeight&&(n.maxHeight=e.maxHeight),e.maxWidth&&(n.maxWidth=e.maxWidth),e.padding&&(n.padding=e.padding),{...n,...e.style??{}}},[t,o,e.maxHeight,e.maxWidth,e.padding,e.style]),S=[];if(r){const e="vertical"===t||"both"===t,o="horizontal"===t||"both"===t;e&&!p&&S.push("inset 0 8px 6px -6px rgba(0,0,0,0.15)"),e&&!f&&S.push("inset 0 -8px 6px -6px rgba(0,0,0,0.15)"),o&&!x&&S.push("inset 8px 0 6px -6px rgba(0,0,0,0.15)"),o&&!b&&S.push("inset -8px 0 6px -6px rgba(0,0,0,0.15)")}const w={...k};return S.length>0&&(w.boxShadow=S.join(", ")),n("div",{className:`scroll-container scroll-container--${t} ${e.className??""}`.trim(),style:w,ref:i,onScroll:v},e.children)},exports.Select=function(e){const t=e.id??`sel-${Math.random().toString(36).slice(2,8)}`,{options:o,value:r,onChange:i,placeholder:p="Select...",searchable:u=!1,multiple:f=!1,clearable:g=!1,disabled:x=!1,error:h,label:b,helpText:m}=e,[y,v]=l(!1),[k,S]=l(""),[w,C]=l(-1),$=c(null),z=d(()=>Array.isArray(r)?r:r?[r]:[],[r]),M=d(()=>{if(!u||!k)return o;const e=k.toLowerCase();return o.filter(t=>t.label.toLowerCase().includes(e))},[o,k,u]),I=d(()=>{const e={},t=[];for(const o of M)o.group?(e[o.group]||(e[o.group]=[]),e[o.group].push(o)):t.push(o);return{groups:e,ungrouped:t}},[M]),D=d(()=>0===z.length?"":z.map(e=>o.find(t=>t.value===e)).filter(Boolean).map(e=>e.label).join(", "),[z,o]);a(()=>{const e=e=>{const t=e.target;$.current&&!$.current.contains(t)&&(v(!1),S(""))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const F=s(e=>{if(f){const t=z.includes(e)?z.filter(t=>t!==e):[...z,e];i(t)}else i(e),v(!1),S("")},[f,z,i]),R=s(e=>{e.stopPropagation(),i(f?[]:"")},[f,i]),L=s(e=>{if(x)return;const t=e.key;if(!y&&("Enter"===t||" "===t||"ArrowDown"===t))return e.preventDefault(),v(!0),void C(0);if(y){if("Escape"===t)return v(!1),void S("");if("ArrowDown"===t)e.preventDefault(),C(e=>Math.min(e+1,M.length-1));else if("ArrowUp"===t)e.preventDefault(),C(e=>Math.max(e-1,0));else if("Enter"===t&&w>=0&&w<M.length){e.preventDefault();const t=M[w];t.disabled||F(t.value)}}},[x,y,w,M,F]),A={...oe({},{focused:y,error:!!h}),display:"flex",alignItems:"center",justifyContent:"space-between",cursor:x?"not-allowed":"pointer",minHeight:"38px",userSelect:"none"},T=(e,t)=>{const o=z.includes(e.value),r=t===w,i={padding:"8px 12px",cursor:e.disabled?"not-allowed":"pointer",backgroundColor:r?"#f3f4f6":o?"#eff6ff":"transparent",color:e.disabled?"#9ca3af":"#1f2937",display:"flex",alignItems:"center",gap:"8px",fontSize:"14px"};return n("div",{key:e.value,style:i,onClick:e.disabled?void 0:()=>F(e.value),onMouseEnter:()=>C(t),role:"option","aria-selected":o?"true":"false","aria-disabled":e.disabled?"true":void 0},f&&o?n("span",{style:{color:"#3b82f6",fontWeight:"700"}},"✓"):null,e.label)},E=n("span",{style:{marginLeft:"8px",fontSize:"10px",transition:"transform 0.15s",transform:y?"rotate(180deg)":"rotate(0deg)",color:"#6b7280"}},"▼"),W=n("div",{style:A,id:t,onClick:x?void 0:()=>{v(!y),C(-1)},onKeyDown:L,tabIndex:x?-1:0,role:"combobox","aria-expanded":y?"true":"false","aria-haspopup":"listbox"},n("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:D?"#1f2937":"#9ca3af"}},D||p),n("span",{style:{display:"flex",alignItems:"center",gap:"4px"}},g&&z.length>0?n("span",{onClick:R,onKeyDown:e=>{const t=e.key;"Enter"!==t&&" "!==t||(e.preventDefault(),e.stopPropagation(),R(e))},style:{cursor:"pointer",color:"#9ca3af",fontSize:"14px",lineHeight:"1"},role:"button",tabIndex:0,"aria-label":"Clear selection"},"✕"):null,E)),B=u&&y?n("input",{type:"text",value:k,onInput:e=>{S(e.target.value),C(0)},placeholder:"Search...",style:{width:"100%",boxSizing:"border-box",padding:"8px 12px",border:"none",borderBottom:"1px solid #e5e7eb",outline:"none",fontSize:"14px"}}):null,N=y?n("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:o,ungrouped:r}=I;for(const o of r)e.push(T(o,t++));for(const r of Object.keys(o)){e.push(n("div",{key:`group-${r}`,style:{padding:"6px 12px",fontSize:"11px",fontWeight:"600",color:"#6b7280",textTransform:"uppercase",letterSpacing:"0.05em"}},r));for(const n of o[r])e.push(T(n,t++))}return 0===e.length&&e.push(n("div",{style:{padding:"8px 12px",color:"#9ca3af",fontSize:"14px"}},"No options")),e})()):null;return n(te,{label:b,error:h,helpText:m,disabled:x,htmlFor:t},n("div",{ref:$,style:{position:"relative"}},W,N))},exports.Sidebar=function(e){const{items:t,collapsed:o=!1,onToggleCollapse:r,selectedId:i,onSelect:l,width:a="240px",collapsedWidth:s="56px"}=e,d=o?"number"==typeof s?`${s}px`:s:"number"==typeof a?`${a}px`:a,c=r?n("button",{type:"button",onClick:r,"aria-label":o?"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"}},o?"▶":"◀"):null,p=t.map(e=>n(We,{key:e.id,item:e,collapsed:o,selectedId:i,onSelect:l,depth:0}));return n(Se,{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,...p)},exports.Skeleton=function(e){const t=e.variant??"text",o=!1!==e.animated,r=p(),i=d(()=>o?`@keyframes liq-shimmer-${r}{0%{background-position:-200% 0}100%{background-position:200% 0}}`:"",[o,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(n("div",{key:String(i),style:Z({width:d?"75%":l??"100%",height:a??"1em",borderRadius:e.borderRadius??"4px",animated:o,animId:r,marginBottom:i<t-1?"8px":"0"})}))}return n("div",{"aria-hidden":"true",style:{width:l??"100%"}},i?n("style",null,i):null,...s)}if("circular"===t){const e=l??a??"40px";return n("div",{"aria-hidden":"true"},i?n("style",null,i):null,n("div",{style:Z({width:e,height:e,borderRadius:"50%",animated:o,animId:r})}))}return n("div",{"aria-hidden":"true"},i?n("style",null,i):null,n("div",{style:Z({width:l??"100%",height:a??"100px",borderRadius:e.borderRadius??"4px",animated:o,animId:r})}))},exports.Slider=function(e){const t=e.id??`sl-${Math.random().toString(36).slice(2,8)}`,{value:o,onChange:r,min:i=0,max:p=100,step:u=1,showValue:f=!1,showTicks:g=!1,disabled:x=!1,marks:h,range:b=!1,label:m,error:y}=e,v=c(null),[k,S]=l(null),w=d(()=>{if(b&&Array.isArray(o))return o;const e="number"==typeof o?o:0;return[e,e]},[o,b]),C=e=>{const t=Math.round((e-i)/u)*u+i;return Math.max(i,Math.min(p,t))},$=e=>(e-i)/(p-i)*100,z=s(e=>{if(!v.current)return i;const t=v.current.getBoundingClientRect(),o=Math.max(0,Math.min(1,(e.clientX-t.left)/t.width));return C(i+o*(p-i))},[i,p,u]),M=s(e=>t=>{x||(t.preventDefault(),S(e))},[x]),I=s(e=>{if(x)return;const t=z(e);if(b){const e=Math.abs(t-w[0]),o=Math.abs(t-w[1]);r(e<=o?[C(t),w[1]]:[w[0],C(t)])}else r(C(t))},[x,z,b,w,r,i,p,u]);a(()=>{if(!k)return;const e=e=>{const t=z(e);"single"===k?r(C(t)):"start"===k?r([Math.min(C(t),w[1]),w[1]]):"end"===k&&r([w[0],Math.max(w[0],C(t))])},t=()=>S(null);return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[k,z,w,r,i,p,u]);const D=s(e=>{if(x)return;let t=0;if("ArrowRight"===e.key||"ArrowUp"===e.key)t=u;else{if("ArrowLeft"!==e.key&&"ArrowDown"!==e.key)return;t=-u}e.preventDefault(),b||r(C(("number"==typeof o?o:0)+t))},[x,u,b,o,r,i,p]),F={position:"relative",width:"100%",height:"6px",backgroundColor:"#e5e7eb",borderRadius:"3px",cursor:x?"not-allowed":"pointer"},R=b?$(w[0]):0,L={position:"absolute",top:"0",left:`${R}%`,width:$(b?w[1]:w[0])-R+"%",height:"100%",backgroundColor:x?"#9ca3af":"#3b82f6",borderRadius:"3px"},A=e=>m?"start"===e?`${m} minimum`:"end"===e?`${m} maximum`:m:"start"===e?"Minimum value":"end"===e?"Maximum value":"Value",T=(e,o,r)=>n("div",{id:"single"===o||"start"===o?t:void 0,style:{position:"absolute",top:"50%",left:`${e}%`,transform:"translate(-50%, -50%)",width:"18px",height:"18px",borderRadius:"50%",backgroundColor:"#ffffff",border:"2px solid "+(x?"#9ca3af":"#3b82f6"),cursor:x?"not-allowed":"grab",boxShadow:"0 1px 3px rgba(0,0,0,0.15)",zIndex:"2"},onMouseDown:M(o),role:"slider","aria-valuenow":String(r),"aria-valuemin":String(i),"aria-valuemax":String(p),"aria-label":A(o),tabIndex:x?-1:0,onKeyDown:D},f?n("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),E=[];if(g)for(let e=i;e<=p;e+=u)E.push(n("div",{key:`tick-${e}`,style:{position:"absolute",top:"10px",left:`${$(e)}%`,width:"1px",height:"6px",backgroundColor:"#d1d5db",transform:"translateX(-50%)"}}));const W=[];if(h)for(const e of h)W.push(n("div",{key:`mark-${e.value}`,style:{position:"absolute",top:"18px",left:`${$(e.value)}%`,transform:"translateX(-50%)",fontSize:"11px",color:"#6b7280",whiteSpace:"nowrap"}},e.label));const B={paddingTop:f?"28px":"8px",paddingBottom:h||g?"28px":"8px",opacity:x?"0.6":"1"},N=[];return b?(N.push(T($(w[0]),"start",w[0])),N.push(T($(w[1]),"end",w[1]))):N.push(T($(w[0]),"single",w[0])),n(te,{label:m,error:y,htmlFor:t},n("div",{style:B},n("div",{ref:v,style:F,onClick:I},n("div",{style:L}),...N,...E,...W)))},exports.Spinner=function(e){const t="number"==typeof e.size?e.size:Q[e.size??"md"]??24,o=e.color??"#3b82f6",r=e.thickness??Math.max(2,Math.round(t/8)),i=ee[e.speed??"normal"]??ee.normal,l=e.label??"Loading",a=p(),s=(t-r)/2,c=2*Math.PI*s;return n("span",{role:"status","aria-label":l,style:{display:"inline-flex",alignItems:"center",justifyContent:"center"}},n("style",null,d(()=>`@keyframes liq-rotate-${a}{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}`,[a])),n("svg",{width:String(t),height:String(t),viewBox:`0 0 ${t} ${t}`,style:{animation:`liq-rotate-${a} ${i} linear infinite`}},n("circle",{cx:String(t/2),cy:String(t/2),r:String(s),fill:"none",stroke:o,"stroke-width":String(r),"stroke-dasharray":`${.7*c} ${.3*c}`,"stroke-linecap":"round"})),n("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))},exports.Splitter=function(e){const t=e.direction??"horizontal",o="horizontal"===t,r=e.dividerSize??6,i=e.minSize??50,[p,u]=l(e.initialSplit??50),f=c(null),g=c(!1),x=s(e=>{e.preventDefault(),g.current=!0,document.body.style.cursor=o?"col-resize":"row-resize",document.body.style.userSelect="none"},[o]);a(()=>{const t=t=>{if(!g.current||!f.current)return;const n=f.current.getBoundingClientRect(),r=o?n.width:n.height,l=o?t.clientX-n.left:t.clientY-n.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)},n=()=>{g.current&&(g.current=!1,document.body.style.cursor="",document.body.style.userSelect="")};return document.addEventListener("mousemove",t),document.addEventListener("mouseup",n),()=>{document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",n)}},[o,i,e.maxSize]);const h=d(()=>({display:"flex",flexDirection:o?"row":"column",width:"100%",height:"100%",overflow:"hidden",...e.style??{}}),[o,e.style]),b=o?{width:`calc(${p}% - ${r/2}px)`,overflow:"auto",flexShrink:"0"}:{height:`calc(${p}% - ${r/2}px)`,overflow:"auto",flexShrink:"0"},m={flexShrink:"0",backgroundColor:"#e5e7eb",transition:"background-color 0.15s",...o?{width:`${r}px`,cursor:"col-resize",height:"100%"}:{height:`${r}px`,cursor:"row-resize",width:"100%"}},y=Array.isArray(e.children)?e.children:[];return n("div",{className:`splitter splitter--${t} ${e.className??""}`.trim(),style:h,ref:f},n("div",{className:"splitter__pane splitter__pane--first",style:b},y[0]??null),n("div",{className:"splitter__divider",style:m,onMouseDown:x,onKeyDown:e=>{const t=e.key;!o||"ArrowLeft"!==t&&"ArrowRight"!==t?o||"ArrowUp"!==t&&"ArrowDown"!==t||(e.preventDefault(),u(e=>{const o="ArrowDown"===t?2:-2;return Math.max(5,Math.min(95,e+o))})):(e.preventDefault(),u(e=>{const o="ArrowRight"===t?2:-2;return Math.max(5,Math.min(95,e+o))}))},role:"separator",tabIndex:0,"aria-orientation":o?"vertical":"horizontal","aria-valuenow":String(Math.round(p)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Resize panels"}),n("div",{className:"splitter__pane splitter__pane--second",style:{flex:"1",overflow:"auto",minWidth:"0",minHeight:"0"}},y[1]??null))},exports.Stepper=function(e){const{steps:t,currentStep:o,orientation:r="horizontal",onChange:i,clickable:l=!1,variant:a="circle"}=e,d="horizontal"===r,c="circle"===a?32:12,p="dot"===a?12:32,u=s(e=>{l&&i&&i(e)},[l,i]),f=[];return t.forEach((e,r)=>{f.push(((e,t)=>{const r=(e=>e<o?"completed":e===o?"active":"pending")(t),i="active"===r,s="completed"===r,f=((e,t,o)=>{const r="dot"===a?p: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"===o?n("div",{style:{...i,backgroundColor:"#2563eb",color:"#ffffff",border:"2px solid #2563eb"}},"circle"===a?t.icon||"✓":null):"active"===o?n("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):n("div",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"#2563eb"}})):n("div",{style:{...i,backgroundColor:"#ffffff",color:"#9ca3af",border:"2px solid #d1d5db"}},"circle"===a?t.icon||String(e+1):null)})(t,e,r),g={fontSize:"11px",color:"#6b7280",marginTop:"2px",textAlign:d?"center":"left"},x=n("div",{style:d?{display:"flex",flexDirection:"column",alignItems:"center"}:{display:"flex",flexDirection:"column"}},n("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?n("span",{style:g},e.description):null),h=n("div",d?{style:{display:"flex",flexDirection:"column",alignItems:"center"}}:{style:{display:"flex",flexDirection:"row",alignItems:"center"}},f,x);return n(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},h)})(e,r));const i=(e=>{if(e>=t.length-1)return null;const r=e<o?"#2563eb":"#d1d5db";return n("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?p:c)/2-1+"px",transition:"background-color 0.2s"}})})(r);i&&f.push(i)}),n("div",{role:"navigation","aria-label":"Progress steps",style:{display:"flex",flexDirection:d?"row":"column",alignItems:d?"flex-start":"stretch",width:"100%"}},...f)},exports.Tabs=function(e){const t=e.position??"top",o=e.variant??"line",r=e.tabs.find(e=>!e.disabled)?.id??"",[i,a]=l(e.activeTab??r),p=e.activeTab??i,u=c(null),f=s(t=>{a(t),e.onChange&&e.onChange(t)},[e.onChange]),g=s(o=>{const n=e.tabs.filter(e=>!e.disabled),r=n.findIndex(e=>e.id===p);if(-1===r)return;const i="left"===t||"right"===t,l=i?"ArrowUp":"ArrowLeft",a=i?"ArrowDown":"ArrowRight";let s=-1;if(o.key===l?s=r>0?r-1:n.length-1:o.key===a?s=r<n.length-1?r+1:0:"Home"===o.key?s=0:"End"===o.key&&(s=n.length-1),s>=0){o.preventDefault(),f(n[s].id);const t=u.current;if(t){const o=t.querySelectorAll('[role="tab"]')[e.tabs.indexOf(n[s])];o&&o.focus()}}},[e.tabs,p,t,f]),x="left"===t||"right"===t,h="bottom"===t||"right"===t,b=d(()=>({display:"flex",flexDirection:x?h?"row-reverse":"row":h?"column-reverse":"column",width:"100%",...e.style??{}}),[x,h,e.style]),m={display:"flex",flexDirection:x?"column":"row",gap:"pill"===o?"4px":"0",..."line"!==o||x?{}:{borderBottom:"2px solid #e5e7eb"},..."line"===o&&x?{borderRight:"left"===t?"2px solid #e5e7eb":"none",borderLeft:"right"===t?"2px solid #e5e7eb":"none"}:{},..."card"===o?{backgroundColor:"#f9fafb"}:{},..."pill"===o?{padding:"4px"}:{},flexShrink:"0"},y=e.tabs.find(e=>e.id===p),v=e.tabs.map(e=>{const r=e.id===p,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"===o?x?"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"===o?(i.backgroundColor=r?"#ffffff":"transparent",i.borderRadius="6px 6px 0 0",r&&(i.border="1px solid #e5e7eb",i.borderBottom="1px solid #ffffff")):"pill"===o&&(i.borderRadius="9999px",i.backgroundColor=r?"#3b82f6":"transparent",i.color=r?"#ffffff":"#6b7280"),n("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:()=>f(e.id),onKeyDown:g},e.icon?n("span",{className:"tabs__tab-icon"},e.icon):null,e.label)});return n("div",{className:`tabs tabs--${t} tabs--${o} ${e.className??""}`.trim(),style:b},n("div",{className:"tabs__list",role:"tablist","aria-orientation":x?"vertical":"horizontal",style:m,ref:u},...v),n("div",{className:"tabs__panel",role:"tabpanel",id:`tabpanel-${p}`,"aria-labelledby":`tab-${p}`,style:{flex:"1",padding:"16px",minWidth:"0",minHeight:"0"},tabIndex:"0"},y?y.content:null))},exports.Tag=function(e){const{label:t,color:o,variant:r="subtle",size:i="md",removable:l=!1,onRemove:a,icon:s,onClick:d,disabled:c=!1}=e,p=function(e,t,o,n,r){const i=X[o],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",...n?{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:G(e,.12),color:e,border:"none"};default:return l}}(function(e){return e??"#3b82f6"}(o),r,i,!!d,c),u=[];return s&&u.push(n("span",{key:"icon",style:{display:"inline-flex",flexShrink:"0"}},s)),u.push(n("span",{key:"label"},t)),l&&u.push(n("button",{key:"remove",type:"button",style:K,onClick:e=>{e.stopPropagation(),!c&&a&&a()},"aria-label":`Remove ${t}`,disabled:c},"×")),n("span",{style:p,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},...u)},exports.TextEditor=function(e){const[t,o]=l(!1),r=c(null),i=e.id??`te-${Math.random().toString(36).slice(2,8)}`,d=e.toolbar??ue,p=e.toolbarStyle??{},u=e.editorStyle??{};a(()=>{r.current&&void 0!==e.value&&(r.current.innerHTML=e.value)},[]);const f=s((t,o)=>{if(!e.disabled&&!e.readOnly){if("createLink"===t){const e=prompt("Enter URL:");if(!e)return;document.execCommand(t,!1,e)}else o&&"formatBlock"===t?document.execCommand(t,!1,`<${o}>`):document.execCommand(t,!1,o);r.current&&e.onChange&&e.onChange(r.current.innerHTML)}},[e.disabled,e.readOnly,e.onChange]),g=s(()=>{r.current&&e.onChange&&e.onChange(r.current.innerHTML)},[e.onChange]),x=s(()=>{o(!1),r.current&&e.onBlur&&e.onBlur(r.current.innerHTML)},[e.onBlur]),h=n("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"}},...d.map(t=>{const o=fe[t];return o?n("button",{key:t,type:"button",title:o.label,onClick:()=>f(o.command,o.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"}},o.icon):null})),b=n("div",{ref:r,id:i,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:u.padding??"12px 14px",minHeight:e.minHeight??"200px",maxHeight:e.maxHeight??"none",overflow:"auto",backgroundColor:u.backgroundColor??"#ffffff",color:u.color??"#1f2937",fontFamily:u.fontFamily??"inherit",fontSize:u.fontSize??"14px",lineHeight:u.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:()=>o(!0),onBlur:x,onInput:g});return n(te,{label:e.label,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},n("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"}},h,b))},exports.TextField=function(e){const[t,o]=l(!1),r=e.id??`tf-${Math.random().toString(36).slice(2,8)}`,i=oe(e.inputStyle??{},{focused:t,error:!!e.error}),a=!(!e.prefix&&!e.suffix),s=n("input",{type:e.type??"text",id:r,name:e.name,value:e.value,placeholder:e.placeholder,maxLength:e.maxLength?String(e.maxLength):void 0,pattern:e.pattern,autoComplete:e.autoComplete,autoFocus:e.autoFocus,readOnly:e.readOnly,disabled:e.disabled,"aria-invalid":e.error?"true":void 0,"aria-required":e.required?"true":void 0,className:`textfield-input ${e.className??""}`.trim(),style:a?{...i,border:"none",boxShadow:"none",flex:"1",minWidth:"0"}:i,onFocus:()=>o(!0),onBlur:t=>{o(!1),e.onBlur&&e.onBlur(t.target.value)},onInput:t=>{const o=t.target.value;e.onInput&&e.onInput(o),e.onChange&&e.onChange(o)},onKeyDown:t=>{"Enter"===t.key&&e.onEnter&&e.onEnter(t.target.value)}}),d=a?n("div",{style:{...i,display:"flex",alignItems:"center",gap:"8px",padding:"0"}},e.prefix?n("span",{style:{paddingLeft:"10px",color:"#9ca3af",flexShrink:"0"}},e.prefix):null,s,e.suffix?n("span",{style:{paddingRight:"10px",color:"#9ca3af",flexShrink:"0"}},e.suffix):null):s;return n(te,{label:e.label,htmlFor:r,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},d)},exports.TimePicker=function(e){const t=e.id??`tp-${Math.random().toString(36).slice(2,8)}`,{value:o,onChange:r,format:i="24h",minuteStep:a=1,disabled:c=!1,label:p,error:u,showSeconds:f=!1,timezone:g,showTimezone:x=!1,timezones:h=ge,onTimezoneChange:b}=e,[m,y]=l(!1),v=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}}(o),[o]),k="12h"===i,S=v.hour>=12,w=k?v.hour%12||12:v.hour,C=s((e,t,o)=>{const n=Math.max(0,Math.min(23,e)),i=Math.max(0,Math.min(59,t)),l=Math.max(0,Math.min(59,o??0));r(f?`${xe(n)}:${xe(i)}:${xe(l)}`:`${xe(n)}:${xe(i)}`)},[r,f]),$=s(e=>{let t=parseInt(e.target.value,10)||0;k&&(t%=12,S&&(t+=12)),C(t,v.minute,v.second)},[k,S,v.minute,v.second,C]),z=s(e=>{const t=parseInt(e.target.value,10)||0;C(v.hour,t,v.second)},[v.hour,v.second,C]),M=s(e=>{const t=parseInt(e.target.value,10)||0;C(v.hour,v.minute,t)},[v.hour,v.minute,C]),I=s(()=>{if(c)return;const e=S?v.hour-12:v.hour+12;C(e,v.minute,v.second)},[c,S,v.hour,v.minute,v.second,C]),D=s(e=>{c||C(v.hour+e,v.minute,v.second)},[c,v.hour,v.minute,v.second,C]),F=s(e=>{c||C(v.hour,v.minute+e*a,v.second)},[c,v.hour,v.minute,v.second,a,C]),R=s(e=>{c||C(v.hour,v.minute,v.second+e)},[c,v.hour,v.minute,v.second,C]),L=s(e=>{const t=e.target.value;b&&b(t)},[b]),A={display:"inline-flex",alignItems:"center",gap:"4px",...oe({},{focused:m,error:!!u})},T={display:"flex",flexDirection:"column",alignItems:"center"},E={background:"none",border:"none",cursor:c?"not-allowed":"pointer",fontSize:"10px",padding:"0 4px",color:"#6b7280",lineHeight:"1"},W={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:c?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},N=n("div",{style:T},n("button",{type:"button",style:E,onClick:()=>D(1),disabled:c},"▲"),n("input",{type:"text",value:xe(w),onChange:$,style:W,disabled:c,"aria-label":"Hour",onFocus:()=>y(!0),onBlur:()=>y(!1)}),n("button",{type:"button",style:E,onClick:()=>D(-1),disabled:c},"▼")),P=n("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"),H=n("div",{style:T},n("button",{type:"button",style:E,onClick:()=>F(1),disabled:c},"▲"),n("input",{type:"text",value:xe(v.minute),onChange:z,style:W,disabled:c,"aria-label":"Minute",onFocus:()=>y(!0),onBlur:()=>y(!1)}),n("button",{type:"button",style:E,onClick:()=>F(-1),disabled:c},"▼")),j=f?n("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"):null,_=f?n("div",{style:T},n("button",{type:"button",style:E,onClick:()=>R(1),disabled:c},"▲"),n("input",{type:"text",value:xe(v.second),onChange:M,style:W,disabled:c,"aria-label":"Second",onFocus:()=>y(!0),onBlur:()=>y(!1)}),n("button",{type:"button",style:E,onClick:()=>R(-1),disabled:c},"▼")):null,q=k?n("button",{type:"button",style:B,onClick:I,disabled:c,"aria-label":"Toggle AM/PM"},S?"PM":"AM"):null,O={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:c?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},Y=g&&!x?n("span",{style:{marginLeft:"8px",fontSize:"12px",fontWeight:"600",color:"#6b7280"}},g):null,U=x?n("select",{style:O,value:g??h[0],onChange:L,disabled:c,"aria-label":"Timezone"},...h.map(e=>n("option",{key:e,value:e},e))):null,G=[N,P,H];return j&&G.push(j),_&&G.push(_),q&&G.push(q),Y&&G.push(Y),U&&G.push(U),n(te,{label:p,error:u,disabled:c,htmlFor:t},n("div",{id:t,style:A},...G))},exports.ToastContainer=et,exports.Toggle=function(e){const{checked:t,onChange:o,label:r,labelPosition:i="right",disabled:l=!1,size:a="md",onColor:d="#3b82f6",offColor:c="#d1d5db"}=e,p=he[a],u=s(()=>{l||o(!t)},[l,t,o]),f=s(e=>{l||" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),o(!t))},[l,t,o]),g={width:`${p.trackW}px`,height:`${p.trackH}px`,borderRadius:`${p.trackH}px`,backgroundColor:t?d:c,position:"relative",cursor:l?"not-allowed":"pointer",transition:"background-color 0.2s",flexShrink:"0"},x=t?p.trackW-p.thumbSize-p.offset:p.offset,h={width:`${p.thumbSize}px`,height:`${p.thumbSize}px`,borderRadius:"50%",backgroundColor:"#ffffff",position:"absolute",top:`${p.offset}px`,left:`${x}px`,transition:"left 0.2s",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"},b={display:"inline-flex",alignItems:"center",gap:"8px",opacity:l?"0.5":"1",userSelect:"none"},m=r?n("span",{style:{fontSize:"14px",color:"#374151"}},r):null,y=n("div",{style:g},n("div",{style:h}));return n("div",{style:b,onClick:u,onKeyDown:f,tabIndex:l?-1:0,role:"switch","aria-checked":t?"true":"false","aria-disabled":l?"true":void 0,"aria-label":r},...("left"===i?[m,y]:[y,m]).filter(Boolean))},exports.Toolbar=function(e){const{items:t,size:o="md",variant:r="flat"}=e,i=Be[o],l=t.map(e=>"separator"===e.type?n("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?n("div",{key:e.id,style:{flex:"1"},"aria-hidden":"true"}):n(Ne,{key:e.id,item:e,size:o,variant:r}));return n(Se,{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)},exports.Tooltip=function(e){const{text:t,placement:o="top",delay:r=200,maxWidth:i="250px",children:d}=e,[p,u]=l(!1),[f,g]=l(null),x=c(null),h=c(null),b=`tooltip-${Math.random().toString(36).slice(2,9)}`,m=s(()=>{h.current=setTimeout(()=>{if(x.current){const e=x.current.getBoundingClientRect();g(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,o))}u(!0)},r)},[r,o]),y=s(()=>{h.current&&(clearTimeout(h.current),h.current=null),u(!1)},[]);a(()=>()=>{h.current&&clearTimeout(h.current)},[]);const v={...f??{},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"},k=[n("div",{ref:x,style:{display:"inline-block"},onMouseEnter:m,onMouseLeave:y,onFocus:m,onBlur:y,"aria-describedby":p?b:void 0},d)];return p&&f&&k.push(n("div",{id:b,style:v,role:"tooltip"},t,n("div",{style:tt(o)}))),n("div",{style:{display:"inline-block",position:"relative"}},...k)},exports.TradingDashboard=function(e){const[t,o]=l(0),[r,i]=l("--:--:--"),[s,c]=l(!0);a(()=>{const e=setInterval(()=>{o(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"),o=String(e.getMinutes()).padStart(2,"0"),n=String(e.getSeconds()).padStart(2,"0");i(`${t}:${o}:${n}`)};e();const t=setInterval(e,1e3);return()=>clearInterval(t)},[]),a(()=>{const e=setInterval(()=>{c(e=>!e)},800);return()=>clearInterval(e)},[]);const p=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,f={width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"#00c853",display:"inline-block",marginRight:"4px",opacity:s?"1":"0.3",transition:"opacity 0.3s"};return n("div",{className:`trading-dashboard ${e.className??""}`.trim(),style:p},n("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"}},n("span",{style:{fontSize:"14px",fontWeight:"700",color:"#ffffff",letterSpacing:"0.5px",display:"flex",alignItems:"center",gap:"8px"}},"SpecifyJS Trading Platform",n("span",{style:{display:"flex",alignItems:"center",fontSize:"11px",color:"#00c853",fontWeight:"600",marginLeft:"8px"}},n("span",{style:f}),"LIVE")),n("div",{style:{display:"flex",alignItems:"center",gap:"16px",fontSize:"12px"}},n("span",{style:{color:"#ffffff",fontFamily:"monospace",fontWeight:"600",fontSize:"13px"}},r),n("span",{style:{color:"#8888aa"}},"Account: SJS-28401"),n("span",{style:{color:"#00c853"}},"Balance: $124,582.30"),n("span",{style:{color:"#8888aa"}},"Status: Connected"))),n("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 o=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)*o}));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 o=e[t]>=e[t-1]?"#00c853":"#ff1744";c.push(n("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:o,strokeWidth:"2",strokeLinecap:"round"}))}const p=[];for(let e=0;e<5;e++){const t=15+e/4*o,r=i-e/4*l;p.push(n("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"})),p.push(n("text",{key:`yl${e}`,x:String(36),y:String((t+3).toFixed(1)),fill:"#6666aa",fontSize:"8",textAnchor:"end",fontFamily:"monospace"},co(r)))}const u=[],f=Math.min(ao.length,e.length),g=(e.length-1)/(f-1);for(let e=0;e<f;e++){const t=40+Math.round(e*g)*a;u.push(n("text",{key:`tl${e}`,x:String(t.toFixed(1)),y:String(156),fill:"#6666aa",fontSize:"8",textAnchor:"middle",fontFamily:"monospace"},ao[e]))}const x="chartGrad";return n("div",{style:po},n("div",{style:uo},"AAPL ",n("span",{style:{color:"#00c853",fontSize:"14px",fontWeight:"700"}},`$${co(t)}`),n("span",{style:{color:"#00c853",fontSize:"11px",marginLeft:"8px"}},"+1.23%")),n("svg",{viewBox:"0 0 360 160",style:{width:"100%",flex:"1",minHeight:"0"},"aria-label":"Price chart",role:"img"},n("defs",null,n("linearGradient",{id:x,x1:"0",y1:"0",x2:"0",y2:"1"},n("stop",{offset:"0%",stopColor:"#00c853",stopOpacity:"0.3"}),n("stop",{offset:"100%",stopColor:"#00c853",stopOpacity:"0.02"}))),n("path",{d:d,fill:`url(#${x})`}),...p,...u,...c,n("line",{x1:String(40),y1:String((15+(1-(t-r)/l)*o).toFixed(1)),x2:String(350),y2:String((15+(1-(t-r)/l)*o).toFixed(1)),stroke:"#00c853",strokeWidth:"0.5",strokeDasharray:"4,2",opacity:"0.6"})))}(ro,u),function(){const e=Math.max(...eo.map(e=>e.qty),...to.map(e=>e.qty));return n("div",{style:po},n("div",{style:uo},"Order Book"),n("table",{style:fo},n("thead",null,n("tr",null,n("th",{style:go},"Bid Price"),n("th",{style:go},"Qty"),n("th",{style:go},"Ask Price"),n("th",{style:go},"Qty"))),n("tbody",null,...eo.map((t,o)=>{const r=to[o],i=t.qty/e*.25,l=(r?.qty??0)/e*.25;return n("tr",{key:String(o),style:ho},n("td",{style:{...xo,color:"#00c853",backgroundColor:`rgba(0,200,83,${i.toFixed(3)})`,fontFamily:"monospace"}},co(t.price)),n("td",{style:{...xo,backgroundColor:`rgba(0,200,83,${(.5*i).toFixed(3)})`,fontFamily:"monospace"}},so(t.qty)),n("td",{style:{...xo,color:"#ff1744",backgroundColor:`rgba(255,23,68,${l.toFixed(3)})`,fontFamily:"monospace"}},r?co(r.price):""),n("td",{style:{...xo,backgroundColor:`rgba(255,23,68,${(.5*l).toFixed(3)})`,fontFamily:"monospace"}},r?so(r.qty):""))}))))}(),function(e){return n("div",{style:po},n("div",{style:uo},"Watchlist"),n("table",{style:fo},n("thead",null,n("tr",null,n("th",{style:go},"Symbol"),n("th",{style:go},"Price"),n("th",{style:go},"Chg%"),n("th",{style:go},"Volume"))),n("tbody",null,...Qt.map((t,o)=>{const r=t.price+(0===o?e:0),i=t.change>=0;return n("tr",{key:String(o),style:ho},n("td",{style:{...xo,fontWeight:"600",color:"#ffffff"}},t.symbol,function(e,t){const o=Math.min(...e),r=Math.max(...e)-o||1;return n("svg",{viewBox:"0 0 40 14",style:{width:"40px",height:"14px",display:"inline-block",verticalAlign:"middle",marginLeft:"4px"},"aria-hidden":"true"},n("polyline",{points:e.map((t,n)=>{const i=n/(e.length-1)*40,l=14-(t-o)/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)),n("td",{style:{...xo,fontFamily:"monospace"}},co(r)),n("td",{style:{...xo,color:i?"#00c853":"#ff1744",fontWeight:"600"}},`${i?"+":""}${co(t.change)}%`),n("td",{style:{...xo,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=oo.reduce((e,t)=>e+t.pnl,0),t=e>=0;return n("div",{style:po},n("div",{style:uo},"Positions",n("span",{style:{marginLeft:"12px",color:t?"#00c853":"#ff1744",fontWeight:"700",fontSize:"12px"}},`${t?"+":""}$${co(e)}`)),n("table",{style:fo},n("thead",null,n("tr",null,n("th",{style:go},"Symbol"),n("th",{style:go},"Qty"),n("th",{style:go},"Avg"),n("th",{style:go},"P&L"))),n("tbody",null,...oo.map((e,t)=>{const o=e.pnl>=0;return n("tr",{key:String(t),style:{...ho,backgroundColor:o?"rgba(0,200,83,0.04)":"rgba(255,23,68,0.04)"}},n("td",{style:{...xo,fontWeight:"600",color:"#ffffff"}},e.symbol),n("td",{style:{...xo,fontFamily:"monospace"}},String(e.qty)),n("td",{style:{...xo,fontFamily:"monospace"}},co(e.avgPrice)),n("td",{style:{...xo,color:o?"#00c853":"#ff1744",fontWeight:"700",fontFamily:"monospace"}},`${o?"+":""}$${co(e.pnl)}`))}))))}(),n("div",{style:po},n("div",{style:uo},"Recent Trades"),n("table",{style:fo},n("thead",null,n("tr",null,n("th",{style:go},"Time"),n("th",{style:go},"Sym"),n("th",{style:go},"Side"),n("th",{style:go},"Qty"),n("th",{style:go},"Price"))),n("tbody",null,...no.map((e,t)=>{const o="BUY"===e.side;return n("tr",{key:String(t),style:ho},n("td",{style:{...xo,color:"#8888aa",fontFamily:"monospace"}},e.time),n("td",{style:{...xo,fontWeight:"600",color:"#ffffff"}},e.symbol),n("td",{style:{...xo,color:o?"#00c853":"#ff1744",fontWeight:"600"}},e.side),n("td",{style:{...xo,fontFamily:"monospace"}},so(e.qty)),n("td",{style:{...xo,fontFamily:"monospace"}},co(e.price)))})))),function(){const e=Math.max(...io.map(e=>e.volume),...lo.map(e=>e.volume)),t="16px";return n("div",{style:po},n("div",{style:uo},"Market Depth"),n("div",{style:{flex:"1",display:"flex",flexDirection:"column",gap:"2px",justifyContent:"center"}},...io.map((o,r)=>n("div",{key:`b${r}`,style:{display:"flex",alignItems:"center",gap:"6px"}},n("span",{style:{width:"52px",fontSize:"11px",color:"#8888aa",textAlign:"right",fontFamily:"monospace"}},co(o.price)),n("div",{style:{height:t,width:o.volume/e*100+"%",backgroundColor:"#00c853",opacity:"0.6",borderRadius:"2px",maxWidth:"60%",transition:"width 0.3s"}}),n("span",{style:{fontSize:"11px",color:"#ccccdd",fontFamily:"monospace"}},so(o.volume)))),n("div",{style:{height:"1px",backgroundColor:"#2a2a4a",margin:"4px 0"}}),...lo.map((o,r)=>n("div",{key:`a${r}`,style:{display:"flex",alignItems:"center",gap:"6px"}},n("span",{style:{width:"52px",fontSize:"11px",color:"#8888aa",textAlign:"right",fontFamily:"monospace"}},co(o.price)),n("div",{style:{height:t,width:o.volume/e*100+"%",backgroundColor:"#ff1744",opacity:"0.6",borderRadius:"2px",maxWidth:"60%",transition:"width 0.3s"}}),n("span",{style:{fontSize:"11px",color:"#ccccdd",fontFamily:"monospace"}},so(o.volume))))))}()))},exports.TreeNav=function(e){const{root:t,onNodeClick:o,onNodeExpand:r,onNodeCollapse:i,selectedId:a,expandAll:c=!1,lineColor:p="#000",lineWidth:u=1,indentPx:f=20,iconExpanded:g="−",iconCollapsed:x="+",nodeStyle:h={},wrapperStyle:b,renderNode:m}=e,[y,v]=l(()=>{const e=Pe.fromData(t);return c&&He(e),e}),[k,S]=l(t.id),w=d(()=>je(y),[y]),C=s(()=>{v(e=>{const t=Object.create(Object.getPrototypeOf(e));return Object.assign(t,e),t})},[]),$=s(e=>{e.toggle(),e.expanded?r?.(e):i?.(e),C()},[r,i,C]),z=s(e=>{S(e.id),o?.(e)},[o]),M=s(e=>{const t=e;if(!k)return;const o=w.findIndex(e=>e.id===k);if(-1===o)return;const n=w[o];switch(t.key){case"ArrowDown":{t.preventDefault();const e=w[o+1];e&&S(e.id);break}case"ArrowUp":{t.preventDefault();const e=w[o-1];e&&S(e.id);break}case"ArrowRight":t.preventDefault(),n.isLeaf()||(n.expanded?n.children.length>0&&S(n.children[0].id):$(n));break;case"ArrowLeft":t.preventDefault(),!n.isLeaf()&&n.expanded?$(n):n.parent&&S(n.parent.id);break;case"Enter":t.preventDefault(),z(n);break;case" ":t.preventDefault(),n.isLeaf()||$(n);break;case"Home":t.preventDefault(),w.length>0&&S(w[0].id);break;case"End":t.preventDefault(),w.length>0&&S(w[w.length-1].id)}},[k,w,$,z]),I=w.map(e=>n(qe,{key:e.id,node:e,isSelected:e.id===a,indentPx:f,lineColor:p,lineWidth:u,iconExpanded:g,iconCollapsed:x,nodeStyle:h,renderNode:m,onToggle:$,onClick:z,focusedId:k}));return n(Se,{role:"tree",ariaLabel:"Tree navigation",styling:b,keyboardNav:!1},n("div",{onKeyDown:M,style:{outline:"none"}},...I))},exports.TreeNode=Pe,exports.UnityDesktop=function(e){const[t,o]=l(-1),[r,i]=l(()=>{const e=new Date;return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}:${String(e.getSeconds()).padStart(2,"0")}`}),[c,p]=l(()=>(new Date).toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"})),[u,f]=l([]),[g,x]=l(-1),[h,b]=l(!1);a(()=>{const e=setInterval(()=>{const e=new Date;i(`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}:${String(e.getSeconds()).padStart(2,"0")}`),p(e.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}))},1e3);return()=>clearInterval(e)},[]);const m=s(e=>{const t=Wt++,o={id:t,appLabel:e.label,appLetter:e.letter,appColor:e.color,minimized:!1};f(e=>[...e,o]),x(t),b(!1)},[]),y=s(e=>{f(t=>t.filter(t=>t.id!==e)),x(t=>t===e?-1:t)},[]),v=s(e=>{f(t=>t.map(t=>t.id===e?{...t,minimized:!t.minimized}:t))},[]),k=s(e=>{x(e),f(t=>t.map(t=>t.id===e?{...t,minimized:!1}:t))},[]),S=s(()=>{b(e=>!e)},[]),w=s((e,t)=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),m(Tt[e]))},[m]),C=d(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'Ubuntu, "Segoe UI", sans-serif',fontSize:"13px",color:"var(--color-text, #ffffff)",overflow:"hidden",position:"relative"}),[]);function $(e){return{width:"12px",height:"12px",borderRadius:"50%",backgroundColor:e,cursor:"pointer",display:"inline-block"}}const z={width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",cursor:"pointer",fontSize:"20px",backgroundColor:t===Tt.length?"rgba(255,255,255,0.15)":"transparent",border:"none",color:"#ffffff",transition:"background 0.15s",marginTop:"auto"},M=u.map((e,t)=>{if(e.minimized)return null;const o=e.id===g,r={width:"420px",minHeight:"280px",backgroundColor:"#ffffff",borderRadius:"6px",boxShadow:o?"0 12px 48px rgba(0,0,0,0.5)":"0 8px 32px rgba(0,0,0,0.4)",display:"flex",flexDirection:"column",overflow:"hidden",position:"absolute",left:80+t%5*30+"px",top:40+t%5*30+"px",zIndex:String(o?100:10+t),transition:"box-shadow 0.15s"},i={height:"32px",backgroundColor:o?"#3c3c3c":"#555",display:"flex",alignItems:"center",padding:"0 10px",gap:"6px",flexShrink:"0",cursor:"default"};return n("div",{key:String(e.id),className:"unity-desktop__window",style:r,onMouseDown:()=>k(e.id)},n("div",{style:i},n("span",{style:$("#e74c3c"),onClick:()=>y(e.id),title:"Close",role:"button","aria-label":`Close ${e.appLabel}`,tabIndex:0}),n("span",{style:$("#f39c12"),onClick:()=>v(e.id),title:"Minimize",role:"button","aria-label":`Minimize ${e.appLabel}`,tabIndex:0}),n("span",{style:$("#2ecc71"),title:"Maximize",role:"button","aria-label":`Maximize ${e.appLabel}`,tabIndex:0}),n("span",{style:{flex:"1",textAlign:"center",fontSize:"12px",color:"#ccc",marginRight:"40px"}},e.appLabel)),n("div",{style:{flex:"1",padding:"16px",fontSize:"13px",color:"#333",lineHeight:"1.5"}},...function(e){switch(e){case"Files":return[n("div",{style:{fontWeight:"600",marginBottom:"8px",color:"#333"}},"Home"),n("div",{style:{display:"flex",flexDirection:"column",gap:"4px"}},n("span",{style:{color:"#555",cursor:"pointer"}},"📁 Documents"),n("span",{style:{color:"#555",cursor:"pointer"}},"📁 Downloads"),n("span",{style:{color:"#555",cursor:"pointer"}},"📁 Music"),n("span",{style:{color:"#555",cursor:"pointer"}},"📁 Pictures"),n("span",{style:{color:"#555",cursor:"pointer"}},"📁 Videos"),n("span",{style:{color:"#555",cursor:"pointer"}},"📄 readme.txt"))];case"Browser":return[n("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"8px"}},n("span",{style:{padding:"4px 8px",backgroundColor:"#eee",borderRadius:"4px",fontSize:"12px",flex:"1",color:"#666"}},"https://example.com")),n("div",{style:{padding:"16px",backgroundColor:"#fafafa",borderRadius:"4px",textAlign:"center",color:"#999"}},"Web page content area")];case"Terminal":return[n("div",{style:{backgroundColor:"#1a1a1a",padding:"12px",borderRadius:"4px",fontFamily:"monospace",fontSize:"12px",color:"#2ecc71",lineHeight:"1.6"}},n("div",null,n("span",{style:{color:"#2ecc71"}},"user@desktop:~$ "),n("span",{style:{color:"#ccc"}},"Welcome to SpecifyJS Desktop")),n("div",null,n("span",{style:{color:"#2ecc71"}},"user@desktop:~$ "),n("span",{style:{color:"#ccc"}},"ls -la")),n("div",{style:{color:"#aaa"}},"total 42"),n("div",null,n("span",{style:{color:"#2ecc71"}},"user@desktop:~$ "),n("span",{style:{color:"#ccc",borderRight:"2px solid #2ecc71"}}," ")))];case"Mail":return[n("div",{style:{fontWeight:"600",marginBottom:"8px",color:"#333"}},"Inbox (3)"),n("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},n("div",{style:{padding:"6px",backgroundColor:"#e8f0fe",borderRadius:"4px",color:"#333",fontSize:"12px"}},"Welcome to SpecifyJS Mail"),n("div",{style:{padding:"6px",backgroundColor:"#f5f5f5",borderRadius:"4px",color:"#333",fontSize:"12px"}},"Your weekly digest"),n("div",{style:{padding:"6px",backgroundColor:"#f5f5f5",borderRadius:"4px",color:"#333",fontSize:"12px"}},"Team standup notes"))];case"Music":return[n("div",{style:{textAlign:"center",padding:"20px",color:"#333"}},n("div",{style:{fontSize:"48px",marginBottom:"12px"}},"🎵"),n("div",{style:{fontWeight:"600",marginBottom:"4px"}},"Now Playing"),n("div",{style:{color:"#666",fontSize:"12px"}},"No track selected"),n("div",{style:{marginTop:"16px",display:"flex",justifyContent:"center",gap:"16px",fontSize:"18px"}},n("span",{style:{cursor:"pointer"}},"⏮"),n("span",{style:{cursor:"pointer"}},"▶"),n("span",{style:{cursor:"pointer"}},"⏭")))];case"Photos":return[n("div",{style:{fontWeight:"600",marginBottom:"8px",color:"#333"}},"Photo Library"),n("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"6px"}},n("div",{style:{width:"60px",height:"60px",backgroundColor:"#ddd",borderRadius:"4px",display:"flex",alignItems:"center",justifyContent:"center",color:"#999"}},"🖼"),n("div",{style:{width:"60px",height:"60px",backgroundColor:"#ddd",borderRadius:"4px",display:"flex",alignItems:"center",justifyContent:"center",color:"#999"}},"🖼"),n("div",{style:{width:"60px",height:"60px",backgroundColor:"#ddd",borderRadius:"4px",display:"flex",alignItems:"center",justifyContent:"center",color:"#999"}},"🖼"))];case"Software":return[n("div",{style:{fontWeight:"600",marginBottom:"8px",color:"#333"}},"Software Center"),n("div",{style:{color:"#666",fontSize:"12px"}},"Browse and install applications"),n("div",{style:{marginTop:"12px",display:"flex",flexDirection:"column",gap:"6px"}},n("div",{style:{padding:"6px",backgroundColor:"#f5f5f5",borderRadius:"4px",color:"#333",fontSize:"12px"}},"📦 Package Manager"),n("div",{style:{padding:"6px",backgroundColor:"#f5f5f5",borderRadius:"4px",color:"#333",fontSize:"12px"}},"📦 Text Editor"),n("div",{style:{padding:"6px",backgroundColor:"#f5f5f5",borderRadius:"4px",color:"#333",fontSize:"12px"}},"📦 Image Viewer"))];case"Settings":return[n("div",{style:{fontWeight:"600",marginBottom:"8px",color:"#333"}},"System Settings"),n("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},n("div",{style:{padding:"6px",backgroundColor:"#f5f5f5",borderRadius:"4px",color:"#333",fontSize:"12px",cursor:"pointer"}},"⚙ General"),n("div",{style:{padding:"6px",backgroundColor:"#f5f5f5",borderRadius:"4px",color:"#333",fontSize:"12px",cursor:"pointer"}},"📶 Network"),n("div",{style:{padding:"6px",backgroundColor:"#f5f5f5",borderRadius:"4px",color:"#333",fontSize:"12px",cursor:"pointer"}},"🔈 Sound"),n("div",{style:{padding:"6px",backgroundColor:"#f5f5f5",borderRadius:"4px",color:"#333",fontSize:"12px",cursor:"pointer"}},"🖥 Display"))];default:return[n("div",{style:{textAlign:"center",color:"#999",padding:"20px"}},`${e} placeholder`)]}}(e.appLabel)))}),I=h?n("div",{className:"unity-desktop__apps-grid",style:{position:"absolute",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(0,0,0,0.75)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"200"},onClick:()=>b(!1)},n("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 80px)",gap:"24px",padding:"40px"},onClick:e=>e.stopPropagation()},...Tt.map(e=>n("div",{key:e.label,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",cursor:"pointer",padding:"12px",borderRadius:"8px",transition:"background 0.15s"},onClick:()=>m(e),role:"button",tabIndex:0,"aria-label":e.label},n("span",{style:{width:"48px",height:"48px",borderRadius:"12px",backgroundColor:e.color,display:"flex",alignItems:"center",justifyContent:"center",fontSize:"20px",fontWeight:"700",color:"#ffffff"}},e.letter),n("span",{style:{color:"#ffffff",fontSize:"11px"}},e.label))))):null;return n("div",{className:`unity-desktop ${e.className??""}`.trim(),style:C},n("div",{className:"unity-desktop__top-panel",style:{width:"100%",height:"28px",backgroundColor:"var(--color-bg, #1a1a1a)",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 12px",boxSizing:"border-box",fontSize:"12px",zIndex:"10",flexShrink:"0",borderBottom:"1px solid var(--color-border, #333)"}},n("span",{style:{fontWeight:"600",cursor:"pointer",padding:"2px 8px",borderRadius:"3px",transition:"background 0.15s"}},"Activities"),n("span",{style:{position:"absolute",left:"50%",transform:"translateX(-50%)"}},`${c} ${r}`),n("div",{style:{display:"flex",alignItems:"center",gap:"10px",fontSize:"14px"}},...Et.map((e,t)=>n("span",{key:String(t),style:{cursor:"pointer"}},e)),n("span",{style:{fontSize:"12px",marginLeft:"4px",cursor:"pointer"}},"▼"))),n("div",{style:{display:"flex",flex:"1",overflow:"hidden"}},n("nav",{className:"unity-desktop__launcher",style:{width:"48px",backgroundColor:"var(--color-bg, #2c2c2c)",display:"flex",flexDirection:"column",alignItems:"center",paddingTop:"8px",paddingBottom:"8px",gap:"4px",flexShrink:"0",overflowY:"auto",boxSizing:"border-box",borderRight:"1px solid var(--color-border, #444)"},"aria-label":"Application launcher"},...Tt.map((e,r)=>{return n("button",{key:String(r),style:(l=r,{width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",cursor:"pointer",fontSize:"14px",fontWeight:"700",backgroundColor:t===l?"rgba(255,255,255,0.15)":"transparent",border:"none",color:"#ffffff",transition:"background 0.15s"}),title:e.label,"aria-label":e.label,tabIndex:0,onMouseEnter:()=>o(r),onMouseLeave:()=>o(-1),onKeyDown:e=>w(r,e),onClick:()=>m(e)},n("span",{style:(i=e.color,{width:"28px",height:"28px",borderRadius:"50%",backgroundColor:i,display:"flex",alignItems:"center",justifyContent:"center",fontSize:"13px",fontWeight:"700",color:"#ffffff",lineHeight:"1"})},e.letter));var i,l}),n("button",{style:z,title:"Show Applications","aria-label":"Show Applications",tabIndex:0,onMouseEnter:()=>o(Tt.length),onMouseLeave:()=>o(-1),onClick:S},"☰")),n("main",{className:"unity-desktop__desktop",style:{flex:"1",background:"linear-gradient(135deg, #2c001e 0%, #5e2750 50%, #2c001e 100%)",display:"flex",alignItems:"center",justifyContent:"center",overflow:"auto",position:"relative"}},...M.filter(Boolean),I,e.children)))},exports.VideoPlayer=function(e){const t=!1!==e.controls,o=c(null);p();const[r,i]=l(!1),[d,u]=l(0),[f,g]=l(0),[x,h]=l(e.muted?0:1),[b,m]=l(!!e.muted),[y,v]=l(!0),k="number"==typeof e.width?`${e.width}px`:e.width??"100%",S="number"==typeof e.height?`${e.height}px`:e.height??"auto";a(()=>{const t=o.current;if(!t)return;const n=()=>{i(!0),e.onPlay&&e.onPlay()},r=()=>{i(!1),e.onPause&&e.onPause()},l=()=>{i(!1),e.onEnded&&e.onEnded()},a=()=>{u(t.currentTime),g(t.duration),e.onTimeUpdate&&e.onTimeUpdate(t.currentTime,t.duration)},s=()=>{g(t.duration)};return t.addEventListener("play",n),t.addEventListener("pause",r),t.addEventListener("ended",l),t.addEventListener("timeupdate",a),t.addEventListener("loadedmetadata",s),()=>{t.removeEventListener("play",n),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 w=s(()=>{const e=o.current;e&&(e.paused?e.play():e.pause())},[]),C=s(e=>{const t=o.current;if(!t||!isFinite(t.duration))return;const n=e.currentTarget.getBoundingClientRect(),r=Math.max(0,Math.min(1,(e.clientX-n.left)/n.width));t.currentTime=r*t.duration},[]),$=s(e=>{const t=o.current,n=parseFloat(e.target.value);t&&(t.volume=n,t.muted=0===n,h(n),m(0===n))},[]),z=s(()=>{const e=o.current;e&&e.requestFullscreen&&e.requestFullscreen()},[]);if(!t)return n("video",{ref:o,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:k,height:S,display:"block"}});const M=f>0?d/f*100:0,I={background:"none",border:"none",color:"#ffffff",cursor:"pointer",fontSize:"16px",padding:"4px 8px",lineHeight:"1"},D=n("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:y?"1":"0",transition:"opacity 0.3s"}},n("button",{"aria-label":r?"Pause":"Play",onclick:w,style:I},r?"⏸":"▶"),n("div",{onclick:C,style:{flex:"1",height:"4px",backgroundColor:"rgba(255,255,255,0.3)",borderRadius:"2px",cursor:"pointer",position:"relative"}},n("div",{style:{width:`${M}%`,height:"100%",backgroundColor:"#3b82f6",borderRadius:"2px",transition:"width 0.1s linear"}})),n("span",{style:{color:"#ffffff",fontSize:"12px",whiteSpace:"nowrap",fontFamily:"monospace"}},`${ke(d)} / ${ke(f)}`),n("input",{type:"range",min:"0",max:"1",step:"0.05",value:String(b?0:x),oninput:$,"aria-label":"Volume",style:{width:"60px",cursor:"pointer"}}),n("button",{"aria-label":"Fullscreen",onclick:z,style:I},"⛶"));return n("div",{style:{position:"relative",width:k,height:S,backgroundColor:"#000",overflow:"hidden"},onmouseenter:()=>v(!0),onmouseleave:()=>{r&&v(!1)}},n("video",{ref:o,src:e.src,poster:e.poster,autoplay:!!e.autoPlay||void 0,loop:!!e.loop||void 0,muted:!!e.muted||void 0,playsinline:!0,onclick:w,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"}}),D)},exports.VirtualScroll=function(e){const{items:t,renderItem:o,itemHeight:r,overscan:i=5,height:a}=e,[d,p]=l(0),u=c(null),f=t.length*r,g=parseInt(a,10)||400,x=Math.ceil(g/r),h=Math.max(0,Math.floor(d/r)-i),b=Math.min(t.length,Math.floor(d/r)+x+i),m=s(e=>{const t=e.target;p(t.scrollTop)},[]),y=[];for(let e=h;e<b;e++)y.push(n("div",{key:String(e),style:{position:"absolute",top:e*r+"px",left:"0",right:"0",height:`${r}px`,overflow:"hidden"}},o(t[e],e)));return n("div",{ref:u,style:{...V,height:a},onScroll:m},n("div",{style:{height:`${f}px`,position:"relative",width:"100%"}},...y))},exports.VizWrapper=function(e){const t=e.titlePosition??"top",o=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?n("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?(p=e.legend,n("div",{className:"viz-legend",style:{display:"flex",flexDirection:(u={align:i,fontSize:e.legendFontSize??"12px",gap:e.legendGap??16,direction:"left"===o||"right"===o?"column":"row"}).direction,flexWrap:"wrap",gap:`${u.gap}px`,justifyContent:u.align,alignItems:"center",fontSize:u.fontSize,color:"#6b7280",flexShrink:"0"}},...p.map((e,t)=>n("div",{key:`legend-${t}`,style:{display:"flex",alignItems:"center",gap:"6px"}},function(e){const t=e.shape??"circle";return"line"===t?n("svg",{width:"20",height:"12",viewBox:"0 0 20 12"},n("line",{x1:"0",y1:"6",x2:"20",y2:"6",stroke:e.color,"stroke-width":"2","stroke-dasharray":e.dash??""})):n("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),n("span",null,e.label))))):null;var p,u;const f=function(e,t,o,r,i){const l=[];if("top"===r&&e&&l.push(e),"left"===i||"right"===i){const a=[];"left"===i&&o&&a.push(o),"left"===r&&e&&a.push(e),a.push(t),"right"===r&&e&&a.push(e),"right"===i&&o&&a.push(o),l.push(n("div",{style:{display:"flex",flexDirection:"row",flex:"1",gap:"12px",minHeight:"0",alignItems:"stretch"}},...a))}else if("left"===r||"right"===r){"top"===i&&o&&l.push(o);const a=[];"left"===r&&e&&a.push(e),a.push(t),"right"===r&&e&&a.push(e),l.push(n("div",{style:{display:"flex",flexDirection:"row",flex:"1",gap:"12px",minHeight:"0",alignItems:"center"}},...a)),"bottom"===i&&o&&l.push(o)}else"top"===i&&o&&l.push(o),l.push(t),"bottom"===i&&o&&l.push(o);return"bottom"===r&&e&&l.push(e),l}(d,n("div",{className:"viz-content",style:{flex:"1",minWidth:"0",minHeight:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}},e.children),c,t,o);return n("div",{className:`viz-wrapper ${e.className??""}`.trim(),style:s},...f)},exports.WordProcessor=function(e){const[t,o]=l(!1),[r,i]=l(!1),[a,p]=l(!1),[u,f]=l(-1),[g,x]=l(""),[h,b]=l(-1),[m,y]=l(0),[v,k]=l("3"),S=c(null),w={bold:s(()=>{document.execCommand("bold",!1),o(e=>!e),S.current&&S.current.focus()},[]),italic:s(()=>{document.execCommand("italic",!1),i(e=>!e),S.current&&S.current.focus()},[]),underline:s(()=>{document.execCommand("underline",!1),p(e=>!e),S.current&&S.current.focus()},[])},C={bold:t,italic:r,underline:a},$=s(e=>{document.execCommand(e,!1),S.current&&S.current.focus()},[]),z=s(e=>{document.execCommand("fontSize",!1,e),k(e),S.current&&S.current.focus()},[]),M=s(e=>{b(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":S.current&&(S.current.innerHTML="",y(0))}b(-1),S.current&&S.current.focus()},[]),D=s(()=>{if(S.current){const e=S.current.textContent??"";y(qt(e))}},[]),F=s(()=>{b(-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"}),[]),L=d(()=>function(){const e=[];for(let t=0;t<=20;t++){const o=t%2==0;e.push(n("div",{key:String(t),style:{position:"absolute",left:t/20*100+"%",bottom:"0",width:"1px",height:o?"10px":"5px",backgroundColor:"#999"}})),o&&e.push(n("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}(),[]),A=e.content??"Start typing...",T=qt(A),E=m>0?m:T,W={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"},B={display:"block",width:"100%",padding:"6px 16px",fontSize:"13px",color:"#333",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"};function N(e,t){return{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid transparent",borderRadius:"3px",cursor:"pointer",fontSize:"13px",backgroundColor:C[e]?"rgba(0,0,0,0.12)":g===e?"rgba(0,0,0,0.06)":"transparent",color:"var(--color-text, #444)",transition:"background 0.15s",...t??{}}}const P=Bt.map((e,t)=>{const o=[e];return h===t&&Nt[e]&&o.push(n("div",{key:"dropdown",style:W,className:"word-processor__menu-dropdown"},...Nt[e].map((e,t)=>n("button",{key:String(t),style:B,onClick:t=>{t.stopPropagation(),I(e.action)},role:"menuitem"},e.label)))),n("button",{key:String(t),style:(r=t,{padding:"4px 10px",cursor:"pointer",borderRadius:"3px",fontSize:"13px",color:"var(--color-text, #333)",backgroundColor:h===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:()=>M(t),onMouseEnter:()=>{f(t)},onMouseLeave:()=>f(-1)},...o);var r});return n("div",{className:`word-processor ${e.className??""}`.trim(),style:R},n("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),n("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"},n("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"},n("span",null,"Arial"),n("span",{style:{fontSize:"10px",color:"#999"}},"▼")),n("div",{key:"0",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},...Pt.map(e=>n("button",{key:e.id,style:N(e.id,e.style),title:e.shortcut?`${e.label} (${e.shortcut})`:e.label,"aria-label":e.label,"aria-pressed":String(C[e.id]??!1),onClick:w[e.id],onMouseEnter:()=>x(e.id),onMouseLeave:()=>x("")},e.text))),n("div",{key:"1",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px",alignItems:"center"}},n("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)}},...jt.map(e=>n("option",{key:e,value:e},_t[e])))),n("div",{key:"2",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},...Ht.map((e,t)=>n("button",{key:String(t),style:N(`align-${t}`),title:e.label,"aria-label":e.label,onClick:()=>$(e.command),onMouseEnter:()=>x(`align-${t}`),onMouseLeave:()=>x("")},e.text)))),n("div",{className:"word-processor__ruler",style:{height:"20px",backgroundColor:"#e8e8e8",borderBottom:"1px solid #ccc",position:"relative",flexShrink:"0",margin:"0 60px"},"aria-hidden":"true"},...L),n("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},n("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:S,onInput:D,suppressContentEditableWarning:!0},A)),n("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"}},n("span",null,"Page 1 of 1"),n("span",null,`${E} words`),n("span",null,"100%")))},exports.buildInputStyle=oe,exports.buildNavItemStyle=we,exports.buildRotationMatrix=$t,exports.computeMandelbrotGrid=function(e,t,o=[-2.5,1],n=[-1.25,1.25],r=80,i=ft){const l=[];for(let a=0;a<t;a++){const s=[],d=n[1]-a/t*(n[1]-n[0]);for(let t=0;t<e;t++){const n=o[0]+t/e*(o[1]-o[0]);s.push(i(n,d,r))}l.push(s)}return l},exports.computeSlices=kt,exports.createToaster=Je,exports.describeArc=vt,exports.generateEdges=Ct,exports.generateHypercube=Rt,exports.generatePalette=At,exports.generateVertices=wt,exports.numRotationAngles=Lt,exports.projectTo2D=Ft,exports.transformVec=Dt,exports.useBarGraphScales=ot,exports.useHover=Ce,exports.useHypercube=function(e={}){const t=e.dimension??4,o=e.rotationSpeed??.008,n=e.perspective??.25,r=e.scale??200,i=Lt(t),[s,c]=l(()=>new Array(i).fill(0));return a(()=>{if(0===o)return;let e=!0,t=0;const n=()=>{e&&(c(e=>e.map((e,t)=>e+o*(1+.3*t))),t=requestAnimationFrame(n))};return t=requestAnimationFrame(n),()=>{e=!1,cancelAnimationFrame(t)}},[o]),{data:d(()=>Rt(t,s,n,r),[t,s,n,r]),angles:s,setAngles:c}},exports.useLineGraphScales=ht,exports.useToast=function(e={}){const t=c(null);t.current||(t.current=Je(e));const o=t.current,r=s(()=>n(et,{toaster:o}),[o]);return{toast:o.toast,dismiss:o.dismiss,dismissAll:o.dismissAll,ToastContainer:r}};
|
|
1
|
+
"use strict";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 p(){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:""}),p();const u=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(){p(),"undefined"!=typeof window&&window.location.hash;for(const e of u)e()}),r({flags:{},isEnabled:()=>!1,setFlag:()=>{},loading:!1});const g="#334155",x="#1e293b",y="#374151",m={xs:24,sm:32,md:40,lg:56,xl:80},b=["#3b82f6","#ef4444","#22c55e","#a855f7","#f97316","#ec4899","#14b8a6","#6366f1","#eab308","#06b6d4"],S={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}}}const v={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"}},w={sm:{width:"6px",height:"6px"},md:{width:"8px",height:"8px"},lg:{width:"10px",height:"10px"}},$={width:"100%",borderCollapse:"collapse",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",color:"#1f2937"},M={padding:"10px 12px",textAlign:"left",fontWeight:"600",backgroundColor:"#f9fafb",borderBottom:"2px solid #e5e7eb",userSelect:"none",whiteSpace:"nowrap"},C={padding:"10px 12px",borderBottom:"1px solid #e5e7eb"},z={marginLeft:"4px",fontSize:"12px",color:"#6b7280"},I={width:"100%",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",boxSizing:"border-box"},A={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",fontSize:"13px",color:"#6b7280"},F={padding:"4px 10px",margin:"0 2px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#fff",cursor:"pointer",fontSize:"13px"},L={...F,backgroundColor:"#3b82f6",color:"#fff",borderColor:"#3b82f6"},R={...F,opacity:"0.5",cursor:"default"},D={cursor:"pointer",width:"16px",height:"16px"};function N(e,t,n){return e!==t?"↕":"asc"===n?"↑":"↓"}function B(e){return e<10?`0${e}`:String(e)}const T={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"},W={fontSize:"2rem",fontWeight:"600",letterSpacing:"2px",lineHeight:"1"},E={fontSize:"0.875rem",fontWeight:"400",marginLeft:"4px",verticalAlign:"super"},P={fontSize:"0.75rem",color:"#94a3b8",marginTop:"4px"},H={listStyle:"none",margin:"0",padding:"0",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px"},j={padding:"10px 14px",color:"var(--color-text, #1f2937)"},Y={borderBottom:"1px solid var(--color-border, #e5e7eb)"},_={cursor:"pointer",transition:"background-color 0.15s ease"},q={backgroundColor:"var(--color-bg-muted, #eff6ff)"},O={padding:"24px",textAlign:"center",color:"var(--color-text-muted, #9ca3af)",fontSize:"14px"},G={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 U(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 V={sm:{fontSize:"11px",padding:"2px 8px",gap:"4px"},md:{fontSize:"13px",padding:"4px 10px",gap:"6px"},lg:{fontSize:"15px",padding:"6px 14px",gap:"8px"}},X={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"},K={overflow:"auto",position:"relative",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},Z={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 J(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 Q={sm:16,md:24,lg:40},ee={slow:"1.2s",normal:"0.75s",fast:"0.45s"};function te(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 ne(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 oe={sm:{box:14,icon:10,fontSize:"12px"},md:{box:18,icon:12,fontSize:"14px"},lg:{box:22,icon:16,fontSize:"16px"}},re=["#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 ie(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e)}function le(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()}const ae=["January","February","March","April","May","June","July","August","September","October","November","December"],se=["Su","Mo","Tu","We","Th","Fr","Sa"];function de(e){if(!e)return null;if(e instanceof Date)return e;const t=new Date(e);return isNaN(t.getTime())?null:t}function ce(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function fe(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]}`}const pe=["bold","italic","underline","strikethrough","heading1","heading2","bulletList","orderedList","blockquote","link","unlink","insertHR","removeFormat","undo","redo"],ue={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"}},he=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Paris","Asia/Tokyo"];function ge(e){return String(e).padStart(2,"0")}const xe={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}},ye={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)"},me={none:"none",sm:"0 1px 3px rgba(0,0,0,0.12)",md:"0 4px 6px rgba(0,0,0,0.1)"};function be(e,t){return"both"===e?"auto":"horizontal"===e?"x"===t?"auto":"hidden":"y"===t?"auto":"hidden"}function Se(e){switch(e){case"never":return{scrollbarWidth:"none"};case"always":case"hover":return{scrollbarWidth:"thin"};default:return{scrollbarWidth:"auto"}}}function ke(e){return!isFinite(e)||e<0?"0:00":`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,"0")}`}function ve(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 we(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 $e(){const[e,t]=l(!1);return{hover:e,onMouseEnter:s(()=>t(!0),[]),onMouseLeave:s(()=>t(!1),[])}}function Me(e){const{section:t,expanded:n,onToggle:r,headerStyle:i,expandIcon:l,collapseIcon:a,iconPosition:d}=e,{hover:c,onMouseEnter:f,onMouseLeave:p}=$e(),u=!0===t.disabled,h={display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",boxSizing:"border-box",padding:i.padding??"12px 16px",backgroundColor:u?"#f9fafb":c?i.hoverBackground??"#f3f4f6":i.backgroundColor??"transparent",color:u?"#9ca3af":i.color??"inherit",fontWeight:i.fontWeight??"600",fontSize:i.fontSize??"inherit",border:"none",outline:"none",cursor:u?"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;u||"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),r())},[u,r]),x=s(()=>{u||r()},[u,r]),y=o("span",{"aria-hidden":"true",style:{display:"inline-block",transition:"transform 0.2s ease",transform:n?"rotate(180deg)":"rotate(0deg)",flexShrink:"0",marginLeft:"right"===d?"auto":"0",marginRight:"left"===d?"8px":"0",paddingLeft:"right"===d?"8px":"0"}},n?a:l),m=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?[y,m]:[m,y];return o("button",{id:`accordion-header-${t.id}`,role:"button","aria-expanded":String(n),"aria-controls":`accordion-panel-${t.id}`,"aria-disabled":u?"true":void 0,"data-section-id":t.id,tabIndex:u?-1:0,style:h,onClick:x,onKeyDown:g,onMouseEnter:f,onMouseLeave:p},...b)}function Ce(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))}const ze={sm:{fontSize:"12px",padding:"4px 0"},md:{fontSize:"14px",padding:"6px 0"},lg:{fontSize:"16px",padding:"8px 0"}};function Ie(e){const{item:t,itemStyle:n,closeOnSelect:r,onClose:i}=e,{hover:a,onMouseEnter:d,onMouseLeave:c}=$e(),[f,p]=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 h=!0===t.disabled,g={...we(n,{hover:!h&&a,active:!1}),position:"relative",justifyContent:"space-between",...h?{color:"#9ca3af",cursor:"default",opacity:"0.6"}:{}},x=s(()=>{h||(u?p(e=>!e):(t.onClick&&t.onClick(),r&&i()))},[h,u,t,r,i]),y=s(()=>{d(),u&&p(!0)},[u,d]),m=s(()=>{c(),u&&p(!1)},[u,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)),S=u?o("span",{style:{marginLeft:"8px",fontSize:"10px",lineHeight:"1"},"aria-hidden":"true"},"›"):null,k=u&&f?o("div",{style:{position:"absolute",left:"100%",top:"0",zIndex:"1000"}},o(ve,{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(Ie,{key:e.id,item:e,itemStyle:n,closeOnSelect:r,onClose:i})))):null;return o("div",{style:{position:"relative"},onMouseEnter:y,onMouseLeave:m},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":u||void 0,"aria-expanded":u?String(f):void 0},b,S),k)}function Ae(e){const{item:t,onClose:n,index:r}=e,{hover:i,onMouseEnter:a,onMouseLeave:d}=$e(),[c,f]=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 u=!0===t.disabled,h=s(()=>{u||(p?f(e=>!e):(t.onClick&&t.onClick(),n()))},[u,p,t,n]),g=s(()=>{a(),p&&f(!0)},[p,a]),x=s(()=>{d(),p&&f(!1)},[p,d]),y={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 16px",fontSize:"13px",fontFamily:"inherit",border:"none",outline:"none",width:"100%",textAlign:"left",cursor:u?"default":"pointer",backgroundColor:!u&&i?"#f3f4f6":"transparent",color:u?"#9ca3af":"#1f2937",opacity:u?"0.6":"1",transition:"background-color 0.1s",boxSizing:"border-box"},m=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=p?o("span",{style:{fontSize:"10px",color:"#9ca3af"},"aria-hidden":"true"},"▶"):t.shortcut?o("span",{style:{fontSize:"11px",color:"#9ca3af",marginLeft:"24px"}},t.shortcut):null,S=p&&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(Ae,{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:y,onClick:h,disabled:u||void 0,tabIndex:-1,"aria-disabled":u||void 0,"aria-haspopup":p||void 0,"aria-expanded":p?c:void 0},m,b),S)}function Fe(e){const{menu:t,index:n,isOpen:r,anyOpen:i,onOpen:l,onClose:a}=e,{hover:d,onMouseEnter:f,onMouseLeave:p}=$e(),u=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"},y=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(Ae,{key:String(t),item:e,onClose:a,index:t})))):null;return o("div",{style:{position:"relative",display:"inline-block"},onMouseEnter:g,onMouseLeave:p},o("button",{ref:u,type:"button",role:"menuitem",style:x,onClick:h,"aria-haspopup":"true","aria-expanded":String(r),tabIndex:0},t.label),y)}function Le(e,t){const n=[];for(let o=e;o<=t;o++)n.push(o);return n}const Re={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"},De={...Re,backgroundColor:"#2563eb",color:"#ffffff",borderColor:"#2563eb",fontWeight:"600"},Ne={...Re,color:"#9ca3af",cursor:"default",opacity:"0.5"},Be={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"36px",height:"36px",color:"#6b7280",fontSize:"14px",userSelect:"none"};function Te(e){const{item:t,collapsed:n,selectedId:r,onSelect:i,depth:a}=e,{hover:d,onMouseEnter:c,onMouseLeave:f}=$e(),[p,u]=l(!1),h=t.children&&t.children.length>0,g=t.id===r,x=s(()=>{h&&!n&&u(e=>!e),i&&i(t.id)},[h,n,i,t.id]),y={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"},m=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),S=!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,k=!n&&h?o("span",{style:{fontSize:"10px",transition:"transform 0.15s",transform:p?"rotate(90deg)":"rotate(0deg)",marginLeft:"4px"},"aria-hidden":"true"},"▶"):null,v=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,w=o("button",{type:"button",style:y,onClick:x,onMouseEnter:c,onMouseLeave:f,"aria-selected":g?"true":"false",title:n?t.label:void 0},m,b,S,k,v),$=!n&&h&&p?t.children.map(e=>o(Te,{key:e.id,item:e,collapsed:n,selectedId:r,onSelect:i,depth:a+1})):null;return o("div",{key:t.id,style:{position:"relative"}},w,$?o("div",{role:"group"},...$):null)}const We={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 Ee(e){const{item:t,size:n,variant:r}=e,{hover:i,onMouseEnter:a,onMouseLeave:d}=$e(),c=We[n],f=!0===t.disabled,p="toggle"===t.type,[u,h]=l(!1),g=p?!0===t.active:u,x=s(()=>{!f&&t.onClick&&t.onClick()},[f,t]),y=s(()=>{f||p||h(!0)},[f,p]),m=s(()=>{p||h(!1)},[p]),b=s(()=>{d(),p||h(!1)},[p,d]),S={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"},k=t.icon?o("span",{style:{fontSize:c.iconSize},"aria-hidden":"true"},t.icon):null,v=t.label?o("span",null,t.label):null,w="dropdown"===t.type?o("span",{style:{fontSize:"10px",marginLeft:"2px"},"aria-hidden":"true"},"▼"):null;return o("button",{type:"button",style:S,onClick:x,onMouseDown:y,onMouseUp:m,onMouseEnter:a,onMouseLeave:b,disabled:f||void 0,"aria-pressed":p?g:void 0,"aria-label":t.label||t.id,title:t.label||t.id},k,v,w)}class Pe{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 Pe(e,this))}static fromData(e){return new Pe(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 Pe(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 He(e){e.expanded=!0;for(const t of e.children)He(t)}function je(e,t=[]){if(t.push(e),e.expanded)for(const n of e.children)je(n,t);return t}function Ye(e){if(!e.parent)return!0;const t=e.parent.children;return t[t.length-1]===e}function _e(e){const{node:t,isSelected:n,indentPx:r,lineColor:i,lineWidth:l,iconExpanded:s,iconCollapsed:d,nodeStyle:f,renderNode:p,onToggle:u,onClick:h,focusedId:g}=e,x=$e(),y=c(null),m=g===t.id;a(()=>{m&&y.current&&y.current.focus()},[m]);const b=t.isLeaf(),S=t.depth,k=[];for(let e=0;e<S;e++){let n=t;for(let t=0;t<S-e;t++)n=n?n.parent:null;const a=!!n&&!Ye(n);k.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 v=S>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,w=b?o("span",{"aria-hidden":"true",style:{display:"inline-block",width:"18px",flexShrink:"0",marginRight:"4px"}}):o("span",{"aria-hidden":"true",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(),u(t)}},t.expanded?s:d),$=p?p(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=we(f,{hover:x.hover,active:n});return o("div",{ref:y,role:"treeitem","aria-expanded":b?void 0:String(t.expanded),"aria-selected":n?"true":"false","aria-level":S+1,tabIndex:m?0:-1,style:{...M,display:"flex",alignItems:"stretch",padding:"0"},onMouseEnter:x.onMouseEnter,onMouseLeave:x.onMouseLeave,onClick:()=>h(t)},...k,v,o("span",{style:{display:"flex",alignItems:"center",flex:"1",padding:f.padding??"6px 10px",minWidth:"0"}},w,$))}function qe(e){const{items:t,position:n,onClose:r,depth:i}=e,[s,d]=l(-1),[f,p]=l(null),u=c(null);a(()=>{if(!u.current)return;u.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&&p(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?p(s):!e.disabled&&e.onClick&&(e.onClick(),r())}}else"Escape"===n.key&&r()};u.current.addEventListener("keydown",e);const n=u.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),u={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:u,onMouseEnter:()=>{d(t),p(c?t:null)},onClick:()=>{a||(c?p(t):(e.onClick&&e.onClick(),r()))},role:"menuitem","aria-disabled":a?"true":void 0},...h)];return c&&f===t&&g.push(o(qe,{key:`submenu-${t}`,items:e.children,position:{x:n.x+178,y:n.y+36*t},onClose:()=>p(null),depth:i+1})),o("div",{key:`wrap-${t}`,style:{position:"relative"}},...g)});return o("div",{ref:u,style:h,tabIndex:-1,role:"menu"},...g)}function Oe(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 Ge(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}}}const Ue={sm:"400px",md:"600px",lg:"800px",full:"100vw"};function Ve(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 Xe(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}`}}}let Ke=0;function Ze(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-${++Ke}-${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 Je={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 Qe(e){const{item:t,onDismiss:n}=e,r=Je[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 et(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(Qe,{key:e.id,item:e,onDismiss:d}));return o("div",{style:i},...c)}function tt(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 nt(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 ot=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function rt(e,t){return t||ot[e%ot.length]}function it(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 lt(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 at(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),st(a))};return st(a),()=>{r=!0}}function st(e){"function"==typeof requestIdleCallback?requestIdleCallback(()=>e(),{timeout:16}):setTimeout(e,0)}function dt(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 ct(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}const ft=40,pt=1e6;function ut(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 ht(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 gt(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 xt(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:gt(r,i,6),yTicks:gt(l,a,6),xMin:r,xMax:i,yMin:l,yMax:a}}(e,t,n,o),[e,t,n,o])}function yt(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function mt(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 bt(e,t,n,o){return{x:e+n*Math.cos(o),y:t+n*Math.sin(o)}}function St(e,t,n,o,r,i){const l=r-Math.PI/2,a=i-Math.PI/2,s=bt(e,t,o,l),d=bt(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=bt(e,t,n,a),p=bt(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 ${p.x} ${p.y}`,"Z"].join(" ")}function kt(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 vt(e,t,n,o,r){return{x:n+e*Math.cos(t)*r,y:o-e*Math.sin(t)*r}}function wt(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 $t(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 Mt(e,t){let n=Ct(e),o=0;for(let r=0;r<e;r++)for(let i=r+1;i<e;i++)o<t.length&&(n=It(n,zt(e,r,i,t[o]))),o++;return n}function Ct(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 zt(e,t,n,o){const r=Ct(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 It(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 At(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 Ft(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 Lt(e,t=[],n=.3,o=1){const r=wt(e),i=$t(e),l=Mt(e,t);return{vertices:r.map((e,t)=>{const r=Ft(At(l,e),n);return{id:t,position:e,x:r.x*o,y:r.y*o,depth:r.depth}}),edges:i,dimension:e}}function Rt(e){return e*(e-1)/2}function Dt(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}const Nt=[{letter:"F",color:"#3465a4",label:"Files"},{letter:"W",color:"#e67e22",label:"Browser"},{letter:"T",color:"#2ecc71",label:"Terminal"},{letter:"M",color:"#3498db",label:"Mail"},{letter:"N",color:"#e74c3c",label:"Music"},{letter:"P",color:"#9b59b6",label:"Photos"},{letter:"S",color:"#f39c12",label:"Software"},{letter:"G",color:"#7f8c8d",label:"Settings"}],Bt=["🔊","📶","🔋"];let Tt=1;const Wt=["File","Edit","View","Insert","Format","Tools","Help"],Et={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"}]},Pt=[{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"}}],Ht=[{label:"Align left",text:"≡",command:"justifyLeft"},{label:"Align center",text:"≣",command:"justifyCenter"},{label:"Align right",text:"≢",command:"justifyRight"}],jt=["1","2","3","4","5","6","7"],Yt={1:"8",2:"10",3:"12",4:"14",5:"18",6:"24",7:"36"};function _t(e){return e.trim().split(/\s+/).filter(e=>e.length>0).length}const qt=["File","Edit","Selection","View","Go","Run","Terminal","Help"],Ot={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"}]},Gt=[{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}],Ut={"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"]',"}"]},Vt=Ut["App.ts"],Xt=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"]),Kt=new Set(["string","number","boolean","void","null","undefined","any","never","unknown","object","interface","type","enum"]),Zt="#569cd6",Jt="#d4d4d4",Qt=[{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]}],en=[{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}],tn=[{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}],nn=[{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}],on=[{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}],rn=[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],ln=[{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}],an=[{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}],sn=["09:30","10:00","10:30","11:00","11:30","12:00"];function dn(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function cn(e){return e.toFixed(2)}const fn={backgroundColor:"#1a1a2e",borderRadius:"4px",padding:"12px",border:"1px solid #2a2a4a",overflow:"auto",display:"flex",flexDirection:"column"},pn={fontSize:"12px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#8888aa",marginBottom:"8px",flexShrink:"0"},un={width:"100%",borderCollapse:"collapse",fontSize:"12px"},hn={textAlign:"left",padding:"4px 6px",borderBottom:"1px solid #2a2a4a",color:"#8888aa",fontWeight:"600",fontSize:"11px"},gn={padding:"3px 6px",borderBottom:"1px solid #16162a",color:"#ccccdd",fontSize:"12px"},xn={cursor:"default",transition:"background-color 0.1s"};const yn={sm:{padding:"3px 10px",fontSize:"12px",borderRadius:"4px"},md:{padding:"6px 14px",fontSize:"13px",borderRadius:"6px"},lg:{padding:"8px 20px",fontSize:"15px",borderRadius:"6px"}},mn={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"}},bn=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],Sn=Math.PI/180;function kn(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 vn(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)}const wn=Math.PI/180;function $n(e){return{x:Math.sin(e.theta)*Math.cos(e.phi),y:Math.sin(e.theta)*Math.sin(e.phi),z:Math.cos(e.theta)}}function Mn(e,t,n){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 Cn(e,t,n){const{x:o,y:r,z:i}=$n(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),Mn(s,d,c)}function zn(e,t){const n=t.angle??Math.PI;switch(t.gate){case"X":return Cn(e,"x",Math.PI);case"Y":return Cn(e,"y",Math.PI);case"Z":return Cn(e,"z",Math.PI);case"H":{const{x:t,y:n,z:o}=$n(e);return Mn(o,-n,t)}case"S":return Cn(e,"z",Math.PI/2);case"T":return Cn(e,"z",Math.PI/4);case"Rx":return Cn(e,"x",n);case"Ry":return Cn(e,"y",n);case"Rz":return Cn(e,"z",n)}}function In(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 An(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=In(t,25),o=In(t,50),r=In(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,p=[];for(const e of t)(e<l||e>a)&&p.push(e);return{q1:n,median:o,q3:r,iqr:i,whiskerLow:s,whiskerHigh:d,mean:f,outliers:p,min:t[0],max:t[t.length-1]}}function Fn(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 Ln(e,t,n){return e<t?t:e>n?n:e}function Rn(e){return"number"==typeof e&&isFinite(e)&&!isNaN(e)}const Dn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Nn=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function Bn(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 Tn(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function Wn(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 En(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=Wn(t[r]),a=Wn(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 Pn=["#9be9a8","#40c463","#30a14e","#216e39"],Hn=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function jn(e,t,n,o){const r=o-Math.PI/2;return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function Yn(e,t,n,o,r,i){const l=jn(e,t,n,r),a=jn(e,t,n,i),s=jn(e,t,o,r),d=jn(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 _n(e,t,n,o,r,i,l){const a=jn(e,t,n,o),s=jn(e,t,n,r),d=jn(e,t,n,i),c=jn(e,t,n,l),f=l-i,p=r-o>Math.PI?1:0,u=f>Math.PI?1:0;return[`M ${a.x} ${a.y}`,`A ${n} ${n} 0 ${p} 1 ${s.x} ${s.y}`,`Q ${e} ${t} ${d.x} ${d.y}`,`A ${n} ${n} 0 ${u} 1 ${c.x} ${c.y}`,`Q ${e} ${t} ${a.x} ${a.y}`,"Z"].join(" ")}const qn=["#3b82f6","#22c55e","#f59e0b","#8b5cf6","#ef4444","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];const On=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Gn(e){return On[e%On.length]}function Un(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??Gn(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 Vn(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 p=(o.vx-t.vx)*d+(o.vy-t.vy)*c;p<=0||(o.fixed?(t.vx+=p*d,t.vy+=p*c):t.fixed?(o.vx-=p*d,o.vy-=p*c):(o.vx-=p*d,o.vy-=p*c,t.vx+=p*d,t.vy+=p*c))}}}const Xn=["#3b82f6","#6366f1","#8b5cf6","#a855f7","#c084fc","#d8b4fe","#e9d5ff","#f3e8ff"],Kn=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Zn(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 Jn(e,t){return t||Kn[e%Kn.length]}const Qn=Math.PI/180;function eo(e,t,n,o){const r=o*Qn;return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function to(e,t,n,o,r){const i=eo(e,t,n,r),l=eo(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 no(e){return!isFinite(e)||isNaN(e)?"--":Math.abs(e)>=1e3?Math.round(e).toString():e===Math.floor(e)?e.toString():e.toFixed(1)}const oo=Math.PI/180;function ro(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 io(e,t){if(0===t.length)return"#cbd5e1";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=ro(t[i]),d=ro(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 lo(e){const t=/[ML]\s*([\d.eE+-]+)[,\s]+([\d.eE+-]+)/gi;let n=0,o=0,r=0,i=t.exec(e);for(;null!==i;){const l=parseFloat(i[1]),a=parseFloat(i[2]);isNaN(l)||isNaN(a)||(n+=l,o+=a,r++),i=t.exec(e)}return 0===r?{cx:0,cy:0}:{cx:n/r,cy:o/r}}function ao(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 so(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=ao(t[r]),a=ao(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 co(e){const{r:t,g:n,b:o}=ao(e);return(.299*t+.587*n+.114*o)/255}const fo=["#3b82f6","#fbbf24","#ef4444"];function po(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function uo(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 ho(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=uo(t[r]),a=uo(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 go(e){const{r:t,g:n,b:o}=uo(e);return(.299*t+.587*n+.114*o)/255}const xo=["#f0f9ff","#3b82f6","#1e3a8a"],yo=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function mo(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 bo(e,t){const n=[];for(const o of t)n.push(String(e[o]??""));return n.join(" | ")}function So(e,t){const n=new Set;for(const o of e)n.add(bo(o,t));const o=Array.from(n);return o.sort(),o}function ko(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 vo(e){return Number.isInteger(e)?String(e):e.toFixed(2)}function wo(e,t){return 2*Math.PI*e/t-Math.PI/2}function $o(e,t,n,o){return{x:e+n*Math.cos(o),y:t+n*Math.sin(o)}}const Mo=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];const Co=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],zo=2*Math.PI;function Io(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 Ao(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),p=e+o*Math.cos(d),u=t+o*Math.sin(d),h=e+n*Math.cos(d),g=t+n*Math.sin(d),x=e+n*Math.cos(s),y=t+n*Math.sin(s);if(l>=zo-.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} ${y}`,`A ${n} ${n} 0 1 0 ${e+n*Math.cos(r)} ${t+n*Math.sin(r)}`,`A ${n} ${n} 0 1 0 ${x} ${y}`,"Z"].join(" ")}return[`M ${c} ${f}`,`A ${o} ${o} 0 ${a} 1 ${p} ${u}`,`L ${h} ${g}`,`A ${n} ${n} 0 ${a} 0 ${x} ${y}`,"Z"].join(" ")}const Fo=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Lo(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 Ro(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 Do(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 No(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=Do(t[i]),d=Do(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 Bo(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}const To=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],Wo=[0,-45,45,90];function Eo(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,p=l*c+a*d;return{x:o-f/2,y:r-p/2,w:f,h:p}}function Po(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 Ho(e,t,n){return e.x>=0&&e.y>=0&&e.x+e.w<=t&&e.y+e.h<=n}function jo(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return Math.abs(t)}const Yo={0:"#1e293b",1:"#3b82f6"};exports.Accordion=function(e){const{sections:t,defaultExpanded:n,allowMultiple:r=!1,headerStyle:i={},contentStyle:a={},wrapperStyle:c,expandIcon:f="+",collapseIcon:p="−",iconPosition:u="right",animated:h=!0,onChange:g}=e,[x,y]=l(()=>n??[]),m=s(e=>{y(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(Me,{key:`header-${e.id}`,section:e,expanded:t,onToggle:()=>m(e.id),headerStyle:i,expandIcon:f,collapseIcon:p,iconPosition:u}),r=o(Ce,{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,p,u,h,m]);return o(ve,{role:"region",ariaLabel:"Accordion",styling:c,keyboardNav:!0},...b)},exports.Alert=function(e){const[t,n]=l(!0),r=e.type??"info",i=e.variant??"subtle",a=Z[r]??Z.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},exports.AnalogClock=function(e){const{format:t="12h",size:n=200,showDate:r=!1,dateFormat:i="short",showSeconds:s=!0,timezone:d,className:c}=e,[f,p]=l(h(d));a(()=>{const e=setInterval(()=>{p(h(d))},1e3);return()=>clearInterval(e)},[d]);const u=f.getHours(),m=f.getMinutes(),b=f.getSeconds(),S=u%12*30+.5*m,k=6*m+.1*b,v=6*b,w=n/2,$=n/2,M=n/2-10,C=M-4,z=M-22,I=[];I.push(o("circle",{cx:String(w),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=C-6;I.push(o("line",{x1:String(w+i*Math.cos(r)),y1:String($+i*Math.sin(r)),x2:String(w+C*Math.cos(r)),y2:String($+C*Math.sin(r)),stroke:g,"stroke-width":"2"}));const l=String(0===e?12:e);if(I.push(o("text",{x:String(w+z*Math.cos(r)),y:String($+z*Math.sin(r)),"text-anchor":"middle","dominant-baseline":"central",fill:y,"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(w+t*Math.cos(r)),y:String($+t*Math.sin(r)),"text-anchor":"middle","dominant-baseline":"central",fill:y,"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(w),y1:String($),x2:String(w+t*Math.cos(i)),y2:String($+t*Math.sin(i)),stroke:r,"stroke-width":n,"stroke-linecap":"round"})};I.push(A(S,.5*M,"4",x)),I.push(A(k,.75*M,"3",x)),s&&I.push(A(v,.85*M,"1.5","#ef4444")),I.push(o("circle",{cx:String(w),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:y}},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)},exports.Avatar=function(e){const{src:t,alt:n,name:r,size:i,shape:a="circle",fallbackColor:s,status:d,statusPosition:c="bottom-right"}=e,[f,p]=l(!1),u=function(e){return null==e?m.md:"number"==typeof e?e:m[e]??m.md}(i),h="circle"===a?"50%":`${Math.round(.15*u)}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 b[Math.abs(t)%b.length]}(r),x=`${Math.round(.4*u)}px`,y={position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:`${u}px`,height:`${u}px`,borderRadius:h,overflow:"hidden",flexShrink:"0"};let v;if(t&&!f)v=o("img",{src:t,alt:n??r??"avatar",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"},onError:()=>p(!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);v=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 w=o("div",{style:{...y,backgroundColor:t&&!f?"transparent":g},role:"img","aria-label":n??r??"avatar"},v);if(!d)return w;const $=Math.max(8,Math.round(.25*u));return o("div",{style:{position:"relative",display:"inline-flex",width:`${u}px`,height:`${u}px`,flexShrink:"0"}},w,o("span",{style:{position:"absolute",width:`${$}px`,height:`${$}px`,borderRadius:"50%",backgroundColor:S[d]??S.offline,border:"2px solid #fff",boxSizing:"border-box",...k(c,$)},"aria-label":d}))},exports.Badge=function(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?{...w[l],borderRadius:"50%",..."solid"===a?{backgroundColor:i}:{backgroundColor:"transparent",border:`2px solid ${i}`}}:{...v[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}`}},p=c?o("span",{style:f,"aria-label":r?"notification":`count ${d}`},d):null;if(null==s)return p??o("span",null);const u={...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:u,"aria-label":r?"notification":`count ${d}`},d):null)},exports.BarGraph=function(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:p=!0,gridColor:u="#e5e7eb",title:h,padding:g=50,animate:x=!1,stacked:y,grouped:m=!1}=e,b="vertical"===i,S=n-2*g,k=r-2*g,v=b?k:S,w=b?S:k,$=void 0!==y&&y.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)}(y):[],[$,y]),C=$?y.length:t.length,z=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,y,m),[t,y,m]),I=z>0?z:1,A=nt(C,I,v,w,a),F=s(()=>{if(!p)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+k-e;t.push(o("line",{key:`grid-${n}`,x1:String(g),y1:String(r),x2:String(g+S),y2:String(r),stroke:u,"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+k),stroke:u,"stroke-width":"1","stroke-dasharray":"4 2"})),t.push(o("text",{key:`grid-label-${n}`,x:String(r),y:String(g+k+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(n)))}}return t},[p,I,A,b,g,S,k,u]),L=s(()=>{const e=[];return b?(e.push(o("line",{key:"axis-y",x1:String(g),y1:String(g),x2:String(g),y2:String(g+k),stroke:"#374151","stroke-width":"1.5"})),e.push(o("line",{key:"axis-x",x1:String(g),y1:String(g+k),x2:String(g+S),y2:String(g+k),stroke:"#374151","stroke-width":"1.5"}))):(e.push(o("line",{key:"axis-x",x1:String(g),y1:String(g+k),x2:String(g+S),y2:String(g+k),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+k),stroke:"#374151","stroke-width":"1.5"}))),e},[b,g,S,k]),R=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,p,u=String(r.value);if(b){const e=g+a,t=g+k-i;d={x:String(e),y:String(t),width:String(A.barThickness),height:String(i),rx:String(c),ry:String(c),fill:s},p={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},p={x:String(t+i+6),y:String(e+A.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"}}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}`,...p},u)),b?e.push(o("text",{key:`cat-${n}`,x:String(g+a+A.barThickness/2),y:String(g+k+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},r.label)):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,k]),D=s(()=>{if(!y)return[];const e=[];for(let t=0;t<y.length;t++){const n=y[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),p=rt(l,a.color);if(b){const i=g+r,u=g+k-d-s;e.push(o("rect",{key:`sbar-${t}-${l}`,x:String(i),y:String(u),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:p,...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(u+s/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(a.value)))}else{const i=g+d,u=g+r;e.push(o("rect",{key:`sbar-${t}-${l}`,x:String(i),y:String(u),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:p,...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(u+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+k-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)))}b?e.push(o("text",{key:`scat-${t}`,x:String(g+r+A.barThickness/2),y:String(g+k+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},n.label)):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},[y,A,c,f,x,b,g,k]),N=s(()=>{if(!y)return[];const e=M.length,t=[];for(let n=0;n<y.length;n++){const r=y[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],p=M.indexOf(d.category),u=p*(a+l),h=A.valueScale(d.value),y=rt(p>=0?p:s,d.color);if(b){const r=g+i+u,l=g+k-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:y,...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+u;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:y,...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)))}}b?t.push(o("text",{key:`gcat-${n}`,x:String(g+i+A.barThickness/2),y:String(g+k+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},r.label)):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},[y,M,A,c,f,x,b,g,k]),B=s(()=>h?[o("text",{key:"title",x:String(n/2),y:String(g/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,n,g]),T=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]),W=F(),E=L(),P=B(),H=T();let j;return j=$&&m?N():$?D():R(),o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",style:{fontFamily:"sans-serif"}},...H,...P,...W,...E,...j)},exports.BigNumber=function(e){const{value:t,label:n,prefix:r="",suffix:i="",trend:l,trendLabel:a,sparkline:c,width:f=280,height:p=160,valueColor:u="#111827",trendUpColor:h="#22c55e",trendDownColor:g="#ef4444",backgroundColor:x="#ffffff"}=e,y=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]),m=null!=l&&isFinite(l)&&!isNaN(l),b=null!=c&&c.length>1,S=null!=n&&n.length>0,k=m&&l>=0?h:g,v=S?.38*p:.45*p,w=Math.min(.15*f,48),$=.55*w,M=v+.4*w+8,C=S?M+22:v+.4*w+22,z=b?Math.min(.22*p,36):0,I=p-20-z,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,p,x]),L=s(()=>{const e=[],t=r+y+i;return e.push(o("text",{key:"value",x:String(f/2),y:String(v),"text-anchor":"middle","dominant-baseline":"central","font-size":String(w),"font-weight":"bold","font-family":"sans-serif",fill:u,"aria-label":`Value: ${t}`},r?o("tspan",{key:"prefix","font-size":String($),"font-weight":"normal"},r):null,y,i?o("tspan",{key:"suffix","font-size":String($),"font-weight":"normal"},i):null)),e},[f,v,w,$,y,r,i,u]),R=s(()=>S?[o("text",{key:"label",x:String(f/2),y:String(M),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#6b7280"},n)]:[],[S,f,M,n]),D=s(()=>{if(!m)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=C;if(t){const t=`${i},${s} ${i-4},${s+8} ${i+4},${s+8}`;e.push(o("polygon",{key:"trend-arrow",points:t,fill:k}))}else{const t=`${i},${s+8} ${i-4},${s} ${i+4},${s}`;e.push(o("polygon",{key:"trend-arrow",points:t,fill:k}))}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:k,"aria-label":`Trend: ${r}`},r)),e},[m,l,a,k,f,C]),N=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+z-(n[e]-r)/l*z;s+=0===e?`M ${t} ${o}`:` L ${t} ${o}`}const d=s+` L ${20+(n.length-1)*a} ${I+z} L 20 ${I+z} 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,z,20]),B=F(),T=L(),W=R(),E=D(),P=N();return o("svg",{width:"100%",viewBox:`0 0 ${f} ${p}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":`${r}${y}${i}${S?`, ${n}`:""}`,style:{fontFamily:"sans-serif"}},...B,...P,...T,...W,...E)},exports.BlochSphere=function(e){const{state:t,gates:n,width:r=400,height:i=400,rotateY:d=-25,rotateX:f=15,zoom:p=1,interactive:u=!0,zoomable:h=!0,showVector:g=!0,showLabels:x=!0,showWireframe:y=!0,showTrail:m=!0,trailMaxPoints:b=200,trailColor:S="#ef4444",wireframeColor:k="#cbd5e1",vectorColor:v="#3b82f6",backgroundColor:w,sphereRadius:$=130,title:M,onStateChange:C}=e,[z,I]=l(t??{theta:0,phi:0}),[A,F]=l(d),[L,R]=l(f),[D,N]=l(p),B=c([]),T=c(!1),W=c(null),E=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=zn(e,n[P.current]);return P.current++,C&&C(t),t}),e=requestAnimationFrame(t))};return e=requestAnimationFrame(t),()=>cancelAnimationFrame(e)},[n]),a(()=>{const e=$n(z);B.current.push(e),B.current.length>b&&B.current.splice(0,B.current.length-b)},[z.theta,z.phi]);const H=$*D,j=r/2,Y=i/2,_=s((e,t,n)=>function(e,t,n,o,r,i,l,a){const s=Math.cos(o*wn),d=Math.sin(o*wn),c=Math.cos(r*wn),f=Math.sin(r*wn),p=-e*f+n*c;return{sx:i+(e*c+n*f)*a,sy:l-(t*s-p*d)*a,depth:t*d+p*s}}(e,t,n,L,A,j,Y,H),[L,A,j,Y,H]),q=s(e=>{if(!u)return;const t=e;T.current=!0,W.current={mx:t.clientX,my:t.clientY,rx:L,ry:A}},[u,L,A]),O=s(e=>{if(!T.current||!W.current)return;const t=e,n=W.current;F(n.ry+.5*(t.clientX-n.mx)),R(n.rx-.5*(t.clientY-n.my))},[]),G=s(()=>{T.current=!1},[]),U=s(e=>{if(!h)return;const t=e;t.preventDefault(),N(e=>Math.max(.5,Math.min(3,e*(t.deltaY>0?.95:1.05))))},[h]),V=[];if(w&&V.push(o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:w,rx:"6"})),M&&V.push(o("text",{key:"title",x:String(j),y:"24","text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},M)),y){const e=60,t=[];for(let n=0;n<=e;n++){const o=n/e*2*Math.PI,r=_(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:k,"stroke-width":"0.8",opacity:"0.5"}));const n=[];for(let t=0;t<=e;t++){const o=t/e*2*Math.PI,r=_(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:k,"stroke-width":"0.8",opacity:"0.4"}));const r=[];for(let t=0;t<=e;t++){const n=t/e*2*Math.PI,o=_(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:k,"stroke-width":"0.8",opacity:"0.4"}))}const X=[{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 X){const t=_(1.15*e.dir[0],1.15*e.dir[1],1.15*e.dir[2]),n=_(1.15*-e.dir[0],1.15*-e.dir[1],1.15*-e.dir[2]);_(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=_(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(m&&B.current.length>1){const e=B.current,t=[];for(let n=0;n<e.length;n++){const o=e[n],r=_(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:S,"stroke-width":"1.5",opacity:"0.5","stroke-linecap":"round","stroke-linejoin":"round"}))}if(g){const e=$n(z),t=_(0,0,0),n=_(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:v,"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:v,stroke:"#fff","stroke-width":"1.5"}));const l=(180*z.theta/Math.PI).toFixed(0),a=(180*z.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:E,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:u?T.current?"grabbing":"grab":"default"},onMouseDown:u?q:void 0,onMouseMove:u?O:void 0,onMouseUp:u?G:void 0,onMouseLeave:u?G:void 0,onWheel:h?U:void 0},...V)},exports.BoxPlot=function(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:p=!0,title:u,padding:h=60}=e,g="vertical"===i,x=n-2*h,y=r-2*h,m=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],b=d(()=>{const e=[];for(const n of t)e.push(An(n.values));return e},[t]),S=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]),k=g?y:x,v=(g?x:y)/(t.length>0?t.length:1),w=v*Math.min(Math.max(f,.1),.95),$=s(e=>{const t=S.max-S.min;return 0===t?k/2:(e-S.min)/t*k},[S,k]),M=s(()=>{if(!p)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}(S.max-S.min);for(let n=Math.ceil(S.min/t)*t;n<=S.max;n+=t){const t=$(n),r=String(Math.round(1e3*n)/1e3);if(g){const i=h+y-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+y),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),e.push(o("text",{key:`glabel-${n}`,x:String(i),y:String(h+y+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},r))}}return e},[p,S,$,g,h,x,y]),C=s(()=>{const e=[];return e.push(o("line",{key:"axis-value",x1:String(h),y1:String(g?h:h+y),x2:String(h),y2:String(h+y),stroke:"#374151","stroke-width":"1.5"})),e.push(o("line",{key:"axis-category",x1:String(h),y1:String(h+y),x2:String(h+x),y2:String(h+y),stroke:"#374151","stroke-width":"1.5"})),e},[h,x,y,g]),z=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??m[n%m.length],d=v*n+v/2,f=w/2;if(g){const t=h+y-$(r.q1),p=h+y-$(r.q3),u=h+y-$(r.median),g=h+y-$(r.whiskerLow),x=h+y-$(r.whiskerHigh),m=h+d;e.push(o("line",{key:`wl-${n}`,x1:String(m),y1:String(t),x2:String(m),y2:String(g),stroke:c,"stroke-width":"1.5"})),e.push(o("line",{key:`wlc-${n}`,x1:String(m-.4*f),y1:String(g),x2:String(m+.4*f),y2:String(g),stroke:c,"stroke-width":"1.5"})),e.push(o("line",{key:`wh-${n}`,x1:String(m),y1:String(p),x2:String(m),y2:String(x),stroke:c,"stroke-width":"1.5"})),e.push(o("line",{key:`whc-${n}`,x1:String(m-.4*f),y1:String(x),x2:String(m+.4*f),y2:String(x),stroke:c,"stroke-width":"1.5"}));const b=Math.min(t,p),S=Math.abs(t-p);if(e.push(o("rect",{key:`box-${n}`,x:String(m-f),y:String(b),width:String(w),height:String(Math.max(S,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(m-f),y1:String(u),x2:String(m+f),y2:String(u),stroke:"#fff","stroke-width":"2.5"})),a){const t=h+y-$(r.mean);e.push(o("circle",{key:`mean-${n}`,cx:String(m),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+y-$(r.outliers[t]);e.push(o("circle",{key:`out-${n}-${t}`,cx:String(m),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(m),y:String(h+y+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},i.label))}else{const t=h+$(r.q1),p=h+$(r.q3),u=h+$(r.median),g=h+$(r.whiskerLow),x=h+$(r.whiskerHigh),y=h+d;e.push(o("line",{key:`wl-${n}`,x1:String(t),y1:String(y),x2:String(g),y2:String(y),stroke:c,"stroke-width":"1.5"})),e.push(o("line",{key:`wlc-${n}`,x1:String(g),y1:String(y-.4*f),x2:String(g),y2:String(y+.4*f),stroke:c,"stroke-width":"1.5"})),e.push(o("line",{key:`wh-${n}`,x1:String(p),y1:String(y),x2:String(x),y2:String(y),stroke:c,"stroke-width":"1.5"})),e.push(o("line",{key:`whc-${n}`,x1:String(x),y1:String(y-.4*f),x2:String(x),y2:String(y+.4*f),stroke:c,"stroke-width":"1.5"}));const m=Math.min(t,p),b=Math.abs(p-t);if(e.push(o("rect",{key:`box-${n}`,x:String(m),y:String(y-f),width:String(Math.max(b,1)),height:String(w),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(u),y1:String(y-f),x2:String(u),y2:String(y+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(y),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(y),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(y+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},i.label))}}return e},[t,b,$,g,h,x,y,v,w,c,l,a,m]),I=s(()=>u?[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"},u)]:[],[u,n,h]),A=M(),F=C(),L=z(),R=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":u??"Box plot",style:{fontFamily:"sans-serif"}},...R,...A,...F,...L)},exports.Breadcrumb=function(e){const{items:t,separator:n="/",maxItems:r,size:i="md"}=e,[a,d]=l(!1),c=ze[i],f=s(()=>{d(!0)},[]);let p=t,u=!1;if(r&&r>1&&t.length>r&&!a){u=!0;const e=1,n=r-1;p=[...t.slice(0,e),{label:"..."},...t.slice(t.length-n)]}const h=p.map((e,t)=>((e,t,r)=>{const i=t===r.length-1,l=u&&"..."===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,p));return o(ve,{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))},exports.BubbleChart=function(e){const{data:t=[],width:n=600,height:r=400,xLabel:i,yLabel:l,showGrid:a=!0,showAxes:c=!0,showLabels:f=!1,maxBubbleRadius:p=40,minBubbleRadius:u=4,defaultColor:h="#3b82f6",opacity:g=.7,title:x,padding:y=60}=e,m=d(()=>{const e=[];for(let n=0;n<t.length;n++){const o=t[n];Rn(o.x)&&Rn(o.y)&&Rn(o.r)&&e.push(o)}return e},[t]),b=n-2*y,S=r-2*y,k=d(()=>{if(0===m.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 m)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}},[m]),v=s(e=>{const t=k.xMax-k.xMin;return y+(e-k.xMin)/t*b},[k,y,b]),w=s(e=>{const t=k.yMax-k.yMin;return y+S-(e-k.yMin)/t*S},[k,y,S]),$=s(e=>{const t=k.rMax-k.rMin;if(0===t)return(u+p)/2;const n=(e-k.rMin)/t;return u+n*(p-u)},[k,u,p]),M=s(()=>{if(!a)return[];const e=[],t=Fn(k.xMax-k.xMin);for(let n=Math.ceil(k.xMin/t)*t;n<=k.xMax;n+=t){const t=v(n);e.push(o("line",{key:`grid-x-${n}`,x1:String(t),y1:String(y),x2:String(t),y2:String(y+S),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),e.push(o("text",{key:`grid-xlabel-${n}`,x:String(t),y:String(y+S+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(1e3*n)/1e3)))}const n=Fn(k.yMax-k.yMin);for(let t=Math.ceil(k.yMin/n)*n;t<=k.yMax;t+=n){const n=w(t);e.push(o("line",{key:`grid-y-${t}`,x1:String(y),y1:String(n),x2:String(y+b),y2:String(n),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),e.push(o("text",{key:`grid-ylabel-${t}`,x:String(y-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,k,v,w,y,b,S]),C=s(()=>{if(!c)return[];const e=[];return e.push(o("line",{key:"axis-y",x1:String(y),y1:String(y),x2:String(y),y2:String(y+S),stroke:"#374151","stroke-width":"1.5"})),e.push(o("line",{key:"axis-x",x1:String(y),y1:String(y+S),x2:String(y+b),y2:String(y+S),stroke:"#374151","stroke-width":"1.5"})),i&&e.push(o("text",{key:"x-label",x:String(y+b/2),y:String(y+S+40),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151"},i)),l&&e.push(o("text",{key:"y-label",x:String(y-40),y:String(y+S/2),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90, ${y-40}, ${y+S/2})`},l)),e},[c,y,b,S,i,l]),z=s(()=>{const e=[];for(let t=0;t<m.length;t++){const n=m[t],r=v(n.x),i=w(n.y),l=Ln($(n.r),u,p),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},[m,v,w,$,h,g,f,u,p]),I=s(()=>x?[o("text",{key:"title",x:String(n/2),y:String(y/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},x)]:[],[x,n,y]),A=M(),F=C(),L=z(),R=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"}},...R,...A,...F,...L)},exports.Button=function(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:p,active:u=!1}=e,h=d(()=>{const e=yn[i]??yn.md,t=mn[r]??mn.secondary,n={padding:e.padding,fontSize:e.fontSize,borderRadius:e.borderRadius,border:`1px solid ${t.border}`,backgroundColor:u?"#3b82f6":t.bg,color:u?"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,u,f]);return o("button",{type:s,onClick:l?void 0:n,disabled:l,className:c,style:h,"aria-label":p,"aria-pressed":u?"true":void 0},t)},exports.CalendarHeatMap=function(e){const{data:t=[],width:n=800,height:r=160,colorScale:i=Pn,cellSize:l=12,cellGap:a=2,showMonthLabels:c=!0,showDayLabels:f=!0,emptyColor:p="#ebedf0",title:u}=e,{dateMap:h,startDate:g,endDate:x,maxVal:y}=d(()=>{const e=new Map;let n=0,o=null,r=null;for(const i of t){const t=Bn(i.date);if(isNaN(t.getTime()))continue;const l=Tn(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]),m=f?30:0,b=c?16:0,S=u?28:0,k=m+10,v=S+b+4,w=s(()=>{const e=[],t=new Date(g);let n=0;for(;t<=x;){const r=t.getDay();0===r&&t>g&&n++;const s=Tn(t),d=h.get(s),c=void 0!==d&&d>0?En(d/y,i):p,f=k+n*(l+a),u=v+r*(l+a);e.push(o("rect",{key:`day-${s}`,x:String(f),y:String(u),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,y,i,p,l,a,k,v]),$=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=k+n*(l+a);e.push(o("text",{key:`month-${n}`,x:String(t),y:String(S+b-2),"font-size":"10","font-family":"sans-serif",fill:"#6b7280"},Dn[s]))}t.setDate(t.getDate()+1)}return e},[c,g,x,l,a,k,S,b]),M=s(()=>{if(!f)return[];const e=[],t=[1,3,5];for(const n of t){const t=v+n*(l+a)+l/2;e.push(o("text",{key:`day-label-${n}`,x:String(m),y:String(t),"text-anchor":"end","dominant-baseline":"central","font-size":"10","font-family":"sans-serif",fill:"#6b7280"},Nn[n]))}return e},[f,l,a,v,m]),C=s(()=>u?[o("text",{key:"title",x:String(n/2),y:"18","text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},u)]:[],[u,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":u??"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:"#6b7280"},"No data to display."));const z=C(),I=$(),A=M(),F=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":u??"Calendar heat map",style:{fontFamily:"sans-serif"}},...z,...I,...A,...F)},exports.Card=function(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=ye[n]??ye.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)},exports.Carousel=function(e){const t=e.items??[],n=t.length,r=!1!==e.loop,i=!1!==e.showDots,p=!1!==e.showArrows,u=e.animation??"slide",h=e.interval??5e3,g=f(),[x,y]=l(0),m=c(null),b=c(null),S=s(t=>{let o=t;o=r?(t%n+n)%n:Math.max(0,Math.min(t,n-1)),y(o),e.onChange&&e.onChange(o)},[n,r,e.onChange]),k=s(()=>S(x+1),[x,S]),v=s(()=>S(x-1),[x,S]);a(()=>{if(!e.autoPlay||n<=1)return;const t=setInterval(k,h);return()=>clearInterval(t)},[e.autoPlay,h,k,n]),a(()=>{const e=e=>{"ArrowLeft"===e.key?v():"ArrowRight"===e.key&&k()},t=b.current;if(t)return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)},[k,v]);const w="fade"===u?`@keyframes liq-fade-in-${g}{from{opacity:0}to{opacity:1}}`:"",$=d(()=>"fade"===u?{position:"relative",width:"100%"}:{display:"flex",transition:"transform 0.4s ease",transform:`translateX(-${100*x}%)`,width:"100%"},[x,u]),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)"},C=t.map((e,t)=>{const n="fade"===u?{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)}),z=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:()=>S(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=>{m.current=e.clientX},onpointerup:e=>{if(null==m.current)return;const t=e.clientX-m.current;t>50?v():t<-50&&k(),m.current=null}},w?o("style",null,w):null,o("div",{style:$},...C),p&&n>1?o("button",{"aria-label":"Previous slide",onclick:v,style:{...M,left:"8px"}},"‹"):null,p&&n>1?o("button",{"aria-label":"Next slide",onclick:k,style:{...M,right:"8px"}},"›"):null,z)},exports.CartesianGraph2D=function(e){const{width:t=400,height:n=300,points:r=[],plotFunction:i,plotResolution:f=200,xStep:p,sync:u=!1,xRange:h=[-5,5],yRange:g=[-5,5],showGrid:x=!0,showAxes:y=!0,pointRadius:m=3,pointColor:b="#3b82f6",curveColor:S="#3b82f6",gridColor:k="#e2e8f0",axisColor:v="#94a3b8",onPointClick:w,onPointDoubleClick:$,onPointContextMenu:M,onPointHover:C}=e,[z,I]=l(h[0]),[A,F]=l(h[1]),[L,R]=l(g[0]),[D,N]=l(g[1]),B=c(!1),T=c(null),W=s(e=>ft+(e-z)/(A-z)*(t-80),[z,A,t]),E=s(e=>n-ft-(e-L)/(D-L)*(n-80),[L,D,n]),P=s(e=>z+(e-ft)/(t-80)*(A-z),[z,A,t]),H=s(e=>L+(n-ft-e)/(n-80)*(D-L),[L,D,n]),j=s(e=>{const t=e;B.current=!0,T.current={mx:t.clientX,my:t.clientY,x0:z,x1:A,y0:L,y1:D}},[z,A,L,D]),Y=s(e=>{if(!B.current||!T.current)return;const o=e,r=T.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),R(r.y0+s),N(r.y1+s)},[t,n]),_=s(()=>{B.current=!1,T.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=H(r),a=t.deltaY>0?1.1:1/1.1,s=(A-z)*a,d=(D-L)*a;if(s<.01||d<.01||s>pt||d>pt)return;const c=(i-z)/(A-z),f=(l-L)/(D-L);I(i-c*s),F(i+(1-c)*s),R(l-f*d),N(l+(1-f)*d)},[z,A,L,D,P,H]),O=[];if(O.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),x){const e=dt(z,A),r=dt(L,D);for(let t=0;t<e.length;t++){const r=W(e[t]);O.push(o("line",{x1:r,y1:ft,x2:r,y2:n-ft,stroke:k,"stroke-width":.5,key:`gx-${t}`})),O.push(o("text",{x:r,y:n-ft+14,"text-anchor":"middle","font-size":10,fill:v,key:`lx-${t}`},ct(e[t])))}for(let e=0;e<r.length;e++){const n=E(r[e]);O.push(o("line",{x1:ft,y1:n,x2:t-ft,y2:n,stroke:k,"stroke-width":.5,key:`gy-${e}`})),O.push(o("text",{x:34,y:n+3,"text-anchor":"end","font-size":10,fill:v,key:`ly-${e}`},ct(r[e])))}}if(y){const e=Math.max(ft,Math.min(t-ft,W(0))),r=Math.max(ft,Math.min(n-ft,E(0)));O.push(o("line",{x1:ft,y1:r,x2:t-ft,y2:r,stroke:v,"stroke-width":1,key:"x-axis"})),O.push(o("line",{x1:e,y1:ft,x2:e,y2:n-ft,stroke:v,"stroke-width":1,key:"y-axis"}))}const G=d(()=>{if(!i||!u)return[];const e=it({start:z,end:A,step:p??(A-z)/f});return lt(i,e)},[i,z,A,p,f,u]),[U,V]=l([]),X=c(null);a(()=>{if(!i||u)return void V([]);const e=it({start:z,end:A,step:p??(A-z)/f});return X.current&&X.current(),X.current=at(i,e,200,e=>{V([...e])}),()=>{X.current&&X.current()}},[i,z,A,p,f,u]);const K=u?G:U;if(K.length>0){const e=[];for(let t=0;t<K.length;t++){const n=K[t],o=W(n.input),r=E(n.output);e.push(`${0===e.length?"M":"L"}${o},${r}`)}O.push(o("path",{d:e.join(" "),fill:"none",stroke:S,"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:W(t.x),cy:E(t.y),r:m,fill:b,cursor:"pointer",key:`pt-${e}`};w&&(n.onClick=Z(0,w,e,t)),$&&(n.onDblClick=Z(0,$,e,t)),M&&(n.onContextMenu=Z(0,M,e,t)),C&&(n.onMouseOver=Z(0,C,e,t)),O.push(o("circle",n))}const J=o("defs",{key:"defs"},o("clipPath",{id:"plot-clip"},o("rect",{x:ft,y:ft,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:j,onMouseMove:Y,onMouseUp:_,onMouseLeave:_,onWheel:q},J,...O)},exports.Checkbox=function(e){const{checked:t,onChange:n,label:r,indeterminate:i=!1,disabled:l=!1,error:d,size:f="md"}=e,p=c(null);a(()=>{p.current&&(p.current.indeterminate=i)},[i]);const u=s(()=>{l||n(!t)},[l,t,n]),h=s(e=>{l||" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),n(!t))},[l,t,n]),g=oe[f],x=`${g.box}px`,y={width:x,height:x,minWidth:x,borderRadius:"4px",border:"2px solid "+(d?"#ef4444":t||i?"#3b82f6":"#d1d5db"),backgroundColor:t||i?"#3b82f6":"#ffffff",display:"flex",alignItems:"center",justifyContent:"center",cursor:l?"not-allowed":"pointer",transition:"all 0.15s",boxSizing:"border-box"},m={color:"#ffffff",fontSize:`${g.icon}px`,lineHeight:"1",fontWeight:"700"},b=i?o("span",{style:m},"—"):t?o("span",{style:m},"✓"):null,S={display:"inline-flex",alignItems:"center",gap:"8px",cursor:l?"not-allowed":"pointer",opacity:l?"0.6":"1",userSelect:"none"},k=o("input",{ref:p,type:"checkbox",checked:t,disabled:l,onChange:()=>n(!t),style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},"aria-hidden":"true",tabIndex:-1}),v=o("div",{style:y},b),w=r?o("span",{style:{fontSize:g.fontSize,color:"#374151"}},r):null;return o(te,{error:d},o("div",{style:S,onClick:u,onKeyDown:h,tabIndex:l?-1:0,role:"checkbox","aria-checked":i?"mixed":t?"true":"false","aria-disabled":l?"true":void 0,"aria-label":r},k,v,w))},exports.ChordDiagram=function(e){const{matrix:t,labels:n,width:r=600,height:i=600,colors:l=Hn,padAngle:a=.05,showLabels:c=!0,showValues:f=!1,ribbonOpacity:p=.5,innerRadiusRatio:u=.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,y=Math.min(r,i)/2-40,m=y*Math.max(.5,Math.min(.99,u)),b=y+16,S=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,p=i[t]>0?o/l*a:0,u=c[t],h=u+p;c[t]=h;const g=i[n]>0?o/l*a:0,x=c[n],y=x+g;if(c[n]=y,t===n){o>0&&f.push({sourceIndex:t,targetIndex:n,sourceStartAngle:u,sourceEndAngle:h,targetStartAngle:x,targetEndAngle:y,value:o,color:s[t].color});continue}const m=i[n]>0?r/l*a:0,b=c[n]+m;c[n]=b;const S=i[t]>0?r/l*a:0,k=c[t]+S;c[t]=k,(o>0||r>0)&&f.push({sourceIndex:t,targetIndex:n,sourceStartAngle:u,sourceEndAngle:Math.max(h,u+.001),targetStartAngle:x,targetEndAngle:Math.max(y,x+.001),value:d,color:s[t].color})}return{groups:s,chords:f}}(t,n,l,a),[t,n,l,a]),k=s(()=>{const e=[];for(let t=0;t<S.groups.length;t++){const n=S.groups[t];if(n.endAngle-n.startAngle<.001)continue;const r=Yn(g,x,y,m,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=jn(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},[S,g,x,y,m,b,c,f]),v=s(()=>{const e=[];for(let t=0;t<S.chords.length;t++){const n=S.chords[t],r=_n(g,x,m,n.sourceStartAngle,n.sourceEndAngle,n.targetStartAngle,n.targetEndAngle);e.push(o("path",{key:`ribbon-${t}`,d:r,fill:n.color,"fill-opacity":String(p),stroke:n.color,"stroke-width":"0.5","stroke-opacity":"0.3"}))}return e},[S,g,x,m,p]),w=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]),$=v(),M=k(),C=w();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"}},...C,...$,...M)},exports.ColorPicker=function(e){const t=e.id??`cp-${Math.random().toString(36).slice(2,8)}`,{value:n,onChange:r,presets:i=re,showInput:d=!0,showAlpha:f=!1,disabled:p=!1,label:u}=e,[h,g]=l(!1),[x,y]=l(n),m=c(null);a(()=>{y(n)},[n]),a(()=>{const e=e=>{m.current&&!m.current.contains(e.target)&&g(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const b=s(e=>{p||r(le(e))},[p,r]),S=s(e=>{const t=e.target.value;y(t);const n=t.startsWith("#")?t:`#${t}`;ie(n)&&r(le(n))},[r]),k=s(()=>{ie(x.startsWith("#")?x:`#${x}`)||y(n)},[x,n]),v={width:"36px",height:"36px",borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:n,cursor:p?"not-allowed":"pointer",flexShrink:"0"},w={display:"grid",gridTemplateColumns:"repeat(10, 1fr)",gap:"4px",marginBottom:d?"8px":"0"},$=i.map(e=>{const t=le(e)===le(n);return o("div",{key:e,style:{width:"20px",height:"20px",borderRadius:"3px",backgroundColor:e,cursor:p?"not-allowed":"pointer",border:t?"2px solid #1f2937":"1px solid #e5e7eb",boxSizing:"border-box"},onClick:()=>b(e),onKeyDown:t=>{const n=t.key;"Enter"!==n&&" "!==n||(t.preventDefault(),b(e))},role:"button",tabIndex:p?-1:0,title:e,"aria-label":`Select color ${e}`})}),M=d?o("div",{style:{display:"flex",alignItems:"center",gap:"4px"}},o("div",{style:{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:n,border:"1px solid #d1d5db",flexShrink:"0"}}),o("input",{type:"text",value:x,onInput:S,onBlur:k,disabled:p,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,C=h?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:w},...$),M):null;return o(te,{label:u,disabled:p,htmlFor:t},o("div",{ref:m,style:{position:"relative"}},o("div",{style:{display:"flex",alignItems:"center",gap:"8px"},onClick:p?void 0:()=>g(!h),onKeyDown:p?void 0:e=>{const t=e.key;"Enter"!==t&&" "!==t||(e.preventDefault(),g(!h))},role:"button",tabIndex:p?-1:0,"aria-expanded":h?"true":"false","aria-label":"Toggle color picker"},o("div",{id:t,style:v}),d?o("span",{style:{fontSize:"14px",fontFamily:"monospace",color:"#1f2937"}},n):null),C))},exports.ColorWheel=function(e){const t=e.id??`cw-${Math.random().toString(36).slice(2,8)}`,{value:n="#000000",onChange:r,size:i=32,showLabel:a=!0,disabled:d=!1,label:f}=e,[p,u]=l(n);return o(te,{label:f,htmlFor:t},o("div",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"4px"}},o("div",{style:{width:`${i}px`,height:`${i}px`,borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:p,cursor:d?"not-allowed":"pointer",position:"relative",overflow:"hidden"}},o("input",{id:t,ref:c(null),type:"color",value:p,onInput:s((...e)=>{const t=e[0].target.value;u(t),r?.(t)},[r]),disabled:d,style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",opacity:"0",cursor:d?"not-allowed":"pointer",border:"none",padding:"0"},"aria-label":f||"Color"})),a?o("span",{style:{fontSize:"11px",fontFamily:"monospace",color:"#64748b"}},p):null))},exports.ComplexGraph2D=function(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:p=ut,data:u,resolution:h=2,onPointClick:g,onPointHover:x,onPointDoubleClick:y,onPointContextMenu:m}=e;if(u){const e=u.length,r=e>0?u[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=u[t];for(let n=0;n<r;n++){const r=e[n]??0,[s,c,p]=ht(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},${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":"Complex plane visualization",style:{cursor:"crosshair",borderRadius:"6px",maxWidth:"100%"}},...a)}const[b,S]=l(r[0]),[k,v]=l(r[1]),[w,$]=l(i[0]),[M,C]=l(i[1]),z=c(null),I=c(!1),A=c(null),F=s((e,o)=>({re:b+e/t*(k-b),im:M-o/n*(M-w)}),[b,k,w,M,t,n]);a(()=>{const e=z.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=p(o,r,d),[a,s,c]=ht(l,d,f),u=4*(e*t+n);i[u]=a,i[u+1]=s,i[u+2]=c,i[u+3]=255}o.putImageData(r,0,0)},[b,k,w,M,t,n,d,f,p,F]);const L=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:p(r,i,d),event:e}},[F,p,d]),R=s(e=>{I.current=!0,A.current={x:e.clientX,y:e.clientY,rMin:b,rMax:k,iMin:w,iMax:M}},[b,k,w,M]),D=s(e=>{if(x&&x(L(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;S(o.rMin-r*l),v(o.rMax-r*l),$(o.iMin+i*a),C(o.iMax+i*a)},[t,n,x,L]),N=s(()=>{I.current=!1},[]),B=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);S(i+(b-i)*t),v(i+(k-i)*t),$(l+(w-l)*t),C(l+(M-l)*t)},[F,b,k,w,M]),T=s(e=>{g&&g(L(e))},[g,L]),W=s(e=>{y&&y(L(e))},[y,L]),E=s(e=>{e.preventDefault(),m&&m(L(e))},[m,L]);return o("canvas",{ref:z,width:t,height:n,style:{cursor:"crosshair"},onMouseDown:R,onMouseMove:D,onMouseUp:N,onMouseLeave:N,onWheel:B,onClick:T,onDblClick:W,onContextMenu:E})},exports.ContextMenu=function(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(qe,{items:t,position:r,onClose:c,depth:0})),o("div",null,...f)},exports.DataGrid=function(e){const{columns:t,data:n,pageSize:r,currentPage:i,onPageChange:a,sortBy:c,sortDir:f,onSort:p,selectable:u=!1,selectedRows:h,onSelectionChange:g,striped:x=!1,bordered:y=!1,compact:m=!1,stickyHeader:b=!1}=e,[S,k]=l(0),[v,w]=l(void 0),[B,T]=l("asc"),[W,E]=l([]),[P,H]=l({}),j=i??S,Y=c??v,_=f??B,q=h??W,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]),G=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"===_?n-o:o-n;const r=String(n),i=String(o),l=r.localeCompare(i);return"asc"===_?l:-l}),e},[O,Y,_]),U=G.length,V=r?Math.max(1,Math.ceil(U/r)):1,X=r?G.slice(j*r,(j+1)*r):G,K=s(e=>{a?a(e):k(e)},[a]),Z=s(e=>{const t=Y===e&&"asc"===_?"desc":"asc";p?p(e,t):(w(e),T(t))},[Y,_,p]),J=s(e=>{const t=q.includes(e)?q.filter(t=>t!==e):[...q,e];g?g(t):E(t)},[q,g]),Q=s(()=>{const e=X.map((e,t)=>r?j*r+t:t),t=e.every(e=>q.includes(e))?q.filter(t=>!e.includes(t)):[...new Set([...q,...e])];g?g(t):E(t)},[X,q,r,j,g]),ee=s((e,t)=>{H(n=>({...n,[e]:t})),K(0)},[K]),te=t.some(e=>e.filterable),ne=m?"6px 8px":C.padding,oe=[];if(u){const e=X.map((e,t)=>r?j*r+t:t),t=e.length>0&&e.every(e=>q.includes(e));oe.push(o("th",{key:"__select_all",style:{...M,padding:ne,width:"40px",textAlign:"center",...b?{position:"sticky",top:"0",zIndex:"2"}:{}}},o("input",{type:"checkbox",checked:t,onChange:Q,style:D,"aria-label":"Select all rows"})))}for(const e of t){const t={...M,padding:ne,...e.width?{width:e.width}:{},...e.sortable?{cursor:"pointer"}:{},...y?{border:"1px solid #e5e7eb"}:{},...b?{position:"sticky",top:"0",zIndex:"2"}:{}},n=[e.header];e.sortable&&n.push(o("span",{style:z},N(e.key,Y,_))),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"===_?"ascending":"descending":void 0},...n))}let re=null;if(te){const e=[];u&&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:I,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<X.length;e++){const n=X[e],i=r?j*r+e:e,l=q.includes(i),a={};x&&e%2==1&&(a.backgroundColor="#f9fafb"),l&&(a.backgroundColor="#eff6ff");const s=[];u&&s.push(o("td",{key:"__select",style:{padding:ne,textAlign:"center",...C,...y?{border:"1px solid #e5e7eb"}:{}}},o("input",{type:"checkbox",checked:l,onChange:()=>J(i),style:D,"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:{...C,padding:ne,...y?{border:"1px solid #e5e7eb"}:{}}},r))}ie.push(o("tr",{key:String(i),style:a},...s))}let le=null;if(r){const e=0===U?0:j*r+1,t=Math.min((j+1)*r,U),n=[];n.push(o("button",{key:"prev",style:0===j?R:F,onClick:j>0?()=>K(j-1):void 0,disabled:0===j,"aria-label":"Previous page"},"← Prev"));const i=7;let l=Math.max(0,j-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:F,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===j?L:F,onClick:e!==j?()=>K(e):void 0,"aria-current":e===j?"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:F,onClick:()=>K(V-1)},String(V)))),n.push(o("button",{key:"next",style:j>=V-1?R:F,onClick:j<V-1?()=>K(j+1):void 0,disabled:j>=V-1,"aria-label":"Next page"},"Next →")),le=o("div",{style:A},o("span",null,`Showing ${e}–${t} of ${U}`),o("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},...n))}const ae={width:"100%",...b?{overflow:"auto",maxHeight:"600px"}:{}},se={...$,...y?{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(U)},de,ce);return o("div",{style:ae},fe,le)},exports.DatePicker=function(e){const t=e.id??`dp-${Math.random().toString(36).slice(2,8)}`,{value:n,onChange:r,format:i="YYYY-MM-DD",minDate:f,maxDate:p,disabled:u=!1,placeholder:h="Select date...",label:g,error:x}=e,y=d(()=>de(n),[n]),m=d(()=>de(f),[f]),b=d(()=>de(p),[p]),[S,k]=l(!1),[v,w]=l(()=>y?y.getFullYear():(new Date).getFullYear()),[$,M]=l(()=>y?y.getMonth():(new Date).getMonth()),C=c(null),z=d(()=>new Date,[]);a(()=>{const e=e=>{C.current&&!C.current.contains(e.target)&&k(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const I=s(()=>{M(e=>0===e?(w(e=>e-1),11):e-1)},[]),A=s(()=>{M(e=>11===e?(w(e=>e+1),0):e+1)},[]),F=s(e=>{const t=new Date(v,$,e);m&&t<m||b&&t>b||(r(function(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}(t)),k(!1))},[v,$,r,m,b]),L=y?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"))}(y,i):"",R=d(()=>{const e=new Date(v,$,1).getDay(),t=new Date(v,$+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},[v,$]),D={...ne({},{focused:S,error:!!x}),cursor:u?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",minHeight:"38px",userSelect:"none"},N={background:"none",border:"none",cursor:"pointer",fontSize:"16px",padding:"4px 8px",color:"#374151",borderRadius:"4px"},B=se.map(e=>o("div",{key:e,style:{padding:"4px"}},e)),T=R.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(v,$,e),i=ce(r,z),l=!!y&&ce(r,y),a=m&&r<m||b&&r>b;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:()=>F(e),onKeyDown:a?void 0:t=>{const n=t.key;"Enter"!==n&&" "!==n||(t.preventDefault(),F(e))},role:a?void 0:"button",tabIndex:a?void 0:0,"aria-label":`${ae[$]} ${e}, ${v}`,"aria-disabled":a?"true":void 0},String(e))});return o("div",{key:`row-${t}`,style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)"}},...n)}),W=S?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:N,onClick:I},"◀"),o("span",{style:{fontWeight:"600",fontSize:"14px",color:"#1f2937"}},`${ae[$]} ${v}`),o("button",{type:"button",style:N,onClick:A},"▶")),o("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",textAlign:"center",fontSize:"11px",fontWeight:"600",color:"#6b7280",marginBottom:"4px"}},...B),...T):null;return o(te,{label:g,error:x,disabled:u,htmlFor:t},o("div",{ref:C,style:{position:"relative"}},o("div",{id:t,style:D,onClick:u?void 0:()=>k(!S),onKeyDown:u?void 0:e=>{const t=e.key;"Enter"!==t&&" "!==t||(e.preventDefault(),k(!S))},tabIndex:u?-1:0,role:"button","aria-label":"Pick a date","aria-expanded":S?"true":"false"},o("span",{style:{color:L?"#1f2937":"#9ca3af"}},L||h),o("span",{style:{color:"#6b7280",fontSize:"14px"}},"📅")),W))},exports.DecompositionTree=function(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:p="#94a3b8",colors:u=qn,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,y=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,p=n-2*i,u="horizontal"===l,h=d+1,g=u?h>1?(f-o)/d:0:h>1?(p-r)/d:0,x=new Array(s.length),y=c[0],m=u?p:f,b=y>0?m/y:m,S=new Array(s.length);S[0]=[0,y];const k=[0];let v=0;for(;v<k.length;){const e=k[v];v++;const t=s[e],[n,o]=S[e],r=(n+o)/2,l=i+t.depth*g,d=i+(r-.5)*b,f=u?l:d,p=u?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:p,parentId:t.parentId,childCount:t.childIndices.length,subtreeLeafCount:c[e]};let y=n;for(const e of t.childIndices)if(e<s.length){const t=y+c[e];S[e]=[y,t],y=t,k.push(e)}}return x}(t,n,r,l,a,g,i,u),[t,n,r,l,a,g,i,u]),m=d(()=>{const e=new Map;for(let t=0;t<y.length;t++){const n=y[t];e.set(n.id,n)}return e},[y]),b=s(()=>{if(!f)return[];const e=[];for(let t=0;t<y.length;t++){const n=y[t];if(null===n.parentId)continue;const r=m.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,u=(s+c)/2;let h;h=x?`M ${i} ${s} C ${f} ${s}, ${f} ${c}, ${d} ${c}`:`M ${i} ${s} C ${i} ${u}, ${d} ${u}, ${d} ${c}`,e.push(o("path",{key:`conn-${t}`,d:h,fill:"none",stroke:p,"stroke-width":"1.5","stroke-opacity":"0.7"}))}return e},[y,m,x,l,a,f,p]),S=s(()=>{const e=[];for(let t=0;t<y.length;t++){const n=y[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},[y,l,a,c]),k=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]),v=b(),w=S(),$=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":h??"Decomposition tree",style:{fontFamily:"sans-serif"}},...$,...v,...w)},exports.DigitalClock=function(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:p,minutes:u,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=p>=12?"PM":"AM",g=p%12||12):g=p;let y=`${B(g)}:${B(u)}`;i&&(y+=`:${B(h)}`);const m=[y];null!=x&&m.push(o("span",{style:E},x));const b=[o("span",{style:W},...m)];return n&&b.push(o("span",{style:P},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:T,...d?{class:d}:{}},...b)},exports.DiscreteCartesian2D=function(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:p=!1,backgroundColor:u="#0f172a",padding:h=10,onCellClick:g,onCellHover:x,title:y}=e,m=n??Yo,b=t.length,S=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]),k=p?20:0,v=y?24:0,w=d(()=>{const e=r-2*h-k,t=i-2*h-k-v;return 0===b||0===S?{cellWidth:0,cellHeight:0}:{cellWidth:Math.max(0,(e-l*(S-1))/S),cellHeight:Math.max(0,(t-l*(b-1))/b)}},[r,i,h,b,S,l,k,v]),$=s(e=>{const t=m[e];return void 0!==t?t:"#666"},[m]),M=s(()=>o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:u}),[r,i,u]),C=s(()=>y?[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"},y)]:[],[y,r,h]),z=s(()=>{if(!c||0===b||0===S)return[];const{cellWidth:e,cellHeight:t}=w,n=h+k,r=h+k+v,i=S*e+(S-1)*l,a=b*t+(b-1)*l,s=[];for(let t=0;t<=S;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,S,w,h,k,v,l,f]),I=s(()=>{if(!p||0===b||0===S)return[];const{cellWidth:e,cellHeight:t}=w,n=h+k,r=h+k+v,i=[];for(let t=0;t<S;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},[p,b,S,w,h,k,v,l]),A=s(()=>{if(0===b||0===S)return[];const{cellWidth:e,cellHeight:n}=w,r=h+k,i=h+k+v,s=[];for(let d=0;d<b;d++){const c=t[d];if(void 0!==c)for(let t=0;t<S;t++){const f=t<c.length?c[t]:0,p=r+t*(e+l),u=i+d*(n+l),h=$(f),y={key:`cell-${d}-${t}`,x:String(p),y:String(u),width:String(e),height:String(n),fill:h,rx:String(a),ry:String(a)};if(g){const e=d,n=t,o=f;y.onClick=()=>g(e,n,o),y.role="button",y.tabIndex=0}if(x){const e=d,n=t,o=f;y.onMouseEnter=()=>x(e,n,o)}s.push(o("rect",y))}}return s},[b,S,t,w,h,k,v,l,a,$,g,x]),F=M(),L=C(),R=z(),D=I(),N=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":y?`${y} — ${b}x${S} discrete grid`:`${b}x${S} discrete grid`},F,...L,...R,...D,...N)},exports.Drawer=function(e){const{open:t,onClose:n,position:r="right",size:i="320px",title:s,overlay:d=!0,closeOnOverlay:f=!0,closeOnEscape:p=!0,children:u}=e,[h,g]=l(!1),[x,y]=l(!1),m=c(null),b=s?"drawer-title":void 0;if(a(()=>{if(!t){y(!1);const e=setTimeout(()=>g(!1),300);return()=>clearTimeout(e)}g(!0),requestAnimationFrame(()=>y(!0))},[t]),a(()=>{if(!t||!p)return;const e=e=>{"Escape"===e.key&&n()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t,p,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&&m.current&&m.current.focus()},[t]),!h)return null;const S={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"},k={...Ge(r,i),transform:Oe(r,x),transition:"transform 0.3s ease"},v=[];s&&v.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"},"×"))),v.push(o("div",{style:{padding:"20px",overflow:"auto",flex:"1"}},u));const w=[];return d&&w.push(o("div",{style:S,onClick:()=>{f&&n()}})),w.push(o("div",{ref:m,style:k,role:"dialog","aria-modal":"true","aria-labelledby":b,tabIndex:-1},...v)),o("div",null,...w)},exports.Dropdown=function(e){const{label:t,items:n,triggerStyle:r,menuStyle:i,itemStyle:d={},placement:f="bottom-start",closeOnSelect:p=!0,width:u="220px"}=e,[h,g]=l(!1),x=c(null),y=s(()=>{g(e=>!e)},[]),m=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:y,"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"},"▼")),S={position:"absolute",top:"100%",..."bottom-end"===f?{right:"0"}:{left:"0"},marginTop:"4px",zIndex:"999"},k={boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #e5e7eb",borderRadius:"6px",padding:"4px 0",width:"number"==typeof u?`${u}px`:u,backgroundColor:"#ffffff",...i??{}},v=h?o("div",{style:S},o(ve,{orientation:"vertical",role:"menu",ariaLabel:`${t} menu`,styling:k},...n.map(e=>o(Ie,{key:e.id,item:e,itemStyle:d,closeOnSelect:p,onClose:m})))):null;return o("div",{ref:x,style:{position:"relative",display:"inline-block"}},b,v)},exports.EmptyState=function(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)},exports.FileUpload=function(e){const t=e.id??`fu-${Math.random().toString(36).slice(2,8)}`,{onChange:n,accept:r,multiple:i=!1,maxSize:a,disabled:d=!1,label:f,helpText:p}=e,[u,h]=l([]),[g,x]=l(!1),[y,m]=l(""),b=c(null),S=s(e=>{m("");const t=[];for(const n of e)a&&n.size>a?m(`File "${n.name}" exceeds maximum size of ${fe(a)}`):t.push(n);const o=i?[...u,...t]:t.slice(0,1);h(o),n(o)},[u,i,a,n]),k=s(e=>{if(e.preventDefault(),e.stopPropagation(),x(!1),d)return;const t=e.dataTransfer;if(!t)return;const n=Array.from(t.files);S(n)},[d,S]),v=s(e=>{e.preventDefault(),e.stopPropagation(),d||x(!0)},[d]),w=s(e=>{e.preventDefault(),e.stopPropagation(),x(!1)},[]),$=s(e=>{const t=e.target;t.files&&(S(Array.from(t.files)),t.value="")},[S]),M=s(e=>{const t=u.filter((t,n)=>n!==e);h(t),n(t)},[u,n]),C=s(()=>{d||b.current&&b.current.click()},[d]),z={border:"2px dashed "+(g?"#3b82f6":y?"#ef4444":"#d1d5db"),borderRadius:"8px",padding:"24px",textAlign:"center",cursor:d?"not-allowed":"pointer",backgroundColor:g?"#eff6ff":"#fafafa",transition:"all 0.15s",opacity:d?"0.6":"1"},I={fontSize:"12px",color:"#9ca3af"},A=o("input",{id:t,ref:b,type:"file",accept:r,multiple:i,onChange:$,disabled:d,style:{display:"none"},tabIndex:-1}),F=o("div",{style:z,onClick:C,onKeyDown:e=>{const t=e.key;"Enter"!==t&&" "!==t||(e.preventDefault(),C())},onDrop:k,onDragOver:v,onDragLeave:w,role:"button",tabIndex:d?-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"),r?o("div",{style:I},r):null,a?o("div",{style:I},`Max size: ${fe(a)}`):null),L=u.length>0?o("div",{style:{marginTop:"8px",display:"flex",flexDirection:"column",gap:"4px"}},...u.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"}},fe(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(),M(t)},"aria-label":`Remove ${e.name}`},"✕")))):null;return o(te,{label:f,helpText:p,error:y||void 0,disabled:d,htmlFor:t},o("div",null,A,F,L))},exports.FlexContainer=function(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)},exports.FlexItem=function(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)},exports.Footer=function(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:p="Site footer"}=e;return o("footer",{className:f,role:"contentinfo","aria-label":p,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)))},exports.ForceGraph=function(e){const{nodes:t,edges:n,width:r=600,height:i=400,nodeRadius:f=12,nodeStrokeWidth:p=2,solidNodes:u=!0,showLabels:h=!0,showArrows:g=!1,repulsionForce:x=300,attractionForce:y=.01,damping:m=.9,edgeLength:b=100,edgeColor:S="#94a3b8",edgeWidth:k=1.5,title:v,customForce:w,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":v??"Empty force-directed graph"},v?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"},v):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(Un(t,r,i)),[C,z]=l(0),I=c(!0),A=c(!1),F=c(n);F.current=n;const L=c(w);L.current=w;const R=c(null),D=c({repulsionForce:x,attractionForce:y,damping:m,edgeLength:b,width:r,height:i,nodeRadius:f,solidNodes:u});D.current={repulsionForce:x,attractionForce:y,damping:m,edgeLength:b,width:r,height:i,nodeRadius:f,solidNodes:u};const N=c(new Map);a(()=>{M.current=Un(t,r,i),A.current=!1,I.current=!0,N.current=new Map,z(e=>e+1)},[t.length]),a(()=>{let e=0;const t=()=>{if(!I.current)return;const n=D.current,o=L.current;let r;if(o?(r=o(M.current,F.current,n.width,n.height,R.current),n.solidNodes&&Vn(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),p=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,u=l/d*c,h=a/d*c;f[t]+=u,p[t]+=h,f[o]-=u,p[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],u=d.x-s.x,h=d.y-s.y,g=Math.sqrt(u*u+h*h);if(g<.1)continue;const x=i*(g-a)*(o.weight??1),y=u/g*x,m=h/g*x;f[r]+=y,p[r]+=m,f[l]-=y,p[l]-=m}const u=n/2,h=o/2;for(let t=0;t<d;t++){const n=e[t];f[t]+=.001*(u-n.x),p[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+p[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,u=r.y+a;c=Math.max(20,Math.min(n-20,c)),u=Math.max(20,Math.min(o-20,u)),g.push({...r,x:c,y:u,vx:i,vy:a})}return Vn(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=N.current.get(t.nodeId);o||(o=[],N.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 z(e=>e+1);z(e=>e+1),e=requestAnimationFrame(t)};return e=requestAnimationFrame(t),()=>{I.current=!1,cancelAnimationFrame(e)}},[]);const B=M.current,T=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,z(e=>e+1))},[]),W=c(null),E=c(null),P=s(e=>{const t=e,n=E.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]),H=c(!1),j=s((e,t)=>{t.stopPropagation(),W.current=e;const n=M.current.find(t=>t.id===e);H.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(R.current={x:t.x,y:t.y},!W.current)return;const n=W.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),z(e=>e+1)},[r,i,P]),_=s(()=>{const e=W.current;e&&(M.current=M.current.map(t=>t.id===e?{...t,fixed:H.current}:t)),W.current=null},[]),q=s(()=>{W.current=null,R.current=null},[]),O=d(()=>{const e=new Map;for(let t=0;t<B.length;t++)e.set(B[t].id,B[t]);return e},[C]),G=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:S})))]:[],[g,f,S]),U=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,k*r.weight)):k,s={key:`edge-${t}`,x1:String(i.x),y1:String(i.y),x2:String(l.x),y2:String(l.y),stroke:r.color??S,"stroke-width":String(a),"stroke-opacity":"0.6"};g&&(s["marker-end"]="url(#arrowhead)"),e.push(o("line",s))}return e},[C,S,k,g]),V=s(()=>{const e=[];for(let t=0;t<B.length;t++){const n=B[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(p),style:{cursor:W.current===n.id?"grabbing":"grab"},onMouseDown:e=>j(n.id,e),onDblClick:()=>T(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},[C,f,h,T]),X=s(()=>v?[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"},v)]:[],[v,r]),K=s(()=>{if(!$||0===$.length)return[];const e=[];for(let t=0;t<$.length;t++){const n=$[t],r=N.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},[C,$]),Z=G(),J=K(),Q=U(),ee=V(),te=X();return o("svg",{ref:E,width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":v??"Force-directed graph — drag nodes to move, double-click to lock",style:{fontFamily:"sans-serif",cursor:W.current?"grabbing":"default"},onMouseMove:Y,onMouseUp:_,onMouseLeave:q},...Z,...te,...J,...Q,...ee)},exports.FormFieldWrapper=te,exports.FunnelChart=function(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:p=Xn,title:u}=e,h="vertical"===i,g=u?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]),y=s(e=>0===x?0:Math.max(.05,e/x),[x]),m=s((e,t)=>t||(p[e%p.length]??Xn[0]),[p]),b=s(()=>{if(0===t.length)return[];const e=[],i=n-80-120,s=r-g-80,d=f*(t.length-1),p=Math.max(1,(s-d)/t.length),u=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=m(n,r.color),h=y(r.value),x=i/2*h,b=i/2*(null!==s?y(s.value):.6*h),S=g+40+n*(p+f),k=`${u-x},${S} ${u+x},${S} ${u+b},${S+p} ${u-b},${S+p}`;e.push(o("polygon",{key:`section-${n}`,points:k,fill:d,stroke:"#fff","stroke-width":"1"}));const v=40+i+12,w=S+p/2;if(l&&e.push(o("text",{key:`label-${n}`,x:String(v),y:String(w-(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(v),y:String(w+(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,m,y,120]),S=s(()=>{if(0===t.length)return[];const e=[],i=n-80,s=r-g-80-40,d=f*(t.length-1),p=Math.max(1,(i-d)/t.length),u=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=m(n,r.color),h=y(r.value),x=s/2*h,b=s/2*(null!==i?y(i.value):.6*h),S=40+n*(p+f),k=`${S},${u-x} ${S+p},${u-b} ${S+p},${u+b} ${S},${u+x}`;e.push(o("polygon",{key:`section-${n}`,points:k,fill:d,stroke:"#fff","stroke-width":"1"}));const v=S+p/2,w=g+40+s+14;if(l&&e.push(o("text",{key:`label-${n}`,x:String(v),y:String(w),"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(v),y:String(w+14),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#6b7280"},i))}}return e},[t,n,r,g,f,l,a,c,m,y]),k=s(()=>u?[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"},u)]:[],[u,n]),v=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]),w=k(),$=h?b():S(),M=v();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??"Funnel chart",style:{fontFamily:"sans-serif"}},...w,...$,...M)},exports.GanttChart=function(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:p="days",title:u,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":u??"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:"#9ca3af"},"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]),y=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]),m=r??2*h+y.length*(i+l)+l+20,b=n-h-g-h,S=h+(u?20:0),k=s(e=>0===x.range?g+h:g+h+(e-x.min)/x.range*b,[x,b,g,h]),v=s(()=>{if(!a)return[];const e=[],t=Zn(x.range),n=Math.ceil(x.min/t)*t,r=S+y.length*(i+l)+l;for(let i=n;i<=x.max;i+=t){const t=k(i);e.push(o("line",{key:`grid-${i}`,x1:String(t),y1:String(S),x2:String(t),y2:String(r),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"}))}return e},[a,x,S,y.length,i,l,k]),w=s(()=>{const e=[],t=Zn(x.range),r=Math.ceil(x.min/t)*t,i=S-8;for(let n=r;n<=x.max;n+=t){const t=k(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:"#6b7280"},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:"#9ca3af","font-style":"italic"},p)),e},[x,S,k,p,n,h]),$=s(()=>{const e=[];let t="";for(let n=0;n<y.length;n++){const r=y[n],a=S+n*(i+l)+l,s=k(r.start),d=Math.max(2,k(r.start+r.duration)-s),p=Jn(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:"#9ca3af","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:p,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:"#374151"},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},[y,S,i,l,k,c,f,g,h]),M=s(()=>u?[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"},u)]:[],[u,n,h]),C=v(),z=w(),I=$(),A=M();return o("svg",{width:"100%",height:String(m),viewBox:`0 0 ${n} ${m}`,xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":u??"Gantt chart",style:{fontFamily:"sans-serif"}},...A,...C,...z,...I)},exports.Gauge=function(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:p=!0,showTicks:u=!0,tickCount:h=10,label:g,unit:x,colors:y=["#22c55e","#f59e0b","#ef4444"],needleColor:m="#374151",backgroundColor:b="#e5e7eb"}=e,S=isFinite(n)&&!isNaN(n)?n:0,k=isFinite(r)&&!isNaN(r)&&r>S?r:S+100,v=isFinite(t)&&!isNaN(t)?function(e,t,n){return e<t?t:e>n?n:e}(t,S,k):S,w=i/2,$=.6*l,M=Math.min(i/2,.55*l)-c/2-10,C=M-c,z=M-c/2,I=d-a,A=s(e=>{const t=k-S;return 0===t?a:a+(e-S)/t*I},[S,k,a,I]),F=s(()=>[o("path",{key:"bg-arc",d:to(w,$,z,a,d),fill:"none",stroke:b,"stroke-width":String(c),"stroke-linecap":"round"})],[w,$,z,a,d,b,c]),L=s(()=>{if(0===y.length)return[];const e=[],t=I/y.length;for(let n=0;n<y.length;n++){const r=a+n*t,i=to(w,$,z,r,r+t);e.push(o("path",{key:`seg-${n}`,d:i,fill:"none",stroke:y[n],"stroke-width":String(c),"stroke-linecap":0===n||n===y.length-1?"round":"butt",opacity:"0.85"}))}return e},[y,I,a,w,$,z,c]),R=s(()=>{if(!u||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*I,l=n%2==0,s=l?10:6,d=eo(w,$,M+4,i),c=eo(w,$,M+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:"#9ca3af","stroke-width":l?"2":"1"})),l){const t=S+r*(k-S),l=eo(w,$,M+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:"#6b7280"},no(t)))}}return e},[u,h,a,I,w,$,M,S,k]),D=s(()=>{const e=[],t=A(v),n=eo(w,$,C-8,t),r=t-90,i=eo(w,$,6,t+90),l=eo(w,$,6,r);return e.push(o("polygon",{key:"needle",points:`${n.x},${n.y} ${i.x},${i.y} ${l.x},${l.y}`,fill:m,stroke:"none"})),e.push(o("circle",{key:"needle-cap",cx:String(w),cy:String($),r:"8",fill:m,stroke:"#fff","stroke-width":"2"})),e},[v,A,w,$,C,m]),N=s(()=>{if(!f)return[];const e=[],t=no(v),n=t+(x?" "+x:"");return e.push(o("text",{key:"value-text",x:String(w),y:String($+.45*M),"text-anchor":"middle","font-size":"22","font-weight":"bold","font-family":"sans-serif",fill:"#111827","aria-label":`Value: ${n}`},t,x?o("tspan",{key:"unit","font-size":"14","font-weight":"normal",fill:"#6b7280"}," "+x):null)),e},[f,v,x,w,$,M]),B=s(()=>g?[o("text",{key:"label",x:String(w),y:String($+.45*M+22),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#6b7280"},g)]:[],[g,w,$,M]),T=s(()=>{if(!p)return[];const e=[],t=eo(w,$,z,a),n=eo(w,$,z,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:"#6b7280"},no(S))),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:"#6b7280"},no(k))),e},[p,w,$,z,a,d,S,k]),W=F(),E=L(),P=R(),H=D(),j=N(),Y=B(),_=T(),q=`Gauge: ${no(v)}${x?" "+x:""}, range ${no(S)} to ${no(k)}${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(v),"aria-valuemin":String(S),"aria-valuemax":String(k),"aria-label":q,style:{fontFamily:"sans-serif"}},...W,...E,...P,...H,...j,...Y,..._)},exports.GeoMap=function(e){const{regions:t=[],markers:n=[],width:r=800,height:i=500,projection:l="equirectangular",colorScale:a=["#dbeafe","#3b82f6","#1e3a8a"],minValue:c,maxValue:f,showLabels:p=!1,backgroundColor:u="#f0f4f8",borderColor:h="#94a3b8",borderWidth:g=1,defaultRegionColor:x="#cbd5e1",title:y,padding:m=20}=e,b=d(()=>{let e=c??1/0,n=f??-1/0;for(let o=0;o<t.length;o++){const r=t[o].value;void 0!==r&&(void 0===c&&r<e&&(e=r),void 0===f&&r>n&&(n=r))}return isFinite(e)||(e=0),isFinite(n)||(n=100),e===n&&(n=e+1),{lo:e,hi:n}},[t,c,f]),S=s((e,t)=>"mercator"===l?function(e,t,n,o,r){const i=o-2*r,l=r+(t+180)/360*(n-2*r),a=Math.max(-85,Math.min(85,e))*oo,s=Math.log(Math.tan(Math.PI/4+a/2)),d=Math.log(Math.tan(Math.PI/4+85*oo/2));return{x:l,y:r+(d-s)/(2*d)*i}}(e,t,r,i,m):function(e,t,n,o,r){return{x:r+(t+180)/360*(n-2*r),y:r+(90-e)/180*(o-2*r)}}(e,t,r,i,m),[l,r,i,m]),k=s(()=>[o("rect",{key:"bg",x:"0",y:"0",width:"100%",fill:u,rx:"4",ry:"4"})],[r,i,u]),v=s(()=>{const e=[];for(let n=0;n<t.length;n++){const r=t[n];let i;if(i=r.color?r.color:void 0!==r.value?io((r.value-b.lo)/(b.hi-b.lo),a):x,e.push(o("path",{key:`region-${r.id}`,d:r.path,fill:i,stroke:h,"stroke-width":String(g),"stroke-linejoin":"round",role:"img","aria-label":r.label+(void 0!==r.value?": "+String(r.value):"")})),p){const t=lo(r.path);e.push(o("text",{key:`label-${r.id}`,x:String(t.cx),y:String(t.cy),"text-anchor":"middle","dominant-baseline":"central","font-size":"10","font-family":"sans-serif",fill:"#1e293b","pointer-events":"none"},r.label))}}return e},[t,b,a,x,h,g,p]),w=s(()=>{const e=[];for(let t=0;t<n.length;t++){const r=n[t],i=S(r.lat,r.lon),l=r.radius??5,a=r.color??"#ef4444";e.push(o("circle",{key:`marker-shadow-${t}`,cx:String(i.x+1),cy:String(i.y+1),r:String(l),fill:"rgba(0,0,0,0.15)"})),e.push(o("circle",{key:`marker-${t}`,cx:String(i.x),cy:String(i.y),r:String(l),fill:a,stroke:"#fff","stroke-width":"1.5",role:"img","aria-label":r.label??`Marker at ${r.lat}, ${r.lon}`})),r.label&&e.push(o("text",{key:`marker-label-${t}`,x:String(i.x),y:String(i.y-l-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#1e293b","pointer-events":"none"},r.label))}return e},[n,S]),$=s(()=>{let e=!1;for(let n=0;n<t.length;n++)if(void 0!==t[n].value){e=!0;break}if(!e)return[];const n=[],l=r-m-150,s=i-m-12-20;for(let e=0;e<20;e++){const t=io(e/19,a);n.push(o("rect",{key:`legend-stop-${e}`,x:String(l+7.5*e),y:String(s),width:String(8),height:String(12),fill:t}))}return n.push(o("rect",{key:"legend-border",x:String(l),y:String(s),width:String(150),height:String(12),fill:"none",stroke:"#94a3b8","stroke-width":"0.5"})),n.push(o("text",{key:"legend-min",x:String(l),y:String(s+12+14),"text-anchor":"start","font-size":"10","font-family":"sans-serif",fill:"#64748b"},String(b.lo))),n.push(o("text",{key:"legend-max",x:String(l+150),y:String(s+12+14),"text-anchor":"end","font-size":"10","font-family":"sans-serif",fill:"#64748b"},String(b.hi))),n},[t,r,i,m,a,b]),M=s(()=>y?[o("text",{key:"title",x:String(r/2),y:String(m+6),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},y)]:[],[y,r,m]),C=k(),z=v(),I=w(),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":y??"Geographic map",style:{fontFamily:"sans-serif"}},...C,...F,...z,...I,...A)},exports.GoogleAnalytics=function(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},exports.Grid=function(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)},exports.GridItem=function(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)},exports.HeatMap=function(e){const{data:t=[],rowLabels:n,columnLabels:r,width:i=600,height:l=400,colorScale:a=fo,minValue:c,maxValue:f,showValues:p=!1,cellBorderColor:u="#fff",cellBorderWidth:h=1,title:g,padding:x=60}=e,y=t.length,m=d(()=>{let e=0;for(const n of t)n.length>e&&(e=n.length);return e},[t]),{minVal:b,maxVal:S}=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]),k=g?30:0,v=n?x:20,w=m>0?(i-v-20)/m:0,$=y>0?(l-k-(r?x:20)-20)/y:0,M=s(()=>{const e=[];for(let n=0;n<y;n++){const r=t[n];for(let t=0;t<m;t++){const i=t<r.length?r[t]:0,l=so((i-b)/(S-b),a),s=v+t*w,d=k+20+n*$;if(e.push(o("rect",{key:`cell-${n}-${t}`,x:String(s),y:String(d),width:String(w),height:String($),fill:l,stroke:u,"stroke-width":String(h)})),p){const r=co(l)>.5?"#111827":"#ffffff";e.push(o("text",{key:`val-${n}-${t}`,x:String(s+w/2),y:String(d+$/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.min(11,.3*w,.4*$)),"font-family":"sans-serif",fill:r},String(Math.round(100*i)/100)))}}}return e},[t,y,m,b,S,a,w,$,v,k,p,u,h]),C=s(()=>{const e=[];if(n)for(let t=0;t<y;t++){const r=t<n.length?n[t]:"",i=k+20+t*$+$/2;e.push(o("text",{key:`row-label-${t}`,x:String(v-8),y:String(i),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"#374151"},r))}if(r)for(let t=0;t<m;t++){const n=t<r.length?r[t]:"",i=v+t*w+w/2,l=k+20+y*$+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:"#374151"},n))}return e},[n,r,y,m,w,$,v,k]),z=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:"#111827"},g)]:[],[g,i]);if(0===y||0===m)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:"#6b7280"},"No data to display."));const I=z(),A=M(),F=C();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)},exports.Histogram=function(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:p,xLabel:u,yLabel:h,padding:g=60}=e,x=Math.max(1,Math.round(n)),y=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]),m=d(()=>{let e=0;for(let t=0;t<y.length;t++)y[t].count>e&&(e=y[t].count);return e>0?e:1},[y]),b=r-2*g,S=i-2*g,k=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}(m),t=[];for(let n=e;n<=m;n+=e){const e=g+S-n/m*S;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,m,g,b,S]),v=s(()=>{const e=[];return e.push(o("line",{key:"axis-y",x1:String(g),y1:String(g),x2:String(g),y2:String(g+S),stroke:"#374151","stroke-width":"1.5"})),e.push(o("line",{key:"axis-x",x1:String(g),y1:String(g+S),x2:String(g+b),y2:String(g+S),stroke:"#374151","stroke-width":"1.5"})),e},[g,b,S]),w=s(()=>{if(0===y.length)return[];const e=[],t=a*(y.length-1),n=Math.max(1,(b-t)/y.length);for(let t=0;t<y.length;t++){const r=y[t],i=r.count/m*S,s=g+t*(n+a),d=g+S-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))),y.length<=15||t%2==0||t===y.length-1){const i=(y.length,po(r.min));e.push(o("text",{key:`xlabel-${t}`,x:String(s+n/2),y:String(g+S+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},i))}}if(y.length>0){const t=y[y.length-1],n=g+b;e.push(o("text",{key:"xlabel-end",x:String(n),y:String(g+S+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},po(t.max)))}return e},[y,m,a,l,f,g,b,S]),$=s(()=>{const e=[];return p&&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"},p)),u&&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"},u)),h&&e.push(o("text",{key:"y-label",x:String(14),y:String(g+S/2),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90 14 ${g+S/2})`},h)),e},[p,u,h,r,i,g,b,S]),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]),C=k(),z=v(),I=w(),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":p??"Histogram",style:{fontFamily:"sans-serif"}},...A,...C,...z,...I,...F)},exports.HypercubeGraph=function(e){const t=e.dimension??4,n=e.width??600,r=e.height??600,i=e.vertexRadius??10,f=e.edgeWidth??3,p=e.edgeColor??"#111",u=e.perspective??.25,h=e.rotationSpeed??.008,g=e.showLabels??!1,x=e.backgroundColor??"transparent",y=e.scale??.3*Math.min(n,r),m=Rt(t),b=1<<t,S=d(()=>"auto"===e.vertexColors||void 0===e.vertexColors?Dt(b):e.vertexColors,[b,e.vertexColors]),[k,v]=l(()=>{const e=[];for(let t=0;t<m;t++)e.push(0);return e}),[w,$]=l(!1),M=c({x:0,y:0}),C=c([]),z=c(0);a(()=>{if(0===h)return;let e=!0;const t=()=>{e&&(v(e=>{const t=e.slice();for(let e=0;e<t.length;e++)t[e]=(t[e]??0)+h*(1+.3*e);return t}),z.current=requestAnimationFrame(t))};return z.current=requestAnimationFrame(t),()=>{e=!1,cancelAnimationFrame(z.current)}},[h]);const I=d(()=>Lt(t,k,u,y),[t,k,u,y]),A=n/2,F=r/2,L=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]),R=d(()=>I.vertices.slice().sort((e,t)=>e.depth-t.depth),[I]),D=s(e=>{const t=e;$(!0),M.current={x:t.clientX,y:t.clientY},C.current=k.slice()},[k]),N=s(e=>{if(!w)return;const t=e,n=.01*(t.clientX-M.current.x),o=.01*(t.clientY-M.current.y);v(()=>{const e=C.current.slice();return e.length>0&&(e[0]=(e[0]??0)+n),e.length>1&&(e[1]=(e[1]??0)+o),e})},[w]),B=s(()=>{$(!1)},[]),T=L.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:p,"stroke-width":String(f),"stroke-opacity":String(n),"stroke-linecap":"round"})}),W=R.map(e=>{const n=i*(e=>{const t=(e+2)/4;return.6+.4*Math.max(0,Math.min(1,t))})(e.depth),r=S[e.id%S.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:w?"grabbing":"grab",userSelect:"none"},onMouseDown:D,onMouseMove:N,onMouseUp:B,onMouseLeave:B},...T,...W.flat())},exports.IDE=function(e){const[t,n]=l("App.ts"),[r,i]=l({src:!0,components:!0,hooks:!0}),[a,f]=l(-1),[p,u]=l(Vt.length),h=c(null),g=s(e=>{n(e);const t=Ut[e];t&&u(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})},[]),y=s(e=>{f(t=>t===e?-1:e)},[]),m=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="",u(1))}f(-1),h.current&&h.current.focus()},[]),b=s(()=>{if(h.current){const e=(h.current.textContent??"").split("\n");u(Math.max(e.length,1))}},[]),S=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"}),[]),k={padding:"3px 8px",fontSize:"12px",color:"#cccccc",cursor:"pointer",borderRadius:"3px",backgroundColor:"transparent",border:"none",position:"relative"},v={...k,backgroundColor:"rgba(255,255,255,0.1)"},w={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"},C=Ut[t]??Vt,z=C.map((e,t)=>{const n=function(e){if(!e.trim())return[{text:" ",color:Jt}];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=Jt;Xt.has(r)?a=Zt:Kt.has(r)?a="#4ec9b0":l?a="#dcdcaa":"true"!==r&&"false"!==r||(a=Zt),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:Jt}),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(p,C.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=Gt.find(t=>t.name===e.parent&&t.isFolder);return!t||F(t)},L=qt.map((e,t)=>{const n=[e],r=a===t;return r&&Ot[e]&&n.push(o("div",{key:"dropdown",style:w,className:"ide__menu-dropdown"},...Ot[e].map((e,t)=>o("button",{key:String(t),style:$,onClick:t=>{t.stopPropagation(),m(e.action)},role:"menuitem"},e.label)))),o("button",{key:String(t),style:r?v:k,role:"menuitem","aria-label":e,onClick:()=>y(t)},...n)}),R=Gt.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:S},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"},...L),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"),...R),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},...z))),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"}}),...C.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"))))},exports.Image=function(e){const[t,n]=l("loading"),r=c(null),i=f(),s=!1!==e.lazy,p="number"==typeof e.width?`${e.width}px`:e.width,u="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 p&&(t.width=p),u&&(t.height=u),e.borderRadius&&(t.borderRadius=e.borderRadius),t},[p,u,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:p??"100%",height:u??"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:p??"100%",height:u??"200px",backgroundColor:"#d1d5db",filter:"blur(20px)"}}):null!=e.placeholder&&!1!==e.placeholder&&(x=e.placeholder));let y=null;"error"===t&&null!=e.fallback&&(y="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 m=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")}),y);return e.caption?o("figure",{style:{margin:"0",display:"inline-block"}},m,o("figcaption",{style:{fontSize:"13px",color:"#6b7280",marginTop:"6px",textAlign:"center"}},e.caption)):m},exports.LineGraph=function(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:p=!0,showArea:u=!1,areaColor:h="rgba(59,130,246,0.15)",xLabel:g,yLabel:x,title:y,padding:m=50,animate:b=!1,multiLine:S}=e,k=xt(d(()=>{const e=[...t];if(S)for(const t of S)e.push(...t.data);return e},[t,S]),n,r,m),{xScale:v,yScale:w,xTicks:$,yTicks:M}=k,C=[];if(C.push(o("rect",{x:0,y:0,width:"100%",fill:"white",key:"bg"})),p){for(let e=0;e<$.length;e++){const t=v($[e]);C.push(o("line",{x1:t,y1:m,x2:t,y2:r-m,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-x-${e}`}))}for(let e=0;e<M.length;e++){const t=w(M[e]);C.push(o("line",{x1:m,y1:t,x2:n-m,y2:t,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-y-${e}`}))}}C.push(o("line",{x1:m,y1:r-m,x2:n-m,y2:r-m,stroke:"#374151","stroke-width":1,key:"x-axis"})),C.push(o("line",{x1:m,y1:m,x2:m,y2:r-m,stroke:"#374151","stroke-width":1,key:"y-axis"}));for(let e=0;e<$.length;e++){const t=v($[e]);C.push(o("line",{x1:t,y1:r-m,x2:t,y2:r-m+5,stroke:"#374151",key:`xtick-${e}`})),C.push(o("text",{x:t,y:r-m+18,"text-anchor":"middle","font-size":11,fill:"#6b7280",key:`xlabel-${e}`},yt($[e])))}for(let e=0;e<M.length;e++){const t=w(M[e]);C.push(o("line",{x1:m-5,y1:t,x2:m,y2:t,stroke:"#374151",key:`ytick-${e}`})),C.push(o("text",{x:m-10,y:t+4,"text-anchor":"end","font-size":11,fill:"#6b7280",key:`ylabel-${e}`},yt(M[e])))}function z(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=w(k.yMin),t=f.map(e=>`${v(e.x)},${w(e.y)}`).join(" "),n=`${v(f[0].x)},${e} ${t} ${v(f[f.length-1].x)},${e}`;C.push(o("polygon",{points:n,fill:i,key:`${c}-area`}))}const p={points:f.map(e=>`${v(e.x)},${w(e.y)}`).join(" "),fill:"none",stroke:t,"stroke-width":n,"stroke-linejoin":"round","stroke-linecap":"round",key:`${c}-line`};if(b?(p["stroke-dasharray"]="1000",p["stroke-dashoffset"]="1000",C.push(o("polyline",p,o("animate",{attributeName:"stroke-dashoffset",from:1e3,to:0,dur:"1.5s",fill:"freeze"})))):C.push(o("polyline",p)),l)for(let e=0;e<f.length;e++){const t=v(f[e].x),n=w(f[e].y),r=f[e].shape??d,i=f[e].radius??s,l=`${c}-pt-${e}`;if(b){const e=mt(r,t,n,i,a,l,{opacity:0});C.push(o("g",{key:`${l}-g`},e,o("animate",{attributeName:"opacity",from:0,to:1,dur:"0.3s",begin:"1.2s",fill:"freeze"})))}else C.push(mt(r,t,n,i,a,l))}}if(z(t,i,l,u,h,f,s,a,c,"primary"),S)for(let e=0;e<S.length;e++){const t=S[e];z(t.data,t.color,l,!1,"transparent",f,t.color,t.pointRadius??a,t.pointShape??c,`series-${e}`)}if(S&&S.length>0){const e=[],t=[{color:i,label:"Primary"},...S.map((e,t)=>({color:e.color,label:e.label??`Series ${t+1}`}))];for(let n=0;n<t.length;n++){const r=m+10+120*n,i=m-30;e.push(o("rect",{x:r,y:i,width:14,height:14,fill:t[n].color,rx:2,key:`legend-rect-${n}`})),e.push(o("text",{x:r+20,y:i+12,"font-size":12,fill:"#374151",key:`legend-text-${n}`},t[n].label))}C.push(o("g",{key:"legend"},...e))}return g&&C.push(o("text",{x:n/2,y:r-8,"text-anchor":"middle","font-size":13,fill:"#374151",key:"x-axis-label"},g)),x&&C.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)),y&&C.push(o("text",{x:n/2,y:20,"text-anchor":"middle","font-size":16,"font-weight":"bold",fill:"#111827",key:"title"},y)),o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...C)},exports.ListView=function(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:G},c):null,o("div",{style:O},d),f?o("div",{style:{...G,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},f):null);const p=[];for(let e=0;e<t.length;e++){const d=t[e],c=r(d,e),f=a===e,u=e===t.length-1,h={...j,...l?_:{},...f?q:{},...i&&!u?Y:{}};p.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:G},c):null,o("ul",{style:H,role:s?"listbox":"list"},...p),f?o("div",{style:{...G,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},f):null)},exports.LollipopChart=function(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:p=!0,showValues:u=!0,title:h,padding:g=60}=e,x="vertical"===i,y=n-2*g,m=r-2*g,b=x?m:y,S=x?y:m,k=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]),v=d(()=>0===t.length?0:S/t.length,[t.length,S]),w=s(()=>{if(!p)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}(k),t=[];for(let n=e;n<=k;n+=e){const e=n/k*b;if(x){const r=g+m-e;t.push(o("line",{key:`grid-${n}`,x1:String(g),y1:String(r),x2:String(g+y),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+m),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),t.push(o("text",{key:`grid-label-${n}`,x:String(r),y:String(g+m+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(n)))}}return t},[p,k,x,g,y,m,b]),$=s(()=>{const e=[];return 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"})),e.push(o("line",{key:"axis-x",x1:String(g),y1:String(g+m),x2:String(g+y),y2:String(g+m),stroke:"#374151","stroke-width":"1.5"})),e},[x,g,y,m]),M=s(()=>{if(0===t.length)return[];const e=[];for(let n=0;n<t.length;n++){const r=t[n],i=r.value/k*b,s=v*n+v/2,d=r.color??f;if(x){const t=g+s,f=g+m,p=g+m-i;e.push(o("line",{key:`stem-${n}`,x1:String(t),y1:String(f),x2:String(t),y2:String(p),stroke:l,"stroke-width":String(a)})),e.push(o("circle",{key:`dot-${n}`,cx:String(t),cy:String(p),r:String(c),fill:d})),u&&e.push(o("text",{key:`val-${n}`,x:String(t),y:String(p-c-4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(r.value))),e.push(o("text",{key:`cat-${n}`,x:String(t),y:String(g+m+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},r.label))}else{const t=g+s,f=g,p=g+i;e.push(o("line",{key:`stem-${n}`,x1:String(f),y1:String(t),x2:String(p),y2:String(t),stroke:l,"stroke-width":String(a)})),e.push(o("circle",{key:`dot-${n}`,cx:String(p),cy:String(t),r:String(c),fill:d})),u&&e.push(o("text",{key:`val-${n}`,x:String(p+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,k,v,f,c,l,a,u,x,g,y,m,b]),C=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]),z=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=w(),A=$(),F=M(),L=C(),R=z();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"}},...L,...I,...A,...F,...R)},exports.Matrix=function(e){const{data:t=[],labels:n,rowLabels:r,columnLabels:i,width:l=500,height:a=500,colorScale:c=xo,showValues:f=!0,showDiagonal:p=!0,cellBorderColor:u="#e5e7eb",title:h,padding:g=70,symmetric:x=!1}=e,y=r??n,m=i??n,b=t.length,S=d(()=>{let e=0;for(const n of t)n.length>e&&(e=n.length);return e},[t]),k=d(()=>{if(!x||0===b)return t;const e=[],n=Math.max(b,S);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,S]),v=k.length,w=d(()=>{let e=0;for(const t of k)t.length>e&&(e=t.length);return e},[k]),{minVal:$,maxVal:M}=d(()=>{let e=1/0,t=-1/0;for(const n of k)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}},[k]),C=h?30:0,z=y?g:20,I=w>0?(l-z-20)/w:0,A=v>0?(a-C-(m?g:20)-20)/v:0,F=s(()=>{const e=[];for(let t=0;t<v;t++){const n=k[t];for(let r=0;r<w;r++){const i=r<n.length?n[r]:0,l=ho((i-$)/(M-$),c),a=z+r*I,s=C+20+t*A,d=t===r,h=d&&p?"#374151":u,g=d&&p?"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=go(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&&p?"bold":"normal","font-family":"sans-serif",fill:n},String(Math.round(100*i)/100)))}}}return e},[k,v,w,$,M,c,I,A,z,C,f,p,u]),L=s(()=>{const e=[];if(y)for(let t=0;t<v;t++){const n=t<y.length?y[t]:"",r=C+20+t*A+A/2;e.push(o("text",{key:`row-label-${t}`,x:String(z-8),y:String(r),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"#374151"},n))}if(m)for(let t=0;t<w;t++){const n=t<m.length?m[t]:"",r=z+t*I+I/2,i=C+20+v*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:"#374151"},n))}return e},[y,m,v,w,I,A,z,C]),R=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:"#111827"},h)]:[],[h,l]);if(0===v||0===w)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:"#6b7280"},"No data to display."));const D=R(),N=F(),B=L();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"}},...D,...N,...B)},exports.Menubar=function(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 p=t.map((e,t)=>o(Fe,{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"}},...p)},exports.Modal=function(e){const{open:t,onClose:n,title:r,size:i="md",closeOnOverlay:l=!0,closeOnEscape:s=!0,footer:d,showCloseButton:f=!0,children:p}=e,u=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&&u.current&&u.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:Ue[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 y=[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"}},p)];return d&&y.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:u,style:h,tabIndex:-1,role:"document"},...y))},exports.MultilineField=function(e){const[t,n]=l(!1),[r,i]=l((e.value??e.defaultValue??"").length),a=e.id??`ml-${Math.random().toString(36).slice(2,8)}`,d={...ne(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}:{}},c=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]),f=o("textarea",{id:a,name:e.name,value:e.value,placeholder:e.placeholder,rows:String(e.rows??4),maxLength:e.maxLength?String(e.maxLength):void 0,readOnly:e.readOnly,disabled:e.disabled,"aria-invalid":e.error?"true":void 0,"aria-required":e.required?"true":void 0,className:`multiline-input ${e.className??""}`.trim(),style:d,onFocus:()=>n(!0),onBlur:t=>{n(!1),e.onBlur&&e.onBlur(t.target.value)},onInput:c}),p=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(te,{label:e.label,htmlFor:a,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},f,p)},exports.NavWrapper=ve,exports.NumberSpinner=function(e){const t=e.id??`ns-${Math.random().toString(36).slice(2,8)}`,{value:n,onChange:r,min:i,max:a,step:d=1,disabled:c=!1,prefix:f,suffix:p,label:u,error:h}=e,[g,x]=l(!1),y=s(e=>{let t=e;return void 0!==i&&t<i&&(t=i),void 0!==a&&t>a&&(t=a),t},[i,a]),m=s(()=>{c||r(y(n+d))},[c,n,d,y,r]),b=s(()=>{c||r(y(n-d))},[c,n,d,y,r]),S=s(e=>{const t=e.target.value;if(""===t||"-"===t)return;const n=parseFloat(t);isNaN(n)||r(y(n))},[y,r]),k=s(e=>{c||("ArrowUp"===e.key?(e.preventDefault(),m()):"ArrowDown"===e.key&&(e.preventDefault(),b()))},[c,m,b]),v=void 0===a||n<a,w={display:"inline-flex",alignItems:"stretch",borderRadius:"6px",overflow:"hidden",border:"1px solid "+(h?"#ef4444":g?"#3b82f6":"var(--color-border, #d1d5db)"),transition:"border-color 0.15s",opacity:c?"0.6":"1",...g&&!h?{boxShadow:"0 0 0 3px #3b82f622"}:{}},$=e=>({display:"flex",alignItems:"center",justifyContent:"center",width:"36px",backgroundColor:"var(--color-bg-subtle, #f9fafb)",border:"none",cursor:c||!e?"not-allowed":"pointer",color:c||!e?"#d1d5db":"var(--color-text, #374151)",fontSize:"inherit",fontWeight:"600",userSelect:"none",transition:"background-color 0.1s",borderRight:"none",borderLeft:"none"}),M={display:"flex",alignItems:"center",fontSize:"inherit",color:"var(--color-text-muted, #6b7280)",padding:"0 2px",backgroundColor:"var(--color-bg-subtle, #f9fafb)"},C=o("button",{type:"button",style:$(void 0===i||n>i),onClick:b,disabled:c,"aria-label":"Decrement",tabIndex:-1},"−"),z=f?o("span",{style:M},f):null,I=o("input",{id:t,type:"text",value:String(n),onInput:S,onKeyDown:k,onFocus:()=>x(!0),onBlur:()=>x(!1),disabled:c,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":u||"Number",role:"spinbutton","aria-valuenow":String(n),"aria-valuemin":void 0!==i?String(i):void 0,"aria-valuemax":void 0!==a?String(a):void 0}),A=p?o("span",{style:M},p):null,F=o("button",{type:"button",style:$(v),onClick:m,disabled:c,"aria-label":"Increment",tabIndex:-1},"+"),L=[C];return z&&L.push(z),L.push(I),A&&L.push(A),L.push(F),o(te,{label:u,error:h,disabled:c,htmlFor:t},o("div",{style:w},...L))},exports.Pagination=function(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)),p=Math.min(Math.max(1,r),f),u=s(e=>{!c&&e>=1&&e<=f&&e!==p&&i(e)},[c,f,p,i]),h=(e,t,n)=>{const r=c||t<1||t>f||t===p;return o("button",{type:"button",onClick:()=>u(t),disabled:r||void 0,"aria-label":n,style:r?Ne:Re},e)},g=function(e,t,n){if(e<=2*n+5)return Le(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?[...Le(1,2*n+3),"ellipsis",e]:i&&!l?[1,"ellipsis",...Le(e-2*n-2,e)]:[1,"ellipsis",...Le(o,r),"ellipsis",e]}(f,p,l);let x=0;const y=[];a&&y.push(h("«",1,"Go to first page")),d&&y.push(h("‹",p-1,"Go to previous page"));for(const e of g)if("ellipsis"===e)y.push(o("span",{key:"ellipsis-"+x++,style:Be},"..."));else{const t=e===p;y.push(o("button",{key:String(e),type:"button",onClick:()=>u(e),disabled:c||void 0,"aria-label":`Page ${e}`,"aria-current":t?"page":void 0,style:c?Ne:t?De:Re},String(e)))}return d&&y.push(h("›",p+1,"Go to next page")),a&&y.push(h("»",f,"Go to last page")),o(ve,{orientation:"horizontal",role:"navigation",ariaLabel:"Pagination",keyboardNav:!0,styling:{border:"none",borderRadius:"0",backgroundColor:"transparent",padding:"0",custom:{gap:"4px"}}},...y)},exports.Panel=function(e){const t=!1!==e.bordered,n=e.shadow??"none",[r,i]=l(!!e.defaultCollapsed),f=c(null),[p,u]=l("auto");a(()=>{if(!e.collapsible)return;const t=f.current;t&&u(`${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=me[n]??me.none,{...o,...e.style??{}}},[t,n,e.style]),y={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",gap:"8px",backgroundColor:"#f9fafb",userSelect:"none",cursor:e.collapsible?"pointer":"default"},m={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":p,overflow:"hidden",transition:"max-height 0.3s ease"};return o("div",{className:`panel ${e.className??""}`.trim(),style:x},o("div",{className:"panel__header",style:y,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:m}):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)))},exports.Partition=function(e){const{data:t,width:n=600,height:r=400,orientation:i="horizontal",showLabels:l=!0,showValues:a=!0,colors:s=yo,borderColor:c="#ffffff",borderWidth:f=1,title:p,padding:u=10}=e,h=p?30:0,g=u,x=u+h,y=n-2*u,m=r-2*u-h;if(d(()=>mo(t),[t])<=0||y<=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":p??"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(mo(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:p}=e,u=mo(o);if(u<=0)continue;const h=s-i;let g,x,y,m;if(d?(g=i,x=n+r*c,y=h,m=c):(g=t+r*c,x=i,y=c,m=h),a.push({x:g,y:x,w:y,h:m,label:o.label,value:u,color:o.color??l[p%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=mo(n);if(i<=0)continue;const l=i/u*h;f.push({node:n,depth:r+1,spanStart:e,spanEnd:e+l,colorIndex:0===r?t:p}),e+=l}}}return a}(t,g,x,y,m,i,s),[t,g,x,y,m,i,s]),S=[];p&&S.push(o("text",{key:"title",x:String(n/2),y:String(u+16),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},p));for(let e=0;e<b.length;e++){const t=b[e];if(S.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;S.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&&S.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":p??"Partition diagram",style:{fontFamily:"sans-serif"}},...S)},exports.PieGraph=function(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:p,centerLabel:u,colors:h,strokeColor:g="#fff",strokeWidth:x=2}=e,y=c&&"right"===f?140:0,m=p?30:0,b=c&&"bottom"===f?22*Math.ceil(t.length/2)+10:0,S=n-y,k=r-m-b,v=S/2,w=m+k/2,$=Math.min(S,k)/2-10,M=e.outerRadius??$,C=d(()=>kt(t,{padAngle:l,colors:h}),[t,l,h]),z=[];p&&z.push(o("text",{key:"title",x:S/2,y:20,textAnchor:"middle",fontFamily:"sans-serif",fontSize:16,fontWeight:"bold",fill:"#333"},p));for(let e=0;e<C.length;e++){const t=C[e],n=St(v,w,i,M,t.startAngle,t.endAngle);if(z.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=bt(v,w,r?M+14:i+.65*(M-i),n-Math.PI/2),d=r?"#333":"#fff",c=r?11:12,f=[];if(a&&f.push(t.label),s&&f.push(`${t.percentage.toFixed(1)}%`),r){const t=bt(v,w,M+2,n-Math.PI/2);z.push(o("line",{key:`connector-${e}`,x1:t.x,y1:t.y,x2:l.x,y2:l.y,stroke:"#999",strokeWidth:1}))}a&&z.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&&z.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(u&&i>0&&z.push(o("text",{key:"center-label",x:v,y:w,textAnchor:"middle",dominantBaseline:"central",fontFamily:"sans-serif",fontSize:14,fontWeight:"bold",fill:"#333"},u)),c){const e=[];if("right"===f){const t=S+10,n=m+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:"#333"},`${i.label} (${i.percentage.toFixed(1)}%)`))}}else{const t=r-b+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:"#333"},`${i.label} (${i.percentage.toFixed(1)}%)`))}}z.push(...e)}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...z)},exports.PivotTable=function(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:p="#3b82f6",cellPadding:u=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:"#9ca3af"},"No data to display"));const h=d(()=>function(e,t,n,o,r){const i=So(e,t),l=So(e,n),a=new Map;for(const r of e){const e=`${bo(r,t)}::${bo(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,ko(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,ko(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,ko(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:ko(f,"count"===r?"sum":r)}}(t,n,r,i,l),[t,n,r,i,l]),{rowKeys:g,colKeys:x,cells:y,rowTotals:m,colTotals:b,grandTotal:S}=h,k=f?30:0,v=x.length+(c?1:0),w=g.length+(c?1:0),$=1+v,M=1+w,C=Math.max(40,(a-2*u)/$),z=Math.max(20,Math.min(36,(s-k-2*u)/M)),I=C*$,A=z*M,F=Math.max(0,(a-I)/2),L=k+Math.max(0,(s-k-A)/2),R=[];f&&R.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:"#111827"},f)),R.push(o("rect",{key:"header-row-bg",x:String(F),y:String(L),width:String(I),height:String(z),fill:p})),R.push(o("rect",{key:"header-col-bg",x:String(F),y:String(L+z),width:String(C),height:String(z*w),fill:p,opacity:"0.85"})),R.push(o("text",{key:"corner",x:String(F+C/2),y:String(L+z/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)*C,n=Math.floor(C/7),r=x[e],i=r.length>n?r.substring(0,Math.max(1,n-2))+"..":r;R.push(o("text",{key:`ch-${e}`,x:String(t+C/2),y:String(L+z/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},i))}c&&R.push(o("text",{key:"ch-total",x:String(F+(x.length+1)*C+C/2),y:String(L+z/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=L+(e+1)*z;e%2==0&&R.push(o("rect",{key:`row-bg-${e}`,x:String(F+C),y:String(n),width:String(C*v),height:String(z),fill:"#f9fafb"}));const r=Math.floor(C/7),i=t.length>r?t.substring(0,Math.max(1,r-2))+"..":t;R.push(o("text",{key:`rh-${e}`,x:String(F+C/2),y:String(n+z/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=y.get(i),a=F+(r+1)*C;R.push(o("rect",{key:`border-${e}-${r}`,x:String(a),y:String(n),width:String(C),height:String(z),fill:"none",stroke:"#e5e7eb","stroke-width":"0.5"})),R.push(o("text",{key:`cell-${e}-${r}`,x:String(a+C/2),y:String(n+z/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},void 0!==l?vo(l):"-"))}if(c){const r=F+(x.length+1)*C,i=m.get(t)??0;R.push(o("rect",{key:`rt-bg-${e}`,x:String(r),y:String(n),width:String(C),height:String(z),fill:"#eff6ff"})),R.push(o("text",{key:`rt-${e}`,x:String(r+C/2),y:String(n+z/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},vo(i)))}}if(c){const e=L+(g.length+1)*z;R.push(o("rect",{key:"total-row-bg",x:String(F),y:String(e),width:String(I),height:String(z),fill:"#eff6ff"})),R.push(o("text",{key:"total-label",x:String(F+C/2),y:String(e+z/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)*C;R.push(o("text",{key:`ct-${t}`,x:String(i+C/2),y:String(e+z/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},vo(r)))}const t=F+(x.length+1)*C;R.push(o("text",{key:"grand-total",x:String(t+C/2),y:String(e+z/2+4),"text-anchor":"middle","font-size":"12","font-family":"sans-serif","font-weight":"bold",fill:"#1e3a8a"},vo(S)))}return R.push(o("rect",{key:"outer-border",x:String(F),y:String(L),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"}},...R)},exports.PolarGraph2D=function(e){const{width:t=400,height:n=400,rRange:r=[0,2],plotFunction:i,plotResolution:f=360,thetaStep:p,sync:u=!1,points:h=[],showGrid:g=!0,pointRadius:x=3,pointColor:y="#3b82f6",curveColor:m="#3b82f6",onPointClick:b,onPointDoubleClick:S,onPointContextMenu:k,onPointHover:v}=e,[w,$]=l(r[1]),[M,C]=l(0),[z,I]=l(0),[A,F]=l(null),L=t/2+M,R=n/2+z,D=Math.min(t,n)/2-30,N=D/w,B=d(()=>{const e=Math.max(1,Math.ceil(w)),t=[],n=w/e;for(let o=1;o<=e;o++)t.push(n*o);return t},[w]),T=d(()=>{const e=[];for(let t=0;t<360;t+=30)e.push(t*Math.PI/180);return e},[]),W=d(()=>{if(!i||!u)return[];const e=p??2*Math.PI/f,t=it({start:0,end:2*Math.PI,step:e});return lt(i,t)},[i,f,p,u]),[E,P]=l([]),H=c(null);a(()=>{if(!i||u)return void P([]);const e=p??2*Math.PI/f,t=it({start:0,end:2*Math.PI,step:e});return H.current&&H.current(),H.current=at(i,t,200,e=>{P([...e])}),()=>{H.current&&H.current()}},[i,f,p,u]);const j=u?W:E,Y=d(()=>{if(0===j.length)return"";const e=[];for(let t=0;t<j.length;t++){const n=j[t],o=n.output;if(o<0||!isFinite(o))continue;const{x:r,y:i}=vt(o,n.input,L,R,N);e.push(`${0===e.length?"M":"L"}${r.toFixed(2)},${i.toFixed(2)}`)}return e.join(" ")},[j,L,R,N]),_=s(e=>{F({x:e.clientX,y:e.clientY,px:M,py:z})},[M,z]),q=s(e=>{A&&(C(A.px+(e.clientX-A.x)),I(A.py+(e.clientY-A.y)))},[A]),O=s(()=>{F(null)},[]),G=s(e=>{e.preventDefault();const t=e.deltaY>0?1.15:1/1.15;$(Math.max(.1,w*t))},[w]),U=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<B.length;e++){const t=B[e]*N;V.push(o("circle",{cx:L,cy:R,r:t,fill:"none",stroke:"#e5e7eb","stroke-width":1,key:`gc-${e}`})),V.push(o("text",{x:L+t+2,y:R-4,"font-size":10,fill:"#9ca3af",key:`gl-${e}`},B[e].toFixed(1)))}for(let e=0;e<T.length;e++){const t=T[e],n=B[B.length-1]*N,r=L+n*Math.cos(t),i=R-n*Math.sin(t);V.push(o("line",{x1:L,y1:R,x2:r,y2:i,stroke:"#e5e7eb","stroke-width":1,key:`al-${e}`}));const l=Math.round(180*t/Math.PI),a=L+(n+14)*Math.cos(t),s=R-(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:L-D,y1:R,x2:L+D,y2:R,stroke:"#d1d5db","stroke-width":1,key:"x-axis"})),V.push(o("line",{x1:L,y1:R-D,x2:L,y2:R+D,stroke:"#d1d5db","stroke-width":1,key:"y-axis"})),Y&&V.push(o("path",{d:Y,fill:"none",stroke:m,"stroke-width":2,key:"curve"}));for(let e=0;e<h.length;e++){const t=h[e],{x:n,y:r}=vt(t.r,t.theta,L,R,N);V.push(o("circle",{cx:n,cy:r,r:x,fill:y,key:`pt-${e}`,style:{cursor:"pointer"},onClick:U(b,t,e),onDblClick:U(S,t,e),onContextMenu:U(k,t,e),onMouseEnter:U(v,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:_,onMouseMove:q,onMouseUp:O,onMouseLeave:O,onWheel:G},...V)},exports.Popover=function(e){const{trigger:t,content:n,open:r,placement:i="bottom",offset:d=4,arrow:f=!1,closeOnClickOutside:p=!0,onOpenChange:u}=e,h=void 0!==r,[g,x]=l(!1),y=h?r:g,m=c(null),b=s(()=>{h?u&&u(!r):x(e=>!e)},[h,r,u]);a(()=>{if(!y||!p)return;const e=e=>{m.current&&!m.current.contains(e.target)&&(h?u&&u(!1):x(!1))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[y,p,h,u]);const S={...Ve(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"},k=[n];f&&k.push(o("div",{style:Xe(i)}));const v=s(e=>{const t=e.key;"Enter"!==t&&" "!==t||(e.preventDefault(),b())},[b]),w=[o("div",{onClick:b,onKeyDown:v,role:"button",tabIndex:0,style:{display:"inline-block"}},t)];return y&&w.push(o("div",{style:S},...k)),o("div",{ref:m,style:{position:"relative",display:"inline-block"}},...w)},exports.ProgressBar=function(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();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 p=e.animated||e.indeterminate?`@keyframes liq-shimmer-${c}{0%{background-position:-200% 0}100%{background-position:200% 0}}`:"",u=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%"}},p||u?o("style",null,p+u):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})))},exports.RadarChart=function(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:p=!0,gridColor:u="#d1d5db",title:h}=e,g=t.length,x=h?30:0,y=f&&n.length>0?30:0,m=Math.min((r-120)/2,(i-120-x-y)/2),b=r/2,S=60+x+m,k=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]),v=s(()=>{if(g<3)return[];const e=[];for(let t=1;t<=l;t++){const n=m*t/l,r=[];for(let e=0;e<g;e++){const t=wo(e,g),o=$o(b,S,n,t);r.push(`${o.x},${o.y}`)}e.push(o("polygon",{key:`ring-${t}`,points:r.join(" "),fill:"none",stroke:u,"stroke-width":t===l?"1.5":"0.5","stroke-dasharray":t===l?"none":"3 2"}))}for(let t=0;t<g;t++){const n=wo(t,g),r=$o(b,S,m,n);e.push(o("line",{key:`spoke-${t}`,x1:String(b),y1:String(S),x2:String(r.x),y2:String(r.y),stroke:u,"stroke-width":"0.75"}))}return e},[g,l,m,b,S,u]),w=s(()=>{if(!a||g<3)return[];const e=[];for(let n=0;n<g;n++){const r=wo(n,g),i=$o(b,S,m+16,r);let l="middle";i.x<b-5?l="end":i.x>b+5&&(l="start");const a=Math.abs(i.y-S)<5?"0.35em":i.y<S?"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:"#374151"},t[n]?.label??`Axis ${n}`))}return e},[a,g,t,m,b,S]),$=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=k[e],d=Math.min(n/s,1),f=m*d,u=wo(e,g),h=$o(b,S,f,u);i.push(`${h.x},${h.y}`),p&&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,k,m,b,S,p,c]),M=s(()=>{if(!f||0===n.length)return[];const e=[],t=S+m+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:"#374151"},l.label))}return e},[f,n,b,S,m]),C=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]);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:"#6b7280"},"Radar chart requires at least 3 axes."));const z=v(),I=w(),A=$(),F=M(),L=C();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Radar chart",style:{fontFamily:"sans-serif"}},...L,...z,...I,...A,...F)},exports.RadioGroup=function(e){const{options:t,value:n,onChange:r,name:i,direction:l="vertical",disabled:a=!1,error:d,label:c}=e,f=s(e=>{a||r(e)},[a,r]),p=s(e=>{if(a)return;const o=t.filter(e=>!e.disabled);if(0===o.length)return;const i=o.findIndex(e=>e.value===n);let l=i;if("ArrowDown"===e.key||"ArrowRight"===e.key)e.preventDefault(),l=i<o.length-1?i+1:0;else{if("ArrowUp"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault(),l=i>0?i-1:o.length-1}r(o[l].value)},[a,t,n,r]),u={display:"flex",flexDirection:"horizontal"===l?"row":"column",gap:"horizontal"===l?"16px":"8px"},h=t.map(e=>{const t=e.value===n,r=a||!!e.disabled,l={width:"18px",height:"18px",minWidth:"18px",borderRadius:"50%",border:"2px solid "+(d?"#ef4444":t?"#3b82f6":"#d1d5db"),display:"flex",alignItems:"center",justifyContent:"center",transition:"border-color 0.15s",boxSizing:"border-box"},s={width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"#3b82f6",transition:"transform 0.15s",transform:t?"scale(1)":"scale(0)"},c={display:"inline-flex",alignItems:"center",gap:"8px",cursor:r?"not-allowed":"pointer",opacity:r?"0.5":"1",userSelect:"none"};return o("label",{key:e.value,style:c,onClick:r?void 0:t=>{t.preventDefault(),f(e.value)}},o("input",{type:"radio",name:i,value:e.value,checked:t,disabled:r,style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},tabIndex:-1}),o("div",{style:l},o("div",{style:s})),o("span",{style:{fontSize:"14px",color:"#374151"}},e.label))});return o(te,{label:c,error:d},o("div",{style:u,role:"radiogroup","aria-label":c,onKeyDown:p,tabIndex:a?-1:0},...h))},exports.SankeyDiagram=function(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:p=.4,colors:u=Mo,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),p=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),u=new Map,h=new Map;for(const e of f)u.set(e,0),h.set(e,0);for(const e of c)h.set(e.source,(h.get(e.source)??0)+e.value),u.set(e.target,(u.get(e.target)??0)+e.value);let g=0;for(const e of p.values())e>g&&(g=e);const x=new Map;for(let e=0;e<=g;e++)x.set(e,[]);for(const[e,t]of p)x.get(t).push(e);const y=new Map,m=g>0?(s-r)/g:0;for(let e=0;e<=g;e++)y.set(e,l+e*m);const b=new Map;for(let t=0;t<e.length;t++)b.set(e[t].id,e[t]);const S=[],k=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=u.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=u.get(r)??0,f=h.get(r)??0,p=Math.max(d,f,1),g=Math.max(4,p*s),x=e.findIndex(e=>e.id===r),m={id:r,label:l.label,color:l.color??a[x%a.length],column:t,x:y.get(t),y:c,height:g,totalIn:d,totalOut:f,totalValue:p};S.push(m),k.set(r,m),c+=g+i}}const v=new Map,w=new Map;for(const e of f)v.set(e,0),w.set(e,0);const $=[...c].sort((e,t)=>t.value-e.value),M=[];for(const e of $){const t=k.get(e.source),n=k.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=v.get(e.source),d=w.get(e.target),c=t.y+s+i/2,f=n.y+d+l/2;v.set(e.source,s+i),w.set(e.target,d+l);const p=b.get(e.source);M.push({source:e.source,target:e.target,value:e.value,color:e.color??p?.color??t.color,sourceY:c,targetY:f,width:a})}return{layoutNodes:S,layoutLinks:M}}(t,n,r,i,l,a,g,u),[t,n,r,i,l,a,g,u]),y=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(p),"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,p,f]),m=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]),S=y(),k=m(),v=b();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Sankey diagram",style:{fontFamily:"sans-serif"}},...v,...S,...k)},exports.ScrollContainer=function(e){const t=e.direction??"vertical",n=e.showScrollbar??"auto",r=e.shadow??!1,i=c(null),[f,p]=l(!0),[u,h]=l(!1),[g,x]=l(!0),[y,m]=l(!1),b=s(()=>{const e=i.current;e&&(p(e.scrollTop<=2),h(e.scrollTop+e.clientHeight>=e.scrollHeight-2),x(e.scrollLeft<=2),m(e.scrollLeft+e.clientWidth>=e.scrollWidth-2))},[]);a(()=>{b()},[b]);const S=s(()=>{r&&b()},[r,b]),k=d(()=>{const o={position:"relative",overflowX:be(t,"x"),overflowY:be(t,"y"),...Se(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]),v=[];if(r){const e="vertical"===t||"both"===t,n="horizontal"===t||"both"===t;e&&!f&&v.push("inset 0 8px 6px -6px rgba(0,0,0,0.15)"),e&&!u&&v.push("inset 0 -8px 6px -6px rgba(0,0,0,0.15)"),n&&!g&&v.push("inset 8px 0 6px -6px rgba(0,0,0,0.15)"),n&&!y&&v.push("inset -8px 0 6px -6px rgba(0,0,0,0.15)")}const w={...k};return v.length>0&&(w.boxShadow=v.join(", ")),o("div",{className:`scroll-container scroll-container--${t} ${e.className??""}`.trim(),style:w,ref:i,onScroll:S},e.children)},exports.Select=function(e){const t=e.id??`sel-${Math.random().toString(36).slice(2,8)}`,{options:n,value:r,onChange:i,placeholder:f="Select...",searchable:p=!1,multiple:u=!1,clearable:h=!1,disabled:g=!1,error:x,label:y,helpText:m}=e,[b,S]=l(!1),[k,v]=l(""),[w,$]=l(-1),M=c(null),C=d(()=>Array.isArray(r)?r:r?[r]:[],[r]),z=d(()=>{if(!p||!k)return n;const e=k.toLowerCase();return n.filter(t=>t.label.toLowerCase().includes(e))},[n,k,p]),I=d(()=>{const e={},t=[];for(const n of z)n.group?(e[n.group]||(e[n.group]=[]),e[n.group].push(n)):t.push(n);return{groups:e,ungrouped:t}},[z]),A=d(()=>0===C.length?"":C.map(e=>n.find(t=>t.value===e)).filter(Boolean).map(e=>e.label).join(", "),[C,n]);a(()=>{const e=e=>{const t=e.target;M.current&&!M.current.contains(t)&&(S(!1),v(""))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const F=s(e=>{if(u){const t=C.includes(e)?C.filter(t=>t!==e):[...C,e];i(t)}else i(e),S(!1),v("")},[u,C,i]),L=s(e=>{e.stopPropagation(),i(u?[]:"")},[u,i]),R=s(e=>{if(g)return;const t=e.key;if(!b&&("Enter"===t||" "===t||"ArrowDown"===t))return e.preventDefault(),S(!0),void $(0);if(b){if("Escape"===t)return S(!1),void v("");if("ArrowDown"===t)e.preventDefault(),$(e=>Math.min(e+1,z.length-1));else if("ArrowUp"===t)e.preventDefault(),$(e=>Math.max(e-1,0));else if("Enter"===t&&w>=0&&w<z.length){e.preventDefault();const t=z[w];t.disabled||F(t.value)}}},[g,b,w,z,F]),D={...ne({},{focused:b,error:!!x}),display:"flex",alignItems:"center",justifyContent:"space-between",cursor:g?"not-allowed":"pointer",minHeight:"38px",userSelect:"none"},N=(e,t)=>{const n=C.includes(e.value),r=t===w,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:()=>F(e.value),onMouseEnter:()=>$(t),role:"option","aria-selected":n?"true":"false","aria-disabled":e.disabled?"true":void 0},u&&n?o("span",{style:{color:"#3b82f6",fontWeight:"700"}},"✓"):null,e.label)},B=o("span",{style:{marginLeft:"8px",fontSize:"10px",transition:"transform 0.15s",transform:b?"rotate(180deg)":"rotate(0deg)",color:"#6b7280"}},"▼"),T=o("div",{style:D,id:t,onClick:g?void 0:()=>{S(!b),$(-1)},onKeyDown:R,tabIndex:g?-1:0,role:"combobox","aria-expanded":b?"true":"false","aria-haspopup":"listbox"},o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:A?"#1f2937":"#9ca3af"}},A||f),o("span",{style:{display:"flex",alignItems:"center",gap:"4px"}},h&&C.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,B)),W=p&&b?o("input",{type:"text",value:k,onInput:e=>{v(e.target.value),$(0)},placeholder:"Search...",style:{width:"100%",boxSizing:"border-box",padding:"8px 12px",border:"none",borderBottom:"1px solid #e5e7eb",outline:"none",fontSize:"14px"}}):null,E=b?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"},W,...(()=>{const e=[];let t=0;const{groups:n,ungrouped:r}=I;for(const n of r)e.push(N(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(N(o,t++))}return 0===e.length&&e.push(o("div",{style:{padding:"8px 12px",color:"#9ca3af",fontSize:"14px"}},"No options")),e})()):null;return o(te,{label:y,error:x,helpText:m,disabled:g,htmlFor:t},o("div",{ref:M,style:{position:"relative"}},T,E))},exports.Sidebar=function(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(Te,{key:e.id,item:e,collapsed:n,selectedId:i,onSelect:l,depth:0}));return o(ve,{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)},exports.Skeleton=function(e){const t=e.variant??"text",n=!1!==e.animated,r=f(),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:J({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:J({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:J({width:l??"100%",height:a??"100px",borderRadius:e.borderRadius??"4px",animated:n,animId:r})}))},exports.Slider=function(e){const t=e.id??`sl-${Math.random().toString(36).slice(2,8)}`,{value:n,onChange:r,min:i=0,max:f=100,step:p=1,showValue:u=!1,showTicks:h=!1,disabled:g=!1,marks:x,range:y=!1,label:m,error:b}=e,S=c(null),[k,v]=l(null),w=d(()=>{if(y&&Array.isArray(n))return n;const e="number"==typeof n?n:0;return[e,e]},[n,y]),$=e=>{const t=Math.round((e-i)/p)*p+i;return Math.max(i,Math.min(f,t))},M=e=>(e-i)/(f-i)*100,C=s(e=>{if(!S.current)return i;const t=S.current.getBoundingClientRect(),n=Math.max(0,Math.min(1,(e.clientX-t.left)/t.width));return $(i+n*(f-i))},[i,f,p]),z=s(e=>t=>{g||(t.preventDefault(),v(e))},[g]),I=s(e=>{if(g)return;const t=C(e);if(y){const e=Math.abs(t-w[0]),n=Math.abs(t-w[1]);r(e<=n?[$(t),w[1]]:[w[0],$(t)])}else r($(t))},[g,C,y,w,r,i,f,p]);a(()=>{if(!k)return;const e=e=>{const t=C(e);"single"===k?r($(t)):"start"===k?r([Math.min($(t),w[1]),w[1]]):"end"===k&&r([w[0],Math.max(w[0],$(t))])},t=()=>v(null);return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[k,C,w,r,i,f,p]);const A=s(e=>{if(g)return;let t=0;if("ArrowRight"===e.key||"ArrowUp"===e.key)t=p;else{if("ArrowLeft"!==e.key&&"ArrowDown"!==e.key)return;t=-p}e.preventDefault(),y||r($(("number"==typeof n?n:0)+t))},[g,p,y,n,r,i,f]),F={position:"relative",width:"100%",height:"6px",backgroundColor:"#e5e7eb",borderRadius:"3px",cursor:g?"not-allowed":"pointer"},L=y?M(w[0]):0,R={position:"absolute",top:"0",left:`${L}%`,width:M(y?w[1]:w[0])-L+"%",height:"100%",backgroundColor:g?"#9ca3af":"#3b82f6",borderRadius:"3px"},D=e=>m?"start"===e?`${m} minimum`:"end"===e?`${m} maximum`:m:"start"===e?"Minimum value":"end"===e?"Maximum value":"Value",N=(e,n,r)=>o("div",{id:"single"===n||"start"===n?t:void 0,style:{position:"absolute",top:"50%",left:`${e}%`,transform:"translate(-50%, -50%)",width:"18px",height:"18px",borderRadius:"50%",backgroundColor:"#ffffff",border:"2px solid "+(g?"#9ca3af":"#3b82f6"),cursor:g?"not-allowed":"grab",boxShadow:"0 1px 3px rgba(0,0,0,0.15)",zIndex:"2"},onMouseDown:z(n),role:"slider","aria-valuenow":String(r),"aria-valuemin":String(i),"aria-valuemax":String(f),"aria-label":D(n),tabIndex:g?-1:0,onKeyDown:A},u?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(h)for(let e=i;e<=f;e+=p)B.push(o("div",{key:`tick-${e}`,style:{position:"absolute",top:"10px",left:`${M(e)}%`,width:"1px",height:"6px",backgroundColor:"#d1d5db",transform:"translateX(-50%)"}}));const T=[];if(x)for(const e of x)T.push(o("div",{key:`mark-${e.value}`,style:{position:"absolute",top:"18px",left:`${M(e.value)}%`,transform:"translateX(-50%)",fontSize:"11px",color:"#6b7280",whiteSpace:"nowrap"}},e.label));const W={paddingTop:u?"28px":"8px",paddingBottom:x||h?"28px":"8px",opacity:g?"0.6":"1"},E=[];return y?(E.push(N(M(w[0]),"start",w[0])),E.push(N(M(w[1]),"end",w[1]))):E.push(N(M(w[0]),"single",w[0])),o(te,{label:m,error:b,htmlFor:t},o("div",{style:W},o("div",{ref:S,style:F,onClick:I},o("div",{style:R}),...E,...B,...T)))},exports.Spinner=function(e){const t="number"==typeof e.size?e.size:Q[e.size??"md"]??24,n=e.color??"#3b82f6",r=e.thickness??Math.max(2,Math.round(t/8)),i=ee[e.speed??"normal"]??ee.normal,l=e.label??"Loading",a=f(),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))},exports.Splitter=function(e){const t=e.direction??"horizontal",n="horizontal"===t,r=e.dividerSize??6,i=e.minSize??50,[f,p]=l(e.initialSplit??50),u=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||!u.current)return;const o=u.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)),p(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]),y=n?{width:`calc(${f}% - ${r/2}px)`,overflow:"auto",flexShrink:"0"}:{height:`calc(${f}% - ${r/2}px)`,overflow:"auto",flexShrink:"0"},m={flexShrink:"0",backgroundColor:"#e5e7eb",transition:"background-color 0.15s",...n?{width:`${r}px`,cursor:"col-resize",height:"100%"}:{height:`${r}px`,cursor:"row-resize",width:"100%"}},b=Array.isArray(e.children)?e.children:[];return o("div",{className:`splitter splitter--${t} ${e.className??""}`.trim(),style:x,ref:u},o("div",{className:"splitter__pane splitter__pane--first",style:y},b[0]??null),o("div",{className:"splitter__divider",style:m,onMouseDown:g,onKeyDown:e=>{const t=e.key;!n||"ArrowLeft"!==t&&"ArrowRight"!==t?n||"ArrowUp"!==t&&"ArrowDown"!==t||(e.preventDefault(),p(e=>{const n="ArrowDown"===t?2:-2;return Math.max(5,Math.min(95,e+n))})):(e.preventDefault(),p(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))},exports.Stepper=function(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,p=s(e=>{l&&i&&i(e)},[l,i]),u=[];return t.forEach((e,r)=>{u.push(((e,t)=>{const r=(e=>e<n?"completed":e===n?"active":"pending")(t),i="active"===r,s="completed"===r,u=((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"}},u,g);return o(l?"button":"div",{key:String(t),onClick:l?()=>p(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&&u.push(i)}),o("div",{role:"navigation","aria-label":"Progress steps",style:{display:"flex",flexDirection:d?"row":"column",alignItems:d?"flex-start":"stretch",width:"100%"}},...u)},exports.Sunburst=function(e){const{data:t,width:n=500,height:r=500,innerRadius:i=40,showLabels:l=!0,colors:a=Co,strokeColor:s="#ffffff",strokeWidth:c=1,title:f}=e,p=n/2,u=r/2,h=f?20:0,g=Math.min(p,u-h)-10;if(d(()=>Io(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(p),y:String(u),"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=Io(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:zo,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=Io(o);if(r<=0)continue;const l=r/i*zo;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=Io(n);if(f<=0)continue;const p=t+d*a,u=p+a;if(r.push({startAngle:i,endAngle:l,innerR:p,outerR:u,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=Io(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]),y=[];f&&y.push(o("text",{key:"title",x:String(p),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},f));const m=u+h/2;for(let e=0;e<x.length;e++){const t=x[e],n=Ao(p,m,t.innerR,t.outerR,t.startAngle,t.endAngle);if(y.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=p+i*Math.cos(r),s=m+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;y.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"}},...y)},exports.Tabs=function(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,p=c(null),u=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(),u(o[s].id);const t=p.current;if(t){const n=t.querySelectorAll('[role="tab"]')[e.tabs.indexOf(o[s])];n&&n.focus()}}},[e.tabs,f,t,u]),g="left"===t||"right"===t,x="bottom"===t||"right"===t,y=d(()=>({display:"flex",flexDirection:g?x?"row-reverse":"row":x?"column-reverse":"column",width:"100%",...e.style??{}}),[g,x,e.style]),m={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),S=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:()=>u(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:y},o("div",{className:"tabs__list",role:"tablist","aria-orientation":g?"vertical":"horizontal",style:m,ref:p},...S),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))},exports.Tag=function(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,t,n,o,r){const i=V[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:U(e,.12),color:e,border:"none"};default:return l}}(function(e){return e??"#3b82f6"}(n),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:X,onClick:e=>{e.stopPropagation(),!c&&a&&a()},"aria-label":`Remove ${t}`,disabled:c},"×")),o("span",{style:f,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)},exports.TextEditor=function(e){const[t,n]=l(!1),r=c(null),i=e.id??`te-${Math.random().toString(36).slice(2,8)}`,d=e.toolbar??pe,f=e.toolbarStyle??{},p=e.editorStyle??{};a(()=>{r.current&&void 0!==e.value&&(r.current.innerHTML=e.value)},[]);const u=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]),h=s(()=>{r.current&&e.onChange&&e.onChange(r.current.innerHTML)},[e.onChange]),g=s(()=>{n(!1),r.current&&e.onBlur&&e.onBlur(r.current.innerHTML)},[e.onBlur]),x=o("div",{className:"texteditor-toolbar",style:{display:"flex",flexWrap:"wrap",gap:"2px",padding:"6px 8px",backgroundColor:f.backgroundColor??"#f9fafb",borderBottom:f.borderBottom??"1px solid #e5e7eb",borderRadius:"6px 6px 0 0"}},...d.map(t=>{const n=ue[t];return n?o("button",{key:t,type:"button",title:n.label,onClick:()=>u(n.command,n.value),disabled:e.disabled||e.readOnly,style:{padding:"4px 8px",border:"none",borderRadius:"4px",backgroundColor:"transparent",color:f.buttonColor??"#374151",cursor:e.disabled?"not-allowed":"pointer",fontSize:f.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})),y=o("div",{ref:r,id:i,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:p.padding??"12px 14px",minHeight:e.minHeight??"200px",maxHeight:e.maxHeight??"none",overflow:"auto",backgroundColor:p.backgroundColor??"#ffffff",color:p.color??"#1f2937",fontFamily:p.fontFamily??"inherit",fontSize:p.fontSize??"14px",lineHeight:p.lineHeight??"1.6",outline:"none",borderRadius:"0 0 6px 6px",border:t?"1px solid #3b82f6":e.error?"1px solid #ef4444":"1px solid #d1d5db",borderTop:"none",transition:"border-color 0.15s"},onFocus:()=>n(!0),onBlur:g,onInput:h});return o(te,{label:e.label,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"}},x,y))},exports.TextField=function(e){const[t,n]=l(!1),r=e.id??`tf-${Math.random().toString(36).slice(2,8)}`,i=ne(e.inputStyle??{},{focused:t,error:!!e.error}),a=!(!e.prefix&&!e.suffix),s=o("input",{type:e.type??"text",id:r,name:e.name,value:e.value,placeholder:e.placeholder,maxLength:e.maxLength?String(e.maxLength):void 0,pattern:e.pattern,autoComplete:e.autoComplete,autoFocus:e.autoFocus,readOnly:e.readOnly,disabled:e.disabled,"aria-invalid":e.error?"true":void 0,"aria-required":e.required?"true":void 0,className:`textfield-input ${e.className??""}`.trim(),style:a?{...i,border:"none",boxShadow:"none",flex:"1",minWidth:"0"}:i,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)}}),d=a?o("div",{style:{...i,display:"flex",alignItems:"center",gap:"8px",padding:"0"}},e.prefix?o("span",{style:{paddingLeft:"10px",color:"#9ca3af",flexShrink:"0"}},e.prefix):null,s,e.suffix?o("span",{style:{paddingRight:"10px",color:"#9ca3af",flexShrink:"0"}},e.suffix):null):s;return o(te,{label:e.label,htmlFor:r,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},d)},exports.ThreeDLayers=function(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:p=!0,layerSpacing:u=2,colorScale:h=bn,gridColor:g="#94a3b8",title:x}=e,y=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]),m=d(()=>{const e=y.maxHeight+(t.length-1)*u+y.maxHeight,o=Math.sqrt(y.maxCols*y.maxCols+y.maxRows*y.maxRows+e*e),i=.75*Math.min(n,r);return o>0?i/o:1},[y,t.length,u,n,r]),b=n/2,S=r/2,k=s((e,t,n)=>function(e,t,n,o,r,i,l,a,s,d){const c=Math.cos(o*Sn),f=Math.sin(o*Sn),p=Math.cos(r*Sn),u=Math.sin(r*Sn),h=Math.cos(i*Sn),g=Math.sin(i*Sn),x=e*h-t*g,y=e*g+t*h,m=x*u+y*p,b=m*f+n*c,S=1+.001*l*b;return{sx:a+(x*p-y*u)*d*S,sy:s-(m*c-n*f)*d*S,depth:b}}(e,t,n,l,a,c,i,b,S,m),[l,a,c,i,b,S,m]),v=s(()=>{if(!p)return[];const e=[];Math.max(y.maxCols,y.maxRows);const n=y.maxCols/2,r=y.maxRows/2,i=k(-n,-r,0),l=k(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=k(-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=y.maxHeight+(t.length-1)*u,d=k(-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},[p,y,t.length,u,k]),w=s(()=>{const e=[],n=y.maxCols/2,r=y.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*u,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,p=o+1-n,u=t-r,h=t+1-r,g=(d[o]??0)+s,x=(d[o+1]??0)+s,y=(c[o]??0)+s,m=(c[o+1]??0)+s,b=k(f,u,g),S=k(p,u,x),v=k(f,h,y),w=k(p,h,m),$=(b.depth+S.depth+v.depth+w.depth)/4,M=`${b.sx},${b.sy} ${S.sx},${S.sy} ${w.sx},${w.sy} ${v.sx},${v.sy}`;i.push({points:M,fill:kn(l,a),stroke:vn(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,p=(d[o]??0)+s,u=k(c,f,p),h=3,g=`${u.sx},${u.sy-h} ${u.sx+h},${u.sy} ${u.sx},${u.sy+h} ${u.sx-h},${u.sy}`;i.push({points:g,fill:kn(l,a),stroke:vn(l,.7),strokeWidth:"0.5",depth:u.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,y,u,h,k]),$=s(()=>{const e=[],t=y.maxCols/2,n=y.maxRows/2;for(let r=0;r<=y.maxRows;r++){const i=r-n,l=k(-t,i,0),a=k(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<=y.maxCols;r++){const i=r-t,l=k(i,-n,0),a=k(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},[y,g,k]),M=s(()=>{if(!f)return[];const e=[],n=y.maxCols/2;y.maxRows;for(let r=0;r<t.length;r++){const i=t[r],l=r*u;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=k(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,y,u,h,k]),C=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])(),z=$(),I=v(),A=w(),F=M(),L=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%"}},...C,...L,...z,...I,...A,...F)},exports.TimePicker=function(e){const t=e.id??`tp-${Math.random().toString(36).slice(2,8)}`,{value:n,onChange:r,format:i="24h",minuteStep:a=1,disabled:c=!1,label:f,error:p,showSeconds:u=!1,timezone:h,showTimezone:g=!1,timezones:x=he,onTimezoneChange:y}=e,[m,b]=l(!1),S=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}}(n),[n]),k="12h"===i,v=S.hour>=12,w=k?S.hour%12||12:S.hour,$=s((e,t,n)=>{const o=Math.max(0,Math.min(23,e)),i=Math.max(0,Math.min(59,t)),l=Math.max(0,Math.min(59,n??0));r(u?`${ge(o)}:${ge(i)}:${ge(l)}`:`${ge(o)}:${ge(i)}`)},[r,u]),M=s(e=>{let t=parseInt(e.target.value,10)||0;k&&(t%=12,v&&(t+=12)),$(t,S.minute,S.second)},[k,v,S.minute,S.second,$]),C=s(e=>{const t=parseInt(e.target.value,10)||0;$(S.hour,t,S.second)},[S.hour,S.second,$]),z=s(e=>{const t=parseInt(e.target.value,10)||0;$(S.hour,S.minute,t)},[S.hour,S.minute,$]),I=s(()=>{if(c)return;const e=v?S.hour-12:S.hour+12;$(e,S.minute,S.second)},[c,v,S.hour,S.minute,S.second,$]),A=s(e=>{c||$(S.hour+e,S.minute,S.second)},[c,S.hour,S.minute,S.second,$]),F=s(e=>{c||$(S.hour,S.minute+e*a,S.second)},[c,S.hour,S.minute,S.second,a,$]),L=s(e=>{c||$(S.hour,S.minute,S.second+e)},[c,S.hour,S.minute,S.second,$]),R=s(e=>{const t=e.target.value;y&&y(t)},[y]),D={display:"inline-flex",alignItems:"center",gap:"4px",...ne({},{focused:m,error:!!p})},N={display:"flex",flexDirection:"column",alignItems:"center"},B={background:"none",border:"none",cursor:c?"not-allowed":"pointer",fontSize:"10px",padding:"0 4px",color:"#6b7280",lineHeight:"1"},T={width:"32px",textAlign:"center",border:"none",outline:"none",fontSize:"14px",fontFamily:"monospace",backgroundColor:"transparent",color:"#1f2937",padding:"0"},W={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:c?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},E=o("div",{style:N},o("button",{type:"button",style:B,onClick:()=>A(1),disabled:c},"▲"),o("input",{type:"text",value:ge(w),onChange:M,style:T,disabled:c,"aria-label":"Hour",onFocus:()=>b(!0),onBlur:()=>b(!1)}),o("button",{type:"button",style:B,onClick:()=>A(-1),disabled:c},"▼")),P=o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"),H=o("div",{style:N},o("button",{type:"button",style:B,onClick:()=>F(1),disabled:c},"▲"),o("input",{type:"text",value:ge(S.minute),onChange:C,style:T,disabled:c,"aria-label":"Minute",onFocus:()=>b(!0),onBlur:()=>b(!1)}),o("button",{type:"button",style:B,onClick:()=>F(-1),disabled:c},"▼")),j=u?o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"):null,Y=u?o("div",{style:N},o("button",{type:"button",style:B,onClick:()=>L(1),disabled:c},"▲"),o("input",{type:"text",value:ge(S.second),onChange:z,style:T,disabled:c,"aria-label":"Second",onFocus:()=>b(!0),onBlur:()=>b(!1)}),o("button",{type:"button",style:B,onClick:()=>L(-1),disabled:c},"▼")):null,_=k?o("button",{type:"button",style:W,onClick:I,disabled:c,"aria-label":"Toggle AM/PM"},v?"PM":"AM"):null,q={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:c?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},O=h&&!g?o("span",{style:{marginLeft:"8px",fontSize:"12px",fontWeight:"600",color:"#6b7280"}},h):null,G=g?o("select",{style:q,value:h??x[0],onChange:R,disabled:c,"aria-label":"Timezone"},...x.map(e=>o("option",{key:e,value:e},e))):null,U=[E,P,H];return j&&U.push(j),Y&&U.push(Y),_&&U.push(_),O&&U.push(O),G&&U.push(G),o(te,{label:f,error:p,disabled:c,htmlFor:t},o("div",{id:t,style:D},...U))},exports.ToastContainer=et,exports.Toggle=function(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=xe[a],p=s(()=>{l||n(!t)},[l,t,n]),u=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)"},y={display:"inline-flex",alignItems:"center",gap:"8px",opacity:l?"0.5":"1",userSelect:"none"},m=r?o("span",{style:{fontSize:"14px",color:"#374151"}},r):null,b=o("div",{style:h},o("div",{style:x}));return o("div",{style:y,onClick:p,onKeyDown:u,tabIndex:l?-1:0,role:"switch","aria-checked":t?"true":"false","aria-disabled":l?"true":void 0,"aria-label":r},...("left"===i?[m,b]:[b,m]).filter(Boolean))},exports.Toolbar=function(e){const{items:t,size:n="md",variant:r="flat"}=e,i=We[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(Ee,{key:e.id,item:e,size:n,variant:r}));return o(ve,{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)},exports.Tooltip=function(e){const{text:t,placement:n="top",delay:r=200,maxWidth:i="250px",children:d}=e,[f,p]=l(!1),[u,h]=l(null),g=c(null),x=c(null),y=`tooltip-${Math.random().toString(36).slice(2,9)}`,m=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))}p(!0)},r)},[r,n]),b=s(()=>{x.current&&(clearTimeout(x.current),x.current=null),p(!1)},[]);a(()=>()=>{x.current&&clearTimeout(x.current)},[]);const S={...u??{},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"},k=[o("div",{ref:g,style:{display:"inline-block"},onMouseEnter:m,onMouseLeave:b,onFocus:m,onBlur:b,"aria-describedby":f?y:void 0},d)];return f&&u&&k.push(o("div",{id:y,style:S,role:"tooltip"},t,o("div",{style:tt(n)}))),o("div",{style:{display:"inline-block",position:"relative"}},...k)},exports.TradingDashboard=function(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"}),[]),p=189.42+t,u={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:u}),"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"},cn(r)))}const p=[],u=Math.min(sn.length,e.length),h=(e.length-1)/(u-1);for(let e=0;e<u;e++){const t=40+Math.round(e*h)*a;p.push(o("text",{key:`tl${e}`,x:String(t.toFixed(1)),y:String(156),fill:"#6666aa",fontSize:"8",textAnchor:"middle",fontFamily:"monospace"},sn[e]))}const g="chartGrad";return o("div",{style:fn},o("div",{style:pn},"AAPL ",o("span",{style:{color:"#00c853",fontSize:"14px",fontWeight:"700"}},`$${cn(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,...p,...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"})))}(rn,p),function(){const e=Math.max(...en.map(e=>e.qty),...tn.map(e=>e.qty));return o("div",{style:fn},o("div",{style:pn},"Order Book"),o("table",{style:un},o("thead",null,o("tr",null,o("th",{style:hn},"Bid Price"),o("th",{style:hn},"Qty"),o("th",{style:hn},"Ask Price"),o("th",{style:hn},"Qty"))),o("tbody",null,...en.map((t,n)=>{const r=tn[n],i=t.qty/e*.25,l=(r?.qty??0)/e*.25;return o("tr",{key:String(n),style:xn},o("td",{style:{...gn,color:"#00c853",backgroundColor:`rgba(0,200,83,${i.toFixed(3)})`,fontFamily:"monospace"}},cn(t.price)),o("td",{style:{...gn,backgroundColor:`rgba(0,200,83,${(.5*i).toFixed(3)})`,fontFamily:"monospace"}},dn(t.qty)),o("td",{style:{...gn,color:"#ff1744",backgroundColor:`rgba(255,23,68,${l.toFixed(3)})`,fontFamily:"monospace"}},r?cn(r.price):""),o("td",{style:{...gn,backgroundColor:`rgba(255,23,68,${(.5*l).toFixed(3)})`,fontFamily:"monospace"}},r?dn(r.qty):""))}))))}(),function(e){return o("div",{style:fn},o("div",{style:pn},"Watchlist"),o("table",{style:un},o("thead",null,o("tr",null,o("th",{style:hn},"Symbol"),o("th",{style:hn},"Price"),o("th",{style:hn},"Chg%"),o("th",{style:hn},"Volume"))),o("tbody",null,...Qt.map((t,n)=>{const r=t.price+(0===n?e:0),i=t.change>=0;return o("tr",{key:String(n),style:xn},o("td",{style:{...gn,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:{...gn,fontFamily:"monospace"}},cn(r)),o("td",{style:{...gn,color:i?"#00c853":"#ff1744",fontWeight:"600"}},`${i?"+":""}${cn(t.change)}%`),o("td",{style:{...gn,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=nn.reduce((e,t)=>e+t.pnl,0),t=e>=0;return o("div",{style:fn},o("div",{style:pn},"Positions",o("span",{style:{marginLeft:"12px",color:t?"#00c853":"#ff1744",fontWeight:"700",fontSize:"12px"}},`${t?"+":""}$${cn(e)}`)),o("table",{style:un},o("thead",null,o("tr",null,o("th",{style:hn},"Symbol"),o("th",{style:hn},"Qty"),o("th",{style:hn},"Avg"),o("th",{style:hn},"P&L"))),o("tbody",null,...nn.map((e,t)=>{const n=e.pnl>=0;return o("tr",{key:String(t),style:{...xn,backgroundColor:n?"rgba(0,200,83,0.04)":"rgba(255,23,68,0.04)"}},o("td",{style:{...gn,fontWeight:"600",color:"#ffffff"}},e.symbol),o("td",{style:{...gn,fontFamily:"monospace"}},String(e.qty)),o("td",{style:{...gn,fontFamily:"monospace"}},cn(e.avgPrice)),o("td",{style:{...gn,color:n?"#00c853":"#ff1744",fontWeight:"700",fontFamily:"monospace"}},`${n?"+":""}$${cn(e.pnl)}`))}))))}(),o("div",{style:fn},o("div",{style:pn},"Recent Trades"),o("table",{style:un},o("thead",null,o("tr",null,o("th",{style:hn},"Time"),o("th",{style:hn},"Sym"),o("th",{style:hn},"Side"),o("th",{style:hn},"Qty"),o("th",{style:hn},"Price"))),o("tbody",null,...on.map((e,t)=>{const n="BUY"===e.side;return o("tr",{key:String(t),style:xn},o("td",{style:{...gn,color:"#8888aa",fontFamily:"monospace"}},e.time),o("td",{style:{...gn,fontWeight:"600",color:"#ffffff"}},e.symbol),o("td",{style:{...gn,color:n?"#00c853":"#ff1744",fontWeight:"600"}},e.side),o("td",{style:{...gn,fontFamily:"monospace"}},dn(e.qty)),o("td",{style:{...gn,fontFamily:"monospace"}},cn(e.price)))})))),function(){const e=Math.max(...ln.map(e=>e.volume),...an.map(e=>e.volume)),t="16px";return o("div",{style:fn},o("div",{style:pn},"Market Depth"),o("div",{style:{flex:"1",display:"flex",flexDirection:"column",gap:"2px",justifyContent:"center"}},...ln.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"}},cn(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"}},dn(n.volume)))),o("div",{style:{height:"1px",backgroundColor:"#2a2a4a",margin:"4px 0"}}),...an.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"}},cn(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"}},dn(n.volume))))))}()))},exports.TreeMap=function(e){const{data:t,width:n=600,height:r=400,showLabels:i=!0,showValues:l=!0,colors:a=Fo,borderColor:s="#ffffff",borderWidth:c=2,padding:f=2,title:p}=e,u=p?30:0,h=f,g=f+u,x=n-2*f,y=r-2*f-u;if(d(()=>Lo(t),[t])<=0||x<=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":p??"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 m=d(()=>function(e,t,n,o,r,i){const l=[],a=[],s=Lo(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=Lo(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=Ro(c,n);for(;s<t.length;){const e=Ro([...c,t[s].area],n);if(e>f)break;d.push(t[s]),c.push(t[s].area),f=e,s++}let p=0;for(const e of c)p+=e;const u=n>0?p/n:0;let h=0;for(let t=0;t<d.length;t++){const n=d[t],s=u>0?n.area/u:0;let c,f,p,g;if(e?(c=r.x,f=r.y+h,p=u,g=s):(c=r.x+h,f=r.y,p=s,g=u),l.push({x:c,y:f,w:p,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=p-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=Lo(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+u,y:r.y,w:r.w-u,h:r.h}:{x:r.x,y:r.y+u,w:r.w,h:r.h-u}}}return l}(t,h,g,x,y,a),[t,h,g,x,y,a]),b=[];p&&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"},p));for(let e=0;e<m.length;e++){const t=m[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":p??"Treemap chart",style:{fontFamily:"sans-serif"}},...b)},exports.TreeNav=function(e){const{root:t,onNodeClick:n,onNodeExpand:r,onNodeCollapse:i,selectedId:a,expandAll:c=!1,lineColor:f="#000",lineWidth:p=1,indentPx:u=20,iconExpanded:h="−",iconCollapsed:g="+",nodeStyle:x={},wrapperStyle:y,renderNode:m}=e,[b,S]=l(()=>{const e=Pe.fromData(t);return c&&He(e),e}),[k,v]=l(t.id),w=d(()=>je(b),[b]),$=s(()=>{S(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,$]),C=s(e=>{v(e.id),n?.(e)},[n]),z=s(e=>{const t=e;if(!k)return;const n=w.findIndex(e=>e.id===k);if(-1===n)return;const o=w[n];switch(t.key){case"ArrowDown":{t.preventDefault();const e=w[n+1];e&&v(e.id);break}case"ArrowUp":{t.preventDefault();const e=w[n-1];e&&v(e.id);break}case"ArrowRight":t.preventDefault(),o.isLeaf()||(o.expanded?o.children.length>0&&v(o.children[0].id):M(o));break;case"ArrowLeft":t.preventDefault(),!o.isLeaf()&&o.expanded?M(o):o.parent&&v(o.parent.id);break;case"Enter":t.preventDefault(),C(o);break;case" ":t.preventDefault(),o.isLeaf()||M(o);break;case"Home":t.preventDefault(),w.length>0&&v(w[0].id);break;case"End":t.preventDefault(),w.length>0&&v(w[w.length-1].id)}},[k,w,M,C]),I=w.map(e=>o(_e,{key:e.id,node:e,isSelected:e.id===a,indentPx:u,lineColor:f,lineWidth:p,iconExpanded:h,iconCollapsed:g,nodeStyle:x,renderNode:m,onToggle:M,onClick:C,focusedId:k}));return o(ve,{role:"tree",ariaLabel:"Tree navigation",styling:y,keyboardNav:!1},o("div",{onKeyDown:z,style:{outline:"none"}},...I))},exports.TreeNode=Pe,exports.UnityDesktop=function(e){const[t,n]=l(-1),[r,i]=l(()=>{const e=new Date;return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}:${String(e.getSeconds()).padStart(2,"0")}`}),[c,f]=l(()=>(new Date).toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"})),[p,u]=l([]),[h,g]=l(-1),[x,y]=l(!1);a(()=>{const e=setInterval(()=>{const e=new Date;i(`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}:${String(e.getSeconds()).padStart(2,"0")}`),f(e.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}))},1e3);return()=>clearInterval(e)},[]);const m=s(e=>{const t=Tt++,n={id:t,appLabel:e.label,appLetter:e.letter,appColor:e.color,minimized:!1};u(e=>[...e,n]),g(t),y(!1)},[]),b=s(e=>{u(t=>t.filter(t=>t.id!==e)),g(t=>t===e?-1:t)},[]),S=s(e=>{u(t=>t.map(t=>t.id===e?{...t,minimized:!t.minimized}:t))},[]),k=s(e=>{g(e),u(t=>t.map(t=>t.id===e?{...t,minimized:!1}:t))},[]),v=s(()=>{y(e=>!e)},[]),w=s((e,t)=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),m(Nt[e]))},[m]),$=d(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'Ubuntu, "Segoe UI", sans-serif',fontSize:"13px",color:"var(--color-text, #ffffff)",overflow:"hidden",position:"relative"}),[]);function M(e){return{width:"12px",height:"12px",borderRadius:"50%",backgroundColor:e,cursor:"pointer",display:"inline-block"}}const C={width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",cursor:"pointer",fontSize:"20px",backgroundColor:t===Nt.length?"rgba(255,255,255,0.15)":"transparent",border:"none",color:"#ffffff",transition:"background 0.15s",marginTop:"auto"},z=p.map((e,t)=>{if(e.minimized)return null;const n=e.id===h,r={width:"420px",minHeight:"280px",backgroundColor:"#ffffff",borderRadius:"6px",boxShadow:n?"0 12px 48px rgba(0,0,0,0.5)":"0 8px 32px rgba(0,0,0,0.4)",display:"flex",flexDirection:"column",overflow:"hidden",position:"absolute",left:80+t%5*30+"px",top:40+t%5*30+"px",zIndex:String(n?100:10+t),transition:"box-shadow 0.15s"},i={height:"32px",backgroundColor:n?"#3c3c3c":"#555",display:"flex",alignItems:"center",padding:"0 10px",gap:"6px",flexShrink:"0",cursor:"default"};return o("div",{key:String(e.id),className:"unity-desktop__window",style:r,onMouseDown:()=>k(e.id)},o("div",{style:i},o("span",{style:M("#e74c3c"),onClick:()=>b(e.id),title:"Close",role:"button","aria-label":`Close ${e.appLabel}`,tabIndex:0}),o("span",{style:M("#f39c12"),onClick:()=>S(e.id),title:"Minimize",role:"button","aria-label":`Minimize ${e.appLabel}`,tabIndex:0}),o("span",{style:M("#2ecc71"),title:"Maximize",role:"button","aria-label":`Maximize ${e.appLabel}`,tabIndex:0}),o("span",{style:{flex:"1",textAlign:"center",fontSize:"12px",color:"#ccc",marginRight:"40px"}},e.appLabel)),o("div",{style:{flex:"1",padding:"16px",fontSize:"13px",color:"#333",lineHeight:"1.5"}},...function(e){switch(e){case"Files":return[o("div",{style:{fontWeight:"600",marginBottom:"8px",color:"#333"}},"Home"),o("div",{style:{display:"flex",flexDirection:"column",gap:"4px"}},o("span",{style:{color:"#555",cursor:"pointer"}},"📁 Documents"),o("span",{style:{color:"#555",cursor:"pointer"}},"📁 Downloads"),o("span",{style:{color:"#555",cursor:"pointer"}},"📁 Music"),o("span",{style:{color:"#555",cursor:"pointer"}},"📁 Pictures"),o("span",{style:{color:"#555",cursor:"pointer"}},"📁 Videos"),o("span",{style:{color:"#555",cursor:"pointer"}},"📄 readme.txt"))];case"Browser":return[o("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"8px"}},o("span",{style:{padding:"4px 8px",backgroundColor:"#eee",borderRadius:"4px",fontSize:"12px",flex:"1",color:"#666"}},"https://example.com")),o("div",{style:{padding:"16px",backgroundColor:"#fafafa",borderRadius:"4px",textAlign:"center",color:"#999"}},"Web page content area")];case"Terminal":return[o("div",{style:{backgroundColor:"#1a1a1a",padding:"12px",borderRadius:"4px",fontFamily:"monospace",fontSize:"12px",color:"#2ecc71",lineHeight:"1.6"}},o("div",null,o("span",{style:{color:"#2ecc71"}},"user@desktop:~$ "),o("span",{style:{color:"#ccc"}},"Welcome to SpecifyJS Desktop")),o("div",null,o("span",{style:{color:"#2ecc71"}},"user@desktop:~$ "),o("span",{style:{color:"#ccc"}},"ls -la")),o("div",{style:{color:"#aaa"}},"total 42"),o("div",null,o("span",{style:{color:"#2ecc71"}},"user@desktop:~$ "),o("span",{style:{color:"#ccc",borderRight:"2px solid #2ecc71"}}," ")))];case"Mail":return[o("div",{style:{fontWeight:"600",marginBottom:"8px",color:"#333"}},"Inbox (3)"),o("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},o("div",{style:{padding:"6px",backgroundColor:"#e8f0fe",borderRadius:"4px",color:"#333",fontSize:"12px"}},"Welcome to SpecifyJS Mail"),o("div",{style:{padding:"6px",backgroundColor:"#f5f5f5",borderRadius:"4px",color:"#333",fontSize:"12px"}},"Your weekly digest"),o("div",{style:{padding:"6px",backgroundColor:"#f5f5f5",borderRadius:"4px",color:"#333",fontSize:"12px"}},"Team standup notes"))];case"Music":return[o("div",{style:{textAlign:"center",padding:"20px",color:"#333"}},o("div",{style:{fontSize:"48px",marginBottom:"12px"}},"🎵"),o("div",{style:{fontWeight:"600",marginBottom:"4px"}},"Now Playing"),o("div",{style:{color:"#666",fontSize:"12px"}},"No track selected"),o("div",{style:{marginTop:"16px",display:"flex",justifyContent:"center",gap:"16px",fontSize:"18px"}},o("span",{style:{cursor:"pointer"}},"⏮"),o("span",{style:{cursor:"pointer"}},"▶"),o("span",{style:{cursor:"pointer"}},"⏭")))];case"Photos":return[o("div",{style:{fontWeight:"600",marginBottom:"8px",color:"#333"}},"Photo Library"),o("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"6px"}},o("div",{style:{width:"60px",height:"60px",backgroundColor:"#ddd",borderRadius:"4px",display:"flex",alignItems:"center",justifyContent:"center",color:"#999"}},"🖼"),o("div",{style:{width:"60px",height:"60px",backgroundColor:"#ddd",borderRadius:"4px",display:"flex",alignItems:"center",justifyContent:"center",color:"#999"}},"🖼"),o("div",{style:{width:"60px",height:"60px",backgroundColor:"#ddd",borderRadius:"4px",display:"flex",alignItems:"center",justifyContent:"center",color:"#999"}},"🖼"))];case"Software":return[o("div",{style:{fontWeight:"600",marginBottom:"8px",color:"#333"}},"Software Center"),o("div",{style:{color:"#666",fontSize:"12px"}},"Browse and install applications"),o("div",{style:{marginTop:"12px",display:"flex",flexDirection:"column",gap:"6px"}},o("div",{style:{padding:"6px",backgroundColor:"#f5f5f5",borderRadius:"4px",color:"#333",fontSize:"12px"}},"📦 Package Manager"),o("div",{style:{padding:"6px",backgroundColor:"#f5f5f5",borderRadius:"4px",color:"#333",fontSize:"12px"}},"📦 Text Editor"),o("div",{style:{padding:"6px",backgroundColor:"#f5f5f5",borderRadius:"4px",color:"#333",fontSize:"12px"}},"📦 Image Viewer"))];case"Settings":return[o("div",{style:{fontWeight:"600",marginBottom:"8px",color:"#333"}},"System Settings"),o("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},o("div",{style:{padding:"6px",backgroundColor:"#f5f5f5",borderRadius:"4px",color:"#333",fontSize:"12px",cursor:"pointer"}},"⚙ General"),o("div",{style:{padding:"6px",backgroundColor:"#f5f5f5",borderRadius:"4px",color:"#333",fontSize:"12px",cursor:"pointer"}},"📶 Network"),o("div",{style:{padding:"6px",backgroundColor:"#f5f5f5",borderRadius:"4px",color:"#333",fontSize:"12px",cursor:"pointer"}},"🔈 Sound"),o("div",{style:{padding:"6px",backgroundColor:"#f5f5f5",borderRadius:"4px",color:"#333",fontSize:"12px",cursor:"pointer"}},"🖥 Display"))];default:return[o("div",{style:{textAlign:"center",color:"#999",padding:"20px"}},`${e} placeholder`)]}}(e.appLabel)))}),I=x?o("div",{className:"unity-desktop__apps-grid",style:{position:"absolute",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(0,0,0,0.75)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"200"},onClick:()=>y(!1)},o("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 80px)",gap:"24px",padding:"40px"},onClick:e=>e.stopPropagation()},...Nt.map(e=>o("div",{key:e.label,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",cursor:"pointer",padding:"12px",borderRadius:"8px",transition:"background 0.15s"},onClick:()=>m(e),role:"button",tabIndex:0,"aria-label":e.label},o("span",{style:{width:"48px",height:"48px",borderRadius:"12px",backgroundColor:e.color,display:"flex",alignItems:"center",justifyContent:"center",fontSize:"20px",fontWeight:"700",color:"#ffffff"}},e.letter),o("span",{style:{color:"#ffffff",fontSize:"11px"}},e.label))))):null;return o("div",{className:`unity-desktop ${e.className??""}`.trim(),style:$},o("div",{className:"unity-desktop__top-panel",style:{width:"100%",height:"28px",backgroundColor:"var(--color-bg, #1a1a1a)",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 12px",boxSizing:"border-box",fontSize:"12px",zIndex:"10",flexShrink:"0",borderBottom:"1px solid var(--color-border, #333)"}},o("span",{style:{fontWeight:"600",cursor:"pointer",padding:"2px 8px",borderRadius:"3px",transition:"background 0.15s"}},"Activities"),o("span",{style:{position:"absolute",left:"50%",transform:"translateX(-50%)"}},`${c} ${r}`),o("div",{style:{display:"flex",alignItems:"center",gap:"10px",fontSize:"14px"}},...Bt.map((e,t)=>o("span",{key:String(t),style:{cursor:"pointer"}},e)),o("span",{style:{fontSize:"12px",marginLeft:"4px",cursor:"pointer"}},"▼"))),o("div",{style:{display:"flex",flex:"1",overflow:"hidden"}},o("nav",{className:"unity-desktop__launcher",style:{width:"48px",backgroundColor:"var(--color-bg, #2c2c2c)",display:"flex",flexDirection:"column",alignItems:"center",paddingTop:"8px",paddingBottom:"8px",gap:"4px",flexShrink:"0",overflowY:"auto",boxSizing:"border-box",borderRight:"1px solid var(--color-border, #444)"},"aria-label":"Application launcher"},...Nt.map((e,r)=>{return o("button",{key:String(r),style:(l=r,{width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",cursor:"pointer",fontSize:"14px",fontWeight:"700",backgroundColor:t===l?"rgba(255,255,255,0.15)":"transparent",border:"none",color:"#ffffff",transition:"background 0.15s"}),title:e.label,"aria-label":e.label,tabIndex:0,onMouseEnter:()=>n(r),onMouseLeave:()=>n(-1),onKeyDown:e=>w(r,e),onClick:()=>m(e)},o("span",{style:(i=e.color,{width:"28px",height:"28px",borderRadius:"50%",backgroundColor:i,display:"flex",alignItems:"center",justifyContent:"center",fontSize:"13px",fontWeight:"700",color:"#ffffff",lineHeight:"1"})},e.letter));var i,l}),o("button",{style:C,title:"Show Applications","aria-label":"Show Applications",tabIndex:0,onMouseEnter:()=>n(Nt.length),onMouseLeave:()=>n(-1),onClick:v},"☰")),o("main",{className:"unity-desktop__desktop",style:{flex:"1",background:"linear-gradient(135deg, #2c001e 0%, #5e2750 50%, #2c001e 100%)",display:"flex",alignItems:"center",justifyContent:"center",overflow:"auto",position:"relative"}},...z.filter(Boolean),I,e.children)))},exports.VectorField=function(e){const{data:t,vectorFunction:n,width:r=600,height:i=600,gridSize:l=15,xRange:a=[-5,5],yRange:c=[-5,5],arrowScale:f=1,arrowColor:p="#3b82f6",showGrid:u=!0,showAxes:h=!0,colorByMagnitude:g=!1,colorScale:x=["#3b82f6","#8b5cf6","#ef4444"],title:y,padding:m=50,tickFontSize:b=10,arrowWidth:S=1.5}=e,k=r-2*m,v=i-2*m,w=a[0],$=a[1],M=c[0],C=c[1],z=$-w,I=C-M,A=s(e=>m+(e-w)/z*k,[m,w,z,k]),F=s(e=>m+(C-e)/I*v,[m,C,I,v]),L=d(()=>{if(t&&t.length>0)return t;if(!n)return[];const e=[],o=Math.max(2,Math.min(50,l)),r=z/(o-1),i=I/(o-1);for(let t=0;t<o;t++)for(let l=0;l<o;l++){const o=w+l*r,a=M+t*i,s=n(o,a),d=Math.sqrt(s.dx*s.dx+s.dy*s.dy);e.push({x:o,y:a,dx:s.dx,dy:s.dy,magnitude:d})}return e},[t,n,l,w,$,M,C,z,I]),R=d(()=>{let e=0;for(let t=0;t<L.length;t++){const n=L[t],o=n.magnitude??Math.sqrt(n.dx*n.dx+n.dy*n.dy);o>e&&(e=o)}return e>0?e:1},[L]),D=d(()=>Math.min(k,v)/Math.max(l,2)/(2*R)*f,[k,v,l,R,f]),N=s(()=>{if(!u)return[];const e=[],t=Bo(z,10);for(let n=Math.ceil(w/t)*t;n<=$;n+=t){const t=A(n);e.push(o("line",{key:`gridv-${n}`,x1:String(t),y1:String(m),x2:String(t),y2:String(m+v),stroke:"#e5e7eb","stroke-width":"0.5"})),e.push(o("text",{key:`xtick-${n}`,x:String(t),y:String(m+v+16),"text-anchor":"middle","font-size":String(b),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(100*n)/100)))}const n=Bo(I,10);for(let t=Math.ceil(M/n)*n;t<=C;t+=n){const n=F(t);e.push(o("line",{key:`gridh-${t}`,x1:String(m),y1:String(n),x2:String(m+k),y2:String(n),stroke:"#e5e7eb","stroke-width":"0.5"})),e.push(o("text",{key:`ytick-${t}`,x:String(m-6),y:String(n+4),"text-anchor":"end","font-size":String(b),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(100*t)/100)))}return e},[u,w,$,M,C,z,I,A,F,m,k,v]),B=s(()=>{if(!h)return[];const e=[];if(M<=0&&C>=0){const t=F(0);e.push(o("line",{key:"axis-x",x1:String(m),y1:String(t),x2:String(m+k),y2:String(t),stroke:"#374151","stroke-width":String(S)}))}if(w<=0&&$>=0){const t=A(0);e.push(o("line",{key:"axis-y",x1:String(t),y1:String(m),x2:String(t),y2:String(m+v),stroke:"#374151","stroke-width":String(S)}))}return e.push(o("rect",{key:"chart-border",x:String(m),y:String(m),width:String(k),height:String(v),fill:"none",stroke:"#d1d5db","stroke-width":"1"})),e},[h,w,$,M,C,A,F,m,k,v]),T=s(()=>{const e=[];for(let t=0;t<L.length;t++){const n=L[t],r=n.magnitude??Math.sqrt(n.dx*n.dx+n.dy*n.dy);if(r<1e-10)continue;const i=A(n.x),l=F(n.y),a=n.dx*D,s=-n.dy*D,d=i+a,c=l+s;let f;f=g?No(r/R,x):p,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(S),"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,y=c-r*p-l*p*.5;e.push(o("polygon",{key:`arrow-head-${t}`,points:`${d},${c} ${h},${g} ${x},${y}`,fill:f}))}}return e},[L,A,F,D,g,R,x,p]),W=s(()=>y?[o("text",{key:"title",x:String(r/2),y:String(m/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},y)]:[],[y,r,m]),E=N(),P=B(),H=T(),j=W();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":y??"Vector field plot",style:{fontFamily:"sans-serif"}},...j,...E,...P,...H)},exports.VideoPlayer=function(e){const t=!1!==e.controls,n=c(null);f();const[r,i]=l(!1),[d,p]=l(0),[u,h]=l(0),[g,x]=l(e.muted?0:1),[y,m]=l(!!e.muted),[b,S]=l(!0),k="number"==typeof e.width?`${e.width}px`:e.width??"100%",v="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=()=>{p(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 w=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),m(0===o))},[]),C=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:k,height:v,display:"block"}});const z=u>0?d/u*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:w,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:`${z}%`,height:"100%",backgroundColor:"#3b82f6",borderRadius:"2px",transition:"width 0.1s linear"}})),o("span",{style:{color:"#ffffff",fontSize:"12px",whiteSpace:"nowrap",fontFamily:"monospace"}},`${ke(d)} / ${ke(u)}`),o("input",{type:"range",min:"0",max:"1",step:"0.05",value:String(y?0:g),oninput:M,"aria-label":"Volume",style:{width:"60px",cursor:"pointer"}}),o("button",{"aria-label":"Fullscreen",onclick:C,style:I},"⛶"));return o("div",{style:{position:"relative",width:k,height:v,backgroundColor:"#000",overflow:"hidden"},onmouseenter:()=>S(!0),onmouseleave:()=>{r&&S(!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:w,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"}}),A)},exports.VirtualScroll=function(e){const{items:t,renderItem:n,itemHeight:r,overscan:i=5,height:a}=e,[d,f]=l(0),p=c(null),u=t.length*r,h=parseInt(a,10)||400,g=Math.ceil(h/r),x=Math.max(0,Math.floor(d/r)-i),y=Math.min(t.length,Math.floor(d/r)+g+i),m=s(e=>{const t=e.target;f(t.scrollTop)},[]),b=[];for(let e=x;e<y;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:p,style:{...K,height:a},onScroll:m},o("div",{style:{height:`${u}px`,position:"relative",width:"100%"}},...b))},exports.VizWrapper=function(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:(p={align:i,fontSize:e.legendFontSize??"12px",gap:e.legendGap??16,direction:"left"===n||"right"===n?"column":"row"}).direction,flexWrap:"wrap",gap:`${p.gap}px`,justifyContent:p.align,alignItems:"center",fontSize:p.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,p;const u=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},...u)},exports.WaterfallChart=function(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:p=!0,showConnectors:u=!0,title:h,padding:g=60}=e,x=n-2*g,y=r-2*g,m=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:S}=d(()=>{let e=0,t=0;for(let n=0;n<m.length;n++){const o=m[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}},[m]),k=S-b,v=s(e=>g+y-(e-b)/k*y,[g,y,b,k]),w=d(()=>0===m.length?0:x/m.length,[m.length,x]),$=Math.max(1,w-6),M=s(()=>{if(!p)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}(k),t=[];for(let n=Math.ceil(b/e)*e;n<=S;n+=e){const e=v(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},[p,k,b,S,v,g,x]),C=s(()=>{const e=[];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"}));const t=b<=0&&S>=0?v(0):g+y;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,y,b,S,v]),z=s(()=>{if(0===m.length)return[];const e=[];for(let t=0;t<m.length;t++){const n=m[t],r=g+t*w+3,s=Math.max(n.start,n.end),d=Math.min(n.start,n.end),p=v(s),h=v(d),x=Math.max(0,h-p);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(p),width:String($),height:String(x),fill:b,rx:"2",ry:"2"})),f){const i="decrease"===n.type||n.value<0?h+14:p-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+y+16),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},n.label)),u&&t<m.length-1){const i=m[t+1],l=v(n.end),a=g+(t+1)*w+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},[m,w,$,v,i,l,a,c,f,u,g,y]),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(),L=C(),R=z(),D=I(),N=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"}},...D,...F,...L,...R,...N)},exports.WordCloud=function(e){const{words:t=[],width:n=600,height:r=400,minFontSize:i=10,maxFontSize:l=64,fontFamily:a="sans-serif",colors:s=To,rotations:c=Wo,padding:f=4,spiral:p="archimedean",title:u}=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 u=[],h=n/2,g=r/2;for(let t=0;t<e.length;t++){const o=e[t],i=d(o.weight),l=c[jo(o.text)%c.length],a=o.color??s[t%s.length];let x=!1;const y=500,m="archimedean"===p?.5:1;for(let e=0;e<y;e++){let t,s;if("archimedean"===p){const n=.1*e,o=m*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)*m;switch(e%4){case 0:t=n*m*4,s=o;break;case 1:t=-o,s=n*m*4;break;case 2:t=-n*m*4,s=-o;break;default:t=o,s=-n*m*4}}const d=h+t,c=g+s,y=Eo(o.text,i,l,d,c),b={x:y.x-f,y:y.y-f,w:y.w+2*f,h:y.h+2*f};if(!Ho(b,n,r))continue;let S=!1;for(const e of u)if(Po(b,e.bbox)){S=!0;break}if(!S){u.push({text:o.text,x:d,y:c,fontSize:i,rotation:l,color:a,bbox:b}),x=!0;break}}}return u},[t,n,r,i,l,s,c,f,p]);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":u??"Word cloud — no data"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":a,fill:"#6b7280"},"No words to display."));const g=[];u&&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:"#111827"},u));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":u??"Word cloud",style:{fontFamily:a}},...g)},exports.WordProcessor=function(e){const[t,n]=l(!1),[r,i]=l(!1),[a,f]=l(!1),[p,u]=l(-1),[h,g]=l(""),[x,y]=l(-1),[m,b]=l(0),[S,k]=l("3"),v=c(null),w={bold:s(()=>{document.execCommand("bold",!1),n(e=>!e),v.current&&v.current.focus()},[]),italic:s(()=>{document.execCommand("italic",!1),i(e=>!e),v.current&&v.current.focus()},[]),underline:s(()=>{document.execCommand("underline",!1),f(e=>!e),v.current&&v.current.focus()},[])},$={bold:t,italic:r,underline:a},M=s(e=>{document.execCommand(e,!1),v.current&&v.current.focus()},[]),C=s(e=>{document.execCommand("fontSize",!1,e),k(e),v.current&&v.current.focus()},[]),z=s(e=>{y(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":v.current&&(v.current.innerHTML="",b(0))}y(-1),v.current&&v.current.focus()},[]),A=s(()=>{if(v.current){const e=v.current.textContent??"";b(_t(e))}},[]),F=s(()=>{y(-1)},[]),L=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"}),[]),R=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}(),[]),D=e.content??"Start typing...",N=_t(D),B=m>0?m:N,T={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"},W={display:"block",width:"100%",padding:"6px 16px",fontSize:"13px",color:"#333",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"};function E(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=Wt.map((e,t)=>{const n=[e];return x===t&&Et[e]&&n.push(o("div",{key:"dropdown",style:T,className:"word-processor__menu-dropdown"},...Et[e].map((e,t)=>o("button",{key:String(t),style:W,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)":p===r?"rgba(0,0,0,0.08)":"transparent",border:"none",lineHeight:"1",transition:"background 0.15s",position:"relative"}),role:"menuitem","aria-label":e,onClick:()=>z(t),onMouseEnter:()=>{u(t)},onMouseLeave:()=>u(-1)},...n);var r});return o("div",{className:`word-processor ${e.className??""}`.trim(),style:L},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"}},...Pt.map(e=>o("button",{key:e.id,style:E(e.id,e.style),title:e.shortcut?`${e.label} (${e.shortcut})`:e.label,"aria-label":e.label,"aria-pressed":String($[e.id]??!1),onClick:w[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:S,onChange:e=>{const t=e.target;C(t.value)}},...jt.map(e=>o("option",{key:e,value:e},Yt[e])))),o("div",{key:"2",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},...Ht.map((e,t)=>o("button",{key:String(t),style:E(`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"},...R),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:v,onInput:A,suppressContentEditableWarning:!0},D)),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,`${B} words`),o("span",null,"100%")))},exports.applyGate=zn,exports.blochToCartesian=$n,exports.buildInputStyle=ne,exports.buildNavItemStyle=we,exports.buildRotationMatrix=Mt,exports.cartesianToBloch=Mn,exports.computeBoxStats=An,exports.computeMandelbrotGrid=function(e,t,n=[-2.5,1],o=[-1.25,1.25],r=80,i=ut){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},exports.computeSlices=kt,exports.createToaster=Ze,exports.describeArc=St,exports.generateEdges=$t,exports.generateHypercube=Lt,exports.generatePalette=Dt,exports.generateUSMapOutline=function(){return[{id:"west",label:"West",path:"M 50 80 L 120 60 L 140 180 L 100 280 L 50 260 Z",value:42},{id:"mountain",label:"Mountain",path:"M 120 60 L 220 50 L 240 170 L 200 270 L 100 280 L 140 180 Z",value:28},{id:"plains",label:"Plains",path:"M 220 50 L 340 60 L 360 180 L 330 280 L 200 270 L 240 170 Z",value:55},{id:"midwest",label:"Midwest",path:"M 340 60 L 460 50 L 490 140 L 470 230 L 330 280 L 360 180 Z",value:71},{id:"south-central",label:"South Central",path:"M 240 280 L 330 280 L 380 380 L 260 400 L 220 350 Z",value:35},{id:"southeast",label:"Southeast",path:"M 330 280 L 470 230 L 540 280 L 520 380 L 380 380 Z",value:63},{id:"northeast",label:"Northeast",path:"M 460 50 L 560 40 L 600 100 L 580 180 L 540 200 L 490 140 Z",value:88},{id:"mid-atlantic",label:"Mid-Atlantic",path:"M 490 140 L 540 200 L 580 180 L 600 240 L 540 280 L 470 230 Z",value:76},{id:"sw-desert",label:"SW Desert",path:"M 100 280 L 200 270 L 240 280 L 220 350 L 160 380 L 80 340 Z",value:19},{id:"pacific-nw",label:"Pacific NW",path:"M 30 30 L 120 20 L 120 60 L 50 80 L 30 60 Z",value:47}]},exports.generateVertices=wt,exports.numRotationAngles=Rt,exports.projectTo2D=Ft,exports.transformVec=At,exports.useBarGraphScales=nt,exports.useHover=$e,exports.useHypercube=function(e={}){const t=e.dimension??4,n=e.rotationSpeed??.008,o=e.perspective??.25,r=e.scale??200,i=Rt(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(()=>Lt(t,s,o,r),[t,s,o,r]),angles:s,setAngles:c}},exports.useLineGraphScales=xt,exports.useToast=function(e={}){const t=c(null);t.current||(t.current=Ze(e));const n=t.current,r=s(()=>o(et,{toaster:n}),[n]);return{toast:n.toast,dismiss:n.dismiss,dismissAll:n.dismissAll,ToastContainer:r}};
|
|
2
2
|
//# sourceMappingURL=specifyjs-components.cjs.js.map
|