@asymmetric-effort/specifyjs 0.1.0 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- "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 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 h(e){if(!e)return new Date;const t=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(new Date),n=e=>Number(t.find(t=>t.type===e)?.value??0);return new Date(n("year"),n("month")-1,n("day"),n("hour"),n("minute"),n("second"))}"undefined"!=typeof window&&window.addEventListener("hashchange",function(){u(),"undefined"!=typeof window&&window.location.hash;for(const e of f)e()}),r({flags:{},isEnabled:()=>!1,setFlag:()=>{},loading:!1});const g="#334155",x="#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 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 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"}},$={width:"100%",borderCollapse:"collapse",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",color:"#1f2937"},C={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"},L={padding:"4px 10px",margin:"0 2px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#fff",cursor:"pointer",fontSize:"13px"},R={...L,backgroundColor:"#3b82f6",color:"#fff",borderColor:"#3b82f6"},T={...L,opacity:"0.5",cursor:"default"},A={cursor:"pointer",width:"16px",height:"16px"};function F(e,t,n){return e!==t?"↕":"asc"===n?"↑":"↓"}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"},H={fontSize:"0.875rem",fontWeight:"400",marginLeft:"4px",verticalAlign:"super"},N={fontSize:"0.75rem",color:"#94a3b8",marginTop:"4px"},P={listStyle:"none",margin:"0",padding:"0",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px"},j={padding:"10px 14px",color:"#1f2937"},_={borderBottom:"1px solid #e5e7eb"},O={cursor:"pointer",transition:"background-color 0.15s ease"},Y={backgroundColor:"#eff6ff"},q={padding:"24px",textAlign:"center",color:"#9ca3af",fontSize:"14px"},G={padding:"10px 14px",borderBottom:"1px solid #e5e7eb",backgroundColor:"#f9fafb",fontWeight:"600",fontSize:"13px",color:"#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 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"}},V={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'},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??{},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 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"}},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}},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",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 Ce(e){const{section:t,expanded:n,onToggle:r,headerStyle:i,expandIcon:l,collapseIcon:a,iconPosition:d}=e,{hover:c,onMouseEnter:p,onMouseLeave:u}=$e(),f=!0===t.disabled,h={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&&(h.flexDirection="row");const g=s(e=>{const t=e;f||"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),r())},[f,r]),x=s(()=>{f||r()},[f,r]),b=o("span",{"aria-hidden":"true",style:{display:"inline-block",transition:"transform 0.2s ease",transform:n?"rotate(180deg)":"rotate(0deg)",flexShrink:"0",marginLeft:"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,y="left"===d?[b,m]:[m,b];return o("button",{id:`accordion-header-${t.id}`,role:"button","aria-expanded":String(n),"aria-controls":`accordion-panel-${t.id}`,"aria-disabled":f?"true":void 0,"data-section-id":t.id,tabIndex:f?-1:0,style:h,onClick:x,onKeyDown:g,onMouseEnter:p,onMouseLeave:u},...y)}function ze(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 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:n,closeOnSelect:r,onClose:i}=e,{hover:a,onMouseEnter:d,onMouseLeave:c}=$e(),[p,u]=l(!1),f=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||(f?u(e=>!e):(t.onClick&&t.onClick(),r&&i()))},[h,f,t,r,i]),b=s(()=>{d(),f&&u(!0)},[f,d]),m=s(()=>{c(),f&&u(!1)},[f,c]),y=o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},t.icon?o("span",{style:{flexShrink:"0"},"aria-hidden":"true"},t.icon):null,o("span",null,t.label)),v=f?o("span",{style:{marginLeft:"8px",fontSize:"10px",lineHeight:"1"},"aria-hidden":"true"},"›"):null,k=f&&p?o("div",{style:{position:"absolute",left:"100%",top:"0",zIndex:"1000"}},o(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=>o(Ie,{key:e.id,item:e,itemStyle:n,closeOnSelect:r,onClose:i})))):null;return o("div",{style:{position:"relative"},onMouseEnter:b,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":f||void 0,"aria-expanded":f?String(p):void 0},y,v),k)}function De(e){const{item:t,onClose:n,index:r}=e,{hover:i,onMouseEnter:a,onMouseLeave:d}=$e(),[c,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 f=!0===t.disabled,h=s(()=>{f||(u?p(e=>!e):(t.onClick&&t.onClick(),n()))},[f,u,t,n]),g=s(()=>{a(),u&&p(!0)},[u,a]),x=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=o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},t.icon?o("span",{style:{width:"16px",textAlign:"center"},"aria-hidden":"true"},t.icon):o("span",{style:{width:"16px"}}),o("span",null,t.label)),y=u?o("span",{style:{fontSize:"10px",color:"#9ca3af"},"aria-hidden":"true"},"▶"):t.shortcut?o("span",{style:{fontSize:"11px",color:"#9ca3af",marginLeft:"24px"}},t.shortcut):null,v=u&&c?o("div",{style:{position:"absolute",left:"100%",top:"0",zIndex:"1001"}},o("div",{role:"menu",style:{backgroundColor:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"180px"}},...t.children.map((e,t)=>o(De,{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:b,onClick:h,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 Le(e){const{menu:t,index:n,isOpen:r,anyOpen:i,onOpen:l,onClose:a}=e,{hover:d,onMouseEnter:p,onMouseLeave:u}=$e(),f=c(null),h=s(()=>{r?a():l(n)},[r,n,l,a]),g=s(()=>{p(),i&&!r&&l(n)},[i,r,n,l,p]),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"},b=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(De,{key:String(t),item:e,onClose:a,index:t})))):null;return o("div",{style:{position:"relative",display:"inline-block"},onMouseEnter:g,onMouseLeave:u},o("button",{ref:f,type:"button",role:"menuitem",style:x,onClick:h,"aria-haspopup":"true","aria-expanded":String(r),tabIndex:0},t.label),b)}function Re(e,t){const n=[];for(let o=e;o<=t;o++)n.push(o);return n}const Te={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={...Te,backgroundColor:"#2563eb",color:"#ffffff",borderColor:"#2563eb",fontWeight:"600"},Fe={...Te,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:n,selectedId:r,onSelect:i,depth:a}=e,{hover:d,onMouseEnter:c,onMouseLeave:p}=$e(),[u,f]=l(!1),h=t.children&&t.children.length>0,g=t.id===r,x=s(()=>{h&&!n&&f(e=>!e),i&&i(t.id)},[h,n,i,t.id]),b={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,y=n?null:o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.label),v=!n&&t.badge?o("span",{style:{backgroundColor:"#ef4444",color:"#ffffff",fontSize:"11px",fontWeight:"600",padding:"1px 6px",borderRadius:"10px",marginLeft:"4px",flexShrink:"0"}},t.badge):null,k=!n&&h?o("span",{style:{fontSize:"10px",transition:"transform 0.15s",transform:u?"rotate(90deg)":"rotate(0deg)",marginLeft:"4px"},"aria-hidden":"true"},"▶"):null,S=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:b,onClick:x,onMouseEnter:c,onMouseLeave:p,"aria-selected":g?"true":"false",title:n?t.label:void 0},m,y,v,k,S),$=!n&&h&&u?t.children.map(e=>o(We,{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 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 He(e){const{item:t,size:n,variant:r}=e,{hover:i,onMouseEnter:l,onMouseLeave:a}=$e(),d=Be[n],c=!0===t.disabled,p=!0===t.active,u=s(()=>{!c&&t.onClick&&t.onClick()},[c,t]),f={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"6px",height:d.height,padding:d.padding,fontSize:d.fontSize,fontFamily:"inherit",border:"raised"===r?"1px solid #d1d5db":"1px solid transparent",borderRadius:"4px",backgroundColor:p?"#e0e7ff":!c&&i?"#f3f4f6":"raised"===r?"#ffffff":"transparent",color:c?"#9ca3af":p?"#2563eb":"#374151",cursor:c?"default":"pointer",opacity:c?"0.5":"1",outline:"none",transition:"background-color 0.15s"},h=t.icon?o("span",{style:{fontSize:d.iconSize},"aria-hidden":"true"},t.icon):null,g=t.label?o("span",null,t.label):null,x="dropdown"===t.type?o("span",{style:{fontSize:"10px",marginLeft:"2px"},"aria-hidden":"true"},"▼"):null;return o("button",{type:"button",style:f,onClick:u,onMouseEnter:l,onMouseLeave:a,disabled:c||void 0,"aria-pressed":p||void 0,"aria-label":t.label||t.id,title:t.label||t.id},h,g,x)}class Ne{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 Ne(e,this))}static fromData(e){return new Ne(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 Ne(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 Pe(e){e.expanded=!0;for(const t of e.children)Pe(t)}function je(e,t=[]){if(t.push(e),e.expanded)for(const n of e.children)je(n,t);return t}function _e(e){if(!e.parent)return!0;const t=e.parent.children;return t[t.length-1]===e}function Oe(e){const{node:t,isSelected:n,indentPx:r,lineColor:i,lineWidth:l,iconExpanded:s,iconCollapsed:d,nodeStyle:p,renderNode:u,onToggle:f,onClick:h,focusedId:g}=e,x=$e(),b=c(null),m=g===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 n=t;for(let t=0;t<v-e;t++)n=n?n.parent:null;const a=!!n&&!_e(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 S=v>0?o("span",{"aria-hidden":"true",style:{display:"inline-block",width:`${Math.floor(r/2)}px`,height:"0",borderTop:`${l}px solid ${i}`,flexShrink:"0",alignSelf:"center",marginLeft:`-${r}px`}}):null,w=y?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(),f(t)}},t.expanded?s:d),$=u?u(t,n):o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.icon?o("span",{style:{marginRight:"6px"}},t.icon):null,t.label),C=we(p,{hover:x.hover,active:n});return o("div",{ref:b,role:"treeitem","aria-expanded":y?void 0:String(t.expanded),"aria-selected":n?"true":"false","aria-level":v+1,tabIndex:m?0:-1,style:{...C,display:"flex",alignItems:"stretch",padding:"0"},onMouseEnter:x.onMouseEnter,onMouseLeave:x.onMouseLeave,onClick:()=>h(t)},...k,S,o("span",{style:{display:"flex",alignItems:"center",flex:"1",padding:p.padding??"6px 10px",minWidth:"0"}},w,$))}function Ye(e){const{items:t,position:n,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 n=e,o=t.map((e,t)=>({item:e,i:t})).filter(({item:e})=>!e.divider);if("ArrowDown"===n.key)n.preventDefault(),d(e=>{const t=(o.findIndex(({i:t})=>t===e)+1)%o.length;return o[t].i});else if("ArrowUp"===n.key)n.preventDefault(),d(e=>{const t=o.findIndex(({i:t})=>t===e),n=t<=0?o.length-1:t-1;return o[n].i});else if("ArrowRight"===n.key)s>=0&&t[s]?.children&&u(s);else if("ArrowLeft"===n.key)i>0&&r();else if("Enter"===n.key){if(n.preventDefault(),s>=0){const e=t[s];e.children?u(s):!e.disabled&&e.onClick&&(e.onClick(),r())}}else"Escape"===n.key&&r()};f.current.addEventListener("keydown",e);const n=f.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),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"},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: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},...h)];return c&&p===t&&g.push(o(Ye,{key:`submenu-${t}`,items:e.children,position:{x:n.x+178,y:n.y+36*t},onClose:()=>u(null),depth:i+1})),o("div",{key:`wrap-${t}`,style:{position:"relative"}},...g)});return o("div",{ref:f,style:h,tabIndex:-1,role:"menu"},...g)}function qe(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 Xe(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 Ve(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 Je(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 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:n}=e,r=Ze[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,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 lt(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}const at=40,st=1e6;function dt(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 ct(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 pt(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 ut(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:pt(r,i,6),yTicks:pt(l,a,6),xMin:r,xMax:i,yMin:l,yMax:a}}(e,t,n,o),[e,t,n,o])}function ft(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function ht(e,t,n,o){return{x:e+n*Math.cos(o),y:t+n*Math.sin(o)}}function gt(e,t,n,o,r,i){const l=r-Math.PI/2,a=i-Math.PI/2,s=ht(e,t,o,l),d=ht(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 p=ht(e,t,n,a),u=ht(e,t,n,l);return[`M ${s.x} ${s.y}`,`A ${o} ${o} 0 ${c} 1 ${d.x} ${d.y}`,`L ${p.x} ${p.y}`,`A ${n} ${n} 0 ${c} 0 ${u.x} ${u.y}`,"Z"].join(" ")}function xt(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 bt(e,t,n,o,r){return{x:n+e*Math.cos(t)*r,y:o-e*Math.sin(t)*r}}function mt(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 yt(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 vt(e,t){let n=kt(e),o=0;for(let r=0;r<e;r++)for(let i=r+1;i<e;i++)o<t.length&&(n=wt(n,St(e,r,i,t[o]))),o++;return n}function kt(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 St(e,t,n,o){const r=kt(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 wt(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 $t(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 Ct(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 zt(e,t=[],n=.3,o=1){const r=mt(e),i=yt(e),l=vt(e,t);return{vertices:r.map((e,t)=>{const r=Ct($t(l,e),n);return{id:t,position:e,x:r.x*o,y:r.y*o,depth:r.depth}}),edges:i,dimension:e}}function Mt(e){return e*(e-1)/2}function It(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}exports.Accordion=function(e){const{sections:t,defaultExpanded:n,allowMultiple:r=!1,headerStyle:i={},contentStyle:a={},wrapperStyle:c,expandIcon:p="+",collapseIcon:u="−",iconPosition:f="right",animated:h=!0,onChange:g}=e,[x,b]=l(()=>n??[]),m=s(e=>{b(t=>{let n;return n=t.includes(e)?t.filter(t=>t!==e):r?[...t,e]:[e],g&&g(n),n})},[r,g]),y=d(()=>t.map(e=>{const t=x.includes(e.id),n=o(Ce,{key:`header-${e.id}`,section:e,expanded:t,onToggle:()=>m(e.id),headerStyle:i,expandIcon:p,collapseIcon:u,iconPosition:f}),r=o(ze,{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,p,u,f,h,m]);return o(Se,{role:"region",ariaLabel:"Accordion",styling:c,keyboardNav:!0},...y)},exports.Alert=function(e){const[t,n]=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?o("div",{role:"alert",style:p},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,[p,u]=l(h(d));a(()=>{const e=setInterval(()=>{u(h(d))},1e3);return()=>clearInterval(e)},[d]);const f=p.getHours(),m=p.getMinutes(),y=p.getSeconds(),v="24h"===t?f%24*15+.25*m:f%12*30+.5*m,k=6*m+.1*y,S=6*y,w=n/2,$=n/2,C=n/2-10,z=C-4,M=C-22,I=[];I.push(o("circle",{cx:String(w),cy:String($),r:String(C),fill:"#f8fafc",stroke:g,"stroke-width":"3"}));const D="24h"===t?24:12;for(let e=0;e<D;e++){const r=(360*e/D-90)*Math.PI/180,i=z-("24h"===t?4:6);I.push(o("line",{x1:String(w+i*Math.cos(r)),y1:String($+i*Math.sin(r)),x2:String(w+z*Math.cos(r)),y2:String($+z*Math.sin(r)),stroke:g,"stroke-width":"2"}));const l=String("24h"===t?e:0===e?12:e),a="24h"===t?.055*n:.08*n;I.push(o("text",{x:String(w+M*Math.cos(r)),y:String($+M*Math.sin(r)),"text-anchor":"middle","dominant-baseline":"central",fill:b,"font-size":String(a),"font-family":"sans-serif"},l))}const L=(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(L(v,.5*C,"4",x)),I.push(L(k,.75*C,"3",x)),s&&I.push(L(S,.85*C,"1.5","#ef4444")),I.push(o("circle",{cx:String(w),cy:String($),r:"4",fill:x}));const R=[o("svg",{width:String(n),height:String(n),viewBox:`0 0 ${n} ${n}`,xmlns:"http://www.w3.org/2000/svg"},...I)];return r&&R.push(o("div",{style:{textAlign:"center",marginTop:"8px",fontFamily:"sans-serif",fontSize:"14px",color:b}},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")}`}}(p,i))),o("div",{className:c,style:{display:"inline-block"}},...R)},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,[p,u]=l(!1),f=function(e){return null==e?m.md:"number"==typeof e?e:m[e]??m.md}(i),h="circle"===a?"50%":`${Math.round(.15*f)}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 y[Math.abs(t)%y.length]}(r),x=`${Math.round(.4*f)}px`,b={position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:`${f}px`,height:`${f}px`,borderRadius:h,overflow:"hidden",flexShrink:"0"};let S;if(t&&!p)S=o("img",{src:t,alt:n??r??"avatar",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"},onError:()=>u(!0)});else{const e=function(e){if(!e)return"?";const t=e.trim().split(/\s+/);return 1===t.length?t[0].charAt(0).toUpperCase():(t[0].charAt(0)+t[t.length-1].charAt(0)).toUpperCase()}(r);S=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:{...b,backgroundColor:t&&!p?"transparent":g},role:"img","aria-label":n??r??"avatar"},S);if(!d)return w;const $=Math.max(8,Math.round(.25*f));return o("div",{style:{position:"relative",display:"inline-flex",width:`${f}px`,height:`${f}px`,flexShrink:"0"}},w,o("span",{style:{position:"absolute",width:`${$}px`,height:`${$}px`,borderRadius:"50%",backgroundColor:v[d]??v.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,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?o("span",{style:p,"aria-label":r?"notification":`count ${d}`},d):null;if(null==s)return u??o("span",null);const f={...p,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:f,"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:p=!0,showGrid:u=!0,gridColor:f="#e5e7eb",title:h,padding:g=50,animate:x=!1,stacked:b,grouped:m=!1}=e,y="vertical"===i,v=n-2*g,k=r-2*g,S=y?k:v,w=y?v:k,$=void 0!==b&&b.length>0,C=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)}(b):[],[$,b]),z=$?b.length:t.length,M=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,b,m),[t,b,m]),I=M>0?M:1,D=nt(z,I,S,w,a),L=s(()=>{if(!u)return[];const e=function(e){if(e<=0)return 1;const t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),o=t/n;return o<=1.5?n:o<=3.5?2*n:o<=7.5?5*n:10*n}(I),t=[];for(let n=e;n<=I;n+=e){const e=D.valueScale(n);if(y){const r=g+k-e;t.push(o("line",{key:`grid-${n}`,x1:String(g),y1:String(r),x2:String(g+v),y2:String(r),stroke:f,"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:f,"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},[u,I,D,y,g,v,k,f]),R=s(()=>{const e=[];return y?(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+v),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+v),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},[y,g,v,k]),T=s(()=>{const e=[];for(let n=0;n<t.length;n++){const r=t[n],i=D.valueScale(r.value),a=D.categoryScale(n),s=r.color??l;let d,u,f=String(r.value);if(y){const e=g+a,t=g+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=g+a,t=g;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"}}x&&(d.style=`animation: barGrow 0.6s ease-out ${.05*n}s both`),e.push(o("rect",{key:`bar-${n}`,...d})),p&&e.push(o("text",{key:`val-${n}`,...u},f)),y?e.push(o("text",{key:`cat-${n}`,x:String(g+a+D.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+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,x,y,g,k]),A=s(()=>{if(!b)return[];const e=[];for(let t=0;t<b.length;t++){const n=b[t],r=D.categoryScale(t);let i=0;for(let l=0;l<n.values.length;l++){const a=n.values[l],s=D.valueScale(a.value),d=D.valueScale(i),u=rt(l,a.color);if(y){const i=g+r,f=g+k-d-s;e.push(o("rect",{key:`sbar-${t}-${l}`,x:String(i),y:String(f),width:String(D.barThickness),height:String(s),rx:l===n.values.length-1?String(c):"0",ry:l===n.values.length-1?String(c):"0",fill:u,...x?{style:`animation: barGrow 0.6s ease-out ${.03*(t*n.values.length+l)}s both`}:{}})),p&&s>14&&e.push(o("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=g+d,f=g+r;e.push(o("rect",{key:`sbar-${t}-${l}`,x:String(i),y:String(f),width:String(s),height:String(D.barThickness),rx:l===n.values.length-1?String(c):"0",ry:l===n.values.length-1?String(c):"0",fill:u,...x?{style:`animation: barGrow 0.6s ease-out ${.03*(t*n.values.length+l)}s both`}:{}})),p&&s>20&&e.push(o("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 n=D.valueScale(i);y?e.push(o("text",{key:`stotal-${t}`,x:String(g+r+D.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+D.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(i)))}y?e.push(o("text",{key:`scat-${t}`,x:String(g+r+D.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+D.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},n.label))}return e},[b,D,c,p,x,y,g,k]),F=s(()=>{if(!b)return[];const e=C.length,t=[];for(let n=0;n<b.length;n++){const r=b[n],i=D.categoryScale(n),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=C.indexOf(d.category),f=u*(a+l),h=D.valueScale(d.value),b=rt(u>=0?u:s,d.color);if(y){const r=g+i+f,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:b,...x?{style:`animation: barGrow 0.6s ease-out ${.04*(n*e+s)}s both`}:{}})),p&&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+f;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:b,...x?{style:`animation: barGrow 0.6s ease-out ${.04*(n*e+s)}s both`}:{}})),p&&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)))}}y?t.push(o("text",{key:`gcat-${n}`,x:String(g+i+D.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+D.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},r.label))}return t},[b,C,D,c,p,x,y,g,k]),E=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]),W=s(()=>x?[o("defs",{key:"anim-defs"},o("style",{key:"anim-style"},y?"@keyframes barGrow { from { transform: scaleY(0); transform-origin: bottom; } to { transform: scaleY(1); transform-origin: bottom; } }":"@keyframes barGrow { from { transform: scaleX(0); transform-origin: left; } to { transform: scaleX(1); transform-origin: left; } }"))]:[],[x,y]),B=L(),H=R(),N=E(),P=W();let j;return j=$&&m?F():$?A():T(),o("svg",{width:String(n),height:String(r),viewBox:`0 0 ${n} ${r}`,xmlns:"http://www.w3.org/2000/svg",style:{fontFamily:"sans-serif"}},...P,...N,...B,...H,...j)},exports.Breadcrumb=function(e){const{items:t,separator:n="/",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,n=r-1;u=[...t.slice(0,e),{label:"..."},...t.slice(t.length-n)]}const h=u.map((e,t)=>((e,t,r)=>{const i=t===r.length-1,l=f&&"..."===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: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(o("span",{"aria-current":"page",style:{color:"#1f2937",fontWeight:"600",fontSize:c.fontSize}},e.label)):e.href?a.push(o("a",{href:e.href,onClick:e.onClick?t=>{t.preventDefault(),e.onClick()}:void 0,style:{color:"#2563eb",textDecoration:"none",fontSize:c.fontSize}},e.label)):e.onClick?a.push(o("button",{type:"button",onClick:e.onClick,style:{background:"none",border:"none",cursor:"pointer",color:"#2563eb",padding:"0",fontSize:c.fontSize,fontFamily:"inherit"}},e.label)):a.push(o("span",{style:{color:"#6b7280",fontSize:c.fontSize}},e.label)),o("li",{key:String(t),style:{display:"inline-flex",alignItems:"center"}},...a)})(e,t,u));return o(Se,{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.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=be[n]??be.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"},p=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,p?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,u=!1!==e.showArrows,f=e.animation??"slide",h=e.interval??5e3,g=p(),[x,b]=l(0),m=c(null),y=c(null),v=s(t=>{let o=t;o=r?(t%n+n)%n:Math.max(0,Math.min(t,n-1)),b(o),e.onChange&&e.onChange(o)},[n,r,e.onChange]),k=s(()=>v(x+1),[x,v]),S=s(()=>v(x-1),[x,v]);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?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-${g}{from{opacity:0}to{opacity:1}}`:"",$=d(()=>"fade"===f?{position:"relative",width:"100%"}:{display:"flex",transition:"transform 0.4s ease",transform:`translateX(-${100*x}%)`,width:"100%"},[x,f]),C={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:"2",background:"rgba(255,255,255,0.8)",border:"none",borderRadius:"50%",width:"36px",height:"36px",fontSize:"18px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:"#111827",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"},z=t.map((e,t)=>{const n="fade"===f?{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)}),M=i?o("div",{style:{display:"flex",justifyContent:"center",gap:"8px",padding:"12px 0"}},...t.map((e,t)=>o("button",{key:String(t),"aria-label":`Go to slide ${t+1}`,onclick:()=>v(t),style:{width:"10px",height:"10px",borderRadius:"50%",border:"none",cursor:"pointer",backgroundColor:t===x?"#3b82f6":"#d1d5db",transition:"background-color 0.2s",padding:"0"}}))):null;return o("div",{ref: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?o("style",null,w):null,o("div",{style:$},...z),u&&n>1?o("button",{"aria-label":"Previous slide",onclick:S,style:{...C,left:"8px"}},"‹"):null,u&&n>1?o("button",{"aria-label":"Next slide",onclick:k,style:{...C,right:"8px"}},"›"):null,M)},exports.CartesianGraph2D=function(e){const{width:t=400,height:n=300,points:r=[],plotFunction:i,plotResolution:a=200,xRange:d=[-5,5],yRange:p=[-5,5],showGrid:u=!0,showAxes:f=!0,pointRadius:h=3,pointColor:g="#3b82f6",curveColor:x="#3b82f6",gridColor:b="#e2e8f0",axisColor:m="#94a3b8",onPointClick:y,onPointDoubleClick:v,onPointContextMenu:k,onPointHover:S}=e,[w,$]=l(d[0]),[C,z]=l(d[1]),[M,I]=l(p[0]),[D,L]=l(p[1]),R=c(!1),T=c(null),A=s(e=>at+(e-w)/(C-w)*(t-80),[w,C,t]),F=s(e=>n-at-(e-M)/(D-M)*(n-80),[M,D,n]),E=s(e=>w+(e-at)/(t-80)*(C-w),[w,C,t]),W=s(e=>M+(n-at-e)/(n-80)*(D-M),[M,D,n]),B=s(e=>{const t=e;R.current=!0,T.current={mx:t.clientX,my:t.clientY,x0:w,x1:C,y0:M,y1:D}},[w,C,M,D]),H=s(e=>{if(!R.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);$(r.x0-a),z(r.x1-a),I(r.y0+s),L(r.y1+s)},[t,n]),N=s(()=>{R.current=!1,T.current=null},[]),P=s(e=>{const t=e;t.preventDefault();const n=t.currentTarget.getBoundingClientRect(),o=t.clientX-n.left,r=t.clientY-n.top,i=E(o),l=W(r),a=t.deltaY>0?1.1:1/1.1,s=(C-w)*a,d=(D-M)*a;if(s<.01||d<.01||s>st||d>st)return;const c=(i-w)/(C-w),p=(l-M)/(D-M);$(i-c*s),z(i+(1-c)*s),I(l-p*d),L(l+(1-p)*d)},[w,C,M,D,E,W]),j=[];if(j.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),u){const e=it(w,C),r=it(M,D);for(let t=0;t<e.length;t++){const r=A(e[t]);j.push(o("line",{x1:r,y1:at,x2:r,y2:n-at,stroke:b,"stroke-width":.5,key:`gx-${t}`})),j.push(o("text",{x:r,y:n-at+14,"text-anchor":"middle","font-size":10,fill:m,key:`lx-${t}`},lt(e[t])))}for(let e=0;e<r.length;e++){const n=F(r[e]);j.push(o("line",{x1:at,y1:n,x2:t-at,y2:n,stroke:b,"stroke-width":.5,key:`gy-${e}`})),j.push(o("text",{x:34,y:n+3,"text-anchor":"end","font-size":10,fill:m,key:`ly-${e}`},lt(r[e])))}}if(f){const e=Math.max(at,Math.min(t-at,A(0))),r=Math.max(at,Math.min(n-at,F(0)));j.push(o("line",{x1:at,y1:r,x2:t-at,y2:r,stroke:m,"stroke-width":1,key:"x-axis"})),j.push(o("line",{x1:e,y1:at,x2:e,y2:n-at,stroke:m,"stroke-width":1,key:"y-axis"}))}if(i){const e=(C-w)/a,t=[];for(let n=0;n<=a;n++){const o=w+n*e,r=i(o);if(!isFinite(r))continue;const l=A(o),a=F(r);t.push(`${0===t.length?"M":"L"}${l},${a}`)}t.length>0&&j.push(o("path",{d:t.join(" "),fill:"none",stroke:x,"stroke-width":1.5,key:"curve"}))}const _=(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:A(t.x),cy:F(t.y),r:h,fill:g,cursor:"pointer",key:`pt-${e}`};y&&(n.onclick=_(0,y,e,t)),v&&(n.ondblclick=_(0,v,e,t)),k&&(n.oncontextmenu=_(0,k,e,t)),S&&(n.onmouseover=_(0,S,e,t)),j.push(o("circle",n))}const O=o("defs",{key:"defs"},o("clipPath",{id:"plot-clip"},o("rect",{x:at,y:at,width:t-80,height:n-80})));return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:n,viewBox:`0 0 ${t} ${n}`,style:"user-select: none; touch-action: none;",onmousedown:B,onmousemove:H,onmouseup:N,onmouseleave:N,onwheel:P},O,...j)},exports.Checkbox=function(e){const{checked:t,onChange:n,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||n(!t)},[l,t,n]),h=s(e=>{l||" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),n(!t))},[l,t,n]),g=oe[p],x=`${g.box}px`,b={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"},y=i?o("span",{style:m},"—"):t?o("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=o("input",{ref:u,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}),S=o("div",{style:b},y),w=r?o("span",{style:{fontSize:g.fontSize,color:"#374151"}},r):null;return o(te,{error:d},o("div",{style:v,onClick:f,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,S,w))},exports.ColorPicker=function(e){const{value:t,onChange:n,presets:r=re,showInput:i=!0,showAlpha:d=!1,disabled:p=!1,label:u}=e,[f,h]=l(!1),[g,x]=l(t),b=c(null);a(()=>{x(t)},[t]),a(()=>{const e=e=>{b.current&&!b.current.contains(e.target)&&h(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const m=s(e=>{p||n(le(e))},[p,n]),y=s(e=>{const t=e.target.value;x(t);const o=t.startsWith("#")?t:`#${t}`;ie(o)&&n(le(o))},[n]),v=s(()=>{ie(g.startsWith("#")?g:`#${g}`)||x(t)},[g,t]),k={width:"36px",height:"36px",borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:t,cursor:p?"not-allowed":"pointer",flexShrink:"0"},S={display:"grid",gridTemplateColumns:"repeat(10, 1fr)",gap:"4px",marginBottom:i?"8px":"0"},w=r.map(e=>{const n=le(e)===le(t);return o("div",{key:e,style:{width:"20px",height:"20px",borderRadius:"3px",backgroundColor:e,cursor:p?"not-allowed":"pointer",border:n?"2px solid #1f2937":"1px solid #e5e7eb",boxSizing:"border-box"},onClick:()=>m(e),title:e})}),$=i?o("div",{style:{display:"flex",alignItems:"center",gap:"4px"}},o("div",{style:{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:t,border:"1px solid #d1d5db",flexShrink:"0"}}),o("input",{type:"text",value:g,onInput:y,onBlur:v,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=f?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:S},...w),$):null;return o(te,{label:u,disabled:p},o("div",{ref:b,style:{position:"relative"}},o("div",{style:{display:"flex",alignItems:"center",gap:"8px"},onClick:p?void 0:()=>h(!f)},o("div",{style:k}),i?o("span",{style:{fontSize:"14px",fontFamily:"monospace",color:"#1f2937"}},t):null),C))},exports.ColorWheel=function(e){const{value:t="#000000",onChange:n,size:r=32,showLabel:i=!0,disabled:a=!1,label:d}=e,[p,u]=l(t),f=c(null),h=s((...e)=>{const t=e[0].target.value;u(t),n?.(t)},[n]),g={width:`${r}px`,height:`${r}px`,borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:p,cursor:a?"not-allowed":"pointer",position:"relative",overflow:"hidden"},x={position:"absolute",top:"0",left:"0",width:"100%",height:"100%",opacity:"0",cursor:a?"not-allowed":"pointer",border:"none",padding:"0"};return o("div",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"4px"}},d?o("label",{style:{fontSize:"12px",color:"#64748b",fontWeight:"500"}},d):null,o("div",{style:g},o("input",{ref:f,type:"color",value:p,onInput:h,disabled:a,style:x})),i?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:p="classic",computeFunction:u=dt,onPointClick:f,onPointHover:h,onPointDoubleClick:g,onPointContextMenu:x}=e,[b,m]=l(r[0]),[y,v]=l(r[1]),[k,S]=l(i[0]),[w,$]=l(i[1]),C=c(null),z=c(!1),M=c(null),I=s((e,o)=>({re:b+e/t*(y-b),im:w-o/n*(w-k)}),[b,y,k,w,t,n]);a(()=>{const e=C.current;if(!e)return;const o=e.getContext("2d");if(!o)return;const r=o.createImageData(t,n),i=r.data;for(let e=0;e<n;e++)for(let n=0;n<t;n++){const{re:o,im:r}=I(n,e),l=u(o,r,d),[a,s,c]=ct(l,d,p),f=4*(e*t+n);i[f]=a,i[f+1]=s,i[f+2]=c,i[f+3]=255}o.putImageData(r,0,0)},[b,y,k,w,t,n,d,p,u,I]);const D=s(e=>{const t=e.target.getBoundingClientRect(),n=e.clientX-t.left,o=e.clientY-t.top,{re:r,im:i}=I(n,o);return{re:r,im:i,iterations:u(r,i,d),event:e}},[I,u,d]),L=s(e=>{z.current=!0,M.current={x:e.clientX,y:e.clientY,rMin:b,rMax:y,iMin:k,iMax:w}},[b,y,k,w]),R=s(e=>{if(h&&h(D(e)),!z.current||!M.current)return;const o=M.current,r=e.clientX-o.x,i=e.clientY-o.y,l=(o.rMax-o.rMin)/t,a=(o.iMax-o.iMin)/n;m(o.rMin-r*l),v(o.rMax-r*l),S(o.iMin+i*a),$(o.iMax+i*a)},[t,n,h,D]),T=s(()=>{z.current=!1},[]),A=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}=I(o,r);m(i+(b-i)*t),v(i+(y-i)*t),S(l+(k-l)*t),$(l+(w-l)*t)},[I,b,y,k,w]),F=s(e=>{f&&f(D(e))},[f,D]),E=s(e=>{g&&g(D(e))},[g,D]),W=s(e=>{e.preventDefault(),x&&x(D(e))},[x,D]);return o("canvas",{ref:C,width:t,height:n,style:{cursor:"crosshair"},onmousedown:L,onmousemove:R,onmouseup:T,onmouseleave:T,onwheel:A,onclick:F,ondblclick:E,oncontextmenu:W})},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 p=[o("div",{onContextMenu:d,style:{display:"contents"}},n)];return r&&p.push(o(Ye,{items:t,position:r,onClose:c,depth:0})),o("div",null,...p)},exports.DataGrid=function(e){const{columns:t,data:n,pageSize:r,currentPage:i,onPageChange:a,sortBy:c,sortDir:p,onSort:u,selectable:f=!1,selectedRows:h,onSelectionChange:g,striped:x=!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,H]=l([]),[N,P]=l({}),j=i??v,_=c??S,O=p??E,Y=h??B,q=d(()=>{const e=Object.entries(N).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,N]),G=d(()=>{if(!_)return q;const e=[...q];return e.sort((e,t)=>{const n=e[_],o=t[_];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"===O?n-o:o-n;const r=String(n),i=String(o),l=r.localeCompare(i);return"asc"===O?l:-l}),e},[q,_,O]),U=G.length,X=r?Math.max(1,Math.ceil(U/r)):1,V=r?G.slice(j*r,(j+1)*r):G,K=s(e=>{a?a(e):k(e)},[a]),J=s(e=>{const t=_===e&&"asc"===O?"desc":"asc";u?u(e,t):(w(e),W(t))},[_,O,u]),Z=s(e=>{const t=Y.includes(e)?Y.filter(t=>t!==e):[...Y,e];g?g(t):H(t)},[Y,g]),Q=s(()=>{const e=V.map((e,t)=>r?j*r+t:t),t=e.every(e=>Y.includes(e))?Y.filter(t=>!e.includes(t)):[...new Set([...Y,...e])];g?g(t):H(t)},[V,Y,r,j,g]),ee=s((e,t)=>{P(n=>({...n,[e]:t})),K(0)},[K]),te=t.some(e=>e.filterable),ne=m?"6px 8px":z.padding,oe=[];if(f){const e=V.map((e,t)=>r?j*r+t:t),t=e.length>0&&e.every(e=>Y.includes(e));oe.push(o("th",{key:"__select_all",style:{...C,padding:ne,width:"40px",textAlign:"center",...y?{position:"sticky",top:"0",zIndex:"2"}:{}}},o("input",{type:"checkbox",checked:t,onChange:Q,style:A,"aria-label":"Select all rows"})))}for(const e of t){const t={...C,padding:ne,...e.width?{width:e.width}:{},...e.sortable?{cursor:"pointer"}:{},...b?{border:"1px solid #e5e7eb"}:{},...y?{position:"sticky",top:"0",zIndex:"2"}:{}},n=[e.header];e.sortable&&n.push(o("span",{style:M},F(e.key,_,O))),oe.push(o("th",{key:e.key,style:t,onClick:e.sortable?()=>J(e.key):void 0,"aria-sort":_===e.key?"asc"===O?"ascending":"descending":void 0},...n))}let re=null;if(te){const e=[];f&&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:N[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<V.length;e++){const n=V[e],i=r?j*r+e:e,l=Y.includes(i),a={};x&&e%2==1&&(a.backgroundColor="#f9fafb"),l&&(a.backgroundColor="#eff6ff");const s=[];f&&s.push(o("td",{key:"__select",style:{padding:ne,textAlign:"center",...z,...b?{border:"1px solid #e5e7eb"}:{}}},o("input",{type:"checkbox",checked:l,onChange:()=>Z(i),style:A,"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:{...z,padding:ne,...b?{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?T:L,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(X,l+i);a-l<i&&(l=Math.max(0,a-i)),l>0&&(n.push(o("button",{key:"p0",style:L,onClick:()=>K(0)},"1")),l>1&&n.push(o("span",{key:"e1",style:{margin:"0 4px"}},"...")));for(let e=l;e<a;e++)n.push(o("button",{key:`p${e}`,style:e===j?R:L,onClick:e!==j?()=>K(e):void 0,"aria-current":e===j?"page":void 0},String(e+1)));a<X&&(a<X-1&&n.push(o("span",{key:"e2",style:{margin:"0 4px"}},"...")),n.push(o("button",{key:"p"+(X-1),style:L,onClick:()=>K(X-1)},String(X)))),n.push(o("button",{key:"next",style:j>=X-1?T:L,onClick:j<X-1?()=>K(j+1):void 0,disabled:j>=X-1,"aria-label":"Next page"},"Next →")),le=o("div",{style:D},o("span",null,`Showing ${e}–${t} of ${U}`),o("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},...n))}const ae={width:"100%",...y?{overflow:"auto",maxHeight:"600px"}:{}},se={...$,...b?{border:"1px solid #e5e7eb"}:{}},de=o("thead",null,o("tr",null,...oe),re),ce=o("tbody",null,...ie),pe=o("table",{style:se,role:"grid","aria-rowcount":String(U)},de,ce);return o("div",{style:ae},pe,le)},exports.DatePicker=function(e){const{value:t,onChange:n,format:r="YYYY-MM-DD",minDate:i,maxDate:p,disabled:u=!1,placeholder:f="Select date...",label:h,error:g}=e,x=d(()=>de(t),[t]),b=d(()=>de(i),[i]),m=d(()=>de(p),[p]),[y,v]=l(!1),[k,S]=l(()=>x?x.getFullYear():(new Date).getFullYear()),[w,$]=l(()=>x?x.getMonth():(new Date).getMonth()),C=c(null),z=d(()=>new Date,[]);a(()=>{const e=e=>{C.current&&!C.current.contains(e.target)&&v(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const M=s(()=>{$(e=>0===e?(S(e=>e-1),11):e-1)},[]),I=s(()=>{$(e=>11===e?(S(e=>e+1),0):e+1)},[]),D=s(e=>{const t=new Date(k,w,e);b&&t<b||m&&t>m||(n(function(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}(t)),v(!1))},[k,w,n,b,m]),L=x?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"))}(x,r):"",R=d(()=>{const e=new Date(k,w,1).getDay(),t=new Date(k,w+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},[k,w]),T={...ne({},{focused:y,error:!!g}),cursor:u?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",minHeight:"38px",userSelect:"none"},A={background:"none",border:"none",cursor:"pointer",fontSize:"16px",padding:"4px 8px",color:"#374151",borderRadius:"4px"},F=se.map(e=>o("div",{key:e,style:{padding:"4px"}},e)),E=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(k,w,e),i=ce(r,z),l=!!x&&ce(r,x),a=b&&r<b||m&&r>m;return o("div",{key:`day-${e}`,style:{padding:"4px",textAlign:"center",cursor:a?"not-allowed":"pointer",borderRadius:"4px",fontSize:"13px",fontWeight:i?"700":"400",backgroundColor:l?"#3b82f6":"transparent",color:l?"#ffffff":a?"#d1d5db":i?"#3b82f6":"#1f2937",border:i&&!l?"1px solid #3b82f6":"1px solid transparent",lineHeight:"1.8"},onClick:a?void 0:()=>D(e)},String(e))});return o("div",{key:`row-${t}`,style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)"}},...n)}),W=y?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:A,onClick:M},"◀"),o("span",{style:{fontWeight:"600",fontSize:"14px",color:"#1f2937"}},`${ae[w]} ${k}`),o("button",{type:"button",style:A,onClick:I},"▶")),o("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",textAlign:"center",fontSize:"11px",fontWeight:"600",color:"#6b7280",marginBottom:"4px"}},...F),...E):null;return o(te,{label:h,error:g,disabled:u},o("div",{ref:C,style:{position:"relative"}},o("div",{style:T,onClick:u?void 0:()=>v(!y),tabIndex:u?-1:0,role:"button","aria-label":"Pick a date"},o("span",{style:{color:L?"#1f2937":"#9ca3af"}},L||f),o("span",{style:{color:"#6b7280",fontSize:"14px"}},"📅")),W))},exports.DigitalClock=function(e){const{format:t="12h",showDate:n=!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:h}=function(e,t){if(t){const n=new Intl.DateTimeFormat("en-US",{timeZone:t,hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}).formatToParts(e),o=e=>Number(n.find(t=>t.type===e)?.value??0);return{hours:o("hour"),minutes:o("minute"),seconds:o("second")}}return{hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()}}(c,s);let g,x=null;"12h"===t?(x=u>=12?"PM":"AM",g=u%12||12):g=u;let b=`${E(g)}:${E(f)}`;i&&(b+=`:${E(h)}`);const m=[b];null!=x&&m.push(o("span",{style:H},x));const y=[o("span",{style:B},...m)];return n&&y.push(o("span",{style:N},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?`${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))),o("div",{style:W,...d?{class:d}:{}},...y)},exports.Drawer=function(e){const{open:t,onClose:n,position:r="right",size:i="320px",title:s,overlay:d=!0,closeOnOverlay:p=!0,closeOnEscape:u=!0,children:f}=e,[h,g]=l(!1),[x,b]=l(!1),m=c(null),y=s?"drawer-title":void 0;if(a(()=>{if(!t){b(!1);const e=setTimeout(()=>g(!1),300);return()=>clearTimeout(e)}g(!0),requestAnimationFrame(()=>b(!0))},[t]),a(()=>{if(!t||!u)return;const e=e=>{"Escape"===e.key&&n()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t,u,n]),a(()=>{if(!t)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[t]),a(()=>{t&&m.current&&m.current.focus()},[t]),!h)return null;const v={position:"fixed",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:"10000",opacity:x?"1":"0",transition:"opacity 0.3s ease"},k={...Ge(r,i),transform:qe(r,x),transition:"transform 0.3s ease"},S=[];s&&S.push(o("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"}},o("h3",{id:y,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"},"×"))),S.push(o("div",{style:{padding:"20px",overflow:"auto",flex:"1"}},f));const w=[];return d&&w.push(o("div",{style:v,onClick:()=>{p&&n()}})),w.push(o("div",{ref:m,style:k,role:"dialog","aria-modal":"true","aria-labelledby":y,tabIndex:-1},...S)),o("div",null,...w)},exports.Dropdown=function(e){const{label:t,items:n,triggerStyle:r,menuStyle:i,itemStyle:d={},placement:p="bottom-start",closeOnSelect:u=!0,width:f="220px"}=e,[h,g]=l(!1),x=c(null),b=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 y=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:b,"aria-haspopup":"true","aria-expanded":String(h)},o("span",null,t),o("span",{style:{marginLeft:"4px",fontSize:"10px",transition:"transform 0.15s",transform:h?"rotate(180deg)":"rotate(0deg)"},"aria-hidden":"true"},"▼")),v={position:"absolute",top:"100%",..."bottom-end"===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=h?o("div",{style:v},o(Se,{orientation:"vertical",role:"menu",ariaLabel:`${t} menu`,styling:k},...n.map(e=>o(Ie,{key:e.id,item:e,itemStyle:d,closeOnSelect:u,onClose:m})))):null;return o("div",{ref:x,style:{position:"relative",display:"inline-block"}},y,S)},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{onChange:t,accept:n,multiple:r=!1,maxSize:i,disabled:a=!1,label:d,helpText:p}=e,[u,f]=l([]),[h,g]=l(!1),[x,b]=l(""),m=c(null),y=s(e=>{b("");const n=[];for(const t of e)i&&t.size>i?b(`File "${t.name}" exceeds maximum size of ${pe(i)}`):n.push(t);const o=r?[...u,...n]:n.slice(0,1);f(o),t(o)},[u,r,i,t]),v=s(e=>{if(e.preventDefault(),e.stopPropagation(),g(!1),a)return;const t=e.dataTransfer;if(!t)return;const n=Array.from(t.files);y(n)},[a,y]),k=s(e=>{e.preventDefault(),e.stopPropagation(),a||g(!0)},[a]),S=s(e=>{e.preventDefault(),e.stopPropagation(),g(!1)},[]),w=s(e=>{const t=e.target;t.files&&(y(Array.from(t.files)),t.value="")},[y]),$=s(e=>{const n=u.filter((t,n)=>n!==e);f(n),t(n)},[u,t]),C=s(()=>{a||m.current&&m.current.click()},[a]),z={border:"2px dashed "+(h?"#3b82f6":x?"#ef4444":"#d1d5db"),borderRadius:"8px",padding:"24px",textAlign:"center",cursor:a?"not-allowed":"pointer",backgroundColor:h?"#eff6ff":"#fafafa",transition:"all 0.15s",opacity:a?"0.6":"1"},M={fontSize:"12px",color:"#9ca3af"},I=o("input",{ref:m,type:"file",accept:n,multiple:r,onChange:w,disabled:a,style:{display:"none"},tabIndex:-1}),D=o("div",{style:z,onClick:C,onDrop:v,onDragOver:k,onDragLeave:S,role:"button",tabIndex:a?-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"),n?o("div",{style:M},n):null,i?o("div",{style:M},`Max size: ${pe(i)}`):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"}},pe(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(),$(t)},"aria-label":`Remove ${e.name}`},"✕")))):null;return o(te,{label:d,helpText:p,error:x||void 0,disabled:a},o("div",null,I,D,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.FormFieldWrapper=te,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.HypercubeGraph=function(e){const t=e.dimension??4,n=e.width??600,r=e.height??600,i=e.vertexRadius??10,p=e.edgeWidth??3,u=e.edgeColor??"#111",f=e.perspective??.25,h=e.rotationSpeed??.008,g=e.showLabels??!1,x=e.backgroundColor??"transparent",b=e.scale??.3*Math.min(n,r),m=Mt(t),y=1<<t,v=d(()=>"auto"===e.vertexColors||void 0===e.vertexColors?It(y):e.vertexColors,[y,e.vertexColors]),[k,S]=l(()=>{const e=[];for(let t=0;t<m;t++)e.push(0);return e}),[w,$]=l(!1),C=c({x:0,y:0}),z=c([]),M=c(0);a(()=>{if(0===h)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)+h*(1+.3*e);return t}),M.current=requestAnimationFrame(t))};return M.current=requestAnimationFrame(t),()=>{e=!1,cancelAnimationFrame(M.current)}},[h]);const I=d(()=>zt(t,k,f,b),[t,k,f,b]),D=n/2,L=r/2,R=d(()=>I.edges.map(e=>{const t=I.vertices[e.source],n=I.vertices[e.target],o=(t.depth+n.depth)/2;return{...e,avgDepth:o,sv:t,tv:n}}).sort((e,t)=>e.avgDepth-t.avgDepth),[I]),T=d(()=>I.vertices.slice().sort((e,t)=>e.depth-t.depth),[I]),A=s(e=>{const t=e;$(!0),C.current={x:t.clientX,y:t.clientY},z.current=k.slice()},[k]),F=s(e=>{if(!w)return;const t=e,n=.01*(t.clientX-C.current.x),o=.01*(t.clientY-C.current.y);S(()=>{const e=z.current.slice();return e.length>0&&(e[0]=(e[0]??0)+n),e.length>1&&(e[1]=(e[1]??0)+o),e})},[w]),E=s(()=>{$(!1)},[]),W=R.map((e,t)=>{const n=(e=>{const t=(e+2)/4;return.3+.7*Math.max(0,Math.min(1,t))})(e.avgDepth);return o("line",{key:`e-${e.source}-${e.target}`,x1:String(D+e.sv.x),y1:String(L+e.sv.y),x2:String(D+e.tv.x),y2:String(L+e.tv.y),stroke:u,"stroke-width":String(p),"stroke-opacity":String(n),"stroke-linecap":"round"})}),B=T.map(e=>{const n=i*(e=>{const t=(e+2)/4;return.6+.4*Math.max(0,Math.min(1,t))})(e.depth),r=v[e.id%v.length]??"#3b82f6",l=[o("circle",{key:`v-${e.id}-circle`,cx:String(D+e.x),cy:String(L+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(D+e.x),y:String(L+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:String(n),height:String(r),viewBox:`0 0 ${n} ${r}`,style:{backgroundColor:x,cursor:w?"grabbing":"grab",userSelect:"none"},onMouseDown:A,onMouseMove:F,onMouseUp:E,onMouseLeave:E},...W,...B.flat())},exports.Image=function(e){const[t,n]=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(()=>{n("loading")},[e.src]);const h=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]),g=d(()=>{const n={display:"block",width:"100%",height:"100%"};return e.objectFit&&(n.objectFit=e.objectFit),"loading"===t&&(n.opacity="0",n.position="absolute"),"error"===t&&(n.display="none"),n},[e.objectFit,t]);let x=null;"loading"===t&&("skeleton"===e.placeholder?x=o("div",null,o("style",null,`@keyframes liq-img-shimmer-${i}{0%{background-position:-200% 0}100%{background-position:200% 0}}`),o("div",{style:{width:u??"100%",height: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?x=o("div",{style:{width:u??"100%",height:f??"200px",backgroundColor:"#d1d5db",filter:"blur(20px)"}}):null!=e.placeholder&&!1!==e.placeholder&&(x=e.placeholder));let b=null;"error"===t&&null!=e.fallback&&(b="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")}),b);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",showPoints:c=!0,showGrid:p=!0,showArea:u=!1,areaColor:f="rgba(59,130,246,0.15)",xLabel:h,yLabel:g,title:x,padding:b=50,animate:m=!1,multiLine:y}=e,v=ut(d(()=>{const e=[...t];if(y)for(const t of y)e.push(...t.data);return e},[t,y]),n,r,b),{xScale:k,yScale:S,xTicks:w,yTicks:$}=v,C=[];if(C.push(o("rect",{x:0,y:0,width:n,height:r,fill:"white",key:"bg"})),p){for(let e=0;e<w.length;e++){const t=k(w[e]);C.push(o("line",{x1:t,y1:b,x2:t,y2:r-b,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-x-${e}`}))}for(let e=0;e<$.length;e++){const t=S($[e]);C.push(o("line",{x1:b,y1:t,x2:n-b,y2:t,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-y-${e}`}))}}C.push(o("line",{x1:b,y1:r-b,x2:n-b,y2:r-b,stroke:"#374151","stroke-width":1,key:"x-axis"})),C.push(o("line",{x1:b,y1:b,x2:b,y2:r-b,stroke:"#374151","stroke-width":1,key:"y-axis"}));for(let e=0;e<w.length;e++){const t=k(w[e]);C.push(o("line",{x1:t,y1:r-b,x2:t,y2:r-b+5,stroke:"#374151",key:`xtick-${e}`})),C.push(o("text",{x:t,y:r-b+18,"text-anchor":"middle","font-size":11,fill:"#6b7280",key:`xlabel-${e}`},ft(w[e])))}for(let e=0;e<$.length;e++){const t=S($[e]);C.push(o("line",{x1:b-5,y1:t,x2:b,y2:t,stroke:"#374151",key:`ytick-${e}`})),C.push(o("text",{x:b-10,y:t+4,"text-anchor":"end","font-size":11,fill:"#6b7280",key:`ylabel-${e}`},ft($[e])))}function z(e,t,n,r,i,l,a,s,d){if(0===e.length)return;const c=[...e].sort((e,t)=>e.x-t.x);if(r){const e=S(v.yMin),t=c.map(e=>`${k(e.x)},${S(e.y)}`).join(" "),n=`${k(c[0].x)},${e} ${t} ${k(c[c.length-1].x)},${e}`;C.push(o("polygon",{points:n,fill:i,key:`${d}-area`}))}const p={points:c.map(e=>`${k(e.x)},${S(e.y)}`).join(" "),fill:"none",stroke:t,"stroke-width":n,"stroke-linejoin":"round","stroke-linecap":"round",key:`${d}-line`};if(m?(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<c.length;e++){const t={cx:k(c[e].x),cy:S(c[e].y),r:s,fill:a,key:`${d}-pt-${e}`};m?(t.opacity=0,C.push(o("circle",t,o("animate",{attributeName:"opacity",from:0,to:1,dur:"0.3s",begin:"1.2s",fill:"freeze"})))):C.push(o("circle",t))}}if(z(t,i,l,u,f,c,s,a,"primary"),y)for(let e=0;e<y.length;e++){const t=y[e];z(t.data,t.color,l,!1,"transparent",c,t.color,a,`series-${e}`)}if(y&&y.length>0){const e=[],t=[{color:i,label:"Primary"},...y.map((e,t)=>({color:e.color,label:e.label??`Series ${t+1}`}))];for(let n=0;n<t.length;n++){const r=b+10+120*n,i=b-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 h&&C.push(o("text",{x:n/2,y:r-8,"text-anchor":"middle","font-size":13,fill:"#374151",key:"x-axis-label"},h)),g&&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"},g)),x&&C.push(o("text",{x:n/2,y:20,"text-anchor":"middle","font-size":16,"font-weight":"bold",fill:"#111827",key:"title"},x)),o("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:r,viewBox:`0 0 ${n} ${r}`},...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:p}=e;if(0===t.length)return o("div",null,c?o("div",{style:G},c):null,o("div",{style:q},d),p?o("div",{style:{...G,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,h={...j,...l?O:{},...p?Y:{},...i&&!f?_:{}};u.push(o("li",{key:c,style:h,onClick:s?()=>s(e):void 0,role:s?"option":void 0,"aria-selected":s?String(p):void 0},n(d,e)))}return o("div",null,c?o("div",{style:G},c):null,o("ul",{style:P,role:s?"listbox":"list"},...u),p?o("div",{style:{...G,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},p):null)},exports.Menubar=function(e){const{menus:t}=e,[n,r]=l(null),i=c(null),d=s(e=>{r(e)},[]),p=s(()=>{r(null)},[]);a(()=>{if(null===n)return;const e=e=>{const t=i.current;t&&!t.contains(e.target)&&r(null)};return document.addEventListener("click",e,!0),()=>{document.removeEventListener("click",e,!0)}},[n]),a(()=>{const e=i.current;if(!e)return;const o=o=>{const i=o;if("Escape"!==i.key){if("ArrowRight"===i.key)return i.preventDefault(),void r(e=>null===e?0:(e+1)%t.length);if("ArrowLeft"===i.key)return i.preventDefault(),void r(e=>null===e?t.length-1:(e-1+t.length)%t.length);if("ArrowDown"===i.key&&null!==n){i.preventDefault();const t=e.querySelector('[role="menu"]');if(t){const e=t.querySelector('[role="menuitem"]');e&&e.focus()}return}"Enter"!==i.key&&i.key}else r(null)};return e.addEventListener("keydown",o),()=>{e.removeEventListener("keydown",o)}},[n,t.length]);const u=t.map((e,t)=>o(Le,{key:String(t),menu:e,index:t,isOpen:n===t,anyOpen:null!==n,onOpen:d,onClose:p}));return o("div",{ref:i,role:"menubar","aria-label":"Menu bar",style:{display:"flex",alignItems:"center",backgroundColor:"#ffffff",borderBottom:"1px solid #e5e7eb",padding:"2px 4px",fontFamily:"inherit",fontSize:"13px",gap:"2px"}},...u)},exports.Modal=function(e){const{open:t,onClose:n,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&&n()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t,s,n]),a(()=>{t&&f.current&&f.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)),p&&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 b=[o("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 24px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"}},...g),o("div",{style:{padding:"24px",overflow:"auto",flex:"1"}},u)];return d&&b.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:f,style:h,tabIndex:-1,role:"document"},...b))},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]),p=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}),u=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},p,u)},exports.NavWrapper=Se,exports.NumberSpinner=function(e){const{value:t,onChange:n,min:r,max:i,step:a=1,disabled:d=!1,prefix:c,suffix:p,label:u,error:f}=e,[h,g]=l(!1),x=s(e=>{let t=e;return void 0!==r&&t<r&&(t=r),void 0!==i&&t>i&&(t=i),t},[r,i]),b=s(()=>{d||n(x(t+a))},[d,t,a,x,n]),m=s(()=>{d||n(x(t-a))},[d,t,a,x,n]),y=s(e=>{const t=e.target.value;if(""===t||"-"===t)return;const o=parseFloat(t);isNaN(o)||n(x(o))},[x,n]),v=s(e=>{d||("ArrowUp"===e.key?(e.preventDefault(),b()):"ArrowDown"===e.key&&(e.preventDefault(),m()))},[d,b,m]),k=void 0===i||t<i,S={display:"inline-flex",alignItems:"stretch",borderRadius:"6px",overflow:"hidden",border:"1px solid "+(f?"#ef4444":h?"#3b82f6":"#d1d5db"),transition:"border-color 0.15s",opacity:d?"0.6":"1",...h&&!f?{boxShadow:"0 0 0 3px #3b82f622"}:{}},w=e=>({display:"flex",alignItems:"center",justifyContent:"center",width:"36px",backgroundColor:"#f9fafb",border:"none",cursor:d||!e?"not-allowed":"pointer",color:d||!e?"#d1d5db":"#374151",fontSize:"16px",fontWeight:"600",userSelect:"none",transition:"background-color 0.1s",borderRight:"none",borderLeft:"none"}),$={display:"flex",alignItems:"center",fontSize:"13px",color:"#6b7280",padding:"0 4px",backgroundColor:"#f9fafb"},C=o("button",{type:"button",style:w(void 0===r||t>r),onClick:m,disabled:d,"aria-label":"Decrement",tabIndex:-1},"−"),z=c?o("span",{style:$},c):null,M=o("input",{type:"text",value:String(t),onInput:y,onKeyDown:v,onFocus:()=>g(!0),onBlur:()=>g(!1),disabled:d,style:{flex:"1",minWidth:"48px",textAlign:"center",border:"none",borderLeft:"1px solid #e5e7eb",borderRight:"1px solid #e5e7eb",outline:"none",fontSize:"14px",fontFamily:"inherit",backgroundColor:"#ffffff",color:"#1f2937",padding:"8px 4px"},"aria-label":u||"Number",role:"spinbutton","aria-valuenow":String(t),"aria-valuemin":void 0!==r?String(r):void 0,"aria-valuemax":void 0!==i?String(i):void 0}),I=p?o("span",{style:$},p):null,D=o("button",{type:"button",style:w(k),onClick:b,disabled:d,"aria-label":"Increment",tabIndex:-1},"+"),L=[C];return z&&L.push(z),L.push(M),I&&L.push(I),L.push(D),o(te,{label:u,error:f,disabled:d},o("div",{style:S},...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,p=Math.max(1,Math.ceil(t/n)),u=Math.min(Math.max(1,r),p),f=s(e=>{!c&&e>=1&&e<=p&&e!==u&&i(e)},[c,p,u,i]),h=(e,t,n)=>{const r=c||t<1||t>p||t===u;return o("button",{type:"button",onClick:()=>f(t),disabled:r||void 0,"aria-label":n,style:r?Fe:Te},e)},g=function(e,t,n){if(e<=2*n+5)return Re(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?[...Re(1,2*n+3),"ellipsis",e]:i&&!l?[1,"ellipsis",...Re(e-2*n-2,e)]:[1,"ellipsis",...Re(o,r),"ellipsis",e]}(p,u,l);let x=0;const b=[];a&&b.push(h("«",1,"Go to first page")),d&&b.push(h("‹",u-1,"Go to previous page"));for(const e of g)if("ellipsis"===e)b.push(o("span",{key:"ellipsis-"+x++,style:Ee},"..."));else{const t=e===u;b.push(o("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?Fe:t?Ae:Te},String(e)))}return d&&b.push(h("›",u+1,"Go to next page")),a&&b.push(h("»",p,"Go to last page")),o(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,n=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 h=s(()=>{e.collapsible&&i(e=>!e)},[e.collapsible]),g=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]),x={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",gap:"8px",backgroundColor:"#f9fafb",userSelect:"none",cursor:e.collapsible?"pointer":"default"},b={display:"inline-block",width:"0",height:"0",borderLeft:"5px solid transparent",borderRight:"5px solid transparent",borderTop:"6px solid #6b7280",transition:"transform 0.2s",transform:r?"rotate(-90deg)":"rotate(0deg)",marginRight:"8px",flexShrink:"0"},m={maxHeight:r?"0":u,overflow:"hidden",transition:"max-height 0.3s ease"};return o("div",{className:`panel ${e.className??""}`.trim(),style:g},o("div",{className:"panel__header",style:x,onClick:h,role:e.collapsible?"button":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:b}):null,e.icon?o("span",{className:"panel__icon"},e.icon):null,e.title?o("span",{className:"panel__title",style:{fontSize:"14px",fontWeight:"600",color:"#111827"}},e.title):null),e.headerRight?o("div",{className:"panel__header-right"},e.headerRight):null),o("div",{className:"panel__body-wrapper",style:e.collapsible?m:{},ref:p},o("div",{className:"panel__body",style:{padding:"16px"}},e.children)))},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:p="right",title:u,centerLabel:f,colors:h,strokeColor:g="#fff",strokeWidth:x=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=n-b,k=r-m-y,S=v/2,w=m+k/2,$=Math.min(v,k)/2-10,C=e.outerRadius??$,z=d(()=>xt(t,{padAngle:l,colors:h}),[t,l,h]),M=[];u&&M.push(o("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],n=gt(S,w,i,C,t.startAngle,t.endAngle);if(M.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=ht(S,w,r?C+14:i+.65*(C-i),n-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=ht(S,w,C+2,n-Math.PI/2);M.push(o("line",{key:`connector-${e}`,x1:t.x,y1:t.y,x2:l.x,y2:l.y,stroke:"#999",strokeWidth:1}))}a&&M.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&&M.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(f&&i>0&&M.push(o("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,n=m+20;for(let r=0;r<z.length;r++){const i=z[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-y+10;for(let r=0;r<z.length;r++){const i=z[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)}%)`))}}M.push(...e)}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:r,viewBox:`0 0 ${n} ${r}`},...M)},exports.PolarGraph2D=function(e){const{width:t=400,height:n=400,rRange:r=[0,2],plotFunction:i,plotResolution:a=360,points:c=[],showGrid:p=!0,pointRadius:u=3,pointColor:f="#3b82f6",curveColor:h="#3b82f6",onPointClick:g,onPointDoubleClick:x,onPointContextMenu:b,onPointHover:m}=e,[y,v]=l(r[1]),[k,S]=l(0),[w,$]=l(0),[C,z]=l(null),M=t/2+k,I=n/2+w,D=Math.min(t,n)/2-30,L=D/y,R=d(()=>{const e=Math.max(1,Math.ceil(y)),t=[],n=y/e;for(let o=1;o<=e;o++)t.push(n*o);return t},[y]),T=d(()=>{const e=[];for(let t=0;t<360;t+=30)e.push(t*Math.PI/180);return e},[]),A=d(()=>{if(!i)return"";const e=[];for(let t=0;t<=a;t++){const n=t/a*2*Math.PI,o=i(n);if(o<0||!isFinite(o))continue;const{x:r,y:l}=bt(o,n,M,I,L);e.push(`${0===e.length?"M":"L"}${r.toFixed(2)},${l.toFixed(2)}`)}return e.join(" ")},[i,a,M,I,L]),F=s(e=>{z({x:e.clientX,y:e.clientY,px:k,py:w})},[k,w]),E=s(e=>{C&&(S(C.px+(e.clientX-C.x)),$(C.py+(e.clientY-C.y)))},[C]),W=s(()=>{z(null)},[]),B=s(e=>{e.preventDefault();const t=e.deltaY>0?1.15:1/1.15;v(Math.max(.1,y*t))},[y]),H=s((e,t,n)=>{if(e)return o=>e({r:t.r,theta:t.theta,index:n,event:o})},[]),N=[];if(N.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),p){for(let e=0;e<R.length;e++){const t=R[e]*L;N.push(o("circle",{cx:M,cy:I,r:t,fill:"none",stroke:"#e5e7eb","stroke-width":1,key:`gc-${e}`})),N.push(o("text",{x:M+t+2,y:I-4,"font-size":10,fill:"#9ca3af",key:`gl-${e}`},R[e].toFixed(1)))}for(let e=0;e<T.length;e++){const t=T[e],n=R[R.length-1]*L,r=M+n*Math.cos(t),i=I-n*Math.sin(t);N.push(o("line",{x1:M,y1:I,x2:r,y2:i,stroke:"#e5e7eb","stroke-width":1,key:`al-${e}`}));const l=Math.round(180*t/Math.PI),a=M+(n+14)*Math.cos(t),s=I-(n+14)*Math.sin(t);N.push(o("text",{x:a,y:s+4,"text-anchor":"middle","font-size":10,fill:"#9ca3af",key:`at-${e}`},`${l}°`))}}N.push(o("line",{x1:M-D,y1:I,x2:M+D,y2:I,stroke:"#d1d5db","stroke-width":1,key:"x-axis"})),N.push(o("line",{x1:M,y1:I-D,x2:M,y2:I+D,stroke:"#d1d5db","stroke-width":1,key:"y-axis"})),A&&N.push(o("path",{d:A,fill:"none",stroke:h,"stroke-width":2,key:"curve"}));for(let e=0;e<c.length;e++){const t=c[e],{x:n,y:r}=bt(t.r,t.theta,M,I,L);N.push(o("circle",{cx:n,cy:r,r:u,fill:f,key:`pt-${e}`,style:{cursor:"pointer"},onclick:H(g,t,e),ondblclick:H(x,t,e),oncontextmenu:H(b,t,e),onmouseenter:H(m,t,e)}))}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:n,viewBox:`0 0 ${t} ${n}`,style:{cursor:C?"grabbing":"grab"},onmousedown:F,onmousemove:E,onmouseup:W,onmouseleave:W,onwheel:B},...N)},exports.Popover=function(e){const{trigger:t,content:n,open:r,placement:i="bottom",offset:d=4,arrow:p=!1,closeOnClickOutside:u=!0,onOpenChange:f}=e,h=void 0!==r,[g,x]=l(!1),b=h?r:g,m=c(null),y=s(()=>{h?f&&f(!r):x(e=>!e)},[h,r,f]);a(()=>{if(!b||!u)return;const e=e=>{m.current&&!m.current.contains(e.target)&&(h?f&&f(!1):x(!1))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[b,u,h,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=[n];p&&k.push(o("div",{style:Ve(i)}));const S=[o("div",{onClick:y,style:{display:"inline-block"}},t)];return b&&S.push(o("div",{style:v},...k)),o("div",{ref:m,style:{position:"relative",display:"inline-block"}},...S)},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=p();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,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 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"}},p?o("style",null,p):null,o("svg",{width:String(t),height:String(t),viewBox:`0 0 ${t} ${t}`,style:e.indeterminate?{animation:`liq-spin-${c} 1s linear infinite`}:e.animated?{animation:`liq-pulse-${c} 1.5s ease-in-out infinite`}:{}},o("circle",{cx:String(t/2),cy:String(t/2),r:String(a),fill:"none",stroke:l,"stroke-width":String(n)}),o("circle",{cx:String(t/2),cy:String(t/2),r:String(a),fill:"none",stroke:i,"stroke-width":String(n),"stroke-dasharray":String(s),"stroke-dashoffset":String(d),"stroke-linecap":"round",transform:`rotate(-90 ${t/2} ${t/2})`,style:{transition:"stroke-dashoffset 0.3s ease"}})),e.showLabel&&!e.indeterminate?o("span",{style:{fontSize:"14px",color:"#374151"}},`${Math.round(r)}%`):null)}const u=e.animated||e.indeterminate?`@keyframes liq-shimmer-${c}{0%{background-position:-200% 0}100%{background-position:200% 0}}`:"",f=e.indeterminate?`@keyframes liq-indeterminate-${c}{0%{left:-40%;width:40%}50%{left:20%;width:60%}100%{left:100%;width:40%}}`:"",h={width:"100%",height:a,backgroundColor:l,borderRadius:a,overflow:"hidden",position:"relative"},g=d(()=>{const t={height:"100%",borderRadius:a,transition:"width 0.3s ease"};return e.indeterminate?(t.position="absolute",t.animation=`liq-indeterminate-${c} 1.5s ease-in-out infinite`,t.backgroundColor=i):(t.width=`${r}%`,t.backgroundColor=i),e.animated&&!e.indeterminate&&(t.backgroundImage=`linear-gradient(90deg, ${i} 0%, ${function(e){const t=e.replace("#","");if(6!==t.length)return e;const n=Math.min(255,parseInt(t.slice(0,2),16)+40),o=Math.min(255,parseInt(t.slice(2,4),16)+40),r=Math.min(255,parseInt(t.slice(4,6),16)+40);return`#${n.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}`}(i)} 50%, ${i} 100%)`,t.backgroundSize="200% 100%",t.animation=`liq-shimmer-${c} 1.5s ease-in-out infinite`),t},[r,i,a,e.animated,e.indeterminate,c]);return o("div",{role:"progressbar","aria-valuenow":e.indeterminate?void 0:String(Math.round(r)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Progress",style:{width:"100%"}},u||f?o("style",null,u+f):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.RadioGroup=function(e){const{options:t,value:n,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 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]),f={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(),p(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:f,role:"radiogroup","aria-label":c,onKeyDown:u,tabIndex:a?-1:0},...h))},exports.ScrollContainer=function(e){const t=e.direction??"vertical",n=e.showScrollbar??"auto",r=e.shadow??!1,i=c(null),[p,u]=l(!0),[f,h]=l(!1),[g,x]=l(!0),[b,m]=l(!1),y=s(()=>{const e=i.current;e&&(u(e.scrollTop<=2),h(e.scrollTop+e.clientHeight>=e.scrollHeight-2),x(e.scrollLeft<=2),m(e.scrollLeft+e.clientWidth>=e.scrollWidth-2))},[]);a(()=>{y()},[y]);const v=s(()=>{r&&y()},[r,y]),k=d(()=>{const o={position:"relative",overflowX:ye(t,"x"),overflowY:ye(t,"y"),...ve(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]),S=[];if(r){const e="vertical"===t||"both"===t,n="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)"),n&&!g&&S.push("inset 8px 0 6px -6px rgba(0,0,0,0.15)"),n&&!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(", ")),o("div",{className:`scroll-container scroll-container--${t} ${e.className??""}`.trim(),style:w,ref:i,onScroll:v},e.children)},exports.Select=function(e){const{options:t,value:n,onChange:r,placeholder:i="Select...",searchable:p=!1,multiple:u=!1,clearable:f=!1,disabled:h=!1,error:g,label:x,helpText:b}=e,[m,y]=l(!1),[v,k]=l(""),[S,w]=l(-1),$=c(null),C=d(()=>Array.isArray(n)?n:n?[n]:[],[n]),z=d(()=>{if(!p||!v)return t;const e=v.toLowerCase();return t.filter(t=>t.label.toLowerCase().includes(e))},[t,v,p]),M=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]),I=d(()=>0===C.length?"":C.map(e=>t.find(t=>t.value===e)).filter(Boolean).map(e=>e.label).join(", "),[C,t]);a(()=>{const e=e=>{const t=e.target;$.current&&!$.current.contains(t)&&(y(!1),k(""))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const D=s(e=>{if(u){const t=C.includes(e)?C.filter(t=>t!==e):[...C,e];r(t)}else r(e),y(!1),k("")},[u,C,r]),L=s(e=>{e.stopPropagation(),r(u?[]:"")},[u,r]),R=s(e=>{if(h)return;const t=e.key;if(!m&&("Enter"===t||" "===t||"ArrowDown"===t))return e.preventDefault(),y(!0),void w(0);if(m){if("Escape"===t)return y(!1),void k("");if("ArrowDown"===t)e.preventDefault(),w(e=>Math.min(e+1,z.length-1));else if("ArrowUp"===t)e.preventDefault(),w(e=>Math.max(e-1,0));else if("Enter"===t&&S>=0&&S<z.length){e.preventDefault();const t=z[S];t.disabled||D(t.value)}}},[h,m,S,z,D]),T={...ne({},{focused:m,error:!!g}),display:"flex",alignItems:"center",justifyContent:"space-between",cursor:h?"not-allowed":"pointer",minHeight:"38px",userSelect:"none"},A=(e,t)=>{const n=C.includes(e.value),r=t===S,i={padding:"8px 12px",cursor:e.disabled?"not-allowed":"pointer",backgroundColor:r?"#f3f4f6":n?"#eff6ff":"transparent",color:e.disabled?"#9ca3af":"#1f2937",display:"flex",alignItems:"center",gap:"8px",fontSize:"14px"};return o("div",{key:e.value,style:i,onClick:e.disabled?void 0:()=>D(e.value),onMouseEnter:()=>w(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)},F=o("span",{style:{marginLeft:"8px",fontSize:"10px",transition:"transform 0.15s",transform:m?"rotate(180deg)":"rotate(0deg)",color:"#6b7280"}},"▼"),E=o("div",{style:T,onClick:h?void 0:()=>{y(!m),w(-1)},onKeyDown:R,tabIndex:h?-1:0,role:"combobox","aria-expanded":m?"true":"false","aria-haspopup":"listbox"},o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:I?"#1f2937":"#9ca3af"}},I||i),o("span",{style:{display:"flex",alignItems:"center",gap:"4px"}},f&&C.length>0?o("span",{onClick:L,style:{cursor:"pointer",color:"#9ca3af",fontSize:"14px",lineHeight:"1"},role:"button","aria-label":"Clear selection"},"✕"):null,F)),W=p&&m?o("input",{type:"text",value:v,onInput:e=>{k(e.target.value),w(0)},placeholder:"Search...",style:{width:"100%",boxSizing:"border-box",padding:"8px 12px",border:"none",borderBottom:"1px solid #e5e7eb",outline:"none",fontSize:"14px"}}):null,B=m?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}=M;for(const n of r)e.push(A(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(A(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:x,error:g,helpText:b,disabled:h},o("div",{ref:$,style:{position:"relative"}},E,B))},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,p=t.map(e=>o(We,{key:e.id,item:e,collapsed:n,selectedId:i,onSelect:l,depth:0}));return o(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",n=!1!==e.animated,r=p(),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:Z({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:Z({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:Z({width:l??"100%",height:a??"100px",borderRadius:e.borderRadius??"4px",animated:n,animId:r})}))},exports.Slider=function(e){const{value:t,onChange:n,min:r=0,max:i=100,step:p=1,showValue:u=!1,showTicks:f=!1,disabled:h=!1,marks:g,range:x=!1,label:b,error:m}=e,y=c(null),[v,k]=l(null),S=d(()=>{if(x&&Array.isArray(t))return t;const e="number"==typeof t?t:0;return[e,e]},[t,x]),w=e=>{const t=Math.round((e-r)/p)*p+r;return Math.max(r,Math.min(i,t))},$=e=>(e-r)/(i-r)*100,C=s(e=>{if(!y.current)return r;const t=y.current.getBoundingClientRect(),n=Math.max(0,Math.min(1,(e.clientX-t.left)/t.width));return w(r+n*(i-r))},[r,i,p]),z=s(e=>t=>{h||(t.preventDefault(),k(e))},[h]),M=s(e=>{if(h)return;const t=C(e);if(x){const e=Math.abs(t-S[0]),o=Math.abs(t-S[1]);n(e<=o?[w(t),S[1]]:[S[0],w(t)])}else n(w(t))},[h,C,x,S,n,r,i,p]);a(()=>{if(!v)return;const e=e=>{const t=C(e);"single"===v?n(w(t)):"start"===v?n([Math.min(w(t),S[1]),S[1]]):"end"===v&&n([S[0],Math.max(S[0],w(t))])},t=()=>k(null);return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[v,C,S,n,r,i,p]);const I=s(e=>{if(h)return;let o=0;if("ArrowRight"===e.key||"ArrowUp"===e.key)o=p;else{if("ArrowLeft"!==e.key&&"ArrowDown"!==e.key)return;o=-p}e.preventDefault(),x||n(w(("number"==typeof t?t:0)+o))},[h,p,x,t,n,r,i]),D={position:"relative",width:"100%",height:"6px",backgroundColor:"#e5e7eb",borderRadius:"3px",cursor:h?"not-allowed":"pointer"},L=x?$(S[0]):0,R={position:"absolute",top:"0",left:`${L}%`,width:$(x?S[1]:S[0])-L+"%",height:"100%",backgroundColor:h?"#9ca3af":"#3b82f6",borderRadius:"3px"},T=e=>b?"start"===e?`${b} minimum`:"end"===e?`${b} maximum`:b:"start"===e?"Minimum value":"end"===e?"Maximum value":"Value",A=(e,t,n)=>o("div",{style:{position:"absolute",top:"50%",left:`${e}%`,transform:"translate(-50%, -50%)",width:"18px",height:"18px",borderRadius:"50%",backgroundColor:"#ffffff",border:"2px solid "+(h?"#9ca3af":"#3b82f6"),cursor:h?"not-allowed":"grab",boxShadow:"0 1px 3px rgba(0,0,0,0.15)",zIndex:"2"},onMouseDown:z(t),role:"slider","aria-valuenow":String(n),"aria-valuemin":String(r),"aria-valuemax":String(i),"aria-label":T(t),tabIndex:h?-1:0,onKeyDown:I},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(n)):null),F=[];if(f)for(let e=r;e<=i;e+=p)F.push(o("div",{key:`tick-${e}`,style:{position:"absolute",top:"10px",left:`${$(e)}%`,width:"1px",height:"6px",backgroundColor:"#d1d5db",transform:"translateX(-50%)"}}));const E=[];if(g)for(const e of g)E.push(o("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 W={paddingTop:u?"28px":"8px",paddingBottom:g||f?"28px":"8px",opacity:h?"0.6":"1"},B=[];return x?(B.push(A($(S[0]),"start",S[0])),B.push(A($(S[1]),"end",S[1]))):B.push(A($(S[0]),"single",S[0])),o(te,{label:b,error:m},o("div",{style:W},o("div",{ref:y,style:D,onClick:M},o("div",{style:R}),...B,...F,...E)))},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=p(),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,[p,u]=l(e.initialSplit??50),f=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||!f.current)return;const o=f.current.getBoundingClientRect(),r=n?o.width:o.height,l=n?t.clientX-o.left:t.clientY-o.top;if(r<=0)return;const a=i/r*100,s=e.maxSize?e.maxSize/r*100:100-a;let d=l/r*100;d=Math.max(a,Math.min(s,d)),u(d)},o=()=>{h.current&&(h.current=!1,document.body.style.cursor="",document.body.style.userSelect="")};return document.addEventListener("mousemove",t),document.addEventListener("mouseup",o),()=>{document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",o)}},[n,i,e.maxSize]);const x=d(()=>({display:"flex",flexDirection:n?"row":"column",width:"100%",height:"100%",overflow:"hidden",...e.style??{}}),[n,e.style]),b=n?{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",...n?{width:`${r}px`,cursor:"col-resize",height:"100%"}:{height:`${r}px`,cursor:"row-resize",width:"100%"}},y=Array.isArray(e.children)?e.children:[];return o("div",{className:`splitter splitter--${t} ${e.className??""}`.trim(),style:x,ref:f},o("div",{className:"splitter__pane splitter__pane--first",style:b},y[0]??null),o("div",{className:"splitter__divider",style:m,onMouseDown:g,role:"separator","aria-orientation":n?"vertical":"horizontal"}),o("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:n,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<n?"completed":e===n?"active":"pending")(t),i="active"===r,s="completed"===r,f=((e,t,n)=>{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"===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"}},f,g);return o(l?"button":"div",{key:String(t),onClick:l?()=>u(t):void 0,style:{display:"flex",flexDirection:d?"column":"row",alignItems:d?"center":"flex-start",background:"none",border:"none",padding:"0",cursor:l?"pointer":"default",fontFamily:"inherit",outline:"none"},"aria-current":i?"step":void 0},x)})(e,r));const i=(e=>{if(e>=t.length-1)return null;const r=e<n?"#2563eb":"#d1d5db";return o("div",d?{style:{flex:"1",height:"2px",backgroundColor:r,margin:"0 8px",alignSelf:"center",transition:"background-color 0.2s"}}:{style:{width:"2px",flex:"1",minHeight:"24px",backgroundColor:r,marginLeft:("dot"===a?p:c)/2-1+"px",transition:"background-color 0.2s"}})})(r);i&&f.push(i)}),o("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",n=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]),h=s(n=>{const o=e.tabs.filter(e=>!e.disabled),r=o.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(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(),f(o[s].id);const t=u.current;if(t){const n=t.querySelectorAll('[role="tab"]')[e.tabs.indexOf(o[s])];n&&n.focus()}}},[e.tabs,p,t,f]),g="left"===t||"right"===t,x="bottom"===t||"right"===t,b=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"},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"===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:()=>f(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:b},o("div",{className:"tabs__list",role:"tablist","aria-orientation":g?"vertical":"horizontal",style:m,ref:u},...v),o("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:n,variant:r="subtle",size:i="md",removable:l=!1,onRemove:a,icon:s,onClick:d,disabled:c=!1}=e,p=function(e,t,n,o,r){const i=X[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),u=[];return s&&u.push(o("span",{key:"icon",style:{display:"inline-flex",flexShrink:"0"}},s)),u.push(o("span",{key:"label"},t)),l&&u.push(o("button",{key:"remove",type:"button",style:V,onClick:e=>{e.stopPropagation(),!c&&a&&a()},"aria-label":`Remove ${t}`,disabled:c},"×")),o("span",{style:p,role:d?"button":void 0,tabIndex:d&&!c?"0":void 0,onClick:!c&&d?d:void 0,"aria-disabled":c?"true":void 0},...u)},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??ue,p=e.toolbarStyle??{},u=e.editorStyle??{};a(()=>{r.current&&void 0!==e.value&&(r.current.innerHTML=e.value)},[]);const f=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:p.backgroundColor??"#f9fafb",borderBottom:p.borderBottom??"1px solid #e5e7eb",borderRadius:"6px 6px 0 0"}},...d.map(t=>{const n=fe[t];return n?o("button",{key:t,type:"button",title:n.label,onClick:()=>f(n.command,n.value),disabled:e.disabled||e.readOnly,style:{padding:"4px 8px",border:"none",borderRadius:"4px",backgroundColor:"transparent",color:p.buttonColor??"#374151",cursor:e.disabled?"not-allowed":"pointer",fontSize:p.buttonSize??"13px",fontWeight:"bold"===t?"700":"italic"===t?"400":"500",fontStyle:"italic"===t?"italic":"normal",textDecoration:"underline"===t?"underline":"strikethrough"===t?"line-through":"none",minWidth:"28px",textAlign:"center",lineHeight:"1.4"}},n.icon):null})),b=o("div",{ref:r,id: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:()=>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,b))},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.TimePicker=function(e){const{value:t,onChange:n,format:r="24h",minuteStep:i=1,disabled:a=!1,label:c,error:p,showSeconds:u=!1,timezone:f,showTimezone:h=!1,timezones:g=he,onTimezoneChange:x}=e,[b,m]=l(!1),y=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}}(t),[t]),v="12h"===r,k=y.hour>=12,S=v?y.hour%12||12:y.hour,w=s((e,t,o)=>{const r=Math.max(0,Math.min(23,e)),i=Math.max(0,Math.min(59,t)),l=Math.max(0,Math.min(59,o??0));n(u?`${ge(r)}:${ge(i)}:${ge(l)}`:`${ge(r)}:${ge(i)}`)},[n,u]),$=s(e=>{let t=parseInt(e.target.value,10)||0;v&&(t%=12,k&&(t+=12)),w(t,y.minute,y.second)},[v,k,y.minute,y.second,w]),C=s(e=>{const t=parseInt(e.target.value,10)||0;w(y.hour,t,y.second)},[y.hour,y.second,w]),z=s(e=>{const t=parseInt(e.target.value,10)||0;w(y.hour,y.minute,t)},[y.hour,y.minute,w]),M=s(()=>{if(a)return;const e=k?y.hour-12:y.hour+12;w(e,y.minute,y.second)},[a,k,y.hour,y.minute,y.second,w]),I=s(e=>{a||w(y.hour+e,y.minute,y.second)},[a,y.hour,y.minute,y.second,w]),D=s(e=>{a||w(y.hour,y.minute+e*i,y.second)},[a,y.hour,y.minute,y.second,i,w]),L=s(e=>{a||w(y.hour,y.minute,y.second+e)},[a,y.hour,y.minute,y.second,w]),R=s(e=>{const t=e.target.value;x&&x(t)},[x]),T={display:"inline-flex",alignItems:"center",gap:"4px",...ne({},{focused:b,error:!!p})},A={display:"flex",flexDirection:"column",alignItems:"center"},F={background:"none",border:"none",cursor:a?"not-allowed":"pointer",fontSize:"10px",padding:"0 4px",color:"#6b7280",lineHeight:"1"},E={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:a?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},B=o("div",{style:A},o("button",{type:"button",style:F,onClick:()=>I(1),disabled:a},"▲"),o("input",{type:"text",value:ge(S),onChange:$,style:E,disabled:a,"aria-label":"Hour",onFocus:()=>m(!0),onBlur:()=>m(!1)}),o("button",{type:"button",style:F,onClick:()=>I(-1),disabled:a},"▼")),H=o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"),N=o("div",{style:A},o("button",{type:"button",style:F,onClick:()=>D(1),disabled:a},"▲"),o("input",{type:"text",value:ge(y.minute),onChange:C,style:E,disabled:a,"aria-label":"Minute",onFocus:()=>m(!0),onBlur:()=>m(!1)}),o("button",{type:"button",style:F,onClick:()=>D(-1),disabled:a},"▼")),P=u?o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"):null,j=u?o("div",{style:A},o("button",{type:"button",style:F,onClick:()=>L(1),disabled:a},"▲"),o("input",{type:"text",value:ge(y.second),onChange:z,style:E,disabled:a,"aria-label":"Second",onFocus:()=>m(!0),onBlur:()=>m(!1)}),o("button",{type:"button",style:F,onClick:()=>L(-1),disabled:a},"▼")):null,_=v?o("button",{type:"button",style:W,onClick:M,disabled:a,"aria-label":"Toggle AM/PM"},k?"PM":"AM"):null,O={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:a?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},Y=f&&!h?o("span",{style:{marginLeft:"8px",fontSize:"12px",fontWeight:"600",color:"#6b7280"}},f):null,q=h?o("select",{style:O,value:f??g[0],onChange:R,disabled:a,"aria-label":"Timezone"},...g.map(e=>o("option",{key:e,value:e},e))):null,G=[B,H,N];return P&&G.push(P),j&&G.push(j),_&&G.push(_),Y&&G.push(Y),q&&G.push(q),o(te,{label:c,error:p,disabled:a},o("div",{style:T},...G))},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,p=xe[a],u=s(()=>{l||n(!t)},[l,t,n]),f=s(e=>{l||" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),n(!t))},[l,t,n]),h={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"},g=t?p.trackW-p.thumbSize-p.offset:p.offset,x={width:`${p.thumbSize}px`,height:`${p.thumbSize}px`,borderRadius:"50%",backgroundColor:"#ffffff",position:"absolute",top:`${p.offset}px`,left:`${g}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?o("span",{style:{fontSize:"14px",color:"#374151"}},r):null,y=o("div",{style:h},o("div",{style:x}));return o("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:n="md",variant:r="flat"}=e,i=Be[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(He,{key:e.id,item:e,size:n,variant:r}));return o(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:n="top",delay:r=200,maxWidth:i="250px",children:d}=e,[p,u]=l(!1),[f,h]=l(null),g=c(null),x=c(null),b=`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))}u(!0)},r)},[r,n]),y=s(()=>{x.current&&(clearTimeout(x.current),x.current=null),u(!1)},[]);a(()=>()=>{x.current&&clearTimeout(x.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=[o("div",{ref:g,style:{display:"inline-block"},onMouseEnter:m,onMouseLeave:y,onFocus:m,onBlur:y,"aria-describedby":p?b:void 0},d)];return p&&f&&k.push(o("div",{id:b,style:v,role:"tooltip"},t,o("div",{style:tt(n)}))),o("div",{style:{display:"inline-block",position:"relative"}},...k)},exports.TreeNav=function(e){const{root:t,onNodeClick:n,onNodeExpand:r,onNodeCollapse:i,selectedId:a,expandAll:c=!1,lineColor:p="#000",lineWidth:u=1,indentPx:f=20,iconExpanded:h="−",iconCollapsed:g="+",nodeStyle:x={},wrapperStyle:b,renderNode:m}=e,[y,v]=l(()=>{const e=Ne.fromData(t);return c&&Pe(e),e}),[k,S]=l(t.id),w=d(()=>je(y),[y]),$=s(()=>{v(e=>{const t=Object.create(Object.getPrototypeOf(e));return Object.assign(t,e),t})},[]),C=s(e=>{e.toggle(),e.expanded?r?.(e):i?.(e),$()},[r,i,$]),z=s(e=>{S(e.id),n?.(e)},[n]),M=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&&S(e.id);break}case"ArrowUp":{t.preventDefault();const e=w[n-1];e&&S(e.id);break}case"ArrowRight":t.preventDefault(),o.isLeaf()||(o.expanded?o.children.length>0&&S(o.children[0].id):C(o));break;case"ArrowLeft":t.preventDefault(),!o.isLeaf()&&o.expanded?C(o):o.parent&&S(o.parent.id);break;case"Enter":t.preventDefault(),z(o);break;case" ":t.preventDefault(),o.isLeaf()||C(o);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,C,z]),I=w.map(e=>o(Oe,{key:e.id,node:e,isSelected:e.id===a,indentPx:f,lineColor:p,lineWidth:u,iconExpanded:h,iconCollapsed:g,nodeStyle:x,renderNode:m,onToggle:C,onClick:z,focusedId:k}));return o(Se,{role:"tree",ariaLabel:"Tree navigation",styling:b,keyboardNav:!1},o("div",{onKeyDown:M,style:{outline:"none"}},...I))},exports.TreeNode=Ne,exports.VideoPlayer=function(e){const t=!1!==e.controls,n=c(null);p();const[r,i]=l(!1),[d,u]=l(0),[f,h]=l(0),[g,x]=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=n.current;if(!t)return;const o=()=>{i(!0),e.onPlay&&e.onPlay()},r=()=>{i(!1),e.onPause&&e.onPause()},l=()=>{i(!1),e.onEnded&&e.onEnded()},a=()=>{u(t.currentTime),h(t.duration),e.onTimeUpdate&&e.onTimeUpdate(t.currentTime,t.duration)},s=()=>{h(t.duration)};return t.addEventListener("play",o),t.addEventListener("pause",r),t.addEventListener("ended",l),t.addEventListener("timeupdate",a),t.addEventListener("loadedmetadata",s),()=>{t.removeEventListener("play",o),t.removeEventListener("pause",r),t.removeEventListener("ended",l),t.removeEventListener("timeupdate",a),t.removeEventListener("loadedmetadata",s)}},[e.onPlay,e.onPause,e.onEnded,e.onTimeUpdate]);const 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},[]),C=s(e=>{const t=n.current,o=parseFloat(e.target.value);t&&(t.volume=o,t.muted=0===o,x(o),m(0===o))},[]),z=s(()=>{const e=n.current;e&&e.requestFullscreen&&e.requestFullscreen()},[]);if(!t)return o("video",{ref:n,src:e.src,poster:e.poster,controls:!0,autoplay:!!e.autoPlay||void 0,loop:!!e.loop||void 0,muted:!!e.muted||void 0,style:{width: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=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:y?"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:`${M}%`,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(f)}`),o("input",{type:"range",min:"0",max:"1",step:"0.05",value:String(b?0:g),oninput:C,"aria-label":"Volume",style:{width:"60px",cursor:"pointer"}}),o("button",{"aria-label":"Fullscreen",onclick:z,style:I},"⛶"));return o("div",{style:{position:"relative",width:k,height:S,backgroundColor:"#000",overflow:"hidden"},onmouseenter:()=>v(!0),onmouseleave:()=>{r&&v(!1)}},o("video",{ref:n,src:e.src,poster:e.poster,autoplay:!!e.autoPlay||void 0,loop:!!e.loop||void 0,muted:!!e.muted||void 0,playsinline:!0,onclick:w,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"}}),D)},exports.VirtualScroll=function(e){const{items:t,renderItem:n,itemHeight:r,overscan:i=5,height:a}=e,[d,p]=l(0),u=c(null),f=t.length*r,h=parseInt(a,10)||400,g=Math.ceil(h/r),x=Math.max(0,Math.floor(d/r)-i),b=Math.min(t.length,Math.floor(d/r)+g+i),m=s(e=>{const t=e.target;p(t.scrollTop)},[]),y=[];for(let e=x;e<b;e++)y.push(o("div",{key:String(e),style:{position:"absolute",top:e*r+"px",left:"0",right:"0",height:`${r}px`,overflow:"hidden"}},n(t[e],e)));return o("div",{ref:u,style:{...K,height:a},onScroll:m},o("div",{style:{height:`${f}px`,position:"relative",width:"100%"}},...y))},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?(p=e.legend,o("div",{className:"viz-legend",style:{display:"flex",flexDirection:(u={align:i,fontSize:e.legendFontSize??"12px",gap:e.legendGap??16,direction:"left"===n||"right"===n?"column":"row"}).direction,flexWrap:"wrap",gap:`${u.gap}px`,justifyContent:u.align,alignItems:"center",fontSize:u.fontSize,color:"#6b7280",flexShrink:"0"}},...p.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 p,u;const f=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},...f)},exports.buildInputStyle=ne,exports.buildNavItemStyle=we,exports.buildRotationMatrix=vt,exports.computeSlices=xt,exports.createToaster=Je,exports.describeArc=gt,exports.generateEdges=yt,exports.generateHypercube=zt,exports.generatePalette=It,exports.generateVertices=mt,exports.numRotationAngles=Mt,exports.projectTo2D=Ct,exports.transformVec=$t,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=Mt(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(()=>zt(t,s,o,r),[t,s,o,r]),angles:s,setAngles:c}},exports.useLineGraphScales=ut,exports.useToast=function(e={}){const t=c(null);t.current||(t.current=Je(e));const n=t.current,r=s(()=>o(et,{toaster:n}),[n]);return{toast:n.toast,dismiss:n.dismiss,dismissAll:n.dismissAll,ToastContainer:r}};
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"},F={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",fontSize:"13px",color:"#6b7280"},L={padding:"4px 10px",margin:"0 2px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#fff",cursor:"pointer",fontSize:"13px"},R={...L,backgroundColor:"#3b82f6",color:"#fff",borderColor:"#3b82f6"},A={...L,opacity:"0.5",cursor:"default"},D={cursor:"pointer",width:"16px",height:"16px"};function T(e,t,o){return e!==t?"↕":"asc"===o?"↑":"↓"}function W(e){return e<10?`0${e}`:String(e)}const E={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:"#1f2937"},_={borderBottom:"1px solid #e5e7eb"},q={cursor:"pointer",transition:"background-color 0.15s ease"},O={backgroundColor:"#eff6ff"},U={padding:"24px",textAlign:"center",color:"#9ca3af",fontSize:"14px"},Y={padding:"10px 14px",borderBottom:"1px solid #e5e7eb",backgroundColor:"#f9fafb",fontWeight:"600",fontSize:"13px",color:"#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"}},V={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'},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 Fe(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(Fe,{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 Le(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(Fe,{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 Ae={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={...Ae,backgroundColor:"#2563eb",color:"#ffffff",borderColor:"#2563eb",fontWeight:"600"},Te={...Ae,color:"#9ca3af",cursor:"default",opacity:"0.5"},We={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"36px",height:"36px",color:"#6b7280",fontSize:"14px",userSelect:"none"};function Ee(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(Ee,{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 Ue(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 Ye(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 Ve(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 Ke=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-${++Ke}-${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,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 lt(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}const at=40,st=1e6;function dt(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 ct(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 pt(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 ut(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:pt(r,i,6),yTicks:pt(l,a,6),xMin:r,xMax:i,yMin:l,yMax:a}}(e,t,o,n),[e,t,o,n])}function ft(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function gt(e,t,o,n){return{x:e+o*Math.cos(n),y:t+o*Math.sin(n)}}function xt(e,t,o,n,r,i){const l=r-Math.PI/2,a=i-Math.PI/2,s=gt(e,t,n,l),d=gt(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=gt(e,t,o,a),u=gt(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 ht(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 bt(e,t,o,n,r){return{x:o+e*Math.cos(t)*r,y:n-e*Math.sin(t)*r}}function mt(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 yt(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 vt(e,t){let o=kt(e),n=0;for(let r=0;r<e;r++)for(let i=r+1;i<e;i++)n<t.length&&(o=wt(o,St(e,r,i,t[n]))),n++;return o}function kt(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 St(e,t,o,n){const r=kt(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 wt(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 Ct(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 $t(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 zt(e,t=[],o=.3,n=1){const r=mt(e),i=yt(e),l=vt(e,t);return{vertices:r.map((e,t)=>{const r=$t(Ct(l,e),o);return{id:t,position:e,x:r.x*n,y:r.y*n,depth:r.depth}}),edges:i,dimension:e}}function Mt(e){return e*(e-1)/2}function It(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 Ft=[{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"}],Lt=["🔊","📶","🔋"];let Rt=1;const At=["File","Edit","View","Insert","Format","Tools","Help"],Dt={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"}]},Tt=[{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"}}],Wt=[{label:"Align left",text:"≡",command:"justifyLeft"},{label:"Align center",text:"≣",command:"justifyCenter"},{label:"Align right",text:"≢",command:"justifyRight"}],Et=["1","2","3","4","5","6","7"],Bt={1:"8",2:"10",3:"12",4:"14",5:"18",6:"24",7:"36"};function Nt(e){return e.trim().split(/\s+/).filter(e=>e.length>0).length}const Pt=["File","Edit","Selection","View","Go","Run","Terminal","Help"],Ht={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"}]},jt=[{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}],_t={"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"]',"}"]},qt=_t["App.ts"],Ot=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"]),Ut=new Set(["string","number","boolean","void","null","undefined","any","never","unknown","object","interface","type","enum"]),Yt="#569cd6",Gt="#d4d4d4",Xt=[{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]}],Vt=[{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}],Kt=[{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}],Jt=[{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}],Zt=[{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}],Qt=[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],eo=[{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}],to=[{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}],oo=["09:30","10:00","10:30","11:00","11:30","12:00"];function no(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function ro(e){return e.toFixed(2)}const io={backgroundColor:"#1a1a2e",borderRadius:"4px",padding:"12px",border:"1px solid #2a2a4a",overflow:"auto",display:"flex",flexDirection:"column"},lo={fontSize:"12px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#8888aa",marginBottom:"8px",flexShrink:"0"},ao={width:"100%",borderCollapse:"collapse",fontSize:"12px"},so={textAlign:"left",padding:"4px 6px",borderBottom:"1px solid #2a2a4a",color:"#8888aa",fontWeight:"600",fontSize:"11px"},co={padding:"3px 6px",borderBottom:"1px solid #16162a",color:"#ccccdd",fontSize:"12px"},po={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 F=(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(F(v,.5*$,"4",h)),I.push(F(k,.75*$,"3",h)),s&&I.push(F(S,.85*$,"1.5","#ef4444")),I.push(n("circle",{cx:String(w),cy:String(C),r:"4",fill:h}));const L=[n("svg",{width:String(o),height:String(o),viewBox:`0 0 ${o} ${o}`,xmlns:"http://www.w3.org/2000/svg"},...I)];return r&&L.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"}},...L)},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,F=ot(z,I,S,w,a),L=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=F.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,F,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]),A=s(()=>{const e=[];for(let o=0;o<t.length;o++){const r=t[o],i=F.valueScale(r.value),a=F.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(F.barThickness),height:String(i),rx:String(c),ry:String(c),fill:s},u={x:String(e+F.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(F.barThickness),rx:String(c),ry:String(c),fill:s},u={x:String(t+i+6),y:String(e+F.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+F.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+F.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},r.label))}return e},[t,F,l,c,p,h,y,x,k]),D=s(()=>{if(!b)return[];const e=[];for(let t=0;t<b.length;t++){const o=b[t],r=F.categoryScale(t);let i=0;for(let l=0;l<o.values.length;l++){const a=o.values[l],s=F.valueScale(a.value),d=F.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(F.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+F.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(F.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+F.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=F.valueScale(i);y?e.push(n("text",{key:`stotal-${t}`,x:String(x+r+F.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+F.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+F.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+F.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},o.label))}return e},[b,F,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=F.categoryScale(o),l=2,a=Math.max(1,(F.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=F.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+F.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+F.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},r.label))}return t},[b,$,F,c,p,h,y,x,k]),W=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]),E=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=L(),N=R(),P=W(),H=E();let j;return j=C&&m?T():C?D():A(),n("svg",{width:String(o),height:String(r),viewBox:`0 0 ${o} ${r}`,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:a=200,xRange:d=[-5,5],yRange:p=[-5,5],showGrid:u=!0,showAxes:f=!0,pointRadius:g=3,pointColor:x="#3b82f6",curveColor:h="#3b82f6",gridColor:b="#e2e8f0",axisColor:m="#94a3b8",onPointClick:y,onPointDoubleClick:v,onPointContextMenu:k,onPointHover:S}=e,[w,C]=l(d[0]),[$,z]=l(d[1]),[M,I]=l(p[0]),[F,L]=l(p[1]),R=c(!1),A=c(null),D=s(e=>at+(e-w)/($-w)*(t-80),[w,$,t]),T=s(e=>o-at-(e-M)/(F-M)*(o-80),[M,F,o]),W=s(e=>w+(e-at)/(t-80)*($-w),[w,$,t]),E=s(e=>M+(o-at-e)/(o-80)*(F-M),[M,F,o]),B=s(e=>{const t=e;R.current=!0,A.current={mx:t.clientX,my:t.clientY,x0:w,x1:$,y0:M,y1:F}},[w,$,M,F]),N=s(e=>{if(!R.current||!A.current)return;const n=e,r=A.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);C(r.x0-a),z(r.x1-a),I(r.y0+s),L(r.y1+s)},[t,o]),P=s(()=>{R.current=!1,A.current=null},[]),H=s(e=>{const t=e;t.preventDefault();const o=t.currentTarget.getBoundingClientRect(),n=t.clientX-o.left,r=t.clientY-o.top,i=W(n),l=E(r),a=t.deltaY>0?1.1:1/1.1,s=($-w)*a,d=(F-M)*a;if(s<.01||d<.01||s>st||d>st)return;const c=(i-w)/($-w),p=(l-M)/(F-M);C(i-c*s),z(i+(1-c)*s),I(l-p*d),L(l+(1-p)*d)},[w,$,M,F,W,E]),j=[];if(j.push(n("rect",{x:0,y:0,width:t,height:o,fill:"white",key:"bg"})),u){const e=it(w,$),r=it(M,F);for(let t=0;t<e.length;t++){const r=D(e[t]);j.push(n("line",{x1:r,y1:at,x2:r,y2:o-at,stroke:b,"stroke-width":.5,key:`gx-${t}`})),j.push(n("text",{x:r,y:o-at+14,"text-anchor":"middle","font-size":10,fill:m,key:`lx-${t}`},lt(e[t])))}for(let e=0;e<r.length;e++){const o=T(r[e]);j.push(n("line",{x1:at,y1:o,x2:t-at,y2:o,stroke:b,"stroke-width":.5,key:`gy-${e}`})),j.push(n("text",{x:34,y:o+3,"text-anchor":"end","font-size":10,fill:m,key:`ly-${e}`},lt(r[e])))}}if(f){const e=Math.max(at,Math.min(t-at,D(0))),r=Math.max(at,Math.min(o-at,T(0)));j.push(n("line",{x1:at,y1:r,x2:t-at,y2:r,stroke:m,"stroke-width":1,key:"x-axis"})),j.push(n("line",{x1:e,y1:at,x2:e,y2:o-at,stroke:m,"stroke-width":1,key:"y-axis"}))}if(i){const e=($-w)/a,t=[];for(let o=0;o<=a;o++){const n=w+o*e,r=i(n);if(!isFinite(r))continue;const l=D(n),a=T(r);t.push(`${0===t.length?"M":"L"}${l},${a}`)}t.length>0&&j.push(n("path",{d:t.join(" "),fill:"none",stroke:h,"stroke-width":1.5,key:"curve"}))}const _=(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:D(t.x),cy:T(t.y),r:g,fill:x,cursor:"pointer",key:`pt-${e}`};y&&(o.onclick=_(0,y,e,t)),v&&(o.ondblclick=_(0,v,e,t)),k&&(o.oncontextmenu=_(0,k,e,t)),S&&(o.onmouseover=_(0,S,e,t)),j.push(n("circle",o))}const q=n("defs",{key:"defs"},n("clipPath",{id:"plot-clip"},n("rect",{x:at,y:at,width:t-80,height:o-80})));return n("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:o,viewBox:`0 0 ${t} ${o}`,style:"user-select: none; touch-action: none;",onmousedown:B,onmousemove:N,onmouseup:P,onmouseleave:P,onwheel:H},q,...j)},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{value:t,onChange:o,presets:r=re,showInput:i=!0,showAlpha:d=!1,disabled:p=!1,label:u}=e,[f,g]=l(!1),[x,h]=l(t),b=c(null);a(()=>{h(t)},[t]),a(()=>{const e=e=>{b.current&&!b.current.contains(e.target)&&g(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const m=s(e=>{p||o(le(e))},[p,o]),y=s(e=>{const t=e.target.value;h(t);const n=t.startsWith("#")?t:`#${t}`;ie(n)&&o(le(n))},[o]),v=s(()=>{ie(x.startsWith("#")?x:`#${x}`)||h(t)},[x,t]),k={width:"36px",height:"36px",borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:t,cursor:p?"not-allowed":"pointer",flexShrink:"0"},S={display:"grid",gridTemplateColumns:"repeat(10, 1fr)",gap:"4px",marginBottom:i?"8px":"0"},w=r.map(e=>{const o=le(e)===le(t);return n("div",{key:e,style:{width:"20px",height:"20px",borderRadius:"3px",backgroundColor:e,cursor:p?"not-allowed":"pointer",border:o?"2px solid #1f2937":"1px solid #e5e7eb",boxSizing:"border-box"},onClick:()=>m(e),title:e})}),C=i?n("div",{style:{display:"flex",alignItems:"center",gap:"4px"}},n("div",{style:{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:t,border:"1px solid #d1d5db",flexShrink:"0"}}),n("input",{type:"text",value:x,onInput:y,onBlur:v,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,$=f?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:S},...w),C):null;return n(te,{label:u,disabled:p},n("div",{ref:b,style:{position:"relative"}},n("div",{style:{display:"flex",alignItems:"center",gap:"8px"},onClick:p?void 0:()=>g(!f)},n("div",{style:k}),i?n("span",{style:{fontSize:"14px",fontFamily:"monospace",color:"#1f2937"}},t):null),$))},exports.ColorWheel=function(e){const{value:t="#000000",onChange:o,size:r=32,showLabel:i=!0,disabled:a=!1,label:d}=e,[p,u]=l(t),f=c(null),g=s((...e)=>{const t=e[0].target.value;u(t),o?.(t)},[o]),x={width:`${r}px`,height:`${r}px`,borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:p,cursor:a?"not-allowed":"pointer",position:"relative",overflow:"hidden"},h={position:"absolute",top:"0",left:"0",width:"100%",height:"100%",opacity:"0",cursor:a?"not-allowed":"pointer",border:"none",padding:"0"};return n("div",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"4px"}},d?n("label",{style:{fontSize:"12px",color:"#64748b",fontWeight:"500"}},d):null,n("div",{style:x},n("input",{ref:f,type:"color",value:p,onInput:g,disabled:a,style:h})),i?n("span",{style:{fontSize:"11px",fontFamily:"monospace",color:"#64748b"}},p):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=dt,onPointClick:f,onPointHover:g,onPointDoubleClick:x,onPointContextMenu:h}=e,[b,m]=l(r[0]),[y,v]=l(r[1]),[k,S]=l(i[0]),[w,C]=l(i[1]),$=c(null),z=c(!1),M=c(null),I=s((e,n)=>({re:b+e/t*(y-b),im:w-n/o*(w-k)}),[b,y,k,w,t,o]);a(()=>{const e=$.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}=I(o,e),l=u(n,r,d),[a,s,c]=ct(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)},[b,y,k,w,t,o,d,p,u,I]);const F=s(e=>{const t=e.target.getBoundingClientRect(),o=e.clientX-t.left,n=e.clientY-t.top,{re:r,im:i}=I(o,n);return{re:r,im:i,iterations:u(r,i,d),event:e}},[I,u,d]),L=s(e=>{z.current=!0,M.current={x:e.clientX,y:e.clientY,rMin:b,rMax:y,iMin:k,iMax:w}},[b,y,k,w]),R=s(e=>{if(g&&g(F(e)),!z.current||!M.current)return;const n=M.current,r=e.clientX-n.x,i=e.clientY-n.y,l=(n.rMax-n.rMin)/t,a=(n.iMax-n.iMin)/o;m(n.rMin-r*l),v(n.rMax-r*l),S(n.iMin+i*a),C(n.iMax+i*a)},[t,o,g,F]),A=s(()=>{z.current=!1},[]),D=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}=I(n,r);m(i+(b-i)*t),v(i+(y-i)*t),S(l+(k-l)*t),C(l+(w-l)*t)},[I,b,y,k,w]),T=s(e=>{f&&f(F(e))},[f,F]),W=s(e=>{x&&x(F(e))},[x,F]),E=s(e=>{e.preventDefault(),h&&h(F(e))},[h,F]);return n("canvas",{ref:$,width:t,height:o,style:{cursor:"crosshair"},onmousedown:L,onmousemove:R,onmouseup:A,onmouseleave:A,onwheel:D,onclick:T,ondblclick:W,oncontextmenu:E})},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),[W,E]=l("asc"),[B,N]=l([]),[P,H]=l({}),j=i??v,_=c??S,q=p??W,O=g??B,U=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]),Y=d(()=>{if(!_)return U;const e=[...U];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},[U,_,q]),G=Y.length,X=r?Math.max(1,Math.ceil(G/r)):1,V=r?Y.slice(j*r,(j+1)*r):Y,K=s(e=>{a?a(e):k(e)},[a]),J=s(e=>{const t=_===e&&"asc"===q?"desc":"asc";u?u(e,t):(w(e),E(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=V.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)},[V,O,r,j,x]),ee=s((e,t)=>{H(o=>({...o,[e]:t})),K(0)},[K]),te=t.some(e=>e.filterable),oe=m?"6px 8px":z.padding,ne=[];if(f){const e=V.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:D,"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,"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<V.length;e++){const o=V[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:D,"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?A:L,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(X,l+i);a-l<i&&(l=Math.max(0,a-i)),l>0&&(o.push(n("button",{key:"p0",style:L,onClick:()=>K(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:L,onClick:e!==j?()=>K(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:L,onClick:()=>K(X-1)},String(X)))),o.push(n("button",{key:"next",style:j>=X-1?A:L,onClick:j<X-1?()=>K(j+1):void 0,disabled:j>=X-1,"aria-label":"Next page"},"Next →")),le=n("div",{style:F},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{value:t,onChange:o,format:r="YYYY-MM-DD",minDate:i,maxDate:p,disabled:u=!1,placeholder:f="Select date...",label:g,error:x}=e,h=d(()=>de(t),[t]),b=d(()=>de(i),[i]),m=d(()=>de(p),[p]),[y,v]=l(!1),[k,S]=l(()=>h?h.getFullYear():(new Date).getFullYear()),[w,C]=l(()=>h?h.getMonth():(new Date).getMonth()),$=c(null),z=d(()=>new Date,[]);a(()=>{const e=e=>{$.current&&!$.current.contains(e.target)&&v(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const M=s(()=>{C(e=>0===e?(S(e=>e-1),11):e-1)},[]),I=s(()=>{C(e=>11===e?(S(e=>e+1),0):e+1)},[]),F=s(e=>{const t=new Date(k,w,e);b&&t<b||m&&t>m||(o(function(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}(t)),v(!1))},[k,w,o,b,m]),L=h?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"))}(h,r):"",R=d(()=>{const e=new Date(k,w,1).getDay(),t=new Date(k,w+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},[k,w]),A={...oe({},{focused:y,error:!!x}),cursor:u?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",minHeight:"38px",userSelect:"none"},D={background:"none",border:"none",cursor:"pointer",fontSize:"16px",padding:"4px 8px",color:"#374151",borderRadius:"4px"},T=se.map(e=>n("div",{key:e,style:{padding:"4px"}},e)),W=R.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(k,w,e),i=ce(r,z),l=!!h&&ce(r,h),a=b&&r<b||m&&r>m;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)},String(e))});return n("div",{key:`row-${t}`,style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)"}},...o)}),E=y?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:D,onClick:M},"◀"),n("span",{style:{fontWeight:"600",fontSize:"14px",color:"#1f2937"}},`${ae[w]} ${k}`),n("button",{type:"button",style:D,onClick:I},"▶")),n("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",textAlign:"center",fontSize:"11px",fontWeight:"600",color:"#6b7280",marginBottom:"4px"}},...T),...W):null;return n(te,{label:g,error:x,disabled:u},n("div",{ref:$,style:{position:"relative"}},n("div",{style:A,onClick:u?void 0:()=>v(!y),tabIndex:u?-1:0,role:"button","aria-label":"Pick a date"},n("span",{style:{color:L?"#1f2937":"#9ca3af"}},L||f),n("span",{style:{color:"#6b7280",fontSize:"14px"}},"📅")),E))},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=`${W(x)}:${W(f)}`;i&&(b+=`:${W(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?`${W(e.getMonth()+1)}/${W(e.getDate())}/${e.getFullYear()}`:"long"===t?new Intl.DateTimeFormat("en-US",{month:"long",day:"numeric",year:"numeric"}).format(e):`${e.getFullYear()}-${W(e.getMonth()+1)}-${W(e.getDate())}`}(c,r,s))),n("div",{style:E,...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={...Ye(r,i),transform:Ue(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{onChange:t,accept:o,multiple:r=!1,maxSize:i,disabled:a=!1,label:d,helpText:p}=e,[u,f]=l([]),[g,x]=l(!1),[h,b]=l(""),m=c(null),y=s(e=>{b("");const o=[];for(const t of e)i&&t.size>i?b(`File "${t.name}" exceeds maximum size of ${pe(i)}`):o.push(t);const n=r?[...u,...o]:o.slice(0,1);f(n),t(n)},[u,r,i,t]),v=s(e=>{if(e.preventDefault(),e.stopPropagation(),x(!1),a)return;const t=e.dataTransfer;if(!t)return;const o=Array.from(t.files);y(o)},[a,y]),k=s(e=>{e.preventDefault(),e.stopPropagation(),a||x(!0)},[a]),S=s(e=>{e.preventDefault(),e.stopPropagation(),x(!1)},[]),w=s(e=>{const t=e.target;t.files&&(y(Array.from(t.files)),t.value="")},[y]),C=s(e=>{const o=u.filter((t,o)=>o!==e);f(o),t(o)},[u,t]),$=s(()=>{a||m.current&&m.current.click()},[a]),z={border:"2px dashed "+(g?"#3b82f6":h?"#ef4444":"#d1d5db"),borderRadius:"8px",padding:"24px",textAlign:"center",cursor:a?"not-allowed":"pointer",backgroundColor:g?"#eff6ff":"#fafafa",transition:"all 0.15s",opacity:a?"0.6":"1"},M={fontSize:"12px",color:"#9ca3af"},I=n("input",{ref:m,type:"file",accept:o,multiple:r,onChange:w,disabled:a,style:{display:"none"},tabIndex:-1}),F=n("div",{style:z,onClick:$,onDrop:v,onDragOver:k,onDragLeave:S,role:"button",tabIndex:a?-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"),o?n("div",{style:M},o):null,i?n("div",{style:M},`Max size: ${pe(i)}`):null),L=u.length>0?n("div",{style:{marginTop:"8px",display:"flex",flexDirection:"column",gap:"4px"}},...u.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(),C(t)},"aria-label":`Remove ${e.name}`},"✕")))):null;return n(te,{label:d,helpText:p,error:h||void 0,disabled:a},n("div",null,I,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 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=Mt(t),y=1<<t,v=d(()=>"auto"===e.vertexColors||void 0===e.vertexColors?It(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(()=>zt(t,k,f,b),[t,k,f,b]),F=o/2,L=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]),A=d(()=>I.vertices.slice().sort((e,t)=>e.depth-t.depth),[I]),D=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]),W=s(()=>{C(!1)},[]),E=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(F+e.sv.x),y1:String(L+e.sv.y),x2:String(F+e.tv.x),y2:String(L+e.tv.y),stroke:u,"stroke-width":String(p),"stroke-opacity":String(o),"stroke-linecap":"round"})}),B=A.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(F+e.x),cy:String(L+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(F+e.x),y:String(L+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:String(o),height:String(r),viewBox:`0 0 ${o} ${r}`,style:{backgroundColor:h,cursor:w?"grabbing":"grab",userSelect:"none"},onMouseDown:D,onMouseMove:T,onMouseUp:W,onMouseLeave:W},...E,...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(qt.length),g=c(null),x=s(e=>{o(e);const t=_t[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=_t[t]??qt,M=z.map((e,t)=>{const o=function(e){if(!e.trim())return[{text:" ",color:Gt}];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=Gt;Ot.has(r)?a=Yt:Ut.has(r)?a="#4ec9b0":l?a="#dcdcaa":"true"!==r&&"false"!==r||(a=Yt),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:Gt}),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),F=[];for(let e=0;e<I;e++)F.push(n("div",{key:String(e)},String(e+1)));const L=e=>{if(!e.parent)return!0;if(!r[e.parent])return!1;const t=jt.find(t=>t.name===e.parent&&t.isFolder);return!t||L(t)},R=Pt.map((e,t)=>{const o=[e],r=a===t;return r&&Ht[e]&&o.push(n("div",{key:"dropdown",style:w,className:"ide__menu-dropdown"},...Ht[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)}),A=jt.map((e,o)=>{if(!L(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"),...A),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"},...F),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",showPoints:c=!0,showGrid:p=!0,showArea:u=!1,areaColor:f="rgba(59,130,246,0.15)",xLabel:g,yLabel:x,title:h,padding:b=50,animate:m=!1,multiLine:y}=e,v=ut(d(()=>{const e=[...t];if(y)for(const t of y)e.push(...t.data);return e},[t,y]),o,r,b),{xScale:k,yScale:S,xTicks:w,yTicks:C}=v,$=[];if($.push(n("rect",{x:0,y:0,width:o,height:r,fill:"white",key:"bg"})),p){for(let e=0;e<w.length;e++){const t=k(w[e]);$.push(n("line",{x1:t,y1:b,x2:t,y2:r-b,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-x-${e}`}))}for(let e=0;e<C.length;e++){const t=S(C[e]);$.push(n("line",{x1:b,y1:t,x2:o-b,y2:t,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-y-${e}`}))}}$.push(n("line",{x1:b,y1:r-b,x2:o-b,y2:r-b,stroke:"#374151","stroke-width":1,key:"x-axis"})),$.push(n("line",{x1:b,y1:b,x2:b,y2:r-b,stroke:"#374151","stroke-width":1,key:"y-axis"}));for(let e=0;e<w.length;e++){const t=k(w[e]);$.push(n("line",{x1:t,y1:r-b,x2:t,y2:r-b+5,stroke:"#374151",key:`xtick-${e}`})),$.push(n("text",{x:t,y:r-b+18,"text-anchor":"middle","font-size":11,fill:"#6b7280",key:`xlabel-${e}`},ft(w[e])))}for(let e=0;e<C.length;e++){const t=S(C[e]);$.push(n("line",{x1:b-5,y1:t,x2:b,y2:t,stroke:"#374151",key:`ytick-${e}`})),$.push(n("text",{x:b-10,y:t+4,"text-anchor":"end","font-size":11,fill:"#6b7280",key:`ylabel-${e}`},ft(C[e])))}function z(e,t,o,r,i,l,a,s,d){if(0===e.length)return;const c=[...e].sort((e,t)=>e.x-t.x);if(r){const e=S(v.yMin),t=c.map(e=>`${k(e.x)},${S(e.y)}`).join(" "),o=`${k(c[0].x)},${e} ${t} ${k(c[c.length-1].x)},${e}`;$.push(n("polygon",{points:o,fill:i,key:`${d}-area`}))}const p={points:c.map(e=>`${k(e.x)},${S(e.y)}`).join(" "),fill:"none",stroke:t,"stroke-width":o,"stroke-linejoin":"round","stroke-linecap":"round",key:`${d}-line`};if(m?(p["stroke-dasharray"]="1000",p["stroke-dashoffset"]="1000",$.push(n("polyline",p,n("animate",{attributeName:"stroke-dashoffset",from:1e3,to:0,dur:"1.5s",fill:"freeze"})))):$.push(n("polyline",p)),l)for(let e=0;e<c.length;e++){const t={cx:k(c[e].x),cy:S(c[e].y),r:s,fill:a,key:`${d}-pt-${e}`};m?(t.opacity=0,$.push(n("circle",t,n("animate",{attributeName:"opacity",from:0,to:1,dur:"0.3s",begin:"1.2s",fill:"freeze"})))):$.push(n("circle",t))}}if(z(t,i,l,u,f,c,s,a,"primary"),y)for(let e=0;e<y.length;e++){const t=y[e];z(t.data,t.color,l,!1,"transparent",c,t.color,a,`series-${e}`)}if(y&&y.length>0){const e=[],t=[{color:i,label:"Primary"},...y.map((e,t)=>({color:e.color,label:e.label??`Series ${t+1}`}))];for(let o=0;o<t.length;o++){const r=b+10+120*o,i=b-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))}$.push(n("g",{key:"legend"},...e))}return g&&$.push(n("text",{x:o/2,y:r-8,"text-anchor":"middle","font-size":13,fill:"#374151",key:"x-axis-label"},g)),x&&$.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"},x)),h&&$.push(n("text",{x:o/2,y:20,"text-anchor":"middle","font-size":16,"font-weight":"bold",fill:"#111827",key:"title"},h)),n("svg",{xmlns:"http://www.w3.org/2000/svg",width:o,height:r,viewBox:`0 0 ${o} ${r}`},...$)},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:Y},c):null,n("div",{style:U},d),p?n("div",{style:{...Y,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,role:s?"option":void 0,"aria-selected":s?String(p):void 0},o(d,e)))}return n("div",null,c?n("div",{style:Y},c):null,n("ul",{style:H,role:s?"listbox":"list"},...u),p?n("div",{style:{...Y,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(Le,{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{value:t,onChange:o,min:r,max:i,step:a=1,disabled:d=!1,prefix:c,suffix:p,label:u,error:f}=e,[g,x]=l(!1),h=s(e=>{let t=e;return void 0!==r&&t<r&&(t=r),void 0!==i&&t>i&&(t=i),t},[r,i]),b=s(()=>{d||o(h(t+a))},[d,t,a,h,o]),m=s(()=>{d||o(h(t-a))},[d,t,a,h,o]),y=s(e=>{const t=e.target.value;if(""===t||"-"===t)return;const n=parseFloat(t);isNaN(n)||o(h(n))},[h,o]),v=s(e=>{d||("ArrowUp"===e.key?(e.preventDefault(),b()):"ArrowDown"===e.key&&(e.preventDefault(),m()))},[d,b,m]),k=void 0===i||t<i,S={display:"inline-flex",alignItems:"stretch",borderRadius:"6px",overflow:"hidden",border:"1px solid "+(f?"#ef4444":g?"#3b82f6":"#d1d5db"),transition:"border-color 0.15s",opacity:d?"0.6":"1",...g&&!f?{boxShadow:"0 0 0 3px #3b82f622"}:{}},w=e=>({display:"flex",alignItems:"center",justifyContent:"center",width:"36px",backgroundColor:"#f9fafb",border:"none",cursor:d||!e?"not-allowed":"pointer",color:d||!e?"#d1d5db":"#374151",fontSize:"16px",fontWeight:"600",userSelect:"none",transition:"background-color 0.1s",borderRight:"none",borderLeft:"none"}),C={display:"flex",alignItems:"center",fontSize:"13px",color:"#6b7280",padding:"0 4px",backgroundColor:"#f9fafb"},$=n("button",{type:"button",style:w(void 0===r||t>r),onClick:m,disabled:d,"aria-label":"Decrement",tabIndex:-1},"−"),z=c?n("span",{style:C},c):null,M=n("input",{type:"text",value:String(t),onInput:y,onKeyDown:v,onFocus:()=>x(!0),onBlur:()=>x(!1),disabled:d,style:{flex:"1",minWidth:"48px",textAlign:"center",border:"none",borderLeft:"1px solid #e5e7eb",borderRight:"1px solid #e5e7eb",outline:"none",fontSize:"14px",fontFamily:"inherit",backgroundColor:"#ffffff",color:"#1f2937",padding:"8px 4px"},"aria-label":u||"Number",role:"spinbutton","aria-valuenow":String(t),"aria-valuemin":void 0!==r?String(r):void 0,"aria-valuemax":void 0!==i?String(i):void 0}),I=p?n("span",{style:C},p):null,F=n("button",{type:"button",style:w(k),onClick:b,disabled:d,"aria-label":"Increment",tabIndex:-1},"+"),L=[$];return z&&L.push(z),L.push(M),I&&L.push(I),L.push(F),n(te,{label:u,error:f,disabled:d},n("div",{style:S},...L))},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:Ae},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:We},"..."));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?De:Ae},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=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]),h={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",gap:"8px",backgroundColor:"#f9fafb",userSelect:"none",cursor:e.collapsible?"pointer":"default"},b={display:"inline-block",width:"0",height:"0",borderLeft:"5px solid transparent",borderRight:"5px solid transparent",borderTop:"6px solid #6b7280",transition:"transform 0.2s",transform:r?"rotate(-90deg)":"rotate(0deg)",marginRight:"8px",flexShrink:"0"},m={maxHeight:r?"0":u,overflow:"hidden",transition:"max-height 0.3s ease"};return n("div",{className:`panel ${e.className??""}`.trim(),style:x},n("div",{className:"panel__header",style:h,onClick:g,role:e.collapsible?"button":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:b}):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?m:{},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(()=>ht(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=xt(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=gt(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=gt(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:o,height:r,viewBox:`0 0 ${o} ${r}`},...M)},exports.PolarGraph2D=function(e){const{width:t=400,height:o=400,rRange:r=[0,2],plotFunction:i,plotResolution:a=360,points:c=[],showGrid:p=!0,pointRadius:u=3,pointColor:f="#3b82f6",curveColor:g="#3b82f6",onPointClick:x,onPointDoubleClick:h,onPointContextMenu:b,onPointHover:m}=e,[y,v]=l(r[1]),[k,S]=l(0),[w,C]=l(0),[$,z]=l(null),M=t/2+k,I=o/2+w,F=Math.min(t,o)/2-30,L=F/y,R=d(()=>{const e=Math.max(1,Math.ceil(y)),t=[],o=y/e;for(let n=1;n<=e;n++)t.push(o*n);return t},[y]),A=d(()=>{const e=[];for(let t=0;t<360;t+=30)e.push(t*Math.PI/180);return e},[]),D=d(()=>{if(!i)return"";const e=[];for(let t=0;t<=a;t++){const o=t/a*2*Math.PI,n=i(o);if(n<0||!isFinite(n))continue;const{x:r,y:l}=bt(n,o,M,I,L);e.push(`${0===e.length?"M":"L"}${r.toFixed(2)},${l.toFixed(2)}`)}return e.join(" ")},[i,a,M,I,L]),T=s(e=>{z({x:e.clientX,y:e.clientY,px:k,py:w})},[k,w]),W=s(e=>{$&&(S($.px+(e.clientX-$.x)),C($.py+(e.clientY-$.y)))},[$]),E=s(()=>{z(null)},[]),B=s(e=>{e.preventDefault();const t=e.deltaY>0?1.15:1/1.15;v(Math.max(.1,y*t))},[y]),N=s((e,t,o)=>{if(e)return n=>e({r:t.r,theta:t.theta,index:o,event:n})},[]),P=[];if(P.push(n("rect",{x:0,y:0,width:t,height:o,fill:"white",key:"bg"})),p){for(let e=0;e<R.length;e++){const t=R[e]*L;P.push(n("circle",{cx:M,cy:I,r:t,fill:"none",stroke:"#e5e7eb","stroke-width":1,key:`gc-${e}`})),P.push(n("text",{x:M+t+2,y:I-4,"font-size":10,fill:"#9ca3af",key:`gl-${e}`},R[e].toFixed(1)))}for(let e=0;e<A.length;e++){const t=A[e],o=R[R.length-1]*L,r=M+o*Math.cos(t),i=I-o*Math.sin(t);P.push(n("line",{x1:M,y1:I,x2:r,y2:i,stroke:"#e5e7eb","stroke-width":1,key:`al-${e}`}));const l=Math.round(180*t/Math.PI),a=M+(o+14)*Math.cos(t),s=I-(o+14)*Math.sin(t);P.push(n("text",{x:a,y:s+4,"text-anchor":"middle","font-size":10,fill:"#9ca3af",key:`at-${e}`},`${l}°`))}}P.push(n("line",{x1:M-F,y1:I,x2:M+F,y2:I,stroke:"#d1d5db","stroke-width":1,key:"x-axis"})),P.push(n("line",{x1:M,y1:I-F,x2:M,y2:I+F,stroke:"#d1d5db","stroke-width":1,key:"y-axis"})),D&&P.push(n("path",{d:D,fill:"none",stroke:g,"stroke-width":2,key:"curve"}));for(let e=0;e<c.length;e++){const t=c[e],{x:o,y:r}=bt(t.r,t.theta,M,I,L);P.push(n("circle",{cx:o,cy:r,r:u,fill:f,key:`pt-${e}`,style:{cursor:"pointer"},onclick:N(x,t,e),ondblclick:N(h,t,e),oncontextmenu:N(b,t,e),onmouseenter:N(m,t,e)}))}return n("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:o,viewBox:`0 0 ${t} ${o}`,style:{cursor:$?"grabbing":"grab"},onmousedown:T,onmousemove:W,onmouseup:E,onmouseleave:E,onwheel:B},...P)},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:Ve(i)}));const S=[n("div",{onClick:y,style:{display:"inline-block"}},t)];return b&&S.push(n("div",{style:v},...k)),n("div",{ref:m,style:{position:"relative",display:"inline-block"}},...S)},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{options:t,value:o,onChange:r,placeholder:i="Select...",searchable:p=!1,multiple:u=!1,clearable:f=!1,disabled:g=!1,error:x,label:h,helpText:b}=e,[m,y]=l(!1),[v,k]=l(""),[S,w]=l(-1),C=c(null),$=d(()=>Array.isArray(o)?o:o?[o]:[],[o]),z=d(()=>{if(!p||!v)return t;const e=v.toLowerCase();return t.filter(t=>t.label.toLowerCase().includes(e))},[t,v,p]),M=d(()=>{const e={},t=[];for(const o of z)o.group?(e[o.group]||(e[o.group]=[]),e[o.group].push(o)):t.push(o);return{groups:e,ungrouped:t}},[z]),I=d(()=>0===$.length?"":$.map(e=>t.find(t=>t.value===e)).filter(Boolean).map(e=>e.label).join(", "),[$,t]);a(()=>{const e=e=>{const t=e.target;C.current&&!C.current.contains(t)&&(y(!1),k(""))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const F=s(e=>{if(u){const t=$.includes(e)?$.filter(t=>t!==e):[...$,e];r(t)}else r(e),y(!1),k("")},[u,$,r]),L=s(e=>{e.stopPropagation(),r(u?[]:"")},[u,r]),R=s(e=>{if(g)return;const t=e.key;if(!m&&("Enter"===t||" "===t||"ArrowDown"===t))return e.preventDefault(),y(!0),void w(0);if(m){if("Escape"===t)return y(!1),void k("");if("ArrowDown"===t)e.preventDefault(),w(e=>Math.min(e+1,z.length-1));else if("ArrowUp"===t)e.preventDefault(),w(e=>Math.max(e-1,0));else if("Enter"===t&&S>=0&&S<z.length){e.preventDefault();const t=z[S];t.disabled||F(t.value)}}},[g,m,S,z,F]),A={...oe({},{focused:m,error:!!x}),display:"flex",alignItems:"center",justifyContent:"space-between",cursor:g?"not-allowed":"pointer",minHeight:"38px",userSelect:"none"},D=(e,t)=>{const o=$.includes(e.value),r=t===S,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:()=>w(t),role:"option","aria-selected":o?"true":"false","aria-disabled":e.disabled?"true":void 0},u&&o?n("span",{style:{color:"#3b82f6",fontWeight:"700"}},"✓"):null,e.label)},T=n("span",{style:{marginLeft:"8px",fontSize:"10px",transition:"transform 0.15s",transform:m?"rotate(180deg)":"rotate(0deg)",color:"#6b7280"}},"▼"),W=n("div",{style:A,onClick:g?void 0:()=>{y(!m),w(-1)},onKeyDown:R,tabIndex:g?-1:0,role:"combobox","aria-expanded":m?"true":"false","aria-haspopup":"listbox"},n("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:I?"#1f2937":"#9ca3af"}},I||i),n("span",{style:{display:"flex",alignItems:"center",gap:"4px"}},f&&$.length>0?n("span",{onClick:L,style:{cursor:"pointer",color:"#9ca3af",fontSize:"14px",lineHeight:"1"},role:"button","aria-label":"Clear selection"},"✕"):null,T)),E=p&&m?n("input",{type:"text",value:v,onInput:e=>{k(e.target.value),w(0)},placeholder:"Search...",style:{width:"100%",boxSizing:"border-box",padding:"8px 12px",border:"none",borderBottom:"1px solid #e5e7eb",outline:"none",fontSize:"14px"}}):null,B=m?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"},E,...(()=>{const e=[];let t=0;const{groups:o,ungrouped:r}=M;for(const o of r)e.push(D(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(D(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:h,error:x,helpText:b,disabled:g},n("div",{ref:C,style:{position:"relative"}},W,B))},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(Ee,{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{value:t,onChange:o,min:r=0,max:i=100,step:p=1,showValue:u=!1,showTicks:f=!1,disabled:g=!1,marks:x,range:h=!1,label:b,error:m}=e,y=c(null),[v,k]=l(null),S=d(()=>{if(h&&Array.isArray(t))return t;const e="number"==typeof t?t:0;return[e,e]},[t,h]),w=e=>{const t=Math.round((e-r)/p)*p+r;return Math.max(r,Math.min(i,t))},C=e=>(e-r)/(i-r)*100,$=s(e=>{if(!y.current)return r;const t=y.current.getBoundingClientRect(),o=Math.max(0,Math.min(1,(e.clientX-t.left)/t.width));return w(r+o*(i-r))},[r,i,p]),z=s(e=>t=>{g||(t.preventDefault(),k(e))},[g]),M=s(e=>{if(g)return;const t=$(e);if(h){const e=Math.abs(t-S[0]),n=Math.abs(t-S[1]);o(e<=n?[w(t),S[1]]:[S[0],w(t)])}else o(w(t))},[g,$,h,S,o,r,i,p]);a(()=>{if(!v)return;const e=e=>{const t=$(e);"single"===v?o(w(t)):"start"===v?o([Math.min(w(t),S[1]),S[1]]):"end"===v&&o([S[0],Math.max(S[0],w(t))])},t=()=>k(null);return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[v,$,S,o,r,i,p]);const I=s(e=>{if(g)return;let n=0;if("ArrowRight"===e.key||"ArrowUp"===e.key)n=p;else{if("ArrowLeft"!==e.key&&"ArrowDown"!==e.key)return;n=-p}e.preventDefault(),h||o(w(("number"==typeof t?t:0)+n))},[g,p,h,t,o,r,i]),F={position:"relative",width:"100%",height:"6px",backgroundColor:"#e5e7eb",borderRadius:"3px",cursor:g?"not-allowed":"pointer"},L=h?C(S[0]):0,R={position:"absolute",top:"0",left:`${L}%`,width:C(h?S[1]:S[0])-L+"%",height:"100%",backgroundColor:g?"#9ca3af":"#3b82f6",borderRadius:"3px"},A=e=>b?"start"===e?`${b} minimum`:"end"===e?`${b} maximum`:b:"start"===e?"Minimum value":"end"===e?"Maximum value":"Value",D=(e,t,o)=>n("div",{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(t),role:"slider","aria-valuenow":String(o),"aria-valuemin":String(r),"aria-valuemax":String(i),"aria-label":A(t),tabIndex:g?-1:0,onKeyDown:I},u?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(o)):null),T=[];if(f)for(let e=r;e<=i;e+=p)T.push(n("div",{key:`tick-${e}`,style:{position:"absolute",top:"10px",left:`${C(e)}%`,width:"1px",height:"6px",backgroundColor:"#d1d5db",transform:"translateX(-50%)"}}));const W=[];if(x)for(const e of x)W.push(n("div",{key:`mark-${e.value}`,style:{position:"absolute",top:"18px",left:`${C(e.value)}%`,transform:"translateX(-50%)",fontSize:"11px",color:"#6b7280",whiteSpace:"nowrap"}},e.label));const E={paddingTop:u?"28px":"8px",paddingBottom:x||f?"28px":"8px",opacity:g?"0.6":"1"},B=[];return h?(B.push(D(C(S[0]),"start",S[0])),B.push(D(C(S[1]),"end",S[1]))):B.push(D(C(S[0]),"single",S[0])),n(te,{label:b,error:m},n("div",{style:E},n("div",{ref:y,style:F,onClick:M},n("div",{style:R}),...B,...T,...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,role:"separator","aria-orientation":o?"vertical":"horizontal"}),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:V,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,"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{value:t,onChange:o,format:r="24h",minuteStep:i=1,disabled:a=!1,label:c,error:p,showSeconds:u=!1,timezone:f,showTimezone:g=!1,timezones:x=ge,onTimezoneChange:h}=e,[b,m]=l(!1),y=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}}(t),[t]),v="12h"===r,k=y.hour>=12,S=v?y.hour%12||12:y.hour,w=s((e,t,n)=>{const r=Math.max(0,Math.min(23,e)),i=Math.max(0,Math.min(59,t)),l=Math.max(0,Math.min(59,n??0));o(u?`${xe(r)}:${xe(i)}:${xe(l)}`:`${xe(r)}:${xe(i)}`)},[o,u]),C=s(e=>{let t=parseInt(e.target.value,10)||0;v&&(t%=12,k&&(t+=12)),w(t,y.minute,y.second)},[v,k,y.minute,y.second,w]),$=s(e=>{const t=parseInt(e.target.value,10)||0;w(y.hour,t,y.second)},[y.hour,y.second,w]),z=s(e=>{const t=parseInt(e.target.value,10)||0;w(y.hour,y.minute,t)},[y.hour,y.minute,w]),M=s(()=>{if(a)return;const e=k?y.hour-12:y.hour+12;w(e,y.minute,y.second)},[a,k,y.hour,y.minute,y.second,w]),I=s(e=>{a||w(y.hour+e,y.minute,y.second)},[a,y.hour,y.minute,y.second,w]),F=s(e=>{a||w(y.hour,y.minute+e*i,y.second)},[a,y.hour,y.minute,y.second,i,w]),L=s(e=>{a||w(y.hour,y.minute,y.second+e)},[a,y.hour,y.minute,y.second,w]),R=s(e=>{const t=e.target.value;h&&h(t)},[h]),A={display:"inline-flex",alignItems:"center",gap:"4px",...oe({},{focused:b,error:!!p})},D={display:"flex",flexDirection:"column",alignItems:"center"},T={background:"none",border:"none",cursor:a?"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"},E={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:a?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},B=n("div",{style:D},n("button",{type:"button",style:T,onClick:()=>I(1),disabled:a},"▲"),n("input",{type:"text",value:xe(S),onChange:C,style:W,disabled:a,"aria-label":"Hour",onFocus:()=>m(!0),onBlur:()=>m(!1)}),n("button",{type:"button",style:T,onClick:()=>I(-1),disabled:a},"▼")),N=n("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"),P=n("div",{style:D},n("button",{type:"button",style:T,onClick:()=>F(1),disabled:a},"▲"),n("input",{type:"text",value:xe(y.minute),onChange:$,style:W,disabled:a,"aria-label":"Minute",onFocus:()=>m(!0),onBlur:()=>m(!1)}),n("button",{type:"button",style:T,onClick:()=>F(-1),disabled:a},"▼")),H=u?n("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"):null,j=u?n("div",{style:D},n("button",{type:"button",style:T,onClick:()=>L(1),disabled:a},"▲"),n("input",{type:"text",value:xe(y.second),onChange:z,style:W,disabled:a,"aria-label":"Second",onFocus:()=>m(!0),onBlur:()=>m(!1)}),n("button",{type:"button",style:T,onClick:()=>L(-1),disabled:a},"▼")):null,_=v?n("button",{type:"button",style:E,onClick:M,disabled:a,"aria-label":"Toggle AM/PM"},k?"PM":"AM"):null,q={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:a?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},O=f&&!g?n("span",{style:{marginLeft:"8px",fontSize:"12px",fontWeight:"600",color:"#6b7280"}},f):null,U=g?n("select",{style:q,value:f??x[0],onChange:R,disabled:a,"aria-label":"Timezone"},...x.map(e=>n("option",{key:e,value:e},e))):null,Y=[B,N,P];return H&&Y.push(H),j&&Y.push(j),_&&Y.push(_),O&&Y.push(O),U&&Y.push(U),n(te,{label:c,error:p,disabled:a},n("div",{style:A},...Y))},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"},ro(r)))}const u=[],f=Math.min(oo.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"},oo[e]))}const x="chartGrad";return n("div",{style:io},n("div",{style:lo},"AAPL ",n("span",{style:{color:"#00c853",fontSize:"14px",fontWeight:"700"}},`$${ro(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"})))}(Qt,u),function(){const e=Math.max(...Vt.map(e=>e.qty),...Kt.map(e=>e.qty));return n("div",{style:io},n("div",{style:lo},"Order Book"),n("table",{style:ao},n("thead",null,n("tr",null,n("th",{style:so},"Bid Price"),n("th",{style:so},"Qty"),n("th",{style:so},"Ask Price"),n("th",{style:so},"Qty"))),n("tbody",null,...Vt.map((t,o)=>{const r=Kt[o],i=t.qty/e*.25,l=(r?.qty??0)/e*.25;return n("tr",{key:String(o),style:po},n("td",{style:{...co,color:"#00c853",backgroundColor:`rgba(0,200,83,${i.toFixed(3)})`,fontFamily:"monospace"}},ro(t.price)),n("td",{style:{...co,backgroundColor:`rgba(0,200,83,${(.5*i).toFixed(3)})`,fontFamily:"monospace"}},no(t.qty)),n("td",{style:{...co,color:"#ff1744",backgroundColor:`rgba(255,23,68,${l.toFixed(3)})`,fontFamily:"monospace"}},r?ro(r.price):""),n("td",{style:{...co,backgroundColor:`rgba(255,23,68,${(.5*l).toFixed(3)})`,fontFamily:"monospace"}},r?no(r.qty):""))}))))}(),function(e){return n("div",{style:io},n("div",{style:lo},"Watchlist"),n("table",{style:ao},n("thead",null,n("tr",null,n("th",{style:so},"Symbol"),n("th",{style:so},"Price"),n("th",{style:so},"Chg%"),n("th",{style:so},"Volume"))),n("tbody",null,...Xt.map((t,o)=>{const r=t.price+(0===o?e:0),i=t.change>=0;return n("tr",{key:String(o),style:po},n("td",{style:{...co,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:{...co,fontFamily:"monospace"}},ro(r)),n("td",{style:{...co,color:i?"#00c853":"#ff1744",fontWeight:"600"}},`${i?"+":""}${ro(t.change)}%`),n("td",{style:{...co,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=Jt.reduce((e,t)=>e+t.pnl,0),t=e>=0;return n("div",{style:io},n("div",{style:lo},"Positions",n("span",{style:{marginLeft:"12px",color:t?"#00c853":"#ff1744",fontWeight:"700",fontSize:"12px"}},`${t?"+":""}$${ro(e)}`)),n("table",{style:ao},n("thead",null,n("tr",null,n("th",{style:so},"Symbol"),n("th",{style:so},"Qty"),n("th",{style:so},"Avg"),n("th",{style:so},"P&L"))),n("tbody",null,...Jt.map((e,t)=>{const o=e.pnl>=0;return n("tr",{key:String(t),style:{...po,backgroundColor:o?"rgba(0,200,83,0.04)":"rgba(255,23,68,0.04)"}},n("td",{style:{...co,fontWeight:"600",color:"#ffffff"}},e.symbol),n("td",{style:{...co,fontFamily:"monospace"}},String(e.qty)),n("td",{style:{...co,fontFamily:"monospace"}},ro(e.avgPrice)),n("td",{style:{...co,color:o?"#00c853":"#ff1744",fontWeight:"700",fontFamily:"monospace"}},`${o?"+":""}$${ro(e.pnl)}`))}))))}(),n("div",{style:io},n("div",{style:lo},"Recent Trades"),n("table",{style:ao},n("thead",null,n("tr",null,n("th",{style:so},"Time"),n("th",{style:so},"Sym"),n("th",{style:so},"Side"),n("th",{style:so},"Qty"),n("th",{style:so},"Price"))),n("tbody",null,...Zt.map((e,t)=>{const o="BUY"===e.side;return n("tr",{key:String(t),style:po},n("td",{style:{...co,color:"#8888aa",fontFamily:"monospace"}},e.time),n("td",{style:{...co,fontWeight:"600",color:"#ffffff"}},e.symbol),n("td",{style:{...co,color:o?"#00c853":"#ff1744",fontWeight:"600"}},e.side),n("td",{style:{...co,fontFamily:"monospace"}},no(e.qty)),n("td",{style:{...co,fontFamily:"monospace"}},ro(e.price)))})))),function(){const e=Math.max(...eo.map(e=>e.volume),...to.map(e=>e.volume)),t="16px";return n("div",{style:io},n("div",{style:lo},"Market Depth"),n("div",{style:{flex:"1",display:"flex",flexDirection:"column",gap:"2px",justifyContent:"center"}},...eo.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"}},ro(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"}},no(o.volume)))),n("div",{style:{height:"1px",backgroundColor:"#2a2a4a",margin:"4px 0"}}),...to.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"}},ro(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"}},no(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=Rt++,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(Ft[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===Ft.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()},...Ft.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"}},...Lt.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"},...Ft.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(Ft.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"},F=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"}}),F)},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:{...K,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()},[]),F=s(()=>{if(S.current){const e=S.current.textContent??"";y(Nt(e))}},[]),L=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"}),[]),A=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}(),[]),D=e.content??"Start typing...",T=Nt(D),W=m>0?m:T,E={position:"absolute",top:"100%",left:"0",minWidth:"160px",backgroundColor:"#ffffff",border:"1px solid #d0d0d0",borderRadius:"4px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",zIndex:"1000"},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=At.map((e,t)=>{const o=[e];return h===t&&Dt[e]&&o.push(n("div",{key:"dropdown",style:E,className:"word-processor__menu-dropdown"},...Dt[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"}},...Tt.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)}},...Et.map(e=>n("option",{key:e,value:e},Bt[e])))),n("div",{key:"2",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},...Wt.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"},...A),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:L},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:F,suppressContentEditableWarning:!0},D)),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,`${W} words`),n("span",null,"100%")))},exports.buildInputStyle=oe,exports.buildNavItemStyle=we,exports.buildRotationMatrix=vt,exports.computeSlices=ht,exports.createToaster=Je,exports.describeArc=xt,exports.generateEdges=yt,exports.generateHypercube=zt,exports.generatePalette=It,exports.generateVertices=mt,exports.numRotationAngles=Mt,exports.projectTo2D=$t,exports.transformVec=Ct,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=Mt(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(()=>zt(t,s,n,r),[t,s,n,r]),angles:s,setAngles:c}},exports.useLineGraphScales=ut,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}};
2
2
  //# sourceMappingURL=specifyjs-components.cjs.js.map