orbcafe-ui 3.1.8 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,24 +1,24 @@
1
- import {f,d,g,e,a,b,c}from'./chunk-7TUSE6H4.mjs';export{h as COrbCanvas}from'./chunk-7TUSE6H4.mjs';import*as Jt from'react';import Jt__default,{createContext,forwardRef,useId,useRef,useState,useImperativeHandle,useMemo,Children,isValidElement,useEffect,useContext,useCallback,Fragment,useLayoutEffect,cloneElement}from'react';import*as Ao from'@radix-ui/react-dropdown-menu';import*as Yo from'@radix-ui/react-tooltip';import {createPortal}from'react-dom';import*as So from'@radix-ui/react-dialog';import*as br from'@radix-ui/react-popover';import rr from'dayjs';import qh from'dayjs/plugin/customParseFormat';import {usePathname,useRouter}from'next/navigation';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {Slot}from'@radix-ui/react-slot';import {cva}from'class-variance-authority';import {DndContext,closestCenter,useSensors,useSensor,PointerSensor,TouchSensor,closestCorners,DragOverlay,useDroppable,useDraggable}from'@dnd-kit/core';import {restrictToHorizontalAxis}from'@dnd-kit/modifiers';import {arrayMove,SortableContext,horizontalListSortingStrategy,verticalListSortingStrategy,useSortable}from'@dnd-kit/sortable';import lb from'dayjs/plugin/isBetween';import cb from'dayjs/plugin/localizedFormat';import'dayjs/locale/zh-cn';import'dayjs/locale/fr';import'dayjs/locale/de';import'dayjs/locale/ja';import'dayjs/locale/ko';import gy from'next/dynamic';import {AnimatePresence,motion}from'framer-motion';import PC from'react-markdown';import TC from'remark-gfm';import IC from'remark-math';import MC from'rehype-katex';import RC from'rehype-raw';import {Prism}from'react-syntax-highlighter';import {oneDark,oneLight}from'react-syntax-highlighter/dist/esm/styles/prism';import xm from'mermaid';import aw from'dayjs/plugin/isoWeek';var Ug={canvas:"#ffffff",surface:"#f5f5f5",surface2:"#f5f5f5",surface3:"#f5f5f5",fg:"#555555",muted:"#8c8c8c",border:"#dbdbdb",primary:"#154194",onPrimary:"#ffffff",link:"#154194",p50:"#f0f3f9",p100:"#dce4f1",p200:"#bac9e3",p300:"#91a8d1",p600:"#0f3276",p700:"#08255a",accent:"#fc4c02",err:"#ac3101",errBg:"#fff4f0",warnBg:"#fff2ee",hover:"rgba(21, 65, 148, 0.06)",selected:"rgba(21, 65, 148, 0.10)",focusRing:"rgba(21, 65, 148, 0.18)",focusSolid:"#154194",disabledFg:"#aeaeae",disabledBg:"#f0f0f0",chartGrid:"#dbdbdb",chartText:"#8c8c8c",track:"#f5f5f5",shadow1:"0 1px 2px rgba(1,9,26,.05),0 2px 6px rgba(1,9,26,.06)",shadow2:"0 4px 14px rgba(1,9,26,.10)",shadow3:"0 12px 32px rgba(1,9,26,.16)",fontBrand:"Montserrat",inverseSurface:"#01091a",inverseFg:"#ffffff",inverseLink:"#91a8d1",aiAccent:"#21bcff",statusFg:"#475569",statusPrimary:"#1d4ed8",statusSuccess:"#047857",statusWarning:"#b45309",statusError:"#b91c1c",statusInfo:"#0369a1",chart1:"#154194",chart2:"#91a8d1",chart3:"#8c8c8c",chart4:"#08255a",chart5:"#fc4c02",chart6:"#bac9e3",chartPositive:"#66bb6a",chartNegative:"#ef5350"},Kg={canvas:"#01091a",surface:"#0a1526",surface2:"#061324",surface3:"#0e1b2b",fg:"#ffffff",muted:"rgba(255,255,255,0.7)",border:"rgba(255,255,255,0.12)",primary:"#154194",onPrimary:"#ffffff",link:"#91a8d1",p50:"#021432",p100:"#021a3d",p200:"#bac9e3",p300:"#91a8d1",p600:"#375ea5",p700:"#6e8cc1",accent:"#fc4c02",err:"#d53f01",errBg:"#16163b",warnBg:"#19173f",hover:"rgba(255,255,255,0.08)",selected:"rgba(21, 65, 148, 0.45)",focusRing:"rgba(145, 168, 209, 0.45)",focusSolid:"#91a8d1",disabledFg:"rgba(255,255,255,0.38)",disabledBg:"rgba(255,255,255,0.07)",chartGrid:"rgba(255,255,255,0.12)",chartText:"rgba(255,255,255,0.7)",track:"rgba(255,255,255,0.1)",shadow1:"0 1px 2px rgba(0,0,0,.4),0 2px 8px rgba(0,0,0,.35)",shadow2:"0 4px 16px rgba(0,0,0,.5)",shadow3:"0 12px 32px rgba(0,0,0,.55)",fontBrand:"Montserrat",inverseSurface:"#01091a",inverseFg:"#ffffff",inverseLink:"#91a8d1",aiAccent:"#21bcff",statusFg:"#94a3b8",statusPrimary:"#60a5fa",statusSuccess:"#34d399",statusWarning:"#fbbf24",statusError:"#f87171",statusInfo:"#38bdf8",chart1:"#154194",chart2:"#91a8d1",chart3:"rgba(255,255,255,0.7)",chart4:"#a4b8dd",chart5:"#fc4c02",chart6:"#bac9e3",chartPositive:"#66bb6a",chartNegative:"#ef5350"},Bs={light:Ug,dark:Kg},kw='"Montserrat", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif',Pw=t=>{let o=Bs[t];return [o.primary,o.p300,o.muted,o.p700]},Tw=10,Iw="0.2s ease";var Tc=createContext({mode:"light",setting:"light"}),Yg=t=>{if(typeof document>"u")return;let o=document.documentElement;o.classList.toggle("orb-dark",t==="dark"),o.dataset.orbMode=t,o.style.colorScheme=t;},Ln=({mode:t,defaultMode:o="light",children:r})=>{let n=t??o,[a,i]=useState("light"),[s,l]=useState(false);useEffect(()=>{l(true);let m=window.matchMedia("(prefers-color-scheme: dark)"),h=()=>i(m.matches?"dark":"light");return h(),m.addEventListener("change",h),()=>m.removeEventListener("change",h)},[]);let d=n==="system"?s?a:"light":n;useEffect(()=>{Yg(d);},[d]);let p=useMemo(()=>({mode:d,setting:n}),[d,n]);return f(Tc.Provider,{value:p,children:r})},go=()=>useContext(Tc).mode,Hs=()=>Bs[go()];var tt=(t,o)=>{let r=Math.min(1,Math.max(0,o)),n=t.trim(),a=d=>d.split("").map(p=>p+p).join(""),i=n.startsWith("#")?n.slice(1):"",s=i.length===3?a(i):i;if(/^[0-9a-fA-F]{6}$/.test(s)){let d=parseInt(s.slice(0,2),16),p=parseInt(s.slice(2,4),16),m=parseInt(s.slice(4,6),16);return `rgba(${d}, ${p}, ${m}, ${r})`}let l=`${Math.round(r*100)}%`;return `color-mix(in oklch, ${t} ${l}, transparent)`};var Do=t=>{let o=t.startsWith("up:")?`(min-width:${t.slice(3)}px)`:t.startsWith("down:")?`(max-width:${t.slice(5)}px)`:t,[r,n]=useState(()=>typeof window>"u"||typeof window.matchMedia!="function"?false:window.matchMedia(o).matches);return useEffect(()=>{if(typeof window.matchMedia!="function")return;let a=window.matchMedia(o),i=()=>n(a.matches);return i(),a.addEventListener("change",i),()=>a.removeEventListener("change",i)},[o]),r};var Jg={accept:57435,activate:57864,activity:57769,add:57432,barChart:57417,calendar:57414,camera:57413,checklist:57952,collapseAll:57988,command:57997,copy:57925,darkMode:58122,decline:57406,delete:57405,dimension:57718,document:57780,down:57827,download:57402,duplicate:57401,edit:57400,email:57399,employee:57398,error:57836,expandAll:57987,factory:57464,favorite:57445,filter:57462,fullScreen:57702,grid:57457,hide:57834,home:57456,information:57993,inventory:57693,ipad:57491,lightMode:58121,lightbulb:57380,lineChart:57740,locked:57683,log:57378,map:57377,menu:57822,message:57884,microphone:57586,move:57832,navigationLeft:57447,navigationRight:57446,overflow:57842,overview:57551,paperPlane:57548,picture:57366,pieChart:57365,play:57499,process:57543,product:57361,pushpin:57503,qrCode:57999,receipt:57541,refresh:57360,save:57498,search:57357,show:57833,shipping:57523,slimDown:57839,slimUp:57840,sort:57853,sound:57895,splitOne:57919,splitTwo:57920,stop:57861,sum:57998,synchronize:57354,table:57530,tableColumn:57983,tableRow:57982,thumbDown:57891,thumbUp:57890,time:57508,translate:57995,tree:57588,trendDown:57931,up:57828,upload:57881,warning:57492,world:57489,wrench:57346},eh=t=>typeof t=="number"?`${t}px`:t,th={"2.5":10,3:12,"3.5":14,4:16,5:20,6:24,7:28,8:32,10:40,12:48},oh=t=>{if(!t)return;let o=t.match(/(?:^|\s)(?:h|w)-(2\.5|3(?:\.5)?|4|5|6|7|8|10|12)(?:\s|$)/);return o?th[o[1]]:void 0},Pt=forwardRef(({name:t,size:o,title:r,className:n,style:a,strokeWidth:i,fill:s,...l},d)=>{let p=l["aria-label"]??r,m=eh(o??oh(n)??"1em"),h={fontFamily:"SAP-icons",fontSize:m,fontStyle:"normal",fontWeight:"normal",lineHeight:1,width:m,height:m,display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",...a};return f("span",{ref:d,role:p?"img":void 0,"aria-hidden":p?void 0:true,title:r,className:n,"data-sap-icon":t,style:h,...l,children:String.fromCodePoint(Jg[t])})});Pt.displayName="SapIcon";var ae=(t,o)=>{let r=forwardRef((n,a)=>f(Pt,{ref:a,name:t,...n}));return r.displayName=o??`SapIcon(${t})`,r};var Mc=ae("activity","Activity"),Ia=ae("error","AlertCircle"),Rc=ae("warning","AlertTriangle"),Uw=ae("down","ArrowDown"),Kw=ae("navigationRight","ArrowRight"),Dc=ae("up","ArrowUp"),zs=ae("barChart","BarChart"),qw=ae("activate","Bot"),Vs=ae("calendar","Calendar"),Xw=Vs,Zw=ae("camera","Camera"),Yw=ae("lineChart","ChartNoAxesCombined"),xo=ae("accept","Check"),Ma=ae("accept","CheckCircle"),Bo=ae("slimDown","ChevronDown"),Ra=ae("navigationLeft","ChevronLeft"),Ho=ae("navigationRight","ChevronRight"),Qw=ae("slimUp","ChevronUp"),jw=ae("expandAll","ChevronsDown"),Jw=ae("collapseAll","ChevronsUp"),Da=ae("error","CircleAlert"),On=ae("accept","CircleCheck"),e0=On,Ws=ae("stop","CircleStop"),Nc=ae("copy","Clipboard"),t0=ae("checklist","ClipboardCheck"),o0=ae("checklist","ClipboardList"),Ac=ae("time","Clock"),r0=ae("tableColumn","Columns3"),No=ae("copy","Copy"),n0=ae("duplicate","CopyPlus"),a0=ae("delete","Delete"),Fn=ae("download","Download"),Ec=ae("edit","Edit"),Lc=ae("fullScreen","Expand"),i0=ae("show","Eye"),s0=ae("hide","EyeOff"),Na=ae("document","File"),Oc=ae("document","FileText"),l0=ae("filter","Filter"),Bn=ae("tree","FolderTree"),Fc=ae("process","GitBranch"),Hn=ae("world","Globe"),Bc=ae("grid","Grid"),c0=ae("move","GripVertical"),d0=ae("wrench","Hammer"),Hc=ae("picture","Image"),Aa=ae("information","Info"),p0=ae("translate","Languages"),u0=ae("dimension","Layers"),m0=ae("home","LayoutDashboard"),Ea=ae("lightbulb","Lightbulb"),zc=ae("lineChart","LineChart"),Vc=ae("synchronize","Loader2"),La=ae("locked","Lock"),g0=La,Wc=ae("log","LogOut"),$s=ae("email","Mail"),$c=ae("map","MapPin"),_c=ae("menu","Menu"),rh=ae("message","MessageCircle"),Gc=rh,Oa=ae("microphone","Mic"),h0=ae("microphone","MicOff"),Uc=ae("darkMode","Moon"),f0=ae("overflow","MoreHorizontal"),b0=ae("accept","PackageCheck"),v0=ae("product","PackageSearch"),Fa=ae("splitOne","PanelLeftOpen"),Ba=ae("splitTwo","PanelRight"),y0=ae("overview","PanelsTopLeft"),Kc=ae("pieChart","PieChart"),Qr=ae("pushpin","Pin"),C0=ae("play","Play"),jr=ae("add","Plus"),x0=ae("qrCode","QrCode"),w0=ae("receipt","ReceiptText"),Ha=ae("refresh","RefreshCw"),S0=ae("activate","Rocket"),k0=ae("refresh","RotateCcw"),qc=ae("refresh","RotateCw"),P0=ae("tableRow","Rows3"),T0=ae("save","Save"),I0=ae("qrCode","ScanLine"),zo=ae("search","Search"),nh=ae("paperPlane","Send"),Xc=nh,Jr=ae("wrench","Settings"),M0=ae("accept","ShieldCheck"),R0=ae("sum","Sigma"),D0=ae("sort","SortAsc"),N0=ae("splitTwo","SquareSplitHorizontal"),A0=ae("favorite","Star"),Zc=ae("lightMode","Sun"),E0=ae("table","Table2"),L0=ae("ipad","TabletSmartphone"),zn=ae("command","Terminal"),Yc=ae("thumbDown","ThumbsDown"),Qc=ae("thumbUp","ThumbsUp"),jc=ae("delete","Trash2"),O0=ae("tree","TreePine"),Jc=ae("trendDown","TrendingDown"),za=ae("warning","TriangleAlert"),F0=ae("shipping","Truck"),ed=ae("upload","UploadCloud"),_s=ae("employee","User"),td=ae("sound","Volume2"),B0=ae("factory","Warehouse"),H0=ae("process","Workflow"),Kt=ae("decline","X"),Va=ae("error","XCircle");var ih={contained:"primary",outlined:"secondary",text:"ghost"},sh={small:"orb-btn-sm",medium:void 0,large:"orb-btn-lg"},Pe=forwardRef(({variant:t="primary",size:o="medium",block:r=false,loading:n=false,startIcon:a,endIcon:i,component:s,href:l,sx:d$1,className:p,children:m,disabled:h,type:f$1="button",...u},b)=>{let C=ih[t]??t,g$1=["orb-btn",`orb-btn-${C}`,sh[o],r?"orb-btn-block":void 0,n?"orb-is-loading":void 0,p].filter(Boolean).join(" "),x=d(d$1,g$1),v=s??(l?"a":"button");return g(v,{ref:b,type:v==="button"?f$1:void 0,href:l,className:x.className,style:x.style,disabled:v==="button"?h||n:void 0,"aria-disabled":v!=="button"&&(h||n)?true:void 0,...u,children:[n&&f("span",{className:`orb-spin ${C==="primary"?"orb-spin-light":""}`,"aria-hidden":true}),!n&&a,m,!n&&i]})});Pe.displayName="CButton";var He=forwardRef(({label:t,value:o,defaultValue:r,onChange:n,onFocus:a,onBlur:i,onKeyDown:s,type:l="text",placeholder:d$1,disabled:p,readOnly:m,required:h,autoFocus:f$1,autoComplete:u,name:b,id:C,error:g$1,helperText:x,dense:v=false,size:y,fullWidth:k=true,select:w=false,multiline:P=false,rows:I,children:S,variant:R,margin:N,onClick:T,startAdornment:M,endAdornment:A,InputProps:L,inputProps:W,InputLabelProps:ee,SelectProps:O,sx:_,className:V},Q)=>{let H=useId(),B=C??`orb-tf-${H}`,q=M??L?.startAdornment,Z=A??L?.endAdornment,J=(typeof g$1=="string"?g$1:void 0)??x,he={id:B,className:`orb-inp ${v||y==="small"?"orb-inp-dense":""}`,style:k?void 0:{width:"auto"},value:o,defaultValue:r,onChange:n,onFocus:a,onBlur:i,onKeyDown:s,placeholder:d$1,disabled:p,required:h,autoFocus:f$1,autoComplete:u,name:b,onClick:T,"aria-invalid":!!g$1},ze=w?f("select",{...he,ref:Q,onChange:n,children:S}):P?f("textarea",{...he,ref:Q,onChange:n,rows:I,readOnly:m||L?.readOnly}):f("input",{...he,ref:Q,onChange:n,type:l,readOnly:m||L?.readOnly,...W}),be=d(_,`orb-fld ${g$1?"orb-is-error":""} ${V??""}`,{width:k?"100%":void 0});return g("div",{className:be.className,style:be.style,children:[t&&f("label",{htmlFor:B,children:t}),q||Z?g("div",{className:"orb-inp-adornment-wrap",children:[q&&f("span",{className:"orb-inp-adornment",children:q}),Z&&f("span",{className:"orb-inp-adornment orb-inp-adornment-end",children:Z}),ze]}):ze,J&&f("span",{className:"orb-fld-msg",children:J})]})});He.displayName="CTextField";var Vn=forwardRef(({label:t,value:o,defaultValue:r,onChange:n,placeholder:a,disabled:i,readOnly:s,rows:l,minRows:d$1=3,multiline:p,error:m,helperText:h,fullWidth:f$1=true,name:u,id:b,inputProps:C,sx:g$1,className:x},v)=>{let y=useId(),k=b??`orb-ta-${y}`,P=(typeof m=="string"?m:void 0)??h,I=d(g$1,`orb-fld ${m?"orb-is-error":""} ${x??""}`,{width:f$1?"100%":void 0});return g("div",{className:I.className,style:I.style,children:[t&&f("label",{htmlFor:k,children:t}),f("textarea",{ref:v,id:k,className:"orb-inp",value:o,defaultValue:r,onChange:n,placeholder:a,disabled:i,readOnly:s,rows:l??d$1,name:u,"aria-invalid":!!m,...C}),P&&f("span",{className:"orb-fld-msg",children:P})]})});Vn.displayName="CTextArea";var zt=forwardRef(({label:t,options:o,children:r,value:n,defaultValue:a,onChange:i,disabled:s,size:l,dense:d$1=true,fullWidth:p=true,minWidth:m,placeholder:h,displayEmpty:f$1,renderValue:u,multiple:b,MenuProps:C,variant:g$1,disableUnderline:x,onClick:v,onMouseDown:y,error:k,helperText:w,name:P,id:I,"aria-label":S,sx:R,className:N},T)=>{let M=useId(),A=I??`orb-sel-${M}`,W=(typeof k=="string"?k:void 0)??w,ee=useRef(null),O=useRef(null),[_,V]=useState(false),[Q,H]=useState(180),[B,q]=useState(a??"");useImperativeHandle(T,()=>ee.current);let Z=useMemo(()=>Children.toArray(r).flatMap(de=>{if(!isValidElement(de)||de.type!=="option")return [];let ve=de;return [{value:Array.isArray(ve.props.value)?ve.props.value[0]??"":ve.props.value??"",label:ve.props.children,disabled:ve.props.disabled}]}),[r]),Y=o??Z,J=n??B,le=Array.isArray(J)?J[0]??"":J,he=String(le??""),ze=Y.find(de=>String(de.value)===he),be=u?u(J):ze?.label??(he||(h??"")),Ce=d(R,`orb-fld ${k?"orb-is-error":""} ${N??""}`,{width:p?"100%":void 0,minWidth:typeof m=="number"?`${m}px`:m});if(b)return g("div",{className:Ce.className,style:Ce.style,children:[t&&f("label",{htmlFor:A,children:t}),g("select",{ref:T,id:A,className:`orb-inp ${d$1||l==="small"?"orb-inp-dense":""}`,value:n,defaultValue:a,onChange:i,disabled:s,name:P,multiple:true,onClick:v,onMouseDown:y,"aria-invalid":!!k,"aria-label":S,children:[h!==void 0&&f("option",{value:"",children:h}),o?o.map(de=>f("option",{value:de.value,disabled:de.disabled,children:de.label},de.value)):r]}),W&&f("span",{className:"orb-fld-msg",children:W})]});let Be=de=>{n===void 0&&q(de);let ve=ee.current;ve&&(Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value")?.set?.call(ve,de),i?.({target:ve,currentTarget:ve}));};return g("div",{className:Ce.className,style:Ce.style,children:[t&&f("label",{htmlFor:A,children:t}),f("select",{ref:ee,className:"orb-visually-hidden",tabIndex:-1,"aria-hidden":"true",name:P,value:he,disabled:s,onChange:()=>{},children:Y.map(de=>f("option",{value:de.value,disabled:de.disabled,children:de.label},String(de.value)))}),g(Ao.Root,{open:_,onOpenChange:de=>{de&&H(O.current?.getBoundingClientRect().width??180),V(de);},children:[f(Ao.Trigger,{asChild:true,children:g("button",{ref:O,id:A,type:"button",className:`orb-inp orb-select-trigger ${d$1||l==="small"?"orb-inp-dense":""}`,disabled:s,"aria-invalid":!!k,"aria-label":S,"aria-haspopup":"listbox","data-placeholder":!ze&&!he?"":void 0,onClick:v,onMouseDown:y,children:[f("span",{className:"orb-select-value",children:be}),f(Pt,{className:"orb-select-chevron",name:"slimDown",size:12})]})}),f(Ao.Portal,{children:f(Ao.Content,{className:"orb-pop orb-select-menu",align:"start",sideOffset:5,collisionPadding:8,style:{minWidth:Q},children:f(Ao.RadioGroup,{value:he,onValueChange:Be,children:Y.map(de=>g(Ao.RadioItem,{className:"orb-select-option",value:String(de.value),disabled:de.disabled,children:[f("span",{className:"orb-select-check","aria-hidden":"true",children:String(de.value)===he?f(Pt,{name:"accept",size:13}):null}),f("span",{children:de.label})]},String(de.value)))})})})]}),W&&f("span",{className:"orb-fld-msg",children:W})]})});zt.displayName="CSelect";var Tt=forwardRef(({label:t,checked:o,defaultChecked:r,onChange:n,disabled:a,indeterminate:i,name:s,value:l,id:d$1,size:p,color:m,onClick:h,inputProps:f$1,sx:u,className:b},C)=>{let g$1=d([{...p==="small"?{fontSize:13}:void 0,...m?{color:m}:void 0},...Array.isArray(u)?u:u?[u]:[]],`orb-chk ${b??""}`),x=f("input",{ref:v=>{v&&(v.indeterminate=!!i),typeof C=="function"?C(v):C&&(C.current=v);},type:"checkbox",id:d$1,checked:o,defaultChecked:r,onChange:n,readOnly:o!==void 0&&n===void 0,disabled:a,name:s,value:l,onClick:h,...f$1});return t==null?f("span",{className:g$1.className,style:g$1.style,children:x}):g("label",{className:g$1.className,style:g$1.style,children:[x,f("span",{children:t})]})});Tt.displayName="CCheckbox";var Ch=({label:t,options:o,value:r,defaultValue:n,onChange:a,name:i,row:s=false,disabled:l,sx:d,className:p})=>{let m=useId(),h=i??`orb-rdo-${m}`;return g("div",{className:`orb-fld ${p??""}`,style:d,role:"radiogroup",children:[t&&f("span",{className:"orb-fld-label",children:t}),f("div",{style:{display:"flex",flexDirection:s?"row":"column",gap:s?24:8,flexWrap:"wrap"},children:o.map(f$1=>g("label",{className:"orb-rdo",children:[f("input",{type:"radio",name:h,value:f$1.value,checked:r!==void 0?r===f$1.value:void 0,defaultChecked:n!==void 0?n===f$1.value:void 0,onChange:a?u=>a(u,f$1.value):void 0,disabled:l||f$1.disabled}),f("span",{children:f$1.label})]},f$1.value))})]})};var Wa=forwardRef(({label:t,checked:o,defaultChecked:r,onChange:n,disabled:a,name:i,id:s,size:l,sx:d$1,className:p},m)=>{let h=d([{...l==="small"?{transform:"scale(.86)",transformOrigin:"center"}:void 0},...Array.isArray(d$1)?d$1:d$1?[d$1]:[]],`orb-sw ${p??""}`),f$1=f("input",{ref:m,type:"checkbox",role:"switch",id:s,checked:o,defaultChecked:r,onChange:n?u=>n(u,u.target.checked):void 0,disabled:a,name:i});return t==null?f("span",{className:h.className,style:h.style,children:f$1}):g("label",{className:h.className,style:h.style,children:[f$1,f("span",{children:t})]})});Wa.displayName="CSwitch";var Sh={default:"gray",primary:"blue",success:"blue",info:"blue",warning:"orange",error:"orange"},Ct=forwardRef(({label:t,children:o,tone:r,color:n="default",variant:a,size:i="medium",clickable:s,avatar:l,icon:d$1,onDelete:p,onClick:m,sx:h,className:f$1},u)=>{let b=r??(a==="outlined"&&n==="default"?"outline":Sh[n]??"gray"),C=s??!!m,g$1=d([{cursor:C?"pointer":void 0,...i==="small"?{height:24,fontSize:11,px:1}:void 0},...Array.isArray(h)?h:h?[h]:[]],`orb-chip orb-chip-${b} ${f$1??""}`);return g("span",{ref:u,className:g$1.className,style:g$1.style,onClick:m,role:C?"button":void 0,tabIndex:C?0:void 0,onKeyDown:C?x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),m?.(x));}:void 0,children:[l??d$1,f("span",{className:"orb-chip-label",children:o??t}),p&&f("button",{type:"button","aria-label":"Remove",onClick:x=>{x.stopPropagation(),p(x);},style:{background:"none",border:"none",padding:0,display:"inline-flex",cursor:"pointer",color:"inherit"},children:f(Kt,{size:13,strokeWidth:2})})]})});Ct.displayName="CChip";var $a=forwardRef(({badgeContent:t,color:o="primary",children:r,invisible:n=false,sx:a,className:i},s)=>{let l=d(a,i,{display:"inline-flex",position:r?"relative":void 0}),d$1=!n&&t!==void 0&&t!==null&&f("span",{className:`orb-badge ${o==="error"?"orb-badge-err":o==="muted"?"orb-badge-muted":""}`,style:r?{position:"absolute",top:-6,right:-6,zIndex:1}:void 0,children:t});return r?g("span",{ref:s,className:l.className,style:l.style,children:[r,d$1]}):f("span",{ref:s,className:l.className,style:l.style,children:d$1})});$a.displayName="CBadge";var en=forwardRef(({children:t,src:o,alt:r,size:n=28,sx:a,className:i},s)=>{let l=d([{width:n,height:n,fontSize:n*.4},...Array.isArray(a)?a:a?[a]:[]],`orb-avatar ${i??""}`);return f("span",{ref:s,className:l.className,style:l.style,children:o?f("img",{src:o,alt:r??"",style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover"}}):t})});en.displayName="CAvatar";var tn=forwardRef(({severity:t="info",title:o,children:r,onClose:n,sx:a,className:i},s)=>{let l=d(a,`orb-alert orb-alert-${t} ${i??""}`);return g("div",{ref:s,role:"alert",className:l.className,style:l.style,children:[g("div",{style:{flex:1,minWidth:0},children:[o&&f("b",{children:o}),r&&f("span",{children:r})]}),n&&f("button",{type:"button","aria-label":"Close",onClick:n,style:{background:"none",border:"none",padding:0,cursor:"pointer",color:"inherit",font:"500 14px/1 var(--orb-font)",opacity:.7},children:"\u2715"})]})});tn.displayName="CAlert";var Wn=({value:t,variant:o,color:r,sx:n,className:a})=>{let i=o==="indeterminate"||t===void 0,s=d(n,`orb-prog ${a??""}`);return g("div",{className:s.className,role:"progressbar","aria-valuenow":i?void 0:Math.round(t),"aria-valuemin":i?void 0:0,"aria-valuemax":i?void 0:100,style:s.style,children:[f("i",{style:i?{width:"40%",animation:"orb-prog-ind 1.2s ease-in-out infinite"}:{width:`${Math.min(100,Math.max(0,t))}%`,background:r}}),i&&f("style",{children:"@keyframes orb-prog-ind { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }"})]})},Ih=({width:t,height:o=14,variant:r="rectangular",sx:n,className:a})=>f("div",{className:`orb-skel ${a??""}`,style:{width:t,height:o,borderRadius:r==="circular"?"50%":r==="text"?6:"var(--orb-r)",...n}}),Zo=({size:t=12,onPrimary:o=false,sx:r,className:n})=>f("span",{className:`orb-spin ${o?"orb-spin-light":""} ${n??""}`,style:{width:t,height:t,...r},role:"status","aria-label":"Loading"});var ct=({title:t,children:o,enterDelay:r=300,side:n="top",align:a="center",disabled:i})=>!t||i?f(e,{children:o}):f(Yo.Provider,{delayDuration:r,skipDelayDuration:200,children:g(Yo.Root,{children:[f(Yo.Trigger,{asChild:true,children:o}),f(Yo.Portal,{children:f(Yo.Content,{className:"orb-tooltip",side:n,align:a,sideOffset:6,children:t})})]})});var ie=forwardRef(({tooltip:t,size:o="small",active:r=false,edge:n,color:a,sx:i,className:s,children:l,type:d$1="button",...p},m)=>{let h=d([{color:r?"var(--orb-primary)":a,...n==="start"?{marginLeft:-8}:n==="end"?{marginRight:-8}:void 0},...Array.isArray(i)?i:i?[i]:[]],`orb-icon-btn ${o==="small"?"orb-icon-btn-sm":""} ${s??""}`),f$1=f("button",{ref:m,type:d$1,className:h.className,style:h.style,...p,children:l});return t?f(ct,{title:t,children:f$1}):f$1});ie.displayName="CIconButton";var $n=({value:t,options:o,onValueChange:r,size:n="medium",sx:a,className:i,...s})=>{let l=useRef([]),d$1=o.findIndex(u=>!u.disabled),p=o.findIndex(u=>u.value===t),m=(u,b)=>{let C=o.map((v,y)=>v.disabled?-1:y).filter(v=>v>=0);if(C.length===0)return;let g=C.indexOf(b),x;u.key==="Home"&&(x=C[0]),u.key==="End"&&(x=C[C.length-1]),(u.key==="ArrowRight"||u.key==="ArrowDown")&&(x=C[(g+1+C.length)%C.length]),(u.key==="ArrowLeft"||u.key==="ArrowUp")&&(x=C[(g-1+C.length)%C.length]),x!==void 0&&(u.preventDefault(),l.current[x]?.focus(),r(o[x].value));},h=d(a,["orb-segmented-control",n==="small"?"orb-segmented-control-sm":"",i].filter(Boolean).join(" ")),f$1={...h.style,"--orb-segmented-count":Math.max(o.length,1),"--orb-segmented-index":Math.max(p,0)};return g("div",{role:"radiogroup",className:h.className,style:f$1,"data-has-selection":p>=0?"true":"false",...s,children:[f("span",{className:"orb-segmented-control-thumb","aria-hidden":"true"}),o.map((u,b)=>{let C=u.value===t;return f(ie,{ref:g=>{l.current[b]=g;},className:["orb-segmented-control-item",u.icon?"":"orb-segmented-control-item-label"].filter(Boolean).join(" "),size:n,tooltip:u.label,role:"radio","aria-label":u.label,"aria-checked":C,"data-selected":C?"true":void 0,disabled:u.disabled,tabIndex:C||t==null&&b===d$1?0:-1,onClick:()=>r(u.value),onKeyDown:g=>m(g,b),children:u.icon??f("span",{className:"orb-segmented-control-label",children:u.label})},u.value)})]})};var Qt=({triggerLabel:t,items:o=[],trigger:r,align:n="start",anchorEl:a,open:i,onClose:s,children:l,slotProps:d$1,PaperProps:p,anchorPosition:m,sx:h})=>{let f$1=useRef(null);if(useEffect(()=>{if(i!==true)return;let u=C=>{let g=C.composedPath();f$1.current&&g.includes(f$1.current)||a&&g.includes(a)||s?.();},b=C=>{C.key==="Escape"&&s?.();};return document.addEventListener("pointerdown",u,true),document.addEventListener("keydown",b,true),()=>{document.removeEventListener("pointerdown",u,true),document.removeEventListener("keydown",b,true);}},[a,s,i]),i!==void 0){if(!i||typeof document>"u")return null;let u=a?.getBoundingClientRect(),b=window.innerWidth,C=u?.left??16,g=u?.right??C,x=d$1?.paper?.sx??p?.sx,v=d([...Array.isArray(x)?x:x?[x]:[],...Array.isArray(h)?h:h?[h]:[]],"orb-pop orb-menu",d$1?.paper?.style??p?.style),y=Children.map(l,k=>{if(!isValidElement(k)||k.type!=="option")return k;let w=k.props,{children:P,disabled:I,selected:S}=w,R=d(w.sx,`orb-menu-item ${S?"orb-selected":""} ${w.className??""}`,w.style);return f("div",{role:"menuitem","aria-disabled":I||void 0,"aria-selected":S||void 0,tabIndex:I?-1:0,id:w.id,title:w.title,className:R.className,style:R.style,onClick:I?void 0:w.onClick,onKeyDown:N=>{!I&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),w.onClick?.(N));},children:P})});return createPortal(f("div",{ref:f$1,role:"menu",className:v.className,style:{...v.style,position:"fixed",left:n==="end"&&!m?void 0:m?.left??C,right:n==="end"&&!m?Math.max(16,b-g):void 0,top:m?.top??(u?.bottom??16)+6,maxWidth:"calc(100vw - 32px)",zIndex:1301},children:y}),document.body)}return g(Ao.Root,{children:[f(Ao.Trigger,{asChild:true,children:r??f(Pe,{variant:"primary",children:t})}),f(Ao.Portal,{children:f(Ao.Content,{className:"orb-pop orb-menu",align:n,sideOffset:6,children:o.map((u,b)=>g(Ao.Item,{className:"orb-menu-item",disabled:u.disabled,onSelect:()=>u.onClick?.(),children:[u.icon,u.label]},b))})})]})};var Ne=forwardRef(({elevation:t=1,variant:o,component:r,sx:n,style:a,className:i,children:s,...l},d$1)=>{let p=r??"div",m=d(n,`orb-card ${t>0&&o!=="outlined"?"orb-card-raised":""} ${i??""}`,a);return f(p,{ref:d$1,className:m.className,style:m.style,...l,children:s})});Ne.displayName="CPaper";var Rt=forwardRef(({orientation:t="horizontal",flexItem:o,sx:r,className:n},a)=>{let i=d([{...t==="vertical"?{alignSelf:"stretch",height:"auto"}:{width:"100%"},...o?{alignSelf:"stretch"}:void 0},...Array.isArray(r)?r:r?[r]:[]],`${t==="vertical"?"orb-divider-v":"orb-divider"} ${n??""}`);return f("hr",{ref:a,"aria-orientation":t,className:i.className,style:i.style})});Rt.displayName="CDivider";var Hh={h1:"orb-h1",h2:"orb-h2",h3:"orb-h3",h4:"orb-h3",h5:"orb-subtitle",h6:"orb-subtitle",subtitle1:"orb-subtitle",subtitle2:"orb-label",body1:"orb-body",body2:"orb-body-dense",label:"orb-label",caption:"orb-meta",overline:"orb-overline"},zh={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6"},E=forwardRef(({variant:t="body1",component:o,muted:r=false,numeric:n=false,color:a,noWrap:i=false,fontWeight:s,sx:l,className:d$1,children:p,...m},h)=>{let f$1=o??zh[t]??"span",b=[t==="inherit"?void 0:Hh[t],d$1].filter(Boolean).join(" "),C=d([{...r?{color:"var(--orb-muted)"}:void 0,...a?{color:a}:void 0,...n?{fontVariantNumeric:"tabular-nums"}:void 0,...s?{fontWeight:s}:void 0,...i?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:void 0},...Array.isArray(l)?l:l?[l]:[]],b);return f(f$1,{ref:h,className:C.className,style:C.style,...m,children:p})});E.displayName="CTypography";var Wh=t=>{if(t!==void 0)return typeof t=="number"?`${t*8}px`:t},se=forwardRef(({direction:t="column",spacing:o,alignItems:r,justifyContent:n,flexWrap:a,flex:i,useFlexGap:s,sx:l,className:d$1,children:p,...m},h)=>{let f$1=d([{display:"flex",flexDirection:t,gap:Wh(o),alignItems:r,justifyContent:n,flexWrap:a,flex:i},...Array.isArray(l)?l:l?[l]:[]],d$1);return f("div",{ref:h,className:f$1.className,style:f$1.style,...m,children:p})});se.displayName="CStack";var Lt=({open:t,onClose:o,title:r,children:n,actions:a,maxWidth:i=560,fullWidth:s=false,fullScreen:l=false,PaperProps:d$1,slotProps:p,disableRestoreFocus:m,keepMounted:h,hideCloseButton:f$1=false,sx:u,className:b})=>{let C=d([{width:l?"100vw":s?"min(920px, calc(100vw - 32px))":void 0,height:l?"100vh":void 0,maxWidth:l?"none":typeof i=="number"?`${i}px`:i},...Array.isArray(d$1?.sx??p?.paper?.sx)?d$1?.sx??p?.paper?.sx:d$1?.sx??p?.paper?.sx?[d$1?.sx??p?.paper?.sx]:[],...Array.isArray(u)?u:u?[u]:[]],`orb-dialog ${b??""}`);return f(So.Root,{open:t,onOpenChange:g=>{g||o?.();},children:g(So.Portal,{children:[f(So.Overlay,{className:"orb-overlay"}),g(So.Content,{className:C.className,style:C.style,children:[(r||!f$1)&&g("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:16},children:[r?f(So.Title,{className:"orb-dialog-title",children:r}):f(So.Title,{className:"orb-visually-hidden",children:"Dialog"}),!f$1&&f(So.Close,{asChild:true,children:f("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Close",style:{marginTop:-4,marginRight:-4},children:f(Kt,{size:16,strokeWidth:2})})})]}),f("div",{style:{minWidth:0},children:n}),a&&f("div",{className:"orb-dialog-actions",children:a})]})]})})};var Us=({open:t,defaultOpen:o,onOpenChange:r,trigger:n,children:a,align:i="start",side:s="bottom",sideOffset:l=6,matchTriggerWidth:d=false,sx:p,className:m})=>g(br.Root,{open:t,defaultOpen:o,onOpenChange:r,children:[f(br.Trigger,{asChild:true,children:n}),f(br.Portal,{children:f(br.Content,{className:`orb-pop ${m??""}`,align:i,side:s,sideOffset:l,style:{minWidth:d?"var(--radix-popover-trigger-width)":void 0,...p},onOpenAutoFocus:h=>h.preventDefault(),children:a})})]});var Gh=({items:t,value:o,defaultValue:r,onChange:n,sx:a,className:i})=>{let s=o!==void 0,[l,d]=useState(r??t[0]?.value),p=s?o:l,m=useRef([]),h=u=>{s||d(u),n?.(u);},f$1=u=>{if(u.key!=="ArrowRight"&&u.key!=="ArrowLeft")return;u.preventDefault();let b=t.filter(v=>!v.disabled),C=b.findIndex(v=>v.value===p),g=u.key==="ArrowRight"?1:-1,x=b[(C+g+b.length)%b.length];if(x){h(x.value);let v=t.findIndex(y=>y.value===x.value);m.current[v]?.focus();}};return f("div",{className:`orb-tabs ${i??""}`,role:"tablist",style:a,onKeyDown:f$1,children:t.map((u,b)=>{let C=u.value===p;return g("button",{ref:g=>{m.current[b]=g;},type:"button",role:"tab","aria-selected":C,disabled:u.disabled,className:`orb-tab ${C?"orb-is-active":""}`,style:{display:"inline-flex",alignItems:"center",gap:6},onClick:()=>h(u.value),children:[u.icon,u.label]},u.value)})})};var Kh=["su","mo","tu","we","th","fr","sa"],_n=(t,o)=>!!(t&&o&&t.isSame(o,"day")),Gn=({value:t,rangeStart:o,rangeEnd:r,onChange:n,month:a,defaultMonth:i,onMonthChange:s,minDate:l,maxDate:d,locale:p,renderDay:m})=>{let h=a!==void 0,[f$1,u]=useState(()=>i??t??o??rr()),b=(h?a:f$1).startOf("month"),C=w=>{h||u(w),s?.(w);},g$1=useMemo(()=>p?b.locale(p):b,[b,p]),x=useMemo(()=>{let P=b.startOf("month").startOf("week"),I=[],S=P;for(let R=0;R<6;R+=1){let N=[];for(let T=0;T<7;T+=1)N.push(S),S=S.add(1,"day");if(I.push(N),S.isAfter(b.endOf("month"))&&R>=3)break}return I},[b]),v=useMemo(()=>{let w=p?rr().locale(p):rr();return Kh.map((P,I)=>w.startOf("week").add(I,"day").format("dd"))},[p]),y=w=>!!(l&&w.isBefore(l.startOf("day"))||d&&w.isAfter(d.startOf("day"))),k=o!==void 0||r!==void 0;return g("div",{className:"orb-cal",children:[g("div",{className:"orb-cal-head",children:[f("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Previous month",onClick:()=>C(b.subtract(1,"month")),children:f(Ra,{size:16,strokeWidth:2})}),f("span",{className:"orb-cal-title","aria-live":"polite",children:g$1.format("MMMM YYYY")}),f("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Next month",onClick:()=>C(b.add(1,"month")),children:f(Ho,{size:16,strokeWidth:2})})]}),g("div",{className:"orb-cal-grid",role:"grid",children:[v.map((w,P)=>f("span",{className:"orb-cal-dow",children:w},`${w}-${P}`)),x.flat().map(w=>{let P=!w.isSame(b,"month"),I=y(w),S=k?_n(w,o)||_n(w,r):_n(w,t),R=w.isSame(rr(),"day"),N=k&&o&&r&&w.isAfter(o.startOf("day"))&&w.isBefore(r.startOf("day")),T=k&&_n(w,o)&&!!r,M=k&&_n(w,r)&&!!o,A=["orb-cal-day",P?"orb-is-outside":void 0,R?"orb-is-today":void 0,S?"orb-is-selected":void 0,N?"orb-is-in-range":void 0,T?"orb-is-range-start":void 0,M?"orb-is-range-end":void 0].filter(Boolean).join(" ");return m?f("span",{className:"orb-cal-day-slot",children:m(w,{outsideCurrentMonth:P,selected:S,today:R,disabled:I})},w.format("YYYY-MM-DD")):f("button",{type:"button",role:"gridcell","aria-selected":S,"aria-current":R?"date":void 0,className:A,disabled:I,onClick:()=>n?.(w),children:w.date()},w.format("YYYY-MM-DD"))})]})]})};rr.extend(qh);var Xh=({label:t,value:o,defaultValue:r,onChange:n,minDate:a,maxDate:i,disabled:s,format:l="YYYY-MM-DD",placeholder:d,locale:p,dense:m=false,error:h,helperText:f$1,sx:u,className:b})=>{let C=o!==void 0,[g$1,x]=useState(r??null),v=C?o:g$1,[y,k]=useState(false),[w,P]=useState(null),I=M=>{C||x(M),n?.(M);},S=w??(v?(p?v.locale(p):v).format(l):""),R=()=>{if(w===null)return;let M=w.trim();if(!M)I(null);else {let A=rr(M,l,true);A.isValid()&&!(a&&A.isBefore(a.startOf("day")))&&!(i&&A.isAfter(i.startOf("day")))&&I(A);}P(null);},T=(typeof h=="string"?h:void 0)??f$1;return g("div",{className:`orb-fld ${h?"orb-is-error":""} ${b??""}`,style:u,children:[t&&f("label",{children:t}),f(Us,{open:y,onOpenChange:k,trigger:g("div",{className:"orb-inp-adornment-wrap",style:{width:"100%"},children:[f("span",{className:"orb-inp-adornment",children:f(Vs,{size:15,strokeWidth:1.8})}),f("input",{className:`orb-inp ${m?"orb-inp-dense":""}`,value:S,placeholder:d??l,disabled:s,onFocus:()=>k(true),onChange:M=>P(M.target.value),onBlur:R,onKeyDown:M=>{M.key==="Enter"&&(R(),k(false)),M.key==="Escape"&&k(false);}})]}),children:f(Gn,{value:v,onChange:M=>{I(M),P(null),k(false);},minDate:a,maxDate:i,locale:p,defaultMonth:v??void 0})}),T&&f("span",{className:"orb-fld-msg",children:T})]})};var Yh=({onFilesSelected:t,multiple:o=false,accept:r="*",maxSize:n,title:a="Drag and drop files here or click to upload",subtitle:i="Support for bulk upload",sx:s})=>{let[l,d]=useState(false),[p,m]=useState([]),h=useRef(null),f$1=v=>{v.preventDefault(),d(true);},u=v=>{v.preventDefault(),d(false);},b=v=>{v.preventDefault(),d(false),g$1(Array.from(v.dataTransfer.files));},C=v=>{v.target.files&&g$1(Array.from(v.target.files));},g$1=v=>{let y=n?v.filter(w=>w.size<=n):v;y.length<v.length&&console.warn(`Some files were rejected because they exceed the maximum size of ${n} bytes.`);let k=o?[...p,...y]:y;o&&(k=k.filter((w,P,I)=>P===I.findIndex(S=>S.name===w.name&&S.size===w.size&&S.lastModified===w.lastModified))),m(k),t?.(k),h.current&&(h.current.value="");},x=v=>{let y=p.filter((k,w)=>w!==v);m(y),t?.(y);};return g("div",{style:{width:"100%",...s},children:[g("div",{onClick:()=>h.current?.click(),onDragOver:f$1,onDragLeave:u,onDrop:b,role:"button",tabIndex:0,onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),h.current?.click());},style:{border:`2px dashed ${l?"var(--orb-primary)":"var(--orb-border)"}`,borderRadius:"var(--orb-r)",padding:32,textAlign:"center",cursor:"pointer",backgroundColor:l?"var(--orb-hover)":"var(--orb-canvas)",transition:"border-color var(--orb-t-fast), background-color var(--orb-t-fast)"},children:[f("input",{type:"file",ref:h,style:{display:"none"},multiple:o,accept:r,onChange:C}),g("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[f(ed,{size:40,strokeWidth:1.5,color:l?"var(--orb-primary)":"var(--orb-muted)"}),f("span",{className:"orb-subtitle",children:a}),f("span",{className:"orb-meta",children:i})]})]}),p.length>0&&f("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:16},children:p.map((v,y)=>g("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",border:"1px solid var(--orb-border)",borderRadius:"var(--orb-r)",backgroundColor:"var(--orb-surface)"},children:[g("div",{style:{display:"flex",alignItems:"center",gap:8,overflow:"hidden"},children:[f(Oc,{size:16,strokeWidth:1.8,color:"var(--orb-muted)"}),f("span",{className:"orb-body-dense",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:v.name}),g("span",{className:"orb-meta",children:["(",(v.size/1024).toFixed(1)," KB)"]})]}),f(ie,{"aria-label":`Remove ${v.name}`,onClick:()=>x(y),children:f(jc,{size:15,strokeWidth:1.8})})]},`${v.name}-${y}`))})]})};function bo(...t){return twMerge(clsx(t))}var Ga={primary:"bg-primary text-primary-foreground hover:bg-primary/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-accent hover:text-accent-foreground"},Un={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},ad=()=>"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50";var tf=cva(ad(),{variants:{variant:{default:`${Ga.primary} shadow-sm`,destructive:"bg-[var(--orb-status-error)] text-[var(--orb-on-primary)] hover:opacity-90 active:opacity-80 shadow-sm",outline:`${Ga.outline} shadow-sm`,secondary:"bg-[var(--orb-surface-2)] text-[var(--orb-fg)] hover:bg-[var(--orb-hover)] active:bg-[var(--orb-selected)] shadow-sm",ghost:Ga.ghost,link:"text-[var(--orb-status-primary)] underline-offset-4 hover:underline hover:text-[var(--orb-status-primary)] active:text-[var(--orb-p700)]","chat-tool":"bg-[var(--orbai-surface-2)] border border-[var(--orbai-border-soft)] text-[var(--orbai-text-2)] hover:bg-[var(--orbai-surface-3)] hover:border-[var(--orbai-border-strong)] hover:text-[var(--orbai-text-1)] active:scale-95 transition-all duration-200","chat-send":"bg-[var(--orb-primary)] hover:bg-[var(--orb-p600)] text-[var(--orb-on-primary)] border border-[var(--orbai-border-strong)] shadow-[var(--orbai-shadow-soft-sm)] hover:shadow-[var(--orbai-shadow-soft-md)] active:scale-95 transition-all duration-200","chat-stop":"bg-[var(--orb-status-error)] hover:opacity-90 border border-[var(--orbai-border-strong)] shadow-[var(--orbai-shadow-soft-sm)] hover:shadow-[var(--orbai-shadow-soft-md)] active:scale-95 text-[var(--orb-on-primary)] transition-all duration-200","chat-disabled":"cursor-not-allowed opacity-50 bg-[var(--orbai-surface-2)] border border-[var(--orbai-border-soft)] text-[var(--orbai-muted)]"},size:{default:"h-10 px-4 py-2",sm:"h-9 px-3",lg:"h-11 px-8",icon:"h-10 w-10","chat-sm":"h-8 w-8 rounded-full","chat-md":"h-10 w-10 rounded-full","chat-lg":"h-12 w-12 rounded-full"},rounded:{none:Un.none,sm:Un.sm,md:Un.md,full:Un.full}},defaultVariants:{variant:"default",size:"default",rounded:"md"}}),Xs=Jt.forwardRef(({className:t,variant:o,size:r,asChild:n=false,...a},i)=>f(n?Slot:"button",{className:bo(tf({variant:o,size:r,className:t})),ref:i,...a}));Xs.displayName="Button";var of={"common.cancel":"Cancel","common.save":"Save","common.ok":"OK","common.done":"Done","common.search":"Search","common.none":"None","common.all":"All","common.noData":"No data","common.copy":"Copy","common.delete":"Delete","common.loading":"Loading...","header.searchPlaceholder":"Ask me...","header.searchAddFeature":"Add feature","header.searchStartVoice":"Start voice input","header.searchStopVoice":"Stop voice input","header.searchOpenPanel":"Open conversation","header.theme.system":"Theme: System","header.theme.dark":"Theme: Dark","header.theme.light":"Theme: Light","header.menu.setting":"Setting","header.menu.refresh":"Refresh","header.menu.logout":"Logout","navigation.expand":"Expand navigation","navigation.collapse":"Collapse navigation","navigation.searchPlaceholder":"Search menu...","navigation.noMatch":"No matching menu items","navigation.noAccessibleApp":"No accessible applications","navigation.noItems":"No items to display","navigation.expandView":"Expand {title}","navigation.mode.switchToFixed":"Switch to fixed navigation","navigation.mode.switchToFloating":"Switch to floating navigation","navigation.pinned":"Pinned","navigation.pin.add":"Pin to top","navigation.pin.remove":"Unpin","table.toolbar.searchPlaceholder":"Search...","table.title.default":"Data Table","table.toolbar.groupBy":"Group By","table.toolbar.summary":"Summary","table.toolbar.columns":"Columns","table.toolbar.export":"Export","table.toolbar.itemsPerPage":"Items per page:","table.toolbar.pageOf":"Page {current} of {total}","table.toolbar.newItem":"New Item","table.toolbar.editItem":"Edit Item","table.toolbar.deleteItem":"Delete Item","table.toolbar.graphicReport":"Graphic Report","table.toolbar.saveLayout":"Save Layout","table.menu.groupBy":"Group By","table.menu.clearAll":"Clear All","table.menu.visibleColumns":"Visible Columns","table.menu.showSummaryRow":"Show Summary Row","table.menu.noNumericColumns":"No numeric columns","table.group.expandAll":"Expand All Groups","table.group.collapseAll":"Collapse All Groups","table.mobile.notImplemented":"Mobile View Not Implemented","table.headerMenu.sortAsc":"Sort Ascending","table.headerMenu.sortDesc":"Sort Descending","table.headerMenu.clearSort":"Clear Sort","table.headerMenu.configureSort":"Configure Sort...","table.headerMenu.group":"Group by this column","table.headerMenu.ungroup":"Remove from grouping","table.headerMenu.addSummary":"Include in Summary","table.headerMenu.removeSummary":"Remove from Summary","table.headerMenu.hideColumn":"Hide Column","table.sortDialog.title":"Sort Settings","table.sortDialog.empty":"No sort rules. Add one to start ordering rows.","table.sortDialog.addRule":"Add Sort Rule","table.sortDialog.clearAll":"Clear All","table.sortDialog.asc":"Ascending","table.sortDialog.desc":"Descending","pivot.title.default":"Pivot Table Builder","pivot.subtitle.default":"Drag fields to configure the pivot table.","pivot.empty":"Drag at least one field into Values to render the pivot result.","pivot.records":"Records","pivot.afterFilter":"After filter","pivot.grandTotal":"Grand Total","pivot.resultLabel":"Result","pivot.valueLabel":"Value","pivot.table.dimensions":"Dimensions","pivot.config.title":"Configuration","pivot.fieldList":"Field List","pivot.availableDimensions":"Available dimensions","pivot.allFieldsInUse":"All fields are in use.","pivot.zone.rows":"Rows","pivot.zone.columns":"Columns","pivot.zone.filters":"Filters","pivot.zone.values":"Values","pivot.hint.rows":"Drag fields here to build row hierarchy","pivot.hint.columns":"Drag fields here to build column hierarchy","pivot.hint.filters":"Drag fields here for report filters","pivot.hint.values":"Drag numeric fields here for aggregation","pivot.clearArea":"Clear area","pivot.filter.na":"N/A","pivot.filter.noValues":"No values","pivot.filter.noneSelected":"None selected","pivot.filter.allValues":"All values","pivot.filter.selectedCount":"{selected} / {total} selected","pivot.filter.selectAll":"Select All","pivot.filter.deselectAll":"Deselect All","pivot.filter.noResults":"No results","pivot.collapse.ariaExpand":"Expand configuration area","pivot.collapse.ariaCollapse":"Collapse configuration area","pivot.agg.sum":"Sum","pivot.agg.count":"Count","pivot.agg.avg":"Average","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"Select preset","pivot.preset.save":"Save preset","pivot.preset.delete":"Delete preset","pivot.preset.saveDialogTitle":"Save current preset","pivot.preset.nameLabel":"Preset name","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"Pivot Result","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"Expand pivot result","pivot.table.collapse.ariaCollapse":"Collapse pivot result","pivot.chart.title":"Pivot Chart","pivot.chart.subtitle":"Map one dimension and up to two measures into a compact chart.","pivot.chart.subtitleReady":"{dimension} by {measure}","pivot.chart.emptyNoDimension":"Add at least one row or column field to render the chart.","pivot.chart.emptyNoValue":"Add at least one value field to render the chart.","pivot.chart.emptyNoData":"No data available for the current chart selection.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Measure","pivot.chart.secondaryMeasure":"Compare measure","pivot.chart.chartType":"Chart type","pivot.chart.style.barVertical":"Vertical bars","pivot.chart.style.barHorizontal":"Horizontal bars","pivot.chart.style.line":"Line","pivot.chart.style.scatter":"Scatter","pivot.chart.collapse.ariaExpand":"Expand chart area","pivot.chart.collapse.ariaCollapse":"Collapse chart area","smartFilter.adaptFilters":"Adapt Filters","smartFilter.addFilters":"Add Filters","smartFilter.go":"Go","smartFilter.visibleFilters":"Visible Filters","smartFilter.searchPlaceholder":"Search...","smartFilter.noOptionsFound":"No options found","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"Equals","smartFilter.operator.contains":"Contains","smartFilter.operator.notContains":"Does Not Contain","smartFilter.operator.wildcard":"Wildcard Search","smartFilter.operator.notEquals":"Not Equals","smartFilter.operator.greaterThan":"Greater Than","smartFilter.operator.lessThan":"Less Than","smartFilter.operator.greaterOrEqual":"Greater Than or Equal","smartFilter.operator.lessOrEqual":"Less Than or Equal","smartFilter.operator.between":"Between","variant.noOptions":"No options","variant.defaultSuffix":"Default","variant.selectVariant":"Select Variant","variant.saveView":"Save View","variant.newVariant":"New Variant","variant.viewName":"View Name","variant.setDefault":"Set as Default","variant.publicAllUsers":"Public (All Users)","variant.toast.fetchFailed":"Failed to load variants","variant.toast.saveFailed":"Failed to save variant","variant.toast.saveSuccess":"Variant saved successfully","variant.toast.deleteFailed":"Failed to delete variant","variant.toast.deleteSuccess":"Variant deleted successfully","variant.toast.defaultFailed":"Failed to update default variant","variant.toast.defaultSuccess":"Default variant updated","layout.saveLayout":"Save Layout","layout.layoutOptions":"Layout Options","layout.selectLayout":"Select Layout","layout.saveCurrentLayout":"Save Current Layout...","layout.noSavedLayouts":"No saved layouts","layout.removeDefault":"Remove Default","layout.setAsDefault":"Set as Default","layout.layoutName":"Layout Name","layout.layoutDescription":"Description","layout.layoutNameHelper":"e.g., 'Compact View'","layout.warningOverwrite":"Warning: Existing layout will be overwritten","layout.useAsDefault":"Use as Default Layout","layout.publicAllUsers":"Public (Visible to all users)","layout.toast.loadFallback":"Failed to load layouts from backend, fallback to local storage","layout.toast.saveSuccess":"Layout saved successfully","layout.toast.saveLocalSuccess":"Layout saved to local storage","layout.toast.backendUnavailableSavedLocal":"Backend unavailable, saved to local storage","layout.toast.deleteSuccess":"Layout deleted successfully","layout.toast.deleteLocalSuccess":"Layout deleted from local storage","layout.toast.backendUnavailableDeletedLocal":"Backend unavailable, deleted from local storage","layout.toast.defaultSuccess":"Default layout set","layout.toast.defaultLocalSuccess":"Default layout set in local storage","layout.toast.backendUnavailableDefaultLocal":"Backend unavailable, default saved to local storage","dateRange.label":"Date Range","dateRange.startDate":"Start Date","dateRange.endDate":"End Date","dateRange.select":"Select...","dateRange.today":"Today","dateRange.thisWeek":"This Week","dateRange.thisMonth":"This Month","graph.records":"{count} records","graph.kpi.totalRecords":"Total Records","graph.kpi.totalReport":"Total Report","graph.kpi.totalBillable":"Total Billable","graph.kpi.efficiency":"Efficiency","graph.kpi.amount":"Amount","graph.kpi.flagged":"Flagged","graph.chart.billable.title":"Billable by Dimension","graph.chart.billable.subtitle":"Top values by billable hours","graph.chart.efficiency.title":"Efficiency by Person","graph.chart.efficiency.subtitle":"Lowest efficiency first","graph.chart.status.title":"Status Distribution","graph.chart.status.subtitle":"Record ratio by status","graph.dataBody":"Data Body","graph.reportTitle":"Graphic Report","graph.unassigned":"Unassigned","graph.column.reportHours":"Report Hours","graph.column.billableHours":"Billable Hours","detail.searchAi.placeholder":"Search fields, or ask AI if no match...","detail.searchAi.matches":"{count} matches found","detail.searchAi.noMatch":"No matching field found.","detail.searchAi.autoAiFallback":"No direct match. Triggering AI analysis...","detail.searchAi.aiResultTitle":"AI Insight","detail.table.title":"Related Records","kanban.empty":"Drop cards here","kanban.bucket.limit":"Limit","kanban.bucket.dropHere":"Release to move into this bucket","kanban.bucket.add":"Add bucket","kanban.bucket.rename":"Rename bucket","kanban.bucket.saveRename":"Save bucket name","kanban.bucket.cancelRename":"Cancel renaming","kanban.search.placeholder":"Search cards and buckets","kanban.search.clear":"Clear search","kanban.search.results":"{count} matching cards","kanban.search.noMatch":"No matching cards","kanban.card.progress":"Progress","kanban.card.openDetail":"Open Detail","kanban.priority.critical":"Critical","kanban.priority.high":"High","kanban.priority.medium":"Medium","kanban.priority.low":"Low","quickCreate.newItem":"New Item","quickCreate.createWithTitle":"Create {title}","quickEdit.editWithTitle":"Edit {title}","quickDelete.confirmTitle":"Confirm Delete","quickDelete.confirmMessageSingle":"Are you sure you want to delete the selected record?","quickDelete.confirmMessageMultiple":"Are you sure you want to delete {count} selected records?","cardPage.viewDetails":"View Details","cardPage.download":"Download","cardPage.close":"Close","cardPage.empty":"No items found","messageBox.confirm":"OK","messageBox.cancel":"Cancel","omph.status.idle":"Idle","omph.status.pending":"Pending","omph.status.running":"Working","omph.status.success":"Success","omph.status.error":"Error","omph.working":"Working","omph.workingFor":"Working for {duration}","omph.loadOlder":"Load earlier","omph.loadingOlder":"Loading earlier\u2026","omph.toBottom":"Back to bottom","omph.copy":"Copy","omph.copied":"Copied","omph.turnActions":"Reply actions","omph.usage":"Usage","omph.inputTokens":"Input","omph.outputTokens":"Output","omph.duration":"Duration","omph.send":"Send","omph.stop":"Stop","omph.supplement.queued":"Added to the running task","omph.turnRail":"Turns","omph.secondUnit":"s","omph.minuteUnit":"m","omph.preview.title":"File preview","omph.preview.close":"Close preview","omph.preview.back":"Back to conversation","omph.preview.expand":"Expand preview","omph.preview.collapse":"Restore preview size","omph.preview.copyContent":"Copy content","omph.preview.copyPath":"Copy path","omph.preview.download":"Download","omph.preview.openExternal":"Open externally","omph.preview.wrap":"Wrap","omph.preview.loading":"Loading file","omph.preview.missing":"File not found","omph.preview.failed":"Could not load this file","omph.preview.unsupported":"No preview for this file type","omph.preview.retry":"Try again","omph.preview.resize":"Resize preview","omph.preview.line":"Line {start}","omph.preview.lines":"Lines {start}\u2013{end}","omph.preview.truncated":"Showing the first {shown} of {total} lines","omph.preview.sheetTruncated":"Showing the first {shown} of {total} rows","omph.preview.imageFailed":"The image could not be displayed","omph.preview.zoomIn":"Zoom in","omph.preview.zoomOut":"Zoom out","omph.preview.zoomFit":"Fit to width","omph.newConversation":"New conversation","omph.conversationList":"Conversation list","omph.conversations":"Conversations","omph.noConversations":"No conversations yet","omph.approval.waiting":"Waiting for approval","omph.approval.choose":"Choose an action","omph.approval.details":"Approval details","omph.approval.choices":"Actions","omph.approval.reject":"Reject","omph.approval.allowOnce":"Allow once","omph.approval.confirm":"Continue","omph.approval.other":"Other","omph.approval.otherPlaceholder":"Describe the action to take","omph.approval.escalation":"Tool {toolName} requests privileged execution","omph.input.placeholder":"Type a message...","omph.input.upload":"Upload file","omph.input.send":"Send message","omph.input.stop":"Stop generating","omph.input.queue.ask":"Agent is running. Send this now or after the turn?","omph.input.queue.sendNow":"Send now","omph.input.queue.afterTurn":"Send after this turn","omph.input.queue.queued":"Queued \u2014 sends after this turn","omph.input.queue.cancel":"Cancel","omph.input.message":"Message input","omph.input.tools":"Input tools","agentui.html.defaultTitle":"Interactive HTML","agentui.html.open":"Open","agentui.html.preview":"Preview","agentui.html.code":"Code","agentui.html.toggle":"Switch between code and preview","agentui.html.copy":"Copy code","agentui.html.copied":"Copied","agentui.html.download":"Download","agentui.html.close":"Close"},rf={"common.cancel":"\u53D6\u6D88","common.save":"\u4FDD\u5B58","common.ok":"\u786E\u5B9A","common.done":"\u5B8C\u6210","common.search":"\u641C\u7D22","common.none":"\u65E0","common.all":"\u5168\u90E8","common.noData":"\u6682\u65E0\u6570\u636E","common.copy":"\u590D\u5236","common.delete":"\u5220\u9664","common.loading":"\u52A0\u8F7D\u4E2D...","header.searchPlaceholder":"\u95EE\u6211\u70B9\u4EC0\u4E48...","header.searchAddFeature":"\u589E\u52A0\u529F\u80FD","header.searchStartVoice":"\u5F00\u59CB\u8BED\u97F3\u8F93\u5165","header.searchStopVoice":"\u505C\u6B62\u8BED\u97F3\u8F93\u5165","header.searchOpenPanel":"\u6253\u5F00\u5BF9\u8BDD","header.theme.system":"\u4E3B\u9898\uFF1A\u8DDF\u968F\u7CFB\u7EDF","header.theme.dark":"\u4E3B\u9898\uFF1A\u6DF1\u8272","header.theme.light":"\u4E3B\u9898\uFF1A\u6D45\u8272","header.menu.setting":"\u8BBE\u7F6E","header.menu.refresh":"\u5237\u65B0","header.menu.logout":"\u6CE8\u9500","navigation.expand":"\u5C55\u5F00\u5BFC\u822A","navigation.collapse":"\u6298\u53E0\u5BFC\u822A","navigation.searchPlaceholder":"\u641C\u7D22\u83DC\u5355...","navigation.noMatch":"\u672A\u627E\u5230\u5339\u914D\u7684\u83DC\u5355\u9879","navigation.noAccessibleApp":"\u6682\u65E0\u53EF\u8BBF\u95EE\u7684\u5E94\u7528","navigation.noItems":"\u6682\u65E0\u53EF\u663E\u793A\u9879","navigation.expandView":"\u5C55\u5F00\u67E5\u770B {title}","navigation.mode.switchToFixed":"\u5207\u6362\u4E3A\u56FA\u5B9A\u5BFC\u822A","navigation.mode.switchToFloating":"\u5207\u6362\u4E3A\u60AC\u6D6E\u5BFC\u822A","navigation.pinned":"\u5DF2\u56FA\u5B9A","navigation.pin.add":"\u56FA\u5B9A\u5230\u9876\u90E8","navigation.pin.remove":"\u53D6\u6D88\u56FA\u5B9A","table.toolbar.searchPlaceholder":"\u641C\u7D22...","table.title.default":"\u6570\u636E\u8868","table.toolbar.groupBy":"\u5206\u7EC4","table.toolbar.summary":"\u6C47\u603B","table.toolbar.columns":"\u5217","table.toolbar.export":"\u5BFC\u51FA","table.toolbar.itemsPerPage":"\u6BCF\u9875\u6761\u6570\uFF1A","table.toolbar.pageOf":"\u7B2C {current} / {total} \u9875","table.toolbar.newItem":"\u65B0\u5EFA\u6761\u76EE","table.toolbar.editItem":"\u7F16\u8F91\u6761\u76EE","table.toolbar.deleteItem":"\u5220\u9664\u6761\u76EE","table.toolbar.graphicReport":"\u56FE\u8868\u62A5\u8868","table.toolbar.saveLayout":"\u4FDD\u5B58\u5E03\u5C40","table.menu.groupBy":"\u5206\u7EC4","table.menu.clearAll":"\u6E05\u7A7A","table.menu.visibleColumns":"\u53EF\u89C1\u5217","table.menu.showSummaryRow":"\u663E\u793A\u6C47\u603B\u884C","table.menu.noNumericColumns":"\u6CA1\u6709\u6570\u503C\u5217","table.group.expandAll":"\u5C55\u5F00\u5168\u90E8\u5206\u7EC4","table.group.collapseAll":"\u6298\u53E0\u5168\u90E8\u5206\u7EC4","table.mobile.notImplemented":"\u79FB\u52A8\u7AEF\u89C6\u56FE\u6682\u672A\u5B9E\u73B0","table.headerMenu.sortAsc":"\u5347\u5E8F\u6392\u5217","table.headerMenu.sortDesc":"\u964D\u5E8F\u6392\u5217","table.headerMenu.clearSort":"\u6E05\u9664\u6392\u5E8F","table.headerMenu.configureSort":"\u6392\u5E8F\u8BBE\u7F6E...","table.headerMenu.group":"\u6309\u6B64\u5217\u5206\u7EC4","table.headerMenu.ungroup":"\u53D6\u6D88\u5206\u7EC4","table.headerMenu.addSummary":"\u52A0\u5165\u6C47\u603B","table.headerMenu.removeSummary":"\u4ECE\u6C47\u603B\u4E2D\u79FB\u9664","table.headerMenu.hideColumn":"\u9690\u85CF\u8BE5\u5217","table.sortDialog.title":"\u6392\u5E8F\u8BBE\u7F6E","table.sortDialog.empty":"\u6682\u65E0\u6392\u5E8F\u89C4\u5219\uFF0C\u8BF7\u6DFB\u52A0\u89C4\u5219\u8FDB\u884C\u6392\u5E8F\u3002","table.sortDialog.addRule":"\u6DFB\u52A0\u6392\u5E8F\u89C4\u5219","table.sortDialog.clearAll":"\u6E05\u7A7A\u89C4\u5219","table.sortDialog.asc":"\u5347\u5E8F","table.sortDialog.desc":"\u964D\u5E8F","pivot.title.default":"\u6570\u636E\u900F\u89C6\u8868","pivot.subtitle.default":"\u62D6\u62FD\u5B57\u6BB5\u4EE5\u914D\u7F6E\u900F\u89C6\u8868\u3002","pivot.empty":"\u8BF7\u81F3\u5C11\u62D6\u5165\u4E00\u4E2A\u503C\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u900F\u89C6\u7ED3\u679C\u3002","pivot.records":"\u8BB0\u5F55\u6570","pivot.afterFilter":"\u7B5B\u9009\u540E","pivot.grandTotal":"\u603B\u8BA1","pivot.resultLabel":"\u7ED3\u679C","pivot.valueLabel":"\u503C","pivot.table.dimensions":"\u7EF4\u5EA6","pivot.config.title":"\u5E03\u5C40\u914D\u7F6E","pivot.fieldList":"\u5B57\u6BB5\u5217\u8868","pivot.availableDimensions":"\u53EF\u7528\u7EF4\u5EA6","pivot.allFieldsInUse":"\u6240\u6709\u5B57\u6BB5\u90FD\u5DF2\u4F7F\u7528\u3002","pivot.zone.rows":"\u884C","pivot.zone.columns":"\u5217","pivot.zone.filters":"\u7B5B\u9009","pivot.zone.values":"\u503C","pivot.hint.rows":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u6784\u5EFA\u884C\u5C42\u7EA7","pivot.hint.columns":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u6784\u5EFA\u5217\u5C42\u7EA7","pivot.hint.filters":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u4F5C\u4E3A\u62A5\u8868\u7B5B\u9009","pivot.hint.values":"\u5C06\u6570\u503C\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u8FDB\u884C\u805A\u5408","pivot.clearArea":"\u6E05\u7A7A\u533A\u57DF","pivot.filter.na":"\u4E0D\u53EF\u7528","pivot.filter.noValues":"\u65E0\u53EF\u9009\u503C","pivot.filter.noneSelected":"\u672A\u9009\u62E9","pivot.filter.allValues":"\u5168\u90E8\u503C","pivot.filter.selectedCount":"\u5DF2\u9009 {selected} / {total}","pivot.filter.selectAll":"\u5168\u9009","pivot.filter.deselectAll":"\u53D6\u6D88\u5168\u9009","pivot.filter.noResults":"\u65E0\u5339\u914D\u7ED3\u679C","pivot.collapse.ariaExpand":"\u5C55\u5F00\u914D\u7F6E\u533A\u57DF","pivot.collapse.ariaCollapse":"\u6298\u53E0\u914D\u7F6E\u533A\u57DF","pivot.agg.sum":"\u6C42\u548C","pivot.agg.count":"\u8BA1\u6570","pivot.agg.avg":"\u5E73\u5747\u503C","pivot.agg.min":"\u6700\u5C0F\u503C","pivot.agg.max":"\u6700\u5927\u503C","pivot.preset.selectPlaceholder":"\u9009\u62E9\u65B9\u6848","pivot.preset.save":"\u4FDD\u5B58\u65B9\u6848","pivot.preset.delete":"\u5220\u9664\u65B9\u6848","pivot.preset.saveDialogTitle":"\u4FDD\u5B58\u5F53\u524D\u65B9\u6848","pivot.preset.nameLabel":"\u65B9\u6848\u540D\u79F0","pivot.preset.defaultName":"\u65B9\u6848 {index}","pivot.table.sectionTitle":"\u900F\u89C6\u7ED3\u679C","pivot.table.expandRowsAll":"\u884C\u5168\u90E8\u6253\u5F00","pivot.table.collapseRowsAll":"\u884C\u5168\u90E8\u6298\u53E0","pivot.table.expandColumnsAll":"\u5217\u5168\u90E8\u6253\u5F00","pivot.table.collapseColumnsAll":"\u5217\u5168\u90E8\u6298\u53E0","pivot.table.collapse.ariaExpand":"\u5C55\u5F00\u900F\u89C6\u7ED3\u679C","pivot.table.collapse.ariaCollapse":"\u6298\u53E0\u900F\u89C6\u7ED3\u679C","pivot.chart.title":"\u900F\u89C6\u56FE\u8868","pivot.chart.subtitle":"\u5C06\u4E00\u4E2A\u7EF4\u5EA6\u4E0E\u6700\u591A\u4E24\u4E2A\u5EA6\u91CF\u6620\u5C04\u4E3A\u7D27\u51D1\u56FE\u8868\u3002","pivot.chart.subtitleReady":"{dimension} \xB7 {measure}","pivot.chart.emptyNoDimension":"\u8BF7\u81F3\u5C11\u653E\u5165\u4E00\u4E2A\u884C\u6216\u5217\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u56FE\u8868\u3002","pivot.chart.emptyNoValue":"\u8BF7\u81F3\u5C11\u653E\u5165\u4E00\u4E2A\u503C\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u56FE\u8868\u3002","pivot.chart.emptyNoData":"\u5F53\u524D\u56FE\u8868\u9009\u62E9\u4E0B\u6682\u65E0\u53EF\u5C55\u793A\u6570\u636E\u3002","pivot.chart.dimension":"\u56FE\u8868\u7EF4\u5EA6","pivot.chart.primaryMeasure":"\u4E3B\u5EA6\u91CF","pivot.chart.secondaryMeasure":"\u5BF9\u6BD4\u5EA6\u91CF","pivot.chart.chartType":"\u56FE\u8868\u7C7B\u578B","pivot.chart.style.barVertical":"\u7EB5\u5411\u67F1\u72B6\u56FE","pivot.chart.style.barHorizontal":"\u6A2A\u5411\u67F1\u72B6\u56FE","pivot.chart.style.line":"\u6298\u7EBF\u56FE","pivot.chart.style.scatter":"\u6563\u70B9\u56FE","pivot.chart.collapse.ariaExpand":"\u5C55\u5F00\u56FE\u8868\u533A\u57DF","pivot.chart.collapse.ariaCollapse":"\u6298\u53E0\u56FE\u8868\u533A\u57DF","smartFilter.adaptFilters":"\u7B5B\u9009\u8BBE\u7F6E","smartFilter.addFilters":"\u6DFB\u52A0\u7B5B\u9009","smartFilter.go":"\u6267\u884C","smartFilter.visibleFilters":"\u53EF\u89C1\u7B5B\u9009\u9879","smartFilter.searchPlaceholder":"\u641C\u7D22...","smartFilter.noOptionsFound":"\u672A\u627E\u5230\u9009\u9879","smartFilter.min":"\u6700\u5C0F\u503C","smartFilter.max":"\u6700\u5927\u503C","smartFilter.minMaxPlaceholder":"\u6700\u5C0F\u503C - \u6700\u5927\u503C","smartFilter.operator.equals":"\u7B49\u4E8E","smartFilter.operator.contains":"\u5305\u542B","smartFilter.operator.notContains":"\u4E0D\u5305\u542B","smartFilter.operator.wildcard":"\u901A\u914D\u7B26\u641C\u7D22","smartFilter.operator.notEquals":"\u4E0D\u7B49\u4E8E","smartFilter.operator.greaterThan":"\u5927\u4E8E","smartFilter.operator.lessThan":"\u5C0F\u4E8E","smartFilter.operator.greaterOrEqual":"\u5927\u4E8E\u7B49\u4E8E","smartFilter.operator.lessOrEqual":"\u5C0F\u4E8E\u7B49\u4E8E","smartFilter.operator.between":"\u533A\u95F4","variant.noOptions":"\u65E0\u9009\u9879","variant.defaultSuffix":"\u9ED8\u8BA4","variant.selectVariant":"\u9009\u62E9\u89C6\u56FE","variant.saveView":"\u4FDD\u5B58\u89C6\u56FE","variant.newVariant":"\u65B0\u89C6\u56FE","variant.viewName":"\u89C6\u56FE\u540D\u79F0","variant.setDefault":"\u8BBE\u4E3A\u9ED8\u8BA4","variant.publicAllUsers":"\u516C\u5F00\uFF08\u6240\u6709\u7528\u6237\uFF09","variant.toast.fetchFailed":"\u52A0\u8F7D\u89C6\u56FE\u5931\u8D25","variant.toast.saveFailed":"\u4FDD\u5B58\u89C6\u56FE\u5931\u8D25","variant.toast.saveSuccess":"\u89C6\u56FE\u4FDD\u5B58\u6210\u529F","variant.toast.deleteFailed":"\u5220\u9664\u89C6\u56FE\u5931\u8D25","variant.toast.deleteSuccess":"\u89C6\u56FE\u5220\u9664\u6210\u529F","variant.toast.defaultFailed":"\u66F4\u65B0\u9ED8\u8BA4\u89C6\u56FE\u5931\u8D25","variant.toast.defaultSuccess":"\u9ED8\u8BA4\u89C6\u56FE\u5DF2\u66F4\u65B0","layout.saveLayout":"\u4FDD\u5B58\u5E03\u5C40","layout.layoutOptions":"\u5E03\u5C40\u9009\u9879","layout.selectLayout":"\u9009\u62E9\u5E03\u5C40","layout.saveCurrentLayout":"\u4FDD\u5B58\u5F53\u524D\u5E03\u5C40...","layout.noSavedLayouts":"\u6682\u65E0\u5DF2\u4FDD\u5B58\u5E03\u5C40","layout.removeDefault":"\u53D6\u6D88\u9ED8\u8BA4","layout.setAsDefault":"\u8BBE\u4E3A\u9ED8\u8BA4","layout.layoutName":"\u5E03\u5C40\u540D\u79F0","layout.layoutDescription":"\u63CF\u8FF0","layout.layoutNameHelper":"\u4F8B\u5982\uFF1A\u7D27\u51D1\u89C6\u56FE","layout.warningOverwrite":"\u8B66\u544A\uFF1A\u5C06\u8986\u76D6\u540C\u540D\u5E03\u5C40","layout.useAsDefault":"\u7528\u4F5C\u9ED8\u8BA4\u5E03\u5C40","layout.publicAllUsers":"\u516C\u5F00\uFF08\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09","layout.toast.loadFallback":"\u540E\u7AEF\u52A0\u8F7D\u5E03\u5C40\u5931\u8D25\uFF0C\u5DF2\u56DE\u9000\u5230\u672C\u5730\u5B58\u50A8","layout.toast.saveSuccess":"\u5E03\u5C40\u4FDD\u5B58\u6210\u529F","layout.toast.saveLocalSuccess":"\u5E03\u5C40\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","layout.toast.backendUnavailableSavedLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","layout.toast.deleteSuccess":"\u5E03\u5C40\u5220\u9664\u6210\u529F","layout.toast.deleteLocalSuccess":"\u5E03\u5C40\u5DF2\u4ECE\u672C\u5730\u5B58\u50A8\u5220\u9664","layout.toast.backendUnavailableDeletedLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u5DF2\u4ECE\u672C\u5730\u5B58\u50A8\u5220\u9664","layout.toast.defaultSuccess":"\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u8BBE\u7F6E","layout.toast.defaultLocalSuccess":"\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u5728\u672C\u5730\u5B58\u50A8\u8BBE\u7F6E","layout.toast.backendUnavailableDefaultLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","dateRange.label":"\u65E5\u671F\u8303\u56F4","dateRange.startDate":"\u5F00\u59CB\u65E5\u671F","dateRange.endDate":"\u7ED3\u675F\u65E5\u671F","dateRange.select":"\u8BF7\u9009\u62E9...","dateRange.today":"\u4ECA\u5929","dateRange.thisWeek":"\u672C\u5468","dateRange.thisMonth":"\u672C\u6708","graph.records":"{count} \u6761\u8BB0\u5F55","graph.kpi.totalRecords":"\u603B\u8BB0\u5F55\u6570","graph.kpi.totalReport":"\u603B\u7533\u62A5\u5DE5\u65F6","graph.kpi.totalBillable":"\u603B\u53EF\u8BA1\u8D39\u5DE5\u65F6","graph.kpi.efficiency":"\u6548\u7387","graph.kpi.amount":"\u91D1\u989D","graph.kpi.flagged":"\u6807\u8BB0","graph.chart.billable.title":"\u7EF4\u5EA6\u8BA1\u8D39\u5DE5\u65F6","graph.chart.billable.subtitle":"\u6309\u53EF\u8BA1\u8D39\u5DE5\u65F6\u6392\u5E8F\u524D\u5217","graph.chart.efficiency.title":"\u4EBA\u5458\u6548\u7387","graph.chart.efficiency.subtitle":"\u6309\u6700\u4F4E\u6548\u7387\u4F18\u5148","graph.chart.status.title":"\u72B6\u6001\u5206\u5E03","graph.chart.status.subtitle":"\u6309\u72B6\u6001\u8BB0\u5F55\u5360\u6BD4","graph.dataBody":"\u6570\u636E\u660E\u7EC6","graph.reportTitle":"\u56FE\u8868\u62A5\u8868","graph.unassigned":"\u672A\u5206\u914D","graph.column.reportHours":"\u7533\u62A5\u5DE5\u65F6","graph.column.billableHours":"\u53EF\u8BA1\u8D39\u5DE5\u65F6","detail.searchAi.placeholder":"\u641C\u7D22\u5B57\u6BB5\uFF1B\u5982\u65E0\u7ED3\u679C\u5219\u81EA\u52A8\u89E6\u53D1 AI...","detail.searchAi.matches":"{count} \u6761\u5339\u914D\u7ED3\u679C","detail.searchAi.noMatch":"\u672A\u627E\u5230\u5339\u914D\u5B57\u6BB5\u3002","detail.searchAi.autoAiFallback":"\u672A\u547D\u4E2D\u5B57\u6BB5\uFF0C\u6B63\u5728\u89E6\u53D1 AI \u5206\u6790...","detail.searchAi.aiResultTitle":"AI \u5206\u6790\u7ED3\u679C","detail.table.title":"\u5173\u8054\u8BB0\u5F55","kanban.empty":"\u5C06\u5361\u7247\u62D6\u5230\u8FD9\u91CC","kanban.bucket.limit":"\u4E0A\u9650","kanban.bucket.dropHere":"\u91CA\u653E\u540E\u79FB\u52A8\u5230\u8BE5 bucket","kanban.bucket.add":"\u65B0\u589E bucket","kanban.bucket.rename":"\u91CD\u547D\u540D bucket","kanban.bucket.saveRename":"\u4FDD\u5B58 bucket \u540D\u79F0","kanban.bucket.cancelRename":"\u53D6\u6D88\u91CD\u547D\u540D","kanban.search.placeholder":"\u641C\u7D22\u5361\u7247\u548C bucket","kanban.search.clear":"\u6E05\u9664\u641C\u7D22","kanban.search.results":"{count} \u5F20\u5339\u914D\u5361\u7247","kanban.search.noMatch":"\u6CA1\u6709\u5339\u914D\u7684\u5361\u7247","kanban.card.progress":"\u8FDB\u5EA6","kanban.card.openDetail":"\u6253\u5F00\u8BE6\u60C5","kanban.priority.critical":"\u7D27\u6025","kanban.priority.high":"\u9AD8","kanban.priority.medium":"\u4E2D","kanban.priority.low":"\u4F4E","quickCreate.newItem":"\u65B0\u5EFA\u6761\u76EE","quickCreate.createWithTitle":"\u521B\u5EFA{title}","quickEdit.editWithTitle":"\u7F16\u8F91{title}","quickDelete.confirmTitle":"\u786E\u8BA4\u5220\u9664","quickDelete.confirmMessageSingle":"\u786E\u8BA4\u5220\u9664\u5F53\u524D\u9009\u4E2D\u8BB0\u5F55\u5417\uFF1F","quickDelete.confirmMessageMultiple":"\u786E\u8BA4\u5220\u9664\u5DF2\u9009\u4E2D\u7684 {count} \u6761\u8BB0\u5F55\u5417\uFF1F","cardPage.viewDetails":"\u67E5\u770B\u8BE6\u60C5","cardPage.download":"\u4E0B\u8F7D","cardPage.close":"\u5173\u95ED","cardPage.empty":"\u672A\u627E\u5230\u6761\u76EE","messageBox.confirm":"\u786E\u5B9A","messageBox.cancel":"\u53D6\u6D88","omph.status.idle":"\u7A7A\u95F2","omph.status.pending":"\u7B49\u5F85\u4E2D","omph.status.running":"\u5904\u7406\u4E2D","omph.status.success":"\u5DF2\u5B8C\u6210","omph.status.error":"\u51FA\u9519","omph.working":"\u5904\u7406\u4E2D","omph.workingFor":"\u5DF2\u5904\u7406 {duration}","omph.loadOlder":"\u52A0\u8F7D\u66F4\u65E9\u6D88\u606F","omph.loadingOlder":"\u6B63\u5728\u52A0\u8F7D\u66F4\u65E9\u6D88\u606F\u2026","omph.toBottom":"\u56DE\u5230\u5E95\u90E8","omph.copy":"\u590D\u5236","omph.copied":"\u5DF2\u590D\u5236","omph.turnActions":"\u56DE\u590D\u64CD\u4F5C","omph.usage":"\u7528\u91CF","omph.inputTokens":"\u8F93\u5165","omph.outputTokens":"\u8F93\u51FA","omph.duration":"\u7528\u65F6","omph.send":"\u53D1\u9001","omph.stop":"\u505C\u6B62","omph.supplement.queued":"\u5DF2\u52A0\u5165\u5F53\u524D\u4EFB\u52A1","omph.turnRail":"\u8F6E\u6B21","omph.secondUnit":"\u79D2","omph.minuteUnit":"\u5206","omph.preview.title":"\u6587\u4EF6\u9884\u89C8","omph.preview.close":"\u5173\u95ED\u9884\u89C8","omph.preview.back":"\u8FD4\u56DE\u5BF9\u8BDD","omph.preview.expand":"\u5C55\u5F00\u9884\u89C8","omph.preview.collapse":"\u8FD8\u539F\u9884\u89C8\u5927\u5C0F","omph.preview.copyContent":"\u590D\u5236\u5185\u5BB9","omph.preview.copyPath":"\u590D\u5236\u8DEF\u5F84","omph.preview.download":"\u4E0B\u8F7D","omph.preview.openExternal":"\u5728\u5916\u90E8\u6253\u5F00","omph.preview.wrap":"\u81EA\u52A8\u6362\u884C","omph.preview.loading":"\u6B63\u5728\u52A0\u8F7D\u6587\u4EF6","omph.preview.missing":"\u6587\u4EF6\u4E0D\u5B58\u5728","omph.preview.failed":"\u65E0\u6CD5\u52A0\u8F7D\u6B64\u6587\u4EF6","omph.preview.unsupported":"\u6B64\u6587\u4EF6\u7C7B\u578B\u4E0D\u652F\u6301\u9884\u89C8","omph.preview.retry":"\u91CD\u8BD5","omph.preview.resize":"\u8C03\u6574\u9884\u89C8\u5927\u5C0F","omph.preview.line":"\u7B2C {start} \u884C","omph.preview.lines":"\u7B2C {start}\u2013{end} \u884C","omph.preview.truncated":"\u5171 {total} \u884C\uFF0C\u4EC5\u663E\u793A\u524D {shown} \u884C","omph.preview.sheetTruncated":"\u5171 {total} \u884C\uFF0C\u4EC5\u663E\u793A\u524D {shown} \u884C","omph.preview.imageFailed":"\u56FE\u7247\u65E0\u6CD5\u663E\u793A","omph.preview.zoomIn":"\u653E\u5927","omph.preview.zoomOut":"\u7F29\u5C0F","omph.preview.zoomFit":"\u9002\u5E94\u5BBD\u5EA6","omph.newConversation":"\u65B0\u5EFA\u4F1A\u8BDD","omph.conversationList":"\u4F1A\u8BDD\u5217\u8868","omph.conversations":"\u4F1A\u8BDD","omph.noConversations":"\u8FD8\u6CA1\u6709\u4F1A\u8BDD","omph.approval.waiting":"\u7B49\u5F85\u5BA1\u6279","omph.approval.choose":"\u8BF7\u9009\u62E9\u64CD\u4F5C","omph.approval.details":"\u5BA1\u6279\u8BE6\u60C5","omph.approval.choices":"\u53EF\u9009\u64CD\u4F5C","omph.approval.reject":"\u62D2\u7EDD","omph.approval.allowOnce":"\u4EC5\u6B64\u4E00\u6B21","omph.approval.confirm":"\u7EE7\u7EED","omph.approval.other":"\u5176\u4ED6","omph.approval.otherPlaceholder":"\u63CF\u8FF0\u8981\u6267\u884C\u7684\u64CD\u4F5C","omph.approval.escalation":"\u5DE5\u5177 {toolName} \u8BF7\u6C42\u7279\u6743\u6267\u884C","omph.input.placeholder":"\u8F93\u5165\u6D88\u606F\u2026","omph.input.upload":"\u4E0A\u4F20\u6587\u4EF6","omph.input.send":"\u53D1\u9001\u6D88\u606F","omph.input.stop":"\u505C\u6B62\u751F\u6210","omph.input.queue.ask":"Agent \u6B63\u5728\u8FD0\u884C\uFF0C\u8FD9\u6761\u6D88\u606F\u600E\u4E48\u53D1\uFF1F","omph.input.queue.sendNow":"\u7ACB\u5373\u53D1\u9001","omph.input.queue.afterTurn":"\u672C\u8F6E\u7ED3\u675F\u540E\u53D1\u9001","omph.input.queue.queued":"\u5DF2\u6392\u961F\uFF0C\u672C\u8F6E\u7ED3\u675F\u540E\u81EA\u52A8\u53D1\u9001","omph.input.queue.cancel":"\u53D6\u6D88","omph.input.message":"\u6D88\u606F\u8F93\u5165","omph.input.tools":"\u8F93\u5165\u5DE5\u5177","agentui.html.defaultTitle":"\u4EA4\u4E92\u5F0F HTML","agentui.html.open":"\u6253\u5F00","agentui.html.preview":"\u9884\u89C8","agentui.html.code":"\u4EE3\u7801","agentui.html.toggle":"\u5207\u6362\u4EE3\u7801\u4E0E\u9884\u89C8","agentui.html.copy":"\u590D\u5236\u4EE3\u7801","agentui.html.copied":"\u5DF2\u590D\u5236","agentui.html.download":"\u4E0B\u8F7D","agentui.html.close":"\u5173\u95ED"},nf={"common.cancel":"Annuler","common.save":"Enregistrer","common.ok":"OK","common.done":"Terminer","common.search":"Rechercher","common.none":"Aucun","common.all":"Tout","common.noData":"Aucune donn\xE9e","common.copy":"Copier","common.delete":"Supprimer","common.loading":"Chargement...","header.searchPlaceholder":"Demandez-moi...","header.searchAddFeature":"Ajouter une fonction","header.searchStartVoice":"D\xE9marrer la saisie vocale","header.searchStopVoice":"Arr\xEAter la saisie vocale","header.searchOpenPanel":"Ouvrir la conversation","header.theme.system":"Th\xE8me : Syst\xE8me","header.theme.dark":"Th\xE8me : Sombre","header.theme.light":"Th\xE8me : Clair","header.menu.setting":"Param\xE8tres","header.menu.refresh":"Actualiser","header.menu.logout":"Se d\xE9connecter","navigation.expand":"D\xE9velopper la navigation","navigation.collapse":"R\xE9duire la navigation","navigation.searchPlaceholder":"Rechercher dans le menu...","navigation.noMatch":"Aucun \xE9l\xE9ment correspondant","navigation.noAccessibleApp":"Aucune application accessible","navigation.noItems":"Aucun \xE9l\xE9ment \xE0 afficher","navigation.expandView":"D\xE9velopper {title}","navigation.mode.switchToFixed":"Basculer vers la navigation fixe","navigation.mode.switchToFloating":"Basculer vers la navigation flottante","navigation.pinned":"\xC9pingl\xE9s","navigation.pin.add":"\xC9pingler en haut","navigation.pin.remove":"D\xE9s\xE9pingler","table.toolbar.searchPlaceholder":"Rechercher...","table.title.default":"Tableau de donn\xE9es","table.toolbar.groupBy":"Grouper","table.toolbar.summary":"R\xE9sum\xE9","table.toolbar.columns":"Colonnes","table.toolbar.export":"Exporter","table.toolbar.itemsPerPage":"Lignes par page :","table.toolbar.pageOf":"Page {current} sur {total}","table.toolbar.newItem":"Nouvel \xE9l\xE9ment","table.toolbar.editItem":"Modifier l'\xE9l\xE9ment","table.toolbar.deleteItem":"Supprimer l'\xE9l\xE9ment","table.toolbar.graphicReport":"Rapport graphique","table.toolbar.saveLayout":"Enregistrer la vue","table.menu.groupBy":"Grouper","table.menu.clearAll":"Tout effacer","table.menu.visibleColumns":"Colonnes visibles","table.menu.showSummaryRow":"Afficher la ligne de r\xE9sum\xE9","table.menu.noNumericColumns":"Aucune colonne num\xE9rique","table.group.expandAll":"D\xE9velopper tous les groupes","table.group.collapseAll":"R\xE9duire tous les groupes","table.mobile.notImplemented":"Vue mobile non impl\xE9ment\xE9e","table.headerMenu.sortAsc":"Trier ascendant","table.headerMenu.sortDesc":"Trier descendant","table.headerMenu.clearSort":"Effacer le tri","table.headerMenu.configureSort":"Configurer le tri...","table.headerMenu.group":"Grouper par cette colonne","table.headerMenu.ungroup":"Retirer du groupement","table.headerMenu.addSummary":"Inclure dans le r\xE9sum\xE9","table.headerMenu.removeSummary":"Retirer du r\xE9sum\xE9","table.headerMenu.hideColumn":"Masquer la colonne","table.sortDialog.title":"Param\xE8tres de tri","table.sortDialog.empty":"Aucune r\xE8gle de tri. Ajoutez-en une pour commencer.","table.sortDialog.addRule":"Ajouter une r\xE8gle","table.sortDialog.clearAll":"Tout effacer","table.sortDialog.asc":"Ascendant","table.sortDialog.desc":"Descendant","pivot.title.default":"Tableau crois\xE9 dynamique","pivot.subtitle.default":"Faites glisser les champs pour configurer le tableau crois\xE9.","pivot.empty":"Ajoutez au moins un champ de valeur pour afficher le r\xE9sultat.","pivot.records":"Enregistrements","pivot.afterFilter":"Apr\xE8s filtre","pivot.grandTotal":"Total g\xE9n\xE9ral","pivot.resultLabel":"R\xE9sultat","pivot.valueLabel":"Valeur","pivot.table.dimensions":"Dimensions","pivot.config.title":"Configuration","pivot.fieldList":"Liste des champs","pivot.availableDimensions":"Dimensions disponibles","pivot.allFieldsInUse":"Tous les champs sont d\xE9j\xE0 utilis\xE9s.","pivot.zone.rows":"Lignes","pivot.zone.columns":"Colonnes","pivot.zone.filters":"Filtres","pivot.zone.values":"Valeurs","pivot.hint.rows":"D\xE9posez les champs ici pour construire la hi\xE9rarchie des lignes","pivot.hint.columns":"D\xE9posez les champs ici pour construire la hi\xE9rarchie des colonnes","pivot.hint.filters":"D\xE9posez les champs ici pour les filtres du rapport","pivot.hint.values":"D\xE9posez les champs num\xE9riques ici pour les agr\xE9gations","pivot.clearArea":"Vider la zone","pivot.filter.na":"N/A","pivot.filter.noValues":"Aucune valeur","pivot.filter.noneSelected":"Aucune s\xE9lection","pivot.filter.allValues":"Toutes les valeurs","pivot.filter.selectedCount":"{selected} / {total} s\xE9lectionn\xE9es","pivot.filter.selectAll":"Tout s\xE9lectionner","pivot.filter.deselectAll":"Tout d\xE9s\xE9lectionner","pivot.filter.noResults":"Aucun r\xE9sultat","pivot.collapse.ariaExpand":"D\xE9velopper la zone de configuration","pivot.collapse.ariaCollapse":"R\xE9duire la zone de configuration","pivot.agg.sum":"Somme","pivot.agg.count":"Compte","pivot.agg.avg":"Moyenne","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"S\xE9lectionner un preset","pivot.preset.save":"Enregistrer le preset","pivot.preset.delete":"Supprimer le preset","pivot.preset.saveDialogTitle":"Enregistrer le preset actuel","pivot.preset.nameLabel":"Nom du preset","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"R\xE9sultat du pivot","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"D\xE9velopper le r\xE9sultat du pivot","pivot.table.collapse.ariaCollapse":"R\xE9duire le r\xE9sultat du pivot","pivot.chart.title":"Graphique pivot","pivot.chart.subtitle":"Associez une dimension et jusqu\u2019\xE0 deux mesures dans un graphique compact.","pivot.chart.subtitleReady":"{dimension} par {measure}","pivot.chart.emptyNoDimension":"Ajoutez au moins un champ de ligne ou de colonne pour afficher le graphique.","pivot.chart.emptyNoValue":"Ajoutez au moins un champ de valeur pour afficher le graphique.","pivot.chart.emptyNoData":"Aucune donn\xE9e disponible pour la s\xE9lection actuelle du graphique.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Mesure","pivot.chart.secondaryMeasure":"Mesure de comparaison","pivot.chart.chartType":"Type de graphique","pivot.chart.style.barVertical":"Barres verticales","pivot.chart.style.barHorizontal":"Barres horizontales","pivot.chart.style.line":"Ligne","pivot.chart.style.scatter":"Nuage de points","pivot.chart.collapse.ariaExpand":"D\xE9velopper la zone du graphique","pivot.chart.collapse.ariaCollapse":"R\xE9duire la zone du graphique","smartFilter.adaptFilters":"Adapter les filtres","smartFilter.addFilters":"Ajouter des filtres","smartFilter.go":"Ex\xE9cuter","smartFilter.visibleFilters":"Filtres visibles","smartFilter.searchPlaceholder":"Rechercher...","smartFilter.noOptionsFound":"Aucune option trouv\xE9e","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"\xC9gal \xE0","smartFilter.operator.contains":"Contient","smartFilter.operator.notContains":"Ne contient pas","smartFilter.operator.wildcard":"Recherche g\xE9n\xE9rique","smartFilter.operator.notEquals":"Diff\xE9rent de","smartFilter.operator.greaterThan":"Sup\xE9rieur \xE0","smartFilter.operator.lessThan":"Inf\xE9rieur \xE0","smartFilter.operator.greaterOrEqual":"Sup\xE9rieur ou \xE9gal","smartFilter.operator.lessOrEqual":"Inf\xE9rieur ou \xE9gal","smartFilter.operator.between":"Entre","variant.noOptions":"Aucune option","variant.defaultSuffix":"Par d\xE9faut","variant.selectVariant":"S\xE9lectionner une vue","variant.saveView":"Enregistrer la vue","variant.newVariant":"Nouvelle vue","variant.viewName":"Nom de la vue","variant.setDefault":"D\xE9finir par d\xE9faut","variant.publicAllUsers":"Public (tous les utilisateurs)","variant.toast.fetchFailed":"\xC9chec du chargement des vues","variant.toast.saveFailed":"\xC9chec de l'enregistrement de la vue","variant.toast.saveSuccess":"Vue enregistr\xE9e avec succ\xE8s","variant.toast.deleteFailed":"\xC9chec de la suppression de la vue","variant.toast.deleteSuccess":"Vue supprim\xE9e avec succ\xE8s","variant.toast.defaultFailed":"\xC9chec de la mise \xE0 jour de la vue par d\xE9faut","variant.toast.defaultSuccess":"Vue par d\xE9faut mise \xE0 jour","layout.saveLayout":"Enregistrer la vue","layout.layoutOptions":"Options de vue","layout.selectLayout":"S\xE9lectionner une vue","layout.saveCurrentLayout":"Enregistrer la vue actuelle...","layout.noSavedLayouts":"Aucune vue enregistr\xE9e","layout.removeDefault":"Retirer le d\xE9faut","layout.setAsDefault":"D\xE9finir par d\xE9faut","layout.layoutName":"Nom de la vue","layout.layoutDescription":"Description","layout.layoutNameHelper":"ex. : Vue compacte","layout.warningOverwrite":"Attention : la vue existante sera \xE9cras\xE9e","layout.useAsDefault":"Utiliser comme vue par d\xE9faut","layout.publicAllUsers":"Public (visible par tous les utilisateurs)","layout.toast.loadFallback":"\xC9chec du chargement depuis le backend, bascule vers le stockage local","layout.toast.saveSuccess":"Vue enregistr\xE9e avec succ\xE8s","layout.toast.saveLocalSuccess":"Vue enregistr\xE9e dans le stockage local","layout.toast.backendUnavailableSavedLocal":"Backend indisponible, enregistr\xE9 en local","layout.toast.deleteSuccess":"Vue supprim\xE9e avec succ\xE8s","layout.toast.deleteLocalSuccess":"Vue supprim\xE9e du stockage local","layout.toast.backendUnavailableDeletedLocal":"Backend indisponible, supprim\xE9 en local","layout.toast.defaultSuccess":"Vue par d\xE9faut d\xE9finie","layout.toast.defaultLocalSuccess":"Vue par d\xE9faut d\xE9finie en local","layout.toast.backendUnavailableDefaultLocal":"Backend indisponible, d\xE9faut enregistr\xE9 en local","dateRange.label":"Plage de dates","dateRange.startDate":"Date de d\xE9but","dateRange.endDate":"Date de fin","dateRange.select":"S\xE9lectionner...","dateRange.today":"Aujourd'hui","dateRange.thisWeek":"Cette semaine","dateRange.thisMonth":"Ce mois-ci","graph.records":"{count} enregistrements","graph.kpi.totalRecords":"Total des enregistrements","graph.kpi.totalReport":"Total d\xE9clar\xE9","graph.kpi.totalBillable":"Total facturable","graph.kpi.efficiency":"Efficacit\xE9","graph.kpi.amount":"Montant","graph.kpi.flagged":"Signal\xE9","graph.chart.billable.title":"Facturable par dimension","graph.chart.billable.subtitle":"Top valeurs par heures facturables","graph.chart.efficiency.title":"Efficacit\xE9 par personne","graph.chart.efficiency.subtitle":"Efficacit\xE9 la plus faible en premier","graph.chart.status.title":"R\xE9partition des statuts","graph.chart.status.subtitle":"Ratio des enregistrements par statut","graph.dataBody":"Donn\xE9es","graph.reportTitle":"Rapport graphique","graph.unassigned":"Non attribu\xE9","graph.column.reportHours":"Heures d\xE9clar\xE9es","graph.column.billableHours":"Heures facturables","detail.searchAi.placeholder":"Rechercher des champs, ou interroger l\u2019IA en cas d\u2019absence de r\xE9sultat...","detail.searchAi.matches":"{count} correspondances trouv\xE9es","detail.searchAi.noMatch":"Aucun champ correspondant trouv\xE9.","detail.searchAi.autoAiFallback":"Aucune correspondance directe. Analyse IA en cours...","detail.searchAi.aiResultTitle":"Analyse IA","detail.table.title":"Enregistrements li\xE9s","kanban.empty":"D\xE9posez les cartes ici","kanban.bucket.limit":"Limite","kanban.bucket.dropHere":"Rel\xE2chez pour d\xE9placer dans cette colonne","kanban.bucket.add":"Ajouter une colonne","kanban.bucket.rename":"Renommer la colonne","kanban.bucket.saveRename":"Enregistrer le nom","kanban.bucket.cancelRename":"Annuler le renommage","kanban.search.placeholder":"Rechercher des cartes et colonnes","kanban.search.clear":"Effacer la recherche","kanban.search.results":"{count} cartes correspondantes","kanban.search.noMatch":"Aucune carte correspondante","kanban.card.progress":"Progression","kanban.card.openDetail":"Ouvrir le d\xE9tail","kanban.priority.critical":"Critique","kanban.priority.high":"\xC9lev\xE9e","kanban.priority.medium":"Moyenne","kanban.priority.low":"Faible","quickCreate.newItem":"Nouvel \xE9l\xE9ment","quickCreate.createWithTitle":"Cr\xE9er {title}","quickEdit.editWithTitle":"Modifier {title}","quickDelete.confirmTitle":"Confirmer la suppression","quickDelete.confirmMessageSingle":"Voulez-vous vraiment supprimer l\u2019enregistrement s\xE9lectionn\xE9 ?","quickDelete.confirmMessageMultiple":"Voulez-vous vraiment supprimer les {count} enregistrements s\xE9lectionn\xE9s ?","cardPage.viewDetails":"Voir les d\xE9tails","cardPage.download":"T\xE9l\xE9charger","cardPage.close":"Fermer","cardPage.empty":"Aucun \xE9l\xE9ment trouv\xE9","messageBox.confirm":"OK","messageBox.cancel":"Annuler","omph.status.idle":"Inactif","omph.status.pending":"En attente","omph.status.running":"En cours","omph.status.success":"Termin\xE9","omph.status.error":"Erreur","omph.working":"En cours","omph.workingFor":"En cours depuis {duration}","omph.loadOlder":"Charger les messages pr\xE9c\xE9dents","omph.loadingOlder":"Chargement des messages pr\xE9c\xE9dents\u2026","omph.toBottom":"Revenir en bas","omph.copy":"Copier","omph.copied":"Copi\xE9","omph.turnActions":"Actions de r\xE9ponse","omph.usage":"Utilisation","omph.inputTokens":"Entr\xE9e","omph.outputTokens":"Sortie","omph.duration":"Dur\xE9e","omph.send":"Envoyer","omph.stop":"Arr\xEAter","omph.supplement.queued":"Ajout\xE9 \xE0 la t\xE2che en cours","omph.turnRail":"Tours","omph.secondUnit":"s","omph.minuteUnit":"min","omph.preview.title":"Aper\xE7u du fichier","omph.preview.close":"Fermer l'aper\xE7u","omph.preview.back":"Retour \xE0 la conversation","omph.preview.expand":"Agrandir l\u2019aper\xE7u","omph.preview.collapse":"R\xE9duire l\u2019aper\xE7u","omph.preview.copyContent":"Copier le contenu","omph.preview.copyPath":"Copier le chemin","omph.preview.download":"T\xE9l\xE9charger","omph.preview.openExternal":"Ouvrir \xE0 l\u2019ext\xE9rieur","omph.preview.wrap":"Retour \xE0 la ligne","omph.preview.loading":"Chargement du fichier","omph.preview.missing":"Fichier introuvable","omph.preview.failed":"Impossible de charger ce fichier","omph.preview.unsupported":"Aucun aper\xE7u pour ce type de fichier","omph.preview.retry":"R\xE9essayer","omph.preview.resize":"Redimensionner l\u2019aper\xE7u","omph.preview.line":"Ligne {start}","omph.preview.lines":"Lignes {start}\u2013{end}","omph.preview.truncated":"Affichage des {shown} premi\xE8res lignes sur {total}","omph.preview.sheetTruncated":"Affichage des {shown} premi\xE8res lignes sur {total}","omph.preview.imageFailed":"Impossible d'afficher l'image","omph.preview.zoomIn":"Zoom avant","omph.preview.zoomOut":"Zoom arri\xE8re","omph.preview.zoomFit":"Ajuster \xE0 la largeur","omph.newConversation":"Nouvelle conversation","omph.conversationList":"Liste des conversations","omph.conversations":"Conversations","omph.noConversations":"Aucune conversation","omph.approval.waiting":"En attente d'approbation","omph.approval.choose":"Choisir une action","omph.approval.details":"D\xE9tails de l'approbation","omph.approval.choices":"Actions","omph.approval.reject":"Refuser","omph.approval.allowOnce":"Autoriser une fois","omph.approval.confirm":"Continuer","omph.approval.other":"Autre","omph.approval.otherPlaceholder":"D\xE9crire l'action \xE0 effectuer","omph.approval.escalation":"L'outil {toolName} demande une ex\xE9cution privil\xE9gi\xE9e","omph.input.placeholder":"Saisir un message\u2026","omph.input.upload":"T\xE9l\xE9verser un fichier","omph.input.send":"Envoyer le message","omph.input.stop":"Arr\xEAter la g\xE9n\xE9ration","omph.input.queue.ask":"L'agent travaille. Envoyer maintenant ou apr\xE8s ce tour ?","omph.input.queue.sendNow":"Envoyer maintenant","omph.input.queue.afterTurn":"Envoyer apr\xE8s ce tour","omph.input.queue.queued":"En file d'attente \u2014 envoi apr\xE8s ce tour","omph.input.queue.cancel":"Annuler","omph.input.message":"Saisie de message","omph.input.tools":"Outils de saisie","agentui.html.defaultTitle":"HTML interactif","agentui.html.open":"Ouvrir","agentui.html.preview":"Aper\xE7u","agentui.html.code":"Code","agentui.html.toggle":"Basculer entre code et aper\xE7u","agentui.html.copy":"Copier le code","agentui.html.copied":"Copi\xE9","agentui.html.download":"T\xE9l\xE9charger","agentui.html.close":"Fermer"},af={"common.cancel":"Abbrechen","common.save":"Speichern","common.ok":"OK","common.done":"Fertig","common.search":"Suchen","common.none":"Keine","common.all":"Alle","common.noData":"Keine Daten","common.copy":"Kopieren","common.delete":"L\xF6schen","common.loading":"Wird geladen...","header.searchPlaceholder":"Frag mich...","header.searchAddFeature":"Funktion hinzuf\xFCgen","header.searchStartVoice":"Spracheingabe starten","header.searchStopVoice":"Spracheingabe stoppen","header.searchOpenPanel":"Unterhaltung \xF6ffnen","header.theme.system":"Theme: System","header.theme.dark":"Theme: Dunkel","header.theme.light":"Theme: Hell","header.menu.setting":"Einstellungen","header.menu.refresh":"Aktualisieren","header.menu.logout":"Abmelden","navigation.expand":"Navigation erweitern","navigation.collapse":"Navigation einklappen","navigation.searchPlaceholder":"Men\xFC suchen...","navigation.noMatch":"Keine passenden Men\xFCeintr\xE4ge","navigation.noAccessibleApp":"Keine verf\xFCgbaren Anwendungen","navigation.noItems":"Keine Eintr\xE4ge vorhanden","navigation.expandView":"{title} aufklappen","navigation.mode.switchToFixed":"Zu fester Navigation wechseln","navigation.mode.switchToFloating":"Zu schwebender Navigation wechseln","navigation.pinned":"Angeheftet","navigation.pin.add":"Oben anheften","navigation.pin.remove":"L\xF6sen","table.toolbar.searchPlaceholder":"Suchen...","table.title.default":"Datentabelle","table.toolbar.groupBy":"Gruppieren","table.toolbar.summary":"Zusammenfassung","table.toolbar.columns":"Spalten","table.toolbar.export":"Export","table.toolbar.itemsPerPage":"Zeilen pro Seite:","table.toolbar.pageOf":"Seite {current} von {total}","table.toolbar.newItem":"Neuer Eintrag","table.toolbar.editItem":"Eintrag bearbeiten","table.toolbar.deleteItem":"Eintrag l\xF6schen","table.toolbar.graphicReport":"Grafikbericht","table.toolbar.saveLayout":"Layout speichern","table.menu.groupBy":"Gruppieren","table.menu.clearAll":"Alles l\xF6schen","table.menu.visibleColumns":"Sichtbare Spalten","table.menu.showSummaryRow":"Summenzeile anzeigen","table.menu.noNumericColumns":"Keine numerischen Spalten","table.group.expandAll":"Alle Gruppen aufklappen","table.group.collapseAll":"Alle Gruppen zuklappen","table.mobile.notImplemented":"Mobile Ansicht nicht implementiert","table.headerMenu.sortAsc":"Aufsteigend sortieren","table.headerMenu.sortDesc":"Absteigend sortieren","table.headerMenu.clearSort":"Sortierung entfernen","table.headerMenu.configureSort":"Sortierung konfigurieren...","table.headerMenu.group":"Nach dieser Spalte gruppieren","table.headerMenu.ungroup":"Aus Gruppierung entfernen","table.headerMenu.addSummary":"In Summe einbeziehen","table.headerMenu.removeSummary":"Aus Summe entfernen","table.headerMenu.hideColumn":"Spalte ausblenden","table.sortDialog.title":"Sortiereinstellungen","table.sortDialog.empty":"Keine Sortierregeln. F\xFCgen Sie eine hinzu, um zu sortieren.","table.sortDialog.addRule":"Regel hinzuf\xFCgen","table.sortDialog.clearAll":"Alle l\xF6schen","table.sortDialog.asc":"Aufsteigend","table.sortDialog.desc":"Absteigend","pivot.title.default":"Pivot-Tabelle","pivot.subtitle.default":"Ziehen Sie Felder, um die Pivot-Tabelle zu konfigurieren.","pivot.empty":"Ziehen Sie mindestens ein Wertefeld, um das Ergebnis anzuzeigen.","pivot.records":"Datens\xE4tze","pivot.afterFilter":"Nach Filter","pivot.grandTotal":"Gesamtsumme","pivot.resultLabel":"Ergebnis","pivot.valueLabel":"Wert","pivot.table.dimensions":"Dimensionen","pivot.config.title":"Konfiguration","pivot.fieldList":"Feldliste","pivot.availableDimensions":"Verf\xFCgbare Dimensionen","pivot.allFieldsInUse":"Alle Felder sind bereits verwendet.","pivot.zone.rows":"Zeilen","pivot.zone.columns":"Spalten","pivot.zone.filters":"Filter","pivot.zone.values":"Werte","pivot.hint.rows":"Felder hierhin ziehen, um die Zeilenhierarchie zu erstellen","pivot.hint.columns":"Felder hierhin ziehen, um die Spaltenhierarchie zu erstellen","pivot.hint.filters":"Felder hierhin ziehen f\xFCr Berichtsfilter","pivot.hint.values":"Numerische Felder hierhin ziehen f\xFCr Aggregation","pivot.clearArea":"Bereich leeren","pivot.filter.na":"N/V","pivot.filter.noValues":"Keine Werte","pivot.filter.noneSelected":"Nichts ausgew\xE4hlt","pivot.filter.allValues":"Alle Werte","pivot.filter.selectedCount":"{selected} / {total} ausgew\xE4hlt","pivot.filter.selectAll":"Alle ausw\xE4hlen","pivot.filter.deselectAll":"Alle abw\xE4hlen","pivot.filter.noResults":"Keine Ergebnisse","pivot.collapse.ariaExpand":"Konfigurationsbereich erweitern","pivot.collapse.ariaCollapse":"Konfigurationsbereich reduzieren","pivot.agg.sum":"Summe","pivot.agg.count":"Anzahl","pivot.agg.avg":"Durchschnitt","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"Preset w\xE4hlen","pivot.preset.save":"Preset speichern","pivot.preset.delete":"Preset l\xF6schen","pivot.preset.saveDialogTitle":"Aktuelles Preset speichern","pivot.preset.nameLabel":"Preset-Name","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"Pivot-Ergebnis","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"Pivot-Ergebnis erweitern","pivot.table.collapse.ariaCollapse":"Pivot-Ergebnis reduzieren","pivot.chart.title":"Pivot-Diagramm","pivot.chart.subtitle":"Eine Dimension und bis zu zwei Kennzahlen in einem kompakten Diagramm abbilden.","pivot.chart.subtitleReady":"{dimension} nach {measure}","pivot.chart.emptyNoDimension":"F\xFCgen Sie mindestens ein Zeilen- oder Spaltenfeld hinzu, um das Diagramm anzuzeigen.","pivot.chart.emptyNoValue":"F\xFCgen Sie mindestens ein Wertefeld hinzu, um das Diagramm anzuzeigen.","pivot.chart.emptyNoData":"F\xFCr die aktuelle Diagrammauswahl sind keine Daten verf\xFCgbar.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Kennzahl","pivot.chart.secondaryMeasure":"Vergleichskennzahl","pivot.chart.chartType":"Diagrammtyp","pivot.chart.style.barVertical":"Vertikale Balken","pivot.chart.style.barHorizontal":"Horizontale Balken","pivot.chart.style.line":"Linie","pivot.chart.style.scatter":"Streudiagramm","pivot.chart.collapse.ariaExpand":"Diagrammbereich erweitern","pivot.chart.collapse.ariaCollapse":"Diagrammbereich reduzieren","smartFilter.adaptFilters":"Filter anpassen","smartFilter.addFilters":"Filter hinzuf\xFCgen","smartFilter.go":"Los","smartFilter.visibleFilters":"Sichtbare Filter","smartFilter.searchPlaceholder":"Suchen...","smartFilter.noOptionsFound":"Keine Optionen gefunden","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"Gleich","smartFilter.operator.contains":"Enth\xE4lt","smartFilter.operator.notContains":"Enth\xE4lt nicht","smartFilter.operator.wildcard":"Wildcard-Suche","smartFilter.operator.notEquals":"Ungleich","smartFilter.operator.greaterThan":"Gr\xF6\xDFer als","smartFilter.operator.lessThan":"Kleiner als","smartFilter.operator.greaterOrEqual":"Gr\xF6\xDFer gleich","smartFilter.operator.lessOrEqual":"Kleiner gleich","smartFilter.operator.between":"Zwischen","variant.noOptions":"Keine Optionen","variant.defaultSuffix":"Standard","variant.selectVariant":"Variante w\xE4hlen","variant.saveView":"Ansicht speichern","variant.newVariant":"Neue Variante","variant.viewName":"Ansichtsname","variant.setDefault":"Als Standard setzen","variant.publicAllUsers":"\xD6ffentlich (alle Benutzer)","variant.toast.fetchFailed":"Varianten konnten nicht geladen werden","variant.toast.saveFailed":"Variante konnte nicht gespeichert werden","variant.toast.saveSuccess":"Variante erfolgreich gespeichert","variant.toast.deleteFailed":"Variante konnte nicht gel\xF6scht werden","variant.toast.deleteSuccess":"Variante erfolgreich gel\xF6scht","variant.toast.defaultFailed":"Standardvariante konnte nicht aktualisiert werden","variant.toast.defaultSuccess":"Standardvariante aktualisiert","layout.saveLayout":"Layout speichern","layout.layoutOptions":"Layout-Optionen","layout.selectLayout":"Layout w\xE4hlen","layout.saveCurrentLayout":"Aktuelles Layout speichern...","layout.noSavedLayouts":"Keine gespeicherten Layouts","layout.removeDefault":"Standard entfernen","layout.setAsDefault":"Als Standard setzen","layout.layoutName":"Layoutname","layout.layoutDescription":"Beschreibung","layout.layoutNameHelper":"z. B. Kompaktansicht","layout.warningOverwrite":"Warnung: Vorhandenes Layout wird \xFCberschrieben","layout.useAsDefault":"Als Standardlayout verwenden","layout.publicAllUsers":"\xD6ffentlich (f\xFCr alle sichtbar)","layout.toast.loadFallback":"Layouts konnten nicht vom Backend geladen werden, Wechsel zu lokalem Speicher","layout.toast.saveSuccess":"Layout erfolgreich gespeichert","layout.toast.saveLocalSuccess":"Layout im lokalen Speicher gespeichert","layout.toast.backendUnavailableSavedLocal":"Backend nicht verf\xFCgbar, lokal gespeichert","layout.toast.deleteSuccess":"Layout erfolgreich gel\xF6scht","layout.toast.deleteLocalSuccess":"Layout aus lokalem Speicher gel\xF6scht","layout.toast.backendUnavailableDeletedLocal":"Backend nicht verf\xFCgbar, lokal gel\xF6scht","layout.toast.defaultSuccess":"Standardlayout gesetzt","layout.toast.defaultLocalSuccess":"Standardlayout lokal gesetzt","layout.toast.backendUnavailableDefaultLocal":"Backend nicht verf\xFCgbar, Standard lokal gespeichert","dateRange.label":"Datumsbereich","dateRange.startDate":"Startdatum","dateRange.endDate":"Enddatum","dateRange.select":"Ausw\xE4hlen...","dateRange.today":"Heute","dateRange.thisWeek":"Diese Woche","dateRange.thisMonth":"Diesen Monat","graph.records":"{count} Datens\xE4tze","graph.kpi.totalRecords":"Gesamt Datens\xE4tze","graph.kpi.totalReport":"Gesamt Report","graph.kpi.totalBillable":"Gesamt abrechenbar","graph.kpi.efficiency":"Effizienz","graph.kpi.amount":"Betrag","graph.kpi.flagged":"Markiert","graph.chart.billable.title":"Abrechenbar nach Dimension","graph.chart.billable.subtitle":"Top-Werte nach abrechenbaren Stunden","graph.chart.efficiency.title":"Effizienz pro Person","graph.chart.efficiency.subtitle":"Niedrigste Effizienz zuerst","graph.chart.status.title":"Statusverteilung","graph.chart.status.subtitle":"Anteil je Status","graph.dataBody":"Datentabelle","graph.reportTitle":"Grafikbericht","graph.unassigned":"Nicht zugewiesen","graph.column.reportHours":"Melde-Stunden","graph.column.billableHours":"Abrechenbare Stunden","detail.searchAi.placeholder":"Felder suchen, oder bei keinem Treffer die KI fragen...","detail.searchAi.matches":"{count} Treffer gefunden","detail.searchAi.noMatch":"Kein passendes Feld gefunden.","detail.searchAi.autoAiFallback":"Keine direkte \xDCbereinstimmung. KI-Analyse wird gestartet...","detail.searchAi.aiResultTitle":"KI-Ergebnis","detail.table.title":"Verkn\xFCpfte Eintr\xE4ge","kanban.empty":"Karten hier ablegen","kanban.bucket.limit":"Limit","kanban.bucket.dropHere":"Loslassen, um in diese Spalte zu verschieben","kanban.bucket.add":"Spalte hinzuf\xFCgen","kanban.bucket.rename":"Spalte umbenennen","kanban.bucket.saveRename":"Spaltennamen speichern","kanban.bucket.cancelRename":"Umbenennen abbrechen","kanban.search.placeholder":"Karten und Spalten durchsuchen","kanban.search.clear":"Suche l\xF6schen","kanban.search.results":"{count} passende Karten","kanban.search.noMatch":"Keine passenden Karten","kanban.card.progress":"Fortschritt","kanban.card.openDetail":"Detail \xF6ffnen","kanban.priority.critical":"Kritisch","kanban.priority.high":"Hoch","kanban.priority.medium":"Mittel","kanban.priority.low":"Niedrig","quickCreate.newItem":"Neuer Eintrag","quickCreate.createWithTitle":"{title} erstellen","quickEdit.editWithTitle":"{title} bearbeiten","quickDelete.confirmTitle":"L\xF6schen best\xE4tigen","quickDelete.confirmMessageSingle":"M\xF6chten Sie den ausgew\xE4hlten Datensatz wirklich l\xF6schen?","quickDelete.confirmMessageMultiple":"M\xF6chten Sie die {count} ausgew\xE4hlten Datens\xE4tze wirklich l\xF6schen?","cardPage.viewDetails":"Details anzeigen","cardPage.download":"Herunterladen","cardPage.close":"Schlie\xDFen","cardPage.empty":"Keine Eintr\xE4ge gefunden","messageBox.confirm":"OK","messageBox.cancel":"Abbrechen","omph.status.idle":"Inaktiv","omph.status.pending":"Ausstehend","omph.status.running":"L\xE4uft","omph.status.success":"Erfolgt","omph.status.error":"Fehler","omph.working":"In Arbeit","omph.workingFor":"In Arbeit seit {duration}","omph.loadOlder":"Fr\xFChere Nachrichten laden","omph.loadingOlder":"Fr\xFChere Nachrichten werden geladen\u2026","omph.toBottom":"Nach unten","omph.copy":"Kopieren","omph.copied":"Kopiert","omph.turnActions":"Antwortaktionen","omph.usage":"Nutzung","omph.inputTokens":"Eingabe","omph.outputTokens":"Ausgabe","omph.duration":"Dauer","omph.send":"Senden","omph.stop":"Stoppen","omph.supplement.queued":"Zum laufenden Vorgang hinzugef\xFCgt","omph.turnRail":"Runden","omph.secondUnit":"s","omph.minuteUnit":"min","omph.preview.title":"Dateivorschau","omph.preview.close":"Vorschau schlie\xDFen","omph.preview.back":"Zur\xFCck zur Konversation","omph.preview.expand":"Vorschau vergr\xF6\xDFern","omph.preview.collapse":"Vorschau wiederherstellen","omph.preview.copyContent":"Inhalt kopieren","omph.preview.copyPath":"Pfad kopieren","omph.preview.download":"Herunterladen","omph.preview.openExternal":"Extern \xF6ffnen","omph.preview.wrap":"Zeilenumbruch","omph.preview.loading":"Datei wird geladen","omph.preview.missing":"Datei nicht gefunden","omph.preview.failed":"Datei konnte nicht geladen werden","omph.preview.unsupported":"Keine Vorschau f\xFCr diesen Dateityp","omph.preview.retry":"Erneut versuchen","omph.preview.resize":"Vorschaugr\xF6\xDFe \xE4ndern","omph.preview.line":"Zeile {start}","omph.preview.lines":"Zeilen {start}\u2013{end}","omph.preview.truncated":"Die ersten {shown} von {total} Zeilen werden angezeigt","omph.preview.sheetTruncated":"Die ersten {shown} von {total} Zeilen werden angezeigt","omph.preview.imageFailed":"Bild konnte nicht angezeigt werden","omph.preview.zoomIn":"Vergr\xF6\xDFern","omph.preview.zoomOut":"Verkleinern","omph.preview.zoomFit":"An Breite anpassen","omph.newConversation":"Neue Konversation","omph.conversationList":"Konversationsliste","omph.conversations":"Konversationen","omph.noConversations":"Noch keine Konversationen","omph.approval.waiting":"Auf Genehmigung wartend","omph.approval.choose":"Aktion w\xE4hlen","omph.approval.details":"Genehmigungsdetails","omph.approval.choices":"Aktionen","omph.approval.reject":"Ablehnen","omph.approval.allowOnce":"Einmal erlauben","omph.approval.confirm":"Fortfahren","omph.approval.other":"Sonstiges","omph.approval.otherPlaceholder":"Aktion beschreiben","omph.approval.escalation":"Tool {toolName} fordert privilegierte Ausf\xFChrung","omph.input.placeholder":"Nachricht eingeben\u2026","omph.input.upload":"Datei hochladen","omph.input.send":"Nachricht senden","omph.input.stop":"Generierung stoppen","omph.input.queue.ask":"Der Agent arbeitet. Jetzt oder nach diesem Zug senden?","omph.input.queue.sendNow":"Jetzt senden","omph.input.queue.afterTurn":"Nach diesem Zug senden","omph.input.queue.queued":"In Warteschlange \u2014 Senden nach diesem Zug","omph.input.queue.cancel":"Abbrechen","omph.input.message":"Nachrichteneingabe","omph.input.tools":"Eingabewerkzeuge","agentui.html.defaultTitle":"Interaktives HTML","agentui.html.open":"\xD6ffnen","agentui.html.preview":"Vorschau","agentui.html.code":"Code","agentui.html.toggle":"Zwischen Code und Vorschau wechseln","agentui.html.copy":"Code kopieren","agentui.html.copied":"Kopiert","agentui.html.download":"Herunterladen","agentui.html.close":"Schlie\xDFen"},sf={"common.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB","common.save":"\u4FDD\u5B58","common.ok":"OK","common.done":"\u5B8C\u4E86","common.search":"\u691C\u7D22","common.none":"\u306A\u3057","common.all":"\u3059\u3079\u3066","common.noData":"\u30C7\u30FC\u30BF\u306A\u3057","common.copy":"\u30B3\u30D4\u30FC","common.delete":"\u524A\u9664","common.loading":"\u8AAD\u307F\u8FBC\u307F\u4E2D...","header.searchPlaceholder":"\u4F55\u304B\u805E\u3044\u3066\u304F\u3060\u3055\u3044...","header.searchAddFeature":"\u6A5F\u80FD\u3092\u8FFD\u52A0","header.searchStartVoice":"\u97F3\u58F0\u5165\u529B\u3092\u958B\u59CB","header.searchStopVoice":"\u97F3\u58F0\u5165\u529B\u3092\u505C\u6B62","header.searchOpenPanel":"\u4F1A\u8A71\u3092\u958B\u304F","header.theme.system":"\u30C6\u30FC\u30DE\uFF1A\u30B7\u30B9\u30C6\u30E0","header.theme.dark":"\u30C6\u30FC\u30DE\uFF1A\u30C0\u30FC\u30AF","header.theme.light":"\u30C6\u30FC\u30DE\uFF1A\u30E9\u30A4\u30C8","header.menu.setting":"\u8A2D\u5B9A","header.menu.refresh":"\u518D\u8AAD\u307F\u8FBC\u307F","header.menu.logout":"\u30ED\u30B0\u30A2\u30A6\u30C8","navigation.expand":"\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u3092\u5C55\u958B","navigation.collapse":"\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u3092\u6298\u308A\u305F\u305F\u3080","navigation.searchPlaceholder":"\u30E1\u30CB\u30E5\u30FC\u3092\u691C\u7D22...","navigation.noMatch":"\u4E00\u81F4\u3059\u308B\u30E1\u30CB\u30E5\u30FC\u304C\u3042\u308A\u307E\u305B\u3093","navigation.noAccessibleApp":"\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u30A2\u30D7\u30EA\u304C\u3042\u308A\u307E\u305B\u3093","navigation.noItems":"\u8868\u793A\u3067\u304D\u308B\u9805\u76EE\u304C\u3042\u308A\u307E\u305B\u3093","navigation.expandView":"{title} \u3092\u5C55\u958B","navigation.mode.switchToFixed":"\u56FA\u5B9A\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u306B\u5207\u308A\u66FF\u3048","navigation.mode.switchToFloating":"\u30D5\u30ED\u30FC\u30C6\u30A3\u30F3\u30B0\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u306B\u5207\u308A\u66FF\u3048","navigation.pinned":"\u30D4\u30F3\u7559\u3081","navigation.pin.add":"\u4E0A\u90E8\u306B\u30D4\u30F3\u7559\u3081","navigation.pin.remove":"\u30D4\u30F3\u7559\u3081\u3092\u89E3\u9664","table.toolbar.searchPlaceholder":"\u691C\u7D22...","table.title.default":"\u30C7\u30FC\u30BF\u30C6\u30FC\u30D6\u30EB","table.toolbar.groupBy":"\u30B0\u30EB\u30FC\u30D7\u5316","table.toolbar.summary":"\u96C6\u8A08","table.toolbar.columns":"\u5217","table.toolbar.export":"\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8","table.toolbar.itemsPerPage":"1\u30DA\u30FC\u30B8\u306E\u4EF6\u6570\uFF1A","table.toolbar.pageOf":"{current} / {total} \u30DA\u30FC\u30B8","table.toolbar.newItem":"\u65B0\u898F\u4F5C\u6210","table.toolbar.editItem":"\u7DE8\u96C6","table.toolbar.deleteItem":"\u524A\u9664","table.toolbar.graphicReport":"\u30B0\u30E9\u30D5\u30A3\u30C3\u30AF\u30EC\u30DD\u30FC\u30C8","table.toolbar.saveLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u4FDD\u5B58","table.menu.groupBy":"\u30B0\u30EB\u30FC\u30D7\u5316","table.menu.clearAll":"\u3059\u3079\u3066\u30AF\u30EA\u30A2","table.menu.visibleColumns":"\u8868\u793A\u5217","table.menu.showSummaryRow":"\u96C6\u8A08\u884C\u3092\u8868\u793A","table.menu.noNumericColumns":"\u6570\u5024\u5217\u304C\u3042\u308A\u307E\u305B\u3093","table.group.expandAll":"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u5C55\u958B","table.group.collapseAll":"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u6298\u308A\u305F\u305F\u3080","table.mobile.notImplemented":"\u30E2\u30D0\u30A4\u30EB\u8868\u793A\u306F\u672A\u5B9F\u88C5\u3067\u3059","table.headerMenu.sortAsc":"\u6607\u9806\u3067\u4E26\u3079\u66FF\u3048","table.headerMenu.sortDesc":"\u964D\u9806\u3067\u4E26\u3079\u66FF\u3048","table.headerMenu.clearSort":"\u4E26\u3079\u66FF\u3048\u3092\u89E3\u9664","table.headerMenu.configureSort":"\u4E26\u3079\u66FF\u3048\u3092\u8A2D\u5B9A...","table.headerMenu.group":"\u3053\u306E\u5217\u3067\u30B0\u30EB\u30FC\u30D7\u5316","table.headerMenu.ungroup":"\u30B0\u30EB\u30FC\u30D7\u304B\u3089\u5916\u3059","table.headerMenu.addSummary":"\u96C6\u8A08\u306B\u8FFD\u52A0","table.headerMenu.removeSummary":"\u96C6\u8A08\u304B\u3089\u524A\u9664","table.headerMenu.hideColumn":"\u5217\u3092\u975E\u8868\u793A","table.sortDialog.title":"\u4E26\u3079\u66FF\u3048\u8A2D\u5B9A","table.sortDialog.empty":"\u4E26\u3079\u66FF\u3048\u30EB\u30FC\u30EB\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","table.sortDialog.addRule":"\u30EB\u30FC\u30EB\u3092\u8FFD\u52A0","table.sortDialog.clearAll":"\u3059\u3079\u3066\u30AF\u30EA\u30A2","table.sortDialog.asc":"\u6607\u9806","table.sortDialog.desc":"\u964D\u9806","pivot.title.default":"\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB","pivot.subtitle.default":"\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB\u3092\u8A2D\u5B9A\u3057\u307E\u3059\u3002","pivot.empty":"\u7D50\u679C\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5024\u30A8\u30EA\u30A2\u306B\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.records":"\u30EC\u30B3\u30FC\u30C9","pivot.afterFilter":"\u30D5\u30A3\u30EB\u30BF\u30FC\u5F8C","pivot.grandTotal":"\u7DCF\u8A08","pivot.resultLabel":"\u7D50\u679C","pivot.valueLabel":"\u5024","pivot.table.dimensions":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.config.title":"\u8A2D\u5B9A","pivot.fieldList":"\u30D5\u30A3\u30FC\u30EB\u30C9\u4E00\u89A7","pivot.availableDimensions":"\u5229\u7528\u53EF\u80FD\u306A\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.allFieldsInUse":"\u3059\u3079\u3066\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u304C\u4F7F\u7528\u4E2D\u3067\u3059\u3002","pivot.zone.rows":"\u884C","pivot.zone.columns":"\u5217","pivot.zone.filters":"\u30D5\u30A3\u30EB\u30BF\u30FC","pivot.zone.values":"\u5024","pivot.hint.rows":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u884C\u968E\u5C64\u3092\u4F5C\u6210","pivot.hint.columns":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u5217\u968E\u5C64\u3092\u4F5C\u6210","pivot.hint.filters":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30EC\u30DD\u30FC\u30C8\u30D5\u30A3\u30EB\u30BF\u30FC\u3092\u8A2D\u5B9A","pivot.hint.values":"\u3053\u3053\u306B\u6570\u5024\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u96C6\u8A08","pivot.clearArea":"\u30A8\u30EA\u30A2\u3092\u30AF\u30EA\u30A2","pivot.filter.na":"N/A","pivot.filter.noValues":"\u5024\u304C\u3042\u308A\u307E\u305B\u3093","pivot.filter.noneSelected":"\u672A\u9078\u629E","pivot.filter.allValues":"\u3059\u3079\u3066\u306E\u5024","pivot.filter.selectedCount":"{selected} / {total} \u3092\u9078\u629E","pivot.filter.selectAll":"\u3059\u3079\u3066\u9078\u629E","pivot.filter.deselectAll":"\u3059\u3079\u3066\u89E3\u9664","pivot.filter.noResults":"\u7D50\u679C\u304C\u3042\u308A\u307E\u305B\u3093","pivot.collapse.ariaExpand":"\u8A2D\u5B9A\u30A8\u30EA\u30A2\u3092\u5C55\u958B","pivot.collapse.ariaCollapse":"\u8A2D\u5B9A\u30A8\u30EA\u30A2\u3092\u6298\u308A\u305F\u305F\u3080","pivot.agg.sum":"\u5408\u8A08","pivot.agg.count":"\u4EF6\u6570","pivot.agg.avg":"\u5E73\u5747","pivot.agg.min":"\u6700\u5C0F","pivot.agg.max":"\u6700\u5927","pivot.preset.selectPlaceholder":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u9078\u629E","pivot.preset.save":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u4FDD\u5B58","pivot.preset.delete":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u524A\u9664","pivot.preset.saveDialogTitle":"\u73FE\u5728\u306E\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u4FDD\u5B58","pivot.preset.nameLabel":"\u30D7\u30EA\u30BB\u30C3\u30C8\u540D","pivot.preset.defaultName":"\u30D7\u30EA\u30BB\u30C3\u30C8 {index}","pivot.table.sectionTitle":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C\u3092\u5C55\u958B","pivot.table.collapse.ariaCollapse":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C\u3092\u6298\u308A\u305F\u305F\u3080","pivot.chart.title":"\u30D4\u30DC\u30C3\u30C8\u30C1\u30E3\u30FC\u30C8","pivot.chart.subtitle":"1\u3064\u306E\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u3068\u6700\u59272\u3064\u306E\u6307\u6A19\u3092\u30B3\u30F3\u30D1\u30AF\u30C8\u306A\u30C1\u30E3\u30FC\u30C8\u306B\u307E\u3068\u3081\u307E\u3059\u3002","pivot.chart.subtitleReady":"{dimension} \u3054\u3068\u306E {measure}","pivot.chart.emptyNoDimension":"\u30C1\u30E3\u30FC\u30C8\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u884C\u307E\u305F\u306F\u5217\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.chart.emptyNoValue":"\u30C1\u30E3\u30FC\u30C8\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u5024\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.chart.emptyNoData":"\u73FE\u5728\u306E\u30C1\u30E3\u30FC\u30C8\u9078\u629E\u3067\u306F\u8868\u793A\u3067\u304D\u308B\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093\u3002","pivot.chart.dimension":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.chart.primaryMeasure":"\u6307\u6A19","pivot.chart.secondaryMeasure":"\u6BD4\u8F03\u6307\u6A19","pivot.chart.chartType":"\u30C1\u30E3\u30FC\u30C8\u7A2E\u5225","pivot.chart.style.barVertical":"\u7E26\u68D2\u30B0\u30E9\u30D5","pivot.chart.style.barHorizontal":"\u6A2A\u68D2\u30B0\u30E9\u30D5","pivot.chart.style.line":"\u6298\u308C\u7DDA\u30B0\u30E9\u30D5","pivot.chart.style.scatter":"\u6563\u5E03\u56F3","pivot.chart.collapse.ariaExpand":"\u30C1\u30E3\u30FC\u30C8\u9818\u57DF\u3092\u5C55\u958B","pivot.chart.collapse.ariaCollapse":"\u30C1\u30E3\u30FC\u30C8\u9818\u57DF\u3092\u6298\u308A\u305F\u305F\u3080","smartFilter.adaptFilters":"\u30D5\u30A3\u30EB\u30BF\u30FC\u8ABF\u6574","smartFilter.addFilters":"\u30D5\u30A3\u30EB\u30BF\u30FC\u8FFD\u52A0","smartFilter.go":"\u5B9F\u884C","smartFilter.visibleFilters":"\u8868\u793A\u30D5\u30A3\u30EB\u30BF\u30FC","smartFilter.searchPlaceholder":"\u691C\u7D22...","smartFilter.noOptionsFound":"\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093","smartFilter.min":"\u6700\u5C0F","smartFilter.max":"\u6700\u5927","smartFilter.minMaxPlaceholder":"\u6700\u5C0F - \u6700\u5927","smartFilter.operator.equals":"\u7B49\u3057\u3044","smartFilter.operator.contains":"\u542B\u3080","smartFilter.operator.notContains":"\u542B\u307E\u306A\u3044","smartFilter.operator.wildcard":"\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u691C\u7D22","smartFilter.operator.notEquals":"\u7B49\u3057\u304F\u306A\u3044","smartFilter.operator.greaterThan":"\u3088\u308A\u5927\u304D\u3044","smartFilter.operator.lessThan":"\u3088\u308A\u5C0F\u3055\u3044","smartFilter.operator.greaterOrEqual":"\u4EE5\u4E0A","smartFilter.operator.lessOrEqual":"\u4EE5\u4E0B","smartFilter.operator.between":"\u7BC4\u56F2","variant.noOptions":"\u30AA\u30D7\u30B7\u30E7\u30F3\u306A\u3057","variant.defaultSuffix":"\u30C7\u30D5\u30A9\u30EB\u30C8","variant.selectVariant":"\u30D3\u30E5\u30FC\u3092\u9078\u629E","variant.saveView":"\u30D3\u30E5\u30FC\u4FDD\u5B58","variant.newVariant":"\u65B0\u3057\u3044\u30D3\u30E5\u30FC","variant.viewName":"\u30D3\u30E5\u30FC\u540D","variant.setDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u306B\u8A2D\u5B9A","variant.publicAllUsers":"\u516C\u958B\uFF08\u5168\u30E6\u30FC\u30B6\u30FC\uFF09","variant.toast.fetchFailed":"\u30D3\u30E5\u30FC\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.saveFailed":"\u30D3\u30E5\u30FC\u306E\u4FDD\u5B58\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.saveSuccess":"\u30D3\u30E5\u30FC\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F","variant.toast.deleteFailed":"\u30D3\u30E5\u30FC\u306E\u524A\u9664\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.deleteSuccess":"\u30D3\u30E5\u30FC\u3092\u524A\u9664\u3057\u307E\u3057\u305F","variant.toast.defaultFailed":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30D3\u30E5\u30FC\u306E\u66F4\u65B0\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.defaultSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30D3\u30E5\u30FC\u3092\u66F4\u65B0\u3057\u307E\u3057\u305F","layout.saveLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u4FDD\u5B58","layout.layoutOptions":"\u30EC\u30A4\u30A2\u30A6\u30C8\u30AA\u30D7\u30B7\u30E7\u30F3","layout.selectLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u9078\u629E","layout.saveCurrentLayout":"\u73FE\u5728\u306E\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4FDD\u5B58...","layout.noSavedLayouts":"\u4FDD\u5B58\u6E08\u307F\u30EC\u30A4\u30A2\u30A6\u30C8\u306A\u3057","layout.removeDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u89E3\u9664","layout.setAsDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u306B\u8A2D\u5B9A","layout.layoutName":"\u30EC\u30A4\u30A2\u30A6\u30C8\u540D","layout.layoutDescription":"\u8AAC\u660E","layout.layoutNameHelper":"\u4F8B\uFF1A\u30B3\u30F3\u30D1\u30AF\u30C8\u8868\u793A","layout.warningOverwrite":"\u8B66\u544A\uFF1A\u65E2\u5B58\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4E0A\u66F8\u304D\u3057\u307E\u3059","layout.useAsDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3068\u3057\u3066\u4F7F\u7528","layout.publicAllUsers":"\u516C\u958B\uFF08\u5168\u30E6\u30FC\u30B6\u30FC\u306B\u8868\u793A\uFF09","layout.toast.loadFallback":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u304B\u3089\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u3001\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u306B\u5207\u308A\u66FF\u3048\u307E\u3057\u305F","layout.toast.saveSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.saveLocalSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableSavedLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30ED\u30FC\u30AB\u30EB\u306B\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.deleteSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.deleteLocalSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u304B\u3089\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableDeletedLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30ED\u30FC\u30AB\u30EB\u304B\u3089\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.defaultSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u8A2D\u5B9A\u3057\u307E\u3057\u305F","layout.toast.defaultLocalSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u306B\u8A2D\u5B9A\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableDefaultLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u3057\u307E\u3057\u305F","dateRange.label":"\u65E5\u4ED8\u7BC4\u56F2","dateRange.startDate":"\u958B\u59CB\u65E5","dateRange.endDate":"\u7D42\u4E86\u65E5","dateRange.select":"\u9078\u629E...","dateRange.today":"\u4ECA\u65E5","dateRange.thisWeek":"\u4ECA\u9031","dateRange.thisMonth":"\u4ECA\u6708","graph.records":"{count} \u4EF6","graph.kpi.totalRecords":"\u7DCF\u30EC\u30B3\u30FC\u30C9","graph.kpi.totalReport":"\u7DCF\u5831\u544A\u6642\u9593","graph.kpi.totalBillable":"\u7DCF\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","graph.kpi.efficiency":"\u52B9\u7387","graph.kpi.amount":"\u91D1\u984D","graph.kpi.flagged":"\u8981\u78BA\u8A8D","graph.chart.billable.title":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u5225\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","graph.chart.billable.subtitle":"\u8ACB\u6C42\u53EF\u80FD\u6642\u9593\u306E\u4E0A\u4F4D","graph.chart.efficiency.title":"\u62C5\u5F53\u8005\u5225\u52B9\u7387","graph.chart.efficiency.subtitle":"\u52B9\u7387\u306E\u4F4E\u3044\u9806","graph.chart.status.title":"\u30B9\u30C6\u30FC\u30BF\u30B9\u5206\u5E03","graph.chart.status.subtitle":"\u30B9\u30C6\u30FC\u30BF\u30B9\u5225\u6BD4\u7387","graph.dataBody":"\u30C7\u30FC\u30BF\u672C\u4F53","graph.reportTitle":"\u30B0\u30E9\u30D5\u30A3\u30C3\u30AF\u30EC\u30DD\u30FC\u30C8","graph.unassigned":"\u672A\u5272\u308A\u5F53\u3066","graph.column.reportHours":"\u5831\u544A\u6642\u9593","graph.column.billableHours":"\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","detail.searchAi.placeholder":"\u9805\u76EE\u3092\u691C\u7D22\u3002\u898B\u3064\u304B\u3089\u306A\u3044\u5834\u5408\u306FAI\u306B\u8CEA\u554F\u3057\u307E\u3059...","detail.searchAi.matches":"{count} \u4EF6\u306E\u4E00\u81F4","detail.searchAi.noMatch":"\u4E00\u81F4\u3059\u308B\u9805\u76EE\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002","detail.searchAi.autoAiFallback":"\u4E00\u81F4\u306A\u3057\u3002AI\u5206\u6790\u3092\u5B9F\u884C\u3057\u307E\u3059...","detail.searchAi.aiResultTitle":"AI\u5206\u6790\u7D50\u679C","detail.table.title":"\u95A2\u9023\u30EC\u30B3\u30FC\u30C9","kanban.empty":"\u3053\u3053\u306B\u30AB\u30FC\u30C9\u3092\u30C9\u30ED\u30C3\u30D7","kanban.bucket.limit":"\u4E0A\u9650","kanban.bucket.dropHere":"\u96E2\u3059\u3068\u3053\u306E bucket \u306B\u79FB\u52D5\u3057\u307E\u3059","kanban.bucket.add":"bucket \u3092\u8FFD\u52A0","kanban.bucket.rename":"bucket \u540D\u3092\u5909\u66F4","kanban.bucket.saveRename":"bucket \u540D\u3092\u4FDD\u5B58","kanban.bucket.cancelRename":"\u540D\u524D\u5909\u66F4\u3092\u30AD\u30E3\u30F3\u30BB\u30EB","kanban.search.placeholder":"\u30AB\u30FC\u30C9\u3068 bucket \u3092\u691C\u7D22","kanban.search.clear":"\u691C\u7D22\u3092\u30AF\u30EA\u30A2","kanban.search.results":"{count} \u4EF6\u306E\u30AB\u30FC\u30C9\u304C\u4E00\u81F4","kanban.search.noMatch":"\u4E00\u81F4\u3059\u308B\u30AB\u30FC\u30C9\u306F\u3042\u308A\u307E\u305B\u3093","kanban.card.progress":"\u9032\u6357","kanban.card.openDetail":"\u8A73\u7D30\u3092\u958B\u304F","kanban.priority.critical":"\u7DCA\u6025","kanban.priority.high":"\u9AD8","kanban.priority.medium":"\u4E2D","kanban.priority.low":"\u4F4E","quickCreate.newItem":"\u65B0\u898F\u4F5C\u6210","quickCreate.createWithTitle":"{title} \u3092\u4F5C\u6210","quickEdit.editWithTitle":"{title} \u3092\u7DE8\u96C6","quickDelete.confirmTitle":"\u524A\u9664\u306E\u78BA\u8A8D","quickDelete.confirmMessageSingle":"\u9078\u629E\u3057\u305F\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F","quickDelete.confirmMessageMultiple":"\u9078\u629E\u3057\u305F {count} \u4EF6\u306E\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F","cardPage.viewDetails":"\u8A73\u7D30\u3092\u8868\u793A","cardPage.download":"\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9","cardPage.close":"\u9589\u3058\u308B","cardPage.empty":"\u9805\u76EE\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093","messageBox.confirm":"OK","messageBox.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB","omph.status.idle":"\u5F85\u6A5F\u4E2D","omph.status.pending":"\u51E6\u7406\u5F85\u3061","omph.status.running":"\u51E6\u7406\u4E2D","omph.status.success":"\u5B8C\u4E86","omph.status.error":"\u30A8\u30E9\u30FC","omph.working":"\u51E6\u7406\u4E2D","omph.workingFor":"\u51E6\u7406\u4E2D\uFF08{duration} \u7D4C\u904E\uFF09","omph.loadOlder":"\u904E\u53BB\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8AAD\u307F\u8FBC\u3080","omph.loadingOlder":"\u8AAD\u307F\u8FBC\u307F\u4E2D\u2026","omph.toBottom":"\u4E00\u756A\u4E0B\u3078","omph.copy":"\u30B3\u30D4\u30FC","omph.copied":"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F","omph.turnActions":"\u8FD4\u4FE1\u30A2\u30AF\u30B7\u30E7\u30F3","omph.usage":"\u4F7F\u7528\u91CF","omph.inputTokens":"\u5165\u529B","omph.outputTokens":"\u51FA\u529B","omph.duration":"\u6240\u8981\u6642\u9593","omph.send":"\u9001\u4FE1","omph.stop":"\u505C\u6B62","omph.supplement.queued":"\u5B9F\u884C\u4E2D\u306E\u30BF\u30B9\u30AF\u306B\u8FFD\u52A0\u3057\u307E\u3057\u305F","omph.turnRail":"\u30BF\u30FC\u30F3","omph.secondUnit":"\u79D2","omph.minuteUnit":"\u5206","omph.preview.title":"\u30D5\u30A1\u30A4\u30EB\u30D7\u30EC\u30D3\u30E5\u30FC","omph.preview.close":"\u30D7\u30EC\u30D3\u30E5\u30FC\u3092\u9589\u3058\u308B","omph.preview.back":"\u4F1A\u8A71\u306B\u623B\u308B","omph.preview.expand":"\u30D7\u30EC\u30D3\u30E5\u30FC\u3092\u62E1\u5927","omph.preview.collapse":"\u30D7\u30EC\u30D3\u30E5\u30FC\u306E\u30B5\u30A4\u30BA\u3092\u623B\u3059","omph.preview.copyContent":"\u5185\u5BB9\u3092\u30B3\u30D4\u30FC","omph.preview.copyPath":"\u30D1\u30B9\u3092\u30B3\u30D4\u30FC","omph.preview.download":"\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9","omph.preview.openExternal":"\u5916\u90E8\u3067\u958B\u304F","omph.preview.wrap":"\u6298\u308A\u8FD4\u3057","omph.preview.loading":"\u30D5\u30A1\u30A4\u30EB\u3092\u8AAD\u307F\u8FBC\u307F\u4E2D","omph.preview.missing":"\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093","omph.preview.failed":"\u3053\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F","omph.preview.unsupported":"\u3053\u306E\u30D5\u30A1\u30A4\u30EB\u5F62\u5F0F\u306F\u30D7\u30EC\u30D3\u30E5\u30FC\u3067\u304D\u307E\u305B\u3093","omph.preview.retry":"\u518D\u8A66\u884C","omph.preview.resize":"\u30D7\u30EC\u30D3\u30E5\u30FC\u30B5\u30A4\u30BA\u306E\u5909\u66F4","omph.preview.line":"{start} \u884C\u76EE","omph.preview.lines":"{start}\u2013{end} \u884C","omph.preview.truncated":"\u5168 {total} \u884C\u4E2D\u5148\u982D {shown} \u884C\u3092\u8868\u793A","omph.preview.sheetTruncated":"\u5168 {total} \u884C\u4E2D\u5148\u982D {shown} \u884C\u3092\u8868\u793A","omph.preview.imageFailed":"\u753B\u50CF\u3092\u8868\u793A\u3067\u304D\u307E\u305B\u3093","omph.preview.zoomIn":"\u62E1\u5927","omph.preview.zoomOut":"\u7E2E\u5C0F","omph.preview.zoomFit":"\u5E45\u306B\u5408\u308F\u305B\u308B","omph.newConversation":"\u65B0\u3057\u3044\u4F1A\u8A71","omph.conversationList":"\u4F1A\u8A71\u30EA\u30B9\u30C8","omph.conversations":"\u4F1A\u8A71","omph.noConversations":"\u4F1A\u8A71\u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093","omph.approval.waiting":"\u627F\u8A8D\u5F85\u3061","omph.approval.choose":"\u64CD\u4F5C\u3092\u9078\u629E","omph.approval.details":"\u627F\u8A8D\u306E\u8A73\u7D30","omph.approval.choices":"\u64CD\u4F5C","omph.approval.reject":"\u62D2\u5426","omph.approval.allowOnce":"\u4ECA\u56DE\u306E\u307F\u8A31\u53EF","omph.approval.confirm":"\u7D9A\u884C","omph.approval.other":"\u305D\u306E\u4ED6","omph.approval.otherPlaceholder":"\u5B9F\u884C\u3059\u308B\u64CD\u4F5C\u3092\u5165\u529B","omph.approval.escalation":"\u30C4\u30FC\u30EB {toolName} \u304C\u7279\u6A29\u5B9F\u884C\u3092\u8981\u6C42\u3057\u3066\u3044\u307E\u3059","omph.input.placeholder":"\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u5165\u529B\u2026","omph.input.upload":"\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9","omph.input.send":"\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u9001\u4FE1","omph.input.stop":"\u751F\u6210\u3092\u505C\u6B62","omph.input.queue.ask":"\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u304C\u5B9F\u884C\u4E2D\u3067\u3059\u3002\u4ECA\u3059\u3050\u9001\u4FE1\u3057\u307E\u3059\u304B\u3001\u3053\u306E\u30BF\u30FC\u30F3\u306E\u5F8C\u306B\u9001\u4FE1\u3057\u307E\u3059\u304B\uFF1F","omph.input.queue.sendNow":"\u4ECA\u3059\u3050\u9001\u4FE1","omph.input.queue.afterTurn":"\u3053\u306E\u30BF\u30FC\u30F3\u306E\u5F8C\u306B\u9001\u4FE1","omph.input.queue.queued":"\u5F85\u6A5F\u4E2D \u2014 \u3053\u306E\u30BF\u30FC\u30F3\u306E\u5F8C\u306B\u81EA\u52D5\u9001\u4FE1","omph.input.queue.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB","omph.input.message":"\u30E1\u30C3\u30BB\u30FC\u30B8\u5165\u529B","omph.input.tools":"\u5165\u529B\u30C4\u30FC\u30EB","agentui.html.defaultTitle":"\u30A4\u30F3\u30BF\u30E9\u30AF\u30C6\u30A3\u30D6 HTML","agentui.html.open":"\u958B\u304F","agentui.html.preview":"\u30D7\u30EC\u30D3\u30E5\u30FC","agentui.html.code":"\u30B3\u30FC\u30C9","agentui.html.toggle":"\u30B3\u30FC\u30C9\u3068\u30D7\u30EC\u30D3\u30E5\u30FC\u3092\u5207\u308A\u66FF\u3048\u308B","agentui.html.copy":"\u30B3\u30FC\u30C9\u3092\u30B3\u30D4\u30FC","agentui.html.copied":"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F","agentui.html.download":"\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9","agentui.html.close":"\u9589\u3058\u308B"},lf={"common.cancel":"\uCDE8\uC18C","common.save":"\uC800\uC7A5","common.ok":"\uD655\uC778","common.done":"\uC644\uB8CC","common.search":"\uAC80\uC0C9","common.none":"\uC5C6\uC74C","common.all":"\uC804\uCCB4","common.noData":"\uB370\uC774\uD130 \uC5C6\uC74C","common.copy":"\uBCF5\uC0AC","common.delete":"\uC0AD\uC81C","common.loading":"\uB85C\uB529 \uC911...","header.searchPlaceholder":"\uBB34\uC5C7\uC774\uB4E0 \uBB3C\uC5B4\uBCF4\uC138\uC694...","header.searchAddFeature":"\uAE30\uB2A5 \uCD94\uAC00","header.searchStartVoice":"\uC74C\uC131 \uC785\uB825 \uC2DC\uC791","header.searchStopVoice":"\uC74C\uC131 \uC785\uB825 \uC911\uC9C0","header.searchOpenPanel":"\uB300\uD654 \uC5F4\uAE30","header.theme.system":"\uD14C\uB9C8: \uC2DC\uC2A4\uD15C","header.theme.dark":"\uD14C\uB9C8: \uB2E4\uD06C","header.theme.light":"\uD14C\uB9C8: \uB77C\uC774\uD2B8","header.menu.setting":"\uC124\uC815","header.menu.refresh":"\uC0C8\uB85C \uACE0\uCE68","header.menu.logout":"\uB85C\uADF8\uC544\uC6C3","navigation.expand":"\uD0D0\uC0C9 \uD3BC\uCE58\uAE30","navigation.collapse":"\uD0D0\uC0C9 \uC811\uAE30","navigation.searchPlaceholder":"\uBA54\uB274 \uAC80\uC0C9...","navigation.noMatch":"\uC77C\uCE58\uD558\uB294 \uBA54\uB274\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.noAccessibleApp":"\uC811\uADFC \uAC00\uB2A5\uD55C \uC571\uC774 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.noItems":"\uD45C\uC2DC\uD560 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.expandView":"{title} \uD3BC\uCE58\uAE30","navigation.mode.switchToFixed":"\uACE0\uC815 \uD0D0\uC0C9\uC73C\uB85C \uC804\uD658","navigation.mode.switchToFloating":"\uD50C\uB85C\uD305 \uD0D0\uC0C9\uC73C\uB85C \uC804\uD658","navigation.pinned":"\uACE0\uC815\uB428","navigation.pin.add":"\uC0C1\uB2E8\uC5D0 \uACE0\uC815","navigation.pin.remove":"\uACE0\uC815 \uD574\uC81C","table.toolbar.searchPlaceholder":"\uAC80\uC0C9...","table.title.default":"\uB370\uC774\uD130 \uD14C\uC774\uBE14","table.toolbar.groupBy":"\uADF8\uB8F9","table.toolbar.summary":"\uC694\uC57D","table.toolbar.columns":"\uC5F4","table.toolbar.export":"\uB0B4\uBCF4\uB0B4\uAE30","table.toolbar.itemsPerPage":"\uD398\uC774\uC9C0\uB2F9 \uD589 \uC218:","table.toolbar.pageOf":"{current} / {total} \uD398\uC774\uC9C0","table.toolbar.newItem":"\uC2E0\uADDC \uD56D\uBAA9","table.toolbar.editItem":"\uD56D\uBAA9 \uC218\uC815","table.toolbar.deleteItem":"\uD56D\uBAA9 \uC0AD\uC81C","table.toolbar.graphicReport":"\uADF8\uB798\uD504 \uB9AC\uD3EC\uD2B8","table.toolbar.saveLayout":"\uB808\uC774\uC544\uC6C3 \uC800\uC7A5","table.menu.groupBy":"\uADF8\uB8F9","table.menu.clearAll":"\uBAA8\uB450 \uC9C0\uC6B0\uAE30","table.menu.visibleColumns":"\uD45C\uC2DC \uC5F4","table.menu.showSummaryRow":"\uC694\uC57D \uD589 \uD45C\uC2DC","table.menu.noNumericColumns":"\uC22B\uC790 \uC5F4 \uC5C6\uC74C","table.group.expandAll":"\uBAA8\uB4E0 \uADF8\uB8F9 \uD3BC\uCE58\uAE30","table.group.collapseAll":"\uBAA8\uB4E0 \uADF8\uB8F9 \uC811\uAE30","table.mobile.notImplemented":"\uBAA8\uBC14\uC77C \uBDF0\uB294 \uC544\uC9C1 \uAD6C\uD604\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4","table.headerMenu.sortAsc":"\uC624\uB984\uCC28\uC21C \uC815\uB82C","table.headerMenu.sortDesc":"\uB0B4\uB9BC\uCC28\uC21C \uC815\uB82C","table.headerMenu.clearSort":"\uC815\uB82C \uD574\uC81C","table.headerMenu.configureSort":"\uC815\uB82C \uC124\uC815...","table.headerMenu.group":"\uC774 \uC5F4\uB85C \uADF8\uB8F9\uD654","table.headerMenu.ungroup":"\uADF8\uB8F9\uC5D0\uC11C \uC81C\uAC70","table.headerMenu.addSummary":"\uC694\uC57D\uC5D0 \uCD94\uAC00","table.headerMenu.removeSummary":"\uC694\uC57D\uC5D0\uC11C \uC81C\uAC70","table.headerMenu.hideColumn":"\uC5F4 \uC228\uAE30\uAE30","table.sortDialog.title":"\uC815\uB82C \uC124\uC815","table.sortDialog.empty":"\uC815\uB82C \uADDC\uCE59\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uCD94\uAC00\uD558\uC138\uC694.","table.sortDialog.addRule":"\uADDC\uCE59 \uCD94\uAC00","table.sortDialog.clearAll":"\uBAA8\uB450 \uC9C0\uC6B0\uAE30","table.sortDialog.asc":"\uC624\uB984\uCC28\uC21C","table.sortDialog.desc":"\uB0B4\uB9BC\uCC28\uC21C","pivot.title.default":"\uD53C\uBC97 \uD14C\uC774\uBE14","pivot.subtitle.default":"\uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uD53C\uBC97 \uD14C\uC774\uBE14\uC744 \uAD6C\uC131\uD558\uC138\uC694.","pivot.empty":"\uACB0\uACFC\uB97C \uBCF4\uB824\uBA74 \uAC12 \uC601\uC5ED\uC5D0 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.records":"\uB808\uCF54\uB4DC","pivot.afterFilter":"\uD544\uD130 \uD6C4","pivot.grandTotal":"\uCD1D\uD569","pivot.resultLabel":"\uACB0\uACFC","pivot.valueLabel":"\uAC12","pivot.table.dimensions":"\uCC28\uC6D0","pivot.config.title":"\uAD6C\uC131","pivot.fieldList":"\uD544\uB4DC \uBAA9\uB85D","pivot.availableDimensions":"\uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uCC28\uC6D0","pivot.allFieldsInUse":"\uBAA8\uB4E0 \uD544\uB4DC\uAC00 \uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC785\uB2C8\uB2E4.","pivot.zone.rows":"\uD589","pivot.zone.columns":"\uC5F4","pivot.zone.filters":"\uD544\uD130","pivot.zone.values":"\uAC12","pivot.hint.rows":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uD589 \uACC4\uCE35\uC744 \uAD6C\uC131","pivot.hint.columns":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uC5F4 \uACC4\uCE35\uC744 \uAD6C\uC131","pivot.hint.filters":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uBCF4\uACE0\uC11C \uD544\uD130\uB85C \uC0AC\uC6A9","pivot.hint.values":"\uC22B\uC790 \uD544\uB4DC\uB97C \uC5EC\uAE30\uC5D0 \uB4DC\uB798\uADF8\uD558\uC5EC \uC9D1\uACC4","pivot.clearArea":"\uC601\uC5ED \uBE44\uC6B0\uAE30","pivot.filter.na":"\uD574\uB2F9 \uC5C6\uC74C","pivot.filter.noValues":"\uAC12 \uC5C6\uC74C","pivot.filter.noneSelected":"\uC120\uD0DD \uC5C6\uC74C","pivot.filter.allValues":"\uBAA8\uB4E0 \uAC12","pivot.filter.selectedCount":"{selected} / {total} \uC120\uD0DD\uB428","pivot.filter.selectAll":"\uC804\uCCB4 \uC120\uD0DD","pivot.filter.deselectAll":"\uC804\uCCB4 \uD574\uC81C","pivot.filter.noResults":"\uAC80\uC0C9 \uACB0\uACFC \uC5C6\uC74C","pivot.collapse.ariaExpand":"\uAD6C\uC131 \uC601\uC5ED \uD3BC\uCE58\uAE30","pivot.collapse.ariaCollapse":"\uAD6C\uC131 \uC601\uC5ED \uC811\uAE30","pivot.agg.sum":"\uD569\uACC4","pivot.agg.count":"\uAC1C\uC218","pivot.agg.avg":"\uD3C9\uADE0","pivot.agg.min":"\uCD5C\uC18C","pivot.agg.max":"\uCD5C\uB300","pivot.preset.selectPlaceholder":"\uD504\uB9AC\uC14B \uC120\uD0DD","pivot.preset.save":"\uD504\uB9AC\uC14B \uC800\uC7A5","pivot.preset.delete":"\uD504\uB9AC\uC14B \uC0AD\uC81C","pivot.preset.saveDialogTitle":"\uD604\uC7AC \uD504\uB9AC\uC14B \uC800\uC7A5","pivot.preset.nameLabel":"\uD504\uB9AC\uC14B \uC774\uB984","pivot.preset.defaultName":"\uD504\uB9AC\uC14B {index}","pivot.table.sectionTitle":"\uD53C\uBC97 \uACB0\uACFC","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"\uD53C\uBC97 \uACB0\uACFC \uD3BC\uCE58\uAE30","pivot.table.collapse.ariaCollapse":"\uD53C\uBC97 \uACB0\uACFC \uC811\uAE30","pivot.chart.title":"\uD53C\uBC97 \uCC28\uD2B8","pivot.chart.subtitle":"\uD558\uB098\uC758 \uCC28\uC6D0\uACFC \uCD5C\uB300 \uB450 \uAC1C\uC758 \uCE21\uC815\uAC12\uC744 \uAC04\uACB0\uD55C \uCC28\uD2B8\uB85C \uD45C\uC2DC\uD569\uB2C8\uB2E4.","pivot.chart.subtitleReady":"{dimension}\uBCC4 {measure}","pivot.chart.emptyNoDimension":"\uCC28\uD2B8\uB97C \uBCF4\uB824\uBA74 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uD589 \uB610\uB294 \uC5F4 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.chart.emptyNoValue":"\uCC28\uD2B8\uB97C \uBCF4\uB824\uBA74 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uAC12 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.chart.emptyNoData":"\uD604\uC7AC \uCC28\uD2B8 \uC120\uD0DD\uC5D0 \uD45C\uC2DC\uD560 \uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.","pivot.chart.dimension":"\uCC28\uD2B8 \uCC28\uC6D0","pivot.chart.primaryMeasure":"\uC8FC \uCE21\uC815\uAC12","pivot.chart.secondaryMeasure":"\uBE44\uAD50 \uCE21\uC815\uAC12","pivot.chart.chartType":"\uCC28\uD2B8 \uC720\uD615","pivot.chart.style.barVertical":"\uC138\uB85C \uB9C9\uB300","pivot.chart.style.barHorizontal":"\uAC00\uB85C \uB9C9\uB300","pivot.chart.style.line":"\uC120\uD615 \uCC28\uD2B8","pivot.chart.style.scatter":"\uC0B0\uC810\uB3C4","pivot.chart.collapse.ariaExpand":"\uCC28\uD2B8 \uC601\uC5ED \uD3BC\uCE58\uAE30","pivot.chart.collapse.ariaCollapse":"\uCC28\uD2B8 \uC601\uC5ED \uC811\uAE30","smartFilter.adaptFilters":"\uD544\uD130 \uC870\uC815","smartFilter.addFilters":"\uD544\uD130 \uCD94\uAC00","smartFilter.go":"\uC2E4\uD589","smartFilter.visibleFilters":"\uD45C\uC2DC \uD544\uD130","smartFilter.searchPlaceholder":"\uAC80\uC0C9...","smartFilter.noOptionsFound":"\uC635\uC158\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","smartFilter.min":"\uCD5C\uC18C","smartFilter.max":"\uCD5C\uB300","smartFilter.minMaxPlaceholder":"\uCD5C\uC18C - \uCD5C\uB300","smartFilter.operator.equals":"\uAC19\uC74C","smartFilter.operator.contains":"\uD3EC\uD568","smartFilter.operator.notContains":"\uBBF8\uD3EC\uD568","smartFilter.operator.wildcard":"\uC640\uC77C\uB4DC\uCE74\uB4DC \uAC80\uC0C9","smartFilter.operator.notEquals":"\uAC19\uC9C0 \uC54A\uC74C","smartFilter.operator.greaterThan":"\uBCF4\uB2E4 \uD07C","smartFilter.operator.lessThan":"\uBCF4\uB2E4 \uC791\uC74C","smartFilter.operator.greaterOrEqual":"\uC774\uC0C1","smartFilter.operator.lessOrEqual":"\uC774\uD558","smartFilter.operator.between":"\uBC94\uC704","variant.noOptions":"\uC635\uC158 \uC5C6\uC74C","variant.defaultSuffix":"\uAE30\uBCF8","variant.selectVariant":"\uBDF0 \uC120\uD0DD","variant.saveView":"\uBDF0 \uC800\uC7A5","variant.newVariant":"\uC0C8 \uBDF0","variant.viewName":"\uBDF0 \uC774\uB984","variant.setDefault":"\uAE30\uBCF8\uC73C\uB85C \uC124\uC815","variant.publicAllUsers":"\uACF5\uAC1C(\uC804\uCCB4 \uC0AC\uC6A9\uC790)","variant.toast.fetchFailed":"\uBDF0\uB97C \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.saveFailed":"\uBDF0\uB97C \uC800\uC7A5\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.saveSuccess":"\uBDF0\uAC00 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","variant.toast.deleteFailed":"\uBDF0\uB97C \uC0AD\uC81C\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.deleteSuccess":"\uBDF0\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","variant.toast.defaultFailed":"\uAE30\uBCF8 \uBDF0\uB97C \uC5C5\uB370\uC774\uD2B8\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.defaultSuccess":"\uAE30\uBCF8 \uBDF0\uAC00 \uC5C5\uB370\uC774\uD2B8\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.saveLayout":"\uB808\uC774\uC544\uC6C3 \uC800\uC7A5","layout.layoutOptions":"\uB808\uC774\uC544\uC6C3 \uC635\uC158","layout.selectLayout":"\uB808\uC774\uC544\uC6C3 \uC120\uD0DD","layout.saveCurrentLayout":"\uD604\uC7AC \uB808\uC774\uC544\uC6C3 \uC800\uC7A5...","layout.noSavedLayouts":"\uC800\uC7A5\uB41C \uB808\uC774\uC544\uC6C3 \uC5C6\uC74C","layout.removeDefault":"\uAE30\uBCF8 \uD574\uC81C","layout.setAsDefault":"\uAE30\uBCF8\uC73C\uB85C \uC124\uC815","layout.layoutName":"\uB808\uC774\uC544\uC6C3 \uC774\uB984","layout.layoutDescription":"\uC124\uBA85","layout.layoutNameHelper":"\uC608: \uCEF4\uD329\uD2B8 \uBDF0","layout.warningOverwrite":"\uACBD\uACE0: \uAE30\uC874 \uB808\uC774\uC544\uC6C3\uC774 \uB36E\uC5B4\uC4F0\uAE30 \uB429\uB2C8\uB2E4","layout.useAsDefault":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC73C\uB85C \uC0AC\uC6A9","layout.publicAllUsers":"\uACF5\uAC1C(\uBAA8\uB4E0 \uC0AC\uC6A9\uC790\uC5D0\uAC8C \uD45C\uC2DC)","layout.toast.loadFallback":"\uBC31\uC5D4\uB4DC\uC5D0\uC11C \uB808\uC774\uC544\uC6C3\uC744 \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD574 \uB85C\uCEEC \uC800\uC7A5\uC18C\uB85C \uC804\uD658\uD588\uC2B5\uB2C8\uB2E4","layout.toast.saveSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.saveLocalSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC \uC800\uC7A5\uC18C\uC5D0 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableSavedLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uB85C\uCEEC\uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4","layout.toast.deleteSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.deleteLocalSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC \uC800\uC7A5\uC18C\uC5D0\uC11C \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableDeletedLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uB85C\uCEEC\uC5D0\uC11C \uC0AD\uC81C\uD588\uC2B5\uB2C8\uB2E4","layout.toast.defaultSuccess":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC774 \uC124\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.defaultLocalSuccess":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC\uC5D0 \uC124\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableDefaultLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uAE30\uBCF8\uAC12\uC744 \uB85C\uCEEC\uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4","dateRange.label":"\uB0A0\uC9DC \uBC94\uC704","dateRange.startDate":"\uC2DC\uC791\uC77C","dateRange.endDate":"\uC885\uB8CC\uC77C","dateRange.select":"\uC120\uD0DD...","dateRange.today":"\uC624\uB298","dateRange.thisWeek":"\uC774\uBC88 \uC8FC","dateRange.thisMonth":"\uC774\uBC88 \uB2EC","graph.records":"{count}\uAC74","graph.kpi.totalRecords":"\uCD1D \uB808\uCF54\uB4DC","graph.kpi.totalReport":"\uCD1D \uBCF4\uACE0 \uC2DC\uAC04","graph.kpi.totalBillable":"\uCD1D \uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","graph.kpi.efficiency":"\uD6A8\uC728","graph.kpi.amount":"\uAE08\uC561","graph.kpi.flagged":"\uD50C\uB798\uADF8","graph.chart.billable.title":"\uCC28\uC6D0\uBCC4 \uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","graph.chart.billable.subtitle":"\uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04 \uC0C1\uC704 \uAC12","graph.chart.efficiency.title":"\uB2F4\uB2F9\uC790\uBCC4 \uD6A8\uC728","graph.chart.efficiency.subtitle":"\uB0AE\uC740 \uD6A8\uC728 \uC6B0\uC120","graph.chart.status.title":"\uC0C1\uD0DC \uBD84\uD3EC","graph.chart.status.subtitle":"\uC0C1\uD0DC\uBCC4 \uBE44\uC728","graph.dataBody":"\uB370\uC774\uD130 \uBCF8\uBB38","graph.reportTitle":"\uADF8\uB798\uD504 \uB9AC\uD3EC\uD2B8","graph.unassigned":"\uBBF8\uC9C0\uC815","graph.column.reportHours":"\uBCF4\uACE0 \uC2DC\uAC04","graph.column.billableHours":"\uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","detail.searchAi.placeholder":"\uD544\uB4DC\uB97C \uAC80\uC0C9\uD558\uACE0, \uACB0\uACFC\uAC00 \uC5C6\uC73C\uBA74 AI\uC5D0 \uC9C8\uBB38\uD558\uC138\uC694...","detail.searchAi.matches":"{count}\uAC1C \uC77C\uCE58 \uD56D\uBAA9","detail.searchAi.noMatch":"\uC77C\uCE58\uD558\uB294 \uD544\uB4DC\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.","detail.searchAi.autoAiFallback":"\uC77C\uCE58 \uD56D\uBAA9\uC774 \uC5C6\uC5B4 AI \uBD84\uC11D\uC744 \uC2E4\uD589\uD569\uB2C8\uB2E4...","detail.searchAi.aiResultTitle":"AI \uBD84\uC11D \uACB0\uACFC","detail.table.title":"\uAD00\uB828 \uB808\uCF54\uB4DC","kanban.empty":"\uC5EC\uAE30\uC5D0 \uCE74\uB4DC\uB97C \uB193\uC73C\uC138\uC694","kanban.bucket.limit":"\uD55C\uB3C4","kanban.bucket.dropHere":"\uB193\uC73C\uBA74 \uC774 \uBC84\uD0B7\uC73C\uB85C \uC774\uB3D9\uD569\uB2C8\uB2E4","kanban.bucket.add":"\uBC84\uD0B7 \uCD94\uAC00","kanban.bucket.rename":"\uBC84\uD0B7 \uC774\uB984 \uBCC0\uACBD","kanban.bucket.saveRename":"\uBC84\uD0B7 \uC774\uB984 \uC800\uC7A5","kanban.bucket.cancelRename":"\uC774\uB984 \uBCC0\uACBD \uCDE8\uC18C","kanban.search.placeholder":"\uCE74\uB4DC \uBC0F \uBC84\uD0B7 \uAC80\uC0C9","kanban.search.clear":"\uAC80\uC0C9 \uC9C0\uC6B0\uAE30","kanban.search.results":"\uC77C\uCE58\uD558\uB294 \uCE74\uB4DC {count}\uAC1C","kanban.search.noMatch":"\uC77C\uCE58\uD558\uB294 \uCE74\uB4DC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4","kanban.card.progress":"\uC9C4\uD589\uB960","kanban.card.openDetail":"\uC0C1\uC138 \uC5F4\uAE30","kanban.priority.critical":"\uAE34\uAE09","kanban.priority.high":"\uB192\uC74C","kanban.priority.medium":"\uBCF4\uD1B5","kanban.priority.low":"\uB0AE\uC74C","quickCreate.newItem":"\uC2E0\uADDC \uD56D\uBAA9","quickCreate.createWithTitle":"{title} \uC0DD\uC131","quickEdit.editWithTitle":"{title} \uC218\uC815","quickDelete.confirmTitle":"\uC0AD\uC81C \uD655\uC778","quickDelete.confirmMessageSingle":"\uC120\uD0DD\uD55C \uD56D\uBAA9\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","quickDelete.confirmMessageMultiple":"\uC120\uD0DD\uD55C {count}\uAC1C \uD56D\uBAA9\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","cardPage.viewDetails":"\uC0C1\uC138 \uBCF4\uAE30","cardPage.download":"\uB2E4\uC6B4\uB85C\uB4DC","cardPage.close":"\uB2EB\uAE30","cardPage.empty":"\uD56D\uBAA9\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","messageBox.confirm":"\uD655\uC778","messageBox.cancel":"\uCDE8\uC18C","omph.status.idle":"\uB300\uAE30","omph.status.pending":"\uB300\uAE30 \uC911","omph.status.running":"\uCC98\uB9AC \uC911","omph.status.success":"\uC644\uB8CC","omph.status.error":"\uC624\uB958","omph.working":"\uCC98\uB9AC \uC911","omph.workingFor":"\uCC98\uB9AC \uC911 {duration} \uACBD\uACFC","omph.loadOlder":"\uC774\uC804 \uBA54\uC2DC\uC9C0 \uBD88\uB7EC\uC624\uAE30","omph.loadingOlder":"\uBD88\uB7EC\uC624\uB294 \uC911\u2026","omph.toBottom":"\uB9E8 \uC544\uB798\uB85C","omph.copy":"\uBCF5\uC0AC","omph.copied":"\uBCF5\uC0AC\uB428","omph.turnActions":"\uC751\uB2F5 \uC791\uC5C5","omph.usage":"\uC0AC\uC6A9\uB7C9","omph.inputTokens":"\uC785\uB825","omph.outputTokens":"\uCD9C\uB825","omph.duration":"\uC18C\uC694 \uC2DC\uAC04","omph.send":"\uBCF4\uB0B4\uAE30","omph.stop":"\uC911\uC9C0","omph.supplement.queued":"\uC2E4\uD589 \uC911\uC778 \uC791\uC5C5\uC5D0 \uCD94\uAC00\uB428","omph.turnRail":"\uD134","omph.secondUnit":"\uCD08","omph.minuteUnit":"\uBD84","omph.preview.title":"\uD30C\uC77C \uBBF8\uB9AC\uBCF4\uAE30","omph.preview.close":"\uBBF8\uB9AC\uBCF4\uAE30 \uB2EB\uAE30","omph.preview.back":"\uB300\uD654\uB85C \uB3CC\uC544\uAC00\uAE30","omph.preview.expand":"\uBBF8\uB9AC\uBCF4\uAE30 \uD655\uB300","omph.preview.collapse":"\uBBF8\uB9AC\uBCF4\uAE30 \uD06C\uAE30 \uBCF5\uC6D0","omph.preview.copyContent":"\uB0B4\uC6A9 \uBCF5\uC0AC","omph.preview.copyPath":"\uACBD\uB85C \uBCF5\uC0AC","omph.preview.download":"\uB2E4\uC6B4\uB85C\uB4DC","omph.preview.openExternal":"\uC678\uBD80\uC5D0\uC11C \uC5F4\uAE30","omph.preview.wrap":"\uC904 \uBC14\uAFC8","omph.preview.loading":"\uD30C\uC77C \uB85C\uB4DC \uC911","omph.preview.missing":"\uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC74C","omph.preview.failed":"\uC774 \uD30C\uC77C\uC744 \uB85C\uB4DC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","omph.preview.unsupported":"\uC774 \uD30C\uC77C \uD615\uC2DD\uC740 \uBBF8\uB9AC\uBCFC \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","omph.preview.retry":"\uB2E4\uC2DC \uC2DC\uB3C4","omph.preview.resize":"\uBBF8\uB9AC\uBCF4\uAE30 \uD06C\uAE30 \uC870\uC815","omph.preview.line":"{start}\uC904","omph.preview.lines":"{start}\u2013{end}\uC904","omph.preview.truncated":"\uC804\uCCB4 {total}\uC904 \uC911 \uCC98\uC74C {shown}\uC904 \uD45C\uC2DC","omph.preview.sheetTruncated":"\uC804\uCCB4 {total}\uD589 \uC911 \uCC98\uC74C {shown}\uD589 \uD45C\uC2DC","omph.preview.imageFailed":"\uC774\uBBF8\uC9C0\uB97C \uD45C\uC2DC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","omph.preview.zoomIn":"\uD655\uB300","omph.preview.zoomOut":"\uCD95\uC18C","omph.preview.zoomFit":"\uB108\uBE44\uC5D0 \uB9DE\uCD94\uAE30","omph.newConversation":"\uC0C8 \uB300\uD654","omph.conversationList":"\uB300\uD654 \uBAA9\uB85D","omph.conversations":"\uB300\uD654","omph.noConversations":"\uC544\uC9C1 \uB300\uD654\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4","omph.approval.waiting":"\uC2B9\uC778 \uB300\uAE30 \uC911","omph.approval.choose":"\uC791\uC5C5\uC744 \uC120\uD0DD\uD558\uC138\uC694","omph.approval.details":"\uC2B9\uC778 \uC138\uBD80 \uC815\uBCF4","omph.approval.choices":"\uC791\uC5C5","omph.approval.reject":"\uAC70\uBD80","omph.approval.allowOnce":"\uD55C \uBC88\uB9CC \uD5C8\uC6A9","omph.approval.confirm":"\uACC4\uC18D","omph.approval.other":"\uAE30\uD0C0","omph.approval.otherPlaceholder":"\uC218\uD589\uD560 \uC791\uC5C5\uC744 \uC124\uBA85\uD558\uC138\uC694","omph.approval.escalation":"\uB3C4\uAD6C {toolName}\uC774(\uAC00) \uAD8C\uD55C \uC788\uB294 \uC2E4\uD589\uC744 \uC694\uCCAD\uD569\uB2C8\uB2E4","omph.input.placeholder":"\uBA54\uC2DC\uC9C0 \uC785\uB825\u2026","omph.input.upload":"\uD30C\uC77C \uC5C5\uB85C\uB4DC","omph.input.send":"\uBA54\uC2DC\uC9C0 \uBCF4\uB0B4\uAE30","omph.input.stop":"\uC0DD\uC131 \uC911\uC9C0","omph.input.queue.ask":"\uC5D0\uC774\uC804\uD2B8\uAC00 \uC2E4\uD589 \uC911\uC785\uB2C8\uB2E4. \uC9C0\uAE08 \uBCF4\uB0BC\uAE4C\uC694, \uC774\uBC88 \uD134\uC774 \uB05D\uB09C \uD6C4\uC5D0 \uBCF4\uB0BC\uAE4C\uC694?","omph.input.queue.sendNow":"\uC9C0\uAE08 \uBCF4\uB0B4\uAE30","omph.input.queue.afterTurn":"\uC774\uBC88 \uD134 \uD6C4\uC5D0 \uBCF4\uB0B4\uAE30","omph.input.queue.queued":"\uB300\uAE30 \uC911 \u2014 \uC774\uBC88 \uD134 \uD6C4 \uC790\uB3D9 \uC804\uC1A1","omph.input.queue.cancel":"\uCDE8\uC18C","omph.input.message":"\uBA54\uC2DC\uC9C0 \uC785\uB825","omph.input.tools":"\uC785\uB825 \uB3C4\uAD6C","agentui.html.defaultTitle":"\uC778\uD130\uB799\uD2F0\uBE0C HTML","agentui.html.open":"\uC5F4\uAE30","agentui.html.preview":"\uBBF8\uB9AC \uBCF4\uAE30","agentui.html.code":"\uCF54\uB4DC","agentui.html.toggle":"\uCF54\uB4DC\uC640 \uBBF8\uB9AC \uBCF4\uAE30 \uC804\uD658","agentui.html.copy":"\uCF54\uB4DC \uBCF5\uC0AC","agentui.html.copied":"\uBCF5\uC0AC\uB428","agentui.html.download":"\uB2E4\uC6B4\uB85C\uB4DC","agentui.html.close":"\uB2EB\uAE30"},Kn={en:of,zh:rf,fr:nf,de:af,ja:sf,ko:lf};var sd=(t,o)=>o?t.replace(/\{(\w+)\}/g,(r,n)=>{let a=o[n];return a==null?"":String(a)}):t,uf={locale:"en",t:(t,o)=>sd(Kn.en[t]||t,o)},ld=createContext(uf),Ua=({locale:t="en",messages:o,children:r})=>{let n=useMemo(()=>{let a=Kn[t]||Kn.en,i=o?.[t]||{},s={...Kn.en,...a,...i};return {locale:t,t:(l,d)=>sd(s[l]||l,d)}},[t,o]);return f(ld.Provider,{value:n,children:r})},ce=()=>useContext(ld);function qn({items:t,onItemClick:o,className:r="",level:n=0,expandedIds:a,onToggleExpand:i,colorMode:s="light",enablePinning:l=false,pinnedIds:d,onTogglePin:p}){let{t:m}=ce(),h=s==="dark",f$1=usePathname(),[u,b]=useState(false),[C,g$1]=useState(new Set),x=a!==void 0&&i!==void 0,v=x?a:C;useEffect(()=>{b(true);},[]);let y=w=>{if(x)i(w);else {let P=new Set(C);P.has(w)?P.delete(w):P.add(w),g$1(P);}},k=w=>{w.children&&w.children.length>0&&y(w.id),o&&o(w);};return !t||!Array.isArray(t)?f("div",{className:bo("tree-menu",r),children:f("div",{className:"text-sm text-[var(--orb-muted)] p-2",children:m("navigation.noItems")})}):f("div",{className:bo("tree-menu",r),children:t.map(w=>{let P=v.has(w.id)||w.isExpanded,I=w.children&&w.children.length>0,R=56+Math.max(0,n-1)*8,N=n===0?12:I?R-24:R,T=w.appurl||w.href,M=u&&T?f$1===T:false,A=d?.has(w.id)??false,L=l&&w.pinnable!==false&&!!T&&!I;return g("div",{className:"tree-menu-item relative",children:[M&&f("div",{className:bo("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10","bg-[var(--orb-nav-active-fg)]")}),g(Xs,{variant:"ghost",className:bo("w-full justify-start h-auto py-2 relative overflow-hidden group",n>0?"gap-1":"gap-2",I&&P&&!M?h?"bg-[color-mix(in_oklch,var(--orb-inverse-fg)_5%,transparent)] text-[var(--orb-fg)] hover:bg-[color-mix(in_oklch,var(--orb-inverse-fg)_8%,transparent)]":"bg-[color-mix(in_oklch,var(--orb-surface)_70%,transparent)] text-[var(--orb-fg)] hover:bg-[var(--orb-surface)]":"",n>=2?"min-h-9 py-1.5 rounded-md":n>0?"min-h-10 rounded-lg":"rounded-lg",M?h?"bg-transparent text-[var(--orb-nav-active-fg)] hover:bg-[color-mix(in_oklch,var(--orb-surface-2)_35%,transparent)]":"bg-transparent text-[var(--orb-nav-active-fg)] hover:bg-[color-mix(in_oklch,var(--orb-surface)_60%,transparent)]":h?"hover:bg-[color-mix(in_oklch,var(--orb-surface-2)_50%,transparent)] text-[var(--orb-fg)]":"hover:bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)] text-[var(--orb-fg)]"),style:{paddingLeft:`${N}px`,paddingRight:L?"34px":"10px"},onClick:()=>k(w),children:[I&&f("div",{className:bo("flex-shrink-0 transition-transform duration-200",P&&"rotate-90",M?"text-[var(--orb-nav-active-fg)]":h?"text-[var(--orb-muted)] group-hover:text-[var(--orb-fg)]":"text-[var(--orb-muted)] group-hover:text-[var(--orb-muted)]"),children:f(Ho,{className:"h-4 w-4"})}),w.icon&&f("div",{className:bo("flex h-4 w-4 flex-shrink-0 items-center justify-center transition-colors duration-200",M?"text-[var(--orb-nav-active-fg)]":h?"text-[var(--orb-muted)] group-hover:text-[var(--orb-fg)]":"text-[var(--orb-muted)] group-hover:text-[var(--orb-muted)]"),children:w.icon}),g("div",{className:"flex-1 text-left overflow-hidden z-10",children:[f("div",{className:bo("text-sm truncate transition-colors duration-200",M?"font-semibold":"font-medium"),children:w.title||w.label}),w.description&&f("div",{className:bo("text-xs truncate transition-colors duration-200",M?h?"text-[color-mix(in_oklch,var(--orb-nav-active-fg)_70%,transparent)]":"text-[color-mix(in_oklch,var(--orb-nav-active-fg)_75%,transparent)]":"text-[var(--orb-muted)]"),title:w.description,children:w.description})]})]}),L&&p&&f("button",{type:"button","aria-label":m(A?"navigation.pin.remove":"navigation.pin.add"),"aria-pressed":A,title:m(A?"navigation.pin.remove":"navigation.pin.add"),onClick:W=>{W.preventDefault(),W.stopPropagation(),p(w);},className:bo("orb-navigation-pin-button absolute right-1 top-1/2 z-20 flex h-7 w-7 -translate-y-1/2 items-center justify-center rounded-md transition-colors duration-150",A&&"orb-is-pinned"),children:f(Qr,{className:bo("h-3.5 w-3.5",A&&"fill-current")})}),I&&f("div",{className:bo("grid transition-[grid-template-rows] duration-300 ease-in-out",P?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:f("div",{className:bo("overflow-hidden",P&&"pt-1"),children:f(qn,{items:w.children,onItemClick:o,level:n+1,expandedIds:a,onToggleExpand:i,colorMode:s,enablePinning:l,pinnedIds:d,onTogglePin:p})})})]},w.id)})})}var ff="orbcafe:navigation-island:pinned-items",Zs="orbcafe-navigation-pinned",bf=t=>t.appurl||t.href,dd=t=>{let o=[];return t.forEach(r=>{let n=!!r.children?.length;r.pinnable!==false&&bf(r)&&!n&&o.push({...r,children:void 0}),r.children?.length&&o.push(...dd(r.children));}),o},pd=({collapsed:t,onToggle:o,className:r="",maxHeight:n,menuData:a=[],colorMode:i="light",displayMode:s="fixed",onDisplayModeChange:l,showDisplayModeToggle:d=true,enablePinning:p=true,pinStorageKey:m=ff,pinnedItemIds:h,defaultPinnedItemIds:f$1=[],onPinnedItemIdsChange:u,pinnedSectionTitle:b})=>{let{t:C}=ce(),g$1=i==="dark",x=s==="floating",v=useRouter(),[y,k]=useState(""),[w,P]=useState(new Set),[I,S]=useState(f$1),[R,N]=useState(false),T=h!==void 0,M=useMemo(()=>h??I,[h,I]),A=useMemo(()=>new Set(M),[M]);useEffect(()=>{t&&P(new Set);},[t]),useEffect(()=>{if(!p||T){N(true);return}try{let B=window.localStorage.getItem(m);if(B){let q=JSON.parse(B);Array.isArray(q)&&S(q.filter(Z=>typeof Z=="string"));}}catch{}finally{N(true);}},[p,T,m]),useEffect(()=>{if(!(!p||T||!R))try{window.localStorage.setItem(m,JSON.stringify(M));}catch{}},[M,p,T,m,R]),useEffect(()=>{!p||t||M.length===0||P(B=>{if(B.has(Zs))return B;let q=new Set(B);return q.add(Zs),q});},[t,M.length,p]);let L=useCallback(B=>{let q=Array.from(new Set(B));T||S(q),u?.(q);},[T,u]),W=useCallback(B=>{let q=B.id,Z=A.has(q)?M.filter(Y=>Y!==q):[...M,q];L(Z);},[M,A,L]),ee=useMemo(()=>{if(!p||M.length===0)return a;let B=new Map(dd(a).map(Z=>[Z.id,Z])),q=M.map(Z=>B.get(Z)).filter(Z=>!!Z);return q.length===0?a:[{id:Zs,title:b||C("navigation.pinned"),icon:f(Qr,{className:"w-4 h-4"}),children:q,pinnable:false},...a]},[M,p,a,b,C]),O=useCallback(B=>{let q=[],Z=Y=>{Y.forEach(J=>{q.push(J.id),J.children&&Z(J.children);});};return Z(B),q},[]),_=useMemo(()=>{if(!y.trim())return ee;let B=q=>q.reduce((Z,Y)=>{let J=Y.title?.toLowerCase().includes(y.toLowerCase())||Y.description?.toLowerCase().includes(y.toLowerCase()),le=Y.children?B(Y.children):[];return (J||le.length>0)&&Z.push({...Y,children:le.length>0?le:Y.children}),Z},[]);return B(ee)},[y,ee]),V=useMemo(()=>y.trim()?new Set(O(ee)):w,[y,ee,w,O]),Q=useCallback(async B=>{if(console.log("\u{1F5B1}\uFE0F \u5BFC\u822A\u83DC\u5355\u9879\u70B9\u51FB:",B),B.id==="chat"||B.appurl==="/chat"){console.log("\u{1F4AC} \u68C0\u6D4B\u5230chat\u83DC\u5355\u70B9\u51FB\uFF0C\u8DF3\u8F6C\u5230\u65B0\u7684\u804A\u5929\u89C6\u56FE");try{v.push("/chat?new=true");}catch(Z){console.error("\u274C \u65E0\u6CD5\u8DF3\u8F6C\u5230\u65B0\u804A\u5929\u89C6\u56FE:",Z),v.push("/chat");}return}let q=B.appurl||B.href;q&&(q.startsWith("http://")||q.startsWith("https://")?window.open(q,"_blank"):v.push(q));},[v]),H=useCallback(()=>{l?.(s==="fixed"?"floating":"fixed");},[s,l]);return g("div",{className:`flex flex-col backdrop-blur-xl border ${x?"shadow-[0_28px_80px_rgba(15,23,42,0.34)]":"shadow-[0_4px_8px_0_rgba(31,38,135,0.1)]"} ${t?"w-14 rounded-full":"w-[234px] rounded-2xl"} relative ${r} ${g$1?x?"border-white/25":"bg-[var(--orb-nav-bg)] border-white/10":x?"border-white/70":"bg-[color-mix(in_oklch,var(--orb-canvas)_70%,transparent)] border-white/30"}`,style:{backdropFilter:x?"blur(34px) saturate(230%) contrast(1.12)":"blur(16px) saturate(180%)",WebkitBackdropFilter:x?"blur(34px) saturate(230%) contrast(1.12)":"blur(16px) saturate(180%)",backgroundColor:x?g$1?"rgba(8, 12, 18, 0.34)":"rgba(255, 255, 255, 0.24)":void 0,backgroundImage:x?g$1?"radial-gradient(circle at 28% 8%, rgba(255,255,255,0.14), rgba(255,255,255,0) 44%), linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.015) 50%, color-mix(in oklch, var(--orb-ai-accent) 5%, transparent))":"radial-gradient(circle at 28% 8%, rgba(255,255,255,0.42), rgba(255,255,255,0) 46%), linear-gradient(145deg, rgba(255,255,255,0.22), rgba(255,255,255,0.07) 50%, color-mix(in oklch, var(--orb-ai-accent) 8%, transparent))":void 0,boxShadow:x?g$1?"inset 0 1px 0 rgba(255,255,255,0.20), inset 0 -1px 0 rgba(255,255,255,0.08), 0 26px 90px rgba(0,0,0,0.52), 0 0 0 1px rgba(255,255,255,0.06)":"inset 0 1px 0 rgba(255,255,255,0.88), inset 0 -1px 0 rgba(255,255,255,0.34), 0 26px 90px rgba(15,23,42,0.24), 0 0 0 1px rgba(255,255,255,0.35)":void 0,transition:"width 400ms cubic-bezier(0.4, 0.0, 0.2, 1), border-radius 0ms cubic-bezier(0.4, 0.0, 0.2, 1), box-shadow 400ms ease-out, background-color 220ms ease-out, backdrop-filter 220ms ease-out",maxHeight:n?`${n}px`:void 0},children:[f("div",{className:`pt-4 pb-2 transition-all duration-500 ease-in-out ${t?"px-1":"px-2"}`,children:t?f("div",{className:"flex justify-center",children:f("button",{onClick:o,className:`w-10 h-10 flex items-center justify-center rounded-lg transition-colors duration-200 ${g$1?"text-[var(--orb-fg)] hover:bg-[var(--orb-surface-2)]":"text-[var(--orb-muted)] hover:bg-[var(--orb-surface)]"}`,title:C("navigation.expand"),children:f(zo,{className:"h-5 w-5"})})}):g("div",{className:`relative transition-opacity duration-300 ${t?"opacity-0":"opacity-100 delay-200"}`,children:[f("input",{type:"text",placeholder:C("navigation.searchPlaceholder"),value:y,onChange:B=>k(B.target.value),className:`w-full pl-10 pr-4 py-2 text-sm border rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--orb-primary)] focus:border-transparent ${g$1?"border-[var(--orb-border)] bg-[var(--orb-surface-2)] text-[var(--orb-fg)] placeholder-[var(--orb-muted)]":"border-[var(--orb-border)] bg-[var(--orb-canvas)] text-[var(--orb-fg)] placeholder-[var(--orb-muted)]"}`}),f("div",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 pointer-events-none",children:f(zo,{className:"h-4 w-4 text-[var(--orb-muted)]"})})]})}),f("nav",{className:`flex-1 pb-4 transition-all duration-500 ease-in-out overflow-y-auto min-h-0 ${t?"px-1":"px-2"}`,children:_.length===0?f("div",{className:"flex items-center justify-center py-8 text-[var(--orb-muted)] text-sm",children:t?f(Bn,{className:"h-5 w-5"}):C(y?"navigation.noMatch":"navigation.noAccessibleApp")}):g(e,{children:[!t&&f("div",{className:`transition-opacity duration-300 ${t?"opacity-0":"opacity-100 delay-200"}`,children:f(qn,{items:_,onItemClick:Q,className:"space-y-1",expandedIds:V,colorMode:i,enablePinning:p,pinnedIds:A,onTogglePin:W,onToggleExpand:B=>{let q=new Set(w);_.some(Y=>Y.id===B)?q.has(B)?q.delete(B):(_.forEach(Y=>{Y.id!==B&&q.has(Y.id)&&q.delete(Y.id);}),q.add(B)):q.has(B)?q.delete(B):q.add(B),P(q);}})}),t&&f("div",{className:"space-y-2",children:ee.map(B=>f("div",{className:"space-y-1",children:f("button",{onClick:()=>{o();let q=new Set([B.id]);P(q);},className:`w-full flex items-center justify-center p-2 rounded-lg cursor-pointer transition-colors duration-200 ${g$1?"text-[var(--orb-muted)] hover:bg-[var(--orb-surface-2)]":"text-[var(--orb-muted)] hover:bg-[var(--orb-surface)]"}`,title:C("navigation.expandView",{title:B.title||""}),children:B.icon||f("div",{className:`w-6 h-6 rounded text-xs flex items-center justify-center font-medium ${g$1?"bg-[var(--orb-nav-active-fg)] text-[#0b0b0b]":"bg-[var(--orb-primary)] text-[var(--orb-on-primary)]"}`,children:B.title?.charAt(0)||"?"})})},B.id))})]})}),!t&&f("button",{onClick:o,className:`absolute -bottom-1 -right-1 w-6 h-6 bg-transparent rounded-full flex items-center justify-center transition-all duration-300 ease-in-out z-20 ${g$1?"hover:bg-[color-mix(in_oklch,var(--orb-surface-2)_50%,transparent)]":"hover:bg-[color-mix(in_oklch,var(--orb-canvas)_20%,transparent)]"}`,title:C("navigation.collapse"),children:f("div",{className:"absolute",style:{bottom:"0px",right:"0px",width:"16px",height:"16px",overflow:"hidden"},children:f("div",{className:g$1?"border-[var(--orb-status-warning)]":"",style:{width:"32px",height:"32px",borderRadius:"16px",border:"3px solid var(--orb-ai-accent)",backgroundColor:"transparent",position:"absolute",top:"-16px",left:"-16px"}})})}),d&&t&&f("button",{type:"button",onClick:H,className:`absolute -bottom-4 left-1/2 z-30 flex h-9 w-9 -translate-x-1/2 items-center justify-center rounded-full border shadow-md transition-colors focus:outline-none focus:ring-2 focus:ring-[color-mix(in_oklch,var(--orb-primary)_45%,transparent)] ${g$1?"border-[var(--orb-border)] bg-[var(--orb-surface-2)] text-[var(--orb-fg)] hover:bg-[var(--orb-hover)]":"border-[var(--orb-border)] bg-[var(--orb-canvas)] text-[var(--orb-status-fg)] hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]"}`,style:{touchAction:"manipulation"},title:C(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),"aria-label":C(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),children:x?f(Fa,{className:"h-4 w-4"}):f(Ba,{className:"h-4 w-4"})})]})};var yf="orbcafe:navigation-island:pinned-items",Ys="orbcafe-navigation-pinned",ud=t=>t.appurl||t.href,md=t=>t.flatMap(o=>{let r=!!o.children?.length,n=o.pinnable!==false&&ud(o)&&!r?[{...o,children:void 0}]:[];return o.children?.length?[...n,...md(o.children)]:n}),gd=t=>t.flatMap(o=>[o.id,...o.children?gd(o.children):[]]),hd=(t,o)=>t.reduce((r,n)=>{let a=n.children?hd(n.children,o):[];return ([n.title,n.label,n.description].some(s=>s?.toLocaleLowerCase().includes(o))||a.length>0)&&r.push({...n,children:a.length>0?a:n.children}),r},[]),Qs=({collapsed:t,onToggle:o,className:r="",maxHeight:n,menuData:a=[],colorMode:i="light",displayMode:s="fixed",onDisplayModeChange:l,showDisplayModeToggle:d=true,enablePinning:p=true,pinStorageKey:m=yf,pinnedItemIds:h,defaultPinnedItemIds:f$1=[],onPinnedItemIdsChange:u,pinnedSectionTitle:b})=>{let{t:C}=ce(),g$1=useRouter(),x=s==="floating",[v,y]=useState(""),[k,w]=useState(new Set),[P,I]=useState(f$1),[S,R]=useState(false),N=h!==void 0,T=h??P,M=useMemo(()=>new Set(T),[T]);useEffect(()=>{t&&w(new Set);},[t]),useEffect(()=>{if(!p||N){R(true);return}try{let B=window.localStorage.getItem(m);if(B){let q=JSON.parse(B);Array.isArray(q)&&I(q.filter(Z=>typeof Z=="string"));}}catch{}finally{R(true);}},[p,N,m]),useEffect(()=>{if(!(!p||N||!S))try{window.localStorage.setItem(m,JSON.stringify(T));}catch{}},[T,p,N,m,S]),useEffect(()=>{!p||t||T.length===0||w(B=>{if(B.has(Ys))return B;let q=new Set(B);return q.add(Ys),q});},[t,T.length,p]);let A=useCallback(B=>{let q=Array.from(new Set(B));N||I(q),u?.(q);},[N,u]),L=useCallback(B=>{A(M.has(B.id)?T.filter(q=>q!==B.id):[...T,B.id]);},[T,M,A]),W=useMemo(()=>{if(!p||T.length===0)return a;let B=new Map(md(a).map(Z=>[Z.id,Z])),q=T.map(Z=>B.get(Z)).filter(Z=>!!Z);return q.length===0?a:[{id:Ys,title:b||C("navigation.pinned"),icon:f(Qr,{className:"h-4 w-4"}),children:q,pinnable:false},...a]},[T,p,a,b,C]),ee=v.trim().toLocaleLowerCase(),O=useMemo(()=>ee?hd(W,ee):W,[W,ee]),_=useMemo(()=>ee?new Set(gd(O)):k,[k,O,ee]),V=useCallback(B=>{w(q=>{let Z=new Set(q),Y=O.some(J=>J.id===B);return Z.has(B)?Z.delete(B):(Y&&O.forEach(J=>Z.delete(J.id)),Z.add(B)),Z});},[O]),Q=useCallback(B=>{let q=ud(B);q&&(B.id==="chat"||B.appurl==="/chat"?g$1.push("/chat?new=true"):/^https?:\/\//.test(q)?window.open(q,"_blank","noopener,noreferrer"):g$1.push(q));},[g$1]),H=B=>{o(),w(new Set([B.id]));};return g("aside",{"data-navigation-island":"v2","data-collapsed":t||void 0,className:`orb-navigation-island-v2 relative flex flex-col border ${t?"w-14":"w-[234px]"} ${r}`,style:{maxHeight:n?`${n}px`:void 0,transition:"width 320ms cubic-bezier(0.4, 0, 0.2, 1), border-radius 220ms ease, box-shadow 220ms ease"},"aria-label":"Navigation",children:[f("div",{className:`orb-navigation-island-v2-search ${t?"px-1":"px-2"}`,children:t?f("button",{type:"button",onClick:o,className:"mx-auto flex h-10 w-10 items-center justify-center rounded-lg text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]",title:C("navigation.expand"),"aria-label":C("navigation.expand"),children:f(zo,{className:"h-5 w-5"})}):g("label",{className:"relative block",children:[f("span",{className:"orb-visually-hidden",children:C("navigation.searchPlaceholder")}),f(zo,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[var(--orb-muted)]"}),f("input",{type:"search",value:v,onChange:B=>y(B.target.value),placeholder:C("navigation.searchPlaceholder"),className:"w-full py-2 pl-10 pr-3 text-sm outline-none"})]})}),f("nav",{className:`min-h-0 flex-1 overflow-y-auto pb-2 ${t?"px-1":"px-2"}`,children:O.length===0?f("div",{className:"flex items-center justify-center py-8 text-sm text-[var(--orb-muted)]",children:t?f(Bn,{className:"h-5 w-5"}):C(ee?"navigation.noMatch":"navigation.noAccessibleApp")}):t?f("div",{className:"space-y-1",children:W.map(B=>f("button",{type:"button",onClick:()=>H(B),className:"flex h-10 w-full items-center justify-center rounded-lg text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]",title:C("navigation.expandView",{title:B.title||B.label||""}),children:B.icon||f(Bn,{className:"h-5 w-5"})},B.id))}):f(qn,{items:O,onItemClick:Q,className:"space-y-1",expandedIds:_,onToggleExpand:V,colorMode:i,enablePinning:p,pinnedIds:M,onTogglePin:L})}),d&&t&&f("div",{className:"orb-navigation-island-v2-footer flex flex-col items-center gap-1 border-t px-1 py-2",children:f("button",{type:"button",onClick:()=>l?.(x?"fixed":"floating"),className:"flex h-9 w-9 items-center justify-center rounded-lg text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]",title:C(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),"aria-label":C(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),children:x?f(Fa,{className:"h-4 w-4"}):f(Ba,{className:"h-4 w-4"})})}),!t&&f("button",{type:"button",onClick:o,className:"absolute -bottom-1 -right-1 z-20 flex h-6 w-6 items-center justify-center rounded-full bg-transparent transition-all duration-300 ease-in-out",title:C("navigation.collapse"),"aria-label":C("navigation.collapse"),children:f("span",{"aria-hidden":"true",className:"absolute overflow-hidden",style:{bottom:0,right:0,width:16,height:16},children:f("span",{className:"absolute rounded-full border-[3px] border-[var(--orb-ai-accent)]",style:{width:32,height:32,top:-16,left:-16}})})})]})};Qs.displayName="NavigationIsland2";var bd=(t={})=>{let{initialCollapsed:o=false,initialDisplayMode:r="fixed",content:n=[],enablePinning:a,pinStorageKey:i,pinnedItemIds:s,defaultPinnedItemIds:l,onPinnedItemIdsChange:d,pinnedSectionTitle:p}=t,[m,h]=useState(o),[f,u]=useState(r),[b,C]=useState(n),g=useCallback(()=>{h(y=>!y);},[]),x=useCallback(()=>{u(y=>y==="fixed"?"floating":"fixed");},[]),v=useMemo(()=>({collapsed:m,onToggle:g,menuData:b,displayMode:f,onDisplayModeChange:u,enablePinning:a,pinStorageKey:i,pinnedItemIds:s,defaultPinnedItemIds:l,onPinnedItemIdsChange:d,pinnedSectionTitle:p}),[m,g,b,f,u,a,i,s,l,d,p]);return {collapsed:m,setCollapsed:h,toggleCollapsed:g,displayMode:f,setDisplayMode:u,toggleDisplayMode:x,menuData:b,setMenuData:C,navigationIslandProps:v}};var Js=class{constructor(){a(this,"listener",null);}register(o){this.listener=o;}unregister(){this.listener=null;}show(o,r,n){this.listener&&this.listener({type:o,content:r,options:n});}hide(){this.listener&&this.listener(null);}},ir=new Js,aT={success:(t,o)=>ir.show("success",t,o),error:(t,o)=>ir.show("error",t,o),warning:(t,o)=>ir.show("warning",t,o),info:(t,o)=>ir.show("info",t,o),show:(t,o,r)=>ir.show(t,o,r),hide:()=>ir.hide()};var xf={success:{icon:f(On,{size:40}),color:"var(--orb-success-bg)",iconColor:"var(--orb-success)"},warning:{icon:f(za,{size:40}),color:"var(--orb-warn-bg)",iconColor:"var(--orb-warn)"},error:{icon:f(Da,{size:40}),color:"var(--orb-err-bg)",iconColor:"var(--orb-err)"},info:{icon:f(Aa,{size:40}),color:"var(--orb-info-bg)",iconColor:"var(--orb-info)"},default:{icon:null,color:"transparent",iconColor:"inherit"}},Yn=({open:t,title:o,message:r,onClose:n,onConfirm:a,confirmText:i,cancelText:s,showCancel:l=true,maxWidth:d="xs",type:p="default"})=>{let{t:m}=ce(),h=i||m("messageBox.confirm"),f$1=s||m("messageBox.cancel"),u=()=>{a?a():n();},b=xf[p],C=p!=="default";return g(Lt,{open:t,onClose:n,maxWidth:d,sx:C?{borderTop:`6px solid ${b.iconColor}`}:void 0,children:[C&&f("div",{style:{display:"flex",justifyContent:"center",paddingTop:24,color:b.iconColor},children:b.icon}),o&&f("div",{className:"orb-dialog-title",style:{textAlign:C?"center":"left",paddingTop:C?8:16},children:o}),f("div",{className:"orb-dialog-content",style:{textAlign:C?"center":"left"},children:typeof r=="string"?f("p",{style:{margin:0,color:"var(--orb-muted)"},children:r}):r}),g("div",{className:"orb-dialog-actions",style:{display:"flex",justifyContent:C?"center":"flex-end",gap:8,paddingBottom:24,paddingLeft:24,paddingRight:24},children:[l&&f(Pe,{onClick:n,variant:"text",children:f$1}),f(Pe,{onClick:u,variant:"contained",color:C&&p==="error"?"error":"primary",autoFocus:true,children:h})]})]})},mT=()=>{let[t,o]=Jt__default.useState(null),[r,n]=Jt__default.useState(false);Jt__default.useEffect(()=>{let s=l=>{l?(o(l),n(true)):(n(false),o(null));};return ir.register(s),()=>ir.unregister()},[]);let a=()=>{n(false),t?.options?.onClose&&t.options.onClose(),o(null);},i=()=>{t?.options?.onConfirm&&t.options.onConfirm(),n(false),o(null);};return t?f(Yn,{open:r,type:t.type,message:t.content,title:t.options?.title,onClose:a,onConfirm:i,confirmText:t.options?.confirmText,cancelText:t.options?.cancelText,showCancel:t.options?.showCancel,maxWidth:t.options?.maxWidth}):null};var vT=({status:t,showIcon:o=true})=>{let r="gray",n,a=t;return t==="OK"?(r="blue",n=f(On,{size:14,strokeWidth:2}),a="Success"):t==="Error"?(r="orange",n=f(Da,{size:14,strokeWidth:2}),a="Error"):t==="Warning"&&(r="orange",n=f(za,{size:14,strokeWidth:2}),a="Warning"),f(Ct,{label:a,tone:r,icon:o&&n?n:void 0})};var xT=({dense:t,sx:o,className:r,children:n,...a})=>f("ul",{...a,className:r,style:{listStyle:"none",margin:0,padding:0,...o},children:n}),wT=({button:t,divider:o,sx:r,className:n,children:a,...i})=>f("li",{...i,className:n,style:{display:"flex",alignItems:"center",padding:"8px 16px",minHeight:40,borderBottom:o?"1px solid var(--orb-border)":void 0,cursor:t?"pointer":void 0,transition:"var(--orb-t-fast)",...r},onMouseEnter:t?s=>{s.currentTarget.style.background="var(--orb-hover)";}:void 0,onMouseLeave:t?s=>{s.currentTarget.style.background="";}:void 0,children:a}),ST=({sx:t,className:o,children:r,...n})=>f("button",{...n,type:"button",className:o,style:{width:"100%",display:"flex",alignItems:"center",padding:"8px 16px",border:"none",background:"transparent",textAlign:"left",cursor:"pointer",transition:"var(--orb-t-fast)",...t},children:r}),kT=({children:t,sx:o})=>f("div",{style:{marginRight:16,display:"flex",alignItems:"center",minWidth:40,...o},children:t}),PT=({primary:t,secondary:o,sx:r})=>g("div",{style:{flex:1,minWidth:0,...r},children:[f("div",{className:"orb-body",style:{fontWeight:500},children:t}),o&&f("div",{className:"orb-meta",style:{marginTop:2},children:o})]}),TT=({sx:t,className:o,children:r,...n})=>f("li",{...n,className:o,style:{padding:"8px 16px",fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--orb-muted)",...t},children:r}),IT=({children:t,sx:o})=>f("div",{style:{marginRight:12,display:"flex",alignItems:"center",...o},children:t});var DT=({xs:t,md:o,lg:r,sx:n,children:a,className:i,...s})=>{let l=r?`span ${r}`:o?`span ${o}`:t?`span ${t}`:"span 12";return f("div",{...s,className:i,style:{gridColumn:l,minWidth:0,...n},children:a})};var Eo=tt,ao=(t,o)=>forwardRef(({component:r,sx:n,className:a,style:i,children:s,...l},d$1)=>{let p=r??t,m=d(n,[o,a].filter(Boolean).join(" "),i);return f(p,{ref:d$1,className:m.className,style:m.style,...l,children:s})}),Ie=ao("div"),yd=ao("a","orb-link"),Or=Ne,Cd=se,vo=E;var xd=ie;var wd=Rt,jo=tn,Ja=en,ei=$a;var ti=Wa,Sd=Zo,kd=({value:t,variant:o,color:r,sx:n})=>f(Wn,{value:o==="determinate"?t:void 0,color:r,sx:n}),Pd=ao("table","orb-tbl"),Td=ao("tbody"),ol=ao("td"),Id=ao("div","orb-table-container"),Md=ao("thead"),rl=ao("tr");ao("tfoot");ao("div","orb-dialog-title");ao("div","orb-dialog-content");ao("div","orb-dialog-actions");ao("p","orb-body-dense");var sr=ao("span","orb-input-adornment"),Rd=forwardRef(({sx:t,fullWidth:o,className:r,style:n,...a},i)=>{let s=d(t,["orb-input-base",r].filter(Boolean).join(" "),n);return f("input",{ref:i,className:s.className,style:{width:o?"100%":void 0,...s.style},...a})});var vr=ao("div","orb-form-control"),Qn=({control:t,label:o,...r})=>g("label",{className:"orb-form-control-label",...r,children:[t,f("span",{children:o})]}),If=({primary:t,secondary:o,children:r,primaryTypographyProps:n,secondaryTypographyProps:a,...i})=>g("span",{className:"orb-list-item-text",...i,children:[t??r,o?f("small",{children:o}):null]}),Mf=ao("span","orb-list-item-icon"),_t=If,Vo=Mf;ao("div","orb-list-subheader");var nl=({container:t,item:o,spacing:r,xs:n,sm:a,md:i,lg:s,xl:l,sx:d,...p})=>{let m={},h=f=>typeof f=="number"?`${f/12*100}%`:f?"100%":void 0;return n!==void 0&&(m.xs=h(n)),a!==void 0&&(m.sm=h(a)),i!==void 0&&(m.md=h(i)),s!==void 0&&(m.lg=h(s)),l!==void 0&&(m.xl=h(l)),f(Ie,{...p,sx:{display:t?"flex":void 0,flexWrap:t?"wrap":void 0,gap:t&&r?r:void 0,width:o?m:void 0,...d??{}}})},on=({in:t,children:o,unmountOnExit:r,...n})=>!t&&r?null:f("div",{hidden:!t,...n,children:o}),Dd=({children:t,container:o})=>typeof document>"u"?null:createPortal(t,o??document.body),Nd=ao("div","orb-toolbar"),Ad=({active:t,direction:o="asc",children:r,sx:n,className:a,style:i,...s})=>{let l=d(n,["orb-table-sort-label",t?"orb-is-active":"",a].filter(Boolean).join(" "),i);return g("button",{type:"button",className:l.className,style:l.style,"data-direction":o,...s,children:[f("span",{className:"orb-table-sort-content",children:r}),f(Pt,{className:"orb-table-sort-icon",name:o==="desc"?"down":"up",size:11})]})},oi=({open:t,anchorEl:o,onClose:r,children:n,anchorOrigin:a,transformOrigin:i,slotProps:s,PaperProps:l,sx:d$1,className:p,style:m,...h})=>{let f$1=useRef(null);if(useEffect(()=>{if(!t)return;let x=y=>{let k=y.composedPath();f$1.current&&k.includes(f$1.current)||o&&k.includes(o)||r?.();},v=y=>{y.key==="Escape"&&r?.();};return document.addEventListener("pointerdown",x,true),document.addEventListener("keydown",v,true),()=>{document.removeEventListener("pointerdown",x,true),document.removeEventListener("keydown",v,true);}},[o,r,t]),!t||typeof document>"u")return null;let u=o?.getBoundingClientRect(),b=s?.paper??l,C=[...Array.isArray(b?.sx)?b.sx:b?.sx?[b.sx]:[],...Array.isArray(d$1)?d$1:d$1?[d$1]:[]],g=d(C,["orb-pop",b?.className,p].filter(Boolean).join(" "),{...b?.style,...m});return createPortal(f("div",{...h,ref:f$1,className:g.className,style:{position:"fixed",left:u?.left??16,top:(u?.bottom??16)+6,zIndex:1301,...g.style},children:n}),document.body)},Ed=({open:t,onClose:o,anchor:r="left",children:n,PaperProps:a})=>{if(!t||typeof document>"u")return null;let i=r==="right"?{right:0,top:0,bottom:0}:r==="top"?{left:0,right:0,top:0}:r==="bottom"?{left:0,right:0,bottom:0}:{left:0,top:0,bottom:0},s=d(a?.sx,"orb-drawer");return createPortal(g(e,{children:[f("button",{type:"button",className:"orb-overlay","aria-label":"Close drawer",onClick:o}),f("aside",{className:s.className,style:{position:"fixed",zIndex:1201,...i},children:n})]}),document.body)},Ld=({value:t,onChange:o,children:r,variant:n,scrollButtons:a,...i})=>f("div",{role:"tablist",className:"orb-tabs",...i,children:Children.map(r,s=>isValidElement(s)?cloneElement(s,{selected:s.props.value===t,onSelect:l=>o?.(null,l)}):s)}),Od=({value:t,label:o,children:r,selected:n,onSelect:a,...i})=>f("button",{type:"button",role:"tab","aria-selected":n,className:`orb-tab ${n?"orb-is-active":""}`,onClick:()=>a?.(t),...i,children:o??r});var io=()=>c(),yr=(t,o)=>Do(t);var Fd=({day:t,onDaySelect:o,selected:r,outsideCurrentMonth:n,disableMargin:a,sx:i,className:s,...l})=>{let d$1=d(i,`orb-cal-day ${r?"orb-is-selected":""} ${n?"orb-is-outside":""} ${s??""}`);return f("button",{type:"button",className:d$1.className,style:d$1.style,onClick:()=>o?.(t),...l,children:t.date()})},Bd=({value:t,referenceDate:o,onChange:r,onMonthChange:n,onYearChange:a,minDate:i,maxDate:s,slots:l,...d})=>f(Gn,{value:t,month:o,onChange:p=>r?.(p),onMonthChange:p=>{n?.(p),a?.(p);},minDate:i,maxDate:s,renderDay:l?.day?(p,m)=>l.day?.({day:p,selected:m.selected,outsideCurrentMonth:m.outsideCurrentMonth,onDaySelect:h=>r?.(h)}):void 0,...d}),Hd=({children:t})=>f(e,{children:t}),ja=class{};var Rf=(t,o)=>o!==void 0?o:typeof t=="number"?t:t==="small"?18:t==="large"?30:t==="inherit"?"1em":22,ke=t=>({fontSize:r,size:n,sx:a,className:i,style:s,titleAccess:l,...d$1})=>{let p=d(a,i,s);return f(Pt,{name:t,size:Rf(r,n),className:p.className,style:p.style,"aria-label":d$1["aria-label"]??l,...d$1})},Cr=ke("tree"),Fr=ke("add"),zd=ke("duplicate"),al=ke("down"),Vd=ke("navigationRight"),Wd=ke("navigationRight"),il=ke("up"),$d=ke("delete"),_d=ke("camera"),Gd=ke("accept"),Ud=ke("accept"),ri=ke("navigationRight"),Kd=ke("dimension"),sl=ke("decline"),xr=ke("decline"),qd=ke("decline"),Xd=ke("decline"),ni=ke("delete"),ai=ke("delete"),Zd=ke("download"),Yd=ke("move"),Qd=ke("edit"),rn=ke("slimDown"),jd=ke("filter"),nn=ke("sum"),Jd=ke("lineChart"),ep=ke("document"),Wo=ke("slimDown"),tp=ke("navigationLeft"),wr=ke("navigationRight"),ii=ke("slimUp"),si=ke("navigationLeft"),li=ke("navigationRight"),op=ke("dimension"),rp=ke("splitOne"),ci=ke("menu"),np=ke("microphone"),ap=ke("microphone"),ip=ke("microphone"),sp=ke("qrCode"),Sr=ke("save"),Br=ke("search"),lp=ke("search"),cp=ke("paperPlane"),dp=ke("paperPlane"),pp=ke("wrench"),up=ke("sort"),di=ke("splitTwo"),mp=ke("favorite"),gp=ke("favorite"),ll=ke("stop"),hp=ke("tableRow"),pi=ke("collapseAll"),ui=ke("expandAll"),an=ke("tableColumn"),fp=ke("overview"),bp=ke("hide");var Nf=[{field:"value",label:"Value",minWidth:120},{field:"label",label:"Description",minWidth:180}],yp=t=>Array.isArray(t)?t:t==null||t===""?[]:[t],ko=t=>String(t),Cp=(t,o)=>t[o],xp=t=>{let o=t.value??t.id??t.key??t.code;return typeof o=="number"||typeof o=="string"?o:""},Af=t=>{let o=t.label??t.description??t.name??t.title;return String(typeof o=="number"||typeof o=="string"?o:xp(t))},Ef=t=>{let o=t.description??t.subtitle;return typeof o=="number"||typeof o=="string"?String(o):void 0},wp=({value:t=null,items:o=[],columns:r,mode:n="single",dialogTitle:a="Value Help",searchPlaceholder:i="Search values...",selectLabel:s="Select",clearLabel:l="Clear",cancelLabel:d="Cancel",valueHelpLabel:p="Open value help",noResultsText:m="No matching values",loading:h=false,clearable:f$1=true,allowManualInput:u=true,validateManualInput:b=true,manualInputErrorText:C="Enter a valid value.",selectedItems:g$1=[],displayValue:x,getOptionValue:v=xp,getOptionLabel:y=Af,getOptionDescription:k=Ef,onChange:w,onSearch:P,disabled:I,InputProps:S,onFocus:R,onBlur:N,onKeyDown:T,error:M,helperText:A,...L})=>{let W=go(),ee=n==="multiple",[O,_]=useState(false),[V,Q]=useState(false),[H,B]=useState(""),[q,Z]=useState(null),[Y,J]=useState(false),[le,he]=useState(()=>yp(t)),[ze,be]=useState(""),[Ce,Be]=useState(""),de=useMemo(()=>r&&r.length>0?r:Nf,[r]),ve=q??o,We=useMemo(()=>{let oe=[...g$1,...o,...q??[]],ye=new Map;return oe.forEach(De=>{ye.set(ko(v(De)),De);}),ye},[v,o,q,g$1]),et=useMemo(()=>yp(t),[t]),nt=useMemo(()=>et.map(String).join(", "),[et]);useEffect(()=>{O||he(et);},[O,et]),useEffect(()=>{!V&&!Ce&&be(nt);},[V,nt,Ce]);let it=useMemo(()=>{let oe=H.trim().toLowerCase();if(!oe||P)return ve;let ye=de.filter(De=>De.searchable!==false);return ve.filter(De=>[v(De),y(De),k(De),...ye.map(st=>Cp(De,st.field))].some(st=>String(st??"").toLowerCase().includes(oe)))},[ve,k,y,v,P,H,de]),U=useMemo(()=>{if(x!==void 0)return x;if(et.length===0)return "";let oe=ye=>{let De=We.get(ko(ye));if(!De)return String(ye);let je=y(De);return je&&je!==String(ye)?`${ye} - ${je}`:String(ye)};return ee?et.length>2?`${et.length} selected`:et.map(oe).join(", "):oe(et[0])},[x,y,ee,We,et]),Re=useCallback(async()=>{if(P){J(true);try{let oe=await P(H);Array.isArray(oe)&&Z(oe);}finally{J(false);}}},[P,H]),we=()=>{I||(he(et),_(true));},Oe=()=>{_(false);},at=()=>{w?.(ee?[]:null,ee?[]:null),he([]),be(""),Be("");},Ze=oe=>{let ye=v(oe);if(ee){he(De=>De.some(st=>ko(st)===ko(ye))?De.filter(st=>ko(st)!==ko(ye)):[...De,ye]);return}he([ye]);},xt=()=>{let oe=le.map(ye=>We.get(ko(ye))).filter(ye=>!!ye);ee?w?.(le,oe):w?.(le[0]??null,oe[0]??null),Be(""),_(false);},It=oe=>{if(oe.key==="F4"){oe.preventDefault(),we();return}if(oe.key==="Enter"&&u&&!At(ze,true)){oe.preventDefault();return}T?.(oe);},Ot=oe=>b?oe.every(ye=>We.has(ko(ye))):true,At=(oe,ye)=>{if(ee){let je=oe.split(/[,;\n]/).map(pt=>pt.trim()).filter(Boolean);if(je.length===0)return Be(""),w?.([],[]),true;if(!Ot(je))return ye&&Be(C),false;Be("");let st=je.map(pt=>We.get(ko(pt))).filter(pt=>!!pt);return w?.(je,st),true}let De=oe.trim();return De?Ot([De])?(Be(""),w?.(De,We.get(ko(De))??null),true):(ye&&Be(C),false):(Be(""),w?.(null,null),true)},re=oe=>{if(!u)return;let ye=oe.target.value;be(ye),Be(""),At(ye,false);},Ge=h||Y,Le=et.length>0,xe=u&&(V||!!Ce)?ze:U;return g(e,{children:[f(He,{...L,className:["orb-value-help-field",f$1&&Le&&!I?"orb-value-help-has-clear":"",L.className??""].filter(Boolean).join(" "),disabled:I,value:xe,error:!!Ce||M,helperText:Ce||A,onChange:re,onFocus:oe=>{Q(true),be(nt),R?.(oe);},onBlur:oe=>{u&&At(ze,true),Q(false),N?.(oe);},onKeyDown:It,InputProps:{...S,readOnly:!u,endAdornment:g("span",{className:"orb-value-help-actions",children:[Ge?f(Zo,{size:18}):null,f$1&&Le&&!I?f(ie,{className:"orb-value-help-clear-trigger",size:"small",tooltip:l,"aria-label":l,onMouseDown:oe=>oe.preventDefault(),onClick:oe=>{oe.stopPropagation(),at();},children:f(Pt,{name:"decline",size:14})}):null,f(ie,{className:"orb-value-help-search-trigger",size:"small",tooltip:p,"aria-label":p,onMouseDown:oe=>oe.preventDefault(),onClick:oe=>{oe.stopPropagation(),we();},disabled:I,children:f(Pt,{name:"search",size:16})})]})}}),g(Lt,{open:O,onClose:Oe,fullWidth:true,maxWidth:820,hideCloseButton:true,PaperProps:{sx:oe=>({borderRadius:2,overflow:"hidden",border:`1px solid ${oe.palette.divider}`,boxShadow:W==="dark"?`0 24px 80px ${tt(oe.palette.common.black,.72)}`:`0 24px 80px ${tt(oe.palette.common.black,.18)}`})},children:[g("div",{className:"orb-dialog-title",sx:oe=>({display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,px:2.5,py:2,pr:1.5,borderBottom:`1px solid ${oe.palette.divider}`,bgcolor:oe.palette.background.paper}),children:[g("div",{children:[f(E,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:a}),ee?f(E,{variant:"body2",color:"text.secondary",sx:{mt:.25},children:`${le.length} selected`}):null]}),f(ie,{"aria-label":"Close",onClick:Oe,size:"small",children:f(xr,{fontSize:"small"})})]}),g("div",{className:"orb-dialog-content",sx:{p:0},children:[g(se,{direction:{xs:"column",sm:"row"},spacing:1,sx:oe=>({px:2.5,py:1.5,borderBottom:`1px solid ${oe.palette.divider}`,bgcolor:W==="dark"?tt(oe.palette.common.white,.025):tt(oe.palette.primary.main,.035)}),children:[f(He,{size:"small",fullWidth:true,autoFocus:true,value:H,placeholder:i,onChange:oe=>B(oe.target.value),onKeyDown:oe=>{oe.key==="Enter"&&(oe.preventDefault(),Re());},InputProps:{startAdornment:f(sr,{position:"start",children:f(Pt,{name:"search",size:16})}),sx:oe=>({borderRadius:1,bgcolor:oe.palette.background.paper,"& fieldset":{borderColor:tt(oe.palette.text.primary,W==="dark"?.2:.16)},"&:hover fieldset":{borderColor:tt(oe.palette.primary.main,.52)},"&:focus-within fieldset":{borderColor:oe.palette.primary.main}})}}),P?f(Pe,{variant:"outlined",onClick:()=>{Re();},disabled:Ge,sx:{minWidth:96,textTransform:"none",fontWeight:700},children:Ge?f(Zo,{size:18}):"Search"}):null]}),f("div",{sx:{maxHeight:420},children:g("table",{className:"orb-tbl",stickyHeader:true,size:"small",children:[f("thead",{children:g("tr",{children:[f("td",{padding:"checkbox",sx:oe=>({bgcolor:W==="dark"?"var(--orb-canvas)":oe.palette.background.paper,borderBottom:`1px solid ${oe.palette.divider}`})}),de.map(oe=>f("td",{align:oe.align==="inherit"?void 0:oe.align,sx:ye=>({minWidth:oe.minWidth,width:oe.width,fontSize:"0.78rem",fontWeight:800,bgcolor:W==="dark"?"var(--orb-canvas)":ye.palette.background.paper,borderBottom:`1px solid ${ye.palette.divider}`}),children:oe.label},String(oe.field)))]})}),g("tbody",{children:[it.map(oe=>{let ye=v(oe),De=le.some(je=>ko(je)===ko(ye));return g("tr",{hover:true,selected:De,onClick:()=>Ze(oe),onDoubleClick:()=>{ee||(he([ye]),w?.(ye,oe),_(false));},sx:je=>({cursor:"pointer","&.orb-selected":{bgcolor:tt(je.palette.primary.main,W==="dark"?.22:.12)},"&.orb-selected:hover":{bgcolor:tt(je.palette.primary.main,W==="dark"?.28:.18)}}),children:[f("td",{padding:"checkbox",children:f(Tt,{size:"small",checked:De})}),de.map(je=>{let st=Cp(oe,je.field);return f("td",{align:je.align==="inherit"?void 0:je.align,sx:{fontSize:"0.82rem",py:1},children:je.render?je.render(st,oe):String(st??"")},String(je.field))})]},ko(ye))}),it.length===0?f("tr",{children:f("td",{colSpan:de.length+1,children:f("div",{sx:{py:5,textAlign:"center",color:"text.secondary"},children:m})})}):null]})]})})]}),g("div",{className:"orb-dialog-actions",sx:oe=>({px:2.5,py:1.5,borderTop:`1px solid ${oe.palette.divider}`,bgcolor:oe.palette.background.paper,"& .orb-btn":{textTransform:"none",fontWeight:700}}),children:[f$1&&(Le||le.length>0)?f(Pe,{onClick:at,children:l}):null,f("div",{sx:{flex:1}}),f(Pe,{onClick:Oe,children:d}),f(Pe,{variant:"contained",onClick:xt,disabled:!ee&&le.length===0,children:s})]})]})]})};var mi=({title:t,hideHeader:o,children:r})=>g("div",{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[!o&&f("div",{sx:{mb:2},children:f(E,{variant:"h4",children:t})}),f("div",{sx:{flex:1,overflow:"hidden"},children:r})]});var cl={width:56,minWidth:56,maxWidth:56,paddingLeft:"4px !important",paddingRight:"4px !important",paddingTop:"0 !important",paddingBottom:"0 !important",textAlign:"center",verticalAlign:"middle",boxSizing:"border-box"},dl={width:72,minWidth:72,maxWidth:72,paddingLeft:"4px !important",paddingRight:"4px !important",paddingTop:"0 !important",paddingBottom:"0 !important",textAlign:"center",verticalAlign:"middle",boxSizing:"border-box"},jn={width:30,height:30,p:.25,flex:"0 0 auto","& svg":{fontSize:20}},Jn={width:30,height:30,minWidth:30,minHeight:30,p:.25,flex:"0 0 auto","& svg":{fontSize:20}},Sp={display:"flex",alignItems:"center",justifyContent:"center",gap:.25,width:"100%",minWidth:0},po={width:32,height:32,minWidth:32,minHeight:32,p:0,flex:"0 0 auto",borderRadius:1,color:"text.secondary","& svg, & [data-sap-icon]":{width:16,height:16,fontSize:16,strokeWidth:1.8}};var Lf={fontSize:"0.85rem",width:62,minWidth:62,"& .orb-select-trigger":{minHeight:"32px !important",height:"32px !important",padding:"0 8px !important"},"& .orb-select-chevron":{width:"11px !important",height:"11px !important",fontSize:"11px !important"}},gi=({rowsPerPage:t=20,rowsPerPageOptions:o=[20,50,100,-1],page:r=0,count:n=0,onRowsPerPageChange:a,onPageChange:i})=>{let{t:s}=ce(),l=o.length>0?o:[20,50,100,-1],d=Math.max(0,r),p=t===-1?1:Math.max(1,Math.ceil(n/t)),m=Math.min(d+1,p),h=d>0,f$1=d<p-1&&t!==-1;return g("div",{className:"orb-table-pager",children:[f(E,{className:"orb-table-pager-label",children:s("table.toolbar.itemsPerPage")}),f(ct,{title:s("table.toolbar.itemsPerPage"),children:f(zt,{size:"small",variant:"standard",value:t,"aria-label":s("table.toolbar.itemsPerPage"),fullWidth:false,disableUnderline:true,onChange:u=>a?.(Number(u.target.value)),sx:Lf,children:l.map(u=>f("option",{value:u,children:u===-1?s("common.all"):u},`rows-per-page-${u}`))})}),f("span",{className:"orb-table-pager-divider"}),f(ie,{className:"orb-table-pager-button","aria-label":"Previous page",size:"small",onClick:()=>i?.(Math.max(d-1,0)),disabled:!h,sx:po,children:f(tp,{})}),g(E,{className:"orb-table-pager-page",title:s("table.toolbar.pageOf",{current:m,total:p}),children:[m," / ",p]}),f(ie,{className:"orb-table-pager-button","aria-label":"Next page",size:"small",onClick:()=>i?.(Math.min(d+1,p-1)),disabled:!f$1,sx:po,children:f(wr,{})})]})};var hi=({value:t="",onChange:o})=>{let{t:r}=ce();return f("div",{className:"orb-table-toolbar-search",children:f(He,{className:"orb-table-toolbar-search-field",size:"small",placeholder:r("table.toolbar.searchPlaceholder"),value:t,onChange:n=>o?.(n.target.value),InputProps:{startAdornment:f(sr,{position:"start",children:f(Br,{size:16})})}})})};var fi=t=>{let{t:o}=ce(),r=Array.isArray(t.actions)?t.actions:t.actions?[t.actions]:[],n=Array.isArray(t.extraTools)?t.extraTools:t.extraTools?[t.extraTools]:[],a=[...r,...n],i=!!(t.showCreateButton||t.showEditButton||t.showDeleteButton),s=!!(t.onOpenGraphReport||t.onLayoutSave&&!t.layoutManager||t.layoutManager);return f(Nd,{className:"orb-table-toolbar",role:"toolbar","aria-label":o("table.title.default"),children:g("div",{className:"orb-table-toolbar-primary",children:[f(hi,{value:t.filterText,onChange:l=>{t.setFilterText(l),t.onPageChange?.(0);}}),f(gi,{rowsPerPage:t.rowsPerPage,rowsPerPageOptions:t.rowsPerPageOptions,page:t.page,count:t.count,onRowsPerPageChange:t.onRowsPerPageChange,onPageChange:t.onPageChange}),a.length>0?f("div",{className:"orb-table-toolbar-custom",children:a.map((l,d)=>f(Jt__default.Fragment,{children:l},`toolbar-custom-${d}`))}):null,f("span",{className:"orb-table-toolbar-spacer"}),g("div",{className:"orb-table-toolbar-actions",children:[g("div",{className:"orb-table-tool-group",children:[!t.disableGrouping&&f(ct,{title:o("table.toolbar.groupBy"),children:f(ie,{className:"orb-table-tool-button",sx:po,onClick:l=>t.setGroupAnchorEl(t.groupAnchorEl?null:l.currentTarget),children:f(ei,{badgeContent:t.grouping?.length,color:"primary",invisible:!t.grouping?.length,children:f(Cr,{})})})}),f(ct,{title:o("table.toolbar.summary"),children:f(ie,{className:`orb-table-tool-button ${t.showSummary?"orb-is-active":""}`,active:!!t.showSummary,sx:po,onClick:l=>t.setSummaryAnchorEl(t.summaryAnchorEl?null:l.currentTarget),children:f(nn,{})})}),f(ct,{title:o("table.toolbar.columns"),children:f(ie,{className:"orb-table-tool-button",sx:po,onClick:l=>t.setAnchorEl(t.anchorEl?null:l.currentTarget),children:f(an,{})})}),f(ct,{title:o("table.toolbar.export"),children:f(ie,{className:"orb-table-tool-button",sx:po,onClick:t.handleExport,children:f(Zd,{})})})]}),i&&g("div",{className:"orb-table-tool-group",children:[t.showCreateButton&&f(ct,{title:o("table.toolbar.newItem"),children:f(ie,{className:"orb-table-tool-button",onClick:t.onOpenCreateDialog,color:"primary.main",sx:po,children:f(Fr,{})})}),t.showEditButton&&f(ct,{title:o("table.toolbar.editItem"),children:f("span",{children:f(ie,{className:"orb-table-tool-button",onClick:t.onOpenEditDialog,color:"primary.main",disabled:!!t.editDisabled,sx:po,children:f(Qd,{})})})}),t.showDeleteButton&&f(ct,{title:o("table.toolbar.deleteItem"),children:f("span",{children:f(ie,{className:"orb-table-tool-button",onClick:t.onOpenDeleteConfirm,disabled:!!t.deleteDisabled,sx:{...po,color:"error.main"},children:f(ni,{})})})})]}),s&&g("div",{className:"orb-table-tool-group",children:[t.onOpenGraphReport&&f(ct,{title:o("table.toolbar.graphicReport"),children:f(ie,{className:"orb-table-tool-button",sx:po,onClick:t.onOpenGraphReport,children:f(Jd,{})})}),t.onLayoutSave&&!t.layoutManager&&f(ct,{title:o("table.toolbar.saveLayout"),children:f(ie,{className:"orb-table-tool-button",sx:po,onClick:l=>t.onLayoutSave(l),children:f(Sr,{})})}),t.layoutManager]})]})]})})};var bi=Object.freeze({Translate:{toString(t){if(!t)return;let{x:o,y:r}=t;return "translate3d("+(o?Math.round(o):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;let{scaleX:o,scaleY:r}=t;return "scaleX("+o+") scaleY("+r+")"}},Transform:{toString(t){if(t)return [bi.Translate.toString(t),bi.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:o,duration:r,easing:n}=t;return o+" "+r+"ms "+n}}});var vi=t=>{let{t:o}=ce(),{onSelectAllClick:r,order:n,orderBy:a,sortBy:i=[],numSelected:s=0,rowCount:l=0,onRequestSort:d,onContextMenu:p,columns:m,visibleColumns:h,selectionMode:f$1,grouping:u=[],isAllExpanded:b=false,handleToggleAll:C,onColumnResize:g$1,columnWidths:x,enableColumnReorder:v=false,disableSorting:y=false}=t,[k,w]=useState(null),P=useRef(null),I=V=>Q=>{y||k||d(V);},S=(V,Q,H)=>{V.preventDefault(),V.stopPropagation(),w(Q),P.current={startX:V.clientX,startWidth:H,colId:Q},document.addEventListener("mousemove",R),document.addEventListener("mouseup",N),document.body.style.cursor="col-resize";},R=V=>{if(!P.current)return;let{startX:Q,startWidth:H,colId:B}=P.current,q=V.clientX-Q,Z=Math.max(50,H+q);g$1&&g$1(B,Z);},N=()=>{w(null),P.current=null,document.removeEventListener("mousemove",R),document.removeEventListener("mouseup",N),document.body.style.cursor="";};useEffect(()=>()=>{document.removeEventListener("mousemove",R),document.removeEventListener("mouseup",N);},[]);let T=f$1==="multiple"||f$1==="single",M=u.length>0&&!!C,A=o(b?"table.group.collapseAll":"table.group.expandAll"),L=m.filter(V=>h.includes(V.id)),W=new Map(i.map((V,Q)=>[V.field,{...V,priority:Q+1}])),ee=L.map(V=>{let Q=x?.[V.id]||V.minWidth||100,H=W.get(V.id);return f($f,{headCell:V,width:typeof Q=="number"?Q:100,order:n,orderBy:a,multiSortInfo:y?void 0:H,onRequestSort:I(V.id),onContextMenu:p,onResizeMouseDown:B=>S(B,V.id,typeof Q=="number"?Q:100),enableColumnReorder:v,disableSorting:y},V.id)}),O=L.map(V=>V.id),_=g("tr",{children:[T&&f("th",{className:"orb-table-control-head",style:{width:56,minWidth:56,maxWidth:56},children:f(Tt,{color:"primary",indeterminate:s>0&&s<l,checked:l>0&&s===l,onChange:r,disabled:f$1==="single",sx:jn})}),M&&f("th",{className:"orb-table-control-head",style:{width:72,minWidth:72,maxWidth:72},children:f(ct,{title:A,children:f(ie,{size:"small",onClick:V=>{V.stopPropagation(),C?.(!b);},sx:Jn,children:b?f(pi,{}):f(ui,{})})})}),v?f(SortableContext,{items:O,strategy:horizontalListSortingStrategy,children:ee}):ee]});return f("thead",{children:_})},$f=({headCell:t,width:o,order:r,orderBy:n,multiSortInfo:a,onRequestSort:i,onContextMenu:s,onResizeMouseDown:l,enableColumnReorder:d,disableSorting:p})=>{let{setNodeRef:m,attributes:h,listeners:f$1,transform:u,transition:b,isDragging:C}=useSortable({id:t.id,disabled:!d}),g$1=d?{transform:bi.Transform.toString(u),transition:b,opacity:C?.6:1}:{},x=p?"asc":a?.direction??(n===t.id?r:"asc"),v=!p&&(!!a||n===t.id);return g("th",{ref:d?m:void 0,className:`orb-table-head-cell ${t.numeric?"orb-num":""} ${d?"orb-is-reorderable":""} ${C?"orb-is-dragging":""}`,"aria-sort":v?x==="asc"?"ascending":"descending":"none",onContextMenu:s?y=>s(y,t.id):void 0,style:{width:o,minWidth:o,maxWidth:o,...g$1},...d?h:{},...d?f$1:{},children:[p?f("span",{className:"orb-table-head-label",children:t.label}):f(Ad,{className:"orb-table-head-sort",active:v,direction:x,onClick:i,children:g("span",{className:"orb-table-head-label",children:[t.label,a&&f("span",{className:"orb-table-sort-priority",children:a.priority})]})}),f("div",{className:"orb-table-resize-handle",onMouseDown:l,onPointerDown:y=>y.stopPropagation(),onClick:y=>y.stopPropagation()})]})};var yi=t=>{let{t:o}=ce(),{visibleRows:r,visibleColumns:n,selected:a=[],handleClick:i,columns:s,toggleGroupExpand:l,expandedGroups:d=new Set,selectionMode:p,grouping:m=[],isGroupFullyExpanded:h,handleExpandGroupRecursively:f$1,handleCollapseGroupRecursively:u,emptyLabel:b,getRowDataKey:C,getRowProps:g$1,getGroupRowProps:x}=t,v=P=>a.indexOf(P)!==-1,y=p==="multiple"||p==="single",k=m.length>0,w=n.length+(y?1:0)+(k?1:0);return g("tbody",{children:[r.map((P,I)=>{if(P.type==="group"){let S=d.has(P.id),R=P.childIds||[],N=R.filter(V=>v(V)).length,T=R.length>0&&N===R.length,M=N>0&&N<R.length,A={entry:P,data:P,id:P.id,index:I,selected:T,group:true},L=x?.(A)||{},{className:W,onClick:ee,...O}=L,_=V=>{if(V.stopPropagation(),!!t.onSelectionChange)if(T){let Q=a.filter(H=>!R.includes(H));t.onSelectionChange(Q);}else {let Q=Array.from(new Set([...a,...R]));t.onSelectionChange(Q);}};return g("tr",{...O,"data-ctable-row-key":C?.(A),className:["orb-table-group-row",W].filter(Boolean).join(" "),onClick:ee,sx:V=>({backgroundColor:"var(--orb-surface)","& th, & td":{color:V.palette.text.primary,borderBottomColor:V.palette.divider},"& .orb-icon-btn":{color:V.palette.text.primary},"& .orb-chk":{color:V.palette.text.secondary},"& .orb-chk:has(input:checked), & .orb-chk:has(input:indeterminate)":{color:V.palette.primary.main}}),children:[y&&f("td",{padding:"checkbox",sx:cl,children:f(Tt,{size:"small",checked:T,indeterminate:M,onChange:_,onClick:V=>V.stopPropagation(),sx:jn})}),k&&f("td",{padding:"checkbox",sx:dl,children:g("div",{sx:Sp,children:[m.length>1&&P.level<m.length-1&&f(ct,{title:h?.(P.id)?o("table.group.collapseAll"):o("table.group.expandAll"),children:f(ie,{size:"small",onClick:()=>{h?.(P.id)?u?.(P.id):f$1?.(P.id);},sx:Jn,children:h?.(P.id)?f(pi,{}):f(ui,{})})}),f(ie,{size:"small",onClick:()=>l&&l(P.id),sx:Jn,children:S?f(Wo,{}):f(wr,{})})]})}),f("td",{colSpan:n.length,sx:{py:1,pl:P.level*3+1},children:g(E,{variant:"body2",fontWeight:"bold",color:"text.primary",sx:{fontSize:"0.85rem"},children:[P.field,": ",P.value," (",P.count,")"]})})]},P.id)}else {let S=P.data||P,R=P.id||S.id||I,N=v(R),T=`enhanced-table-checkbox-${I}`,M={entry:P,data:S,id:R,index:I,selected:N,group:false},A=g$1?.(M)||{},{className:L,onClick:W,...ee}=A,_=(P.level!==void 0?P.level:0)*4;return g("tr",{...ee,"data-ctable-row-key":C?.(M),className:[N?"orb-is-selected":"",L].filter(Boolean).join(" "),onClick:V=>{W?.(V),V.defaultPrevented||i?.(V,S);},role:y?"checkbox":ee.role,"aria-checked":y?N:ee["aria-checked"],tabIndex:ee.tabIndex??-1,children:[y&&f("td",{padding:"checkbox",sx:cl,children:f(Tt,{color:"primary",checked:N,inputProps:{"aria-labelledby":T},sx:jn})}),k&&f("td",{padding:"checkbox",sx:dl}),s.filter(V=>n.includes(V.id)).map((V,Q)=>{let B=Q===0&&_>0?{pl:_+2}:{};return f("td",{className:V.numeric?"orb-num":void 0,align:V.numeric?"right":"left",sx:B,children:V.render?V.render(S[V.id],S):(function(){let Z=S[V.id];if(V.numeric){if(typeof Z=="number")return Z.toLocaleString();if(typeof Z=="string"&&Z.trim()!==""&&!isNaN(Number(Z)))return Number(Z).toLocaleString()}return Z})()},V.id)})]},R)}}),r.length===0&&f("tr",{children:f("td",{colSpan:w,align:"center",children:b??o("common.noData")})})]})};var kp=t=>{let{columns:o=[],visibleColumns:r,summaryRow:n,selectionMode:a,grouping:i=[],columnWidths:s={}}=t;if(!t.showSummary)return null;let l=a==="multiple"||a==="single",d=i.length>0,p=o.filter(m=>r.includes(m.id));return f("tfoot",{className:"orb-table-footer",style:{zIndex:t.zIndex},children:g("tr",{children:[l&&f("td",{className:"orb-table-footer-control",style:{width:56,minWidth:56,maxWidth:56}}),d&&f("td",{className:"orb-table-footer-control",style:{width:72,minWidth:72,maxWidth:72}}),p.map(m=>f("td",{className:`orb-table-footer-cell ${m.numeric?"orb-num":""}`,style:{width:s[m.id]||m.minWidth||100,minWidth:s[m.id]||m.minWidth||100,maxWidth:s[m.id]||m.minWidth||100},children:(function(){let f=n[m.id];return f==null||f===""?"":typeof f=="number"?f.toLocaleString():typeof f=="string"&&f.trim()!==""&&!isNaN(Number(f))?Number(f).toLocaleString():f})()},m.id))]})})};var Pp=t=>{let{t:o}=ce();return f("div",{sx:{p:2},children:f(E,{children:o("table.mobile.notImplemented")})})};var cn=({groupAnchorEl:t,setGroupAnchorEl:o,grouping:r,setGrouping:n,columns:a})=>{let{t:i}=ce(),[s,l]=useState(r);useEffect(()=>{t&&l(r);},[t,r]);let d=()=>{l(r),o(null);},p=h=>{l(f=>f.includes(h)?f.filter(u=>u!==h):[...f,h]);},m=()=>{n(s),o(null);};return g(Qt,{anchorEl:t,open:!!t,onClose:d,sx:{width:224,minWidth:224,maxHeight:360,overflowY:"auto"},children:[g("div",{className:"orb-table-group-menu-header",onClick:h=>h.stopPropagation(),children:[f(E,{className:"orb-table-group-menu-title",variant:"subtitle2",children:i("table.menu.groupBy")}),s.length>0&&f(Pe,{className:"orb-table-group-menu-clear",size:"small",color:"error",onClick:h=>{h.stopPropagation(),l([]);},children:i("table.menu.clearAll")})]}),f(Rt,{className:"orb-table-group-menu-divider"}),a.map(h=>{let f$1=s.includes(h.id),u=s.indexOf(h.id)+1;return f("option",{className:"orb-table-group-menu-option",selected:f$1,onClick:b=>{b.stopPropagation(),p(h.id);},children:g("div",{className:"orb-table-group-menu-option-content",children:[f(Tt,{className:"orb-table-group-menu-checkbox",checked:f$1,size:"small"}),f(_t,{className:"orb-table-group-menu-label",primary:h.label}),f$1&&f("span",{className:"orb-table-group-menu-order","aria-label":`${i("table.menu.groupBy")} ${u}`,children:u})]})},h.id)}),g("div",{className:"orb-table-group-menu-footer",children:[f(Pe,{size:"small",variant:"ghost",onClick:d,children:i("common.cancel")}),f(Pe,{size:"small",variant:"primary",onClick:m,children:i("common.ok")})]})]})},dn=({anchorEl:t,setAnchorEl:o,columns:r,visibleColumns:n,toggleColumnVisibility:a})=>{let{t:i}=ce();return g(Qt,{anchorEl:t,open:!!t,onClose:()=>o(null),children:[f("option",{disabled:true,children:f(_t,{primary:i("table.menu.visibleColumns")})}),f(Rt,{}),r.map(s=>g("option",{onClick:()=>a(s.id),children:[f(Tt,{checked:n.includes(s.id),size:"small"}),f(_t,{primary:s.label})]},s.id))]})},Ci=({anchorEl:t,setAnchorEl:o,showSummary:r,setShowSummary:n,columns:a,summaryColumns:i,toggleSummaryColumn:s})=>{let{t:l}=ce();return g(Qt,{anchorEl:t,open:!!t,onClose:()=>o(null),children:[f("option",{children:f(Qn,{control:f(ti,{checked:r,onChange:d=>n(d.target.checked),size:"small"}),label:l("table.menu.showSummaryRow")})}),f(Rt,{}),a.filter(d=>d.numeric).map(d=>g("option",{onClick:()=>s(d.id),disabled:!r,children:[f(Tt,{checked:i.includes(d.id),size:"small"}),f(_t,{primary:d.label})]},d.id)),a.filter(d=>d.numeric).length===0&&f("option",{disabled:true,children:f(_t,{primary:l("table.menu.noNumericColumns")})})]})},xi=({contextMenu:t,handleCloseContextMenu:o,columns:r,visibleColumns:n,toggleColumnVisibility:a})=>{let{t:i}=ce();return g(Qt,{open:t!==null,onClose:o,anchorReference:"anchorPosition",anchorPosition:t!==null?{top:t.mouseY,left:t.mouseX}:void 0,children:[f("option",{onClick:o,children:i("common.copy")}),f(Rt,{}),f("option",{disabled:true,children:i("table.menu.visibleColumns")}),r.map(s=>g("option",{onClick:()=>a(s.id),children:[f(Vo,{children:n.includes(s.id)&&f(Gd,{fontSize:"small"})}),f(_t,{children:s.label})]},s.id))]})},Rp=({contextMenu:t,handleClose:o,columns:r,visibleColumns:n,grouping:a,summaryColumns:i,showSummary:s,sortBy:l,orderBy:d,order:p,onSortAsc:m,onSortDesc:h,onClearSort:f$1,onHideColumn:u,onToggleGroup:b,onToggleSummary:C,onOpenSortDialog:g$1})=>{let{t:x}=ce(),v=t?.columnId??"",y=r.find(T=>T.id===v),k=a.includes(v),w=i.includes(v),P=!!y?.numeric,I=l.find(T=>T.field===v),S=I?I.direction==="asc":d===v&&p==="asc",R=I?I.direction==="desc":d===v&&p==="desc",N=S||R;return g(Qt,{open:t!==null,onClose:o,anchorReference:"anchorPosition",anchorPosition:t!==null?{top:t.mouseY,left:t.mouseX}:void 0,children:[f("option",{disabled:true,sx:{opacity:"1 !important",fontWeight:700},children:f(_t,{primary:y?.label??v})}),f(Rt,{}),g("option",{onClick:()=>{m(v),o();},selected:S,children:[f(Vo,{children:f(il,{fontSize:"small"})}),f(_t,{primary:x("table.headerMenu.sortAsc")})]}),g("option",{onClick:()=>{h(v),o();},selected:R,children:[f(Vo,{children:f(al,{fontSize:"small"})}),f(_t,{primary:x("table.headerMenu.sortDesc")})]}),N&&g("option",{onClick:()=>{f$1(v),o();},children:[f(Vo,{children:f(Kd,{fontSize:"small"})}),f(_t,{primary:x("table.headerMenu.clearSort")})]}),g("option",{onClick:()=>{g$1(),o();},children:[f(Vo,{children:f(Fr,{fontSize:"small"})}),f(_t,{primary:x("table.headerMenu.configureSort")})]}),f(Rt,{}),g("option",{onClick:()=>{b(v),o();},selected:k,children:[f(Vo,{children:f(Cr,{fontSize:"small"})}),f(_t,{primary:x(k?"table.headerMenu.ungroup":"table.headerMenu.group")})]}),P&&s&&g("option",{onClick:()=>{C(v),o();},selected:w,children:[f(Vo,{children:f(nn,{fontSize:"small"})}),f(_t,{primary:x(w?"table.headerMenu.removeSummary":"table.headerMenu.addSummary")})]}),f(Rt,{}),g("option",{onClick:()=>{u(v),o();},children:[f(Vo,{children:f(bp,{fontSize:"small"})}),f(_t,{primary:x("table.headerMenu.hideColumn")})]})]})},Dp=({open:t,onClose:o,columns:r,initialRules:n,onApply:a,onClear:i})=>{let{t:s}=ce(),[l,d]=useState([]);useEffect(()=>{t&&d(n.length>0?n.map(C=>({...C})):[]);},[t,n]);let p=useMemo(()=>new Set(l.map(C=>C.field)),[l]),m=useMemo(()=>r.filter(C=>!p.has(C.id)),[r,p]),h=()=>{let C=m[0];C&&d(g=>[...g,{field:C.id,direction:"asc"}]);},f$1=C=>{d(g=>g.filter((x,v)=>v!==C));},u=(C,g)=>{d(x=>x.map((v,y)=>y===C?{...v,...g}:v));},b=(C,g)=>{d(x=>{let v=C+g;if(v<0||v>=x.length)return x;let y=[...x],[k]=y.splice(C,1);return y.splice(v,0,k),y});};return f(Lt,{open:t,onClose:o,maxWidth:620,fullWidth:true,className:"orb-table-sort-dialog",title:s("table.sortDialog.title"),actions:g(e,{children:[f(Pe,{className:"orb-table-sort-clear",variant:"neutral",disabled:l.length===0&&n.length===0,onClick:()=>{i(),o();},children:s("table.sortDialog.clearAll")}),f("span",{className:"orb-table-sort-action-spacer"}),f(Pe,{variant:"neutral",onClick:o,children:s("common.cancel")}),f(Pe,{variant:"primary",onClick:()=>{a(l),o();},children:s("common.ok")})]}),children:g("div",{className:"orb-table-sort-dialog-content",children:[l.length===0?f(E,{className:"orb-table-sort-empty",variant:"body2",children:s("table.sortDialog.empty")}):f(se,{className:"orb-table-sort-rules",spacing:1,children:l.map((C,g$1)=>{let x=new Set(l.filter((y,k)=>k!==g$1).map(y=>y.field)),v=r.filter(y=>!x.has(y.id));return g("div",{className:"orb-table-sort-rule",children:[f(ei,{className:"orb-table-sort-order",badgeContent:g$1+1,color:"primary"}),f(zt,{size:"small",value:C.field,onChange:y=>u(g$1,{field:y.target.value}),options:v.map(y=>({value:y.id,label:y.label}))}),f(zt,{size:"small",value:C.direction,onChange:y=>u(g$1,{direction:y.target.value}),options:[{value:"asc",label:s("table.sortDialog.asc")},{value:"desc",label:s("table.sortDialog.desc")}]}),f(ie,{className:"orb-table-sort-icon-button",size:"small",onClick:()=>b(g$1,-1),disabled:g$1===0,children:f(il,{fontSize:"small"})}),f(ie,{className:"orb-table-sort-icon-button",size:"small",onClick:()=>b(g$1,1),disabled:g$1===l.length-1,children:f(al,{fontSize:"small"})}),f(ie,{className:"orb-table-sort-icon-button orb-table-sort-delete",size:"small",onClick:()=>f$1(g$1),children:f(ai,{fontSize:"small"})})]},`sort-rule-${g$1}`)})}),f(Pe,{size:"small",onClick:h,disabled:m.length===0,startIcon:f(Fr,{}),variant:"secondary",className:"orb-table-sort-add",children:s("table.sortDialog.addRule")})]})})};var ea=(t,o=2)=>t.toLocaleString(void 0,{maximumFractionDigits:o}),Np=({kpis:t})=>{let{t:o}=ce(),r=[{label:o("graph.kpi.totalRecords"),value:ea(t.totalRecords,0),color:"var(--orb-fg)"},{label:o("graph.kpi.totalReport"),value:ea(t.totalReportHours),color:"var(--orb-fg)"},{label:o("graph.kpi.totalBillable"),value:ea(t.totalBillableHours),color:"var(--orb-primary)"},{label:o("graph.kpi.efficiency"),value:`${t.efficiency.toFixed(2)}%`,color:"var(--orb-accent)"},{label:o("graph.kpi.amount"),value:ea(t.totalAmount),color:"var(--orb-primary)"},{label:o("graph.kpi.flagged"),value:ea(t.flaggedCount,0),color:"var(--orb-err)"}];return f("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(140px, 1fr))",gap:12},children:r.map(n=>g(Ne,{elevation:0,sx:{padding:12,minHeight:96,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[f(E,{variant:"caption",muted:true,children:n.label}),f(E,{variant:"h3",sx:{fontWeight:800,color:n.color,fontVariantNumeric:"tabular-nums"},children:n.value})]},n.label))})};var wi=({title:t,subtitle:o,children:r})=>g(Ne,{elevation:0,sx:{padding:16},children:[f(E,{variant:"h4",sx:{fontWeight:700},children:t}),o&&f(E,{variant:"body2",muted:true,sx:{marginBottom:16},children:o}),r]});var ta=({data:t,orientation:o="horizontal",valueSuffix:r="",minHeight:n=210,activeName:a,onItemClick:i})=>{if(t.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let s=Math.max(...t.map(l=>l.value),1);return o==="vertical"?f("div",{style:{display:"flex",gap:1,alignItems:"flex-end",minHeight:n},children:t.map(l=>g("div",{style:{flex:1,minWidth:0},children:[f("div",{onClick:()=>i?.(l),sx:{height:`${Math.max(l.value/s*180,6)}px`,background:l.name===a?"primary.dark":"primary.main",borderRadius:"8px 8px 0 0",cursor:i?"pointer":"default",opacity:a&&l.name!==a?.45:1}}),f(E,{variant:"caption",title:l.name,sx:{display:"block",mt:.5},children:l.name}),g(E,{variant:"caption",muted:true,children:[l.value.toFixed(1),r]})]},l.name))}):f(se,{spacing:1,children:t.map(l=>g("div",{style:{display:"grid",gridTemplateColumns:"140px 1fr 64px",gap:1},children:[f(E,{variant:"caption",muted:true,title:l.name,children:l.name}),f("div",{onClick:()=>i?.(l),sx:{alignSelf:"center",background:"action.hover",height:10,borderRadius:999,overflow:"hidden",cursor:i?"pointer":"default",opacity:a&&l.name!==a?.45:1},children:f("div",{style:{width:`${l.value/s*100}%`,height:"100%",background:l.name===a?"primary.dark":"primary.main"}})}),g(E,{variant:"caption",sx:{textAlign:"right",fontWeight:600},children:[l.value.toFixed(1),r]})]},l.name))})};var Ap=({data:t,color:o="var(--orb-chart-1)",valueSuffix:r="",height:n=220})=>{if(t.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let a=640,i=28,s=t.map(f=>f.value),l=Math.min(...s,0),p=Math.max(...s,1)-l||1,m=t.map((f,u)=>{let b=i+u*(a-i*2)/Math.max(t.length-1,1),C=n-i-(f.value-l)/p*(n-i*2);return {x:b,y:C,...f}}),h=m.map(f=>`${f.x},${f.y}`).join(" ");return g("div",{children:[g("div",{component:"svg",viewBox:`0 0 ${a} ${n}`,style:{width:"100%",height:n},children:[f("line",{x1:i,y1:n-i,x2:a-i,y2:n-i,style:{stroke:"var(--orb-chart-grid)"}}),f("polyline",{fill:"none",style:{stroke:o},strokeWidth:3,points:h}),m.map(f$1=>f("circle",{cx:f$1.x,cy:f$1.y,r:4,style:{fill:o}},f$1.name))]}),f("div",{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`,gap:1},children:t.map(f$1=>g("div",{style:{minWidth:0},children:[f(E,{variant:"caption",title:f$1.name,sx:{display:"block"},children:f$1.name}),g(E,{variant:"caption",muted:true,children:[f$1.value.toFixed(1),r]})]},f$1.name))})]})};var Ep=({data:t,barColor:o="var(--orb-chart-1)",lineColor:r="var(--orb-chart-5)",height:n=220})=>{if(t.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let a=640,i=28,s=Math.max(...t.map(m=>m.barValue),1),l=Math.max(...t.map(m=>m.lineValue),1),d=t.map((m,h)=>{let f=(a-i*2)/t.length,u=Math.max(f*.5,8),b=i+h*f+(f-u)/2,C=m.barValue/s*(n-i*2),g=n-i-C;return {x:b,y:g,barHeight:C,barWidth:u,item:m}}),p=t.map((m,h)=>{let f=(a-i*2)/t.length,u=i+h*f+f/2,b=n-i-m.lineValue/l*(n-i*2);return {x:u,y:b,item:m}});return g(se,{spacing:1.25,children:[g("div",{component:"svg",viewBox:`0 0 ${a} ${n}`,style:{width:"100%",height:n},children:[f("line",{x1:i,y1:n-i,x2:a-i,y2:n-i,style:{stroke:"var(--orb-chart-grid)"}}),d.map(m=>f("rect",{x:m.x,y:m.y,width:m.barWidth,height:Math.max(m.barHeight,4),rx:6,style:{fill:o}},m.item.name)),f("polyline",{fill:"none",style:{stroke:r},strokeWidth:3,points:p.map(m=>`${m.x},${m.y}`).join(" ")}),p.map(m=>f("circle",{cx:m.x,cy:m.y,r:3.5,style:{fill:r}},`${m.item.name}-line`))]}),f("div",{style:{display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`,gap:1},children:t.map(m=>g("div",{style:{minWidth:0},children:[f(E,{variant:"caption",title:m.name,sx:{display:"block"},children:m.name}),g(E,{variant:"caption",muted:true,sx:{display:"block"},children:["Bar: ",m.barValue.toFixed(1)]}),g(E,{variant:"caption",muted:true,sx:{display:"block"},children:["Line: ",m.lineValue.toFixed(1)]})]},m.name))})]})};var _f=t=>{let r=.2+Math.max(0,Math.min(1,t))*.8;return `color-mix(in oklch, var(--orb-chart-1) ${Math.round(r*100)}%, transparent)`},Lp=({data:t})=>{if(t.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let o=Array.from(new Set(t.map(i=>i.x))),r=Array.from(new Set(t.map(i=>i.y))),n=Math.max(...t.map(i=>i.value),1),a=new Map(t.map(i=>[`${i.y}__${i.x}`,i.value]));return f("div",{style:{overflowX:"auto"},children:g("div",{style:{display:"grid",gridTemplateColumns:`120px repeat(${o.length}, minmax(64px, 1fr))`,gap:1,minWidth:120+o.length*64},children:[f("div",{}),o.map(i=>f(E,{variant:"caption",sx:{textAlign:"center",fontWeight:600},children:i},i)),r.map(i=>g("div",{style:{display:"contents"},children:[f(E,{variant:"caption",sx:{alignSelf:"center"},children:i}),o.map(s=>{let l=a.get(`${i}__${s}`)||0,d=l/n;return f("div",{sx:{height:36,borderRadius:1,background:_f(d),border:"1px solid color-mix(in oklch, var(--orb-muted) 20%, transparent)",display:"flex",alignItems:"center",justifyContent:"center"},children:f(E,{variant:"caption",sx:{fontWeight:700},children:l.toFixed(1)})},`${i}-${s}`)})]},i))]})})};var Gf=["var(--orb-chart-1)","var(--orb-chart-2)","var(--orb-chart-5)","var(--orb-chart-negative)","var(--orb-chart-4)","var(--orb-chart-3)"],Si=({data:t,variant:o="donut",colors:r=Gf,size:n=180,activeName:a,onItemClick:i})=>{if(t.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let s=0,l=t.map((d,p)=>{let m=s;return s+=d.percent,`${r[p%r.length]} ${m}% ${s}%`});return g(se,{direction:{xs:"column",sm:"row"},spacing:2,alignItems:"center",children:[f("div",{style:{width:n,height:n,borderRadius:"50%",background:`conic-gradient(${l.join(", ")})`,position:"relative",flexShrink:0},children:o==="donut"&&f("div",{style:{position:"absolute",inset:Math.round(n*.18),background:"background.paper",borderRadius:"50%"}})}),f(se,{spacing:1,sx:{minWidth:180},children:t.map((d,p)=>g("div",{onClick:()=>i?.(d),sx:{display:"flex",alignItems:"center",gap:1,cursor:i?"pointer":"default",opacity:a&&d.name!==a?.45:1},children:[f("div",{style:{width:10,height:10,borderRadius:"50%",background:r[p%r.length]}}),f(E,{variant:"caption",sx:{flex:1},children:d.name}),g(E,{variant:"caption",sx:{fontWeight:700},children:[d.percent.toFixed(0),"%"]})]},d.name))})]})};var Op=({effect:t,branches:o})=>{if(o.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let r=o.filter((a,i)=>i%2===0),n=o.filter((a,i)=>i%2===1);return g(se,{spacing:1.5,children:[f("div",{style:{display:"grid",gridTemplateColumns:`repeat(${Math.max(r.length,1)}, minmax(0, 1fr))`,gap:1},children:r.map(a=>g("div",{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[f(E,{variant:"caption",sx:{fontWeight:700},children:a.title}),a.causes.map(i=>f(E,{variant:"caption",muted:true,sx:{display:"block"},children:i},i))]},a.title))}),g("div",{style:{position:"relative",height:32},children:[f("div",{style:{position:"absolute",inset:"50% 0 auto 0",borderTop:"2px solid",borderColor:"primary.main"}}),f("div",{sx:{position:"absolute",right:0,top:"calc(50% - 12px)",px:1,py:.25,borderRadius:1,background:"primary.main",color:"primary.contrastText"},children:f(E,{variant:"caption",sx:{fontWeight:700},children:t})})]}),f("div",{style:{display:"grid",gridTemplateColumns:`repeat(${Math.max(n.length,1)}, minmax(0, 1fr))`,gap:1},children:n.map(a=>g("div",{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[f(E,{variant:"caption",sx:{fontWeight:700},children:a.title}),a.causes.map(i=>f(E,{variant:"caption",muted:true,sx:{display:"block"},children:i},i))]},a.title))})]})};var Fp=({data:t,height:o=240})=>{if(t.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let r=0,n=t.map(h=>{let f=h.type==="total"?0:r,u=h.type==="total"?h.value:r+h.value;return h.type!=="total"&&(r=u),{...h,start:f,end:u,delta:u-f}}),a=n.flatMap(h=>[h.start,h.end]),i=Math.min(...a,0),s=Math.max(...a,1),l=680,d=30,p=s-i||1,m=h=>o-d-(h-i)/p*(o-d*2);return g("div",{children:[g("div",{component:"svg",viewBox:`0 0 ${l} ${o}`,style:{width:"100%",height:o},children:[f("line",{x1:d,y1:m(0),x2:l-d,y2:m(0),style:{stroke:"var(--orb-chart-grid)"}}),n.map((h,f$1)=>{let u=(l-d*2)/n.length,b=Math.max(u*.55,8),C=d+f$1*u+(u-b)/2,g$1=m(Math.max(h.start,h.end)),x=m(Math.min(h.start,h.end)),v=h.type==="total"?"var(--orb-chart-1)":h.delta>=0?"var(--orb-chart-positive)":"var(--orb-chart-negative)";return g("g",{children:[f("rect",{x:C,y:g$1,width:b,height:Math.max(x-g$1,4),rx:6,style:{fill:v}}),f("text",{x:C+b/2,y:g$1-6,textAnchor:"middle",fill:"currentColor",fontSize:"11",children:h.end.toFixed(1)})]},h.name)})]}),f("div",{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${n.length}, minmax(0, 1fr))`,gap:1},children:n.map(h=>f(E,{variant:"caption",title:h.name,children:h.name},h.name))})]})};var oa=({apiKey:t,query:o,zoom:r=14,mapType:n="roadmap"})=>{let a=encodeURIComponent(o);return `https://www.google.com/maps/embed/v1/place?key=${encodeURIComponent(t)}&q=${a}&zoom=${r}&maptype=${n}`},aR=(t,o=360)=>{let r=oa(t);return `<iframe width="100%" height="${o}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${r}"></iframe>`};var Bp=({apiKey:t,query:o,embedUrl:r,zoom:n=14,mapType:a="roadmap",height:i=320})=>{let s=r||(t&&o?oa({apiKey:t,query:o,zoom:n,mapType:a}):"");return s?g("div",{children:[f("div",{component:"iframe",src:s,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:i,border:0,borderRadius:2}}),g(E,{variant:"caption",muted:true,sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",f("a",{href:s,target:"_blank",rel:"noreferrer",children:"Google Maps"})]})]}):f("div",{children:f(E,{variant:"body2",muted:true,children:"Google Map requires `embedUrl` or (`apiKey` + `query`)."})})};var ki=({keyword:t,location:o,src:r="orbcafe-ui"})=>{if(o){let n=encodeURIComponent(o.name||t||"Location");return `https://uri.amap.com/marker?position=${o.lng},${o.lat}&name=${n}&src=${encodeURIComponent(r)}&coordinate=gaode&callnative=0`}return t?`https://uri.amap.com/search?keyword=${encodeURIComponent(t)}&src=${encodeURIComponent(r)}&callnative=0`:"https://uri.amap.com/search?keyword=%E5%8C%97%E4%BA%AC&src=orbcafe-ui&callnative=0"};var Hp=({keyword:t,location:o,embedUrl:r,height:n=320})=>{let a=r||ki({keyword:t,location:o?{lng:o.lng,lat:o.lat,name:o.name}:void 0});return g("div",{children:[f("div",{component:"iframe",src:a,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:n,border:0,borderRadius:2}}),g(E,{variant:"caption",muted:true,sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",f("a",{href:a,target:"_blank",rel:"noreferrer",children:"AMap"})]})]})};var zp=({billableByPrimary:t,efficiencyBySecondary:o,statusDistribution:r,interaction:n})=>{let{t:a}=ce();return g("div",{style:{display:"grid",gap:12,gridTemplateColumns:"repeat(auto-fit, minmax(320px, 1fr))"},children:[f(wi,{title:a("graph.chart.billable.title"),subtitle:a("graph.chart.billable.subtitle"),children:f(ta,{data:t,orientation:"horizontal",activeName:n?.filters?.primaryDimension,onItemClick:i=>n?.onPrimaryDimensionClick?.(i.name)})}),f(wi,{title:a("graph.chart.efficiency.title"),subtitle:a("graph.chart.efficiency.subtitle"),children:f(ta,{data:o,orientation:"vertical",valueSuffix:"%",activeName:n?.filters?.secondaryDimension,onItemClick:i=>n?.onSecondaryDimensionClick?.(i.name)})}),f(wi,{title:a("graph.chart.status.title"),subtitle:a("graph.chart.status.subtitle"),children:f(Si,{data:r,variant:"donut",activeName:n?.filters?.status,onItemClick:i=>n?.onStatusClick?.(i.name)})})]})};var Kf=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],qf=["zh","en","de","fr","ja","ko"],Vp=({open:t,onClose:o,value:r,onSaveAll:n,modelOptions:a=Kf,promptLangOptions:i=qf,analysisTemplateOptions:s=[],responseTemplateOptions:l=[],defaultAnalysisTemplateId:d,defaultResponseTemplateId:p})=>{let[m,h]=useState(r),[f$1,u]=useState(d||""),[b,C]=useState(p||""),[g$1,x]=useState(false);useEffect(()=>{t&&(h(r),u(d||""),C(p||""));},[t,r,d,p]);let v=(k,w)=>{h(P=>({...P,[k]:w}));},y=async()=>{if(n)try{x(!0),await n({settings:m,analysisTemplateId:f$1||void 0,responseTemplateId:b||void 0});}finally{x(false);}};return g(Lt,{open:t,onClose:o,fullWidth:true,maxWidth:"lg",children:[g("div",{className:"orb-dialog-title",sx:{pr:7,pb:2.2},children:[f(E,{variant:"h5",sx:{fontWeight:800},children:"AI Settings"}),f(E,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:"Configure LLM settings and editable agent prompts by language."}),f(ie,{onClick:o,sx:{position:"absolute",right:12,top:12},children:f(xr,{})})]}),f("div",{className:"orb-dialog-content",sx:{pt:"18px !important"},children:g(se,{spacing:2.2,children:[g("div",{sx:{mt:.8,display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",md:"repeat(2, minmax(0, 1fr))"}},children:[f("div",{children:f(He,{size:"small",value:m.baseUrl,onChange:k=>v("baseUrl",k.target.value),fullWidth:true,label:"Base URL"})}),f("div",{children:f(He,{size:"small",type:"password",value:m.apiKey,onChange:k=>v("apiKey",k.target.value),fullWidth:true,label:"API Key"})}),f("div",{children:f(He,{size:"small",value:m.model,onChange:k=>v("model",k.target.value),fullWidth:true,select:true,label:"Model",children:a.map(k=>f("option",{value:k,children:k},k))})}),f("div",{children:f(He,{size:"small",value:m.promptLang,onChange:k=>v("promptLang",k.target.value),fullWidth:true,select:true,label:"Prompt Lang",children:i.map(k=>f("option",{value:k,children:k},k))})})]}),g("div",{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[g(He,{size:"small",value:f$1,onChange:k=>u(k.target.value),fullWidth:true,select:true,label:"Analysis Template",children:[f("option",{value:"",children:"Default"}),s.map(k=>f("option",{value:k.id,children:k.label},k.id))]}),f(Vn,{multiline:true,minRows:8,value:m.analysisPrompt,onChange:k=>v("analysisPrompt",k.target.value),fullWidth:true,label:"Analysis Prompt",sx:{"& textarea":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}}),g(He,{size:"small",value:b,onChange:k=>C(k.target.value),fullWidth:true,select:true,label:"Response Template",children:[f("option",{value:"",children:"Default"}),l.map(k=>f("option",{value:k.id,children:k.label},k.id))]}),f(Vn,{multiline:true,minRows:8,value:m.responsePrompt,onChange:k=>v("responsePrompt",k.target.value),fullWidth:true,label:"Response Prompt",sx:{"& textarea":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}})]})]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2.5,pt:1.2,gap:1},children:[f(Pe,{variant:"outlined",onClick:o,children:"Cancel"}),f(Pe,{variant:"contained",onClick:y,disabled:!n||g$1,children:"Save"})]})]})};var Ti=({open:t,onClose:o,model:r,tableContent:n,extraCharts:a,interaction:i,aiAssistant:s})=>{let{t:l}=ce(),[d,p]=useState(s?.defaultPrompt||""),[m,h]=useState(false),[f$1,u]=useState(false),b=i?.enabled!==false&&!!i,C=s?.enabled!==false,g$1=i?.filters||{},x=!!(g$1.primaryDimension||g$1.secondaryDimension||g$1.status),v=s?.placeholder||"Ask AI to analyze data, create charts, or find insights...";useEffect(()=>{t&&p(s?.defaultPrompt||"");},[t,s?.defaultPrompt]);let y=s?.settings||{baseUrl:"/llm-api",apiKey:"",model:"doubao-lite",promptLang:"zh",analysisPrompt:"",responsePrompt:""},k=async()=>{let w=d.trim();if(!(!w||!s?.onSubmit))try{h(!0),await s.onSubmit(w,{filters:g$1,model:r});}finally{h(false);}};return f(Lt,{open:t,onClose:o,fullWidth:true,maxWidth:1400,hideCloseButton:true,children:g("div",{style:{height:"80vh",display:"flex",flexDirection:"column",background:"var(--orb-canvas)"},children:[f("div",{style:{padding:16,borderBottom:"1px solid var(--orb-border)"},children:g(se,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:12,children:[g(se,{direction:"row",spacing:10,alignItems:"center",sx:{flexWrap:"wrap"},children:[f(E,{variant:"h3",sx:{fontWeight:800},children:r.title}),f(Ct,{label:l("graph.records",{count:r.kpis.totalRecords})}),b&&g$1.primaryDimension&&f(Ct,{tone:"outline",label:`${i?.fieldMapping.primaryDimension}: ${g$1.primaryDimension}`,onDelete:()=>i?.onClearFilter("primaryDimension")}),b&&g$1.secondaryDimension&&f(Ct,{tone:"outline",label:`${i?.fieldMapping.secondaryDimension}: ${g$1.secondaryDimension}`,onDelete:()=>i?.onClearFilter("secondaryDimension")}),b&&g$1.status&&f(Ct,{tone:"outline",label:`${i?.fieldMapping.status}: ${g$1.status}`,onDelete:()=>i?.onClearFilter("status")}),b&&x&&f(Pe,{size:"small",variant:"ghost",onClick:()=>i?.onClearAll(),children:"Clear"})]}),g(se,{direction:"row",spacing:10,alignItems:"center",children:[C&&g("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 10px",borderRadius:999,border:"1px solid var(--orb-border)",background:"var(--orb-surface)",minWidth:320},children:[f(ie,{size:"small",onClick:s?.onVoiceInput,children:f(Oa,{size:16,strokeWidth:1.8})}),f("input",{className:"orb-inp orb-inp-dense",value:d,onChange:w=>p(w.target.value),onKeyDown:w=>{w.key==="Enter"&&(w.preventDefault(),k());},placeholder:v,style:{fontSize:14,border:"none",background:"transparent",flex:1,minWidth:0}}),f(ie,{size:"small",onClick:k,disabled:m||!d.trim(),children:f(Xc,{size:16,strokeWidth:1.8})}),f(ie,{size:"small",onClick:()=>u(true),children:f(Jr,{size:16,strokeWidth:1.8})})]}),f(ie,{onClick:o,children:f(Kt,{size:18,strokeWidth:2})})]})]})}),g("div",{style:{padding:16,display:"flex",flexDirection:"column",gap:12,overflow:"auto",minHeight:0},children:[f(Np,{kpis:r.kpis}),f(zp,{billableByPrimary:r.charts.billableByPrimary,efficiencyBySecondary:r.charts.efficiencyBySecondary,statusDistribution:r.charts.statusDistribution,interaction:b?{filters:g$1,onPrimaryDimensionClick:w=>i?.onPrimaryDimensionClick(w),onSecondaryDimensionClick:w=>i?.onSecondaryDimensionClick(w),onStatusClick:w=>i?.onStatusClick(w)}:void 0}),a,n]}),f(Vp,{open:f$1,onClose:()=>u(false),value:y,onSaveAll:s?.onSaveAll,modelOptions:s?.modelOptions,promptLangOptions:s?.promptLangOptions,analysisTemplateOptions:s?.analysisTemplateOptions,responseTemplateOptions:s?.responseTemplateOptions,defaultAnalysisTemplateId:s?.defaultAnalysisTemplateId,defaultResponseTemplateId:s?.defaultResponseTemplateId})]})})};var Tr={primaryDimension:["Client","Customer","Category","Project"],secondaryDimension:["Person","Consultant","Owner","Name"],status:["Status","state"],date:["Date","WorkDate","CreatedAt"],description:["Description","Task","Title","Memo"],reportHours:["Report_Hour","Report Hours","Hours","ReportHours"],billableHours:["Billable_Hour","Billable Hours","BillableHours"],amount:["Amount","Billable_Amount","Total_Amount","Value"]},Zf=5,Wp=t=>t.toLowerCase().replace(/[\s_-]/g,""),Ir=(t,o,r,n)=>{if(o)return o;if(t.length===0)return n;let a=Object.keys(t[0]),i=new Map(a.map(s=>[Wp(s),s]));for(let s of r){let l=i.get(Wp(s));if(l)return l}return a[0]||n},Po=t=>{if(typeof t=="number")return Number.isFinite(t)?t:0;if(typeof t=="string"){let o=Number(t.replace(/,/g,"").trim());return Number.isFinite(o)?o:0}return 0},ho=(t,o)=>t==null||t===""?o:String(t),Yf=(t,o,r,n,a)=>{let i=new Map;return t.forEach(s=>{let l=ho(s[o],a);i.set(l,(i.get(l)||0)+Po(s[r]));}),Array.from(i.entries()).map(([s,l])=>({name:s,value:l})).sort((s,l)=>l.value-s.value).slice(0,n)},Qf=(t,o,r,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=ho(l[o],i),p=s.get(d)||{report:0,billable:0};p.report+=Po(l[r]),p.billable+=Po(l[n]),s.set(d,p);}),Array.from(s.entries()).map(([l,d])=>({name:l,value:d.report>0?d.billable/d.report*100:0})).sort((l,d)=>l.value-d.value).slice(0,a)},jf=(t,o,r)=>{let n=t.length;if(n===0)return [];let a=new Map;return t.forEach(i=>{let s=ho(i[o],r);a.set(s,(a.get(s)||0)+1);}),Array.from(a.entries()).map(([i,s])=>({name:i,value:s,percent:s/n*100}))},$p=(t,o,r)=>{let n=new Map;return t.forEach(a=>{let i=ho(a[o],"N/A");n.set(i,(n.get(i)||0)+Po(a[r]));}),Array.from(n.entries()).sort(([a],[i])=>a.localeCompare(i)).map(([a,i])=>({name:a,value:i}))},Jf=(t,o,r,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=ho(l[o],i),p=s.get(d)||{report:0,billable:0};p.report+=Po(l[r]),p.billable+=Po(l[n]),s.set(d,p);}),Array.from(s.entries()).map(([l,d])=>({name:l,barValue:d.billable,lineValue:d.report>0?d.billable/d.report*100:0})).sort((l,d)=>d.barValue-l.barValue).slice(0,a)},eb=(t,o,r,n,a)=>{let i=new Map;return t.forEach(s=>{let l=ho(s[o],a),d=ho(s[r],a),p=`${l}__${d}`;i.set(p,(i.get(p)||0)+Po(s[n]));}),Array.from(i.entries()).map(([s,l])=>{let[d,p]=s.split("__");return {x:d,y:p,value:l}})},tb=(t,o,r)=>{let n=$p(t,o,r),a=n.map(s=>({name:s.name,value:s.value,type:"delta"})),i=n.reduce((s,l)=>s+l.value,0);return [...a,{name:"Total",value:i,type:"total"}]},ob=(t,o,r,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=ho(l[o],i),p=`${ho(l[r],i)} / ${ho(l[n],i)}`,m=s.get(d)||new Map;m.set(p,(m.get(p)||0)+1),s.set(d,m);}),Array.from(s.entries()).map(([l,d])=>({title:l,causes:Array.from(d.entries()).sort((p,m)=>m[1]-p[1]).slice(0,a).map(([p,m])=>`${p} (${m})`)})).slice(0,6)},pn=({rows:t,config:o})=>{let{t:r}=ce(),n=r("graph.unassigned"),a=useMemo(()=>{let m=o?.fieldMapping;return {primaryDimension:Ir(t,m?.primaryDimension,Tr.primaryDimension,"Category"),secondaryDimension:Ir(t,m?.secondaryDimension,Tr.secondaryDimension,"Owner"),status:Ir(t,m?.status,Tr.status,"Status"),date:Ir(t,m?.date,Tr.date,"Date"),description:Ir(t,m?.description,Tr.description,"Description"),reportHours:Ir(t,m?.reportHours,Tr.reportHours,"ReportHours"),billableHours:Ir(t,m?.billableHours,Tr.billableHours,"BillableHours"),amount:Ir(t,m?.amount,Tr.amount,"Amount")}},[t,o?.fieldMapping]),i=useMemo(()=>t.map((m,h)=>{let f=Po(m[a.reportHours]),u=Po(m[a.billableHours]),b=Po(m[a.amount]),C=f>0?u/f*100:0;return {id:`graph-row-${h}`,Date:ho(m[a.date],""),Primary:ho(m[a.primaryDimension],n),Secondary:ho(m[a.secondaryDimension],n),Description:ho(m[a.description],""),ReportHours:f,BillableHours:u,Amount:b,Efficiency:C,Status:ho(m[a.status],n)}}),[t,a,n]),s=useMemo(()=>{let m=i.length,h=i.reduce((x,v)=>x+Po(v.ReportHours),0),f=i.reduce((x,v)=>x+Po(v.BillableHours),0),u=i.reduce((x,v)=>x+Po(v.Amount),0),b=h>0?f/h*100:0,C=o?.statusFlagValues||["flag","flagged","warning","risk"],g=i.filter(x=>C.includes(ho(x.Status,"").toLowerCase())).length;return {totalRecords:m,totalReportHours:h,totalBillableHours:f,efficiency:b,totalAmount:u,flaggedCount:g}},[i,o?.statusFlagValues]),l=o?.topN||Zf,d=useMemo(()=>({billableByPrimary:Yf(i,"Primary","BillableHours",l,n),efficiencyBySecondary:Qf(i,"Secondary","ReportHours","BillableHours",l,n),statusDistribution:jf(i,"Status",n),lineByDate:$p(i,"Date","BillableHours"),comboByPrimary:Jf(i,"Primary","ReportHours","BillableHours",l,n),heatmapPrimarySecondary:eb(i,"Primary","Secondary","BillableHours",n),waterfallBillable:tb(i,"Date","BillableHours"),fishboneStatusCauses:ob(i,"Status","Primary","Secondary",3,n)}),[i,l,n]),p=useMemo(()=>({title:o?.title||r("graph.reportTitle"),kpis:s,charts:d,table:{columns:[{id:"Date",label:a.date},{id:"Primary",label:a.primaryDimension},{id:"Secondary",label:a.secondaryDimension},{id:"Description",label:a.description},{id:"ReportHours",label:r("graph.column.reportHours"),align:"right"},{id:"BillableHours",label:r("graph.column.billableHours"),align:"right"},{id:"Amount",label:"Amount",align:"right"},{id:"Efficiency",label:"Efficiency",align:"right"},{id:"Status",label:a.status}],rows:i}}),[d,o?.title,a,s,i,r]);return {fieldMapping:a,model:p}};var un=t=>String(t??"").trim(),Mi=(t={})=>{let[o,r]=useState(t),n=useCallback((d,p)=>{r(m=>{let h=p?.trim();if(!h){let f={...m};return delete f[d],f}if(m[d]===h){let f={...m};return delete f[d],f}return {...m,[d]:h}});},[]),a=useCallback(d=>{r(p=>{if(!p[d])return p;let m={...p};return delete m[d],m});},[]),i=useCallback(()=>{r({});},[]),s=useMemo(()=>!!(o.primaryDimension||o.secondaryDimension||o.status),[o]),l=useCallback((d,p)=>d.filter(m=>!(o.primaryDimension&&un(m[p.primaryDimension])!==un(o.primaryDimension)||o.secondaryDimension&&un(m[p.secondaryDimension])!==un(o.secondaryDimension)||o.status&&un(m[p.status])!==un(o.status))),[o]);return {filters:o,setFilter:n,clearFilter:a,clearAll:i,hasActiveFilters:s,applyRows:l}};var Di=({variants:t,currentVariantId:o,onLoad:r,onSave:n,onDelete:a,onSetDefault:i})=>{let{t:s}=ce(),[l,d]=useState(false),[p,m]=useState(""),[h,f$1]=useState(false),[u,b]=useState(false),C=t.find(v=>v.id===o),g$1=()=>{m(C?.name||s("variant.newVariant")),f$1(C?.isDefault||false),b(C?.isPublic||false),d(true);},x=()=>{n({name:p,isDefault:h,isPublic:u,description:""}),d(false);};return g("div",{className:"orb-variant-management",children:[f(zt,{size:"small",fullWidth:false,sx:{width:"min(240px, 100%)","& .orb-inp":{fontSize:"0.85rem",backgroundColor:"var(--orb-p50)",borderColor:"color-mix(in oklch, var(--orb-primary) 30%, var(--orb-border))"}},value:o||"",options:[{value:"",label:s("variant.selectVariant"),disabled:true},...t.map(v=>({value:v.id,label:v.name+(v.isDefault?` (${s("variant.defaultSuffix")})`:"")}))],onChange:v=>{let y=t.find(k=>k.id===v.target.value);y&&r(y);}}),f(ct,{title:s("variant.saveView"),children:f(ie,{className:"orb-variant-save-button",onClick:g$1,size:"small",color:"primary",children:f(Sr,{fontSize:"small"})})}),g(Lt,{open:l,onClose:()=>d(false),children:[f("div",{className:"orb-dialog-title",children:s("variant.saveView")}),g("div",{className:"orb-dialog-content",children:[f(He,{autoFocus:true,margin:"dense",label:s("variant.viewName"),fullWidth:true,variant:"outlined",value:p,onChange:v=>m(v.target.value)}),f(Qn,{control:f(Tt,{checked:h,onChange:v=>f$1(v.target.checked)}),label:s("variant.setDefault")}),f(Qn,{control:f(Tt,{checked:u,onChange:v=>b(v.target.checked)}),label:s("variant.publicAllUsers")})]}),g("div",{className:"orb-dialog-actions",children:[f(Pe,{onClick:()=>d(false),children:s("common.cancel")}),f(Pe,{onClick:x,variant:"contained",children:s("common.save")})]})]})]})};var Gp=({appId:t,tableKey:o="default",currentFilters:r,currentLayoutId:n,layoutRefs:a,onLoad:i,variantService:s,serviceUrl:l,onError:d,onSuccess:p,currentVariantId:m,onVariantChange:h})=>{let{t:f$1}=ce(),[u,b]=useState([]),[C,g]=useState(""),x=`orbcafe.variants.${t}.${o}`,v=m!==void 0?m:C,y=M=>{m===void 0&&g(M),h&&h(M);},k=useCallback(()=>{try{let M=localStorage.getItem(x);if(!M)return [];let A=JSON.parse(M);return Array.isArray(A)?A:[]}catch{return []}},[x]),w=useCallback(M=>{try{localStorage.setItem(x,JSON.stringify(M));}catch{}},[x]),P=useCallback(M=>{b(M);let A=M.find(L=>L.isDefault);A&&!v&&(y(A.id),i(A));},[v,i,y]),I=useCallback(async()=>{if(!t)return [];try{let M=[];if(s)M=await s.getVariants(t,o);else if(l){let A=await fetch(`${l}/api/variants?appId=${encodeURIComponent(t)}&tableKey=${encodeURIComponent(o)}`);if(!A.ok)throw new Error(f$1("variant.toast.fetchFailed"));M=await A.json();}else M=k();return P(M),M}catch(M){console.error("Error fetching variants",M);let A=k();return P(A),d&&d(f$1("variant.toast.fetchFailed")),A}},[t,o,s,l,k,P,d,f$1]);return useEffect(()=>{I();},[t,o]),f(Di,{variants:u,currentVariantId:v,onLoad:M=>{y(M.id),i(M);},onSave:async M=>{let A=Date.now().toString(),L;try{let W=M.scope||"Both",ee=u.find(Q=>Q.name===M.name);A=ee?ee.id:Date.now().toString();let O=[];if(ee&&(Array.isArray(ee.filters)?O=[...ee.filters]:ee.filters&&(O=[{scope:"default",filters:ee.filters}])),W==="Search"||W==="Both"){let Q=(Array.isArray(r),r);if(Q)if(Array.isArray(Q)&&Q.length>0&&Q[0].scope)Q.forEach(H=>{let B=O.findIndex(q=>q.scope===H.scope);B>=0?O[B]=H:O.push(H);});else {let H={scope:o,filters:Q},B=O.findIndex(q=>q.scope===o);B>=0?O[B]=H:O.push(H);}}let _=ee?.layout||{},V=[];if(ee&&Array.isArray(ee.layoutRefs)&&(V=[...ee.layoutRefs]),W==="Layout"||W==="Both")if(a&&a.length>0)a.forEach(Q=>{let H=V.findIndex(B=>B.tableKey===Q.tableKey);H>=0?V[H]=Q:V.push(Q);});else {let Q={tableKey:o,layoutId:n||null},H=V.findIndex(B=>B.tableKey===o);H>=0?V[H]=Q:V.push(Q);}if(L={appId:t,tableKey:o,...M,scope:W,id:A,createdAt:new Date().toISOString(),filters:O,layout:_,layoutRefs:V},s)await s.saveVariant(L,t,o);else if(l){if(!(await fetch(`${l}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(L)})).ok)throw new Error(f$1("variant.toast.saveFailed"))}else {let H=u.some(B=>B.id===A)?u.map(B=>B.id===A?L:B):[...u,L];b(H),w(H);}p&&p(f$1("variant.toast.saveSuccess")),(s||l)&&await I(),y(A),i(L);}catch(W){console.error("Error saving variant",W);let O=u.some(_=>_.id===A)?u.map(_=>_.id===A?L:_):[...u,L];b(O),w(O),y(A),i(L),d&&d(f$1("variant.toast.saveFailed"));}},onDelete:async M=>{try{if(s)await s.deleteVariant(M);else if(l){if(!(await fetch(`${l}/api/variants/${M}`,{method:"DELETE"})).ok)throw new Error(f$1("variant.toast.deleteFailed"))}else {let A=u.filter(L=>L.id!==M);b(A),w(A);}v===M&&y(""),(s||l)&&I(),p&&p(f$1("variant.toast.deleteSuccess"));}catch(A){console.error("Error deleting variant",A);let L=u.filter(W=>W.id!==M);b(L),w(L),v===M&&y(""),d&&d(f$1("variant.toast.deleteFailed"));}},onSetDefault:async M=>{try{let A=u.find(W=>W.id===M);if(!A)return;let L={appId:t,tableKey:o,...A,isDefault:!0};if(s)await s.setDefaultVariant(M,t,o);else if(l){if(!(await fetch(`${l}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(L)})).ok)throw new Error(f$1("variant.toast.defaultFailed"))}else {let W=u.map(ee=>({...ee,isDefault:ee.id===M}));b(W),w(W);}(s||l)&&await I(),p&&p(f$1("variant.toast.defaultSuccess"));}catch(A){console.error("Error setting default variant",A);let L=u.map(W=>({...W,isDefault:W.id===M}));b(L),w(L),d&&d(f$1("variant.toast.defaultFailed"));}}})};rr.extend(lb);rr.extend(cb);rr.extend(qh);var na="YYYY-MM-DD",pb=[null,null],Hr="0.85rem",ub={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},mb=({isInRange:t,isStart:o,isEnd:r,isHovered:n,disableMargin:a,sx:i,...s})=>{let l=io();return f(Fd,{...s,sx:[...Array.isArray(i)?i:i?[i]:[],t?{borderRadius:0,backgroundColor:l.palette.primary.light,color:l.palette.primary.contrastText}:{},n&&!t&&!o&&!r?{borderRadius:0,backgroundColor:l.palette.action.hover,border:`1px dashed ${l.palette.primary.main}`}:{},o?{borderRadius:"50% 0 0 50%",backgroundColor:l.palette.primary.main,color:l.palette.primary.contrastText}:{},r?{borderRadius:"0 50% 50% 0",backgroundColor:l.palette.primary.main,color:l.palette.primary.contrastText}:{},o&&r?{borderRadius:"50%"}:{}]})},Kp=({label:t,value:o=pb,onChange:r})=>{let{t:n,locale:a}=ce(),i=ub[a]||"en",s=t||n("dateRange.label"),[l,d]=useState(null),[p,m]=useState(o),[h,f$1]=useState("start"),[u,b]=useState(null),[C,g$1]=useState((o[0]||rr()).locale(i)),[x,v]=useState(""),[y,k]=useState(""),[w,P]=useState(false),[I,S]=useState(false),R=Jt__default.useRef(o);useEffect(()=>{let[Q,H]=o,[B,q]=R.current,Z=le=>le&&typeof le.isSame=="function",Y=!(Q===null&&B===null||Z(Q)&&Z(B)&&Q.isSame(B,"day")),J=!(H===null&&q===null||Z(H)&&Z(q)&&H.isSame(q,"day"));(Y||J)&&(m(o),o[0]&&Z(o[0])&&g$1(o[0].locale(i))),R.current=o;},[o,i]),useEffect(()=>{v(p[0]?p[0].locale(i).format(na):""),k(p[1]?p[1].locale(i).format(na):""),P(false),S(false);},[p,i]);let N=(Q,H)=>{let B=H.trim(),q=Q==="start"?P:S;if(!B){let J=Q==="start"?[null,p[1]]:[p[0],null];q(false),m(J);return}let Z=rr(B,na,true).locale(i);if(!Z.isValid()){q(true);return}q(false);let Y=[...p];if(Q==="start")Y[0]=Z,Y[1]&&Z.isAfter(Y[1],"day")&&(Y[1]=null),f$1(Y[1]?"start":"end");else {let J=Y[0];J&&Z.isBefore(J,"day")?(Y=[Z,null],f$1("end")):(Y[1]=Z,f$1("start"));}m(Y),g$1(Z);},T=Q=>{d(Q.currentTarget);},M=()=>{d(null),f$1("start"),b(null);},A=!!l,L=Q=>{if(!Q)return;let H=[...p];if(h==="start")H=[Q,null],f$1("end");else {let B=H[0];B&&Q.isBefore(B)?(H=[Q,null],f$1("end")):(H=[B,Q],f$1("start"));}m(H);},W=Q=>{let H=rr().locale(i),B=[null,null];switch(Q){case "today":B=[H,H];break;case "week":B=[H.startOf("week"),H.endOf("week")];break;case "month":B=[H.startOf("month"),H.endOf("month")];break}m(B),f$1("start"),g$1(H);},ee=()=>{r&&r(p),M();},O=()=>{m(o),f$1("start"),M();},_=useCallback(Q=>{let{day:H,...B}=Q,[q,Z]=p,Y=q?H.isSame(q,"day"):false,J=Z?H.isSame(Z,"day"):false,le=q&&Z?H.isBetween(q,Z,"day","()"):false,he=false;return h==="end"&&q&&!Z&&u&&H.isAfter(q,"day")&&H.isBefore(u.add(1,"day"),"day")&&(he=true),f(mb,{...B,day:H,disableMargin:true,isStart:Y,isEnd:J,isInRange:le||he,onMouseEnter:()=>b(H)})},[p,h,u]),V=Q=>Q?Q.locale(i).format("YYYY-MM-DD"):"";return g("div",{className:"orb-date-range-picker",children:[f(He,{className:"orb-date-range-field",label:s,value:p[0]?`${V(p[0])} - ${V(p[1])}`:"",onClick:T,fullWidth:true,size:"small",InputLabelProps:{sx:{fontSize:Hr}},InputProps:{readOnly:true,sx:{fontSize:Hr,"& .orb-inp":{fontSize:Hr},paddingRight:"4px"},endAdornment:f(ie,{className:"orb-date-range-calendar-trigger",size:"small",onClick:T,tooltip:s,children:f(Pt,{name:"calendar",size:16})})}}),g(oi,{open:A,anchorEl:l,onClose:M,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},className:"orb-date-range-popover",children:[f("div",{className:"orb-date-range-inputs",children:g(se,{className:"orb-date-range-input-row",direction:"row",alignItems:"center",spacing:1.5,justifyContent:"space-between",children:[f(He,{className:"orb-date-range-manual-field",label:n("dateRange.startDate"),placeholder:na,value:x,error:w,size:"small",onFocus:()=>f$1("start"),onChange:Q=>{v(Q.target.value),w&&P(false);},onBlur:()=>N("start",x),onKeyDown:Q=>{Q.key==="Enter"&&(Q.preventDefault(),N("start",x));},sx:{"& .orb-inp":{fontSize:Hr,py:.75},"& label":{fontSize:Hr}}}),f(Vd,{color:"action",fontSize:"small"}),f(He,{className:"orb-date-range-manual-field",label:n("dateRange.endDate"),placeholder:na,value:y,error:I,size:"small",onFocus:()=>{p[0]&&f$1("end");},onChange:Q=>{k(Q.target.value),I&&S(false);},onBlur:()=>N("end",y),onKeyDown:Q=>{Q.key==="Enter"&&(Q.preventDefault(),N("end",y));},sx:{"& .orb-inp":{fontSize:Hr,py:.75},"& label":{fontSize:Hr}}})]})}),f("div",{className:"orb-date-range-shortcuts",children:g(se,{direction:"row",spacing:1,justifyContent:"center",children:[f(Ct,{label:n("dateRange.today"),onClick:()=>W("today"),clickable:true,size:"small",variant:"outlined"}),f(Ct,{label:n("dateRange.thisWeek"),onClick:()=>W("week"),clickable:true,size:"small",variant:"outlined"}),f(Ct,{label:n("dateRange.thisMonth"),onClick:()=>W("month"),clickable:true,size:"small",variant:"outlined"})]})}),f("div",{className:"orb-date-range-calendar",children:f(Hd,{dateAdapter:ja,adapterLocale:i,children:f(Bd,{value:null,referenceDate:C,onMonthChange:g$1,onYearChange:g$1,onChange:L,slots:{day:_},views:["year","month","day"],openTo:"day",showDaysOutsideCurrentMonth:true})})}),f(Rt,{}),g(se,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{p:2},children:[f(Pe,{size:"small",onClick:O,color:"inherit",children:n("common.cancel")}),f(Pe,{size:"small",variant:"contained",onClick:ee,children:n("common.done")})]})]})]})};var Ai={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},fb={equals:"smartFilter.operator.equals",contains:"smartFilter.operator.contains",notContains:"smartFilter.operator.notContains",wildcard:"smartFilter.operator.wildcard","=":"smartFilter.operator.equals","!=":"smartFilter.operator.notEquals",">":"smartFilter.operator.greaterThan","<":"smartFilter.operator.lessThan",">=":"smartFilter.operator.greaterOrEqual","<=":"smartFilter.operator.lessOrEqual",between:"smartFilter.operator.between"},bb=["contains","notContains",">",">=","<","<=","equals"],Xp=["=","!=",">","<",">=","<=","between"],oo="0.85rem",vb=({field:t,value:o,onChange:r})=>{let{t:n}=ce(),[a,i]=useState(null),[s,l]=useState(null),[d,p]=useState(null),[m,h]=useState(""),[f$1,u]=useState(""),[b,C]=useState(""),[g$1,x]=useState("");useEffect(()=>{let T=setTimeout(()=>{x(b);},1e3);return ()=>clearTimeout(T)},[b]);let v=o?.operator||(t.type==="number"?"=":"equals"),y=o?.value,k=T=>{let M=fb[T];return M?n(M):T},w=T=>{i(a?null:T.currentTarget);},P=T=>{r({...o,operator:T,value:y}),i(null);},I={size:"small",fullWidth:true,variant:"outlined",InputLabelProps:{sx:{fontSize:oo}},InputProps:{sx:{fontSize:oo}},SelectProps:{MenuProps:{PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:oo,paddingTop:"4px",paddingBottom:"4px",minHeight:"auto"}}}}}},S=t.type||"text";if(S==="date"){let M=(A=>{if(!A)return [null,null];if(Array.isArray(A)&&A.length===2){let L=A[0]?rr.isDayjs(A[0])?A[0]:rr(A[0]):null,W=A[1]?rr.isDayjs(A[1])?A[1]:rr(A[1]):null;return [L,W]}return rr.isDayjs(A)||typeof A=="string"?[rr.isDayjs(A)?A:rr(A),null]:[null,null]})(y);return f(Kp,{label:t.label,value:M,onChange:A=>r({value:A,operator:"between"})})}if(S==="number"&&v==="between"){let T=()=>{r({value:[m,f$1],operator:"between"}),l(null);},M=Array.isArray(y)?`${y[0]||""} - ${y[1]||""}`:"";return g(e,{children:[f(He,{...I,label:t.label,value:M,placeholder:n("smartFilter.minMaxPlaceholder"),InputProps:{...I.InputProps,startAdornment:f(sr,{position:"start",children:f(ct,{title:k("between"),children:f(ie,{size:"small",onClick:w,sx:{width:24,height:24,fontSize:oo},children:Ai.between})})}),readOnly:true},onClick:A=>l(s?null:A.currentTarget)}),f(Qt,{anchorEl:a,open:!!a,onClose:()=>i(null),PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:oo,minHeight:"auto",py:.5}}},children:Xp.map(A=>g("option",{selected:A===v,onClick:()=>P(A),children:[f("div",{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Ai[A]}),f(_t,{primary:k(A),primaryTypographyProps:{fontSize:oo}})]},A))}),f(oi,{open:!!s,anchorEl:s,onClose:()=>l(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},children:g("div",{sx:{p:2,display:"flex",gap:1,alignItems:"center"},children:[f(He,{size:"small",label:n("smartFilter.min"),type:"number",value:m,onChange:A=>h(A.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:oo}},InputProps:{sx:{fontSize:oo}}}),f(Wd,{color:"action"}),f(He,{size:"small",label:n("smartFilter.max"),type:"number",value:f$1,onChange:A=>u(A.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:oo}},InputProps:{sx:{fontSize:oo}}}),f(Pe,{variant:"contained",size:"small",onClick:T,children:n("common.ok")})]})})]})}if(t.isValueHelp||S==="value-help"){let T=t.valueHelp?.mode||"single";return f(wp,{...I,...t.valueHelp,label:t.label,placeholder:t.placeholder||t.valueHelp?.placeholder,value:y??(T==="multiple"?[]:null),mode:T,onChange:M=>r({value:M,operator:T==="multiple"?"anyOf":"equals"})})}if(S==="select")return g(zt,{size:"small",fullWidth:true,label:t.label,value:y||"",onChange:T=>r({...o,value:T.target.value,operator:"equals"}),children:[f("option",{value:"",children:n("common.none")}),t.options?.map(T=>f("option",{value:T.value,children:T.label},T.value))]});if(S==="multi-select"){let T=Array.isArray(y)?y:[],M=t.options?.filter(_=>_.label.toLowerCase().includes(g$1.toLowerCase()))||[],A=_=>t.options?.find(V=>V.value===_)?.label||_,L=T.map(A),W=L.length===0?n("common.none"):L.length>2?`${L.slice(0,2).join(", ")} +${L.length-2}`:L.join(", "),ee=()=>{p(null),C(""),x("");},O=_=>{let V=T.includes(_)?T.filter(Q=>Q!==_):[...T,_];r({...o,value:V,operator:"anyOf"});};return g("div",{className:"orb-fld",children:[f("label",{children:t.label}),g(Pe,{variant:"outlined",size:"small",onClick:_=>p(d?null:_.currentTarget),sx:{width:"100%",minHeight:36,justifyContent:"space-between",fontSize:oo,fontWeight:400},children:[f("span",{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:W}),f(Wo,{fontSize:"small"})]}),f(Qt,{anchorEl:d,open:!!d,onClose:ee,PaperProps:{sx:{width:280,maxHeight:340,overflowY:"auto",p:.5}},children:g("div",{onClick:_=>_.stopPropagation(),sx:{display:"grid",gap:.35},children:[f(He,{size:"small",autoFocus:true,placeholder:n("smartFilter.searchPlaceholder"),fullWidth:true,InputProps:{startAdornment:f(sr,{position:"start",children:f(Br,{fontSize:"small"})}),sx:{fontSize:oo}},value:b,onChange:_=>C(_.target.value),onKeyDown:_=>_.stopPropagation()}),M.length>0?M.map(_=>{let V=T.includes(_.value);return g("div",{role:"option","aria-selected":V,tabIndex:0,className:`orb-menu-item ${V?"orb-selected":""}`,onClick:()=>O(_.value),onKeyDown:Q=>{(Q.key==="Enter"||Q.key===" ")&&(Q.preventDefault(),O(_.value));},children:[f(Tt,{checked:V,size:"small",inputProps:{tabIndex:-1},sx:{pointerEvents:"none"}}),f(_t,{primary:_.label})]},String(_.value))}):f("div",{className:"orb-menu-item","aria-disabled":"true",children:n("smartFilter.noOptionsFound")})]})})]})}let R=S==="number"?Xp:bb;return g(e,{children:[f(He,{...I,className:"orb-filter-operator-field",label:t.label,sx:{minWidth:"120px"},value:y||"",type:S==="number"?"number":"text",onChange:T=>r({...o,value:T.target.value,operator:v}),InputProps:{...I.InputProps,startAdornment:f(sr,{position:"start",children:f(ct,{title:k(v),children:f(ie,{className:"orb-filter-operator-trigger",size:"small",onClick:w,onMouseDown:T=>T.preventDefault(),sx:{width:24,height:24,fontSize:oo,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:Ai[v]})})}),endAdornment:t.hasSearchIcon?f(sr,{position:"end",children:f(Br,{color:"action"})}):void 0}}),f(Qt,{anchorEl:a,open:!!a,onClose:()=>i(null),PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:oo,minHeight:"auto",py:.5}}},children:R.map(T=>g("option",{selected:T===v,onClick:()=>P(T),children:[f("span",{className:"orb-filter-operator-symbol",children:Ai[T]}),f(_t,{primary:k(T),primaryTypographyProps:{fontSize:oo}})]},T))})]})},$o=({fields:t,filters:o,onFilterChange:r,variants:n=[],currentVariantId:a,onVariantLoad:i,onVariantSave:s,onVariantDelete:l,onVariantSetDefault:d,onSearch:p,loading:m=false,appId:h,tableKey:f$1,currentLayout:u,currentLayoutId:b,layoutRefs:C,variantService:g$1,serviceUrl:x})=>{let{t:v}=ce(),[y,k]=useState(true),[w,P]=useState(null),[I,S]=useState(t.filter(M=>!M.hidden).map(M=>M.id)),R=(M,A)=>{r({...o,[M]:A});},N=M=>{I.includes(M)?S(I.filter(A=>A!==M)):S([...I,M]);};return g(Ne,{className:`orb-smart-filter ${y?"orb-smart-filter-expanded":"orb-smart-filter-collapsed"}`,sx:{mb:0,display:"flex",flexDirection:"column",overflow:"visible",position:"relative"},children:[y?g(e,{children:[g("div",{className:"orb-smart-filter-header",children:[h?f(Gp,{appId:h,tableKey:f$1,currentFilters:{values:o,visibleFields:I},currentLayout:u,currentLayoutId:b,layoutRefs:C,onLoad:M=>{if(!M.filters)return;let A=null;if(Array.isArray(M.filters)){let L=f$1||"default",W=M.filters.find(ee=>ee.scope===L);A=W?W.filters:null;}else A=M.filters;A&&(A.values||A.visibleFields?(A.visibleFields&&Array.isArray(A.visibleFields)&&S(A.visibleFields),A.values&&r(A.values)):r(A)),i&&i(M);},variantService:g$1,serviceUrl:x,currentVariantId:a}):f(Di,{variants:n,currentVariantId:a,onLoad:i,onSave:M=>{s&&s({...M,filters:{values:o,visibleFields:I}});},onDelete:l,onSetDefault:d}),g("div",{className:"orb-smart-filter-actions",children:[f(ct,{title:v("smartFilter.addFilters"),children:f(Pe,{className:"orb-smart-filter-adapt",onClick:M=>P(w?null:M.currentTarget),size:"small",color:"primary",startIcon:f(pp,{fontSize:"small"}),sx:{textTransform:"none",fontSize:oo,whiteSpace:"nowrap",minWidth:"fit-content"},children:v("smartFilter.adaptFilters")})}),f(ie,{className:"orb-smart-filter-go",tooltip:v("smartFilter.go"),"aria-label":v("smartFilter.go"),onClick:p,disabled:m,children:m?f(Zo,{size:16}):f(Pt,{name:"play",size:16})}),g(Qt,{anchorEl:w,open:!!w,onClose:()=>P(null),slotProps:{paper:{style:{maxHeight:400,width:"25ch"},sx:{"& .orb-menu-item, & option":{fontSize:oo,minHeight:32}}}},children:[f("option",{disabled:true,children:f(_t,{primary:v("smartFilter.visibleFilters"),primaryTypographyProps:{fontSize:oo}})}),f(Rt,{}),t.map(M=>g("option",{onClick:()=>N(M.id),children:[f(Tt,{checked:I.includes(M.id),size:"small"}),f(_t,{primary:M.label,primaryTypographyProps:{fontSize:oo}})]},M.id))]})]})]}),f("div",{className:"orb-smart-filter-grid",children:f(nl,{container:true,spacing:2,columns:{xs:2,sm:3,md:4,lg:6},children:t.filter(M=>I.includes(M.id)).map(M=>f(nl,{size:1,children:f(vb,{field:M,value:o[M.id]||{value:"",operator:M.type==="number"?"=":"equals"},onChange:A=>R(M.id,A)})},M.id))})})]}):null,f("div",{className:"orb-smart-filter-toggle",children:f(ie,{className:"orb-smart-filter-toggle-button",size:"small",onClick:()=>k(!y),sx:{bgcolor:"background.paper",boxShadow:2,border:"1px solid",borderColor:"divider",width:30,height:30,minWidth:30,minHeight:0,p:0,"&:hover":{bgcolor:"background.paper"}},children:y?f(ii,{className:"orb-smart-filter-toggle-icon",sx:{fontSize:20},color:"action"}):f(Wo,{className:"orb-smart-filter-toggle-icon",sx:{fontSize:20},color:"action"})})})]})};var Zp=({layouts:t,currentLayoutId:o,onLoad:r,onSave:n,onDelete:a,onSetDefault:i})=>{let{t:s}=ce(),[l,d]=useState(null),[p,m]=useState(false),[h,f$1]=useState(""),[u,b]=useState(""),[C,g$1]=useState({isDefault:false,isPublic:false}),x=t.find(I=>I.id===o),v=I=>{d(I.currentTarget);},y=()=>{d(null);},k=I=>{r(I),y();},w=()=>{f$1(""),b(""),g$1({isDefault:false,isPublic:false}),m(true),y();},P=()=>{h.trim()&&(n({name:h,description:u,...C}),m(false));};return g("div",{className:"orb-layout-actions",sx:{display:"flex",alignItems:"center",gap:.25},children:[f(ct,{title:s("layout.layoutOptions"),children:f(ie,{onClick:v,color:x?"primary":"default",size:"small",children:f(fp,{fontSize:"small"})})}),g(Qt,{anchorEl:l,open:!!l,onClose:y,align:"end",PaperProps:{sx:{width:320,maxHeight:400}},children:[f("option",{disabled:true,children:f(E,{variant:"caption",children:s("layout.selectLayout")})}),g("option",{onClick:w,children:[f(Vo,{children:f(Sr,{fontSize:"small"})}),f(_t,{children:s("layout.saveCurrentLayout")})]}),f(Rt,{}),t.length===0&&f("option",{disabled:true,children:f(E,{variant:"body2",color:"text.secondary",children:s("layout.noSavedLayouts")})}),t.map((I,S)=>f("option",{onClick:()=>k(I),selected:I.id===o,children:g("div",{sx:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"},children:[g("div",{sx:{display:"flex",flexDirection:"column",overflow:"hidden",mr:1},children:[f("div",{sx:{display:"flex",alignItems:"center",gap:1},children:f(E,{variant:"body2",fontWeight:I.id===o?"bold":"normal",noWrap:true,children:I.name})}),I.description&&f(E,{variant:"caption",color:"text.secondary",noWrap:true,children:I.description})]}),g("div",{sx:{display:"flex",alignItems:"center"},onClick:R=>R.stopPropagation(),children:[f(ct,{title:I.isDefault?s("layout.removeDefault"):s("layout.setAsDefault"),children:f(ie,{size:"small",onClick:R=>{R.stopPropagation(),i(I.id);},children:I.isDefault?f(gp,{fontSize:"small",color:"warning"}):f(mp,{fontSize:"small"})})}),f(ct,{title:s("common.delete"),children:f(ie,{size:"small",color:"error",onClick:R=>{R.stopPropagation(),a(I.id);},children:f(ni,{fontSize:"small"})})})]})]})},I.id||S))]}),f(Lt,{open:p,onClose:()=>m(false),maxWidth:"xs",fullWidth:true,className:"orb-layout-save-dialog",title:s("layout.saveLayout"),actions:g(e,{children:[f(Pe,{variant:"ghost",onClick:()=>m(false),children:s("common.cancel")}),f(Pe,{onClick:P,variant:"primary",disabled:!h.trim(),children:s("common.save")})]}),children:g("div",{className:"orb-layout-save-form",children:[f(He,{label:s("layout.layoutName"),value:h,onChange:I=>f$1(I.target.value),fullWidth:true,autoFocus:true,size:"small",helperText:s("layout.layoutNameHelper")}),t.some(I=>I.name===h)&&f(E,{className:"orb-layout-save-warning",variant:"caption",color:"warning.main",children:s("layout.warningOverwrite")}),f(He,{label:s("layout.layoutDescription"),value:u,onChange:I=>b(I.target.value),fullWidth:true,size:"small"}),f(Tt,{className:"orb-layout-save-option",checked:C.isDefault,onChange:I=>g$1({...C,isDefault:I.target.checked}),label:s("layout.useAsDefault")}),f(Tt,{className:"orb-layout-save-option",checked:C.isPublic,onChange:I=>g$1({...C,isPublic:I.target.checked}),label:s("layout.publicAllUsers")})]})})]})};var gn=({appId:t,tableKey:o="default",currentLayoutData:r,onLayoutLoad:n,targetLayoutId:a,activeLayoutId:i,serviceUrl:s,onError:l,onSuccess:d})=>{let{t:p}=ce(),[m,h]=useState([]),[f$1,u]=useState(""),b=`orbcafe.layouts.${t}.${o}`,C=S=>({id:S.layoutId,name:S.name,description:S.description??"",isDefault:!!S.isDefault,isPublic:!!S.isPublic,createdAt:S.createdAt??new Date().toISOString(),layoutData:S.layout??{}}),g=S=>({appId:t,tableKey:o,layoutId:S.id,name:S.name,description:S.description??"",isDefault:!!S.isDefault,isPublic:!!S.isPublic,createdAt:S.createdAt,layout:S.layoutData}),x=useCallback(()=>{try{let S=localStorage.getItem(b);if(!S)return [];let R=JSON.parse(S);return Array.isArray(R)?R:[]}catch{return []}},[b]),v=useCallback(S=>{try{localStorage.setItem(b,JSON.stringify(S));}catch{}},[b]);useEffect(()=>{i!==void 0&&u(i);},[i]),useEffect(()=>{if(a&&m.length>0){let S=m.find(R=>R.id===a);S&&(u(S.id),n(S));}},[a,m,n]);let y=useCallback(async()=>{if(t){if(!s){let S=x();h(S);let R=S.find(N=>N.isDefault);R&&!f$1&&!a&&(u(R.id),n(R));return}try{let S=await fetch(`${s}/api/layouts?appId=${encodeURIComponent(t)}&tableKey=${encodeURIComponent(o)}`);if(!S.ok)throw new Error("LAYOUT_FETCH_FAILED");let N=(await S.json()).map(C);h(N);let T=N.find(M=>M.isDefault);T&&!f$1&&!a&&(u(T.id),n(T));}catch(S){console.error("Error fetching layouts",S);let R=x();h(R);let N=R.find(T=>T.isDefault);N&&!f$1&&!a&&(u(N.id),n(N)),l&&l(p("layout.toast.loadFallback"));}}},[t,o,s,l,f$1,n,a,x,p]);return useEffect(()=>{y();},[t,o]),f(Zp,{layouts:m,currentLayoutId:f$1,onLoad:S=>{u(S.id),n(S);},onSave:async S=>{let R=m.find(M=>M.name===S.name),N=R?R.id:Date.now().toString(),T={id:N,...S,createdAt:new Date().toISOString(),layoutData:r,isDefault:S.isDefault??false,isPublic:S.isPublic??false};if(!s){let A=m.some(L=>L.id===N)?m.map(L=>L.id===N?T:L):[...m,T];h(A),v(A),u(N),n(T),d&&d(p("layout.toast.saveLocalSuccess"));return}try{if(!(await fetch(`${s}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g(T))})).ok)throw new Error("LAYOUT_SAVE_FAILED");d&&d(p("layout.toast.saveSuccess")),await y(),u(N),n(T);}catch(M){console.error("Error saving layout",M);let L=m.some(W=>W.id===N)?m.map(W=>W.id===N?T:W):[...m,T];h(L),v(L),u(N),n(T),d&&d(p("layout.toast.saveLocalSuccess")),l&&l(p("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async S=>{if(!s){let R=m.filter(N=>N.id!==S);h(R),v(R),f$1===S&&u(""),d&&d(p("layout.toast.deleteLocalSuccess"));return}try{if(!(await fetch(`${s}/api/layouts/${encodeURIComponent(S)}`,{method:"DELETE"})).ok)throw new Error("LAYOUT_DELETE_FAILED");f$1===S&&u(""),d&&d(p("layout.toast.deleteSuccess")),await y();}catch(R){console.error("Error deleting layout",R);let N=m.filter(T=>T.id!==S);h(N),v(N),f$1===S&&u(""),d&&d(p("layout.toast.deleteLocalSuccess")),l&&l(p("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async S=>{if(!s){let R=m.map(N=>({...N,isDefault:N.id===S}));h(R),v(R),d&&d(p("layout.toast.defaultLocalSuccess"));return}try{let R=m.find(T=>T.id===S);if(!R)return;if(!(await fetch(`${s}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g({...R,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");d&&d(p("layout.toast.defaultSuccess")),await y();}catch(R){console.error("Error setting default",R);let N=m.map(T=>({...T,isDefault:T.id===S}));h(N),v(N),d&&d(p("layout.toast.defaultLocalSuccess")),l&&l(p("layout.toast.backendUnavailableDefaultLocal"));}}})};var Ei=(t,o)=>{if(!t||!t.filters)return null;if(Array.isArray(t.filters)){let r=t.filters.find(a=>a.scope===o);if(r)return r.filters;let n=t.filters.find(a=>a.scope==="default");return n?n.filters:null}return typeof t.filters=="object"?t.filters:null},Li=(t,o)=>{if(!t)return {layout:null,layoutId:null};let r=null,n=null;if(Array.isArray(t.layoutRefs)){let a=t.layoutRefs.find(i=>i.tableKey===o);a&&(r=a.layoutId);}return !r&&t.layoutId&&(r=t.layoutId),t.layout&&typeof t.layout=="object"&&!Array.isArray(t.layout)&&(n=t.layout),{layoutId:r,layout:n}};function Qp(t,o,r){return o[r]<t[r]?-1:o[r]>t[r]?1:0}function yb(t,o){return t==="desc"?(r,n)=>Qp(r,n,o):(r,n)=>-Qp(r,n,o)}function Cb(t,o){let r=t.map((n,a)=>[n,a]);return r.sort((n,a)=>{let i=o(n[0],a[0]);return i!==0?i:n[1]-a[1]}),r.map(n=>n[0])}var hn=t=>{let o=!!t.disableGrouping,r=!!t.disableSorting,n=useCallback(K=>{let X=String(K?.label??K?.id??"").length*9+64,fe=typeof K?.minWidth=="number"?K.minWidth:0;return Math.max(100,fe,X)},[]),a=useCallback(()=>(t.columns||[]).filter(K=>!!K?.numeric).map(K=>K.id),[t.columns]),[i,s]=useState(""),[l,d]=useState(t.order||"asc"),[p,m]=useState(t.orderBy||""),[h,f]=useState([]),[u,b]=useState(t.page||0),[C,g]=useState(t.rowsPerPage||20),[x,v]=useState(t.selected||[]),[y,k]=useState(t.columns?t.columns.map(K=>K.id):[]),[w,P]=useState(t.columns?t.columns.map(K=>K.id):[]),[I,S]=useState(t.showSummary||false),[R,N]=useState(()=>a()),[T,M]=useState([]),[A,L]=useState(new Set),[W,ee]=useState(()=>{let K={};return (t.columns||[]).forEach(z=>{K[z.id]=n(z);}),K}),[O,_]=useState(null),[V,Q]=useState(null),[H,B]=useState(null),[q,Z]=useState(null),[Y,J]=useState(false),[le,he]=useState(""),[ze,be]=useState(""),Ce=o?[]:T,Be=useCallback(K=>{if(o){M([]),L(new Set),Q(null);return}M(K);},[o]);useEffect(()=>{o&&(M([]),L(new Set),Q(null));},[o]),useEffect(()=>{r&&(d("asc"),m(""),f([]));},[r]),useEffect(()=>{t.layout&&wt(t.layout);},[t.layout]),useEffect(()=>{if(r){d("asc"),m("");return}t.order!==void 0&&d(t.order),t.orderBy!==void 0&&m(t.orderBy);},[t.order,t.orderBy,r]),useEffect(()=>{t.selected!==void 0&&v(t.selected);},[t.selected]),useEffect(()=>{t.page!==void 0&&b(t.page);},[t.page]),useEffect(()=>{t.rowsPerPage!==void 0&&g(t.rowsPerPage);},[t.rowsPerPage]),useEffect(()=>{let K=a();N(z=>z.filter(fe=>K.includes(fe)));},[a]),useEffect(()=>{ee(K=>{let z={...K};return (t.columns||[]).forEach(X=>{z[X.id]===void 0&&(z[X.id]=n(X));}),z});},[t.columns,n]),useEffect(()=>{P(K=>{let z=(t.columns||[]).map(Ke=>Ke.id),X=new Set(z),fe=K.filter(Ke=>X.has(Ke)),Se=new Set(fe),Ae=z.filter(Ke=>!Se.has(Ke)),$e=[...fe,...Ae];return $e.length===K.length&&$e.every((Ke,Ye)=>Ke===K[Ye])?K:$e});},[t.columns]);let de=useMemo(()=>{let K=t.columns||[];if(w.length===0)return K;let z=new Map(K.map(Se=>[Se.id,Se])),X=[],fe=new Set;return w.forEach(Se=>{let Ae=z.get(Se);Ae&&(X.push(Ae),fe.add(Se));}),K.forEach(Se=>{fe.has(Se.id)||X.push(Se);}),X},[t.columns,w]),ve=useMemo(()=>{let K=t.rows||[];return i&&(K=K.filter(z=>Object.keys(z).some(X=>String(z[X]).toLowerCase().includes(i.toLowerCase())))),K},[t.rows,i]),We=useMemo(()=>{if(r||t.onSortChange)return ve;if(h.length>0){let K=[...ve];return K.sort((z,X)=>{for(let fe of h){let Se=z?.[fe.field],Ae=X?.[fe.field];if(!(Se==null&&Ae==null)){if(Se==null)return fe.direction==="asc"?-1:1;if(Ae==null)return fe.direction==="asc"?1:-1;if(Se<Ae)return fe.direction==="asc"?-1:1;if(Se>Ae)return fe.direction==="asc"?1:-1}}return 0}),K}return p?Cb(ve,yb(l,p)):ve},[ve,l,p,h,t.onSortChange,r]),et=useCallback(K=>{if(Ce.length===0)return K.map(Ae=>({type:"row",data:Ae,id:Ae[t.rowKey||"id"]}));let z=[...K].sort((Ae,$e)=>{for(let Ke of Ce){if(Ae[Ke]<$e[Ke])return -1;if(Ae[Ke]>$e[Ke])return 1}return 0}),X=(Ae,$e=0)=>{if($e>=Ce.length)return Ae;let Ke=Ce[$e],Ye={},ut=[];return Ae.forEach(gt=>{let Mt=gt[Ke],bt=`${Ke}:${Mt}`;Ye[bt]||(Ye[bt]={key:bt,field:Ke,value:Mt,children:[],count:0,level:$e},ut.push(Ye[bt])),Ye[bt].children.push(gt),Ye[bt].count++;}),ut.forEach(gt=>{gt.children&&(gt.children=X(gt.children,$e+1));}),ut},fe=X(z),Se=(Ae,$e="")=>{let Ke=[];return Ae.forEach(Ye=>{if(Ye.children){let ut=$e?`${$e}>${Ye.key}`:Ye.key,gt=A.has(ut);Ke.push({type:"group",id:ut,field:Ye.field,value:Ye.value,level:Ye.level,count:Ye.count,isExpanded:gt,childIds:(function Mt(bt){let F=[];return bt.children.forEach(j=>{j.children?F=F.concat(Mt(j)):F.push(j[t.rowKey||"id"]);}),F})(Ye)}),gt&&(Ke=Ke.concat(Se(Ye.children,ut)));}else Ke.push({type:"row",data:Ye,id:Ye[t.rowKey||"id"],level:Ce.length});}),Ke};return Se(fe)},[Ce,A,t.rowKey]),nt=useCallback(K=>{if(Ce.length===0)return [];let z=[...K].sort((Se,Ae)=>{for(let $e of Ce){if(Se[$e]<Ae[$e])return -1;if(Se[$e]>Ae[$e])return 1}return 0}),X=[],fe=(Se,Ae,$e)=>{if(Ae>=Ce.length)return;let Ke=Ce[Ae],Ye=new Map;Se.forEach(ut=>{let gt=ut[Ke],Mt=Ye.get(gt);Mt?Mt.push(ut):Ye.set(gt,[ut]);}),Ye.forEach((ut,gt)=>{let Mt=`${Ke}:${gt}`,bt=$e?`${$e}>${Mt}`:Mt;X.push(bt),fe(ut,Ae+1,bt);});};return fe(z,0,""),X},[Ce]),it=useMemo(()=>et(We),[We,et]),U=useMemo(()=>nt(We),[We,nt]),Re=useMemo(()=>{let K=(t.rows||[]).length;return typeof t.count=="number"&&t.count>K},[t.count,t.rows]),we=useMemo(()=>Re?it:C>0?it.slice(u*C,u*C+C):it,[it,u,C,Re]),Oe=useMemo(()=>Re&&typeof t.count=="number"?t.count:it.length,[it.length,Re,t.count]),at=K=>{L(z=>{let X=new Set(z);return X.has(K)?X.delete(K):X.add(K),X});},Ze=K=>{let z=U.filter(X=>X===K||X.startsWith(`${K}>`));L(X=>{let fe=new Set(X);return z.forEach(Se=>fe.add(Se)),fe});},xt=K=>{L(z=>{let X=new Set(z);return Array.from(X).forEach(fe=>{(fe===K||fe.startsWith(`${K}>`))&&X.delete(fe);}),X});},It=K=>{if(!K){L(new Set);return}L(new Set(U));},Ot=K=>{let z=U.filter(X=>X.startsWith(`${K}>`));return z.length===0?A.has(K):A.has(K)&&z.every(X=>A.has(X))},At=K=>{if(r)return;h.length>0&&f([]);let z=p===K&&l==="asc",X=p===K&&l==="desc";if(t.onSortChange){z?t.onSortChange(K,"desc"):X?t.onSortChange("","asc"):t.onSortChange(K,"asc");return}z?(d("desc"),m(K)):X?(d("asc"),m("")):(d("asc"),m(K));},re=K=>{if(r){d("asc"),m(""),f([]);return}let z=K.filter(X=>X&&X.field);f(z),z.length>0&&m("");},Ge=()=>{f([]);},Le=(K,z)=>{ee(X=>({...X,[K]:z}));},pe=K=>{if(K.target.checked){let z=ve.map(X=>X[t.rowKey||"id"]);v(z),t.onSelectionChange&&t.onSelectionChange(z);return}v([]),t.onSelectionChange&&t.onSelectionChange([]);},xe=(K,z)=>{let X=z[t.rowKey||"id"],fe=x.indexOf(X),Se=[];fe===-1?Se=Se.concat(x,X):fe===0?Se=Se.concat(x.slice(1)):fe===x.length-1?Se=Se.concat(x.slice(0,-1)):fe>0&&(Se=Se.concat(x.slice(0,fe),x.slice(fe+1))),v(Se),t.onSelectionChange&&t.onSelectionChange(Se);},oe=K=>{b(K),t.onPageChange&&t.onPageChange(K);},ye=K=>{g(K),b(0),t.onPageChange&&t.onPageChange(0),t.onRowsPerPageChange&&t.onRowsPerPageChange(K);},De=K=>{let z=y.indexOf(K),X=[...y];z===-1?X.push(K):X.splice(z,1),k(X);},je=K=>{if(o)return;let z=Ce.indexOf(K),X=[...Ce];z===-1?X.push(K):X.splice(z,1),Be(X);},st=K=>{a().includes(K)&&N(X=>X.includes(K)?X.filter(fe=>fe!==K):[...X,K]);},pt=(K,z)=>{!K||!z||K===z||P(X=>{let fe=X.indexOf(K),Se=X.indexOf(z);if(fe===-1||Se===-1)return X;let Ae=[...X];return Ae.splice(fe,1),Ae.splice(Se,0,K),Ae});},Bt=K=>{let z=K?.active?.id,X=K?.over?.id;typeof z=="string"&&typeof X=="string"&&pt(z,X);},Xt=K=>{t.onLayoutSave&&t.onLayoutSave({visibleColumns:y,columnOrder:w,order:r?"asc":l,orderBy:r?"":p,sortBy:r?[]:h,grouping:Ce,columnWidths:W,showSummary:I,summaryColumns:R});},Vt=K=>{let{layout:z,layoutId:X}=Li(K,t.tableKey||"default");X?(be(X),he(X)):(be(""),he("")),z&&(z.visibleColumns&&k(z.visibleColumns),Array.isArray(z.columnOrder)&&P(z.columnOrder),r?(d("asc"),m(""),f([])):(z.order&&d(z.order),z.orderBy&&m(z.orderBy),Array.isArray(z.sortBy)&&f(z.sortBy)),z.grouping&&Be(z.grouping),z.columnWidths&&ee(z.columnWidths),z.showSummary!==void 0&&S(!!z.showSummary),Array.isArray(z.summaryColumns)&&N(z.summaryColumns));},wt=K=>{let z=K?.layoutData||K?.layout||K||{};z.visibleColumns&&k(z.visibleColumns),Array.isArray(z.columnOrder)&&P(z.columnOrder),r?(d("asc"),m(""),f([])):(z.order&&d(z.order),z.orderBy!==void 0&&m(z.orderBy),Array.isArray(z.sortBy)&&f(z.sortBy)),z.grouping&&Be(z.grouping),z.columnWidths&&ee(z.columnWidths),z.showSummary!==void 0&&S(!!z.showSummary),Array.isArray(z.summaryColumns)&&N(z.summaryColumns),L(new Set),b(0),K?.id&&he(K.id),be("");};useEffect(()=>{t.layout&&Vt({layout:t.layout});},[t.layout]);let Wt=K=>{K.preventDefault(),Z(q===null?{mouseX:K.clientX+2,mouseY:K.clientY-6}:null);},ft=()=>{Z(null);},Nt=useMemo(()=>{if(!I)return {};let K={};t.columns.forEach(X=>{if(X.numeric&&R.includes(X.id)){let fe=ve.reduce((Se,Ae)=>{let $e=parseFloat(Ae[X.id]);return Se+(isNaN($e)?0:$e)},0);K[X.id]=fe.toFixed(2);}else K[X.id]="";});let z=t.columns.find(X=>y.includes(X.id)&&!X.numeric);return z&&!z.numeric&&(K[z.id]="Total"),K},[ve,t.columns,I,R,y]),lt=()=>{if(!t.columns||!ve)return;let K=t.columns.map(Ae=>Ae.label).join(","),z=ve.map(Ae=>t.columns.map($e=>{let Ke=Ae[$e.id];return `"${(Ke==null?"":String(Ke)).replace(/"/g,'""')}"`}).join(",")).join(`
2
- `),X=`data:text/csv;charset=utf-8,${K}
3
- ${z}`,fe=encodeURI(X),Se=document.createElement("a");Se.setAttribute("href",fe),Se.setAttribute("download",`${t.title||"export"}.csv`),document.body.appendChild(Se),Se.click(),document.body.removeChild(Se);},Ft=()=>{J(true);},Zt=()=>{J(false);};return {isMobile:false,columns:de,order:l,setOrder:d,orderBy:p,setOrderBy:m,sortBy:h,setSortBy:f,applyMultiSort:re,clearMultiSort:Ge,columnOrder:w,setColumnOrder:P,filterText:i,setFilterText:s,visibleColumns:y,setVisibleColumns:k,showSummary:I,setShowSummary:S,summaryColumns:R,grouping:Ce,setGrouping:Be,expandedGroups:A,setExpandedGroups:L,groupAnchorEl:V,setGroupAnchorEl:Q,summaryAnchorEl:H,setSummaryAnchorEl:B,columnWidths:W,setColumnWidths:ee,anchorEl:O,setAnchorEl:_,contextMenu:q,setContextMenu:Z,sensors:void 0,sortedAndFilteredRows:We,visibleRows:we,summaryRow:Nt,page:u,setPage:oe,rowsPerPage:C,setRowsPerPage:ye,totalDisplayCount:Oe,selected:x,setSelected:v,isAllExpanded:U.length>0&&U.every(K=>A.has(K)),handleColumnResize:Le,handleRequestSort:At,handleSelectAllClick:pe,handleClick:xe,toggleSummaryColumn:st,handleDragEnd:Bt,handleColumnReorder:pt,handleExport:lt,handleContextMenu:Wt,handleCloseContextMenu:ft,toggleColumnVisibility:De,toggleGroupExpand:at,toggleGroupField:je,handleToggleAll:It,handleExpandGroupRecursively:Ze,handleCollapseGroupRecursively:xt,isGroupFullyExpanded:Ot,handleLayoutLoad:wt,handleVariantLoad:Vt,handleLayoutSave:Xt,effectiveAppId:t.appId||"",currentLayoutData:{visibleColumns:y,order:r?"asc":l,orderBy:r?"":p,sortBy:r?[]:h,columnOrder:w,grouping:Ce,columnWidths:W,showSummary:I,summaryColumns:R},currentLayoutId:le,layoutIdToLoad:ze,onPageChange:oe,onRowsPerPageChange:ye,graphReportOpen:Y,handleOpenGraphReport:Ft,handleCloseGraphReport:Zt}};var cD=t=>f("tbody",{...t}),dD=({align:t,...o})=>f("td",{align:t==="inherit"?void 0:t,...o}),pD=t=>f("div",{...t}),uD=t=>f("thead",{...t}),mD=t=>f("tr",{...t}),er=t=>{let{t:o}=ce(),r="0.85rem",{title:n,showToolbar:a=true,selectionMode:i,selected:s=[],onSelectionChange:l,actions:d,extraTools:p,fitContainer:m=false,fullWidth:h=false,maxHeight:f$1,loading:u=false,rowsPerPageOptions:b=[20,50,100,-1],onLayoutSave:C,filterConfig:g$1,rowKey:x,tableKey:v="default",graphReport:y,quickCreate:k,quickEdit:w,quickDelete:P,serviceUrl:I,disableGrouping:S=false,disableSorting:R=false}=t,N=n||o("table.title.default"),{isMobile:T,columns:M,order:A,orderBy:L,filterText:W,setFilterText:ee,visibleColumns:O,showSummary:_,setShowSummary:V,summaryColumns:Q,grouping:H,setGrouping:B,expandedGroups:q,groupAnchorEl:Z,setGroupAnchorEl:Y,summaryAnchorEl:J,setSummaryAnchorEl:le,columnWidths:he,anchorEl:ze,setAnchorEl:be,contextMenu:Ce,sensors:Be,sortedAndFilteredRows:de,summaryRow:ve,visibleRows:We,isAllExpanded:et,page:nt,setPage:it,rowsPerPage:U,setRowsPerPage:Re,totalDisplayCount:we,setSelected:Oe,handleColumnResize:at,handleRequestSort:Ze,handleSelectAllClick:xt,handleClick:It,toggleSummaryColumn:Ot,handleDragEnd:At,handleExport:re,handleContextMenu:Ge,handleCloseContextMenu:Le,toggleColumnVisibility:pe,toggleGroupExpand:xe,handleToggleAll:oe,handleExpandGroupRecursively:ye,handleCollapseGroupRecursively:De,isGroupFullyExpanded:je,handleLayoutLoad:st,handleVariantLoad:pt,handleLayoutSave:Bt,effectiveAppId:Xt,currentLayoutData:Vt,currentLayoutId:wt,layoutIdToLoad:Wt,graphReportOpen:ft,handleOpenGraphReport:Nt,handleCloseGraphReport:lt}=hn(t),Ft=y?.enabled??false,Zt=Ft&&(y?.interaction?.enabled??true),K=Mi(),z=!!k?.enabled,X=!!w?.enabled,fe=!!P?.enabled,Se=k?.fields,Ae=k?.excludeFields||[],$e=k?.initialValues||{},[Ke,Ye]=Jt__default.useState(false),[ut,gt]=Jt__default.useState(false),[Mt,bt]=Jt__default.useState({}),[F,j]=Jt__default.useState(false),[ge,Te]=Jt__default.useState(false),[Je,qe]=Jt__default.useState({}),[St,ht]=Jt__default.useState(false),[mt,yt]=Jt__default.useState(false),ro=u||ut||ge||mt,Et=Jt__default.useMemo(()=>{let ne=[...M];if(Array.isArray(Se)&&Se.length>0){let me=new Set(Se);ne=ne.filter(te=>me.has(te.id));}if(Ae.length>0){let me=new Set(Ae);ne=ne.filter(te=>!me.has(te.id));}return ne.filter(me=>!!me?.id)},[M,Ae,Se]),Yt=x||"id",Ht=Jt__default.useMemo(()=>{let ne=new Set(s);return de.filter(me=>ne.has(me?.[Yt]))},[s,de,Yt]),Ut=Ht.length===1?Ht[0]:null,$t=w?.fields,to=w?.excludeFields||[],no=w?.editableFields||[],fo=w?.nonEditableFields||[],Io=w?.primaryKeys?.length?w.primaryKeys:[Yt],Mo=Jt__default.useMemo(()=>{let ne=[...M];if(Array.isArray($t)&&$t.length>0){let me=new Set($t);ne=ne.filter(te=>me.has(te.id));}if(to.length>0){let me=new Set(to);ne=ne.filter(te=>!me.has(te.id));}return ne.filter(me=>!!me?.id)},[M,to,$t]),nr=Jt__default.useMemo(()=>new Set(Io),[Io]),Co=Jt__default.useMemo(()=>new Set(no),[no]),Fo=Jt__default.useMemo(()=>new Set(fo),[fo]),Ur=Jt__default.useCallback(ne=>Co.size>0?Co.has(ne):!(Fo.has(ne)||nr.has(ne)),[Co,Fo,nr]);Jt__default.useEffect(()=>{!ft&&K.hasActiveFilters&&K.clearAll();},[ft,K.hasActiveFilters,K.clearAll]);let Kr=()=>{let ne={};Et.forEach(me=>{ne[me.id]=$e[me.id]??"";}),bt(ne),Ye(true);},Ar=()=>{ut||Ye(false);},qr=(ne,me)=>{bt(te=>({...te,[ne]:me}));},Xr=async()=>{if(!k?.onSubmit){Ye(false);return}try{gt(!0),await k.onSubmit(Mt),Ye(!1);}finally{gt(false);}},Ro=()=>{if(!Ut)return;let ne={};Mo.forEach(te=>{ne[te.id]=Ut[te.id]??"";});let me=w?.getInitialValues?{...ne,...w.getInitialValues(Ut)}:ne;qe(me),j(true);},Er=()=>{ge||j(false);},Zr=(ne,me)=>{qe(te=>({...te,[ne]:me}));},Xo=async()=>{if(Ut){if(!w?.onSubmit){j(false);return}try{Te(!0),await w.onSubmit(Je,Ut),j(!1);}finally{Te(false);}}},ar=()=>{Ht.length!==0&&ht(true);},En=()=>{mt||ht(false);},Lr=async()=>{if(Ht.length===0){ht(false);return}if(!P?.onConfirm){ht(false),Oe([]),l?.([]);return}try{yt(!0),await P.onConfirm(Ht),ht(!1),Oe([]),l?.([]);}finally{yt(false);}},D=de,{fieldMapping:$}=pn({rows:D,config:{...y,title:y?.title||`${N} ${o("graph.reportTitle")}`}}),G=Jt__default.useMemo(()=>Zt?K.applyRows(D,$):D,[Zt,K.applyRows,D,$]),{model:ue}=pn({rows:G,config:{...y,title:y?.title||`${N} ${o("graph.reportTitle")}`,fieldMapping:$}}),Fe=ue.table.columns.map(ne=>({id:ne.id,label:ne.label,align:ne.align||"left",minWidth:120,numeric:ne.align==="right"})),rt=Xt?f(gn,{appId:Xt,tableKey:v,currentLayoutData:Vt,onLayoutLoad:st,targetLayoutId:Wt,activeLayoutId:wt,serviceUrl:I??g$1?.serviceUrl}):null,_e=g(e,{children:[!S&&f(cn,{groupAnchorEl:Z,setGroupAnchorEl:Y,grouping:H,setGrouping:B,columns:M}),f(dn,{anchorEl:ze,setAnchorEl:be,columns:M,visibleColumns:O,toggleColumnVisibility:pe}),f(Ci,{anchorEl:J,setAnchorEl:le,showSummary:_,setShowSummary:V,columns:M,summaryColumns:Q,toggleSummaryColumn:Ot}),f(xi,{contextMenu:Ce,handleCloseContextMenu:Le,columns:M,visibleColumns:O,toggleColumnVisibility:pe})]});return T?g("div",{sx:{display:"flex",flexDirection:"column",gap:2,height:"100%"},children:[g$1&&f($o,{fields:g$1.fields,filters:g$1.filters,onFilterChange:g$1.onFilterChange,onSearch:g$1.onSearch,variants:g$1.variants||[],currentVariantId:g$1.currentVariantId,onVariantLoad:g$1.onVariantLoad,onVariantSave:g$1.onVariantSave,onVariantDelete:g$1.onVariantDelete,onVariantSetDefault:g$1.onVariantSetDefault,appId:g$1.appId,tableKey:v,currentLayout:[{tableKey:v,layoutData:Vt}],variantService:g$1.variantService,serviceUrl:I??g$1.serviceUrl}),f(Pp,{title:N,loading:u,showSummary:_,setShowSummary:V,setAnchorEl:be,setSummaryAnchorEl:le,filterText:W,setFilterText:ee,sortedAndFilteredRows:de,selected:s,columns:M,visibleColumns:O,summaryRow:ve,handleClick:It,selectionMode:i}),_e]}):g("div",{sx:{width:h?"100%":"auto",mb:m?0:2,...m?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[g$1&&f("div",{sx:{mb:2},children:f($o,{fields:g$1.fields,filters:g$1.filters,onFilterChange:g$1.onFilterChange,onSearch:g$1.onSearch,variants:g$1.variants||[],currentVariantId:g$1.currentVariantId,onVariantLoad:ne=>{pt(ne),g$1.onVariantLoad&&g$1.onVariantLoad(ne);},onVariantSave:g$1.onVariantSave,onVariantDelete:g$1.onVariantDelete,onVariantSetDefault:g$1.onVariantSetDefault,loading:u,appId:g$1.appId,tableKey:v,currentLayout:[{tableKey:v,layoutData:Vt}],currentLayoutId:wt,layoutRefs:[{tableKey:v,layoutId:wt}],variantService:g$1.variantService,serviceUrl:I??g$1.serviceUrl})}),g(Ne,{className:"orb-ctable-surface",sx:{width:h?"100%":"auto",mb:m?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":ro?{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"3px",background:"linear-gradient(90deg, color-mix(in oklch, var(--orb-primary) 0%, transparent) 0%, color-mix(in oklch, var(--orb-primary) 25%, transparent) 25%, var(--orb-primary) 50%, color-mix(in oklch, var(--orb-primary) 25%, transparent) 75%, color-mix(in oklch, var(--orb-primary) 0%, transparent) 100%)",backgroundSize:"220% 100%",animation:"cTableTopMarquee 1.2s linear infinite",zIndex:6,pointerEvents:"none"}:{},"@keyframes cTableTopMarquee":{"0%":{backgroundPosition:"220% 0"},"100%":{backgroundPosition:"-120% 0"}},...f$1?{height:f$1}:m?{flex:1,minHeight:0,height:"100%"}:{}},children:[a&&f(fi,{filterText:W,setFilterText:ee,onRowsPerPageChange:Re,rowsPerPage:U,rowsPerPageOptions:b,page:nt,count:we,onPageChange:it,actions:d,extraTools:p,grouping:H,disableGrouping:S,groupAnchorEl:Z,setGroupAnchorEl:Y,showSummary:_,setShowSummary:V,anchorEl:ze,setAnchorEl:be,summaryAnchorEl:J,setSummaryAnchorEl:le,handleExport:re,showCreateButton:z,onOpenCreateDialog:Kr,showEditButton:X,onOpenEditDialog:Ro,editDisabled:Ht.length!==1,showDeleteButton:fe,onOpenDeleteConfirm:ar,deleteDisabled:Ht.length===0,onLayoutSave:C||g$1?.variantService&&g$1?.appId?Bt:void 0,loading:u,layoutManager:rt,onOpenGraphReport:Ft?Nt:void 0}),f("div",{sx:{flex:1,...f$1?{maxHeight:f$1,height:f$1}:m?{height:0,maxHeight:"none"}:{maxHeight:"calc(100vh - 320px)"},overflowY:"auto",overflowX:"auto",position:"relative",minHeight:0},children:f(DndContext,{sensors:Be,collisionDetection:closestCenter,onDragEnd:At,modifiers:[restrictToHorizontalAxis],children:g("table",{className:"orb-tbl orb-ctable",style:{minWidth:h?750:void 0,width:h?"100%":"auto",tableLayout:Object.keys(he).length>0?"fixed":"auto",borderCollapse:"separate",borderSpacing:0,fontSize:r},"aria-labelledby":"tableTitle",children:[f(vi,{columns:M,visibleColumns:O,order:A,orderBy:L,onRequestSort:Ze,disableSorting:R,onContextMenu:Ge,selectionMode:i,grouping:H,isAllExpanded:et,handleToggleAll:oe,rowCount:de.length,numSelected:s.length,onSelectAllClick:xt,columnWidths:he,onColumnResize:at}),f(yi,{visibleRows:We,columns:M,visibleColumns:O,selectionMode:i,selected:s,orderBy:L,loading:u,expandedGroups:q,toggleGroupExpand:xe,handleExpandGroupRecursively:ye,handleCollapseGroupRecursively:De,isGroupFullyExpanded:je,handleClick:It,onSelectionChange:l,grouping:H,rowKeyProp:x,page:nt,rowsPerPage:U}),_&&f(kp,{showSummary:_,columns:M,visibleColumns:O,summaryRow:ve,selectionMode:i?.toString(),grouping:H,columnWidths:he,orderBy:L,zIndex:3})]})})})]}),z&&g(Lt,{open:Ke,onClose:Ar,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:ne=>`1px solid ${ne.palette.divider}`,bgcolor:"background.paper"}}},children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:k?.title||o("quickCreate.createWithTitle",{title:N})}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Et.map(ne=>{let me=ne.type==="number"||ne.numeric?"number":ne.type==="date"?"date":"text",te=ne.label||ne.id;return f(He,{label:te,value:Mt[ne.id]??"",onChange:Ee=>qr(ne.id,Ee.target.value),type:me,size:"small",fullWidth:true,InputLabelProps:{shrink:me==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-create-${ne.id}`)}),k?.description&&f(jo,{severity:"info",sx:{fontSize:"0.85rem","& span":{fontSize:"0.85rem"}},children:k.description})]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[f(Pe,{onClick:Ar,sx:{fontSize:"0.85rem"},disabled:ut,children:k?.cancelLabel||o("common.cancel")}),f(Pe,{onClick:Xr,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:ut,children:k?.submitLabel||o("common.save")})]})]}),X&&g(Lt,{open:F,onClose:Er,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:ne=>`1px solid ${ne.palette.divider}`,bgcolor:"background.paper"}}},children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:w?.title||o("quickEdit.editWithTitle",{title:N})}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Mo.map(ne=>{let me=ne.type==="number"||ne.numeric?"number":ne.type==="date"?"date":"text",te=ne.label||ne.id,Ee=Ur(ne.id);return f(He,{label:te,value:Je[ne.id]??"",onChange:Qe=>Zr(ne.id,Qe.target.value),type:me,size:"small",fullWidth:true,disabled:!Ee,InputLabelProps:{shrink:me==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-edit-${ne.id}`)}),w?.description&&f(jo,{severity:"info",sx:{fontSize:"0.85rem","& span":{fontSize:"0.85rem"}},children:w.description})]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[f(Pe,{onClick:Er,sx:{fontSize:"0.85rem"},disabled:ge,children:w?.cancelLabel||o("common.cancel")}),f(Pe,{onClick:Xo,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:ge||!Ut,children:w?.submitLabel||o("common.save")})]})]}),fe&&f(Yn,{open:St,type:"warning",title:P?.title||o("quickDelete.confirmTitle"),message:P?.message||(Ht.length>1?o("quickDelete.confirmMessageMultiple",{count:Ht.length}):o("quickDelete.confirmMessageSingle")),confirmText:P?.confirmText||o("common.delete"),cancelText:P?.cancelText||o("common.cancel"),onClose:En,onConfirm:Lr}),_e,Ft&&f(Ti,{open:ft,onClose:lt,model:ue,aiAssistant:y?.aiAssistant,interaction:Zt?{enabled:true,filters:K.filters,fieldMapping:$,onPrimaryDimensionClick:ne=>K.setFilter("primaryDimension",ne),onSecondaryDimensionClick:ne=>K.setFilter("secondaryDimension",ne),onStatusClick:ne=>K.setFilter("status",ne),onClearFilter:K.clearFilter,onClearAll:K.clearAll}:void 0,tableContent:f(er,{appId:Xt||"graph-report-internal",title:o("graph.dataBody"),columns:Fe,rows:ue.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false}})})]})},gD=er;var xD=({id:t,title:o,hideHeader:r=true,filterConfig:n,tableProps:a,children:i,spacing:s=1,mode:l="separated"})=>{let d=n?{...n,appId:n.appId||t}:void 0,p={...a,appId:a.appId||t};return g(mi,{title:o,hideHeader:r,children:[g(se,{spacing:s,sx:{height:"100%",overflow:"hidden"},children:[l==="separated"&&d&&f("div",{sx:{flexShrink:0},children:f($o,{...d})}),f("div",{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:f(er,{...p,fitContainer:true,filterConfig:l==="integrated"?d:void 0})})]}),i]})};var ID=({metadata:t,fetchData:o,initialRowsPerPage:r=20,rowsPerPageOptions:n=[20,50,100,-1],tableKey:a="default",mode:i="integrated",serviceUrl:s,variantService:l})=>{let{t:d}=ce(),[p,m]=useState(false),[h,f]=useState([]),[u,b]=useState({}),[C,g]=useState(t.variants||[]),[x,v]=useState(t.layout||null),[y,k]=useState(""),[w,P]=useState(0),[I,S]=useState(0),[R,N]=useState(r),[T,M]=useState([]),[A,L]=useState("asc"),[W,ee]=useState("");useEffect(()=>{let J={};t.filters.forEach(le=>{le.defaultValue!==void 0&&(J[le.id]=le.defaultValue);}),b(J);},[t.filters]);let O=useCallback(async(J,le,he,ze,be)=>{m(true);try{let Ce={...J,page:le+1,limit:he,sort:be,order:ze},Be;o?Be=await o(Ce):typeof t.api=="function"?Be=await t.api(Ce):t.api&&typeof t.api=="object"?(console.log("Fetching from URL:",t.api.url,Ce),Be={rows:[],total:0}):(console.warn("No API configured for report"),Be={rows:[],total:0}),Be&&(f(Be.rows||[]),P(Be.total||0));}catch(Ce){console.error("Failed to fetch report data",Ce);}finally{m(false);}},[t.api,o]);useEffect(()=>{O(u,I,R,A,W);},[O,I,R,A,W]);let _=()=>{S(0),O(u,0,R,A,W);},V=J=>{S(0),N(J);},Q=(J,le)=>{L(le),ee(J);},H=J=>{b(J);},B=J=>{k(J?.id||"");let le=Ei(J,a);if(le){let ze=le.values??le;b(ze),O(ze,0,R,A,W),S(0);}let{layout:he}=Li(J,a);he&&v(he);},q=J=>{let le={...J,id:Date.now().toString(),createdAt:new Date().toISOString()};g(he=>[...he,le]);},Z=J=>{v(J);};return {pageProps:{id:t.id,title:t.title,mode:i,filterConfig:{appId:t.id,tableKey:a,fields:t.filters,filters:u,onFilterChange:H,onSearch:_,onVariantLoad:B,onVariantSave:q,onVariantDelete:J=>g(le=>le.filter(he=>he.id!==J)),onVariantSetDefault:J=>{g(le=>le.map(he=>({...he,isDefault:he.id===J})));},variants:C,currentVariantId:y,variantService:l,serviceUrl:s},tableProps:{appId:t.id,tableKey:a,columns:t.columns,rows:h,loading:p,rowKey:"id",count:w,page:I,rowsPerPage:R,rowsPerPageOptions:n,onPageChange:S,onRowsPerPageChange:V,selectionMode:"multiple",selected:T,onSelectionChange:M,onLayoutSave:Z,layout:x,title:t.title,showSummary:true,order:A,orderBy:W,serviceUrl:s,onSortChange:Q,graphReport:t.graphReport||{enabled:true,title:`${t.title} ${d("graph.reportTitle")}`}}},filters:u,rows:h,loading:p,refresh:_}};var Ib=new Set(["id","title","description","icon","iconNode","meta"]),Mb=t=>t.replace(/([A-Z])/g," $1").replace(/[._-]+/g," ").replace(/^\w/,o=>o.toUpperCase()).trim(),Rb=t=>Object.entries(t).filter(([o,r])=>!Ib.has(o)&&r!==null&&r!==void 0&&["string","number","boolean"].includes(typeof r)).map(([o,r])=>({key:o,label:Mb(o),value:String(r)})),Jp=({item:t,open:o,onClose:r,onDownloadClick:n,renderContent:a,downloadTooltip:i,closeTooltip:s})=>{let{t:l}=ce(),p=go()==="dark"?"var(--orb-p300)":"var(--orb-primary)";Jt__default.useEffect(()=>{if(!o)return;let h=f=>{f.key==="Escape"&&r();};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[o,r]);let m=Rb(t);return typeof document>"u"?null:createPortal(g(e,{children:[f("div",{"aria-hidden":"true",onClick:r,sx:{position:"fixed",inset:0,zIndex:1299,backgroundColor:"rgba(1, 9, 26, 0.4)",opacity:o?1:0,pointerEvents:o?"auto":"none",transition:"opacity 200ms ease"}}),g("div",{role:"dialog","aria-modal":"true","aria-label":t.title,sx:{position:"fixed",top:"50%",left:"50%",zIndex:1300,width:"min(520px, 92vw)",maxHeight:"82vh",display:"flex",flexDirection:"column",bgcolor:"background.paper",border:"1px solid",borderColor:"divider",borderRadius:3,boxShadow:"0 24px 64px rgba(1, 9, 26, 0.3)",transform:o?"translate(-50%, -50%) scale(1)":"translate(-50%, -47%) scale(0.96)",opacity:o?1:0,transition:"transform 200ms ease, opacity 180ms ease"},children:[g(se,{direction:"row",spacing:1.5,alignItems:"center",sx:{p:2.5,pb:2,borderBottom:"1px solid",borderColor:"divider",flexShrink:0},children:[f("div",{sx:{width:56,height:56,flex:"0 0 auto",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:t.iconNode??f(Pt,{name:t.icon??"product",size:30,style:{color:p}})}),g("div",{sx:{flex:1,minWidth:0},children:[f(E,{component:"div",sx:{fontWeight:700,fontSize:"1.1rem",lineHeight:1.3,wordBreak:"break-word"},children:t.title}),t.meta?f(E,{component:"div",sx:{fontSize:"0.8rem",color:"text.secondary"},children:t.meta}):null]}),f(ie,{tooltip:s??l("cardPage.close"),"aria-label":s??l("cardPage.close"),onClick:r,children:f(Pt,{name:"decline",size:18})})]}),f("div",{sx:{flex:1,minHeight:0,overflowY:"auto",p:2.5},children:a?a(t):g(e,{children:[t.description?f(E,{component:"div",sx:{fontSize:"0.9rem",lineHeight:1.6,color:"text.primary"},children:t.description}):null,m.length>0?f("div",{sx:{mt:t.description?2.5:0,display:"grid",gap:1.5},children:m.map(h=>g("div",{children:[f(E,{component:"div",sx:{fontSize:"0.72rem",fontWeight:600,color:"text.secondary",textTransform:"uppercase",letterSpacing:"0.04em"},children:h.label}),f(E,{component:"div",sx:{fontSize:"0.88rem",color:"text.primary",wordBreak:"break-word"},children:h.value})]},h.key))}):null]})}),n?f("div",{sx:{p:2.5,pt:2,borderTop:"1px solid",borderColor:"divider",flexShrink:0},children:f(Pe,{variant:"contained",sx:{width:"100%"},startIcon:f(Pt,{name:"download",size:16}),onClick:()=>n(t),children:i??l("cardPage.download")})}):null]})]}),document.body)};var Db={display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3",overflow:"hidden"},Nb=({item:t,onDetailClick:o,onDownloadClick:r,detailTooltip:n,downloadTooltip:a})=>{let{t:i}=ce(),l=go()==="dark"?"var(--orb-p300)":"var(--orb-primary)",d=t.iconNode??f(Pt,{name:t.icon??"product",size:26,style:{color:l}});return g(Ne,{elevation:0,sx:{p:2,height:"100%",display:"flex",flexDirection:"column",borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",boxShadow:"0 8px 20px rgba(15, 23, 42, 0.06)",transition:"transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease","&:hover":{transform:"translateY(-2px)",borderColor:"primary.main",boxShadow:"0 14px 32px rgba(15, 23, 42, 0.12)"}},children:[g(se,{direction:"row",spacing:1.5,alignItems:"center",children:[f("div",{sx:{width:48,height:48,flex:"0 0 auto",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:2.5,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:d}),g("div",{sx:{flex:1,minWidth:0},children:[f(E,{component:"div",noWrap:true,sx:{fontWeight:700,fontSize:"0.98rem",lineHeight:1.3},children:t.title}),t.meta?f(E,{component:"div",noWrap:true,sx:{fontSize:"0.75rem",color:"text.secondary"},children:t.meta}):null]})]}),f("div",{sx:{mt:1.5,flex:1,minHeight:0},children:f(E,{component:"div",sx:{fontSize:"0.84rem",lineHeight:1.45,color:"text.primary",...Db},children:t.description||"\xA0"})}),g(se,{direction:"row",spacing:.5,justifyContent:"flex-end",sx:{mt:1.5},children:[f(ie,{tooltip:n??i("cardPage.viewDetails"),"aria-label":n??i("cardPage.viewDetails"),onClick:()=>o?.(t),children:f(Pt,{name:"show",size:18})}),f(ie,{tooltip:a??i("cardPage.download"),"aria-label":a??i("cardPage.download"),onClick:()=>r?.(t),children:f(Pt,{name:"download",size:18})})]})]})},tu=({items:t,loading:o=false,onDetailClick:r,onDownloadClick:n,minCardWidth:a=260,detailTooltip:i,downloadTooltip:s,emptyText:l,detailPanel:d=true,renderDetailContent:p})=>{let{t:m}=ce(),[h,f$1]=Jt__default.useState(null),[u,b]=Jt__default.useState(false),C=x=>{r?.(x),d&&(f$1(x),requestAnimationFrame(()=>requestAnimationFrame(()=>b(true))));},g$1=()=>{b(false),setTimeout(()=>f$1(null),260);};return o?f("div",{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",minHeight:240},children:f(Zo,{})}):t.length?g(e,{children:[f("div",{sx:{flex:1,minHeight:0,overflowY:"auto",display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(${a}px, 1fr))`,gap:2,alignContent:"start",p:.5},children:t.map(x=>f(Nb,{item:x,onDetailClick:C,onDownloadClick:n,detailTooltip:i,downloadTooltip:s},x.id))}),d&&h?f(Jp,{item:h,open:u,onClose:g$1,onDownloadClick:n,renderContent:p,downloadTooltip:s}):null]}):f("div",{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",minHeight:240},children:f(E,{sx:{color:"text.secondary"},children:l??m("cardPage.empty")})})};var ZD=({id:t,title:o,hideHeader:r=true,filterConfig:n,gridProps:a,children:i,spacing:s=1})=>{let l=n?{...n,appId:n.appId||t}:void 0;return g(mi,{title:o,hideHeader:r,children:[g(se,{spacing:s,sx:{height:"100%",overflow:"hidden"},children:[l&&f("div",{sx:{flexShrink:0},children:f($o,{...l})}),f("div",{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:f(tu,{...a})})]}),i]})};var eN=({metadata:t,fetchData:o,tableKey:r="default",variantService:n,serviceUrl:a,onDetailClick:i,onDownloadClick:s,minCardWidth:l})=>{let[d,p]=useState(false),[m,h]=useState([]),[f,u]=useState(0),[b,C]=useState({}),[g,x]=useState(t.variants||[]),[v,y]=useState("");useEffect(()=>{let N={};t.filters.forEach(T=>{T.defaultValue!==void 0&&(N[T.id]=T.defaultValue);}),C(N);},[t.filters]);let k=useCallback(async N=>{p(true);try{let T=o?await o({...N}):{rows:[],total:0};h(T?.rows||[]),u(T?.total||0);}catch(T){console.error("Failed to fetch card page data",T);}finally{p(false);}},[o]);useEffect(()=>{k(b);},[k]);let w=()=>{k(b);},P=N=>{C(N);},I=N=>{y(N?.id||"");let T=Ei(N,r);if(T){let M=T.values??T;C(M),k(M);}},S=N=>{let T={...N,id:Date.now().toString(),createdAt:new Date().toISOString()};x(M=>[...M,T]);};return {pageProps:{id:t.id,title:t.title,filterConfig:{appId:t.id,tableKey:r,fields:t.filters,filters:b,onFilterChange:P,onSearch:w,onVariantLoad:I,onVariantSave:S,onVariantDelete:N=>x(T=>T.filter(M=>M.id!==N)),onVariantSetDefault:N=>{x(T=>T.map(M=>({...M,isDefault:M.id===N})));},variants:g,currentVariantId:v,variantService:n,serviceUrl:a},gridProps:{items:m,loading:d,onDetailClick:i,onDownloadClick:s,minCardWidth:l}},items:m,total:f,filters:b,loading:d,refresh:w}};var Eb=t=>[...t].sort((o,r)=>r.value-o.value),rN=({bars:t=[],lines:o=[],combos:r=[],heatmap:n=[],pies:a=[],waterfalls:i=[]})=>{let s=useMemo(()=>Eb(t),[t]),l=useMemo(()=>[...o],[o]),d=useMemo(()=>[...r],[r]),p=useMemo(()=>[...n],[n]),m=useMemo(()=>{let f=a.reduce((u,b)=>u+b.value,0);return a.map(u=>({...u,percent:f>0?u.value/f*100:u.percent}))},[a]),h=useMemo(()=>[...i],[i]);return {bars:s,lines:l,combos:d,heatmap:p,pies:m,waterfalls:h}};var lN=({apiKey:t,query:o,zoom:r=14,mapType:n="roadmap"})=>useMemo(()=>!t||!o?"":oa({apiKey:t,query:o,zoom:r,mapType:n}),[t,o,r,n]),cN=({keyword:t,location:o})=>useMemo(()=>ki({keyword:t,location:o?{lng:o.lng,lat:o.lat,name:o.name}:void 0}),[t,o]);var sa=({code:t,language:o="text",copyable:r=true,showLineNumbers:n=false,wrapLongLines:a=false,maxHeight:i})=>{let[s,l]=useState(false),d=useMemo(()=>t.replace(/\n$/,"").split(`
4
- `),[t]);return g("div",{style:{border:"1px solid var(--orb-border)",borderRadius:12,overflow:"hidden",background:"var(--orb-canvas)"},children:[g("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"4.8px 8px",background:"var(--orb-hover)",borderBottom:"1px solid var(--orb-border)"},children:[f("span",{style:{fontSize:12,fontWeight:500,textTransform:"uppercase",letterSpacing:.5,color:"var(--orb-muted)",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:o}),r&&f(ie,{size:"small",tooltip:s?"Copied":"Copy",onClick:async()=>{try{await navigator.clipboard.writeText(t),l(!0),window.setTimeout(()=>l(!1),1400);}catch{l(false);}},children:s?f(xo,{size:14,strokeWidth:1.8}):f(No,{size:14,strokeWidth:1.8})})]}),f("pre",{style:{margin:0,padding:10,fontSize:"0.82rem",lineHeight:1.55,overflow:"auto",maxHeight:i,background:"var(--orb-surface)",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:n?d.map((m,h)=>g("div",{style:{display:"flex"},children:[f("span",{style:{width:34,flexShrink:0,textAlign:"right",paddingRight:8,color:"var(--orb-disabled-fg)",userSelect:"none"},children:h+1}),f("span",{style:{whiteSpace:a?"pre-wrap":"pre",wordBreak:a?"break-word":"normal"},children:m})]},`${h}-${m}`)):f("code",{style:{display:"block",whiteSpace:a?"pre-wrap":"pre",wordBreak:a?"break-word":"normal"},children:t})})]})};var zb=t=>{let o=t.trim();return o.startsWith("$$")&&o.endsWith("$$")&&o.length>=4&&(o=o.slice(2,-2).trim()),o.startsWith("$")&&o.endsWith("$")&&o.length>=2&&(o=o.slice(1,-1).trim()),o},Vb=async t=>new Function("m","return import(m)")(t),la=({expression:t,inline:o=false,allowKatex:r=false})=>{let n=useMemo(()=>zb(t),[t]),[a,i]=useState("");return useEffect(()=>{let s=true;return (async()=>{if(!r||!n){i("");return}try{let d=await Vb("katex"),m=(d?.default||d)?.renderToString?.(n,{displayMode:!o,throwOnError:!1,strict:"warn"});s&&typeof m=="string"&&i(m);}catch{s&&i("");}})(),()=>{s=false;}},[r,n,o]),n?a?f(Ie,{component:o?"span":"div",sx:{display:o?"inline-flex":"block",my:o?0:.5,overflowX:"auto"},dangerouslySetInnerHTML:{__html:a}}):o?f(Ie,{component:"code",sx:{px:.4,py:.05,borderRadius:.8,bgcolor:"action.hover",fontSize:"0.82em",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:n}):f(Ie,{sx:{my:1,p:1,borderRadius:1.2,border:"1px dashed",borderColor:"divider",bgcolor:"background.paper"},children:f(vo,{component:"pre",sx:{m:0,whiteSpace:"pre-wrap",fontSize:"0.9rem",lineHeight:1.5,fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:n})}):null};var _b=async t=>new Function("m","return import(m)")(t),hl=({code:t,title:o="Mermaid Diagram",height:r=320,enabled:n=true})=>{let[a,i]=useState(""),[s,l]=useState(""),[d,p]=useState(false),m=useMemo(()=>t.trim(),[t]);return useEffect(()=>{let h=true;return (async()=>{if(!n||!m){i(""),l("");return}p(true),l(""),i("");try{let u=await _b("mermaid"),b=u?.default||u;if(!b||typeof b.render!="function")throw new Error("Mermaid runtime is not available");b.initialize?.({startOnLoad:!1,securityLevel:"loose",theme:"default"});let C=await b.render(`orbcafe-mermaid-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,m),g=typeof C=="string"?C:C?.svg;h&&typeof g=="string"&&i(g);}catch(u){if(h){let b=u instanceof Error?u.message:"Failed to render Mermaid diagram";l(b);}}finally{h&&p(false);}})(),()=>{h=false;}},[n,m]),g(Or,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:[f(Ie,{sx:{px:1,py:.6,borderBottom:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:f(vo,{variant:"caption",color:"text.secondary",sx:{letterSpacing:.4,textTransform:"uppercase"},children:o})}),g(Ie,{sx:{p:1},children:[d&&f(Ie,{sx:{minHeight:120,display:"flex",alignItems:"center",justifyContent:"center"},children:f(Sd,{size:20})}),!d&&a&&f(Ie,{sx:{maxHeight:r,overflow:"auto","& svg":{display:"block",mx:"auto",maxWidth:"100%",height:"auto"}},dangerouslySetInnerHTML:{__html:a}}),!d&&!a&&g(Ie,{children:[s&&f(jo,{severity:"info",sx:{mb:1},children:s}),f(sa,{code:m,language:"mermaid",copyable:true,showLineNumbers:true,wrapLongLines:true})]})]})]})};var fl=t=>t.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(r=>r.trim()),Ub=t=>/^:?-{3,}:?$/.test(t.trim()),Kb=t=>{let o=t.trim(),r=o.startsWith(":"),n=o.endsWith(":");return r&&n?"center":n?"right":"left"},Oi=t=>{let o=t.split(`
5
- `).map(s=>s.trim()).filter(Boolean);if(o.length<2)return null;let r=fl(o[0]),n=fl(o[1]);if(r.length===0||n.length!==r.length||!n.every(Ub))return null;let a=n.map(Kb),i=o.slice(2).filter(s=>s.includes("|")).map(s=>{let l=fl(s);return l.length<r.length?[...l,...Array.from({length:r.length-l.length},()=>"")]:l.slice(0,r.length)});return {headers:r,aligns:a,rows:i}},bl=({markdown:t,table:o,maxHeight:r=360})=>{let n=useMemo(()=>o||(t?Oi(t):null),[o,t]);return !n||n.headers.length===0?f(Or,{variant:"outlined",sx:{p:1.2,borderRadius:1.5},children:f(vo,{variant:"body2",color:"text.secondary",children:"Invalid table block"})}):f(Or,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:f(Id,{sx:{maxHeight:r},children:g(Pd,{size:"small",stickyHeader:true,children:[f(Md,{children:f(rl,{children:n.headers.map((a,i)=>f(ol,{align:n.aligns[i],sx:{fontWeight:700,bgcolor:"background.paper"},children:a},`${a}-${i}`))})}),f(Td,{children:n.rows.map((a,i)=>f(rl,{hover:true,children:a.map((s,l)=>f(ol,{align:n.aligns[l],sx:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:s||f(Ie,{component:"span",sx:{color:"text.disabled"},children:"-"})},`cell-${i}-${l}`))},`row-${i}`))})]})})})};var Fi=({content:t,title:o="Thinking",defaultExpanded:r=false,isStreaming:n=false})=>{let[a,i]=useState(r);return g(Ie,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1,my:.8},children:[g(Cd,{direction:"row",alignItems:"center",spacing:.6,children:[f(xd,{size:"small",onClick:()=>i(s=>!s),sx:{transform:a?"rotate(180deg)":"rotate(0deg)",transition:"transform .15s ease"},children:f(rn,{fontSize:"inherit"})}),g(vo,{variant:"caption",color:"text.secondary",sx:{fontStyle:"italic"},children:[o,n?" ...":""]})]}),f(on,{in:a,children:f(vo,{variant:"body2",sx:{pl:4,pt:.4,whiteSpace:"pre-wrap",color:"text.secondary",fontStyle:"italic",lineHeight:1.55},children:t})})]})};var vl=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|\*[^*]+\*|\$[^$\n]+\$)/g,Bi=t=>t.trim().startsWith("```"),au=t=>/^#{1,6}\s+/.test(t.trim()),yl=t=>/^[-*+]\s+/.test(t.trim()),Cl=t=>/^\d+\.\s+/.test(t.trim()),iu=t=>/^(?:-{3,}|\*{3,}|_{3,})$/.test(t.trim()),xl=t=>t.trim().startsWith(">"),su=(t,o)=>{if(o+1>=t.length)return false;let r=t[o],n=t[o+1];return !r.includes("|")||!n.includes("|")?false:/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(n.trim())},lu=t=>t.trim().startsWith("<think>")||t.trim()===":::think",ca=(t,o,r)=>{let n=[],a=0,i=0;vl.lastIndex=0;let s=vl.exec(t);for(;s;){s.index>a&&n.push(t.slice(a,s.index));let l=s[0],d=`${r}-${i}`;if(l.startsWith("**")&&l.endsWith("**"))n.push(f("strong",{children:l.slice(2,-2)},d));else if(l.startsWith("*")&&l.endsWith("*"))n.push(f("em",{children:l.slice(1,-1)},d));else if(l.startsWith("`")&&l.endsWith("`"))n.push(f(Ie,{component:"code",sx:{px:.45,py:.08,borderRadius:.8,bgcolor:"action.hover",fontSize:"0.82em",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:l.slice(1,-1)},d));else if(l.startsWith("[")&&l.includes("](")&&l.endsWith(")")){let p=l.match(/^\[([^\]]+)\]\(([^)]+)\)$/);p?n.push(f(yd,{href:p[2],target:"_blank",rel:"noreferrer",children:p[1]},d)):n.push(l);}else l.startsWith("$")&&l.endsWith("$")&&o.enableMath?n.push(f(la,{expression:l,inline:true,allowKatex:true},d)):n.push(l);a=s.index+l.length,i+=1,s=vl.exec(t);}return a<t.length&&n.push(t.slice(a)),n.length>0?n:[t]},da=({markdown:t,content:o,className:r,enableMath:n=true,enableMermaid:a=true,enableThinkBlock:i=true,codeCopyable:s=true,codeLineNumbers:l=false})=>{let d=t??o??"",p=useMemo(()=>{let m=[],h=d.replace(/\r\n/g,`
1
+ import {f,d,g,e,a,b,c}from'./chunk-7TUSE6H4.mjs';export{h as COrbCanvas}from'./chunk-7TUSE6H4.mjs';import*as Jt from'react';import Jt__default,{createContext,forwardRef,useId,useRef,useState,useImperativeHandle,useMemo,Children,isValidElement,useEffect,useContext,useCallback,Fragment,useLayoutEffect,cloneElement}from'react';import*as Oo from'@radix-ui/react-dropdown-menu';import*as Qo from'@radix-ui/react-tooltip';import {createPortal}from'react-dom';import*as To from'@radix-ui/react-dialog';import*as vr from'@radix-ui/react-popover';import nr from'dayjs';import nf from'dayjs/plugin/customParseFormat';import {usePathname,useRouter}from'next/navigation';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {Slot}from'@radix-ui/react-slot';import {cva}from'class-variance-authority';import {DndContext,closestCenter,useSensors,useSensor,PointerSensor,TouchSensor,closestCorners,DragOverlay,useDroppable,useDraggable}from'@dnd-kit/core';import {restrictToHorizontalAxis}from'@dnd-kit/modifiers';import {arrayMove,SortableContext,horizontalListSortingStrategy,verticalListSortingStrategy,useSortable}from'@dnd-kit/sortable';import yb from'dayjs/plugin/isBetween';import Cb from'dayjs/plugin/localizedFormat';import'dayjs/locale/zh-cn';import'dayjs/locale/fr';import'dayjs/locale/de';import'dayjs/locale/ja';import'dayjs/locale/ko';import Py from'next/dynamic';import {AnimatePresence,motion}from'framer-motion';import HC from'react-markdown';import zC from'remark-gfm';import VC from'remark-math';import WC from'rehype-katex';import $C from'rehype-raw';import {Prism}from'react-syntax-highlighter';import {oneDark,oneLight}from'react-syntax-highlighter/dist/esm/styles/prism';import Tm from'mermaid';import Tw from'dayjs/plugin/isoWeek';var oh={canvas:"#ffffff",surface:"#f5f5f5",surface2:"#f5f5f5",surface3:"#f5f5f5",fg:"#555555",muted:"#8c8c8c",border:"#dbdbdb",primary:"#154194",onPrimary:"#ffffff",link:"#154194",p50:"#f0f3f9",p100:"#dce4f1",p200:"#bac9e3",p300:"#91a8d1",p600:"#0f3276",p700:"#08255a",accent:"#fc4c02",err:"#ac3101",errBg:"#fff4f0",warnBg:"#fff2ee",hover:"rgba(21, 65, 148, 0.06)",selected:"rgba(21, 65, 148, 0.10)",focusRing:"rgba(21, 65, 148, 0.18)",focusSolid:"#154194",disabledFg:"#aeaeae",disabledBg:"#f0f0f0",chartGrid:"#dbdbdb",chartText:"#8c8c8c",track:"#f5f5f5",shadow1:"0 1px 2px rgba(1,9,26,.05),0 2px 6px rgba(1,9,26,.06)",shadow2:"0 4px 14px rgba(1,9,26,.10)",shadow3:"0 12px 32px rgba(1,9,26,.16)",fontBrand:"Montserrat",inverseSurface:"#01091a",inverseFg:"#ffffff",inverseLink:"#91a8d1",aiAccent:"#21bcff",statusFg:"#475569",statusPrimary:"#1d4ed8",statusSuccess:"#047857",statusWarning:"#b45309",statusError:"#b91c1c",statusInfo:"#0369a1",chart1:"#154194",chart2:"#91a8d1",chart3:"#8c8c8c",chart4:"#08255a",chart5:"#fc4c02",chart6:"#bac9e3",chartPositive:"#66bb6a",chartNegative:"#ef5350"},rh={canvas:"#01091a",surface:"#0a1526",surface2:"#061324",surface3:"#0e1b2b",fg:"#ffffff",muted:"rgba(255,255,255,0.7)",border:"rgba(255,255,255,0.12)",primary:"#154194",onPrimary:"#ffffff",link:"#91a8d1",p50:"#021432",p100:"#021a3d",p200:"#bac9e3",p300:"#91a8d1",p600:"#375ea5",p700:"#6e8cc1",accent:"#fc4c02",err:"#d53f01",errBg:"#16163b",warnBg:"#19173f",hover:"rgba(255,255,255,0.08)",selected:"rgba(21, 65, 148, 0.45)",focusRing:"rgba(145, 168, 209, 0.45)",focusSolid:"#91a8d1",disabledFg:"rgba(255,255,255,0.38)",disabledBg:"rgba(255,255,255,0.07)",chartGrid:"rgba(255,255,255,0.12)",chartText:"rgba(255,255,255,0.7)",track:"rgba(255,255,255,0.1)",shadow1:"0 1px 2px rgba(0,0,0,.4),0 2px 8px rgba(0,0,0,.35)",shadow2:"0 4px 16px rgba(0,0,0,.5)",shadow3:"0 12px 32px rgba(0,0,0,.55)",fontBrand:"Montserrat",inverseSurface:"#01091a",inverseFg:"#ffffff",inverseLink:"#91a8d1",aiAccent:"#21bcff",statusFg:"#94a3b8",statusPrimary:"#60a5fa",statusSuccess:"#34d399",statusWarning:"#fbbf24",statusError:"#f87171",statusInfo:"#38bdf8",chart1:"#154194",chart2:"#91a8d1",chart3:"rgba(255,255,255,0.7)",chart4:"#a4b8dd",chart5:"#fc4c02",chart6:"#bac9e3",chartPositive:"#66bb6a",chartNegative:"#ef5350"},Us={light:oh,dark:rh},Uw='"Montserrat", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif',Kw=t=>{let o=Us[t];return [o.primary,o.p300,o.muted,o.p700]},qw=10,Xw="0.2s ease";var Dc=createContext({mode:"light",setting:"light"}),sh=t=>{if(typeof document>"u")return;let o=document.documentElement;o.classList.toggle("orb-dark",t==="dark"),o.dataset.orbMode=t,o.style.colorScheme=t;},Fn=({mode:t,defaultMode:o="light",children:r})=>{let n=t??o,[a,i]=useState("light"),[s,c]=useState(false);useEffect(()=>{c(true);let m=window.matchMedia("(prefers-color-scheme: dark)"),h=()=>i(m.matches?"dark":"light");return h(),m.addEventListener("change",h),()=>m.removeEventListener("change",h)},[]);let u=n==="system"?s?a:"light":n;useEffect(()=>{sh(u);},[u]);let d=useMemo(()=>({mode:u,setting:n}),[u,n]);return f(Dc.Provider,{value:d,children:r})},fo=()=>useContext(Dc).mode,Ks=()=>Us[fo()];var tt=(t,o)=>{let r=Math.min(1,Math.max(0,o)),n=t.trim(),a=u=>u.split("").map(d=>d+d).join(""),i=n.startsWith("#")?n.slice(1):"",s=i.length===3?a(i):i;if(/^[0-9a-fA-F]{6}$/.test(s)){let u=parseInt(s.slice(0,2),16),d=parseInt(s.slice(2,4),16),m=parseInt(s.slice(4,6),16);return `rgba(${u}, ${d}, ${m}, ${r})`}let c=`${Math.round(r*100)}%`;return `color-mix(in oklch, ${t} ${c}, transparent)`};var Eo=t=>{let o=t.startsWith("up:")?`(min-width:${t.slice(3)}px)`:t.startsWith("down:")?`(max-width:${t.slice(5)}px)`:t,[r,n]=useState(()=>typeof window>"u"||typeof window.matchMedia!="function"?false:window.matchMedia(o).matches);return useEffect(()=>{if(typeof window.matchMedia!="function")return;let a=window.matchMedia(o),i=()=>n(a.matches);return i(),a.addEventListener("change",i),()=>a.removeEventListener("change",i)},[o]),r};var dh={accept:57435,activate:57864,activity:57769,add:57432,barChart:57417,calendar:57414,camera:57413,checklist:57952,collapseAll:57988,command:57997,copy:57925,darkMode:58122,decline:57406,delete:57405,dimension:57718,document:57780,down:57827,download:57402,duplicate:57401,edit:57400,email:57399,employee:57398,error:57836,expandAll:57987,factory:57464,favorite:57445,filter:57462,fullScreen:57702,grid:57457,hide:57834,home:57456,information:57993,inventory:57693,ipad:57491,lightMode:58121,lightbulb:57380,lineChart:57740,locked:57683,log:57378,map:57377,menu:57822,message:57884,microphone:57586,move:57832,navigationLeft:57447,navigationRight:57446,overflow:57842,overview:57551,paperPlane:57548,picture:57366,pieChart:57365,play:57499,process:57543,product:57361,pushpin:57503,qrCode:57999,receipt:57541,refresh:57360,save:57498,search:57357,show:57833,shipping:57523,slimDown:57839,slimUp:57840,sort:57853,sound:57895,splitOne:57919,splitTwo:57920,stop:57861,sum:57998,synchronize:57354,table:57530,tableColumn:57983,tableRow:57982,thumbDown:57891,thumbUp:57890,time:57508,translate:57995,tree:57588,trendDown:57931,up:57828,upload:57881,warning:57492,world:57489,wrench:57346},ph=t=>typeof t=="number"?`${t}px`:t,uh={"2.5":10,3:12,"3.5":14,4:16,5:20,6:24,7:28,8:32,10:40,12:48},mh=t=>{if(!t)return;let o=t.match(/(?:^|\s)(?:h|w)-(2\.5|3(?:\.5)?|4|5|6|7|8|10|12)(?:\s|$)/);return o?uh[o[1]]:void 0},Pt=forwardRef(({name:t,size:o,title:r,className:n,style:a,strokeWidth:i,fill:s,...c},u)=>{let d=c["aria-label"]??r,m=ph(o??mh(n)??"1em"),h={fontFamily:"SAP-icons",fontSize:m,fontStyle:"normal",fontWeight:"normal",lineHeight:1,width:m,height:m,display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",...a};return f("span",{ref:u,role:d?"img":void 0,"aria-hidden":d?void 0:true,title:r,className:n,"data-sap-icon":t,style:h,...c,children:String.fromCodePoint(dh[t])})});Pt.displayName="SapIcon";var se=(t,o)=>{let r=forwardRef((n,a)=>f(Pt,{ref:a,name:t,...n}));return r.displayName=o??`SapIcon(${t})`,r};var Ec=se("activity","Activity"),Aa=se("error","AlertCircle"),Lc=se("warning","AlertTriangle"),u0=se("down","ArrowDown"),m0=se("navigationRight","ArrowRight"),Oc=se("up","ArrowUp"),qs=se("barChart","BarChart"),g0=se("activate","Bot"),Xs=se("calendar","Calendar"),h0=Xs,f0=se("camera","Camera"),b0=se("lineChart","ChartNoAxesCombined"),po=se("accept","Check"),Ea=se("accept","CheckCircle"),Po=se("slimDown","ChevronDown"),La=se("navigationLeft","ChevronLeft"),So=se("navigationRight","ChevronRight"),v0=se("slimUp","ChevronUp"),y0=se("expandAll","ChevronsDown"),C0=se("collapseAll","ChevronsUp"),Oa=se("error","CircleAlert"),Bn=se("accept","CircleCheck"),x0=Bn,Zs=se("stop","CircleStop"),Fc=se("copy","Clipboard"),w0=se("checklist","ClipboardCheck"),S0=se("checklist","ClipboardList"),Bc=se("time","Clock"),k0=se("tableColumn","Columns3"),Lo=se("copy","Copy"),P0=se("duplicate","CopyPlus"),T0=se("delete","Delete"),Hn=se("download","Download"),Hc=se("edit","Edit"),zc=se("fullScreen","Expand"),M0=se("show","Eye"),I0=se("hide","EyeOff"),Fa=se("document","File"),Vc=se("document","FileText"),R0=se("filter","Filter"),zn=se("tree","FolderTree"),Wc=se("process","GitBranch"),Vn=se("world","Globe"),$c=se("grid","Grid"),N0=se("move","GripVertical"),D0=se("wrench","Hammer"),_c=se("picture","Image"),Ba=se("information","Info"),A0=se("translate","Languages"),E0=se("dimension","Layers"),L0=se("home","LayoutDashboard"),Ha=se("lightbulb","Lightbulb"),Gc=se("lineChart","LineChart"),Uc=se("synchronize","Loader2"),za=se("locked","Lock"),O0=za,Kc=se("log","LogOut"),Ys=se("email","Mail"),qc=se("map","MapPin"),Xc=se("menu","Menu"),gh=se("message","MessageCircle"),Zc=gh,Va=se("microphone","Mic"),F0=se("microphone","MicOff"),Yc=se("darkMode","Moon"),B0=se("overflow","MoreHorizontal"),H0=se("accept","PackageCheck"),z0=se("product","PackageSearch"),Wa=se("splitOne","PanelLeftOpen"),$a=se("splitTwo","PanelRight"),V0=se("overview","PanelsTopLeft"),Qc=se("pieChart","PieChart"),jr=se("pushpin","Pin"),W0=se("play","Play"),Jr=se("add","Plus"),$0=se("qrCode","QrCode"),_0=se("receipt","ReceiptText"),_a=se("refresh","RefreshCw"),G0=se("activate","Rocket"),U0=se("refresh","RotateCcw"),jc=se("refresh","RotateCw"),K0=se("tableRow","Rows3"),q0=se("save","Save"),X0=se("qrCode","ScanLine"),Vo=se("search","Search"),hh=se("paperPlane","Send"),Jc=hh,en=se("wrench","Settings"),Z0=se("accept","ShieldCheck"),Y0=se("sum","Sigma"),Q0=se("sort","SortAsc"),j0=se("splitTwo","SquareSplitHorizontal"),J0=se("favorite","Star"),ed=se("lightMode","Sun"),eS=se("table","Table2"),tS=se("ipad","TabletSmartphone"),Wn=se("command","Terminal"),td=se("thumbDown","ThumbsDown"),od=se("thumbUp","ThumbsUp"),rd=se("delete","Trash2"),oS=se("tree","TreePine"),nd=se("trendDown","TrendingDown"),Ga=se("warning","TriangleAlert"),rS=se("shipping","Truck"),ad=se("upload","UploadCloud"),Qs=se("employee","User"),id=se("sound","Volume2"),nS=se("factory","Warehouse"),aS=se("process","Workflow"),Kt=se("decline","X"),Ua=se("error","XCircle");var bh={contained:"primary",outlined:"secondary",text:"ghost"},vh={small:"orb-btn-sm",medium:void 0,large:"orb-btn-lg"},Me=forwardRef(({variant:t="primary",size:o="medium",block:r=false,loading:n=false,startIcon:a,endIcon:i,component:s,href:c,sx:u,className:d$1,children:m,disabled:h,type:f$1="button",...p},v)=>{let C=bh[t]??t,g$1=["orb-btn",`orb-btn-${C}`,vh[o],r?"orb-btn-block":void 0,n?"orb-is-loading":void 0,d$1].filter(Boolean).join(" "),x=d(u,g$1),y=s??(c?"a":"button");return g(y,{ref:v,type:y==="button"?f$1:void 0,href:c,className:x.className,style:x.style,disabled:y==="button"?h||n:void 0,"aria-disabled":y!=="button"&&(h||n)?true:void 0,...p,children:[n&&f("span",{className:`orb-spin ${C==="primary"?"orb-spin-light":""}`,"aria-hidden":true}),!n&&a,m,!n&&i]})});Me.displayName="CButton";var We=forwardRef(({label:t,value:o,defaultValue:r,onChange:n,onFocus:a,onBlur:i,onKeyDown:s,type:c="text",placeholder:u,disabled:d$1,readOnly:m,required:h,autoFocus:f$1,autoComplete:p,name:v,id:C,error:g$1,helperText:x,dense:y=false,size:b,fullWidth:k=true,select:w=false,multiline:T=false,rows:I,children:S,variant:D,margin:R,onClick:M,startAdornment:P,endAdornment:A,InputProps:L,inputProps:W,InputLabelProps:j,SelectProps:O,sx:_,className:z},Y)=>{let H=useId(),B=C??`orb-tf-${H}`,q=P??L?.startAdornment,Z=A??L?.endAdornment,ne=(typeof g$1=="string"?g$1:void 0)??x,Ce={id:B,className:`orb-inp ${y||b==="small"?"orb-inp-dense":""}`,style:k?void 0:{width:"auto"},value:o,defaultValue:r,onChange:n,onFocus:a,onBlur:i,onKeyDown:s,placeholder:u,disabled:d$1,required:h,autoFocus:f$1,autoComplete:p,name:v,onClick:M,"aria-invalid":!!g$1},$=w?f("select",{...Ce,ref:Y,onChange:n,children:S}):T?f("textarea",{...Ce,ref:Y,onChange:n,rows:I,readOnly:m||L?.readOnly}):f("input",{...Ce,ref:Y,onChange:n,type:c,readOnly:m||L?.readOnly,...W}),J=d(_,`orb-fld ${g$1?"orb-is-error":""} ${z??""}`,{width:k?"100%":void 0});return g("div",{className:J.className,style:J.style,children:[t&&f("label",{htmlFor:B,children:t}),q||Z?g("div",{className:"orb-inp-adornment-wrap",children:[q&&f("span",{className:"orb-inp-adornment",children:q}),Z&&f("span",{className:"orb-inp-adornment orb-inp-adornment-end",children:Z}),$]}):$,ne&&f("span",{className:"orb-fld-msg",children:ne})]})});We.displayName="CTextField";var $n=forwardRef(({label:t,value:o,defaultValue:r,onChange:n,placeholder:a,disabled:i,readOnly:s,rows:c,minRows:u=3,multiline:d$1,error:m,helperText:h,fullWidth:f$1=true,name:p,id:v,inputProps:C,sx:g$1,className:x},y)=>{let b=useId(),k=v??`orb-ta-${b}`,T=(typeof m=="string"?m:void 0)??h,I=d(g$1,`orb-fld ${m?"orb-is-error":""} ${x??""}`,{width:f$1?"100%":void 0});return g("div",{className:I.className,style:I.style,children:[t&&f("label",{htmlFor:k,children:t}),f("textarea",{ref:y,id:k,className:"orb-inp",value:o,defaultValue:r,onChange:n,placeholder:a,disabled:i,readOnly:s,rows:c??u,name:p,"aria-invalid":!!m,...C}),T&&f("span",{className:"orb-fld-msg",children:T})]})});$n.displayName="CTextArea";var zt=forwardRef(({label:t,options:o,children:r,value:n,defaultValue:a,onChange:i,disabled:s,size:c,dense:u=true,fullWidth:d$1=true,minWidth:m,placeholder:h,displayEmpty:f$1,renderValue:p,multiple:v,MenuProps:C,variant:g$1,disableUnderline:x,onClick:y,onMouseDown:b,error:k,helperText:w,name:T,id:I,"aria-label":S,sx:D,className:R},M)=>{let P=useId(),A=I??`orb-sel-${P}`,W=(typeof k=="string"?k:void 0)??w,j=useRef(null),O=useRef(null),[_,z]=useState(false),[Y,H]=useState(180),[B,q]=useState(a??"");useImperativeHandle(M,()=>j.current);let Z=useMemo(()=>Children.toArray(r).flatMap(pe=>{if(!isValidElement(pe)||pe.type!=="option")return [];let me=pe;return [{value:Array.isArray(me.props.value)?me.props.value[0]??"":me.props.value??"",label:me.props.children,disabled:me.props.disabled}]}),[r]),ue=o??Z,ne=n??B,fe=Array.isArray(ne)?ne[0]??"":ne,Ce=String(fe??""),$=ue.find(pe=>String(pe.value)===Ce),J=p?p(ne):$?.label??(Ce||(h??"")),ae=d(D,`orb-fld ${k?"orb-is-error":""} ${R??""}`,{width:d$1?"100%":void 0,minWidth:typeof m=="number"?`${m}px`:m});if(v)return g("div",{className:ae.className,style:ae.style,children:[t&&f("label",{htmlFor:A,children:t}),g("select",{ref:M,id:A,className:`orb-inp ${u||c==="small"?"orb-inp-dense":""}`,value:n,defaultValue:a,onChange:i,disabled:s,name:T,multiple:true,onClick:y,onMouseDown:b,"aria-invalid":!!k,"aria-label":S,children:[h!==void 0&&f("option",{value:"",children:h}),o?o.map(pe=>f("option",{value:pe.value,disabled:pe.disabled,children:pe.label},pe.value)):r]}),W&&f("span",{className:"orb-fld-msg",children:W})]});let xe=pe=>{n===void 0&&q(pe);let me=j.current;me&&(Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value")?.set?.call(me,pe),i?.({target:me,currentTarget:me}));};return g("div",{className:ae.className,style:ae.style,children:[t&&f("label",{htmlFor:A,children:t}),f("select",{ref:j,className:"orb-visually-hidden",tabIndex:-1,"aria-hidden":"true",name:T,value:Ce,disabled:s,onChange:()=>{},children:ue.map(pe=>f("option",{value:pe.value,disabled:pe.disabled,children:pe.label},String(pe.value)))}),g(Oo.Root,{open:_,onOpenChange:pe=>{pe&&H(O.current?.getBoundingClientRect().width??180),z(pe);},children:[f(Oo.Trigger,{asChild:true,children:g("button",{ref:O,id:A,type:"button",className:`orb-inp orb-select-trigger ${u||c==="small"?"orb-inp-dense":""}`,disabled:s,"aria-invalid":!!k,"aria-label":S,"aria-haspopup":"listbox","data-placeholder":!$&&!Ce?"":void 0,onClick:y,onMouseDown:b,children:[f("span",{className:"orb-select-value",children:J}),f(Pt,{className:"orb-select-chevron",name:"slimDown",size:12})]})}),f(Oo.Portal,{children:f(Oo.Content,{className:"orb-pop orb-select-menu",align:"start",sideOffset:5,collisionPadding:8,style:{minWidth:Y},children:f(Oo.RadioGroup,{value:Ce,onValueChange:xe,children:ue.map(pe=>g(Oo.RadioItem,{className:"orb-select-option",value:String(pe.value),disabled:pe.disabled,children:[f("span",{className:"orb-select-check","aria-hidden":"true",children:String(pe.value)===Ce?f(Pt,{name:"accept",size:13}):null}),f("span",{children:pe.label})]},String(pe.value)))})})})]}),W&&f("span",{className:"orb-fld-msg",children:W})]})});zt.displayName="CSelect";var Tt=forwardRef(({label:t,checked:o,defaultChecked:r,onChange:n,disabled:a,indeterminate:i,name:s,value:c,id:u,size:d$1,color:m,onClick:h,inputProps:f$1,sx:p,className:v},C)=>{let g$1=d([{...d$1==="small"?{fontSize:13}:void 0,...m?{color:m}:void 0},...Array.isArray(p)?p:p?[p]:[]],`orb-chk ${v??""}`),x=f("input",{ref:y=>{y&&(y.indeterminate=!!i),typeof C=="function"?C(y):C&&(C.current=y);},type:"checkbox",id:u,checked:o,defaultChecked:r,onChange:n,readOnly:o!==void 0&&n===void 0,disabled:a,name:s,value:c,onClick:h,...f$1});return t==null?f("span",{className:g$1.className,style:g$1.style,children:x}):g("label",{className:g$1.className,style:g$1.style,children:[x,f("span",{children:t})]})});Tt.displayName="CCheckbox";var Dh=({label:t,options:o,value:r,defaultValue:n,onChange:a,name:i,row:s=false,disabled:c,sx:u,className:d})=>{let m=useId(),h=i??`orb-rdo-${m}`;return g("div",{className:`orb-fld ${d??""}`,style:u,role:"radiogroup",children:[t&&f("span",{className:"orb-fld-label",children:t}),f("div",{style:{display:"flex",flexDirection:s?"row":"column",gap:s?24:8,flexWrap:"wrap"},children:o.map(f$1=>g("label",{className:"orb-rdo",children:[f("input",{type:"radio",name:h,value:f$1.value,checked:r!==void 0?r===f$1.value:void 0,defaultChecked:n!==void 0?n===f$1.value:void 0,onChange:a?p=>a(p,f$1.value):void 0,disabled:c||f$1.disabled}),f("span",{children:f$1.label})]},f$1.value))})]})};var Ka=forwardRef(({label:t,checked:o,defaultChecked:r,onChange:n,disabled:a,name:i,id:s,size:c,sx:u,className:d$1},m)=>{let h=d([{...c==="small"?{transform:"scale(.86)",transformOrigin:"center"}:void 0},...Array.isArray(u)?u:u?[u]:[]],`orb-sw ${d$1??""}`),f$1=f("input",{ref:m,type:"checkbox",role:"switch",id:s,checked:o,defaultChecked:r,onChange:n?p=>n(p,p.target.checked):void 0,disabled:a,name:i});return t==null?f("span",{className:h.className,style:h.style,children:f$1}):g("label",{className:h.className,style:h.style,children:[f$1,f("span",{children:t})]})});Ka.displayName="CSwitch";var Lh={default:"gray",primary:"blue",success:"blue",info:"blue",warning:"orange",error:"orange"},Ct=forwardRef(({label:t,children:o,tone:r,color:n="default",variant:a,size:i="medium",clickable:s,avatar:c,icon:u,onDelete:d$1,onClick:m,sx:h,className:f$1},p)=>{let v=r??(a==="outlined"&&n==="default"?"outline":Lh[n]??"gray"),C=s??!!m,g$1=d([{cursor:C?"pointer":void 0,...i==="small"?{height:24,fontSize:11,px:1}:void 0},...Array.isArray(h)?h:h?[h]:[]],`orb-chip orb-chip-${v} ${f$1??""}`);return g("span",{ref:p,className:g$1.className,style:g$1.style,onClick:m,role:C?"button":void 0,tabIndex:C?0:void 0,onKeyDown:C?x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),m?.(x));}:void 0,children:[c??u,f("span",{className:"orb-chip-label",children:o??t}),d$1&&f("button",{type:"button","aria-label":"Remove",onClick:x=>{x.stopPropagation(),d$1(x);},style:{background:"none",border:"none",padding:0,display:"inline-flex",cursor:"pointer",color:"inherit"},children:f(Kt,{size:13,strokeWidth:2})})]})});Ct.displayName="CChip";var qa=forwardRef(({badgeContent:t,color:o="primary",children:r,invisible:n=false,sx:a,className:i},s)=>{let c=d(a,i,{display:"inline-flex",position:r?"relative":void 0}),u=!n&&t!==void 0&&t!==null&&f("span",{className:`orb-badge ${o==="error"?"orb-badge-err":o==="muted"?"orb-badge-muted":""}`,style:r?{position:"absolute",top:-6,right:-6,zIndex:1}:void 0,children:t});return r?g("span",{ref:s,className:c.className,style:c.style,children:[r,u]}):f("span",{ref:s,className:c.className,style:c.style,children:u})});qa.displayName="CBadge";var tn=forwardRef(({children:t,src:o,alt:r,size:n=28,sx:a,className:i},s)=>{let c=d([{width:n,height:n,fontSize:n*.4},...Array.isArray(a)?a:a?[a]:[]],`orb-avatar ${i??""}`);return f("span",{ref:s,className:c.className,style:c.style,children:o?f("img",{src:o,alt:r??"",style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover"}}):t})});tn.displayName="CAvatar";var on=forwardRef(({severity:t="info",title:o,children:r,onClose:n,sx:a,className:i},s)=>{let c=d(a,`orb-alert orb-alert-${t} ${i??""}`);return g("div",{ref:s,role:"alert",className:c.className,style:c.style,children:[g("div",{style:{flex:1,minWidth:0},children:[o&&f("b",{children:o}),r&&f("span",{children:r})]}),n&&f("button",{type:"button","aria-label":"Close",onClick:n,style:{background:"none",border:"none",padding:0,cursor:"pointer",color:"inherit",font:"500 14px/1 var(--orb-font)",opacity:.7},children:"\u2715"})]})});on.displayName="CAlert";var _n=({value:t,variant:o,color:r,sx:n,className:a})=>{let i=o==="indeterminate"||t===void 0,s=d(n,`orb-prog ${a??""}`);return g("div",{className:s.className,role:"progressbar","aria-valuenow":i?void 0:Math.round(t),"aria-valuemin":i?void 0:0,"aria-valuemax":i?void 0:100,style:s.style,children:[f("i",{style:i?{width:"40%",animation:"orb-prog-ind 1.2s ease-in-out infinite"}:{width:`${Math.min(100,Math.max(0,t))}%`,background:r}}),i&&f("style",{children:"@keyframes orb-prog-ind { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }"})]})},Hh=({width:t,height:o=14,variant:r="rectangular",sx:n,className:a})=>f("div",{className:`orb-skel ${a??""}`,style:{width:t,height:o,borderRadius:r==="circular"?"50%":r==="text"?6:"var(--orb-r)",...n}}),Yo=({size:t=12,onPrimary:o=false,sx:r,className:n})=>f("span",{className:`orb-spin ${o?"orb-spin-light":""} ${n??""}`,style:{width:t,height:t,...r},role:"status","aria-label":"Loading"});var ct=({title:t,children:o,enterDelay:r=300,side:n="top",align:a="center",disabled:i})=>!t||i?f(e,{children:o}):f(Qo.Provider,{delayDuration:r,skipDelayDuration:200,children:g(Qo.Root,{children:[f(Qo.Trigger,{asChild:true,children:o}),f(Qo.Portal,{children:f(Qo.Content,{className:"orb-tooltip",side:n,align:a,sideOffset:6,children:t})})]})});var le=forwardRef(({tooltip:t,size:o="small",active:r=false,edge:n,color:a,sx:i,className:s,children:c,type:u="button",...d$1},m)=>{let h=d([{color:r?"var(--orb-primary)":a,...n==="start"?{marginLeft:-8}:n==="end"?{marginRight:-8}:void 0},...Array.isArray(i)?i:i?[i]:[]],`orb-icon-btn ${o==="small"?"orb-icon-btn-sm":""} ${s??""}`),f$1=f("button",{ref:m,type:u,className:h.className,style:h.style,...d$1,children:c});return t?f(ct,{title:t,children:f$1}):f$1});le.displayName="CIconButton";var Gn=({value:t,options:o,onValueChange:r,size:n="medium",sx:a,className:i,...s})=>{let c=useRef([]),u=o.findIndex(p=>!p.disabled),d$1=o.findIndex(p=>p.value===t),m=(p,v)=>{let C=o.map((y,b)=>y.disabled?-1:b).filter(y=>y>=0);if(C.length===0)return;let g=C.indexOf(v),x;p.key==="Home"&&(x=C[0]),p.key==="End"&&(x=C[C.length-1]),(p.key==="ArrowRight"||p.key==="ArrowDown")&&(x=C[(g+1+C.length)%C.length]),(p.key==="ArrowLeft"||p.key==="ArrowUp")&&(x=C[(g-1+C.length)%C.length]),x!==void 0&&(p.preventDefault(),c.current[x]?.focus(),r(o[x].value));},h=d(a,["orb-segmented-control",n==="small"?"orb-segmented-control-sm":"",i].filter(Boolean).join(" ")),f$1={...h.style,"--orb-segmented-count":Math.max(o.length,1),"--orb-segmented-index":Math.max(d$1,0)};return g("div",{role:"radiogroup",className:h.className,style:f$1,"data-has-selection":d$1>=0?"true":"false",...s,children:[f("span",{className:"orb-segmented-control-thumb","aria-hidden":"true"}),o.map((p,v)=>{let C=p.value===t;return f(le,{ref:g=>{c.current[v]=g;},className:["orb-segmented-control-item",p.icon?"":"orb-segmented-control-item-label"].filter(Boolean).join(" "),size:n,tooltip:p.label,role:"radio","aria-label":p.label,"aria-checked":C,"data-selected":C?"true":void 0,disabled:p.disabled,tabIndex:C||t==null&&v===u?0:-1,onClick:()=>r(p.value),onKeyDown:g=>m(g,v),children:p.icon??f("span",{className:"orb-segmented-control-label",children:p.label})},p.value)})]})};var Qt=({triggerLabel:t,items:o=[],trigger:r,align:n="start",anchorEl:a,open:i,onClose:s,children:c,slotProps:u,PaperProps:d$1,anchorPosition:m,sx:h})=>{let f$1=useRef(null);if(useEffect(()=>{if(i!==true)return;let p=C=>{let g=C.composedPath();f$1.current&&g.includes(f$1.current)||a&&g.includes(a)||s?.();},v=C=>{C.key==="Escape"&&s?.();};return document.addEventListener("pointerdown",p,true),document.addEventListener("keydown",v,true),()=>{document.removeEventListener("pointerdown",p,true),document.removeEventListener("keydown",v,true);}},[a,s,i]),i!==void 0){if(!i||typeof document>"u")return null;let p=a?.getBoundingClientRect(),v=window.innerWidth,C=p?.left??16,g=p?.right??C,x=u?.paper?.sx??d$1?.sx,y=d([...Array.isArray(x)?x:x?[x]:[],...Array.isArray(h)?h:h?[h]:[]],"orb-pop orb-menu",u?.paper?.style??d$1?.style),b=Children.map(c,k=>{if(!isValidElement(k)||k.type!=="option")return k;let w=k.props,{children:T,disabled:I,selected:S}=w,D=d(w.sx,`orb-menu-item ${S?"orb-selected":""} ${w.className??""}`,w.style);return f("div",{role:"menuitem","aria-disabled":I||void 0,"aria-selected":S||void 0,tabIndex:I?-1:0,id:w.id,title:w.title,className:D.className,style:D.style,onClick:I?void 0:w.onClick,onKeyDown:R=>{!I&&(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),w.onClick?.(R));},children:T})});return createPortal(f("div",{ref:f$1,role:"menu",className:y.className,style:{...y.style,position:"fixed",left:n==="end"&&!m?void 0:m?.left??C,right:n==="end"&&!m?Math.max(16,v-g):void 0,top:m?.top??(p?.bottom??16)+6,maxWidth:"calc(100vw - 32px)",zIndex:1301},children:b}),document.body)}return g(Oo.Root,{children:[f(Oo.Trigger,{asChild:true,children:r??f(Me,{variant:"primary",children:t})}),f(Oo.Portal,{children:f(Oo.Content,{className:"orb-pop orb-menu",align:n,sideOffset:6,children:o.map((p,v)=>g(Oo.Item,{className:"orb-menu-item",disabled:p.disabled,onSelect:()=>p.onClick?.(),children:[p.icon,p.label]},v))})})]})};var Le=forwardRef(({elevation:t=1,variant:o,component:r,sx:n,style:a,className:i,children:s,...c},u)=>{let d$1=r??"div",m=d(n,`orb-card ${t>0&&o!=="outlined"?"orb-card-raised":""} ${i??""}`,a);return f(d$1,{ref:u,className:m.className,style:m.style,...c,children:s})});Le.displayName="CPaper";var Rt=forwardRef(({orientation:t="horizontal",flexItem:o,sx:r,className:n},a)=>{let i=d([{...t==="vertical"?{alignSelf:"stretch",height:"auto"}:{width:"100%"},...o?{alignSelf:"stretch"}:void 0},...Array.isArray(r)?r:r?[r]:[]],`${t==="vertical"?"orb-divider-v":"orb-divider"} ${n??""}`);return f("hr",{ref:a,"aria-orientation":t,className:i.className,style:i.style})});Rt.displayName="CDivider";var Zh={h1:"orb-h1",h2:"orb-h2",h3:"orb-h3",h4:"orb-h3",h5:"orb-subtitle",h6:"orb-subtitle",subtitle1:"orb-subtitle",subtitle2:"orb-label",body1:"orb-body",body2:"orb-body-dense",label:"orb-label",caption:"orb-meta",overline:"orb-overline"},Yh={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6"},E=forwardRef(({variant:t="body1",component:o,muted:r=false,numeric:n=false,color:a,noWrap:i=false,fontWeight:s,sx:c,className:u,children:d$1,...m},h)=>{let f$1=o??Yh[t]??"span",v=[t==="inherit"?void 0:Zh[t],u].filter(Boolean).join(" "),C=d([{...r?{color:"var(--orb-muted)"}:void 0,...a?{color:a}:void 0,...n?{fontVariantNumeric:"tabular-nums"}:void 0,...s?{fontWeight:s}:void 0,...i?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:void 0},...Array.isArray(c)?c:c?[c]:[]],v);return f(f$1,{ref:h,className:C.className,style:C.style,...m,children:d$1})});E.displayName="CTypography";var jh=t=>{if(t!==void 0)return typeof t=="number"?`${t*8}px`:t},ce=forwardRef(({direction:t="column",spacing:o,alignItems:r,justifyContent:n,flexWrap:a,flex:i,useFlexGap:s,sx:c,className:u,children:d$1,...m},h)=>{let f$1=d([{display:"flex",flexDirection:t,gap:jh(o),alignItems:r,justifyContent:n,flexWrap:a,flex:i},...Array.isArray(c)?c:c?[c]:[]],u);return f("div",{ref:h,className:f$1.className,style:f$1.style,...m,children:d$1})});ce.displayName="CStack";var Lt=({open:t,onClose:o,title:r,children:n,actions:a,maxWidth:i=560,fullWidth:s=false,fullScreen:c=false,PaperProps:u,slotProps:d$1,disableRestoreFocus:m,keepMounted:h,hideCloseButton:f$1=false,sx:p,className:v})=>{let C=d([{width:c?"100vw":s?"min(920px, calc(100vw - 32px))":void 0,height:c?"100vh":void 0,maxWidth:c?"none":typeof i=="number"?`${i}px`:i},...Array.isArray(u?.sx??d$1?.paper?.sx)?u?.sx??d$1?.paper?.sx:u?.sx??d$1?.paper?.sx?[u?.sx??d$1?.paper?.sx]:[],...Array.isArray(p)?p:p?[p]:[]],`orb-dialog ${v??""}`);return f(To.Root,{open:t,onOpenChange:g=>{g||o?.();},children:g(To.Portal,{children:[f(To.Overlay,{className:"orb-overlay"}),g(To.Content,{className:C.className,style:C.style,children:[(r||!f$1)&&g("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:16},children:[r?f(To.Title,{className:"orb-dialog-title",children:r}):f(To.Title,{className:"orb-visually-hidden",children:"Dialog"}),!f$1&&f(To.Close,{asChild:true,children:f("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Close",style:{marginTop:-4,marginRight:-4},children:f(Kt,{size:16,strokeWidth:2})})})]}),f("div",{style:{minWidth:0},children:n}),a&&f("div",{className:"orb-dialog-actions",children:a})]})]})})};var Js=({open:t,defaultOpen:o,onOpenChange:r,trigger:n,children:a,align:i="start",side:s="bottom",sideOffset:c=6,matchTriggerWidth:u=false,sx:d,className:m})=>g(vr.Root,{open:t,defaultOpen:o,onOpenChange:r,children:[f(vr.Trigger,{asChild:true,children:n}),f(vr.Portal,{children:f(vr.Content,{className:`orb-pop ${m??""}`,align:i,side:s,sideOffset:c,style:{minWidth:u?"var(--radix-popover-trigger-width)":void 0,...d},onOpenAutoFocus:h=>h.preventDefault(),children:a})})]});var tf=({items:t,value:o,defaultValue:r,onChange:n,sx:a,className:i})=>{let s=o!==void 0,[c,u]=useState(r??t[0]?.value),d=s?o:c,m=useRef([]),h=p=>{s||u(p),n?.(p);},f$1=p=>{if(p.key!=="ArrowRight"&&p.key!=="ArrowLeft")return;p.preventDefault();let v=t.filter(y=>!y.disabled),C=v.findIndex(y=>y.value===d),g=p.key==="ArrowRight"?1:-1,x=v[(C+g+v.length)%v.length];if(x){h(x.value);let y=t.findIndex(b=>b.value===x.value);m.current[y]?.focus();}};return f("div",{className:`orb-tabs ${i??""}`,role:"tablist",style:a,onKeyDown:f$1,children:t.map((p,v)=>{let C=p.value===d;return g("button",{ref:g=>{m.current[v]=g;},type:"button",role:"tab","aria-selected":C,disabled:p.disabled,className:`orb-tab ${C?"orb-is-active":""}`,style:{display:"inline-flex",alignItems:"center",gap:6},onClick:()=>h(p.value),children:[p.icon,p.label]},p.value)})})};var rf=["su","mo","tu","we","th","fr","sa"],Un=(t,o)=>!!(t&&o&&t.isSame(o,"day")),Kn=({value:t,rangeStart:o,rangeEnd:r,onChange:n,month:a,defaultMonth:i,onMonthChange:s,minDate:c,maxDate:u,locale:d,renderDay:m})=>{let h=a!==void 0,[f$1,p]=useState(()=>i??t??o??nr()),v=(h?a:f$1).startOf("month"),C=w=>{h||p(w),s?.(w);},g$1=useMemo(()=>d?v.locale(d):v,[v,d]),x=useMemo(()=>{let T=v.startOf("month").startOf("week"),I=[],S=T;for(let D=0;D<6;D+=1){let R=[];for(let M=0;M<7;M+=1)R.push(S),S=S.add(1,"day");if(I.push(R),S.isAfter(v.endOf("month"))&&D>=3)break}return I},[v]),y=useMemo(()=>{let w=d?nr().locale(d):nr();return rf.map((T,I)=>w.startOf("week").add(I,"day").format("dd"))},[d]),b=w=>!!(c&&w.isBefore(c.startOf("day"))||u&&w.isAfter(u.startOf("day"))),k=o!==void 0||r!==void 0;return g("div",{className:"orb-cal",children:[g("div",{className:"orb-cal-head",children:[f("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Previous month",onClick:()=>C(v.subtract(1,"month")),children:f(La,{size:16,strokeWidth:2})}),f("span",{className:"orb-cal-title","aria-live":"polite",children:g$1.format("MMMM YYYY")}),f("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Next month",onClick:()=>C(v.add(1,"month")),children:f(So,{size:16,strokeWidth:2})})]}),g("div",{className:"orb-cal-grid",role:"grid",children:[y.map((w,T)=>f("span",{className:"orb-cal-dow",children:w},`${w}-${T}`)),x.flat().map(w=>{let T=!w.isSame(v,"month"),I=b(w),S=k?Un(w,o)||Un(w,r):Un(w,t),D=w.isSame(nr(),"day"),R=k&&o&&r&&w.isAfter(o.startOf("day"))&&w.isBefore(r.startOf("day")),M=k&&Un(w,o)&&!!r,P=k&&Un(w,r)&&!!o,A=["orb-cal-day",T?"orb-is-outside":void 0,D?"orb-is-today":void 0,S?"orb-is-selected":void 0,R?"orb-is-in-range":void 0,M?"orb-is-range-start":void 0,P?"orb-is-range-end":void 0].filter(Boolean).join(" ");return m?f("span",{className:"orb-cal-day-slot",children:m(w,{outsideCurrentMonth:T,selected:S,today:D,disabled:I})},w.format("YYYY-MM-DD")):f("button",{type:"button",role:"gridcell","aria-selected":S,"aria-current":D?"date":void 0,className:A,disabled:I,onClick:()=>n?.(w),children:w.date()},w.format("YYYY-MM-DD"))})]})]})};nr.extend(nf);var af=({label:t,value:o,defaultValue:r,onChange:n,minDate:a,maxDate:i,disabled:s,format:c="YYYY-MM-DD",placeholder:u,locale:d,dense:m=false,error:h,helperText:f$1,sx:p,className:v})=>{let C=o!==void 0,[g$1,x]=useState(r??null),y=C?o:g$1,[b,k]=useState(false),[w,T]=useState(null),I=P=>{C||x(P),n?.(P);},S=w??(y?(d?y.locale(d):y).format(c):""),D=()=>{if(w===null)return;let P=w.trim();if(!P)I(null);else {let A=nr(P,c,true);A.isValid()&&!(a&&A.isBefore(a.startOf("day")))&&!(i&&A.isAfter(i.startOf("day")))&&I(A);}T(null);},M=(typeof h=="string"?h:void 0)??f$1;return g("div",{className:`orb-fld ${h?"orb-is-error":""} ${v??""}`,style:p,children:[t&&f("label",{children:t}),f(Js,{open:b,onOpenChange:k,trigger:g("div",{className:"orb-inp-adornment-wrap",style:{width:"100%"},children:[f("span",{className:"orb-inp-adornment",children:f(Xs,{size:15,strokeWidth:1.8})}),f("input",{className:`orb-inp ${m?"orb-inp-dense":""}`,value:S,placeholder:u??c,disabled:s,onFocus:()=>k(true),onChange:P=>T(P.target.value),onBlur:D,onKeyDown:P=>{P.key==="Enter"&&(D(),k(false)),P.key==="Escape"&&k(false);}})]}),children:f(Kn,{value:y,onChange:P=>{I(P),T(null),k(false);},minDate:a,maxDate:i,locale:d,defaultMonth:y??void 0})}),M&&f("span",{className:"orb-fld-msg",children:M})]})};var lf=({onFilesSelected:t,multiple:o=false,accept:r="*",maxSize:n,title:a="Drag and drop files here or click to upload",subtitle:i="Support for bulk upload",sx:s})=>{let[c,u]=useState(false),[d,m]=useState([]),h=useRef(null),f$1=y=>{y.preventDefault(),u(true);},p=y=>{y.preventDefault(),u(false);},v=y=>{y.preventDefault(),u(false),g$1(Array.from(y.dataTransfer.files));},C=y=>{y.target.files&&g$1(Array.from(y.target.files));},g$1=y=>{let b=n?y.filter(w=>w.size<=n):y;b.length<y.length&&console.warn(`Some files were rejected because they exceed the maximum size of ${n} bytes.`);let k=o?[...d,...b]:b;o&&(k=k.filter((w,T,I)=>T===I.findIndex(S=>S.name===w.name&&S.size===w.size&&S.lastModified===w.lastModified))),m(k),t?.(k),h.current&&(h.current.value="");},x=y=>{let b=d.filter((k,w)=>w!==y);m(b),t?.(b);};return g("div",{style:{width:"100%",...s},children:[g("div",{onClick:()=>h.current?.click(),onDragOver:f$1,onDragLeave:p,onDrop:v,role:"button",tabIndex:0,onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),h.current?.click());},style:{border:`2px dashed ${c?"var(--orb-primary)":"var(--orb-border)"}`,borderRadius:"var(--orb-r)",padding:32,textAlign:"center",cursor:"pointer",backgroundColor:c?"var(--orb-hover)":"var(--orb-canvas)",transition:"border-color var(--orb-t-fast), background-color var(--orb-t-fast)"},children:[f("input",{type:"file",ref:h,style:{display:"none"},multiple:o,accept:r,onChange:C}),g("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[f(ad,{size:40,strokeWidth:1.5,color:c?"var(--orb-primary)":"var(--orb-muted)"}),f("span",{className:"orb-subtitle",children:a}),f("span",{className:"orb-meta",children:i})]})]}),d.length>0&&f("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:16},children:d.map((y,b)=>g("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",border:"1px solid var(--orb-border)",borderRadius:"var(--orb-r)",backgroundColor:"var(--orb-surface)"},children:[g("div",{style:{display:"flex",alignItems:"center",gap:8,overflow:"hidden"},children:[f(Vc,{size:16,strokeWidth:1.8,color:"var(--orb-muted)"}),f("span",{className:"orb-body-dense",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:y.name}),g("span",{className:"orb-meta",children:["(",(y.size/1024).toFixed(1)," KB)"]})]}),f(le,{"aria-label":`Remove ${y.name}`,onClick:()=>x(b),children:f(rd,{size:15,strokeWidth:1.8})})]},`${y.name}-${b}`))})]})};function yo(...t){return twMerge(clsx(t))}var Za={primary:"bg-primary text-primary-foreground hover:bg-primary/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-accent hover:text-accent-foreground"},qn={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},dd=()=>"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50";var mf=cva(dd(),{variants:{variant:{default:`${Za.primary} shadow-sm`,destructive:"bg-[var(--orb-status-error)] text-[var(--orb-on-primary)] hover:opacity-90 active:opacity-80 shadow-sm",outline:`${Za.outline} shadow-sm`,secondary:"bg-[var(--orb-surface-2)] text-[var(--orb-fg)] hover:bg-[var(--orb-hover)] active:bg-[var(--orb-selected)] shadow-sm",ghost:Za.ghost,link:"text-[var(--orb-status-primary)] underline-offset-4 hover:underline hover:text-[var(--orb-status-primary)] active:text-[var(--orb-p700)]","chat-tool":"bg-[var(--orbai-surface-2)] border border-[var(--orbai-border-soft)] text-[var(--orbai-text-2)] hover:bg-[var(--orbai-surface-3)] hover:border-[var(--orbai-border-strong)] hover:text-[var(--orbai-text-1)] active:scale-95 transition-all duration-200","chat-send":"bg-[var(--orb-primary)] hover:bg-[var(--orb-p600)] text-[var(--orb-on-primary)] border border-[var(--orbai-border-strong)] shadow-[var(--orbai-shadow-soft-sm)] hover:shadow-[var(--orbai-shadow-soft-md)] active:scale-95 transition-all duration-200","chat-stop":"bg-[var(--orb-status-error)] hover:opacity-90 border border-[var(--orbai-border-strong)] shadow-[var(--orbai-shadow-soft-sm)] hover:shadow-[var(--orbai-shadow-soft-md)] active:scale-95 text-[var(--orb-on-primary)] transition-all duration-200","chat-disabled":"cursor-not-allowed opacity-50 bg-[var(--orbai-surface-2)] border border-[var(--orbai-border-soft)] text-[var(--orbai-muted)]"},size:{default:"h-10 px-4 py-2",sm:"h-9 px-3",lg:"h-11 px-8",icon:"h-10 w-10","chat-sm":"h-8 w-8 rounded-full","chat-md":"h-10 w-10 rounded-full","chat-lg":"h-12 w-12 rounded-full"},rounded:{none:qn.none,sm:qn.sm,md:qn.md,full:qn.full}},defaultVariants:{variant:"default",size:"default",rounded:"md"}}),ol=Jt.forwardRef(({className:t,variant:o,size:r,asChild:n=false,...a},i)=>f(n?Slot:"button",{className:yo(mf({variant:o,size:r,className:t})),ref:i,...a}));ol.displayName="Button";var gf={"common.cancel":"Cancel","common.save":"Save","common.ok":"OK","common.done":"Done","common.search":"Search","common.none":"None","common.all":"All","common.noData":"No data","common.copy":"Copy","common.delete":"Delete","common.loading":"Loading...","header.searchPlaceholder":"Ask me...","header.searchAddFeature":"Add feature","header.searchStartVoice":"Start voice input","header.searchStopVoice":"Stop voice input","header.searchOpenPanel":"Open conversation","header.theme.system":"Theme: System","header.theme.dark":"Theme: Dark","header.theme.light":"Theme: Light","header.menu.setting":"Setting","header.menu.refresh":"Refresh","header.menu.logout":"Logout","navigation.expand":"Expand navigation","navigation.collapse":"Collapse navigation","navigation.searchPlaceholder":"Search menu...","navigation.noMatch":"No matching menu items","navigation.noAccessibleApp":"No accessible applications","navigation.noItems":"No items to display","navigation.expandView":"Expand {title}","navigation.mode.switchToFixed":"Switch to fixed navigation","navigation.mode.switchToFloating":"Switch to floating navigation","navigation.pinned":"Pinned","navigation.pin.add":"Pin to top","navigation.pin.remove":"Unpin","table.toolbar.searchPlaceholder":"Search...","table.title.default":"Data Table","table.toolbar.groupBy":"Group By","table.toolbar.summary":"Summary","table.toolbar.columns":"Columns","table.toolbar.export":"Export","table.toolbar.itemsPerPage":"Items per page:","table.toolbar.pageOf":"Page {current} of {total}","table.toolbar.newItem":"New Item","table.toolbar.editItem":"Edit Item","table.toolbar.deleteItem":"Delete Item","table.toolbar.graphicReport":"Graphic Report","table.toolbar.saveLayout":"Save Layout","table.menu.groupBy":"Group By","table.menu.clearAll":"Clear All","table.menu.visibleColumns":"Visible Columns","table.menu.showSummaryRow":"Show Summary Row","table.menu.noNumericColumns":"No numeric columns","table.group.expandAll":"Expand All Groups","table.group.collapseAll":"Collapse All Groups","table.mobile.notImplemented":"Mobile View Not Implemented","table.headerMenu.sortAsc":"Sort Ascending","table.headerMenu.sortDesc":"Sort Descending","table.headerMenu.clearSort":"Clear Sort","table.headerMenu.configureSort":"Configure Sort...","table.headerMenu.group":"Group by this column","table.headerMenu.ungroup":"Remove from grouping","table.headerMenu.addSummary":"Include in Summary","table.headerMenu.removeSummary":"Remove from Summary","table.headerMenu.hideColumn":"Hide Column","table.sortDialog.title":"Sort Settings","table.sortDialog.empty":"No sort rules. Add one to start ordering rows.","table.sortDialog.addRule":"Add Sort Rule","table.sortDialog.clearAll":"Clear All","table.sortDialog.asc":"Ascending","table.sortDialog.desc":"Descending","pivot.title.default":"Pivot Table Builder","pivot.subtitle.default":"Drag fields to configure the pivot table.","pivot.empty":"Drag at least one field into Values to render the pivot result.","pivot.records":"Records","pivot.afterFilter":"After filter","pivot.grandTotal":"Grand Total","pivot.resultLabel":"Result","pivot.valueLabel":"Value","pivot.table.dimensions":"Dimensions","pivot.config.title":"Configuration","pivot.fieldList":"Field List","pivot.availableDimensions":"Available dimensions","pivot.allFieldsInUse":"All fields are in use.","pivot.zone.rows":"Rows","pivot.zone.columns":"Columns","pivot.zone.filters":"Filters","pivot.zone.values":"Values","pivot.hint.rows":"Drag fields here to build row hierarchy","pivot.hint.columns":"Drag fields here to build column hierarchy","pivot.hint.filters":"Drag fields here for report filters","pivot.hint.values":"Drag numeric fields here for aggregation","pivot.clearArea":"Clear area","pivot.filter.na":"N/A","pivot.filter.noValues":"No values","pivot.filter.noneSelected":"None selected","pivot.filter.allValues":"All values","pivot.filter.selectedCount":"{selected} / {total} selected","pivot.filter.selectAll":"Select All","pivot.filter.deselectAll":"Deselect All","pivot.filter.noResults":"No results","pivot.collapse.ariaExpand":"Expand configuration area","pivot.collapse.ariaCollapse":"Collapse configuration area","pivot.agg.sum":"Sum","pivot.agg.count":"Count","pivot.agg.avg":"Average","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"Select preset","pivot.preset.save":"Save preset","pivot.preset.delete":"Delete preset","pivot.preset.saveDialogTitle":"Save current preset","pivot.preset.nameLabel":"Preset name","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"Pivot Result","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"Expand pivot result","pivot.table.collapse.ariaCollapse":"Collapse pivot result","pivot.chart.title":"Pivot Chart","pivot.chart.subtitle":"Map one dimension and up to two measures into a compact chart.","pivot.chart.subtitleReady":"{dimension} by {measure}","pivot.chart.emptyNoDimension":"Add at least one row or column field to render the chart.","pivot.chart.emptyNoValue":"Add at least one value field to render the chart.","pivot.chart.emptyNoData":"No data available for the current chart selection.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Measure","pivot.chart.secondaryMeasure":"Compare measure","pivot.chart.chartType":"Chart type","pivot.chart.style.barVertical":"Vertical bars","pivot.chart.style.barHorizontal":"Horizontal bars","pivot.chart.style.line":"Line","pivot.chart.style.scatter":"Scatter","pivot.chart.collapse.ariaExpand":"Expand chart area","pivot.chart.collapse.ariaCollapse":"Collapse chart area","smartFilter.adaptFilters":"Adapt Filters","smartFilter.addFilters":"Add Filters","smartFilter.go":"Go","smartFilter.visibleFilters":"Visible Filters","smartFilter.searchPlaceholder":"Search...","smartFilter.noOptionsFound":"No options found","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"Equals","smartFilter.operator.contains":"Contains","smartFilter.operator.notContains":"Does Not Contain","smartFilter.operator.wildcard":"Wildcard Search","smartFilter.operator.notEquals":"Not Equals","smartFilter.operator.greaterThan":"Greater Than","smartFilter.operator.lessThan":"Less Than","smartFilter.operator.greaterOrEqual":"Greater Than or Equal","smartFilter.operator.lessOrEqual":"Less Than or Equal","smartFilter.operator.between":"Between","variant.noOptions":"No options","variant.defaultSuffix":"Default","variant.selectVariant":"Select Variant","variant.saveView":"Save View","variant.newVariant":"New Variant","variant.viewName":"View Name","variant.setDefault":"Set as Default","variant.publicAllUsers":"Public (All Users)","variant.toast.fetchFailed":"Failed to load variants","variant.toast.saveFailed":"Failed to save variant","variant.toast.saveSuccess":"Variant saved successfully","variant.toast.deleteFailed":"Failed to delete variant","variant.toast.deleteSuccess":"Variant deleted successfully","variant.toast.defaultFailed":"Failed to update default variant","variant.toast.defaultSuccess":"Default variant updated","layout.saveLayout":"Save Layout","layout.layoutOptions":"Layout Options","layout.selectLayout":"Select Layout","layout.saveCurrentLayout":"Save Current Layout...","layout.noSavedLayouts":"No saved layouts","layout.removeDefault":"Remove Default","layout.setAsDefault":"Set as Default","layout.layoutName":"Layout Name","layout.layoutDescription":"Description","layout.layoutNameHelper":"e.g., 'Compact View'","layout.warningOverwrite":"Warning: Existing layout will be overwritten","layout.useAsDefault":"Use as Default Layout","layout.publicAllUsers":"Public (Visible to all users)","layout.toast.loadFallback":"Failed to load layouts from backend, fallback to local storage","layout.toast.saveSuccess":"Layout saved successfully","layout.toast.saveLocalSuccess":"Layout saved to local storage","layout.toast.backendUnavailableSavedLocal":"Backend unavailable, saved to local storage","layout.toast.deleteSuccess":"Layout deleted successfully","layout.toast.deleteLocalSuccess":"Layout deleted from local storage","layout.toast.backendUnavailableDeletedLocal":"Backend unavailable, deleted from local storage","layout.toast.defaultSuccess":"Default layout set","layout.toast.defaultLocalSuccess":"Default layout set in local storage","layout.toast.backendUnavailableDefaultLocal":"Backend unavailable, default saved to local storage","dateRange.label":"Date Range","dateRange.startDate":"Start Date","dateRange.endDate":"End Date","dateRange.select":"Select...","dateRange.today":"Today","dateRange.thisWeek":"This Week","dateRange.thisMonth":"This Month","graph.records":"{count} records","graph.kpi.totalRecords":"Total Records","graph.kpi.totalReport":"Total Report","graph.kpi.totalBillable":"Total Billable","graph.kpi.efficiency":"Efficiency","graph.kpi.amount":"Amount","graph.kpi.flagged":"Flagged","graph.chart.billable.title":"Billable by Dimension","graph.chart.billable.subtitle":"Top values by billable hours","graph.chart.efficiency.title":"Efficiency by Person","graph.chart.efficiency.subtitle":"Lowest efficiency first","graph.chart.status.title":"Status Distribution","graph.chart.status.subtitle":"Record ratio by status","graph.dataBody":"Data Body","graph.reportTitle":"Graphic Report","graph.unassigned":"Unassigned","graph.column.reportHours":"Report Hours","graph.column.billableHours":"Billable Hours","detail.searchAi.placeholder":"Search fields, or ask AI if no match...","detail.searchAi.matches":"{count} matches found","detail.searchAi.noMatch":"No matching field found.","detail.searchAi.autoAiFallback":"No direct match. Triggering AI analysis...","detail.searchAi.aiResultTitle":"AI Insight","detail.table.title":"Related Records","kanban.empty":"Drop cards here","kanban.bucket.limit":"Limit","kanban.bucket.dropHere":"Release to move into this bucket","kanban.bucket.add":"Add bucket","kanban.bucket.rename":"Rename bucket","kanban.bucket.saveRename":"Save bucket name","kanban.bucket.cancelRename":"Cancel renaming","kanban.search.placeholder":"Search cards and buckets","kanban.search.clear":"Clear search","kanban.search.results":"{count} matching cards","kanban.search.noMatch":"No matching cards","kanban.card.progress":"Progress","kanban.card.openDetail":"Open Detail","kanban.priority.critical":"Critical","kanban.priority.high":"High","kanban.priority.medium":"Medium","kanban.priority.low":"Low","quickCreate.newItem":"New Item","quickCreate.createWithTitle":"Create {title}","quickEdit.editWithTitle":"Edit {title}","quickDelete.confirmTitle":"Confirm Delete","quickDelete.confirmMessageSingle":"Are you sure you want to delete the selected record?","quickDelete.confirmMessageMultiple":"Are you sure you want to delete {count} selected records?","cardPage.viewDetails":"View Details","cardPage.download":"Download","cardPage.close":"Close","cardPage.empty":"No items found","messageBox.confirm":"OK","messageBox.cancel":"Cancel","omph.status.idle":"Idle","omph.status.pending":"Pending","omph.status.running":"Working","omph.status.success":"Success","omph.status.error":"Error","omph.working":"Working","omph.workingFor":"Working for {duration}","omph.loadOlder":"Load earlier","omph.loadingOlder":"Loading earlier\u2026","omph.toBottom":"Back to bottom","omph.copy":"Copy","omph.copied":"Copied","omph.turnActions":"Reply actions","omph.usage":"Usage","omph.inputTokens":"Input","omph.outputTokens":"Output","omph.duration":"Duration","omph.send":"Send","omph.stop":"Stop","omph.supplement.queued":"Added to the running task","omph.turnRail":"Turns","omph.secondUnit":"s","omph.minuteUnit":"m","omph.preview.title":"File preview","omph.preview.close":"Close preview","omph.preview.back":"Back to conversation","omph.preview.expand":"Expand preview","omph.preview.collapse":"Restore preview size","omph.preview.copyContent":"Copy content","omph.preview.copyPath":"Copy path","omph.preview.download":"Download","omph.preview.openExternal":"Open externally","omph.preview.wrap":"Wrap","omph.preview.loading":"Loading file","omph.preview.missing":"File not found","omph.preview.failed":"Could not load this file","omph.preview.unsupported":"No preview for this file type","omph.preview.retry":"Try again","omph.preview.resize":"Resize preview","omph.preview.line":"Line {start}","omph.preview.lines":"Lines {start}\u2013{end}","omph.preview.truncated":"Showing the first {shown} of {total} lines","omph.preview.sheetTruncated":"Showing the first {shown} of {total} rows","omph.preview.imageFailed":"The image could not be displayed","omph.preview.zoomIn":"Zoom in","omph.preview.zoomOut":"Zoom out","omph.preview.zoomFit":"Fit to width","omph.newConversation":"New conversation","omph.conversationList":"Conversation list","omph.conversations":"Conversations","omph.noConversations":"No conversations yet","omph.initial.suggestions":"Suggested questions","omph.approval.waiting":"Waiting for approval","omph.approval.choose":"Choose an action","omph.approval.details":"Approval details","omph.approval.choices":"Actions","omph.approval.reject":"Reject","omph.approval.allowOnce":"Allow once","omph.approval.confirm":"Continue","omph.approval.other":"Other","omph.approval.otherPlaceholder":"Describe the action to take","omph.approval.escalation":"Tool {toolName} requests privileged execution","omph.approval.recommended":"(Recommended)","omph.approval.allowOnceException":"Allow this exception once","omph.approval.allowSession":"Allow this kind for the rest of the session","omph.approval.abandon":"Abandon","omph.input.placeholder":"Type a message...","omph.input.upload":"Upload file","omph.input.send":"Send message","omph.input.stop":"Stop generating","omph.input.queue.ask":"Agent is running. Send this now or after the turn?","omph.input.queue.sendNow":"Send now","omph.input.queue.afterTurn":"Send after this turn","omph.input.queue.queued":"Queued \u2014 sends after this turn","omph.input.queue.cancel":"Cancel","omph.input.message":"Message input","omph.input.tools":"Input tools","omph.model.fallback":"Select model","omph.model.aria":"Select model, current {model}","omph.model.ariaEffort":"Select model, current {model}, effort {effort}","omph.model.menu":"Model and effort","omph.model.model":"Model","omph.model.effort":"Effort","omph.model.search":"Search models\u2026","omph.model.searchClear":"Clear search","omph.model.searchEmpty":"No matching models.","omph.model.emptyModels":"No models available.","omph.model.emptyEfforts":"This model has no effort levels.","agentui.html.defaultTitle":"Interactive HTML","agentui.html.open":"Open","agentui.html.preview":"Preview","agentui.html.code":"Code","agentui.html.toggle":"Switch between code and preview","agentui.html.copy":"Copy code","agentui.html.copied":"Copied","agentui.html.download":"Download","agentui.html.close":"Close"},hf={"common.cancel":"\u53D6\u6D88","common.save":"\u4FDD\u5B58","common.ok":"\u786E\u5B9A","common.done":"\u5B8C\u6210","common.search":"\u641C\u7D22","common.none":"\u65E0","common.all":"\u5168\u90E8","common.noData":"\u6682\u65E0\u6570\u636E","common.copy":"\u590D\u5236","common.delete":"\u5220\u9664","common.loading":"\u52A0\u8F7D\u4E2D...","header.searchPlaceholder":"\u95EE\u6211\u70B9\u4EC0\u4E48...","header.searchAddFeature":"\u589E\u52A0\u529F\u80FD","header.searchStartVoice":"\u5F00\u59CB\u8BED\u97F3\u8F93\u5165","header.searchStopVoice":"\u505C\u6B62\u8BED\u97F3\u8F93\u5165","header.searchOpenPanel":"\u6253\u5F00\u5BF9\u8BDD","header.theme.system":"\u4E3B\u9898\uFF1A\u8DDF\u968F\u7CFB\u7EDF","header.theme.dark":"\u4E3B\u9898\uFF1A\u6DF1\u8272","header.theme.light":"\u4E3B\u9898\uFF1A\u6D45\u8272","header.menu.setting":"\u8BBE\u7F6E","header.menu.refresh":"\u5237\u65B0","header.menu.logout":"\u6CE8\u9500","navigation.expand":"\u5C55\u5F00\u5BFC\u822A","navigation.collapse":"\u6298\u53E0\u5BFC\u822A","navigation.searchPlaceholder":"\u641C\u7D22\u83DC\u5355...","navigation.noMatch":"\u672A\u627E\u5230\u5339\u914D\u7684\u83DC\u5355\u9879","navigation.noAccessibleApp":"\u6682\u65E0\u53EF\u8BBF\u95EE\u7684\u5E94\u7528","navigation.noItems":"\u6682\u65E0\u53EF\u663E\u793A\u9879","navigation.expandView":"\u5C55\u5F00\u67E5\u770B {title}","navigation.mode.switchToFixed":"\u5207\u6362\u4E3A\u56FA\u5B9A\u5BFC\u822A","navigation.mode.switchToFloating":"\u5207\u6362\u4E3A\u60AC\u6D6E\u5BFC\u822A","navigation.pinned":"\u5DF2\u56FA\u5B9A","navigation.pin.add":"\u56FA\u5B9A\u5230\u9876\u90E8","navigation.pin.remove":"\u53D6\u6D88\u56FA\u5B9A","table.toolbar.searchPlaceholder":"\u641C\u7D22...","table.title.default":"\u6570\u636E\u8868","table.toolbar.groupBy":"\u5206\u7EC4","table.toolbar.summary":"\u6C47\u603B","table.toolbar.columns":"\u5217","table.toolbar.export":"\u5BFC\u51FA","table.toolbar.itemsPerPage":"\u6BCF\u9875\u6761\u6570\uFF1A","table.toolbar.pageOf":"\u7B2C {current} / {total} \u9875","table.toolbar.newItem":"\u65B0\u5EFA\u6761\u76EE","table.toolbar.editItem":"\u7F16\u8F91\u6761\u76EE","table.toolbar.deleteItem":"\u5220\u9664\u6761\u76EE","table.toolbar.graphicReport":"\u56FE\u8868\u62A5\u8868","table.toolbar.saveLayout":"\u4FDD\u5B58\u5E03\u5C40","table.menu.groupBy":"\u5206\u7EC4","table.menu.clearAll":"\u6E05\u7A7A","table.menu.visibleColumns":"\u53EF\u89C1\u5217","table.menu.showSummaryRow":"\u663E\u793A\u6C47\u603B\u884C","table.menu.noNumericColumns":"\u6CA1\u6709\u6570\u503C\u5217","table.group.expandAll":"\u5C55\u5F00\u5168\u90E8\u5206\u7EC4","table.group.collapseAll":"\u6298\u53E0\u5168\u90E8\u5206\u7EC4","table.mobile.notImplemented":"\u79FB\u52A8\u7AEF\u89C6\u56FE\u6682\u672A\u5B9E\u73B0","table.headerMenu.sortAsc":"\u5347\u5E8F\u6392\u5217","table.headerMenu.sortDesc":"\u964D\u5E8F\u6392\u5217","table.headerMenu.clearSort":"\u6E05\u9664\u6392\u5E8F","table.headerMenu.configureSort":"\u6392\u5E8F\u8BBE\u7F6E...","table.headerMenu.group":"\u6309\u6B64\u5217\u5206\u7EC4","table.headerMenu.ungroup":"\u53D6\u6D88\u5206\u7EC4","table.headerMenu.addSummary":"\u52A0\u5165\u6C47\u603B","table.headerMenu.removeSummary":"\u4ECE\u6C47\u603B\u4E2D\u79FB\u9664","table.headerMenu.hideColumn":"\u9690\u85CF\u8BE5\u5217","table.sortDialog.title":"\u6392\u5E8F\u8BBE\u7F6E","table.sortDialog.empty":"\u6682\u65E0\u6392\u5E8F\u89C4\u5219\uFF0C\u8BF7\u6DFB\u52A0\u89C4\u5219\u8FDB\u884C\u6392\u5E8F\u3002","table.sortDialog.addRule":"\u6DFB\u52A0\u6392\u5E8F\u89C4\u5219","table.sortDialog.clearAll":"\u6E05\u7A7A\u89C4\u5219","table.sortDialog.asc":"\u5347\u5E8F","table.sortDialog.desc":"\u964D\u5E8F","pivot.title.default":"\u6570\u636E\u900F\u89C6\u8868","pivot.subtitle.default":"\u62D6\u62FD\u5B57\u6BB5\u4EE5\u914D\u7F6E\u900F\u89C6\u8868\u3002","pivot.empty":"\u8BF7\u81F3\u5C11\u62D6\u5165\u4E00\u4E2A\u503C\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u900F\u89C6\u7ED3\u679C\u3002","pivot.records":"\u8BB0\u5F55\u6570","pivot.afterFilter":"\u7B5B\u9009\u540E","pivot.grandTotal":"\u603B\u8BA1","pivot.resultLabel":"\u7ED3\u679C","pivot.valueLabel":"\u503C","pivot.table.dimensions":"\u7EF4\u5EA6","pivot.config.title":"\u5E03\u5C40\u914D\u7F6E","pivot.fieldList":"\u5B57\u6BB5\u5217\u8868","pivot.availableDimensions":"\u53EF\u7528\u7EF4\u5EA6","pivot.allFieldsInUse":"\u6240\u6709\u5B57\u6BB5\u90FD\u5DF2\u4F7F\u7528\u3002","pivot.zone.rows":"\u884C","pivot.zone.columns":"\u5217","pivot.zone.filters":"\u7B5B\u9009","pivot.zone.values":"\u503C","pivot.hint.rows":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u6784\u5EFA\u884C\u5C42\u7EA7","pivot.hint.columns":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u6784\u5EFA\u5217\u5C42\u7EA7","pivot.hint.filters":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u4F5C\u4E3A\u62A5\u8868\u7B5B\u9009","pivot.hint.values":"\u5C06\u6570\u503C\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u8FDB\u884C\u805A\u5408","pivot.clearArea":"\u6E05\u7A7A\u533A\u57DF","pivot.filter.na":"\u4E0D\u53EF\u7528","pivot.filter.noValues":"\u65E0\u53EF\u9009\u503C","pivot.filter.noneSelected":"\u672A\u9009\u62E9","pivot.filter.allValues":"\u5168\u90E8\u503C","pivot.filter.selectedCount":"\u5DF2\u9009 {selected} / {total}","pivot.filter.selectAll":"\u5168\u9009","pivot.filter.deselectAll":"\u53D6\u6D88\u5168\u9009","pivot.filter.noResults":"\u65E0\u5339\u914D\u7ED3\u679C","pivot.collapse.ariaExpand":"\u5C55\u5F00\u914D\u7F6E\u533A\u57DF","pivot.collapse.ariaCollapse":"\u6298\u53E0\u914D\u7F6E\u533A\u57DF","pivot.agg.sum":"\u6C42\u548C","pivot.agg.count":"\u8BA1\u6570","pivot.agg.avg":"\u5E73\u5747\u503C","pivot.agg.min":"\u6700\u5C0F\u503C","pivot.agg.max":"\u6700\u5927\u503C","pivot.preset.selectPlaceholder":"\u9009\u62E9\u65B9\u6848","pivot.preset.save":"\u4FDD\u5B58\u65B9\u6848","pivot.preset.delete":"\u5220\u9664\u65B9\u6848","pivot.preset.saveDialogTitle":"\u4FDD\u5B58\u5F53\u524D\u65B9\u6848","pivot.preset.nameLabel":"\u65B9\u6848\u540D\u79F0","pivot.preset.defaultName":"\u65B9\u6848 {index}","pivot.table.sectionTitle":"\u900F\u89C6\u7ED3\u679C","pivot.table.expandRowsAll":"\u884C\u5168\u90E8\u6253\u5F00","pivot.table.collapseRowsAll":"\u884C\u5168\u90E8\u6298\u53E0","pivot.table.expandColumnsAll":"\u5217\u5168\u90E8\u6253\u5F00","pivot.table.collapseColumnsAll":"\u5217\u5168\u90E8\u6298\u53E0","pivot.table.collapse.ariaExpand":"\u5C55\u5F00\u900F\u89C6\u7ED3\u679C","pivot.table.collapse.ariaCollapse":"\u6298\u53E0\u900F\u89C6\u7ED3\u679C","pivot.chart.title":"\u900F\u89C6\u56FE\u8868","pivot.chart.subtitle":"\u5C06\u4E00\u4E2A\u7EF4\u5EA6\u4E0E\u6700\u591A\u4E24\u4E2A\u5EA6\u91CF\u6620\u5C04\u4E3A\u7D27\u51D1\u56FE\u8868\u3002","pivot.chart.subtitleReady":"{dimension} \xB7 {measure}","pivot.chart.emptyNoDimension":"\u8BF7\u81F3\u5C11\u653E\u5165\u4E00\u4E2A\u884C\u6216\u5217\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u56FE\u8868\u3002","pivot.chart.emptyNoValue":"\u8BF7\u81F3\u5C11\u653E\u5165\u4E00\u4E2A\u503C\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u56FE\u8868\u3002","pivot.chart.emptyNoData":"\u5F53\u524D\u56FE\u8868\u9009\u62E9\u4E0B\u6682\u65E0\u53EF\u5C55\u793A\u6570\u636E\u3002","pivot.chart.dimension":"\u56FE\u8868\u7EF4\u5EA6","pivot.chart.primaryMeasure":"\u4E3B\u5EA6\u91CF","pivot.chart.secondaryMeasure":"\u5BF9\u6BD4\u5EA6\u91CF","pivot.chart.chartType":"\u56FE\u8868\u7C7B\u578B","pivot.chart.style.barVertical":"\u7EB5\u5411\u67F1\u72B6\u56FE","pivot.chart.style.barHorizontal":"\u6A2A\u5411\u67F1\u72B6\u56FE","pivot.chart.style.line":"\u6298\u7EBF\u56FE","pivot.chart.style.scatter":"\u6563\u70B9\u56FE","pivot.chart.collapse.ariaExpand":"\u5C55\u5F00\u56FE\u8868\u533A\u57DF","pivot.chart.collapse.ariaCollapse":"\u6298\u53E0\u56FE\u8868\u533A\u57DF","smartFilter.adaptFilters":"\u7B5B\u9009\u8BBE\u7F6E","smartFilter.addFilters":"\u6DFB\u52A0\u7B5B\u9009","smartFilter.go":"\u6267\u884C","smartFilter.visibleFilters":"\u53EF\u89C1\u7B5B\u9009\u9879","smartFilter.searchPlaceholder":"\u641C\u7D22...","smartFilter.noOptionsFound":"\u672A\u627E\u5230\u9009\u9879","smartFilter.min":"\u6700\u5C0F\u503C","smartFilter.max":"\u6700\u5927\u503C","smartFilter.minMaxPlaceholder":"\u6700\u5C0F\u503C - \u6700\u5927\u503C","smartFilter.operator.equals":"\u7B49\u4E8E","smartFilter.operator.contains":"\u5305\u542B","smartFilter.operator.notContains":"\u4E0D\u5305\u542B","smartFilter.operator.wildcard":"\u901A\u914D\u7B26\u641C\u7D22","smartFilter.operator.notEquals":"\u4E0D\u7B49\u4E8E","smartFilter.operator.greaterThan":"\u5927\u4E8E","smartFilter.operator.lessThan":"\u5C0F\u4E8E","smartFilter.operator.greaterOrEqual":"\u5927\u4E8E\u7B49\u4E8E","smartFilter.operator.lessOrEqual":"\u5C0F\u4E8E\u7B49\u4E8E","smartFilter.operator.between":"\u533A\u95F4","variant.noOptions":"\u65E0\u9009\u9879","variant.defaultSuffix":"\u9ED8\u8BA4","variant.selectVariant":"\u9009\u62E9\u89C6\u56FE","variant.saveView":"\u4FDD\u5B58\u89C6\u56FE","variant.newVariant":"\u65B0\u89C6\u56FE","variant.viewName":"\u89C6\u56FE\u540D\u79F0","variant.setDefault":"\u8BBE\u4E3A\u9ED8\u8BA4","variant.publicAllUsers":"\u516C\u5F00\uFF08\u6240\u6709\u7528\u6237\uFF09","variant.toast.fetchFailed":"\u52A0\u8F7D\u89C6\u56FE\u5931\u8D25","variant.toast.saveFailed":"\u4FDD\u5B58\u89C6\u56FE\u5931\u8D25","variant.toast.saveSuccess":"\u89C6\u56FE\u4FDD\u5B58\u6210\u529F","variant.toast.deleteFailed":"\u5220\u9664\u89C6\u56FE\u5931\u8D25","variant.toast.deleteSuccess":"\u89C6\u56FE\u5220\u9664\u6210\u529F","variant.toast.defaultFailed":"\u66F4\u65B0\u9ED8\u8BA4\u89C6\u56FE\u5931\u8D25","variant.toast.defaultSuccess":"\u9ED8\u8BA4\u89C6\u56FE\u5DF2\u66F4\u65B0","layout.saveLayout":"\u4FDD\u5B58\u5E03\u5C40","layout.layoutOptions":"\u5E03\u5C40\u9009\u9879","layout.selectLayout":"\u9009\u62E9\u5E03\u5C40","layout.saveCurrentLayout":"\u4FDD\u5B58\u5F53\u524D\u5E03\u5C40...","layout.noSavedLayouts":"\u6682\u65E0\u5DF2\u4FDD\u5B58\u5E03\u5C40","layout.removeDefault":"\u53D6\u6D88\u9ED8\u8BA4","layout.setAsDefault":"\u8BBE\u4E3A\u9ED8\u8BA4","layout.layoutName":"\u5E03\u5C40\u540D\u79F0","layout.layoutDescription":"\u63CF\u8FF0","layout.layoutNameHelper":"\u4F8B\u5982\uFF1A\u7D27\u51D1\u89C6\u56FE","layout.warningOverwrite":"\u8B66\u544A\uFF1A\u5C06\u8986\u76D6\u540C\u540D\u5E03\u5C40","layout.useAsDefault":"\u7528\u4F5C\u9ED8\u8BA4\u5E03\u5C40","layout.publicAllUsers":"\u516C\u5F00\uFF08\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09","layout.toast.loadFallback":"\u540E\u7AEF\u52A0\u8F7D\u5E03\u5C40\u5931\u8D25\uFF0C\u5DF2\u56DE\u9000\u5230\u672C\u5730\u5B58\u50A8","layout.toast.saveSuccess":"\u5E03\u5C40\u4FDD\u5B58\u6210\u529F","layout.toast.saveLocalSuccess":"\u5E03\u5C40\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","layout.toast.backendUnavailableSavedLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","layout.toast.deleteSuccess":"\u5E03\u5C40\u5220\u9664\u6210\u529F","layout.toast.deleteLocalSuccess":"\u5E03\u5C40\u5DF2\u4ECE\u672C\u5730\u5B58\u50A8\u5220\u9664","layout.toast.backendUnavailableDeletedLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u5DF2\u4ECE\u672C\u5730\u5B58\u50A8\u5220\u9664","layout.toast.defaultSuccess":"\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u8BBE\u7F6E","layout.toast.defaultLocalSuccess":"\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u5728\u672C\u5730\u5B58\u50A8\u8BBE\u7F6E","layout.toast.backendUnavailableDefaultLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","dateRange.label":"\u65E5\u671F\u8303\u56F4","dateRange.startDate":"\u5F00\u59CB\u65E5\u671F","dateRange.endDate":"\u7ED3\u675F\u65E5\u671F","dateRange.select":"\u8BF7\u9009\u62E9...","dateRange.today":"\u4ECA\u5929","dateRange.thisWeek":"\u672C\u5468","dateRange.thisMonth":"\u672C\u6708","graph.records":"{count} \u6761\u8BB0\u5F55","graph.kpi.totalRecords":"\u603B\u8BB0\u5F55\u6570","graph.kpi.totalReport":"\u603B\u7533\u62A5\u5DE5\u65F6","graph.kpi.totalBillable":"\u603B\u53EF\u8BA1\u8D39\u5DE5\u65F6","graph.kpi.efficiency":"\u6548\u7387","graph.kpi.amount":"\u91D1\u989D","graph.kpi.flagged":"\u6807\u8BB0","graph.chart.billable.title":"\u7EF4\u5EA6\u8BA1\u8D39\u5DE5\u65F6","graph.chart.billable.subtitle":"\u6309\u53EF\u8BA1\u8D39\u5DE5\u65F6\u6392\u5E8F\u524D\u5217","graph.chart.efficiency.title":"\u4EBA\u5458\u6548\u7387","graph.chart.efficiency.subtitle":"\u6309\u6700\u4F4E\u6548\u7387\u4F18\u5148","graph.chart.status.title":"\u72B6\u6001\u5206\u5E03","graph.chart.status.subtitle":"\u6309\u72B6\u6001\u8BB0\u5F55\u5360\u6BD4","graph.dataBody":"\u6570\u636E\u660E\u7EC6","graph.reportTitle":"\u56FE\u8868\u62A5\u8868","graph.unassigned":"\u672A\u5206\u914D","graph.column.reportHours":"\u7533\u62A5\u5DE5\u65F6","graph.column.billableHours":"\u53EF\u8BA1\u8D39\u5DE5\u65F6","detail.searchAi.placeholder":"\u641C\u7D22\u5B57\u6BB5\uFF1B\u5982\u65E0\u7ED3\u679C\u5219\u81EA\u52A8\u89E6\u53D1 AI...","detail.searchAi.matches":"{count} \u6761\u5339\u914D\u7ED3\u679C","detail.searchAi.noMatch":"\u672A\u627E\u5230\u5339\u914D\u5B57\u6BB5\u3002","detail.searchAi.autoAiFallback":"\u672A\u547D\u4E2D\u5B57\u6BB5\uFF0C\u6B63\u5728\u89E6\u53D1 AI \u5206\u6790...","detail.searchAi.aiResultTitle":"AI \u5206\u6790\u7ED3\u679C","detail.table.title":"\u5173\u8054\u8BB0\u5F55","kanban.empty":"\u5C06\u5361\u7247\u62D6\u5230\u8FD9\u91CC","kanban.bucket.limit":"\u4E0A\u9650","kanban.bucket.dropHere":"\u91CA\u653E\u540E\u79FB\u52A8\u5230\u8BE5 bucket","kanban.bucket.add":"\u65B0\u589E bucket","kanban.bucket.rename":"\u91CD\u547D\u540D bucket","kanban.bucket.saveRename":"\u4FDD\u5B58 bucket \u540D\u79F0","kanban.bucket.cancelRename":"\u53D6\u6D88\u91CD\u547D\u540D","kanban.search.placeholder":"\u641C\u7D22\u5361\u7247\u548C bucket","kanban.search.clear":"\u6E05\u9664\u641C\u7D22","kanban.search.results":"{count} \u5F20\u5339\u914D\u5361\u7247","kanban.search.noMatch":"\u6CA1\u6709\u5339\u914D\u7684\u5361\u7247","kanban.card.progress":"\u8FDB\u5EA6","kanban.card.openDetail":"\u6253\u5F00\u8BE6\u60C5","kanban.priority.critical":"\u7D27\u6025","kanban.priority.high":"\u9AD8","kanban.priority.medium":"\u4E2D","kanban.priority.low":"\u4F4E","quickCreate.newItem":"\u65B0\u5EFA\u6761\u76EE","quickCreate.createWithTitle":"\u521B\u5EFA{title}","quickEdit.editWithTitle":"\u7F16\u8F91{title}","quickDelete.confirmTitle":"\u786E\u8BA4\u5220\u9664","quickDelete.confirmMessageSingle":"\u786E\u8BA4\u5220\u9664\u5F53\u524D\u9009\u4E2D\u8BB0\u5F55\u5417\uFF1F","quickDelete.confirmMessageMultiple":"\u786E\u8BA4\u5220\u9664\u5DF2\u9009\u4E2D\u7684 {count} \u6761\u8BB0\u5F55\u5417\uFF1F","cardPage.viewDetails":"\u67E5\u770B\u8BE6\u60C5","cardPage.download":"\u4E0B\u8F7D","cardPage.close":"\u5173\u95ED","cardPage.empty":"\u672A\u627E\u5230\u6761\u76EE","messageBox.confirm":"\u786E\u5B9A","messageBox.cancel":"\u53D6\u6D88","omph.status.idle":"\u7A7A\u95F2","omph.status.pending":"\u7B49\u5F85\u4E2D","omph.status.running":"\u5904\u7406\u4E2D","omph.status.success":"\u5DF2\u5B8C\u6210","omph.status.error":"\u51FA\u9519","omph.working":"\u5904\u7406\u4E2D","omph.workingFor":"\u5DF2\u5904\u7406 {duration}","omph.loadOlder":"\u52A0\u8F7D\u66F4\u65E9\u6D88\u606F","omph.loadingOlder":"\u6B63\u5728\u52A0\u8F7D\u66F4\u65E9\u6D88\u606F\u2026","omph.toBottom":"\u56DE\u5230\u5E95\u90E8","omph.copy":"\u590D\u5236","omph.copied":"\u5DF2\u590D\u5236","omph.turnActions":"\u56DE\u590D\u64CD\u4F5C","omph.usage":"\u7528\u91CF","omph.inputTokens":"\u8F93\u5165","omph.outputTokens":"\u8F93\u51FA","omph.duration":"\u7528\u65F6","omph.send":"\u53D1\u9001","omph.stop":"\u505C\u6B62","omph.supplement.queued":"\u5DF2\u52A0\u5165\u5F53\u524D\u4EFB\u52A1","omph.turnRail":"\u8F6E\u6B21","omph.secondUnit":"\u79D2","omph.minuteUnit":"\u5206","omph.preview.title":"\u6587\u4EF6\u9884\u89C8","omph.preview.close":"\u5173\u95ED\u9884\u89C8","omph.preview.back":"\u8FD4\u56DE\u5BF9\u8BDD","omph.preview.expand":"\u5C55\u5F00\u9884\u89C8","omph.preview.collapse":"\u8FD8\u539F\u9884\u89C8\u5927\u5C0F","omph.preview.copyContent":"\u590D\u5236\u5185\u5BB9","omph.preview.copyPath":"\u590D\u5236\u8DEF\u5F84","omph.preview.download":"\u4E0B\u8F7D","omph.preview.openExternal":"\u5728\u5916\u90E8\u6253\u5F00","omph.preview.wrap":"\u81EA\u52A8\u6362\u884C","omph.preview.loading":"\u6B63\u5728\u52A0\u8F7D\u6587\u4EF6","omph.preview.missing":"\u6587\u4EF6\u4E0D\u5B58\u5728","omph.preview.failed":"\u65E0\u6CD5\u52A0\u8F7D\u6B64\u6587\u4EF6","omph.preview.unsupported":"\u6B64\u6587\u4EF6\u7C7B\u578B\u4E0D\u652F\u6301\u9884\u89C8","omph.preview.retry":"\u91CD\u8BD5","omph.preview.resize":"\u8C03\u6574\u9884\u89C8\u5927\u5C0F","omph.preview.line":"\u7B2C {start} \u884C","omph.preview.lines":"\u7B2C {start}\u2013{end} \u884C","omph.preview.truncated":"\u5171 {total} \u884C\uFF0C\u4EC5\u663E\u793A\u524D {shown} \u884C","omph.preview.sheetTruncated":"\u5171 {total} \u884C\uFF0C\u4EC5\u663E\u793A\u524D {shown} \u884C","omph.preview.imageFailed":"\u56FE\u7247\u65E0\u6CD5\u663E\u793A","omph.preview.zoomIn":"\u653E\u5927","omph.preview.zoomOut":"\u7F29\u5C0F","omph.preview.zoomFit":"\u9002\u5E94\u5BBD\u5EA6","omph.newConversation":"\u65B0\u5EFA\u4F1A\u8BDD","omph.conversationList":"\u4F1A\u8BDD\u5217\u8868","omph.conversations":"\u4F1A\u8BDD","omph.noConversations":"\u8FD8\u6CA1\u6709\u4F1A\u8BDD","omph.initial.suggestions":"\u5019\u9009\u95EE\u9898","omph.approval.waiting":"\u7B49\u5F85\u5BA1\u6279","omph.approval.choose":"\u8BF7\u9009\u62E9\u64CD\u4F5C","omph.approval.details":"\u5BA1\u6279\u8BE6\u60C5","omph.approval.choices":"\u53EF\u9009\u64CD\u4F5C","omph.approval.reject":"\u62D2\u7EDD","omph.approval.allowOnce":"\u4EC5\u6B64\u4E00\u6B21","omph.approval.confirm":"\u7EE7\u7EED","omph.approval.other":"\u5176\u4ED6","omph.approval.otherPlaceholder":"\u63CF\u8FF0\u8981\u6267\u884C\u7684\u64CD\u4F5C","omph.approval.escalation":"\u5DE5\u5177 {toolName} \u8BF7\u6C42\u7279\u6743\u6267\u884C","omph.approval.recommended":"\uFF08\u63A8\u8350\uFF09","omph.approval.allowOnceException":"\u4EC5\u672C\u6B21\u7834\u4F8B","omph.approval.allowSession":"\u672C\u4F1A\u8BDD\u540C\u7C7B\u90FD\u5141\u8BB8","omph.approval.abandon":"\u653E\u5F03","omph.input.placeholder":"\u8F93\u5165\u6D88\u606F\u2026","omph.input.upload":"\u4E0A\u4F20\u6587\u4EF6","omph.input.send":"\u53D1\u9001\u6D88\u606F","omph.input.stop":"\u505C\u6B62\u751F\u6210","omph.input.queue.ask":"Agent \u6B63\u5728\u8FD0\u884C\uFF0C\u8FD9\u6761\u6D88\u606F\u600E\u4E48\u53D1\uFF1F","omph.input.queue.sendNow":"\u7ACB\u5373\u53D1\u9001","omph.input.queue.afterTurn":"\u672C\u8F6E\u7ED3\u675F\u540E\u53D1\u9001","omph.input.queue.queued":"\u5DF2\u6392\u961F\uFF0C\u672C\u8F6E\u7ED3\u675F\u540E\u81EA\u52A8\u53D1\u9001","omph.input.queue.cancel":"\u53D6\u6D88","omph.input.message":"\u6D88\u606F\u8F93\u5165","omph.input.tools":"\u8F93\u5165\u5DE5\u5177","omph.model.fallback":"\u8BF7\u9009\u62E9\u6A21\u578B","omph.model.aria":"\u9009\u62E9\u6A21\u578B\uFF0C\u5F53\u524D {model}","omph.model.ariaEffort":"\u9009\u62E9\u6A21\u578B\uFF0C\u5F53\u524D {model}\uFF0C\u601D\u8003\u5F3A\u5EA6 {effort}","omph.model.menu":"\u6A21\u578B\u4E0E\u601D\u8003\u5F3A\u5EA6","omph.model.model":"\u6A21\u578B","omph.model.effort":"\u601D\u8003\u5F3A\u5EA6","omph.model.search":"\u641C\u7D22\u6A21\u578B\u2026","omph.model.searchClear":"\u6E05\u9664\u641C\u7D22","omph.model.searchEmpty":"\u6CA1\u6709\u5339\u914D\u7684\u6A21\u578B\u3002","omph.model.emptyModels":"\u6CA1\u6709\u53EF\u7528\u7684\u6A21\u578B\u3002","omph.model.emptyEfforts":"\u5F53\u524D\u6A21\u578B\u6CA1\u6709\u601D\u8003\u5F3A\u5EA6\u3002","agentui.html.defaultTitle":"\u4EA4\u4E92\u5F0F HTML","agentui.html.open":"\u6253\u5F00","agentui.html.preview":"\u9884\u89C8","agentui.html.code":"\u4EE3\u7801","agentui.html.toggle":"\u5207\u6362\u4EE3\u7801\u4E0E\u9884\u89C8","agentui.html.copy":"\u590D\u5236\u4EE3\u7801","agentui.html.copied":"\u5DF2\u590D\u5236","agentui.html.download":"\u4E0B\u8F7D","agentui.html.close":"\u5173\u95ED"},ff={"common.cancel":"Annuler","common.save":"Enregistrer","common.ok":"OK","common.done":"Terminer","common.search":"Rechercher","common.none":"Aucun","common.all":"Tout","common.noData":"Aucune donn\xE9e","common.copy":"Copier","common.delete":"Supprimer","common.loading":"Chargement...","header.searchPlaceholder":"Demandez-moi...","header.searchAddFeature":"Ajouter une fonction","header.searchStartVoice":"D\xE9marrer la saisie vocale","header.searchStopVoice":"Arr\xEAter la saisie vocale","header.searchOpenPanel":"Ouvrir la conversation","header.theme.system":"Th\xE8me : Syst\xE8me","header.theme.dark":"Th\xE8me : Sombre","header.theme.light":"Th\xE8me : Clair","header.menu.setting":"Param\xE8tres","header.menu.refresh":"Actualiser","header.menu.logout":"Se d\xE9connecter","navigation.expand":"D\xE9velopper la navigation","navigation.collapse":"R\xE9duire la navigation","navigation.searchPlaceholder":"Rechercher dans le menu...","navigation.noMatch":"Aucun \xE9l\xE9ment correspondant","navigation.noAccessibleApp":"Aucune application accessible","navigation.noItems":"Aucun \xE9l\xE9ment \xE0 afficher","navigation.expandView":"D\xE9velopper {title}","navigation.mode.switchToFixed":"Basculer vers la navigation fixe","navigation.mode.switchToFloating":"Basculer vers la navigation flottante","navigation.pinned":"\xC9pingl\xE9s","navigation.pin.add":"\xC9pingler en haut","navigation.pin.remove":"D\xE9s\xE9pingler","table.toolbar.searchPlaceholder":"Rechercher...","table.title.default":"Tableau de donn\xE9es","table.toolbar.groupBy":"Grouper","table.toolbar.summary":"R\xE9sum\xE9","table.toolbar.columns":"Colonnes","table.toolbar.export":"Exporter","table.toolbar.itemsPerPage":"Lignes par page :","table.toolbar.pageOf":"Page {current} sur {total}","table.toolbar.newItem":"Nouvel \xE9l\xE9ment","table.toolbar.editItem":"Modifier l'\xE9l\xE9ment","table.toolbar.deleteItem":"Supprimer l'\xE9l\xE9ment","table.toolbar.graphicReport":"Rapport graphique","table.toolbar.saveLayout":"Enregistrer la vue","table.menu.groupBy":"Grouper","table.menu.clearAll":"Tout effacer","table.menu.visibleColumns":"Colonnes visibles","table.menu.showSummaryRow":"Afficher la ligne de r\xE9sum\xE9","table.menu.noNumericColumns":"Aucune colonne num\xE9rique","table.group.expandAll":"D\xE9velopper tous les groupes","table.group.collapseAll":"R\xE9duire tous les groupes","table.mobile.notImplemented":"Vue mobile non impl\xE9ment\xE9e","table.headerMenu.sortAsc":"Trier ascendant","table.headerMenu.sortDesc":"Trier descendant","table.headerMenu.clearSort":"Effacer le tri","table.headerMenu.configureSort":"Configurer le tri...","table.headerMenu.group":"Grouper par cette colonne","table.headerMenu.ungroup":"Retirer du groupement","table.headerMenu.addSummary":"Inclure dans le r\xE9sum\xE9","table.headerMenu.removeSummary":"Retirer du r\xE9sum\xE9","table.headerMenu.hideColumn":"Masquer la colonne","table.sortDialog.title":"Param\xE8tres de tri","table.sortDialog.empty":"Aucune r\xE8gle de tri. Ajoutez-en une pour commencer.","table.sortDialog.addRule":"Ajouter une r\xE8gle","table.sortDialog.clearAll":"Tout effacer","table.sortDialog.asc":"Ascendant","table.sortDialog.desc":"Descendant","pivot.title.default":"Tableau crois\xE9 dynamique","pivot.subtitle.default":"Faites glisser les champs pour configurer le tableau crois\xE9.","pivot.empty":"Ajoutez au moins un champ de valeur pour afficher le r\xE9sultat.","pivot.records":"Enregistrements","pivot.afterFilter":"Apr\xE8s filtre","pivot.grandTotal":"Total g\xE9n\xE9ral","pivot.resultLabel":"R\xE9sultat","pivot.valueLabel":"Valeur","pivot.table.dimensions":"Dimensions","pivot.config.title":"Configuration","pivot.fieldList":"Liste des champs","pivot.availableDimensions":"Dimensions disponibles","pivot.allFieldsInUse":"Tous les champs sont d\xE9j\xE0 utilis\xE9s.","pivot.zone.rows":"Lignes","pivot.zone.columns":"Colonnes","pivot.zone.filters":"Filtres","pivot.zone.values":"Valeurs","pivot.hint.rows":"D\xE9posez les champs ici pour construire la hi\xE9rarchie des lignes","pivot.hint.columns":"D\xE9posez les champs ici pour construire la hi\xE9rarchie des colonnes","pivot.hint.filters":"D\xE9posez les champs ici pour les filtres du rapport","pivot.hint.values":"D\xE9posez les champs num\xE9riques ici pour les agr\xE9gations","pivot.clearArea":"Vider la zone","pivot.filter.na":"N/A","pivot.filter.noValues":"Aucune valeur","pivot.filter.noneSelected":"Aucune s\xE9lection","pivot.filter.allValues":"Toutes les valeurs","pivot.filter.selectedCount":"{selected} / {total} s\xE9lectionn\xE9es","pivot.filter.selectAll":"Tout s\xE9lectionner","pivot.filter.deselectAll":"Tout d\xE9s\xE9lectionner","pivot.filter.noResults":"Aucun r\xE9sultat","pivot.collapse.ariaExpand":"D\xE9velopper la zone de configuration","pivot.collapse.ariaCollapse":"R\xE9duire la zone de configuration","pivot.agg.sum":"Somme","pivot.agg.count":"Compte","pivot.agg.avg":"Moyenne","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"S\xE9lectionner un preset","pivot.preset.save":"Enregistrer le preset","pivot.preset.delete":"Supprimer le preset","pivot.preset.saveDialogTitle":"Enregistrer le preset actuel","pivot.preset.nameLabel":"Nom du preset","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"R\xE9sultat du pivot","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"D\xE9velopper le r\xE9sultat du pivot","pivot.table.collapse.ariaCollapse":"R\xE9duire le r\xE9sultat du pivot","pivot.chart.title":"Graphique pivot","pivot.chart.subtitle":"Associez une dimension et jusqu\u2019\xE0 deux mesures dans un graphique compact.","pivot.chart.subtitleReady":"{dimension} par {measure}","pivot.chart.emptyNoDimension":"Ajoutez au moins un champ de ligne ou de colonne pour afficher le graphique.","pivot.chart.emptyNoValue":"Ajoutez au moins un champ de valeur pour afficher le graphique.","pivot.chart.emptyNoData":"Aucune donn\xE9e disponible pour la s\xE9lection actuelle du graphique.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Mesure","pivot.chart.secondaryMeasure":"Mesure de comparaison","pivot.chart.chartType":"Type de graphique","pivot.chart.style.barVertical":"Barres verticales","pivot.chart.style.barHorizontal":"Barres horizontales","pivot.chart.style.line":"Ligne","pivot.chart.style.scatter":"Nuage de points","pivot.chart.collapse.ariaExpand":"D\xE9velopper la zone du graphique","pivot.chart.collapse.ariaCollapse":"R\xE9duire la zone du graphique","smartFilter.adaptFilters":"Adapter les filtres","smartFilter.addFilters":"Ajouter des filtres","smartFilter.go":"Ex\xE9cuter","smartFilter.visibleFilters":"Filtres visibles","smartFilter.searchPlaceholder":"Rechercher...","smartFilter.noOptionsFound":"Aucune option trouv\xE9e","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"\xC9gal \xE0","smartFilter.operator.contains":"Contient","smartFilter.operator.notContains":"Ne contient pas","smartFilter.operator.wildcard":"Recherche g\xE9n\xE9rique","smartFilter.operator.notEquals":"Diff\xE9rent de","smartFilter.operator.greaterThan":"Sup\xE9rieur \xE0","smartFilter.operator.lessThan":"Inf\xE9rieur \xE0","smartFilter.operator.greaterOrEqual":"Sup\xE9rieur ou \xE9gal","smartFilter.operator.lessOrEqual":"Inf\xE9rieur ou \xE9gal","smartFilter.operator.between":"Entre","variant.noOptions":"Aucune option","variant.defaultSuffix":"Par d\xE9faut","variant.selectVariant":"S\xE9lectionner une vue","variant.saveView":"Enregistrer la vue","variant.newVariant":"Nouvelle vue","variant.viewName":"Nom de la vue","variant.setDefault":"D\xE9finir par d\xE9faut","variant.publicAllUsers":"Public (tous les utilisateurs)","variant.toast.fetchFailed":"\xC9chec du chargement des vues","variant.toast.saveFailed":"\xC9chec de l'enregistrement de la vue","variant.toast.saveSuccess":"Vue enregistr\xE9e avec succ\xE8s","variant.toast.deleteFailed":"\xC9chec de la suppression de la vue","variant.toast.deleteSuccess":"Vue supprim\xE9e avec succ\xE8s","variant.toast.defaultFailed":"\xC9chec de la mise \xE0 jour de la vue par d\xE9faut","variant.toast.defaultSuccess":"Vue par d\xE9faut mise \xE0 jour","layout.saveLayout":"Enregistrer la vue","layout.layoutOptions":"Options de vue","layout.selectLayout":"S\xE9lectionner une vue","layout.saveCurrentLayout":"Enregistrer la vue actuelle...","layout.noSavedLayouts":"Aucune vue enregistr\xE9e","layout.removeDefault":"Retirer le d\xE9faut","layout.setAsDefault":"D\xE9finir par d\xE9faut","layout.layoutName":"Nom de la vue","layout.layoutDescription":"Description","layout.layoutNameHelper":"ex. : Vue compacte","layout.warningOverwrite":"Attention : la vue existante sera \xE9cras\xE9e","layout.useAsDefault":"Utiliser comme vue par d\xE9faut","layout.publicAllUsers":"Public (visible par tous les utilisateurs)","layout.toast.loadFallback":"\xC9chec du chargement depuis le backend, bascule vers le stockage local","layout.toast.saveSuccess":"Vue enregistr\xE9e avec succ\xE8s","layout.toast.saveLocalSuccess":"Vue enregistr\xE9e dans le stockage local","layout.toast.backendUnavailableSavedLocal":"Backend indisponible, enregistr\xE9 en local","layout.toast.deleteSuccess":"Vue supprim\xE9e avec succ\xE8s","layout.toast.deleteLocalSuccess":"Vue supprim\xE9e du stockage local","layout.toast.backendUnavailableDeletedLocal":"Backend indisponible, supprim\xE9 en local","layout.toast.defaultSuccess":"Vue par d\xE9faut d\xE9finie","layout.toast.defaultLocalSuccess":"Vue par d\xE9faut d\xE9finie en local","layout.toast.backendUnavailableDefaultLocal":"Backend indisponible, d\xE9faut enregistr\xE9 en local","dateRange.label":"Plage de dates","dateRange.startDate":"Date de d\xE9but","dateRange.endDate":"Date de fin","dateRange.select":"S\xE9lectionner...","dateRange.today":"Aujourd'hui","dateRange.thisWeek":"Cette semaine","dateRange.thisMonth":"Ce mois-ci","graph.records":"{count} enregistrements","graph.kpi.totalRecords":"Total des enregistrements","graph.kpi.totalReport":"Total d\xE9clar\xE9","graph.kpi.totalBillable":"Total facturable","graph.kpi.efficiency":"Efficacit\xE9","graph.kpi.amount":"Montant","graph.kpi.flagged":"Signal\xE9","graph.chart.billable.title":"Facturable par dimension","graph.chart.billable.subtitle":"Top valeurs par heures facturables","graph.chart.efficiency.title":"Efficacit\xE9 par personne","graph.chart.efficiency.subtitle":"Efficacit\xE9 la plus faible en premier","graph.chart.status.title":"R\xE9partition des statuts","graph.chart.status.subtitle":"Ratio des enregistrements par statut","graph.dataBody":"Donn\xE9es","graph.reportTitle":"Rapport graphique","graph.unassigned":"Non attribu\xE9","graph.column.reportHours":"Heures d\xE9clar\xE9es","graph.column.billableHours":"Heures facturables","detail.searchAi.placeholder":"Rechercher des champs, ou interroger l\u2019IA en cas d\u2019absence de r\xE9sultat...","detail.searchAi.matches":"{count} correspondances trouv\xE9es","detail.searchAi.noMatch":"Aucun champ correspondant trouv\xE9.","detail.searchAi.autoAiFallback":"Aucune correspondance directe. Analyse IA en cours...","detail.searchAi.aiResultTitle":"Analyse IA","detail.table.title":"Enregistrements li\xE9s","kanban.empty":"D\xE9posez les cartes ici","kanban.bucket.limit":"Limite","kanban.bucket.dropHere":"Rel\xE2chez pour d\xE9placer dans cette colonne","kanban.bucket.add":"Ajouter une colonne","kanban.bucket.rename":"Renommer la colonne","kanban.bucket.saveRename":"Enregistrer le nom","kanban.bucket.cancelRename":"Annuler le renommage","kanban.search.placeholder":"Rechercher des cartes et colonnes","kanban.search.clear":"Effacer la recherche","kanban.search.results":"{count} cartes correspondantes","kanban.search.noMatch":"Aucune carte correspondante","kanban.card.progress":"Progression","kanban.card.openDetail":"Ouvrir le d\xE9tail","kanban.priority.critical":"Critique","kanban.priority.high":"\xC9lev\xE9e","kanban.priority.medium":"Moyenne","kanban.priority.low":"Faible","quickCreate.newItem":"Nouvel \xE9l\xE9ment","quickCreate.createWithTitle":"Cr\xE9er {title}","quickEdit.editWithTitle":"Modifier {title}","quickDelete.confirmTitle":"Confirmer la suppression","quickDelete.confirmMessageSingle":"Voulez-vous vraiment supprimer l\u2019enregistrement s\xE9lectionn\xE9 ?","quickDelete.confirmMessageMultiple":"Voulez-vous vraiment supprimer les {count} enregistrements s\xE9lectionn\xE9s ?","cardPage.viewDetails":"Voir les d\xE9tails","cardPage.download":"T\xE9l\xE9charger","cardPage.close":"Fermer","cardPage.empty":"Aucun \xE9l\xE9ment trouv\xE9","messageBox.confirm":"OK","messageBox.cancel":"Annuler","omph.status.idle":"Inactif","omph.status.pending":"En attente","omph.status.running":"En cours","omph.status.success":"Termin\xE9","omph.status.error":"Erreur","omph.working":"En cours","omph.workingFor":"En cours depuis {duration}","omph.loadOlder":"Charger les messages pr\xE9c\xE9dents","omph.loadingOlder":"Chargement des messages pr\xE9c\xE9dents\u2026","omph.toBottom":"Revenir en bas","omph.copy":"Copier","omph.copied":"Copi\xE9","omph.turnActions":"Actions de r\xE9ponse","omph.usage":"Utilisation","omph.inputTokens":"Entr\xE9e","omph.outputTokens":"Sortie","omph.duration":"Dur\xE9e","omph.send":"Envoyer","omph.stop":"Arr\xEAter","omph.supplement.queued":"Ajout\xE9 \xE0 la t\xE2che en cours","omph.turnRail":"Tours","omph.secondUnit":"s","omph.minuteUnit":"min","omph.preview.title":"Aper\xE7u du fichier","omph.preview.close":"Fermer l'aper\xE7u","omph.preview.back":"Retour \xE0 la conversation","omph.preview.expand":"Agrandir l\u2019aper\xE7u","omph.preview.collapse":"R\xE9duire l\u2019aper\xE7u","omph.preview.copyContent":"Copier le contenu","omph.preview.copyPath":"Copier le chemin","omph.preview.download":"T\xE9l\xE9charger","omph.preview.openExternal":"Ouvrir \xE0 l\u2019ext\xE9rieur","omph.preview.wrap":"Retour \xE0 la ligne","omph.preview.loading":"Chargement du fichier","omph.preview.missing":"Fichier introuvable","omph.preview.failed":"Impossible de charger ce fichier","omph.preview.unsupported":"Aucun aper\xE7u pour ce type de fichier","omph.preview.retry":"R\xE9essayer","omph.preview.resize":"Redimensionner l\u2019aper\xE7u","omph.preview.line":"Ligne {start}","omph.preview.lines":"Lignes {start}\u2013{end}","omph.preview.truncated":"Affichage des {shown} premi\xE8res lignes sur {total}","omph.preview.sheetTruncated":"Affichage des {shown} premi\xE8res lignes sur {total}","omph.preview.imageFailed":"Impossible d'afficher l'image","omph.preview.zoomIn":"Zoom avant","omph.preview.zoomOut":"Zoom arri\xE8re","omph.preview.zoomFit":"Ajuster \xE0 la largeur","omph.newConversation":"Nouvelle conversation","omph.conversationList":"Liste des conversations","omph.conversations":"Conversations","omph.noConversations":"Aucune conversation","omph.initial.suggestions":"Questions sugg\xE9r\xE9es","omph.approval.waiting":"En attente d'approbation","omph.approval.choose":"Choisir une action","omph.approval.details":"D\xE9tails de l'approbation","omph.approval.choices":"Actions","omph.approval.reject":"Refuser","omph.approval.allowOnce":"Autoriser une fois","omph.approval.confirm":"Continuer","omph.approval.other":"Autre","omph.approval.otherPlaceholder":"D\xE9crire l'action \xE0 effectuer","omph.approval.escalation":"L'outil {toolName} demande une ex\xE9cution privil\xE9gi\xE9e","omph.approval.recommended":"(Recommand\xE9)","omph.approval.allowOnceException":"Autoriser cette exception une fois","omph.approval.allowSession":"Autoriser ce type pour le reste de la session","omph.approval.abandon":"Abandonner","omph.input.placeholder":"Saisir un message\u2026","omph.input.upload":"T\xE9l\xE9verser un fichier","omph.input.send":"Envoyer le message","omph.input.stop":"Arr\xEAter la g\xE9n\xE9ration","omph.input.queue.ask":"L'agent travaille. Envoyer maintenant ou apr\xE8s ce tour ?","omph.input.queue.sendNow":"Envoyer maintenant","omph.input.queue.afterTurn":"Envoyer apr\xE8s ce tour","omph.input.queue.queued":"En file d'attente \u2014 envoi apr\xE8s ce tour","omph.input.queue.cancel":"Annuler","omph.input.message":"Saisie de message","omph.input.tools":"Outils de saisie","omph.model.fallback":"Choisir un mod\xE8le","omph.model.aria":"Choisir le mod\xE8le, actuel {model}","omph.model.ariaEffort":"Choisir le mod\xE8le, actuel {model}, effort {effort}","omph.model.menu":"Mod\xE8le et effort","omph.model.model":"Mod\xE8le","omph.model.effort":"Effort","omph.model.search":"Rechercher un mod\xE8le\u2026","omph.model.searchClear":"Effacer la recherche","omph.model.searchEmpty":"Aucun mod\xE8le correspondant.","omph.model.emptyModels":"Aucun mod\xE8le disponible.","omph.model.emptyEfforts":"Ce mod\xE8le n'a pas de niveau d'effort.","agentui.html.defaultTitle":"HTML interactif","agentui.html.open":"Ouvrir","agentui.html.preview":"Aper\xE7u","agentui.html.code":"Code","agentui.html.toggle":"Basculer entre code et aper\xE7u","agentui.html.copy":"Copier le code","agentui.html.copied":"Copi\xE9","agentui.html.download":"T\xE9l\xE9charger","agentui.html.close":"Fermer"},bf={"common.cancel":"Abbrechen","common.save":"Speichern","common.ok":"OK","common.done":"Fertig","common.search":"Suchen","common.none":"Keine","common.all":"Alle","common.noData":"Keine Daten","common.copy":"Kopieren","common.delete":"L\xF6schen","common.loading":"Wird geladen...","header.searchPlaceholder":"Frag mich...","header.searchAddFeature":"Funktion hinzuf\xFCgen","header.searchStartVoice":"Spracheingabe starten","header.searchStopVoice":"Spracheingabe stoppen","header.searchOpenPanel":"Unterhaltung \xF6ffnen","header.theme.system":"Theme: System","header.theme.dark":"Theme: Dunkel","header.theme.light":"Theme: Hell","header.menu.setting":"Einstellungen","header.menu.refresh":"Aktualisieren","header.menu.logout":"Abmelden","navigation.expand":"Navigation erweitern","navigation.collapse":"Navigation einklappen","navigation.searchPlaceholder":"Men\xFC suchen...","navigation.noMatch":"Keine passenden Men\xFCeintr\xE4ge","navigation.noAccessibleApp":"Keine verf\xFCgbaren Anwendungen","navigation.noItems":"Keine Eintr\xE4ge vorhanden","navigation.expandView":"{title} aufklappen","navigation.mode.switchToFixed":"Zu fester Navigation wechseln","navigation.mode.switchToFloating":"Zu schwebender Navigation wechseln","navigation.pinned":"Angeheftet","navigation.pin.add":"Oben anheften","navigation.pin.remove":"L\xF6sen","table.toolbar.searchPlaceholder":"Suchen...","table.title.default":"Datentabelle","table.toolbar.groupBy":"Gruppieren","table.toolbar.summary":"Zusammenfassung","table.toolbar.columns":"Spalten","table.toolbar.export":"Export","table.toolbar.itemsPerPage":"Zeilen pro Seite:","table.toolbar.pageOf":"Seite {current} von {total}","table.toolbar.newItem":"Neuer Eintrag","table.toolbar.editItem":"Eintrag bearbeiten","table.toolbar.deleteItem":"Eintrag l\xF6schen","table.toolbar.graphicReport":"Grafikbericht","table.toolbar.saveLayout":"Layout speichern","table.menu.groupBy":"Gruppieren","table.menu.clearAll":"Alles l\xF6schen","table.menu.visibleColumns":"Sichtbare Spalten","table.menu.showSummaryRow":"Summenzeile anzeigen","table.menu.noNumericColumns":"Keine numerischen Spalten","table.group.expandAll":"Alle Gruppen aufklappen","table.group.collapseAll":"Alle Gruppen zuklappen","table.mobile.notImplemented":"Mobile Ansicht nicht implementiert","table.headerMenu.sortAsc":"Aufsteigend sortieren","table.headerMenu.sortDesc":"Absteigend sortieren","table.headerMenu.clearSort":"Sortierung entfernen","table.headerMenu.configureSort":"Sortierung konfigurieren...","table.headerMenu.group":"Nach dieser Spalte gruppieren","table.headerMenu.ungroup":"Aus Gruppierung entfernen","table.headerMenu.addSummary":"In Summe einbeziehen","table.headerMenu.removeSummary":"Aus Summe entfernen","table.headerMenu.hideColumn":"Spalte ausblenden","table.sortDialog.title":"Sortiereinstellungen","table.sortDialog.empty":"Keine Sortierregeln. F\xFCgen Sie eine hinzu, um zu sortieren.","table.sortDialog.addRule":"Regel hinzuf\xFCgen","table.sortDialog.clearAll":"Alle l\xF6schen","table.sortDialog.asc":"Aufsteigend","table.sortDialog.desc":"Absteigend","pivot.title.default":"Pivot-Tabelle","pivot.subtitle.default":"Ziehen Sie Felder, um die Pivot-Tabelle zu konfigurieren.","pivot.empty":"Ziehen Sie mindestens ein Wertefeld, um das Ergebnis anzuzeigen.","pivot.records":"Datens\xE4tze","pivot.afterFilter":"Nach Filter","pivot.grandTotal":"Gesamtsumme","pivot.resultLabel":"Ergebnis","pivot.valueLabel":"Wert","pivot.table.dimensions":"Dimensionen","pivot.config.title":"Konfiguration","pivot.fieldList":"Feldliste","pivot.availableDimensions":"Verf\xFCgbare Dimensionen","pivot.allFieldsInUse":"Alle Felder sind bereits verwendet.","pivot.zone.rows":"Zeilen","pivot.zone.columns":"Spalten","pivot.zone.filters":"Filter","pivot.zone.values":"Werte","pivot.hint.rows":"Felder hierhin ziehen, um die Zeilenhierarchie zu erstellen","pivot.hint.columns":"Felder hierhin ziehen, um die Spaltenhierarchie zu erstellen","pivot.hint.filters":"Felder hierhin ziehen f\xFCr Berichtsfilter","pivot.hint.values":"Numerische Felder hierhin ziehen f\xFCr Aggregation","pivot.clearArea":"Bereich leeren","pivot.filter.na":"N/V","pivot.filter.noValues":"Keine Werte","pivot.filter.noneSelected":"Nichts ausgew\xE4hlt","pivot.filter.allValues":"Alle Werte","pivot.filter.selectedCount":"{selected} / {total} ausgew\xE4hlt","pivot.filter.selectAll":"Alle ausw\xE4hlen","pivot.filter.deselectAll":"Alle abw\xE4hlen","pivot.filter.noResults":"Keine Ergebnisse","pivot.collapse.ariaExpand":"Konfigurationsbereich erweitern","pivot.collapse.ariaCollapse":"Konfigurationsbereich reduzieren","pivot.agg.sum":"Summe","pivot.agg.count":"Anzahl","pivot.agg.avg":"Durchschnitt","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"Preset w\xE4hlen","pivot.preset.save":"Preset speichern","pivot.preset.delete":"Preset l\xF6schen","pivot.preset.saveDialogTitle":"Aktuelles Preset speichern","pivot.preset.nameLabel":"Preset-Name","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"Pivot-Ergebnis","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"Pivot-Ergebnis erweitern","pivot.table.collapse.ariaCollapse":"Pivot-Ergebnis reduzieren","pivot.chart.title":"Pivot-Diagramm","pivot.chart.subtitle":"Eine Dimension und bis zu zwei Kennzahlen in einem kompakten Diagramm abbilden.","pivot.chart.subtitleReady":"{dimension} nach {measure}","pivot.chart.emptyNoDimension":"F\xFCgen Sie mindestens ein Zeilen- oder Spaltenfeld hinzu, um das Diagramm anzuzeigen.","pivot.chart.emptyNoValue":"F\xFCgen Sie mindestens ein Wertefeld hinzu, um das Diagramm anzuzeigen.","pivot.chart.emptyNoData":"F\xFCr die aktuelle Diagrammauswahl sind keine Daten verf\xFCgbar.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Kennzahl","pivot.chart.secondaryMeasure":"Vergleichskennzahl","pivot.chart.chartType":"Diagrammtyp","pivot.chart.style.barVertical":"Vertikale Balken","pivot.chart.style.barHorizontal":"Horizontale Balken","pivot.chart.style.line":"Linie","pivot.chart.style.scatter":"Streudiagramm","pivot.chart.collapse.ariaExpand":"Diagrammbereich erweitern","pivot.chart.collapse.ariaCollapse":"Diagrammbereich reduzieren","smartFilter.adaptFilters":"Filter anpassen","smartFilter.addFilters":"Filter hinzuf\xFCgen","smartFilter.go":"Los","smartFilter.visibleFilters":"Sichtbare Filter","smartFilter.searchPlaceholder":"Suchen...","smartFilter.noOptionsFound":"Keine Optionen gefunden","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"Gleich","smartFilter.operator.contains":"Enth\xE4lt","smartFilter.operator.notContains":"Enth\xE4lt nicht","smartFilter.operator.wildcard":"Wildcard-Suche","smartFilter.operator.notEquals":"Ungleich","smartFilter.operator.greaterThan":"Gr\xF6\xDFer als","smartFilter.operator.lessThan":"Kleiner als","smartFilter.operator.greaterOrEqual":"Gr\xF6\xDFer gleich","smartFilter.operator.lessOrEqual":"Kleiner gleich","smartFilter.operator.between":"Zwischen","variant.noOptions":"Keine Optionen","variant.defaultSuffix":"Standard","variant.selectVariant":"Variante w\xE4hlen","variant.saveView":"Ansicht speichern","variant.newVariant":"Neue Variante","variant.viewName":"Ansichtsname","variant.setDefault":"Als Standard setzen","variant.publicAllUsers":"\xD6ffentlich (alle Benutzer)","variant.toast.fetchFailed":"Varianten konnten nicht geladen werden","variant.toast.saveFailed":"Variante konnte nicht gespeichert werden","variant.toast.saveSuccess":"Variante erfolgreich gespeichert","variant.toast.deleteFailed":"Variante konnte nicht gel\xF6scht werden","variant.toast.deleteSuccess":"Variante erfolgreich gel\xF6scht","variant.toast.defaultFailed":"Standardvariante konnte nicht aktualisiert werden","variant.toast.defaultSuccess":"Standardvariante aktualisiert","layout.saveLayout":"Layout speichern","layout.layoutOptions":"Layout-Optionen","layout.selectLayout":"Layout w\xE4hlen","layout.saveCurrentLayout":"Aktuelles Layout speichern...","layout.noSavedLayouts":"Keine gespeicherten Layouts","layout.removeDefault":"Standard entfernen","layout.setAsDefault":"Als Standard setzen","layout.layoutName":"Layoutname","layout.layoutDescription":"Beschreibung","layout.layoutNameHelper":"z. B. Kompaktansicht","layout.warningOverwrite":"Warnung: Vorhandenes Layout wird \xFCberschrieben","layout.useAsDefault":"Als Standardlayout verwenden","layout.publicAllUsers":"\xD6ffentlich (f\xFCr alle sichtbar)","layout.toast.loadFallback":"Layouts konnten nicht vom Backend geladen werden, Wechsel zu lokalem Speicher","layout.toast.saveSuccess":"Layout erfolgreich gespeichert","layout.toast.saveLocalSuccess":"Layout im lokalen Speicher gespeichert","layout.toast.backendUnavailableSavedLocal":"Backend nicht verf\xFCgbar, lokal gespeichert","layout.toast.deleteSuccess":"Layout erfolgreich gel\xF6scht","layout.toast.deleteLocalSuccess":"Layout aus lokalem Speicher gel\xF6scht","layout.toast.backendUnavailableDeletedLocal":"Backend nicht verf\xFCgbar, lokal gel\xF6scht","layout.toast.defaultSuccess":"Standardlayout gesetzt","layout.toast.defaultLocalSuccess":"Standardlayout lokal gesetzt","layout.toast.backendUnavailableDefaultLocal":"Backend nicht verf\xFCgbar, Standard lokal gespeichert","dateRange.label":"Datumsbereich","dateRange.startDate":"Startdatum","dateRange.endDate":"Enddatum","dateRange.select":"Ausw\xE4hlen...","dateRange.today":"Heute","dateRange.thisWeek":"Diese Woche","dateRange.thisMonth":"Diesen Monat","graph.records":"{count} Datens\xE4tze","graph.kpi.totalRecords":"Gesamt Datens\xE4tze","graph.kpi.totalReport":"Gesamt Report","graph.kpi.totalBillable":"Gesamt abrechenbar","graph.kpi.efficiency":"Effizienz","graph.kpi.amount":"Betrag","graph.kpi.flagged":"Markiert","graph.chart.billable.title":"Abrechenbar nach Dimension","graph.chart.billable.subtitle":"Top-Werte nach abrechenbaren Stunden","graph.chart.efficiency.title":"Effizienz pro Person","graph.chart.efficiency.subtitle":"Niedrigste Effizienz zuerst","graph.chart.status.title":"Statusverteilung","graph.chart.status.subtitle":"Anteil je Status","graph.dataBody":"Datentabelle","graph.reportTitle":"Grafikbericht","graph.unassigned":"Nicht zugewiesen","graph.column.reportHours":"Melde-Stunden","graph.column.billableHours":"Abrechenbare Stunden","detail.searchAi.placeholder":"Felder suchen, oder bei keinem Treffer die KI fragen...","detail.searchAi.matches":"{count} Treffer gefunden","detail.searchAi.noMatch":"Kein passendes Feld gefunden.","detail.searchAi.autoAiFallback":"Keine direkte \xDCbereinstimmung. KI-Analyse wird gestartet...","detail.searchAi.aiResultTitle":"KI-Ergebnis","detail.table.title":"Verkn\xFCpfte Eintr\xE4ge","kanban.empty":"Karten hier ablegen","kanban.bucket.limit":"Limit","kanban.bucket.dropHere":"Loslassen, um in diese Spalte zu verschieben","kanban.bucket.add":"Spalte hinzuf\xFCgen","kanban.bucket.rename":"Spalte umbenennen","kanban.bucket.saveRename":"Spaltennamen speichern","kanban.bucket.cancelRename":"Umbenennen abbrechen","kanban.search.placeholder":"Karten und Spalten durchsuchen","kanban.search.clear":"Suche l\xF6schen","kanban.search.results":"{count} passende Karten","kanban.search.noMatch":"Keine passenden Karten","kanban.card.progress":"Fortschritt","kanban.card.openDetail":"Detail \xF6ffnen","kanban.priority.critical":"Kritisch","kanban.priority.high":"Hoch","kanban.priority.medium":"Mittel","kanban.priority.low":"Niedrig","quickCreate.newItem":"Neuer Eintrag","quickCreate.createWithTitle":"{title} erstellen","quickEdit.editWithTitle":"{title} bearbeiten","quickDelete.confirmTitle":"L\xF6schen best\xE4tigen","quickDelete.confirmMessageSingle":"M\xF6chten Sie den ausgew\xE4hlten Datensatz wirklich l\xF6schen?","quickDelete.confirmMessageMultiple":"M\xF6chten Sie die {count} ausgew\xE4hlten Datens\xE4tze wirklich l\xF6schen?","cardPage.viewDetails":"Details anzeigen","cardPage.download":"Herunterladen","cardPage.close":"Schlie\xDFen","cardPage.empty":"Keine Eintr\xE4ge gefunden","messageBox.confirm":"OK","messageBox.cancel":"Abbrechen","omph.status.idle":"Inaktiv","omph.status.pending":"Ausstehend","omph.status.running":"L\xE4uft","omph.status.success":"Erfolgt","omph.status.error":"Fehler","omph.working":"In Arbeit","omph.workingFor":"In Arbeit seit {duration}","omph.loadOlder":"Fr\xFChere Nachrichten laden","omph.loadingOlder":"Fr\xFChere Nachrichten werden geladen\u2026","omph.toBottom":"Nach unten","omph.copy":"Kopieren","omph.copied":"Kopiert","omph.turnActions":"Antwortaktionen","omph.usage":"Nutzung","omph.inputTokens":"Eingabe","omph.outputTokens":"Ausgabe","omph.duration":"Dauer","omph.send":"Senden","omph.stop":"Stoppen","omph.supplement.queued":"Zum laufenden Vorgang hinzugef\xFCgt","omph.turnRail":"Runden","omph.secondUnit":"s","omph.minuteUnit":"min","omph.preview.title":"Dateivorschau","omph.preview.close":"Vorschau schlie\xDFen","omph.preview.back":"Zur\xFCck zur Konversation","omph.preview.expand":"Vorschau vergr\xF6\xDFern","omph.preview.collapse":"Vorschau wiederherstellen","omph.preview.copyContent":"Inhalt kopieren","omph.preview.copyPath":"Pfad kopieren","omph.preview.download":"Herunterladen","omph.preview.openExternal":"Extern \xF6ffnen","omph.preview.wrap":"Zeilenumbruch","omph.preview.loading":"Datei wird geladen","omph.preview.missing":"Datei nicht gefunden","omph.preview.failed":"Datei konnte nicht geladen werden","omph.preview.unsupported":"Keine Vorschau f\xFCr diesen Dateityp","omph.preview.retry":"Erneut versuchen","omph.preview.resize":"Vorschaugr\xF6\xDFe \xE4ndern","omph.preview.line":"Zeile {start}","omph.preview.lines":"Zeilen {start}\u2013{end}","omph.preview.truncated":"Die ersten {shown} von {total} Zeilen werden angezeigt","omph.preview.sheetTruncated":"Die ersten {shown} von {total} Zeilen werden angezeigt","omph.preview.imageFailed":"Bild konnte nicht angezeigt werden","omph.preview.zoomIn":"Vergr\xF6\xDFern","omph.preview.zoomOut":"Verkleinern","omph.preview.zoomFit":"An Breite anpassen","omph.newConversation":"Neue Konversation","omph.conversationList":"Konversationsliste","omph.conversations":"Konversationen","omph.noConversations":"Noch keine Konversationen","omph.initial.suggestions":"Vorgeschlagene Fragen","omph.approval.waiting":"Auf Genehmigung wartend","omph.approval.choose":"Aktion w\xE4hlen","omph.approval.details":"Genehmigungsdetails","omph.approval.choices":"Aktionen","omph.approval.reject":"Ablehnen","omph.approval.allowOnce":"Einmal erlauben","omph.approval.confirm":"Fortfahren","omph.approval.other":"Sonstiges","omph.approval.otherPlaceholder":"Aktion beschreiben","omph.approval.escalation":"Tool {toolName} fordert privilegierte Ausf\xFChrung","omph.approval.recommended":"(Empfohlen)","omph.approval.allowOnceException":"Diese Ausnahme einmal erlauben","omph.approval.allowSession":"Diese Art f\xFCr den Rest der Sitzung erlauben","omph.approval.abandon":"Aufgeben","omph.input.placeholder":"Nachricht eingeben\u2026","omph.input.upload":"Datei hochladen","omph.input.send":"Nachricht senden","omph.input.stop":"Generierung stoppen","omph.input.queue.ask":"Der Agent arbeitet. Jetzt oder nach diesem Zug senden?","omph.input.queue.sendNow":"Jetzt senden","omph.input.queue.afterTurn":"Nach diesem Zug senden","omph.input.queue.queued":"In Warteschlange \u2014 Senden nach diesem Zug","omph.input.queue.cancel":"Abbrechen","omph.input.message":"Nachrichteneingabe","omph.input.tools":"Eingabewerkzeuge","omph.model.fallback":"Modell w\xE4hlen","omph.model.aria":"Modell w\xE4hlen, aktuell {model}","omph.model.ariaEffort":"Modell w\xE4hlen, aktuell {model}, Aufwand {effort}","omph.model.menu":"Modell und Denkaufwand","omph.model.model":"Modell","omph.model.effort":"Denkaufwand","omph.model.search":"Modelle suchen\u2026","omph.model.searchClear":"Suche l\xF6schen","omph.model.searchEmpty":"Keine passenden Modelle.","omph.model.emptyModels":"Keine Modelle verf\xFCgbar.","omph.model.emptyEfforts":"Dieses Modell hat keine Denkaufwand-Stufen.","agentui.html.defaultTitle":"Interaktives HTML","agentui.html.open":"\xD6ffnen","agentui.html.preview":"Vorschau","agentui.html.code":"Code","agentui.html.toggle":"Zwischen Code und Vorschau wechseln","agentui.html.copy":"Code kopieren","agentui.html.copied":"Kopiert","agentui.html.download":"Herunterladen","agentui.html.close":"Schlie\xDFen"},vf={"common.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB","common.save":"\u4FDD\u5B58","common.ok":"OK","common.done":"\u5B8C\u4E86","common.search":"\u691C\u7D22","common.none":"\u306A\u3057","common.all":"\u3059\u3079\u3066","common.noData":"\u30C7\u30FC\u30BF\u306A\u3057","common.copy":"\u30B3\u30D4\u30FC","common.delete":"\u524A\u9664","common.loading":"\u8AAD\u307F\u8FBC\u307F\u4E2D...","header.searchPlaceholder":"\u4F55\u304B\u805E\u3044\u3066\u304F\u3060\u3055\u3044...","header.searchAddFeature":"\u6A5F\u80FD\u3092\u8FFD\u52A0","header.searchStartVoice":"\u97F3\u58F0\u5165\u529B\u3092\u958B\u59CB","header.searchStopVoice":"\u97F3\u58F0\u5165\u529B\u3092\u505C\u6B62","header.searchOpenPanel":"\u4F1A\u8A71\u3092\u958B\u304F","header.theme.system":"\u30C6\u30FC\u30DE\uFF1A\u30B7\u30B9\u30C6\u30E0","header.theme.dark":"\u30C6\u30FC\u30DE\uFF1A\u30C0\u30FC\u30AF","header.theme.light":"\u30C6\u30FC\u30DE\uFF1A\u30E9\u30A4\u30C8","header.menu.setting":"\u8A2D\u5B9A","header.menu.refresh":"\u518D\u8AAD\u307F\u8FBC\u307F","header.menu.logout":"\u30ED\u30B0\u30A2\u30A6\u30C8","navigation.expand":"\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u3092\u5C55\u958B","navigation.collapse":"\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u3092\u6298\u308A\u305F\u305F\u3080","navigation.searchPlaceholder":"\u30E1\u30CB\u30E5\u30FC\u3092\u691C\u7D22...","navigation.noMatch":"\u4E00\u81F4\u3059\u308B\u30E1\u30CB\u30E5\u30FC\u304C\u3042\u308A\u307E\u305B\u3093","navigation.noAccessibleApp":"\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u30A2\u30D7\u30EA\u304C\u3042\u308A\u307E\u305B\u3093","navigation.noItems":"\u8868\u793A\u3067\u304D\u308B\u9805\u76EE\u304C\u3042\u308A\u307E\u305B\u3093","navigation.expandView":"{title} \u3092\u5C55\u958B","navigation.mode.switchToFixed":"\u56FA\u5B9A\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u306B\u5207\u308A\u66FF\u3048","navigation.mode.switchToFloating":"\u30D5\u30ED\u30FC\u30C6\u30A3\u30F3\u30B0\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u306B\u5207\u308A\u66FF\u3048","navigation.pinned":"\u30D4\u30F3\u7559\u3081","navigation.pin.add":"\u4E0A\u90E8\u306B\u30D4\u30F3\u7559\u3081","navigation.pin.remove":"\u30D4\u30F3\u7559\u3081\u3092\u89E3\u9664","table.toolbar.searchPlaceholder":"\u691C\u7D22...","table.title.default":"\u30C7\u30FC\u30BF\u30C6\u30FC\u30D6\u30EB","table.toolbar.groupBy":"\u30B0\u30EB\u30FC\u30D7\u5316","table.toolbar.summary":"\u96C6\u8A08","table.toolbar.columns":"\u5217","table.toolbar.export":"\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8","table.toolbar.itemsPerPage":"1\u30DA\u30FC\u30B8\u306E\u4EF6\u6570\uFF1A","table.toolbar.pageOf":"{current} / {total} \u30DA\u30FC\u30B8","table.toolbar.newItem":"\u65B0\u898F\u4F5C\u6210","table.toolbar.editItem":"\u7DE8\u96C6","table.toolbar.deleteItem":"\u524A\u9664","table.toolbar.graphicReport":"\u30B0\u30E9\u30D5\u30A3\u30C3\u30AF\u30EC\u30DD\u30FC\u30C8","table.toolbar.saveLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u4FDD\u5B58","table.menu.groupBy":"\u30B0\u30EB\u30FC\u30D7\u5316","table.menu.clearAll":"\u3059\u3079\u3066\u30AF\u30EA\u30A2","table.menu.visibleColumns":"\u8868\u793A\u5217","table.menu.showSummaryRow":"\u96C6\u8A08\u884C\u3092\u8868\u793A","table.menu.noNumericColumns":"\u6570\u5024\u5217\u304C\u3042\u308A\u307E\u305B\u3093","table.group.expandAll":"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u5C55\u958B","table.group.collapseAll":"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u6298\u308A\u305F\u305F\u3080","table.mobile.notImplemented":"\u30E2\u30D0\u30A4\u30EB\u8868\u793A\u306F\u672A\u5B9F\u88C5\u3067\u3059","table.headerMenu.sortAsc":"\u6607\u9806\u3067\u4E26\u3079\u66FF\u3048","table.headerMenu.sortDesc":"\u964D\u9806\u3067\u4E26\u3079\u66FF\u3048","table.headerMenu.clearSort":"\u4E26\u3079\u66FF\u3048\u3092\u89E3\u9664","table.headerMenu.configureSort":"\u4E26\u3079\u66FF\u3048\u3092\u8A2D\u5B9A...","table.headerMenu.group":"\u3053\u306E\u5217\u3067\u30B0\u30EB\u30FC\u30D7\u5316","table.headerMenu.ungroup":"\u30B0\u30EB\u30FC\u30D7\u304B\u3089\u5916\u3059","table.headerMenu.addSummary":"\u96C6\u8A08\u306B\u8FFD\u52A0","table.headerMenu.removeSummary":"\u96C6\u8A08\u304B\u3089\u524A\u9664","table.headerMenu.hideColumn":"\u5217\u3092\u975E\u8868\u793A","table.sortDialog.title":"\u4E26\u3079\u66FF\u3048\u8A2D\u5B9A","table.sortDialog.empty":"\u4E26\u3079\u66FF\u3048\u30EB\u30FC\u30EB\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","table.sortDialog.addRule":"\u30EB\u30FC\u30EB\u3092\u8FFD\u52A0","table.sortDialog.clearAll":"\u3059\u3079\u3066\u30AF\u30EA\u30A2","table.sortDialog.asc":"\u6607\u9806","table.sortDialog.desc":"\u964D\u9806","pivot.title.default":"\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB","pivot.subtitle.default":"\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB\u3092\u8A2D\u5B9A\u3057\u307E\u3059\u3002","pivot.empty":"\u7D50\u679C\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5024\u30A8\u30EA\u30A2\u306B\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.records":"\u30EC\u30B3\u30FC\u30C9","pivot.afterFilter":"\u30D5\u30A3\u30EB\u30BF\u30FC\u5F8C","pivot.grandTotal":"\u7DCF\u8A08","pivot.resultLabel":"\u7D50\u679C","pivot.valueLabel":"\u5024","pivot.table.dimensions":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.config.title":"\u8A2D\u5B9A","pivot.fieldList":"\u30D5\u30A3\u30FC\u30EB\u30C9\u4E00\u89A7","pivot.availableDimensions":"\u5229\u7528\u53EF\u80FD\u306A\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.allFieldsInUse":"\u3059\u3079\u3066\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u304C\u4F7F\u7528\u4E2D\u3067\u3059\u3002","pivot.zone.rows":"\u884C","pivot.zone.columns":"\u5217","pivot.zone.filters":"\u30D5\u30A3\u30EB\u30BF\u30FC","pivot.zone.values":"\u5024","pivot.hint.rows":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u884C\u968E\u5C64\u3092\u4F5C\u6210","pivot.hint.columns":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u5217\u968E\u5C64\u3092\u4F5C\u6210","pivot.hint.filters":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30EC\u30DD\u30FC\u30C8\u30D5\u30A3\u30EB\u30BF\u30FC\u3092\u8A2D\u5B9A","pivot.hint.values":"\u3053\u3053\u306B\u6570\u5024\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u96C6\u8A08","pivot.clearArea":"\u30A8\u30EA\u30A2\u3092\u30AF\u30EA\u30A2","pivot.filter.na":"N/A","pivot.filter.noValues":"\u5024\u304C\u3042\u308A\u307E\u305B\u3093","pivot.filter.noneSelected":"\u672A\u9078\u629E","pivot.filter.allValues":"\u3059\u3079\u3066\u306E\u5024","pivot.filter.selectedCount":"{selected} / {total} \u3092\u9078\u629E","pivot.filter.selectAll":"\u3059\u3079\u3066\u9078\u629E","pivot.filter.deselectAll":"\u3059\u3079\u3066\u89E3\u9664","pivot.filter.noResults":"\u7D50\u679C\u304C\u3042\u308A\u307E\u305B\u3093","pivot.collapse.ariaExpand":"\u8A2D\u5B9A\u30A8\u30EA\u30A2\u3092\u5C55\u958B","pivot.collapse.ariaCollapse":"\u8A2D\u5B9A\u30A8\u30EA\u30A2\u3092\u6298\u308A\u305F\u305F\u3080","pivot.agg.sum":"\u5408\u8A08","pivot.agg.count":"\u4EF6\u6570","pivot.agg.avg":"\u5E73\u5747","pivot.agg.min":"\u6700\u5C0F","pivot.agg.max":"\u6700\u5927","pivot.preset.selectPlaceholder":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u9078\u629E","pivot.preset.save":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u4FDD\u5B58","pivot.preset.delete":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u524A\u9664","pivot.preset.saveDialogTitle":"\u73FE\u5728\u306E\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u4FDD\u5B58","pivot.preset.nameLabel":"\u30D7\u30EA\u30BB\u30C3\u30C8\u540D","pivot.preset.defaultName":"\u30D7\u30EA\u30BB\u30C3\u30C8 {index}","pivot.table.sectionTitle":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C\u3092\u5C55\u958B","pivot.table.collapse.ariaCollapse":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C\u3092\u6298\u308A\u305F\u305F\u3080","pivot.chart.title":"\u30D4\u30DC\u30C3\u30C8\u30C1\u30E3\u30FC\u30C8","pivot.chart.subtitle":"1\u3064\u306E\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u3068\u6700\u59272\u3064\u306E\u6307\u6A19\u3092\u30B3\u30F3\u30D1\u30AF\u30C8\u306A\u30C1\u30E3\u30FC\u30C8\u306B\u307E\u3068\u3081\u307E\u3059\u3002","pivot.chart.subtitleReady":"{dimension} \u3054\u3068\u306E {measure}","pivot.chart.emptyNoDimension":"\u30C1\u30E3\u30FC\u30C8\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u884C\u307E\u305F\u306F\u5217\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.chart.emptyNoValue":"\u30C1\u30E3\u30FC\u30C8\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u5024\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.chart.emptyNoData":"\u73FE\u5728\u306E\u30C1\u30E3\u30FC\u30C8\u9078\u629E\u3067\u306F\u8868\u793A\u3067\u304D\u308B\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093\u3002","pivot.chart.dimension":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.chart.primaryMeasure":"\u6307\u6A19","pivot.chart.secondaryMeasure":"\u6BD4\u8F03\u6307\u6A19","pivot.chart.chartType":"\u30C1\u30E3\u30FC\u30C8\u7A2E\u5225","pivot.chart.style.barVertical":"\u7E26\u68D2\u30B0\u30E9\u30D5","pivot.chart.style.barHorizontal":"\u6A2A\u68D2\u30B0\u30E9\u30D5","pivot.chart.style.line":"\u6298\u308C\u7DDA\u30B0\u30E9\u30D5","pivot.chart.style.scatter":"\u6563\u5E03\u56F3","pivot.chart.collapse.ariaExpand":"\u30C1\u30E3\u30FC\u30C8\u9818\u57DF\u3092\u5C55\u958B","pivot.chart.collapse.ariaCollapse":"\u30C1\u30E3\u30FC\u30C8\u9818\u57DF\u3092\u6298\u308A\u305F\u305F\u3080","smartFilter.adaptFilters":"\u30D5\u30A3\u30EB\u30BF\u30FC\u8ABF\u6574","smartFilter.addFilters":"\u30D5\u30A3\u30EB\u30BF\u30FC\u8FFD\u52A0","smartFilter.go":"\u5B9F\u884C","smartFilter.visibleFilters":"\u8868\u793A\u30D5\u30A3\u30EB\u30BF\u30FC","smartFilter.searchPlaceholder":"\u691C\u7D22...","smartFilter.noOptionsFound":"\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093","smartFilter.min":"\u6700\u5C0F","smartFilter.max":"\u6700\u5927","smartFilter.minMaxPlaceholder":"\u6700\u5C0F - \u6700\u5927","smartFilter.operator.equals":"\u7B49\u3057\u3044","smartFilter.operator.contains":"\u542B\u3080","smartFilter.operator.notContains":"\u542B\u307E\u306A\u3044","smartFilter.operator.wildcard":"\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u691C\u7D22","smartFilter.operator.notEquals":"\u7B49\u3057\u304F\u306A\u3044","smartFilter.operator.greaterThan":"\u3088\u308A\u5927\u304D\u3044","smartFilter.operator.lessThan":"\u3088\u308A\u5C0F\u3055\u3044","smartFilter.operator.greaterOrEqual":"\u4EE5\u4E0A","smartFilter.operator.lessOrEqual":"\u4EE5\u4E0B","smartFilter.operator.between":"\u7BC4\u56F2","variant.noOptions":"\u30AA\u30D7\u30B7\u30E7\u30F3\u306A\u3057","variant.defaultSuffix":"\u30C7\u30D5\u30A9\u30EB\u30C8","variant.selectVariant":"\u30D3\u30E5\u30FC\u3092\u9078\u629E","variant.saveView":"\u30D3\u30E5\u30FC\u4FDD\u5B58","variant.newVariant":"\u65B0\u3057\u3044\u30D3\u30E5\u30FC","variant.viewName":"\u30D3\u30E5\u30FC\u540D","variant.setDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u306B\u8A2D\u5B9A","variant.publicAllUsers":"\u516C\u958B\uFF08\u5168\u30E6\u30FC\u30B6\u30FC\uFF09","variant.toast.fetchFailed":"\u30D3\u30E5\u30FC\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.saveFailed":"\u30D3\u30E5\u30FC\u306E\u4FDD\u5B58\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.saveSuccess":"\u30D3\u30E5\u30FC\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F","variant.toast.deleteFailed":"\u30D3\u30E5\u30FC\u306E\u524A\u9664\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.deleteSuccess":"\u30D3\u30E5\u30FC\u3092\u524A\u9664\u3057\u307E\u3057\u305F","variant.toast.defaultFailed":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30D3\u30E5\u30FC\u306E\u66F4\u65B0\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.defaultSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30D3\u30E5\u30FC\u3092\u66F4\u65B0\u3057\u307E\u3057\u305F","layout.saveLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u4FDD\u5B58","layout.layoutOptions":"\u30EC\u30A4\u30A2\u30A6\u30C8\u30AA\u30D7\u30B7\u30E7\u30F3","layout.selectLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u9078\u629E","layout.saveCurrentLayout":"\u73FE\u5728\u306E\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4FDD\u5B58...","layout.noSavedLayouts":"\u4FDD\u5B58\u6E08\u307F\u30EC\u30A4\u30A2\u30A6\u30C8\u306A\u3057","layout.removeDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u89E3\u9664","layout.setAsDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u306B\u8A2D\u5B9A","layout.layoutName":"\u30EC\u30A4\u30A2\u30A6\u30C8\u540D","layout.layoutDescription":"\u8AAC\u660E","layout.layoutNameHelper":"\u4F8B\uFF1A\u30B3\u30F3\u30D1\u30AF\u30C8\u8868\u793A","layout.warningOverwrite":"\u8B66\u544A\uFF1A\u65E2\u5B58\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4E0A\u66F8\u304D\u3057\u307E\u3059","layout.useAsDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3068\u3057\u3066\u4F7F\u7528","layout.publicAllUsers":"\u516C\u958B\uFF08\u5168\u30E6\u30FC\u30B6\u30FC\u306B\u8868\u793A\uFF09","layout.toast.loadFallback":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u304B\u3089\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u3001\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u306B\u5207\u308A\u66FF\u3048\u307E\u3057\u305F","layout.toast.saveSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.saveLocalSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableSavedLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30ED\u30FC\u30AB\u30EB\u306B\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.deleteSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.deleteLocalSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u304B\u3089\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableDeletedLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30ED\u30FC\u30AB\u30EB\u304B\u3089\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.defaultSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u8A2D\u5B9A\u3057\u307E\u3057\u305F","layout.toast.defaultLocalSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u306B\u8A2D\u5B9A\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableDefaultLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u3057\u307E\u3057\u305F","dateRange.label":"\u65E5\u4ED8\u7BC4\u56F2","dateRange.startDate":"\u958B\u59CB\u65E5","dateRange.endDate":"\u7D42\u4E86\u65E5","dateRange.select":"\u9078\u629E...","dateRange.today":"\u4ECA\u65E5","dateRange.thisWeek":"\u4ECA\u9031","dateRange.thisMonth":"\u4ECA\u6708","graph.records":"{count} \u4EF6","graph.kpi.totalRecords":"\u7DCF\u30EC\u30B3\u30FC\u30C9","graph.kpi.totalReport":"\u7DCF\u5831\u544A\u6642\u9593","graph.kpi.totalBillable":"\u7DCF\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","graph.kpi.efficiency":"\u52B9\u7387","graph.kpi.amount":"\u91D1\u984D","graph.kpi.flagged":"\u8981\u78BA\u8A8D","graph.chart.billable.title":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u5225\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","graph.chart.billable.subtitle":"\u8ACB\u6C42\u53EF\u80FD\u6642\u9593\u306E\u4E0A\u4F4D","graph.chart.efficiency.title":"\u62C5\u5F53\u8005\u5225\u52B9\u7387","graph.chart.efficiency.subtitle":"\u52B9\u7387\u306E\u4F4E\u3044\u9806","graph.chart.status.title":"\u30B9\u30C6\u30FC\u30BF\u30B9\u5206\u5E03","graph.chart.status.subtitle":"\u30B9\u30C6\u30FC\u30BF\u30B9\u5225\u6BD4\u7387","graph.dataBody":"\u30C7\u30FC\u30BF\u672C\u4F53","graph.reportTitle":"\u30B0\u30E9\u30D5\u30A3\u30C3\u30AF\u30EC\u30DD\u30FC\u30C8","graph.unassigned":"\u672A\u5272\u308A\u5F53\u3066","graph.column.reportHours":"\u5831\u544A\u6642\u9593","graph.column.billableHours":"\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","detail.searchAi.placeholder":"\u9805\u76EE\u3092\u691C\u7D22\u3002\u898B\u3064\u304B\u3089\u306A\u3044\u5834\u5408\u306FAI\u306B\u8CEA\u554F\u3057\u307E\u3059...","detail.searchAi.matches":"{count} \u4EF6\u306E\u4E00\u81F4","detail.searchAi.noMatch":"\u4E00\u81F4\u3059\u308B\u9805\u76EE\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002","detail.searchAi.autoAiFallback":"\u4E00\u81F4\u306A\u3057\u3002AI\u5206\u6790\u3092\u5B9F\u884C\u3057\u307E\u3059...","detail.searchAi.aiResultTitle":"AI\u5206\u6790\u7D50\u679C","detail.table.title":"\u95A2\u9023\u30EC\u30B3\u30FC\u30C9","kanban.empty":"\u3053\u3053\u306B\u30AB\u30FC\u30C9\u3092\u30C9\u30ED\u30C3\u30D7","kanban.bucket.limit":"\u4E0A\u9650","kanban.bucket.dropHere":"\u96E2\u3059\u3068\u3053\u306E bucket \u306B\u79FB\u52D5\u3057\u307E\u3059","kanban.bucket.add":"bucket \u3092\u8FFD\u52A0","kanban.bucket.rename":"bucket \u540D\u3092\u5909\u66F4","kanban.bucket.saveRename":"bucket \u540D\u3092\u4FDD\u5B58","kanban.bucket.cancelRename":"\u540D\u524D\u5909\u66F4\u3092\u30AD\u30E3\u30F3\u30BB\u30EB","kanban.search.placeholder":"\u30AB\u30FC\u30C9\u3068 bucket \u3092\u691C\u7D22","kanban.search.clear":"\u691C\u7D22\u3092\u30AF\u30EA\u30A2","kanban.search.results":"{count} \u4EF6\u306E\u30AB\u30FC\u30C9\u304C\u4E00\u81F4","kanban.search.noMatch":"\u4E00\u81F4\u3059\u308B\u30AB\u30FC\u30C9\u306F\u3042\u308A\u307E\u305B\u3093","kanban.card.progress":"\u9032\u6357","kanban.card.openDetail":"\u8A73\u7D30\u3092\u958B\u304F","kanban.priority.critical":"\u7DCA\u6025","kanban.priority.high":"\u9AD8","kanban.priority.medium":"\u4E2D","kanban.priority.low":"\u4F4E","quickCreate.newItem":"\u65B0\u898F\u4F5C\u6210","quickCreate.createWithTitle":"{title} \u3092\u4F5C\u6210","quickEdit.editWithTitle":"{title} \u3092\u7DE8\u96C6","quickDelete.confirmTitle":"\u524A\u9664\u306E\u78BA\u8A8D","quickDelete.confirmMessageSingle":"\u9078\u629E\u3057\u305F\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F","quickDelete.confirmMessageMultiple":"\u9078\u629E\u3057\u305F {count} \u4EF6\u306E\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F","cardPage.viewDetails":"\u8A73\u7D30\u3092\u8868\u793A","cardPage.download":"\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9","cardPage.close":"\u9589\u3058\u308B","cardPage.empty":"\u9805\u76EE\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093","messageBox.confirm":"OK","messageBox.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB","omph.status.idle":"\u5F85\u6A5F\u4E2D","omph.status.pending":"\u51E6\u7406\u5F85\u3061","omph.status.running":"\u51E6\u7406\u4E2D","omph.status.success":"\u5B8C\u4E86","omph.status.error":"\u30A8\u30E9\u30FC","omph.working":"\u51E6\u7406\u4E2D","omph.workingFor":"\u51E6\u7406\u4E2D\uFF08{duration} \u7D4C\u904E\uFF09","omph.loadOlder":"\u904E\u53BB\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8AAD\u307F\u8FBC\u3080","omph.loadingOlder":"\u8AAD\u307F\u8FBC\u307F\u4E2D\u2026","omph.toBottom":"\u4E00\u756A\u4E0B\u3078","omph.copy":"\u30B3\u30D4\u30FC","omph.copied":"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F","omph.turnActions":"\u8FD4\u4FE1\u30A2\u30AF\u30B7\u30E7\u30F3","omph.usage":"\u4F7F\u7528\u91CF","omph.inputTokens":"\u5165\u529B","omph.outputTokens":"\u51FA\u529B","omph.duration":"\u6240\u8981\u6642\u9593","omph.send":"\u9001\u4FE1","omph.stop":"\u505C\u6B62","omph.supplement.queued":"\u5B9F\u884C\u4E2D\u306E\u30BF\u30B9\u30AF\u306B\u8FFD\u52A0\u3057\u307E\u3057\u305F","omph.turnRail":"\u30BF\u30FC\u30F3","omph.secondUnit":"\u79D2","omph.minuteUnit":"\u5206","omph.preview.title":"\u30D5\u30A1\u30A4\u30EB\u30D7\u30EC\u30D3\u30E5\u30FC","omph.preview.close":"\u30D7\u30EC\u30D3\u30E5\u30FC\u3092\u9589\u3058\u308B","omph.preview.back":"\u4F1A\u8A71\u306B\u623B\u308B","omph.preview.expand":"\u30D7\u30EC\u30D3\u30E5\u30FC\u3092\u62E1\u5927","omph.preview.collapse":"\u30D7\u30EC\u30D3\u30E5\u30FC\u306E\u30B5\u30A4\u30BA\u3092\u623B\u3059","omph.preview.copyContent":"\u5185\u5BB9\u3092\u30B3\u30D4\u30FC","omph.preview.copyPath":"\u30D1\u30B9\u3092\u30B3\u30D4\u30FC","omph.preview.download":"\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9","omph.preview.openExternal":"\u5916\u90E8\u3067\u958B\u304F","omph.preview.wrap":"\u6298\u308A\u8FD4\u3057","omph.preview.loading":"\u30D5\u30A1\u30A4\u30EB\u3092\u8AAD\u307F\u8FBC\u307F\u4E2D","omph.preview.missing":"\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093","omph.preview.failed":"\u3053\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F","omph.preview.unsupported":"\u3053\u306E\u30D5\u30A1\u30A4\u30EB\u5F62\u5F0F\u306F\u30D7\u30EC\u30D3\u30E5\u30FC\u3067\u304D\u307E\u305B\u3093","omph.preview.retry":"\u518D\u8A66\u884C","omph.preview.resize":"\u30D7\u30EC\u30D3\u30E5\u30FC\u30B5\u30A4\u30BA\u306E\u5909\u66F4","omph.preview.line":"{start} \u884C\u76EE","omph.preview.lines":"{start}\u2013{end} \u884C","omph.preview.truncated":"\u5168 {total} \u884C\u4E2D\u5148\u982D {shown} \u884C\u3092\u8868\u793A","omph.preview.sheetTruncated":"\u5168 {total} \u884C\u4E2D\u5148\u982D {shown} \u884C\u3092\u8868\u793A","omph.preview.imageFailed":"\u753B\u50CF\u3092\u8868\u793A\u3067\u304D\u307E\u305B\u3093","omph.preview.zoomIn":"\u62E1\u5927","omph.preview.zoomOut":"\u7E2E\u5C0F","omph.preview.zoomFit":"\u5E45\u306B\u5408\u308F\u305B\u308B","omph.newConversation":"\u65B0\u3057\u3044\u4F1A\u8A71","omph.conversationList":"\u4F1A\u8A71\u30EA\u30B9\u30C8","omph.conversations":"\u4F1A\u8A71","omph.noConversations":"\u4F1A\u8A71\u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093","omph.initial.suggestions":"\u5019\u88DC\u306E\u8CEA\u554F","omph.approval.waiting":"\u627F\u8A8D\u5F85\u3061","omph.approval.choose":"\u64CD\u4F5C\u3092\u9078\u629E","omph.approval.details":"\u627F\u8A8D\u306E\u8A73\u7D30","omph.approval.choices":"\u64CD\u4F5C","omph.approval.reject":"\u62D2\u5426","omph.approval.allowOnce":"\u4ECA\u56DE\u306E\u307F\u8A31\u53EF","omph.approval.confirm":"\u7D9A\u884C","omph.approval.other":"\u305D\u306E\u4ED6","omph.approval.otherPlaceholder":"\u5B9F\u884C\u3059\u308B\u64CD\u4F5C\u3092\u5165\u529B","omph.approval.escalation":"\u30C4\u30FC\u30EB {toolName} \u304C\u7279\u6A29\u5B9F\u884C\u3092\u8981\u6C42\u3057\u3066\u3044\u307E\u3059","omph.approval.recommended":"\uFF08\u63A8\u5968\uFF09","omph.approval.allowOnceException":"\u4ECA\u56DE\u306E\u307F\u4F8B\u5916\u3092\u8A31\u53EF","omph.approval.allowSession":"\u3053\u306E\u30BB\u30C3\u30B7\u30E7\u30F3\u3067\u306F\u540C\u7A2E\u3092\u8A31\u53EF","omph.approval.abandon":"\u653E\u68C4","omph.input.placeholder":"\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u5165\u529B\u2026","omph.input.upload":"\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9","omph.input.send":"\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u9001\u4FE1","omph.input.stop":"\u751F\u6210\u3092\u505C\u6B62","omph.input.queue.ask":"\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u304C\u5B9F\u884C\u4E2D\u3067\u3059\u3002\u4ECA\u3059\u3050\u9001\u4FE1\u3057\u307E\u3059\u304B\u3001\u3053\u306E\u30BF\u30FC\u30F3\u306E\u5F8C\u306B\u9001\u4FE1\u3057\u307E\u3059\u304B\uFF1F","omph.input.queue.sendNow":"\u4ECA\u3059\u3050\u9001\u4FE1","omph.input.queue.afterTurn":"\u3053\u306E\u30BF\u30FC\u30F3\u306E\u5F8C\u306B\u9001\u4FE1","omph.input.queue.queued":"\u5F85\u6A5F\u4E2D \u2014 \u3053\u306E\u30BF\u30FC\u30F3\u306E\u5F8C\u306B\u81EA\u52D5\u9001\u4FE1","omph.input.queue.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB","omph.input.message":"\u30E1\u30C3\u30BB\u30FC\u30B8\u5165\u529B","omph.input.tools":"\u5165\u529B\u30C4\u30FC\u30EB","omph.model.fallback":"\u30E2\u30C7\u30EB\u3092\u9078\u629E","omph.model.aria":"\u30E2\u30C7\u30EB\u3092\u9078\u629E\u3001\u73FE\u5728 {model}","omph.model.ariaEffort":"\u30E2\u30C7\u30EB\u3092\u9078\u629E\u3001\u73FE\u5728 {model}\u3001\u601D\u8003\u306E\u5F37\u3055 {effort}","omph.model.menu":"\u30E2\u30C7\u30EB\u3068\u601D\u8003\u306E\u5F37\u3055","omph.model.model":"\u30E2\u30C7\u30EB","omph.model.effort":"\u601D\u8003\u306E\u5F37\u3055","omph.model.search":"\u30E2\u30C7\u30EB\u3092\u691C\u7D22\u2026","omph.model.searchClear":"\u691C\u7D22\u3092\u30AF\u30EA\u30A2","omph.model.searchEmpty":"\u4E00\u81F4\u3059\u308B\u30E2\u30C7\u30EB\u304C\u3042\u308A\u307E\u305B\u3093\u3002","omph.model.emptyModels":"\u5229\u7528\u3067\u304D\u308B\u30E2\u30C7\u30EB\u304C\u3042\u308A\u307E\u305B\u3093\u3002","omph.model.emptyEfforts":"\u3053\u306E\u30E2\u30C7\u30EB\u306B\u601D\u8003\u306E\u5F37\u3055\u306F\u3042\u308A\u307E\u305B\u3093\u3002","agentui.html.defaultTitle":"\u30A4\u30F3\u30BF\u30E9\u30AF\u30C6\u30A3\u30D6 HTML","agentui.html.open":"\u958B\u304F","agentui.html.preview":"\u30D7\u30EC\u30D3\u30E5\u30FC","agentui.html.code":"\u30B3\u30FC\u30C9","agentui.html.toggle":"\u30B3\u30FC\u30C9\u3068\u30D7\u30EC\u30D3\u30E5\u30FC\u3092\u5207\u308A\u66FF\u3048\u308B","agentui.html.copy":"\u30B3\u30FC\u30C9\u3092\u30B3\u30D4\u30FC","agentui.html.copied":"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F","agentui.html.download":"\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9","agentui.html.close":"\u9589\u3058\u308B"},yf={"common.cancel":"\uCDE8\uC18C","common.save":"\uC800\uC7A5","common.ok":"\uD655\uC778","common.done":"\uC644\uB8CC","common.search":"\uAC80\uC0C9","common.none":"\uC5C6\uC74C","common.all":"\uC804\uCCB4","common.noData":"\uB370\uC774\uD130 \uC5C6\uC74C","common.copy":"\uBCF5\uC0AC","common.delete":"\uC0AD\uC81C","common.loading":"\uB85C\uB529 \uC911...","header.searchPlaceholder":"\uBB34\uC5C7\uC774\uB4E0 \uBB3C\uC5B4\uBCF4\uC138\uC694...","header.searchAddFeature":"\uAE30\uB2A5 \uCD94\uAC00","header.searchStartVoice":"\uC74C\uC131 \uC785\uB825 \uC2DC\uC791","header.searchStopVoice":"\uC74C\uC131 \uC785\uB825 \uC911\uC9C0","header.searchOpenPanel":"\uB300\uD654 \uC5F4\uAE30","header.theme.system":"\uD14C\uB9C8: \uC2DC\uC2A4\uD15C","header.theme.dark":"\uD14C\uB9C8: \uB2E4\uD06C","header.theme.light":"\uD14C\uB9C8: \uB77C\uC774\uD2B8","header.menu.setting":"\uC124\uC815","header.menu.refresh":"\uC0C8\uB85C \uACE0\uCE68","header.menu.logout":"\uB85C\uADF8\uC544\uC6C3","navigation.expand":"\uD0D0\uC0C9 \uD3BC\uCE58\uAE30","navigation.collapse":"\uD0D0\uC0C9 \uC811\uAE30","navigation.searchPlaceholder":"\uBA54\uB274 \uAC80\uC0C9...","navigation.noMatch":"\uC77C\uCE58\uD558\uB294 \uBA54\uB274\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.noAccessibleApp":"\uC811\uADFC \uAC00\uB2A5\uD55C \uC571\uC774 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.noItems":"\uD45C\uC2DC\uD560 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.expandView":"{title} \uD3BC\uCE58\uAE30","navigation.mode.switchToFixed":"\uACE0\uC815 \uD0D0\uC0C9\uC73C\uB85C \uC804\uD658","navigation.mode.switchToFloating":"\uD50C\uB85C\uD305 \uD0D0\uC0C9\uC73C\uB85C \uC804\uD658","navigation.pinned":"\uACE0\uC815\uB428","navigation.pin.add":"\uC0C1\uB2E8\uC5D0 \uACE0\uC815","navigation.pin.remove":"\uACE0\uC815 \uD574\uC81C","table.toolbar.searchPlaceholder":"\uAC80\uC0C9...","table.title.default":"\uB370\uC774\uD130 \uD14C\uC774\uBE14","table.toolbar.groupBy":"\uADF8\uB8F9","table.toolbar.summary":"\uC694\uC57D","table.toolbar.columns":"\uC5F4","table.toolbar.export":"\uB0B4\uBCF4\uB0B4\uAE30","table.toolbar.itemsPerPage":"\uD398\uC774\uC9C0\uB2F9 \uD589 \uC218:","table.toolbar.pageOf":"{current} / {total} \uD398\uC774\uC9C0","table.toolbar.newItem":"\uC2E0\uADDC \uD56D\uBAA9","table.toolbar.editItem":"\uD56D\uBAA9 \uC218\uC815","table.toolbar.deleteItem":"\uD56D\uBAA9 \uC0AD\uC81C","table.toolbar.graphicReport":"\uADF8\uB798\uD504 \uB9AC\uD3EC\uD2B8","table.toolbar.saveLayout":"\uB808\uC774\uC544\uC6C3 \uC800\uC7A5","table.menu.groupBy":"\uADF8\uB8F9","table.menu.clearAll":"\uBAA8\uB450 \uC9C0\uC6B0\uAE30","table.menu.visibleColumns":"\uD45C\uC2DC \uC5F4","table.menu.showSummaryRow":"\uC694\uC57D \uD589 \uD45C\uC2DC","table.menu.noNumericColumns":"\uC22B\uC790 \uC5F4 \uC5C6\uC74C","table.group.expandAll":"\uBAA8\uB4E0 \uADF8\uB8F9 \uD3BC\uCE58\uAE30","table.group.collapseAll":"\uBAA8\uB4E0 \uADF8\uB8F9 \uC811\uAE30","table.mobile.notImplemented":"\uBAA8\uBC14\uC77C \uBDF0\uB294 \uC544\uC9C1 \uAD6C\uD604\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4","table.headerMenu.sortAsc":"\uC624\uB984\uCC28\uC21C \uC815\uB82C","table.headerMenu.sortDesc":"\uB0B4\uB9BC\uCC28\uC21C \uC815\uB82C","table.headerMenu.clearSort":"\uC815\uB82C \uD574\uC81C","table.headerMenu.configureSort":"\uC815\uB82C \uC124\uC815...","table.headerMenu.group":"\uC774 \uC5F4\uB85C \uADF8\uB8F9\uD654","table.headerMenu.ungroup":"\uADF8\uB8F9\uC5D0\uC11C \uC81C\uAC70","table.headerMenu.addSummary":"\uC694\uC57D\uC5D0 \uCD94\uAC00","table.headerMenu.removeSummary":"\uC694\uC57D\uC5D0\uC11C \uC81C\uAC70","table.headerMenu.hideColumn":"\uC5F4 \uC228\uAE30\uAE30","table.sortDialog.title":"\uC815\uB82C \uC124\uC815","table.sortDialog.empty":"\uC815\uB82C \uADDC\uCE59\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uCD94\uAC00\uD558\uC138\uC694.","table.sortDialog.addRule":"\uADDC\uCE59 \uCD94\uAC00","table.sortDialog.clearAll":"\uBAA8\uB450 \uC9C0\uC6B0\uAE30","table.sortDialog.asc":"\uC624\uB984\uCC28\uC21C","table.sortDialog.desc":"\uB0B4\uB9BC\uCC28\uC21C","pivot.title.default":"\uD53C\uBC97 \uD14C\uC774\uBE14","pivot.subtitle.default":"\uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uD53C\uBC97 \uD14C\uC774\uBE14\uC744 \uAD6C\uC131\uD558\uC138\uC694.","pivot.empty":"\uACB0\uACFC\uB97C \uBCF4\uB824\uBA74 \uAC12 \uC601\uC5ED\uC5D0 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.records":"\uB808\uCF54\uB4DC","pivot.afterFilter":"\uD544\uD130 \uD6C4","pivot.grandTotal":"\uCD1D\uD569","pivot.resultLabel":"\uACB0\uACFC","pivot.valueLabel":"\uAC12","pivot.table.dimensions":"\uCC28\uC6D0","pivot.config.title":"\uAD6C\uC131","pivot.fieldList":"\uD544\uB4DC \uBAA9\uB85D","pivot.availableDimensions":"\uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uCC28\uC6D0","pivot.allFieldsInUse":"\uBAA8\uB4E0 \uD544\uB4DC\uAC00 \uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC785\uB2C8\uB2E4.","pivot.zone.rows":"\uD589","pivot.zone.columns":"\uC5F4","pivot.zone.filters":"\uD544\uD130","pivot.zone.values":"\uAC12","pivot.hint.rows":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uD589 \uACC4\uCE35\uC744 \uAD6C\uC131","pivot.hint.columns":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uC5F4 \uACC4\uCE35\uC744 \uAD6C\uC131","pivot.hint.filters":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uBCF4\uACE0\uC11C \uD544\uD130\uB85C \uC0AC\uC6A9","pivot.hint.values":"\uC22B\uC790 \uD544\uB4DC\uB97C \uC5EC\uAE30\uC5D0 \uB4DC\uB798\uADF8\uD558\uC5EC \uC9D1\uACC4","pivot.clearArea":"\uC601\uC5ED \uBE44\uC6B0\uAE30","pivot.filter.na":"\uD574\uB2F9 \uC5C6\uC74C","pivot.filter.noValues":"\uAC12 \uC5C6\uC74C","pivot.filter.noneSelected":"\uC120\uD0DD \uC5C6\uC74C","pivot.filter.allValues":"\uBAA8\uB4E0 \uAC12","pivot.filter.selectedCount":"{selected} / {total} \uC120\uD0DD\uB428","pivot.filter.selectAll":"\uC804\uCCB4 \uC120\uD0DD","pivot.filter.deselectAll":"\uC804\uCCB4 \uD574\uC81C","pivot.filter.noResults":"\uAC80\uC0C9 \uACB0\uACFC \uC5C6\uC74C","pivot.collapse.ariaExpand":"\uAD6C\uC131 \uC601\uC5ED \uD3BC\uCE58\uAE30","pivot.collapse.ariaCollapse":"\uAD6C\uC131 \uC601\uC5ED \uC811\uAE30","pivot.agg.sum":"\uD569\uACC4","pivot.agg.count":"\uAC1C\uC218","pivot.agg.avg":"\uD3C9\uADE0","pivot.agg.min":"\uCD5C\uC18C","pivot.agg.max":"\uCD5C\uB300","pivot.preset.selectPlaceholder":"\uD504\uB9AC\uC14B \uC120\uD0DD","pivot.preset.save":"\uD504\uB9AC\uC14B \uC800\uC7A5","pivot.preset.delete":"\uD504\uB9AC\uC14B \uC0AD\uC81C","pivot.preset.saveDialogTitle":"\uD604\uC7AC \uD504\uB9AC\uC14B \uC800\uC7A5","pivot.preset.nameLabel":"\uD504\uB9AC\uC14B \uC774\uB984","pivot.preset.defaultName":"\uD504\uB9AC\uC14B {index}","pivot.table.sectionTitle":"\uD53C\uBC97 \uACB0\uACFC","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"\uD53C\uBC97 \uACB0\uACFC \uD3BC\uCE58\uAE30","pivot.table.collapse.ariaCollapse":"\uD53C\uBC97 \uACB0\uACFC \uC811\uAE30","pivot.chart.title":"\uD53C\uBC97 \uCC28\uD2B8","pivot.chart.subtitle":"\uD558\uB098\uC758 \uCC28\uC6D0\uACFC \uCD5C\uB300 \uB450 \uAC1C\uC758 \uCE21\uC815\uAC12\uC744 \uAC04\uACB0\uD55C \uCC28\uD2B8\uB85C \uD45C\uC2DC\uD569\uB2C8\uB2E4.","pivot.chart.subtitleReady":"{dimension}\uBCC4 {measure}","pivot.chart.emptyNoDimension":"\uCC28\uD2B8\uB97C \uBCF4\uB824\uBA74 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uD589 \uB610\uB294 \uC5F4 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.chart.emptyNoValue":"\uCC28\uD2B8\uB97C \uBCF4\uB824\uBA74 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uAC12 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.chart.emptyNoData":"\uD604\uC7AC \uCC28\uD2B8 \uC120\uD0DD\uC5D0 \uD45C\uC2DC\uD560 \uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.","pivot.chart.dimension":"\uCC28\uD2B8 \uCC28\uC6D0","pivot.chart.primaryMeasure":"\uC8FC \uCE21\uC815\uAC12","pivot.chart.secondaryMeasure":"\uBE44\uAD50 \uCE21\uC815\uAC12","pivot.chart.chartType":"\uCC28\uD2B8 \uC720\uD615","pivot.chart.style.barVertical":"\uC138\uB85C \uB9C9\uB300","pivot.chart.style.barHorizontal":"\uAC00\uB85C \uB9C9\uB300","pivot.chart.style.line":"\uC120\uD615 \uCC28\uD2B8","pivot.chart.style.scatter":"\uC0B0\uC810\uB3C4","pivot.chart.collapse.ariaExpand":"\uCC28\uD2B8 \uC601\uC5ED \uD3BC\uCE58\uAE30","pivot.chart.collapse.ariaCollapse":"\uCC28\uD2B8 \uC601\uC5ED \uC811\uAE30","smartFilter.adaptFilters":"\uD544\uD130 \uC870\uC815","smartFilter.addFilters":"\uD544\uD130 \uCD94\uAC00","smartFilter.go":"\uC2E4\uD589","smartFilter.visibleFilters":"\uD45C\uC2DC \uD544\uD130","smartFilter.searchPlaceholder":"\uAC80\uC0C9...","smartFilter.noOptionsFound":"\uC635\uC158\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","smartFilter.min":"\uCD5C\uC18C","smartFilter.max":"\uCD5C\uB300","smartFilter.minMaxPlaceholder":"\uCD5C\uC18C - \uCD5C\uB300","smartFilter.operator.equals":"\uAC19\uC74C","smartFilter.operator.contains":"\uD3EC\uD568","smartFilter.operator.notContains":"\uBBF8\uD3EC\uD568","smartFilter.operator.wildcard":"\uC640\uC77C\uB4DC\uCE74\uB4DC \uAC80\uC0C9","smartFilter.operator.notEquals":"\uAC19\uC9C0 \uC54A\uC74C","smartFilter.operator.greaterThan":"\uBCF4\uB2E4 \uD07C","smartFilter.operator.lessThan":"\uBCF4\uB2E4 \uC791\uC74C","smartFilter.operator.greaterOrEqual":"\uC774\uC0C1","smartFilter.operator.lessOrEqual":"\uC774\uD558","smartFilter.operator.between":"\uBC94\uC704","variant.noOptions":"\uC635\uC158 \uC5C6\uC74C","variant.defaultSuffix":"\uAE30\uBCF8","variant.selectVariant":"\uBDF0 \uC120\uD0DD","variant.saveView":"\uBDF0 \uC800\uC7A5","variant.newVariant":"\uC0C8 \uBDF0","variant.viewName":"\uBDF0 \uC774\uB984","variant.setDefault":"\uAE30\uBCF8\uC73C\uB85C \uC124\uC815","variant.publicAllUsers":"\uACF5\uAC1C(\uC804\uCCB4 \uC0AC\uC6A9\uC790)","variant.toast.fetchFailed":"\uBDF0\uB97C \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.saveFailed":"\uBDF0\uB97C \uC800\uC7A5\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.saveSuccess":"\uBDF0\uAC00 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","variant.toast.deleteFailed":"\uBDF0\uB97C \uC0AD\uC81C\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.deleteSuccess":"\uBDF0\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","variant.toast.defaultFailed":"\uAE30\uBCF8 \uBDF0\uB97C \uC5C5\uB370\uC774\uD2B8\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.defaultSuccess":"\uAE30\uBCF8 \uBDF0\uAC00 \uC5C5\uB370\uC774\uD2B8\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.saveLayout":"\uB808\uC774\uC544\uC6C3 \uC800\uC7A5","layout.layoutOptions":"\uB808\uC774\uC544\uC6C3 \uC635\uC158","layout.selectLayout":"\uB808\uC774\uC544\uC6C3 \uC120\uD0DD","layout.saveCurrentLayout":"\uD604\uC7AC \uB808\uC774\uC544\uC6C3 \uC800\uC7A5...","layout.noSavedLayouts":"\uC800\uC7A5\uB41C \uB808\uC774\uC544\uC6C3 \uC5C6\uC74C","layout.removeDefault":"\uAE30\uBCF8 \uD574\uC81C","layout.setAsDefault":"\uAE30\uBCF8\uC73C\uB85C \uC124\uC815","layout.layoutName":"\uB808\uC774\uC544\uC6C3 \uC774\uB984","layout.layoutDescription":"\uC124\uBA85","layout.layoutNameHelper":"\uC608: \uCEF4\uD329\uD2B8 \uBDF0","layout.warningOverwrite":"\uACBD\uACE0: \uAE30\uC874 \uB808\uC774\uC544\uC6C3\uC774 \uB36E\uC5B4\uC4F0\uAE30 \uB429\uB2C8\uB2E4","layout.useAsDefault":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC73C\uB85C \uC0AC\uC6A9","layout.publicAllUsers":"\uACF5\uAC1C(\uBAA8\uB4E0 \uC0AC\uC6A9\uC790\uC5D0\uAC8C \uD45C\uC2DC)","layout.toast.loadFallback":"\uBC31\uC5D4\uB4DC\uC5D0\uC11C \uB808\uC774\uC544\uC6C3\uC744 \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD574 \uB85C\uCEEC \uC800\uC7A5\uC18C\uB85C \uC804\uD658\uD588\uC2B5\uB2C8\uB2E4","layout.toast.saveSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.saveLocalSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC \uC800\uC7A5\uC18C\uC5D0 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableSavedLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uB85C\uCEEC\uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4","layout.toast.deleteSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.deleteLocalSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC \uC800\uC7A5\uC18C\uC5D0\uC11C \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableDeletedLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uB85C\uCEEC\uC5D0\uC11C \uC0AD\uC81C\uD588\uC2B5\uB2C8\uB2E4","layout.toast.defaultSuccess":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC774 \uC124\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.defaultLocalSuccess":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC\uC5D0 \uC124\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableDefaultLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uAE30\uBCF8\uAC12\uC744 \uB85C\uCEEC\uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4","dateRange.label":"\uB0A0\uC9DC \uBC94\uC704","dateRange.startDate":"\uC2DC\uC791\uC77C","dateRange.endDate":"\uC885\uB8CC\uC77C","dateRange.select":"\uC120\uD0DD...","dateRange.today":"\uC624\uB298","dateRange.thisWeek":"\uC774\uBC88 \uC8FC","dateRange.thisMonth":"\uC774\uBC88 \uB2EC","graph.records":"{count}\uAC74","graph.kpi.totalRecords":"\uCD1D \uB808\uCF54\uB4DC","graph.kpi.totalReport":"\uCD1D \uBCF4\uACE0 \uC2DC\uAC04","graph.kpi.totalBillable":"\uCD1D \uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","graph.kpi.efficiency":"\uD6A8\uC728","graph.kpi.amount":"\uAE08\uC561","graph.kpi.flagged":"\uD50C\uB798\uADF8","graph.chart.billable.title":"\uCC28\uC6D0\uBCC4 \uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","graph.chart.billable.subtitle":"\uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04 \uC0C1\uC704 \uAC12","graph.chart.efficiency.title":"\uB2F4\uB2F9\uC790\uBCC4 \uD6A8\uC728","graph.chart.efficiency.subtitle":"\uB0AE\uC740 \uD6A8\uC728 \uC6B0\uC120","graph.chart.status.title":"\uC0C1\uD0DC \uBD84\uD3EC","graph.chart.status.subtitle":"\uC0C1\uD0DC\uBCC4 \uBE44\uC728","graph.dataBody":"\uB370\uC774\uD130 \uBCF8\uBB38","graph.reportTitle":"\uADF8\uB798\uD504 \uB9AC\uD3EC\uD2B8","graph.unassigned":"\uBBF8\uC9C0\uC815","graph.column.reportHours":"\uBCF4\uACE0 \uC2DC\uAC04","graph.column.billableHours":"\uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","detail.searchAi.placeholder":"\uD544\uB4DC\uB97C \uAC80\uC0C9\uD558\uACE0, \uACB0\uACFC\uAC00 \uC5C6\uC73C\uBA74 AI\uC5D0 \uC9C8\uBB38\uD558\uC138\uC694...","detail.searchAi.matches":"{count}\uAC1C \uC77C\uCE58 \uD56D\uBAA9","detail.searchAi.noMatch":"\uC77C\uCE58\uD558\uB294 \uD544\uB4DC\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.","detail.searchAi.autoAiFallback":"\uC77C\uCE58 \uD56D\uBAA9\uC774 \uC5C6\uC5B4 AI \uBD84\uC11D\uC744 \uC2E4\uD589\uD569\uB2C8\uB2E4...","detail.searchAi.aiResultTitle":"AI \uBD84\uC11D \uACB0\uACFC","detail.table.title":"\uAD00\uB828 \uB808\uCF54\uB4DC","kanban.empty":"\uC5EC\uAE30\uC5D0 \uCE74\uB4DC\uB97C \uB193\uC73C\uC138\uC694","kanban.bucket.limit":"\uD55C\uB3C4","kanban.bucket.dropHere":"\uB193\uC73C\uBA74 \uC774 \uBC84\uD0B7\uC73C\uB85C \uC774\uB3D9\uD569\uB2C8\uB2E4","kanban.bucket.add":"\uBC84\uD0B7 \uCD94\uAC00","kanban.bucket.rename":"\uBC84\uD0B7 \uC774\uB984 \uBCC0\uACBD","kanban.bucket.saveRename":"\uBC84\uD0B7 \uC774\uB984 \uC800\uC7A5","kanban.bucket.cancelRename":"\uC774\uB984 \uBCC0\uACBD \uCDE8\uC18C","kanban.search.placeholder":"\uCE74\uB4DC \uBC0F \uBC84\uD0B7 \uAC80\uC0C9","kanban.search.clear":"\uAC80\uC0C9 \uC9C0\uC6B0\uAE30","kanban.search.results":"\uC77C\uCE58\uD558\uB294 \uCE74\uB4DC {count}\uAC1C","kanban.search.noMatch":"\uC77C\uCE58\uD558\uB294 \uCE74\uB4DC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4","kanban.card.progress":"\uC9C4\uD589\uB960","kanban.card.openDetail":"\uC0C1\uC138 \uC5F4\uAE30","kanban.priority.critical":"\uAE34\uAE09","kanban.priority.high":"\uB192\uC74C","kanban.priority.medium":"\uBCF4\uD1B5","kanban.priority.low":"\uB0AE\uC74C","quickCreate.newItem":"\uC2E0\uADDC \uD56D\uBAA9","quickCreate.createWithTitle":"{title} \uC0DD\uC131","quickEdit.editWithTitle":"{title} \uC218\uC815","quickDelete.confirmTitle":"\uC0AD\uC81C \uD655\uC778","quickDelete.confirmMessageSingle":"\uC120\uD0DD\uD55C \uD56D\uBAA9\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","quickDelete.confirmMessageMultiple":"\uC120\uD0DD\uD55C {count}\uAC1C \uD56D\uBAA9\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","cardPage.viewDetails":"\uC0C1\uC138 \uBCF4\uAE30","cardPage.download":"\uB2E4\uC6B4\uB85C\uB4DC","cardPage.close":"\uB2EB\uAE30","cardPage.empty":"\uD56D\uBAA9\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","messageBox.confirm":"\uD655\uC778","messageBox.cancel":"\uCDE8\uC18C","omph.status.idle":"\uB300\uAE30","omph.status.pending":"\uB300\uAE30 \uC911","omph.status.running":"\uCC98\uB9AC \uC911","omph.status.success":"\uC644\uB8CC","omph.status.error":"\uC624\uB958","omph.working":"\uCC98\uB9AC \uC911","omph.workingFor":"\uCC98\uB9AC \uC911 {duration} \uACBD\uACFC","omph.loadOlder":"\uC774\uC804 \uBA54\uC2DC\uC9C0 \uBD88\uB7EC\uC624\uAE30","omph.loadingOlder":"\uBD88\uB7EC\uC624\uB294 \uC911\u2026","omph.toBottom":"\uB9E8 \uC544\uB798\uB85C","omph.copy":"\uBCF5\uC0AC","omph.copied":"\uBCF5\uC0AC\uB428","omph.turnActions":"\uC751\uB2F5 \uC791\uC5C5","omph.usage":"\uC0AC\uC6A9\uB7C9","omph.inputTokens":"\uC785\uB825","omph.outputTokens":"\uCD9C\uB825","omph.duration":"\uC18C\uC694 \uC2DC\uAC04","omph.send":"\uBCF4\uB0B4\uAE30","omph.stop":"\uC911\uC9C0","omph.supplement.queued":"\uC2E4\uD589 \uC911\uC778 \uC791\uC5C5\uC5D0 \uCD94\uAC00\uB428","omph.turnRail":"\uD134","omph.secondUnit":"\uCD08","omph.minuteUnit":"\uBD84","omph.preview.title":"\uD30C\uC77C \uBBF8\uB9AC\uBCF4\uAE30","omph.preview.close":"\uBBF8\uB9AC\uBCF4\uAE30 \uB2EB\uAE30","omph.preview.back":"\uB300\uD654\uB85C \uB3CC\uC544\uAC00\uAE30","omph.preview.expand":"\uBBF8\uB9AC\uBCF4\uAE30 \uD655\uB300","omph.preview.collapse":"\uBBF8\uB9AC\uBCF4\uAE30 \uD06C\uAE30 \uBCF5\uC6D0","omph.preview.copyContent":"\uB0B4\uC6A9 \uBCF5\uC0AC","omph.preview.copyPath":"\uACBD\uB85C \uBCF5\uC0AC","omph.preview.download":"\uB2E4\uC6B4\uB85C\uB4DC","omph.preview.openExternal":"\uC678\uBD80\uC5D0\uC11C \uC5F4\uAE30","omph.preview.wrap":"\uC904 \uBC14\uAFC8","omph.preview.loading":"\uD30C\uC77C \uB85C\uB4DC \uC911","omph.preview.missing":"\uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC74C","omph.preview.failed":"\uC774 \uD30C\uC77C\uC744 \uB85C\uB4DC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","omph.preview.unsupported":"\uC774 \uD30C\uC77C \uD615\uC2DD\uC740 \uBBF8\uB9AC\uBCFC \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","omph.preview.retry":"\uB2E4\uC2DC \uC2DC\uB3C4","omph.preview.resize":"\uBBF8\uB9AC\uBCF4\uAE30 \uD06C\uAE30 \uC870\uC815","omph.preview.line":"{start}\uC904","omph.preview.lines":"{start}\u2013{end}\uC904","omph.preview.truncated":"\uC804\uCCB4 {total}\uC904 \uC911 \uCC98\uC74C {shown}\uC904 \uD45C\uC2DC","omph.preview.sheetTruncated":"\uC804\uCCB4 {total}\uD589 \uC911 \uCC98\uC74C {shown}\uD589 \uD45C\uC2DC","omph.preview.imageFailed":"\uC774\uBBF8\uC9C0\uB97C \uD45C\uC2DC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","omph.preview.zoomIn":"\uD655\uB300","omph.preview.zoomOut":"\uCD95\uC18C","omph.preview.zoomFit":"\uB108\uBE44\uC5D0 \uB9DE\uCD94\uAE30","omph.newConversation":"\uC0C8 \uB300\uD654","omph.conversationList":"\uB300\uD654 \uBAA9\uB85D","omph.conversations":"\uB300\uD654","omph.noConversations":"\uC544\uC9C1 \uB300\uD654\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4","omph.initial.suggestions":"\uCD94\uCC9C \uC9C8\uBB38","omph.approval.waiting":"\uC2B9\uC778 \uB300\uAE30 \uC911","omph.approval.choose":"\uC791\uC5C5\uC744 \uC120\uD0DD\uD558\uC138\uC694","omph.approval.details":"\uC2B9\uC778 \uC138\uBD80 \uC815\uBCF4","omph.approval.choices":"\uC791\uC5C5","omph.approval.reject":"\uAC70\uBD80","omph.approval.allowOnce":"\uD55C \uBC88\uB9CC \uD5C8\uC6A9","omph.approval.confirm":"\uACC4\uC18D","omph.approval.other":"\uAE30\uD0C0","omph.approval.otherPlaceholder":"\uC218\uD589\uD560 \uC791\uC5C5\uC744 \uC124\uBA85\uD558\uC138\uC694","omph.approval.escalation":"\uB3C4\uAD6C {toolName}\uC774(\uAC00) \uAD8C\uD55C \uC788\uB294 \uC2E4\uD589\uC744 \uC694\uCCAD\uD569\uB2C8\uB2E4","omph.approval.recommended":"(\uAD8C\uC7A5)","omph.approval.allowOnceException":"\uC774\uBC88\uB9CC \uC608\uC678 \uD5C8\uC6A9","omph.approval.allowSession":"\uC774 \uC138\uC158\uC5D0\uC11C \uAC19\uC740 \uC885\uB958 \uD5C8\uC6A9","omph.approval.abandon":"\uD3EC\uAE30","omph.input.placeholder":"\uBA54\uC2DC\uC9C0 \uC785\uB825\u2026","omph.input.upload":"\uD30C\uC77C \uC5C5\uB85C\uB4DC","omph.input.send":"\uBA54\uC2DC\uC9C0 \uBCF4\uB0B4\uAE30","omph.input.stop":"\uC0DD\uC131 \uC911\uC9C0","omph.input.queue.ask":"\uC5D0\uC774\uC804\uD2B8\uAC00 \uC2E4\uD589 \uC911\uC785\uB2C8\uB2E4. \uC9C0\uAE08 \uBCF4\uB0BC\uAE4C\uC694, \uC774\uBC88 \uD134\uC774 \uB05D\uB09C \uD6C4\uC5D0 \uBCF4\uB0BC\uAE4C\uC694?","omph.input.queue.sendNow":"\uC9C0\uAE08 \uBCF4\uB0B4\uAE30","omph.input.queue.afterTurn":"\uC774\uBC88 \uD134 \uD6C4\uC5D0 \uBCF4\uB0B4\uAE30","omph.input.queue.queued":"\uB300\uAE30 \uC911 \u2014 \uC774\uBC88 \uD134 \uD6C4 \uC790\uB3D9 \uC804\uC1A1","omph.input.queue.cancel":"\uCDE8\uC18C","omph.input.message":"\uBA54\uC2DC\uC9C0 \uC785\uB825","omph.input.tools":"\uC785\uB825 \uB3C4\uAD6C","omph.model.fallback":"\uBAA8\uB378 \uC120\uD0DD","omph.model.aria":"\uBAA8\uB378 \uC120\uD0DD, \uD604\uC7AC {model}","omph.model.ariaEffort":"\uBAA8\uB378 \uC120\uD0DD, \uD604\uC7AC {model}, \uC0AC\uACE0 \uAC15\uB3C4 {effort}","omph.model.menu":"\uBAA8\uB378\uACFC \uC0AC\uACE0 \uAC15\uB3C4","omph.model.model":"\uBAA8\uB378","omph.model.effort":"\uC0AC\uACE0 \uAC15\uB3C4","omph.model.search":"\uBAA8\uB378 \uAC80\uC0C9\u2026","omph.model.searchClear":"\uAC80\uC0C9 \uC9C0\uC6B0\uAE30","omph.model.searchEmpty":"\uC77C\uCE58\uD558\uB294 \uBAA8\uB378\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.","omph.model.emptyModels":"\uC0AC\uC6A9\uD560 \uC218 \uC788\uB294 \uBAA8\uB378\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.","omph.model.emptyEfforts":"\uC774 \uBAA8\uB378\uC5D0\uB294 \uC0AC\uACE0 \uAC15\uB3C4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.","agentui.html.defaultTitle":"\uC778\uD130\uB799\uD2F0\uBE0C HTML","agentui.html.open":"\uC5F4\uAE30","agentui.html.preview":"\uBBF8\uB9AC \uBCF4\uAE30","agentui.html.code":"\uCF54\uB4DC","agentui.html.toggle":"\uCF54\uB4DC\uC640 \uBBF8\uB9AC \uBCF4\uAE30 \uC804\uD658","agentui.html.copy":"\uCF54\uB4DC \uBCF5\uC0AC","agentui.html.copied":"\uBCF5\uC0AC\uB428","agentui.html.download":"\uB2E4\uC6B4\uB85C\uB4DC","agentui.html.close":"\uB2EB\uAE30"},Xn={en:gf,zh:hf,fr:ff,de:bf,ja:vf,ko:yf};var ud=(t,o)=>o?t.replace(/\{(\w+)\}/g,(r,n)=>{let a=o[n];return a==null?"":String(a)}):t,Sf={locale:"en",t:(t,o)=>ud(Xn.en[t]||t,o)},md=createContext(Sf),Ya=({locale:t="en",messages:o,children:r})=>{let n=useMemo(()=>{let a=Xn[t]||Xn.en,i=o?.[t]||{},s={...Xn.en,...a,...i};return {locale:t,t:(c,u)=>ud(s[c]||c,u)}},[t,o]);return f(md.Provider,{value:n,children:r})},de=()=>useContext(md);function Zn({items:t,onItemClick:o,className:r="",level:n=0,expandedIds:a,onToggleExpand:i,colorMode:s="light",enablePinning:c=false,pinnedIds:u,onTogglePin:d}){let{t:m}=de(),h=s==="dark",f$1=usePathname(),[p,v]=useState(false),[C,g$1]=useState(new Set),x=a!==void 0&&i!==void 0,y=x?a:C;useEffect(()=>{v(true);},[]);let b=w=>{if(x)i(w);else {let T=new Set(C);T.has(w)?T.delete(w):T.add(w),g$1(T);}},k=w=>{w.children&&w.children.length>0&&b(w.id),o&&o(w);};return !t||!Array.isArray(t)?f("div",{className:yo("tree-menu",r),children:f("div",{className:"text-sm text-[var(--orb-muted)] p-2",children:m("navigation.noItems")})}):f("div",{className:yo("tree-menu",r),children:t.map(w=>{let T=y.has(w.id)||w.isExpanded,I=w.children&&w.children.length>0,D=56+Math.max(0,n-1)*8,R=n===0?12:I?D-24:D,M=w.appurl||w.href,P=p&&M?f$1===M:false,A=u?.has(w.id)??false,L=c&&w.pinnable!==false&&!!M&&!I;return g("div",{className:"tree-menu-item relative",children:[P&&f("div",{className:yo("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10","bg-[var(--orb-nav-active-fg)]")}),g(ol,{variant:"ghost",className:yo("w-full justify-start h-auto py-2 relative overflow-hidden group",n>0?"gap-1":"gap-2",I&&T&&!P?h?"bg-[color-mix(in_oklch,var(--orb-inverse-fg)_5%,transparent)] text-[var(--orb-fg)] hover:bg-[color-mix(in_oklch,var(--orb-inverse-fg)_8%,transparent)]":"bg-[color-mix(in_oklch,var(--orb-surface)_70%,transparent)] text-[var(--orb-fg)] hover:bg-[var(--orb-surface)]":"",n>=2?"min-h-9 py-1.5 rounded-md":n>0?"min-h-10 rounded-lg":"rounded-lg",P?h?"bg-transparent text-[var(--orb-nav-active-fg)] hover:bg-[color-mix(in_oklch,var(--orb-surface-2)_35%,transparent)]":"bg-transparent text-[var(--orb-nav-active-fg)] hover:bg-[color-mix(in_oklch,var(--orb-surface)_60%,transparent)]":h?"hover:bg-[color-mix(in_oklch,var(--orb-surface-2)_50%,transparent)] text-[var(--orb-fg)]":"hover:bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)] text-[var(--orb-fg)]"),style:{paddingLeft:`${R}px`,paddingRight:L?"34px":"10px"},onClick:()=>k(w),children:[I&&f("div",{className:yo("flex-shrink-0 transition-transform duration-200",T&&"rotate-90",P?"text-[var(--orb-nav-active-fg)]":h?"text-[var(--orb-muted)] group-hover:text-[var(--orb-fg)]":"text-[var(--orb-muted)] group-hover:text-[var(--orb-muted)]"),children:f(So,{className:"h-4 w-4"})}),w.icon&&f("div",{className:yo("flex h-4 w-4 flex-shrink-0 items-center justify-center transition-colors duration-200",P?"text-[var(--orb-nav-active-fg)]":h?"text-[var(--orb-muted)] group-hover:text-[var(--orb-fg)]":"text-[var(--orb-muted)] group-hover:text-[var(--orb-muted)]"),children:w.icon}),g("div",{className:"flex-1 text-left overflow-hidden z-10",children:[f("div",{className:yo("text-sm truncate transition-colors duration-200",P?"font-semibold":"font-medium"),children:w.title||w.label}),w.description&&f("div",{className:yo("text-xs truncate transition-colors duration-200",P?h?"text-[color-mix(in_oklch,var(--orb-nav-active-fg)_70%,transparent)]":"text-[color-mix(in_oklch,var(--orb-nav-active-fg)_75%,transparent)]":"text-[var(--orb-muted)]"),title:w.description,children:w.description})]})]}),L&&d&&f("button",{type:"button","aria-label":m(A?"navigation.pin.remove":"navigation.pin.add"),"aria-pressed":A,title:m(A?"navigation.pin.remove":"navigation.pin.add"),onClick:W=>{W.preventDefault(),W.stopPropagation(),d(w);},className:yo("orb-navigation-pin-button absolute right-1 top-1/2 z-20 flex h-7 w-7 -translate-y-1/2 items-center justify-center rounded-md transition-colors duration-150",A&&"orb-is-pinned"),children:f(jr,{className:yo("h-3.5 w-3.5",A&&"fill-current")})}),I&&f("div",{className:yo("grid transition-[grid-template-rows] duration-300 ease-in-out",T?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:f("div",{className:yo("overflow-hidden",T&&"pt-1"),children:f(Zn,{items:w.children,onItemClick:o,level:n+1,expandedIds:a,onToggleExpand:i,colorMode:s,enablePinning:c,pinnedIds:u,onTogglePin:d})})})]},w.id)})})}var Mf="orbcafe:navigation-island:pinned-items",rl="orbcafe-navigation-pinned",If=t=>t.appurl||t.href,hd=t=>{let o=[];return t.forEach(r=>{let n=!!r.children?.length;r.pinnable!==false&&If(r)&&!n&&o.push({...r,children:void 0}),r.children?.length&&o.push(...hd(r.children));}),o},fd=({collapsed:t,onToggle:o,className:r="",maxHeight:n,menuData:a=[],colorMode:i="light",displayMode:s="fixed",onDisplayModeChange:c,showDisplayModeToggle:u=true,enablePinning:d=true,pinStorageKey:m=Mf,pinnedItemIds:h,defaultPinnedItemIds:f$1=[],onPinnedItemIdsChange:p,pinnedSectionTitle:v})=>{let{t:C}=de(),g$1=i==="dark",x=s==="floating",y=useRouter(),[b,k]=useState(""),[w,T]=useState(new Set),[I,S]=useState(f$1),[D,R]=useState(false),M=h!==void 0,P=useMemo(()=>h??I,[h,I]),A=useMemo(()=>new Set(P),[P]);useEffect(()=>{t&&T(new Set);},[t]),useEffect(()=>{if(!d||M){R(true);return}try{let B=window.localStorage.getItem(m);if(B){let q=JSON.parse(B);Array.isArray(q)&&S(q.filter(Z=>typeof Z=="string"));}}catch{}finally{R(true);}},[d,M,m]),useEffect(()=>{if(!(!d||M||!D))try{window.localStorage.setItem(m,JSON.stringify(P));}catch{}},[P,d,M,m,D]),useEffect(()=>{!d||t||P.length===0||T(B=>{if(B.has(rl))return B;let q=new Set(B);return q.add(rl),q});},[t,P.length,d]);let L=useCallback(B=>{let q=Array.from(new Set(B));M||S(q),p?.(q);},[M,p]),W=useCallback(B=>{let q=B.id,Z=A.has(q)?P.filter(ue=>ue!==q):[...P,q];L(Z);},[P,A,L]),j=useMemo(()=>{if(!d||P.length===0)return a;let B=new Map(hd(a).map(Z=>[Z.id,Z])),q=P.map(Z=>B.get(Z)).filter(Z=>!!Z);return q.length===0?a:[{id:rl,title:v||C("navigation.pinned"),icon:f(jr,{className:"w-4 h-4"}),children:q,pinnable:false},...a]},[P,d,a,v,C]),O=useCallback(B=>{let q=[],Z=ue=>{ue.forEach(ne=>{q.push(ne.id),ne.children&&Z(ne.children);});};return Z(B),q},[]),_=useMemo(()=>{if(!b.trim())return j;let B=q=>q.reduce((Z,ue)=>{let ne=ue.title?.toLowerCase().includes(b.toLowerCase())||ue.description?.toLowerCase().includes(b.toLowerCase()),fe=ue.children?B(ue.children):[];return (ne||fe.length>0)&&Z.push({...ue,children:fe.length>0?fe:ue.children}),Z},[]);return B(j)},[b,j]),z=useMemo(()=>b.trim()?new Set(O(j)):w,[b,j,w,O]),Y=useCallback(async B=>{if(console.log("\u{1F5B1}\uFE0F \u5BFC\u822A\u83DC\u5355\u9879\u70B9\u51FB:",B),B.id==="chat"||B.appurl==="/chat"){console.log("\u{1F4AC} \u68C0\u6D4B\u5230chat\u83DC\u5355\u70B9\u51FB\uFF0C\u8DF3\u8F6C\u5230\u65B0\u7684\u804A\u5929\u89C6\u56FE");try{y.push("/chat?new=true");}catch(Z){console.error("\u274C \u65E0\u6CD5\u8DF3\u8F6C\u5230\u65B0\u804A\u5929\u89C6\u56FE:",Z),y.push("/chat");}return}let q=B.appurl||B.href;q&&(q.startsWith("http://")||q.startsWith("https://")?window.open(q,"_blank"):y.push(q));},[y]),H=useCallback(()=>{c?.(s==="fixed"?"floating":"fixed");},[s,c]);return g("div",{className:`flex flex-col backdrop-blur-xl border ${x?"shadow-[0_28px_80px_rgba(15,23,42,0.34)]":"shadow-[0_4px_8px_0_rgba(31,38,135,0.1)]"} ${t?"w-14 rounded-full":"w-[234px] rounded-2xl"} relative ${r} ${g$1?x?"border-white/25":"bg-[var(--orb-nav-bg)] border-white/10":x?"border-white/70":"bg-[color-mix(in_oklch,var(--orb-canvas)_70%,transparent)] border-white/30"}`,style:{backdropFilter:x?"blur(34px) saturate(230%) contrast(1.12)":"blur(16px) saturate(180%)",WebkitBackdropFilter:x?"blur(34px) saturate(230%) contrast(1.12)":"blur(16px) saturate(180%)",backgroundColor:x?g$1?"rgba(8, 12, 18, 0.34)":"rgba(255, 255, 255, 0.24)":void 0,backgroundImage:x?g$1?"radial-gradient(circle at 28% 8%, rgba(255,255,255,0.14), rgba(255,255,255,0) 44%), linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.015) 50%, color-mix(in oklch, var(--orb-ai-accent) 5%, transparent))":"radial-gradient(circle at 28% 8%, rgba(255,255,255,0.42), rgba(255,255,255,0) 46%), linear-gradient(145deg, rgba(255,255,255,0.22), rgba(255,255,255,0.07) 50%, color-mix(in oklch, var(--orb-ai-accent) 8%, transparent))":void 0,boxShadow:x?g$1?"inset 0 1px 0 rgba(255,255,255,0.20), inset 0 -1px 0 rgba(255,255,255,0.08), 0 26px 90px rgba(0,0,0,0.52), 0 0 0 1px rgba(255,255,255,0.06)":"inset 0 1px 0 rgba(255,255,255,0.88), inset 0 -1px 0 rgba(255,255,255,0.34), 0 26px 90px rgba(15,23,42,0.24), 0 0 0 1px rgba(255,255,255,0.35)":void 0,transition:"width 400ms cubic-bezier(0.4, 0.0, 0.2, 1), border-radius 0ms cubic-bezier(0.4, 0.0, 0.2, 1), box-shadow 400ms ease-out, background-color 220ms ease-out, backdrop-filter 220ms ease-out",maxHeight:n?`${n}px`:void 0},children:[f("div",{className:`pt-4 pb-2 transition-all duration-500 ease-in-out ${t?"px-1":"px-2"}`,children:t?f("div",{className:"flex justify-center",children:f("button",{onClick:o,className:`w-10 h-10 flex items-center justify-center rounded-lg transition-colors duration-200 ${g$1?"text-[var(--orb-fg)] hover:bg-[var(--orb-surface-2)]":"text-[var(--orb-muted)] hover:bg-[var(--orb-surface)]"}`,title:C("navigation.expand"),children:f(Vo,{className:"h-5 w-5"})})}):g("div",{className:`relative transition-opacity duration-300 ${t?"opacity-0":"opacity-100 delay-200"}`,children:[f("input",{type:"text",placeholder:C("navigation.searchPlaceholder"),value:b,onChange:B=>k(B.target.value),className:`w-full pl-10 pr-4 py-2 text-sm border rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--orb-primary)] focus:border-transparent ${g$1?"border-[var(--orb-border)] bg-[var(--orb-surface-2)] text-[var(--orb-fg)] placeholder-[var(--orb-muted)]":"border-[var(--orb-border)] bg-[var(--orb-canvas)] text-[var(--orb-fg)] placeholder-[var(--orb-muted)]"}`}),f("div",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 pointer-events-none",children:f(Vo,{className:"h-4 w-4 text-[var(--orb-muted)]"})})]})}),f("nav",{className:`flex-1 pb-4 transition-all duration-500 ease-in-out overflow-y-auto min-h-0 ${t?"px-1":"px-2"}`,children:_.length===0?f("div",{className:"flex items-center justify-center py-8 text-[var(--orb-muted)] text-sm",children:t?f(zn,{className:"h-5 w-5"}):C(b?"navigation.noMatch":"navigation.noAccessibleApp")}):g(e,{children:[!t&&f("div",{className:`transition-opacity duration-300 ${t?"opacity-0":"opacity-100 delay-200"}`,children:f(Zn,{items:_,onItemClick:Y,className:"space-y-1",expandedIds:z,colorMode:i,enablePinning:d,pinnedIds:A,onTogglePin:W,onToggleExpand:B=>{let q=new Set(w);_.some(ue=>ue.id===B)?q.has(B)?q.delete(B):(_.forEach(ue=>{ue.id!==B&&q.has(ue.id)&&q.delete(ue.id);}),q.add(B)):q.has(B)?q.delete(B):q.add(B),T(q);}})}),t&&f("div",{className:"space-y-2",children:j.map(B=>f("div",{className:"space-y-1",children:f("button",{onClick:()=>{o();let q=new Set([B.id]);T(q);},className:`w-full flex items-center justify-center p-2 rounded-lg cursor-pointer transition-colors duration-200 ${g$1?"text-[var(--orb-muted)] hover:bg-[var(--orb-surface-2)]":"text-[var(--orb-muted)] hover:bg-[var(--orb-surface)]"}`,title:C("navigation.expandView",{title:B.title||""}),children:B.icon||f("div",{className:`w-6 h-6 rounded text-xs flex items-center justify-center font-medium ${g$1?"bg-[var(--orb-nav-active-fg)] text-[#0b0b0b]":"bg-[var(--orb-primary)] text-[var(--orb-on-primary)]"}`,children:B.title?.charAt(0)||"?"})})},B.id))})]})}),!t&&f("button",{onClick:o,className:`absolute -bottom-1 -right-1 w-6 h-6 bg-transparent rounded-full flex items-center justify-center transition-all duration-300 ease-in-out z-20 ${g$1?"hover:bg-[color-mix(in_oklch,var(--orb-surface-2)_50%,transparent)]":"hover:bg-[color-mix(in_oklch,var(--orb-canvas)_20%,transparent)]"}`,title:C("navigation.collapse"),children:f("div",{className:"absolute",style:{bottom:"0px",right:"0px",width:"16px",height:"16px",overflow:"hidden"},children:f("div",{className:g$1?"border-[var(--orb-status-warning)]":"",style:{width:"32px",height:"32px",borderRadius:"16px",border:"3px solid var(--orb-ai-accent)",backgroundColor:"transparent",position:"absolute",top:"-16px",left:"-16px"}})})}),u&&t&&f("button",{type:"button",onClick:H,className:`absolute -bottom-4 left-1/2 z-30 flex h-9 w-9 -translate-x-1/2 items-center justify-center rounded-full border shadow-md transition-colors focus:outline-none focus:ring-2 focus:ring-[color-mix(in_oklch,var(--orb-primary)_45%,transparent)] ${g$1?"border-[var(--orb-border)] bg-[var(--orb-surface-2)] text-[var(--orb-fg)] hover:bg-[var(--orb-hover)]":"border-[var(--orb-border)] bg-[var(--orb-canvas)] text-[var(--orb-status-fg)] hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]"}`,style:{touchAction:"manipulation"},title:C(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),"aria-label":C(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),children:x?f(Wa,{className:"h-4 w-4"}):f($a,{className:"h-4 w-4"})})]})};var Nf="orbcafe:navigation-island:pinned-items",nl="orbcafe-navigation-pinned",bd=t=>t.appurl||t.href,vd=t=>t.flatMap(o=>{let r=!!o.children?.length,n=o.pinnable!==false&&bd(o)&&!r?[{...o,children:void 0}]:[];return o.children?.length?[...n,...vd(o.children)]:n}),yd=t=>t.flatMap(o=>[o.id,...o.children?yd(o.children):[]]),Cd=(t,o)=>t.reduce((r,n)=>{let a=n.children?Cd(n.children,o):[];return ([n.title,n.label,n.description].some(s=>s?.toLocaleLowerCase().includes(o))||a.length>0)&&r.push({...n,children:a.length>0?a:n.children}),r},[]),al=({collapsed:t,onToggle:o,className:r="",maxHeight:n,menuData:a=[],colorMode:i="light",displayMode:s="fixed",onDisplayModeChange:c,showDisplayModeToggle:u=true,enablePinning:d=true,pinStorageKey:m=Nf,pinnedItemIds:h,defaultPinnedItemIds:f$1=[],onPinnedItemIdsChange:p,pinnedSectionTitle:v})=>{let{t:C}=de(),g$1=useRouter(),x=s==="floating",[y,b]=useState(""),[k,w]=useState(new Set),[T,I]=useState(f$1),[S,D]=useState(false),R=h!==void 0,M=h??T,P=useMemo(()=>new Set(M),[M]);useEffect(()=>{t&&w(new Set);},[t]),useEffect(()=>{if(!d||R){D(true);return}try{let B=window.localStorage.getItem(m);if(B){let q=JSON.parse(B);Array.isArray(q)&&I(q.filter(Z=>typeof Z=="string"));}}catch{}finally{D(true);}},[d,R,m]),useEffect(()=>{if(!(!d||R||!S))try{window.localStorage.setItem(m,JSON.stringify(M));}catch{}},[M,d,R,m,S]),useEffect(()=>{!d||t||M.length===0||w(B=>{if(B.has(nl))return B;let q=new Set(B);return q.add(nl),q});},[t,M.length,d]);let A=useCallback(B=>{let q=Array.from(new Set(B));R||I(q),p?.(q);},[R,p]),L=useCallback(B=>{A(P.has(B.id)?M.filter(q=>q!==B.id):[...M,B.id]);},[M,P,A]),W=useMemo(()=>{if(!d||M.length===0)return a;let B=new Map(vd(a).map(Z=>[Z.id,Z])),q=M.map(Z=>B.get(Z)).filter(Z=>!!Z);return q.length===0?a:[{id:nl,title:v||C("navigation.pinned"),icon:f(jr,{className:"h-4 w-4"}),children:q,pinnable:false},...a]},[M,d,a,v,C]),j=y.trim().toLocaleLowerCase(),O=useMemo(()=>j?Cd(W,j):W,[W,j]),_=useMemo(()=>j?new Set(yd(O)):k,[k,O,j]),z=useCallback(B=>{w(q=>{let Z=new Set(q),ue=O.some(ne=>ne.id===B);return Z.has(B)?Z.delete(B):(ue&&O.forEach(ne=>Z.delete(ne.id)),Z.add(B)),Z});},[O]),Y=useCallback(B=>{let q=bd(B);q&&(B.id==="chat"||B.appurl==="/chat"?g$1.push("/chat?new=true"):/^https?:\/\//.test(q)?window.open(q,"_blank","noopener,noreferrer"):g$1.push(q));},[g$1]),H=B=>{o(),w(new Set([B.id]));};return g("aside",{"data-navigation-island":"v2","data-collapsed":t||void 0,className:`orb-navigation-island-v2 relative flex flex-col border ${t?"w-14":"w-[234px]"} ${r}`,style:{maxHeight:n?`${n}px`:void 0,transition:"width 320ms cubic-bezier(0.4, 0, 0.2, 1), border-radius 220ms ease, box-shadow 220ms ease"},"aria-label":"Navigation",children:[f("div",{className:`orb-navigation-island-v2-search ${t?"px-1":"px-2"}`,children:t?f("button",{type:"button",onClick:o,className:"mx-auto flex h-10 w-10 items-center justify-center rounded-lg text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]",title:C("navigation.expand"),"aria-label":C("navigation.expand"),children:f(Vo,{className:"h-5 w-5"})}):g("label",{className:"relative block",children:[f("span",{className:"orb-visually-hidden",children:C("navigation.searchPlaceholder")}),f(Vo,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[var(--orb-muted)]"}),f("input",{type:"search",value:y,onChange:B=>b(B.target.value),placeholder:C("navigation.searchPlaceholder"),className:"w-full py-2 pl-10 pr-3 text-sm outline-none"})]})}),f("nav",{className:`min-h-0 flex-1 overflow-y-auto pb-2 ${t?"px-1":"px-2"}`,children:O.length===0?f("div",{className:"flex items-center justify-center py-8 text-sm text-[var(--orb-muted)]",children:t?f(zn,{className:"h-5 w-5"}):C(j?"navigation.noMatch":"navigation.noAccessibleApp")}):t?f("div",{className:"space-y-1",children:W.map(B=>f("button",{type:"button",onClick:()=>H(B),className:"flex h-10 w-full items-center justify-center rounded-lg text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]",title:C("navigation.expandView",{title:B.title||B.label||""}),children:B.icon||f(zn,{className:"h-5 w-5"})},B.id))}):f(Zn,{items:O,onItemClick:Y,className:"space-y-1",expandedIds:_,onToggleExpand:z,colorMode:i,enablePinning:d,pinnedIds:P,onTogglePin:L})}),u&&t&&f("div",{className:"orb-navigation-island-v2-footer flex flex-col items-center gap-1 border-t px-1 py-2",children:f("button",{type:"button",onClick:()=>c?.(x?"fixed":"floating"),className:"flex h-9 w-9 items-center justify-center rounded-lg text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]",title:C(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),"aria-label":C(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),children:x?f(Wa,{className:"h-4 w-4"}):f($a,{className:"h-4 w-4"})})}),!t&&f("button",{type:"button",onClick:o,className:"absolute -bottom-1 -right-1 z-20 flex h-6 w-6 items-center justify-center rounded-full bg-transparent transition-all duration-300 ease-in-out",title:C("navigation.collapse"),"aria-label":C("navigation.collapse"),children:f("span",{"aria-hidden":"true",className:"absolute overflow-hidden",style:{bottom:0,right:0,width:16,height:16},children:f("span",{className:"absolute rounded-full border-[3px] border-[var(--orb-ai-accent)]",style:{width:32,height:32,top:-16,left:-16}})})})]})};al.displayName="NavigationIsland2";var wd=(t={})=>{let{initialCollapsed:o=false,initialDisplayMode:r="fixed",content:n=[],enablePinning:a,pinStorageKey:i,pinnedItemIds:s,defaultPinnedItemIds:c,onPinnedItemIdsChange:u,pinnedSectionTitle:d}=t,[m,h]=useState(o),[f,p]=useState(r),[v,C]=useState(n),g=useCallback(()=>{h(b=>!b);},[]),x=useCallback(()=>{p(b=>b==="fixed"?"floating":"fixed");},[]),y=useMemo(()=>({collapsed:m,onToggle:g,menuData:v,displayMode:f,onDisplayModeChange:p,enablePinning:a,pinStorageKey:i,pinnedItemIds:s,defaultPinnedItemIds:c,onPinnedItemIdsChange:u,pinnedSectionTitle:d}),[m,g,v,f,p,a,i,s,c,u,d]);return {collapsed:m,setCollapsed:h,toggleCollapsed:g,displayMode:f,setDisplayMode:p,toggleDisplayMode:x,menuData:v,setMenuData:C,navigationIslandProps:y}};var sl=class{constructor(){a(this,"listener",null);}register(o){this.listener=o;}unregister(){this.listener=null;}show(o,r,n){this.listener&&this.listener({type:o,content:r,options:n});}hide(){this.listener&&this.listener(null);}},sr=new sl,TT={success:(t,o)=>sr.show("success",t,o),error:(t,o)=>sr.show("error",t,o),warning:(t,o)=>sr.show("warning",t,o),info:(t,o)=>sr.show("info",t,o),show:(t,o,r)=>sr.show(t,o,r),hide:()=>sr.hide()};var Af={success:{icon:f(Bn,{size:40}),color:"var(--orb-success-bg)",iconColor:"var(--orb-success)"},warning:{icon:f(Ga,{size:40}),color:"var(--orb-warn-bg)",iconColor:"var(--orb-warn)"},error:{icon:f(Oa,{size:40}),color:"var(--orb-err-bg)",iconColor:"var(--orb-err)"},info:{icon:f(Ba,{size:40}),color:"var(--orb-info-bg)",iconColor:"var(--orb-info)"},default:{icon:null,color:"transparent",iconColor:"inherit"}},jn=({open:t,title:o,message:r,onClose:n,onConfirm:a,confirmText:i,cancelText:s,showCancel:c=true,maxWidth:u="xs",type:d="default"})=>{let{t:m}=de(),h=i||m("messageBox.confirm"),f$1=s||m("messageBox.cancel"),p=()=>{a?a():n();},v=Af[d],C=d!=="default";return g(Lt,{open:t,onClose:n,maxWidth:u,sx:C?{borderTop:`6px solid ${v.iconColor}`}:void 0,children:[C&&f("div",{style:{display:"flex",justifyContent:"center",paddingTop:24,color:v.iconColor},children:v.icon}),o&&f("div",{className:"orb-dialog-title",style:{textAlign:C?"center":"left",paddingTop:C?8:16},children:o}),f("div",{className:"orb-dialog-content",style:{textAlign:C?"center":"left"},children:typeof r=="string"?f("p",{style:{margin:0,color:"var(--orb-muted)"},children:r}):r}),g("div",{className:"orb-dialog-actions",style:{display:"flex",justifyContent:C?"center":"flex-end",gap:8,paddingBottom:24,paddingLeft:24,paddingRight:24},children:[c&&f(Me,{onClick:n,variant:"text",children:f$1}),f(Me,{onClick:p,variant:"contained",color:C&&d==="error"?"error":"primary",autoFocus:true,children:h})]})]})},LT=()=>{let[t,o]=Jt__default.useState(null),[r,n]=Jt__default.useState(false);Jt__default.useEffect(()=>{let s=c=>{c?(o(c),n(true)):(n(false),o(null));};return sr.register(s),()=>sr.unregister()},[]);let a=()=>{n(false),t?.options?.onClose&&t.options.onClose(),o(null);},i=()=>{t?.options?.onConfirm&&t.options.onConfirm(),n(false),o(null);};return t?f(jn,{open:r,type:t.type,message:t.content,title:t.options?.title,onClose:a,onConfirm:i,confirmText:t.options?.confirmText,cancelText:t.options?.cancelText,showCancel:t.options?.showCancel,maxWidth:t.options?.maxWidth}):null};var zT=({status:t,showIcon:o=true})=>{let r="gray",n,a=t;return t==="OK"?(r="blue",n=f(Bn,{size:14,strokeWidth:2}),a="Success"):t==="Error"?(r="orange",n=f(Oa,{size:14,strokeWidth:2}),a="Error"):t==="Warning"&&(r="orange",n=f(Ga,{size:14,strokeWidth:2}),a="Warning"),f(Ct,{label:a,tone:r,icon:o&&n?n:void 0})};var $T=({dense:t,sx:o,className:r,children:n,...a})=>f("ul",{...a,className:r,style:{listStyle:"none",margin:0,padding:0,...o},children:n}),_T=({button:t,divider:o,sx:r,className:n,children:a,...i})=>f("li",{...i,className:n,style:{display:"flex",alignItems:"center",padding:"8px 16px",minHeight:40,borderBottom:o?"1px solid var(--orb-border)":void 0,cursor:t?"pointer":void 0,transition:"var(--orb-t-fast)",...r},onMouseEnter:t?s=>{s.currentTarget.style.background="var(--orb-hover)";}:void 0,onMouseLeave:t?s=>{s.currentTarget.style.background="";}:void 0,children:a}),GT=({sx:t,className:o,children:r,...n})=>f("button",{...n,type:"button",className:o,style:{width:"100%",display:"flex",alignItems:"center",padding:"8px 16px",border:"none",background:"transparent",textAlign:"left",cursor:"pointer",transition:"var(--orb-t-fast)",...t},children:r}),UT=({children:t,sx:o})=>f("div",{style:{marginRight:16,display:"flex",alignItems:"center",minWidth:40,...o},children:t}),KT=({primary:t,secondary:o,sx:r})=>g("div",{style:{flex:1,minWidth:0,...r},children:[f("div",{className:"orb-body",style:{fontWeight:500},children:t}),o&&f("div",{className:"orb-meta",style:{marginTop:2},children:o})]}),qT=({sx:t,className:o,children:r,...n})=>f("li",{...n,className:o,style:{padding:"8px 16px",fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--orb-muted)",...t},children:r}),XT=({children:t,sx:o})=>f("div",{style:{marginRight:12,display:"flex",alignItems:"center",...o},children:t});var QT=({xs:t,md:o,lg:r,sx:n,children:a,className:i,...s})=>{let c=r?`span ${r}`:o?`span ${o}`:t?`span ${t}`:"span 12";return f("div",{...s,className:i,style:{gridColumn:c,minWidth:0,...n},children:a})};var Fo=tt,ao=(t,o)=>forwardRef(({component:r,sx:n,className:a,style:i,children:s,...c},u)=>{let d$1=r??t,m=d(n,[o,a].filter(Boolean).join(" "),i);return f(d$1,{ref:u,className:m.className,style:m.style,...c,children:s})}),Re=ao("div"),kd=ao("a","orb-link"),Fr=Le,Pd=ce,Co=E;var Td=le;var Md=Rt,Jo=on,ni=tn,ai=qa;var ii=Ka,Id=Yo,Rd=({value:t,variant:o,color:r,sx:n})=>f(_n,{value:o==="determinate"?t:void 0,color:r,sx:n}),Nd=ao("table","orb-tbl"),Dd=ao("tbody"),dl=ao("td"),Ad=ao("div","orb-table-container"),Ed=ao("thead"),pl=ao("tr");ao("tfoot");ao("div","orb-dialog-title");ao("div","orb-dialog-content");ao("div","orb-dialog-actions");ao("p","orb-body-dense");var lr=ao("span","orb-input-adornment"),Ld=forwardRef(({sx:t,fullWidth:o,className:r,style:n,...a},i)=>{let s=d(t,["orb-input-base",r].filter(Boolean).join(" "),n);return f("input",{ref:i,className:s.className,style:{width:o?"100%":void 0,...s.style},...a})});var yr=ao("div","orb-form-control"),Jn=({control:t,label:o,...r})=>g("label",{className:"orb-form-control-label",...r,children:[t,f("span",{children:o})]}),Hf=({primary:t,secondary:o,children:r,primaryTypographyProps:n,secondaryTypographyProps:a,...i})=>g("span",{className:"orb-list-item-text",...i,children:[t??r,o?f("small",{children:o}):null]}),zf=ao("span","orb-list-item-icon"),_t=Hf,Wo=zf;ao("div","orb-list-subheader");var ul=({container:t,item:o,spacing:r,xs:n,sm:a,md:i,lg:s,xl:c,sx:u,...d})=>{let m={},h=f=>typeof f=="number"?`${f/12*100}%`:f?"100%":void 0;return n!==void 0&&(m.xs=h(n)),a!==void 0&&(m.sm=h(a)),i!==void 0&&(m.md=h(i)),s!==void 0&&(m.lg=h(s)),c!==void 0&&(m.xl=h(c)),f(Re,{...d,sx:{display:t?"flex":void 0,flexWrap:t?"wrap":void 0,gap:t&&r?r:void 0,width:o?m:void 0,...u??{}}})},rn=({in:t,children:o,unmountOnExit:r,...n})=>!t&&r?null:f("div",{hidden:!t,...n,children:o}),Od=({children:t,container:o})=>typeof document>"u"?null:createPortal(t,o??document.body),Fd=ao("div","orb-toolbar"),Bd=({active:t,direction:o="asc",children:r,sx:n,className:a,style:i,...s})=>{let c=d(n,["orb-table-sort-label",t?"orb-is-active":"",a].filter(Boolean).join(" "),i);return g("button",{type:"button",className:c.className,style:c.style,"data-direction":o,...s,children:[f("span",{className:"orb-table-sort-content",children:r}),f(Pt,{className:"orb-table-sort-icon",name:o==="desc"?"down":"up",size:11})]})},si=({open:t,anchorEl:o,onClose:r,children:n,anchorOrigin:a,transformOrigin:i,slotProps:s,PaperProps:c,sx:u,className:d$1,style:m,...h})=>{let f$1=useRef(null);if(useEffect(()=>{if(!t)return;let x=b=>{let k=b.composedPath();f$1.current&&k.includes(f$1.current)||o&&k.includes(o)||r?.();},y=b=>{b.key==="Escape"&&r?.();};return document.addEventListener("pointerdown",x,true),document.addEventListener("keydown",y,true),()=>{document.removeEventListener("pointerdown",x,true),document.removeEventListener("keydown",y,true);}},[o,r,t]),!t||typeof document>"u")return null;let p=o?.getBoundingClientRect(),v=s?.paper??c,C=[...Array.isArray(v?.sx)?v.sx:v?.sx?[v.sx]:[],...Array.isArray(u)?u:u?[u]:[]],g=d(C,["orb-pop",v?.className,d$1].filter(Boolean).join(" "),{...v?.style,...m});return createPortal(f("div",{...h,ref:f$1,className:g.className,style:{position:"fixed",left:p?.left??16,top:(p?.bottom??16)+6,zIndex:1301,...g.style},children:n}),document.body)},Hd=({open:t,onClose:o,anchor:r="left",children:n,PaperProps:a})=>{if(!t||typeof document>"u")return null;let i=r==="right"?{right:0,top:0,bottom:0}:r==="top"?{left:0,right:0,top:0}:r==="bottom"?{left:0,right:0,bottom:0}:{left:0,top:0,bottom:0},s=d(a?.sx,"orb-drawer");return createPortal(g(e,{children:[f("button",{type:"button",className:"orb-overlay","aria-label":"Close drawer",onClick:o}),f("aside",{className:s.className,style:{position:"fixed",zIndex:1201,...i},children:n})]}),document.body)},zd=({value:t,onChange:o,children:r,variant:n,scrollButtons:a,...i})=>f("div",{role:"tablist",className:"orb-tabs",...i,children:Children.map(r,s=>isValidElement(s)?cloneElement(s,{selected:s.props.value===t,onSelect:c=>o?.(null,c)}):s)}),Vd=({value:t,label:o,children:r,selected:n,onSelect:a,...i})=>f("button",{type:"button",role:"tab","aria-selected":n,className:`orb-tab ${n?"orb-is-active":""}`,onClick:()=>a?.(t),...i,children:o??r});var io=()=>c(),Cr=(t,o)=>Eo(t);var Wd=({day:t,onDaySelect:o,selected:r,outsideCurrentMonth:n,disableMargin:a,sx:i,className:s,...c})=>{let u=d(i,`orb-cal-day ${r?"orb-is-selected":""} ${n?"orb-is-outside":""} ${s??""}`);return f("button",{type:"button",className:u.className,style:u.style,onClick:()=>o?.(t),...c,children:t.date()})},$d=({value:t,referenceDate:o,onChange:r,onMonthChange:n,onYearChange:a,minDate:i,maxDate:s,slots:c,...u})=>f(Kn,{value:t,month:o,onChange:d=>r?.(d),onMonthChange:d=>{n?.(d),a?.(d);},minDate:i,maxDate:s,renderDay:c?.day?(d,m)=>c.day?.({day:d,selected:m.selected,outsideCurrentMonth:m.outsideCurrentMonth,onDaySelect:h=>r?.(h)}):void 0,...u}),_d=({children:t})=>f(e,{children:t}),ri=class{};var Vf=(t,o)=>o!==void 0?o:typeof t=="number"?t:t==="small"?18:t==="large"?30:t==="inherit"?"1em":22,Te=t=>({fontSize:r,size:n,sx:a,className:i,style:s,titleAccess:c,...u})=>{let d$1=d(a,i,s);return f(Pt,{name:t,size:Vf(r,n),className:d$1.className,style:d$1.style,"aria-label":u["aria-label"]??c,...u})},xr=Te("tree"),Br=Te("add"),Gd=Te("duplicate"),ml=Te("down"),Ud=Te("navigationRight"),Kd=Te("navigationRight"),gl=Te("up"),qd=Te("delete"),Xd=Te("camera"),Zd=Te("accept"),Yd=Te("accept"),li=Te("navigationRight"),Qd=Te("dimension"),ea=Te("decline"),wr=Te("decline"),jd=Te("decline"),Jd=Te("decline"),ci=Te("delete"),di=Te("delete"),ep=Te("download"),tp=Te("move"),op=Te("edit"),nn=Te("slimDown"),rp=Te("filter"),an=Te("sum"),np=Te("lineChart"),ap=Te("document"),$o=Te("slimDown"),ip=Te("navigationLeft"),Sr=Te("navigationRight"),pi=Te("slimUp"),ui=Te("navigationLeft"),mi=Te("navigationRight"),sp=Te("dimension"),lp=Te("splitOne"),gi=Te("menu"),cp=Te("microphone"),dp=Te("microphone"),pp=Te("microphone"),up=Te("qrCode"),kr=Te("save"),Hr=Te("search"),mp=Te("search"),gp=Te("paperPlane"),hp=Te("paperPlane"),fp=Te("wrench"),bp=Te("sort"),hi=Te("splitTwo"),vp=Te("favorite"),yp=Te("favorite"),hl=Te("stop"),Cp=Te("tableRow"),fi=Te("collapseAll"),bi=Te("expandAll"),sn=Te("tableColumn"),xp=Te("overview"),wp=Te("hide");var $f=[{field:"value",label:"Value",minWidth:120},{field:"label",label:"Description",minWidth:180}],kp=t=>Array.isArray(t)?t:t==null||t===""?[]:[t],Mo=t=>String(t),Pp=(t,o)=>t[o],Tp=t=>{let o=t.value??t.id??t.key??t.code;return typeof o=="number"||typeof o=="string"?o:""},_f=t=>{let o=t.label??t.description??t.name??t.title;return String(typeof o=="number"||typeof o=="string"?o:Tp(t))},Gf=t=>{let o=t.description??t.subtitle;return typeof o=="number"||typeof o=="string"?String(o):void 0},Mp=({value:t=null,items:o=[],columns:r,mode:n="single",dialogTitle:a="Value Help",searchPlaceholder:i="Search values...",selectLabel:s="Select",clearLabel:c="Clear",cancelLabel:u="Cancel",valueHelpLabel:d="Open value help",noResultsText:m="No matching values",loading:h=false,clearable:f$1=true,allowManualInput:p=true,validateManualInput:v=true,manualInputErrorText:C="Enter a valid value.",selectedItems:g$1=[],displayValue:x,getOptionValue:y=Tp,getOptionLabel:b=_f,getOptionDescription:k=Gf,onChange:w,onSearch:T,disabled:I,InputProps:S,onFocus:D,onBlur:R,onKeyDown:M,error:P,helperText:A,...L})=>{let W=fo(),j=n==="multiple",[O,_]=useState(false),[z,Y]=useState(false),[H,B]=useState(""),[q,Z]=useState(null),[ue,ne]=useState(false),[fe,Ce]=useState(()=>kp(t)),[$,J]=useState(""),[ae,xe]=useState(""),pe=useMemo(()=>r&&r.length>0?r:$f,[r]),me=q??o,Ee=useMemo(()=>{let oe=[...g$1,...o,...q??[]],we=new Map;return oe.forEach(Ae=>{we.set(Mo(y(Ae)),Ae);}),we},[y,o,q,g$1]),Ge=useMemo(()=>kp(t),[t]),nt=useMemo(()=>Ge.map(String).join(", "),[Ge]);useEffect(()=>{O||Ce(Ge);},[O,Ge]),useEffect(()=>{!z&&!ae&&J(nt);},[z,nt,ae]);let it=useMemo(()=>{let oe=H.trim().toLowerCase();if(!oe||T)return me;let we=pe.filter(Ae=>Ae.searchable!==false);return me.filter(Ae=>[y(Ae),b(Ae),k(Ae),...we.map(st=>Pp(Ae,st.field))].some(st=>String(st??"").toLowerCase().includes(oe)))},[me,k,b,y,T,H,pe]),K=useMemo(()=>{if(x!==void 0)return x;if(Ge.length===0)return "";let oe=we=>{let Ae=Ee.get(Mo(we));if(!Ae)return String(we);let Je=b(Ae);return Je&&Je!==String(we)?`${we} - ${Je}`:String(we)};return j?Ge.length>2?`${Ge.length} selected`:Ge.map(oe).join(", "):oe(Ge[0])},[x,b,j,Ee,Ge]),De=useCallback(async()=>{if(T){ne(true);try{let oe=await T(H);Array.isArray(oe)&&Z(oe);}finally{ne(false);}}},[T,H]),ke=()=>{I||(Ce(Ge),_(true));},He=()=>{_(false);},at=()=>{w?.(j?[]:null,j?[]:null),Ce([]),J(""),xe("");},Ye=oe=>{let we=y(oe);if(j){Ce(Ae=>Ae.some(st=>Mo(st)===Mo(we))?Ae.filter(st=>Mo(st)!==Mo(we)):[...Ae,we]);return}Ce([we]);},xt=()=>{let oe=fe.map(we=>Ee.get(Mo(we))).filter(we=>!!we);j?w?.(fe,oe):w?.(fe[0]??null,oe[0]??null),xe(""),_(false);},Mt=oe=>{if(oe.key==="F4"){oe.preventDefault(),ke();return}if(oe.key==="Enter"&&p&&!At($,true)){oe.preventDefault();return}M?.(oe);},Ot=oe=>v?oe.every(we=>Ee.has(Mo(we))):true,At=(oe,we)=>{if(j){let Je=oe.split(/[,;\n]/).map(pt=>pt.trim()).filter(Boolean);if(Je.length===0)return xe(""),w?.([],[]),true;if(!Ot(Je))return we&&xe(C),false;xe("");let st=Je.map(pt=>Ee.get(Mo(pt))).filter(pt=>!!pt);return w?.(Je,st),true}let Ae=oe.trim();return Ae?Ot([Ae])?(xe(""),w?.(Ae,Ee.get(Mo(Ae))??null),true):(we&&xe(C),false):(xe(""),w?.(null,null),true)},re=oe=>{if(!p)return;let we=oe.target.value;J(we),xe(""),At(we,false);},Ue=h||ue,Be=Ge.length>0,Se=p&&(z||!!ae)?$:K;return g(e,{children:[f(We,{...L,className:["orb-value-help-field",f$1&&Be&&!I?"orb-value-help-has-clear":"",L.className??""].filter(Boolean).join(" "),disabled:I,value:Se,error:!!ae||P,helperText:ae||A,onChange:re,onFocus:oe=>{Y(true),J(nt),D?.(oe);},onBlur:oe=>{p&&At($,true),Y(false),R?.(oe);},onKeyDown:Mt,InputProps:{...S,readOnly:!p,endAdornment:g("span",{className:"orb-value-help-actions",children:[Ue?f(Yo,{size:18}):null,f$1&&Be&&!I?f(le,{className:"orb-value-help-clear-trigger",size:"small",tooltip:c,"aria-label":c,onMouseDown:oe=>oe.preventDefault(),onClick:oe=>{oe.stopPropagation(),at();},children:f(Pt,{name:"decline",size:14})}):null,f(le,{className:"orb-value-help-search-trigger",size:"small",tooltip:d,"aria-label":d,onMouseDown:oe=>oe.preventDefault(),onClick:oe=>{oe.stopPropagation(),ke();},disabled:I,children:f(Pt,{name:"search",size:16})})]})}}),g(Lt,{open:O,onClose:He,fullWidth:true,maxWidth:820,hideCloseButton:true,PaperProps:{sx:oe=>({borderRadius:2,overflow:"hidden",border:`1px solid ${oe.palette.divider}`,boxShadow:W==="dark"?`0 24px 80px ${tt(oe.palette.common.black,.72)}`:`0 24px 80px ${tt(oe.palette.common.black,.18)}`})},children:[g("div",{className:"orb-dialog-title",sx:oe=>({display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,px:2.5,py:2,pr:1.5,borderBottom:`1px solid ${oe.palette.divider}`,bgcolor:oe.palette.background.paper}),children:[g("div",{children:[f(E,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:a}),j?f(E,{variant:"body2",color:"text.secondary",sx:{mt:.25},children:`${fe.length} selected`}):null]}),f(le,{"aria-label":"Close",onClick:He,size:"small",children:f(wr,{fontSize:"small"})})]}),g("div",{className:"orb-dialog-content",sx:{p:0},children:[g(ce,{direction:{xs:"column",sm:"row"},spacing:1,sx:oe=>({px:2.5,py:1.5,borderBottom:`1px solid ${oe.palette.divider}`,bgcolor:W==="dark"?tt(oe.palette.common.white,.025):tt(oe.palette.primary.main,.035)}),children:[f(We,{size:"small",fullWidth:true,autoFocus:true,value:H,placeholder:i,onChange:oe=>B(oe.target.value),onKeyDown:oe=>{oe.key==="Enter"&&(oe.preventDefault(),De());},InputProps:{startAdornment:f(lr,{position:"start",children:f(Pt,{name:"search",size:16})}),sx:oe=>({borderRadius:1,bgcolor:oe.palette.background.paper,"& fieldset":{borderColor:tt(oe.palette.text.primary,W==="dark"?.2:.16)},"&:hover fieldset":{borderColor:tt(oe.palette.primary.main,.52)},"&:focus-within fieldset":{borderColor:oe.palette.primary.main}})}}),T?f(Me,{variant:"outlined",onClick:()=>{De();},disabled:Ue,sx:{minWidth:96,textTransform:"none",fontWeight:700},children:Ue?f(Yo,{size:18}):"Search"}):null]}),f("div",{sx:{maxHeight:420},children:g("table",{className:"orb-tbl",stickyHeader:true,size:"small",children:[f("thead",{children:g("tr",{children:[f("td",{padding:"checkbox",sx:oe=>({bgcolor:W==="dark"?"var(--orb-canvas)":oe.palette.background.paper,borderBottom:`1px solid ${oe.palette.divider}`})}),pe.map(oe=>f("td",{align:oe.align==="inherit"?void 0:oe.align,sx:we=>({minWidth:oe.minWidth,width:oe.width,fontSize:"0.78rem",fontWeight:800,bgcolor:W==="dark"?"var(--orb-canvas)":we.palette.background.paper,borderBottom:`1px solid ${we.palette.divider}`}),children:oe.label},String(oe.field)))]})}),g("tbody",{children:[it.map(oe=>{let we=y(oe),Ae=fe.some(Je=>Mo(Je)===Mo(we));return g("tr",{hover:true,selected:Ae,onClick:()=>Ye(oe),onDoubleClick:()=>{j||(Ce([we]),w?.(we,oe),_(false));},sx:Je=>({cursor:"pointer","&.orb-selected":{bgcolor:tt(Je.palette.primary.main,W==="dark"?.22:.12)},"&.orb-selected:hover":{bgcolor:tt(Je.palette.primary.main,W==="dark"?.28:.18)}}),children:[f("td",{padding:"checkbox",children:f(Tt,{size:"small",checked:Ae})}),pe.map(Je=>{let st=Pp(oe,Je.field);return f("td",{align:Je.align==="inherit"?void 0:Je.align,sx:{fontSize:"0.82rem",py:1},children:Je.render?Je.render(st,oe):String(st??"")},String(Je.field))})]},Mo(we))}),it.length===0?f("tr",{children:f("td",{colSpan:pe.length+1,children:f("div",{sx:{py:5,textAlign:"center",color:"text.secondary"},children:m})})}):null]})]})})]}),g("div",{className:"orb-dialog-actions",sx:oe=>({px:2.5,py:1.5,borderTop:`1px solid ${oe.palette.divider}`,bgcolor:oe.palette.background.paper,"& .orb-btn":{textTransform:"none",fontWeight:700}}),children:[f$1&&(Be||fe.length>0)?f(Me,{onClick:at,children:c}):null,f("div",{sx:{flex:1}}),f(Me,{onClick:He,children:u}),f(Me,{variant:"contained",onClick:xt,disabled:!j&&fe.length===0,children:s})]})]})]})};var vi=({title:t,hideHeader:o,children:r})=>g("div",{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[!o&&f("div",{sx:{mb:2},children:f(E,{variant:"h4",children:t})}),f("div",{sx:{flex:1,overflow:"hidden"},children:r})]});var fl={width:56,minWidth:56,maxWidth:56,paddingLeft:"4px !important",paddingRight:"4px !important",paddingTop:"0 !important",paddingBottom:"0 !important",textAlign:"center",verticalAlign:"middle",boxSizing:"border-box"},bl={width:72,minWidth:72,maxWidth:72,paddingLeft:"4px !important",paddingRight:"4px !important",paddingTop:"0 !important",paddingBottom:"0 !important",textAlign:"center",verticalAlign:"middle",boxSizing:"border-box"},ta={width:30,height:30,p:.25,flex:"0 0 auto","& svg":{fontSize:20}},oa={width:30,height:30,minWidth:30,minHeight:30,p:.25,flex:"0 0 auto","& svg":{fontSize:20}},Ip={display:"flex",alignItems:"center",justifyContent:"center",gap:.25,width:"100%",minWidth:0},uo={width:32,height:32,minWidth:32,minHeight:32,p:0,flex:"0 0 auto",borderRadius:1,color:"text.secondary","& svg, & [data-sap-icon]":{width:16,height:16,fontSize:16,strokeWidth:1.8}};var Uf={fontSize:"0.85rem",width:62,minWidth:62,"& .orb-select-trigger":{minHeight:"32px !important",height:"32px !important",padding:"0 8px !important"},"& .orb-select-chevron":{width:"11px !important",height:"11px !important",fontSize:"11px !important"}},yi=({rowsPerPage:t=20,rowsPerPageOptions:o=[20,50,100,-1],page:r=0,count:n=0,onRowsPerPageChange:a,onPageChange:i})=>{let{t:s}=de(),c=o.length>0?o:[20,50,100,-1],u=Math.max(0,r),d=t===-1?1:Math.max(1,Math.ceil(n/t)),m=Math.min(u+1,d),h=u>0,f$1=u<d-1&&t!==-1;return g("div",{className:"orb-table-pager",children:[f(E,{className:"orb-table-pager-label",children:s("table.toolbar.itemsPerPage")}),f(ct,{title:s("table.toolbar.itemsPerPage"),children:f(zt,{size:"small",variant:"standard",value:t,"aria-label":s("table.toolbar.itemsPerPage"),fullWidth:false,disableUnderline:true,onChange:p=>a?.(Number(p.target.value)),sx:Uf,children:c.map(p=>f("option",{value:p,children:p===-1?s("common.all"):p},`rows-per-page-${p}`))})}),f("span",{className:"orb-table-pager-divider"}),f(le,{className:"orb-table-pager-button","aria-label":"Previous page",size:"small",onClick:()=>i?.(Math.max(u-1,0)),disabled:!h,sx:uo,children:f(ip,{})}),g(E,{className:"orb-table-pager-page",title:s("table.toolbar.pageOf",{current:m,total:d}),children:[m," / ",d]}),f(le,{className:"orb-table-pager-button","aria-label":"Next page",size:"small",onClick:()=>i?.(Math.min(u+1,d-1)),disabled:!f$1,sx:uo,children:f(Sr,{})})]})};var Ci=({value:t="",onChange:o})=>{let{t:r}=de();return f("div",{className:"orb-table-toolbar-search",children:f(We,{className:"orb-table-toolbar-search-field",size:"small",placeholder:r("table.toolbar.searchPlaceholder"),value:t,onChange:n=>o?.(n.target.value),InputProps:{startAdornment:f(lr,{position:"start",children:f(Hr,{size:16})})}})})};var xi=t=>{let{t:o}=de(),r=Array.isArray(t.actions)?t.actions:t.actions?[t.actions]:[],n=Array.isArray(t.extraTools)?t.extraTools:t.extraTools?[t.extraTools]:[],a=[...r,...n],i=!!(t.showCreateButton||t.showEditButton||t.showDeleteButton),s=!!(t.onOpenGraphReport||t.onLayoutSave&&!t.layoutManager||t.layoutManager);return f(Fd,{className:"orb-table-toolbar",role:"toolbar","aria-label":o("table.title.default"),children:g("div",{className:"orb-table-toolbar-primary",children:[f(Ci,{value:t.filterText,onChange:c=>{t.setFilterText(c),t.onPageChange?.(0);}}),f(yi,{rowsPerPage:t.rowsPerPage,rowsPerPageOptions:t.rowsPerPageOptions,page:t.page,count:t.count,onRowsPerPageChange:t.onRowsPerPageChange,onPageChange:t.onPageChange}),a.length>0?f("div",{className:"orb-table-toolbar-custom",children:a.map((c,u)=>f(Jt__default.Fragment,{children:c},`toolbar-custom-${u}`))}):null,f("span",{className:"orb-table-toolbar-spacer"}),g("div",{className:"orb-table-toolbar-actions",children:[g("div",{className:"orb-table-tool-group",children:[!t.disableGrouping&&f(ct,{title:o("table.toolbar.groupBy"),children:f(le,{className:"orb-table-tool-button",sx:uo,onClick:c=>t.setGroupAnchorEl(t.groupAnchorEl?null:c.currentTarget),children:f(ai,{badgeContent:t.grouping?.length,color:"primary",invisible:!t.grouping?.length,children:f(xr,{})})})}),f(ct,{title:o("table.toolbar.summary"),children:f(le,{className:`orb-table-tool-button ${t.showSummary?"orb-is-active":""}`,active:!!t.showSummary,sx:uo,onClick:c=>t.setSummaryAnchorEl(t.summaryAnchorEl?null:c.currentTarget),children:f(an,{})})}),f(ct,{title:o("table.toolbar.columns"),children:f(le,{className:"orb-table-tool-button",sx:uo,onClick:c=>t.setAnchorEl(t.anchorEl?null:c.currentTarget),children:f(sn,{})})}),f(ct,{title:o("table.toolbar.export"),children:f(le,{className:"orb-table-tool-button",sx:uo,onClick:t.handleExport,children:f(ep,{})})})]}),i&&g("div",{className:"orb-table-tool-group",children:[t.showCreateButton&&f(ct,{title:o("table.toolbar.newItem"),children:f(le,{className:"orb-table-tool-button",onClick:t.onOpenCreateDialog,color:"primary.main",sx:uo,children:f(Br,{})})}),t.showEditButton&&f(ct,{title:o("table.toolbar.editItem"),children:f("span",{children:f(le,{className:"orb-table-tool-button",onClick:t.onOpenEditDialog,color:"primary.main",disabled:!!t.editDisabled,sx:uo,children:f(op,{})})})}),t.showDeleteButton&&f(ct,{title:o("table.toolbar.deleteItem"),children:f("span",{children:f(le,{className:"orb-table-tool-button",onClick:t.onOpenDeleteConfirm,disabled:!!t.deleteDisabled,sx:{...uo,color:"error.main"},children:f(ci,{})})})})]}),s&&g("div",{className:"orb-table-tool-group",children:[t.onOpenGraphReport&&f(ct,{title:o("table.toolbar.graphicReport"),children:f(le,{className:"orb-table-tool-button",sx:uo,onClick:t.onOpenGraphReport,children:f(np,{})})}),t.onLayoutSave&&!t.layoutManager&&f(ct,{title:o("table.toolbar.saveLayout"),children:f(le,{className:"orb-table-tool-button",sx:uo,onClick:c=>t.onLayoutSave(c),children:f(kr,{})})}),t.layoutManager]})]})]})})};var wi=Object.freeze({Translate:{toString(t){if(!t)return;let{x:o,y:r}=t;return "translate3d("+(o?Math.round(o):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;let{scaleX:o,scaleY:r}=t;return "scaleX("+o+") scaleY("+r+")"}},Transform:{toString(t){if(t)return [wi.Translate.toString(t),wi.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:o,duration:r,easing:n}=t;return o+" "+r+"ms "+n}}});var Si=t=>{let{t:o}=de(),{onSelectAllClick:r,order:n,orderBy:a,sortBy:i=[],numSelected:s=0,rowCount:c=0,onRequestSort:u,onContextMenu:d,columns:m,visibleColumns:h,selectionMode:f$1,grouping:p=[],isAllExpanded:v=false,handleToggleAll:C,onColumnResize:g$1,columnWidths:x,enableColumnReorder:y=false,disableSorting:b=false}=t,[k,w]=useState(null),T=useRef(null),I=z=>Y=>{b||k||u(z);},S=(z,Y,H)=>{z.preventDefault(),z.stopPropagation(),w(Y),T.current={startX:z.clientX,startWidth:H,colId:Y},document.addEventListener("mousemove",D),document.addEventListener("mouseup",R),document.body.style.cursor="col-resize";},D=z=>{if(!T.current)return;let{startX:Y,startWidth:H,colId:B}=T.current,q=z.clientX-Y,Z=Math.max(50,H+q);g$1&&g$1(B,Z);},R=()=>{w(null),T.current=null,document.removeEventListener("mousemove",D),document.removeEventListener("mouseup",R),document.body.style.cursor="";};useEffect(()=>()=>{document.removeEventListener("mousemove",D),document.removeEventListener("mouseup",R);},[]);let M=f$1==="multiple"||f$1==="single",P=p.length>0&&!!C,A=o(v?"table.group.collapseAll":"table.group.expandAll"),L=m.filter(z=>h.includes(z.id)),W=new Map(i.map((z,Y)=>[z.field,{...z,priority:Y+1}])),j=L.map(z=>{let Y=x?.[z.id]||z.minWidth||100,H=W.get(z.id);return f(Jf,{headCell:z,width:typeof Y=="number"?Y:100,order:n,orderBy:a,multiSortInfo:b?void 0:H,onRequestSort:I(z.id),onContextMenu:d,onResizeMouseDown:B=>S(B,z.id,typeof Y=="number"?Y:100),enableColumnReorder:y,disableSorting:b},z.id)}),O=L.map(z=>z.id),_=g("tr",{children:[M&&f("th",{className:"orb-table-control-head",style:{width:56,minWidth:56,maxWidth:56},children:f(Tt,{color:"primary",indeterminate:s>0&&s<c,checked:c>0&&s===c,onChange:r,disabled:f$1==="single",sx:ta})}),P&&f("th",{className:"orb-table-control-head",style:{width:72,minWidth:72,maxWidth:72},children:f(ct,{title:A,children:f(le,{size:"small",onClick:z=>{z.stopPropagation(),C?.(!v);},sx:oa,children:v?f(fi,{}):f(bi,{})})})}),y?f(SortableContext,{items:O,strategy:horizontalListSortingStrategy,children:j}):j]});return f("thead",{children:_})},Jf=({headCell:t,width:o,order:r,orderBy:n,multiSortInfo:a,onRequestSort:i,onContextMenu:s,onResizeMouseDown:c,enableColumnReorder:u,disableSorting:d})=>{let{setNodeRef:m,attributes:h,listeners:f$1,transform:p,transition:v,isDragging:C}=useSortable({id:t.id,disabled:!u}),g$1=u?{transform:wi.Transform.toString(p),transition:v,opacity:C?.6:1}:{},x=d?"asc":a?.direction??(n===t.id?r:"asc"),y=!d&&(!!a||n===t.id);return g("th",{ref:u?m:void 0,className:`orb-table-head-cell ${t.numeric?"orb-num":""} ${u?"orb-is-reorderable":""} ${C?"orb-is-dragging":""}`,"aria-sort":y?x==="asc"?"ascending":"descending":"none",onContextMenu:s?b=>s(b,t.id):void 0,style:{width:o,minWidth:o,maxWidth:o,...g$1},...u?h:{},...u?f$1:{},children:[d?f("span",{className:"orb-table-head-label",children:t.label}):f(Bd,{className:"orb-table-head-sort",active:y,direction:x,onClick:i,children:g("span",{className:"orb-table-head-label",children:[t.label,a&&f("span",{className:"orb-table-sort-priority",children:a.priority})]})}),f("div",{className:"orb-table-resize-handle",onMouseDown:c,onPointerDown:b=>b.stopPropagation(),onClick:b=>b.stopPropagation()})]})};var ki=t=>{let{t:o}=de(),{visibleRows:r,visibleColumns:n,selected:a=[],handleClick:i,columns:s,toggleGroupExpand:c,expandedGroups:u=new Set,selectionMode:d,grouping:m=[],isGroupFullyExpanded:h,handleExpandGroupRecursively:f$1,handleCollapseGroupRecursively:p,emptyLabel:v,getRowDataKey:C,getRowProps:g$1,getGroupRowProps:x}=t,y=T=>a.indexOf(T)!==-1,b=d==="multiple"||d==="single",k=m.length>0,w=n.length+(b?1:0)+(k?1:0);return g("tbody",{children:[r.map((T,I)=>{if(T.type==="group"){let S=u.has(T.id),D=T.childIds||[],R=D.filter(z=>y(z)).length,M=D.length>0&&R===D.length,P=R>0&&R<D.length,A={entry:T,data:T,id:T.id,index:I,selected:M,group:true},L=x?.(A)||{},{className:W,onClick:j,...O}=L,_=z=>{if(z.stopPropagation(),!!t.onSelectionChange)if(M){let Y=a.filter(H=>!D.includes(H));t.onSelectionChange(Y);}else {let Y=Array.from(new Set([...a,...D]));t.onSelectionChange(Y);}};return g("tr",{...O,"data-ctable-row-key":C?.(A),className:["orb-table-group-row",W].filter(Boolean).join(" "),onClick:j,sx:z=>({backgroundColor:"var(--orb-surface)","& th, & td":{color:z.palette.text.primary,borderBottomColor:z.palette.divider},"& .orb-icon-btn":{color:z.palette.text.primary},"& .orb-chk":{color:z.palette.text.secondary},"& .orb-chk:has(input:checked), & .orb-chk:has(input:indeterminate)":{color:z.palette.primary.main}}),children:[b&&f("td",{padding:"checkbox",sx:fl,children:f(Tt,{size:"small",checked:M,indeterminate:P,onChange:_,onClick:z=>z.stopPropagation(),sx:ta})}),k&&f("td",{padding:"checkbox",sx:bl,children:g("div",{sx:Ip,children:[m.length>1&&T.level<m.length-1&&f(ct,{title:h?.(T.id)?o("table.group.collapseAll"):o("table.group.expandAll"),children:f(le,{size:"small",onClick:()=>{h?.(T.id)?p?.(T.id):f$1?.(T.id);},sx:oa,children:h?.(T.id)?f(fi,{}):f(bi,{})})}),f(le,{size:"small",onClick:()=>c&&c(T.id),sx:oa,children:S?f($o,{}):f(Sr,{})})]})}),f("td",{colSpan:n.length,sx:{py:1,pl:T.level*3+1},children:g(E,{variant:"body2",fontWeight:"bold",color:"text.primary",sx:{fontSize:"0.85rem"},children:[T.field,": ",T.value," (",T.count,")"]})})]},T.id)}else {let S=T.data||T,D=T.id||S.id||I,R=y(D),M=`enhanced-table-checkbox-${I}`,P={entry:T,data:S,id:D,index:I,selected:R,group:false},A=g$1?.(P)||{},{className:L,onClick:W,...j}=A,_=(T.level!==void 0?T.level:0)*4;return g("tr",{...j,"data-ctable-row-key":C?.(P),className:[R?"orb-is-selected":"",L].filter(Boolean).join(" "),onClick:z=>{W?.(z),z.defaultPrevented||i?.(z,S);},role:b?"checkbox":j.role,"aria-checked":b?R:j["aria-checked"],tabIndex:j.tabIndex??-1,children:[b&&f("td",{padding:"checkbox",sx:fl,children:f(Tt,{color:"primary",checked:R,inputProps:{"aria-labelledby":M},sx:ta})}),k&&f("td",{padding:"checkbox",sx:bl}),s.filter(z=>n.includes(z.id)).map((z,Y)=>{let B=Y===0&&_>0?{pl:_+2}:{};return f("td",{className:z.numeric?"orb-num":void 0,align:z.numeric?"right":"left",sx:B,children:z.render?z.render(S[z.id],S):(function(){let Z=S[z.id];if(z.numeric){if(typeof Z=="number")return Z.toLocaleString();if(typeof Z=="string"&&Z.trim()!==""&&!isNaN(Number(Z)))return Number(Z).toLocaleString()}return Z})()},z.id)})]},D)}}),r.length===0&&f("tr",{children:f("td",{colSpan:w,align:"center",children:v??o("common.noData")})})]})};var Rp=t=>{let{columns:o=[],visibleColumns:r,summaryRow:n,selectionMode:a,grouping:i=[],columnWidths:s={}}=t;if(!t.showSummary)return null;let c=a==="multiple"||a==="single",u=i.length>0,d=o.filter(m=>r.includes(m.id));return f("tfoot",{className:"orb-table-footer",style:{zIndex:t.zIndex},children:g("tr",{children:[c&&f("td",{className:"orb-table-footer-control",style:{width:56,minWidth:56,maxWidth:56}}),u&&f("td",{className:"orb-table-footer-control",style:{width:72,minWidth:72,maxWidth:72}}),d.map(m=>f("td",{className:`orb-table-footer-cell ${m.numeric?"orb-num":""}`,style:{width:s[m.id]||m.minWidth||100,minWidth:s[m.id]||m.minWidth||100,maxWidth:s[m.id]||m.minWidth||100},children:(function(){let f=n[m.id];return f==null||f===""?"":typeof f=="number"?f.toLocaleString():typeof f=="string"&&f.trim()!==""&&!isNaN(Number(f))?Number(f).toLocaleString():f})()},m.id))]})})};var Np=t=>{let{t:o}=de();return f("div",{sx:{p:2},children:f(E,{children:o("table.mobile.notImplemented")})})};var dn=({groupAnchorEl:t,setGroupAnchorEl:o,grouping:r,setGrouping:n,columns:a})=>{let{t:i}=de(),[s,c]=useState(r);useEffect(()=>{t&&c(r);},[t,r]);let u=()=>{c(r),o(null);},d=h=>{c(f=>f.includes(h)?f.filter(p=>p!==h):[...f,h]);},m=()=>{n(s),o(null);};return g(Qt,{anchorEl:t,open:!!t,onClose:u,sx:{width:224,minWidth:224,maxHeight:360,overflowY:"auto"},children:[g("div",{className:"orb-table-group-menu-header",onClick:h=>h.stopPropagation(),children:[f(E,{className:"orb-table-group-menu-title",variant:"subtitle2",children:i("table.menu.groupBy")}),s.length>0&&f(Me,{className:"orb-table-group-menu-clear",size:"small",color:"error",onClick:h=>{h.stopPropagation(),c([]);},children:i("table.menu.clearAll")})]}),f(Rt,{className:"orb-table-group-menu-divider"}),a.map(h=>{let f$1=s.includes(h.id),p=s.indexOf(h.id)+1;return f("option",{className:"orb-table-group-menu-option",selected:f$1,onClick:v=>{v.stopPropagation(),d(h.id);},children:g("div",{className:"orb-table-group-menu-option-content",children:[f(Tt,{className:"orb-table-group-menu-checkbox",checked:f$1,size:"small"}),f(_t,{className:"orb-table-group-menu-label",primary:h.label}),f$1&&f("span",{className:"orb-table-group-menu-order","aria-label":`${i("table.menu.groupBy")} ${p}`,children:p})]})},h.id)}),g("div",{className:"orb-table-group-menu-footer",children:[f(Me,{size:"small",variant:"ghost",onClick:u,children:i("common.cancel")}),f(Me,{size:"small",variant:"primary",onClick:m,children:i("common.ok")})]})]})},pn=({anchorEl:t,setAnchorEl:o,columns:r,visibleColumns:n,toggleColumnVisibility:a})=>{let{t:i}=de();return g(Qt,{anchorEl:t,open:!!t,onClose:()=>o(null),children:[f("option",{disabled:true,children:f(_t,{primary:i("table.menu.visibleColumns")})}),f(Rt,{}),r.map(s=>g("option",{onClick:()=>a(s.id),children:[f(Tt,{checked:n.includes(s.id),size:"small"}),f(_t,{primary:s.label})]},s.id))]})},Pi=({anchorEl:t,setAnchorEl:o,showSummary:r,setShowSummary:n,columns:a,summaryColumns:i,toggleSummaryColumn:s})=>{let{t:c}=de();return g(Qt,{anchorEl:t,open:!!t,onClose:()=>o(null),children:[f("option",{children:f(Jn,{control:f(ii,{checked:r,onChange:u=>n(u.target.checked),size:"small"}),label:c("table.menu.showSummaryRow")})}),f(Rt,{}),a.filter(u=>u.numeric).map(u=>g("option",{onClick:()=>s(u.id),disabled:!r,children:[f(Tt,{checked:i.includes(u.id),size:"small"}),f(_t,{primary:u.label})]},u.id)),a.filter(u=>u.numeric).length===0&&f("option",{disabled:true,children:f(_t,{primary:c("table.menu.noNumericColumns")})})]})},Ti=({contextMenu:t,handleCloseContextMenu:o,columns:r,visibleColumns:n,toggleColumnVisibility:a})=>{let{t:i}=de();return g(Qt,{open:t!==null,onClose:o,anchorReference:"anchorPosition",anchorPosition:t!==null?{top:t.mouseY,left:t.mouseX}:void 0,children:[f("option",{onClick:o,children:i("common.copy")}),f(Rt,{}),f("option",{disabled:true,children:i("table.menu.visibleColumns")}),r.map(s=>g("option",{onClick:()=>a(s.id),children:[f(Wo,{children:n.includes(s.id)&&f(Zd,{fontSize:"small"})}),f(_t,{children:s.label})]},s.id))]})},Lp=({contextMenu:t,handleClose:o,columns:r,visibleColumns:n,grouping:a,summaryColumns:i,showSummary:s,sortBy:c,orderBy:u,order:d,onSortAsc:m,onSortDesc:h,onClearSort:f$1,onHideColumn:p,onToggleGroup:v,onToggleSummary:C,onOpenSortDialog:g$1})=>{let{t:x}=de(),y=t?.columnId??"",b=r.find(M=>M.id===y),k=a.includes(y),w=i.includes(y),T=!!b?.numeric,I=c.find(M=>M.field===y),S=I?I.direction==="asc":u===y&&d==="asc",D=I?I.direction==="desc":u===y&&d==="desc",R=S||D;return g(Qt,{open:t!==null,onClose:o,anchorReference:"anchorPosition",anchorPosition:t!==null?{top:t.mouseY,left:t.mouseX}:void 0,children:[f("option",{disabled:true,sx:{opacity:"1 !important",fontWeight:700},children:f(_t,{primary:b?.label??y})}),f(Rt,{}),g("option",{onClick:()=>{m(y),o();},selected:S,children:[f(Wo,{children:f(gl,{fontSize:"small"})}),f(_t,{primary:x("table.headerMenu.sortAsc")})]}),g("option",{onClick:()=>{h(y),o();},selected:D,children:[f(Wo,{children:f(ml,{fontSize:"small"})}),f(_t,{primary:x("table.headerMenu.sortDesc")})]}),R&&g("option",{onClick:()=>{f$1(y),o();},children:[f(Wo,{children:f(Qd,{fontSize:"small"})}),f(_t,{primary:x("table.headerMenu.clearSort")})]}),g("option",{onClick:()=>{g$1(),o();},children:[f(Wo,{children:f(Br,{fontSize:"small"})}),f(_t,{primary:x("table.headerMenu.configureSort")})]}),f(Rt,{}),g("option",{onClick:()=>{v(y),o();},selected:k,children:[f(Wo,{children:f(xr,{fontSize:"small"})}),f(_t,{primary:x(k?"table.headerMenu.ungroup":"table.headerMenu.group")})]}),T&&s&&g("option",{onClick:()=>{C(y),o();},selected:w,children:[f(Wo,{children:f(an,{fontSize:"small"})}),f(_t,{primary:x(w?"table.headerMenu.removeSummary":"table.headerMenu.addSummary")})]}),f(Rt,{}),g("option",{onClick:()=>{p(y),o();},children:[f(Wo,{children:f(wp,{fontSize:"small"})}),f(_t,{primary:x("table.headerMenu.hideColumn")})]})]})},Op=({open:t,onClose:o,columns:r,initialRules:n,onApply:a,onClear:i})=>{let{t:s}=de(),[c,u]=useState([]);useEffect(()=>{t&&u(n.length>0?n.map(C=>({...C})):[]);},[t,n]);let d=useMemo(()=>new Set(c.map(C=>C.field)),[c]),m=useMemo(()=>r.filter(C=>!d.has(C.id)),[r,d]),h=()=>{let C=m[0];C&&u(g=>[...g,{field:C.id,direction:"asc"}]);},f$1=C=>{u(g=>g.filter((x,y)=>y!==C));},p=(C,g)=>{u(x=>x.map((y,b)=>b===C?{...y,...g}:y));},v=(C,g)=>{u(x=>{let y=C+g;if(y<0||y>=x.length)return x;let b=[...x],[k]=b.splice(C,1);return b.splice(y,0,k),b});};return f(Lt,{open:t,onClose:o,maxWidth:620,fullWidth:true,className:"orb-table-sort-dialog",title:s("table.sortDialog.title"),actions:g(e,{children:[f(Me,{className:"orb-table-sort-clear",variant:"neutral",disabled:c.length===0&&n.length===0,onClick:()=>{i(),o();},children:s("table.sortDialog.clearAll")}),f("span",{className:"orb-table-sort-action-spacer"}),f(Me,{variant:"neutral",onClick:o,children:s("common.cancel")}),f(Me,{variant:"primary",onClick:()=>{a(c),o();},children:s("common.ok")})]}),children:g("div",{className:"orb-table-sort-dialog-content",children:[c.length===0?f(E,{className:"orb-table-sort-empty",variant:"body2",children:s("table.sortDialog.empty")}):f(ce,{className:"orb-table-sort-rules",spacing:1,children:c.map((C,g$1)=>{let x=new Set(c.filter((b,k)=>k!==g$1).map(b=>b.field)),y=r.filter(b=>!x.has(b.id));return g("div",{className:"orb-table-sort-rule",children:[f(ai,{className:"orb-table-sort-order",badgeContent:g$1+1,color:"primary"}),f(zt,{size:"small",value:C.field,onChange:b=>p(g$1,{field:b.target.value}),options:y.map(b=>({value:b.id,label:b.label}))}),f(zt,{size:"small",value:C.direction,onChange:b=>p(g$1,{direction:b.target.value}),options:[{value:"asc",label:s("table.sortDialog.asc")},{value:"desc",label:s("table.sortDialog.desc")}]}),f(le,{className:"orb-table-sort-icon-button",size:"small",onClick:()=>v(g$1,-1),disabled:g$1===0,children:f(gl,{fontSize:"small"})}),f(le,{className:"orb-table-sort-icon-button",size:"small",onClick:()=>v(g$1,1),disabled:g$1===c.length-1,children:f(ml,{fontSize:"small"})}),f(le,{className:"orb-table-sort-icon-button orb-table-sort-delete",size:"small",onClick:()=>f$1(g$1),children:f(di,{fontSize:"small"})})]},`sort-rule-${g$1}`)})}),f(Me,{size:"small",onClick:h,disabled:m.length===0,startIcon:f(Br,{}),variant:"secondary",className:"orb-table-sort-add",children:s("table.sortDialog.addRule")})]})})};var ra=(t,o=2)=>t.toLocaleString(void 0,{maximumFractionDigits:o}),Fp=({kpis:t})=>{let{t:o}=de(),r=[{label:o("graph.kpi.totalRecords"),value:ra(t.totalRecords,0),color:"var(--orb-fg)"},{label:o("graph.kpi.totalReport"),value:ra(t.totalReportHours),color:"var(--orb-fg)"},{label:o("graph.kpi.totalBillable"),value:ra(t.totalBillableHours),color:"var(--orb-primary)"},{label:o("graph.kpi.efficiency"),value:`${t.efficiency.toFixed(2)}%`,color:"var(--orb-accent)"},{label:o("graph.kpi.amount"),value:ra(t.totalAmount),color:"var(--orb-primary)"},{label:o("graph.kpi.flagged"),value:ra(t.flaggedCount,0),color:"var(--orb-err)"}];return f("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(140px, 1fr))",gap:12},children:r.map(n=>g(Le,{elevation:0,sx:{padding:12,minHeight:96,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[f(E,{variant:"caption",muted:true,children:n.label}),f(E,{variant:"h3",sx:{fontWeight:800,color:n.color,fontVariantNumeric:"tabular-nums"},children:n.value})]},n.label))})};var Mi=({title:t,subtitle:o,children:r})=>g(Le,{elevation:0,sx:{padding:16},children:[f(E,{variant:"h4",sx:{fontWeight:700},children:t}),o&&f(E,{variant:"body2",muted:true,sx:{marginBottom:16},children:o}),r]});var na=({data:t,orientation:o="horizontal",valueSuffix:r="",minHeight:n=210,activeName:a,onItemClick:i})=>{if(t.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let s=Math.max(...t.map(c=>c.value),1);return o==="vertical"?f("div",{style:{display:"flex",gap:1,alignItems:"flex-end",minHeight:n},children:t.map(c=>g("div",{style:{flex:1,minWidth:0},children:[f("div",{onClick:()=>i?.(c),sx:{height:`${Math.max(c.value/s*180,6)}px`,background:c.name===a?"primary.dark":"primary.main",borderRadius:"8px 8px 0 0",cursor:i?"pointer":"default",opacity:a&&c.name!==a?.45:1}}),f(E,{variant:"caption",title:c.name,sx:{display:"block",mt:.5},children:c.name}),g(E,{variant:"caption",muted:true,children:[c.value.toFixed(1),r]})]},c.name))}):f(ce,{spacing:1,children:t.map(c=>g("div",{style:{display:"grid",gridTemplateColumns:"140px 1fr 64px",gap:1},children:[f(E,{variant:"caption",muted:true,title:c.name,children:c.name}),f("div",{onClick:()=>i?.(c),sx:{alignSelf:"center",background:"action.hover",height:10,borderRadius:999,overflow:"hidden",cursor:i?"pointer":"default",opacity:a&&c.name!==a?.45:1},children:f("div",{style:{width:`${c.value/s*100}%`,height:"100%",background:c.name===a?"primary.dark":"primary.main"}})}),g(E,{variant:"caption",sx:{textAlign:"right",fontWeight:600},children:[c.value.toFixed(1),r]})]},c.name))})};var Bp=({data:t,color:o="var(--orb-chart-1)",valueSuffix:r="",height:n=220})=>{if(t.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let a=640,i=28,s=t.map(f=>f.value),c=Math.min(...s,0),d=Math.max(...s,1)-c||1,m=t.map((f,p)=>{let v=i+p*(a-i*2)/Math.max(t.length-1,1),C=n-i-(f.value-c)/d*(n-i*2);return {x:v,y:C,...f}}),h=m.map(f=>`${f.x},${f.y}`).join(" ");return g("div",{children:[g("div",{component:"svg",viewBox:`0 0 ${a} ${n}`,style:{width:"100%",height:n},children:[f("line",{x1:i,y1:n-i,x2:a-i,y2:n-i,style:{stroke:"var(--orb-chart-grid)"}}),f("polyline",{fill:"none",style:{stroke:o},strokeWidth:3,points:h}),m.map(f$1=>f("circle",{cx:f$1.x,cy:f$1.y,r:4,style:{fill:o}},f$1.name))]}),f("div",{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`,gap:1},children:t.map(f$1=>g("div",{style:{minWidth:0},children:[f(E,{variant:"caption",title:f$1.name,sx:{display:"block"},children:f$1.name}),g(E,{variant:"caption",muted:true,children:[f$1.value.toFixed(1),r]})]},f$1.name))})]})};var Hp=({data:t,barColor:o="var(--orb-chart-1)",lineColor:r="var(--orb-chart-5)",height:n=220})=>{if(t.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let a=640,i=28,s=Math.max(...t.map(m=>m.barValue),1),c=Math.max(...t.map(m=>m.lineValue),1),u=t.map((m,h)=>{let f=(a-i*2)/t.length,p=Math.max(f*.5,8),v=i+h*f+(f-p)/2,C=m.barValue/s*(n-i*2),g=n-i-C;return {x:v,y:g,barHeight:C,barWidth:p,item:m}}),d=t.map((m,h)=>{let f=(a-i*2)/t.length,p=i+h*f+f/2,v=n-i-m.lineValue/c*(n-i*2);return {x:p,y:v,item:m}});return g(ce,{spacing:1.25,children:[g("div",{component:"svg",viewBox:`0 0 ${a} ${n}`,style:{width:"100%",height:n},children:[f("line",{x1:i,y1:n-i,x2:a-i,y2:n-i,style:{stroke:"var(--orb-chart-grid)"}}),u.map(m=>f("rect",{x:m.x,y:m.y,width:m.barWidth,height:Math.max(m.barHeight,4),rx:6,style:{fill:o}},m.item.name)),f("polyline",{fill:"none",style:{stroke:r},strokeWidth:3,points:d.map(m=>`${m.x},${m.y}`).join(" ")}),d.map(m=>f("circle",{cx:m.x,cy:m.y,r:3.5,style:{fill:r}},`${m.item.name}-line`))]}),f("div",{style:{display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`,gap:1},children:t.map(m=>g("div",{style:{minWidth:0},children:[f(E,{variant:"caption",title:m.name,sx:{display:"block"},children:m.name}),g(E,{variant:"caption",muted:true,sx:{display:"block"},children:["Bar: ",m.barValue.toFixed(1)]}),g(E,{variant:"caption",muted:true,sx:{display:"block"},children:["Line: ",m.lineValue.toFixed(1)]})]},m.name))})]})};var eb=t=>{let r=.2+Math.max(0,Math.min(1,t))*.8;return `color-mix(in oklch, var(--orb-chart-1) ${Math.round(r*100)}%, transparent)`},zp=({data:t})=>{if(t.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let o=Array.from(new Set(t.map(i=>i.x))),r=Array.from(new Set(t.map(i=>i.y))),n=Math.max(...t.map(i=>i.value),1),a=new Map(t.map(i=>[`${i.y}__${i.x}`,i.value]));return f("div",{style:{overflowX:"auto"},children:g("div",{style:{display:"grid",gridTemplateColumns:`120px repeat(${o.length}, minmax(64px, 1fr))`,gap:1,minWidth:120+o.length*64},children:[f("div",{}),o.map(i=>f(E,{variant:"caption",sx:{textAlign:"center",fontWeight:600},children:i},i)),r.map(i=>g("div",{style:{display:"contents"},children:[f(E,{variant:"caption",sx:{alignSelf:"center"},children:i}),o.map(s=>{let c=a.get(`${i}__${s}`)||0,u=c/n;return f("div",{sx:{height:36,borderRadius:1,background:eb(u),border:"1px solid color-mix(in oklch, var(--orb-muted) 20%, transparent)",display:"flex",alignItems:"center",justifyContent:"center"},children:f(E,{variant:"caption",sx:{fontWeight:700},children:c.toFixed(1)})},`${i}-${s}`)})]},i))]})})};var tb=["var(--orb-chart-1)","var(--orb-chart-2)","var(--orb-chart-5)","var(--orb-chart-negative)","var(--orb-chart-4)","var(--orb-chart-3)"],Ii=({data:t,variant:o="donut",colors:r=tb,size:n=180,activeName:a,onItemClick:i})=>{if(t.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let s=0,c=t.map((u,d)=>{let m=s;return s+=u.percent,`${r[d%r.length]} ${m}% ${s}%`});return g(ce,{direction:{xs:"column",sm:"row"},spacing:2,alignItems:"center",children:[f("div",{style:{width:n,height:n,borderRadius:"50%",background:`conic-gradient(${c.join(", ")})`,position:"relative",flexShrink:0},children:o==="donut"&&f("div",{style:{position:"absolute",inset:Math.round(n*.18),background:"background.paper",borderRadius:"50%"}})}),f(ce,{spacing:1,sx:{minWidth:180},children:t.map((u,d)=>g("div",{onClick:()=>i?.(u),sx:{display:"flex",alignItems:"center",gap:1,cursor:i?"pointer":"default",opacity:a&&u.name!==a?.45:1},children:[f("div",{style:{width:10,height:10,borderRadius:"50%",background:r[d%r.length]}}),f(E,{variant:"caption",sx:{flex:1},children:u.name}),g(E,{variant:"caption",sx:{fontWeight:700},children:[u.percent.toFixed(0),"%"]})]},u.name))})]})};var Vp=({effect:t,branches:o})=>{if(o.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let r=o.filter((a,i)=>i%2===0),n=o.filter((a,i)=>i%2===1);return g(ce,{spacing:1.5,children:[f("div",{style:{display:"grid",gridTemplateColumns:`repeat(${Math.max(r.length,1)}, minmax(0, 1fr))`,gap:1},children:r.map(a=>g("div",{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[f(E,{variant:"caption",sx:{fontWeight:700},children:a.title}),a.causes.map(i=>f(E,{variant:"caption",muted:true,sx:{display:"block"},children:i},i))]},a.title))}),g("div",{style:{position:"relative",height:32},children:[f("div",{style:{position:"absolute",inset:"50% 0 auto 0",borderTop:"2px solid",borderColor:"primary.main"}}),f("div",{sx:{position:"absolute",right:0,top:"calc(50% - 12px)",px:1,py:.25,borderRadius:1,background:"primary.main",color:"primary.contrastText"},children:f(E,{variant:"caption",sx:{fontWeight:700},children:t})})]}),f("div",{style:{display:"grid",gridTemplateColumns:`repeat(${Math.max(n.length,1)}, minmax(0, 1fr))`,gap:1},children:n.map(a=>g("div",{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[f(E,{variant:"caption",sx:{fontWeight:700},children:a.title}),a.causes.map(i=>f(E,{variant:"caption",muted:true,sx:{display:"block"},children:i},i))]},a.title))})]})};var Wp=({data:t,height:o=240})=>{if(t.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let r=0,n=t.map(h=>{let f=h.type==="total"?0:r,p=h.type==="total"?h.value:r+h.value;return h.type!=="total"&&(r=p),{...h,start:f,end:p,delta:p-f}}),a=n.flatMap(h=>[h.start,h.end]),i=Math.min(...a,0),s=Math.max(...a,1),c=680,u=30,d=s-i||1,m=h=>o-u-(h-i)/d*(o-u*2);return g("div",{children:[g("div",{component:"svg",viewBox:`0 0 ${c} ${o}`,style:{width:"100%",height:o},children:[f("line",{x1:u,y1:m(0),x2:c-u,y2:m(0),style:{stroke:"var(--orb-chart-grid)"}}),n.map((h,f$1)=>{let p=(c-u*2)/n.length,v=Math.max(p*.55,8),C=u+f$1*p+(p-v)/2,g$1=m(Math.max(h.start,h.end)),x=m(Math.min(h.start,h.end)),y=h.type==="total"?"var(--orb-chart-1)":h.delta>=0?"var(--orb-chart-positive)":"var(--orb-chart-negative)";return g("g",{children:[f("rect",{x:C,y:g$1,width:v,height:Math.max(x-g$1,4),rx:6,style:{fill:y}}),f("text",{x:C+v/2,y:g$1-6,textAnchor:"middle",fill:"currentColor",fontSize:"11",children:h.end.toFixed(1)})]},h.name)})]}),f("div",{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${n.length}, minmax(0, 1fr))`,gap:1},children:n.map(h=>f(E,{variant:"caption",title:h.name,children:h.name},h.name))})]})};var aa=({apiKey:t,query:o,zoom:r=14,mapType:n="roadmap"})=>{let a=encodeURIComponent(o);return `https://www.google.com/maps/embed/v1/place?key=${encodeURIComponent(t)}&q=${a}&zoom=${r}&maptype=${n}`},TR=(t,o=360)=>{let r=aa(t);return `<iframe width="100%" height="${o}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${r}"></iframe>`};var $p=({apiKey:t,query:o,embedUrl:r,zoom:n=14,mapType:a="roadmap",height:i=320})=>{let s=r||(t&&o?aa({apiKey:t,query:o,zoom:n,mapType:a}):"");return s?g("div",{children:[f("div",{component:"iframe",src:s,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:i,border:0,borderRadius:2}}),g(E,{variant:"caption",muted:true,sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",f("a",{href:s,target:"_blank",rel:"noreferrer",children:"Google Maps"})]})]}):f("div",{children:f(E,{variant:"body2",muted:true,children:"Google Map requires `embedUrl` or (`apiKey` + `query`)."})})};var Ri=({keyword:t,location:o,src:r="orbcafe-ui"})=>{if(o){let n=encodeURIComponent(o.name||t||"Location");return `https://uri.amap.com/marker?position=${o.lng},${o.lat}&name=${n}&src=${encodeURIComponent(r)}&coordinate=gaode&callnative=0`}return t?`https://uri.amap.com/search?keyword=${encodeURIComponent(t)}&src=${encodeURIComponent(r)}&callnative=0`:"https://uri.amap.com/search?keyword=%E5%8C%97%E4%BA%AC&src=orbcafe-ui&callnative=0"};var _p=({keyword:t,location:o,embedUrl:r,height:n=320})=>{let a=r||Ri({keyword:t,location:o?{lng:o.lng,lat:o.lat,name:o.name}:void 0});return g("div",{children:[f("div",{component:"iframe",src:a,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:n,border:0,borderRadius:2}}),g(E,{variant:"caption",muted:true,sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",f("a",{href:a,target:"_blank",rel:"noreferrer",children:"AMap"})]})]})};var Gp=({billableByPrimary:t,efficiencyBySecondary:o,statusDistribution:r,interaction:n})=>{let{t:a}=de();return g("div",{style:{display:"grid",gap:12,gridTemplateColumns:"repeat(auto-fit, minmax(320px, 1fr))"},children:[f(Mi,{title:a("graph.chart.billable.title"),subtitle:a("graph.chart.billable.subtitle"),children:f(na,{data:t,orientation:"horizontal",activeName:n?.filters?.primaryDimension,onItemClick:i=>n?.onPrimaryDimensionClick?.(i.name)})}),f(Mi,{title:a("graph.chart.efficiency.title"),subtitle:a("graph.chart.efficiency.subtitle"),children:f(na,{data:o,orientation:"vertical",valueSuffix:"%",activeName:n?.filters?.secondaryDimension,onItemClick:i=>n?.onSecondaryDimensionClick?.(i.name)})}),f(Mi,{title:a("graph.chart.status.title"),subtitle:a("graph.chart.status.subtitle"),children:f(Ii,{data:r,variant:"donut",activeName:n?.filters?.status,onItemClick:i=>n?.onStatusClick?.(i.name)})})]})};var rb=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],nb=["zh","en","de","fr","ja","ko"],Up=({open:t,onClose:o,value:r,onSaveAll:n,modelOptions:a=rb,promptLangOptions:i=nb,analysisTemplateOptions:s=[],responseTemplateOptions:c=[],defaultAnalysisTemplateId:u,defaultResponseTemplateId:d})=>{let[m,h]=useState(r),[f$1,p]=useState(u||""),[v,C]=useState(d||""),[g$1,x]=useState(false);useEffect(()=>{t&&(h(r),p(u||""),C(d||""));},[t,r,u,d]);let y=(k,w)=>{h(T=>({...T,[k]:w}));},b=async()=>{if(n)try{x(!0),await n({settings:m,analysisTemplateId:f$1||void 0,responseTemplateId:v||void 0});}finally{x(false);}};return g(Lt,{open:t,onClose:o,fullWidth:true,maxWidth:"lg",children:[g("div",{className:"orb-dialog-title",sx:{pr:7,pb:2.2},children:[f(E,{variant:"h5",sx:{fontWeight:800},children:"AI Settings"}),f(E,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:"Configure LLM settings and editable agent prompts by language."}),f(le,{onClick:o,sx:{position:"absolute",right:12,top:12},children:f(wr,{})})]}),f("div",{className:"orb-dialog-content",sx:{pt:"18px !important"},children:g(ce,{spacing:2.2,children:[g("div",{sx:{mt:.8,display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",md:"repeat(2, minmax(0, 1fr))"}},children:[f("div",{children:f(We,{size:"small",value:m.baseUrl,onChange:k=>y("baseUrl",k.target.value),fullWidth:true,label:"Base URL"})}),f("div",{children:f(We,{size:"small",type:"password",value:m.apiKey,onChange:k=>y("apiKey",k.target.value),fullWidth:true,label:"API Key"})}),f("div",{children:f(We,{size:"small",value:m.model,onChange:k=>y("model",k.target.value),fullWidth:true,select:true,label:"Model",children:a.map(k=>f("option",{value:k,children:k},k))})}),f("div",{children:f(We,{size:"small",value:m.promptLang,onChange:k=>y("promptLang",k.target.value),fullWidth:true,select:true,label:"Prompt Lang",children:i.map(k=>f("option",{value:k,children:k},k))})})]}),g("div",{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[g(We,{size:"small",value:f$1,onChange:k=>p(k.target.value),fullWidth:true,select:true,label:"Analysis Template",children:[f("option",{value:"",children:"Default"}),s.map(k=>f("option",{value:k.id,children:k.label},k.id))]}),f($n,{multiline:true,minRows:8,value:m.analysisPrompt,onChange:k=>y("analysisPrompt",k.target.value),fullWidth:true,label:"Analysis Prompt",sx:{"& textarea":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}}),g(We,{size:"small",value:v,onChange:k=>C(k.target.value),fullWidth:true,select:true,label:"Response Template",children:[f("option",{value:"",children:"Default"}),c.map(k=>f("option",{value:k.id,children:k.label},k.id))]}),f($n,{multiline:true,minRows:8,value:m.responsePrompt,onChange:k=>y("responsePrompt",k.target.value),fullWidth:true,label:"Response Prompt",sx:{"& textarea":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}})]})]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2.5,pt:1.2,gap:1},children:[f(Me,{variant:"outlined",onClick:o,children:"Cancel"}),f(Me,{variant:"contained",onClick:b,disabled:!n||g$1,children:"Save"})]})]})};var Di=({open:t,onClose:o,model:r,tableContent:n,extraCharts:a,interaction:i,aiAssistant:s})=>{let{t:c}=de(),[u,d]=useState(s?.defaultPrompt||""),[m,h]=useState(false),[f$1,p]=useState(false),v=i?.enabled!==false&&!!i,C=s?.enabled!==false,g$1=i?.filters||{},x=!!(g$1.primaryDimension||g$1.secondaryDimension||g$1.status),y=s?.placeholder||"Ask AI to analyze data, create charts, or find insights...";useEffect(()=>{t&&d(s?.defaultPrompt||"");},[t,s?.defaultPrompt]);let b=s?.settings||{baseUrl:"/llm-api",apiKey:"",model:"doubao-lite",promptLang:"zh",analysisPrompt:"",responsePrompt:""},k=async()=>{let w=u.trim();if(!(!w||!s?.onSubmit))try{h(!0),await s.onSubmit(w,{filters:g$1,model:r});}finally{h(false);}};return f(Lt,{open:t,onClose:o,fullWidth:true,maxWidth:1400,hideCloseButton:true,children:g("div",{style:{height:"80vh",display:"flex",flexDirection:"column",background:"var(--orb-canvas)"},children:[f("div",{style:{padding:16,borderBottom:"1px solid var(--orb-border)"},children:g(ce,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:12,children:[g(ce,{direction:"row",spacing:10,alignItems:"center",sx:{flexWrap:"wrap"},children:[f(E,{variant:"h3",sx:{fontWeight:800},children:r.title}),f(Ct,{label:c("graph.records",{count:r.kpis.totalRecords})}),v&&g$1.primaryDimension&&f(Ct,{tone:"outline",label:`${i?.fieldMapping.primaryDimension}: ${g$1.primaryDimension}`,onDelete:()=>i?.onClearFilter("primaryDimension")}),v&&g$1.secondaryDimension&&f(Ct,{tone:"outline",label:`${i?.fieldMapping.secondaryDimension}: ${g$1.secondaryDimension}`,onDelete:()=>i?.onClearFilter("secondaryDimension")}),v&&g$1.status&&f(Ct,{tone:"outline",label:`${i?.fieldMapping.status}: ${g$1.status}`,onDelete:()=>i?.onClearFilter("status")}),v&&x&&f(Me,{size:"small",variant:"ghost",onClick:()=>i?.onClearAll(),children:"Clear"})]}),g(ce,{direction:"row",spacing:10,alignItems:"center",children:[C&&g("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 10px",borderRadius:999,border:"1px solid var(--orb-border)",background:"var(--orb-surface)",minWidth:320},children:[f(le,{size:"small",onClick:s?.onVoiceInput,children:f(Va,{size:16,strokeWidth:1.8})}),f("input",{className:"orb-inp orb-inp-dense",value:u,onChange:w=>d(w.target.value),onKeyDown:w=>{w.key==="Enter"&&(w.preventDefault(),k());},placeholder:y,style:{fontSize:14,border:"none",background:"transparent",flex:1,minWidth:0}}),f(le,{size:"small",onClick:k,disabled:m||!u.trim(),children:f(Jc,{size:16,strokeWidth:1.8})}),f(le,{size:"small",onClick:()=>p(true),children:f(en,{size:16,strokeWidth:1.8})})]}),f(le,{onClick:o,children:f(Kt,{size:18,strokeWidth:2})})]})]})}),g("div",{style:{padding:16,display:"flex",flexDirection:"column",gap:12,overflow:"auto",minHeight:0},children:[f(Fp,{kpis:r.kpis}),f(Gp,{billableByPrimary:r.charts.billableByPrimary,efficiencyBySecondary:r.charts.efficiencyBySecondary,statusDistribution:r.charts.statusDistribution,interaction:v?{filters:g$1,onPrimaryDimensionClick:w=>i?.onPrimaryDimensionClick(w),onSecondaryDimensionClick:w=>i?.onSecondaryDimensionClick(w),onStatusClick:w=>i?.onStatusClick(w)}:void 0}),a,n]}),f(Up,{open:f$1,onClose:()=>p(false),value:b,onSaveAll:s?.onSaveAll,modelOptions:s?.modelOptions,promptLangOptions:s?.promptLangOptions,analysisTemplateOptions:s?.analysisTemplateOptions,responseTemplateOptions:s?.responseTemplateOptions,defaultAnalysisTemplateId:s?.defaultAnalysisTemplateId,defaultResponseTemplateId:s?.defaultResponseTemplateId})]})})};var Mr={primaryDimension:["Client","Customer","Category","Project"],secondaryDimension:["Person","Consultant","Owner","Name"],status:["Status","state"],date:["Date","WorkDate","CreatedAt"],description:["Description","Task","Title","Memo"],reportHours:["Report_Hour","Report Hours","Hours","ReportHours"],billableHours:["Billable_Hour","Billable Hours","BillableHours"],amount:["Amount","Billable_Amount","Total_Amount","Value"]},ib=5,Kp=t=>t.toLowerCase().replace(/[\s_-]/g,""),Ir=(t,o,r,n)=>{if(o)return o;if(t.length===0)return n;let a=Object.keys(t[0]),i=new Map(a.map(s=>[Kp(s),s]));for(let s of r){let c=i.get(Kp(s));if(c)return c}return a[0]||n},Io=t=>{if(typeof t=="number")return Number.isFinite(t)?t:0;if(typeof t=="string"){let o=Number(t.replace(/,/g,"").trim());return Number.isFinite(o)?o:0}return 0},bo=(t,o)=>t==null||t===""?o:String(t),sb=(t,o,r,n,a)=>{let i=new Map;return t.forEach(s=>{let c=bo(s[o],a);i.set(c,(i.get(c)||0)+Io(s[r]));}),Array.from(i.entries()).map(([s,c])=>({name:s,value:c})).sort((s,c)=>c.value-s.value).slice(0,n)},lb=(t,o,r,n,a,i)=>{let s=new Map;return t.forEach(c=>{let u=bo(c[o],i),d=s.get(u)||{report:0,billable:0};d.report+=Io(c[r]),d.billable+=Io(c[n]),s.set(u,d);}),Array.from(s.entries()).map(([c,u])=>({name:c,value:u.report>0?u.billable/u.report*100:0})).sort((c,u)=>c.value-u.value).slice(0,a)},cb=(t,o,r)=>{let n=t.length;if(n===0)return [];let a=new Map;return t.forEach(i=>{let s=bo(i[o],r);a.set(s,(a.get(s)||0)+1);}),Array.from(a.entries()).map(([i,s])=>({name:i,value:s,percent:s/n*100}))},qp=(t,o,r)=>{let n=new Map;return t.forEach(a=>{let i=bo(a[o],"N/A");n.set(i,(n.get(i)||0)+Io(a[r]));}),Array.from(n.entries()).sort(([a],[i])=>a.localeCompare(i)).map(([a,i])=>({name:a,value:i}))},db=(t,o,r,n,a,i)=>{let s=new Map;return t.forEach(c=>{let u=bo(c[o],i),d=s.get(u)||{report:0,billable:0};d.report+=Io(c[r]),d.billable+=Io(c[n]),s.set(u,d);}),Array.from(s.entries()).map(([c,u])=>({name:c,barValue:u.billable,lineValue:u.report>0?u.billable/u.report*100:0})).sort((c,u)=>u.barValue-c.barValue).slice(0,a)},pb=(t,o,r,n,a)=>{let i=new Map;return t.forEach(s=>{let c=bo(s[o],a),u=bo(s[r],a),d=`${c}__${u}`;i.set(d,(i.get(d)||0)+Io(s[n]));}),Array.from(i.entries()).map(([s,c])=>{let[u,d]=s.split("__");return {x:u,y:d,value:c}})},ub=(t,o,r)=>{let n=qp(t,o,r),a=n.map(s=>({name:s.name,value:s.value,type:"delta"})),i=n.reduce((s,c)=>s+c.value,0);return [...a,{name:"Total",value:i,type:"total"}]},mb=(t,o,r,n,a,i)=>{let s=new Map;return t.forEach(c=>{let u=bo(c[o],i),d=`${bo(c[r],i)} / ${bo(c[n],i)}`,m=s.get(u)||new Map;m.set(d,(m.get(d)||0)+1),s.set(u,m);}),Array.from(s.entries()).map(([c,u])=>({title:c,causes:Array.from(u.entries()).sort((d,m)=>m[1]-d[1]).slice(0,a).map(([d,m])=>`${d} (${m})`)})).slice(0,6)},un=({rows:t,config:o})=>{let{t:r}=de(),n=r("graph.unassigned"),a=useMemo(()=>{let m=o?.fieldMapping;return {primaryDimension:Ir(t,m?.primaryDimension,Mr.primaryDimension,"Category"),secondaryDimension:Ir(t,m?.secondaryDimension,Mr.secondaryDimension,"Owner"),status:Ir(t,m?.status,Mr.status,"Status"),date:Ir(t,m?.date,Mr.date,"Date"),description:Ir(t,m?.description,Mr.description,"Description"),reportHours:Ir(t,m?.reportHours,Mr.reportHours,"ReportHours"),billableHours:Ir(t,m?.billableHours,Mr.billableHours,"BillableHours"),amount:Ir(t,m?.amount,Mr.amount,"Amount")}},[t,o?.fieldMapping]),i=useMemo(()=>t.map((m,h)=>{let f=Io(m[a.reportHours]),p=Io(m[a.billableHours]),v=Io(m[a.amount]),C=f>0?p/f*100:0;return {id:`graph-row-${h}`,Date:bo(m[a.date],""),Primary:bo(m[a.primaryDimension],n),Secondary:bo(m[a.secondaryDimension],n),Description:bo(m[a.description],""),ReportHours:f,BillableHours:p,Amount:v,Efficiency:C,Status:bo(m[a.status],n)}}),[t,a,n]),s=useMemo(()=>{let m=i.length,h=i.reduce((x,y)=>x+Io(y.ReportHours),0),f=i.reduce((x,y)=>x+Io(y.BillableHours),0),p=i.reduce((x,y)=>x+Io(y.Amount),0),v=h>0?f/h*100:0,C=o?.statusFlagValues||["flag","flagged","warning","risk"],g=i.filter(x=>C.includes(bo(x.Status,"").toLowerCase())).length;return {totalRecords:m,totalReportHours:h,totalBillableHours:f,efficiency:v,totalAmount:p,flaggedCount:g}},[i,o?.statusFlagValues]),c=o?.topN||ib,u=useMemo(()=>({billableByPrimary:sb(i,"Primary","BillableHours",c,n),efficiencyBySecondary:lb(i,"Secondary","ReportHours","BillableHours",c,n),statusDistribution:cb(i,"Status",n),lineByDate:qp(i,"Date","BillableHours"),comboByPrimary:db(i,"Primary","ReportHours","BillableHours",c,n),heatmapPrimarySecondary:pb(i,"Primary","Secondary","BillableHours",n),waterfallBillable:ub(i,"Date","BillableHours"),fishboneStatusCauses:mb(i,"Status","Primary","Secondary",3,n)}),[i,c,n]),d=useMemo(()=>({title:o?.title||r("graph.reportTitle"),kpis:s,charts:u,table:{columns:[{id:"Date",label:a.date},{id:"Primary",label:a.primaryDimension},{id:"Secondary",label:a.secondaryDimension},{id:"Description",label:a.description},{id:"ReportHours",label:r("graph.column.reportHours"),align:"right"},{id:"BillableHours",label:r("graph.column.billableHours"),align:"right"},{id:"Amount",label:"Amount",align:"right"},{id:"Efficiency",label:"Efficiency",align:"right"},{id:"Status",label:a.status}],rows:i}}),[u,o?.title,a,s,i,r]);return {fieldMapping:a,model:d}};var mn=t=>String(t??"").trim(),Ei=(t={})=>{let[o,r]=useState(t),n=useCallback((u,d)=>{r(m=>{let h=d?.trim();if(!h){let f={...m};return delete f[u],f}if(m[u]===h){let f={...m};return delete f[u],f}return {...m,[u]:h}});},[]),a=useCallback(u=>{r(d=>{if(!d[u])return d;let m={...d};return delete m[u],m});},[]),i=useCallback(()=>{r({});},[]),s=useMemo(()=>!!(o.primaryDimension||o.secondaryDimension||o.status),[o]),c=useCallback((u,d)=>u.filter(m=>!(o.primaryDimension&&mn(m[d.primaryDimension])!==mn(o.primaryDimension)||o.secondaryDimension&&mn(m[d.secondaryDimension])!==mn(o.secondaryDimension)||o.status&&mn(m[d.status])!==mn(o.status))),[o]);return {filters:o,setFilter:n,clearFilter:a,clearAll:i,hasActiveFilters:s,applyRows:c}};var Oi=({variants:t,currentVariantId:o,onLoad:r,onSave:n,onDelete:a,onSetDefault:i})=>{let{t:s}=de(),[c,u]=useState(false),[d,m]=useState(""),[h,f$1]=useState(false),[p,v]=useState(false),C=t.find(y=>y.id===o),g$1=()=>{m(C?.name||s("variant.newVariant")),f$1(C?.isDefault||false),v(C?.isPublic||false),u(true);},x=()=>{n({name:d,isDefault:h,isPublic:p,description:""}),u(false);};return g("div",{className:"orb-variant-management",children:[f(zt,{size:"small",fullWidth:false,sx:{width:"min(240px, 100%)","& .orb-inp":{fontSize:"0.85rem",backgroundColor:"var(--orb-p50)",borderColor:"color-mix(in oklch, var(--orb-primary) 30%, var(--orb-border))"}},value:o||"",options:[{value:"",label:s("variant.selectVariant"),disabled:true},...t.map(y=>({value:y.id,label:y.name+(y.isDefault?` (${s("variant.defaultSuffix")})`:"")}))],onChange:y=>{let b=t.find(k=>k.id===y.target.value);b&&r(b);}}),f(ct,{title:s("variant.saveView"),children:f(le,{className:"orb-variant-save-button",onClick:g$1,size:"small",color:"primary",children:f(kr,{fontSize:"small"})})}),g(Lt,{open:c,onClose:()=>u(false),children:[f("div",{className:"orb-dialog-title",children:s("variant.saveView")}),g("div",{className:"orb-dialog-content",children:[f(We,{autoFocus:true,margin:"dense",label:s("variant.viewName"),fullWidth:true,variant:"outlined",value:d,onChange:y=>m(y.target.value)}),f(Jn,{control:f(Tt,{checked:h,onChange:y=>f$1(y.target.checked)}),label:s("variant.setDefault")}),f(Jn,{control:f(Tt,{checked:p,onChange:y=>v(y.target.checked)}),label:s("variant.publicAllUsers")})]}),g("div",{className:"orb-dialog-actions",children:[f(Me,{onClick:()=>u(false),children:s("common.cancel")}),f(Me,{onClick:x,variant:"contained",children:s("common.save")})]})]})]})};var Zp=({appId:t,tableKey:o="default",currentFilters:r,currentLayoutId:n,layoutRefs:a,onLoad:i,variantService:s,serviceUrl:c,onError:u,onSuccess:d,currentVariantId:m,onVariantChange:h})=>{let{t:f$1}=de(),[p,v]=useState([]),[C,g]=useState(""),x=`orbcafe.variants.${t}.${o}`,y=m!==void 0?m:C,b=P=>{m===void 0&&g(P),h&&h(P);},k=useCallback(()=>{try{let P=localStorage.getItem(x);if(!P)return [];let A=JSON.parse(P);return Array.isArray(A)?A:[]}catch{return []}},[x]),w=useCallback(P=>{try{localStorage.setItem(x,JSON.stringify(P));}catch{}},[x]),T=useCallback(P=>{v(P);let A=P.find(L=>L.isDefault);A&&!y&&(b(A.id),i(A));},[y,i,b]),I=useCallback(async()=>{if(!t)return [];try{let P=[];if(s)P=await s.getVariants(t,o);else if(c){let A=await fetch(`${c}/api/variants?appId=${encodeURIComponent(t)}&tableKey=${encodeURIComponent(o)}`);if(!A.ok)throw new Error(f$1("variant.toast.fetchFailed"));P=await A.json();}else P=k();return T(P),P}catch(P){console.error("Error fetching variants",P);let A=k();return T(A),u&&u(f$1("variant.toast.fetchFailed")),A}},[t,o,s,c,k,T,u,f$1]);return useEffect(()=>{I();},[t,o]),f(Oi,{variants:p,currentVariantId:y,onLoad:P=>{b(P.id),i(P);},onSave:async P=>{let A=Date.now().toString(),L;try{let W=P.scope||"Both",j=p.find(Y=>Y.name===P.name);A=j?j.id:Date.now().toString();let O=[];if(j&&(Array.isArray(j.filters)?O=[...j.filters]:j.filters&&(O=[{scope:"default",filters:j.filters}])),W==="Search"||W==="Both"){let Y=(Array.isArray(r),r);if(Y)if(Array.isArray(Y)&&Y.length>0&&Y[0].scope)Y.forEach(H=>{let B=O.findIndex(q=>q.scope===H.scope);B>=0?O[B]=H:O.push(H);});else {let H={scope:o,filters:Y},B=O.findIndex(q=>q.scope===o);B>=0?O[B]=H:O.push(H);}}let _=j?.layout||{},z=[];if(j&&Array.isArray(j.layoutRefs)&&(z=[...j.layoutRefs]),W==="Layout"||W==="Both")if(a&&a.length>0)a.forEach(Y=>{let H=z.findIndex(B=>B.tableKey===Y.tableKey);H>=0?z[H]=Y:z.push(Y);});else {let Y={tableKey:o,layoutId:n||null},H=z.findIndex(B=>B.tableKey===o);H>=0?z[H]=Y:z.push(Y);}if(L={appId:t,tableKey:o,...P,scope:W,id:A,createdAt:new Date().toISOString(),filters:O,layout:_,layoutRefs:z},s)await s.saveVariant(L,t,o);else if(c){if(!(await fetch(`${c}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(L)})).ok)throw new Error(f$1("variant.toast.saveFailed"))}else {let H=p.some(B=>B.id===A)?p.map(B=>B.id===A?L:B):[...p,L];v(H),w(H);}d&&d(f$1("variant.toast.saveSuccess")),(s||c)&&await I(),b(A),i(L);}catch(W){console.error("Error saving variant",W);let O=p.some(_=>_.id===A)?p.map(_=>_.id===A?L:_):[...p,L];v(O),w(O),b(A),i(L),u&&u(f$1("variant.toast.saveFailed"));}},onDelete:async P=>{try{if(s)await s.deleteVariant(P);else if(c){if(!(await fetch(`${c}/api/variants/${P}`,{method:"DELETE"})).ok)throw new Error(f$1("variant.toast.deleteFailed"))}else {let A=p.filter(L=>L.id!==P);v(A),w(A);}y===P&&b(""),(s||c)&&I(),d&&d(f$1("variant.toast.deleteSuccess"));}catch(A){console.error("Error deleting variant",A);let L=p.filter(W=>W.id!==P);v(L),w(L),y===P&&b(""),u&&u(f$1("variant.toast.deleteFailed"));}},onSetDefault:async P=>{try{let A=p.find(W=>W.id===P);if(!A)return;let L={appId:t,tableKey:o,...A,isDefault:!0};if(s)await s.setDefaultVariant(P,t,o);else if(c){if(!(await fetch(`${c}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(L)})).ok)throw new Error(f$1("variant.toast.defaultFailed"))}else {let W=p.map(j=>({...j,isDefault:j.id===P}));v(W),w(W);}(s||c)&&await I(),d&&d(f$1("variant.toast.defaultSuccess"));}catch(A){console.error("Error setting default variant",A);let L=p.map(W=>({...W,isDefault:W.id===P}));v(L),w(L),u&&u(f$1("variant.toast.defaultFailed"));}}})};nr.extend(yb);nr.extend(Cb);nr.extend(nf);var sa="YYYY-MM-DD",wb=[null,null],zr="0.85rem",Sb={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},kb=({isInRange:t,isStart:o,isEnd:r,isHovered:n,disableMargin:a,sx:i,...s})=>{let c=io();return f(Wd,{...s,sx:[...Array.isArray(i)?i:i?[i]:[],t?{borderRadius:0,backgroundColor:c.palette.primary.light,color:c.palette.primary.contrastText}:{},n&&!t&&!o&&!r?{borderRadius:0,backgroundColor:c.palette.action.hover,border:`1px dashed ${c.palette.primary.main}`}:{},o?{borderRadius:"50% 0 0 50%",backgroundColor:c.palette.primary.main,color:c.palette.primary.contrastText}:{},r?{borderRadius:"0 50% 50% 0",backgroundColor:c.palette.primary.main,color:c.palette.primary.contrastText}:{},o&&r?{borderRadius:"50%"}:{}]})},Qp=({label:t,value:o=wb,onChange:r})=>{let{t:n,locale:a}=de(),i=Sb[a]||"en",s=t||n("dateRange.label"),[c,u]=useState(null),[d,m]=useState(o),[h,f$1]=useState("start"),[p,v]=useState(null),[C,g$1]=useState((o[0]||nr()).locale(i)),[x,y]=useState(""),[b,k]=useState(""),[w,T]=useState(false),[I,S]=useState(false),D=Jt__default.useRef(o);useEffect(()=>{let[Y,H]=o,[B,q]=D.current,Z=fe=>fe&&typeof fe.isSame=="function",ue=!(Y===null&&B===null||Z(Y)&&Z(B)&&Y.isSame(B,"day")),ne=!(H===null&&q===null||Z(H)&&Z(q)&&H.isSame(q,"day"));(ue||ne)&&(m(o),o[0]&&Z(o[0])&&g$1(o[0].locale(i))),D.current=o;},[o,i]),useEffect(()=>{y(d[0]?d[0].locale(i).format(sa):""),k(d[1]?d[1].locale(i).format(sa):""),T(false),S(false);},[d,i]);let R=(Y,H)=>{let B=H.trim(),q=Y==="start"?T:S;if(!B){let ne=Y==="start"?[null,d[1]]:[d[0],null];q(false),m(ne);return}let Z=nr(B,sa,true).locale(i);if(!Z.isValid()){q(true);return}q(false);let ue=[...d];if(Y==="start")ue[0]=Z,ue[1]&&Z.isAfter(ue[1],"day")&&(ue[1]=null),f$1(ue[1]?"start":"end");else {let ne=ue[0];ne&&Z.isBefore(ne,"day")?(ue=[Z,null],f$1("end")):(ue[1]=Z,f$1("start"));}m(ue),g$1(Z);},M=Y=>{u(Y.currentTarget);},P=()=>{u(null),f$1("start"),v(null);},A=!!c,L=Y=>{if(!Y)return;let H=[...d];if(h==="start")H=[Y,null],f$1("end");else {let B=H[0];B&&Y.isBefore(B)?(H=[Y,null],f$1("end")):(H=[B,Y],f$1("start"));}m(H);},W=Y=>{let H=nr().locale(i),B=[null,null];switch(Y){case "today":B=[H,H];break;case "week":B=[H.startOf("week"),H.endOf("week")];break;case "month":B=[H.startOf("month"),H.endOf("month")];break}m(B),f$1("start"),g$1(H);},j=()=>{r&&r(d),P();},O=()=>{m(o),f$1("start"),P();},_=useCallback(Y=>{let{day:H,...B}=Y,[q,Z]=d,ue=q?H.isSame(q,"day"):false,ne=Z?H.isSame(Z,"day"):false,fe=q&&Z?H.isBetween(q,Z,"day","()"):false,Ce=false;return h==="end"&&q&&!Z&&p&&H.isAfter(q,"day")&&H.isBefore(p.add(1,"day"),"day")&&(Ce=true),f(kb,{...B,day:H,disableMargin:true,isStart:ue,isEnd:ne,isInRange:fe||Ce,onMouseEnter:()=>v(H)})},[d,h,p]),z=Y=>Y?Y.locale(i).format("YYYY-MM-DD"):"";return g("div",{className:"orb-date-range-picker",children:[f(We,{className:"orb-date-range-field",label:s,value:d[0]?`${z(d[0])} - ${z(d[1])}`:"",onClick:M,fullWidth:true,size:"small",InputLabelProps:{sx:{fontSize:zr}},InputProps:{readOnly:true,sx:{fontSize:zr,"& .orb-inp":{fontSize:zr},paddingRight:"4px"},endAdornment:f(le,{className:"orb-date-range-calendar-trigger",size:"small",onClick:M,tooltip:s,children:f(Pt,{name:"calendar",size:16})})}}),g(si,{open:A,anchorEl:c,onClose:P,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},className:"orb-date-range-popover",children:[f("div",{className:"orb-date-range-inputs",children:g(ce,{className:"orb-date-range-input-row",direction:"row",alignItems:"center",spacing:1.5,justifyContent:"space-between",children:[f(We,{className:"orb-date-range-manual-field",label:n("dateRange.startDate"),placeholder:sa,value:x,error:w,size:"small",onFocus:()=>f$1("start"),onChange:Y=>{y(Y.target.value),w&&T(false);},onBlur:()=>R("start",x),onKeyDown:Y=>{Y.key==="Enter"&&(Y.preventDefault(),R("start",x));},sx:{"& .orb-inp":{fontSize:zr,py:.75},"& label":{fontSize:zr}}}),f(Ud,{color:"action",fontSize:"small"}),f(We,{className:"orb-date-range-manual-field",label:n("dateRange.endDate"),placeholder:sa,value:b,error:I,size:"small",onFocus:()=>{d[0]&&f$1("end");},onChange:Y=>{k(Y.target.value),I&&S(false);},onBlur:()=>R("end",b),onKeyDown:Y=>{Y.key==="Enter"&&(Y.preventDefault(),R("end",b));},sx:{"& .orb-inp":{fontSize:zr,py:.75},"& label":{fontSize:zr}}})]})}),f("div",{className:"orb-date-range-shortcuts",children:g(ce,{direction:"row",spacing:1,justifyContent:"center",children:[f(Ct,{label:n("dateRange.today"),onClick:()=>W("today"),clickable:true,size:"small",variant:"outlined"}),f(Ct,{label:n("dateRange.thisWeek"),onClick:()=>W("week"),clickable:true,size:"small",variant:"outlined"}),f(Ct,{label:n("dateRange.thisMonth"),onClick:()=>W("month"),clickable:true,size:"small",variant:"outlined"})]})}),f("div",{className:"orb-date-range-calendar",children:f(_d,{dateAdapter:ri,adapterLocale:i,children:f($d,{value:null,referenceDate:C,onMonthChange:g$1,onYearChange:g$1,onChange:L,slots:{day:_},views:["year","month","day"],openTo:"day",showDaysOutsideCurrentMonth:true})})}),f(Rt,{}),g(ce,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{p:2},children:[f(Me,{size:"small",onClick:O,color:"inherit",children:n("common.cancel")}),f(Me,{size:"small",variant:"contained",onClick:j,children:n("common.done")})]})]})]})};var Bi={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},Mb={equals:"smartFilter.operator.equals",contains:"smartFilter.operator.contains",notContains:"smartFilter.operator.notContains",wildcard:"smartFilter.operator.wildcard","=":"smartFilter.operator.equals","!=":"smartFilter.operator.notEquals",">":"smartFilter.operator.greaterThan","<":"smartFilter.operator.lessThan",">=":"smartFilter.operator.greaterOrEqual","<=":"smartFilter.operator.lessOrEqual",between:"smartFilter.operator.between"},Ib=["contains","notContains",">",">=","<","<=","equals"],Jp=["=","!=",">","<",">=","<=","between"],oo="0.85rem",Rb=({field:t,value:o,onChange:r})=>{let{t:n}=de(),[a,i]=useState(null),[s,c]=useState(null),[u,d]=useState(null),[m,h]=useState(""),[f$1,p]=useState(""),[v,C]=useState(""),[g$1,x]=useState("");useEffect(()=>{let M=setTimeout(()=>{x(v);},1e3);return ()=>clearTimeout(M)},[v]);let y=o?.operator||(t.type==="number"?"=":"equals"),b=o?.value,k=M=>{let P=Mb[M];return P?n(P):M},w=M=>{i(a?null:M.currentTarget);},T=M=>{r({...o,operator:M,value:b}),i(null);},I={size:"small",fullWidth:true,variant:"outlined",InputLabelProps:{sx:{fontSize:oo}},InputProps:{sx:{fontSize:oo}},SelectProps:{MenuProps:{PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:oo,paddingTop:"4px",paddingBottom:"4px",minHeight:"auto"}}}}}},S=t.type||"text";if(S==="date"){let P=(A=>{if(!A)return [null,null];if(Array.isArray(A)&&A.length===2){let L=A[0]?nr.isDayjs(A[0])?A[0]:nr(A[0]):null,W=A[1]?nr.isDayjs(A[1])?A[1]:nr(A[1]):null;return [L,W]}return nr.isDayjs(A)||typeof A=="string"?[nr.isDayjs(A)?A:nr(A),null]:[null,null]})(b);return f(Qp,{label:t.label,value:P,onChange:A=>r({value:A,operator:"between"})})}if(S==="number"&&y==="between"){let M=()=>{r({value:[m,f$1],operator:"between"}),c(null);},P=Array.isArray(b)?`${b[0]||""} - ${b[1]||""}`:"";return g(e,{children:[f(We,{...I,label:t.label,value:P,placeholder:n("smartFilter.minMaxPlaceholder"),InputProps:{...I.InputProps,startAdornment:f(lr,{position:"start",children:f(ct,{title:k("between"),children:f(le,{size:"small",onClick:w,sx:{width:24,height:24,fontSize:oo},children:Bi.between})})}),readOnly:true},onClick:A=>c(s?null:A.currentTarget)}),f(Qt,{anchorEl:a,open:!!a,onClose:()=>i(null),PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:oo,minHeight:"auto",py:.5}}},children:Jp.map(A=>g("option",{selected:A===y,onClick:()=>T(A),children:[f("div",{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Bi[A]}),f(_t,{primary:k(A),primaryTypographyProps:{fontSize:oo}})]},A))}),f(si,{open:!!s,anchorEl:s,onClose:()=>c(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},children:g("div",{sx:{p:2,display:"flex",gap:1,alignItems:"center"},children:[f(We,{size:"small",label:n("smartFilter.min"),type:"number",value:m,onChange:A=>h(A.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:oo}},InputProps:{sx:{fontSize:oo}}}),f(Kd,{color:"action"}),f(We,{size:"small",label:n("smartFilter.max"),type:"number",value:f$1,onChange:A=>p(A.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:oo}},InputProps:{sx:{fontSize:oo}}}),f(Me,{variant:"contained",size:"small",onClick:M,children:n("common.ok")})]})})]})}if(t.isValueHelp||S==="value-help"){let M=t.valueHelp?.mode||"single";return f(Mp,{...I,...t.valueHelp,label:t.label,placeholder:t.placeholder||t.valueHelp?.placeholder,value:b??(M==="multiple"?[]:null),mode:M,onChange:P=>r({value:P,operator:M==="multiple"?"anyOf":"equals"})})}if(S==="select")return g(zt,{size:"small",fullWidth:true,label:t.label,value:b||"",onChange:M=>r({...o,value:M.target.value,operator:"equals"}),children:[f("option",{value:"",children:n("common.none")}),t.options?.map(M=>f("option",{value:M.value,children:M.label},M.value))]});if(S==="multi-select"){let M=Array.isArray(b)?b:[],P=t.options?.filter(_=>_.label.toLowerCase().includes(g$1.toLowerCase()))||[],A=_=>t.options?.find(z=>z.value===_)?.label||_,L=M.map(A),W=L.length===0?n("common.none"):L.length>2?`${L.slice(0,2).join(", ")} +${L.length-2}`:L.join(", "),j=()=>{d(null),C(""),x("");},O=_=>{let z=M.includes(_)?M.filter(Y=>Y!==_):[...M,_];r({...o,value:z,operator:"anyOf"});};return g("div",{className:"orb-fld",children:[f("label",{children:t.label}),g(Me,{variant:"outlined",size:"small",onClick:_=>d(u?null:_.currentTarget),sx:{width:"100%",minHeight:36,justifyContent:"space-between",fontSize:oo,fontWeight:400},children:[f("span",{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:W}),f($o,{fontSize:"small"})]}),f(Qt,{anchorEl:u,open:!!u,onClose:j,PaperProps:{sx:{width:280,maxHeight:340,overflowY:"auto",p:.5}},children:g("div",{onClick:_=>_.stopPropagation(),sx:{display:"grid",gap:.35},children:[f(We,{size:"small",autoFocus:true,placeholder:n("smartFilter.searchPlaceholder"),fullWidth:true,InputProps:{startAdornment:f(lr,{position:"start",children:f(Hr,{fontSize:"small"})}),sx:{fontSize:oo}},value:v,onChange:_=>C(_.target.value),onKeyDown:_=>_.stopPropagation()}),P.length>0?P.map(_=>{let z=M.includes(_.value);return g("div",{role:"option","aria-selected":z,tabIndex:0,className:`orb-menu-item ${z?"orb-selected":""}`,onClick:()=>O(_.value),onKeyDown:Y=>{(Y.key==="Enter"||Y.key===" ")&&(Y.preventDefault(),O(_.value));},children:[f(Tt,{checked:z,size:"small",inputProps:{tabIndex:-1},sx:{pointerEvents:"none"}}),f(_t,{primary:_.label})]},String(_.value))}):f("div",{className:"orb-menu-item","aria-disabled":"true",children:n("smartFilter.noOptionsFound")})]})})]})}let D=S==="number"?Jp:Ib;return g(e,{children:[f(We,{...I,className:"orb-filter-operator-field",label:t.label,sx:{minWidth:"120px"},value:b||"",type:S==="number"?"number":"text",onChange:M=>r({...o,value:M.target.value,operator:y}),InputProps:{...I.InputProps,startAdornment:f(lr,{position:"start",children:f(ct,{title:k(y),children:f(le,{className:"orb-filter-operator-trigger",size:"small",onClick:w,onMouseDown:M=>M.preventDefault(),sx:{width:24,height:24,fontSize:oo,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:Bi[y]})})}),endAdornment:t.hasSearchIcon?f(lr,{position:"end",children:f(Hr,{color:"action"})}):void 0}}),f(Qt,{anchorEl:a,open:!!a,onClose:()=>i(null),PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:oo,minHeight:"auto",py:.5}}},children:D.map(M=>g("option",{selected:M===y,onClick:()=>T(M),children:[f("span",{className:"orb-filter-operator-symbol",children:Bi[M]}),f(_t,{primary:k(M),primaryTypographyProps:{fontSize:oo}})]},M))})]})},_o=({fields:t,filters:o,onFilterChange:r,variants:n=[],currentVariantId:a,onVariantLoad:i,onVariantSave:s,onVariantDelete:c,onVariantSetDefault:u,onSearch:d,loading:m=false,appId:h,tableKey:f$1,currentLayout:p,currentLayoutId:v,layoutRefs:C,variantService:g$1,serviceUrl:x})=>{let{t:y}=de(),[b,k]=useState(true),[w,T]=useState(null),[I,S]=useState(t.filter(P=>!P.hidden).map(P=>P.id)),D=(P,A)=>{r({...o,[P]:A});},R=P=>{I.includes(P)?S(I.filter(A=>A!==P)):S([...I,P]);};return g(Le,{className:`orb-smart-filter ${b?"orb-smart-filter-expanded":"orb-smart-filter-collapsed"}`,sx:{mb:0,display:"flex",flexDirection:"column",overflow:"visible",position:"relative"},children:[b?g(e,{children:[g("div",{className:"orb-smart-filter-header",children:[h?f(Zp,{appId:h,tableKey:f$1,currentFilters:{values:o,visibleFields:I},currentLayout:p,currentLayoutId:v,layoutRefs:C,onLoad:P=>{if(!P.filters)return;let A=null;if(Array.isArray(P.filters)){let L=f$1||"default",W=P.filters.find(j=>j.scope===L);A=W?W.filters:null;}else A=P.filters;A&&(A.values||A.visibleFields?(A.visibleFields&&Array.isArray(A.visibleFields)&&S(A.visibleFields),A.values&&r(A.values)):r(A)),i&&i(P);},variantService:g$1,serviceUrl:x,currentVariantId:a}):f(Oi,{variants:n,currentVariantId:a,onLoad:i,onSave:P=>{s&&s({...P,filters:{values:o,visibleFields:I}});},onDelete:c,onSetDefault:u}),g("div",{className:"orb-smart-filter-actions",children:[f(ct,{title:y("smartFilter.addFilters"),children:f(Me,{className:"orb-smart-filter-adapt",onClick:P=>T(w?null:P.currentTarget),size:"small",color:"primary",startIcon:f(fp,{fontSize:"small"}),sx:{textTransform:"none",fontSize:oo,whiteSpace:"nowrap",minWidth:"fit-content"},children:y("smartFilter.adaptFilters")})}),f(le,{className:"orb-smart-filter-go",tooltip:y("smartFilter.go"),"aria-label":y("smartFilter.go"),onClick:d,disabled:m,children:m?f(Yo,{size:16}):f(Pt,{name:"play",size:16})}),g(Qt,{anchorEl:w,open:!!w,onClose:()=>T(null),slotProps:{paper:{style:{maxHeight:400,width:"25ch"},sx:{"& .orb-menu-item, & option":{fontSize:oo,minHeight:32}}}},children:[f("option",{disabled:true,children:f(_t,{primary:y("smartFilter.visibleFilters"),primaryTypographyProps:{fontSize:oo}})}),f(Rt,{}),t.map(P=>g("option",{onClick:()=>R(P.id),children:[f(Tt,{checked:I.includes(P.id),size:"small"}),f(_t,{primary:P.label,primaryTypographyProps:{fontSize:oo}})]},P.id))]})]})]}),f("div",{className:"orb-smart-filter-grid",children:f(ul,{container:true,spacing:2,columns:{xs:2,sm:3,md:4,lg:6},children:t.filter(P=>I.includes(P.id)).map(P=>f(ul,{size:1,children:f(Rb,{field:P,value:o[P.id]||{value:"",operator:P.type==="number"?"=":"equals"},onChange:A=>D(P.id,A)})},P.id))})})]}):null,f("div",{className:"orb-smart-filter-toggle",children:f(le,{className:"orb-smart-filter-toggle-button",size:"small",onClick:()=>k(!b),sx:{bgcolor:"background.paper",boxShadow:2,border:"1px solid",borderColor:"divider",width:30,height:30,minWidth:30,minHeight:0,p:0,"&:hover":{bgcolor:"background.paper"}},children:b?f(pi,{className:"orb-smart-filter-toggle-icon",sx:{fontSize:20},color:"action"}):f($o,{className:"orb-smart-filter-toggle-icon",sx:{fontSize:20},color:"action"})})})]})};var eu=({layouts:t,currentLayoutId:o,onLoad:r,onSave:n,onDelete:a,onSetDefault:i})=>{let{t:s}=de(),[c,u]=useState(null),[d,m]=useState(false),[h,f$1]=useState(""),[p,v]=useState(""),[C,g$1]=useState({isDefault:false,isPublic:false}),x=t.find(I=>I.id===o),y=I=>{u(I.currentTarget);},b=()=>{u(null);},k=I=>{r(I),b();},w=()=>{f$1(""),v(""),g$1({isDefault:false,isPublic:false}),m(true),b();},T=()=>{h.trim()&&(n({name:h,description:p,...C}),m(false));};return g("div",{className:"orb-layout-actions",sx:{display:"flex",alignItems:"center",gap:.25},children:[f(ct,{title:s("layout.layoutOptions"),children:f(le,{onClick:y,color:x?"primary":"default",size:"small",children:f(xp,{fontSize:"small"})})}),g(Qt,{anchorEl:c,open:!!c,onClose:b,align:"end",PaperProps:{sx:{width:320,maxHeight:400}},children:[f("option",{disabled:true,children:f(E,{variant:"caption",children:s("layout.selectLayout")})}),g("option",{onClick:w,children:[f(Wo,{children:f(kr,{fontSize:"small"})}),f(_t,{children:s("layout.saveCurrentLayout")})]}),f(Rt,{}),t.length===0&&f("option",{disabled:true,children:f(E,{variant:"body2",color:"text.secondary",children:s("layout.noSavedLayouts")})}),t.map((I,S)=>f("option",{onClick:()=>k(I),selected:I.id===o,children:g("div",{sx:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"},children:[g("div",{sx:{display:"flex",flexDirection:"column",overflow:"hidden",mr:1},children:[f("div",{sx:{display:"flex",alignItems:"center",gap:1},children:f(E,{variant:"body2",fontWeight:I.id===o?"bold":"normal",noWrap:true,children:I.name})}),I.description&&f(E,{variant:"caption",color:"text.secondary",noWrap:true,children:I.description})]}),g("div",{sx:{display:"flex",alignItems:"center"},onClick:D=>D.stopPropagation(),children:[f(ct,{title:I.isDefault?s("layout.removeDefault"):s("layout.setAsDefault"),children:f(le,{size:"small",onClick:D=>{D.stopPropagation(),i(I.id);},children:I.isDefault?f(yp,{fontSize:"small",color:"warning"}):f(vp,{fontSize:"small"})})}),f(ct,{title:s("common.delete"),children:f(le,{size:"small",color:"error",onClick:D=>{D.stopPropagation(),a(I.id);},children:f(ci,{fontSize:"small"})})})]})]})},I.id||S))]}),f(Lt,{open:d,onClose:()=>m(false),maxWidth:"xs",fullWidth:true,className:"orb-layout-save-dialog",title:s("layout.saveLayout"),actions:g(e,{children:[f(Me,{variant:"ghost",onClick:()=>m(false),children:s("common.cancel")}),f(Me,{onClick:T,variant:"primary",disabled:!h.trim(),children:s("common.save")})]}),children:g("div",{className:"orb-layout-save-form",children:[f(We,{label:s("layout.layoutName"),value:h,onChange:I=>f$1(I.target.value),fullWidth:true,autoFocus:true,size:"small",helperText:s("layout.layoutNameHelper")}),t.some(I=>I.name===h)&&f(E,{className:"orb-layout-save-warning",variant:"caption",color:"warning.main",children:s("layout.warningOverwrite")}),f(We,{label:s("layout.layoutDescription"),value:p,onChange:I=>v(I.target.value),fullWidth:true,size:"small"}),f(Tt,{className:"orb-layout-save-option",checked:C.isDefault,onChange:I=>g$1({...C,isDefault:I.target.checked}),label:s("layout.useAsDefault")}),f(Tt,{className:"orb-layout-save-option",checked:C.isPublic,onChange:I=>g$1({...C,isPublic:I.target.checked}),label:s("layout.publicAllUsers")})]})})]})};var hn=({appId:t,tableKey:o="default",currentLayoutData:r,onLayoutLoad:n,targetLayoutId:a,activeLayoutId:i,serviceUrl:s,onError:c,onSuccess:u})=>{let{t:d}=de(),[m,h]=useState([]),[f$1,p]=useState(""),v=`orbcafe.layouts.${t}.${o}`,C=S=>({id:S.layoutId,name:S.name,description:S.description??"",isDefault:!!S.isDefault,isPublic:!!S.isPublic,createdAt:S.createdAt??new Date().toISOString(),layoutData:S.layout??{}}),g=S=>({appId:t,tableKey:o,layoutId:S.id,name:S.name,description:S.description??"",isDefault:!!S.isDefault,isPublic:!!S.isPublic,createdAt:S.createdAt,layout:S.layoutData}),x=useCallback(()=>{try{let S=localStorage.getItem(v);if(!S)return [];let D=JSON.parse(S);return Array.isArray(D)?D:[]}catch{return []}},[v]),y=useCallback(S=>{try{localStorage.setItem(v,JSON.stringify(S));}catch{}},[v]);useEffect(()=>{i!==void 0&&p(i);},[i]),useEffect(()=>{if(a&&m.length>0){let S=m.find(D=>D.id===a);S&&(p(S.id),n(S));}},[a,m,n]);let b=useCallback(async()=>{if(t){if(!s){let S=x();h(S);let D=S.find(R=>R.isDefault);D&&!f$1&&!a&&(p(D.id),n(D));return}try{let S=await fetch(`${s}/api/layouts?appId=${encodeURIComponent(t)}&tableKey=${encodeURIComponent(o)}`);if(!S.ok)throw new Error("LAYOUT_FETCH_FAILED");let R=(await S.json()).map(C);h(R);let M=R.find(P=>P.isDefault);M&&!f$1&&!a&&(p(M.id),n(M));}catch(S){console.error("Error fetching layouts",S);let D=x();h(D);let R=D.find(M=>M.isDefault);R&&!f$1&&!a&&(p(R.id),n(R)),c&&c(d("layout.toast.loadFallback"));}}},[t,o,s,c,f$1,n,a,x,d]);return useEffect(()=>{b();},[t,o]),f(eu,{layouts:m,currentLayoutId:f$1,onLoad:S=>{p(S.id),n(S);},onSave:async S=>{let D=m.find(P=>P.name===S.name),R=D?D.id:Date.now().toString(),M={id:R,...S,createdAt:new Date().toISOString(),layoutData:r,isDefault:S.isDefault??false,isPublic:S.isPublic??false};if(!s){let A=m.some(L=>L.id===R)?m.map(L=>L.id===R?M:L):[...m,M];h(A),y(A),p(R),n(M),u&&u(d("layout.toast.saveLocalSuccess"));return}try{if(!(await fetch(`${s}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g(M))})).ok)throw new Error("LAYOUT_SAVE_FAILED");u&&u(d("layout.toast.saveSuccess")),await b(),p(R),n(M);}catch(P){console.error("Error saving layout",P);let L=m.some(W=>W.id===R)?m.map(W=>W.id===R?M:W):[...m,M];h(L),y(L),p(R),n(M),u&&u(d("layout.toast.saveLocalSuccess")),c&&c(d("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async S=>{if(!s){let D=m.filter(R=>R.id!==S);h(D),y(D),f$1===S&&p(""),u&&u(d("layout.toast.deleteLocalSuccess"));return}try{if(!(await fetch(`${s}/api/layouts/${encodeURIComponent(S)}`,{method:"DELETE"})).ok)throw new Error("LAYOUT_DELETE_FAILED");f$1===S&&p(""),u&&u(d("layout.toast.deleteSuccess")),await b();}catch(D){console.error("Error deleting layout",D);let R=m.filter(M=>M.id!==S);h(R),y(R),f$1===S&&p(""),u&&u(d("layout.toast.deleteLocalSuccess")),c&&c(d("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async S=>{if(!s){let D=m.map(R=>({...R,isDefault:R.id===S}));h(D),y(D),u&&u(d("layout.toast.defaultLocalSuccess"));return}try{let D=m.find(M=>M.id===S);if(!D)return;if(!(await fetch(`${s}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g({...D,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");u&&u(d("layout.toast.defaultSuccess")),await b();}catch(D){console.error("Error setting default",D);let R=m.map(M=>({...M,isDefault:M.id===S}));h(R),y(R),u&&u(d("layout.toast.defaultLocalSuccess")),c&&c(d("layout.toast.backendUnavailableDefaultLocal"));}}})};var Hi=(t,o)=>{if(!t||!t.filters)return null;if(Array.isArray(t.filters)){let r=t.filters.find(a=>a.scope===o);if(r)return r.filters;let n=t.filters.find(a=>a.scope==="default");return n?n.filters:null}return typeof t.filters=="object"?t.filters:null},zi=(t,o)=>{if(!t)return {layout:null,layoutId:null};let r=null,n=null;if(Array.isArray(t.layoutRefs)){let a=t.layoutRefs.find(i=>i.tableKey===o);a&&(r=a.layoutId);}return !r&&t.layoutId&&(r=t.layoutId),t.layout&&typeof t.layout=="object"&&!Array.isArray(t.layout)&&(n=t.layout),{layoutId:r,layout:n}};function ou(t,o,r){return o[r]<t[r]?-1:o[r]>t[r]?1:0}function Nb(t,o){return t==="desc"?(r,n)=>ou(r,n,o):(r,n)=>-ou(r,n,o)}function Db(t,o){let r=t.map((n,a)=>[n,a]);return r.sort((n,a)=>{let i=o(n[0],a[0]);return i!==0?i:n[1]-a[1]}),r.map(n=>n[0])}var fn=t=>{let o=!!t.disableGrouping,r=!!t.disableSorting,n=useCallback(X=>{let Q=String(X?.label??X?.id??"").length*9+64,ye=typeof X?.minWidth=="number"?X.minWidth:0;return Math.max(100,ye,Q)},[]),a=useCallback(()=>(t.columns||[]).filter(X=>!!X?.numeric).map(X=>X.id),[t.columns]),[i,s]=useState(""),[c,u]=useState(t.order||"asc"),[d,m]=useState(t.orderBy||""),[h,f]=useState([]),[p,v]=useState(t.page||0),[C,g]=useState(t.rowsPerPage||20),[x,y]=useState(t.selected||[]),[b,k]=useState(t.columns?t.columns.map(X=>X.id):[]),[w,T]=useState(t.columns?t.columns.map(X=>X.id):[]),[I,S]=useState(t.showSummary||false),[D,R]=useState(()=>a()),[M,P]=useState([]),[A,L]=useState(new Set),[W,j]=useState(()=>{let X={};return (t.columns||[]).forEach(V=>{X[V.id]=n(V);}),X}),[O,_]=useState(null),[z,Y]=useState(null),[H,B]=useState(null),[q,Z]=useState(null),[ue,ne]=useState(false),[fe,Ce]=useState(""),[$,J]=useState(""),ae=o?[]:M,xe=useCallback(X=>{if(o){P([]),L(new Set),Y(null);return}P(X);},[o]);useEffect(()=>{o&&(P([]),L(new Set),Y(null));},[o]),useEffect(()=>{r&&(u("asc"),m(""),f([]));},[r]),useEffect(()=>{t.layout&&wt(t.layout);},[t.layout]),useEffect(()=>{if(r){u("asc"),m("");return}t.order!==void 0&&u(t.order),t.orderBy!==void 0&&m(t.orderBy);},[t.order,t.orderBy,r]),useEffect(()=>{t.selected!==void 0&&y(t.selected);},[t.selected]),useEffect(()=>{t.page!==void 0&&v(t.page);},[t.page]),useEffect(()=>{t.rowsPerPage!==void 0&&g(t.rowsPerPage);},[t.rowsPerPage]),useEffect(()=>{let X=a();R(V=>V.filter(ye=>X.includes(ye)));},[a]),useEffect(()=>{j(X=>{let V={...X};return (t.columns||[]).forEach(Q=>{V[Q.id]===void 0&&(V[Q.id]=n(Q));}),V});},[t.columns,n]),useEffect(()=>{T(X=>{let V=(t.columns||[]).map(qe=>qe.id),Q=new Set(V),ye=X.filter(qe=>Q.has(qe)),Pe=new Set(ye),Oe=V.filter(qe=>!Pe.has(qe)),$e=[...ye,...Oe];return $e.length===X.length&&$e.every((qe,Qe)=>qe===X[Qe])?X:$e});},[t.columns]);let pe=useMemo(()=>{let X=t.columns||[];if(w.length===0)return X;let V=new Map(X.map(Pe=>[Pe.id,Pe])),Q=[],ye=new Set;return w.forEach(Pe=>{let Oe=V.get(Pe);Oe&&(Q.push(Oe),ye.add(Pe));}),X.forEach(Pe=>{ye.has(Pe.id)||Q.push(Pe);}),Q},[t.columns,w]),me=useMemo(()=>{let X=t.rows||[];return i&&(X=X.filter(V=>Object.keys(V).some(Q=>String(V[Q]).toLowerCase().includes(i.toLowerCase())))),X},[t.rows,i]),Ee=useMemo(()=>{if(r||t.onSortChange)return me;if(h.length>0){let X=[...me];return X.sort((V,Q)=>{for(let ye of h){let Pe=V?.[ye.field],Oe=Q?.[ye.field];if(!(Pe==null&&Oe==null)){if(Pe==null)return ye.direction==="asc"?-1:1;if(Oe==null)return ye.direction==="asc"?1:-1;if(Pe<Oe)return ye.direction==="asc"?-1:1;if(Pe>Oe)return ye.direction==="asc"?1:-1}}return 0}),X}return d?Db(me,Nb(c,d)):me},[me,c,d,h,t.onSortChange,r]),Ge=useCallback(X=>{if(ae.length===0)return X.map(Oe=>({type:"row",data:Oe,id:Oe[t.rowKey||"id"]}));let V=[...X].sort((Oe,$e)=>{for(let qe of ae){if(Oe[qe]<$e[qe])return -1;if(Oe[qe]>$e[qe])return 1}return 0}),Q=(Oe,$e=0)=>{if($e>=ae.length)return Oe;let qe=ae[$e],Qe={},ut=[];return Oe.forEach(gt=>{let It=gt[qe],bt=`${qe}:${It}`;Qe[bt]||(Qe[bt]={key:bt,field:qe,value:It,children:[],count:0,level:$e},ut.push(Qe[bt])),Qe[bt].children.push(gt),Qe[bt].count++;}),ut.forEach(gt=>{gt.children&&(gt.children=Q(gt.children,$e+1));}),ut},ye=Q(V),Pe=(Oe,$e="")=>{let qe=[];return Oe.forEach(Qe=>{if(Qe.children){let ut=$e?`${$e}>${Qe.key}`:Qe.key,gt=A.has(ut);qe.push({type:"group",id:ut,field:Qe.field,value:Qe.value,level:Qe.level,count:Qe.count,isExpanded:gt,childIds:(function It(bt){let F=[];return bt.children.forEach(ee=>{ee.children?F=F.concat(It(ee)):F.push(ee[t.rowKey||"id"]);}),F})(Qe)}),gt&&(qe=qe.concat(Pe(Qe.children,ut)));}else qe.push({type:"row",data:Qe,id:Qe[t.rowKey||"id"],level:ae.length});}),qe};return Pe(ye)},[ae,A,t.rowKey]),nt=useCallback(X=>{if(ae.length===0)return [];let V=[...X].sort((Pe,Oe)=>{for(let $e of ae){if(Pe[$e]<Oe[$e])return -1;if(Pe[$e]>Oe[$e])return 1}return 0}),Q=[],ye=(Pe,Oe,$e)=>{if(Oe>=ae.length)return;let qe=ae[Oe],Qe=new Map;Pe.forEach(ut=>{let gt=ut[qe],It=Qe.get(gt);It?It.push(ut):Qe.set(gt,[ut]);}),Qe.forEach((ut,gt)=>{let It=`${qe}:${gt}`,bt=$e?`${$e}>${It}`:It;Q.push(bt),ye(ut,Oe+1,bt);});};return ye(V,0,""),Q},[ae]),it=useMemo(()=>Ge(Ee),[Ee,Ge]),K=useMemo(()=>nt(Ee),[Ee,nt]),De=useMemo(()=>{let X=(t.rows||[]).length;return typeof t.count=="number"&&t.count>X},[t.count,t.rows]),ke=useMemo(()=>De?it:C>0?it.slice(p*C,p*C+C):it,[it,p,C,De]),He=useMemo(()=>De&&typeof t.count=="number"?t.count:it.length,[it.length,De,t.count]),at=X=>{L(V=>{let Q=new Set(V);return Q.has(X)?Q.delete(X):Q.add(X),Q});},Ye=X=>{let V=K.filter(Q=>Q===X||Q.startsWith(`${X}>`));L(Q=>{let ye=new Set(Q);return V.forEach(Pe=>ye.add(Pe)),ye});},xt=X=>{L(V=>{let Q=new Set(V);return Array.from(Q).forEach(ye=>{(ye===X||ye.startsWith(`${X}>`))&&Q.delete(ye);}),Q});},Mt=X=>{if(!X){L(new Set);return}L(new Set(K));},Ot=X=>{let V=K.filter(Q=>Q.startsWith(`${X}>`));return V.length===0?A.has(X):A.has(X)&&V.every(Q=>A.has(Q))},At=X=>{if(r)return;h.length>0&&f([]);let V=d===X&&c==="asc",Q=d===X&&c==="desc";if(t.onSortChange){V?t.onSortChange(X,"desc"):Q?t.onSortChange("","asc"):t.onSortChange(X,"asc");return}V?(u("desc"),m(X)):Q?(u("asc"),m("")):(u("asc"),m(X));},re=X=>{if(r){u("asc"),m(""),f([]);return}let V=X.filter(Q=>Q&&Q.field);f(V),V.length>0&&m("");},Ue=()=>{f([]);},Be=(X,V)=>{j(Q=>({...Q,[X]:V}));},ge=X=>{if(X.target.checked){let V=me.map(Q=>Q[t.rowKey||"id"]);y(V),t.onSelectionChange&&t.onSelectionChange(V);return}y([]),t.onSelectionChange&&t.onSelectionChange([]);},Se=(X,V)=>{let Q=V[t.rowKey||"id"],ye=x.indexOf(Q),Pe=[];ye===-1?Pe=Pe.concat(x,Q):ye===0?Pe=Pe.concat(x.slice(1)):ye===x.length-1?Pe=Pe.concat(x.slice(0,-1)):ye>0&&(Pe=Pe.concat(x.slice(0,ye),x.slice(ye+1))),y(Pe),t.onSelectionChange&&t.onSelectionChange(Pe);},oe=X=>{v(X),t.onPageChange&&t.onPageChange(X);},we=X=>{g(X),v(0),t.onPageChange&&t.onPageChange(0),t.onRowsPerPageChange&&t.onRowsPerPageChange(X);},Ae=X=>{let V=b.indexOf(X),Q=[...b];V===-1?Q.push(X):Q.splice(V,1),k(Q);},Je=X=>{if(o)return;let V=ae.indexOf(X),Q=[...ae];V===-1?Q.push(X):Q.splice(V,1),xe(Q);},st=X=>{a().includes(X)&&R(Q=>Q.includes(X)?Q.filter(ye=>ye!==X):[...Q,X]);},pt=(X,V)=>{!X||!V||X===V||T(Q=>{let ye=Q.indexOf(X),Pe=Q.indexOf(V);if(ye===-1||Pe===-1)return Q;let Oe=[...Q];return Oe.splice(ye,1),Oe.splice(Pe,0,X),Oe});},Bt=X=>{let V=X?.active?.id,Q=X?.over?.id;typeof V=="string"&&typeof Q=="string"&&pt(V,Q);},Xt=X=>{t.onLayoutSave&&t.onLayoutSave({visibleColumns:b,columnOrder:w,order:r?"asc":c,orderBy:r?"":d,sortBy:r?[]:h,grouping:ae,columnWidths:W,showSummary:I,summaryColumns:D});},Vt=X=>{let{layout:V,layoutId:Q}=zi(X,t.tableKey||"default");Q?(J(Q),Ce(Q)):(J(""),Ce("")),V&&(V.visibleColumns&&k(V.visibleColumns),Array.isArray(V.columnOrder)&&T(V.columnOrder),r?(u("asc"),m(""),f([])):(V.order&&u(V.order),V.orderBy&&m(V.orderBy),Array.isArray(V.sortBy)&&f(V.sortBy)),V.grouping&&xe(V.grouping),V.columnWidths&&j(V.columnWidths),V.showSummary!==void 0&&S(!!V.showSummary),Array.isArray(V.summaryColumns)&&R(V.summaryColumns));},wt=X=>{let V=X?.layoutData||X?.layout||X||{};V.visibleColumns&&k(V.visibleColumns),Array.isArray(V.columnOrder)&&T(V.columnOrder),r?(u("asc"),m(""),f([])):(V.order&&u(V.order),V.orderBy!==void 0&&m(V.orderBy),Array.isArray(V.sortBy)&&f(V.sortBy)),V.grouping&&xe(V.grouping),V.columnWidths&&j(V.columnWidths),V.showSummary!==void 0&&S(!!V.showSummary),Array.isArray(V.summaryColumns)&&R(V.summaryColumns),L(new Set),v(0),X?.id&&Ce(X.id),J("");};useEffect(()=>{t.layout&&Vt({layout:t.layout});},[t.layout]);let Wt=X=>{X.preventDefault(),Z(q===null?{mouseX:X.clientX+2,mouseY:X.clientY-6}:null);},ft=()=>{Z(null);},Dt=useMemo(()=>{if(!I)return {};let X={};t.columns.forEach(Q=>{if(Q.numeric&&D.includes(Q.id)){let ye=me.reduce((Pe,Oe)=>{let $e=parseFloat(Oe[Q.id]);return Pe+(isNaN($e)?0:$e)},0);X[Q.id]=ye.toFixed(2);}else X[Q.id]="";});let V=t.columns.find(Q=>b.includes(Q.id)&&!Q.numeric);return V&&!V.numeric&&(X[V.id]="Total"),X},[me,t.columns,I,D,b]),lt=()=>{if(!t.columns||!me)return;let X=t.columns.map(Oe=>Oe.label).join(","),V=me.map(Oe=>t.columns.map($e=>{let qe=Oe[$e.id];return `"${(qe==null?"":String(qe)).replace(/"/g,'""')}"`}).join(",")).join(`
2
+ `),Q=`data:text/csv;charset=utf-8,${X}
3
+ ${V}`,ye=encodeURI(Q),Pe=document.createElement("a");Pe.setAttribute("href",ye),Pe.setAttribute("download",`${t.title||"export"}.csv`),document.body.appendChild(Pe),Pe.click(),document.body.removeChild(Pe);},Ft=()=>{ne(true);},Zt=()=>{ne(false);};return {isMobile:false,columns:pe,order:c,setOrder:u,orderBy:d,setOrderBy:m,sortBy:h,setSortBy:f,applyMultiSort:re,clearMultiSort:Ue,columnOrder:w,setColumnOrder:T,filterText:i,setFilterText:s,visibleColumns:b,setVisibleColumns:k,showSummary:I,setShowSummary:S,summaryColumns:D,grouping:ae,setGrouping:xe,expandedGroups:A,setExpandedGroups:L,groupAnchorEl:z,setGroupAnchorEl:Y,summaryAnchorEl:H,setSummaryAnchorEl:B,columnWidths:W,setColumnWidths:j,anchorEl:O,setAnchorEl:_,contextMenu:q,setContextMenu:Z,sensors:void 0,sortedAndFilteredRows:Ee,visibleRows:ke,summaryRow:Dt,page:p,setPage:oe,rowsPerPage:C,setRowsPerPage:we,totalDisplayCount:He,selected:x,setSelected:y,isAllExpanded:K.length>0&&K.every(X=>A.has(X)),handleColumnResize:Be,handleRequestSort:At,handleSelectAllClick:ge,handleClick:Se,toggleSummaryColumn:st,handleDragEnd:Bt,handleColumnReorder:pt,handleExport:lt,handleContextMenu:Wt,handleCloseContextMenu:ft,toggleColumnVisibility:Ae,toggleGroupExpand:at,toggleGroupField:Je,handleToggleAll:Mt,handleExpandGroupRecursively:Ye,handleCollapseGroupRecursively:xt,isGroupFullyExpanded:Ot,handleLayoutLoad:wt,handleVariantLoad:Vt,handleLayoutSave:Xt,effectiveAppId:t.appId||"",currentLayoutData:{visibleColumns:b,order:r?"asc":c,orderBy:r?"":d,sortBy:r?[]:h,columnOrder:w,grouping:ae,columnWidths:W,showSummary:I,summaryColumns:D},currentLayoutId:fe,layoutIdToLoad:$,onPageChange:oe,onRowsPerPageChange:we,graphReportOpen:ue,handleOpenGraphReport:Ft,handleCloseGraphReport:Zt}};var NN=t=>f("tbody",{...t}),DN=({align:t,...o})=>f("td",{align:t==="inherit"?void 0:t,...o}),AN=t=>f("div",{...t}),EN=t=>f("thead",{...t}),LN=t=>f("tr",{...t}),tr=t=>{let{t:o}=de(),r="0.85rem",{title:n,showToolbar:a=true,selectionMode:i,selected:s=[],onSelectionChange:c,actions:u,extraTools:d,fitContainer:m=false,fullWidth:h=false,maxHeight:f$1,loading:p=false,rowsPerPageOptions:v=[20,50,100,-1],onLayoutSave:C,filterConfig:g$1,rowKey:x,tableKey:y="default",graphReport:b,quickCreate:k,quickEdit:w,quickDelete:T,serviceUrl:I,disableGrouping:S=false,disableSorting:D=false}=t,R=n||o("table.title.default"),{isMobile:M,columns:P,order:A,orderBy:L,filterText:W,setFilterText:j,visibleColumns:O,showSummary:_,setShowSummary:z,summaryColumns:Y,grouping:H,setGrouping:B,expandedGroups:q,groupAnchorEl:Z,setGroupAnchorEl:ue,summaryAnchorEl:ne,setSummaryAnchorEl:fe,columnWidths:Ce,anchorEl:$,setAnchorEl:J,contextMenu:ae,sensors:xe,sortedAndFilteredRows:pe,summaryRow:me,visibleRows:Ee,isAllExpanded:Ge,page:nt,setPage:it,rowsPerPage:K,setRowsPerPage:De,totalDisplayCount:ke,setSelected:He,handleColumnResize:at,handleRequestSort:Ye,handleSelectAllClick:xt,handleClick:Mt,toggleSummaryColumn:Ot,handleDragEnd:At,handleExport:re,handleContextMenu:Ue,handleCloseContextMenu:Be,toggleColumnVisibility:ge,toggleGroupExpand:Se,handleToggleAll:oe,handleExpandGroupRecursively:we,handleCollapseGroupRecursively:Ae,isGroupFullyExpanded:Je,handleLayoutLoad:st,handleVariantLoad:pt,handleLayoutSave:Bt,effectiveAppId:Xt,currentLayoutData:Vt,currentLayoutId:wt,layoutIdToLoad:Wt,graphReportOpen:ft,handleOpenGraphReport:Dt,handleCloseGraphReport:lt}=fn(t),Ft=b?.enabled??false,Zt=Ft&&(b?.interaction?.enabled??true),X=Ei(),V=!!k?.enabled,Q=!!w?.enabled,ye=!!T?.enabled,Pe=k?.fields,Oe=k?.excludeFields||[],$e=k?.initialValues||{},[qe,Qe]=Jt__default.useState(false),[ut,gt]=Jt__default.useState(false),[It,bt]=Jt__default.useState({}),[F,ee]=Jt__default.useState(false),[ve,Ie]=Jt__default.useState(false),[et,Xe]=Jt__default.useState({}),[St,ht]=Jt__default.useState(false),[mt,yt]=Jt__default.useState(false),ro=p||ut||ve||mt,Et=Jt__default.useMemo(()=>{let ie=[...P];if(Array.isArray(Pe)&&Pe.length>0){let be=new Set(Pe);ie=ie.filter(te=>be.has(te.id));}if(Oe.length>0){let be=new Set(Oe);ie=ie.filter(te=>!be.has(te.id));}return ie.filter(be=>!!be?.id)},[P,Oe,Pe]),Yt=x||"id",Ht=Jt__default.useMemo(()=>{let ie=new Set(s);return pe.filter(be=>ie.has(be?.[Yt]))},[s,pe,Yt]),Ut=Ht.length===1?Ht[0]:null,$t=w?.fields,to=w?.excludeFields||[],no=w?.editableFields||[],vo=w?.nonEditableFields||[],No=w?.primaryKeys?.length?w.primaryKeys:[Yt],Do=Jt__default.useMemo(()=>{let ie=[...P];if(Array.isArray($t)&&$t.length>0){let be=new Set($t);ie=ie.filter(te=>be.has(te.id));}if(to.length>0){let be=new Set(to);ie=ie.filter(te=>!be.has(te.id));}return ie.filter(be=>!!be?.id)},[P,to,$t]),ar=Jt__default.useMemo(()=>new Set(No),[No]),wo=Jt__default.useMemo(()=>new Set(no),[no]),zo=Jt__default.useMemo(()=>new Set(vo),[vo]),Kr=Jt__default.useCallback(ie=>wo.size>0?wo.has(ie):!(zo.has(ie)||ar.has(ie)),[wo,zo,ar]);Jt__default.useEffect(()=>{!ft&&X.hasActiveFilters&&X.clearAll();},[ft,X.hasActiveFilters,X.clearAll]);let qr=()=>{let ie={};Et.forEach(be=>{ie[be.id]=$e[be.id]??"";}),bt(ie),Qe(true);},Er=()=>{ut||Qe(false);},Xr=(ie,be)=>{bt(te=>({...te,[ie]:be}));},Zr=async()=>{if(!k?.onSubmit){Qe(false);return}try{gt(!0),await k.onSubmit(It),Qe(!1);}finally{gt(false);}},Ao=()=>{if(!Ut)return;let ie={};Do.forEach(te=>{ie[te.id]=Ut[te.id]??"";});let be=w?.getInitialValues?{...ie,...w.getInitialValues(Ut)}:ie;Xe(be),ee(true);},Lr=()=>{ve||ee(false);},Yr=(ie,be)=>{Xe(te=>({...te,[ie]:be}));},Zo=async()=>{if(Ut){if(!w?.onSubmit){ee(false);return}try{Ie(!0),await w.onSubmit(et,Ut),ee(!1);}finally{Ie(false);}}},ir=()=>{Ht.length!==0&&ht(true);},On=()=>{mt||ht(false);},Or=async()=>{if(Ht.length===0){ht(false);return}if(!T?.onConfirm){ht(false),He([]),c?.([]);return}try{yt(!0),await T.onConfirm(Ht),ht(!1),He([]),c?.([]);}finally{yt(false);}},N=pe,{fieldMapping:G}=un({rows:N,config:{...b,title:b?.title||`${R} ${o("graph.reportTitle")}`}}),U=Jt__default.useMemo(()=>Zt?X.applyRows(N,G):N,[Zt,X.applyRows,N,G]),{model:he}=un({rows:U,config:{...b,title:b?.title||`${R} ${o("graph.reportTitle")}`,fieldMapping:G}}),Ve=he.table.columns.map(ie=>({id:ie.id,label:ie.label,align:ie.align||"left",minWidth:120,numeric:ie.align==="right"})),rt=Xt?f(hn,{appId:Xt,tableKey:y,currentLayoutData:Vt,onLayoutLoad:st,targetLayoutId:Wt,activeLayoutId:wt,serviceUrl:I??g$1?.serviceUrl}):null,_e=g(e,{children:[!S&&f(dn,{groupAnchorEl:Z,setGroupAnchorEl:ue,grouping:H,setGrouping:B,columns:P}),f(pn,{anchorEl:$,setAnchorEl:J,columns:P,visibleColumns:O,toggleColumnVisibility:ge}),f(Pi,{anchorEl:ne,setAnchorEl:fe,showSummary:_,setShowSummary:z,columns:P,summaryColumns:Y,toggleSummaryColumn:Ot}),f(Ti,{contextMenu:ae,handleCloseContextMenu:Be,columns:P,visibleColumns:O,toggleColumnVisibility:ge})]});return M?g("div",{sx:{display:"flex",flexDirection:"column",gap:2,height:"100%"},children:[g$1&&f(_o,{fields:g$1.fields,filters:g$1.filters,onFilterChange:g$1.onFilterChange,onSearch:g$1.onSearch,variants:g$1.variants||[],currentVariantId:g$1.currentVariantId,onVariantLoad:g$1.onVariantLoad,onVariantSave:g$1.onVariantSave,onVariantDelete:g$1.onVariantDelete,onVariantSetDefault:g$1.onVariantSetDefault,appId:g$1.appId,tableKey:y,currentLayout:[{tableKey:y,layoutData:Vt}],variantService:g$1.variantService,serviceUrl:I??g$1.serviceUrl}),f(Np,{title:R,loading:p,showSummary:_,setShowSummary:z,setAnchorEl:J,setSummaryAnchorEl:fe,filterText:W,setFilterText:j,sortedAndFilteredRows:pe,selected:s,columns:P,visibleColumns:O,summaryRow:me,handleClick:Mt,selectionMode:i}),_e]}):g("div",{sx:{width:h?"100%":"auto",mb:m?0:2,...m?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[g$1&&f("div",{sx:{mb:2},children:f(_o,{fields:g$1.fields,filters:g$1.filters,onFilterChange:g$1.onFilterChange,onSearch:g$1.onSearch,variants:g$1.variants||[],currentVariantId:g$1.currentVariantId,onVariantLoad:ie=>{pt(ie),g$1.onVariantLoad&&g$1.onVariantLoad(ie);},onVariantSave:g$1.onVariantSave,onVariantDelete:g$1.onVariantDelete,onVariantSetDefault:g$1.onVariantSetDefault,loading:p,appId:g$1.appId,tableKey:y,currentLayout:[{tableKey:y,layoutData:Vt}],currentLayoutId:wt,layoutRefs:[{tableKey:y,layoutId:wt}],variantService:g$1.variantService,serviceUrl:I??g$1.serviceUrl})}),g(Le,{className:"orb-ctable-surface",sx:{width:h?"100%":"auto",mb:m?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":ro?{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"3px",background:"linear-gradient(90deg, color-mix(in oklch, var(--orb-primary) 0%, transparent) 0%, color-mix(in oklch, var(--orb-primary) 25%, transparent) 25%, var(--orb-primary) 50%, color-mix(in oklch, var(--orb-primary) 25%, transparent) 75%, color-mix(in oklch, var(--orb-primary) 0%, transparent) 100%)",backgroundSize:"220% 100%",animation:"cTableTopMarquee 1.2s linear infinite",zIndex:6,pointerEvents:"none"}:{},"@keyframes cTableTopMarquee":{"0%":{backgroundPosition:"220% 0"},"100%":{backgroundPosition:"-120% 0"}},...f$1?{height:f$1}:m?{flex:1,minHeight:0,height:"100%"}:{}},children:[a&&f(xi,{filterText:W,setFilterText:j,onRowsPerPageChange:De,rowsPerPage:K,rowsPerPageOptions:v,page:nt,count:ke,onPageChange:it,actions:u,extraTools:d,grouping:H,disableGrouping:S,groupAnchorEl:Z,setGroupAnchorEl:ue,showSummary:_,setShowSummary:z,anchorEl:$,setAnchorEl:J,summaryAnchorEl:ne,setSummaryAnchorEl:fe,handleExport:re,showCreateButton:V,onOpenCreateDialog:qr,showEditButton:Q,onOpenEditDialog:Ao,editDisabled:Ht.length!==1,showDeleteButton:ye,onOpenDeleteConfirm:ir,deleteDisabled:Ht.length===0,onLayoutSave:C||g$1?.variantService&&g$1?.appId?Bt:void 0,loading:p,layoutManager:rt,onOpenGraphReport:Ft?Dt:void 0}),f("div",{sx:{flex:1,...f$1?{maxHeight:f$1,height:f$1}:m?{height:0,maxHeight:"none"}:{maxHeight:"calc(100vh - 320px)"},overflowY:"auto",overflowX:"auto",position:"relative",minHeight:0},children:f(DndContext,{sensors:xe,collisionDetection:closestCenter,onDragEnd:At,modifiers:[restrictToHorizontalAxis],children:g("table",{className:"orb-tbl orb-ctable",style:{minWidth:h?750:void 0,width:h?"100%":"auto",tableLayout:Object.keys(Ce).length>0?"fixed":"auto",borderCollapse:"separate",borderSpacing:0,fontSize:r},"aria-labelledby":"tableTitle",children:[f(Si,{columns:P,visibleColumns:O,order:A,orderBy:L,onRequestSort:Ye,disableSorting:D,onContextMenu:Ue,selectionMode:i,grouping:H,isAllExpanded:Ge,handleToggleAll:oe,rowCount:pe.length,numSelected:s.length,onSelectAllClick:xt,columnWidths:Ce,onColumnResize:at}),f(ki,{visibleRows:Ee,columns:P,visibleColumns:O,selectionMode:i,selected:s,orderBy:L,loading:p,expandedGroups:q,toggleGroupExpand:Se,handleExpandGroupRecursively:we,handleCollapseGroupRecursively:Ae,isGroupFullyExpanded:Je,handleClick:Mt,onSelectionChange:c,grouping:H,rowKeyProp:x,page:nt,rowsPerPage:K}),_&&f(Rp,{showSummary:_,columns:P,visibleColumns:O,summaryRow:me,selectionMode:i?.toString(),grouping:H,columnWidths:Ce,orderBy:L,zIndex:3})]})})})]}),V&&g(Lt,{open:qe,onClose:Er,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:ie=>`1px solid ${ie.palette.divider}`,bgcolor:"background.paper"}}},children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:k?.title||o("quickCreate.createWithTitle",{title:R})}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Et.map(ie=>{let be=ie.type==="number"||ie.numeric?"number":ie.type==="date"?"date":"text",te=ie.label||ie.id;return f(We,{label:te,value:It[ie.id]??"",onChange:Fe=>Xr(ie.id,Fe.target.value),type:be,size:"small",fullWidth:true,InputLabelProps:{shrink:be==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-create-${ie.id}`)}),k?.description&&f(Jo,{severity:"info",sx:{fontSize:"0.85rem","& span":{fontSize:"0.85rem"}},children:k.description})]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[f(Me,{onClick:Er,sx:{fontSize:"0.85rem"},disabled:ut,children:k?.cancelLabel||o("common.cancel")}),f(Me,{onClick:Zr,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:ut,children:k?.submitLabel||o("common.save")})]})]}),Q&&g(Lt,{open:F,onClose:Lr,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:ie=>`1px solid ${ie.palette.divider}`,bgcolor:"background.paper"}}},children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:w?.title||o("quickEdit.editWithTitle",{title:R})}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Do.map(ie=>{let be=ie.type==="number"||ie.numeric?"number":ie.type==="date"?"date":"text",te=ie.label||ie.id,Fe=Kr(ie.id);return f(We,{label:te,value:et[ie.id]??"",onChange:je=>Yr(ie.id,je.target.value),type:be,size:"small",fullWidth:true,disabled:!Fe,InputLabelProps:{shrink:be==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-edit-${ie.id}`)}),w?.description&&f(Jo,{severity:"info",sx:{fontSize:"0.85rem","& span":{fontSize:"0.85rem"}},children:w.description})]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[f(Me,{onClick:Lr,sx:{fontSize:"0.85rem"},disabled:ve,children:w?.cancelLabel||o("common.cancel")}),f(Me,{onClick:Zo,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:ve||!Ut,children:w?.submitLabel||o("common.save")})]})]}),ye&&f(jn,{open:St,type:"warning",title:T?.title||o("quickDelete.confirmTitle"),message:T?.message||(Ht.length>1?o("quickDelete.confirmMessageMultiple",{count:Ht.length}):o("quickDelete.confirmMessageSingle")),confirmText:T?.confirmText||o("common.delete"),cancelText:T?.cancelText||o("common.cancel"),onClose:On,onConfirm:Or}),_e,Ft&&f(Di,{open:ft,onClose:lt,model:he,aiAssistant:b?.aiAssistant,interaction:Zt?{enabled:true,filters:X.filters,fieldMapping:G,onPrimaryDimensionClick:ie=>X.setFilter("primaryDimension",ie),onSecondaryDimensionClick:ie=>X.setFilter("secondaryDimension",ie),onStatusClick:ie=>X.setFilter("status",ie),onClearFilter:X.clearFilter,onClearAll:X.clearAll}:void 0,tableContent:f(tr,{appId:Xt||"graph-report-internal",title:o("graph.dataBody"),columns:Ve,rows:he.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false}})})]})},ON=tr;var $N=({id:t,title:o,hideHeader:r=true,filterConfig:n,tableProps:a,children:i,spacing:s=1,mode:c="separated"})=>{let u=n?{...n,appId:n.appId||t}:void 0,d={...a,appId:a.appId||t};return g(vi,{title:o,hideHeader:r,children:[g(ce,{spacing:s,sx:{height:"100%",overflow:"hidden"},children:[c==="separated"&&u&&f("div",{sx:{flexShrink:0},children:f(_o,{...u})}),f("div",{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:f(tr,{...d,fitContainer:true,filterConfig:c==="integrated"?u:void 0})})]}),i]})};var XN=({metadata:t,fetchData:o,initialRowsPerPage:r=20,rowsPerPageOptions:n=[20,50,100,-1],tableKey:a="default",mode:i="integrated",serviceUrl:s,variantService:c})=>{let{t:u}=de(),[d,m]=useState(false),[h,f]=useState([]),[p,v]=useState({}),[C,g]=useState(t.variants||[]),[x,y]=useState(t.layout||null),[b,k]=useState(""),[w,T]=useState(0),[I,S]=useState(0),[D,R]=useState(r),[M,P]=useState([]),[A,L]=useState("asc"),[W,j]=useState("");useEffect(()=>{let ne={};t.filters.forEach(fe=>{fe.defaultValue!==void 0&&(ne[fe.id]=fe.defaultValue);}),v(ne);},[t.filters]);let O=useCallback(async(ne,fe,Ce,$,J)=>{m(true);try{let ae={...ne,page:fe+1,limit:Ce,sort:J,order:$},xe;o?xe=await o(ae):typeof t.api=="function"?xe=await t.api(ae):t.api&&typeof t.api=="object"?(console.log("Fetching from URL:",t.api.url,ae),xe={rows:[],total:0}):(console.warn("No API configured for report"),xe={rows:[],total:0}),xe&&(f(xe.rows||[]),T(xe.total||0));}catch(ae){console.error("Failed to fetch report data",ae);}finally{m(false);}},[t.api,o]);useEffect(()=>{O(p,I,D,A,W);},[O,I,D,A,W]);let _=()=>{S(0),O(p,0,D,A,W);},z=ne=>{S(0),R(ne);},Y=(ne,fe)=>{L(fe),j(ne);},H=ne=>{v(ne);},B=ne=>{k(ne?.id||"");let fe=Hi(ne,a);if(fe){let $=fe.values??fe;v($),O($,0,D,A,W),S(0);}let{layout:Ce}=zi(ne,a);Ce&&y(Ce);},q=ne=>{let fe={...ne,id:Date.now().toString(),createdAt:new Date().toISOString()};g(Ce=>[...Ce,fe]);},Z=ne=>{y(ne);};return {pageProps:{id:t.id,title:t.title,mode:i,filterConfig:{appId:t.id,tableKey:a,fields:t.filters,filters:p,onFilterChange:H,onSearch:_,onVariantLoad:B,onVariantSave:q,onVariantDelete:ne=>g(fe=>fe.filter(Ce=>Ce.id!==ne)),onVariantSetDefault:ne=>{g(fe=>fe.map(Ce=>({...Ce,isDefault:Ce.id===ne})));},variants:C,currentVariantId:b,variantService:c,serviceUrl:s},tableProps:{appId:t.id,tableKey:a,columns:t.columns,rows:h,loading:d,rowKey:"id",count:w,page:I,rowsPerPage:D,rowsPerPageOptions:n,onPageChange:S,onRowsPerPageChange:z,selectionMode:"multiple",selected:M,onSelectionChange:P,onLayoutSave:Z,layout:x,title:t.title,showSummary:true,order:A,orderBy:W,serviceUrl:s,onSortChange:Y,graphReport:t.graphReport||{enabled:true,title:`${t.title} ${u("graph.reportTitle")}`}}},filters:p,rows:h,loading:d,refresh:_}};var Hb=new Set(["id","title","description","icon","iconNode","meta"]),zb=t=>t.replace(/([A-Z])/g," $1").replace(/[._-]+/g," ").replace(/^\w/,o=>o.toUpperCase()).trim(),Vb=t=>Object.entries(t).filter(([o,r])=>!Hb.has(o)&&r!==null&&r!==void 0&&["string","number","boolean"].includes(typeof r)).map(([o,r])=>({key:o,label:zb(o),value:String(r)})),nu=({item:t,open:o,onClose:r,onDownloadClick:n,renderContent:a,downloadTooltip:i,closeTooltip:s})=>{let{t:c}=de(),d=fo()==="dark"?"var(--orb-p300)":"var(--orb-primary)";Jt__default.useEffect(()=>{if(!o)return;let h=f=>{f.key==="Escape"&&r();};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[o,r]);let m=Vb(t);return typeof document>"u"?null:createPortal(g(e,{children:[f("div",{"aria-hidden":"true",onClick:r,sx:{position:"fixed",inset:0,zIndex:1299,backgroundColor:"rgba(1, 9, 26, 0.4)",opacity:o?1:0,pointerEvents:o?"auto":"none",transition:"opacity 200ms ease"}}),g("div",{role:"dialog","aria-modal":"true","aria-label":t.title,sx:{position:"fixed",top:"50%",left:"50%",zIndex:1300,width:"min(520px, 92vw)",maxHeight:"82vh",display:"flex",flexDirection:"column",bgcolor:"background.paper",border:"1px solid",borderColor:"divider",borderRadius:3,boxShadow:"0 24px 64px rgba(1, 9, 26, 0.3)",transform:o?"translate(-50%, -50%) scale(1)":"translate(-50%, -47%) scale(0.96)",opacity:o?1:0,transition:"transform 200ms ease, opacity 180ms ease"},children:[g(ce,{direction:"row",spacing:1.5,alignItems:"center",sx:{p:2.5,pb:2,borderBottom:"1px solid",borderColor:"divider",flexShrink:0},children:[f("div",{sx:{width:56,height:56,flex:"0 0 auto",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:t.iconNode??f(Pt,{name:t.icon??"product",size:30,style:{color:d}})}),g("div",{sx:{flex:1,minWidth:0},children:[f(E,{component:"div",sx:{fontWeight:700,fontSize:"1.1rem",lineHeight:1.3,wordBreak:"break-word"},children:t.title}),t.meta?f(E,{component:"div",sx:{fontSize:"0.8rem",color:"text.secondary"},children:t.meta}):null]}),f(le,{tooltip:s??c("cardPage.close"),"aria-label":s??c("cardPage.close"),onClick:r,children:f(Pt,{name:"decline",size:18})})]}),f("div",{sx:{flex:1,minHeight:0,overflowY:"auto",p:2.5},children:a?a(t):g(e,{children:[t.description?f(E,{component:"div",sx:{fontSize:"0.9rem",lineHeight:1.6,color:"text.primary"},children:t.description}):null,m.length>0?f("div",{sx:{mt:t.description?2.5:0,display:"grid",gap:1.5},children:m.map(h=>g("div",{children:[f(E,{component:"div",sx:{fontSize:"0.72rem",fontWeight:600,color:"text.secondary",textTransform:"uppercase",letterSpacing:"0.04em"},children:h.label}),f(E,{component:"div",sx:{fontSize:"0.88rem",color:"text.primary",wordBreak:"break-word"},children:h.value})]},h.key))}):null]})}),n?f("div",{sx:{p:2.5,pt:2,borderTop:"1px solid",borderColor:"divider",flexShrink:0},children:f(Me,{variant:"contained",sx:{width:"100%"},startIcon:f(Pt,{name:"download",size:16}),onClick:()=>n(t),children:i??c("cardPage.download")})}):null]})]}),document.body)};var Wb={display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3",overflow:"hidden"},$b=({item:t,onDetailClick:o,onDownloadClick:r,detailTooltip:n,downloadTooltip:a})=>{let{t:i}=de(),c=fo()==="dark"?"var(--orb-p300)":"var(--orb-primary)",u=t.iconNode??f(Pt,{name:t.icon??"product",size:26,style:{color:c}});return g(Le,{elevation:0,sx:{p:2,height:"100%",display:"flex",flexDirection:"column",borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",boxShadow:"0 8px 20px rgba(15, 23, 42, 0.06)",transition:"transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease","&:hover":{transform:"translateY(-2px)",borderColor:"primary.main",boxShadow:"0 14px 32px rgba(15, 23, 42, 0.12)"}},children:[g(ce,{direction:"row",spacing:1.5,alignItems:"center",children:[f("div",{sx:{width:48,height:48,flex:"0 0 auto",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:2.5,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:u}),g("div",{sx:{flex:1,minWidth:0},children:[f(E,{component:"div",noWrap:true,sx:{fontWeight:700,fontSize:"0.98rem",lineHeight:1.3},children:t.title}),t.meta?f(E,{component:"div",noWrap:true,sx:{fontSize:"0.75rem",color:"text.secondary"},children:t.meta}):null]})]}),f("div",{sx:{mt:1.5,flex:1,minHeight:0},children:f(E,{component:"div",sx:{fontSize:"0.84rem",lineHeight:1.45,color:"text.primary",...Wb},children:t.description||"\xA0"})}),g(ce,{direction:"row",spacing:.5,justifyContent:"flex-end",sx:{mt:1.5},children:[f(le,{tooltip:n??i("cardPage.viewDetails"),"aria-label":n??i("cardPage.viewDetails"),onClick:()=>o?.(t),children:f(Pt,{name:"show",size:18})}),f(le,{tooltip:a??i("cardPage.download"),"aria-label":a??i("cardPage.download"),onClick:()=>r?.(t),children:f(Pt,{name:"download",size:18})})]})]})},iu=({items:t,loading:o=false,onDetailClick:r,onDownloadClick:n,minCardWidth:a=260,detailTooltip:i,downloadTooltip:s,emptyText:c,detailPanel:u=true,renderDetailContent:d})=>{let{t:m}=de(),[h,f$1]=Jt__default.useState(null),[p,v]=Jt__default.useState(false),C=x=>{r?.(x),u&&(f$1(x),requestAnimationFrame(()=>requestAnimationFrame(()=>v(true))));},g$1=()=>{v(false),setTimeout(()=>f$1(null),260);};return o?f("div",{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",minHeight:240},children:f(Yo,{})}):t.length?g(e,{children:[f("div",{sx:{flex:1,minHeight:0,overflowY:"auto",display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(${a}px, 1fr))`,gap:2,alignContent:"start",p:.5},children:t.map(x=>f($b,{item:x,onDetailClick:C,onDownloadClick:n,detailTooltip:i,downloadTooltip:s},x.id))}),u&&h?f(nu,{item:h,open:p,onClose:g$1,onDownloadClick:n,renderContent:d,downloadTooltip:s}):null]}):f("div",{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",minHeight:240},children:f(E,{sx:{color:"text.secondary"},children:c??m("cardPage.empty")})})};var fD=({id:t,title:o,hideHeader:r=true,filterConfig:n,gridProps:a,children:i,spacing:s=1})=>{let c=n?{...n,appId:n.appId||t}:void 0;return g(vi,{title:o,hideHeader:r,children:[g(ce,{spacing:s,sx:{height:"100%",overflow:"hidden"},children:[c&&f("div",{sx:{flexShrink:0},children:f(_o,{...c})}),f("div",{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:f(iu,{...a})})]}),i]})};var xD=({metadata:t,fetchData:o,tableKey:r="default",variantService:n,serviceUrl:a,onDetailClick:i,onDownloadClick:s,minCardWidth:c})=>{let[u,d]=useState(false),[m,h]=useState([]),[f,p]=useState(0),[v,C]=useState({}),[g,x]=useState(t.variants||[]),[y,b]=useState("");useEffect(()=>{let R={};t.filters.forEach(M=>{M.defaultValue!==void 0&&(R[M.id]=M.defaultValue);}),C(R);},[t.filters]);let k=useCallback(async R=>{d(true);try{let M=o?await o({...R}):{rows:[],total:0};h(M?.rows||[]),p(M?.total||0);}catch(M){console.error("Failed to fetch card page data",M);}finally{d(false);}},[o]);useEffect(()=>{k(v);},[k]);let w=()=>{k(v);},T=R=>{C(R);},I=R=>{b(R?.id||"");let M=Hi(R,r);if(M){let P=M.values??M;C(P),k(P);}},S=R=>{let M={...R,id:Date.now().toString(),createdAt:new Date().toISOString()};x(P=>[...P,M]);};return {pageProps:{id:t.id,title:t.title,filterConfig:{appId:t.id,tableKey:r,fields:t.filters,filters:v,onFilterChange:T,onSearch:w,onVariantLoad:I,onVariantSave:S,onVariantDelete:R=>x(M=>M.filter(P=>P.id!==R)),onVariantSetDefault:R=>{x(M=>M.map(P=>({...P,isDefault:P.id===R})));},variants:g,currentVariantId:y,variantService:n,serviceUrl:a},gridProps:{items:m,loading:u,onDetailClick:i,onDownloadClick:s,minCardWidth:c}},items:m,total:f,filters:v,loading:u,refresh:w}};var Gb=t=>[...t].sort((o,r)=>r.value-o.value),kD=({bars:t=[],lines:o=[],combos:r=[],heatmap:n=[],pies:a=[],waterfalls:i=[]})=>{let s=useMemo(()=>Gb(t),[t]),c=useMemo(()=>[...o],[o]),u=useMemo(()=>[...r],[r]),d=useMemo(()=>[...n],[n]),m=useMemo(()=>{let f=a.reduce((p,v)=>p+v.value,0);return a.map(p=>({...p,percent:f>0?p.value/f*100:p.percent}))},[a]),h=useMemo(()=>[...i],[i]);return {bars:s,lines:c,combos:u,heatmap:d,pies:m,waterfalls:h}};var RD=({apiKey:t,query:o,zoom:r=14,mapType:n="roadmap"})=>useMemo(()=>!t||!o?"":aa({apiKey:t,query:o,zoom:r,mapType:n}),[t,o,r,n]),ND=({keyword:t,location:o})=>useMemo(()=>Ri({keyword:t,location:o?{lng:o.lng,lat:o.lat,name:o.name}:void 0}),[t,o]);var da=({code:t,language:o="text",copyable:r=true,showLineNumbers:n=false,wrapLongLines:a=false,maxHeight:i})=>{let[s,c]=useState(false),u=useMemo(()=>t.replace(/\n$/,"").split(`
4
+ `),[t]);return g("div",{style:{border:"1px solid var(--orb-border)",borderRadius:12,overflow:"hidden",background:"var(--orb-canvas)"},children:[g("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"4.8px 8px",background:"var(--orb-hover)",borderBottom:"1px solid var(--orb-border)"},children:[f("span",{style:{fontSize:12,fontWeight:500,textTransform:"uppercase",letterSpacing:.5,color:"var(--orb-muted)",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:o}),r&&f(le,{size:"small",tooltip:s?"Copied":"Copy",onClick:async()=>{try{await navigator.clipboard.writeText(t),c(!0),window.setTimeout(()=>c(!1),1400);}catch{c(false);}},children:s?f(po,{size:14,strokeWidth:1.8}):f(Lo,{size:14,strokeWidth:1.8})})]}),f("pre",{style:{margin:0,padding:10,fontSize:"0.82rem",lineHeight:1.55,overflow:"auto",maxHeight:i,background:"var(--orb-surface)",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:n?u.map((m,h)=>g("div",{style:{display:"flex"},children:[f("span",{style:{width:34,flexShrink:0,textAlign:"right",paddingRight:8,color:"var(--orb-disabled-fg)",userSelect:"none"},children:h+1}),f("span",{style:{whiteSpace:a?"pre-wrap":"pre",wordBreak:a?"break-word":"normal"},children:m})]},`${h}-${m}`)):f("code",{style:{display:"block",whiteSpace:a?"pre-wrap":"pre",wordBreak:a?"break-word":"normal"},children:t})})]})};var Yb=t=>{let o=t.trim();return o.startsWith("$$")&&o.endsWith("$$")&&o.length>=4&&(o=o.slice(2,-2).trim()),o.startsWith("$")&&o.endsWith("$")&&o.length>=2&&(o=o.slice(1,-1).trim()),o},Qb=async t=>new Function("m","return import(m)")(t),pa=({expression:t,inline:o=false,allowKatex:r=false})=>{let n=useMemo(()=>Yb(t),[t]),[a,i]=useState("");return useEffect(()=>{let s=true;return (async()=>{if(!r||!n){i("");return}try{let u=await Qb("katex"),m=(u?.default||u)?.renderToString?.(n,{displayMode:!o,throwOnError:!1,strict:"warn"});s&&typeof m=="string"&&i(m);}catch{s&&i("");}})(),()=>{s=false;}},[r,n,o]),n?a?f(Re,{component:o?"span":"div",sx:{display:o?"inline-flex":"block",my:o?0:.5,overflowX:"auto"},dangerouslySetInnerHTML:{__html:a}}):o?f(Re,{component:"code",sx:{px:.4,py:.05,borderRadius:.8,bgcolor:"action.hover",fontSize:"0.82em",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:n}):f(Re,{sx:{my:1,p:1,borderRadius:1.2,border:"1px dashed",borderColor:"divider",bgcolor:"background.paper"},children:f(Co,{component:"pre",sx:{m:0,whiteSpace:"pre-wrap",fontSize:"0.9rem",lineHeight:1.5,fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:n})}):null};var ev=async t=>new Function("m","return import(m)")(t),wl=({code:t,title:o="Mermaid Diagram",height:r=320,enabled:n=true})=>{let[a,i]=useState(""),[s,c]=useState(""),[u,d]=useState(false),m=useMemo(()=>t.trim(),[t]);return useEffect(()=>{let h=true;return (async()=>{if(!n||!m){i(""),c("");return}d(true),c(""),i("");try{let p=await ev("mermaid"),v=p?.default||p;if(!v||typeof v.render!="function")throw new Error("Mermaid runtime is not available");v.initialize?.({startOnLoad:!1,securityLevel:"loose",theme:"default"});let C=await v.render(`orbcafe-mermaid-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,m),g=typeof C=="string"?C:C?.svg;h&&typeof g=="string"&&i(g);}catch(p){if(h){let v=p instanceof Error?p.message:"Failed to render Mermaid diagram";c(v);}}finally{h&&d(false);}})(),()=>{h=false;}},[n,m]),g(Fr,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:[f(Re,{sx:{px:1,py:.6,borderBottom:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:f(Co,{variant:"caption",color:"text.secondary",sx:{letterSpacing:.4,textTransform:"uppercase"},children:o})}),g(Re,{sx:{p:1},children:[u&&f(Re,{sx:{minHeight:120,display:"flex",alignItems:"center",justifyContent:"center"},children:f(Id,{size:20})}),!u&&a&&f(Re,{sx:{maxHeight:r,overflow:"auto","& svg":{display:"block",mx:"auto",maxWidth:"100%",height:"auto"}},dangerouslySetInnerHTML:{__html:a}}),!u&&!a&&g(Re,{children:[s&&f(Jo,{severity:"info",sx:{mb:1},children:s}),f(da,{code:m,language:"mermaid",copyable:true,showLineNumbers:true,wrapLongLines:true})]})]})]})};var Sl=t=>t.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(r=>r.trim()),ov=t=>/^:?-{3,}:?$/.test(t.trim()),rv=t=>{let o=t.trim(),r=o.startsWith(":"),n=o.endsWith(":");return r&&n?"center":n?"right":"left"},Vi=t=>{let o=t.split(`
5
+ `).map(s=>s.trim()).filter(Boolean);if(o.length<2)return null;let r=Sl(o[0]),n=Sl(o[1]);if(r.length===0||n.length!==r.length||!n.every(ov))return null;let a=n.map(rv),i=o.slice(2).filter(s=>s.includes("|")).map(s=>{let c=Sl(s);return c.length<r.length?[...c,...Array.from({length:r.length-c.length},()=>"")]:c.slice(0,r.length)});return {headers:r,aligns:a,rows:i}},kl=({markdown:t,table:o,maxHeight:r=360})=>{let n=useMemo(()=>o||(t?Vi(t):null),[o,t]);return !n||n.headers.length===0?f(Fr,{variant:"outlined",sx:{p:1.2,borderRadius:1.5},children:f(Co,{variant:"body2",color:"text.secondary",children:"Invalid table block"})}):f(Fr,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:f(Ad,{sx:{maxHeight:r},children:g(Nd,{size:"small",stickyHeader:true,children:[f(Ed,{children:f(pl,{children:n.headers.map((a,i)=>f(dl,{align:n.aligns[i],sx:{fontWeight:700,bgcolor:"background.paper"},children:a},`${a}-${i}`))})}),f(Dd,{children:n.rows.map((a,i)=>f(pl,{hover:true,children:a.map((s,c)=>f(dl,{align:n.aligns[c],sx:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:s||f(Re,{component:"span",sx:{color:"text.disabled"},children:"-"})},`cell-${i}-${c}`))},`row-${i}`))})]})})})};var Wi=({content:t,title:o="Thinking",defaultExpanded:r=false,isStreaming:n=false})=>{let[a,i]=useState(r);return g(Re,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1,my:.8},children:[g(Pd,{direction:"row",alignItems:"center",spacing:.6,children:[f(Td,{size:"small",onClick:()=>i(s=>!s),sx:{transform:a?"rotate(180deg)":"rotate(0deg)",transition:"transform .15s ease"},children:f(nn,{fontSize:"inherit"})}),g(Co,{variant:"caption",color:"text.secondary",sx:{fontStyle:"italic"},children:[o,n?" ...":""]})]}),f(rn,{in:a,children:f(Co,{variant:"body2",sx:{pl:4,pt:.4,whiteSpace:"pre-wrap",color:"text.secondary",fontStyle:"italic",lineHeight:1.55},children:t})})]})};var Pl=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|\*[^*]+\*|\$[^$\n]+\$)/g,$i=t=>t.trim().startsWith("```"),du=t=>/^#{1,6}\s+/.test(t.trim()),Tl=t=>/^[-*+]\s+/.test(t.trim()),Ml=t=>/^\d+\.\s+/.test(t.trim()),pu=t=>/^(?:-{3,}|\*{3,}|_{3,})$/.test(t.trim()),Il=t=>t.trim().startsWith(">"),uu=(t,o)=>{if(o+1>=t.length)return false;let r=t[o],n=t[o+1];return !r.includes("|")||!n.includes("|")?false:/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(n.trim())},mu=t=>t.trim().startsWith("<think>")||t.trim()===":::think",ua=(t,o,r)=>{let n=[],a=0,i=0;Pl.lastIndex=0;let s=Pl.exec(t);for(;s;){s.index>a&&n.push(t.slice(a,s.index));let c=s[0],u=`${r}-${i}`;if(c.startsWith("**")&&c.endsWith("**"))n.push(f("strong",{children:c.slice(2,-2)},u));else if(c.startsWith("*")&&c.endsWith("*"))n.push(f("em",{children:c.slice(1,-1)},u));else if(c.startsWith("`")&&c.endsWith("`"))n.push(f(Re,{component:"code",sx:{px:.45,py:.08,borderRadius:.8,bgcolor:"action.hover",fontSize:"0.82em",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:c.slice(1,-1)},u));else if(c.startsWith("[")&&c.includes("](")&&c.endsWith(")")){let d=c.match(/^\[([^\]]+)\]\(([^)]+)\)$/);d?n.push(f(kd,{href:d[2],target:"_blank",rel:"noreferrer",children:d[1]},u)):n.push(c);}else c.startsWith("$")&&c.endsWith("$")&&o.enableMath?n.push(f(pa,{expression:c,inline:true,allowKatex:true},u)):n.push(c);a=s.index+c.length,i+=1,s=Pl.exec(t);}return a<t.length&&n.push(t.slice(a)),n.length>0?n:[t]},ma=({markdown:t,content:o,className:r,enableMath:n=true,enableMermaid:a=true,enableThinkBlock:i=true,codeCopyable:s=true,codeLineNumbers:c=false})=>{let u=t??o??"",d=useMemo(()=>{let m=[],h=u.replace(/\r\n/g,`
6
6
  `).split(`
7
- `),f$1={enableMath:n},u=0;for(;u<h.length;){let b=h[u],C=b.trim();if(!C){u+=1;continue}if(i&&lu(b)){if(C.startsWith("<think>")){let v=[],y=b;for(;;){let k=y.indexOf("<think>"),w=k>=0?y.slice(k+7):y,P=w.indexOf("</think>");if(P>=0){v.push(w.slice(0,P)),u+=1;break}if(v.push(w),u+=1,u>=h.length)break;y=h[u];}m.push(f(Fi,{content:v.join(`
8
- `).trim()},`think-tag-${u}`));continue}u+=1;let x=[];for(;u<h.length&&h[u].trim()!==":::";)x.push(h[u]),u+=1;u<h.length&&h[u].trim()===":::"&&(u+=1),m.push(f(Fi,{content:x.join(`
9
- `).trim()},`think-fence-${u}`));continue}if(Bi(b)){let x=C.slice(3).trim().toLowerCase(),v=[];for(u+=1;u<h.length&&!Bi(h[u]);)v.push(h[u]),u+=1;u<h.length&&Bi(h[u])&&(u+=1);let y=v.join(`
10
- `);if(a&&x==="mermaid"){m.push(f(hl,{code:y},`mermaid-${u}`));continue}if(n&&["math","latex","katex"].includes(x)){m.push(f(la,{expression:y,allowKatex:true},`math-fence-${u}`));continue}m.push(f(sa,{code:y,language:x||"text",copyable:s,showLineNumbers:l,wrapLongLines:true},`code-${u}`));continue}if(n&&C.startsWith("$$")){let x=[];if(C.endsWith("$$")&&C!=="$$")x.push(C.slice(2,-2)),u+=1;else {let y=b.slice(b.indexOf("$$")+2);for(y.trim()&&x.push(y),u+=1;u<h.length;){let k=h[u],w=k.indexOf("$$");if(w>=0){x.push(k.slice(0,w)),u+=1;break}x.push(k),u+=1;}}m.push(f(la,{expression:x.join(`
11
- `).trim(),allowKatex:true},`math-${u}`));continue}if(au(b)){let x=Math.min(6,b.match(/^#{1,6}/)?.[0]?.length||1),v=b.replace(/^#{1,6}\s+/,""),y=x===1?"h5":x===2?"h6":"subtitle1";m.push(f(vo,{variant:y,sx:{mt:x===1?1.2:.8,mb:.5,fontWeight:700},children:ca(v,f$1,`h-${u}`)},`heading-${u}`)),u+=1;continue}if(iu(b)){m.push(f(wd,{sx:{my:1.2}},`hr-${u}`)),u+=1;continue}if(su(h,u)){let x=u+2;for(;x<h.length&&h[x].trim()&&h[x].includes("|");)x+=1;let v=h.slice(u,x).join(`
12
- `),y=Oi(v);if(y){m.push(f(bl,{table:y},`table-${u}`)),u=x;continue}}if(xl(b)){let x=[];for(;u<h.length&&xl(h[u]);)x.push(h[u].replace(/^\s*>\s?/,"")),u+=1;m.push(f(Or,{variant:"outlined",sx:{px:1,py:.8,my:.9,borderLeftWidth:3,borderLeftStyle:"solid",borderLeftColor:"primary.main",bgcolor:"action.hover"},children:f(vo,{variant:"body2",sx:{whiteSpace:"pre-wrap"},children:x.map((v,y)=>g(Fragment,{children:[y>0&&f("br",{}),ca(v,f$1,`q-${u}-${y}`)]},`quote-line-${y}`))})},`quote-${u}`));continue}if(yl(b)){let x=[];for(;u<h.length&&yl(h[u]);)x.push(h[u].trim().replace(/^[-*+]\s+/,"")),u+=1;m.push(f(Ie,{component:"ul",sx:{my:.8,pl:2.5},children:x.map((v,y)=>f(Ie,{component:"li",sx:{mb:.45},children:f(vo,{variant:"body2",children:ca(v,f$1,`ul-${u}-${y}`)})},`ul-item-${y}`))},`ul-${u}`));continue}if(Cl(b)){let x=[];for(;u<h.length&&Cl(h[u]);)x.push(h[u].trim().replace(/^\d+\.\s+/,"")),u+=1;m.push(f(Ie,{component:"ol",sx:{my:.8,pl:2.7},children:x.map((v,y)=>f(Ie,{component:"li",sx:{mb:.45},children:f(vo,{variant:"body2",children:ca(v,f$1,`ol-${u}-${y}`)})},`ol-item-${y}`))},`ol-${u}`));continue}let g$1=[];for(;u<h.length;){let x=h[u],v=x.trim();if(!v||Bi(x)||au(x)||iu(x)||yl(x)||Cl(x)||xl(x)||su(h,u)||i&&lu(x)||n&&v.startsWith("$$"))break;g$1.push(x),u+=1;}g$1.length>0?m.push(f(vo,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:g$1.map((x,v)=>g(Fragment,{children:[v>0&&f("br",{}),ca(x,f$1,`p-${u}-${v}`)]},`p-line-${v}`))},`p-${u}`)):u+=1;}return m},[d,n,a,i,s,l]);return f(Ie,{className:r,sx:{"& strong":{fontWeight:700},"& em":{fontStyle:"italic"},"& a":{wordBreak:"break-all"}},children:p})};var _N=(t,o)=>f(da,{markdown:t,...o});var cu=({value:t,onChange:o,onSubmit:r,onVoiceInput:n,onClear:a,placeholder:i,statusText:s,loading:l=false,compact:d=false,showStatusText:p=true})=>g(se,{spacing:.75,children:[g("div",{sx:{display:"flex",alignItems:"center",gap:1,px:1.2,py:d?.25:.4,borderRadius:999,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",minHeight:d?38:44},children:[f(Br,{sx:{fontSize:d?16:18,color:"text.secondary"}}),f(Rd,{fullWidth:true,value:t,onChange:m=>o(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),r());},placeholder:i,sx:{fontSize:d?"0.84rem":"0.9rem"}}),t&&a&&f(ie,{size:"small",onClick:a,children:f(xr,{sx:{fontSize:d?16:18}})}),n&&f(ie,{size:"small",onClick:n,children:f(np,{sx:{fontSize:d?16:18}})}),f(ie,{size:"small",onClick:r,disabled:l||!t.trim(),children:f(cp,{sx:{fontSize:d?16:18}})})]}),p&&s&&f(E,{variant:"caption",color:"text.secondary",children:s})]});var du=(t,o)=>{let r=o.trim();if(!r)return t;let n=t.toLowerCase(),a=r.toLowerCase(),i=n.indexOf(a);return i<0?t:g(e,{children:[t.slice(0,i),f("div",{component:"mark",sx:{bgcolor:"warning.light",color:"warning.contrastText",px:.15,borderRadius:.4},children:t.slice(i,i+r.length)}),t.slice(i+r.length)]})},Hi=({section:t,highlightQuery:o=""})=>{let r=t.columns||2;return g(Ne,{variant:"outlined",sx:{p:1.8,borderRadius:2},children:[f(E,{variant:"subtitle1",sx:{fontWeight:700,mb:1.4},children:t.title}),f("div",{sx:{display:"grid",gap:1.15,gridTemplateColumns:{xs:"1fr",md:r===3?"repeat(3, minmax(0, 1fr))":r===1?"1fr":"repeat(2, minmax(0, 1fr))"}},children:t.fields.map(n=>{let a=typeof n.value=="string"||typeof n.value=="number"?String(n.value):null;return g("div",{sx:{minWidth:0},children:[f(E,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:du(n.label,o)}),f(E,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:a?du(a,o):n.value})]},n.id)})})]})};var wl=t=>t==null?"":typeof t=="string"||typeof t=="number"||typeof t=="boolean"?String(t):"",Vi=t=>t.trim().toLowerCase(),Qb=(t,o)=>{let r=[];return t.forEach(n=>{n.fields.forEach(a=>{let i=a.searchableText||wl(a.value),s={source:"section",sourceId:n.id,sourceSectionId:n.id,sourceTitle:n.title,fieldId:a.id,fieldLabel:a.label,fieldValue:i};r.push({hit:s,text:Vi(`${n.title} ${a.label} ${i}`)});});}),o.forEach(n=>{(n.fields||[]).forEach(a=>{let i=a.searchableText||wl(a.value),s={source:"tab",sourceId:n.id,sourceTitle:n.label,fieldId:a.id,fieldLabel:a.label,fieldValue:i};r.push({hit:s,text:Vi(`${n.label} ${a.label} ${i}`)});}),(n.sections||[]).forEach(a=>{a.fields.forEach(i=>{let s=i.searchableText||wl(i.value),l={source:"tab",sourceId:n.id,sourceSectionId:a.id,sourceTitle:`${n.label} / ${a.title}`,fieldId:i.id,fieldLabel:i.label,fieldValue:s};r.push({hit:l,text:Vi(`${n.label} ${a.title} ${i.label} ${s}`)});});});}),r},pu=({sections:t,tabs:o=[],defaultTabId:r,ai:n})=>{let{t:a}=ce(),[i,s]=useState(""),[l,d]=useState(r||o[0]?.id),[p,m]=useState("idle"),[h,f]=useState([]),[u,b]=useState(""),[C,g]=useState(""),[x,v]=useState(false),y=useMemo(()=>Qb(t,o),[t,o]);useEffect(()=>{if(o.length===0){d(void 0);return}o.some(R=>R.id===l)||d(r||o[0]?.id);},[o,l,r]);let k=useCallback(()=>{m("idle"),f([]),b(""),g("");},[]),w=useCallback(S=>{s(S),S.trim()||(m("idle"),f([]),b(""),g(""));},[]),P=useCallback(S=>{let R=Vi(S);return R?y.filter(N=>N.text.includes(R)).map(N=>N.hit):[]},[y]),I=useCallback(async()=>{let S=i.trim();if(!S)return;v(true);let R=P(S);if(f(R),R.length>0){m("search"),g(""),b(a("detail.searchAi.matches",{count:R.length})),v(false);return}if(n?.enabled!==false&&n?.onSubmit){m("ai"),b(a("detail.searchAi.autoAiFallback"));try{let T=await n.onSubmit(S,{query:S,hits:R,activeTabId:l,sections:t,tabs:o});g(typeof T=="string"?T:"");}finally{v(false);}return}m("search"),g(""),b(a("detail.searchAi.noMatch")),v(false);},[i,P,a,n,l,t,o]);return {query:i,setQuery:w,activeTabId:l,setActiveTabId:d,searchMode:p,hits:h,statusText:u,aiResponse:C,searching:x,handleSubmit:I,clearResult:k}};var bA=({title:t,subtitle:o,sections:r,tabs:n=[],defaultTabId:a,table:i,ai:s,rightHeaderSlot:l,searchBarWidth:d=460,onClose:p,closeLabel:m="Close"})=>{let{t:h}=ce(),{query:f$1,setQuery:u,activeTabId:b,setActiveTabId:C,searchMode:g$1,hits:x,statusText:v,aiResponse:y,searching:k,handleSubmit:w,clearResult:P}=pu({sections:r,tabs:n,defaultTabId:a,ai:s}),I=useMemo(()=>n.find(N=>N.id===b)||n[0],[n,b]),S=useCallback(N=>{let T=M=>{let A=document.getElementById(N);if(A){A.scrollIntoView({behavior:"smooth",block:"center"});return}M<4&&setTimeout(()=>T(M+1),60);};requestAnimationFrame(()=>T(0));},[]),R=useCallback((N,T)=>{if(n.some(M=>M.id===N)){C(N),S(T?`detail-tab-${N}-section-${T}`:`detail-tab-${N}`);return}S(`detail-section-${N}`);},[n,C,S]);return g("div",{sx:{display:"flex",flexDirection:"column",gap:1.5,minHeight:"100%"},children:[g(se,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",md:"center"},spacing:1,children:[g("div",{sx:{minWidth:0},children:[f(E,{variant:"h5",sx:{fontWeight:800,color:"text.primary"},children:t}),o&&f(E,{variant:"body2",color:"text.secondary",sx:{mt:.35},children:o})]}),g(se,{direction:"row",spacing:.6,alignItems:"center",sx:{width:{xs:"100%",md:"auto"},ml:{xs:0,md:"auto"}},children:[f("div",{sx:{width:{xs:"100%",md:d},maxWidth:"100%",minWidth:{md:320}},children:f(cu,{value:f$1,onChange:u,onSubmit:w,onVoiceInput:s?.onVoiceInput,onClear:()=>{u(""),P();},placeholder:s?.placeholder||h("detail.searchAi.placeholder"),statusText:v,loading:k,compact:true,showStatusText:false})}),p&&f(ct,{title:m,children:f(ie,{size:"small",onClick:p,children:f(qd,{fontSize:"small"})})}),l]})]}),v&&f(E,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:v}),g$1==="search"&&x.length>0&&g(Ne,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[f(E,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.6},children:h("detail.searchAi.matches",{count:x.length})}),f(se,{spacing:.35,children:x.slice(0,8).map(N=>f("div",{component:"button",type:"button",onClick:()=>R(N.sourceId,N.sourceSectionId),sx:{textAlign:"left",border:0,bgcolor:"transparent",p:.2,cursor:"pointer",color:"text.primary",borderRadius:1,"&:hover":{bgcolor:"action.hover"}},children:g(E,{variant:"body2",sx:{fontSize:"0.84rem"},children:[f("div",{component:"span",sx:{color:"text.secondary"},children:N.sourceTitle})," \xB7 ",f("div",{component:"span",sx:{fontWeight:700},children:N.fieldLabel})," = ",f("div",{component:"span",children:N.fieldValue||"-"})]})},`${N.source}|${N.sourceId}|${N.fieldId}`))})]}),g$1==="ai"&&y&&g(Ne,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[f(E,{variant:"subtitle2",sx:{fontWeight:700,mb:.7},children:h("detail.searchAi.aiResultTitle")}),f("div",{sx:{fontSize:"0.9rem",lineHeight:1.6,"& p":{m:0,mb:.8},"& h1, & h2, & h3, & h4":{mt:1.2,mb:.6,lineHeight:1.3},"& ul, & ol":{mt:.4,mb:.8,pl:2.6},"& code":{px:.5,py:.1,borderRadius:.8,bgcolor:"action.hover",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},"& pre":{m:0,mt:.8,mb:.8,p:1.1,borderRadius:1.2,bgcolor:"action.hover",overflowX:"auto"},"& pre code":{p:0,bgcolor:"transparent"}},children:f(da,{markdown:y})})]}),f("div",{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:r.map(N=>f("div",{id:`detail-section-${N.id}`,children:f(Hi,{section:N,highlightQuery:f$1})},N.id))}),n.length>0&&g(Ne,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[f(Ld,{value:I?.id||false,onChange:(N,T)=>C(String(T)),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:n.map(N=>f(Od,{value:N.id,label:N.label,sx:{textTransform:"none"}},N.id))}),g("div",{sx:{p:1.5},children:[f("div",{id:`detail-tab-${I?.id||""}`}),I?.description&&f(E,{variant:"body2",color:"text.secondary",sx:{mb:1.2},children:I.description}),I?.content?I.content:g(se,{spacing:1.5,children:[(I?.sections||[]).map(N=>f("div",{id:`detail-tab-${I?.id}-section-${N.id}`,children:f(Hi,{section:N,highlightQuery:f$1})},N.id)),I?.fields&&I.fields.length>0&&f(Hi,{section:{id:`${I.id}-fields`,title:I.label,fields:I.fields,columns:2},highlightQuery:f$1})]})]})]}),i&&f(er,{title:i.title||h("detail.table.title"),...i.tableProps,filterConfig:void 0,fitContainer:false})]})};var gu=({bucket:t,cardCount:o,highlighted:r=false,children:n,emptyLabel:a,height:i,maxHeight:s,onRename:l,renameLabel:d,sx:p})=>{let{t:m}=ce(),[h,f$1]=useState(false),[u,b]=useState(t.title),C=()=>{b(t.title),f$1(false);},g$1=x=>{x.preventDefault();let v=u.trim();v&&(v!==t.title&&l?.(v),b(v),f$1(false));};return f(Ne,{elevation:0,sx:[x=>{let v=t.accentColor??x.palette.primary.main;return {position:"relative",display:"flex",flexDirection:"column",minWidth:0,minHeight:0,height:i??s??560,maxHeight:s,borderRadius:"var(--orb-r-container)",overflow:"hidden",border:r?`1px solid ${tt(v,.65)}`:"1px solid var(--orb-border)",bgcolor:"var(--orb-canvas)",boxShadow:r?`0 0 0 2px ${tt(v,.16)}, var(--orb-shadow-2)`:"none",transition:"border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease","&::before":{content:'""',display:"block",flexShrink:0,height:3,bgcolor:v}}},...Array.isArray(p)?p:p?[p]:[]],children:g(se,{spacing:1.25,sx:{flex:1,minHeight:0,overflow:"hidden",p:1.5},children:[g(Ie,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1.25},children:[f(Ie,{sx:{minWidth:0,flex:1},children:g(Ie,{sx:{display:"flex",alignItems:"center",gap:.75,minHeight:28},children:[t.icon&&f(Ie,{sx:{display:"inline-flex",flexShrink:0,color:t.accentColor??"var(--orb-primary)"},children:t.icon}),h?g(Ie,{component:"form",onSubmit:g$1,sx:{display:"flex",alignItems:"center",gap:.5,flex:1,minWidth:0},children:[f(He,{dense:true,autoFocus:true,value:u,onChange:x=>b(x.target.value),onKeyDown:x=>{x.key==="Escape"&&(x.preventDefault(),C());},inputProps:{"aria-label":d??m("kanban.bucket.rename")},error:!u.trim(),sx:{flex:1,minWidth:0}}),f(ie,{type:"submit",size:"small",tooltip:m("kanban.bucket.saveRename"),"aria-label":m("kanban.bucket.saveRename"),disabled:!u.trim(),children:f(xo,{size:14})}),f(ie,{size:"small",tooltip:m("kanban.bucket.cancelRename"),"aria-label":m("kanban.bucket.cancelRename"),onClick:C,children:f(Kt,{size:14})})]}):f(E,{component:"div",sx:{fontSize:15,fontWeight:600,lineHeight:1.35,color:"text.primary"},children:t.title})]})}),!h&&g(se,{direction:"row",spacing:.75,sx:{flexShrink:0},children:[f(Ct,{size:"small",label:o,sx:{minWidth:24,justifyContent:"center",fontWeight:600}}),typeof t.limit=="number"&&f(Ct,{size:"small",label:`${m("kanban.bucket.limit")} ${t.limit}`,color:o>t.limit?"warning":"default",variant:"outlined"}),l&&f(ie,{size:"small",tooltip:d??m("kanban.bucket.rename"),"aria-label":d??m("kanban.bucket.rename"),onClick:()=>{b(t.title),f$1(true);},sx:{width:26,height:26},children:f(Ec,{size:14})})]})]}),r&&f(E,{component:"div",sx:{fontSize:12,color:t.accentColor??"var(--orb-primary)",fontWeight:500},children:m("kanban.bucket.dropHere")}),f(Ie,{sx:{flex:1,height:0,minHeight:0,overflowY:"auto",overscrollBehavior:"contain",pr:.4,scrollbarGutter:"stable"},children:o>0?n:f(Ie,{sx:{minHeight:"100%",borderRadius:"var(--orb-r-container)",border:"1px dashed var(--orb-border)",bgcolor:"transparent",display:"grid",placeItems:"center",px:2,textAlign:"center"},children:f(E,{sx:{fontSize:13,color:"text.secondary"},children:a??t.emptyLabel??m("kanban.empty")})})})]})})};var Jb={success:"success",warning:"warning",info:"info",error:"error"},ev={critical:"error",high:"warning",medium:"info",low:"success"},tv={default:"var(--orb-primary)",success:"var(--orb-primary)",warning:"var(--orb-accent)",info:"var(--orb-primary)",error:"var(--orb-err)"},ov=(t,o)=>{switch(t){case "critical":return o("kanban.priority.critical");case "high":return o("kanban.priority.high");case "medium":return o("kanban.priority.medium");case "low":return o("kanban.priority.low");default:return t}},rv=t=>t?t.split(/\s+/).map(o=>o.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",Sl=({card:t,bucket:o,dragging:r=false,overlay:n=false,onClick:a,sx:i})=>{let{t:s}=ce(),l=!!(a&&o),d=t.tone??(t.priority?ev[t.priority]:"default"),p=d==="default"?"primary":Jb[d],m=tv[d],h=o?{card:t,bucket:o}:void 0;return f(Ne,{onClick:l?()=>h&&a?.(h):void 0,onKeyDown:l?f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),h&&a?.(h));}:void 0,role:l?"button":void 0,tabIndex:l?0:void 0,sx:[{position:"relative",minWidth:0,overflow:"hidden",p:1.5,pl:1.75,borderRadius:"var(--orb-r-container)",border:`1px solid ${tt(m,.24)}`,bgcolor:"var(--orb-canvas)",boxShadow:n?"var(--orb-shadow-3)":r?"none":"var(--orb-shadow-1)",transform:n?"rotate(1deg) scale(1.01)":"none",transition:"transform var(--orb-t-fast), box-shadow var(--orb-t-fast), border-color var(--orb-t-fast)",cursor:l?"pointer":"default",opacity:r?.5:1,"&::before":{content:'""',position:"absolute",inset:"0 auto 0 0",width:3,bgcolor:m},"&:hover":l?{transform:"translateY(-1px)",borderColor:tt(m,.48),boxShadow:"var(--orb-shadow-2)"}:void 0,"&:focus-visible":l?{outline:"2px solid var(--orb-focus-solid)",outlineOffset:2}:void 0},...Array.isArray(i)?i:i?[i]:[]],elevation:0,children:g(se,{spacing:1.25,children:[g(Ie,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[g(Ie,{sx:{minWidth:0,flex:1},children:[(t.kicker||o?.title)&&f(E,{component:"div",sx:{fontSize:11,fontWeight:500,color:"text.secondary",textTransform:"uppercase"},children:t.kicker??o?.title}),f(E,{component:"div",sx:{mt:.25,fontSize:14,fontWeight:600,lineHeight:1.4,color:"text.primary"},children:t.title})]}),t.priority&&f(Ct,{size:"small",color:p,label:ov(t.priority,s),variant:d==="default"?"outlined":"filled",sx:{height:22,flexShrink:0,fontWeight:500}})]}),t.summary&&f(E,{component:"div",sx:{fontSize:13,fontWeight:300,color:"text.secondary",lineHeight:1.5},children:t.summary}),t.metrics&&t.metrics.length>0&&f(Ie,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.min(t.metrics.length,3)}, minmax(0, 1fr))`,gap:.75},children:t.metrics.slice(0,3).map(f$1=>g(Ie,{sx:{minWidth:0,borderRadius:"var(--orb-r)",px:1,py:.75,bgcolor:"var(--orb-surface)",border:"1px solid var(--orb-border)"},children:[f(E,{component:"div",noWrap:true,sx:{fontSize:11,fontWeight:500,color:"text.secondary",textTransform:"uppercase"},children:f$1.label}),f(E,{component:"div",noWrap:true,numeric:true,sx:{mt:.25,fontSize:13,fontWeight:600},children:f$1.value})]},f$1.id))}),typeof t.progress=="number"&&g(Ie,{children:[g(Ie,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:.5},children:[f(E,{sx:{fontSize:12,color:"text.secondary"},children:s("kanban.card.progress")}),g(E,{numeric:true,sx:{fontSize:12,fontWeight:600},children:[Math.round(t.progress),"%"]})]}),f(kd,{variant:"determinate",value:Math.max(0,Math.min(100,t.progress)),color:m,sx:{height:4,borderRadius:2}})]}),(t.tags?.length||t.assignee||t.dueDate||t.footer||l)&&g(se,{spacing:.9,children:[t.tags&&t.tags.length>0&&f(Ie,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:t.tags.map(f$1=>f(Ct,{size:"small",label:f$1.label,color:f$1.color??"default",variant:"outlined"},f$1.id))}),g(Ie,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,flexWrap:"wrap"},children:[g(Ie,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0},children:[t.assignee&&g(e,{children:[f(Ja,{src:t.assignee.avatarSrc,sx:{width:28,height:28,fontSize:11},children:t.assignee.initials??rv(t.assignee.name)}),g(Ie,{sx:{minWidth:0},children:[f(E,{component:"div",sx:{fontSize:13,fontWeight:500,lineHeight:1.3},noWrap:true,children:t.assignee.name}),t.dueDate&&f(E,{component:"div",sx:{fontSize:11,color:"text.secondary",lineHeight:1.35},noWrap:true,children:t.dueDate})]})]}),!t.assignee&&t.dueDate&&f(E,{sx:{fontSize:12,color:"text.secondary"},children:t.dueDate})]}),l&&f(E,{sx:{fontSize:12,color:"var(--orb-link)",fontWeight:500,whiteSpace:"nowrap"},children:s("kanban.card.openDetail")})]}),t.footer]})]})})};var hu=(t,o)=>{let r=o.title.trim();return !o.id||!r||t.buckets.some(n=>n.id===o.id)?t:{buckets:[...t.buckets,{...o,title:r,cards:[]}]}},fu=(t,o,r)=>{let n=r.trim();if(!n)return t;let a=t.buckets.find(i=>i.id===o);return !a||a.title===n?t:{buckets:t.buckets.map(i=>i.id===o?{...i,title:n}:i)}},nv=(t,o)=>Number.isNaN(t)||t<0?0:t>o?o:t,bu=({buckets:t,cards:o})=>{let r=new Map;return o.forEach((n,a)=>{let i=r.get(n.bucketId)??[];i.push({card:n,sourceIndex:a}),r.set(n.bucketId,i);}),{buckets:t.map(n=>{let a=[...r.get(n.id)??[]].sort((i,s)=>i.card.position===void 0&&s.card.position===void 0?i.sourceIndex-s.sourceIndex:i.card.position===void 0?1:s.card.position===void 0?-1:i.card.position-s.card.position||i.sourceIndex-s.sourceIndex).map(({card:i},s)=>({...i,bucketId:n.id,position:s}));return {...n,cards:a}})}},Go=(t,o)=>{for(let r=0;r<t.buckets.length;r+=1){let n=t.buckets[r],a=n.cards.findIndex(i=>i.id===o);if(a>=0)return {card:n.cards[a],bucket:n,bucketIndex:r,cardIndex:a}}},Wi=(t,o)=>{let r=Go(t,o.cardId);if(!r)return t;let n=t.buckets.findIndex(p=>p.id===o.toBucketId);if(n<0)return t;let a=t.buckets.map(p=>({...p,cards:p.cards.map(m=>({...m}))})),i=a[r.bucketIndex],[s]=i.cards.splice(r.cardIndex,1);if(!s)return t;let l=a[n],d=nv(o.targetIndex??l.cards.length,l.cards.length);return l.cards.splice(d,0,{...s,bucketId:o.toBucketId}),{buckets:a.map(p=>({...p,cards:p.cards.map((m,h)=>({...m,bucketId:p.id,position:h}))}))}};var Tl="kanban-card|",Il="kanban-bucket|",Cu=t=>`${Tl}${t}`,hv=t=>`${Il}${t}`,$i=t=>t?.startsWith(Tl)?t.slice(Tl.length):void 0,yu=t=>t?.startsWith(Il)?t.slice(Il.length):void 0,fv=({card:t,bucket:o,onCardClick:r})=>{let{setNodeRef:n,attributes:a,listeners:i,transform:s,transition:l,isDragging:d}=useSortable({id:Cu(t.id)}),p={transform:s?`translate3d(${s.x}px, ${s.y}px, 0)`:void 0,transition:l,zIndex:d?2:1,touchAction:"none",cursor:d?"grabbing":"grab"};return f("div",{ref:n,style:p,...a,...i,children:f(Sl,{card:t,bucket:o,dragging:d,onClick:r})})},bv=({bucket:t,highlighted:o,bucketHeight:r,emptyBucketLabel:n,onBucketRename:a,onCardClick:i})=>{let{isOver:s,setNodeRef:l}=useDroppable({id:hv(t.id)});return f(Ie,{ref:l,sx:{minWidth:0,minHeight:0,height:r},children:f(gu,{bucket:t,cardCount:t.cards.length,highlighted:o||s,emptyLabel:n,height:r,onRename:a,children:f(SortableContext,{items:t.cards.map(d=>Cu(d.id)),strategy:verticalListSortingStrategy,children:f(se,{spacing:1,children:t.cards.map(d=>f(fv,{card:d,bucket:t,onCardClick:i},d.id))})})})})},xu=t=>String(t??"").toLocaleLowerCase(),vv=(t,o)=>[t.id,t.title,t.summary,t.kicker,t.priority,t.tone,t.progress,t.dueDate,t.assignee?.id,t.assignee?.name,...t.tags?.flatMap(n=>[n.id,n.label])??[],...t.metrics?.flatMap(n=>[n.label,n.value])??[]].some(n=>xu(n).includes(o)),UA=({model:t,onCardMove:o,onCardClick:r,cardFilter:n,onBucketAdd:a,onBucketRename:i,addBucketLabel:s,minBucketWidth:l=320,bucketHeight:d,bucketMaxHeight:p,searchable:m=false,searchValue:h,defaultSearchValue:f$1="",onSearchValueChange:u,searchPlaceholder:b,emptyBucketLabel:C,sx:g$1})=>{let{t:x}=ce(),[v,y]=useState(null),[k,w]=useState(),[P,I]=useState(f$1),S=h??P,R=S.trim().toLocaleLowerCase(),N=d??p??560,T=useMemo(()=>({buckets:t.buckets.map(H=>{let B=n?H.cards.filter(Z=>n(Z,H)):H.cards;if(!R)return {...H,cards:B};let q=[H.id,H.title,H.description].some(Z=>xu(Z).includes(R));return {...H,cards:q?B:B.filter(Z=>vv(Z,R))}})}),[n,t,R]),M=useMemo(()=>T.buckets.reduce((H,B)=>H+B.cards.length,0),[T]),A=useCallback(H=>{h===void 0&&I(H),u?.(H);},[u,h]),L=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:6}}),useSensor(TouchSensor,{activationConstraint:{delay:120,tolerance:8}})),W=useMemo(()=>v?Go(t,v):void 0,[v,t]),ee=useCallback(()=>{y(null),w(void 0);},[]),O=useCallback(H=>{if(!H)return;let B=$i(H);return B?Go(t,B)?.bucket.id:yu(H)},[t]),_=useCallback(H=>{y($i(String(H.active.id))??null);},[]),V=useCallback(H=>{w(O(H.over?String(H.over.id):void 0));},[O]),Q=useCallback(H=>{let B=$i(String(H.active.id)),q=H.over?String(H.over.id):void 0;if(!B||!q){ee();return}let Z=Go(t,B);if(!Z){ee();return}let Y=Z.bucket.id,J=Z.cardIndex,le=$i(q);if(le){let be=Go(t,le);if(!be){ee();return}Y=be.bucket.id,J=be.cardIndex;}else {let be=yu(q),Ce=t.buckets.find(Be=>Be.id===be);if(!be||!Ce){ee();return}Y=be,J=Ce.cards.length;}if(Z.bucket.id===Y&&Z.cardIndex===J){ee();return}let he=Wi(t,{cardId:B,fromBucketId:Z.bucket.id,toBucketId:Y,targetIndex:J}),ze=Go(he,B);ze&&!(ze.bucket.id===Z.bucket.id&&ze.cardIndex===Z.cardIndex)&&o?.({cardId:B,fromBucketId:Z.bucket.id,toBucketId:ze.bucket.id,targetIndex:ze.cardIndex,card:ze.card,model:he}),ee();},[t,o,ee]);return g(DndContext,{sensors:L,collisionDetection:closestCorners,onDragStart:_,onDragOver:V,onDragEnd:Q,onDragCancel:ee,children:[g(Ie,{sx:{display:"flex",flexDirection:"column",minWidth:0,minHeight:0,height:"100%",overflow:"hidden"},children:[(m||a)&&g(Ie,{role:m?"search":void 0,sx:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:1.5,mb:1.25,minWidth:0},children:[m&&f(Ie,{sx:{width:"100%",maxWidth:360,flex:"1 1 240px"},children:f(He,{dense:true,value:S,onChange:H=>A(H.target.value),placeholder:b??x("kanban.search.placeholder"),autoComplete:"off",sx:{"& .orb-inp":{paddingLeft:"38px",paddingRight:S?"42px":"12px"},"& .orb-inp-adornment-end":{pointerEvents:"auto"}},startAdornment:f(zo,{size:16,"aria-hidden":"true"}),endAdornment:S?f(ie,{size:"small",tooltip:x("kanban.search.clear"),"aria-label":x("kanban.search.clear"),onClick:()=>A(""),sx:{width:26,height:26},children:f(Kt,{size:15})}):void 0})}),g(Ie,{sx:{display:"flex",alignItems:"center",gap:1,ml:"auto"},children:[R&&f(E,{component:"div","aria-live":"polite",sx:{flexShrink:0,fontSize:12,fontWeight:500,color:"text.secondary"},children:M>0?x("kanban.search.results",{count:M}):x("kanban.search.noMatch")}),a&&f(Pe,{size:"small",variant:"secondary",startIcon:f(jr,{size:15}),onClick:a,children:s??x("kanban.bucket.add")})]})]}),f(Ie,{sx:[{display:"grid",gridAutoFlow:"column",gridAutoColumns:`minmax(${l}px, ${Math.max(l,360)}px)`,gap:1.5,gridAutoRows:N==="100%"?"minmax(0, 1fr)":void 0,alignItems:"stretch",justifyContent:"start",flex:"1 1 0",height:"100%",minHeight:0,overflowX:"auto",overflowY:"hidden",overscrollBehavior:"contain",scrollbarGutter:"stable both-edges",pb:.5},...Array.isArray(g$1)?g$1:g$1?[g$1]:[]],children:T.buckets.map(H=>f(bv,{bucket:H,highlighted:H.id===k,bucketHeight:N,emptyBucketLabel:R?x("kanban.search.noMatch"):C,onBucketRename:i?B=>i(H.id,B):void 0,onCardClick:r},H.id))})]}),f(DragOverlay,{children:W?f(Ie,{sx:{width:Math.max(l-24,260)},children:f(Sl,{card:W.card,bucket:W.bucket,overlay:true})}):null})]})};var xv=({initialModel:t,initialBuckets:o,initialCards:r})=>t||bu({buckets:o??[],cards:r??[]}),YA=t=>{let{onCardMove:o,onCardClick:r}=t,[n,a]=useState(()=>xv(t)),i=useCallback(f=>{a(u=>typeof f=="function"?f(u):f);},[]),s=useCallback(f=>Go(n,f),[n]),l=useCallback((f,u,b)=>{let C=Go(n,f);if(!C)return;let g=Wi(n,{cardId:f,fromBucketId:C.bucket.id,toBucketId:u,targetIndex:b}),x=Go(g,f);if(!x||x.bucket.id===C.bucket.id&&x.cardIndex===C.cardIndex)return;a(g);let v={cardId:f,fromBucketId:C.bucket.id,toBucketId:x.bucket.id,targetIndex:x.cardIndex,card:x.card,model:g};return o?.(v),v},[n,o]),d=useCallback((f,u)=>{a(b=>({buckets:b.buckets.map(C=>({...C,cards:C.cards.map(g=>g.id!==f?g:typeof u=="function"?u(g):{...g,...u})}))}));},[]),p=useCallback(f=>{let u=hu(n,f);return u===n?false:(a(u),true)},[n]),m=useCallback((f,u)=>{let b=fu(n,f,u);return b===n?false:(a(b),true)},[n]),h=useMemo(()=>({model:n,onCardMove:f=>{l(f.cardId,f.toBucketId,f.targetIndex);},onCardClick:r}),[n,l,r]);return {model:n,actions:{replaceModel:i,moveCard:l,updateCard:d,addBucket:p,renameBucket:m,getCard:s},boardProps:h}};function Cn({onTextUpdate:t,onComplete:o,onError:r,wsUrl:n="ws://localhost:8765",silenceThresholdMs:a=2e3,minVolumeRms:i=.015}){let[s,l]=useState(false),d=useRef(null),p=useRef(null),m=useRef(null),h=useRef(null),f=useRef(null),u=useRef(0),b=useRef(false),C=useRef(false),g=useCallback(()=>{d.current&&(d.current.close(),d.current=null),h.current&&(h.current.disconnect(),h.current=null),f.current&&(f.current.disconnect(),f.current=null),p.current&&(p.current.getTracks().forEach(y=>y.stop()),p.current=null),m.current&&(m.current.close(),m.current=null),C.current=false,l(false);},[]),x=useCallback(()=>{b.current||(b.current=true,d.current?.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"stop"})),setTimeout(g,500));},[g]),v=useCallback(async()=>{if(!(s||C.current)){C.current=true,b.current=false,u.current=Date.now();try{let y=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:16e3,echoCancellation:!0,noiseSuppression:!0}});p.current=y;let k=new WebSocket(n);d.current=k,k.onopen=()=>{l(!0),C.current=!1;},k.onmessage=R=>{try{let N=JSON.parse(R.data);if(N.type==="recognition")N.is_final?o(N.text):t?.(N.text);else if(N.type==="error"){let T=N.message||"Voice recognition error";r?.(T),x();}}catch{r?.("Failed to parse voice message");}},k.onerror=()=>{r?.("Voice service connection failed"),g();},k.onclose=()=>{g();};let w=window.AudioContext||window.webkitAudioContext;if(!w)throw new Error("AudioContext is not supported in this browser");let P=new w({sampleRate:16e3});m.current=P;let I=P.createMediaStreamSource(y);f.current=I;let S=P.createScriptProcessor(4096,1,1);h.current=S,S.onaudioprocess=R=>{if(d.current?.readyState!==WebSocket.OPEN)return;let N=R.inputBuffer.getChannelData(0),T=0;for(let L=0;L<N.length;L+=1)T+=N[L]*N[L];if(Math.sqrt(T/N.length)>i)u.current=Date.now();else if(Date.now()-u.current>a&&!b.current){x();return}let A=new Int16Array(N.length);for(let L=0;L<N.length;L+=1){let W=Math.max(-1,Math.min(1,N[L]));A[L]=W<0?W*32768:W*32767;}d.current.send(A.buffer);},I.connect(S),S.connect(P.destination);}catch{r?.("Cannot access microphone"),g();}}},[g,s,i,o,r,t,a,x,n]);return useEffect(()=>g,[g]),{isRecording:s,startRecording:v,stopRecording:x}}var Pv=["en","zh","fr","de","ja","ko"],Su={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},Rl=({searchPlaceholder:t,onSearch:o,onSearchAdd:r,onOpenPanel:n,panelOpen:a=false,maxWidth:i=540,sx:s})=>{let{t:l}=ce(),[d,p]=useState(""),m=useCallback((x=d)=>{let v=x.trim();v&&(p(""),o?.(v));},[o,d]),h=x=>{x.preventDefault(),m();},{isRecording:f$1,startRecording:u,stopRecording:b}=Cn({onTextUpdate:p,onComplete:x=>{p(x),m(x);},onError:x=>{console.error("Header voice input error:",x);}}),C=useCallback(async()=>{if(f$1){b();return}await u();},[f$1,u,b]),g$1=t||l("header.searchPlaceholder");return f("form",{className:"orb-app-header-search",onSubmit:h,style:{width:"100%",maxWidth:typeof i=="number"?`${i}px`:i,...s},children:g("div",{className:"orb-inp-adornment-wrap orb-app-header-search-shell",style:{background:"var(--orb-surface)",border:"1px solid var(--orb-border)",borderRadius:999,paddingRight:4},children:[f("div",{className:"orb-inp-adornment",children:f(ie,{className:"orb-app-header-ai-action",size:"small",onClick:r,tooltip:l("header.searchAddFeature"),children:f(Pt,{name:"add",size:16})})}),f("input",{className:"orb-inp orb-inp-dense orb-app-header-ai-input",value:d,onChange:x=>p(x.target.value),placeholder:g$1,style:{border:"none",background:"transparent",flex:1,minWidth:0}}),g("div",{className:"orb-inp-adornment orb-inp-adornment-end",children:[n&&!a&&f(ie,{className:"orb-app-header-ai-action",size:"small","aria-label":l("header.searchOpenPanel"),tooltip:l("header.searchOpenPanel"),onClick:n,children:f(Pt,{name:"message",size:16})}),f(ie,{className:"orb-app-header-ai-action",size:"small",onClick:()=>{C();},tooltip:l(f$1?"header.searchStopVoice":"header.searchStartVoice"),sx:{color:f$1?"var(--orb-err)":void 0},children:f(Pt,{name:"microphone",size:16})})]})]})})},_i=({appTitle:t,logo:o,onToggleMode:r,locale:n,localeLabel:a,localeOptions:i,onLocaleChange:s,searchPlaceholder:l,showSearch:d=false,onSearch:p,onSearchAdd:m,onOpenPanel:h,panelOpen:f$1,user:u,onUserRefresh:b,onUserSetting:C,onUserLogout:g$1,userMenuItems:x,leftSlot:v,rightSlot:y})=>{let{t:k,locale:w}=ce(),P=go(),I=n||w,S=a||Su[I],R=i||Pv,N=P==="dark"?f(Uc,{size:15}):f(Zc,{size:15}),T=k(P==="dark"?"header.theme.dark":"header.theme.light"),M=[...b?[{key:"refresh",label:k("header.menu.refresh"),icon:f(Ha,{size:15}),onClick:b}]:[],...C?[{key:"settings",label:k("header.menu.setting"),icon:f(Jr,{size:16}),onClick:C}]:[],...g$1?[{key:"logout",label:k("header.menu.logout"),icon:f(Wc,{size:16}),onClick:g$1}]:[]],A=x||M,L=R.map(W=>({label:Su[W],onClick:()=>{s?.(W),window.requestAnimationFrame(()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur();});},disabled:W===I}));return g("header",{className:"orb-app-header",children:[g("div",{className:"orb-app-header-brand",children:[v,o===null?null:o||f("div",{className:"orb-app-header-default-logo","aria-label":"ORBCAFE",children:f(Pt,{name:"product",size:20})}),t&&f(E,{variant:"h4",sx:{fontWeight:700},children:t})]}),f("div",{className:"orb-app-header-center",children:d&&f(Rl,{searchPlaceholder:l,onSearch:p,onSearchAdd:m,onOpenPanel:h,panelOpen:f$1})}),g("div",{className:"orb-app-header-actions",children:[g("div",{className:"orb-app-header-utilities",children:[s?f(Qt,{triggerLabel:S,trigger:g("button",{type:"button",className:"orb-icon-btn orb-app-header-locale",children:[f(Hn,{size:15}),f("span",{className:"orb-label",children:S})]}),items:L,align:"end"}):g("div",{className:"orb-app-header-locale","aria-label":S,children:[f(Hn,{size:15}),f("span",{className:"orb-label",children:S})]}),f(ie,{className:"orb-app-header-theme",size:"small",onClick:r,tooltip:T,children:N})]}),u&&f("span",{className:"orb-app-header-divider","aria-hidden":"true"}),u&&f(Qt,{triggerLabel:u.name,trigger:g("button",{type:"button",className:"orb-app-header-user-trigger",children:[g("span",{className:"orb-app-header-user-copy",children:[f(E,{variant:"body2",className:"orb-app-header-user-name",children:u.name}),u.subtitle&&f(E,{variant:"caption",muted:true,className:"orb-app-header-user-subtitle",title:u.subtitle,children:u.subtitle})]}),f(en,{src:u.avatarSrc,alt:u.name,size:32,children:u.avatarText||u.name.slice(0,1).toUpperCase()})]}),items:A.map(W=>({label:W.label,onClick:W.onClick,disabled:W.disabled,icon:W.icon})),align:"end"}),y]})]})};var ku=({menuData:t=[],initialNavigationCollapsed:o=false,initialNavigationMode:r="fixed",enableNavigationPinning:n,navigationPinStorageKey:a,pinnedNavigationItemIds:i,defaultPinnedNavigationItemIds:s,onPinnedNavigationItemIdsChange:l,pinnedNavigationSectionTitle:d}={})=>{let{navigationIslandProps:p}=bd({initialCollapsed:o,initialDisplayMode:r,content:t,enablePinning:n,pinStorageKey:a,pinnedItemIds:i,defaultPinnedItemIds:s,onPinnedItemIdsChange:l,pinnedSectionTitle:d}),[m,h]=useState(900);useEffect(()=>{let u=()=>h(window.innerHeight);return u(),window.addEventListener("resize",u),()=>window.removeEventListener("resize",u)},[]);let f=useMemo(()=>Math.max(280,m-100),[m]);return {navigationIslandProps:p,navigationMaxHeight:f}};var Oo=12,Tu=56,Iu=234,Dv="orbcafe:page-layout-locale",Mu=["en","zh","fr","de","ja","ko"],Nv=t=>encodeURIComponent(t.trim().toLowerCase()).replace(/%/g,"").replace(/[^a-z0-9._~-]+/g,"-")||"app",Gi=(t,o)=>`orbcafe:page-layout:${Nv(t)}:${o}`,Av=t=>`orbcafe:page-layout:${t.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-")||"app"}:pinned-navigation-items`,Ev=t=>t==="system"?"dark":t==="dark"?"light":"system",Ui=(t,o,r)=>Math.min(Math.max(t,o),Math.max(o,r)),Lv=t=>t instanceof HTMLElement?!!t.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,yE=({appId:t,appTitle:o,menuData:r=[],children:n,showNavigation:a=true,locale:i="en",localeLabel:s,localeOptions:l,onLocaleChange:d,mode:p,defaultMode:m="system",onModeChange:h,user:f$1,onUserRefresh:u,onUserSetting:b,onUserLogout:C,userMenuItems:g$1,logo:x,searchPlaceholder:v,searchPlacement:y="hidden",floatingSearchSx:k,onSearch:w,onSearchAdd:P,onOpenPanel:I,panelOpen:S,rightHeaderSlot:R,leftHeaderSlot:N,contentSx:T,navigationVariant:M="classic",navigationMode:A,defaultNavigationMode:L="fixed",onNavigationModeChange:W,showNavigationModeToggle:ee=true,enableNavigationPinning:O=true,navigationPinStorageKey:_,pinnedNavigationItemIds:V,defaultPinnedNavigationItemIds:Q,onPinnedNavigationItemIdsChange:H,pinnedNavigationSectionTitle:B})=>{let q=t?Gi(t,"mode"):"orbcafe:page-layout-mode",Z=t?Gi(t,"locale"):Dv,Y=t?Gi(t,"navigation-mode"):"orbcafe:page-layout-navigation-mode",[J,le]=useState(m),[he,ze]=useState("light"),[be,Ce]=useState(false),[Be,de]=useState(i),[ve,We]=useState(false),[et,nt]=useState(false),[it,U]=useState(L),[Re,we]=useState({x:Oo,y:Oo}),[Oe,at]=useState("left"),[Ze,xt]=useState(false),It=useRef(null),Ot=useRef(null),At=p!==void 0,re=p??J,Ge=d!==void 0,Le=Ge?i:Be,pe=l?.join("|")??"",xe=A!==void 0,oe=A??it,ye=oe==="floating",De=M==="v2"?Qs:pd,je=y==="header",st=re==="system"?be?he:"light":re;useEffect(()=>{if(!At)try{let fe=window.localStorage.getItem(q);(fe==="light"||fe==="dark"||fe==="system")&&le(fe);}catch{}Ce(true);let z=window.matchMedia("(prefers-color-scheme: dark)"),X=()=>{ze(z.matches?"dark":"light");};return X(),z.addEventListener("change",X),()=>z.removeEventListener("change",X)},[At,q]),useEffect(()=>{if(!(At||!be))try{window.localStorage.setItem(q,re);}catch{}},[be,At,re,q]),useEffect(()=>{if(Ge){We(true);return}try{let z=window.localStorage.getItem(Z),X=l??Mu;z&&Mu.includes(z)&&X.includes(z)&&de(z);}catch{}finally{We(true);}},[Ge,pe,Z]),useEffect(()=>{if(!(Ge||!ve))try{window.localStorage.setItem(Z,Le);}catch{}},[Le,Ge,ve,Z]),useEffect(()=>{if(xe){nt(true);return}try{let z=window.localStorage.getItem(Y);(z==="fixed"||z==="floating")&&U(z);}catch{}finally{nt(true);}},[xe]),useEffect(()=>{if(et)try{window.localStorage.setItem(Y,oe);}catch{}},[oe,et]),useEffect(()=>{st==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[st]);let pt=useCallback(z=>{xe||U(z),W?.(z);},[xe,W]),Bt=useCallback(z=>{At||le(z),h?.(z);},[At,h]),Xt=useCallback(z=>{Ge||de(z),d?.(z);},[Ge,d]),{navigationIslandProps:Vt,navigationMaxHeight:wt}=ku({menuData:r,initialNavigationCollapsed:false,initialNavigationMode:oe,enableNavigationPinning:O,navigationPinStorageKey:_??(t?Gi(t,"pinned-navigation-items"):Av(o)),pinnedNavigationItemIds:V,defaultPinnedNavigationItemIds:Q,onPinnedNavigationItemIdsChange:H,pinnedNavigationSectionTitle:B}),Wt=Vt.collapsed,ft=useCallback(z=>{let X=It.current,fe=X?.parentElement;if(!X||!fe)return z;let Se=fe.getBoundingClientRect(),Ae=X.getBoundingClientRect(),$e=Oo,Ke=Oo,Ye=Math.max($e,Se.width-Ae.width-Oo),ut=Math.max(Ke,Se.height-Ae.height-Oo);return {x:Ui(z.x,$e,Ye),y:Ui(z.y,Ke,ut)}},[]),Nt=useCallback(z=>{let X=It.current,fe=X?.parentElement;if(!X||!fe)return z;let Se=fe.getBoundingClientRect(),Ae=X.getBoundingClientRect(),$e=Oo,Ke=Oo,Ye=Math.max($e,Se.width-Ae.width-Oo),ut=Math.max(Ke,Se.height-Ae.height-Oo),gt={x:Ui(z.x,$e,Ye),y:Ui(z.y,Ke,ut)},bt=[{distance:Math.abs(gt.x-$e),position:{x:$e,y:gt.y}},{distance:Math.abs(gt.x-Ye),position:{x:Ye,y:gt.y}},{distance:Math.abs(gt.y-Ke),position:{x:gt.x,y:Ke}},{distance:Math.abs(gt.y-ut),position:{x:gt.x,y:ut}}].reduce((F,j)=>j.distance<F.distance?j:F).position;return at(bt.x>=($e+Ye)/2?"right":"left"),bt},[]),lt=useMemo(()=>{if(!ye||Ze)return Re.x;if(Oe==="right"){let fe=It.current?.parentElement?.getBoundingClientRect().width,Se=Wt?Tu:Iu;return fe?Math.max(Oo,fe-Se-Oo):Wt?Re.x:Re.x-(Iu-Tu)}return Re.x},[Oe,Re.x,Ze,ye,Wt]),Ft=useCallback(z=>{if(!ye||!Wt||Lv(z.target))return;z.preventDefault(),z.currentTarget.setPointerCapture(z.pointerId);let X=ft({x:lt,y:Re.y});at("left"),we(X),Ot.current={pointerId:z.pointerId,startClientX:z.clientX,startClientY:z.clientY,startX:X.x,startY:X.y,currentX:X.x,currentY:X.y},xt(true);},[ft,lt,Re.y,ye,Wt]),Zt=useCallback(z=>{let X=Ot.current;if(!X||X.pointerId!==z.pointerId)return;let fe=ft({x:X.startX+z.clientX-X.startClientX,y:X.startY+z.clientY-X.startClientY});X.currentX=fe.x,X.currentY=fe.y,we(fe);},[ft]),K=useCallback(z=>{let X=Ot.current;if(!(!X||X.pointerId!==z.pointerId)){try{z.currentTarget.releasePointerCapture(z.pointerId);}catch{}Ot.current=null,we(Nt({x:X.currentX,y:X.currentY})),xt(false);}},[Nt]);return useEffect(()=>{if(!ye)return;let z=()=>{we(Se=>ft(Se));},X=window.requestAnimationFrame(z),fe=window.setTimeout(z,430);return ()=>{window.cancelAnimationFrame(X),window.clearTimeout(fe);}},[ft,ye,Wt,wt]),f(Ln,{mode:re,children:f(Ua,{locale:Le,children:g("div",{className:"orb-root",style:{minHeight:"100vh",width:"100%",display:"flex",flexDirection:"column",overflowX:"hidden",background:"var(--orb-canvas)"},children:[f(_i,{appTitle:o,logo:x,mode:re,onToggleMode:()=>Bt(Ev(re)),locale:Le,localeLabel:Ge||Le===i?s:void 0,localeOptions:l,onLocaleChange:Xt,user:f$1,onUserRefresh:u,onUserSetting:b,onUserLogout:C,userMenuItems:g$1,searchPlaceholder:v,showSearch:je,onSearch:w,onSearchAdd:P,onOpenPanel:I,panelOpen:S,leftSlot:N,rightSlot:R}),y==="floating"&&f("div",{className:"orb-float-search",style:k,children:f(Rl,{searchPlaceholder:v,onSearch:w,onSearchAdd:P,onOpenPanel:I,panelOpen:S,maxWidth:"100%"})}),g("div",{style:{flex:1,minHeight:0,minWidth:0,display:"flex",overflowX:"hidden",position:"relative"},children:[a&&!ye&&f("div",{style:{paddingTop:12,paddingBottom:12,paddingLeft:12,paddingRight:Wt?4:12,display:"flex",alignItems:"flex-start",flexShrink:0},children:f(De,{...Vt,maxHeight:wt,colorMode:st,displayMode:oe,onDisplayModeChange:pt,showDisplayModeToggle:ee&&Wt})}),a&&ye&&f("div",{ref:It,onPointerDown:Ft,onPointerMove:Zt,onPointerUp:K,onPointerCancel:K,style:{position:"absolute",top:Re.y,left:lt,zIndex:1205,display:"flex",alignItems:"flex-start",cursor:Wt?Ze?"grabbing":"grab":"default",touchAction:Wt?"none":"auto",userSelect:Ze?"none":void 0,transition:Ze?"none":"left 180ms ease-out, top 180ms ease-out"},children:f(De,{...Vt,maxHeight:wt,colorMode:st,displayMode:oe,onDisplayModeChange:pt,showDisplayModeToggle:ee&&Wt})}),f("div",{style:{flex:1,minWidth:0,minHeight:0,overflow:"auto",paddingTop:12,paddingBottom:12,paddingRight:12,paddingLeft:a&&!ye&&Wt?4:12,...T},children:n})]})]})})})};var Ki="(blank)",Ru="Result",Du="Grand Total",Nu={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},Au=["sum","count","avg","min","max"];var Eu=["palette","rows","columns","filters","values"];var Lu=t=>Eu.includes(t),Ou=t=>t==="rows"||t==="columns"||t==="filters",qi=t=>{let o=t.split("|");return o.length===2&&o[0]==="container"&&Lu(o[1])?{kind:"container",zone:o[1]}:o.length===3&&o[0]==="item"&&Lu(o[1])&&o[2]?{kind:"item",zone:o[1],key:o[2]}:null},dr=t=>t==null||t===""?Ki:t instanceof Date?t.toISOString().slice(0,10):String(t),Wr=t=>JSON.stringify(t),Fu=(t,o)=>{let r=t.join(""),n=o.join("");return r.localeCompare(n,void 0,{sensitivity:"base"})},Ov=t=>{if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"&&t.trim()!==""){let o=Number(t);return Number.isFinite(o)?o:null}return null},xn=(t,o,r)=>{if(r==="count")return t.length;let n=t.map(a=>Ov(a[o])).filter(a=>a!==null);return n.length===0?0:r==="sum"?n.reduce((a,i)=>a+i,0):r==="avg"?n.reduce((a,i)=>a+i,0)/n.length:r==="min"?Math.min(...n):Math.max(...n)},so=(t,o)=>{if(!t||t.length===0)return [];let r=new Set,n=[];return t.forEach(a=>{!o.has(a)||r.has(a)||(r.add(a),n.push(a));}),n},pr=(t,o)=>t.length!==o.length?false:t.every((r,n)=>r===o[n]),Bu=(t,o)=>{let r=Object.keys(t),n=Object.keys(o);return r.length!==n.length?false:r.every(a=>{let i=t[a]??[],s=o[a]??[];return pr(i,s)})},Xi=(t,o)=>t.length!==o.length?false:t.every((r,n)=>{let a=o[n];return r.tokenId===a.tokenId&&r.fieldId===a.fieldId&&r.aggregation===a.aggregation}),Dl=t=>!t?.aggregations||t.aggregations.length===0?Au:t.aggregations,yo=(t,o)=>{let r=Dl(o);return t&&r.includes(t)?t:o?.type==="number"&&r.includes("sum")?"sum":r.includes("count")?"count":r[0]},pa=(t,o,r)=>{let n=r.get(o.fieldId);return n?.formatValue?n.formatValue(t):o.aggregation==="count"?Math.round(t).toLocaleString():t.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:2})};var zu=({options:t,selectedValues:o,onChange:r,minWidth:n=96})=>{let{t:a}=ce(),[i,s]=useState(""),[l,d]=useState(null),p=useMemo(()=>{let u=i.trim().toLowerCase();return u?t.filter(b=>b.toLowerCase().includes(u)):t},[t,i]),m=t.length>0&&o.length===t.length,h=t.length===0?a("pivot.filter.na"):o.length===0?a("common.none"):m?a("common.all"):`${o.length}/${t.length}`,f$1=u=>{r(o.includes(u)?o.filter(b=>b!==u):[...o,u]);};return g("div",{sx:{minWidth:n},onClick:u=>u.stopPropagation(),onMouseDown:u=>u.stopPropagation(),children:[f(Pe,{variant:"outlined",size:"small",onClick:u=>d(u.currentTarget),sx:{minWidth:n,height:26,px:1,py:.35,fontSize:"0.72rem",justifyContent:"space-between"},children:h}),f(Qt,{anchorEl:l,open:!!l,onClose:()=>d(null),PaperProps:{sx:{width:Math.max(n,220),maxHeight:320,overflowY:"auto",p:.5}},children:g("div",{onClick:u=>u.stopPropagation(),sx:{display:"grid",gap:.4},children:[f(He,{size:"small",placeholder:`${a("common.search")}...`,fullWidth:true,value:i,onChange:u=>s(u.target.value),onKeyDown:u=>u.stopPropagation(),onClick:u=>u.stopPropagation(),sx:{m:0,"& .orb-inp":{fontSize:"0.75rem",py:.7}}}),f("div",{sx:{px:1,py:.5,borderBottom:"1px solid var(--orb-border)"},children:f(Pe,{variant:"text",size:"small",onClick:u=>{u.preventDefault(),u.stopPropagation(),r(m?[]:t);},sx:{minWidth:"auto",px:0,py:.2,fontSize:"0.76rem",fontWeight:700,textTransform:"none"},children:a(m?"pivot.filter.deselectAll":"pivot.filter.selectAll")})}),p.length===0&&f("div",{className:"orb-menu-item","aria-disabled":"true",sx:{fontSize:"0.75rem"},children:a("pivot.filter.noResults")}),p.map(u=>{let b=o.includes(u);return g("div",{role:"option","aria-selected":b,tabIndex:0,className:`orb-menu-item ${b?"orb-selected":""}`,onClick:()=>f$1(u),onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),f$1(u));},sx:{display:"flex",alignItems:"center",fontSize:"0.75rem",py:.4},children:[f(Tt,{size:"small",checked:b,inputProps:{tabIndex:-1},sx:{p:.5,mr:.5,pointerEvents:"none"}}),f("span",{children:u})]},u)})]})})]})};var wn=({size:t=18,subtle:o=false})=>{let r=Math.max(2,Math.round(t/6));return f(Ie,{"aria-hidden":"true",sx:{display:"grid",gridTemplateColumns:`repeat(2, ${r}px)`,gridAutoRows:`${r}px`,gap:`${Math.max(2,Math.round(r/1.5))}px`,placeItems:"center",width:t,height:t,flexShrink:0,color:o?"var(--orb-muted)":"var(--orb-primary)"},children:Array.from({length:6},(n,a)=>f(Ie,{sx:{width:r,height:r,borderRadius:999,bgcolor:"currentColor"}},a))})};var Nl=({label:t,subtitle:o,isDragging:r,dragRef:n,listeners:a,attributes:i,style:s})=>f(Ne,{ref:n,...a,...i,sx:{p:1,borderRadius:"var(--orb-r-container)",border:"1px solid",borderColor:"var(--orb-border)",bgcolor:"var(--orb-canvas)",boxShadow:"var(--orb-shadow-1)",touchAction:"none",transition:"border-color 140ms ease, background-color 140ms ease, transform 140ms ease","&:hover":{borderColor:"var(--orb-p200)",bgcolor:"var(--orb-p50)",transform:"translateY(-1px)"}},style:{...s,opacity:r?.3:1,cursor:r?"grabbing":"grab"},children:g("div",{sx:{display:"flex",alignItems:"center",gap:.9},children:[f("div",{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:"var(--orb-r)",bgcolor:"var(--orb-p50)",border:"1px solid var(--orb-p100)"},children:f(wn,{size:13,subtle:true})}),g("div",{sx:{minWidth:0,display:"flex",flexDirection:"column",gap:.15},children:[f(E,{component:"div",sx:{fontSize:"0.84rem",fontWeight:700,lineHeight:1.2,color:"var(--orb-fg-strong)"},children:t}),o&&f(E,{component:"div",sx:{fontSize:"0.73rem",fontWeight:400,color:"var(--orb-fg)",lineHeight:1.2},children:o})]})]})}),Vu=({id:t,label:o,subtitle:r})=>{let{setNodeRef:n,listeners:a,attributes:i,isDragging:s}=useDraggable({id:t});return f(Nl,{label:o,subtitle:r,isDragging:s,dragRef:n,listeners:a,attributes:i})};var Sn=({zone:t,title:o,hint:r,icon:n,children:a,itemCount:i,onClear:s})=>{let l=`container|${t}`,{isOver:d,setNodeRef:p}=useDroppable({id:l}),{t:m}=ce();return g(Ne,{ref:p,sx:h=>({p:1.1,borderRadius:"var(--orb-r-container)",border:"1px dashed",borderColor:d?"var(--orb-primary)":"var(--orb-p200)",bgcolor:d?"var(--orb-p100)":h.palette.mode==="dark"?"var(--orb-surface-2)":"var(--orb-p50)",transition:"border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease",boxShadow:d?"0 0 0 3px var(--orb-focus-ring)":"none",minHeight:120,display:"flex",flexDirection:"column"}),children:[g("div",{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[g("div",{sx:{display:"flex",alignItems:"center",gap:.8},children:[n,f(E,{component:"div",sx:{fontSize:"0.8rem",fontWeight:700,letterSpacing:.1,color:"var(--orb-fg-strong)"},children:o}),g(E,{component:"div",sx:{fontSize:"0.73rem",fontWeight:500,color:"var(--orb-fg)"},children:["(",i,")"]})]}),i>0&&s&&f(ct,{title:m("pivot.clearArea"),children:f(ie,{size:"small",onClick:s,sx:{width:24,height:24,p:0},children:f(op,{size:13})})})]}),f(E,{component:"div",sx:{mt:.5,mb:.9,fontSize:"0.72rem",fontWeight:400,color:"var(--orb-fg)"},children:r}),f("div",{sx:{flex:1},children:a})]})};var Wu={xs:1.2,md:1.6},kn=({title:t,subtitle:o,collapsed:r,onToggleCollapse:n,expandAriaLabel:a,collapseAriaLabel:i,children:s,bodySx:l,unmountOnExit:d=false,headerActions:p})=>g(Ne,{sx:m=>({borderRadius:"var(--orb-r-container)",border:`1px solid ${m.palette.divider}`,overflow:"hidden",bgcolor:"var(--orb-surface)",boxShadow:"var(--orb-shadow-1)"}),children:[g("div",{sx:m=>({px:Wu,py:1.15,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,bgcolor:"var(--orb-canvas)",borderBottom:r?"none":`1px solid ${m.palette.divider}`}),children:[g("div",{sx:{minWidth:0,flex:1},children:[f(E,{component:"div",sx:{fontSize:"0.92rem",fontWeight:700,color:"var(--orb-fg-strong)"},children:t}),f(E,{component:"div",sx:{fontSize:"0.75rem",fontWeight:400,color:"var(--orb-fg)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o})]}),g("div",{sx:{display:"flex",alignItems:"center",gap:.75,flexShrink:0},children:[p,f(ie,{size:"small","aria-label":r?a:i,onClick:n,sx:m=>({border:`1px solid ${m.palette.divider}`,bgcolor:"var(--orb-canvas)",color:"var(--orb-primary)",width:24,height:24,padding:0,borderRadius:999,flexShrink:0,"&:hover":{bgcolor:"var(--orb-p50)",borderColor:"var(--orb-p200)"}}),children:f(ii,{size:13,sx:{transition:"transform 220ms cubic-bezier(0.2, 0, 0, 1)",transform:r?"rotate(180deg)":"rotate(0deg)"}})})]})]}),f(on,{in:!r,timeout:260,easing:"cubic-bezier(0.2, 0, 0, 1)",unmountOnExit:d,children:f("div",{sx:[{px:Wu,py:{xs:1.2,md:1.6}},...Array.isArray(l)?l:l?[l]:[]],children:s})})]});var Zi=({label:t,caption:o,onRemove:r,trailing:n,isDragging:a,dragRef:i,listeners:s,attributes:l,style:d})=>f(Ne,{ref:i,style:d,sx:{p:1,borderRadius:"var(--orb-r-container)",border:"1px solid",borderColor:"var(--orb-border)",bgcolor:"var(--orb-canvas)",boxShadow:"var(--orb-shadow-1)",touchAction:"none",opacity:a?0:1,transition:"border-color 140ms ease, background-color 140ms ease, transform 140ms ease","&:hover":{borderColor:"var(--orb-p200)",bgcolor:"var(--orb-p50)"}},children:g("div",{sx:{display:"flex",alignItems:"center",gap:.9},children:[f("div",{...l,...s,sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:"var(--orb-r)",bgcolor:"var(--orb-p50)",border:"1px solid var(--orb-p100)",cursor:"grab"},children:f(wn,{size:13,subtle:true})}),g("div",{sx:{minWidth:0,flex:1,display:"flex",flexDirection:"column",gap:.15},children:[f(E,{component:"div",sx:{fontSize:"0.82rem",fontWeight:700,lineHeight:1.2,color:"var(--orb-fg-strong)"},children:t}),o&&f(E,{component:"div",sx:{fontSize:"0.72rem",fontWeight:400,color:"var(--orb-fg)",lineHeight:1.2},children:o})]}),n,r&&f(ie,{size:"small",onClick:p=>{p.stopPropagation(),r();},sx:{width:24,height:24,p:0},children:f(xr,{size:13})})]})}),ua=({id:t,label:o,caption:r,onRemove:n,trailing:a})=>{let{setNodeRef:i,attributes:s,listeners:l,transform:d,transition:p,isDragging:m}=useSortable({id:t}),h={transform:d?`translate3d(${d.x}px, ${d.y}px, 0)`:void 0,transition:p,zIndex:m?999:"auto"};return f(Zi,{label:o,caption:r,onRemove:n,trailing:a,isDragging:m,dragRef:i,listeners:l,attributes:s,style:h})};var ji={rows:f(hp,{size:16,sx:{color:"var(--orb-primary)"}}),columns:f(an,{size:16,sx:{color:"var(--orb-primary)"}}),filters:f(jd,{size:16,sx:{color:"var(--orb-primary)"}}),values:f(nn,{size:16,sx:{color:"var(--orb-accent)"}})},$u=({isConfiguratorCollapsed:t,onToggleCollapse:o,availableFields:r,fieldMap:n,filterFields:a,columnFields:i,rowFields:s,valueFields:l,clearZone:d,removeFieldFromZone:p,getFilterSelectionSummary:m,renderDimensionFilterSelect:h,renderAggregationSelect:f$1,getAggregationLabel:u})=>{let{t:b}=ce(),C=[`${b("pivot.zone.rows")} ${s.length}`,`${b("pivot.zone.columns")} ${i.length}`,`${b("pivot.zone.filters")} ${a.length}`,`${b("pivot.zone.values")} ${l.length}`].join(" \xB7 ");return f(kn,{title:b("pivot.config.title"),subtitle:C,collapsed:t,onToggleCollapse:o,expandAriaLabel:b("pivot.collapse.ariaExpand"),collapseAriaLabel:b("pivot.collapse.ariaCollapse"),unmountOnExit:true,children:g("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",lg:"260px 1fr"},gap:2},children:[f(Sn,{zone:"palette",title:b("pivot.fieldList"),hint:b("pivot.availableDimensions"),itemCount:r.length,icon:f(wn,{size:18,subtle:true}),children:g(se,{spacing:.8,sx:{maxHeight:400,overflowY:"auto",pr:.5},children:[r.length===0&&f(E,{component:"div",sx:{fontSize:"0.74rem",fontWeight:400,color:"var(--orb-fg)",py:1},children:b("pivot.allFieldsInUse")}),r.map(g=>f(Vu,{id:`item|palette|${g.id}`,label:g.label,subtitle:g.type??"string"},g.id))]})}),g(se,{spacing:2,children:[g("div",{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[f(Sn,{zone:"filters",title:b("pivot.zone.filters"),hint:b("pivot.hint.filters"),icon:ji.filters,itemCount:a.length,onClear:()=>d("filters"),children:f(SortableContext,{items:a.map(g=>`item|filters|${g}`),strategy:verticalListSortingStrategy,children:f(se,{spacing:.7,children:a.map(g=>f(ua,{id:`item|filters|${g}`,label:n.get(g)?.label??g,caption:m(g),trailing:h(g),onRemove:()=>p("filters",g)},g))})})}),f(Sn,{zone:"columns",title:b("pivot.zone.columns"),hint:b("pivot.hint.columns"),icon:ji.columns,itemCount:i.length,onClear:()=>d("columns"),children:f(SortableContext,{items:i.map(g=>`item|columns|${g}`),strategy:verticalListSortingStrategy,children:f(se,{spacing:.7,children:i.map(g=>f(ua,{id:`item|columns|${g}`,label:n.get(g)?.label??g,caption:`${n.get(g)?.type??"dimension"} \u2022 ${m(g)}`,trailing:h(g),onRemove:()=>p("columns",g)},g))})})})]}),g("div",{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[f(Sn,{zone:"rows",title:b("pivot.zone.rows"),hint:b("pivot.hint.rows"),icon:ji.rows,itemCount:s.length,onClear:()=>d("rows"),children:f(SortableContext,{items:s.map(g=>`item|rows|${g}`),strategy:verticalListSortingStrategy,children:f(se,{spacing:.7,children:s.map(g=>f(ua,{id:`item|rows|${g}`,label:n.get(g)?.label??g,caption:`${n.get(g)?.type??"dimension"} \u2022 ${m(g)}`,trailing:h(g),onRemove:()=>p("rows",g)},g))})})}),f(Sn,{zone:"values",title:b("pivot.zone.values"),hint:b("pivot.hint.values"),icon:ji.values,itemCount:l.length,onClear:()=>d("values"),children:f(SortableContext,{items:l.map(g=>`item|values|${g.tokenId}`),strategy:verticalListSortingStrategy,children:f(se,{spacing:.7,children:l.map(g=>{let x=n.get(g.fieldId)?.label??g.fieldId,v=`${u(g.aggregation)}(${x})`;return f(ua,{id:`item|values|${g.tokenId}`,label:x,caption:v,trailing:f$1(g),onRemove:()=>p("values",g.tokenId)},g.tokenId)})})})})]})]})]})})};var _u=t=>t.toLocaleString(void 0,{maximumFractionDigits:1}),Gu=({data:t,primaryLabel:o,secondaryLabel:r,formatPrimaryValue:n,formatSecondaryValue:a})=>{let i=io();if(t.length===0)return null;let s=720,l=250,d={top:20,right:24,bottom:40,left:52},p=r?t.map(g=>g.primaryValue):t.map((g,x)=>x+1),m=r?t.map(g=>g.secondaryValue??0):t.map(g=>g.primaryValue),h=Math.max(...p,1),f$1=Math.max(...m,1),u=s-d.left-d.right,b=l-d.top-d.bottom,C=t.map((g,x)=>{let v=r?g.primaryValue:x+1,y=r?g.secondaryValue??0:g.primaryValue,k=d.left+v/h*u,w=l-d.bottom-y/f$1*b;return {...g,x:k,y:w,rawX:v,rawY:y}});return g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[f("div",{sx:{overflowX:"auto"},children:g("div",{component:"svg",viewBox:`0 0 ${s} ${l}`,sx:{width:"100%",minWidth:s,height:l},children:[f("line",{x1:d.left,y1:l-d.bottom,x2:s-d.right,y2:l-d.bottom,stroke:Eo(i.palette.text.secondary,.35)}),f("line",{x1:d.left,y1:d.top,x2:d.left,y2:l-d.bottom,stroke:Eo(i.palette.text.secondary,.35)}),C.map(g$1=>g("g",{children:[f("circle",{cx:g$1.x,cy:g$1.y,r:7,fill:Eo(i.palette.primary.main,.18)}),f("circle",{cx:g$1.x,cy:g$1.y,r:4.5,fill:i.palette.primary.main,children:g("title",{children:[g$1.name,`
7
+ `),f$1={enableMath:n},p=0;for(;p<h.length;){let v=h[p],C=v.trim();if(!C){p+=1;continue}if(i&&mu(v)){if(C.startsWith("<think>")){let y=[],b=v;for(;;){let k=b.indexOf("<think>"),w=k>=0?b.slice(k+7):b,T=w.indexOf("</think>");if(T>=0){y.push(w.slice(0,T)),p+=1;break}if(y.push(w),p+=1,p>=h.length)break;b=h[p];}m.push(f(Wi,{content:y.join(`
8
+ `).trim()},`think-tag-${p}`));continue}p+=1;let x=[];for(;p<h.length&&h[p].trim()!==":::";)x.push(h[p]),p+=1;p<h.length&&h[p].trim()===":::"&&(p+=1),m.push(f(Wi,{content:x.join(`
9
+ `).trim()},`think-fence-${p}`));continue}if($i(v)){let x=C.slice(3).trim().toLowerCase(),y=[];for(p+=1;p<h.length&&!$i(h[p]);)y.push(h[p]),p+=1;p<h.length&&$i(h[p])&&(p+=1);let b=y.join(`
10
+ `);if(a&&x==="mermaid"){m.push(f(wl,{code:b},`mermaid-${p}`));continue}if(n&&["math","latex","katex"].includes(x)){m.push(f(pa,{expression:b,allowKatex:true},`math-fence-${p}`));continue}m.push(f(da,{code:b,language:x||"text",copyable:s,showLineNumbers:c,wrapLongLines:true},`code-${p}`));continue}if(n&&C.startsWith("$$")){let x=[];if(C.endsWith("$$")&&C!=="$$")x.push(C.slice(2,-2)),p+=1;else {let b=v.slice(v.indexOf("$$")+2);for(b.trim()&&x.push(b),p+=1;p<h.length;){let k=h[p],w=k.indexOf("$$");if(w>=0){x.push(k.slice(0,w)),p+=1;break}x.push(k),p+=1;}}m.push(f(pa,{expression:x.join(`
11
+ `).trim(),allowKatex:true},`math-${p}`));continue}if(du(v)){let x=Math.min(6,v.match(/^#{1,6}/)?.[0]?.length||1),y=v.replace(/^#{1,6}\s+/,""),b=x===1?"h5":x===2?"h6":"subtitle1";m.push(f(Co,{variant:b,sx:{mt:x===1?1.2:.8,mb:.5,fontWeight:700},children:ua(y,f$1,`h-${p}`)},`heading-${p}`)),p+=1;continue}if(pu(v)){m.push(f(Md,{sx:{my:1.2}},`hr-${p}`)),p+=1;continue}if(uu(h,p)){let x=p+2;for(;x<h.length&&h[x].trim()&&h[x].includes("|");)x+=1;let y=h.slice(p,x).join(`
12
+ `),b=Vi(y);if(b){m.push(f(kl,{table:b},`table-${p}`)),p=x;continue}}if(Il(v)){let x=[];for(;p<h.length&&Il(h[p]);)x.push(h[p].replace(/^\s*>\s?/,"")),p+=1;m.push(f(Fr,{variant:"outlined",sx:{px:1,py:.8,my:.9,borderLeftWidth:3,borderLeftStyle:"solid",borderLeftColor:"primary.main",bgcolor:"action.hover"},children:f(Co,{variant:"body2",sx:{whiteSpace:"pre-wrap"},children:x.map((y,b)=>g(Fragment,{children:[b>0&&f("br",{}),ua(y,f$1,`q-${p}-${b}`)]},`quote-line-${b}`))})},`quote-${p}`));continue}if(Tl(v)){let x=[];for(;p<h.length&&Tl(h[p]);)x.push(h[p].trim().replace(/^[-*+]\s+/,"")),p+=1;m.push(f(Re,{component:"ul",sx:{my:.8,pl:2.5},children:x.map((y,b)=>f(Re,{component:"li",sx:{mb:.45},children:f(Co,{variant:"body2",children:ua(y,f$1,`ul-${p}-${b}`)})},`ul-item-${b}`))},`ul-${p}`));continue}if(Ml(v)){let x=[];for(;p<h.length&&Ml(h[p]);)x.push(h[p].trim().replace(/^\d+\.\s+/,"")),p+=1;m.push(f(Re,{component:"ol",sx:{my:.8,pl:2.7},children:x.map((y,b)=>f(Re,{component:"li",sx:{mb:.45},children:f(Co,{variant:"body2",children:ua(y,f$1,`ol-${p}-${b}`)})},`ol-item-${b}`))},`ol-${p}`));continue}let g$1=[];for(;p<h.length;){let x=h[p],y=x.trim();if(!y||$i(x)||du(x)||pu(x)||Tl(x)||Ml(x)||Il(x)||uu(h,p)||i&&mu(x)||n&&y.startsWith("$$"))break;g$1.push(x),p+=1;}g$1.length>0?m.push(f(Co,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:g$1.map((x,y)=>g(Fragment,{children:[y>0&&f("br",{}),ua(x,f$1,`p-${p}-${y}`)]},`p-line-${y}`))},`p-${p}`)):p+=1;}return m},[u,n,a,i,s,c]);return f(Re,{className:r,sx:{"& strong":{fontWeight:700},"& em":{fontStyle:"italic"},"& a":{wordBreak:"break-all"}},children:d})};var dA=(t,o)=>f(ma,{markdown:t,...o});var gu=({value:t,onChange:o,onSubmit:r,onVoiceInput:n,onClear:a,placeholder:i,statusText:s,loading:c=false,compact:u=false,showStatusText:d=true})=>g(ce,{spacing:.75,children:[g("div",{sx:{display:"flex",alignItems:"center",gap:1,px:1.2,py:u?.25:.4,borderRadius:999,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",minHeight:u?38:44},children:[f(Hr,{sx:{fontSize:u?16:18,color:"text.secondary"}}),f(Ld,{fullWidth:true,value:t,onChange:m=>o(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),r());},placeholder:i,sx:{fontSize:u?"0.84rem":"0.9rem"}}),t&&a&&f(le,{size:"small",onClick:a,children:f(wr,{sx:{fontSize:u?16:18}})}),n&&f(le,{size:"small",onClick:n,children:f(cp,{sx:{fontSize:u?16:18}})}),f(le,{size:"small",onClick:r,disabled:c||!t.trim(),children:f(gp,{sx:{fontSize:u?16:18}})})]}),d&&s&&f(E,{variant:"caption",color:"text.secondary",children:s})]});var hu=(t,o)=>{let r=o.trim();if(!r)return t;let n=t.toLowerCase(),a=r.toLowerCase(),i=n.indexOf(a);return i<0?t:g(e,{children:[t.slice(0,i),f("div",{component:"mark",sx:{bgcolor:"warning.light",color:"warning.contrastText",px:.15,borderRadius:.4},children:t.slice(i,i+r.length)}),t.slice(i+r.length)]})},_i=({section:t,highlightQuery:o=""})=>{let r=t.columns||2;return g(Le,{variant:"outlined",sx:{p:1.8,borderRadius:2},children:[f(E,{variant:"subtitle1",sx:{fontWeight:700,mb:1.4},children:t.title}),f("div",{sx:{display:"grid",gap:1.15,gridTemplateColumns:{xs:"1fr",md:r===3?"repeat(3, minmax(0, 1fr))":r===1?"1fr":"repeat(2, minmax(0, 1fr))"}},children:t.fields.map(n=>{let a=typeof n.value=="string"||typeof n.value=="number"?String(n.value):null;return g("div",{sx:{minWidth:0},children:[f(E,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:hu(n.label,o)}),f(E,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:a?hu(a,o):n.value})]},n.id)})})]})};var Rl=t=>t==null?"":typeof t=="string"||typeof t=="number"||typeof t=="boolean"?String(t):"",Ui=t=>t.trim().toLowerCase(),lv=(t,o)=>{let r=[];return t.forEach(n=>{n.fields.forEach(a=>{let i=a.searchableText||Rl(a.value),s={source:"section",sourceId:n.id,sourceSectionId:n.id,sourceTitle:n.title,fieldId:a.id,fieldLabel:a.label,fieldValue:i};r.push({hit:s,text:Ui(`${n.title} ${a.label} ${i}`)});});}),o.forEach(n=>{(n.fields||[]).forEach(a=>{let i=a.searchableText||Rl(a.value),s={source:"tab",sourceId:n.id,sourceTitle:n.label,fieldId:a.id,fieldLabel:a.label,fieldValue:i};r.push({hit:s,text:Ui(`${n.label} ${a.label} ${i}`)});}),(n.sections||[]).forEach(a=>{a.fields.forEach(i=>{let s=i.searchableText||Rl(i.value),c={source:"tab",sourceId:n.id,sourceSectionId:a.id,sourceTitle:`${n.label} / ${a.title}`,fieldId:i.id,fieldLabel:i.label,fieldValue:s};r.push({hit:c,text:Ui(`${n.label} ${a.title} ${i.label} ${s}`)});});});}),r},fu=({sections:t,tabs:o=[],defaultTabId:r,ai:n})=>{let{t:a}=de(),[i,s]=useState(""),[c,u]=useState(r||o[0]?.id),[d,m]=useState("idle"),[h,f]=useState([]),[p,v]=useState(""),[C,g]=useState(""),[x,y]=useState(false),b=useMemo(()=>lv(t,o),[t,o]);useEffect(()=>{if(o.length===0){u(void 0);return}o.some(D=>D.id===c)||u(r||o[0]?.id);},[o,c,r]);let k=useCallback(()=>{m("idle"),f([]),v(""),g("");},[]),w=useCallback(S=>{s(S),S.trim()||(m("idle"),f([]),v(""),g(""));},[]),T=useCallback(S=>{let D=Ui(S);return D?b.filter(R=>R.text.includes(D)).map(R=>R.hit):[]},[b]),I=useCallback(async()=>{let S=i.trim();if(!S)return;y(true);let D=T(S);if(f(D),D.length>0){m("search"),g(""),v(a("detail.searchAi.matches",{count:D.length})),y(false);return}if(n?.enabled!==false&&n?.onSubmit){m("ai"),v(a("detail.searchAi.autoAiFallback"));try{let M=await n.onSubmit(S,{query:S,hits:D,activeTabId:c,sections:t,tabs:o});g(typeof M=="string"?M:"");}finally{y(false);}return}m("search"),g(""),v(a("detail.searchAi.noMatch")),y(false);},[i,T,a,n,c,t,o]);return {query:i,setQuery:w,activeTabId:c,setActiveTabId:u,searchMode:d,hits:h,statusText:p,aiResponse:C,searching:x,handleSubmit:I,clearResult:k}};var HA=({title:t,subtitle:o,sections:r,tabs:n=[],defaultTabId:a,table:i,ai:s,rightHeaderSlot:c,searchBarWidth:u=460,onClose:d,closeLabel:m="Close"})=>{let{t:h}=de(),{query:f$1,setQuery:p,activeTabId:v,setActiveTabId:C,searchMode:g$1,hits:x,statusText:y,aiResponse:b,searching:k,handleSubmit:w,clearResult:T}=fu({sections:r,tabs:n,defaultTabId:a,ai:s}),I=useMemo(()=>n.find(R=>R.id===v)||n[0],[n,v]),S=useCallback(R=>{let M=P=>{let A=document.getElementById(R);if(A){A.scrollIntoView({behavior:"smooth",block:"center"});return}P<4&&setTimeout(()=>M(P+1),60);};requestAnimationFrame(()=>M(0));},[]),D=useCallback((R,M)=>{if(n.some(P=>P.id===R)){C(R),S(M?`detail-tab-${R}-section-${M}`:`detail-tab-${R}`);return}S(`detail-section-${R}`);},[n,C,S]);return g("div",{sx:{display:"flex",flexDirection:"column",gap:1.5,minHeight:"100%"},children:[g(ce,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",md:"center"},spacing:1,children:[g("div",{sx:{minWidth:0},children:[f(E,{variant:"h5",sx:{fontWeight:800,color:"text.primary"},children:t}),o&&f(E,{variant:"body2",color:"text.secondary",sx:{mt:.35},children:o})]}),g(ce,{direction:"row",spacing:.6,alignItems:"center",sx:{width:{xs:"100%",md:"auto"},ml:{xs:0,md:"auto"}},children:[f("div",{sx:{width:{xs:"100%",md:u},maxWidth:"100%",minWidth:{md:320}},children:f(gu,{value:f$1,onChange:p,onSubmit:w,onVoiceInput:s?.onVoiceInput,onClear:()=>{p(""),T();},placeholder:s?.placeholder||h("detail.searchAi.placeholder"),statusText:y,loading:k,compact:true,showStatusText:false})}),d&&f(ct,{title:m,children:f(le,{size:"small",onClick:d,children:f(jd,{fontSize:"small"})})}),c]})]}),y&&f(E,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:y}),g$1==="search"&&x.length>0&&g(Le,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[f(E,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.6},children:h("detail.searchAi.matches",{count:x.length})}),f(ce,{spacing:.35,children:x.slice(0,8).map(R=>f("div",{component:"button",type:"button",onClick:()=>D(R.sourceId,R.sourceSectionId),sx:{textAlign:"left",border:0,bgcolor:"transparent",p:.2,cursor:"pointer",color:"text.primary",borderRadius:1,"&:hover":{bgcolor:"action.hover"}},children:g(E,{variant:"body2",sx:{fontSize:"0.84rem"},children:[f("div",{component:"span",sx:{color:"text.secondary"},children:R.sourceTitle})," \xB7 ",f("div",{component:"span",sx:{fontWeight:700},children:R.fieldLabel})," = ",f("div",{component:"span",children:R.fieldValue||"-"})]})},`${R.source}|${R.sourceId}|${R.fieldId}`))})]}),g$1==="ai"&&b&&g(Le,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[f(E,{variant:"subtitle2",sx:{fontWeight:700,mb:.7},children:h("detail.searchAi.aiResultTitle")}),f("div",{sx:{fontSize:"0.9rem",lineHeight:1.6,"& p":{m:0,mb:.8},"& h1, & h2, & h3, & h4":{mt:1.2,mb:.6,lineHeight:1.3},"& ul, & ol":{mt:.4,mb:.8,pl:2.6},"& code":{px:.5,py:.1,borderRadius:.8,bgcolor:"action.hover",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},"& pre":{m:0,mt:.8,mb:.8,p:1.1,borderRadius:1.2,bgcolor:"action.hover",overflowX:"auto"},"& pre code":{p:0,bgcolor:"transparent"}},children:f(ma,{markdown:b})})]}),f("div",{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:r.map(R=>f("div",{id:`detail-section-${R.id}`,children:f(_i,{section:R,highlightQuery:f$1})},R.id))}),n.length>0&&g(Le,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[f(zd,{value:I?.id||false,onChange:(R,M)=>C(String(M)),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:n.map(R=>f(Vd,{value:R.id,label:R.label,sx:{textTransform:"none"}},R.id))}),g("div",{sx:{p:1.5},children:[f("div",{id:`detail-tab-${I?.id||""}`}),I?.description&&f(E,{variant:"body2",color:"text.secondary",sx:{mb:1.2},children:I.description}),I?.content?I.content:g(ce,{spacing:1.5,children:[(I?.sections||[]).map(R=>f("div",{id:`detail-tab-${I?.id}-section-${R.id}`,children:f(_i,{section:R,highlightQuery:f$1})},R.id)),I?.fields&&I.fields.length>0&&f(_i,{section:{id:`${I.id}-fields`,title:I.label,fields:I.fields,columns:2},highlightQuery:f$1})]})]})]}),i&&f(tr,{title:i.title||h("detail.table.title"),...i.tableProps,filterConfig:void 0,fitContainer:false})]})};var yu=({bucket:t,cardCount:o,highlighted:r=false,children:n,emptyLabel:a,height:i,maxHeight:s,onRename:c,renameLabel:u,sx:d})=>{let{t:m}=de(),[h,f$1]=useState(false),[p,v]=useState(t.title),C=()=>{v(t.title),f$1(false);},g$1=x=>{x.preventDefault();let y=p.trim();y&&(y!==t.title&&c?.(y),v(y),f$1(false));};return f(Le,{elevation:0,sx:[x=>{let y=t.accentColor??x.palette.primary.main;return {position:"relative",display:"flex",flexDirection:"column",minWidth:0,minHeight:0,height:i??s??560,maxHeight:s,borderRadius:"var(--orb-r-container)",overflow:"hidden",border:r?`1px solid ${tt(y,.65)}`:"1px solid var(--orb-border)",bgcolor:"var(--orb-canvas)",boxShadow:r?`0 0 0 2px ${tt(y,.16)}, var(--orb-shadow-2)`:"none",transition:"border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease","&::before":{content:'""',display:"block",flexShrink:0,height:3,bgcolor:y}}},...Array.isArray(d)?d:d?[d]:[]],children:g(ce,{spacing:1.25,sx:{flex:1,minHeight:0,overflow:"hidden",p:1.5},children:[g(Re,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1.25},children:[f(Re,{sx:{minWidth:0,flex:1},children:g(Re,{sx:{display:"flex",alignItems:"center",gap:.75,minHeight:28},children:[t.icon&&f(Re,{sx:{display:"inline-flex",flexShrink:0,color:t.accentColor??"var(--orb-primary)"},children:t.icon}),h?g(Re,{component:"form",onSubmit:g$1,sx:{display:"flex",alignItems:"center",gap:.5,flex:1,minWidth:0},children:[f(We,{dense:true,autoFocus:true,value:p,onChange:x=>v(x.target.value),onKeyDown:x=>{x.key==="Escape"&&(x.preventDefault(),C());},inputProps:{"aria-label":u??m("kanban.bucket.rename")},error:!p.trim(),sx:{flex:1,minWidth:0}}),f(le,{type:"submit",size:"small",tooltip:m("kanban.bucket.saveRename"),"aria-label":m("kanban.bucket.saveRename"),disabled:!p.trim(),children:f(po,{size:14})}),f(le,{size:"small",tooltip:m("kanban.bucket.cancelRename"),"aria-label":m("kanban.bucket.cancelRename"),onClick:C,children:f(Kt,{size:14})})]}):f(E,{component:"div",sx:{fontSize:15,fontWeight:600,lineHeight:1.35,color:"text.primary"},children:t.title})]})}),!h&&g(ce,{direction:"row",spacing:.75,sx:{flexShrink:0},children:[f(Ct,{size:"small",label:o,sx:{minWidth:24,justifyContent:"center",fontWeight:600}}),typeof t.limit=="number"&&f(Ct,{size:"small",label:`${m("kanban.bucket.limit")} ${t.limit}`,color:o>t.limit?"warning":"default",variant:"outlined"}),c&&f(le,{size:"small",tooltip:u??m("kanban.bucket.rename"),"aria-label":u??m("kanban.bucket.rename"),onClick:()=>{v(t.title),f$1(true);},sx:{width:26,height:26},children:f(Hc,{size:14})})]})]}),r&&f(E,{component:"div",sx:{fontSize:12,color:t.accentColor??"var(--orb-primary)",fontWeight:500},children:m("kanban.bucket.dropHere")}),f(Re,{sx:{flex:1,height:0,minHeight:0,overflowY:"auto",overscrollBehavior:"contain",pr:.4,scrollbarGutter:"stable"},children:o>0?n:f(Re,{sx:{minHeight:"100%",borderRadius:"var(--orb-r-container)",border:"1px dashed var(--orb-border)",bgcolor:"transparent",display:"grid",placeItems:"center",px:2,textAlign:"center"},children:f(E,{sx:{fontSize:13,color:"text.secondary"},children:a??t.emptyLabel??m("kanban.empty")})})})]})})};var dv={success:"success",warning:"warning",info:"info",error:"error"},pv={critical:"error",high:"warning",medium:"info",low:"success"},uv={default:"var(--orb-primary)",success:"var(--orb-primary)",warning:"var(--orb-accent)",info:"var(--orb-primary)",error:"var(--orb-err)"},mv=(t,o)=>{switch(t){case "critical":return o("kanban.priority.critical");case "high":return o("kanban.priority.high");case "medium":return o("kanban.priority.medium");case "low":return o("kanban.priority.low");default:return t}},gv=t=>t?t.split(/\s+/).map(o=>o.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",Nl=({card:t,bucket:o,dragging:r=false,overlay:n=false,onClick:a,sx:i})=>{let{t:s}=de(),c=!!(a&&o),u=t.tone??(t.priority?pv[t.priority]:"default"),d=u==="default"?"primary":dv[u],m=uv[u],h=o?{card:t,bucket:o}:void 0;return f(Le,{onClick:c?()=>h&&a?.(h):void 0,onKeyDown:c?f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),h&&a?.(h));}:void 0,role:c?"button":void 0,tabIndex:c?0:void 0,sx:[{position:"relative",minWidth:0,overflow:"hidden",p:1.5,pl:1.75,borderRadius:"var(--orb-r-container)",border:`1px solid ${tt(m,.24)}`,bgcolor:"var(--orb-canvas)",boxShadow:n?"var(--orb-shadow-3)":r?"none":"var(--orb-shadow-1)",transform:n?"rotate(1deg) scale(1.01)":"none",transition:"transform var(--orb-t-fast), box-shadow var(--orb-t-fast), border-color var(--orb-t-fast)",cursor:c?"pointer":"default",opacity:r?.5:1,"&::before":{content:'""',position:"absolute",inset:"0 auto 0 0",width:3,bgcolor:m},"&:hover":c?{transform:"translateY(-1px)",borderColor:tt(m,.48),boxShadow:"var(--orb-shadow-2)"}:void 0,"&:focus-visible":c?{outline:"2px solid var(--orb-focus-solid)",outlineOffset:2}:void 0},...Array.isArray(i)?i:i?[i]:[]],elevation:0,children:g(ce,{spacing:1.25,children:[g(Re,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[g(Re,{sx:{minWidth:0,flex:1},children:[(t.kicker||o?.title)&&f(E,{component:"div",sx:{fontSize:11,fontWeight:500,color:"text.secondary",textTransform:"uppercase"},children:t.kicker??o?.title}),f(E,{component:"div",sx:{mt:.25,fontSize:14,fontWeight:600,lineHeight:1.4,color:"text.primary"},children:t.title})]}),t.priority&&f(Ct,{size:"small",color:d,label:mv(t.priority,s),variant:u==="default"?"outlined":"filled",sx:{height:22,flexShrink:0,fontWeight:500}})]}),t.summary&&f(E,{component:"div",sx:{fontSize:13,fontWeight:300,color:"text.secondary",lineHeight:1.5},children:t.summary}),t.metrics&&t.metrics.length>0&&f(Re,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.min(t.metrics.length,3)}, minmax(0, 1fr))`,gap:.75},children:t.metrics.slice(0,3).map(f$1=>g(Re,{sx:{minWidth:0,borderRadius:"var(--orb-r)",px:1,py:.75,bgcolor:"var(--orb-surface)",border:"1px solid var(--orb-border)"},children:[f(E,{component:"div",noWrap:true,sx:{fontSize:11,fontWeight:500,color:"text.secondary",textTransform:"uppercase"},children:f$1.label}),f(E,{component:"div",noWrap:true,numeric:true,sx:{mt:.25,fontSize:13,fontWeight:600},children:f$1.value})]},f$1.id))}),typeof t.progress=="number"&&g(Re,{children:[g(Re,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:.5},children:[f(E,{sx:{fontSize:12,color:"text.secondary"},children:s("kanban.card.progress")}),g(E,{numeric:true,sx:{fontSize:12,fontWeight:600},children:[Math.round(t.progress),"%"]})]}),f(Rd,{variant:"determinate",value:Math.max(0,Math.min(100,t.progress)),color:m,sx:{height:4,borderRadius:2}})]}),(t.tags?.length||t.assignee||t.dueDate||t.footer||c)&&g(ce,{spacing:.9,children:[t.tags&&t.tags.length>0&&f(Re,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:t.tags.map(f$1=>f(Ct,{size:"small",label:f$1.label,color:f$1.color??"default",variant:"outlined"},f$1.id))}),g(Re,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,flexWrap:"wrap"},children:[g(Re,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0},children:[t.assignee&&g(e,{children:[f(ni,{src:t.assignee.avatarSrc,sx:{width:28,height:28,fontSize:11},children:t.assignee.initials??gv(t.assignee.name)}),g(Re,{sx:{minWidth:0},children:[f(E,{component:"div",sx:{fontSize:13,fontWeight:500,lineHeight:1.3},noWrap:true,children:t.assignee.name}),t.dueDate&&f(E,{component:"div",sx:{fontSize:11,color:"text.secondary",lineHeight:1.35},noWrap:true,children:t.dueDate})]})]}),!t.assignee&&t.dueDate&&f(E,{sx:{fontSize:12,color:"text.secondary"},children:t.dueDate})]}),c&&f(E,{sx:{fontSize:12,color:"var(--orb-link)",fontWeight:500,whiteSpace:"nowrap"},children:s("kanban.card.openDetail")})]}),t.footer]})]})})};var Cu=(t,o)=>{let r=o.title.trim();return !o.id||!r||t.buckets.some(n=>n.id===o.id)?t:{buckets:[...t.buckets,{...o,title:r,cards:[]}]}},xu=(t,o,r)=>{let n=r.trim();if(!n)return t;let a=t.buckets.find(i=>i.id===o);return !a||a.title===n?t:{buckets:t.buckets.map(i=>i.id===o?{...i,title:n}:i)}},hv=(t,o)=>Number.isNaN(t)||t<0?0:t>o?o:t,wu=({buckets:t,cards:o})=>{let r=new Map;return o.forEach((n,a)=>{let i=r.get(n.bucketId)??[];i.push({card:n,sourceIndex:a}),r.set(n.bucketId,i);}),{buckets:t.map(n=>{let a=[...r.get(n.id)??[]].sort((i,s)=>i.card.position===void 0&&s.card.position===void 0?i.sourceIndex-s.sourceIndex:i.card.position===void 0?1:s.card.position===void 0?-1:i.card.position-s.card.position||i.sourceIndex-s.sourceIndex).map(({card:i},s)=>({...i,bucketId:n.id,position:s}));return {...n,cards:a}})}},Uo=(t,o)=>{for(let r=0;r<t.buckets.length;r+=1){let n=t.buckets[r],a=n.cards.findIndex(i=>i.id===o);if(a>=0)return {card:n.cards[a],bucket:n,bucketIndex:r,cardIndex:a}}},Ki=(t,o)=>{let r=Uo(t,o.cardId);if(!r)return t;let n=t.buckets.findIndex(d=>d.id===o.toBucketId);if(n<0)return t;let a=t.buckets.map(d=>({...d,cards:d.cards.map(m=>({...m}))})),i=a[r.bucketIndex],[s]=i.cards.splice(r.cardIndex,1);if(!s)return t;let c=a[n],u=hv(o.targetIndex??c.cards.length,c.cards.length);return c.cards.splice(u,0,{...s,bucketId:o.toBucketId}),{buckets:a.map(d=>({...d,cards:d.cards.map((m,h)=>({...m,bucketId:d.id,position:h}))}))}};var El="kanban-card|",Ll="kanban-bucket|",Pu=t=>`${El}${t}`,Tv=t=>`${Ll}${t}`,qi=t=>t?.startsWith(El)?t.slice(El.length):void 0,ku=t=>t?.startsWith(Ll)?t.slice(Ll.length):void 0,Mv=({card:t,bucket:o,onCardClick:r})=>{let{setNodeRef:n,attributes:a,listeners:i,transform:s,transition:c,isDragging:u}=useSortable({id:Pu(t.id)}),d={transform:s?`translate3d(${s.x}px, ${s.y}px, 0)`:void 0,transition:c,zIndex:u?2:1,touchAction:"none",cursor:u?"grabbing":"grab"};return f("div",{ref:n,style:d,...a,...i,children:f(Nl,{card:t,bucket:o,dragging:u,onClick:r})})},Iv=({bucket:t,highlighted:o,bucketHeight:r,emptyBucketLabel:n,onBucketRename:a,onCardClick:i})=>{let{isOver:s,setNodeRef:c}=useDroppable({id:Tv(t.id)});return f(Re,{ref:c,sx:{minWidth:0,minHeight:0,height:r},children:f(yu,{bucket:t,cardCount:t.cards.length,highlighted:o||s,emptyLabel:n,height:r,onRename:a,children:f(SortableContext,{items:t.cards.map(u=>Pu(u.id)),strategy:verticalListSortingStrategy,children:f(ce,{spacing:1,children:t.cards.map(u=>f(Mv,{card:u,bucket:t,onCardClick:i},u.id))})})})})},Tu=t=>String(t??"").toLocaleLowerCase(),Rv=(t,o)=>[t.id,t.title,t.summary,t.kicker,t.priority,t.tone,t.progress,t.dueDate,t.assignee?.id,t.assignee?.name,...t.tags?.flatMap(n=>[n.id,n.label])??[],...t.metrics?.flatMap(n=>[n.label,n.value])??[]].some(n=>Tu(n).includes(o)),uE=({model:t,onCardMove:o,onCardClick:r,cardFilter:n,onBucketAdd:a,onBucketRename:i,addBucketLabel:s,minBucketWidth:c=320,bucketHeight:u,bucketMaxHeight:d,searchable:m=false,searchValue:h,defaultSearchValue:f$1="",onSearchValueChange:p,searchPlaceholder:v,emptyBucketLabel:C,sx:g$1})=>{let{t:x}=de(),[y,b]=useState(null),[k,w]=useState(),[T,I]=useState(f$1),S=h??T,D=S.trim().toLocaleLowerCase(),R=u??d??560,M=useMemo(()=>({buckets:t.buckets.map(H=>{let B=n?H.cards.filter(Z=>n(Z,H)):H.cards;if(!D)return {...H,cards:B};let q=[H.id,H.title,H.description].some(Z=>Tu(Z).includes(D));return {...H,cards:q?B:B.filter(Z=>Rv(Z,D))}})}),[n,t,D]),P=useMemo(()=>M.buckets.reduce((H,B)=>H+B.cards.length,0),[M]),A=useCallback(H=>{h===void 0&&I(H),p?.(H);},[p,h]),L=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:6}}),useSensor(TouchSensor,{activationConstraint:{delay:120,tolerance:8}})),W=useMemo(()=>y?Uo(t,y):void 0,[y,t]),j=useCallback(()=>{b(null),w(void 0);},[]),O=useCallback(H=>{if(!H)return;let B=qi(H);return B?Uo(t,B)?.bucket.id:ku(H)},[t]),_=useCallback(H=>{b(qi(String(H.active.id))??null);},[]),z=useCallback(H=>{w(O(H.over?String(H.over.id):void 0));},[O]),Y=useCallback(H=>{let B=qi(String(H.active.id)),q=H.over?String(H.over.id):void 0;if(!B||!q){j();return}let Z=Uo(t,B);if(!Z){j();return}let ue=Z.bucket.id,ne=Z.cardIndex,fe=qi(q);if(fe){let J=Uo(t,fe);if(!J){j();return}ue=J.bucket.id,ne=J.cardIndex;}else {let J=ku(q),ae=t.buckets.find(xe=>xe.id===J);if(!J||!ae){j();return}ue=J,ne=ae.cards.length;}if(Z.bucket.id===ue&&Z.cardIndex===ne){j();return}let Ce=Ki(t,{cardId:B,fromBucketId:Z.bucket.id,toBucketId:ue,targetIndex:ne}),$=Uo(Ce,B);$&&!($.bucket.id===Z.bucket.id&&$.cardIndex===Z.cardIndex)&&o?.({cardId:B,fromBucketId:Z.bucket.id,toBucketId:$.bucket.id,targetIndex:$.cardIndex,card:$.card,model:Ce}),j();},[t,o,j]);return g(DndContext,{sensors:L,collisionDetection:closestCorners,onDragStart:_,onDragOver:z,onDragEnd:Y,onDragCancel:j,children:[g(Re,{sx:{display:"flex",flexDirection:"column",minWidth:0,minHeight:0,height:"100%",overflow:"hidden"},children:[(m||a)&&g(Re,{role:m?"search":void 0,sx:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:1.5,mb:1.25,minWidth:0},children:[m&&f(Re,{sx:{width:"100%",maxWidth:360,flex:"1 1 240px"},children:f(We,{dense:true,value:S,onChange:H=>A(H.target.value),placeholder:v??x("kanban.search.placeholder"),autoComplete:"off",sx:{"& .orb-inp":{paddingLeft:"38px",paddingRight:S?"42px":"12px"},"& .orb-inp-adornment-end":{pointerEvents:"auto"}},startAdornment:f(Vo,{size:16,"aria-hidden":"true"}),endAdornment:S?f(le,{size:"small",tooltip:x("kanban.search.clear"),"aria-label":x("kanban.search.clear"),onClick:()=>A(""),sx:{width:26,height:26},children:f(Kt,{size:15})}):void 0})}),g(Re,{sx:{display:"flex",alignItems:"center",gap:1,ml:"auto"},children:[D&&f(E,{component:"div","aria-live":"polite",sx:{flexShrink:0,fontSize:12,fontWeight:500,color:"text.secondary"},children:P>0?x("kanban.search.results",{count:P}):x("kanban.search.noMatch")}),a&&f(Me,{size:"small",variant:"secondary",startIcon:f(Jr,{size:15}),onClick:a,children:s??x("kanban.bucket.add")})]})]}),f(Re,{sx:[{display:"grid",gridAutoFlow:"column",gridAutoColumns:`minmax(${c}px, ${Math.max(c,360)}px)`,gap:1.5,gridAutoRows:R==="100%"?"minmax(0, 1fr)":void 0,alignItems:"stretch",justifyContent:"start",flex:"1 1 0",height:"100%",minHeight:0,overflowX:"auto",overflowY:"hidden",overscrollBehavior:"contain",scrollbarGutter:"stable both-edges",pb:.5},...Array.isArray(g$1)?g$1:g$1?[g$1]:[]],children:M.buckets.map(H=>f(Iv,{bucket:H,highlighted:H.id===k,bucketHeight:R,emptyBucketLabel:D?x("kanban.search.noMatch"):C,onBucketRename:i?B=>i(H.id,B):void 0,onCardClick:r},H.id))})]}),f(DragOverlay,{children:W?f(Re,{sx:{width:Math.max(c-24,260)},children:f(Nl,{card:W.card,bucket:W.bucket,overlay:true})}):null})]})};var Av=({initialModel:t,initialBuckets:o,initialCards:r})=>t||wu({buckets:o??[],cards:r??[]}),bE=t=>{let{onCardMove:o,onCardClick:r}=t,[n,a]=useState(()=>Av(t)),i=useCallback(f=>{a(p=>typeof f=="function"?f(p):f);},[]),s=useCallback(f=>Uo(n,f),[n]),c=useCallback((f,p,v)=>{let C=Uo(n,f);if(!C)return;let g=Ki(n,{cardId:f,fromBucketId:C.bucket.id,toBucketId:p,targetIndex:v}),x=Uo(g,f);if(!x||x.bucket.id===C.bucket.id&&x.cardIndex===C.cardIndex)return;a(g);let y={cardId:f,fromBucketId:C.bucket.id,toBucketId:x.bucket.id,targetIndex:x.cardIndex,card:x.card,model:g};return o?.(y),y},[n,o]),u=useCallback((f,p)=>{a(v=>({buckets:v.buckets.map(C=>({...C,cards:C.cards.map(g=>g.id!==f?g:typeof p=="function"?p(g):{...g,...p})}))}));},[]),d=useCallback(f=>{let p=Cu(n,f);return p===n?false:(a(p),true)},[n]),m=useCallback((f,p)=>{let v=xu(n,f,p);return v===n?false:(a(v),true)},[n]),h=useMemo(()=>({model:n,onCardMove:f=>{c(f.cardId,f.toBucketId,f.targetIndex);},onCardClick:r}),[n,c,r]);return {model:n,actions:{replaceModel:i,moveCard:c,updateCard:u,addBucket:d,renameBucket:m,getCard:s},boardProps:h}};function xn({onTextUpdate:t,onComplete:o,onError:r,wsUrl:n="ws://localhost:8765",silenceThresholdMs:a=2e3,minVolumeRms:i=.015}){let[s,c]=useState(false),u=useRef(null),d=useRef(null),m=useRef(null),h=useRef(null),f=useRef(null),p=useRef(0),v=useRef(false),C=useRef(false),g=useCallback(()=>{u.current&&(u.current.close(),u.current=null),h.current&&(h.current.disconnect(),h.current=null),f.current&&(f.current.disconnect(),f.current=null),d.current&&(d.current.getTracks().forEach(b=>b.stop()),d.current=null),m.current&&(m.current.close(),m.current=null),C.current=false,c(false);},[]),x=useCallback(()=>{v.current||(v.current=true,u.current?.readyState===WebSocket.OPEN&&u.current.send(JSON.stringify({type:"stop"})),setTimeout(g,500));},[g]),y=useCallback(async()=>{if(!(s||C.current)){C.current=true,v.current=false,p.current=Date.now();try{let b=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:16e3,echoCancellation:!0,noiseSuppression:!0}});d.current=b;let k=new WebSocket(n);u.current=k,k.onopen=()=>{c(!0),C.current=!1;},k.onmessage=D=>{try{let R=JSON.parse(D.data);if(R.type==="recognition")R.is_final?o(R.text):t?.(R.text);else if(R.type==="error"){let M=R.message||"Voice recognition error";r?.(M),x();}}catch{r?.("Failed to parse voice message");}},k.onerror=()=>{r?.("Voice service connection failed"),g();},k.onclose=()=>{g();};let w=window.AudioContext||window.webkitAudioContext;if(!w)throw new Error("AudioContext is not supported in this browser");let T=new w({sampleRate:16e3});m.current=T;let I=T.createMediaStreamSource(b);f.current=I;let S=T.createScriptProcessor(4096,1,1);h.current=S,S.onaudioprocess=D=>{if(u.current?.readyState!==WebSocket.OPEN)return;let R=D.inputBuffer.getChannelData(0),M=0;for(let L=0;L<R.length;L+=1)M+=R[L]*R[L];if(Math.sqrt(M/R.length)>i)p.current=Date.now();else if(Date.now()-p.current>a&&!v.current){x();return}let A=new Int16Array(R.length);for(let L=0;L<R.length;L+=1){let W=Math.max(-1,Math.min(1,R[L]));A[L]=W<0?W*32768:W*32767;}u.current.send(A.buffer);},I.connect(S),S.connect(T.destination);}catch{r?.("Cannot access microphone"),g();}}},[g,s,i,o,r,t,a,x,n]);return useEffect(()=>g,[g]),{isRecording:s,startRecording:y,stopRecording:x}}var Fv=["en","zh","fr","de","ja","ko"],Iu={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},Fl=({searchPlaceholder:t,onSearch:o,onSearchAdd:r,onOpenPanel:n,panelOpen:a=false,maxWidth:i=540,sx:s})=>{let{t:c}=de(),[u,d]=useState(""),m=useCallback((x=u)=>{let y=x.trim();y&&(d(""),o?.(y));},[o,u]),h=x=>{x.preventDefault(),m();},{isRecording:f$1,startRecording:p,stopRecording:v}=xn({onTextUpdate:d,onComplete:x=>{d(x),m(x);},onError:x=>{console.error("Header voice input error:",x);}}),C=useCallback(async()=>{if(f$1){v();return}await p();},[f$1,p,v]),g$1=t||c("header.searchPlaceholder");return f("form",{className:"orb-app-header-search",onSubmit:h,style:{width:"100%",maxWidth:typeof i=="number"?`${i}px`:i,...s},children:g("div",{className:"orb-inp-adornment-wrap orb-app-header-search-shell",style:{background:"var(--orb-surface)",border:"1px solid var(--orb-border)",borderRadius:999,paddingRight:4},children:[f("div",{className:"orb-inp-adornment",children:f(le,{className:"orb-app-header-ai-action",size:"small",onClick:r,tooltip:c("header.searchAddFeature"),children:f(Pt,{name:"add",size:16})})}),f("input",{className:"orb-inp orb-inp-dense orb-app-header-ai-input",value:u,onChange:x=>d(x.target.value),placeholder:g$1,style:{border:"none",background:"transparent",flex:1,minWidth:0}}),g("div",{className:"orb-inp-adornment orb-inp-adornment-end",children:[n&&!a&&f(le,{className:"orb-app-header-ai-action",size:"small","aria-label":c("header.searchOpenPanel"),tooltip:c("header.searchOpenPanel"),onClick:n,children:f(Pt,{name:"message",size:16})}),f(le,{className:"orb-app-header-ai-action",size:"small",onClick:()=>{C();},tooltip:c(f$1?"header.searchStopVoice":"header.searchStartVoice"),sx:{color:f$1?"var(--orb-err)":void 0},children:f(Pt,{name:"microphone",size:16})})]})]})})},Xi=({appTitle:t,logo:o,onToggleMode:r,locale:n,localeLabel:a,localeOptions:i,onLocaleChange:s,searchPlaceholder:c,showSearch:u=false,onSearch:d,onSearchAdd:m,onOpenPanel:h,panelOpen:f$1,user:p,onUserRefresh:v,onUserSetting:C,onUserLogout:g$1,userMenuItems:x,leftSlot:y,rightSlot:b})=>{let{t:k,locale:w}=de(),T=fo(),I=n||w,S=a||Iu[I],D=i||Fv,R=T==="dark"?f(Yc,{size:15}):f(ed,{size:15}),M=k(T==="dark"?"header.theme.dark":"header.theme.light"),P=[...v?[{key:"refresh",label:k("header.menu.refresh"),icon:f(_a,{size:15}),onClick:v}]:[],...C?[{key:"settings",label:k("header.menu.setting"),icon:f(en,{size:16}),onClick:C}]:[],...g$1?[{key:"logout",label:k("header.menu.logout"),icon:f(Kc,{size:16}),onClick:g$1}]:[]],A=x||P,L=D.map(W=>({label:Iu[W],onClick:()=>{s?.(W),window.requestAnimationFrame(()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur();});},disabled:W===I}));return g("header",{className:"orb-app-header",children:[g("div",{className:"orb-app-header-brand",children:[y,o===null?null:o||f("div",{className:"orb-app-header-default-logo","aria-label":"ORBCAFE",children:f(Pt,{name:"product",size:20})}),t&&f(E,{variant:"h4",sx:{fontWeight:700},children:t})]}),f("div",{className:"orb-app-header-center",children:u&&f(Fl,{searchPlaceholder:c,onSearch:d,onSearchAdd:m,onOpenPanel:h,panelOpen:f$1})}),g("div",{className:"orb-app-header-actions",children:[g("div",{className:"orb-app-header-utilities",children:[s?f(Qt,{triggerLabel:S,trigger:g("button",{type:"button",className:"orb-icon-btn orb-app-header-locale",children:[f(Vn,{size:15}),f("span",{className:"orb-label",children:S})]}),items:L,align:"end"}):g("div",{className:"orb-app-header-locale","aria-label":S,children:[f(Vn,{size:15}),f("span",{className:"orb-label",children:S})]}),f(le,{className:"orb-app-header-theme",size:"small",onClick:r,tooltip:M,children:R})]}),p&&f("span",{className:"orb-app-header-divider","aria-hidden":"true"}),p&&f(Qt,{triggerLabel:p.name,trigger:g("button",{type:"button",className:"orb-app-header-user-trigger",children:[g("span",{className:"orb-app-header-user-copy",children:[f(E,{variant:"body2",className:"orb-app-header-user-name",children:p.name}),p.subtitle&&f(E,{variant:"caption",muted:true,className:"orb-app-header-user-subtitle",title:p.subtitle,children:p.subtitle})]}),f(tn,{src:p.avatarSrc,alt:p.name,size:32,children:p.avatarText||p.name.slice(0,1).toUpperCase()})]}),items:A.map(W=>({label:W.label,onClick:W.onClick,disabled:W.disabled,icon:W.icon})),align:"end"}),b]})]})};var Ru=({menuData:t=[],initialNavigationCollapsed:o=false,initialNavigationMode:r="fixed",enableNavigationPinning:n,navigationPinStorageKey:a,pinnedNavigationItemIds:i,defaultPinnedNavigationItemIds:s,onPinnedNavigationItemIdsChange:c,pinnedNavigationSectionTitle:u}={})=>{let{navigationIslandProps:d}=wd({initialCollapsed:o,initialDisplayMode:r,content:t,enablePinning:n,pinStorageKey:a,pinnedItemIds:i,defaultPinnedItemIds:s,onPinnedItemIdsChange:c,pinnedSectionTitle:u}),[m,h]=useState(900);useEffect(()=>{let p=()=>h(window.innerHeight);return p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[]);let f=useMemo(()=>Math.max(280,m-100),[m]);return {navigationIslandProps:d,navigationMaxHeight:f}};var Ho=12,Du=56,Au=234,Wv="orbcafe:page-layout-locale",Eu=["en","zh","fr","de","ja","ko"],$v=t=>encodeURIComponent(t.trim().toLowerCase()).replace(/%/g,"").replace(/[^a-z0-9._~-]+/g,"-")||"app",Zi=(t,o)=>`orbcafe:page-layout:${$v(t)}:${o}`,_v=t=>`orbcafe:page-layout:${t.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-")||"app"}:pinned-navigation-items`,Gv=t=>t==="system"?"dark":t==="dark"?"light":"system",Yi=(t,o,r)=>Math.min(Math.max(t,o),Math.max(o,r)),Uv=t=>t instanceof HTMLElement?!!t.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,VE=({appId:t,appTitle:o,menuData:r=[],children:n,showNavigation:a=true,locale:i="en",localeLabel:s,localeOptions:c,onLocaleChange:u,mode:d,defaultMode:m="system",onModeChange:h,user:f$1,onUserRefresh:p,onUserSetting:v,onUserLogout:C,userMenuItems:g$1,logo:x,searchPlaceholder:y,searchPlacement:b="hidden",floatingSearchSx:k,onSearch:w,onSearchAdd:T,onOpenPanel:I,panelOpen:S,rightHeaderSlot:D,leftHeaderSlot:R,contentSx:M,navigationVariant:P="classic",navigationMode:A,defaultNavigationMode:L="fixed",onNavigationModeChange:W,showNavigationModeToggle:j=true,enableNavigationPinning:O=true,navigationPinStorageKey:_,pinnedNavigationItemIds:z,defaultPinnedNavigationItemIds:Y,onPinnedNavigationItemIdsChange:H,pinnedNavigationSectionTitle:B})=>{let q=t?Zi(t,"mode"):"orbcafe:page-layout-mode",Z=t?Zi(t,"locale"):Wv,ue=t?Zi(t,"navigation-mode"):"orbcafe:page-layout-navigation-mode",[ne,fe]=useState(m),[Ce,$]=useState("light"),[J,ae]=useState(false),[xe,pe]=useState(i),[me,Ee]=useState(false),[Ge,nt]=useState(false),[it,K]=useState(L),[De,ke]=useState({x:Ho,y:Ho}),[He,at]=useState("left"),[Ye,xt]=useState(false),Mt=useRef(null),Ot=useRef(null),At=d!==void 0,re=d??ne,Ue=u!==void 0,Be=Ue?i:xe,ge=c?.join("|")??"",Se=A!==void 0,oe=A??it,we=oe==="floating",Ae=P==="v2"?al:fd,Je=b==="header",st=re==="system"?J?Ce:"light":re;useEffect(()=>{if(!At)try{let ye=window.localStorage.getItem(q);(ye==="light"||ye==="dark"||ye==="system")&&fe(ye);}catch{}ae(true);let V=window.matchMedia("(prefers-color-scheme: dark)"),Q=()=>{$(V.matches?"dark":"light");};return Q(),V.addEventListener("change",Q),()=>V.removeEventListener("change",Q)},[At,q]),useEffect(()=>{if(!(At||!J))try{window.localStorage.setItem(q,re);}catch{}},[J,At,re,q]),useEffect(()=>{if(Ue){Ee(true);return}try{let V=window.localStorage.getItem(Z),Q=c??Eu;V&&Eu.includes(V)&&Q.includes(V)&&pe(V);}catch{}finally{Ee(true);}},[Ue,ge,Z]),useEffect(()=>{if(!(Ue||!me))try{window.localStorage.setItem(Z,Be);}catch{}},[Be,Ue,me,Z]),useEffect(()=>{if(Se){nt(true);return}try{let V=window.localStorage.getItem(ue);(V==="fixed"||V==="floating")&&K(V);}catch{}finally{nt(true);}},[Se]),useEffect(()=>{if(Ge)try{window.localStorage.setItem(ue,oe);}catch{}},[oe,Ge]),useEffect(()=>{st==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[st]);let pt=useCallback(V=>{Se||K(V),W?.(V);},[Se,W]),Bt=useCallback(V=>{At||fe(V),h?.(V);},[At,h]),Xt=useCallback(V=>{Ue||pe(V),u?.(V);},[Ue,u]),{navigationIslandProps:Vt,navigationMaxHeight:wt}=Ru({menuData:r,initialNavigationCollapsed:false,initialNavigationMode:oe,enableNavigationPinning:O,navigationPinStorageKey:_??(t?Zi(t,"pinned-navigation-items"):_v(o)),pinnedNavigationItemIds:z,defaultPinnedNavigationItemIds:Y,onPinnedNavigationItemIdsChange:H,pinnedNavigationSectionTitle:B}),Wt=Vt.collapsed,ft=useCallback(V=>{let Q=Mt.current,ye=Q?.parentElement;if(!Q||!ye)return V;let Pe=ye.getBoundingClientRect(),Oe=Q.getBoundingClientRect(),$e=Ho,qe=Ho,Qe=Math.max($e,Pe.width-Oe.width-Ho),ut=Math.max(qe,Pe.height-Oe.height-Ho);return {x:Yi(V.x,$e,Qe),y:Yi(V.y,qe,ut)}},[]),Dt=useCallback(V=>{let Q=Mt.current,ye=Q?.parentElement;if(!Q||!ye)return V;let Pe=ye.getBoundingClientRect(),Oe=Q.getBoundingClientRect(),$e=Ho,qe=Ho,Qe=Math.max($e,Pe.width-Oe.width-Ho),ut=Math.max(qe,Pe.height-Oe.height-Ho),gt={x:Yi(V.x,$e,Qe),y:Yi(V.y,qe,ut)},bt=[{distance:Math.abs(gt.x-$e),position:{x:$e,y:gt.y}},{distance:Math.abs(gt.x-Qe),position:{x:Qe,y:gt.y}},{distance:Math.abs(gt.y-qe),position:{x:gt.x,y:qe}},{distance:Math.abs(gt.y-ut),position:{x:gt.x,y:ut}}].reduce((F,ee)=>ee.distance<F.distance?ee:F).position;return at(bt.x>=($e+Qe)/2?"right":"left"),bt},[]),lt=useMemo(()=>{if(!we||Ye)return De.x;if(He==="right"){let ye=Mt.current?.parentElement?.getBoundingClientRect().width,Pe=Wt?Du:Au;return ye?Math.max(Ho,ye-Pe-Ho):Wt?De.x:De.x-(Au-Du)}return De.x},[He,De.x,Ye,we,Wt]),Ft=useCallback(V=>{if(!we||!Wt||Uv(V.target))return;V.preventDefault(),V.currentTarget.setPointerCapture(V.pointerId);let Q=ft({x:lt,y:De.y});at("left"),ke(Q),Ot.current={pointerId:V.pointerId,startClientX:V.clientX,startClientY:V.clientY,startX:Q.x,startY:Q.y,currentX:Q.x,currentY:Q.y},xt(true);},[ft,lt,De.y,we,Wt]),Zt=useCallback(V=>{let Q=Ot.current;if(!Q||Q.pointerId!==V.pointerId)return;let ye=ft({x:Q.startX+V.clientX-Q.startClientX,y:Q.startY+V.clientY-Q.startClientY});Q.currentX=ye.x,Q.currentY=ye.y,ke(ye);},[ft]),X=useCallback(V=>{let Q=Ot.current;if(!(!Q||Q.pointerId!==V.pointerId)){try{V.currentTarget.releasePointerCapture(V.pointerId);}catch{}Ot.current=null,ke(Dt({x:Q.currentX,y:Q.currentY})),xt(false);}},[Dt]);return useEffect(()=>{if(!we)return;let V=()=>{ke(Pe=>ft(Pe));},Q=window.requestAnimationFrame(V),ye=window.setTimeout(V,430);return ()=>{window.cancelAnimationFrame(Q),window.clearTimeout(ye);}},[ft,we,Wt,wt]),f(Fn,{mode:re,children:f(Ya,{locale:Be,children:g("div",{className:"orb-root",style:{minHeight:"100vh",width:"100%",display:"flex",flexDirection:"column",overflowX:"hidden",background:"var(--orb-canvas)"},children:[f(Xi,{appTitle:o,logo:x,mode:re,onToggleMode:()=>Bt(Gv(re)),locale:Be,localeLabel:Ue||Be===i?s:void 0,localeOptions:c,onLocaleChange:Xt,user:f$1,onUserRefresh:p,onUserSetting:v,onUserLogout:C,userMenuItems:g$1,searchPlaceholder:y,showSearch:Je,onSearch:w,onSearchAdd:T,onOpenPanel:I,panelOpen:S,leftSlot:R,rightSlot:D}),b==="floating"&&f("div",{className:"orb-float-search",style:k,children:f(Fl,{searchPlaceholder:y,onSearch:w,onSearchAdd:T,onOpenPanel:I,panelOpen:S,maxWidth:"100%"})}),g("div",{style:{flex:1,minHeight:0,minWidth:0,display:"flex",overflowX:"hidden",position:"relative"},children:[a&&!we&&f("div",{style:{paddingTop:12,paddingBottom:12,paddingLeft:12,paddingRight:Wt?4:12,display:"flex",alignItems:"flex-start",flexShrink:0},children:f(Ae,{...Vt,maxHeight:wt,colorMode:st,displayMode:oe,onDisplayModeChange:pt,showDisplayModeToggle:j&&Wt})}),a&&we&&f("div",{ref:Mt,onPointerDown:Ft,onPointerMove:Zt,onPointerUp:X,onPointerCancel:X,style:{position:"absolute",top:De.y,left:lt,zIndex:1205,display:"flex",alignItems:"flex-start",cursor:Wt?Ye?"grabbing":"grab":"default",touchAction:Wt?"none":"auto",userSelect:Ye?"none":void 0,transition:Ye?"none":"left 180ms ease-out, top 180ms ease-out"},children:f(Ae,{...Vt,maxHeight:wt,colorMode:st,displayMode:oe,onDisplayModeChange:pt,showDisplayModeToggle:j&&Wt})}),f("div",{style:{flex:1,minWidth:0,minHeight:0,overflow:"auto",paddingTop:12,paddingBottom:12,paddingRight:12,paddingLeft:a&&!we&&Wt?4:12,...M},children:n})]})]})})})};var Qi="(blank)",Lu="Result",Ou="Grand Total",Fu={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},Bu=["sum","count","avg","min","max"];var Hu=["palette","rows","columns","filters","values"];var zu=t=>Hu.includes(t),Vu=t=>t==="rows"||t==="columns"||t==="filters",ji=t=>{let o=t.split("|");return o.length===2&&o[0]==="container"&&zu(o[1])?{kind:"container",zone:o[1]}:o.length===3&&o[0]==="item"&&zu(o[1])&&o[2]?{kind:"item",zone:o[1],key:o[2]}:null},pr=t=>t==null||t===""?Qi:t instanceof Date?t.toISOString().slice(0,10):String(t),$r=t=>JSON.stringify(t),Wu=(t,o)=>{let r=t.join(""),n=o.join("");return r.localeCompare(n,void 0,{sensitivity:"base"})},Kv=t=>{if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"&&t.trim()!==""){let o=Number(t);return Number.isFinite(o)?o:null}return null},wn=(t,o,r)=>{if(r==="count")return t.length;let n=t.map(a=>Kv(a[o])).filter(a=>a!==null);return n.length===0?0:r==="sum"?n.reduce((a,i)=>a+i,0):r==="avg"?n.reduce((a,i)=>a+i,0)/n.length:r==="min"?Math.min(...n):Math.max(...n)},so=(t,o)=>{if(!t||t.length===0)return [];let r=new Set,n=[];return t.forEach(a=>{!o.has(a)||r.has(a)||(r.add(a),n.push(a));}),n},ur=(t,o)=>t.length!==o.length?false:t.every((r,n)=>r===o[n]),$u=(t,o)=>{let r=Object.keys(t),n=Object.keys(o);return r.length!==n.length?false:r.every(a=>{let i=t[a]??[],s=o[a]??[];return ur(i,s)})},Ji=(t,o)=>t.length!==o.length?false:t.every((r,n)=>{let a=o[n];return r.tokenId===a.tokenId&&r.fieldId===a.fieldId&&r.aggregation===a.aggregation}),Bl=t=>!t?.aggregations||t.aggregations.length===0?Bu:t.aggregations,xo=(t,o)=>{let r=Bl(o);return t&&r.includes(t)?t:o?.type==="number"&&r.includes("sum")?"sum":r.includes("count")?"count":r[0]},ga=(t,o,r)=>{let n=r.get(o.fieldId);return n?.formatValue?n.formatValue(t):o.aggregation==="count"?Math.round(t).toLocaleString():t.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:2})};var Gu=({options:t,selectedValues:o,onChange:r,minWidth:n=96})=>{let{t:a}=de(),[i,s]=useState(""),[c,u]=useState(null),d=useMemo(()=>{let p=i.trim().toLowerCase();return p?t.filter(v=>v.toLowerCase().includes(p)):t},[t,i]),m=t.length>0&&o.length===t.length,h=t.length===0?a("pivot.filter.na"):o.length===0?a("common.none"):m?a("common.all"):`${o.length}/${t.length}`,f$1=p=>{r(o.includes(p)?o.filter(v=>v!==p):[...o,p]);};return g("div",{sx:{minWidth:n},onClick:p=>p.stopPropagation(),onMouseDown:p=>p.stopPropagation(),children:[f(Me,{variant:"outlined",size:"small",onClick:p=>u(p.currentTarget),sx:{minWidth:n,height:26,px:1,py:.35,fontSize:"0.72rem",justifyContent:"space-between"},children:h}),f(Qt,{anchorEl:c,open:!!c,onClose:()=>u(null),PaperProps:{sx:{width:Math.max(n,220),maxHeight:320,overflowY:"auto",p:.5}},children:g("div",{onClick:p=>p.stopPropagation(),sx:{display:"grid",gap:.4},children:[f(We,{size:"small",placeholder:`${a("common.search")}...`,fullWidth:true,value:i,onChange:p=>s(p.target.value),onKeyDown:p=>p.stopPropagation(),onClick:p=>p.stopPropagation(),sx:{m:0,"& .orb-inp":{fontSize:"0.75rem",py:.7}}}),f("div",{sx:{px:1,py:.5,borderBottom:"1px solid var(--orb-border)"},children:f(Me,{variant:"text",size:"small",onClick:p=>{p.preventDefault(),p.stopPropagation(),r(m?[]:t);},sx:{minWidth:"auto",px:0,py:.2,fontSize:"0.76rem",fontWeight:700,textTransform:"none"},children:a(m?"pivot.filter.deselectAll":"pivot.filter.selectAll")})}),d.length===0&&f("div",{className:"orb-menu-item","aria-disabled":"true",sx:{fontSize:"0.75rem"},children:a("pivot.filter.noResults")}),d.map(p=>{let v=o.includes(p);return g("div",{role:"option","aria-selected":v,tabIndex:0,className:`orb-menu-item ${v?"orb-selected":""}`,onClick:()=>f$1(p),onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),f$1(p));},sx:{display:"flex",alignItems:"center",fontSize:"0.75rem",py:.4},children:[f(Tt,{size:"small",checked:v,inputProps:{tabIndex:-1},sx:{p:.5,mr:.5,pointerEvents:"none"}}),f("span",{children:p})]},p)})]})})]})};var Sn=({size:t=18,subtle:o=false})=>{let r=Math.max(2,Math.round(t/6));return f(Re,{"aria-hidden":"true",sx:{display:"grid",gridTemplateColumns:`repeat(2, ${r}px)`,gridAutoRows:`${r}px`,gap:`${Math.max(2,Math.round(r/1.5))}px`,placeItems:"center",width:t,height:t,flexShrink:0,color:o?"var(--orb-muted)":"var(--orb-primary)"},children:Array.from({length:6},(n,a)=>f(Re,{sx:{width:r,height:r,borderRadius:999,bgcolor:"currentColor"}},a))})};var Hl=({label:t,subtitle:o,isDragging:r,dragRef:n,listeners:a,attributes:i,style:s})=>f(Le,{ref:n,...a,...i,sx:{p:1,borderRadius:"var(--orb-r-container)",border:"1px solid",borderColor:"var(--orb-border)",bgcolor:"var(--orb-canvas)",boxShadow:"var(--orb-shadow-1)",touchAction:"none",transition:"border-color 140ms ease, background-color 140ms ease, transform 140ms ease","&:hover":{borderColor:"var(--orb-p200)",bgcolor:"var(--orb-p50)",transform:"translateY(-1px)"}},style:{...s,opacity:r?.3:1,cursor:r?"grabbing":"grab"},children:g("div",{sx:{display:"flex",alignItems:"center",gap:.9},children:[f("div",{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:"var(--orb-r)",bgcolor:"var(--orb-p50)",border:"1px solid var(--orb-p100)"},children:f(Sn,{size:13,subtle:true})}),g("div",{sx:{minWidth:0,display:"flex",flexDirection:"column",gap:.15},children:[f(E,{component:"div",sx:{fontSize:"0.84rem",fontWeight:700,lineHeight:1.2,color:"var(--orb-fg-strong)"},children:t}),o&&f(E,{component:"div",sx:{fontSize:"0.73rem",fontWeight:400,color:"var(--orb-fg)",lineHeight:1.2},children:o})]})]})}),Uu=({id:t,label:o,subtitle:r})=>{let{setNodeRef:n,listeners:a,attributes:i,isDragging:s}=useDraggable({id:t});return f(Hl,{label:o,subtitle:r,isDragging:s,dragRef:n,listeners:a,attributes:i})};var kn=({zone:t,title:o,hint:r,icon:n,children:a,itemCount:i,onClear:s})=>{let c=`container|${t}`,{isOver:u,setNodeRef:d}=useDroppable({id:c}),{t:m}=de();return g(Le,{ref:d,sx:h=>({p:1.1,borderRadius:"var(--orb-r-container)",border:"1px dashed",borderColor:u?"var(--orb-primary)":"var(--orb-p200)",bgcolor:u?"var(--orb-p100)":h.palette.mode==="dark"?"var(--orb-surface-2)":"var(--orb-p50)",transition:"border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease",boxShadow:u?"0 0 0 3px var(--orb-focus-ring)":"none",minHeight:120,display:"flex",flexDirection:"column"}),children:[g("div",{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[g("div",{sx:{display:"flex",alignItems:"center",gap:.8},children:[n,f(E,{component:"div",sx:{fontSize:"0.8rem",fontWeight:700,letterSpacing:.1,color:"var(--orb-fg-strong)"},children:o}),g(E,{component:"div",sx:{fontSize:"0.73rem",fontWeight:500,color:"var(--orb-fg)"},children:["(",i,")"]})]}),i>0&&s&&f(ct,{title:m("pivot.clearArea"),children:f(le,{size:"small",onClick:s,sx:{width:24,height:24,p:0},children:f(sp,{size:13})})})]}),f(E,{component:"div",sx:{mt:.5,mb:.9,fontSize:"0.72rem",fontWeight:400,color:"var(--orb-fg)"},children:r}),f("div",{sx:{flex:1},children:a})]})};var Ku={xs:1.2,md:1.6},Pn=({title:t,subtitle:o,collapsed:r,onToggleCollapse:n,expandAriaLabel:a,collapseAriaLabel:i,children:s,bodySx:c,unmountOnExit:u=false,headerActions:d})=>g(Le,{sx:m=>({borderRadius:"var(--orb-r-container)",border:`1px solid ${m.palette.divider}`,overflow:"hidden",bgcolor:"var(--orb-surface)",boxShadow:"var(--orb-shadow-1)"}),children:[g("div",{sx:m=>({px:Ku,py:1.15,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,bgcolor:"var(--orb-canvas)",borderBottom:r?"none":`1px solid ${m.palette.divider}`}),children:[g("div",{sx:{minWidth:0,flex:1},children:[f(E,{component:"div",sx:{fontSize:"0.92rem",fontWeight:700,color:"var(--orb-fg-strong)"},children:t}),f(E,{component:"div",sx:{fontSize:"0.75rem",fontWeight:400,color:"var(--orb-fg)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o})]}),g("div",{sx:{display:"flex",alignItems:"center",gap:.75,flexShrink:0},children:[d,f(le,{size:"small","aria-label":r?a:i,onClick:n,sx:m=>({border:`1px solid ${m.palette.divider}`,bgcolor:"var(--orb-canvas)",color:"var(--orb-primary)",width:24,height:24,padding:0,borderRadius:999,flexShrink:0,"&:hover":{bgcolor:"var(--orb-p50)",borderColor:"var(--orb-p200)"}}),children:f(pi,{size:13,sx:{transition:"transform 220ms cubic-bezier(0.2, 0, 0, 1)",transform:r?"rotate(180deg)":"rotate(0deg)"}})})]})]}),f(rn,{in:!r,timeout:260,easing:"cubic-bezier(0.2, 0, 0, 1)",unmountOnExit:u,children:f("div",{sx:[{px:Ku,py:{xs:1.2,md:1.6}},...Array.isArray(c)?c:c?[c]:[]],children:s})})]});var es=({label:t,caption:o,onRemove:r,trailing:n,isDragging:a,dragRef:i,listeners:s,attributes:c,style:u})=>f(Le,{ref:i,style:u,sx:{p:1,borderRadius:"var(--orb-r-container)",border:"1px solid",borderColor:"var(--orb-border)",bgcolor:"var(--orb-canvas)",boxShadow:"var(--orb-shadow-1)",touchAction:"none",opacity:a?0:1,transition:"border-color 140ms ease, background-color 140ms ease, transform 140ms ease","&:hover":{borderColor:"var(--orb-p200)",bgcolor:"var(--orb-p50)"}},children:g("div",{sx:{display:"flex",alignItems:"center",gap:.9},children:[f("div",{...c,...s,sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:"var(--orb-r)",bgcolor:"var(--orb-p50)",border:"1px solid var(--orb-p100)",cursor:"grab"},children:f(Sn,{size:13,subtle:true})}),g("div",{sx:{minWidth:0,flex:1,display:"flex",flexDirection:"column",gap:.15},children:[f(E,{component:"div",sx:{fontSize:"0.82rem",fontWeight:700,lineHeight:1.2,color:"var(--orb-fg-strong)"},children:t}),o&&f(E,{component:"div",sx:{fontSize:"0.72rem",fontWeight:400,color:"var(--orb-fg)",lineHeight:1.2},children:o})]}),n,r&&f(le,{size:"small",onClick:d=>{d.stopPropagation(),r();},sx:{width:24,height:24,p:0},children:f(wr,{size:13})})]})}),ha=({id:t,label:o,caption:r,onRemove:n,trailing:a})=>{let{setNodeRef:i,attributes:s,listeners:c,transform:u,transition:d,isDragging:m}=useSortable({id:t}),h={transform:u?`translate3d(${u.x}px, ${u.y}px, 0)`:void 0,transition:d,zIndex:m?999:"auto"};return f(es,{label:o,caption:r,onRemove:n,trailing:a,isDragging:m,dragRef:i,listeners:c,attributes:s,style:h})};var rs={rows:f(Cp,{size:16,sx:{color:"var(--orb-primary)"}}),columns:f(sn,{size:16,sx:{color:"var(--orb-primary)"}}),filters:f(rp,{size:16,sx:{color:"var(--orb-primary)"}}),values:f(an,{size:16,sx:{color:"var(--orb-accent)"}})},qu=({isConfiguratorCollapsed:t,onToggleCollapse:o,availableFields:r,fieldMap:n,filterFields:a,columnFields:i,rowFields:s,valueFields:c,clearZone:u,removeFieldFromZone:d,getFilterSelectionSummary:m,renderDimensionFilterSelect:h,renderAggregationSelect:f$1,getAggregationLabel:p})=>{let{t:v}=de(),C=[`${v("pivot.zone.rows")} ${s.length}`,`${v("pivot.zone.columns")} ${i.length}`,`${v("pivot.zone.filters")} ${a.length}`,`${v("pivot.zone.values")} ${c.length}`].join(" \xB7 ");return f(Pn,{title:v("pivot.config.title"),subtitle:C,collapsed:t,onToggleCollapse:o,expandAriaLabel:v("pivot.collapse.ariaExpand"),collapseAriaLabel:v("pivot.collapse.ariaCollapse"),unmountOnExit:true,children:g("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",lg:"260px 1fr"},gap:2},children:[f(kn,{zone:"palette",title:v("pivot.fieldList"),hint:v("pivot.availableDimensions"),itemCount:r.length,icon:f(Sn,{size:18,subtle:true}),children:g(ce,{spacing:.8,sx:{maxHeight:400,overflowY:"auto",pr:.5},children:[r.length===0&&f(E,{component:"div",sx:{fontSize:"0.74rem",fontWeight:400,color:"var(--orb-fg)",py:1},children:v("pivot.allFieldsInUse")}),r.map(g=>f(Uu,{id:`item|palette|${g.id}`,label:g.label,subtitle:g.type??"string"},g.id))]})}),g(ce,{spacing:2,children:[g("div",{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[f(kn,{zone:"filters",title:v("pivot.zone.filters"),hint:v("pivot.hint.filters"),icon:rs.filters,itemCount:a.length,onClear:()=>u("filters"),children:f(SortableContext,{items:a.map(g=>`item|filters|${g}`),strategy:verticalListSortingStrategy,children:f(ce,{spacing:.7,children:a.map(g=>f(ha,{id:`item|filters|${g}`,label:n.get(g)?.label??g,caption:m(g),trailing:h(g),onRemove:()=>d("filters",g)},g))})})}),f(kn,{zone:"columns",title:v("pivot.zone.columns"),hint:v("pivot.hint.columns"),icon:rs.columns,itemCount:i.length,onClear:()=>u("columns"),children:f(SortableContext,{items:i.map(g=>`item|columns|${g}`),strategy:verticalListSortingStrategy,children:f(ce,{spacing:.7,children:i.map(g=>f(ha,{id:`item|columns|${g}`,label:n.get(g)?.label??g,caption:`${n.get(g)?.type??"dimension"} \u2022 ${m(g)}`,trailing:h(g),onRemove:()=>d("columns",g)},g))})})})]}),g("div",{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[f(kn,{zone:"rows",title:v("pivot.zone.rows"),hint:v("pivot.hint.rows"),icon:rs.rows,itemCount:s.length,onClear:()=>u("rows"),children:f(SortableContext,{items:s.map(g=>`item|rows|${g}`),strategy:verticalListSortingStrategy,children:f(ce,{spacing:.7,children:s.map(g=>f(ha,{id:`item|rows|${g}`,label:n.get(g)?.label??g,caption:`${n.get(g)?.type??"dimension"} \u2022 ${m(g)}`,trailing:h(g),onRemove:()=>d("rows",g)},g))})})}),f(kn,{zone:"values",title:v("pivot.zone.values"),hint:v("pivot.hint.values"),icon:rs.values,itemCount:c.length,onClear:()=>u("values"),children:f(SortableContext,{items:c.map(g=>`item|values|${g.tokenId}`),strategy:verticalListSortingStrategy,children:f(ce,{spacing:.7,children:c.map(g=>{let x=n.get(g.fieldId)?.label??g.fieldId,y=`${p(g.aggregation)}(${x})`;return f(ha,{id:`item|values|${g.tokenId}`,label:x,caption:y,trailing:f$1(g),onRemove:()=>d("values",g.tokenId)},g.tokenId)})})})})]})]})]})})};var Xu=t=>t.toLocaleString(void 0,{maximumFractionDigits:1}),Zu=({data:t,primaryLabel:o,secondaryLabel:r,formatPrimaryValue:n,formatSecondaryValue:a})=>{let i=io();if(t.length===0)return null;let s=720,c=250,u={top:20,right:24,bottom:40,left:52},d=r?t.map(g=>g.primaryValue):t.map((g,x)=>x+1),m=r?t.map(g=>g.secondaryValue??0):t.map(g=>g.primaryValue),h=Math.max(...d,1),f$1=Math.max(...m,1),p=s-u.left-u.right,v=c-u.top-u.bottom,C=t.map((g,x)=>{let y=r?g.primaryValue:x+1,b=r?g.secondaryValue??0:g.primaryValue,k=u.left+y/h*p,w=c-u.bottom-b/f$1*v;return {...g,x:k,y:w,rawX:y,rawY:b}});return g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[f("div",{sx:{overflowX:"auto"},children:g("div",{component:"svg",viewBox:`0 0 ${s} ${c}`,sx:{width:"100%",minWidth:s,height:c},children:[f("line",{x1:u.left,y1:c-u.bottom,x2:s-u.right,y2:c-u.bottom,stroke:Fo(i.palette.text.secondary,.35)}),f("line",{x1:u.left,y1:u.top,x2:u.left,y2:c-u.bottom,stroke:Fo(i.palette.text.secondary,.35)}),C.map(g$1=>g("g",{children:[f("circle",{cx:g$1.x,cy:g$1.y,r:7,fill:Fo(i.palette.primary.main,.18)}),f("circle",{cx:g$1.x,cy:g$1.y,r:4.5,fill:i.palette.primary.main,children:g("title",{children:[g$1.name,`
13
13
  `,r?`${o}: ${n(g$1.primaryValue)}`:`${o}: ${n(g$1.primaryValue)}`,r?`
14
- ${r}: ${(a??n)(g$1.secondaryValue??0)}`:""]})}),f("text",{x:g$1.x,y:Math.max(g$1.y-12,d.top+8),textAnchor:"middle",fontSize:"10",fill:i.palette.text.secondary,children:g$1.name})]},g$1.name)),f("text",{x:s/2,y:l-10,textAnchor:"middle",fontSize:"11",fill:i.palette.text.secondary,children:r?o:"Index"}),f("text",{x:16,y:l/2,textAnchor:"middle",transform:`rotate(-90 16 ${l/2})`,fontSize:"11",fill:i.palette.text.secondary,children:r??o}),f("text",{x:d.left,y:d.top-4,fontSize:"10",fill:i.palette.text.secondary,children:_u(f$1)}),f("text",{x:s-d.right,y:l-d.bottom+16,textAnchor:"end",fontSize:"10",fill:i.palette.text.secondary,children:_u(h)})]})}),f("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",lg:"repeat(3, minmax(0, 1fr))"},gap:1},children:t.map(g$1=>g("div",{sx:x=>({borderRadius:"var(--orb-r-container)",px:1.25,py:1,border:`1px solid ${Eo(x.palette.divider,.7)}`,bgcolor:Eo(x.palette.background.default,.35)}),children:[f(E,{component:"div",sx:{fontSize:"0.78rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:g$1.name,children:g$1.name}),g(E,{component:"div",sx:{fontSize:"0.72rem",color:"var(--orb-fg)"},children:[o,": ",n(g$1.primaryValue)]}),r&&g(E,{component:"div",sx:{fontSize:"0.72rem",color:"var(--orb-fg)"},children:[r,": ",(a??n)(g$1.secondaryValue??0)]})]},g$1.name))})]})};var Al=t=>Math.max(...t,1),Uu=({data:t,chartType:o,primaryLabel:r,secondaryLabel:n,formatPrimaryValue:a,formatSecondaryValue:i})=>{let s=io(),l=s.palette.primary.main,d=s.palette.warning.main;if(t.length===0)return null;if(o==="bar-horizontal"){let v=Al(t.flatMap(y=>[y.primaryValue,y.secondaryValue??0]));return f(se,{spacing:1.1,children:t.map(y=>g("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"160px 1fr 128px"},gap:1.25,alignItems:"center"},children:[f(E,{component:"div",sx:{fontSize:"0.78rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:y.name,children:y.name}),g(se,{spacing:.65,children:[f("div",{sx:{height:10,borderRadius:999,overflow:"hidden",bgcolor:Eo(s.palette.action.active,.08)},children:f("div",{sx:{width:`${y.primaryValue/v*100}%`,height:"100%",bgcolor:l}})}),n&&f("div",{sx:{height:8,borderRadius:999,overflow:"hidden",bgcolor:Eo(s.palette.action.active,.08)},children:f("div",{sx:{width:`${(y.secondaryValue??0)/v*100}%`,height:"100%",bgcolor:d}})})]}),g("div",{sx:{minWidth:0},children:[f(E,{component:"div",sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},fontWeight:700,color:"var(--orb-fg-strong)"},children:a(y.primaryValue)}),n&&f(E,{component:"div",sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},color:"var(--orb-fg)"},children:(i??a)(y.secondaryValue??0)})]})]},y.name))})}if(o==="bar-vertical"){let v=Al(t.flatMap(k=>[k.primaryValue,k.secondaryValue??0])),y=n?92:76;return f("div",{sx:{overflowX:"auto",pb:.5},children:f("div",{sx:{minWidth:Math.max(620,t.length*y),display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(56px, 1fr))`,gap:1,alignItems:"end"},children:t.map(k=>g("div",{sx:{minWidth:0},children:[g("div",{sx:{height:210,display:"flex",alignItems:"flex-end",justifyContent:"center",gap:.8},children:[f("div",{sx:{width:n?16:26,minHeight:8,height:`${Math.max(k.primaryValue/v*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:l},title:`${r}: ${a(k.primaryValue)}`}),n&&f("div",{sx:{width:16,minHeight:8,height:`${Math.max((k.secondaryValue??0)/v*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:d},title:`${n}: ${(i??a)(k.secondaryValue??0)}`})]}),f(E,{component:"div",sx:{fontSize:"0.76rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:k.name,children:k.name}),f(E,{component:"div",sx:{fontSize:"0.7rem",color:"var(--orb-fg)"},noWrap:true,title:a(k.primaryValue),children:a(k.primaryValue)}),n&&f(E,{component:"div",sx:{fontSize:"0.7rem",color:"var(--orb-fg)"},noWrap:true,title:(i??a)(k.secondaryValue??0),children:(i??a)(k.secondaryValue??0)})]},k.name))})})}let p=Math.max(680,t.length*74),m=240,h={top:20,right:18,bottom:36,left:18},f$1=Al(t.flatMap(v=>[v.primaryValue,v.secondaryValue??0])),u=p-h.left-h.right,b=m-h.top-h.bottom,C=v=>t.map((y,k)=>{let w=h.left+k*u/Math.max(t.length-1,1),P=m-h.bottom-v(y)/f$1*b;return {x:w,y:P,item:y}}),g$1=C(v=>v.primaryValue),x=n?C(v=>v.secondaryValue??0):[];return g("div",{sx:{display:"flex",flexDirection:"column",gap:1.1},children:[f("div",{sx:{overflowX:"auto"},children:g("div",{component:"svg",viewBox:`0 0 ${p} ${m}`,sx:{width:"100%",minWidth:p,height:m},children:[f("line",{x1:h.left,y1:m-h.bottom,x2:p-h.right,y2:m-h.bottom,stroke:Eo(s.palette.text.secondary,.35)}),f("polyline",{fill:"none",stroke:l,strokeWidth:3,points:g$1.map(v=>`${v.x},${v.y}`).join(" ")}),g$1.map(v=>f("circle",{cx:v.x,cy:v.y,r:4,fill:l,children:g("title",{children:[v.item.name,`
15
- `,r,": ",a(v.item.primaryValue)]})},`primary-${v.item.name}`)),n&&g(e,{children:[f("polyline",{fill:"none",stroke:d,strokeWidth:2.5,strokeDasharray:"5 5",points:x.map(v=>`${v.x},${v.y}`).join(" ")}),x.map(v=>f("circle",{cx:v.x,cy:v.y,r:3.5,fill:d,children:g("title",{children:[v.item.name,`
16
- `,n,": ",(i??a)(v.item.secondaryValue??0)]})},`secondary-${v.item.name}`))]})]})}),f("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1},children:t.map(v=>g("div",{sx:y=>({borderRadius:"var(--orb-r-container)",px:1.1,py:.9,border:`1px solid ${Eo(y.palette.divider,.7)}`,bgcolor:Eo(y.palette.background.default,.35)}),children:[f(E,{component:"div",sx:{fontSize:"0.76rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:v.name,children:v.name}),f(E,{component:"div",sx:{fontSize:"0.71rem",color:"var(--orb-fg)"},children:a(v.primaryValue)}),n&&f(E,{component:"div",sx:{fontSize:"0.71rem",color:"var(--orb-fg)"},children:(i??a)(v.secondaryValue??0)})]},v.name))})]})};var Ku=(t,o,r)=>{let n=new Set,a=[];return t.forEach(i=>{n.has(i)||(n.add(i),a.push({fieldId:i,label:r.get(i)?.label??i,zone:"rows"}));}),o.forEach(i=>{n.has(i)||(n.add(i),a.push({fieldId:i,label:r.get(i)?.label??i,zone:"columns"}));}),a},qu=(t,o,r)=>t.map(n=>{let a=o.get(n.fieldId),i=a?.label??n.fieldId;return {fieldId:n.fieldId,label:`${r(n.aggregation)} \xB7 ${i}`,item:n,field:a}}),Xu=({rows:t,dimensionFieldId:o,primaryValue:r,secondaryValue:n})=>{if(!o)return [];let a=new Map;return t.forEach(i=>{let s=dr(i[o]),l=a.get(s);if(l){l.push(i);return}a.set(s,[i]);}),Array.from(a.entries()).sort((i,s)=>i[0].localeCompare(s[0],void 0,{sensitivity:"base"})).map(([i,s])=>({name:i,primaryValue:xn(s,r.fieldId,r.aggregation),secondaryValue:n?xn(s,n.fieldId,n.aggregation):void 0}))};var Zu=({rows:t,fieldMap:o,rowFields:r,columnFields:n,valueFields:a,chartDimensionFieldId:i,chartPrimaryValueFieldId:s,chartSecondaryValueFieldId:l,chartType:d,isCollapsed:p,onChartDimensionFieldIdChange:m,onChartPrimaryValueFieldIdChange:h,onChartSecondaryValueFieldIdChange:f$1,onChartTypeChange:u,onToggleCollapse:b,getAggregationLabel:C})=>{let{t:g$1}=ce(),x=useMemo(()=>Ku(r,n,o),[n,o,r]),v=useMemo(()=>qu(a,o,C),[o,C,a]),y=v.find(T=>T.fieldId===s)??v[0],k=v.find(T=>T.fieldId===l&&T.fieldId!==y?.fieldId)??null,w=x.find(T=>T.fieldId===i)??x[0],P=w&&y?g$1("pivot.chart.subtitleReady",{dimension:w.label,measure:k?`${y.label} / ${k.label}`:y.label}):g$1("pivot.chart.subtitle"),I=useMemo(()=>!w||!y?[]:Xu({rows:t,dimensionFieldId:w.fieldId,primaryValue:y.item,secondaryValue:k?.item}),[y,t,k,w]),S=T=>y?pa(T,y.item,o):T.toLocaleString(),R=T=>k?pa(T,k.item,o):T.toLocaleString(),N=x.length>1||v.length>1;return g(kn,{title:g$1("pivot.chart.title"),subtitle:P,collapsed:p,onToggleCollapse:b,expandAriaLabel:g$1("pivot.chart.collapse.ariaExpand"),collapseAriaLabel:g$1("pivot.chart.collapse.ariaCollapse"),bodySx:{display:"flex",flexDirection:"column",gap:1.1},children:[N&&g("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1,alignItems:"start"},children:[g(vr,{size:"small",sx:{minWidth:0,width:"100%"},children:[f(E,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g$1("pivot.chart.dimension")}),f(zt,{value:w?.fieldId??"",onChange:T=>m(String(T.target.value)),sx:{fontSize:"0.75rem",height:32},children:x.map(T=>f("option",{value:T.fieldId,sx:{fontSize:"0.75rem"},children:T.label},T.fieldId))})]}),g(vr,{size:"small",sx:{minWidth:0,width:"100%"},children:[f(E,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g$1("pivot.chart.primaryMeasure")}),f(zt,{value:y?.fieldId??"",onChange:T=>h(String(T.target.value)),sx:{fontSize:"0.75rem",height:32},children:v.map(T=>f("option",{value:T.fieldId,sx:{fontSize:"0.75rem"},children:T.label},T.fieldId))})]}),g(vr,{size:"small",sx:{minWidth:0,width:"100%"},children:[f(E,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g$1("pivot.chart.secondaryMeasure")}),g(zt,{value:k?.fieldId??"",onChange:T=>f$1(String(T.target.value)),sx:{fontSize:"0.75rem",height:32},children:[f("option",{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:g$1("common.none")}),v.filter(T=>T.fieldId!==y?.fieldId).map(T=>f("option",{value:T.fieldId,sx:{fontSize:"0.75rem"},children:T.label},T.fieldId))]})]}),g(vr,{size:"small",sx:{minWidth:0,width:"100%"},children:[f(E,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g$1("pivot.chart.chartType")}),g(zt,{value:d,onChange:T=>u(T.target.value),sx:{fontSize:"0.75rem",height:32},children:[f("option",{value:"bar-vertical",sx:{fontSize:"0.75rem"},children:g$1("pivot.chart.style.barVertical")}),f("option",{value:"bar-horizontal",sx:{fontSize:"0.75rem"},children:g$1("pivot.chart.style.barHorizontal")}),f("option",{value:"line",sx:{fontSize:"0.75rem"},children:g$1("pivot.chart.style.line")}),f("option",{value:"scatter",sx:{fontSize:"0.75rem"},children:g$1("pivot.chart.style.scatter")})]})]})]}),f("div",{children:w?y?I.length===0?f("div",{sx:{py:5,textAlign:"center"},children:f(E,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g$1("pivot.chart.emptyNoData")})}):d==="scatter"?f(Gu,{data:I,primaryLabel:y.label,secondaryLabel:k?.label,formatPrimaryValue:S,formatSecondaryValue:R}):f(Uu,{data:I,chartType:d,primaryLabel:y.label,secondaryLabel:k?.label,formatPrimaryValue:S,formatSecondaryValue:R}):f("div",{sx:{py:5,textAlign:"center"},children:f(E,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g$1("pivot.chart.emptyNoValue")})}):f("div",{sx:{py:5,textAlign:"center"},children:f(E,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g$1("pivot.chart.emptyNoDimension")})})})]})};var Ji=({node:t,dataColumns:o,fieldMap:r,level:n,expandedKeys:a,onToggle:i,getValue:s})=>{let l=a.has(t.key),d=t.children.length>0,p=t.isGrandTotal,m=d&&!l&&!p,h=p?800:m?700:d?600:500,f$1=p?800:m?600:500;return g(e,{children:[g("tr",{sx:{bgcolor:p?b()==="dark"?"color-mix(in oklch, var(--orb-primary) 22%, transparent)":"color-mix(in oklch, var(--orb-primary) 8%, transparent)":b()==="dark"?"var(--orb-surface)":"background.paper","&:hover":{bgcolor:p?b()==="dark"?"color-mix(in oklch, var(--orb-primary) 28%, transparent)":"color-mix(in oklch, var(--orb-primary) 12%, transparent)":"var(--orb-hover)"}},children:[g("td",{style:{fontWeight:h},sx:u=>({fontSize:"0.76rem",borderBottom:`1px solid ${u.palette.divider}`,whiteSpace:"nowrap",pl:n*2+1,display:"flex",alignItems:"center",height:40}),children:[d&&!p&&f(ie,{size:"small",onClick:()=>i(t.key),sx:{width:22,height:22,p:0,mr:.35,ml:-0.8},children:l?f(Wo,{size:12}):f(wr,{size:12})}),!d&&!p&&n>0&&f("div",{sx:{width:18}}),t.value]}),o.map(u=>f("td",{align:"right",style:{fontWeight:f$1},sx:{fontSize:"0.76rem",borderBottom:b=>`1px solid ${b.palette.divider}`,whiteSpace:"nowrap"},children:pa(s?s(t,u.id):t.aggregatedValues[u.id]??0,u.valueItem,r)},`${t.key}-${u.id}`))]}),l&&t.children.map(u=>f(Ji,{node:u,dataColumns:o,fieldMap:r,level:n+1,expandedKeys:a,onToggle:i,getValue:s},u.key))]})};var Ll=(t,o,r)=>{let n=[...t,...o];return r&&n.includes(r)?r:n[0]??""},ts=(t,o)=>o&&t.some(r=>r.fieldId===o)?o:t[0]?.fieldId??"",Ol=(t,o,r)=>r===""?"":r&&r!==o&&t.some(n=>n.fieldId===r)?r:t.find(n=>n.fieldId!==o)?.fieldId??"",Qu=t=>{let o=new Set,r=n=>{n.forEach(a=>{a.children.length>0&&(o.add(a.key),r(a.children));});};return r(t),o},ju=(t,o,r=0)=>t.length===0?r:t.reduce((n,a)=>a.children.length===0||!o.has(a.key)?Math.max(n,r+1):Math.max(n,ju(a.children,o,r+1)),r),Kv=(t,o)=>{let r=[],n=a=>{a.forEach(i=>{if(i.children.length>0&&o.has(i.key)){n(i.children);return}r.push(i);});};return n(t),r},sO=({title:t,rows:o,fields:r,initialLayout:n,initialChart:a,emptyText:i,maxPreviewHeight:s=520,initialChartCollapsed:l=false,initialTableCollapsed:d=false,model:p,enablePresetManagement:m=false,presets:h,defaultPresets:f$1,onPresetsChange:u,initialPresetId:b$1,onPresetApplied:C})=>{let{t:g$1}=ce(),x=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}})),v=useRef(0),y=useRef(false),k=t??g$1("pivot.title.default"),w=i??g$1("pivot.empty"),P=useMemo(()=>({sum:g$1("pivot.agg.sum"),count:g$1("pivot.agg.count"),avg:g$1("pivot.agg.avg"),min:g$1("pivot.agg.min"),max:g$1("pivot.agg.max")}),[g$1]),I=useCallback(D=>P[D]??Nu[D],[P]),S=useMemo(()=>new Set(r.map(D=>D.id)),[r]),R=useMemo(()=>new Map(r.map(D=>[D.id,D])),[r]),[N,T]=useState(()=>so(n?.rows,S)),[M,A]=useState(()=>so(n?.columns,S)),[L,W]=useState(()=>so(n?.filters,S)),[ee,O]=useState(()=>{let D=n?.values??[],$=new Set,G=[];return D.forEach(ue=>{if(!S.has(ue.fieldId)||$.has(ue.fieldId))return;$.add(ue.fieldId),v.current+=1;let Fe=R.get(ue.fieldId);G.push({tokenId:`v${v.current}`,fieldId:ue.fieldId,aggregation:yo(ue.aggregation,Fe)});}),G}),[_,V]=useState({}),[Q,H]=useState(true),[B,q]=useState(false),[Z,Y]=useState(()=>Ll(so(n?.rows,S),so(n?.columns,S),a?.dimensionFieldId)),[J,le]=useState(()=>{let D=(n?.values??[]).filter(($,G,ue)=>S.has($.fieldId)&&ue.findIndex(Fe=>Fe.fieldId===$.fieldId)===G).map($=>({tokenId:$.fieldId,fieldId:$.fieldId,aggregation:yo($.aggregation,R.get($.fieldId))}));return ts(D,a?.primaryValueFieldId)}),[he,ze]=useState(()=>{let D=(n?.values??[]).filter((G,ue,Fe)=>S.has(G.fieldId)&&Fe.findIndex(rt=>rt.fieldId===G.fieldId)===ue).map(G=>({tokenId:G.fieldId,fieldId:G.fieldId,aggregation:yo(G.aggregation,R.get(G.fieldId))})),$=ts(D,a?.primaryValueFieldId);return Ol(D,$,a?.secondaryValueFieldId)}),[be,Ce]=useState(a?.chartType??"bar-vertical"),[Be,de]=useState(l),[ve,We]=useState(d),[et,nt]=useState(()=>f$1??[]),[it,U]=useState(""),[Re,we]=useState(false),[Oe,at]=useState(""),[Ze,xt]=useState(null),[It,Ot]=useState(new Set(["__grand_total__"])),[At,re]=useState(new Set),Ge=p?.rowFields??N,Le=p?.columnFields??M,pe=p?.filterFields??L,xe=p?.valueFields??ee,oe=p?.filterSelections??_,ye=p?.showGrandTotal??Q,De=p?.isConfiguratorCollapsed??B,je=p?.chartDimensionFieldId??Z,st=p?.chartPrimaryValueFieldId??J,pt=p?.chartSecondaryValueFieldId??he,Bt=p?.chartType??be,Xt=p?.isChartCollapsed??Be,Vt=p?.isTableCollapsed??ve,wt=h??et,Wt=m||wt.length>0||!!u,ft=useCallback(D=>{if(p?.setRowFields){p.setRowFields(D);return}T(D);},[p]),Nt=useCallback(D=>{if(p?.setColumnFields){p.setColumnFields(D);return}A(D);},[p]),lt=useCallback(D=>{if(p?.setFilterFields){p.setFilterFields(D);return}W(D);},[p]),Ft=useCallback(D=>{if(p?.setValueFields){p.setValueFields(D);return}O(D);},[p]),Zt=useCallback(D=>{if(p?.setFilterSelections){p.setFilterSelections(D);return}V(D);},[p]),K=useCallback(D=>{if(p?.setShowGrandTotal){p.setShowGrandTotal(D);return}H(D);},[p]),z=useCallback(D=>{if(p?.setIsConfiguratorCollapsed){p.setIsConfiguratorCollapsed(D);return}q(D);},[p]),X=useCallback(D=>{if(p?.setChartDimensionFieldId){p.setChartDimensionFieldId(D);return}Y(D);},[p]),fe=useCallback(D=>{if(p?.setChartPrimaryValueFieldId){p.setChartPrimaryValueFieldId(D);return}le(D);},[p]),Se=useCallback(D=>{if(p?.setChartSecondaryValueFieldId){p.setChartSecondaryValueFieldId(D);return}ze(D);},[p]),Ae=useCallback(D=>{if(p?.setChartType){p.setChartType(D);return}Ce(D);},[p]),$e=useCallback(D=>{if(p?.setIsChartCollapsed){p.setIsChartCollapsed(D);return}de(D);},[p]),Ke=useCallback(D=>{if(p?.setIsTableCollapsed){p.setIsTableCollapsed(D);return}We(D);},[p]),Ye=useCallback(D=>{let $=typeof D=="function"?D(wt):D;h||nt($),u?.($);},[u,wt,h]),ut=useMemo(()=>new Set([...Ge,...Le,...pe]),[Ge,Le,pe]),gt=useMemo(()=>r.filter(D=>!ut.has(D.id)),[r,ut]),Mt=useMemo(()=>{let D=[...Ge,...Le,...pe],$=new Set,G=[];return D.forEach(ue=>{$.has(ue)||($.add(ue),G.push(ue));}),G},[Le,pe,Ge]);useEffect(()=>{ft(D=>{let $=D.filter(G=>S.has(G));return pr(D,$)?D:$}),Nt(D=>{let $=D.filter(G=>S.has(G));return pr(D,$)?D:$}),lt(D=>{let $=D.filter(G=>S.has(G));return pr(D,$)?D:$}),Ft(D=>{let $=D.filter(G=>S.has(G.fieldId)).map(G=>({...G,aggregation:yo(G.aggregation,R.get(G.fieldId))}));return Xi(D,$)?D:$});},[R,S]);let bt=useMemo(()=>{let D={};return Mt.forEach($=>{let G=new Set;o.forEach(ue=>{G.add(dr(ue[$]));}),D[$]=Array.from(G).sort((ue,Fe)=>ue.localeCompare(Fe));}),D},[Mt,o]);useEffect(()=>{Zt(D=>{let $={};return Mt.forEach(G=>{let ue=bt[G]??[],rt=(D[G]??[]).filter(ne=>ue.includes(ne)),_e=Object.prototype.hasOwnProperty.call(D,G);$[G]=_e?rt:ue;}),Bu(D,$)?D:$});},[Mt,bt]),useEffect(()=>{X(D=>Ll(Ge,Le,D));},[Le,Ge,X]),useEffect(()=>{fe(D=>ts(xe,D));},[fe,xe]),useEffect(()=>{Se(D=>Ol(xe,st,D));},[st,Se,xe]);let F=useMemo(()=>o.filter(D=>Mt.every($=>{let G=oe[$]??[],ue=bt[$]??[];if(G.length===ue.length)return true;if(G.length===0)return false;let Fe=dr(D[$]);return G.includes(Fe)})),[Mt,bt,oe,o]),j=useMemo(()=>{if(xe.length===0)return null;let D=new Map;if(F.forEach(_e=>{let ne=Le.length>0?Le.map(te=>dr(_e[te])):[g$1("pivot.valueLabel")],me=Wr(ne);D.set(me,ne);}),D.size===0){let _e=Le.length>0?Le.map(()=>Ki):[g$1("pivot.valueLabel")];D.set(Wr(_e),_e);}let $=Array.from(D.entries()).sort((_e,ne)=>Fu(_e[1],ne[1])),G=$.flatMap(([_e,ne])=>xe.map(me=>{let te=R.get(me.fieldId),Ee=`${I(me.aggregation)} ${te?.label??me.fieldId}`,Qe=Le.length===0||xe.length>1?`${ne.join(" / ")} \u2022 ${Ee}`:ne.join(" / ");return {id:`${_e}::${me.tokenId}`,colKey:_e,valueItem:me,label:Qe}})),ue=[];Le.length>0&&$.forEach(([_e,ne])=>{let me=G.filter(Qe=>Qe.colKey===_e),te=ue,Ee=[];ne.forEach((Qe,Me)=>{Ee.push(`d${Me}:${Qe}`);let Xe=`col::${Wr(Ee)}`,kt=te.find(Yr=>Yr.key===Xe);kt||(kt={key:Xe,label:Qe,children:[],leafColumnIds:[],path:ne.slice(0,Me+1),depth:Me},te.push(kt)),me.forEach(Yr=>{kt.leafColumnIds.includes(Yr.id)||kt.leafColumnIds.push(Yr.id);}),te=kt.children;});});let Fe=_e=>{let ne={};return G.forEach(me=>{let te=_e.filter(Ee=>{let Qe=Le.length>0?Le.map(Me=>dr(Ee[Me])):[g$1("pivot.valueLabel")];return Wr(Qe)===me.colKey});ne[me.id]=xn(te,me.valueItem.fieldId,me.valueItem.aggregation);}),ne},rt=[];if(Ge.length===0)rt.push({key:"root",value:g$1("pivot.resultLabel")||Ru,children:[],isLeaf:true,aggregatedValues:Fe(F),path:[],depth:0});else {let _e=(ne,me,te)=>{if(me>=Ge.length)return [];let Ee=Ge[me],Qe=new Map;return ne.forEach(Me=>{let Xe=dr(Me[Ee]);Qe.has(Xe)||Qe.set(Xe,[]),Qe.get(Xe).push(Me);}),Array.from(Qe.keys()).sort().map(Me=>{let Xe=Qe.get(Me),kt=[...te,Me];return {key:Wr(kt),value:Me,fieldId:Ee,aggregatedValues:Fe(Xe),children:_e(Xe,me+1,kt),isLeaf:me===Ge.length-1,path:kt,depth:me}})};rt.push(..._e(F,0,[]));}return {dataColumns:G,columnTree:ue,rowTree:rt}},[Le,R,F,I,Ge,g$1,xe]),ge=useCallback((D,$)=>(v.current+=1,{tokenId:`v${v.current}`,fieldId:D,aggregation:yo($,R.get(D))}),[R]),Te=useCallback(D=>{if(D==="rows")return ft([]);if(D==="columns")return Nt([]);if(D==="filters")return lt([]);Ft([]);},[]),Je=useCallback((D,$)=>{if(D==="rows")return ft(G=>G.filter(ue=>ue!==$));if(D==="columns")return Nt(G=>G.filter(ue=>ue!==$));if(D==="filters")return lt(G=>G.filter(ue=>ue!==$));Ft(G=>G.filter(ue=>ue.tokenId!==$));},[]),qe=useCallback((D,$)=>{Ft(G=>G.map(ue=>ue.tokenId===D?{...ue,aggregation:yo($,R.get(ue.fieldId))}:ue));},[R]),St=useCallback(D=>{xt(String(D.active.id));},[]),ht=useCallback(D=>{if(xt(null),!D.over)return;let $=qi(String(D.active.id)),G=qi(String(D.over.id));if(!$||!G||$.kind!=="item"||!$.key)return;if($.zone===G.zone&&G.kind==="item"){if($.zone==="rows"){let Me=Ge.indexOf($.key),Xe=Ge.indexOf(G.key??"");Me!==-1&&Xe!==-1&&Me!==Xe&&ft(kt=>arrayMove(kt,Me,Xe));return}if($.zone==="columns"){let Me=Le.indexOf($.key),Xe=Le.indexOf(G.key??"");Me!==-1&&Xe!==-1&&Me!==Xe&&Nt(kt=>arrayMove(kt,Me,Xe));return}if($.zone==="filters"){let Me=pe.indexOf($.key),Xe=pe.indexOf(G.key??"");Me!==-1&&Xe!==-1&&Me!==Xe&&lt(kt=>arrayMove(kt,Me,Xe));return}if($.zone==="values"){let Me=xe.findIndex(kt=>kt.tokenId===$.key),Xe=xe.findIndex(kt=>kt.tokenId===(G.key??""));Me!==-1&&Xe!==-1&&Me!==Xe&&Ft(kt=>arrayMove(kt,Me,Xe));}return}let ue=G.zone,Fe=[...Ge],rt=[...Le],_e=[...pe],ne=[...xe],me="",te=null;if($.zone==="palette")me=$.key;else if($.zone==="values"){let Me=ne.find(Xe=>Xe.tokenId===$.key);if(!Me)return;me=Me.fieldId,te=Me,ne=ne.filter(Xe=>Xe.tokenId!==$.key);}else $.zone==="rows"?(me=$.key,Fe=Fe.filter(Me=>Me!==me)):$.zone==="columns"?(me=$.key,rt=rt.filter(Me=>Me!==me)):$.zone==="filters"&&(me=$.key,_e=_e.filter(Me=>Me!==me));if(!me)return;let Ee=()=>{Fe=Fe.filter(Me=>Me!==me),rt=rt.filter(Me=>Me!==me),_e=_e.filter(Me=>Me!==me);},Qe=Me=>{if(G.kind!=="item"||!G.key)return Me==="rows"?Fe.length:Me==="columns"?rt.length:Me==="filters"?_e.length:Me==="values"?ne.length:0;if(Me==="rows"){let Xe=Fe.indexOf(G.key);return Xe>=0?Xe:Fe.length}if(Me==="columns"){let Xe=rt.indexOf(G.key);return Xe>=0?Xe:rt.length}if(Me==="filters"){let Xe=_e.indexOf(G.key);return Xe>=0?Xe:_e.length}if(Me==="values"){let Xe=ne.findIndex(kt=>kt.tokenId===G.key);return Xe>=0?Xe:ne.length}return 0};if(ue==="palette"){ft(Fe),Nt(rt),lt(_e),Ft(ne);return}if(ue==="values"){let Me=Qe("values"),Xe=te??ge(me);ne.splice(Me,0,Xe),ft(Fe),Nt(rt),lt(_e),Ft(ne);return}if(Ou(ue)){Ee();let Me=Qe(ue);ue==="rows"?Fe.splice(Me,0,me):ue==="columns"?rt.splice(Me,0,me):_e.splice(Me,0,me),ft(Fe),Nt(rt),lt(_e),Ft(ne);}},[Le,ge,pe,Ge,xe]),mt=useCallback((D,$)=>{Zt(G=>({...G,[D]:$}));},[]),yt=useCallback(D=>{Ot($=>{let G=new Set($);return G.has(D)?G.delete(D):G.add(D),G});},[]),ro=useCallback(D=>{re($=>{let G=new Set($);return G.has(D)?G.delete(D):G.add(D),G});},[]),Et=useCallback(D=>{let $=R.get(D.fieldId),G=Dl($);return f(vr,{size:"small",sx:{minWidth:98},children:f(zt,{value:D.aggregation,onChange:ue=>qe(D.tokenId,ue.target.value),onClick:ue=>ue.stopPropagation(),onMouseDown:ue=>ue.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& select.orb-inp":{py:.35}},children:G.map(ue=>f("option",{value:ue,sx:{fontSize:"0.75rem"},children:I(ue)},ue))})})},[R,I,qe]),Yt=useCallback(D=>{let $=bt[D]??[],G=oe[D]??$;return $.length===0?g$1("pivot.filter.noValues"):G.length===0?g$1("pivot.filter.noneSelected"):G.length===$.length?g$1("pivot.filter.allValues"):g$1("pivot.filter.selectedCount",{selected:G.length,total:$.length})},[bt,oe,g$1]),Ht=useCallback(D=>{let $=bt[D]??[],G=oe[D]??$;return f(zu,{options:$,selectedValues:G,onChange:ue=>mt(D,ue)})},[bt,oe,mt]),Ut=useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),$t=useCallback(()=>{let D={};return new Set([...Mt,...Object.keys(oe)]).forEach(G=>{if(!S.has(G))return;let ue=oe[G]??[];D[G]=[...ue];}),{layout:{rows:[...Ge],columns:[...Le],filters:[...pe],values:xe.map(G=>({fieldId:G.fieldId,aggregation:G.aggregation}))},filterSelections:D,showGrandTotal:ye,chart:{dimensionFieldId:je,primaryValueFieldId:st,secondaryValueFieldId:pt,chartType:Bt}}},[Mt,je,st,pt,Bt,Le,pe,oe,Ge,ye,S,xe]),to=useCallback(D=>{let $=so(D.layout.rows,S),G=so(D.layout.columns,S),ue=so(D.layout.filters,S),Fe=new Set,rt=(D.layout.values??[]).filter(me=>!S.has(me.fieldId)||Fe.has(me.fieldId)?false:(Fe.add(me.fieldId),true)).map(me=>ge(me.fieldId,me.aggregation)),_e={};Object.entries(D.filterSelections??{}).forEach(([me,te])=>{!S.has(me)||!Array.isArray(te)||(_e[me]=Array.from(new Set(te.map(Ee=>String(Ee)))));}),ft($),Nt(G),lt(ue),Ft(rt),Zt(_e),typeof D.showGrandTotal=="boolean"&&K(D.showGrandTotal),X(Ll($,G,D.chart?.dimensionFieldId));let ne=ts(rt,D.chart?.primaryValueFieldId);fe(ne),Se(Ol(rt,ne,D.chart?.secondaryValueFieldId)),Ae(D.chart?.chartType??"bar-vertical"),U(D.id),C?.(D);},[ge,C,X,fe,Se,Ae,Nt,lt,Zt,ft,K,Ft,S]),no=useCallback(D=>{if(!D){U("");return}let $=wt.find(G=>G.id===D);if(!$){U("");return}to($);},[to,wt]),fo=useCallback(()=>{let D=g$1("pivot.preset.defaultName",{index:wt.length+1});at(D),we(true);},[wt.length,g$1]),Io=useCallback(()=>{let D=Oe.trim();if(!D)return;let $={id:Ut(),name:D,...$t()};Ye(G=>[...G,$]),U($.id),we(false);},[$t,Ut,Oe,Ye]),Mo=useCallback(()=>{it&&(Ye(D=>D.filter($=>$.id!==it)),U(""));},[it,Ye]);useEffect(()=>{if(!b$1||y.current)return;let D=wt.find($=>$.id===b$1);D&&(y.current=true,to(D));},[to,b$1,wt]),useEffect(()=>{it&&(wt.some(D=>D.id===it)||U(""));},[it,wt]);let nr=useMemo(()=>{if(!ye||!j||!Ge.length)return null;let D={};return j.dataColumns.forEach($=>{let G=F.filter(ue=>{let Fe=Le.length>0?Le.map(rt=>dr(ue[rt])):[g$1("pivot.valueLabel")];return Wr(Fe)===$.colKey});D[$.id]=xn(G,$.valueItem.fieldId,$.valueItem.aggregation);}),{key:"__grand_total__",value:g$1("pivot.grandTotal")||Du,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:D,path:[],depth:-1}},[ye,j,F,Le,Ge.length,g$1]),Co=useMemo(()=>Qu(j?.rowTree??[]),[j]),Fo=useMemo(()=>Qu(j?.columnTree??[]),[j]);useEffect(()=>{Ot(D=>{let $=new Set;return D.has("__grand_total__")&&$.add("__grand_total__"),Co.forEach(G=>{D.has(G)&&$.add(G);}),$});},[Co]),useEffect(()=>{re(D=>{let $=new Set;return Fo.forEach(G=>{D.has(G)&&$.add(G);}),$});},[Fo]);let Ur=useCallback(()=>{Ot(D=>{let $=new Set(D);return Co.forEach(G=>$.add(G)),$});},[Co]),Kr=useCallback(()=>{Ot(D=>{let $=new Set;return D.has("__grand_total__")&&$.add("__grand_total__"),$});},[]),Ar=useCallback(()=>{re(new Set(Fo));},[Fo]),qr=useCallback(()=>{re(new Set);},[]),Xr=useMemo(()=>!j||Le.length===0?[]:Kv(j.columnTree,At),[Le.length,At,j]),Ro=useMemo(()=>{if(!j)return [];if(Le.length===0)return j.dataColumns.map($=>({id:$.id,label:$.label,leafColumnIds:[$.id],valueItem:$.valueItem}));let D=new Map(j.dataColumns.map($=>[$.id,$]));return Xr.flatMap($=>{let G=new Map;return $.leafColumnIds.forEach(ue=>{let Fe=D.get(ue);if(!Fe)return;let rt=Fe.valueItem.tokenId,_e=`${I(Fe.valueItem.aggregation)} ${R.get(Fe.valueItem.fieldId)?.label??Fe.valueItem.fieldId}`,ne=G.get(rt);if(ne){ne.leafColumnIds.push(ue);return}G.set(rt,{id:`${$.key}::${rt}`,label:xe.length>1?_e:$.label,leafColumnIds:[ue],valueItem:Fe.valueItem});}),Array.from(G.values())})},[Le.length,R,I,j,xe.length,Xr]),Er=useMemo(()=>new Map(Ro.map(D=>[D.id,D])),[Ro]),Zr=useMemo(()=>Ro.map(D=>({id:D.id,colKey:D.id,valueItem:D.valueItem,label:D.label})),[Ro]),Xo=useMemo(()=>{if(!j||Le.length===0)return [];let D=[],$=ju(j.columnTree,At),G=$+(xe.length>1?1:0),ue=(Fe,rt)=>{D[rt]??(D[rt]=[]),Fe.forEach(_e=>{let ne=_e.children.length>0&&At.has(_e.key),me=Ro.filter(Ee=>_e.leafColumnIds.some(Qe=>Ee.leafColumnIds.includes(Qe))).length,te=ne||xe.length>1?1:G-rt;D[rt].push({key:_e.key,label:_e.label,colSpan:me,rowSpan:te,expandable:_e.children.length>0,expanded:ne}),ne&&ue(_e.children,rt+1);});};return ue(j.columnTree,0),xe.length>1&&(D[$]=Ro.map(Fe=>({key:Fe.id,label:Fe.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),D},[Le.length,At,j,xe.length,Ro]),ar=useCallback((D,$)=>$.leafColumnIds.reduce((G,ue)=>G+(D.aggregatedValues[ue]??0),0),[]),En=useMemo(()=>g(e,{children:[f(Pe,{size:"small",variant:"text",onClick:Ur,disabled:Co.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g$1("pivot.table.expandRowsAll")}),f(Pe,{size:"small",variant:"text",onClick:Kr,disabled:Co.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g$1("pivot.table.collapseRowsAll")}),f(Rt,{orientation:"vertical",flexItem:true}),f(Pe,{size:"small",variant:"text",onClick:Ar,disabled:Fo.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g$1("pivot.table.expandColumnsAll")}),f(Pe,{size:"small",variant:"text",onClick:qr,disabled:Le.length===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g$1("pivot.table.collapseColumnsAll")})]}),[Le.length,Fo.size,Co.size,qr,Kr,Ar,Ur,g$1]),Lr=()=>{if(!Ze)return null;let D=qi(Ze);if(!D||D.kind!=="item"||!D.key)return null;if(D.zone==="palette"){let Fe=R.get(D.key);return Fe?f(Nl,{label:Fe.label,subtitle:Fe.type}):null}if(D.zone==="values"){let Fe=xe.find(me=>me.tokenId===D.key);if(!Fe)return null;let _e=R.get(Fe.fieldId)?.label??Fe.fieldId,ne=`${I(Fe.aggregation)}(${_e})`;return f(Zi,{label:_e,caption:ne})}let G=R.get(D.key)?.label??D.key,ue=Yt(D.key);return f(Zi,{label:G,caption:ue})};return g(Ne,{sx:D=>({p:{xs:1.2,md:2},borderRadius:"var(--orb-r-container)",border:`1px solid ${D.palette.divider}`,bgcolor:"var(--orb-canvas)",boxShadow:"var(--orb-shadow-2)",display:"flex",flexDirection:"column",gap:2.25}),children:[g("div",{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1.5,flexWrap:"wrap"},children:[g("div",{sx:{minWidth:0,display:"flex",flexDirection:"column",gap:.35},children:[f(E,{component:"div",sx:{fontSize:"1.08rem",fontWeight:700,lineHeight:1.25,color:"var(--orb-fg-strong)"},children:k}),f(E,{component:"div",sx:{fontSize:"0.8rem",fontWeight:400,color:"var(--orb-fg)"},children:g$1("pivot.subtitle.default")})]}),g(se,{direction:"row",spacing:1.5,alignItems:"center",children:[Wt&&g(e,{children:[f(vr,{size:"small",sx:{minWidth:200},children:g(zt,{value:it,displayEmpty:true,onChange:D=>no(String(D.target.value)),sx:{fontSize:"0.75rem",height:32},children:[f("option",{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:g$1("pivot.preset.selectPlaceholder")}),wt.map(D=>f("option",{value:D.id,sx:{fontSize:"0.75rem"},children:D.name},D.id))]})}),f(ct,{title:g$1("pivot.preset.save"),children:f(ie,{size:"small",onClick:fo,"aria-label":g$1("pivot.preset.save"),sx:{width:28,height:28,p:0},children:f(Sr,{size:15})})}),f(ct,{title:g$1("pivot.preset.delete"),children:f("span",{children:f(ie,{size:"small",onClick:Mo,disabled:!it,"aria-label":g$1("pivot.preset.delete"),sx:{width:28,height:28,p:0},children:f(ai,{size:15})})})}),f(Rt,{flexItem:true,orientation:"vertical"})]}),g(E,{component:"div",sx:{fontSize:"0.75rem",fontWeight:400,color:"var(--orb-fg)"},children:[g$1("pivot.records"),": ",f("strong",{children:o.length.toLocaleString()})," / ",g$1("pivot.afterFilter"),":"," ",f("strong",{children:F.length.toLocaleString()})]}),f(Rt,{flexItem:true,orientation:"vertical"}),g("div",{sx:{display:"flex",alignItems:"center",gap:.6},children:[f(E,{component:"div",sx:{fontSize:"0.75rem",fontWeight:500,color:"var(--orb-fg-strong)"},children:g$1("pivot.grandTotal")}),f(ti,{size:"small",checked:ye,onChange:D=>K(D.target.checked)})]})]})]}),f(Rt,{}),g(DndContext,{sensors:x,collisionDetection:closestCenter,onDragStart:St,onDragEnd:ht,children:[f($u,{isConfiguratorCollapsed:De,onToggleCollapse:()=>z(D=>!D),availableFields:gt,fieldMap:R,filterFields:pe,columnFields:Le,rowFields:Ge,valueFields:xe,clearZone:Te,removeFieldFromZone:Je,getFilterSelectionSummary:Yt,renderDimensionFilterSelect:Ht,renderAggregationSelect:Et,getAggregationLabel:I}),f(Dd,{children:f(DragOverlay,{dropAnimation:{duration:250,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:Lr()})})]}),f(Zu,{rows:F,fieldMap:R,rowFields:Ge,columnFields:Le,valueFields:xe,chartDimensionFieldId:je,chartPrimaryValueFieldId:st,chartSecondaryValueFieldId:pt,chartType:Bt,isCollapsed:Xt,onChartDimensionFieldIdChange:D=>X(D),onChartPrimaryValueFieldIdChange:D=>fe(D),onChartSecondaryValueFieldIdChange:D=>Se(D),onChartTypeChange:D=>Ae(D),onToggleCollapse:()=>$e(D=>!D),getAggregationLabel:I}),f(kn,{title:g$1("pivot.table.sectionTitle"),subtitle:Ge.length>0?Ge.map(D=>R.get(D)?.label??D).join(" > "):g$1("pivot.table.dimensions"),collapsed:Vt,onToggleCollapse:()=>Ke(D=>!D),expandAriaLabel:g$1("pivot.table.collapse.ariaExpand"),collapseAriaLabel:g$1("pivot.table.collapse.ariaCollapse"),bodySx:{p:0},headerActions:En,children:j===null?f("div",{sx:{py:5,px:{xs:1.2,md:1.6},textAlign:"center"},children:f(E,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:w})}):f("div",{sx:{maxHeight:s},children:g("table",{className:"orb-tbl",size:"small",stickyHeader:true,children:[f("thead",{children:(Xo.length>0?Xo:[[]]).map((D,$)=>g("tr",{children:[$===0&&f("td",{rowSpan:Math.max(Xo.length,1),sx:G=>({fontWeight:800,fontSize:"0.76rem",color:"text.primary",bgcolor:b()==="dark"?"var(--orb-canvas)":"var(--orb-surface)",borderBottom:`1px solid ${G.palette.divider}`,pl:2,minWidth:220,verticalAlign:"middle"}),children:Ge.length>0?Ge.map(G=>R.get(G)?.label).join(" > "):g$1("pivot.table.dimensions")}),(D.length>0?D:Ro.map(G=>({key:G.id,label:G.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))).map(G=>f("td",{align:"center",colSpan:G.colSpan,rowSpan:G.rowSpan,sx:ue=>({fontWeight:800,fontSize:"0.75rem",color:"text.primary",bgcolor:b()==="dark"?"var(--orb-canvas)":"var(--orb-surface)",borderBottom:`1px solid ${ue.palette.divider}`,minWidth:148,verticalAlign:"middle"}),children:g("div",{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:.4},children:[G.expandable&&f(ie,{size:"small",onClick:()=>ro(G.key),sx:{width:22,height:22,p:0,ml:-0.2},children:G.expanded?f(Wo,{size:12}):f(wr,{size:12})}),f("div",{component:"span",children:G.label})]})},G.key))]},`pivot-header-row-${$}`))}),g("tbody",{children:[j.rowTree.map(D=>f(Ji,{node:D,dataColumns:Zr,fieldMap:R,level:0,expandedKeys:It,onToggle:yt,getValue:($,G)=>{let ue=Er.get(G);return ue?ar($,ue):0}},D.key)),nr&&f(Ji,{node:nr,dataColumns:Zr,fieldMap:R,level:0,expandedKeys:It,onToggle:yt,getValue:(D,$)=>{let G=Er.get($);return G?ar(D,G):0}})]})]})})}),g(Lt,{open:Re,onClose:()=>we(false),maxWidth:"xs",fullWidth:true,children:[f("div",{className:"orb-dialog-title",children:g$1("pivot.preset.saveDialogTitle")}),f("div",{className:"orb-dialog-content",children:f(He,{autoFocus:true,fullWidth:true,margin:"dense",label:g$1("pivot.preset.nameLabel"),value:Oe,onChange:D=>at(D.target.value),onKeyDown:D=>{D.key==="Enter"&&(D.preventDefault(),Io());}})}),g("div",{className:"orb-dialog-actions",children:[f(Pe,{onClick:()=>we(false),children:g$1("common.cancel")}),f(Pe,{variant:"contained",onClick:Io,disabled:!Oe.trim(),children:g$1("common.save")})]})]})]})};var Ju=(t,o,r)=>{let n=[...t,...o];return r&&n.includes(r)?r:n[0]??""},Bl=(t,o)=>o&&t.some(r=>r.fieldId===o)?o:t[0]?.fieldId??"",em=(t,o,r)=>r===""?"":r&&r!==o&&t.some(n=>n.fieldId===r)?r:t.find(n=>n.fieldId!==o)?.fieldId??"",uO=({fields:t,initialLayout:o,initialFilterSelections:r={},initialShowGrandTotal:n=true,initialConfiguratorCollapsed:a=false,initialChart:i,initialChartCollapsed:s=false,initialTableCollapsed:l=false})=>{let d=useRef(0),p=useMemo(()=>new Set(t.map(U=>U.id)),[t]),m=useMemo(()=>new Map(t.map(U=>[U.id,U])),[t]),[h,f]=useState(()=>so(o?.rows,p)),[u,b]=useState(()=>so(o?.columns,p)),[C,g]=useState(()=>so(o?.filters,p)),[x,v]=useState(()=>{let U=o?.values??[],Re=new Set,we=[];return U.forEach(Oe=>{!p.has(Oe.fieldId)||Re.has(Oe.fieldId)||(Re.add(Oe.fieldId),d.current+=1,we.push({tokenId:`v${d.current}`,fieldId:Oe.fieldId,aggregation:yo(Oe.aggregation,m.get(Oe.fieldId))}));}),we}),[y,k]=useState(r),[w,P]=useState(n),[I,S]=useState(a),[R,N]=useState(()=>Ju(so(o?.rows,p),so(o?.columns,p),i?.dimensionFieldId)),[T,M]=useState(()=>{let U=(()=>{let Re=o?.values??[],we=new Set,Oe=[];return Re.forEach(at=>{!p.has(at.fieldId)||we.has(at.fieldId)||(we.add(at.fieldId),Oe.push({tokenId:at.fieldId,fieldId:at.fieldId,aggregation:yo(at.aggregation,m.get(at.fieldId))}));}),Oe})();return Bl(U,i?.primaryValueFieldId)}),[A,L]=useState(()=>{let U=(()=>{let we=o?.values??[],Oe=new Set,at=[];return we.forEach(Ze=>{!p.has(Ze.fieldId)||Oe.has(Ze.fieldId)||(Oe.add(Ze.fieldId),at.push({tokenId:Ze.fieldId,fieldId:Ze.fieldId,aggregation:yo(Ze.aggregation,m.get(Ze.fieldId))}));}),at})(),Re=Bl(U,i?.primaryValueFieldId);return em(U,Re,i?.secondaryValueFieldId)}),[W,ee]=useState(i?.chartType??"bar-vertical"),[O,_]=useState(s),[V,Q]=useState(l);useEffect(()=>{f(U=>{let Re=U.filter(we=>p.has(we));return pr(U,Re)?U:Re}),b(U=>{let Re=U.filter(we=>p.has(we));return pr(U,Re)?U:Re}),g(U=>{let Re=U.filter(we=>p.has(we));return pr(U,Re)?U:Re}),v(U=>{let Re=U.filter(we=>p.has(we.fieldId)).map(we=>({...we,aggregation:yo(we.aggregation,m.get(we.fieldId))}));return Xi(U,Re)?U:Re});},[m,p]),useEffect(()=>{N(U=>Ju(h,u,U));},[u,h]),useEffect(()=>{M(U=>Bl(x,U));},[x]),useEffect(()=>{L(U=>em(x,T,U));},[T,x]);let H=useCallback(U=>{f(so(U,p));},[p]),B=useCallback(U=>{b(so(U,p));},[p]),q=useCallback(U=>{g(so(U,p));},[p]),Z=useCallback(U=>{v(Re=>{let we=U??[],Oe=new Set,at=[];return we.forEach(Ze=>{if(!p.has(Ze.fieldId)||Oe.has(Ze.fieldId))return;Oe.add(Ze.fieldId);let xt=Re.find(It=>It.fieldId===Ze.fieldId);if(xt){at.push({...xt,aggregation:yo(Ze.aggregation??xt.aggregation,m.get(Ze.fieldId))});return}d.current+=1,at.push({tokenId:`v${d.current}`,fieldId:Ze.fieldId,aggregation:yo(Ze.aggregation,m.get(Ze.fieldId))});}),at});},[m,p]),Y=useCallback(U=>{H(U.rows??[]),B(U.columns??[]),q(U.filters??[]),Z(U.values??[]);},[B,q,H,Z]),J=useCallback(U=>{if(U==="rows")return f([]);if(U==="columns")return b([]);if(U==="filters")return g([]);v([]);},[]),le=useCallback((U,Re)=>{if(U==="rows")return f(we=>we.filter(Oe=>Oe!==Re));if(U==="columns")return b(we=>we.filter(Oe=>Oe!==Re));if(U==="filters")return g(we=>we.filter(Oe=>Oe!==Re));v(we=>we.filter(Oe=>Oe.tokenId!==Re));},[]),he=useCallback((U,Re)=>{v(we=>we.map(Oe=>Oe.tokenId===U?{...Oe,aggregation:yo(Re,m.get(Oe.fieldId))}:Oe));},[m]),ze=useCallback((U,Re)=>{k(we=>({...we,[U]:Re}));},[]),be=useCallback(()=>{k({});},[]),Ce=useCallback(()=>{P(U=>!U);},[]),Be=useCallback(()=>{S(U=>!U);},[]),de=useCallback(U=>{N(U);},[]),ve=useCallback(U=>{M(U);},[]),We=useCallback(U=>{L(U);},[]),et=useCallback(()=>{_(U=>!U);},[]),nt=useCallback(()=>{Q(U=>!U);},[]);return {model:useMemo(()=>({rowFields:h,setRowFields:f,columnFields:u,setColumnFields:b,filterFields:C,setFilterFields:g,valueFields:x,setValueFields:v,filterSelections:y,setFilterSelections:k,showGrandTotal:w,setShowGrandTotal:P,isConfiguratorCollapsed:I,setIsConfiguratorCollapsed:S,chartDimensionFieldId:R,setChartDimensionFieldId:N,chartPrimaryValueFieldId:T,setChartPrimaryValueFieldId:M,chartSecondaryValueFieldId:A,setChartSecondaryValueFieldId:L,chartType:W,setChartType:ee,isChartCollapsed:O,setIsChartCollapsed:_,isTableCollapsed:V,setIsTableCollapsed:Q}),[R,T,A,W,u,C,y,O,I,V,h,w,x]),actions:{setRows:H,setColumns:B,setFilters:q,setValues:Z,setLayout:Y,clearZone:J,removeFieldFromZone:le,setAggregationForValue:he,setFilterSelection:ze,resetFilterSelections:be,toggleGrandTotal:Ce,toggleConfigurator:Be,setChartDimension:de,setChartPrimaryValue:ve,setChartSecondaryValue:We,setChartType:ee,toggleChart:et,toggleTable:nt}}};var fO=({orientation:t="auto",defaultNavigationOpen:o,onNavOpenChange:r}={})=>{let n=io(),a=yr("(orientation: portrait)"),i=yr(n.breakpoints.down("md")),s=useMemo(()=>t==="auto"?a||i?"portrait":"landscape":t,[i,a,t]),[l,d]=useState(o??s==="landscape");useEffect(()=>{d(o??s==="landscape");},[o,s]);let p=h=>{d(h),r?.(h);};return {resolvedOrientation:s,isPortraitViewport:a,isCompactViewport:i,navigationOpen:l,setNavigationOpen:p,toggleNavigationOpen:()=>p(!l)}};var jv=t=>{let o=Number(t||0);return Number.isFinite(o)?o:0},yO=({rows:t,rowKey:o="id",numericField:r,defaultSelectedId:n})=>{let i=t[0]?.[o],[s,l]=useState(n??i),d=useMemo(()=>t.find(u=>u[o]===s)||t[0],[o,t,s]),[p,m]=useState(()=>{let u=d?.[r];return u==null?"0":String(u)});return {selectedId:s,selectedRecord:d,editorValue:p,setEditorValue:m,selectRecord:u=>{let b=u[o];l(b);let C=u[r];m(C==null?"0":String(C));},applyEditorValue:u=>{if(s===void 0)return;let b=jv(p),C=t.map(g=>g[o]===s?{...g,[r]:b}:g);u(C);}}};var Jv=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],om=(t,o,r,n)=>{o?.(t),n&&r?.();},PO=({open:t,onClose:o,title:r="Scan barcode",subtitle:n="Use the rear camera on the device. If scanning is unavailable, enter the code manually.",formats:a=Jv,facingMode:i="environment",manualEntry:s=true,autoCloseOnDetect:l=true,scanIntervalMs:d=600,confirmLabel:p="Use code",cancelLabel:m="Close",manualPlaceholder:h="Enter barcode manually",onDetected:f$1,onError:u,sx:b$1})=>{let C=Jt__default.useRef(null),g$1=Jt__default.useRef(null),x=Jt__default.useRef(null),v=Jt__default.useRef(null),[y,k]=Jt__default.useState("idle"),[w,P]=Jt__default.useState(""),[I,S]=Jt__default.useState(null),[R,N]=Jt__default.useState(null),T=Jt__default.useCallback(()=>{x.current!==null&&(window.clearInterval(x.current),x.current=null),g$1.current&&(g$1.current.getTracks().forEach(L=>L.stop()),g$1.current=null),C.current&&(C.current.srcObject=null);},[]),M=Jt__default.useCallback(L=>{N(L),k("error"),u?.(L);},[u]);Jt__default.useEffect(()=>{if(!t){T(),k("idle"),N(null),P("");return}let L=false;return (async()=>{if(!(typeof window>"u"||typeof navigator>"u")){if(!navigator.mediaDevices?.getUserMedia){k("unsupported"),N("Camera access is not supported in this browser.");return}k("starting"),N(null);try{let ee=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:i}}});if(L){ee.getTracks().forEach(O=>O.stop());return}if(g$1.current=ee,C.current&&(C.current.srcObject=ee,await C.current.play()),!window.BarcodeDetector){k("unsupported"),N("BarcodeDetector is not available. Camera preview is ready and manual entry is enabled.");return}v.current=new window.BarcodeDetector({formats:a}),k("ready"),x.current=window.setInterval(async()=>{if(!(!C.current||!v.current)&&!(C.current.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))try{let _=(await v.current.detect(C.current)).find(Q=>Q.rawValue);if(!_?.rawValue)return;let V={rawValue:_.rawValue,format:_.format};S(V),T(),om(V,f$1,o,l);}catch(O){M(O instanceof Error?O.message:"Failed to detect barcode.");}},d);}catch(ee){M(ee instanceof Error?ee.message:"Unable to start camera.");}}})(),()=>{L=true,T();}},[l,i,a,o,f$1,t,M,d,T]);let A=()=>{let L=w.trim();if(!L)return;let W={rawValue:L,format:"manual"};S(W),om(W,f$1,o,l);};return g(Lt,{open:t,onClose:o,fullWidth:true,maxWidth:"sm",children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:900},children:r}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g(se,{spacing:2,sx:b$1,children:[f(E,{sx:{fontSize:"0.88rem",color:"text.secondary",lineHeight:1.55},children:n}),g(Ne,{elevation:0,sx:{position:"relative",overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:"divider",minHeight:280,background:b()==="dark"?"linear-gradient(180deg, color-mix(in oklch, var(--orb-canvas) 92%, transparent), color-mix(in oklch, var(--orb-canvas) 96%, transparent))":"linear-gradient(180deg, var(--orb-surface), color-mix(in oklch, var(--orb-border) 92%, transparent))"},children:[f("video",{ref:C,muted:true,playsInline:true,autoPlay:true,style:{width:"100%",height:280,objectFit:"cover",display:"block"}}),f("div",{sx:{pointerEvents:"none",position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:f("div",{sx:{width:"72%",maxWidth:320,aspectRatio:"1.7 / 1",borderRadius:3,border:"2px solid rgba(255,255,255,0.95)",boxShadow:"0 0 0 999px rgba(15,23,42,0.24)",position:"relative"},children:f("div",{sx:{position:"absolute",top:"50%",left:0,right:0,height:2,bgcolor:"var(--orb-ai-accent)",boxShadow:"0 0 18px color-mix(in oklch, var(--orb-ai-accent) 85%, transparent)"}})})}),g("div",{sx:{position:"absolute",top:12,left:12,display:"flex",gap:1,flexWrap:"wrap"},children:[f(Ct,{icon:f(_d,{}),label:y==="ready"?"Camera ready":y==="starting"?"Starting camera":y==="unsupported"?"Preview only":y==="error"?"Scanner error":"Idle",size:"small",color:y==="error"?"error":"primary",variant:"filled"}),I?f(Ct,{icon:f(sp,{}),label:`${I.format||"barcode"}: ${I.rawValue}`,size:"small",color:"success",variant:"filled"}):null]})]}),R?f(jo,{severity:y==="unsupported"?"info":"warning",children:R}):null,s?g(se,{direction:{xs:"column",sm:"row"},spacing:1.25,children:[f(He,{fullWidth:true,label:"Barcode",placeholder:h,value:w,onChange:L=>P(L.target.value)}),f(Pe,{variant:"contained",onClick:A,sx:{minHeight:56,px:2.5},children:p})]}):null]})}),f("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:f(Pe,{onClick:o,children:m})})]})};var ey={default:"var(--orb-status-fg)",primary:"var(--orb-status-primary)",success:"var(--orb-status-success)",warning:"var(--orb-status-warning)",error:"var(--orb-status-error)",info:"var(--orb-status-info)"},AO=({title:t,description:o,kicker:r,icon:n,badges:a=[],metrics:i=[],footer:s,children:l,selected:d=false,draggable:p=false,isDragging:m=false,swipeThreshold:h=88,startAction:f$1,endAction:u,dragHandleProps:b$1,onClick:C,onSwipe:g$1,sx:x})=>{let[v,y]=useState(0),[k,w]=useState(false),P=useRef(null),I=useRef(0),S=useRef(0),R=!!(f$1||u),N=132,T=()=>{y(0),w(false),P.current=null,I.current=0,S.current=0;},M=O=>{(O==="start"?f$1:u)?.onTrigger?.(),g$1?.(O),T();},A=O=>{!R||O.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(P.current=O.pointerId,I.current=O.clientX,S.current=O.clientX,w(true),O.currentTarget.setPointerCapture(O.pointerId));},L=O=>{if(!k||P.current!==O.pointerId)return;S.current=O.clientX;let _=S.current-I.current,V=Math.max(-N,Math.min(N,_));y(V);},W=O=>{if(!k||P.current!==O.pointerId)return;let _=S.current-I.current;if(_>=h&&f$1){M("start");return}if(_<=-h&&u){M("end");return}Math.abs(_)<12&&C?.(),T();},ee=(O,_)=>{if(!O)return null;let V=O.backgroundColor||ey[O.tone||"default"];return f("div",{sx:{position:"absolute",top:0,bottom:0,[_]:0,width:N,px:2,display:"flex",alignItems:"center",justifyContent:_==="left"?"flex-start":"flex-end",color:"var(--orb-on-primary)",background:`linear-gradient(135deg, ${V}, rgba(15,23,42,0.92))`},children:g(se,{direction:"row",spacing:1,alignItems:"center",children:[O.icon,f(E,{sx:{fontWeight:700,fontSize:"0.95rem"},children:O.label})]})})};return g("div",{sx:{position:"relative",overflow:"hidden",borderRadius:4,...x},children:[ee(f$1,"left"),ee(u,"right"),f(Ne,{elevation:0,onPointerDown:A,onPointerMove:L,onPointerUp:W,onPointerCancel:T,sx:{position:"relative",zIndex:1,p:2,borderRadius:4,border:"1px solid",borderColor:d?"primary.main":"divider",background:b()==="dark"?"linear-gradient(180deg, color-mix(in oklch, var(--orb-surface-3) 96%, transparent), color-mix(in oklch, var(--orb-canvas) 92%, transparent))":"linear-gradient(180deg, var(--orb-canvas), var(--orb-surface))",color:"text.primary",boxShadow:d?"0 18px 42px color-mix(in oklch, var(--orb-primary) 18%, transparent)":"0 12px 28px rgba(15, 23, 42, 0.08)",transform:`translate3d(${v}px, 0, 0) scale(${m?.985:1})`,transition:k?"none":"transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease",touchAction:"pan-y",cursor:C?"pointer":"default",opacity:m?.9:1},children:g(se,{spacing:1.5,children:[g(se,{direction:"row",spacing:1.5,alignItems:"flex-start",children:[n?f("div",{sx:{mt:.25},children:n}):null,g("div",{sx:{flex:1,minWidth:0},children:[r?f(E,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:"0.08em",color:"text.secondary"},children:r}):null,f(E,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:t}),o?f(E,{sx:{mt:.5,fontSize:"0.9rem",color:"text.secondary",lineHeight:1.45},children:o}):null]}),p?f("div",{"data-no-swipe":"true",...b$1,sx:{alignSelf:"center",display:"inline-flex",touchAction:"none"},children:f(ie,{size:"small",children:f(Yd,{})})}):null]}),a.length>0?f(se,{direction:"row",spacing:1,useFlexGap:true,flexWrap:"wrap",children:a.map((O,_)=>f(Ct,{label:O,size:"small",sx:{borderRadius:999,fontWeight:700,bgcolor:"action.hover",color:"text.primary"}},_))}):null,i.length>0?f("div",{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:1},children:i.map(O=>g(Ne,{elevation:0,sx:{p:1.25,borderRadius:3,bgcolor:"action.hover",border:"1px solid",borderColor:"divider",color:"text.primary"},children:[f(E,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:O.label}),f(E,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.2},children:O.value})]},O.id))}):null,l,s]})})]})};var ma=({label:t,onPress:o,emphasis:r="default"})=>f("div",{component:"button",type:"button",onClick:o,sx:n=>({minHeight:72,borderRadius:3,border:"1px solid",borderColor:r==="primary"?"primary.main":"divider",background:r==="primary"?n.palette.primary.main:r==="danger"?b()==="dark"?"color-mix(in oklch, var(--orb-status-error) 18%, transparent)":"color-mix(in oklch, var(--orb-status-error) 10%, transparent)":b()==="dark"?"rgba(255,255,255,0.04)":"var(--orb-canvas)",color:r==="primary"?"var(--orb-on-primary)":"text.primary",fontSize:"1.25rem",fontWeight:800,transition:"transform 120ms ease, box-shadow 160ms ease, background-color 160ms ease",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent","&:active":{transform:"scale(0.98)"}}),children:t}),VO=({value:t,defaultValue:o="",title:r,subtitle:n,placeholder:a="0",allowDecimal:i=false,allowNegative:s=false,maxLength:l,confirmLabel:d,clearLabel:p,backspaceLabel:m,onChange:h,onSubmit:f$1,onClose:u,sx:b})=>{let{t:C}=ce(),[g$1,x]=useState(o),v=t??g$1,y=T=>{t===void 0&&x(T),h?.(T);},k=T=>{l&&v.length>=l||y(`${v}${T}`);},w=T=>{if(T==="00"){if(!v){y("0");return}k("00");return}k(T);},P=()=>{!i||v.includes(".")||y(v?`${v}.`:"0.");},I=()=>{if(s){if(v.startsWith("-")){y(v.slice(1));return}y(v?`-${v}`:"-");}},S=()=>{y(v.slice(0,-1));},R=()=>{y("");},N=()=>{f$1?.(v);};return f(Ne,{elevation:0,sx:{p:2,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",...b},children:g(se,{spacing:2,children:[g(se,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[g("div",{sx:{minWidth:0},children:[r?f(E,{sx:{fontSize:"1rem",fontWeight:800},children:r}):null,n?f(E,{sx:{mt:.5,fontSize:"0.86rem",color:"text.secondary"},children:n}):null]}),u?f(ie,{onClick:u,size:"small",children:f(Xd,{})}):null]}),f(Ne,{elevation:0,sx:{p:2,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:f(E,{sx:{minHeight:38,fontSize:v?"1.9rem":"1.25rem",fontWeight:900,letterSpacing:"0.06em",color:v?"text.primary":"text.disabled"},children:v||a})}),g("div",{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[["1","2","3","4","5","6","7","8","9"].map(T=>f(ma,{label:T,onPress:()=>w(T)},T)),f(ma,{label:s?"+/-":"00",onPress:s?I:()=>w("00")}),f(ma,{label:"0",onPress:()=>w("0")}),f(ma,{label:i?".":m?String(m):"DEL",onPress:i?P:S})]}),g("div",{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[f("div",{component:"button",type:"button",onClick:S,sx:{minHeight:64,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"},children:g(se,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[f($d,{}),f(E,{sx:{fontWeight:700},children:m||"DEL"})]})}),f(ma,{label:String(p||"CLR"),onPress:R,emphasis:"danger"}),f("div",{component:"button",type:"button",onClick:N,sx:T=>({minHeight:64,borderRadius:3,border:"1px solid",borderColor:"primary.main",background:T.palette.primary.main,color:"var(--orb-on-primary)",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"}),children:g(se,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[f(Ud,{}),f(E,{sx:{fontWeight:800},children:d||C("common.ok")})]})})]})]})})};var nm=({touchMode:t="comfortable",sx:o,...r})=>{let n=t==="expanded";return f("div",{sx:{"& .orb-card":{borderRadius:4},"& .orb-autocomplete":{minWidth:{xs:"100%",md:260}},"& .orb-autocomplete .orb-inp-adornment-wrap, & .orb-inp":{backgroundColor:"transparent !important"},"& .orb-inp-adornment-wrap, & .orb-inp":{minHeight:n?56:50,borderRadius:3,fontSize:n?"0.98rem":"0.92rem"},"& .orb-inp":{py:n?1.6:1.25,fontSize:n?"0.98rem":"0.92rem"},"& label":{fontSize:n?"0.95rem":"0.88rem"},"& .orb-btn":{minHeight:n?48:44,px:n?2.25:1.75,borderRadius:3,fontSize:n?"0.95rem":"0.88rem",fontWeight:700},"& .orb-icon-btn":{width:n?40:36,height:n?40:36},"& .orb-menu-item, & option":{minHeight:n?44:38,fontSize:n?"0.95rem":"0.88rem"},"& .orb-list-subheader":{py:1},"& .orb-chk":{p:n?1:.75},"& .orb-form-control-label > span":{fontSize:n?"0.95rem":"0.88rem"},"& .orb-dialog":{borderRadius:4},"& .orb-dialog-title":{fontSize:n?"1.05rem":"0.98rem",fontWeight:800},"& .orb-dialog-content .orb-inp-adornment-wrap, & .orb-inp":{minHeight:52},"& .orb-grid > *":{minWidth:0},...o},children:f($o,{...r})})};var ay=(t,o,r)=>{if(r?.(o),!!o.href){if(o.href.startsWith("http://")||o.href.startsWith("https://")){window.open(o.href,"_blank");return}t.push(o.href);}},am=({items:t,selectedId:o,orientation:r="auto",onItemSelect:n,sx:a})=>{let i=io(),[s,l]=useState(false);useEffect(()=>{l(true);},[]);let d=yr("(orientation: portrait)"),p=yr(i.breakpoints.down("md")),m=r==="auto"?d||p?"portrait":"landscape":r,h=useRouter();return f("div",{sx:{display:"grid",gridTemplateColumns:!s||m==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(180px, 1fr))",gap:1.5,...a},children:t.map(f$1=>{let u=f$1.id===o,b$1=f$1.color||(u?i.palette.primary.main:i.palette.divider);return f(Ne,{elevation:0,sx:{overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:u?"primary.main":"divider",boxShadow:u?"0 18px 40px color-mix(in oklch, var(--orb-primary) 16%, transparent)":"none",bgcolor:b()==="dark"?"color-mix(in oklch, var(--orb-surface-3) 60%, transparent)":"background.paper"},children:f("div",{component:"button",type:"button",disabled:f$1.disabled,onClick:()=>ay(h,f$1,n),sx:{width:"100%",p:2,minHeight:m==="portrait"?156:148,display:"block",border:0,background:"transparent",textAlign:"left",cursor:f$1.disabled?"not-allowed":"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent",color:"text.primary"},children:g(se,{spacing:1.5,sx:{height:"100%"},children:[g(se,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[f("div",{sx:{width:44,height:44,borderRadius:3,display:"grid",placeItems:"center",color:u?"var(--orb-on-primary)":"text.primary",background:u?b$1:"action.hover"},children:f$1.icon||f(E,{sx:{fontSize:"1rem",fontWeight:900},children:f$1.title.slice(0,1).toUpperCase()})}),f$1.badge!==void 0?f("div",{sx:{minWidth:34,px:1,py:.4,borderRadius:999,bgcolor:u?"primary.main":"action.hover",color:u?"var(--orb-on-primary)":"text.secondary",textAlign:"center",fontWeight:800,fontSize:"0.8rem"},children:f$1.badge}):null]}),g("div",{sx:{flex:1,minWidth:0},children:[f(E,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.25},children:f$1.title}),f$1.caption?f(E,{sx:{mt:.5,fontSize:"0.74rem",fontWeight:700,color:"text.secondary"},children:f$1.caption}):null,f$1.description?f(E,{sx:{mt:.75,fontSize:"0.84rem",lineHeight:1.45,color:"text.secondary"},children:f$1.description}):null]})]})})},f$1.id)})})};var lm=(t,o)=>o.trim()?t.reduce((r,n)=>{let a=n.title?.toLowerCase().includes(o.toLowerCase())||n.label?.toLowerCase().includes(o.toLowerCase())||n.description?.toLowerCase().includes(o.toLowerCase()),i=n.children?lm(n.children,o):[];return (a||i.length>0)&&r.push({...n,children:i.length>0?i:n.children}),r},[]):t,cy=t=>{let o=new Set,r=n=>{n.forEach(a=>{a.children?.length&&(o.add(a.id),r(a.children));});};return r(t),o},cm=({collapsed:t=false,onToggle:o,className:r="",maxHeight:n,menuData:a=[],colorMode:i="light",orientation:s="auto",headerSlot:l,footerSlot:d,activeHref:p,onItemSelect:m})=>{let{t:h}=ce(),f$1=io(),u=Do("(orientation: portrait)"),b=Do(f$1.breakpoints.down("md")),C=s==="auto"?u||b?"portrait":"landscape":s,g$1=i==="dark",x=useRouter(),v=usePathname(),[y,k]=useState(""),[w,P]=useState(new Set),I=useMemo(()=>lm(a,y),[a,y]),S=useMemo(()=>y.trim()?cy(I):w,[w,I,y]);useEffect(()=>{t&&P(new Set);},[t]);let R=L=>L.appurl||L.href||"",N=L=>{m?.(L);let W=R(L);if(W){if(W.startsWith("http://")||W.startsWith("https://")){window.open(W,"_blank");return}x.push(W);}},T=L=>{let W=!!L.children?.length;if(t&&W){o?.();return}if(W){P(ee=>{let O=new Set(ee);return O.has(L.id)?O.delete(L.id):O.add(L.id),O});return}N(L);},M=L=>{let W=p||v,ee=R(L);return !!(ee&&W===ee)},A=(L,W=0)=>{let ee=!!L.children?.length,O=S.has(L.id),_=M(L);return f("div",{sx:{pl:W===0?0:1.5},children:g(Ne,{elevation:0,sx:{mb:1,overflow:"hidden",borderRadius:3,border:"1px solid",borderColor:_?"primary.main":"divider",bgcolor:_?"action.selected":"background.paper"},children:[g("div",{component:"button",type:"button",onClick:()=>T(L),sx:{width:"100%",px:1.5,py:1.4,display:"flex",alignItems:"center",gap:1.25,border:0,background:"transparent",textAlign:"left",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"},children:[f(Ja,{variant:"rounded",sx:{width:40,height:40,bgcolor:_?"primary.main":"action.hover",color:_?"var(--orb-on-primary)":"text.primary"},children:L.icon||(L.title||L.label||"?").slice(0,1).toUpperCase()}),g("div",{sx:{flex:1,minWidth:0},children:[f(E,{sx:{fontSize:"0.95rem",fontWeight:800,lineHeight:1.2},children:L.title||L.label}),L.description?f(E,{sx:{mt:.4,fontSize:"0.78rem",color:"text.secondary",lineHeight:1.35},children:L.description}):null]}),ee?f(rn,{sx:{transform:O?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):f(ri,{color:"action"})]}),ee?f(on,{in:O,children:f("div",{sx:{px:1.25,pb:1.25},children:L.children?.map(V=>A(V,W+1))})}):null]})},L.id)};return t?f(Ne,{elevation:0,className:r,sx:{width:C==="portrait"?"100%":88,p:1,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:g$1?"var(--orb-surface)":"color-mix(in oklch, var(--orb-canvas) 88%, transparent)",maxHeight:n?`${n}px`:void 0,overflowY:"auto"},children:g(se,{spacing:1,children:[f(ie,{onClick:o,sx:{width:48,height:48,alignSelf:"center",bgcolor:"action.hover"},title:h("navigation.expand"),children:f(ci,{})}),a.map(L=>f(ie,{onClick:()=>T(L),sx:{width:56,height:56,alignSelf:"center",borderRadius:3,bgcolor:M(L)?"primary.main":"action.hover",color:M(L)?"var(--orb-on-primary)":"text.primary"},children:L.icon||(L.title||L.label||"?").slice(0,1).toUpperCase()},L.id))]})}):f(Ne,{elevation:0,className:r,sx:{width:C==="portrait"?"100%":320,p:1.25,borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:g$1?"var(--orb-surface)":"color-mix(in oklch, var(--orb-canvas) 88%, transparent)",maxHeight:n?`${n}px`:void 0,overflow:"hidden",display:"flex",flexDirection:"column"},children:g(se,{spacing:1.25,sx:{flex:1,minHeight:0},children:[g(se,{direction:"row",spacing:1,alignItems:"center",children:[f(He,{value:y,onChange:L=>k(L.target.value),placeholder:h("navigation.searchPlaceholder"),size:"small",fullWidth:true,InputProps:{startAdornment:f(lp,{fontSize:"small",color:"action"})}}),C==="landscape"&&!t?f(ie,{onClick:o,sx:{bgcolor:"action.hover"},children:f(rp,{})}):null]}),l,f("div",{sx:{flex:1,minHeight:0,overflowY:"auto",pr:.25},children:I.length>0?I.map(L=>A(L)):f(E,{sx:{p:2,fontSize:"0.88rem",color:"text.secondary",textAlign:"center"},children:h("navigation.noMatch")})}),d]})})};var dm=(t,o)=>{let r=o[t.id];if(t.render)return t.render(r,o);if(r==null||r==="")return "--";if(t.numeric){if(typeof r=="number")return r.toLocaleString();if(typeof r=="string"&&r.trim()!==""&&!Number.isNaN(Number(r)))return Number(r).toLocaleString()}return String(r)},dy=t=>Jt__default.isValidElement(t)?f("div",{sx:{display:"inline-flex",alignItems:"center"},children:t}):f(E,{sx:{mt:.2,fontSize:"0.88rem",fontWeight:800},children:t}),py=(t,o)=>{let r=o[t.id];if(r==null||r==="")return "--";if(t.numeric){if(typeof r=="number")return r.toLocaleString();if(typeof r=="string"&&r.trim()!==""&&!Number.isNaN(Number(r)))return Number(r).toLocaleString()}return String(r)},uy=({summaryRow:t,visibleColumns:o,columns:r})=>{let n=r.filter(a=>o.includes(a.id)&&t[a.id]!=="");return n.length===0?null:f(Ne,{elevation:0,sx:{p:1.5,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:g(se,{spacing:1,children:[f(E,{sx:{fontSize:"0.82rem",fontWeight:800,color:"text.secondary"},children:"Summary"}),f("div",{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(132px, 1fr))",gap:1},children:n.map(a=>g(Ne,{elevation:0,sx:{p:1.1,borderRadius:3,border:"1px solid",borderColor:"divider"},children:[f(E,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:a.label}),f(E,{sx:{mt:.25,fontSize:"0.96rem",fontWeight:800},children:t[a.id]})]},`summary-${a.id}`))})]})})},my=t=>{let{t:o}=ce(),r=io(),{title:n,showToolbar:a=true,selectionMode:i,selected:s=[],onSelectionChange:l,actions:d,extraTools:p,fitContainer:m=false,fullWidth:h=false,maxHeight:f$1,loading:u=false,rowsPerPageOptions:b$1=[20,50,100,-1],onLayoutSave:C,filterConfig:g$1,rowKey:x,tableKey:v="default",graphReport:y,quickCreate:k,quickEdit:w,quickDelete:P,serviceUrl:I,orientation:S="auto",cardTitleField:R,cardSubtitleFields:N,toolbarSlot:T,emptyState:M,rowHeight:A="comfortable",cardActionSlot:L,renderCardFooter:W,onRowClick:ee}=t,O=n||o("table.title.default"),_=Do("(orientation: portrait)"),V=Do(r.breakpoints.down("md")),Q=S==="auto"?_||V?"portrait":"landscape":S,{columns:H,filterText:B,setFilterText:q,visibleColumns:Z,showSummary:Y,setShowSummary:J,summaryColumns:le,grouping:he,setGrouping:ze,expandedGroups:be,groupAnchorEl:Ce,setGroupAnchorEl:Be,summaryAnchorEl:de,setSummaryAnchorEl:ve,anchorEl:We,setAnchorEl:et,contextMenu:nt,sortedAndFilteredRows:it,summaryRow:U,visibleRows:Re,page:we,setPage:Oe,rowsPerPage:at,setRowsPerPage:Ze,totalDisplayCount:xt,setSelected:It,handleClick:Ot,toggleSummaryColumn:At,handleExport:re,handleCloseContextMenu:Ge,toggleColumnVisibility:Le,toggleGroupExpand:pe,handleExpandGroupRecursively:xe,handleCollapseGroupRecursively:oe,handleLayoutLoad:ye,handleVariantLoad:De,handleLayoutSave:je,effectiveAppId:st,currentLayoutData:pt,currentLayoutId:Bt,layoutIdToLoad:Xt,graphReportOpen:Vt,handleOpenGraphReport:wt,handleCloseGraphReport:Wt}=hn(t),ft=y?.enabled??false,Nt=ft&&(y?.interaction?.enabled??true),lt=Mi(),Ft=x||"id",Zt=Jt__default.useMemo(()=>({borderRadius:999,fontWeight:700,borderColor:tt(r.palette.divider,b()==="dark"?.55:.3),bgcolor:b()==="dark"?tt(r.palette.common.white,.06):tt(r.palette.background.paper,.92),color:r.palette.text.primary,"& .orb-chip-label":{px:1.05}}),[r]),K=Jt__default.useMemo(()=>({...Zt,borderColor:tt(r.palette.primary.main,b()==="dark"?.42:.24),bgcolor:b()==="dark"?tt(r.palette.primary.main,.16):tt(r.palette.primary.main,.08)}),[Zt,r]),z=Jt__default.useMemo(()=>{let te=new Set(s);return it.filter(Ee=>te.has(Ee?.[Ft]))},[Ft,s,it]),X=z.length===1?z[0]:null,fe=!!k?.enabled,Se=!!w?.enabled,Ae=!!P?.enabled,$e=k?.fields,Ke=k?.excludeFields||[],Ye=k?.initialValues||{},ut=w?.fields,gt=w?.excludeFields||[],Mt=w?.editableFields||[],bt=w?.nonEditableFields||[],F=w?.primaryKeys?.length?w.primaryKeys:[Ft],[j,ge]=Jt__default.useState(false),[Te,Je]=Jt__default.useState(false),[qe,St]=Jt__default.useState({}),[ht,mt]=Jt__default.useState(false),[yt,ro]=Jt__default.useState(false),[Et,Yt]=Jt__default.useState({}),[Ht,Ut]=Jt__default.useState(false),[$t,to]=Jt__default.useState(false),no=u||Te||yt||$t,fo=Jt__default.useMemo(()=>{let te=[...H];if(Array.isArray($e)&&$e.length>0){let Ee=new Set($e);te=te.filter(Qe=>Ee.has(Qe.id));}if(Ke.length>0){let Ee=new Set(Ke);te=te.filter(Qe=>!Ee.has(Qe.id));}return te.filter(Ee=>!!Ee?.id)},[H,Ke,$e]),Io=Jt__default.useMemo(()=>{let te=[...H];if(Array.isArray(ut)&&ut.length>0){let Ee=new Set(ut);te=te.filter(Qe=>Ee.has(Qe.id));}if(gt.length>0){let Ee=new Set(gt);te=te.filter(Qe=>!Ee.has(Qe.id));}return te.filter(Ee=>!!Ee?.id)},[H,gt,ut]),Mo=Jt__default.useMemo(()=>new Set(F),[F]),nr=Jt__default.useMemo(()=>new Set(Mt),[Mt]),Co=Jt__default.useMemo(()=>new Set(bt),[bt]),Fo=Jt__default.useCallback(te=>nr.size>0?nr.has(te):!(Co.has(te)||Mo.has(te)),[nr,Co,Mo]);Jt__default.useEffect(()=>{!Vt&&lt.hasActiveFilters&&lt.clearAll();},[lt,Vt]);let Ur=()=>{let te={};fo.forEach(Ee=>{te[Ee.id]=Ye[Ee.id]??"";}),St(te),ge(true);},Kr=(te,Ee)=>{St(Qe=>({...Qe,[te]:Ee}));},Ar=async()=>{if(!k?.onSubmit){ge(false);return}try{Je(!0),await k.onSubmit(qe),ge(!1);}finally{Je(false);}},qr=()=>{if(!X)return;let te={};Io.forEach(Qe=>{te[Qe.id]=X[Qe.id]??"";});let Ee=w?.getInitialValues?{...te,...w.getInitialValues(X)}:te;Yt(Ee),mt(true);},Xr=(te,Ee)=>{Yt(Qe=>({...Qe,[te]:Ee}));},Ro=async()=>{if(X){if(!w?.onSubmit){mt(false);return}try{ro(!0),await w.onSubmit(Et,X),mt(!1);}finally{ro(false);}}},Er=()=>{z.length!==0&&Ut(true);},Zr=async()=>{if(z.length===0){Ut(false);return}if(!P?.onConfirm){Ut(false),It([]),l?.([]);return}try{to(!0),await P.onConfirm(z),Ut(!1),It([]),l?.([]);}finally{to(false);}},Xo=it,{fieldMapping:ar}=pn({rows:Xo,config:{...y,title:y?.title||`${O} ${o("graph.reportTitle")}`}}),En=Jt__default.useMemo(()=>Nt?lt.applyRows(Xo,ar):Xo,[ar,lt,Nt,Xo]),{model:Lr}=pn({rows:En,config:{...y,title:y?.title||`${O} ${o("graph.reportTitle")}`,fieldMapping:ar}}),D=Lr.table.columns.map(te=>({id:te.id,label:te.label,align:te.align||"left",minWidth:120,numeric:te.align==="right"})),$=st?f(gn,{appId:st,tableKey:v,currentLayoutData:pt,onLayoutLoad:ye,targetLayoutId:Xt,activeLayoutId:Bt,serviceUrl:I??g$1?.serviceUrl}):null,G=H.filter(te=>Z.includes(te.id)),ue=G.find(te=>te.id===R)||G[0],Fe=N?.map(te=>G.find(Ee=>Ee.id===te)).filter(Boolean)||G.filter(te=>te.id!==ue?.id).slice(0,Q==="portrait"?2:3),rt=G.filter(te=>te.id!==ue?.id&&!Fe.some(Ee=>Ee.id===te.id)),_e=[T,p].filter(Boolean),ne=g(e,{children:[f(cn,{groupAnchorEl:Ce,setGroupAnchorEl:Be,grouping:he,setGrouping:ze,columns:H}),f(dn,{anchorEl:We,setAnchorEl:et,columns:H,visibleColumns:Z,toggleColumnVisibility:Le}),f(Ci,{anchorEl:de,setAnchorEl:ve,showSummary:Y,setShowSummary:J,columns:H,summaryColumns:le,toggleSummaryColumn:At}),f(xi,{contextMenu:nt,handleCloseContextMenu:Ge,columns:H,visibleColumns:Z,toggleColumnVisibility:Le})]}),me=(te,Ee,Qe)=>{let Me=s.includes(Ee),Xe=Q==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(140px, 1fr))",kt=Qe%2===0?tt(r.palette.primary.main,b()==="dark"?.09:.04):tt(r.palette.primary.main,b()==="dark"?.05:.022),Yr=tt(r.palette.divider,.22);return f(Ne,{elevation:0,onClick:()=>{Ot({},te),ee?.(te);},sx:{p:A==="compact"?1.25:1.5,borderRadius:4,border:"0.5px solid",borderColor:Me?tt(r.palette.primary.main,.38):Yr,background:Me?`linear-gradient(135deg, ${tt(r.palette.primary.main,.13)}, ${tt(r.palette.primary.main,.06)})`:`linear-gradient(135deg, ${kt}, ${tt(r.palette.primary.main,.015)})`,boxShadow:Me?`0 12px 30px ${tt(r.palette.primary.main,.2)}`:`0 3px 10px ${tt(r.palette.common.black,.045)}`,cursor:"pointer",position:"relative",overflow:"hidden",transition:"border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease, background 160ms ease","&::before":{content:'""',position:"absolute",left:0,top:0,bottom:0,width:4,background:Me?r.palette.primary.main:Qe%2===0?tt(r.palette.primary.main,.26):tt(r.palette.text.primary,.16)},"&:hover":{boxShadow:`0 10px 20px ${tt(r.palette.primary.main,.12)}`,transform:"translateY(-1px)"},"&:active":{transform:"scale(0.995)"}},children:g(se,{spacing:1.25,children:[g(se,{direction:"row",spacing:1.25,alignItems:"flex-start",children:[i?f(Tt,{checked:Me,onClick:wo=>wo.stopPropagation(),onChange:()=>Ot({},te),sx:{mt:-0.6,ml:-0.6}}):null,g("div",{sx:{flex:1,minWidth:0},children:[ue?f(E,{sx:{fontSize:"1rem",fontWeight:900,lineHeight:1.25},children:dm(ue,te)}):null,Fe.length>0?f(se,{direction:"row",spacing:.75,useFlexGap:true,flexWrap:"wrap",sx:{mt:.75},children:Fe.map(wo=>f(Ct,{label:`${wo.label}: ${py(wo,te)}`,size:"small",variant:"outlined",sx:Zt},`${Ee}-${wo.id}`))}):null]}),L?f("div",{onClick:wo=>wo.stopPropagation(),children:L(te)}):null]}),rt.length>0?f("div",{sx:{display:"grid",gridTemplateColumns:Xe,gap:1},children:rt.map(wo=>g(Ne,{elevation:0,sx:{p:1,borderRadius:3,bgcolor:b()==="dark"?tt(r.palette.background.default,.7):tt(r.palette.background.paper,.92),border:"0.1px solid",borderColor:tt(r.palette.divider,.24)},children:[f(E,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:wo.label}),dy(dm(wo,te))]},`${Ee}-${wo.id}-detail`))}):null,W?g(e,{children:[f(Rt,{}),f("div",{onClick:wo=>wo.stopPropagation(),children:W(te)})]}):null]})},Ee)};return g("div",{sx:{width:h?"100%":"auto",mb:m?0:2,...m?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[g$1?f("div",{sx:{mb:2},children:f(nm,{...g$1,onVariantLoad:te=>{De(te),g$1.onVariantLoad?.(te);},appId:g$1.appId,tableKey:v,currentLayout:[{tableKey:v,layoutData:pt}],currentLayoutId:Bt,layoutRefs:[{tableKey:v,layoutId:Bt}],variantService:g$1.variantService,serviceUrl:I??g$1.serviceUrl,touchMode:Q==="portrait"?"expanded":"comfortable"})}):null,g(Ne,{sx:{width:h?"100%":"auto",mb:m?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",bgcolor:"transparent",backgroundImage:"none",boxShadow:"none","&::before":no?{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"3px",background:"linear-gradient(90deg, color-mix(in oklch, var(--orb-primary) 0%, transparent) 0%, color-mix(in oklch, var(--orb-primary) 25%, transparent) 25%, var(--orb-primary) 50%, color-mix(in oklch, var(--orb-primary) 25%, transparent) 75%, color-mix(in oklch, var(--orb-primary) 0%, transparent) 100%)",backgroundSize:"220% 100%",animation:"cTableTopMarquee 1.2s linear infinite",zIndex:6,pointerEvents:"none"}:{},"@keyframes cTableTopMarquee":{"0%":{backgroundPosition:"220% 0"},"100%":{backgroundPosition:"-120% 0"}},...f$1?{height:f$1}:m?{flex:1,minHeight:0,height:"100%"}:{}},children:[a?f("div",{sx:{"& .orb-toolbar":{minHeight:60,alignItems:{xs:"flex-start",md:"center"},flexWrap:"wrap",rowGap:1,columnGap:1},"& .orb-toolbar > :nth-of-type(1)":{width:{xs:"100%",md:"auto"},"& .orb-fld":{width:{xs:"100%",md:300}}},"& .orb-toolbar > :nth-of-type(2)":{flexShrink:0},"& .orb-toolbar > :nth-of-type(3)":{display:{xs:"none",md:"block"}},"& .orb-toolbar > :nth-of-type(4)":{ml:"auto",justifyContent:"flex-end",flexWrap:"wrap"},"& .orb-inp-adornment-wrap, & .orb-inp":{minHeight:46},"& .orb-icon-btn":{width:40,height:40},"& .orb-body, & .orb-body-dense, & .orb-label, & .orb-meta":{fontSize:"0.9rem"},"& button":{borderRadius:2.5}},children:f(fi,{filterText:B,setFilterText:q,onRowsPerPageChange:Ze,rowsPerPage:at,rowsPerPageOptions:b$1,page:we,count:xt,onPageChange:Oe,actions:d,extraTools:_e,grouping:he,setGroupAnchorEl:Be,showSummary:Y,setShowSummary:J,setAnchorEl:et,setSummaryAnchorEl:ve,handleExport:re,showCreateButton:fe,onOpenCreateDialog:Ur,showEditButton:Se,onOpenEditDialog:qr,editDisabled:z.length!==1,showDeleteButton:Ae,onOpenDeleteConfirm:Er,deleteDisabled:z.length===0,onLayoutSave:C||g$1?.variantService&&g$1?.appId?je:void 0,loading:u,layoutManager:$,onOpenGraphReport:ft?wt:void 0})}):null,f("div",{sx:{flex:1,minHeight:0,overflow:"auto",p:1.5},children:g(se,{spacing:1.25,children:[Re.length===0&&!u?M||f(Ne,{elevation:0,sx:{p:4,borderRadius:4,border:"1px dashed",borderColor:"divider",textAlign:"center"},children:f(E,{sx:{fontSize:"0.92rem",color:"text.secondary"},children:o("common.noData")})}):null,Re.map((te,Ee)=>{if(te.type==="group"){let Xe=be.has(te.id);return f(Ne,{elevation:0,sx:{borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:g("div",{component:"button",type:"button",onClick:()=>pe(te.id),sx:{width:"100%",px:1.5,py:1.3,border:0,background:"transparent",display:"flex",alignItems:"center",gap:1,textAlign:"left",cursor:"pointer",appearance:"none",WebkitAppearance:"none",color:"text.primary"},children:[Xe?f(rn,{}):f(ri,{}),g("div",{sx:{flex:1,minWidth:0},children:[g(E,{sx:{fontSize:"0.94rem",fontWeight:800},children:[te.field,": ",te.value]}),g(E,{sx:{mt:.2,fontSize:"0.76rem",color:"text.secondary"},children:[te.count," records"]})]}),he.length>1&&te.level<he.length-1?g(se,{direction:"row",spacing:.5,children:[f(Ct,{size:"small",label:o("table.group.expandAll"),onClick:kt=>{kt.stopPropagation(),xe(te.id);},sx:K}),f(Ct,{size:"small",label:o("table.group.collapseAll"),onClick:kt=>{kt.stopPropagation(),oe(te.id);},sx:K})]}):null]})},te.id)}let Qe=te.data||te,Me=te.id||Qe[Ft]||Ee;return me(Qe,Me,Ee)}),Y?f(uy,{summaryRow:U,visibleColumns:Z,columns:H}):null,u?f(E,{sx:{py:1,fontSize:"0.84rem",color:"text.secondary",textAlign:"center"},children:o("common.loading")}):null]})})]}),fe?g(Lt,{open:j,onClose:()=>!Te&&ge(false),fullWidth:true,maxWidth:"sm",children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:800},children:k?.title||o("quickCreate.createWithTitle",{title:O})}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[fo.map(te=>{let Ee=te.type==="number"||te.numeric?"number":te.type==="date"?"date":"text";return f(He,{label:te.label||te.id,value:qe[te.id]??"",onChange:Qe=>Kr(te.id,Qe.target.value),type:Ee,fullWidth:true,InputLabelProps:{shrink:Ee==="date"?true:void 0}},`quick-create-${te.id}`)}),k?.description?f(jo,{severity:"info",children:k.description}):null]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[f(Pe,{onClick:()=>ge(false),disabled:Te,children:k?.cancelLabel||o("common.cancel")}),f(Pe,{onClick:Ar,variant:"contained",disabled:Te,children:k?.submitLabel||o("common.save")})]})]}):null,Se?g(Lt,{open:ht,onClose:()=>!yt&&mt(false),fullWidth:true,maxWidth:"sm",children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:800},children:w?.title||o("quickEdit.editWithTitle",{title:O})}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Io.map(te=>{let Ee=te.type==="number"||te.numeric?"number":te.type==="date"?"date":"text";return f(He,{label:te.label||te.id,value:Et[te.id]??"",onChange:Qe=>Xr(te.id,Qe.target.value),type:Ee,disabled:!Fo(te.id),fullWidth:true,InputLabelProps:{shrink:Ee==="date"?true:void 0}},`quick-edit-${te.id}`)}),w?.description?f(jo,{severity:"info",children:w.description}):null]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[f(Pe,{onClick:()=>mt(false),disabled:yt,children:w?.cancelLabel||o("common.cancel")}),f(Pe,{onClick:Ro,variant:"contained",disabled:yt||!X,children:w?.submitLabel||o("common.save")})]})]}):null,Ae?f(Yn,{open:Ht,type:"warning",title:P?.title||o("quickDelete.confirmTitle"),message:P?.message||(z.length>1?o("quickDelete.confirmMessageMultiple",{count:z.length}):o("quickDelete.confirmMessageSingle")),confirmText:P?.confirmText||o("common.delete"),cancelText:P?.cancelText||o("common.cancel"),onClose:()=>!$t&&Ut(false),onConfirm:Zr}):null,ne,ft?f(Ti,{open:Vt,onClose:Wt,model:Lr,aiAssistant:y?.aiAssistant,interaction:Nt?{enabled:true,filters:lt.filters,fieldMapping:ar,onPrimaryDimensionClick:te=>lt.setFilter("primaryDimension",te),onSecondaryDimensionClick:te=>lt.setFilter("secondaryDimension",te),onStatusClick:te=>lt.setFilter("status",te),onClearFilter:lt.clearFilter,onClearAll:lt.clearAll}:void 0,tableContent:f(my,{appId:st||"graph-report-internal",title:o("graph.dataBody"),columns:D,rows:Lr.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false},showSummary:false})}):null]})};var LF=({appTitle:t,children:o,menuData:r=[],workloadItems:n=[],workloadSelectedId:a,showNavigation:i=true,showWorkloadNav:s=true,orientation:l="auto",logo:d,headerSlot:p,actionSlot:m,portraitBottomSlot:h,contentSx:f$1,containerSx:u,user:b,onSearch:C,onSearchAdd:g$1,defaultNavigationOpen:x,navOpen:v,onNavOpenChange:y,onWorkloadSelect:k,locale:w="en",localeLabel:P,localeOptions:I,onLocaleChange:S,onUserSetting:R,onUserLogout:N,userMenuItems:T,leftHeaderSlot:M,rightHeaderSlot:A})=>{let L="orbcafe:page-layout-mode",[W,ee]=useState("system"),[O,_]=useState("light"),[V,Q]=useState(false),[H,B]=useState(false),q=W==="system"?H?O:"light":W;useEffect(()=>{Q(true);},[]),useEffect(()=>{try{let nt=window.localStorage.getItem(L);(nt==="light"||nt==="dark"||nt==="system")&&ee(nt);}catch{}B(true);let We=window.matchMedia("(prefers-color-scheme: dark)"),et=()=>{_(We.matches?"dark":"light");};return et(),We.addEventListener("change",et),()=>We.removeEventListener("change",et)},[]),useEffect(()=>{if(H)try{window.localStorage.setItem(L,W);}catch{}},[H,W]),useEffect(()=>{q==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.classList.add("orb-dark"),document.documentElement.dataset.orbMode="dark",document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.classList.remove("orb-dark"),document.documentElement.dataset.orbMode="light",document.documentElement.style.colorScheme="light");},[q]);let Z=Do("(orientation: portrait)"),Y=Do("(max-width: 899.95px)"),J=l==="auto"?!V||Z||Y?"portrait":"landscape":l,[le,he]=useState({landscape:x??true,portrait:false}),ze=le[J],be=v??ze,Ce=We=>{v===void 0&&he(et=>({...et,[J]:We})),y?.(We);},Be=g(se,{direction:"row",spacing:1,alignItems:"center",children:[!V||i&&J==="portrait"?f(ie,{onClick:()=>Ce(!be),sx:{bgcolor:"action.hover"},children:f(ci,{})}):null,M]}),de=g(se,{direction:"row",spacing:1,alignItems:"center",children:[m,A]}),ve=f(cm,{collapsed:J==="landscape"?!be:false,onToggle:()=>Ce(!be),menuData:r,orientation:J,colorMode:q,maxHeight:J==="landscape"?900:void 0});return f(Ln,{mode:W,children:f(Ua,{locale:w,children:g("div",{sx:[We=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:We.palette.mode==="dark"?"linear-gradient(180deg, var(--orb-canvas) 0%, var(--orb-surface) 55%, var(--orb-surface-2) 100%)":We.palette.background.default}),...Array.isArray(u)?u:[u]],children:[f(_i,{appTitle:t,logo:d===void 0?null:d,mode:W,onToggleMode:()=>ee(We=>We==="system"?"dark":We==="dark"?"light":"system"),locale:w,localeLabel:P,localeOptions:I,onLocaleChange:S,user:b,onUserSetting:R,onUserLogout:N,userMenuItems:T,onSearch:C,onSearchAdd:g$1,leftSlot:Be,rightSlot:de}),p?f("div",{sx:{px:{xs:2,md:3},py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:p}):null,g("div",{sx:{flex:1,minHeight:0,display:"flex",position:"relative"},children:[V&&i&&J==="landscape"?f("div",{sx:{p:1.5,pr:0,flexShrink:0},children:ve}):null,!V||i&&J==="portrait"?f(Ed,{open:be,onClose:()=>Ce(false),PaperProps:{sx:{width:"min(88vw, 360px)",p:1.25,bgcolor:"transparent",boxShadow:"none"}},children:ve}):null,f("div",{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...f$1},children:g(se,{spacing:1.5,children:[s&&n.length>0?f(am,{items:n,selectedId:a,orientation:J,onItemSelect:k}):null,f(Ne,{elevation:0,sx:{flex:1,minHeight:J==="portrait"?420:560,p:{xs:1.25,md:1.5},borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:"color-mix(in oklch, var(--orb-canvas) 72%, transparent)",backdropFilter:"blur(12px)",color:"text.primary"},children:o})]})})]}),J==="portrait"&&h?g(e,{children:[f(Rt,{}),f("div",{sx:{p:1.5},children:h})]}):null]})})})};var pm=gy(()=>import('./COrbCanvas-4PZFJUYO.mjs').then(t=>t.COrbCanvas),{ssr:false,loading:()=>f("div",{className:"h-full w-full bg-transparent"})});function zl({isRecording:t}){return f(AnimatePresence,{children:t&&f(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.5},className:"pointer-events-none absolute inset-0 z-0 overflow-hidden",children:g("div",{className:"relative flex h-full w-full items-center justify-center",children:[f("div",{className:"absolute inset-0",children:f(pm,{hue:0,hoverIntensity:.5,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})}),f("div",{className:"relative z-10 h-full w-1/3 mix-blend-overlay opacity-80",children:f(pm,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var zF=zl;var mm=createContext(null);function xy(t){if(!t||!(t instanceof HTMLElement))return false;let o=t.tagName;return !!(o==="INPUT"||o==="TEXTAREA"||o==="SELECT"||t.isContentEditable||t.closest('[data-voice-hotkey-ignore="true"]'))}function wy({children:t,onVoiceSubmit:o,onVoicePartial:r,onVoiceError:n,longPressMs:a=200,disableSpaceTrigger:i=false,ignoreWhenFocusedInput:s=true,renderOverlay:l=true,wsUrl:d,silenceThresholdMs:p,minVolumeRms:m}){let[h,f$1]=useState(false),[u,b]=useState(false),C=useRef(null),g$1=useRef(false),x=useRef(false),v=useCallback(()=>{x.current=false,f$1(false);},[]),{isRecording:y,startRecording:k,stopRecording:w}=Cn({wsUrl:d,silenceThresholdMs:p,minVolumeRms:m,onTextUpdate:R=>{r?.(R);},onComplete:async R=>{try{R.trim()&&(b(!0),await o(R.trim()));}catch(N){let T=N instanceof Error?N.message:"Failed to process voice command";n?.(T);}finally{b(!1),v();}},onError:R=>{n?.(R),b(!1),g$1.current||v();}}),P=useCallback(async()=>{x.current=false,await k();},[k]),I=useCallback(()=>{w();},[w]);useEffect(()=>{if(i)return;let R=T=>{T.isComposing||(T.code==="Space"||T.key===" ")&&(g$1.current||T.repeat||s&&xy(document.activeElement)||(g$1.current=true,T.preventDefault(),C.current=setTimeout(()=>{x.current=true,f$1(true),k();},a)));},N=T=>{(T.code==="Space"||T.key===" ")&&(C.current&&(clearTimeout(C.current),C.current=null),g$1.current=false,x.current&&(T.preventDefault(),f$1(false),w()));};return window.addEventListener("keydown",R),window.addEventListener("keyup",N),()=>{window.removeEventListener("keydown",R),window.removeEventListener("keyup",N),C.current&&(clearTimeout(C.current),C.current=null);}},[i,s,a,k,w]);let S=useMemo(()=>({isRecording:y,isHotkeyRecording:h,isSubmitting:u,startRecording:P,stopRecording:I}),[h,y,u,P,I]);return g(mm.Provider,{value:S,children:[l?f(zl,{isRecording:h}):null,t]})}function Sy(){let t=useContext(mm);if(!t)throw new Error("useAINav must be used within CAINavProvider");return t}var UF=wy,KF=Sy;function ot(...t){return twMerge(clsx(t))}var My=({content:t,theme:o="light",size:r="base",defaultExpanded:n=false})=>{let[a,i]=useState(n),s=useMemo(()=>`${(r==="sm"?14:r==="lg"?18:16)-2}px`,[r]);return g("div",{className:`my-6 rounded-lg overflow-hidden transition-all duration-200 ${o==="dark"?"bg-[var(--orb-surface-2)]":"bg-[var(--orb-canvas)]"}`,style:{border:"0.5px solid var(--orb-border)"},children:[g("div",{className:"px-4 py-3 cursor-pointer flex items-center justify-between transition-colors duration-200 bg-[var(--orb-surface)] hover:bg-[var(--orb-hover)]",style:{borderBottom:"0.5px solid var(--orb-border)"},onClick:()=>i(!a),children:[g("span",{className:"flex items-center",children:[f(Ea,{className:"mr-2 h-4 w-4"}),f("span",{className:"font-medium text-[var(--orb-fg)]",style:{fontSize:r==="sm"?"14px":r==="lg"?"18px":"16px"},children:"\u601D\u8003\u8FC7\u7A0B"})]}),f(Bo,{className:`w-4 h-4 transition-transform duration-200 ${a?"rotate-180":""} text-[var(--orb-muted)]`})]}),a&&f("div",{className:"p-4 whitespace-pre-wrap italic font-light text-[var(--orb-muted)]",style:{fontSize:s,lineHeight:"1.3 !important"},children:t})]})},gm=My;var Ey=({content:t,language:o="text",isStreaming:r=false,className:n=""})=>{let a=go(),[i,s]=useState(false),l=async()=>{try{await navigator.clipboard.writeText(t),s(!0),setTimeout(()=>s(!1),2e3);}catch(p){console.error("\u590D\u5236\u5931\u8D25:",p);}},d=a==="dark"?oneDark:oneLight;return g("div",{className:ot("rounded-lg overflow-hidden border border-[var(--orb-border)] my-4",n),children:[g("div",{className:"flex items-center justify-between px-4 py-2 bg-[var(--orb-surface)] border-b border-[var(--orb-border)]",children:[f("span",{className:"text-xs font-medium text-[var(--orb-muted)] uppercase",children:o}),f("button",{onClick:l,className:"p-1 hover:bg-[var(--orb-hover)] rounded transition-colors",disabled:r,title:i?"Copied":"Copy code",children:i?f(xo,{size:14,className:"text-[var(--orb-status-success)]"}):f(Nc,{size:14,className:"text-[var(--orb-muted)]"})})]}),f("div",{className:"text-sm",children:f(Prism,{language:o,style:d,customStyle:{margin:0,padding:"16px",fontSize:"14px",lineHeight:"1.5",backgroundColor:a==="dark"?"var(--orb-surface-2)":"var(--orb-canvas)"},wrapLongLines:true,children:t})})]})},hm=Ey;var bm="orb-html-demo",vm="orb-html-demo-ping",ns=16,By=2,Hy=2e3,zy=300,Vy=96,Wy=200,$y=560,_y=320,$l=`<script>(function(){var post=function(){var body=document.body;var height=Math.ceil(document.documentElement.scrollHeight);if(body){var style=getComputedStyle(body);height=Math.ceil(Math.max(body.offsetHeight,body.scrollHeight)+parseFloat(style.marginTop||'0')+parseFloat(style.marginBottom||'0'))}parent.postMessage({source:${JSON.stringify(bm)},height:height},'*')};addEventListener('load',post);addEventListener('resize',post);addEventListener('message',function(event){if(event.data&&event.data.source===${JSON.stringify(vm)})post()});new MutationObserver(post).observe(document.documentElement,{subtree:true,childList:true,attributes:true,characterData:true});var retries=0;var timer=setInterval(function(){post();retries+=1;if(retries>5)clearInterval(timer)},250);post()})()</script>`,Gy="html,body{margin:0;padding:12px;font:14px/1.5 system-ui,sans-serif;}",Uy=t=>/<html[\s>]/i.test(t),Ky=t=>{let o=t.trim();return Uy(o)?/<\/body>/i.test(o)?o.replace(/<\/body>/i,`${$l}</body>`):`${o}${$l}`:`<!DOCTYPE html><html><head><meta charset="utf-8"><style>${Gy}</style></head><body>${o}${$l}</body></html>`},qy=t=>{let o=/<title[^>]*>([^<]+)<\/title>/i.exec(t)?.[1]?.trim();return o||(/<h1[^>]*>([^<]+)<\/h1>/i.exec(t)?.[1]?.trim()??null)},Xy=t=>{if(t<1024)return `${t} B`;let o=t/1024;if(o<1024)return `${o<10?o.toFixed(1):Math.round(o)} KB`;let r=o/1024;return `${r<10?r.toFixed(1):Math.round(r)} MB`},Zy=t=>`${t.toLowerCase().replace(/[^\p{Letter}\p{Number}]+/gu,"-").replace(/^-+|-+$/g,"").slice(0,60)||"interactive-demo"}.html`,Yy=(t,o)=>{let r=URL.createObjectURL(t),n=document.createElement("a");n.href=r,n.download=o,n.click(),window.setTimeout(()=>URL.revokeObjectURL(r),1e3);},ba=new Map,Gl="orb-html-demo-store",Qy=t=>t.replace(/^\s+/,"").slice(0,Vy),_l=(t,o)=>{ba.set(t,o),window.dispatchEvent(new CustomEvent(Gl));},jy=({content:t,title:o})=>{let{t:r}=ce(),n=go(),a=Qy(t),[i,s]=useState(()=>ba.get(a)?.open??false),[l,d]=useState(()=>ba.get(a)?.view??"preview"),[p,m]=useState(false),[h,f$1]=useState(_y),u=useRef(null),b=useRef(null),C=useRef(false),g$1=useRef(false),x=useRef(t),v=M=>_l(a,{open:M,view:l}),y=M=>_l(a,{open:i,view:M}),k=()=>{g$1.current=true,v(false);};useEffect(()=>{let M=()=>{let A=ba.get(a);s(A?.open??false),d(A?.view??"preview");};return window.addEventListener(Gl,M),()=>window.removeEventListener(Gl,M)},[a]),useEffect(()=>{x.current!==t&&(x.current=t,ba.has(a)||_l(a,{open:true,view:"preview"}));},[t,a]);let[w,P]=useState(t);useEffect(()=>{if(t===w)return;let M=window.setTimeout(()=>P(t),zy);return ()=>window.clearTimeout(M)},[t,w]);let I=useMemo(()=>Ky(w),[w]);useEffect(()=>{if(!i)return;let M=A=>{let L=A.data;!L||L.source!==bm||typeof L.height!="number"||b.current&&A.source!==b.current.contentWindow||f$1(Math.max(Wy,Math.min($y,Math.ceil(L.height))));};return window.addEventListener("message",M),b.current?.contentWindow?.postMessage({source:vm},"*"),()=>window.removeEventListener("message",M)},[i]);let S=o??qy(t)??r("agentui.html.defaultTitle"),R=useMemo(()=>new TextEncoder().encode(t).length,[t]);useEffect(()=>{if(!p)return;let M=window.setTimeout(()=>m(false),Hy);return ()=>window.clearTimeout(M)},[p]),useEffect(()=>{if(i){C.current=true;return}C.current&&(C.current=false,g$1.current&&(g$1.current=false,u.current?.focus()));},[i]);let N=()=>{navigator.clipboard.writeText(t).then(()=>m(true));},T=()=>Yy(new Blob([t],{type:"text/html;charset=utf-8"}),Zy(S));return i?g("section",{className:"orb-html-demo","aria-label":S,"data-view":l,children:[g("header",{className:"orb-html-demo-head",children:[f("span",{className:"orb-html-demo-glyph","aria-hidden":"true",children:"</>"}),f("span",{className:"orb-html-demo-head-title",title:S,children:S}),g("div",{className:"orb-segmented-control orb-html-demo-segment",role:"group","aria-label":r("agentui.html.toggle"),"data-has-selection":"true",style:{"--orb-segmented-count":By,"--orb-segmented-index":l==="code"?0:1},children:[f("span",{className:"orb-segmented-control-thumb","aria-hidden":"true"}),f("button",{type:"button",className:"orb-segmented-control-item orb-segmented-control-item-label","data-selected":l==="code","aria-pressed":l==="code",onClick:()=>y("code"),children:r("agentui.html.code")}),f("button",{type:"button",className:"orb-segmented-control-item orb-segmented-control-item-label","data-selected":l==="preview","aria-pressed":l==="preview",onClick:()=>y("preview"),children:r("agentui.html.preview")})]}),g("div",{className:"orb-html-demo-actions",children:[f("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":r(p?"agentui.html.copied":"agentui.html.copy"),title:r(p?"agentui.html.copied":"agentui.html.copy"),onClick:N,children:p?f(xo,{size:ns}):f(No,{size:ns})}),f("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":r("agentui.html.download"),title:r("agentui.html.download"),onClick:T,children:f(Fn,{size:ns})}),f("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":r("agentui.html.close"),title:r("agentui.html.close"),onClick:k,children:f(Kt,{size:ns})})]})]}),g("div",{className:"orb-html-demo-body",children:[f("iframe",{ref:b,className:"orb-html-demo-frame",title:S,sandbox:"allow-scripts",srcDoc:I,style:{height:h},hidden:l!=="preview"}),f("div",{className:"orb-html-demo-code",hidden:l!=="code",children:f(Prism,{language:"html",style:n==="dark"?oneDark:oneLight,customStyle:{margin:0,padding:"16px 20px",background:"transparent",fontSize:"13px",lineHeight:"1.6"},wrapLongLines:true,children:t})})]})]}):g("button",{ref:u,type:"button",className:"orb-html-demo-card","aria-expanded":false,onClick:()=>v(true),children:[f("span",{className:"orb-html-demo-glyph","aria-hidden":"true",children:"</>"}),g("span",{className:"orb-html-demo-info",children:[f("span",{className:"orb-html-demo-title",children:S}),g("span",{className:"orb-html-demo-meta",children:["HTML \xB7 ",Xy(R)]})]}),f("span",{className:"orb-html-demo-openpill",children:r("agentui.html.open")})]})},ym=jy;var tC=t=>{let o=/line (\d+)/i.exec(t)?.[1];return o?`Mermaid syntax error around line ${o} \u2014 expand for details`:"Mermaid syntax error \u2014 expand for details"},oC=({content:t,isLoading:o,className:r="",style:n})=>{let a=useRef(null),[i,s]=useState(false),[l,d]=useState(null),p=go();return useEffect(()=>{let m=false,h=async()=>{if(!(!t.trim()||!a.current)){s(true),d(null);try{xm.initialize({startOnLoad:!1,theme:p==="dark"?"dark":"default",securityLevel:"loose",fontFamily:"inherit",flowchart:{htmlLabels:!1}});let u=`mermaid-${Math.random().toString(36).substr(2,9)}`,b=t.replace(/```mermaid\n?|\n?```/g,"").trim(),{svg:C,bindFunctions:g}=await xm.render(u,b);!m&&a.current&&(a.current.innerHTML=C,g?.(a.current));}catch(u){if(m)return;console.error("Mermaid render failed:",u),d(u instanceof Error?u.message:"Render failed");}finally{m||s(false);}}},f=setTimeout(()=>{h();},100);return ()=>{m=true,clearTimeout(f);}},[t,p]),g("div",{className:`mermaid-block ${r}`,style:n,children:[(o||i)&&g("div",{className:"flex items-center justify-center rounded border border-[var(--orb-border)] bg-[var(--orb-surface)] p-4 dark:bg-[var(--orb-surface-2)]",children:[f("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-b-2 border-[var(--orb-primary)]"}),f("span",{className:"text-sm text-[var(--orb-muted)]",children:"Generating Diagram..."})]}),l&&g("div",{className:"rounded border border-[color-mix(in_oklch,var(--orb-status-error)_30%,transparent)] bg-[color-mix(in_oklch,var(--orb-status-error)_8%,transparent)] p-3 text-sm text-[var(--orb-status-error)]",children:[f("p",{className:"font-medium",children:tC(l)}),g("details",{className:"mt-1",children:[f("summary",{className:"cursor-pointer text-xs text-[var(--orb-muted)]",children:"Details & source"}),f("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap break-words",children:l}),f("pre",{className:"mt-2 max-h-40 overflow-auto text-xs text-[var(--orb-muted)]",children:t})]})]}),f("div",{ref:a,className:`overflow-x-auto ${o||i||l?"hidden":""}`})]})},wm=oC;var rC=({title:t="\u53D1\u751F\u9519\u8BEF",content:o,errorCode:r,stack:n,icon:a,closable:i=true,onClose:s,onRetry:l,className:d="",...p})=>{let[m,h]=useState(false),[f$1,u]=useState(false),b=async()=>{if(l){u(true);try{await l();}catch(C){console.error("\u91CD\u8BD5\u5931\u8D25:",C);}finally{u(false);}}};return g("div",{className:`relative w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${d}`,...p,children:[g("div",{className:"flex p-4 border-l-4 border-l-[var(--orb-status-error)] bg-[color-mix(in_oklch,var(--orb-status-error)_8%,transparent)]",children:[f("div",{className:"flex-shrink-0 mr-3 text-[var(--orb-status-error)] mt-0.5",children:a||f(Ia,{className:"w-5 h-5"})}),g("div",{className:"flex-1 min-w-0",children:[g("div",{className:"flex items-center space-x-2 mb-1",children:[f("h4",{className:"text-base font-semibold text-[var(--orb-fg)]",children:t}),r&&f("span",{className:"text-xs font-mono px-1.5 py-0.5 rounded bg-[color-mix(in_oklch,var(--orb-status-error)_14%,transparent)] text-[var(--orb-status-error)]",children:r})]}),o&&f("div",{className:"text-sm text-[var(--orb-muted)] mb-3 leading-relaxed",children:typeof o=="string"?f("p",{className:"whitespace-pre-wrap",children:o}):o}),(l||n)&&g("div",{className:"flex items-center space-x-4 mt-2",children:[l&&g("button",{onClick:b,disabled:f$1,className:"flex items-center text-xs font-medium text-[var(--orb-status-error)] hover:opacity-80 transition-colors disabled:opacity-50",children:[f(qc,{className:`w-3.5 h-3.5 mr-1.5 ${f$1?"animate-spin":""}`}),f$1?"\u91CD\u8BD5\u4E2D...":"\u91CD\u8BD5"]}),n&&g("button",{onClick:()=>h(!m),className:"flex items-center text-xs font-medium text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] transition-colors",children:[m?f(Bo,{className:"w-3.5 h-3.5 mr-1"}):f(Ho,{className:"w-3.5 h-3.5 mr-1"}),m?"\u9690\u85CF\u8BE6\u60C5":"\u67E5\u770B\u8BE6\u60C5"]})]})]}),i&&s&&f("button",{onClick:s,className:"flex-shrink-0 ml-3 text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors self-start",children:f(Kt,{className:"w-4 h-4"})})]}),n&&m&&f("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] p-3 border-t border-[var(--orb-border)]",children:f("pre",{className:"text-xs font-mono text-[var(--orb-muted)] overflow-x-auto whitespace-pre-wrap p-2 bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)]",children:n})})]})},as=rC;var nC=({title:t="\u8B66\u544A",content:o,warningType:r,severity:n="warning",warnings:a=[],icon:i,closable:s=true,onClose:l,onConfirm:d,actionText:p,className:m="",...h})=>{let f$1=()=>{switch(n){case "info":return {borderLeftColor:"border-l-blue-500",iconColor:"text-[var(--orb-primary)]",bgColor:"bg-[var(--orb-p50)]"};case "error":return {borderLeftColor:"border-l-[var(--orb-status-error)]",iconColor:"text-[var(--orb-status-error)]",bgColor:"bg-[color-mix(in_oklch,var(--orb-status-error)_8%,transparent)]"};case "success":return {borderLeftColor:"border-l-green-500",iconColor:"text-[var(--orb-status-success)]",bgColor:"bg-[color-mix(in_oklch,var(--orb-status-success)_8%,transparent)]"};default:return {borderLeftColor:"border-l-yellow-500",iconColor:"text-[var(--orb-status-warning)]",bgColor:"bg-[color-mix(in_oklch,var(--orb-status-warning)_8%,transparent)]"}}},u=()=>{switch(n){case "info":return f(Aa,{className:"w-5 h-5"});case "error":return f(Va,{className:"w-5 h-5"});case "success":return f(Ma,{className:"w-5 h-5"});default:return f(Rc,{className:"w-5 h-5"})}},b=f$1();return g("div",{className:`relative w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${m}`,...h,children:[g("div",{className:`flex p-4 border-l-4 ${b.borderLeftColor} ${b.bgColor}`,children:[f("div",{className:`flex-shrink-0 mr-3 ${b.iconColor}`,children:i||u()}),g("div",{className:"flex-1 min-w-0",children:[g("div",{className:"flex items-center justify-between mb-1",children:[f("h4",{className:"text-base font-semibold text-[var(--orb-fg)]",children:t}),r&&f("span",{className:"text-xs font-medium px-2 py-0.5 rounded-full bg-[var(--orb-surface)] text-[var(--orb-muted)]",children:r})]}),o&&f("div",{className:"text-sm text-[var(--orb-muted)] mb-2",children:o}),a&&a.length>0&&f("ul",{className:"mt-2 space-y-1",children:a.map((C,g$1)=>g("li",{className:"flex items-start text-sm text-[var(--orb-muted)]",children:[f("span",{className:"mr-2 mt-1.5 w-1 h-1 rounded-full bg-[var(--orb-muted)] flex-shrink-0"}),f("span",{children:C})]},g$1))})]}),s&&l&&f("button",{onClick:l,className:"flex-shrink-0 ml-3 text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors",children:f(Kt,{className:"w-4 h-4"})})]}),d&&f("div",{className:"bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)] px-4 py-3 flex justify-end border-t border-[var(--orb-border)]",children:f("button",{onClick:d,className:"px-4 py-1.5 text-sm font-medium text-[var(--orb-on-primary)] bg-[var(--orb-primary)] hover:bg-[var(--orb-p600)] rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-[var(--orb-primary)] focus:ring-offset-2 dark:focus:ring-offset-gray-900",children:p||"\u786E\u8BA4"})})]})},is=nC;var aC=({title:t="\u76F8\u5173\u63A8\u8350",content:o,suggestions:r,onSuggestionClick:n,maxDisplay:a=5,icon:i,closable:s=false,onClose:l,className:d="",...p})=>{let[m,h]=useState(false),[f$1,u]=useState(""),[b,C]=useState(false),g$1=useMemo(()=>f$1.trim()?r.filter(y=>y.toLowerCase().includes(f$1.toLowerCase())):r,[r,f$1]),x=useMemo(()=>m?g$1:g$1.slice(0,a),[g$1,m,a]),v=y=>{n?.(y);};return !r||r.length===0?null:g("div",{className:`w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${d}`,...p,children:[g("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--orb-border)] bg-[var(--orb-p50)]",children:[g("div",{className:"flex items-center space-x-2.5",children:[f("div",{className:"text-[var(--orb-primary)] flex-shrink-0",children:i||f(Ea,{className:"w-5 h-5"})}),g("div",{className:"flex flex-col",children:[f("h4",{className:"text-sm font-semibold text-[var(--orb-fg)] leading-tight",children:t}),o&&f("span",{className:"text-xs text-[var(--orb-muted)] mt-0.5",children:o})]})]}),g("div",{className:"flex items-center space-x-1",children:[r.length>3&&f("button",{onClick:()=>C(!b),className:`p-1.5 rounded-md transition-colors ${b?"bg-[var(--orb-p100)] text-[var(--orb-status-primary)]":"text-[var(--orb-muted)] hover:text-[var(--orb-fg)] hover:bg-[var(--orb-hover)]"}`,title:b?"\u5173\u95ED\u641C\u7D22":"\u641C\u7D22\u95EE\u9898",children:f(zo,{className:"w-4 h-4"})}),s&&l&&f("button",{onClick:l,className:"text-[var(--orb-muted)] hover:text-[var(--orb-fg)] p-1.5 rounded-md hover:bg-[var(--orb-hover)] transition-colors",title:"\u5173\u95ED",children:f(Kt,{className:"w-4 h-4"})})]})]}),b&&f("div",{className:"px-4 py-2 border-b border-[var(--orb-border)] bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)]",children:g("div",{className:"relative",children:[f("input",{type:"text",placeholder:"\u641C\u7D22\u76F8\u5173\u95EE\u9898...",value:f$1,onChange:y=>u(y.target.value),className:"w-full text-sm px-3 py-1.5 pl-8 rounded border border-[var(--orb-border)] bg-[var(--orb-canvas)] text-[var(--orb-fg)] focus:ring-1 focus:ring-[var(--orb-primary)] focus:border-[var(--orb-primary)] outline-none transition-shadow",autoFocus:true}),f(zo,{className:"absolute left-2.5 top-2 w-3.5 h-3.5 text-[var(--orb-muted)]"})]})}),g("div",{className:"p-2",children:[f("ul",{className:"space-y-1",children:x.map((y,k)=>f("li",{children:g("button",{onClick:()=>v(y),className:"w-full text-left px-3 py-2 rounded-md text-sm text-[var(--orb-fg)] hover:bg-[var(--orb-hover)] hover:text-[var(--orb-status-primary)] transition-colors group flex items-start justify-between",children:[f("span",{children:y}),f(Ho,{className:"w-4 h-4 text-[var(--orb-muted)] group-hover:text-[var(--orb-status-primary)] opacity-0 group-hover:opacity-100 transition-all transform group-hover:translate-x-0.5"})]})},k))}),g$1.length>a&&f("button",{onClick:()=>h(!m),className:"w-full text-center py-2 text-xs font-medium text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors border-t border-[var(--orb-border)] mt-1",children:m?"\u6536\u8D77":`\u67E5\u770B\u5168\u90E8 (${g$1.length})`}),g$1.length===0&&f$1&&f("div",{className:"text-center py-4 text-sm text-[var(--orb-muted)]",children:"\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u5EFA\u8BAE"})]})]})},ss=aC;var iC=({title:t,content:o,toolName:r,parameters:n,result:a,status:i,duration:s,icon:l,closable:d=false,onClose:p,onAction:m,actionText:h,className:f$1="",...u})=>{let[b,C]=useState(false),[g$1,x]=useState(true),v=()=>{switch(i){case "pending":return {iconColor:"text-[var(--orb-primary)]",badgeBg:"bg-[var(--orb-p50)]",badgeText:"text-[var(--orb-status-primary)]",label:"\u6267\u884C\u4E2D"};case "error":return {iconColor:"text-[var(--orb-status-error)]",badgeBg:"bg-[color-mix(in_oklch,var(--orb-status-error)_10%,transparent)]",badgeText:"text-[var(--orb-status-error)]",label:"\u5931\u8D25"};default:return {iconColor:"text-[var(--orb-status-success)]",badgeBg:"bg-[color-mix(in_oklch,var(--orb-status-success)_8%,transparent)]",badgeText:"text-[var(--orb-status-success)]",label:"\u6210\u529F"}}},y=()=>{switch(i){case "pending":return f(Vc,{className:"w-5 h-5 animate-spin"});case "error":return f(Va,{className:"w-5 h-5"});default:return f(Ma,{className:"w-5 h-5"})}},k=I=>I?I<1e3?`${I}ms`:`${(I/1e3).toFixed(2)}s`:"",w=v(),P=t||r||"\u5DE5\u5177\u8C03\u7528";return g("div",{className:`w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${f$1}`,...u,children:[g("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--orb-border)] bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)]",children:[g("div",{className:"flex items-center space-x-3",children:[f("div",{className:`flex-shrink-0 ${w.iconColor}`,children:l||y()}),g("div",{children:[g("div",{className:"flex items-center space-x-2",children:[f("h4",{className:"text-sm font-semibold text-[var(--orb-fg)]",children:P}),f("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${w.badgeBg} ${w.badgeText}`,children:w.label})]}),r&&t&&g("div",{className:"text-xs text-[var(--orb-muted)] flex items-center mt-0.5",children:[f(zn,{className:"w-3 h-3 mr-1"}),r]})]})]}),g("div",{className:"flex items-center space-x-2 text-xs text-[var(--orb-muted)]",children:[s&&g("div",{className:"flex items-center bg-[var(--orb-surface)] px-2 py-1 rounded",children:[f(Ac,{className:"w-3 h-3 mr-1"}),k(s)]}),d&&p&&f("button",{onClick:p,className:"text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors p-1 rounded",children:f(Kt,{className:"w-4 h-4"})})]})]}),g("div",{className:"p-4",children:[o&&f("div",{className:"text-sm text-[var(--orb-muted)] mb-4 leading-relaxed",children:o}),n&&g("div",{className:"mb-3",children:[g("button",{onClick:()=>C(!b),className:"flex items-center text-xs font-medium text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] mb-2",children:[b?f(Bo,{className:"w-3.5 h-3.5 mr-1"}):f(Ho,{className:"w-3.5 h-3.5 mr-1"}),f("div",{className:"w-3.5 h-3.5 mr-1.5"}),"\u8F93\u5165\u53C2\u6570"]}),b&&f("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)] overflow-hidden",children:f("pre",{className:"p-3 text-xs font-mono text-[var(--orb-muted)] overflow-x-auto",children:JSON.stringify(n,null,2)})})]}),a&&g("div",{children:[g("button",{onClick:()=>x(!g$1),className:"flex items-center text-xs font-medium text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] mb-2",children:[g$1?f(Bo,{className:"w-3.5 h-3.5 mr-1"}):f(Ho,{className:"w-3.5 h-3.5 mr-1"}),f(zn,{className:"w-3.5 h-3.5 mr-1.5"}),"\u6267\u884C\u7ED3\u679C"]}),g$1&&f("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)] overflow-hidden",children:f("pre",{className:"p-3 text-xs font-mono text-[var(--orb-muted)] overflow-x-auto",children:typeof a=="string"?a:JSON.stringify(a,null,2)})})]}),m&&f("div",{className:"mt-3 pt-3 border-t border-[var(--orb-border)] flex justify-end",children:f("button",{onClick:m,className:"px-4 py-1.5 text-sm font-medium text-[var(--orb-on-primary)] bg-[var(--orb-primary)] hover:bg-[var(--orb-p600)] rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-[var(--orb-primary)] focus:ring-offset-2 dark:focus:ring-offset-gray-900",children:h||"\u6267\u884C\u64CD\u4F5C"})})]})]})},ls=iC;var lC=({data:t})=>{if(!t)return null;let o=useMemo(()=>{let r=[],n=[],a="\u6570\u636E\u8868\u683C";return Array.isArray(t)?(r=t,r.length>0&&(n=Object.keys(r[0]).map(i=>({id:i,label:i.charAt(0).toUpperCase()+i.slice(1),numeric:typeof r[0][i]=="number"})))):typeof t=="object"&&(a=t.title||a,r=Array.isArray(t.rows)?t.rows:Array.isArray(t.data)?t.data:[],Array.isArray(t.columns)?n=t.columns.map(s=>({id:s.key||s.id,label:s.title||s.label,numeric:s.dataType==="number"||s.numeric})):r.length>0&&(n=Object.keys(r[0]).map(s=>({id:s,label:s,numeric:typeof r[0][s]=="number"})))),r=r.map((i,s)=>({...i,id:i.id||`row_${s}`})),{title:a,columns:n,rows:r}},[t]);return o.rows.length===0?f("div",{className:"w-full my-4 p-4 border border-dashed border-[var(--orb-border)] rounded text-center text-[var(--orb-muted)]",children:"\u6682\u65E0\u8868\u683C\u6570\u636E"}):f("div",{className:"w-full my-4",children:f(er,{appId:"agent-ui-table-card",title:o.title,columns:o.columns,rows:o.rows,count:o.rows.length,rowKey:"id",fitContainer:false,maxHeight:"500px",rowsPerPage:10,rowsPerPageOptions:[5,10,20,50]})})},cs=lC;var cC=({title:t,subtitle:o,data:r,type:n,config:a={}})=>{let i=()=>{switch(n){case "bar-chart-card":return f(zs,{className:"w-4 h-4 text-[var(--orb-chart-1)]"});case "line-chart-card":return f(zc,{className:"w-4 h-4 text-[var(--orb-chart-positive)]"});case "pie-chart-card":return f(Kc,{className:"w-4 h-4 text-[var(--orb-chart-2)]"});case "combo-chart-card":return f(Mc,{className:"w-4 h-4 text-[var(--orb-chart-5)]"});case "heatmap-chart-card":return f(Bc,{className:"w-4 h-4 text-[var(--orb-chart-negative)]"});case "fishbone-chart-card":return f(Fc,{className:"w-4 h-4 text-[var(--orb-chart-4)]"});case "waterfall-chart-card":return f(Jc,{className:"w-4 h-4 text-[var(--orb-chart-6)]"});case "google-map-card":return f(Hn,{className:"w-4 h-4 text-[var(--orb-status-primary)]"});case "amap-card":return f($c,{className:"w-4 h-4 text-[var(--orb-status-primary)]"});default:return f(zs,{className:"w-4 h-4"})}},s=()=>{if(!r&&n!=="google-map-card"&&n!=="amap-card")return f("div",{className:"text-[var(--orb-muted)] text-sm p-4 text-center",children:"No data available"});try{switch(n){case "bar-chart-card":return f(ta,{data:r,orientation:a.orientation||"horizontal",valueSuffix:a.valueSuffix||"",minHeight:a.minHeight});case "line-chart-card":return f(Ap,{data:r,color:a.color,valueSuffix:a.valueSuffix||"",height:a.height});case "pie-chart-card":let l=r.reduce((p,m)=>p+(Number(m.value)||0),0),d=r.map(p=>({name:p.name,value:Number(p.value)||0,percent:typeof p.percent=="number"?p.percent:l>0?(Number(p.value)||0)/l*100:0}));return f(Si,{data:d,variant:a.variant||"donut",size:a.size,colors:a.colors});case "combo-chart-card":return f(Ep,{data:r,barColor:a.barColor,lineColor:a.lineColor});case "heatmap-chart-card":return f(Lp,{data:r});case "fishbone-chart-card":return f(Op,{branches:r,effect:a.effect||t||"Problem"});case "waterfall-chart-card":return f(Fp,{data:r,height:a.height});case "google-map-card":return f(Bp,{embedUrl:a.embedUrl||r&&r[0]?.embedUrl,apiKey:a.apiKey,query:a.query||r&&r[0]?.query||t,height:a.height});case "amap-card":return f(Hp,{embedUrl:a.embedUrl||r&&r[0]?.embedUrl,keyword:a.keyword||r&&r[0]?.keyword||t,height:a.height});default:return g("div",{className:"text-[var(--orb-muted)] text-sm p-4 text-center",children:["Unsupported chart type: ",n]})}}catch(l){return console.error("Error rendering chart:",l),f("div",{className:"text-[var(--orb-status-error)] text-sm p-4 text-center",children:"Error rendering chart"})}};return g("div",{className:"w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md",children:[g("div",{className:"flex items-center px-4 py-3 border-b border-[var(--orb-border)] bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)]",children:[f("div",{className:"mr-2 flex-shrink-0",children:i()}),g("div",{className:"flex-1 min-w-0",children:[f("h3",{className:"text-sm font-semibold text-[var(--orb-fg)] truncate",children:t}),o&&f("p",{className:"text-xs text-[var(--orb-muted)] mt-0.5 truncate",children:o})]})]}),g("div",{className:"p-4",children:[f("div",{className:"overflow-x-auto",children:s()}),f("div",{className:"mt-3",children:g("details",{className:"text-xs text-[var(--orb-muted)]",children:[f("summary",{className:"cursor-pointer hover:text-[var(--orb-fg)] transition-colors select-none font-medium opacity-60 hover:opacity-100",children:"View Raw Data"}),f("pre",{className:"mt-2 p-2 bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)] overflow-x-auto max-h-40",children:JSON.stringify(r,null,2)})]})})]})]})},ds=cC;var hs=["bar","column","line","pie","donut","scatter","bubble","list","metric","progress"],dC={bar:"Bars",column:"Columns",line:"Line",pie:"Pie",donut:"Donut",scatter:"Scatter",bubble:"Bubble",list:"List",metric:"Metric",progress:"Progress"},ms=480,Tn=214,Gt={top:18,right:16,bottom:38,left:30},eo=t=>typeof t=="number"&&Number.isFinite(t)?t:0,Mm=t=>t.toLocaleString(void 0,{maximumFractionDigits:1}),Ko=(t,o)=>`${t.id||t.label}-${o}`,Rm=(t,o=13)=>t.length>o?`${t.slice(0,Math.max(1,o-1))}\u2026`:t,gs=(t,o,r)=>Math.min(r,Math.max(o,t)),mr=(t,o,r)=>t.color??r[o%r.length],gr=(t,o)=>o?{onMouseEnter:()=>o.onItemHoverStart?.(t),onMouseMove:()=>o.onItemHoverStart?.(t),onMouseLeave:()=>o.onItemHoverEnd?.(t),onContextMenu:r=>o.onItemContextMenu?.(r,t)}:{},Dm=t=>{let o=t.map(a=>eo(a.value)),r=Math.min(0,...o),n=Math.max(0,...o);return {min:r,max:n===r?r+1:n,range:n===r?1:n-r}},pC=(t,o,r)=>{let n=ms-Gt.left-Gt.right,a=Tn-Gt.top-Gt.bottom,{max:i,range:s}=Dm(r),l=Gt.left+t*n/Math.max(r.length-1,1),d=Gt.top+(i-eo(o.value))/s*a,p=Gt.top+i/s*a;return {x:l,y:d,zeroY:p}},us=(t,o,r,n)=>{let a=(n-90)*Math.PI/180;return {x:t+r*Math.cos(a),y:o+r*Math.sin(a)}},uC=(t,o,r,n,a,i)=>{let s=us(t,o,r,i),l=us(t,o,r,a),d=i-a>180?1:0;if(n===0)return `M ${t} ${o} L ${s.x} ${s.y} A ${r} ${r} 0 ${d} 0 ${l.x} ${l.y} Z`;let p=us(t,o,n,i),m=us(t,o,n,a);return `M ${s.x} ${s.y} A ${r} ${r} 0 ${d} 0 ${l.x} ${l.y} L ${m.x} ${m.y} A ${n} ${n} 0 ${d} 1 ${p.x} ${p.y} Z`},mC=({children:t})=>g("div",{className:"orb-metric-empty",role:"status",children:[f("span",{className:"orb-metric-empty-mark","aria-hidden":"true",children:"\u2014"}),f(E,{variant:"body2",muted:true,children:t})]}),gC=()=>g("div",{className:"orb-metric-loading",role:"status","aria-label":"Loading chart",children:[f("span",{className:"orb-metric-skeleton orb-metric-skeleton-wide"}),f("span",{className:"orb-metric-skeleton"}),f("span",{className:"orb-metric-skeleton orb-metric-skeleton-short"}),f("span",{className:"orb-metric-skeleton orb-metric-skeleton-wide"})]}),ql=({item:t,onItemClick:o,interactions:r})=>{let n=()=>o?.(t);return {...o?{role:"button",tabIndex:0,onClick:n,onKeyDown:i=>{o&&(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),n());}}:{},...gr(t,r),style:{cursor:o||r?"pointer":"default"}}},hC=({loading:t,error:o,hasData:r,emptyState:n,children:a})=>t?f(gC,{}):o?f("div",{className:"orb-metric-error",role:"alert",children:o}):r?f(e,{children:a}):f(mC,{children:n??"No data for the current selection."}),fC=({data:t,activeId:o,onItemClick:r,interactions:n,valueFormatter:a,colors:i})=>{let s=Math.max(...t.map(l=>Math.abs(eo(l.value))),1);return f("div",{className:"orb-metric-bars",role:"list","aria-label":"Chart data",children:t.map((l,d)=>{let p=eo(l.value),m=`${gs(Math.abs(p)/s*100,0,100)}%`,h=o===l.id,f$1=g(e,{children:[f("span",{className:"orb-metric-bar-label",title:l.label,children:l.label}),f("span",{className:"orb-metric-bar-track","aria-hidden":"true",children:f("span",{className:`orb-metric-bar-fill${h?" is-active":""}`,style:{width:m,backgroundColor:mr(l,d,i)}})}),f("span",{className:"orb-metric-bar-value",children:a(p)})]});return r?f("button",{type:"button",className:`orb-metric-bar-row${h?" is-active":""}`,onClick:()=>r(l),title:`${l.label}: ${a(p)}`,"aria-pressed":h,...gr(l,n),children:f$1},Ko(l,d)):f("div",{className:`orb-metric-bar-row${h?" is-active":""}`,role:"listitem",...gr(l,n),children:f$1},Ko(l,d))})})},bC=({data:t,activeId:o,onItemClick:r,interactions:n,valueFormatter:a,colors:i})=>{let s=Math.max(t.reduce((l,d)=>l+Math.max(eo(d.value),0),0),1);return f("div",{className:"orb-metric-progress",role:"list","aria-label":"Chart data",children:t.map((l,d)=>{let p=Math.max(eo(l.value),0),m=gs(p/s*100,0,100),h=o===l.id,f$1=g(e,{children:[g("span",{className:"orb-metric-progress-heading",children:[f("span",{title:l.label,children:l.label}),f("strong",{children:a(p)})]}),f("span",{className:"orb-metric-bar-track","aria-hidden":"true",children:f("span",{className:"orb-metric-bar-fill",style:{width:`${m}%`,backgroundColor:mr(l,d,i)}})})]});return r?f("button",{type:"button",className:`orb-metric-progress-row${h?" is-active":""}`,onClick:()=>r(l),"aria-pressed":h,...gr(l,n),children:f$1},Ko(l,d)):f("div",{className:`orb-metric-progress-row${h?" is-active":""}`,role:"listitem",...gr(l,n),children:f$1},Ko(l,d))})})},vC=({type:t,data:o,activeId:r,onItemClick:n,interactions:a,valueFormatter:i,secondaryValueFormatter:s,colors:l,ariaLabel:d})=>{let{min:p,max:m,range:h}=Dm(o),f$1=ms-Gt.left-Gt.right,u=Tn-Gt.top-Gt.bottom,b=Gt.top+m/h*u,C=Math.max(1,Math.ceil(o.length/6)),g$1=o.map((y,k)=>pC(k,y,o)),x=g$1.map(y=>`${y.x},${y.y}`).join(" "),v=Math.max(...o.map(y=>Math.max(eo(y.secondaryValue),0)),1);return f("div",{className:"orb-metric-svg-wrap",children:g("svg",{className:"orb-metric-svg",viewBox:`0 0 ${ms} ${Tn}`,role:"img","aria-label":d,children:[f("line",{className:"orb-metric-axis",x1:Gt.left,y1:b,x2:ms-Gt.right,y2:b}),f("line",{className:"orb-metric-grid",x1:Gt.left,y1:Gt.top,x2:Gt.left,y2:Tn-Gt.bottom}),t==="column"&&o.map((y,k)=>{let w=g$1[k],P=eo(y.value),I=Math.max(Math.abs(w.y-b),P===0?2:0),S=w.x-Math.min(18,f$1/Math.max(o.length*2,1)),R=Math.min(36,Math.max(10,f$1/Math.max(o.length*1.8,1))),N=r===y.id;return g("g",{...ql({item:y,onItemClick:n,interactions:a}),"aria-label":`${y.label}: ${i(P)}`,children:[f("rect",{className:`orb-metric-column${N?" is-active":""}`,x:S,y:Math.min(w.y,b),width:R,height:I,rx:4,fill:mr(y,k,l)}),g("title",{children:[y.label,": ",i(P)]}),(k%C===0||o.length<=6)&&f("text",{className:"orb-metric-svg-label",x:w.x,y:Tn-14,textAnchor:"middle",children:Rm(y.label)})]},Ko(y,k))}),(t==="line"||t==="scatter"||t==="bubble")&&g(e,{children:[t==="line"&&f("polyline",{className:"orb-metric-line",fill:"none",points:x,stroke:l[0]}),o.map((y,k)=>{let w=g$1[k],P=r===y.id,I=t==="bubble"?7+Math.max(eo(y.secondaryValue),0)/v*12:t==="scatter"?5:4;return g("g",{...ql({item:y,onItemClick:n,interactions:a}),"aria-label":`${y.label}: ${i(eo(y.value))}`,children:[t==="line"&&f("circle",{className:`orb-metric-point${P?" is-active":""}`,cx:w.x,cy:w.y,r:P?6:4,fill:mr(y,k,l)}),t!=="line"&&f("circle",{className:`orb-metric-point${P?" is-active":""}`,cx:w.x,cy:w.y,r:I,fill:mr(y,k,l),opacity:t==="bubble"?.82:.9}),g("title",{children:[y.label,": ",i(eo(y.value)),t==="bubble"&&y.secondaryValue!==void 0?` \xB7 Size: ${s(eo(y.secondaryValue))}`:""]}),(k%C===0||o.length<=6)&&f("text",{className:"orb-metric-svg-label",x:w.x,y:Math.max(Gt.top+8,w.y-I-7),textAnchor:"middle",children:Rm(y.label)})]},Ko(y,k))})]}),f("text",{className:"orb-metric-axis-label",x:Gt.left,y:Gt.top-5,children:i(m)}),p<0&&f("text",{className:"orb-metric-axis-label",x:Gt.left,y:Tn-Gt.bottom+14,children:i(p)})]})})},yC=({type:t,data:o,activeId:r,onItemClick:n,interactions:a,valueFormatter:i,colors:s,ariaLabel:l})=>{let d=o.map(u=>({...u,value:Math.max(eo(u.value),0)})),p=d.reduce((u,b)=>u+b.value,0),m=72,h=92,f$1=0;return g("div",{className:"orb-metric-circular",children:[g("svg",{className:"orb-metric-donut",viewBox:"0 0 184 184",role:"img","aria-label":l,children:[d.map((u,b)=>{let C=u.value/p*360,g$1=f$1;f$1+=C;let x=r===u.id,v=C>=359.9?void 0:uC(h,h,m,t==="donut"?46:0,g$1,g$1+C),y=ql({item:u,onItemClick:n,interactions:a});return v?f("path",{className:`orb-metric-slice${x?" is-active":""}`,d:v,fill:mr(u,b,s),...y,children:g("title",{children:[u.label,": ",i(u.value)," (",(u.value/p*100).toFixed(1),"%)"]})},Ko(u,b)):f("circle",{className:`orb-metric-slice${x?" is-active":""}`,cx:h,cy:h,r:t==="donut"?60:m,fill:t==="donut"?"none":mr(u,b,s),stroke:t==="donut"?mr(u,b,s):void 0,strokeWidth:28,...y,children:g("title",{children:[u.label,": ",i(u.value)," (100%)"]})},Ko(u,b))}),t==="donut"&&f("circle",{cx:h,cy:h,r:44,fill:"var(--orb-surface)"}),t==="donut"&&f("text",{className:"orb-metric-donut-total",x:h,y:h+5,textAnchor:"middle",children:i(p)})]}),f("div",{className:"orb-metric-legend",role:"list","aria-label":"Chart legend",children:d.map((u,b)=>{let C=r===u.id;return g("button",{type:"button",className:`orb-metric-legend-item${C?" is-active":""}`,onClick:()=>n?.(u),disabled:!n,title:u.label,...gr(u,a),children:[f("span",{className:"orb-metric-legend-dot",style:{backgroundColor:mr(u,b,s)}}),f("span",{className:"orb-metric-legend-label",children:u.label}),g("strong",{children:[(u.value/p*100).toFixed(0),"%"]})]},Ko(u,b))})})]})},CC=({data:t,activeId:o,onItemClick:r,interactions:n,valueFormatter:a,secondaryValueFormatter:i})=>f("div",{className:"orb-metric-list",role:"list","aria-label":"Chart data",children:t.map((s,l)=>{let d=g(e,{children:[f("span",{className:"orb-metric-list-label",title:s.label,children:s.label}),f("span",{className:"orb-metric-list-value",children:a(eo(s.value))}),s.secondaryValue!==void 0&&f("span",{className:"orb-metric-list-secondary",children:i(eo(s.secondaryValue))})]});return r?f("button",{type:"button",className:`orb-metric-list-row${o===s.id?" is-active":""}`,onClick:()=>r(s),"aria-pressed":o===s.id,...gr(s,n),children:d},Ko(s,l)):f("div",{className:`orb-metric-list-row${o===s.id?" is-active":""}`,role:"listitem",...gr(s,n),children:d},Ko(s,l))})}),fs=({title:t,subtitle:o,data:r=[],chartType:n="bar",onChartTypeChange:a,onItemClick:i,onDataDetails:s,activeId:l,valueFormatter:d=Mm,secondaryValueFormatter:p=Mm,valueLabel:m,secondaryValueLabel:h,emptyState:f$1,loading:u=false,error:b,maxItems:C=8,showChartTypeControl:g$1=true,showDataDetails:x=true,dataRevealDelayMs:v=1e3,chartTypeOptions:y,chartTypeLabels:k,footer:w,ariaLabel:P,className:I,style:S,sx:R})=>{let N=Hs(),T=useRef(null),M=useRef(null),[A,L]=useState(n),[W,ee]=useState(false),[O,_]=useState(null),[V,Q]=useState(null);useEffect(()=>L(n),[n]);let H=useCallback(()=>{M.current!==null&&(window.clearTimeout(M.current),M.current=null);},[]);useEffect(()=>H,[H]),useEffect(()=>{if(!V)return;let U=Re=>{let we=Re.target;we instanceof HTMLElement&&we.closest(".orb-metric-context-menu")||Q(null);};return document.addEventListener("pointerdown",U),()=>document.removeEventListener("pointerdown",U)},[V]);let B=A,q=useMemo(()=>[N.chart1,N.chart2,N.chart3,N.chart4,N.chart5,N.chart6],[N]),Z=useMemo(()=>W?r:r.slice(0,Math.max(1,C)),[r,C,W]),Y=Math.max(0,r.length-Z.length),J=Z.some(U=>eo(U.value)>0),le=Z.length>0&&(B!=="pie"&&B!=="donut"?true:J),he=(y??[B,"bar","column","line","pie","donut","scatter","bubble","list"]).filter((U,Re,we)=>hs.includes(U)&&we.indexOf(U)===Re),ze={...dC,...k},be=Z[0],Ce=P??`${t} ${ze[B]} chart`,Be=U=>{L(U),a?.(U);},de=useCallback((U,Re)=>{_({item:U,source:Re}),Q(null),s?.(U,Re);},[s]),ve=useCallback(U=>{H(),!(!x||V)&&(M.current=window.setTimeout(()=>{de(U,"hover"),M.current=null;},Math.max(0,v)));},[H,V,v,de,x]),We=useCallback(()=>{H();},[H]),et=useCallback((U,Re)=>{if(!x)return;U.preventDefault(),H();let we=T.current?.getBoundingClientRect(),Oe=we?gs(U.clientX-we.left,8,Math.max(8,we.width-164)):8,at=we?gs(U.clientY-we.top,8,Math.max(8,we.height-72)):8;Q({item:Re,left:Oe,top:at});},[H,x]),nt=x?{onItemHoverStart:ve,onItemHoverEnd:We,onItemContextMenu:et}:void 0,it=B==="metric"?g("div",{className:"orb-metric-kpi",role:i?"button":"img",tabIndex:i?0:void 0,onClick:()=>be&&i?.(be),onKeyDown:U=>{be&&i&&(U.key==="Enter"||U.key===" ")&&(U.preventDefault(),i(be));},"aria-label":Ce,...be?gr(be,nt):{},children:[f("span",{className:"orb-metric-kpi-label",children:be?.label??m??"Value"}),f("strong",{children:be?d(eo(be.value)):"\u2014"}),be?.secondaryValue!==void 0&&g("span",{className:"orb-metric-kpi-secondary",children:[h??"Compared with"," \xB7 ",p(eo(be.secondaryValue))]})]}):B==="progress"?f(bC,{data:Z,activeId:l,onItemClick:i,interactions:nt,valueFormatter:d,colors:q}):B==="bar"?f(fC,{data:Z,activeId:l,onItemClick:i,interactions:nt,valueFormatter:d,colors:q}):B==="list"?f(CC,{data:Z,activeId:l,onItemClick:i,interactions:nt,valueFormatter:d,secondaryValueFormatter:p}):B==="pie"||B==="donut"?f(yC,{type:B,data:Z,activeId:l,onItemClick:i,interactions:nt,valueFormatter:d,colors:q,ariaLabel:Ce}):f(vC,{type:B,data:Z,activeId:l,onItemClick:i,interactions:nt,valueFormatter:d,secondaryValueFormatter:p,colors:q,ariaLabel:Ce});return g("div",{ref:T,className:"orb-metric-chart-shell",onMouseLeave:()=>{H(),O?.source==="hover"&&_(null);},children:[g(Ne,{elevation:1,variant:"outlined",className:`orb-metric-chart-card ${I??""}`,style:S,sx:R,children:[g("div",{className:"orb-metric-chart-header",children:[g("div",{className:"orb-metric-chart-heading",children:[f(E,{variant:"subtitle1",component:"h3",noWrap:true,title:t,children:t}),o&&f(E,{variant:"caption",muted:true,component:"div",noWrap:true,children:o})]}),g$1&&he.length>1&&f(zt,{"aria-label":`${t} chart type`,className:"orb-metric-chart-select",value:B,options:he.map(U=>({value:U,label:ze[U]})),onChange:U=>Be(U.target.value),minWidth:108,fullWidth:false,size:"small"})]}),g("div",{className:"orb-metric-chart-body",children:[f(hC,{loading:u,error:b,hasData:le,emptyState:f$1,children:it}),Y>0&&!u&&!b&&f("button",{type:"button",className:"orb-metric-more",onClick:()=>ee(U=>!U),children:W?"Show fewer":`Show all ${r.length}`})]}),w&&f("div",{className:"orb-metric-chart-footer",children:w})]}),V&&g("div",{className:"orb-metric-context-menu",role:"menu",onMouseEnter:H,onKeyDown:U=>{U.key==="Escape"&&Q(null);},style:{left:V.left,top:V.top},onPointerDown:U=>U.stopPropagation(),children:[f("div",{className:"orb-metric-context-label",children:V.item.label}),f("button",{type:"button",role:"menuitem",onClick:U=>{U.preventDefault(),U.stopPropagation(),de(V.item,"contextmenu");},children:"Show data"})]}),O&&g("div",{className:"orb-metric-data-details",role:"dialog","aria-label":`${O.item.label} data details`,onPointerDown:U=>U.stopPropagation(),children:[g("div",{className:"orb-metric-data-details-header",children:[f("strong",{children:O.item.label}),f("button",{type:"button","aria-label":"Close data details",onClick:()=>_(null),children:"\xD7"})]}),g("div",{className:"orb-metric-data-details-row",children:[f("span",{children:m??"Value"}),f("strong",{children:d(eo(O.item.value))})]}),O.item.secondaryValue!==void 0&&g("div",{className:"orb-metric-data-details-row",children:[f("span",{children:h??"Secondary value"}),f("strong",{children:p(eo(O.item.secondaryValue))})]}),f("span",{className:"orb-metric-data-details-hint",children:O.source==="hover"?`Shown after ${Math.max(0,v)/1e3} seconds of stillness`:"Shown from the context menu"})]})]})};fs.displayName="CMetricChartCard";var xC=({messageId:t,cardHooks:o,valueSuffix:r,secondaryValueSuffix:n,...a})=>{let i=(l,d)=>{o?.onCardEvent?.({messageId:t,cardType:"metric-chart-card",action:l,title:a.title,payload:d,rawData:a});},s=(l,d)=>`${l.toLocaleString()}${d??""}`;return f(fs,{...a,valueFormatter:l=>s(l,r),secondaryValueFormatter:l=>s(l,n),onChartTypeChange:l=>i("action",{chartType:l}),onItemClick:l=>i("action",{item:l}),onDataDetails:(l,d)=>i("show-data",{item:l,source:d})})},bs=xC;var wC=({type:t,manifest:o})=>g("div",{className:"w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md",children:[g("div",{className:"flex items-center px-4 py-3 border-b border-[var(--orb-border)] bg-[var(--orb-p50)]",children:[f("div",{className:"w-4 h-4 mr-2 text-[var(--orb-status-primary)]"}),g("h3",{className:"text-sm font-semibold text-[var(--orb-fg)]",children:["SAP Card: ",t]})]}),f("div",{className:"p-4",children:f("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] p-3 rounded border border-[var(--orb-border)] overflow-x-auto",children:f("pre",{className:"text-xs font-mono text-[var(--orb-muted)] whitespace-pre-wrap",children:JSON.stringify(o,null,2)})})})]}),vs=wC;var SC=t=>Array.isArray(t)?t.flatMap((o,r)=>{if(!o||typeof o!="object")return [];let n=o,a=String(n.label??n.name??n.id??`Item ${r+1}`),i=Number(n.value),s=Number.isFinite(i)?i:0,l=n.secondaryValue===void 0?void 0:Number(n.secondaryValue);return [{id:String(n.id??n.name??n.label??r),label:a,value:s,...l!==void 0&&Number.isFinite(l)?{secondaryValue:l}:{},...typeof n.color=="string"?{color:n.color}:{}}]}):[],ys=t=>{let o;try{o=JSON.parse(t);}catch{return null}if(o&&typeof o=="object"){if(o.type==="metric-chart-card"&&o.title&&Array.isArray(o.data)){let r=hs.includes(o.chartType)?o.chartType:"bar";return {...o,type:"metric-chart-card",chartType:r,data:SC(o.data)}}if((o.type==="bar-chart-card"||o.type==="line-chart-card"||o.type==="pie-chart-card"||o.type==="combo-chart-card"||o.type==="heatmap-chart-card"||o.type==="fishbone-chart-card"||o.type==="waterfall-chart-card"||o.type==="google-map-card"||o.type==="amap-card")&&o.title||(o.type==="sap-analytical-card"||o.type==="sap-list-card"||o.type==="sap-object-card"||o.type==="sap-component-card")&&o.manifest||o.type==="error-card"||o.type==="warning-card"||o.type==="suggestions-card"||o.type==="tool-result-card"||o.type==="table"&&o.data)return o}return null};var DC=({content:t,theme:o,size:r="base",className:n,enableCodeHighlight:a=true,enableMermaid:i=true,messageId:s,cardHooks:l})=>{let d=useRef(l);d.current=l;let p=!!l?.onCardEvent,m=useMemo(()=>p?{onCardEvent:C=>d.current?.onCardEvent?.(C)}:void 0,[p]),h=useMemo(()=>t?t.replace(/<think>([\s\S]*?)<\/think>/g,(C,g)=>`<div data-component="thinkbox" data-think-content="${encodeURIComponent(g.trim())}"></div>`):"",[t]),f$1=(C,g,x,v,y)=>{m?.onCardEvent?.({messageId:s,cardType:C,action:g,title:x,payload:v,rawData:y});},u=(C,g,x,v,y,k)=>{if(!(!y&&!m?.onCardEvent))return (...w)=>{let P=y?.(...w),I=k?k(...w):void 0;return f$1(C,g,x,I,v),P}},b=useMemo(()=>({div(C){let{"data-component":g,"data-think-content":x,...v}=C;return g==="thinkbox"&&x?f(gm,{content:decodeURIComponent(x),theme:o,size:r,defaultExpanded:false}):f("div",{...v})},table({children:C}){return f("div",{className:"my-4 w-full overflow-x-auto rounded-lg border border-[var(--orb-border)]",children:f("table",{className:"w-full min-w-[520px] border-collapse text-sm",children:C})})},thead({children:C}){return f("thead",{className:"bg-[color-mix(in_oklch,var(--orb-surface)_60%,transparent)]",children:C})},tbody({children:C}){return f("tbody",{className:"bg-[var(--orb-canvas)] dark:bg-[var(--orb-canvas)]",children:C})},tr({children:C}){return f("tr",{className:"border-b border-[var(--orb-border)] last:border-b-0",children:C})},th({children:C,align:g}){return f("th",{className:`px-3 py-2 font-semibold text-[var(--orb-fg)] ${g==="center"?"text-center":g==="right"?"text-right":"text-left"}`,children:C})},td({children:C,align:g}){return f("td",{className:`px-3 py-2 text-[var(--orb-fg)] align-top ${g==="center"?"text-center":g==="right"?"text-right":"text-left"}`,children:C})},code({className:C,children:g,...x}){let v=/language-([\w-]+)/.exec(C||""),y=v?v[1]:"",k=String(g);if(!v&&!k.includes(`
17
- `))return f("code",{children:g});let P=k.replace(/\n$/,"");if(i&&y==="mermaid")return f(wm,{content:P});if(y==="html"||y==="htm")return f(ym,{content:P});if(y==="json"){let I=ys(P);if(I)switch(I.type){case "table":return f(cs,{data:I.data});case "metric-chart-card":return f(bs,{...I,messageId:s,cardHooks:m});case "bar-chart-card":case "line-chart-card":case "pie-chart-card":case "combo-chart-card":case "heatmap-chart-card":case "fishbone-chart-card":case "waterfall-chart-card":case "google-map-card":case "amap-card":return f(ds,{...I});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return f(vs,{...I});case "error-card":{let S=I;return f(as,{...S,onClose:u("error-card","close",S.title,S,S.onClose),onRetry:u("error-card","retry",S.title,S,S.onRetry)})}case "warning-card":{let S=I,R=S.onConfirm?u("warning-card","confirm",S.title,S,S.onConfirm):S.actionText&&m?.onCardEvent?u("warning-card","confirm",S.title,S):void 0;return f(is,{...S,onClose:u("warning-card","close",S.title,S,S.onClose),onConfirm:R})}case "suggestions-card":{let S=I;return f(ss,{...S,onClose:u("suggestions-card","close",S.title,S,S.onClose),onSuggestionClick:u("suggestions-card","suggestion-click",S.title,S,S.onSuggestionClick,R=>({suggestion:R}))})}case "tool-result-card":{let S=I;return f(ls,{...S,onClose:u("tool-result-card","close",S.title,S,S.onClose),onAction:u("tool-result-card","action",S.title,S,S.onAction)})}}}return a?f(hm,{content:P,language:y,className:"not-prose"}):f("code",{className:C,...x,children:g})}}),[o,r,i,a,m,s]);return f("div",{className:ot("markdown-body max-w-none",n),children:f(PC,{remarkPlugins:[TC,IC],rehypePlugins:[MC,RC],components:b,children:h})})},In=DC;var NC=({content:t,messageId:o,cardHooks:r})=>{let n=(s,l,d,p,m)=>{r?.onCardEvent?.({messageId:o,cardType:s,action:l,title:d,payload:p,rawData:m});},a=(s,l,d,p,m,h)=>{if(!(!m&&!r?.onCardEvent))return (...f)=>{let u=m?.(...f),b=h?h(...f):void 0;return n(s,l,d,b,p),u}},i=ys(t);if(i)switch(i.type){case "table":return f(cs,{data:i.data});case "metric-chart-card":return f(bs,{...i,messageId:o,cardHooks:r});case "bar-chart-card":case "line-chart-card":case "pie-chart-card":case "combo-chart-card":case "heatmap-chart-card":case "fishbone-chart-card":case "waterfall-chart-card":case "google-map-card":case "amap-card":return f(ds,{...i});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return f(vs,{...i});case "error-card":{let s=i;return f(as,{...s,onClose:a("error-card","close",s.title,s,s.onClose),onRetry:a("error-card","retry",s.title,s,s.onRetry)})}case "warning-card":{let s=i,l=s.onConfirm?a("warning-card","confirm",s.title,s,s.onConfirm):s.actionText&&r?.onCardEvent?a("warning-card","confirm",s.title,s):void 0;return f(is,{...s,onClose:a("warning-card","close",s.title,s,s.onClose),onConfirm:l})}case "suggestions-card":{let s=i;return f(ss,{...s,onClose:a("suggestions-card","close",s.title,s,s.onClose),onSuggestionClick:a("suggestions-card","suggestion-click",s.title,s,s.onSuggestionClick,l=>({suggestion:l}))})}case "tool-result-card":{let s=i;return f(ls,{...s,onClose:a("tool-result-card","close",s.title,s,s.onClose),onAction:a("tool-result-card","action",s.title,s,s.onAction)})}}return f("div",{className:"dynamic-card-fallback",children:f(In,{content:t,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:o,cardHooks:r})})},Nm=NC;var Zl=class{static analyze(o){if(!o.trim())return {blocks:[],hasComplexContent:false,overallType:"simple"};let n=/```json\s*\{\s*"type":\s*"[^"]+"/g.test(o),a=/<[^>]+>[\s\S]*?<\/[^>]+>/.test(o),i=o.includes("NQ#")||o.includes("data-component");return n||a||i?{blocks:[{type:"mixed",content:o,startIndex:0,endIndex:o.length}],hasComplexContent:true,overallType:"complex"}:{blocks:[{type:"markdown",content:o,startIndex:0,endIndex:o.length}],hasComplexContent:false,overallType:"simple"}}},EC=({content:t,className:o="",messageId:r,cardHooks:n})=>{let a=Jt__default.useMemo(()=>Zl.analyze(t),[t]);return f("div",{className:`universal-content-renderer ${o}`,children:a.blocks.map((i,s)=>i.type==="mixed"||i.type==="json-card"?f(Nm,{content:i.content,messageId:r,cardHooks:n},`block-${s}`):f(In,{content:i.content,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:r,cardHooks:n},`block-${s}`))})},Cs=EC;var LC=({content:t,isStreaming:o=true,onComplete:r,className:n="",streamIntervalMs:a=24,streamChunkSize:i=3,messageId:s,cardHooks:l})=>{let[d,p]=useState(o?0:t.length),[m,h]=useState(!o);useEffect(()=>{if(o){p(0),h(false);return}p(t.length),h(true);},[t,o]),useEffect(()=>{if(!o||m)return;if(d>=t.length){h(true),r?.();return}let g=window.setTimeout(()=>{p(x=>Math.min(x+i,t.length));},a);return ()=>{window.clearTimeout(g);}},[t.length,m,o,r,i,a,d]);let f$1=()=>{o&&!m&&(p(t.length),h(true),r?.());},u=o?t.slice(0,d):t,b=o&&!m,C=o&&!m;return g("div",{className:`streaming-markdown ${n}`,onClick:f$1,style:{cursor:o?"pointer":"default"},children:[g("div",{className:"relative",children:[f(Cs,{content:u,messageId:s,cardHooks:l}),b&&f("span",{className:"inline-block w-[2px] h-[13px] ml-0.5 animate-pulse",style:{verticalAlign:"text-bottom",backgroundColor:"var(--orb-primary, #154194)"}})]}),C&&f("div",{className:"streaming-hint",style:{fontSize:"9px",color:"var(--orb-muted)",marginTop:"8px",fontStyle:"italic",opacity:.7},children:"\u70B9\u51FB\u6B64\u5904\u663E\u793A\u5B8C\u6574\u5185\u5BB9"})]})},Lm=LC;var Om=({buttons:t,className:o})=>{let r=n=>{switch(n){case "copy":return f(No,{size:14});case "refresh":return f(Ha,{size:14});case "volume":return f(td,{size:14});case "like":return f(Qc,{size:14});case "dislike":return f(Yc,{size:14});default:return null}};return f("div",{className:ot("flex items-center gap-1",o),children:t.map((n,a)=>f("button",{onClick:n.onClick,disabled:n.disabled,"aria-busy":n.loading||void 0,className:ot("p-1.5 rounded-md transition-colors","text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] dark:hover:text-[var(--orb-fg)]","hover:bg-[var(--orb-hover)]","disabled:opacity-50 disabled:cursor-not-allowed",n.active&&"text-[var(--orb-primary)] bg-[var(--orb-p50)]",n.type==="refresh"&&n.loading&&"animate-spin"),title:n.type,type:"button",children:r(n.type)},`${n.type}-${a}`))})};var xs=({message:t,onStreamingComplete:o,assistantActions:r,streamIntervalMs:n,streamChunkSize:a,cardHooks:i})=>{let s={lineHeight:1.55,fontSize:13,fontWeight:300,fontFamily:'var(--orb-font, "Montserrat", system-ui, sans-serif)',color:"var(--orb-fg, #555555)",borderRadius:"var(--orb-r, 10px)",padding:"10px 14px"},l={marginTop:6,fontSize:11,color:"var(--orb-muted, #8c8c8c)"};if(t.type==="assistant"){let d=!!(r?.isResponding||t.isStreaming);return f("div",{className:"mb-4 flex justify-start",children:g("div",{className:"mr-auto w-full",style:{...s,background:"var(--orb-surface, #f5f5f5)",border:"1px solid var(--orb-border, #dbdbdb)"},children:[f(Lm,{content:t.content,isStreaming:t.isStreaming??false,onComplete:o,streamIntervalMs:n,streamChunkSize:a,messageId:t.id,cardHooks:i}),t.content&&r?.isLatestAssistant&&f("div",{className:"mt-3 flex flex-row justify-start gap-2 border-t pt-2",style:{borderColor:"var(--orb-border, #dbdbdb)"},children:f(Om,{buttons:[{type:"refresh",onClick:()=>{r?.onRegenerate?.();},disabled:d||!r?.onRegenerate,loading:d},{type:"copy",onClick:()=>navigator.clipboard.writeText(t.content),disabled:false},{type:"volume",onClick:()=>console.log("\u8BED\u97F3\u64AD\u653E"),disabled:false},{type:"like",onClick:()=>console.log("\u70B9\u8D5E"),disabled:false},{type:"dislike",onClick:()=>console.log("\u70B9\u8E29"),disabled:false}],size:"sm",variant:"default"})}),f("div",{style:l,children:t.timestamp.toLocaleTimeString()})]})})}return f("div",{className:"mb-4 flex justify-end",children:g("div",{className:"ml-auto max-w-[80%]",style:{...s,background:"var(--orb-p50, #eef2f9)",border:"1px solid var(--orb-p100, #e4e9f5)"},children:[f("div",{className:"whitespace-pre-wrap",children:t.content}),f("div",{style:l,children:t.timestamp.toLocaleTimeString()})]})})};var Fm=({onTextUpdate:t,onComplete:o,onCancel:r,disabled:n,className:a})=>{let{isRecording:i,startRecording:s,stopRecording:l}=Cn({onTextUpdate:t,onComplete:p=>{o?.(p);},onError:p=>{console.error("Voice input error:",p),r?.();}});return f("button",{onClick:async()=>{i?l():await s();},disabled:n,className:ot("transition-all duration-200 flex items-center justify-center rounded-full",i?"bg-[color-mix(in_oklch,var(--orb-status-error)_12%,transparent)] text-[var(--orb-status-error)] hover:bg-[color-mix(in_oklch,var(--orb-status-error)_20%,transparent)] animate-pulse":"bg-transparent hover:bg-[var(--orb-hover)] text-[var(--orb-muted)] active:scale-95",n&&"opacity-50 cursor-not-allowed",a),title:i?"Stop recording":"Start recording",type:"button",children:i?f(ap,{size:16}):f(ip,{size:16})})};var Dt={container:"w-full max-w-4xl mx-auto",inputContainer:ot("w-full flex flex-col border border-[var(--orb-border,#dbdbdb)] bg-[color-mix(in_oklch,var(--orb-canvas)_64%,transparent)] backdrop-blur-[28px] transition-colors duration-200","orb-agent-input","focus-within:border-[var(--orb-primary,#154194)] focus-within:ring-1 focus-within:ring-[var(--orb-focus-ring,#e4e9f5)]"),dragActive:"border-[var(--orb-primary,#154194)] bg-[var(--orb-p50,#eef2f9)]",textareaWrapper:"flex-1 relative flex items-center",textarea:ot("w-full outline-none appearance-none resize-none bg-transparent border-none text-sm font-normal py-3 px-3","placeholder:text-[var(--orb-muted,#8c8c8c)] placeholder:font-normal","text-[var(--orb-fg,#555555)] selection:bg-[var(--orb-p100,#e4e9f5)]","focus:ring-0 focus:outline-none focus:border-none focus:shadow-none","min-h-[44px] max-h-[12em] overflow-y-auto scrollbar-thin scrollbar-thumb-[var(--orb-border)]"),filePreviewArea:"px-4 pt-3 pb-1 flex flex-wrap gap-2",queueArea:"px-4 pt-3 flex flex-col gap-2",queueCard:ot("flex flex-wrap items-center gap-x-3 gap-y-1 px-3 py-2 rounded-lg","bg-[var(--orb-p50,#eef2f9)] border border-[var(--orb-p100,#dbdbdb)]","text-xs text-[var(--orb-fg,#555555)]"),queueContent:"min-w-0 flex-1 truncate font-medium",queueHint:"text-[var(--orb-muted,#8c8c8c)]",queueButton:ot("shrink-0 px-2 py-1 rounded-md text-xs font-semibold cursor-pointer active:scale-95","text-[var(--orb-primary,#154194)] hover:bg-[var(--orb-p50,#eef2f9)]"),queueCancelButton:ot("shrink-0 flex items-center justify-center h-5 w-5 rounded-full cursor-pointer","text-[var(--orb-muted,#8c8c8c)] hover:text-[var(--orb-fg,#555555)] hover:bg-[var(--orb-hover,#eef2f9)]"),fileTag:ot("flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs font-medium","bg-[var(--orb-surface,#f5f5f5)] text-[var(--orb-fg,#555555)]","border border-[var(--orb-border,#dbdbdb)]","transition-all hover:bg-[var(--orb-hover,#eef2f9)]"),buttonBase:"flex items-center justify-center transition-all duration-200 rounded-full",buttonSmall:"h-[38px] w-[38px] shrink-0 md:h-8 md:w-8",buttonNormal:ot("bg-transparent hover:bg-[var(--orb-hover,#eef2f9)] text-[var(--orb-muted,#8c8c8c)] hover:text-[var(--orb-fg,#555555)]","cursor-pointer active:scale-95"),sendButton:ot("cursor-pointer bg-[var(--orb-primary,#154194)] hover:bg-[var(--orb-p600,#0e2d63)] text-[var(--orb-on-primary)] shadow-none active:scale-95"),sendButtonDisabled:ot("cursor-not-allowed opacity-40 bg-[var(--orb-disabled-bg,#f5f5f5)] text-[var(--orb-disabled-fg,#8c8c8c)]"),stopButton:ot("cursor-pointer bg-[var(--orb-err,#c43f02)] hover:opacity-90 text-[var(--orb-on-primary)] shadow-none active:scale-95"),stopSecondary:ot("cursor-pointer border border-[var(--orb-border,#dbdbdb)] text-[var(--orb-muted,#8c8c8c)]","hover:border-[var(--orb-err,#c43f02)] hover:text-[var(--orb-err,#c43f02)] active:scale-95")},FC={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},BC=({enabled:t,onClick:o})=>{let{t:r}=ce();return f("button",{className:ot(Dt.buttonBase,Dt.buttonSmall,Dt.buttonNormal),onClick:o,disabled:!t,"aria-label":r("omph.input.upload"),type:"button",children:f(zd,{size:16})})},HC=({canSend:t,isResponding:o,onSend:r,onStop:n})=>{let{t:a}=ce();return o&&!t?f("button",{className:ot(Dt.buttonBase,Dt.buttonSmall,Dt.stopButton),onClick:n,"aria-label":a("omph.input.stop"),type:"button",children:f(ll,{size:15})}):g(e,{children:[o&&f("button",{className:ot(Dt.buttonBase,Dt.buttonSmall,Dt.stopSecondary),onClick:n,"aria-label":a("omph.input.stop"),type:"button",children:f(ll,{size:14})}),f("button",{className:ot(Dt.buttonBase,Dt.buttonSmall,t?Dt.sendButton:Dt.sendButtonDisabled),onClick:r,disabled:!t,"aria-label":a("omph.input.send"),type:"button",children:f(dp,{size:16,className:t?"text-[var(--orb-on-primary,#ffffff)]":"text-[var(--orb-disabled-fg,#8c8c8c)]"})})]})},Yl=({onSend:t,onStop:o,isResponding:r=false,placeholder:n,getText:a})=>{let[i,s]=useState(""),[l,d]=useState([]),[p,m]=useState(false),[h,f$1]=useState(false),[u,b]=useState([]),C=useRef(null),g$1=useRef(0),{t:x}=ce(),v=x("omph.input.placeholder"),y=v!=="omph.input.placeholder"?v:"Type a message...",k=n||(a?a("00019",y):y),w=i.trim().length>0||l.length>0,P={enabled:true},I=useCallback(Y=>{s(Y.target.value),Y.target.style.height="auto",Y.target.style.height=`${Math.min(Y.target.scrollHeight,200)}px`;},[]),S=useCallback(Y=>{if(Y.target.files&&Y.target.files.length>0){let J=Array.from(Y.target.files);d(le=>{let he=J.filter(be=>le.some(Ce=>Ce.name===be.name&&Ce.size===be.size));he.length>0&&console.warn("Duplicate files ignored:",he.map(be=>be.name));let ze=J.filter(be=>!le.some(Ce=>Ce.name===be.name&&Ce.size===be.size));return [...le,...ze]}),C.current&&(C.current.value="");}},[]),R=useCallback(Y=>{d(J=>J.filter((le,he)=>he!==Y));},[]),N=useCallback(()=>{C.current?.click();},[]),T=useCallback(async()=>{if(!w)return;let Y=i,J=[...l];if(r){g$1.current+=1,b(le=>[...le,{id:g$1.current,content:Y,files:J,confirmed:false}]),s(""),d([]),C.current&&(C.current.value="");return}s(""),d([]),C.current&&(C.current.value="");try{await t(Y,J);}catch(le){console.error("Failed to send message:",le),s(Y),d(J);}},[i,w,r,t,l]),M=useCallback(Y=>{let J=u.find(le=>le.id===Y);J&&(b(le=>le.filter(he=>he.id!==Y)),t(J.content,J.files).catch(()=>s(J.content)));},[u,t]),A=useCallback(Y=>{b(J=>J.map(le=>le.id===Y?{...le,confirmed:true}:le));},[]),L=useCallback(Y=>{b(J=>J.filter(le=>le.id!==Y));},[]);useEffect(()=>{if(r||u.length===0)return;let Y=u;b([]),(async()=>{for(let J of Y)try{await t(J.content,J.files);}catch(le){console.error("Failed to send queued message:",le),s(J.content);}})();},[r,u,t]);let W=useCallback(()=>{b([]),o();},[o]),ee=useCallback(Y=>{Y.key==="Enter"&&!Y.shiftKey&&!p&&(Y.preventDefault(),T());},[T,p]),O=useCallback(()=>{m(true);},[]),_=useCallback(()=>{m(false);},[]),V=useCallback(Y=>{s(Y);},[]),Q=useCallback(Y=>{s(Y);},[]),H=useCallback(()=>{},[]),B=useCallback(Y=>{Y.preventDefault(),f$1(true);},[]),q=useCallback(Y=>{Y.preventDefault(),f$1(false);},[]),Z=useCallback(Y=>{if(Y.preventDefault(),f$1(false),Y.dataTransfer.files&&Y.dataTransfer.files.length>0){let J=Array.from(Y.dataTransfer.files);d(le=>[...le,...J]);}},[]);return f("div",{className:Dt.container,children:g("div",{className:"relative",children:[f("input",{type:"file",multiple:true,className:"hidden",ref:C,onChange:S}),g("div",{className:ot(Dt.inputContainer,h&&Dt.dragActive),onDragOver:B,onDragLeave:q,onDrop:Z,children:[u.length>0&&f("div",{className:Dt.queueArea,children:u.map(Y=>g("div",{className:Dt.queueCard,"data-omph-queue":Y.id,children:[f("span",{className:Dt.queueContent,title:Y.content,children:Y.content}),Y.confirmed?f("span",{className:Dt.queueHint,children:x("omph.input.queue.queued")}):f("span",{className:Dt.queueHint,children:x("omph.input.queue.ask")}),f("button",{className:Dt.queueButton,onClick:()=>M(Y.id),type:"button",children:x("omph.input.queue.sendNow")}),!Y.confirmed&&f("button",{className:Dt.queueButton,onClick:()=>A(Y.id),type:"button",children:x("omph.input.queue.afterTurn")}),f("button",{className:Dt.queueCancelButton,onClick:()=>L(Y.id),"aria-label":x("omph.input.queue.cancel"),type:"button",children:f(sl,{sx:{fontSize:14}})})]},Y.id))}),l.length>0&&f("div",{className:Dt.filePreviewArea,children:l.map((Y,J)=>g("div",{className:Dt.fileTag,children:[f(ep,{sx:{fontSize:16},className:"text-[var(--orb-primary)]"}),f("span",{className:"truncate max-w-[150px]",children:Y.name}),f("button",{onClick:()=>R(J),className:"ml-1 hover:text-[var(--orb-status-error)] focus:outline-none",type:"button",children:f(sl,{sx:{fontSize:16}})})]},`${Y.name}-${J}`))}),g("div",{className:"flex w-full flex-col p-2",children:[f("div",{className:ot(Dt.textareaWrapper,"min-h-[52px] px-2 pb-2 pt-1.5 md:min-h-[44px]"),children:f("textarea",{className:ot(Dt.textarea,"min-h-[24px] py-0 px-0"),placeholder:k,value:i,onChange:I,onKeyDown:ee,onCompositionStart:O,onCompositionEnd:_,style:FC,"aria-label":x("omph.input.message"),spellCheck:false,rows:1})}),g("div",{className:"flex items-center justify-between px-1 pb-0.5",children:[f("div",{className:"flex items-center gap-1",role:"toolbar","aria-label":x("omph.input.tools"),children:f(BC,{enabled:P.enabled,onClick:N})}),g("div",{className:"flex items-center gap-1",children:[f(Fm,{onTextUpdate:V,onComplete:Q,onCancel:H,disabled:r,className:Dt.buttonSmall}),f(HC,{canSend:w,isResponding:r,onSend:T,onStop:W})]})]})]})]})]})})};var zm=({messages:t,onSend:o,onStop:r,onRegenerate:n,isResponding:a=false,className:i,placeholder:s,streamIntervalMs:l,streamChunkSize:d,onMessageStreamingComplete:p,cardHooks:m,showInput:h=true,statusLine:f$1})=>{let u=useRef(null),b=useRef(t.length);return useEffect(()=>{t.length>b.current&&u.current?.scrollIntoView({behavior:"smooth"}),b.current=t.length;},[t]),g("div",{className:ot("flex flex-col h-full w-full relative",i),children:[g("div",{className:"flex-1 overflow-y-auto px-4 py-4 space-y-6 scrollbar-thin scrollbar-thumb-[var(--orb-border)]",children:[t.map((C,g)=>{let x=C.type==="assistant"&&g===t.length-1,v=C.type==="assistant"?{isLatestAssistant:x,isResponding:a,onRegenerate:n?()=>n(C.id):void 0}:void 0;return f(xs,{message:C,assistantActions:v,onStreamingComplete:()=>p?.(C.id),streamIntervalMs:l,streamChunkSize:d,cardHooks:m},C.id)}),f$1,f("div",{ref:u})]}),h&&f("div",{className:"border-t border-[var(--orb-border,#dbdbdb)] bg-[var(--orb-canvas,#ffffff)] p-4 z-10",children:f(Yl,{onSend:o||(async()=>{}),onStop:r||(()=>{}),isResponding:a,placeholder:s})})]})};var Vm={idle:"Idle",running:"Working",success:"Success",error:"Error",pending:"Pending"},Wm=({title:t="AI Agent",description:o,headerActions:r,className:n,agentStatus:a,statusText:i,onHeaderPointerDown:s,showInput:l=false,...d})=>{let p=a??(d.isResponding?"running":"idle"),m=p==="running"||p==="pending",h=[Vm[p],o].filter(Boolean).join(" \xB7 ");return g("div",{className:ot("orb-agent-panel",n),children:[g("div",{className:ot("orb-agent-header",s&&"cursor-grab active:cursor-grabbing"),onPointerDown:s,children:[f("span",{className:"orb-agent-avatar","aria-hidden":"true",children:"AI"}),g("div",{className:"min-w-0 flex-1",children:[f("div",{className:"orb-agent-title",children:t}),g("div",{className:"orb-agent-subtitle",children:[f("span",{className:"orb-agent-dot","data-active":m||void 0}),f("span",{className:"truncate",children:h||"Agent"})]})]}),r&&f("div",{className:"ml-auto flex flex-none items-center gap-1",children:r})]}),f("div",{className:"relative min-h-0 flex-1",children:f(zm,{...d,showInput:l,statusLine:m?g("div",{className:ot("orb-agent-status-line","mb-1"),children:[f("span",{className:"orb-agent-spinner","aria-hidden":"true"}),f("span",{children:i??`${Vm[p]}\u2026`})]}):void 0})})]})};var $C=t=>Number.isNaN(t.getTime())?"":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(t),_m=({conversations:t,activeConversationId:o,labels:r,onNewConversation:n,onSelectConversation:a})=>{let[i,s]=useState(false),l=useRef(null),d=useRef(null),p=useRef(null),m=useId(),h=!!a;useEffect(()=>{if(!i)return;let u=C=>{l.current?.contains(C.target)||s(false);},b=C=>{C.key==="Escape"&&(C.stopPropagation(),s(false),p.current?.focus());};return document.addEventListener("pointerdown",u),document.addEventListener("keydown",b),()=>{document.removeEventListener("pointerdown",u),document.removeEventListener("keydown",b);}},[i]),useEffect(()=>{if(!i)return;let u=d.current?.querySelector('[aria-selected="true"]'),b=d.current?.querySelector('[role="option"]');(u??b)?.focus();},[i]);let f$1=u=>{let b=Array.from(d.current?.querySelectorAll('[role="option"]')??[]);if(b.length===0)return;let C=b.findIndex(x=>x===document.activeElement),g=C<0?u===1?0:b.length-1:(C+u+b.length)%b.length;b[g]?.focus();};return !n&&!h?null:g(e,{children:[n&&f("button",{type:"button",className:"orb-omph-icon-btn","aria-label":r.newConversation,onClick:()=>{s(false),n();},children:f(jr,{size:16})}),h&&a&&g("div",{className:"orb-omph-conversation-anchor",ref:l,children:[f("button",{ref:p,type:"button",className:"orb-omph-icon-btn","aria-label":r.conversationList,"aria-expanded":i,"aria-controls":m,onClick:()=>s(u=>!u),children:f(_c,{size:16})}),i&&f("div",{ref:d,id:m,className:"orb-omph-conversations",role:"listbox","aria-label":r.conversations,onKeyDown:u=>{u.key==="ArrowDown"?(u.preventDefault(),f$1(1)):u.key==="ArrowUp"&&(u.preventDefault(),f$1(-1));},children:t.length===0?f("p",{className:"orb-omph-conversation-empty",children:r.noConversations}):t.map(u=>{let b=u.updatedAt?$C(u.updatedAt):"",C=[u.preview,b].filter(x=>x&&x.length>0).join(" \xB7 "),g$1=u.id===o;return g("button",{type:"button",role:"option",className:"orb-omph-conversation","aria-selected":g$1,"data-active":g$1||void 0,onClick:()=>{a(u.id),s(false);},children:[f("span",{className:"orb-omph-conversation-title",children:u.title}),C&&f("span",{className:"orb-omph-conversation-meta",children:C})]},u.id)})})]})]})};var _C=t=>{let o=0;for(let r=0;r<t.length;r+=1){let n=t.charCodeAt(r);if(n<65||n>90)break;o=o*26+(n-64);}return o-1},GC=/^\$?([A-Za-z]+)\$?\d+$/,Gm=t=>{let o=[];return t.querySelectorAll("t").forEach(r=>o.push(r.textContent??"")),o.join("")},ws=t=>new DOMParser().parseFromString(t,"application/xml"),UC="http://schemas.openxmlformats.org/officeDocument/2006/relationships",Um=async t=>{let{default:o}=await import('jszip'),r=await o.loadAsync(t),n=[],a=r.file("xl/sharedStrings.xml");a&&ws(await a.async("string")).querySelectorAll("si").forEach(u=>n.push(Gm(u)));let i=r.file("xl/workbook.xml");if(!i)throw new Error("Not an xlsx workbook");let s=ws(await i.async("string")),l=new Map,d=r.file("xl/_rels/workbook.xml.rels");d&&ws(await d.async("string")).querySelectorAll("Relationship").forEach(u=>{let b=u.getAttribute("Id"),C=u.getAttribute("Target");b&&C&&l.set(b,C.startsWith("xl/")?C:`xl/${C.replace(/^\//,"")}`);});let p=2e5,m=[],h=Array.from(s.querySelectorAll("sheet"));for(let f of h){let u=f.getAttribute("name")??`Sheet${m.length+1}`,b=f.getAttributeNS(UC,"id"),C=b&&l.get(b)||`xl/worksheets/sheet${m.length+1}.xml`,g=r.file(C);if(!g)continue;let x=ws(await g.async("string")),v=[],y=false;for(x.querySelectorAll("row").forEach(k=>{if(v.length>=5e3||p<=0){y=true;return}let w=[];k.querySelectorAll("c").forEach(P=>{if(p<=0)return;let I=P.getAttribute("r")??"",S=GC.exec(I),R=S?_C(S[1].toUpperCase()):w.length;if(R<0)return;let N=P.getAttribute("t"),T="";if(N==="inlineStr"){let M=P.querySelector("is");T=M?Gm(M):"";}else {let M=P.querySelector("v")?.textContent??"";N==="s"?T=n[Number(M)]??"":N==="b"?T=M==="1"?"TRUE":"FALSE":T=M;}T!==""&&(w[R]=T,p-=1);}),v.push(Array.from(w,P=>P??""));});v.length>0&&v[v.length-1].every(k=>k==="");)v.pop();m.push({name:u,rows:v,truncated:y});}if(m.length===0)throw new Error("No worksheets found");return m},Km=t=>t.map(o=>{let r=[...o];for(;r.length>0&&r[r.length-1]==="";)r.pop();return r.join(" ")}).join(`
18
- `);var ZC=2e3,YC=1/3,Ss=[.25,.5,.75,1,1.5,2,3,4],QC=100,jC=500,JC=100,ex=9,tx=1e3,qm=14,Xm={color:"inherit",background:"transparent",textShadow:"none",fontFamily:"inherit",fontSize:"inherit",lineHeight:"inherit",textAlign:"left",wordSpacing:"normal",wordBreak:"normal",overflowWrap:"normal",tabSize:"inherit",hyphens:"none"},Ym=({text:t,language:o,startLine:r,endLine:n,wrap:a,labels:i})=>{let s=useRef(null),l=useMemo(()=>{let m=t.split(`
19
- `);m.length>1&&m[m.length-1]===""&&m.pop();let h=Math.min(m.length,ZC);return {shown:m.slice(0,h).join(`
20
- `),shownCount:h,total:m.length}},[t]),d=useCallback(m=>{let h=n??r,f=r!==void 0&&h!==void 0&&m>=r&&m<=h;return {className:"orb-omph-code-line","data-line":m,...f?{"data-hit":"true"}:{}}},[n,r]);useEffect(()=>{let m=s.current,h=m?.closest(".orb-omph-pv-body");if(!m||!h)return;if(r===void 0){h.scrollTop=0;return}let f=m.querySelector(`[data-line="${r}"]`);if(!f)return;let u=f.getBoundingClientRect().top-h.getBoundingClientRect().top+h.scrollTop;h.scrollTop=Math.max(0,u-h.clientHeight*YC);},[r,l.shown]);let p={"--orb-omph-digits":String(l.shownCount).length};return g("div",{ref:s,className:"orb-omph-code","data-wrap":a||void 0,style:p,children:[f(Prism,{language:o,useInlineStyles:false,PreTag:"div",CodeTag:"div",showLineNumbers:true,wrapLines:true,lineProps:d,customStyle:Xm,codeTagProps:{className:`language-${o}`,style:Xm},children:l.shown}),l.total>l.shownCount&&f("div",{className:"orb-omph-pv-note",children:i.previewTruncated(l.shownCount,l.total)})]})},Qm=({text:t})=>f("div",{className:"orb-omph-pv-doc",children:f(In,{content:t})}),jm=({url:t,alt:o,labels:r})=>{let[n,a]=useState("fit"),[i,s]=useState(null),[l,d]=useState(false),p=n==="fit"?1:n,m=Ss.some(b=>b>p),h=Ss.some(b=>b<p),f$1=b=>a(C=>{let g=C==="fit"?1:C;return (b>0?Ss.find(v=>v>g):[...Ss].reverse().find(v=>v<g))??C}),u=n==="fit"||i===null?{maxWidth:"100%",height:"auto"}:{width:i*n,maxWidth:"none",height:"auto"};return l?f("div",{className:"orb-omph-pv-note",role:"alert",children:o?`${r.imageFailed} \xB7 ${o}`:r.imageFailed}):g("div",{className:"orb-omph-img",children:[f("div",{className:"orb-omph-img-stage",children:f("img",{src:t,alt:o??"",draggable:false,style:u,onLoad:b=>s(b.currentTarget.naturalWidth),onError:()=>d(true)})}),g("div",{className:"orb-omph-img-zoom",role:"group","aria-label":r.zoomFit,children:[f("button",{type:"button","aria-label":r.zoomOut,disabled:!h,onClick:()=>f$1(-1),children:"\u2212"}),f("button",{type:"button","aria-label":r.zoomFit,"data-active":n==="fit"||void 0,onClick:()=>a("fit"),children:n==="fit"?r.zoomFit:`${Math.round(n*QC)}%`}),f("button",{type:"button","aria-label":r.zoomIn,disabled:!m,onClick:()=>f$1(1),children:"+"})]})]})},ox=t=>{let o=t+1,r="";for(;o>0;){let n=(o-1)%26;r=String.fromCharCode(65+n)+r,o=Math.floor((o-1)/26);}return r},Jm=({body:t,labels:o})=>{let[r,n]=useState({status:"parsing"}),[a,i]=useState(0),[s,l]=useState(false);useEffect(()=>{let h=false,f=new AbortController;return n({status:"parsing"}),(async()=>{if(t.bytes)return t.bytes;if(!t.url)throw new Error("Sheet body has neither bytes nor url");let b=await fetch(t.url,{signal:f.signal});if(!b.ok)throw new Error(`HTTP ${b.status}`);return b.arrayBuffer()})().then(b=>Um(b)).then(b=>{h||(i(0),n({status:"ready",sheets:b}));}).catch(b=>{h||b instanceof DOMException&&b.name==="AbortError"||n({status:"error",message:b instanceof Error?b.message:String(b)});}),()=>{h=true,f.abort();}},[t]),useEffect(()=>{if(!s)return;let h=window.setTimeout(()=>l(false),tx);return ()=>window.clearTimeout(h)},[s]);let d=r.status==="ready"?r.sheets[Math.min(a,r.sheets.length-1)]:null,p=useMemo(()=>{if(!d)return null;let h=Math.min(d.rows.reduce((u,b)=>Math.max(u,b.length),0),JC),f=d.rows.slice(0,jC);return {columnCount:h,shownRows:f}},[d]);if(r.status==="parsing")return f("div",{className:"orb-omph-pv-skel",role:"status","aria-label":o.previewLoading,children:Array.from({length:ex},(h,f$1)=>f("span",{},f$1))});if(r.status==="error")return g("div",{className:"orb-omph-pv-note",role:"alert",children:[o.previewFailed," \xB7 ",r.message]});if(!d||!p)return null;let m=d.truncated||d.rows.length>p.shownRows.length;return g("div",{className:"orb-omph-sheet",children:[g("div",{className:"orb-omph-sheet-bar",children:[f("div",{className:"orb-omph-sheet-tabs",role:"tablist",children:r.sheets.map((h,f$1)=>f("button",{type:"button",role:"tab","aria-selected":f$1===a,"data-active":f$1===a||void 0,className:"orb-omph-sheet-tab",onClick:()=>i(f$1),children:h.name},h.name))}),f("button",{type:"button",className:"orb-omph-icon-button","aria-label":s?o.copied:o.previewCopyContent,title:s?o.copied:o.previewCopyContent,onClick:()=>{navigator.clipboard.writeText(Km(d.rows)).then(()=>l(true));},children:s?f(xo,{size:qm}):f(No,{size:qm})})]}),g("div",{className:"orb-omph-sheet-scroll",children:[g("table",{className:"orb-omph-sheet-grid",children:[f("thead",{children:g("tr",{children:[f("th",{className:"orb-omph-sheet-corner","aria-label":d.name}),Array.from({length:p.columnCount},(h,f$1)=>f("th",{scope:"col",children:ox(f$1)},f$1))]})}),f("tbody",{children:p.shownRows.map((h,f$1)=>g("tr",{children:[f("th",{scope:"row",children:f$1+1}),Array.from({length:p.columnCount},(u,b)=>f("td",{children:h[b]??""},b))]},f$1))})]}),d.rows.length===0&&f("div",{className:"orb-omph-pv-note",children:o.previewUnsupported}),m&&f("div",{className:"orb-omph-pv-note",children:o.previewSheetTruncated(p.shownRows.length,d.rows.length)})]})]})};var rx=/^[a-z][a-z0-9+.-]*:/i,nx=/^L(\d+)(?:-L?(\d+))?$/i;var eg=["B","KB","MB","GB"];var ax=t=>{try{return decodeURIComponent(t)}catch{return t}},Jl=t=>{let o=t.trim();if(!o||o.startsWith("#")||o.startsWith("//")||rx.test(o))return null;let r=o.indexOf("#"),n=r>=0?o.slice(0,r):o,a=r>=0?o.slice(r+1):"",i=n.indexOf("?"),s=ax(i>=0?n.slice(0,i):n);if(!s||s.endsWith("/"))return null;let l=nx.exec(a);if(!l)return {path:s};let d=Number(l[1]);if(d<1)return {path:s};let p=l[2]?Number(l[2]):d;return {path:s,startLine:d,endLine:Math.max(d,p)}},ks=t=>t.split("/").filter(Boolean).pop()??t,og=t=>{let o=t.split("/");return o.pop(),o.join("/")},Ps=t=>{let o=ks(t),r=o.lastIndexOf(".");return r>0?o.slice(r+1).toLowerCase():""},rg={prism:"text",label:"Text"},tg={ts:{prism:"typescript",label:"TypeScript"},tsx:{prism:"tsx",label:"TSX"},js:{prism:"javascript",label:"JavaScript"},mjs:{prism:"javascript",label:"JavaScript"},cjs:{prism:"javascript",label:"JavaScript"},jsx:{prism:"jsx",label:"JSX"},json:{prism:"json",label:"JSON"},py:{prism:"python",label:"Python"},java:{prism:"java",label:"Java"},go:{prism:"go",label:"Go"},rs:{prism:"rust",label:"Rust"},c:{prism:"c",label:"C"},h:{prism:"c",label:"C"},cpp:{prism:"cpp",label:"C++"},cs:{prism:"csharp",label:"C#"},sql:{prism:"sql",label:"SQL"},sh:{prism:"bash",label:"Shell"},bash:{prism:"bash",label:"Shell"},yml:{prism:"yaml",label:"YAML"},yaml:{prism:"yaml",label:"YAML"},xml:{prism:"markup",label:"XML"},html:{prism:"markup",label:"HTML"},css:{prism:"css",label:"CSS"},scss:{prism:"scss",label:"SCSS"},abap:{prism:"abap",label:"ABAP"},toml:{prism:"toml",label:"TOML"},ini:{prism:"ini",label:"INI"},md:{prism:"markdown",label:"Markdown"},csv:{prism:"text",label:"CSV"},log:{prism:"text",label:"Log"},txt:rg},ec=(t,o)=>o?Object.values(tg).find(n=>n.prism===o)??{prism:o,label:o}:tg[Ps(t)]??rg,ng=t=>{let o=t,r=0;for(;o>=1024&&r<eg.length-1;)o/=1024,r+=1;return `${r>0&&o<10?o.toFixed(1):Math.round(o).toString()} ${eg[r]}`};var ix=1e3,sx=9,qo=16,lx={markdown:"text/markdown;charset=utf-8",code:"text/plain;charset=utf-8"},cx="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",Ts=(t,o)=>{let r=URL.createObjectURL(t),n=document.createElement("a");n.href=r,n.download=o,n.click(),window.setTimeout(()=>URL.revokeObjectURL(r),1e3);},tc=({tone:t,icon:o,title:r,text:n,action:a})=>g("div",{className:"orb-omph-pv-notice","data-tone":t,role:t==="error"?"alert":void 0,children:[f("span",{className:"orb-omph-pv-notice-icon","aria-hidden":"true",children:o}),f("div",{className:"orb-omph-pv-notice-title",children:r}),n&&f("p",{className:"orb-omph-pv-notice-text",children:n}),a]}),sg=({state:t,placement:o,expanded:r,canExpand:n,labels:a,gripProps:i,paneRef:s,onClose:l,onRetry:d,onToggleExpand:p,onOpenExternally:m})=>{let[h,f$1]=useState(true),[u,b]=useState(false),{open:C,ref:g$1,phase:x,data:v}=t,y=v?.body;useEffect(()=>{if(!u)return;let O=window.setTimeout(()=>b(false),ix);return ()=>window.clearTimeout(O)},[u]),useEffect(()=>{C&&s.current?.focus({preventScroll:true});},[C,s,g$1?.path]);let k=v?.absolutePath??g$1?.path??"",w=y&&(y.kind==="markdown"||y.kind==="code")?y.text:k,P=w===k?a.previewCopyPath:a.previewCopyContent,I=y?.kind==="code"&&g$1?ec(g$1.path,y.language):null,S=!!(y&&(y.kind==="markdown"||y.kind==="code")&&y.previewOnly),R=!!(g$1&&y&&!S&&(y.kind==="markdown"||y.kind==="code"||y.kind==="image"||y.kind==="embed"||y.kind==="sheet")),N=()=>{if(!y||!g$1)return;let O=ks(k);if(y.kind==="markdown"&&!/\.(md|markdown|txt)$/i.test(O)&&(O=`${O}.md`),y.kind==="markdown"||y.kind==="code"){Ts(new Blob([y.text],{type:lx[y.kind]}),O);return}if(y.kind==="sheet"){if(y.fileName&&(O=y.fileName),/\.(xlsx|xlsm|xls|csv)$/i.test(O)||(O=`${O}.xlsx`),y.bytes){let _=y.bytes instanceof Uint8Array?y.bytes.slice().buffer:y.bytes;Ts(new Blob([_],{type:cx}),O);return}y.url&&fetch(y.url).then(_=>{if(!_.ok)throw new Error(`HTTP ${_.status}`);return _.blob()}).then(_=>Ts(_,O)).catch(()=>window.open(y.url,"_blank","noopener"));return}(y.kind==="image"||y.kind==="embed")&&fetch(y.url).then(_=>{if(!_.ok)throw new Error(`HTTP ${_.status}`);return _.blob()}).then(_=>Ts(_,O)).catch(()=>window.open(y.url,"_blank","noopener"));},T=[];I&&T.push(I.label),y?.kind==="markdown"&&T.push("Markdown"),y?.kind==="image"&&g$1&&T.push(Ps(g$1.path).toUpperCase()),y?.kind==="sheet"&&g$1&&T.push(Ps(g$1.path).toUpperCase()||"XLSX"),v?.size!==void 0&&T.push(ng(v.size)),y?.kind==="code"&&g$1?.startLine!==void 0&&T.push(a.previewLines(g$1.startLine,g$1.endLine??g$1.startLine));let M=O=>{O.key==="Escape"&&(O.stopPropagation(),l(true));},A=f("button",{type:"button",className:"orb-omph-pv-action",onClick:d,children:a.previewRetry}),L=()=>{if(!g$1)return null;if(x==="loading")return f("div",{className:"orb-omph-pv-skel",role:"status","aria-label":a.previewLoading,children:Array.from({length:sx},(O,_)=>f("span",{},_))});if(x==="error"||!y)return f(tc,{tone:"error",icon:f(Ia,{size:qo}),title:a.previewFailed,text:k,action:A});switch(y.kind){case "missing":return f(tc,{tone:"neutral",icon:f(Na,{size:qo}),title:a.previewMissing,text:y.message??k});case "unsupported":return f(tc,{tone:"neutral",icon:f(Na,{size:qo}),title:a.previewUnsupported,text:y.message??k,action:m&&f("button",{type:"button",className:"orb-omph-pv-action",onClick:()=>m(g$1),children:a.previewOpenExternal})});case "markdown":return f(Qm,{text:y.text},g$1.path);case "code":return f(Ym,{text:y.text,language:ec(g$1.path,y.language).prism,startLine:g$1.startLine,endLine:g$1.endLine,wrap:h,labels:a},g$1.path);case "image":return f(jm,{url:y.url,alt:y.alt,labels:a},y.url);case "sheet":return f(Jm,{body:y,labels:a},g$1.path);case "embed":return f("iframe",{src:y.url,title:y.caption??a.previewTitle,className:"orb-omph-pv-embed"},y.url);default:return null}},W=o==="overlay",ee=y?.kind==="image"?Hc:Na;return g("aside",{ref:s,className:"orb-omph-preview","data-open":C||void 0,"data-placement":o,role:W?"dialog":"complementary","aria-label":a.previewTitle,"aria-hidden":!C||void 0,tabIndex:-1,onKeyDown:M,children:[!W&&C&&f("div",{className:"orb-omph-pv-grip","aria-label":a.previewResize,...i}),g("div",{className:"orb-omph-pv",children:[g("header",{className:"orb-omph-pv-head",children:[W&&f("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewBack,onClick:()=>l(true),children:f(Ra,{size:qo})}),f("span",{className:"orb-omph-pv-glyph","aria-hidden":"true",children:f(ee,{size:qo})}),g("div",{className:"orb-omph-pv-titles",children:[f("div",{className:"orb-omph-pv-name",title:k,children:g$1?ks(k):""}),f("div",{className:"orb-omph-pv-path",title:k,children:f("bdi",{children:og(k)})})]}),g("div",{className:"orb-omph-pv-actions",children:[y?.kind==="code"&&f("button",{type:"button",className:"orb-omph-text-button","aria-pressed":h,onClick:()=>f$1(O=>!O),children:a.previewWrap}),R&&f("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewDownload,title:a.previewDownload,onClick:N,children:f(Fn,{size:qo})}),S&&g$1&&m&&f("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewOpenExternal,title:a.previewOpenExternal,onClick:()=>m(g$1),children:f(Fn,{size:qo})}),g$1&&f("button",{type:"button",className:"orb-omph-icon-button","aria-label":u?a.copied:P,title:u?a.copied:P,onClick:()=>{navigator.clipboard.writeText(w).then(()=>b(true));},children:u?f(xo,{size:qo}):f(No,{size:qo})}),n&&f("button",{type:"button",className:"orb-omph-icon-button","aria-pressed":r,"aria-label":r?a.previewCollapse:a.previewExpand,title:r?a.previewCollapse:a.previewExpand,onClick:p,children:f(Lc,{size:qo})}),!W&&f("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewClose,onClick:()=>l(true),children:f(Kt,{size:qo})})]})]}),f("div",{className:"orb-omph-pv-meta",children:T.join(" \xB7 ")}),f("div",{className:"orb-omph-pv-body","data-kind":x==="ready"?y?.kind:void 0,children:L()})]})]})};var px=1e3,lg=50,ux=1e3,mx=t=>t==="tool"?Jr:t==="command"?zn:Gc,dg=t=>!!t.streaming||t.status==="running"||t.status==="pending",gx=(t,o)=>o==="expanded"?true:dg(t),hx=t=>t!==void 0&&(t.inputTokens!==void 0||t.outputTokens!==void 0||t.durationMs!==void 0),fx=(t,o)=>`${Math.max(1,Math.round(t/ux))}${o.secondUnit}`,bx=({content:t})=>{let o=useRef(null),[r,n]=useState(false);return useEffect(()=>{let a=o.current;if(!a)return;let i=()=>n(a.scrollHeight>a.clientHeight+1);i();let s=new ResizeObserver(i);return s.observe(a),()=>s.disconnect()},[t]),f("div",{ref:o,className:"orb-omph-process-body","data-overflow":r||void 0,children:t})},vx=({turn:t,labels:o})=>{let[r,n]=useState(false),[a,i]=useState(false),s=t.assistant?.content??"",l=t.usage;return useEffect(()=>{if(!r)return;let d=window.setTimeout(()=>n(false),px);return ()=>window.clearTimeout(d)},[r]),g("div",{className:"orb-omph-turn-actions",role:"group","aria-label":o.turnActions,children:[f("span",{className:"orb-omph-actions-time",children:t.assistant?.timestamp.toLocaleTimeString()}),hx(l)&&g(e,{children:[f("span",{className:"orb-omph-actions-divider","aria-hidden":"true"}),f("button",{type:"button",className:"orb-omph-text-button","aria-expanded":a,onClick:()=>i(d=>!d),children:o.usage})]}),f("button",{type:"button",className:"orb-omph-icon-button orb-omph-actions-end","aria-label":r?o.copied:o.copy,onClick:()=>{navigator.clipboard.writeText(s).then(()=>n(true));},children:r?f(xo,{size:14}):f(No,{size:14})}),a&&l&&g("div",{className:"orb-omph-usage",children:[l.inputTokens!==void 0&&g("span",{children:[o.inputTokens," ",l.inputTokens.toLocaleString()]}),l.outputTokens!==void 0&&g("span",{children:[o.outputTokens," ",l.outputTokens.toLocaleString()]}),l.durationMs!==void 0&&g("span",{children:[o.duration," ",fx(l.durationMs,o)]})]})]})},yx=({item:t,display:o,open:r,onToggle:n})=>{let a=mx(t.kind),i=dg(t),s=o!=="compact"&&!!t.summary,l=r&&!!t.content;return g("div",{className:"orb-omph-process","data-status":t.status,"data-open":r||void 0,children:[g("button",{type:"button",className:"orb-omph-process-toggle","aria-expanded":r,onClick:n,children:[f(Bo,{size:12,className:"orb-omph-process-chevron"}),f(a,{size:14}),f("span",{className:i?"orb-omph-shimmer":void 0,children:t.title}),s&&f("span",{className:"orb-omph-process-summary",children:t.summary})]}),l&&t.content&&f(bx,{content:t.content}),r&&t.streaming&&f("span",{className:"orb-omph-caret","aria-hidden":"true"})]})},oc=t=>{let o=t.user?.content||t.assistant?.content||t.id,r=o.split(`
21
- `).find(n=>n.trim())??o;return r.length>lg?`${r.slice(0,lg)}\u2026`:r},Cx=0,pg=({turns:t,labels:o,processDisplay:r,cardHooks:n,resolveFileLink:a,onOpenFile:i})=>{let[s,l]=useState({}),d=p=>{if(!i||p.defaultPrevented||p.button!==Cx||p.metaKey||p.ctrlKey||p.shiftKey||p.altKey)return;let m=p.target.closest("a[href]");if(!m)return;let h=a(m.getAttribute("href")??"");h&&(p.preventDefault(),i(h,m));};return f(e,{children:t.map((p,m)=>{let h=!!(p.assistant&&!p.assistant.streaming),u=m===t.length-1&&h?"always":"hover";return g("article",{className:"orb-omph-turn","data-omph-turn":p.id,"data-actions-reveal":u,children:[p.user&&g("div",{className:"orb-omph-user",children:[f("div",{className:"orb-omph-user-bubble","data-queued":p.user.queued||void 0,children:p.user.content}),g("div",{className:"orb-omph-user-meta",children:[p.user.queued&&f("span",{className:"orb-omph-user-queued",children:o.supplementQueued}),f("span",{className:"orb-omph-clock",children:p.user.timestamp.toLocaleTimeString()})]})]}),p.process&&p.process.length>0&&f("div",{className:"orb-omph-process-list",children:p.process.map(b=>{let C=b.id in s?s[b.id]:gx(b,r);return f(yx,{item:b,display:r,open:C,onToggle:()=>l(g=>({...g,[b.id]:!C}))},b.id)})}),p.assistant&&g("div",{className:"orb-omph-assistant","data-file-links":i?"true":void 0,onClick:d,children:[f(Cs,{content:p.assistant.content,messageId:p.assistant.id,cardHooks:n}),p.assistant.streaming&&f("span",{className:"orb-omph-caret","aria-hidden":"true"})]}),p.failure&&f("div",{className:"orb-omph-failure","data-severity":p.failure.severity,children:p.failure.content}),h&&f(vx,{turn:p,labels:o})]},p.id)})})};var rc=t=>({idle:t("omph.status.idle"),pending:t("omph.status.pending"),running:t("omph.status.running"),success:t("omph.status.success"),error:t("omph.status.error"),working:t("omph.working"),workingFor:o=>t("omph.workingFor",{duration:o}),loadOlder:t("omph.loadOlder"),loadingOlder:t("omph.loadingOlder"),toBottom:t("omph.toBottom"),copy:t("omph.copy"),copied:t("omph.copied"),turnActions:t("omph.turnActions"),usage:t("omph.usage"),inputTokens:t("omph.inputTokens"),outputTokens:t("omph.outputTokens"),duration:t("omph.duration"),send:t("omph.send"),stop:t("omph.stop"),supplementQueued:t("omph.supplement.queued"),turnRail:t("omph.turnRail"),secondUnit:t("omph.secondUnit"),minuteUnit:t("omph.minuteUnit"),previewTitle:t("omph.preview.title"),previewClose:t("omph.preview.close"),previewBack:t("omph.preview.back"),previewExpand:t("omph.preview.expand"),previewCollapse:t("omph.preview.collapse"),previewCopyContent:t("omph.preview.copyContent"),previewCopyPath:t("omph.preview.copyPath"),previewDownload:t("omph.preview.download"),previewOpenExternal:t("omph.preview.openExternal"),previewWrap:t("omph.preview.wrap"),previewLoading:t("omph.preview.loading"),previewMissing:t("omph.preview.missing"),previewFailed:t("omph.preview.failed"),previewUnsupported:t("omph.preview.unsupported"),previewRetry:t("omph.preview.retry"),previewResize:t("omph.preview.resize"),previewLines:(o,r)=>t(o===r?"omph.preview.line":"omph.preview.lines",{start:o,end:r}),previewTruncated:(o,r)=>t("omph.preview.truncated",{shown:o,total:r}),previewSheetTruncated:(o,r)=>t("omph.preview.sheetTruncated",{shown:o,total:r}),imageFailed:t("omph.preview.imageFailed"),zoomIn:t("omph.preview.zoomIn"),zoomOut:t("omph.preview.zoomOut"),zoomFit:t("omph.preview.zoomFit"),newConversation:t("omph.newConversation"),conversationList:t("omph.conversationList"),conversations:t("omph.conversations"),noConversations:t("omph.noConversations")}),nc=t=>({waiting:t("omph.approval.waiting"),choose:t("omph.approval.choose"),details:t("omph.approval.details"),choices:t("omph.approval.choices"),reject:t("omph.approval.reject"),allowOnce:t("omph.approval.allowOnce"),confirm:t("omph.approval.confirm"),other:t("omph.approval.other"),otherPlaceholder:t("omph.approval.otherPlaceholder"),escalation:o=>t("omph.approval.escalation",{toolName:o})});var xx=1e3,ug=60,wx=1e3,mg=(t,o)=>{let r=Math.max(1,Math.round(Math.max(t,wx)/xx)),n=Math.floor(r/ug),a=r%ug;return n<=0?`${r}${o.secondUnit}`:`${n}${o.minuteUnit} ${a}${o.secondUnit}`};var Px={open:false,ref:null,phase:"loading",data:null},gg=t=>{let[o,r]=useState(Px),n=useRef(o);n.current=o;let a=useRef(t);a.current=t;let i=useRef(null),s=useRef(0),l=useRef(null),d=useCallback(f=>{let u=a.current;if(!u)return;i.current?.abort();let b=new AbortController;i.current=b,s.current+=1;let C=s.current;r({open:true,ref:f,phase:"loading",data:null}),u(f,b.signal).then(g=>{C===s.current&&r(x=>({...x,phase:"ready",data:g}));},()=>{C!==s.current||b.signal.aborted||r(g=>({...g,phase:"error",data:null}));});},[]),p=useCallback((f,u)=>{l.current=u??null;let b=n.current;if(b.ref?.path===f.path&&b.phase==="ready"){r({...b,open:true,ref:f});return}d(f);},[d]),m=useCallback((f=false)=>{s.current+=1,i.current?.abort(),r(b=>({...b,open:false}));let u=l.current;f&&u?.isConnected&&u.focus({preventScroll:true});},[]),h=useCallback(()=>{let{ref:f}=n.current;f&&d(f);},[d]);return useEffect(()=>()=>{i.current?.abort();},[]),{state:o,open:p,close:m,reload:h}};var ic="--orb-omph-pv-w",sc="--orb-omph-pv-pref",Mx=880,Rx=560,fg=400,$r=320,Dx=.45,Nx=.7,bg=24,ac=(t,o,r)=>Math.min(Math.max(t,o),Math.max(o,r)),vg=({open:t,layout:o})=>{let r=useRef(null),n=useRef(null),[a,i]=useState(0),[s,l]=useState(null),[d,p]=useState(false),[m,h]=useState(false);useLayoutEffect(()=>{let P=r.current;if(!P)return;let I=()=>i(P.getBoundingClientRect().width);I();let S=new ResizeObserver(I);return S.observe(P),()=>S.disconnect()},[]),useEffect(()=>{t||p(false);},[t]);let f=o==="overlay"?false:o==="split"?a>=fg+$r:a>=Mx,u=f&&!d?"split":"overlay",b=Math.max($r,Math.min(a*Nx,a-fg)),C=ac(s??a*Dx,$r,b),g=a>0&&a<Rx,x=useCallback(P=>{let I=r.current;I&&(I.style.setProperty(sc,`${P}px`),I.dataset.placement==="split"&&I.dataset.open==="true"&&I.style.setProperty(ic,`${P}px`));},[]),v=useCallback(P=>{P.button===0&&(P.preventDefault(),P.currentTarget.setPointerCapture(P.pointerId),n.current={pointerId:P.pointerId,startX:P.clientX,startWidth:C,latest:C},h(true));},[C]),y=useCallback(P=>{let I=n.current;!I||I.pointerId!==P.pointerId||(I.latest=ac(I.startWidth+(I.startX-P.clientX),$r,b),x(I.latest));},[b,x]),k=useCallback(P=>{let I=n.current;!I||I.pointerId!==P.pointerId||(n.current=null,P.currentTarget.hasPointerCapture(P.pointerId)&&P.currentTarget.releasePointerCapture(P.pointerId),l(I.latest),h(false));},[]),w=useCallback(P=>{let I={ArrowLeft:C+bg,ArrowRight:C-bg,Home:$r,End:b};P.key in I&&(P.preventDefault(),l(ac(I[P.key],$r,b)));},[b,C]);return {mainRef:r,placement:u,width:C,compact:g,dragging:m,expanded:d,canExpand:f,toggleExpanded:()=>p(P=>!P),gripProps:{role:"separator","aria-orientation":"vertical","aria-valuemin":$r,"aria-valuemax":Math.round(b),"aria-valuenow":Math.round(C),tabIndex:0,onPointerDown:v,onPointerMove:y,onPointerUp:k,onPointerCancel:k,onKeyDown:w}}};var Ds=48,Ex=900,Cg=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,xg=({turns:t,contentVersion:o,hasOlder:r=false,loadingOlder:n=false,onLoadOlder:a})=>{let i=useRef(null),s=useRef(null),l=useRef(true),d=useRef({height:0,top:0}),p=useRef(void 0),m=useRef(false),[h,f]=useState(true),[u,b]=useState(false),[C,g]=useState(t[0]?.id),x=useCallback(()=>{let P=i.current;P&&(d.current={height:P.scrollHeight,top:P.scrollTop});},[]),v=useCallback(()=>{let P=i.current;if(!P)return;let I=P.getBoundingClientRect().top,S=P.querySelector("[data-omph-turn]")?.dataset.omphTurn;P.querySelectorAll("[data-omph-turn]").forEach(R=>{R.getBoundingClientRect().top-I<=Ds&&(S=R.dataset.omphTurn);}),g(S);},[]);useEffect(()=>{let P=i.current,I=s.current;if(!P||!I)return;let S=()=>{b(P.clientWidth>Ex),l.current&&(P.scrollTop=P.scrollHeight),x();};S();let R=new ResizeObserver(S);return R.observe(P),R.observe(I),()=>R.disconnect()},[x]),useLayoutEffect(()=>{let P=i.current;if(!P)return;let I=t[0]?.id,S=p.current,R=S!==void 0&&t.some(M=>M.id===S),N=R&&I!==void 0&&I!==S,T=S!==void 0&&!R;if(p.current=I,T){l.current=true,f(true),P.scrollTop=P.scrollHeight,x(),v();return}if(N){l.current=false,f(false);let M=P.scrollHeight-d.current.height;P.scrollTop=d.current.top+Math.max(0,M),x(),v();return}l.current&&(P.scrollTop=P.scrollHeight),x(),v();},[o,x,t,v]),useEffect(()=>{n||(m.current=false);},[n]);let y=useCallback(()=>{let P=i.current;if(!P)return;let S=P.scrollHeight-P.scrollTop-P.clientHeight<=Ds;S!==l.current&&(l.current=S,f(S)),x(),v();let R=P.scrollHeight-P.clientHeight>Ds,N=P.scrollTop<=Ds;!R||!N||S||!r||n||!a||m.current||(m.current=true,a());},[r,n,a,x,v]),k=useCallback(()=>{let P=i.current;P&&(l.current=true,f(true),P.scrollTo({top:P.scrollHeight,behavior:Cg()?"auto":"smooth"}));},[]),w=useCallback(P=>{let S=i.current?.querySelector(`[data-omph-turn="${CSS.escape(P)}"]`);S&&(l.current=false,f(false),S.scrollIntoView({block:"start",behavior:Cg()?"auto":"smooth"}));},[]);return {scrollerRef:i,contentRef:s,following:h,railVisible:u,activeTurnId:C,onScroll:y,returnToBottom:k,scrollToTurn:w}};var Ox=1e3,Fx=(t,o)=>o[t],Bx=t=>t.map(o=>[o.id,o.user?.content.length??0,o.assistant?.content.length??0,o.assistant?.streaming?"1":"0",o.failure?.id??"",(o.process??[]).map(r=>`${r.id}:${r.status}:${r.content?.length??0}`).join(",")].join(":")).join("|"),Hx=({startedAt:t,labels:o})=>{let[r,n]=useState(()=>Date.now());useEffect(()=>{n(Date.now());let i=window.setInterval(()=>n(Date.now()),Ox);return ()=>window.clearInterval(i)},[t]);let a=t===void 0?o.working:o.workingFor(mg(Math.max(0,r-t),o));return g("div",{className:"orb-omph-running","data-omph-running":"true",children:[f("span",{className:"orb-visually-hidden",role:"status","aria-live":"polite",children:o.working}),f("span",{className:"orb-omph-running-rule","aria-hidden":"true"}),g("span",{className:"orb-omph-running-body",children:[f("span",{className:"orb-omph-spinner","aria-hidden":"true"}),f("span",{className:"orb-omph-shimmer",children:a})]})]})},Pz=({turns:t,title:o,avatar:r,description:n,headerActions:a,agentStatus:i,isResponding:s=false,labels:l,processDisplay:d="standard",showInput:p=false,placeholder:m,className:h,cardHooks:f$1,hasOlder:u=false,loadingOlder:b=false,onLoadOlder:C,onSend:g$1,onStop:x,onHeaderPointerDown:v,conversations:y=[],activeConversationId:k,onNewConversation:w,onSelectConversation:P,loadFilePreview:I,resolveFileLink:S=Jl,filePreviewLayout:R="auto",onOpenFileExternally:N})=>{let{t:T}=ce(),M={...rc(T),...l},A=i??(s?"running":"idle"),L=A==="running"||A==="pending",W=[Fx(A,M),n].filter(Boolean).join(" \xB7 "),ee=useMemo(()=>Bx(t),[t]),O=xg({turns:t,contentVersion:ee,hasOlder:u,loadingOlder:b,onLoadOlder:C}),[_,V]=useState(""),Q=_.trim(),H=s&&Q.length===0,B=[...t].reverse().find(de=>!!de.assistant?.streaming||de.process?.some(ve=>ve.streaming||ve.status==="running"||ve.status==="pending")),q=L?B?.startedAt:void 0,Z=!!I,Y=gg(I),J=vg({open:Y.state.open,layout:R}),le=useRef(null),he=useRef(null),ze=Z&&Y.state.open&&J.placement==="overlay",be=J.placement==="split"&&Y.state.open,Ce={[sc]:`${J.width}px`,[ic]:be?`${J.width}px`:"0px"};useEffect(()=>{he.current?.toggleAttribute("inert",ze);},[ze]);let Be=async()=>{if(!Q||!g$1)return;let de=Q;V("");try{await g$1(de);}catch{V(ve=>ve.trim().length===0?de:ve);}};return g("div",{className:ot("orb-omph-panel",h),"data-omph-panel":"","data-status":A,"data-compact":J.compact||void 0,children:[g("div",{className:ot("orb-omph-header",v&&"cursor-grab active:cursor-grabbing"),onPointerDown:v,children:[f("span",{className:"orb-omph-avatar","aria-hidden":"true",children:r??"AI"}),g("div",{className:"min-w-0 flex-1",children:[o&&f("div",{className:"orb-omph-title",children:o}),g("div",{className:"orb-omph-subtitle",children:[f("span",{className:"orb-omph-dot","data-active":L||void 0}),f("span",{className:"truncate",children:W||M.idle})]})]}),(w||P||a)&&g("div",{className:"orb-omph-header-actions",onPointerDown:de=>de.stopPropagation(),children:[f(_m,{conversations:y,activeConversationId:k,labels:M,onNewConversation:w,onSelectConversation:P}),a]})]}),g("div",{ref:J.mainRef,className:"orb-omph-main","data-placement":J.placement,"data-open":String(Y.state.open),"data-dragging":J.dragging||void 0,style:Ce,children:[g("div",{ref:he,className:"orb-omph-center",children:[g("div",{className:"orb-omph-stage","data-rail":O.railVisible||void 0,children:[f("div",{ref:O.scrollerRef,className:"orb-omph-scroll",onScroll:O.onScroll,children:g("div",{ref:O.contentRef,className:"orb-omph-column",children:[u&&C&&f("button",{type:"button",className:"orb-omph-older",disabled:b,onClick:C,children:b?M.loadingOlder:M.loadOlder}),f(pg,{turns:t,labels:M,processDisplay:d,cardHooks:f$1,resolveFileLink:S,onOpenFile:Z?Y.open:void 0}),L&&f(Hx,{startedAt:q,labels:M})]})}),O.railVisible&&t.length>0&&f("nav",{className:"orb-omph-rail","aria-label":M.turnRail,children:t.map(de=>f("button",{type:"button",className:"orb-omph-rail-mark","data-active":O.activeTurnId===de.id||void 0,"aria-label":oc(de),title:oc(de),onClick:()=>O.scrollToTurn(de.id)},de.id))}),!O.following&&f("button",{type:"button",className:"orb-omph-to-bottom","aria-label":M.toBottom,onClick:O.returnToBottom,children:f(Bo,{size:16})})]}),p&&g("form",{className:"orb-omph-composer",onSubmit:de=>{de.preventDefault(),H?x?.():Be();},children:[f("textarea",{className:"orb-omph-input",value:_,placeholder:m,rows:1,onChange:de=>V(de.target.value),onKeyDown:de=>{de.key!=="Enter"||de.shiftKey||de.nativeEvent.isComposing||(de.preventDefault(),H?x?.():Be());}}),!H&&s&&x&&f("button",{type:"button",className:"orb-omph-stop-secondary","aria-label":M.stop,title:M.stop,onClick:x,children:f(Ws,{size:14})}),f("button",{type:"submit",className:H?"orb-omph-stop":"orb-omph-send","aria-label":H?M.stop:M.send,disabled:!H&&Q.length===0,children:H?f(Ws,{size:16}):f(Dc,{size:16})})]})]}),Z&&f(sg,{state:Y.state,placement:J.placement,expanded:J.expanded,canExpand:J.canExpand,labels:M,gripProps:J.gripProps,paneRef:le,onClose:Y.close,onRetry:Y.reload,onToggleExpand:J.toggleExpanded,onOpenExternally:N})]})]})};var hr="other",zx=t=>t instanceof HTMLElement&&t.closest('input, textarea, select, [contenteditable="true"], [contenteditable=""]')!==null,Vx=({request:t,onDecide:o,labels:r})=>{let{t:n}=ce(),a={...nc(n),...r},i=useRef(null),s=useRef(null),l=useRef(false),d=useRef(false),[p,m]=useState(false),[h,f$1]=useState(null),[u,b]=useState(""),C=t.choices??[],g$1=t.allowOther??C.length>0,x=C.length>0||g$1,v=t.reason?.trim()||a.escalation(t.toolName),y=t.detail?.trim(),k=h===hr&&u.trim().length>0,w=!x||h!==null&&h!==hr||k;useEffect(()=>{m(false),f$1(null),b(""),i.current?.focus();},[t.id]),useEffect(()=>{h===hr&&s.current?.focus();},[h]);let P=R=>{p||(m(true),o(R,t));},I=()=>{if(w){if(!x){P({kind:"allowed-once"});return}if(h===hr){let R=u.trim();if(!R)return;P({kind:"other",text:R});return}h&&P({kind:"choice",choiceId:h});}},S=R=>{if(!(p||zx(R.target))&&!(R.key!=="Enter"&&R.key!=="Escape")&&!(R.key==="Enter"&&R.target instanceof HTMLElement&&R.target.closest('button, a[href], [role="button"]'))&&!(R.ctrlKey||R.metaKey||R.altKey||R.shiftKey)&&(R.preventDefault(),R.stopPropagation(),!(R.repeat||l.current||d.current||R.nativeEvent.isComposing))){if(R.key==="Escape"){P({kind:"rejected"});return}I();}};return f("div",{className:"orb-omph-approval","data-omph-approval":t.id,"aria-busy":p,onKeyDown:S,onKeyUpCapture:()=>{d.current=false;},onCompositionStartCapture:()=>{l.current=true;},onCompositionEndCapture:()=>{l.current=false,d.current=true;},children:g("div",{className:"orb-omph-approval-card",children:[g("div",{className:"orb-omph-approval-strip",children:[f("span",{className:"orb-omph-approval-dot","aria-hidden":"true"}),x?a.choose:a.waiting]}),g("div",{ref:i,className:"orb-omph-approval-body",tabIndex:0,role:"group","aria-label":a.details,children:[f("div",{className:"orb-omph-approval-headline",children:v}),y&&f("div",{className:"orb-omph-approval-detail",children:y}),x&&g("fieldset",{className:"orb-omph-approval-choices",disabled:p,children:[f("legend",{className:"orb-visually-hidden",children:a.choices}),C.map(R=>{let N=h===R.id;return g("label",{className:"orb-omph-approval-choice","data-selected":N,children:[f("input",{type:"radio",name:`omph-approval-${t.id}`,value:R.id,checked:N,onChange:()=>f$1(R.id)}),g("span",{className:"orb-omph-approval-choice-copy",children:[f("span",{children:R.label}),R.description&&f("span",{className:"orb-omph-approval-choice-description",children:R.description})]})]},R.id)}),g$1&&g("label",{className:"orb-omph-approval-choice","data-selected":h===hr,children:[f("input",{type:"radio",name:`omph-approval-${t.id}`,value:hr,checked:h===hr,onChange:()=>f$1(hr)}),f("span",{className:"orb-omph-approval-choice-copy",children:f("span",{children:a.other})})]}),g$1&&h===hr&&f("textarea",{ref:s,className:"orb-omph-approval-other",value:u,placeholder:a.otherPlaceholder,rows:3,"aria-label":a.other,onChange:R=>b(R.target.value)})]})]}),g("div",{className:"orb-omph-approval-actions",children:[f("button",{type:"button",className:"orb-btn orb-btn-neutral orb-omph-approval-reject",disabled:p,onClick:()=>P({kind:"rejected"}),children:a.reject}),f("button",{type:"button",className:"orb-btn orb-btn-primary",disabled:p||!w,onClick:I,children:x?a.confirm:a.allowOnce})]})]})})};var Mg=520,_x=88,Gx=88,Ux=24,As=640,Rg=(t,o,r)=>Math.min(Math.max(t,o),Math.max(o,r)),dc=t=>typeof t=="number"?`${t}px`:t,Kx=t=>t instanceof HTMLElement?!!t.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,Bz=({anchor:t,defaultAnchor:o="right",onAnchorChange:r,width:n=Mg,top:a=_x,bottom:i=Gx,inset:s=Ux,zIndex:l=1300,shellClassName:d,shellStyle:p,className:m,onHeaderPointerDown:h,...f$1})=>{let u=useRef(null),b=useRef(null),[C,g]=useState(o),[x,v]=useState(0),[y,k]=useState(typeof n=="number"?n:Mg),[w,P]=useState(0),[I,S]=useState(false),R=t??C;useEffect(()=>{let O=()=>v(window.innerWidth);return O(),window.addEventListener("resize",O),()=>window.removeEventListener("resize",O)},[]),useLayoutEffect(()=>{let O=()=>{let V=u.current?.getBoundingClientRect();V?.width?k(V.width):typeof n=="number"&&k(n);};if(O(),!u.current||typeof ResizeObserver>"u")return;let _=new ResizeObserver(O);return _.observe(u.current),()=>_.disconnect()},[n]);let N=useCallback(O=>{if(!x)return s;let _=x<As?12:s,V=Math.max(_,x-y-_);return x<As||O==="left"?_:O==="center"?Rg((x-y)/2,_,V):V},[s,y,x]),T=useCallback(O=>["left","center","right"].reduce((V,Q)=>{let H=Math.abs(O-N(V));return Math.abs(O-N(Q))<H?Q:V},"right"),[N]),M=useCallback(O=>{t===void 0&&g(O),r?.(O);},[t,r]);useEffect(()=>{I||P(N(R));},[N,I,R]);let A=useCallback(O=>{h?.(O),!(O.defaultPrevented||Kx(O.target))&&(O.preventDefault(),O.currentTarget.setPointerCapture(O.pointerId),b.current={pointerId:O.pointerId,startClientX:O.clientX,startX:w,currentX:w,captureElement:O.currentTarget},S(true));},[h,w]),L=useCallback(O=>{let _=b.current;if(!_||_.pointerId!==O.pointerId)return;let V=x<As?12:s,Q=Math.max(V,x-y-V),H=Rg(_.startX+O.clientX-_.startClientX,V,Q);_.currentX=H,P(H);},[s,y,x]),W=useCallback(O=>{let _=b.current;if(!_||_.pointerId!==O.pointerId)return;try{_.captureElement.releasePointerCapture(O.pointerId);}catch{}let V=T(_.currentX);b.current=null,S(false),M(V),P(N(V));},[N,M,T]),ee=useMemo(()=>({position:"fixed",top:dc(a),bottom:dc(i),left:w,width:dc(n),maxWidth:`calc(100vw - ${x<As?24:s*2}px)`,zIndex:l,pointerEvents:"auto",transition:I?"none":"left 180ms ease-out",touchAction:"none",...p}),[i,s,I,w,p,a,x,n,l]);return f("div",{ref:u,className:ot("orbcafe-floating-agent-panel min-w-0",d),"data-anchor":R,"data-dragging":I?"true":"false",style:ee,onPointerMove:L,onPointerUp:W,onPointerCancel:W,children:f(Wm,{...f$1,className:m,onHeaderPointerDown:A})})};var Zx={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},Uz=({messages:t,onSend:o,onRegenerate:r,isResponding:n=false,className:a,placeholder:i,title:s="Copilot",corner:l="bottom-right",onCollapse:d,onHeaderPointerDown:p,onPlusClick:m,onMicClick:h,streamIntervalMs:f$1,streamChunkSize:u,onMessageStreamingComplete:b,cardHooks:C})=>{let[g$1,x]=useState(""),[v,y]=useState(false),k=useRef(null),w=Zx[l];useEffect(()=>{k.current?.scrollIntoView({behavior:"smooth"});},[t,n]);let P=useCallback(async()=>{let S=g$1.trim();!S||n||(x(""),await o(S));},[n,o,g$1]),I=useCallback(async S=>{S.key==="Enter"&&!v&&(S.preventDefault(),await P());},[P,v]);return g("div",{className:ot("relative flex h-full w-full min-h-[460px] min-w-[340px] flex-col overflow-hidden rounded-3xl border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-none dark:bg-[var(--orb-surface-2)]",a),children:[d&&f("button",{onClick:d,className:ot("absolute z-20 flex h-10 w-10 items-center justify-center rounded-full transition-colors hover:bg-transparent dark:hover:bg-transparent",w==="top-left"&&"-left-2 -top-2",w==="top-right"&&"-right-2 -top-2",w==="bottom-left"&&"-bottom-2 -left-2",w==="bottom-right"&&"-bottom-2 -right-2"),type:"button","aria-label":"Collapse Copilot",children:f("span",{className:ot("block h-4 w-4 border-[var(--orb-ai-accent)]",w==="top-left"&&"rounded-tl-full border-l-[3px] border-t-[3px]",w==="top-right"&&"rounded-tr-full border-r-[3px] border-t-[3px]",w==="bottom-left"&&"rounded-bl-full border-b-[3px] border-l-[3px]",w==="bottom-right"&&"rounded-br-full border-b-[3px] border-r-[3px]")})}),g("div",{className:"flex items-center justify-between border-b border-[var(--orb-border)] px-4 py-3",onPointerDown:p,children:[f("div",{className:"flex items-center",children:f("h3",{className:"text-base font-semibold tracking-tight text-[var(--orb-fg)]",children:s})}),f("div",{})]}),g("div",{className:"flex-1 overflow-y-auto px-3 py-3 space-y-5 scrollbar-thin scrollbar-thumb-[var(--orb-border)]",children:[t.map((S,R)=>{let N=S.type==="assistant"&&R===t.length-1,T=S.type==="assistant"?{isLatestAssistant:N,isResponding:n,onRegenerate:r?()=>r(S.id):void 0}:void 0;return f(xs,{message:S,assistantActions:T,onStreamingComplete:()=>b?.(S.id),streamIntervalMs:f$1,streamChunkSize:u,cardHooks:C},S.id)}),f("div",{ref:k})]}),f("div",{className:"border-t border-[var(--orb-border)] px-3 py-3",children:g("div",{className:"flex items-center gap-2 rounded-xl border border-[var(--orb-p300)] bg-[var(--orb-canvas)] px-2 py-1.5 dark:bg-[var(--orb-surface-2)]",children:[f("button",{className:"flex h-8 w-8 items-center justify-center rounded-full text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-surface)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] dark:hover:bg-[var(--orb-surface-2)]",onClick:m,type:"button","aria-label":"Add",children:f(jr,{className:"h-4 w-4"})}),f("input",{className:"h-7 flex-1 border-none bg-transparent text-sm text-[var(--orb-fg)] outline-none placeholder:text-[var(--orb-muted)] dark:text-[var(--orb-fg)] dark:placeholder:text-[var(--orb-muted)]",placeholder:i||"Ask Copilot...",value:g$1,onChange:S=>x(S.target.value),onCompositionStart:()=>y(true),onCompositionEnd:()=>y(false),onKeyDown:I,"aria-label":"Copilot input",spellCheck:false}),f("button",{className:"flex h-8 w-8 items-center justify-center rounded-full text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-surface)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] dark:hover:bg-[var(--orb-surface-2)]",onClick:h,type:"button","aria-label":"Microphone",children:f(Oa,{className:"h-4 w-4"})})]})})]})};var Yx=["var(--orb-primary)","var(--orb-primary)","var(--orb-primary)"],Qx=`
14
+ ${r}: ${(a??n)(g$1.secondaryValue??0)}`:""]})}),f("text",{x:g$1.x,y:Math.max(g$1.y-12,u.top+8),textAnchor:"middle",fontSize:"10",fill:i.palette.text.secondary,children:g$1.name})]},g$1.name)),f("text",{x:s/2,y:c-10,textAnchor:"middle",fontSize:"11",fill:i.palette.text.secondary,children:r?o:"Index"}),f("text",{x:16,y:c/2,textAnchor:"middle",transform:`rotate(-90 16 ${c/2})`,fontSize:"11",fill:i.palette.text.secondary,children:r??o}),f("text",{x:u.left,y:u.top-4,fontSize:"10",fill:i.palette.text.secondary,children:Xu(f$1)}),f("text",{x:s-u.right,y:c-u.bottom+16,textAnchor:"end",fontSize:"10",fill:i.palette.text.secondary,children:Xu(h)})]})}),f("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",lg:"repeat(3, minmax(0, 1fr))"},gap:1},children:t.map(g$1=>g("div",{sx:x=>({borderRadius:"var(--orb-r-container)",px:1.25,py:1,border:`1px solid ${Fo(x.palette.divider,.7)}`,bgcolor:Fo(x.palette.background.default,.35)}),children:[f(E,{component:"div",sx:{fontSize:"0.78rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:g$1.name,children:g$1.name}),g(E,{component:"div",sx:{fontSize:"0.72rem",color:"var(--orb-fg)"},children:[o,": ",n(g$1.primaryValue)]}),r&&g(E,{component:"div",sx:{fontSize:"0.72rem",color:"var(--orb-fg)"},children:[r,": ",(a??n)(g$1.secondaryValue??0)]})]},g$1.name))})]})};var zl=t=>Math.max(...t,1),Yu=({data:t,chartType:o,primaryLabel:r,secondaryLabel:n,formatPrimaryValue:a,formatSecondaryValue:i})=>{let s=io(),c=s.palette.primary.main,u=s.palette.warning.main;if(t.length===0)return null;if(o==="bar-horizontal"){let y=zl(t.flatMap(b=>[b.primaryValue,b.secondaryValue??0]));return f(ce,{spacing:1.1,children:t.map(b=>g("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"160px 1fr 128px"},gap:1.25,alignItems:"center"},children:[f(E,{component:"div",sx:{fontSize:"0.78rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:b.name,children:b.name}),g(ce,{spacing:.65,children:[f("div",{sx:{height:10,borderRadius:999,overflow:"hidden",bgcolor:Fo(s.palette.action.active,.08)},children:f("div",{sx:{width:`${b.primaryValue/y*100}%`,height:"100%",bgcolor:c}})}),n&&f("div",{sx:{height:8,borderRadius:999,overflow:"hidden",bgcolor:Fo(s.palette.action.active,.08)},children:f("div",{sx:{width:`${(b.secondaryValue??0)/y*100}%`,height:"100%",bgcolor:u}})})]}),g("div",{sx:{minWidth:0},children:[f(E,{component:"div",sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},fontWeight:700,color:"var(--orb-fg-strong)"},children:a(b.primaryValue)}),n&&f(E,{component:"div",sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},color:"var(--orb-fg)"},children:(i??a)(b.secondaryValue??0)})]})]},b.name))})}if(o==="bar-vertical"){let y=zl(t.flatMap(k=>[k.primaryValue,k.secondaryValue??0])),b=n?92:76;return f("div",{sx:{overflowX:"auto",pb:.5},children:f("div",{sx:{minWidth:Math.max(620,t.length*b),display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(56px, 1fr))`,gap:1,alignItems:"end"},children:t.map(k=>g("div",{sx:{minWidth:0},children:[g("div",{sx:{height:210,display:"flex",alignItems:"flex-end",justifyContent:"center",gap:.8},children:[f("div",{sx:{width:n?16:26,minHeight:8,height:`${Math.max(k.primaryValue/y*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:c},title:`${r}: ${a(k.primaryValue)}`}),n&&f("div",{sx:{width:16,minHeight:8,height:`${Math.max((k.secondaryValue??0)/y*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:u},title:`${n}: ${(i??a)(k.secondaryValue??0)}`})]}),f(E,{component:"div",sx:{fontSize:"0.76rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:k.name,children:k.name}),f(E,{component:"div",sx:{fontSize:"0.7rem",color:"var(--orb-fg)"},noWrap:true,title:a(k.primaryValue),children:a(k.primaryValue)}),n&&f(E,{component:"div",sx:{fontSize:"0.7rem",color:"var(--orb-fg)"},noWrap:true,title:(i??a)(k.secondaryValue??0),children:(i??a)(k.secondaryValue??0)})]},k.name))})})}let d=Math.max(680,t.length*74),m=240,h={top:20,right:18,bottom:36,left:18},f$1=zl(t.flatMap(y=>[y.primaryValue,y.secondaryValue??0])),p=d-h.left-h.right,v=m-h.top-h.bottom,C=y=>t.map((b,k)=>{let w=h.left+k*p/Math.max(t.length-1,1),T=m-h.bottom-y(b)/f$1*v;return {x:w,y:T,item:b}}),g$1=C(y=>y.primaryValue),x=n?C(y=>y.secondaryValue??0):[];return g("div",{sx:{display:"flex",flexDirection:"column",gap:1.1},children:[f("div",{sx:{overflowX:"auto"},children:g("div",{component:"svg",viewBox:`0 0 ${d} ${m}`,sx:{width:"100%",minWidth:d,height:m},children:[f("line",{x1:h.left,y1:m-h.bottom,x2:d-h.right,y2:m-h.bottom,stroke:Fo(s.palette.text.secondary,.35)}),f("polyline",{fill:"none",stroke:c,strokeWidth:3,points:g$1.map(y=>`${y.x},${y.y}`).join(" ")}),g$1.map(y=>f("circle",{cx:y.x,cy:y.y,r:4,fill:c,children:g("title",{children:[y.item.name,`
15
+ `,r,": ",a(y.item.primaryValue)]})},`primary-${y.item.name}`)),n&&g(e,{children:[f("polyline",{fill:"none",stroke:u,strokeWidth:2.5,strokeDasharray:"5 5",points:x.map(y=>`${y.x},${y.y}`).join(" ")}),x.map(y=>f("circle",{cx:y.x,cy:y.y,r:3.5,fill:u,children:g("title",{children:[y.item.name,`
16
+ `,n,": ",(i??a)(y.item.secondaryValue??0)]})},`secondary-${y.item.name}`))]})]})}),f("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1},children:t.map(y=>g("div",{sx:b=>({borderRadius:"var(--orb-r-container)",px:1.1,py:.9,border:`1px solid ${Fo(b.palette.divider,.7)}`,bgcolor:Fo(b.palette.background.default,.35)}),children:[f(E,{component:"div",sx:{fontSize:"0.76rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:y.name,children:y.name}),f(E,{component:"div",sx:{fontSize:"0.71rem",color:"var(--orb-fg)"},children:a(y.primaryValue)}),n&&f(E,{component:"div",sx:{fontSize:"0.71rem",color:"var(--orb-fg)"},children:(i??a)(y.secondaryValue??0)})]},y.name))})]})};var Qu=(t,o,r)=>{let n=new Set,a=[];return t.forEach(i=>{n.has(i)||(n.add(i),a.push({fieldId:i,label:r.get(i)?.label??i,zone:"rows"}));}),o.forEach(i=>{n.has(i)||(n.add(i),a.push({fieldId:i,label:r.get(i)?.label??i,zone:"columns"}));}),a},ju=(t,o,r)=>t.map(n=>{let a=o.get(n.fieldId),i=a?.label??n.fieldId;return {fieldId:n.fieldId,label:`${r(n.aggregation)} \xB7 ${i}`,item:n,field:a}}),Ju=({rows:t,dimensionFieldId:o,primaryValue:r,secondaryValue:n})=>{if(!o)return [];let a=new Map;return t.forEach(i=>{let s=pr(i[o]),c=a.get(s);if(c){c.push(i);return}a.set(s,[i]);}),Array.from(a.entries()).sort((i,s)=>i[0].localeCompare(s[0],void 0,{sensitivity:"base"})).map(([i,s])=>({name:i,primaryValue:wn(s,r.fieldId,r.aggregation),secondaryValue:n?wn(s,n.fieldId,n.aggregation):void 0}))};var em=({rows:t,fieldMap:o,rowFields:r,columnFields:n,valueFields:a,chartDimensionFieldId:i,chartPrimaryValueFieldId:s,chartSecondaryValueFieldId:c,chartType:u,isCollapsed:d,onChartDimensionFieldIdChange:m,onChartPrimaryValueFieldIdChange:h,onChartSecondaryValueFieldIdChange:f$1,onChartTypeChange:p,onToggleCollapse:v,getAggregationLabel:C})=>{let{t:g$1}=de(),x=useMemo(()=>Qu(r,n,o),[n,o,r]),y=useMemo(()=>ju(a,o,C),[o,C,a]),b=y.find(M=>M.fieldId===s)??y[0],k=y.find(M=>M.fieldId===c&&M.fieldId!==b?.fieldId)??null,w=x.find(M=>M.fieldId===i)??x[0],T=w&&b?g$1("pivot.chart.subtitleReady",{dimension:w.label,measure:k?`${b.label} / ${k.label}`:b.label}):g$1("pivot.chart.subtitle"),I=useMemo(()=>!w||!b?[]:Ju({rows:t,dimensionFieldId:w.fieldId,primaryValue:b.item,secondaryValue:k?.item}),[b,t,k,w]),S=M=>b?ga(M,b.item,o):M.toLocaleString(),D=M=>k?ga(M,k.item,o):M.toLocaleString(),R=x.length>1||y.length>1;return g(Pn,{title:g$1("pivot.chart.title"),subtitle:T,collapsed:d,onToggleCollapse:v,expandAriaLabel:g$1("pivot.chart.collapse.ariaExpand"),collapseAriaLabel:g$1("pivot.chart.collapse.ariaCollapse"),bodySx:{display:"flex",flexDirection:"column",gap:1.1},children:[R&&g("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1,alignItems:"start"},children:[g(yr,{size:"small",sx:{minWidth:0,width:"100%"},children:[f(E,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g$1("pivot.chart.dimension")}),f(zt,{value:w?.fieldId??"",onChange:M=>m(String(M.target.value)),sx:{fontSize:"0.75rem",height:32},children:x.map(M=>f("option",{value:M.fieldId,sx:{fontSize:"0.75rem"},children:M.label},M.fieldId))})]}),g(yr,{size:"small",sx:{minWidth:0,width:"100%"},children:[f(E,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g$1("pivot.chart.primaryMeasure")}),f(zt,{value:b?.fieldId??"",onChange:M=>h(String(M.target.value)),sx:{fontSize:"0.75rem",height:32},children:y.map(M=>f("option",{value:M.fieldId,sx:{fontSize:"0.75rem"},children:M.label},M.fieldId))})]}),g(yr,{size:"small",sx:{minWidth:0,width:"100%"},children:[f(E,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g$1("pivot.chart.secondaryMeasure")}),g(zt,{value:k?.fieldId??"",onChange:M=>f$1(String(M.target.value)),sx:{fontSize:"0.75rem",height:32},children:[f("option",{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:g$1("common.none")}),y.filter(M=>M.fieldId!==b?.fieldId).map(M=>f("option",{value:M.fieldId,sx:{fontSize:"0.75rem"},children:M.label},M.fieldId))]})]}),g(yr,{size:"small",sx:{minWidth:0,width:"100%"},children:[f(E,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g$1("pivot.chart.chartType")}),g(zt,{value:u,onChange:M=>p(M.target.value),sx:{fontSize:"0.75rem",height:32},children:[f("option",{value:"bar-vertical",sx:{fontSize:"0.75rem"},children:g$1("pivot.chart.style.barVertical")}),f("option",{value:"bar-horizontal",sx:{fontSize:"0.75rem"},children:g$1("pivot.chart.style.barHorizontal")}),f("option",{value:"line",sx:{fontSize:"0.75rem"},children:g$1("pivot.chart.style.line")}),f("option",{value:"scatter",sx:{fontSize:"0.75rem"},children:g$1("pivot.chart.style.scatter")})]})]})]}),f("div",{children:w?b?I.length===0?f("div",{sx:{py:5,textAlign:"center"},children:f(E,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g$1("pivot.chart.emptyNoData")})}):u==="scatter"?f(Zu,{data:I,primaryLabel:b.label,secondaryLabel:k?.label,formatPrimaryValue:S,formatSecondaryValue:D}):f(Yu,{data:I,chartType:u,primaryLabel:b.label,secondaryLabel:k?.label,formatPrimaryValue:S,formatSecondaryValue:D}):f("div",{sx:{py:5,textAlign:"center"},children:f(E,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g$1("pivot.chart.emptyNoValue")})}):f("div",{sx:{py:5,textAlign:"center"},children:f(E,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g$1("pivot.chart.emptyNoDimension")})})})]})};var ns=({node:t,dataColumns:o,fieldMap:r,level:n,expandedKeys:a,onToggle:i,getValue:s})=>{let c=a.has(t.key),u=t.children.length>0,d=t.isGrandTotal,m=u&&!c&&!d,h=d?800:m?700:u?600:500,f$1=d?800:m?600:500;return g(e,{children:[g("tr",{sx:{bgcolor:d?b()==="dark"?"color-mix(in oklch, var(--orb-primary) 22%, transparent)":"color-mix(in oklch, var(--orb-primary) 8%, transparent)":b()==="dark"?"var(--orb-surface)":"background.paper","&:hover":{bgcolor:d?b()==="dark"?"color-mix(in oklch, var(--orb-primary) 28%, transparent)":"color-mix(in oklch, var(--orb-primary) 12%, transparent)":"var(--orb-hover)"}},children:[g("td",{style:{fontWeight:h},sx:p=>({fontSize:"0.76rem",borderBottom:`1px solid ${p.palette.divider}`,whiteSpace:"nowrap",pl:n*2+1,display:"flex",alignItems:"center",height:40}),children:[u&&!d&&f(le,{size:"small",onClick:()=>i(t.key),sx:{width:22,height:22,p:0,mr:.35,ml:-0.8},children:c?f($o,{size:12}):f(Sr,{size:12})}),!u&&!d&&n>0&&f("div",{sx:{width:18}}),t.value]}),o.map(p=>f("td",{align:"right",style:{fontWeight:f$1},sx:{fontSize:"0.76rem",borderBottom:v=>`1px solid ${v.palette.divider}`,whiteSpace:"nowrap"},children:ga(s?s(t,p.id):t.aggregatedValues[p.id]??0,p.valueItem,r)},`${t.key}-${p.id}`))]}),c&&t.children.map(p=>f(ns,{node:p,dataColumns:o,fieldMap:r,level:n+1,expandedKeys:a,onToggle:i,getValue:s},p.key))]})};var Wl=(t,o,r)=>{let n=[...t,...o];return r&&n.includes(r)?r:n[0]??""},is=(t,o)=>o&&t.some(r=>r.fieldId===o)?o:t[0]?.fieldId??"",$l=(t,o,r)=>r===""?"":r&&r!==o&&t.some(n=>n.fieldId===r)?r:t.find(n=>n.fieldId!==o)?.fieldId??"",om=t=>{let o=new Set,r=n=>{n.forEach(a=>{a.children.length>0&&(o.add(a.key),r(a.children));});};return r(t),o},rm=(t,o,r=0)=>t.length===0?r:t.reduce((n,a)=>a.children.length===0||!o.has(a.key)?Math.max(n,r+1):Math.max(n,rm(a.children,o,r+1)),r),ry=(t,o)=>{let r=[],n=a=>{a.forEach(i=>{if(i.children.length>0&&o.has(i.key)){n(i.children);return}r.push(i);});};return n(t),r},IO=({title:t,rows:o,fields:r,initialLayout:n,initialChart:a,emptyText:i,maxPreviewHeight:s=520,initialChartCollapsed:c=false,initialTableCollapsed:u=false,model:d,enablePresetManagement:m=false,presets:h,defaultPresets:f$1,onPresetsChange:p,initialPresetId:v,onPresetApplied:C})=>{let{t:g$1}=de(),x=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}})),y=useRef(0),b$1=useRef(false),k=t??g$1("pivot.title.default"),w=i??g$1("pivot.empty"),T=useMemo(()=>({sum:g$1("pivot.agg.sum"),count:g$1("pivot.agg.count"),avg:g$1("pivot.agg.avg"),min:g$1("pivot.agg.min"),max:g$1("pivot.agg.max")}),[g$1]),I=useCallback(N=>T[N]??Fu[N],[T]),S=useMemo(()=>new Set(r.map(N=>N.id)),[r]),D=useMemo(()=>new Map(r.map(N=>[N.id,N])),[r]),[R,M]=useState(()=>so(n?.rows,S)),[P,A]=useState(()=>so(n?.columns,S)),[L,W]=useState(()=>so(n?.filters,S)),[j,O]=useState(()=>{let N=n?.values??[],G=new Set,U=[];return N.forEach(he=>{if(!S.has(he.fieldId)||G.has(he.fieldId))return;G.add(he.fieldId),y.current+=1;let Ve=D.get(he.fieldId);U.push({tokenId:`v${y.current}`,fieldId:he.fieldId,aggregation:xo(he.aggregation,Ve)});}),U}),[_,z]=useState({}),[Y,H]=useState(true),[B,q]=useState(false),[Z,ue]=useState(()=>Wl(so(n?.rows,S),so(n?.columns,S),a?.dimensionFieldId)),[ne,fe]=useState(()=>{let N=(n?.values??[]).filter((G,U,he)=>S.has(G.fieldId)&&he.findIndex(Ve=>Ve.fieldId===G.fieldId)===U).map(G=>({tokenId:G.fieldId,fieldId:G.fieldId,aggregation:xo(G.aggregation,D.get(G.fieldId))}));return is(N,a?.primaryValueFieldId)}),[Ce,$]=useState(()=>{let N=(n?.values??[]).filter((U,he,Ve)=>S.has(U.fieldId)&&Ve.findIndex(rt=>rt.fieldId===U.fieldId)===he).map(U=>({tokenId:U.fieldId,fieldId:U.fieldId,aggregation:xo(U.aggregation,D.get(U.fieldId))})),G=is(N,a?.primaryValueFieldId);return $l(N,G,a?.secondaryValueFieldId)}),[J,ae]=useState(a?.chartType??"bar-vertical"),[xe,pe]=useState(c),[me,Ee]=useState(u),[Ge,nt]=useState(()=>f$1??[]),[it,K]=useState(""),[De,ke]=useState(false),[He,at]=useState(""),[Ye,xt]=useState(null),[Mt,Ot]=useState(new Set(["__grand_total__"])),[At,re]=useState(new Set),Ue=d?.rowFields??R,Be=d?.columnFields??P,ge=d?.filterFields??L,Se=d?.valueFields??j,oe=d?.filterSelections??_,we=d?.showGrandTotal??Y,Ae=d?.isConfiguratorCollapsed??B,Je=d?.chartDimensionFieldId??Z,st=d?.chartPrimaryValueFieldId??ne,pt=d?.chartSecondaryValueFieldId??Ce,Bt=d?.chartType??J,Xt=d?.isChartCollapsed??xe,Vt=d?.isTableCollapsed??me,wt=h??Ge,Wt=m||wt.length>0||!!p,ft=useCallback(N=>{if(d?.setRowFields){d.setRowFields(N);return}M(N);},[d]),Dt=useCallback(N=>{if(d?.setColumnFields){d.setColumnFields(N);return}A(N);},[d]),lt=useCallback(N=>{if(d?.setFilterFields){d.setFilterFields(N);return}W(N);},[d]),Ft=useCallback(N=>{if(d?.setValueFields){d.setValueFields(N);return}O(N);},[d]),Zt=useCallback(N=>{if(d?.setFilterSelections){d.setFilterSelections(N);return}z(N);},[d]),X=useCallback(N=>{if(d?.setShowGrandTotal){d.setShowGrandTotal(N);return}H(N);},[d]),V=useCallback(N=>{if(d?.setIsConfiguratorCollapsed){d.setIsConfiguratorCollapsed(N);return}q(N);},[d]),Q=useCallback(N=>{if(d?.setChartDimensionFieldId){d.setChartDimensionFieldId(N);return}ue(N);},[d]),ye=useCallback(N=>{if(d?.setChartPrimaryValueFieldId){d.setChartPrimaryValueFieldId(N);return}fe(N);},[d]),Pe=useCallback(N=>{if(d?.setChartSecondaryValueFieldId){d.setChartSecondaryValueFieldId(N);return}$(N);},[d]),Oe=useCallback(N=>{if(d?.setChartType){d.setChartType(N);return}ae(N);},[d]),$e=useCallback(N=>{if(d?.setIsChartCollapsed){d.setIsChartCollapsed(N);return}pe(N);},[d]),qe=useCallback(N=>{if(d?.setIsTableCollapsed){d.setIsTableCollapsed(N);return}Ee(N);},[d]),Qe=useCallback(N=>{let G=typeof N=="function"?N(wt):N;h||nt(G),p?.(G);},[p,wt,h]),ut=useMemo(()=>new Set([...Ue,...Be,...ge]),[Ue,Be,ge]),gt=useMemo(()=>r.filter(N=>!ut.has(N.id)),[r,ut]),It=useMemo(()=>{let N=[...Ue,...Be,...ge],G=new Set,U=[];return N.forEach(he=>{G.has(he)||(G.add(he),U.push(he));}),U},[Be,ge,Ue]);useEffect(()=>{ft(N=>{let G=N.filter(U=>S.has(U));return ur(N,G)?N:G}),Dt(N=>{let G=N.filter(U=>S.has(U));return ur(N,G)?N:G}),lt(N=>{let G=N.filter(U=>S.has(U));return ur(N,G)?N:G}),Ft(N=>{let G=N.filter(U=>S.has(U.fieldId)).map(U=>({...U,aggregation:xo(U.aggregation,D.get(U.fieldId))}));return Ji(N,G)?N:G});},[D,S]);let bt=useMemo(()=>{let N={};return It.forEach(G=>{let U=new Set;o.forEach(he=>{U.add(pr(he[G]));}),N[G]=Array.from(U).sort((he,Ve)=>he.localeCompare(Ve));}),N},[It,o]);useEffect(()=>{Zt(N=>{let G={};return It.forEach(U=>{let he=bt[U]??[],rt=(N[U]??[]).filter(ie=>he.includes(ie)),_e=Object.prototype.hasOwnProperty.call(N,U);G[U]=_e?rt:he;}),$u(N,G)?N:G});},[It,bt]),useEffect(()=>{Q(N=>Wl(Ue,Be,N));},[Be,Ue,Q]),useEffect(()=>{ye(N=>is(Se,N));},[ye,Se]),useEffect(()=>{Pe(N=>$l(Se,st,N));},[st,Pe,Se]);let F=useMemo(()=>o.filter(N=>It.every(G=>{let U=oe[G]??[],he=bt[G]??[];if(U.length===he.length)return true;if(U.length===0)return false;let Ve=pr(N[G]);return U.includes(Ve)})),[It,bt,oe,o]),ee=useMemo(()=>{if(Se.length===0)return null;let N=new Map;if(F.forEach(_e=>{let ie=Be.length>0?Be.map(te=>pr(_e[te])):[g$1("pivot.valueLabel")],be=$r(ie);N.set(be,ie);}),N.size===0){let _e=Be.length>0?Be.map(()=>Qi):[g$1("pivot.valueLabel")];N.set($r(_e),_e);}let G=Array.from(N.entries()).sort((_e,ie)=>Wu(_e[1],ie[1])),U=G.flatMap(([_e,ie])=>Se.map(be=>{let te=D.get(be.fieldId),Fe=`${I(be.aggregation)} ${te?.label??be.fieldId}`,je=Be.length===0||Se.length>1?`${ie.join(" / ")} \u2022 ${Fe}`:ie.join(" / ");return {id:`${_e}::${be.tokenId}`,colKey:_e,valueItem:be,label:je}})),he=[];Be.length>0&&G.forEach(([_e,ie])=>{let be=U.filter(je=>je.colKey===_e),te=he,Fe=[];ie.forEach((je,Ne)=>{Fe.push(`d${Ne}:${je}`);let Ze=`col::${$r(Fe)}`,kt=te.find(Qr=>Qr.key===Ze);kt||(kt={key:Ze,label:je,children:[],leafColumnIds:[],path:ie.slice(0,Ne+1),depth:Ne},te.push(kt)),be.forEach(Qr=>{kt.leafColumnIds.includes(Qr.id)||kt.leafColumnIds.push(Qr.id);}),te=kt.children;});});let Ve=_e=>{let ie={};return U.forEach(be=>{let te=_e.filter(Fe=>{let je=Be.length>0?Be.map(Ne=>pr(Fe[Ne])):[g$1("pivot.valueLabel")];return $r(je)===be.colKey});ie[be.id]=wn(te,be.valueItem.fieldId,be.valueItem.aggregation);}),ie},rt=[];if(Ue.length===0)rt.push({key:"root",value:g$1("pivot.resultLabel")||Lu,children:[],isLeaf:true,aggregatedValues:Ve(F),path:[],depth:0});else {let _e=(ie,be,te)=>{if(be>=Ue.length)return [];let Fe=Ue[be],je=new Map;return ie.forEach(Ne=>{let Ze=pr(Ne[Fe]);je.has(Ze)||je.set(Ze,[]),je.get(Ze).push(Ne);}),Array.from(je.keys()).sort().map(Ne=>{let Ze=je.get(Ne),kt=[...te,Ne];return {key:$r(kt),value:Ne,fieldId:Fe,aggregatedValues:Ve(Ze),children:_e(Ze,be+1,kt),isLeaf:be===Ue.length-1,path:kt,depth:be}})};rt.push(..._e(F,0,[]));}return {dataColumns:U,columnTree:he,rowTree:rt}},[Be,D,F,I,Ue,g$1,Se]),ve=useCallback((N,G)=>(y.current+=1,{tokenId:`v${y.current}`,fieldId:N,aggregation:xo(G,D.get(N))}),[D]),Ie=useCallback(N=>{if(N==="rows")return ft([]);if(N==="columns")return Dt([]);if(N==="filters")return lt([]);Ft([]);},[]),et=useCallback((N,G)=>{if(N==="rows")return ft(U=>U.filter(he=>he!==G));if(N==="columns")return Dt(U=>U.filter(he=>he!==G));if(N==="filters")return lt(U=>U.filter(he=>he!==G));Ft(U=>U.filter(he=>he.tokenId!==G));},[]),Xe=useCallback((N,G)=>{Ft(U=>U.map(he=>he.tokenId===N?{...he,aggregation:xo(G,D.get(he.fieldId))}:he));},[D]),St=useCallback(N=>{xt(String(N.active.id));},[]),ht=useCallback(N=>{if(xt(null),!N.over)return;let G=ji(String(N.active.id)),U=ji(String(N.over.id));if(!G||!U||G.kind!=="item"||!G.key)return;if(G.zone===U.zone&&U.kind==="item"){if(G.zone==="rows"){let Ne=Ue.indexOf(G.key),Ze=Ue.indexOf(U.key??"");Ne!==-1&&Ze!==-1&&Ne!==Ze&&ft(kt=>arrayMove(kt,Ne,Ze));return}if(G.zone==="columns"){let Ne=Be.indexOf(G.key),Ze=Be.indexOf(U.key??"");Ne!==-1&&Ze!==-1&&Ne!==Ze&&Dt(kt=>arrayMove(kt,Ne,Ze));return}if(G.zone==="filters"){let Ne=ge.indexOf(G.key),Ze=ge.indexOf(U.key??"");Ne!==-1&&Ze!==-1&&Ne!==Ze&&lt(kt=>arrayMove(kt,Ne,Ze));return}if(G.zone==="values"){let Ne=Se.findIndex(kt=>kt.tokenId===G.key),Ze=Se.findIndex(kt=>kt.tokenId===(U.key??""));Ne!==-1&&Ze!==-1&&Ne!==Ze&&Ft(kt=>arrayMove(kt,Ne,Ze));}return}let he=U.zone,Ve=[...Ue],rt=[...Be],_e=[...ge],ie=[...Se],be="",te=null;if(G.zone==="palette")be=G.key;else if(G.zone==="values"){let Ne=ie.find(Ze=>Ze.tokenId===G.key);if(!Ne)return;be=Ne.fieldId,te=Ne,ie=ie.filter(Ze=>Ze.tokenId!==G.key);}else G.zone==="rows"?(be=G.key,Ve=Ve.filter(Ne=>Ne!==be)):G.zone==="columns"?(be=G.key,rt=rt.filter(Ne=>Ne!==be)):G.zone==="filters"&&(be=G.key,_e=_e.filter(Ne=>Ne!==be));if(!be)return;let Fe=()=>{Ve=Ve.filter(Ne=>Ne!==be),rt=rt.filter(Ne=>Ne!==be),_e=_e.filter(Ne=>Ne!==be);},je=Ne=>{if(U.kind!=="item"||!U.key)return Ne==="rows"?Ve.length:Ne==="columns"?rt.length:Ne==="filters"?_e.length:Ne==="values"?ie.length:0;if(Ne==="rows"){let Ze=Ve.indexOf(U.key);return Ze>=0?Ze:Ve.length}if(Ne==="columns"){let Ze=rt.indexOf(U.key);return Ze>=0?Ze:rt.length}if(Ne==="filters"){let Ze=_e.indexOf(U.key);return Ze>=0?Ze:_e.length}if(Ne==="values"){let Ze=ie.findIndex(kt=>kt.tokenId===U.key);return Ze>=0?Ze:ie.length}return 0};if(he==="palette"){ft(Ve),Dt(rt),lt(_e),Ft(ie);return}if(he==="values"){let Ne=je("values"),Ze=te??ve(be);ie.splice(Ne,0,Ze),ft(Ve),Dt(rt),lt(_e),Ft(ie);return}if(Vu(he)){Fe();let Ne=je(he);he==="rows"?Ve.splice(Ne,0,be):he==="columns"?rt.splice(Ne,0,be):_e.splice(Ne,0,be),ft(Ve),Dt(rt),lt(_e),Ft(ie);}},[Be,ve,ge,Ue,Se]),mt=useCallback((N,G)=>{Zt(U=>({...U,[N]:G}));},[]),yt=useCallback(N=>{Ot(G=>{let U=new Set(G);return U.has(N)?U.delete(N):U.add(N),U});},[]),ro=useCallback(N=>{re(G=>{let U=new Set(G);return U.has(N)?U.delete(N):U.add(N),U});},[]),Et=useCallback(N=>{let G=D.get(N.fieldId),U=Bl(G);return f(yr,{size:"small",sx:{minWidth:98},children:f(zt,{value:N.aggregation,onChange:he=>Xe(N.tokenId,he.target.value),onClick:he=>he.stopPropagation(),onMouseDown:he=>he.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& select.orb-inp":{py:.35}},children:U.map(he=>f("option",{value:he,sx:{fontSize:"0.75rem"},children:I(he)},he))})})},[D,I,Xe]),Yt=useCallback(N=>{let G=bt[N]??[],U=oe[N]??G;return G.length===0?g$1("pivot.filter.noValues"):U.length===0?g$1("pivot.filter.noneSelected"):U.length===G.length?g$1("pivot.filter.allValues"):g$1("pivot.filter.selectedCount",{selected:U.length,total:G.length})},[bt,oe,g$1]),Ht=useCallback(N=>{let G=bt[N]??[],U=oe[N]??G;return f(Gu,{options:G,selectedValues:U,onChange:he=>mt(N,he)})},[bt,oe,mt]),Ut=useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),$t=useCallback(()=>{let N={};return new Set([...It,...Object.keys(oe)]).forEach(U=>{if(!S.has(U))return;let he=oe[U]??[];N[U]=[...he];}),{layout:{rows:[...Ue],columns:[...Be],filters:[...ge],values:Se.map(U=>({fieldId:U.fieldId,aggregation:U.aggregation}))},filterSelections:N,showGrandTotal:we,chart:{dimensionFieldId:Je,primaryValueFieldId:st,secondaryValueFieldId:pt,chartType:Bt}}},[It,Je,st,pt,Bt,Be,ge,oe,Ue,we,S,Se]),to=useCallback(N=>{let G=so(N.layout.rows,S),U=so(N.layout.columns,S),he=so(N.layout.filters,S),Ve=new Set,rt=(N.layout.values??[]).filter(be=>!S.has(be.fieldId)||Ve.has(be.fieldId)?false:(Ve.add(be.fieldId),true)).map(be=>ve(be.fieldId,be.aggregation)),_e={};Object.entries(N.filterSelections??{}).forEach(([be,te])=>{!S.has(be)||!Array.isArray(te)||(_e[be]=Array.from(new Set(te.map(Fe=>String(Fe)))));}),ft(G),Dt(U),lt(he),Ft(rt),Zt(_e),typeof N.showGrandTotal=="boolean"&&X(N.showGrandTotal),Q(Wl(G,U,N.chart?.dimensionFieldId));let ie=is(rt,N.chart?.primaryValueFieldId);ye(ie),Pe($l(rt,ie,N.chart?.secondaryValueFieldId)),Oe(N.chart?.chartType??"bar-vertical"),K(N.id),C?.(N);},[ve,C,Q,ye,Pe,Oe,Dt,lt,Zt,ft,X,Ft,S]),no=useCallback(N=>{if(!N){K("");return}let G=wt.find(U=>U.id===N);if(!G){K("");return}to(G);},[to,wt]),vo=useCallback(()=>{let N=g$1("pivot.preset.defaultName",{index:wt.length+1});at(N),ke(true);},[wt.length,g$1]),No=useCallback(()=>{let N=He.trim();if(!N)return;let G={id:Ut(),name:N,...$t()};Qe(U=>[...U,G]),K(G.id),ke(false);},[$t,Ut,He,Qe]),Do=useCallback(()=>{it&&(Qe(N=>N.filter(G=>G.id!==it)),K(""));},[it,Qe]);useEffect(()=>{if(!v||b$1.current)return;let N=wt.find(G=>G.id===v);N&&(b$1.current=true,to(N));},[to,v,wt]),useEffect(()=>{it&&(wt.some(N=>N.id===it)||K(""));},[it,wt]);let ar=useMemo(()=>{if(!we||!ee||!Ue.length)return null;let N={};return ee.dataColumns.forEach(G=>{let U=F.filter(he=>{let Ve=Be.length>0?Be.map(rt=>pr(he[rt])):[g$1("pivot.valueLabel")];return $r(Ve)===G.colKey});N[G.id]=wn(U,G.valueItem.fieldId,G.valueItem.aggregation);}),{key:"__grand_total__",value:g$1("pivot.grandTotal")||Ou,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:N,path:[],depth:-1}},[we,ee,F,Be,Ue.length,g$1]),wo=useMemo(()=>om(ee?.rowTree??[]),[ee]),zo=useMemo(()=>om(ee?.columnTree??[]),[ee]);useEffect(()=>{Ot(N=>{let G=new Set;return N.has("__grand_total__")&&G.add("__grand_total__"),wo.forEach(U=>{N.has(U)&&G.add(U);}),G});},[wo]),useEffect(()=>{re(N=>{let G=new Set;return zo.forEach(U=>{N.has(U)&&G.add(U);}),G});},[zo]);let Kr=useCallback(()=>{Ot(N=>{let G=new Set(N);return wo.forEach(U=>G.add(U)),G});},[wo]),qr=useCallback(()=>{Ot(N=>{let G=new Set;return N.has("__grand_total__")&&G.add("__grand_total__"),G});},[]),Er=useCallback(()=>{re(new Set(zo));},[zo]),Xr=useCallback(()=>{re(new Set);},[]),Zr=useMemo(()=>!ee||Be.length===0?[]:ry(ee.columnTree,At),[Be.length,At,ee]),Ao=useMemo(()=>{if(!ee)return [];if(Be.length===0)return ee.dataColumns.map(G=>({id:G.id,label:G.label,leafColumnIds:[G.id],valueItem:G.valueItem}));let N=new Map(ee.dataColumns.map(G=>[G.id,G]));return Zr.flatMap(G=>{let U=new Map;return G.leafColumnIds.forEach(he=>{let Ve=N.get(he);if(!Ve)return;let rt=Ve.valueItem.tokenId,_e=`${I(Ve.valueItem.aggregation)} ${D.get(Ve.valueItem.fieldId)?.label??Ve.valueItem.fieldId}`,ie=U.get(rt);if(ie){ie.leafColumnIds.push(he);return}U.set(rt,{id:`${G.key}::${rt}`,label:Se.length>1?_e:G.label,leafColumnIds:[he],valueItem:Ve.valueItem});}),Array.from(U.values())})},[Be.length,D,I,ee,Se.length,Zr]),Lr=useMemo(()=>new Map(Ao.map(N=>[N.id,N])),[Ao]),Yr=useMemo(()=>Ao.map(N=>({id:N.id,colKey:N.id,valueItem:N.valueItem,label:N.label})),[Ao]),Zo=useMemo(()=>{if(!ee||Be.length===0)return [];let N=[],G=rm(ee.columnTree,At),U=G+(Se.length>1?1:0),he=(Ve,rt)=>{N[rt]??(N[rt]=[]),Ve.forEach(_e=>{let ie=_e.children.length>0&&At.has(_e.key),be=Ao.filter(Fe=>_e.leafColumnIds.some(je=>Fe.leafColumnIds.includes(je))).length,te=ie||Se.length>1?1:U-rt;N[rt].push({key:_e.key,label:_e.label,colSpan:be,rowSpan:te,expandable:_e.children.length>0,expanded:ie}),ie&&he(_e.children,rt+1);});};return he(ee.columnTree,0),Se.length>1&&(N[G]=Ao.map(Ve=>({key:Ve.id,label:Ve.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),N},[Be.length,At,ee,Se.length,Ao]),ir=useCallback((N,G)=>G.leafColumnIds.reduce((U,he)=>U+(N.aggregatedValues[he]??0),0),[]),On=useMemo(()=>g(e,{children:[f(Me,{size:"small",variant:"text",onClick:Kr,disabled:wo.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g$1("pivot.table.expandRowsAll")}),f(Me,{size:"small",variant:"text",onClick:qr,disabled:wo.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g$1("pivot.table.collapseRowsAll")}),f(Rt,{orientation:"vertical",flexItem:true}),f(Me,{size:"small",variant:"text",onClick:Er,disabled:zo.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g$1("pivot.table.expandColumnsAll")}),f(Me,{size:"small",variant:"text",onClick:Xr,disabled:Be.length===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g$1("pivot.table.collapseColumnsAll")})]}),[Be.length,zo.size,wo.size,Xr,qr,Er,Kr,g$1]),Or=()=>{if(!Ye)return null;let N=ji(Ye);if(!N||N.kind!=="item"||!N.key)return null;if(N.zone==="palette"){let Ve=D.get(N.key);return Ve?f(Hl,{label:Ve.label,subtitle:Ve.type}):null}if(N.zone==="values"){let Ve=Se.find(be=>be.tokenId===N.key);if(!Ve)return null;let _e=D.get(Ve.fieldId)?.label??Ve.fieldId,ie=`${I(Ve.aggregation)}(${_e})`;return f(es,{label:_e,caption:ie})}let U=D.get(N.key)?.label??N.key,he=Yt(N.key);return f(es,{label:U,caption:he})};return g(Le,{sx:N=>({p:{xs:1.2,md:2},borderRadius:"var(--orb-r-container)",border:`1px solid ${N.palette.divider}`,bgcolor:"var(--orb-canvas)",boxShadow:"var(--orb-shadow-2)",display:"flex",flexDirection:"column",gap:2.25}),children:[g("div",{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1.5,flexWrap:"wrap"},children:[g("div",{sx:{minWidth:0,display:"flex",flexDirection:"column",gap:.35},children:[f(E,{component:"div",sx:{fontSize:"1.08rem",fontWeight:700,lineHeight:1.25,color:"var(--orb-fg-strong)"},children:k}),f(E,{component:"div",sx:{fontSize:"0.8rem",fontWeight:400,color:"var(--orb-fg)"},children:g$1("pivot.subtitle.default")})]}),g(ce,{direction:"row",spacing:1.5,alignItems:"center",children:[Wt&&g(e,{children:[f(yr,{size:"small",sx:{minWidth:200},children:g(zt,{value:it,displayEmpty:true,onChange:N=>no(String(N.target.value)),sx:{fontSize:"0.75rem",height:32},children:[f("option",{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:g$1("pivot.preset.selectPlaceholder")}),wt.map(N=>f("option",{value:N.id,sx:{fontSize:"0.75rem"},children:N.name},N.id))]})}),f(ct,{title:g$1("pivot.preset.save"),children:f(le,{size:"small",onClick:vo,"aria-label":g$1("pivot.preset.save"),sx:{width:28,height:28,p:0},children:f(kr,{size:15})})}),f(ct,{title:g$1("pivot.preset.delete"),children:f("span",{children:f(le,{size:"small",onClick:Do,disabled:!it,"aria-label":g$1("pivot.preset.delete"),sx:{width:28,height:28,p:0},children:f(di,{size:15})})})}),f(Rt,{flexItem:true,orientation:"vertical"})]}),g(E,{component:"div",sx:{fontSize:"0.75rem",fontWeight:400,color:"var(--orb-fg)"},children:[g$1("pivot.records"),": ",f("strong",{children:o.length.toLocaleString()})," / ",g$1("pivot.afterFilter"),":"," ",f("strong",{children:F.length.toLocaleString()})]}),f(Rt,{flexItem:true,orientation:"vertical"}),g("div",{sx:{display:"flex",alignItems:"center",gap:.6},children:[f(E,{component:"div",sx:{fontSize:"0.75rem",fontWeight:500,color:"var(--orb-fg-strong)"},children:g$1("pivot.grandTotal")}),f(ii,{size:"small",checked:we,onChange:N=>X(N.target.checked)})]})]})]}),f(Rt,{}),g(DndContext,{sensors:x,collisionDetection:closestCenter,onDragStart:St,onDragEnd:ht,children:[f(qu,{isConfiguratorCollapsed:Ae,onToggleCollapse:()=>V(N=>!N),availableFields:gt,fieldMap:D,filterFields:ge,columnFields:Be,rowFields:Ue,valueFields:Se,clearZone:Ie,removeFieldFromZone:et,getFilterSelectionSummary:Yt,renderDimensionFilterSelect:Ht,renderAggregationSelect:Et,getAggregationLabel:I}),f(Od,{children:f(DragOverlay,{dropAnimation:{duration:250,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:Or()})})]}),f(em,{rows:F,fieldMap:D,rowFields:Ue,columnFields:Be,valueFields:Se,chartDimensionFieldId:Je,chartPrimaryValueFieldId:st,chartSecondaryValueFieldId:pt,chartType:Bt,isCollapsed:Xt,onChartDimensionFieldIdChange:N=>Q(N),onChartPrimaryValueFieldIdChange:N=>ye(N),onChartSecondaryValueFieldIdChange:N=>Pe(N),onChartTypeChange:N=>Oe(N),onToggleCollapse:()=>$e(N=>!N),getAggregationLabel:I}),f(Pn,{title:g$1("pivot.table.sectionTitle"),subtitle:Ue.length>0?Ue.map(N=>D.get(N)?.label??N).join(" > "):g$1("pivot.table.dimensions"),collapsed:Vt,onToggleCollapse:()=>qe(N=>!N),expandAriaLabel:g$1("pivot.table.collapse.ariaExpand"),collapseAriaLabel:g$1("pivot.table.collapse.ariaCollapse"),bodySx:{p:0},headerActions:On,children:ee===null?f("div",{sx:{py:5,px:{xs:1.2,md:1.6},textAlign:"center"},children:f(E,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:w})}):f("div",{sx:{maxHeight:s},children:g("table",{className:"orb-tbl",size:"small",stickyHeader:true,children:[f("thead",{children:(Zo.length>0?Zo:[[]]).map((N,G)=>g("tr",{children:[G===0&&f("td",{rowSpan:Math.max(Zo.length,1),sx:U=>({fontWeight:800,fontSize:"0.76rem",color:"text.primary",bgcolor:b()==="dark"?"var(--orb-canvas)":"var(--orb-surface)",borderBottom:`1px solid ${U.palette.divider}`,pl:2,minWidth:220,verticalAlign:"middle"}),children:Ue.length>0?Ue.map(U=>D.get(U)?.label).join(" > "):g$1("pivot.table.dimensions")}),(N.length>0?N:Ao.map(U=>({key:U.id,label:U.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))).map(U=>f("td",{align:"center",colSpan:U.colSpan,rowSpan:U.rowSpan,sx:he=>({fontWeight:800,fontSize:"0.75rem",color:"text.primary",bgcolor:b()==="dark"?"var(--orb-canvas)":"var(--orb-surface)",borderBottom:`1px solid ${he.palette.divider}`,minWidth:148,verticalAlign:"middle"}),children:g("div",{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:.4},children:[U.expandable&&f(le,{size:"small",onClick:()=>ro(U.key),sx:{width:22,height:22,p:0,ml:-0.2},children:U.expanded?f($o,{size:12}):f(Sr,{size:12})}),f("div",{component:"span",children:U.label})]})},U.key))]},`pivot-header-row-${G}`))}),g("tbody",{children:[ee.rowTree.map(N=>f(ns,{node:N,dataColumns:Yr,fieldMap:D,level:0,expandedKeys:Mt,onToggle:yt,getValue:(G,U)=>{let he=Lr.get(U);return he?ir(G,he):0}},N.key)),ar&&f(ns,{node:ar,dataColumns:Yr,fieldMap:D,level:0,expandedKeys:Mt,onToggle:yt,getValue:(N,G)=>{let U=Lr.get(G);return U?ir(N,U):0}})]})]})})}),g(Lt,{open:De,onClose:()=>ke(false),maxWidth:"xs",fullWidth:true,children:[f("div",{className:"orb-dialog-title",children:g$1("pivot.preset.saveDialogTitle")}),f("div",{className:"orb-dialog-content",children:f(We,{autoFocus:true,fullWidth:true,margin:"dense",label:g$1("pivot.preset.nameLabel"),value:He,onChange:N=>at(N.target.value),onKeyDown:N=>{N.key==="Enter"&&(N.preventDefault(),No());}})}),g("div",{className:"orb-dialog-actions",children:[f(Me,{onClick:()=>ke(false),children:g$1("common.cancel")}),f(Me,{variant:"contained",onClick:No,disabled:!He.trim(),children:g$1("common.save")})]})]})]})};var nm=(t,o,r)=>{let n=[...t,...o];return r&&n.includes(r)?r:n[0]??""},Gl=(t,o)=>o&&t.some(r=>r.fieldId===o)?o:t[0]?.fieldId??"",am=(t,o,r)=>r===""?"":r&&r!==o&&t.some(n=>n.fieldId===r)?r:t.find(n=>n.fieldId!==o)?.fieldId??"",EO=({fields:t,initialLayout:o,initialFilterSelections:r={},initialShowGrandTotal:n=true,initialConfiguratorCollapsed:a=false,initialChart:i,initialChartCollapsed:s=false,initialTableCollapsed:c=false})=>{let u=useRef(0),d=useMemo(()=>new Set(t.map(K=>K.id)),[t]),m=useMemo(()=>new Map(t.map(K=>[K.id,K])),[t]),[h,f]=useState(()=>so(o?.rows,d)),[p,v]=useState(()=>so(o?.columns,d)),[C,g]=useState(()=>so(o?.filters,d)),[x,y]=useState(()=>{let K=o?.values??[],De=new Set,ke=[];return K.forEach(He=>{!d.has(He.fieldId)||De.has(He.fieldId)||(De.add(He.fieldId),u.current+=1,ke.push({tokenId:`v${u.current}`,fieldId:He.fieldId,aggregation:xo(He.aggregation,m.get(He.fieldId))}));}),ke}),[b,k]=useState(r),[w,T]=useState(n),[I,S]=useState(a),[D,R]=useState(()=>nm(so(o?.rows,d),so(o?.columns,d),i?.dimensionFieldId)),[M,P]=useState(()=>{let K=(()=>{let De=o?.values??[],ke=new Set,He=[];return De.forEach(at=>{!d.has(at.fieldId)||ke.has(at.fieldId)||(ke.add(at.fieldId),He.push({tokenId:at.fieldId,fieldId:at.fieldId,aggregation:xo(at.aggregation,m.get(at.fieldId))}));}),He})();return Gl(K,i?.primaryValueFieldId)}),[A,L]=useState(()=>{let K=(()=>{let ke=o?.values??[],He=new Set,at=[];return ke.forEach(Ye=>{!d.has(Ye.fieldId)||He.has(Ye.fieldId)||(He.add(Ye.fieldId),at.push({tokenId:Ye.fieldId,fieldId:Ye.fieldId,aggregation:xo(Ye.aggregation,m.get(Ye.fieldId))}));}),at})(),De=Gl(K,i?.primaryValueFieldId);return am(K,De,i?.secondaryValueFieldId)}),[W,j]=useState(i?.chartType??"bar-vertical"),[O,_]=useState(s),[z,Y]=useState(c);useEffect(()=>{f(K=>{let De=K.filter(ke=>d.has(ke));return ur(K,De)?K:De}),v(K=>{let De=K.filter(ke=>d.has(ke));return ur(K,De)?K:De}),g(K=>{let De=K.filter(ke=>d.has(ke));return ur(K,De)?K:De}),y(K=>{let De=K.filter(ke=>d.has(ke.fieldId)).map(ke=>({...ke,aggregation:xo(ke.aggregation,m.get(ke.fieldId))}));return Ji(K,De)?K:De});},[m,d]),useEffect(()=>{R(K=>nm(h,p,K));},[p,h]),useEffect(()=>{P(K=>Gl(x,K));},[x]),useEffect(()=>{L(K=>am(x,M,K));},[M,x]);let H=useCallback(K=>{f(so(K,d));},[d]),B=useCallback(K=>{v(so(K,d));},[d]),q=useCallback(K=>{g(so(K,d));},[d]),Z=useCallback(K=>{y(De=>{let ke=K??[],He=new Set,at=[];return ke.forEach(Ye=>{if(!d.has(Ye.fieldId)||He.has(Ye.fieldId))return;He.add(Ye.fieldId);let xt=De.find(Mt=>Mt.fieldId===Ye.fieldId);if(xt){at.push({...xt,aggregation:xo(Ye.aggregation??xt.aggregation,m.get(Ye.fieldId))});return}u.current+=1,at.push({tokenId:`v${u.current}`,fieldId:Ye.fieldId,aggregation:xo(Ye.aggregation,m.get(Ye.fieldId))});}),at});},[m,d]),ue=useCallback(K=>{H(K.rows??[]),B(K.columns??[]),q(K.filters??[]),Z(K.values??[]);},[B,q,H,Z]),ne=useCallback(K=>{if(K==="rows")return f([]);if(K==="columns")return v([]);if(K==="filters")return g([]);y([]);},[]),fe=useCallback((K,De)=>{if(K==="rows")return f(ke=>ke.filter(He=>He!==De));if(K==="columns")return v(ke=>ke.filter(He=>He!==De));if(K==="filters")return g(ke=>ke.filter(He=>He!==De));y(ke=>ke.filter(He=>He.tokenId!==De));},[]),Ce=useCallback((K,De)=>{y(ke=>ke.map(He=>He.tokenId===K?{...He,aggregation:xo(De,m.get(He.fieldId))}:He));},[m]),$=useCallback((K,De)=>{k(ke=>({...ke,[K]:De}));},[]),J=useCallback(()=>{k({});},[]),ae=useCallback(()=>{T(K=>!K);},[]),xe=useCallback(()=>{S(K=>!K);},[]),pe=useCallback(K=>{R(K);},[]),me=useCallback(K=>{P(K);},[]),Ee=useCallback(K=>{L(K);},[]),Ge=useCallback(()=>{_(K=>!K);},[]),nt=useCallback(()=>{Y(K=>!K);},[]);return {model:useMemo(()=>({rowFields:h,setRowFields:f,columnFields:p,setColumnFields:v,filterFields:C,setFilterFields:g,valueFields:x,setValueFields:y,filterSelections:b,setFilterSelections:k,showGrandTotal:w,setShowGrandTotal:T,isConfiguratorCollapsed:I,setIsConfiguratorCollapsed:S,chartDimensionFieldId:D,setChartDimensionFieldId:R,chartPrimaryValueFieldId:M,setChartPrimaryValueFieldId:P,chartSecondaryValueFieldId:A,setChartSecondaryValueFieldId:L,chartType:W,setChartType:j,isChartCollapsed:O,setIsChartCollapsed:_,isTableCollapsed:z,setIsTableCollapsed:Y}),[D,M,A,W,p,C,b,O,I,z,h,w,x]),actions:{setRows:H,setColumns:B,setFilters:q,setValues:Z,setLayout:ue,clearZone:ne,removeFieldFromZone:fe,setAggregationForValue:Ce,setFilterSelection:$,resetFilterSelections:J,toggleGrandTotal:ae,toggleConfigurator:xe,setChartDimension:pe,setChartPrimaryValue:me,setChartSecondaryValue:Ee,setChartType:j,toggleChart:Ge,toggleTable:nt}}};var BO=({orientation:t="auto",defaultNavigationOpen:o,onNavOpenChange:r}={})=>{let n=io(),a=Cr("(orientation: portrait)"),i=Cr(n.breakpoints.down("md")),s=useMemo(()=>t==="auto"?a||i?"portrait":"landscape":t,[i,a,t]),[c,u]=useState(o??s==="landscape");useEffect(()=>{u(o??s==="landscape");},[o,s]);let d=h=>{u(h),r?.(h);};return {resolvedOrientation:s,isPortraitViewport:a,isCompactViewport:i,navigationOpen:c,setNavigationOpen:d,toggleNavigationOpen:()=>d(!c)}};var cy=t=>{let o=Number(t||0);return Number.isFinite(o)?o:0},VO=({rows:t,rowKey:o="id",numericField:r,defaultSelectedId:n})=>{let i=t[0]?.[o],[s,c]=useState(n??i),u=useMemo(()=>t.find(p=>p[o]===s)||t[0],[o,t,s]),[d,m]=useState(()=>{let p=u?.[r];return p==null?"0":String(p)});return {selectedId:s,selectedRecord:u,editorValue:d,setEditorValue:m,selectRecord:p=>{let v=p[o];c(v);let C=p[r];m(C==null?"0":String(C));},applyEditorValue:p=>{if(s===void 0)return;let v=cy(d),C=t.map(g=>g[o]===s?{...g,[r]:v}:g);p(C);}}};var dy=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],sm=(t,o,r,n)=>{o?.(t),n&&r?.();},KO=({open:t,onClose:o,title:r="Scan barcode",subtitle:n="Use the rear camera on the device. If scanning is unavailable, enter the code manually.",formats:a=dy,facingMode:i="environment",manualEntry:s=true,autoCloseOnDetect:c=true,scanIntervalMs:u=600,confirmLabel:d="Use code",cancelLabel:m="Close",manualPlaceholder:h="Enter barcode manually",onDetected:f$1,onError:p,sx:v})=>{let C=Jt__default.useRef(null),g$1=Jt__default.useRef(null),x=Jt__default.useRef(null),y=Jt__default.useRef(null),[b$1,k]=Jt__default.useState("idle"),[w,T]=Jt__default.useState(""),[I,S]=Jt__default.useState(null),[D,R]=Jt__default.useState(null),M=Jt__default.useCallback(()=>{x.current!==null&&(window.clearInterval(x.current),x.current=null),g$1.current&&(g$1.current.getTracks().forEach(L=>L.stop()),g$1.current=null),C.current&&(C.current.srcObject=null);},[]),P=Jt__default.useCallback(L=>{R(L),k("error"),p?.(L);},[p]);Jt__default.useEffect(()=>{if(!t){M(),k("idle"),R(null),T("");return}let L=false;return (async()=>{if(!(typeof window>"u"||typeof navigator>"u")){if(!navigator.mediaDevices?.getUserMedia){k("unsupported"),R("Camera access is not supported in this browser.");return}k("starting"),R(null);try{let j=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:i}}});if(L){j.getTracks().forEach(O=>O.stop());return}if(g$1.current=j,C.current&&(C.current.srcObject=j,await C.current.play()),!window.BarcodeDetector){k("unsupported"),R("BarcodeDetector is not available. Camera preview is ready and manual entry is enabled.");return}y.current=new window.BarcodeDetector({formats:a}),k("ready"),x.current=window.setInterval(async()=>{if(!(!C.current||!y.current)&&!(C.current.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))try{let _=(await y.current.detect(C.current)).find(Y=>Y.rawValue);if(!_?.rawValue)return;let z={rawValue:_.rawValue,format:_.format};S(z),M(),sm(z,f$1,o,c);}catch(O){P(O instanceof Error?O.message:"Failed to detect barcode.");}},u);}catch(j){P(j instanceof Error?j.message:"Unable to start camera.");}}})(),()=>{L=true,M();}},[c,i,a,o,f$1,t,P,u,M]);let A=()=>{let L=w.trim();if(!L)return;let W={rawValue:L,format:"manual"};S(W),sm(W,f$1,o,c);};return g(Lt,{open:t,onClose:o,fullWidth:true,maxWidth:"sm",children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:900},children:r}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g(ce,{spacing:2,sx:v,children:[f(E,{sx:{fontSize:"0.88rem",color:"text.secondary",lineHeight:1.55},children:n}),g(Le,{elevation:0,sx:{position:"relative",overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:"divider",minHeight:280,background:b()==="dark"?"linear-gradient(180deg, color-mix(in oklch, var(--orb-canvas) 92%, transparent), color-mix(in oklch, var(--orb-canvas) 96%, transparent))":"linear-gradient(180deg, var(--orb-surface), color-mix(in oklch, var(--orb-border) 92%, transparent))"},children:[f("video",{ref:C,muted:true,playsInline:true,autoPlay:true,style:{width:"100%",height:280,objectFit:"cover",display:"block"}}),f("div",{sx:{pointerEvents:"none",position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:f("div",{sx:{width:"72%",maxWidth:320,aspectRatio:"1.7 / 1",borderRadius:3,border:"2px solid rgba(255,255,255,0.95)",boxShadow:"0 0 0 999px rgba(15,23,42,0.24)",position:"relative"},children:f("div",{sx:{position:"absolute",top:"50%",left:0,right:0,height:2,bgcolor:"var(--orb-ai-accent)",boxShadow:"0 0 18px color-mix(in oklch, var(--orb-ai-accent) 85%, transparent)"}})})}),g("div",{sx:{position:"absolute",top:12,left:12,display:"flex",gap:1,flexWrap:"wrap"},children:[f(Ct,{icon:f(Xd,{}),label:b$1==="ready"?"Camera ready":b$1==="starting"?"Starting camera":b$1==="unsupported"?"Preview only":b$1==="error"?"Scanner error":"Idle",size:"small",color:b$1==="error"?"error":"primary",variant:"filled"}),I?f(Ct,{icon:f(up,{}),label:`${I.format||"barcode"}: ${I.rawValue}`,size:"small",color:"success",variant:"filled"}):null]})]}),D?f(Jo,{severity:b$1==="unsupported"?"info":"warning",children:D}):null,s?g(ce,{direction:{xs:"column",sm:"row"},spacing:1.25,children:[f(We,{fullWidth:true,label:"Barcode",placeholder:h,value:w,onChange:L=>T(L.target.value)}),f(Me,{variant:"contained",onClick:A,sx:{minHeight:56,px:2.5},children:d})]}):null]})}),f("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:f(Me,{onClick:o,children:m})})]})};var py={default:"var(--orb-status-fg)",primary:"var(--orb-status-primary)",success:"var(--orb-status-success)",warning:"var(--orb-status-warning)",error:"var(--orb-status-error)",info:"var(--orb-status-info)"},JO=({title:t,description:o,kicker:r,icon:n,badges:a=[],metrics:i=[],footer:s,children:c,selected:u=false,draggable:d=false,isDragging:m=false,swipeThreshold:h=88,startAction:f$1,endAction:p,dragHandleProps:v,onClick:C,onSwipe:g$1,sx:x})=>{let[y,b$1]=useState(0),[k,w]=useState(false),T=useRef(null),I=useRef(0),S=useRef(0),D=!!(f$1||p),R=132,M=()=>{b$1(0),w(false),T.current=null,I.current=0,S.current=0;},P=O=>{(O==="start"?f$1:p)?.onTrigger?.(),g$1?.(O),M();},A=O=>{!D||O.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(T.current=O.pointerId,I.current=O.clientX,S.current=O.clientX,w(true),O.currentTarget.setPointerCapture(O.pointerId));},L=O=>{if(!k||T.current!==O.pointerId)return;S.current=O.clientX;let _=S.current-I.current,z=Math.max(-R,Math.min(R,_));b$1(z);},W=O=>{if(!k||T.current!==O.pointerId)return;let _=S.current-I.current;if(_>=h&&f$1){P("start");return}if(_<=-h&&p){P("end");return}Math.abs(_)<12&&C?.(),M();},j=(O,_)=>{if(!O)return null;let z=O.backgroundColor||py[O.tone||"default"];return f("div",{sx:{position:"absolute",top:0,bottom:0,[_]:0,width:R,px:2,display:"flex",alignItems:"center",justifyContent:_==="left"?"flex-start":"flex-end",color:"var(--orb-on-primary)",background:`linear-gradient(135deg, ${z}, rgba(15,23,42,0.92))`},children:g(ce,{direction:"row",spacing:1,alignItems:"center",children:[O.icon,f(E,{sx:{fontWeight:700,fontSize:"0.95rem"},children:O.label})]})})};return g("div",{sx:{position:"relative",overflow:"hidden",borderRadius:4,...x},children:[j(f$1,"left"),j(p,"right"),f(Le,{elevation:0,onPointerDown:A,onPointerMove:L,onPointerUp:W,onPointerCancel:M,sx:{position:"relative",zIndex:1,p:2,borderRadius:4,border:"1px solid",borderColor:u?"primary.main":"divider",background:b()==="dark"?"linear-gradient(180deg, color-mix(in oklch, var(--orb-surface-3) 96%, transparent), color-mix(in oklch, var(--orb-canvas) 92%, transparent))":"linear-gradient(180deg, var(--orb-canvas), var(--orb-surface))",color:"text.primary",boxShadow:u?"0 18px 42px color-mix(in oklch, var(--orb-primary) 18%, transparent)":"0 12px 28px rgba(15, 23, 42, 0.08)",transform:`translate3d(${y}px, 0, 0) scale(${m?.985:1})`,transition:k?"none":"transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease",touchAction:"pan-y",cursor:C?"pointer":"default",opacity:m?.9:1},children:g(ce,{spacing:1.5,children:[g(ce,{direction:"row",spacing:1.5,alignItems:"flex-start",children:[n?f("div",{sx:{mt:.25},children:n}):null,g("div",{sx:{flex:1,minWidth:0},children:[r?f(E,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:"0.08em",color:"text.secondary"},children:r}):null,f(E,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:t}),o?f(E,{sx:{mt:.5,fontSize:"0.9rem",color:"text.secondary",lineHeight:1.45},children:o}):null]}),d?f("div",{"data-no-swipe":"true",...v,sx:{alignSelf:"center",display:"inline-flex",touchAction:"none"},children:f(le,{size:"small",children:f(tp,{})})}):null]}),a.length>0?f(ce,{direction:"row",spacing:1,useFlexGap:true,flexWrap:"wrap",children:a.map((O,_)=>f(Ct,{label:O,size:"small",sx:{borderRadius:999,fontWeight:700,bgcolor:"action.hover",color:"text.primary"}},_))}):null,i.length>0?f("div",{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:1},children:i.map(O=>g(Le,{elevation:0,sx:{p:1.25,borderRadius:3,bgcolor:"action.hover",border:"1px solid",borderColor:"divider",color:"text.primary"},children:[f(E,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:O.label}),f(E,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.2},children:O.value})]},O.id))}):null,c,s]})})]})};var fa=({label:t,onPress:o,emphasis:r="default"})=>f("div",{component:"button",type:"button",onClick:o,sx:n=>({minHeight:72,borderRadius:3,border:"1px solid",borderColor:r==="primary"?"primary.main":"divider",background:r==="primary"?n.palette.primary.main:r==="danger"?b()==="dark"?"color-mix(in oklch, var(--orb-status-error) 18%, transparent)":"color-mix(in oklch, var(--orb-status-error) 10%, transparent)":b()==="dark"?"rgba(255,255,255,0.04)":"var(--orb-canvas)",color:r==="primary"?"var(--orb-on-primary)":"text.primary",fontSize:"1.25rem",fontWeight:800,transition:"transform 120ms ease, box-shadow 160ms ease, background-color 160ms ease",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent","&:active":{transform:"scale(0.98)"}}),children:t}),sF=({value:t,defaultValue:o="",title:r,subtitle:n,placeholder:a="0",allowDecimal:i=false,allowNegative:s=false,maxLength:c,confirmLabel:u,clearLabel:d,backspaceLabel:m,onChange:h,onSubmit:f$1,onClose:p,sx:v})=>{let{t:C}=de(),[g$1,x]=useState(o),y=t??g$1,b=M=>{t===void 0&&x(M),h?.(M);},k=M=>{c&&y.length>=c||b(`${y}${M}`);},w=M=>{if(M==="00"){if(!y){b("0");return}k("00");return}k(M);},T=()=>{!i||y.includes(".")||b(y?`${y}.`:"0.");},I=()=>{if(s){if(y.startsWith("-")){b(y.slice(1));return}b(y?`-${y}`:"-");}},S=()=>{b(y.slice(0,-1));},D=()=>{b("");},R=()=>{f$1?.(y);};return f(Le,{elevation:0,sx:{p:2,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",...v},children:g(ce,{spacing:2,children:[g(ce,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[g("div",{sx:{minWidth:0},children:[r?f(E,{sx:{fontSize:"1rem",fontWeight:800},children:r}):null,n?f(E,{sx:{mt:.5,fontSize:"0.86rem",color:"text.secondary"},children:n}):null]}),p?f(le,{onClick:p,size:"small",children:f(Jd,{})}):null]}),f(Le,{elevation:0,sx:{p:2,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:f(E,{sx:{minHeight:38,fontSize:y?"1.9rem":"1.25rem",fontWeight:900,letterSpacing:"0.06em",color:y?"text.primary":"text.disabled"},children:y||a})}),g("div",{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[["1","2","3","4","5","6","7","8","9"].map(M=>f(fa,{label:M,onPress:()=>w(M)},M)),f(fa,{label:s?"+/-":"00",onPress:s?I:()=>w("00")}),f(fa,{label:"0",onPress:()=>w("0")}),f(fa,{label:i?".":m?String(m):"DEL",onPress:i?T:S})]}),g("div",{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[f("div",{component:"button",type:"button",onClick:S,sx:{minHeight:64,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"},children:g(ce,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[f(qd,{}),f(E,{sx:{fontWeight:700},children:m||"DEL"})]})}),f(fa,{label:String(d||"CLR"),onPress:D,emphasis:"danger"}),f("div",{component:"button",type:"button",onClick:R,sx:M=>({minHeight:64,borderRadius:3,border:"1px solid",borderColor:"primary.main",background:M.palette.primary.main,color:"var(--orb-on-primary)",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"}),children:g(ce,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[f(Yd,{}),f(E,{sx:{fontWeight:800},children:u||C("common.ok")})]})})]})]})})};var cm=({touchMode:t="comfortable",sx:o,...r})=>{let n=t==="expanded";return f("div",{sx:{"& .orb-card":{borderRadius:4},"& .orb-autocomplete":{minWidth:{xs:"100%",md:260}},"& .orb-autocomplete .orb-inp-adornment-wrap, & .orb-inp":{backgroundColor:"transparent !important"},"& .orb-inp-adornment-wrap, & .orb-inp":{minHeight:n?56:50,borderRadius:3,fontSize:n?"0.98rem":"0.92rem"},"& .orb-inp":{py:n?1.6:1.25,fontSize:n?"0.98rem":"0.92rem"},"& label":{fontSize:n?"0.95rem":"0.88rem"},"& .orb-btn":{minHeight:n?48:44,px:n?2.25:1.75,borderRadius:3,fontSize:n?"0.95rem":"0.88rem",fontWeight:700},"& .orb-icon-btn":{width:n?40:36,height:n?40:36},"& .orb-menu-item, & option":{minHeight:n?44:38,fontSize:n?"0.95rem":"0.88rem"},"& .orb-list-subheader":{py:1},"& .orb-chk":{p:n?1:.75},"& .orb-form-control-label > span":{fontSize:n?"0.95rem":"0.88rem"},"& .orb-dialog":{borderRadius:4},"& .orb-dialog-title":{fontSize:n?"1.05rem":"0.98rem",fontWeight:800},"& .orb-dialog-content .orb-inp-adornment-wrap, & .orb-inp":{minHeight:52},"& .orb-grid > *":{minWidth:0},...o},children:f(_o,{...r})})};var fy=(t,o,r)=>{if(r?.(o),!!o.href){if(o.href.startsWith("http://")||o.href.startsWith("https://")){window.open(o.href,"_blank");return}t.push(o.href);}},dm=({items:t,selectedId:o,orientation:r="auto",onItemSelect:n,sx:a})=>{let i=io(),[s,c]=useState(false);useEffect(()=>{c(true);},[]);let u=Cr("(orientation: portrait)"),d=Cr(i.breakpoints.down("md")),m=r==="auto"?u||d?"portrait":"landscape":r,h=useRouter();return f("div",{sx:{display:"grid",gridTemplateColumns:!s||m==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(180px, 1fr))",gap:1.5,...a},children:t.map(f$1=>{let p=f$1.id===o,v=f$1.color||(p?i.palette.primary.main:i.palette.divider);return f(Le,{elevation:0,sx:{overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:p?"primary.main":"divider",boxShadow:p?"0 18px 40px color-mix(in oklch, var(--orb-primary) 16%, transparent)":"none",bgcolor:b()==="dark"?"color-mix(in oklch, var(--orb-surface-3) 60%, transparent)":"background.paper"},children:f("div",{component:"button",type:"button",disabled:f$1.disabled,onClick:()=>fy(h,f$1,n),sx:{width:"100%",p:2,minHeight:m==="portrait"?156:148,display:"block",border:0,background:"transparent",textAlign:"left",cursor:f$1.disabled?"not-allowed":"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent",color:"text.primary"},children:g(ce,{spacing:1.5,sx:{height:"100%"},children:[g(ce,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[f("div",{sx:{width:44,height:44,borderRadius:3,display:"grid",placeItems:"center",color:p?"var(--orb-on-primary)":"text.primary",background:p?v:"action.hover"},children:f$1.icon||f(E,{sx:{fontSize:"1rem",fontWeight:900},children:f$1.title.slice(0,1).toUpperCase()})}),f$1.badge!==void 0?f("div",{sx:{minWidth:34,px:1,py:.4,borderRadius:999,bgcolor:p?"primary.main":"action.hover",color:p?"var(--orb-on-primary)":"text.secondary",textAlign:"center",fontWeight:800,fontSize:"0.8rem"},children:f$1.badge}):null]}),g("div",{sx:{flex:1,minWidth:0},children:[f(E,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.25},children:f$1.title}),f$1.caption?f(E,{sx:{mt:.5,fontSize:"0.74rem",fontWeight:700,color:"text.secondary"},children:f$1.caption}):null,f$1.description?f(E,{sx:{mt:.75,fontSize:"0.84rem",lineHeight:1.45,color:"text.secondary"},children:f$1.description}):null]})]})})},f$1.id)})})};var mm=(t,o)=>o.trim()?t.reduce((r,n)=>{let a=n.title?.toLowerCase().includes(o.toLowerCase())||n.label?.toLowerCase().includes(o.toLowerCase())||n.description?.toLowerCase().includes(o.toLowerCase()),i=n.children?mm(n.children,o):[];return (a||i.length>0)&&r.push({...n,children:i.length>0?i:n.children}),r},[]):t,Cy=t=>{let o=new Set,r=n=>{n.forEach(a=>{a.children?.length&&(o.add(a.id),r(a.children));});};return r(t),o},gm=({collapsed:t=false,onToggle:o,className:r="",maxHeight:n,menuData:a=[],colorMode:i="light",orientation:s="auto",headerSlot:c,footerSlot:u,activeHref:d,onItemSelect:m})=>{let{t:h}=de(),f$1=io(),p=Eo("(orientation: portrait)"),v=Eo(f$1.breakpoints.down("md")),C=s==="auto"?p||v?"portrait":"landscape":s,g$1=i==="dark",x=useRouter(),y=usePathname(),[b,k]=useState(""),[w,T]=useState(new Set),I=useMemo(()=>mm(a,b),[a,b]),S=useMemo(()=>b.trim()?Cy(I):w,[w,I,b]);useEffect(()=>{t&&T(new Set);},[t]);let D=L=>L.appurl||L.href||"",R=L=>{m?.(L);let W=D(L);if(W){if(W.startsWith("http://")||W.startsWith("https://")){window.open(W,"_blank");return}x.push(W);}},M=L=>{let W=!!L.children?.length;if(t&&W){o?.();return}if(W){T(j=>{let O=new Set(j);return O.has(L.id)?O.delete(L.id):O.add(L.id),O});return}R(L);},P=L=>{let W=d||y,j=D(L);return !!(j&&W===j)},A=(L,W=0)=>{let j=!!L.children?.length,O=S.has(L.id),_=P(L);return f("div",{sx:{pl:W===0?0:1.5},children:g(Le,{elevation:0,sx:{mb:1,overflow:"hidden",borderRadius:3,border:"1px solid",borderColor:_?"primary.main":"divider",bgcolor:_?"action.selected":"background.paper"},children:[g("div",{component:"button",type:"button",onClick:()=>M(L),sx:{width:"100%",px:1.5,py:1.4,display:"flex",alignItems:"center",gap:1.25,border:0,background:"transparent",textAlign:"left",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"},children:[f(ni,{variant:"rounded",sx:{width:40,height:40,bgcolor:_?"primary.main":"action.hover",color:_?"var(--orb-on-primary)":"text.primary"},children:L.icon||(L.title||L.label||"?").slice(0,1).toUpperCase()}),g("div",{sx:{flex:1,minWidth:0},children:[f(E,{sx:{fontSize:"0.95rem",fontWeight:800,lineHeight:1.2},children:L.title||L.label}),L.description?f(E,{sx:{mt:.4,fontSize:"0.78rem",color:"text.secondary",lineHeight:1.35},children:L.description}):null]}),j?f(nn,{sx:{transform:O?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):f(li,{color:"action"})]}),j?f(rn,{in:O,children:f("div",{sx:{px:1.25,pb:1.25},children:L.children?.map(z=>A(z,W+1))})}):null]})},L.id)};return t?f(Le,{elevation:0,className:r,sx:{width:C==="portrait"?"100%":88,p:1,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:g$1?"var(--orb-surface)":"color-mix(in oklch, var(--orb-canvas) 88%, transparent)",maxHeight:n?`${n}px`:void 0,overflowY:"auto"},children:g(ce,{spacing:1,children:[f(le,{onClick:o,sx:{width:48,height:48,alignSelf:"center",bgcolor:"action.hover"},title:h("navigation.expand"),children:f(gi,{})}),a.map(L=>f(le,{onClick:()=>M(L),sx:{width:56,height:56,alignSelf:"center",borderRadius:3,bgcolor:P(L)?"primary.main":"action.hover",color:P(L)?"var(--orb-on-primary)":"text.primary"},children:L.icon||(L.title||L.label||"?").slice(0,1).toUpperCase()},L.id))]})}):f(Le,{elevation:0,className:r,sx:{width:C==="portrait"?"100%":320,p:1.25,borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:g$1?"var(--orb-surface)":"color-mix(in oklch, var(--orb-canvas) 88%, transparent)",maxHeight:n?`${n}px`:void 0,overflow:"hidden",display:"flex",flexDirection:"column"},children:g(ce,{spacing:1.25,sx:{flex:1,minHeight:0},children:[g(ce,{direction:"row",spacing:1,alignItems:"center",children:[f(We,{value:b,onChange:L=>k(L.target.value),placeholder:h("navigation.searchPlaceholder"),size:"small",fullWidth:true,InputProps:{startAdornment:f(mp,{fontSize:"small",color:"action"})}}),C==="landscape"&&!t?f(le,{onClick:o,sx:{bgcolor:"action.hover"},children:f(lp,{})}):null]}),c,f("div",{sx:{flex:1,minHeight:0,overflowY:"auto",pr:.25},children:I.length>0?I.map(L=>A(L)):f(E,{sx:{p:2,fontSize:"0.88rem",color:"text.secondary",textAlign:"center"},children:h("navigation.noMatch")})}),u]})})};var hm=(t,o)=>{let r=o[t.id];if(t.render)return t.render(r,o);if(r==null||r==="")return "--";if(t.numeric){if(typeof r=="number")return r.toLocaleString();if(typeof r=="string"&&r.trim()!==""&&!Number.isNaN(Number(r)))return Number(r).toLocaleString()}return String(r)},xy=t=>Jt__default.isValidElement(t)?f("div",{sx:{display:"inline-flex",alignItems:"center"},children:t}):f(E,{sx:{mt:.2,fontSize:"0.88rem",fontWeight:800},children:t}),wy=(t,o)=>{let r=o[t.id];if(r==null||r==="")return "--";if(t.numeric){if(typeof r=="number")return r.toLocaleString();if(typeof r=="string"&&r.trim()!==""&&!Number.isNaN(Number(r)))return Number(r).toLocaleString()}return String(r)},Sy=({summaryRow:t,visibleColumns:o,columns:r})=>{let n=r.filter(a=>o.includes(a.id)&&t[a.id]!=="");return n.length===0?null:f(Le,{elevation:0,sx:{p:1.5,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:g(ce,{spacing:1,children:[f(E,{sx:{fontSize:"0.82rem",fontWeight:800,color:"text.secondary"},children:"Summary"}),f("div",{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(132px, 1fr))",gap:1},children:n.map(a=>g(Le,{elevation:0,sx:{p:1.1,borderRadius:3,border:"1px solid",borderColor:"divider"},children:[f(E,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:a.label}),f(E,{sx:{mt:.25,fontSize:"0.96rem",fontWeight:800},children:t[a.id]})]},`summary-${a.id}`))})]})})},ky=t=>{let{t:o}=de(),r=io(),{title:n,showToolbar:a=true,selectionMode:i,selected:s=[],onSelectionChange:c,actions:u,extraTools:d,fitContainer:m=false,fullWidth:h=false,maxHeight:f$1,loading:p=false,rowsPerPageOptions:v=[20,50,100,-1],onLayoutSave:C,filterConfig:g$1,rowKey:x,tableKey:y="default",graphReport:b$1,quickCreate:k,quickEdit:w,quickDelete:T,serviceUrl:I,orientation:S="auto",cardTitleField:D,cardSubtitleFields:R,toolbarSlot:M,emptyState:P,rowHeight:A="comfortable",cardActionSlot:L,renderCardFooter:W,onRowClick:j}=t,O=n||o("table.title.default"),_=Eo("(orientation: portrait)"),z=Eo(r.breakpoints.down("md")),Y=S==="auto"?_||z?"portrait":"landscape":S,{columns:H,filterText:B,setFilterText:q,visibleColumns:Z,showSummary:ue,setShowSummary:ne,summaryColumns:fe,grouping:Ce,setGrouping:$,expandedGroups:J,groupAnchorEl:ae,setGroupAnchorEl:xe,summaryAnchorEl:pe,setSummaryAnchorEl:me,anchorEl:Ee,setAnchorEl:Ge,contextMenu:nt,sortedAndFilteredRows:it,summaryRow:K,visibleRows:De,page:ke,setPage:He,rowsPerPage:at,setRowsPerPage:Ye,totalDisplayCount:xt,setSelected:Mt,handleClick:Ot,toggleSummaryColumn:At,handleExport:re,handleCloseContextMenu:Ue,toggleColumnVisibility:Be,toggleGroupExpand:ge,handleExpandGroupRecursively:Se,handleCollapseGroupRecursively:oe,handleLayoutLoad:we,handleVariantLoad:Ae,handleLayoutSave:Je,effectiveAppId:st,currentLayoutData:pt,currentLayoutId:Bt,layoutIdToLoad:Xt,graphReportOpen:Vt,handleOpenGraphReport:wt,handleCloseGraphReport:Wt}=fn(t),ft=b$1?.enabled??false,Dt=ft&&(b$1?.interaction?.enabled??true),lt=Ei(),Ft=x||"id",Zt=Jt__default.useMemo(()=>({borderRadius:999,fontWeight:700,borderColor:tt(r.palette.divider,b()==="dark"?.55:.3),bgcolor:b()==="dark"?tt(r.palette.common.white,.06):tt(r.palette.background.paper,.92),color:r.palette.text.primary,"& .orb-chip-label":{px:1.05}}),[r]),X=Jt__default.useMemo(()=>({...Zt,borderColor:tt(r.palette.primary.main,b()==="dark"?.42:.24),bgcolor:b()==="dark"?tt(r.palette.primary.main,.16):tt(r.palette.primary.main,.08)}),[Zt,r]),V=Jt__default.useMemo(()=>{let te=new Set(s);return it.filter(Fe=>te.has(Fe?.[Ft]))},[Ft,s,it]),Q=V.length===1?V[0]:null,ye=!!k?.enabled,Pe=!!w?.enabled,Oe=!!T?.enabled,$e=k?.fields,qe=k?.excludeFields||[],Qe=k?.initialValues||{},ut=w?.fields,gt=w?.excludeFields||[],It=w?.editableFields||[],bt=w?.nonEditableFields||[],F=w?.primaryKeys?.length?w.primaryKeys:[Ft],[ee,ve]=Jt__default.useState(false),[Ie,et]=Jt__default.useState(false),[Xe,St]=Jt__default.useState({}),[ht,mt]=Jt__default.useState(false),[yt,ro]=Jt__default.useState(false),[Et,Yt]=Jt__default.useState({}),[Ht,Ut]=Jt__default.useState(false),[$t,to]=Jt__default.useState(false),no=p||Ie||yt||$t,vo=Jt__default.useMemo(()=>{let te=[...H];if(Array.isArray($e)&&$e.length>0){let Fe=new Set($e);te=te.filter(je=>Fe.has(je.id));}if(qe.length>0){let Fe=new Set(qe);te=te.filter(je=>!Fe.has(je.id));}return te.filter(Fe=>!!Fe?.id)},[H,qe,$e]),No=Jt__default.useMemo(()=>{let te=[...H];if(Array.isArray(ut)&&ut.length>0){let Fe=new Set(ut);te=te.filter(je=>Fe.has(je.id));}if(gt.length>0){let Fe=new Set(gt);te=te.filter(je=>!Fe.has(je.id));}return te.filter(Fe=>!!Fe?.id)},[H,gt,ut]),Do=Jt__default.useMemo(()=>new Set(F),[F]),ar=Jt__default.useMemo(()=>new Set(It),[It]),wo=Jt__default.useMemo(()=>new Set(bt),[bt]),zo=Jt__default.useCallback(te=>ar.size>0?ar.has(te):!(wo.has(te)||Do.has(te)),[ar,wo,Do]);Jt__default.useEffect(()=>{!Vt&&lt.hasActiveFilters&&lt.clearAll();},[lt,Vt]);let Kr=()=>{let te={};vo.forEach(Fe=>{te[Fe.id]=Qe[Fe.id]??"";}),St(te),ve(true);},qr=(te,Fe)=>{St(je=>({...je,[te]:Fe}));},Er=async()=>{if(!k?.onSubmit){ve(false);return}try{et(!0),await k.onSubmit(Xe),ve(!1);}finally{et(false);}},Xr=()=>{if(!Q)return;let te={};No.forEach(je=>{te[je.id]=Q[je.id]??"";});let Fe=w?.getInitialValues?{...te,...w.getInitialValues(Q)}:te;Yt(Fe),mt(true);},Zr=(te,Fe)=>{Yt(je=>({...je,[te]:Fe}));},Ao=async()=>{if(Q){if(!w?.onSubmit){mt(false);return}try{ro(!0),await w.onSubmit(Et,Q),mt(!1);}finally{ro(false);}}},Lr=()=>{V.length!==0&&Ut(true);},Yr=async()=>{if(V.length===0){Ut(false);return}if(!T?.onConfirm){Ut(false),Mt([]),c?.([]);return}try{to(!0),await T.onConfirm(V),Ut(!1),Mt([]),c?.([]);}finally{to(false);}},Zo=it,{fieldMapping:ir}=un({rows:Zo,config:{...b$1,title:b$1?.title||`${O} ${o("graph.reportTitle")}`}}),On=Jt__default.useMemo(()=>Dt?lt.applyRows(Zo,ir):Zo,[ir,lt,Dt,Zo]),{model:Or}=un({rows:On,config:{...b$1,title:b$1?.title||`${O} ${o("graph.reportTitle")}`,fieldMapping:ir}}),N=Or.table.columns.map(te=>({id:te.id,label:te.label,align:te.align||"left",minWidth:120,numeric:te.align==="right"})),G=st?f(hn,{appId:st,tableKey:y,currentLayoutData:pt,onLayoutLoad:we,targetLayoutId:Xt,activeLayoutId:Bt,serviceUrl:I??g$1?.serviceUrl}):null,U=H.filter(te=>Z.includes(te.id)),he=U.find(te=>te.id===D)||U[0],Ve=R?.map(te=>U.find(Fe=>Fe.id===te)).filter(Boolean)||U.filter(te=>te.id!==he?.id).slice(0,Y==="portrait"?2:3),rt=U.filter(te=>te.id!==he?.id&&!Ve.some(Fe=>Fe.id===te.id)),_e=[M,d].filter(Boolean),ie=g(e,{children:[f(dn,{groupAnchorEl:ae,setGroupAnchorEl:xe,grouping:Ce,setGrouping:$,columns:H}),f(pn,{anchorEl:Ee,setAnchorEl:Ge,columns:H,visibleColumns:Z,toggleColumnVisibility:Be}),f(Pi,{anchorEl:pe,setAnchorEl:me,showSummary:ue,setShowSummary:ne,columns:H,summaryColumns:fe,toggleSummaryColumn:At}),f(Ti,{contextMenu:nt,handleCloseContextMenu:Ue,columns:H,visibleColumns:Z,toggleColumnVisibility:Be})]}),be=(te,Fe,je)=>{let Ne=s.includes(Fe),Ze=Y==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(140px, 1fr))",kt=je%2===0?tt(r.palette.primary.main,b()==="dark"?.09:.04):tt(r.palette.primary.main,b()==="dark"?.05:.022),Qr=tt(r.palette.divider,.22);return f(Le,{elevation:0,onClick:()=>{Ot({},te),j?.(te);},sx:{p:A==="compact"?1.25:1.5,borderRadius:4,border:"0.5px solid",borderColor:Ne?tt(r.palette.primary.main,.38):Qr,background:Ne?`linear-gradient(135deg, ${tt(r.palette.primary.main,.13)}, ${tt(r.palette.primary.main,.06)})`:`linear-gradient(135deg, ${kt}, ${tt(r.palette.primary.main,.015)})`,boxShadow:Ne?`0 12px 30px ${tt(r.palette.primary.main,.2)}`:`0 3px 10px ${tt(r.palette.common.black,.045)}`,cursor:"pointer",position:"relative",overflow:"hidden",transition:"border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease, background 160ms ease","&::before":{content:'""',position:"absolute",left:0,top:0,bottom:0,width:4,background:Ne?r.palette.primary.main:je%2===0?tt(r.palette.primary.main,.26):tt(r.palette.text.primary,.16)},"&:hover":{boxShadow:`0 10px 20px ${tt(r.palette.primary.main,.12)}`,transform:"translateY(-1px)"},"&:active":{transform:"scale(0.995)"}},children:g(ce,{spacing:1.25,children:[g(ce,{direction:"row",spacing:1.25,alignItems:"flex-start",children:[i?f(Tt,{checked:Ne,onClick:ko=>ko.stopPropagation(),onChange:()=>Ot({},te),sx:{mt:-0.6,ml:-0.6}}):null,g("div",{sx:{flex:1,minWidth:0},children:[he?f(E,{sx:{fontSize:"1rem",fontWeight:900,lineHeight:1.25},children:hm(he,te)}):null,Ve.length>0?f(ce,{direction:"row",spacing:.75,useFlexGap:true,flexWrap:"wrap",sx:{mt:.75},children:Ve.map(ko=>f(Ct,{label:`${ko.label}: ${wy(ko,te)}`,size:"small",variant:"outlined",sx:Zt},`${Fe}-${ko.id}`))}):null]}),L?f("div",{onClick:ko=>ko.stopPropagation(),children:L(te)}):null]}),rt.length>0?f("div",{sx:{display:"grid",gridTemplateColumns:Ze,gap:1},children:rt.map(ko=>g(Le,{elevation:0,sx:{p:1,borderRadius:3,bgcolor:b()==="dark"?tt(r.palette.background.default,.7):tt(r.palette.background.paper,.92),border:"0.1px solid",borderColor:tt(r.palette.divider,.24)},children:[f(E,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:ko.label}),xy(hm(ko,te))]},`${Fe}-${ko.id}-detail`))}):null,W?g(e,{children:[f(Rt,{}),f("div",{onClick:ko=>ko.stopPropagation(),children:W(te)})]}):null]})},Fe)};return g("div",{sx:{width:h?"100%":"auto",mb:m?0:2,...m?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[g$1?f("div",{sx:{mb:2},children:f(cm,{...g$1,onVariantLoad:te=>{Ae(te),g$1.onVariantLoad?.(te);},appId:g$1.appId,tableKey:y,currentLayout:[{tableKey:y,layoutData:pt}],currentLayoutId:Bt,layoutRefs:[{tableKey:y,layoutId:Bt}],variantService:g$1.variantService,serviceUrl:I??g$1.serviceUrl,touchMode:Y==="portrait"?"expanded":"comfortable"})}):null,g(Le,{sx:{width:h?"100%":"auto",mb:m?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",bgcolor:"transparent",backgroundImage:"none",boxShadow:"none","&::before":no?{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"3px",background:"linear-gradient(90deg, color-mix(in oklch, var(--orb-primary) 0%, transparent) 0%, color-mix(in oklch, var(--orb-primary) 25%, transparent) 25%, var(--orb-primary) 50%, color-mix(in oklch, var(--orb-primary) 25%, transparent) 75%, color-mix(in oklch, var(--orb-primary) 0%, transparent) 100%)",backgroundSize:"220% 100%",animation:"cTableTopMarquee 1.2s linear infinite",zIndex:6,pointerEvents:"none"}:{},"@keyframes cTableTopMarquee":{"0%":{backgroundPosition:"220% 0"},"100%":{backgroundPosition:"-120% 0"}},...f$1?{height:f$1}:m?{flex:1,minHeight:0,height:"100%"}:{}},children:[a?f("div",{sx:{"& .orb-toolbar":{minHeight:60,alignItems:{xs:"flex-start",md:"center"},flexWrap:"wrap",rowGap:1,columnGap:1},"& .orb-toolbar > :nth-of-type(1)":{width:{xs:"100%",md:"auto"},"& .orb-fld":{width:{xs:"100%",md:300}}},"& .orb-toolbar > :nth-of-type(2)":{flexShrink:0},"& .orb-toolbar > :nth-of-type(3)":{display:{xs:"none",md:"block"}},"& .orb-toolbar > :nth-of-type(4)":{ml:"auto",justifyContent:"flex-end",flexWrap:"wrap"},"& .orb-inp-adornment-wrap, & .orb-inp":{minHeight:46},"& .orb-icon-btn":{width:40,height:40},"& .orb-body, & .orb-body-dense, & .orb-label, & .orb-meta":{fontSize:"0.9rem"},"& button":{borderRadius:2.5}},children:f(xi,{filterText:B,setFilterText:q,onRowsPerPageChange:Ye,rowsPerPage:at,rowsPerPageOptions:v,page:ke,count:xt,onPageChange:He,actions:u,extraTools:_e,grouping:Ce,setGroupAnchorEl:xe,showSummary:ue,setShowSummary:ne,setAnchorEl:Ge,setSummaryAnchorEl:me,handleExport:re,showCreateButton:ye,onOpenCreateDialog:Kr,showEditButton:Pe,onOpenEditDialog:Xr,editDisabled:V.length!==1,showDeleteButton:Oe,onOpenDeleteConfirm:Lr,deleteDisabled:V.length===0,onLayoutSave:C||g$1?.variantService&&g$1?.appId?Je:void 0,loading:p,layoutManager:G,onOpenGraphReport:ft?wt:void 0})}):null,f("div",{sx:{flex:1,minHeight:0,overflow:"auto",p:1.5},children:g(ce,{spacing:1.25,children:[De.length===0&&!p?P||f(Le,{elevation:0,sx:{p:4,borderRadius:4,border:"1px dashed",borderColor:"divider",textAlign:"center"},children:f(E,{sx:{fontSize:"0.92rem",color:"text.secondary"},children:o("common.noData")})}):null,De.map((te,Fe)=>{if(te.type==="group"){let Ze=J.has(te.id);return f(Le,{elevation:0,sx:{borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:g("div",{component:"button",type:"button",onClick:()=>ge(te.id),sx:{width:"100%",px:1.5,py:1.3,border:0,background:"transparent",display:"flex",alignItems:"center",gap:1,textAlign:"left",cursor:"pointer",appearance:"none",WebkitAppearance:"none",color:"text.primary"},children:[Ze?f(nn,{}):f(li,{}),g("div",{sx:{flex:1,minWidth:0},children:[g(E,{sx:{fontSize:"0.94rem",fontWeight:800},children:[te.field,": ",te.value]}),g(E,{sx:{mt:.2,fontSize:"0.76rem",color:"text.secondary"},children:[te.count," records"]})]}),Ce.length>1&&te.level<Ce.length-1?g(ce,{direction:"row",spacing:.5,children:[f(Ct,{size:"small",label:o("table.group.expandAll"),onClick:kt=>{kt.stopPropagation(),Se(te.id);},sx:X}),f(Ct,{size:"small",label:o("table.group.collapseAll"),onClick:kt=>{kt.stopPropagation(),oe(te.id);},sx:X})]}):null]})},te.id)}let je=te.data||te,Ne=te.id||je[Ft]||Fe;return be(je,Ne,Fe)}),ue?f(Sy,{summaryRow:K,visibleColumns:Z,columns:H}):null,p?f(E,{sx:{py:1,fontSize:"0.84rem",color:"text.secondary",textAlign:"center"},children:o("common.loading")}):null]})})]}),ye?g(Lt,{open:ee,onClose:()=>!Ie&&ve(false),fullWidth:true,maxWidth:"sm",children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:800},children:k?.title||o("quickCreate.createWithTitle",{title:O})}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[vo.map(te=>{let Fe=te.type==="number"||te.numeric?"number":te.type==="date"?"date":"text";return f(We,{label:te.label||te.id,value:Xe[te.id]??"",onChange:je=>qr(te.id,je.target.value),type:Fe,fullWidth:true,InputLabelProps:{shrink:Fe==="date"?true:void 0}},`quick-create-${te.id}`)}),k?.description?f(Jo,{severity:"info",children:k.description}):null]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[f(Me,{onClick:()=>ve(false),disabled:Ie,children:k?.cancelLabel||o("common.cancel")}),f(Me,{onClick:Er,variant:"contained",disabled:Ie,children:k?.submitLabel||o("common.save")})]})]}):null,Pe?g(Lt,{open:ht,onClose:()=>!yt&&mt(false),fullWidth:true,maxWidth:"sm",children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:800},children:w?.title||o("quickEdit.editWithTitle",{title:O})}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[No.map(te=>{let Fe=te.type==="number"||te.numeric?"number":te.type==="date"?"date":"text";return f(We,{label:te.label||te.id,value:Et[te.id]??"",onChange:je=>Zr(te.id,je.target.value),type:Fe,disabled:!zo(te.id),fullWidth:true,InputLabelProps:{shrink:Fe==="date"?true:void 0}},`quick-edit-${te.id}`)}),w?.description?f(Jo,{severity:"info",children:w.description}):null]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[f(Me,{onClick:()=>mt(false),disabled:yt,children:w?.cancelLabel||o("common.cancel")}),f(Me,{onClick:Ao,variant:"contained",disabled:yt||!Q,children:w?.submitLabel||o("common.save")})]})]}):null,Oe?f(jn,{open:Ht,type:"warning",title:T?.title||o("quickDelete.confirmTitle"),message:T?.message||(V.length>1?o("quickDelete.confirmMessageMultiple",{count:V.length}):o("quickDelete.confirmMessageSingle")),confirmText:T?.confirmText||o("common.delete"),cancelText:T?.cancelText||o("common.cancel"),onClose:()=>!$t&&Ut(false),onConfirm:Yr}):null,ie,ft?f(Di,{open:Vt,onClose:Wt,model:Or,aiAssistant:b$1?.aiAssistant,interaction:Dt?{enabled:true,filters:lt.filters,fieldMapping:ir,onPrimaryDimensionClick:te=>lt.setFilter("primaryDimension",te),onSecondaryDimensionClick:te=>lt.setFilter("secondaryDimension",te),onStatusClick:te=>lt.setFilter("status",te),onClearFilter:lt.clearFilter,onClearAll:lt.clearAll}:void 0,tableContent:f(ky,{appId:st||"graph-report-internal",title:o("graph.dataBody"),columns:N,rows:Or.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false},showSummary:false})}):null]})};var t2=({appTitle:t,children:o,menuData:r=[],workloadItems:n=[],workloadSelectedId:a,showNavigation:i=true,showWorkloadNav:s=true,orientation:c="auto",logo:u,headerSlot:d,actionSlot:m,portraitBottomSlot:h,contentSx:f$1,containerSx:p,user:v,onSearch:C,onSearchAdd:g$1,defaultNavigationOpen:x,navOpen:y,onNavOpenChange:b,onWorkloadSelect:k,locale:w="en",localeLabel:T,localeOptions:I,onLocaleChange:S,onUserSetting:D,onUserLogout:R,userMenuItems:M,leftHeaderSlot:P,rightHeaderSlot:A})=>{let L="orbcafe:page-layout-mode",[W,j]=useState("system"),[O,_]=useState("light"),[z,Y]=useState(false),[H,B]=useState(false),q=W==="system"?H?O:"light":W;useEffect(()=>{Y(true);},[]),useEffect(()=>{try{let nt=window.localStorage.getItem(L);(nt==="light"||nt==="dark"||nt==="system")&&j(nt);}catch{}B(true);let Ee=window.matchMedia("(prefers-color-scheme: dark)"),Ge=()=>{_(Ee.matches?"dark":"light");};return Ge(),Ee.addEventListener("change",Ge),()=>Ee.removeEventListener("change",Ge)},[]),useEffect(()=>{if(H)try{window.localStorage.setItem(L,W);}catch{}},[H,W]),useEffect(()=>{q==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.classList.add("orb-dark"),document.documentElement.dataset.orbMode="dark",document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.classList.remove("orb-dark"),document.documentElement.dataset.orbMode="light",document.documentElement.style.colorScheme="light");},[q]);let Z=Eo("(orientation: portrait)"),ue=Eo("(max-width: 899.95px)"),ne=c==="auto"?!z||Z||ue?"portrait":"landscape":c,[fe,Ce]=useState({landscape:x??true,portrait:false}),$=fe[ne],J=y??$,ae=Ee=>{y===void 0&&Ce(Ge=>({...Ge,[ne]:Ee})),b?.(Ee);},xe=g(ce,{direction:"row",spacing:1,alignItems:"center",children:[!z||i&&ne==="portrait"?f(le,{onClick:()=>ae(!J),sx:{bgcolor:"action.hover"},children:f(gi,{})}):null,P]}),pe=g(ce,{direction:"row",spacing:1,alignItems:"center",children:[m,A]}),me=f(gm,{collapsed:ne==="landscape"?!J:false,onToggle:()=>ae(!J),menuData:r,orientation:ne,colorMode:q,maxHeight:ne==="landscape"?900:void 0});return f(Fn,{mode:W,children:f(Ya,{locale:w,children:g("div",{sx:[Ee=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:Ee.palette.mode==="dark"?"linear-gradient(180deg, var(--orb-canvas) 0%, var(--orb-surface) 55%, var(--orb-surface-2) 100%)":Ee.palette.background.default}),...Array.isArray(p)?p:[p]],children:[f(Xi,{appTitle:t,logo:u===void 0?null:u,mode:W,onToggleMode:()=>j(Ee=>Ee==="system"?"dark":Ee==="dark"?"light":"system"),locale:w,localeLabel:T,localeOptions:I,onLocaleChange:S,user:v,onUserSetting:D,onUserLogout:R,userMenuItems:M,onSearch:C,onSearchAdd:g$1,leftSlot:xe,rightSlot:pe}),d?f("div",{sx:{px:{xs:2,md:3},py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:d}):null,g("div",{sx:{flex:1,minHeight:0,display:"flex",position:"relative"},children:[z&&i&&ne==="landscape"?f("div",{sx:{p:1.5,pr:0,flexShrink:0},children:me}):null,!z||i&&ne==="portrait"?f(Hd,{open:J,onClose:()=>ae(false),PaperProps:{sx:{width:"min(88vw, 360px)",p:1.25,bgcolor:"transparent",boxShadow:"none"}},children:me}):null,f("div",{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...f$1},children:g(ce,{spacing:1.5,children:[s&&n.length>0?f(dm,{items:n,selectedId:a,orientation:ne,onItemSelect:k}):null,f(Le,{elevation:0,sx:{flex:1,minHeight:ne==="portrait"?420:560,p:{xs:1.25,md:1.5},borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:"color-mix(in oklch, var(--orb-canvas) 72%, transparent)",backdropFilter:"blur(12px)",color:"text.primary"},children:o})]})})]}),ne==="portrait"&&h?g(e,{children:[f(Rt,{}),f("div",{sx:{p:1.5},children:h})]}):null]})})})};var fm=Py(()=>import('./COrbCanvas-4PZFJUYO.mjs').then(t=>t.COrbCanvas),{ssr:false,loading:()=>f("div",{className:"h-full w-full bg-transparent"})});function Kl({isRecording:t}){return f(AnimatePresence,{children:t&&f(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.5},className:"pointer-events-none absolute inset-0 z-0 overflow-hidden",children:g("div",{className:"relative flex h-full w-full items-center justify-center",children:[f("div",{className:"absolute inset-0",children:f(fm,{hue:0,hoverIntensity:.5,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})}),f("div",{className:"relative z-10 h-full w-1/3 mix-blend-overlay opacity-80",children:f(fm,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var i2=Kl;var vm=createContext(null);function Ay(t){if(!t||!(t instanceof HTMLElement))return false;let o=t.tagName;return !!(o==="INPUT"||o==="TEXTAREA"||o==="SELECT"||t.isContentEditable||t.closest('[data-voice-hotkey-ignore="true"]'))}function Ey({children:t,onVoiceSubmit:o,onVoicePartial:r,onVoiceError:n,longPressMs:a=200,disableSpaceTrigger:i=false,ignoreWhenFocusedInput:s=true,renderOverlay:c=true,wsUrl:u,silenceThresholdMs:d,minVolumeRms:m}){let[h,f$1]=useState(false),[p,v]=useState(false),C=useRef(null),g$1=useRef(false),x=useRef(false),y=useCallback(()=>{x.current=false,f$1(false);},[]),{isRecording:b,startRecording:k,stopRecording:w}=xn({wsUrl:u,silenceThresholdMs:d,minVolumeRms:m,onTextUpdate:D=>{r?.(D);},onComplete:async D=>{try{D.trim()&&(v(!0),await o(D.trim()));}catch(R){let M=R instanceof Error?R.message:"Failed to process voice command";n?.(M);}finally{v(!1),y();}},onError:D=>{n?.(D),v(!1),g$1.current||y();}}),T=useCallback(async()=>{x.current=false,await k();},[k]),I=useCallback(()=>{w();},[w]);useEffect(()=>{if(i)return;let D=M=>{M.isComposing||(M.code==="Space"||M.key===" ")&&(g$1.current||M.repeat||s&&Ay(document.activeElement)||(g$1.current=true,M.preventDefault(),C.current=setTimeout(()=>{x.current=true,f$1(true),k();},a)));},R=M=>{(M.code==="Space"||M.key===" ")&&(C.current&&(clearTimeout(C.current),C.current=null),g$1.current=false,x.current&&(M.preventDefault(),f$1(false),w()));};return window.addEventListener("keydown",D),window.addEventListener("keyup",R),()=>{window.removeEventListener("keydown",D),window.removeEventListener("keyup",R),C.current&&(clearTimeout(C.current),C.current=null);}},[i,s,a,k,w]);let S=useMemo(()=>({isRecording:b,isHotkeyRecording:h,isSubmitting:p,startRecording:T,stopRecording:I}),[h,b,p,T,I]);return g(vm.Provider,{value:S,children:[c?f(Kl,{isRecording:h}):null,t]})}function Ly(){let t=useContext(vm);if(!t)throw new Error("useAINav must be used within CAINavProvider");return t}var u2=Ey,m2=Ly;function ot(...t){return twMerge(clsx(t))}var zy=({content:t,theme:o="light",size:r="base",defaultExpanded:n=false})=>{let[a,i]=useState(n),s=useMemo(()=>`${(r==="sm"?14:r==="lg"?18:16)-2}px`,[r]);return g("div",{className:`my-6 rounded-lg overflow-hidden transition-all duration-200 ${o==="dark"?"bg-[var(--orb-surface-2)]":"bg-[var(--orb-canvas)]"}`,style:{border:"0.5px solid var(--orb-border)"},children:[g("div",{className:"px-4 py-3 cursor-pointer flex items-center justify-between transition-colors duration-200 bg-[var(--orb-surface)] hover:bg-[var(--orb-hover)]",style:{borderBottom:"0.5px solid var(--orb-border)"},onClick:()=>i(!a),children:[g("span",{className:"flex items-center",children:[f(Ha,{className:"mr-2 h-4 w-4"}),f("span",{className:"font-medium text-[var(--orb-fg)]",style:{fontSize:r==="sm"?"14px":r==="lg"?"18px":"16px"},children:"\u601D\u8003\u8FC7\u7A0B"})]}),f(Po,{className:`w-4 h-4 transition-transform duration-200 ${a?"rotate-180":""} text-[var(--orb-muted)]`})]}),a&&f("div",{className:"p-4 whitespace-pre-wrap italic font-light text-[var(--orb-muted)]",style:{fontSize:s,lineHeight:"1.3 !important"},children:t})]})},ym=zy;var Gy=({content:t,language:o="text",isStreaming:r=false,className:n=""})=>{let a=fo(),[i,s]=useState(false),c=async()=>{try{await navigator.clipboard.writeText(t),s(!0),setTimeout(()=>s(!1),2e3);}catch(d){console.error("\u590D\u5236\u5931\u8D25:",d);}},u=a==="dark"?oneDark:oneLight;return g("div",{className:ot("rounded-lg overflow-hidden border border-[var(--orb-border)] my-4",n),children:[g("div",{className:"flex items-center justify-between px-4 py-2 bg-[var(--orb-surface)] border-b border-[var(--orb-border)]",children:[f("span",{className:"text-xs font-medium text-[var(--orb-muted)] uppercase",children:o}),f("button",{onClick:c,className:"p-1 hover:bg-[var(--orb-hover)] rounded transition-colors",disabled:r,title:i?"Copied":"Copy code",children:i?f(po,{size:14,className:"text-[var(--orb-status-success)]"}):f(Fc,{size:14,className:"text-[var(--orb-muted)]"})})]}),f("div",{className:"text-sm",children:f(Prism,{language:o,style:u,customStyle:{margin:0,padding:"16px",fontSize:"14px",lineHeight:"1.5",backgroundColor:a==="dark"?"var(--orb-surface-2)":"var(--orb-canvas)"},wrapLongLines:true,children:t})})]})},Cm=Gy;var wm="orb-html-demo",Sm="orb-html-demo-ping",cs=16,Xy=2,Zy=2e3,Yy=300,Qy=96,jy=200,Jy=560,eC=320,Zl=`<script>(function(){var post=function(){var body=document.body;var height=Math.ceil(document.documentElement.scrollHeight);if(body){var style=getComputedStyle(body);height=Math.ceil(Math.max(body.offsetHeight,body.scrollHeight)+parseFloat(style.marginTop||'0')+parseFloat(style.marginBottom||'0'))}parent.postMessage({source:${JSON.stringify(wm)},height:height},'*')};addEventListener('load',post);addEventListener('resize',post);addEventListener('message',function(event){if(event.data&&event.data.source===${JSON.stringify(Sm)})post()});new MutationObserver(post).observe(document.documentElement,{subtree:true,childList:true,attributes:true,characterData:true});var retries=0;var timer=setInterval(function(){post();retries+=1;if(retries>5)clearInterval(timer)},250);post()})()</script>`,tC="html,body{margin:0;padding:12px;font:14px/1.5 system-ui,sans-serif;}",oC=t=>/<html[\s>]/i.test(t),rC=t=>{let o=t.trim();return oC(o)?/<\/body>/i.test(o)?o.replace(/<\/body>/i,`${Zl}</body>`):`${o}${Zl}`:`<!DOCTYPE html><html><head><meta charset="utf-8"><style>${tC}</style></head><body>${o}${Zl}</body></html>`},nC=t=>{let o=/<title[^>]*>([^<]+)<\/title>/i.exec(t)?.[1]?.trim();return o||(/<h1[^>]*>([^<]+)<\/h1>/i.exec(t)?.[1]?.trim()??null)},aC=t=>{if(t<1024)return `${t} B`;let o=t/1024;if(o<1024)return `${o<10?o.toFixed(1):Math.round(o)} KB`;let r=o/1024;return `${r<10?r.toFixed(1):Math.round(r)} MB`},iC=t=>`${t.toLowerCase().replace(/[^\p{Letter}\p{Number}]+/gu,"-").replace(/^-+|-+$/g,"").slice(0,60)||"interactive-demo"}.html`,sC=(t,o)=>{let r=URL.createObjectURL(t),n=document.createElement("a");n.href=r,n.download=o,n.click(),window.setTimeout(()=>URL.revokeObjectURL(r),1e3);},Ca=new Map,Ql="orb-html-demo-store",lC=t=>t.replace(/^\s+/,"").slice(0,Qy),Yl=(t,o)=>{Ca.set(t,o),window.dispatchEvent(new CustomEvent(Ql));},cC=({content:t,title:o})=>{let{t:r}=de(),n=fo(),a=lC(t),[i,s]=useState(()=>Ca.get(a)?.open??false),[c,u]=useState(()=>Ca.get(a)?.view??"preview"),[d,m]=useState(false),[h,f$1]=useState(eC),p=useRef(null),v=useRef(null),C=useRef(false),g$1=useRef(false),x=useRef(t),y=P=>Yl(a,{open:P,view:c}),b=P=>Yl(a,{open:i,view:P}),k=()=>{g$1.current=true,y(false);};useEffect(()=>{let P=()=>{let A=Ca.get(a);s(A?.open??false),u(A?.view??"preview");};return window.addEventListener(Ql,P),()=>window.removeEventListener(Ql,P)},[a]),useEffect(()=>{x.current!==t&&(x.current=t,Ca.has(a)||Yl(a,{open:true,view:"preview"}));},[t,a]);let[w,T]=useState(t);useEffect(()=>{if(t===w)return;let P=window.setTimeout(()=>T(t),Yy);return ()=>window.clearTimeout(P)},[t,w]);let I=useMemo(()=>rC(w),[w]);useEffect(()=>{if(!i)return;let P=A=>{let L=A.data;!L||L.source!==wm||typeof L.height!="number"||v.current&&A.source!==v.current.contentWindow||f$1(Math.max(jy,Math.min(Jy,Math.ceil(L.height))));};return window.addEventListener("message",P),v.current?.contentWindow?.postMessage({source:Sm},"*"),()=>window.removeEventListener("message",P)},[i]);let S=o??nC(t)??r("agentui.html.defaultTitle"),D=useMemo(()=>new TextEncoder().encode(t).length,[t]);useEffect(()=>{if(!d)return;let P=window.setTimeout(()=>m(false),Zy);return ()=>window.clearTimeout(P)},[d]),useEffect(()=>{if(i){C.current=true;return}C.current&&(C.current=false,g$1.current&&(g$1.current=false,p.current?.focus()));},[i]);let R=()=>{navigator.clipboard.writeText(t).then(()=>m(true));},M=()=>sC(new Blob([t],{type:"text/html;charset=utf-8"}),iC(S));return i?g("section",{className:"orb-html-demo","aria-label":S,"data-view":c,children:[g("header",{className:"orb-html-demo-head",children:[f("span",{className:"orb-html-demo-glyph","aria-hidden":"true",children:"</>"}),f("span",{className:"orb-html-demo-head-title",title:S,children:S}),g("div",{className:"orb-segmented-control orb-html-demo-segment",role:"group","aria-label":r("agentui.html.toggle"),"data-has-selection":"true",style:{"--orb-segmented-count":Xy,"--orb-segmented-index":c==="code"?0:1},children:[f("span",{className:"orb-segmented-control-thumb","aria-hidden":"true"}),f("button",{type:"button",className:"orb-segmented-control-item orb-segmented-control-item-label","data-selected":c==="code","aria-pressed":c==="code",onClick:()=>b("code"),children:r("agentui.html.code")}),f("button",{type:"button",className:"orb-segmented-control-item orb-segmented-control-item-label","data-selected":c==="preview","aria-pressed":c==="preview",onClick:()=>b("preview"),children:r("agentui.html.preview")})]}),g("div",{className:"orb-html-demo-actions",children:[f("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":r(d?"agentui.html.copied":"agentui.html.copy"),title:r(d?"agentui.html.copied":"agentui.html.copy"),onClick:R,children:d?f(po,{size:cs}):f(Lo,{size:cs})}),f("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":r("agentui.html.download"),title:r("agentui.html.download"),onClick:M,children:f(Hn,{size:cs})}),f("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":r("agentui.html.close"),title:r("agentui.html.close"),onClick:k,children:f(Kt,{size:cs})})]})]}),g("div",{className:"orb-html-demo-body",children:[f("iframe",{ref:v,className:"orb-html-demo-frame",title:S,sandbox:"allow-scripts",srcDoc:I,style:{height:h},hidden:c!=="preview"}),f("div",{className:"orb-html-demo-code",hidden:c!=="code",children:f(Prism,{language:"html",style:n==="dark"?oneDark:oneLight,customStyle:{margin:0,padding:"16px 20px",background:"transparent",fontSize:"13px",lineHeight:"1.6"},wrapLongLines:true,children:t})})]})]}):g("button",{ref:p,type:"button",className:"orb-html-demo-card","aria-expanded":false,onClick:()=>y(true),children:[f("span",{className:"orb-html-demo-glyph","aria-hidden":"true",children:"</>"}),g("span",{className:"orb-html-demo-info",children:[f("span",{className:"orb-html-demo-title",children:S}),g("span",{className:"orb-html-demo-meta",children:["HTML \xB7 ",aC(D)]})]}),f("span",{className:"orb-html-demo-openpill",children:r("agentui.html.open")})]})},km=cC;var ho={useMaxWidth:false},uC=t=>{let o=t.closest(".markdown-body, .orb-omph-assistant")??t,r=getComputedStyle(o);return {fontSize:r.fontSize,fontFamily:r.fontFamily}},mC=t=>{let o=t.querySelector("svg");if(!o)return;let r=o.style.maxWidth;o.getAttribute("width")==="100%"&&r.endsWith("px")&&(o.setAttribute("width",r),o.style.width=r,o.style.maxWidth="none");},gC=t=>{let o=/line (\d+)/i.exec(t)?.[1];return o?`Mermaid syntax error around line ${o} \u2014 expand for details`:"Mermaid syntax error \u2014 expand for details"},hC=({content:t,isLoading:o,className:r="",style:n})=>{let a=useRef(null),[i,s]=useState(false),[c,u]=useState(null),d=fo();return useEffect(()=>{let m=false,h=async()=>{if(!(!t.trim()||!a.current)){s(true),u(null);try{let p=uC(a.current),v=Number.parseFloat(p.fontSize);Tm.initialize({startOnLoad:!1,theme:d==="dark"?"dark":"default",securityLevel:"loose",fontFamily:p.fontFamily,themeVariables:{fontFamily:p.fontFamily,fontSize:p.fontSize},flowchart:{htmlLabels:!1,...ho},sequence:{...ho,actorFontSize:v,noteFontSize:v,messageFontSize:v,actorFontFamily:p.fontFamily,noteFontFamily:p.fontFamily,messageFontFamily:p.fontFamily},gantt:ho,journey:ho,class:ho,state:ho,er:ho,pie:ho,mindmap:ho,timeline:ho,gitGraph:ho,quadrantChart:ho,requirement:ho,sankey:ho,block:ho,c4:ho,xyChart:ho});let C=`mermaid-${Math.random().toString(36).substr(2,9)}`,g=t.replace(/```mermaid\n?|\n?```/g,"").trim(),{svg:x,bindFunctions:y}=await Tm.render(C,g);!m&&a.current&&(a.current.innerHTML=x,mC(a.current),y?.(a.current));}catch(p){if(m)return;console.error("Mermaid render failed:",p),u(p instanceof Error?p.message:"Render failed");}finally{m||s(false);}}},f=setTimeout(()=>{h();},100);return ()=>{m=true,clearTimeout(f);}},[t,d]),g("div",{className:`mermaid-block ${r}`,style:n,children:[(o||i)&&g("div",{className:"flex items-center justify-center rounded border border-[var(--orb-border)] bg-[var(--orb-surface)] p-4 dark:bg-[var(--orb-surface-2)]",children:[f("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-b-2 border-[var(--orb-primary)]"}),f("span",{className:"text-sm text-[var(--orb-muted)]",children:"Generating Diagram..."})]}),c&&g("div",{className:"rounded border border-[color-mix(in_oklch,var(--orb-status-error)_30%,transparent)] bg-[color-mix(in_oklch,var(--orb-status-error)_8%,transparent)] p-3 text-sm text-[var(--orb-status-error)]",children:[f("p",{className:"font-medium",children:gC(c)}),g("details",{className:"mt-1",children:[f("summary",{className:"cursor-pointer text-xs text-[var(--orb-muted)]",children:"Details & source"}),f("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap break-words",children:c}),f("pre",{className:"mt-2 max-h-40 overflow-auto text-xs text-[var(--orb-muted)]",children:t})]})]}),f("div",{ref:a,className:`overflow-x-auto ${o||i||c?"hidden":""}`})]})},Mm=hC;var fC=({title:t="\u53D1\u751F\u9519\u8BEF",content:o,errorCode:r,stack:n,icon:a,closable:i=true,onClose:s,onRetry:c,className:u="",...d})=>{let[m,h]=useState(false),[f$1,p]=useState(false),v=async()=>{if(c){p(true);try{await c();}catch(C){console.error("\u91CD\u8BD5\u5931\u8D25:",C);}finally{p(false);}}};return g("div",{className:`relative w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${u}`,...d,children:[g("div",{className:"flex p-4 border-l-4 border-l-[var(--orb-status-error)] bg-[color-mix(in_oklch,var(--orb-status-error)_8%,transparent)]",children:[f("div",{className:"flex-shrink-0 mr-3 text-[var(--orb-status-error)] mt-0.5",children:a||f(Aa,{className:"w-5 h-5"})}),g("div",{className:"flex-1 min-w-0",children:[g("div",{className:"flex items-center space-x-2 mb-1",children:[f("h4",{className:"text-base font-semibold text-[var(--orb-fg)]",children:t}),r&&f("span",{className:"text-xs font-mono px-1.5 py-0.5 rounded bg-[color-mix(in_oklch,var(--orb-status-error)_14%,transparent)] text-[var(--orb-status-error)]",children:r})]}),o&&f("div",{className:"text-sm text-[var(--orb-muted)] mb-3 leading-relaxed",children:typeof o=="string"?f("p",{className:"whitespace-pre-wrap",children:o}):o}),(c||n)&&g("div",{className:"flex items-center space-x-4 mt-2",children:[c&&g("button",{onClick:v,disabled:f$1,className:"flex items-center text-xs font-medium text-[var(--orb-status-error)] hover:opacity-80 transition-colors disabled:opacity-50",children:[f(jc,{className:`w-3.5 h-3.5 mr-1.5 ${f$1?"animate-spin":""}`}),f$1?"\u91CD\u8BD5\u4E2D...":"\u91CD\u8BD5"]}),n&&g("button",{onClick:()=>h(!m),className:"flex items-center text-xs font-medium text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] transition-colors",children:[m?f(Po,{className:"w-3.5 h-3.5 mr-1"}):f(So,{className:"w-3.5 h-3.5 mr-1"}),m?"\u9690\u85CF\u8BE6\u60C5":"\u67E5\u770B\u8BE6\u60C5"]})]})]}),i&&s&&f("button",{onClick:s,className:"flex-shrink-0 ml-3 text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors self-start",children:f(Kt,{className:"w-4 h-4"})})]}),n&&m&&f("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] p-3 border-t border-[var(--orb-border)]",children:f("pre",{className:"text-xs font-mono text-[var(--orb-muted)] overflow-x-auto whitespace-pre-wrap p-2 bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)]",children:n})})]})},ds=fC;var bC=({title:t="\u8B66\u544A",content:o,warningType:r,severity:n="warning",warnings:a=[],icon:i,closable:s=true,onClose:c,onConfirm:u,actionText:d,className:m="",...h})=>{let f$1=()=>{switch(n){case "info":return {borderLeftColor:"border-l-blue-500",iconColor:"text-[var(--orb-primary)]",bgColor:"bg-[var(--orb-p50)]"};case "error":return {borderLeftColor:"border-l-[var(--orb-status-error)]",iconColor:"text-[var(--orb-status-error)]",bgColor:"bg-[color-mix(in_oklch,var(--orb-status-error)_8%,transparent)]"};case "success":return {borderLeftColor:"border-l-green-500",iconColor:"text-[var(--orb-status-success)]",bgColor:"bg-[color-mix(in_oklch,var(--orb-status-success)_8%,transparent)]"};default:return {borderLeftColor:"border-l-yellow-500",iconColor:"text-[var(--orb-status-warning)]",bgColor:"bg-[color-mix(in_oklch,var(--orb-status-warning)_8%,transparent)]"}}},p=()=>{switch(n){case "info":return f(Ba,{className:"w-5 h-5"});case "error":return f(Ua,{className:"w-5 h-5"});case "success":return f(Ea,{className:"w-5 h-5"});default:return f(Lc,{className:"w-5 h-5"})}},v=f$1();return g("div",{className:`relative w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${m}`,...h,children:[g("div",{className:`flex p-4 border-l-4 ${v.borderLeftColor} ${v.bgColor}`,children:[f("div",{className:`flex-shrink-0 mr-3 ${v.iconColor}`,children:i||p()}),g("div",{className:"flex-1 min-w-0",children:[g("div",{className:"flex items-center justify-between mb-1",children:[f("h4",{className:"text-base font-semibold text-[var(--orb-fg)]",children:t}),r&&f("span",{className:"text-xs font-medium px-2 py-0.5 rounded-full bg-[var(--orb-surface)] text-[var(--orb-muted)]",children:r})]}),o&&f("div",{className:"text-sm text-[var(--orb-muted)] mb-2",children:o}),a&&a.length>0&&f("ul",{className:"mt-2 space-y-1",children:a.map((C,g$1)=>g("li",{className:"flex items-start text-sm text-[var(--orb-muted)]",children:[f("span",{className:"mr-2 mt-1.5 w-1 h-1 rounded-full bg-[var(--orb-muted)] flex-shrink-0"}),f("span",{children:C})]},g$1))})]}),s&&c&&f("button",{onClick:c,className:"flex-shrink-0 ml-3 text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors",children:f(Kt,{className:"w-4 h-4"})})]}),u&&f("div",{className:"bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)] px-4 py-3 flex justify-end border-t border-[var(--orb-border)]",children:f("button",{onClick:u,className:"px-4 py-1.5 text-sm font-medium text-[var(--orb-on-primary)] bg-[var(--orb-primary)] hover:bg-[var(--orb-p600)] rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-[var(--orb-primary)] focus:ring-offset-2 dark:focus:ring-offset-gray-900",children:d||"\u786E\u8BA4"})})]})},ps=bC;var vC=({title:t="\u76F8\u5173\u63A8\u8350",content:o,suggestions:r,onSuggestionClick:n,maxDisplay:a=5,icon:i,closable:s=false,onClose:c,className:u="",...d})=>{let[m,h]=useState(false),[f$1,p]=useState(""),[v,C]=useState(false),g$1=useMemo(()=>f$1.trim()?r.filter(b=>b.toLowerCase().includes(f$1.toLowerCase())):r,[r,f$1]),x=useMemo(()=>m?g$1:g$1.slice(0,a),[g$1,m,a]),y=b=>{n?.(b);};return !r||r.length===0?null:g("div",{className:`w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${u}`,...d,children:[g("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--orb-border)] bg-[var(--orb-p50)]",children:[g("div",{className:"flex items-center space-x-2.5",children:[f("div",{className:"text-[var(--orb-primary)] flex-shrink-0",children:i||f(Ha,{className:"w-5 h-5"})}),g("div",{className:"flex flex-col",children:[f("h4",{className:"text-sm font-semibold text-[var(--orb-fg)] leading-tight",children:t}),o&&f("span",{className:"text-xs text-[var(--orb-muted)] mt-0.5",children:o})]})]}),g("div",{className:"flex items-center space-x-1",children:[r.length>3&&f("button",{onClick:()=>C(!v),className:`p-1.5 rounded-md transition-colors ${v?"bg-[var(--orb-p100)] text-[var(--orb-status-primary)]":"text-[var(--orb-muted)] hover:text-[var(--orb-fg)] hover:bg-[var(--orb-hover)]"}`,title:v?"\u5173\u95ED\u641C\u7D22":"\u641C\u7D22\u95EE\u9898",children:f(Vo,{className:"w-4 h-4"})}),s&&c&&f("button",{onClick:c,className:"text-[var(--orb-muted)] hover:text-[var(--orb-fg)] p-1.5 rounded-md hover:bg-[var(--orb-hover)] transition-colors",title:"\u5173\u95ED",children:f(Kt,{className:"w-4 h-4"})})]})]}),v&&f("div",{className:"px-4 py-2 border-b border-[var(--orb-border)] bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)]",children:g("div",{className:"relative",children:[f("input",{type:"text",placeholder:"\u641C\u7D22\u76F8\u5173\u95EE\u9898...",value:f$1,onChange:b=>p(b.target.value),className:"w-full text-sm px-3 py-1.5 pl-8 rounded border border-[var(--orb-border)] bg-[var(--orb-canvas)] text-[var(--orb-fg)] focus:ring-1 focus:ring-[var(--orb-primary)] focus:border-[var(--orb-primary)] outline-none transition-shadow",autoFocus:true}),f(Vo,{className:"absolute left-2.5 top-2 w-3.5 h-3.5 text-[var(--orb-muted)]"})]})}),g("div",{className:"p-2",children:[f("ul",{className:"space-y-1",children:x.map((b,k)=>f("li",{children:g("button",{onClick:()=>y(b),className:"w-full text-left px-3 py-2 rounded-md text-sm text-[var(--orb-fg)] hover:bg-[var(--orb-hover)] hover:text-[var(--orb-status-primary)] transition-colors group flex items-start justify-between",children:[f("span",{children:b}),f(So,{className:"w-4 h-4 text-[var(--orb-muted)] group-hover:text-[var(--orb-status-primary)] opacity-0 group-hover:opacity-100 transition-all transform group-hover:translate-x-0.5"})]})},k))}),g$1.length>a&&f("button",{onClick:()=>h(!m),className:"w-full text-center py-2 text-xs font-medium text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors border-t border-[var(--orb-border)] mt-1",children:m?"\u6536\u8D77":`\u67E5\u770B\u5168\u90E8 (${g$1.length})`}),g$1.length===0&&f$1&&f("div",{className:"text-center py-4 text-sm text-[var(--orb-muted)]",children:"\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u5EFA\u8BAE"})]})]})},us=vC;var yC=({title:t,content:o,toolName:r,parameters:n,result:a,status:i,duration:s,icon:c,closable:u=false,onClose:d,onAction:m,actionText:h,className:f$1="",...p})=>{let[v,C]=useState(false),[g$1,x]=useState(true),y=()=>{switch(i){case "pending":return {iconColor:"text-[var(--orb-primary)]",badgeBg:"bg-[var(--orb-p50)]",badgeText:"text-[var(--orb-status-primary)]",label:"\u6267\u884C\u4E2D"};case "error":return {iconColor:"text-[var(--orb-status-error)]",badgeBg:"bg-[color-mix(in_oklch,var(--orb-status-error)_10%,transparent)]",badgeText:"text-[var(--orb-status-error)]",label:"\u5931\u8D25"};default:return {iconColor:"text-[var(--orb-status-success)]",badgeBg:"bg-[color-mix(in_oklch,var(--orb-status-success)_8%,transparent)]",badgeText:"text-[var(--orb-status-success)]",label:"\u6210\u529F"}}},b=()=>{switch(i){case "pending":return f(Uc,{className:"w-5 h-5 animate-spin"});case "error":return f(Ua,{className:"w-5 h-5"});default:return f(Ea,{className:"w-5 h-5"})}},k=I=>I?I<1e3?`${I}ms`:`${(I/1e3).toFixed(2)}s`:"",w=y(),T=t||r||"\u5DE5\u5177\u8C03\u7528";return g("div",{className:`w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${f$1}`,...p,children:[g("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--orb-border)] bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)]",children:[g("div",{className:"flex items-center space-x-3",children:[f("div",{className:`flex-shrink-0 ${w.iconColor}`,children:c||b()}),g("div",{children:[g("div",{className:"flex items-center space-x-2",children:[f("h4",{className:"text-sm font-semibold text-[var(--orb-fg)]",children:T}),f("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${w.badgeBg} ${w.badgeText}`,children:w.label})]}),r&&t&&g("div",{className:"text-xs text-[var(--orb-muted)] flex items-center mt-0.5",children:[f(Wn,{className:"w-3 h-3 mr-1"}),r]})]})]}),g("div",{className:"flex items-center space-x-2 text-xs text-[var(--orb-muted)]",children:[s&&g("div",{className:"flex items-center bg-[var(--orb-surface)] px-2 py-1 rounded",children:[f(Bc,{className:"w-3 h-3 mr-1"}),k(s)]}),u&&d&&f("button",{onClick:d,className:"text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors p-1 rounded",children:f(Kt,{className:"w-4 h-4"})})]})]}),g("div",{className:"p-4",children:[o&&f("div",{className:"text-sm text-[var(--orb-muted)] mb-4 leading-relaxed",children:o}),n&&g("div",{className:"mb-3",children:[g("button",{onClick:()=>C(!v),className:"flex items-center text-xs font-medium text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] mb-2",children:[v?f(Po,{className:"w-3.5 h-3.5 mr-1"}):f(So,{className:"w-3.5 h-3.5 mr-1"}),f("div",{className:"w-3.5 h-3.5 mr-1.5"}),"\u8F93\u5165\u53C2\u6570"]}),v&&f("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)] overflow-hidden",children:f("pre",{className:"p-3 text-xs font-mono text-[var(--orb-muted)] overflow-x-auto",children:JSON.stringify(n,null,2)})})]}),a&&g("div",{children:[g("button",{onClick:()=>x(!g$1),className:"flex items-center text-xs font-medium text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] mb-2",children:[g$1?f(Po,{className:"w-3.5 h-3.5 mr-1"}):f(So,{className:"w-3.5 h-3.5 mr-1"}),f(Wn,{className:"w-3.5 h-3.5 mr-1.5"}),"\u6267\u884C\u7ED3\u679C"]}),g$1&&f("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)] overflow-hidden",children:f("pre",{className:"p-3 text-xs font-mono text-[var(--orb-muted)] overflow-x-auto",children:typeof a=="string"?a:JSON.stringify(a,null,2)})})]}),m&&f("div",{className:"mt-3 pt-3 border-t border-[var(--orb-border)] flex justify-end",children:f("button",{onClick:m,className:"px-4 py-1.5 text-sm font-medium text-[var(--orb-on-primary)] bg-[var(--orb-primary)] hover:bg-[var(--orb-p600)] rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-[var(--orb-primary)] focus:ring-offset-2 dark:focus:ring-offset-gray-900",children:h||"\u6267\u884C\u64CD\u4F5C"})})]})]})},ms=yC;var xC=({data:t})=>{if(!t)return null;let o=useMemo(()=>{let r=[],n=[],a="\u6570\u636E\u8868\u683C";return Array.isArray(t)?(r=t,r.length>0&&(n=Object.keys(r[0]).map(i=>({id:i,label:i.charAt(0).toUpperCase()+i.slice(1),numeric:typeof r[0][i]=="number"})))):typeof t=="object"&&(a=t.title||a,r=Array.isArray(t.rows)?t.rows:Array.isArray(t.data)?t.data:[],Array.isArray(t.columns)?n=t.columns.map(s=>({id:s.key||s.id,label:s.title||s.label,numeric:s.dataType==="number"||s.numeric})):r.length>0&&(n=Object.keys(r[0]).map(s=>({id:s,label:s,numeric:typeof r[0][s]=="number"})))),r=r.map((i,s)=>({...i,id:i.id||`row_${s}`})),{title:a,columns:n,rows:r}},[t]);return o.rows.length===0?f("div",{className:"w-full my-4 p-4 border border-dashed border-[var(--orb-border)] rounded text-center text-[var(--orb-muted)]",children:"\u6682\u65E0\u8868\u683C\u6570\u636E"}):f("div",{className:"w-full my-4",children:f(tr,{appId:"agent-ui-table-card",title:o.title,columns:o.columns,rows:o.rows,count:o.rows.length,rowKey:"id",fitContainer:false,maxHeight:"500px",rowsPerPage:10,rowsPerPageOptions:[5,10,20,50]})})},gs=xC;var wC=({title:t,subtitle:o,data:r,type:n,config:a={}})=>{let i=()=>{switch(n){case "bar-chart-card":return f(qs,{className:"w-4 h-4 text-[var(--orb-chart-1)]"});case "line-chart-card":return f(Gc,{className:"w-4 h-4 text-[var(--orb-chart-positive)]"});case "pie-chart-card":return f(Qc,{className:"w-4 h-4 text-[var(--orb-chart-2)]"});case "combo-chart-card":return f(Ec,{className:"w-4 h-4 text-[var(--orb-chart-5)]"});case "heatmap-chart-card":return f($c,{className:"w-4 h-4 text-[var(--orb-chart-negative)]"});case "fishbone-chart-card":return f(Wc,{className:"w-4 h-4 text-[var(--orb-chart-4)]"});case "waterfall-chart-card":return f(nd,{className:"w-4 h-4 text-[var(--orb-chart-6)]"});case "google-map-card":return f(Vn,{className:"w-4 h-4 text-[var(--orb-status-primary)]"});case "amap-card":return f(qc,{className:"w-4 h-4 text-[var(--orb-status-primary)]"});default:return f(qs,{className:"w-4 h-4"})}},s=()=>{if(!r&&n!=="google-map-card"&&n!=="amap-card")return f("div",{className:"text-[var(--orb-muted)] text-sm p-4 text-center",children:"No data available"});try{switch(n){case "bar-chart-card":return f(na,{data:r,orientation:a.orientation||"horizontal",valueSuffix:a.valueSuffix||"",minHeight:a.minHeight});case "line-chart-card":return f(Bp,{data:r,color:a.color,valueSuffix:a.valueSuffix||"",height:a.height});case "pie-chart-card":let c=r.reduce((d,m)=>d+(Number(m.value)||0),0),u=r.map(d=>({name:d.name,value:Number(d.value)||0,percent:typeof d.percent=="number"?d.percent:c>0?(Number(d.value)||0)/c*100:0}));return f(Ii,{data:u,variant:a.variant||"donut",size:a.size,colors:a.colors});case "combo-chart-card":return f(Hp,{data:r,barColor:a.barColor,lineColor:a.lineColor});case "heatmap-chart-card":return f(zp,{data:r});case "fishbone-chart-card":return f(Vp,{branches:r,effect:a.effect||t||"Problem"});case "waterfall-chart-card":return f(Wp,{data:r,height:a.height});case "google-map-card":return f($p,{embedUrl:a.embedUrl||r&&r[0]?.embedUrl,apiKey:a.apiKey,query:a.query||r&&r[0]?.query||t,height:a.height});case "amap-card":return f(_p,{embedUrl:a.embedUrl||r&&r[0]?.embedUrl,keyword:a.keyword||r&&r[0]?.keyword||t,height:a.height});default:return g("div",{className:"text-[var(--orb-muted)] text-sm p-4 text-center",children:["Unsupported chart type: ",n]})}}catch(c){return console.error("Error rendering chart:",c),f("div",{className:"text-[var(--orb-status-error)] text-sm p-4 text-center",children:"Error rendering chart"})}};return g("div",{className:"w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md",children:[g("div",{className:"flex items-center px-4 py-3 border-b border-[var(--orb-border)] bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)]",children:[f("div",{className:"mr-2 flex-shrink-0",children:i()}),g("div",{className:"flex-1 min-w-0",children:[f("h3",{className:"text-sm font-semibold text-[var(--orb-fg)] truncate",children:t}),o&&f("p",{className:"text-xs text-[var(--orb-muted)] mt-0.5 truncate",children:o})]})]}),g("div",{className:"p-4",children:[f("div",{className:"overflow-x-auto",children:s()}),f("div",{className:"mt-3",children:g("details",{className:"text-xs text-[var(--orb-muted)]",children:[f("summary",{className:"cursor-pointer hover:text-[var(--orb-fg)] transition-colors select-none font-medium opacity-60 hover:opacity-100",children:"View Raw Data"}),f("pre",{className:"mt-2 p-2 bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)] overflow-x-auto max-h-40",children:JSON.stringify(r,null,2)})]})})]})]})},hs=wC;var Cs=["bar","column","line","pie","donut","scatter","bubble","list","metric","progress"],SC={bar:"Bars",column:"Columns",line:"Line",pie:"Pie",donut:"Donut",scatter:"Scatter",bubble:"Bubble",list:"List",metric:"Metric",progress:"Progress"},vs=480,Mn=214,Gt={top:18,right:16,bottom:38,left:30},eo=t=>typeof t=="number"&&Number.isFinite(t)?t:0,Em=t=>t.toLocaleString(void 0,{maximumFractionDigits:1}),qo=(t,o)=>`${t.id||t.label}-${o}`,Lm=(t,o=13)=>t.length>o?`${t.slice(0,Math.max(1,o-1))}\u2026`:t,ys=(t,o,r)=>Math.min(r,Math.max(o,t)),gr=(t,o,r)=>t.color??r[o%r.length],hr=(t,o)=>o?{onMouseEnter:()=>o.onItemHoverStart?.(t),onMouseMove:()=>o.onItemHoverStart?.(t),onMouseLeave:()=>o.onItemHoverEnd?.(t),onContextMenu:r=>o.onItemContextMenu?.(r,t)}:{},Om=t=>{let o=t.map(a=>eo(a.value)),r=Math.min(0,...o),n=Math.max(0,...o);return {min:r,max:n===r?r+1:n,range:n===r?1:n-r}},kC=(t,o,r)=>{let n=vs-Gt.left-Gt.right,a=Mn-Gt.top-Gt.bottom,{max:i,range:s}=Om(r),c=Gt.left+t*n/Math.max(r.length-1,1),u=Gt.top+(i-eo(o.value))/s*a,d=Gt.top+i/s*a;return {x:c,y:u,zeroY:d}},bs=(t,o,r,n)=>{let a=(n-90)*Math.PI/180;return {x:t+r*Math.cos(a),y:o+r*Math.sin(a)}},PC=(t,o,r,n,a,i)=>{let s=bs(t,o,r,i),c=bs(t,o,r,a),u=i-a>180?1:0;if(n===0)return `M ${t} ${o} L ${s.x} ${s.y} A ${r} ${r} 0 ${u} 0 ${c.x} ${c.y} Z`;let d=bs(t,o,n,i),m=bs(t,o,n,a);return `M ${s.x} ${s.y} A ${r} ${r} 0 ${u} 0 ${c.x} ${c.y} L ${m.x} ${m.y} A ${n} ${n} 0 ${u} 1 ${d.x} ${d.y} Z`},TC=({children:t})=>g("div",{className:"orb-metric-empty",role:"status",children:[f("span",{className:"orb-metric-empty-mark","aria-hidden":"true",children:"\u2014"}),f(E,{variant:"body2",muted:true,children:t})]}),MC=()=>g("div",{className:"orb-metric-loading",role:"status","aria-label":"Loading chart",children:[f("span",{className:"orb-metric-skeleton orb-metric-skeleton-wide"}),f("span",{className:"orb-metric-skeleton"}),f("span",{className:"orb-metric-skeleton orb-metric-skeleton-short"}),f("span",{className:"orb-metric-skeleton orb-metric-skeleton-wide"})]}),ec=({item:t,onItemClick:o,interactions:r})=>{let n=()=>o?.(t);return {...o?{role:"button",tabIndex:0,onClick:n,onKeyDown:i=>{o&&(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),n());}}:{},...hr(t,r),style:{cursor:o||r?"pointer":"default"}}},IC=({loading:t,error:o,hasData:r,emptyState:n,children:a})=>t?f(MC,{}):o?f("div",{className:"orb-metric-error",role:"alert",children:o}):r?f(e,{children:a}):f(TC,{children:n??"No data for the current selection."}),RC=({data:t,activeId:o,onItemClick:r,interactions:n,valueFormatter:a,colors:i})=>{let s=Math.max(...t.map(c=>Math.abs(eo(c.value))),1);return f("div",{className:"orb-metric-bars",role:"list","aria-label":"Chart data",children:t.map((c,u)=>{let d=eo(c.value),m=`${ys(Math.abs(d)/s*100,0,100)}%`,h=o===c.id,f$1=g(e,{children:[f("span",{className:"orb-metric-bar-label",title:c.label,children:c.label}),f("span",{className:"orb-metric-bar-track","aria-hidden":"true",children:f("span",{className:`orb-metric-bar-fill${h?" is-active":""}`,style:{width:m,backgroundColor:gr(c,u,i)}})}),f("span",{className:"orb-metric-bar-value",children:a(d)})]});return r?f("button",{type:"button",className:`orb-metric-bar-row${h?" is-active":""}`,onClick:()=>r(c),title:`${c.label}: ${a(d)}`,"aria-pressed":h,...hr(c,n),children:f$1},qo(c,u)):f("div",{className:`orb-metric-bar-row${h?" is-active":""}`,role:"listitem",...hr(c,n),children:f$1},qo(c,u))})})},NC=({data:t,activeId:o,onItemClick:r,interactions:n,valueFormatter:a,colors:i})=>{let s=Math.max(t.reduce((c,u)=>c+Math.max(eo(u.value),0),0),1);return f("div",{className:"orb-metric-progress",role:"list","aria-label":"Chart data",children:t.map((c,u)=>{let d=Math.max(eo(c.value),0),m=ys(d/s*100,0,100),h=o===c.id,f$1=g(e,{children:[g("span",{className:"orb-metric-progress-heading",children:[f("span",{title:c.label,children:c.label}),f("strong",{children:a(d)})]}),f("span",{className:"orb-metric-bar-track","aria-hidden":"true",children:f("span",{className:"orb-metric-bar-fill",style:{width:`${m}%`,backgroundColor:gr(c,u,i)}})})]});return r?f("button",{type:"button",className:`orb-metric-progress-row${h?" is-active":""}`,onClick:()=>r(c),"aria-pressed":h,...hr(c,n),children:f$1},qo(c,u)):f("div",{className:`orb-metric-progress-row${h?" is-active":""}`,role:"listitem",...hr(c,n),children:f$1},qo(c,u))})})},DC=({type:t,data:o,activeId:r,onItemClick:n,interactions:a,valueFormatter:i,secondaryValueFormatter:s,colors:c,ariaLabel:u})=>{let{min:d,max:m,range:h}=Om(o),f$1=vs-Gt.left-Gt.right,p=Mn-Gt.top-Gt.bottom,v=Gt.top+m/h*p,C=Math.max(1,Math.ceil(o.length/6)),g$1=o.map((b,k)=>kC(k,b,o)),x=g$1.map(b=>`${b.x},${b.y}`).join(" "),y=Math.max(...o.map(b=>Math.max(eo(b.secondaryValue),0)),1);return f("div",{className:"orb-metric-svg-wrap",children:g("svg",{className:"orb-metric-svg",viewBox:`0 0 ${vs} ${Mn}`,role:"img","aria-label":u,children:[f("line",{className:"orb-metric-axis",x1:Gt.left,y1:v,x2:vs-Gt.right,y2:v}),f("line",{className:"orb-metric-grid",x1:Gt.left,y1:Gt.top,x2:Gt.left,y2:Mn-Gt.bottom}),t==="column"&&o.map((b,k)=>{let w=g$1[k],T=eo(b.value),I=Math.max(Math.abs(w.y-v),T===0?2:0),S=w.x-Math.min(18,f$1/Math.max(o.length*2,1)),D=Math.min(36,Math.max(10,f$1/Math.max(o.length*1.8,1))),R=r===b.id;return g("g",{...ec({item:b,onItemClick:n,interactions:a}),"aria-label":`${b.label}: ${i(T)}`,children:[f("rect",{className:`orb-metric-column${R?" is-active":""}`,x:S,y:Math.min(w.y,v),width:D,height:I,rx:4,fill:gr(b,k,c)}),g("title",{children:[b.label,": ",i(T)]}),(k%C===0||o.length<=6)&&f("text",{className:"orb-metric-svg-label",x:w.x,y:Mn-14,textAnchor:"middle",children:Lm(b.label)})]},qo(b,k))}),(t==="line"||t==="scatter"||t==="bubble")&&g(e,{children:[t==="line"&&f("polyline",{className:"orb-metric-line",fill:"none",points:x,stroke:c[0]}),o.map((b,k)=>{let w=g$1[k],T=r===b.id,I=t==="bubble"?7+Math.max(eo(b.secondaryValue),0)/y*12:t==="scatter"?5:4;return g("g",{...ec({item:b,onItemClick:n,interactions:a}),"aria-label":`${b.label}: ${i(eo(b.value))}`,children:[t==="line"&&f("circle",{className:`orb-metric-point${T?" is-active":""}`,cx:w.x,cy:w.y,r:T?6:4,fill:gr(b,k,c)}),t!=="line"&&f("circle",{className:`orb-metric-point${T?" is-active":""}`,cx:w.x,cy:w.y,r:I,fill:gr(b,k,c),opacity:t==="bubble"?.82:.9}),g("title",{children:[b.label,": ",i(eo(b.value)),t==="bubble"&&b.secondaryValue!==void 0?` \xB7 Size: ${s(eo(b.secondaryValue))}`:""]}),(k%C===0||o.length<=6)&&f("text",{className:"orb-metric-svg-label",x:w.x,y:Math.max(Gt.top+8,w.y-I-7),textAnchor:"middle",children:Lm(b.label)})]},qo(b,k))})]}),f("text",{className:"orb-metric-axis-label",x:Gt.left,y:Gt.top-5,children:i(m)}),d<0&&f("text",{className:"orb-metric-axis-label",x:Gt.left,y:Mn-Gt.bottom+14,children:i(d)})]})})},AC=({type:t,data:o,activeId:r,onItemClick:n,interactions:a,valueFormatter:i,colors:s,ariaLabel:c})=>{let u=o.map(p=>({...p,value:Math.max(eo(p.value),0)})),d=u.reduce((p,v)=>p+v.value,0),m=72,h=92,f$1=0;return g("div",{className:"orb-metric-circular",children:[g("svg",{className:"orb-metric-donut",viewBox:"0 0 184 184",role:"img","aria-label":c,children:[u.map((p,v)=>{let C=p.value/d*360,g$1=f$1;f$1+=C;let x=r===p.id,y=C>=359.9?void 0:PC(h,h,m,t==="donut"?46:0,g$1,g$1+C),b=ec({item:p,onItemClick:n,interactions:a});return y?f("path",{className:`orb-metric-slice${x?" is-active":""}`,d:y,fill:gr(p,v,s),...b,children:g("title",{children:[p.label,": ",i(p.value)," (",(p.value/d*100).toFixed(1),"%)"]})},qo(p,v)):f("circle",{className:`orb-metric-slice${x?" is-active":""}`,cx:h,cy:h,r:t==="donut"?60:m,fill:t==="donut"?"none":gr(p,v,s),stroke:t==="donut"?gr(p,v,s):void 0,strokeWidth:28,...b,children:g("title",{children:[p.label,": ",i(p.value)," (100%)"]})},qo(p,v))}),t==="donut"&&f("circle",{cx:h,cy:h,r:44,fill:"var(--orb-surface)"}),t==="donut"&&f("text",{className:"orb-metric-donut-total",x:h,y:h+5,textAnchor:"middle",children:i(d)})]}),f("div",{className:"orb-metric-legend",role:"list","aria-label":"Chart legend",children:u.map((p,v)=>{let C=r===p.id;return g("button",{type:"button",className:`orb-metric-legend-item${C?" is-active":""}`,onClick:()=>n?.(p),disabled:!n,title:p.label,...hr(p,a),children:[f("span",{className:"orb-metric-legend-dot",style:{backgroundColor:gr(p,v,s)}}),f("span",{className:"orb-metric-legend-label",children:p.label}),g("strong",{children:[(p.value/d*100).toFixed(0),"%"]})]},qo(p,v))})})]})},EC=({data:t,activeId:o,onItemClick:r,interactions:n,valueFormatter:a,secondaryValueFormatter:i})=>f("div",{className:"orb-metric-list",role:"list","aria-label":"Chart data",children:t.map((s,c)=>{let u=g(e,{children:[f("span",{className:"orb-metric-list-label",title:s.label,children:s.label}),f("span",{className:"orb-metric-list-value",children:a(eo(s.value))}),s.secondaryValue!==void 0&&f("span",{className:"orb-metric-list-secondary",children:i(eo(s.secondaryValue))})]});return r?f("button",{type:"button",className:`orb-metric-list-row${o===s.id?" is-active":""}`,onClick:()=>r(s),"aria-pressed":o===s.id,...hr(s,n),children:u},qo(s,c)):f("div",{className:`orb-metric-list-row${o===s.id?" is-active":""}`,role:"listitem",...hr(s,n),children:u},qo(s,c))})}),xs=({title:t,subtitle:o,data:r=[],chartType:n="bar",onChartTypeChange:a,onItemClick:i,onDataDetails:s,activeId:c,valueFormatter:u=Em,secondaryValueFormatter:d=Em,valueLabel:m,secondaryValueLabel:h,emptyState:f$1,loading:p=false,error:v,maxItems:C=8,showChartTypeControl:g$1=true,showDataDetails:x=true,dataRevealDelayMs:y=1e3,chartTypeOptions:b,chartTypeLabels:k,footer:w,ariaLabel:T,className:I,style:S,sx:D})=>{let R=Ks(),M=useRef(null),P=useRef(null),[A,L]=useState(n),[W,j]=useState(false),[O,_]=useState(null),[z,Y]=useState(null);useEffect(()=>L(n),[n]);let H=useCallback(()=>{P.current!==null&&(window.clearTimeout(P.current),P.current=null);},[]);useEffect(()=>H,[H]),useEffect(()=>{if(!z)return;let K=De=>{let ke=De.target;ke instanceof HTMLElement&&ke.closest(".orb-metric-context-menu")||Y(null);};return document.addEventListener("pointerdown",K),()=>document.removeEventListener("pointerdown",K)},[z]);let B=A,q=useMemo(()=>[R.chart1,R.chart2,R.chart3,R.chart4,R.chart5,R.chart6],[R]),Z=useMemo(()=>W?r:r.slice(0,Math.max(1,C)),[r,C,W]),ue=Math.max(0,r.length-Z.length),ne=Z.some(K=>eo(K.value)>0),fe=Z.length>0&&(B!=="pie"&&B!=="donut"?true:ne),Ce=(b??[B,"bar","column","line","pie","donut","scatter","bubble","list"]).filter((K,De,ke)=>Cs.includes(K)&&ke.indexOf(K)===De),$={...SC,...k},J=Z[0],ae=T??`${t} ${$[B]} chart`,xe=K=>{L(K),a?.(K);},pe=useCallback((K,De)=>{_({item:K,source:De}),Y(null),s?.(K,De);},[s]),me=useCallback(K=>{H(),!(!x||z)&&(P.current=window.setTimeout(()=>{pe(K,"hover"),P.current=null;},Math.max(0,y)));},[H,z,y,pe,x]),Ee=useCallback(()=>{H();},[H]),Ge=useCallback((K,De)=>{if(!x)return;K.preventDefault(),H();let ke=M.current?.getBoundingClientRect(),He=ke?ys(K.clientX-ke.left,8,Math.max(8,ke.width-164)):8,at=ke?ys(K.clientY-ke.top,8,Math.max(8,ke.height-72)):8;Y({item:De,left:He,top:at});},[H,x]),nt=x?{onItemHoverStart:me,onItemHoverEnd:Ee,onItemContextMenu:Ge}:void 0,it=B==="metric"?g("div",{className:"orb-metric-kpi",role:i?"button":"img",tabIndex:i?0:void 0,onClick:()=>J&&i?.(J),onKeyDown:K=>{J&&i&&(K.key==="Enter"||K.key===" ")&&(K.preventDefault(),i(J));},"aria-label":ae,...J?hr(J,nt):{},children:[f("span",{className:"orb-metric-kpi-label",children:J?.label??m??"Value"}),f("strong",{children:J?u(eo(J.value)):"\u2014"}),J?.secondaryValue!==void 0&&g("span",{className:"orb-metric-kpi-secondary",children:[h??"Compared with"," \xB7 ",d(eo(J.secondaryValue))]})]}):B==="progress"?f(NC,{data:Z,activeId:c,onItemClick:i,interactions:nt,valueFormatter:u,colors:q}):B==="bar"?f(RC,{data:Z,activeId:c,onItemClick:i,interactions:nt,valueFormatter:u,colors:q}):B==="list"?f(EC,{data:Z,activeId:c,onItemClick:i,interactions:nt,valueFormatter:u,secondaryValueFormatter:d}):B==="pie"||B==="donut"?f(AC,{type:B,data:Z,activeId:c,onItemClick:i,interactions:nt,valueFormatter:u,colors:q,ariaLabel:ae}):f(DC,{type:B,data:Z,activeId:c,onItemClick:i,interactions:nt,valueFormatter:u,secondaryValueFormatter:d,colors:q,ariaLabel:ae});return g("div",{ref:M,className:"orb-metric-chart-shell",onMouseLeave:()=>{H(),O?.source==="hover"&&_(null);},children:[g(Le,{elevation:1,variant:"outlined",className:`orb-metric-chart-card ${I??""}`,style:S,sx:D,children:[g("div",{className:"orb-metric-chart-header",children:[g("div",{className:"orb-metric-chart-heading",children:[f(E,{variant:"subtitle1",component:"h3",noWrap:true,title:t,children:t}),o&&f(E,{variant:"caption",muted:true,component:"div",noWrap:true,children:o})]}),g$1&&Ce.length>1&&f(zt,{"aria-label":`${t} chart type`,className:"orb-metric-chart-select",value:B,options:Ce.map(K=>({value:K,label:$[K]})),onChange:K=>xe(K.target.value),minWidth:108,fullWidth:false,size:"small"})]}),g("div",{className:"orb-metric-chart-body",children:[f(IC,{loading:p,error:v,hasData:fe,emptyState:f$1,children:it}),ue>0&&!p&&!v&&f("button",{type:"button",className:"orb-metric-more",onClick:()=>j(K=>!K),children:W?"Show fewer":`Show all ${r.length}`})]}),w&&f("div",{className:"orb-metric-chart-footer",children:w})]}),z&&g("div",{className:"orb-metric-context-menu",role:"menu",onMouseEnter:H,onKeyDown:K=>{K.key==="Escape"&&Y(null);},style:{left:z.left,top:z.top},onPointerDown:K=>K.stopPropagation(),children:[f("div",{className:"orb-metric-context-label",children:z.item.label}),f("button",{type:"button",role:"menuitem",onClick:K=>{K.preventDefault(),K.stopPropagation(),pe(z.item,"contextmenu");},children:"Show data"})]}),O&&g("div",{className:"orb-metric-data-details",role:"dialog","aria-label":`${O.item.label} data details`,onPointerDown:K=>K.stopPropagation(),children:[g("div",{className:"orb-metric-data-details-header",children:[f("strong",{children:O.item.label}),f("button",{type:"button","aria-label":"Close data details",onClick:()=>_(null),children:"\xD7"})]}),g("div",{className:"orb-metric-data-details-row",children:[f("span",{children:m??"Value"}),f("strong",{children:u(eo(O.item.value))})]}),O.item.secondaryValue!==void 0&&g("div",{className:"orb-metric-data-details-row",children:[f("span",{children:h??"Secondary value"}),f("strong",{children:d(eo(O.item.secondaryValue))})]}),f("span",{className:"orb-metric-data-details-hint",children:O.source==="hover"?`Shown after ${Math.max(0,y)/1e3} seconds of stillness`:"Shown from the context menu"})]})]})};xs.displayName="CMetricChartCard";var LC=({messageId:t,cardHooks:o,valueSuffix:r,secondaryValueSuffix:n,...a})=>{let i=(c,u)=>{o?.onCardEvent?.({messageId:t,cardType:"metric-chart-card",action:c,title:a.title,payload:u,rawData:a});},s=(c,u)=>`${c.toLocaleString()}${u??""}`;return f(xs,{...a,valueFormatter:c=>s(c,r),secondaryValueFormatter:c=>s(c,n),onChartTypeChange:c=>i("action",{chartType:c}),onItemClick:c=>i("action",{item:c}),onDataDetails:(c,u)=>i("show-data",{item:c,source:u})})},ws=LC;var OC=({type:t,manifest:o})=>g("div",{className:"w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md",children:[g("div",{className:"flex items-center px-4 py-3 border-b border-[var(--orb-border)] bg-[var(--orb-p50)]",children:[f("div",{className:"w-4 h-4 mr-2 text-[var(--orb-status-primary)]"}),g("h3",{className:"text-sm font-semibold text-[var(--orb-fg)]",children:["SAP Card: ",t]})]}),f("div",{className:"p-4",children:f("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] p-3 rounded border border-[var(--orb-border)] overflow-x-auto",children:f("pre",{className:"text-xs font-mono text-[var(--orb-muted)] whitespace-pre-wrap",children:JSON.stringify(o,null,2)})})})]}),Ss=OC;var FC=t=>Array.isArray(t)?t.flatMap((o,r)=>{if(!o||typeof o!="object")return [];let n=o,a=String(n.label??n.name??n.id??`Item ${r+1}`),i=Number(n.value),s=Number.isFinite(i)?i:0,c=n.secondaryValue===void 0?void 0:Number(n.secondaryValue);return [{id:String(n.id??n.name??n.label??r),label:a,value:s,...c!==void 0&&Number.isFinite(c)?{secondaryValue:c}:{},...typeof n.color=="string"?{color:n.color}:{}}]}):[],ks=t=>{let o;try{o=JSON.parse(t);}catch{return null}if(o&&typeof o=="object"){if(o.type==="metric-chart-card"&&o.title&&Array.isArray(o.data)){let r=Cs.includes(o.chartType)?o.chartType:"bar";return {...o,type:"metric-chart-card",chartType:r,data:FC(o.data)}}if((o.type==="bar-chart-card"||o.type==="line-chart-card"||o.type==="pie-chart-card"||o.type==="combo-chart-card"||o.type==="heatmap-chart-card"||o.type==="fishbone-chart-card"||o.type==="waterfall-chart-card"||o.type==="google-map-card"||o.type==="amap-card")&&o.title||(o.type==="sap-analytical-card"||o.type==="sap-list-card"||o.type==="sap-object-card"||o.type==="sap-component-card")&&o.manifest||o.type==="error-card"||o.type==="warning-card"||o.type==="suggestions-card"||o.type==="tool-result-card"||o.type==="table"&&o.data)return o}return null};var _C=({content:t,theme:o,size:r="base",className:n,enableCodeHighlight:a=true,enableMermaid:i=true,messageId:s,cardHooks:c})=>{let u=useRef(c);u.current=c;let d=!!c?.onCardEvent,m=useMemo(()=>d?{onCardEvent:C=>u.current?.onCardEvent?.(C)}:void 0,[d]),h=useMemo(()=>t?t.replace(/<think>([\s\S]*?)<\/think>/g,(C,g)=>`<div data-component="thinkbox" data-think-content="${encodeURIComponent(g.trim())}"></div>`):"",[t]),f$1=(C,g,x,y,b)=>{m?.onCardEvent?.({messageId:s,cardType:C,action:g,title:x,payload:y,rawData:b});},p=(C,g,x,y,b,k)=>{if(!(!b&&!m?.onCardEvent))return (...w)=>{let T=b?.(...w),I=k?k(...w):void 0;return f$1(C,g,x,I,y),T}},v=useMemo(()=>({div(C){let{"data-component":g,"data-think-content":x,...y}=C;return g==="thinkbox"&&x?f(ym,{content:decodeURIComponent(x),theme:o,size:r,defaultExpanded:false}):f("div",{...y})},table({children:C}){return f("div",{className:"my-4 w-full overflow-x-auto rounded-lg border border-[var(--orb-border)]",children:f("table",{className:"w-full min-w-[520px] border-collapse text-sm",children:C})})},thead({children:C}){return f("thead",{className:"bg-[color-mix(in_oklch,var(--orb-surface)_60%,transparent)]",children:C})},tbody({children:C}){return f("tbody",{className:"bg-[var(--orb-canvas)] dark:bg-[var(--orb-canvas)]",children:C})},tr({children:C}){return f("tr",{className:"border-b border-[var(--orb-border)] last:border-b-0",children:C})},th({children:C,align:g}){return f("th",{className:`px-3 py-2 font-semibold text-[var(--orb-fg)] ${g==="center"?"text-center":g==="right"?"text-right":"text-left"}`,children:C})},td({children:C,align:g}){return f("td",{className:`px-3 py-2 text-[var(--orb-fg)] align-top ${g==="center"?"text-center":g==="right"?"text-right":"text-left"}`,children:C})},code({className:C,children:g,...x}){let y=/language-([\w-]+)/.exec(C||""),b=y?y[1]:"",k=String(g);if(!y&&!k.includes(`
17
+ `))return f("code",{children:g});let T=k.replace(/\n$/,"");if(i&&b==="mermaid")return f(Mm,{content:T});if(b==="html"||b==="htm")return f(km,{content:T});if(b==="json"){let I=ks(T);if(I)switch(I.type){case "table":return f(gs,{data:I.data});case "metric-chart-card":return f(ws,{...I,messageId:s,cardHooks:m});case "bar-chart-card":case "line-chart-card":case "pie-chart-card":case "combo-chart-card":case "heatmap-chart-card":case "fishbone-chart-card":case "waterfall-chart-card":case "google-map-card":case "amap-card":return f(hs,{...I});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return f(Ss,{...I});case "error-card":{let S=I;return f(ds,{...S,onClose:p("error-card","close",S.title,S,S.onClose),onRetry:p("error-card","retry",S.title,S,S.onRetry)})}case "warning-card":{let S=I,D=S.onConfirm?p("warning-card","confirm",S.title,S,S.onConfirm):S.actionText&&m?.onCardEvent?p("warning-card","confirm",S.title,S):void 0;return f(ps,{...S,onClose:p("warning-card","close",S.title,S,S.onClose),onConfirm:D})}case "suggestions-card":{let S=I;return f(us,{...S,onClose:p("suggestions-card","close",S.title,S,S.onClose),onSuggestionClick:p("suggestions-card","suggestion-click",S.title,S,S.onSuggestionClick,D=>({suggestion:D}))})}case "tool-result-card":{let S=I;return f(ms,{...S,onClose:p("tool-result-card","close",S.title,S,S.onClose),onAction:p("tool-result-card","action",S.title,S,S.onAction)})}}}return a?f(Cm,{content:T,language:b,className:"not-prose"}):f("code",{className:C,...x,children:g})}}),[o,r,i,a,m,s]);return f("div",{className:ot("markdown-body max-w-none",n),children:f(HC,{remarkPlugins:[zC,VC],rehypePlugins:[WC,$C],components:v,children:h})})},In=_C;var GC=({content:t,messageId:o,cardHooks:r})=>{let n=(s,c,u,d,m)=>{r?.onCardEvent?.({messageId:o,cardType:s,action:c,title:u,payload:d,rawData:m});},a=(s,c,u,d,m,h)=>{if(!(!m&&!r?.onCardEvent))return (...f)=>{let p=m?.(...f),v=h?h(...f):void 0;return n(s,c,u,v,d),p}},i=ks(t);if(i)switch(i.type){case "table":return f(gs,{data:i.data});case "metric-chart-card":return f(ws,{...i,messageId:o,cardHooks:r});case "bar-chart-card":case "line-chart-card":case "pie-chart-card":case "combo-chart-card":case "heatmap-chart-card":case "fishbone-chart-card":case "waterfall-chart-card":case "google-map-card":case "amap-card":return f(hs,{...i});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return f(Ss,{...i});case "error-card":{let s=i;return f(ds,{...s,onClose:a("error-card","close",s.title,s,s.onClose),onRetry:a("error-card","retry",s.title,s,s.onRetry)})}case "warning-card":{let s=i,c=s.onConfirm?a("warning-card","confirm",s.title,s,s.onConfirm):s.actionText&&r?.onCardEvent?a("warning-card","confirm",s.title,s):void 0;return f(ps,{...s,onClose:a("warning-card","close",s.title,s,s.onClose),onConfirm:c})}case "suggestions-card":{let s=i;return f(us,{...s,onClose:a("suggestions-card","close",s.title,s,s.onClose),onSuggestionClick:a("suggestions-card","suggestion-click",s.title,s,s.onSuggestionClick,c=>({suggestion:c}))})}case "tool-result-card":{let s=i;return f(ms,{...s,onClose:a("tool-result-card","close",s.title,s,s.onClose),onAction:a("tool-result-card","action",s.title,s,s.onAction)})}}return f("div",{className:"dynamic-card-fallback",children:f(In,{content:t,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:o,cardHooks:r})})},Fm=GC;var oc=class{static analyze(o){if(!o.trim())return {blocks:[],hasComplexContent:false,overallType:"simple"};let n=/```json\s*\{\s*"type":\s*"[^"]+"/g.test(o),a=/<[^>]+>[\s\S]*?<\/[^>]+>/.test(o),i=o.includes("NQ#")||o.includes("data-component");return n||a||i?{blocks:[{type:"mixed",content:o,startIndex:0,endIndex:o.length}],hasComplexContent:true,overallType:"complex"}:{blocks:[{type:"markdown",content:o,startIndex:0,endIndex:o.length}],hasComplexContent:false,overallType:"simple"}}},KC=({content:t,className:o="",messageId:r,cardHooks:n})=>{let a=Jt__default.useMemo(()=>oc.analyze(t),[t]);return f("div",{className:`universal-content-renderer ${o}`,children:a.blocks.map((i,s)=>i.type==="mixed"||i.type==="json-card"?f(Fm,{content:i.content,messageId:r,cardHooks:n},`block-${s}`):f(In,{content:i.content,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:r,cardHooks:n},`block-${s}`))})},Ps=KC;var qC=({content:t,isStreaming:o=true,onComplete:r,className:n="",streamIntervalMs:a=24,streamChunkSize:i=3,messageId:s,cardHooks:c})=>{let[u,d]=useState(o?0:t.length),[m,h]=useState(!o);useEffect(()=>{if(o){d(0),h(false);return}d(t.length),h(true);},[t,o]),useEffect(()=>{if(!o||m)return;if(u>=t.length){h(true),r?.();return}let g=window.setTimeout(()=>{d(x=>Math.min(x+i,t.length));},a);return ()=>{window.clearTimeout(g);}},[t.length,m,o,r,i,a,u]);let f$1=()=>{o&&!m&&(d(t.length),h(true),r?.());},p=o?t.slice(0,u):t,v=o&&!m,C=o&&!m;return g("div",{className:`streaming-markdown ${n}`,onClick:f$1,style:{cursor:o?"pointer":"default"},children:[g("div",{className:"relative",children:[f(Ps,{content:p,messageId:s,cardHooks:c}),v&&f("span",{className:"inline-block w-[2px] h-[13px] ml-0.5 animate-pulse",style:{verticalAlign:"text-bottom",backgroundColor:"var(--orb-primary, #154194)"}})]}),C&&f("div",{className:"streaming-hint",style:{fontSize:"9px",color:"var(--orb-muted)",marginTop:"8px",fontStyle:"italic",opacity:.7},children:"\u70B9\u51FB\u6B64\u5904\u663E\u793A\u5B8C\u6574\u5185\u5BB9"})]})},zm=qC;var Vm=({buttons:t,className:o})=>{let r=n=>{switch(n){case "copy":return f(Lo,{size:14});case "refresh":return f(_a,{size:14});case "volume":return f(id,{size:14});case "like":return f(od,{size:14});case "dislike":return f(td,{size:14});default:return null}};return f("div",{className:ot("flex items-center gap-1",o),children:t.map((n,a)=>f("button",{onClick:n.onClick,disabled:n.disabled,"aria-busy":n.loading||void 0,className:ot("p-1.5 rounded-md transition-colors","text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] dark:hover:text-[var(--orb-fg)]","hover:bg-[var(--orb-hover)]","disabled:opacity-50 disabled:cursor-not-allowed",n.active&&"text-[var(--orb-primary)] bg-[var(--orb-p50)]",n.type==="refresh"&&n.loading&&"animate-spin"),title:n.type,type:"button",children:r(n.type)},`${n.type}-${a}`))})};var Ts=({message:t,onStreamingComplete:o,assistantActions:r,streamIntervalMs:n,streamChunkSize:a,cardHooks:i})=>{let s={lineHeight:1.55,fontSize:13,fontWeight:300,fontFamily:'var(--orb-font, "Montserrat", system-ui, sans-serif)',color:"var(--orb-fg, #555555)",borderRadius:"var(--orb-r, 10px)",padding:"10px 14px"},c={marginTop:6,fontSize:11,color:"var(--orb-muted, #8c8c8c)"};if(t.type==="assistant"){let u=!!(r?.isResponding||t.isStreaming);return f("div",{className:"mb-4 flex justify-start",children:g("div",{className:"mr-auto w-full",style:{...s,background:"var(--orb-surface, #f5f5f5)",border:"1px solid var(--orb-border, #dbdbdb)"},children:[f(zm,{content:t.content,isStreaming:t.isStreaming??false,onComplete:o,streamIntervalMs:n,streamChunkSize:a,messageId:t.id,cardHooks:i}),t.content&&r?.isLatestAssistant&&f("div",{className:"mt-3 flex flex-row justify-start gap-2 border-t pt-2",style:{borderColor:"var(--orb-border, #dbdbdb)"},children:f(Vm,{buttons:[{type:"refresh",onClick:()=>{r?.onRegenerate?.();},disabled:u||!r?.onRegenerate,loading:u},{type:"copy",onClick:()=>navigator.clipboard.writeText(t.content),disabled:false},{type:"volume",onClick:()=>console.log("\u8BED\u97F3\u64AD\u653E"),disabled:false},{type:"like",onClick:()=>console.log("\u70B9\u8D5E"),disabled:false},{type:"dislike",onClick:()=>console.log("\u70B9\u8E29"),disabled:false}],size:"sm",variant:"default"})}),f("div",{style:c,children:t.timestamp.toLocaleTimeString()})]})})}return f("div",{className:"mb-4 flex justify-end",children:g("div",{className:"ml-auto max-w-[80%]",style:{...s,background:"var(--orb-p50, #eef2f9)",border:"1px solid var(--orb-p100, #e4e9f5)"},children:[f("div",{className:"whitespace-pre-wrap",children:t.content}),f("div",{style:c,children:t.timestamp.toLocaleTimeString()})]})})};var QC=4,Is=8,_m=6,jC=[],JC=(t,o)=>{if(!o)return null;let r=t.find(a=>a.id===o.groupId),n=r?.models.find(a=>a.id===o.modelId);return r&&n?{group:r,model:n}:null},ex=(t,o)=>({groupId:t.id,modelId:o.id,...o.defaultEffortId?{effortId:o.defaultEffortId}:{}}),Gm=({modelGroups:t=jC,modelSelection:o,onModelSelectionChange:r,modelSelectDisabled:n=false})=>{let{t:a}=de(),i=useId(),s=useRef(null),c=useRef(null),u=useRef(null),[d,m]=useState(false),[h,f$1]=useState("root"),[p,v]=useState(""),[C,g$1]=useState(0),[x,y]=useState(null),[b,k]=useState(null),w=useRef("root");w.current=h;let T=o!==void 0,I=T?o??null:x,S=JC(t,I),D=S?.model.efforts??[],R=I?.effortId??S?.model.defaultEffortId,P=D.find($=>$.id===R)?.name??(R&&D.length>0?R:void 0),A=S?.model.name??(I?I.modelId:a("omph.model.fallback")),L=t.reduce(($,J)=>$+J.models.length,0),W=L>QC,j=useMemo(()=>{let $=W?p.trim().toLowerCase():"";return t.map(J=>({...J,models:$?J.models.filter(ae=>ae.name.toLowerCase().includes($)):J.models})).filter(J=>J.models.length>0)},[t,p,W]),O=useMemo(()=>j.flatMap($=>$.models.map(J=>({group:$,model:J}))),[j]),_=O.length===0?-1:Math.min(C,O.length-1),z=()=>{m(false),f$1("root"),v(""),g$1(0),k(null);},Y=$=>{T||y($),r?.($),z(),s.current?.focus();},H=()=>{n||(f$1("root"),v(""),g$1(0),k(null),m(true));};useLayoutEffect(()=>{if(!d)return;let $=()=>{let J=s.current,ae=c.current;if(!J||!ae)return;let xe=J.getBoundingClientRect(),pe=ae.getBoundingClientRect(),me=xe.top-pe.height-_m;me<Is&&(me=Math.min(xe.bottom+_m,window.innerHeight-pe.height-Is));let Ee=xe.right-pe.width;Ee=Math.max(Is,Math.min(Ee,window.innerWidth-pe.width-Is)),k(Ge=>Ge&&Ge.top===me&&Ge.left===Ee?Ge:{top:me,left:Ee});};return $(),window.addEventListener("resize",$),window.addEventListener("scroll",$,true),()=>{window.removeEventListener("resize",$),window.removeEventListener("scroll",$,true);}},[d,h,p,L,D.length]),useEffect(()=>{if(!d)return;let $=ae=>{let xe=ae.composedPath();s.current&&xe.includes(s.current)||c.current&&xe.includes(c.current)||z();},J=ae=>{if(ae.key==="Escape"){if(ae.preventDefault(),ae.stopPropagation(),w.current!=="root"){f$1("root");return}z(),s.current?.focus();}};return document.addEventListener("pointerdown",$),document.addEventListener("keydown",J),()=>{document.removeEventListener("pointerdown",$),document.removeEventListener("keydown",J);}},[d]),useEffect(()=>{if(!d)return;if(h==="model"&&W){u.current?.focus();return}let $=c.current?.querySelector('[aria-checked="true"]'),J=c.current?.querySelector('[role="menuitem"], [role="menuitemradio"]');($??J)?.focus();},[d,h,W]);let B=($,J)=>{if(I?.groupId===$.id&&I.modelId===J.id){z(),s.current?.focus();return}Y(ex($,J));},q=$=>{if(S){if(R===$){z(),s.current?.focus();return}Y({groupId:S.group.id,modelId:S.model.id,effortId:$});}},Z=$=>{O.length!==0&&g$1(J=>(Math.min(J,O.length-1)+$+O.length)%O.length);},ue=$=>{if($.key==="ArrowDown")$.preventDefault(),Z(1);else if($.key==="ArrowUp")$.preventDefault(),Z(-1);else if($.key==="Enter"&&_>=0){$.preventDefault();let J=O[_];J&&B(J.group,J.model);}},ne=$=>{if($.key!=="ArrowDown"&&$.key!=="ArrowUp")return;let J=[...c.current?.querySelectorAll('[role="menuitem"], [role="menuitemradio"]')??[]];if(J.length===0)return;$.preventDefault();let ae=J.indexOf(document.activeElement),xe=$.key==="ArrowDown"?1:-1;J[(ae+xe+J.length)%J.length]?.focus();},fe=I?P?a("omph.model.ariaEffort",{model:A,effort:P}):a("omph.model.aria",{model:A}):a("omph.model.fallback"),Ce=d?g("div",{ref:c,id:i,className:"orb-omph-model-menu",role:h==="root"?"menu":"group","aria-label":a("omph.model.menu"),style:b?{top:b.top,left:b.left}:{visibility:"hidden",top:0,left:0},onKeyDown:h==="model"&&W?void 0:ne,children:[h==="root"&&g(e,{children:[g("button",{type:"button",className:"orb-omph-model-cell",role:"menuitem",onClick:()=>f$1("model"),children:[f("span",{className:"orb-omph-model-cell-label",children:a("omph.model.model")}),f("span",{className:"orb-omph-model-cell-value",children:A}),f(So,{className:"orb-omph-model-cell-chevron",size:12})]}),D.length>0&&g("button",{type:"button",className:"orb-omph-model-cell",role:"menuitem",onClick:()=>f$1("effort"),children:[f("span",{className:"orb-omph-model-cell-label",children:a("omph.model.effort")}),f("span",{className:"orb-omph-model-cell-value",children:P}),f(So,{className:"orb-omph-model-cell-chevron",size:12})]})]}),h==="model"&&g(e,{children:[W&&g("div",{className:"orb-omph-model-search",children:[f("input",{ref:u,className:"orb-omph-model-search-input",type:"text",role:"searchbox","aria-label":a("omph.model.search"),"aria-controls":`${i}-models`,"aria-activedescendant":_>=0?`${i}-model-${_}`:void 0,placeholder:a("omph.model.search"),value:p,onChange:$=>{v($.target.value),g$1(0);},onKeyDown:ue}),p!==""&&f("button",{type:"button",className:"orb-omph-model-search-clear","aria-label":a("omph.model.searchClear"),onClick:()=>{v(""),g$1(0),u.current?.focus();},children:f(ea,{size:14})})]}),f("div",{id:`${i}-models`,className:"orb-omph-model-list",role:"menu","aria-label":a("omph.model.model"),hidden:j.length===0,children:j.map($=>g("div",{role:"group","aria-label":$.name,children:[f("div",{className:"orb-omph-model-group",children:$.name}),$.models.map(J=>{let ae=O.findIndex(pe=>pe.group.id===$.id&&pe.model.id===J.id),xe=I?.groupId===$.id&&I.modelId===J.id;return g("button",{id:`${i}-model-${ae}`,type:"button",role:"menuitemradio","aria-checked":xe,tabIndex:W?-1:0,"data-active":W&&ae===_?"":void 0,className:"orb-omph-model-option",title:J.name,onMouseMove:W&&ae!==_?()=>g$1(ae):void 0,onClick:()=>B($,J),children:[f("span",{className:"orb-omph-model-option-name",children:J.name}),f("span",{className:"orb-omph-model-check","aria-hidden":"true",children:xe?f(po,{size:14}):null})]},J.id)})]},$.id))}),j.length===0&&f("div",{className:"orb-omph-model-empty",role:"status",children:a(L===0?"omph.model.emptyModels":"omph.model.searchEmpty")})]}),h==="effort"&&(D.length===0?f("div",{className:"orb-omph-model-empty",children:a("omph.model.emptyEfforts")}):f("div",{className:"orb-omph-model-list",role:"menu","aria-label":a("omph.model.effort"),children:D.map($=>{let J=R===$.id;return g("button",{type:"button",role:"menuitemradio","aria-checked":J,className:"orb-omph-model-option",onClick:()=>q($.id),children:[f("span",{className:"orb-omph-model-option-name",children:$.name}),f("span",{className:"orb-omph-model-check","aria-hidden":"true",children:J?f(po,{size:14}):null})]},$.id)})}))]}):null;return g("div",{className:"orb-omph-model",children:[g("button",{ref:s,type:"button",className:"orb-omph-model-trigger","aria-label":fe,"aria-haspopup":"menu","aria-expanded":d,"aria-controls":d?i:void 0,title:P?`${A} ${P}`:A,disabled:n,onClick:()=>{d?z():H();},children:[f("span",{className:"orb-omph-model-name",children:A}),P&&f("span",{className:"orb-omph-model-effort",children:P}),f(Po,{className:"orb-omph-model-chevron",size:14})]}),Ce&&typeof document<"u"?createPortal(Ce,document.body):null]})};var Um=({onTextUpdate:t,onComplete:o,onCancel:r,disabled:n,className:a})=>{let{isRecording:i,startRecording:s,stopRecording:c}=xn({onTextUpdate:t,onComplete:d=>{o?.(d);},onError:d=>{console.error("Voice input error:",d),r?.();}});return f("button",{onClick:async()=>{i?c():await s();},disabled:n,className:ot("transition-all duration-200 flex items-center justify-center rounded-full",i?"bg-[color-mix(in_oklch,var(--orb-status-error)_12%,transparent)] text-[var(--orb-status-error)] hover:bg-[color-mix(in_oklch,var(--orb-status-error)_20%,transparent)] animate-pulse":"bg-transparent hover:bg-[var(--orb-hover)] text-[var(--orb-muted)] active:scale-95",n&&"opacity-50 cursor-not-allowed",a),title:i?"Stop recording":"Start recording",type:"button",children:i?f(dp,{size:16}):f(pp,{size:16})})};var Nt={container:"w-full max-w-4xl mx-auto",inputContainer:ot("w-full flex flex-col border border-[var(--orb-border,#dbdbdb)] bg-[color-mix(in_oklch,var(--orb-canvas)_64%,transparent)] backdrop-blur-[28px] transition-colors duration-200","orb-agent-input","focus-within:border-[var(--orb-primary,#154194)] focus-within:ring-1 focus-within:ring-[var(--orb-focus-ring,#e4e9f5)]"),dragActive:"border-[var(--orb-primary,#154194)] bg-[var(--orb-p50,#eef2f9)]",textareaWrapper:"flex-1 relative flex items-center",textarea:ot("w-full outline-none appearance-none resize-none bg-transparent border-none text-sm font-normal py-3 px-3","placeholder:text-[var(--orb-muted,#8c8c8c)] placeholder:font-normal","text-[var(--orb-fg,#555555)] selection:bg-[var(--orb-p100,#e4e9f5)]","focus:ring-0 focus:outline-none focus:border-none focus:shadow-none","min-h-[44px] max-h-[12em] overflow-y-auto scrollbar-thin scrollbar-thumb-[var(--orb-border)]"),filePreviewArea:"px-4 pt-3 pb-1 flex flex-wrap gap-2",queueArea:"px-4 pt-3 flex flex-col gap-2",queueCard:ot("flex flex-wrap items-center gap-x-3 gap-y-1 px-3 py-2 rounded-lg","bg-[var(--orb-p50,#eef2f9)] border border-[var(--orb-p100,#dbdbdb)]","text-xs text-[var(--orb-fg,#555555)]"),queueContent:"min-w-0 flex-1 truncate font-medium",queueHint:"text-[var(--orb-muted,#8c8c8c)]",queueButton:ot("shrink-0 px-2 py-1 rounded-md text-xs font-semibold cursor-pointer active:scale-95","text-[var(--orb-primary,#154194)] hover:bg-[var(--orb-p50,#eef2f9)]"),queueCancelButton:ot("shrink-0 flex items-center justify-center h-5 w-5 rounded-full cursor-pointer","text-[var(--orb-muted,#8c8c8c)] hover:text-[var(--orb-fg,#555555)] hover:bg-[var(--orb-hover,#eef2f9)]"),fileTag:ot("flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs font-medium","bg-[var(--orb-surface,#f5f5f5)] text-[var(--orb-fg,#555555)]","border border-[var(--orb-border,#dbdbdb)]","transition-all hover:bg-[var(--orb-hover,#eef2f9)]"),buttonBase:"flex items-center justify-center transition-all duration-200 rounded-full",buttonSmall:"h-[38px] w-[38px] shrink-0 md:h-8 md:w-8",buttonNormal:ot("bg-transparent hover:bg-[var(--orb-hover,#eef2f9)] text-[var(--orb-muted,#8c8c8c)] hover:text-[var(--orb-fg,#555555)]","cursor-pointer active:scale-95"),sendButton:ot("cursor-pointer bg-[var(--orb-primary,#154194)] hover:bg-[var(--orb-p600,#0e2d63)] text-[var(--orb-on-primary)] shadow-none active:scale-95"),sendButtonDisabled:ot("cursor-not-allowed opacity-40 bg-[var(--orb-disabled-bg,#f5f5f5)] text-[var(--orb-disabled-fg,#8c8c8c)]"),stopButton:ot("cursor-pointer bg-[var(--orb-err,#c43f02)] hover:opacity-90 text-[var(--orb-on-primary)] shadow-none active:scale-95"),stopSecondary:ot("cursor-pointer border border-[var(--orb-border,#dbdbdb)] text-[var(--orb-muted,#8c8c8c)]","hover:border-[var(--orb-err,#c43f02)] hover:text-[var(--orb-err,#c43f02)] active:scale-95")},ox={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},rx=({enabled:t,onClick:o})=>{let{t:r}=de();return f("button",{className:ot(Nt.buttonBase,Nt.buttonSmall,Nt.buttonNormal),onClick:o,disabled:!t,"aria-label":r("omph.input.upload"),type:"button",children:f(Gd,{size:16})})},nx=({canSend:t,isResponding:o,onSend:r,onStop:n})=>{let{t:a}=de();return o&&!t?f("button",{className:ot(Nt.buttonBase,Nt.buttonSmall,Nt.stopButton),onClick:n,"aria-label":a("omph.input.stop"),type:"button",children:f(hl,{size:15})}):g(e,{children:[o&&f("button",{className:ot(Nt.buttonBase,Nt.buttonSmall,Nt.stopSecondary),onClick:n,"aria-label":a("omph.input.stop"),type:"button",children:f(hl,{size:14})}),f("button",{className:ot(Nt.buttonBase,Nt.buttonSmall,t?Nt.sendButton:Nt.sendButtonDisabled),onClick:r,disabled:!t,"aria-label":a("omph.input.send"),type:"button",children:f(hp,{size:16,className:t?"text-[var(--orb-on-primary,#ffffff)]":"text-[var(--orb-disabled-fg,#8c8c8c)]"})})]})},Sa=({onSend:t,onStop:o,isResponding:r=false,placeholder:n,getText:a,modelGroups:i,modelSelection:s,onModelSelectionChange:c,modelSelectDisabled:u})=>{let[d,m]=useState(""),[h,f$1]=useState([]),[p,v]=useState(false),[C,g$1]=useState(false),[x,y]=useState([]),b=useRef(null),k=useRef(0),{t:w}=de(),T=w("omph.input.placeholder"),I=T!=="omph.input.placeholder"?T:"Type a message...",S=n||(a?a("00019",I):I),D=d.trim().length>0||h.length>0,R={enabled:true},M=useCallback($=>{m($.target.value),$.target.style.height="auto",$.target.style.height=`${Math.min($.target.scrollHeight,200)}px`;},[]),P=useCallback($=>{if($.target.files&&$.target.files.length>0){let J=Array.from($.target.files);f$1(ae=>{let xe=J.filter(me=>ae.some(Ee=>Ee.name===me.name&&Ee.size===me.size));xe.length>0&&console.warn("Duplicate files ignored:",xe.map(me=>me.name));let pe=J.filter(me=>!ae.some(Ee=>Ee.name===me.name&&Ee.size===me.size));return [...ae,...pe]}),b.current&&(b.current.value="");}},[]),A=useCallback($=>{f$1(J=>J.filter((ae,xe)=>xe!==$));},[]),L=useCallback(()=>{b.current?.click();},[]),W=useCallback(async()=>{if(!D)return;let $=d,J=[...h];if(r){k.current+=1,y(ae=>[...ae,{id:k.current,content:$,files:J,confirmed:false}]),m(""),f$1([]),b.current&&(b.current.value="");return}m(""),f$1([]),b.current&&(b.current.value="");try{await t($,J);}catch(ae){console.error("Failed to send message:",ae),m($),f$1(J);}},[d,D,r,t,h]),j=useCallback($=>{let J=x.find(ae=>ae.id===$);J&&(y(ae=>ae.filter(xe=>xe.id!==$)),t(J.content,J.files).catch(()=>m(J.content)));},[x,t]),O=useCallback($=>{y(J=>J.map(ae=>ae.id===$?{...ae,confirmed:true}:ae));},[]),_=useCallback($=>{y(J=>J.filter(ae=>ae.id!==$));},[]);useEffect(()=>{if(r||x.length===0)return;let $=x;y([]),(async()=>{for(let J of $)try{await t(J.content,J.files);}catch(ae){console.error("Failed to send queued message:",ae),m(J.content);}})();},[r,x,t]);let z=useCallback(()=>{y([]),o();},[o]),Y=useCallback($=>{$.key==="Enter"&&!$.shiftKey&&!p&&($.preventDefault(),W());},[W,p]),H=useCallback(()=>{v(true);},[]),B=useCallback(()=>{v(false);},[]),q=useCallback($=>{m($);},[]),Z=useCallback($=>{m($);},[]),ue=useCallback(()=>{},[]),ne=useCallback($=>{$.preventDefault(),g$1(true);},[]),fe=useCallback($=>{$.preventDefault(),g$1(false);},[]),Ce=useCallback($=>{if($.preventDefault(),g$1(false),$.dataTransfer.files&&$.dataTransfer.files.length>0){let J=Array.from($.dataTransfer.files);f$1(ae=>[...ae,...J]);}},[]);return f("div",{className:Nt.container,children:g("div",{className:"relative",children:[f("input",{type:"file",multiple:true,className:"hidden",ref:b,onChange:P}),g("div",{className:ot(Nt.inputContainer,C&&Nt.dragActive),onDragOver:ne,onDragLeave:fe,onDrop:Ce,children:[x.length>0&&f("div",{className:Nt.queueArea,children:x.map($=>g("div",{className:Nt.queueCard,"data-omph-queue":$.id,children:[f("span",{className:Nt.queueContent,title:$.content,children:$.content}),$.confirmed?f("span",{className:Nt.queueHint,children:w("omph.input.queue.queued")}):f("span",{className:Nt.queueHint,children:w("omph.input.queue.ask")}),f("button",{className:Nt.queueButton,onClick:()=>j($.id),type:"button",children:w("omph.input.queue.sendNow")}),!$.confirmed&&f("button",{className:Nt.queueButton,onClick:()=>O($.id),type:"button",children:w("omph.input.queue.afterTurn")}),f("button",{className:Nt.queueCancelButton,onClick:()=>_($.id),"aria-label":w("omph.input.queue.cancel"),type:"button",children:f(ea,{sx:{fontSize:14}})})]},$.id))}),h.length>0&&f("div",{className:Nt.filePreviewArea,children:h.map(($,J)=>g("div",{className:Nt.fileTag,children:[f(ap,{sx:{fontSize:16},className:"text-[var(--orb-primary)]"}),f("span",{className:"truncate max-w-[150px]",children:$.name}),f("button",{onClick:()=>A(J),className:"ml-1 hover:text-[var(--orb-status-error)] focus:outline-none",type:"button",children:f(ea,{sx:{fontSize:16}})})]},`${$.name}-${J}`))}),g("div",{className:"flex w-full flex-col p-2",children:[f("div",{className:ot(Nt.textareaWrapper,"min-h-[52px] px-2 pb-2 pt-1.5 md:min-h-[44px]"),children:f("textarea",{className:ot(Nt.textarea,"min-h-[24px] py-0 px-0"),placeholder:S,value:d,onChange:M,onKeyDown:Y,onCompositionStart:H,onCompositionEnd:B,style:ox,"aria-label":w("omph.input.message"),spellCheck:false,rows:1})}),g("div",{className:"flex items-center justify-between px-1 pb-0.5",children:[f("div",{className:"flex items-center gap-1",role:"toolbar","aria-label":w("omph.input.tools"),children:f(rx,{enabled:R.enabled,onClick:L})}),g("div",{className:"flex min-w-0 items-center gap-1",children:[f(Um,{onTextUpdate:q,onComplete:Z,onCancel:ue,disabled:r,className:Nt.buttonSmall}),f(Gm,{modelGroups:i,modelSelection:s,onModelSelectionChange:c,modelSelectDisabled:u}),f(nx,{canSend:D,isResponding:r,onSend:W,onStop:z})]})]})]})]})]})})};var Xm=({messages:t,onSend:o,onStop:r,onRegenerate:n,isResponding:a=false,className:i,placeholder:s,streamIntervalMs:c,streamChunkSize:u,onMessageStreamingComplete:d,cardHooks:m,showInput:h=true,statusLine:f$1,modelGroups:p,modelSelection:v,onModelSelectionChange:C,modelSelectDisabled:g$1})=>{let x=useRef(null),y=useRef(t.length);return useEffect(()=>{t.length>y.current&&x.current?.scrollIntoView({behavior:"smooth"}),y.current=t.length;},[t]),g("div",{className:ot("flex flex-col h-full w-full relative",i),children:[g("div",{className:"flex-1 overflow-y-auto px-4 py-4 space-y-6 scrollbar-thin scrollbar-thumb-[var(--orb-border)]",children:[t.map((b,k)=>{let w=b.type==="assistant"&&k===t.length-1,T=b.type==="assistant"?{isLatestAssistant:w,isResponding:a,onRegenerate:n?()=>n(b.id):void 0}:void 0;return f(Ts,{message:b,assistantActions:T,onStreamingComplete:()=>d?.(b.id),streamIntervalMs:c,streamChunkSize:u,cardHooks:m},b.id)}),f$1,f("div",{ref:x})]}),h&&f("div",{className:"border-t border-[var(--orb-border,#dbdbdb)] bg-[var(--orb-canvas,#ffffff)] p-4 z-10",children:f(Sa,{onSend:o||(async()=>{}),onStop:r||(()=>{}),isResponding:a,placeholder:s,modelGroups:p,modelSelection:v,onModelSelectionChange:C,modelSelectDisabled:g$1})})]})};var Zm={idle:"Idle",running:"Working",success:"Success",error:"Error",pending:"Pending"},Ym=({title:t="AI Agent",description:o,headerActions:r,className:n,agentStatus:a,statusText:i,onHeaderPointerDown:s,showInput:c=false,...u})=>{let d=a??(u.isResponding?"running":"idle"),m=d==="running"||d==="pending",h=[Zm[d],o].filter(Boolean).join(" \xB7 ");return g("div",{className:ot("orb-agent-panel",n),children:[g("div",{className:ot("orb-agent-header",s&&"cursor-grab active:cursor-grabbing"),onPointerDown:s,children:[f("span",{className:"orb-agent-avatar","aria-hidden":"true",children:"AI"}),g("div",{className:"min-w-0 flex-1",children:[f("div",{className:"orb-agent-title",children:t}),g("div",{className:"orb-agent-subtitle",children:[f("span",{className:"orb-agent-dot","data-active":m||void 0}),f("span",{className:"truncate",children:h||"Agent"})]})]}),r&&f("div",{className:"ml-auto flex flex-none items-center gap-1",children:r})]}),f("div",{className:"relative min-h-0 flex-1",children:f(Xm,{...u,showInput:c,statusLine:m?g("div",{className:ot("orb-agent-status-line","mb-1"),children:[f("span",{className:"orb-agent-spinner","aria-hidden":"true"}),f("span",{children:i??`${Zm[d]}\u2026`})]}):void 0})})]})};var lx=t=>Number.isNaN(t.getTime())?"":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(t),Rs=({conversations:t,activeConversationId:o,labels:r,onNewConversation:n,onSelectConversation:a})=>{let[i,s]=useState(false),c=useRef(null),u=useRef(null),d=useRef(null),m=useId(),h=!!a;useEffect(()=>{if(!i)return;let p=C=>{c.current?.contains(C.target)||s(false);},v=C=>{C.key==="Escape"&&(C.stopPropagation(),s(false),d.current?.focus());};return document.addEventListener("pointerdown",p),document.addEventListener("keydown",v),()=>{document.removeEventListener("pointerdown",p),document.removeEventListener("keydown",v);}},[i]),useEffect(()=>{if(!i)return;let p=u.current?.querySelector('[aria-selected="true"]'),v=u.current?.querySelector('[role="option"]');(p??v)?.focus();},[i]);let f$1=p=>{let v=Array.from(u.current?.querySelectorAll('[role="option"]')??[]);if(v.length===0)return;let C=v.findIndex(x=>x===document.activeElement),g=C<0?p===1?0:v.length-1:(C+p+v.length)%v.length;v[g]?.focus();};return !n&&!h?null:g(e,{children:[n&&f("button",{type:"button",className:"orb-omph-icon-btn","aria-label":r.newConversation,onClick:()=>{s(false),n();},children:f(Jr,{size:16})}),h&&a&&g("div",{className:"orb-omph-conversation-anchor",ref:c,children:[f("button",{ref:d,type:"button",className:"orb-omph-icon-btn","aria-label":r.conversationList,"aria-expanded":i,"aria-controls":m,onClick:()=>s(p=>!p),children:f(Xc,{size:16})}),i&&f("div",{ref:u,id:m,className:"orb-omph-conversations",role:"listbox","aria-label":r.conversations,onKeyDown:p=>{p.key==="ArrowDown"?(p.preventDefault(),f$1(1)):p.key==="ArrowUp"&&(p.preventDefault(),f$1(-1));},children:t.length===0?f("p",{className:"orb-omph-conversation-empty",children:r.noConversations}):t.map(p=>{let v=p.updatedAt?lx(p.updatedAt):"",C=[p.preview,v].filter(x=>x&&x.length>0).join(" \xB7 "),g$1=p.id===o;return g("button",{type:"button",role:"option",className:"orb-omph-conversation","aria-selected":g$1,"data-active":g$1||void 0,onClick:()=>{a(p.id),s(false);},children:[f("span",{className:"orb-omph-conversation-title",children:p.title}),C&&f("span",{className:"orb-omph-conversation-meta",children:C})]},p.id)})})]})]})};var cx=t=>{let o=0;for(let r=0;r<t.length;r+=1){let n=t.charCodeAt(r);if(n<65||n>90)break;o=o*26+(n-64);}return o-1},dx=/^\$?([A-Za-z]+)\$?\d+$/,jm=t=>{let o=[];return t.querySelectorAll("t").forEach(r=>o.push(r.textContent??"")),o.join("")},Ns=t=>new DOMParser().parseFromString(t,"application/xml"),px="http://schemas.openxmlformats.org/officeDocument/2006/relationships",Jm=async t=>{let{default:o}=await import('jszip'),r=await o.loadAsync(t),n=[],a=r.file("xl/sharedStrings.xml");a&&Ns(await a.async("string")).querySelectorAll("si").forEach(p=>n.push(jm(p)));let i=r.file("xl/workbook.xml");if(!i)throw new Error("Not an xlsx workbook");let s=Ns(await i.async("string")),c=new Map,u=r.file("xl/_rels/workbook.xml.rels");u&&Ns(await u.async("string")).querySelectorAll("Relationship").forEach(p=>{let v=p.getAttribute("Id"),C=p.getAttribute("Target");v&&C&&c.set(v,C.startsWith("xl/")?C:`xl/${C.replace(/^\//,"")}`);});let d=2e5,m=[],h=Array.from(s.querySelectorAll("sheet"));for(let f of h){let p=f.getAttribute("name")??`Sheet${m.length+1}`,v=f.getAttributeNS(px,"id"),C=v&&c.get(v)||`xl/worksheets/sheet${m.length+1}.xml`,g=r.file(C);if(!g)continue;let x=Ns(await g.async("string")),y=[],b=false;for(x.querySelectorAll("row").forEach(k=>{if(y.length>=5e3||d<=0){b=true;return}let w=[];k.querySelectorAll("c").forEach(T=>{if(d<=0)return;let I=T.getAttribute("r")??"",S=dx.exec(I),D=S?cx(S[1].toUpperCase()):w.length;if(D<0)return;let R=T.getAttribute("t"),M="";if(R==="inlineStr"){let P=T.querySelector("is");M=P?jm(P):"";}else {let P=T.querySelector("v")?.textContent??"";R==="s"?M=n[Number(P)]??"":R==="b"?M=P==="1"?"TRUE":"FALSE":M=P;}M!==""&&(w[D]=M,d-=1);}),y.push(Array.from(w,T=>T??""));});y.length>0&&y[y.length-1].every(k=>k==="");)y.pop();m.push({name:p,rows:y,truncated:b});}if(m.length===0)throw new Error("No worksheets found");return m},eg=t=>t.map(o=>{let r=[...o];for(;r.length>0&&r[r.length-1]==="";)r.pop();return r.join(" ")}).join(`
18
+ `);var hx=2e3,fx=1/3,Ds=[.25,.5,.75,1,1.5,2,3,4],bx=100,vx=500,yx=100,Cx=9,xx=1e3,tg=14,og={color:"inherit",background:"transparent",textShadow:"none",fontFamily:"inherit",fontSize:"inherit",lineHeight:"inherit",textAlign:"left",wordSpacing:"normal",wordBreak:"normal",overflowWrap:"normal",tabSize:"inherit",hyphens:"none"},ng=({text:t,language:o,startLine:r,endLine:n,wrap:a,labels:i})=>{let s=useRef(null),c=useMemo(()=>{let m=t.split(`
19
+ `);m.length>1&&m[m.length-1]===""&&m.pop();let h=Math.min(m.length,hx);return {shown:m.slice(0,h).join(`
20
+ `),shownCount:h,total:m.length}},[t]),u=useCallback(m=>{let h=n??r,f=r!==void 0&&h!==void 0&&m>=r&&m<=h;return {className:"orb-omph-code-line","data-line":m,...f?{"data-hit":"true"}:{}}},[n,r]);useEffect(()=>{let m=s.current,h=m?.closest(".orb-omph-pv-body");if(!m||!h)return;if(r===void 0){h.scrollTop=0;return}let f=m.querySelector(`[data-line="${r}"]`);if(!f)return;let p=f.getBoundingClientRect().top-h.getBoundingClientRect().top+h.scrollTop;h.scrollTop=Math.max(0,p-h.clientHeight*fx);},[r,c.shown]);let d={"--orb-omph-digits":String(c.shownCount).length};return g("div",{ref:s,className:"orb-omph-code","data-wrap":a||void 0,style:d,children:[f(Prism,{language:o,useInlineStyles:false,PreTag:"div",CodeTag:"div",showLineNumbers:true,wrapLines:true,lineProps:u,customStyle:og,codeTagProps:{className:`language-${o}`,style:og},children:c.shown}),c.total>c.shownCount&&f("div",{className:"orb-omph-pv-note",children:i.previewTruncated(c.shownCount,c.total)})]})},ag=({text:t})=>f("div",{className:"orb-omph-pv-doc",children:f(In,{content:t})}),ig=({url:t,alt:o,labels:r})=>{let[n,a]=useState("fit"),[i,s]=useState(null),[c,u]=useState(false),d=n==="fit"?1:n,m=Ds.some(v=>v>d),h=Ds.some(v=>v<d),f$1=v=>a(C=>{let g=C==="fit"?1:C;return (v>0?Ds.find(y=>y>g):[...Ds].reverse().find(y=>y<g))??C}),p=n==="fit"||i===null?{maxWidth:"100%",height:"auto"}:{width:i*n,maxWidth:"none",height:"auto"};return c?f("div",{className:"orb-omph-pv-note",role:"alert",children:o?`${r.imageFailed} \xB7 ${o}`:r.imageFailed}):g("div",{className:"orb-omph-img",children:[f("div",{className:"orb-omph-img-stage",children:f("img",{src:t,alt:o??"",draggable:false,style:p,onLoad:v=>s(v.currentTarget.naturalWidth),onError:()=>u(true)})}),g("div",{className:"orb-omph-img-zoom",role:"group","aria-label":r.zoomFit,children:[f("button",{type:"button","aria-label":r.zoomOut,disabled:!h,onClick:()=>f$1(-1),children:"\u2212"}),f("button",{type:"button","aria-label":r.zoomFit,"data-active":n==="fit"||void 0,onClick:()=>a("fit"),children:n==="fit"?r.zoomFit:`${Math.round(n*bx)}%`}),f("button",{type:"button","aria-label":r.zoomIn,disabled:!m,onClick:()=>f$1(1),children:"+"})]})]})},wx=t=>{let o=t+1,r="";for(;o>0;){let n=(o-1)%26;r=String.fromCharCode(65+n)+r,o=Math.floor((o-1)/26);}return r},sg=({body:t,labels:o})=>{let[r,n]=useState({status:"parsing"}),[a,i]=useState(0),[s,c]=useState(false);useEffect(()=>{let h=false,f=new AbortController;return n({status:"parsing"}),(async()=>{if(t.bytes)return t.bytes;if(!t.url)throw new Error("Sheet body has neither bytes nor url");let v=await fetch(t.url,{signal:f.signal});if(!v.ok)throw new Error(`HTTP ${v.status}`);return v.arrayBuffer()})().then(v=>Jm(v)).then(v=>{h||(i(0),n({status:"ready",sheets:v}));}).catch(v=>{h||v instanceof DOMException&&v.name==="AbortError"||n({status:"error",message:v instanceof Error?v.message:String(v)});}),()=>{h=true,f.abort();}},[t]),useEffect(()=>{if(!s)return;let h=window.setTimeout(()=>c(false),xx);return ()=>window.clearTimeout(h)},[s]);let u=r.status==="ready"?r.sheets[Math.min(a,r.sheets.length-1)]:null,d=useMemo(()=>{if(!u)return null;let h=Math.min(u.rows.reduce((p,v)=>Math.max(p,v.length),0),yx),f=u.rows.slice(0,vx);return {columnCount:h,shownRows:f}},[u]);if(r.status==="parsing")return f("div",{className:"orb-omph-pv-skel",role:"status","aria-label":o.previewLoading,children:Array.from({length:Cx},(h,f$1)=>f("span",{},f$1))});if(r.status==="error")return g("div",{className:"orb-omph-pv-note",role:"alert",children:[o.previewFailed," \xB7 ",r.message]});if(!u||!d)return null;let m=u.truncated||u.rows.length>d.shownRows.length;return g("div",{className:"orb-omph-sheet",children:[g("div",{className:"orb-omph-sheet-bar",children:[f("div",{className:"orb-omph-sheet-tabs",role:"tablist",children:r.sheets.map((h,f$1)=>f("button",{type:"button",role:"tab","aria-selected":f$1===a,"data-active":f$1===a||void 0,className:"orb-omph-sheet-tab",onClick:()=>i(f$1),children:h.name},h.name))}),f("button",{type:"button",className:"orb-omph-icon-button","aria-label":s?o.copied:o.previewCopyContent,title:s?o.copied:o.previewCopyContent,onClick:()=>{navigator.clipboard.writeText(eg(u.rows)).then(()=>c(true));},children:s?f(po,{size:tg}):f(Lo,{size:tg})})]}),g("div",{className:"orb-omph-sheet-scroll",children:[g("table",{className:"orb-omph-sheet-grid",children:[f("thead",{children:g("tr",{children:[f("th",{className:"orb-omph-sheet-corner","aria-label":u.name}),Array.from({length:d.columnCount},(h,f$1)=>f("th",{scope:"col",children:wx(f$1)},f$1))]})}),f("tbody",{children:d.shownRows.map((h,f$1)=>g("tr",{children:[f("th",{scope:"row",children:f$1+1}),Array.from({length:d.columnCount},(p,v)=>f("td",{children:h[v]??""},v))]},f$1))})]}),u.rows.length===0&&f("div",{className:"orb-omph-pv-note",children:o.previewUnsupported}),m&&f("div",{className:"orb-omph-pv-note",children:o.previewSheetTruncated(d.shownRows.length,u.rows.length)})]})]})};var Sx=/^[a-z][a-z0-9+.-]*:/i,kx=/^L(\d+)(?:-L?(\d+))?$/i;var lg=["B","KB","MB","GB"];var Px=t=>{try{return decodeURIComponent(t)}catch{return t}},ac=t=>{let o=t.trim();if(!o||o.startsWith("#")||o.startsWith("//")||Sx.test(o))return null;let r=o.indexOf("#"),n=r>=0?o.slice(0,r):o,a=r>=0?o.slice(r+1):"",i=n.indexOf("?"),s=Px(i>=0?n.slice(0,i):n);if(!s||s.endsWith("/"))return null;let c=kx.exec(a);if(!c)return {path:s};let u=Number(c[1]);if(u<1)return {path:s};let d=c[2]?Number(c[2]):u;return {path:s,startLine:u,endLine:Math.max(u,d)}},As=t=>t.split("/").filter(Boolean).pop()??t,dg=t=>{let o=t.split("/");return o.pop(),o.join("/")},Es=t=>{let o=As(t),r=o.lastIndexOf(".");return r>0?o.slice(r+1).toLowerCase():""},pg={prism:"text",label:"Text"},cg={ts:{prism:"typescript",label:"TypeScript"},tsx:{prism:"tsx",label:"TSX"},js:{prism:"javascript",label:"JavaScript"},mjs:{prism:"javascript",label:"JavaScript"},cjs:{prism:"javascript",label:"JavaScript"},jsx:{prism:"jsx",label:"JSX"},json:{prism:"json",label:"JSON"},py:{prism:"python",label:"Python"},java:{prism:"java",label:"Java"},go:{prism:"go",label:"Go"},rs:{prism:"rust",label:"Rust"},c:{prism:"c",label:"C"},h:{prism:"c",label:"C"},cpp:{prism:"cpp",label:"C++"},cs:{prism:"csharp",label:"C#"},sql:{prism:"sql",label:"SQL"},sh:{prism:"bash",label:"Shell"},bash:{prism:"bash",label:"Shell"},yml:{prism:"yaml",label:"YAML"},yaml:{prism:"yaml",label:"YAML"},xml:{prism:"markup",label:"XML"},html:{prism:"markup",label:"HTML"},css:{prism:"css",label:"CSS"},scss:{prism:"scss",label:"SCSS"},abap:{prism:"abap",label:"ABAP"},toml:{prism:"toml",label:"TOML"},ini:{prism:"ini",label:"INI"},md:{prism:"markdown",label:"Markdown"},csv:{prism:"text",label:"CSV"},log:{prism:"text",label:"Log"},txt:pg},ic=(t,o)=>o?Object.values(cg).find(n=>n.prism===o)??{prism:o,label:o}:cg[Es(t)]??pg,ug=t=>{let o=t,r=0;for(;o>=1024&&r<lg.length-1;)o/=1024,r+=1;return `${r>0&&o<10?o.toFixed(1):Math.round(o).toString()} ${lg[r]}`};var Tx=1e3,Mx=9,Xo=16,Ix={markdown:"text/markdown;charset=utf-8",code:"text/plain;charset=utf-8"},Rx="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",Ls=(t,o)=>{let r=URL.createObjectURL(t),n=document.createElement("a");n.href=r,n.download=o,n.click(),window.setTimeout(()=>URL.revokeObjectURL(r),1e3);},sc=({tone:t,icon:o,title:r,text:n,action:a})=>g("div",{className:"orb-omph-pv-notice","data-tone":t,role:t==="error"?"alert":void 0,children:[f("span",{className:"orb-omph-pv-notice-icon","aria-hidden":"true",children:o}),f("div",{className:"orb-omph-pv-notice-title",children:r}),n&&f("p",{className:"orb-omph-pv-notice-text",children:n}),a]}),hg=({state:t,placement:o,expanded:r,canExpand:n,labels:a,gripProps:i,paneRef:s,onClose:c,onRetry:u,onToggleExpand:d,onOpenExternally:m})=>{let[h,f$1]=useState(true),[p,v]=useState(false),{open:C,ref:g$1,phase:x,data:y}=t,b=y?.body;useEffect(()=>{if(!p)return;let O=window.setTimeout(()=>v(false),Tx);return ()=>window.clearTimeout(O)},[p]),useEffect(()=>{C&&s.current?.focus({preventScroll:true});},[C,s,g$1?.path]);let k=y?.absolutePath??g$1?.path??"",w=b&&(b.kind==="markdown"||b.kind==="code")?b.text:k,T=w===k?a.previewCopyPath:a.previewCopyContent,I=b?.kind==="code"&&g$1?ic(g$1.path,b.language):null,S=!!(b&&(b.kind==="markdown"||b.kind==="code")&&b.previewOnly),D=!!(g$1&&b&&!S&&(b.kind==="markdown"||b.kind==="code"||b.kind==="image"||b.kind==="embed"||b.kind==="sheet")),R=()=>{if(!b||!g$1)return;let O=As(k);if(b.kind==="markdown"&&!/\.(md|markdown|txt)$/i.test(O)&&(O=`${O}.md`),b.kind==="markdown"||b.kind==="code"){Ls(new Blob([b.text],{type:Ix[b.kind]}),O);return}if(b.kind==="sheet"){if(b.fileName&&(O=b.fileName),/\.(xlsx|xlsm|xls|csv)$/i.test(O)||(O=`${O}.xlsx`),b.bytes){let _=b.bytes instanceof Uint8Array?b.bytes.slice().buffer:b.bytes;Ls(new Blob([_],{type:Rx}),O);return}b.url&&fetch(b.url).then(_=>{if(!_.ok)throw new Error(`HTTP ${_.status}`);return _.blob()}).then(_=>Ls(_,O)).catch(()=>window.open(b.url,"_blank","noopener"));return}(b.kind==="image"||b.kind==="embed")&&fetch(b.url).then(_=>{if(!_.ok)throw new Error(`HTTP ${_.status}`);return _.blob()}).then(_=>Ls(_,O)).catch(()=>window.open(b.url,"_blank","noopener"));},M=[];I&&M.push(I.label),b?.kind==="markdown"&&M.push("Markdown"),b?.kind==="image"&&g$1&&M.push(Es(g$1.path).toUpperCase()),b?.kind==="sheet"&&g$1&&M.push(Es(g$1.path).toUpperCase()||"XLSX"),y?.size!==void 0&&M.push(ug(y.size)),b?.kind==="code"&&g$1?.startLine!==void 0&&M.push(a.previewLines(g$1.startLine,g$1.endLine??g$1.startLine));let P=O=>{O.key==="Escape"&&(O.stopPropagation(),c(true));},A=f("button",{type:"button",className:"orb-omph-pv-action",onClick:u,children:a.previewRetry}),L=()=>{if(!g$1)return null;if(x==="loading")return f("div",{className:"orb-omph-pv-skel",role:"status","aria-label":a.previewLoading,children:Array.from({length:Mx},(O,_)=>f("span",{},_))});if(x==="error"||!b)return f(sc,{tone:"error",icon:f(Aa,{size:Xo}),title:a.previewFailed,text:k,action:A});switch(b.kind){case "missing":return f(sc,{tone:"neutral",icon:f(Fa,{size:Xo}),title:a.previewMissing,text:b.message??k});case "unsupported":return f(sc,{tone:"neutral",icon:f(Fa,{size:Xo}),title:a.previewUnsupported,text:b.message??k,action:m&&f("button",{type:"button",className:"orb-omph-pv-action",onClick:()=>m(g$1),children:a.previewOpenExternal})});case "markdown":return f(ag,{text:b.text},g$1.path);case "code":return f(ng,{text:b.text,language:ic(g$1.path,b.language).prism,startLine:g$1.startLine,endLine:g$1.endLine,wrap:h,labels:a},g$1.path);case "image":return f(ig,{url:b.url,alt:b.alt,labels:a},b.url);case "sheet":return f(sg,{body:b,labels:a},g$1.path);case "embed":return f("iframe",{src:b.url,title:b.caption??a.previewTitle,className:"orb-omph-pv-embed"},b.url);default:return null}},W=o==="overlay",j=b?.kind==="image"?_c:Fa;return g("aside",{ref:s,className:"orb-omph-preview","data-open":C||void 0,"data-placement":o,role:W?"dialog":"complementary","aria-label":a.previewTitle,"aria-hidden":!C||void 0,tabIndex:-1,onKeyDown:P,children:[!W&&C&&f("div",{className:"orb-omph-pv-grip","aria-label":a.previewResize,...i}),g("div",{className:"orb-omph-pv",children:[g("header",{className:"orb-omph-pv-head",children:[W&&f("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewBack,onClick:()=>c(true),children:f(La,{size:Xo})}),f("span",{className:"orb-omph-pv-glyph","aria-hidden":"true",children:f(j,{size:Xo})}),g("div",{className:"orb-omph-pv-titles",children:[f("div",{className:"orb-omph-pv-name",title:k,children:g$1?As(k):""}),f("div",{className:"orb-omph-pv-path",title:k,children:f("bdi",{children:dg(k)})})]}),g("div",{className:"orb-omph-pv-actions",children:[b?.kind==="code"&&f("button",{type:"button",className:"orb-omph-text-button","aria-pressed":h,onClick:()=>f$1(O=>!O),children:a.previewWrap}),D&&f("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewDownload,title:a.previewDownload,onClick:R,children:f(Hn,{size:Xo})}),S&&g$1&&m&&f("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewOpenExternal,title:a.previewOpenExternal,onClick:()=>m(g$1),children:f(Hn,{size:Xo})}),g$1&&f("button",{type:"button",className:"orb-omph-icon-button","aria-label":p?a.copied:T,title:p?a.copied:T,onClick:()=>{navigator.clipboard.writeText(w).then(()=>v(true));},children:p?f(po,{size:Xo}):f(Lo,{size:Xo})}),n&&f("button",{type:"button",className:"orb-omph-icon-button","aria-pressed":r,"aria-label":r?a.previewCollapse:a.previewExpand,title:r?a.previewCollapse:a.previewExpand,onClick:d,children:f(zc,{size:Xo})}),!W&&f("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewClose,onClick:()=>c(true),children:f(Kt,{size:Xo})})]})]}),f("div",{className:"orb-omph-pv-meta",children:M.join(" \xB7 ")}),f("div",{className:"orb-omph-pv-body","data-kind":x==="ready"?b?.kind:void 0,children:L()})]})]})};var Dx=1e3,fg=50,Ax=1e3,Ex=t=>t==="tool"?en:t==="command"?Wn:Zc,vg=t=>!!t.streaming||t.status==="running"||t.status==="pending",Lx=(t,o)=>o==="expanded"?true:vg(t),Ox=t=>t!==void 0&&(t.inputTokens!==void 0||t.outputTokens!==void 0||t.durationMs!==void 0),Fx=(t,o)=>`${Math.max(1,Math.round(t/Ax))}${o.secondUnit}`,Bx=({content:t})=>{let o=useRef(null),[r,n]=useState(false);return useEffect(()=>{let a=o.current;if(!a)return;let i=()=>n(a.scrollHeight>a.clientHeight+1);i();let s=new ResizeObserver(i);return s.observe(a),()=>s.disconnect()},[t]),f("div",{ref:o,className:"orb-omph-process-body","data-overflow":r||void 0,children:t})},Hx=({turn:t,labels:o})=>{let[r,n]=useState(false),[a,i]=useState(false),s=t.assistant?.content??"",c=t.usage;return useEffect(()=>{if(!r)return;let u=window.setTimeout(()=>n(false),Dx);return ()=>window.clearTimeout(u)},[r]),g("div",{className:"orb-omph-turn-actions",role:"group","aria-label":o.turnActions,children:[f("span",{className:"orb-omph-actions-time",children:t.assistant?.timestamp.toLocaleTimeString()}),Ox(c)&&g(e,{children:[f("span",{className:"orb-omph-actions-divider","aria-hidden":"true"}),f("button",{type:"button",className:"orb-omph-text-button","aria-expanded":a,onClick:()=>i(u=>!u),children:o.usage})]}),f("button",{type:"button",className:"orb-omph-icon-button orb-omph-actions-end","aria-label":r?o.copied:o.copy,onClick:()=>{navigator.clipboard.writeText(s).then(()=>n(true));},children:r?f(po,{size:14}):f(Lo,{size:14})}),a&&c&&g("div",{className:"orb-omph-usage",children:[c.inputTokens!==void 0&&g("span",{children:[o.inputTokens," ",c.inputTokens.toLocaleString()]}),c.outputTokens!==void 0&&g("span",{children:[o.outputTokens," ",c.outputTokens.toLocaleString()]}),c.durationMs!==void 0&&g("span",{children:[o.duration," ",Fx(c.durationMs,o)]})]})]})},zx=({item:t,display:o,open:r,onToggle:n})=>{let a=Ex(t.kind),i=vg(t),s=o!=="compact"&&!!t.summary,c=r&&!!t.content;return g("div",{className:"orb-omph-process","data-status":t.status,"data-open":r||void 0,children:[g("button",{type:"button",className:"orb-omph-process-toggle","aria-expanded":r,onClick:n,children:[f(Po,{size:12,className:"orb-omph-process-chevron"}),f(a,{size:14}),f("span",{className:i?"orb-omph-shimmer":void 0,children:t.title}),s&&f("span",{className:"orb-omph-process-summary",children:t.summary})]}),c&&t.content&&f(Bx,{content:t.content}),r&&t.streaming&&f("span",{className:"orb-omph-caret","aria-hidden":"true"})]})},lc=t=>{let o=t.user?.content||t.assistant?.content||t.id,r=o.split(`
21
+ `).find(n=>n.trim())??o;return r.length>fg?`${r.slice(0,fg)}\u2026`:r},Vx=0,yg=({turns:t,labels:o,processDisplay:r,cardHooks:n,resolveFileLink:a,onOpenFile:i})=>{let[s,c]=useState({}),u=d=>{if(!i||d.defaultPrevented||d.button!==Vx||d.metaKey||d.ctrlKey||d.shiftKey||d.altKey)return;let m=d.target.closest("a[href]");if(!m)return;let h=a(m.getAttribute("href")??"");h&&(d.preventDefault(),i(h,m));};return f(e,{children:t.map((d,m)=>{let h=!!(d.assistant&&!d.assistant.streaming),p=m===t.length-1&&h?"always":"hover";return g("article",{className:"orb-omph-turn","data-omph-turn":d.id,"data-actions-reveal":p,children:[d.user&&g("div",{className:"orb-omph-user",children:[f("div",{className:"orb-omph-user-bubble","data-queued":d.user.queued||void 0,children:d.user.content}),g("div",{className:"orb-omph-user-meta",children:[d.user.queued&&f("span",{className:"orb-omph-user-queued",children:o.supplementQueued}),f("span",{className:"orb-omph-clock",children:d.user.timestamp.toLocaleTimeString()})]})]}),d.process&&d.process.length>0&&f("div",{className:"orb-omph-process-list",children:d.process.map(v=>{let C=v.id in s?s[v.id]:Lx(v,r);return f(zx,{item:v,display:r,open:C,onToggle:()=>c(g=>({...g,[v.id]:!C}))},v.id)})}),d.assistant&&g("div",{className:"orb-omph-assistant","data-file-links":i?"true":void 0,onClick:u,children:[f(Ps,{content:d.assistant.content,messageId:d.assistant.id,cardHooks:n}),d.assistant.streaming&&f("span",{className:"orb-omph-caret","aria-hidden":"true"})]}),d.failure&&f("div",{className:"orb-omph-failure","data-severity":d.failure.severity,children:d.failure.content}),h&&f(Hx,{turn:d,labels:o})]},d.id)})})};var ka=t=>({idle:t("omph.status.idle"),pending:t("omph.status.pending"),running:t("omph.status.running"),success:t("omph.status.success"),error:t("omph.status.error"),working:t("omph.working"),workingFor:o=>t("omph.workingFor",{duration:o}),loadOlder:t("omph.loadOlder"),loadingOlder:t("omph.loadingOlder"),toBottom:t("omph.toBottom"),copy:t("omph.copy"),copied:t("omph.copied"),turnActions:t("omph.turnActions"),usage:t("omph.usage"),inputTokens:t("omph.inputTokens"),outputTokens:t("omph.outputTokens"),duration:t("omph.duration"),send:t("omph.send"),stop:t("omph.stop"),supplementQueued:t("omph.supplement.queued"),turnRail:t("omph.turnRail"),secondUnit:t("omph.secondUnit"),minuteUnit:t("omph.minuteUnit"),previewTitle:t("omph.preview.title"),previewClose:t("omph.preview.close"),previewBack:t("omph.preview.back"),previewExpand:t("omph.preview.expand"),previewCollapse:t("omph.preview.collapse"),previewCopyContent:t("omph.preview.copyContent"),previewCopyPath:t("omph.preview.copyPath"),previewDownload:t("omph.preview.download"),previewOpenExternal:t("omph.preview.openExternal"),previewWrap:t("omph.preview.wrap"),previewLoading:t("omph.preview.loading"),previewMissing:t("omph.preview.missing"),previewFailed:t("omph.preview.failed"),previewUnsupported:t("omph.preview.unsupported"),previewRetry:t("omph.preview.retry"),previewResize:t("omph.preview.resize"),previewLines:(o,r)=>t(o===r?"omph.preview.line":"omph.preview.lines",{start:o,end:r}),previewTruncated:(o,r)=>t("omph.preview.truncated",{shown:o,total:r}),previewSheetTruncated:(o,r)=>t("omph.preview.sheetTruncated",{shown:o,total:r}),imageFailed:t("omph.preview.imageFailed"),zoomIn:t("omph.preview.zoomIn"),zoomOut:t("omph.preview.zoomOut"),zoomFit:t("omph.preview.zoomFit"),newConversation:t("omph.newConversation"),conversationList:t("omph.conversationList"),conversations:t("omph.conversations"),noConversations:t("omph.noConversations")}),cc=t=>({waiting:t("omph.approval.waiting"),choose:t("omph.approval.choose"),details:t("omph.approval.details"),choices:t("omph.approval.choices"),reject:t("omph.approval.reject"),allowOnce:t("omph.approval.allowOnce"),confirm:t("omph.approval.confirm"),other:t("omph.approval.other"),otherPlaceholder:t("omph.approval.otherPlaceholder"),recommended:t("omph.approval.recommended"),allowOnceException:t("omph.approval.allowOnceException"),allowSession:t("omph.approval.allowSession"),abandon:t("omph.approval.abandon"),escalation:o=>t("omph.approval.escalation",{toolName:o})});var Wx=1e3,Cg=60,$x=1e3,xg=(t,o)=>{let r=Math.max(1,Math.round(Math.max(t,$x)/Wx)),n=Math.floor(r/Cg),a=r%Cg;return n<=0?`${r}${o.secondUnit}`:`${n}${o.minuteUnit} ${a}${o.secondUnit}`};var Ux={open:false,ref:null,phase:"loading",data:null},wg=t=>{let[o,r]=useState(Ux),n=useRef(o);n.current=o;let a=useRef(t);a.current=t;let i=useRef(null),s=useRef(0),c=useRef(null),u=useCallback(f=>{let p=a.current;if(!p)return;i.current?.abort();let v=new AbortController;i.current=v,s.current+=1;let C=s.current;r({open:true,ref:f,phase:"loading",data:null}),p(f,v.signal).then(g=>{C===s.current&&r(x=>({...x,phase:"ready",data:g}));},()=>{C!==s.current||v.signal.aborted||r(g=>({...g,phase:"error",data:null}));});},[]),d=useCallback((f,p)=>{c.current=p??null;let v=n.current;if(v.ref?.path===f.path&&v.phase==="ready"){r({...v,open:true,ref:f});return}u(f);},[u]),m=useCallback((f=false)=>{s.current+=1,i.current?.abort(),r(v=>({...v,open:false}));let p=c.current;f&&p?.isConnected&&p.focus({preventScroll:true});},[]),h=useCallback(()=>{let{ref:f}=n.current;f&&u(f);},[u]);return useEffect(()=>()=>{i.current?.abort();},[]),{state:o,open:d,close:m,reload:h}};var pc="--orb-omph-pv-w",uc="--orb-omph-pv-pref",Xx=880,Zx=560,kg=400,_r=320,Yx=.45,Qx=.7,Pg=24,dc=(t,o,r)=>Math.min(Math.max(t,o),Math.max(o,r)),Tg=({open:t,layout:o})=>{let r=useRef(null),n=useRef(null),[a,i]=useState(0),[s,c]=useState(null),[u,d]=useState(false),[m,h]=useState(false);useLayoutEffect(()=>{let T=r.current;if(!T)return;let I=()=>i(T.getBoundingClientRect().width);I();let S=new ResizeObserver(I);return S.observe(T),()=>S.disconnect()},[]),useEffect(()=>{t||d(false);},[t]);let f=o==="overlay"?false:o==="split"?a>=kg+_r:a>=Xx,p=f&&!u?"split":"overlay",v=Math.max(_r,Math.min(a*Qx,a-kg)),C=dc(s??a*Yx,_r,v),g=a>0&&a<Zx,x=useCallback(T=>{let I=r.current;I&&(I.style.setProperty(uc,`${T}px`),I.dataset.placement==="split"&&I.dataset.open==="true"&&I.style.setProperty(pc,`${T}px`));},[]),y=useCallback(T=>{T.button===0&&(T.preventDefault(),T.currentTarget.setPointerCapture(T.pointerId),n.current={pointerId:T.pointerId,startX:T.clientX,startWidth:C,latest:C},h(true));},[C]),b=useCallback(T=>{let I=n.current;!I||I.pointerId!==T.pointerId||(I.latest=dc(I.startWidth+(I.startX-T.clientX),_r,v),x(I.latest));},[v,x]),k=useCallback(T=>{let I=n.current;!I||I.pointerId!==T.pointerId||(n.current=null,T.currentTarget.hasPointerCapture(T.pointerId)&&T.currentTarget.releasePointerCapture(T.pointerId),c(I.latest),h(false));},[]),w=useCallback(T=>{let I={ArrowLeft:C+Pg,ArrowRight:C-Pg,Home:_r,End:v};T.key in I&&(T.preventDefault(),c(dc(I[T.key],_r,v)));},[v,C]);return {mainRef:r,placement:p,width:C,compact:g,dragging:m,expanded:u,canExpand:f,toggleExpanded:()=>d(T=>!T),gripProps:{role:"separator","aria-orientation":"vertical","aria-valuemin":_r,"aria-valuemax":Math.round(v),"aria-valuenow":Math.round(C),tabIndex:0,onPointerDown:y,onPointerMove:b,onPointerUp:k,onPointerCancel:k,onKeyDown:w}}};var Hs=48,Jx=900,Ig=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,Rg=({turns:t,contentVersion:o,hasOlder:r=false,loadingOlder:n=false,onLoadOlder:a})=>{let i=useRef(null),s=useRef(null),c=useRef(true),u=useRef({height:0,top:0}),d=useRef(void 0),m=useRef(false),[h,f]=useState(true),[p,v]=useState(false),[C,g]=useState(t[0]?.id),x=useCallback(()=>{let T=i.current;T&&(u.current={height:T.scrollHeight,top:T.scrollTop});},[]),y=useCallback(()=>{let T=i.current;if(!T)return;let I=T.getBoundingClientRect().top,S=T.querySelector("[data-omph-turn]")?.dataset.omphTurn;T.querySelectorAll("[data-omph-turn]").forEach(D=>{D.getBoundingClientRect().top-I<=Hs&&(S=D.dataset.omphTurn);}),g(S);},[]);useEffect(()=>{let T=i.current,I=s.current;if(!T||!I)return;let S=()=>{v(T.clientWidth>Jx),c.current&&(T.scrollTop=T.scrollHeight),x();};S();let D=new ResizeObserver(S);return D.observe(T),D.observe(I),()=>D.disconnect()},[x]),useLayoutEffect(()=>{let T=i.current;if(!T)return;let I=t[0]?.id,S=d.current,D=S!==void 0&&t.some(P=>P.id===S),R=D&&I!==void 0&&I!==S,M=S!==void 0&&!D;if(d.current=I,M){c.current=true,f(true),T.scrollTop=T.scrollHeight,x(),y();return}if(R){c.current=false,f(false);let P=T.scrollHeight-u.current.height;T.scrollTop=u.current.top+Math.max(0,P),x(),y();return}c.current&&(T.scrollTop=T.scrollHeight),x(),y();},[o,x,t,y]),useEffect(()=>{n||(m.current=false);},[n]);let b=useCallback(()=>{let T=i.current;if(!T)return;let S=T.scrollHeight-T.scrollTop-T.clientHeight<=Hs;S!==c.current&&(c.current=S,f(S)),x(),y();let D=T.scrollHeight-T.clientHeight>Hs,R=T.scrollTop<=Hs;!D||!R||S||!r||n||!a||m.current||(m.current=true,a());},[r,n,a,x,y]),k=useCallback(()=>{let T=i.current;T&&(c.current=true,f(true),T.scrollTo({top:T.scrollHeight,behavior:Ig()?"auto":"smooth"}));},[]),w=useCallback(T=>{let S=i.current?.querySelector(`[data-omph-turn="${CSS.escape(T)}"]`);S&&(c.current=false,f(false),S.scrollIntoView({block:"start",behavior:Ig()?"auto":"smooth"}));},[]);return {scrollerRef:i,contentRef:s,following:h,railVisible:p,activeTurnId:C,onScroll:b,returnToBottom:k,scrollToTurn:w}};var tw=1e3,ow=(t,o)=>o[t],rw=t=>t.map(o=>[o.id,o.user?.content.length??0,o.assistant?.content.length??0,o.assistant?.streaming?"1":"0",o.failure?.id??"",(o.process??[]).map(r=>`${r.id}:${r.status}:${r.content?.length??0}`).join(",")].join(":")).join("|"),nw=({startedAt:t,labels:o})=>{let[r,n]=useState(()=>Date.now());useEffect(()=>{n(Date.now());let i=window.setInterval(()=>n(Date.now()),tw);return ()=>window.clearInterval(i)},[t]);let a=t===void 0?o.working:o.workingFor(xg(Math.max(0,r-t),o));return g("div",{className:"orb-omph-running","data-omph-running":"true",children:[f("span",{className:"orb-visually-hidden",role:"status","aria-live":"polite",children:o.working}),f("span",{className:"orb-omph-running-rule","aria-hidden":"true"}),g("span",{className:"orb-omph-running-body",children:[f("span",{className:"orb-omph-spinner","aria-hidden":"true"}),f("span",{className:"orb-omph-shimmer",children:a})]})]})},e5=({turns:t,title:o,avatar:r,description:n,headerActions:a,agentStatus:i,isResponding:s=false,labels:c,processDisplay:u="standard",showInput:d=false,placeholder:m,className:h,cardHooks:f$1,hasOlder:p=false,loadingOlder:v=false,onLoadOlder:C,onSend:g$1,onStop:x,onHeaderPointerDown:y,conversations:b=[],activeConversationId:k,onNewConversation:w,onSelectConversation:T,loadFilePreview:I,resolveFileLink:S=ac,filePreviewLayout:D="auto",onOpenFileExternally:R})=>{let{t:M}=de(),P={...ka(M),...c},A=i??(s?"running":"idle"),L=A==="running"||A==="pending",W=[ow(A,P),n].filter(Boolean).join(" \xB7 "),j=useMemo(()=>rw(t),[t]),O=Rg({turns:t,contentVersion:j,hasOlder:p,loadingOlder:v,onLoadOlder:C}),[_,z]=useState(""),Y=_.trim(),H=s&&Y.length===0,B=[...t].reverse().find(pe=>!!pe.assistant?.streaming||pe.process?.some(me=>me.streaming||me.status==="running"||me.status==="pending")),q=L?B?.startedAt:void 0,Z=!!I,ue=wg(I),ne=Tg({open:ue.state.open,layout:D}),fe=useRef(null),Ce=useRef(null),$=Z&&ue.state.open&&ne.placement==="overlay",J=ne.placement==="split"&&ue.state.open,ae={[uc]:`${ne.width}px`,[pc]:J?`${ne.width}px`:"0px"};useEffect(()=>{Ce.current?.toggleAttribute("inert",$);},[$]);let xe=async()=>{if(!Y||!g$1)return;let pe=Y;z("");try{await g$1(pe);}catch{z(me=>me.trim().length===0?pe:me);}};return g("div",{className:ot("orb-omph-panel",h),"data-omph-panel":"","data-status":A,"data-compact":ne.compact||void 0,children:[g("div",{className:ot("orb-omph-header",y&&"cursor-grab active:cursor-grabbing"),onPointerDown:y,children:[f("span",{className:"orb-omph-avatar","aria-hidden":"true",children:r??"AI"}),g("div",{className:"min-w-0 flex-1",children:[o&&f("div",{className:"orb-omph-title",children:o}),g("div",{className:"orb-omph-subtitle",children:[f("span",{className:"orb-omph-dot","data-active":L||void 0}),f("span",{className:"truncate",children:W||P.idle})]})]}),(w||T||a)&&g("div",{className:"orb-omph-header-actions",onPointerDown:pe=>pe.stopPropagation(),children:[f(Rs,{conversations:b,activeConversationId:k,labels:P,onNewConversation:w,onSelectConversation:T}),a]})]}),g("div",{ref:ne.mainRef,className:"orb-omph-main","data-placement":ne.placement,"data-open":String(ue.state.open),"data-dragging":ne.dragging||void 0,style:ae,children:[g("div",{ref:Ce,className:"orb-omph-center",children:[g("div",{className:"orb-omph-stage","data-rail":O.railVisible||void 0,children:[f("div",{ref:O.scrollerRef,className:"orb-omph-scroll",onScroll:O.onScroll,children:g("div",{ref:O.contentRef,className:"orb-omph-column",children:[p&&C&&f("button",{type:"button",className:"orb-omph-older",disabled:v,onClick:C,children:v?P.loadingOlder:P.loadOlder}),f(yg,{turns:t,labels:P,processDisplay:u,cardHooks:f$1,resolveFileLink:S,onOpenFile:Z?ue.open:void 0}),L&&f(nw,{startedAt:q,labels:P})]})}),O.railVisible&&t.length>0&&f("nav",{className:"orb-omph-rail","aria-label":P.turnRail,children:t.map(pe=>f("button",{type:"button",className:"orb-omph-rail-mark","data-active":O.activeTurnId===pe.id||void 0,"aria-label":lc(pe),title:lc(pe),onClick:()=>O.scrollToTurn(pe.id)},pe.id))}),!O.following&&f("button",{type:"button",className:"orb-omph-to-bottom","aria-label":P.toBottom,onClick:O.returnToBottom,children:f(Po,{size:16})})]}),d&&g("form",{className:"orb-omph-composer",onSubmit:pe=>{pe.preventDefault(),H?x?.():xe();},children:[f("textarea",{className:"orb-omph-input",value:_,placeholder:m,rows:1,onChange:pe=>z(pe.target.value),onKeyDown:pe=>{pe.key!=="Enter"||pe.shiftKey||pe.nativeEvent.isComposing||(pe.preventDefault(),H?x?.():xe());}}),!H&&s&&x&&f("button",{type:"button",className:"orb-omph-stop-secondary","aria-label":P.stop,title:P.stop,onClick:x,children:f(Zs,{size:14})}),f("button",{type:"submit",className:H?"orb-omph-stop":"orb-omph-send","aria-label":H?P.stop:P.send,disabled:!H&&Y.length===0,children:H?f(Zs,{size:16}):f(Oc,{size:16})})]})]}),Z&&f(hg,{state:ue.state,placement:ne.placement,expanded:ne.expanded,canExpand:ne.canExpand,labels:P,gripProps:ne.gripProps,paneRef:fe,onClose:ue.close,onRetry:ue.reload,onToggleExpand:ne.toggleExpanded,onOpenExternally:R})]})]})};var fr="other",Lg="allow-once",Og="allow-session",Fg="abandon",aw=t=>t instanceof HTMLElement&&t.closest('input, textarea, select, [contenteditable="true"], [contenteditable=""]')!==null,iw=({request:t,onDecide:o,labels:r})=>{let{t:n}=de(),a={...cc(n),...r},i=useRef(null),s=useRef(null),c=useRef(false),u=useRef(false),[d,m]=useState(false),[h,f$1]=useState(null),[p,v]=useState(""),C=t.kind,g$1=C==="authorize"?[{id:Lg,label:a.allowOnceException,recommended:true},{id:Og,label:a.allowSession},{id:Fg,label:a.abandon}]:[],x=C==="authorize"?g$1:t.choices??[],y=C==="authorize"?false:t.allowOther??x.length>0,b=x.length>0||y,k=P=>(C==="tradeoff"||C==="authorize")&&P===true,w=t.reason?.trim()||a.escalation(t.toolName),T=t.detail?.trim(),I=h===fr&&p.trim().length>0,S=!b||h!==null&&h!==fr||I;useEffect(()=>{m(false),f$1(null),v(""),i.current?.focus();},[t.id]),useEffect(()=>{h===fr&&s.current?.focus();},[h]);let D=P=>{d||(m(true),o(P,t));},R=()=>{if(S){if(!b){D({kind:"allowed-once"});return}if(h===fr){let P=p.trim();if(!P)return;D({kind:"other",text:P});return}if(C==="authorize"){h===Lg?D({kind:"allowed-once"}):h===Og?D({kind:"allowed-session"}):h===Fg&&D({kind:"rejected"});return}h&&D({kind:"choice",choiceId:h});}},M=P=>{if(!(d||aw(P.target))&&!(P.key!=="Enter"&&P.key!=="Escape")&&!(P.key==="Enter"&&P.target instanceof HTMLElement&&P.target.closest('button, a[href], [role="button"]'))&&!(P.ctrlKey||P.metaKey||P.altKey||P.shiftKey)&&(P.preventDefault(),P.stopPropagation(),!(P.repeat||c.current||u.current||P.nativeEvent.isComposing))){if(P.key==="Escape"){D({kind:"rejected"});return}R();}};return f("div",{className:"orb-omph-approval","data-omph-approval":t.id,"aria-busy":d,onKeyDown:M,onKeyUpCapture:()=>{u.current=false;},onCompositionStartCapture:()=>{c.current=true;},onCompositionEndCapture:()=>{c.current=false,u.current=true;},children:g("div",{className:"orb-omph-approval-card","data-kind":C,children:[g("div",{className:"orb-omph-approval-strip",children:[f("span",{className:"orb-omph-approval-dot","aria-hidden":"true"}),b?a.choose:a.waiting]}),g("div",{ref:i,className:"orb-omph-approval-body",tabIndex:0,role:"group","aria-label":a.details,children:[f("div",{className:"orb-omph-approval-headline",children:w}),T&&f("div",{className:"orb-omph-approval-detail",children:T}),b&&g("fieldset",{className:"orb-omph-approval-choices",disabled:d,children:[f("legend",{className:"orb-visually-hidden",children:a.choices}),x.map(P=>{let A=h===P.id;return g("label",{className:"orb-omph-approval-choice","data-selected":A,children:[f("input",{type:"radio",name:`omph-approval-${t.id}`,value:P.id,checked:A,onChange:()=>f$1(P.id)}),g("span",{className:"orb-omph-approval-choice-copy",children:[g("span",{children:[P.label,k(P.recommended)&&f("span",{className:"orb-omph-approval-recommended",children:a.recommended})]}),P.description&&f("span",{className:"orb-omph-approval-choice-description",children:P.description})]})]},P.id)}),y&&g("label",{className:"orb-omph-approval-choice","data-selected":h===fr,children:[f("input",{type:"radio",name:`omph-approval-${t.id}`,value:fr,checked:h===fr,onChange:()=>f$1(fr)}),f("span",{className:"orb-omph-approval-choice-copy",children:f("span",{children:a.other})})]}),y&&h===fr&&f("textarea",{ref:s,className:"orb-omph-approval-other",value:p,placeholder:a.otherPlaceholder,rows:3,"aria-label":a.other,onChange:P=>v(P.target.value)})]})]}),g("div",{className:"orb-omph-approval-actions",children:[f("button",{type:"button",className:"orb-btn orb-btn-neutral orb-omph-approval-reject",disabled:d,onClick:()=>D({kind:"rejected"}),children:a.reject}),f("button",{type:"button",className:"orb-btn orb-btn-primary",disabled:d||!S,onClick:R,children:b?a.confirm:a.allowOnce})]})]})})};var sw=({mark:t,hint:o,suggestions:r=[],placeholder:n,isResponding:a=false,labels:i,conversations:s=[],activeConversationId:c,onSelectConversation:u,onSend:d,onStop:m,className:h,modelGroups:f$1,modelSelection:p,onModelSelectionChange:v,modelSelectDisabled:C})=>{let{t:g$1}=de(),x={...ka(g$1),...i},y=o?.trim(),b=r.filter(k=>k.label.trim().length>0);return g("section",{className:["orb-omph-initial",h].filter(Boolean).join(" "),children:[g("div",{className:"orb-omph-initial-stage","aria-hidden":"true",children:[f("span",{className:"orb-omph-initial-bloom orb-omph-initial-bloom-petrol"}),f("span",{className:"orb-omph-initial-bloom orb-omph-initial-bloom-blue"}),f("span",{className:"orb-omph-initial-bloom orb-omph-initial-bloom-pink"}),g("svg",{className:"orb-omph-initial-arc",viewBox:"0 0 1440 900",preserveAspectRatio:"xMidYMid slice",children:[f("path",{d:"M-80 690C240 180 680 1040 1520 260"}),f("path",{d:"M-40 780C300 320 760 1120 1500 390"})]})]}),g("div",{className:"orb-omph-initial-center",children:[t&&f("div",{className:"orb-omph-initial-mark",children:t}),g("div",{className:"orb-omph-initial-composer",children:[f(Sa,{placeholder:n,isResponding:a,onSend:async(k,w)=>{await d(k,w);},onStop:()=>m?.(),modelGroups:f$1,modelSelection:p,onModelSelectionChange:v,modelSelectDisabled:C}),u&&f("div",{className:"orb-omph-initial-menu",children:f(Rs,{conversations:s,activeConversationId:c,labels:x,onSelectConversation:u})})]}),b.length>0?f("div",{className:"orb-omph-initial-suggestions",role:"group","aria-label":g$1("omph.initial.suggestions"),children:b.map(k=>f("button",{type:"button",className:"orb-omph-initial-suggestion",disabled:a,onClick:()=>{d(k.label.trim());},children:k.label.trim()},k.id))}):y&&f("p",{className:"orb-omph-initial-hint",children:y})]})]})};var zg=520,dw=88,pw=88,uw=24,Vs=640,Vg=(t,o,r)=>Math.min(Math.max(t,o),Math.max(o,r)),hc=t=>typeof t=="number"?`${t}px`:t,mw=t=>t instanceof HTMLElement?!!t.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,v5=({anchor:t,defaultAnchor:o="right",onAnchorChange:r,width:n=zg,top:a=dw,bottom:i=pw,inset:s=uw,zIndex:c=1300,shellClassName:u,shellStyle:d,className:m,onHeaderPointerDown:h,...f$1})=>{let p=useRef(null),v=useRef(null),[C,g]=useState(o),[x,y]=useState(0),[b,k]=useState(typeof n=="number"?n:zg),[w,T]=useState(0),[I,S]=useState(false),D=t??C;useEffect(()=>{let O=()=>y(window.innerWidth);return O(),window.addEventListener("resize",O),()=>window.removeEventListener("resize",O)},[]),useLayoutEffect(()=>{let O=()=>{let z=p.current?.getBoundingClientRect();z?.width?k(z.width):typeof n=="number"&&k(n);};if(O(),!p.current||typeof ResizeObserver>"u")return;let _=new ResizeObserver(O);return _.observe(p.current),()=>_.disconnect()},[n]);let R=useCallback(O=>{if(!x)return s;let _=x<Vs?12:s,z=Math.max(_,x-b-_);return x<Vs||O==="left"?_:O==="center"?Vg((x-b)/2,_,z):z},[s,b,x]),M=useCallback(O=>["left","center","right"].reduce((z,Y)=>{let H=Math.abs(O-R(z));return Math.abs(O-R(Y))<H?Y:z},"right"),[R]),P=useCallback(O=>{t===void 0&&g(O),r?.(O);},[t,r]);useEffect(()=>{I||T(R(D));},[R,I,D]);let A=useCallback(O=>{h?.(O),!(O.defaultPrevented||mw(O.target))&&(O.preventDefault(),O.currentTarget.setPointerCapture(O.pointerId),v.current={pointerId:O.pointerId,startClientX:O.clientX,startX:w,currentX:w,captureElement:O.currentTarget},S(true));},[h,w]),L=useCallback(O=>{let _=v.current;if(!_||_.pointerId!==O.pointerId)return;let z=x<Vs?12:s,Y=Math.max(z,x-b-z),H=Vg(_.startX+O.clientX-_.startClientX,z,Y);_.currentX=H,T(H);},[s,b,x]),W=useCallback(O=>{let _=v.current;if(!_||_.pointerId!==O.pointerId)return;try{_.captureElement.releasePointerCapture(O.pointerId);}catch{}let z=M(_.currentX);v.current=null,S(false),P(z),T(R(z));},[R,P,M]),j=useMemo(()=>({position:"fixed",top:hc(a),bottom:hc(i),left:w,width:hc(n),maxWidth:`calc(100vw - ${x<Vs?24:s*2}px)`,zIndex:c,pointerEvents:"auto",transition:I?"none":"left 180ms ease-out",touchAction:"none",...d}),[i,s,I,w,d,a,x,n,c]);return f("div",{ref:p,className:ot("orbcafe-floating-agent-panel min-w-0",u),"data-anchor":D,"data-dragging":I?"true":"false",style:j,onPointerMove:L,onPointerUp:W,onPointerCancel:W,children:f(Ym,{...f$1,className:m,onHeaderPointerDown:A})})};var fw={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},T5=({messages:t,onSend:o,onRegenerate:r,isResponding:n=false,className:a,placeholder:i,title:s="Copilot",corner:c="bottom-right",onCollapse:u,onHeaderPointerDown:d,onPlusClick:m,onMicClick:h,streamIntervalMs:f$1,streamChunkSize:p,onMessageStreamingComplete:v,cardHooks:C})=>{let[g$1,x]=useState(""),[y,b]=useState(false),k=useRef(null),w=fw[c];useEffect(()=>{k.current?.scrollIntoView({behavior:"smooth"});},[t,n]);let T=useCallback(async()=>{let S=g$1.trim();!S||n||(x(""),await o(S));},[n,o,g$1]),I=useCallback(async S=>{S.key==="Enter"&&!y&&(S.preventDefault(),await T());},[T,y]);return g("div",{className:ot("relative flex h-full w-full min-h-[460px] min-w-[340px] flex-col overflow-hidden rounded-3xl border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-none dark:bg-[var(--orb-surface-2)]",a),children:[u&&f("button",{onClick:u,className:ot("absolute z-20 flex h-10 w-10 items-center justify-center rounded-full transition-colors hover:bg-transparent dark:hover:bg-transparent",w==="top-left"&&"-left-2 -top-2",w==="top-right"&&"-right-2 -top-2",w==="bottom-left"&&"-bottom-2 -left-2",w==="bottom-right"&&"-bottom-2 -right-2"),type:"button","aria-label":"Collapse Copilot",children:f("span",{className:ot("block h-4 w-4 border-[var(--orb-ai-accent)]",w==="top-left"&&"rounded-tl-full border-l-[3px] border-t-[3px]",w==="top-right"&&"rounded-tr-full border-r-[3px] border-t-[3px]",w==="bottom-left"&&"rounded-bl-full border-b-[3px] border-l-[3px]",w==="bottom-right"&&"rounded-br-full border-b-[3px] border-r-[3px]")})}),g("div",{className:"flex items-center justify-between border-b border-[var(--orb-border)] px-4 py-3",onPointerDown:d,children:[f("div",{className:"flex items-center",children:f("h3",{className:"text-base font-semibold tracking-tight text-[var(--orb-fg)]",children:s})}),f("div",{})]}),g("div",{className:"flex-1 overflow-y-auto px-3 py-3 space-y-5 scrollbar-thin scrollbar-thumb-[var(--orb-border)]",children:[t.map((S,D)=>{let R=S.type==="assistant"&&D===t.length-1,M=S.type==="assistant"?{isLatestAssistant:R,isResponding:n,onRegenerate:r?()=>r(S.id):void 0}:void 0;return f(Ts,{message:S,assistantActions:M,onStreamingComplete:()=>v?.(S.id),streamIntervalMs:f$1,streamChunkSize:p,cardHooks:C},S.id)}),f("div",{ref:k})]}),f("div",{className:"border-t border-[var(--orb-border)] px-3 py-3",children:g("div",{className:"flex items-center gap-2 rounded-xl border border-[var(--orb-p300)] bg-[var(--orb-canvas)] px-2 py-1.5 dark:bg-[var(--orb-surface-2)]",children:[f("button",{className:"flex h-8 w-8 items-center justify-center rounded-full text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-surface)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] dark:hover:bg-[var(--orb-surface-2)]",onClick:m,type:"button","aria-label":"Add",children:f(Jr,{className:"h-4 w-4"})}),f("input",{className:"h-7 flex-1 border-none bg-transparent text-sm text-[var(--orb-fg)] outline-none placeholder:text-[var(--orb-muted)] dark:text-[var(--orb-fg)] dark:placeholder:text-[var(--orb-muted)]",placeholder:i||"Ask Copilot...",value:g$1,onChange:S=>x(S.target.value),onCompositionStart:()=>b(true),onCompositionEnd:()=>b(false),onKeyDown:I,"aria-label":"Copilot input",spellCheck:false}),f("button",{className:"flex h-8 w-8 items-center justify-center rounded-full text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-surface)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] dark:hover:bg-[var(--orb-surface-2)]",onClick:h,type:"button","aria-label":"Microphone",children:f(Va,{className:"h-4 w-4"})})]})})]})};var bw=["var(--orb-primary)","var(--orb-primary)","var(--orb-primary)"],vw=`
22
22
  .orbcafe-ai-browser-glow {
23
23
  position: fixed;
24
24
  inset: 0;
@@ -50,4 +50,4 @@ ${r}: ${(a??n)(g$1.secondaryValue??0)}`:""]})}),f("text",{x:g$1.x,y:Math.max(g$1
50
50
  0%, 100% { opacity: 0.5; }
51
51
  50% { opacity: 1; }
52
52
  }
53
- `,Xz=({active:t=false,colors:o=Yx,zIndex:r=2147483e3})=>{let n={"--orbcafe-ai-glow-line":o[0],"--orbcafe-ai-glow-z-index":r};return g(e,{children:[f("style",{children:Qx}),f("div",{className:"orbcafe-ai-browser-glow","data-active":t?"true":"false",style:n,"aria-hidden":"true"})]})};var c5=({defaultMode:t="login",onLogin:o,onRegister:r,onForgotPassword:n}={})=>{let[a,i]=useState(t),[s,l]=useState(false),d=useCallback(async u=>{l(true);try{await u?.();}finally{l(false);}},[]),p=useCallback(u=>d(()=>o?.(u)),[o,d]),m=useCallback(u=>d(()=>r?.(u)),[r,d]),h=useCallback(u=>d(()=>n?.(u)),[n,d]),f=useMemo(()=>({mode:a,loading:s,onModeChange:i,onLogin:p,onRegister:m,onForgotPassword:h}),[h,p,m,s,a]);return {mode:a,loading:s,setMode:i,authPageProps:f}};var ew={productName:"ORBCAFE \u2014 Enterprise suite",headline:"We digitalize you.",subheadline:"One sign-in for planning, production and analytics across your value chain.",brandMeta:"ORBCAFE \xB7 Enterprise manufacturing suite",loginTitle:"Sign in",loginSubtitle:"Use your corporate account to continue.",registerTitle:"Create account",registerSubtitle:"Request a demo workspace user for evaluation.",forgotTitle:"Reset password",forgotSubtitle:"Send a password reset request to your email address."},v5=({mode:t,defaultMode:o="login",onModeChange:r,onLogin:n,onRegister:a,onForgotPassword:i,loading:s=false,logo:l,copy:d,sx:p})=>{let m=t!==void 0,[h,f$1]=useState(o),u=t??h,b=useMemo(()=>({...ew,...d}),[d]),[C,g$1]=useState({username:"demo@orbcafe.local",password:"orbcafe-demo",remember:true}),[x,v]=useState({name:"",email:"",password:"",confirmPassword:"",acceptedTerms:false}),[y,k]=useState({email:""}),[w,P]=useState(""),I=A=>{m||f$1(A),P(""),r?.(A);},S=async A=>{A.preventDefault(),await n?.(C),P("Demo login accepted. No real authentication request was sent.");},R=async A=>{A.preventDefault(),await a?.(x),P("Demo registration saved locally for this screen.");},N=async A=>{A.preventDefault(),await i?.(y),P("Demo reset link request created. No email was sent.");},T=u==="login"?b.loginTitle:u==="register"?b.registerTitle:b.forgotTitle,M=u==="login"?b.loginSubtitle:u==="register"?b.registerSubtitle:b.forgotSubtitle;return g("div",{className:"orb-auth-frame orb-root",style:p,children:[g("div",{className:"orb-auth-brand",children:[f("span",{className:"orb-auth-dia",style:{width:230,height:230,right:-70,bottom:-60}}),f("span",{className:"orb-auth-dia orb-auth-dia-sm-hide",style:{width:140,height:140,right:120,bottom:80,borderColor:"rgba(255,255,255,.09)"}}),f("span",{className:"orb-auth-dia orb-auth-dia-sm-hide",style:{width:76,height:76,right:60,bottom:170,background:"color-mix(in oklch, var(--orb-primary) 35%, transparent)",borderColor:"rgba(255,255,255,.2)"}}),l?f("span",{style:{alignSelf:"flex-start",position:"relative"},children:l}):f("span",{className:"orb-logo-slot",children:"Host logo"}),g("div",{className:"orb-auth-claim",children:[f("div",{className:"orb-auth-rule"}),f("h2",{children:b.headline}),f("p",{children:b.subheadline})]}),f("div",{className:"orb-auth-meta",children:b.brandMeta})]}),f("div",{className:"orb-auth-form",children:g("div",{className:"orb-auth-card",children:[f("span",{className:"orb-overline",style:{letterSpacing:"0.12em"},children:b.productName}),f("h1",{className:"orb-h2",style:{margin:0},children:T}),f("p",{className:"orb-body-dense",style:{color:"var(--orb-muted)",margin:"-10px 0 0"},children:M}),w&&f(tn,{severity:"success",children:w}),u==="login"&&g("form",{onSubmit:S,style:{display:"flex",flexDirection:"column",gap:16},children:[f(He,{label:"Email",type:"email",autoComplete:"username",value:C.username,onChange:A=>g$1(L=>({...L,username:A.target.value})),startAdornment:f(_s,{size:15,strokeWidth:1.8})}),f(He,{label:"Password",type:"password",autoComplete:"current-password",value:C.password,onChange:A=>g$1(L=>({...L,password:A.target.value})),startAdornment:f(La,{size:15,strokeWidth:1.8})}),g("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},children:[f(Tt,{label:"Remember me",checked:C.remember,onChange:A=>g$1(L=>({...L,remember:A.target.checked}))}),f("button",{type:"button",className:"orb-link",onClick:()=>I("forgot"),children:"Forgot password?"})]}),f(Pe,{type:"submit",size:"large",block:true,loading:s,children:s?"Signing in\u2026":"Sign in"}),g("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["New user?"," ",f("button",{type:"button",className:"orb-link",onClick:()=>I("register"),children:"Register"})]})]}),u==="register"&&g("form",{onSubmit:R,style:{display:"flex",flexDirection:"column",gap:16},children:[f(He,{label:"Full name",value:x.name,onChange:A=>v(L=>({...L,name:A.target.value})),startAdornment:f(_s,{size:15,strokeWidth:1.8})}),f(He,{label:"Work email",type:"email",autoComplete:"username",value:x.email,onChange:A=>v(L=>({...L,email:A.target.value})),startAdornment:f($s,{size:15,strokeWidth:1.8})}),f(He,{label:"Password",type:"password",autoComplete:"new-password",value:x.password,onChange:A=>v(L=>({...L,password:A.target.value})),startAdornment:f(La,{size:15,strokeWidth:1.8})}),f(He,{label:"Confirm password",type:"password",autoComplete:"new-password",value:x.confirmPassword,onChange:A=>v(L=>({...L,confirmPassword:A.target.value}))}),f(Tt,{label:"I accept the demo workspace terms",checked:x.acceptedTerms,onChange:A=>v(L=>({...L,acceptedTerms:A.target.checked}))}),f(Pe,{type:"submit",size:"large",block:true,loading:s,children:"Create demo account"}),g("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["Already have an account?"," ",f("button",{type:"button",className:"orb-link",onClick:()=>I("login"),children:"Sign in"})]})]}),u==="forgot"&&g("form",{onSubmit:N,style:{display:"flex",flexDirection:"column",gap:16},children:[f(He,{label:"Work email",type:"email",autoComplete:"username",value:y.email,onChange:A=>k({email:A.target.value}),startAdornment:f($s,{size:15,strokeWidth:1.8})}),f(Pe,{type:"submit",size:"large",block:true,loading:s,children:"Send reset request"}),g("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["Remember your password?"," ",f("button",{type:"button",className:"orb-link",onClick:()=>I("login"),children:"Back to sign in"})]})]}),g("div",{style:{display:"flex",alignItems:"center",gap:12,font:"500 10px/1 var(--orb-font)",letterSpacing:"0.1em",textTransform:"uppercase",color:"var(--orb-muted)"},children:[f("span",{style:{flex:1,height:1,background:"var(--orb-border)"}}),"or",f("span",{style:{flex:1,height:1,background:"var(--orb-border)"}})]}),f(Pe,{variant:"neutral",size:"large",block:true,children:"Continue with corporate SSO"}),g("p",{className:"orb-meta",style:{textAlign:"center",fontWeight:300,margin:0},children:["Protected by corporate single sign-on.",f("br",{}),"Demo credentials: demo@orbcafe.local / orbcafe-demo"]})]})})]})};var ow={keyword:{value:"",operator:"contains"},status:{value:"",operator:"equals"},owner:{value:"",operator:"contains"},workCenter:{value:"",operator:"contains"}},rw=[{id:"keyword",label:"Keyword",type:"text",placeholder:"Task/ID/Project",hasSearchIcon:true},{id:"status",label:"Status",type:"select",options:[{label:"In progress",value:"in-progress"},{label:"Blocked",value:"blocked"},{label:"Planned",value:"planned"},{label:"Not started",value:"not-started"}]},{id:"owner",label:"Owner",type:"text",placeholder:"Owner name"},{id:"workCenter",label:"Work Center",type:"text",placeholder:"CNC-02 / WH-A / ..."},{id:"dateRange",label:"Date Range",type:"date"}],Eg=({tasks:t,appId:o,tableKey:r,defaultScale:n="week",defaultSelectedTaskId:a,initialFilters:i,filterFields:s,filterAppId:l,filterTableKey:d,serviceUrl:p,variantService:m,layout:h,columns:f,page:u,rowsPerPage:b,rowsPerPageOptions:C,count:g,onPageChange:x,onRowsPerPageChange:v,onFilterSearch:y,onFilterVariantLoad:k,enableRowReorder:w,onTaskReorder:P,onLayoutIdChange:I,onLayoutSave:S})=>{let R=o??l??"planning-gantt",N=r??d??"planning",[T,M]=useState(n),[A,L]=useState(a??t[0]?.id??""),[W,ee]=useState(""),[O,_]=useState(null),[V,Q]=useState({...ow,...i}),H=useMemo(()=>{let le=String(V.keyword?.value??"").trim().toLowerCase(),he=String(V.status?.value??"").trim(),ze=String(V.owner?.value??"").trim().toLowerCase(),be=String(V.workCenter?.value??"").trim().toLowerCase(),Ce=V.dateRange?.value,Be=Ce?.[0]?rr(Ce[0]):null,de=Ce?.[1]?rr(Ce[1]):null;return t.filter(ve=>{if(le&&![ve.id,ve.code,ve.title,ve.project,ve.workCenter,ve.owner?.name].join(" ").toLowerCase().includes(le)||he&&ve.status!==he||ze&&!String(ve.owner?.name??"").toLowerCase().includes(ze)||be&&!String(ve.workCenter??"").toLowerCase().includes(be))return false;if(Be||de){let We=rr(ve.startDate),et=rr(ve.endDate),nt=Be?et.isAfter(Be)||et.isSame(Be,"day"):true,it=de?We.isBefore(de)||We.isSame(de,"day"):true;if(!nt||!it)return false}return true})},[V,t]);useEffect(()=>{H.length!==0&&(H.some(le=>le.id===A)||L(H[0].id));},[H,A]);let B=useCallback(le=>{L(le.id);},[]),q=useCallback(le=>{ee(le),I?.(le);},[I]),Z=useCallback(le=>{_(he=>({key:(he?.key??0)+1,variant:le})),k?.(le);},[k]),Y=useMemo(()=>({appId:R,tableKey:N,fields:s??rw,filters:V,onFilterChange:Q,onVariantLoad:Z,onSearch:y??(()=>{}),currentLayoutId:W,layoutRefs:[{tableKey:N,layoutId:W||null}],variantService:m,serviceUrl:p}),[W,s,V,Z,y,R,N,p,m]),J=useMemo(()=>({appId:R,tableKey:N,serviceUrl:p,tasks:H,columns:f,scale:T,onScaleChange:M,page:u,rowsPerPage:b,rowsPerPageOptions:C,count:g,onPageChange:x,onRowsPerPageChange:v,selectedTaskId:A,onTaskSelect:B,enableRowReorder:w,onTaskReorder:P,layout:h,layoutVariant:O?.variant,layoutVariantLoadKey:O?.key,onLayoutIdChange:q,onLayoutSave:S}),[f,g,w,H,q,h,O?.key,O?.variant,x,v,S,P,B,u,R,N,b,C,T,p,A]);return {scale:T,setScale:M,selectedTaskId:A,setSelectedTaskId:L,filters:V,setFilters:Q,filteredTasks:H,smartFilterProps:Y,planningGanttProps:J}};var T5=t=>{let o=Eg(t),r=useMemo(()=>({filterProps:o.smartFilterProps,ganttProps:o.planningGanttProps}),[o.planningGanttProps,o.smartFilterProps]);return {...o,layoutProps:r}};rr.extend(aw);var gc=[{value:"hour",label:"Hour",width:56},{value:"day",label:"Day",width:46},{value:"week",label:"Week",width:78},{value:"month",label:"Month",width:104}],hc=36,fc=58,Ta=8,bc=260,uw=320,_r="220ms cubic-bezier(0.2, 0, 0, 1)",Lg={"not-started":{label:"Not started",color:"default"},planned:{label:"Planned",color:"info"},"in-progress":{label:"In progress",color:"primary"},blocked:{label:"Blocked",color:"error"},done:{label:"Done",color:"success"}},mw=t=>t?Lg[t]?.label??t:"Planned",gw=t=>t?Lg[t]?.color??"default":"info",Og=t=>Math.min(100,Math.max(0,t??0)),Fg=(t,o=0)=>t.flatMap(r=>[{...r,level:o},...Fg(r.children??[],o+1)]),hw=t=>({id:t.id,code:t.code??t.id,title:t.title,titleSub:t.project??t.workCenter??"General",project:t.project??"",workCenter:t.workCenter??"",owner:t.owner?.name??"Unassigned",status:mw(t.status),statusTone:t.status??"planned",progress:Og(t.progress),startDate:t.startDate,endDate:t.endDate,color:t.color,reorderable:t.reorderable!==false}),Bg=(t,o)=>o==="month"?t.startOf("month"):o==="week"?t.startOf("week"):o==="day"?t.startOf("day"):t.startOf("hour"),Hg=(t,o)=>o==="month"?t.endOf("month"):o==="week"?t.endOf("week"):o==="day"?t.endOf("day"):t.endOf("hour"),fw=(t,o,r)=>{let n=[],a=Bg(t,r),i=Hg(o,r);for(;a.isBefore(i)||a.isSame(i);){let s=r==="month"?a.add(1,"month"):r==="week"?a.add(1,"week"):r==="day"?a.add(1,"day"):a.add(1,"hour");n.push({key:`${r}-${a.valueOf()}`,label:r==="month"?a.format("MMM YYYY"):r==="week"?a.format("MMM D"):r==="day"?a.format("D"):a.format("HH:mm"),contextLabel:r==="hour"?a.format("MMM D"):r==="day"?a.format("MMM"):r==="week"?`W${a.isoWeek()}`:void 0,title:r==="hour"?a.format("MMM D, YYYY HH:mm"):r==="day"?a.format("MMM D, YYYY"):r==="week"?`${a.format("MMM D, YYYY")} - Week ${a.isoWeek()}`:void 0,start:a,end:s}),a=s;}return n},vc=(t,o,r)=>{let n=0;for(let a of o){if(t.isBefore(a.start))return n;if(t.isBefore(a.end)){let i=Math.max(1,a.end.valueOf()-a.start.valueOf()),s=Math.max(0,t.valueOf()-a.start.valueOf());return n+s/i*r}n+=r;}return n},zg=({appId:t="planning-gantt",tableKey:o="planning",serviceUrl:r,title:n="Project Plan",extraTools:a,bodyHeight:i=560,tasks:s,columns:l,scale:d="week",onScaleChange:p,page:m,rowsPerPage:h=20,rowsPerPageOptions:f$1=[20,50,100,-1],count:u,onPageChange:b$1,onRowsPerPageChange:C,timelineStart:g$1,timelineEnd:x,selectedTaskId:v,onTaskSelect:y,enableRowReorder:k=true,onTaskReorder:w,layout:P,layoutVariant:I,layoutVariantLoadKey:S,onLayoutIdChange:R,onLayoutSave:N,emptyLabel:T="No planning tasks available.",sx:M})=>{let A=io(),{t:L}=ce(),W=useRef(null),ee=useRef(null),O=useRef(null),_=useRef(false),[V,Q]=useState(null),[H,B]=useState("content"),[q,Z]=useState(null),[Y,J]=useState(0),[le,he]=useState({}),[ze,be]=useState(hc),[Ce,Be]=useState([]),de=useRef(void 0),[ve,We]=useState({activeId:null,overId:null}),[et,nt]=useState(null),[it,U]=useState(false),Re=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:4}})),we=useRef(null),Oe=useMemo(()=>Fg(s),[s]),at=useMemo(()=>{if(Ce.length===0)return Oe;let F=new Map(Oe.map(Te=>[Te.id,Te])),j=Ce.map(Te=>F.get(Te)).filter(Te=>!!Te),ge=new Set(j.map(Te=>Te.id));return [...j,...Oe.filter(Te=>!ge.has(Te.id))]},[Oe,Ce]),Ze=useMemo(()=>new Map(at.map(F=>[F.id,F])),[at]),xt=useMemo(()=>at.map(F=>hw(F)),[at]),It=useMemo(()=>new Map(xt.map(F=>[F.id,F])),[xt]),Ot=useMemo(()=>[{id:"code",label:"ID",minWidth:90},{id:"title",label:"Task",minWidth:260,render:(F,j)=>g(se,{spacing:.2,children:[f(E,{sx:{fontSize:15,fontWeight:700,lineHeight:1.2},children:j.title}),f(E,{sx:{fontSize:13,color:"text.secondary"},children:j.titleSub})]})},{id:"owner",label:"Owner",minWidth:170},{id:"status",label:"Status",minWidth:130,render:(F,j)=>f(Ct,{label:j.status,color:gw(j.statusTone),size:"small"})},{id:"progress",label:"Progress",minWidth:140,numeric:true,render:F=>g(se,{spacing:.6,children:[g(E,{variant:"caption",sx:{color:"text.secondary"},children:[F,"%"]}),f(Wn,{variant:"determinate",value:F,sx:{height:6,borderRadius:999}})]})},{id:"startDate",label:"Start",minWidth:120},{id:"endDate",label:"End",minWidth:120}],[]),At=useMemo(()=>{if(!l||l.length===0)return Ot;let F=new Map(Ot.map(j=>[j.id,j]));return l.map(j=>{let ge=F.get(j.id),Te=j.width??ge?.minWidth??120,Je={id:j.id,label:j.label,minWidth:Te};if(ge?.numeric&&(Je.numeric=true),j.render){let qe=j.render;return Je.render=(St,ht)=>{let mt=Ze.get(ht.id);return qe(mt||ht)},Je}return ge?.render?(Je.render=ge.render,Je):(Je.render=(qe,St)=>{let ht=St[j.id];if(ht!=null&&String(ht).length>0)return String(ht);let yt=Ze.get(St.id)?.[j.id];return yt!=null&&String(yt).length>0?String(yt):"-"},Je)})},[l,Ot,Ze]),re=hn({appId:t,tableKey:o,title:n,columns:At,rows:xt,rowKey:"id",page:m,rowsPerPage:h,rowsPerPageOptions:f$1,count:u??xt.length,onPageChange:b$1,onRowsPerPageChange:C,showSummary:false,layout:P,onLayoutSave:N}),Ge=t?f(gn,{appId:t,tableKey:o,currentLayoutData:re.currentLayoutData,onLayoutLoad:re.handleLayoutLoad,targetLayoutId:re.layoutIdToLoad,activeLayoutId:re.currentLayoutId,serviceUrl:r}):null,Le=re.visibleRows;useEffect(()=>{let F=Oe.map(j=>j.id);Be(j=>{let ge=new Set(F),Te=j.filter(ht=>ge.has(ht)),Je=new Set(Te),qe=F.filter(ht=>!Je.has(ht)),St=[...Te,...qe];return St.length===j.length&&St.every((ht,mt)=>ht===j[mt])?j:St});},[Oe]),useEffect(()=>{S===void 0||!I||de.current!==S&&(de.current=S,re.handleVariantLoad(I));},[re,I,S]),useEffect(()=>{R?.(re.currentLayoutId);},[re.currentLayoutId,R]);let pe=F=>F.type==="group"?`group-${F.id}`:`row-${(F.data||F)?.id}`,xe=useMemo(()=>{let F=xt.map(mt=>rr(mt.startDate)),j=xt.map(mt=>rr(mt.endDate)),ge=g$1?rr(g$1):F.reduce((mt,yt)=>yt.isBefore(mt)?yt:mt,F[0]??rr()),Te=x?rr(x):j.reduce((mt,yt)=>yt.isAfter(mt)?yt:mt,j[0]??rr().add(30,"day")),Je=d==="month"?"month":d==="week"?"week":d==="day"?"day":"hour",qe=d==="month"?"month":d==="week"?"week":d==="day"?"day":"hour",St=d==="hour"?12:1,ht=d==="hour"?12:1;return {start:Bg(ge.subtract(St,Je),d),end:Hg(Te.add(ht,qe),d)}},[xt,d,x,g$1]),oe=gc.find(F=>F.value===d)??gc[1],ye=Array.isArray(a)?a:a?[a]:[],De=useMemo(()=>fw(xe.start,xe.end,d),[xe.end,xe.start,d]),je=De.length*oe.width,st=De.length>0?100/De.length:100,pt=De.length>0?`repeat(${De.length}, minmax(${oe.width}px, 1fr))`:"1fr",Bt=De.length>0?`calc(100% / ${De.length}) 100%`:"100% 100%",Xt=(re.columns||[]).filter(F=>re.visibleColumns.includes(F.id)).reduce((F,j)=>F+(re.columnWidths?.[j.id]||j.minWidth||100),0)+(re.grouping.length>0?72:0),Vt=H==="manual"&&V!==null?V:Xt,wt=q==="table",Wt=q==="timeline",ft=q==="timeline",Nt=q==="table",lt=!ft&&!Nt,Ft=()=>{let F=Y||W.current?.clientWidth||0;return F>0?Math.max(bc,F-Ta-uw):Math.max(bc,Xt)},Zt=F=>Math.min(Math.max(F,bc),Ft()),z=(()=>{if(Y<=0)return null;let F=lt?Ta:0;if(wt)return {tableWidth:Y,splitterWidth:F,timelineWidth:0};if(Wt)return {tableWidth:0,splitterWidth:F,timelineWidth:Y};if(H==="even"){let ge=Math.max(0,(Y-F)/2);return {tableWidth:ge,splitterWidth:F,timelineWidth:Math.max(0,Y-F-ge)}}let j=Zt(Vt);return {tableWidth:j,splitterWidth:F,timelineWidth:Math.max(0,Y-F-j)}})(),X=z?`${z.tableWidth}px ${z.splitterWidth}px ${z.timelineWidth}px`:wt?"minmax(0, 1fr) 0px 0px":Wt?"0px 0px minmax(0, 1fr)":H==="even"?`minmax(0, 1fr) ${Ta}px minmax(0, 1fr)`:`${Vt}px ${Ta}px minmax(0, 1fr)`;useEffect(()=>{H==="manual"&&Q(F=>F===null?null:Zt(F));},[H,Xt,Y]);let fe=F=>{F.preventDefault(),F.currentTarget.setPointerCapture(F.pointerId),Z(null),B("manual"),we.current={startX:F.clientX,startWidth:ee.current?.getBoundingClientRect().width??Vt};let j=Te=>{let Je=we.current;if(!Je)return;let qe=Zt(Je.startWidth+Te.clientX-Je.startX);Q(qe);},ge=()=>{we.current=null,window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",ge),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",j),window.addEventListener("pointerup",ge);},Se=()=>{Z(null),B("even"),Q(null);},Ae=F=>!k||!F?false:It.get(F)?.reorderable!==false,$e=(F,j)=>{if(!F||!j||F===j||!Ae(F)||!Ae(j))return false;if(re.grouping.length===0)return true;let ge=It.get(F),Te=It.get(j);return !ge||!Te?false:re.grouping.every(Je=>ge[Je]===Te[Je])},Ke=(F,j)=>{if(!$e(F,j))return;let ge=Le.filter(Et=>Et.type!=="group").map(Et=>String((Et.data||Et)?.id)),Te=ge.indexOf(F),Je=ge.indexOf(j);if(Te<0||Je<0)return;let qe=[...ge];[qe[Te],qe[Je]]=[qe[Je],qe[Te]];let St=new Set(ge),ht=at.map(Et=>Et.id),mt=[...qe,...ht.filter(Et=>!St.has(Et))],yt=Ze.get(F),ro=Ze.get(j);if(re.setOrder("asc"),re.setOrderBy(""),Be(mt),yt&&ro){let{level:Et,...Yt}=yt,{level:Ht,...Ut}=ro,$t=mt.reduce((to,no)=>{let fo=Ze.get(no);if(fo){let{level:Io,...Mo}=fo;to.push(Mo);}return to},[]);w?.($t,{activeTask:Yt,targetTask:Ut});}},Ye=(F,j)=>{if(!Ae(j.id)){F.preventDefault();return}F.stopPropagation(),F.dataTransfer.effectAllowed="move",F.dataTransfer.setData("text/plain",j.id),We({activeId:j.id,overId:null}),y?.(Ze.get(j.id)||j);},ut=(F,j)=>{if(!$e(ve.activeId,j)){We(ge=>ge.overId===null?ge:{...ge,overId:null});return}F.preventDefault(),F.stopPropagation(),F.dataTransfer.dropEffect="move",We(ge=>ge.overId===j?ge:{...ge,overId:j});},gt=(F,j)=>{let ge=ve.activeId||F.dataTransfer.getData("text/plain");if(!$e(ge,j)){We({activeId:null,overId:null});return}F.preventDefault(),F.stopPropagation(),Ke(ge,j),We({activeId:null,overId:null});},Mt=()=>{We({activeId:null,overId:null});},bt=F=>{if(_.current)return;let j=F==="table"?ee.current:O.current,ge=F==="table"?O.current:ee.current;!j||!ge||(_.current=true,ge.scrollTop=j.scrollTop,window.requestAnimationFrame(()=>{_.current=false;}));};return useLayoutEffect(()=>{let F=W.current;if(!F){J(0);return}let j=0,ge=()=>{window.cancelAnimationFrame(j),j=window.requestAnimationFrame(()=>{let Je=F.clientWidth;J(qe=>Math.abs(qe-Je)<.5?qe:Je);});};if(ge(),typeof ResizeObserver>"u")return window.addEventListener("resize",ge),()=>{window.cancelAnimationFrame(j),window.removeEventListener("resize",ge);};let Te=new ResizeObserver(ge);return Te.observe(F),window.addEventListener("resize",ge),()=>{window.cancelAnimationFrame(j),Te.disconnect(),window.removeEventListener("resize",ge);}},[xt.length]),useLayoutEffect(()=>{if(!v||Nt)return;let F=O.current,j=ee.current;if(!F)return;let ge=`row-${v}`,Te=Array.from(F.querySelectorAll("[data-planning-timeline-row-key]")).find(St=>St.dataset.planningTimelineRowKey===ge),Je=It.get(v);if(!Te||!Je)return;let qe=window.requestAnimationFrame(()=>{let St=F.getBoundingClientRect(),ht=Te.getBoundingClientRect(),mt=Math.max(1,F.clientHeight-ze),yt=F.scrollTop+ht.top-St.top-ze-(mt-ht.height)/2;_.current=true,F.scrollTop=Math.max(0,yt),j&&!ft&&(j.scrollTop=F.scrollTop);let ro=Math.max(1,F.scrollWidth),Et=De.length>0?ro/De.length:oe.width,Yt=vc(rr(Je.startDate),De,Et),Ht=Math.max(0,Yt-Et);F.scrollLeft=Math.min(Ht,Math.max(0,ro-F.clientWidth)),window.requestAnimationFrame(()=>{_.current=false;});});return ()=>window.cancelAnimationFrame(qe)},[oe.width,ze,v,ft,It,Nt,Le,De]),useLayoutEffect(()=>{let F=ee.current;if(!F)return;let j=0,ge=0,Te=false,Je=()=>{if(Te)return;let Ht=F.querySelector("thead"),Ut=Array.from(F.querySelectorAll("tbody tr[data-ctable-row-key]"));if(Ut.length===0)return;let $t=Ht?.getBoundingClientRect().height||hc,to={};Ut.forEach(no=>{let fo=no.dataset.ctableRowKey;fo&&(to[fo]=no.getBoundingClientRect().height);}),be(no=>Math.abs(no-$t)<.01?no:$t),he(no=>{let fo=Object.keys(no),Io=Object.keys(to);return fo.length===Io.length&&Io.every(Mo=>Math.abs((no[Mo]??0)-to[Mo])<.01)?no:to});},qe=()=>{window.cancelAnimationFrame(j),j=window.requestAnimationFrame(Je);};if(Je(),window.cancelAnimationFrame(ge),ge=window.requestAnimationFrame(()=>{ge=window.requestAnimationFrame(Je);}),typeof document<"u"&&document.fonts?.ready&&document.fonts.ready.then(()=>{Te||qe();}).catch(()=>{}),typeof ResizeObserver>"u")return window.addEventListener("resize",qe),()=>{Te=true,window.cancelAnimationFrame(j),window.cancelAnimationFrame(ge),window.removeEventListener("resize",qe);};let St=new ResizeObserver(qe),ht=F.querySelector("table"),mt=F.querySelector("tbody"),yt=F.querySelector("thead");ht&&St.observe(ht),yt&&St.observe(yt);let ro=new WeakSet,Et=()=>{F.querySelectorAll("tbody tr[data-ctable-row-key]").forEach(Ht=>{ro.has(Ht)||(St.observe(Ht),ro.add(Ht));});};Et();let Yt=null;return mt&&typeof MutationObserver<"u"&&(Yt=new MutationObserver(()=>{Et(),qe();}),Yt.observe(mt,{childList:true,subtree:true,characterData:true})),window.addEventListener("resize",qe),()=>{Te=true,window.cancelAnimationFrame(j),window.cancelAnimationFrame(ge),St.disconnect(),Yt?.disconnect(),window.removeEventListener("resize",qe);}},[Le,re.visibleColumns,re.grouping,re.columnWidths]),g(Ne,{className:"orb-ctable-surface orb-planning-gantt",elevation:0,sx:{m:0,p:0,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden",borderRadius:"var(--orb-r-container)",border:`1px solid ${A.palette.divider}`,...M},children:[f("div",{className:"orb-table-toolbar orb-planning-table-toolbar",role:"toolbar","aria-label":L("table.title.default"),children:g("div",{className:"orb-table-toolbar-primary",children:[f(hi,{value:re.filterText,onChange:F=>{re.setFilterText(F),re.setPage(0);}}),f(gi,{rowsPerPage:re.rowsPerPage,rowsPerPageOptions:f$1,page:re.page,count:re.totalDisplayCount,onRowsPerPageChange:re.setRowsPerPage,onPageChange:re.setPage}),ye.length>0&&f("div",{className:"orb-table-toolbar-custom",children:ye.map((F,j)=>f("div",{className:"orb-planning-extra-tool",children:F},`planning-extra-tool-${j}`))}),f("span",{className:"orb-table-toolbar-spacer"}),g("div",{className:"orb-table-toolbar-actions",children:[g("div",{className:"orb-table-tool-group",children:[f(ie,{className:"orb-table-tool-button",tooltip:"Column visibility",onClick:F=>re.setAnchorEl(F.currentTarget),sx:po,children:f(an,{fontSize:"small"})}),f(ie,{className:"orb-table-tool-button",tooltip:"Group by",onClick:F=>re.setGroupAnchorEl(F.currentTarget),sx:po,children:f(Cr,{fontSize:"small"})}),f(ie,{className:`orb-table-tool-button ${re.sortBy.length>0||re.orderBy?"orb-is-active":""}`,tooltip:"Sort by...",active:re.sortBy.length>0||!!re.orderBy,onClick:()=>U(true),sx:po,children:f(up,{fontSize:"small"})})]}),Ge&&f("div",{className:"orb-table-tool-group",children:Ge}),f("div",{className:"orb-table-tool-group orb-planning-pane-controls",children:f($n,{"aria-label":"Planning pane layout",size:"small",value:q??(H==="even"?"split":null),options:[{value:"table",label:"Expand task table",icon:f(li,{fontSize:"small"})},{value:"split",label:"Split evenly",icon:f(di,{fontSize:"small"})},{value:"timeline",label:"Expand timeline",icon:f(si,{fontSize:"small"})}],onValueChange:F=>{F==="split"?Se():Z(F);}})}),f("div",{className:"orb-table-tool-group orb-planning-scale-control",children:f(zt,{label:"",value:d,options:gc.map(F=>({value:F.value,label:F.label})),onChange:F=>p?.(F.target.value)})})]})]})}),xt.length===0?f("div",{sx:{minHeight:240,display:"grid",placeItems:"center",color:"text.secondary"},children:T}):f("div",{sx:{overflow:"hidden",flex:1,minHeight:0},children:g("div",{ref:W,sx:{height:"100%",display:"grid",gridTemplateColumns:X,minWidth:0,transition:`grid-template-columns ${_r}`},children:[f("div",{"data-planning-scroll-pane":"table",ref:ee,onScroll:()=>bt("table"),sx:{width:"100%",minWidth:0,maxWidth:"100%",height:i,overflowX:"auto",overflowY:"auto",opacity:ft?0:1,transform:ft?"translateX(-10px)":"translateX(0)",pointerEvents:ft?"none":"auto",transition:`opacity ${_r}, transform ${_r}`},children:f(DndContext,{sensors:Re,collisionDetection:closestCenter,modifiers:[restrictToHorizontalAxis],onDragEnd:F=>{let j=F?.active?.id,ge=F?.over?.id;typeof j=="string"&&typeof ge=="string"&&re.handleColumnReorder(j,ge);},children:g("table",{className:"orb-tbl orb-ctable orb-planning-table",sx:{tableLayout:"fixed",width:Xt,"& thead th":{height:hc,py:0,lineHeight:1.15,boxSizing:"border-box"}},children:[f(vi,{columns:re.columns,visibleColumns:re.visibleColumns,order:re.order,orderBy:re.orderBy,sortBy:re.sortBy,onRequestSort:re.handleRequestSort,onContextMenu:(F,j)=>{F.preventDefault(),F.stopPropagation(),nt({mouseX:F.clientX+2,mouseY:F.clientY-6,columnId:j});},grouping:re.grouping,isAllExpanded:re.isAllExpanded,handleToggleAll:re.handleToggleAll,columnWidths:re.columnWidths,onColumnResize:re.handleColumnResize,enableColumnReorder:true}),f(yi,{visibleRows:Le,columns:re.columns,visibleColumns:re.visibleColumns,selected:v?[v]:[],expandedGroups:re.expandedGroups,toggleGroupExpand:re.toggleGroupExpand,handleExpandGroupRecursively:re.handleExpandGroupRecursively,handleCollapseGroupRecursively:re.handleCollapseGroupRecursively,isGroupFullyExpanded:re.isGroupFullyExpanded,grouping:re.grouping,rowKeyProp:"id",page:re.page,rowsPerPage:re.rowsPerPage,emptyLabel:T,handleClick:(F,j)=>{y?.(Ze.get(j.id)||j);},getRowDataKey:({entry:F})=>pe(F),getGroupRowProps:()=>({style:{height:fc}}),getRowProps:({data:F})=>{let j=F,ge=Ae(j.id),Te=ve.activeId===j.id,Je=ve.overId===j.id&&$e(ve.activeId,j.id);return {draggable:ge,className:Je?"orb-is-drop-target":void 0,style:{cursor:Te?"grabbing":ge?"grab":y?"pointer":"default",height:fc,opacity:Te?.56:1,transition:"background-color 120ms ease, opacity 120ms ease"},onDragStart:qe=>Ye(qe,j),onDragOver:qe=>ut(qe,j.id),onDragEnter:qe=>ut(qe,j.id),onDrop:qe=>gt(qe,j.id),onDragEnd:Mt}}})]})})}),f("div",{onPointerDown:lt?fe:void 0,role:"separator","aria-orientation":"vertical",sx:{width:lt?Ta:0,cursor:lt?"col-resize":"default",opacity:lt?1:0,pointerEvents:lt?"auto":"none",borderLeft:lt?`1px solid ${A.palette.divider}`:"0 solid transparent",borderRight:lt?`1px solid ${A.palette.divider}`:"0 solid transparent",backgroundColor:b()==="dark"?"color-mix(in oklch, var(--orb-muted) 10%, transparent)":"color-mix(in oklch, var(--orb-fg) 4%, transparent)",transition:`width ${_r}, opacity ${_r}, background-color 120ms ease`,position:"relative","&:hover":{backgroundColor:A.palette.action.selected},"&::before":{content:'""',position:"absolute",top:0,bottom:0,left:-6,right:-6,cursor:lt?"col-resize":"default"}}}),f("div",{sx:{minWidth:0,overflow:"hidden",opacity:Nt?0:1,transform:Nt?"translateX(10px)":"translateX(0)",pointerEvents:Nt?"none":"auto",transition:`opacity ${_r}, transform ${_r}`},children:f("div",{"data-planning-scroll-pane":"timeline",ref:O,onScroll:()=>bt("timeline"),sx:{width:"100%",height:i,overflowX:"auto",overflowY:"auto"},children:g("div",{sx:{width:"100%",minWidth:je||"100%"},children:[f("div",{className:"orb-planning-timeline-header",sx:{display:"grid",gridTemplateColumns:pt,height:ze,boxSizing:"border-box",borderBottom:`1px solid ${A.palette.divider}`,position:"sticky",top:0,zIndex:2},children:De.map(F=>g("div",{title:F.title,sx:{px:.75,display:"flex",flexDirection:F.contextLabel?"column":"row",alignItems:"center",justifyContent:"center",gap:F.contextLabel?.15:0,borderRight:`1px solid ${A.palette.divider}`,color:F.contextLabel?"text.primary":"text.secondary",overflow:"hidden"},children:[F.contextLabel&&f(E,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"text.secondary",fontSize:11,fontWeight:700,lineHeight:1.1},children:F.contextLabel}),f(E,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:12,fontWeight:700,lineHeight:1.15},children:F.label})]},F.key))}),f(se,{sx:{position:"relative"},children:Le.map(F=>{let j=pe(F),ge=le[j]??fc;if(F.type==="group")return f("div",{className:"orb-planning-timeline-row orb-table-group-row","data-planning-timeline-row-key":j,sx:{position:"relative",height:ge,boxSizing:"border-box",borderBottom:`1px solid ${A.palette.divider}`}},F.id);let Te=F.data||F,Je=rr(Te.startDate),qe=rr(Te.endDate),St=vc(Je,De,st),ht=vc(qe,De,st),mt=Math.max(0,ht-St),yt=Og(Te.progress),ro=Te.id===v,Et=Ae(Te.id),Yt=ve.activeId===Te.id,Ht=ve.overId===Te.id&&$e(ve.activeId,Te.id),Ut=Te.color??(Te.statusTone==="blocked"?A.palette.error.main:A.palette.primary.main);return f("div",{className:`orb-planning-timeline-row ${ro?"orb-is-selected":""}`,"data-planning-timeline-row-key":j,draggable:Et,onDragStart:$t=>Ye($t,Te),onDragOver:$t=>ut($t,Te.id),onDragEnter:$t=>ut($t,Te.id),onDrop:$t=>gt($t,Te.id),onDragEnd:Mt,onClick:()=>y?.(Ze.get(Te.id)||Te),sx:{position:"relative",height:ge,boxSizing:"border-box",borderBottom:`1px solid ${A.palette.divider}`,opacity:Yt?.56:1,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,height:2,backgroundColor:A.palette.primary.main,opacity:Ht?1:0,transition:"opacity 120ms ease",pointerEvents:"none",zIndex:3},backgroundImage:b()==="dark"?"linear-gradient(90deg, color-mix(in oklch, var(--orb-muted) 8%, transparent) 1px, transparent 1px)":"linear-gradient(90deg, color-mix(in oklch, var(--orb-fg) 6%, transparent) 1px, transparent 1px)",backgroundSize:Bt,cursor:Yt?"grabbing":Et?"grab":y?"pointer":"default",transition:"opacity 120ms ease"},children:f(ct,{title:`${Te.title}: ${Je.format("MMM D HH:mm")} - ${qe.format("MMM D HH:mm")}`,children:g("div",{sx:{position:"absolute",left:`${St}%`,top:Math.max(8,(ge-24)/2),width:`max(18px, ${mt}%)`,height:24,borderRadius:999,overflow:"hidden",backgroundColor:b()==="dark"?"color-mix(in oklch, var(--orb-muted) 18%, transparent)":"color-mix(in oklch, var(--orb-fg) 10%, transparent)",outline:ro?`2px solid ${A.palette.warning.main}`:"none",outlineOffset:2},children:[f("div",{sx:{height:"100%",width:`${yt}%`,backgroundColor:Ut}}),f(E,{sx:{position:"absolute",inset:0,px:1,display:"flex",alignItems:"center",color:"var(--orb-on-primary)",fontSize:11,fontWeight:800,textShadow:"0 1px 4px rgba(0,0,0,0.45)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:Te.code})]})})},Te.id)})})]})})})]})}),f(cn,{groupAnchorEl:re.groupAnchorEl,setGroupAnchorEl:re.setGroupAnchorEl,grouping:re.grouping,setGrouping:re.setGrouping,columns:re.columns}),f(dn,{anchorEl:re.anchorEl,setAnchorEl:re.setAnchorEl,columns:re.columns,visibleColumns:re.visibleColumns,toggleColumnVisibility:re.toggleColumnVisibility}),f(Rp,{contextMenu:et,handleClose:()=>nt(null),columns:re.columns,visibleColumns:re.visibleColumns,grouping:re.grouping,summaryColumns:re.summaryColumns,showSummary:re.showSummary,sortBy:re.sortBy,orderBy:re.orderBy,order:re.order,onSortAsc:F=>{re.applyMultiSort([{field:F,direction:"asc"}]);},onSortDesc:F=>{re.applyMultiSort([{field:F,direction:"desc"}]);},onClearSort:F=>{let j=re.sortBy.filter(ge=>ge.field!==F);j.length>0?re.applyMultiSort(j):(re.clearMultiSort(),re.orderBy===F&&re.setOrderBy(""));},onHideColumn:F=>{re.visibleColumns.includes(F)&&re.toggleColumnVisibility(F);},onToggleGroup:F=>re.toggleGroupField(F),onToggleSummary:F=>re.toggleSummaryColumn(F),onOpenSortDialog:()=>U(true)}),f(Dp,{open:it,onClose:()=>U(false),columns:re.columns,initialRules:re.sortBy.length>0?re.sortBy:re.orderBy?[{field:re.orderBy,direction:re.order}]:[],onApply:F=>re.applyMultiSort(F),onClear:()=>{re.clearMultiSort(),re.setOrderBy("");}})]})};var aV=({filterProps:t,ganttProps:o,spacing:r=2,sx:n,children:a})=>{let i=n?[{height:"100%",overflow:"hidden"},n]:{height:"100%",overflow:"hidden"},s=o.sx?[{height:"100%"},o.sx]:{height:"100%"};return g(se,{spacing:r,sx:i,children:[f("div",{sx:{flexShrink:0},children:f($o,{...t})}),f("div",{sx:{flex:1,minHeight:0,overflow:"hidden"},children:f(zg,{...o,bodyHeight:o.bodyHeight??"100%",sx:s})}),a]})};var Vg=640,bw=360,vw=360,Fs=8,An="220ms cubic-bezier(0.2, 0, 0, 1)",xc=(t,o,r=0,n=[])=>t.flatMap(a=>{let i=a.children??[],s=[{node:a,level:r,hasChildren:i.length>0,parentIds:n}];return o.has(a.id)?[...s,...xc(i,o,r+1,[...n,a.id])]:s}),$g=t=>t.flatMap(o=>[o,...$g(o.children??[])]),_g=(t,o=0,r=[])=>t.flatMap(n=>{let a=n.children??[];return [{node:n,level:o,hasChildren:a.length>0,parentIds:r},..._g(a,o+1,[...r,n.id])]}),Gg=t=>t.flatMap(o=>{let r=o.children??[];return r.length===0?[]:[o.id,...Gg(r)]}),Wg=t=>Object.entries(t).filter(([o])=>o!=="children").map(([,o])=>o==null?"":typeof o=="string"||typeof o=="number"||typeof o=="boolean"?String(o):"").join(" ").toLowerCase(),fV=({title:t,subtitle:o,nodes:r,columns:n,detail:a,selectedNodeId:i,defaultSelectedNodeId:s,onNodeSelect:l,expandedNodeIds:d,defaultExpandedNodeIds:p,onExpandedNodeIdsChange:m,defaultPaneMode:h="split",minTreePaneWidth:f$1=bw,minDetailPaneWidth:u=vw,tableAppId:b$1="ctree-comp",tableKey:C="default",tableTitle:g$1,filterConfig:x,searchQuery:v,searchToken:y,defaultRowsPerPage:k=-1,rowsPerPageOptions:w=[20,50,100,-1],serviceUrl:P,emptyLabel:I="No tree items available.",headerAction:S,sx:R,className:N})=>{let T=io(),M=useRef(null),A=useRef(null),L=useRef(null),[W,ee]=useState(s??r[0]?.id??null),[O,_]=useState(p??Gg(r).slice(0,3)),[V,Q]=useState(h),[H,B]=useState(Vg),[q,Z]=useState(0),[Y,J]=useState(0),[le,he]=useState(k),ze=useMemo(()=>n&&n.length>0?n:[{id:"label",label:"Name",render:pe=>g(se,{spacing:.3,children:[f(E,{sx:{fontSize:15,fontWeight:700,lineHeight:1.15},children:pe.label}),pe.subtitle&&f(E,{sx:{fontSize:13,color:"text.secondary",lineHeight:1.2},children:pe.subtitle})]})}],[n]),be=useMemo(()=>new Set(d??O),[d,O]),Ce=useMemo(()=>xc(r,be),[r,be]),Be=useMemo(()=>$g(r),[r]),de=useMemo(()=>_g(r),[r]),ve=i===void 0?W:i,We=useMemo(()=>Be.find(pe=>pe.id===ve)??null,[ve,Be]),et=pe=>{let xe=A.current?.clientWidth??0,oe=xe>0?Math.max(f$1,xe-Fs-u):Math.max(f$1,pe);return Math.min(Math.max(pe,f$1),oe)},nt=V==="detail",it=V==="tree"||!a,U=V==="split"&&!!a,we=(()=>{if(q<=0)return null;if(V==="tree"||!a)return {treeWidth:q,splitterWidth:0,detailWidth:0};if(V==="detail")return {treeWidth:0,splitterWidth:0,detailWidth:q};let pe=U?Fs:0,xe=et(H);return {treeWidth:xe,splitterWidth:pe,detailWidth:Math.max(0,q-pe-xe)}})(),Oe=we?`${we.treeWidth}px ${we.splitterWidth}px ${we.detailWidth}px`:V==="tree"||!a?"minmax(0, 1fr) 0px 0px":V==="detail"?"0px 0px minmax(0, 1fr)":`minmax(${f$1}px, ${H}px) ${Fs}px minmax(${u}px, 1fr)`;useEffect(()=>{let pe=A.current;if(!pe){Z(0);return}let xe=0,oe=()=>{window.cancelAnimationFrame(xe),xe=window.requestAnimationFrame(()=>{let De=pe.clientWidth;Z(je=>Math.abs(je-De)<.5?je:De);});};if(oe(),typeof ResizeObserver>"u")return window.addEventListener("resize",oe),()=>{window.cancelAnimationFrame(xe),window.removeEventListener("resize",oe);};let ye=new ResizeObserver(oe);return ye.observe(pe),window.addEventListener("resize",oe),()=>{window.cancelAnimationFrame(xe),ye.disconnect(),window.removeEventListener("resize",oe);}},[]);let at=pe=>{d===void 0&&_(pe),m?.(pe);},Ze=pe=>{let xe=new Set(be);xe.has(pe)?xe.delete(pe):xe.add(pe),at(Array.from(xe));},xt=pe=>{i===void 0&&ee(pe.id),l?.(pe);};useEffect(()=>{J(0);},[r]),useEffect(()=>{let pe=v?.trim().toLowerCase();if(!pe)return;let xe=de.find(({node:pt})=>Wg(pt).includes(pe));if(!xe)return;let oe=new Set(be);xe.parentIds.forEach(pt=>oe.add(pt)),at(Array.from(oe)),xt(xe.node);let De=xc(r,oe).findIndex(({node:pt})=>pt.id===xe.node.id);De>=0&&le>0&&J(Math.floor(De/le));let je=0,st=0;return je=window.requestAnimationFrame(()=>{st=window.requestAnimationFrame(()=>{let pt=M.current?.querySelector("tr.orb-selected"),Bt=pt?.closest(".orb-table-container");if(pt&&Bt){let Xt=Bt.getBoundingClientRect(),Vt=pt.getBoundingClientRect(),wt=Vt.top-Xt.top+Bt.scrollTop;Bt.scrollTo({top:wt-Bt.clientHeight/2+Vt.height/2,behavior:"smooth"});return}pt?.scrollIntoView({block:"center",behavior:"smooth"});});}),()=>{window.cancelAnimationFrame(je),window.cancelAnimationFrame(st);}},[v,y,de,r,le]);let It=useMemo(()=>Ce.map(({node:pe,level:xe,hasChildren:oe})=>({...pe,id:pe.id,__node:pe,__level:xe,__hasChildren:oe,__expanded:be.has(pe.id),__searchText:Wg(pe)})),[be,Ce]),Ot=useMemo(()=>ze.map((pe,xe)=>({id:pe.id,label:pe.label,minWidth:typeof pe.width=="number"?pe.width:pe.minWidth??(xe===0?320:120),numeric:pe.numeric??pe.align==="right",render:(oe,ye)=>{let De=ye.__node,je=pe.render?pe.render(De):De[pe.id];if(xe!==0)return f(Ie,{sx:{minWidth:0,color:pe.align==="right"?"text.primary":"text.secondary",fontWeight:pe.align==="right"?750:500,textAlign:pe.align??"left"},children:je});let st=Number(ye.__level??0),pt=!!ye.__hasChildren,Bt=!!ye.__expanded;return g(se,{direction:"row",alignItems:"center",spacing:1,sx:{minWidth:0,pl:`${st*24}px`},children:[f(ie,{tooltip:pt?Bt?"Collapse":"Expand":"",onClick:Xt=>{Xt.stopPropagation(),pt&&Ze(De.id);},disabled:!pt,sx:{width:24,height:24,visibility:pt?"visible":"hidden",transform:Bt?"rotate(0deg)":"rotate(-90deg)",transition:"transform 160ms ease"},children:f(Wo,{sx:{fontSize:20}})}),f(Ie,{sx:{width:10,height:10,borderRadius:"50%",flexShrink:0,backgroundColor:De.markerColor??T.palette.primary.main}}),f(Ie,{sx:{minWidth:0},children:je})]})}})),[ze,be,T.palette.primary.main]),At=pe=>{if(!U)return;pe.preventDefault(),pe.currentTarget.setPointerCapture(pe.pointerId),L.current={startX:pe.clientX,startWidth:H};let xe=ye=>{let De=L.current;De&&B(et(De.startWidth+ye.clientX-De.startX));},oe=()=>{L.current=null,window.removeEventListener("pointermove",xe),window.removeEventListener("pointerup",oe),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",xe),window.addEventListener("pointerup",oe);},re=()=>{let pe=A.current?.clientWidth??0,xe=pe>0?Math.max(f$1,(pe-Fs)/2):Vg;Q("split"),B(et(xe));},Ge=()=>a?typeof a=="function"?a(We):a:null,Le=a?f($n,{"aria-label":"Tree pane layout",value:V,options:[{value:"tree",label:"Expand tree",icon:f(li,{fontSize:"small"})},{value:"split",label:"Split evenly",icon:f(di,{fontSize:"small"})},{value:"detail",label:"Expand detail",icon:f(si,{fontSize:"small"})}],onValueChange:pe=>{pe==="split"?re():Q(pe);},sx:{position:"absolute",top:13,right:56,zIndex:3,backdropFilter:"blur(10px)"}}):null;return g(Ie,{ref:M,className:["ctree_comp",N].filter(Boolean).join(" "),sx:{position:"relative",height:"100%",minHeight:0,border:`1px solid ${T.palette.divider}`,borderRadius:"var(--orb-r-container)",overflow:"hidden",backgroundColor:"background.paper",boxShadow:`0 18px 42px ${tt(T.palette.common.black,b()==="dark"?.24:.08)}`,...R},children:[Le,g(Ie,{ref:A,sx:{height:"100%",display:"grid",gridTemplateColumns:Oe,transition:`grid-template-columns ${An}`,minWidth:0},children:[g(Ie,{"aria-hidden":nt?true:void 0,sx:{minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column",opacity:nt?0:1,transform:nt?"translateX(-12px)":"translateX(0)",pointerEvents:nt?"none":"auto",transition:`opacity ${An}, transform ${An}`,willChange:"opacity, transform"},children:[g(se,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:2,sx:{px:2,py:1.5,minHeight:74,borderBottom:`1px solid ${T.palette.divider}`},children:[g(se,{direction:"row",alignItems:"center",spacing:1.4,sx:{minWidth:0},children:[f(Cr,{sx:{color:"primary.main",fontSize:28}}),g(Ie,{sx:{minWidth:0},children:[f(E,{sx:{fontSize:20,fontWeight:750,lineHeight:1.12},noWrap:true,children:t}),o&&f(E,{sx:{fontSize:14,color:"text.secondary",mt:.3},noWrap:true,children:o})]})]}),S!==void 0?S:f(ie,{tooltip:"Add node",color:"default",children:f(Fr,{fontSize:"small"})})]}),g(Ie,{sx:{flex:1,minHeight:0,overflow:"hidden"},children:[f(er,{appId:b$1,tableKey:C,title:g$1??(typeof t=="string"?t:"Tree"),columns:Ot,rows:It,rowKey:"id",fitContainer:true,fullWidth:true,showSummary:false,selectionMode:"single",selected:ve?[ve]:[],onSelectionChange:pe=>{let xe=pe[pe.length-1],oe=Be.find(ye=>ye.id===xe);oe&&xt(oe);},page:Y,rowsPerPage:le,rowsPerPageOptions:w,count:It.length,onPageChange:J,onRowsPerPageChange:pe=>{J(0),he(pe);},filterConfig:x,serviceUrl:P,graphReport:{enabled:false},disableGrouping:true,disableSorting:true,maxHeight:"100%"}),It.length===0&&f(Ie,{sx:{minHeight:220,display:"grid",placeItems:"center",color:"text.secondary"},children:I})]})]}),f(Ie,{"data-ctree-splitter":"true",role:"separator","aria-orientation":"vertical",onPointerDown:U?At:void 0,sx:{width:"100%",cursor:U?"col-resize":"default",backgroundColor:U?tt(T.palette.text.primary,b()==="dark"?.16:.08):"transparent",opacity:U?1:0,pointerEvents:U?"auto":"none",position:"relative",transition:`opacity ${An}, background-color 120ms ease`,"&:hover":{backgroundColor:U?tt(T.palette.primary.main,b()==="dark"?.35:.18):"transparent"}}}),g(Ie,{"aria-hidden":it?true:void 0,sx:{minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column",opacity:it?0:1,transform:it?"translateX(12px)":"translateX(0)",pointerEvents:it?"none":"auto",transition:`opacity ${An}, transform ${An}`,willChange:"opacity, transform"},children:[f(Ie,{sx:{px:2,pt:2,minHeight:74,display:"flex",alignItems:"flex-end"},children:f(Rt,{sx:{width:"100%"}})}),f(Ie,{sx:{flex:1,minHeight:0,overflow:"auto",px:2,pb:2},children:Ge()})]})]})]})};var ww={none:{from:{},to:{}},fade:{from:{opacity:0},to:{opacity:1}},"slide-up":{from:{opacity:0,transform:"translate3d(0, 12px, 0)"},to:{opacity:1,transform:"translate3d(0, 0, 0)"}},"slide-left":{from:{opacity:0,transform:"translate3d(12px, 0, 0)"},to:{opacity:1,transform:"translate3d(0, 0, 0)"}},scale:{from:{opacity:0,transform:"scale(0.985)"},to:{opacity:1,transform:"scale(1)"}}},xV=({children:t,transitionKey:o,variant:r="fade",durationMs:n=220,delayMs:a=0,easing:i="cubic-bezier(0.22, 1, 0.36, 1)",disabled:s=false,sx:l})=>{let d=yr("(prefers-reduced-motion: reduce)"),[p,m]=useState("to"),h=!s&&!d&&r!=="none";useEffect(()=>{if(!h){m("to");return}m("from");let b=requestAnimationFrame(()=>{b=requestAnimationFrame(()=>{m("to");});});return ()=>cancelAnimationFrame(b)},[o,h]);let f$1=ww[r],u=useMemo(()=>h?p==="from"?f$1.from:f$1.to:{opacity:1,transform:"none"},[h,p,f$1.from,f$1.to]);return f(Ie,{sx:{willChange:h?"opacity, transform":"auto",transition:h?`opacity ${n}ms ${i} ${a}ms, transform ${n}ms ${i} ${a}ms`:"none",backfaceVisibility:"hidden",...u,...l},children:t})},wV={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};export{Xz as AIBrowserGlow,Mc as Activity,Wm as AgentPanel,Ia as AlertCircle,Rc as AlertTriangle,Uw as ArrowDown,Kw as ArrowRight,Dc as ArrowUp,zs as BarChart,qw as Bot,Xs as Button,wy as CAINavProvider,tn as CAlert,Hp as CAmapChart,_i as CAppHeader,Rl as CAppHeaderSearch,yE as CAppPageLayout,v5 as CAuthPage,en as CAvatar,$a as CBadge,ta as CBarChart,Pe as CButton,Gn as CCalendar,Jp as CCardDetailPanel,tu as CCardGrid,Nb as CCardGridCard,ZD as CCardPage,wi as CChartCard,Tt as CCheckbox,Ct as CChip,Ep as CComboChart,Vp as CCustomizeAgent,Xh as CDatePicker,bA as CDetailInfoPage,cu as CDetailSearchAiBar,Hi as CDetailSectionCard,Lt as CDialog,Rt as CDivider,Yh as CFileUpload,DT as CFilterField,Op as CFishboneChart,Bp as CGoogleMapChart,zp as CGraphCharts,Np as CGraphKpiCards,Ti as CGraphReport,Lp as CHeatmapChart,ie as CIconButton,UA as CKanbanBoard,gu as CKanbanBucket,Sl as CKanbanCard,Zp as CLayoutManagement,gn as CLayoutManager,Ap as CLineChart,xT as CList,wT as CListItem,IT as CListItemAvatar,ST as CListItemButton,kT as CListItemIcon,PT as CListItemText,TT as CListSubheader,Qt as CMenu,Yn as CMessageBox,fs as CMetricChartCard,mi as CPageLayout,xV as CPageTransition,Ne as CPaper,Si as CPieChart,sO as CPivotTable,zg as CPlanningGantt,aV as CPlanningLayout,Us as CPopover,Wn as CProgress,Ch as CRadioGroup,$n as CSegmentedControl,zt as CSelect,Ih as CSkeleton,$o as CSmartFilter,gD as CSmartTable,Zo as CSpinner,se as CStack,xD as CStandardPage,vT as CStatusBadge,Wa as CSwitch,er as CTable,cD as CTableBody,dD as CTableCell,pD as CTableContainer,uD as CTableHead,mD as CTableRow,Gh as CTabs,Vn as CTextArea,He as CTextField,ct as CTooltip,fV as CTreeComp,E as CTypography,wp as CValueHelp,Di as CVariantManagement,Gp as CVariantManager,zl as CVoiceWaveOverlay,Fp as CWaterfallChart,Vs as Calendar,Xw as CalendarDays,Zw as Camera,Yw as ChartNoAxesCombined,xo as Check,Ma as CheckCircle,Bo as ChevronDown,Ra as ChevronLeft,Ho as ChevronRight,Qw as ChevronUp,jw as ChevronsDown,Jw as ChevronsUp,Da as CircleAlert,On as CircleCheck,e0 as CircleCheckBig,Ws as CircleStop,Nc as Clipboard,t0 as ClipboardCheck,o0 as ClipboardList,Ac as Clock,sa as CodeBlock,r0 as Columns3,Uz as CopilotChat,No as Copy,n0 as CopyPlus,a0 as Delete,Fn as Download,Ec as Edit,Lc as Expand,i0 as Eye,s0 as EyeOff,Na as File,Oc as FileText,l0 as Filter,Bz as FloatingAgentPanel,Bn as FolderTree,Fc as GitBranch,mT as GlobalMessage,Hn as Globe,Bc as Grid,c0 as GripVertical,d0 as Hammer,Hc as Image,Aa as Info,Yl as InputArea,p0 as Languages,u0 as Layers,m0 as LayoutDashboard,Ea as Lightbulb,zc as LineChart,Vc as Loader2,La as Lock,g0 as LockKeyhole,Wc as LogOut,hs as METRIC_CHART_TYPES,$s as Mail,$c as MapPin,da as MarkdownRenderer,la as MathBlock,_c as Menu,hl as MermaidBlock,rh as MessageCircle,Gc as MessageSquare,Oa as Mic,h0 as MicOff,Uc as Moon,f0 as MoreHorizontal,pd as NavigationIsland,Qs as NavigationIsland2,Vx as OMPHApprovalCard,Pz as OMPHPanel,Kn as ORBCAFE_I18N_MESSAGES,Kg as ORB_DARK,kw as ORB_FONT_STACK,Ug as ORB_LIGHT,Tw as ORB_RADIUS,Bs as ORB_TOKENS,Iw as ORB_TRANSITION_FAST,Ua as OrbcafeI18nProvider,Ln as OrbisModeProvider,wV as PAGE_TRANSITION_PRESETS,LF as PAppPageLayout,PO as PBarcodeScanner,cm as PNavIsland,VO as PNumericKeypad,nm as PSmartFilter,my as PTable,AO as PTouchCard,am as PWorkloadNav,b0 as PackageCheck,v0 as PackageSearch,Fa as PanelLeftOpen,Ba as PanelRight,y0 as PanelsTopLeft,Kc as PieChart,Qr as Pin,Zu as PivotChartPanel,C0 as Play,jr as Plus,x0 as QrCode,w0 as ReceiptText,Ha as RefreshCw,S0 as Rocket,k0 as RotateCcw,qc as RotateCw,P0 as Rows3,Pt as SapIcon,T0 as Save,I0 as ScanLine,zo as Search,nh as Send,Xc as SendHorizontal,Jr as Settings,M0 as ShieldCheck,R0 as Sigma,D0 as SortAsc,N0 as SquareSplitHorizontal,A0 as Star,zm as StdChat,Zc as Sun,E0 as Table2,bl as TableBlock,L0 as TabletSmartphone,zn as Terminal,Fi as ThinkBlock,Yc as ThumbsDown,Qc as ThumbsUp,jc as Trash2,qn as TreeMenu,O0 as TreePine,Jc as TrendingDown,za as TriangleAlert,F0 as Truck,ed as UploadCloud,_s as User,UF as VoiceNavigatorProvider,zF as VoiceWaveOverlay,td as Volume2,B0 as Warehouse,H0 as Workflow,Kt as X,Va as XCircle,hu as addKanbanBucket,ki as buildAmapEmbedUrl,oa as buildGoogleMapEmbedUrl,aR as buildGoogleMapIframe,tf as buttonVariants,bu as createKanbanBoardModel,ae as createSapIcon,Go as findKanbanCard,aT as message,ir as messageManager,Wi as moveKanbanCard,nc as omphApprovalLabelsFromI18n,rc as omphLabelsFromI18n,tt as orbAlpha,Pw as orbChartSeries,Oi as parseMarkdownTable,Jl as parseOmphFileHref,fu as renameKanbanBucket,_N as renderMarkdown,Ei as resolveVariantFilters,Li as resolveVariantLayout,Sy as useAINav,cN as useAmapEmbedUrl,c5 as useAuthPage,eN as useCardPage,pu as useDetailInfo,lN as useGoogleMapEmbedUrl,rN as useGraphChartData,Mi as useGraphInteraction,pn as useGraphReport,YA as useKanbanBoard,Do as useMediaQuery,bd as useNavigationIsland,go as useOrbMode,Hs as useOrbTokens,ce as useOrbcafeI18n,fO as usePadLayout,yO as usePadRecordEditor,ku as usePageLayout,uO as usePivotTable,Eg as usePlanningGantt,T5 as usePlanningLayout,ID as useStandardReport,Cn as useVoiceInput,KF as useVoiceNavigator};
53
+ `,R5=({active:t=false,colors:o=bw,zIndex:r=2147483e3})=>{let n={"--orbcafe-ai-glow-line":o[0],"--orbcafe-ai-glow-z-index":r};return g(e,{children:[f("style",{children:vw}),f("div",{className:"orbcafe-ai-browser-glow","data-active":t?"true":"false",style:n,"aria-hidden":"true"})]})};var U5=({defaultMode:t="login",onLogin:o,onRegister:r,onForgotPassword:n}={})=>{let[a,i]=useState(t),[s,c]=useState(false),u=useCallback(async p=>{c(true);try{await p?.();}finally{c(false);}},[]),d=useCallback(p=>u(()=>o?.(p)),[o,u]),m=useCallback(p=>u(()=>r?.(p)),[r,u]),h=useCallback(p=>u(()=>n?.(p)),[n,u]),f=useMemo(()=>({mode:a,loading:s,onModeChange:i,onLogin:d,onRegister:m,onForgotPassword:h}),[h,d,m,s,a]);return {mode:a,loading:s,setMode:i,authPageProps:f}};var xw={productName:"ORBCAFE \u2014 Enterprise suite",headline:"We digitalize you.",subheadline:"One sign-in for planning, production and analytics across your value chain.",brandMeta:"ORBCAFE \xB7 Enterprise manufacturing suite",loginTitle:"Sign in",loginSubtitle:"Use your corporate account to continue.",registerTitle:"Create account",registerSubtitle:"Request a demo workspace user for evaluation.",forgotTitle:"Reset password",forgotSubtitle:"Send a password reset request to your email address."},eV=({mode:t,defaultMode:o="login",onModeChange:r,onLogin:n,onRegister:a,onForgotPassword:i,loading:s=false,logo:c,copy:u,sx:d})=>{let m=t!==void 0,[h,f$1]=useState(o),p=t??h,v=useMemo(()=>({...xw,...u}),[u]),[C,g$1]=useState({username:"demo@orbcafe.local",password:"orbcafe-demo",remember:true}),[x,y]=useState({name:"",email:"",password:"",confirmPassword:"",acceptedTerms:false}),[b,k]=useState({email:""}),[w,T]=useState(""),I=A=>{m||f$1(A),T(""),r?.(A);},S=async A=>{A.preventDefault(),await n?.(C),T("Demo login accepted. No real authentication request was sent.");},D=async A=>{A.preventDefault(),await a?.(x),T("Demo registration saved locally for this screen.");},R=async A=>{A.preventDefault(),await i?.(b),T("Demo reset link request created. No email was sent.");},M=p==="login"?v.loginTitle:p==="register"?v.registerTitle:v.forgotTitle,P=p==="login"?v.loginSubtitle:p==="register"?v.registerSubtitle:v.forgotSubtitle;return g("div",{className:"orb-auth-frame orb-root",style:d,children:[g("div",{className:"orb-auth-brand",children:[f("span",{className:"orb-auth-dia",style:{width:230,height:230,right:-70,bottom:-60}}),f("span",{className:"orb-auth-dia orb-auth-dia-sm-hide",style:{width:140,height:140,right:120,bottom:80,borderColor:"rgba(255,255,255,.09)"}}),f("span",{className:"orb-auth-dia orb-auth-dia-sm-hide",style:{width:76,height:76,right:60,bottom:170,background:"color-mix(in oklch, var(--orb-primary) 35%, transparent)",borderColor:"rgba(255,255,255,.2)"}}),c?f("span",{style:{alignSelf:"flex-start",position:"relative"},children:c}):f("span",{className:"orb-logo-slot",children:"Host logo"}),g("div",{className:"orb-auth-claim",children:[f("div",{className:"orb-auth-rule"}),f("h2",{children:v.headline}),f("p",{children:v.subheadline})]}),f("div",{className:"orb-auth-meta",children:v.brandMeta})]}),f("div",{className:"orb-auth-form",children:g("div",{className:"orb-auth-card",children:[f("span",{className:"orb-overline",style:{letterSpacing:"0.12em"},children:v.productName}),f("h1",{className:"orb-h2",style:{margin:0},children:M}),f("p",{className:"orb-body-dense",style:{color:"var(--orb-muted)",margin:"-10px 0 0"},children:P}),w&&f(on,{severity:"success",children:w}),p==="login"&&g("form",{onSubmit:S,style:{display:"flex",flexDirection:"column",gap:16},children:[f(We,{label:"Email",type:"email",autoComplete:"username",value:C.username,onChange:A=>g$1(L=>({...L,username:A.target.value})),startAdornment:f(Qs,{size:15,strokeWidth:1.8})}),f(We,{label:"Password",type:"password",autoComplete:"current-password",value:C.password,onChange:A=>g$1(L=>({...L,password:A.target.value})),startAdornment:f(za,{size:15,strokeWidth:1.8})}),g("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},children:[f(Tt,{label:"Remember me",checked:C.remember,onChange:A=>g$1(L=>({...L,remember:A.target.checked}))}),f("button",{type:"button",className:"orb-link",onClick:()=>I("forgot"),children:"Forgot password?"})]}),f(Me,{type:"submit",size:"large",block:true,loading:s,children:s?"Signing in\u2026":"Sign in"}),g("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["New user?"," ",f("button",{type:"button",className:"orb-link",onClick:()=>I("register"),children:"Register"})]})]}),p==="register"&&g("form",{onSubmit:D,style:{display:"flex",flexDirection:"column",gap:16},children:[f(We,{label:"Full name",value:x.name,onChange:A=>y(L=>({...L,name:A.target.value})),startAdornment:f(Qs,{size:15,strokeWidth:1.8})}),f(We,{label:"Work email",type:"email",autoComplete:"username",value:x.email,onChange:A=>y(L=>({...L,email:A.target.value})),startAdornment:f(Ys,{size:15,strokeWidth:1.8})}),f(We,{label:"Password",type:"password",autoComplete:"new-password",value:x.password,onChange:A=>y(L=>({...L,password:A.target.value})),startAdornment:f(za,{size:15,strokeWidth:1.8})}),f(We,{label:"Confirm password",type:"password",autoComplete:"new-password",value:x.confirmPassword,onChange:A=>y(L=>({...L,confirmPassword:A.target.value}))}),f(Tt,{label:"I accept the demo workspace terms",checked:x.acceptedTerms,onChange:A=>y(L=>({...L,acceptedTerms:A.target.checked}))}),f(Me,{type:"submit",size:"large",block:true,loading:s,children:"Create demo account"}),g("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["Already have an account?"," ",f("button",{type:"button",className:"orb-link",onClick:()=>I("login"),children:"Sign in"})]})]}),p==="forgot"&&g("form",{onSubmit:R,style:{display:"flex",flexDirection:"column",gap:16},children:[f(We,{label:"Work email",type:"email",autoComplete:"username",value:b.email,onChange:A=>k({email:A.target.value}),startAdornment:f(Ys,{size:15,strokeWidth:1.8})}),f(Me,{type:"submit",size:"large",block:true,loading:s,children:"Send reset request"}),g("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["Remember your password?"," ",f("button",{type:"button",className:"orb-link",onClick:()=>I("login"),children:"Back to sign in"})]})]}),g("div",{style:{display:"flex",alignItems:"center",gap:12,font:"500 10px/1 var(--orb-font)",letterSpacing:"0.1em",textTransform:"uppercase",color:"var(--orb-muted)"},children:[f("span",{style:{flex:1,height:1,background:"var(--orb-border)"}}),"or",f("span",{style:{flex:1,height:1,background:"var(--orb-border)"}})]}),f(Me,{variant:"neutral",size:"large",block:true,children:"Continue with corporate SSO"}),g("p",{className:"orb-meta",style:{textAlign:"center",fontWeight:300,margin:0},children:["Protected by corporate single sign-on.",f("br",{}),"Demo credentials: demo@orbcafe.local / orbcafe-demo"]})]})})]})};var Sw={keyword:{value:"",operator:"contains"},status:{value:"",operator:"equals"},owner:{value:"",operator:"contains"},workCenter:{value:"",operator:"contains"}},kw=[{id:"keyword",label:"Keyword",type:"text",placeholder:"Task/ID/Project",hasSearchIcon:true},{id:"status",label:"Status",type:"select",options:[{label:"In progress",value:"in-progress"},{label:"Blocked",value:"blocked"},{label:"Planned",value:"planned"},{label:"Not started",value:"not-started"}]},{id:"owner",label:"Owner",type:"text",placeholder:"Owner name"},{id:"workCenter",label:"Work Center",type:"text",placeholder:"CNC-02 / WH-A / ..."},{id:"dateRange",label:"Date Range",type:"date"}],Gg=({tasks:t,appId:o,tableKey:r,defaultScale:n="week",defaultSelectedTaskId:a,initialFilters:i,filterFields:s,filterAppId:c,filterTableKey:u,serviceUrl:d,variantService:m,layout:h,columns:f,page:p,rowsPerPage:v,rowsPerPageOptions:C,count:g,onPageChange:x,onRowsPerPageChange:y,onFilterSearch:b,onFilterVariantLoad:k,enableRowReorder:w,onTaskReorder:T,onLayoutIdChange:I,onLayoutSave:S})=>{let D=o??c??"planning-gantt",R=r??u??"planning",[M,P]=useState(n),[A,L]=useState(a??t[0]?.id??""),[W,j]=useState(""),[O,_]=useState(null),[z,Y]=useState({...Sw,...i}),H=useMemo(()=>{let fe=String(z.keyword?.value??"").trim().toLowerCase(),Ce=String(z.status?.value??"").trim(),$=String(z.owner?.value??"").trim().toLowerCase(),J=String(z.workCenter?.value??"").trim().toLowerCase(),ae=z.dateRange?.value,xe=ae?.[0]?nr(ae[0]):null,pe=ae?.[1]?nr(ae[1]):null;return t.filter(me=>{if(fe&&![me.id,me.code,me.title,me.project,me.workCenter,me.owner?.name].join(" ").toLowerCase().includes(fe)||Ce&&me.status!==Ce||$&&!String(me.owner?.name??"").toLowerCase().includes($)||J&&!String(me.workCenter??"").toLowerCase().includes(J))return false;if(xe||pe){let Ee=nr(me.startDate),Ge=nr(me.endDate),nt=xe?Ge.isAfter(xe)||Ge.isSame(xe,"day"):true,it=pe?Ee.isBefore(pe)||Ee.isSame(pe,"day"):true;if(!nt||!it)return false}return true})},[z,t]);useEffect(()=>{H.length!==0&&(H.some(fe=>fe.id===A)||L(H[0].id));},[H,A]);let B=useCallback(fe=>{L(fe.id);},[]),q=useCallback(fe=>{j(fe),I?.(fe);},[I]),Z=useCallback(fe=>{_(Ce=>({key:(Ce?.key??0)+1,variant:fe})),k?.(fe);},[k]),ue=useMemo(()=>({appId:D,tableKey:R,fields:s??kw,filters:z,onFilterChange:Y,onVariantLoad:Z,onSearch:b??(()=>{}),currentLayoutId:W,layoutRefs:[{tableKey:R,layoutId:W||null}],variantService:m,serviceUrl:d}),[W,s,z,Z,b,D,R,d,m]),ne=useMemo(()=>({appId:D,tableKey:R,serviceUrl:d,tasks:H,columns:f,scale:M,onScaleChange:P,page:p,rowsPerPage:v,rowsPerPageOptions:C,count:g,onPageChange:x,onRowsPerPageChange:y,selectedTaskId:A,onTaskSelect:B,enableRowReorder:w,onTaskReorder:T,layout:h,layoutVariant:O?.variant,layoutVariantLoadKey:O?.key,onLayoutIdChange:q,onLayoutSave:S}),[f,g,w,H,q,h,O?.key,O?.variant,x,y,S,T,B,p,D,R,v,C,M,d,A]);return {scale:M,setScale:P,selectedTaskId:A,setSelectedTaskId:L,filters:z,setFilters:Y,filteredTasks:H,smartFilterProps:ue,planningGanttProps:ne}};var lV=t=>{let o=Gg(t),r=useMemo(()=>({filterProps:o.smartFilterProps,ganttProps:o.planningGanttProps}),[o.planningGanttProps,o.smartFilterProps]);return {...o,layoutProps:r}};nr.extend(Tw);var yc=[{value:"hour",label:"Hour",width:56},{value:"day",label:"Day",width:46},{value:"week",label:"Week",width:78},{value:"month",label:"Month",width:104}],Cc=36,xc=58,Da=8,wc=260,Ew=320,Gr="220ms cubic-bezier(0.2, 0, 0, 1)",Ug={"not-started":{label:"Not started",color:"default"},planned:{label:"Planned",color:"info"},"in-progress":{label:"In progress",color:"primary"},blocked:{label:"Blocked",color:"error"},done:{label:"Done",color:"success"}},Lw=t=>t?Ug[t]?.label??t:"Planned",Ow=t=>t?Ug[t]?.color??"default":"info",Kg=t=>Math.min(100,Math.max(0,t??0)),qg=(t,o=0)=>t.flatMap(r=>[{...r,level:o},...qg(r.children??[],o+1)]),Fw=t=>({id:t.id,code:t.code??t.id,title:t.title,titleSub:t.project??t.workCenter??"General",project:t.project??"",workCenter:t.workCenter??"",owner:t.owner?.name??"Unassigned",status:Lw(t.status),statusTone:t.status??"planned",progress:Kg(t.progress),startDate:t.startDate,endDate:t.endDate,color:t.color,reorderable:t.reorderable!==false}),Xg=(t,o)=>o==="month"?t.startOf("month"):o==="week"?t.startOf("week"):o==="day"?t.startOf("day"):t.startOf("hour"),Zg=(t,o)=>o==="month"?t.endOf("month"):o==="week"?t.endOf("week"):o==="day"?t.endOf("day"):t.endOf("hour"),Bw=(t,o,r)=>{let n=[],a=Xg(t,r),i=Zg(o,r);for(;a.isBefore(i)||a.isSame(i);){let s=r==="month"?a.add(1,"month"):r==="week"?a.add(1,"week"):r==="day"?a.add(1,"day"):a.add(1,"hour");n.push({key:`${r}-${a.valueOf()}`,label:r==="month"?a.format("MMM YYYY"):r==="week"?a.format("MMM D"):r==="day"?a.format("D"):a.format("HH:mm"),contextLabel:r==="hour"?a.format("MMM D"):r==="day"?a.format("MMM"):r==="week"?`W${a.isoWeek()}`:void 0,title:r==="hour"?a.format("MMM D, YYYY HH:mm"):r==="day"?a.format("MMM D, YYYY"):r==="week"?`${a.format("MMM D, YYYY")} - Week ${a.isoWeek()}`:void 0,start:a,end:s}),a=s;}return n},Sc=(t,o,r)=>{let n=0;for(let a of o){if(t.isBefore(a.start))return n;if(t.isBefore(a.end)){let i=Math.max(1,a.end.valueOf()-a.start.valueOf()),s=Math.max(0,t.valueOf()-a.start.valueOf());return n+s/i*r}n+=r;}return n},Yg=({appId:t="planning-gantt",tableKey:o="planning",serviceUrl:r,title:n="Project Plan",extraTools:a,bodyHeight:i=560,tasks:s,columns:c,scale:u="week",onScaleChange:d,page:m,rowsPerPage:h=20,rowsPerPageOptions:f$1=[20,50,100,-1],count:p,onPageChange:v,onRowsPerPageChange:C,timelineStart:g$1,timelineEnd:x,selectedTaskId:y,onTaskSelect:b$1,enableRowReorder:k=true,onTaskReorder:w,layout:T,layoutVariant:I,layoutVariantLoadKey:S,onLayoutIdChange:D,onLayoutSave:R,emptyLabel:M="No planning tasks available.",sx:P})=>{let A=io(),{t:L}=de(),W=useRef(null),j=useRef(null),O=useRef(null),_=useRef(false),[z,Y]=useState(null),[H,B]=useState("content"),[q,Z]=useState(null),[ue,ne]=useState(0),[fe,Ce]=useState({}),[$,J]=useState(Cc),[ae,xe]=useState([]),pe=useRef(void 0),[me,Ee]=useState({activeId:null,overId:null}),[Ge,nt]=useState(null),[it,K]=useState(false),De=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:4}})),ke=useRef(null),He=useMemo(()=>qg(s),[s]),at=useMemo(()=>{if(ae.length===0)return He;let F=new Map(He.map(Ie=>[Ie.id,Ie])),ee=ae.map(Ie=>F.get(Ie)).filter(Ie=>!!Ie),ve=new Set(ee.map(Ie=>Ie.id));return [...ee,...He.filter(Ie=>!ve.has(Ie.id))]},[He,ae]),Ye=useMemo(()=>new Map(at.map(F=>[F.id,F])),[at]),xt=useMemo(()=>at.map(F=>Fw(F)),[at]),Mt=useMemo(()=>new Map(xt.map(F=>[F.id,F])),[xt]),Ot=useMemo(()=>[{id:"code",label:"ID",minWidth:90},{id:"title",label:"Task",minWidth:260,render:(F,ee)=>g(ce,{spacing:.2,children:[f(E,{sx:{fontSize:15,fontWeight:700,lineHeight:1.2},children:ee.title}),f(E,{sx:{fontSize:13,color:"text.secondary"},children:ee.titleSub})]})},{id:"owner",label:"Owner",minWidth:170},{id:"status",label:"Status",minWidth:130,render:(F,ee)=>f(Ct,{label:ee.status,color:Ow(ee.statusTone),size:"small"})},{id:"progress",label:"Progress",minWidth:140,numeric:true,render:F=>g(ce,{spacing:.6,children:[g(E,{variant:"caption",sx:{color:"text.secondary"},children:[F,"%"]}),f(_n,{variant:"determinate",value:F,sx:{height:6,borderRadius:999}})]})},{id:"startDate",label:"Start",minWidth:120},{id:"endDate",label:"End",minWidth:120}],[]),At=useMemo(()=>{if(!c||c.length===0)return Ot;let F=new Map(Ot.map(ee=>[ee.id,ee]));return c.map(ee=>{let ve=F.get(ee.id),Ie=ee.width??ve?.minWidth??120,et={id:ee.id,label:ee.label,minWidth:Ie};if(ve?.numeric&&(et.numeric=true),ee.render){let Xe=ee.render;return et.render=(St,ht)=>{let mt=Ye.get(ht.id);return Xe(mt||ht)},et}return ve?.render?(et.render=ve.render,et):(et.render=(Xe,St)=>{let ht=St[ee.id];if(ht!=null&&String(ht).length>0)return String(ht);let yt=Ye.get(St.id)?.[ee.id];return yt!=null&&String(yt).length>0?String(yt):"-"},et)})},[c,Ot,Ye]),re=fn({appId:t,tableKey:o,title:n,columns:At,rows:xt,rowKey:"id",page:m,rowsPerPage:h,rowsPerPageOptions:f$1,count:p??xt.length,onPageChange:v,onRowsPerPageChange:C,showSummary:false,layout:T,onLayoutSave:R}),Ue=t?f(hn,{appId:t,tableKey:o,currentLayoutData:re.currentLayoutData,onLayoutLoad:re.handleLayoutLoad,targetLayoutId:re.layoutIdToLoad,activeLayoutId:re.currentLayoutId,serviceUrl:r}):null,Be=re.visibleRows;useEffect(()=>{let F=He.map(ee=>ee.id);xe(ee=>{let ve=new Set(F),Ie=ee.filter(ht=>ve.has(ht)),et=new Set(Ie),Xe=F.filter(ht=>!et.has(ht)),St=[...Ie,...Xe];return St.length===ee.length&&St.every((ht,mt)=>ht===ee[mt])?ee:St});},[He]),useEffect(()=>{S===void 0||!I||pe.current!==S&&(pe.current=S,re.handleVariantLoad(I));},[re,I,S]),useEffect(()=>{D?.(re.currentLayoutId);},[re.currentLayoutId,D]);let ge=F=>F.type==="group"?`group-${F.id}`:`row-${(F.data||F)?.id}`,Se=useMemo(()=>{let F=xt.map(mt=>nr(mt.startDate)),ee=xt.map(mt=>nr(mt.endDate)),ve=g$1?nr(g$1):F.reduce((mt,yt)=>yt.isBefore(mt)?yt:mt,F[0]??nr()),Ie=x?nr(x):ee.reduce((mt,yt)=>yt.isAfter(mt)?yt:mt,ee[0]??nr().add(30,"day")),et=u==="month"?"month":u==="week"?"week":u==="day"?"day":"hour",Xe=u==="month"?"month":u==="week"?"week":u==="day"?"day":"hour",St=u==="hour"?12:1,ht=u==="hour"?12:1;return {start:Xg(ve.subtract(St,et),u),end:Zg(Ie.add(ht,Xe),u)}},[xt,u,x,g$1]),oe=yc.find(F=>F.value===u)??yc[1],we=Array.isArray(a)?a:a?[a]:[],Ae=useMemo(()=>Bw(Se.start,Se.end,u),[Se.end,Se.start,u]),Je=Ae.length*oe.width,st=Ae.length>0?100/Ae.length:100,pt=Ae.length>0?`repeat(${Ae.length}, minmax(${oe.width}px, 1fr))`:"1fr",Bt=Ae.length>0?`calc(100% / ${Ae.length}) 100%`:"100% 100%",Xt=(re.columns||[]).filter(F=>re.visibleColumns.includes(F.id)).reduce((F,ee)=>F+(re.columnWidths?.[ee.id]||ee.minWidth||100),0)+(re.grouping.length>0?72:0),Vt=H==="manual"&&z!==null?z:Xt,wt=q==="table",Wt=q==="timeline",ft=q==="timeline",Dt=q==="table",lt=!ft&&!Dt,Ft=()=>{let F=ue||W.current?.clientWidth||0;return F>0?Math.max(wc,F-Da-Ew):Math.max(wc,Xt)},Zt=F=>Math.min(Math.max(F,wc),Ft()),V=(()=>{if(ue<=0)return null;let F=lt?Da:0;if(wt)return {tableWidth:ue,splitterWidth:F,timelineWidth:0};if(Wt)return {tableWidth:0,splitterWidth:F,timelineWidth:ue};if(H==="even"){let ve=Math.max(0,(ue-F)/2);return {tableWidth:ve,splitterWidth:F,timelineWidth:Math.max(0,ue-F-ve)}}let ee=Zt(Vt);return {tableWidth:ee,splitterWidth:F,timelineWidth:Math.max(0,ue-F-ee)}})(),Q=V?`${V.tableWidth}px ${V.splitterWidth}px ${V.timelineWidth}px`:wt?"minmax(0, 1fr) 0px 0px":Wt?"0px 0px minmax(0, 1fr)":H==="even"?`minmax(0, 1fr) ${Da}px minmax(0, 1fr)`:`${Vt}px ${Da}px minmax(0, 1fr)`;useEffect(()=>{H==="manual"&&Y(F=>F===null?null:Zt(F));},[H,Xt,ue]);let ye=F=>{F.preventDefault(),F.currentTarget.setPointerCapture(F.pointerId),Z(null),B("manual"),ke.current={startX:F.clientX,startWidth:j.current?.getBoundingClientRect().width??Vt};let ee=Ie=>{let et=ke.current;if(!et)return;let Xe=Zt(et.startWidth+Ie.clientX-et.startX);Y(Xe);},ve=()=>{ke.current=null,window.removeEventListener("pointermove",ee),window.removeEventListener("pointerup",ve),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",ee),window.addEventListener("pointerup",ve);},Pe=()=>{Z(null),B("even"),Y(null);},Oe=F=>!k||!F?false:Mt.get(F)?.reorderable!==false,$e=(F,ee)=>{if(!F||!ee||F===ee||!Oe(F)||!Oe(ee))return false;if(re.grouping.length===0)return true;let ve=Mt.get(F),Ie=Mt.get(ee);return !ve||!Ie?false:re.grouping.every(et=>ve[et]===Ie[et])},qe=(F,ee)=>{if(!$e(F,ee))return;let ve=Be.filter(Et=>Et.type!=="group").map(Et=>String((Et.data||Et)?.id)),Ie=ve.indexOf(F),et=ve.indexOf(ee);if(Ie<0||et<0)return;let Xe=[...ve];[Xe[Ie],Xe[et]]=[Xe[et],Xe[Ie]];let St=new Set(ve),ht=at.map(Et=>Et.id),mt=[...Xe,...ht.filter(Et=>!St.has(Et))],yt=Ye.get(F),ro=Ye.get(ee);if(re.setOrder("asc"),re.setOrderBy(""),xe(mt),yt&&ro){let{level:Et,...Yt}=yt,{level:Ht,...Ut}=ro,$t=mt.reduce((to,no)=>{let vo=Ye.get(no);if(vo){let{level:No,...Do}=vo;to.push(Do);}return to},[]);w?.($t,{activeTask:Yt,targetTask:Ut});}},Qe=(F,ee)=>{if(!Oe(ee.id)){F.preventDefault();return}F.stopPropagation(),F.dataTransfer.effectAllowed="move",F.dataTransfer.setData("text/plain",ee.id),Ee({activeId:ee.id,overId:null}),b$1?.(Ye.get(ee.id)||ee);},ut=(F,ee)=>{if(!$e(me.activeId,ee)){Ee(ve=>ve.overId===null?ve:{...ve,overId:null});return}F.preventDefault(),F.stopPropagation(),F.dataTransfer.dropEffect="move",Ee(ve=>ve.overId===ee?ve:{...ve,overId:ee});},gt=(F,ee)=>{let ve=me.activeId||F.dataTransfer.getData("text/plain");if(!$e(ve,ee)){Ee({activeId:null,overId:null});return}F.preventDefault(),F.stopPropagation(),qe(ve,ee),Ee({activeId:null,overId:null});},It=()=>{Ee({activeId:null,overId:null});},bt=F=>{if(_.current)return;let ee=F==="table"?j.current:O.current,ve=F==="table"?O.current:j.current;!ee||!ve||(_.current=true,ve.scrollTop=ee.scrollTop,window.requestAnimationFrame(()=>{_.current=false;}));};return useLayoutEffect(()=>{let F=W.current;if(!F){ne(0);return}let ee=0,ve=()=>{window.cancelAnimationFrame(ee),ee=window.requestAnimationFrame(()=>{let et=F.clientWidth;ne(Xe=>Math.abs(Xe-et)<.5?Xe:et);});};if(ve(),typeof ResizeObserver>"u")return window.addEventListener("resize",ve),()=>{window.cancelAnimationFrame(ee),window.removeEventListener("resize",ve);};let Ie=new ResizeObserver(ve);return Ie.observe(F),window.addEventListener("resize",ve),()=>{window.cancelAnimationFrame(ee),Ie.disconnect(),window.removeEventListener("resize",ve);}},[xt.length]),useLayoutEffect(()=>{if(!y||Dt)return;let F=O.current,ee=j.current;if(!F)return;let ve=`row-${y}`,Ie=Array.from(F.querySelectorAll("[data-planning-timeline-row-key]")).find(St=>St.dataset.planningTimelineRowKey===ve),et=Mt.get(y);if(!Ie||!et)return;let Xe=window.requestAnimationFrame(()=>{let St=F.getBoundingClientRect(),ht=Ie.getBoundingClientRect(),mt=Math.max(1,F.clientHeight-$),yt=F.scrollTop+ht.top-St.top-$-(mt-ht.height)/2;_.current=true,F.scrollTop=Math.max(0,yt),ee&&!ft&&(ee.scrollTop=F.scrollTop);let ro=Math.max(1,F.scrollWidth),Et=Ae.length>0?ro/Ae.length:oe.width,Yt=Sc(nr(et.startDate),Ae,Et),Ht=Math.max(0,Yt-Et);F.scrollLeft=Math.min(Ht,Math.max(0,ro-F.clientWidth)),window.requestAnimationFrame(()=>{_.current=false;});});return ()=>window.cancelAnimationFrame(Xe)},[oe.width,$,y,ft,Mt,Dt,Be,Ae]),useLayoutEffect(()=>{let F=j.current;if(!F)return;let ee=0,ve=0,Ie=false,et=()=>{if(Ie)return;let Ht=F.querySelector("thead"),Ut=Array.from(F.querySelectorAll("tbody tr[data-ctable-row-key]"));if(Ut.length===0)return;let $t=Ht?.getBoundingClientRect().height||Cc,to={};Ut.forEach(no=>{let vo=no.dataset.ctableRowKey;vo&&(to[vo]=no.getBoundingClientRect().height);}),J(no=>Math.abs(no-$t)<.01?no:$t),Ce(no=>{let vo=Object.keys(no),No=Object.keys(to);return vo.length===No.length&&No.every(Do=>Math.abs((no[Do]??0)-to[Do])<.01)?no:to});},Xe=()=>{window.cancelAnimationFrame(ee),ee=window.requestAnimationFrame(et);};if(et(),window.cancelAnimationFrame(ve),ve=window.requestAnimationFrame(()=>{ve=window.requestAnimationFrame(et);}),typeof document<"u"&&document.fonts?.ready&&document.fonts.ready.then(()=>{Ie||Xe();}).catch(()=>{}),typeof ResizeObserver>"u")return window.addEventListener("resize",Xe),()=>{Ie=true,window.cancelAnimationFrame(ee),window.cancelAnimationFrame(ve),window.removeEventListener("resize",Xe);};let St=new ResizeObserver(Xe),ht=F.querySelector("table"),mt=F.querySelector("tbody"),yt=F.querySelector("thead");ht&&St.observe(ht),yt&&St.observe(yt);let ro=new WeakSet,Et=()=>{F.querySelectorAll("tbody tr[data-ctable-row-key]").forEach(Ht=>{ro.has(Ht)||(St.observe(Ht),ro.add(Ht));});};Et();let Yt=null;return mt&&typeof MutationObserver<"u"&&(Yt=new MutationObserver(()=>{Et(),Xe();}),Yt.observe(mt,{childList:true,subtree:true,characterData:true})),window.addEventListener("resize",Xe),()=>{Ie=true,window.cancelAnimationFrame(ee),window.cancelAnimationFrame(ve),St.disconnect(),Yt?.disconnect(),window.removeEventListener("resize",Xe);}},[Be,re.visibleColumns,re.grouping,re.columnWidths]),g(Le,{className:"orb-ctable-surface orb-planning-gantt",elevation:0,sx:{m:0,p:0,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden",borderRadius:"var(--orb-r-container)",border:`1px solid ${A.palette.divider}`,...P},children:[f("div",{className:"orb-table-toolbar orb-planning-table-toolbar",role:"toolbar","aria-label":L("table.title.default"),children:g("div",{className:"orb-table-toolbar-primary",children:[f(Ci,{value:re.filterText,onChange:F=>{re.setFilterText(F),re.setPage(0);}}),f(yi,{rowsPerPage:re.rowsPerPage,rowsPerPageOptions:f$1,page:re.page,count:re.totalDisplayCount,onRowsPerPageChange:re.setRowsPerPage,onPageChange:re.setPage}),we.length>0&&f("div",{className:"orb-table-toolbar-custom",children:we.map((F,ee)=>f("div",{className:"orb-planning-extra-tool",children:F},`planning-extra-tool-${ee}`))}),f("span",{className:"orb-table-toolbar-spacer"}),g("div",{className:"orb-table-toolbar-actions",children:[g("div",{className:"orb-table-tool-group",children:[f(le,{className:"orb-table-tool-button",tooltip:"Column visibility",onClick:F=>re.setAnchorEl(F.currentTarget),sx:uo,children:f(sn,{fontSize:"small"})}),f(le,{className:"orb-table-tool-button",tooltip:"Group by",onClick:F=>re.setGroupAnchorEl(F.currentTarget),sx:uo,children:f(xr,{fontSize:"small"})}),f(le,{className:`orb-table-tool-button ${re.sortBy.length>0||re.orderBy?"orb-is-active":""}`,tooltip:"Sort by...",active:re.sortBy.length>0||!!re.orderBy,onClick:()=>K(true),sx:uo,children:f(bp,{fontSize:"small"})})]}),Ue&&f("div",{className:"orb-table-tool-group",children:Ue}),f("div",{className:"orb-table-tool-group orb-planning-pane-controls",children:f(Gn,{"aria-label":"Planning pane layout",size:"small",value:q??(H==="even"?"split":null),options:[{value:"table",label:"Expand task table",icon:f(mi,{fontSize:"small"})},{value:"split",label:"Split evenly",icon:f(hi,{fontSize:"small"})},{value:"timeline",label:"Expand timeline",icon:f(ui,{fontSize:"small"})}],onValueChange:F=>{F==="split"?Pe():Z(F);}})}),f("div",{className:"orb-table-tool-group orb-planning-scale-control",children:f(zt,{label:"",value:u,options:yc.map(F=>({value:F.value,label:F.label})),onChange:F=>d?.(F.target.value)})})]})]})}),xt.length===0?f("div",{sx:{minHeight:240,display:"grid",placeItems:"center",color:"text.secondary"},children:M}):f("div",{sx:{overflow:"hidden",flex:1,minHeight:0},children:g("div",{ref:W,sx:{height:"100%",display:"grid",gridTemplateColumns:Q,minWidth:0,transition:`grid-template-columns ${Gr}`},children:[f("div",{"data-planning-scroll-pane":"table",ref:j,onScroll:()=>bt("table"),sx:{width:"100%",minWidth:0,maxWidth:"100%",height:i,overflowX:"auto",overflowY:"auto",opacity:ft?0:1,transform:ft?"translateX(-10px)":"translateX(0)",pointerEvents:ft?"none":"auto",transition:`opacity ${Gr}, transform ${Gr}`},children:f(DndContext,{sensors:De,collisionDetection:closestCenter,modifiers:[restrictToHorizontalAxis],onDragEnd:F=>{let ee=F?.active?.id,ve=F?.over?.id;typeof ee=="string"&&typeof ve=="string"&&re.handleColumnReorder(ee,ve);},children:g("table",{className:"orb-tbl orb-ctable orb-planning-table",sx:{tableLayout:"fixed",width:Xt,"& thead th":{height:Cc,py:0,lineHeight:1.15,boxSizing:"border-box"}},children:[f(Si,{columns:re.columns,visibleColumns:re.visibleColumns,order:re.order,orderBy:re.orderBy,sortBy:re.sortBy,onRequestSort:re.handleRequestSort,onContextMenu:(F,ee)=>{F.preventDefault(),F.stopPropagation(),nt({mouseX:F.clientX+2,mouseY:F.clientY-6,columnId:ee});},grouping:re.grouping,isAllExpanded:re.isAllExpanded,handleToggleAll:re.handleToggleAll,columnWidths:re.columnWidths,onColumnResize:re.handleColumnResize,enableColumnReorder:true}),f(ki,{visibleRows:Be,columns:re.columns,visibleColumns:re.visibleColumns,selected:y?[y]:[],expandedGroups:re.expandedGroups,toggleGroupExpand:re.toggleGroupExpand,handleExpandGroupRecursively:re.handleExpandGroupRecursively,handleCollapseGroupRecursively:re.handleCollapseGroupRecursively,isGroupFullyExpanded:re.isGroupFullyExpanded,grouping:re.grouping,rowKeyProp:"id",page:re.page,rowsPerPage:re.rowsPerPage,emptyLabel:M,handleClick:(F,ee)=>{b$1?.(Ye.get(ee.id)||ee);},getRowDataKey:({entry:F})=>ge(F),getGroupRowProps:()=>({style:{height:xc}}),getRowProps:({data:F})=>{let ee=F,ve=Oe(ee.id),Ie=me.activeId===ee.id,et=me.overId===ee.id&&$e(me.activeId,ee.id);return {draggable:ve,className:et?"orb-is-drop-target":void 0,style:{cursor:Ie?"grabbing":ve?"grab":b$1?"pointer":"default",height:xc,opacity:Ie?.56:1,transition:"background-color 120ms ease, opacity 120ms ease"},onDragStart:Xe=>Qe(Xe,ee),onDragOver:Xe=>ut(Xe,ee.id),onDragEnter:Xe=>ut(Xe,ee.id),onDrop:Xe=>gt(Xe,ee.id),onDragEnd:It}}})]})})}),f("div",{onPointerDown:lt?ye:void 0,role:"separator","aria-orientation":"vertical",sx:{width:lt?Da:0,cursor:lt?"col-resize":"default",opacity:lt?1:0,pointerEvents:lt?"auto":"none",borderLeft:lt?`1px solid ${A.palette.divider}`:"0 solid transparent",borderRight:lt?`1px solid ${A.palette.divider}`:"0 solid transparent",backgroundColor:b()==="dark"?"color-mix(in oklch, var(--orb-muted) 10%, transparent)":"color-mix(in oklch, var(--orb-fg) 4%, transparent)",transition:`width ${Gr}, opacity ${Gr}, background-color 120ms ease`,position:"relative","&:hover":{backgroundColor:A.palette.action.selected},"&::before":{content:'""',position:"absolute",top:0,bottom:0,left:-6,right:-6,cursor:lt?"col-resize":"default"}}}),f("div",{sx:{minWidth:0,overflow:"hidden",opacity:Dt?0:1,transform:Dt?"translateX(10px)":"translateX(0)",pointerEvents:Dt?"none":"auto",transition:`opacity ${Gr}, transform ${Gr}`},children:f("div",{"data-planning-scroll-pane":"timeline",ref:O,onScroll:()=>bt("timeline"),sx:{width:"100%",height:i,overflowX:"auto",overflowY:"auto"},children:g("div",{sx:{width:"100%",minWidth:Je||"100%"},children:[f("div",{className:"orb-planning-timeline-header",sx:{display:"grid",gridTemplateColumns:pt,height:$,boxSizing:"border-box",borderBottom:`1px solid ${A.palette.divider}`,position:"sticky",top:0,zIndex:2},children:Ae.map(F=>g("div",{title:F.title,sx:{px:.75,display:"flex",flexDirection:F.contextLabel?"column":"row",alignItems:"center",justifyContent:"center",gap:F.contextLabel?.15:0,borderRight:`1px solid ${A.palette.divider}`,color:F.contextLabel?"text.primary":"text.secondary",overflow:"hidden"},children:[F.contextLabel&&f(E,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"text.secondary",fontSize:11,fontWeight:700,lineHeight:1.1},children:F.contextLabel}),f(E,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:12,fontWeight:700,lineHeight:1.15},children:F.label})]},F.key))}),f(ce,{sx:{position:"relative"},children:Be.map(F=>{let ee=ge(F),ve=fe[ee]??xc;if(F.type==="group")return f("div",{className:"orb-planning-timeline-row orb-table-group-row","data-planning-timeline-row-key":ee,sx:{position:"relative",height:ve,boxSizing:"border-box",borderBottom:`1px solid ${A.palette.divider}`}},F.id);let Ie=F.data||F,et=nr(Ie.startDate),Xe=nr(Ie.endDate),St=Sc(et,Ae,st),ht=Sc(Xe,Ae,st),mt=Math.max(0,ht-St),yt=Kg(Ie.progress),ro=Ie.id===y,Et=Oe(Ie.id),Yt=me.activeId===Ie.id,Ht=me.overId===Ie.id&&$e(me.activeId,Ie.id),Ut=Ie.color??(Ie.statusTone==="blocked"?A.palette.error.main:A.palette.primary.main);return f("div",{className:`orb-planning-timeline-row ${ro?"orb-is-selected":""}`,"data-planning-timeline-row-key":ee,draggable:Et,onDragStart:$t=>Qe($t,Ie),onDragOver:$t=>ut($t,Ie.id),onDragEnter:$t=>ut($t,Ie.id),onDrop:$t=>gt($t,Ie.id),onDragEnd:It,onClick:()=>b$1?.(Ye.get(Ie.id)||Ie),sx:{position:"relative",height:ve,boxSizing:"border-box",borderBottom:`1px solid ${A.palette.divider}`,opacity:Yt?.56:1,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,height:2,backgroundColor:A.palette.primary.main,opacity:Ht?1:0,transition:"opacity 120ms ease",pointerEvents:"none",zIndex:3},backgroundImage:b()==="dark"?"linear-gradient(90deg, color-mix(in oklch, var(--orb-muted) 8%, transparent) 1px, transparent 1px)":"linear-gradient(90deg, color-mix(in oklch, var(--orb-fg) 6%, transparent) 1px, transparent 1px)",backgroundSize:Bt,cursor:Yt?"grabbing":Et?"grab":b$1?"pointer":"default",transition:"opacity 120ms ease"},children:f(ct,{title:`${Ie.title}: ${et.format("MMM D HH:mm")} - ${Xe.format("MMM D HH:mm")}`,children:g("div",{sx:{position:"absolute",left:`${St}%`,top:Math.max(8,(ve-24)/2),width:`max(18px, ${mt}%)`,height:24,borderRadius:999,overflow:"hidden",backgroundColor:b()==="dark"?"color-mix(in oklch, var(--orb-muted) 18%, transparent)":"color-mix(in oklch, var(--orb-fg) 10%, transparent)",outline:ro?`2px solid ${A.palette.warning.main}`:"none",outlineOffset:2},children:[f("div",{sx:{height:"100%",width:`${yt}%`,backgroundColor:Ut}}),f(E,{sx:{position:"absolute",inset:0,px:1,display:"flex",alignItems:"center",color:"var(--orb-on-primary)",fontSize:11,fontWeight:800,textShadow:"0 1px 4px rgba(0,0,0,0.45)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:Ie.code})]})})},Ie.id)})})]})})})]})}),f(dn,{groupAnchorEl:re.groupAnchorEl,setGroupAnchorEl:re.setGroupAnchorEl,grouping:re.grouping,setGrouping:re.setGrouping,columns:re.columns}),f(pn,{anchorEl:re.anchorEl,setAnchorEl:re.setAnchorEl,columns:re.columns,visibleColumns:re.visibleColumns,toggleColumnVisibility:re.toggleColumnVisibility}),f(Lp,{contextMenu:Ge,handleClose:()=>nt(null),columns:re.columns,visibleColumns:re.visibleColumns,grouping:re.grouping,summaryColumns:re.summaryColumns,showSummary:re.showSummary,sortBy:re.sortBy,orderBy:re.orderBy,order:re.order,onSortAsc:F=>{re.applyMultiSort([{field:F,direction:"asc"}]);},onSortDesc:F=>{re.applyMultiSort([{field:F,direction:"desc"}]);},onClearSort:F=>{let ee=re.sortBy.filter(ve=>ve.field!==F);ee.length>0?re.applyMultiSort(ee):(re.clearMultiSort(),re.orderBy===F&&re.setOrderBy(""));},onHideColumn:F=>{re.visibleColumns.includes(F)&&re.toggleColumnVisibility(F);},onToggleGroup:F=>re.toggleGroupField(F),onToggleSummary:F=>re.toggleSummaryColumn(F),onOpenSortDialog:()=>K(true)}),f(Op,{open:it,onClose:()=>K(false),columns:re.columns,initialRules:re.sortBy.length>0?re.sortBy:re.orderBy?[{field:re.orderBy,direction:re.order}]:[],onApply:F=>re.applyMultiSort(F),onClear:()=>{re.clearMultiSort(),re.setOrderBy("");}})]})};var WV=({filterProps:t,ganttProps:o,spacing:r=2,sx:n,children:a})=>{let i=n?[{height:"100%",overflow:"hidden"},n]:{height:"100%",overflow:"hidden"},s=o.sx?[{height:"100%"},o.sx]:{height:"100%"};return g(ce,{spacing:r,sx:i,children:[f("div",{sx:{flexShrink:0},children:f(_o,{...t})}),f("div",{sx:{flex:1,minHeight:0,overflow:"hidden"},children:f(Yg,{...o,bodyHeight:o.bodyHeight??"100%",sx:s})}),a]})};var Qg=640,Hw=360,zw=360,Gs=8,Ln="220ms cubic-bezier(0.2, 0, 0, 1)",Tc=(t,o,r=0,n=[])=>t.flatMap(a=>{let i=a.children??[],s=[{node:a,level:r,hasChildren:i.length>0,parentIds:n}];return o.has(a.id)?[...s,...Tc(i,o,r+1,[...n,a.id])]:s}),Jg=t=>t.flatMap(o=>[o,...Jg(o.children??[])]),eh=(t,o=0,r=[])=>t.flatMap(n=>{let a=n.children??[];return [{node:n,level:o,hasChildren:a.length>0,parentIds:r},...eh(a,o+1,[...r,n.id])]}),th=t=>t.flatMap(o=>{let r=o.children??[];return r.length===0?[]:[o.id,...th(r)]}),jg=t=>Object.entries(t).filter(([o])=>o!=="children").map(([,o])=>o==null?"":typeof o=="string"||typeof o=="number"||typeof o=="boolean"?String(o):"").join(" ").toLowerCase(),jV=({title:t,subtitle:o,nodes:r,columns:n,detail:a,selectedNodeId:i,defaultSelectedNodeId:s,onNodeSelect:c,expandedNodeIds:u,defaultExpandedNodeIds:d,onExpandedNodeIdsChange:m,defaultPaneMode:h="split",minTreePaneWidth:f$1=Hw,minDetailPaneWidth:p=zw,tableAppId:v="ctree-comp",tableKey:C="default",tableTitle:g$1,filterConfig:x,searchQuery:y,searchToken:b$1,defaultRowsPerPage:k=-1,rowsPerPageOptions:w=[20,50,100,-1],serviceUrl:T,emptyLabel:I="No tree items available.",headerAction:S,sx:D,className:R})=>{let M=io(),P=useRef(null),A=useRef(null),L=useRef(null),[W,j]=useState(s??r[0]?.id??null),[O,_]=useState(d??th(r).slice(0,3)),[z,Y]=useState(h),[H,B]=useState(Qg),[q,Z]=useState(0),[ue,ne]=useState(0),[fe,Ce]=useState(k),$=useMemo(()=>n&&n.length>0?n:[{id:"label",label:"Name",render:ge=>g(ce,{spacing:.3,children:[f(E,{sx:{fontSize:15,fontWeight:700,lineHeight:1.15},children:ge.label}),ge.subtitle&&f(E,{sx:{fontSize:13,color:"text.secondary",lineHeight:1.2},children:ge.subtitle})]})}],[n]),J=useMemo(()=>new Set(u??O),[u,O]),ae=useMemo(()=>Tc(r,J),[r,J]),xe=useMemo(()=>Jg(r),[r]),pe=useMemo(()=>eh(r),[r]),me=i===void 0?W:i,Ee=useMemo(()=>xe.find(ge=>ge.id===me)??null,[me,xe]),Ge=ge=>{let Se=A.current?.clientWidth??0,oe=Se>0?Math.max(f$1,Se-Gs-p):Math.max(f$1,ge);return Math.min(Math.max(ge,f$1),oe)},nt=z==="detail",it=z==="tree"||!a,K=z==="split"&&!!a,ke=(()=>{if(q<=0)return null;if(z==="tree"||!a)return {treeWidth:q,splitterWidth:0,detailWidth:0};if(z==="detail")return {treeWidth:0,splitterWidth:0,detailWidth:q};let ge=K?Gs:0,Se=Ge(H);return {treeWidth:Se,splitterWidth:ge,detailWidth:Math.max(0,q-ge-Se)}})(),He=ke?`${ke.treeWidth}px ${ke.splitterWidth}px ${ke.detailWidth}px`:z==="tree"||!a?"minmax(0, 1fr) 0px 0px":z==="detail"?"0px 0px minmax(0, 1fr)":`minmax(${f$1}px, ${H}px) ${Gs}px minmax(${p}px, 1fr)`;useEffect(()=>{let ge=A.current;if(!ge){Z(0);return}let Se=0,oe=()=>{window.cancelAnimationFrame(Se),Se=window.requestAnimationFrame(()=>{let Ae=ge.clientWidth;Z(Je=>Math.abs(Je-Ae)<.5?Je:Ae);});};if(oe(),typeof ResizeObserver>"u")return window.addEventListener("resize",oe),()=>{window.cancelAnimationFrame(Se),window.removeEventListener("resize",oe);};let we=new ResizeObserver(oe);return we.observe(ge),window.addEventListener("resize",oe),()=>{window.cancelAnimationFrame(Se),we.disconnect(),window.removeEventListener("resize",oe);}},[]);let at=ge=>{u===void 0&&_(ge),m?.(ge);},Ye=ge=>{let Se=new Set(J);Se.has(ge)?Se.delete(ge):Se.add(ge),at(Array.from(Se));},xt=ge=>{i===void 0&&j(ge.id),c?.(ge);};useEffect(()=>{ne(0);},[r]),useEffect(()=>{let ge=y?.trim().toLowerCase();if(!ge)return;let Se=pe.find(({node:pt})=>jg(pt).includes(ge));if(!Se)return;let oe=new Set(J);Se.parentIds.forEach(pt=>oe.add(pt)),at(Array.from(oe)),xt(Se.node);let Ae=Tc(r,oe).findIndex(({node:pt})=>pt.id===Se.node.id);Ae>=0&&fe>0&&ne(Math.floor(Ae/fe));let Je=0,st=0;return Je=window.requestAnimationFrame(()=>{st=window.requestAnimationFrame(()=>{let pt=P.current?.querySelector("tr.orb-selected"),Bt=pt?.closest(".orb-table-container");if(pt&&Bt){let Xt=Bt.getBoundingClientRect(),Vt=pt.getBoundingClientRect(),wt=Vt.top-Xt.top+Bt.scrollTop;Bt.scrollTo({top:wt-Bt.clientHeight/2+Vt.height/2,behavior:"smooth"});return}pt?.scrollIntoView({block:"center",behavior:"smooth"});});}),()=>{window.cancelAnimationFrame(Je),window.cancelAnimationFrame(st);}},[y,b$1,pe,r,fe]);let Mt=useMemo(()=>ae.map(({node:ge,level:Se,hasChildren:oe})=>({...ge,id:ge.id,__node:ge,__level:Se,__hasChildren:oe,__expanded:J.has(ge.id),__searchText:jg(ge)})),[J,ae]),Ot=useMemo(()=>$.map((ge,Se)=>({id:ge.id,label:ge.label,minWidth:typeof ge.width=="number"?ge.width:ge.minWidth??(Se===0?320:120),numeric:ge.numeric??ge.align==="right",render:(oe,we)=>{let Ae=we.__node,Je=ge.render?ge.render(Ae):Ae[ge.id];if(Se!==0)return f(Re,{sx:{minWidth:0,color:ge.align==="right"?"text.primary":"text.secondary",fontWeight:ge.align==="right"?750:500,textAlign:ge.align??"left"},children:Je});let st=Number(we.__level??0),pt=!!we.__hasChildren,Bt=!!we.__expanded;return g(ce,{direction:"row",alignItems:"center",spacing:1,sx:{minWidth:0,pl:`${st*24}px`},children:[f(le,{tooltip:pt?Bt?"Collapse":"Expand":"",onClick:Xt=>{Xt.stopPropagation(),pt&&Ye(Ae.id);},disabled:!pt,sx:{width:24,height:24,visibility:pt?"visible":"hidden",transform:Bt?"rotate(0deg)":"rotate(-90deg)",transition:"transform 160ms ease"},children:f($o,{sx:{fontSize:20}})}),f(Re,{sx:{width:10,height:10,borderRadius:"50%",flexShrink:0,backgroundColor:Ae.markerColor??M.palette.primary.main}}),f(Re,{sx:{minWidth:0},children:Je})]})}})),[$,J,M.palette.primary.main]),At=ge=>{if(!K)return;ge.preventDefault(),ge.currentTarget.setPointerCapture(ge.pointerId),L.current={startX:ge.clientX,startWidth:H};let Se=we=>{let Ae=L.current;Ae&&B(Ge(Ae.startWidth+we.clientX-Ae.startX));},oe=()=>{L.current=null,window.removeEventListener("pointermove",Se),window.removeEventListener("pointerup",oe),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",Se),window.addEventListener("pointerup",oe);},re=()=>{let ge=A.current?.clientWidth??0,Se=ge>0?Math.max(f$1,(ge-Gs)/2):Qg;Y("split"),B(Ge(Se));},Ue=()=>a?typeof a=="function"?a(Ee):a:null,Be=a?f(Gn,{"aria-label":"Tree pane layout",value:z,options:[{value:"tree",label:"Expand tree",icon:f(mi,{fontSize:"small"})},{value:"split",label:"Split evenly",icon:f(hi,{fontSize:"small"})},{value:"detail",label:"Expand detail",icon:f(ui,{fontSize:"small"})}],onValueChange:ge=>{ge==="split"?re():Y(ge);},sx:{position:"absolute",top:13,right:56,zIndex:3,backdropFilter:"blur(10px)"}}):null;return g(Re,{ref:P,className:["ctree_comp",R].filter(Boolean).join(" "),sx:{position:"relative",height:"100%",minHeight:0,border:`1px solid ${M.palette.divider}`,borderRadius:"var(--orb-r-container)",overflow:"hidden",backgroundColor:"background.paper",boxShadow:`0 18px 42px ${tt(M.palette.common.black,b()==="dark"?.24:.08)}`,...D},children:[Be,g(Re,{ref:A,sx:{height:"100%",display:"grid",gridTemplateColumns:He,transition:`grid-template-columns ${Ln}`,minWidth:0},children:[g(Re,{"aria-hidden":nt?true:void 0,sx:{minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column",opacity:nt?0:1,transform:nt?"translateX(-12px)":"translateX(0)",pointerEvents:nt?"none":"auto",transition:`opacity ${Ln}, transform ${Ln}`,willChange:"opacity, transform"},children:[g(ce,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:2,sx:{px:2,py:1.5,minHeight:74,borderBottom:`1px solid ${M.palette.divider}`},children:[g(ce,{direction:"row",alignItems:"center",spacing:1.4,sx:{minWidth:0},children:[f(xr,{sx:{color:"primary.main",fontSize:28}}),g(Re,{sx:{minWidth:0},children:[f(E,{sx:{fontSize:20,fontWeight:750,lineHeight:1.12},noWrap:true,children:t}),o&&f(E,{sx:{fontSize:14,color:"text.secondary",mt:.3},noWrap:true,children:o})]})]}),S!==void 0?S:f(le,{tooltip:"Add node",color:"default",children:f(Br,{fontSize:"small"})})]}),g(Re,{sx:{flex:1,minHeight:0,overflow:"hidden"},children:[f(tr,{appId:v,tableKey:C,title:g$1??(typeof t=="string"?t:"Tree"),columns:Ot,rows:Mt,rowKey:"id",fitContainer:true,fullWidth:true,showSummary:false,selectionMode:"single",selected:me?[me]:[],onSelectionChange:ge=>{let Se=ge[ge.length-1],oe=xe.find(we=>we.id===Se);oe&&xt(oe);},page:ue,rowsPerPage:fe,rowsPerPageOptions:w,count:Mt.length,onPageChange:ne,onRowsPerPageChange:ge=>{ne(0),Ce(ge);},filterConfig:x,serviceUrl:T,graphReport:{enabled:false},disableGrouping:true,disableSorting:true,maxHeight:"100%"}),Mt.length===0&&f(Re,{sx:{minHeight:220,display:"grid",placeItems:"center",color:"text.secondary"},children:I})]})]}),f(Re,{"data-ctree-splitter":"true",role:"separator","aria-orientation":"vertical",onPointerDown:K?At:void 0,sx:{width:"100%",cursor:K?"col-resize":"default",backgroundColor:K?tt(M.palette.text.primary,b()==="dark"?.16:.08):"transparent",opacity:K?1:0,pointerEvents:K?"auto":"none",position:"relative",transition:`opacity ${Ln}, background-color 120ms ease`,"&:hover":{backgroundColor:K?tt(M.palette.primary.main,b()==="dark"?.35:.18):"transparent"}}}),g(Re,{"aria-hidden":it?true:void 0,sx:{minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column",opacity:it?0:1,transform:it?"translateX(12px)":"translateX(0)",pointerEvents:it?"none":"auto",transition:`opacity ${Ln}, transform ${Ln}`,willChange:"opacity, transform"},children:[f(Re,{sx:{px:2,pt:2,minHeight:74,display:"flex",alignItems:"flex-end"},children:f(Rt,{sx:{width:"100%"}})}),f(Re,{sx:{flex:1,minHeight:0,overflow:"auto",px:2,pb:2},children:Ue()})]})]})]})};var _w={none:{from:{},to:{}},fade:{from:{opacity:0},to:{opacity:1}},"slide-up":{from:{opacity:0,transform:"translate3d(0, 12px, 0)"},to:{opacity:1,transform:"translate3d(0, 0, 0)"}},"slide-left":{from:{opacity:0,transform:"translate3d(12px, 0, 0)"},to:{opacity:1,transform:"translate3d(0, 0, 0)"}},scale:{from:{opacity:0,transform:"scale(0.985)"},to:{opacity:1,transform:"scale(1)"}}},rW=({children:t,transitionKey:o,variant:r="fade",durationMs:n=220,delayMs:a=0,easing:i="cubic-bezier(0.22, 1, 0.36, 1)",disabled:s=false,sx:c})=>{let u=Cr("(prefers-reduced-motion: reduce)"),[d,m]=useState("to"),h=!s&&!u&&r!=="none";useEffect(()=>{if(!h){m("to");return}m("from");let v=requestAnimationFrame(()=>{v=requestAnimationFrame(()=>{m("to");});});return ()=>cancelAnimationFrame(v)},[o,h]);let f$1=_w[r],p=useMemo(()=>h?d==="from"?f$1.from:f$1.to:{opacity:1,transform:"none"},[h,d,f$1.from,f$1.to]);return f(Re,{sx:{willChange:h?"opacity, transform":"auto",transition:h?`opacity ${n}ms ${i} ${a}ms, transform ${n}ms ${i} ${a}ms`:"none",backfaceVisibility:"hidden",...p,...c},children:t})},nW={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};export{R5 as AIBrowserGlow,Ec as Activity,Ym as AgentPanel,Aa as AlertCircle,Lc as AlertTriangle,u0 as ArrowDown,m0 as ArrowRight,Oc as ArrowUp,qs as BarChart,g0 as Bot,ol as Button,Ey as CAINavProvider,on as CAlert,_p as CAmapChart,Xi as CAppHeader,Fl as CAppHeaderSearch,VE as CAppPageLayout,eV as CAuthPage,tn as CAvatar,qa as CBadge,na as CBarChart,Me as CButton,Kn as CCalendar,nu as CCardDetailPanel,iu as CCardGrid,$b as CCardGridCard,fD as CCardPage,Mi as CChartCard,Tt as CCheckbox,Ct as CChip,Hp as CComboChart,Up as CCustomizeAgent,af as CDatePicker,HA as CDetailInfoPage,gu as CDetailSearchAiBar,_i as CDetailSectionCard,Lt as CDialog,Rt as CDivider,lf as CFileUpload,QT as CFilterField,Vp as CFishboneChart,$p as CGoogleMapChart,Gp as CGraphCharts,Fp as CGraphKpiCards,Di as CGraphReport,zp as CHeatmapChart,le as CIconButton,uE as CKanbanBoard,yu as CKanbanBucket,Nl as CKanbanCard,eu as CLayoutManagement,hn as CLayoutManager,Bp as CLineChart,$T as CList,_T as CListItem,XT as CListItemAvatar,GT as CListItemButton,UT as CListItemIcon,KT as CListItemText,qT as CListSubheader,Qt as CMenu,jn as CMessageBox,xs as CMetricChartCard,vi as CPageLayout,rW as CPageTransition,Le as CPaper,Ii as CPieChart,IO as CPivotTable,Yg as CPlanningGantt,WV as CPlanningLayout,Js as CPopover,_n as CProgress,Dh as CRadioGroup,Gn as CSegmentedControl,zt as CSelect,Hh as CSkeleton,_o as CSmartFilter,ON as CSmartTable,Yo as CSpinner,ce as CStack,$N as CStandardPage,zT as CStatusBadge,Ka as CSwitch,tr as CTable,NN as CTableBody,DN as CTableCell,AN as CTableContainer,EN as CTableHead,LN as CTableRow,tf as CTabs,$n as CTextArea,We as CTextField,ct as CTooltip,jV as CTreeComp,E as CTypography,Mp as CValueHelp,Oi as CVariantManagement,Zp as CVariantManager,Kl as CVoiceWaveOverlay,Wp as CWaterfallChart,Xs as Calendar,h0 as CalendarDays,f0 as Camera,b0 as ChartNoAxesCombined,po as Check,Ea as CheckCircle,Po as ChevronDown,La as ChevronLeft,So as ChevronRight,v0 as ChevronUp,y0 as ChevronsDown,C0 as ChevronsUp,Oa as CircleAlert,Bn as CircleCheck,x0 as CircleCheckBig,Zs as CircleStop,Fc as Clipboard,w0 as ClipboardCheck,S0 as ClipboardList,Bc as Clock,da as CodeBlock,k0 as Columns3,T5 as CopilotChat,Lo as Copy,P0 as CopyPlus,T0 as Delete,Hn as Download,Hc as Edit,zc as Expand,M0 as Eye,I0 as EyeOff,Fa as File,Vc as FileText,R0 as Filter,v5 as FloatingAgentPanel,zn as FolderTree,Wc as GitBranch,LT as GlobalMessage,Vn as Globe,$c as Grid,N0 as GripVertical,D0 as Hammer,_c as Image,Ba as Info,Sa as InputArea,A0 as Languages,E0 as Layers,L0 as LayoutDashboard,Ha as Lightbulb,Gc as LineChart,Uc as Loader2,za as Lock,O0 as LockKeyhole,Kc as LogOut,Cs as METRIC_CHART_TYPES,Ys as Mail,qc as MapPin,ma as MarkdownRenderer,pa as MathBlock,Xc as Menu,wl as MermaidBlock,gh as MessageCircle,Zc as MessageSquare,Va as Mic,F0 as MicOff,Yc as Moon,B0 as MoreHorizontal,fd as NavigationIsland,al as NavigationIsland2,iw as OMPHApprovalCard,sw as OMPHInitial,e5 as OMPHPanel,Xn as ORBCAFE_I18N_MESSAGES,rh as ORB_DARK,Uw as ORB_FONT_STACK,oh as ORB_LIGHT,qw as ORB_RADIUS,Us as ORB_TOKENS,Xw as ORB_TRANSITION_FAST,Ya as OrbcafeI18nProvider,Fn as OrbisModeProvider,nW as PAGE_TRANSITION_PRESETS,t2 as PAppPageLayout,KO as PBarcodeScanner,gm as PNavIsland,sF as PNumericKeypad,cm as PSmartFilter,ky as PTable,JO as PTouchCard,dm as PWorkloadNav,H0 as PackageCheck,z0 as PackageSearch,Wa as PanelLeftOpen,$a as PanelRight,V0 as PanelsTopLeft,Qc as PieChart,jr as Pin,em as PivotChartPanel,W0 as Play,Jr as Plus,$0 as QrCode,_0 as ReceiptText,_a as RefreshCw,G0 as Rocket,U0 as RotateCcw,jc as RotateCw,K0 as Rows3,Pt as SapIcon,q0 as Save,X0 as ScanLine,Vo as Search,hh as Send,Jc as SendHorizontal,en as Settings,Z0 as ShieldCheck,Y0 as Sigma,Q0 as SortAsc,j0 as SquareSplitHorizontal,J0 as Star,Xm as StdChat,ed as Sun,eS as Table2,kl as TableBlock,tS as TabletSmartphone,Wn as Terminal,Wi as ThinkBlock,td as ThumbsDown,od as ThumbsUp,rd as Trash2,Zn as TreeMenu,oS as TreePine,nd as TrendingDown,Ga as TriangleAlert,rS as Truck,ad as UploadCloud,Qs as User,u2 as VoiceNavigatorProvider,i2 as VoiceWaveOverlay,id as Volume2,nS as Warehouse,aS as Workflow,Kt as X,Ua as XCircle,Cu as addKanbanBucket,Ri as buildAmapEmbedUrl,aa as buildGoogleMapEmbedUrl,TR as buildGoogleMapIframe,mf as buttonVariants,wu as createKanbanBoardModel,se as createSapIcon,Uo as findKanbanCard,TT as message,sr as messageManager,Ki as moveKanbanCard,cc as omphApprovalLabelsFromI18n,ka as omphLabelsFromI18n,tt as orbAlpha,Kw as orbChartSeries,Vi as parseMarkdownTable,ac as parseOmphFileHref,xu as renameKanbanBucket,dA as renderMarkdown,Hi as resolveVariantFilters,zi as resolveVariantLayout,Ly as useAINav,ND as useAmapEmbedUrl,U5 as useAuthPage,xD as useCardPage,fu as useDetailInfo,RD as useGoogleMapEmbedUrl,kD as useGraphChartData,Ei as useGraphInteraction,un as useGraphReport,bE as useKanbanBoard,Eo as useMediaQuery,wd as useNavigationIsland,fo as useOrbMode,Ks as useOrbTokens,de as useOrbcafeI18n,BO as usePadLayout,VO as usePadRecordEditor,Ru as usePageLayout,EO as usePivotTable,Gg as usePlanningGantt,lV as usePlanningLayout,XN as useStandardReport,xn as useVoiceInput,m2 as useVoiceNavigator};