orbcafe-ui 3.0.0 → 3.1.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.js CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';var jsxRuntime=require('react/jsx-runtime'),ogl=require('ogl'),Qt=require('react'),Mr=require('@radix-ui/react-dropdown-menu'),_r=require('@radix-ui/react-tooltip'),reactDom=require('react-dom'),Cr=require('@radix-ui/react-dialog'),lo=require('@radix-ui/react-popover'),Qr=require('dayjs'),hg=require('dayjs/plugin/customParseFormat'),navigation=require('next/navigation'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),reactSlot=require('@radix-ui/react-slot'),classVarianceAuthority=require('class-variance-authority'),core=require('@dnd-kit/core'),modifiers=require('@dnd-kit/modifiers'),sortable=require('@dnd-kit/sortable'),Nf=require('dayjs/plugin/isBetween'),Ef=require('dayjs/plugin/localizedFormat');require('dayjs/locale/zh-cn'),require('dayjs/locale/fr'),require('dayjs/locale/de'),require('dayjs/locale/ja'),require('dayjs/locale/ko');var Kh=require('next/dynamic'),framerMotion=require('framer-motion'),wv=require('react-markdown'),kv=require('remark-gfm'),Tv=require('remark-math'),Pv=require('rehype-katex'),Iv=require('rehype-raw'),reactSyntaxHighlighter=require('react-syntax-highlighter'),prism=require('react-syntax-highlighter/dist/esm/styles/prism'),Cu=require('mermaid'),oy=require('dayjs/plugin/isoWeek');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var Qt__namespace=/*#__PURE__*/_interopNamespace(Qt);var Mr__namespace=/*#__PURE__*/_interopNamespace(Mr);var _r__namespace=/*#__PURE__*/_interopNamespace(_r);var Cr__namespace=/*#__PURE__*/_interopNamespace(Cr);var lo__namespace=/*#__PURE__*/_interopNamespace(lo);var Qr__default=/*#__PURE__*/_interopDefault(Qr);var hg__default=/*#__PURE__*/_interopDefault(hg);var Nf__default=/*#__PURE__*/_interopDefault(Nf);var Ef__default=/*#__PURE__*/_interopDefault(Ef);var Kh__default=/*#__PURE__*/_interopDefault(Kh);var wv__default=/*#__PURE__*/_interopDefault(wv);var kv__default=/*#__PURE__*/_interopDefault(kv);var Tv__default=/*#__PURE__*/_interopDefault(Tv);var Pv__default=/*#__PURE__*/_interopDefault(Pv);var Iv__default=/*#__PURE__*/_interopDefault(Iv);var Cu__default=/*#__PURE__*/_interopDefault(Cu);var oy__default=/*#__PURE__*/_interopDefault(oy);var vl=Object.defineProperty;var nm=(t,r,o)=>r in t?vl(t,r,{enumerable:true,configurable:true,writable:true,value:o}):t[r]=o;var es=(t,r,o)=>()=>{if(o)throw o[0];try{return t&&(r=t(t=0)),r}catch(n){throw o=[n],n}};var am=(t,r)=>{for(var o in r)vl(t,o,{get:r[o],enumerable:true});};var yl=(t,r,o)=>nm(t,r+"",o);var aa,lm,ht,ia,xl,cm,dm,Cl,Sl,pm,rs,um,wl,mm,Cn,Ge,$t=es(()=>{"use strict";aa={xs:0,sm:600,md:900,lg:1200,xl:1536},lm=t=>({palette:{mode:t,primary:{main:"var(--orb-primary)",light:"var(--orb-p300)",dark:"var(--orb-p700)",contrastText:"var(--orb-on-primary)"},secondary:{main:t==="dark"?"var(--orb-p300)":"var(--orb-fg)",contrastText:t==="dark"?"var(--orb-canvas)":"var(--orb-on-primary)"},error:{main:"var(--orb-err)",contrastText:"var(--orb-on-primary)"},warning:{main:"var(--orb-accent)",contrastText:"var(--orb-on-primary)"},info:{main:t==="dark"?"var(--orb-p300)":"var(--orb-primary)",contrastText:"var(--orb-on-primary)"},success:{main:t==="dark"?"var(--orb-p300)":"var(--orb-primary)",contrastText:"var(--orb-on-primary)"},text:{primary:"var(--orb-fg)",secondary:"var(--orb-muted)",disabled:"var(--orb-disabled-fg)"},background:{default:"var(--orb-canvas)",paper:"var(--orb-surface)"},action:{hover:"var(--orb-hover)",selected:"var(--orb-selected)",focus:"var(--orb-focus-ring)",disabled:"var(--orb-disabled-fg)",disabledBackground:"var(--orb-disabled-bg)",active:t==="dark"?"var(--orb-p300)":"var(--orb-primary)"},divider:"var(--orb-border)",common:{white:"#ffffff",black:"#01091a"},grey:{50:"var(--orb-surface)",100:"var(--orb-surface)",200:"var(--orb-border)",300:"var(--orb-border)",400:"var(--orb-muted)",500:"var(--orb-muted)",600:"var(--orb-fg)",700:"var(--orb-fg)",800:"var(--orb-surface-3)",900:"var(--orb-canvas)"}},shape:{borderRadius:10},breakpoints:{up:r=>`@media (min-width:${aa[r]}px)`,down:r=>`@media (max-width:${Math.max(0,aa[r]-.05)}px)`},spacing:(...r)=>r.map(o=>`${o*8}px`).join(" "),transitions:{create:(r="all",o={})=>(Array.isArray(r)?r:[r]).map(a=>`${a} ${o.duration??200}ms ${o.easing??"ease"}`).join(", "),duration:{shortest:150,shorter:180,short:200,standard:300}},zIndex:{modal:1300,drawer:1200,appBar:1100,tooltip:1500}}),ht=()=>typeof document>"u"?"light":document.documentElement.dataset.orbMode==="dark"||document.documentElement.classList.contains("orb-dark")?"dark":"light",ia=()=>lm(ht()),xl={m:["margin"],mt:["marginTop"],mr:["marginRight"],mb:["marginBottom"],ml:["marginLeft"],mx:["marginLeft","marginRight"],my:["marginTop","marginBottom"],p:["padding"],pt:["paddingTop"],pr:["paddingRight"],pb:["paddingBottom"],pl:["paddingLeft"],px:["paddingLeft","paddingRight"],py:["paddingTop","paddingBottom"],bgcolor:["backgroundColor"]},cm=new Set(["animationIterationCount","borderImageOutset","borderImageSlice","borderImageWidth","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","columns","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridArea","gridColumn","gridColumnEnd","gridColumnSpan","gridColumnStart","gridRow","gridRowEnd","gridRowSpan","gridRowStart","fontWeight","lineClamp","lineHeight","opacity","order","orphans","scale","tabSize","widows","zIndex","zoom"]),dm=(t,r)=>{if(typeof r!="string")return r;let o={"background.default":"var(--orb-canvas)","background.paper":"var(--orb-surface)","text.primary":"var(--orb-fg)","text.secondary":"var(--orb-muted)","text.disabled":"var(--orb-disabled-fg)","primary.main":"var(--orb-primary)","primary.light":"var(--orb-p300)","primary.dark":"var(--orb-p700)","secondary.main":"var(--orb-muted)",divider:"var(--orb-border)","error.main":"var(--orb-err)","warning.main":"var(--orb-accent)","success.main":"var(--orb-primary)","info.main":"var(--orb-primary)","action.hover":"var(--orb-hover)","action.selected":"var(--orb-selected)","action.disabled":"var(--orb-disabled-fg)"};return o[r]?o[r]:r},Cl=t=>t.startsWith("--")?t:t.replace(/[A-Z]/g,r=>`-${r.toLowerCase()}`),Sl=(t,r)=>{if(r==null||r===!1)return null;let o=dm(t,r);return typeof o=="number"&&o!==0&&!cm.has(t)?["margin","marginTop","marginRight","marginBottom","marginLeft","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","gap","rowGap","columnGap"].includes(t)?`${o*8}px`:`${o}px`:String(o)},pm=t=>t?(Array.isArray(t)?t:[t]).reduce((o,n)=>{if(!n)return o;let a=typeof n=="function"?n(ia()):n;return {...o,...a}},{}):{},rs=t=>!t||typeof t!="object"?JSON.stringify(t):Array.isArray(t)?`[${t.map(rs).join(",")}]`:`{${Object.keys(t).sort().map(r=>`${JSON.stringify(r)}:${rs(t[r])}`).join(",")}}`,um=t=>{let r=2166136261;for(let o=0;o<t.length;o+=1)r^=t.charCodeAt(o),r=Math.imul(r,16777619);return (r>>>0).toString(36)},wl=new Set,mm=t=>{if(typeof document>"u"||wl.has(t))return;wl.add(t);let r=document.querySelector("style[data-orb-sx]");r||(r=document.createElement("style"),r.dataset.orbSx="true",document.head.appendChild(r)),r.appendChild(document.createTextNode(t));},Cn=(t,r)=>{let o=[],n=[];return Object.entries(r).forEach(([a,i])=>{let s=typeof i=="function"?i(ia()):i;if(s==null||s===!1)return;if(a.startsWith("@media")&&typeof s=="object"){n.push(`${a}{${Cn(t,s)}}`);return}if(a.startsWith("&")&&typeof s=="object"){n.push(Cn(a.split("&").join(t),s));return}if((a.startsWith(":")||a.startsWith(">")||a.startsWith("["))&&typeof s=="object"){n.push(Cn(`${t}${a}`,s));return}if(typeof s=="object"){let p=s,u=Object.keys(p).filter(d=>d in aa);u.length>0?u.forEach(d=>{let b=(xl[a]??[a]).map(m=>{let v=Sl(m,p[d]);return v===null?"":`${Cl(m)}:${v};`}).join("");b&&(d==="xs"?n.push(`${t}{${b}}`):n.push(`@media (min-width:${aa[d]}px){${t}{${b}}}`));}):n.push(Cn(`${t} ${a}`,p));return}(xl[a]??[a]).forEach(p=>{let u=Sl(p,s);u!==null&&o.push(`${Cl(p)}:${u};`);});}),`${o.length?`${t}{${o.join("")}}`:""}${n.join("")}`},Ge=(t,r,o)=>{let n=pm(t);if(Object.keys(n).length===0)return {className:r,style:o};let a=`orb-sx-${um(rs(n))}`;return mm(Cn(`.${a}`,n)),{className:[a,r].filter(Boolean).join(" "),style:o}};});var kl,e,l,w=es(()=>{"use strict";$t();kl=(t,r)=>{if(!r||typeof t!="string")return [t,r];let o={...r},n=o.component??t;delete o.component;let a=o.sx;delete o.sx;let i=Ge(a,o.className,o.style);return o.className=[i.className,o.hover?"orb-hoverable":void 0,o.selected?"orb-selected":void 0,o.noWrap?"orb-nowrap":void 0,o.padding==="checkbox"?"orb-cell-checkbox":void 0].filter(Boolean).join(" ")||void 0,o.style=i.style,["hover","selected","noWrap","stickyHeader","padding","flexItem","item","container","xs","sm","md","lg","xl","sortDirection","scrollButtons","disableSticky","columns","primaryTypographyProps","secondaryTypographyProps","position"].forEach(s=>delete o[s]),[n,o]},e=(t,r,o)=>{let[n,a]=kl(t,r);return jsxRuntime.jsx(n,a,o)},l=(t,r,o)=>{let[n,a]=kl(t,r);return jsxRuntime.jsxs(n,a,o)};});var mu={};am(mu,{COrbCanvas:()=>_h});function _h({hue:t=0,hoverIntensity:r=.2,rotateOnHover:o=true,forceHoverState:n=false,backgroundColor:a="transparent"}){let i=Qt.useRef(null),s=`
1
+ 'use strict';var jsxRuntime=require('react/jsx-runtime'),ogl=require('ogl'),Jt=require('react'),Nr=require('@radix-ui/react-dropdown-menu'),Yr=require('@radix-ui/react-tooltip'),reactDom=require('react-dom'),wr=require('@radix-ui/react-dialog'),vo=require('@radix-ui/react-popover'),ro=require('dayjs'),Gf=require('dayjs/plugin/customParseFormat'),navigation=require('next/navigation'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),reactSlot=require('@radix-ui/react-slot'),classVarianceAuthority=require('class-variance-authority'),core=require('@dnd-kit/core'),modifiers=require('@dnd-kit/modifiers'),sortable=require('@dnd-kit/sortable'),oh=require('dayjs/plugin/isBetween'),nh=require('dayjs/plugin/localizedFormat');require('dayjs/locale/zh-cn'),require('dayjs/locale/fr'),require('dayjs/locale/de'),require('dayjs/locale/ja'),require('dayjs/locale/ko');var hy=require('next/dynamic'),framerMotion=require('framer-motion'),lC=require('react-markdown'),cC=require('remark-gfm'),dC=require('remark-math'),pC=require('rehype-katex'),uC=require('rehype-raw'),reactSyntaxHighlighter=require('react-syntax-highlighter'),prism=require('react-syntax-highlighter/dist/esm/styles/prism'),fm=require('mermaid'),Nx=require('dayjs/plugin/isoWeek');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var Jt__namespace=/*#__PURE__*/_interopNamespace(Jt);var Nr__namespace=/*#__PURE__*/_interopNamespace(Nr);var Yr__namespace=/*#__PURE__*/_interopNamespace(Yr);var wr__namespace=/*#__PURE__*/_interopNamespace(wr);var vo__namespace=/*#__PURE__*/_interopNamespace(vo);var ro__default=/*#__PURE__*/_interopDefault(ro);var Gf__default=/*#__PURE__*/_interopDefault(Gf);var oh__default=/*#__PURE__*/_interopDefault(oh);var nh__default=/*#__PURE__*/_interopDefault(nh);var hy__default=/*#__PURE__*/_interopDefault(hy);var lC__default=/*#__PURE__*/_interopDefault(lC);var cC__default=/*#__PURE__*/_interopDefault(cC);var dC__default=/*#__PURE__*/_interopDefault(dC);var pC__default=/*#__PURE__*/_interopDefault(pC);var uC__default=/*#__PURE__*/_interopDefault(uC);var fm__default=/*#__PURE__*/_interopDefault(fm);var Nx__default=/*#__PURE__*/_interopDefault(Nx);var cc=Object.defineProperty;var Dg=(t,r,o)=>r in t?cc(t,r,{enumerable:true,configurable:true,writable:true,value:o}):t[r]=o;var Ds=(t,r,o)=>()=>{if(o)throw o[0];try{return t&&(r=t(t=0)),r}catch(n){throw o=[n],n}};var Ng=(t,r)=>{for(var o in r)cc(t,o,{get:r[o],enumerable:true});};var dc=(t,r,o)=>Dg(t,r+"",o);var Sa,Lg,ht,wa,pc,Og,Fg,uc,mc,Bg,As,Hg,gc,zg,En,Ue,Gt=Ds(()=>{"use strict";Sa={xs:0,sm:600,md:900,lg:1200,xl:1536},Lg=t=>({palette:{mode:t,primary:{main:"var(--orb-primary)",light:"var(--orb-p300)",dark:"var(--orb-p700)",contrastText:"var(--orb-on-primary)"},secondary:{main:t==="dark"?"var(--orb-p300)":"var(--orb-fg)",contrastText:t==="dark"?"var(--orb-canvas)":"var(--orb-on-primary)"},error:{main:"var(--orb-err)",contrastText:"var(--orb-on-primary)"},warning:{main:"var(--orb-accent)",contrastText:"var(--orb-on-primary)"},info:{main:t==="dark"?"var(--orb-p300)":"var(--orb-primary)",contrastText:"var(--orb-on-primary)"},success:{main:t==="dark"?"var(--orb-p300)":"var(--orb-primary)",contrastText:"var(--orb-on-primary)"},text:{primary:"var(--orb-fg)",secondary:"var(--orb-muted)",disabled:"var(--orb-disabled-fg)"},background:{default:"var(--orb-canvas)",paper:"var(--orb-surface)"},action:{hover:"var(--orb-hover)",selected:"var(--orb-selected)",focus:"var(--orb-focus-ring)",disabled:"var(--orb-disabled-fg)",disabledBackground:"var(--orb-disabled-bg)",active:t==="dark"?"var(--orb-p300)":"var(--orb-primary)"},divider:"var(--orb-border)",common:{white:"#ffffff",black:"#01091a"},grey:{50:"var(--orb-surface)",100:"var(--orb-surface)",200:"var(--orb-border)",300:"var(--orb-border)",400:"var(--orb-muted)",500:"var(--orb-muted)",600:"var(--orb-fg)",700:"var(--orb-fg)",800:"var(--orb-surface-3)",900:"var(--orb-canvas)"}},shape:{borderRadius:10},breakpoints:{up:r=>`@media (min-width:${Sa[r]}px)`,down:r=>`@media (max-width:${Math.max(0,Sa[r]-.05)}px)`},spacing:(...r)=>r.map(o=>`${o*8}px`).join(" "),transitions:{create:(r="all",o={})=>(Array.isArray(r)?r:[r]).map(a=>`${a} ${o.duration??200}ms ${o.easing??"ease"}`).join(", "),duration:{shortest:150,shorter:180,short:200,standard:300}},zIndex:{modal:1300,drawer:1200,appBar:1100,tooltip:1500}}),ht=()=>typeof document>"u"?"light":document.documentElement.dataset.orbMode==="dark"||document.documentElement.classList.contains("orb-dark")?"dark":"light",wa=()=>Lg(ht()),pc={m:["margin"],mt:["marginTop"],mr:["marginRight"],mb:["marginBottom"],ml:["marginLeft"],mx:["marginLeft","marginRight"],my:["marginTop","marginBottom"],p:["padding"],pt:["paddingTop"],pr:["paddingRight"],pb:["paddingBottom"],pl:["paddingLeft"],px:["paddingLeft","paddingRight"],py:["paddingTop","paddingBottom"],bgcolor:["backgroundColor"]},Og=new Set(["animationIterationCount","borderImageOutset","borderImageSlice","borderImageWidth","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","columns","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridArea","gridColumn","gridColumnEnd","gridColumnSpan","gridColumnStart","gridRow","gridRowEnd","gridRowSpan","gridRowStart","fontWeight","lineClamp","lineHeight","opacity","order","orphans","scale","tabSize","widows","zIndex","zoom"]),Fg=(t,r)=>{if(typeof r!="string")return r;let o={"background.default":"var(--orb-canvas)","background.paper":"var(--orb-surface)","text.primary":"var(--orb-fg)","text.secondary":"var(--orb-muted)","text.disabled":"var(--orb-disabled-fg)","primary.main":"var(--orb-primary)","primary.light":"var(--orb-p300)","primary.dark":"var(--orb-p700)","secondary.main":"var(--orb-muted)",divider:"var(--orb-border)","error.main":"var(--orb-err)","warning.main":"var(--orb-accent)","success.main":"var(--orb-primary)","info.main":"var(--orb-primary)","action.hover":"var(--orb-hover)","action.selected":"var(--orb-selected)","action.disabled":"var(--orb-disabled-fg)"};return o[r]?o[r]:r},uc=t=>t.startsWith("--")?t:t.replace(/[A-Z]/g,r=>`-${r.toLowerCase()}`),mc=(t,r)=>{if(r==null||r===!1)return null;let o=Fg(t,r);return typeof o=="number"&&o!==0&&!Og.has(t)?["margin","marginTop","marginRight","marginBottom","marginLeft","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","gap","rowGap","columnGap"].includes(t)?`${o*8}px`:`${o}px`:String(o)},Bg=t=>t?(Array.isArray(t)?t:[t]).reduce((o,n)=>{if(!n)return o;let a=typeof n=="function"?n(wa()):n;return {...o,...a}},{}):{},As=t=>!t||typeof t!="object"?JSON.stringify(t):Array.isArray(t)?`[${t.map(As).join(",")}]`:`{${Object.keys(t).sort().map(r=>`${JSON.stringify(r)}:${As(t[r])}`).join(",")}}`,Hg=t=>{let r=2166136261;for(let o=0;o<t.length;o+=1)r^=t.charCodeAt(o),r=Math.imul(r,16777619);return (r>>>0).toString(36)},gc=new Set,zg=t=>{if(typeof document>"u"||gc.has(t))return;gc.add(t);let r=document.querySelector("style[data-orb-sx]");r||(r=document.createElement("style"),r.dataset.orbSx="true",document.head.appendChild(r)),r.appendChild(document.createTextNode(t));},En=(t,r)=>{let o=[],n=[];return Object.entries(r).forEach(([a,i])=>{let s=typeof i=="function"?i(wa()):i;if(s==null||s===!1)return;if(a.startsWith("@media")&&typeof s=="object"){n.push(`${a}{${En(t,s)}}`);return}if(a.startsWith("&")&&typeof s=="object"){n.push(En(a.split("&").join(t),s));return}if((a.startsWith(":")||a.startsWith(">")||a.startsWith("["))&&typeof s=="object"){n.push(En(`${t}${a}`,s));return}if(typeof s=="object"){let d=s,p=Object.keys(d).filter(u=>u in Sa);p.length>0?p.forEach(u=>{let b=(pc[a]??[a]).map(m=>{let v=mc(m,d[u]);return v===null?"":`${uc(m)}:${v};`}).join("");b&&(u==="xs"?n.push(`${t}{${b}}`):n.push(`@media (min-width:${Sa[u]}px){${t}{${b}}}`));}):n.push(En(`${t} ${a}`,d));return}(pc[a]??[a]).forEach(d=>{let p=mc(d,s);p!==null&&o.push(`${uc(d)}:${p};`);});}),`${o.length?`${t}{${o.join("")}}`:""}${n.join("")}`},Ue=(t,r,o)=>{let n=Bg(t);if(Object.keys(n).length===0)return {className:r,style:o};let a=`orb-sx-${Hg(As(n))}`;return zg(En(`.${a}`,n)),{className:[a,r].filter(Boolean).join(" "),style:o}};});var fc,e,c,T=Ds(()=>{"use strict";Gt();fc=(t,r)=>{if(!r||typeof t!="string")return [t,r];let o={...r},n=o.component??t;delete o.component;let a=o.sx;delete o.sx;let i=Ue(a,o.className,o.style);return o.className=[i.className,o.hover?"orb-hoverable":void 0,o.selected?"orb-selected":void 0,o.noWrap?"orb-nowrap":void 0,o.padding==="checkbox"?"orb-cell-checkbox":void 0].filter(Boolean).join(" ")||void 0,o.style=i.style,["hover","selected","noWrap","stickyHeader","padding","flexItem","item","container","xs","sm","md","lg","xl","sortDirection","scrollButtons","disableSticky","columns","primaryTypographyProps","secondaryTypographyProps","position"].forEach(s=>delete o[s]),[n,o]},e=(t,r,o)=>{let[n,a]=fc(t,r);return jsxRuntime.jsx(n,a,o)},c=(t,r,o)=>{let[n,a]=fc(t,r);return jsxRuntime.jsxs(n,a,o)};});var sm={};Ng(sm,{COrbCanvas:()=>fy});function fy({hue:t=0,hoverIntensity:r=.2,rotateOnHover:o=true,forceHoverState:n=false,backgroundColor:a="transparent"}){let i=Jt.useRef(null),s=`
2
2
  precision highp float;
3
3
  attribute vec2 position;
4
4
  attribute vec2 uv;
@@ -7,7 +7,7 @@
7
7
  vUv = uv;
8
8
  gl_Position = vec4(position, 0.0, 1.0);
9
9
  }
10
- `,c=`
10
+ `,l=`
11
11
  precision highp float;
12
12
 
13
13
  uniform float iTime;
@@ -180,23 +180,26 @@
180
180
  vec4 col = mainImage(fragCoord);
181
181
  gl_FragColor = vec4(col.rgb * col.a, col.a);
182
182
  }
183
- `;return Qt.useEffect(()=>{let p=i.current;if(!p)return;let u=new ogl.Renderer({alpha:true,premultipliedAlpha:false}),d=u.gl;d.clearColor(0,0,0,0),p.appendChild(d.canvas);let f=new ogl.Triangle(d),b=new ogl.Program(d,{vertex:s,fragment:c,uniforms:{iTime:{value:0},iResolution:{value:new ogl.Vec3(d.canvas.width,d.canvas.height,d.canvas.width/d.canvas.height)},hue:{value:t},hover:{value:0},rot:{value:0},hoverIntensity:{value:r},backgroundColor:{value:uu(a)}}}),m=new ogl.Mesh(d,{geometry:f,program:b});function v(){if(!p)return;let A=window.devicePixelRatio||1,I=p.clientWidth,N=p.clientHeight;u.setSize(I*A,N*A),d.canvas.style.width=I+"px",d.canvas.style.height=N+"px",b.uniforms.iResolution.value.set(d.canvas.width,d.canvas.height,d.canvas.width/d.canvas.height);}window.addEventListener("resize",v),v();let y=0,g=0,x=0,h=.3,S=A=>{let I=p.getBoundingClientRect(),N=A.clientX-I.left,M=A.clientY-I.top,k=I.width,D=I.height,R=Math.min(k,D),F=k/2,z=D/2,K=(N-F)/R*2,V=(M-z)/R*2;Math.sqrt(K*K+V*V)<.8?y=1:y=0;},T=()=>{y=0;};p.addEventListener("mousemove",S),p.addEventListener("mouseleave",T);let C,L=A=>{C=requestAnimationFrame(L);let I=(A-g)*.001;g=A,b.uniforms.iTime.value=A*.001,b.uniforms.hue.value=t,b.uniforms.hoverIntensity.value=r,b.uniforms.backgroundColor.value=uu(a);let N=n?1:y;b.uniforms.hover.value+=(N-b.uniforms.hover.value)*.1,o&&N>.5&&(x+=I*h),b.uniforms.rot.value=x,u.render({scene:m});};return C=requestAnimationFrame(L),()=>{cancelAnimationFrame(C),window.removeEventListener("resize",v),p.removeEventListener("mousemove",S),p.removeEventListener("mouseleave",T),d.canvas.parentNode===p&&p.removeChild(d.canvas),d.getExtension("WEBGL_lose_context")?.loseContext();}},[t,r,o,n,a]),e("div",{ref:i,className:"w-full h-full"})}function Uh(t,r,o){let n,a,i;if(r===0)n=a=i=o;else {let s=(u,d,f)=>(f<0&&(f+=1),f>1&&(f-=1),f<.16666666666666666?u+(d-u)*6*f:f<.5?d:f<.6666666666666666?u+(d-u)*(.6666666666666666-f)*6:u),c=o<.5?o*(1+r):o+r-o*r,p=2*o-c;n=s(p,c,t+1/3),a=s(p,c,t),i=s(p,c,t-1/3);}return new ogl.Vec3(n,a,i)}function uu(t){if(t==="transparent")return new ogl.Vec3(0,0,0);if(t.startsWith("#")){let n=parseInt(t.slice(1,3),16)/255,a=parseInt(t.slice(3,5),16)/255,i=parseInt(t.slice(5,7),16)/255;return new ogl.Vec3(n,a,i)}let r=t.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(r)return new ogl.Vec3(parseInt(r[1])/255,parseInt(r[2])/255,parseInt(r[3])/255);let o=t.match(/hsla?\((\d+),\s*(\d+)%,\s*(\d+)%/);if(o){let n=parseInt(o[1])/360,a=parseInt(o[2])/100,i=parseInt(o[3])/100;return Uh(n,a,i)}return new ogl.Vec3(0,0,0)}var gu=es(()=>{"use strict";"use client";w();});var im={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"},sm={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"},ts={light:im,dark:sm},Sy='"Montserrat", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif',wy=t=>{let r=ts[t];return [r.primary,r.p300,r.muted,r.p700]},ky=10,Ty="0.2s ease";w();var Il=Qt.createContext({mode:"light",setting:"light"}),ym=t=>{if(typeof document>"u")return;let r=document.documentElement;r.classList.toggle("orb-dark",t==="dark"),r.dataset.orbMode=t,r.style.colorScheme=t;},Sn=({mode:t,defaultMode:r="light",children:o})=>{let n=t??r,[a,i]=Qt.useState("light"),[s,c]=Qt.useState(false);Qt.useEffect(()=>{c(true);let d=window.matchMedia("(prefers-color-scheme: dark)"),f=()=>i(d.matches?"dark":"light");return f(),d.addEventListener("change",f),()=>d.removeEventListener("change",f)},[]);let p=n==="system"?s?a:"light":n;Qt.useEffect(()=>{ym(p);},[p]);let u=Qt.useMemo(()=>({mode:p,setting:n}),[p,n]);return e(Il.Provider,{value:u,children:o})},hr=()=>Qt.useContext(Il).mode,xm=()=>ts[hr()];var tt=(t,r)=>{let o=Math.min(1,Math.max(0,r)),n=t.trim(),a=p=>p.split("").map(u=>u+u).join(""),i=n.startsWith("#")?n.slice(1):"",s=i.length===3?a(i):i;if(/^[0-9a-fA-F]{6}$/.test(s)){let p=parseInt(s.slice(0,2),16),u=parseInt(s.slice(2,4),16),d=parseInt(s.slice(4,6),16);return `rgba(${p}, ${u}, ${d}, ${o})`}let c=`${Math.round(o*100)}%`;return `color-mix(in oklch, ${t} ${c}, transparent)`};var Rr=t=>{let r=t.startsWith("up:")?`(min-width:${t.slice(3)}px)`:t.startsWith("down:")?`(max-width:${t.slice(5)}px)`:t,[o,n]=Qt.useState(()=>typeof window>"u"||typeof window.matchMedia!="function"?false:window.matchMedia(r).matches);return Qt.useEffect(()=>{if(typeof window.matchMedia!="function")return;let a=window.matchMedia(r),i=()=>n(a.matches);return i(),a.addEventListener("change",i),()=>a.removeEventListener("change",i)},[r]),o};w();var wm={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},km=t=>typeof t=="number"?`${t}px`:t,Tm={"2.5":10,3:12,"3.5":14,4:16,5:20,6:24,7:28,8:32,10:40,12:48},Pm=t=>{if(!t)return;let r=t.match(/(?:^|\s)(?:h|w)-(2\.5|3(?:\.5)?|4|5|6|7|8|10|12)(?:\s|$)/);return r?Tm[r[1]]:void 0},Mt=Qt.forwardRef(({name:t,size:r,title:o,className:n,style:a,strokeWidth:i,fill:s,...c},p)=>{let u=c["aria-label"]??o,d=km(r??Pm(n)??"1em"),f={fontFamily:"SAP-icons",fontSize:d,fontStyle:"normal",fontWeight:"normal",lineHeight:1,width:d,height:d,display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",...a};return e("span",{ref:p,role:u?"img":void 0,"aria-hidden":u?void 0:true,title:o,className:n,"data-sap-icon":t,style:f,...c,children:String.fromCodePoint(wm[t])})});Mt.displayName="SapIcon";var ne=(t,r)=>{let o=Qt.forwardRef((n,a)=>e(Mt,{ref:a,name:t,...n}));return o.displayName=r??`SapIcon(${t})`,o};var Ml=ne("activity","Activity"),Dl=ne("error","AlertCircle"),Al=ne("warning","AlertTriangle"),qy=ne("down","ArrowDown"),Xy=ne("navigationRight","ArrowRight"),Yy=ne("up","ArrowUp"),os=ne("barChart","BarChart"),Zy=ne("activate","Bot"),ns=ne("calendar","Calendar"),Qy=ns,jy=ne("camera","Camera"),Jy=ne("lineChart","ChartNoAxesCombined"),Go=ne("accept","Check"),sa=ne("accept","CheckCircle"),Io=ne("slimDown","ChevronDown"),Nl=ne("navigationLeft","ChevronLeft"),Lr=ne("navigationRight","ChevronRight"),ex=ne("slimUp","ChevronUp"),tx=ne("expandAll","ChevronsDown"),rx=ne("collapseAll","ChevronsUp"),la=ne("error","CircleAlert"),wn=ne("accept","CircleCheck"),ox=wn,nx=ne("stop","CircleStop"),El=ne("copy","Clipboard"),ax=ne("checklist","ClipboardCheck"),ix=ne("checklist","ClipboardList"),Ll=ne("time","Clock"),sx=ne("tableColumn","Columns3"),ca=ne("copy","Copy"),lx=ne("duplicate","CopyPlus"),cx=ne("delete","Delete"),dx=ne("download","Download"),Fl=ne("edit","Edit"),px=ne("fullScreen","Expand"),ux=ne("show","Eye"),mx=ne("hide","EyeOff"),gx=ne("document","File"),Ol=ne("document","FileText"),fx=ne("filter","Filter"),kn=ne("tree","FolderTree"),Bl=ne("process","GitBranch"),Tn=ne("world","Globe"),zl=ne("grid","Grid"),bx=ne("move","GripVertical"),hx=ne("wrench","Hammer"),vx=ne("picture","Image"),da=ne("information","Info"),yx=ne("translate","Languages"),xx=ne("dimension","Layers"),Cx=ne("home","LayoutDashboard"),pa=ne("lightbulb","Lightbulb"),Vl=ne("lineChart","LineChart"),Hl=ne("synchronize","Loader2"),ua=ne("locked","Lock"),Sx=ua,Wl=ne("log","LogOut"),as=ne("email","Mail"),$l=ne("map","MapPin"),wx=ne("menu","Menu"),Im=ne("message","MessageCircle"),kx=Im,ma=ne("microphone","Mic"),Tx=ne("microphone","MicOff"),Gl=ne("darkMode","Moon"),Px=ne("overflow","MoreHorizontal"),Ix=ne("accept","PackageCheck"),Rx=ne("product","PackageSearch"),ga=ne("splitOne","PanelLeftOpen"),fa=ne("splitTwo","PanelRight"),Mx=ne("overview","PanelsTopLeft"),_l=ne("pieChart","PieChart"),_o=ne("pushpin","Pin"),Dx=ne("play","Play"),ba=ne("add","Plus"),Ax=ne("qrCode","QrCode"),Nx=ne("receipt","ReceiptText"),ha=ne("refresh","RefreshCw"),Ex=ne("activate","Rocket"),Lx=ne("refresh","RotateCcw"),Ul=ne("refresh","RotateCw"),Fx=ne("tableRow","Rows3"),Ox=ne("save","Save"),Bx=ne("qrCode","ScanLine"),Fr=ne("search","Search"),Rm=ne("paperPlane","Send"),Kl=Rm,va=ne("wrench","Settings"),zx=ne("accept","ShieldCheck"),Vx=ne("sum","Sigma"),Hx=ne("sort","SortAsc"),Wx=ne("splitTwo","SquareSplitHorizontal"),$x=ne("favorite","Star"),ql=ne("lightMode","Sun"),Gx=ne("table","Table2"),_x=ne("ipad","TabletSmartphone"),is=ne("command","Terminal"),Xl=ne("thumbDown","ThumbsDown"),Yl=ne("thumbUp","ThumbsUp"),Zl=ne("delete","Trash2"),Ux=ne("tree","TreePine"),Ql=ne("trendDown","TrendingDown"),ya=ne("warning","TriangleAlert"),Kx=ne("shipping","Truck"),jl=ne("upload","UploadCloud"),ss=ne("employee","User"),Jl=ne("sound","Volume2"),qx=ne("factory","Warehouse"),Xx=ne("process","Workflow"),or=ne("decline","X"),xa=ne("error","XCircle");$t();w();var Dm={contained:"primary",outlined:"secondary",text:"ghost"},Am={small:"orb-btn-sm",medium:void 0,large:"orb-btn-lg"},ve=Qt.forwardRef(({variant:t="primary",size:r="medium",block:o=false,loading:n=false,startIcon:a,endIcon:i,component:s,href:c,sx:p,className:u,children:d,disabled:f,type:b="button",...m},v)=>{let y=Dm[t]??t,g=["orb-btn",`orb-btn-${y}`,Am[r],o?"orb-btn-block":void 0,n?"orb-is-loading":void 0,u].filter(Boolean).join(" "),x=Ge(p,g),h=s??(c?"a":"button");return l(h,{ref:v,type:h==="button"?b:void 0,href:c,className:x.className,style:x.style,disabled:h==="button"?f||n:void 0,"aria-disabled":h!=="button"&&(f||n)?true:void 0,...m,children:[n&&e("span",{className:`orb-spin ${y==="primary"?"orb-spin-light":""}`,"aria-hidden":true}),!n&&a,d,!n&&i]})});ve.displayName="CButton";$t();w();var Be=Qt.forwardRef(({label:t,value:r,defaultValue:o,onChange:n,onFocus:a,onBlur:i,onKeyDown:s,type:c="text",placeholder:p,disabled:u,readOnly:d,required:f,autoFocus:b,autoComplete:m,name:v,id:y,error:g,helperText:x,dense:h=false,size:S,fullWidth:T=true,select:C=false,multiline:L=false,rows:A,children:I,variant:N,margin:M,onClick:k,startAdornment:D,endAdornment:R,InputProps:F,inputProps:z,InputLabelProps:K,SelectProps:V,sx:q,className:$},X)=>{let W=Qt.useId(),H=y??`orb-tf-${W}`,Q=D??F?.startAdornment,J=R??F?.endAdornment,se=(typeof g=="string"?g:void 0)??x,xe={id:H,className:`orb-inp ${h||S==="small"?"orb-inp-dense":""}`,style:T?void 0:{width:"auto"},value:r,defaultValue:o,onChange:n,onFocus:a,onBlur:i,onKeyDown:s,placeholder:p,disabled:u,required:f,autoFocus:b,autoComplete:m,name:v,onClick:k,"aria-invalid":!!g},Ke=C?e("select",{...xe,ref:X,onChange:n,children:I}):L?e("textarea",{...xe,ref:X,onChange:n,rows:A,readOnly:d||F?.readOnly}):e("input",{...xe,ref:X,onChange:n,type:c,readOnly:d||F?.readOnly,...z}),ze=Ge(q,`orb-fld ${g?"orb-is-error":""} ${$??""}`,{width:T?"100%":void 0});return l("div",{className:ze.className,style:ze.style,children:[t&&e("label",{htmlFor:H,children:t}),Q||J?l("div",{className:"orb-inp-adornment-wrap",children:[Q&&e("span",{className:"orb-inp-adornment",children:Q}),J&&e("span",{className:"orb-inp-adornment orb-inp-adornment-end",children:J}),Ke]}):Ke,se&&e("span",{className:"orb-fld-msg",children:se})]})});Be.displayName="CTextField";$t();w();var Pn=Qt.forwardRef(({label:t,value:r,defaultValue:o,onChange:n,placeholder:a,disabled:i,readOnly:s,rows:c,minRows:p=3,multiline:u,error:d,helperText:f,fullWidth:b=true,name:m,id:v,inputProps:y,sx:g,className:x},h)=>{let S=Qt.useId(),T=v??`orb-ta-${S}`,L=(typeof d=="string"?d:void 0)??f,A=Ge(g,`orb-fld ${d?"orb-is-error":""} ${x??""}`,{width:b?"100%":void 0});return l("div",{className:A.className,style:A.style,children:[t&&e("label",{htmlFor:T,children:t}),e("textarea",{ref:h,id:T,className:"orb-inp",value:r,defaultValue:o,onChange:n,placeholder:a,disabled:i,readOnly:s,rows:c??p,name:m,"aria-invalid":!!d,...y}),L&&e("span",{className:"orb-fld-msg",children:L})]})});Pn.displayName="CTextArea";$t();w();var Kt=Qt.forwardRef(({label:t,options:r,children:o,value:n,defaultValue:a,onChange:i,disabled:s,size:c,dense:p=true,fullWidth:u=true,minWidth:d,placeholder:f,displayEmpty:b,renderValue:m,multiple:v,MenuProps:y,variant:g,disableUnderline:x,onClick:h,onMouseDown:S,error:T,helperText:C,name:L,id:A,"aria-label":I,sx:N,className:M},k)=>{let D=Qt.useId(),R=A??`orb-sel-${D}`,z=(typeof T=="string"?T:void 0)??C,K=Qt.useRef(null),V=Qt.useRef(null),[q,$]=Qt.useState(false),[X,W]=Qt.useState(180),[H,Q]=Qt.useState(a??"");Qt.useImperativeHandle(k,()=>K.current);let J=Qt.useMemo(()=>Qt.Children.toArray(o).flatMap(Me=>{if(!Qt.isValidElement(Me)||Me.type!=="option")return [];let Ce=Me;return [{value:Array.isArray(Ce.props.value)?Ce.props.value[0]??"":Ce.props.value??"",label:Ce.props.children,disabled:Ce.props.disabled}]}),[o]),ge=r??J,se=n??H,fe=Array.isArray(se)?se[0]??"":se,xe=String(fe??""),Ke=ge.find(Me=>String(Me.value)===xe),ze=m?m(se):Ke?.label??(xe||(f??"")),Re=Ge(N,`orb-fld ${T?"orb-is-error":""} ${M??""}`,{width:u?"100%":void 0,minWidth:typeof d=="number"?`${d}px`:d});if(v)return l("div",{className:Re.className,style:Re.style,children:[t&&e("label",{htmlFor:R,children:t}),l("select",{ref:k,id:R,className:`orb-inp ${p||c==="small"?"orb-inp-dense":""}`,value:n,defaultValue:a,onChange:i,disabled:s,name:L,multiple:true,onClick:h,onMouseDown:S,"aria-invalid":!!T,"aria-label":I,children:[f!==void 0&&e("option",{value:"",children:f}),r?r.map(Me=>e("option",{value:Me.value,disabled:Me.disabled,children:Me.label},Me.value)):o]}),z&&e("span",{className:"orb-fld-msg",children:z})]});let Ve=Me=>{n===void 0&&Q(Me);let Ce=K.current;Ce&&(Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value")?.set?.call(Ce,Me),i?.({target:Ce,currentTarget:Ce}));};return l("div",{className:Re.className,style:Re.style,children:[t&&e("label",{htmlFor:R,children:t}),e("select",{ref:K,className:"orb-visually-hidden",tabIndex:-1,"aria-hidden":"true",name:L,value:xe,disabled:s,onChange:()=>{},children:ge.map(Me=>e("option",{value:Me.value,disabled:Me.disabled,children:Me.label},String(Me.value)))}),l(Mr__namespace.Root,{open:q,onOpenChange:Me=>{Me&&W(V.current?.getBoundingClientRect().width??180),$(Me);},children:[e(Mr__namespace.Trigger,{asChild:true,children:l("button",{ref:V,id:R,type:"button",className:`orb-inp orb-select-trigger ${p||c==="small"?"orb-inp-dense":""}`,disabled:s,"aria-invalid":!!T,"aria-label":I,"aria-haspopup":"listbox","data-placeholder":!Ke&&!xe?"":void 0,onClick:h,onMouseDown:S,children:[e("span",{className:"orb-select-value",children:ze}),e(Mt,{className:"orb-select-chevron",name:"slimDown",size:12})]})}),e(Mr__namespace.Portal,{children:e(Mr__namespace.Content,{className:"orb-pop orb-select-menu",align:"start",sideOffset:5,collisionPadding:8,style:{minWidth:X},children:e(Mr__namespace.RadioGroup,{value:xe,onValueChange:Ve,children:ge.map(Me=>l(Mr__namespace.RadioItem,{className:"orb-select-option",value:String(Me.value),disabled:Me.disabled,children:[e("span",{className:"orb-select-check","aria-hidden":"true",children:String(Me.value)===xe?e(Mt,{name:"accept",size:13}):null}),e("span",{children:Me.label})]},String(Me.value)))})})})]}),z&&e("span",{className:"orb-fld-msg",children:z})]})});Kt.displayName="CSelect";$t();w();var Dt=Qt.forwardRef(({label:t,checked:r,defaultChecked:o,onChange:n,disabled:a,indeterminate:i,name:s,value:c,id:p,size:u,color:d,onClick:f,inputProps:b,sx:m,className:v},y)=>{let g=Ge([{...u==="small"?{fontSize:13}:void 0,...d?{color:d}:void 0},...Array.isArray(m)?m:m?[m]:[]],`orb-chk ${v??""}`),x=e("input",{ref:h=>{h&&(h.indeterminate=!!i),typeof y=="function"?y(h):y&&(y.current=h);},type:"checkbox",id:p,checked:r,defaultChecked:o,onChange:n,readOnly:r!==void 0&&n===void 0,disabled:a,name:s,value:c,onClick:f,...b});return t==null?e("span",{className:g.className,style:g.style,children:x}):l("label",{className:g.className,style:g.style,children:[x,e("span",{children:t})]})});Dt.displayName="CCheckbox";w();var _m=({label:t,options:r,value:o,defaultValue:n,onChange:a,name:i,row:s=false,disabled:c,sx:p,className:u})=>{let d=Qt.useId(),f=i??`orb-rdo-${d}`;return l("div",{className:`orb-fld ${u??""}`,style:p,role:"radiogroup",children:[t&&e("span",{className:"orb-fld-label",children:t}),e("div",{style:{display:"flex",flexDirection:s?"row":"column",gap:s?24:8,flexWrap:"wrap"},children:r.map(b=>l("label",{className:"orb-rdo",children:[e("input",{type:"radio",name:f,value:b.value,checked:o!==void 0?o===b.value:void 0,defaultChecked:n!==void 0?n===b.value:void 0,onChange:a?m=>a(m,b.value):void 0,disabled:c||b.disabled}),e("span",{children:b.label})]},b.value))})]})};$t();w();var Ca=Qt.forwardRef(({label:t,checked:r,defaultChecked:o,onChange:n,disabled:a,name:i,id:s,size:c,sx:p,className:u},d)=>{let f=Ge([{...c==="small"?{transform:"scale(.86)",transformOrigin:"center"}:void 0},...Array.isArray(p)?p:p?[p]:[]],`orb-sw ${u??""}`),b=e("input",{ref:d,type:"checkbox",role:"switch",id:s,checked:r,defaultChecked:o,onChange:n?m=>n(m,m.target.checked):void 0,disabled:a,name:i});return t==null?e("span",{className:f.className,style:f.style,children:b}):l("label",{className:f.className,style:f.style,children:[b,e("span",{children:t})]})});Ca.displayName="CSwitch";$t();w();var qm={default:"gray",primary:"blue",success:"blue",info:"blue",warning:"orange",error:"orange"},Tt=Qt.forwardRef(({label:t,children:r,tone:o,color:n="default",variant:a,size:i="medium",clickable:s,avatar:c,icon:p,onDelete:u,onClick:d,sx:f,className:b},m)=>{let v=o??(a==="outlined"&&n==="default"?"outline":qm[n]??"gray"),y=s??!!d,g=Ge([{cursor:y?"pointer":void 0,...i==="small"?{height:24,fontSize:11,px:1}:void 0},...Array.isArray(f)?f:f?[f]:[]],`orb-chip orb-chip-${v} ${b??""}`);return l("span",{ref:m,className:g.className,style:g.style,onClick:d,role:y?"button":void 0,tabIndex:y?0:void 0,onKeyDown:y?x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),d?.(x));}:void 0,children:[c??p,e("span",{className:"orb-chip-label",children:r??t}),u&&e("button",{type:"button","aria-label":"Remove",onClick:x=>{x.stopPropagation(),u(x);},style:{background:"none",border:"none",padding:0,display:"inline-flex",cursor:"pointer",color:"inherit"},children:e(or,{size:13,strokeWidth:2})})]})});Tt.displayName="CChip";$t();w();var Sa=Qt.forwardRef(({badgeContent:t,color:r="primary",children:o,invisible:n=false,sx:a,className:i},s)=>{let c=Ge(a,i,{display:"inline-flex",position:o?"relative":void 0}),p=!n&&t!==void 0&&t!==null&&e("span",{className:`orb-badge ${r==="error"?"orb-badge-err":r==="muted"?"orb-badge-muted":""}`,style:o?{position:"absolute",top:-6,right:-6,zIndex:1}:void 0,children:t});return o?l("span",{ref:s,className:c.className,style:c.style,children:[o,p]}):e("span",{ref:s,className:c.className,style:c.style,children:p})});Sa.displayName="CBadge";$t();w();var Uo=Qt.forwardRef(({children:t,src:r,alt:o,size:n=28,sx:a,className:i},s)=>{let c=Ge([{width:n,height:n,fontSize:n*.4},...Array.isArray(a)?a:a?[a]:[]],`orb-avatar ${i??""}`);return e("span",{ref:s,className:c.className,style:c.style,children:r?e("img",{src:r,alt:o??"",style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover"}}):t})});Uo.displayName="CAvatar";$t();w();var Ko=Qt.forwardRef(({severity:t="info",title:r,children:o,onClose:n,sx:a,className:i},s)=>{let c=Ge(a,`orb-alert orb-alert-${t} ${i??""}`);return l("div",{ref:s,role:"alert",className:c.className,style:c.style,children:[l("div",{style:{flex:1,minWidth:0},children:[r&&e("b",{children:r}),o&&e("span",{children:o})]}),n&&e("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"})]})});Ko.displayName="CAlert";$t();w();var In=({value:t,variant:r,color:o,sx:n,className:a})=>{let i=r==="indeterminate"||t===void 0,s=Ge(n,`orb-prog ${a??""}`);return l("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:[e("i",{style:i?{width:"40%",animation:"orb-prog-ind 1.2s ease-in-out infinite"}:{width:`${Math.min(100,Math.max(0,t))}%`,background:o}}),i&&e("style",{children:"@keyframes orb-prog-ind { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }"})]})},Qm=({width:t,height:r=14,variant:o="rectangular",sx:n,className:a})=>e("div",{className:`orb-skel ${a??""}`,style:{width:t,height:r,borderRadius:o==="circular"?"50%":o==="text"?6:"var(--orb-r)",...n}}),Gr=({size:t=12,onPrimary:r=false,sx:o,className:n})=>e("span",{className:`orb-spin ${r?"orb-spin-light":""} ${n??""}`,style:{width:t,height:t,...o},role:"status","aria-label":"Loading"});w();var it=({title:t,children:r,enterDelay:o=300,side:n="top",align:a="center",disabled:i})=>!t||i?e(jsxRuntime.Fragment,{children:r}):e(_r__namespace.Provider,{delayDuration:o,skipDelayDuration:200,children:l(_r__namespace.Root,{children:[e(_r__namespace.Trigger,{asChild:true,children:r}),e(_r__namespace.Portal,{children:e(_r__namespace.Content,{className:"orb-tooltip",side:n,align:a,sideOffset:6,children:t})})]})});$t();w();var ae=Qt.forwardRef(({tooltip:t,size:r="small",active:o=false,edge:n,color:a,sx:i,className:s,children:c,type:p="button",...u},d)=>{let f=Ge([{color:o?"var(--orb-primary)":a,...n==="start"?{marginLeft:-8}:n==="end"?{marginRight:-8}:void 0},...Array.isArray(i)?i:i?[i]:[]],`orb-icon-btn ${r==="small"?"orb-icon-btn-sm":""} ${s??""}`),b=e("button",{ref:d,type:p,className:f.className,style:f.style,...u,children:c});return t?e(it,{title:t,children:b}):b});ae.displayName="CIconButton";$t();w();var Rn=({value:t,options:r,onValueChange:o,size:n="medium",sx:a,className:i,...s})=>{let c=Qt.useRef([]),p=r.findIndex(m=>!m.disabled),u=r.findIndex(m=>m.value===t),d=(m,v)=>{let y=r.map((h,S)=>h.disabled?-1:S).filter(h=>h>=0);if(y.length===0)return;let g=y.indexOf(v),x;m.key==="Home"&&(x=y[0]),m.key==="End"&&(x=y[y.length-1]),(m.key==="ArrowRight"||m.key==="ArrowDown")&&(x=y[(g+1+y.length)%y.length]),(m.key==="ArrowLeft"||m.key==="ArrowUp")&&(x=y[(g-1+y.length)%y.length]),x!==void 0&&(m.preventDefault(),c.current[x]?.focus(),o(r[x].value));},f=Ge(a,["orb-segmented-control",n==="small"?"orb-segmented-control-sm":"",i].filter(Boolean).join(" ")),b={...f.style,"--orb-segmented-count":Math.max(r.length,1),"--orb-segmented-index":Math.max(u,0)};return l("div",{role:"radiogroup",className:f.className,style:b,"data-has-selection":u>=0?"true":"false",...s,children:[e("span",{className:"orb-segmented-control-thumb","aria-hidden":"true"}),r.map((m,v)=>{let y=m.value===t;return e(ae,{ref:g=>{c.current[v]=g;},className:["orb-segmented-control-item",m.icon?"":"orb-segmented-control-item-label"].filter(Boolean).join(" "),size:n,tooltip:m.label,role:"radio","aria-label":m.label,"aria-checked":y,"data-selected":y?"true":void 0,disabled:m.disabled,tabIndex:y||t==null&&v===p?0:-1,onClick:()=>o(m.value),onKeyDown:g=>d(g,v),children:m.icon??e("span",{className:"orb-segmented-control-label",children:m.label})},m.value)})]})};$t();w();var Yt=({triggerLabel:t,items:r=[],trigger:o,align:n="start",anchorEl:a,open:i,onClose:s,children:c,slotProps:p,PaperProps:u,anchorPosition:d,sx:f})=>{let b=Qt.useRef(null);if(Qt.useEffect(()=>{if(i!==true)return;let m=y=>{let g=y.composedPath();b.current&&g.includes(b.current)||a&&g.includes(a)||s?.();},v=y=>{y.key==="Escape"&&s?.();};return document.addEventListener("pointerdown",m,true),document.addEventListener("keydown",v,true),()=>{document.removeEventListener("pointerdown",m,true),document.removeEventListener("keydown",v,true);}},[a,s,i]),i!==void 0){if(!i||typeof document>"u")return null;let m=a?.getBoundingClientRect(),v=window.innerWidth,y=m?.left??16,g=m?.right??y,x=p?.paper?.sx??u?.sx,h=Ge([...Array.isArray(x)?x:x?[x]:[],...Array.isArray(f)?f:f?[f]:[]],"orb-pop orb-menu",p?.paper?.style??u?.style),S=Qt.Children.map(c,T=>{if(!Qt.isValidElement(T)||T.type!=="option")return T;let C=T.props,{children:L,disabled:A,selected:I}=C,N=Ge(C.sx,`orb-menu-item ${I?"orb-selected":""} ${C.className??""}`,C.style);return e("div",{role:"menuitem","aria-disabled":A||void 0,"aria-selected":I||void 0,tabIndex:A?-1:0,id:C.id,title:C.title,className:N.className,style:N.style,onClick:A?void 0:C.onClick,onKeyDown:M=>{!A&&(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),C.onClick?.(M));},children:L})});return reactDom.createPortal(e("div",{ref:b,role:"menu",className:h.className,style:{...h.style,position:"fixed",left:n==="end"&&!d?void 0:d?.left??y,right:n==="end"&&!d?Math.max(16,v-g):void 0,top:d?.top??(m?.bottom??16)+6,maxWidth:"calc(100vw - 32px)",zIndex:1301},children:S}),document.body)}return l(Mr__namespace.Root,{children:[e(Mr__namespace.Trigger,{asChild:true,children:o??e(ve,{variant:"primary",children:t})}),e(Mr__namespace.Portal,{children:e(Mr__namespace.Content,{className:"orb-pop orb-menu",align:n,sideOffset:6,children:r.map((m,v)=>l(Mr__namespace.Item,{className:"orb-menu-item",disabled:m.disabled,onSelect:()=>m.onClick?.(),children:[m.icon,m.label]},v))})})]})};$t();w();var Ne=Qt.forwardRef(({elevation:t=1,variant:r,component:o,sx:n,style:a,className:i,children:s,...c},p)=>{let u=o??"div",d=Ge(n,`orb-card ${t>0&&r!=="outlined"?"orb-card-raised":""} ${i??""}`,a);return e(u,{ref:p,className:d.className,style:d.style,...c,children:s})});Ne.displayName="CPaper";$t();w();var Nt=Qt.forwardRef(({orientation:t="horizontal",flexItem:r,sx:o,className:n},a)=>{let i=Ge([{...t==="vertical"?{alignSelf:"stretch",height:"auto"}:{width:"100%"},...r?{alignSelf:"stretch"}:void 0},...Array.isArray(o)?o:o?[o]:[]],`${t==="vertical"?"orb-divider-v":"orb-divider"} ${n??""}`);return e("hr",{ref:a,"aria-orientation":t,className:i.className,style:i.style})});Nt.displayName="CDivider";$t();w();var lg={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"},cg={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6"},E=Qt.forwardRef(({variant:t="body1",component:r,muted:o=false,numeric:n=false,color:a,noWrap:i=false,fontWeight:s,sx:c,className:p,children:u,...d},f)=>{let b=r??cg[t]??"span",v=[t==="inherit"?void 0:lg[t],p].filter(Boolean).join(" "),y=Ge([{...o?{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 e(b,{ref:f,className:y.className,style:y.style,...d,children:u})});E.displayName="CTypography";$t();w();var pg=t=>{if(t!==void 0)return typeof t=="number"?`${t*8}px`:t},ie=Qt.forwardRef(({direction:t="column",spacing:r,alignItems:o,justifyContent:n,flexWrap:a,flex:i,useFlexGap:s,sx:c,className:p,children:u,...d},f)=>{let b=Ge([{display:"flex",flexDirection:t,gap:pg(r),alignItems:o,justifyContent:n,flexWrap:a,flex:i},...Array.isArray(c)?c:c?[c]:[]],p);return e("div",{ref:f,className:b.className,style:b.style,...d,children:u})});ie.displayName="CStack";$t();w();var Vt=({open:t,onClose:r,title:o,children:n,actions:a,maxWidth:i=560,fullWidth:s=false,fullScreen:c=false,PaperProps:p,slotProps:u,disableRestoreFocus:d,keepMounted:f,hideCloseButton:b=false,sx:m,className:v})=>{let y=Ge([{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(p?.sx??u?.paper?.sx)?p?.sx??u?.paper?.sx:p?.sx??u?.paper?.sx?[p?.sx??u?.paper?.sx]:[],...Array.isArray(m)?m:m?[m]:[]],`orb-dialog ${v??""}`);return e(Cr__namespace.Root,{open:t,onOpenChange:g=>{g||r?.();},children:l(Cr__namespace.Portal,{children:[e(Cr__namespace.Overlay,{className:"orb-overlay"}),l(Cr__namespace.Content,{className:y.className,style:y.style,children:[(o||!b)&&l("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:16},children:[o?e(Cr__namespace.Title,{className:"orb-dialog-title",children:o}):e(Cr__namespace.Title,{className:"orb-visually-hidden",children:"Dialog"}),!b&&e(Cr__namespace.Close,{asChild:true,children:e("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Close",style:{marginTop:-4,marginRight:-4},children:e(or,{size:16,strokeWidth:2})})})]}),e("div",{style:{minWidth:0},children:n}),a&&e("div",{className:"orb-dialog-actions",children:a})]})]})})};w();var cs=({open:t,defaultOpen:r,onOpenChange:o,trigger:n,children:a,align:i="start",side:s="bottom",sideOffset:c=6,matchTriggerWidth:p=false,sx:u,className:d})=>l(lo__namespace.Root,{open:t,defaultOpen:r,onOpenChange:o,children:[e(lo__namespace.Trigger,{asChild:true,children:n}),e(lo__namespace.Portal,{children:e(lo__namespace.Content,{className:`orb-pop ${d??""}`,align:i,side:s,sideOffset:c,style:{minWidth:p?"var(--radix-popover-trigger-width)":void 0,...u},onOpenAutoFocus:f=>f.preventDefault(),children:a})})]});w();var gg=({items:t,value:r,defaultValue:o,onChange:n,sx:a,className:i})=>{let s=r!==void 0,[c,p]=Qt.useState(o??t[0]?.value),u=s?r:c,d=Qt.useRef([]),f=m=>{s||p(m),n?.(m);},b=m=>{if(m.key!=="ArrowRight"&&m.key!=="ArrowLeft")return;m.preventDefault();let v=t.filter(h=>!h.disabled),y=v.findIndex(h=>h.value===u),g=m.key==="ArrowRight"?1:-1,x=v[(y+g+v.length)%v.length];if(x){f(x.value);let h=t.findIndex(S=>S.value===x.value);d.current[h]?.focus();}};return e("div",{className:`orb-tabs ${i??""}`,role:"tablist",style:a,onKeyDown:b,children:t.map((m,v)=>{let y=m.value===u;return l("button",{ref:g=>{d.current[v]=g;},type:"button",role:"tab","aria-selected":y,disabled:m.disabled,className:`orb-tab ${y?"orb-is-active":""}`,style:{display:"inline-flex",alignItems:"center",gap:6},onClick:()=>f(m.value),children:[m.icon,m.label]},m.value)})})};w();var bg=["su","mo","tu","we","th","fr","sa"],Mn=(t,r)=>!!(t&&r&&t.isSame(r,"day")),Dn=({value:t,rangeStart:r,rangeEnd:o,onChange:n,month:a,defaultMonth:i,onMonthChange:s,minDate:c,maxDate:p,locale:u,renderDay:d})=>{let f=a!==void 0,[b,m]=Qt.useState(()=>i??t??r??Qr__default.default()),v=(f?a:b).startOf("month"),y=C=>{f||m(C),s?.(C);},g=Qt.useMemo(()=>u?v.locale(u):v,[v,u]),x=Qt.useMemo(()=>{let L=v.startOf("month").startOf("week"),A=[],I=L;for(let N=0;N<6;N+=1){let M=[];for(let k=0;k<7;k+=1)M.push(I),I=I.add(1,"day");if(A.push(M),I.isAfter(v.endOf("month"))&&N>=3)break}return A},[v]),h=Qt.useMemo(()=>{let C=u?Qr__default.default().locale(u):Qr__default.default();return bg.map((L,A)=>C.startOf("week").add(A,"day").format("dd"))},[u]),S=C=>!!(c&&C.isBefore(c.startOf("day"))||p&&C.isAfter(p.startOf("day"))),T=r!==void 0||o!==void 0;return l("div",{className:"orb-cal",children:[l("div",{className:"orb-cal-head",children:[e("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Previous month",onClick:()=>y(v.subtract(1,"month")),children:e(Nl,{size:16,strokeWidth:2})}),e("span",{className:"orb-cal-title","aria-live":"polite",children:g.format("MMMM YYYY")}),e("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Next month",onClick:()=>y(v.add(1,"month")),children:e(Lr,{size:16,strokeWidth:2})})]}),l("div",{className:"orb-cal-grid",role:"grid",children:[h.map((C,L)=>e("span",{className:"orb-cal-dow",children:C},`${C}-${L}`)),x.flat().map(C=>{let L=!C.isSame(v,"month"),A=S(C),I=T?Mn(C,r)||Mn(C,o):Mn(C,t),N=C.isSame(Qr__default.default(),"day"),M=T&&r&&o&&C.isAfter(r.startOf("day"))&&C.isBefore(o.startOf("day")),k=T&&Mn(C,r)&&!!o,D=T&&Mn(C,o)&&!!r,R=["orb-cal-day",L?"orb-is-outside":void 0,N?"orb-is-today":void 0,I?"orb-is-selected":void 0,M?"orb-is-in-range":void 0,k?"orb-is-range-start":void 0,D?"orb-is-range-end":void 0].filter(Boolean).join(" ");return d?e("span",{className:"orb-cal-day-slot",children:d(C,{outsideCurrentMonth:L,selected:I,today:N,disabled:A})},C.format("YYYY-MM-DD")):e("button",{type:"button",role:"gridcell","aria-selected":I,"aria-current":N?"date":void 0,className:R,disabled:A,onClick:()=>n?.(C),children:C.date()},C.format("YYYY-MM-DD"))})]})]})};w();Qr__default.default.extend(hg__default.default);var vg=({label:t,value:r,defaultValue:o,onChange:n,minDate:a,maxDate:i,disabled:s,format:c="YYYY-MM-DD",placeholder:p,locale:u,dense:d=false,error:f,helperText:b,sx:m,className:v})=>{let y=r!==void 0,[g,x]=Qt.useState(o??null),h=y?r:g,[S,T]=Qt.useState(false),[C,L]=Qt.useState(null),A=D=>{y||x(D),n?.(D);},I=C??(h?(u?h.locale(u):h).format(c):""),N=()=>{if(C===null)return;let D=C.trim();if(!D)A(null);else {let R=Qr__default.default(D,c,true);R.isValid()&&!(a&&R.isBefore(a.startOf("day")))&&!(i&&R.isAfter(i.startOf("day")))&&A(R);}L(null);},k=(typeof f=="string"?f:void 0)??b;return l("div",{className:`orb-fld ${f?"orb-is-error":""} ${v??""}`,style:m,children:[t&&e("label",{children:t}),e(cs,{open:S,onOpenChange:T,trigger:l("div",{className:"orb-inp-adornment-wrap",style:{width:"100%"},children:[e("span",{className:"orb-inp-adornment",children:e(ns,{size:15,strokeWidth:1.8})}),e("input",{className:`orb-inp ${d?"orb-inp-dense":""}`,value:I,placeholder:p??c,disabled:s,onFocus:()=>T(true),onChange:D=>L(D.target.value),onBlur:N,onKeyDown:D=>{D.key==="Enter"&&(N(),T(false)),D.key==="Escape"&&T(false);}})]}),children:e(Dn,{value:h,onChange:D=>{A(D),L(null),T(false);},minDate:a,maxDate:i,locale:u,defaultMonth:h??void 0})}),k&&e("span",{className:"orb-fld-msg",children:k})]})};w();var xg=({onFilesSelected:t,multiple:r=false,accept:o="*",maxSize:n,title:a="Drag and drop files here or click to upload",subtitle:i="Support for bulk upload",sx:s})=>{let[c,p]=Qt.useState(false),[u,d]=Qt.useState([]),f=Qt.useRef(null),b=h=>{h.preventDefault(),p(true);},m=h=>{h.preventDefault(),p(false);},v=h=>{h.preventDefault(),p(false),g(Array.from(h.dataTransfer.files));},y=h=>{h.target.files&&g(Array.from(h.target.files));},g=h=>{let S=n?h.filter(C=>C.size<=n):h;S.length<h.length&&console.warn(`Some files were rejected because they exceed the maximum size of ${n} bytes.`);let T=r?[...u,...S]:S;r&&(T=T.filter((C,L,A)=>L===A.findIndex(I=>I.name===C.name&&I.size===C.size&&I.lastModified===C.lastModified))),d(T),t?.(T),f.current&&(f.current.value="");},x=h=>{let S=u.filter((T,C)=>C!==h);d(S),t?.(S);};return l("div",{style:{width:"100%",...s},children:[l("div",{onClick:()=>f.current?.click(),onDragOver:b,onDragLeave:m,onDrop:v,role:"button",tabIndex:0,onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),f.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:[e("input",{type:"file",ref:f,style:{display:"none"},multiple:r,accept:o,onChange:y}),l("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[e(jl,{size:40,strokeWidth:1.5,color:c?"var(--orb-primary)":"var(--orb-muted)"}),e("span",{className:"orb-subtitle",children:a}),e("span",{className:"orb-meta",children:i})]})]}),u.length>0&&e("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:16},children:u.map((h,S)=>l("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:[l("div",{style:{display:"flex",alignItems:"center",gap:8,overflow:"hidden"},children:[e(Ol,{size:16,strokeWidth:1.8,color:"var(--orb-muted)"}),e("span",{className:"orb-body-dense",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:h.name}),l("span",{className:"orb-meta",children:["(",(h.size/1024).toFixed(1)," KB)"]})]}),e(ae,{"aria-label":`Remove ${h.name}`,onClick:()=>x(S),children:e(Zl,{size:15,strokeWidth:1.8})})]},`${h.name}-${S}`))})]})};function mr(...t){return tailwindMerge.twMerge(clsx.clsx(t))}var ka={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"},An={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},oc=()=>"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";w();var Tg=classVarianceAuthority.cva(oc(),{variants:{variant:{default:`${ka.primary} shadow-sm`,destructive:"bg-[var(--orb-status-error)] text-[var(--orb-on-primary)] hover:opacity-90 active:opacity-80 shadow-sm",outline:`${ka.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:ka.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:An.none,sm:An.sm,md:An.md,full:An.full}},defaultVariants:{variant:"default",size:"default",rounded:"md"}}),us=Qt__namespace.forwardRef(({className:t,variant:r,size:o,asChild:n=false,...a},i)=>e(n?reactSlot.Slot:"button",{className:mr(Tg({variant:r,size:o,className:t})),ref:i,...a}));us.displayName="Button";var Pg={"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.searchSend":"Send","header.searchStartVoice":"Start voice input","header.searchStopVoice":"Stop voice input","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"},Ig={"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.searchSend":"\u53D1\u9001","header.searchStartVoice":"\u5F00\u59CB\u8BED\u97F3\u8F93\u5165","header.searchStopVoice":"\u505C\u6B62\u8BED\u97F3\u8F93\u5165","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"},Rg={"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.searchSend":"Envoyer","header.searchStartVoice":"D\xE9marrer la saisie vocale","header.searchStopVoice":"Arr\xEAter la saisie vocale","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"},Mg={"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.searchSend":"Senden","header.searchStartVoice":"Spracheingabe starten","header.searchStopVoice":"Spracheingabe stoppen","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"},Dg={"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.searchSend":"\u9001\u4FE1","header.searchStartVoice":"\u97F3\u58F0\u5165\u529B\u3092\u958B\u59CB","header.searchStopVoice":"\u97F3\u58F0\u5165\u529B\u3092\u505C\u6B62","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"},Ag={"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.searchSend":"\uBCF4\uB0B4\uAE30","header.searchStartVoice":"\uC74C\uC131 \uC785\uB825 \uC2DC\uC791","header.searchStopVoice":"\uC74C\uC131 \uC785\uB825 \uC911\uC9C0","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"},Nn={en:Pg,zh:Ig,fr:Rg,de:Mg,ja:Dg,ko:Ag};w();var ac=(t,r)=>r?t.replace(/\{(\w+)\}/g,(o,n)=>{let a=r[n];return a==null?"":String(a)}):t,Fg={locale:"en",t:(t,r)=>ac(Nn.en[t]||t,r)},ic=Qt.createContext(Fg),Ta=({locale:t="en",messages:r,children:o})=>{let n=Qt.useMemo(()=>{let a=Nn[t]||Nn.en,i=r?.[t]||{},s={...Nn.en,...a,...i};return {locale:t,t:(c,p)=>ac(s[c]||c,p)}},[t,r]);return e(ic.Provider,{value:n,children:o})},de=()=>Qt.useContext(ic);w();function En({items:t,onItemClick:r,className:o="",level:n=0,expandedIds:a,onToggleExpand:i,colorMode:s="light",enablePinning:c=false,pinnedIds:p,onTogglePin:u}){let{t:d}=de(),f=s==="dark",b=navigation.usePathname(),[m,v]=Qt.useState(false),[y,g]=Qt.useState(new Set),x=a!==void 0&&i!==void 0,h=x?a:y;Qt.useEffect(()=>{v(true);},[]);let S=C=>{if(x)i(C);else {let L=new Set(y);L.has(C)?L.delete(C):L.add(C),g(L);}},T=C=>{C.children&&C.children.length>0&&S(C.id),r&&r(C);};return !t||!Array.isArray(t)?e("div",{className:mr("tree-menu",o),children:e("div",{className:"text-sm text-[var(--orb-muted)] p-2",children:d("navigation.noItems")})}):e("div",{className:mr("tree-menu",o),children:t.map(C=>{let L=h.has(C.id)||C.isExpanded,A=C.children&&C.children.length>0,N=56+Math.max(0,n-1)*8,M=n===0?12:A?N-24:N,k=C.appurl||C.href,D=m&&k?b===k:false,R=p?.has(C.id)??false,F=c&&C.pinnable!==false&&!!k&&!A;return l("div",{className:"tree-menu-item relative",children:[D&&e("div",{className:mr("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10","bg-[var(--orb-nav-active-fg)]")}),l(us,{variant:"ghost",className:mr("w-full justify-start h-auto py-2 relative overflow-hidden group",n>0?"gap-1":"gap-2",A&&L&&!D?f?"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",D?f?"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)]":f?"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:`${M}px`,paddingRight:F?"34px":"10px"},onClick:()=>T(C),children:[A&&e("div",{className:mr("flex-shrink-0 transition-transform duration-200",L&&"rotate-90",D?"text-[var(--orb-nav-active-fg)]":f?"text-[var(--orb-muted)] group-hover:text-[var(--orb-fg)]":"text-[var(--orb-muted)] group-hover:text-[var(--orb-muted)]"),children:e(Lr,{className:"h-4 w-4"})}),C.icon&&e("div",{className:mr("flex h-4 w-4 flex-shrink-0 items-center justify-center transition-colors duration-200",D?"text-[var(--orb-nav-active-fg)]":f?"text-[var(--orb-muted)] group-hover:text-[var(--orb-fg)]":"text-[var(--orb-muted)] group-hover:text-[var(--orb-muted)]"),children:C.icon}),l("div",{className:"flex-1 text-left overflow-hidden z-10",children:[e("div",{className:mr("text-sm truncate transition-colors duration-200",D?"font-semibold":"font-medium"),children:C.title||C.label}),C.description&&e("div",{className:mr("text-xs truncate transition-colors duration-200",D?f?"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:C.description,children:C.description})]})]}),F&&u&&e("button",{type:"button","aria-label":d(R?"navigation.pin.remove":"navigation.pin.add"),"aria-pressed":R,title:d(R?"navigation.pin.remove":"navigation.pin.add"),onClick:z=>{z.preventDefault(),z.stopPropagation(),u(C);},className:mr("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",R&&"orb-is-pinned"),children:e(_o,{className:mr("h-3.5 w-3.5",R&&"fill-current")})}),A&&e("div",{className:mr("grid transition-[grid-template-rows] duration-300 ease-in-out",L?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:e("div",{className:mr("overflow-hidden",L&&"pt-1"),children:e(En,{items:C.children,onItemClick:r,level:n+1,expandedIds:a,onToggleExpand:i,colorMode:s,enablePinning:c,pinnedIds:p,onTogglePin:u})})})]},C.id)})})}w();var Vg="orbcafe:navigation-island:pinned-items",ms="orbcafe-navigation-pinned",Hg=t=>t.appurl||t.href,lc=t=>{let r=[];return t.forEach(o=>{let n=!!o.children?.length;o.pinnable!==false&&Hg(o)&&!n&&r.push({...o,children:void 0}),o.children?.length&&r.push(...lc(o.children));}),r},cc=({collapsed:t,onToggle:r,className:o="",maxHeight:n,menuData:a=[],colorMode:i="light",displayMode:s="fixed",onDisplayModeChange:c,showDisplayModeToggle:p=true,enablePinning:u=true,pinStorageKey:d=Vg,pinnedItemIds:f,defaultPinnedItemIds:b=[],onPinnedItemIdsChange:m,pinnedSectionTitle:v})=>{let{t:y}=de(),g=i==="dark",x=s==="floating",h=navigation.useRouter(),[S,T]=Qt.useState(""),[C,L]=Qt.useState(new Set),[A,I]=Qt.useState(b),[N,M]=Qt.useState(false),k=f!==void 0,D=Qt.useMemo(()=>f??A,[f,A]),R=Qt.useMemo(()=>new Set(D),[D]);Qt.useEffect(()=>{t&&L(new Set);},[t]),Qt.useEffect(()=>{if(!u||k){M(true);return}try{let H=window.localStorage.getItem(d);if(H){let Q=JSON.parse(H);Array.isArray(Q)&&I(Q.filter(J=>typeof J=="string"));}}catch{}finally{M(true);}},[u,k,d]),Qt.useEffect(()=>{if(!(!u||k||!N))try{window.localStorage.setItem(d,JSON.stringify(D));}catch{}},[D,u,k,d,N]),Qt.useEffect(()=>{!u||t||D.length===0||L(H=>{if(H.has(ms))return H;let Q=new Set(H);return Q.add(ms),Q});},[t,D.length,u]);let F=Qt.useCallback(H=>{let Q=Array.from(new Set(H));k||I(Q),m?.(Q);},[k,m]),z=Qt.useCallback(H=>{let Q=H.id,J=R.has(Q)?D.filter(ge=>ge!==Q):[...D,Q];F(J);},[D,R,F]),K=Qt.useMemo(()=>{if(!u||D.length===0)return a;let H=new Map(lc(a).map(J=>[J.id,J])),Q=D.map(J=>H.get(J)).filter(J=>!!J);return Q.length===0?a:[{id:ms,title:v||y("navigation.pinned"),icon:e(_o,{className:"w-4 h-4"}),children:Q,pinnable:false},...a]},[D,u,a,v,y]),V=Qt.useCallback(H=>{let Q=[],J=ge=>{ge.forEach(se=>{Q.push(se.id),se.children&&J(se.children);});};return J(H),Q},[]),q=Qt.useMemo(()=>{if(!S.trim())return K;let H=Q=>Q.reduce((J,ge)=>{let se=ge.title?.toLowerCase().includes(S.toLowerCase())||ge.description?.toLowerCase().includes(S.toLowerCase()),fe=ge.children?H(ge.children):[];return (se||fe.length>0)&&J.push({...ge,children:fe.length>0?fe:ge.children}),J},[]);return H(K)},[S,K]),$=Qt.useMemo(()=>S.trim()?new Set(V(K)):C,[S,K,C,V]),X=Qt.useCallback(async H=>{if(console.log("\u{1F5B1}\uFE0F \u5BFC\u822A\u83DC\u5355\u9879\u70B9\u51FB:",H),H.id==="chat"||H.appurl==="/chat"){console.log("\u{1F4AC} \u68C0\u6D4B\u5230chat\u83DC\u5355\u70B9\u51FB\uFF0C\u8DF3\u8F6C\u5230\u65B0\u7684\u804A\u5929\u89C6\u56FE");try{h.push("/chat?new=true");}catch(J){console.error("\u274C \u65E0\u6CD5\u8DF3\u8F6C\u5230\u65B0\u804A\u5929\u89C6\u56FE:",J),h.push("/chat");}return}let Q=H.appurl||H.href;Q&&(Q.startsWith("http://")||Q.startsWith("https://")?window.open(Q,"_blank"):h.push(Q));},[h]),W=Qt.useCallback(()=>{c?.(s==="fixed"?"floating":"fixed");},[s,c]);return l("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 ${o} ${g?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?"rgba(8, 12, 18, 0.34)":"rgba(255, 255, 255, 0.24)":void 0,backgroundImage:x?g?"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?"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:[e("div",{className:`pt-4 pb-2 transition-all duration-500 ease-in-out ${t?"px-1":"px-2"}`,children:t?e("div",{className:"flex justify-center",children:e("button",{onClick:r,className:`w-10 h-10 flex items-center justify-center rounded-lg transition-colors duration-200 ${g?"text-[var(--orb-fg)] hover:bg-[var(--orb-surface-2)]":"text-[var(--orb-muted)] hover:bg-[var(--orb-surface)]"}`,title:y("navigation.expand"),children:e(Fr,{className:"h-5 w-5"})})}):l("div",{className:`relative transition-opacity duration-300 ${t?"opacity-0":"opacity-100 delay-200"}`,children:[e("input",{type:"text",placeholder:y("navigation.searchPlaceholder"),value:S,onChange:H=>T(H.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?"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)]"}`}),e("div",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 pointer-events-none",children:e(Fr,{className:"h-4 w-4 text-[var(--orb-muted)]"})})]})}),e("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:q.length===0?e("div",{className:"flex items-center justify-center py-8 text-[var(--orb-muted)] text-sm",children:t?e(kn,{className:"h-5 w-5"}):y(S?"navigation.noMatch":"navigation.noAccessibleApp")}):l(jsxRuntime.Fragment,{children:[!t&&e("div",{className:`transition-opacity duration-300 ${t?"opacity-0":"opacity-100 delay-200"}`,children:e(En,{items:q,onItemClick:X,className:"space-y-1",expandedIds:$,colorMode:i,enablePinning:u,pinnedIds:R,onTogglePin:z,onToggleExpand:H=>{let Q=new Set(C);q.some(ge=>ge.id===H)?Q.has(H)?Q.delete(H):(q.forEach(ge=>{ge.id!==H&&Q.has(ge.id)&&Q.delete(ge.id);}),Q.add(H)):Q.has(H)?Q.delete(H):Q.add(H),L(Q);}})}),t&&e("div",{className:"space-y-2",children:K.map(H=>e("div",{className:"space-y-1",children:e("button",{onClick:()=>{r();let Q=new Set([H.id]);L(Q);},className:`w-full flex items-center justify-center p-2 rounded-lg cursor-pointer transition-colors duration-200 ${g?"text-[var(--orb-muted)] hover:bg-[var(--orb-surface-2)]":"text-[var(--orb-muted)] hover:bg-[var(--orb-surface)]"}`,title:y("navigation.expandView",{title:H.title||""}),children:H.icon||e("div",{className:`w-6 h-6 rounded text-xs flex items-center justify-center font-medium ${g?"bg-[var(--orb-nav-active-fg)] text-[#0b0b0b]":"bg-[var(--orb-primary)] text-[var(--orb-on-primary)]"}`,children:H.title?.charAt(0)||"?"})})},H.id))})]})}),!t&&e("button",{onClick:r,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?"hover:bg-[color-mix(in_oklch,var(--orb-surface-2)_50%,transparent)]":"hover:bg-[color-mix(in_oklch,var(--orb-canvas)_20%,transparent)]"}`,title:y("navigation.collapse"),children:e("div",{className:"absolute",style:{bottom:"0px",right:"0px",width:"16px",height:"16px",overflow:"hidden"},children:e("div",{className:g?"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"}})})}),p&&t&&e("button",{type:"button",onClick:W,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?"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:y(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),"aria-label":y(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),children:x?e(ga,{className:"h-4 w-4"}):e(fa,{className:"h-4 w-4"})})]})};w();var $g="orbcafe:navigation-island:pinned-items",gs="orbcafe-navigation-pinned",dc=t=>t.appurl||t.href,pc=t=>t.flatMap(r=>{let o=!!r.children?.length,n=r.pinnable!==false&&dc(r)&&!o?[{...r,children:void 0}]:[];return r.children?.length?[...n,...pc(r.children)]:n}),uc=t=>t.flatMap(r=>[r.id,...r.children?uc(r.children):[]]),mc=(t,r)=>t.reduce((o,n)=>{let a=n.children?mc(n.children,r):[];return ([n.title,n.label,n.description].some(s=>s?.toLocaleLowerCase().includes(r))||a.length>0)&&o.push({...n,children:a.length>0?a:n.children}),o},[]),fs=({collapsed:t,onToggle:r,className:o="",maxHeight:n,menuData:a=[],colorMode:i="light",displayMode:s="fixed",onDisplayModeChange:c,showDisplayModeToggle:p=true,enablePinning:u=true,pinStorageKey:d=$g,pinnedItemIds:f,defaultPinnedItemIds:b=[],onPinnedItemIdsChange:m,pinnedSectionTitle:v})=>{let{t:y}=de(),g=navigation.useRouter(),x=s==="floating",[h,S]=Qt.useState(""),[T,C]=Qt.useState(new Set),[L,A]=Qt.useState(b),[I,N]=Qt.useState(false),M=f!==void 0,k=f??L,D=Qt.useMemo(()=>new Set(k),[k]);Qt.useEffect(()=>{t&&C(new Set);},[t]),Qt.useEffect(()=>{if(!u||M){N(true);return}try{let H=window.localStorage.getItem(d);if(H){let Q=JSON.parse(H);Array.isArray(Q)&&A(Q.filter(J=>typeof J=="string"));}}catch{}finally{N(true);}},[u,M,d]),Qt.useEffect(()=>{if(!(!u||M||!I))try{window.localStorage.setItem(d,JSON.stringify(k));}catch{}},[k,u,M,d,I]),Qt.useEffect(()=>{!u||t||k.length===0||C(H=>{if(H.has(gs))return H;let Q=new Set(H);return Q.add(gs),Q});},[t,k.length,u]);let R=Qt.useCallback(H=>{let Q=Array.from(new Set(H));M||A(Q),m?.(Q);},[M,m]),F=Qt.useCallback(H=>{R(D.has(H.id)?k.filter(Q=>Q!==H.id):[...k,H.id]);},[k,D,R]),z=Qt.useMemo(()=>{if(!u||k.length===0)return a;let H=new Map(pc(a).map(J=>[J.id,J])),Q=k.map(J=>H.get(J)).filter(J=>!!J);return Q.length===0?a:[{id:gs,title:v||y("navigation.pinned"),icon:e(_o,{className:"h-4 w-4"}),children:Q,pinnable:false},...a]},[k,u,a,v,y]),K=h.trim().toLocaleLowerCase(),V=Qt.useMemo(()=>K?mc(z,K):z,[z,K]),q=Qt.useMemo(()=>K?new Set(uc(V)):T,[T,V,K]),$=Qt.useCallback(H=>{C(Q=>{let J=new Set(Q),ge=V.some(se=>se.id===H);return J.has(H)?J.delete(H):(ge&&V.forEach(se=>J.delete(se.id)),J.add(H)),J});},[V]),X=Qt.useCallback(H=>{let Q=dc(H);Q&&(H.id==="chat"||H.appurl==="/chat"?g.push("/chat?new=true"):/^https?:\/\//.test(Q)?window.open(Q,"_blank","noopener,noreferrer"):g.push(Q));},[g]),W=H=>{r(),C(new Set([H.id]));};return l("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]"} ${o}`,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:[e("div",{className:`orb-navigation-island-v2-search ${t?"px-1":"px-2"}`,children:t?e("button",{type:"button",onClick:r,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:y("navigation.expand"),"aria-label":y("navigation.expand"),children:e(Fr,{className:"h-5 w-5"})}):l("label",{className:"relative block",children:[e("span",{className:"orb-visually-hidden",children:y("navigation.searchPlaceholder")}),e(Fr,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[var(--orb-muted)]"}),e("input",{type:"search",value:h,onChange:H=>S(H.target.value),placeholder:y("navigation.searchPlaceholder"),className:"w-full py-2 pl-10 pr-3 text-sm outline-none"})]})}),e("nav",{className:`min-h-0 flex-1 overflow-y-auto pb-2 ${t?"px-1":"px-2"}`,children:V.length===0?e("div",{className:"flex items-center justify-center py-8 text-sm text-[var(--orb-muted)]",children:t?e(kn,{className:"h-5 w-5"}):y(K?"navigation.noMatch":"navigation.noAccessibleApp")}):t?e("div",{className:"space-y-1",children:z.map(H=>e("button",{type:"button",onClick:()=>W(H),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:y("navigation.expandView",{title:H.title||H.label||""}),children:H.icon||e(kn,{className:"h-5 w-5"})},H.id))}):e(En,{items:V,onItemClick:X,className:"space-y-1",expandedIds:q,onToggleExpand:$,colorMode:i,enablePinning:u,pinnedIds:D,onTogglePin:F})}),p&&t&&e("div",{className:"orb-navigation-island-v2-footer flex flex-col items-center gap-1 border-t px-1 py-2",children:e("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:y(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),"aria-label":y(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),children:x?e(ga,{className:"h-4 w-4"}):e(fa,{className:"h-4 w-4"})})}),!t&&e("button",{type:"button",onClick:r,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:y("navigation.collapse"),"aria-label":y("navigation.collapse"),children:e("span",{"aria-hidden":"true",className:"absolute overflow-hidden",style:{bottom:0,right:0,width:16,height:16},children:e("span",{className:"absolute rounded-full border-[3px] border-[var(--orb-ai-accent)]",style:{width:32,height:32,top:-16,left:-16}})})})]})};fs.displayName="NavigationIsland2";var fc=(t={})=>{let{initialCollapsed:r=false,initialDisplayMode:o="fixed",content:n=[],enablePinning:a,pinStorageKey:i,pinnedItemIds:s,defaultPinnedItemIds:c,onPinnedItemIdsChange:p,pinnedSectionTitle:u}=t,[d,f]=Qt.useState(r),[b,m]=Qt.useState(o),[v,y]=Qt.useState(n),g=Qt.useCallback(()=>{f(S=>!S);},[]),x=Qt.useCallback(()=>{m(S=>S==="fixed"?"floating":"fixed");},[]),h=Qt.useMemo(()=>({collapsed:d,onToggle:g,menuData:v,displayMode:b,onDisplayModeChange:m,enablePinning:a,pinStorageKey:i,pinnedItemIds:s,defaultPinnedItemIds:c,onPinnedItemIdsChange:p,pinnedSectionTitle:u}),[d,g,v,b,m,a,i,s,c,p,u]);return {collapsed:d,setCollapsed:f,toggleCollapsed:g,displayMode:b,setDisplayMode:m,toggleDisplayMode:x,menuData:v,setMenuData:y,navigationIslandProps:h}};var hs=class{constructor(){yl(this,"listener",null);}register(r){this.listener=r;}unregister(){this.listener=null;}show(r,o,n){this.listener&&this.listener({type:r,content:o,options:n});}hide(){this.listener&&this.listener(null);}},eo=new hs,fw={success:(t,r)=>eo.show("success",t,r),error:(t,r)=>eo.show("error",t,r),warning:(t,r)=>eo.show("warning",t,r),info:(t,r)=>eo.show("info",t,r),show:(t,r,o)=>eo.show(t,r,o),hide:()=>eo.hide()};w();var _g={success:{icon:e(wn,{size:40}),color:"var(--orb-success-bg)",iconColor:"var(--orb-success)"},warning:{icon:e(ya,{size:40}),color:"var(--orb-warn-bg)",iconColor:"var(--orb-warn)"},error:{icon:e(la,{size:40}),color:"var(--orb-err-bg)",iconColor:"var(--orb-err)"},info:{icon:e(da,{size:40}),color:"var(--orb-info-bg)",iconColor:"var(--orb-info)"},default:{icon:null,color:"transparent",iconColor:"inherit"}},On=({open:t,title:r,message:o,onClose:n,onConfirm:a,confirmText:i,cancelText:s,showCancel:c=true,maxWidth:p="xs",type:u="default"})=>{let{t:d}=de(),f=i||d("messageBox.confirm"),b=s||d("messageBox.cancel"),m=()=>{a?a():n();},v=_g[u],y=u!=="default";return l(Vt,{open:t,onClose:n,maxWidth:p,sx:y?{borderTop:`6px solid ${v.iconColor}`}:void 0,children:[y&&e("div",{style:{display:"flex",justifyContent:"center",paddingTop:24,color:v.iconColor},children:v.icon}),r&&e("div",{className:"orb-dialog-title",style:{textAlign:y?"center":"left",paddingTop:y?8:16},children:r}),e("div",{className:"orb-dialog-content",style:{textAlign:y?"center":"left"},children:typeof o=="string"?e("p",{style:{margin:0,color:"var(--orb-muted)"},children:o}):o}),l("div",{className:"orb-dialog-actions",style:{display:"flex",justifyContent:y?"center":"flex-end",gap:8,paddingBottom:24,paddingLeft:24,paddingRight:24},children:[c&&e(ve,{onClick:n,variant:"text",children:b}),e(ve,{onClick:m,variant:"contained",color:y&&u==="error"?"error":"primary",autoFocus:true,children:f})]})]})},ww=()=>{let[t,r]=Qt__namespace.default.useState(null),[o,n]=Qt__namespace.default.useState(false);Qt__namespace.default.useEffect(()=>{let s=c=>{c?(r(c),n(true)):(n(false),r(null));};return eo.register(s),()=>eo.unregister()},[]);let a=()=>{n(false),t?.options?.onClose&&t.options.onClose(),r(null);},i=()=>{t?.options?.onConfirm&&t.options.onConfirm(),n(false),r(null);};return t?e(On,{open:o,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};w();var Rw=({status:t,showIcon:r=true})=>{let o="gray",n,a=t;return t==="OK"?(o="blue",n=e(wn,{size:14,strokeWidth:2}),a="Success"):t==="Error"?(o="orange",n=e(la,{size:14,strokeWidth:2}),a="Error"):t==="Warning"&&(o="orange",n=e(ya,{size:14,strokeWidth:2}),a="Warning"),e(Tt,{label:a,tone:o,icon:r&&n?n:void 0})};w();var Aw=({dense:t,sx:r,className:o,children:n,...a})=>e("ul",{...a,className:o,style:{listStyle:"none",margin:0,padding:0,...r},children:n}),Nw=({button:t,divider:r,sx:o,className:n,children:a,...i})=>e("li",{...i,className:n,style:{display:"flex",alignItems:"center",padding:"8px 16px",minHeight:40,borderBottom:r?"1px solid var(--orb-border)":void 0,cursor:t?"pointer":void 0,transition:"var(--orb-t-fast)",...o},onMouseEnter:t?s=>{s.currentTarget.style.background="var(--orb-hover)";}:void 0,onMouseLeave:t?s=>{s.currentTarget.style.background="";}:void 0,children:a}),Ew=({sx:t,className:r,children:o,...n})=>e("button",{...n,type:"button",className:r,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:o}),Lw=({children:t,sx:r})=>e("div",{style:{marginRight:16,display:"flex",alignItems:"center",minWidth:40,...r},children:t}),Fw=({primary:t,secondary:r,sx:o})=>l("div",{style:{flex:1,minWidth:0,...o},children:[e("div",{className:"orb-body",style:{fontWeight:500},children:t}),r&&e("div",{className:"orb-meta",style:{marginTop:2},children:r})]}),Ow=({sx:t,className:r,children:o,...n})=>e("li",{...n,className:r,style:{padding:"8px 16px",fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--orb-muted)",...t},children:o}),Bw=({children:t,sx:r})=>e("div",{style:{marginRight:12,display:"flex",alignItems:"center",...r},children:t});w();var Hw=({xs:t,md:r,lg:o,sx:n,children:a,className:i,...s})=>{let c=o?`span ${o}`:r?`span ${r}`:t?`span ${t}`:"span 12";return e("div",{...s,className:i,style:{gridColumn:c,minWidth:0,...n},children:a})};$t();w();var Dr=tt,nr=(t,r)=>Qt.forwardRef(({component:o,sx:n,className:a,style:i,children:s,...c},p)=>{let u=o??t,d=Ge(n,[r,a].filter(Boolean).join(" "),i);return e(u,{ref:p,className:d.className,style:d.style,...c,children:s})}),we=nr("div"),hc=nr("a","orb-link"),Ro=Ne,vc=ie,gr=E;var yc=ae;var xc=Nt,Kr=Ko,Ea=Uo,La=Sa;var Fa=Ca,Cc=Gr,Sc=({value:t,variant:r,color:o,sx:n})=>e(In,{value:r==="determinate"?t:void 0,color:o,sx:n}),wc=nr("table","orb-tbl"),kc=nr("tbody"),xs=nr("td"),Tc=nr("div","orb-table-container"),Pc=nr("thead"),Cs=nr("tr");nr("tfoot");nr("div","orb-dialog-title");nr("div","orb-dialog-content");nr("div","orb-dialog-actions");nr("p","orb-body-dense");var to=nr("span","orb-input-adornment"),Ic=Qt.forwardRef(({sx:t,fullWidth:r,className:o,style:n,...a},i)=>{let s=Ge(t,["orb-input-base",o].filter(Boolean).join(" "),n);return e("input",{ref:i,className:s.className,style:{width:r?"100%":void 0,...s.style},...a})});var co=nr("div","orb-form-control"),Bn=({control:t,label:r,...o})=>l("label",{className:"orb-form-control-label",...o,children:[t,e("span",{children:r})]}),Zg=({primary:t,secondary:r,children:o,primaryTypographyProps:n,secondaryTypographyProps:a,...i})=>l("span",{className:"orb-list-item-text",...i,children:[t??o,r?e("small",{children:r}):null]}),Qg=nr("span","orb-list-item-icon"),Gt=Zg,Or=Qg;nr("div","orb-list-subheader");var Ss=({container:t,item:r,spacing:o,xs:n,sm:a,md:i,lg:s,xl:c,sx:p,...u})=>{let d={},f=b=>typeof b=="number"?`${b/12*100}%`:b?"100%":void 0;return n!==void 0&&(d.xs=f(n)),a!==void 0&&(d.sm=f(a)),i!==void 0&&(d.md=f(i)),s!==void 0&&(d.lg=f(s)),c!==void 0&&(d.xl=f(c)),e(we,{...u,sx:{display:t?"flex":void 0,flexWrap:t?"wrap":void 0,gap:t&&o?o:void 0,width:r?d:void 0,...p??{}}})},qo=({in:t,children:r,unmountOnExit:o,...n})=>!t&&o?null:e("div",{hidden:!t,...n,children:r}),Rc=({children:t,container:r})=>typeof document>"u"?null:reactDom.createPortal(t,r??document.body),Mc=nr("div","orb-toolbar"),Dc=({active:t,direction:r="asc",children:o,sx:n,className:a,style:i,...s})=>{let c=Ge(n,["orb-table-sort-label",t?"orb-is-active":"",a].filter(Boolean).join(" "),i);return l("button",{type:"button",className:c.className,style:c.style,"data-direction":r,...s,children:[e("span",{className:"orb-table-sort-content",children:o}),e(Mt,{className:"orb-table-sort-icon",name:r==="desc"?"down":"up",size:11})]})},Oa=({open:t,anchorEl:r,onClose:o,children:n,anchorOrigin:a,transformOrigin:i,slotProps:s,PaperProps:c,sx:p,className:u,style:d,...f})=>{let b=Qt.useRef(null);if(Qt.useEffect(()=>{if(!t)return;let x=S=>{let T=S.composedPath();b.current&&T.includes(b.current)||r&&T.includes(r)||o?.();},h=S=>{S.key==="Escape"&&o?.();};return document.addEventListener("pointerdown",x,true),document.addEventListener("keydown",h,true),()=>{document.removeEventListener("pointerdown",x,true),document.removeEventListener("keydown",h,true);}},[r,o,t]),!t||typeof document>"u")return null;let m=r?.getBoundingClientRect(),v=s?.paper??c,y=[...Array.isArray(v?.sx)?v.sx:v?.sx?[v.sx]:[],...Array.isArray(p)?p:p?[p]:[]],g=Ge(y,["orb-pop",v?.className,u].filter(Boolean).join(" "),{...v?.style,...d});return reactDom.createPortal(e("div",{...f,ref:b,className:g.className,style:{position:"fixed",left:m?.left??16,top:(m?.bottom??16)+6,zIndex:1301,...g.style},children:n}),document.body)},Ac=({open:t,onClose:r,anchor:o="left",children:n,PaperProps:a})=>{if(!t||typeof document>"u")return null;let i=o==="right"?{right:0,top:0,bottom:0}:o==="top"?{left:0,right:0,top:0}:o==="bottom"?{left:0,right:0,bottom:0}:{left:0,top:0,bottom:0},s=Ge(a?.sx,"orb-drawer");return reactDom.createPortal(l(jsxRuntime.Fragment,{children:[e("button",{type:"button",className:"orb-overlay","aria-label":"Close drawer",onClick:r}),e("aside",{className:s.className,style:{position:"fixed",zIndex:1201,...i},children:n})]}),document.body)},Nc=({value:t,onChange:r,children:o,variant:n,scrollButtons:a,...i})=>e("div",{role:"tablist",className:"orb-tabs",...i,children:Qt.Children.map(o,s=>Qt.isValidElement(s)?Qt.cloneElement(s,{selected:s.props.value===t,onSelect:c=>r?.(null,c)}):s)}),Ec=({value:t,label:r,children:o,selected:n,onSelect:a,...i})=>e("button",{type:"button",role:"tab","aria-selected":n,className:`orb-tab ${n?"orb-is-active":""}`,onClick:()=>a?.(t),...i,children:r??o});var ar=()=>ia(),po=(t,r)=>Rr(t);var Lc=({day:t,onDaySelect:r,selected:o,outsideCurrentMonth:n,disableMargin:a,sx:i,className:s,...c})=>{let p=Ge(i,`orb-cal-day ${o?"orb-is-selected":""} ${n?"orb-is-outside":""} ${s??""}`);return e("button",{type:"button",className:p.className,style:p.style,onClick:()=>r?.(t),...c,children:t.date()})},Fc=({value:t,referenceDate:r,onChange:o,onMonthChange:n,onYearChange:a,minDate:i,maxDate:s,slots:c,...p})=>e(Dn,{value:t,month:r,onChange:u=>o?.(u),onMonthChange:u=>{n?.(u),a?.(u);},minDate:i,maxDate:s,renderDay:c?.day?(u,d)=>c.day?.({day:u,selected:d.selected,outsideCurrentMonth:d.outsideCurrentMonth,onDaySelect:f=>o?.(f)}):void 0,...p}),Oc=({children:t})=>e(jsxRuntime.Fragment,{children:t}),Na=class{};$t();w();var jg=(t,r)=>r!==void 0?r:typeof t=="number"?t:t==="small"?18:t==="large"?30:t==="inherit"?"1em":22,he=t=>({fontSize:o,size:n,sx:a,className:i,style:s,titleAccess:c,...p})=>{let u=Ge(a,i,s);return e(Mt,{name:t,size:jg(o,n),className:u.className,style:u.style,"aria-label":p["aria-label"]??c,...p})},uo=he("tree"),Mo=he("add"),Bc=he("duplicate"),ws=he("down"),zc=he("navigationRight"),Vc=he("navigationRight"),ks=he("up"),Hc=he("delete"),Wc=he("camera"),$c=he("accept"),Gc=he("accept"),Ba=he("navigationRight"),_c=he("dimension"),Uc=he("decline"),mo=he("decline"),Kc=he("decline"),qc=he("decline"),za=he("delete"),Va=he("delete"),Xc=he("download"),Yc=he("move"),Zc=he("edit"),Xo=he("slimDown"),Qc=he("filter"),Yo=he("sum"),jc=he("wrench"),Jc=he("lineChart"),ed=he("document"),Br=he("slimDown"),td=he("navigationLeft"),go=he("navigationRight"),Ha=he("slimUp"),Wa=he("navigationLeft"),$a=he("navigationRight"),rd=he("dimension"),od=he("splitOne"),Ga=he("menu"),nd=he("microphone"),ad=he("microphone"),id=he("microphone"),sd=he("qrCode"),fo=he("save"),Do=he("search"),ld=he("search"),cd=he("paperPlane"),dd=he("paperPlane"),pd=he("wrench"),ud=he("sort"),_a=he("splitTwo"),md=he("favorite"),gd=he("favorite"),fd=he("stop"),bd=he("tableRow"),Ua=he("collapseAll"),Ka=he("expandAll"),Zo=he("tableColumn"),hd=he("overview"),vd=he("hide");w();var ef=[{field:"value",label:"Value",minWidth:120},{field:"label",label:"Description",minWidth:180}],xd=t=>Array.isArray(t)?t:t==null||t===""?[]:[t],Sr=t=>String(t),Cd=(t,r)=>t[r],Sd=t=>{let r=t.value??t.id??t.key??t.code;return typeof r=="number"||typeof r=="string"?r:""},tf=t=>{let r=t.label??t.description??t.name??t.title;return String(typeof r=="number"||typeof r=="string"?r:Sd(t))},rf=t=>{let r=t.description??t.subtitle;return typeof r=="number"||typeof r=="string"?String(r):void 0},wd=({value:t=null,items:r=[],columns:o,mode:n="single",dialogTitle:a="Value Help",searchPlaceholder:i="Search values...",selectLabel:s="Select",clearLabel:c="Clear",cancelLabel:p="Cancel",valueHelpLabel:u="Open value help",noResultsText:d="No matching values",loading:f=false,clearable:b=true,allowManualInput:m=true,validateManualInput:v=true,manualInputErrorText:y="Enter a valid value.",selectedItems:g=[],displayValue:x,getOptionValue:h=Sd,getOptionLabel:S=tf,getOptionDescription:T=rf,onChange:C,onSearch:L,disabled:A,InputProps:I,onFocus:N,onBlur:M,onKeyDown:k,error:D,helperText:R,...F})=>{let z=hr(),K=n==="multiple",[V,q]=Qt.useState(false),[$,X]=Qt.useState(false),[W,H]=Qt.useState(""),[Q,J]=Qt.useState(null),[ge,se]=Qt.useState(false),[fe,xe]=Qt.useState(()=>xd(t)),[Ke,ze]=Qt.useState(""),[Re,Ve]=Qt.useState(""),Me=Qt.useMemo(()=>o&&o.length>0?o:ef,[o]),Ce=Q??r,He=Qt.useMemo(()=>{let j=[...g,...r,...Q??[]],ke=new Map;return j.forEach(Te=>{ke.set(Sr(h(Te)),Te);}),ke},[h,r,Q,g]),at=Qt.useMemo(()=>xd(t),[t]),ft=Qt.useMemo(()=>at.map(String).join(", "),[at]);Qt.useEffect(()=>{V||xe(at);},[V,at]),Qt.useEffect(()=>{!$&&!Re&&ze(ft);},[$,ft,Re]);let et=Qt.useMemo(()=>{let j=W.trim().toLowerCase();if(!j||L)return Ce;let ke=Me.filter(Te=>Te.searchable!==false);return Ce.filter(Te=>[h(Te),S(Te),T(Te),...ke.map(pt=>Cd(Te,pt.field))].some(pt=>String(pt??"").toLowerCase().includes(j)))},[Ce,T,S,h,L,W,Me]),re=Qt.useMemo(()=>{if(x!==void 0)return x;if(at.length===0)return "";let j=ke=>{let Te=He.get(Sr(ke));if(!Te)return String(ke);let Ye=S(Te);return Ye&&Ye!==String(ke)?`${ke} - ${Ye}`:String(ke)};return K?at.length>2?`${at.length} selected`:at.map(j).join(", "):j(at[0])},[x,S,K,He,at]),$e=Qt.useCallback(async()=>{if(L){se(true);try{let j=await L(W);Array.isArray(j)&&J(j);}finally{se(false);}}},[L,W]),Ee=()=>{A||(xe(at),q(true));},Le=()=>{q(false);},lt=()=>{C?.(K?[]:null,K?[]:null),xe([]),ze(""),Ve("");},Qe=j=>{let ke=h(j);if(K){xe(Te=>Te.some(pt=>Sr(pt)===Sr(ke))?Te.filter(pt=>Sr(pt)!==Sr(ke)):[...Te,ke]);return}xe([ke]);},vt=()=>{let j=fe.map(ke=>He.get(Sr(ke))).filter(ke=>!!ke);K?C?.(fe,j):C?.(fe[0]??null,j[0]??null),Ve(""),q(false);},St=j=>{if(j.key==="F4"){j.preventDefault(),Ee();return}if(j.key==="Enter"&&m&&!Lt(Ke,true)){j.preventDefault();return}k?.(j);},Et=j=>v?j.every(ke=>He.has(Sr(ke))):true,Lt=(j,ke)=>{if(K){let Ye=j.split(/[,;\n]/).map(ct=>ct.trim()).filter(Boolean);if(Ye.length===0)return Ve(""),C?.([],[]),true;if(!Et(Ye))return ke&&Ve(y),false;Ve("");let pt=Ye.map(ct=>He.get(Sr(ct))).filter(ct=>!!ct);return C?.(Ye,pt),true}let Te=j.trim();return Te?Et([Te])?(Ve(""),C?.(Te,He.get(Sr(Te))??null),true):(ke&&Ve(y),false):(Ve(""),C?.(null,null),true)},te=j=>{if(!m)return;let ke=j.target.value;ze(ke),Ve(""),Lt(ke,false);},rt=f||ge,Fe=at.length>0,me=m&&($||!!Re)?Ke:re;return l(jsxRuntime.Fragment,{children:[e(Be,{...F,className:["orb-value-help-field",b&&Fe&&!A?"orb-value-help-has-clear":"",F.className??""].filter(Boolean).join(" "),disabled:A,value:me,error:!!Re||D,helperText:Re||R,onChange:te,onFocus:j=>{X(true),ze(ft),N?.(j);},onBlur:j=>{m&&Lt(Ke,true),X(false),M?.(j);},onKeyDown:St,InputProps:{...I,readOnly:!m,endAdornment:l("span",{className:"orb-value-help-actions",children:[rt?e(Gr,{size:18}):null,b&&Fe&&!A?e(ae,{className:"orb-value-help-clear-trigger",size:"small",tooltip:c,"aria-label":c,onMouseDown:j=>j.preventDefault(),onClick:j=>{j.stopPropagation(),lt();},children:e(Mt,{name:"decline",size:14})}):null,e(ae,{className:"orb-value-help-search-trigger",size:"small",tooltip:u,"aria-label":u,onMouseDown:j=>j.preventDefault(),onClick:j=>{j.stopPropagation(),Ee();},disabled:A,children:e(Mt,{name:"search",size:16})})]})}}),l(Vt,{open:V,onClose:Le,fullWidth:true,maxWidth:820,hideCloseButton:true,PaperProps:{sx:j=>({borderRadius:2,overflow:"hidden",border:`1px solid ${j.palette.divider}`,boxShadow:z==="dark"?`0 24px 80px ${tt(j.palette.common.black,.72)}`:`0 24px 80px ${tt(j.palette.common.black,.18)}`})},children:[l("div",{className:"orb-dialog-title",sx:j=>({display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,px:2.5,py:2,pr:1.5,borderBottom:`1px solid ${j.palette.divider}`,bgcolor:j.palette.background.paper}),children:[l("div",{children:[e(E,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:a}),K?e(E,{variant:"body2",color:"text.secondary",sx:{mt:.25},children:`${fe.length} selected`}):null]}),e(ae,{"aria-label":"Close",onClick:Le,size:"small",children:e(mo,{fontSize:"small"})})]}),l("div",{className:"orb-dialog-content",sx:{p:0},children:[l(ie,{direction:{xs:"column",sm:"row"},spacing:1,sx:j=>({px:2.5,py:1.5,borderBottom:`1px solid ${j.palette.divider}`,bgcolor:z==="dark"?tt(j.palette.common.white,.025):tt(j.palette.primary.main,.035)}),children:[e(Be,{size:"small",fullWidth:true,autoFocus:true,value:W,placeholder:i,onChange:j=>H(j.target.value),onKeyDown:j=>{j.key==="Enter"&&(j.preventDefault(),$e());},InputProps:{startAdornment:e(to,{position:"start",children:e(Mt,{name:"search",size:16})}),sx:j=>({borderRadius:1,bgcolor:j.palette.background.paper,"& fieldset":{borderColor:tt(j.palette.text.primary,z==="dark"?.2:.16)},"&:hover fieldset":{borderColor:tt(j.palette.primary.main,.52)},"&:focus-within fieldset":{borderColor:j.palette.primary.main}})}}),L?e(ve,{variant:"outlined",onClick:()=>{$e();},disabled:rt,sx:{minWidth:96,textTransform:"none",fontWeight:700},children:rt?e(Gr,{size:18}):"Search"}):null]}),e("div",{sx:{maxHeight:420},children:l("table",{className:"orb-tbl",stickyHeader:true,size:"small",children:[e("thead",{children:l("tr",{children:[e("td",{padding:"checkbox",sx:j=>({bgcolor:z==="dark"?"var(--orb-canvas)":j.palette.background.paper,borderBottom:`1px solid ${j.palette.divider}`})}),Me.map(j=>e("td",{align:j.align==="inherit"?void 0:j.align,sx:ke=>({minWidth:j.minWidth,width:j.width,fontSize:"0.78rem",fontWeight:800,bgcolor:z==="dark"?"var(--orb-canvas)":ke.palette.background.paper,borderBottom:`1px solid ${ke.palette.divider}`}),children:j.label},String(j.field)))]})}),l("tbody",{children:[et.map(j=>{let ke=h(j),Te=fe.some(Ye=>Sr(Ye)===Sr(ke));return l("tr",{hover:true,selected:Te,onClick:()=>Qe(j),onDoubleClick:()=>{K||(xe([ke]),C?.(ke,j),q(false));},sx:Ye=>({cursor:"pointer","&.orb-selected":{bgcolor:tt(Ye.palette.primary.main,z==="dark"?.22:.12)},"&.orb-selected:hover":{bgcolor:tt(Ye.palette.primary.main,z==="dark"?.28:.18)}}),children:[e("td",{padding:"checkbox",children:e(Dt,{size:"small",checked:Te})}),Me.map(Ye=>{let pt=Cd(j,Ye.field);return e("td",{align:Ye.align==="inherit"?void 0:Ye.align,sx:{fontSize:"0.82rem",py:1},children:Ye.render?Ye.render(pt,j):String(pt??"")},String(Ye.field))})]},Sr(ke))}),et.length===0?e("tr",{children:e("td",{colSpan:Me.length+1,children:e("div",{sx:{py:5,textAlign:"center",color:"text.secondary"},children:d})})}):null]})]})})]}),l("div",{className:"orb-dialog-actions",sx:j=>({px:2.5,py:1.5,borderTop:`1px solid ${j.palette.divider}`,bgcolor:j.palette.background.paper,"& .orb-btn":{textTransform:"none",fontWeight:700}}),children:[b&&(Fe||fe.length>0)?e(ve,{onClick:lt,children:c}):null,e("div",{sx:{flex:1}}),e(ve,{onClick:Le,children:p}),e(ve,{variant:"contained",onClick:vt,disabled:!K&&fe.length===0,children:s})]})]})]})};w();var qa=({title:t,hideHeader:r,children:o})=>l("div",{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[!r&&e("div",{sx:{mb:2},children:e(E,{variant:"h4",children:t})}),e("div",{sx:{flex:1,overflow:"hidden"},children:o})]});var Ts={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"},Ps={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"},zn={width:30,height:30,p:.25,flex:"0 0 auto","& svg":{fontSize:20}},Vn={width:30,height:30,minWidth:30,minHeight:30,p:.25,flex:"0 0 auto","& svg":{fontSize:20}},kd={display:"flex",alignItems:"center",justifyContent:"center",gap:.25,width:"100%",minWidth:0},lr={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}};w();var of={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"}},Xa=({rowsPerPage:t=20,rowsPerPageOptions:r=[20,50,100,-1],page:o=0,count:n=0,onRowsPerPageChange:a,onPageChange:i})=>{let{t:s}=de(),c=r.length>0?r:[20,50,100,-1],p=Math.max(0,o),u=t===-1?1:Math.max(1,Math.ceil(n/t)),d=Math.min(p+1,u),f=p>0,b=p<u-1&&t!==-1;return l("div",{className:"orb-table-pager",children:[e(E,{className:"orb-table-pager-label",children:s("table.toolbar.itemsPerPage")}),e(it,{title:s("table.toolbar.itemsPerPage"),children:e(Kt,{size:"small",variant:"standard",value:t,"aria-label":s("table.toolbar.itemsPerPage"),fullWidth:false,disableUnderline:true,onChange:m=>a?.(Number(m.target.value)),sx:of,children:c.map(m=>e("option",{value:m,children:m===-1?s("common.all"):m},`rows-per-page-${m}`))})}),e("span",{className:"orb-table-pager-divider"}),e(ae,{className:"orb-table-pager-button","aria-label":"Previous page",size:"small",onClick:()=>i?.(Math.max(p-1,0)),disabled:!f,sx:lr,children:e(td,{})}),l(E,{className:"orb-table-pager-page",title:s("table.toolbar.pageOf",{current:d,total:u}),children:[d," / ",u]}),e(ae,{className:"orb-table-pager-button","aria-label":"Next page",size:"small",onClick:()=>i?.(Math.min(p+1,u-1)),disabled:!b,sx:lr,children:e(go,{})})]})};w();var Ya=({value:t="",onChange:r})=>{let{t:o}=de();return e("div",{className:"orb-table-toolbar-search",children:e(Be,{className:"orb-table-toolbar-search-field",size:"small",placeholder:o("table.toolbar.searchPlaceholder"),value:t,onChange:n=>r?.(n.target.value),InputProps:{startAdornment:e(to,{position:"start",children:e(Do,{size:16})})}})})};w();var Za=t=>{let{t:r}=de(),o=Array.isArray(t.actions)?t.actions:t.actions?[t.actions]:[],n=Array.isArray(t.extraTools)?t.extraTools:t.extraTools?[t.extraTools]:[],a=[...o,...n],i=!!(t.showCreateButton||t.showEditButton||t.showDeleteButton),s=!!(t.onOpenGraphReport||t.onLayoutSave&&!t.layoutManager||t.layoutManager);return e(Mc,{className:"orb-table-toolbar",role:"toolbar","aria-label":r("table.title.default"),children:l("div",{className:"orb-table-toolbar-primary",children:[e(Ya,{value:t.filterText,onChange:c=>{t.setFilterText(c),t.onPageChange?.(0);}}),e(Xa,{rowsPerPage:t.rowsPerPage,rowsPerPageOptions:t.rowsPerPageOptions,page:t.page,count:t.count,onRowsPerPageChange:t.onRowsPerPageChange,onPageChange:t.onPageChange}),a.length>0?e("div",{className:"orb-table-toolbar-custom",children:a.map((c,p)=>e(Qt__namespace.default.Fragment,{children:c},`toolbar-custom-${p}`))}):null,e("span",{className:"orb-table-toolbar-spacer"}),l("div",{className:"orb-table-toolbar-actions",children:[l("div",{className:"orb-table-tool-group",children:[!t.disableGrouping&&e(it,{title:r("table.toolbar.groupBy"),children:e(ae,{className:"orb-table-tool-button",sx:lr,onClick:c=>t.setGroupAnchorEl(t.groupAnchorEl?null:c.currentTarget),children:e(La,{badgeContent:t.grouping?.length,color:"primary",invisible:!t.grouping?.length,children:e(uo,{})})})}),e(it,{title:r("table.toolbar.summary"),children:e(ae,{className:`orb-table-tool-button ${t.showSummary?"orb-is-active":""}`,active:!!t.showSummary,sx:lr,onClick:c=>t.setSummaryAnchorEl(t.summaryAnchorEl?null:c.currentTarget),children:e(Yo,{})})}),e(it,{title:r("table.toolbar.columns"),children:e(ae,{className:"orb-table-tool-button",sx:lr,onClick:c=>t.setAnchorEl(t.anchorEl?null:c.currentTarget),children:e(Zo,{})})}),e(it,{title:r("table.toolbar.export"),children:e(ae,{className:"orb-table-tool-button",sx:lr,onClick:t.handleExport,children:e(Xc,{})})})]}),i&&l("div",{className:"orb-table-tool-group",children:[t.showCreateButton&&e(it,{title:r("table.toolbar.newItem"),children:e(ae,{className:"orb-table-tool-button",onClick:t.onOpenCreateDialog,color:"primary.main",sx:lr,children:e(Mo,{})})}),t.showEditButton&&e(it,{title:r("table.toolbar.editItem"),children:e("span",{children:e(ae,{className:"orb-table-tool-button",onClick:t.onOpenEditDialog,color:"primary.main",disabled:!!t.editDisabled,sx:lr,children:e(Zc,{})})})}),t.showDeleteButton&&e(it,{title:r("table.toolbar.deleteItem"),children:e("span",{children:e(ae,{className:"orb-table-tool-button",onClick:t.onOpenDeleteConfirm,disabled:!!t.deleteDisabled,sx:{...lr,color:"error.main"},children:e(za,{})})})})]}),s&&l("div",{className:"orb-table-tool-group",children:[t.onOpenGraphReport&&e(it,{title:r("table.toolbar.graphicReport"),children:e(ae,{className:"orb-table-tool-button",sx:lr,onClick:t.onOpenGraphReport,children:e(Jc,{})})}),t.onLayoutSave&&!t.layoutManager&&e(it,{title:r("table.toolbar.saveLayout"),children:e(ae,{className:"orb-table-tool-button",sx:lr,onClick:c=>t.onLayoutSave(c),children:e(fo,{})})}),t.layoutManager]})]})]})})};var Qa=Object.freeze({Translate:{toString(t){if(!t)return;let{x:r,y:o}=t;return "translate3d("+(r?Math.round(r):0)+"px, "+(o?Math.round(o):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;let{scaleX:r,scaleY:o}=t;return "scaleX("+r+") scaleY("+o+")"}},Transform:{toString(t){if(t)return [Qa.Translate.toString(t),Qa.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:r,duration:o,easing:n}=t;return r+" "+o+"ms "+n}}});w();var ja=t=>{let{t:r}=de(),{onSelectAllClick:o,order:n,orderBy:a,sortBy:i=[],numSelected:s=0,rowCount:c=0,onRequestSort:p,onContextMenu:u,columns:d,visibleColumns:f,selectionMode:b,grouping:m=[],isAllExpanded:v=false,handleToggleAll:y,onColumnResize:g,columnWidths:x,enableColumnReorder:h=false,disableSorting:S=false}=t,[T,C]=Qt.useState(null),L=Qt.useRef(null),A=$=>X=>{S||T||p($);},I=($,X,W)=>{$.preventDefault(),$.stopPropagation(),C(X),L.current={startX:$.clientX,startWidth:W,colId:X},document.addEventListener("mousemove",N),document.addEventListener("mouseup",M),document.body.style.cursor="col-resize";},N=$=>{if(!L.current)return;let{startX:X,startWidth:W,colId:H}=L.current,Q=$.clientX-X,J=Math.max(50,W+Q);g&&g(H,J);},M=()=>{C(null),L.current=null,document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",M),document.body.style.cursor="";};Qt.useEffect(()=>()=>{document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",M);},[]);let k=b==="multiple"||b==="single",D=m.length>0&&!!y,R=r(v?"table.group.collapseAll":"table.group.expandAll"),F=d.filter($=>f.includes($.id)),z=new Map(i.map(($,X)=>[$.field,{...$,priority:X+1}])),K=F.map($=>{let X=x?.[$.id]||$.minWidth||100,W=z.get($.id);return e(uf,{headCell:$,width:typeof X=="number"?X:100,order:n,orderBy:a,multiSortInfo:S?void 0:W,onRequestSort:A($.id),onContextMenu:u,onResizeMouseDown:H=>I(H,$.id,typeof X=="number"?X:100),enableColumnReorder:h,disableSorting:S},$.id)}),V=F.map($=>$.id),q=l("tr",{children:[k&&e("th",{className:"orb-table-control-head",style:{width:56,minWidth:56,maxWidth:56},children:e(Dt,{color:"primary",indeterminate:s>0&&s<c,checked:c>0&&s===c,onChange:o,disabled:b==="single",sx:zn})}),D&&e("th",{className:"orb-table-control-head",style:{width:72,minWidth:72,maxWidth:72},children:e(it,{title:R,children:e(ae,{size:"small",onClick:$=>{$.stopPropagation(),y?.(!v);},sx:Vn,children:v?e(Ua,{}):e(Ka,{})})})}),h?e(sortable.SortableContext,{items:V,strategy:sortable.horizontalListSortingStrategy,children:K}):K]});return e("thead",{children:q})},uf=({headCell:t,width:r,order:o,orderBy:n,multiSortInfo:a,onRequestSort:i,onContextMenu:s,onResizeMouseDown:c,enableColumnReorder:p,disableSorting:u})=>{let{setNodeRef:d,attributes:f,listeners:b,transform:m,transition:v,isDragging:y}=sortable.useSortable({id:t.id,disabled:!p}),g=p?{transform:Qa.Transform.toString(m),transition:v,opacity:y?.6:1}:{},x=u?"asc":a?.direction??(n===t.id?o:"asc"),h=!u&&(!!a||n===t.id);return l("th",{ref:p?d:void 0,className:`orb-table-head-cell ${t.numeric?"orb-num":""} ${p?"orb-is-reorderable":""} ${y?"orb-is-dragging":""}`,"aria-sort":h?x==="asc"?"ascending":"descending":"none",onContextMenu:s?S=>s(S,t.id):void 0,style:{width:r,minWidth:r,maxWidth:r,...g},...p?f:{},...p?b:{},children:[u?e("span",{className:"orb-table-head-label",children:t.label}):e(Dc,{className:"orb-table-head-sort",active:h,direction:x,onClick:i,children:l("span",{className:"orb-table-head-label",children:[t.label,a&&e("span",{className:"orb-table-sort-priority",children:a.priority})]})}),e("div",{className:"orb-table-resize-handle",onMouseDown:c,onPointerDown:S=>S.stopPropagation(),onClick:S=>S.stopPropagation()})]})};w();var Ja=t=>{let{t:r}=de(),{visibleRows:o,visibleColumns:n,selected:a=[],handleClick:i,columns:s,toggleGroupExpand:c,expandedGroups:p=new Set,selectionMode:u,grouping:d=[],isGroupFullyExpanded:f,handleExpandGroupRecursively:b,handleCollapseGroupRecursively:m,emptyLabel:v,getRowDataKey:y,getRowProps:g,getGroupRowProps:x}=t,h=L=>a.indexOf(L)!==-1,S=u==="multiple"||u==="single",T=d.length>0,C=n.length+(S?1:0)+(T?1:0);return l("tbody",{children:[o.map((L,A)=>{if(L.type==="group"){let I=p.has(L.id),N=L.childIds||[],M=N.filter($=>h($)).length,k=N.length>0&&M===N.length,D=M>0&&M<N.length,R={entry:L,data:L,id:L.id,index:A,selected:k,group:true},F=x?.(R)||{},{className:z,onClick:K,...V}=F,q=$=>{if($.stopPropagation(),!!t.onSelectionChange)if(k){let X=a.filter(W=>!N.includes(W));t.onSelectionChange(X);}else {let X=Array.from(new Set([...a,...N]));t.onSelectionChange(X);}};return l("tr",{...V,"data-ctable-row-key":y?.(R),className:["orb-table-group-row",z].filter(Boolean).join(" "),onClick:K,sx:$=>({backgroundColor:"var(--orb-surface)","& th, & td":{color:$.palette.text.primary,borderBottomColor:$.palette.divider},"& .orb-icon-btn":{color:$.palette.text.primary},"& .orb-chk":{color:$.palette.text.secondary},"& .orb-chk:has(input:checked), & .orb-chk:has(input:indeterminate)":{color:$.palette.primary.main}}),children:[S&&e("td",{padding:"checkbox",sx:Ts,children:e(Dt,{size:"small",checked:k,indeterminate:D,onChange:q,onClick:$=>$.stopPropagation(),sx:zn})}),T&&e("td",{padding:"checkbox",sx:Ps,children:l("div",{sx:kd,children:[d.length>1&&L.level<d.length-1&&e(it,{title:f?.(L.id)?r("table.group.collapseAll"):r("table.group.expandAll"),children:e(ae,{size:"small",onClick:()=>{f?.(L.id)?m?.(L.id):b?.(L.id);},sx:Vn,children:f?.(L.id)?e(Ua,{}):e(Ka,{})})}),e(ae,{size:"small",onClick:()=>c&&c(L.id),sx:Vn,children:I?e(Br,{}):e(go,{})})]})}),e("td",{colSpan:n.length,sx:{py:1,pl:L.level*3+1},children:l(E,{variant:"body2",fontWeight:"bold",color:"text.primary",sx:{fontSize:"0.85rem"},children:[L.field,": ",L.value," (",L.count,")"]})})]},L.id)}else {let I=L.data||L,N=L.id||I.id||A,M=h(N),k=`enhanced-table-checkbox-${A}`,D={entry:L,data:I,id:N,index:A,selected:M,group:false},R=g?.(D)||{},{className:F,onClick:z,...K}=R,q=(L.level!==void 0?L.level:0)*4;return l("tr",{...K,"data-ctable-row-key":y?.(D),className:[M?"orb-is-selected":"",F].filter(Boolean).join(" "),onClick:$=>{z?.($),$.defaultPrevented||i?.($,I);},role:S?"checkbox":K.role,"aria-checked":S?M:K["aria-checked"],tabIndex:K.tabIndex??-1,children:[S&&e("td",{padding:"checkbox",sx:Ts,children:e(Dt,{color:"primary",checked:M,inputProps:{"aria-labelledby":k},sx:zn})}),T&&e("td",{padding:"checkbox",sx:Ps}),s.filter($=>n.includes($.id)).map(($,X)=>{let H=X===0&&q>0?{pl:q+2}:{};return e("td",{className:$.numeric?"orb-num":void 0,align:$.numeric?"right":"left",sx:H,children:$.render?$.render(I[$.id],I):(function(){let J=I[$.id];if($.numeric){if(typeof J=="number")return J.toLocaleString();if(typeof J=="string"&&J.trim()!==""&&!isNaN(Number(J)))return Number(J).toLocaleString()}return J})()},$.id)})]},N)}}),o.length===0&&e("tr",{children:e("td",{colSpan:C,align:"center",children:v??r("common.noData")})})]})};w();var Td=t=>{let{columns:r=[],visibleColumns:o,summaryRow:n,selectionMode:a,grouping:i=[],columnWidths:s={}}=t;if(!t.showSummary)return null;let c=a==="multiple"||a==="single",p=i.length>0,u=r.filter(d=>o.includes(d.id));return e("tfoot",{className:"orb-table-footer",style:{zIndex:t.zIndex},children:l("tr",{children:[c&&e("td",{className:"orb-table-footer-control",style:{width:56,minWidth:56,maxWidth:56}}),p&&e("td",{className:"orb-table-footer-control",style:{width:72,minWidth:72,maxWidth:72}}),u.map(d=>e("td",{className:`orb-table-footer-cell ${d.numeric?"orb-num":""}`,style:{width:s[d.id]||d.minWidth||100,minWidth:s[d.id]||d.minWidth||100,maxWidth:s[d.id]||d.minWidth||100},children:(function(){let b=n[d.id];return b==null||b===""?"":typeof b=="number"?b.toLocaleString():typeof b=="string"&&b.trim()!==""&&!isNaN(Number(b))?Number(b).toLocaleString():b})()},d.id))]})})};w();var Pd=t=>{let{t:r}=de();return e("div",{sx:{p:2},children:e(E,{children:r("table.mobile.notImplemented")})})};w();var Jo=({groupAnchorEl:t,setGroupAnchorEl:r,grouping:o,setGrouping:n,columns:a})=>{let{t:i}=de(),[s,c]=Qt.useState(o);Qt.useEffect(()=>{t&&c(o);},[t,o]);let p=()=>{c(o),r(null);},u=f=>{c(b=>b.includes(f)?b.filter(m=>m!==f):[...b,f]);},d=()=>{n(s),r(null);};return l(Yt,{anchorEl:t,open:!!t,onClose:p,sx:{width:224,minWidth:224,maxHeight:360,overflowY:"auto"},children:[l("div",{className:"orb-table-group-menu-header",onClick:f=>f.stopPropagation(),children:[e(E,{className:"orb-table-group-menu-title",variant:"subtitle2",children:i("table.menu.groupBy")}),s.length>0&&e(ve,{className:"orb-table-group-menu-clear",size:"small",color:"error",onClick:f=>{f.stopPropagation(),c([]);},children:i("table.menu.clearAll")})]}),e(Nt,{className:"orb-table-group-menu-divider"}),a.map(f=>{let b=s.includes(f.id),m=s.indexOf(f.id)+1;return e("option",{className:"orb-table-group-menu-option",selected:b,onClick:v=>{v.stopPropagation(),u(f.id);},children:l("div",{className:"orb-table-group-menu-option-content",children:[e(Dt,{className:"orb-table-group-menu-checkbox",checked:b,size:"small"}),e(Gt,{className:"orb-table-group-menu-label",primary:f.label}),b&&e("span",{className:"orb-table-group-menu-order","aria-label":`${i("table.menu.groupBy")} ${m}`,children:m})]})},f.id)}),l("div",{className:"orb-table-group-menu-footer",children:[e(ve,{size:"small",variant:"ghost",onClick:p,children:i("common.cancel")}),e(ve,{size:"small",variant:"primary",onClick:d,children:i("common.ok")})]})]})},en=({anchorEl:t,setAnchorEl:r,columns:o,visibleColumns:n,toggleColumnVisibility:a})=>{let{t:i}=de();return l(Yt,{anchorEl:t,open:!!t,onClose:()=>r(null),children:[e("option",{disabled:true,children:e(Gt,{primary:i("table.menu.visibleColumns")})}),e(Nt,{}),o.map(s=>l("option",{onClick:()=>a(s.id),children:[e(Dt,{checked:n.includes(s.id),size:"small"}),e(Gt,{primary:s.label})]},s.id))]})},ei=({anchorEl:t,setAnchorEl:r,showSummary:o,setShowSummary:n,columns:a,summaryColumns:i,toggleSummaryColumn:s})=>{let{t:c}=de();return l(Yt,{anchorEl:t,open:!!t,onClose:()=>r(null),children:[e("option",{children:e(Bn,{control:e(Fa,{checked:o,onChange:p=>n(p.target.checked),size:"small"}),label:c("table.menu.showSummaryRow")})}),e(Nt,{}),a.filter(p=>p.numeric).map(p=>l("option",{onClick:()=>s(p.id),disabled:!o,children:[e(Dt,{checked:i.includes(p.id),size:"small"}),e(Gt,{primary:p.label})]},p.id)),a.filter(p=>p.numeric).length===0&&e("option",{disabled:true,children:e(Gt,{primary:c("table.menu.noNumericColumns")})})]})},ti=({contextMenu:t,handleCloseContextMenu:r,columns:o,visibleColumns:n,toggleColumnVisibility:a})=>{let{t:i}=de();return l(Yt,{open:t!==null,onClose:r,anchorReference:"anchorPosition",anchorPosition:t!==null?{top:t.mouseY,left:t.mouseX}:void 0,children:[e("option",{onClick:r,children:i("common.copy")}),e(Nt,{}),e("option",{disabled:true,children:i("table.menu.visibleColumns")}),o.map(s=>l("option",{onClick:()=>a(s.id),children:[e(Or,{children:n.includes(s.id)&&e($c,{fontSize:"small"})}),e(Gt,{children:s.label})]},s.id))]})},Dd=({contextMenu:t,handleClose:r,columns:o,visibleColumns:n,grouping:a,summaryColumns:i,showSummary:s,sortBy:c,orderBy:p,order:u,onSortAsc:d,onSortDesc:f,onClearSort:b,onHideColumn:m,onToggleGroup:v,onToggleSummary:y,onOpenSortDialog:g})=>{let{t:x}=de(),h=t?.columnId??"",S=o.find(k=>k.id===h),T=a.includes(h),C=i.includes(h),L=!!S?.numeric,A=c.find(k=>k.field===h),I=A?A.direction==="asc":p===h&&u==="asc",N=A?A.direction==="desc":p===h&&u==="desc",M=I||N;return l(Yt,{open:t!==null,onClose:r,anchorReference:"anchorPosition",anchorPosition:t!==null?{top:t.mouseY,left:t.mouseX}:void 0,children:[e("option",{disabled:true,sx:{opacity:"1 !important",fontWeight:700},children:e(Gt,{primary:S?.label??h})}),e(Nt,{}),l("option",{onClick:()=>{d(h),r();},selected:I,children:[e(Or,{children:e(ks,{fontSize:"small"})}),e(Gt,{primary:x("table.headerMenu.sortAsc")})]}),l("option",{onClick:()=>{f(h),r();},selected:N,children:[e(Or,{children:e(ws,{fontSize:"small"})}),e(Gt,{primary:x("table.headerMenu.sortDesc")})]}),M&&l("option",{onClick:()=>{b(h),r();},children:[e(Or,{children:e(_c,{fontSize:"small"})}),e(Gt,{primary:x("table.headerMenu.clearSort")})]}),l("option",{onClick:()=>{g(),r();},children:[e(Or,{children:e(Mo,{fontSize:"small"})}),e(Gt,{primary:x("table.headerMenu.configureSort")})]}),e(Nt,{}),l("option",{onClick:()=>{v(h),r();},selected:T,children:[e(Or,{children:e(uo,{fontSize:"small"})}),e(Gt,{primary:x(T?"table.headerMenu.ungroup":"table.headerMenu.group")})]}),L&&s&&l("option",{onClick:()=>{y(h),r();},selected:C,children:[e(Or,{children:e(Yo,{fontSize:"small"})}),e(Gt,{primary:x(C?"table.headerMenu.removeSummary":"table.headerMenu.addSummary")})]}),e(Nt,{}),l("option",{onClick:()=>{m(h),r();},children:[e(Or,{children:e(vd,{fontSize:"small"})}),e(Gt,{primary:x("table.headerMenu.hideColumn")})]})]})},Ad=({open:t,onClose:r,columns:o,initialRules:n,onApply:a,onClear:i})=>{let{t:s}=de(),[c,p]=Qt.useState([]);Qt.useEffect(()=>{t&&p(n.length>0?n.map(y=>({...y})):[]);},[t,n]);let u=Qt.useMemo(()=>new Set(c.map(y=>y.field)),[c]),d=Qt.useMemo(()=>o.filter(y=>!u.has(y.id)),[o,u]),f=()=>{let y=d[0];y&&p(g=>[...g,{field:y.id,direction:"asc"}]);},b=y=>{p(g=>g.filter((x,h)=>h!==y));},m=(y,g)=>{p(x=>x.map((h,S)=>S===y?{...h,...g}:h));},v=(y,g)=>{p(x=>{let h=y+g;if(h<0||h>=x.length)return x;let S=[...x],[T]=S.splice(y,1);return S.splice(h,0,T),S});};return e(Vt,{open:t,onClose:r,maxWidth:620,fullWidth:true,className:"orb-table-sort-dialog",title:s("table.sortDialog.title"),actions:l(jsxRuntime.Fragment,{children:[e(ve,{className:"orb-table-sort-clear",variant:"neutral",disabled:c.length===0&&n.length===0,onClick:()=>{i(),r();},children:s("table.sortDialog.clearAll")}),e("span",{className:"orb-table-sort-action-spacer"}),e(ve,{variant:"neutral",onClick:r,children:s("common.cancel")}),e(ve,{variant:"primary",onClick:()=>{a(c),r();},children:s("common.ok")})]}),children:l("div",{className:"orb-table-sort-dialog-content",children:[c.length===0?e(E,{className:"orb-table-sort-empty",variant:"body2",children:s("table.sortDialog.empty")}):e(ie,{className:"orb-table-sort-rules",spacing:1,children:c.map((y,g)=>{let x=new Set(c.filter((S,T)=>T!==g).map(S=>S.field)),h=o.filter(S=>!x.has(S.id));return l("div",{className:"orb-table-sort-rule",children:[e(La,{className:"orb-table-sort-order",badgeContent:g+1,color:"primary"}),e(Kt,{size:"small",value:y.field,onChange:S=>m(g,{field:S.target.value}),options:h.map(S=>({value:S.id,label:S.label}))}),e(Kt,{size:"small",value:y.direction,onChange:S=>m(g,{direction:S.target.value}),options:[{value:"asc",label:s("table.sortDialog.asc")},{value:"desc",label:s("table.sortDialog.desc")}]}),e(ae,{className:"orb-table-sort-icon-button",size:"small",onClick:()=>v(g,-1),disabled:g===0,children:e(ks,{fontSize:"small"})}),e(ae,{className:"orb-table-sort-icon-button",size:"small",onClick:()=>v(g,1),disabled:g===c.length-1,children:e(ws,{fontSize:"small"})}),e(ae,{className:"orb-table-sort-icon-button orb-table-sort-delete",size:"small",onClick:()=>b(g),children:e(Va,{fontSize:"small"})})]},`sort-rule-${g}`)})}),e(ve,{size:"small",onClick:f,disabled:d.length===0,startIcon:e(Mo,{}),variant:"secondary",className:"orb-table-sort-add",children:s("table.sortDialog.addRule")})]})})};w();var Hn=(t,r=2)=>t.toLocaleString(void 0,{maximumFractionDigits:r}),Nd=({kpis:t})=>{let{t:r}=de(),o=[{label:r("graph.kpi.totalRecords"),value:Hn(t.totalRecords,0),color:"var(--orb-fg)"},{label:r("graph.kpi.totalReport"),value:Hn(t.totalReportHours),color:"var(--orb-fg)"},{label:r("graph.kpi.totalBillable"),value:Hn(t.totalBillableHours),color:"var(--orb-primary)"},{label:r("graph.kpi.efficiency"),value:`${t.efficiency.toFixed(2)}%`,color:"var(--orb-accent)"},{label:r("graph.kpi.amount"),value:Hn(t.totalAmount),color:"var(--orb-primary)"},{label:r("graph.kpi.flagged"),value:Hn(t.flaggedCount,0),color:"var(--orb-err)"}];return e("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(140px, 1fr))",gap:12},children:o.map(n=>l(Ne,{elevation:0,sx:{padding:12,minHeight:96,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[e(E,{variant:"caption",muted:true,children:n.label}),e(E,{variant:"h3",sx:{fontWeight:800,color:n.color,fontVariantNumeric:"tabular-nums"},children:n.value})]},n.label))})};w();var ri=({title:t,subtitle:r,children:o})=>l(Ne,{elevation:0,sx:{padding:16},children:[e(E,{variant:"h4",sx:{fontWeight:700},children:t}),r&&e(E,{variant:"body2",muted:true,sx:{marginBottom:16},children:r}),o]});w();var Wn=({data:t,orientation:r="horizontal",valueSuffix:o="",minHeight:n=210,activeName:a,onItemClick:i})=>{if(t.length===0)return e(E,{variant:"body2",muted:true,children:"No data"});let s=Math.max(...t.map(c=>c.value),1);return r==="vertical"?e("div",{style:{display:"flex",gap:1,alignItems:"flex-end",minHeight:n},children:t.map(c=>l("div",{style:{flex:1,minWidth:0},children:[e("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}}),e(E,{variant:"caption",title:c.name,sx:{display:"block",mt:.5},children:c.name}),l(E,{variant:"caption",muted:true,children:[c.value.toFixed(1),o]})]},c.name))}):e(ie,{spacing:1,children:t.map(c=>l("div",{style:{display:"grid",gridTemplateColumns:"140px 1fr 64px",gap:1},children:[e(E,{variant:"caption",muted:true,title:c.name,children:c.name}),e("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:e("div",{style:{width:`${c.value/s*100}%`,height:"100%",background:c.name===a?"primary.dark":"primary.main"}})}),l(E,{variant:"caption",sx:{textAlign:"right",fontWeight:600},children:[c.value.toFixed(1),o]})]},c.name))})};w();var Ed=({data:t,color:r="var(--orb-chart-1)",valueSuffix:o="",height:n=220})=>{if(t.length===0)return e(E,{variant:"body2",muted:true,children:"No data"});let a=640,i=28,s=t.map(b=>b.value),c=Math.min(...s,0),u=Math.max(...s,1)-c||1,d=t.map((b,m)=>{let v=i+m*(a-i*2)/Math.max(t.length-1,1),y=n-i-(b.value-c)/u*(n-i*2);return {x:v,y,...b}}),f=d.map(b=>`${b.x},${b.y}`).join(" ");return l("div",{children:[l("div",{component:"svg",viewBox:`0 0 ${a} ${n}`,style:{width:"100%",height:n},children:[e("line",{x1:i,y1:n-i,x2:a-i,y2:n-i,style:{stroke:"var(--orb-chart-grid)"}}),e("polyline",{fill:"none",style:{stroke:r},strokeWidth:3,points:f}),d.map(b=>e("circle",{cx:b.x,cy:b.y,r:4,style:{fill:r}},b.name))]}),e("div",{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`,gap:1},children:t.map(b=>l("div",{style:{minWidth:0},children:[e(E,{variant:"caption",title:b.name,sx:{display:"block"},children:b.name}),l(E,{variant:"caption",muted:true,children:[b.value.toFixed(1),o]})]},b.name))})]})};w();var Ld=({data:t,barColor:r="var(--orb-chart-1)",lineColor:o="var(--orb-chart-5)",height:n=220})=>{if(t.length===0)return e(E,{variant:"body2",muted:true,children:"No data"});let a=640,i=28,s=Math.max(...t.map(d=>d.barValue),1),c=Math.max(...t.map(d=>d.lineValue),1),p=t.map((d,f)=>{let b=(a-i*2)/t.length,m=Math.max(b*.5,8),v=i+f*b+(b-m)/2,y=d.barValue/s*(n-i*2),g=n-i-y;return {x:v,y:g,barHeight:y,barWidth:m,item:d}}),u=t.map((d,f)=>{let b=(a-i*2)/t.length,m=i+f*b+b/2,v=n-i-d.lineValue/c*(n-i*2);return {x:m,y:v,item:d}});return l(ie,{spacing:1.25,children:[l("div",{component:"svg",viewBox:`0 0 ${a} ${n}`,style:{width:"100%",height:n},children:[e("line",{x1:i,y1:n-i,x2:a-i,y2:n-i,style:{stroke:"var(--orb-chart-grid)"}}),p.map(d=>e("rect",{x:d.x,y:d.y,width:d.barWidth,height:Math.max(d.barHeight,4),rx:6,style:{fill:r}},d.item.name)),e("polyline",{fill:"none",style:{stroke:o},strokeWidth:3,points:u.map(d=>`${d.x},${d.y}`).join(" ")}),u.map(d=>e("circle",{cx:d.x,cy:d.y,r:3.5,style:{fill:o}},`${d.item.name}-line`))]}),e("div",{style:{display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`,gap:1},children:t.map(d=>l("div",{style:{minWidth:0},children:[e(E,{variant:"caption",title:d.name,sx:{display:"block"},children:d.name}),l(E,{variant:"caption",muted:true,sx:{display:"block"},children:["Bar: ",d.barValue.toFixed(1)]}),l(E,{variant:"caption",muted:true,sx:{display:"block"},children:["Line: ",d.lineValue.toFixed(1)]})]},d.name))})]})};w();var mf=t=>{let o=.2+Math.max(0,Math.min(1,t))*.8;return `color-mix(in oklch, var(--orb-chart-1) ${Math.round(o*100)}%, transparent)`},Fd=({data:t})=>{if(t.length===0)return e(E,{variant:"body2",muted:true,children:"No data"});let r=Array.from(new Set(t.map(i=>i.x))),o=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 e("div",{style:{overflowX:"auto"},children:l("div",{style:{display:"grid",gridTemplateColumns:`120px repeat(${r.length}, minmax(64px, 1fr))`,gap:1,minWidth:120+r.length*64},children:[e("div",{}),r.map(i=>e(E,{variant:"caption",sx:{textAlign:"center",fontWeight:600},children:i},i)),o.map(i=>l("div",{style:{display:"contents"},children:[e(E,{variant:"caption",sx:{alignSelf:"center"},children:i}),r.map(s=>{let c=a.get(`${i}__${s}`)||0,p=c/n;return e("div",{sx:{height:36,borderRadius:1,background:mf(p),border:"1px solid color-mix(in oklch, var(--orb-muted) 20%, transparent)",display:"flex",alignItems:"center",justifyContent:"center"},children:e(E,{variant:"caption",sx:{fontWeight:700},children:c.toFixed(1)})},`${i}-${s}`)})]},i))]})})};w();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)"],oi=({data:t,variant:r="donut",colors:o=gf,size:n=180,activeName:a,onItemClick:i})=>{if(t.length===0)return e(E,{variant:"body2",muted:true,children:"No data"});let s=0,c=t.map((p,u)=>{let d=s;return s+=p.percent,`${o[u%o.length]} ${d}% ${s}%`});return l(ie,{direction:{xs:"column",sm:"row"},spacing:2,alignItems:"center",children:[e("div",{style:{width:n,height:n,borderRadius:"50%",background:`conic-gradient(${c.join(", ")})`,position:"relative",flexShrink:0},children:r==="donut"&&e("div",{style:{position:"absolute",inset:Math.round(n*.18),background:"background.paper",borderRadius:"50%"}})}),e(ie,{spacing:1,sx:{minWidth:180},children:t.map((p,u)=>l("div",{onClick:()=>i?.(p),sx:{display:"flex",alignItems:"center",gap:1,cursor:i?"pointer":"default",opacity:a&&p.name!==a?.45:1},children:[e("div",{style:{width:10,height:10,borderRadius:"50%",background:o[u%o.length]}}),e(E,{variant:"caption",sx:{flex:1},children:p.name}),l(E,{variant:"caption",sx:{fontWeight:700},children:[p.percent.toFixed(0),"%"]})]},p.name))})]})};w();var Od=({effect:t,branches:r})=>{if(r.length===0)return e(E,{variant:"body2",muted:true,children:"No data"});let o=r.filter((a,i)=>i%2===0),n=r.filter((a,i)=>i%2===1);return l(ie,{spacing:1.5,children:[e("div",{style:{display:"grid",gridTemplateColumns:`repeat(${Math.max(o.length,1)}, minmax(0, 1fr))`,gap:1},children:o.map(a=>l("div",{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[e(E,{variant:"caption",sx:{fontWeight:700},children:a.title}),a.causes.map(i=>e(E,{variant:"caption",muted:true,sx:{display:"block"},children:i},i))]},a.title))}),l("div",{style:{position:"relative",height:32},children:[e("div",{style:{position:"absolute",inset:"50% 0 auto 0",borderTop:"2px solid",borderColor:"primary.main"}}),e("div",{sx:{position:"absolute",right:0,top:"calc(50% - 12px)",px:1,py:.25,borderRadius:1,background:"primary.main",color:"primary.contrastText"},children:e(E,{variant:"caption",sx:{fontWeight:700},children:t})})]}),e("div",{style:{display:"grid",gridTemplateColumns:`repeat(${Math.max(n.length,1)}, minmax(0, 1fr))`,gap:1},children:n.map(a=>l("div",{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[e(E,{variant:"caption",sx:{fontWeight:700},children:a.title}),a.causes.map(i=>e(E,{variant:"caption",muted:true,sx:{display:"block"},children:i},i))]},a.title))})]})};w();var Bd=({data:t,height:r=240})=>{if(t.length===0)return e(E,{variant:"body2",muted:true,children:"No data"});let o=0,n=t.map(f=>{let b=f.type==="total"?0:o,m=f.type==="total"?f.value:o+f.value;return f.type!=="total"&&(o=m),{...f,start:b,end:m,delta:m-b}}),a=n.flatMap(f=>[f.start,f.end]),i=Math.min(...a,0),s=Math.max(...a,1),c=680,p=30,u=s-i||1,d=f=>r-p-(f-i)/u*(r-p*2);return l("div",{children:[l("div",{component:"svg",viewBox:`0 0 ${c} ${r}`,style:{width:"100%",height:r},children:[e("line",{x1:p,y1:d(0),x2:c-p,y2:d(0),style:{stroke:"var(--orb-chart-grid)"}}),n.map((f,b)=>{let m=(c-p*2)/n.length,v=Math.max(m*.55,8),y=p+b*m+(m-v)/2,g=d(Math.max(f.start,f.end)),x=d(Math.min(f.start,f.end)),h=f.type==="total"?"var(--orb-chart-1)":f.delta>=0?"var(--orb-chart-positive)":"var(--orb-chart-negative)";return l("g",{children:[e("rect",{x:y,y:g,width:v,height:Math.max(x-g,4),rx:6,style:{fill:h}}),e("text",{x:y+v/2,y:g-6,textAnchor:"middle",fill:"currentColor",fontSize:"11",children:f.end.toFixed(1)})]},f.name)})]}),e("div",{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${n.length}, minmax(0, 1fr))`,gap:1},children:n.map(f=>e(E,{variant:"caption",title:f.name,children:f.name},f.name))})]})};var $n=({apiKey:t,query:r,zoom:o=14,mapType:n="roadmap"})=>{let a=encodeURIComponent(r);return `https://www.google.com/maps/embed/v1/place?key=${encodeURIComponent(t)}&q=${a}&zoom=${o}&maptype=${n}`},gP=(t,r=360)=>{let o=$n(t);return `<iframe width="100%" height="${r}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${o}"></iframe>`};w();var zd=({apiKey:t,query:r,embedUrl:o,zoom:n=14,mapType:a="roadmap",height:i=320})=>{let s=o||(t&&r?$n({apiKey:t,query:r,zoom:n,mapType:a}):"");return s?l("div",{children:[e("div",{component:"iframe",src:s,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:i,border:0,borderRadius:2}}),l(E,{variant:"caption",muted:true,sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",e("a",{href:s,target:"_blank",rel:"noreferrer",children:"Google Maps"})]})]}):e("div",{children:e(E,{variant:"body2",muted:true,children:"Google Map requires `embedUrl` or (`apiKey` + `query`)."})})};var ni=({keyword:t,location:r,src:o="orbcafe-ui"})=>{if(r){let n=encodeURIComponent(r.name||t||"Location");return `https://uri.amap.com/marker?position=${r.lng},${r.lat}&name=${n}&src=${encodeURIComponent(o)}&coordinate=gaode&callnative=0`}return t?`https://uri.amap.com/search?keyword=${encodeURIComponent(t)}&src=${encodeURIComponent(o)}&callnative=0`:"https://uri.amap.com/search?keyword=%E5%8C%97%E4%BA%AC&src=orbcafe-ui&callnative=0"};w();var Vd=({keyword:t,location:r,embedUrl:o,height:n=320})=>{let a=o||ni({keyword:t,location:r?{lng:r.lng,lat:r.lat,name:r.name}:void 0});return l("div",{children:[e("div",{component:"iframe",src:a,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:n,border:0,borderRadius:2}}),l(E,{variant:"caption",muted:true,sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",e("a",{href:a,target:"_blank",rel:"noreferrer",children:"AMap"})]})]})};w();var Hd=({billableByPrimary:t,efficiencyBySecondary:r,statusDistribution:o,interaction:n})=>{let{t:a}=de();return l("div",{style:{display:"grid",gap:12,gridTemplateColumns:"repeat(auto-fit, minmax(320px, 1fr))"},children:[e(ri,{title:a("graph.chart.billable.title"),subtitle:a("graph.chart.billable.subtitle"),children:e(Wn,{data:t,orientation:"horizontal",activeName:n?.filters?.primaryDimension,onItemClick:i=>n?.onPrimaryDimensionClick?.(i.name)})}),e(ri,{title:a("graph.chart.efficiency.title"),subtitle:a("graph.chart.efficiency.subtitle"),children:e(Wn,{data:r,orientation:"vertical",valueSuffix:"%",activeName:n?.filters?.secondaryDimension,onItemClick:i=>n?.onSecondaryDimensionClick?.(i.name)})}),e(ri,{title:a("graph.chart.status.title"),subtitle:a("graph.chart.status.subtitle"),children:e(oi,{data:o,variant:"donut",activeName:n?.filters?.status,onItemClick:i=>n?.onStatusClick?.(i.name)})})]})};w();var bf=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],hf=["zh","en","de","fr","ja","ko"],Wd=({open:t,onClose:r,value:o,onSaveAll:n,modelOptions:a=bf,promptLangOptions:i=hf,analysisTemplateOptions:s=[],responseTemplateOptions:c=[],defaultAnalysisTemplateId:p,defaultResponseTemplateId:u})=>{let[d,f]=Qt.useState(o),[b,m]=Qt.useState(p||""),[v,y]=Qt.useState(u||""),[g,x]=Qt.useState(false);Qt.useEffect(()=>{t&&(f(o),m(p||""),y(u||""));},[t,o,p,u]);let h=(T,C)=>{f(L=>({...L,[T]:C}));},S=async()=>{if(n)try{x(!0),await n({settings:d,analysisTemplateId:b||void 0,responseTemplateId:v||void 0});}finally{x(false);}};return l(Vt,{open:t,onClose:r,fullWidth:true,maxWidth:"lg",children:[l("div",{className:"orb-dialog-title",sx:{pr:7,pb:2.2},children:[e(E,{variant:"h5",sx:{fontWeight:800},children:"AI Settings"}),e(E,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:"Configure LLM settings and editable agent prompts by language."}),e(ae,{onClick:r,sx:{position:"absolute",right:12,top:12},children:e(mo,{})})]}),e("div",{className:"orb-dialog-content",sx:{pt:"18px !important"},children:l(ie,{spacing:2.2,children:[l("div",{sx:{mt:.8,display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",md:"repeat(2, minmax(0, 1fr))"}},children:[e("div",{children:e(Be,{size:"small",value:d.baseUrl,onChange:T=>h("baseUrl",T.target.value),fullWidth:true,label:"Base URL"})}),e("div",{children:e(Be,{size:"small",type:"password",value:d.apiKey,onChange:T=>h("apiKey",T.target.value),fullWidth:true,label:"API Key"})}),e("div",{children:e(Be,{size:"small",value:d.model,onChange:T=>h("model",T.target.value),fullWidth:true,select:true,label:"Model",children:a.map(T=>e("option",{value:T,children:T},T))})}),e("div",{children:e(Be,{size:"small",value:d.promptLang,onChange:T=>h("promptLang",T.target.value),fullWidth:true,select:true,label:"Prompt Lang",children:i.map(T=>e("option",{value:T,children:T},T))})})]}),l("div",{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[l(Be,{size:"small",value:b,onChange:T=>m(T.target.value),fullWidth:true,select:true,label:"Analysis Template",children:[e("option",{value:"",children:"Default"}),s.map(T=>e("option",{value:T.id,children:T.label},T.id))]}),e(Pn,{multiline:true,minRows:8,value:d.analysisPrompt,onChange:T=>h("analysisPrompt",T.target.value),fullWidth:true,label:"Analysis Prompt",sx:{"& textarea":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}}),l(Be,{size:"small",value:v,onChange:T=>y(T.target.value),fullWidth:true,select:true,label:"Response Template",children:[e("option",{value:"",children:"Default"}),c.map(T=>e("option",{value:T.id,children:T.label},T.id))]}),e(Pn,{multiline:true,minRows:8,value:d.responsePrompt,onChange:T=>h("responsePrompt",T.target.value),fullWidth:true,label:"Response Prompt",sx:{"& textarea":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}})]})]})}),l("div",{className:"orb-dialog-actions",sx:{px:3,pb:2.5,pt:1.2,gap:1},children:[e(ve,{variant:"outlined",onClick:r,children:"Cancel"}),e(ve,{variant:"contained",onClick:S,disabled:!n||g,children:"Save"})]})]})};w();var ii=({open:t,onClose:r,model:o,tableContent:n,extraCharts:a,interaction:i,aiAssistant:s})=>{let{t:c}=de(),[p,u]=Qt.useState(s?.defaultPrompt||""),[d,f]=Qt.useState(false),[b,m]=Qt.useState(false),v=i?.enabled!==false&&!!i,y=s?.enabled!==false,g=i?.filters||{},x=!!(g.primaryDimension||g.secondaryDimension||g.status),h=s?.placeholder||"Ask AI to analyze data, create charts, or find insights...";Qt.useEffect(()=>{t&&u(s?.defaultPrompt||"");},[t,s?.defaultPrompt]);let S=s?.settings||{baseUrl:"/llm-api",apiKey:"",model:"doubao-lite",promptLang:"zh",analysisPrompt:"",responsePrompt:""},T=async()=>{let C=p.trim();if(!(!C||!s?.onSubmit))try{f(!0),await s.onSubmit(C,{filters:g,model:o});}finally{f(false);}};return e(Vt,{open:t,onClose:r,fullWidth:true,maxWidth:1400,hideCloseButton:true,children:l("div",{style:{height:"80vh",display:"flex",flexDirection:"column",background:"var(--orb-canvas)"},children:[e("div",{style:{padding:16,borderBottom:"1px solid var(--orb-border)"},children:l(ie,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:12,children:[l(ie,{direction:"row",spacing:10,alignItems:"center",sx:{flexWrap:"wrap"},children:[e(E,{variant:"h3",sx:{fontWeight:800},children:o.title}),e(Tt,{label:c("graph.records",{count:o.kpis.totalRecords})}),v&&g.primaryDimension&&e(Tt,{tone:"outline",label:`${i?.fieldMapping.primaryDimension}: ${g.primaryDimension}`,onDelete:()=>i?.onClearFilter("primaryDimension")}),v&&g.secondaryDimension&&e(Tt,{tone:"outline",label:`${i?.fieldMapping.secondaryDimension}: ${g.secondaryDimension}`,onDelete:()=>i?.onClearFilter("secondaryDimension")}),v&&g.status&&e(Tt,{tone:"outline",label:`${i?.fieldMapping.status}: ${g.status}`,onDelete:()=>i?.onClearFilter("status")}),v&&x&&e(ve,{size:"small",variant:"ghost",onClick:()=>i?.onClearAll(),children:"Clear"})]}),l(ie,{direction:"row",spacing:10,alignItems:"center",children:[y&&l("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:[e(ae,{size:"small",onClick:s?.onVoiceInput,children:e(ma,{size:16,strokeWidth:1.8})}),e("input",{className:"orb-inp orb-inp-dense",value:p,onChange:C=>u(C.target.value),onKeyDown:C=>{C.key==="Enter"&&(C.preventDefault(),T());},placeholder:h,style:{fontSize:14,border:"none",background:"transparent",flex:1,minWidth:0}}),e(ae,{size:"small",onClick:T,disabled:d||!p.trim(),children:e(Kl,{size:16,strokeWidth:1.8})}),e(ae,{size:"small",onClick:()=>m(true),children:e(va,{size:16,strokeWidth:1.8})})]}),e(ae,{onClick:r,children:e(or,{size:18,strokeWidth:2})})]})]})}),l("div",{style:{padding:16,display:"flex",flexDirection:"column",gap:12,overflow:"auto",minHeight:0},children:[e(Nd,{kpis:o.kpis}),e(Hd,{billableByPrimary:o.charts.billableByPrimary,efficiencyBySecondary:o.charts.efficiencyBySecondary,statusDistribution:o.charts.statusDistribution,interaction:v?{filters:g,onPrimaryDimensionClick:C=>i?.onPrimaryDimensionClick(C),onSecondaryDimensionClick:C=>i?.onSecondaryDimensionClick(C),onStatusClick:C=>i?.onStatusClick(C)}:void 0}),a,n]}),e(Wd,{open:b,onClose:()=>m(false),value:S,onSaveAll:s?.onSaveAll,modelOptions:s?.modelOptions,promptLangOptions:s?.promptLangOptions,analysisTemplateOptions:s?.analysisTemplateOptions,responseTemplateOptions:s?.responseTemplateOptions,defaultAnalysisTemplateId:s?.defaultAnalysisTemplateId,defaultResponseTemplateId:s?.defaultResponseTemplateId})]})})};var vo={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"]},yf=5,$d=t=>t.toLowerCase().replace(/[\s_-]/g,""),yo=(t,r,o,n)=>{if(r)return r;if(t.length===0)return n;let a=Object.keys(t[0]),i=new Map(a.map(s=>[$d(s),s]));for(let s of o){let c=i.get($d(s));if(c)return c}return a[0]||n},wr=t=>{if(typeof t=="number")return Number.isFinite(t)?t:0;if(typeof t=="string"){let r=Number(t.replace(/,/g,"").trim());return Number.isFinite(r)?r:0}return 0},pr=(t,r)=>t==null||t===""?r:String(t),xf=(t,r,o,n,a)=>{let i=new Map;return t.forEach(s=>{let c=pr(s[r],a);i.set(c,(i.get(c)||0)+wr(s[o]));}),Array.from(i.entries()).map(([s,c])=>({name:s,value:c})).sort((s,c)=>c.value-s.value).slice(0,n)},Cf=(t,r,o,n,a,i)=>{let s=new Map;return t.forEach(c=>{let p=pr(c[r],i),u=s.get(p)||{report:0,billable:0};u.report+=wr(c[o]),u.billable+=wr(c[n]),s.set(p,u);}),Array.from(s.entries()).map(([c,p])=>({name:c,value:p.report>0?p.billable/p.report*100:0})).sort((c,p)=>c.value-p.value).slice(0,a)},Sf=(t,r,o)=>{let n=t.length;if(n===0)return [];let a=new Map;return t.forEach(i=>{let s=pr(i[r],o);a.set(s,(a.get(s)||0)+1);}),Array.from(a.entries()).map(([i,s])=>({name:i,value:s,percent:s/n*100}))},Gd=(t,r,o)=>{let n=new Map;return t.forEach(a=>{let i=pr(a[r],"N/A");n.set(i,(n.get(i)||0)+wr(a[o]));}),Array.from(n.entries()).sort(([a],[i])=>a.localeCompare(i)).map(([a,i])=>({name:a,value:i}))},wf=(t,r,o,n,a,i)=>{let s=new Map;return t.forEach(c=>{let p=pr(c[r],i),u=s.get(p)||{report:0,billable:0};u.report+=wr(c[o]),u.billable+=wr(c[n]),s.set(p,u);}),Array.from(s.entries()).map(([c,p])=>({name:c,barValue:p.billable,lineValue:p.report>0?p.billable/p.report*100:0})).sort((c,p)=>p.barValue-c.barValue).slice(0,a)},kf=(t,r,o,n,a)=>{let i=new Map;return t.forEach(s=>{let c=pr(s[r],a),p=pr(s[o],a),u=`${c}__${p}`;i.set(u,(i.get(u)||0)+wr(s[n]));}),Array.from(i.entries()).map(([s,c])=>{let[p,u]=s.split("__");return {x:p,y:u,value:c}})},Tf=(t,r,o)=>{let n=Gd(t,r,o),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"}]},Pf=(t,r,o,n,a,i)=>{let s=new Map;return t.forEach(c=>{let p=pr(c[r],i),u=`${pr(c[o],i)} / ${pr(c[n],i)}`,d=s.get(p)||new Map;d.set(u,(d.get(u)||0)+1),s.set(p,d);}),Array.from(s.entries()).map(([c,p])=>({title:c,causes:Array.from(p.entries()).sort((u,d)=>d[1]-u[1]).slice(0,a).map(([u,d])=>`${u} (${d})`)})).slice(0,6)},tn=({rows:t,config:r})=>{let{t:o}=de(),n=o("graph.unassigned"),a=Qt.useMemo(()=>{let d=r?.fieldMapping;return {primaryDimension:yo(t,d?.primaryDimension,vo.primaryDimension,"Category"),secondaryDimension:yo(t,d?.secondaryDimension,vo.secondaryDimension,"Owner"),status:yo(t,d?.status,vo.status,"Status"),date:yo(t,d?.date,vo.date,"Date"),description:yo(t,d?.description,vo.description,"Description"),reportHours:yo(t,d?.reportHours,vo.reportHours,"ReportHours"),billableHours:yo(t,d?.billableHours,vo.billableHours,"BillableHours"),amount:yo(t,d?.amount,vo.amount,"Amount")}},[t,r?.fieldMapping]),i=Qt.useMemo(()=>t.map((d,f)=>{let b=wr(d[a.reportHours]),m=wr(d[a.billableHours]),v=wr(d[a.amount]),y=b>0?m/b*100:0;return {id:`graph-row-${f}`,Date:pr(d[a.date],""),Primary:pr(d[a.primaryDimension],n),Secondary:pr(d[a.secondaryDimension],n),Description:pr(d[a.description],""),ReportHours:b,BillableHours:m,Amount:v,Efficiency:y,Status:pr(d[a.status],n)}}),[t,a,n]),s=Qt.useMemo(()=>{let d=i.length,f=i.reduce((x,h)=>x+wr(h.ReportHours),0),b=i.reduce((x,h)=>x+wr(h.BillableHours),0),m=i.reduce((x,h)=>x+wr(h.Amount),0),v=f>0?b/f*100:0,y=r?.statusFlagValues||["flag","flagged","warning","risk"],g=i.filter(x=>y.includes(pr(x.Status,"").toLowerCase())).length;return {totalRecords:d,totalReportHours:f,totalBillableHours:b,efficiency:v,totalAmount:m,flaggedCount:g}},[i,r?.statusFlagValues]),c=r?.topN||yf,p=Qt.useMemo(()=>({billableByPrimary:xf(i,"Primary","BillableHours",c,n),efficiencyBySecondary:Cf(i,"Secondary","ReportHours","BillableHours",c,n),statusDistribution:Sf(i,"Status",n),lineByDate:Gd(i,"Date","BillableHours"),comboByPrimary:wf(i,"Primary","ReportHours","BillableHours",c,n),heatmapPrimarySecondary:kf(i,"Primary","Secondary","BillableHours",n),waterfallBillable:Tf(i,"Date","BillableHours"),fishboneStatusCauses:Pf(i,"Status","Primary","Secondary",3,n)}),[i,c,n]),u=Qt.useMemo(()=>({title:r?.title||o("graph.reportTitle"),kpis:s,charts:p,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:o("graph.column.reportHours"),align:"right"},{id:"BillableHours",label:o("graph.column.billableHours"),align:"right"},{id:"Amount",label:"Amount",align:"right"},{id:"Efficiency",label:"Efficiency",align:"right"},{id:"Status",label:a.status}],rows:i}}),[p,r?.title,a,s,i,o]);return {fieldMapping:a,model:u}};var rn=t=>String(t??"").trim(),li=(t={})=>{let[r,o]=Qt.useState(t),n=Qt.useCallback((p,u)=>{o(d=>{let f=u?.trim();if(!f){let b={...d};return delete b[p],b}if(d[p]===f){let b={...d};return delete b[p],b}return {...d,[p]:f}});},[]),a=Qt.useCallback(p=>{o(u=>{if(!u[p])return u;let d={...u};return delete d[p],d});},[]),i=Qt.useCallback(()=>{o({});},[]),s=Qt.useMemo(()=>!!(r.primaryDimension||r.secondaryDimension||r.status),[r]),c=Qt.useCallback((p,u)=>p.filter(d=>!(r.primaryDimension&&rn(d[u.primaryDimension])!==rn(r.primaryDimension)||r.secondaryDimension&&rn(d[u.secondaryDimension])!==rn(r.secondaryDimension)||r.status&&rn(d[u.status])!==rn(r.status))),[r]);return {filters:r,setFilter:n,clearFilter:a,clearAll:i,hasActiveFilters:s,applyRows:c}};w();var di=({variants:t,currentVariantId:r,onLoad:o,onSave:n,onDelete:a,onSetDefault:i})=>{let{t:s}=de(),[c,p]=Qt.useState(false),[u,d]=Qt.useState(""),[f,b]=Qt.useState(false),[m,v]=Qt.useState(false),y=t.find(h=>h.id===r),g=()=>{d(y?.name||s("variant.newVariant")),b(y?.isDefault||false),v(y?.isPublic||false),p(true);},x=()=>{n({name:u,isDefault:f,isPublic:m,description:""}),p(false);};return l("div",{className:"orb-variant-management",children:[e(Kt,{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:r||"",options:[{value:"",label:s("variant.selectVariant"),disabled:true},...t.map(h=>({value:h.id,label:h.name+(h.isDefault?` (${s("variant.defaultSuffix")})`:"")}))],onChange:h=>{let S=t.find(T=>T.id===h.target.value);S&&o(S);}}),e(it,{title:s("variant.saveView"),children:e(ae,{className:"orb-variant-save-button",onClick:g,size:"small",color:"primary",children:e(fo,{fontSize:"small"})})}),l(Vt,{open:c,onClose:()=>p(false),children:[e("div",{className:"orb-dialog-title",children:s("variant.saveView")}),l("div",{className:"orb-dialog-content",children:[e(Be,{autoFocus:true,margin:"dense",label:s("variant.viewName"),fullWidth:true,variant:"outlined",value:u,onChange:h=>d(h.target.value)}),e(Bn,{control:e(Dt,{checked:f,onChange:h=>b(h.target.checked)}),label:s("variant.setDefault")}),e(Bn,{control:e(Dt,{checked:m,onChange:h=>v(h.target.checked)}),label:s("variant.publicAllUsers")})]}),l("div",{className:"orb-dialog-actions",children:[e(ve,{onClick:()=>p(false),children:s("common.cancel")}),e(ve,{onClick:x,variant:"contained",children:s("common.save")})]})]})]})};w();var Ud=({appId:t,tableKey:r="default",currentFilters:o,currentLayoutId:n,layoutRefs:a,onLoad:i,variantService:s,serviceUrl:c,onError:p,onSuccess:u,currentVariantId:d,onVariantChange:f})=>{let{t:b}=de(),[m,v]=Qt.useState([]),[y,g]=Qt.useState(""),x=`orbcafe.variants.${t}.${r}`,h=d!==void 0?d:y,S=D=>{d===void 0&&g(D),f&&f(D);},T=Qt.useCallback(()=>{try{let D=localStorage.getItem(x);if(!D)return [];let R=JSON.parse(D);return Array.isArray(R)?R:[]}catch{return []}},[x]),C=Qt.useCallback(D=>{try{localStorage.setItem(x,JSON.stringify(D));}catch{}},[x]),L=Qt.useCallback(D=>{v(D);let R=D.find(F=>F.isDefault);R&&!h&&(S(R.id),i(R));},[h,i,S]),A=Qt.useCallback(async()=>{if(!t)return [];try{let D=[];if(s)D=await s.getVariants(t,r);else if(c){let R=await fetch(`${c}/api/variants?appId=${encodeURIComponent(t)}&tableKey=${encodeURIComponent(r)}`);if(!R.ok)throw new Error(b("variant.toast.fetchFailed"));D=await R.json();}else D=T();return L(D),D}catch(D){console.error("Error fetching variants",D);let R=T();return L(R),p&&p(b("variant.toast.fetchFailed")),R}},[t,r,s,c,T,L,p,b]);return Qt.useEffect(()=>{A();},[t,r]),e(di,{variants:m,currentVariantId:h,onLoad:D=>{S(D.id),i(D);},onSave:async D=>{let R=Date.now().toString(),F;try{let z=D.scope||"Both",K=m.find(X=>X.name===D.name);R=K?K.id:Date.now().toString();let V=[];if(K&&(Array.isArray(K.filters)?V=[...K.filters]:K.filters&&(V=[{scope:"default",filters:K.filters}])),z==="Search"||z==="Both"){let X=(Array.isArray(o),o);if(X)if(Array.isArray(X)&&X.length>0&&X[0].scope)X.forEach(W=>{let H=V.findIndex(Q=>Q.scope===W.scope);H>=0?V[H]=W:V.push(W);});else {let W={scope:r,filters:X},H=V.findIndex(Q=>Q.scope===r);H>=0?V[H]=W:V.push(W);}}let q=K?.layout||{},$=[];if(K&&Array.isArray(K.layoutRefs)&&($=[...K.layoutRefs]),z==="Layout"||z==="Both")if(a&&a.length>0)a.forEach(X=>{let W=$.findIndex(H=>H.tableKey===X.tableKey);W>=0?$[W]=X:$.push(X);});else {let X={tableKey:r,layoutId:n||null},W=$.findIndex(H=>H.tableKey===r);W>=0?$[W]=X:$.push(X);}if(F={appId:t,tableKey:r,...D,scope:z,id:R,createdAt:new Date().toISOString(),filters:V,layout:q,layoutRefs:$},s)await s.saveVariant(F,t,r);else if(c){if(!(await fetch(`${c}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(F)})).ok)throw new Error(b("variant.toast.saveFailed"))}else {let W=m.some(H=>H.id===R)?m.map(H=>H.id===R?F:H):[...m,F];v(W),C(W);}u&&u(b("variant.toast.saveSuccess")),(s||c)&&await A(),S(R),i(F);}catch(z){console.error("Error saving variant",z);let V=m.some(q=>q.id===R)?m.map(q=>q.id===R?F:q):[...m,F];v(V),C(V),S(R),i(F),p&&p(b("variant.toast.saveFailed"));}},onDelete:async D=>{try{if(s)await s.deleteVariant(D);else if(c){if(!(await fetch(`${c}/api/variants/${D}`,{method:"DELETE"})).ok)throw new Error(b("variant.toast.deleteFailed"))}else {let R=m.filter(F=>F.id!==D);v(R),C(R);}h===D&&S(""),(s||c)&&A(),u&&u(b("variant.toast.deleteSuccess"));}catch(R){console.error("Error deleting variant",R);let F=m.filter(z=>z.id!==D);v(F),C(F),h===D&&S(""),p&&p(b("variant.toast.deleteFailed"));}},onSetDefault:async D=>{try{let R=m.find(z=>z.id===D);if(!R)return;let F={appId:t,tableKey:r,...R,isDefault:!0};if(s)await s.setDefaultVariant(D,t,r);else if(c){if(!(await fetch(`${c}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(F)})).ok)throw new Error(b("variant.toast.defaultFailed"))}else {let z=m.map(K=>({...K,isDefault:K.id===D}));v(z),C(z);}(s||c)&&await A(),u&&u(b("variant.toast.defaultSuccess"));}catch(R){console.error("Error setting default variant",R);let F=m.map(z=>({...z,isDefault:z.id===D}));v(F),C(F),p&&p(b("variant.toast.defaultFailed"));}}})};w();Qr__default.default.extend(Nf__default.default);Qr__default.default.extend(Ef__default.default);Qr__default.default.extend(hg__default.default);var _n="YYYY-MM-DD",Ff=[null,null],Ao="0.85rem",Of={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},Bf=({isInRange:t,isStart:r,isEnd:o,isHovered:n,disableMargin:a,sx:i,...s})=>{let c=ar();return e(Lc,{...s,sx:[...Array.isArray(i)?i:i?[i]:[],t?{borderRadius:0,backgroundColor:c.palette.primary.light,color:c.palette.primary.contrastText}:{},n&&!t&&!r&&!o?{borderRadius:0,backgroundColor:c.palette.action.hover,border:`1px dashed ${c.palette.primary.main}`}:{},r?{borderRadius:"50% 0 0 50%",backgroundColor:c.palette.primary.main,color:c.palette.primary.contrastText}:{},o?{borderRadius:"0 50% 50% 0",backgroundColor:c.palette.primary.main,color:c.palette.primary.contrastText}:{},r&&o?{borderRadius:"50%"}:{}]})},qd=({label:t,value:r=Ff,onChange:o})=>{let{t:n,locale:a}=de(),i=Of[a]||"en",s=t||n("dateRange.label"),[c,p]=Qt.useState(null),[u,d]=Qt.useState(r),[f,b]=Qt.useState("start"),[m,v]=Qt.useState(null),[y,g]=Qt.useState((r[0]||Qr__default.default()).locale(i)),[x,h]=Qt.useState(""),[S,T]=Qt.useState(""),[C,L]=Qt.useState(false),[A,I]=Qt.useState(false),N=Qt__namespace.default.useRef(r);Qt.useEffect(()=>{let[X,W]=r,[H,Q]=N.current,J=fe=>fe&&typeof fe.isSame=="function",ge=!(X===null&&H===null||J(X)&&J(H)&&X.isSame(H,"day")),se=!(W===null&&Q===null||J(W)&&J(Q)&&W.isSame(Q,"day"));(ge||se)&&(d(r),r[0]&&J(r[0])&&g(r[0].locale(i))),N.current=r;},[r,i]),Qt.useEffect(()=>{h(u[0]?u[0].locale(i).format(_n):""),T(u[1]?u[1].locale(i).format(_n):""),L(false),I(false);},[u,i]);let M=(X,W)=>{let H=W.trim(),Q=X==="start"?L:I;if(!H){let se=X==="start"?[null,u[1]]:[u[0],null];Q(false),d(se);return}let J=Qr__default.default(H,_n,true).locale(i);if(!J.isValid()){Q(true);return}Q(false);let ge=[...u];if(X==="start")ge[0]=J,ge[1]&&J.isAfter(ge[1],"day")&&(ge[1]=null),b(ge[1]?"start":"end");else {let se=ge[0];se&&J.isBefore(se,"day")?(ge=[J,null],b("end")):(ge[1]=J,b("start"));}d(ge),g(J);},k=X=>{p(X.currentTarget);},D=()=>{p(null),b("start"),v(null);},R=!!c,F=X=>{if(!X)return;let W=[...u];if(f==="start")W=[X,null],b("end");else {let H=W[0];H&&X.isBefore(H)?(W=[X,null],b("end")):(W=[H,X],b("start"));}d(W);},z=X=>{let W=Qr__default.default().locale(i),H=[null,null];switch(X){case "today":H=[W,W];break;case "week":H=[W.startOf("week"),W.endOf("week")];break;case "month":H=[W.startOf("month"),W.endOf("month")];break}d(H),b("start"),g(W);},K=()=>{o&&o(u),D();},V=()=>{d(r),b("start"),D();},q=Qt.useCallback(X=>{let{day:W,...H}=X,[Q,J]=u,ge=Q?W.isSame(Q,"day"):false,se=J?W.isSame(J,"day"):false,fe=Q&&J?W.isBetween(Q,J,"day","()"):false,xe=false;return f==="end"&&Q&&!J&&m&&W.isAfter(Q,"day")&&W.isBefore(m.add(1,"day"),"day")&&(xe=true),e(Bf,{...H,day:W,disableMargin:true,isStart:ge,isEnd:se,isInRange:fe||xe,onMouseEnter:()=>v(W)})},[u,f,m]),$=X=>X?X.locale(i).format("YYYY-MM-DD"):"";return l("div",{className:"orb-date-range-picker",children:[e(Be,{className:"orb-date-range-field",label:s,value:u[0]?`${$(u[0])} - ${$(u[1])}`:"",onClick:k,fullWidth:true,size:"small",InputLabelProps:{sx:{fontSize:Ao}},InputProps:{readOnly:true,sx:{fontSize:Ao,"& .orb-inp":{fontSize:Ao},paddingRight:"4px"},endAdornment:e(ae,{className:"orb-date-range-calendar-trigger",size:"small",onClick:k,tooltip:s,children:e(Mt,{name:"calendar",size:16})})}}),l(Oa,{open:R,anchorEl:c,onClose:D,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},className:"orb-date-range-popover",children:[e("div",{className:"orb-date-range-inputs",children:l(ie,{className:"orb-date-range-input-row",direction:"row",alignItems:"center",spacing:1.5,justifyContent:"space-between",children:[e(Be,{className:"orb-date-range-manual-field",label:n("dateRange.startDate"),placeholder:_n,value:x,error:C,size:"small",onFocus:()=>b("start"),onChange:X=>{h(X.target.value),C&&L(false);},onBlur:()=>M("start",x),onKeyDown:X=>{X.key==="Enter"&&(X.preventDefault(),M("start",x));},sx:{"& .orb-inp":{fontSize:Ao,py:.75},"& label":{fontSize:Ao}}}),e(zc,{color:"action",fontSize:"small"}),e(Be,{className:"orb-date-range-manual-field",label:n("dateRange.endDate"),placeholder:_n,value:S,error:A,size:"small",onFocus:()=>{u[0]&&b("end");},onChange:X=>{T(X.target.value),A&&I(false);},onBlur:()=>M("end",S),onKeyDown:X=>{X.key==="Enter"&&(X.preventDefault(),M("end",S));},sx:{"& .orb-inp":{fontSize:Ao,py:.75},"& label":{fontSize:Ao}}})]})}),e("div",{className:"orb-date-range-shortcuts",children:l(ie,{direction:"row",spacing:1,justifyContent:"center",children:[e(Tt,{label:n("dateRange.today"),onClick:()=>z("today"),clickable:true,size:"small",variant:"outlined"}),e(Tt,{label:n("dateRange.thisWeek"),onClick:()=>z("week"),clickable:true,size:"small",variant:"outlined"}),e(Tt,{label:n("dateRange.thisMonth"),onClick:()=>z("month"),clickable:true,size:"small",variant:"outlined"})]})}),e("div",{className:"orb-date-range-calendar",children:e(Oc,{dateAdapter:Na,adapterLocale:i,children:e(Fc,{value:null,referenceDate:y,onMonthChange:g,onYearChange:g,onChange:F,slots:{day:q},views:["year","month","day"],openTo:"day",showDaysOutsideCurrentMonth:true})})}),e(Nt,{}),l(ie,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{p:2},children:[e(ve,{size:"small",onClick:V,color:"inherit",children:n("common.cancel")}),e(ve,{size:"small",variant:"contained",onClick:K,children:n("common.done")})]})]})]})};w();var ui={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},Hf={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"},Wf=["contains","notContains",">",">=","<","<=","equals"],Yd=["=","!=",">","<",">=","<=","between"],er="0.85rem",$f=({field:t,value:r,onChange:o})=>{let{t:n}=de(),[a,i]=Qt.useState(null),[s,c]=Qt.useState(null),[p,u]=Qt.useState(null),[d,f]=Qt.useState(""),[b,m]=Qt.useState(""),[v,y]=Qt.useState(""),[g,x]=Qt.useState("");Qt.useEffect(()=>{let k=setTimeout(()=>{x(v);},1e3);return ()=>clearTimeout(k)},[v]);let h=r?.operator||(t.type==="number"?"=":"equals"),S=r?.value,T=k=>{let D=Hf[k];return D?n(D):k},C=k=>{i(a?null:k.currentTarget);},L=k=>{o({...r,operator:k,value:S}),i(null);},A={size:"small",fullWidth:true,variant:"outlined",InputLabelProps:{sx:{fontSize:er}},InputProps:{sx:{fontSize:er}},SelectProps:{MenuProps:{PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:er,paddingTop:"4px",paddingBottom:"4px",minHeight:"auto"}}}}}},I=t.type||"text";if(I==="date"){let D=(R=>{if(!R)return [null,null];if(Array.isArray(R)&&R.length===2){let F=R[0]?Qr__default.default.isDayjs(R[0])?R[0]:Qr__default.default(R[0]):null,z=R[1]?Qr__default.default.isDayjs(R[1])?R[1]:Qr__default.default(R[1]):null;return [F,z]}return Qr__default.default.isDayjs(R)||typeof R=="string"?[Qr__default.default.isDayjs(R)?R:Qr__default.default(R),null]:[null,null]})(S);return e(qd,{label:t.label,value:D,onChange:R=>o({value:R,operator:"between"})})}if(I==="number"&&h==="between"){let k=()=>{o({value:[d,b],operator:"between"}),c(null);},D=Array.isArray(S)?`${S[0]||""} - ${S[1]||""}`:"";return l(jsxRuntime.Fragment,{children:[e(Be,{...A,label:t.label,value:D,placeholder:n("smartFilter.minMaxPlaceholder"),InputProps:{...A.InputProps,startAdornment:e(to,{position:"start",children:e(it,{title:T("between"),children:e(ae,{size:"small",onClick:C,sx:{width:24,height:24,fontSize:er},children:ui.between})})}),readOnly:true},onClick:R=>c(s?null:R.currentTarget)}),e(Yt,{anchorEl:a,open:!!a,onClose:()=>i(null),PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:er,minHeight:"auto",py:.5}}},children:Yd.map(R=>l("option",{selected:R===h,onClick:()=>L(R),children:[e("div",{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:ui[R]}),e(Gt,{primary:T(R),primaryTypographyProps:{fontSize:er}})]},R))}),e(Oa,{open:!!s,anchorEl:s,onClose:()=>c(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},children:l("div",{sx:{p:2,display:"flex",gap:1,alignItems:"center"},children:[e(Be,{size:"small",label:n("smartFilter.min"),type:"number",value:d,onChange:R=>f(R.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:er}},InputProps:{sx:{fontSize:er}}}),e(Vc,{color:"action"}),e(Be,{size:"small",label:n("smartFilter.max"),type:"number",value:b,onChange:R=>m(R.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:er}},InputProps:{sx:{fontSize:er}}}),e(ve,{variant:"contained",size:"small",onClick:k,children:n("common.ok")})]})})]})}if(t.isValueHelp||I==="value-help"){let k=t.valueHelp?.mode||"single";return e(wd,{...A,...t.valueHelp,label:t.label,placeholder:t.placeholder||t.valueHelp?.placeholder,value:S??(k==="multiple"?[]:null),mode:k,onChange:D=>o({value:D,operator:k==="multiple"?"anyOf":"equals"})})}if(I==="select")return l(Kt,{size:"small",fullWidth:true,label:t.label,value:S||"",onChange:k=>o({...r,value:k.target.value,operator:"equals"}),children:[e("option",{value:"",children:n("common.none")}),t.options?.map(k=>e("option",{value:k.value,children:k.label},k.value))]});if(I==="multi-select"){let k=Array.isArray(S)?S:[],D=t.options?.filter(q=>q.label.toLowerCase().includes(g.toLowerCase()))||[],R=q=>t.options?.find($=>$.value===q)?.label||q,F=k.map(R),z=F.length===0?n("common.none"):F.length>2?`${F.slice(0,2).join(", ")} +${F.length-2}`:F.join(", "),K=()=>{u(null),y(""),x("");},V=q=>{let $=k.includes(q)?k.filter(X=>X!==q):[...k,q];o({...r,value:$,operator:"anyOf"});};return l("div",{className:"orb-fld",children:[e("label",{children:t.label}),l(ve,{variant:"outlined",size:"small",onClick:q=>u(p?null:q.currentTarget),sx:{width:"100%",minHeight:36,justifyContent:"space-between",fontSize:er,fontWeight:400},children:[e("span",{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:z}),e(Br,{fontSize:"small"})]}),e(Yt,{anchorEl:p,open:!!p,onClose:K,PaperProps:{sx:{width:280,maxHeight:340,overflowY:"auto",p:.5}},children:l("div",{onClick:q=>q.stopPropagation(),sx:{display:"grid",gap:.35},children:[e(Be,{size:"small",autoFocus:true,placeholder:n("smartFilter.searchPlaceholder"),fullWidth:true,InputProps:{startAdornment:e(to,{position:"start",children:e(Do,{fontSize:"small"})}),sx:{fontSize:er}},value:v,onChange:q=>y(q.target.value),onKeyDown:q=>q.stopPropagation()}),D.length>0?D.map(q=>{let $=k.includes(q.value);return l("div",{role:"option","aria-selected":$,tabIndex:0,className:`orb-menu-item ${$?"orb-selected":""}`,onClick:()=>V(q.value),onKeyDown:X=>{(X.key==="Enter"||X.key===" ")&&(X.preventDefault(),V(q.value));},children:[e(Dt,{checked:$,size:"small",inputProps:{tabIndex:-1},sx:{pointerEvents:"none"}}),e(Gt,{primary:q.label})]},String(q.value))}):e("div",{className:"orb-menu-item","aria-disabled":"true",children:n("smartFilter.noOptionsFound")})]})})]})}let N=I==="number"?Yd:Wf;return l(jsxRuntime.Fragment,{children:[e(Be,{...A,className:"orb-filter-operator-field",label:t.label,sx:{minWidth:"120px"},value:S||"",type:I==="number"?"number":"text",onChange:k=>o({...r,value:k.target.value,operator:h}),InputProps:{...A.InputProps,startAdornment:e(to,{position:"start",children:e(it,{title:T(h),children:e(ae,{className:"orb-filter-operator-trigger",size:"small",onClick:C,onMouseDown:k=>k.preventDefault(),sx:{width:24,height:24,fontSize:er,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:ui[h]})})}),endAdornment:t.hasSearchIcon?e(to,{position:"end",children:e(Do,{color:"action"})}):void 0}}),e(Yt,{anchorEl:a,open:!!a,onClose:()=>i(null),PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:er,minHeight:"auto",py:.5}}},children:N.map(k=>l("option",{selected:k===h,onClick:()=>L(k),children:[e("span",{className:"orb-filter-operator-symbol",children:ui[k]}),e(Gt,{primary:T(k),primaryTypographyProps:{fontSize:er}})]},k))})]})},zr=({fields:t,filters:r,onFilterChange:o,variants:n=[],currentVariantId:a,onVariantLoad:i,onVariantSave:s,onVariantDelete:c,onVariantSetDefault:p,onSearch:u,loading:d=false,appId:f,tableKey:b,currentLayout:m,currentLayoutId:v,layoutRefs:y,variantService:g,serviceUrl:x})=>{let{t:h}=de(),[S,T]=Qt.useState(true),[C,L]=Qt.useState(null),[A,I]=Qt.useState(t.filter(D=>!D.hidden).map(D=>D.id)),N=(D,R)=>{o({...r,[D]:R});},M=D=>{A.includes(D)?I(A.filter(R=>R!==D)):I([...A,D]);};return l(Ne,{className:`orb-smart-filter ${S?"orb-smart-filter-expanded":"orb-smart-filter-collapsed"}`,sx:{mb:0,display:"flex",flexDirection:"column",overflow:"visible",position:"relative"},children:[S?l(jsxRuntime.Fragment,{children:[l("div",{className:"orb-smart-filter-header",children:[f?e(Ud,{appId:f,tableKey:b,currentFilters:{values:r,visibleFields:A},currentLayout:m,currentLayoutId:v,layoutRefs:y,onLoad:D=>{if(!D.filters)return;let R=null;if(Array.isArray(D.filters)){let F=b||"default",z=D.filters.find(K=>K.scope===F);R=z?z.filters:null;}else R=D.filters;R&&(R.values||R.visibleFields?(R.visibleFields&&Array.isArray(R.visibleFields)&&I(R.visibleFields),R.values&&o(R.values)):o(R)),i&&i(D);},variantService:g,serviceUrl:x,currentVariantId:a}):e(di,{variants:n,currentVariantId:a,onLoad:i,onSave:D=>{s&&s({...D,filters:{values:r,visibleFields:A}});},onDelete:c,onSetDefault:p}),l("div",{className:"orb-smart-filter-actions",children:[e(it,{title:h("smartFilter.addFilters"),children:e(ve,{className:"orb-smart-filter-adapt",onClick:D=>L(C?null:D.currentTarget),size:"small",color:"primary",startIcon:e(pd,{fontSize:"small"}),sx:{textTransform:"none",fontSize:er,whiteSpace:"nowrap",minWidth:"fit-content"},children:h("smartFilter.adaptFilters")})}),e(ae,{className:"orb-smart-filter-go",tooltip:h("smartFilter.go"),"aria-label":h("smartFilter.go"),onClick:u,disabled:d,children:d?e(Gr,{size:16}):e(Mt,{name:"play",size:16})}),l(Yt,{anchorEl:C,open:!!C,onClose:()=>L(null),slotProps:{paper:{style:{maxHeight:400,width:"25ch"},sx:{"& .orb-menu-item, & option":{fontSize:er,minHeight:32}}}},children:[e("option",{disabled:true,children:e(Gt,{primary:h("smartFilter.visibleFilters"),primaryTypographyProps:{fontSize:er}})}),e(Nt,{}),t.map(D=>l("option",{onClick:()=>M(D.id),children:[e(Dt,{checked:A.includes(D.id),size:"small"}),e(Gt,{primary:D.label,primaryTypographyProps:{fontSize:er}})]},D.id))]})]})]}),e("div",{className:"orb-smart-filter-grid",children:e(Ss,{container:true,spacing:2,columns:{xs:2,sm:3,md:4,lg:6},children:t.filter(D=>A.includes(D.id)).map(D=>e(Ss,{size:1,children:e($f,{field:D,value:r[D.id]||{value:"",operator:D.type==="number"?"=":"equals"},onChange:R=>N(D.id,R)})},D.id))})})]}):null,e("div",{className:"orb-smart-filter-toggle",children:e(ae,{className:"orb-smart-filter-toggle-button",size:"small",onClick:()=>T(!S),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:S?e(Ha,{className:"orb-smart-filter-toggle-icon",sx:{fontSize:20},color:"action"}):e(Br,{className:"orb-smart-filter-toggle-icon",sx:{fontSize:20},color:"action"})})})]})};w();var Zd=({layouts:t,currentLayoutId:r,onLoad:o,onSave:n,onDelete:a,onSetDefault:i})=>{let{t:s}=de(),[c,p]=Qt.useState(null),[u,d]=Qt.useState(false),[f,b]=Qt.useState(""),[m,v]=Qt.useState(""),[y,g]=Qt.useState({isDefault:false,isPublic:false}),x=t.find(A=>A.id===r),h=A=>{p(A.currentTarget);},S=()=>{p(null);},T=A=>{o(A),S();},C=()=>{b(""),v(""),g({isDefault:false,isPublic:false}),d(true),S();},L=()=>{f.trim()&&(n({name:f,description:m,...y}),d(false));};return l("div",{className:"orb-layout-actions",sx:{display:"flex",alignItems:"center",gap:.25},children:[e(it,{title:s("layout.layoutOptions"),children:e(ae,{onClick:h,color:x?"primary":"default",size:"small",children:e(hd,{fontSize:"small"})})}),l(Yt,{anchorEl:c,open:!!c,onClose:S,align:"end",PaperProps:{sx:{width:320,maxHeight:400}},children:[e("option",{disabled:true,children:e(E,{variant:"caption",children:s("layout.selectLayout")})}),l("option",{onClick:C,children:[e(Or,{children:e(fo,{fontSize:"small"})}),e(Gt,{children:s("layout.saveCurrentLayout")})]}),e(Nt,{}),t.length===0&&e("option",{disabled:true,children:e(E,{variant:"body2",color:"text.secondary",children:s("layout.noSavedLayouts")})}),t.map((A,I)=>e("option",{onClick:()=>T(A),selected:A.id===r,children:l("div",{sx:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"},children:[l("div",{sx:{display:"flex",flexDirection:"column",overflow:"hidden",mr:1},children:[e("div",{sx:{display:"flex",alignItems:"center",gap:1},children:e(E,{variant:"body2",fontWeight:A.id===r?"bold":"normal",noWrap:true,children:A.name})}),A.description&&e(E,{variant:"caption",color:"text.secondary",noWrap:true,children:A.description})]}),l("div",{sx:{display:"flex",alignItems:"center"},onClick:N=>N.stopPropagation(),children:[e(it,{title:A.isDefault?s("layout.removeDefault"):s("layout.setAsDefault"),children:e(ae,{size:"small",onClick:N=>{N.stopPropagation(),i(A.id);},children:A.isDefault?e(gd,{fontSize:"small",color:"warning"}):e(md,{fontSize:"small"})})}),e(it,{title:s("common.delete"),children:e(ae,{size:"small",color:"error",onClick:N=>{N.stopPropagation(),a(A.id);},children:e(za,{fontSize:"small"})})})]})]})},A.id||I))]}),e(Vt,{open:u,onClose:()=>d(false),maxWidth:"xs",fullWidth:true,className:"orb-layout-save-dialog",title:s("layout.saveLayout"),actions:l(jsxRuntime.Fragment,{children:[e(ve,{variant:"ghost",onClick:()=>d(false),children:s("common.cancel")}),e(ve,{onClick:L,variant:"primary",disabled:!f.trim(),children:s("common.save")})]}),children:l("div",{className:"orb-layout-save-form",children:[e(Be,{label:s("layout.layoutName"),value:f,onChange:A=>b(A.target.value),fullWidth:true,autoFocus:true,size:"small",helperText:s("layout.layoutNameHelper")}),t.some(A=>A.name===f)&&e(E,{className:"orb-layout-save-warning",variant:"caption",color:"warning.main",children:s("layout.warningOverwrite")}),e(Be,{label:s("layout.layoutDescription"),value:m,onChange:A=>v(A.target.value),fullWidth:true,size:"small"}),e(Dt,{className:"orb-layout-save-option",checked:y.isDefault,onChange:A=>g({...y,isDefault:A.target.checked}),label:s("layout.useAsDefault")}),e(Dt,{className:"orb-layout-save-option",checked:y.isPublic,onChange:A=>g({...y,isPublic:A.target.checked}),label:s("layout.publicAllUsers")})]})})]})};w();var nn=({appId:t,tableKey:r="default",currentLayoutData:o,onLayoutLoad:n,targetLayoutId:a,activeLayoutId:i,serviceUrl:s,onError:c,onSuccess:p})=>{let{t:u}=de(),[d,f]=Qt.useState([]),[b,m]=Qt.useState(""),v=`orbcafe.layouts.${t}.${r}`,y=I=>({id:I.layoutId,name:I.name,description:I.description??"",isDefault:!!I.isDefault,isPublic:!!I.isPublic,createdAt:I.createdAt??new Date().toISOString(),layoutData:I.layout??{}}),g=I=>({appId:t,tableKey:r,layoutId:I.id,name:I.name,description:I.description??"",isDefault:!!I.isDefault,isPublic:!!I.isPublic,createdAt:I.createdAt,layout:I.layoutData}),x=Qt.useCallback(()=>{try{let I=localStorage.getItem(v);if(!I)return [];let N=JSON.parse(I);return Array.isArray(N)?N:[]}catch{return []}},[v]),h=Qt.useCallback(I=>{try{localStorage.setItem(v,JSON.stringify(I));}catch{}},[v]);Qt.useEffect(()=>{i!==void 0&&m(i);},[i]),Qt.useEffect(()=>{if(a&&d.length>0){let I=d.find(N=>N.id===a);I&&(m(I.id),n(I));}},[a,d,n]);let S=Qt.useCallback(async()=>{if(t){if(!s){let I=x();f(I);let N=I.find(M=>M.isDefault);N&&!b&&!a&&(m(N.id),n(N));return}try{let I=await fetch(`${s}/api/layouts?appId=${encodeURIComponent(t)}&tableKey=${encodeURIComponent(r)}`);if(!I.ok)throw new Error("LAYOUT_FETCH_FAILED");let M=(await I.json()).map(y);f(M);let k=M.find(D=>D.isDefault);k&&!b&&!a&&(m(k.id),n(k));}catch(I){console.error("Error fetching layouts",I);let N=x();f(N);let M=N.find(k=>k.isDefault);M&&!b&&!a&&(m(M.id),n(M)),c&&c(u("layout.toast.loadFallback"));}}},[t,r,s,c,b,n,a,x,u]);return Qt.useEffect(()=>{S();},[t,r]),e(Zd,{layouts:d,currentLayoutId:b,onLoad:I=>{m(I.id),n(I);},onSave:async I=>{let N=d.find(D=>D.name===I.name),M=N?N.id:Date.now().toString(),k={id:M,...I,createdAt:new Date().toISOString(),layoutData:o,isDefault:I.isDefault??false,isPublic:I.isPublic??false};if(!s){let R=d.some(F=>F.id===M)?d.map(F=>F.id===M?k:F):[...d,k];f(R),h(R),m(M),n(k),p&&p(u("layout.toast.saveLocalSuccess"));return}try{if(!(await fetch(`${s}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g(k))})).ok)throw new Error("LAYOUT_SAVE_FAILED");p&&p(u("layout.toast.saveSuccess")),await S(),m(M),n(k);}catch(D){console.error("Error saving layout",D);let F=d.some(z=>z.id===M)?d.map(z=>z.id===M?k:z):[...d,k];f(F),h(F),m(M),n(k),p&&p(u("layout.toast.saveLocalSuccess")),c&&c(u("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async I=>{if(!s){let N=d.filter(M=>M.id!==I);f(N),h(N),b===I&&m(""),p&&p(u("layout.toast.deleteLocalSuccess"));return}try{if(!(await fetch(`${s}/api/layouts/${encodeURIComponent(I)}`,{method:"DELETE"})).ok)throw new Error("LAYOUT_DELETE_FAILED");b===I&&m(""),p&&p(u("layout.toast.deleteSuccess")),await S();}catch(N){console.error("Error deleting layout",N);let M=d.filter(k=>k.id!==I);f(M),h(M),b===I&&m(""),p&&p(u("layout.toast.deleteLocalSuccess")),c&&c(u("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async I=>{if(!s){let N=d.map(M=>({...M,isDefault:M.id===I}));f(N),h(N),p&&p(u("layout.toast.defaultLocalSuccess"));return}try{let N=d.find(k=>k.id===I);if(!N)return;if(!(await fetch(`${s}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g({...N,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");p&&p(u("layout.toast.defaultSuccess")),await S();}catch(N){console.error("Error setting default",N);let M=d.map(k=>({...k,isDefault:k.id===I}));f(M),h(M),p&&p(u("layout.toast.defaultLocalSuccess")),c&&c(u("layout.toast.backendUnavailableDefaultLocal"));}}})};var mi=(t,r)=>{if(!t||!t.filters)return null;if(Array.isArray(t.filters)){let o=t.filters.find(a=>a.scope===r);if(o)return o.filters;let n=t.filters.find(a=>a.scope==="default");return n?n.filters:null}return typeof t.filters=="object"?t.filters:null},gi=(t,r)=>{if(!t)return {layout:null,layoutId:null};let o=null,n=null;if(Array.isArray(t.layoutRefs)){let a=t.layoutRefs.find(i=>i.tableKey===r);a&&(o=a.layoutId);}return !o&&t.layoutId&&(o=t.layoutId),t.layout&&typeof t.layout=="object"&&!Array.isArray(t.layout)&&(n=t.layout),{layoutId:o,layout:n}};function jd(t,r,o){return r[o]<t[o]?-1:r[o]>t[o]?1:0}function Gf(t,r){return t==="desc"?(o,n)=>jd(o,n,r):(o,n)=>-jd(o,n,r)}function _f(t,r){let o=t.map((n,a)=>[n,a]);return o.sort((n,a)=>{let i=r(n[0],a[0]);return i!==0?i:n[1]-a[1]}),o.map(n=>n[0])}var an=t=>{let r=!!t.disableGrouping,o=!!t.disableSorting,n=Qt.useCallback(B=>{let ee=String(B?.label??B?.id??"").length*9+64,Ie=typeof B?.minWidth=="number"?B.minWidth:0;return Math.max(100,Ie,ee)},[]),a=Qt.useCallback(()=>(t.columns||[]).filter(B=>!!B?.numeric).map(B=>B.id),[t.columns]),[i,s]=Qt.useState(""),[c,p]=Qt.useState(t.order||"asc"),[u,d]=Qt.useState(t.orderBy||""),[f,b]=Qt.useState([]),[m,v]=Qt.useState(t.page||0),[y,g]=Qt.useState(t.rowsPerPage||20),[x,h]=Qt.useState(t.selected||[]),[S,T]=Qt.useState(t.columns?t.columns.map(B=>B.id):[]),[C,L]=Qt.useState(t.columns?t.columns.map(B=>B.id):[]),[A,I]=Qt.useState(t.showSummary||false),[N,M]=Qt.useState(()=>a()),[k,D]=Qt.useState([]),[R,F]=Qt.useState(new Set),[z,K]=Qt.useState(()=>{let B={};return (t.columns||[]).forEach(U=>{B[U.id]=n(U);}),B}),[V,q]=Qt.useState(null),[$,X]=Qt.useState(null),[W,H]=Qt.useState(null),[Q,J]=Qt.useState(null),[ge,se]=Qt.useState(false),[fe,xe]=Qt.useState(""),[Ke,ze]=Qt.useState(""),Re=r?[]:k,Ve=Qt.useCallback(B=>{if(r){D([]),F(new Set),X(null);return}D(B);},[r]);Qt.useEffect(()=>{r&&(D([]),F(new Set),X(null));},[r]),Qt.useEffect(()=>{o&&(p("asc"),d(""),b([]));},[o]),Qt.useEffect(()=>{t.layout&&bt(t.layout);},[t.layout]),Qt.useEffect(()=>{if(o){p("asc"),d("");return}t.order!==void 0&&p(t.order),t.orderBy!==void 0&&d(t.orderBy);},[t.order,t.orderBy,o]),Qt.useEffect(()=>{t.selected!==void 0&&h(t.selected);},[t.selected]),Qt.useEffect(()=>{t.page!==void 0&&v(t.page);},[t.page]),Qt.useEffect(()=>{t.rowsPerPage!==void 0&&g(t.rowsPerPage);},[t.rowsPerPage]),Qt.useEffect(()=>{let B=a();M(U=>U.filter(Ie=>B.includes(Ie)));},[a]),Qt.useEffect(()=>{K(B=>{let U={...B};return (t.columns||[]).forEach(ee=>{U[ee.id]===void 0&&(U[ee.id]=n(ee));}),U});},[t.columns,n]),Qt.useEffect(()=>{L(B=>{let U=(t.columns||[]).map(je=>je.id),ee=new Set(U),Ie=B.filter(je=>ee.has(je)),be=new Set(Ie),De=U.filter(je=>!be.has(je)),_e=[...Ie,...De];return _e.length===B.length&&_e.every((je,Ue)=>je===B[Ue])?B:_e});},[t.columns]);let Me=Qt.useMemo(()=>{let B=t.columns||[];if(C.length===0)return B;let U=new Map(B.map(be=>[be.id,be])),ee=[],Ie=new Set;return C.forEach(be=>{let De=U.get(be);De&&(ee.push(De),Ie.add(be));}),B.forEach(be=>{Ie.has(be.id)||ee.push(be);}),ee},[t.columns,C]),Ce=Qt.useMemo(()=>{let B=t.rows||[];return i&&(B=B.filter(U=>Object.keys(U).some(ee=>String(U[ee]).toLowerCase().includes(i.toLowerCase())))),B},[t.rows,i]),He=Qt.useMemo(()=>{if(o||t.onSortChange)return Ce;if(f.length>0){let B=[...Ce];return B.sort((U,ee)=>{for(let Ie of f){let be=U?.[Ie.field],De=ee?.[Ie.field];if(!(be==null&&De==null)){if(be==null)return Ie.direction==="asc"?-1:1;if(De==null)return Ie.direction==="asc"?1:-1;if(be<De)return Ie.direction==="asc"?-1:1;if(be>De)return Ie.direction==="asc"?1:-1}}return 0}),B}return u?_f(Ce,Gf(c,u)):Ce},[Ce,c,u,f,t.onSortChange,o]),at=Qt.useCallback(B=>{if(Re.length===0)return B.map(De=>({type:"row",data:De,id:De[t.rowKey||"id"]}));let U=[...B].sort((De,_e)=>{for(let je of Re){if(De[je]<_e[je])return -1;if(De[je]>_e[je])return 1}return 0}),ee=(De,_e=0)=>{if(_e>=Re.length)return De;let je=Re[_e],Ue={},xt=[];return De.forEach(At=>{let wt=At[je],Ct=`${je}:${wt}`;Ue[Ct]||(Ue[Ct]={key:Ct,field:je,value:wt,children:[],count:0,level:_e},xt.push(Ue[Ct])),Ue[Ct].children.push(At),Ue[Ct].count++;}),xt.forEach(At=>{At.children&&(At.children=ee(At.children,_e+1));}),xt},Ie=ee(U),be=(De,_e="")=>{let je=[];return De.forEach(Ue=>{if(Ue.children){let xt=_e?`${_e}>${Ue.key}`:Ue.key,At=R.has(xt);je.push({type:"group",id:xt,field:Ue.field,value:Ue.value,level:Ue.level,count:Ue.count,isExpanded:At,childIds:(function wt(Ct){let O=[];return Ct.children.forEach(Y=>{Y.children?O=O.concat(wt(Y)):O.push(Y[t.rowKey||"id"]);}),O})(Ue)}),At&&(je=je.concat(be(Ue.children,xt)));}else je.push({type:"row",data:Ue,id:Ue[t.rowKey||"id"],level:Re.length});}),je};return be(Ie)},[Re,R,t.rowKey]),ft=Qt.useCallback(B=>{if(Re.length===0)return [];let U=[...B].sort((be,De)=>{for(let _e of Re){if(be[_e]<De[_e])return -1;if(be[_e]>De[_e])return 1}return 0}),ee=[],Ie=(be,De,_e)=>{if(De>=Re.length)return;let je=Re[De],Ue=new Map;be.forEach(xt=>{let At=xt[je],wt=Ue.get(At);wt?wt.push(xt):Ue.set(At,[xt]);}),Ue.forEach((xt,At)=>{let wt=`${je}:${At}`,Ct=_e?`${_e}>${wt}`:wt;ee.push(Ct),Ie(xt,De+1,Ct);});};return Ie(U,0,""),ee},[Re]),et=Qt.useMemo(()=>at(He),[He,at]),re=Qt.useMemo(()=>ft(He),[He,ft]),$e=Qt.useMemo(()=>{let B=(t.rows||[]).length;return typeof t.count=="number"&&t.count>B},[t.count,t.rows]),Ee=Qt.useMemo(()=>$e?et:y>0?et.slice(m*y,m*y+y):et,[et,m,y,$e]),Le=Qt.useMemo(()=>$e&&typeof t.count=="number"?t.count:et.length,[et.length,$e,t.count]),lt=B=>{F(U=>{let ee=new Set(U);return ee.has(B)?ee.delete(B):ee.add(B),ee});},Qe=B=>{let U=re.filter(ee=>ee===B||ee.startsWith(`${B}>`));F(ee=>{let Ie=new Set(ee);return U.forEach(be=>Ie.add(be)),Ie});},vt=B=>{F(U=>{let ee=new Set(U);return Array.from(ee).forEach(Ie=>{(Ie===B||Ie.startsWith(`${B}>`))&&ee.delete(Ie);}),ee});},St=B=>{if(!B){F(new Set);return}F(new Set(re));},Et=B=>{let U=re.filter(ee=>ee.startsWith(`${B}>`));return U.length===0?R.has(B):R.has(B)&&U.every(ee=>R.has(ee))},Lt=B=>{if(o)return;f.length>0&&b([]);let U=u===B&&c==="asc",ee=u===B&&c==="desc";if(t.onSortChange){U?t.onSortChange(B,"desc"):ee?t.onSortChange("","asc"):t.onSortChange(B,"asc");return}U?(p("desc"),d(B)):ee?(p("asc"),d("")):(p("asc"),d(B));},te=B=>{if(o){p("asc"),d(""),b([]);return}let U=B.filter(ee=>ee&&ee.field);b(U),U.length>0&&d("");},rt=()=>{b([]);},Fe=(B,U)=>{K(ee=>({...ee,[B]:U}));},le=B=>{if(B.target.checked){let U=Ce.map(ee=>ee[t.rowKey||"id"]);h(U),t.onSelectionChange&&t.onSelectionChange(U);return}h([]),t.onSelectionChange&&t.onSelectionChange([]);},me=(B,U)=>{let ee=U[t.rowKey||"id"],Ie=x.indexOf(ee),be=[];Ie===-1?be=be.concat(x,ee):Ie===0?be=be.concat(x.slice(1)):Ie===x.length-1?be=be.concat(x.slice(0,-1)):Ie>0&&(be=be.concat(x.slice(0,Ie),x.slice(Ie+1))),h(be),t.onSelectionChange&&t.onSelectionChange(be);},j=B=>{v(B),t.onPageChange&&t.onPageChange(B);},ke=B=>{g(B),v(0),t.onPageChange&&t.onPageChange(0),t.onRowsPerPageChange&&t.onRowsPerPageChange(B);},Te=B=>{let U=S.indexOf(B),ee=[...S];U===-1?ee.push(B):ee.splice(U,1),T(ee);},Ye=B=>{if(r)return;let U=Re.indexOf(B),ee=[...Re];U===-1?ee.push(B):ee.splice(U,1),Ve(ee);},pt=B=>{a().includes(B)&&M(ee=>ee.includes(B)?ee.filter(Ie=>Ie!==B):[...ee,B]);},ct=(B,U)=>{!B||!U||B===U||L(ee=>{let Ie=ee.indexOf(B),be=ee.indexOf(U);if(Ie===-1||be===-1)return ee;let De=[...ee];return De.splice(Ie,1),De.splice(be,0,B),De});},Ft=B=>{let U=B?.active?.id,ee=B?.over?.id;typeof U=="string"&&typeof ee=="string"&&ct(U,ee);},_t=B=>{t.onLayoutSave&&t.onLayoutSave({visibleColumns:S,columnOrder:C,order:o?"asc":c,orderBy:o?"":u,sortBy:o?[]:f,grouping:Re,columnWidths:z,showSummary:A,summaryColumns:N});},yt=B=>{let{layout:U,layoutId:ee}=gi(B,t.tableKey||"default");ee?(ze(ee),xe(ee)):(ze(""),xe("")),U&&(U.visibleColumns&&T(U.visibleColumns),Array.isArray(U.columnOrder)&&L(U.columnOrder),o?(p("asc"),d(""),b([])):(U.order&&p(U.order),U.orderBy&&d(U.orderBy),Array.isArray(U.sortBy)&&b(U.sortBy)),U.grouping&&Ve(U.grouping),U.columnWidths&&K(U.columnWidths),U.showSummary!==void 0&&I(!!U.showSummary),Array.isArray(U.summaryColumns)&&M(U.summaryColumns));},bt=B=>{let U=B?.layoutData||B?.layout||B||{};U.visibleColumns&&T(U.visibleColumns),Array.isArray(U.columnOrder)&&L(U.columnOrder),o?(p("asc"),d(""),b([])):(U.order&&p(U.order),U.orderBy!==void 0&&d(U.orderBy),Array.isArray(U.sortBy)&&b(U.sortBy)),U.grouping&&Ve(U.grouping),U.columnWidths&&K(U.columnWidths),U.showSummary!==void 0&&I(!!U.showSummary),Array.isArray(U.summaryColumns)&&M(U.summaryColumns),F(new Set),v(0),B?.id&&xe(B.id),ze("");};Qt.useEffect(()=>{t.layout&&yt({layout:t.layout});},[t.layout]);let yr=B=>{B.preventDefault(),J(Q===null?{mouseX:B.clientX+2,mouseY:B.clientY-6}:null);},Pt=()=>{J(null);},Ot=Qt.useMemo(()=>{if(!A)return {};let B={};t.columns.forEach(ee=>{if(ee.numeric&&N.includes(ee.id)){let Ie=Ce.reduce((be,De)=>{let _e=parseFloat(De[ee.id]);return be+(isNaN(_e)?0:_e)},0);B[ee.id]=Ie.toFixed(2);}else B[ee.id]="";});let U=t.columns.find(ee=>S.includes(ee.id)&&!ee.numeric);return U&&!U.numeric&&(B[U.id]="Total"),B},[Ce,t.columns,A,N,S]),dt=()=>{if(!t.columns||!Ce)return;let B=t.columns.map(De=>De.label).join(","),U=Ce.map(De=>t.columns.map(_e=>{let je=De[_e.id];return `"${(je==null?"":String(je)).replace(/"/g,'""')}"`}).join(",")).join(`
184
- `),ee=`data:text/csv;charset=utf-8,${B}
185
- ${U}`,Ie=encodeURI(ee),be=document.createElement("a");be.setAttribute("href",Ie),be.setAttribute("download",`${t.title||"export"}.csv`),document.body.appendChild(be),be.click(),document.body.removeChild(be);},Bt=()=>{se(true);},Se=()=>{se(false);};return {isMobile:false,columns:Me,order:c,setOrder:p,orderBy:u,setOrderBy:d,sortBy:f,setSortBy:b,applyMultiSort:te,clearMultiSort:rt,columnOrder:C,setColumnOrder:L,filterText:i,setFilterText:s,visibleColumns:S,setVisibleColumns:T,showSummary:A,setShowSummary:I,summaryColumns:N,grouping:Re,setGrouping:Ve,expandedGroups:R,setExpandedGroups:F,groupAnchorEl:$,setGroupAnchorEl:X,summaryAnchorEl:W,setSummaryAnchorEl:H,columnWidths:z,setColumnWidths:K,anchorEl:V,setAnchorEl:q,contextMenu:Q,setContextMenu:J,sensors:void 0,sortedAndFilteredRows:He,visibleRows:Ee,summaryRow:Ot,page:m,setPage:j,rowsPerPage:y,setRowsPerPage:ke,totalDisplayCount:Le,selected:x,setSelected:h,isAllExpanded:re.length>0&&re.every(B=>R.has(B)),handleColumnResize:Fe,handleRequestSort:Lt,handleSelectAllClick:le,handleClick:me,toggleSummaryColumn:pt,handleDragEnd:Ft,handleColumnReorder:ct,handleExport:dt,handleContextMenu:yr,handleCloseContextMenu:Pt,toggleColumnVisibility:Te,toggleGroupExpand:lt,toggleGroupField:Ye,handleToggleAll:St,handleExpandGroupRecursively:Qe,handleCollapseGroupRecursively:vt,isGroupFullyExpanded:Et,handleLayoutLoad:bt,handleVariantLoad:yt,handleLayoutSave:_t,effectiveAppId:t.appId||"",currentLayoutData:{visibleColumns:S,order:o?"asc":c,orderBy:o?"":u,sortBy:o?[]:f,columnOrder:C,grouping:Re,columnWidths:z,showSummary:A,summaryColumns:N},currentLayoutId:fe,layoutIdToLoad:Ke,onPageChange:j,onRowsPerPageChange:ke,graphReportOpen:ge,handleOpenGraphReport:Bt,handleCloseGraphReport:Se}};w();var v1=t=>e("tbody",{...t}),y1=({align:t,...r})=>e("td",{align:t==="inherit"?void 0:t,...r}),x1=t=>e("div",{...t}),C1=t=>e("thead",{...t}),S1=t=>e("tr",{...t}),Xr=t=>{let{t:r}=de(),o="0.85rem",{title:n,showToolbar:a=true,selectionMode:i,selected:s=[],onSelectionChange:c,actions:p,extraTools:u,fitContainer:d=false,fullWidth:f=false,maxHeight:b,loading:m=false,rowsPerPageOptions:v=[20,50,100,-1],onLayoutSave:y,filterConfig:g,rowKey:x,tableKey:h="default",graphReport:S,quickCreate:T,quickEdit:C,quickDelete:L,serviceUrl:A,disableGrouping:I=false,disableSorting:N=false}=t,M=n||r("table.title.default"),{isMobile:k,columns:D,order:R,orderBy:F,filterText:z,setFilterText:K,visibleColumns:V,showSummary:q,setShowSummary:$,summaryColumns:X,grouping:W,setGrouping:H,expandedGroups:Q,groupAnchorEl:J,setGroupAnchorEl:ge,summaryAnchorEl:se,setSummaryAnchorEl:fe,columnWidths:xe,anchorEl:Ke,setAnchorEl:ze,contextMenu:Re,sensors:Ve,sortedAndFilteredRows:Me,summaryRow:Ce,visibleRows:He,isAllExpanded:at,page:ft,setPage:et,rowsPerPage:re,setRowsPerPage:$e,totalDisplayCount:Ee,setSelected:Le,handleColumnResize:lt,handleRequestSort:Qe,handleSelectAllClick:vt,handleClick:St,toggleSummaryColumn:Et,handleDragEnd:Lt,handleExport:te,handleContextMenu:rt,handleCloseContextMenu:Fe,toggleColumnVisibility:le,toggleGroupExpand:me,handleToggleAll:j,handleExpandGroupRecursively:ke,handleCollapseGroupRecursively:Te,isGroupFullyExpanded:Ye,handleLayoutLoad:pt,handleVariantLoad:ct,handleLayoutSave:Ft,effectiveAppId:_t,currentLayoutData:yt,currentLayoutId:bt,layoutIdToLoad:yr,graphReportOpen:Pt,handleOpenGraphReport:Ot,handleCloseGraphReport:dt}=an(t),Bt=S?.enabled??false,Se=Bt&&(S?.interaction?.enabled??true),B=li(),U=!!T?.enabled,ee=!!C?.enabled,Ie=!!L?.enabled,be=T?.fields,De=T?.excludeFields||[],_e=T?.initialValues||{},[je,Ue]=Qt__namespace.default.useState(false),[xt,At]=Qt__namespace.default.useState(false),[wt,Ct]=Qt__namespace.default.useState({}),[O,Y]=Qt__namespace.default.useState(false),[ue,ye]=Qt__namespace.default.useState(false),[Je,qe]=Qt__namespace.default.useState({}),[It,gt]=Qt__namespace.default.useState(false),[ut,kt]=Qt__namespace.default.useState(false),tr=m||xt||ue||ut,zt=Qt__namespace.default.useMemo(()=>{let oe=[...D];if(Array.isArray(be)&&be.length>0){let pe=new Set(be);oe=oe.filter(Z=>pe.has(Z.id));}if(De.length>0){let pe=new Set(De);oe=oe.filter(Z=>!pe.has(Z.id));}return oe.filter(pe=>!!pe?.id)},[D,De,be]),Xt=x||"id",Ht=Qt__namespace.default.useMemo(()=>{let oe=new Set(s);return Me.filter(pe=>oe.has(pe?.[Xt]))},[s,Me,Xt]),Ut=Ht.length===1?Ht[0]:null,Wt=C?.fields,Jt=C?.excludeFields||[],rr=C?.editableFields||[],ur=C?.nonEditableFields||[],Tr=C?.primaryKeys?.length?C.primaryKeys:[Xt],Pr=Qt__namespace.default.useMemo(()=>{let oe=[...D];if(Array.isArray(Wt)&&Wt.length>0){let pe=new Set(Wt);oe=oe.filter(Z=>pe.has(Z.id));}if(Jt.length>0){let pe=new Set(Jt);oe=oe.filter(Z=>!pe.has(Z.id));}return oe.filter(pe=>!!pe?.id)},[D,Jt,Wt]),jr=Qt__namespace.default.useMemo(()=>new Set(Tr),[Tr]),br=Qt__namespace.default.useMemo(()=>new Set(rr),[rr]),Er=Qt__namespace.default.useMemo(()=>new Set(ur),[ur]),Bo=Qt__namespace.default.useCallback(oe=>br.size>0?br.has(oe):!(Er.has(oe)||jr.has(oe)),[br,Er,jr]);Qt__namespace.default.useEffect(()=>{!Pt&&B.hasActiveFilters&&B.clearAll();},[Pt,B.hasActiveFilters,B.clearAll]);let zo=()=>{let oe={};zt.forEach(pe=>{oe[pe.id]=_e[pe.id]??"";}),Ct(oe),Ue(true);},ko=()=>{xt||Ue(false);},Vo=(oe,pe)=>{Ct(Z=>({...Z,[oe]:pe}));},Ho=async()=>{if(!T?.onSubmit){Ue(false);return}try{At(!0),await T.onSubmit(wt),Ue(!1);}finally{At(false);}},Ir=()=>{if(!Ut)return;let oe={};Pr.forEach(Z=>{oe[Z.id]=Ut[Z.id]??"";});let pe=C?.getInitialValues?{...oe,...C.getInitialValues(Ut)}:oe;qe(pe),Y(true);},To=()=>{ue||Y(false);},Wo=(oe,pe)=>{qe(Z=>({...Z,[oe]:pe}));},$r=async()=>{if(Ut){if(!C?.onSubmit){Y(false);return}try{ye(!0),await C.onSubmit(Je,Ut),Y(!1);}finally{ye(false);}}},Jr=()=>{Ht.length!==0&&gt(true);},xn=()=>{ut||gt(false);},Po=async()=>{if(Ht.length===0){gt(false);return}if(!L?.onConfirm){gt(false),Le([]),c?.([]);return}try{kt(!0),await L.onConfirm(Ht),gt(!1),Le([]),c?.([]);}finally{kt(false);}},P=Me,{fieldMapping:G}=tn({rows:P,config:{...S,title:S?.title||`${M} ${r("graph.reportTitle")}`}}),_=Qt__namespace.default.useMemo(()=>Se?B.applyRows(P,G):P,[Se,B.applyRows,P,G]),{model:ce}=tn({rows:_,config:{...S,title:S?.title||`${M} ${r("graph.reportTitle")}`,fieldMapping:G}}),Oe=ce.table.columns.map(oe=>({id:oe.id,label:oe.label,align:oe.align||"left",minWidth:120,numeric:oe.align==="right"})),ot=_t?e(nn,{appId:_t,tableKey:h,currentLayoutData:yt,onLayoutLoad:pt,targetLayoutId:yr,activeLayoutId:bt,serviceUrl:A??g?.serviceUrl}):null,We=l(jsxRuntime.Fragment,{children:[!I&&e(Jo,{groupAnchorEl:J,setGroupAnchorEl:ge,grouping:W,setGrouping:H,columns:D}),e(en,{anchorEl:Ke,setAnchorEl:ze,columns:D,visibleColumns:V,toggleColumnVisibility:le}),e(ei,{anchorEl:se,setAnchorEl:fe,showSummary:q,setShowSummary:$,columns:D,summaryColumns:X,toggleSummaryColumn:Et}),e(ti,{contextMenu:Re,handleCloseContextMenu:Fe,columns:D,visibleColumns:V,toggleColumnVisibility:le})]});return k?l("div",{sx:{display:"flex",flexDirection:"column",gap:2,height:"100%"},children:[g&&e(zr,{fields:g.fields,filters:g.filters,onFilterChange:g.onFilterChange,onSearch:g.onSearch,variants:g.variants||[],currentVariantId:g.currentVariantId,onVariantLoad:g.onVariantLoad,onVariantSave:g.onVariantSave,onVariantDelete:g.onVariantDelete,onVariantSetDefault:g.onVariantSetDefault,appId:g.appId,tableKey:h,currentLayout:[{tableKey:h,layoutData:yt}],variantService:g.variantService,serviceUrl:A??g.serviceUrl}),e(Pd,{title:M,loading:m,showSummary:q,setShowSummary:$,setAnchorEl:ze,setSummaryAnchorEl:fe,filterText:z,setFilterText:K,sortedAndFilteredRows:Me,selected:s,columns:D,visibleColumns:V,summaryRow:Ce,handleClick:St,selectionMode:i}),We]}):l("div",{sx:{width:f?"100%":"auto",mb:d?0:2,...d?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[g&&e("div",{sx:{mb:2},children:e(zr,{fields:g.fields,filters:g.filters,onFilterChange:g.onFilterChange,onSearch:g.onSearch,variants:g.variants||[],currentVariantId:g.currentVariantId,onVariantLoad:oe=>{ct(oe),g.onVariantLoad&&g.onVariantLoad(oe);},onVariantSave:g.onVariantSave,onVariantDelete:g.onVariantDelete,onVariantSetDefault:g.onVariantSetDefault,loading:m,appId:g.appId,tableKey:h,currentLayout:[{tableKey:h,layoutData:yt}],currentLayoutId:bt,layoutRefs:[{tableKey:h,layoutId:bt}],variantService:g.variantService,serviceUrl:A??g.serviceUrl})}),l(Ne,{className:"orb-ctable-surface",sx:{width:f?"100%":"auto",mb:d?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":tr?{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"}},...b?{height:b}:d?{flex:1,minHeight:0,height:"100%"}:{}},children:[a&&e(Za,{filterText:z,setFilterText:K,onRowsPerPageChange:$e,rowsPerPage:re,rowsPerPageOptions:v,page:ft,count:Ee,onPageChange:et,actions:p,extraTools:u,grouping:W,disableGrouping:I,groupAnchorEl:J,setGroupAnchorEl:ge,showSummary:q,setShowSummary:$,anchorEl:Ke,setAnchorEl:ze,summaryAnchorEl:se,setSummaryAnchorEl:fe,handleExport:te,showCreateButton:U,onOpenCreateDialog:zo,showEditButton:ee,onOpenEditDialog:Ir,editDisabled:Ht.length!==1,showDeleteButton:Ie,onOpenDeleteConfirm:Jr,deleteDisabled:Ht.length===0,onLayoutSave:y||g?.variantService&&g?.appId?Ft:void 0,loading:m,layoutManager:ot,onOpenGraphReport:Bt?Ot:void 0}),e("div",{sx:{flex:1,...b?{maxHeight:b,height:b}:d?{height:0,maxHeight:"none"}:{maxHeight:"calc(100vh - 320px)"},overflowY:"auto",overflowX:"auto",position:"relative",minHeight:0},children:e(core.DndContext,{sensors:Ve,collisionDetection:core.closestCenter,onDragEnd:Lt,modifiers:[modifiers.restrictToHorizontalAxis],children:l("table",{className:"orb-tbl orb-ctable",style:{minWidth:f?750:void 0,width:f?"100%":"auto",tableLayout:Object.keys(xe).length>0?"fixed":"auto",borderCollapse:"separate",borderSpacing:0,fontSize:o},"aria-labelledby":"tableTitle",children:[e(ja,{columns:D,visibleColumns:V,order:R,orderBy:F,onRequestSort:Qe,disableSorting:N,onContextMenu:rt,selectionMode:i,grouping:W,isAllExpanded:at,handleToggleAll:j,rowCount:Me.length,numSelected:s.length,onSelectAllClick:vt,columnWidths:xe,onColumnResize:lt}),e(Ja,{visibleRows:He,columns:D,visibleColumns:V,selectionMode:i,selected:s,orderBy:F,loading:m,expandedGroups:Q,toggleGroupExpand:me,handleExpandGroupRecursively:ke,handleCollapseGroupRecursively:Te,isGroupFullyExpanded:Ye,handleClick:St,onSelectionChange:c,grouping:W,rowKeyProp:x,page:ft,rowsPerPage:re}),q&&e(Td,{showSummary:q,columns:D,visibleColumns:V,summaryRow:Ce,selectionMode:i?.toString(),grouping:W,columnWidths:xe,orderBy:F,zIndex:3})]})})})]}),U&&l(Vt,{open:je,onClose:ko,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:oe=>`1px solid ${oe.palette.divider}`,bgcolor:"background.paper"}}},children:[e("div",{className:"orb-dialog-title",sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:T?.title||r("quickCreate.createWithTitle",{title:M})}),e("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:l("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[zt.map(oe=>{let pe=oe.type==="number"||oe.numeric?"number":oe.type==="date"?"date":"text",Z=oe.label||oe.id;return e(Be,{label:Z,value:wt[oe.id]??"",onChange:Ae=>Vo(oe.id,Ae.target.value),type:pe,size:"small",fullWidth:true,InputLabelProps:{shrink:pe==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-create-${oe.id}`)}),T?.description&&e(Kr,{severity:"info",sx:{fontSize:"0.85rem","& span":{fontSize:"0.85rem"}},children:T.description})]})}),l("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[e(ve,{onClick:ko,sx:{fontSize:"0.85rem"},disabled:xt,children:T?.cancelLabel||r("common.cancel")}),e(ve,{onClick:Ho,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:xt,children:T?.submitLabel||r("common.save")})]})]}),ee&&l(Vt,{open:O,onClose:To,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:oe=>`1px solid ${oe.palette.divider}`,bgcolor:"background.paper"}}},children:[e("div",{className:"orb-dialog-title",sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:C?.title||r("quickEdit.editWithTitle",{title:M})}),e("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:l("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Pr.map(oe=>{let pe=oe.type==="number"||oe.numeric?"number":oe.type==="date"?"date":"text",Z=oe.label||oe.id,Ae=Bo(oe.id);return e(Be,{label:Z,value:Je[oe.id]??"",onChange:Ze=>Wo(oe.id,Ze.target.value),type:pe,size:"small",fullWidth:true,disabled:!Ae,InputLabelProps:{shrink:pe==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-edit-${oe.id}`)}),C?.description&&e(Kr,{severity:"info",sx:{fontSize:"0.85rem","& span":{fontSize:"0.85rem"}},children:C.description})]})}),l("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[e(ve,{onClick:To,sx:{fontSize:"0.85rem"},disabled:ue,children:C?.cancelLabel||r("common.cancel")}),e(ve,{onClick:$r,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:ue||!Ut,children:C?.submitLabel||r("common.save")})]})]}),Ie&&e(On,{open:It,type:"warning",title:L?.title||r("quickDelete.confirmTitle"),message:L?.message||(Ht.length>1?r("quickDelete.confirmMessageMultiple",{count:Ht.length}):r("quickDelete.confirmMessageSingle")),confirmText:L?.confirmText||r("common.delete"),cancelText:L?.cancelText||r("common.cancel"),onClose:xn,onConfirm:Po}),We,Bt&&e(ii,{open:Pt,onClose:dt,model:ce,aiAssistant:S?.aiAssistant,interaction:Se?{enabled:true,filters:B.filters,fieldMapping:G,onPrimaryDimensionClick:oe=>B.setFilter("primaryDimension",oe),onSecondaryDimensionClick:oe=>B.setFilter("secondaryDimension",oe),onStatusClick:oe=>B.setFilter("status",oe),onClearFilter:B.clearFilter,onClearAll:B.clearAll}:void 0,tableContent:e(Xr,{appId:_t||"graph-report-internal",title:r("graph.dataBody"),columns:Oe,rows:ce.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false}})})]})},w1=Xr;w();var D1=({id:t,title:r,hideHeader:o=true,filterConfig:n,tableProps:a,children:i,spacing:s=1,mode:c="separated"})=>{let p=n?{...n,appId:n.appId||t}:void 0,u={...a,appId:a.appId||t};return l(qa,{title:r,hideHeader:o,children:[l(ie,{spacing:s,sx:{height:"100%",overflow:"hidden"},children:[c==="separated"&&p&&e("div",{sx:{flexShrink:0},children:e(zr,{...p})}),e("div",{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:e(Xr,{...u,fitContainer:true,filterConfig:c==="integrated"?p:void 0})})]}),i]})};var O1=({metadata:t,fetchData:r,initialRowsPerPage:o=20,rowsPerPageOptions:n=[20,50,100,-1],tableKey:a="default",mode:i="integrated",serviceUrl:s,variantService:c})=>{let{t:p}=de(),[u,d]=Qt.useState(false),[f,b]=Qt.useState([]),[m,v]=Qt.useState({}),[y,g]=Qt.useState(t.variants||[]),[x,h]=Qt.useState(t.layout||null),[S,T]=Qt.useState(""),[C,L]=Qt.useState(0),[A,I]=Qt.useState(0),[N,M]=Qt.useState(o),[k,D]=Qt.useState([]),[R,F]=Qt.useState("asc"),[z,K]=Qt.useState("");Qt.useEffect(()=>{let se={};t.filters.forEach(fe=>{fe.defaultValue!==void 0&&(se[fe.id]=fe.defaultValue);}),v(se);},[t.filters]);let V=Qt.useCallback(async(se,fe,xe,Ke,ze)=>{d(true);try{let Re={...se,page:fe+1,limit:xe,sort:ze,order:Ke},Ve;r?Ve=await r(Re):typeof t.api=="function"?Ve=await t.api(Re):t.api&&typeof t.api=="object"?(console.log("Fetching from URL:",t.api.url,Re),Ve={rows:[],total:0}):(console.warn("No API configured for report"),Ve={rows:[],total:0}),Ve&&(b(Ve.rows||[]),L(Ve.total||0));}catch(Re){console.error("Failed to fetch report data",Re);}finally{d(false);}},[t.api,r]);Qt.useEffect(()=>{V(m,A,N,R,z);},[V,A,N,R,z]);let q=()=>{I(0),V(m,0,N,R,z);},$=se=>{I(0),M(se);},X=(se,fe)=>{F(fe),K(se);},W=se=>{v(se);},H=se=>{T(se?.id||"");let fe=mi(se,a);if(fe){let Ke=fe.values??fe;v(Ke),V(Ke,0,N,R,z),I(0);}let{layout:xe}=gi(se,a);xe&&h(xe);},Q=se=>{let fe={...se,id:Date.now().toString(),createdAt:new Date().toISOString()};g(xe=>[...xe,fe]);},J=se=>{h(se);};return {pageProps:{id:t.id,title:t.title,mode:i,filterConfig:{appId:t.id,tableKey:a,fields:t.filters,filters:m,onFilterChange:W,onSearch:q,onVariantLoad:H,onVariantSave:Q,onVariantDelete:se=>g(fe=>fe.filter(xe=>xe.id!==se)),onVariantSetDefault:se=>{g(fe=>fe.map(xe=>({...xe,isDefault:xe.id===se})));},variants:y,currentVariantId:S,variantService:c,serviceUrl:s},tableProps:{appId:t.id,tableKey:a,columns:t.columns,rows:f,loading:u,rowKey:"id",count:C,page:A,rowsPerPage:N,rowsPerPageOptions:n,onPageChange:I,onRowsPerPageChange:$,selectionMode:"multiple",selected:k,onSelectionChange:D,onLayoutSave:J,layout:x,title:t.title,showSummary:true,order:R,orderBy:z,serviceUrl:s,onSortChange:X,graphReport:t.graphReport||{enabled:true,title:`${t.title} ${p("graph.reportTitle")}`}}},filters:m,rows:f,loading:u,refresh:q}};w();var Qf=new Set(["id","title","description","icon","iconNode","meta"]),jf=t=>t.replace(/([A-Z])/g," $1").replace(/[._-]+/g," ").replace(/^\w/,r=>r.toUpperCase()).trim(),Jf=t=>Object.entries(t).filter(([r,o])=>!Qf.has(r)&&o!==null&&o!==void 0&&["string","number","boolean"].includes(typeof o)).map(([r,o])=>({key:r,label:jf(r),value:String(o)})),ep=({item:t,open:r,onClose:o,onDownloadClick:n,renderContent:a,downloadTooltip:i,closeTooltip:s})=>{let{t:c}=de(),u=hr()==="dark"?"var(--orb-p300)":"var(--orb-primary)";Qt__namespace.default.useEffect(()=>{if(!r)return;let f=b=>{b.key==="Escape"&&o();};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[r,o]);let d=Jf(t);return typeof document>"u"?null:reactDom.createPortal(l(jsxRuntime.Fragment,{children:[e("div",{"aria-hidden":"true",onClick:o,sx:{position:"fixed",inset:0,zIndex:1299,backgroundColor:"rgba(1, 9, 26, 0.4)",opacity:r?1:0,pointerEvents:r?"auto":"none",transition:"opacity 200ms ease"}}),l("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:r?"translate(-50%, -50%) scale(1)":"translate(-50%, -47%) scale(0.96)",opacity:r?1:0,transition:"transform 200ms ease, opacity 180ms ease"},children:[l(ie,{direction:"row",spacing:1.5,alignItems:"center",sx:{p:2.5,pb:2,borderBottom:"1px solid",borderColor:"divider",flexShrink:0},children:[e("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??e(Mt,{name:t.icon??"product",size:30,style:{color:u}})}),l("div",{sx:{flex:1,minWidth:0},children:[e(E,{component:"div",sx:{fontWeight:700,fontSize:"1.1rem",lineHeight:1.3,wordBreak:"break-word"},children:t.title}),t.meta?e(E,{component:"div",sx:{fontSize:"0.8rem",color:"text.secondary"},children:t.meta}):null]}),e(ae,{tooltip:s??c("cardPage.close"),"aria-label":s??c("cardPage.close"),onClick:o,children:e(Mt,{name:"decline",size:18})})]}),e("div",{sx:{flex:1,minHeight:0,overflowY:"auto",p:2.5},children:a?a(t):l(jsxRuntime.Fragment,{children:[t.description?e(E,{component:"div",sx:{fontSize:"0.9rem",lineHeight:1.6,color:"text.primary"},children:t.description}):null,d.length>0?e("div",{sx:{mt:t.description?2.5:0,display:"grid",gap:1.5},children:d.map(f=>l("div",{children:[e(E,{component:"div",sx:{fontSize:"0.72rem",fontWeight:600,color:"text.secondary",textTransform:"uppercase",letterSpacing:"0.04em"},children:f.label}),e(E,{component:"div",sx:{fontSize:"0.88rem",color:"text.primary",wordBreak:"break-word"},children:f.value})]},f.key))}):null]})}),n?e("div",{sx:{p:2.5,pt:2,borderTop:"1px solid",borderColor:"divider",flexShrink:0},children:e(ve,{variant:"contained",sx:{width:"100%"},startIcon:e(Mt,{name:"download",size:16}),onClick:()=>n(t),children:i??c("cardPage.download")})}):null]})]}),document.body)};w();var eb={display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3",overflow:"hidden"},tb=({item:t,onDetailClick:r,onDownloadClick:o,detailTooltip:n,downloadTooltip:a})=>{let{t:i}=de(),c=hr()==="dark"?"var(--orb-p300)":"var(--orb-primary)",p=t.iconNode??e(Mt,{name:t.icon??"product",size:26,style:{color:c}});return l(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:[l(ie,{direction:"row",spacing:1.5,alignItems:"center",children:[e("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:p}),l("div",{sx:{flex:1,minWidth:0},children:[e(E,{component:"div",noWrap:true,sx:{fontWeight:700,fontSize:"0.98rem",lineHeight:1.3},children:t.title}),t.meta?e(E,{component:"div",noWrap:true,sx:{fontSize:"0.75rem",color:"text.secondary"},children:t.meta}):null]})]}),e("div",{sx:{mt:1.5,flex:1,minHeight:0},children:e(E,{component:"div",sx:{fontSize:"0.84rem",lineHeight:1.45,color:"text.primary",...eb},children:t.description||"\xA0"})}),l(ie,{direction:"row",spacing:.5,justifyContent:"flex-end",sx:{mt:1.5},children:[e(ae,{tooltip:n??i("cardPage.viewDetails"),"aria-label":n??i("cardPage.viewDetails"),onClick:()=>r?.(t),children:e(Mt,{name:"show",size:18})}),e(ae,{tooltip:a??i("cardPage.download"),"aria-label":a??i("cardPage.download"),onClick:()=>o?.(t),children:e(Mt,{name:"download",size:18})})]})]})},rp=({items:t,loading:r=false,onDetailClick:o,onDownloadClick:n,minCardWidth:a=260,detailTooltip:i,downloadTooltip:s,emptyText:c,detailPanel:p=true,renderDetailContent:u})=>{let{t:d}=de(),[f,b]=Qt__namespace.default.useState(null),[m,v]=Qt__namespace.default.useState(false),y=x=>{o?.(x),p&&(b(x),requestAnimationFrame(()=>requestAnimationFrame(()=>v(true))));},g=()=>{v(false),setTimeout(()=>b(null),260);};return r?e("div",{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",minHeight:240},children:e(Gr,{})}):t.length?l(jsxRuntime.Fragment,{children:[e("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=>e(tb,{item:x,onDetailClick:y,onDownloadClick:n,detailTooltip:i,downloadTooltip:s},x.id))}),p&&f?e(ep,{item:f,open:m,onClose:g,onDownloadClick:n,renderContent:u,downloadTooltip:s}):null]}):e("div",{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",minHeight:240},children:e(E,{sx:{color:"text.secondary"},children:c??d("cardPage.empty")})})};w();var nR=({id:t,title:r,hideHeader:o=true,filterConfig:n,gridProps:a,children:i,spacing:s=1})=>{let c=n?{...n,appId:n.appId||t}:void 0;return l(qa,{title:r,hideHeader:o,children:[l(ie,{spacing:s,sx:{height:"100%",overflow:"hidden"},children:[c&&e("div",{sx:{flexShrink:0},children:e(zr,{...c})}),e("div",{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:e(rp,{...a})})]}),i]})};var cR=({metadata:t,fetchData:r,tableKey:o="default",variantService:n,serviceUrl:a,onDetailClick:i,onDownloadClick:s,minCardWidth:c})=>{let[p,u]=Qt.useState(false),[d,f]=Qt.useState([]),[b,m]=Qt.useState(0),[v,y]=Qt.useState({}),[g,x]=Qt.useState(t.variants||[]),[h,S]=Qt.useState("");Qt.useEffect(()=>{let M={};t.filters.forEach(k=>{k.defaultValue!==void 0&&(M[k.id]=k.defaultValue);}),y(M);},[t.filters]);let T=Qt.useCallback(async M=>{u(true);try{let k=r?await r({...M}):{rows:[],total:0};f(k?.rows||[]),m(k?.total||0);}catch(k){console.error("Failed to fetch card page data",k);}finally{u(false);}},[r]);Qt.useEffect(()=>{T(v);},[T]);let C=()=>{T(v);},L=M=>{y(M);},A=M=>{S(M?.id||"");let k=mi(M,o);if(k){let D=k.values??k;y(D),T(D);}},I=M=>{let k={...M,id:Date.now().toString(),createdAt:new Date().toISOString()};x(D=>[...D,k]);};return {pageProps:{id:t.id,title:t.title,filterConfig:{appId:t.id,tableKey:o,fields:t.filters,filters:v,onFilterChange:L,onSearch:C,onVariantLoad:A,onVariantSave:I,onVariantDelete:M=>x(k=>k.filter(D=>D.id!==M)),onVariantSetDefault:M=>{x(k=>k.map(D=>({...D,isDefault:D.id===M})));},variants:g,currentVariantId:h,variantService:n,serviceUrl:a},gridProps:{items:d,loading:p,onDetailClick:i,onDownloadClick:s,minCardWidth:c}},items:d,total:b,filters:v,loading:p,refresh:C}};var ob=t=>[...t].sort((r,o)=>o.value-r.value),uR=({bars:t=[],lines:r=[],combos:o=[],heatmap:n=[],pies:a=[],waterfalls:i=[]})=>{let s=Qt.useMemo(()=>ob(t),[t]),c=Qt.useMemo(()=>[...r],[r]),p=Qt.useMemo(()=>[...o],[o]),u=Qt.useMemo(()=>[...n],[n]),d=Qt.useMemo(()=>{let b=a.reduce((m,v)=>m+v.value,0);return a.map(m=>({...m,percent:b>0?m.value/b*100:m.percent}))},[a]),f=Qt.useMemo(()=>[...i],[i]);return {bars:s,lines:c,combos:p,heatmap:u,pies:d,waterfalls:f}};var hR=({apiKey:t,query:r,zoom:o=14,mapType:n="roadmap"})=>Qt.useMemo(()=>!t||!r?"":$n({apiKey:t,query:r,zoom:o,mapType:n}),[t,r,o,n]),vR=({keyword:t,location:r})=>Qt.useMemo(()=>ni({keyword:t,location:r?{lng:r.lng,lat:r.lat,name:r.name}:void 0}),[t,r]);w();var qn=({code:t,language:r="text",copyable:o=true,showLineNumbers:n=false,wrapLongLines:a=false,maxHeight:i})=>{let[s,c]=Qt.useState(false),p=Qt.useMemo(()=>t.replace(/\n$/,"").split(`
186
- `),[t]);return l("div",{style:{border:"1px solid var(--orb-border)",borderRadius:12,overflow:"hidden",background:"var(--orb-canvas)"},children:[l("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"4.8px 8px",background:"var(--orb-hover)",borderBottom:"1px solid var(--orb-border)"},children:[e("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:r}),o&&e(ae,{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?e(Go,{size:14,strokeWidth:1.8}):e(ca,{size:14,strokeWidth:1.8})})]}),e("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?p.map((d,f)=>l("div",{style:{display:"flex"},children:[e("span",{style:{width:34,flexShrink:0,textAlign:"right",paddingRight:8,color:"var(--orb-disabled-fg)",userSelect:"none"},children:f+1}),e("span",{style:{whiteSpace:a?"pre-wrap":"pre",wordBreak:a?"break-word":"normal"},children:d})]},`${f}-${d}`)):e("code",{style:{display:"block",whiteSpace:a?"pre-wrap":"pre",wordBreak:a?"break-word":"normal"},children:t})})]})};w();var cb=t=>{let r=t.trim();return r.startsWith("$$")&&r.endsWith("$$")&&r.length>=4&&(r=r.slice(2,-2).trim()),r.startsWith("$")&&r.endsWith("$")&&r.length>=2&&(r=r.slice(1,-1).trim()),r},db=async t=>new Function("m","return import(m)")(t),Xn=({expression:t,inline:r=false,allowKatex:o=false})=>{let n=Qt.useMemo(()=>cb(t),[t]),[a,i]=Qt.useState("");return Qt.useEffect(()=>{let s=true;return (async()=>{if(!o||!n){i("");return}try{let p=await db("katex"),d=(p?.default||p)?.renderToString?.(n,{displayMode:!r,throwOnError:!1,strict:"warn"});s&&typeof d=="string"&&i(d);}catch{s&&i("");}})(),()=>{s=false;}},[o,n,r]),n?a?e(we,{component:r?"span":"div",sx:{display:r?"inline-flex":"block",my:r?0:.5,overflowX:"auto"},dangerouslySetInnerHTML:{__html:a}}):r?e(we,{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}):e(we,{sx:{my:1,p:1,borderRadius:1.2,border:"1px dashed",borderColor:"divider",bgcolor:"background.paper"},children:e(gr,{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};w();var mb=async t=>new Function("m","return import(m)")(t),As=({code:t,title:r="Mermaid Diagram",height:o=320,enabled:n=true})=>{let[a,i]=Qt.useState(""),[s,c]=Qt.useState(""),[p,u]=Qt.useState(false),d=Qt.useMemo(()=>t.trim(),[t]);return Qt.useEffect(()=>{let f=true;return (async()=>{if(!n||!d){i(""),c("");return}u(true),c(""),i("");try{let m=await mb("mermaid"),v=m?.default||m;if(!v||typeof v.render!="function")throw new Error("Mermaid runtime is not available");v.initialize?.({startOnLoad:!1,securityLevel:"loose",theme:"default"});let y=await v.render(`orbcafe-mermaid-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,d),g=typeof y=="string"?y:y?.svg;f&&typeof g=="string"&&i(g);}catch(m){if(f){let v=m instanceof Error?m.message:"Failed to render Mermaid diagram";c(v);}}finally{f&&u(false);}})(),()=>{f=false;}},[n,d]),l(Ro,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:[e(we,{sx:{px:1,py:.6,borderBottom:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:e(gr,{variant:"caption",color:"text.secondary",sx:{letterSpacing:.4,textTransform:"uppercase"},children:r})}),l(we,{sx:{p:1},children:[p&&e(we,{sx:{minHeight:120,display:"flex",alignItems:"center",justifyContent:"center"},children:e(Cc,{size:20})}),!p&&a&&e(we,{sx:{maxHeight:o,overflow:"auto","& svg":{display:"block",mx:"auto",maxWidth:"100%",height:"auto"}},dangerouslySetInnerHTML:{__html:a}}),!p&&!a&&l(we,{children:[s&&e(Kr,{severity:"info",sx:{mb:1},children:s}),e(qn,{code:d,language:"mermaid",copyable:true,showLineNumbers:true,wrapLongLines:true})]})]})]})};w();var Ns=t=>t.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(o=>o.trim()),fb=t=>/^:?-{3,}:?$/.test(t.trim()),bb=t=>{let r=t.trim(),o=r.startsWith(":"),n=r.endsWith(":");return o&&n?"center":n?"right":"left"},fi=t=>{let r=t.split(`
187
- `).map(s=>s.trim()).filter(Boolean);if(r.length<2)return null;let o=Ns(r[0]),n=Ns(r[1]);if(o.length===0||n.length!==o.length||!n.every(fb))return null;let a=n.map(bb),i=r.slice(2).filter(s=>s.includes("|")).map(s=>{let c=Ns(s);return c.length<o.length?[...c,...Array.from({length:o.length-c.length},()=>"")]:c.slice(0,o.length)});return {headers:o,aligns:a,rows:i}},Es=({markdown:t,table:r,maxHeight:o=360})=>{let n=Qt.useMemo(()=>r||(t?fi(t):null),[r,t]);return !n||n.headers.length===0?e(Ro,{variant:"outlined",sx:{p:1.2,borderRadius:1.5},children:e(gr,{variant:"body2",color:"text.secondary",children:"Invalid table block"})}):e(Ro,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:e(Tc,{sx:{maxHeight:o},children:l(wc,{size:"small",stickyHeader:true,children:[e(Pc,{children:e(Cs,{children:n.headers.map((a,i)=>e(xs,{align:n.aligns[i],sx:{fontWeight:700,bgcolor:"background.paper"},children:a},`${a}-${i}`))})}),e(kc,{children:n.rows.map((a,i)=>e(Cs,{hover:true,children:a.map((s,c)=>e(xs,{align:n.aligns[c],sx:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:s||e(we,{component:"span",sx:{color:"text.disabled"},children:"-"})},`cell-${i}-${c}`))},`row-${i}`))})]})})})};w();var bi=({content:t,title:r="Thinking",defaultExpanded:o=false,isStreaming:n=false})=>{let[a,i]=Qt.useState(o);return l(we,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1,my:.8},children:[l(vc,{direction:"row",alignItems:"center",spacing:.6,children:[e(yc,{size:"small",onClick:()=>i(s=>!s),sx:{transform:a?"rotate(180deg)":"rotate(0deg)",transition:"transform .15s ease"},children:e(Xo,{fontSize:"inherit"})}),l(gr,{variant:"caption",color:"text.secondary",sx:{fontStyle:"italic"},children:[r,n?" ...":""]})]}),e(qo,{in:a,children:e(gr,{variant:"body2",sx:{pl:4,pt:.4,whiteSpace:"pre-wrap",color:"text.secondary",fontStyle:"italic",lineHeight:1.55},children:t})})]})};w();var Ls=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|\*[^*]+\*|\$[^$\n]+\$)/g,hi=t=>t.trim().startsWith("```"),ip=t=>/^#{1,6}\s+/.test(t.trim()),Fs=t=>/^[-*+]\s+/.test(t.trim()),Os=t=>/^\d+\.\s+/.test(t.trim()),sp=t=>/^(?:-{3,}|\*{3,}|_{3,})$/.test(t.trim()),Bs=t=>t.trim().startsWith(">"),lp=(t,r)=>{if(r+1>=t.length)return false;let o=t[r],n=t[r+1];return !o.includes("|")||!n.includes("|")?false:/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(n.trim())},cp=t=>t.trim().startsWith("<think>")||t.trim()===":::think",Yn=(t,r,o)=>{let n=[],a=0,i=0;Ls.lastIndex=0;let s=Ls.exec(t);for(;s;){s.index>a&&n.push(t.slice(a,s.index));let c=s[0],p=`${o}-${i}`;if(c.startsWith("**")&&c.endsWith("**"))n.push(e("strong",{children:c.slice(2,-2)},p));else if(c.startsWith("*")&&c.endsWith("*"))n.push(e("em",{children:c.slice(1,-1)},p));else if(c.startsWith("`")&&c.endsWith("`"))n.push(e(we,{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)},p));else if(c.startsWith("[")&&c.includes("](")&&c.endsWith(")")){let u=c.match(/^\[([^\]]+)\]\(([^)]+)\)$/);u?n.push(e(hc,{href:u[2],target:"_blank",rel:"noreferrer",children:u[1]},p)):n.push(c);}else c.startsWith("$")&&c.endsWith("$")&&r.enableMath?n.push(e(Xn,{expression:c,inline:true,allowKatex:true},p)):n.push(c);a=s.index+c.length,i+=1,s=Ls.exec(t);}return a<t.length&&n.push(t.slice(a)),n.length>0?n:[t]},Zn=({markdown:t,content:r,className:o,enableMath:n=true,enableMermaid:a=true,enableThinkBlock:i=true,codeCopyable:s=true,codeLineNumbers:c=false})=>{let p=t??r??"",u=Qt.useMemo(()=>{let d=[],f=p.replace(/\r\n/g,`
183
+ `;return Jt.useEffect(()=>{let d=i.current;if(!d)return;let p=new ogl.Renderer({alpha:true,premultipliedAlpha:false}),u=p.gl;u.clearColor(0,0,0,0),d.appendChild(u.canvas);let f=new ogl.Triangle(u),b=new ogl.Program(u,{vertex:s,fragment:l,uniforms:{iTime:{value:0},iResolution:{value:new ogl.Vec3(u.canvas.width,u.canvas.height,u.canvas.width/u.canvas.height)},hue:{value:t},hover:{value:0},rot:{value:0},hoverIntensity:{value:r},backgroundColor:{value:im(a)}}}),m=new ogl.Mesh(u,{geometry:f,program:b});function v(){if(!d)return;let R=window.devicePixelRatio||1,S=d.clientWidth,E=d.clientHeight;p.setSize(S*R,E*R),u.canvas.style.width=S+"px",u.canvas.style.height=E+"px",b.uniforms.iResolution.value.set(u.canvas.width,u.canvas.height,u.canvas.width/u.canvas.height);}window.addEventListener("resize",v),v();let y=0,g=0,x=0,h=.3,C=R=>{let S=d.getBoundingClientRect(),E=R.clientX-S.left,D=R.clientY-S.top,I=S.width,A=S.height,N=Math.min(I,A),O=I/2,F=A/2,q=(E-O)/N*2,z=(D-F)/N*2;Math.sqrt(q*q+z*z)<.8?y=1:y=0;},P=()=>{y=0;};d.addEventListener("mousemove",C),d.addEventListener("mouseleave",P);let w,k=R=>{w=requestAnimationFrame(k);let S=(R-g)*.001;g=R,b.uniforms.iTime.value=R*.001,b.uniforms.hue.value=t,b.uniforms.hoverIntensity.value=r,b.uniforms.backgroundColor.value=im(a);let E=n?1:y;b.uniforms.hover.value+=(E-b.uniforms.hover.value)*.1,o&&E>.5&&(x+=S*h),b.uniforms.rot.value=x,p.render({scene:m});};return w=requestAnimationFrame(k),()=>{cancelAnimationFrame(w),window.removeEventListener("resize",v),d.removeEventListener("mousemove",C),d.removeEventListener("mouseleave",P),u.canvas.parentNode===d&&d.removeChild(u.canvas),u.getExtension("WEBGL_lose_context")?.loseContext();}},[t,r,o,n,a]),e("div",{ref:i,className:"w-full h-full"})}function by(t,r,o){let n,a,i;if(r===0)n=a=i=o;else {let s=(p,u,f)=>(f<0&&(f+=1),f>1&&(f-=1),f<.16666666666666666?p+(u-p)*6*f:f<.5?u:f<.6666666666666666?p+(u-p)*(.6666666666666666-f)*6:p),l=o<.5?o*(1+r):o+r-o*r,d=2*o-l;n=s(d,l,t+1/3),a=s(d,l,t),i=s(d,l,t-1/3);}return new ogl.Vec3(n,a,i)}function im(t){if(t==="transparent")return new ogl.Vec3(0,0,0);if(t.startsWith("#")){let n=parseInt(t.slice(1,3),16)/255,a=parseInt(t.slice(3,5),16)/255,i=parseInt(t.slice(5,7),16)/255;return new ogl.Vec3(n,a,i)}let r=t.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(r)return new ogl.Vec3(parseInt(r[1])/255,parseInt(r[2])/255,parseInt(r[3])/255);let o=t.match(/hsla?\((\d+),\s*(\d+)%,\s*(\d+)%/);if(o){let n=parseInt(o[1])/360,a=parseInt(o[2])/100,i=parseInt(o[3])/100;return by(n,a,i)}return new ogl.Vec3(0,0,0)}var lm=Ds(()=>{"use strict";"use client";T();});var Ag={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"},Eg={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"},Ns={light:Ag,dark:Eg},Zx='"Montserrat", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif',jx=t=>{let r=Ns[t];return [r.primary,r.p300,r.muted,r.p700]},Qx=10,Jx="0.2s ease";T();var vc=Jt.createContext({mode:"light",setting:"light"}),Ug=t=>{if(typeof document>"u")return;let r=document.documentElement;r.classList.toggle("orb-dark",t==="dark"),r.dataset.orbMode=t,r.style.colorScheme=t;},Ln=({mode:t,defaultMode:r="light",children:o})=>{let n=t??r,[a,i]=Jt.useState("light"),[s,l]=Jt.useState(false);Jt.useEffect(()=>{l(true);let u=window.matchMedia("(prefers-color-scheme: dark)"),f=()=>i(u.matches?"dark":"light");return f(),u.addEventListener("change",f),()=>u.removeEventListener("change",f)},[]);let d=n==="system"?s?a:"light":n;Jt.useEffect(()=>{Ug(d);},[d]);let p=Jt.useMemo(()=>({mode:d,setting:n}),[d,n]);return e(vc.Provider,{value:p,children:o})},yr=()=>Jt.useContext(vc).mode,Es=()=>Ns[yr()];var rt=(t,r)=>{let o=Math.min(1,Math.max(0,r)),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),u=parseInt(s.slice(4,6),16);return `rgba(${d}, ${p}, ${u}, ${o})`}let l=`${Math.round(o*100)}%`;return `color-mix(in oklch, ${t} ${l}, transparent)`};var Dr=t=>{let r=t.startsWith("up:")?`(min-width:${t.slice(3)}px)`:t.startsWith("down:")?`(max-width:${t.slice(5)}px)`:t,[o,n]=Jt.useState(()=>typeof window>"u"||typeof window.matchMedia!="function"?false:window.matchMedia(r).matches);return Jt.useEffect(()=>{if(typeof window.matchMedia!="function")return;let a=window.matchMedia(r),i=()=>n(a.matches);return i(),a.addEventListener("change",i),()=>a.removeEventListener("change",i)},[r]),o};T();var Xg={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},Yg=t=>typeof t=="number"?`${t}px`:t,Zg={"2.5":10,3:12,"3.5":14,4:16,5:20,6:24,7:28,8:32,10:40,12:48},jg=t=>{if(!t)return;let r=t.match(/(?:^|\s)(?:h|w)-(2\.5|3(?:\.5)?|4|5|6|7|8|10|12)(?:\s|$)/);return r?Zg[r[1]]:void 0},Mt=Jt.forwardRef(({name:t,size:r,title:o,className:n,style:a,strokeWidth:i,fill:s,...l},d)=>{let p=l["aria-label"]??o,u=Yg(r??jg(n)??"1em"),f={fontFamily:"SAP-icons",fontSize:u,fontStyle:"normal",fontWeight:"normal",lineHeight:1,width:u,height:u,display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",...a};return e("span",{ref:d,role:p?"img":void 0,"aria-hidden":p?void 0:true,title:o,className:n,"data-sap-icon":t,style:f,...l,children:String.fromCodePoint(Xg[t])})});Mt.displayName="SapIcon";var ne=(t,r)=>{let o=Jt.forwardRef((n,a)=>e(Mt,{ref:a,name:t,...n}));return o.displayName=r??`SapIcon(${t})`,o};var Cc=ne("activity","Activity"),ka=ne("error","AlertCircle"),xc=ne("warning","AlertTriangle"),x0=ne("down","ArrowDown"),S0=ne("navigationRight","ArrowRight"),Sc=ne("up","ArrowUp"),Ls=ne("barChart","BarChart"),w0=ne("activate","Bot"),Os=ne("calendar","Calendar"),k0=Os,P0=ne("camera","Camera"),T0=ne("lineChart","ChartNoAxesCombined"),qr=ne("accept","Check"),Pa=ne("accept","CheckCircle"),Fr=ne("slimDown","ChevronDown"),Ta=ne("navigationLeft","ChevronLeft"),Br=ne("navigationRight","ChevronRight"),I0=ne("slimUp","ChevronUp"),R0=ne("expandAll","ChevronsDown"),M0=ne("collapseAll","ChevronsUp"),Ia=ne("error","CircleAlert"),On=ne("accept","CircleCheck"),D0=On,wc=ne("stop","CircleStop"),kc=ne("copy","Clipboard"),N0=ne("checklist","ClipboardCheck"),A0=ne("checklist","ClipboardList"),Pc=ne("time","Clock"),E0=ne("tableColumn","Columns3"),ho=ne("copy","Copy"),L0=ne("duplicate","CopyPlus"),O0=ne("delete","Delete"),F0=ne("download","Download"),Tc=ne("edit","Edit"),Ic=ne("fullScreen","Expand"),B0=ne("show","Eye"),H0=ne("hide","EyeOff"),Ra=ne("document","File"),Rc=ne("document","FileText"),z0=ne("filter","Filter"),Fn=ne("tree","FolderTree"),Mc=ne("process","GitBranch"),Bn=ne("world","Globe"),Dc=ne("grid","Grid"),V0=ne("move","GripVertical"),W0=ne("wrench","Hammer"),Nc=ne("picture","Image"),Ma=ne("information","Info"),$0=ne("translate","Languages"),G0=ne("dimension","Layers"),_0=ne("home","LayoutDashboard"),Da=ne("lightbulb","Lightbulb"),Ac=ne("lineChart","LineChart"),Ec=ne("synchronize","Loader2"),Na=ne("locked","Lock"),U0=Na,Lc=ne("log","LogOut"),Fs=ne("email","Mail"),Oc=ne("map","MapPin"),K0=ne("menu","Menu"),Qg=ne("message","MessageCircle"),Fc=Qg,Aa=ne("microphone","Mic"),q0=ne("microphone","MicOff"),Bc=ne("darkMode","Moon"),X0=ne("overflow","MoreHorizontal"),Y0=ne("accept","PackageCheck"),Z0=ne("product","PackageSearch"),Ea=ne("splitOne","PanelLeftOpen"),La=ne("splitTwo","PanelRight"),j0=ne("overview","PanelsTopLeft"),Hc=ne("pieChart","PieChart"),Qo=ne("pushpin","Pin"),Q0=ne("play","Play"),Oa=ne("add","Plus"),J0=ne("qrCode","QrCode"),eS=ne("receipt","ReceiptText"),Fa=ne("refresh","RefreshCw"),tS=ne("activate","Rocket"),rS=ne("refresh","RotateCcw"),zc=ne("refresh","RotateCw"),oS=ne("tableRow","Rows3"),nS=ne("save","Save"),aS=ne("qrCode","ScanLine"),Hr=ne("search","Search"),Jg=ne("paperPlane","Send"),Vc=Jg,Jo=ne("wrench","Settings"),iS=ne("accept","ShieldCheck"),sS=ne("sum","Sigma"),lS=ne("sort","SortAsc"),cS=ne("splitTwo","SquareSplitHorizontal"),dS=ne("favorite","Star"),Wc=ne("lightMode","Sun"),pS=ne("table","Table2"),uS=ne("ipad","TabletSmartphone"),Hn=ne("command","Terminal"),$c=ne("thumbDown","ThumbsDown"),Gc=ne("thumbUp","ThumbsUp"),_c=ne("delete","Trash2"),mS=ne("tree","TreePine"),Uc=ne("trendDown","TrendingDown"),Ba=ne("warning","TriangleAlert"),gS=ne("shipping","Truck"),Kc=ne("upload","UploadCloud"),Bs=ne("employee","User"),qc=ne("sound","Volume2"),fS=ne("factory","Warehouse"),bS=ne("process","Workflow"),Zt=ne("decline","X"),Ha=ne("error","XCircle");Gt();T();var tf={contained:"primary",outlined:"secondary",text:"ghost"},rf={small:"orb-btn-sm",medium:void 0,large:"orb-btn-lg"},Ce=Jt.forwardRef(({variant:t="primary",size:r="medium",block:o=false,loading:n=false,startIcon:a,endIcon:i,component:s,href:l,sx:d,className:p,children:u,disabled:f,type:b="button",...m},v)=>{let y=tf[t]??t,g=["orb-btn",`orb-btn-${y}`,rf[r],o?"orb-btn-block":void 0,n?"orb-is-loading":void 0,p].filter(Boolean).join(" "),x=Ue(d,g),h=s??(l?"a":"button");return c(h,{ref:v,type:h==="button"?b:void 0,href:l,className:x.className,style:x.style,disabled:h==="button"?f||n:void 0,"aria-disabled":h!=="button"&&(f||n)?true:void 0,...m,children:[n&&e("span",{className:`orb-spin ${y==="primary"?"orb-spin-light":""}`,"aria-hidden":true}),!n&&a,u,!n&&i]})});Ce.displayName="CButton";Gt();T();var ze=Jt.forwardRef(({label:t,value:r,defaultValue:o,onChange:n,onFocus:a,onBlur:i,onKeyDown:s,type:l="text",placeholder:d,disabled:p,readOnly:u,required:f,autoFocus:b,autoComplete:m,name:v,id:y,error:g,helperText:x,dense:h=false,size:C,fullWidth:P=true,select:w=false,multiline:k=false,rows:R,children:S,variant:E,margin:D,onClick:I,startAdornment:A,endAdornment:N,InputProps:O,inputProps:F,InputLabelProps:q,SelectProps:z,sx:X,className:$},_)=>{let V=Jt.useId(),B=y??`orb-tf-${V}`,Z=A??O?.startAdornment,Q=N??O?.endAdornment,se=(typeof g=="string"?g:void 0)??x,be={id:B,className:`orb-inp ${h||C==="small"?"orb-inp-dense":""}`,style:P?void 0:{width:"auto"},value:r,defaultValue:o,onChange:n,onFocus:a,onBlur:i,onKeyDown:s,placeholder:d,disabled:p,required:f,autoFocus:b,autoComplete:m,name:v,onClick:I,"aria-invalid":!!g},_e=w?e("select",{...be,ref:_,onChange:n,children:S}):k?e("textarea",{...be,ref:_,onChange:n,rows:R,readOnly:u||O?.readOnly}):e("input",{...be,ref:_,onChange:n,type:l,readOnly:u||O?.readOnly,...F}),De=Ue(X,`orb-fld ${g?"orb-is-error":""} ${$??""}`,{width:P?"100%":void 0});return c("div",{className:De.className,style:De.style,children:[t&&e("label",{htmlFor:B,children:t}),Z||Q?c("div",{className:"orb-inp-adornment-wrap",children:[Z&&e("span",{className:"orb-inp-adornment",children:Z}),Q&&e("span",{className:"orb-inp-adornment orb-inp-adornment-end",children:Q}),_e]}):_e,se&&e("span",{className:"orb-fld-msg",children:se})]})});ze.displayName="CTextField";Gt();T();var zn=Jt.forwardRef(({label:t,value:r,defaultValue:o,onChange:n,placeholder:a,disabled:i,readOnly:s,rows:l,minRows:d=3,multiline:p,error:u,helperText:f,fullWidth:b=true,name:m,id:v,inputProps:y,sx:g,className:x},h)=>{let C=Jt.useId(),P=v??`orb-ta-${C}`,k=(typeof u=="string"?u:void 0)??f,R=Ue(g,`orb-fld ${u?"orb-is-error":""} ${x??""}`,{width:b?"100%":void 0});return c("div",{className:R.className,style:R.style,children:[t&&e("label",{htmlFor:P,children:t}),e("textarea",{ref:h,id:P,className:"orb-inp",value:r,defaultValue:o,onChange:n,placeholder:a,disabled:i,readOnly:s,rows:l??d,name:m,"aria-invalid":!!u,...y}),k&&e("span",{className:"orb-fld-msg",children:k})]})});zn.displayName="CTextArea";Gt();T();var Wt=Jt.forwardRef(({label:t,options:r,children:o,value:n,defaultValue:a,onChange:i,disabled:s,size:l,dense:d=true,fullWidth:p=true,minWidth:u,placeholder:f,displayEmpty:b,renderValue:m,multiple:v,MenuProps:y,variant:g,disableUnderline:x,onClick:h,onMouseDown:C,error:P,helperText:w,name:k,id:R,"aria-label":S,sx:E,className:D},I)=>{let A=Jt.useId(),N=R??`orb-sel-${A}`,F=(typeof P=="string"?P:void 0)??w,q=Jt.useRef(null),z=Jt.useRef(null),[X,$]=Jt.useState(false),[_,V]=Jt.useState(180),[B,Z]=Jt.useState(a??"");Jt.useImperativeHandle(I,()=>q.current);let Q=Jt.useMemo(()=>Jt.Children.toArray(o).flatMap(Te=>{if(!Jt.isValidElement(Te)||Te.type!=="option")return [];let xe=Te;return [{value:Array.isArray(xe.props.value)?xe.props.value[0]??"":xe.props.value??"",label:xe.props.children,disabled:xe.props.disabled}]}),[o]),ge=r??Q,se=n??B,le=Array.isArray(se)?se[0]??"":se,be=String(le??""),_e=ge.find(Te=>String(Te.value)===be),De=m?m(se):_e?.label??(be||(f??"")),Pe=Ue(E,`orb-fld ${P?"orb-is-error":""} ${D??""}`,{width:p?"100%":void 0,minWidth:typeof u=="number"?`${u}px`:u});if(v)return c("div",{className:Pe.className,style:Pe.style,children:[t&&e("label",{htmlFor:N,children:t}),c("select",{ref:I,id:N,className:`orb-inp ${d||l==="small"?"orb-inp-dense":""}`,value:n,defaultValue:a,onChange:i,disabled:s,name:k,multiple:true,onClick:h,onMouseDown:C,"aria-invalid":!!P,"aria-label":S,children:[f!==void 0&&e("option",{value:"",children:f}),r?r.map(Te=>e("option",{value:Te.value,disabled:Te.disabled,children:Te.label},Te.value)):o]}),F&&e("span",{className:"orb-fld-msg",children:F})]});let Ve=Te=>{n===void 0&&Z(Te);let xe=q.current;xe&&(Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value")?.set?.call(xe,Te),i?.({target:xe,currentTarget:xe}));};return c("div",{className:Pe.className,style:Pe.style,children:[t&&e("label",{htmlFor:N,children:t}),e("select",{ref:q,className:"orb-visually-hidden",tabIndex:-1,"aria-hidden":"true",name:k,value:be,disabled:s,onChange:()=>{},children:ge.map(Te=>e("option",{value:Te.value,disabled:Te.disabled,children:Te.label},String(Te.value)))}),c(Nr__namespace.Root,{open:X,onOpenChange:Te=>{Te&&V(z.current?.getBoundingClientRect().width??180),$(Te);},children:[e(Nr__namespace.Trigger,{asChild:true,children:c("button",{ref:z,id:N,type:"button",className:`orb-inp orb-select-trigger ${d||l==="small"?"orb-inp-dense":""}`,disabled:s,"aria-invalid":!!P,"aria-label":S,"aria-haspopup":"listbox","data-placeholder":!_e&&!be?"":void 0,onClick:h,onMouseDown:C,children:[e("span",{className:"orb-select-value",children:De}),e(Mt,{className:"orb-select-chevron",name:"slimDown",size:12})]})}),e(Nr__namespace.Portal,{children:e(Nr__namespace.Content,{className:"orb-pop orb-select-menu",align:"start",sideOffset:5,collisionPadding:8,style:{minWidth:_},children:e(Nr__namespace.RadioGroup,{value:be,onValueChange:Ve,children:ge.map(Te=>c(Nr__namespace.RadioItem,{className:"orb-select-option",value:String(Te.value),disabled:Te.disabled,children:[e("span",{className:"orb-select-check","aria-hidden":"true",children:String(Te.value)===be?e(Mt,{name:"accept",size:13}):null}),e("span",{children:Te.label})]},String(Te.value)))})})})]}),F&&e("span",{className:"orb-fld-msg",children:F})]})});Wt.displayName="CSelect";Gt();T();var Dt=Jt.forwardRef(({label:t,checked:r,defaultChecked:o,onChange:n,disabled:a,indeterminate:i,name:s,value:l,id:d,size:p,color:u,onClick:f,inputProps:b,sx:m,className:v},y)=>{let g=Ue([{...p==="small"?{fontSize:13}:void 0,...u?{color:u}:void 0},...Array.isArray(m)?m:m?[m]:[]],`orb-chk ${v??""}`),x=e("input",{ref:h=>{h&&(h.indeterminate=!!i),typeof y=="function"?y(h):y&&(y.current=h);},type:"checkbox",id:d,checked:r,defaultChecked:o,onChange:n,readOnly:r!==void 0&&n===void 0,disabled:a,name:s,value:l,onClick:f,...b});return t==null?e("span",{className:g.className,style:g.style,children:x}):c("label",{className:g.className,style:g.style,children:[x,e("span",{children:t})]})});Dt.displayName="CCheckbox";T();var bf=({label:t,options:r,value:o,defaultValue:n,onChange:a,name:i,row:s=false,disabled:l,sx:d,className:p})=>{let u=Jt.useId(),f=i??`orb-rdo-${u}`;return c("div",{className:`orb-fld ${p??""}`,style:d,role:"radiogroup",children:[t&&e("span",{className:"orb-fld-label",children:t}),e("div",{style:{display:"flex",flexDirection:s?"row":"column",gap:s?24:8,flexWrap:"wrap"},children:r.map(b=>c("label",{className:"orb-rdo",children:[e("input",{type:"radio",name:f,value:b.value,checked:o!==void 0?o===b.value:void 0,defaultChecked:n!==void 0?n===b.value:void 0,onChange:a?m=>a(m,b.value):void 0,disabled:l||b.disabled}),e("span",{children:b.label})]},b.value))})]})};Gt();T();var za=Jt.forwardRef(({label:t,checked:r,defaultChecked:o,onChange:n,disabled:a,name:i,id:s,size:l,sx:d,className:p},u)=>{let f=Ue([{...l==="small"?{transform:"scale(.86)",transformOrigin:"center"}:void 0},...Array.isArray(d)?d:d?[d]:[]],`orb-sw ${p??""}`),b=e("input",{ref:u,type:"checkbox",role:"switch",id:s,checked:r,defaultChecked:o,onChange:n?m=>n(m,m.target.checked):void 0,disabled:a,name:i});return t==null?e("span",{className:f.className,style:f.style,children:b}):c("label",{className:f.className,style:f.style,children:[b,e("span",{children:t})]})});za.displayName="CSwitch";Gt();T();var yf={default:"gray",primary:"blue",success:"blue",info:"blue",warning:"orange",error:"orange"},Pt=Jt.forwardRef(({label:t,children:r,tone:o,color:n="default",variant:a,size:i="medium",clickable:s,avatar:l,icon:d,onDelete:p,onClick:u,sx:f,className:b},m)=>{let v=o??(a==="outlined"&&n==="default"?"outline":yf[n]??"gray"),y=s??!!u,g=Ue([{cursor:y?"pointer":void 0,...i==="small"?{height:24,fontSize:11,px:1}:void 0},...Array.isArray(f)?f:f?[f]:[]],`orb-chip orb-chip-${v} ${b??""}`);return c("span",{ref:m,className:g.className,style:g.style,onClick:u,role:y?"button":void 0,tabIndex:y?0:void 0,onKeyDown:y?x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),u?.(x));}:void 0,children:[l??d,e("span",{className:"orb-chip-label",children:r??t}),p&&e("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:e(Zt,{size:13,strokeWidth:2})})]})});Pt.displayName="CChip";Gt();T();var Va=Jt.forwardRef(({badgeContent:t,color:r="primary",children:o,invisible:n=false,sx:a,className:i},s)=>{let l=Ue(a,i,{display:"inline-flex",position:o?"relative":void 0}),d=!n&&t!==void 0&&t!==null&&e("span",{className:`orb-badge ${r==="error"?"orb-badge-err":r==="muted"?"orb-badge-muted":""}`,style:o?{position:"absolute",top:-6,right:-6,zIndex:1}:void 0,children:t});return o?c("span",{ref:s,className:l.className,style:l.style,children:[o,d]}):e("span",{ref:s,className:l.className,style:l.style,children:d})});Va.displayName="CBadge";Gt();T();var en=Jt.forwardRef(({children:t,src:r,alt:o,size:n=28,sx:a,className:i},s)=>{let l=Ue([{width:n,height:n,fontSize:n*.4},...Array.isArray(a)?a:a?[a]:[]],`orb-avatar ${i??""}`);return e("span",{ref:s,className:l.className,style:l.style,children:r?e("img",{src:r,alt:o??"",style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover"}}):t})});en.displayName="CAvatar";Gt();T();var tn=Jt.forwardRef(({severity:t="info",title:r,children:o,onClose:n,sx:a,className:i},s)=>{let l=Ue(a,`orb-alert orb-alert-${t} ${i??""}`);return c("div",{ref:s,role:"alert",className:l.className,style:l.style,children:[c("div",{style:{flex:1,minWidth:0},children:[r&&e("b",{children:r}),o&&e("span",{children:o})]}),n&&e("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";Gt();T();var Vn=({value:t,variant:r,color:o,sx:n,className:a})=>{let i=r==="indeterminate"||t===void 0,s=Ue(n,`orb-prog ${a??""}`);return c("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:[e("i",{style:i?{width:"40%",animation:"orb-prog-ind 1.2s ease-in-out infinite"}:{width:`${Math.min(100,Math.max(0,t))}%`,background:o}}),i&&e("style",{children:"@keyframes orb-prog-ind { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }"})]})},wf=({width:t,height:r=14,variant:o="rectangular",sx:n,className:a})=>e("div",{className:`orb-skel ${a??""}`,style:{width:t,height:r,borderRadius:o==="circular"?"50%":o==="text"?6:"var(--orb-r)",...n}}),Xr=({size:t=12,onPrimary:r=false,sx:o,className:n})=>e("span",{className:`orb-spin ${r?"orb-spin-light":""} ${n??""}`,style:{width:t,height:t,...o},role:"status","aria-label":"Loading"});T();var lt=({title:t,children:r,enterDelay:o=300,side:n="top",align:a="center",disabled:i})=>!t||i?e(jsxRuntime.Fragment,{children:r}):e(Yr__namespace.Provider,{delayDuration:o,skipDelayDuration:200,children:c(Yr__namespace.Root,{children:[e(Yr__namespace.Trigger,{asChild:true,children:r}),e(Yr__namespace.Portal,{children:e(Yr__namespace.Content,{className:"orb-tooltip",side:n,align:a,sideOffset:6,children:t})})]})});Gt();T();var ae=Jt.forwardRef(({tooltip:t,size:r="small",active:o=false,edge:n,color:a,sx:i,className:s,children:l,type:d="button",...p},u)=>{let f=Ue([{color:o?"var(--orb-primary)":a,...n==="start"?{marginLeft:-8}:n==="end"?{marginRight:-8}:void 0},...Array.isArray(i)?i:i?[i]:[]],`orb-icon-btn ${r==="small"?"orb-icon-btn-sm":""} ${s??""}`),b=e("button",{ref:u,type:d,className:f.className,style:f.style,...p,children:l});return t?e(lt,{title:t,children:b}):b});ae.displayName="CIconButton";Gt();T();var Wn=({value:t,options:r,onValueChange:o,size:n="medium",sx:a,className:i,...s})=>{let l=Jt.useRef([]),d=r.findIndex(m=>!m.disabled),p=r.findIndex(m=>m.value===t),u=(m,v)=>{let y=r.map((h,C)=>h.disabled?-1:C).filter(h=>h>=0);if(y.length===0)return;let g=y.indexOf(v),x;m.key==="Home"&&(x=y[0]),m.key==="End"&&(x=y[y.length-1]),(m.key==="ArrowRight"||m.key==="ArrowDown")&&(x=y[(g+1+y.length)%y.length]),(m.key==="ArrowLeft"||m.key==="ArrowUp")&&(x=y[(g-1+y.length)%y.length]),x!==void 0&&(m.preventDefault(),l.current[x]?.focus(),o(r[x].value));},f=Ue(a,["orb-segmented-control",n==="small"?"orb-segmented-control-sm":"",i].filter(Boolean).join(" ")),b={...f.style,"--orb-segmented-count":Math.max(r.length,1),"--orb-segmented-index":Math.max(p,0)};return c("div",{role:"radiogroup",className:f.className,style:b,"data-has-selection":p>=0?"true":"false",...s,children:[e("span",{className:"orb-segmented-control-thumb","aria-hidden":"true"}),r.map((m,v)=>{let y=m.value===t;return e(ae,{ref:g=>{l.current[v]=g;},className:["orb-segmented-control-item",m.icon?"":"orb-segmented-control-item-label"].filter(Boolean).join(" "),size:n,tooltip:m.label,role:"radio","aria-label":m.label,"aria-checked":y,"data-selected":y?"true":void 0,disabled:m.disabled,tabIndex:y||t==null&&v===d?0:-1,onClick:()=>o(m.value),onKeyDown:g=>u(g,v),children:m.icon??e("span",{className:"orb-segmented-control-label",children:m.label})},m.value)})]})};Gt();T();var jt=({triggerLabel:t,items:r=[],trigger:o,align:n="start",anchorEl:a,open:i,onClose:s,children:l,slotProps:d,PaperProps:p,anchorPosition:u,sx:f})=>{let b=Jt.useRef(null);if(Jt.useEffect(()=>{if(i!==true)return;let m=y=>{let g=y.composedPath();b.current&&g.includes(b.current)||a&&g.includes(a)||s?.();},v=y=>{y.key==="Escape"&&s?.();};return document.addEventListener("pointerdown",m,true),document.addEventListener("keydown",v,true),()=>{document.removeEventListener("pointerdown",m,true),document.removeEventListener("keydown",v,true);}},[a,s,i]),i!==void 0){if(!i||typeof document>"u")return null;let m=a?.getBoundingClientRect(),v=window.innerWidth,y=m?.left??16,g=m?.right??y,x=d?.paper?.sx??p?.sx,h=Ue([...Array.isArray(x)?x:x?[x]:[],...Array.isArray(f)?f:f?[f]:[]],"orb-pop orb-menu",d?.paper?.style??p?.style),C=Jt.Children.map(l,P=>{if(!Jt.isValidElement(P)||P.type!=="option")return P;let w=P.props,{children:k,disabled:R,selected:S}=w,E=Ue(w.sx,`orb-menu-item ${S?"orb-selected":""} ${w.className??""}`,w.style);return e("div",{role:"menuitem","aria-disabled":R||void 0,"aria-selected":S||void 0,tabIndex:R?-1:0,id:w.id,title:w.title,className:E.className,style:E.style,onClick:R?void 0:w.onClick,onKeyDown:D=>{!R&&(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),w.onClick?.(D));},children:k})});return reactDom.createPortal(e("div",{ref:b,role:"menu",className:h.className,style:{...h.style,position:"fixed",left:n==="end"&&!u?void 0:u?.left??y,right:n==="end"&&!u?Math.max(16,v-g):void 0,top:u?.top??(m?.bottom??16)+6,maxWidth:"calc(100vw - 32px)",zIndex:1301},children:C}),document.body)}return c(Nr__namespace.Root,{children:[e(Nr__namespace.Trigger,{asChild:true,children:o??e(Ce,{variant:"primary",children:t})}),e(Nr__namespace.Portal,{children:e(Nr__namespace.Content,{className:"orb-pop orb-menu",align:n,sideOffset:6,children:r.map((m,v)=>c(Nr__namespace.Item,{className:"orb-menu-item",disabled:m.disabled,onSelect:()=>m.onClick?.(),children:[m.icon,m.label]},v))})})]})};Gt();T();var Ee=Jt.forwardRef(({elevation:t=1,variant:r,component:o,sx:n,style:a,className:i,children:s,...l},d)=>{let p=o??"div",u=Ue(n,`orb-card ${t>0&&r!=="outlined"?"orb-card-raised":""} ${i??""}`,a);return e(p,{ref:d,className:u.className,style:u.style,...l,children:s})});Ee.displayName="CPaper";Gt();T();var At=Jt.forwardRef(({orientation:t="horizontal",flexItem:r,sx:o,className:n},a)=>{let i=Ue([{...t==="vertical"?{alignSelf:"stretch",height:"auto"}:{width:"100%"},...r?{alignSelf:"stretch"}:void 0},...Array.isArray(o)?o:o?[o]:[]],`${t==="vertical"?"orb-divider-v":"orb-divider"} ${n??""}`);return e("hr",{ref:a,"aria-orientation":t,className:i.className,style:i.style})});At.displayName="CDivider";Gt();T();var Lf={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"},Of={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6"},L=Jt.forwardRef(({variant:t="body1",component:r,muted:o=false,numeric:n=false,color:a,noWrap:i=false,fontWeight:s,sx:l,className:d,children:p,...u},f)=>{let b=r??Of[t]??"span",v=[t==="inherit"?void 0:Lf[t],d].filter(Boolean).join(" "),y=Ue([{...o?{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]:[]],v);return e(b,{ref:f,className:y.className,style:y.style,...u,children:p})});L.displayName="CTypography";Gt();T();var Bf=t=>{if(t!==void 0)return typeof t=="number"?`${t*8}px`:t},ie=Jt.forwardRef(({direction:t="column",spacing:r,alignItems:o,justifyContent:n,flexWrap:a,flex:i,useFlexGap:s,sx:l,className:d,children:p,...u},f)=>{let b=Ue([{display:"flex",flexDirection:t,gap:Bf(r),alignItems:o,justifyContent:n,flexWrap:a,flex:i},...Array.isArray(l)?l:l?[l]:[]],d);return e("div",{ref:f,className:b.className,style:b.style,...u,children:p})});ie.displayName="CStack";Gt();T();var zt=({open:t,onClose:r,title:o,children:n,actions:a,maxWidth:i=560,fullWidth:s=false,fullScreen:l=false,PaperProps:d,slotProps:p,disableRestoreFocus:u,keepMounted:f,hideCloseButton:b=false,sx:m,className:v})=>{let y=Ue([{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?.sx??p?.paper?.sx)?d?.sx??p?.paper?.sx:d?.sx??p?.paper?.sx?[d?.sx??p?.paper?.sx]:[],...Array.isArray(m)?m:m?[m]:[]],`orb-dialog ${v??""}`);return e(wr__namespace.Root,{open:t,onOpenChange:g=>{g||r?.();},children:c(wr__namespace.Portal,{children:[e(wr__namespace.Overlay,{className:"orb-overlay"}),c(wr__namespace.Content,{className:y.className,style:y.style,children:[(o||!b)&&c("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:16},children:[o?e(wr__namespace.Title,{className:"orb-dialog-title",children:o}):e(wr__namespace.Title,{className:"orb-visually-hidden",children:"Dialog"}),!b&&e(wr__namespace.Close,{asChild:true,children:e("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Close",style:{marginTop:-4,marginRight:-4},children:e(Zt,{size:16,strokeWidth:2})})})]}),e("div",{style:{minWidth:0},children:n}),a&&e("div",{className:"orb-dialog-actions",children:a})]})]})})};T();var zs=({open:t,defaultOpen:r,onOpenChange:o,trigger:n,children:a,align:i="start",side:s="bottom",sideOffset:l=6,matchTriggerWidth:d=false,sx:p,className:u})=>c(vo__namespace.Root,{open:t,defaultOpen:r,onOpenChange:o,children:[e(vo__namespace.Trigger,{asChild:true,children:n}),e(vo__namespace.Portal,{children:e(vo__namespace.Content,{className:`orb-pop ${u??""}`,align:i,side:s,sideOffset:l,style:{minWidth:d?"var(--radix-popover-trigger-width)":void 0,...p},onOpenAutoFocus:f=>f.preventDefault(),children:a})})]});T();var Vf=({items:t,value:r,defaultValue:o,onChange:n,sx:a,className:i})=>{let s=r!==void 0,[l,d]=Jt.useState(o??t[0]?.value),p=s?r:l,u=Jt.useRef([]),f=m=>{s||d(m),n?.(m);},b=m=>{if(m.key!=="ArrowRight"&&m.key!=="ArrowLeft")return;m.preventDefault();let v=t.filter(h=>!h.disabled),y=v.findIndex(h=>h.value===p),g=m.key==="ArrowRight"?1:-1,x=v[(y+g+v.length)%v.length];if(x){f(x.value);let h=t.findIndex(C=>C.value===x.value);u.current[h]?.focus();}};return e("div",{className:`orb-tabs ${i??""}`,role:"tablist",style:a,onKeyDown:b,children:t.map((m,v)=>{let y=m.value===p;return c("button",{ref:g=>{u.current[v]=g;},type:"button",role:"tab","aria-selected":y,disabled:m.disabled,className:`orb-tab ${y?"orb-is-active":""}`,style:{display:"inline-flex",alignItems:"center",gap:6},onClick:()=>f(m.value),children:[m.icon,m.label]},m.value)})})};T();var $f=["su","mo","tu","we","th","fr","sa"],$n=(t,r)=>!!(t&&r&&t.isSame(r,"day")),Gn=({value:t,rangeStart:r,rangeEnd:o,onChange:n,month:a,defaultMonth:i,onMonthChange:s,minDate:l,maxDate:d,locale:p,renderDay:u})=>{let f=a!==void 0,[b,m]=Jt.useState(()=>i??t??r??ro__default.default()),v=(f?a:b).startOf("month"),y=w=>{f||m(w),s?.(w);},g=Jt.useMemo(()=>p?v.locale(p):v,[v,p]),x=Jt.useMemo(()=>{let k=v.startOf("month").startOf("week"),R=[],S=k;for(let E=0;E<6;E+=1){let D=[];for(let I=0;I<7;I+=1)D.push(S),S=S.add(1,"day");if(R.push(D),S.isAfter(v.endOf("month"))&&E>=3)break}return R},[v]),h=Jt.useMemo(()=>{let w=p?ro__default.default().locale(p):ro__default.default();return $f.map((k,R)=>w.startOf("week").add(R,"day").format("dd"))},[p]),C=w=>!!(l&&w.isBefore(l.startOf("day"))||d&&w.isAfter(d.startOf("day"))),P=r!==void 0||o!==void 0;return c("div",{className:"orb-cal",children:[c("div",{className:"orb-cal-head",children:[e("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Previous month",onClick:()=>y(v.subtract(1,"month")),children:e(Ta,{size:16,strokeWidth:2})}),e("span",{className:"orb-cal-title","aria-live":"polite",children:g.format("MMMM YYYY")}),e("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Next month",onClick:()=>y(v.add(1,"month")),children:e(Br,{size:16,strokeWidth:2})})]}),c("div",{className:"orb-cal-grid",role:"grid",children:[h.map((w,k)=>e("span",{className:"orb-cal-dow",children:w},`${w}-${k}`)),x.flat().map(w=>{let k=!w.isSame(v,"month"),R=C(w),S=P?$n(w,r)||$n(w,o):$n(w,t),E=w.isSame(ro__default.default(),"day"),D=P&&r&&o&&w.isAfter(r.startOf("day"))&&w.isBefore(o.startOf("day")),I=P&&$n(w,r)&&!!o,A=P&&$n(w,o)&&!!r,N=["orb-cal-day",k?"orb-is-outside":void 0,E?"orb-is-today":void 0,S?"orb-is-selected":void 0,D?"orb-is-in-range":void 0,I?"orb-is-range-start":void 0,A?"orb-is-range-end":void 0].filter(Boolean).join(" ");return u?e("span",{className:"orb-cal-day-slot",children:u(w,{outsideCurrentMonth:k,selected:S,today:E,disabled:R})},w.format("YYYY-MM-DD")):e("button",{type:"button",role:"gridcell","aria-selected":S,"aria-current":E?"date":void 0,className:N,disabled:R,onClick:()=>n?.(w),children:w.date()},w.format("YYYY-MM-DD"))})]})]})};T();ro__default.default.extend(Gf__default.default);var _f=({label:t,value:r,defaultValue:o,onChange:n,minDate:a,maxDate:i,disabled:s,format:l="YYYY-MM-DD",placeholder:d,locale:p,dense:u=false,error:f,helperText:b,sx:m,className:v})=>{let y=r!==void 0,[g,x]=Jt.useState(o??null),h=y?r:g,[C,P]=Jt.useState(false),[w,k]=Jt.useState(null),R=A=>{y||x(A),n?.(A);},S=w??(h?(p?h.locale(p):h).format(l):""),E=()=>{if(w===null)return;let A=w.trim();if(!A)R(null);else {let N=ro__default.default(A,l,true);N.isValid()&&!(a&&N.isBefore(a.startOf("day")))&&!(i&&N.isAfter(i.startOf("day")))&&R(N);}k(null);},I=(typeof f=="string"?f:void 0)??b;return c("div",{className:`orb-fld ${f?"orb-is-error":""} ${v??""}`,style:m,children:[t&&e("label",{children:t}),e(zs,{open:C,onOpenChange:P,trigger:c("div",{className:"orb-inp-adornment-wrap",style:{width:"100%"},children:[e("span",{className:"orb-inp-adornment",children:e(Os,{size:15,strokeWidth:1.8})}),e("input",{className:`orb-inp ${u?"orb-inp-dense":""}`,value:S,placeholder:d??l,disabled:s,onFocus:()=>P(true),onChange:A=>k(A.target.value),onBlur:E,onKeyDown:A=>{A.key==="Enter"&&(E(),P(false)),A.key==="Escape"&&P(false);}})]}),children:e(Gn,{value:h,onChange:A=>{R(A),k(null),P(false);},minDate:a,maxDate:i,locale:p,defaultMonth:h??void 0})}),I&&e("span",{className:"orb-fld-msg",children:I})]})};T();var Kf=({onFilesSelected:t,multiple:r=false,accept:o="*",maxSize:n,title:a="Drag and drop files here or click to upload",subtitle:i="Support for bulk upload",sx:s})=>{let[l,d]=Jt.useState(false),[p,u]=Jt.useState([]),f=Jt.useRef(null),b=h=>{h.preventDefault(),d(true);},m=h=>{h.preventDefault(),d(false);},v=h=>{h.preventDefault(),d(false),g(Array.from(h.dataTransfer.files));},y=h=>{h.target.files&&g(Array.from(h.target.files));},g=h=>{let C=n?h.filter(w=>w.size<=n):h;C.length<h.length&&console.warn(`Some files were rejected because they exceed the maximum size of ${n} bytes.`);let P=r?[...p,...C]:C;r&&(P=P.filter((w,k,R)=>k===R.findIndex(S=>S.name===w.name&&S.size===w.size&&S.lastModified===w.lastModified))),u(P),t?.(P),f.current&&(f.current.value="");},x=h=>{let C=p.filter((P,w)=>w!==h);u(C),t?.(C);};return c("div",{style:{width:"100%",...s},children:[c("div",{onClick:()=>f.current?.click(),onDragOver:b,onDragLeave:m,onDrop:v,role:"button",tabIndex:0,onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),f.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:[e("input",{type:"file",ref:f,style:{display:"none"},multiple:r,accept:o,onChange:y}),c("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[e(Kc,{size:40,strokeWidth:1.5,color:l?"var(--orb-primary)":"var(--orb-muted)"}),e("span",{className:"orb-subtitle",children:a}),e("span",{className:"orb-meta",children:i})]})]}),p.length>0&&e("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:16},children:p.map((h,C)=>c("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:[c("div",{style:{display:"flex",alignItems:"center",gap:8,overflow:"hidden"},children:[e(Rc,{size:16,strokeWidth:1.8,color:"var(--orb-muted)"}),e("span",{className:"orb-body-dense",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:h.name}),c("span",{className:"orb-meta",children:["(",(h.size/1024).toFixed(1)," KB)"]})]}),e(ae,{"aria-label":`Remove ${h.name}`,onClick:()=>x(C),children:e(_c,{size:15,strokeWidth:1.8})})]},`${h.name}-${C}`))})]})};function fr(...t){return tailwindMerge.twMerge(clsx.clsx(t))}var $a={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"},_n={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},jc=()=>"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";T();var jf=classVarianceAuthority.cva(jc(),{variants:{variant:{default:`${$a.primary} shadow-sm`,destructive:"bg-[var(--orb-status-error)] text-[var(--orb-on-primary)] hover:opacity-90 active:opacity-80 shadow-sm",outline:`${$a.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:$a.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:_n.none,sm:_n.sm,md:_n.md,full:_n.full}},defaultVariants:{variant:"default",size:"default",rounded:"md"}}),$s=Jt__namespace.forwardRef(({className:t,variant:r,size:o,asChild:n=false,...a},i)=>e(n?reactSlot.Slot:"button",{className:fr(jf({variant:r,size:o,className:t})),ref:i,...a}));$s.displayName="Button";var Qf={"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.searchSend":"Send","header.searchStartVoice":"Start voice input","header.searchStopVoice":"Stop voice input","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"},Jf={"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.searchSend":"\u53D1\u9001","header.searchStartVoice":"\u5F00\u59CB\u8BED\u97F3\u8F93\u5165","header.searchStopVoice":"\u505C\u6B62\u8BED\u97F3\u8F93\u5165","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"},eb={"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.searchSend":"Envoyer","header.searchStartVoice":"D\xE9marrer la saisie vocale","header.searchStopVoice":"Arr\xEAter la saisie vocale","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"},tb={"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.searchSend":"Senden","header.searchStartVoice":"Spracheingabe starten","header.searchStopVoice":"Spracheingabe stoppen","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"},rb={"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.searchSend":"\u9001\u4FE1","header.searchStartVoice":"\u97F3\u58F0\u5165\u529B\u3092\u958B\u59CB","header.searchStopVoice":"\u97F3\u58F0\u5165\u529B\u3092\u505C\u6B62","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"},ob={"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.searchSend":"\uBCF4\uB0B4\uAE30","header.searchStartVoice":"\uC74C\uC131 \uC785\uB825 \uC2DC\uC791","header.searchStopVoice":"\uC74C\uC131 \uC785\uB825 \uC911\uC9C0","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"},Un={en:Qf,zh:Jf,fr:eb,de:tb,ja:rb,ko:ob};T();var Jc=(t,r)=>r?t.replace(/\{(\w+)\}/g,(o,n)=>{let a=r[n];return a==null?"":String(a)}):t,sb={locale:"en",t:(t,r)=>Jc(Un.en[t]||t,r)},ed=Jt.createContext(sb),Ga=({locale:t="en",messages:r,children:o})=>{let n=Jt.useMemo(()=>{let a=Un[t]||Un.en,i=r?.[t]||{},s={...Un.en,...a,...i};return {locale:t,t:(l,d)=>Jc(s[l]||l,d)}},[t,r]);return e(ed.Provider,{value:n,children:o})},pe=()=>Jt.useContext(ed);T();function Kn({items:t,onItemClick:r,className:o="",level:n=0,expandedIds:a,onToggleExpand:i,colorMode:s="light",enablePinning:l=false,pinnedIds:d,onTogglePin:p}){let{t:u}=pe(),f=s==="dark",b=navigation.usePathname(),[m,v]=Jt.useState(false),[y,g]=Jt.useState(new Set),x=a!==void 0&&i!==void 0,h=x?a:y;Jt.useEffect(()=>{v(true);},[]);let C=w=>{if(x)i(w);else {let k=new Set(y);k.has(w)?k.delete(w):k.add(w),g(k);}},P=w=>{w.children&&w.children.length>0&&C(w.id),r&&r(w);};return !t||!Array.isArray(t)?e("div",{className:fr("tree-menu",o),children:e("div",{className:"text-sm text-[var(--orb-muted)] p-2",children:u("navigation.noItems")})}):e("div",{className:fr("tree-menu",o),children:t.map(w=>{let k=h.has(w.id)||w.isExpanded,R=w.children&&w.children.length>0,E=56+Math.max(0,n-1)*8,D=n===0?12:R?E-24:E,I=w.appurl||w.href,A=m&&I?b===I:false,N=d?.has(w.id)??false,O=l&&w.pinnable!==false&&!!I&&!R;return c("div",{className:"tree-menu-item relative",children:[A&&e("div",{className:fr("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10","bg-[var(--orb-nav-active-fg)]")}),c($s,{variant:"ghost",className:fr("w-full justify-start h-auto py-2 relative overflow-hidden group",n>0?"gap-1":"gap-2",R&&k&&!A?f?"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",A?f?"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)]":f?"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:`${D}px`,paddingRight:O?"34px":"10px"},onClick:()=>P(w),children:[R&&e("div",{className:fr("flex-shrink-0 transition-transform duration-200",k&&"rotate-90",A?"text-[var(--orb-nav-active-fg)]":f?"text-[var(--orb-muted)] group-hover:text-[var(--orb-fg)]":"text-[var(--orb-muted)] group-hover:text-[var(--orb-muted)]"),children:e(Br,{className:"h-4 w-4"})}),w.icon&&e("div",{className:fr("flex h-4 w-4 flex-shrink-0 items-center justify-center transition-colors duration-200",A?"text-[var(--orb-nav-active-fg)]":f?"text-[var(--orb-muted)] group-hover:text-[var(--orb-fg)]":"text-[var(--orb-muted)] group-hover:text-[var(--orb-muted)]"),children:w.icon}),c("div",{className:"flex-1 text-left overflow-hidden z-10",children:[e("div",{className:fr("text-sm truncate transition-colors duration-200",A?"font-semibold":"font-medium"),children:w.title||w.label}),w.description&&e("div",{className:fr("text-xs truncate transition-colors duration-200",A?f?"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})]})]}),O&&p&&e("button",{type:"button","aria-label":u(N?"navigation.pin.remove":"navigation.pin.add"),"aria-pressed":N,title:u(N?"navigation.pin.remove":"navigation.pin.add"),onClick:F=>{F.preventDefault(),F.stopPropagation(),p(w);},className:fr("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",N&&"orb-is-pinned"),children:e(Qo,{className:fr("h-3.5 w-3.5",N&&"fill-current")})}),R&&e("div",{className:fr("grid transition-[grid-template-rows] duration-300 ease-in-out",k?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:e("div",{className:fr("overflow-hidden",k&&"pt-1"),children:e(Kn,{items:w.children,onItemClick:r,level:n+1,expandedIds:a,onToggleExpand:i,colorMode:s,enablePinning:l,pinnedIds:d,onTogglePin:p})})})]},w.id)})})}T();var pb="orbcafe:navigation-island:pinned-items",Gs="orbcafe-navigation-pinned",ub=t=>t.appurl||t.href,rd=t=>{let r=[];return t.forEach(o=>{let n=!!o.children?.length;o.pinnable!==false&&ub(o)&&!n&&r.push({...o,children:void 0}),o.children?.length&&r.push(...rd(o.children));}),r},od=({collapsed:t,onToggle:r,className:o="",maxHeight:n,menuData:a=[],colorMode:i="light",displayMode:s="fixed",onDisplayModeChange:l,showDisplayModeToggle:d=true,enablePinning:p=true,pinStorageKey:u=pb,pinnedItemIds:f,defaultPinnedItemIds:b=[],onPinnedItemIdsChange:m,pinnedSectionTitle:v})=>{let{t:y}=pe(),g=i==="dark",x=s==="floating",h=navigation.useRouter(),[C,P]=Jt.useState(""),[w,k]=Jt.useState(new Set),[R,S]=Jt.useState(b),[E,D]=Jt.useState(false),I=f!==void 0,A=Jt.useMemo(()=>f??R,[f,R]),N=Jt.useMemo(()=>new Set(A),[A]);Jt.useEffect(()=>{t&&k(new Set);},[t]),Jt.useEffect(()=>{if(!p||I){D(true);return}try{let B=window.localStorage.getItem(u);if(B){let Z=JSON.parse(B);Array.isArray(Z)&&S(Z.filter(Q=>typeof Q=="string"));}}catch{}finally{D(true);}},[p,I,u]),Jt.useEffect(()=>{if(!(!p||I||!E))try{window.localStorage.setItem(u,JSON.stringify(A));}catch{}},[A,p,I,u,E]),Jt.useEffect(()=>{!p||t||A.length===0||k(B=>{if(B.has(Gs))return B;let Z=new Set(B);return Z.add(Gs),Z});},[t,A.length,p]);let O=Jt.useCallback(B=>{let Z=Array.from(new Set(B));I||S(Z),m?.(Z);},[I,m]),F=Jt.useCallback(B=>{let Z=B.id,Q=N.has(Z)?A.filter(ge=>ge!==Z):[...A,Z];O(Q);},[A,N,O]),q=Jt.useMemo(()=>{if(!p||A.length===0)return a;let B=new Map(rd(a).map(Q=>[Q.id,Q])),Z=A.map(Q=>B.get(Q)).filter(Q=>!!Q);return Z.length===0?a:[{id:Gs,title:v||y("navigation.pinned"),icon:e(Qo,{className:"w-4 h-4"}),children:Z,pinnable:false},...a]},[A,p,a,v,y]),z=Jt.useCallback(B=>{let Z=[],Q=ge=>{ge.forEach(se=>{Z.push(se.id),se.children&&Q(se.children);});};return Q(B),Z},[]),X=Jt.useMemo(()=>{if(!C.trim())return q;let B=Z=>Z.reduce((Q,ge)=>{let se=ge.title?.toLowerCase().includes(C.toLowerCase())||ge.description?.toLowerCase().includes(C.toLowerCase()),le=ge.children?B(ge.children):[];return (se||le.length>0)&&Q.push({...ge,children:le.length>0?le:ge.children}),Q},[]);return B(q)},[C,q]),$=Jt.useMemo(()=>C.trim()?new Set(z(q)):w,[C,q,w,z]),_=Jt.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{h.push("/chat?new=true");}catch(Q){console.error("\u274C \u65E0\u6CD5\u8DF3\u8F6C\u5230\u65B0\u804A\u5929\u89C6\u56FE:",Q),h.push("/chat");}return}let Z=B.appurl||B.href;Z&&(Z.startsWith("http://")||Z.startsWith("https://")?window.open(Z,"_blank"):h.push(Z));},[h]),V=Jt.useCallback(()=>{l?.(s==="fixed"?"floating":"fixed");},[s,l]);return c("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 ${o} ${g?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?"rgba(8, 12, 18, 0.34)":"rgba(255, 255, 255, 0.24)":void 0,backgroundImage:x?g?"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?"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:[e("div",{className:`pt-4 pb-2 transition-all duration-500 ease-in-out ${t?"px-1":"px-2"}`,children:t?e("div",{className:"flex justify-center",children:e("button",{onClick:r,className:`w-10 h-10 flex items-center justify-center rounded-lg transition-colors duration-200 ${g?"text-[var(--orb-fg)] hover:bg-[var(--orb-surface-2)]":"text-[var(--orb-muted)] hover:bg-[var(--orb-surface)]"}`,title:y("navigation.expand"),children:e(Hr,{className:"h-5 w-5"})})}):c("div",{className:`relative transition-opacity duration-300 ${t?"opacity-0":"opacity-100 delay-200"}`,children:[e("input",{type:"text",placeholder:y("navigation.searchPlaceholder"),value:C,onChange:B=>P(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?"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)]"}`}),e("div",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 pointer-events-none",children:e(Hr,{className:"h-4 w-4 text-[var(--orb-muted)]"})})]})}),e("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:X.length===0?e("div",{className:"flex items-center justify-center py-8 text-[var(--orb-muted)] text-sm",children:t?e(Fn,{className:"h-5 w-5"}):y(C?"navigation.noMatch":"navigation.noAccessibleApp")}):c(jsxRuntime.Fragment,{children:[!t&&e("div",{className:`transition-opacity duration-300 ${t?"opacity-0":"opacity-100 delay-200"}`,children:e(Kn,{items:X,onItemClick:_,className:"space-y-1",expandedIds:$,colorMode:i,enablePinning:p,pinnedIds:N,onTogglePin:F,onToggleExpand:B=>{let Z=new Set(w);X.some(ge=>ge.id===B)?Z.has(B)?Z.delete(B):(X.forEach(ge=>{ge.id!==B&&Z.has(ge.id)&&Z.delete(ge.id);}),Z.add(B)):Z.has(B)?Z.delete(B):Z.add(B),k(Z);}})}),t&&e("div",{className:"space-y-2",children:q.map(B=>e("div",{className:"space-y-1",children:e("button",{onClick:()=>{r();let Z=new Set([B.id]);k(Z);},className:`w-full flex items-center justify-center p-2 rounded-lg cursor-pointer transition-colors duration-200 ${g?"text-[var(--orb-muted)] hover:bg-[var(--orb-surface-2)]":"text-[var(--orb-muted)] hover:bg-[var(--orb-surface)]"}`,title:y("navigation.expandView",{title:B.title||""}),children:B.icon||e("div",{className:`w-6 h-6 rounded text-xs flex items-center justify-center font-medium ${g?"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&&e("button",{onClick:r,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?"hover:bg-[color-mix(in_oklch,var(--orb-surface-2)_50%,transparent)]":"hover:bg-[color-mix(in_oklch,var(--orb-canvas)_20%,transparent)]"}`,title:y("navigation.collapse"),children:e("div",{className:"absolute",style:{bottom:"0px",right:"0px",width:"16px",height:"16px",overflow:"hidden"},children:e("div",{className:g?"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&&e("button",{type:"button",onClick:V,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?"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:y(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),"aria-label":y(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),children:x?e(Ea,{className:"h-4 w-4"}):e(La,{className:"h-4 w-4"})})]})};T();var gb="orbcafe:navigation-island:pinned-items",_s="orbcafe-navigation-pinned",nd=t=>t.appurl||t.href,ad=t=>t.flatMap(r=>{let o=!!r.children?.length,n=r.pinnable!==false&&nd(r)&&!o?[{...r,children:void 0}]:[];return r.children?.length?[...n,...ad(r.children)]:n}),id=t=>t.flatMap(r=>[r.id,...r.children?id(r.children):[]]),sd=(t,r)=>t.reduce((o,n)=>{let a=n.children?sd(n.children,r):[];return ([n.title,n.label,n.description].some(s=>s?.toLocaleLowerCase().includes(r))||a.length>0)&&o.push({...n,children:a.length>0?a:n.children}),o},[]),Us=({collapsed:t,onToggle:r,className:o="",maxHeight:n,menuData:a=[],colorMode:i="light",displayMode:s="fixed",onDisplayModeChange:l,showDisplayModeToggle:d=true,enablePinning:p=true,pinStorageKey:u=gb,pinnedItemIds:f,defaultPinnedItemIds:b=[],onPinnedItemIdsChange:m,pinnedSectionTitle:v})=>{let{t:y}=pe(),g=navigation.useRouter(),x=s==="floating",[h,C]=Jt.useState(""),[P,w]=Jt.useState(new Set),[k,R]=Jt.useState(b),[S,E]=Jt.useState(false),D=f!==void 0,I=f??k,A=Jt.useMemo(()=>new Set(I),[I]);Jt.useEffect(()=>{t&&w(new Set);},[t]),Jt.useEffect(()=>{if(!p||D){E(true);return}try{let B=window.localStorage.getItem(u);if(B){let Z=JSON.parse(B);Array.isArray(Z)&&R(Z.filter(Q=>typeof Q=="string"));}}catch{}finally{E(true);}},[p,D,u]),Jt.useEffect(()=>{if(!(!p||D||!S))try{window.localStorage.setItem(u,JSON.stringify(I));}catch{}},[I,p,D,u,S]),Jt.useEffect(()=>{!p||t||I.length===0||w(B=>{if(B.has(_s))return B;let Z=new Set(B);return Z.add(_s),Z});},[t,I.length,p]);let N=Jt.useCallback(B=>{let Z=Array.from(new Set(B));D||R(Z),m?.(Z);},[D,m]),O=Jt.useCallback(B=>{N(A.has(B.id)?I.filter(Z=>Z!==B.id):[...I,B.id]);},[I,A,N]),F=Jt.useMemo(()=>{if(!p||I.length===0)return a;let B=new Map(ad(a).map(Q=>[Q.id,Q])),Z=I.map(Q=>B.get(Q)).filter(Q=>!!Q);return Z.length===0?a:[{id:_s,title:v||y("navigation.pinned"),icon:e(Qo,{className:"h-4 w-4"}),children:Z,pinnable:false},...a]},[I,p,a,v,y]),q=h.trim().toLocaleLowerCase(),z=Jt.useMemo(()=>q?sd(F,q):F,[F,q]),X=Jt.useMemo(()=>q?new Set(id(z)):P,[P,z,q]),$=Jt.useCallback(B=>{w(Z=>{let Q=new Set(Z),ge=z.some(se=>se.id===B);return Q.has(B)?Q.delete(B):(ge&&z.forEach(se=>Q.delete(se.id)),Q.add(B)),Q});},[z]),_=Jt.useCallback(B=>{let Z=nd(B);Z&&(B.id==="chat"||B.appurl==="/chat"?g.push("/chat?new=true"):/^https?:\/\//.test(Z)?window.open(Z,"_blank","noopener,noreferrer"):g.push(Z));},[g]),V=B=>{r(),w(new Set([B.id]));};return c("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]"} ${o}`,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:[e("div",{className:`orb-navigation-island-v2-search ${t?"px-1":"px-2"}`,children:t?e("button",{type:"button",onClick:r,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:y("navigation.expand"),"aria-label":y("navigation.expand"),children:e(Hr,{className:"h-5 w-5"})}):c("label",{className:"relative block",children:[e("span",{className:"orb-visually-hidden",children:y("navigation.searchPlaceholder")}),e(Hr,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[var(--orb-muted)]"}),e("input",{type:"search",value:h,onChange:B=>C(B.target.value),placeholder:y("navigation.searchPlaceholder"),className:"w-full py-2 pl-10 pr-3 text-sm outline-none"})]})}),e("nav",{className:`min-h-0 flex-1 overflow-y-auto pb-2 ${t?"px-1":"px-2"}`,children:z.length===0?e("div",{className:"flex items-center justify-center py-8 text-sm text-[var(--orb-muted)]",children:t?e(Fn,{className:"h-5 w-5"}):y(q?"navigation.noMatch":"navigation.noAccessibleApp")}):t?e("div",{className:"space-y-1",children:F.map(B=>e("button",{type:"button",onClick:()=>V(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:y("navigation.expandView",{title:B.title||B.label||""}),children:B.icon||e(Fn,{className:"h-5 w-5"})},B.id))}):e(Kn,{items:z,onItemClick:_,className:"space-y-1",expandedIds:X,onToggleExpand:$,colorMode:i,enablePinning:p,pinnedIds:A,onTogglePin:O})}),d&&t&&e("div",{className:"orb-navigation-island-v2-footer flex flex-col items-center gap-1 border-t px-1 py-2",children:e("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:y(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),"aria-label":y(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),children:x?e(Ea,{className:"h-4 w-4"}):e(La,{className:"h-4 w-4"})})}),!t&&e("button",{type:"button",onClick:r,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:y("navigation.collapse"),"aria-label":y("navigation.collapse"),children:e("span",{"aria-hidden":"true",className:"absolute overflow-hidden",style:{bottom:0,right:0,width:16,height:16},children:e("span",{className:"absolute rounded-full border-[3px] border-[var(--orb-ai-accent)]",style:{width:32,height:32,top:-16,left:-16}})})})]})};Us.displayName="NavigationIsland2";var cd=(t={})=>{let{initialCollapsed:r=false,initialDisplayMode:o="fixed",content:n=[],enablePinning:a,pinStorageKey:i,pinnedItemIds:s,defaultPinnedItemIds:l,onPinnedItemIdsChange:d,pinnedSectionTitle:p}=t,[u,f]=Jt.useState(r),[b,m]=Jt.useState(o),[v,y]=Jt.useState(n),g=Jt.useCallback(()=>{f(C=>!C);},[]),x=Jt.useCallback(()=>{m(C=>C==="fixed"?"floating":"fixed");},[]),h=Jt.useMemo(()=>({collapsed:u,onToggle:g,menuData:v,displayMode:b,onDisplayModeChange:m,enablePinning:a,pinStorageKey:i,pinnedItemIds:s,defaultPinnedItemIds:l,onPinnedItemIdsChange:d,pinnedSectionTitle:p}),[u,g,v,b,m,a,i,s,l,d,p]);return {collapsed:u,setCollapsed:f,toggleCollapsed:g,displayMode:b,setDisplayMode:m,toggleDisplayMode:x,menuData:v,setMenuData:y,navigationIslandProps:h}};var qs=class{constructor(){dc(this,"listener",null);}register(r){this.listener=r;}unregister(){this.listener=null;}show(r,o,n){this.listener&&this.listener({type:r,content:o,options:n});}hide(){this.listener&&this.listener(null);}},ao=new qs,BP={success:(t,r)=>ao.show("success",t,r),error:(t,r)=>ao.show("error",t,r),warning:(t,r)=>ao.show("warning",t,r),info:(t,r)=>ao.show("info",t,r),show:(t,r,o)=>ao.show(t,r,o),hide:()=>ao.hide()};T();var bb={success:{icon:e(On,{size:40}),color:"var(--orb-success-bg)",iconColor:"var(--orb-success)"},warning:{icon:e(Ba,{size:40}),color:"var(--orb-warn-bg)",iconColor:"var(--orb-warn)"},error:{icon:e(Ia,{size:40}),color:"var(--orb-err-bg)",iconColor:"var(--orb-err)"},info:{icon:e(Ma,{size:40}),color:"var(--orb-info-bg)",iconColor:"var(--orb-info)"},default:{icon:null,color:"transparent",iconColor:"inherit"}},Yn=({open:t,title:r,message:o,onClose:n,onConfirm:a,confirmText:i,cancelText:s,showCancel:l=true,maxWidth:d="xs",type:p="default"})=>{let{t:u}=pe(),f=i||u("messageBox.confirm"),b=s||u("messageBox.cancel"),m=()=>{a?a():n();},v=bb[p],y=p!=="default";return c(zt,{open:t,onClose:n,maxWidth:d,sx:y?{borderTop:`6px solid ${v.iconColor}`}:void 0,children:[y&&e("div",{style:{display:"flex",justifyContent:"center",paddingTop:24,color:v.iconColor},children:v.icon}),r&&e("div",{className:"orb-dialog-title",style:{textAlign:y?"center":"left",paddingTop:y?8:16},children:r}),e("div",{className:"orb-dialog-content",style:{textAlign:y?"center":"left"},children:typeof o=="string"?e("p",{style:{margin:0,color:"var(--orb-muted)"},children:o}):o}),c("div",{className:"orb-dialog-actions",style:{display:"flex",justifyContent:y?"center":"flex-end",gap:8,paddingBottom:24,paddingLeft:24,paddingRight:24},children:[l&&e(Ce,{onClick:n,variant:"text",children:b}),e(Ce,{onClick:m,variant:"contained",color:y&&p==="error"?"error":"primary",autoFocus:true,children:f})]})]})},UP=()=>{let[t,r]=Jt__namespace.default.useState(null),[o,n]=Jt__namespace.default.useState(false);Jt__namespace.default.useEffect(()=>{let s=l=>{l?(r(l),n(true)):(n(false),r(null));};return ao.register(s),()=>ao.unregister()},[]);let a=()=>{n(false),t?.options?.onClose&&t.options.onClose(),r(null);},i=()=>{t?.options?.onConfirm&&t.options.onConfirm(),n(false),r(null);};return t?e(Yn,{open:o,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};T();var ZP=({status:t,showIcon:r=true})=>{let o="gray",n,a=t;return t==="OK"?(o="blue",n=e(On,{size:14,strokeWidth:2}),a="Success"):t==="Error"?(o="orange",n=e(Ia,{size:14,strokeWidth:2}),a="Error"):t==="Warning"&&(o="orange",n=e(Ba,{size:14,strokeWidth:2}),a="Warning"),e(Pt,{label:a,tone:o,icon:r&&n?n:void 0})};T();var JP=({dense:t,sx:r,className:o,children:n,...a})=>e("ul",{...a,className:o,style:{listStyle:"none",margin:0,padding:0,...r},children:n}),eT=({button:t,divider:r,sx:o,className:n,children:a,...i})=>e("li",{...i,className:n,style:{display:"flex",alignItems:"center",padding:"8px 16px",minHeight:40,borderBottom:r?"1px solid var(--orb-border)":void 0,cursor:t?"pointer":void 0,transition:"var(--orb-t-fast)",...o},onMouseEnter:t?s=>{s.currentTarget.style.background="var(--orb-hover)";}:void 0,onMouseLeave:t?s=>{s.currentTarget.style.background="";}:void 0,children:a}),tT=({sx:t,className:r,children:o,...n})=>e("button",{...n,type:"button",className:r,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:o}),rT=({children:t,sx:r})=>e("div",{style:{marginRight:16,display:"flex",alignItems:"center",minWidth:40,...r},children:t}),oT=({primary:t,secondary:r,sx:o})=>c("div",{style:{flex:1,minWidth:0,...o},children:[e("div",{className:"orb-body",style:{fontWeight:500},children:t}),r&&e("div",{className:"orb-meta",style:{marginTop:2},children:r})]}),nT=({sx:t,className:r,children:o,...n})=>e("li",{...n,className:r,style:{padding:"8px 16px",fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--orb-muted)",...t},children:o}),aT=({children:t,sx:r})=>e("div",{style:{marginRight:12,display:"flex",alignItems:"center",...r},children:t});T();var lT=({xs:t,md:r,lg:o,sx:n,children:a,className:i,...s})=>{let l=o?`span ${o}`:r?`span ${r}`:t?`span ${t}`:"span 12";return e("div",{...s,className:i,style:{gridColumn:l,minWidth:0,...n},children:a})};Gt();T();var Ar=rt,ir=(t,r)=>Jt.forwardRef(({component:o,sx:n,className:a,style:i,children:s,...l},d)=>{let p=o??t,u=Ue(n,[r,a].filter(Boolean).join(" "),i);return e(p,{ref:d,className:u.className,style:u.style,...l,children:s})}),ke=ir("div"),pd=ir("a","orb-link"),Fo=Ee,ud=ie,br=L;var md=ae;var gd=At,jr=tn,ja=en,Qa=Va;var Ja=za,fd=Xr,bd=({value:t,variant:r,color:o,sx:n})=>e(Vn,{value:r==="determinate"?t:void 0,color:o,sx:n}),hd=ir("table","orb-tbl"),vd=ir("tbody"),Zs=ir("td"),yd=ir("div","orb-table-container"),Cd=ir("thead"),js=ir("tr");ir("tfoot");ir("div","orb-dialog-title");ir("div","orb-dialog-content");ir("div","orb-dialog-actions");ir("p","orb-body-dense");var io=ir("span","orb-input-adornment"),xd=Jt.forwardRef(({sx:t,fullWidth:r,className:o,style:n,...a},i)=>{let s=Ue(t,["orb-input-base",o].filter(Boolean).join(" "),n);return e("input",{ref:i,className:s.className,style:{width:r?"100%":void 0,...s.style},...a})});var yo=ir("div","orb-form-control"),Zn=({control:t,label:r,...o})=>c("label",{className:"orb-form-control-label",...o,children:[t,e("span",{children:r})]}),Sb=({primary:t,secondary:r,children:o,primaryTypographyProps:n,secondaryTypographyProps:a,...i})=>c("span",{className:"orb-list-item-text",...i,children:[t??o,r?e("small",{children:r}):null]}),wb=ir("span","orb-list-item-icon"),_t=Sb,zr=wb;ir("div","orb-list-subheader");var Qs=({container:t,item:r,spacing:o,xs:n,sm:a,md:i,lg:s,xl:l,sx:d,...p})=>{let u={},f=b=>typeof b=="number"?`${b/12*100}%`:b?"100%":void 0;return n!==void 0&&(u.xs=f(n)),a!==void 0&&(u.sm=f(a)),i!==void 0&&(u.md=f(i)),s!==void 0&&(u.lg=f(s)),l!==void 0&&(u.xl=f(l)),e(ke,{...p,sx:{display:t?"flex":void 0,flexWrap:t?"wrap":void 0,gap:t&&o?o:void 0,width:r?u:void 0,...d??{}}})},rn=({in:t,children:r,unmountOnExit:o,...n})=>!t&&o?null:e("div",{hidden:!t,...n,children:r}),Sd=({children:t,container:r})=>typeof document>"u"?null:reactDom.createPortal(t,r??document.body),wd=ir("div","orb-toolbar"),kd=({active:t,direction:r="asc",children:o,sx:n,className:a,style:i,...s})=>{let l=Ue(n,["orb-table-sort-label",t?"orb-is-active":"",a].filter(Boolean).join(" "),i);return c("button",{type:"button",className:l.className,style:l.style,"data-direction":r,...s,children:[e("span",{className:"orb-table-sort-content",children:o}),e(Mt,{className:"orb-table-sort-icon",name:r==="desc"?"down":"up",size:11})]})},ei=({open:t,anchorEl:r,onClose:o,children:n,anchorOrigin:a,transformOrigin:i,slotProps:s,PaperProps:l,sx:d,className:p,style:u,...f})=>{let b=Jt.useRef(null);if(Jt.useEffect(()=>{if(!t)return;let x=C=>{let P=C.composedPath();b.current&&P.includes(b.current)||r&&P.includes(r)||o?.();},h=C=>{C.key==="Escape"&&o?.();};return document.addEventListener("pointerdown",x,true),document.addEventListener("keydown",h,true),()=>{document.removeEventListener("pointerdown",x,true),document.removeEventListener("keydown",h,true);}},[r,o,t]),!t||typeof document>"u")return null;let m=r?.getBoundingClientRect(),v=s?.paper??l,y=[...Array.isArray(v?.sx)?v.sx:v?.sx?[v.sx]:[],...Array.isArray(d)?d:d?[d]:[]],g=Ue(y,["orb-pop",v?.className,p].filter(Boolean).join(" "),{...v?.style,...u});return reactDom.createPortal(e("div",{...f,ref:b,className:g.className,style:{position:"fixed",left:m?.left??16,top:(m?.bottom??16)+6,zIndex:1301,...g.style},children:n}),document.body)},Pd=({open:t,onClose:r,anchor:o="left",children:n,PaperProps:a})=>{if(!t||typeof document>"u")return null;let i=o==="right"?{right:0,top:0,bottom:0}:o==="top"?{left:0,right:0,top:0}:o==="bottom"?{left:0,right:0,bottom:0}:{left:0,top:0,bottom:0},s=Ue(a?.sx,"orb-drawer");return reactDom.createPortal(c(jsxRuntime.Fragment,{children:[e("button",{type:"button",className:"orb-overlay","aria-label":"Close drawer",onClick:r}),e("aside",{className:s.className,style:{position:"fixed",zIndex:1201,...i},children:n})]}),document.body)},Td=({value:t,onChange:r,children:o,variant:n,scrollButtons:a,...i})=>e("div",{role:"tablist",className:"orb-tabs",...i,children:Jt.Children.map(o,s=>Jt.isValidElement(s)?Jt.cloneElement(s,{selected:s.props.value===t,onSelect:l=>r?.(null,l)}):s)}),Id=({value:t,label:r,children:o,selected:n,onSelect:a,...i})=>e("button",{type:"button",role:"tab","aria-selected":n,className:`orb-tab ${n?"orb-is-active":""}`,onClick:()=>a?.(t),...i,children:r??o});var sr=()=>wa(),Co=(t,r)=>Dr(t);var Rd=({day:t,onDaySelect:r,selected:o,outsideCurrentMonth:n,disableMargin:a,sx:i,className:s,...l})=>{let d=Ue(i,`orb-cal-day ${o?"orb-is-selected":""} ${n?"orb-is-outside":""} ${s??""}`);return e("button",{type:"button",className:d.className,style:d.style,onClick:()=>r?.(t),...l,children:t.date()})},Md=({value:t,referenceDate:r,onChange:o,onMonthChange:n,onYearChange:a,minDate:i,maxDate:s,slots:l,...d})=>e(Gn,{value:t,month:r,onChange:p=>o?.(p),onMonthChange:p=>{n?.(p),a?.(p);},minDate:i,maxDate:s,renderDay:l?.day?(p,u)=>l.day?.({day:p,selected:u.selected,outsideCurrentMonth:u.outsideCurrentMonth,onDaySelect:f=>o?.(f)}):void 0,...d}),Dd=({children:t})=>e(jsxRuntime.Fragment,{children:t}),Za=class{};Gt();T();var kb=(t,r)=>r!==void 0?r:typeof t=="number"?t:t==="small"?18:t==="large"?30:t==="inherit"?"1em":22,ve=t=>({fontSize:o,size:n,sx:a,className:i,style:s,titleAccess:l,...d})=>{let p=Ue(a,i,s);return e(Mt,{name:t,size:kb(o,n),className:p.className,style:p.style,"aria-label":d["aria-label"]??l,...d})},xo=ve("tree"),Bo=ve("add"),Nd=ve("duplicate"),Js=ve("down"),Ad=ve("navigationRight"),Ed=ve("navigationRight"),el=ve("up"),Ld=ve("delete"),Od=ve("camera"),Fd=ve("accept"),Bd=ve("accept"),ti=ve("navigationRight"),Hd=ve("dimension"),zd=ve("decline"),So=ve("decline"),Vd=ve("decline"),Wd=ve("decline"),ri=ve("delete"),oi=ve("delete"),$d=ve("download"),Gd=ve("move"),_d=ve("edit"),on=ve("slimDown"),Ud=ve("filter"),nn=ve("sum"),Kd=ve("wrench"),qd=ve("lineChart"),Xd=ve("document"),Vr=ve("slimDown"),Yd=ve("navigationLeft"),wo=ve("navigationRight"),ni=ve("slimUp"),ai=ve("navigationLeft"),ii=ve("navigationRight"),Zd=ve("dimension"),jd=ve("splitOne"),si=ve("menu"),Qd=ve("microphone"),Jd=ve("microphone"),ep=ve("microphone"),tp=ve("qrCode"),ko=ve("save"),Ho=ve("search"),rp=ve("search"),op=ve("paperPlane"),np=ve("paperPlane"),ap=ve("wrench"),ip=ve("sort"),li=ve("splitTwo"),sp=ve("favorite"),lp=ve("favorite"),cp=ve("stop"),dp=ve("tableRow"),ci=ve("collapseAll"),di=ve("expandAll"),an=ve("tableColumn"),pp=ve("overview"),up=ve("hide");T();var Tb=[{field:"value",label:"Value",minWidth:120},{field:"label",label:"Description",minWidth:180}],gp=t=>Array.isArray(t)?t:t==null||t===""?[]:[t],kr=t=>String(t),fp=(t,r)=>t[r],bp=t=>{let r=t.value??t.id??t.key??t.code;return typeof r=="number"||typeof r=="string"?r:""},Ib=t=>{let r=t.label??t.description??t.name??t.title;return String(typeof r=="number"||typeof r=="string"?r:bp(t))},Rb=t=>{let r=t.description??t.subtitle;return typeof r=="number"||typeof r=="string"?String(r):void 0},hp=({value:t=null,items:r=[],columns:o,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:u="No matching values",loading:f=false,clearable:b=true,allowManualInput:m=true,validateManualInput:v=true,manualInputErrorText:y="Enter a valid value.",selectedItems:g=[],displayValue:x,getOptionValue:h=bp,getOptionLabel:C=Ib,getOptionDescription:P=Rb,onChange:w,onSearch:k,disabled:R,InputProps:S,onFocus:E,onBlur:D,onKeyDown:I,error:A,helperText:N,...O})=>{let F=yr(),q=n==="multiple",[z,X]=Jt.useState(false),[$,_]=Jt.useState(false),[V,B]=Jt.useState(""),[Z,Q]=Jt.useState(null),[ge,se]=Jt.useState(false),[le,be]=Jt.useState(()=>gp(t)),[_e,De]=Jt.useState(""),[Pe,Ve]=Jt.useState(""),Te=Jt.useMemo(()=>o&&o.length>0?o:Tb,[o]),xe=Z??r,We=Jt.useMemo(()=>{let ee=[...g,...r,...Z??[]],Ie=new Map;return ee.forEach(Re=>{Ie.set(kr(h(Re)),Re);}),Ie},[h,r,Z,g]),ot=Jt.useMemo(()=>gp(t),[t]),it=Jt.useMemo(()=>ot.map(String).join(", "),[ot]);Jt.useEffect(()=>{z||be(ot);},[z,ot]),Jt.useEffect(()=>{!$&&!Pe&&De(it);},[$,it,Pe]);let Ze=Jt.useMemo(()=>{let ee=V.trim().toLowerCase();if(!ee||k)return xe;let Ie=Te.filter(Re=>Re.searchable!==false);return xe.filter(Re=>[h(Re),C(Re),P(Re),...Ie.map(mt=>fp(Re,mt.field))].some(mt=>String(mt??"").toLowerCase().includes(ee)))},[xe,P,C,h,k,V,Te]),U=Jt.useMemo(()=>{if(x!==void 0)return x;if(ot.length===0)return "";let ee=Ie=>{let Re=We.get(kr(Ie));if(!Re)return String(Ie);let je=C(Re);return je&&je!==String(Ie)?`${Ie} - ${je}`:String(Ie)};return q?ot.length>2?`${ot.length} selected`:ot.map(ee).join(", "):ee(ot[0])},[x,C,q,We,ot]),Fe=Jt.useCallback(async()=>{if(k){se(true);try{let ee=await k(V);Array.isArray(ee)&&Q(ee);}finally{se(false);}}},[k,V]),ye=()=>{R||(be(ot),X(true));},Le=()=>{X(false);},st=()=>{w?.(q?[]:null,q?[]:null),be([]),De(""),Ve("");},Je=ee=>{let Ie=h(ee);if(q){be(Re=>Re.some(mt=>kr(mt)===kr(Ie))?Re.filter(mt=>kr(mt)!==kr(Ie)):[...Re,Ie]);return}be([Ie]);},vt=()=>{let ee=le.map(Ie=>We.get(kr(Ie))).filter(Ie=>!!Ie);q?w?.(le,ee):w?.(le[0]??null,ee[0]??null),Ve(""),X(false);},St=ee=>{if(ee.key==="F4"){ee.preventDefault(),ye();return}if(ee.key==="Enter"&&m&&!Lt(_e,true)){ee.preventDefault();return}I?.(ee);},Et=ee=>v?ee.every(Ie=>We.has(kr(Ie))):true,Lt=(ee,Ie)=>{if(q){let je=ee.split(/[,;\n]/).map(pt=>pt.trim()).filter(Boolean);if(je.length===0)return Ve(""),w?.([],[]),true;if(!Et(je))return Ie&&Ve(y),false;Ve("");let mt=je.map(pt=>We.get(kr(pt))).filter(pt=>!!pt);return w?.(je,mt),true}let Re=ee.trim();return Re?Et([Re])?(Ve(""),w?.(Re,We.get(kr(Re))??null),true):(Ie&&Ve(y),false):(Ve(""),w?.(null,null),true)},re=ee=>{if(!m)return;let Ie=ee.target.value;De(Ie),Ve(""),Lt(Ie,false);},nt=f||ge,Be=ot.length>0,fe=m&&($||!!Pe)?_e:U;return c(jsxRuntime.Fragment,{children:[e(ze,{...O,className:["orb-value-help-field",b&&Be&&!R?"orb-value-help-has-clear":"",O.className??""].filter(Boolean).join(" "),disabled:R,value:fe,error:!!Pe||A,helperText:Pe||N,onChange:re,onFocus:ee=>{_(true),De(it),E?.(ee);},onBlur:ee=>{m&&Lt(_e,true),_(false),D?.(ee);},onKeyDown:St,InputProps:{...S,readOnly:!m,endAdornment:c("span",{className:"orb-value-help-actions",children:[nt?e(Xr,{size:18}):null,b&&Be&&!R?e(ae,{className:"orb-value-help-clear-trigger",size:"small",tooltip:l,"aria-label":l,onMouseDown:ee=>ee.preventDefault(),onClick:ee=>{ee.stopPropagation(),st();},children:e(Mt,{name:"decline",size:14})}):null,e(ae,{className:"orb-value-help-search-trigger",size:"small",tooltip:p,"aria-label":p,onMouseDown:ee=>ee.preventDefault(),onClick:ee=>{ee.stopPropagation(),ye();},disabled:R,children:e(Mt,{name:"search",size:16})})]})}}),c(zt,{open:z,onClose:Le,fullWidth:true,maxWidth:820,hideCloseButton:true,PaperProps:{sx:ee=>({borderRadius:2,overflow:"hidden",border:`1px solid ${ee.palette.divider}`,boxShadow:F==="dark"?`0 24px 80px ${rt(ee.palette.common.black,.72)}`:`0 24px 80px ${rt(ee.palette.common.black,.18)}`})},children:[c("div",{className:"orb-dialog-title",sx:ee=>({display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,px:2.5,py:2,pr:1.5,borderBottom:`1px solid ${ee.palette.divider}`,bgcolor:ee.palette.background.paper}),children:[c("div",{children:[e(L,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:a}),q?e(L,{variant:"body2",color:"text.secondary",sx:{mt:.25},children:`${le.length} selected`}):null]}),e(ae,{"aria-label":"Close",onClick:Le,size:"small",children:e(So,{fontSize:"small"})})]}),c("div",{className:"orb-dialog-content",sx:{p:0},children:[c(ie,{direction:{xs:"column",sm:"row"},spacing:1,sx:ee=>({px:2.5,py:1.5,borderBottom:`1px solid ${ee.palette.divider}`,bgcolor:F==="dark"?rt(ee.palette.common.white,.025):rt(ee.palette.primary.main,.035)}),children:[e(ze,{size:"small",fullWidth:true,autoFocus:true,value:V,placeholder:i,onChange:ee=>B(ee.target.value),onKeyDown:ee=>{ee.key==="Enter"&&(ee.preventDefault(),Fe());},InputProps:{startAdornment:e(io,{position:"start",children:e(Mt,{name:"search",size:16})}),sx:ee=>({borderRadius:1,bgcolor:ee.palette.background.paper,"& fieldset":{borderColor:rt(ee.palette.text.primary,F==="dark"?.2:.16)},"&:hover fieldset":{borderColor:rt(ee.palette.primary.main,.52)},"&:focus-within fieldset":{borderColor:ee.palette.primary.main}})}}),k?e(Ce,{variant:"outlined",onClick:()=>{Fe();},disabled:nt,sx:{minWidth:96,textTransform:"none",fontWeight:700},children:nt?e(Xr,{size:18}):"Search"}):null]}),e("div",{sx:{maxHeight:420},children:c("table",{className:"orb-tbl",stickyHeader:true,size:"small",children:[e("thead",{children:c("tr",{children:[e("td",{padding:"checkbox",sx:ee=>({bgcolor:F==="dark"?"var(--orb-canvas)":ee.palette.background.paper,borderBottom:`1px solid ${ee.palette.divider}`})}),Te.map(ee=>e("td",{align:ee.align==="inherit"?void 0:ee.align,sx:Ie=>({minWidth:ee.minWidth,width:ee.width,fontSize:"0.78rem",fontWeight:800,bgcolor:F==="dark"?"var(--orb-canvas)":Ie.palette.background.paper,borderBottom:`1px solid ${Ie.palette.divider}`}),children:ee.label},String(ee.field)))]})}),c("tbody",{children:[Ze.map(ee=>{let Ie=h(ee),Re=le.some(je=>kr(je)===kr(Ie));return c("tr",{hover:true,selected:Re,onClick:()=>Je(ee),onDoubleClick:()=>{q||(be([Ie]),w?.(Ie,ee),X(false));},sx:je=>({cursor:"pointer","&.orb-selected":{bgcolor:rt(je.palette.primary.main,F==="dark"?.22:.12)},"&.orb-selected:hover":{bgcolor:rt(je.palette.primary.main,F==="dark"?.28:.18)}}),children:[e("td",{padding:"checkbox",children:e(Dt,{size:"small",checked:Re})}),Te.map(je=>{let mt=fp(ee,je.field);return e("td",{align:je.align==="inherit"?void 0:je.align,sx:{fontSize:"0.82rem",py:1},children:je.render?je.render(mt,ee):String(mt??"")},String(je.field))})]},kr(Ie))}),Ze.length===0?e("tr",{children:e("td",{colSpan:Te.length+1,children:e("div",{sx:{py:5,textAlign:"center",color:"text.secondary"},children:u})})}):null]})]})})]}),c("div",{className:"orb-dialog-actions",sx:ee=>({px:2.5,py:1.5,borderTop:`1px solid ${ee.palette.divider}`,bgcolor:ee.palette.background.paper,"& .orb-btn":{textTransform:"none",fontWeight:700}}),children:[b&&(Be||le.length>0)?e(Ce,{onClick:st,children:l}):null,e("div",{sx:{flex:1}}),e(Ce,{onClick:Le,children:d}),e(Ce,{variant:"contained",onClick:vt,disabled:!q&&le.length===0,children:s})]})]})]})};T();var pi=({title:t,hideHeader:r,children:o})=>c("div",{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[!r&&e("div",{sx:{mb:2},children:e(L,{variant:"h4",children:t})}),e("div",{sx:{flex:1,overflow:"hidden"},children:o})]});var tl={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"},rl={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}},Qn={width:30,height:30,minWidth:30,minHeight:30,p:.25,flex:"0 0 auto","& svg":{fontSize:20}},vp={display:"flex",alignItems:"center",justifyContent:"center",gap:.25,width:"100%",minWidth:0},dr={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}};T();var Mb={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"}},ui=({rowsPerPage:t=20,rowsPerPageOptions:r=[20,50,100,-1],page:o=0,count:n=0,onRowsPerPageChange:a,onPageChange:i})=>{let{t:s}=pe(),l=r.length>0?r:[20,50,100,-1],d=Math.max(0,o),p=t===-1?1:Math.max(1,Math.ceil(n/t)),u=Math.min(d+1,p),f=d>0,b=d<p-1&&t!==-1;return c("div",{className:"orb-table-pager",children:[e(L,{className:"orb-table-pager-label",children:s("table.toolbar.itemsPerPage")}),e(lt,{title:s("table.toolbar.itemsPerPage"),children:e(Wt,{size:"small",variant:"standard",value:t,"aria-label":s("table.toolbar.itemsPerPage"),fullWidth:false,disableUnderline:true,onChange:m=>a?.(Number(m.target.value)),sx:Mb,children:l.map(m=>e("option",{value:m,children:m===-1?s("common.all"):m},`rows-per-page-${m}`))})}),e("span",{className:"orb-table-pager-divider"}),e(ae,{className:"orb-table-pager-button","aria-label":"Previous page",size:"small",onClick:()=>i?.(Math.max(d-1,0)),disabled:!f,sx:dr,children:e(Yd,{})}),c(L,{className:"orb-table-pager-page",title:s("table.toolbar.pageOf",{current:u,total:p}),children:[u," / ",p]}),e(ae,{className:"orb-table-pager-button","aria-label":"Next page",size:"small",onClick:()=>i?.(Math.min(d+1,p-1)),disabled:!b,sx:dr,children:e(wo,{})})]})};T();var mi=({value:t="",onChange:r})=>{let{t:o}=pe();return e("div",{className:"orb-table-toolbar-search",children:e(ze,{className:"orb-table-toolbar-search-field",size:"small",placeholder:o("table.toolbar.searchPlaceholder"),value:t,onChange:n=>r?.(n.target.value),InputProps:{startAdornment:e(io,{position:"start",children:e(Ho,{size:16})})}})})};T();var gi=t=>{let{t:r}=pe(),o=Array.isArray(t.actions)?t.actions:t.actions?[t.actions]:[],n=Array.isArray(t.extraTools)?t.extraTools:t.extraTools?[t.extraTools]:[],a=[...o,...n],i=!!(t.showCreateButton||t.showEditButton||t.showDeleteButton),s=!!(t.onOpenGraphReport||t.onLayoutSave&&!t.layoutManager||t.layoutManager);return e(wd,{className:"orb-table-toolbar",role:"toolbar","aria-label":r("table.title.default"),children:c("div",{className:"orb-table-toolbar-primary",children:[e(mi,{value:t.filterText,onChange:l=>{t.setFilterText(l),t.onPageChange?.(0);}}),e(ui,{rowsPerPage:t.rowsPerPage,rowsPerPageOptions:t.rowsPerPageOptions,page:t.page,count:t.count,onRowsPerPageChange:t.onRowsPerPageChange,onPageChange:t.onPageChange}),a.length>0?e("div",{className:"orb-table-toolbar-custom",children:a.map((l,d)=>e(Jt__namespace.default.Fragment,{children:l},`toolbar-custom-${d}`))}):null,e("span",{className:"orb-table-toolbar-spacer"}),c("div",{className:"orb-table-toolbar-actions",children:[c("div",{className:"orb-table-tool-group",children:[!t.disableGrouping&&e(lt,{title:r("table.toolbar.groupBy"),children:e(ae,{className:"orb-table-tool-button",sx:dr,onClick:l=>t.setGroupAnchorEl(t.groupAnchorEl?null:l.currentTarget),children:e(Qa,{badgeContent:t.grouping?.length,color:"primary",invisible:!t.grouping?.length,children:e(xo,{})})})}),e(lt,{title:r("table.toolbar.summary"),children:e(ae,{className:`orb-table-tool-button ${t.showSummary?"orb-is-active":""}`,active:!!t.showSummary,sx:dr,onClick:l=>t.setSummaryAnchorEl(t.summaryAnchorEl?null:l.currentTarget),children:e(nn,{})})}),e(lt,{title:r("table.toolbar.columns"),children:e(ae,{className:"orb-table-tool-button",sx:dr,onClick:l=>t.setAnchorEl(t.anchorEl?null:l.currentTarget),children:e(an,{})})}),e(lt,{title:r("table.toolbar.export"),children:e(ae,{className:"orb-table-tool-button",sx:dr,onClick:t.handleExport,children:e($d,{})})})]}),i&&c("div",{className:"orb-table-tool-group",children:[t.showCreateButton&&e(lt,{title:r("table.toolbar.newItem"),children:e(ae,{className:"orb-table-tool-button",onClick:t.onOpenCreateDialog,color:"primary.main",sx:dr,children:e(Bo,{})})}),t.showEditButton&&e(lt,{title:r("table.toolbar.editItem"),children:e("span",{children:e(ae,{className:"orb-table-tool-button",onClick:t.onOpenEditDialog,color:"primary.main",disabled:!!t.editDisabled,sx:dr,children:e(_d,{})})})}),t.showDeleteButton&&e(lt,{title:r("table.toolbar.deleteItem"),children:e("span",{children:e(ae,{className:"orb-table-tool-button",onClick:t.onOpenDeleteConfirm,disabled:!!t.deleteDisabled,sx:{...dr,color:"error.main"},children:e(ri,{})})})})]}),s&&c("div",{className:"orb-table-tool-group",children:[t.onOpenGraphReport&&e(lt,{title:r("table.toolbar.graphicReport"),children:e(ae,{className:"orb-table-tool-button",sx:dr,onClick:t.onOpenGraphReport,children:e(qd,{})})}),t.onLayoutSave&&!t.layoutManager&&e(lt,{title:r("table.toolbar.saveLayout"),children:e(ae,{className:"orb-table-tool-button",sx:dr,onClick:l=>t.onLayoutSave(l),children:e(ko,{})})}),t.layoutManager]})]})]})})};var fi=Object.freeze({Translate:{toString(t){if(!t)return;let{x:r,y:o}=t;return "translate3d("+(r?Math.round(r):0)+"px, "+(o?Math.round(o):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;let{scaleX:r,scaleY:o}=t;return "scaleX("+r+") scaleY("+o+")"}},Transform:{toString(t){if(t)return [fi.Translate.toString(t),fi.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:r,duration:o,easing:n}=t;return r+" "+o+"ms "+n}}});T();var bi=t=>{let{t:r}=pe(),{onSelectAllClick:o,order:n,orderBy:a,sortBy:i=[],numSelected:s=0,rowCount:l=0,onRequestSort:d,onContextMenu:p,columns:u,visibleColumns:f,selectionMode:b,grouping:m=[],isAllExpanded:v=false,handleToggleAll:y,onColumnResize:g,columnWidths:x,enableColumnReorder:h=false,disableSorting:C=false}=t,[P,w]=Jt.useState(null),k=Jt.useRef(null),R=$=>_=>{C||P||d($);},S=($,_,V)=>{$.preventDefault(),$.stopPropagation(),w(_),k.current={startX:$.clientX,startWidth:V,colId:_},document.addEventListener("mousemove",E),document.addEventListener("mouseup",D),document.body.style.cursor="col-resize";},E=$=>{if(!k.current)return;let{startX:_,startWidth:V,colId:B}=k.current,Z=$.clientX-_,Q=Math.max(50,V+Z);g&&g(B,Q);},D=()=>{w(null),k.current=null,document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",D),document.body.style.cursor="";};Jt.useEffect(()=>()=>{document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",D);},[]);let I=b==="multiple"||b==="single",A=m.length>0&&!!y,N=r(v?"table.group.collapseAll":"table.group.expandAll"),O=u.filter($=>f.includes($.id)),F=new Map(i.map(($,_)=>[$.field,{...$,priority:_+1}])),q=O.map($=>{let _=x?.[$.id]||$.minWidth||100,V=F.get($.id);return e(Bb,{headCell:$,width:typeof _=="number"?_:100,order:n,orderBy:a,multiSortInfo:C?void 0:V,onRequestSort:R($.id),onContextMenu:p,onResizeMouseDown:B=>S(B,$.id,typeof _=="number"?_:100),enableColumnReorder:h,disableSorting:C},$.id)}),z=O.map($=>$.id),X=c("tr",{children:[I&&e("th",{className:"orb-table-control-head",style:{width:56,minWidth:56,maxWidth:56},children:e(Dt,{color:"primary",indeterminate:s>0&&s<l,checked:l>0&&s===l,onChange:o,disabled:b==="single",sx:jn})}),A&&e("th",{className:"orb-table-control-head",style:{width:72,minWidth:72,maxWidth:72},children:e(lt,{title:N,children:e(ae,{size:"small",onClick:$=>{$.stopPropagation(),y?.(!v);},sx:Qn,children:v?e(ci,{}):e(di,{})})})}),h?e(sortable.SortableContext,{items:z,strategy:sortable.horizontalListSortingStrategy,children:q}):q]});return e("thead",{children:X})},Bb=({headCell:t,width:r,order:o,orderBy:n,multiSortInfo:a,onRequestSort:i,onContextMenu:s,onResizeMouseDown:l,enableColumnReorder:d,disableSorting:p})=>{let{setNodeRef:u,attributes:f,listeners:b,transform:m,transition:v,isDragging:y}=sortable.useSortable({id:t.id,disabled:!d}),g=d?{transform:fi.Transform.toString(m),transition:v,opacity:y?.6:1}:{},x=p?"asc":a?.direction??(n===t.id?o:"asc"),h=!p&&(!!a||n===t.id);return c("th",{ref:d?u:void 0,className:`orb-table-head-cell ${t.numeric?"orb-num":""} ${d?"orb-is-reorderable":""} ${y?"orb-is-dragging":""}`,"aria-sort":h?x==="asc"?"ascending":"descending":"none",onContextMenu:s?C=>s(C,t.id):void 0,style:{width:r,minWidth:r,maxWidth:r,...g},...d?f:{},...d?b:{},children:[p?e("span",{className:"orb-table-head-label",children:t.label}):e(kd,{className:"orb-table-head-sort",active:h,direction:x,onClick:i,children:c("span",{className:"orb-table-head-label",children:[t.label,a&&e("span",{className:"orb-table-sort-priority",children:a.priority})]})}),e("div",{className:"orb-table-resize-handle",onMouseDown:l,onPointerDown:C=>C.stopPropagation(),onClick:C=>C.stopPropagation()})]})};T();var hi=t=>{let{t:r}=pe(),{visibleRows:o,visibleColumns:n,selected:a=[],handleClick:i,columns:s,toggleGroupExpand:l,expandedGroups:d=new Set,selectionMode:p,grouping:u=[],isGroupFullyExpanded:f,handleExpandGroupRecursively:b,handleCollapseGroupRecursively:m,emptyLabel:v,getRowDataKey:y,getRowProps:g,getGroupRowProps:x}=t,h=k=>a.indexOf(k)!==-1,C=p==="multiple"||p==="single",P=u.length>0,w=n.length+(C?1:0)+(P?1:0);return c("tbody",{children:[o.map((k,R)=>{if(k.type==="group"){let S=d.has(k.id),E=k.childIds||[],D=E.filter($=>h($)).length,I=E.length>0&&D===E.length,A=D>0&&D<E.length,N={entry:k,data:k,id:k.id,index:R,selected:I,group:true},O=x?.(N)||{},{className:F,onClick:q,...z}=O,X=$=>{if($.stopPropagation(),!!t.onSelectionChange)if(I){let _=a.filter(V=>!E.includes(V));t.onSelectionChange(_);}else {let _=Array.from(new Set([...a,...E]));t.onSelectionChange(_);}};return c("tr",{...z,"data-ctable-row-key":y?.(N),className:["orb-table-group-row",F].filter(Boolean).join(" "),onClick:q,sx:$=>({backgroundColor:"var(--orb-surface)","& th, & td":{color:$.palette.text.primary,borderBottomColor:$.palette.divider},"& .orb-icon-btn":{color:$.palette.text.primary},"& .orb-chk":{color:$.palette.text.secondary},"& .orb-chk:has(input:checked), & .orb-chk:has(input:indeterminate)":{color:$.palette.primary.main}}),children:[C&&e("td",{padding:"checkbox",sx:tl,children:e(Dt,{size:"small",checked:I,indeterminate:A,onChange:X,onClick:$=>$.stopPropagation(),sx:jn})}),P&&e("td",{padding:"checkbox",sx:rl,children:c("div",{sx:vp,children:[u.length>1&&k.level<u.length-1&&e(lt,{title:f?.(k.id)?r("table.group.collapseAll"):r("table.group.expandAll"),children:e(ae,{size:"small",onClick:()=>{f?.(k.id)?m?.(k.id):b?.(k.id);},sx:Qn,children:f?.(k.id)?e(ci,{}):e(di,{})})}),e(ae,{size:"small",onClick:()=>l&&l(k.id),sx:Qn,children:S?e(Vr,{}):e(wo,{})})]})}),e("td",{colSpan:n.length,sx:{py:1,pl:k.level*3+1},children:c(L,{variant:"body2",fontWeight:"bold",color:"text.primary",sx:{fontSize:"0.85rem"},children:[k.field,": ",k.value," (",k.count,")"]})})]},k.id)}else {let S=k.data||k,E=k.id||S.id||R,D=h(E),I=`enhanced-table-checkbox-${R}`,A={entry:k,data:S,id:E,index:R,selected:D,group:false},N=g?.(A)||{},{className:O,onClick:F,...q}=N,X=(k.level!==void 0?k.level:0)*4;return c("tr",{...q,"data-ctable-row-key":y?.(A),className:[D?"orb-is-selected":"",O].filter(Boolean).join(" "),onClick:$=>{F?.($),$.defaultPrevented||i?.($,S);},role:C?"checkbox":q.role,"aria-checked":C?D:q["aria-checked"],tabIndex:q.tabIndex??-1,children:[C&&e("td",{padding:"checkbox",sx:tl,children:e(Dt,{color:"primary",checked:D,inputProps:{"aria-labelledby":I},sx:jn})}),P&&e("td",{padding:"checkbox",sx:rl}),s.filter($=>n.includes($.id)).map(($,_)=>{let B=_===0&&X>0?{pl:X+2}:{};return e("td",{className:$.numeric?"orb-num":void 0,align:$.numeric?"right":"left",sx:B,children:$.render?$.render(S[$.id],S):(function(){let Q=S[$.id];if($.numeric){if(typeof Q=="number")return Q.toLocaleString();if(typeof Q=="string"&&Q.trim()!==""&&!isNaN(Number(Q)))return Number(Q).toLocaleString()}return Q})()},$.id)})]},E)}}),o.length===0&&e("tr",{children:e("td",{colSpan:w,align:"center",children:v??r("common.noData")})})]})};T();var yp=t=>{let{columns:r=[],visibleColumns:o,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=r.filter(u=>o.includes(u.id));return e("tfoot",{className:"orb-table-footer",style:{zIndex:t.zIndex},children:c("tr",{children:[l&&e("td",{className:"orb-table-footer-control",style:{width:56,minWidth:56,maxWidth:56}}),d&&e("td",{className:"orb-table-footer-control",style:{width:72,minWidth:72,maxWidth:72}}),p.map(u=>e("td",{className:`orb-table-footer-cell ${u.numeric?"orb-num":""}`,style:{width:s[u.id]||u.minWidth||100,minWidth:s[u.id]||u.minWidth||100,maxWidth:s[u.id]||u.minWidth||100},children:(function(){let b=n[u.id];return b==null||b===""?"":typeof b=="number"?b.toLocaleString():typeof b=="string"&&b.trim()!==""&&!isNaN(Number(b))?Number(b).toLocaleString():b})()},u.id))]})})};T();var Cp=t=>{let{t:r}=pe();return e("div",{sx:{p:2},children:e(L,{children:r("table.mobile.notImplemented")})})};T();var cn=({groupAnchorEl:t,setGroupAnchorEl:r,grouping:o,setGrouping:n,columns:a})=>{let{t:i}=pe(),[s,l]=Jt.useState(o);Jt.useEffect(()=>{t&&l(o);},[t,o]);let d=()=>{l(o),r(null);},p=f=>{l(b=>b.includes(f)?b.filter(m=>m!==f):[...b,f]);},u=()=>{n(s),r(null);};return c(jt,{anchorEl:t,open:!!t,onClose:d,sx:{width:224,minWidth:224,maxHeight:360,overflowY:"auto"},children:[c("div",{className:"orb-table-group-menu-header",onClick:f=>f.stopPropagation(),children:[e(L,{className:"orb-table-group-menu-title",variant:"subtitle2",children:i("table.menu.groupBy")}),s.length>0&&e(Ce,{className:"orb-table-group-menu-clear",size:"small",color:"error",onClick:f=>{f.stopPropagation(),l([]);},children:i("table.menu.clearAll")})]}),e(At,{className:"orb-table-group-menu-divider"}),a.map(f=>{let b=s.includes(f.id),m=s.indexOf(f.id)+1;return e("option",{className:"orb-table-group-menu-option",selected:b,onClick:v=>{v.stopPropagation(),p(f.id);},children:c("div",{className:"orb-table-group-menu-option-content",children:[e(Dt,{className:"orb-table-group-menu-checkbox",checked:b,size:"small"}),e(_t,{className:"orb-table-group-menu-label",primary:f.label}),b&&e("span",{className:"orb-table-group-menu-order","aria-label":`${i("table.menu.groupBy")} ${m}`,children:m})]})},f.id)}),c("div",{className:"orb-table-group-menu-footer",children:[e(Ce,{size:"small",variant:"ghost",onClick:d,children:i("common.cancel")}),e(Ce,{size:"small",variant:"primary",onClick:u,children:i("common.ok")})]})]})},dn=({anchorEl:t,setAnchorEl:r,columns:o,visibleColumns:n,toggleColumnVisibility:a})=>{let{t:i}=pe();return c(jt,{anchorEl:t,open:!!t,onClose:()=>r(null),children:[e("option",{disabled:true,children:e(_t,{primary:i("table.menu.visibleColumns")})}),e(At,{}),o.map(s=>c("option",{onClick:()=>a(s.id),children:[e(Dt,{checked:n.includes(s.id),size:"small"}),e(_t,{primary:s.label})]},s.id))]})},vi=({anchorEl:t,setAnchorEl:r,showSummary:o,setShowSummary:n,columns:a,summaryColumns:i,toggleSummaryColumn:s})=>{let{t:l}=pe();return c(jt,{anchorEl:t,open:!!t,onClose:()=>r(null),children:[e("option",{children:e(Zn,{control:e(Ja,{checked:o,onChange:d=>n(d.target.checked),size:"small"}),label:l("table.menu.showSummaryRow")})}),e(At,{}),a.filter(d=>d.numeric).map(d=>c("option",{onClick:()=>s(d.id),disabled:!o,children:[e(Dt,{checked:i.includes(d.id),size:"small"}),e(_t,{primary:d.label})]},d.id)),a.filter(d=>d.numeric).length===0&&e("option",{disabled:true,children:e(_t,{primary:l("table.menu.noNumericColumns")})})]})},yi=({contextMenu:t,handleCloseContextMenu:r,columns:o,visibleColumns:n,toggleColumnVisibility:a})=>{let{t:i}=pe();return c(jt,{open:t!==null,onClose:r,anchorReference:"anchorPosition",anchorPosition:t!==null?{top:t.mouseY,left:t.mouseX}:void 0,children:[e("option",{onClick:r,children:i("common.copy")}),e(At,{}),e("option",{disabled:true,children:i("table.menu.visibleColumns")}),o.map(s=>c("option",{onClick:()=>a(s.id),children:[e(zr,{children:n.includes(s.id)&&e(Fd,{fontSize:"small"})}),e(_t,{children:s.label})]},s.id))]})},kp=({contextMenu:t,handleClose:r,columns:o,visibleColumns:n,grouping:a,summaryColumns:i,showSummary:s,sortBy:l,orderBy:d,order:p,onSortAsc:u,onSortDesc:f,onClearSort:b,onHideColumn:m,onToggleGroup:v,onToggleSummary:y,onOpenSortDialog:g})=>{let{t:x}=pe(),h=t?.columnId??"",C=o.find(I=>I.id===h),P=a.includes(h),w=i.includes(h),k=!!C?.numeric,R=l.find(I=>I.field===h),S=R?R.direction==="asc":d===h&&p==="asc",E=R?R.direction==="desc":d===h&&p==="desc",D=S||E;return c(jt,{open:t!==null,onClose:r,anchorReference:"anchorPosition",anchorPosition:t!==null?{top:t.mouseY,left:t.mouseX}:void 0,children:[e("option",{disabled:true,sx:{opacity:"1 !important",fontWeight:700},children:e(_t,{primary:C?.label??h})}),e(At,{}),c("option",{onClick:()=>{u(h),r();},selected:S,children:[e(zr,{children:e(el,{fontSize:"small"})}),e(_t,{primary:x("table.headerMenu.sortAsc")})]}),c("option",{onClick:()=>{f(h),r();},selected:E,children:[e(zr,{children:e(Js,{fontSize:"small"})}),e(_t,{primary:x("table.headerMenu.sortDesc")})]}),D&&c("option",{onClick:()=>{b(h),r();},children:[e(zr,{children:e(Hd,{fontSize:"small"})}),e(_t,{primary:x("table.headerMenu.clearSort")})]}),c("option",{onClick:()=>{g(),r();},children:[e(zr,{children:e(Bo,{fontSize:"small"})}),e(_t,{primary:x("table.headerMenu.configureSort")})]}),e(At,{}),c("option",{onClick:()=>{v(h),r();},selected:P,children:[e(zr,{children:e(xo,{fontSize:"small"})}),e(_t,{primary:x(P?"table.headerMenu.ungroup":"table.headerMenu.group")})]}),k&&s&&c("option",{onClick:()=>{y(h),r();},selected:w,children:[e(zr,{children:e(nn,{fontSize:"small"})}),e(_t,{primary:x(w?"table.headerMenu.removeSummary":"table.headerMenu.addSummary")})]}),e(At,{}),c("option",{onClick:()=>{m(h),r();},children:[e(zr,{children:e(up,{fontSize:"small"})}),e(_t,{primary:x("table.headerMenu.hideColumn")})]})]})},Pp=({open:t,onClose:r,columns:o,initialRules:n,onApply:a,onClear:i})=>{let{t:s}=pe(),[l,d]=Jt.useState([]);Jt.useEffect(()=>{t&&d(n.length>0?n.map(y=>({...y})):[]);},[t,n]);let p=Jt.useMemo(()=>new Set(l.map(y=>y.field)),[l]),u=Jt.useMemo(()=>o.filter(y=>!p.has(y.id)),[o,p]),f=()=>{let y=u[0];y&&d(g=>[...g,{field:y.id,direction:"asc"}]);},b=y=>{d(g=>g.filter((x,h)=>h!==y));},m=(y,g)=>{d(x=>x.map((h,C)=>C===y?{...h,...g}:h));},v=(y,g)=>{d(x=>{let h=y+g;if(h<0||h>=x.length)return x;let C=[...x],[P]=C.splice(y,1);return C.splice(h,0,P),C});};return e(zt,{open:t,onClose:r,maxWidth:620,fullWidth:true,className:"orb-table-sort-dialog",title:s("table.sortDialog.title"),actions:c(jsxRuntime.Fragment,{children:[e(Ce,{className:"orb-table-sort-clear",variant:"neutral",disabled:l.length===0&&n.length===0,onClick:()=>{i(),r();},children:s("table.sortDialog.clearAll")}),e("span",{className:"orb-table-sort-action-spacer"}),e(Ce,{variant:"neutral",onClick:r,children:s("common.cancel")}),e(Ce,{variant:"primary",onClick:()=>{a(l),r();},children:s("common.ok")})]}),children:c("div",{className:"orb-table-sort-dialog-content",children:[l.length===0?e(L,{className:"orb-table-sort-empty",variant:"body2",children:s("table.sortDialog.empty")}):e(ie,{className:"orb-table-sort-rules",spacing:1,children:l.map((y,g)=>{let x=new Set(l.filter((C,P)=>P!==g).map(C=>C.field)),h=o.filter(C=>!x.has(C.id));return c("div",{className:"orb-table-sort-rule",children:[e(Qa,{className:"orb-table-sort-order",badgeContent:g+1,color:"primary"}),e(Wt,{size:"small",value:y.field,onChange:C=>m(g,{field:C.target.value}),options:h.map(C=>({value:C.id,label:C.label}))}),e(Wt,{size:"small",value:y.direction,onChange:C=>m(g,{direction:C.target.value}),options:[{value:"asc",label:s("table.sortDialog.asc")},{value:"desc",label:s("table.sortDialog.desc")}]}),e(ae,{className:"orb-table-sort-icon-button",size:"small",onClick:()=>v(g,-1),disabled:g===0,children:e(el,{fontSize:"small"})}),e(ae,{className:"orb-table-sort-icon-button",size:"small",onClick:()=>v(g,1),disabled:g===l.length-1,children:e(Js,{fontSize:"small"})}),e(ae,{className:"orb-table-sort-icon-button orb-table-sort-delete",size:"small",onClick:()=>b(g),children:e(oi,{fontSize:"small"})})]},`sort-rule-${g}`)})}),e(Ce,{size:"small",onClick:f,disabled:u.length===0,startIcon:e(Bo,{}),variant:"secondary",className:"orb-table-sort-add",children:s("table.sortDialog.addRule")})]})})};T();var Jn=(t,r=2)=>t.toLocaleString(void 0,{maximumFractionDigits:r}),Tp=({kpis:t})=>{let{t:r}=pe(),o=[{label:r("graph.kpi.totalRecords"),value:Jn(t.totalRecords,0),color:"var(--orb-fg)"},{label:r("graph.kpi.totalReport"),value:Jn(t.totalReportHours),color:"var(--orb-fg)"},{label:r("graph.kpi.totalBillable"),value:Jn(t.totalBillableHours),color:"var(--orb-primary)"},{label:r("graph.kpi.efficiency"),value:`${t.efficiency.toFixed(2)}%`,color:"var(--orb-accent)"},{label:r("graph.kpi.amount"),value:Jn(t.totalAmount),color:"var(--orb-primary)"},{label:r("graph.kpi.flagged"),value:Jn(t.flaggedCount,0),color:"var(--orb-err)"}];return e("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(140px, 1fr))",gap:12},children:o.map(n=>c(Ee,{elevation:0,sx:{padding:12,minHeight:96,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[e(L,{variant:"caption",muted:true,children:n.label}),e(L,{variant:"h3",sx:{fontWeight:800,color:n.color,fontVariantNumeric:"tabular-nums"},children:n.value})]},n.label))})};T();var Ci=({title:t,subtitle:r,children:o})=>c(Ee,{elevation:0,sx:{padding:16},children:[e(L,{variant:"h4",sx:{fontWeight:700},children:t}),r&&e(L,{variant:"body2",muted:true,sx:{marginBottom:16},children:r}),o]});T();var ea=({data:t,orientation:r="horizontal",valueSuffix:o="",minHeight:n=210,activeName:a,onItemClick:i})=>{if(t.length===0)return e(L,{variant:"body2",muted:true,children:"No data"});let s=Math.max(...t.map(l=>l.value),1);return r==="vertical"?e("div",{style:{display:"flex",gap:1,alignItems:"flex-end",minHeight:n},children:t.map(l=>c("div",{style:{flex:1,minWidth:0},children:[e("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}}),e(L,{variant:"caption",title:l.name,sx:{display:"block",mt:.5},children:l.name}),c(L,{variant:"caption",muted:true,children:[l.value.toFixed(1),o]})]},l.name))}):e(ie,{spacing:1,children:t.map(l=>c("div",{style:{display:"grid",gridTemplateColumns:"140px 1fr 64px",gap:1},children:[e(L,{variant:"caption",muted:true,title:l.name,children:l.name}),e("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:e("div",{style:{width:`${l.value/s*100}%`,height:"100%",background:l.name===a?"primary.dark":"primary.main"}})}),c(L,{variant:"caption",sx:{textAlign:"right",fontWeight:600},children:[l.value.toFixed(1),o]})]},l.name))})};T();var Ip=({data:t,color:r="var(--orb-chart-1)",valueSuffix:o="",height:n=220})=>{if(t.length===0)return e(L,{variant:"body2",muted:true,children:"No data"});let a=640,i=28,s=t.map(b=>b.value),l=Math.min(...s,0),p=Math.max(...s,1)-l||1,u=t.map((b,m)=>{let v=i+m*(a-i*2)/Math.max(t.length-1,1),y=n-i-(b.value-l)/p*(n-i*2);return {x:v,y,...b}}),f=u.map(b=>`${b.x},${b.y}`).join(" ");return c("div",{children:[c("div",{component:"svg",viewBox:`0 0 ${a} ${n}`,style:{width:"100%",height:n},children:[e("line",{x1:i,y1:n-i,x2:a-i,y2:n-i,style:{stroke:"var(--orb-chart-grid)"}}),e("polyline",{fill:"none",style:{stroke:r},strokeWidth:3,points:f}),u.map(b=>e("circle",{cx:b.x,cy:b.y,r:4,style:{fill:r}},b.name))]}),e("div",{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`,gap:1},children:t.map(b=>c("div",{style:{minWidth:0},children:[e(L,{variant:"caption",title:b.name,sx:{display:"block"},children:b.name}),c(L,{variant:"caption",muted:true,children:[b.value.toFixed(1),o]})]},b.name))})]})};T();var Rp=({data:t,barColor:r="var(--orb-chart-1)",lineColor:o="var(--orb-chart-5)",height:n=220})=>{if(t.length===0)return e(L,{variant:"body2",muted:true,children:"No data"});let a=640,i=28,s=Math.max(...t.map(u=>u.barValue),1),l=Math.max(...t.map(u=>u.lineValue),1),d=t.map((u,f)=>{let b=(a-i*2)/t.length,m=Math.max(b*.5,8),v=i+f*b+(b-m)/2,y=u.barValue/s*(n-i*2),g=n-i-y;return {x:v,y:g,barHeight:y,barWidth:m,item:u}}),p=t.map((u,f)=>{let b=(a-i*2)/t.length,m=i+f*b+b/2,v=n-i-u.lineValue/l*(n-i*2);return {x:m,y:v,item:u}});return c(ie,{spacing:1.25,children:[c("div",{component:"svg",viewBox:`0 0 ${a} ${n}`,style:{width:"100%",height:n},children:[e("line",{x1:i,y1:n-i,x2:a-i,y2:n-i,style:{stroke:"var(--orb-chart-grid)"}}),d.map(u=>e("rect",{x:u.x,y:u.y,width:u.barWidth,height:Math.max(u.barHeight,4),rx:6,style:{fill:r}},u.item.name)),e("polyline",{fill:"none",style:{stroke:o},strokeWidth:3,points:p.map(u=>`${u.x},${u.y}`).join(" ")}),p.map(u=>e("circle",{cx:u.x,cy:u.y,r:3.5,style:{fill:o}},`${u.item.name}-line`))]}),e("div",{style:{display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`,gap:1},children:t.map(u=>c("div",{style:{minWidth:0},children:[e(L,{variant:"caption",title:u.name,sx:{display:"block"},children:u.name}),c(L,{variant:"caption",muted:true,sx:{display:"block"},children:["Bar: ",u.barValue.toFixed(1)]}),c(L,{variant:"caption",muted:true,sx:{display:"block"},children:["Line: ",u.lineValue.toFixed(1)]})]},u.name))})]})};T();var Hb=t=>{let o=.2+Math.max(0,Math.min(1,t))*.8;return `color-mix(in oklch, var(--orb-chart-1) ${Math.round(o*100)}%, transparent)`},Mp=({data:t})=>{if(t.length===0)return e(L,{variant:"body2",muted:true,children:"No data"});let r=Array.from(new Set(t.map(i=>i.x))),o=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 e("div",{style:{overflowX:"auto"},children:c("div",{style:{display:"grid",gridTemplateColumns:`120px repeat(${r.length}, minmax(64px, 1fr))`,gap:1,minWidth:120+r.length*64},children:[e("div",{}),r.map(i=>e(L,{variant:"caption",sx:{textAlign:"center",fontWeight:600},children:i},i)),o.map(i=>c("div",{style:{display:"contents"},children:[e(L,{variant:"caption",sx:{alignSelf:"center"},children:i}),r.map(s=>{let l=a.get(`${i}__${s}`)||0,d=l/n;return e("div",{sx:{height:36,borderRadius:1,background:Hb(d),border:"1px solid color-mix(in oklch, var(--orb-muted) 20%, transparent)",display:"flex",alignItems:"center",justifyContent:"center"},children:e(L,{variant:"caption",sx:{fontWeight:700},children:l.toFixed(1)})},`${i}-${s}`)})]},i))]})})};T();var zb=["var(--orb-chart-1)","var(--orb-chart-2)","var(--orb-chart-5)","var(--orb-chart-negative)","var(--orb-chart-4)","var(--orb-chart-3)"],xi=({data:t,variant:r="donut",colors:o=zb,size:n=180,activeName:a,onItemClick:i})=>{if(t.length===0)return e(L,{variant:"body2",muted:true,children:"No data"});let s=0,l=t.map((d,p)=>{let u=s;return s+=d.percent,`${o[p%o.length]} ${u}% ${s}%`});return c(ie,{direction:{xs:"column",sm:"row"},spacing:2,alignItems:"center",children:[e("div",{style:{width:n,height:n,borderRadius:"50%",background:`conic-gradient(${l.join(", ")})`,position:"relative",flexShrink:0},children:r==="donut"&&e("div",{style:{position:"absolute",inset:Math.round(n*.18),background:"background.paper",borderRadius:"50%"}})}),e(ie,{spacing:1,sx:{minWidth:180},children:t.map((d,p)=>c("div",{onClick:()=>i?.(d),sx:{display:"flex",alignItems:"center",gap:1,cursor:i?"pointer":"default",opacity:a&&d.name!==a?.45:1},children:[e("div",{style:{width:10,height:10,borderRadius:"50%",background:o[p%o.length]}}),e(L,{variant:"caption",sx:{flex:1},children:d.name}),c(L,{variant:"caption",sx:{fontWeight:700},children:[d.percent.toFixed(0),"%"]})]},d.name))})]})};T();var Dp=({effect:t,branches:r})=>{if(r.length===0)return e(L,{variant:"body2",muted:true,children:"No data"});let o=r.filter((a,i)=>i%2===0),n=r.filter((a,i)=>i%2===1);return c(ie,{spacing:1.5,children:[e("div",{style:{display:"grid",gridTemplateColumns:`repeat(${Math.max(o.length,1)}, minmax(0, 1fr))`,gap:1},children:o.map(a=>c("div",{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[e(L,{variant:"caption",sx:{fontWeight:700},children:a.title}),a.causes.map(i=>e(L,{variant:"caption",muted:true,sx:{display:"block"},children:i},i))]},a.title))}),c("div",{style:{position:"relative",height:32},children:[e("div",{style:{position:"absolute",inset:"50% 0 auto 0",borderTop:"2px solid",borderColor:"primary.main"}}),e("div",{sx:{position:"absolute",right:0,top:"calc(50% - 12px)",px:1,py:.25,borderRadius:1,background:"primary.main",color:"primary.contrastText"},children:e(L,{variant:"caption",sx:{fontWeight:700},children:t})})]}),e("div",{style:{display:"grid",gridTemplateColumns:`repeat(${Math.max(n.length,1)}, minmax(0, 1fr))`,gap:1},children:n.map(a=>c("div",{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[e(L,{variant:"caption",sx:{fontWeight:700},children:a.title}),a.causes.map(i=>e(L,{variant:"caption",muted:true,sx:{display:"block"},children:i},i))]},a.title))})]})};T();var Np=({data:t,height:r=240})=>{if(t.length===0)return e(L,{variant:"body2",muted:true,children:"No data"});let o=0,n=t.map(f=>{let b=f.type==="total"?0:o,m=f.type==="total"?f.value:o+f.value;return f.type!=="total"&&(o=m),{...f,start:b,end:m,delta:m-b}}),a=n.flatMap(f=>[f.start,f.end]),i=Math.min(...a,0),s=Math.max(...a,1),l=680,d=30,p=s-i||1,u=f=>r-d-(f-i)/p*(r-d*2);return c("div",{children:[c("div",{component:"svg",viewBox:`0 0 ${l} ${r}`,style:{width:"100%",height:r},children:[e("line",{x1:d,y1:u(0),x2:l-d,y2:u(0),style:{stroke:"var(--orb-chart-grid)"}}),n.map((f,b)=>{let m=(l-d*2)/n.length,v=Math.max(m*.55,8),y=d+b*m+(m-v)/2,g=u(Math.max(f.start,f.end)),x=u(Math.min(f.start,f.end)),h=f.type==="total"?"var(--orb-chart-1)":f.delta>=0?"var(--orb-chart-positive)":"var(--orb-chart-negative)";return c("g",{children:[e("rect",{x:y,y:g,width:v,height:Math.max(x-g,4),rx:6,style:{fill:h}}),e("text",{x:y+v/2,y:g-6,textAnchor:"middle",fill:"currentColor",fontSize:"11",children:f.end.toFixed(1)})]},f.name)})]}),e("div",{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${n.length}, minmax(0, 1fr))`,gap:1},children:n.map(f=>e(L,{variant:"caption",title:f.name,children:f.name},f.name))})]})};var ta=({apiKey:t,query:r,zoom:o=14,mapType:n="roadmap"})=>{let a=encodeURIComponent(r);return `https://www.google.com/maps/embed/v1/place?key=${encodeURIComponent(t)}&q=${a}&zoom=${o}&maptype=${n}`},FR=(t,r=360)=>{let o=ta(t);return `<iframe width="100%" height="${r}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${o}"></iframe>`};T();var Ap=({apiKey:t,query:r,embedUrl:o,zoom:n=14,mapType:a="roadmap",height:i=320})=>{let s=o||(t&&r?ta({apiKey:t,query:r,zoom:n,mapType:a}):"");return s?c("div",{children:[e("div",{component:"iframe",src:s,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:i,border:0,borderRadius:2}}),c(L,{variant:"caption",muted:true,sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",e("a",{href:s,target:"_blank",rel:"noreferrer",children:"Google Maps"})]})]}):e("div",{children:e(L,{variant:"body2",muted:true,children:"Google Map requires `embedUrl` or (`apiKey` + `query`)."})})};var Si=({keyword:t,location:r,src:o="orbcafe-ui"})=>{if(r){let n=encodeURIComponent(r.name||t||"Location");return `https://uri.amap.com/marker?position=${r.lng},${r.lat}&name=${n}&src=${encodeURIComponent(o)}&coordinate=gaode&callnative=0`}return t?`https://uri.amap.com/search?keyword=${encodeURIComponent(t)}&src=${encodeURIComponent(o)}&callnative=0`:"https://uri.amap.com/search?keyword=%E5%8C%97%E4%BA%AC&src=orbcafe-ui&callnative=0"};T();var Ep=({keyword:t,location:r,embedUrl:o,height:n=320})=>{let a=o||Si({keyword:t,location:r?{lng:r.lng,lat:r.lat,name:r.name}:void 0});return c("div",{children:[e("div",{component:"iframe",src:a,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:n,border:0,borderRadius:2}}),c(L,{variant:"caption",muted:true,sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",e("a",{href:a,target:"_blank",rel:"noreferrer",children:"AMap"})]})]})};T();var Lp=({billableByPrimary:t,efficiencyBySecondary:r,statusDistribution:o,interaction:n})=>{let{t:a}=pe();return c("div",{style:{display:"grid",gap:12,gridTemplateColumns:"repeat(auto-fit, minmax(320px, 1fr))"},children:[e(Ci,{title:a("graph.chart.billable.title"),subtitle:a("graph.chart.billable.subtitle"),children:e(ea,{data:t,orientation:"horizontal",activeName:n?.filters?.primaryDimension,onItemClick:i=>n?.onPrimaryDimensionClick?.(i.name)})}),e(Ci,{title:a("graph.chart.efficiency.title"),subtitle:a("graph.chart.efficiency.subtitle"),children:e(ea,{data:r,orientation:"vertical",valueSuffix:"%",activeName:n?.filters?.secondaryDimension,onItemClick:i=>n?.onSecondaryDimensionClick?.(i.name)})}),e(Ci,{title:a("graph.chart.status.title"),subtitle:a("graph.chart.status.subtitle"),children:e(xi,{data:o,variant:"donut",activeName:n?.filters?.status,onItemClick:i=>n?.onStatusClick?.(i.name)})})]})};T();var Wb=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],$b=["zh","en","de","fr","ja","ko"],Op=({open:t,onClose:r,value:o,onSaveAll:n,modelOptions:a=Wb,promptLangOptions:i=$b,analysisTemplateOptions:s=[],responseTemplateOptions:l=[],defaultAnalysisTemplateId:d,defaultResponseTemplateId:p})=>{let[u,f]=Jt.useState(o),[b,m]=Jt.useState(d||""),[v,y]=Jt.useState(p||""),[g,x]=Jt.useState(false);Jt.useEffect(()=>{t&&(f(o),m(d||""),y(p||""));},[t,o,d,p]);let h=(P,w)=>{f(k=>({...k,[P]:w}));},C=async()=>{if(n)try{x(!0),await n({settings:u,analysisTemplateId:b||void 0,responseTemplateId:v||void 0});}finally{x(false);}};return c(zt,{open:t,onClose:r,fullWidth:true,maxWidth:"lg",children:[c("div",{className:"orb-dialog-title",sx:{pr:7,pb:2.2},children:[e(L,{variant:"h5",sx:{fontWeight:800},children:"AI Settings"}),e(L,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:"Configure LLM settings and editable agent prompts by language."}),e(ae,{onClick:r,sx:{position:"absolute",right:12,top:12},children:e(So,{})})]}),e("div",{className:"orb-dialog-content",sx:{pt:"18px !important"},children:c(ie,{spacing:2.2,children:[c("div",{sx:{mt:.8,display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",md:"repeat(2, minmax(0, 1fr))"}},children:[e("div",{children:e(ze,{size:"small",value:u.baseUrl,onChange:P=>h("baseUrl",P.target.value),fullWidth:true,label:"Base URL"})}),e("div",{children:e(ze,{size:"small",type:"password",value:u.apiKey,onChange:P=>h("apiKey",P.target.value),fullWidth:true,label:"API Key"})}),e("div",{children:e(ze,{size:"small",value:u.model,onChange:P=>h("model",P.target.value),fullWidth:true,select:true,label:"Model",children:a.map(P=>e("option",{value:P,children:P},P))})}),e("div",{children:e(ze,{size:"small",value:u.promptLang,onChange:P=>h("promptLang",P.target.value),fullWidth:true,select:true,label:"Prompt Lang",children:i.map(P=>e("option",{value:P,children:P},P))})})]}),c("div",{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[c(ze,{size:"small",value:b,onChange:P=>m(P.target.value),fullWidth:true,select:true,label:"Analysis Template",children:[e("option",{value:"",children:"Default"}),s.map(P=>e("option",{value:P.id,children:P.label},P.id))]}),e(zn,{multiline:true,minRows:8,value:u.analysisPrompt,onChange:P=>h("analysisPrompt",P.target.value),fullWidth:true,label:"Analysis Prompt",sx:{"& textarea":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}}),c(ze,{size:"small",value:v,onChange:P=>y(P.target.value),fullWidth:true,select:true,label:"Response Template",children:[e("option",{value:"",children:"Default"}),l.map(P=>e("option",{value:P.id,children:P.label},P.id))]}),e(zn,{multiline:true,minRows:8,value:u.responsePrompt,onChange:P=>h("responsePrompt",P.target.value),fullWidth:true,label:"Response Prompt",sx:{"& textarea":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}})]})]})}),c("div",{className:"orb-dialog-actions",sx:{px:3,pb:2.5,pt:1.2,gap:1},children:[e(Ce,{variant:"outlined",onClick:r,children:"Cancel"}),e(Ce,{variant:"contained",onClick:C,disabled:!n||g,children:"Save"})]})]})};T();var ki=({open:t,onClose:r,model:o,tableContent:n,extraCharts:a,interaction:i,aiAssistant:s})=>{let{t:l}=pe(),[d,p]=Jt.useState(s?.defaultPrompt||""),[u,f]=Jt.useState(false),[b,m]=Jt.useState(false),v=i?.enabled!==false&&!!i,y=s?.enabled!==false,g=i?.filters||{},x=!!(g.primaryDimension||g.secondaryDimension||g.status),h=s?.placeholder||"Ask AI to analyze data, create charts, or find insights...";Jt.useEffect(()=>{t&&p(s?.defaultPrompt||"");},[t,s?.defaultPrompt]);let C=s?.settings||{baseUrl:"/llm-api",apiKey:"",model:"doubao-lite",promptLang:"zh",analysisPrompt:"",responsePrompt:""},P=async()=>{let w=d.trim();if(!(!w||!s?.onSubmit))try{f(!0),await s.onSubmit(w,{filters:g,model:o});}finally{f(false);}};return e(zt,{open:t,onClose:r,fullWidth:true,maxWidth:1400,hideCloseButton:true,children:c("div",{style:{height:"80vh",display:"flex",flexDirection:"column",background:"var(--orb-canvas)"},children:[e("div",{style:{padding:16,borderBottom:"1px solid var(--orb-border)"},children:c(ie,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:12,children:[c(ie,{direction:"row",spacing:10,alignItems:"center",sx:{flexWrap:"wrap"},children:[e(L,{variant:"h3",sx:{fontWeight:800},children:o.title}),e(Pt,{label:l("graph.records",{count:o.kpis.totalRecords})}),v&&g.primaryDimension&&e(Pt,{tone:"outline",label:`${i?.fieldMapping.primaryDimension}: ${g.primaryDimension}`,onDelete:()=>i?.onClearFilter("primaryDimension")}),v&&g.secondaryDimension&&e(Pt,{tone:"outline",label:`${i?.fieldMapping.secondaryDimension}: ${g.secondaryDimension}`,onDelete:()=>i?.onClearFilter("secondaryDimension")}),v&&g.status&&e(Pt,{tone:"outline",label:`${i?.fieldMapping.status}: ${g.status}`,onDelete:()=>i?.onClearFilter("status")}),v&&x&&e(Ce,{size:"small",variant:"ghost",onClick:()=>i?.onClearAll(),children:"Clear"})]}),c(ie,{direction:"row",spacing:10,alignItems:"center",children:[y&&c("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:[e(ae,{size:"small",onClick:s?.onVoiceInput,children:e(Aa,{size:16,strokeWidth:1.8})}),e("input",{className:"orb-inp orb-inp-dense",value:d,onChange:w=>p(w.target.value),onKeyDown:w=>{w.key==="Enter"&&(w.preventDefault(),P());},placeholder:h,style:{fontSize:14,border:"none",background:"transparent",flex:1,minWidth:0}}),e(ae,{size:"small",onClick:P,disabled:u||!d.trim(),children:e(Vc,{size:16,strokeWidth:1.8})}),e(ae,{size:"small",onClick:()=>m(true),children:e(Jo,{size:16,strokeWidth:1.8})})]}),e(ae,{onClick:r,children:e(Zt,{size:18,strokeWidth:2})})]})]})}),c("div",{style:{padding:16,display:"flex",flexDirection:"column",gap:12,overflow:"auto",minHeight:0},children:[e(Tp,{kpis:o.kpis}),e(Lp,{billableByPrimary:o.charts.billableByPrimary,efficiencyBySecondary:o.charts.efficiencyBySecondary,statusDistribution:o.charts.statusDistribution,interaction:v?{filters:g,onPrimaryDimensionClick:w=>i?.onPrimaryDimensionClick(w),onSecondaryDimensionClick:w=>i?.onSecondaryDimensionClick(w),onStatusClick:w=>i?.onStatusClick(w)}:void 0}),a,n]}),e(Op,{open:b,onClose:()=>m(false),value:C,onSaveAll:s?.onSaveAll,modelOptions:s?.modelOptions,promptLangOptions:s?.promptLangOptions,analysisTemplateOptions:s?.analysisTemplateOptions,responseTemplateOptions:s?.responseTemplateOptions,defaultAnalysisTemplateId:s?.defaultAnalysisTemplateId,defaultResponseTemplateId:s?.defaultResponseTemplateId})]})})};var Io={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"]},_b=5,Fp=t=>t.toLowerCase().replace(/[\s_-]/g,""),Ro=(t,r,o,n)=>{if(r)return r;if(t.length===0)return n;let a=Object.keys(t[0]),i=new Map(a.map(s=>[Fp(s),s]));for(let s of o){let l=i.get(Fp(s));if(l)return l}return a[0]||n},Pr=t=>{if(typeof t=="number")return Number.isFinite(t)?t:0;if(typeof t=="string"){let r=Number(t.replace(/,/g,"").trim());return Number.isFinite(r)?r:0}return 0},mr=(t,r)=>t==null||t===""?r:String(t),Ub=(t,r,o,n,a)=>{let i=new Map;return t.forEach(s=>{let l=mr(s[r],a);i.set(l,(i.get(l)||0)+Pr(s[o]));}),Array.from(i.entries()).map(([s,l])=>({name:s,value:l})).sort((s,l)=>l.value-s.value).slice(0,n)},Kb=(t,r,o,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=mr(l[r],i),p=s.get(d)||{report:0,billable:0};p.report+=Pr(l[o]),p.billable+=Pr(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)},qb=(t,r,o)=>{let n=t.length;if(n===0)return [];let a=new Map;return t.forEach(i=>{let s=mr(i[r],o);a.set(s,(a.get(s)||0)+1);}),Array.from(a.entries()).map(([i,s])=>({name:i,value:s,percent:s/n*100}))},Bp=(t,r,o)=>{let n=new Map;return t.forEach(a=>{let i=mr(a[r],"N/A");n.set(i,(n.get(i)||0)+Pr(a[o]));}),Array.from(n.entries()).sort(([a],[i])=>a.localeCompare(i)).map(([a,i])=>({name:a,value:i}))},Xb=(t,r,o,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=mr(l[r],i),p=s.get(d)||{report:0,billable:0};p.report+=Pr(l[o]),p.billable+=Pr(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)},Yb=(t,r,o,n,a)=>{let i=new Map;return t.forEach(s=>{let l=mr(s[r],a),d=mr(s[o],a),p=`${l}__${d}`;i.set(p,(i.get(p)||0)+Pr(s[n]));}),Array.from(i.entries()).map(([s,l])=>{let[d,p]=s.split("__");return {x:d,y:p,value:l}})},Zb=(t,r,o)=>{let n=Bp(t,r,o),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"}]},jb=(t,r,o,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=mr(l[r],i),p=`${mr(l[o],i)} / ${mr(l[n],i)}`,u=s.get(d)||new Map;u.set(p,(u.get(p)||0)+1),s.set(d,u);}),Array.from(s.entries()).map(([l,d])=>({title:l,causes:Array.from(d.entries()).sort((p,u)=>u[1]-p[1]).slice(0,a).map(([p,u])=>`${p} (${u})`)})).slice(0,6)},pn=({rows:t,config:r})=>{let{t:o}=pe(),n=o("graph.unassigned"),a=Jt.useMemo(()=>{let u=r?.fieldMapping;return {primaryDimension:Ro(t,u?.primaryDimension,Io.primaryDimension,"Category"),secondaryDimension:Ro(t,u?.secondaryDimension,Io.secondaryDimension,"Owner"),status:Ro(t,u?.status,Io.status,"Status"),date:Ro(t,u?.date,Io.date,"Date"),description:Ro(t,u?.description,Io.description,"Description"),reportHours:Ro(t,u?.reportHours,Io.reportHours,"ReportHours"),billableHours:Ro(t,u?.billableHours,Io.billableHours,"BillableHours"),amount:Ro(t,u?.amount,Io.amount,"Amount")}},[t,r?.fieldMapping]),i=Jt.useMemo(()=>t.map((u,f)=>{let b=Pr(u[a.reportHours]),m=Pr(u[a.billableHours]),v=Pr(u[a.amount]),y=b>0?m/b*100:0;return {id:`graph-row-${f}`,Date:mr(u[a.date],""),Primary:mr(u[a.primaryDimension],n),Secondary:mr(u[a.secondaryDimension],n),Description:mr(u[a.description],""),ReportHours:b,BillableHours:m,Amount:v,Efficiency:y,Status:mr(u[a.status],n)}}),[t,a,n]),s=Jt.useMemo(()=>{let u=i.length,f=i.reduce((x,h)=>x+Pr(h.ReportHours),0),b=i.reduce((x,h)=>x+Pr(h.BillableHours),0),m=i.reduce((x,h)=>x+Pr(h.Amount),0),v=f>0?b/f*100:0,y=r?.statusFlagValues||["flag","flagged","warning","risk"],g=i.filter(x=>y.includes(mr(x.Status,"").toLowerCase())).length;return {totalRecords:u,totalReportHours:f,totalBillableHours:b,efficiency:v,totalAmount:m,flaggedCount:g}},[i,r?.statusFlagValues]),l=r?.topN||_b,d=Jt.useMemo(()=>({billableByPrimary:Ub(i,"Primary","BillableHours",l,n),efficiencyBySecondary:Kb(i,"Secondary","ReportHours","BillableHours",l,n),statusDistribution:qb(i,"Status",n),lineByDate:Bp(i,"Date","BillableHours"),comboByPrimary:Xb(i,"Primary","ReportHours","BillableHours",l,n),heatmapPrimarySecondary:Yb(i,"Primary","Secondary","BillableHours",n),waterfallBillable:Zb(i,"Date","BillableHours"),fishboneStatusCauses:jb(i,"Status","Primary","Secondary",3,n)}),[i,l,n]),p=Jt.useMemo(()=>({title:r?.title||o("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:o("graph.column.reportHours"),align:"right"},{id:"BillableHours",label:o("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,r?.title,a,s,i,o]);return {fieldMapping:a,model:p}};var un=t=>String(t??"").trim(),Ti=(t={})=>{let[r,o]=Jt.useState(t),n=Jt.useCallback((d,p)=>{o(u=>{let f=p?.trim();if(!f){let b={...u};return delete b[d],b}if(u[d]===f){let b={...u};return delete b[d],b}return {...u,[d]:f}});},[]),a=Jt.useCallback(d=>{o(p=>{if(!p[d])return p;let u={...p};return delete u[d],u});},[]),i=Jt.useCallback(()=>{o({});},[]),s=Jt.useMemo(()=>!!(r.primaryDimension||r.secondaryDimension||r.status),[r]),l=Jt.useCallback((d,p)=>d.filter(u=>!(r.primaryDimension&&un(u[p.primaryDimension])!==un(r.primaryDimension)||r.secondaryDimension&&un(u[p.secondaryDimension])!==un(r.secondaryDimension)||r.status&&un(u[p.status])!==un(r.status))),[r]);return {filters:r,setFilter:n,clearFilter:a,clearAll:i,hasActiveFilters:s,applyRows:l}};T();var Ri=({variants:t,currentVariantId:r,onLoad:o,onSave:n,onDelete:a,onSetDefault:i})=>{let{t:s}=pe(),[l,d]=Jt.useState(false),[p,u]=Jt.useState(""),[f,b]=Jt.useState(false),[m,v]=Jt.useState(false),y=t.find(h=>h.id===r),g=()=>{u(y?.name||s("variant.newVariant")),b(y?.isDefault||false),v(y?.isPublic||false),d(true);},x=()=>{n({name:p,isDefault:f,isPublic:m,description:""}),d(false);};return c("div",{className:"orb-variant-management",children:[e(Wt,{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:r||"",options:[{value:"",label:s("variant.selectVariant"),disabled:true},...t.map(h=>({value:h.id,label:h.name+(h.isDefault?` (${s("variant.defaultSuffix")})`:"")}))],onChange:h=>{let C=t.find(P=>P.id===h.target.value);C&&o(C);}}),e(lt,{title:s("variant.saveView"),children:e(ae,{className:"orb-variant-save-button",onClick:g,size:"small",color:"primary",children:e(ko,{fontSize:"small"})})}),c(zt,{open:l,onClose:()=>d(false),children:[e("div",{className:"orb-dialog-title",children:s("variant.saveView")}),c("div",{className:"orb-dialog-content",children:[e(ze,{autoFocus:true,margin:"dense",label:s("variant.viewName"),fullWidth:true,variant:"outlined",value:p,onChange:h=>u(h.target.value)}),e(Zn,{control:e(Dt,{checked:f,onChange:h=>b(h.target.checked)}),label:s("variant.setDefault")}),e(Zn,{control:e(Dt,{checked:m,onChange:h=>v(h.target.checked)}),label:s("variant.publicAllUsers")})]}),c("div",{className:"orb-dialog-actions",children:[e(Ce,{onClick:()=>d(false),children:s("common.cancel")}),e(Ce,{onClick:x,variant:"contained",children:s("common.save")})]})]})]})};T();var zp=({appId:t,tableKey:r="default",currentFilters:o,currentLayoutId:n,layoutRefs:a,onLoad:i,variantService:s,serviceUrl:l,onError:d,onSuccess:p,currentVariantId:u,onVariantChange:f})=>{let{t:b}=pe(),[m,v]=Jt.useState([]),[y,g]=Jt.useState(""),x=`orbcafe.variants.${t}.${r}`,h=u!==void 0?u:y,C=A=>{u===void 0&&g(A),f&&f(A);},P=Jt.useCallback(()=>{try{let A=localStorage.getItem(x);if(!A)return [];let N=JSON.parse(A);return Array.isArray(N)?N:[]}catch{return []}},[x]),w=Jt.useCallback(A=>{try{localStorage.setItem(x,JSON.stringify(A));}catch{}},[x]),k=Jt.useCallback(A=>{v(A);let N=A.find(O=>O.isDefault);N&&!h&&(C(N.id),i(N));},[h,i,C]),R=Jt.useCallback(async()=>{if(!t)return [];try{let A=[];if(s)A=await s.getVariants(t,r);else if(l){let N=await fetch(`${l}/api/variants?appId=${encodeURIComponent(t)}&tableKey=${encodeURIComponent(r)}`);if(!N.ok)throw new Error(b("variant.toast.fetchFailed"));A=await N.json();}else A=P();return k(A),A}catch(A){console.error("Error fetching variants",A);let N=P();return k(N),d&&d(b("variant.toast.fetchFailed")),N}},[t,r,s,l,P,k,d,b]);return Jt.useEffect(()=>{R();},[t,r]),e(Ri,{variants:m,currentVariantId:h,onLoad:A=>{C(A.id),i(A);},onSave:async A=>{let N=Date.now().toString(),O;try{let F=A.scope||"Both",q=m.find(_=>_.name===A.name);N=q?q.id:Date.now().toString();let z=[];if(q&&(Array.isArray(q.filters)?z=[...q.filters]:q.filters&&(z=[{scope:"default",filters:q.filters}])),F==="Search"||F==="Both"){let _=(Array.isArray(o),o);if(_)if(Array.isArray(_)&&_.length>0&&_[0].scope)_.forEach(V=>{let B=z.findIndex(Z=>Z.scope===V.scope);B>=0?z[B]=V:z.push(V);});else {let V={scope:r,filters:_},B=z.findIndex(Z=>Z.scope===r);B>=0?z[B]=V:z.push(V);}}let X=q?.layout||{},$=[];if(q&&Array.isArray(q.layoutRefs)&&($=[...q.layoutRefs]),F==="Layout"||F==="Both")if(a&&a.length>0)a.forEach(_=>{let V=$.findIndex(B=>B.tableKey===_.tableKey);V>=0?$[V]=_:$.push(_);});else {let _={tableKey:r,layoutId:n||null},V=$.findIndex(B=>B.tableKey===r);V>=0?$[V]=_:$.push(_);}if(O={appId:t,tableKey:r,...A,scope:F,id:N,createdAt:new Date().toISOString(),filters:z,layout:X,layoutRefs:$},s)await s.saveVariant(O,t,r);else if(l){if(!(await fetch(`${l}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(O)})).ok)throw new Error(b("variant.toast.saveFailed"))}else {let V=m.some(B=>B.id===N)?m.map(B=>B.id===N?O:B):[...m,O];v(V),w(V);}p&&p(b("variant.toast.saveSuccess")),(s||l)&&await R(),C(N),i(O);}catch(F){console.error("Error saving variant",F);let z=m.some(X=>X.id===N)?m.map(X=>X.id===N?O:X):[...m,O];v(z),w(z),C(N),i(O),d&&d(b("variant.toast.saveFailed"));}},onDelete:async A=>{try{if(s)await s.deleteVariant(A);else if(l){if(!(await fetch(`${l}/api/variants/${A}`,{method:"DELETE"})).ok)throw new Error(b("variant.toast.deleteFailed"))}else {let N=m.filter(O=>O.id!==A);v(N),w(N);}h===A&&C(""),(s||l)&&R(),p&&p(b("variant.toast.deleteSuccess"));}catch(N){console.error("Error deleting variant",N);let O=m.filter(F=>F.id!==A);v(O),w(O),h===A&&C(""),d&&d(b("variant.toast.deleteFailed"));}},onSetDefault:async A=>{try{let N=m.find(F=>F.id===A);if(!N)return;let O={appId:t,tableKey:r,...N,isDefault:!0};if(s)await s.setDefaultVariant(A,t,r);else if(l){if(!(await fetch(`${l}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(O)})).ok)throw new Error(b("variant.toast.defaultFailed"))}else {let F=m.map(q=>({...q,isDefault:q.id===A}));v(F),w(F);}(s||l)&&await R(),p&&p(b("variant.toast.defaultSuccess"));}catch(N){console.error("Error setting default variant",N);let O=m.map(F=>({...F,isDefault:F.id===A}));v(O),w(O),d&&d(b("variant.toast.defaultFailed"));}}})};T();ro__default.default.extend(oh__default.default);ro__default.default.extend(nh__default.default);ro__default.default.extend(Gf__default.default);var oa="YYYY-MM-DD",ih=[null,null],zo="0.85rem",sh={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},lh=({isInRange:t,isStart:r,isEnd:o,isHovered:n,disableMargin:a,sx:i,...s})=>{let l=sr();return e(Rd,{...s,sx:[...Array.isArray(i)?i:i?[i]:[],t?{borderRadius:0,backgroundColor:l.palette.primary.light,color:l.palette.primary.contrastText}:{},n&&!t&&!r&&!o?{borderRadius:0,backgroundColor:l.palette.action.hover,border:`1px dashed ${l.palette.primary.main}`}:{},r?{borderRadius:"50% 0 0 50%",backgroundColor:l.palette.primary.main,color:l.palette.primary.contrastText}:{},o?{borderRadius:"0 50% 50% 0",backgroundColor:l.palette.primary.main,color:l.palette.primary.contrastText}:{},r&&o?{borderRadius:"50%"}:{}]})},Wp=({label:t,value:r=ih,onChange:o})=>{let{t:n,locale:a}=pe(),i=sh[a]||"en",s=t||n("dateRange.label"),[l,d]=Jt.useState(null),[p,u]=Jt.useState(r),[f,b]=Jt.useState("start"),[m,v]=Jt.useState(null),[y,g]=Jt.useState((r[0]||ro__default.default()).locale(i)),[x,h]=Jt.useState(""),[C,P]=Jt.useState(""),[w,k]=Jt.useState(false),[R,S]=Jt.useState(false),E=Jt__namespace.default.useRef(r);Jt.useEffect(()=>{let[_,V]=r,[B,Z]=E.current,Q=le=>le&&typeof le.isSame=="function",ge=!(_===null&&B===null||Q(_)&&Q(B)&&_.isSame(B,"day")),se=!(V===null&&Z===null||Q(V)&&Q(Z)&&V.isSame(Z,"day"));(ge||se)&&(u(r),r[0]&&Q(r[0])&&g(r[0].locale(i))),E.current=r;},[r,i]),Jt.useEffect(()=>{h(p[0]?p[0].locale(i).format(oa):""),P(p[1]?p[1].locale(i).format(oa):""),k(false),S(false);},[p,i]);let D=(_,V)=>{let B=V.trim(),Z=_==="start"?k:S;if(!B){let se=_==="start"?[null,p[1]]:[p[0],null];Z(false),u(se);return}let Q=ro__default.default(B,oa,true).locale(i);if(!Q.isValid()){Z(true);return}Z(false);let ge=[...p];if(_==="start")ge[0]=Q,ge[1]&&Q.isAfter(ge[1],"day")&&(ge[1]=null),b(ge[1]?"start":"end");else {let se=ge[0];se&&Q.isBefore(se,"day")?(ge=[Q,null],b("end")):(ge[1]=Q,b("start"));}u(ge),g(Q);},I=_=>{d(_.currentTarget);},A=()=>{d(null),b("start"),v(null);},N=!!l,O=_=>{if(!_)return;let V=[...p];if(f==="start")V=[_,null],b("end");else {let B=V[0];B&&_.isBefore(B)?(V=[_,null],b("end")):(V=[B,_],b("start"));}u(V);},F=_=>{let V=ro__default.default().locale(i),B=[null,null];switch(_){case "today":B=[V,V];break;case "week":B=[V.startOf("week"),V.endOf("week")];break;case "month":B=[V.startOf("month"),V.endOf("month")];break}u(B),b("start"),g(V);},q=()=>{o&&o(p),A();},z=()=>{u(r),b("start"),A();},X=Jt.useCallback(_=>{let{day:V,...B}=_,[Z,Q]=p,ge=Z?V.isSame(Z,"day"):false,se=Q?V.isSame(Q,"day"):false,le=Z&&Q?V.isBetween(Z,Q,"day","()"):false,be=false;return f==="end"&&Z&&!Q&&m&&V.isAfter(Z,"day")&&V.isBefore(m.add(1,"day"),"day")&&(be=true),e(lh,{...B,day:V,disableMargin:true,isStart:ge,isEnd:se,isInRange:le||be,onMouseEnter:()=>v(V)})},[p,f,m]),$=_=>_?_.locale(i).format("YYYY-MM-DD"):"";return c("div",{className:"orb-date-range-picker",children:[e(ze,{className:"orb-date-range-field",label:s,value:p[0]?`${$(p[0])} - ${$(p[1])}`:"",onClick:I,fullWidth:true,size:"small",InputLabelProps:{sx:{fontSize:zo}},InputProps:{readOnly:true,sx:{fontSize:zo,"& .orb-inp":{fontSize:zo},paddingRight:"4px"},endAdornment:e(ae,{className:"orb-date-range-calendar-trigger",size:"small",onClick:I,tooltip:s,children:e(Mt,{name:"calendar",size:16})})}}),c(ei,{open:N,anchorEl:l,onClose:A,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},className:"orb-date-range-popover",children:[e("div",{className:"orb-date-range-inputs",children:c(ie,{className:"orb-date-range-input-row",direction:"row",alignItems:"center",spacing:1.5,justifyContent:"space-between",children:[e(ze,{className:"orb-date-range-manual-field",label:n("dateRange.startDate"),placeholder:oa,value:x,error:w,size:"small",onFocus:()=>b("start"),onChange:_=>{h(_.target.value),w&&k(false);},onBlur:()=>D("start",x),onKeyDown:_=>{_.key==="Enter"&&(_.preventDefault(),D("start",x));},sx:{"& .orb-inp":{fontSize:zo,py:.75},"& label":{fontSize:zo}}}),e(Ad,{color:"action",fontSize:"small"}),e(ze,{className:"orb-date-range-manual-field",label:n("dateRange.endDate"),placeholder:oa,value:C,error:R,size:"small",onFocus:()=>{p[0]&&b("end");},onChange:_=>{P(_.target.value),R&&S(false);},onBlur:()=>D("end",C),onKeyDown:_=>{_.key==="Enter"&&(_.preventDefault(),D("end",C));},sx:{"& .orb-inp":{fontSize:zo,py:.75},"& label":{fontSize:zo}}})]})}),e("div",{className:"orb-date-range-shortcuts",children:c(ie,{direction:"row",spacing:1,justifyContent:"center",children:[e(Pt,{label:n("dateRange.today"),onClick:()=>F("today"),clickable:true,size:"small",variant:"outlined"}),e(Pt,{label:n("dateRange.thisWeek"),onClick:()=>F("week"),clickable:true,size:"small",variant:"outlined"}),e(Pt,{label:n("dateRange.thisMonth"),onClick:()=>F("month"),clickable:true,size:"small",variant:"outlined"})]})}),e("div",{className:"orb-date-range-calendar",children:e(Dd,{dateAdapter:Za,adapterLocale:i,children:e(Md,{value:null,referenceDate:y,onMonthChange:g,onYearChange:g,onChange:O,slots:{day:X},views:["year","month","day"],openTo:"day",showDaysOutsideCurrentMonth:true})})}),e(At,{}),c(ie,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{p:2},children:[e(Ce,{size:"small",onClick:z,color:"inherit",children:n("common.cancel")}),e(Ce,{size:"small",variant:"contained",onClick:q,children:n("common.done")})]})]})]})};T();var Di={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},ph={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"},uh=["contains","notContains",">",">=","<","<=","equals"],Gp=["=","!=",">","<",">=","<=","between"],or="0.85rem",mh=({field:t,value:r,onChange:o})=>{let{t:n}=pe(),[a,i]=Jt.useState(null),[s,l]=Jt.useState(null),[d,p]=Jt.useState(null),[u,f]=Jt.useState(""),[b,m]=Jt.useState(""),[v,y]=Jt.useState(""),[g,x]=Jt.useState("");Jt.useEffect(()=>{let I=setTimeout(()=>{x(v);},1e3);return ()=>clearTimeout(I)},[v]);let h=r?.operator||(t.type==="number"?"=":"equals"),C=r?.value,P=I=>{let A=ph[I];return A?n(A):I},w=I=>{i(a?null:I.currentTarget);},k=I=>{o({...r,operator:I,value:C}),i(null);},R={size:"small",fullWidth:true,variant:"outlined",InputLabelProps:{sx:{fontSize:or}},InputProps:{sx:{fontSize:or}},SelectProps:{MenuProps:{PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:or,paddingTop:"4px",paddingBottom:"4px",minHeight:"auto"}}}}}},S=t.type||"text";if(S==="date"){let A=(N=>{if(!N)return [null,null];if(Array.isArray(N)&&N.length===2){let O=N[0]?ro__default.default.isDayjs(N[0])?N[0]:ro__default.default(N[0]):null,F=N[1]?ro__default.default.isDayjs(N[1])?N[1]:ro__default.default(N[1]):null;return [O,F]}return ro__default.default.isDayjs(N)||typeof N=="string"?[ro__default.default.isDayjs(N)?N:ro__default.default(N),null]:[null,null]})(C);return e(Wp,{label:t.label,value:A,onChange:N=>o({value:N,operator:"between"})})}if(S==="number"&&h==="between"){let I=()=>{o({value:[u,b],operator:"between"}),l(null);},A=Array.isArray(C)?`${C[0]||""} - ${C[1]||""}`:"";return c(jsxRuntime.Fragment,{children:[e(ze,{...R,label:t.label,value:A,placeholder:n("smartFilter.minMaxPlaceholder"),InputProps:{...R.InputProps,startAdornment:e(io,{position:"start",children:e(lt,{title:P("between"),children:e(ae,{size:"small",onClick:w,sx:{width:24,height:24,fontSize:or},children:Di.between})})}),readOnly:true},onClick:N=>l(s?null:N.currentTarget)}),e(jt,{anchorEl:a,open:!!a,onClose:()=>i(null),PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:or,minHeight:"auto",py:.5}}},children:Gp.map(N=>c("option",{selected:N===h,onClick:()=>k(N),children:[e("div",{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Di[N]}),e(_t,{primary:P(N),primaryTypographyProps:{fontSize:or}})]},N))}),e(ei,{open:!!s,anchorEl:s,onClose:()=>l(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},children:c("div",{sx:{p:2,display:"flex",gap:1,alignItems:"center"},children:[e(ze,{size:"small",label:n("smartFilter.min"),type:"number",value:u,onChange:N=>f(N.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:or}},InputProps:{sx:{fontSize:or}}}),e(Ed,{color:"action"}),e(ze,{size:"small",label:n("smartFilter.max"),type:"number",value:b,onChange:N=>m(N.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:or}},InputProps:{sx:{fontSize:or}}}),e(Ce,{variant:"contained",size:"small",onClick:I,children:n("common.ok")})]})})]})}if(t.isValueHelp||S==="value-help"){let I=t.valueHelp?.mode||"single";return e(hp,{...R,...t.valueHelp,label:t.label,placeholder:t.placeholder||t.valueHelp?.placeholder,value:C??(I==="multiple"?[]:null),mode:I,onChange:A=>o({value:A,operator:I==="multiple"?"anyOf":"equals"})})}if(S==="select")return c(Wt,{size:"small",fullWidth:true,label:t.label,value:C||"",onChange:I=>o({...r,value:I.target.value,operator:"equals"}),children:[e("option",{value:"",children:n("common.none")}),t.options?.map(I=>e("option",{value:I.value,children:I.label},I.value))]});if(S==="multi-select"){let I=Array.isArray(C)?C:[],A=t.options?.filter(X=>X.label.toLowerCase().includes(g.toLowerCase()))||[],N=X=>t.options?.find($=>$.value===X)?.label||X,O=I.map(N),F=O.length===0?n("common.none"):O.length>2?`${O.slice(0,2).join(", ")} +${O.length-2}`:O.join(", "),q=()=>{p(null),y(""),x("");},z=X=>{let $=I.includes(X)?I.filter(_=>_!==X):[...I,X];o({...r,value:$,operator:"anyOf"});};return c("div",{className:"orb-fld",children:[e("label",{children:t.label}),c(Ce,{variant:"outlined",size:"small",onClick:X=>p(d?null:X.currentTarget),sx:{width:"100%",minHeight:36,justifyContent:"space-between",fontSize:or,fontWeight:400},children:[e("span",{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:F}),e(Vr,{fontSize:"small"})]}),e(jt,{anchorEl:d,open:!!d,onClose:q,PaperProps:{sx:{width:280,maxHeight:340,overflowY:"auto",p:.5}},children:c("div",{onClick:X=>X.stopPropagation(),sx:{display:"grid",gap:.35},children:[e(ze,{size:"small",autoFocus:true,placeholder:n("smartFilter.searchPlaceholder"),fullWidth:true,InputProps:{startAdornment:e(io,{position:"start",children:e(Ho,{fontSize:"small"})}),sx:{fontSize:or}},value:v,onChange:X=>y(X.target.value),onKeyDown:X=>X.stopPropagation()}),A.length>0?A.map(X=>{let $=I.includes(X.value);return c("div",{role:"option","aria-selected":$,tabIndex:0,className:`orb-menu-item ${$?"orb-selected":""}`,onClick:()=>z(X.value),onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),z(X.value));},children:[e(Dt,{checked:$,size:"small",inputProps:{tabIndex:-1},sx:{pointerEvents:"none"}}),e(_t,{primary:X.label})]},String(X.value))}):e("div",{className:"orb-menu-item","aria-disabled":"true",children:n("smartFilter.noOptionsFound")})]})})]})}let E=S==="number"?Gp:uh;return c(jsxRuntime.Fragment,{children:[e(ze,{...R,className:"orb-filter-operator-field",label:t.label,sx:{minWidth:"120px"},value:C||"",type:S==="number"?"number":"text",onChange:I=>o({...r,value:I.target.value,operator:h}),InputProps:{...R.InputProps,startAdornment:e(io,{position:"start",children:e(lt,{title:P(h),children:e(ae,{className:"orb-filter-operator-trigger",size:"small",onClick:w,onMouseDown:I=>I.preventDefault(),sx:{width:24,height:24,fontSize:or,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:Di[h]})})}),endAdornment:t.hasSearchIcon?e(io,{position:"end",children:e(Ho,{color:"action"})}):void 0}}),e(jt,{anchorEl:a,open:!!a,onClose:()=>i(null),PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:or,minHeight:"auto",py:.5}}},children:E.map(I=>c("option",{selected:I===h,onClick:()=>k(I),children:[e("span",{className:"orb-filter-operator-symbol",children:Di[I]}),e(_t,{primary:P(I),primaryTypographyProps:{fontSize:or}})]},I))})]})},Wr=({fields:t,filters:r,onFilterChange:o,variants:n=[],currentVariantId:a,onVariantLoad:i,onVariantSave:s,onVariantDelete:l,onVariantSetDefault:d,onSearch:p,loading:u=false,appId:f,tableKey:b,currentLayout:m,currentLayoutId:v,layoutRefs:y,variantService:g,serviceUrl:x})=>{let{t:h}=pe(),[C,P]=Jt.useState(true),[w,k]=Jt.useState(null),[R,S]=Jt.useState(t.filter(A=>!A.hidden).map(A=>A.id)),E=(A,N)=>{o({...r,[A]:N});},D=A=>{R.includes(A)?S(R.filter(N=>N!==A)):S([...R,A]);};return c(Ee,{className:`orb-smart-filter ${C?"orb-smart-filter-expanded":"orb-smart-filter-collapsed"}`,sx:{mb:0,display:"flex",flexDirection:"column",overflow:"visible",position:"relative"},children:[C?c(jsxRuntime.Fragment,{children:[c("div",{className:"orb-smart-filter-header",children:[f?e(zp,{appId:f,tableKey:b,currentFilters:{values:r,visibleFields:R},currentLayout:m,currentLayoutId:v,layoutRefs:y,onLoad:A=>{if(!A.filters)return;let N=null;if(Array.isArray(A.filters)){let O=b||"default",F=A.filters.find(q=>q.scope===O);N=F?F.filters:null;}else N=A.filters;N&&(N.values||N.visibleFields?(N.visibleFields&&Array.isArray(N.visibleFields)&&S(N.visibleFields),N.values&&o(N.values)):o(N)),i&&i(A);},variantService:g,serviceUrl:x,currentVariantId:a}):e(Ri,{variants:n,currentVariantId:a,onLoad:i,onSave:A=>{s&&s({...A,filters:{values:r,visibleFields:R}});},onDelete:l,onSetDefault:d}),c("div",{className:"orb-smart-filter-actions",children:[e(lt,{title:h("smartFilter.addFilters"),children:e(Ce,{className:"orb-smart-filter-adapt",onClick:A=>k(w?null:A.currentTarget),size:"small",color:"primary",startIcon:e(ap,{fontSize:"small"}),sx:{textTransform:"none",fontSize:or,whiteSpace:"nowrap",minWidth:"fit-content"},children:h("smartFilter.adaptFilters")})}),e(ae,{className:"orb-smart-filter-go",tooltip:h("smartFilter.go"),"aria-label":h("smartFilter.go"),onClick:p,disabled:u,children:u?e(Xr,{size:16}):e(Mt,{name:"play",size:16})}),c(jt,{anchorEl:w,open:!!w,onClose:()=>k(null),slotProps:{paper:{style:{maxHeight:400,width:"25ch"},sx:{"& .orb-menu-item, & option":{fontSize:or,minHeight:32}}}},children:[e("option",{disabled:true,children:e(_t,{primary:h("smartFilter.visibleFilters"),primaryTypographyProps:{fontSize:or}})}),e(At,{}),t.map(A=>c("option",{onClick:()=>D(A.id),children:[e(Dt,{checked:R.includes(A.id),size:"small"}),e(_t,{primary:A.label,primaryTypographyProps:{fontSize:or}})]},A.id))]})]})]}),e("div",{className:"orb-smart-filter-grid",children:e(Qs,{container:true,spacing:2,columns:{xs:2,sm:3,md:4,lg:6},children:t.filter(A=>R.includes(A.id)).map(A=>e(Qs,{size:1,children:e(mh,{field:A,value:r[A.id]||{value:"",operator:A.type==="number"?"=":"equals"},onChange:N=>E(A.id,N)})},A.id))})})]}):null,e("div",{className:"orb-smart-filter-toggle",children:e(ae,{className:"orb-smart-filter-toggle-button",size:"small",onClick:()=>P(!C),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:C?e(ni,{className:"orb-smart-filter-toggle-icon",sx:{fontSize:20},color:"action"}):e(Vr,{className:"orb-smart-filter-toggle-icon",sx:{fontSize:20},color:"action"})})})]})};T();var _p=({layouts:t,currentLayoutId:r,onLoad:o,onSave:n,onDelete:a,onSetDefault:i})=>{let{t:s}=pe(),[l,d]=Jt.useState(null),[p,u]=Jt.useState(false),[f,b]=Jt.useState(""),[m,v]=Jt.useState(""),[y,g]=Jt.useState({isDefault:false,isPublic:false}),x=t.find(R=>R.id===r),h=R=>{d(R.currentTarget);},C=()=>{d(null);},P=R=>{o(R),C();},w=()=>{b(""),v(""),g({isDefault:false,isPublic:false}),u(true),C();},k=()=>{f.trim()&&(n({name:f,description:m,...y}),u(false));};return c("div",{className:"orb-layout-actions",sx:{display:"flex",alignItems:"center",gap:.25},children:[e(lt,{title:s("layout.layoutOptions"),children:e(ae,{onClick:h,color:x?"primary":"default",size:"small",children:e(pp,{fontSize:"small"})})}),c(jt,{anchorEl:l,open:!!l,onClose:C,align:"end",PaperProps:{sx:{width:320,maxHeight:400}},children:[e("option",{disabled:true,children:e(L,{variant:"caption",children:s("layout.selectLayout")})}),c("option",{onClick:w,children:[e(zr,{children:e(ko,{fontSize:"small"})}),e(_t,{children:s("layout.saveCurrentLayout")})]}),e(At,{}),t.length===0&&e("option",{disabled:true,children:e(L,{variant:"body2",color:"text.secondary",children:s("layout.noSavedLayouts")})}),t.map((R,S)=>e("option",{onClick:()=>P(R),selected:R.id===r,children:c("div",{sx:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"},children:[c("div",{sx:{display:"flex",flexDirection:"column",overflow:"hidden",mr:1},children:[e("div",{sx:{display:"flex",alignItems:"center",gap:1},children:e(L,{variant:"body2",fontWeight:R.id===r?"bold":"normal",noWrap:true,children:R.name})}),R.description&&e(L,{variant:"caption",color:"text.secondary",noWrap:true,children:R.description})]}),c("div",{sx:{display:"flex",alignItems:"center"},onClick:E=>E.stopPropagation(),children:[e(lt,{title:R.isDefault?s("layout.removeDefault"):s("layout.setAsDefault"),children:e(ae,{size:"small",onClick:E=>{E.stopPropagation(),i(R.id);},children:R.isDefault?e(lp,{fontSize:"small",color:"warning"}):e(sp,{fontSize:"small"})})}),e(lt,{title:s("common.delete"),children:e(ae,{size:"small",color:"error",onClick:E=>{E.stopPropagation(),a(R.id);},children:e(ri,{fontSize:"small"})})})]})]})},R.id||S))]}),e(zt,{open:p,onClose:()=>u(false),maxWidth:"xs",fullWidth:true,className:"orb-layout-save-dialog",title:s("layout.saveLayout"),actions:c(jsxRuntime.Fragment,{children:[e(Ce,{variant:"ghost",onClick:()=>u(false),children:s("common.cancel")}),e(Ce,{onClick:k,variant:"primary",disabled:!f.trim(),children:s("common.save")})]}),children:c("div",{className:"orb-layout-save-form",children:[e(ze,{label:s("layout.layoutName"),value:f,onChange:R=>b(R.target.value),fullWidth:true,autoFocus:true,size:"small",helperText:s("layout.layoutNameHelper")}),t.some(R=>R.name===f)&&e(L,{className:"orb-layout-save-warning",variant:"caption",color:"warning.main",children:s("layout.warningOverwrite")}),e(ze,{label:s("layout.layoutDescription"),value:m,onChange:R=>v(R.target.value),fullWidth:true,size:"small"}),e(Dt,{className:"orb-layout-save-option",checked:y.isDefault,onChange:R=>g({...y,isDefault:R.target.checked}),label:s("layout.useAsDefault")}),e(Dt,{className:"orb-layout-save-option",checked:y.isPublic,onChange:R=>g({...y,isPublic:R.target.checked}),label:s("layout.publicAllUsers")})]})})]})};T();var gn=({appId:t,tableKey:r="default",currentLayoutData:o,onLayoutLoad:n,targetLayoutId:a,activeLayoutId:i,serviceUrl:s,onError:l,onSuccess:d})=>{let{t:p}=pe(),[u,f]=Jt.useState([]),[b,m]=Jt.useState(""),v=`orbcafe.layouts.${t}.${r}`,y=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:r,layoutId:S.id,name:S.name,description:S.description??"",isDefault:!!S.isDefault,isPublic:!!S.isPublic,createdAt:S.createdAt,layout:S.layoutData}),x=Jt.useCallback(()=>{try{let S=localStorage.getItem(v);if(!S)return [];let E=JSON.parse(S);return Array.isArray(E)?E:[]}catch{return []}},[v]),h=Jt.useCallback(S=>{try{localStorage.setItem(v,JSON.stringify(S));}catch{}},[v]);Jt.useEffect(()=>{i!==void 0&&m(i);},[i]),Jt.useEffect(()=>{if(a&&u.length>0){let S=u.find(E=>E.id===a);S&&(m(S.id),n(S));}},[a,u,n]);let C=Jt.useCallback(async()=>{if(t){if(!s){let S=x();f(S);let E=S.find(D=>D.isDefault);E&&!b&&!a&&(m(E.id),n(E));return}try{let S=await fetch(`${s}/api/layouts?appId=${encodeURIComponent(t)}&tableKey=${encodeURIComponent(r)}`);if(!S.ok)throw new Error("LAYOUT_FETCH_FAILED");let D=(await S.json()).map(y);f(D);let I=D.find(A=>A.isDefault);I&&!b&&!a&&(m(I.id),n(I));}catch(S){console.error("Error fetching layouts",S);let E=x();f(E);let D=E.find(I=>I.isDefault);D&&!b&&!a&&(m(D.id),n(D)),l&&l(p("layout.toast.loadFallback"));}}},[t,r,s,l,b,n,a,x,p]);return Jt.useEffect(()=>{C();},[t,r]),e(_p,{layouts:u,currentLayoutId:b,onLoad:S=>{m(S.id),n(S);},onSave:async S=>{let E=u.find(A=>A.name===S.name),D=E?E.id:Date.now().toString(),I={id:D,...S,createdAt:new Date().toISOString(),layoutData:o,isDefault:S.isDefault??false,isPublic:S.isPublic??false};if(!s){let N=u.some(O=>O.id===D)?u.map(O=>O.id===D?I:O):[...u,I];f(N),h(N),m(D),n(I),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(I))})).ok)throw new Error("LAYOUT_SAVE_FAILED");d&&d(p("layout.toast.saveSuccess")),await C(),m(D),n(I);}catch(A){console.error("Error saving layout",A);let O=u.some(F=>F.id===D)?u.map(F=>F.id===D?I:F):[...u,I];f(O),h(O),m(D),n(I),d&&d(p("layout.toast.saveLocalSuccess")),l&&l(p("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async S=>{if(!s){let E=u.filter(D=>D.id!==S);f(E),h(E),b===S&&m(""),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");b===S&&m(""),d&&d(p("layout.toast.deleteSuccess")),await C();}catch(E){console.error("Error deleting layout",E);let D=u.filter(I=>I.id!==S);f(D),h(D),b===S&&m(""),d&&d(p("layout.toast.deleteLocalSuccess")),l&&l(p("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async S=>{if(!s){let E=u.map(D=>({...D,isDefault:D.id===S}));f(E),h(E),d&&d(p("layout.toast.defaultLocalSuccess"));return}try{let E=u.find(I=>I.id===S);if(!E)return;if(!(await fetch(`${s}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g({...E,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");d&&d(p("layout.toast.defaultSuccess")),await C();}catch(E){console.error("Error setting default",E);let D=u.map(I=>({...I,isDefault:I.id===S}));f(D),h(D),d&&d(p("layout.toast.defaultLocalSuccess")),l&&l(p("layout.toast.backendUnavailableDefaultLocal"));}}})};var Ni=(t,r)=>{if(!t||!t.filters)return null;if(Array.isArray(t.filters)){let o=t.filters.find(a=>a.scope===r);if(o)return o.filters;let n=t.filters.find(a=>a.scope==="default");return n?n.filters:null}return typeof t.filters=="object"?t.filters:null},Ai=(t,r)=>{if(!t)return {layout:null,layoutId:null};let o=null,n=null;if(Array.isArray(t.layoutRefs)){let a=t.layoutRefs.find(i=>i.tableKey===r);a&&(o=a.layoutId);}return !o&&t.layoutId&&(o=t.layoutId),t.layout&&typeof t.layout=="object"&&!Array.isArray(t.layout)&&(n=t.layout),{layoutId:o,layout:n}};function Kp(t,r,o){return r[o]<t[o]?-1:r[o]>t[o]?1:0}function gh(t,r){return t==="desc"?(o,n)=>Kp(o,n,r):(o,n)=>-Kp(o,n,r)}function fh(t,r){let o=t.map((n,a)=>[n,a]);return o.sort((n,a)=>{let i=r(n[0],a[0]);return i!==0?i:n[1]-a[1]}),o.map(n=>n[0])}var fn=t=>{let r=!!t.disableGrouping,o=!!t.disableSorting,n=Jt.useCallback(W=>{let te=String(W?.label??W?.id??"").length*9+64,Ne=typeof W?.minWidth=="number"?W.minWidth:0;return Math.max(100,Ne,te)},[]),a=Jt.useCallback(()=>(t.columns||[]).filter(W=>!!W?.numeric).map(W=>W.id),[t.columns]),[i,s]=Jt.useState(""),[l,d]=Jt.useState(t.order||"asc"),[p,u]=Jt.useState(t.orderBy||""),[f,b]=Jt.useState([]),[m,v]=Jt.useState(t.page||0),[y,g]=Jt.useState(t.rowsPerPage||20),[x,h]=Jt.useState(t.selected||[]),[C,P]=Jt.useState(t.columns?t.columns.map(W=>W.id):[]),[w,k]=Jt.useState(t.columns?t.columns.map(W=>W.id):[]),[R,S]=Jt.useState(t.showSummary||false),[E,D]=Jt.useState(()=>a()),[I,A]=Jt.useState([]),[N,O]=Jt.useState(new Set),[F,q]=Jt.useState(()=>{let W={};return (t.columns||[]).forEach(Y=>{W[Y.id]=n(Y);}),W}),[z,X]=Jt.useState(null),[$,_]=Jt.useState(null),[V,B]=Jt.useState(null),[Z,Q]=Jt.useState(null),[ge,se]=Jt.useState(false),[le,be]=Jt.useState(""),[_e,De]=Jt.useState(""),Pe=r?[]:I,Ve=Jt.useCallback(W=>{if(r){A([]),O(new Set),_(null);return}A(W);},[r]);Jt.useEffect(()=>{r&&(A([]),O(new Set),_(null));},[r]),Jt.useEffect(()=>{o&&(d("asc"),u(""),b([]));},[o]),Jt.useEffect(()=>{t.layout&&bt(t.layout);},[t.layout]),Jt.useEffect(()=>{if(o){d("asc"),u("");return}t.order!==void 0&&d(t.order),t.orderBy!==void 0&&u(t.orderBy);},[t.order,t.orderBy,o]),Jt.useEffect(()=>{t.selected!==void 0&&h(t.selected);},[t.selected]),Jt.useEffect(()=>{t.page!==void 0&&v(t.page);},[t.page]),Jt.useEffect(()=>{t.rowsPerPage!==void 0&&g(t.rowsPerPage);},[t.rowsPerPage]),Jt.useEffect(()=>{let W=a();D(Y=>Y.filter(Ne=>W.includes(Ne)));},[a]),Jt.useEffect(()=>{q(W=>{let Y={...W};return (t.columns||[]).forEach(te=>{Y[te.id]===void 0&&(Y[te.id]=n(te));}),Y});},[t.columns,n]),Jt.useEffect(()=>{k(W=>{let Y=(t.columns||[]).map(et=>et.id),te=new Set(Y),Ne=W.filter(et=>te.has(et)),he=new Set(Ne),Ae=Y.filter(et=>!he.has(et)),Ke=[...Ne,...Ae];return Ke.length===W.length&&Ke.every((et,qe)=>et===W[qe])?W:Ke});},[t.columns]);let Te=Jt.useMemo(()=>{let W=t.columns||[];if(w.length===0)return W;let Y=new Map(W.map(he=>[he.id,he])),te=[],Ne=new Set;return w.forEach(he=>{let Ae=Y.get(he);Ae&&(te.push(Ae),Ne.add(he));}),W.forEach(he=>{Ne.has(he.id)||te.push(he);}),te},[t.columns,w]),xe=Jt.useMemo(()=>{let W=t.rows||[];return i&&(W=W.filter(Y=>Object.keys(Y).some(te=>String(Y[te]).toLowerCase().includes(i.toLowerCase())))),W},[t.rows,i]),We=Jt.useMemo(()=>{if(o||t.onSortChange)return xe;if(f.length>0){let W=[...xe];return W.sort((Y,te)=>{for(let Ne of f){let he=Y?.[Ne.field],Ae=te?.[Ne.field];if(!(he==null&&Ae==null)){if(he==null)return Ne.direction==="asc"?-1:1;if(Ae==null)return Ne.direction==="asc"?1:-1;if(he<Ae)return Ne.direction==="asc"?-1:1;if(he>Ae)return Ne.direction==="asc"?1:-1}}return 0}),W}return p?fh(xe,gh(l,p)):xe},[xe,l,p,f,t.onSortChange,o]),ot=Jt.useCallback(W=>{if(Pe.length===0)return W.map(Ae=>({type:"row",data:Ae,id:Ae[t.rowKey||"id"]}));let Y=[...W].sort((Ae,Ke)=>{for(let et of Pe){if(Ae[et]<Ke[et])return -1;if(Ae[et]>Ke[et])return 1}return 0}),te=(Ae,Ke=0)=>{if(Ke>=Pe.length)return Ae;let et=Pe[Ke],qe={},Ct=[];return Ae.forEach(Nt=>{let wt=Nt[et],xt=`${et}:${wt}`;qe[xt]||(qe[xt]={key:xt,field:et,value:wt,children:[],count:0,level:Ke},Ct.push(qe[xt])),qe[xt].children.push(Nt),qe[xt].count++;}),Ct.forEach(Nt=>{Nt.children&&(Nt.children=te(Nt.children,Ke+1));}),Ct},Ne=te(Y),he=(Ae,Ke="")=>{let et=[];return Ae.forEach(qe=>{if(qe.children){let Ct=Ke?`${Ke}>${qe.key}`:qe.key,Nt=N.has(Ct);et.push({type:"group",id:Ct,field:qe.field,value:qe.value,level:qe.level,count:qe.count,isExpanded:Nt,childIds:(function wt(xt){let H=[];return xt.children.forEach(j=>{j.children?H=H.concat(wt(j)):H.push(j[t.rowKey||"id"]);}),H})(qe)}),Nt&&(et=et.concat(he(qe.children,Ct)));}else et.push({type:"row",data:qe,id:qe[t.rowKey||"id"],level:Pe.length});}),et};return he(Ne)},[Pe,N,t.rowKey]),it=Jt.useCallback(W=>{if(Pe.length===0)return [];let Y=[...W].sort((he,Ae)=>{for(let Ke of Pe){if(he[Ke]<Ae[Ke])return -1;if(he[Ke]>Ae[Ke])return 1}return 0}),te=[],Ne=(he,Ae,Ke)=>{if(Ae>=Pe.length)return;let et=Pe[Ae],qe=new Map;he.forEach(Ct=>{let Nt=Ct[et],wt=qe.get(Nt);wt?wt.push(Ct):qe.set(Nt,[Ct]);}),qe.forEach((Ct,Nt)=>{let wt=`${et}:${Nt}`,xt=Ke?`${Ke}>${wt}`:wt;te.push(xt),Ne(Ct,Ae+1,xt);});};return Ne(Y,0,""),te},[Pe]),Ze=Jt.useMemo(()=>ot(We),[We,ot]),U=Jt.useMemo(()=>it(We),[We,it]),Fe=Jt.useMemo(()=>{let W=(t.rows||[]).length;return typeof t.count=="number"&&t.count>W},[t.count,t.rows]),ye=Jt.useMemo(()=>Fe?Ze:y>0?Ze.slice(m*y,m*y+y):Ze,[Ze,m,y,Fe]),Le=Jt.useMemo(()=>Fe&&typeof t.count=="number"?t.count:Ze.length,[Ze.length,Fe,t.count]),st=W=>{O(Y=>{let te=new Set(Y);return te.has(W)?te.delete(W):te.add(W),te});},Je=W=>{let Y=U.filter(te=>te===W||te.startsWith(`${W}>`));O(te=>{let Ne=new Set(te);return Y.forEach(he=>Ne.add(he)),Ne});},vt=W=>{O(Y=>{let te=new Set(Y);return Array.from(te).forEach(Ne=>{(Ne===W||Ne.startsWith(`${W}>`))&&te.delete(Ne);}),te});},St=W=>{if(!W){O(new Set);return}O(new Set(U));},Et=W=>{let Y=U.filter(te=>te.startsWith(`${W}>`));return Y.length===0?N.has(W):N.has(W)&&Y.every(te=>N.has(te))},Lt=W=>{if(o)return;f.length>0&&b([]);let Y=p===W&&l==="asc",te=p===W&&l==="desc";if(t.onSortChange){Y?t.onSortChange(W,"desc"):te?t.onSortChange("","asc"):t.onSortChange(W,"asc");return}Y?(d("desc"),u(W)):te?(d("asc"),u("")):(d("asc"),u(W));},re=W=>{if(o){d("asc"),u(""),b([]);return}let Y=W.filter(te=>te&&te.field);b(Y),Y.length>0&&u("");},nt=()=>{b([]);},Be=(W,Y)=>{q(te=>({...te,[W]:Y}));},ce=W=>{if(W.target.checked){let Y=xe.map(te=>te[t.rowKey||"id"]);h(Y),t.onSelectionChange&&t.onSelectionChange(Y);return}h([]),t.onSelectionChange&&t.onSelectionChange([]);},fe=(W,Y)=>{let te=Y[t.rowKey||"id"],Ne=x.indexOf(te),he=[];Ne===-1?he=he.concat(x,te):Ne===0?he=he.concat(x.slice(1)):Ne===x.length-1?he=he.concat(x.slice(0,-1)):Ne>0&&(he=he.concat(x.slice(0,Ne),x.slice(Ne+1))),h(he),t.onSelectionChange&&t.onSelectionChange(he);},ee=W=>{v(W),t.onPageChange&&t.onPageChange(W);},Ie=W=>{g(W),v(0),t.onPageChange&&t.onPageChange(0),t.onRowsPerPageChange&&t.onRowsPerPageChange(W);},Re=W=>{let Y=C.indexOf(W),te=[...C];Y===-1?te.push(W):te.splice(Y,1),P(te);},je=W=>{if(r)return;let Y=Pe.indexOf(W),te=[...Pe];Y===-1?te.push(W):te.splice(Y,1),Ve(te);},mt=W=>{a().includes(W)&&D(te=>te.includes(W)?te.filter(Ne=>Ne!==W):[...te,W]);},pt=(W,Y)=>{!W||!Y||W===Y||k(te=>{let Ne=te.indexOf(W),he=te.indexOf(Y);if(Ne===-1||he===-1)return te;let Ae=[...te];return Ae.splice(Ne,1),Ae.splice(he,0,W),Ae});},Ot=W=>{let Y=W?.active?.id,te=W?.over?.id;typeof Y=="string"&&typeof te=="string"&&pt(Y,te);},Kt=W=>{t.onLayoutSave&&t.onLayoutSave({visibleColumns:C,columnOrder:w,order:o?"asc":l,orderBy:o?"":p,sortBy:o?[]:f,grouping:Pe,columnWidths:F,showSummary:R,summaryColumns:E});},yt=W=>{let{layout:Y,layoutId:te}=Ai(W,t.tableKey||"default");te?(De(te),be(te)):(De(""),be("")),Y&&(Y.visibleColumns&&P(Y.visibleColumns),Array.isArray(Y.columnOrder)&&k(Y.columnOrder),o?(d("asc"),u(""),b([])):(Y.order&&d(Y.order),Y.orderBy&&u(Y.orderBy),Array.isArray(Y.sortBy)&&b(Y.sortBy)),Y.grouping&&Ve(Y.grouping),Y.columnWidths&&q(Y.columnWidths),Y.showSummary!==void 0&&S(!!Y.showSummary),Array.isArray(Y.summaryColumns)&&D(Y.summaryColumns));},bt=W=>{let Y=W?.layoutData||W?.layout||W||{};Y.visibleColumns&&P(Y.visibleColumns),Array.isArray(Y.columnOrder)&&k(Y.columnOrder),o?(d("asc"),u(""),b([])):(Y.order&&d(Y.order),Y.orderBy!==void 0&&u(Y.orderBy),Array.isArray(Y.sortBy)&&b(Y.sortBy)),Y.grouping&&Ve(Y.grouping),Y.columnWidths&&q(Y.columnWidths),Y.showSummary!==void 0&&S(!!Y.showSummary),Array.isArray(Y.summaryColumns)&&D(Y.summaryColumns),O(new Set),v(0),W?.id&&be(W.id),De("");};Jt.useEffect(()=>{t.layout&&yt({layout:t.layout});},[t.layout]);let xr=W=>{W.preventDefault(),Q(Z===null?{mouseX:W.clientX+2,mouseY:W.clientY-6}:null);},Tt=()=>{Q(null);},Ft=Jt.useMemo(()=>{if(!R)return {};let W={};t.columns.forEach(te=>{if(te.numeric&&E.includes(te.id)){let Ne=xe.reduce((he,Ae)=>{let Ke=parseFloat(Ae[te.id]);return he+(isNaN(Ke)?0:Ke)},0);W[te.id]=Ne.toFixed(2);}else W[te.id]="";});let Y=t.columns.find(te=>C.includes(te.id)&&!te.numeric);return Y&&!Y.numeric&&(W[Y.id]="Total"),W},[xe,t.columns,R,E,C]),ut=()=>{if(!t.columns||!xe)return;let W=t.columns.map(Ae=>Ae.label).join(","),Y=xe.map(Ae=>t.columns.map(Ke=>{let et=Ae[Ke.id];return `"${(et==null?"":String(et)).replace(/"/g,'""')}"`}).join(",")).join(`
184
+ `),te=`data:text/csv;charset=utf-8,${W}
185
+ ${Y}`,Ne=encodeURI(te),he=document.createElement("a");he.setAttribute("href",Ne),he.setAttribute("download",`${t.title||"export"}.csv`),document.body.appendChild(he),he.click(),document.body.removeChild(he);},Bt=()=>{se(true);},we=()=>{se(false);};return {isMobile:false,columns:Te,order:l,setOrder:d,orderBy:p,setOrderBy:u,sortBy:f,setSortBy:b,applyMultiSort:re,clearMultiSort:nt,columnOrder:w,setColumnOrder:k,filterText:i,setFilterText:s,visibleColumns:C,setVisibleColumns:P,showSummary:R,setShowSummary:S,summaryColumns:E,grouping:Pe,setGrouping:Ve,expandedGroups:N,setExpandedGroups:O,groupAnchorEl:$,setGroupAnchorEl:_,summaryAnchorEl:V,setSummaryAnchorEl:B,columnWidths:F,setColumnWidths:q,anchorEl:z,setAnchorEl:X,contextMenu:Z,setContextMenu:Q,sensors:void 0,sortedAndFilteredRows:We,visibleRows:ye,summaryRow:Ft,page:m,setPage:ee,rowsPerPage:y,setRowsPerPage:Ie,totalDisplayCount:Le,selected:x,setSelected:h,isAllExpanded:U.length>0&&U.every(W=>N.has(W)),handleColumnResize:Be,handleRequestSort:Lt,handleSelectAllClick:ce,handleClick:fe,toggleSummaryColumn:mt,handleDragEnd:Ot,handleColumnReorder:pt,handleExport:ut,handleContextMenu:xr,handleCloseContextMenu:Tt,toggleColumnVisibility:Re,toggleGroupExpand:st,toggleGroupField:je,handleToggleAll:St,handleExpandGroupRecursively:Je,handleCollapseGroupRecursively:vt,isGroupFullyExpanded:Et,handleLayoutLoad:bt,handleVariantLoad:yt,handleLayoutSave:Kt,effectiveAppId:t.appId||"",currentLayoutData:{visibleColumns:C,order:o?"asc":l,orderBy:o?"":p,sortBy:o?[]:f,columnOrder:w,grouping:Pe,columnWidths:F,showSummary:R,summaryColumns:E},currentLayoutId:le,layoutIdToLoad:_e,onPageChange:ee,onRowsPerPageChange:Ie,graphReportOpen:ge,handleOpenGraphReport:Bt,handleCloseGraphReport:we}};T();var VM=t=>e("tbody",{...t}),WM=({align:t,...r})=>e("td",{align:t==="inherit"?void 0:t,...r}),$M=t=>e("div",{...t}),GM=t=>e("thead",{...t}),_M=t=>e("tr",{...t}),Jr=t=>{let{t:r}=pe(),o="0.85rem",{title:n,showToolbar:a=true,selectionMode:i,selected:s=[],onSelectionChange:l,actions:d,extraTools:p,fitContainer:u=false,fullWidth:f=false,maxHeight:b,loading:m=false,rowsPerPageOptions:v=[20,50,100,-1],onLayoutSave:y,filterConfig:g,rowKey:x,tableKey:h="default",graphReport:C,quickCreate:P,quickEdit:w,quickDelete:k,serviceUrl:R,disableGrouping:S=false,disableSorting:E=false}=t,D=n||r("table.title.default"),{isMobile:I,columns:A,order:N,orderBy:O,filterText:F,setFilterText:q,visibleColumns:z,showSummary:X,setShowSummary:$,summaryColumns:_,grouping:V,setGrouping:B,expandedGroups:Z,groupAnchorEl:Q,setGroupAnchorEl:ge,summaryAnchorEl:se,setSummaryAnchorEl:le,columnWidths:be,anchorEl:_e,setAnchorEl:De,contextMenu:Pe,sensors:Ve,sortedAndFilteredRows:Te,summaryRow:xe,visibleRows:We,isAllExpanded:ot,page:it,setPage:Ze,rowsPerPage:U,setRowsPerPage:Fe,totalDisplayCount:ye,setSelected:Le,handleColumnResize:st,handleRequestSort:Je,handleSelectAllClick:vt,handleClick:St,toggleSummaryColumn:Et,handleDragEnd:Lt,handleExport:re,handleContextMenu:nt,handleCloseContextMenu:Be,toggleColumnVisibility:ce,toggleGroupExpand:fe,handleToggleAll:ee,handleExpandGroupRecursively:Ie,handleCollapseGroupRecursively:Re,isGroupFullyExpanded:je,handleLayoutLoad:mt,handleVariantLoad:pt,handleLayoutSave:Ot,effectiveAppId:Kt,currentLayoutData:yt,currentLayoutId:bt,layoutIdToLoad:xr,graphReportOpen:Tt,handleOpenGraphReport:Ft,handleCloseGraphReport:ut}=fn(t),Bt=C?.enabled??false,we=Bt&&(C?.interaction?.enabled??true),W=Ti(),Y=!!P?.enabled,te=!!w?.enabled,Ne=!!k?.enabled,he=P?.fields,Ae=P?.excludeFields||[],Ke=P?.initialValues||{},[et,qe]=Jt__namespace.default.useState(false),[Ct,Nt]=Jt__namespace.default.useState(false),[wt,xt]=Jt__namespace.default.useState({}),[H,j]=Jt__namespace.default.useState(false),[me,Se]=Jt__namespace.default.useState(false),[tt,Xe]=Jt__namespace.default.useState({}),[It,ft]=Jt__namespace.default.useState(false),[gt,kt]=Jt__namespace.default.useState(false),nr=m||Ct||me||gt,Ht=Jt__namespace.default.useMemo(()=>{let oe=[...A];if(Array.isArray(he)&&he.length>0){let ue=new Set(he);oe=oe.filter(J=>ue.has(J.id));}if(Ae.length>0){let ue=new Set(Ae);oe=oe.filter(J=>!ue.has(J.id));}return oe.filter(ue=>!!ue?.id)},[A,Ae,he]),Yt=x||"id",Vt=Jt__namespace.default.useMemo(()=>{let oe=new Set(s);return Te.filter(ue=>oe.has(ue?.[Yt]))},[s,Te,Yt]),qt=Vt.length===1?Vt[0]:null,$t=w?.fields,rr=w?.excludeFields||[],ar=w?.editableFields||[],gr=w?.nonEditableFields||[],Ir=w?.primaryKeys?.length?w.primaryKeys:[Yt],Rr=Jt__namespace.default.useMemo(()=>{let oe=[...A];if(Array.isArray($t)&&$t.length>0){let ue=new Set($t);oe=oe.filter(J=>ue.has(J.id));}if(rr.length>0){let ue=new Set(rr);oe=oe.filter(J=>!ue.has(J.id));}return oe.filter(ue=>!!ue?.id)},[A,rr,$t]),oo=Jt__namespace.default.useMemo(()=>new Set(Ir),[Ir]),vr=Jt__namespace.default.useMemo(()=>new Set(ar),[ar]),Or=Jt__namespace.default.useMemo(()=>new Set(gr),[gr]),Ko=Jt__namespace.default.useCallback(oe=>vr.size>0?vr.has(oe):!(Or.has(oe)||oo.has(oe)),[vr,Or,oo]);Jt__namespace.default.useEffect(()=>{!Tt&&W.hasActiveFilters&&W.clearAll();},[Tt,W.hasActiveFilters,W.clearAll]);let qo=()=>{let oe={};Ht.forEach(ue=>{oe[ue.id]=Ke[ue.id]??"";}),xt(oe),qe(true);},Eo=()=>{Ct||qe(false);},Xo=(oe,ue)=>{xt(J=>({...J,[oe]:ue}));},Yo=async()=>{if(!P?.onSubmit){qe(false);return}try{Nt(!0),await P.onSubmit(wt),qe(!1);}finally{Nt(false);}},Mr=()=>{if(!qt)return;let oe={};Rr.forEach(J=>{oe[J.id]=qt[J.id]??"";});let ue=w?.getInitialValues?{...oe,...w.getInitialValues(qt)}:oe;Xe(ue),j(true);},Lo=()=>{me||j(false);},Zo=(oe,ue)=>{Xe(J=>({...J,[oe]:ue}));},Kr=async()=>{if(qt){if(!w?.onSubmit){j(false);return}try{Se(!0),await w.onSubmit(tt,qt),j(!1);}finally{Se(false);}}},no=()=>{Vt.length!==0&&ft(true);},An=()=>{gt||ft(false);},Oo=async()=>{if(Vt.length===0){ft(false);return}if(!k?.onConfirm){ft(false),Le([]),l?.([]);return}try{kt(!0),await k.onConfirm(Vt),ft(!1),Le([]),l?.([]);}finally{kt(false);}},M=Te,{fieldMapping:G}=pn({rows:M,config:{...C,title:C?.title||`${D} ${r("graph.reportTitle")}`}}),K=Jt__namespace.default.useMemo(()=>we?W.applyRows(M,G):M,[we,W.applyRows,M,G]),{model:de}=pn({rows:K,config:{...C,title:C?.title||`${D} ${r("graph.reportTitle")}`,fieldMapping:G}}),He=de.table.columns.map(oe=>({id:oe.id,label:oe.label,align:oe.align||"left",minWidth:120,numeric:oe.align==="right"})),at=Kt?e(gn,{appId:Kt,tableKey:h,currentLayoutData:yt,onLayoutLoad:mt,targetLayoutId:xr,activeLayoutId:bt,serviceUrl:R??g?.serviceUrl}):null,$e=c(jsxRuntime.Fragment,{children:[!S&&e(cn,{groupAnchorEl:Q,setGroupAnchorEl:ge,grouping:V,setGrouping:B,columns:A}),e(dn,{anchorEl:_e,setAnchorEl:De,columns:A,visibleColumns:z,toggleColumnVisibility:ce}),e(vi,{anchorEl:se,setAnchorEl:le,showSummary:X,setShowSummary:$,columns:A,summaryColumns:_,toggleSummaryColumn:Et}),e(yi,{contextMenu:Pe,handleCloseContextMenu:Be,columns:A,visibleColumns:z,toggleColumnVisibility:ce})]});return I?c("div",{sx:{display:"flex",flexDirection:"column",gap:2,height:"100%"},children:[g&&e(Wr,{fields:g.fields,filters:g.filters,onFilterChange:g.onFilterChange,onSearch:g.onSearch,variants:g.variants||[],currentVariantId:g.currentVariantId,onVariantLoad:g.onVariantLoad,onVariantSave:g.onVariantSave,onVariantDelete:g.onVariantDelete,onVariantSetDefault:g.onVariantSetDefault,appId:g.appId,tableKey:h,currentLayout:[{tableKey:h,layoutData:yt}],variantService:g.variantService,serviceUrl:R??g.serviceUrl}),e(Cp,{title:D,loading:m,showSummary:X,setShowSummary:$,setAnchorEl:De,setSummaryAnchorEl:le,filterText:F,setFilterText:q,sortedAndFilteredRows:Te,selected:s,columns:A,visibleColumns:z,summaryRow:xe,handleClick:St,selectionMode:i}),$e]}):c("div",{sx:{width:f?"100%":"auto",mb:u?0:2,...u?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[g&&e("div",{sx:{mb:2},children:e(Wr,{fields:g.fields,filters:g.filters,onFilterChange:g.onFilterChange,onSearch:g.onSearch,variants:g.variants||[],currentVariantId:g.currentVariantId,onVariantLoad:oe=>{pt(oe),g.onVariantLoad&&g.onVariantLoad(oe);},onVariantSave:g.onVariantSave,onVariantDelete:g.onVariantDelete,onVariantSetDefault:g.onVariantSetDefault,loading:m,appId:g.appId,tableKey:h,currentLayout:[{tableKey:h,layoutData:yt}],currentLayoutId:bt,layoutRefs:[{tableKey:h,layoutId:bt}],variantService:g.variantService,serviceUrl:R??g.serviceUrl})}),c(Ee,{className:"orb-ctable-surface",sx:{width:f?"100%":"auto",mb:u?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":nr?{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"}},...b?{height:b}:u?{flex:1,minHeight:0,height:"100%"}:{}},children:[a&&e(gi,{filterText:F,setFilterText:q,onRowsPerPageChange:Fe,rowsPerPage:U,rowsPerPageOptions:v,page:it,count:ye,onPageChange:Ze,actions:d,extraTools:p,grouping:V,disableGrouping:S,groupAnchorEl:Q,setGroupAnchorEl:ge,showSummary:X,setShowSummary:$,anchorEl:_e,setAnchorEl:De,summaryAnchorEl:se,setSummaryAnchorEl:le,handleExport:re,showCreateButton:Y,onOpenCreateDialog:qo,showEditButton:te,onOpenEditDialog:Mr,editDisabled:Vt.length!==1,showDeleteButton:Ne,onOpenDeleteConfirm:no,deleteDisabled:Vt.length===0,onLayoutSave:y||g?.variantService&&g?.appId?Ot:void 0,loading:m,layoutManager:at,onOpenGraphReport:Bt?Ft:void 0}),e("div",{sx:{flex:1,...b?{maxHeight:b,height:b}:u?{height:0,maxHeight:"none"}:{maxHeight:"calc(100vh - 320px)"},overflowY:"auto",overflowX:"auto",position:"relative",minHeight:0},children:e(core.DndContext,{sensors:Ve,collisionDetection:core.closestCenter,onDragEnd:Lt,modifiers:[modifiers.restrictToHorizontalAxis],children:c("table",{className:"orb-tbl orb-ctable",style:{minWidth:f?750:void 0,width:f?"100%":"auto",tableLayout:Object.keys(be).length>0?"fixed":"auto",borderCollapse:"separate",borderSpacing:0,fontSize:o},"aria-labelledby":"tableTitle",children:[e(bi,{columns:A,visibleColumns:z,order:N,orderBy:O,onRequestSort:Je,disableSorting:E,onContextMenu:nt,selectionMode:i,grouping:V,isAllExpanded:ot,handleToggleAll:ee,rowCount:Te.length,numSelected:s.length,onSelectAllClick:vt,columnWidths:be,onColumnResize:st}),e(hi,{visibleRows:We,columns:A,visibleColumns:z,selectionMode:i,selected:s,orderBy:O,loading:m,expandedGroups:Z,toggleGroupExpand:fe,handleExpandGroupRecursively:Ie,handleCollapseGroupRecursively:Re,isGroupFullyExpanded:je,handleClick:St,onSelectionChange:l,grouping:V,rowKeyProp:x,page:it,rowsPerPage:U}),X&&e(yp,{showSummary:X,columns:A,visibleColumns:z,summaryRow:xe,selectionMode:i?.toString(),grouping:V,columnWidths:be,orderBy:O,zIndex:3})]})})})]}),Y&&c(zt,{open:et,onClose:Eo,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:oe=>`1px solid ${oe.palette.divider}`,bgcolor:"background.paper"}}},children:[e("div",{className:"orb-dialog-title",sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:P?.title||r("quickCreate.createWithTitle",{title:D})}),e("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:c("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Ht.map(oe=>{let ue=oe.type==="number"||oe.numeric?"number":oe.type==="date"?"date":"text",J=oe.label||oe.id;return e(ze,{label:J,value:wt[oe.id]??"",onChange:Oe=>Xo(oe.id,Oe.target.value),type:ue,size:"small",fullWidth:true,InputLabelProps:{shrink:ue==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-create-${oe.id}`)}),P?.description&&e(jr,{severity:"info",sx:{fontSize:"0.85rem","& span":{fontSize:"0.85rem"}},children:P.description})]})}),c("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[e(Ce,{onClick:Eo,sx:{fontSize:"0.85rem"},disabled:Ct,children:P?.cancelLabel||r("common.cancel")}),e(Ce,{onClick:Yo,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:Ct,children:P?.submitLabel||r("common.save")})]})]}),te&&c(zt,{open:H,onClose:Lo,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:oe=>`1px solid ${oe.palette.divider}`,bgcolor:"background.paper"}}},children:[e("div",{className:"orb-dialog-title",sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:w?.title||r("quickEdit.editWithTitle",{title:D})}),e("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:c("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Rr.map(oe=>{let ue=oe.type==="number"||oe.numeric?"number":oe.type==="date"?"date":"text",J=oe.label||oe.id,Oe=Ko(oe.id);return e(ze,{label:J,value:tt[oe.id]??"",onChange:Qe=>Zo(oe.id,Qe.target.value),type:ue,size:"small",fullWidth:true,disabled:!Oe,InputLabelProps:{shrink:ue==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-edit-${oe.id}`)}),w?.description&&e(jr,{severity:"info",sx:{fontSize:"0.85rem","& span":{fontSize:"0.85rem"}},children:w.description})]})}),c("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[e(Ce,{onClick:Lo,sx:{fontSize:"0.85rem"},disabled:me,children:w?.cancelLabel||r("common.cancel")}),e(Ce,{onClick:Kr,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:me||!qt,children:w?.submitLabel||r("common.save")})]})]}),Ne&&e(Yn,{open:It,type:"warning",title:k?.title||r("quickDelete.confirmTitle"),message:k?.message||(Vt.length>1?r("quickDelete.confirmMessageMultiple",{count:Vt.length}):r("quickDelete.confirmMessageSingle")),confirmText:k?.confirmText||r("common.delete"),cancelText:k?.cancelText||r("common.cancel"),onClose:An,onConfirm:Oo}),$e,Bt&&e(ki,{open:Tt,onClose:ut,model:de,aiAssistant:C?.aiAssistant,interaction:we?{enabled:true,filters:W.filters,fieldMapping:G,onPrimaryDimensionClick:oe=>W.setFilter("primaryDimension",oe),onSecondaryDimensionClick:oe=>W.setFilter("secondaryDimension",oe),onStatusClick:oe=>W.setFilter("status",oe),onClearFilter:W.clearFilter,onClearAll:W.clearAll}:void 0,tableContent:e(Jr,{appId:Kt||"graph-report-internal",title:r("graph.dataBody"),columns:He,rows:de.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false}})})]})},UM=Jr;T();var QM=({id:t,title:r,hideHeader:o=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 c(pi,{title:r,hideHeader:o,children:[c(ie,{spacing:s,sx:{height:"100%",overflow:"hidden"},children:[l==="separated"&&d&&e("div",{sx:{flexShrink:0},children:e(Wr,{...d})}),e("div",{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:e(Jr,{...p,fitContainer:true,filterConfig:l==="integrated"?d:void 0})})]}),i]})};var nD=({metadata:t,fetchData:r,initialRowsPerPage:o=20,rowsPerPageOptions:n=[20,50,100,-1],tableKey:a="default",mode:i="integrated",serviceUrl:s,variantService:l})=>{let{t:d}=pe(),[p,u]=Jt.useState(false),[f,b]=Jt.useState([]),[m,v]=Jt.useState({}),[y,g]=Jt.useState(t.variants||[]),[x,h]=Jt.useState(t.layout||null),[C,P]=Jt.useState(""),[w,k]=Jt.useState(0),[R,S]=Jt.useState(0),[E,D]=Jt.useState(o),[I,A]=Jt.useState([]),[N,O]=Jt.useState("asc"),[F,q]=Jt.useState("");Jt.useEffect(()=>{let se={};t.filters.forEach(le=>{le.defaultValue!==void 0&&(se[le.id]=le.defaultValue);}),v(se);},[t.filters]);let z=Jt.useCallback(async(se,le,be,_e,De)=>{u(true);try{let Pe={...se,page:le+1,limit:be,sort:De,order:_e},Ve;r?Ve=await r(Pe):typeof t.api=="function"?Ve=await t.api(Pe):t.api&&typeof t.api=="object"?(console.log("Fetching from URL:",t.api.url,Pe),Ve={rows:[],total:0}):(console.warn("No API configured for report"),Ve={rows:[],total:0}),Ve&&(b(Ve.rows||[]),k(Ve.total||0));}catch(Pe){console.error("Failed to fetch report data",Pe);}finally{u(false);}},[t.api,r]);Jt.useEffect(()=>{z(m,R,E,N,F);},[z,R,E,N,F]);let X=()=>{S(0),z(m,0,E,N,F);},$=se=>{S(0),D(se);},_=(se,le)=>{O(le),q(se);},V=se=>{v(se);},B=se=>{P(se?.id||"");let le=Ni(se,a);if(le){let _e=le.values??le;v(_e),z(_e,0,E,N,F),S(0);}let{layout:be}=Ai(se,a);be&&h(be);},Z=se=>{let le={...se,id:Date.now().toString(),createdAt:new Date().toISOString()};g(be=>[...be,le]);},Q=se=>{h(se);};return {pageProps:{id:t.id,title:t.title,mode:i,filterConfig:{appId:t.id,tableKey:a,fields:t.filters,filters:m,onFilterChange:V,onSearch:X,onVariantLoad:B,onVariantSave:Z,onVariantDelete:se=>g(le=>le.filter(be=>be.id!==se)),onVariantSetDefault:se=>{g(le=>le.map(be=>({...be,isDefault:be.id===se})));},variants:y,currentVariantId:C,variantService:l,serviceUrl:s},tableProps:{appId:t.id,tableKey:a,columns:t.columns,rows:f,loading:p,rowKey:"id",count:w,page:R,rowsPerPage:E,rowsPerPageOptions:n,onPageChange:S,onRowsPerPageChange:$,selectionMode:"multiple",selected:I,onSelectionChange:A,onLayoutSave:Q,layout:x,title:t.title,showSummary:true,order:N,orderBy:F,serviceUrl:s,onSortChange:_,graphReport:t.graphReport||{enabled:true,title:`${t.title} ${d("graph.reportTitle")}`}}},filters:m,rows:f,loading:p,refresh:X}};T();var Sh=new Set(["id","title","description","icon","iconNode","meta"]),wh=t=>t.replace(/([A-Z])/g," $1").replace(/[._-]+/g," ").replace(/^\w/,r=>r.toUpperCase()).trim(),kh=t=>Object.entries(t).filter(([r,o])=>!Sh.has(r)&&o!==null&&o!==void 0&&["string","number","boolean"].includes(typeof o)).map(([r,o])=>({key:r,label:wh(r),value:String(o)})),Xp=({item:t,open:r,onClose:o,onDownloadClick:n,renderContent:a,downloadTooltip:i,closeTooltip:s})=>{let{t:l}=pe(),p=yr()==="dark"?"var(--orb-p300)":"var(--orb-primary)";Jt__namespace.default.useEffect(()=>{if(!r)return;let f=b=>{b.key==="Escape"&&o();};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[r,o]);let u=kh(t);return typeof document>"u"?null:reactDom.createPortal(c(jsxRuntime.Fragment,{children:[e("div",{"aria-hidden":"true",onClick:o,sx:{position:"fixed",inset:0,zIndex:1299,backgroundColor:"rgba(1, 9, 26, 0.4)",opacity:r?1:0,pointerEvents:r?"auto":"none",transition:"opacity 200ms ease"}}),c("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:r?"translate(-50%, -50%) scale(1)":"translate(-50%, -47%) scale(0.96)",opacity:r?1:0,transition:"transform 200ms ease, opacity 180ms ease"},children:[c(ie,{direction:"row",spacing:1.5,alignItems:"center",sx:{p:2.5,pb:2,borderBottom:"1px solid",borderColor:"divider",flexShrink:0},children:[e("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??e(Mt,{name:t.icon??"product",size:30,style:{color:p}})}),c("div",{sx:{flex:1,minWidth:0},children:[e(L,{component:"div",sx:{fontWeight:700,fontSize:"1.1rem",lineHeight:1.3,wordBreak:"break-word"},children:t.title}),t.meta?e(L,{component:"div",sx:{fontSize:"0.8rem",color:"text.secondary"},children:t.meta}):null]}),e(ae,{tooltip:s??l("cardPage.close"),"aria-label":s??l("cardPage.close"),onClick:o,children:e(Mt,{name:"decline",size:18})})]}),e("div",{sx:{flex:1,minHeight:0,overflowY:"auto",p:2.5},children:a?a(t):c(jsxRuntime.Fragment,{children:[t.description?e(L,{component:"div",sx:{fontSize:"0.9rem",lineHeight:1.6,color:"text.primary"},children:t.description}):null,u.length>0?e("div",{sx:{mt:t.description?2.5:0,display:"grid",gap:1.5},children:u.map(f=>c("div",{children:[e(L,{component:"div",sx:{fontSize:"0.72rem",fontWeight:600,color:"text.secondary",textTransform:"uppercase",letterSpacing:"0.04em"},children:f.label}),e(L,{component:"div",sx:{fontSize:"0.88rem",color:"text.primary",wordBreak:"break-word"},children:f.value})]},f.key))}):null]})}),n?e("div",{sx:{p:2.5,pt:2,borderTop:"1px solid",borderColor:"divider",flexShrink:0},children:e(Ce,{variant:"contained",sx:{width:"100%"},startIcon:e(Mt,{name:"download",size:16}),onClick:()=>n(t),children:i??l("cardPage.download")})}):null]})]}),document.body)};T();var Ph={display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3",overflow:"hidden"},Th=({item:t,onDetailClick:r,onDownloadClick:o,detailTooltip:n,downloadTooltip:a})=>{let{t:i}=pe(),l=yr()==="dark"?"var(--orb-p300)":"var(--orb-primary)",d=t.iconNode??e(Mt,{name:t.icon??"product",size:26,style:{color:l}});return c(Ee,{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:[c(ie,{direction:"row",spacing:1.5,alignItems:"center",children:[e("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}),c("div",{sx:{flex:1,minWidth:0},children:[e(L,{component:"div",noWrap:true,sx:{fontWeight:700,fontSize:"0.98rem",lineHeight:1.3},children:t.title}),t.meta?e(L,{component:"div",noWrap:true,sx:{fontSize:"0.75rem",color:"text.secondary"},children:t.meta}):null]})]}),e("div",{sx:{mt:1.5,flex:1,minHeight:0},children:e(L,{component:"div",sx:{fontSize:"0.84rem",lineHeight:1.45,color:"text.primary",...Ph},children:t.description||"\xA0"})}),c(ie,{direction:"row",spacing:.5,justifyContent:"flex-end",sx:{mt:1.5},children:[e(ae,{tooltip:n??i("cardPage.viewDetails"),"aria-label":n??i("cardPage.viewDetails"),onClick:()=>r?.(t),children:e(Mt,{name:"show",size:18})}),e(ae,{tooltip:a??i("cardPage.download"),"aria-label":a??i("cardPage.download"),onClick:()=>o?.(t),children:e(Mt,{name:"download",size:18})})]})]})},Zp=({items:t,loading:r=false,onDetailClick:o,onDownloadClick:n,minCardWidth:a=260,detailTooltip:i,downloadTooltip:s,emptyText:l,detailPanel:d=true,renderDetailContent:p})=>{let{t:u}=pe(),[f,b]=Jt__namespace.default.useState(null),[m,v]=Jt__namespace.default.useState(false),y=x=>{o?.(x),d&&(b(x),requestAnimationFrame(()=>requestAnimationFrame(()=>v(true))));},g=()=>{v(false),setTimeout(()=>b(null),260);};return r?e("div",{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",minHeight:240},children:e(Xr,{})}):t.length?c(jsxRuntime.Fragment,{children:[e("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=>e(Th,{item:x,onDetailClick:y,onDownloadClick:n,detailTooltip:i,downloadTooltip:s},x.id))}),d&&f?e(Xp,{item:f,open:m,onClose:g,onDownloadClick:n,renderContent:p,downloadTooltip:s}):null]}):e("div",{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",minHeight:240},children:e(L,{sx:{color:"text.secondary"},children:l??u("cardPage.empty")})})};T();var TD=({id:t,title:r,hideHeader:o=true,filterConfig:n,gridProps:a,children:i,spacing:s=1})=>{let l=n?{...n,appId:n.appId||t}:void 0;return c(pi,{title:r,hideHeader:o,children:[c(ie,{spacing:s,sx:{height:"100%",overflow:"hidden"},children:[l&&e("div",{sx:{flexShrink:0},children:e(Wr,{...l})}),e("div",{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:e(Zp,{...a})})]}),i]})};var ND=({metadata:t,fetchData:r,tableKey:o="default",variantService:n,serviceUrl:a,onDetailClick:i,onDownloadClick:s,minCardWidth:l})=>{let[d,p]=Jt.useState(false),[u,f]=Jt.useState([]),[b,m]=Jt.useState(0),[v,y]=Jt.useState({}),[g,x]=Jt.useState(t.variants||[]),[h,C]=Jt.useState("");Jt.useEffect(()=>{let D={};t.filters.forEach(I=>{I.defaultValue!==void 0&&(D[I.id]=I.defaultValue);}),y(D);},[t.filters]);let P=Jt.useCallback(async D=>{p(true);try{let I=r?await r({...D}):{rows:[],total:0};f(I?.rows||[]),m(I?.total||0);}catch(I){console.error("Failed to fetch card page data",I);}finally{p(false);}},[r]);Jt.useEffect(()=>{P(v);},[P]);let w=()=>{P(v);},k=D=>{y(D);},R=D=>{C(D?.id||"");let I=Ni(D,o);if(I){let A=I.values??I;y(A),P(A);}},S=D=>{let I={...D,id:Date.now().toString(),createdAt:new Date().toISOString()};x(A=>[...A,I]);};return {pageProps:{id:t.id,title:t.title,filterConfig:{appId:t.id,tableKey:o,fields:t.filters,filters:v,onFilterChange:k,onSearch:w,onVariantLoad:R,onVariantSave:S,onVariantDelete:D=>x(I=>I.filter(A=>A.id!==D)),onVariantSetDefault:D=>{x(I=>I.map(A=>({...A,isDefault:A.id===D})));},variants:g,currentVariantId:h,variantService:n,serviceUrl:a},gridProps:{items:u,loading:d,onDetailClick:i,onDownloadClick:s,minCardWidth:l}},items:u,total:b,filters:v,loading:d,refresh:w}};var Rh=t=>[...t].sort((r,o)=>o.value-r.value),LD=({bars:t=[],lines:r=[],combos:o=[],heatmap:n=[],pies:a=[],waterfalls:i=[]})=>{let s=Jt.useMemo(()=>Rh(t),[t]),l=Jt.useMemo(()=>[...r],[r]),d=Jt.useMemo(()=>[...o],[o]),p=Jt.useMemo(()=>[...n],[n]),u=Jt.useMemo(()=>{let b=a.reduce((m,v)=>m+v.value,0);return a.map(m=>({...m,percent:b>0?m.value/b*100:m.percent}))},[a]),f=Jt.useMemo(()=>[...i],[i]);return {bars:s,lines:l,combos:d,heatmap:p,pies:u,waterfalls:f}};var zD=({apiKey:t,query:r,zoom:o=14,mapType:n="roadmap"})=>Jt.useMemo(()=>!t||!r?"":ta({apiKey:t,query:r,zoom:o,mapType:n}),[t,r,o,n]),VD=({keyword:t,location:r})=>Jt.useMemo(()=>Si({keyword:t,location:r?{lng:r.lng,lat:r.lat,name:r.name}:void 0}),[t,r]);T();var ia=({code:t,language:r="text",copyable:o=true,showLineNumbers:n=false,wrapLongLines:a=false,maxHeight:i})=>{let[s,l]=Jt.useState(false),d=Jt.useMemo(()=>t.replace(/\n$/,"").split(`
186
+ `),[t]);return c("div",{style:{border:"1px solid var(--orb-border)",borderRadius:12,overflow:"hidden",background:"var(--orb-canvas)"},children:[c("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"4.8px 8px",background:"var(--orb-hover)",borderBottom:"1px solid var(--orb-border)"},children:[e("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:r}),o&&e(ae,{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?e(qr,{size:14,strokeWidth:1.8}):e(ho,{size:14,strokeWidth:1.8})})]}),e("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((u,f)=>c("div",{style:{display:"flex"},children:[e("span",{style:{width:34,flexShrink:0,textAlign:"right",paddingRight:8,color:"var(--orb-disabled-fg)",userSelect:"none"},children:f+1}),e("span",{style:{whiteSpace:a?"pre-wrap":"pre",wordBreak:a?"break-word":"normal"},children:u})]},`${f}-${u}`)):e("code",{style:{display:"block",whiteSpace:a?"pre-wrap":"pre",wordBreak:a?"break-word":"normal"},children:t})})]})};T();var Lh=t=>{let r=t.trim();return r.startsWith("$$")&&r.endsWith("$$")&&r.length>=4&&(r=r.slice(2,-2).trim()),r.startsWith("$")&&r.endsWith("$")&&r.length>=2&&(r=r.slice(1,-1).trim()),r},Oh=async t=>new Function("m","return import(m)")(t),sa=({expression:t,inline:r=false,allowKatex:o=false})=>{let n=Jt.useMemo(()=>Lh(t),[t]),[a,i]=Jt.useState("");return Jt.useEffect(()=>{let s=true;return (async()=>{if(!o||!n){i("");return}try{let d=await Oh("katex"),u=(d?.default||d)?.renderToString?.(n,{displayMode:!r,throwOnError:!1,strict:"warn"});s&&typeof u=="string"&&i(u);}catch{s&&i("");}})(),()=>{s=false;}},[o,n,r]),n?a?e(ke,{component:r?"span":"div",sx:{display:r?"inline-flex":"block",my:r?0:.5,overflowX:"auto"},dangerouslySetInnerHTML:{__html:a}}):r?e(ke,{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}):e(ke,{sx:{my:1,p:1,borderRadius:1.2,border:"1px dashed",borderColor:"divider",bgcolor:"background.paper"},children:e(br,{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};T();var Hh=async t=>new Function("m","return import(m)")(t),sl=({code:t,title:r="Mermaid Diagram",height:o=320,enabled:n=true})=>{let[a,i]=Jt.useState(""),[s,l]=Jt.useState(""),[d,p]=Jt.useState(false),u=Jt.useMemo(()=>t.trim(),[t]);return Jt.useEffect(()=>{let f=true;return (async()=>{if(!n||!u){i(""),l("");return}p(true),l(""),i("");try{let m=await Hh("mermaid"),v=m?.default||m;if(!v||typeof v.render!="function")throw new Error("Mermaid runtime is not available");v.initialize?.({startOnLoad:!1,securityLevel:"loose",theme:"default"});let y=await v.render(`orbcafe-mermaid-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,u),g=typeof y=="string"?y:y?.svg;f&&typeof g=="string"&&i(g);}catch(m){if(f){let v=m instanceof Error?m.message:"Failed to render Mermaid diagram";l(v);}}finally{f&&p(false);}})(),()=>{f=false;}},[n,u]),c(Fo,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:[e(ke,{sx:{px:1,py:.6,borderBottom:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:e(br,{variant:"caption",color:"text.secondary",sx:{letterSpacing:.4,textTransform:"uppercase"},children:r})}),c(ke,{sx:{p:1},children:[d&&e(ke,{sx:{minHeight:120,display:"flex",alignItems:"center",justifyContent:"center"},children:e(fd,{size:20})}),!d&&a&&e(ke,{sx:{maxHeight:o,overflow:"auto","& svg":{display:"block",mx:"auto",maxWidth:"100%",height:"auto"}},dangerouslySetInnerHTML:{__html:a}}),!d&&!a&&c(ke,{children:[s&&e(jr,{severity:"info",sx:{mb:1},children:s}),e(ia,{code:u,language:"mermaid",copyable:true,showLineNumbers:true,wrapLongLines:true})]})]})]})};T();var ll=t=>t.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(o=>o.trim()),Vh=t=>/^:?-{3,}:?$/.test(t.trim()),Wh=t=>{let r=t.trim(),o=r.startsWith(":"),n=r.endsWith(":");return o&&n?"center":n?"right":"left"},Ei=t=>{let r=t.split(`
187
+ `).map(s=>s.trim()).filter(Boolean);if(r.length<2)return null;let o=ll(r[0]),n=ll(r[1]);if(o.length===0||n.length!==o.length||!n.every(Vh))return null;let a=n.map(Wh),i=r.slice(2).filter(s=>s.includes("|")).map(s=>{let l=ll(s);return l.length<o.length?[...l,...Array.from({length:o.length-l.length},()=>"")]:l.slice(0,o.length)});return {headers:o,aligns:a,rows:i}},cl=({markdown:t,table:r,maxHeight:o=360})=>{let n=Jt.useMemo(()=>r||(t?Ei(t):null),[r,t]);return !n||n.headers.length===0?e(Fo,{variant:"outlined",sx:{p:1.2,borderRadius:1.5},children:e(br,{variant:"body2",color:"text.secondary",children:"Invalid table block"})}):e(Fo,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:e(yd,{sx:{maxHeight:o},children:c(hd,{size:"small",stickyHeader:true,children:[e(Cd,{children:e(js,{children:n.headers.map((a,i)=>e(Zs,{align:n.aligns[i],sx:{fontWeight:700,bgcolor:"background.paper"},children:a},`${a}-${i}`))})}),e(vd,{children:n.rows.map((a,i)=>e(js,{hover:true,children:a.map((s,l)=>e(Zs,{align:n.aligns[l],sx:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:s||e(ke,{component:"span",sx:{color:"text.disabled"},children:"-"})},`cell-${i}-${l}`))},`row-${i}`))})]})})})};T();var Li=({content:t,title:r="Thinking",defaultExpanded:o=false,isStreaming:n=false})=>{let[a,i]=Jt.useState(o);return c(ke,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1,my:.8},children:[c(ud,{direction:"row",alignItems:"center",spacing:.6,children:[e(md,{size:"small",onClick:()=>i(s=>!s),sx:{transform:a?"rotate(180deg)":"rotate(0deg)",transition:"transform .15s ease"},children:e(on,{fontSize:"inherit"})}),c(br,{variant:"caption",color:"text.secondary",sx:{fontStyle:"italic"},children:[r,n?" ...":""]})]}),e(rn,{in:a,children:e(br,{variant:"body2",sx:{pl:4,pt:.4,whiteSpace:"pre-wrap",color:"text.secondary",fontStyle:"italic",lineHeight:1.55},children:t})})]})};T();var dl=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|\*[^*]+\*|\$[^$\n]+\$)/g,Oi=t=>t.trim().startsWith("```"),eu=t=>/^#{1,6}\s+/.test(t.trim()),pl=t=>/^[-*+]\s+/.test(t.trim()),ul=t=>/^\d+\.\s+/.test(t.trim()),tu=t=>/^(?:-{3,}|\*{3,}|_{3,})$/.test(t.trim()),ml=t=>t.trim().startsWith(">"),ru=(t,r)=>{if(r+1>=t.length)return false;let o=t[r],n=t[r+1];return !o.includes("|")||!n.includes("|")?false:/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(n.trim())},ou=t=>t.trim().startsWith("<think>")||t.trim()===":::think",la=(t,r,o)=>{let n=[],a=0,i=0;dl.lastIndex=0;let s=dl.exec(t);for(;s;){s.index>a&&n.push(t.slice(a,s.index));let l=s[0],d=`${o}-${i}`;if(l.startsWith("**")&&l.endsWith("**"))n.push(e("strong",{children:l.slice(2,-2)},d));else if(l.startsWith("*")&&l.endsWith("*"))n.push(e("em",{children:l.slice(1,-1)},d));else if(l.startsWith("`")&&l.endsWith("`"))n.push(e(ke,{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(e(pd,{href:p[2],target:"_blank",rel:"noreferrer",children:p[1]},d)):n.push(l);}else l.startsWith("$")&&l.endsWith("$")&&r.enableMath?n.push(e(sa,{expression:l,inline:true,allowKatex:true},d)):n.push(l);a=s.index+l.length,i+=1,s=dl.exec(t);}return a<t.length&&n.push(t.slice(a)),n.length>0?n:[t]},ca=({markdown:t,content:r,className:o,enableMath:n=true,enableMermaid:a=true,enableThinkBlock:i=true,codeCopyable:s=true,codeLineNumbers:l=false})=>{let d=t??r??"",p=Jt.useMemo(()=>{let u=[],f=d.replace(/\r\n/g,`
188
188
  `).split(`
189
- `),b={enableMath:n},m=0;for(;m<f.length;){let v=f[m],y=v.trim();if(!y){m+=1;continue}if(i&&cp(v)){if(y.startsWith("<think>")){let h=[],S=v;for(;;){let T=S.indexOf("<think>"),C=T>=0?S.slice(T+7):S,L=C.indexOf("</think>");if(L>=0){h.push(C.slice(0,L)),m+=1;break}if(h.push(C),m+=1,m>=f.length)break;S=f[m];}d.push(e(bi,{content:h.join(`
190
- `).trim()},`think-tag-${m}`));continue}m+=1;let x=[];for(;m<f.length&&f[m].trim()!==":::";)x.push(f[m]),m+=1;m<f.length&&f[m].trim()===":::"&&(m+=1),d.push(e(bi,{content:x.join(`
191
- `).trim()},`think-fence-${m}`));continue}if(hi(v)){let x=y.slice(3).trim().toLowerCase(),h=[];for(m+=1;m<f.length&&!hi(f[m]);)h.push(f[m]),m+=1;m<f.length&&hi(f[m])&&(m+=1);let S=h.join(`
192
- `);if(a&&x==="mermaid"){d.push(e(As,{code:S},`mermaid-${m}`));continue}if(n&&["math","latex","katex"].includes(x)){d.push(e(Xn,{expression:S,allowKatex:true},`math-fence-${m}`));continue}d.push(e(qn,{code:S,language:x||"text",copyable:s,showLineNumbers:c,wrapLongLines:true},`code-${m}`));continue}if(n&&y.startsWith("$$")){let x=[];if(y.endsWith("$$")&&y!=="$$")x.push(y.slice(2,-2)),m+=1;else {let S=v.slice(v.indexOf("$$")+2);for(S.trim()&&x.push(S),m+=1;m<f.length;){let T=f[m],C=T.indexOf("$$");if(C>=0){x.push(T.slice(0,C)),m+=1;break}x.push(T),m+=1;}}d.push(e(Xn,{expression:x.join(`
193
- `).trim(),allowKatex:true},`math-${m}`));continue}if(ip(v)){let x=Math.min(6,v.match(/^#{1,6}/)?.[0]?.length||1),h=v.replace(/^#{1,6}\s+/,""),S=x===1?"h5":x===2?"h6":"subtitle1";d.push(e(gr,{variant:S,sx:{mt:x===1?1.2:.8,mb:.5,fontWeight:700},children:Yn(h,b,`h-${m}`)},`heading-${m}`)),m+=1;continue}if(sp(v)){d.push(e(xc,{sx:{my:1.2}},`hr-${m}`)),m+=1;continue}if(lp(f,m)){let x=m+2;for(;x<f.length&&f[x].trim()&&f[x].includes("|");)x+=1;let h=f.slice(m,x).join(`
194
- `),S=fi(h);if(S){d.push(e(Es,{table:S},`table-${m}`)),m=x;continue}}if(Bs(v)){let x=[];for(;m<f.length&&Bs(f[m]);)x.push(f[m].replace(/^\s*>\s?/,"")),m+=1;d.push(e(Ro,{variant:"outlined",sx:{px:1,py:.8,my:.9,borderLeftWidth:3,borderLeftStyle:"solid",borderLeftColor:"primary.main",bgcolor:"action.hover"},children:e(gr,{variant:"body2",sx:{whiteSpace:"pre-wrap"},children:x.map((h,S)=>l(Qt.Fragment,{children:[S>0&&e("br",{}),Yn(h,b,`q-${m}-${S}`)]},`quote-line-${S}`))})},`quote-${m}`));continue}if(Fs(v)){let x=[];for(;m<f.length&&Fs(f[m]);)x.push(f[m].trim().replace(/^[-*+]\s+/,"")),m+=1;d.push(e(we,{component:"ul",sx:{my:.8,pl:2.5},children:x.map((h,S)=>e(we,{component:"li",sx:{mb:.45},children:e(gr,{variant:"body2",children:Yn(h,b,`ul-${m}-${S}`)})},`ul-item-${S}`))},`ul-${m}`));continue}if(Os(v)){let x=[];for(;m<f.length&&Os(f[m]);)x.push(f[m].trim().replace(/^\d+\.\s+/,"")),m+=1;d.push(e(we,{component:"ol",sx:{my:.8,pl:2.7},children:x.map((h,S)=>e(we,{component:"li",sx:{mb:.45},children:e(gr,{variant:"body2",children:Yn(h,b,`ol-${m}-${S}`)})},`ol-item-${S}`))},`ol-${m}`));continue}let g=[];for(;m<f.length;){let x=f[m],h=x.trim();if(!h||hi(x)||ip(x)||sp(x)||Fs(x)||Os(x)||Bs(x)||lp(f,m)||i&&cp(x)||n&&h.startsWith("$$"))break;g.push(x),m+=1;}g.length>0?d.push(e(gr,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:g.map((x,h)=>l(Qt.Fragment,{children:[h>0&&e("br",{}),Yn(x,b,`p-${m}-${h}`)]},`p-line-${h}`))},`p-${m}`)):m+=1;}return d},[p,n,a,i,s,c]);return e(we,{className:o,sx:{"& strong":{fontWeight:700},"& em":{fontStyle:"italic"},"& a":{wordBreak:"break-all"}},children:u})};w();var jR=(t,r)=>e(Zn,{markdown:t,...r});w();var dp=({value:t,onChange:r,onSubmit:o,onVoiceInput:n,onClear:a,placeholder:i,statusText:s,loading:c=false,compact:p=false,showStatusText:u=true})=>l(ie,{spacing:.75,children:[l("div",{sx:{display:"flex",alignItems:"center",gap:1,px:1.2,py:p?.25:.4,borderRadius:999,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",minHeight:p?38:44},children:[e(Do,{sx:{fontSize:p?16:18,color:"text.secondary"}}),e(Ic,{fullWidth:true,value:t,onChange:d=>r(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),o());},placeholder:i,sx:{fontSize:p?"0.84rem":"0.9rem"}}),t&&a&&e(ae,{size:"small",onClick:a,children:e(mo,{sx:{fontSize:p?16:18}})}),n&&e(ae,{size:"small",onClick:n,children:e(nd,{sx:{fontSize:p?16:18}})}),e(ae,{size:"small",onClick:o,disabled:c||!t.trim(),children:e(cd,{sx:{fontSize:p?16:18}})})]}),u&&s&&e(E,{variant:"caption",color:"text.secondary",children:s})]});w();var pp=(t,r)=>{let o=r.trim();if(!o)return t;let n=t.toLowerCase(),a=o.toLowerCase(),i=n.indexOf(a);return i<0?t:l(jsxRuntime.Fragment,{children:[t.slice(0,i),e("div",{component:"mark",sx:{bgcolor:"warning.light",color:"warning.contrastText",px:.15,borderRadius:.4},children:t.slice(i,i+o.length)}),t.slice(i+o.length)]})},vi=({section:t,highlightQuery:r=""})=>{let o=t.columns||2;return l(Ne,{variant:"outlined",sx:{p:1.8,borderRadius:2},children:[e(E,{variant:"subtitle1",sx:{fontWeight:700,mb:1.4},children:t.title}),e("div",{sx:{display:"grid",gap:1.15,gridTemplateColumns:{xs:"1fr",md:o===3?"repeat(3, minmax(0, 1fr))":o===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 l("div",{sx:{minWidth:0},children:[e(E,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:pp(n.label,r)}),e(E,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:a?pp(a,r):n.value})]},n.id)})})]})};var zs=t=>t==null?"":typeof t=="string"||typeof t=="number"||typeof t=="boolean"?String(t):"",xi=t=>t.trim().toLowerCase(),Cb=(t,r)=>{let o=[];return t.forEach(n=>{n.fields.forEach(a=>{let i=a.searchableText||zs(a.value),s={source:"section",sourceId:n.id,sourceSectionId:n.id,sourceTitle:n.title,fieldId:a.id,fieldLabel:a.label,fieldValue:i};o.push({hit:s,text:xi(`${n.title} ${a.label} ${i}`)});});}),r.forEach(n=>{(n.fields||[]).forEach(a=>{let i=a.searchableText||zs(a.value),s={source:"tab",sourceId:n.id,sourceTitle:n.label,fieldId:a.id,fieldLabel:a.label,fieldValue:i};o.push({hit:s,text:xi(`${n.label} ${a.label} ${i}`)});}),(n.sections||[]).forEach(a=>{a.fields.forEach(i=>{let s=i.searchableText||zs(i.value),c={source:"tab",sourceId:n.id,sourceSectionId:a.id,sourceTitle:`${n.label} / ${a.title}`,fieldId:i.id,fieldLabel:i.label,fieldValue:s};o.push({hit:c,text:xi(`${n.label} ${a.title} ${i.label} ${s}`)});});});}),o},up=({sections:t,tabs:r=[],defaultTabId:o,ai:n})=>{let{t:a}=de(),[i,s]=Qt.useState(""),[c,p]=Qt.useState(o||r[0]?.id),[u,d]=Qt.useState("idle"),[f,b]=Qt.useState([]),[m,v]=Qt.useState(""),[y,g]=Qt.useState(""),[x,h]=Qt.useState(false),S=Qt.useMemo(()=>Cb(t,r),[t,r]);Qt.useEffect(()=>{if(r.length===0){p(void 0);return}r.some(N=>N.id===c)||p(o||r[0]?.id);},[r,c,o]);let T=Qt.useCallback(()=>{d("idle"),b([]),v(""),g("");},[]),C=Qt.useCallback(I=>{s(I),I.trim()||(d("idle"),b([]),v(""),g(""));},[]),L=Qt.useCallback(I=>{let N=xi(I);return N?S.filter(M=>M.text.includes(N)).map(M=>M.hit):[]},[S]),A=Qt.useCallback(async()=>{let I=i.trim();if(!I)return;h(true);let N=L(I);if(b(N),N.length>0){d("search"),g(""),v(a("detail.searchAi.matches",{count:N.length})),h(false);return}if(n?.enabled!==false&&n?.onSubmit){d("ai"),v(a("detail.searchAi.autoAiFallback"));try{let k=await n.onSubmit(I,{query:I,hits:N,activeTabId:c,sections:t,tabs:r});g(typeof k=="string"?k:"");}finally{h(false);}return}d("search"),g(""),v(a("detail.searchAi.noMatch")),h(false);},[i,L,a,n,c,t,r]);return {query:i,setQuery:C,activeTabId:c,setActiveTabId:p,searchMode:u,hits:f,statusText:m,aiResponse:y,searching:x,handleSubmit:A,clearResult:T}};w();var PM=({title:t,subtitle:r,sections:o,tabs:n=[],defaultTabId:a,table:i,ai:s,rightHeaderSlot:c,searchBarWidth:p=460,onClose:u,closeLabel:d="Close"})=>{let{t:f}=de(),{query:b,setQuery:m,activeTabId:v,setActiveTabId:y,searchMode:g,hits:x,statusText:h,aiResponse:S,searching:T,handleSubmit:C,clearResult:L}=up({sections:o,tabs:n,defaultTabId:a,ai:s}),A=Qt.useMemo(()=>n.find(M=>M.id===v)||n[0],[n,v]),I=Qt.useCallback(M=>{let k=D=>{let R=document.getElementById(M);if(R){R.scrollIntoView({behavior:"smooth",block:"center"});return}D<4&&setTimeout(()=>k(D+1),60);};requestAnimationFrame(()=>k(0));},[]),N=Qt.useCallback((M,k)=>{if(n.some(D=>D.id===M)){y(M),I(k?`detail-tab-${M}-section-${k}`:`detail-tab-${M}`);return}I(`detail-section-${M}`);},[n,y,I]);return l("div",{sx:{display:"flex",flexDirection:"column",gap:1.5,minHeight:"100%"},children:[l(ie,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",md:"center"},spacing:1,children:[l("div",{sx:{minWidth:0},children:[e(E,{variant:"h5",sx:{fontWeight:800,color:"text.primary"},children:t}),r&&e(E,{variant:"body2",color:"text.secondary",sx:{mt:.35},children:r})]}),l(ie,{direction:"row",spacing:.6,alignItems:"center",sx:{width:{xs:"100%",md:"auto"},ml:{xs:0,md:"auto"}},children:[e("div",{sx:{width:{xs:"100%",md:p},maxWidth:"100%",minWidth:{md:320}},children:e(dp,{value:b,onChange:m,onSubmit:C,onVoiceInput:s?.onVoiceInput,onClear:()=>{m(""),L();},placeholder:s?.placeholder||f("detail.searchAi.placeholder"),statusText:h,loading:T,compact:true,showStatusText:false})}),u&&e(it,{title:d,children:e(ae,{size:"small",onClick:u,children:e(Kc,{fontSize:"small"})})}),c]})]}),h&&e(E,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:h}),g==="search"&&x.length>0&&l(Ne,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[e(E,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.6},children:f("detail.searchAi.matches",{count:x.length})}),e(ie,{spacing:.35,children:x.slice(0,8).map(M=>e("div",{component:"button",type:"button",onClick:()=>N(M.sourceId,M.sourceSectionId),sx:{textAlign:"left",border:0,bgcolor:"transparent",p:.2,cursor:"pointer",color:"text.primary",borderRadius:1,"&:hover":{bgcolor:"action.hover"}},children:l(E,{variant:"body2",sx:{fontSize:"0.84rem"},children:[e("div",{component:"span",sx:{color:"text.secondary"},children:M.sourceTitle})," \xB7 ",e("div",{component:"span",sx:{fontWeight:700},children:M.fieldLabel})," = ",e("div",{component:"span",children:M.fieldValue||"-"})]})},`${M.source}|${M.sourceId}|${M.fieldId}`))})]}),g==="ai"&&S&&l(Ne,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[e(E,{variant:"subtitle2",sx:{fontWeight:700,mb:.7},children:f("detail.searchAi.aiResultTitle")}),e("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:e(Zn,{markdown:S})})]}),e("div",{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:o.map(M=>e("div",{id:`detail-section-${M.id}`,children:e(vi,{section:M,highlightQuery:b})},M.id))}),n.length>0&&l(Ne,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[e(Nc,{value:A?.id||false,onChange:(M,k)=>y(String(k)),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:n.map(M=>e(Ec,{value:M.id,label:M.label,sx:{textTransform:"none"}},M.id))}),l("div",{sx:{p:1.5},children:[e("div",{id:`detail-tab-${A?.id||""}`}),A?.description&&e(E,{variant:"body2",color:"text.secondary",sx:{mb:1.2},children:A.description}),A?.content?A.content:l(ie,{spacing:1.5,children:[(A?.sections||[]).map(M=>e("div",{id:`detail-tab-${A?.id}-section-${M.id}`,children:e(vi,{section:M,highlightQuery:b})},M.id)),A?.fields&&A.fields.length>0&&e(vi,{section:{id:`${A.id}-fields`,title:A.label,fields:A.fields,columns:2},highlightQuery:b})]})]})]}),i&&e(Xr,{title:i.title||f("detail.table.title"),...i.tableProps,filterConfig:void 0,fitContainer:false})]})};w();var fp=({bucket:t,cardCount:r,highlighted:o=false,children:n,emptyLabel:a,height:i,maxHeight:s,onRename:c,renameLabel:p,sx:u})=>{let{t:d}=de(),[f,b]=Qt.useState(false),[m,v]=Qt.useState(t.title),y=()=>{v(t.title),b(false);},g=x=>{x.preventDefault();let h=m.trim();h&&(h!==t.title&&c?.(h),v(h),b(false));};return e(Ne,{elevation:0,sx:[x=>{let h=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:o?`1px solid ${tt(h,.65)}`:"1px solid var(--orb-border)",bgcolor:"var(--orb-canvas)",boxShadow:o?`0 0 0 2px ${tt(h,.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:h}}},...Array.isArray(u)?u:u?[u]:[]],children:l(ie,{spacing:1.25,sx:{flex:1,minHeight:0,overflow:"hidden",p:1.5},children:[l(we,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1.25},children:[e(we,{sx:{minWidth:0,flex:1},children:l(we,{sx:{display:"flex",alignItems:"center",gap:.75,minHeight:28},children:[t.icon&&e(we,{sx:{display:"inline-flex",flexShrink:0,color:t.accentColor??"var(--orb-primary)"},children:t.icon}),f?l(we,{component:"form",onSubmit:g,sx:{display:"flex",alignItems:"center",gap:.5,flex:1,minWidth:0},children:[e(Be,{dense:true,autoFocus:true,value:m,onChange:x=>v(x.target.value),onKeyDown:x=>{x.key==="Escape"&&(x.preventDefault(),y());},inputProps:{"aria-label":p??d("kanban.bucket.rename")},error:!m.trim(),sx:{flex:1,minWidth:0}}),e(ae,{type:"submit",size:"small",tooltip:d("kanban.bucket.saveRename"),"aria-label":d("kanban.bucket.saveRename"),disabled:!m.trim(),children:e(Go,{size:14})}),e(ae,{size:"small",tooltip:d("kanban.bucket.cancelRename"),"aria-label":d("kanban.bucket.cancelRename"),onClick:y,children:e(or,{size:14})})]}):e(E,{component:"div",sx:{fontSize:15,fontWeight:600,lineHeight:1.35,color:"text.primary"},children:t.title})]})}),!f&&l(ie,{direction:"row",spacing:.75,sx:{flexShrink:0},children:[e(Tt,{size:"small",label:r,sx:{minWidth:24,justifyContent:"center",fontWeight:600}}),typeof t.limit=="number"&&e(Tt,{size:"small",label:`${d("kanban.bucket.limit")} ${t.limit}`,color:r>t.limit?"warning":"default",variant:"outlined"}),c&&e(ae,{size:"small",tooltip:p??d("kanban.bucket.rename"),"aria-label":p??d("kanban.bucket.rename"),onClick:()=>{v(t.title),b(true);},sx:{width:26,height:26},children:e(Fl,{size:14})})]})]}),o&&e(E,{component:"div",sx:{fontSize:12,color:t.accentColor??"var(--orb-primary)",fontWeight:500},children:d("kanban.bucket.dropHere")}),e(we,{sx:{flex:1,height:0,minHeight:0,overflowY:"auto",overscrollBehavior:"contain",pr:.4,scrollbarGutter:"stable"},children:r>0?n:e(we,{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:e(E,{sx:{fontSize:13,color:"text.secondary"},children:a??t.emptyLabel??d("kanban.empty")})})})]})})};w();var wb={success:"success",warning:"warning",info:"info",error:"error"},kb={critical:"error",high:"warning",medium:"info",low:"success"},Tb={default:"var(--orb-primary)",success:"var(--orb-primary)",warning:"var(--orb-accent)",info:"var(--orb-primary)",error:"var(--orb-err)"},Pb=(t,r)=>{switch(t){case "critical":return r("kanban.priority.critical");case "high":return r("kanban.priority.high");case "medium":return r("kanban.priority.medium");case "low":return r("kanban.priority.low");default:return t}},Ib=t=>t?t.split(/\s+/).map(r=>r.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",Vs=({card:t,bucket:r,dragging:o=false,overlay:n=false,onClick:a,sx:i})=>{let{t:s}=de(),c=!!(a&&r),p=t.tone??(t.priority?kb[t.priority]:"default"),u=p==="default"?"primary":wb[p],d=Tb[p],f=r?{card:t,bucket:r}:void 0;return e(Ne,{onClick:c?()=>f&&a?.(f):void 0,onKeyDown:c?b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),f&&a?.(f));}: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(d,.24)}`,bgcolor:"var(--orb-canvas)",boxShadow:n?"var(--orb-shadow-3)":o?"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:o?.5:1,"&::before":{content:'""',position:"absolute",inset:"0 auto 0 0",width:3,bgcolor:d},"&:hover":c?{transform:"translateY(-1px)",borderColor:tt(d,.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:l(ie,{spacing:1.25,children:[l(we,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[l(we,{sx:{minWidth:0,flex:1},children:[(t.kicker||r?.title)&&e(E,{component:"div",sx:{fontSize:11,fontWeight:500,color:"text.secondary",textTransform:"uppercase"},children:t.kicker??r?.title}),e(E,{component:"div",sx:{mt:.25,fontSize:14,fontWeight:600,lineHeight:1.4,color:"text.primary"},children:t.title})]}),t.priority&&e(Tt,{size:"small",color:u,label:Pb(t.priority,s),variant:p==="default"?"outlined":"filled",sx:{height:22,flexShrink:0,fontWeight:500}})]}),t.summary&&e(E,{component:"div",sx:{fontSize:13,fontWeight:300,color:"text.secondary",lineHeight:1.5},children:t.summary}),t.metrics&&t.metrics.length>0&&e(we,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.min(t.metrics.length,3)}, minmax(0, 1fr))`,gap:.75},children:t.metrics.slice(0,3).map(b=>l(we,{sx:{minWidth:0,borderRadius:"var(--orb-r)",px:1,py:.75,bgcolor:"var(--orb-surface)",border:"1px solid var(--orb-border)"},children:[e(E,{component:"div",noWrap:true,sx:{fontSize:11,fontWeight:500,color:"text.secondary",textTransform:"uppercase"},children:b.label}),e(E,{component:"div",noWrap:true,numeric:true,sx:{mt:.25,fontSize:13,fontWeight:600},children:b.value})]},b.id))}),typeof t.progress=="number"&&l(we,{children:[l(we,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:.5},children:[e(E,{sx:{fontSize:12,color:"text.secondary"},children:s("kanban.card.progress")}),l(E,{numeric:true,sx:{fontSize:12,fontWeight:600},children:[Math.round(t.progress),"%"]})]}),e(Sc,{variant:"determinate",value:Math.max(0,Math.min(100,t.progress)),color:d,sx:{height:4,borderRadius:2}})]}),(t.tags?.length||t.assignee||t.dueDate||t.footer||c)&&l(ie,{spacing:.9,children:[t.tags&&t.tags.length>0&&e(we,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:t.tags.map(b=>e(Tt,{size:"small",label:b.label,color:b.color??"default",variant:"outlined"},b.id))}),l(we,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,flexWrap:"wrap"},children:[l(we,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0},children:[t.assignee&&l(jsxRuntime.Fragment,{children:[e(Ea,{src:t.assignee.avatarSrc,sx:{width:28,height:28,fontSize:11},children:t.assignee.initials??Ib(t.assignee.name)}),l(we,{sx:{minWidth:0},children:[e(E,{component:"div",sx:{fontSize:13,fontWeight:500,lineHeight:1.3},noWrap:true,children:t.assignee.name}),t.dueDate&&e(E,{component:"div",sx:{fontSize:11,color:"text.secondary",lineHeight:1.35},noWrap:true,children:t.dueDate})]})]}),!t.assignee&&t.dueDate&&e(E,{sx:{fontSize:12,color:"text.secondary"},children:t.dueDate})]}),c&&e(E,{sx:{fontSize:12,color:"var(--orb-link)",fontWeight:500,whiteSpace:"nowrap"},children:s("kanban.card.openDetail")})]}),t.footer]})]})})};var bp=(t,r)=>{let o=r.title.trim();return !r.id||!o||t.buckets.some(n=>n.id===r.id)?t:{buckets:[...t.buckets,{...r,title:o,cards:[]}]}},hp=(t,r,o)=>{let n=o.trim();if(!n)return t;let a=t.buckets.find(i=>i.id===r);return !a||a.title===n?t:{buckets:t.buckets.map(i=>i.id===r?{...i,title:n}:i)}},Rb=(t,r)=>Number.isNaN(t)||t<0?0:t>r?r:t,vp=({buckets:t,cards:r})=>{let o=new Map;return r.forEach((n,a)=>{let i=o.get(n.bucketId)??[];i.push({card:n,sourceIndex:a}),o.set(n.bucketId,i);}),{buckets:t.map(n=>{let a=[...o.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}})}},Hr=(t,r)=>{for(let o=0;o<t.buckets.length;o+=1){let n=t.buckets[o],a=n.cards.findIndex(i=>i.id===r);if(a>=0)return {card:n.cards[a],bucket:n,bucketIndex:o,cardIndex:a}}},Ci=(t,r)=>{let o=Hr(t,r.cardId);if(!o)return t;let n=t.buckets.findIndex(u=>u.id===r.toBucketId);if(n<0)return t;let a=t.buckets.map(u=>({...u,cards:u.cards.map(d=>({...d}))})),i=a[o.bucketIndex],[s]=i.cards.splice(o.cardIndex,1);if(!s)return t;let c=a[n],p=Rb(r.targetIndex??c.cards.length,c.cards.length);return c.cards.splice(p,0,{...s,bucketId:r.toBucketId}),{buckets:a.map(u=>({...u,cards:u.cards.map((d,f)=>({...d,bucketId:u.id,position:f}))}))}};w();var $s="kanban-card|",Gs="kanban-bucket|",Cp=t=>`${$s}${t}`,Vb=t=>`${Gs}${t}`,Si=t=>t?.startsWith($s)?t.slice($s.length):void 0,xp=t=>t?.startsWith(Gs)?t.slice(Gs.length):void 0,Hb=({card:t,bucket:r,onCardClick:o})=>{let{setNodeRef:n,attributes:a,listeners:i,transform:s,transition:c,isDragging:p}=sortable.useSortable({id:Cp(t.id)}),u={transform:s?`translate3d(${s.x}px, ${s.y}px, 0)`:void 0,transition:c,zIndex:p?2:1,touchAction:"none",cursor:p?"grabbing":"grab"};return e("div",{ref:n,style:u,...a,...i,children:e(Vs,{card:t,bucket:r,dragging:p,onClick:o})})},Wb=({bucket:t,highlighted:r,bucketHeight:o,emptyBucketLabel:n,onBucketRename:a,onCardClick:i})=>{let{isOver:s,setNodeRef:c}=core.useDroppable({id:Vb(t.id)});return e(we,{ref:c,sx:{minWidth:0,minHeight:0,height:o},children:e(fp,{bucket:t,cardCount:t.cards.length,highlighted:r||s,emptyLabel:n,height:o,onRename:a,children:e(sortable.SortableContext,{items:t.cards.map(p=>Cp(p.id)),strategy:sortable.verticalListSortingStrategy,children:e(ie,{spacing:1,children:t.cards.map(p=>e(Hb,{card:p,bucket:t,onCardClick:i},p.id))})})})})},Sp=t=>String(t??"").toLocaleLowerCase(),$b=(t,r)=>[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=>Sp(n).includes(r)),eD=({model:t,onCardMove:r,onCardClick:o,cardFilter:n,onBucketAdd:a,onBucketRename:i,addBucketLabel:s,minBucketWidth:c=320,bucketHeight:p,bucketMaxHeight:u,searchable:d=false,searchValue:f,defaultSearchValue:b="",onSearchValueChange:m,searchPlaceholder:v,emptyBucketLabel:y,sx:g})=>{let{t:x}=de(),[h,S]=Qt.useState(null),[T,C]=Qt.useState(),[L,A]=Qt.useState(b),I=f??L,N=I.trim().toLocaleLowerCase(),M=p??u??560,k=Qt.useMemo(()=>({buckets:t.buckets.map(W=>{let H=n?W.cards.filter(J=>n(J,W)):W.cards;if(!N)return {...W,cards:H};let Q=[W.id,W.title,W.description].some(J=>Sp(J).includes(N));return {...W,cards:Q?H:H.filter(J=>$b(J,N))}})}),[n,t,N]),D=Qt.useMemo(()=>k.buckets.reduce((W,H)=>W+H.cards.length,0),[k]),R=Qt.useCallback(W=>{f===void 0&&A(W),m?.(W);},[m,f]),F=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:6}}),core.useSensor(core.TouchSensor,{activationConstraint:{delay:120,tolerance:8}})),z=Qt.useMemo(()=>h?Hr(t,h):void 0,[h,t]),K=Qt.useCallback(()=>{S(null),C(void 0);},[]),V=Qt.useCallback(W=>{if(!W)return;let H=Si(W);return H?Hr(t,H)?.bucket.id:xp(W)},[t]),q=Qt.useCallback(W=>{S(Si(String(W.active.id))??null);},[]),$=Qt.useCallback(W=>{C(V(W.over?String(W.over.id):void 0));},[V]),X=Qt.useCallback(W=>{let H=Si(String(W.active.id)),Q=W.over?String(W.over.id):void 0;if(!H||!Q){K();return}let J=Hr(t,H);if(!J){K();return}let ge=J.bucket.id,se=J.cardIndex,fe=Si(Q);if(fe){let ze=Hr(t,fe);if(!ze){K();return}ge=ze.bucket.id,se=ze.cardIndex;}else {let ze=xp(Q),Re=t.buckets.find(Ve=>Ve.id===ze);if(!ze||!Re){K();return}ge=ze,se=Re.cards.length;}if(J.bucket.id===ge&&J.cardIndex===se){K();return}let xe=Ci(t,{cardId:H,fromBucketId:J.bucket.id,toBucketId:ge,targetIndex:se}),Ke=Hr(xe,H);Ke&&!(Ke.bucket.id===J.bucket.id&&Ke.cardIndex===J.cardIndex)&&r?.({cardId:H,fromBucketId:J.bucket.id,toBucketId:Ke.bucket.id,targetIndex:Ke.cardIndex,card:Ke.card,model:xe}),K();},[t,r,K]);return l(core.DndContext,{sensors:F,collisionDetection:core.closestCorners,onDragStart:q,onDragOver:$,onDragEnd:X,onDragCancel:K,children:[l(we,{sx:{display:"flex",flexDirection:"column",minWidth:0,minHeight:0,height:"100%",overflow:"hidden"},children:[(d||a)&&l(we,{role:d?"search":void 0,sx:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:1.5,mb:1.25,minWidth:0},children:[d&&e(we,{sx:{width:"100%",maxWidth:360,flex:"1 1 240px"},children:e(Be,{dense:true,value:I,onChange:W=>R(W.target.value),placeholder:v??x("kanban.search.placeholder"),autoComplete:"off",sx:{"& .orb-inp":{paddingLeft:"38px",paddingRight:I?"42px":"12px"},"& .orb-inp-adornment-end":{pointerEvents:"auto"}},startAdornment:e(Fr,{size:16,"aria-hidden":"true"}),endAdornment:I?e(ae,{size:"small",tooltip:x("kanban.search.clear"),"aria-label":x("kanban.search.clear"),onClick:()=>R(""),sx:{width:26,height:26},children:e(or,{size:15})}):void 0})}),l(we,{sx:{display:"flex",alignItems:"center",gap:1,ml:"auto"},children:[N&&e(E,{component:"div","aria-live":"polite",sx:{flexShrink:0,fontSize:12,fontWeight:500,color:"text.secondary"},children:D>0?x("kanban.search.results",{count:D}):x("kanban.search.noMatch")}),a&&e(ve,{size:"small",variant:"secondary",startIcon:e(ba,{size:15}),onClick:a,children:s??x("kanban.bucket.add")})]})]}),e(we,{sx:[{display:"grid",gridAutoFlow:"column",gridAutoColumns:`minmax(${c}px, ${Math.max(c,360)}px)`,gap:1.5,gridAutoRows:M==="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)?g:g?[g]:[]],children:k.buckets.map(W=>e(Wb,{bucket:W,highlighted:W.id===T,bucketHeight:M,emptyBucketLabel:N?x("kanban.search.noMatch"):y,onBucketRename:i?H=>i(W.id,H):void 0,onCardClick:o},W.id))})]}),e(core.DragOverlay,{children:z?e(we,{sx:{width:Math.max(c-24,260)},children:e(Vs,{card:z.card,bucket:z.bucket,overlay:true})}):null})]})};var Ub=({initialModel:t,initialBuckets:r,initialCards:o})=>t||vp({buckets:r??[],cards:o??[]}),aD=t=>{let{onCardMove:r,onCardClick:o}=t,[n,a]=Qt.useState(()=>Ub(t)),i=Qt.useCallback(b=>{a(m=>typeof b=="function"?b(m):b);},[]),s=Qt.useCallback(b=>Hr(n,b),[n]),c=Qt.useCallback((b,m,v)=>{let y=Hr(n,b);if(!y)return;let g=Ci(n,{cardId:b,fromBucketId:y.bucket.id,toBucketId:m,targetIndex:v}),x=Hr(g,b);if(!x||x.bucket.id===y.bucket.id&&x.cardIndex===y.cardIndex)return;a(g);let h={cardId:b,fromBucketId:y.bucket.id,toBucketId:x.bucket.id,targetIndex:x.cardIndex,card:x.card,model:g};return r?.(h),h},[n,r]),p=Qt.useCallback((b,m)=>{a(v=>({buckets:v.buckets.map(y=>({...y,cards:y.cards.map(g=>g.id!==b?g:typeof m=="function"?m(g):{...g,...m})}))}));},[]),u=Qt.useCallback(b=>{let m=bp(n,b);return m===n?false:(a(m),true)},[n]),d=Qt.useCallback((b,m)=>{let v=hp(n,b,m);return v===n?false:(a(v),true)},[n]),f=Qt.useMemo(()=>({model:n,onCardMove:b=>{c(b.cardId,b.toBucketId,b.targetIndex);},onCardClick:o}),[n,c,o]);return {model:n,actions:{replaceModel:i,moveCard:c,updateCard:p,addBucket:u,renameBucket:d,getCard:s},boardProps:f}};function pn({onTextUpdate:t,onComplete:r,onError:o,wsUrl:n="ws://localhost:8765",silenceThresholdMs:a=2e3,minVolumeRms:i=.015}){let[s,c]=Qt.useState(false),p=Qt.useRef(null),u=Qt.useRef(null),d=Qt.useRef(null),f=Qt.useRef(null),b=Qt.useRef(null),m=Qt.useRef(0),v=Qt.useRef(false),y=Qt.useRef(false),g=Qt.useCallback(()=>{p.current&&(p.current.close(),p.current=null),f.current&&(f.current.disconnect(),f.current=null),b.current&&(b.current.disconnect(),b.current=null),u.current&&(u.current.getTracks().forEach(S=>S.stop()),u.current=null),d.current&&(d.current.close(),d.current=null),y.current=false,c(false);},[]),x=Qt.useCallback(()=>{v.current||(v.current=true,p.current?.readyState===WebSocket.OPEN&&p.current.send(JSON.stringify({type:"stop"})),setTimeout(g,500));},[g]),h=Qt.useCallback(async()=>{if(!(s||y.current)){y.current=true,v.current=false,m.current=Date.now();try{let S=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:16e3,echoCancellation:!0,noiseSuppression:!0}});u.current=S;let T=new WebSocket(n);p.current=T,T.onopen=()=>{c(!0),y.current=!1;},T.onmessage=N=>{try{let M=JSON.parse(N.data);if(M.type==="recognition")M.is_final?r(M.text):t?.(M.text);else if(M.type==="error"){let k=M.message||"Voice recognition error";o?.(k),x();}}catch{o?.("Failed to parse voice message");}},T.onerror=()=>{o?.("Voice service connection failed"),g();},T.onclose=()=>{g();};let C=window.AudioContext||window.webkitAudioContext;if(!C)throw new Error("AudioContext is not supported in this browser");let L=new C({sampleRate:16e3});d.current=L;let A=L.createMediaStreamSource(S);b.current=A;let I=L.createScriptProcessor(4096,1,1);f.current=I,I.onaudioprocess=N=>{if(p.current?.readyState!==WebSocket.OPEN)return;let M=N.inputBuffer.getChannelData(0),k=0;for(let F=0;F<M.length;F+=1)k+=M[F]*M[F];if(Math.sqrt(k/M.length)>i)m.current=Date.now();else if(Date.now()-m.current>a&&!v.current){x();return}let R=new Int16Array(M.length);for(let F=0;F<M.length;F+=1){let z=Math.max(-1,Math.min(1,M[F]));R[F]=z<0?z*32768:z*32767;}p.current.send(R.buffer);},A.connect(I),I.connect(L.destination);}catch{o?.("Cannot access microphone"),g();}}},[g,s,i,r,o,t,a,x,n]);return Qt.useEffect(()=>g,[g]),{isRecording:s,startRecording:h,stopRecording:x}}w();var Yb=["en","zh","fr","de","ja","ko"],kp={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},Us=({searchPlaceholder:t,onSearch:r,onSearchAdd:o,maxWidth:n=540,sx:a})=>{let{t:i}=de(),[s,c]=Qt.useState(""),p=Qt.useCallback((g=s)=>{let x=g.trim();x&&(c(""),r?.(x));},[r,s]),u=g=>{g.preventDefault(),p();},{isRecording:d,startRecording:f,stopRecording:b}=pn({onTextUpdate:c,onComplete:g=>{c(g),p(g);},onError:g=>{console.error("Header voice input error:",g);}}),m=Qt.useCallback(async()=>{if(d){b();return}await f();},[d,f,b]),v=t||i("header.searchPlaceholder"),y=s.trim().length>0;return e("form",{className:"orb-app-header-search",onSubmit:u,style:{width:"100%",maxWidth:typeof n=="number"?`${n}px`:n,...a},children:l("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:[e("div",{className:"orb-inp-adornment",children:e(ae,{className:"orb-app-header-ai-action",size:"small",onClick:o,tooltip:i("header.searchAddFeature"),children:e(Mt,{name:"add",size:16})})}),e("input",{className:"orb-inp orb-inp-dense orb-app-header-ai-input",value:s,onChange:g=>c(g.target.value),placeholder:v,style:{border:"none",background:"transparent",flex:1,minWidth:0}}),l("div",{className:"orb-inp-adornment orb-inp-adornment-end",children:[e(ae,{className:"orb-app-header-ai-action",size:"small",onClick:()=>{m();},tooltip:i(d?"header.searchStopVoice":"header.searchStartVoice"),sx:{color:d?"var(--orb-err)":void 0},children:e(Mt,{name:"microphone",size:16})}),e(ae,{className:"orb-app-header-ai-action",size:"small",type:"submit",disabled:!y,tooltip:i("header.searchSend"),children:e(Mt,{name:"paperPlane",size:16})})]})]})})},wi=({appTitle:t,logo:r,onToggleMode:o,locale:n,localeLabel:a,localeOptions:i,onLocaleChange:s,searchPlaceholder:c,showSearch:p=false,onSearch:u,onSearchAdd:d,user:f,onUserRefresh:b,onUserSetting:m,onUserLogout:v,userMenuItems:y,leftSlot:g,rightSlot:x})=>{let{t:h,locale:S}=de(),T=hr(),C=n||S,L=a||kp[C],A=i||Yb,I=T==="dark"?e(Gl,{size:15}):e(ql,{size:15}),N=h(T==="dark"?"header.theme.dark":"header.theme.light"),M=[...b?[{key:"refresh",label:h("header.menu.refresh"),icon:e(ha,{size:15}),onClick:b}]:[],...m?[{key:"settings",label:h("header.menu.setting"),icon:e(va,{size:16}),onClick:m}]:[],...v?[{key:"logout",label:h("header.menu.logout"),icon:e(Wl,{size:16}),onClick:v}]:[]],k=y||M,D=A.map(R=>({label:kp[R],onClick:()=>{s?.(R),window.requestAnimationFrame(()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur();});},disabled:R===C}));return l("header",{className:"orb-app-header",children:[l("div",{className:"orb-app-header-brand",children:[g,r===null?null:r||e("div",{className:"orb-app-header-default-logo","aria-label":"ORBCAFE",children:e(Mt,{name:"product",size:20})}),t&&e(E,{variant:"h4",sx:{fontWeight:700},children:t})]}),e("div",{className:"orb-app-header-center",children:p&&e(Us,{searchPlaceholder:c,onSearch:u,onSearchAdd:d})}),l("div",{className:"orb-app-header-actions",children:[l("div",{className:"orb-app-header-utilities",children:[s?e(Yt,{triggerLabel:L,trigger:l("button",{type:"button",className:"orb-icon-btn orb-app-header-locale",children:[e(Tn,{size:15}),e("span",{className:"orb-label",children:L})]}),items:D,align:"end"}):l("div",{className:"orb-app-header-locale","aria-label":L,children:[e(Tn,{size:15}),e("span",{className:"orb-label",children:L})]}),e(ae,{className:"orb-app-header-theme",size:"small",onClick:o,tooltip:N,children:I})]}),f&&e("span",{className:"orb-app-header-divider","aria-hidden":"true"}),f&&e(Yt,{triggerLabel:f.name,trigger:l("button",{type:"button",className:"orb-app-header-user-trigger",children:[l("span",{className:"orb-app-header-user-copy",children:[e(E,{variant:"body2",className:"orb-app-header-user-name",children:f.name}),f.subtitle&&e(E,{variant:"caption",muted:true,className:"orb-app-header-user-subtitle",title:f.subtitle,children:f.subtitle})]}),e(Uo,{src:f.avatarSrc,alt:f.name,size:32,children:f.avatarText||f.name.slice(0,1).toUpperCase()})]}),items:k.map(R=>({label:R.label,onClick:R.onClick,disabled:R.disabled,icon:R.icon})),align:"end"}),x]})]})};var Tp=({menuData:t=[],initialNavigationCollapsed:r=false,initialNavigationMode:o="fixed",enableNavigationPinning:n,navigationPinStorageKey:a,pinnedNavigationItemIds:i,defaultPinnedNavigationItemIds:s,onPinnedNavigationItemIdsChange:c,pinnedNavigationSectionTitle:p}={})=>{let{navigationIslandProps:u}=fc({initialCollapsed:r,initialDisplayMode:o,content:t,enablePinning:n,pinStorageKey:a,pinnedItemIds:i,defaultPinnedItemIds:s,onPinnedItemIdsChange:c,pinnedSectionTitle:p}),[d,f]=Qt.useState(900);Qt.useEffect(()=>{let m=()=>f(window.innerHeight);return m(),window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[]);let b=Qt.useMemo(()=>Math.max(280,d-100),[d]);return {navigationIslandProps:u,navigationMaxHeight:b}};w();var Nr=12,Ip=56,Rp=234,eh="orbcafe:page-layout-locale",Mp=["en","zh","fr","de","ja","ko"],th=t=>encodeURIComponent(t.trim().toLowerCase()).replace(/%/g,"").replace(/[^a-z0-9._~-]+/g,"-")||"app",ki=(t,r)=>`orbcafe:page-layout:${th(t)}:${r}`,rh=t=>`orbcafe:page-layout:${t.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-")||"app"}:pinned-navigation-items`,oh=t=>t==="system"?"dark":t==="dark"?"light":"system",Ti=(t,r,o)=>Math.min(Math.max(t,r),Math.max(r,o)),nh=t=>t instanceof HTMLElement?!!t.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,RD=({appId:t,appTitle:r,menuData:o=[],children:n,showNavigation:a=true,locale:i="en",localeLabel:s,localeOptions:c,onLocaleChange:p,mode:u,defaultMode:d="system",onModeChange:f,user:b,onUserRefresh:m,onUserSetting:v,onUserLogout:y,userMenuItems:g,logo:x,searchPlaceholder:h,searchPlacement:S="hidden",floatingSearchSx:T,onSearch:C,onSearchAdd:L,rightHeaderSlot:A,leftHeaderSlot:I,contentSx:N,navigationVariant:M="classic",navigationMode:k,defaultNavigationMode:D="fixed",onNavigationModeChange:R,showNavigationModeToggle:F=true,enableNavigationPinning:z=true,navigationPinStorageKey:K,pinnedNavigationItemIds:V,defaultPinnedNavigationItemIds:q,onPinnedNavigationItemIdsChange:$,pinnedNavigationSectionTitle:X})=>{let W=t?ki(t,"mode"):"orbcafe:page-layout-mode",H=t?ki(t,"locale"):eh,Q=t?ki(t,"navigation-mode"):"orbcafe:page-layout-navigation-mode",[J,ge]=Qt.useState(d),[se,fe]=Qt.useState("light"),[xe,Ke]=Qt.useState(false),[ze,Re]=Qt.useState(i),[Ve,Me]=Qt.useState(false),[Ce,He]=Qt.useState(false),[at,ft]=Qt.useState(D),[et,re]=Qt.useState({x:Nr,y:Nr}),[$e,Ee]=Qt.useState("left"),[Le,lt]=Qt.useState(false),Qe=Qt.useRef(null),vt=Qt.useRef(null),St=u!==void 0,Et=u??J,Lt=p!==void 0,te=Lt?i:ze,rt=c?.join("|")??"",Fe=k!==void 0,le=k??at,me=le==="floating",j=M==="v2"?fs:cc,ke=S==="header",Te=Et==="system"?xe?se:"light":Et;Qt.useEffect(()=>{if(!St)try{let U=window.localStorage.getItem(W);(U==="light"||U==="dark"||U==="system")&&ge(U);}catch{}Ke(true);let Se=window.matchMedia("(prefers-color-scheme: dark)"),B=()=>{fe(Se.matches?"dark":"light");};return B(),Se.addEventListener("change",B),()=>Se.removeEventListener("change",B)},[St,W]),Qt.useEffect(()=>{if(!(St||!xe))try{window.localStorage.setItem(W,Et);}catch{}},[xe,St,Et,W]),Qt.useEffect(()=>{if(Lt){Me(true);return}try{let Se=window.localStorage.getItem(H),B=c??Mp;Se&&Mp.includes(Se)&&B.includes(Se)&&Re(Se);}catch{}finally{Me(true);}},[Lt,rt,H]),Qt.useEffect(()=>{if(!(Lt||!Ve))try{window.localStorage.setItem(H,te);}catch{}},[te,Lt,Ve,H]),Qt.useEffect(()=>{if(Fe){He(true);return}try{let Se=window.localStorage.getItem(Q);(Se==="fixed"||Se==="floating")&&ft(Se);}catch{}finally{He(true);}},[Fe]),Qt.useEffect(()=>{if(Ce)try{window.localStorage.setItem(Q,le);}catch{}},[le,Ce]),Qt.useEffect(()=>{Te==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[Te]);let Ye=Qt.useCallback(Se=>{Fe||ft(Se),R?.(Se);},[Fe,R]),pt=Qt.useCallback(Se=>{St||ge(Se),f?.(Se);},[St,f]),ct=Qt.useCallback(Se=>{Lt||Re(Se),p?.(Se);},[Lt,p]),{navigationIslandProps:Ft,navigationMaxHeight:_t}=Tp({menuData:o,initialNavigationCollapsed:false,initialNavigationMode:le,enableNavigationPinning:z,navigationPinStorageKey:K??(t?ki(t,"pinned-navigation-items"):rh(r)),pinnedNavigationItemIds:V,defaultPinnedNavigationItemIds:q,onPinnedNavigationItemIdsChange:$,pinnedNavigationSectionTitle:X}),yt=Ft.collapsed,bt=Qt.useCallback(Se=>{let B=Qe.current,U=B?.parentElement;if(!B||!U)return Se;let ee=U.getBoundingClientRect(),Ie=B.getBoundingClientRect(),be=Nr,De=Nr,_e=Math.max(be,ee.width-Ie.width-Nr),je=Math.max(De,ee.height-Ie.height-Nr);return {x:Ti(Se.x,be,_e),y:Ti(Se.y,De,je)}},[]),yr=Qt.useCallback(Se=>{let B=Qe.current,U=B?.parentElement;if(!B||!U)return Se;let ee=U.getBoundingClientRect(),Ie=B.getBoundingClientRect(),be=Nr,De=Nr,_e=Math.max(be,ee.width-Ie.width-Nr),je=Math.max(De,ee.height-Ie.height-Nr),Ue={x:Ti(Se.x,be,_e),y:Ti(Se.y,De,je)},At=[{distance:Math.abs(Ue.x-be),position:{x:be,y:Ue.y}},{distance:Math.abs(Ue.x-_e),position:{x:_e,y:Ue.y}},{distance:Math.abs(Ue.y-De),position:{x:Ue.x,y:De}},{distance:Math.abs(Ue.y-je),position:{x:Ue.x,y:je}}].reduce((wt,Ct)=>Ct.distance<wt.distance?Ct:wt).position;return Ee(At.x>=(be+_e)/2?"right":"left"),At},[]),Pt=Qt.useMemo(()=>{if(!me||Le)return et.x;if($e==="right"){let U=Qe.current?.parentElement?.getBoundingClientRect().width,ee=yt?Ip:Rp;return U?Math.max(Nr,U-ee-Nr):yt?et.x:et.x-(Rp-Ip)}return et.x},[$e,et.x,Le,me,yt]),Ot=Qt.useCallback(Se=>{if(!me||!yt||nh(Se.target))return;Se.preventDefault(),Se.currentTarget.setPointerCapture(Se.pointerId);let B=bt({x:Pt,y:et.y});Ee("left"),re(B),vt.current={pointerId:Se.pointerId,startClientX:Se.clientX,startClientY:Se.clientY,startX:B.x,startY:B.y,currentX:B.x,currentY:B.y},lt(true);},[bt,Pt,et.y,me,yt]),dt=Qt.useCallback(Se=>{let B=vt.current;if(!B||B.pointerId!==Se.pointerId)return;let U=bt({x:B.startX+Se.clientX-B.startClientX,y:B.startY+Se.clientY-B.startClientY});B.currentX=U.x,B.currentY=U.y,re(U);},[bt]),Bt=Qt.useCallback(Se=>{let B=vt.current;if(!(!B||B.pointerId!==Se.pointerId)){try{Se.currentTarget.releasePointerCapture(Se.pointerId);}catch{}vt.current=null,re(yr({x:B.currentX,y:B.currentY})),lt(false);}},[yr]);return Qt.useEffect(()=>{if(!me)return;let Se=()=>{re(ee=>bt(ee));},B=window.requestAnimationFrame(Se),U=window.setTimeout(Se,430);return ()=>{window.cancelAnimationFrame(B),window.clearTimeout(U);}},[bt,me,yt,_t]),e(Sn,{mode:Et,children:e(Ta,{locale:te,children:l("div",{className:"orb-root",style:{minHeight:"100vh",width:"100%",display:"flex",flexDirection:"column",overflowX:"hidden",background:"var(--orb-canvas)"},children:[e(wi,{appTitle:r,logo:x,mode:Et,onToggleMode:()=>pt(oh(Et)),locale:te,localeLabel:Lt||te===i?s:void 0,localeOptions:c,onLocaleChange:ct,user:b,onUserRefresh:m,onUserSetting:v,onUserLogout:y,userMenuItems:g,searchPlaceholder:h,showSearch:ke,onSearch:C,onSearchAdd:L,leftSlot:I,rightSlot:A}),S==="floating"&&e("div",{className:"orb-float-search",style:T,children:e(Us,{searchPlaceholder:h,onSearch:C,onSearchAdd:L,maxWidth:"100%"})}),l("div",{style:{flex:1,minHeight:0,minWidth:0,display:"flex",overflowX:"hidden",position:"relative"},children:[a&&!me&&e("div",{style:{paddingTop:12,paddingBottom:12,paddingLeft:12,paddingRight:yt?4:12,display:"flex",alignItems:"flex-start",flexShrink:0},children:e(j,{...Ft,maxHeight:_t,colorMode:Te,displayMode:le,onDisplayModeChange:Ye,showDisplayModeToggle:F&&yt})}),a&&me&&e("div",{ref:Qe,onPointerDown:Ot,onPointerMove:dt,onPointerUp:Bt,onPointerCancel:Bt,style:{position:"absolute",top:et.y,left:Pt,zIndex:1205,display:"flex",alignItems:"flex-start",cursor:yt?Le?"grabbing":"grab":"default",touchAction:yt?"none":"auto",userSelect:Le?"none":void 0,transition:Le?"none":"left 180ms ease-out, top 180ms ease-out"},children:e(j,{...Ft,maxHeight:_t,colorMode:Te,displayMode:le,onDisplayModeChange:Ye,showDisplayModeToggle:F&&yt})}),e("div",{style:{flex:1,minWidth:0,minHeight:0,overflow:"auto",paddingTop:12,paddingBottom:12,paddingRight:12,paddingLeft:a&&!me&&yt?4:12,...N},children:n})]})]})})})};var Pi="(blank)",Dp="Result",Ap="Grand Total",Np={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},Ep=["sum","count","avg","min","max"];var Lp=["palette","rows","columns","filters","values"];var Fp=t=>Lp.includes(t),Op=t=>t==="rows"||t==="columns"||t==="filters",Ii=t=>{let r=t.split("|");return r.length===2&&r[0]==="container"&&Fp(r[1])?{kind:"container",zone:r[1]}:r.length===3&&r[0]==="item"&&Fp(r[1])&&r[2]?{kind:"item",zone:r[1],key:r[2]}:null},no=t=>t==null||t===""?Pi:t instanceof Date?t.toISOString().slice(0,10):String(t),Lo=t=>JSON.stringify(t),Bp=(t,r)=>{let o=t.join(""),n=r.join("");return o.localeCompare(n,void 0,{sensitivity:"base"})},ah=t=>{if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"&&t.trim()!==""){let r=Number(t);return Number.isFinite(r)?r:null}return null},un=(t,r,o)=>{if(o==="count")return t.length;let n=t.map(a=>ah(a[r])).filter(a=>a!==null);return n.length===0?0:o==="sum"?n.reduce((a,i)=>a+i,0):o==="avg"?n.reduce((a,i)=>a+i,0)/n.length:o==="min"?Math.min(...n):Math.max(...n)},ir=(t,r)=>{if(!t||t.length===0)return [];let o=new Set,n=[];return t.forEach(a=>{!r.has(a)||o.has(a)||(o.add(a),n.push(a));}),n},ao=(t,r)=>t.length!==r.length?false:t.every((o,n)=>o===r[n]),zp=(t,r)=>{let o=Object.keys(t),n=Object.keys(r);return o.length!==n.length?false:o.every(a=>{let i=t[a]??[],s=r[a]??[];return ao(i,s)})},Ri=(t,r)=>t.length!==r.length?false:t.every((o,n)=>{let a=r[n];return o.tokenId===a.tokenId&&o.fieldId===a.fieldId&&o.aggregation===a.aggregation}),Ks=t=>!t?.aggregations||t.aggregations.length===0?Ep:t.aggregations,fr=(t,r)=>{let o=Ks(r);return t&&o.includes(t)?t:r?.type==="number"&&o.includes("sum")?"sum":o.includes("count")?"count":o[0]},Qn=(t,r,o)=>{let n=o.get(r.fieldId);return n?.formatValue?n.formatValue(t):r.aggregation==="count"?Math.round(t).toLocaleString():t.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:2})};w();var Hp=({options:t,selectedValues:r,onChange:o,minWidth:n=96})=>{let{t:a}=de(),[i,s]=Qt.useState(""),[c,p]=Qt.useState(null),u=Qt.useMemo(()=>{let m=i.trim().toLowerCase();return m?t.filter(v=>v.toLowerCase().includes(m)):t},[t,i]),d=t.length>0&&r.length===t.length,f=t.length===0?a("pivot.filter.na"):r.length===0?a("common.none"):d?a("common.all"):`${r.length}/${t.length}`,b=m=>{o(r.includes(m)?r.filter(v=>v!==m):[...r,m]);};return l("div",{sx:{minWidth:n},onClick:m=>m.stopPropagation(),onMouseDown:m=>m.stopPropagation(),children:[e(ve,{variant:"outlined",size:"small",onClick:m=>p(m.currentTarget),sx:{minWidth:n,height:26,px:1,py:.35,fontSize:"0.72rem",justifyContent:"space-between"},children:f}),e(Yt,{anchorEl:c,open:!!c,onClose:()=>p(null),PaperProps:{sx:{width:Math.max(n,220),maxHeight:320,overflowY:"auto",p:.5}},children:l("div",{onClick:m=>m.stopPropagation(),sx:{display:"grid",gap:.4},children:[e(Be,{size:"small",placeholder:`${a("common.search")}...`,fullWidth:true,value:i,onChange:m=>s(m.target.value),onKeyDown:m=>m.stopPropagation(),onClick:m=>m.stopPropagation(),sx:{m:0,"& .orb-inp":{fontSize:"0.75rem",py:.7}}}),e("div",{sx:{px:1,py:.5,borderBottom:"1px solid var(--orb-border)"},children:e(ve,{variant:"text",size:"small",onClick:m=>{m.preventDefault(),m.stopPropagation(),o(d?[]:t);},sx:{minWidth:"auto",px:0,py:.2,fontSize:"0.76rem",fontWeight:700,textTransform:"none"},children:a(d?"pivot.filter.deselectAll":"pivot.filter.selectAll")})}),u.length===0&&e("div",{className:"orb-menu-item","aria-disabled":"true",sx:{fontSize:"0.75rem"},children:a("pivot.filter.noResults")}),u.map(m=>{let v=r.includes(m);return l("div",{role:"option","aria-selected":v,tabIndex:0,className:`orb-menu-item ${v?"orb-selected":""}`,onClick:()=>b(m),onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),b(m));},sx:{display:"flex",alignItems:"center",fontSize:"0.75rem",py:.4},children:[e(Dt,{size:"small",checked:v,inputProps:{tabIndex:-1},sx:{p:.5,mr:.5,pointerEvents:"none"}}),e("span",{children:m})]},m)})]})})]})};w();var mn=({size:t=18,subtle:r=false})=>{let o=Math.max(2,Math.round(t/6));return e(we,{"aria-hidden":"true",sx:{display:"grid",gridTemplateColumns:`repeat(2, ${o}px)`,gridAutoRows:`${o}px`,gap:`${Math.max(2,Math.round(o/1.5))}px`,placeItems:"center",width:t,height:t,flexShrink:0,color:r?"var(--orb-muted)":"var(--orb-primary)"},children:Array.from({length:6},(n,a)=>e(we,{sx:{width:o,height:o,borderRadius:999,bgcolor:"currentColor"}},a))})};w();var qs=({label:t,subtitle:r,isDragging:o,dragRef:n,listeners:a,attributes:i,style:s})=>e(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:o?.3:1,cursor:o?"grabbing":"grab"},children:l("div",{sx:{display:"flex",alignItems:"center",gap:.9},children:[e("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:e(mn,{size:13,subtle:true})}),l("div",{sx:{minWidth:0,display:"flex",flexDirection:"column",gap:.15},children:[e(E,{component:"div",sx:{fontSize:"0.84rem",fontWeight:700,lineHeight:1.2,color:"var(--orb-fg-strong)"},children:t}),r&&e(E,{component:"div",sx:{fontSize:"0.73rem",fontWeight:400,color:"var(--orb-fg)",lineHeight:1.2},children:r})]})]})}),Wp=({id:t,label:r,subtitle:o})=>{let{setNodeRef:n,listeners:a,attributes:i,isDragging:s}=core.useDraggable({id:t});return e(qs,{label:r,subtitle:o,isDragging:s,dragRef:n,listeners:a,attributes:i})};w();var gn=({zone:t,title:r,hint:o,icon:n,children:a,itemCount:i,onClear:s})=>{let c=`container|${t}`,{isOver:p,setNodeRef:u}=core.useDroppable({id:c}),{t:d}=de();return l(Ne,{ref:u,sx:f=>({p:1.1,borderRadius:"var(--orb-r-container)",border:"1px dashed",borderColor:p?"var(--orb-primary)":"var(--orb-p200)",bgcolor:p?"var(--orb-p100)":f.palette.mode==="dark"?"var(--orb-surface-2)":"var(--orb-p50)",transition:"border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease",boxShadow:p?"0 0 0 3px var(--orb-focus-ring)":"none",minHeight:120,display:"flex",flexDirection:"column"}),children:[l("div",{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[l("div",{sx:{display:"flex",alignItems:"center",gap:.8},children:[n,e(E,{component:"div",sx:{fontSize:"0.8rem",fontWeight:700,letterSpacing:.1,color:"var(--orb-fg-strong)"},children:r}),l(E,{component:"div",sx:{fontSize:"0.73rem",fontWeight:500,color:"var(--orb-fg)"},children:["(",i,")"]})]}),i>0&&s&&e(it,{title:d("pivot.clearArea"),children:e(ae,{size:"small",onClick:s,sx:{width:24,height:24,p:0},children:e(rd,{size:13})})})]}),e(E,{component:"div",sx:{mt:.5,mb:.9,fontSize:"0.72rem",fontWeight:400,color:"var(--orb-fg)"},children:o}),e("div",{sx:{flex:1},children:a})]})};w();var $p={xs:1.2,md:1.6},fn=({title:t,subtitle:r,collapsed:o,onToggleCollapse:n,expandAriaLabel:a,collapseAriaLabel:i,children:s,bodySx:c,unmountOnExit:p=false,headerActions:u})=>l(Ne,{sx:d=>({borderRadius:"var(--orb-r-container)",border:`1px solid ${d.palette.divider}`,overflow:"hidden",bgcolor:"var(--orb-surface)",boxShadow:"var(--orb-shadow-1)"}),children:[l("div",{sx:d=>({px:$p,py:1.15,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,bgcolor:"var(--orb-canvas)",borderBottom:o?"none":`1px solid ${d.palette.divider}`}),children:[l("div",{sx:{minWidth:0,flex:1},children:[e(E,{component:"div",sx:{fontSize:"0.92rem",fontWeight:700,color:"var(--orb-fg-strong)"},children:t}),e(E,{component:"div",sx:{fontSize:"0.75rem",fontWeight:400,color:"var(--orb-fg)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r})]}),l("div",{sx:{display:"flex",alignItems:"center",gap:.75,flexShrink:0},children:[u,e(ae,{size:"small","aria-label":o?a:i,onClick:n,sx:d=>({border:`1px solid ${d.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:e(Ha,{size:13,sx:{transition:"transform 220ms cubic-bezier(0.2, 0, 0, 1)",transform:o?"rotate(180deg)":"rotate(0deg)"}})})]})]}),e(qo,{in:!o,timeout:260,easing:"cubic-bezier(0.2, 0, 0, 1)",unmountOnExit:p,children:e("div",{sx:[{px:$p,py:{xs:1.2,md:1.6}},...Array.isArray(c)?c:c?[c]:[]],children:s})})]});w();var Mi=({label:t,caption:r,onRemove:o,trailing:n,isDragging:a,dragRef:i,listeners:s,attributes:c,style:p})=>e(Ne,{ref:i,style:p,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:l("div",{sx:{display:"flex",alignItems:"center",gap:.9},children:[e("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:e(mn,{size:13,subtle:true})}),l("div",{sx:{minWidth:0,flex:1,display:"flex",flexDirection:"column",gap:.15},children:[e(E,{component:"div",sx:{fontSize:"0.82rem",fontWeight:700,lineHeight:1.2,color:"var(--orb-fg-strong)"},children:t}),r&&e(E,{component:"div",sx:{fontSize:"0.72rem",fontWeight:400,color:"var(--orb-fg)",lineHeight:1.2},children:r})]}),n,o&&e(ae,{size:"small",onClick:u=>{u.stopPropagation(),o();},sx:{width:24,height:24,p:0},children:e(mo,{size:13})})]})}),jn=({id:t,label:r,caption:o,onRemove:n,trailing:a})=>{let{setNodeRef:i,attributes:s,listeners:c,transform:p,transition:u,isDragging:d}=sortable.useSortable({id:t}),f={transform:p?`translate3d(${p.x}px, ${p.y}px, 0)`:void 0,transition:u,zIndex:d?999:"auto"};return e(Mi,{label:r,caption:o,onRemove:n,trailing:a,isDragging:d,dragRef:i,listeners:c,attributes:s,style:f})};w();var Ni={rows:e(bd,{size:16,sx:{color:"var(--orb-primary)"}}),columns:e(Zo,{size:16,sx:{color:"var(--orb-primary)"}}),filters:e(Qc,{size:16,sx:{color:"var(--orb-primary)"}}),values:e(Yo,{size:16,sx:{color:"var(--orb-accent)"}})},Gp=({isConfiguratorCollapsed:t,onToggleCollapse:r,availableFields:o,fieldMap:n,filterFields:a,columnFields:i,rowFields:s,valueFields:c,clearZone:p,removeFieldFromZone:u,getFilterSelectionSummary:d,renderDimensionFilterSelect:f,renderAggregationSelect:b,getAggregationLabel:m})=>{let{t:v}=de(),y=[`${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 e(fn,{title:v("pivot.config.title"),subtitle:y,collapsed:t,onToggleCollapse:r,expandAriaLabel:v("pivot.collapse.ariaExpand"),collapseAriaLabel:v("pivot.collapse.ariaCollapse"),unmountOnExit:true,children:l("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",lg:"260px 1fr"},gap:2},children:[e(gn,{zone:"palette",title:v("pivot.fieldList"),hint:v("pivot.availableDimensions"),itemCount:o.length,icon:e(mn,{size:18,subtle:true}),children:l(ie,{spacing:.8,sx:{maxHeight:400,overflowY:"auto",pr:.5},children:[o.length===0&&e(E,{component:"div",sx:{fontSize:"0.74rem",fontWeight:400,color:"var(--orb-fg)",py:1},children:v("pivot.allFieldsInUse")}),o.map(g=>e(Wp,{id:`item|palette|${g.id}`,label:g.label,subtitle:g.type??"string"},g.id))]})}),l(ie,{spacing:2,children:[l("div",{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[e(gn,{zone:"filters",title:v("pivot.zone.filters"),hint:v("pivot.hint.filters"),icon:Ni.filters,itemCount:a.length,onClear:()=>p("filters"),children:e(sortable.SortableContext,{items:a.map(g=>`item|filters|${g}`),strategy:sortable.verticalListSortingStrategy,children:e(ie,{spacing:.7,children:a.map(g=>e(jn,{id:`item|filters|${g}`,label:n.get(g)?.label??g,caption:d(g),trailing:f(g),onRemove:()=>u("filters",g)},g))})})}),e(gn,{zone:"columns",title:v("pivot.zone.columns"),hint:v("pivot.hint.columns"),icon:Ni.columns,itemCount:i.length,onClear:()=>p("columns"),children:e(sortable.SortableContext,{items:i.map(g=>`item|columns|${g}`),strategy:sortable.verticalListSortingStrategy,children:e(ie,{spacing:.7,children:i.map(g=>e(jn,{id:`item|columns|${g}`,label:n.get(g)?.label??g,caption:`${n.get(g)?.type??"dimension"} \u2022 ${d(g)}`,trailing:f(g),onRemove:()=>u("columns",g)},g))})})})]}),l("div",{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[e(gn,{zone:"rows",title:v("pivot.zone.rows"),hint:v("pivot.hint.rows"),icon:Ni.rows,itemCount:s.length,onClear:()=>p("rows"),children:e(sortable.SortableContext,{items:s.map(g=>`item|rows|${g}`),strategy:sortable.verticalListSortingStrategy,children:e(ie,{spacing:.7,children:s.map(g=>e(jn,{id:`item|rows|${g}`,label:n.get(g)?.label??g,caption:`${n.get(g)?.type??"dimension"} \u2022 ${d(g)}`,trailing:f(g),onRemove:()=>u("rows",g)},g))})})}),e(gn,{zone:"values",title:v("pivot.zone.values"),hint:v("pivot.hint.values"),icon:Ni.values,itemCount:c.length,onClear:()=>p("values"),children:e(sortable.SortableContext,{items:c.map(g=>`item|values|${g.tokenId}`),strategy:sortable.verticalListSortingStrategy,children:e(ie,{spacing:.7,children:c.map(g=>{let x=n.get(g.fieldId)?.label??g.fieldId,h=`${m(g.aggregation)}(${x})`;return e(jn,{id:`item|values|${g.tokenId}`,label:x,caption:h,trailing:b(g),onRemove:()=>u("values",g.tokenId)},g.tokenId)})})})})]})]})]})})};w();var _p=t=>t.toLocaleString(void 0,{maximumFractionDigits:1}),Up=({data:t,primaryLabel:r,secondaryLabel:o,formatPrimaryValue:n,formatSecondaryValue:a})=>{let i=ar();if(t.length===0)return null;let s=720,c=250,p={top:20,right:24,bottom:40,left:52},u=o?t.map(g=>g.primaryValue):t.map((g,x)=>x+1),d=o?t.map(g=>g.secondaryValue??0):t.map(g=>g.primaryValue),f=Math.max(...u,1),b=Math.max(...d,1),m=s-p.left-p.right,v=c-p.top-p.bottom,y=t.map((g,x)=>{let h=o?g.primaryValue:x+1,S=o?g.secondaryValue??0:g.primaryValue,T=p.left+h/f*m,C=c-p.bottom-S/b*v;return {...g,x:T,y:C,rawX:h,rawY:S}});return l("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[e("div",{sx:{overflowX:"auto"},children:l("div",{component:"svg",viewBox:`0 0 ${s} ${c}`,sx:{width:"100%",minWidth:s,height:c},children:[e("line",{x1:p.left,y1:c-p.bottom,x2:s-p.right,y2:c-p.bottom,stroke:Dr(i.palette.text.secondary,.35)}),e("line",{x1:p.left,y1:p.top,x2:p.left,y2:c-p.bottom,stroke:Dr(i.palette.text.secondary,.35)}),y.map(g=>l("g",{children:[e("circle",{cx:g.x,cy:g.y,r:7,fill:Dr(i.palette.primary.main,.18)}),e("circle",{cx:g.x,cy:g.y,r:4.5,fill:i.palette.primary.main,children:l("title",{children:[g.name,`
189
+ `),b={enableMath:n},m=0;for(;m<f.length;){let v=f[m],y=v.trim();if(!y){m+=1;continue}if(i&&ou(v)){if(y.startsWith("<think>")){let h=[],C=v;for(;;){let P=C.indexOf("<think>"),w=P>=0?C.slice(P+7):C,k=w.indexOf("</think>");if(k>=0){h.push(w.slice(0,k)),m+=1;break}if(h.push(w),m+=1,m>=f.length)break;C=f[m];}u.push(e(Li,{content:h.join(`
190
+ `).trim()},`think-tag-${m}`));continue}m+=1;let x=[];for(;m<f.length&&f[m].trim()!==":::";)x.push(f[m]),m+=1;m<f.length&&f[m].trim()===":::"&&(m+=1),u.push(e(Li,{content:x.join(`
191
+ `).trim()},`think-fence-${m}`));continue}if(Oi(v)){let x=y.slice(3).trim().toLowerCase(),h=[];for(m+=1;m<f.length&&!Oi(f[m]);)h.push(f[m]),m+=1;m<f.length&&Oi(f[m])&&(m+=1);let C=h.join(`
192
+ `);if(a&&x==="mermaid"){u.push(e(sl,{code:C},`mermaid-${m}`));continue}if(n&&["math","latex","katex"].includes(x)){u.push(e(sa,{expression:C,allowKatex:true},`math-fence-${m}`));continue}u.push(e(ia,{code:C,language:x||"text",copyable:s,showLineNumbers:l,wrapLongLines:true},`code-${m}`));continue}if(n&&y.startsWith("$$")){let x=[];if(y.endsWith("$$")&&y!=="$$")x.push(y.slice(2,-2)),m+=1;else {let C=v.slice(v.indexOf("$$")+2);for(C.trim()&&x.push(C),m+=1;m<f.length;){let P=f[m],w=P.indexOf("$$");if(w>=0){x.push(P.slice(0,w)),m+=1;break}x.push(P),m+=1;}}u.push(e(sa,{expression:x.join(`
193
+ `).trim(),allowKatex:true},`math-${m}`));continue}if(eu(v)){let x=Math.min(6,v.match(/^#{1,6}/)?.[0]?.length||1),h=v.replace(/^#{1,6}\s+/,""),C=x===1?"h5":x===2?"h6":"subtitle1";u.push(e(br,{variant:C,sx:{mt:x===1?1.2:.8,mb:.5,fontWeight:700},children:la(h,b,`h-${m}`)},`heading-${m}`)),m+=1;continue}if(tu(v)){u.push(e(gd,{sx:{my:1.2}},`hr-${m}`)),m+=1;continue}if(ru(f,m)){let x=m+2;for(;x<f.length&&f[x].trim()&&f[x].includes("|");)x+=1;let h=f.slice(m,x).join(`
194
+ `),C=Ei(h);if(C){u.push(e(cl,{table:C},`table-${m}`)),m=x;continue}}if(ml(v)){let x=[];for(;m<f.length&&ml(f[m]);)x.push(f[m].replace(/^\s*>\s?/,"")),m+=1;u.push(e(Fo,{variant:"outlined",sx:{px:1,py:.8,my:.9,borderLeftWidth:3,borderLeftStyle:"solid",borderLeftColor:"primary.main",bgcolor:"action.hover"},children:e(br,{variant:"body2",sx:{whiteSpace:"pre-wrap"},children:x.map((h,C)=>c(Jt.Fragment,{children:[C>0&&e("br",{}),la(h,b,`q-${m}-${C}`)]},`quote-line-${C}`))})},`quote-${m}`));continue}if(pl(v)){let x=[];for(;m<f.length&&pl(f[m]);)x.push(f[m].trim().replace(/^[-*+]\s+/,"")),m+=1;u.push(e(ke,{component:"ul",sx:{my:.8,pl:2.5},children:x.map((h,C)=>e(ke,{component:"li",sx:{mb:.45},children:e(br,{variant:"body2",children:la(h,b,`ul-${m}-${C}`)})},`ul-item-${C}`))},`ul-${m}`));continue}if(ul(v)){let x=[];for(;m<f.length&&ul(f[m]);)x.push(f[m].trim().replace(/^\d+\.\s+/,"")),m+=1;u.push(e(ke,{component:"ol",sx:{my:.8,pl:2.7},children:x.map((h,C)=>e(ke,{component:"li",sx:{mb:.45},children:e(br,{variant:"body2",children:la(h,b,`ol-${m}-${C}`)})},`ol-item-${C}`))},`ol-${m}`));continue}let g=[];for(;m<f.length;){let x=f[m],h=x.trim();if(!h||Oi(x)||eu(x)||tu(x)||pl(x)||ul(x)||ml(x)||ru(f,m)||i&&ou(x)||n&&h.startsWith("$$"))break;g.push(x),m+=1;}g.length>0?u.push(e(br,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:g.map((x,h)=>c(Jt.Fragment,{children:[h>0&&e("br",{}),la(x,b,`p-${m}-${h}`)]},`p-line-${h}`))},`p-${m}`)):m+=1;}return u},[d,n,a,i,s,l]);return e(ke,{className:o,sx:{"& strong":{fontWeight:700},"& em":{fontStyle:"italic"},"& a":{wordBreak:"break-all"}},children:p})};T();var CN=(t,r)=>e(ca,{markdown:t,...r});T();var nu=({value:t,onChange:r,onSubmit:o,onVoiceInput:n,onClear:a,placeholder:i,statusText:s,loading:l=false,compact:d=false,showStatusText:p=true})=>c(ie,{spacing:.75,children:[c("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:[e(Ho,{sx:{fontSize:d?16:18,color:"text.secondary"}}),e(xd,{fullWidth:true,value:t,onChange:u=>r(u.target.value),onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),o());},placeholder:i,sx:{fontSize:d?"0.84rem":"0.9rem"}}),t&&a&&e(ae,{size:"small",onClick:a,children:e(So,{sx:{fontSize:d?16:18}})}),n&&e(ae,{size:"small",onClick:n,children:e(Qd,{sx:{fontSize:d?16:18}})}),e(ae,{size:"small",onClick:o,disabled:l||!t.trim(),children:e(op,{sx:{fontSize:d?16:18}})})]}),p&&s&&e(L,{variant:"caption",color:"text.secondary",children:s})]});T();var au=(t,r)=>{let o=r.trim();if(!o)return t;let n=t.toLowerCase(),a=o.toLowerCase(),i=n.indexOf(a);return i<0?t:c(jsxRuntime.Fragment,{children:[t.slice(0,i),e("div",{component:"mark",sx:{bgcolor:"warning.light",color:"warning.contrastText",px:.15,borderRadius:.4},children:t.slice(i,i+o.length)}),t.slice(i+o.length)]})},Fi=({section:t,highlightQuery:r=""})=>{let o=t.columns||2;return c(Ee,{variant:"outlined",sx:{p:1.8,borderRadius:2},children:[e(L,{variant:"subtitle1",sx:{fontWeight:700,mb:1.4},children:t.title}),e("div",{sx:{display:"grid",gap:1.15,gridTemplateColumns:{xs:"1fr",md:o===3?"repeat(3, minmax(0, 1fr))":o===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 c("div",{sx:{minWidth:0},children:[e(L,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:au(n.label,r)}),e(L,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:a?au(a,r):n.value})]},n.id)})})]})};var gl=t=>t==null?"":typeof t=="string"||typeof t=="number"||typeof t=="boolean"?String(t):"",Hi=t=>t.trim().toLowerCase(),Kh=(t,r)=>{let o=[];return t.forEach(n=>{n.fields.forEach(a=>{let i=a.searchableText||gl(a.value),s={source:"section",sourceId:n.id,sourceSectionId:n.id,sourceTitle:n.title,fieldId:a.id,fieldLabel:a.label,fieldValue:i};o.push({hit:s,text:Hi(`${n.title} ${a.label} ${i}`)});});}),r.forEach(n=>{(n.fields||[]).forEach(a=>{let i=a.searchableText||gl(a.value),s={source:"tab",sourceId:n.id,sourceTitle:n.label,fieldId:a.id,fieldLabel:a.label,fieldValue:i};o.push({hit:s,text:Hi(`${n.label} ${a.label} ${i}`)});}),(n.sections||[]).forEach(a=>{a.fields.forEach(i=>{let s=i.searchableText||gl(i.value),l={source:"tab",sourceId:n.id,sourceSectionId:a.id,sourceTitle:`${n.label} / ${a.title}`,fieldId:i.id,fieldLabel:i.label,fieldValue:s};o.push({hit:l,text:Hi(`${n.label} ${a.title} ${i.label} ${s}`)});});});}),o},iu=({sections:t,tabs:r=[],defaultTabId:o,ai:n})=>{let{t:a}=pe(),[i,s]=Jt.useState(""),[l,d]=Jt.useState(o||r[0]?.id),[p,u]=Jt.useState("idle"),[f,b]=Jt.useState([]),[m,v]=Jt.useState(""),[y,g]=Jt.useState(""),[x,h]=Jt.useState(false),C=Jt.useMemo(()=>Kh(t,r),[t,r]);Jt.useEffect(()=>{if(r.length===0){d(void 0);return}r.some(E=>E.id===l)||d(o||r[0]?.id);},[r,l,o]);let P=Jt.useCallback(()=>{u("idle"),b([]),v(""),g("");},[]),w=Jt.useCallback(S=>{s(S),S.trim()||(u("idle"),b([]),v(""),g(""));},[]),k=Jt.useCallback(S=>{let E=Hi(S);return E?C.filter(D=>D.text.includes(E)).map(D=>D.hit):[]},[C]),R=Jt.useCallback(async()=>{let S=i.trim();if(!S)return;h(true);let E=k(S);if(b(E),E.length>0){u("search"),g(""),v(a("detail.searchAi.matches",{count:E.length})),h(false);return}if(n?.enabled!==false&&n?.onSubmit){u("ai"),v(a("detail.searchAi.autoAiFallback"));try{let I=await n.onSubmit(S,{query:S,hits:E,activeTabId:l,sections:t,tabs:r});g(typeof I=="string"?I:"");}finally{h(false);}return}u("search"),g(""),v(a("detail.searchAi.noMatch")),h(false);},[i,k,a,n,l,t,r]);return {query:i,setQuery:w,activeTabId:l,setActiveTabId:d,searchMode:p,hits:f,statusText:m,aiResponse:y,searching:x,handleSubmit:R,clearResult:P}};T();var XN=({title:t,subtitle:r,sections:o,tabs:n=[],defaultTabId:a,table:i,ai:s,rightHeaderSlot:l,searchBarWidth:d=460,onClose:p,closeLabel:u="Close"})=>{let{t:f}=pe(),{query:b,setQuery:m,activeTabId:v,setActiveTabId:y,searchMode:g,hits:x,statusText:h,aiResponse:C,searching:P,handleSubmit:w,clearResult:k}=iu({sections:o,tabs:n,defaultTabId:a,ai:s}),R=Jt.useMemo(()=>n.find(D=>D.id===v)||n[0],[n,v]),S=Jt.useCallback(D=>{let I=A=>{let N=document.getElementById(D);if(N){N.scrollIntoView({behavior:"smooth",block:"center"});return}A<4&&setTimeout(()=>I(A+1),60);};requestAnimationFrame(()=>I(0));},[]),E=Jt.useCallback((D,I)=>{if(n.some(A=>A.id===D)){y(D),S(I?`detail-tab-${D}-section-${I}`:`detail-tab-${D}`);return}S(`detail-section-${D}`);},[n,y,S]);return c("div",{sx:{display:"flex",flexDirection:"column",gap:1.5,minHeight:"100%"},children:[c(ie,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",md:"center"},spacing:1,children:[c("div",{sx:{minWidth:0},children:[e(L,{variant:"h5",sx:{fontWeight:800,color:"text.primary"},children:t}),r&&e(L,{variant:"body2",color:"text.secondary",sx:{mt:.35},children:r})]}),c(ie,{direction:"row",spacing:.6,alignItems:"center",sx:{width:{xs:"100%",md:"auto"},ml:{xs:0,md:"auto"}},children:[e("div",{sx:{width:{xs:"100%",md:d},maxWidth:"100%",minWidth:{md:320}},children:e(nu,{value:b,onChange:m,onSubmit:w,onVoiceInput:s?.onVoiceInput,onClear:()=>{m(""),k();},placeholder:s?.placeholder||f("detail.searchAi.placeholder"),statusText:h,loading:P,compact:true,showStatusText:false})}),p&&e(lt,{title:u,children:e(ae,{size:"small",onClick:p,children:e(Vd,{fontSize:"small"})})}),l]})]}),h&&e(L,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:h}),g==="search"&&x.length>0&&c(Ee,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[e(L,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.6},children:f("detail.searchAi.matches",{count:x.length})}),e(ie,{spacing:.35,children:x.slice(0,8).map(D=>e("div",{component:"button",type:"button",onClick:()=>E(D.sourceId,D.sourceSectionId),sx:{textAlign:"left",border:0,bgcolor:"transparent",p:.2,cursor:"pointer",color:"text.primary",borderRadius:1,"&:hover":{bgcolor:"action.hover"}},children:c(L,{variant:"body2",sx:{fontSize:"0.84rem"},children:[e("div",{component:"span",sx:{color:"text.secondary"},children:D.sourceTitle})," \xB7 ",e("div",{component:"span",sx:{fontWeight:700},children:D.fieldLabel})," = ",e("div",{component:"span",children:D.fieldValue||"-"})]})},`${D.source}|${D.sourceId}|${D.fieldId}`))})]}),g==="ai"&&C&&c(Ee,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[e(L,{variant:"subtitle2",sx:{fontWeight:700,mb:.7},children:f("detail.searchAi.aiResultTitle")}),e("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:e(ca,{markdown:C})})]}),e("div",{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:o.map(D=>e("div",{id:`detail-section-${D.id}`,children:e(Fi,{section:D,highlightQuery:b})},D.id))}),n.length>0&&c(Ee,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[e(Td,{value:R?.id||false,onChange:(D,I)=>y(String(I)),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:n.map(D=>e(Id,{value:D.id,label:D.label,sx:{textTransform:"none"}},D.id))}),c("div",{sx:{p:1.5},children:[e("div",{id:`detail-tab-${R?.id||""}`}),R?.description&&e(L,{variant:"body2",color:"text.secondary",sx:{mb:1.2},children:R.description}),R?.content?R.content:c(ie,{spacing:1.5,children:[(R?.sections||[]).map(D=>e("div",{id:`detail-tab-${R?.id}-section-${D.id}`,children:e(Fi,{section:D,highlightQuery:b})},D.id)),R?.fields&&R.fields.length>0&&e(Fi,{section:{id:`${R.id}-fields`,title:R.label,fields:R.fields,columns:2},highlightQuery:b})]})]})]}),i&&e(Jr,{title:i.title||f("detail.table.title"),...i.tableProps,filterConfig:void 0,fitContainer:false})]})};T();var cu=({bucket:t,cardCount:r,highlighted:o=false,children:n,emptyLabel:a,height:i,maxHeight:s,onRename:l,renameLabel:d,sx:p})=>{let{t:u}=pe(),[f,b]=Jt.useState(false),[m,v]=Jt.useState(t.title),y=()=>{v(t.title),b(false);},g=x=>{x.preventDefault();let h=m.trim();h&&(h!==t.title&&l?.(h),v(h),b(false));};return e(Ee,{elevation:0,sx:[x=>{let h=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:o?`1px solid ${rt(h,.65)}`:"1px solid var(--orb-border)",bgcolor:"var(--orb-canvas)",boxShadow:o?`0 0 0 2px ${rt(h,.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:h}}},...Array.isArray(p)?p:p?[p]:[]],children:c(ie,{spacing:1.25,sx:{flex:1,minHeight:0,overflow:"hidden",p:1.5},children:[c(ke,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1.25},children:[e(ke,{sx:{minWidth:0,flex:1},children:c(ke,{sx:{display:"flex",alignItems:"center",gap:.75,minHeight:28},children:[t.icon&&e(ke,{sx:{display:"inline-flex",flexShrink:0,color:t.accentColor??"var(--orb-primary)"},children:t.icon}),f?c(ke,{component:"form",onSubmit:g,sx:{display:"flex",alignItems:"center",gap:.5,flex:1,minWidth:0},children:[e(ze,{dense:true,autoFocus:true,value:m,onChange:x=>v(x.target.value),onKeyDown:x=>{x.key==="Escape"&&(x.preventDefault(),y());},inputProps:{"aria-label":d??u("kanban.bucket.rename")},error:!m.trim(),sx:{flex:1,minWidth:0}}),e(ae,{type:"submit",size:"small",tooltip:u("kanban.bucket.saveRename"),"aria-label":u("kanban.bucket.saveRename"),disabled:!m.trim(),children:e(qr,{size:14})}),e(ae,{size:"small",tooltip:u("kanban.bucket.cancelRename"),"aria-label":u("kanban.bucket.cancelRename"),onClick:y,children:e(Zt,{size:14})})]}):e(L,{component:"div",sx:{fontSize:15,fontWeight:600,lineHeight:1.35,color:"text.primary"},children:t.title})]})}),!f&&c(ie,{direction:"row",spacing:.75,sx:{flexShrink:0},children:[e(Pt,{size:"small",label:r,sx:{minWidth:24,justifyContent:"center",fontWeight:600}}),typeof t.limit=="number"&&e(Pt,{size:"small",label:`${u("kanban.bucket.limit")} ${t.limit}`,color:r>t.limit?"warning":"default",variant:"outlined"}),l&&e(ae,{size:"small",tooltip:d??u("kanban.bucket.rename"),"aria-label":d??u("kanban.bucket.rename"),onClick:()=>{v(t.title),b(true);},sx:{width:26,height:26},children:e(Tc,{size:14})})]})]}),o&&e(L,{component:"div",sx:{fontSize:12,color:t.accentColor??"var(--orb-primary)",fontWeight:500},children:u("kanban.bucket.dropHere")}),e(ke,{sx:{flex:1,height:0,minHeight:0,overflowY:"auto",overscrollBehavior:"contain",pr:.4,scrollbarGutter:"stable"},children:r>0?n:e(ke,{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:e(L,{sx:{fontSize:13,color:"text.secondary"},children:a??t.emptyLabel??u("kanban.empty")})})})]})})};T();var Xh={success:"success",warning:"warning",info:"info",error:"error"},Yh={critical:"error",high:"warning",medium:"info",low:"success"},Zh={default:"var(--orb-primary)",success:"var(--orb-primary)",warning:"var(--orb-accent)",info:"var(--orb-primary)",error:"var(--orb-err)"},jh=(t,r)=>{switch(t){case "critical":return r("kanban.priority.critical");case "high":return r("kanban.priority.high");case "medium":return r("kanban.priority.medium");case "low":return r("kanban.priority.low");default:return t}},Qh=t=>t?t.split(/\s+/).map(r=>r.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",fl=({card:t,bucket:r,dragging:o=false,overlay:n=false,onClick:a,sx:i})=>{let{t:s}=pe(),l=!!(a&&r),d=t.tone??(t.priority?Yh[t.priority]:"default"),p=d==="default"?"primary":Xh[d],u=Zh[d],f=r?{card:t,bucket:r}:void 0;return e(Ee,{onClick:l?()=>f&&a?.(f):void 0,onKeyDown:l?b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),f&&a?.(f));}: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 ${rt(u,.24)}`,bgcolor:"var(--orb-canvas)",boxShadow:n?"var(--orb-shadow-3)":o?"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:o?.5:1,"&::before":{content:'""',position:"absolute",inset:"0 auto 0 0",width:3,bgcolor:u},"&:hover":l?{transform:"translateY(-1px)",borderColor:rt(u,.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:c(ie,{spacing:1.25,children:[c(ke,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[c(ke,{sx:{minWidth:0,flex:1},children:[(t.kicker||r?.title)&&e(L,{component:"div",sx:{fontSize:11,fontWeight:500,color:"text.secondary",textTransform:"uppercase"},children:t.kicker??r?.title}),e(L,{component:"div",sx:{mt:.25,fontSize:14,fontWeight:600,lineHeight:1.4,color:"text.primary"},children:t.title})]}),t.priority&&e(Pt,{size:"small",color:p,label:jh(t.priority,s),variant:d==="default"?"outlined":"filled",sx:{height:22,flexShrink:0,fontWeight:500}})]}),t.summary&&e(L,{component:"div",sx:{fontSize:13,fontWeight:300,color:"text.secondary",lineHeight:1.5},children:t.summary}),t.metrics&&t.metrics.length>0&&e(ke,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.min(t.metrics.length,3)}, minmax(0, 1fr))`,gap:.75},children:t.metrics.slice(0,3).map(b=>c(ke,{sx:{minWidth:0,borderRadius:"var(--orb-r)",px:1,py:.75,bgcolor:"var(--orb-surface)",border:"1px solid var(--orb-border)"},children:[e(L,{component:"div",noWrap:true,sx:{fontSize:11,fontWeight:500,color:"text.secondary",textTransform:"uppercase"},children:b.label}),e(L,{component:"div",noWrap:true,numeric:true,sx:{mt:.25,fontSize:13,fontWeight:600},children:b.value})]},b.id))}),typeof t.progress=="number"&&c(ke,{children:[c(ke,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:.5},children:[e(L,{sx:{fontSize:12,color:"text.secondary"},children:s("kanban.card.progress")}),c(L,{numeric:true,sx:{fontSize:12,fontWeight:600},children:[Math.round(t.progress),"%"]})]}),e(bd,{variant:"determinate",value:Math.max(0,Math.min(100,t.progress)),color:u,sx:{height:4,borderRadius:2}})]}),(t.tags?.length||t.assignee||t.dueDate||t.footer||l)&&c(ie,{spacing:.9,children:[t.tags&&t.tags.length>0&&e(ke,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:t.tags.map(b=>e(Pt,{size:"small",label:b.label,color:b.color??"default",variant:"outlined"},b.id))}),c(ke,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,flexWrap:"wrap"},children:[c(ke,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0},children:[t.assignee&&c(jsxRuntime.Fragment,{children:[e(ja,{src:t.assignee.avatarSrc,sx:{width:28,height:28,fontSize:11},children:t.assignee.initials??Qh(t.assignee.name)}),c(ke,{sx:{minWidth:0},children:[e(L,{component:"div",sx:{fontSize:13,fontWeight:500,lineHeight:1.3},noWrap:true,children:t.assignee.name}),t.dueDate&&e(L,{component:"div",sx:{fontSize:11,color:"text.secondary",lineHeight:1.35},noWrap:true,children:t.dueDate})]})]}),!t.assignee&&t.dueDate&&e(L,{sx:{fontSize:12,color:"text.secondary"},children:t.dueDate})]}),l&&e(L,{sx:{fontSize:12,color:"var(--orb-link)",fontWeight:500,whiteSpace:"nowrap"},children:s("kanban.card.openDetail")})]}),t.footer]})]})})};var du=(t,r)=>{let o=r.title.trim();return !r.id||!o||t.buckets.some(n=>n.id===r.id)?t:{buckets:[...t.buckets,{...r,title:o,cards:[]}]}},pu=(t,r,o)=>{let n=o.trim();if(!n)return t;let a=t.buckets.find(i=>i.id===r);return !a||a.title===n?t:{buckets:t.buckets.map(i=>i.id===r?{...i,title:n}:i)}},Jh=(t,r)=>Number.isNaN(t)||t<0?0:t>r?r:t,uu=({buckets:t,cards:r})=>{let o=new Map;return r.forEach((n,a)=>{let i=o.get(n.bucketId)??[];i.push({card:n,sourceIndex:a}),o.set(n.bucketId,i);}),{buckets:t.map(n=>{let a=[...o.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}})}},Gr=(t,r)=>{for(let o=0;o<t.buckets.length;o+=1){let n=t.buckets[o],a=n.cards.findIndex(i=>i.id===r);if(a>=0)return {card:n.cards[a],bucket:n,bucketIndex:o,cardIndex:a}}},zi=(t,r)=>{let o=Gr(t,r.cardId);if(!o)return t;let n=t.buckets.findIndex(p=>p.id===r.toBucketId);if(n<0)return t;let a=t.buckets.map(p=>({...p,cards:p.cards.map(u=>({...u}))})),i=a[o.bucketIndex],[s]=i.cards.splice(o.cardIndex,1);if(!s)return t;let l=a[n],d=Jh(r.targetIndex??l.cards.length,l.cards.length);return l.cards.splice(d,0,{...s,bucketId:r.toBucketId}),{buckets:a.map(p=>({...p,cards:p.cards.map((u,f)=>({...u,bucketId:p.id,position:f}))}))}};T();var vl="kanban-card|",yl="kanban-bucket|",fu=t=>`${vl}${t}`,dv=t=>`${yl}${t}`,Vi=t=>t?.startsWith(vl)?t.slice(vl.length):void 0,gu=t=>t?.startsWith(yl)?t.slice(yl.length):void 0,pv=({card:t,bucket:r,onCardClick:o})=>{let{setNodeRef:n,attributes:a,listeners:i,transform:s,transition:l,isDragging:d}=sortable.useSortable({id:fu(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 e("div",{ref:n,style:p,...a,...i,children:e(fl,{card:t,bucket:r,dragging:d,onClick:o})})},uv=({bucket:t,highlighted:r,bucketHeight:o,emptyBucketLabel:n,onBucketRename:a,onCardClick:i})=>{let{isOver:s,setNodeRef:l}=core.useDroppable({id:dv(t.id)});return e(ke,{ref:l,sx:{minWidth:0,minHeight:0,height:o},children:e(cu,{bucket:t,cardCount:t.cards.length,highlighted:r||s,emptyLabel:n,height:o,onRename:a,children:e(sortable.SortableContext,{items:t.cards.map(d=>fu(d.id)),strategy:sortable.verticalListSortingStrategy,children:e(ie,{spacing:1,children:t.cards.map(d=>e(pv,{card:d,bucket:t,onCardClick:i},d.id))})})})})},bu=t=>String(t??"").toLocaleLowerCase(),mv=(t,r)=>[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=>bu(n).includes(r)),SA=({model:t,onCardMove:r,onCardClick:o,cardFilter:n,onBucketAdd:a,onBucketRename:i,addBucketLabel:s,minBucketWidth:l=320,bucketHeight:d,bucketMaxHeight:p,searchable:u=false,searchValue:f,defaultSearchValue:b="",onSearchValueChange:m,searchPlaceholder:v,emptyBucketLabel:y,sx:g})=>{let{t:x}=pe(),[h,C]=Jt.useState(null),[P,w]=Jt.useState(),[k,R]=Jt.useState(b),S=f??k,E=S.trim().toLocaleLowerCase(),D=d??p??560,I=Jt.useMemo(()=>({buckets:t.buckets.map(V=>{let B=n?V.cards.filter(Q=>n(Q,V)):V.cards;if(!E)return {...V,cards:B};let Z=[V.id,V.title,V.description].some(Q=>bu(Q).includes(E));return {...V,cards:Z?B:B.filter(Q=>mv(Q,E))}})}),[n,t,E]),A=Jt.useMemo(()=>I.buckets.reduce((V,B)=>V+B.cards.length,0),[I]),N=Jt.useCallback(V=>{f===void 0&&R(V),m?.(V);},[m,f]),O=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:6}}),core.useSensor(core.TouchSensor,{activationConstraint:{delay:120,tolerance:8}})),F=Jt.useMemo(()=>h?Gr(t,h):void 0,[h,t]),q=Jt.useCallback(()=>{C(null),w(void 0);},[]),z=Jt.useCallback(V=>{if(!V)return;let B=Vi(V);return B?Gr(t,B)?.bucket.id:gu(V)},[t]),X=Jt.useCallback(V=>{C(Vi(String(V.active.id))??null);},[]),$=Jt.useCallback(V=>{w(z(V.over?String(V.over.id):void 0));},[z]),_=Jt.useCallback(V=>{let B=Vi(String(V.active.id)),Z=V.over?String(V.over.id):void 0;if(!B||!Z){q();return}let Q=Gr(t,B);if(!Q){q();return}let ge=Q.bucket.id,se=Q.cardIndex,le=Vi(Z);if(le){let De=Gr(t,le);if(!De){q();return}ge=De.bucket.id,se=De.cardIndex;}else {let De=gu(Z),Pe=t.buckets.find(Ve=>Ve.id===De);if(!De||!Pe){q();return}ge=De,se=Pe.cards.length;}if(Q.bucket.id===ge&&Q.cardIndex===se){q();return}let be=zi(t,{cardId:B,fromBucketId:Q.bucket.id,toBucketId:ge,targetIndex:se}),_e=Gr(be,B);_e&&!(_e.bucket.id===Q.bucket.id&&_e.cardIndex===Q.cardIndex)&&r?.({cardId:B,fromBucketId:Q.bucket.id,toBucketId:_e.bucket.id,targetIndex:_e.cardIndex,card:_e.card,model:be}),q();},[t,r,q]);return c(core.DndContext,{sensors:O,collisionDetection:core.closestCorners,onDragStart:X,onDragOver:$,onDragEnd:_,onDragCancel:q,children:[c(ke,{sx:{display:"flex",flexDirection:"column",minWidth:0,minHeight:0,height:"100%",overflow:"hidden"},children:[(u||a)&&c(ke,{role:u?"search":void 0,sx:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:1.5,mb:1.25,minWidth:0},children:[u&&e(ke,{sx:{width:"100%",maxWidth:360,flex:"1 1 240px"},children:e(ze,{dense:true,value:S,onChange:V=>N(V.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:e(Hr,{size:16,"aria-hidden":"true"}),endAdornment:S?e(ae,{size:"small",tooltip:x("kanban.search.clear"),"aria-label":x("kanban.search.clear"),onClick:()=>N(""),sx:{width:26,height:26},children:e(Zt,{size:15})}):void 0})}),c(ke,{sx:{display:"flex",alignItems:"center",gap:1,ml:"auto"},children:[E&&e(L,{component:"div","aria-live":"polite",sx:{flexShrink:0,fontSize:12,fontWeight:500,color:"text.secondary"},children:A>0?x("kanban.search.results",{count:A}):x("kanban.search.noMatch")}),a&&e(Ce,{size:"small",variant:"secondary",startIcon:e(Oa,{size:15}),onClick:a,children:s??x("kanban.bucket.add")})]})]}),e(ke,{sx:[{display:"grid",gridAutoFlow:"column",gridAutoColumns:`minmax(${l}px, ${Math.max(l,360)}px)`,gap:1.5,gridAutoRows:D==="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)?g:g?[g]:[]],children:I.buckets.map(V=>e(uv,{bucket:V,highlighted:V.id===P,bucketHeight:D,emptyBucketLabel:E?x("kanban.search.noMatch"):y,onBucketRename:i?B=>i(V.id,B):void 0,onCardClick:o},V.id))})]}),e(core.DragOverlay,{children:F?e(ke,{sx:{width:Math.max(l-24,260)},children:e(fl,{card:F.card,bucket:F.bucket,overlay:true})}):null})]})};var bv=({initialModel:t,initialBuckets:r,initialCards:o})=>t||uu({buckets:r??[],cards:o??[]}),IA=t=>{let{onCardMove:r,onCardClick:o}=t,[n,a]=Jt.useState(()=>bv(t)),i=Jt.useCallback(b=>{a(m=>typeof b=="function"?b(m):b);},[]),s=Jt.useCallback(b=>Gr(n,b),[n]),l=Jt.useCallback((b,m,v)=>{let y=Gr(n,b);if(!y)return;let g=zi(n,{cardId:b,fromBucketId:y.bucket.id,toBucketId:m,targetIndex:v}),x=Gr(g,b);if(!x||x.bucket.id===y.bucket.id&&x.cardIndex===y.cardIndex)return;a(g);let h={cardId:b,fromBucketId:y.bucket.id,toBucketId:x.bucket.id,targetIndex:x.cardIndex,card:x.card,model:g};return r?.(h),h},[n,r]),d=Jt.useCallback((b,m)=>{a(v=>({buckets:v.buckets.map(y=>({...y,cards:y.cards.map(g=>g.id!==b?g:typeof m=="function"?m(g):{...g,...m})}))}));},[]),p=Jt.useCallback(b=>{let m=du(n,b);return m===n?false:(a(m),true)},[n]),u=Jt.useCallback((b,m)=>{let v=pu(n,b,m);return v===n?false:(a(v),true)},[n]),f=Jt.useMemo(()=>({model:n,onCardMove:b=>{l(b.cardId,b.toBucketId,b.targetIndex);},onCardClick:o}),[n,l,o]);return {model:n,actions:{replaceModel:i,moveCard:l,updateCard:d,addBucket:p,renameBucket:u,getCard:s},boardProps:f}};function Cn({onTextUpdate:t,onComplete:r,onError:o,wsUrl:n="ws://localhost:8765",silenceThresholdMs:a=2e3,minVolumeRms:i=.015}){let[s,l]=Jt.useState(false),d=Jt.useRef(null),p=Jt.useRef(null),u=Jt.useRef(null),f=Jt.useRef(null),b=Jt.useRef(null),m=Jt.useRef(0),v=Jt.useRef(false),y=Jt.useRef(false),g=Jt.useCallback(()=>{d.current&&(d.current.close(),d.current=null),f.current&&(f.current.disconnect(),f.current=null),b.current&&(b.current.disconnect(),b.current=null),p.current&&(p.current.getTracks().forEach(C=>C.stop()),p.current=null),u.current&&(u.current.close(),u.current=null),y.current=false,l(false);},[]),x=Jt.useCallback(()=>{v.current||(v.current=true,d.current?.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"stop"})),setTimeout(g,500));},[g]),h=Jt.useCallback(async()=>{if(!(s||y.current)){y.current=true,v.current=false,m.current=Date.now();try{let C=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:16e3,echoCancellation:!0,noiseSuppression:!0}});p.current=C;let P=new WebSocket(n);d.current=P,P.onopen=()=>{l(!0),y.current=!1;},P.onmessage=E=>{try{let D=JSON.parse(E.data);if(D.type==="recognition")D.is_final?r(D.text):t?.(D.text);else if(D.type==="error"){let I=D.message||"Voice recognition error";o?.(I),x();}}catch{o?.("Failed to parse voice message");}},P.onerror=()=>{o?.("Voice service connection failed"),g();},P.onclose=()=>{g();};let w=window.AudioContext||window.webkitAudioContext;if(!w)throw new Error("AudioContext is not supported in this browser");let k=new w({sampleRate:16e3});u.current=k;let R=k.createMediaStreamSource(C);b.current=R;let S=k.createScriptProcessor(4096,1,1);f.current=S,S.onaudioprocess=E=>{if(d.current?.readyState!==WebSocket.OPEN)return;let D=E.inputBuffer.getChannelData(0),I=0;for(let O=0;O<D.length;O+=1)I+=D[O]*D[O];if(Math.sqrt(I/D.length)>i)m.current=Date.now();else if(Date.now()-m.current>a&&!v.current){x();return}let N=new Int16Array(D.length);for(let O=0;O<D.length;O+=1){let F=Math.max(-1,Math.min(1,D[O]));N[O]=F<0?F*32768:F*32767;}d.current.send(N.buffer);},R.connect(S),S.connect(k.destination);}catch{o?.("Cannot access microphone"),g();}}},[g,s,i,r,o,t,a,x,n]);return Jt.useEffect(()=>g,[g]),{isRecording:s,startRecording:h,stopRecording:x}}T();var Cv=["en","zh","fr","de","ja","ko"],vu={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},xl=({searchPlaceholder:t,onSearch:r,onSearchAdd:o,maxWidth:n=540,sx:a})=>{let{t:i}=pe(),[s,l]=Jt.useState(""),d=Jt.useCallback((g=s)=>{let x=g.trim();x&&(l(""),r?.(x));},[r,s]),p=g=>{g.preventDefault(),d();},{isRecording:u,startRecording:f,stopRecording:b}=Cn({onTextUpdate:l,onComplete:g=>{l(g),d(g);},onError:g=>{console.error("Header voice input error:",g);}}),m=Jt.useCallback(async()=>{if(u){b();return}await f();},[u,f,b]),v=t||i("header.searchPlaceholder"),y=s.trim().length>0;return e("form",{className:"orb-app-header-search",onSubmit:p,style:{width:"100%",maxWidth:typeof n=="number"?`${n}px`:n,...a},children:c("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:[e("div",{className:"orb-inp-adornment",children:e(ae,{className:"orb-app-header-ai-action",size:"small",onClick:o,tooltip:i("header.searchAddFeature"),children:e(Mt,{name:"add",size:16})})}),e("input",{className:"orb-inp orb-inp-dense orb-app-header-ai-input",value:s,onChange:g=>l(g.target.value),placeholder:v,style:{border:"none",background:"transparent",flex:1,minWidth:0}}),c("div",{className:"orb-inp-adornment orb-inp-adornment-end",children:[e(ae,{className:"orb-app-header-ai-action",size:"small",onClick:()=>{m();},tooltip:i(u?"header.searchStopVoice":"header.searchStartVoice"),sx:{color:u?"var(--orb-err)":void 0},children:e(Mt,{name:"microphone",size:16})}),e(ae,{className:"orb-app-header-ai-action",size:"small",type:"submit",disabled:!y,tooltip:i("header.searchSend"),children:e(Mt,{name:"paperPlane",size:16})})]})]})})},Wi=({appTitle:t,logo:r,onToggleMode:o,locale:n,localeLabel:a,localeOptions:i,onLocaleChange:s,searchPlaceholder:l,showSearch:d=false,onSearch:p,onSearchAdd:u,user:f,onUserRefresh:b,onUserSetting:m,onUserLogout:v,userMenuItems:y,leftSlot:g,rightSlot:x})=>{let{t:h,locale:C}=pe(),P=yr(),w=n||C,k=a||vu[w],R=i||Cv,S=P==="dark"?e(Bc,{size:15}):e(Wc,{size:15}),E=h(P==="dark"?"header.theme.dark":"header.theme.light"),D=[...b?[{key:"refresh",label:h("header.menu.refresh"),icon:e(Fa,{size:15}),onClick:b}]:[],...m?[{key:"settings",label:h("header.menu.setting"),icon:e(Jo,{size:16}),onClick:m}]:[],...v?[{key:"logout",label:h("header.menu.logout"),icon:e(Lc,{size:16}),onClick:v}]:[]],I=y||D,A=R.map(N=>({label:vu[N],onClick:()=>{s?.(N),window.requestAnimationFrame(()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur();});},disabled:N===w}));return c("header",{className:"orb-app-header",children:[c("div",{className:"orb-app-header-brand",children:[g,r===null?null:r||e("div",{className:"orb-app-header-default-logo","aria-label":"ORBCAFE",children:e(Mt,{name:"product",size:20})}),t&&e(L,{variant:"h4",sx:{fontWeight:700},children:t})]}),e("div",{className:"orb-app-header-center",children:d&&e(xl,{searchPlaceholder:l,onSearch:p,onSearchAdd:u})}),c("div",{className:"orb-app-header-actions",children:[c("div",{className:"orb-app-header-utilities",children:[s?e(jt,{triggerLabel:k,trigger:c("button",{type:"button",className:"orb-icon-btn orb-app-header-locale",children:[e(Bn,{size:15}),e("span",{className:"orb-label",children:k})]}),items:A,align:"end"}):c("div",{className:"orb-app-header-locale","aria-label":k,children:[e(Bn,{size:15}),e("span",{className:"orb-label",children:k})]}),e(ae,{className:"orb-app-header-theme",size:"small",onClick:o,tooltip:E,children:S})]}),f&&e("span",{className:"orb-app-header-divider","aria-hidden":"true"}),f&&e(jt,{triggerLabel:f.name,trigger:c("button",{type:"button",className:"orb-app-header-user-trigger",children:[c("span",{className:"orb-app-header-user-copy",children:[e(L,{variant:"body2",className:"orb-app-header-user-name",children:f.name}),f.subtitle&&e(L,{variant:"caption",muted:true,className:"orb-app-header-user-subtitle",title:f.subtitle,children:f.subtitle})]}),e(en,{src:f.avatarSrc,alt:f.name,size:32,children:f.avatarText||f.name.slice(0,1).toUpperCase()})]}),items:I.map(N=>({label:N.label,onClick:N.onClick,disabled:N.disabled,icon:N.icon})),align:"end"}),x]})]})};var yu=({menuData:t=[],initialNavigationCollapsed:r=false,initialNavigationMode:o="fixed",enableNavigationPinning:n,navigationPinStorageKey:a,pinnedNavigationItemIds:i,defaultPinnedNavigationItemIds:s,onPinnedNavigationItemIdsChange:l,pinnedNavigationSectionTitle:d}={})=>{let{navigationIslandProps:p}=cd({initialCollapsed:r,initialDisplayMode:o,content:t,enablePinning:n,pinStorageKey:a,pinnedItemIds:i,defaultPinnedItemIds:s,onPinnedItemIdsChange:l,pinnedSectionTitle:d}),[u,f]=Jt.useState(900);Jt.useEffect(()=>{let m=()=>f(window.innerHeight);return m(),window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[]);let b=Jt.useMemo(()=>Math.max(280,u-100),[u]);return {navigationIslandProps:p,navigationMaxHeight:b}};T();var Lr=12,xu=56,Su=234,Pv="orbcafe:page-layout-locale",wu=["en","zh","fr","de","ja","ko"],Tv=t=>encodeURIComponent(t.trim().toLowerCase()).replace(/%/g,"").replace(/[^a-z0-9._~-]+/g,"-")||"app",$i=(t,r)=>`orbcafe:page-layout:${Tv(t)}:${r}`,Iv=t=>`orbcafe:page-layout:${t.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-")||"app"}:pinned-navigation-items`,Rv=t=>t==="system"?"dark":t==="dark"?"light":"system",Gi=(t,r,o)=>Math.min(Math.max(t,r),Math.max(r,o)),Mv=t=>t instanceof HTMLElement?!!t.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,ZA=({appId:t,appTitle:r,menuData:o=[],children:n,showNavigation:a=true,locale:i="en",localeLabel:s,localeOptions:l,onLocaleChange:d,mode:p,defaultMode:u="system",onModeChange:f,user:b,onUserRefresh:m,onUserSetting:v,onUserLogout:y,userMenuItems:g,logo:x,searchPlaceholder:h,searchPlacement:C="hidden",floatingSearchSx:P,onSearch:w,onSearchAdd:k,rightHeaderSlot:R,leftHeaderSlot:S,contentSx:E,navigationVariant:D="classic",navigationMode:I,defaultNavigationMode:A="fixed",onNavigationModeChange:N,showNavigationModeToggle:O=true,enableNavigationPinning:F=true,navigationPinStorageKey:q,pinnedNavigationItemIds:z,defaultPinnedNavigationItemIds:X,onPinnedNavigationItemIdsChange:$,pinnedNavigationSectionTitle:_})=>{let V=t?$i(t,"mode"):"orbcafe:page-layout-mode",B=t?$i(t,"locale"):Pv,Z=t?$i(t,"navigation-mode"):"orbcafe:page-layout-navigation-mode",[Q,ge]=Jt.useState(u),[se,le]=Jt.useState("light"),[be,_e]=Jt.useState(false),[De,Pe]=Jt.useState(i),[Ve,Te]=Jt.useState(false),[xe,We]=Jt.useState(false),[ot,it]=Jt.useState(A),[Ze,U]=Jt.useState({x:Lr,y:Lr}),[Fe,ye]=Jt.useState("left"),[Le,st]=Jt.useState(false),Je=Jt.useRef(null),vt=Jt.useRef(null),St=p!==void 0,Et=p??Q,Lt=d!==void 0,re=Lt?i:De,nt=l?.join("|")??"",Be=I!==void 0,ce=I??ot,fe=ce==="floating",ee=D==="v2"?Us:od,Ie=C==="header",Re=Et==="system"?be?se:"light":Et;Jt.useEffect(()=>{if(!St)try{let Y=window.localStorage.getItem(V);(Y==="light"||Y==="dark"||Y==="system")&&ge(Y);}catch{}_e(true);let we=window.matchMedia("(prefers-color-scheme: dark)"),W=()=>{le(we.matches?"dark":"light");};return W(),we.addEventListener("change",W),()=>we.removeEventListener("change",W)},[St,V]),Jt.useEffect(()=>{if(!(St||!be))try{window.localStorage.setItem(V,Et);}catch{}},[be,St,Et,V]),Jt.useEffect(()=>{if(Lt){Te(true);return}try{let we=window.localStorage.getItem(B),W=l??wu;we&&wu.includes(we)&&W.includes(we)&&Pe(we);}catch{}finally{Te(true);}},[Lt,nt,B]),Jt.useEffect(()=>{if(!(Lt||!Ve))try{window.localStorage.setItem(B,re);}catch{}},[re,Lt,Ve,B]),Jt.useEffect(()=>{if(Be){We(true);return}try{let we=window.localStorage.getItem(Z);(we==="fixed"||we==="floating")&&it(we);}catch{}finally{We(true);}},[Be]),Jt.useEffect(()=>{if(xe)try{window.localStorage.setItem(Z,ce);}catch{}},[ce,xe]),Jt.useEffect(()=>{Re==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[Re]);let je=Jt.useCallback(we=>{Be||it(we),N?.(we);},[Be,N]),mt=Jt.useCallback(we=>{St||ge(we),f?.(we);},[St,f]),pt=Jt.useCallback(we=>{Lt||Pe(we),d?.(we);},[Lt,d]),{navigationIslandProps:Ot,navigationMaxHeight:Kt}=yu({menuData:o,initialNavigationCollapsed:false,initialNavigationMode:ce,enableNavigationPinning:F,navigationPinStorageKey:q??(t?$i(t,"pinned-navigation-items"):Iv(r)),pinnedNavigationItemIds:z,defaultPinnedNavigationItemIds:X,onPinnedNavigationItemIdsChange:$,pinnedNavigationSectionTitle:_}),yt=Ot.collapsed,bt=Jt.useCallback(we=>{let W=Je.current,Y=W?.parentElement;if(!W||!Y)return we;let te=Y.getBoundingClientRect(),Ne=W.getBoundingClientRect(),he=Lr,Ae=Lr,Ke=Math.max(he,te.width-Ne.width-Lr),et=Math.max(Ae,te.height-Ne.height-Lr);return {x:Gi(we.x,he,Ke),y:Gi(we.y,Ae,et)}},[]),xr=Jt.useCallback(we=>{let W=Je.current,Y=W?.parentElement;if(!W||!Y)return we;let te=Y.getBoundingClientRect(),Ne=W.getBoundingClientRect(),he=Lr,Ae=Lr,Ke=Math.max(he,te.width-Ne.width-Lr),et=Math.max(Ae,te.height-Ne.height-Lr),qe={x:Gi(we.x,he,Ke),y:Gi(we.y,Ae,et)},Nt=[{distance:Math.abs(qe.x-he),position:{x:he,y:qe.y}},{distance:Math.abs(qe.x-Ke),position:{x:Ke,y:qe.y}},{distance:Math.abs(qe.y-Ae),position:{x:qe.x,y:Ae}},{distance:Math.abs(qe.y-et),position:{x:qe.x,y:et}}].reduce((wt,xt)=>xt.distance<wt.distance?xt:wt).position;return ye(Nt.x>=(he+Ke)/2?"right":"left"),Nt},[]),Tt=Jt.useMemo(()=>{if(!fe||Le)return Ze.x;if(Fe==="right"){let Y=Je.current?.parentElement?.getBoundingClientRect().width,te=yt?xu:Su;return Y?Math.max(Lr,Y-te-Lr):yt?Ze.x:Ze.x-(Su-xu)}return Ze.x},[Fe,Ze.x,Le,fe,yt]),Ft=Jt.useCallback(we=>{if(!fe||!yt||Mv(we.target))return;we.preventDefault(),we.currentTarget.setPointerCapture(we.pointerId);let W=bt({x:Tt,y:Ze.y});ye("left"),U(W),vt.current={pointerId:we.pointerId,startClientX:we.clientX,startClientY:we.clientY,startX:W.x,startY:W.y,currentX:W.x,currentY:W.y},st(true);},[bt,Tt,Ze.y,fe,yt]),ut=Jt.useCallback(we=>{let W=vt.current;if(!W||W.pointerId!==we.pointerId)return;let Y=bt({x:W.startX+we.clientX-W.startClientX,y:W.startY+we.clientY-W.startClientY});W.currentX=Y.x,W.currentY=Y.y,U(Y);},[bt]),Bt=Jt.useCallback(we=>{let W=vt.current;if(!(!W||W.pointerId!==we.pointerId)){try{we.currentTarget.releasePointerCapture(we.pointerId);}catch{}vt.current=null,U(xr({x:W.currentX,y:W.currentY})),st(false);}},[xr]);return Jt.useEffect(()=>{if(!fe)return;let we=()=>{U(te=>bt(te));},W=window.requestAnimationFrame(we),Y=window.setTimeout(we,430);return ()=>{window.cancelAnimationFrame(W),window.clearTimeout(Y);}},[bt,fe,yt,Kt]),e(Ln,{mode:Et,children:e(Ga,{locale:re,children:c("div",{className:"orb-root",style:{minHeight:"100vh",width:"100%",display:"flex",flexDirection:"column",overflowX:"hidden",background:"var(--orb-canvas)"},children:[e(Wi,{appTitle:r,logo:x,mode:Et,onToggleMode:()=>mt(Rv(Et)),locale:re,localeLabel:Lt||re===i?s:void 0,localeOptions:l,onLocaleChange:pt,user:b,onUserRefresh:m,onUserSetting:v,onUserLogout:y,userMenuItems:g,searchPlaceholder:h,showSearch:Ie,onSearch:w,onSearchAdd:k,leftSlot:S,rightSlot:R}),C==="floating"&&e("div",{className:"orb-float-search",style:P,children:e(xl,{searchPlaceholder:h,onSearch:w,onSearchAdd:k,maxWidth:"100%"})}),c("div",{style:{flex:1,minHeight:0,minWidth:0,display:"flex",overflowX:"hidden",position:"relative"},children:[a&&!fe&&e("div",{style:{paddingTop:12,paddingBottom:12,paddingLeft:12,paddingRight:yt?4:12,display:"flex",alignItems:"flex-start",flexShrink:0},children:e(ee,{...Ot,maxHeight:Kt,colorMode:Re,displayMode:ce,onDisplayModeChange:je,showDisplayModeToggle:O&&yt})}),a&&fe&&e("div",{ref:Je,onPointerDown:Ft,onPointerMove:ut,onPointerUp:Bt,onPointerCancel:Bt,style:{position:"absolute",top:Ze.y,left:Tt,zIndex:1205,display:"flex",alignItems:"flex-start",cursor:yt?Le?"grabbing":"grab":"default",touchAction:yt?"none":"auto",userSelect:Le?"none":void 0,transition:Le?"none":"left 180ms ease-out, top 180ms ease-out"},children:e(ee,{...Ot,maxHeight:Kt,colorMode:Re,displayMode:ce,onDisplayModeChange:je,showDisplayModeToggle:O&&yt})}),e("div",{style:{flex:1,minWidth:0,minHeight:0,overflow:"auto",paddingTop:12,paddingBottom:12,paddingRight:12,paddingLeft:a&&!fe&&yt?4:12,...E},children:n})]})]})})})};var _i="(blank)",ku="Result",Pu="Grand Total",Tu={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},Iu=["sum","count","avg","min","max"];var Ru=["palette","rows","columns","filters","values"];var Mu=t=>Ru.includes(t),Du=t=>t==="rows"||t==="columns"||t==="filters",Ui=t=>{let r=t.split("|");return r.length===2&&r[0]==="container"&&Mu(r[1])?{kind:"container",zone:r[1]}:r.length===3&&r[0]==="item"&&Mu(r[1])&&r[2]?{kind:"item",zone:r[1],key:r[2]}:null},co=t=>t==null||t===""?_i:t instanceof Date?t.toISOString().slice(0,10):String(t),$o=t=>JSON.stringify(t),Nu=(t,r)=>{let o=t.join(""),n=r.join("");return o.localeCompare(n,void 0,{sensitivity:"base"})},Dv=t=>{if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"&&t.trim()!==""){let r=Number(t);return Number.isFinite(r)?r:null}return null},xn=(t,r,o)=>{if(o==="count")return t.length;let n=t.map(a=>Dv(a[r])).filter(a=>a!==null);return n.length===0?0:o==="sum"?n.reduce((a,i)=>a+i,0):o==="avg"?n.reduce((a,i)=>a+i,0)/n.length:o==="min"?Math.min(...n):Math.max(...n)},lr=(t,r)=>{if(!t||t.length===0)return [];let o=new Set,n=[];return t.forEach(a=>{!r.has(a)||o.has(a)||(o.add(a),n.push(a));}),n},po=(t,r)=>t.length!==r.length?false:t.every((o,n)=>o===r[n]),Au=(t,r)=>{let o=Object.keys(t),n=Object.keys(r);return o.length!==n.length?false:o.every(a=>{let i=t[a]??[],s=r[a]??[];return po(i,s)})},Ki=(t,r)=>t.length!==r.length?false:t.every((o,n)=>{let a=r[n];return o.tokenId===a.tokenId&&o.fieldId===a.fieldId&&o.aggregation===a.aggregation}),Sl=t=>!t?.aggregations||t.aggregations.length===0?Iu:t.aggregations,hr=(t,r)=>{let o=Sl(r);return t&&o.includes(t)?t:r?.type==="number"&&o.includes("sum")?"sum":o.includes("count")?"count":o[0]},da=(t,r,o)=>{let n=o.get(r.fieldId);return n?.formatValue?n.formatValue(t):r.aggregation==="count"?Math.round(t).toLocaleString():t.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:2})};T();var Lu=({options:t,selectedValues:r,onChange:o,minWidth:n=96})=>{let{t:a}=pe(),[i,s]=Jt.useState(""),[l,d]=Jt.useState(null),p=Jt.useMemo(()=>{let m=i.trim().toLowerCase();return m?t.filter(v=>v.toLowerCase().includes(m)):t},[t,i]),u=t.length>0&&r.length===t.length,f=t.length===0?a("pivot.filter.na"):r.length===0?a("common.none"):u?a("common.all"):`${r.length}/${t.length}`,b=m=>{o(r.includes(m)?r.filter(v=>v!==m):[...r,m]);};return c("div",{sx:{minWidth:n},onClick:m=>m.stopPropagation(),onMouseDown:m=>m.stopPropagation(),children:[e(Ce,{variant:"outlined",size:"small",onClick:m=>d(m.currentTarget),sx:{minWidth:n,height:26,px:1,py:.35,fontSize:"0.72rem",justifyContent:"space-between"},children:f}),e(jt,{anchorEl:l,open:!!l,onClose:()=>d(null),PaperProps:{sx:{width:Math.max(n,220),maxHeight:320,overflowY:"auto",p:.5}},children:c("div",{onClick:m=>m.stopPropagation(),sx:{display:"grid",gap:.4},children:[e(ze,{size:"small",placeholder:`${a("common.search")}...`,fullWidth:true,value:i,onChange:m=>s(m.target.value),onKeyDown:m=>m.stopPropagation(),onClick:m=>m.stopPropagation(),sx:{m:0,"& .orb-inp":{fontSize:"0.75rem",py:.7}}}),e("div",{sx:{px:1,py:.5,borderBottom:"1px solid var(--orb-border)"},children:e(Ce,{variant:"text",size:"small",onClick:m=>{m.preventDefault(),m.stopPropagation(),o(u?[]:t);},sx:{minWidth:"auto",px:0,py:.2,fontSize:"0.76rem",fontWeight:700,textTransform:"none"},children:a(u?"pivot.filter.deselectAll":"pivot.filter.selectAll")})}),p.length===0&&e("div",{className:"orb-menu-item","aria-disabled":"true",sx:{fontSize:"0.75rem"},children:a("pivot.filter.noResults")}),p.map(m=>{let v=r.includes(m);return c("div",{role:"option","aria-selected":v,tabIndex:0,className:`orb-menu-item ${v?"orb-selected":""}`,onClick:()=>b(m),onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),b(m));},sx:{display:"flex",alignItems:"center",fontSize:"0.75rem",py:.4},children:[e(Dt,{size:"small",checked:v,inputProps:{tabIndex:-1},sx:{p:.5,mr:.5,pointerEvents:"none"}}),e("span",{children:m})]},m)})]})})]})};T();var Sn=({size:t=18,subtle:r=false})=>{let o=Math.max(2,Math.round(t/6));return e(ke,{"aria-hidden":"true",sx:{display:"grid",gridTemplateColumns:`repeat(2, ${o}px)`,gridAutoRows:`${o}px`,gap:`${Math.max(2,Math.round(o/1.5))}px`,placeItems:"center",width:t,height:t,flexShrink:0,color:r?"var(--orb-muted)":"var(--orb-primary)"},children:Array.from({length:6},(n,a)=>e(ke,{sx:{width:o,height:o,borderRadius:999,bgcolor:"currentColor"}},a))})};T();var wl=({label:t,subtitle:r,isDragging:o,dragRef:n,listeners:a,attributes:i,style:s})=>e(Ee,{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:o?.3:1,cursor:o?"grabbing":"grab"},children:c("div",{sx:{display:"flex",alignItems:"center",gap:.9},children:[e("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:e(Sn,{size:13,subtle:true})}),c("div",{sx:{minWidth:0,display:"flex",flexDirection:"column",gap:.15},children:[e(L,{component:"div",sx:{fontSize:"0.84rem",fontWeight:700,lineHeight:1.2,color:"var(--orb-fg-strong)"},children:t}),r&&e(L,{component:"div",sx:{fontSize:"0.73rem",fontWeight:400,color:"var(--orb-fg)",lineHeight:1.2},children:r})]})]})}),Ou=({id:t,label:r,subtitle:o})=>{let{setNodeRef:n,listeners:a,attributes:i,isDragging:s}=core.useDraggable({id:t});return e(wl,{label:r,subtitle:o,isDragging:s,dragRef:n,listeners:a,attributes:i})};T();var wn=({zone:t,title:r,hint:o,icon:n,children:a,itemCount:i,onClear:s})=>{let l=`container|${t}`,{isOver:d,setNodeRef:p}=core.useDroppable({id:l}),{t:u}=pe();return c(Ee,{ref:p,sx:f=>({p:1.1,borderRadius:"var(--orb-r-container)",border:"1px dashed",borderColor:d?"var(--orb-primary)":"var(--orb-p200)",bgcolor:d?"var(--orb-p100)":f.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:[c("div",{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[c("div",{sx:{display:"flex",alignItems:"center",gap:.8},children:[n,e(L,{component:"div",sx:{fontSize:"0.8rem",fontWeight:700,letterSpacing:.1,color:"var(--orb-fg-strong)"},children:r}),c(L,{component:"div",sx:{fontSize:"0.73rem",fontWeight:500,color:"var(--orb-fg)"},children:["(",i,")"]})]}),i>0&&s&&e(lt,{title:u("pivot.clearArea"),children:e(ae,{size:"small",onClick:s,sx:{width:24,height:24,p:0},children:e(Zd,{size:13})})})]}),e(L,{component:"div",sx:{mt:.5,mb:.9,fontSize:"0.72rem",fontWeight:400,color:"var(--orb-fg)"},children:o}),e("div",{sx:{flex:1},children:a})]})};T();var Fu={xs:1.2,md:1.6},kn=({title:t,subtitle:r,collapsed:o,onToggleCollapse:n,expandAriaLabel:a,collapseAriaLabel:i,children:s,bodySx:l,unmountOnExit:d=false,headerActions:p})=>c(Ee,{sx:u=>({borderRadius:"var(--orb-r-container)",border:`1px solid ${u.palette.divider}`,overflow:"hidden",bgcolor:"var(--orb-surface)",boxShadow:"var(--orb-shadow-1)"}),children:[c("div",{sx:u=>({px:Fu,py:1.15,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,bgcolor:"var(--orb-canvas)",borderBottom:o?"none":`1px solid ${u.palette.divider}`}),children:[c("div",{sx:{minWidth:0,flex:1},children:[e(L,{component:"div",sx:{fontSize:"0.92rem",fontWeight:700,color:"var(--orb-fg-strong)"},children:t}),e(L,{component:"div",sx:{fontSize:"0.75rem",fontWeight:400,color:"var(--orb-fg)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r})]}),c("div",{sx:{display:"flex",alignItems:"center",gap:.75,flexShrink:0},children:[p,e(ae,{size:"small","aria-label":o?a:i,onClick:n,sx:u=>({border:`1px solid ${u.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:e(ni,{size:13,sx:{transition:"transform 220ms cubic-bezier(0.2, 0, 0, 1)",transform:o?"rotate(180deg)":"rotate(0deg)"}})})]})]}),e(rn,{in:!o,timeout:260,easing:"cubic-bezier(0.2, 0, 0, 1)",unmountOnExit:d,children:e("div",{sx:[{px:Fu,py:{xs:1.2,md:1.6}},...Array.isArray(l)?l:l?[l]:[]],children:s})})]});T();var qi=({label:t,caption:r,onRemove:o,trailing:n,isDragging:a,dragRef:i,listeners:s,attributes:l,style:d})=>e(Ee,{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:c("div",{sx:{display:"flex",alignItems:"center",gap:.9},children:[e("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:e(Sn,{size:13,subtle:true})}),c("div",{sx:{minWidth:0,flex:1,display:"flex",flexDirection:"column",gap:.15},children:[e(L,{component:"div",sx:{fontSize:"0.82rem",fontWeight:700,lineHeight:1.2,color:"var(--orb-fg-strong)"},children:t}),r&&e(L,{component:"div",sx:{fontSize:"0.72rem",fontWeight:400,color:"var(--orb-fg)",lineHeight:1.2},children:r})]}),n,o&&e(ae,{size:"small",onClick:p=>{p.stopPropagation(),o();},sx:{width:24,height:24,p:0},children:e(So,{size:13})})]})}),pa=({id:t,label:r,caption:o,onRemove:n,trailing:a})=>{let{setNodeRef:i,attributes:s,listeners:l,transform:d,transition:p,isDragging:u}=sortable.useSortable({id:t}),f={transform:d?`translate3d(${d.x}px, ${d.y}px, 0)`:void 0,transition:p,zIndex:u?999:"auto"};return e(qi,{label:r,caption:o,onRemove:n,trailing:a,isDragging:u,dragRef:i,listeners:l,attributes:s,style:f})};T();var Zi={rows:e(dp,{size:16,sx:{color:"var(--orb-primary)"}}),columns:e(an,{size:16,sx:{color:"var(--orb-primary)"}}),filters:e(Ud,{size:16,sx:{color:"var(--orb-primary)"}}),values:e(nn,{size:16,sx:{color:"var(--orb-accent)"}})},Bu=({isConfiguratorCollapsed:t,onToggleCollapse:r,availableFields:o,fieldMap:n,filterFields:a,columnFields:i,rowFields:s,valueFields:l,clearZone:d,removeFieldFromZone:p,getFilterSelectionSummary:u,renderDimensionFilterSelect:f,renderAggregationSelect:b,getAggregationLabel:m})=>{let{t:v}=pe(),y=[`${v("pivot.zone.rows")} ${s.length}`,`${v("pivot.zone.columns")} ${i.length}`,`${v("pivot.zone.filters")} ${a.length}`,`${v("pivot.zone.values")} ${l.length}`].join(" \xB7 ");return e(kn,{title:v("pivot.config.title"),subtitle:y,collapsed:t,onToggleCollapse:r,expandAriaLabel:v("pivot.collapse.ariaExpand"),collapseAriaLabel:v("pivot.collapse.ariaCollapse"),unmountOnExit:true,children:c("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",lg:"260px 1fr"},gap:2},children:[e(wn,{zone:"palette",title:v("pivot.fieldList"),hint:v("pivot.availableDimensions"),itemCount:o.length,icon:e(Sn,{size:18,subtle:true}),children:c(ie,{spacing:.8,sx:{maxHeight:400,overflowY:"auto",pr:.5},children:[o.length===0&&e(L,{component:"div",sx:{fontSize:"0.74rem",fontWeight:400,color:"var(--orb-fg)",py:1},children:v("pivot.allFieldsInUse")}),o.map(g=>e(Ou,{id:`item|palette|${g.id}`,label:g.label,subtitle:g.type??"string"},g.id))]})}),c(ie,{spacing:2,children:[c("div",{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[e(wn,{zone:"filters",title:v("pivot.zone.filters"),hint:v("pivot.hint.filters"),icon:Zi.filters,itemCount:a.length,onClear:()=>d("filters"),children:e(sortable.SortableContext,{items:a.map(g=>`item|filters|${g}`),strategy:sortable.verticalListSortingStrategy,children:e(ie,{spacing:.7,children:a.map(g=>e(pa,{id:`item|filters|${g}`,label:n.get(g)?.label??g,caption:u(g),trailing:f(g),onRemove:()=>p("filters",g)},g))})})}),e(wn,{zone:"columns",title:v("pivot.zone.columns"),hint:v("pivot.hint.columns"),icon:Zi.columns,itemCount:i.length,onClear:()=>d("columns"),children:e(sortable.SortableContext,{items:i.map(g=>`item|columns|${g}`),strategy:sortable.verticalListSortingStrategy,children:e(ie,{spacing:.7,children:i.map(g=>e(pa,{id:`item|columns|${g}`,label:n.get(g)?.label??g,caption:`${n.get(g)?.type??"dimension"} \u2022 ${u(g)}`,trailing:f(g),onRemove:()=>p("columns",g)},g))})})})]}),c("div",{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[e(wn,{zone:"rows",title:v("pivot.zone.rows"),hint:v("pivot.hint.rows"),icon:Zi.rows,itemCount:s.length,onClear:()=>d("rows"),children:e(sortable.SortableContext,{items:s.map(g=>`item|rows|${g}`),strategy:sortable.verticalListSortingStrategy,children:e(ie,{spacing:.7,children:s.map(g=>e(pa,{id:`item|rows|${g}`,label:n.get(g)?.label??g,caption:`${n.get(g)?.type??"dimension"} \u2022 ${u(g)}`,trailing:f(g),onRemove:()=>p("rows",g)},g))})})}),e(wn,{zone:"values",title:v("pivot.zone.values"),hint:v("pivot.hint.values"),icon:Zi.values,itemCount:l.length,onClear:()=>d("values"),children:e(sortable.SortableContext,{items:l.map(g=>`item|values|${g.tokenId}`),strategy:sortable.verticalListSortingStrategy,children:e(ie,{spacing:.7,children:l.map(g=>{let x=n.get(g.fieldId)?.label??g.fieldId,h=`${m(g.aggregation)}(${x})`;return e(pa,{id:`item|values|${g.tokenId}`,label:x,caption:h,trailing:b(g),onRemove:()=>p("values",g.tokenId)},g.tokenId)})})})})]})]})]})})};T();var Hu=t=>t.toLocaleString(void 0,{maximumFractionDigits:1}),zu=({data:t,primaryLabel:r,secondaryLabel:o,formatPrimaryValue:n,formatSecondaryValue:a})=>{let i=sr();if(t.length===0)return null;let s=720,l=250,d={top:20,right:24,bottom:40,left:52},p=o?t.map(g=>g.primaryValue):t.map((g,x)=>x+1),u=o?t.map(g=>g.secondaryValue??0):t.map(g=>g.primaryValue),f=Math.max(...p,1),b=Math.max(...u,1),m=s-d.left-d.right,v=l-d.top-d.bottom,y=t.map((g,x)=>{let h=o?g.primaryValue:x+1,C=o?g.secondaryValue??0:g.primaryValue,P=d.left+h/f*m,w=l-d.bottom-C/b*v;return {...g,x:P,y:w,rawX:h,rawY:C}});return c("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[e("div",{sx:{overflowX:"auto"},children:c("div",{component:"svg",viewBox:`0 0 ${s} ${l}`,sx:{width:"100%",minWidth:s,height:l},children:[e("line",{x1:d.left,y1:l-d.bottom,x2:s-d.right,y2:l-d.bottom,stroke:Ar(i.palette.text.secondary,.35)}),e("line",{x1:d.left,y1:d.top,x2:d.left,y2:l-d.bottom,stroke:Ar(i.palette.text.secondary,.35)}),y.map(g=>c("g",{children:[e("circle",{cx:g.x,cy:g.y,r:7,fill:Ar(i.palette.primary.main,.18)}),e("circle",{cx:g.x,cy:g.y,r:4.5,fill:i.palette.primary.main,children:c("title",{children:[g.name,`
195
195
  `,o?`${r}: ${n(g.primaryValue)}`:`${r}: ${n(g.primaryValue)}`,o?`
196
- ${o}: ${(a??n)(g.secondaryValue??0)}`:""]})}),e("text",{x:g.x,y:Math.max(g.y-12,p.top+8),textAnchor:"middle",fontSize:"10",fill:i.palette.text.secondary,children:g.name})]},g.name)),e("text",{x:s/2,y:c-10,textAnchor:"middle",fontSize:"11",fill:i.palette.text.secondary,children:o?r:"Index"}),e("text",{x:16,y:c/2,textAnchor:"middle",transform:`rotate(-90 16 ${c/2})`,fontSize:"11",fill:i.palette.text.secondary,children:o??r}),e("text",{x:p.left,y:p.top-4,fontSize:"10",fill:i.palette.text.secondary,children:_p(b)}),e("text",{x:s-p.right,y:c-p.bottom+16,textAnchor:"end",fontSize:"10",fill:i.palette.text.secondary,children:_p(f)})]})}),e("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=>l("div",{sx:x=>({borderRadius:"var(--orb-r-container)",px:1.25,py:1,border:`1px solid ${Dr(x.palette.divider,.7)}`,bgcolor:Dr(x.palette.background.default,.35)}),children:[e(E,{component:"div",sx:{fontSize:"0.78rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:g.name,children:g.name}),l(E,{component:"div",sx:{fontSize:"0.72rem",color:"var(--orb-fg)"},children:[r,": ",n(g.primaryValue)]}),o&&l(E,{component:"div",sx:{fontSize:"0.72rem",color:"var(--orb-fg)"},children:[o,": ",(a??n)(g.secondaryValue??0)]})]},g.name))})]})};w();var Xs=t=>Math.max(...t,1),Kp=({data:t,chartType:r,primaryLabel:o,secondaryLabel:n,formatPrimaryValue:a,formatSecondaryValue:i})=>{let s=ar(),c=s.palette.primary.main,p=s.palette.warning.main;if(t.length===0)return null;if(r==="bar-horizontal"){let h=Xs(t.flatMap(S=>[S.primaryValue,S.secondaryValue??0]));return e(ie,{spacing:1.1,children:t.map(S=>l("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"160px 1fr 128px"},gap:1.25,alignItems:"center"},children:[e(E,{component:"div",sx:{fontSize:"0.78rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:S.name,children:S.name}),l(ie,{spacing:.65,children:[e("div",{sx:{height:10,borderRadius:999,overflow:"hidden",bgcolor:Dr(s.palette.action.active,.08)},children:e("div",{sx:{width:`${S.primaryValue/h*100}%`,height:"100%",bgcolor:c}})}),n&&e("div",{sx:{height:8,borderRadius:999,overflow:"hidden",bgcolor:Dr(s.palette.action.active,.08)},children:e("div",{sx:{width:`${(S.secondaryValue??0)/h*100}%`,height:"100%",bgcolor:p}})})]}),l("div",{sx:{minWidth:0},children:[e(E,{component:"div",sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},fontWeight:700,color:"var(--orb-fg-strong)"},children:a(S.primaryValue)}),n&&e(E,{component:"div",sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},color:"var(--orb-fg)"},children:(i??a)(S.secondaryValue??0)})]})]},S.name))})}if(r==="bar-vertical"){let h=Xs(t.flatMap(T=>[T.primaryValue,T.secondaryValue??0])),S=n?92:76;return e("div",{sx:{overflowX:"auto",pb:.5},children:e("div",{sx:{minWidth:Math.max(620,t.length*S),display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(56px, 1fr))`,gap:1,alignItems:"end"},children:t.map(T=>l("div",{sx:{minWidth:0},children:[l("div",{sx:{height:210,display:"flex",alignItems:"flex-end",justifyContent:"center",gap:.8},children:[e("div",{sx:{width:n?16:26,minHeight:8,height:`${Math.max(T.primaryValue/h*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:c},title:`${o}: ${a(T.primaryValue)}`}),n&&e("div",{sx:{width:16,minHeight:8,height:`${Math.max((T.secondaryValue??0)/h*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:p},title:`${n}: ${(i??a)(T.secondaryValue??0)}`})]}),e(E,{component:"div",sx:{fontSize:"0.76rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:T.name,children:T.name}),e(E,{component:"div",sx:{fontSize:"0.7rem",color:"var(--orb-fg)"},noWrap:true,title:a(T.primaryValue),children:a(T.primaryValue)}),n&&e(E,{component:"div",sx:{fontSize:"0.7rem",color:"var(--orb-fg)"},noWrap:true,title:(i??a)(T.secondaryValue??0),children:(i??a)(T.secondaryValue??0)})]},T.name))})})}let u=Math.max(680,t.length*74),d=240,f={top:20,right:18,bottom:36,left:18},b=Xs(t.flatMap(h=>[h.primaryValue,h.secondaryValue??0])),m=u-f.left-f.right,v=d-f.top-f.bottom,y=h=>t.map((S,T)=>{let C=f.left+T*m/Math.max(t.length-1,1),L=d-f.bottom-h(S)/b*v;return {x:C,y:L,item:S}}),g=y(h=>h.primaryValue),x=n?y(h=>h.secondaryValue??0):[];return l("div",{sx:{display:"flex",flexDirection:"column",gap:1.1},children:[e("div",{sx:{overflowX:"auto"},children:l("div",{component:"svg",viewBox:`0 0 ${u} ${d}`,sx:{width:"100%",minWidth:u,height:d},children:[e("line",{x1:f.left,y1:d-f.bottom,x2:u-f.right,y2:d-f.bottom,stroke:Dr(s.palette.text.secondary,.35)}),e("polyline",{fill:"none",stroke:c,strokeWidth:3,points:g.map(h=>`${h.x},${h.y}`).join(" ")}),g.map(h=>e("circle",{cx:h.x,cy:h.y,r:4,fill:c,children:l("title",{children:[h.item.name,`
197
- `,o,": ",a(h.item.primaryValue)]})},`primary-${h.item.name}`)),n&&l(jsxRuntime.Fragment,{children:[e("polyline",{fill:"none",stroke:p,strokeWidth:2.5,strokeDasharray:"5 5",points:x.map(h=>`${h.x},${h.y}`).join(" ")}),x.map(h=>e("circle",{cx:h.x,cy:h.y,r:3.5,fill:p,children:l("title",{children:[h.item.name,`
198
- `,n,": ",(i??a)(h.item.secondaryValue??0)]})},`secondary-${h.item.name}`))]})]})}),e("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1},children:t.map(h=>l("div",{sx:S=>({borderRadius:"var(--orb-r-container)",px:1.1,py:.9,border:`1px solid ${Dr(S.palette.divider,.7)}`,bgcolor:Dr(S.palette.background.default,.35)}),children:[e(E,{component:"div",sx:{fontSize:"0.76rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:h.name,children:h.name}),e(E,{component:"div",sx:{fontSize:"0.71rem",color:"var(--orb-fg)"},children:a(h.primaryValue)}),n&&e(E,{component:"div",sx:{fontSize:"0.71rem",color:"var(--orb-fg)"},children:(i??a)(h.secondaryValue??0)})]},h.name))})]})};var qp=(t,r,o)=>{let n=new Set,a=[];return t.forEach(i=>{n.has(i)||(n.add(i),a.push({fieldId:i,label:o.get(i)?.label??i,zone:"rows"}));}),r.forEach(i=>{n.has(i)||(n.add(i),a.push({fieldId:i,label:o.get(i)?.label??i,zone:"columns"}));}),a},Xp=(t,r,o)=>t.map(n=>{let a=r.get(n.fieldId),i=a?.label??n.fieldId;return {fieldId:n.fieldId,label:`${o(n.aggregation)} \xB7 ${i}`,item:n,field:a}}),Yp=({rows:t,dimensionFieldId:r,primaryValue:o,secondaryValue:n})=>{if(!r)return [];let a=new Map;return t.forEach(i=>{let s=no(i[r]),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:un(s,o.fieldId,o.aggregation),secondaryValue:n?un(s,n.fieldId,n.aggregation):void 0}))};w();var Zp=({rows:t,fieldMap:r,rowFields:o,columnFields:n,valueFields:a,chartDimensionFieldId:i,chartPrimaryValueFieldId:s,chartSecondaryValueFieldId:c,chartType:p,isCollapsed:u,onChartDimensionFieldIdChange:d,onChartPrimaryValueFieldIdChange:f,onChartSecondaryValueFieldIdChange:b,onChartTypeChange:m,onToggleCollapse:v,getAggregationLabel:y})=>{let{t:g}=de(),x=Qt.useMemo(()=>qp(o,n,r),[n,r,o]),h=Qt.useMemo(()=>Xp(a,r,y),[r,y,a]),S=h.find(k=>k.fieldId===s)??h[0],T=h.find(k=>k.fieldId===c&&k.fieldId!==S?.fieldId)??null,C=x.find(k=>k.fieldId===i)??x[0],L=C&&S?g("pivot.chart.subtitleReady",{dimension:C.label,measure:T?`${S.label} / ${T.label}`:S.label}):g("pivot.chart.subtitle"),A=Qt.useMemo(()=>!C||!S?[]:Yp({rows:t,dimensionFieldId:C.fieldId,primaryValue:S.item,secondaryValue:T?.item}),[S,t,T,C]),I=k=>S?Qn(k,S.item,r):k.toLocaleString(),N=k=>T?Qn(k,T.item,r):k.toLocaleString(),M=x.length>1||h.length>1;return l(fn,{title:g("pivot.chart.title"),subtitle:L,collapsed:u,onToggleCollapse:v,expandAriaLabel:g("pivot.chart.collapse.ariaExpand"),collapseAriaLabel:g("pivot.chart.collapse.ariaCollapse"),bodySx:{display:"flex",flexDirection:"column",gap:1.1},children:[M&&l("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1,alignItems:"start"},children:[l(co,{size:"small",sx:{minWidth:0,width:"100%"},children:[e(E,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g("pivot.chart.dimension")}),e(Kt,{value:C?.fieldId??"",onChange:k=>d(String(k.target.value)),sx:{fontSize:"0.75rem",height:32},children:x.map(k=>e("option",{value:k.fieldId,sx:{fontSize:"0.75rem"},children:k.label},k.fieldId))})]}),l(co,{size:"small",sx:{minWidth:0,width:"100%"},children:[e(E,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g("pivot.chart.primaryMeasure")}),e(Kt,{value:S?.fieldId??"",onChange:k=>f(String(k.target.value)),sx:{fontSize:"0.75rem",height:32},children:h.map(k=>e("option",{value:k.fieldId,sx:{fontSize:"0.75rem"},children:k.label},k.fieldId))})]}),l(co,{size:"small",sx:{minWidth:0,width:"100%"},children:[e(E,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g("pivot.chart.secondaryMeasure")}),l(Kt,{value:T?.fieldId??"",onChange:k=>b(String(k.target.value)),sx:{fontSize:"0.75rem",height:32},children:[e("option",{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:g("common.none")}),h.filter(k=>k.fieldId!==S?.fieldId).map(k=>e("option",{value:k.fieldId,sx:{fontSize:"0.75rem"},children:k.label},k.fieldId))]})]}),l(co,{size:"small",sx:{minWidth:0,width:"100%"},children:[e(E,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g("pivot.chart.chartType")}),l(Kt,{value:p,onChange:k=>m(k.target.value),sx:{fontSize:"0.75rem",height:32},children:[e("option",{value:"bar-vertical",sx:{fontSize:"0.75rem"},children:g("pivot.chart.style.barVertical")}),e("option",{value:"bar-horizontal",sx:{fontSize:"0.75rem"},children:g("pivot.chart.style.barHorizontal")}),e("option",{value:"line",sx:{fontSize:"0.75rem"},children:g("pivot.chart.style.line")}),e("option",{value:"scatter",sx:{fontSize:"0.75rem"},children:g("pivot.chart.style.scatter")})]})]})]}),e("div",{children:C?S?A.length===0?e("div",{sx:{py:5,textAlign:"center"},children:e(E,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g("pivot.chart.emptyNoData")})}):p==="scatter"?e(Up,{data:A,primaryLabel:S.label,secondaryLabel:T?.label,formatPrimaryValue:I,formatSecondaryValue:N}):e(Kp,{data:A,chartType:p,primaryLabel:S.label,secondaryLabel:T?.label,formatPrimaryValue:I,formatSecondaryValue:N}):e("div",{sx:{py:5,textAlign:"center"},children:e(E,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g("pivot.chart.emptyNoValue")})}):e("div",{sx:{py:5,textAlign:"center"},children:e(E,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g("pivot.chart.emptyNoDimension")})})})]})};w();var Ei=({node:t,dataColumns:r,fieldMap:o,level:n,expandedKeys:a,onToggle:i,getValue:s})=>{let c=a.has(t.key),p=t.children.length>0,u=t.isGrandTotal,d=p&&!c&&!u,f=u?800:d?700:p?600:500,b=u?800:d?600:500;return l(jsxRuntime.Fragment,{children:[l("tr",{sx:{bgcolor:u?ht()==="dark"?"color-mix(in oklch, var(--orb-primary) 22%, transparent)":"color-mix(in oklch, var(--orb-primary) 8%, transparent)":ht()==="dark"?"var(--orb-surface)":"background.paper","&:hover":{bgcolor:u?ht()==="dark"?"color-mix(in oklch, var(--orb-primary) 28%, transparent)":"color-mix(in oklch, var(--orb-primary) 12%, transparent)":"var(--orb-hover)"}},children:[l("td",{style:{fontWeight:f},sx:m=>({fontSize:"0.76rem",borderBottom:`1px solid ${m.palette.divider}`,whiteSpace:"nowrap",pl:n*2+1,display:"flex",alignItems:"center",height:40}),children:[p&&!u&&e(ae,{size:"small",onClick:()=>i(t.key),sx:{width:22,height:22,p:0,mr:.35,ml:-0.8},children:c?e(Br,{size:12}):e(go,{size:12})}),!p&&!u&&n>0&&e("div",{sx:{width:18}}),t.value]}),r.map(m=>e("td",{align:"right",style:{fontWeight:b},sx:{fontSize:"0.76rem",borderBottom:v=>`1px solid ${v.palette.divider}`,whiteSpace:"nowrap"},children:Qn(s?s(t,m.id):t.aggregatedValues[m.id]??0,m.valueItem,o)},`${t.key}-${m.id}`))]}),c&&t.children.map(m=>e(Ei,{node:m,dataColumns:r,fieldMap:o,level:n+1,expandedKeys:a,onToggle:i,getValue:s},m.key))]})};w();var Zs=(t,r,o)=>{let n=[...t,...r];return o&&n.includes(o)?o:n[0]??""},Fi=(t,r)=>r&&t.some(o=>o.fieldId===r)?r:t[0]?.fieldId??"",Qs=(t,r,o)=>o===""?"":o&&o!==r&&t.some(n=>n.fieldId===o)?o:t.find(n=>n.fieldId!==r)?.fieldId??"",jp=t=>{let r=new Set,o=n=>{n.forEach(a=>{a.children.length>0&&(r.add(a.key),o(a.children));});};return o(t),r},Jp=(t,r,o=0)=>t.length===0?o:t.reduce((n,a)=>a.children.length===0||!r.has(a.key)?Math.max(n,o+1):Math.max(n,Jp(a.children,r,o+1)),o),bh=(t,r)=>{let o=[],n=a=>{a.forEach(i=>{if(i.children.length>0&&r.has(i.key)){n(i.children);return}o.push(i);});};return n(t),o},bN=({title:t,rows:r,fields:o,initialLayout:n,initialChart:a,emptyText:i,maxPreviewHeight:s=520,initialChartCollapsed:c=false,initialTableCollapsed:p=false,model:u,enablePresetManagement:d=false,presets:f,defaultPresets:b,onPresetsChange:m,initialPresetId:v,onPresetApplied:y})=>{let{t:g}=de(),x=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:8}})),h=Qt.useRef(0),S=Qt.useRef(false),T=t??g("pivot.title.default"),C=i??g("pivot.empty"),L=Qt.useMemo(()=>({sum:g("pivot.agg.sum"),count:g("pivot.agg.count"),avg:g("pivot.agg.avg"),min:g("pivot.agg.min"),max:g("pivot.agg.max")}),[g]),A=Qt.useCallback(P=>L[P]??Np[P],[L]),I=Qt.useMemo(()=>new Set(o.map(P=>P.id)),[o]),N=Qt.useMemo(()=>new Map(o.map(P=>[P.id,P])),[o]),[M,k]=Qt.useState(()=>ir(n?.rows,I)),[D,R]=Qt.useState(()=>ir(n?.columns,I)),[F,z]=Qt.useState(()=>ir(n?.filters,I)),[K,V]=Qt.useState(()=>{let P=n?.values??[],G=new Set,_=[];return P.forEach(ce=>{if(!I.has(ce.fieldId)||G.has(ce.fieldId))return;G.add(ce.fieldId),h.current+=1;let Oe=N.get(ce.fieldId);_.push({tokenId:`v${h.current}`,fieldId:ce.fieldId,aggregation:fr(ce.aggregation,Oe)});}),_}),[q,$]=Qt.useState({}),[X,W]=Qt.useState(true),[H,Q]=Qt.useState(false),[J,ge]=Qt.useState(()=>Zs(ir(n?.rows,I),ir(n?.columns,I),a?.dimensionFieldId)),[se,fe]=Qt.useState(()=>{let P=(n?.values??[]).filter((G,_,ce)=>I.has(G.fieldId)&&ce.findIndex(Oe=>Oe.fieldId===G.fieldId)===_).map(G=>({tokenId:G.fieldId,fieldId:G.fieldId,aggregation:fr(G.aggregation,N.get(G.fieldId))}));return Fi(P,a?.primaryValueFieldId)}),[xe,Ke]=Qt.useState(()=>{let P=(n?.values??[]).filter((_,ce,Oe)=>I.has(_.fieldId)&&Oe.findIndex(ot=>ot.fieldId===_.fieldId)===ce).map(_=>({tokenId:_.fieldId,fieldId:_.fieldId,aggregation:fr(_.aggregation,N.get(_.fieldId))})),G=Fi(P,a?.primaryValueFieldId);return Qs(P,G,a?.secondaryValueFieldId)}),[ze,Re]=Qt.useState(a?.chartType??"bar-vertical"),[Ve,Me]=Qt.useState(c),[Ce,He]=Qt.useState(p),[at,ft]=Qt.useState(()=>b??[]),[et,re]=Qt.useState(""),[$e,Ee]=Qt.useState(false),[Le,lt]=Qt.useState(""),[Qe,vt]=Qt.useState(null),[St,Et]=Qt.useState(new Set(["__grand_total__"])),[Lt,te]=Qt.useState(new Set),rt=u?.rowFields??M,Fe=u?.columnFields??D,le=u?.filterFields??F,me=u?.valueFields??K,j=u?.filterSelections??q,ke=u?.showGrandTotal??X,Te=u?.isConfiguratorCollapsed??H,Ye=u?.chartDimensionFieldId??J,pt=u?.chartPrimaryValueFieldId??se,ct=u?.chartSecondaryValueFieldId??xe,Ft=u?.chartType??ze,_t=u?.isChartCollapsed??Ve,yt=u?.isTableCollapsed??Ce,bt=f??at,yr=d||bt.length>0||!!m,Pt=Qt.useCallback(P=>{if(u?.setRowFields){u.setRowFields(P);return}k(P);},[u]),Ot=Qt.useCallback(P=>{if(u?.setColumnFields){u.setColumnFields(P);return}R(P);},[u]),dt=Qt.useCallback(P=>{if(u?.setFilterFields){u.setFilterFields(P);return}z(P);},[u]),Bt=Qt.useCallback(P=>{if(u?.setValueFields){u.setValueFields(P);return}V(P);},[u]),Se=Qt.useCallback(P=>{if(u?.setFilterSelections){u.setFilterSelections(P);return}$(P);},[u]),B=Qt.useCallback(P=>{if(u?.setShowGrandTotal){u.setShowGrandTotal(P);return}W(P);},[u]),U=Qt.useCallback(P=>{if(u?.setIsConfiguratorCollapsed){u.setIsConfiguratorCollapsed(P);return}Q(P);},[u]),ee=Qt.useCallback(P=>{if(u?.setChartDimensionFieldId){u.setChartDimensionFieldId(P);return}ge(P);},[u]),Ie=Qt.useCallback(P=>{if(u?.setChartPrimaryValueFieldId){u.setChartPrimaryValueFieldId(P);return}fe(P);},[u]),be=Qt.useCallback(P=>{if(u?.setChartSecondaryValueFieldId){u.setChartSecondaryValueFieldId(P);return}Ke(P);},[u]),De=Qt.useCallback(P=>{if(u?.setChartType){u.setChartType(P);return}Re(P);},[u]),_e=Qt.useCallback(P=>{if(u?.setIsChartCollapsed){u.setIsChartCollapsed(P);return}Me(P);},[u]),je=Qt.useCallback(P=>{if(u?.setIsTableCollapsed){u.setIsTableCollapsed(P);return}He(P);},[u]),Ue=Qt.useCallback(P=>{let G=typeof P=="function"?P(bt):P;f||ft(G),m?.(G);},[m,bt,f]),xt=Qt.useMemo(()=>new Set([...rt,...Fe,...le]),[rt,Fe,le]),At=Qt.useMemo(()=>o.filter(P=>!xt.has(P.id)),[o,xt]),wt=Qt.useMemo(()=>{let P=[...rt,...Fe,...le],G=new Set,_=[];return P.forEach(ce=>{G.has(ce)||(G.add(ce),_.push(ce));}),_},[Fe,le,rt]);Qt.useEffect(()=>{Pt(P=>{let G=P.filter(_=>I.has(_));return ao(P,G)?P:G}),Ot(P=>{let G=P.filter(_=>I.has(_));return ao(P,G)?P:G}),dt(P=>{let G=P.filter(_=>I.has(_));return ao(P,G)?P:G}),Bt(P=>{let G=P.filter(_=>I.has(_.fieldId)).map(_=>({..._,aggregation:fr(_.aggregation,N.get(_.fieldId))}));return Ri(P,G)?P:G});},[N,I]);let Ct=Qt.useMemo(()=>{let P={};return wt.forEach(G=>{let _=new Set;r.forEach(ce=>{_.add(no(ce[G]));}),P[G]=Array.from(_).sort((ce,Oe)=>ce.localeCompare(Oe));}),P},[wt,r]);Qt.useEffect(()=>{Se(P=>{let G={};return wt.forEach(_=>{let ce=Ct[_]??[],ot=(P[_]??[]).filter(oe=>ce.includes(oe)),We=Object.prototype.hasOwnProperty.call(P,_);G[_]=We?ot:ce;}),zp(P,G)?P:G});},[wt,Ct]),Qt.useEffect(()=>{ee(P=>Zs(rt,Fe,P));},[Fe,rt,ee]),Qt.useEffect(()=>{Ie(P=>Fi(me,P));},[Ie,me]),Qt.useEffect(()=>{be(P=>Qs(me,pt,P));},[pt,be,me]);let O=Qt.useMemo(()=>r.filter(P=>wt.every(G=>{let _=j[G]??[],ce=Ct[G]??[];if(_.length===ce.length)return true;if(_.length===0)return false;let Oe=no(P[G]);return _.includes(Oe)})),[wt,Ct,j,r]),Y=Qt.useMemo(()=>{if(me.length===0)return null;let P=new Map;if(O.forEach(We=>{let oe=Fe.length>0?Fe.map(Z=>no(We[Z])):[g("pivot.valueLabel")],pe=Lo(oe);P.set(pe,oe);}),P.size===0){let We=Fe.length>0?Fe.map(()=>Pi):[g("pivot.valueLabel")];P.set(Lo(We),We);}let G=Array.from(P.entries()).sort((We,oe)=>Bp(We[1],oe[1])),_=G.flatMap(([We,oe])=>me.map(pe=>{let Z=N.get(pe.fieldId),Ae=`${A(pe.aggregation)} ${Z?.label??pe.fieldId}`,Ze=Fe.length===0||me.length>1?`${oe.join(" / ")} \u2022 ${Ae}`:oe.join(" / ");return {id:`${We}::${pe.tokenId}`,colKey:We,valueItem:pe,label:Ze}})),ce=[];Fe.length>0&&G.forEach(([We,oe])=>{let pe=_.filter(Ze=>Ze.colKey===We),Z=ce,Ae=[];oe.forEach((Ze,Pe)=>{Ae.push(`d${Pe}:${Ze}`);let Xe=`col::${Lo(Ae)}`,Rt=Z.find($o=>$o.key===Xe);Rt||(Rt={key:Xe,label:Ze,children:[],leafColumnIds:[],path:oe.slice(0,Pe+1),depth:Pe},Z.push(Rt)),pe.forEach($o=>{Rt.leafColumnIds.includes($o.id)||Rt.leafColumnIds.push($o.id);}),Z=Rt.children;});});let Oe=We=>{let oe={};return _.forEach(pe=>{let Z=We.filter(Ae=>{let Ze=Fe.length>0?Fe.map(Pe=>no(Ae[Pe])):[g("pivot.valueLabel")];return Lo(Ze)===pe.colKey});oe[pe.id]=un(Z,pe.valueItem.fieldId,pe.valueItem.aggregation);}),oe},ot=[];if(rt.length===0)ot.push({key:"root",value:g("pivot.resultLabel")||Dp,children:[],isLeaf:true,aggregatedValues:Oe(O),path:[],depth:0});else {let We=(oe,pe,Z)=>{if(pe>=rt.length)return [];let Ae=rt[pe],Ze=new Map;return oe.forEach(Pe=>{let Xe=no(Pe[Ae]);Ze.has(Xe)||Ze.set(Xe,[]),Ze.get(Xe).push(Pe);}),Array.from(Ze.keys()).sort().map(Pe=>{let Xe=Ze.get(Pe),Rt=[...Z,Pe];return {key:Lo(Rt),value:Pe,fieldId:Ae,aggregatedValues:Oe(Xe),children:We(Xe,pe+1,Rt),isLeaf:pe===rt.length-1,path:Rt,depth:pe}})};ot.push(...We(O,0,[]));}return {dataColumns:_,columnTree:ce,rowTree:ot}},[Fe,N,O,A,rt,g,me]),ue=Qt.useCallback((P,G)=>(h.current+=1,{tokenId:`v${h.current}`,fieldId:P,aggregation:fr(G,N.get(P))}),[N]),ye=Qt.useCallback(P=>{if(P==="rows")return Pt([]);if(P==="columns")return Ot([]);if(P==="filters")return dt([]);Bt([]);},[]),Je=Qt.useCallback((P,G)=>{if(P==="rows")return Pt(_=>_.filter(ce=>ce!==G));if(P==="columns")return Ot(_=>_.filter(ce=>ce!==G));if(P==="filters")return dt(_=>_.filter(ce=>ce!==G));Bt(_=>_.filter(ce=>ce.tokenId!==G));},[]),qe=Qt.useCallback((P,G)=>{Bt(_=>_.map(ce=>ce.tokenId===P?{...ce,aggregation:fr(G,N.get(ce.fieldId))}:ce));},[N]),It=Qt.useCallback(P=>{vt(String(P.active.id));},[]),gt=Qt.useCallback(P=>{if(vt(null),!P.over)return;let G=Ii(String(P.active.id)),_=Ii(String(P.over.id));if(!G||!_||G.kind!=="item"||!G.key)return;if(G.zone===_.zone&&_.kind==="item"){if(G.zone==="rows"){let Pe=rt.indexOf(G.key),Xe=rt.indexOf(_.key??"");Pe!==-1&&Xe!==-1&&Pe!==Xe&&Pt(Rt=>sortable.arrayMove(Rt,Pe,Xe));return}if(G.zone==="columns"){let Pe=Fe.indexOf(G.key),Xe=Fe.indexOf(_.key??"");Pe!==-1&&Xe!==-1&&Pe!==Xe&&Ot(Rt=>sortable.arrayMove(Rt,Pe,Xe));return}if(G.zone==="filters"){let Pe=le.indexOf(G.key),Xe=le.indexOf(_.key??"");Pe!==-1&&Xe!==-1&&Pe!==Xe&&dt(Rt=>sortable.arrayMove(Rt,Pe,Xe));return}if(G.zone==="values"){let Pe=me.findIndex(Rt=>Rt.tokenId===G.key),Xe=me.findIndex(Rt=>Rt.tokenId===(_.key??""));Pe!==-1&&Xe!==-1&&Pe!==Xe&&Bt(Rt=>sortable.arrayMove(Rt,Pe,Xe));}return}let ce=_.zone,Oe=[...rt],ot=[...Fe],We=[...le],oe=[...me],pe="",Z=null;if(G.zone==="palette")pe=G.key;else if(G.zone==="values"){let Pe=oe.find(Xe=>Xe.tokenId===G.key);if(!Pe)return;pe=Pe.fieldId,Z=Pe,oe=oe.filter(Xe=>Xe.tokenId!==G.key);}else G.zone==="rows"?(pe=G.key,Oe=Oe.filter(Pe=>Pe!==pe)):G.zone==="columns"?(pe=G.key,ot=ot.filter(Pe=>Pe!==pe)):G.zone==="filters"&&(pe=G.key,We=We.filter(Pe=>Pe!==pe));if(!pe)return;let Ae=()=>{Oe=Oe.filter(Pe=>Pe!==pe),ot=ot.filter(Pe=>Pe!==pe),We=We.filter(Pe=>Pe!==pe);},Ze=Pe=>{if(_.kind!=="item"||!_.key)return Pe==="rows"?Oe.length:Pe==="columns"?ot.length:Pe==="filters"?We.length:Pe==="values"?oe.length:0;if(Pe==="rows"){let Xe=Oe.indexOf(_.key);return Xe>=0?Xe:Oe.length}if(Pe==="columns"){let Xe=ot.indexOf(_.key);return Xe>=0?Xe:ot.length}if(Pe==="filters"){let Xe=We.indexOf(_.key);return Xe>=0?Xe:We.length}if(Pe==="values"){let Xe=oe.findIndex(Rt=>Rt.tokenId===_.key);return Xe>=0?Xe:oe.length}return 0};if(ce==="palette"){Pt(Oe),Ot(ot),dt(We),Bt(oe);return}if(ce==="values"){let Pe=Ze("values"),Xe=Z??ue(pe);oe.splice(Pe,0,Xe),Pt(Oe),Ot(ot),dt(We),Bt(oe);return}if(Op(ce)){Ae();let Pe=Ze(ce);ce==="rows"?Oe.splice(Pe,0,pe):ce==="columns"?ot.splice(Pe,0,pe):We.splice(Pe,0,pe),Pt(Oe),Ot(ot),dt(We),Bt(oe);}},[Fe,ue,le,rt,me]),ut=Qt.useCallback((P,G)=>{Se(_=>({..._,[P]:G}));},[]),kt=Qt.useCallback(P=>{Et(G=>{let _=new Set(G);return _.has(P)?_.delete(P):_.add(P),_});},[]),tr=Qt.useCallback(P=>{te(G=>{let _=new Set(G);return _.has(P)?_.delete(P):_.add(P),_});},[]),zt=Qt.useCallback(P=>{let G=N.get(P.fieldId),_=Ks(G);return e(co,{size:"small",sx:{minWidth:98},children:e(Kt,{value:P.aggregation,onChange:ce=>qe(P.tokenId,ce.target.value),onClick:ce=>ce.stopPropagation(),onMouseDown:ce=>ce.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& select.orb-inp":{py:.35}},children:_.map(ce=>e("option",{value:ce,sx:{fontSize:"0.75rem"},children:A(ce)},ce))})})},[N,A,qe]),Xt=Qt.useCallback(P=>{let G=Ct[P]??[],_=j[P]??G;return G.length===0?g("pivot.filter.noValues"):_.length===0?g("pivot.filter.noneSelected"):_.length===G.length?g("pivot.filter.allValues"):g("pivot.filter.selectedCount",{selected:_.length,total:G.length})},[Ct,j,g]),Ht=Qt.useCallback(P=>{let G=Ct[P]??[],_=j[P]??G;return e(Hp,{options:G,selectedValues:_,onChange:ce=>ut(P,ce)})},[Ct,j,ut]),Ut=Qt.useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),Wt=Qt.useCallback(()=>{let P={};return new Set([...wt,...Object.keys(j)]).forEach(_=>{if(!I.has(_))return;let ce=j[_]??[];P[_]=[...ce];}),{layout:{rows:[...rt],columns:[...Fe],filters:[...le],values:me.map(_=>({fieldId:_.fieldId,aggregation:_.aggregation}))},filterSelections:P,showGrandTotal:ke,chart:{dimensionFieldId:Ye,primaryValueFieldId:pt,secondaryValueFieldId:ct,chartType:Ft}}},[wt,Ye,pt,ct,Ft,Fe,le,j,rt,ke,I,me]),Jt=Qt.useCallback(P=>{let G=ir(P.layout.rows,I),_=ir(P.layout.columns,I),ce=ir(P.layout.filters,I),Oe=new Set,ot=(P.layout.values??[]).filter(pe=>!I.has(pe.fieldId)||Oe.has(pe.fieldId)?false:(Oe.add(pe.fieldId),true)).map(pe=>ue(pe.fieldId,pe.aggregation)),We={};Object.entries(P.filterSelections??{}).forEach(([pe,Z])=>{!I.has(pe)||!Array.isArray(Z)||(We[pe]=Array.from(new Set(Z.map(Ae=>String(Ae)))));}),Pt(G),Ot(_),dt(ce),Bt(ot),Se(We),typeof P.showGrandTotal=="boolean"&&B(P.showGrandTotal),ee(Zs(G,_,P.chart?.dimensionFieldId));let oe=Fi(ot,P.chart?.primaryValueFieldId);Ie(oe),be(Qs(ot,oe,P.chart?.secondaryValueFieldId)),De(P.chart?.chartType??"bar-vertical"),re(P.id),y?.(P);},[ue,y,ee,Ie,be,De,Ot,dt,Se,Pt,B,Bt,I]),rr=Qt.useCallback(P=>{if(!P){re("");return}let G=bt.find(_=>_.id===P);if(!G){re("");return}Jt(G);},[Jt,bt]),ur=Qt.useCallback(()=>{let P=g("pivot.preset.defaultName",{index:bt.length+1});lt(P),Ee(true);},[bt.length,g]),Tr=Qt.useCallback(()=>{let P=Le.trim();if(!P)return;let G={id:Ut(),name:P,...Wt()};Ue(_=>[..._,G]),re(G.id),Ee(false);},[Wt,Ut,Le,Ue]),Pr=Qt.useCallback(()=>{et&&(Ue(P=>P.filter(G=>G.id!==et)),re(""));},[et,Ue]);Qt.useEffect(()=>{if(!v||S.current)return;let P=bt.find(G=>G.id===v);P&&(S.current=true,Jt(P));},[Jt,v,bt]),Qt.useEffect(()=>{et&&(bt.some(P=>P.id===et)||re(""));},[et,bt]);let jr=Qt.useMemo(()=>{if(!ke||!Y||!rt.length)return null;let P={};return Y.dataColumns.forEach(G=>{let _=O.filter(ce=>{let Oe=Fe.length>0?Fe.map(ot=>no(ce[ot])):[g("pivot.valueLabel")];return Lo(Oe)===G.colKey});P[G.id]=un(_,G.valueItem.fieldId,G.valueItem.aggregation);}),{key:"__grand_total__",value:g("pivot.grandTotal")||Ap,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:P,path:[],depth:-1}},[ke,Y,O,Fe,rt.length,g]),br=Qt.useMemo(()=>jp(Y?.rowTree??[]),[Y]),Er=Qt.useMemo(()=>jp(Y?.columnTree??[]),[Y]);Qt.useEffect(()=>{Et(P=>{let G=new Set;return P.has("__grand_total__")&&G.add("__grand_total__"),br.forEach(_=>{P.has(_)&&G.add(_);}),G});},[br]),Qt.useEffect(()=>{te(P=>{let G=new Set;return Er.forEach(_=>{P.has(_)&&G.add(_);}),G});},[Er]);let Bo=Qt.useCallback(()=>{Et(P=>{let G=new Set(P);return br.forEach(_=>G.add(_)),G});},[br]),zo=Qt.useCallback(()=>{Et(P=>{let G=new Set;return P.has("__grand_total__")&&G.add("__grand_total__"),G});},[]),ko=Qt.useCallback(()=>{te(new Set(Er));},[Er]),Vo=Qt.useCallback(()=>{te(new Set);},[]),Ho=Qt.useMemo(()=>!Y||Fe.length===0?[]:bh(Y.columnTree,Lt),[Fe.length,Lt,Y]),Ir=Qt.useMemo(()=>{if(!Y)return [];if(Fe.length===0)return Y.dataColumns.map(G=>({id:G.id,label:G.label,leafColumnIds:[G.id],valueItem:G.valueItem}));let P=new Map(Y.dataColumns.map(G=>[G.id,G]));return Ho.flatMap(G=>{let _=new Map;return G.leafColumnIds.forEach(ce=>{let Oe=P.get(ce);if(!Oe)return;let ot=Oe.valueItem.tokenId,We=`${A(Oe.valueItem.aggregation)} ${N.get(Oe.valueItem.fieldId)?.label??Oe.valueItem.fieldId}`,oe=_.get(ot);if(oe){oe.leafColumnIds.push(ce);return}_.set(ot,{id:`${G.key}::${ot}`,label:me.length>1?We:G.label,leafColumnIds:[ce],valueItem:Oe.valueItem});}),Array.from(_.values())})},[Fe.length,N,A,Y,me.length,Ho]),To=Qt.useMemo(()=>new Map(Ir.map(P=>[P.id,P])),[Ir]),Wo=Qt.useMemo(()=>Ir.map(P=>({id:P.id,colKey:P.id,valueItem:P.valueItem,label:P.label})),[Ir]),$r=Qt.useMemo(()=>{if(!Y||Fe.length===0)return [];let P=[],G=Jp(Y.columnTree,Lt),_=G+(me.length>1?1:0),ce=(Oe,ot)=>{P[ot]??(P[ot]=[]),Oe.forEach(We=>{let oe=We.children.length>0&&Lt.has(We.key),pe=Ir.filter(Ae=>We.leafColumnIds.some(Ze=>Ae.leafColumnIds.includes(Ze))).length,Z=oe||me.length>1?1:_-ot;P[ot].push({key:We.key,label:We.label,colSpan:pe,rowSpan:Z,expandable:We.children.length>0,expanded:oe}),oe&&ce(We.children,ot+1);});};return ce(Y.columnTree,0),me.length>1&&(P[G]=Ir.map(Oe=>({key:Oe.id,label:Oe.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),P},[Fe.length,Lt,Y,me.length,Ir]),Jr=Qt.useCallback((P,G)=>G.leafColumnIds.reduce((_,ce)=>_+(P.aggregatedValues[ce]??0),0),[]),xn=Qt.useMemo(()=>l(jsxRuntime.Fragment,{children:[e(ve,{size:"small",variant:"text",onClick:Bo,disabled:br.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g("pivot.table.expandRowsAll")}),e(ve,{size:"small",variant:"text",onClick:zo,disabled:br.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g("pivot.table.collapseRowsAll")}),e(Nt,{orientation:"vertical",flexItem:true}),e(ve,{size:"small",variant:"text",onClick:ko,disabled:Er.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g("pivot.table.expandColumnsAll")}),e(ve,{size:"small",variant:"text",onClick:Vo,disabled:Fe.length===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g("pivot.table.collapseColumnsAll")})]}),[Fe.length,Er.size,br.size,Vo,zo,ko,Bo,g]),Po=()=>{if(!Qe)return null;let P=Ii(Qe);if(!P||P.kind!=="item"||!P.key)return null;if(P.zone==="palette"){let Oe=N.get(P.key);return Oe?e(qs,{label:Oe.label,subtitle:Oe.type}):null}if(P.zone==="values"){let Oe=me.find(pe=>pe.tokenId===P.key);if(!Oe)return null;let We=N.get(Oe.fieldId)?.label??Oe.fieldId,oe=`${A(Oe.aggregation)}(${We})`;return e(Mi,{label:We,caption:oe})}let _=N.get(P.key)?.label??P.key,ce=Xt(P.key);return e(Mi,{label:_,caption:ce})};return l(Ne,{sx:P=>({p:{xs:1.2,md:2},borderRadius:"var(--orb-r-container)",border:`1px solid ${P.palette.divider}`,bgcolor:"var(--orb-canvas)",boxShadow:"var(--orb-shadow-2)",display:"flex",flexDirection:"column",gap:2.25}),children:[l("div",{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1.5,flexWrap:"wrap"},children:[l("div",{sx:{minWidth:0,display:"flex",flexDirection:"column",gap:.35},children:[e(E,{component:"div",sx:{fontSize:"1.08rem",fontWeight:700,lineHeight:1.25,color:"var(--orb-fg-strong)"},children:T}),e(E,{component:"div",sx:{fontSize:"0.8rem",fontWeight:400,color:"var(--orb-fg)"},children:g("pivot.subtitle.default")})]}),l(ie,{direction:"row",spacing:1.5,alignItems:"center",children:[yr&&l(jsxRuntime.Fragment,{children:[e(co,{size:"small",sx:{minWidth:200},children:l(Kt,{value:et,displayEmpty:true,onChange:P=>rr(String(P.target.value)),sx:{fontSize:"0.75rem",height:32},children:[e("option",{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:g("pivot.preset.selectPlaceholder")}),bt.map(P=>e("option",{value:P.id,sx:{fontSize:"0.75rem"},children:P.name},P.id))]})}),e(it,{title:g("pivot.preset.save"),children:e(ae,{size:"small",onClick:ur,"aria-label":g("pivot.preset.save"),sx:{width:28,height:28,p:0},children:e(fo,{size:15})})}),e(it,{title:g("pivot.preset.delete"),children:e("span",{children:e(ae,{size:"small",onClick:Pr,disabled:!et,"aria-label":g("pivot.preset.delete"),sx:{width:28,height:28,p:0},children:e(Va,{size:15})})})}),e(Nt,{flexItem:true,orientation:"vertical"})]}),l(E,{component:"div",sx:{fontSize:"0.75rem",fontWeight:400,color:"var(--orb-fg)"},children:[g("pivot.records"),": ",e("strong",{children:r.length.toLocaleString()})," / ",g("pivot.afterFilter"),":"," ",e("strong",{children:O.length.toLocaleString()})]}),e(Nt,{flexItem:true,orientation:"vertical"}),l("div",{sx:{display:"flex",alignItems:"center",gap:.6},children:[e(E,{component:"div",sx:{fontSize:"0.75rem",fontWeight:500,color:"var(--orb-fg-strong)"},children:g("pivot.grandTotal")}),e(Fa,{size:"small",checked:ke,onChange:P=>B(P.target.checked)})]})]})]}),e(Nt,{}),l(core.DndContext,{sensors:x,collisionDetection:core.closestCenter,onDragStart:It,onDragEnd:gt,children:[e(Gp,{isConfiguratorCollapsed:Te,onToggleCollapse:()=>U(P=>!P),availableFields:At,fieldMap:N,filterFields:le,columnFields:Fe,rowFields:rt,valueFields:me,clearZone:ye,removeFieldFromZone:Je,getFilterSelectionSummary:Xt,renderDimensionFilterSelect:Ht,renderAggregationSelect:zt,getAggregationLabel:A}),e(Rc,{children:e(core.DragOverlay,{dropAnimation:{duration:250,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:Po()})})]}),e(Zp,{rows:O,fieldMap:N,rowFields:rt,columnFields:Fe,valueFields:me,chartDimensionFieldId:Ye,chartPrimaryValueFieldId:pt,chartSecondaryValueFieldId:ct,chartType:Ft,isCollapsed:_t,onChartDimensionFieldIdChange:P=>ee(P),onChartPrimaryValueFieldIdChange:P=>Ie(P),onChartSecondaryValueFieldIdChange:P=>be(P),onChartTypeChange:P=>De(P),onToggleCollapse:()=>_e(P=>!P),getAggregationLabel:A}),e(fn,{title:g("pivot.table.sectionTitle"),subtitle:rt.length>0?rt.map(P=>N.get(P)?.label??P).join(" > "):g("pivot.table.dimensions"),collapsed:yt,onToggleCollapse:()=>je(P=>!P),expandAriaLabel:g("pivot.table.collapse.ariaExpand"),collapseAriaLabel:g("pivot.table.collapse.ariaCollapse"),bodySx:{p:0},headerActions:xn,children:Y===null?e("div",{sx:{py:5,px:{xs:1.2,md:1.6},textAlign:"center"},children:e(E,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:C})}):e("div",{sx:{maxHeight:s},children:l("table",{className:"orb-tbl",size:"small",stickyHeader:true,children:[e("thead",{children:($r.length>0?$r:[[]]).map((P,G)=>l("tr",{children:[G===0&&e("td",{rowSpan:Math.max($r.length,1),sx:_=>({fontWeight:800,fontSize:"0.76rem",color:"text.primary",bgcolor:ht()==="dark"?"var(--orb-canvas)":"var(--orb-surface)",borderBottom:`1px solid ${_.palette.divider}`,pl:2,minWidth:220,verticalAlign:"middle"}),children:rt.length>0?rt.map(_=>N.get(_)?.label).join(" > "):g("pivot.table.dimensions")}),(P.length>0?P:Ir.map(_=>({key:_.id,label:_.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))).map(_=>e("td",{align:"center",colSpan:_.colSpan,rowSpan:_.rowSpan,sx:ce=>({fontWeight:800,fontSize:"0.75rem",color:"text.primary",bgcolor:ht()==="dark"?"var(--orb-canvas)":"var(--orb-surface)",borderBottom:`1px solid ${ce.palette.divider}`,minWidth:148,verticalAlign:"middle"}),children:l("div",{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:.4},children:[_.expandable&&e(ae,{size:"small",onClick:()=>tr(_.key),sx:{width:22,height:22,p:0,ml:-0.2},children:_.expanded?e(Br,{size:12}):e(go,{size:12})}),e("div",{component:"span",children:_.label})]})},_.key))]},`pivot-header-row-${G}`))}),l("tbody",{children:[Y.rowTree.map(P=>e(Ei,{node:P,dataColumns:Wo,fieldMap:N,level:0,expandedKeys:St,onToggle:kt,getValue:(G,_)=>{let ce=To.get(_);return ce?Jr(G,ce):0}},P.key)),jr&&e(Ei,{node:jr,dataColumns:Wo,fieldMap:N,level:0,expandedKeys:St,onToggle:kt,getValue:(P,G)=>{let _=To.get(G);return _?Jr(P,_):0}})]})]})})}),l(Vt,{open:$e,onClose:()=>Ee(false),maxWidth:"xs",fullWidth:true,children:[e("div",{className:"orb-dialog-title",children:g("pivot.preset.saveDialogTitle")}),e("div",{className:"orb-dialog-content",children:e(Be,{autoFocus:true,fullWidth:true,margin:"dense",label:g("pivot.preset.nameLabel"),value:Le,onChange:P=>lt(P.target.value),onKeyDown:P=>{P.key==="Enter"&&(P.preventDefault(),Tr());}})}),l("div",{className:"orb-dialog-actions",children:[e(ve,{onClick:()=>Ee(false),children:g("common.cancel")}),e(ve,{variant:"contained",onClick:Tr,disabled:!Le.trim(),children:g("common.save")})]})]})]})};var eu=(t,r,o)=>{let n=[...t,...r];return o&&n.includes(o)?o:n[0]??""},Js=(t,r)=>r&&t.some(o=>o.fieldId===r)?r:t[0]?.fieldId??"",tu=(t,r,o)=>o===""?"":o&&o!==r&&t.some(n=>n.fieldId===o)?o:t.find(n=>n.fieldId!==r)?.fieldId??"",CN=({fields:t,initialLayout:r,initialFilterSelections:o={},initialShowGrandTotal:n=true,initialConfiguratorCollapsed:a=false,initialChart:i,initialChartCollapsed:s=false,initialTableCollapsed:c=false})=>{let p=Qt.useRef(0),u=Qt.useMemo(()=>new Set(t.map(re=>re.id)),[t]),d=Qt.useMemo(()=>new Map(t.map(re=>[re.id,re])),[t]),[f,b]=Qt.useState(()=>ir(r?.rows,u)),[m,v]=Qt.useState(()=>ir(r?.columns,u)),[y,g]=Qt.useState(()=>ir(r?.filters,u)),[x,h]=Qt.useState(()=>{let re=r?.values??[],$e=new Set,Ee=[];return re.forEach(Le=>{!u.has(Le.fieldId)||$e.has(Le.fieldId)||($e.add(Le.fieldId),p.current+=1,Ee.push({tokenId:`v${p.current}`,fieldId:Le.fieldId,aggregation:fr(Le.aggregation,d.get(Le.fieldId))}));}),Ee}),[S,T]=Qt.useState(o),[C,L]=Qt.useState(n),[A,I]=Qt.useState(a),[N,M]=Qt.useState(()=>eu(ir(r?.rows,u),ir(r?.columns,u),i?.dimensionFieldId)),[k,D]=Qt.useState(()=>{let re=(()=>{let $e=r?.values??[],Ee=new Set,Le=[];return $e.forEach(lt=>{!u.has(lt.fieldId)||Ee.has(lt.fieldId)||(Ee.add(lt.fieldId),Le.push({tokenId:lt.fieldId,fieldId:lt.fieldId,aggregation:fr(lt.aggregation,d.get(lt.fieldId))}));}),Le})();return Js(re,i?.primaryValueFieldId)}),[R,F]=Qt.useState(()=>{let re=(()=>{let Ee=r?.values??[],Le=new Set,lt=[];return Ee.forEach(Qe=>{!u.has(Qe.fieldId)||Le.has(Qe.fieldId)||(Le.add(Qe.fieldId),lt.push({tokenId:Qe.fieldId,fieldId:Qe.fieldId,aggregation:fr(Qe.aggregation,d.get(Qe.fieldId))}));}),lt})(),$e=Js(re,i?.primaryValueFieldId);return tu(re,$e,i?.secondaryValueFieldId)}),[z,K]=Qt.useState(i?.chartType??"bar-vertical"),[V,q]=Qt.useState(s),[$,X]=Qt.useState(c);Qt.useEffect(()=>{b(re=>{let $e=re.filter(Ee=>u.has(Ee));return ao(re,$e)?re:$e}),v(re=>{let $e=re.filter(Ee=>u.has(Ee));return ao(re,$e)?re:$e}),g(re=>{let $e=re.filter(Ee=>u.has(Ee));return ao(re,$e)?re:$e}),h(re=>{let $e=re.filter(Ee=>u.has(Ee.fieldId)).map(Ee=>({...Ee,aggregation:fr(Ee.aggregation,d.get(Ee.fieldId))}));return Ri(re,$e)?re:$e});},[d,u]),Qt.useEffect(()=>{M(re=>eu(f,m,re));},[m,f]),Qt.useEffect(()=>{D(re=>Js(x,re));},[x]),Qt.useEffect(()=>{F(re=>tu(x,k,re));},[k,x]);let W=Qt.useCallback(re=>{b(ir(re,u));},[u]),H=Qt.useCallback(re=>{v(ir(re,u));},[u]),Q=Qt.useCallback(re=>{g(ir(re,u));},[u]),J=Qt.useCallback(re=>{h($e=>{let Ee=re??[],Le=new Set,lt=[];return Ee.forEach(Qe=>{if(!u.has(Qe.fieldId)||Le.has(Qe.fieldId))return;Le.add(Qe.fieldId);let vt=$e.find(St=>St.fieldId===Qe.fieldId);if(vt){lt.push({...vt,aggregation:fr(Qe.aggregation??vt.aggregation,d.get(Qe.fieldId))});return}p.current+=1,lt.push({tokenId:`v${p.current}`,fieldId:Qe.fieldId,aggregation:fr(Qe.aggregation,d.get(Qe.fieldId))});}),lt});},[d,u]),ge=Qt.useCallback(re=>{W(re.rows??[]),H(re.columns??[]),Q(re.filters??[]),J(re.values??[]);},[H,Q,W,J]),se=Qt.useCallback(re=>{if(re==="rows")return b([]);if(re==="columns")return v([]);if(re==="filters")return g([]);h([]);},[]),fe=Qt.useCallback((re,$e)=>{if(re==="rows")return b(Ee=>Ee.filter(Le=>Le!==$e));if(re==="columns")return v(Ee=>Ee.filter(Le=>Le!==$e));if(re==="filters")return g(Ee=>Ee.filter(Le=>Le!==$e));h(Ee=>Ee.filter(Le=>Le.tokenId!==$e));},[]),xe=Qt.useCallback((re,$e)=>{h(Ee=>Ee.map(Le=>Le.tokenId===re?{...Le,aggregation:fr($e,d.get(Le.fieldId))}:Le));},[d]),Ke=Qt.useCallback((re,$e)=>{T(Ee=>({...Ee,[re]:$e}));},[]),ze=Qt.useCallback(()=>{T({});},[]),Re=Qt.useCallback(()=>{L(re=>!re);},[]),Ve=Qt.useCallback(()=>{I(re=>!re);},[]),Me=Qt.useCallback(re=>{M(re);},[]),Ce=Qt.useCallback(re=>{D(re);},[]),He=Qt.useCallback(re=>{F(re);},[]),at=Qt.useCallback(()=>{q(re=>!re);},[]),ft=Qt.useCallback(()=>{X(re=>!re);},[]);return {model:Qt.useMemo(()=>({rowFields:f,setRowFields:b,columnFields:m,setColumnFields:v,filterFields:y,setFilterFields:g,valueFields:x,setValueFields:h,filterSelections:S,setFilterSelections:T,showGrandTotal:C,setShowGrandTotal:L,isConfiguratorCollapsed:A,setIsConfiguratorCollapsed:I,chartDimensionFieldId:N,setChartDimensionFieldId:M,chartPrimaryValueFieldId:k,setChartPrimaryValueFieldId:D,chartSecondaryValueFieldId:R,setChartSecondaryValueFieldId:F,chartType:z,setChartType:K,isChartCollapsed:V,setIsChartCollapsed:q,isTableCollapsed:$,setIsTableCollapsed:X}),[N,k,R,z,m,y,S,V,A,$,f,C,x]),actions:{setRows:W,setColumns:H,setFilters:Q,setValues:J,setLayout:ge,clearZone:se,removeFieldFromZone:fe,setAggregationForValue:xe,setFilterSelection:Ke,resetFilterSelections:ze,toggleGrandTotal:Re,toggleConfigurator:Ve,setChartDimension:Me,setChartPrimaryValue:Ce,setChartSecondaryValue:He,setChartType:K,toggleChart:at,toggleTable:ft}}};var TN=({orientation:t="auto",defaultNavigationOpen:r,onNavOpenChange:o}={})=>{let n=ar(),a=po("(orientation: portrait)"),i=po(n.breakpoints.down("md")),s=Qt.useMemo(()=>t==="auto"?a||i?"portrait":"landscape":t,[i,a,t]),[c,p]=Qt.useState(r??s==="landscape");Qt.useEffect(()=>{p(r??s==="landscape");},[r,s]);let u=f=>{p(f),o?.(f);};return {resolvedOrientation:s,isPortraitViewport:a,isCompactViewport:i,navigationOpen:c,setNavigationOpen:u,toggleNavigationOpen:()=>u(!c)}};var Sh=t=>{let r=Number(t||0);return Number.isFinite(r)?r:0},RN=({rows:t,rowKey:r="id",numericField:o,defaultSelectedId:n})=>{let i=t[0]?.[r],[s,c]=Qt.useState(n??i),p=Qt.useMemo(()=>t.find(m=>m[r]===s)||t[0],[r,t,s]),[u,d]=Qt.useState(()=>{let m=p?.[o];return m==null?"0":String(m)});return {selectedId:s,selectedRecord:p,editorValue:u,setEditorValue:d,selectRecord:m=>{let v=m[r];c(v);let y=m[o];d(y==null?"0":String(y));},applyEditorValue:m=>{if(s===void 0)return;let v=Sh(u),y=t.map(g=>g[r]===s?{...g,[o]:v}:g);m(y);}}};w();var wh=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],ou=(t,r,o,n)=>{r?.(t),n&&o?.();},LN=({open:t,onClose:r,title:o="Scan barcode",subtitle:n="Use the rear camera on the device. If scanning is unavailable, enter the code manually.",formats:a=wh,facingMode:i="environment",manualEntry:s=true,autoCloseOnDetect:c=true,scanIntervalMs:p=600,confirmLabel:u="Use code",cancelLabel:d="Close",manualPlaceholder:f="Enter barcode manually",onDetected:b,onError:m,sx:v})=>{let y=Qt__namespace.default.useRef(null),g=Qt__namespace.default.useRef(null),x=Qt__namespace.default.useRef(null),h=Qt__namespace.default.useRef(null),[S,T]=Qt__namespace.default.useState("idle"),[C,L]=Qt__namespace.default.useState(""),[A,I]=Qt__namespace.default.useState(null),[N,M]=Qt__namespace.default.useState(null),k=Qt__namespace.default.useCallback(()=>{x.current!==null&&(window.clearInterval(x.current),x.current=null),g.current&&(g.current.getTracks().forEach(F=>F.stop()),g.current=null),y.current&&(y.current.srcObject=null);},[]),D=Qt__namespace.default.useCallback(F=>{M(F),T("error"),m?.(F);},[m]);Qt__namespace.default.useEffect(()=>{if(!t){k(),T("idle"),M(null),L("");return}let F=false;return (async()=>{if(!(typeof window>"u"||typeof navigator>"u")){if(!navigator.mediaDevices?.getUserMedia){T("unsupported"),M("Camera access is not supported in this browser.");return}T("starting"),M(null);try{let K=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:i}}});if(F){K.getTracks().forEach(V=>V.stop());return}if(g.current=K,y.current&&(y.current.srcObject=K,await y.current.play()),!window.BarcodeDetector){T("unsupported"),M("BarcodeDetector is not available. Camera preview is ready and manual entry is enabled.");return}h.current=new window.BarcodeDetector({formats:a}),T("ready"),x.current=window.setInterval(async()=>{if(!(!y.current||!h.current)&&!(y.current.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))try{let q=(await h.current.detect(y.current)).find(X=>X.rawValue);if(!q?.rawValue)return;let $={rawValue:q.rawValue,format:q.format};I($),k(),ou($,b,r,c);}catch(V){D(V instanceof Error?V.message:"Failed to detect barcode.");}},p);}catch(K){D(K instanceof Error?K.message:"Unable to start camera.");}}})(),()=>{F=true,k();}},[c,i,a,r,b,t,D,p,k]);let R=()=>{let F=C.trim();if(!F)return;let z={rawValue:F,format:"manual"};I(z),ou(z,b,r,c);};return l(Vt,{open:t,onClose:r,fullWidth:true,maxWidth:"sm",children:[e("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:900},children:o}),e("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:l(ie,{spacing:2,sx:v,children:[e(E,{sx:{fontSize:"0.88rem",color:"text.secondary",lineHeight:1.55},children:n}),l(Ne,{elevation:0,sx:{position:"relative",overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:"divider",minHeight:280,background:ht()==="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:[e("video",{ref:y,muted:true,playsInline:true,autoPlay:true,style:{width:"100%",height:280,objectFit:"cover",display:"block"}}),e("div",{sx:{pointerEvents:"none",position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:e("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:e("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)"}})})}),l("div",{sx:{position:"absolute",top:12,left:12,display:"flex",gap:1,flexWrap:"wrap"},children:[e(Tt,{icon:e(Wc,{}),label:S==="ready"?"Camera ready":S==="starting"?"Starting camera":S==="unsupported"?"Preview only":S==="error"?"Scanner error":"Idle",size:"small",color:S==="error"?"error":"primary",variant:"filled"}),A?e(Tt,{icon:e(sd,{}),label:`${A.format||"barcode"}: ${A.rawValue}`,size:"small",color:"success",variant:"filled"}):null]})]}),N?e(Kr,{severity:S==="unsupported"?"info":"warning",children:N}):null,s?l(ie,{direction:{xs:"column",sm:"row"},spacing:1.25,children:[e(Be,{fullWidth:true,label:"Barcode",placeholder:f,value:C,onChange:F=>L(F.target.value)}),e(ve,{variant:"contained",onClick:R,sx:{minHeight:56,px:2.5},children:u})]}):null]})}),e("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:e(ve,{onClick:r,children:d})})]})};w();var kh={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)"},WN=({title:t,description:r,kicker:o,icon:n,badges:a=[],metrics:i=[],footer:s,children:c,selected:p=false,draggable:u=false,isDragging:d=false,swipeThreshold:f=88,startAction:b,endAction:m,dragHandleProps:v,onClick:y,onSwipe:g,sx:x})=>{let[h,S]=Qt.useState(0),[T,C]=Qt.useState(false),L=Qt.useRef(null),A=Qt.useRef(0),I=Qt.useRef(0),N=!!(b||m),M=132,k=()=>{S(0),C(false),L.current=null,A.current=0,I.current=0;},D=V=>{(V==="start"?b:m)?.onTrigger?.(),g?.(V),k();},R=V=>{!N||V.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(L.current=V.pointerId,A.current=V.clientX,I.current=V.clientX,C(true),V.currentTarget.setPointerCapture(V.pointerId));},F=V=>{if(!T||L.current!==V.pointerId)return;I.current=V.clientX;let q=I.current-A.current,$=Math.max(-M,Math.min(M,q));S($);},z=V=>{if(!T||L.current!==V.pointerId)return;let q=I.current-A.current;if(q>=f&&b){D("start");return}if(q<=-f&&m){D("end");return}Math.abs(q)<12&&y?.(),k();},K=(V,q)=>{if(!V)return null;let $=V.backgroundColor||kh[V.tone||"default"];return e("div",{sx:{position:"absolute",top:0,bottom:0,[q]:0,width:M,px:2,display:"flex",alignItems:"center",justifyContent:q==="left"?"flex-start":"flex-end",color:"var(--orb-on-primary)",background:`linear-gradient(135deg, ${$}, rgba(15,23,42,0.92))`},children:l(ie,{direction:"row",spacing:1,alignItems:"center",children:[V.icon,e(E,{sx:{fontWeight:700,fontSize:"0.95rem"},children:V.label})]})})};return l("div",{sx:{position:"relative",overflow:"hidden",borderRadius:4,...x},children:[K(b,"left"),K(m,"right"),e(Ne,{elevation:0,onPointerDown:R,onPointerMove:F,onPointerUp:z,onPointerCancel:k,sx:{position:"relative",zIndex:1,p:2,borderRadius:4,border:"1px solid",borderColor:p?"primary.main":"divider",background:ht()==="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:p?"0 18px 42px color-mix(in oklch, var(--orb-primary) 18%, transparent)":"0 12px 28px rgba(15, 23, 42, 0.08)",transform:`translate3d(${h}px, 0, 0) scale(${d?.985:1})`,transition:T?"none":"transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease",touchAction:"pan-y",cursor:y?"pointer":"default",opacity:d?.9:1},children:l(ie,{spacing:1.5,children:[l(ie,{direction:"row",spacing:1.5,alignItems:"flex-start",children:[n?e("div",{sx:{mt:.25},children:n}):null,l("div",{sx:{flex:1,minWidth:0},children:[o?e(E,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:"0.08em",color:"text.secondary"},children:o}):null,e(E,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:t}),r?e(E,{sx:{mt:.5,fontSize:"0.9rem",color:"text.secondary",lineHeight:1.45},children:r}):null]}),u?e("div",{"data-no-swipe":"true",...v,sx:{alignSelf:"center",display:"inline-flex",touchAction:"none"},children:e(ae,{size:"small",children:e(Yc,{})})}):null]}),a.length>0?e(ie,{direction:"row",spacing:1,useFlexGap:true,flexWrap:"wrap",children:a.map((V,q)=>e(Tt,{label:V,size:"small",sx:{borderRadius:999,fontWeight:700,bgcolor:"action.hover",color:"text.primary"}},q))}):null,i.length>0?e("div",{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:1},children:i.map(V=>l(Ne,{elevation:0,sx:{p:1.25,borderRadius:3,bgcolor:"action.hover",border:"1px solid",borderColor:"divider",color:"text.primary"},children:[e(E,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:V.label}),e(E,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.2},children:V.value})]},V.id))}):null,c,s]})})]})};w();var Jn=({label:t,onPress:r,emphasis:o="default"})=>e("div",{component:"button",type:"button",onClick:r,sx:n=>({minHeight:72,borderRadius:3,border:"1px solid",borderColor:o==="primary"?"primary.main":"divider",background:o==="primary"?n.palette.primary.main:o==="danger"?ht()==="dark"?"color-mix(in oklch, var(--orb-status-error) 18%, transparent)":"color-mix(in oklch, var(--orb-status-error) 10%, transparent)":ht()==="dark"?"rgba(255,255,255,0.04)":"var(--orb-canvas)",color:o==="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}),YN=({value:t,defaultValue:r="",title:o,subtitle:n,placeholder:a="0",allowDecimal:i=false,allowNegative:s=false,maxLength:c,confirmLabel:p,clearLabel:u,backspaceLabel:d,onChange:f,onSubmit:b,onClose:m,sx:v})=>{let{t:y}=de(),[g,x]=Qt.useState(r),h=t??g,S=k=>{t===void 0&&x(k),f?.(k);},T=k=>{c&&h.length>=c||S(`${h}${k}`);},C=k=>{if(k==="00"){if(!h){S("0");return}T("00");return}T(k);},L=()=>{!i||h.includes(".")||S(h?`${h}.`:"0.");},A=()=>{if(s){if(h.startsWith("-")){S(h.slice(1));return}S(h?`-${h}`:"-");}},I=()=>{S(h.slice(0,-1));},N=()=>{S("");},M=()=>{b?.(h);};return e(Ne,{elevation:0,sx:{p:2,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",...v},children:l(ie,{spacing:2,children:[l(ie,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[l("div",{sx:{minWidth:0},children:[o?e(E,{sx:{fontSize:"1rem",fontWeight:800},children:o}):null,n?e(E,{sx:{mt:.5,fontSize:"0.86rem",color:"text.secondary"},children:n}):null]}),m?e(ae,{onClick:m,size:"small",children:e(qc,{})}):null]}),e(Ne,{elevation:0,sx:{p:2,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:e(E,{sx:{minHeight:38,fontSize:h?"1.9rem":"1.25rem",fontWeight:900,letterSpacing:"0.06em",color:h?"text.primary":"text.disabled"},children:h||a})}),l("div",{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[["1","2","3","4","5","6","7","8","9"].map(k=>e(Jn,{label:k,onPress:()=>C(k)},k)),e(Jn,{label:s?"+/-":"00",onPress:s?A:()=>C("00")}),e(Jn,{label:"0",onPress:()=>C("0")}),e(Jn,{label:i?".":d?String(d):"DEL",onPress:i?L:I})]}),l("div",{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[e("div",{component:"button",type:"button",onClick:I,sx:{minHeight:64,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"},children:l(ie,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[e(Hc,{}),e(E,{sx:{fontWeight:700},children:d||"DEL"})]})}),e(Jn,{label:String(u||"CLR"),onPress:N,emphasis:"danger"}),e("div",{component:"button",type:"button",onClick:M,sx:k=>({minHeight:64,borderRadius:3,border:"1px solid",borderColor:"primary.main",background:k.palette.primary.main,color:"var(--orb-on-primary)",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"}),children:l(ie,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[e(Gc,{}),e(E,{sx:{fontWeight:800},children:p||y("common.ok")})]})})]})]})})};w();var au=({touchMode:t="comfortable",sx:r,...o})=>{let n=t==="expanded";return e("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},...r},children:e(zr,{...o})})};w();var Mh=(t,r,o)=>{if(o?.(r),!!r.href){if(r.href.startsWith("http://")||r.href.startsWith("https://")){window.open(r.href,"_blank");return}t.push(r.href);}},iu=({items:t,selectedId:r,orientation:o="auto",onItemSelect:n,sx:a})=>{let i=ar(),[s,c]=Qt.useState(false);Qt.useEffect(()=>{c(true);},[]);let p=po("(orientation: portrait)"),u=po(i.breakpoints.down("md")),d=o==="auto"?p||u?"portrait":"landscape":o,f=navigation.useRouter();return e("div",{sx:{display:"grid",gridTemplateColumns:!s||d==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(180px, 1fr))",gap:1.5,...a},children:t.map(b=>{let m=b.id===r,v=b.color||(m?i.palette.primary.main:i.palette.divider);return e(Ne,{elevation:0,sx:{overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:m?"primary.main":"divider",boxShadow:m?"0 18px 40px color-mix(in oklch, var(--orb-primary) 16%, transparent)":"none",bgcolor:ht()==="dark"?"color-mix(in oklch, var(--orb-surface-3) 60%, transparent)":"background.paper"},children:e("div",{component:"button",type:"button",disabled:b.disabled,onClick:()=>Mh(f,b,n),sx:{width:"100%",p:2,minHeight:d==="portrait"?156:148,display:"block",border:0,background:"transparent",textAlign:"left",cursor:b.disabled?"not-allowed":"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent",color:"text.primary"},children:l(ie,{spacing:1.5,sx:{height:"100%"},children:[l(ie,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[e("div",{sx:{width:44,height:44,borderRadius:3,display:"grid",placeItems:"center",color:m?"var(--orb-on-primary)":"text.primary",background:m?v:"action.hover"},children:b.icon||e(E,{sx:{fontSize:"1rem",fontWeight:900},children:b.title.slice(0,1).toUpperCase()})}),b.badge!==void 0?e("div",{sx:{minWidth:34,px:1,py:.4,borderRadius:999,bgcolor:m?"primary.main":"action.hover",color:m?"var(--orb-on-primary)":"text.secondary",textAlign:"center",fontWeight:800,fontSize:"0.8rem"},children:b.badge}):null]}),l("div",{sx:{flex:1,minWidth:0},children:[e(E,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.25},children:b.title}),b.caption?e(E,{sx:{mt:.5,fontSize:"0.74rem",fontWeight:700,color:"text.secondary"},children:b.caption}):null,b.description?e(E,{sx:{mt:.75,fontSize:"0.84rem",lineHeight:1.45,color:"text.secondary"},children:b.description}):null]})]})})},b.id)})})};w();var cu=(t,r)=>r.trim()?t.reduce((o,n)=>{let a=n.title?.toLowerCase().includes(r.toLowerCase())||n.label?.toLowerCase().includes(r.toLowerCase())||n.description?.toLowerCase().includes(r.toLowerCase()),i=n.children?cu(n.children,r):[];return (a||i.length>0)&&o.push({...n,children:i.length>0?i:n.children}),o},[]):t,Eh=t=>{let r=new Set,o=n=>{n.forEach(a=>{a.children?.length&&(r.add(a.id),o(a.children));});};return o(t),r},du=({collapsed:t=false,onToggle:r,className:o="",maxHeight:n,menuData:a=[],colorMode:i="light",orientation:s="auto",headerSlot:c,footerSlot:p,activeHref:u,onItemSelect:d})=>{let{t:f}=de(),b=ar(),m=Rr("(orientation: portrait)"),v=Rr(b.breakpoints.down("md")),y=s==="auto"?m||v?"portrait":"landscape":s,g=i==="dark",x=navigation.useRouter(),h=navigation.usePathname(),[S,T]=Qt.useState(""),[C,L]=Qt.useState(new Set),A=Qt.useMemo(()=>cu(a,S),[a,S]),I=Qt.useMemo(()=>S.trim()?Eh(A):C,[C,A,S]);Qt.useEffect(()=>{t&&L(new Set);},[t]);let N=F=>F.appurl||F.href||"",M=F=>{d?.(F);let z=N(F);if(z){if(z.startsWith("http://")||z.startsWith("https://")){window.open(z,"_blank");return}x.push(z);}},k=F=>{let z=!!F.children?.length;if(t&&z){r?.();return}if(z){L(K=>{let V=new Set(K);return V.has(F.id)?V.delete(F.id):V.add(F.id),V});return}M(F);},D=F=>{let z=u||h,K=N(F);return !!(K&&z===K)},R=(F,z=0)=>{let K=!!F.children?.length,V=I.has(F.id),q=D(F);return e("div",{sx:{pl:z===0?0:1.5},children:l(Ne,{elevation:0,sx:{mb:1,overflow:"hidden",borderRadius:3,border:"1px solid",borderColor:q?"primary.main":"divider",bgcolor:q?"action.selected":"background.paper"},children:[l("div",{component:"button",type:"button",onClick:()=>k(F),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:[e(Ea,{variant:"rounded",sx:{width:40,height:40,bgcolor:q?"primary.main":"action.hover",color:q?"var(--orb-on-primary)":"text.primary"},children:F.icon||(F.title||F.label||"?").slice(0,1).toUpperCase()}),l("div",{sx:{flex:1,minWidth:0},children:[e(E,{sx:{fontSize:"0.95rem",fontWeight:800,lineHeight:1.2},children:F.title||F.label}),F.description?e(E,{sx:{mt:.4,fontSize:"0.78rem",color:"text.secondary",lineHeight:1.35},children:F.description}):null]}),K?e(Xo,{sx:{transform:V?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):e(Ba,{color:"action"})]}),K?e(qo,{in:V,children:e("div",{sx:{px:1.25,pb:1.25},children:F.children?.map($=>R($,z+1))})}):null]})},F.id)};return t?e(Ne,{elevation:0,className:o,sx:{width:y==="portrait"?"100%":88,p:1,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:g?"var(--orb-surface)":"color-mix(in oklch, var(--orb-canvas) 88%, transparent)",maxHeight:n?`${n}px`:void 0,overflowY:"auto"},children:l(ie,{spacing:1,children:[e(ae,{onClick:r,sx:{width:48,height:48,alignSelf:"center",bgcolor:"action.hover"},title:f("navigation.expand"),children:e(Ga,{})}),a.map(F=>e(ae,{onClick:()=>k(F),sx:{width:56,height:56,alignSelf:"center",borderRadius:3,bgcolor:D(F)?"primary.main":"action.hover",color:D(F)?"var(--orb-on-primary)":"text.primary"},children:F.icon||(F.title||F.label||"?").slice(0,1).toUpperCase()},F.id))]})}):e(Ne,{elevation:0,className:o,sx:{width:y==="portrait"?"100%":320,p:1.25,borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:g?"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:l(ie,{spacing:1.25,sx:{flex:1,minHeight:0},children:[l(ie,{direction:"row",spacing:1,alignItems:"center",children:[e(Be,{value:S,onChange:F=>T(F.target.value),placeholder:f("navigation.searchPlaceholder"),size:"small",fullWidth:true,InputProps:{startAdornment:e(ld,{fontSize:"small",color:"action"})}}),y==="landscape"&&!t?e(ae,{onClick:r,sx:{bgcolor:"action.hover"},children:e(od,{})}):null]}),c,e("div",{sx:{flex:1,minHeight:0,overflowY:"auto",pr:.25},children:A.length>0?A.map(F=>R(F)):e(E,{sx:{p:2,fontSize:"0.88rem",color:"text.secondary",textAlign:"center"},children:f("navigation.noMatch")})}),p]})})};w();var pu=(t,r)=>{let o=r[t.id];if(t.render)return t.render(o,r);if(o==null||o==="")return "--";if(t.numeric){if(typeof o=="number")return o.toLocaleString();if(typeof o=="string"&&o.trim()!==""&&!Number.isNaN(Number(o)))return Number(o).toLocaleString()}return String(o)},Lh=t=>Qt__namespace.default.isValidElement(t)?e("div",{sx:{display:"inline-flex",alignItems:"center"},children:t}):e(E,{sx:{mt:.2,fontSize:"0.88rem",fontWeight:800},children:t}),Fh=(t,r)=>{let o=r[t.id];if(o==null||o==="")return "--";if(t.numeric){if(typeof o=="number")return o.toLocaleString();if(typeof o=="string"&&o.trim()!==""&&!Number.isNaN(Number(o)))return Number(o).toLocaleString()}return String(o)},Oh=({summaryRow:t,visibleColumns:r,columns:o})=>{let n=o.filter(a=>r.includes(a.id)&&t[a.id]!=="");return n.length===0?null:e(Ne,{elevation:0,sx:{p:1.5,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:l(ie,{spacing:1,children:[e(E,{sx:{fontSize:"0.82rem",fontWeight:800,color:"text.secondary"},children:"Summary"}),e("div",{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(132px, 1fr))",gap:1},children:n.map(a=>l(Ne,{elevation:0,sx:{p:1.1,borderRadius:3,border:"1px solid",borderColor:"divider"},children:[e(E,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:a.label}),e(E,{sx:{mt:.25,fontSize:"0.96rem",fontWeight:800},children:t[a.id]})]},`summary-${a.id}`))})]})})},Bh=t=>{let{t:r}=de(),o=ar(),{title:n,showToolbar:a=true,selectionMode:i,selected:s=[],onSelectionChange:c,actions:p,extraTools:u,fitContainer:d=false,fullWidth:f=false,maxHeight:b,loading:m=false,rowsPerPageOptions:v=[20,50,100,-1],onLayoutSave:y,filterConfig:g,rowKey:x,tableKey:h="default",graphReport:S,quickCreate:T,quickEdit:C,quickDelete:L,serviceUrl:A,orientation:I="auto",cardTitleField:N,cardSubtitleFields:M,toolbarSlot:k,emptyState:D,rowHeight:R="comfortable",cardActionSlot:F,renderCardFooter:z,onRowClick:K}=t,V=n||r("table.title.default"),q=Rr("(orientation: portrait)"),$=Rr(o.breakpoints.down("md")),X=I==="auto"?q||$?"portrait":"landscape":I,{columns:W,filterText:H,setFilterText:Q,visibleColumns:J,showSummary:ge,setShowSummary:se,summaryColumns:fe,grouping:xe,setGrouping:Ke,expandedGroups:ze,groupAnchorEl:Re,setGroupAnchorEl:Ve,summaryAnchorEl:Me,setSummaryAnchorEl:Ce,anchorEl:He,setAnchorEl:at,contextMenu:ft,sortedAndFilteredRows:et,summaryRow:re,visibleRows:$e,page:Ee,setPage:Le,rowsPerPage:lt,setRowsPerPage:Qe,totalDisplayCount:vt,setSelected:St,handleClick:Et,toggleSummaryColumn:Lt,handleExport:te,handleCloseContextMenu:rt,toggleColumnVisibility:Fe,toggleGroupExpand:le,handleExpandGroupRecursively:me,handleCollapseGroupRecursively:j,handleLayoutLoad:ke,handleVariantLoad:Te,handleLayoutSave:Ye,effectiveAppId:pt,currentLayoutData:ct,currentLayoutId:Ft,layoutIdToLoad:_t,graphReportOpen:yt,handleOpenGraphReport:bt,handleCloseGraphReport:yr}=an(t),Pt=S?.enabled??false,Ot=Pt&&(S?.interaction?.enabled??true),dt=li(),Bt=x||"id",Se=Qt__namespace.default.useMemo(()=>({borderRadius:999,fontWeight:700,borderColor:tt(o.palette.divider,ht()==="dark"?.55:.3),bgcolor:ht()==="dark"?tt(o.palette.common.white,.06):tt(o.palette.background.paper,.92),color:o.palette.text.primary,"& .orb-chip-label":{px:1.05}}),[o]),B=Qt__namespace.default.useMemo(()=>({...Se,borderColor:tt(o.palette.primary.main,ht()==="dark"?.42:.24),bgcolor:ht()==="dark"?tt(o.palette.primary.main,.16):tt(o.palette.primary.main,.08)}),[Se,o]),U=Qt__namespace.default.useMemo(()=>{let Z=new Set(s);return et.filter(Ae=>Z.has(Ae?.[Bt]))},[Bt,s,et]),ee=U.length===1?U[0]:null,Ie=!!T?.enabled,be=!!C?.enabled,De=!!L?.enabled,_e=T?.fields,je=T?.excludeFields||[],Ue=T?.initialValues||{},xt=C?.fields,At=C?.excludeFields||[],wt=C?.editableFields||[],Ct=C?.nonEditableFields||[],O=C?.primaryKeys?.length?C.primaryKeys:[Bt],[Y,ue]=Qt__namespace.default.useState(false),[ye,Je]=Qt__namespace.default.useState(false),[qe,It]=Qt__namespace.default.useState({}),[gt,ut]=Qt__namespace.default.useState(false),[kt,tr]=Qt__namespace.default.useState(false),[zt,Xt]=Qt__namespace.default.useState({}),[Ht,Ut]=Qt__namespace.default.useState(false),[Wt,Jt]=Qt__namespace.default.useState(false),rr=m||ye||kt||Wt,ur=Qt__namespace.default.useMemo(()=>{let Z=[...W];if(Array.isArray(_e)&&_e.length>0){let Ae=new Set(_e);Z=Z.filter(Ze=>Ae.has(Ze.id));}if(je.length>0){let Ae=new Set(je);Z=Z.filter(Ze=>!Ae.has(Ze.id));}return Z.filter(Ae=>!!Ae?.id)},[W,je,_e]),Tr=Qt__namespace.default.useMemo(()=>{let Z=[...W];if(Array.isArray(xt)&&xt.length>0){let Ae=new Set(xt);Z=Z.filter(Ze=>Ae.has(Ze.id));}if(At.length>0){let Ae=new Set(At);Z=Z.filter(Ze=>!Ae.has(Ze.id));}return Z.filter(Ae=>!!Ae?.id)},[W,At,xt]),Pr=Qt__namespace.default.useMemo(()=>new Set(O),[O]),jr=Qt__namespace.default.useMemo(()=>new Set(wt),[wt]),br=Qt__namespace.default.useMemo(()=>new Set(Ct),[Ct]),Er=Qt__namespace.default.useCallback(Z=>jr.size>0?jr.has(Z):!(br.has(Z)||Pr.has(Z)),[jr,br,Pr]);Qt__namespace.default.useEffect(()=>{!yt&&dt.hasActiveFilters&&dt.clearAll();},[dt,yt]);let Bo=()=>{let Z={};ur.forEach(Ae=>{Z[Ae.id]=Ue[Ae.id]??"";}),It(Z),ue(true);},zo=(Z,Ae)=>{It(Ze=>({...Ze,[Z]:Ae}));},ko=async()=>{if(!T?.onSubmit){ue(false);return}try{Je(!0),await T.onSubmit(qe),ue(!1);}finally{Je(false);}},Vo=()=>{if(!ee)return;let Z={};Tr.forEach(Ze=>{Z[Ze.id]=ee[Ze.id]??"";});let Ae=C?.getInitialValues?{...Z,...C.getInitialValues(ee)}:Z;Xt(Ae),ut(true);},Ho=(Z,Ae)=>{Xt(Ze=>({...Ze,[Z]:Ae}));},Ir=async()=>{if(ee){if(!C?.onSubmit){ut(false);return}try{tr(!0),await C.onSubmit(zt,ee),ut(!1);}finally{tr(false);}}},To=()=>{U.length!==0&&Ut(true);},Wo=async()=>{if(U.length===0){Ut(false);return}if(!L?.onConfirm){Ut(false),St([]),c?.([]);return}try{Jt(!0),await L.onConfirm(U),Ut(!1),St([]),c?.([]);}finally{Jt(false);}},$r=et,{fieldMapping:Jr}=tn({rows:$r,config:{...S,title:S?.title||`${V} ${r("graph.reportTitle")}`}}),xn=Qt__namespace.default.useMemo(()=>Ot?dt.applyRows($r,Jr):$r,[Jr,dt,Ot,$r]),{model:Po}=tn({rows:xn,config:{...S,title:S?.title||`${V} ${r("graph.reportTitle")}`,fieldMapping:Jr}}),P=Po.table.columns.map(Z=>({id:Z.id,label:Z.label,align:Z.align||"left",minWidth:120,numeric:Z.align==="right"})),G=pt?e(nn,{appId:pt,tableKey:h,currentLayoutData:ct,onLayoutLoad:ke,targetLayoutId:_t,activeLayoutId:Ft,serviceUrl:A??g?.serviceUrl}):null,_=W.filter(Z=>J.includes(Z.id)),ce=_.find(Z=>Z.id===N)||_[0],Oe=M?.map(Z=>_.find(Ae=>Ae.id===Z)).filter(Boolean)||_.filter(Z=>Z.id!==ce?.id).slice(0,X==="portrait"?2:3),ot=_.filter(Z=>Z.id!==ce?.id&&!Oe.some(Ae=>Ae.id===Z.id)),We=[k,u].filter(Boolean),oe=l(jsxRuntime.Fragment,{children:[e(Jo,{groupAnchorEl:Re,setGroupAnchorEl:Ve,grouping:xe,setGrouping:Ke,columns:W}),e(en,{anchorEl:He,setAnchorEl:at,columns:W,visibleColumns:J,toggleColumnVisibility:Fe}),e(ei,{anchorEl:Me,setAnchorEl:Ce,showSummary:ge,setShowSummary:se,columns:W,summaryColumns:fe,toggleSummaryColumn:Lt}),e(ti,{contextMenu:ft,handleCloseContextMenu:rt,columns:W,visibleColumns:J,toggleColumnVisibility:Fe})]}),pe=(Z,Ae,Ze)=>{let Pe=s.includes(Ae),Xe=X==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(140px, 1fr))",Rt=Ze%2===0?tt(o.palette.primary.main,ht()==="dark"?.09:.04):tt(o.palette.primary.main,ht()==="dark"?.05:.022),$o=tt(o.palette.divider,.22);return e(Ne,{elevation:0,onClick:()=>{Et({},Z),K?.(Z);},sx:{p:R==="compact"?1.25:1.5,borderRadius:4,border:"0.5px solid",borderColor:Pe?tt(o.palette.primary.main,.38):$o,background:Pe?`linear-gradient(135deg, ${tt(o.palette.primary.main,.13)}, ${tt(o.palette.primary.main,.06)})`:`linear-gradient(135deg, ${Rt}, ${tt(o.palette.primary.main,.015)})`,boxShadow:Pe?`0 12px 30px ${tt(o.palette.primary.main,.2)}`:`0 3px 10px ${tt(o.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:Pe?o.palette.primary.main:Ze%2===0?tt(o.palette.primary.main,.26):tt(o.palette.text.primary,.16)},"&:hover":{boxShadow:`0 10px 20px ${tt(o.palette.primary.main,.12)}`,transform:"translateY(-1px)"},"&:active":{transform:"scale(0.995)"}},children:l(ie,{spacing:1.25,children:[l(ie,{direction:"row",spacing:1.25,alignItems:"flex-start",children:[i?e(Dt,{checked:Pe,onClick:xr=>xr.stopPropagation(),onChange:()=>Et({},Z),sx:{mt:-0.6,ml:-0.6}}):null,l("div",{sx:{flex:1,minWidth:0},children:[ce?e(E,{sx:{fontSize:"1rem",fontWeight:900,lineHeight:1.25},children:pu(ce,Z)}):null,Oe.length>0?e(ie,{direction:"row",spacing:.75,useFlexGap:true,flexWrap:"wrap",sx:{mt:.75},children:Oe.map(xr=>e(Tt,{label:`${xr.label}: ${Fh(xr,Z)}`,size:"small",variant:"outlined",sx:Se},`${Ae}-${xr.id}`))}):null]}),F?e("div",{onClick:xr=>xr.stopPropagation(),children:F(Z)}):null]}),ot.length>0?e("div",{sx:{display:"grid",gridTemplateColumns:Xe,gap:1},children:ot.map(xr=>l(Ne,{elevation:0,sx:{p:1,borderRadius:3,bgcolor:ht()==="dark"?tt(o.palette.background.default,.7):tt(o.palette.background.paper,.92),border:"0.1px solid",borderColor:tt(o.palette.divider,.24)},children:[e(E,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:xr.label}),Lh(pu(xr,Z))]},`${Ae}-${xr.id}-detail`))}):null,z?l(jsxRuntime.Fragment,{children:[e(Nt,{}),e("div",{onClick:xr=>xr.stopPropagation(),children:z(Z)})]}):null]})},Ae)};return l("div",{sx:{width:f?"100%":"auto",mb:d?0:2,...d?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[g?e("div",{sx:{mb:2},children:e(au,{...g,onVariantLoad:Z=>{Te(Z),g.onVariantLoad?.(Z);},appId:g.appId,tableKey:h,currentLayout:[{tableKey:h,layoutData:ct}],currentLayoutId:Ft,layoutRefs:[{tableKey:h,layoutId:Ft}],variantService:g.variantService,serviceUrl:A??g.serviceUrl,touchMode:X==="portrait"?"expanded":"comfortable"})}):null,l(Ne,{sx:{width:f?"100%":"auto",mb:d?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",bgcolor:"transparent",backgroundImage:"none",boxShadow:"none","&::before":rr?{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"}},...b?{height:b}:d?{flex:1,minHeight:0,height:"100%"}:{}},children:[a?e("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:e(Za,{filterText:H,setFilterText:Q,onRowsPerPageChange:Qe,rowsPerPage:lt,rowsPerPageOptions:v,page:Ee,count:vt,onPageChange:Le,actions:p,extraTools:We,grouping:xe,setGroupAnchorEl:Ve,showSummary:ge,setShowSummary:se,setAnchorEl:at,setSummaryAnchorEl:Ce,handleExport:te,showCreateButton:Ie,onOpenCreateDialog:Bo,showEditButton:be,onOpenEditDialog:Vo,editDisabled:U.length!==1,showDeleteButton:De,onOpenDeleteConfirm:To,deleteDisabled:U.length===0,onLayoutSave:y||g?.variantService&&g?.appId?Ye:void 0,loading:m,layoutManager:G,onOpenGraphReport:Pt?bt:void 0})}):null,e("div",{sx:{flex:1,minHeight:0,overflow:"auto",p:1.5},children:l(ie,{spacing:1.25,children:[$e.length===0&&!m?D||e(Ne,{elevation:0,sx:{p:4,borderRadius:4,border:"1px dashed",borderColor:"divider",textAlign:"center"},children:e(E,{sx:{fontSize:"0.92rem",color:"text.secondary"},children:r("common.noData")})}):null,$e.map((Z,Ae)=>{if(Z.type==="group"){let Xe=ze.has(Z.id);return e(Ne,{elevation:0,sx:{borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:l("div",{component:"button",type:"button",onClick:()=>le(Z.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?e(Xo,{}):e(Ba,{}),l("div",{sx:{flex:1,minWidth:0},children:[l(E,{sx:{fontSize:"0.94rem",fontWeight:800},children:[Z.field,": ",Z.value]}),l(E,{sx:{mt:.2,fontSize:"0.76rem",color:"text.secondary"},children:[Z.count," records"]})]}),xe.length>1&&Z.level<xe.length-1?l(ie,{direction:"row",spacing:.5,children:[e(Tt,{size:"small",label:r("table.group.expandAll"),onClick:Rt=>{Rt.stopPropagation(),me(Z.id);},sx:B}),e(Tt,{size:"small",label:r("table.group.collapseAll"),onClick:Rt=>{Rt.stopPropagation(),j(Z.id);},sx:B})]}):null]})},Z.id)}let Ze=Z.data||Z,Pe=Z.id||Ze[Bt]||Ae;return pe(Ze,Pe,Ae)}),ge?e(Oh,{summaryRow:re,visibleColumns:J,columns:W}):null,m?e(E,{sx:{py:1,fontSize:"0.84rem",color:"text.secondary",textAlign:"center"},children:r("common.loading")}):null]})})]}),Ie?l(Vt,{open:Y,onClose:()=>!ye&&ue(false),fullWidth:true,maxWidth:"sm",children:[e("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:800},children:T?.title||r("quickCreate.createWithTitle",{title:V})}),e("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:l("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[ur.map(Z=>{let Ae=Z.type==="number"||Z.numeric?"number":Z.type==="date"?"date":"text";return e(Be,{label:Z.label||Z.id,value:qe[Z.id]??"",onChange:Ze=>zo(Z.id,Ze.target.value),type:Ae,fullWidth:true,InputLabelProps:{shrink:Ae==="date"?true:void 0}},`quick-create-${Z.id}`)}),T?.description?e(Kr,{severity:"info",children:T.description}):null]})}),l("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[e(ve,{onClick:()=>ue(false),disabled:ye,children:T?.cancelLabel||r("common.cancel")}),e(ve,{onClick:ko,variant:"contained",disabled:ye,children:T?.submitLabel||r("common.save")})]})]}):null,be?l(Vt,{open:gt,onClose:()=>!kt&&ut(false),fullWidth:true,maxWidth:"sm",children:[e("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:800},children:C?.title||r("quickEdit.editWithTitle",{title:V})}),e("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:l("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Tr.map(Z=>{let Ae=Z.type==="number"||Z.numeric?"number":Z.type==="date"?"date":"text";return e(Be,{label:Z.label||Z.id,value:zt[Z.id]??"",onChange:Ze=>Ho(Z.id,Ze.target.value),type:Ae,disabled:!Er(Z.id),fullWidth:true,InputLabelProps:{shrink:Ae==="date"?true:void 0}},`quick-edit-${Z.id}`)}),C?.description?e(Kr,{severity:"info",children:C.description}):null]})}),l("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[e(ve,{onClick:()=>ut(false),disabled:kt,children:C?.cancelLabel||r("common.cancel")}),e(ve,{onClick:Ir,variant:"contained",disabled:kt||!ee,children:C?.submitLabel||r("common.save")})]})]}):null,De?e(On,{open:Ht,type:"warning",title:L?.title||r("quickDelete.confirmTitle"),message:L?.message||(U.length>1?r("quickDelete.confirmMessageMultiple",{count:U.length}):r("quickDelete.confirmMessageSingle")),confirmText:L?.confirmText||r("common.delete"),cancelText:L?.cancelText||r("common.cancel"),onClose:()=>!Wt&&Ut(false),onConfirm:Wo}):null,oe,Pt?e(ii,{open:yt,onClose:yr,model:Po,aiAssistant:S?.aiAssistant,interaction:Ot?{enabled:true,filters:dt.filters,fieldMapping:Jr,onPrimaryDimensionClick:Z=>dt.setFilter("primaryDimension",Z),onSecondaryDimensionClick:Z=>dt.setFilter("secondaryDimension",Z),onStatusClick:Z=>dt.setFilter("status",Z),onClearFilter:dt.clearFilter,onClearAll:dt.clearAll}:void 0,tableContent:e(Bh,{appId:pt||"graph-report-internal",title:r("graph.dataBody"),columns:P,rows:Po.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false},showSummary:false})}):null]})};w();var GE=({appTitle:t,children:r,menuData:o=[],workloadItems:n=[],workloadSelectedId:a,showNavigation:i=true,showWorkloadNav:s=true,orientation:c="auto",logo:p,headerSlot:u,actionSlot:d,portraitBottomSlot:f,contentSx:b,containerSx:m,user:v,onSearch:y,onSearchAdd:g,defaultNavigationOpen:x,navOpen:h,onNavOpenChange:S,onWorkloadSelect:T,locale:C="en",localeLabel:L,localeOptions:A,onLocaleChange:I,onUserSetting:N,onUserLogout:M,userMenuItems:k,leftHeaderSlot:D,rightHeaderSlot:R})=>{let F="orbcafe:page-layout-mode",[z,K]=Qt.useState("system"),[V,q]=Qt.useState("light"),[$,X]=Qt.useState(false),[W,H]=Qt.useState(false),Q=z==="system"?W?V:"light":z;Qt.useEffect(()=>{X(true);},[]),Qt.useEffect(()=>{try{let ft=window.localStorage.getItem(F);(ft==="light"||ft==="dark"||ft==="system")&&K(ft);}catch{}H(true);let He=window.matchMedia("(prefers-color-scheme: dark)"),at=()=>{q(He.matches?"dark":"light");};return at(),He.addEventListener("change",at),()=>He.removeEventListener("change",at)},[]),Qt.useEffect(()=>{if(W)try{window.localStorage.setItem(F,z);}catch{}},[W,z]),Qt.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 J=Rr("(orientation: portrait)"),ge=Rr("(max-width: 899.95px)"),se=c==="auto"?!$||J||ge?"portrait":"landscape":c,[fe,xe]=Qt.useState({landscape:x??true,portrait:false}),Ke=fe[se],ze=h??Ke,Re=He=>{h===void 0&&xe(at=>({...at,[se]:He})),S?.(He);},Ve=l(ie,{direction:"row",spacing:1,alignItems:"center",children:[!$||i&&se==="portrait"?e(ae,{onClick:()=>Re(!ze),sx:{bgcolor:"action.hover"},children:e(Ga,{})}):null,D]}),Me=l(ie,{direction:"row",spacing:1,alignItems:"center",children:[d,R]}),Ce=e(du,{collapsed:se==="landscape"?!ze:false,onToggle:()=>Re(!ze),menuData:o,orientation:se,colorMode:Q,maxHeight:se==="landscape"?900:void 0});return e(Sn,{mode:z,children:e(Ta,{locale:C,children:l("div",{sx:[He=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:He.palette.mode==="dark"?"linear-gradient(180deg, var(--orb-canvas) 0%, var(--orb-surface) 55%, var(--orb-surface-2) 100%)":He.palette.background.default}),...Array.isArray(m)?m:[m]],children:[e(wi,{appTitle:t,logo:p===void 0?null:p,mode:z,onToggleMode:()=>K(He=>He==="system"?"dark":He==="dark"?"light":"system"),locale:C,localeLabel:L,localeOptions:A,onLocaleChange:I,user:v,onUserSetting:N,onUserLogout:M,userMenuItems:k,onSearch:y,onSearchAdd:g,leftSlot:Ve,rightSlot:Me}),u?e("div",{sx:{px:{xs:2,md:3},py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:u}):null,l("div",{sx:{flex:1,minHeight:0,display:"flex",position:"relative"},children:[$&&i&&se==="landscape"?e("div",{sx:{p:1.5,pr:0,flexShrink:0},children:Ce}):null,!$||i&&se==="portrait"?e(Ac,{open:ze,onClose:()=>Re(false),PaperProps:{sx:{width:"min(88vw, 360px)",p:1.25,bgcolor:"transparent",boxShadow:"none"}},children:Ce}):null,e("div",{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...b},children:l(ie,{spacing:1.5,children:[s&&n.length>0?e(iu,{items:n,selectedId:a,orientation:se,onItemSelect:T}):null,e(Ne,{elevation:0,sx:{flex:1,minHeight:se==="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:r})]})})]}),se==="portrait"&&f?l(jsxRuntime.Fragment,{children:[e(Nt,{}),e("div",{sx:{p:1.5},children:f})]}):null]})})})};w();var fu=Kh__default.default(()=>Promise.resolve().then(()=>(gu(),mu)).then(t=>t.COrbCanvas),{ssr:false,loading:()=>e("div",{className:"h-full w-full bg-transparent"})});function tl({isRecording:t}){return e(framerMotion.AnimatePresence,{children:t&&e(framerMotion.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:l("div",{className:"relative flex h-full w-full items-center justify-center",children:[e("div",{className:"absolute inset-0",children:e(fu,{hue:0,hoverIntensity:.5,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})}),e("div",{className:"relative z-10 h-full w-1/3 mix-blend-overlay opacity-80",children:e(fu,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var QE=tl;w();var hu=Qt.createContext(null);function Jh(t){if(!t||!(t instanceof HTMLElement))return false;let r=t.tagName;return !!(r==="INPUT"||r==="TEXTAREA"||r==="SELECT"||t.isContentEditable||t.closest('[data-voice-hotkey-ignore="true"]'))}function ev({children:t,onVoiceSubmit:r,onVoicePartial:o,onVoiceError:n,longPressMs:a=200,disableSpaceTrigger:i=false,ignoreWhenFocusedInput:s=true,renderOverlay:c=true,wsUrl:p,silenceThresholdMs:u,minVolumeRms:d}){let[f,b]=Qt.useState(false),[m,v]=Qt.useState(false),y=Qt.useRef(null),g=Qt.useRef(false),x=Qt.useRef(false),h=Qt.useCallback(()=>{x.current=false,b(false);},[]),{isRecording:S,startRecording:T,stopRecording:C}=pn({wsUrl:p,silenceThresholdMs:u,minVolumeRms:d,onTextUpdate:N=>{o?.(N);},onComplete:async N=>{try{N.trim()&&(v(!0),await r(N.trim()));}catch(M){let k=M instanceof Error?M.message:"Failed to process voice command";n?.(k);}finally{v(!1),h();}},onError:N=>{n?.(N),v(!1),g.current||h();}}),L=Qt.useCallback(async()=>{x.current=false,await T();},[T]),A=Qt.useCallback(()=>{C();},[C]);Qt.useEffect(()=>{if(i)return;let N=k=>{k.isComposing||(k.code==="Space"||k.key===" ")&&(g.current||k.repeat||s&&Jh(document.activeElement)||(g.current=true,k.preventDefault(),y.current=setTimeout(()=>{x.current=true,b(true),T();},a)));},M=k=>{(k.code==="Space"||k.key===" ")&&(y.current&&(clearTimeout(y.current),y.current=null),g.current=false,x.current&&(k.preventDefault(),b(false),C()));};return window.addEventListener("keydown",N),window.addEventListener("keyup",M),()=>{window.removeEventListener("keydown",N),window.removeEventListener("keyup",M),y.current&&(clearTimeout(y.current),y.current=null);}},[i,s,a,T,C]);let I=Qt.useMemo(()=>({isRecording:S,isHotkeyRecording:f,isSubmitting:m,startRecording:L,stopRecording:A}),[f,S,m,L,A]);return l(hu.Provider,{value:I,children:[c?e(tl,{isRecording:f}):null,t]})}function tv(){let t=Qt.useContext(hu);if(!t)throw new Error("useAINav must be used within CAINavProvider");return t}var oL=ev,nL=tv;function mt(...t){return tailwindMerge.twMerge(clsx.clsx(t))}w();var iv=({content:t,theme:r="light",size:o="base",defaultExpanded:n=false})=>{let[a,i]=Qt.useState(n),s=Qt.useMemo(()=>`${(o==="sm"?14:o==="lg"?18:16)-2}px`,[o]);return l("div",{className:`my-6 rounded-lg overflow-hidden transition-all duration-200 ${r==="dark"?"bg-[var(--orb-surface-2)]":"bg-[var(--orb-canvas)]"}`,style:{border:"0.5px solid var(--orb-border)"},children:[l("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:[l("span",{className:"flex items-center",children:[e(pa,{className:"mr-2 h-4 w-4"}),e("span",{className:"font-medium text-[var(--orb-fg)]",style:{fontSize:o==="sm"?"14px":o==="lg"?"18px":"16px"},children:"\u601D\u8003\u8FC7\u7A0B"})]}),e(Io,{className:`w-4 h-4 transition-transform duration-200 ${a?"rotate-180":""} text-[var(--orb-muted)]`})]}),a&&e("div",{className:"p-4 whitespace-pre-wrap italic font-light text-[var(--orb-muted)]",style:{fontSize:s,lineHeight:"1.3 !important"},children:t})]})},vu=iv;w();var pv=({content:t,language:r="text",isStreaming:o=false,className:n=""})=>{let a=hr(),[i,s]=Qt.useState(false),c=async()=>{try{await navigator.clipboard.writeText(t),s(!0),setTimeout(()=>s(!1),2e3);}catch(u){console.error("\u590D\u5236\u5931\u8D25:",u);}},p=a==="dark"?prism.oneDark:prism.oneLight;return l("div",{className:mt("rounded-lg overflow-hidden border border-[var(--orb-border)] my-4",n),children:[l("div",{className:"flex items-center justify-between px-4 py-2 bg-[var(--orb-surface)] border-b border-[var(--orb-border)]",children:[e("span",{className:"text-xs font-medium text-[var(--orb-muted)] uppercase",children:r}),e("button",{onClick:c,className:"p-1 hover:bg-[var(--orb-hover)] rounded transition-colors",disabled:o,title:i?"Copied":"Copy code",children:i?e(Go,{size:14,className:"text-[var(--orb-status-success)]"}):e(El,{size:14,className:"text-[var(--orb-muted)]"})})]}),e("div",{className:"text-sm",children:e(reactSyntaxHighlighter.Prism,{language:r,style:p,customStyle:{margin:0,padding:"16px",fontSize:"14px",lineHeight:"1.5",backgroundColor:a==="dark"?"var(--orb-surface-2)":"var(--orb-canvas)"},wrapLongLines:true,children:t})})]})},yu=pv;w();var gv=({content:t,isLoading:r,className:o="",style:n})=>{let a=Qt.useRef(null),[i,s]=Qt.useState(false),[c,p]=Qt.useState(null),u=hr();return Qt.useEffect(()=>{let d=false,f=async()=>{if(!(!t.trim()||!a.current)){s(true),p(null);try{Cu__default.default.initialize({startOnLoad:!1,theme:u==="dark"?"dark":"default",securityLevel:"loose",fontFamily:"inherit",flowchart:{htmlLabels:!1}});let m=`mermaid-${Math.random().toString(36).substr(2,9)}`,v=t.replace(/```mermaid\n?|\n?```/g,"").trim(),{svg:y,bindFunctions:g}=await Cu__default.default.render(m,v);!d&&a.current&&(a.current.innerHTML=y,g?.(a.current));}catch(m){if(d)return;console.error("Mermaid render failed:",m),p(m instanceof Error?m.message:"Render failed");}finally{d||s(false);}}},b=setTimeout(()=>{f();},100);return ()=>{d=true,clearTimeout(b);}},[t,u]),l("div",{className:`mermaid-block ${o}`,style:n,children:[(r||i)&&l("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:[e("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-b-2 border-[var(--orb-primary)]"}),e("span",{className:"text-sm text-[var(--orb-muted)]",children:"Generating Diagram..."})]}),c&&l("div",{className:"overflow-auto 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-4 text-sm text-[var(--orb-status-error)]",children:[e("p",{className:"mb-2 font-semibold",children:"Mermaid Error:"}),e("pre",{children:c}),e("pre",{className:"mt-4 text-xs text-[var(--orb-muted)]",children:t})]}),e("div",{ref:a,className:`overflow-x-auto ${r||i||c?"hidden":""}`})]})},Su=gv;w();var fv=({title:t="\u53D1\u751F\u9519\u8BEF",content:r,errorCode:o,stack:n,icon:a,closable:i=true,onClose:s,onRetry:c,className:p="",...u})=>{let[d,f]=Qt.useState(false),[b,m]=Qt.useState(false),v=async()=>{if(c){m(true);try{await c();}catch(y){console.error("\u91CD\u8BD5\u5931\u8D25:",y);}finally{m(false);}}};return l("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 ${p}`,...u,children:[l("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:[e("div",{className:"flex-shrink-0 mr-3 text-[var(--orb-status-error)] mt-0.5",children:a||e(Dl,{className:"w-5 h-5"})}),l("div",{className:"flex-1 min-w-0",children:[l("div",{className:"flex items-center space-x-2 mb-1",children:[e("h4",{className:"text-base font-semibold text-[var(--orb-fg)]",children:t}),o&&e("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:o})]}),r&&e("div",{className:"text-sm text-[var(--orb-muted)] mb-3 leading-relaxed",children:typeof r=="string"?e("p",{className:"whitespace-pre-wrap",children:r}):r}),(c||n)&&l("div",{className:"flex items-center space-x-4 mt-2",children:[c&&l("button",{onClick:v,disabled:b,className:"flex items-center text-xs font-medium text-[var(--orb-status-error)] hover:opacity-80 transition-colors disabled:opacity-50",children:[e(Ul,{className:`w-3.5 h-3.5 mr-1.5 ${b?"animate-spin":""}`}),b?"\u91CD\u8BD5\u4E2D...":"\u91CD\u8BD5"]}),n&&l("button",{onClick:()=>f(!d),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:[d?e(Io,{className:"w-3.5 h-3.5 mr-1"}):e(Lr,{className:"w-3.5 h-3.5 mr-1"}),d?"\u9690\u85CF\u8BE6\u60C5":"\u67E5\u770B\u8BE6\u60C5"]})]})]}),i&&s&&e("button",{onClick:s,className:"flex-shrink-0 ml-3 text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors self-start",children:e(or,{className:"w-4 h-4"})})]}),n&&d&&e("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] p-3 border-t border-[var(--orb-border)]",children:e("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})})]})},zi=fv;w();var bv=({title:t="\u8B66\u544A",content:r,warningType:o,severity:n="warning",warnings:a=[],icon:i,closable:s=true,onClose:c,onConfirm:p,actionText:u,className:d="",...f})=>{let b=()=>{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)]"}}},m=()=>{switch(n){case "info":return e(da,{className:"w-5 h-5"});case "error":return e(xa,{className:"w-5 h-5"});case "success":return e(sa,{className:"w-5 h-5"});default:return e(Al,{className:"w-5 h-5"})}},v=b();return l("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}`,...f,children:[l("div",{className:`flex p-4 border-l-4 ${v.borderLeftColor} ${v.bgColor}`,children:[e("div",{className:`flex-shrink-0 mr-3 ${v.iconColor}`,children:i||m()}),l("div",{className:"flex-1 min-w-0",children:[l("div",{className:"flex items-center justify-between mb-1",children:[e("h4",{className:"text-base font-semibold text-[var(--orb-fg)]",children:t}),o&&e("span",{className:"text-xs font-medium px-2 py-0.5 rounded-full bg-[var(--orb-surface)] text-[var(--orb-muted)]",children:o})]}),r&&e("div",{className:"text-sm text-[var(--orb-muted)] mb-2",children:r}),a&&a.length>0&&e("ul",{className:"mt-2 space-y-1",children:a.map((y,g)=>l("li",{className:"flex items-start text-sm text-[var(--orb-muted)]",children:[e("span",{className:"mr-2 mt-1.5 w-1 h-1 rounded-full bg-[var(--orb-muted)] flex-shrink-0"}),e("span",{children:y})]},g))})]}),s&&c&&e("button",{onClick:c,className:"flex-shrink-0 ml-3 text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors",children:e(or,{className:"w-4 h-4"})})]}),p&&e("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:e("button",{onClick:p,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:u||"\u786E\u8BA4"})})]})},Vi=bv;w();var hv=({title:t="\u76F8\u5173\u63A8\u8350",content:r,suggestions:o,onSuggestionClick:n,maxDisplay:a=5,icon:i,closable:s=false,onClose:c,className:p="",...u})=>{let[d,f]=Qt.useState(false),[b,m]=Qt.useState(""),[v,y]=Qt.useState(false),g=Qt.useMemo(()=>b.trim()?o.filter(S=>S.toLowerCase().includes(b.toLowerCase())):o,[o,b]),x=Qt.useMemo(()=>d?g:g.slice(0,a),[g,d,a]),h=S=>{n?.(S);};return !o||o.length===0?null:l("div",{className:`w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${p}`,...u,children:[l("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--orb-border)] bg-[var(--orb-p50)]",children:[l("div",{className:"flex items-center space-x-2.5",children:[e("div",{className:"text-[var(--orb-primary)] flex-shrink-0",children:i||e(pa,{className:"w-5 h-5"})}),l("div",{className:"flex flex-col",children:[e("h4",{className:"text-sm font-semibold text-[var(--orb-fg)] leading-tight",children:t}),r&&e("span",{className:"text-xs text-[var(--orb-muted)] mt-0.5",children:r})]})]}),l("div",{className:"flex items-center space-x-1",children:[o.length>3&&e("button",{onClick:()=>y(!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:e(Fr,{className:"w-4 h-4"})}),s&&c&&e("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:e(or,{className:"w-4 h-4"})})]})]}),v&&e("div",{className:"px-4 py-2 border-b border-[var(--orb-border)] bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)]",children:l("div",{className:"relative",children:[e("input",{type:"text",placeholder:"\u641C\u7D22\u76F8\u5173\u95EE\u9898...",value:b,onChange:S=>m(S.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}),e(Fr,{className:"absolute left-2.5 top-2 w-3.5 h-3.5 text-[var(--orb-muted)]"})]})}),l("div",{className:"p-2",children:[e("ul",{className:"space-y-1",children:x.map((S,T)=>e("li",{children:l("button",{onClick:()=>h(S),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:[e("span",{children:S}),e(Lr,{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"})]})},T))}),g.length>a&&e("button",{onClick:()=>f(!d),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:d?"\u6536\u8D77":`\u67E5\u770B\u5168\u90E8 (${g.length})`}),g.length===0&&b&&e("div",{className:"text-center py-4 text-sm text-[var(--orb-muted)]",children:"\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u5EFA\u8BAE"})]})]})},Hi=hv;w();var vv=({title:t,content:r,toolName:o,parameters:n,result:a,status:i,duration:s,icon:c,closable:p=false,onClose:u,onAction:d,actionText:f,className:b="",...m})=>{let[v,y]=Qt.useState(false),[g,x]=Qt.useState(true),h=()=>{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"}}},S=()=>{switch(i){case "pending":return e(Hl,{className:"w-5 h-5 animate-spin"});case "error":return e(xa,{className:"w-5 h-5"});default:return e(sa,{className:"w-5 h-5"})}},T=A=>A?A<1e3?`${A}ms`:`${(A/1e3).toFixed(2)}s`:"",C=h(),L=t||o||"\u5DE5\u5177\u8C03\u7528";return l("div",{className:`w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${b}`,...m,children:[l("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:[l("div",{className:"flex items-center space-x-3",children:[e("div",{className:`flex-shrink-0 ${C.iconColor}`,children:c||S()}),l("div",{children:[l("div",{className:"flex items-center space-x-2",children:[e("h4",{className:"text-sm font-semibold text-[var(--orb-fg)]",children:L}),e("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${C.badgeBg} ${C.badgeText}`,children:C.label})]}),o&&t&&l("div",{className:"text-xs text-[var(--orb-muted)] flex items-center mt-0.5",children:[e(is,{className:"w-3 h-3 mr-1"}),o]})]})]}),l("div",{className:"flex items-center space-x-2 text-xs text-[var(--orb-muted)]",children:[s&&l("div",{className:"flex items-center bg-[var(--orb-surface)] px-2 py-1 rounded",children:[e(Ll,{className:"w-3 h-3 mr-1"}),T(s)]}),p&&u&&e("button",{onClick:u,className:"text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors p-1 rounded",children:e(or,{className:"w-4 h-4"})})]})]}),l("div",{className:"p-4",children:[r&&e("div",{className:"text-sm text-[var(--orb-muted)] mb-4 leading-relaxed",children:r}),n&&l("div",{className:"mb-3",children:[l("button",{onClick:()=>y(!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?e(Io,{className:"w-3.5 h-3.5 mr-1"}):e(Lr,{className:"w-3.5 h-3.5 mr-1"}),e("div",{className:"w-3.5 h-3.5 mr-1.5"}),"\u8F93\u5165\u53C2\u6570"]}),v&&e("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)] overflow-hidden",children:e("pre",{className:"p-3 text-xs font-mono text-[var(--orb-muted)] overflow-x-auto",children:JSON.stringify(n,null,2)})})]}),a&&l("div",{children:[l("button",{onClick:()=>x(!g),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?e(Io,{className:"w-3.5 h-3.5 mr-1"}):e(Lr,{className:"w-3.5 h-3.5 mr-1"}),e(is,{className:"w-3.5 h-3.5 mr-1.5"}),"\u6267\u884C\u7ED3\u679C"]}),g&&e("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)] overflow-hidden",children:e("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)})})]}),d&&e("div",{className:"mt-3 pt-3 border-t border-[var(--orb-border)] flex justify-end",children:e("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:f||"\u6267\u884C\u64CD\u4F5C"})})]})]})},Wi=vv;w();var xv=({data:t})=>{if(!t)return null;let r=Qt.useMemo(()=>{let o=[],n=[],a="\u6570\u636E\u8868\u683C";return Array.isArray(t)?(o=t,o.length>0&&(n=Object.keys(o[0]).map(i=>({id:i,label:i.charAt(0).toUpperCase()+i.slice(1),numeric:typeof o[0][i]=="number"})))):typeof t=="object"&&(a=t.title||a,o=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})):o.length>0&&(n=Object.keys(o[0]).map(s=>({id:s,label:s,numeric:typeof o[0][s]=="number"})))),o=o.map((i,s)=>({...i,id:i.id||`row_${s}`})),{title:a,columns:n,rows:o}},[t]);return r.rows.length===0?e("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"}):e("div",{className:"w-full my-4",children:e(Xr,{appId:"agent-ui-table-card",title:r.title,columns:r.columns,rows:r.rows,count:r.rows.length,rowKey:"id",fitContainer:false,maxHeight:"500px",rowsPerPage:10,rowsPerPageOptions:[5,10,20,50]})})},$i=xv;w();var Cv=({title:t,subtitle:r,data:o,type:n,config:a={}})=>{let i=()=>{switch(n){case "bar-chart-card":return e(os,{className:"w-4 h-4 text-[var(--orb-chart-1)]"});case "line-chart-card":return e(Vl,{className:"w-4 h-4 text-[var(--orb-chart-positive)]"});case "pie-chart-card":return e(_l,{className:"w-4 h-4 text-[var(--orb-chart-2)]"});case "combo-chart-card":return e(Ml,{className:"w-4 h-4 text-[var(--orb-chart-5)]"});case "heatmap-chart-card":return e(zl,{className:"w-4 h-4 text-[var(--orb-chart-negative)]"});case "fishbone-chart-card":return e(Bl,{className:"w-4 h-4 text-[var(--orb-chart-4)]"});case "waterfall-chart-card":return e(Ql,{className:"w-4 h-4 text-[var(--orb-chart-6)]"});case "google-map-card":return e(Tn,{className:"w-4 h-4 text-[var(--orb-status-primary)]"});case "amap-card":return e($l,{className:"w-4 h-4 text-[var(--orb-status-primary)]"});default:return e(os,{className:"w-4 h-4"})}},s=()=>{if(!o&&n!=="google-map-card"&&n!=="amap-card")return e("div",{className:"text-[var(--orb-muted)] text-sm p-4 text-center",children:"No data available"});try{switch(n){case "bar-chart-card":return e(Wn,{data:o,orientation:a.orientation||"horizontal",valueSuffix:a.valueSuffix||"",minHeight:a.minHeight});case "line-chart-card":return e(Ed,{data:o,color:a.color,valueSuffix:a.valueSuffix||"",height:a.height});case "pie-chart-card":let c=o.reduce((u,d)=>u+(Number(d.value)||0),0),p=o.map(u=>({name:u.name,value:Number(u.value)||0,percent:typeof u.percent=="number"?u.percent:c>0?(Number(u.value)||0)/c*100:0}));return e(oi,{data:p,variant:a.variant||"donut",size:a.size,colors:a.colors});case "combo-chart-card":return e(Ld,{data:o,barColor:a.barColor,lineColor:a.lineColor});case "heatmap-chart-card":return e(Fd,{data:o});case "fishbone-chart-card":return e(Od,{branches:o,effect:a.effect||t||"Problem"});case "waterfall-chart-card":return e(Bd,{data:o,height:a.height});case "google-map-card":return e(zd,{embedUrl:a.embedUrl||o&&o[0]?.embedUrl,apiKey:a.apiKey,query:a.query||o&&o[0]?.query||t,height:a.height});case "amap-card":return e(Vd,{embedUrl:a.embedUrl||o&&o[0]?.embedUrl,keyword:a.keyword||o&&o[0]?.keyword||t,height:a.height});default:return l("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),e("div",{className:"text-[var(--orb-status-error)] text-sm p-4 text-center",children:"Error rendering chart"})}};return l("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:[l("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:[e("div",{className:"mr-2 flex-shrink-0",children:i()}),l("div",{className:"flex-1 min-w-0",children:[e("h3",{className:"text-sm font-semibold text-[var(--orb-fg)] truncate",children:t}),r&&e("p",{className:"text-xs text-[var(--orb-muted)] mt-0.5 truncate",children:r})]})]}),l("div",{className:"p-4",children:[e("div",{className:"overflow-x-auto",children:s()}),e("div",{className:"mt-3",children:l("details",{className:"text-xs text-[var(--orb-muted)]",children:[e("summary",{className:"cursor-pointer hover:text-[var(--orb-fg)] transition-colors select-none font-medium opacity-60 hover:opacity-100",children:"View Raw Data"}),e("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(o,null,2)})]})})]})]})},Gi=Cv;w();var Sv=({type:t,manifest:r})=>l("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:[l("div",{className:"flex items-center px-4 py-3 border-b border-[var(--orb-border)] bg-[var(--orb-p50)]",children:[e("div",{className:"w-4 h-4 mr-2 text-[var(--orb-status-primary)]"}),l("h3",{className:"text-sm font-semibold text-[var(--orb-fg)]",children:["SAP Card: ",t]})]}),e("div",{className:"p-4",children:e("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] p-3 rounded border border-[var(--orb-border)] overflow-x-auto",children:e("pre",{className:"text-xs font-mono text-[var(--orb-muted)] whitespace-pre-wrap",children:JSON.stringify(r,null,2)})})})]}),_i=Sv;var Ui=t=>{let r;try{r=JSON.parse(t);}catch{return null}return r&&typeof r=="object"&&((r.type==="bar-chart-card"||r.type==="line-chart-card"||r.type==="pie-chart-card"||r.type==="combo-chart-card"||r.type==="heatmap-chart-card"||r.type==="fishbone-chart-card"||r.type==="waterfall-chart-card"||r.type==="google-map-card"||r.type==="amap-card")&&r.title||(r.type==="sap-analytical-card"||r.type==="sap-list-card"||r.type==="sap-object-card"||r.type==="sap-component-card")&&r.manifest||r.type==="error-card"||r.type==="warning-card"||r.type==="suggestions-card"||r.type==="tool-result-card"||r.type==="table"&&r.data)?r:null};w();var Rv=({content:t,theme:r,size:o="base",className:n,enableCodeHighlight:a=true,enableMermaid:i=true,messageId:s,cardHooks:c})=>{let p=Qt.useMemo(()=>t?t.replace(/<think>([\s\S]*?)<\/think>/g,(b,m)=>`<div data-component="thinkbox" data-think-content="${encodeURIComponent(m.trim())}"></div>`):"",[t]),u=(b,m,v,y,g)=>{c?.onCardEvent?.({messageId:s,cardType:b,action:m,title:v,payload:y,rawData:g});},d=(b,m,v,y,g,x)=>{if(!(!g&&!c?.onCardEvent))return (...h)=>{let S=g?.(...h),T=x?x(...h):void 0;return u(b,m,v,T,y),S}},f=Qt.useMemo(()=>({div(b){let{"data-component":m,"data-think-content":v,...y}=b;return m==="thinkbox"&&v?e(vu,{content:decodeURIComponent(v),theme:r,size:o,defaultExpanded:false}):e("div",{...y})},table({children:b}){return e("div",{className:"my-4 w-full overflow-x-auto rounded-lg border border-[var(--orb-border)]",children:e("table",{className:"w-full min-w-[520px] border-collapse text-sm",children:b})})},thead({children:b}){return e("thead",{className:"bg-[color-mix(in_oklch,var(--orb-surface)_60%,transparent)]",children:b})},tbody({children:b}){return e("tbody",{className:"bg-[var(--orb-canvas)] dark:bg-[var(--orb-canvas)]",children:b})},tr({children:b}){return e("tr",{className:"border-b border-[var(--orb-border)] last:border-b-0",children:b})},th({children:b,align:m}){return e("th",{className:`px-3 py-2 font-semibold text-[var(--orb-fg)] ${m==="center"?"text-center":m==="right"?"text-right":"text-left"}`,children:b})},td({children:b,align:m}){return e("td",{className:`px-3 py-2 text-[var(--orb-fg)] align-top ${m==="center"?"text-center":m==="right"?"text-right":"text-left"}`,children:b})},code({className:b,children:m,...v}){let y=/language-([\w-]+)/.exec(b||""),g=y?y[1]:"",x=String(m);if(!y&&!x.includes(`
199
- `))return e("code",{children:m});let S=x.replace(/\n$/,"");if(i&&g==="mermaid")return e(Su,{content:S});if(g==="json"){let T=Ui(S);if(T)switch(T.type){case "table":return e($i,{data:T.data});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 e(Gi,{...T});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return e(_i,{...T});case "error-card":{let C=T;return e(zi,{...C,onClose:d("error-card","close",C.title,C,C.onClose),onRetry:d("error-card","retry",C.title,C,C.onRetry)})}case "warning-card":{let C=T,L=C.onConfirm?d("warning-card","confirm",C.title,C,C.onConfirm):C.actionText&&c?.onCardEvent?d("warning-card","confirm",C.title,C):void 0;return e(Vi,{...C,onClose:d("warning-card","close",C.title,C,C.onClose),onConfirm:L})}case "suggestions-card":{let C=T;return e(Hi,{...C,onClose:d("suggestions-card","close",C.title,C,C.onClose),onSuggestionClick:d("suggestions-card","suggestion-click",C.title,C,C.onSuggestionClick,L=>({suggestion:L}))})}case "tool-result-card":{let C=T;return e(Wi,{...C,onClose:d("tool-result-card","close",C.title,C,C.onClose),onAction:d("tool-result-card","action",C.title,C,C.onAction)})}}}return a?e(yu,{content:S,language:g,className:"not-prose"}):e("code",{className:b,...v,children:m})}}),[r,o,i,a,c,s]);return e("div",{className:mt("markdown-body max-w-none",n),children:e(wv__default.default,{remarkPlugins:[kv__default.default,Tv__default.default],rehypePlugins:[Pv__default.default,Iv__default.default],components:f,children:p})})},Ki=Rv;w();var Mv=({content:t,messageId:r,cardHooks:o})=>{let n=(s,c,p,u,d)=>{o?.onCardEvent?.({messageId:r,cardType:s,action:c,title:p,payload:u,rawData:d});},a=(s,c,p,u,d,f)=>{if(!(!d&&!o?.onCardEvent))return (...b)=>{let m=d?.(...b),v=f?f(...b):void 0;return n(s,c,p,v,u),m}},i=Ui(t);if(i)switch(i.type){case "table":return e($i,{data:i.data});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 e(Gi,{...i});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return e(_i,{...i});case "error-card":{let s=i;return e(zi,{...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&&o?.onCardEvent?a("warning-card","confirm",s.title,s):void 0;return e(Vi,{...s,onClose:a("warning-card","close",s.title,s,s.onClose),onConfirm:c})}case "suggestions-card":{let s=i;return e(Hi,{...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 e(Wi,{...s,onClose:a("tool-result-card","close",s.title,s,s.onClose),onAction:a("tool-result-card","action",s.title,s,s.onAction)})}}return e("div",{className:"dynamic-card-fallback",children:e(Ki,{content:t,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:r,cardHooks:o})})},Iu=Mv;w();var al=class{static analyze(r){if(!r.trim())return {blocks:[],hasComplexContent:false,overallType:"simple"};let n=/```json\s*\{\s*"type":\s*"[^"]+"/g.test(r),a=/<[^>]+>[\s\S]*?<\/[^>]+>/.test(r),i=r.includes("NQ#")||r.includes("data-component");return n||a||i?{blocks:[{type:"mixed",content:r,startIndex:0,endIndex:r.length}],hasComplexContent:true,overallType:"complex"}:{blocks:[{type:"markdown",content:r,startIndex:0,endIndex:r.length}],hasComplexContent:false,overallType:"simple"}}},Av=({content:t,className:r="",messageId:o,cardHooks:n})=>{let a=Qt__namespace.default.useMemo(()=>al.analyze(t),[t]);return e("div",{className:`universal-content-renderer ${r}`,children:a.blocks.map((i,s)=>i.type==="mixed"||i.type==="json-card"?e(Iu,{content:i.content,messageId:o,cardHooks:n},`block-${s}`):e(Ki,{content:i.content,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:o,cardHooks:n},`block-${s}`))})},Ru=Av;w();var Nv=({content:t,isStreaming:r=true,onComplete:o,className:n="",streamIntervalMs:a=24,streamChunkSize:i=3,messageId:s,cardHooks:c})=>{let[p,u]=Qt.useState(r?0:t.length),[d,f]=Qt.useState(!r);Qt.useEffect(()=>{if(r){u(0),f(false);return}u(t.length),f(true);},[t,r]),Qt.useEffect(()=>{if(!r||d)return;if(p>=t.length){f(true),o?.();return}let g=window.setTimeout(()=>{u(x=>Math.min(x+i,t.length));},a);return ()=>{window.clearTimeout(g);}},[t.length,d,r,o,i,a,p]);let b=()=>{r&&!d&&(u(t.length),f(true),o?.());},m=r?t.slice(0,p):t,v=r&&!d,y=r&&!d;return l("div",{className:`streaming-markdown ${n}`,onClick:b,style:{cursor:r?"pointer":"default"},children:[l("div",{className:"relative",children:[e(Ru,{content:m,messageId:s,cardHooks:c}),v&&e("span",{className:"inline-block w-[2px] h-[13px] ml-0.5 animate-pulse",style:{verticalAlign:"text-bottom",backgroundColor:"var(--orb-primary, #154194)"}})]}),y&&e("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"})]})},Au=Nv;w();var Nu=({buttons:t,className:r})=>{let o=n=>{switch(n){case "copy":return e(ca,{size:14});case "refresh":return e(ha,{size:14});case "volume":return e(Jl,{size:14});case "like":return e(Yl,{size:14});case "dislike":return e(Xl,{size:14});default:return null}};return e("div",{className:mt("flex items-center gap-1",r),children:t.map((n,a)=>e("button",{onClick:n.onClick,disabled:n.disabled,"aria-busy":n.loading||void 0,className:mt("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:o(n.type)},`${n.type}-${a}`))})};w();var qi=({message:t,onStreamingComplete:r,assistantActions:o,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 p=!!(o?.isResponding||t.isStreaming);return e("div",{className:"mb-4 flex justify-start",children:l("div",{className:"mr-auto w-full",style:{...s,background:"var(--orb-surface, #f5f5f5)",border:"1px solid var(--orb-border, #dbdbdb)"},children:[e(Au,{content:t.content,isStreaming:t.isStreaming??false,onComplete:r,streamIntervalMs:n,streamChunkSize:a,messageId:t.id,cardHooks:i}),t.content&&o?.isLatestAssistant&&e("div",{className:"mt-3 flex flex-row justify-start gap-2 border-t pt-2",style:{borderColor:"var(--orb-border, #dbdbdb)"},children:e(Nu,{buttons:[{type:"refresh",onClick:()=>{o?.onRegenerate?.();},disabled:p||!o?.onRegenerate,loading:p},{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"})}),e("div",{style:c,children:t.timestamp.toLocaleTimeString()})]})})}return e("div",{className:"mb-4 flex justify-end",children:l("div",{className:"ml-auto max-w-[80%]",style:{...s,background:"var(--orb-p50, #eef2f9)",border:"1px solid var(--orb-p100, #e4e9f5)"},children:[e("div",{className:"whitespace-pre-wrap",children:t.content}),e("div",{style:c,children:t.timestamp.toLocaleTimeString()})]})})};w();var Eu=({onTextUpdate:t,onComplete:r,onCancel:o,disabled:n,className:a})=>{let{isRecording:i,startRecording:s,stopRecording:c}=pn({onTextUpdate:t,onComplete:u=>{r?.(u);},onError:u=>{console.error("Voice input error:",u),o?.();}});return e("button",{onClick:async()=>{i?c():await s();},disabled:n,className:mt("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?e(ad,{size:16}):e(id,{size:16})})};w();var jt={container:"w-full max-w-4xl mx-auto",inputContainer:mt("w-full flex flex-col border border-[var(--orb-border,#dbdbdb)] bg-[var(--orb-canvas,#ffffff)] transition-colors duration-200","rounded-[var(--orb-r,10px)]","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:mt("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",fileTag:mt("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:mt("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:mt("cursor-pointer bg-[var(--orb-primary,#154194)] hover:bg-[var(--orb-p600,#0e2d63)] text-[var(--orb-on-primary)] shadow-none active:scale-95"),sendButtonDisabled:mt("cursor-not-allowed opacity-40 bg-[var(--orb-disabled-bg,#f5f5f5)] text-[var(--orb-disabled-fg,#8c8c8c)]"),stopButton:mt("cursor-pointer bg-[var(--orb-err,#c43f02)] hover:opacity-90 text-[var(--orb-on-primary)] shadow-none active:scale-95")},Lv={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},Fv=({enabled:t,onClick:r})=>e("button",{className:mt(jt.buttonBase,jt.buttonSmall,jt.buttonNormal),onClick:r,disabled:!t,"aria-label":"Upload file",type:"button",children:e(Bc,{size:16})}),Ov=()=>l("button",{className:mt(jt.buttonBase,"h-[38px] gap-1 rounded-full px-2.5 md:h-8 md:px-2",jt.buttonNormal),"aria-label":"Tools",type:"button",children:[e(jc,{size:15}),e("span",{className:"text-xs font-medium",children:"Tools"})]}),Bv=({canSend:t,isResponding:r,onSend:o,onStop:n})=>r?e("button",{className:mt(jt.buttonBase,jt.buttonSmall,jt.stopButton),onClick:n,"aria-label":"Stop generating",type:"button",children:e(fd,{size:15})}):e("button",{className:mt(jt.buttonBase,jt.buttonSmall,t?jt.sendButton:jt.sendButtonDisabled),onClick:o,disabled:!t,"aria-label":"Send message",type:"button",children:e(dd,{size:16,className:t?"text-[var(--orb-on-primary,#ffffff)]":"text-[var(--orb-disabled-fg,#8c8c8c)]"})}),Lu=({onSend:t,onStop:r,isResponding:o=false,placeholder:n,getText:a})=>{let[i,s]=Qt.useState(""),[c,p]=Qt.useState([]),[u,d]=Qt.useState(false),[f,b]=Qt.useState(false),m=Qt.useRef(null),v=n||(a?a("00019","Type a message..."):"Type a message..."),y=(i.trim().length>0||c.length>0)&&!o,g={enabled:true},x=Qt.useCallback(z=>{s(z.target.value),z.target.style.height="auto",z.target.style.height=`${Math.min(z.target.scrollHeight,200)}px`;},[]),h=Qt.useCallback(z=>{if(z.target.files&&z.target.files.length>0){let K=Array.from(z.target.files);p(V=>{let q=K.filter(X=>V.some(W=>W.name===X.name&&W.size===X.size));q.length>0&&console.warn("Duplicate files ignored:",q.map(X=>X.name));let $=K.filter(X=>!V.some(W=>W.name===X.name&&W.size===X.size));return [...V,...$]}),m.current&&(m.current.value="");}},[]),S=Qt.useCallback(z=>{p(K=>K.filter((V,q)=>q!==z));},[]),T=Qt.useCallback(()=>{m.current?.click();},[]),C=Qt.useCallback(async()=>{if(!y)return;let z=i,K=[...c];s(""),p([]),m.current&&(m.current.value="");try{await t(z,K);}catch(V){console.error("Failed to send message:",V),s(z),p(K);}},[i,y,t,c]),L=Qt.useCallback(z=>{z.key==="Enter"&&!z.shiftKey&&!u&&(z.preventDefault(),C());},[C,u]),A=Qt.useCallback(()=>{d(true);},[]),I=Qt.useCallback(()=>{d(false);},[]),N=Qt.useCallback(z=>{s(z);},[]),M=Qt.useCallback(z=>{s(z);},[]),k=Qt.useCallback(()=>{},[]),D=Qt.useCallback(z=>{z.preventDefault(),b(true);},[]),R=Qt.useCallback(z=>{z.preventDefault(),b(false);},[]),F=Qt.useCallback(z=>{if(z.preventDefault(),b(false),z.dataTransfer.files&&z.dataTransfer.files.length>0){let K=Array.from(z.dataTransfer.files);p(V=>[...V,...K]);}},[]);return e("div",{className:jt.container,children:l("div",{className:"relative",children:[e("input",{type:"file",multiple:true,className:"hidden",ref:m,onChange:h}),l("div",{className:mt(jt.inputContainer,f&&jt.dragActive),style:{borderRadius:"24px"},onDragOver:D,onDragLeave:R,onDrop:F,children:[c.length>0&&e("div",{className:jt.filePreviewArea,children:c.map((z,K)=>l("div",{className:jt.fileTag,children:[e(ed,{sx:{fontSize:16},className:"text-[var(--orb-primary)]"}),e("span",{className:"truncate max-w-[150px]",children:z.name}),e("button",{onClick:()=>S(K),className:"ml-1 hover:text-[var(--orb-status-error)] focus:outline-none",type:"button",children:e(Uc,{sx:{fontSize:16}})})]},`${z.name}-${K}`))}),l("div",{className:"flex w-full flex-col p-2",children:[e("div",{className:mt(jt.textareaWrapper,"min-h-[52px] px-2 pb-2 pt-1.5 md:min-h-[44px]"),children:e("textarea",{className:mt(jt.textarea,"min-h-[24px] py-0 px-0"),placeholder:v,value:i,onChange:x,onKeyDown:L,onCompositionStart:A,onCompositionEnd:I,style:Lv,"aria-label":"Message input",spellCheck:false,rows:1})}),l("div",{className:"flex items-center justify-between px-1 pb-0.5",children:[l("div",{className:"flex items-center gap-1",role:"toolbar","aria-label":"Input tools",children:[e(Fv,{enabled:g.enabled,onClick:T}),e(Ov,{})]}),l("div",{className:"flex items-center gap-1",children:[e(Eu,{onTextUpdate:N,onComplete:M,onCancel:k,disabled:o,className:jt.buttonSmall}),e(Bv,{canSend:y,isResponding:o,onSend:C,onStop:r})]})]})]})]})]})})};w();var Ou=({messages:t,onSend:r,onStop:o,onRegenerate:n,isResponding:a=false,className:i,placeholder:s,streamIntervalMs:c,streamChunkSize:p,onMessageStreamingComplete:u,cardHooks:d,showInput:f=true,statusLine:b})=>{let m=Qt.useRef(null),v=Qt.useRef(t.length);return Qt.useEffect(()=>{t.length>v.current&&m.current?.scrollIntoView({behavior:"smooth"}),v.current=t.length;},[t]),l("div",{className:mt("flex flex-col h-full w-full relative",i),children:[l("div",{className:"flex-1 overflow-y-auto px-4 py-4 space-y-6 scrollbar-thin scrollbar-thumb-[var(--orb-border)]",children:[t.map((y,g)=>{let x=y.type==="assistant"&&g===t.length-1,h=y.type==="assistant"?{isLatestAssistant:x,isResponding:a,onRegenerate:n?()=>n(y.id):void 0}:void 0;return e(qi,{message:y,assistantActions:h,onStreamingComplete:()=>u?.(y.id),streamIntervalMs:c,streamChunkSize:p,cardHooks:d},y.id)}),b,e("div",{ref:m})]}),f&&e("div",{className:"border-t border-[var(--orb-border,#dbdbdb)] bg-[var(--orb-canvas,#ffffff)] p-4 z-10",children:e(Lu,{onSend:r||(async()=>{}),onStop:o||(()=>{}),isResponding:a,placeholder:s})})]})};w();var Bu={idle:"Idle",running:"Working",success:"Success",error:"Error",pending:"Pending"},zu=({title:t="AI Agent",description:r,headerActions:o,className:n,agentStatus:a,statusText:i,onHeaderPointerDown:s,showInput:c=false,...p})=>{let u=a??(p.isResponding?"running":"idle"),d=u==="running"||u==="pending",f=[Bu[u],r].filter(Boolean).join(" \xB7 ");return l("div",{className:mt("orb-agent-panel",n),children:[l("div",{className:mt("orb-agent-header",s&&"cursor-grab active:cursor-grabbing"),onPointerDown:s,children:[e("span",{className:"orb-agent-avatar","aria-hidden":"true",children:"AI"}),l("div",{className:"min-w-0 flex-1",children:[e("div",{className:"orb-agent-title",children:t}),l("div",{className:"orb-agent-subtitle",children:[e("span",{className:"orb-agent-dot","data-active":d||void 0}),e("span",{className:"truncate",children:f||"Agent"})]})]}),o&&e("div",{className:"ml-auto flex flex-none items-center gap-1",children:o})]}),e("div",{className:"relative min-h-0 flex-1",children:e(Ou,{...p,showInput:c,statusLine:d?l("div",{className:mt("orb-agent-status-line","mb-1"),children:[e("span",{className:"orb-agent-spinner","aria-hidden":"true"}),e("span",{children:i??`${Bu[u]}\u2026`})]}):void 0})})]})};w();var Wu=520,Wv=88,$v=88,Gv=24,Yi=640,$u=(t,r,o)=>Math.min(Math.max(t,r),Math.max(r,o)),il=t=>typeof t=="number"?`${t}px`:t,_v=t=>t instanceof HTMLElement?!!t.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,MF=({anchor:t,defaultAnchor:r="right",onAnchorChange:o,width:n=Wu,top:a=Wv,bottom:i=$v,inset:s=Gv,zIndex:c=1300,shellClassName:p,shellStyle:u,className:d,onHeaderPointerDown:f,...b})=>{let m=Qt.useRef(null),v=Qt.useRef(null),[y,g]=Qt.useState(r),[x,h]=Qt.useState(0),[S,T]=Qt.useState(typeof n=="number"?n:Wu),[C,L]=Qt.useState(0),[A,I]=Qt.useState(false),N=t??y;Qt.useEffect(()=>{let V=()=>h(window.innerWidth);return V(),window.addEventListener("resize",V),()=>window.removeEventListener("resize",V)},[]),Qt.useLayoutEffect(()=>{let V=()=>{let $=m.current?.getBoundingClientRect();$?.width?T($.width):typeof n=="number"&&T(n);};if(V(),!m.current||typeof ResizeObserver>"u")return;let q=new ResizeObserver(V);return q.observe(m.current),()=>q.disconnect()},[n]);let M=Qt.useCallback(V=>{if(!x)return s;let q=x<Yi?12:s,$=Math.max(q,x-S-q);return x<Yi||V==="left"?q:V==="center"?$u((x-S)/2,q,$):$},[s,S,x]),k=Qt.useCallback(V=>["left","center","right"].reduce(($,X)=>{let W=Math.abs(V-M($));return Math.abs(V-M(X))<W?X:$},"right"),[M]),D=Qt.useCallback(V=>{t===void 0&&g(V),o?.(V);},[t,o]);Qt.useEffect(()=>{A||L(M(N));},[M,A,N]);let R=Qt.useCallback(V=>{f?.(V),!(V.defaultPrevented||_v(V.target))&&(V.preventDefault(),V.currentTarget.setPointerCapture(V.pointerId),v.current={pointerId:V.pointerId,startClientX:V.clientX,startX:C,currentX:C,captureElement:V.currentTarget},I(true));},[f,C]),F=Qt.useCallback(V=>{let q=v.current;if(!q||q.pointerId!==V.pointerId)return;let $=x<Yi?12:s,X=Math.max($,x-S-$),W=$u(q.startX+V.clientX-q.startClientX,$,X);q.currentX=W,L(W);},[s,S,x]),z=Qt.useCallback(V=>{let q=v.current;if(!q||q.pointerId!==V.pointerId)return;try{q.captureElement.releasePointerCapture(V.pointerId);}catch{}let $=k(q.currentX);v.current=null,I(false),D($),L(M($));},[M,D,k]),K=Qt.useMemo(()=>({position:"fixed",top:il(a),bottom:il(i),left:C,width:il(n),maxWidth:`calc(100vw - ${x<Yi?24:s*2}px)`,zIndex:c,pointerEvents:"auto",transition:A?"none":"left 180ms ease-out",touchAction:"none",...u}),[i,s,A,C,u,a,x,n,c]);return e("div",{ref:m,className:mt("orbcafe-floating-agent-panel min-w-0",p),"data-anchor":N,"data-dragging":A?"true":"false",style:K,onPointerMove:F,onPointerUp:z,onPointerCancel:z,children:e(zu,{...b,className:d,onHeaderPointerDown:R})})};w();var qv={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},BF=({messages:t,onSend:r,onRegenerate:o,isResponding:n=false,className:a,placeholder:i,title:s="Copilot",corner:c="bottom-right",onCollapse:p,onHeaderPointerDown:u,onPlusClick:d,onMicClick:f,streamIntervalMs:b,streamChunkSize:m,onMessageStreamingComplete:v,cardHooks:y})=>{let[g,x]=Qt.useState(""),[h,S]=Qt.useState(false),T=Qt.useRef(null),C=qv[c];Qt.useEffect(()=>{T.current?.scrollIntoView({behavior:"smooth"});},[t,n]);let L=Qt.useCallback(async()=>{let I=g.trim();!I||n||(x(""),await r(I));},[n,r,g]),A=Qt.useCallback(async I=>{I.key==="Enter"&&!h&&(I.preventDefault(),await L());},[L,h]);return l("div",{className:mt("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:[p&&e("button",{onClick:p,className:mt("absolute z-20 flex h-10 w-10 items-center justify-center rounded-full transition-colors hover:bg-transparent dark:hover:bg-transparent",C==="top-left"&&"-left-2 -top-2",C==="top-right"&&"-right-2 -top-2",C==="bottom-left"&&"-bottom-2 -left-2",C==="bottom-right"&&"-bottom-2 -right-2"),type:"button","aria-label":"Collapse Copilot",children:e("span",{className:mt("block h-4 w-4 border-[var(--orb-ai-accent)]",C==="top-left"&&"rounded-tl-full border-l-[3px] border-t-[3px]",C==="top-right"&&"rounded-tr-full border-r-[3px] border-t-[3px]",C==="bottom-left"&&"rounded-bl-full border-b-[3px] border-l-[3px]",C==="bottom-right"&&"rounded-br-full border-b-[3px] border-r-[3px]")})}),l("div",{className:"flex items-center justify-between border-b border-[var(--orb-border)] px-4 py-3",onPointerDown:u,children:[e("div",{className:"flex items-center",children:e("h3",{className:"text-base font-semibold tracking-tight text-[var(--orb-fg)]",children:s})}),e("div",{})]}),l("div",{className:"flex-1 overflow-y-auto px-3 py-3 space-y-5 scrollbar-thin scrollbar-thumb-[var(--orb-border)]",children:[t.map((I,N)=>{let M=I.type==="assistant"&&N===t.length-1,k=I.type==="assistant"?{isLatestAssistant:M,isResponding:n,onRegenerate:o?()=>o(I.id):void 0}:void 0;return e(qi,{message:I,assistantActions:k,onStreamingComplete:()=>v?.(I.id),streamIntervalMs:b,streamChunkSize:m,cardHooks:y},I.id)}),e("div",{ref:T})]}),e("div",{className:"border-t border-[var(--orb-border)] px-3 py-3",children:l("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:[e("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:d,type:"button","aria-label":"Add",children:e(ba,{className:"h-4 w-4"})}),e("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,onChange:I=>x(I.target.value),onCompositionStart:()=>S(true),onCompositionEnd:()=>S(false),onKeyDown:A,"aria-label":"Copilot input",spellCheck:false}),e("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:f,type:"button","aria-label":"Microphone",children:e(ma,{className:"h-4 w-4"})})]})})]})};w();var Xv=["var(--orb-primary)","var(--orb-primary)","var(--orb-primary)"],Yv=`
196
+ ${o}: ${(a??n)(g.secondaryValue??0)}`:""]})}),e("text",{x:g.x,y:Math.max(g.y-12,d.top+8),textAnchor:"middle",fontSize:"10",fill:i.palette.text.secondary,children:g.name})]},g.name)),e("text",{x:s/2,y:l-10,textAnchor:"middle",fontSize:"11",fill:i.palette.text.secondary,children:o?r:"Index"}),e("text",{x:16,y:l/2,textAnchor:"middle",transform:`rotate(-90 16 ${l/2})`,fontSize:"11",fill:i.palette.text.secondary,children:o??r}),e("text",{x:d.left,y:d.top-4,fontSize:"10",fill:i.palette.text.secondary,children:Hu(b)}),e("text",{x:s-d.right,y:l-d.bottom+16,textAnchor:"end",fontSize:"10",fill:i.palette.text.secondary,children:Hu(f)})]})}),e("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=>c("div",{sx:x=>({borderRadius:"var(--orb-r-container)",px:1.25,py:1,border:`1px solid ${Ar(x.palette.divider,.7)}`,bgcolor:Ar(x.palette.background.default,.35)}),children:[e(L,{component:"div",sx:{fontSize:"0.78rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:g.name,children:g.name}),c(L,{component:"div",sx:{fontSize:"0.72rem",color:"var(--orb-fg)"},children:[r,": ",n(g.primaryValue)]}),o&&c(L,{component:"div",sx:{fontSize:"0.72rem",color:"var(--orb-fg)"},children:[o,": ",(a??n)(g.secondaryValue??0)]})]},g.name))})]})};T();var kl=t=>Math.max(...t,1),Vu=({data:t,chartType:r,primaryLabel:o,secondaryLabel:n,formatPrimaryValue:a,formatSecondaryValue:i})=>{let s=sr(),l=s.palette.primary.main,d=s.palette.warning.main;if(t.length===0)return null;if(r==="bar-horizontal"){let h=kl(t.flatMap(C=>[C.primaryValue,C.secondaryValue??0]));return e(ie,{spacing:1.1,children:t.map(C=>c("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"160px 1fr 128px"},gap:1.25,alignItems:"center"},children:[e(L,{component:"div",sx:{fontSize:"0.78rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:C.name,children:C.name}),c(ie,{spacing:.65,children:[e("div",{sx:{height:10,borderRadius:999,overflow:"hidden",bgcolor:Ar(s.palette.action.active,.08)},children:e("div",{sx:{width:`${C.primaryValue/h*100}%`,height:"100%",bgcolor:l}})}),n&&e("div",{sx:{height:8,borderRadius:999,overflow:"hidden",bgcolor:Ar(s.palette.action.active,.08)},children:e("div",{sx:{width:`${(C.secondaryValue??0)/h*100}%`,height:"100%",bgcolor:d}})})]}),c("div",{sx:{minWidth:0},children:[e(L,{component:"div",sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},fontWeight:700,color:"var(--orb-fg-strong)"},children:a(C.primaryValue)}),n&&e(L,{component:"div",sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},color:"var(--orb-fg)"},children:(i??a)(C.secondaryValue??0)})]})]},C.name))})}if(r==="bar-vertical"){let h=kl(t.flatMap(P=>[P.primaryValue,P.secondaryValue??0])),C=n?92:76;return e("div",{sx:{overflowX:"auto",pb:.5},children:e("div",{sx:{minWidth:Math.max(620,t.length*C),display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(56px, 1fr))`,gap:1,alignItems:"end"},children:t.map(P=>c("div",{sx:{minWidth:0},children:[c("div",{sx:{height:210,display:"flex",alignItems:"flex-end",justifyContent:"center",gap:.8},children:[e("div",{sx:{width:n?16:26,minHeight:8,height:`${Math.max(P.primaryValue/h*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:l},title:`${o}: ${a(P.primaryValue)}`}),n&&e("div",{sx:{width:16,minHeight:8,height:`${Math.max((P.secondaryValue??0)/h*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:d},title:`${n}: ${(i??a)(P.secondaryValue??0)}`})]}),e(L,{component:"div",sx:{fontSize:"0.76rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:P.name,children:P.name}),e(L,{component:"div",sx:{fontSize:"0.7rem",color:"var(--orb-fg)"},noWrap:true,title:a(P.primaryValue),children:a(P.primaryValue)}),n&&e(L,{component:"div",sx:{fontSize:"0.7rem",color:"var(--orb-fg)"},noWrap:true,title:(i??a)(P.secondaryValue??0),children:(i??a)(P.secondaryValue??0)})]},P.name))})})}let p=Math.max(680,t.length*74),u=240,f={top:20,right:18,bottom:36,left:18},b=kl(t.flatMap(h=>[h.primaryValue,h.secondaryValue??0])),m=p-f.left-f.right,v=u-f.top-f.bottom,y=h=>t.map((C,P)=>{let w=f.left+P*m/Math.max(t.length-1,1),k=u-f.bottom-h(C)/b*v;return {x:w,y:k,item:C}}),g=y(h=>h.primaryValue),x=n?y(h=>h.secondaryValue??0):[];return c("div",{sx:{display:"flex",flexDirection:"column",gap:1.1},children:[e("div",{sx:{overflowX:"auto"},children:c("div",{component:"svg",viewBox:`0 0 ${p} ${u}`,sx:{width:"100%",minWidth:p,height:u},children:[e("line",{x1:f.left,y1:u-f.bottom,x2:p-f.right,y2:u-f.bottom,stroke:Ar(s.palette.text.secondary,.35)}),e("polyline",{fill:"none",stroke:l,strokeWidth:3,points:g.map(h=>`${h.x},${h.y}`).join(" ")}),g.map(h=>e("circle",{cx:h.x,cy:h.y,r:4,fill:l,children:c("title",{children:[h.item.name,`
197
+ `,o,": ",a(h.item.primaryValue)]})},`primary-${h.item.name}`)),n&&c(jsxRuntime.Fragment,{children:[e("polyline",{fill:"none",stroke:d,strokeWidth:2.5,strokeDasharray:"5 5",points:x.map(h=>`${h.x},${h.y}`).join(" ")}),x.map(h=>e("circle",{cx:h.x,cy:h.y,r:3.5,fill:d,children:c("title",{children:[h.item.name,`
198
+ `,n,": ",(i??a)(h.item.secondaryValue??0)]})},`secondary-${h.item.name}`))]})]})}),e("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1},children:t.map(h=>c("div",{sx:C=>({borderRadius:"var(--orb-r-container)",px:1.1,py:.9,border:`1px solid ${Ar(C.palette.divider,.7)}`,bgcolor:Ar(C.palette.background.default,.35)}),children:[e(L,{component:"div",sx:{fontSize:"0.76rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:h.name,children:h.name}),e(L,{component:"div",sx:{fontSize:"0.71rem",color:"var(--orb-fg)"},children:a(h.primaryValue)}),n&&e(L,{component:"div",sx:{fontSize:"0.71rem",color:"var(--orb-fg)"},children:(i??a)(h.secondaryValue??0)})]},h.name))})]})};var Wu=(t,r,o)=>{let n=new Set,a=[];return t.forEach(i=>{n.has(i)||(n.add(i),a.push({fieldId:i,label:o.get(i)?.label??i,zone:"rows"}));}),r.forEach(i=>{n.has(i)||(n.add(i),a.push({fieldId:i,label:o.get(i)?.label??i,zone:"columns"}));}),a},$u=(t,r,o)=>t.map(n=>{let a=r.get(n.fieldId),i=a?.label??n.fieldId;return {fieldId:n.fieldId,label:`${o(n.aggregation)} \xB7 ${i}`,item:n,field:a}}),Gu=({rows:t,dimensionFieldId:r,primaryValue:o,secondaryValue:n})=>{if(!r)return [];let a=new Map;return t.forEach(i=>{let s=co(i[r]),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,o.fieldId,o.aggregation),secondaryValue:n?xn(s,n.fieldId,n.aggregation):void 0}))};T();var _u=({rows:t,fieldMap:r,rowFields:o,columnFields:n,valueFields:a,chartDimensionFieldId:i,chartPrimaryValueFieldId:s,chartSecondaryValueFieldId:l,chartType:d,isCollapsed:p,onChartDimensionFieldIdChange:u,onChartPrimaryValueFieldIdChange:f,onChartSecondaryValueFieldIdChange:b,onChartTypeChange:m,onToggleCollapse:v,getAggregationLabel:y})=>{let{t:g}=pe(),x=Jt.useMemo(()=>Wu(o,n,r),[n,r,o]),h=Jt.useMemo(()=>$u(a,r,y),[r,y,a]),C=h.find(I=>I.fieldId===s)??h[0],P=h.find(I=>I.fieldId===l&&I.fieldId!==C?.fieldId)??null,w=x.find(I=>I.fieldId===i)??x[0],k=w&&C?g("pivot.chart.subtitleReady",{dimension:w.label,measure:P?`${C.label} / ${P.label}`:C.label}):g("pivot.chart.subtitle"),R=Jt.useMemo(()=>!w||!C?[]:Gu({rows:t,dimensionFieldId:w.fieldId,primaryValue:C.item,secondaryValue:P?.item}),[C,t,P,w]),S=I=>C?da(I,C.item,r):I.toLocaleString(),E=I=>P?da(I,P.item,r):I.toLocaleString(),D=x.length>1||h.length>1;return c(kn,{title:g("pivot.chart.title"),subtitle:k,collapsed:p,onToggleCollapse:v,expandAriaLabel:g("pivot.chart.collapse.ariaExpand"),collapseAriaLabel:g("pivot.chart.collapse.ariaCollapse"),bodySx:{display:"flex",flexDirection:"column",gap:1.1},children:[D&&c("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1,alignItems:"start"},children:[c(yo,{size:"small",sx:{minWidth:0,width:"100%"},children:[e(L,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g("pivot.chart.dimension")}),e(Wt,{value:w?.fieldId??"",onChange:I=>u(String(I.target.value)),sx:{fontSize:"0.75rem",height:32},children:x.map(I=>e("option",{value:I.fieldId,sx:{fontSize:"0.75rem"},children:I.label},I.fieldId))})]}),c(yo,{size:"small",sx:{minWidth:0,width:"100%"},children:[e(L,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g("pivot.chart.primaryMeasure")}),e(Wt,{value:C?.fieldId??"",onChange:I=>f(String(I.target.value)),sx:{fontSize:"0.75rem",height:32},children:h.map(I=>e("option",{value:I.fieldId,sx:{fontSize:"0.75rem"},children:I.label},I.fieldId))})]}),c(yo,{size:"small",sx:{minWidth:0,width:"100%"},children:[e(L,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g("pivot.chart.secondaryMeasure")}),c(Wt,{value:P?.fieldId??"",onChange:I=>b(String(I.target.value)),sx:{fontSize:"0.75rem",height:32},children:[e("option",{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:g("common.none")}),h.filter(I=>I.fieldId!==C?.fieldId).map(I=>e("option",{value:I.fieldId,sx:{fontSize:"0.75rem"},children:I.label},I.fieldId))]})]}),c(yo,{size:"small",sx:{minWidth:0,width:"100%"},children:[e(L,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g("pivot.chart.chartType")}),c(Wt,{value:d,onChange:I=>m(I.target.value),sx:{fontSize:"0.75rem",height:32},children:[e("option",{value:"bar-vertical",sx:{fontSize:"0.75rem"},children:g("pivot.chart.style.barVertical")}),e("option",{value:"bar-horizontal",sx:{fontSize:"0.75rem"},children:g("pivot.chart.style.barHorizontal")}),e("option",{value:"line",sx:{fontSize:"0.75rem"},children:g("pivot.chart.style.line")}),e("option",{value:"scatter",sx:{fontSize:"0.75rem"},children:g("pivot.chart.style.scatter")})]})]})]}),e("div",{children:w?C?R.length===0?e("div",{sx:{py:5,textAlign:"center"},children:e(L,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g("pivot.chart.emptyNoData")})}):d==="scatter"?e(zu,{data:R,primaryLabel:C.label,secondaryLabel:P?.label,formatPrimaryValue:S,formatSecondaryValue:E}):e(Vu,{data:R,chartType:d,primaryLabel:C.label,secondaryLabel:P?.label,formatPrimaryValue:S,formatSecondaryValue:E}):e("div",{sx:{py:5,textAlign:"center"},children:e(L,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g("pivot.chart.emptyNoValue")})}):e("div",{sx:{py:5,textAlign:"center"},children:e(L,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g("pivot.chart.emptyNoDimension")})})})]})};T();var ji=({node:t,dataColumns:r,fieldMap:o,level:n,expandedKeys:a,onToggle:i,getValue:s})=>{let l=a.has(t.key),d=t.children.length>0,p=t.isGrandTotal,u=d&&!l&&!p,f=p?800:u?700:d?600:500,b=p?800:u?600:500;return c(jsxRuntime.Fragment,{children:[c("tr",{sx:{bgcolor:p?ht()==="dark"?"color-mix(in oklch, var(--orb-primary) 22%, transparent)":"color-mix(in oklch, var(--orb-primary) 8%, transparent)":ht()==="dark"?"var(--orb-surface)":"background.paper","&:hover":{bgcolor:p?ht()==="dark"?"color-mix(in oklch, var(--orb-primary) 28%, transparent)":"color-mix(in oklch, var(--orb-primary) 12%, transparent)":"var(--orb-hover)"}},children:[c("td",{style:{fontWeight:f},sx:m=>({fontSize:"0.76rem",borderBottom:`1px solid ${m.palette.divider}`,whiteSpace:"nowrap",pl:n*2+1,display:"flex",alignItems:"center",height:40}),children:[d&&!p&&e(ae,{size:"small",onClick:()=>i(t.key),sx:{width:22,height:22,p:0,mr:.35,ml:-0.8},children:l?e(Vr,{size:12}):e(wo,{size:12})}),!d&&!p&&n>0&&e("div",{sx:{width:18}}),t.value]}),r.map(m=>e("td",{align:"right",style:{fontWeight:b},sx:{fontSize:"0.76rem",borderBottom:v=>`1px solid ${v.palette.divider}`,whiteSpace:"nowrap"},children:da(s?s(t,m.id):t.aggregatedValues[m.id]??0,m.valueItem,o)},`${t.key}-${m.id}`))]}),l&&t.children.map(m=>e(ji,{node:m,dataColumns:r,fieldMap:o,level:n+1,expandedKeys:a,onToggle:i,getValue:s},m.key))]})};T();var Tl=(t,r,o)=>{let n=[...t,...r];return o&&n.includes(o)?o:n[0]??""},Ji=(t,r)=>r&&t.some(o=>o.fieldId===r)?r:t[0]?.fieldId??"",Il=(t,r,o)=>o===""?"":o&&o!==r&&t.some(n=>n.fieldId===o)?o:t.find(n=>n.fieldId!==r)?.fieldId??"",Ku=t=>{let r=new Set,o=n=>{n.forEach(a=>{a.children.length>0&&(r.add(a.key),o(a.children));});};return o(t),r},qu=(t,r,o=0)=>t.length===0?o:t.reduce((n,a)=>a.children.length===0||!r.has(a.key)?Math.max(n,o+1):Math.max(n,qu(a.children,r,o+1)),o),Wv=(t,r)=>{let o=[],n=a=>{a.forEach(i=>{if(i.children.length>0&&r.has(i.key)){n(i.children);return}o.push(i);});};return n(t),o},HL=({title:t,rows:r,fields:o,initialLayout:n,initialChart:a,emptyText:i,maxPreviewHeight:s=520,initialChartCollapsed:l=false,initialTableCollapsed:d=false,model:p,enablePresetManagement:u=false,presets:f,defaultPresets:b,onPresetsChange:m,initialPresetId:v,onPresetApplied:y})=>{let{t:g}=pe(),x=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:8}})),h=Jt.useRef(0),C=Jt.useRef(false),P=t??g("pivot.title.default"),w=i??g("pivot.empty"),k=Jt.useMemo(()=>({sum:g("pivot.agg.sum"),count:g("pivot.agg.count"),avg:g("pivot.agg.avg"),min:g("pivot.agg.min"),max:g("pivot.agg.max")}),[g]),R=Jt.useCallback(M=>k[M]??Tu[M],[k]),S=Jt.useMemo(()=>new Set(o.map(M=>M.id)),[o]),E=Jt.useMemo(()=>new Map(o.map(M=>[M.id,M])),[o]),[D,I]=Jt.useState(()=>lr(n?.rows,S)),[A,N]=Jt.useState(()=>lr(n?.columns,S)),[O,F]=Jt.useState(()=>lr(n?.filters,S)),[q,z]=Jt.useState(()=>{let M=n?.values??[],G=new Set,K=[];return M.forEach(de=>{if(!S.has(de.fieldId)||G.has(de.fieldId))return;G.add(de.fieldId),h.current+=1;let He=E.get(de.fieldId);K.push({tokenId:`v${h.current}`,fieldId:de.fieldId,aggregation:hr(de.aggregation,He)});}),K}),[X,$]=Jt.useState({}),[_,V]=Jt.useState(true),[B,Z]=Jt.useState(false),[Q,ge]=Jt.useState(()=>Tl(lr(n?.rows,S),lr(n?.columns,S),a?.dimensionFieldId)),[se,le]=Jt.useState(()=>{let M=(n?.values??[]).filter((G,K,de)=>S.has(G.fieldId)&&de.findIndex(He=>He.fieldId===G.fieldId)===K).map(G=>({tokenId:G.fieldId,fieldId:G.fieldId,aggregation:hr(G.aggregation,E.get(G.fieldId))}));return Ji(M,a?.primaryValueFieldId)}),[be,_e]=Jt.useState(()=>{let M=(n?.values??[]).filter((K,de,He)=>S.has(K.fieldId)&&He.findIndex(at=>at.fieldId===K.fieldId)===de).map(K=>({tokenId:K.fieldId,fieldId:K.fieldId,aggregation:hr(K.aggregation,E.get(K.fieldId))})),G=Ji(M,a?.primaryValueFieldId);return Il(M,G,a?.secondaryValueFieldId)}),[De,Pe]=Jt.useState(a?.chartType??"bar-vertical"),[Ve,Te]=Jt.useState(l),[xe,We]=Jt.useState(d),[ot,it]=Jt.useState(()=>b??[]),[Ze,U]=Jt.useState(""),[Fe,ye]=Jt.useState(false),[Le,st]=Jt.useState(""),[Je,vt]=Jt.useState(null),[St,Et]=Jt.useState(new Set(["__grand_total__"])),[Lt,re]=Jt.useState(new Set),nt=p?.rowFields??D,Be=p?.columnFields??A,ce=p?.filterFields??O,fe=p?.valueFields??q,ee=p?.filterSelections??X,Ie=p?.showGrandTotal??_,Re=p?.isConfiguratorCollapsed??B,je=p?.chartDimensionFieldId??Q,mt=p?.chartPrimaryValueFieldId??se,pt=p?.chartSecondaryValueFieldId??be,Ot=p?.chartType??De,Kt=p?.isChartCollapsed??Ve,yt=p?.isTableCollapsed??xe,bt=f??ot,xr=u||bt.length>0||!!m,Tt=Jt.useCallback(M=>{if(p?.setRowFields){p.setRowFields(M);return}I(M);},[p]),Ft=Jt.useCallback(M=>{if(p?.setColumnFields){p.setColumnFields(M);return}N(M);},[p]),ut=Jt.useCallback(M=>{if(p?.setFilterFields){p.setFilterFields(M);return}F(M);},[p]),Bt=Jt.useCallback(M=>{if(p?.setValueFields){p.setValueFields(M);return}z(M);},[p]),we=Jt.useCallback(M=>{if(p?.setFilterSelections){p.setFilterSelections(M);return}$(M);},[p]),W=Jt.useCallback(M=>{if(p?.setShowGrandTotal){p.setShowGrandTotal(M);return}V(M);},[p]),Y=Jt.useCallback(M=>{if(p?.setIsConfiguratorCollapsed){p.setIsConfiguratorCollapsed(M);return}Z(M);},[p]),te=Jt.useCallback(M=>{if(p?.setChartDimensionFieldId){p.setChartDimensionFieldId(M);return}ge(M);},[p]),Ne=Jt.useCallback(M=>{if(p?.setChartPrimaryValueFieldId){p.setChartPrimaryValueFieldId(M);return}le(M);},[p]),he=Jt.useCallback(M=>{if(p?.setChartSecondaryValueFieldId){p.setChartSecondaryValueFieldId(M);return}_e(M);},[p]),Ae=Jt.useCallback(M=>{if(p?.setChartType){p.setChartType(M);return}Pe(M);},[p]),Ke=Jt.useCallback(M=>{if(p?.setIsChartCollapsed){p.setIsChartCollapsed(M);return}Te(M);},[p]),et=Jt.useCallback(M=>{if(p?.setIsTableCollapsed){p.setIsTableCollapsed(M);return}We(M);},[p]),qe=Jt.useCallback(M=>{let G=typeof M=="function"?M(bt):M;f||it(G),m?.(G);},[m,bt,f]),Ct=Jt.useMemo(()=>new Set([...nt,...Be,...ce]),[nt,Be,ce]),Nt=Jt.useMemo(()=>o.filter(M=>!Ct.has(M.id)),[o,Ct]),wt=Jt.useMemo(()=>{let M=[...nt,...Be,...ce],G=new Set,K=[];return M.forEach(de=>{G.has(de)||(G.add(de),K.push(de));}),K},[Be,ce,nt]);Jt.useEffect(()=>{Tt(M=>{let G=M.filter(K=>S.has(K));return po(M,G)?M:G}),Ft(M=>{let G=M.filter(K=>S.has(K));return po(M,G)?M:G}),ut(M=>{let G=M.filter(K=>S.has(K));return po(M,G)?M:G}),Bt(M=>{let G=M.filter(K=>S.has(K.fieldId)).map(K=>({...K,aggregation:hr(K.aggregation,E.get(K.fieldId))}));return Ki(M,G)?M:G});},[E,S]);let xt=Jt.useMemo(()=>{let M={};return wt.forEach(G=>{let K=new Set;r.forEach(de=>{K.add(co(de[G]));}),M[G]=Array.from(K).sort((de,He)=>de.localeCompare(He));}),M},[wt,r]);Jt.useEffect(()=>{we(M=>{let G={};return wt.forEach(K=>{let de=xt[K]??[],at=(M[K]??[]).filter(oe=>de.includes(oe)),$e=Object.prototype.hasOwnProperty.call(M,K);G[K]=$e?at:de;}),Au(M,G)?M:G});},[wt,xt]),Jt.useEffect(()=>{te(M=>Tl(nt,Be,M));},[Be,nt,te]),Jt.useEffect(()=>{Ne(M=>Ji(fe,M));},[Ne,fe]),Jt.useEffect(()=>{he(M=>Il(fe,mt,M));},[mt,he,fe]);let H=Jt.useMemo(()=>r.filter(M=>wt.every(G=>{let K=ee[G]??[],de=xt[G]??[];if(K.length===de.length)return true;if(K.length===0)return false;let He=co(M[G]);return K.includes(He)})),[wt,xt,ee,r]),j=Jt.useMemo(()=>{if(fe.length===0)return null;let M=new Map;if(H.forEach($e=>{let oe=Be.length>0?Be.map(J=>co($e[J])):[g("pivot.valueLabel")],ue=$o(oe);M.set(ue,oe);}),M.size===0){let $e=Be.length>0?Be.map(()=>_i):[g("pivot.valueLabel")];M.set($o($e),$e);}let G=Array.from(M.entries()).sort(($e,oe)=>Nu($e[1],oe[1])),K=G.flatMap(([$e,oe])=>fe.map(ue=>{let J=E.get(ue.fieldId),Oe=`${R(ue.aggregation)} ${J?.label??ue.fieldId}`,Qe=Be.length===0||fe.length>1?`${oe.join(" / ")} \u2022 ${Oe}`:oe.join(" / ");return {id:`${$e}::${ue.tokenId}`,colKey:$e,valueItem:ue,label:Qe}})),de=[];Be.length>0&&G.forEach(([$e,oe])=>{let ue=K.filter(Qe=>Qe.colKey===$e),J=de,Oe=[];oe.forEach((Qe,Me)=>{Oe.push(`d${Me}:${Qe}`);let Ye=`col::${$o(Oe)}`,Rt=J.find(jo=>jo.key===Ye);Rt||(Rt={key:Ye,label:Qe,children:[],leafColumnIds:[],path:oe.slice(0,Me+1),depth:Me},J.push(Rt)),ue.forEach(jo=>{Rt.leafColumnIds.includes(jo.id)||Rt.leafColumnIds.push(jo.id);}),J=Rt.children;});});let He=$e=>{let oe={};return K.forEach(ue=>{let J=$e.filter(Oe=>{let Qe=Be.length>0?Be.map(Me=>co(Oe[Me])):[g("pivot.valueLabel")];return $o(Qe)===ue.colKey});oe[ue.id]=xn(J,ue.valueItem.fieldId,ue.valueItem.aggregation);}),oe},at=[];if(nt.length===0)at.push({key:"root",value:g("pivot.resultLabel")||ku,children:[],isLeaf:true,aggregatedValues:He(H),path:[],depth:0});else {let $e=(oe,ue,J)=>{if(ue>=nt.length)return [];let Oe=nt[ue],Qe=new Map;return oe.forEach(Me=>{let Ye=co(Me[Oe]);Qe.has(Ye)||Qe.set(Ye,[]),Qe.get(Ye).push(Me);}),Array.from(Qe.keys()).sort().map(Me=>{let Ye=Qe.get(Me),Rt=[...J,Me];return {key:$o(Rt),value:Me,fieldId:Oe,aggregatedValues:He(Ye),children:$e(Ye,ue+1,Rt),isLeaf:ue===nt.length-1,path:Rt,depth:ue}})};at.push(...$e(H,0,[]));}return {dataColumns:K,columnTree:de,rowTree:at}},[Be,E,H,R,nt,g,fe]),me=Jt.useCallback((M,G)=>(h.current+=1,{tokenId:`v${h.current}`,fieldId:M,aggregation:hr(G,E.get(M))}),[E]),Se=Jt.useCallback(M=>{if(M==="rows")return Tt([]);if(M==="columns")return Ft([]);if(M==="filters")return ut([]);Bt([]);},[]),tt=Jt.useCallback((M,G)=>{if(M==="rows")return Tt(K=>K.filter(de=>de!==G));if(M==="columns")return Ft(K=>K.filter(de=>de!==G));if(M==="filters")return ut(K=>K.filter(de=>de!==G));Bt(K=>K.filter(de=>de.tokenId!==G));},[]),Xe=Jt.useCallback((M,G)=>{Bt(K=>K.map(de=>de.tokenId===M?{...de,aggregation:hr(G,E.get(de.fieldId))}:de));},[E]),It=Jt.useCallback(M=>{vt(String(M.active.id));},[]),ft=Jt.useCallback(M=>{if(vt(null),!M.over)return;let G=Ui(String(M.active.id)),K=Ui(String(M.over.id));if(!G||!K||G.kind!=="item"||!G.key)return;if(G.zone===K.zone&&K.kind==="item"){if(G.zone==="rows"){let Me=nt.indexOf(G.key),Ye=nt.indexOf(K.key??"");Me!==-1&&Ye!==-1&&Me!==Ye&&Tt(Rt=>sortable.arrayMove(Rt,Me,Ye));return}if(G.zone==="columns"){let Me=Be.indexOf(G.key),Ye=Be.indexOf(K.key??"");Me!==-1&&Ye!==-1&&Me!==Ye&&Ft(Rt=>sortable.arrayMove(Rt,Me,Ye));return}if(G.zone==="filters"){let Me=ce.indexOf(G.key),Ye=ce.indexOf(K.key??"");Me!==-1&&Ye!==-1&&Me!==Ye&&ut(Rt=>sortable.arrayMove(Rt,Me,Ye));return}if(G.zone==="values"){let Me=fe.findIndex(Rt=>Rt.tokenId===G.key),Ye=fe.findIndex(Rt=>Rt.tokenId===(K.key??""));Me!==-1&&Ye!==-1&&Me!==Ye&&Bt(Rt=>sortable.arrayMove(Rt,Me,Ye));}return}let de=K.zone,He=[...nt],at=[...Be],$e=[...ce],oe=[...fe],ue="",J=null;if(G.zone==="palette")ue=G.key;else if(G.zone==="values"){let Me=oe.find(Ye=>Ye.tokenId===G.key);if(!Me)return;ue=Me.fieldId,J=Me,oe=oe.filter(Ye=>Ye.tokenId!==G.key);}else G.zone==="rows"?(ue=G.key,He=He.filter(Me=>Me!==ue)):G.zone==="columns"?(ue=G.key,at=at.filter(Me=>Me!==ue)):G.zone==="filters"&&(ue=G.key,$e=$e.filter(Me=>Me!==ue));if(!ue)return;let Oe=()=>{He=He.filter(Me=>Me!==ue),at=at.filter(Me=>Me!==ue),$e=$e.filter(Me=>Me!==ue);},Qe=Me=>{if(K.kind!=="item"||!K.key)return Me==="rows"?He.length:Me==="columns"?at.length:Me==="filters"?$e.length:Me==="values"?oe.length:0;if(Me==="rows"){let Ye=He.indexOf(K.key);return Ye>=0?Ye:He.length}if(Me==="columns"){let Ye=at.indexOf(K.key);return Ye>=0?Ye:at.length}if(Me==="filters"){let Ye=$e.indexOf(K.key);return Ye>=0?Ye:$e.length}if(Me==="values"){let Ye=oe.findIndex(Rt=>Rt.tokenId===K.key);return Ye>=0?Ye:oe.length}return 0};if(de==="palette"){Tt(He),Ft(at),ut($e),Bt(oe);return}if(de==="values"){let Me=Qe("values"),Ye=J??me(ue);oe.splice(Me,0,Ye),Tt(He),Ft(at),ut($e),Bt(oe);return}if(Du(de)){Oe();let Me=Qe(de);de==="rows"?He.splice(Me,0,ue):de==="columns"?at.splice(Me,0,ue):$e.splice(Me,0,ue),Tt(He),Ft(at),ut($e),Bt(oe);}},[Be,me,ce,nt,fe]),gt=Jt.useCallback((M,G)=>{we(K=>({...K,[M]:G}));},[]),kt=Jt.useCallback(M=>{Et(G=>{let K=new Set(G);return K.has(M)?K.delete(M):K.add(M),K});},[]),nr=Jt.useCallback(M=>{re(G=>{let K=new Set(G);return K.has(M)?K.delete(M):K.add(M),K});},[]),Ht=Jt.useCallback(M=>{let G=E.get(M.fieldId),K=Sl(G);return e(yo,{size:"small",sx:{minWidth:98},children:e(Wt,{value:M.aggregation,onChange:de=>Xe(M.tokenId,de.target.value),onClick:de=>de.stopPropagation(),onMouseDown:de=>de.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& select.orb-inp":{py:.35}},children:K.map(de=>e("option",{value:de,sx:{fontSize:"0.75rem"},children:R(de)},de))})})},[E,R,Xe]),Yt=Jt.useCallback(M=>{let G=xt[M]??[],K=ee[M]??G;return G.length===0?g("pivot.filter.noValues"):K.length===0?g("pivot.filter.noneSelected"):K.length===G.length?g("pivot.filter.allValues"):g("pivot.filter.selectedCount",{selected:K.length,total:G.length})},[xt,ee,g]),Vt=Jt.useCallback(M=>{let G=xt[M]??[],K=ee[M]??G;return e(Lu,{options:G,selectedValues:K,onChange:de=>gt(M,de)})},[xt,ee,gt]),qt=Jt.useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),$t=Jt.useCallback(()=>{let M={};return new Set([...wt,...Object.keys(ee)]).forEach(K=>{if(!S.has(K))return;let de=ee[K]??[];M[K]=[...de];}),{layout:{rows:[...nt],columns:[...Be],filters:[...ce],values:fe.map(K=>({fieldId:K.fieldId,aggregation:K.aggregation}))},filterSelections:M,showGrandTotal:Ie,chart:{dimensionFieldId:je,primaryValueFieldId:mt,secondaryValueFieldId:pt,chartType:Ot}}},[wt,je,mt,pt,Ot,Be,ce,ee,nt,Ie,S,fe]),rr=Jt.useCallback(M=>{let G=lr(M.layout.rows,S),K=lr(M.layout.columns,S),de=lr(M.layout.filters,S),He=new Set,at=(M.layout.values??[]).filter(ue=>!S.has(ue.fieldId)||He.has(ue.fieldId)?false:(He.add(ue.fieldId),true)).map(ue=>me(ue.fieldId,ue.aggregation)),$e={};Object.entries(M.filterSelections??{}).forEach(([ue,J])=>{!S.has(ue)||!Array.isArray(J)||($e[ue]=Array.from(new Set(J.map(Oe=>String(Oe)))));}),Tt(G),Ft(K),ut(de),Bt(at),we($e),typeof M.showGrandTotal=="boolean"&&W(M.showGrandTotal),te(Tl(G,K,M.chart?.dimensionFieldId));let oe=Ji(at,M.chart?.primaryValueFieldId);Ne(oe),he(Il(at,oe,M.chart?.secondaryValueFieldId)),Ae(M.chart?.chartType??"bar-vertical"),U(M.id),y?.(M);},[me,y,te,Ne,he,Ae,Ft,ut,we,Tt,W,Bt,S]),ar=Jt.useCallback(M=>{if(!M){U("");return}let G=bt.find(K=>K.id===M);if(!G){U("");return}rr(G);},[rr,bt]),gr=Jt.useCallback(()=>{let M=g("pivot.preset.defaultName",{index:bt.length+1});st(M),ye(true);},[bt.length,g]),Ir=Jt.useCallback(()=>{let M=Le.trim();if(!M)return;let G={id:qt(),name:M,...$t()};qe(K=>[...K,G]),U(G.id),ye(false);},[$t,qt,Le,qe]),Rr=Jt.useCallback(()=>{Ze&&(qe(M=>M.filter(G=>G.id!==Ze)),U(""));},[Ze,qe]);Jt.useEffect(()=>{if(!v||C.current)return;let M=bt.find(G=>G.id===v);M&&(C.current=true,rr(M));},[rr,v,bt]),Jt.useEffect(()=>{Ze&&(bt.some(M=>M.id===Ze)||U(""));},[Ze,bt]);let oo=Jt.useMemo(()=>{if(!Ie||!j||!nt.length)return null;let M={};return j.dataColumns.forEach(G=>{let K=H.filter(de=>{let He=Be.length>0?Be.map(at=>co(de[at])):[g("pivot.valueLabel")];return $o(He)===G.colKey});M[G.id]=xn(K,G.valueItem.fieldId,G.valueItem.aggregation);}),{key:"__grand_total__",value:g("pivot.grandTotal")||Pu,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:M,path:[],depth:-1}},[Ie,j,H,Be,nt.length,g]),vr=Jt.useMemo(()=>Ku(j?.rowTree??[]),[j]),Or=Jt.useMemo(()=>Ku(j?.columnTree??[]),[j]);Jt.useEffect(()=>{Et(M=>{let G=new Set;return M.has("__grand_total__")&&G.add("__grand_total__"),vr.forEach(K=>{M.has(K)&&G.add(K);}),G});},[vr]),Jt.useEffect(()=>{re(M=>{let G=new Set;return Or.forEach(K=>{M.has(K)&&G.add(K);}),G});},[Or]);let Ko=Jt.useCallback(()=>{Et(M=>{let G=new Set(M);return vr.forEach(K=>G.add(K)),G});},[vr]),qo=Jt.useCallback(()=>{Et(M=>{let G=new Set;return M.has("__grand_total__")&&G.add("__grand_total__"),G});},[]),Eo=Jt.useCallback(()=>{re(new Set(Or));},[Or]),Xo=Jt.useCallback(()=>{re(new Set);},[]),Yo=Jt.useMemo(()=>!j||Be.length===0?[]:Wv(j.columnTree,Lt),[Be.length,Lt,j]),Mr=Jt.useMemo(()=>{if(!j)return [];if(Be.length===0)return j.dataColumns.map(G=>({id:G.id,label:G.label,leafColumnIds:[G.id],valueItem:G.valueItem}));let M=new Map(j.dataColumns.map(G=>[G.id,G]));return Yo.flatMap(G=>{let K=new Map;return G.leafColumnIds.forEach(de=>{let He=M.get(de);if(!He)return;let at=He.valueItem.tokenId,$e=`${R(He.valueItem.aggregation)} ${E.get(He.valueItem.fieldId)?.label??He.valueItem.fieldId}`,oe=K.get(at);if(oe){oe.leafColumnIds.push(de);return}K.set(at,{id:`${G.key}::${at}`,label:fe.length>1?$e:G.label,leafColumnIds:[de],valueItem:He.valueItem});}),Array.from(K.values())})},[Be.length,E,R,j,fe.length,Yo]),Lo=Jt.useMemo(()=>new Map(Mr.map(M=>[M.id,M])),[Mr]),Zo=Jt.useMemo(()=>Mr.map(M=>({id:M.id,colKey:M.id,valueItem:M.valueItem,label:M.label})),[Mr]),Kr=Jt.useMemo(()=>{if(!j||Be.length===0)return [];let M=[],G=qu(j.columnTree,Lt),K=G+(fe.length>1?1:0),de=(He,at)=>{M[at]??(M[at]=[]),He.forEach($e=>{let oe=$e.children.length>0&&Lt.has($e.key),ue=Mr.filter(Oe=>$e.leafColumnIds.some(Qe=>Oe.leafColumnIds.includes(Qe))).length,J=oe||fe.length>1?1:K-at;M[at].push({key:$e.key,label:$e.label,colSpan:ue,rowSpan:J,expandable:$e.children.length>0,expanded:oe}),oe&&de($e.children,at+1);});};return de(j.columnTree,0),fe.length>1&&(M[G]=Mr.map(He=>({key:He.id,label:He.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),M},[Be.length,Lt,j,fe.length,Mr]),no=Jt.useCallback((M,G)=>G.leafColumnIds.reduce((K,de)=>K+(M.aggregatedValues[de]??0),0),[]),An=Jt.useMemo(()=>c(jsxRuntime.Fragment,{children:[e(Ce,{size:"small",variant:"text",onClick:Ko,disabled:vr.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g("pivot.table.expandRowsAll")}),e(Ce,{size:"small",variant:"text",onClick:qo,disabled:vr.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g("pivot.table.collapseRowsAll")}),e(At,{orientation:"vertical",flexItem:true}),e(Ce,{size:"small",variant:"text",onClick:Eo,disabled:Or.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g("pivot.table.expandColumnsAll")}),e(Ce,{size:"small",variant:"text",onClick:Xo,disabled:Be.length===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g("pivot.table.collapseColumnsAll")})]}),[Be.length,Or.size,vr.size,Xo,qo,Eo,Ko,g]),Oo=()=>{if(!Je)return null;let M=Ui(Je);if(!M||M.kind!=="item"||!M.key)return null;if(M.zone==="palette"){let He=E.get(M.key);return He?e(wl,{label:He.label,subtitle:He.type}):null}if(M.zone==="values"){let He=fe.find(ue=>ue.tokenId===M.key);if(!He)return null;let $e=E.get(He.fieldId)?.label??He.fieldId,oe=`${R(He.aggregation)}(${$e})`;return e(qi,{label:$e,caption:oe})}let K=E.get(M.key)?.label??M.key,de=Yt(M.key);return e(qi,{label:K,caption:de})};return c(Ee,{sx:M=>({p:{xs:1.2,md:2},borderRadius:"var(--orb-r-container)",border:`1px solid ${M.palette.divider}`,bgcolor:"var(--orb-canvas)",boxShadow:"var(--orb-shadow-2)",display:"flex",flexDirection:"column",gap:2.25}),children:[c("div",{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1.5,flexWrap:"wrap"},children:[c("div",{sx:{minWidth:0,display:"flex",flexDirection:"column",gap:.35},children:[e(L,{component:"div",sx:{fontSize:"1.08rem",fontWeight:700,lineHeight:1.25,color:"var(--orb-fg-strong)"},children:P}),e(L,{component:"div",sx:{fontSize:"0.8rem",fontWeight:400,color:"var(--orb-fg)"},children:g("pivot.subtitle.default")})]}),c(ie,{direction:"row",spacing:1.5,alignItems:"center",children:[xr&&c(jsxRuntime.Fragment,{children:[e(yo,{size:"small",sx:{minWidth:200},children:c(Wt,{value:Ze,displayEmpty:true,onChange:M=>ar(String(M.target.value)),sx:{fontSize:"0.75rem",height:32},children:[e("option",{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:g("pivot.preset.selectPlaceholder")}),bt.map(M=>e("option",{value:M.id,sx:{fontSize:"0.75rem"},children:M.name},M.id))]})}),e(lt,{title:g("pivot.preset.save"),children:e(ae,{size:"small",onClick:gr,"aria-label":g("pivot.preset.save"),sx:{width:28,height:28,p:0},children:e(ko,{size:15})})}),e(lt,{title:g("pivot.preset.delete"),children:e("span",{children:e(ae,{size:"small",onClick:Rr,disabled:!Ze,"aria-label":g("pivot.preset.delete"),sx:{width:28,height:28,p:0},children:e(oi,{size:15})})})}),e(At,{flexItem:true,orientation:"vertical"})]}),c(L,{component:"div",sx:{fontSize:"0.75rem",fontWeight:400,color:"var(--orb-fg)"},children:[g("pivot.records"),": ",e("strong",{children:r.length.toLocaleString()})," / ",g("pivot.afterFilter"),":"," ",e("strong",{children:H.length.toLocaleString()})]}),e(At,{flexItem:true,orientation:"vertical"}),c("div",{sx:{display:"flex",alignItems:"center",gap:.6},children:[e(L,{component:"div",sx:{fontSize:"0.75rem",fontWeight:500,color:"var(--orb-fg-strong)"},children:g("pivot.grandTotal")}),e(Ja,{size:"small",checked:Ie,onChange:M=>W(M.target.checked)})]})]})]}),e(At,{}),c(core.DndContext,{sensors:x,collisionDetection:core.closestCenter,onDragStart:It,onDragEnd:ft,children:[e(Bu,{isConfiguratorCollapsed:Re,onToggleCollapse:()=>Y(M=>!M),availableFields:Nt,fieldMap:E,filterFields:ce,columnFields:Be,rowFields:nt,valueFields:fe,clearZone:Se,removeFieldFromZone:tt,getFilterSelectionSummary:Yt,renderDimensionFilterSelect:Vt,renderAggregationSelect:Ht,getAggregationLabel:R}),e(Sd,{children:e(core.DragOverlay,{dropAnimation:{duration:250,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:Oo()})})]}),e(_u,{rows:H,fieldMap:E,rowFields:nt,columnFields:Be,valueFields:fe,chartDimensionFieldId:je,chartPrimaryValueFieldId:mt,chartSecondaryValueFieldId:pt,chartType:Ot,isCollapsed:Kt,onChartDimensionFieldIdChange:M=>te(M),onChartPrimaryValueFieldIdChange:M=>Ne(M),onChartSecondaryValueFieldIdChange:M=>he(M),onChartTypeChange:M=>Ae(M),onToggleCollapse:()=>Ke(M=>!M),getAggregationLabel:R}),e(kn,{title:g("pivot.table.sectionTitle"),subtitle:nt.length>0?nt.map(M=>E.get(M)?.label??M).join(" > "):g("pivot.table.dimensions"),collapsed:yt,onToggleCollapse:()=>et(M=>!M),expandAriaLabel:g("pivot.table.collapse.ariaExpand"),collapseAriaLabel:g("pivot.table.collapse.ariaCollapse"),bodySx:{p:0},headerActions:An,children:j===null?e("div",{sx:{py:5,px:{xs:1.2,md:1.6},textAlign:"center"},children:e(L,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:w})}):e("div",{sx:{maxHeight:s},children:c("table",{className:"orb-tbl",size:"small",stickyHeader:true,children:[e("thead",{children:(Kr.length>0?Kr:[[]]).map((M,G)=>c("tr",{children:[G===0&&e("td",{rowSpan:Math.max(Kr.length,1),sx:K=>({fontWeight:800,fontSize:"0.76rem",color:"text.primary",bgcolor:ht()==="dark"?"var(--orb-canvas)":"var(--orb-surface)",borderBottom:`1px solid ${K.palette.divider}`,pl:2,minWidth:220,verticalAlign:"middle"}),children:nt.length>0?nt.map(K=>E.get(K)?.label).join(" > "):g("pivot.table.dimensions")}),(M.length>0?M:Mr.map(K=>({key:K.id,label:K.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))).map(K=>e("td",{align:"center",colSpan:K.colSpan,rowSpan:K.rowSpan,sx:de=>({fontWeight:800,fontSize:"0.75rem",color:"text.primary",bgcolor:ht()==="dark"?"var(--orb-canvas)":"var(--orb-surface)",borderBottom:`1px solid ${de.palette.divider}`,minWidth:148,verticalAlign:"middle"}),children:c("div",{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:.4},children:[K.expandable&&e(ae,{size:"small",onClick:()=>nr(K.key),sx:{width:22,height:22,p:0,ml:-0.2},children:K.expanded?e(Vr,{size:12}):e(wo,{size:12})}),e("div",{component:"span",children:K.label})]})},K.key))]},`pivot-header-row-${G}`))}),c("tbody",{children:[j.rowTree.map(M=>e(ji,{node:M,dataColumns:Zo,fieldMap:E,level:0,expandedKeys:St,onToggle:kt,getValue:(G,K)=>{let de=Lo.get(K);return de?no(G,de):0}},M.key)),oo&&e(ji,{node:oo,dataColumns:Zo,fieldMap:E,level:0,expandedKeys:St,onToggle:kt,getValue:(M,G)=>{let K=Lo.get(G);return K?no(M,K):0}})]})]})})}),c(zt,{open:Fe,onClose:()=>ye(false),maxWidth:"xs",fullWidth:true,children:[e("div",{className:"orb-dialog-title",children:g("pivot.preset.saveDialogTitle")}),e("div",{className:"orb-dialog-content",children:e(ze,{autoFocus:true,fullWidth:true,margin:"dense",label:g("pivot.preset.nameLabel"),value:Le,onChange:M=>st(M.target.value),onKeyDown:M=>{M.key==="Enter"&&(M.preventDefault(),Ir());}})}),c("div",{className:"orb-dialog-actions",children:[e(Ce,{onClick:()=>ye(false),children:g("common.cancel")}),e(Ce,{variant:"contained",onClick:Ir,disabled:!Le.trim(),children:g("common.save")})]})]})]})};var Xu=(t,r,o)=>{let n=[...t,...r];return o&&n.includes(o)?o:n[0]??""},Ml=(t,r)=>r&&t.some(o=>o.fieldId===r)?r:t[0]?.fieldId??"",Yu=(t,r,o)=>o===""?"":o&&o!==r&&t.some(n=>n.fieldId===o)?o:t.find(n=>n.fieldId!==r)?.fieldId??"",GL=({fields:t,initialLayout:r,initialFilterSelections:o={},initialShowGrandTotal:n=true,initialConfiguratorCollapsed:a=false,initialChart:i,initialChartCollapsed:s=false,initialTableCollapsed:l=false})=>{let d=Jt.useRef(0),p=Jt.useMemo(()=>new Set(t.map(U=>U.id)),[t]),u=Jt.useMemo(()=>new Map(t.map(U=>[U.id,U])),[t]),[f,b]=Jt.useState(()=>lr(r?.rows,p)),[m,v]=Jt.useState(()=>lr(r?.columns,p)),[y,g]=Jt.useState(()=>lr(r?.filters,p)),[x,h]=Jt.useState(()=>{let U=r?.values??[],Fe=new Set,ye=[];return U.forEach(Le=>{!p.has(Le.fieldId)||Fe.has(Le.fieldId)||(Fe.add(Le.fieldId),d.current+=1,ye.push({tokenId:`v${d.current}`,fieldId:Le.fieldId,aggregation:hr(Le.aggregation,u.get(Le.fieldId))}));}),ye}),[C,P]=Jt.useState(o),[w,k]=Jt.useState(n),[R,S]=Jt.useState(a),[E,D]=Jt.useState(()=>Xu(lr(r?.rows,p),lr(r?.columns,p),i?.dimensionFieldId)),[I,A]=Jt.useState(()=>{let U=(()=>{let Fe=r?.values??[],ye=new Set,Le=[];return Fe.forEach(st=>{!p.has(st.fieldId)||ye.has(st.fieldId)||(ye.add(st.fieldId),Le.push({tokenId:st.fieldId,fieldId:st.fieldId,aggregation:hr(st.aggregation,u.get(st.fieldId))}));}),Le})();return Ml(U,i?.primaryValueFieldId)}),[N,O]=Jt.useState(()=>{let U=(()=>{let ye=r?.values??[],Le=new Set,st=[];return ye.forEach(Je=>{!p.has(Je.fieldId)||Le.has(Je.fieldId)||(Le.add(Je.fieldId),st.push({tokenId:Je.fieldId,fieldId:Je.fieldId,aggregation:hr(Je.aggregation,u.get(Je.fieldId))}));}),st})(),Fe=Ml(U,i?.primaryValueFieldId);return Yu(U,Fe,i?.secondaryValueFieldId)}),[F,q]=Jt.useState(i?.chartType??"bar-vertical"),[z,X]=Jt.useState(s),[$,_]=Jt.useState(l);Jt.useEffect(()=>{b(U=>{let Fe=U.filter(ye=>p.has(ye));return po(U,Fe)?U:Fe}),v(U=>{let Fe=U.filter(ye=>p.has(ye));return po(U,Fe)?U:Fe}),g(U=>{let Fe=U.filter(ye=>p.has(ye));return po(U,Fe)?U:Fe}),h(U=>{let Fe=U.filter(ye=>p.has(ye.fieldId)).map(ye=>({...ye,aggregation:hr(ye.aggregation,u.get(ye.fieldId))}));return Ki(U,Fe)?U:Fe});},[u,p]),Jt.useEffect(()=>{D(U=>Xu(f,m,U));},[m,f]),Jt.useEffect(()=>{A(U=>Ml(x,U));},[x]),Jt.useEffect(()=>{O(U=>Yu(x,I,U));},[I,x]);let V=Jt.useCallback(U=>{b(lr(U,p));},[p]),B=Jt.useCallback(U=>{v(lr(U,p));},[p]),Z=Jt.useCallback(U=>{g(lr(U,p));},[p]),Q=Jt.useCallback(U=>{h(Fe=>{let ye=U??[],Le=new Set,st=[];return ye.forEach(Je=>{if(!p.has(Je.fieldId)||Le.has(Je.fieldId))return;Le.add(Je.fieldId);let vt=Fe.find(St=>St.fieldId===Je.fieldId);if(vt){st.push({...vt,aggregation:hr(Je.aggregation??vt.aggregation,u.get(Je.fieldId))});return}d.current+=1,st.push({tokenId:`v${d.current}`,fieldId:Je.fieldId,aggregation:hr(Je.aggregation,u.get(Je.fieldId))});}),st});},[u,p]),ge=Jt.useCallback(U=>{V(U.rows??[]),B(U.columns??[]),Z(U.filters??[]),Q(U.values??[]);},[B,Z,V,Q]),se=Jt.useCallback(U=>{if(U==="rows")return b([]);if(U==="columns")return v([]);if(U==="filters")return g([]);h([]);},[]),le=Jt.useCallback((U,Fe)=>{if(U==="rows")return b(ye=>ye.filter(Le=>Le!==Fe));if(U==="columns")return v(ye=>ye.filter(Le=>Le!==Fe));if(U==="filters")return g(ye=>ye.filter(Le=>Le!==Fe));h(ye=>ye.filter(Le=>Le.tokenId!==Fe));},[]),be=Jt.useCallback((U,Fe)=>{h(ye=>ye.map(Le=>Le.tokenId===U?{...Le,aggregation:hr(Fe,u.get(Le.fieldId))}:Le));},[u]),_e=Jt.useCallback((U,Fe)=>{P(ye=>({...ye,[U]:Fe}));},[]),De=Jt.useCallback(()=>{P({});},[]),Pe=Jt.useCallback(()=>{k(U=>!U);},[]),Ve=Jt.useCallback(()=>{S(U=>!U);},[]),Te=Jt.useCallback(U=>{D(U);},[]),xe=Jt.useCallback(U=>{A(U);},[]),We=Jt.useCallback(U=>{O(U);},[]),ot=Jt.useCallback(()=>{X(U=>!U);},[]),it=Jt.useCallback(()=>{_(U=>!U);},[]);return {model:Jt.useMemo(()=>({rowFields:f,setRowFields:b,columnFields:m,setColumnFields:v,filterFields:y,setFilterFields:g,valueFields:x,setValueFields:h,filterSelections:C,setFilterSelections:P,showGrandTotal:w,setShowGrandTotal:k,isConfiguratorCollapsed:R,setIsConfiguratorCollapsed:S,chartDimensionFieldId:E,setChartDimensionFieldId:D,chartPrimaryValueFieldId:I,setChartPrimaryValueFieldId:A,chartSecondaryValueFieldId:N,setChartSecondaryValueFieldId:O,chartType:F,setChartType:q,isChartCollapsed:z,setIsChartCollapsed:X,isTableCollapsed:$,setIsTableCollapsed:_}),[E,I,N,F,m,y,C,z,R,$,f,w,x]),actions:{setRows:V,setColumns:B,setFilters:Z,setValues:Q,setLayout:ge,clearZone:se,removeFieldFromZone:le,setAggregationForValue:be,setFilterSelection:_e,resetFilterSelections:De,toggleGrandTotal:Pe,toggleConfigurator:Ve,setChartDimension:Te,setChartPrimaryValue:xe,setChartSecondaryValue:We,setChartType:q,toggleChart:ot,toggleTable:it}}};var qL=({orientation:t="auto",defaultNavigationOpen:r,onNavOpenChange:o}={})=>{let n=sr(),a=Co("(orientation: portrait)"),i=Co(n.breakpoints.down("md")),s=Jt.useMemo(()=>t==="auto"?a||i?"portrait":"landscape":t,[i,a,t]),[l,d]=Jt.useState(r??s==="landscape");Jt.useEffect(()=>{d(r??s==="landscape");},[r,s]);let p=f=>{d(f),o?.(f);};return {resolvedOrientation:s,isPortraitViewport:a,isCompactViewport:i,navigationOpen:l,setNavigationOpen:p,toggleNavigationOpen:()=>p(!l)}};var qv=t=>{let r=Number(t||0);return Number.isFinite(r)?r:0},ZL=({rows:t,rowKey:r="id",numericField:o,defaultSelectedId:n})=>{let i=t[0]?.[r],[s,l]=Jt.useState(n??i),d=Jt.useMemo(()=>t.find(m=>m[r]===s)||t[0],[r,t,s]),[p,u]=Jt.useState(()=>{let m=d?.[o];return m==null?"0":String(m)});return {selectedId:s,selectedRecord:d,editorValue:p,setEditorValue:u,selectRecord:m=>{let v=m[r];l(v);let y=m[o];u(y==null?"0":String(y));},applyEditorValue:m=>{if(s===void 0)return;let v=qv(p),y=t.map(g=>g[r]===s?{...g,[o]:v}:g);m(y);}}};T();var Xv=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],ju=(t,r,o,n)=>{r?.(t),n&&o?.();},rO=({open:t,onClose:r,title:o="Scan barcode",subtitle:n="Use the rear camera on the device. If scanning is unavailable, enter the code manually.",formats:a=Xv,facingMode:i="environment",manualEntry:s=true,autoCloseOnDetect:l=true,scanIntervalMs:d=600,confirmLabel:p="Use code",cancelLabel:u="Close",manualPlaceholder:f="Enter barcode manually",onDetected:b,onError:m,sx:v})=>{let y=Jt__namespace.default.useRef(null),g=Jt__namespace.default.useRef(null),x=Jt__namespace.default.useRef(null),h=Jt__namespace.default.useRef(null),[C,P]=Jt__namespace.default.useState("idle"),[w,k]=Jt__namespace.default.useState(""),[R,S]=Jt__namespace.default.useState(null),[E,D]=Jt__namespace.default.useState(null),I=Jt__namespace.default.useCallback(()=>{x.current!==null&&(window.clearInterval(x.current),x.current=null),g.current&&(g.current.getTracks().forEach(O=>O.stop()),g.current=null),y.current&&(y.current.srcObject=null);},[]),A=Jt__namespace.default.useCallback(O=>{D(O),P("error"),m?.(O);},[m]);Jt__namespace.default.useEffect(()=>{if(!t){I(),P("idle"),D(null),k("");return}let O=false;return (async()=>{if(!(typeof window>"u"||typeof navigator>"u")){if(!navigator.mediaDevices?.getUserMedia){P("unsupported"),D("Camera access is not supported in this browser.");return}P("starting"),D(null);try{let q=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:i}}});if(O){q.getTracks().forEach(z=>z.stop());return}if(g.current=q,y.current&&(y.current.srcObject=q,await y.current.play()),!window.BarcodeDetector){P("unsupported"),D("BarcodeDetector is not available. Camera preview is ready and manual entry is enabled.");return}h.current=new window.BarcodeDetector({formats:a}),P("ready"),x.current=window.setInterval(async()=>{if(!(!y.current||!h.current)&&!(y.current.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))try{let X=(await h.current.detect(y.current)).find(_=>_.rawValue);if(!X?.rawValue)return;let $={rawValue:X.rawValue,format:X.format};S($),I(),ju($,b,r,l);}catch(z){A(z instanceof Error?z.message:"Failed to detect barcode.");}},d);}catch(q){A(q instanceof Error?q.message:"Unable to start camera.");}}})(),()=>{O=true,I();}},[l,i,a,r,b,t,A,d,I]);let N=()=>{let O=w.trim();if(!O)return;let F={rawValue:O,format:"manual"};S(F),ju(F,b,r,l);};return c(zt,{open:t,onClose:r,fullWidth:true,maxWidth:"sm",children:[e("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:900},children:o}),e("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:c(ie,{spacing:2,sx:v,children:[e(L,{sx:{fontSize:"0.88rem",color:"text.secondary",lineHeight:1.55},children:n}),c(Ee,{elevation:0,sx:{position:"relative",overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:"divider",minHeight:280,background:ht()==="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:[e("video",{ref:y,muted:true,playsInline:true,autoPlay:true,style:{width:"100%",height:280,objectFit:"cover",display:"block"}}),e("div",{sx:{pointerEvents:"none",position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:e("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:e("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)"}})})}),c("div",{sx:{position:"absolute",top:12,left:12,display:"flex",gap:1,flexWrap:"wrap"},children:[e(Pt,{icon:e(Od,{}),label:C==="ready"?"Camera ready":C==="starting"?"Starting camera":C==="unsupported"?"Preview only":C==="error"?"Scanner error":"Idle",size:"small",color:C==="error"?"error":"primary",variant:"filled"}),R?e(Pt,{icon:e(tp,{}),label:`${R.format||"barcode"}: ${R.rawValue}`,size:"small",color:"success",variant:"filled"}):null]})]}),E?e(jr,{severity:C==="unsupported"?"info":"warning",children:E}):null,s?c(ie,{direction:{xs:"column",sm:"row"},spacing:1.25,children:[e(ze,{fullWidth:true,label:"Barcode",placeholder:f,value:w,onChange:O=>k(O.target.value)}),e(Ce,{variant:"contained",onClick:N,sx:{minHeight:56,px:2.5},children:p})]}):null]})}),e("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:e(Ce,{onClick:r,children:u})})]})};T();var Yv={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)"},cO=({title:t,description:r,kicker:o,icon:n,badges:a=[],metrics:i=[],footer:s,children:l,selected:d=false,draggable:p=false,isDragging:u=false,swipeThreshold:f=88,startAction:b,endAction:m,dragHandleProps:v,onClick:y,onSwipe:g,sx:x})=>{let[h,C]=Jt.useState(0),[P,w]=Jt.useState(false),k=Jt.useRef(null),R=Jt.useRef(0),S=Jt.useRef(0),E=!!(b||m),D=132,I=()=>{C(0),w(false),k.current=null,R.current=0,S.current=0;},A=z=>{(z==="start"?b:m)?.onTrigger?.(),g?.(z),I();},N=z=>{!E||z.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(k.current=z.pointerId,R.current=z.clientX,S.current=z.clientX,w(true),z.currentTarget.setPointerCapture(z.pointerId));},O=z=>{if(!P||k.current!==z.pointerId)return;S.current=z.clientX;let X=S.current-R.current,$=Math.max(-D,Math.min(D,X));C($);},F=z=>{if(!P||k.current!==z.pointerId)return;let X=S.current-R.current;if(X>=f&&b){A("start");return}if(X<=-f&&m){A("end");return}Math.abs(X)<12&&y?.(),I();},q=(z,X)=>{if(!z)return null;let $=z.backgroundColor||Yv[z.tone||"default"];return e("div",{sx:{position:"absolute",top:0,bottom:0,[X]:0,width:D,px:2,display:"flex",alignItems:"center",justifyContent:X==="left"?"flex-start":"flex-end",color:"var(--orb-on-primary)",background:`linear-gradient(135deg, ${$}, rgba(15,23,42,0.92))`},children:c(ie,{direction:"row",spacing:1,alignItems:"center",children:[z.icon,e(L,{sx:{fontWeight:700,fontSize:"0.95rem"},children:z.label})]})})};return c("div",{sx:{position:"relative",overflow:"hidden",borderRadius:4,...x},children:[q(b,"left"),q(m,"right"),e(Ee,{elevation:0,onPointerDown:N,onPointerMove:O,onPointerUp:F,onPointerCancel:I,sx:{position:"relative",zIndex:1,p:2,borderRadius:4,border:"1px solid",borderColor:d?"primary.main":"divider",background:ht()==="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(${h}px, 0, 0) scale(${u?.985:1})`,transition:P?"none":"transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease",touchAction:"pan-y",cursor:y?"pointer":"default",opacity:u?.9:1},children:c(ie,{spacing:1.5,children:[c(ie,{direction:"row",spacing:1.5,alignItems:"flex-start",children:[n?e("div",{sx:{mt:.25},children:n}):null,c("div",{sx:{flex:1,minWidth:0},children:[o?e(L,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:"0.08em",color:"text.secondary"},children:o}):null,e(L,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:t}),r?e(L,{sx:{mt:.5,fontSize:"0.9rem",color:"text.secondary",lineHeight:1.45},children:r}):null]}),p?e("div",{"data-no-swipe":"true",...v,sx:{alignSelf:"center",display:"inline-flex",touchAction:"none"},children:e(ae,{size:"small",children:e(Gd,{})})}):null]}),a.length>0?e(ie,{direction:"row",spacing:1,useFlexGap:true,flexWrap:"wrap",children:a.map((z,X)=>e(Pt,{label:z,size:"small",sx:{borderRadius:999,fontWeight:700,bgcolor:"action.hover",color:"text.primary"}},X))}):null,i.length>0?e("div",{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:1},children:i.map(z=>c(Ee,{elevation:0,sx:{p:1.25,borderRadius:3,bgcolor:"action.hover",border:"1px solid",borderColor:"divider",color:"text.primary"},children:[e(L,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:z.label}),e(L,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.2},children:z.value})]},z.id))}):null,l,s]})})]})};T();var ua=({label:t,onPress:r,emphasis:o="default"})=>e("div",{component:"button",type:"button",onClick:r,sx:n=>({minHeight:72,borderRadius:3,border:"1px solid",borderColor:o==="primary"?"primary.main":"divider",background:o==="primary"?n.palette.primary.main:o==="danger"?ht()==="dark"?"color-mix(in oklch, var(--orb-status-error) 18%, transparent)":"color-mix(in oklch, var(--orb-status-error) 10%, transparent)":ht()==="dark"?"rgba(255,255,255,0.04)":"var(--orb-canvas)",color:o==="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}),hO=({value:t,defaultValue:r="",title:o,subtitle:n,placeholder:a="0",allowDecimal:i=false,allowNegative:s=false,maxLength:l,confirmLabel:d,clearLabel:p,backspaceLabel:u,onChange:f,onSubmit:b,onClose:m,sx:v})=>{let{t:y}=pe(),[g,x]=Jt.useState(r),h=t??g,C=I=>{t===void 0&&x(I),f?.(I);},P=I=>{l&&h.length>=l||C(`${h}${I}`);},w=I=>{if(I==="00"){if(!h){C("0");return}P("00");return}P(I);},k=()=>{!i||h.includes(".")||C(h?`${h}.`:"0.");},R=()=>{if(s){if(h.startsWith("-")){C(h.slice(1));return}C(h?`-${h}`:"-");}},S=()=>{C(h.slice(0,-1));},E=()=>{C("");},D=()=>{b?.(h);};return e(Ee,{elevation:0,sx:{p:2,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",...v},children:c(ie,{spacing:2,children:[c(ie,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[c("div",{sx:{minWidth:0},children:[o?e(L,{sx:{fontSize:"1rem",fontWeight:800},children:o}):null,n?e(L,{sx:{mt:.5,fontSize:"0.86rem",color:"text.secondary"},children:n}):null]}),m?e(ae,{onClick:m,size:"small",children:e(Wd,{})}):null]}),e(Ee,{elevation:0,sx:{p:2,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:e(L,{sx:{minHeight:38,fontSize:h?"1.9rem":"1.25rem",fontWeight:900,letterSpacing:"0.06em",color:h?"text.primary":"text.disabled"},children:h||a})}),c("div",{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[["1","2","3","4","5","6","7","8","9"].map(I=>e(ua,{label:I,onPress:()=>w(I)},I)),e(ua,{label:s?"+/-":"00",onPress:s?R:()=>w("00")}),e(ua,{label:"0",onPress:()=>w("0")}),e(ua,{label:i?".":u?String(u):"DEL",onPress:i?k:S})]}),c("div",{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[e("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:c(ie,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[e(Ld,{}),e(L,{sx:{fontWeight:700},children:u||"DEL"})]})}),e(ua,{label:String(p||"CLR"),onPress:E,emphasis:"danger"}),e("div",{component:"button",type:"button",onClick:D,sx:I=>({minHeight:64,borderRadius:3,border:"1px solid",borderColor:"primary.main",background:I.palette.primary.main,color:"var(--orb-on-primary)",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"}),children:c(ie,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[e(Bd,{}),e(L,{sx:{fontWeight:800},children:d||y("common.ok")})]})})]})]})})};T();var Ju=({touchMode:t="comfortable",sx:r,...o})=>{let n=t==="expanded";return e("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},...r},children:e(Wr,{...o})})};T();var ey=(t,r,o)=>{if(o?.(r),!!r.href){if(r.href.startsWith("http://")||r.href.startsWith("https://")){window.open(r.href,"_blank");return}t.push(r.href);}},em=({items:t,selectedId:r,orientation:o="auto",onItemSelect:n,sx:a})=>{let i=sr(),[s,l]=Jt.useState(false);Jt.useEffect(()=>{l(true);},[]);let d=Co("(orientation: portrait)"),p=Co(i.breakpoints.down("md")),u=o==="auto"?d||p?"portrait":"landscape":o,f=navigation.useRouter();return e("div",{sx:{display:"grid",gridTemplateColumns:!s||u==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(180px, 1fr))",gap:1.5,...a},children:t.map(b=>{let m=b.id===r,v=b.color||(m?i.palette.primary.main:i.palette.divider);return e(Ee,{elevation:0,sx:{overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:m?"primary.main":"divider",boxShadow:m?"0 18px 40px color-mix(in oklch, var(--orb-primary) 16%, transparent)":"none",bgcolor:ht()==="dark"?"color-mix(in oklch, var(--orb-surface-3) 60%, transparent)":"background.paper"},children:e("div",{component:"button",type:"button",disabled:b.disabled,onClick:()=>ey(f,b,n),sx:{width:"100%",p:2,minHeight:u==="portrait"?156:148,display:"block",border:0,background:"transparent",textAlign:"left",cursor:b.disabled?"not-allowed":"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent",color:"text.primary"},children:c(ie,{spacing:1.5,sx:{height:"100%"},children:[c(ie,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[e("div",{sx:{width:44,height:44,borderRadius:3,display:"grid",placeItems:"center",color:m?"var(--orb-on-primary)":"text.primary",background:m?v:"action.hover"},children:b.icon||e(L,{sx:{fontSize:"1rem",fontWeight:900},children:b.title.slice(0,1).toUpperCase()})}),b.badge!==void 0?e("div",{sx:{minWidth:34,px:1,py:.4,borderRadius:999,bgcolor:m?"primary.main":"action.hover",color:m?"var(--orb-on-primary)":"text.secondary",textAlign:"center",fontWeight:800,fontSize:"0.8rem"},children:b.badge}):null]}),c("div",{sx:{flex:1,minWidth:0},children:[e(L,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.25},children:b.title}),b.caption?e(L,{sx:{mt:.5,fontSize:"0.74rem",fontWeight:700,color:"text.secondary"},children:b.caption}):null,b.description?e(L,{sx:{mt:.75,fontSize:"0.84rem",lineHeight:1.45,color:"text.secondary"},children:b.description}):null]})]})})},b.id)})})};T();var om=(t,r)=>r.trim()?t.reduce((o,n)=>{let a=n.title?.toLowerCase().includes(r.toLowerCase())||n.label?.toLowerCase().includes(r.toLowerCase())||n.description?.toLowerCase().includes(r.toLowerCase()),i=n.children?om(n.children,r):[];return (a||i.length>0)&&o.push({...n,children:i.length>0?i:n.children}),o},[]):t,ny=t=>{let r=new Set,o=n=>{n.forEach(a=>{a.children?.length&&(r.add(a.id),o(a.children));});};return o(t),r},nm=({collapsed:t=false,onToggle:r,className:o="",maxHeight:n,menuData:a=[],colorMode:i="light",orientation:s="auto",headerSlot:l,footerSlot:d,activeHref:p,onItemSelect:u})=>{let{t:f}=pe(),b=sr(),m=Dr("(orientation: portrait)"),v=Dr(b.breakpoints.down("md")),y=s==="auto"?m||v?"portrait":"landscape":s,g=i==="dark",x=navigation.useRouter(),h=navigation.usePathname(),[C,P]=Jt.useState(""),[w,k]=Jt.useState(new Set),R=Jt.useMemo(()=>om(a,C),[a,C]),S=Jt.useMemo(()=>C.trim()?ny(R):w,[w,R,C]);Jt.useEffect(()=>{t&&k(new Set);},[t]);let E=O=>O.appurl||O.href||"",D=O=>{u?.(O);let F=E(O);if(F){if(F.startsWith("http://")||F.startsWith("https://")){window.open(F,"_blank");return}x.push(F);}},I=O=>{let F=!!O.children?.length;if(t&&F){r?.();return}if(F){k(q=>{let z=new Set(q);return z.has(O.id)?z.delete(O.id):z.add(O.id),z});return}D(O);},A=O=>{let F=p||h,q=E(O);return !!(q&&F===q)},N=(O,F=0)=>{let q=!!O.children?.length,z=S.has(O.id),X=A(O);return e("div",{sx:{pl:F===0?0:1.5},children:c(Ee,{elevation:0,sx:{mb:1,overflow:"hidden",borderRadius:3,border:"1px solid",borderColor:X?"primary.main":"divider",bgcolor:X?"action.selected":"background.paper"},children:[c("div",{component:"button",type:"button",onClick:()=>I(O),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:[e(ja,{variant:"rounded",sx:{width:40,height:40,bgcolor:X?"primary.main":"action.hover",color:X?"var(--orb-on-primary)":"text.primary"},children:O.icon||(O.title||O.label||"?").slice(0,1).toUpperCase()}),c("div",{sx:{flex:1,minWidth:0},children:[e(L,{sx:{fontSize:"0.95rem",fontWeight:800,lineHeight:1.2},children:O.title||O.label}),O.description?e(L,{sx:{mt:.4,fontSize:"0.78rem",color:"text.secondary",lineHeight:1.35},children:O.description}):null]}),q?e(on,{sx:{transform:z?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):e(ti,{color:"action"})]}),q?e(rn,{in:z,children:e("div",{sx:{px:1.25,pb:1.25},children:O.children?.map($=>N($,F+1))})}):null]})},O.id)};return t?e(Ee,{elevation:0,className:o,sx:{width:y==="portrait"?"100%":88,p:1,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:g?"var(--orb-surface)":"color-mix(in oklch, var(--orb-canvas) 88%, transparent)",maxHeight:n?`${n}px`:void 0,overflowY:"auto"},children:c(ie,{spacing:1,children:[e(ae,{onClick:r,sx:{width:48,height:48,alignSelf:"center",bgcolor:"action.hover"},title:f("navigation.expand"),children:e(si,{})}),a.map(O=>e(ae,{onClick:()=>I(O),sx:{width:56,height:56,alignSelf:"center",borderRadius:3,bgcolor:A(O)?"primary.main":"action.hover",color:A(O)?"var(--orb-on-primary)":"text.primary"},children:O.icon||(O.title||O.label||"?").slice(0,1).toUpperCase()},O.id))]})}):e(Ee,{elevation:0,className:o,sx:{width:y==="portrait"?"100%":320,p:1.25,borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:g?"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:c(ie,{spacing:1.25,sx:{flex:1,minHeight:0},children:[c(ie,{direction:"row",spacing:1,alignItems:"center",children:[e(ze,{value:C,onChange:O=>P(O.target.value),placeholder:f("navigation.searchPlaceholder"),size:"small",fullWidth:true,InputProps:{startAdornment:e(rp,{fontSize:"small",color:"action"})}}),y==="landscape"&&!t?e(ae,{onClick:r,sx:{bgcolor:"action.hover"},children:e(jd,{})}):null]}),l,e("div",{sx:{flex:1,minHeight:0,overflowY:"auto",pr:.25},children:R.length>0?R.map(O=>N(O)):e(L,{sx:{p:2,fontSize:"0.88rem",color:"text.secondary",textAlign:"center"},children:f("navigation.noMatch")})}),d]})})};T();var am=(t,r)=>{let o=r[t.id];if(t.render)return t.render(o,r);if(o==null||o==="")return "--";if(t.numeric){if(typeof o=="number")return o.toLocaleString();if(typeof o=="string"&&o.trim()!==""&&!Number.isNaN(Number(o)))return Number(o).toLocaleString()}return String(o)},ay=t=>Jt__namespace.default.isValidElement(t)?e("div",{sx:{display:"inline-flex",alignItems:"center"},children:t}):e(L,{sx:{mt:.2,fontSize:"0.88rem",fontWeight:800},children:t}),iy=(t,r)=>{let o=r[t.id];if(o==null||o==="")return "--";if(t.numeric){if(typeof o=="number")return o.toLocaleString();if(typeof o=="string"&&o.trim()!==""&&!Number.isNaN(Number(o)))return Number(o).toLocaleString()}return String(o)},sy=({summaryRow:t,visibleColumns:r,columns:o})=>{let n=o.filter(a=>r.includes(a.id)&&t[a.id]!=="");return n.length===0?null:e(Ee,{elevation:0,sx:{p:1.5,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:c(ie,{spacing:1,children:[e(L,{sx:{fontSize:"0.82rem",fontWeight:800,color:"text.secondary"},children:"Summary"}),e("div",{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(132px, 1fr))",gap:1},children:n.map(a=>c(Ee,{elevation:0,sx:{p:1.1,borderRadius:3,border:"1px solid",borderColor:"divider"},children:[e(L,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:a.label}),e(L,{sx:{mt:.25,fontSize:"0.96rem",fontWeight:800},children:t[a.id]})]},`summary-${a.id}`))})]})})},ly=t=>{let{t:r}=pe(),o=sr(),{title:n,showToolbar:a=true,selectionMode:i,selected:s=[],onSelectionChange:l,actions:d,extraTools:p,fitContainer:u=false,fullWidth:f=false,maxHeight:b,loading:m=false,rowsPerPageOptions:v=[20,50,100,-1],onLayoutSave:y,filterConfig:g,rowKey:x,tableKey:h="default",graphReport:C,quickCreate:P,quickEdit:w,quickDelete:k,serviceUrl:R,orientation:S="auto",cardTitleField:E,cardSubtitleFields:D,toolbarSlot:I,emptyState:A,rowHeight:N="comfortable",cardActionSlot:O,renderCardFooter:F,onRowClick:q}=t,z=n||r("table.title.default"),X=Dr("(orientation: portrait)"),$=Dr(o.breakpoints.down("md")),_=S==="auto"?X||$?"portrait":"landscape":S,{columns:V,filterText:B,setFilterText:Z,visibleColumns:Q,showSummary:ge,setShowSummary:se,summaryColumns:le,grouping:be,setGrouping:_e,expandedGroups:De,groupAnchorEl:Pe,setGroupAnchorEl:Ve,summaryAnchorEl:Te,setSummaryAnchorEl:xe,anchorEl:We,setAnchorEl:ot,contextMenu:it,sortedAndFilteredRows:Ze,summaryRow:U,visibleRows:Fe,page:ye,setPage:Le,rowsPerPage:st,setRowsPerPage:Je,totalDisplayCount:vt,setSelected:St,handleClick:Et,toggleSummaryColumn:Lt,handleExport:re,handleCloseContextMenu:nt,toggleColumnVisibility:Be,toggleGroupExpand:ce,handleExpandGroupRecursively:fe,handleCollapseGroupRecursively:ee,handleLayoutLoad:Ie,handleVariantLoad:Re,handleLayoutSave:je,effectiveAppId:mt,currentLayoutData:pt,currentLayoutId:Ot,layoutIdToLoad:Kt,graphReportOpen:yt,handleOpenGraphReport:bt,handleCloseGraphReport:xr}=fn(t),Tt=C?.enabled??false,Ft=Tt&&(C?.interaction?.enabled??true),ut=Ti(),Bt=x||"id",we=Jt__namespace.default.useMemo(()=>({borderRadius:999,fontWeight:700,borderColor:rt(o.palette.divider,ht()==="dark"?.55:.3),bgcolor:ht()==="dark"?rt(o.palette.common.white,.06):rt(o.palette.background.paper,.92),color:o.palette.text.primary,"& .orb-chip-label":{px:1.05}}),[o]),W=Jt__namespace.default.useMemo(()=>({...we,borderColor:rt(o.palette.primary.main,ht()==="dark"?.42:.24),bgcolor:ht()==="dark"?rt(o.palette.primary.main,.16):rt(o.palette.primary.main,.08)}),[we,o]),Y=Jt__namespace.default.useMemo(()=>{let J=new Set(s);return Ze.filter(Oe=>J.has(Oe?.[Bt]))},[Bt,s,Ze]),te=Y.length===1?Y[0]:null,Ne=!!P?.enabled,he=!!w?.enabled,Ae=!!k?.enabled,Ke=P?.fields,et=P?.excludeFields||[],qe=P?.initialValues||{},Ct=w?.fields,Nt=w?.excludeFields||[],wt=w?.editableFields||[],xt=w?.nonEditableFields||[],H=w?.primaryKeys?.length?w.primaryKeys:[Bt],[j,me]=Jt__namespace.default.useState(false),[Se,tt]=Jt__namespace.default.useState(false),[Xe,It]=Jt__namespace.default.useState({}),[ft,gt]=Jt__namespace.default.useState(false),[kt,nr]=Jt__namespace.default.useState(false),[Ht,Yt]=Jt__namespace.default.useState({}),[Vt,qt]=Jt__namespace.default.useState(false),[$t,rr]=Jt__namespace.default.useState(false),ar=m||Se||kt||$t,gr=Jt__namespace.default.useMemo(()=>{let J=[...V];if(Array.isArray(Ke)&&Ke.length>0){let Oe=new Set(Ke);J=J.filter(Qe=>Oe.has(Qe.id));}if(et.length>0){let Oe=new Set(et);J=J.filter(Qe=>!Oe.has(Qe.id));}return J.filter(Oe=>!!Oe?.id)},[V,et,Ke]),Ir=Jt__namespace.default.useMemo(()=>{let J=[...V];if(Array.isArray(Ct)&&Ct.length>0){let Oe=new Set(Ct);J=J.filter(Qe=>Oe.has(Qe.id));}if(Nt.length>0){let Oe=new Set(Nt);J=J.filter(Qe=>!Oe.has(Qe.id));}return J.filter(Oe=>!!Oe?.id)},[V,Nt,Ct]),Rr=Jt__namespace.default.useMemo(()=>new Set(H),[H]),oo=Jt__namespace.default.useMemo(()=>new Set(wt),[wt]),vr=Jt__namespace.default.useMemo(()=>new Set(xt),[xt]),Or=Jt__namespace.default.useCallback(J=>oo.size>0?oo.has(J):!(vr.has(J)||Rr.has(J)),[oo,vr,Rr]);Jt__namespace.default.useEffect(()=>{!yt&&ut.hasActiveFilters&&ut.clearAll();},[ut,yt]);let Ko=()=>{let J={};gr.forEach(Oe=>{J[Oe.id]=qe[Oe.id]??"";}),It(J),me(true);},qo=(J,Oe)=>{It(Qe=>({...Qe,[J]:Oe}));},Eo=async()=>{if(!P?.onSubmit){me(false);return}try{tt(!0),await P.onSubmit(Xe),me(!1);}finally{tt(false);}},Xo=()=>{if(!te)return;let J={};Ir.forEach(Qe=>{J[Qe.id]=te[Qe.id]??"";});let Oe=w?.getInitialValues?{...J,...w.getInitialValues(te)}:J;Yt(Oe),gt(true);},Yo=(J,Oe)=>{Yt(Qe=>({...Qe,[J]:Oe}));},Mr=async()=>{if(te){if(!w?.onSubmit){gt(false);return}try{nr(!0),await w.onSubmit(Ht,te),gt(!1);}finally{nr(false);}}},Lo=()=>{Y.length!==0&&qt(true);},Zo=async()=>{if(Y.length===0){qt(false);return}if(!k?.onConfirm){qt(false),St([]),l?.([]);return}try{rr(!0),await k.onConfirm(Y),qt(!1),St([]),l?.([]);}finally{rr(false);}},Kr=Ze,{fieldMapping:no}=pn({rows:Kr,config:{...C,title:C?.title||`${z} ${r("graph.reportTitle")}`}}),An=Jt__namespace.default.useMemo(()=>Ft?ut.applyRows(Kr,no):Kr,[no,ut,Ft,Kr]),{model:Oo}=pn({rows:An,config:{...C,title:C?.title||`${z} ${r("graph.reportTitle")}`,fieldMapping:no}}),M=Oo.table.columns.map(J=>({id:J.id,label:J.label,align:J.align||"left",minWidth:120,numeric:J.align==="right"})),G=mt?e(gn,{appId:mt,tableKey:h,currentLayoutData:pt,onLayoutLoad:Ie,targetLayoutId:Kt,activeLayoutId:Ot,serviceUrl:R??g?.serviceUrl}):null,K=V.filter(J=>Q.includes(J.id)),de=K.find(J=>J.id===E)||K[0],He=D?.map(J=>K.find(Oe=>Oe.id===J)).filter(Boolean)||K.filter(J=>J.id!==de?.id).slice(0,_==="portrait"?2:3),at=K.filter(J=>J.id!==de?.id&&!He.some(Oe=>Oe.id===J.id)),$e=[I,p].filter(Boolean),oe=c(jsxRuntime.Fragment,{children:[e(cn,{groupAnchorEl:Pe,setGroupAnchorEl:Ve,grouping:be,setGrouping:_e,columns:V}),e(dn,{anchorEl:We,setAnchorEl:ot,columns:V,visibleColumns:Q,toggleColumnVisibility:Be}),e(vi,{anchorEl:Te,setAnchorEl:xe,showSummary:ge,setShowSummary:se,columns:V,summaryColumns:le,toggleSummaryColumn:Lt}),e(yi,{contextMenu:it,handleCloseContextMenu:nt,columns:V,visibleColumns:Q,toggleColumnVisibility:Be})]}),ue=(J,Oe,Qe)=>{let Me=s.includes(Oe),Ye=_==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(140px, 1fr))",Rt=Qe%2===0?rt(o.palette.primary.main,ht()==="dark"?.09:.04):rt(o.palette.primary.main,ht()==="dark"?.05:.022),jo=rt(o.palette.divider,.22);return e(Ee,{elevation:0,onClick:()=>{Et({},J),q?.(J);},sx:{p:N==="compact"?1.25:1.5,borderRadius:4,border:"0.5px solid",borderColor:Me?rt(o.palette.primary.main,.38):jo,background:Me?`linear-gradient(135deg, ${rt(o.palette.primary.main,.13)}, ${rt(o.palette.primary.main,.06)})`:`linear-gradient(135deg, ${Rt}, ${rt(o.palette.primary.main,.015)})`,boxShadow:Me?`0 12px 30px ${rt(o.palette.primary.main,.2)}`:`0 3px 10px ${rt(o.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?o.palette.primary.main:Qe%2===0?rt(o.palette.primary.main,.26):rt(o.palette.text.primary,.16)},"&:hover":{boxShadow:`0 10px 20px ${rt(o.palette.primary.main,.12)}`,transform:"translateY(-1px)"},"&:active":{transform:"scale(0.995)"}},children:c(ie,{spacing:1.25,children:[c(ie,{direction:"row",spacing:1.25,alignItems:"flex-start",children:[i?e(Dt,{checked:Me,onClick:Sr=>Sr.stopPropagation(),onChange:()=>Et({},J),sx:{mt:-0.6,ml:-0.6}}):null,c("div",{sx:{flex:1,minWidth:0},children:[de?e(L,{sx:{fontSize:"1rem",fontWeight:900,lineHeight:1.25},children:am(de,J)}):null,He.length>0?e(ie,{direction:"row",spacing:.75,useFlexGap:true,flexWrap:"wrap",sx:{mt:.75},children:He.map(Sr=>e(Pt,{label:`${Sr.label}: ${iy(Sr,J)}`,size:"small",variant:"outlined",sx:we},`${Oe}-${Sr.id}`))}):null]}),O?e("div",{onClick:Sr=>Sr.stopPropagation(),children:O(J)}):null]}),at.length>0?e("div",{sx:{display:"grid",gridTemplateColumns:Ye,gap:1},children:at.map(Sr=>c(Ee,{elevation:0,sx:{p:1,borderRadius:3,bgcolor:ht()==="dark"?rt(o.palette.background.default,.7):rt(o.palette.background.paper,.92),border:"0.1px solid",borderColor:rt(o.palette.divider,.24)},children:[e(L,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:Sr.label}),ay(am(Sr,J))]},`${Oe}-${Sr.id}-detail`))}):null,F?c(jsxRuntime.Fragment,{children:[e(At,{}),e("div",{onClick:Sr=>Sr.stopPropagation(),children:F(J)})]}):null]})},Oe)};return c("div",{sx:{width:f?"100%":"auto",mb:u?0:2,...u?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[g?e("div",{sx:{mb:2},children:e(Ju,{...g,onVariantLoad:J=>{Re(J),g.onVariantLoad?.(J);},appId:g.appId,tableKey:h,currentLayout:[{tableKey:h,layoutData:pt}],currentLayoutId:Ot,layoutRefs:[{tableKey:h,layoutId:Ot}],variantService:g.variantService,serviceUrl:R??g.serviceUrl,touchMode:_==="portrait"?"expanded":"comfortable"})}):null,c(Ee,{sx:{width:f?"100%":"auto",mb:u?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",bgcolor:"transparent",backgroundImage:"none",boxShadow:"none","&::before":ar?{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"}},...b?{height:b}:u?{flex:1,minHeight:0,height:"100%"}:{}},children:[a?e("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:e(gi,{filterText:B,setFilterText:Z,onRowsPerPageChange:Je,rowsPerPage:st,rowsPerPageOptions:v,page:ye,count:vt,onPageChange:Le,actions:d,extraTools:$e,grouping:be,setGroupAnchorEl:Ve,showSummary:ge,setShowSummary:se,setAnchorEl:ot,setSummaryAnchorEl:xe,handleExport:re,showCreateButton:Ne,onOpenCreateDialog:Ko,showEditButton:he,onOpenEditDialog:Xo,editDisabled:Y.length!==1,showDeleteButton:Ae,onOpenDeleteConfirm:Lo,deleteDisabled:Y.length===0,onLayoutSave:y||g?.variantService&&g?.appId?je:void 0,loading:m,layoutManager:G,onOpenGraphReport:Tt?bt:void 0})}):null,e("div",{sx:{flex:1,minHeight:0,overflow:"auto",p:1.5},children:c(ie,{spacing:1.25,children:[Fe.length===0&&!m?A||e(Ee,{elevation:0,sx:{p:4,borderRadius:4,border:"1px dashed",borderColor:"divider",textAlign:"center"},children:e(L,{sx:{fontSize:"0.92rem",color:"text.secondary"},children:r("common.noData")})}):null,Fe.map((J,Oe)=>{if(J.type==="group"){let Ye=De.has(J.id);return e(Ee,{elevation:0,sx:{borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:c("div",{component:"button",type:"button",onClick:()=>ce(J.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:[Ye?e(on,{}):e(ti,{}),c("div",{sx:{flex:1,minWidth:0},children:[c(L,{sx:{fontSize:"0.94rem",fontWeight:800},children:[J.field,": ",J.value]}),c(L,{sx:{mt:.2,fontSize:"0.76rem",color:"text.secondary"},children:[J.count," records"]})]}),be.length>1&&J.level<be.length-1?c(ie,{direction:"row",spacing:.5,children:[e(Pt,{size:"small",label:r("table.group.expandAll"),onClick:Rt=>{Rt.stopPropagation(),fe(J.id);},sx:W}),e(Pt,{size:"small",label:r("table.group.collapseAll"),onClick:Rt=>{Rt.stopPropagation(),ee(J.id);},sx:W})]}):null]})},J.id)}let Qe=J.data||J,Me=J.id||Qe[Bt]||Oe;return ue(Qe,Me,Oe)}),ge?e(sy,{summaryRow:U,visibleColumns:Q,columns:V}):null,m?e(L,{sx:{py:1,fontSize:"0.84rem",color:"text.secondary",textAlign:"center"},children:r("common.loading")}):null]})})]}),Ne?c(zt,{open:j,onClose:()=>!Se&&me(false),fullWidth:true,maxWidth:"sm",children:[e("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:800},children:P?.title||r("quickCreate.createWithTitle",{title:z})}),e("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:c("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[gr.map(J=>{let Oe=J.type==="number"||J.numeric?"number":J.type==="date"?"date":"text";return e(ze,{label:J.label||J.id,value:Xe[J.id]??"",onChange:Qe=>qo(J.id,Qe.target.value),type:Oe,fullWidth:true,InputLabelProps:{shrink:Oe==="date"?true:void 0}},`quick-create-${J.id}`)}),P?.description?e(jr,{severity:"info",children:P.description}):null]})}),c("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[e(Ce,{onClick:()=>me(false),disabled:Se,children:P?.cancelLabel||r("common.cancel")}),e(Ce,{onClick:Eo,variant:"contained",disabled:Se,children:P?.submitLabel||r("common.save")})]})]}):null,he?c(zt,{open:ft,onClose:()=>!kt&&gt(false),fullWidth:true,maxWidth:"sm",children:[e("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:800},children:w?.title||r("quickEdit.editWithTitle",{title:z})}),e("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:c("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Ir.map(J=>{let Oe=J.type==="number"||J.numeric?"number":J.type==="date"?"date":"text";return e(ze,{label:J.label||J.id,value:Ht[J.id]??"",onChange:Qe=>Yo(J.id,Qe.target.value),type:Oe,disabled:!Or(J.id),fullWidth:true,InputLabelProps:{shrink:Oe==="date"?true:void 0}},`quick-edit-${J.id}`)}),w?.description?e(jr,{severity:"info",children:w.description}):null]})}),c("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[e(Ce,{onClick:()=>gt(false),disabled:kt,children:w?.cancelLabel||r("common.cancel")}),e(Ce,{onClick:Mr,variant:"contained",disabled:kt||!te,children:w?.submitLabel||r("common.save")})]})]}):null,Ae?e(Yn,{open:Vt,type:"warning",title:k?.title||r("quickDelete.confirmTitle"),message:k?.message||(Y.length>1?r("quickDelete.confirmMessageMultiple",{count:Y.length}):r("quickDelete.confirmMessageSingle")),confirmText:k?.confirmText||r("common.delete"),cancelText:k?.cancelText||r("common.cancel"),onClose:()=>!$t&&qt(false),onConfirm:Zo}):null,oe,Tt?e(ki,{open:yt,onClose:xr,model:Oo,aiAssistant:C?.aiAssistant,interaction:Ft?{enabled:true,filters:ut.filters,fieldMapping:no,onPrimaryDimensionClick:J=>ut.setFilter("primaryDimension",J),onSecondaryDimensionClick:J=>ut.setFilter("secondaryDimension",J),onStatusClick:J=>ut.setFilter("status",J),onClearFilter:ut.clearFilter,onClearAll:ut.clearAll}:void 0,tableContent:e(ly,{appId:mt||"graph-report-internal",title:r("graph.dataBody"),columns:M,rows:Oo.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false},showSummary:false})}):null]})};T();var p2=({appTitle:t,children:r,menuData:o=[],workloadItems:n=[],workloadSelectedId:a,showNavigation:i=true,showWorkloadNav:s=true,orientation:l="auto",logo:d,headerSlot:p,actionSlot:u,portraitBottomSlot:f,contentSx:b,containerSx:m,user:v,onSearch:y,onSearchAdd:g,defaultNavigationOpen:x,navOpen:h,onNavOpenChange:C,onWorkloadSelect:P,locale:w="en",localeLabel:k,localeOptions:R,onLocaleChange:S,onUserSetting:E,onUserLogout:D,userMenuItems:I,leftHeaderSlot:A,rightHeaderSlot:N})=>{let O="orbcafe:page-layout-mode",[F,q]=Jt.useState("system"),[z,X]=Jt.useState("light"),[$,_]=Jt.useState(false),[V,B]=Jt.useState(false),Z=F==="system"?V?z:"light":F;Jt.useEffect(()=>{_(true);},[]),Jt.useEffect(()=>{try{let it=window.localStorage.getItem(O);(it==="light"||it==="dark"||it==="system")&&q(it);}catch{}B(true);let We=window.matchMedia("(prefers-color-scheme: dark)"),ot=()=>{X(We.matches?"dark":"light");};return ot(),We.addEventListener("change",ot),()=>We.removeEventListener("change",ot)},[]),Jt.useEffect(()=>{if(V)try{window.localStorage.setItem(O,F);}catch{}},[V,F]),Jt.useEffect(()=>{Z==="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");},[Z]);let Q=Dr("(orientation: portrait)"),ge=Dr("(max-width: 899.95px)"),se=l==="auto"?!$||Q||ge?"portrait":"landscape":l,[le,be]=Jt.useState({landscape:x??true,portrait:false}),_e=le[se],De=h??_e,Pe=We=>{h===void 0&&be(ot=>({...ot,[se]:We})),C?.(We);},Ve=c(ie,{direction:"row",spacing:1,alignItems:"center",children:[!$||i&&se==="portrait"?e(ae,{onClick:()=>Pe(!De),sx:{bgcolor:"action.hover"},children:e(si,{})}):null,A]}),Te=c(ie,{direction:"row",spacing:1,alignItems:"center",children:[u,N]}),xe=e(nm,{collapsed:se==="landscape"?!De:false,onToggle:()=>Pe(!De),menuData:o,orientation:se,colorMode:Z,maxHeight:se==="landscape"?900:void 0});return e(Ln,{mode:F,children:e(Ga,{locale:w,children:c("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(m)?m:[m]],children:[e(Wi,{appTitle:t,logo:d===void 0?null:d,mode:F,onToggleMode:()=>q(We=>We==="system"?"dark":We==="dark"?"light":"system"),locale:w,localeLabel:k,localeOptions:R,onLocaleChange:S,user:v,onUserSetting:E,onUserLogout:D,userMenuItems:I,onSearch:y,onSearchAdd:g,leftSlot:Ve,rightSlot:Te}),p?e("div",{sx:{px:{xs:2,md:3},py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:p}):null,c("div",{sx:{flex:1,minHeight:0,display:"flex",position:"relative"},children:[$&&i&&se==="landscape"?e("div",{sx:{p:1.5,pr:0,flexShrink:0},children:xe}):null,!$||i&&se==="portrait"?e(Pd,{open:De,onClose:()=>Pe(false),PaperProps:{sx:{width:"min(88vw, 360px)",p:1.25,bgcolor:"transparent",boxShadow:"none"}},children:xe}):null,e("div",{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...b},children:c(ie,{spacing:1.5,children:[s&&n.length>0?e(em,{items:n,selectedId:a,orientation:se,onItemSelect:P}):null,e(Ee,{elevation:0,sx:{flex:1,minHeight:se==="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:r})]})})]}),se==="portrait"&&f?c(jsxRuntime.Fragment,{children:[e(At,{}),e("div",{sx:{p:1.5},children:f})]}):null]})})})};T();var cm=hy__default.default(()=>Promise.resolve().then(()=>(lm(),sm)).then(t=>t.COrbCanvas),{ssr:false,loading:()=>e("div",{className:"h-full w-full bg-transparent"})});function Nl({isRecording:t}){return e(framerMotion.AnimatePresence,{children:t&&e(framerMotion.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:c("div",{className:"relative flex h-full w-full items-center justify-center",children:[e("div",{className:"absolute inset-0",children:e(cm,{hue:0,hoverIntensity:.5,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})}),e("div",{className:"relative z-10 h-full w-1/3 mix-blend-overlay opacity-80",children:e(cm,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var y2=Nl;T();var pm=Jt.createContext(null);function ky(t){if(!t||!(t instanceof HTMLElement))return false;let r=t.tagName;return !!(r==="INPUT"||r==="TEXTAREA"||r==="SELECT"||t.isContentEditable||t.closest('[data-voice-hotkey-ignore="true"]'))}function Py({children:t,onVoiceSubmit:r,onVoicePartial:o,onVoiceError:n,longPressMs:a=200,disableSpaceTrigger:i=false,ignoreWhenFocusedInput:s=true,renderOverlay:l=true,wsUrl:d,silenceThresholdMs:p,minVolumeRms:u}){let[f,b]=Jt.useState(false),[m,v]=Jt.useState(false),y=Jt.useRef(null),g=Jt.useRef(false),x=Jt.useRef(false),h=Jt.useCallback(()=>{x.current=false,b(false);},[]),{isRecording:C,startRecording:P,stopRecording:w}=Cn({wsUrl:d,silenceThresholdMs:p,minVolumeRms:u,onTextUpdate:E=>{o?.(E);},onComplete:async E=>{try{E.trim()&&(v(!0),await r(E.trim()));}catch(D){let I=D instanceof Error?D.message:"Failed to process voice command";n?.(I);}finally{v(!1),h();}},onError:E=>{n?.(E),v(!1),g.current||h();}}),k=Jt.useCallback(async()=>{x.current=false,await P();},[P]),R=Jt.useCallback(()=>{w();},[w]);Jt.useEffect(()=>{if(i)return;let E=I=>{I.isComposing||(I.code==="Space"||I.key===" ")&&(g.current||I.repeat||s&&ky(document.activeElement)||(g.current=true,I.preventDefault(),y.current=setTimeout(()=>{x.current=true,b(true),P();},a)));},D=I=>{(I.code==="Space"||I.key===" ")&&(y.current&&(clearTimeout(y.current),y.current=null),g.current=false,x.current&&(I.preventDefault(),b(false),w()));};return window.addEventListener("keydown",E),window.addEventListener("keyup",D),()=>{window.removeEventListener("keydown",E),window.removeEventListener("keyup",D),y.current&&(clearTimeout(y.current),y.current=null);}},[i,s,a,P,w]);let S=Jt.useMemo(()=>({isRecording:C,isHotkeyRecording:f,isSubmitting:m,startRecording:k,stopRecording:R}),[f,C,m,k,R]);return c(pm.Provider,{value:S,children:[l?e(Nl,{isRecording:f}):null,t]})}function Ty(){let t=Jt.useContext(pm);if(!t)throw new Error("useAINav must be used within CAINavProvider");return t}var P2=Py,T2=Ty;function dt(...t){return tailwindMerge.twMerge(clsx.clsx(t))}T();var Ny=({content:t,theme:r="light",size:o="base",defaultExpanded:n=false})=>{let[a,i]=Jt.useState(n),s=Jt.useMemo(()=>`${(o==="sm"?14:o==="lg"?18:16)-2}px`,[o]);return c("div",{className:`my-6 rounded-lg overflow-hidden transition-all duration-200 ${r==="dark"?"bg-[var(--orb-surface-2)]":"bg-[var(--orb-canvas)]"}`,style:{border:"0.5px solid var(--orb-border)"},children:[c("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:[c("span",{className:"flex items-center",children:[e(Da,{className:"mr-2 h-4 w-4"}),e("span",{className:"font-medium text-[var(--orb-fg)]",style:{fontSize:o==="sm"?"14px":o==="lg"?"18px":"16px"},children:"\u601D\u8003\u8FC7\u7A0B"})]}),e(Fr,{className:`w-4 h-4 transition-transform duration-200 ${a?"rotate-180":""} text-[var(--orb-muted)]`})]}),a&&e("div",{className:"p-4 whitespace-pre-wrap italic font-light text-[var(--orb-muted)]",style:{fontSize:s,lineHeight:"1.3 !important"},children:t})]})},um=Ny;T();var Fy=({content:t,language:r="text",isStreaming:o=false,className:n=""})=>{let a=yr(),[i,s]=Jt.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"?prism.oneDark:prism.oneLight;return c("div",{className:dt("rounded-lg overflow-hidden border border-[var(--orb-border)] my-4",n),children:[c("div",{className:"flex items-center justify-between px-4 py-2 bg-[var(--orb-surface)] border-b border-[var(--orb-border)]",children:[e("span",{className:"text-xs font-medium text-[var(--orb-muted)] uppercase",children:r}),e("button",{onClick:l,className:"p-1 hover:bg-[var(--orb-hover)] rounded transition-colors",disabled:o,title:i?"Copied":"Copy code",children:i?e(qr,{size:14,className:"text-[var(--orb-status-success)]"}):e(kc,{size:14,className:"text-[var(--orb-muted)]"})})]}),e("div",{className:"text-sm",children:e(reactSyntaxHighlighter.Prism,{language:r,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})})]})},mm=Fy;T();var zy=({content:t,isLoading:r,className:o="",style:n})=>{let a=Jt.useRef(null),[i,s]=Jt.useState(false),[l,d]=Jt.useState(null),p=yr();return Jt.useEffect(()=>{let u=false,f=async()=>{if(!(!t.trim()||!a.current)){s(true),d(null);try{fm__default.default.initialize({startOnLoad:!1,theme:p==="dark"?"dark":"default",securityLevel:"loose",fontFamily:"inherit",flowchart:{htmlLabels:!1}});let m=`mermaid-${Math.random().toString(36).substr(2,9)}`,v=t.replace(/```mermaid\n?|\n?```/g,"").trim(),{svg:y,bindFunctions:g}=await fm__default.default.render(m,v);!u&&a.current&&(a.current.innerHTML=y,g?.(a.current));}catch(m){if(u)return;console.error("Mermaid render failed:",m),d(m instanceof Error?m.message:"Render failed");}finally{u||s(false);}}},b=setTimeout(()=>{f();},100);return ()=>{u=true,clearTimeout(b);}},[t,p]),c("div",{className:`mermaid-block ${o}`,style:n,children:[(r||i)&&c("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:[e("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-b-2 border-[var(--orb-primary)]"}),e("span",{className:"text-sm text-[var(--orb-muted)]",children:"Generating Diagram..."})]}),l&&c("div",{className:"overflow-auto 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-4 text-sm text-[var(--orb-status-error)]",children:[e("p",{className:"mb-2 font-semibold",children:"Mermaid Error:"}),e("pre",{children:l}),e("pre",{className:"mt-4 text-xs text-[var(--orb-muted)]",children:t})]}),e("div",{ref:a,className:`overflow-x-auto ${r||i||l?"hidden":""}`})]})},bm=zy;T();var Vy=({title:t="\u53D1\u751F\u9519\u8BEF",content:r,errorCode:o,stack:n,icon:a,closable:i=true,onClose:s,onRetry:l,className:d="",...p})=>{let[u,f]=Jt.useState(false),[b,m]=Jt.useState(false),v=async()=>{if(l){m(true);try{await l();}catch(y){console.error("\u91CD\u8BD5\u5931\u8D25:",y);}finally{m(false);}}};return c("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:[c("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:[e("div",{className:"flex-shrink-0 mr-3 text-[var(--orb-status-error)] mt-0.5",children:a||e(ka,{className:"w-5 h-5"})}),c("div",{className:"flex-1 min-w-0",children:[c("div",{className:"flex items-center space-x-2 mb-1",children:[e("h4",{className:"text-base font-semibold text-[var(--orb-fg)]",children:t}),o&&e("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:o})]}),r&&e("div",{className:"text-sm text-[var(--orb-muted)] mb-3 leading-relaxed",children:typeof r=="string"?e("p",{className:"whitespace-pre-wrap",children:r}):r}),(l||n)&&c("div",{className:"flex items-center space-x-4 mt-2",children:[l&&c("button",{onClick:v,disabled:b,className:"flex items-center text-xs font-medium text-[var(--orb-status-error)] hover:opacity-80 transition-colors disabled:opacity-50",children:[e(zc,{className:`w-3.5 h-3.5 mr-1.5 ${b?"animate-spin":""}`}),b?"\u91CD\u8BD5\u4E2D...":"\u91CD\u8BD5"]}),n&&c("button",{onClick:()=>f(!u),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:[u?e(Fr,{className:"w-3.5 h-3.5 mr-1"}):e(Br,{className:"w-3.5 h-3.5 mr-1"}),u?"\u9690\u85CF\u8BE6\u60C5":"\u67E5\u770B\u8BE6\u60C5"]})]})]}),i&&s&&e("button",{onClick:s,className:"flex-shrink-0 ml-3 text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors self-start",children:e(Zt,{className:"w-4 h-4"})})]}),n&&u&&e("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] p-3 border-t border-[var(--orb-border)]",children:e("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})})]})},rs=Vy;T();var Wy=({title:t="\u8B66\u544A",content:r,warningType:o,severity:n="warning",warnings:a=[],icon:i,closable:s=true,onClose:l,onConfirm:d,actionText:p,className:u="",...f})=>{let b=()=>{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)]"}}},m=()=>{switch(n){case "info":return e(Ma,{className:"w-5 h-5"});case "error":return e(Ha,{className:"w-5 h-5"});case "success":return e(Pa,{className:"w-5 h-5"});default:return e(xc,{className:"w-5 h-5"})}},v=b();return c("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}`,...f,children:[c("div",{className:`flex p-4 border-l-4 ${v.borderLeftColor} ${v.bgColor}`,children:[e("div",{className:`flex-shrink-0 mr-3 ${v.iconColor}`,children:i||m()}),c("div",{className:"flex-1 min-w-0",children:[c("div",{className:"flex items-center justify-between mb-1",children:[e("h4",{className:"text-base font-semibold text-[var(--orb-fg)]",children:t}),o&&e("span",{className:"text-xs font-medium px-2 py-0.5 rounded-full bg-[var(--orb-surface)] text-[var(--orb-muted)]",children:o})]}),r&&e("div",{className:"text-sm text-[var(--orb-muted)] mb-2",children:r}),a&&a.length>0&&e("ul",{className:"mt-2 space-y-1",children:a.map((y,g)=>c("li",{className:"flex items-start text-sm text-[var(--orb-muted)]",children:[e("span",{className:"mr-2 mt-1.5 w-1 h-1 rounded-full bg-[var(--orb-muted)] flex-shrink-0"}),e("span",{children:y})]},g))})]}),s&&l&&e("button",{onClick:l,className:"flex-shrink-0 ml-3 text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors",children:e(Zt,{className:"w-4 h-4"})})]}),d&&e("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:e("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"})})]})},os=Wy;T();var $y=({title:t="\u76F8\u5173\u63A8\u8350",content:r,suggestions:o,onSuggestionClick:n,maxDisplay:a=5,icon:i,closable:s=false,onClose:l,className:d="",...p})=>{let[u,f]=Jt.useState(false),[b,m]=Jt.useState(""),[v,y]=Jt.useState(false),g=Jt.useMemo(()=>b.trim()?o.filter(C=>C.toLowerCase().includes(b.toLowerCase())):o,[o,b]),x=Jt.useMemo(()=>u?g:g.slice(0,a),[g,u,a]),h=C=>{n?.(C);};return !o||o.length===0?null:c("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:[c("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--orb-border)] bg-[var(--orb-p50)]",children:[c("div",{className:"flex items-center space-x-2.5",children:[e("div",{className:"text-[var(--orb-primary)] flex-shrink-0",children:i||e(Da,{className:"w-5 h-5"})}),c("div",{className:"flex flex-col",children:[e("h4",{className:"text-sm font-semibold text-[var(--orb-fg)] leading-tight",children:t}),r&&e("span",{className:"text-xs text-[var(--orb-muted)] mt-0.5",children:r})]})]}),c("div",{className:"flex items-center space-x-1",children:[o.length>3&&e("button",{onClick:()=>y(!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:e(Hr,{className:"w-4 h-4"})}),s&&l&&e("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:e(Zt,{className:"w-4 h-4"})})]})]}),v&&e("div",{className:"px-4 py-2 border-b border-[var(--orb-border)] bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)]",children:c("div",{className:"relative",children:[e("input",{type:"text",placeholder:"\u641C\u7D22\u76F8\u5173\u95EE\u9898...",value:b,onChange:C=>m(C.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}),e(Hr,{className:"absolute left-2.5 top-2 w-3.5 h-3.5 text-[var(--orb-muted)]"})]})}),c("div",{className:"p-2",children:[e("ul",{className:"space-y-1",children:x.map((C,P)=>e("li",{children:c("button",{onClick:()=>h(C),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:[e("span",{children:C}),e(Br,{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"})]})},P))}),g.length>a&&e("button",{onClick:()=>f(!u),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:u?"\u6536\u8D77":`\u67E5\u770B\u5168\u90E8 (${g.length})`}),g.length===0&&b&&e("div",{className:"text-center py-4 text-sm text-[var(--orb-muted)]",children:"\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u5EFA\u8BAE"})]})]})},ns=$y;T();var Gy=({title:t,content:r,toolName:o,parameters:n,result:a,status:i,duration:s,icon:l,closable:d=false,onClose:p,onAction:u,actionText:f,className:b="",...m})=>{let[v,y]=Jt.useState(false),[g,x]=Jt.useState(true),h=()=>{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"}}},C=()=>{switch(i){case "pending":return e(Ec,{className:"w-5 h-5 animate-spin"});case "error":return e(Ha,{className:"w-5 h-5"});default:return e(Pa,{className:"w-5 h-5"})}},P=R=>R?R<1e3?`${R}ms`:`${(R/1e3).toFixed(2)}s`:"",w=h(),k=t||o||"\u5DE5\u5177\u8C03\u7528";return c("div",{className:`w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${b}`,...m,children:[c("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:[c("div",{className:"flex items-center space-x-3",children:[e("div",{className:`flex-shrink-0 ${w.iconColor}`,children:l||C()}),c("div",{children:[c("div",{className:"flex items-center space-x-2",children:[e("h4",{className:"text-sm font-semibold text-[var(--orb-fg)]",children:k}),e("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${w.badgeBg} ${w.badgeText}`,children:w.label})]}),o&&t&&c("div",{className:"text-xs text-[var(--orb-muted)] flex items-center mt-0.5",children:[e(Hn,{className:"w-3 h-3 mr-1"}),o]})]})]}),c("div",{className:"flex items-center space-x-2 text-xs text-[var(--orb-muted)]",children:[s&&c("div",{className:"flex items-center bg-[var(--orb-surface)] px-2 py-1 rounded",children:[e(Pc,{className:"w-3 h-3 mr-1"}),P(s)]}),d&&p&&e("button",{onClick:p,className:"text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors p-1 rounded",children:e(Zt,{className:"w-4 h-4"})})]})]}),c("div",{className:"p-4",children:[r&&e("div",{className:"text-sm text-[var(--orb-muted)] mb-4 leading-relaxed",children:r}),n&&c("div",{className:"mb-3",children:[c("button",{onClick:()=>y(!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?e(Fr,{className:"w-3.5 h-3.5 mr-1"}):e(Br,{className:"w-3.5 h-3.5 mr-1"}),e("div",{className:"w-3.5 h-3.5 mr-1.5"}),"\u8F93\u5165\u53C2\u6570"]}),v&&e("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)] overflow-hidden",children:e("pre",{className:"p-3 text-xs font-mono text-[var(--orb-muted)] overflow-x-auto",children:JSON.stringify(n,null,2)})})]}),a&&c("div",{children:[c("button",{onClick:()=>x(!g),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?e(Fr,{className:"w-3.5 h-3.5 mr-1"}):e(Br,{className:"w-3.5 h-3.5 mr-1"}),e(Hn,{className:"w-3.5 h-3.5 mr-1.5"}),"\u6267\u884C\u7ED3\u679C"]}),g&&e("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)] overflow-hidden",children:e("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)})})]}),u&&e("div",{className:"mt-3 pt-3 border-t border-[var(--orb-border)] flex justify-end",children:e("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:f||"\u6267\u884C\u64CD\u4F5C"})})]})]})},as=Gy;T();var Uy=({data:t})=>{if(!t)return null;let r=Jt.useMemo(()=>{let o=[],n=[],a="\u6570\u636E\u8868\u683C";return Array.isArray(t)?(o=t,o.length>0&&(n=Object.keys(o[0]).map(i=>({id:i,label:i.charAt(0).toUpperCase()+i.slice(1),numeric:typeof o[0][i]=="number"})))):typeof t=="object"&&(a=t.title||a,o=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})):o.length>0&&(n=Object.keys(o[0]).map(s=>({id:s,label:s,numeric:typeof o[0][s]=="number"})))),o=o.map((i,s)=>({...i,id:i.id||`row_${s}`})),{title:a,columns:n,rows:o}},[t]);return r.rows.length===0?e("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"}):e("div",{className:"w-full my-4",children:e(Jr,{appId:"agent-ui-table-card",title:r.title,columns:r.columns,rows:r.rows,count:r.rows.length,rowKey:"id",fitContainer:false,maxHeight:"500px",rowsPerPage:10,rowsPerPageOptions:[5,10,20,50]})})},is=Uy;T();var Ky=({title:t,subtitle:r,data:o,type:n,config:a={}})=>{let i=()=>{switch(n){case "bar-chart-card":return e(Ls,{className:"w-4 h-4 text-[var(--orb-chart-1)]"});case "line-chart-card":return e(Ac,{className:"w-4 h-4 text-[var(--orb-chart-positive)]"});case "pie-chart-card":return e(Hc,{className:"w-4 h-4 text-[var(--orb-chart-2)]"});case "combo-chart-card":return e(Cc,{className:"w-4 h-4 text-[var(--orb-chart-5)]"});case "heatmap-chart-card":return e(Dc,{className:"w-4 h-4 text-[var(--orb-chart-negative)]"});case "fishbone-chart-card":return e(Mc,{className:"w-4 h-4 text-[var(--orb-chart-4)]"});case "waterfall-chart-card":return e(Uc,{className:"w-4 h-4 text-[var(--orb-chart-6)]"});case "google-map-card":return e(Bn,{className:"w-4 h-4 text-[var(--orb-status-primary)]"});case "amap-card":return e(Oc,{className:"w-4 h-4 text-[var(--orb-status-primary)]"});default:return e(Ls,{className:"w-4 h-4"})}},s=()=>{if(!o&&n!=="google-map-card"&&n!=="amap-card")return e("div",{className:"text-[var(--orb-muted)] text-sm p-4 text-center",children:"No data available"});try{switch(n){case "bar-chart-card":return e(ea,{data:o,orientation:a.orientation||"horizontal",valueSuffix:a.valueSuffix||"",minHeight:a.minHeight});case "line-chart-card":return e(Ip,{data:o,color:a.color,valueSuffix:a.valueSuffix||"",height:a.height});case "pie-chart-card":let l=o.reduce((p,u)=>p+(Number(u.value)||0),0),d=o.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 e(xi,{data:d,variant:a.variant||"donut",size:a.size,colors:a.colors});case "combo-chart-card":return e(Rp,{data:o,barColor:a.barColor,lineColor:a.lineColor});case "heatmap-chart-card":return e(Mp,{data:o});case "fishbone-chart-card":return e(Dp,{branches:o,effect:a.effect||t||"Problem"});case "waterfall-chart-card":return e(Np,{data:o,height:a.height});case "google-map-card":return e(Ap,{embedUrl:a.embedUrl||o&&o[0]?.embedUrl,apiKey:a.apiKey,query:a.query||o&&o[0]?.query||t,height:a.height});case "amap-card":return e(Ep,{embedUrl:a.embedUrl||o&&o[0]?.embedUrl,keyword:a.keyword||o&&o[0]?.keyword||t,height:a.height});default:return c("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),e("div",{className:"text-[var(--orb-status-error)] text-sm p-4 text-center",children:"Error rendering chart"})}};return c("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:[c("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:[e("div",{className:"mr-2 flex-shrink-0",children:i()}),c("div",{className:"flex-1 min-w-0",children:[e("h3",{className:"text-sm font-semibold text-[var(--orb-fg)] truncate",children:t}),r&&e("p",{className:"text-xs text-[var(--orb-muted)] mt-0.5 truncate",children:r})]})]}),c("div",{className:"p-4",children:[e("div",{className:"overflow-x-auto",children:s()}),e("div",{className:"mt-3",children:c("details",{className:"text-xs text-[var(--orb-muted)]",children:[e("summary",{className:"cursor-pointer hover:text-[var(--orb-fg)] transition-colors select-none font-medium opacity-60 hover:opacity-100",children:"View Raw Data"}),e("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(o,null,2)})]})})]})]})},ss=Ky;T();var us=["bar","column","line","pie","donut","scatter","bubble","list","metric","progress"],qy={bar:"Bars",column:"Columns",line:"Line",pie:"Pie",donut:"Donut",scatter:"Scatter",bubble:"Bubble",list:"List",metric:"Metric",progress:"Progress"},ds=480,Tn=214,Ut={top:18,right:16,bottom:38,left:30},er=t=>typeof t=="number"&&Number.isFinite(t)?t:0,Sm=t=>t.toLocaleString(void 0,{maximumFractionDigits:1}),Ur=(t,r)=>`${t.id||t.label}-${r}`,wm=(t,r=13)=>t.length>r?`${t.slice(0,Math.max(1,r-1))}\u2026`:t,ps=(t,r,o)=>Math.min(o,Math.max(r,t)),mo=(t,r,o)=>t.color??o[r%o.length],go=(t,r)=>r?{onMouseEnter:()=>r.onItemHoverStart?.(t),onMouseMove:()=>r.onItemHoverStart?.(t),onMouseLeave:()=>r.onItemHoverEnd?.(t),onContextMenu:o=>r.onItemContextMenu?.(o,t)}:{},km=t=>{let r=t.map(a=>er(a.value)),o=Math.min(0,...r),n=Math.max(0,...r);return {min:o,max:n===o?o+1:n,range:n===o?1:n-o}},Xy=(t,r,o)=>{let n=ds-Ut.left-Ut.right,a=Tn-Ut.top-Ut.bottom,{max:i,range:s}=km(o),l=Ut.left+t*n/Math.max(o.length-1,1),d=Ut.top+(i-er(r.value))/s*a,p=Ut.top+i/s*a;return {x:l,y:d,zeroY:p}},cs=(t,r,o,n)=>{let a=(n-90)*Math.PI/180;return {x:t+o*Math.cos(a),y:r+o*Math.sin(a)}},Yy=(t,r,o,n,a,i)=>{let s=cs(t,r,o,i),l=cs(t,r,o,a),d=i-a>180?1:0;if(n===0)return `M ${t} ${r} L ${s.x} ${s.y} A ${o} ${o} 0 ${d} 0 ${l.x} ${l.y} Z`;let p=cs(t,r,n,i),u=cs(t,r,n,a);return `M ${s.x} ${s.y} A ${o} ${o} 0 ${d} 0 ${l.x} ${l.y} L ${u.x} ${u.y} A ${n} ${n} 0 ${d} 1 ${p.x} ${p.y} Z`},Zy=({children:t})=>c("div",{className:"orb-metric-empty",role:"status",children:[e("span",{className:"orb-metric-empty-mark","aria-hidden":"true",children:"\u2014"}),e(L,{variant:"body2",muted:true,children:t})]}),jy=()=>c("div",{className:"orb-metric-loading",role:"status","aria-label":"Loading chart",children:[e("span",{className:"orb-metric-skeleton orb-metric-skeleton-wide"}),e("span",{className:"orb-metric-skeleton"}),e("span",{className:"orb-metric-skeleton orb-metric-skeleton-short"}),e("span",{className:"orb-metric-skeleton orb-metric-skeleton-wide"})]}),Fl=({item:t,onItemClick:r,interactions:o})=>{let n=()=>r?.(t);return {...r?{role:"button",tabIndex:0,onClick:n,onKeyDown:i=>{r&&(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),n());}}:{},...go(t,o),style:{cursor:r||o?"pointer":"default"}}},Qy=({loading:t,error:r,hasData:o,emptyState:n,children:a})=>t?e(jy,{}):r?e("div",{className:"orb-metric-error",role:"alert",children:r}):o?e(jsxRuntime.Fragment,{children:a}):e(Zy,{children:n??"No data for the current selection."}),Jy=({data:t,activeId:r,onItemClick:o,interactions:n,valueFormatter:a,colors:i})=>{let s=Math.max(...t.map(l=>Math.abs(er(l.value))),1);return e("div",{className:"orb-metric-bars",role:"list","aria-label":"Chart data",children:t.map((l,d)=>{let p=er(l.value),u=`${ps(Math.abs(p)/s*100,0,100)}%`,f=r===l.id,b=c(jsxRuntime.Fragment,{children:[e("span",{className:"orb-metric-bar-label",title:l.label,children:l.label}),e("span",{className:"orb-metric-bar-track","aria-hidden":"true",children:e("span",{className:`orb-metric-bar-fill${f?" is-active":""}`,style:{width:u,backgroundColor:mo(l,d,i)}})}),e("span",{className:"orb-metric-bar-value",children:a(p)})]});return o?e("button",{type:"button",className:`orb-metric-bar-row${f?" is-active":""}`,onClick:()=>o(l),title:`${l.label}: ${a(p)}`,"aria-pressed":f,...go(l,n),children:b},Ur(l,d)):e("div",{className:`orb-metric-bar-row${f?" is-active":""}`,role:"listitem",...go(l,n),children:b},Ur(l,d))})})},eC=({data:t,activeId:r,onItemClick:o,interactions:n,valueFormatter:a,colors:i})=>{let s=Math.max(t.reduce((l,d)=>l+Math.max(er(d.value),0),0),1);return e("div",{className:"orb-metric-progress",role:"list","aria-label":"Chart data",children:t.map((l,d)=>{let p=Math.max(er(l.value),0),u=ps(p/s*100,0,100),f=r===l.id,b=c(jsxRuntime.Fragment,{children:[c("span",{className:"orb-metric-progress-heading",children:[e("span",{title:l.label,children:l.label}),e("strong",{children:a(p)})]}),e("span",{className:"orb-metric-bar-track","aria-hidden":"true",children:e("span",{className:"orb-metric-bar-fill",style:{width:`${u}%`,backgroundColor:mo(l,d,i)}})})]});return o?e("button",{type:"button",className:`orb-metric-progress-row${f?" is-active":""}`,onClick:()=>o(l),"aria-pressed":f,...go(l,n),children:b},Ur(l,d)):e("div",{className:`orb-metric-progress-row${f?" is-active":""}`,role:"listitem",...go(l,n),children:b},Ur(l,d))})})},tC=({type:t,data:r,activeId:o,onItemClick:n,interactions:a,valueFormatter:i,secondaryValueFormatter:s,colors:l,ariaLabel:d})=>{let{min:p,max:u,range:f}=km(r),b=ds-Ut.left-Ut.right,m=Tn-Ut.top-Ut.bottom,v=Ut.top+u/f*m,y=Math.max(1,Math.ceil(r.length/6)),g=r.map((C,P)=>Xy(P,C,r)),x=g.map(C=>`${C.x},${C.y}`).join(" "),h=Math.max(...r.map(C=>Math.max(er(C.secondaryValue),0)),1);return e("div",{className:"orb-metric-svg-wrap",children:c("svg",{className:"orb-metric-svg",viewBox:`0 0 ${ds} ${Tn}`,role:"img","aria-label":d,children:[e("line",{className:"orb-metric-axis",x1:Ut.left,y1:v,x2:ds-Ut.right,y2:v}),e("line",{className:"orb-metric-grid",x1:Ut.left,y1:Ut.top,x2:Ut.left,y2:Tn-Ut.bottom}),t==="column"&&r.map((C,P)=>{let w=g[P],k=er(C.value),R=Math.max(Math.abs(w.y-v),k===0?2:0),S=w.x-Math.min(18,b/Math.max(r.length*2,1)),E=Math.min(36,Math.max(10,b/Math.max(r.length*1.8,1))),D=o===C.id;return c("g",{...Fl({item:C,onItemClick:n,interactions:a}),"aria-label":`${C.label}: ${i(k)}`,children:[e("rect",{className:`orb-metric-column${D?" is-active":""}`,x:S,y:Math.min(w.y,v),width:E,height:R,rx:4,fill:mo(C,P,l)}),c("title",{children:[C.label,": ",i(k)]}),(P%y===0||r.length<=6)&&e("text",{className:"orb-metric-svg-label",x:w.x,y:Tn-14,textAnchor:"middle",children:wm(C.label)})]},Ur(C,P))}),(t==="line"||t==="scatter"||t==="bubble")&&c(jsxRuntime.Fragment,{children:[t==="line"&&e("polyline",{className:"orb-metric-line",fill:"none",points:x,stroke:l[0]}),r.map((C,P)=>{let w=g[P],k=o===C.id,R=t==="bubble"?7+Math.max(er(C.secondaryValue),0)/h*12:t==="scatter"?5:4;return c("g",{...Fl({item:C,onItemClick:n,interactions:a}),"aria-label":`${C.label}: ${i(er(C.value))}`,children:[t==="line"&&e("circle",{className:`orb-metric-point${k?" is-active":""}`,cx:w.x,cy:w.y,r:k?6:4,fill:mo(C,P,l)}),t!=="line"&&e("circle",{className:`orb-metric-point${k?" is-active":""}`,cx:w.x,cy:w.y,r:R,fill:mo(C,P,l),opacity:t==="bubble"?.82:.9}),c("title",{children:[C.label,": ",i(er(C.value)),t==="bubble"&&C.secondaryValue!==void 0?` \xB7 Size: ${s(er(C.secondaryValue))}`:""]}),(P%y===0||r.length<=6)&&e("text",{className:"orb-metric-svg-label",x:w.x,y:Math.max(Ut.top+8,w.y-R-7),textAnchor:"middle",children:wm(C.label)})]},Ur(C,P))})]}),e("text",{className:"orb-metric-axis-label",x:Ut.left,y:Ut.top-5,children:i(u)}),p<0&&e("text",{className:"orb-metric-axis-label",x:Ut.left,y:Tn-Ut.bottom+14,children:i(p)})]})})},rC=({type:t,data:r,activeId:o,onItemClick:n,interactions:a,valueFormatter:i,colors:s,ariaLabel:l})=>{let d=r.map(m=>({...m,value:Math.max(er(m.value),0)})),p=d.reduce((m,v)=>m+v.value,0),u=72,f=92,b=0;return c("div",{className:"orb-metric-circular",children:[c("svg",{className:"orb-metric-donut",viewBox:"0 0 184 184",role:"img","aria-label":l,children:[d.map((m,v)=>{let y=m.value/p*360,g=b;b+=y;let x=o===m.id,h=y>=359.9?void 0:Yy(f,f,u,t==="donut"?46:0,g,g+y),C=Fl({item:m,onItemClick:n,interactions:a});return h?e("path",{className:`orb-metric-slice${x?" is-active":""}`,d:h,fill:mo(m,v,s),...C,children:c("title",{children:[m.label,": ",i(m.value)," (",(m.value/p*100).toFixed(1),"%)"]})},Ur(m,v)):e("circle",{className:`orb-metric-slice${x?" is-active":""}`,cx:f,cy:f,r:t==="donut"?60:u,fill:t==="donut"?"none":mo(m,v,s),stroke:t==="donut"?mo(m,v,s):void 0,strokeWidth:28,...C,children:c("title",{children:[m.label,": ",i(m.value)," (100%)"]})},Ur(m,v))}),t==="donut"&&e("circle",{cx:f,cy:f,r:44,fill:"var(--orb-surface)"}),t==="donut"&&e("text",{className:"orb-metric-donut-total",x:f,y:f+5,textAnchor:"middle",children:i(p)})]}),e("div",{className:"orb-metric-legend",role:"list","aria-label":"Chart legend",children:d.map((m,v)=>{let y=o===m.id;return c("button",{type:"button",className:`orb-metric-legend-item${y?" is-active":""}`,onClick:()=>n?.(m),disabled:!n,title:m.label,...go(m,a),children:[e("span",{className:"orb-metric-legend-dot",style:{backgroundColor:mo(m,v,s)}}),e("span",{className:"orb-metric-legend-label",children:m.label}),c("strong",{children:[(m.value/p*100).toFixed(0),"%"]})]},Ur(m,v))})})]})},oC=({data:t,activeId:r,onItemClick:o,interactions:n,valueFormatter:a,secondaryValueFormatter:i})=>e("div",{className:"orb-metric-list",role:"list","aria-label":"Chart data",children:t.map((s,l)=>{let d=c(jsxRuntime.Fragment,{children:[e("span",{className:"orb-metric-list-label",title:s.label,children:s.label}),e("span",{className:"orb-metric-list-value",children:a(er(s.value))}),s.secondaryValue!==void 0&&e("span",{className:"orb-metric-list-secondary",children:i(er(s.secondaryValue))})]});return o?e("button",{type:"button",className:`orb-metric-list-row${r===s.id?" is-active":""}`,onClick:()=>o(s),"aria-pressed":r===s.id,...go(s,n),children:d},Ur(s,l)):e("div",{className:`orb-metric-list-row${r===s.id?" is-active":""}`,role:"listitem",...go(s,n),children:d},Ur(s,l))})}),ms=({title:t,subtitle:r,data:o=[],chartType:n="bar",onChartTypeChange:a,onItemClick:i,onDataDetails:s,activeId:l,valueFormatter:d=Sm,secondaryValueFormatter:p=Sm,valueLabel:u,secondaryValueLabel:f,emptyState:b,loading:m=false,error:v,maxItems:y=8,showChartTypeControl:g=true,showDataDetails:x=true,dataRevealDelayMs:h=1e3,chartTypeOptions:C,chartTypeLabels:P,footer:w,ariaLabel:k,className:R,style:S,sx:E})=>{let D=Es(),I=Jt.useRef(null),A=Jt.useRef(null),[N,O]=Jt.useState(n),[F,q]=Jt.useState(false),[z,X]=Jt.useState(null),[$,_]=Jt.useState(null);Jt.useEffect(()=>O(n),[n]);let V=Jt.useCallback(()=>{A.current!==null&&(window.clearTimeout(A.current),A.current=null);},[]);Jt.useEffect(()=>V,[V]),Jt.useEffect(()=>{if(!$)return;let U=Fe=>{let ye=Fe.target;ye instanceof HTMLElement&&ye.closest(".orb-metric-context-menu")||_(null);};return document.addEventListener("pointerdown",U),()=>document.removeEventListener("pointerdown",U)},[$]);let B=N,Z=Jt.useMemo(()=>[D.chart1,D.chart2,D.chart3,D.chart4,D.chart5,D.chart6],[D]),Q=Jt.useMemo(()=>F?o:o.slice(0,Math.max(1,y)),[o,y,F]),ge=Math.max(0,o.length-Q.length),se=Q.some(U=>er(U.value)>0),le=Q.length>0&&(B!=="pie"&&B!=="donut"?true:se),be=(C??[B,"bar","column","line","pie","donut","scatter","bubble","list"]).filter((U,Fe,ye)=>us.includes(U)&&ye.indexOf(U)===Fe),_e={...qy,...P},De=Q[0],Pe=k??`${t} ${_e[B]} chart`,Ve=U=>{O(U),a?.(U);},Te=Jt.useCallback((U,Fe)=>{X({item:U,source:Fe}),_(null),s?.(U,Fe);},[s]),xe=Jt.useCallback(U=>{V(),!(!x||$)&&(A.current=window.setTimeout(()=>{Te(U,"hover"),A.current=null;},Math.max(0,h)));},[V,$,h,Te,x]),We=Jt.useCallback(()=>{V();},[V]),ot=Jt.useCallback((U,Fe)=>{if(!x)return;U.preventDefault(),V();let ye=I.current?.getBoundingClientRect(),Le=ye?ps(U.clientX-ye.left,8,Math.max(8,ye.width-164)):8,st=ye?ps(U.clientY-ye.top,8,Math.max(8,ye.height-72)):8;_({item:Fe,left:Le,top:st});},[V,x]),it=x?{onItemHoverStart:xe,onItemHoverEnd:We,onItemContextMenu:ot}:void 0,Ze=B==="metric"?c("div",{className:"orb-metric-kpi",role:i?"button":"img",tabIndex:i?0:void 0,onClick:()=>De&&i?.(De),onKeyDown:U=>{De&&i&&(U.key==="Enter"||U.key===" ")&&(U.preventDefault(),i(De));},"aria-label":Pe,...De?go(De,it):{},children:[e("span",{className:"orb-metric-kpi-label",children:De?.label??u??"Value"}),e("strong",{children:De?d(er(De.value)):"\u2014"}),De?.secondaryValue!==void 0&&c("span",{className:"orb-metric-kpi-secondary",children:[f??"Compared with"," \xB7 ",p(er(De.secondaryValue))]})]}):B==="progress"?e(eC,{data:Q,activeId:l,onItemClick:i,interactions:it,valueFormatter:d,colors:Z}):B==="bar"?e(Jy,{data:Q,activeId:l,onItemClick:i,interactions:it,valueFormatter:d,colors:Z}):B==="list"?e(oC,{data:Q,activeId:l,onItemClick:i,interactions:it,valueFormatter:d,secondaryValueFormatter:p}):B==="pie"||B==="donut"?e(rC,{type:B,data:Q,activeId:l,onItemClick:i,interactions:it,valueFormatter:d,colors:Z,ariaLabel:Pe}):e(tC,{type:B,data:Q,activeId:l,onItemClick:i,interactions:it,valueFormatter:d,secondaryValueFormatter:p,colors:Z,ariaLabel:Pe});return c("div",{ref:I,className:"orb-metric-chart-shell",onMouseLeave:()=>{V(),z?.source==="hover"&&X(null);},children:[c(Ee,{elevation:1,variant:"outlined",className:`orb-metric-chart-card ${R??""}`,style:S,sx:E,children:[c("div",{className:"orb-metric-chart-header",children:[c("div",{className:"orb-metric-chart-heading",children:[e(L,{variant:"subtitle1",component:"h3",noWrap:true,title:t,children:t}),r&&e(L,{variant:"caption",muted:true,component:"div",noWrap:true,children:r})]}),g&&be.length>1&&e(Wt,{"aria-label":`${t} chart type`,className:"orb-metric-chart-select",value:B,options:be.map(U=>({value:U,label:_e[U]})),onChange:U=>Ve(U.target.value),minWidth:108,fullWidth:false,size:"small"})]}),c("div",{className:"orb-metric-chart-body",children:[e(Qy,{loading:m,error:v,hasData:le,emptyState:b,children:Ze}),ge>0&&!m&&!v&&e("button",{type:"button",className:"orb-metric-more",onClick:()=>q(U=>!U),children:F?"Show fewer":`Show all ${o.length}`})]}),w&&e("div",{className:"orb-metric-chart-footer",children:w})]}),$&&c("div",{className:"orb-metric-context-menu",role:"menu",onMouseEnter:V,onKeyDown:U=>{U.key==="Escape"&&_(null);},style:{left:$.left,top:$.top},onPointerDown:U=>U.stopPropagation(),children:[e("div",{className:"orb-metric-context-label",children:$.item.label}),e("button",{type:"button",role:"menuitem",onClick:U=>{U.preventDefault(),U.stopPropagation(),Te($.item,"contextmenu");},children:"Show data"})]}),z&&c("div",{className:"orb-metric-data-details",role:"dialog","aria-label":`${z.item.label} data details`,onPointerDown:U=>U.stopPropagation(),children:[c("div",{className:"orb-metric-data-details-header",children:[e("strong",{children:z.item.label}),e("button",{type:"button","aria-label":"Close data details",onClick:()=>X(null),children:"\xD7"})]}),c("div",{className:"orb-metric-data-details-row",children:[e("span",{children:u??"Value"}),e("strong",{children:d(er(z.item.value))})]}),z.item.secondaryValue!==void 0&&c("div",{className:"orb-metric-data-details-row",children:[e("span",{children:f??"Secondary value"}),e("strong",{children:p(er(z.item.secondaryValue))})]}),e("span",{className:"orb-metric-data-details-hint",children:z.source==="hover"?`Shown after ${Math.max(0,h)/1e3} seconds of stillness`:"Shown from the context menu"})]})]})};ms.displayName="CMetricChartCard";T();var nC=({messageId:t,cardHooks:r,valueSuffix:o,secondaryValueSuffix:n,...a})=>{let i=(l,d)=>{r?.onCardEvent?.({messageId:t,cardType:"metric-chart-card",action:l,title:a.title,payload:d,rawData:a});},s=(l,d)=>`${l.toLocaleString()}${d??""}`;return e(ms,{...a,valueFormatter:l=>s(l,o),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})})},gs=nC;T();var aC=({type:t,manifest:r})=>c("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:[c("div",{className:"flex items-center px-4 py-3 border-b border-[var(--orb-border)] bg-[var(--orb-p50)]",children:[e("div",{className:"w-4 h-4 mr-2 text-[var(--orb-status-primary)]"}),c("h3",{className:"text-sm font-semibold text-[var(--orb-fg)]",children:["SAP Card: ",t]})]}),e("div",{className:"p-4",children:e("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] p-3 rounded border border-[var(--orb-border)] overflow-x-auto",children:e("pre",{className:"text-xs font-mono text-[var(--orb-muted)] whitespace-pre-wrap",children:JSON.stringify(r,null,2)})})})]}),fs=aC;var iC=t=>Array.isArray(t)?t.flatMap((r,o)=>{if(!r||typeof r!="object")return [];let n=r,a=String(n.label??n.name??n.id??`Item ${o+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??o),label:a,value:s,...l!==void 0&&Number.isFinite(l)?{secondaryValue:l}:{},...typeof n.color=="string"?{color:n.color}:{}}]}):[],bs=t=>{let r;try{r=JSON.parse(t);}catch{return null}if(r&&typeof r=="object"){if(r.type==="metric-chart-card"&&r.title&&Array.isArray(r.data)){let o=us.includes(r.chartType)?r.chartType:"bar";return {...r,type:"metric-chart-card",chartType:o,data:iC(r.data)}}if((r.type==="bar-chart-card"||r.type==="line-chart-card"||r.type==="pie-chart-card"||r.type==="combo-chart-card"||r.type==="heatmap-chart-card"||r.type==="fishbone-chart-card"||r.type==="waterfall-chart-card"||r.type==="google-map-card"||r.type==="amap-card")&&r.title||(r.type==="sap-analytical-card"||r.type==="sap-list-card"||r.type==="sap-object-card"||r.type==="sap-component-card")&&r.manifest||r.type==="error-card"||r.type==="warning-card"||r.type==="suggestions-card"||r.type==="tool-result-card"||r.type==="table"&&r.data)return r}return null};T();var mC=({content:t,theme:r,size:o="base",className:n,enableCodeHighlight:a=true,enableMermaid:i=true,messageId:s,cardHooks:l})=>{let d=Jt.useRef(l);d.current=l;let p=!!l?.onCardEvent,u=Jt.useMemo(()=>p?{onCardEvent:y=>d.current?.onCardEvent?.(y)}:void 0,[p]),f=Jt.useMemo(()=>t?t.replace(/<think>([\s\S]*?)<\/think>/g,(y,g)=>`<div data-component="thinkbox" data-think-content="${encodeURIComponent(g.trim())}"></div>`):"",[t]),b=(y,g,x,h,C)=>{u?.onCardEvent?.({messageId:s,cardType:y,action:g,title:x,payload:h,rawData:C});},m=(y,g,x,h,C,P)=>{if(!(!C&&!u?.onCardEvent))return (...w)=>{let k=C?.(...w),R=P?P(...w):void 0;return b(y,g,x,R,h),k}},v=Jt.useMemo(()=>({div(y){let{"data-component":g,"data-think-content":x,...h}=y;return g==="thinkbox"&&x?e(um,{content:decodeURIComponent(x),theme:r,size:o,defaultExpanded:false}):e("div",{...h})},table({children:y}){return e("div",{className:"my-4 w-full overflow-x-auto rounded-lg border border-[var(--orb-border)]",children:e("table",{className:"w-full min-w-[520px] border-collapse text-sm",children:y})})},thead({children:y}){return e("thead",{className:"bg-[color-mix(in_oklch,var(--orb-surface)_60%,transparent)]",children:y})},tbody({children:y}){return e("tbody",{className:"bg-[var(--orb-canvas)] dark:bg-[var(--orb-canvas)]",children:y})},tr({children:y}){return e("tr",{className:"border-b border-[var(--orb-border)] last:border-b-0",children:y})},th({children:y,align:g}){return e("th",{className:`px-3 py-2 font-semibold text-[var(--orb-fg)] ${g==="center"?"text-center":g==="right"?"text-right":"text-left"}`,children:y})},td({children:y,align:g}){return e("td",{className:`px-3 py-2 text-[var(--orb-fg)] align-top ${g==="center"?"text-center":g==="right"?"text-right":"text-left"}`,children:y})},code({className:y,children:g,...x}){let h=/language-([\w-]+)/.exec(y||""),C=h?h[1]:"",P=String(g);if(!h&&!P.includes(`
199
+ `))return e("code",{children:g});let k=P.replace(/\n$/,"");if(i&&C==="mermaid")return e(bm,{content:k});if(C==="json"){let R=bs(k);if(R)switch(R.type){case "table":return e(is,{data:R.data});case "metric-chart-card":return e(gs,{...R,messageId:s,cardHooks:u});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 e(ss,{...R});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return e(fs,{...R});case "error-card":{let S=R;return e(rs,{...S,onClose:m("error-card","close",S.title,S,S.onClose),onRetry:m("error-card","retry",S.title,S,S.onRetry)})}case "warning-card":{let S=R,E=S.onConfirm?m("warning-card","confirm",S.title,S,S.onConfirm):S.actionText&&u?.onCardEvent?m("warning-card","confirm",S.title,S):void 0;return e(os,{...S,onClose:m("warning-card","close",S.title,S,S.onClose),onConfirm:E})}case "suggestions-card":{let S=R;return e(ns,{...S,onClose:m("suggestions-card","close",S.title,S,S.onClose),onSuggestionClick:m("suggestions-card","suggestion-click",S.title,S,S.onSuggestionClick,E=>({suggestion:E}))})}case "tool-result-card":{let S=R;return e(as,{...S,onClose:m("tool-result-card","close",S.title,S,S.onClose),onAction:m("tool-result-card","action",S.title,S,S.onAction)})}}}return a?e(mm,{content:k,language:C,className:"not-prose"}):e("code",{className:y,...x,children:g})}}),[r,o,i,a,u,s]);return e("div",{className:dt("markdown-body max-w-none",n),children:e(lC__default.default,{remarkPlugins:[cC__default.default,dC__default.default],rehypePlugins:[pC__default.default,uC__default.default],components:v,children:f})})},In=mC;T();var gC=({content:t,messageId:r,cardHooks:o})=>{let n=(s,l,d,p,u)=>{o?.onCardEvent?.({messageId:r,cardType:s,action:l,title:d,payload:p,rawData:u});},a=(s,l,d,p,u,f)=>{if(!(!u&&!o?.onCardEvent))return (...b)=>{let m=u?.(...b),v=f?f(...b):void 0;return n(s,l,d,v,p),m}},i=bs(t);if(i)switch(i.type){case "table":return e(is,{data:i.data});case "metric-chart-card":return e(gs,{...i,messageId:r,cardHooks:o});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 e(ss,{...i});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return e(fs,{...i});case "error-card":{let s=i;return e(rs,{...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&&o?.onCardEvent?a("warning-card","confirm",s.title,s):void 0;return e(os,{...s,onClose:a("warning-card","close",s.title,s,s.onClose),onConfirm:l})}case "suggestions-card":{let s=i;return e(ns,{...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 e(as,{...s,onClose:a("tool-result-card","close",s.title,s,s.onClose),onAction:a("tool-result-card","action",s.title,s,s.onAction)})}}return e("div",{className:"dynamic-card-fallback",children:e(In,{content:t,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:r,cardHooks:o})})},Pm=gC;T();var Hl=class{static analyze(r){if(!r.trim())return {blocks:[],hasComplexContent:false,overallType:"simple"};let n=/```json\s*\{\s*"type":\s*"[^"]+"/g.test(r),a=/<[^>]+>[\s\S]*?<\/[^>]+>/.test(r),i=r.includes("NQ#")||r.includes("data-component");return n||a||i?{blocks:[{type:"mixed",content:r,startIndex:0,endIndex:r.length}],hasComplexContent:true,overallType:"complex"}:{blocks:[{type:"markdown",content:r,startIndex:0,endIndex:r.length}],hasComplexContent:false,overallType:"simple"}}},bC=({content:t,className:r="",messageId:o,cardHooks:n})=>{let a=Jt__namespace.default.useMemo(()=>Hl.analyze(t),[t]);return e("div",{className:`universal-content-renderer ${r}`,children:a.blocks.map((i,s)=>i.type==="mixed"||i.type==="json-card"?e(Pm,{content:i.content,messageId:o,cardHooks:n},`block-${s}`):e(In,{content:i.content,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:o,cardHooks:n},`block-${s}`))})},hs=bC;T();var hC=({content:t,isStreaming:r=true,onComplete:o,className:n="",streamIntervalMs:a=24,streamChunkSize:i=3,messageId:s,cardHooks:l})=>{let[d,p]=Jt.useState(r?0:t.length),[u,f]=Jt.useState(!r);Jt.useEffect(()=>{if(r){p(0),f(false);return}p(t.length),f(true);},[t,r]),Jt.useEffect(()=>{if(!r||u)return;if(d>=t.length){f(true),o?.();return}let g=window.setTimeout(()=>{p(x=>Math.min(x+i,t.length));},a);return ()=>{window.clearTimeout(g);}},[t.length,u,r,o,i,a,d]);let b=()=>{r&&!u&&(p(t.length),f(true),o?.());},m=r?t.slice(0,d):t,v=r&&!u,y=r&&!u;return c("div",{className:`streaming-markdown ${n}`,onClick:b,style:{cursor:r?"pointer":"default"},children:[c("div",{className:"relative",children:[e(hs,{content:m,messageId:s,cardHooks:l}),v&&e("span",{className:"inline-block w-[2px] h-[13px] ml-0.5 animate-pulse",style:{verticalAlign:"text-bottom",backgroundColor:"var(--orb-primary, #154194)"}})]}),y&&e("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"})]})},Rm=hC;T();var Mm=({buttons:t,className:r})=>{let o=n=>{switch(n){case "copy":return e(ho,{size:14});case "refresh":return e(Fa,{size:14});case "volume":return e(qc,{size:14});case "like":return e(Gc,{size:14});case "dislike":return e($c,{size:14});default:return null}};return e("div",{className:dt("flex items-center gap-1",r),children:t.map((n,a)=>e("button",{onClick:n.onClick,disabled:n.disabled,"aria-busy":n.loading||void 0,className:dt("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:o(n.type)},`${n.type}-${a}`))})};T();var vs=({message:t,onStreamingComplete:r,assistantActions:o,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=!!(o?.isResponding||t.isStreaming);return e("div",{className:"mb-4 flex justify-start",children:c("div",{className:"mr-auto w-full",style:{...s,background:"var(--orb-surface, #f5f5f5)",border:"1px solid var(--orb-border, #dbdbdb)"},children:[e(Rm,{content:t.content,isStreaming:t.isStreaming??false,onComplete:r,streamIntervalMs:n,streamChunkSize:a,messageId:t.id,cardHooks:i}),t.content&&o?.isLatestAssistant&&e("div",{className:"mt-3 flex flex-row justify-start gap-2 border-t pt-2",style:{borderColor:"var(--orb-border, #dbdbdb)"},children:e(Mm,{buttons:[{type:"refresh",onClick:()=>{o?.onRegenerate?.();},disabled:d||!o?.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"})}),e("div",{style:l,children:t.timestamp.toLocaleTimeString()})]})})}return e("div",{className:"mb-4 flex justify-end",children:c("div",{className:"ml-auto max-w-[80%]",style:{...s,background:"var(--orb-p50, #eef2f9)",border:"1px solid var(--orb-p100, #e4e9f5)"},children:[e("div",{className:"whitespace-pre-wrap",children:t.content}),e("div",{style:l,children:t.timestamp.toLocaleTimeString()})]})})};T();var Dm=({onTextUpdate:t,onComplete:r,onCancel:o,disabled:n,className:a})=>{let{isRecording:i,startRecording:s,stopRecording:l}=Cn({onTextUpdate:t,onComplete:p=>{r?.(p);},onError:p=>{console.error("Voice input error:",p),o?.();}});return e("button",{onClick:async()=>{i?l():await s();},disabled:n,className:dt("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?e(Jd,{size:16}):e(ep,{size:16})})};T();var tr={container:"w-full max-w-4xl mx-auto",inputContainer:dt("w-full flex flex-col border border-[var(--orb-border,#dbdbdb)] bg-[var(--orb-canvas,#ffffff)] 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:dt("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",fileTag:dt("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:dt("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:dt("cursor-pointer bg-[var(--orb-primary,#154194)] hover:bg-[var(--orb-p600,#0e2d63)] text-[var(--orb-on-primary)] shadow-none active:scale-95"),sendButtonDisabled:dt("cursor-not-allowed opacity-40 bg-[var(--orb-disabled-bg,#f5f5f5)] text-[var(--orb-disabled-fg,#8c8c8c)]"),stopButton:dt("cursor-pointer bg-[var(--orb-err,#c43f02)] hover:opacity-90 text-[var(--orb-on-primary)] shadow-none active:scale-95")},yC={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},CC=({enabled:t,onClick:r})=>e("button",{className:dt(tr.buttonBase,tr.buttonSmall,tr.buttonNormal),onClick:r,disabled:!t,"aria-label":"Upload file",type:"button",children:e(Nd,{size:16})}),xC=()=>c("button",{className:dt(tr.buttonBase,"h-[38px] gap-1 rounded-full px-2.5 md:h-8 md:px-2",tr.buttonNormal),"aria-label":"Tools",type:"button",children:[e(Kd,{size:15}),e("span",{className:"text-xs font-medium",children:"Tools"})]}),SC=({canSend:t,isResponding:r,onSend:o,onStop:n})=>r?e("button",{className:dt(tr.buttonBase,tr.buttonSmall,tr.stopButton),onClick:n,"aria-label":"Stop generating",type:"button",children:e(cp,{size:15})}):e("button",{className:dt(tr.buttonBase,tr.buttonSmall,t?tr.sendButton:tr.sendButtonDisabled),onClick:o,disabled:!t,"aria-label":"Send message",type:"button",children:e(np,{size:16,className:t?"text-[var(--orb-on-primary,#ffffff)]":"text-[var(--orb-disabled-fg,#8c8c8c)]"})}),zl=({onSend:t,onStop:r,isResponding:o=false,placeholder:n,getText:a})=>{let[i,s]=Jt.useState(""),[l,d]=Jt.useState([]),[p,u]=Jt.useState(false),[f,b]=Jt.useState(false),m=Jt.useRef(null),v=n||(a?a("00019","Type a message..."):"Type a message..."),y=(i.trim().length>0||l.length>0)&&!o,g={enabled:true},x=Jt.useCallback(F=>{s(F.target.value),F.target.style.height="auto",F.target.style.height=`${Math.min(F.target.scrollHeight,200)}px`;},[]),h=Jt.useCallback(F=>{if(F.target.files&&F.target.files.length>0){let q=Array.from(F.target.files);d(z=>{let X=q.filter(_=>z.some(V=>V.name===_.name&&V.size===_.size));X.length>0&&console.warn("Duplicate files ignored:",X.map(_=>_.name));let $=q.filter(_=>!z.some(V=>V.name===_.name&&V.size===_.size));return [...z,...$]}),m.current&&(m.current.value="");}},[]),C=Jt.useCallback(F=>{d(q=>q.filter((z,X)=>X!==F));},[]),P=Jt.useCallback(()=>{m.current?.click();},[]),w=Jt.useCallback(async()=>{if(!y)return;let F=i,q=[...l];s(""),d([]),m.current&&(m.current.value="");try{await t(F,q);}catch(z){console.error("Failed to send message:",z),s(F),d(q);}},[i,y,t,l]),k=Jt.useCallback(F=>{F.key==="Enter"&&!F.shiftKey&&!p&&(F.preventDefault(),w());},[w,p]),R=Jt.useCallback(()=>{u(true);},[]),S=Jt.useCallback(()=>{u(false);},[]),E=Jt.useCallback(F=>{s(F);},[]),D=Jt.useCallback(F=>{s(F);},[]),I=Jt.useCallback(()=>{},[]),A=Jt.useCallback(F=>{F.preventDefault(),b(true);},[]),N=Jt.useCallback(F=>{F.preventDefault(),b(false);},[]),O=Jt.useCallback(F=>{if(F.preventDefault(),b(false),F.dataTransfer.files&&F.dataTransfer.files.length>0){let q=Array.from(F.dataTransfer.files);d(z=>[...z,...q]);}},[]);return e("div",{className:tr.container,children:c("div",{className:"relative",children:[e("input",{type:"file",multiple:true,className:"hidden",ref:m,onChange:h}),c("div",{className:dt(tr.inputContainer,f&&tr.dragActive),onDragOver:A,onDragLeave:N,onDrop:O,children:[l.length>0&&e("div",{className:tr.filePreviewArea,children:l.map((F,q)=>c("div",{className:tr.fileTag,children:[e(Xd,{sx:{fontSize:16},className:"text-[var(--orb-primary)]"}),e("span",{className:"truncate max-w-[150px]",children:F.name}),e("button",{onClick:()=>C(q),className:"ml-1 hover:text-[var(--orb-status-error)] focus:outline-none",type:"button",children:e(zd,{sx:{fontSize:16}})})]},`${F.name}-${q}`))}),c("div",{className:"flex w-full flex-col p-2",children:[e("div",{className:dt(tr.textareaWrapper,"min-h-[52px] px-2 pb-2 pt-1.5 md:min-h-[44px]"),children:e("textarea",{className:dt(tr.textarea,"min-h-[24px] py-0 px-0"),placeholder:v,value:i,onChange:x,onKeyDown:k,onCompositionStart:R,onCompositionEnd:S,style:yC,"aria-label":"Message input",spellCheck:false,rows:1})}),c("div",{className:"flex items-center justify-between px-1 pb-0.5",children:[c("div",{className:"flex items-center gap-1",role:"toolbar","aria-label":"Input tools",children:[e(CC,{enabled:g.enabled,onClick:P}),e(xC,{})]}),c("div",{className:"flex items-center gap-1",children:[e(Dm,{onTextUpdate:E,onComplete:D,onCancel:I,disabled:o,className:tr.buttonSmall}),e(SC,{canSend:y,isResponding:o,onSend:w,onStop:r})]})]})]})]})]})})};T();var Am=({messages:t,onSend:r,onStop:o,onRegenerate:n,isResponding:a=false,className:i,placeholder:s,streamIntervalMs:l,streamChunkSize:d,onMessageStreamingComplete:p,cardHooks:u,showInput:f=true,statusLine:b})=>{let m=Jt.useRef(null),v=Jt.useRef(t.length);return Jt.useEffect(()=>{t.length>v.current&&m.current?.scrollIntoView({behavior:"smooth"}),v.current=t.length;},[t]),c("div",{className:dt("flex flex-col h-full w-full relative",i),children:[c("div",{className:"flex-1 overflow-y-auto px-4 py-4 space-y-6 scrollbar-thin scrollbar-thumb-[var(--orb-border)]",children:[t.map((y,g)=>{let x=y.type==="assistant"&&g===t.length-1,h=y.type==="assistant"?{isLatestAssistant:x,isResponding:a,onRegenerate:n?()=>n(y.id):void 0}:void 0;return e(vs,{message:y,assistantActions:h,onStreamingComplete:()=>p?.(y.id),streamIntervalMs:l,streamChunkSize:d,cardHooks:u},y.id)}),b,e("div",{ref:m})]}),f&&e("div",{className:"border-t border-[var(--orb-border,#dbdbdb)] bg-[var(--orb-canvas,#ffffff)] p-4 z-10",children:e(zl,{onSend:r||(async()=>{}),onStop:o||(()=>{}),isResponding:a,placeholder:s})})]})};T();var Em={idle:"Idle",running:"Working",success:"Success",error:"Error",pending:"Pending"},Lm=({title:t="AI Agent",description:r,headerActions:o,className:n,agentStatus:a,statusText:i,onHeaderPointerDown:s,showInput:l=false,...d})=>{let p=a??(d.isResponding?"running":"idle"),u=p==="running"||p==="pending",f=[Em[p],r].filter(Boolean).join(" \xB7 ");return c("div",{className:dt("orb-agent-panel",n),children:[c("div",{className:dt("orb-agent-header",s&&"cursor-grab active:cursor-grabbing"),onPointerDown:s,children:[e("span",{className:"orb-agent-avatar","aria-hidden":"true",children:"AI"}),c("div",{className:"min-w-0 flex-1",children:[e("div",{className:"orb-agent-title",children:t}),c("div",{className:"orb-agent-subtitle",children:[e("span",{className:"orb-agent-dot","data-active":u||void 0}),e("span",{className:"truncate",children:f||"Agent"})]})]}),o&&e("div",{className:"ml-auto flex flex-none items-center gap-1",children:o})]}),e("div",{className:"relative min-h-0 flex-1",children:e(Am,{...d,showInput:l,statusLine:u?c("div",{className:dt("orb-agent-status-line","mb-1"),children:[e("span",{className:"orb-agent-spinner","aria-hidden":"true"}),e("span",{children:i??`${Em[p]}\u2026`})]}):void 0})})]})};T();var MC=2e3,DC=1/3,Cs=[.25,.5,.75,1,1.5,2,3,4],NC=100,Om={color:"inherit",background:"transparent",textShadow:"none",fontFamily:"inherit",fontSize:"inherit",lineHeight:"inherit",textAlign:"left",wordSpacing:"normal",wordBreak:"normal",overflowWrap:"normal",tabSize:"inherit",hyphens:"none"},Fm=({text:t,language:r,startLine:o,endLine:n,wrap:a,labels:i})=>{let s=Jt.useRef(null),l=Jt.useMemo(()=>{let u=t.split(`
200
+ `);u.length>1&&u[u.length-1]===""&&u.pop();let f=Math.min(u.length,MC);return {shown:u.slice(0,f).join(`
201
+ `),shownCount:f,total:u.length}},[t]),d=Jt.useCallback(u=>{let f=n??o,b=o!==void 0&&f!==void 0&&u>=o&&u<=f;return {className:"orb-omph-code-line","data-line":u,...b?{"data-hit":"true"}:{}}},[n,o]);Jt.useEffect(()=>{let u=s.current,f=u?.closest(".orb-omph-pv-body");if(!u||!f)return;if(o===void 0){f.scrollTop=0;return}let b=u.querySelector(`[data-line="${o}"]`);if(!b)return;let m=b.getBoundingClientRect().top-f.getBoundingClientRect().top+f.scrollTop;f.scrollTop=Math.max(0,m-f.clientHeight*DC);},[o,l.shown]);let p={"--orb-omph-digits":String(l.shownCount).length};return c("div",{ref:s,className:"orb-omph-code","data-wrap":a||void 0,style:p,children:[e(reactSyntaxHighlighter.Prism,{language:r,useInlineStyles:false,PreTag:"div",CodeTag:"div",showLineNumbers:true,wrapLines:true,lineProps:d,customStyle:Om,codeTagProps:{className:`language-${r}`,style:Om},children:l.shown}),l.total>l.shownCount&&e("div",{className:"orb-omph-pv-note",children:i.previewTruncated(l.shownCount,l.total)})]})},Bm=({text:t})=>e("div",{className:"orb-omph-pv-doc",children:e(In,{content:t})}),Hm=({url:t,alt:r,labels:o})=>{let[n,a]=Jt.useState("fit"),[i,s]=Jt.useState(null),[l,d]=Jt.useState(false),p=n==="fit"?1:n,u=Cs.some(v=>v>p),f=Cs.some(v=>v<p),b=v=>a(y=>{let g=y==="fit"?1:y;return (v>0?Cs.find(h=>h>g):[...Cs].reverse().find(h=>h<g))??y}),m=n==="fit"||i===null?{maxWidth:"100%",height:"auto"}:{width:i*n,maxWidth:"none",height:"auto"};return l?e("div",{className:"orb-omph-pv-note",role:"alert",children:r?`${o.imageFailed} \xB7 ${r}`:o.imageFailed}):c("div",{className:"orb-omph-img",children:[e("div",{className:"orb-omph-img-stage",children:e("img",{src:t,alt:r??"",draggable:false,style:m,onLoad:v=>s(v.currentTarget.naturalWidth),onError:()=>d(true)})}),c("div",{className:"orb-omph-img-zoom",role:"group","aria-label":o.zoomFit,children:[e("button",{type:"button","aria-label":o.zoomOut,disabled:!f,onClick:()=>b(-1),children:"\u2212"}),e("button",{type:"button","aria-label":o.zoomFit,"data-active":n==="fit"||void 0,onClick:()=>a("fit"),children:n==="fit"?o.zoomFit:`${Math.round(n*NC)}%`}),e("button",{type:"button","aria-label":o.zoomIn,disabled:!u,onClick:()=>b(1),children:"+"})]})]})};var AC=/^[a-z][a-z0-9+.-]*:/i,EC=/^L(\d+)(?:-L?(\d+))?$/i;var zm=["B","KB","MB","GB"];var LC=t=>{try{return decodeURIComponent(t)}catch{return t}},Wl=t=>{let r=t.trim();if(!r||r.startsWith("#")||r.startsWith("//")||AC.test(r))return null;let o=r.indexOf("#"),n=o>=0?r.slice(0,o):r,a=o>=0?r.slice(o+1):"",i=n.indexOf("?"),s=LC(i>=0?n.slice(0,i):n);if(!s||s.endsWith("/"))return null;let l=EC.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)}},$l=t=>t.split("/").filter(Boolean).pop()??t,Wm=t=>{let r=t.split("/");return r.pop(),r.join("/")},Gl=t=>{let r=$l(t),o=r.lastIndexOf(".");return o>0?r.slice(o+1).toLowerCase():""},$m={prism:"text",label:"Text"},Vm={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:$m},_l=(t,r)=>r?Object.values(Vm).find(n=>n.prism===r)??{prism:r,label:r}:Vm[Gl(t)]??$m,Gm=t=>{let r=t,o=0;for(;r>=1024&&o<zm.length-1;)r/=1024,o+=1;return `${o>0&&r<10?r.toFixed(1):Math.round(r).toString()} ${zm[o]}`};T();var OC=1e3,FC=9,fo=16,Ul=({tone:t,icon:r,title:o,text:n,action:a})=>c("div",{className:"orb-omph-pv-notice","data-tone":t,role:t==="error"?"alert":void 0,children:[e("span",{className:"orb-omph-pv-notice-icon","aria-hidden":"true",children:r}),e("div",{className:"orb-omph-pv-notice-title",children:o}),n&&e("p",{className:"orb-omph-pv-notice-text",children:n}),a]}),Km=({state:t,placement:r,expanded:o,canExpand:n,labels:a,gripProps:i,paneRef:s,onClose:l,onRetry:d,onToggleExpand:p,onOpenExternally:u})=>{let[f,b]=Jt.useState(true),[m,v]=Jt.useState(false),{open:y,ref:g,phase:x,data:h}=t,C=h?.body;Jt.useEffect(()=>{if(!m)return;let O=window.setTimeout(()=>v(false),OC);return ()=>window.clearTimeout(O)},[m]),Jt.useEffect(()=>{y&&s.current?.focus({preventScroll:true});},[y,s,g?.path]);let P=h?.absolutePath??g?.path??"",w=C&&(C.kind==="markdown"||C.kind==="code")?C.text:P,k=w===P?a.previewCopyPath:a.previewCopyContent,R=C?.kind==="code"&&g?_l(g.path,C.language):null,S=[];R&&S.push(R.label),C?.kind==="markdown"&&S.push("Markdown"),C?.kind==="image"&&g&&S.push(Gl(g.path).toUpperCase()),h?.size!==void 0&&S.push(Gm(h.size)),C?.kind==="code"&&g?.startLine!==void 0&&S.push(a.previewLines(g.startLine,g.endLine??g.startLine));let E=O=>{O.key==="Escape"&&(O.stopPropagation(),l(true));},D=e("button",{type:"button",className:"orb-omph-pv-action",onClick:d,children:a.previewRetry}),I=()=>{if(!g)return null;if(x==="loading")return e("div",{className:"orb-omph-pv-skel",role:"status","aria-label":a.previewLoading,children:Array.from({length:FC},(O,F)=>e("span",{},F))});if(x==="error"||!C)return e(Ul,{tone:"error",icon:e(ka,{size:fo}),title:a.previewFailed,text:P,action:D});switch(C.kind){case "missing":return e(Ul,{tone:"neutral",icon:e(Ra,{size:fo}),title:a.previewMissing,text:C.message??P});case "unsupported":return e(Ul,{tone:"neutral",icon:e(Ra,{size:fo}),title:a.previewUnsupported,text:C.message??P,action:u&&e("button",{type:"button",className:"orb-omph-pv-action",onClick:()=>u(g),children:a.previewOpenExternal})});case "markdown":return e(Bm,{text:C.text},g.path);case "code":return e(Fm,{text:C.text,language:_l(g.path,C.language).prism,startLine:g.startLine,endLine:g.endLine,wrap:f,labels:a},g.path);case "image":return e(Hm,{url:C.url,alt:C.alt,labels:a},C.url);default:return null}},A=r==="overlay",N=C?.kind==="image"?Nc:Ra;return c("aside",{ref:s,className:"orb-omph-preview","data-open":y||void 0,"data-placement":r,role:A?"dialog":"complementary","aria-label":a.previewTitle,"aria-hidden":!y||void 0,tabIndex:-1,onKeyDown:E,children:[!A&&y&&e("div",{className:"orb-omph-pv-grip","aria-label":a.previewResize,...i}),c("div",{className:"orb-omph-pv",children:[c("header",{className:"orb-omph-pv-head",children:[A&&e("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewBack,onClick:()=>l(true),children:e(Ta,{size:fo})}),e("span",{className:"orb-omph-pv-glyph","aria-hidden":"true",children:e(N,{size:fo})}),c("div",{className:"orb-omph-pv-titles",children:[e("div",{className:"orb-omph-pv-name",title:P,children:g?$l(g.path):""}),e("div",{className:"orb-omph-pv-path",title:P,children:e("bdi",{children:Wm(P)})})]}),c("div",{className:"orb-omph-pv-actions",children:[C?.kind==="code"&&e("button",{type:"button",className:"orb-omph-text-button","aria-pressed":f,onClick:()=>b(O=>!O),children:a.previewWrap}),g&&e("button",{type:"button",className:"orb-omph-icon-button","aria-label":m?a.copied:k,title:m?a.copied:k,onClick:()=>{navigator.clipboard.writeText(w).then(()=>v(true));},children:m?e(qr,{size:fo}):e(ho,{size:fo})}),n&&e("button",{type:"button",className:"orb-omph-icon-button","aria-pressed":o,"aria-label":o?a.previewCollapse:a.previewExpand,title:o?a.previewCollapse:a.previewExpand,onClick:p,children:e(Ic,{size:fo})}),!A&&e("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewClose,onClick:()=>l(true),children:e(Zt,{size:fo})})]})]}),e("div",{className:"orb-omph-pv-meta",children:S.join(" \xB7 ")}),e("div",{className:"orb-omph-pv-body","data-kind":x==="ready"?C?.kind:void 0,children:I()})]})]})};T();var HC=1e3,qm=50,zC=1e3,VC=t=>t==="tool"?Jo:t==="command"?Hn:Fc,Ym=t=>!!t.streaming||t.status==="running"||t.status==="pending",WC=(t,r)=>r==="expanded"?true:Ym(t),$C=t=>t!==void 0&&(t.inputTokens!==void 0||t.outputTokens!==void 0||t.durationMs!==void 0),GC=(t,r)=>`${Math.max(1,Math.round(t/zC))}${r.secondUnit}`,_C=({content:t})=>{let r=Jt.useRef(null),[o,n]=Jt.useState(false);return Jt.useEffect(()=>{let a=r.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]),e("div",{ref:r,className:"orb-omph-process-body","data-overflow":o||void 0,children:t})},UC=({turn:t,labels:r})=>{let[o,n]=Jt.useState(false),[a,i]=Jt.useState(false),s=t.assistant?.content??"",l=t.usage;return Jt.useEffect(()=>{if(!o)return;let d=window.setTimeout(()=>n(false),HC);return ()=>window.clearTimeout(d)},[o]),c("div",{className:"orb-omph-turn-actions",role:"group","aria-label":r.turnActions,children:[e("span",{className:"orb-omph-actions-time",children:t.assistant?.timestamp.toLocaleTimeString()}),$C(l)&&c(jsxRuntime.Fragment,{children:[e("span",{className:"orb-omph-actions-divider","aria-hidden":"true"}),e("button",{type:"button",className:"orb-omph-text-button","aria-expanded":a,onClick:()=>i(d=>!d),children:r.usage})]}),e("button",{type:"button",className:"orb-omph-icon-button orb-omph-actions-end","aria-label":o?r.copied:r.copy,onClick:()=>{navigator.clipboard.writeText(s).then(()=>n(true));},children:o?e(qr,{size:14}):e(ho,{size:14})}),a&&l&&c("div",{className:"orb-omph-usage",children:[l.inputTokens!==void 0&&c("span",{children:[r.inputTokens," ",l.inputTokens.toLocaleString()]}),l.outputTokens!==void 0&&c("span",{children:[r.outputTokens," ",l.outputTokens.toLocaleString()]}),l.durationMs!==void 0&&c("span",{children:[r.duration," ",GC(l.durationMs,r)]})]})]})},KC=({item:t,display:r,open:o,onToggle:n})=>{let a=VC(t.kind),i=Ym(t),s=r!=="compact"&&!!t.summary,l=o&&!!t.content;return c("div",{className:"orb-omph-process","data-status":t.status,"data-open":o||void 0,children:[c("button",{type:"button",className:"orb-omph-process-toggle","aria-expanded":o,onClick:n,children:[e(Fr,{size:12,className:"orb-omph-process-chevron"}),e(a,{size:14}),e("span",{className:i?"orb-omph-shimmer":void 0,children:t.title}),s&&e("span",{className:"orb-omph-process-summary",children:t.summary})]}),l&&t.content&&e(_C,{content:t.content}),o&&t.streaming&&e("span",{className:"orb-omph-caret","aria-hidden":"true"})]})},Kl=t=>{let r=t.user?.content||t.assistant?.content||t.id,o=r.split(`
202
+ `).find(n=>n.trim())??r;return o.length>qm?`${o.slice(0,qm)}\u2026`:o},qC=0,Zm=({turns:t,labels:r,processDisplay:o,cardHooks:n,resolveFileLink:a,onOpenFile:i})=>{let[s,l]=Jt.useState({}),d=p=>{if(!i||p.defaultPrevented||p.button!==qC||p.metaKey||p.ctrlKey||p.shiftKey||p.altKey)return;let u=p.target.closest("a[href]");if(!u)return;let f=a(u.getAttribute("href")??"");f&&(p.preventDefault(),i(f,u));};return e(jsxRuntime.Fragment,{children:t.map((p,u)=>{let f=!!(p.assistant&&!p.assistant.streaming),m=u===t.length-1&&f?"always":"hover";return c("article",{className:"orb-omph-turn","data-omph-turn":p.id,"data-actions-reveal":m,children:[p.user&&c("div",{className:"orb-omph-user",children:[e("div",{className:"orb-omph-user-bubble",children:p.user.content}),e("div",{className:"orb-omph-clock",children:p.user.timestamp.toLocaleTimeString()})]}),p.process&&p.process.length>0&&e("div",{className:"orb-omph-process-list",children:p.process.map(v=>{let y=v.id in s?s[v.id]:WC(v,o);return e(KC,{item:v,display:o,open:y,onToggle:()=>l(g=>({...g,[v.id]:!y}))},v.id)})}),p.assistant&&c("div",{className:"orb-omph-assistant","data-file-links":i?"true":void 0,onClick:d,children:[e(hs,{content:p.assistant.content,messageId:p.assistant.id,cardHooks:n}),p.assistant.streaming&&e("span",{className:"orb-omph-caret","aria-hidden":"true"})]}),p.failure&&e("div",{className:"orb-omph-failure","data-severity":p.failure.severity,children:p.failure.content}),f&&e(UC,{turn:p,labels:r})]},p.id)})})};var XC={idle:"Idle",pending:"Pending",running:"Working",success:"Success",error:"Error",working:"Working",workingFor:t=>`Working for ${t}`,loadOlder:"Load earlier",loadingOlder:"Loading earlier\u2026",toBottom:"Back to bottom",copy:"Copy",copied:"Copied",turnActions:"Reply actions",usage:"Usage",inputTokens:"Input",outputTokens:"Output",duration:"Duration",send:"Send",stop:"Stop",turnRail:"Turns",secondUnit:"s",minuteUnit:"m",previewTitle:"File preview",previewClose:"Close preview",previewBack:"Back to conversation",previewExpand:"Expand preview",previewCollapse:"Restore preview size",previewCopyContent:"Copy content",previewCopyPath:"Copy path",previewOpenExternal:"Open externally",previewWrap:"Wrap",previewLoading:"Loading file",previewMissing:"File not found",previewFailed:"Could not load this file",previewUnsupported:"No preview for this file type",previewRetry:"Try again",previewResize:"Resize preview",previewLines:(t,r)=>t===r?`Line ${t}`:`Lines ${t}\u2013${r}`,previewTruncated:(t,r)=>`Showing the first ${t.toLocaleString()} of ${r.toLocaleString()} lines`,imageFailed:"The image could not be displayed",zoomIn:"Zoom in",zoomOut:"Zoom out",zoomFit:"Fit to width"},Qm=t=>({...XC,...t}),YC=1e3,jm=60,ZC=1e3,Jm=(t,r)=>{let o=Math.max(1,Math.round(Math.max(t,ZC)/YC)),n=Math.floor(o/jm),a=o%jm;return n<=0?`${o}${r.secondUnit}`:`${n}${r.minuteUnit} ${a}${r.secondUnit}`};var JC={open:false,ref:null,phase:"loading",data:null},eg=t=>{let[r,o]=Jt.useState(JC),n=Jt.useRef(r);n.current=r;let a=Jt.useRef(t);a.current=t;let i=Jt.useRef(null),s=Jt.useRef(0),l=Jt.useRef(null),d=Jt.useCallback(b=>{let m=a.current;if(!m)return;i.current?.abort();let v=new AbortController;i.current=v,s.current+=1;let y=s.current;o({open:true,ref:b,phase:"loading",data:null}),m(b,v.signal).then(g=>{y===s.current&&o(x=>({...x,phase:"ready",data:g}));},()=>{y!==s.current||v.signal.aborted||o(g=>({...g,phase:"error",data:null}));});},[]),p=Jt.useCallback((b,m)=>{l.current=m??null;let v=n.current;if(v.ref?.path===b.path&&v.phase==="ready"){o({...v,open:true,ref:b});return}d(b);},[d]),u=Jt.useCallback((b=false)=>{s.current+=1,i.current?.abort(),o(v=>({...v,open:false}));let m=l.current;b&&m?.isConnected&&m.focus({preventScroll:true});},[]),f=Jt.useCallback(()=>{let{ref:b}=n.current;b&&d(b);},[d]);return Jt.useEffect(()=>()=>{i.current?.abort();},[]),{state:r,open:p,close:u,reload:f}};var Xl="--orb-omph-pv-w",Yl="--orb-omph-pv-pref",rx=880,ox=560,rg=400,Go=320,nx=.45,ax=.7,og=24,ql=(t,r,o)=>Math.min(Math.max(t,r),Math.max(r,o)),ng=({open:t,layout:r})=>{let o=Jt.useRef(null),n=Jt.useRef(null),[a,i]=Jt.useState(0),[s,l]=Jt.useState(null),[d,p]=Jt.useState(false),[u,f]=Jt.useState(false);Jt.useLayoutEffect(()=>{let k=o.current;if(!k)return;let R=()=>i(k.getBoundingClientRect().width);R();let S=new ResizeObserver(R);return S.observe(k),()=>S.disconnect()},[]),Jt.useEffect(()=>{t||p(false);},[t]);let b=r==="overlay"?false:r==="split"?a>=rg+Go:a>=rx,m=b&&!d?"split":"overlay",v=Math.max(Go,Math.min(a*ax,a-rg)),y=ql(s??a*nx,Go,v),g=a>0&&a<ox,x=Jt.useCallback(k=>{let R=o.current;R&&(R.style.setProperty(Yl,`${k}px`),R.dataset.placement==="split"&&R.dataset.open==="true"&&R.style.setProperty(Xl,`${k}px`));},[]),h=Jt.useCallback(k=>{k.button===0&&(k.preventDefault(),k.currentTarget.setPointerCapture(k.pointerId),n.current={pointerId:k.pointerId,startX:k.clientX,startWidth:y,latest:y},f(true));},[y]),C=Jt.useCallback(k=>{let R=n.current;!R||R.pointerId!==k.pointerId||(R.latest=ql(R.startWidth+(R.startX-k.clientX),Go,v),x(R.latest));},[v,x]),P=Jt.useCallback(k=>{let R=n.current;!R||R.pointerId!==k.pointerId||(n.current=null,k.currentTarget.hasPointerCapture(k.pointerId)&&k.currentTarget.releasePointerCapture(k.pointerId),l(R.latest),f(false));},[]),w=Jt.useCallback(k=>{let R={ArrowLeft:y+og,ArrowRight:y-og,Home:Go,End:v};k.key in R&&(k.preventDefault(),l(ql(R[k.key],Go,v)));},[v,y]);return {mainRef:o,placement:m,width:y,compact:g,dragging:u,expanded:d,canExpand:b,toggleExpanded:()=>p(k=>!k),gripProps:{role:"separator","aria-orientation":"vertical","aria-valuemin":Go,"aria-valuemax":Math.round(v),"aria-valuenow":Math.round(y),tabIndex:0,onPointerDown:h,onPointerMove:C,onPointerUp:P,onPointerCancel:P,onKeyDown:w}}};var ks=48,sx=900,ig=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,sg=({turns:t,contentVersion:r,hasOlder:o=false,loadingOlder:n=false,onLoadOlder:a})=>{let i=Jt.useRef(null),s=Jt.useRef(null),l=Jt.useRef(true),d=Jt.useRef({height:0,top:0}),p=Jt.useRef(void 0),u=Jt.useRef(false),[f,b]=Jt.useState(true),[m,v]=Jt.useState(false),[y,g]=Jt.useState(t[0]?.id),x=Jt.useCallback(()=>{let k=i.current;k&&(d.current={height:k.scrollHeight,top:k.scrollTop});},[]),h=Jt.useCallback(()=>{let k=i.current;if(!k)return;let R=k.getBoundingClientRect().top,S=k.querySelector("[data-omph-turn]")?.dataset.omphTurn;k.querySelectorAll("[data-omph-turn]").forEach(E=>{E.getBoundingClientRect().top-R<=ks&&(S=E.dataset.omphTurn);}),g(S);},[]);Jt.useEffect(()=>{let k=i.current,R=s.current;if(!k||!R)return;let S=()=>{v(k.clientWidth>sx),l.current&&(k.scrollTop=k.scrollHeight),x();};S();let E=new ResizeObserver(S);return E.observe(k),E.observe(R),()=>E.disconnect()},[x]),Jt.useLayoutEffect(()=>{let k=i.current;if(!k)return;let R=t[0]?.id,S=p.current,E=S!==void 0&&R!==void 0&&R!==S;if(p.current=R,E){l.current=false,b(false);let D=k.scrollHeight-d.current.height;k.scrollTop=d.current.top+Math.max(0,D),x(),h();return}l.current&&(k.scrollTop=k.scrollHeight),x(),h();},[r,x,t,h]),Jt.useEffect(()=>{n||(u.current=false);},[n]);let C=Jt.useCallback(()=>{let k=i.current;if(!k)return;let S=k.scrollHeight-k.scrollTop-k.clientHeight<=ks;S!==l.current&&(l.current=S,b(S)),x(),h();let E=k.scrollHeight-k.clientHeight>ks,D=k.scrollTop<=ks;!E||!D||S||!o||n||!a||u.current||(u.current=true,a());},[o,n,a,x,h]),P=Jt.useCallback(()=>{let k=i.current;k&&(l.current=true,b(true),k.scrollTo({top:k.scrollHeight,behavior:ig()?"auto":"smooth"}));},[]),w=Jt.useCallback(k=>{let S=i.current?.querySelector(`[data-omph-turn="${CSS.escape(k)}"]`);S&&(l.current=false,b(false),S.scrollIntoView({block:"start",behavior:ig()?"auto":"smooth"}));},[]);return {scrollerRef:i,contentRef:s,following:f,railVisible:m,activeTurnId:y,onScroll:C,returnToBottom:P,scrollToTurn:w}};T();var cx=1e3,dx=(t,r)=>r[t],px=t=>t.map(r=>[r.id,r.user?.content.length??0,r.assistant?.content.length??0,r.assistant?.streaming?"1":"0",r.failure?.id??"",(r.process??[]).map(o=>`${o.id}:${o.status}:${o.content?.length??0}`).join(",")].join(":")).join("|"),ux=({startedAt:t,labels:r})=>{let[o,n]=Jt.useState(()=>Date.now());Jt.useEffect(()=>{n(Date.now());let i=window.setInterval(()=>n(Date.now()),cx);return ()=>window.clearInterval(i)},[t]);let a=t===void 0?r.working:r.workingFor(Jm(Math.max(0,o-t),r));return c("div",{className:"orb-omph-running","data-omph-running":"true",children:[e("span",{className:"orb-visually-hidden",role:"status","aria-live":"polite",children:r.working}),e("span",{className:"orb-omph-running-rule","aria-hidden":"true"}),c("span",{className:"orb-omph-running-body",children:[e("span",{className:"orb-omph-spinner","aria-hidden":"true"}),e("span",{className:"orb-omph-shimmer",children:a})]})]})},VH=({turns:t,title:r="OMPH Agent",description:o,headerActions:n,agentStatus:a,isResponding:i=false,labels:s,processDisplay:l="standard",showInput:d=false,placeholder:p,className:u,cardHooks:f,hasOlder:b=false,loadingOlder:m=false,onLoadOlder:v,onSend:y,onStop:g,onHeaderPointerDown:x,loadFilePreview:h,resolveFileLink:C=Wl,filePreviewLayout:P="auto",onOpenFileExternally:w})=>{let k=Qm(s),R=a??(i?"running":"idle"),S=R==="running"||R==="pending",E=[dx(R,k),o].filter(Boolean).join(" \xB7 "),D=Jt.useMemo(()=>px(t),[t]),I=sg({turns:t,contentVersion:D,hasOlder:b,loadingOlder:m,onLoadOlder:v}),[A,N]=Jt.useState(""),O=A.trim(),F=i&&O.length===0,q=[...t].reverse().find(le=>!!le.assistant?.streaming||le.process?.some(be=>be.streaming||be.status==="running"||be.status==="pending")),z=S?q?.startedAt:void 0,X=!!h,$=eg(h),_=ng({open:$.state.open,layout:P}),V=Jt.useRef(null),B=Jt.useRef(null),Z=X&&$.state.open&&_.placement==="overlay",Q=_.placement==="split"&&$.state.open,ge={[Yl]:`${_.width}px`,[Xl]:Q?`${_.width}px`:"0px"};Jt.useEffect(()=>{B.current?.toggleAttribute("inert",Z);},[Z]);let se=async()=>{if(!O||!y)return;let le=O;N("");try{await y(le);}catch{N(be=>be.trim().length===0?le:be);}};return c("div",{className:dt("orb-omph-panel",u),"data-omph-panel":"","data-status":R,"data-compact":_.compact||void 0,children:[c("div",{className:dt("orb-omph-header",x&&"cursor-grab active:cursor-grabbing"),onPointerDown:x,children:[e("span",{className:"orb-omph-avatar","aria-hidden":"true",children:"AI"}),c("div",{className:"min-w-0 flex-1",children:[e("div",{className:"orb-omph-title",children:r}),c("div",{className:"orb-omph-subtitle",children:[e("span",{className:"orb-omph-dot","data-active":S||void 0}),e("span",{className:"truncate",children:E||k.idle})]})]}),n&&e("div",{className:"ml-auto flex flex-none items-center gap-1",children:n})]}),c("div",{ref:_.mainRef,className:"orb-omph-main","data-placement":_.placement,"data-open":String($.state.open),"data-dragging":_.dragging||void 0,style:ge,children:[c("div",{ref:B,className:"orb-omph-center",children:[c("div",{className:"orb-omph-stage","data-rail":I.railVisible||void 0,children:[e("div",{ref:I.scrollerRef,className:"orb-omph-scroll",onScroll:I.onScroll,children:c("div",{ref:I.contentRef,className:"orb-omph-column",children:[b&&v&&e("button",{type:"button",className:"orb-omph-older",disabled:m,onClick:v,children:m?k.loadingOlder:k.loadOlder}),e(Zm,{turns:t,labels:k,processDisplay:l,cardHooks:f,resolveFileLink:C,onOpenFile:X?$.open:void 0}),S&&e(ux,{startedAt:z,labels:k})]})}),I.railVisible&&t.length>0&&e("nav",{className:"orb-omph-rail","aria-label":k.turnRail,children:t.map(le=>e("button",{type:"button",className:"orb-omph-rail-mark","data-active":I.activeTurnId===le.id||void 0,"aria-label":Kl(le),title:Kl(le),onClick:()=>I.scrollToTurn(le.id)},le.id))}),!I.following&&e("button",{type:"button",className:"orb-omph-to-bottom","aria-label":k.toBottom,onClick:I.returnToBottom,children:e(Fr,{size:16})})]}),d&&c("form",{className:"orb-omph-composer",onSubmit:le=>{le.preventDefault(),F?g?.():se();},children:[e("textarea",{className:"orb-omph-input",value:A,placeholder:p,rows:1,onChange:le=>N(le.target.value),onKeyDown:le=>{le.key!=="Enter"||le.shiftKey||le.nativeEvent.isComposing||(le.preventDefault(),F?g?.():se());}}),e("button",{type:"submit",className:F?"orb-omph-stop":"orb-omph-send","aria-label":F?k.stop:k.send,disabled:!F&&O.length===0,children:F?e(wc,{size:16}):e(Sc,{size:16})})]})]}),X&&e(Km,{state:$.state,placement:_.placement,expanded:_.expanded,canExpand:_.canExpand,labels:k,gripProps:_.gripProps,paneRef:V,onClose:$.close,onRetry:$.reload,onToggleExpand:_.toggleExpanded,onOpenExternally:w})]})]})};T();var mg=520,fx=88,bx=88,hx=24,Ps=640,gg=(t,r,o)=>Math.min(Math.max(t,r),Math.max(r,o)),jl=t=>typeof t=="number"?`${t}px`:t,vx=t=>t instanceof HTMLElement?!!t.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,qH=({anchor:t,defaultAnchor:r="right",onAnchorChange:o,width:n=mg,top:a=fx,bottom:i=bx,inset:s=hx,zIndex:l=1300,shellClassName:d,shellStyle:p,className:u,onHeaderPointerDown:f,...b})=>{let m=Jt.useRef(null),v=Jt.useRef(null),[y,g]=Jt.useState(r),[x,h]=Jt.useState(0),[C,P]=Jt.useState(typeof n=="number"?n:mg),[w,k]=Jt.useState(0),[R,S]=Jt.useState(false),E=t??y;Jt.useEffect(()=>{let z=()=>h(window.innerWidth);return z(),window.addEventListener("resize",z),()=>window.removeEventListener("resize",z)},[]),Jt.useLayoutEffect(()=>{let z=()=>{let $=m.current?.getBoundingClientRect();$?.width?P($.width):typeof n=="number"&&P(n);};if(z(),!m.current||typeof ResizeObserver>"u")return;let X=new ResizeObserver(z);return X.observe(m.current),()=>X.disconnect()},[n]);let D=Jt.useCallback(z=>{if(!x)return s;let X=x<Ps?12:s,$=Math.max(X,x-C-X);return x<Ps||z==="left"?X:z==="center"?gg((x-C)/2,X,$):$},[s,C,x]),I=Jt.useCallback(z=>["left","center","right"].reduce(($,_)=>{let V=Math.abs(z-D($));return Math.abs(z-D(_))<V?_:$},"right"),[D]),A=Jt.useCallback(z=>{t===void 0&&g(z),o?.(z);},[t,o]);Jt.useEffect(()=>{R||k(D(E));},[D,R,E]);let N=Jt.useCallback(z=>{f?.(z),!(z.defaultPrevented||vx(z.target))&&(z.preventDefault(),z.currentTarget.setPointerCapture(z.pointerId),v.current={pointerId:z.pointerId,startClientX:z.clientX,startX:w,currentX:w,captureElement:z.currentTarget},S(true));},[f,w]),O=Jt.useCallback(z=>{let X=v.current;if(!X||X.pointerId!==z.pointerId)return;let $=x<Ps?12:s,_=Math.max($,x-C-$),V=gg(X.startX+z.clientX-X.startClientX,$,_);X.currentX=V,k(V);},[s,C,x]),F=Jt.useCallback(z=>{let X=v.current;if(!X||X.pointerId!==z.pointerId)return;try{X.captureElement.releasePointerCapture(z.pointerId);}catch{}let $=I(X.currentX);v.current=null,S(false),A($),k(D($));},[D,A,I]),q=Jt.useMemo(()=>({position:"fixed",top:jl(a),bottom:jl(i),left:w,width:jl(n),maxWidth:`calc(100vw - ${x<Ps?24:s*2}px)`,zIndex:l,pointerEvents:"auto",transition:R?"none":"left 180ms ease-out",touchAction:"none",...p}),[i,s,R,w,p,a,x,n,l]);return e("div",{ref:m,className:dt("orbcafe-floating-agent-panel min-w-0",d),"data-anchor":E,"data-dragging":R?"true":"false",style:q,onPointerMove:O,onPointerUp:F,onPointerCancel:F,children:e(Lm,{...b,className:u,onHeaderPointerDown:N})})};T();var xx={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},tz=({messages:t,onSend:r,onRegenerate:o,isResponding:n=false,className:a,placeholder:i,title:s="Copilot",corner:l="bottom-right",onCollapse:d,onHeaderPointerDown:p,onPlusClick:u,onMicClick:f,streamIntervalMs:b,streamChunkSize:m,onMessageStreamingComplete:v,cardHooks:y})=>{let[g,x]=Jt.useState(""),[h,C]=Jt.useState(false),P=Jt.useRef(null),w=xx[l];Jt.useEffect(()=>{P.current?.scrollIntoView({behavior:"smooth"});},[t,n]);let k=Jt.useCallback(async()=>{let S=g.trim();!S||n||(x(""),await r(S));},[n,r,g]),R=Jt.useCallback(async S=>{S.key==="Enter"&&!h&&(S.preventDefault(),await k());},[k,h]);return c("div",{className:dt("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&&e("button",{onClick:d,className:dt("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:e("span",{className:dt("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]")})}),c("div",{className:"flex items-center justify-between border-b border-[var(--orb-border)] px-4 py-3",onPointerDown:p,children:[e("div",{className:"flex items-center",children:e("h3",{className:"text-base font-semibold tracking-tight text-[var(--orb-fg)]",children:s})}),e("div",{})]}),c("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,E)=>{let D=S.type==="assistant"&&E===t.length-1,I=S.type==="assistant"?{isLatestAssistant:D,isResponding:n,onRegenerate:o?()=>o(S.id):void 0}:void 0;return e(vs,{message:S,assistantActions:I,onStreamingComplete:()=>v?.(S.id),streamIntervalMs:b,streamChunkSize:m,cardHooks:y},S.id)}),e("div",{ref:P})]}),e("div",{className:"border-t border-[var(--orb-border)] px-3 py-3",children:c("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:[e("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:u,type:"button","aria-label":"Add",children:e(Oa,{className:"h-4 w-4"})}),e("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,onChange:S=>x(S.target.value),onCompositionStart:()=>C(true),onCompositionEnd:()=>C(false),onKeyDown:R,"aria-label":"Copilot input",spellCheck:false}),e("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:f,type:"button","aria-label":"Microphone",children:e(Aa,{className:"h-4 w-4"})})]})})]})};T();var Sx=["var(--orb-primary)","var(--orb-primary)","var(--orb-primary)"],wx=`
200
203
  .orbcafe-ai-browser-glow {
201
204
  position: fixed;
202
205
  inset: 0;
@@ -228,4 +231,4 @@ ${o}: ${(a??n)(g.secondaryValue??0)}`:""]})}),e("text",{x:g.x,y:Math.max(g.y-12,
228
231
  0%, 100% { opacity: 0.5; }
229
232
  50% { opacity: 1; }
230
233
  }
231
- `,HF=({active:t=false,colors:r=Xv,zIndex:o=2147483e3})=>{let n={"--orbcafe-ai-glow-line":r[0],"--orbcafe-ai-glow-z-index":o};return l(jsxRuntime.Fragment,{children:[e("style",{children:Yv}),e("div",{className:"orbcafe-ai-browser-glow","data-active":t?"true":"false",style:n,"aria-hidden":"true"})]})};var _F=({defaultMode:t="login",onLogin:r,onRegister:o,onForgotPassword:n}={})=>{let[a,i]=Qt.useState(t),[s,c]=Qt.useState(false),p=Qt.useCallback(async m=>{c(true);try{await m?.();}finally{c(false);}},[]),u=Qt.useCallback(m=>p(()=>r?.(m)),[r,p]),d=Qt.useCallback(m=>p(()=>o?.(m)),[o,p]),f=Qt.useCallback(m=>p(()=>n?.(m)),[n,p]),b=Qt.useMemo(()=>({mode:a,loading:s,onModeChange:i,onLogin:u,onRegister:d,onForgotPassword:f}),[f,u,d,s,a]);return {mode:a,loading:s,setMode:i,authPageProps:b}};w();var jv={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."},JF=({mode:t,defaultMode:r="login",onModeChange:o,onLogin:n,onRegister:a,onForgotPassword:i,loading:s=false,logo:c,copy:p,sx:u})=>{let d=t!==void 0,[f,b]=Qt.useState(r),m=t??f,v=Qt.useMemo(()=>({...jv,...p}),[p]),[y,g]=Qt.useState({username:"demo@orbcafe.local",password:"orbcafe-demo",remember:true}),[x,h]=Qt.useState({name:"",email:"",password:"",confirmPassword:"",acceptedTerms:false}),[S,T]=Qt.useState({email:""}),[C,L]=Qt.useState(""),A=R=>{d||b(R),L(""),o?.(R);},I=async R=>{R.preventDefault(),await n?.(y),L("Demo login accepted. No real authentication request was sent.");},N=async R=>{R.preventDefault(),await a?.(x),L("Demo registration saved locally for this screen.");},M=async R=>{R.preventDefault(),await i?.(S),L("Demo reset link request created. No email was sent.");},k=m==="login"?v.loginTitle:m==="register"?v.registerTitle:v.forgotTitle,D=m==="login"?v.loginSubtitle:m==="register"?v.registerSubtitle:v.forgotSubtitle;return l("div",{className:"orb-auth-frame orb-root",style:u,children:[l("div",{className:"orb-auth-brand",children:[e("span",{className:"orb-auth-dia",style:{width:230,height:230,right:-70,bottom:-60}}),e("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)"}}),e("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?e("span",{style:{alignSelf:"flex-start",position:"relative"},children:c}):e("span",{className:"orb-logo-slot",children:"Host logo"}),l("div",{className:"orb-auth-claim",children:[e("div",{className:"orb-auth-rule"}),e("h2",{children:v.headline}),e("p",{children:v.subheadline})]}),e("div",{className:"orb-auth-meta",children:v.brandMeta})]}),e("div",{className:"orb-auth-form",children:l("div",{className:"orb-auth-card",children:[e("span",{className:"orb-overline",style:{letterSpacing:"0.12em"},children:v.productName}),e("h1",{className:"orb-h2",style:{margin:0},children:k}),e("p",{className:"orb-body-dense",style:{color:"var(--orb-muted)",margin:"-10px 0 0"},children:D}),C&&e(Ko,{severity:"success",children:C}),m==="login"&&l("form",{onSubmit:I,style:{display:"flex",flexDirection:"column",gap:16},children:[e(Be,{label:"Email",type:"email",autoComplete:"username",value:y.username,onChange:R=>g(F=>({...F,username:R.target.value})),startAdornment:e(ss,{size:15,strokeWidth:1.8})}),e(Be,{label:"Password",type:"password",autoComplete:"current-password",value:y.password,onChange:R=>g(F=>({...F,password:R.target.value})),startAdornment:e(ua,{size:15,strokeWidth:1.8})}),l("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},children:[e(Dt,{label:"Remember me",checked:y.remember,onChange:R=>g(F=>({...F,remember:R.target.checked}))}),e("button",{type:"button",className:"orb-link",onClick:()=>A("forgot"),children:"Forgot password?"})]}),e(ve,{type:"submit",size:"large",block:true,loading:s,children:s?"Signing in\u2026":"Sign in"}),l("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["New user?"," ",e("button",{type:"button",className:"orb-link",onClick:()=>A("register"),children:"Register"})]})]}),m==="register"&&l("form",{onSubmit:N,style:{display:"flex",flexDirection:"column",gap:16},children:[e(Be,{label:"Full name",value:x.name,onChange:R=>h(F=>({...F,name:R.target.value})),startAdornment:e(ss,{size:15,strokeWidth:1.8})}),e(Be,{label:"Work email",type:"email",autoComplete:"username",value:x.email,onChange:R=>h(F=>({...F,email:R.target.value})),startAdornment:e(as,{size:15,strokeWidth:1.8})}),e(Be,{label:"Password",type:"password",autoComplete:"new-password",value:x.password,onChange:R=>h(F=>({...F,password:R.target.value})),startAdornment:e(ua,{size:15,strokeWidth:1.8})}),e(Be,{label:"Confirm password",type:"password",autoComplete:"new-password",value:x.confirmPassword,onChange:R=>h(F=>({...F,confirmPassword:R.target.value}))}),e(Dt,{label:"I accept the demo workspace terms",checked:x.acceptedTerms,onChange:R=>h(F=>({...F,acceptedTerms:R.target.checked}))}),e(ve,{type:"submit",size:"large",block:true,loading:s,children:"Create demo account"}),l("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["Already have an account?"," ",e("button",{type:"button",className:"orb-link",onClick:()=>A("login"),children:"Sign in"})]})]}),m==="forgot"&&l("form",{onSubmit:M,style:{display:"flex",flexDirection:"column",gap:16},children:[e(Be,{label:"Work email",type:"email",autoComplete:"username",value:S.email,onChange:R=>T({email:R.target.value}),startAdornment:e(as,{size:15,strokeWidth:1.8})}),e(ve,{type:"submit",size:"large",block:true,loading:s,children:"Send reset request"}),l("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["Remember your password?"," ",e("button",{type:"button",className:"orb-link",onClick:()=>A("login"),children:"Back to sign in"})]})]}),l("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:[e("span",{style:{flex:1,height:1,background:"var(--orb-border)"}}),"or",e("span",{style:{flex:1,height:1,background:"var(--orb-border)"}})]}),e(ve,{variant:"neutral",size:"large",block:true,children:"Continue with corporate SSO"}),l("p",{className:"orb-meta",style:{textAlign:"center",fontWeight:300,margin:0},children:["Protected by corporate single sign-on.",e("br",{}),"Demo credentials: demo@orbcafe.local / orbcafe-demo"]})]})})]})};var ey={keyword:{value:"",operator:"contains"},status:{value:"",operator:"equals"},owner:{value:"",operator:"contains"},workCenter:{value:"",operator:"contains"}},ty=[{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"}],Ku=({tasks:t,appId:r,tableKey:o,defaultScale:n="week",defaultSelectedTaskId:a,initialFilters:i,filterFields:s,filterAppId:c,filterTableKey:p,serviceUrl:u,variantService:d,layout:f,columns:b,page:m,rowsPerPage:v,rowsPerPageOptions:y,count:g,onPageChange:x,onRowsPerPageChange:h,onFilterSearch:S,onFilterVariantLoad:T,enableRowReorder:C,onTaskReorder:L,onLayoutIdChange:A,onLayoutSave:I})=>{let N=r??c??"planning-gantt",M=o??p??"planning",[k,D]=Qt.useState(n),[R,F]=Qt.useState(a??t[0]?.id??""),[z,K]=Qt.useState(""),[V,q]=Qt.useState(null),[$,X]=Qt.useState({...ey,...i}),W=Qt.useMemo(()=>{let fe=String($.keyword?.value??"").trim().toLowerCase(),xe=String($.status?.value??"").trim(),Ke=String($.owner?.value??"").trim().toLowerCase(),ze=String($.workCenter?.value??"").trim().toLowerCase(),Re=$.dateRange?.value,Ve=Re?.[0]?Qr__default.default(Re[0]):null,Me=Re?.[1]?Qr__default.default(Re[1]):null;return t.filter(Ce=>{if(fe&&![Ce.id,Ce.code,Ce.title,Ce.project,Ce.workCenter,Ce.owner?.name].join(" ").toLowerCase().includes(fe)||xe&&Ce.status!==xe||Ke&&!String(Ce.owner?.name??"").toLowerCase().includes(Ke)||ze&&!String(Ce.workCenter??"").toLowerCase().includes(ze))return false;if(Ve||Me){let He=Qr__default.default(Ce.startDate),at=Qr__default.default(Ce.endDate),ft=Ve?at.isAfter(Ve)||at.isSame(Ve,"day"):true,et=Me?He.isBefore(Me)||He.isSame(Me,"day"):true;if(!ft||!et)return false}return true})},[$,t]);Qt.useEffect(()=>{W.length!==0&&(W.some(fe=>fe.id===R)||F(W[0].id));},[W,R]);let H=Qt.useCallback(fe=>{F(fe.id);},[]),Q=Qt.useCallback(fe=>{K(fe),A?.(fe);},[A]),J=Qt.useCallback(fe=>{q(xe=>({key:(xe?.key??0)+1,variant:fe})),T?.(fe);},[T]),ge=Qt.useMemo(()=>({appId:N,tableKey:M,fields:s??ty,filters:$,onFilterChange:X,onVariantLoad:J,onSearch:S??(()=>{}),currentLayoutId:z,layoutRefs:[{tableKey:M,layoutId:z||null}],variantService:d,serviceUrl:u}),[z,s,$,J,S,N,M,u,d]),se=Qt.useMemo(()=>({appId:N,tableKey:M,serviceUrl:u,tasks:W,columns:b,scale:k,onScaleChange:D,page:m,rowsPerPage:v,rowsPerPageOptions:y,count:g,onPageChange:x,onRowsPerPageChange:h,selectedTaskId:R,onTaskSelect:H,enableRowReorder:C,onTaskReorder:L,layout:f,layoutVariant:V?.variant,layoutVariantLoadKey:V?.key,onLayoutIdChange:Q,onLayoutSave:I}),[b,g,C,W,Q,f,V?.key,V?.variant,x,h,I,L,H,m,N,M,v,y,k,u,R]);return {scale:k,setScale:D,selectedTaskId:R,setSelectedTaskId:F,filters:$,setFilters:X,filteredTasks:W,smartFilterProps:ge,planningGanttProps:se}};var sO=t=>{let r=Ku(t),o=Qt.useMemo(()=>({filterProps:r.smartFilterProps,ganttProps:r.planningGanttProps}),[r.planningGanttProps,r.smartFilterProps]);return {...r,layoutProps:o}};w();Qr__default.default.extend(oy__default.default);var dl=[{value:"hour",label:"Hour",width:56},{value:"day",label:"Day",width:46},{value:"week",label:"Week",width:78},{value:"month",label:"Month",width:104}],pl=36,ul=58,na=8,ml=260,dy=320,Fo="220ms cubic-bezier(0.2, 0, 0, 1)",qu={"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"}},py=t=>t?qu[t]?.label??t:"Planned",uy=t=>t?qu[t]?.color??"default":"info",Xu=t=>Math.min(100,Math.max(0,t??0)),Yu=(t,r=0)=>t.flatMap(o=>[{...o,level:r},...Yu(o.children??[],r+1)]),my=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:py(t.status),statusTone:t.status??"planned",progress:Xu(t.progress),startDate:t.startDate,endDate:t.endDate,color:t.color,reorderable:t.reorderable!==false}),Zu=(t,r)=>r==="month"?t.startOf("month"):r==="week"?t.startOf("week"):r==="day"?t.startOf("day"):t.startOf("hour"),Qu=(t,r)=>r==="month"?t.endOf("month"):r==="week"?t.endOf("week"):r==="day"?t.endOf("day"):t.endOf("hour"),gy=(t,r,o)=>{let n=[],a=Zu(t,o),i=Qu(r,o);for(;a.isBefore(i)||a.isSame(i);){let s=o==="month"?a.add(1,"month"):o==="week"?a.add(1,"week"):o==="day"?a.add(1,"day"):a.add(1,"hour");n.push({key:`${o}-${a.valueOf()}`,label:o==="month"?a.format("MMM YYYY"):o==="week"?a.format("MMM D"):o==="day"?a.format("D"):a.format("HH:mm"),contextLabel:o==="hour"?a.format("MMM D"):o==="day"?a.format("MMM"):o==="week"?`W${a.isoWeek()}`:void 0,title:o==="hour"?a.format("MMM D, YYYY HH:mm"):o==="day"?a.format("MMM D, YYYY"):o==="week"?`${a.format("MMM D, YYYY")} - Week ${a.isoWeek()}`:void 0,start:a,end:s}),a=s;}return n},gl=(t,r,o)=>{let n=0;for(let a of r){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*o}n+=o;}return n},ju=({appId:t="planning-gantt",tableKey:r="planning",serviceUrl:o,title:n="Project Plan",extraTools:a,bodyHeight:i=560,tasks:s,columns:c,scale:p="week",onScaleChange:u,page:d,rowsPerPage:f=20,rowsPerPageOptions:b=[20,50,100,-1],count:m,onPageChange:v,onRowsPerPageChange:y,timelineStart:g,timelineEnd:x,selectedTaskId:h,onTaskSelect:S,enableRowReorder:T=true,onTaskReorder:C,layout:L,layoutVariant:A,layoutVariantLoadKey:I,onLayoutIdChange:N,onLayoutSave:M,emptyLabel:k="No planning tasks available.",sx:D})=>{let R=ar(),{t:F}=de(),z=Qt.useRef(null),K=Qt.useRef(null),V=Qt.useRef(null),q=Qt.useRef(false),[$,X]=Qt.useState(null),[W,H]=Qt.useState("content"),[Q,J]=Qt.useState(null),[ge,se]=Qt.useState(0),[fe,xe]=Qt.useState({}),[Ke,ze]=Qt.useState(pl),[Re,Ve]=Qt.useState([]),Me=Qt.useRef(void 0),[Ce,He]=Qt.useState({activeId:null,overId:null}),[at,ft]=Qt.useState(null),[et,re]=Qt.useState(false),$e=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:4}})),Ee=Qt.useRef(null),Le=Qt.useMemo(()=>Yu(s),[s]),lt=Qt.useMemo(()=>{if(Re.length===0)return Le;let O=new Map(Le.map(ye=>[ye.id,ye])),Y=Re.map(ye=>O.get(ye)).filter(ye=>!!ye),ue=new Set(Y.map(ye=>ye.id));return [...Y,...Le.filter(ye=>!ue.has(ye.id))]},[Le,Re]),Qe=Qt.useMemo(()=>new Map(lt.map(O=>[O.id,O])),[lt]),vt=Qt.useMemo(()=>lt.map(O=>my(O)),[lt]),St=Qt.useMemo(()=>new Map(vt.map(O=>[O.id,O])),[vt]),Et=Qt.useMemo(()=>[{id:"code",label:"ID",minWidth:90},{id:"title",label:"Task",minWidth:260,render:(O,Y)=>l(ie,{spacing:.2,children:[e(E,{sx:{fontSize:15,fontWeight:700,lineHeight:1.2},children:Y.title}),e(E,{sx:{fontSize:13,color:"text.secondary"},children:Y.titleSub})]})},{id:"owner",label:"Owner",minWidth:170},{id:"status",label:"Status",minWidth:130,render:(O,Y)=>e(Tt,{label:Y.status,color:uy(Y.statusTone),size:"small"})},{id:"progress",label:"Progress",minWidth:140,numeric:true,render:O=>l(ie,{spacing:.6,children:[l(E,{variant:"caption",sx:{color:"text.secondary"},children:[O,"%"]}),e(In,{variant:"determinate",value:O,sx:{height:6,borderRadius:999}})]})},{id:"startDate",label:"Start",minWidth:120},{id:"endDate",label:"End",minWidth:120}],[]),Lt=Qt.useMemo(()=>{if(!c||c.length===0)return Et;let O=new Map(Et.map(Y=>[Y.id,Y]));return c.map(Y=>{let ue=O.get(Y.id),ye=Y.width??ue?.minWidth??120,Je={id:Y.id,label:Y.label,minWidth:ye};if(ue?.numeric&&(Je.numeric=true),Y.render){let qe=Y.render;return Je.render=(It,gt)=>{let ut=Qe.get(gt.id);return qe(ut||gt)},Je}return ue?.render?(Je.render=ue.render,Je):(Je.render=(qe,It)=>{let gt=It[Y.id];if(gt!=null&&String(gt).length>0)return String(gt);let kt=Qe.get(It.id)?.[Y.id];return kt!=null&&String(kt).length>0?String(kt):"-"},Je)})},[c,Et,Qe]),te=an({appId:t,tableKey:r,title:n,columns:Lt,rows:vt,rowKey:"id",page:d,rowsPerPage:f,rowsPerPageOptions:b,count:m??vt.length,onPageChange:v,onRowsPerPageChange:y,showSummary:false,layout:L,onLayoutSave:M}),rt=t?e(nn,{appId:t,tableKey:r,currentLayoutData:te.currentLayoutData,onLayoutLoad:te.handleLayoutLoad,targetLayoutId:te.layoutIdToLoad,activeLayoutId:te.currentLayoutId,serviceUrl:o}):null,Fe=te.visibleRows;Qt.useEffect(()=>{let O=Le.map(Y=>Y.id);Ve(Y=>{let ue=new Set(O),ye=Y.filter(gt=>ue.has(gt)),Je=new Set(ye),qe=O.filter(gt=>!Je.has(gt)),It=[...ye,...qe];return It.length===Y.length&&It.every((gt,ut)=>gt===Y[ut])?Y:It});},[Le]),Qt.useEffect(()=>{I===void 0||!A||Me.current!==I&&(Me.current=I,te.handleVariantLoad(A));},[te,A,I]),Qt.useEffect(()=>{N?.(te.currentLayoutId);},[te.currentLayoutId,N]);let le=O=>O.type==="group"?`group-${O.id}`:`row-${(O.data||O)?.id}`,me=Qt.useMemo(()=>{let O=vt.map(ut=>Qr__default.default(ut.startDate)),Y=vt.map(ut=>Qr__default.default(ut.endDate)),ue=g?Qr__default.default(g):O.reduce((ut,kt)=>kt.isBefore(ut)?kt:ut,O[0]??Qr__default.default()),ye=x?Qr__default.default(x):Y.reduce((ut,kt)=>kt.isAfter(ut)?kt:ut,Y[0]??Qr__default.default().add(30,"day")),Je=p==="month"?"month":p==="week"?"week":p==="day"?"day":"hour",qe=p==="month"?"month":p==="week"?"week":p==="day"?"day":"hour",It=p==="hour"?12:1,gt=p==="hour"?12:1;return {start:Zu(ue.subtract(It,Je),p),end:Qu(ye.add(gt,qe),p)}},[vt,p,x,g]),j=dl.find(O=>O.value===p)??dl[1],ke=Array.isArray(a)?a:a?[a]:[],Te=Qt.useMemo(()=>gy(me.start,me.end,p),[me.end,me.start,p]),Ye=Te.length*j.width,pt=Te.length>0?100/Te.length:100,ct=Te.length>0?`repeat(${Te.length}, minmax(${j.width}px, 1fr))`:"1fr",Ft=Te.length>0?`calc(100% / ${Te.length}) 100%`:"100% 100%",_t=(te.columns||[]).filter(O=>te.visibleColumns.includes(O.id)).reduce((O,Y)=>O+(te.columnWidths?.[Y.id]||Y.minWidth||100),0)+(te.grouping.length>0?72:0),yt=W==="manual"&&$!==null?$:_t,bt=Q==="table",yr=Q==="timeline",Pt=Q==="timeline",Ot=Q==="table",dt=!Pt&&!Ot,Bt=()=>{let O=ge||z.current?.clientWidth||0;return O>0?Math.max(ml,O-na-dy):Math.max(ml,_t)},Se=O=>Math.min(Math.max(O,ml),Bt()),U=(()=>{if(ge<=0)return null;let O=dt?na:0;if(bt)return {tableWidth:ge,splitterWidth:O,timelineWidth:0};if(yr)return {tableWidth:0,splitterWidth:O,timelineWidth:ge};if(W==="even"){let ue=Math.max(0,(ge-O)/2);return {tableWidth:ue,splitterWidth:O,timelineWidth:Math.max(0,ge-O-ue)}}let Y=Se(yt);return {tableWidth:Y,splitterWidth:O,timelineWidth:Math.max(0,ge-O-Y)}})(),ee=U?`${U.tableWidth}px ${U.splitterWidth}px ${U.timelineWidth}px`:bt?"minmax(0, 1fr) 0px 0px":yr?"0px 0px minmax(0, 1fr)":W==="even"?`minmax(0, 1fr) ${na}px minmax(0, 1fr)`:`${yt}px ${na}px minmax(0, 1fr)`;Qt.useEffect(()=>{W==="manual"&&X(O=>O===null?null:Se(O));},[W,_t,ge]);let Ie=O=>{O.preventDefault(),O.currentTarget.setPointerCapture(O.pointerId),J(null),H("manual"),Ee.current={startX:O.clientX,startWidth:K.current?.getBoundingClientRect().width??yt};let Y=ye=>{let Je=Ee.current;if(!Je)return;let qe=Se(Je.startWidth+ye.clientX-Je.startX);X(qe);},ue=()=>{Ee.current=null,window.removeEventListener("pointermove",Y),window.removeEventListener("pointerup",ue),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",Y),window.addEventListener("pointerup",ue);},be=()=>{J(null),H("even"),X(null);},De=O=>!T||!O?false:St.get(O)?.reorderable!==false,_e=(O,Y)=>{if(!O||!Y||O===Y||!De(O)||!De(Y))return false;if(te.grouping.length===0)return true;let ue=St.get(O),ye=St.get(Y);return !ue||!ye?false:te.grouping.every(Je=>ue[Je]===ye[Je])},je=(O,Y)=>{if(!_e(O,Y))return;let ue=Fe.filter(zt=>zt.type!=="group").map(zt=>String((zt.data||zt)?.id)),ye=ue.indexOf(O),Je=ue.indexOf(Y);if(ye<0||Je<0)return;let qe=[...ue];[qe[ye],qe[Je]]=[qe[Je],qe[ye]];let It=new Set(ue),gt=lt.map(zt=>zt.id),ut=[...qe,...gt.filter(zt=>!It.has(zt))],kt=Qe.get(O),tr=Qe.get(Y);if(te.setOrder("asc"),te.setOrderBy(""),Ve(ut),kt&&tr){let{level:zt,...Xt}=kt,{level:Ht,...Ut}=tr,Wt=ut.reduce((Jt,rr)=>{let ur=Qe.get(rr);if(ur){let{level:Tr,...Pr}=ur;Jt.push(Pr);}return Jt},[]);C?.(Wt,{activeTask:Xt,targetTask:Ut});}},Ue=(O,Y)=>{if(!De(Y.id)){O.preventDefault();return}O.stopPropagation(),O.dataTransfer.effectAllowed="move",O.dataTransfer.setData("text/plain",Y.id),He({activeId:Y.id,overId:null}),S?.(Qe.get(Y.id)||Y);},xt=(O,Y)=>{if(!_e(Ce.activeId,Y)){He(ue=>ue.overId===null?ue:{...ue,overId:null});return}O.preventDefault(),O.stopPropagation(),O.dataTransfer.dropEffect="move",He(ue=>ue.overId===Y?ue:{...ue,overId:Y});},At=(O,Y)=>{let ue=Ce.activeId||O.dataTransfer.getData("text/plain");if(!_e(ue,Y)){He({activeId:null,overId:null});return}O.preventDefault(),O.stopPropagation(),je(ue,Y),He({activeId:null,overId:null});},wt=()=>{He({activeId:null,overId:null});},Ct=O=>{if(q.current)return;let Y=O==="table"?K.current:V.current,ue=O==="table"?V.current:K.current;!Y||!ue||(q.current=true,ue.scrollTop=Y.scrollTop,window.requestAnimationFrame(()=>{q.current=false;}));};return Qt.useLayoutEffect(()=>{let O=z.current;if(!O){se(0);return}let Y=0,ue=()=>{window.cancelAnimationFrame(Y),Y=window.requestAnimationFrame(()=>{let Je=O.clientWidth;se(qe=>Math.abs(qe-Je)<.5?qe:Je);});};if(ue(),typeof ResizeObserver>"u")return window.addEventListener("resize",ue),()=>{window.cancelAnimationFrame(Y),window.removeEventListener("resize",ue);};let ye=new ResizeObserver(ue);return ye.observe(O),window.addEventListener("resize",ue),()=>{window.cancelAnimationFrame(Y),ye.disconnect(),window.removeEventListener("resize",ue);}},[vt.length]),Qt.useLayoutEffect(()=>{if(!h||Ot)return;let O=V.current,Y=K.current;if(!O)return;let ue=`row-${h}`,ye=Array.from(O.querySelectorAll("[data-planning-timeline-row-key]")).find(It=>It.dataset.planningTimelineRowKey===ue),Je=St.get(h);if(!ye||!Je)return;let qe=window.requestAnimationFrame(()=>{let It=O.getBoundingClientRect(),gt=ye.getBoundingClientRect(),ut=Math.max(1,O.clientHeight-Ke),kt=O.scrollTop+gt.top-It.top-Ke-(ut-gt.height)/2;q.current=true,O.scrollTop=Math.max(0,kt),Y&&!Pt&&(Y.scrollTop=O.scrollTop);let tr=Math.max(1,O.scrollWidth),zt=Te.length>0?tr/Te.length:j.width,Xt=gl(Qr__default.default(Je.startDate),Te,zt),Ht=Math.max(0,Xt-zt);O.scrollLeft=Math.min(Ht,Math.max(0,tr-O.clientWidth)),window.requestAnimationFrame(()=>{q.current=false;});});return ()=>window.cancelAnimationFrame(qe)},[j.width,Ke,h,Pt,St,Ot,Fe,Te]),Qt.useLayoutEffect(()=>{let O=K.current;if(!O)return;let Y=0,ue=0,ye=false,Je=()=>{if(ye)return;let Ht=O.querySelector("thead"),Ut=Array.from(O.querySelectorAll("tbody tr[data-ctable-row-key]"));if(Ut.length===0)return;let Wt=Ht?.getBoundingClientRect().height||pl,Jt={};Ut.forEach(rr=>{let ur=rr.dataset.ctableRowKey;ur&&(Jt[ur]=rr.getBoundingClientRect().height);}),ze(rr=>Math.abs(rr-Wt)<.01?rr:Wt),xe(rr=>{let ur=Object.keys(rr),Tr=Object.keys(Jt);return ur.length===Tr.length&&Tr.every(Pr=>Math.abs((rr[Pr]??0)-Jt[Pr])<.01)?rr:Jt});},qe=()=>{window.cancelAnimationFrame(Y),Y=window.requestAnimationFrame(Je);};if(Je(),window.cancelAnimationFrame(ue),ue=window.requestAnimationFrame(()=>{ue=window.requestAnimationFrame(Je);}),typeof document<"u"&&document.fonts?.ready&&document.fonts.ready.then(()=>{ye||qe();}).catch(()=>{}),typeof ResizeObserver>"u")return window.addEventListener("resize",qe),()=>{ye=true,window.cancelAnimationFrame(Y),window.cancelAnimationFrame(ue),window.removeEventListener("resize",qe);};let It=new ResizeObserver(qe),gt=O.querySelector("table"),ut=O.querySelector("tbody"),kt=O.querySelector("thead");gt&&It.observe(gt),kt&&It.observe(kt);let tr=new WeakSet,zt=()=>{O.querySelectorAll("tbody tr[data-ctable-row-key]").forEach(Ht=>{tr.has(Ht)||(It.observe(Ht),tr.add(Ht));});};zt();let Xt=null;return ut&&typeof MutationObserver<"u"&&(Xt=new MutationObserver(()=>{zt(),qe();}),Xt.observe(ut,{childList:true,subtree:true,characterData:true})),window.addEventListener("resize",qe),()=>{ye=true,window.cancelAnimationFrame(Y),window.cancelAnimationFrame(ue),It.disconnect(),Xt?.disconnect(),window.removeEventListener("resize",qe);}},[Fe,te.visibleColumns,te.grouping,te.columnWidths]),l(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 ${R.palette.divider}`,...D},children:[e("div",{className:"orb-table-toolbar orb-planning-table-toolbar",role:"toolbar","aria-label":F("table.title.default"),children:l("div",{className:"orb-table-toolbar-primary",children:[e(Ya,{value:te.filterText,onChange:O=>{te.setFilterText(O),te.setPage(0);}}),e(Xa,{rowsPerPage:te.rowsPerPage,rowsPerPageOptions:b,page:te.page,count:te.totalDisplayCount,onRowsPerPageChange:te.setRowsPerPage,onPageChange:te.setPage}),ke.length>0&&e("div",{className:"orb-table-toolbar-custom",children:ke.map((O,Y)=>e("div",{className:"orb-planning-extra-tool",children:O},`planning-extra-tool-${Y}`))}),e("span",{className:"orb-table-toolbar-spacer"}),l("div",{className:"orb-table-toolbar-actions",children:[l("div",{className:"orb-table-tool-group",children:[e(ae,{className:"orb-table-tool-button",tooltip:"Column visibility",onClick:O=>te.setAnchorEl(O.currentTarget),sx:lr,children:e(Zo,{fontSize:"small"})}),e(ae,{className:"orb-table-tool-button",tooltip:"Group by",onClick:O=>te.setGroupAnchorEl(O.currentTarget),sx:lr,children:e(uo,{fontSize:"small"})}),e(ae,{className:`orb-table-tool-button ${te.sortBy.length>0||te.orderBy?"orb-is-active":""}`,tooltip:"Sort by...",active:te.sortBy.length>0||!!te.orderBy,onClick:()=>re(true),sx:lr,children:e(ud,{fontSize:"small"})})]}),rt&&e("div",{className:"orb-table-tool-group",children:rt}),e("div",{className:"orb-table-tool-group orb-planning-pane-controls",children:e(Rn,{"aria-label":"Planning pane layout",size:"small",value:Q??(W==="even"?"split":null),options:[{value:"table",label:"Expand task table",icon:e($a,{fontSize:"small"})},{value:"split",label:"Split evenly",icon:e(_a,{fontSize:"small"})},{value:"timeline",label:"Expand timeline",icon:e(Wa,{fontSize:"small"})}],onValueChange:O=>{O==="split"?be():J(O);}})}),e("div",{className:"orb-table-tool-group orb-planning-scale-control",children:e(Kt,{label:"",value:p,options:dl.map(O=>({value:O.value,label:O.label})),onChange:O=>u?.(O.target.value)})})]})]})}),vt.length===0?e("div",{sx:{minHeight:240,display:"grid",placeItems:"center",color:"text.secondary"},children:k}):e("div",{sx:{overflow:"hidden",flex:1,minHeight:0},children:l("div",{ref:z,sx:{height:"100%",display:"grid",gridTemplateColumns:ee,minWidth:0,transition:`grid-template-columns ${Fo}`},children:[e("div",{"data-planning-scroll-pane":"table",ref:K,onScroll:()=>Ct("table"),sx:{width:"100%",minWidth:0,maxWidth:"100%",height:i,overflowX:"auto",overflowY:"auto",opacity:Pt?0:1,transform:Pt?"translateX(-10px)":"translateX(0)",pointerEvents:Pt?"none":"auto",transition:`opacity ${Fo}, transform ${Fo}`},children:e(core.DndContext,{sensors:$e,collisionDetection:core.closestCenter,modifiers:[modifiers.restrictToHorizontalAxis],onDragEnd:O=>{let Y=O?.active?.id,ue=O?.over?.id;typeof Y=="string"&&typeof ue=="string"&&te.handleColumnReorder(Y,ue);},children:l("table",{className:"orb-tbl orb-ctable orb-planning-table",sx:{tableLayout:"fixed",width:_t,"& thead th":{height:pl,py:0,lineHeight:1.15,boxSizing:"border-box"}},children:[e(ja,{columns:te.columns,visibleColumns:te.visibleColumns,order:te.order,orderBy:te.orderBy,sortBy:te.sortBy,onRequestSort:te.handleRequestSort,onContextMenu:(O,Y)=>{O.preventDefault(),O.stopPropagation(),ft({mouseX:O.clientX+2,mouseY:O.clientY-6,columnId:Y});},grouping:te.grouping,isAllExpanded:te.isAllExpanded,handleToggleAll:te.handleToggleAll,columnWidths:te.columnWidths,onColumnResize:te.handleColumnResize,enableColumnReorder:true}),e(Ja,{visibleRows:Fe,columns:te.columns,visibleColumns:te.visibleColumns,selected:h?[h]:[],expandedGroups:te.expandedGroups,toggleGroupExpand:te.toggleGroupExpand,handleExpandGroupRecursively:te.handleExpandGroupRecursively,handleCollapseGroupRecursively:te.handleCollapseGroupRecursively,isGroupFullyExpanded:te.isGroupFullyExpanded,grouping:te.grouping,rowKeyProp:"id",page:te.page,rowsPerPage:te.rowsPerPage,emptyLabel:k,handleClick:(O,Y)=>{S?.(Qe.get(Y.id)||Y);},getRowDataKey:({entry:O})=>le(O),getGroupRowProps:()=>({style:{height:ul}}),getRowProps:({data:O})=>{let Y=O,ue=De(Y.id),ye=Ce.activeId===Y.id,Je=Ce.overId===Y.id&&_e(Ce.activeId,Y.id);return {draggable:ue,className:Je?"orb-is-drop-target":void 0,style:{cursor:ye?"grabbing":ue?"grab":S?"pointer":"default",height:ul,opacity:ye?.56:1,transition:"background-color 120ms ease, opacity 120ms ease"},onDragStart:qe=>Ue(qe,Y),onDragOver:qe=>xt(qe,Y.id),onDragEnter:qe=>xt(qe,Y.id),onDrop:qe=>At(qe,Y.id),onDragEnd:wt}}})]})})}),e("div",{onPointerDown:dt?Ie:void 0,role:"separator","aria-orientation":"vertical",sx:{width:dt?na:0,cursor:dt?"col-resize":"default",opacity:dt?1:0,pointerEvents:dt?"auto":"none",borderLeft:dt?`1px solid ${R.palette.divider}`:"0 solid transparent",borderRight:dt?`1px solid ${R.palette.divider}`:"0 solid transparent",backgroundColor:ht()==="dark"?"color-mix(in oklch, var(--orb-muted) 10%, transparent)":"color-mix(in oklch, var(--orb-fg) 4%, transparent)",transition:`width ${Fo}, opacity ${Fo}, background-color 120ms ease`,position:"relative","&:hover":{backgroundColor:R.palette.action.selected},"&::before":{content:'""',position:"absolute",top:0,bottom:0,left:-6,right:-6,cursor:dt?"col-resize":"default"}}}),e("div",{sx:{minWidth:0,overflow:"hidden",opacity:Ot?0:1,transform:Ot?"translateX(10px)":"translateX(0)",pointerEvents:Ot?"none":"auto",transition:`opacity ${Fo}, transform ${Fo}`},children:e("div",{"data-planning-scroll-pane":"timeline",ref:V,onScroll:()=>Ct("timeline"),sx:{width:"100%",height:i,overflowX:"auto",overflowY:"auto"},children:l("div",{sx:{width:"100%",minWidth:Ye||"100%"},children:[e("div",{className:"orb-planning-timeline-header",sx:{display:"grid",gridTemplateColumns:ct,height:Ke,boxSizing:"border-box",borderBottom:`1px solid ${R.palette.divider}`,position:"sticky",top:0,zIndex:2},children:Te.map(O=>l("div",{title:O.title,sx:{px:.75,display:"flex",flexDirection:O.contextLabel?"column":"row",alignItems:"center",justifyContent:"center",gap:O.contextLabel?.15:0,borderRight:`1px solid ${R.palette.divider}`,color:O.contextLabel?"text.primary":"text.secondary",overflow:"hidden"},children:[O.contextLabel&&e(E,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"text.secondary",fontSize:11,fontWeight:700,lineHeight:1.1},children:O.contextLabel}),e(E,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:12,fontWeight:700,lineHeight:1.15},children:O.label})]},O.key))}),e(ie,{sx:{position:"relative"},children:Fe.map(O=>{let Y=le(O),ue=fe[Y]??ul;if(O.type==="group")return e("div",{className:"orb-planning-timeline-row orb-table-group-row","data-planning-timeline-row-key":Y,sx:{position:"relative",height:ue,boxSizing:"border-box",borderBottom:`1px solid ${R.palette.divider}`}},O.id);let ye=O.data||O,Je=Qr__default.default(ye.startDate),qe=Qr__default.default(ye.endDate),It=gl(Je,Te,pt),gt=gl(qe,Te,pt),ut=Math.max(0,gt-It),kt=Xu(ye.progress),tr=ye.id===h,zt=De(ye.id),Xt=Ce.activeId===ye.id,Ht=Ce.overId===ye.id&&_e(Ce.activeId,ye.id),Ut=ye.color??(ye.statusTone==="blocked"?R.palette.error.main:R.palette.primary.main);return e("div",{className:`orb-planning-timeline-row ${tr?"orb-is-selected":""}`,"data-planning-timeline-row-key":Y,draggable:zt,onDragStart:Wt=>Ue(Wt,ye),onDragOver:Wt=>xt(Wt,ye.id),onDragEnter:Wt=>xt(Wt,ye.id),onDrop:Wt=>At(Wt,ye.id),onDragEnd:wt,onClick:()=>S?.(Qe.get(ye.id)||ye),sx:{position:"relative",height:ue,boxSizing:"border-box",borderBottom:`1px solid ${R.palette.divider}`,opacity:Xt?.56:1,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,height:2,backgroundColor:R.palette.primary.main,opacity:Ht?1:0,transition:"opacity 120ms ease",pointerEvents:"none",zIndex:3},backgroundImage:ht()==="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:Ft,cursor:Xt?"grabbing":zt?"grab":S?"pointer":"default",transition:"opacity 120ms ease"},children:e(it,{title:`${ye.title}: ${Je.format("MMM D HH:mm")} - ${qe.format("MMM D HH:mm")}`,children:l("div",{sx:{position:"absolute",left:`${It}%`,top:Math.max(8,(ue-24)/2),width:`max(18px, ${ut}%)`,height:24,borderRadius:999,overflow:"hidden",backgroundColor:ht()==="dark"?"color-mix(in oklch, var(--orb-muted) 18%, transparent)":"color-mix(in oklch, var(--orb-fg) 10%, transparent)",outline:tr?`2px solid ${R.palette.warning.main}`:"none",outlineOffset:2},children:[e("div",{sx:{height:"100%",width:`${kt}%`,backgroundColor:Ut}}),e(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:ye.code})]})})},ye.id)})})]})})})]})}),e(Jo,{groupAnchorEl:te.groupAnchorEl,setGroupAnchorEl:te.setGroupAnchorEl,grouping:te.grouping,setGrouping:te.setGrouping,columns:te.columns}),e(en,{anchorEl:te.anchorEl,setAnchorEl:te.setAnchorEl,columns:te.columns,visibleColumns:te.visibleColumns,toggleColumnVisibility:te.toggleColumnVisibility}),e(Dd,{contextMenu:at,handleClose:()=>ft(null),columns:te.columns,visibleColumns:te.visibleColumns,grouping:te.grouping,summaryColumns:te.summaryColumns,showSummary:te.showSummary,sortBy:te.sortBy,orderBy:te.orderBy,order:te.order,onSortAsc:O=>{te.applyMultiSort([{field:O,direction:"asc"}]);},onSortDesc:O=>{te.applyMultiSort([{field:O,direction:"desc"}]);},onClearSort:O=>{let Y=te.sortBy.filter(ue=>ue.field!==O);Y.length>0?te.applyMultiSort(Y):(te.clearMultiSort(),te.orderBy===O&&te.setOrderBy(""));},onHideColumn:O=>{te.visibleColumns.includes(O)&&te.toggleColumnVisibility(O);},onToggleGroup:O=>te.toggleGroupField(O),onToggleSummary:O=>te.toggleSummaryColumn(O),onOpenSortDialog:()=>re(true)}),e(Ad,{open:et,onClose:()=>re(false),columns:te.columns,initialRules:te.sortBy.length>0?te.sortBy:te.orderBy?[{field:te.orderBy,direction:te.order}]:[],onApply:O=>te.applyMultiSort(O),onClear:()=>{te.clearMultiSort(),te.setOrderBy("");}})]})};w();var HO=({filterProps:t,ganttProps:r,spacing:o=2,sx:n,children:a})=>{let i=n?[{height:"100%",overflow:"hidden"},n]:{height:"100%",overflow:"hidden"},s=r.sx?[{height:"100%"},r.sx]:{height:"100%"};return l(ie,{spacing:o,sx:i,children:[e("div",{sx:{flexShrink:0},children:e(zr,{...t})}),e("div",{sx:{flex:1,minHeight:0,overflow:"hidden"},children:e(ju,{...r,bodyHeight:r.bodyHeight??"100%",sx:s})}),a]})};w();var Ju=640,fy=360,by=360,Ji=8,yn="220ms cubic-bezier(0.2, 0, 0, 1)",hl=(t,r,o=0,n=[])=>t.flatMap(a=>{let i=a.children??[],s=[{node:a,level:o,hasChildren:i.length>0,parentIds:n}];return r.has(a.id)?[...s,...hl(i,r,o+1,[...n,a.id])]:s}),tm=t=>t.flatMap(r=>[r,...tm(r.children??[])]),rm=(t,r=0,o=[])=>t.flatMap(n=>{let a=n.children??[];return [{node:n,level:r,hasChildren:a.length>0,parentIds:o},...rm(a,r+1,[...o,n.id])]}),om=t=>t.flatMap(r=>{let o=r.children??[];return o.length===0?[]:[r.id,...om(o)]}),em=t=>Object.entries(t).filter(([r])=>r!=="children").map(([,r])=>r==null?"":typeof r=="string"||typeof r=="number"||typeof r=="boolean"?String(r):"").join(" ").toLowerCase(),QO=({title:t,subtitle:r,nodes:o,columns:n,detail:a,selectedNodeId:i,defaultSelectedNodeId:s,onNodeSelect:c,expandedNodeIds:p,defaultExpandedNodeIds:u,onExpandedNodeIdsChange:d,defaultPaneMode:f="split",minTreePaneWidth:b=fy,minDetailPaneWidth:m=by,tableAppId:v="ctree-comp",tableKey:y="default",tableTitle:g,filterConfig:x,searchQuery:h,searchToken:S,defaultRowsPerPage:T=-1,rowsPerPageOptions:C=[20,50,100,-1],serviceUrl:L,emptyLabel:A="No tree items available.",headerAction:I,sx:N,className:M})=>{let k=ar(),D=Qt.useRef(null),R=Qt.useRef(null),F=Qt.useRef(null),[z,K]=Qt.useState(s??o[0]?.id??null),[V,q]=Qt.useState(u??om(o).slice(0,3)),[$,X]=Qt.useState(f),[W,H]=Qt.useState(Ju),[Q,J]=Qt.useState(0),[ge,se]=Qt.useState(0),[fe,xe]=Qt.useState(T),Ke=Qt.useMemo(()=>n&&n.length>0?n:[{id:"label",label:"Name",render:le=>l(ie,{spacing:.3,children:[e(E,{sx:{fontSize:15,fontWeight:700,lineHeight:1.15},children:le.label}),le.subtitle&&e(E,{sx:{fontSize:13,color:"text.secondary",lineHeight:1.2},children:le.subtitle})]})}],[n]),ze=Qt.useMemo(()=>new Set(p??V),[p,V]),Re=Qt.useMemo(()=>hl(o,ze),[o,ze]),Ve=Qt.useMemo(()=>tm(o),[o]),Me=Qt.useMemo(()=>rm(o),[o]),Ce=i===void 0?z:i,He=Qt.useMemo(()=>Ve.find(le=>le.id===Ce)??null,[Ce,Ve]),at=le=>{let me=R.current?.clientWidth??0,j=me>0?Math.max(b,me-Ji-m):Math.max(b,le);return Math.min(Math.max(le,b),j)},ft=$==="detail",et=$==="tree"||!a,re=$==="split"&&!!a,Ee=(()=>{if(Q<=0)return null;if($==="tree"||!a)return {treeWidth:Q,splitterWidth:0,detailWidth:0};if($==="detail")return {treeWidth:0,splitterWidth:0,detailWidth:Q};let le=re?Ji:0,me=at(W);return {treeWidth:me,splitterWidth:le,detailWidth:Math.max(0,Q-le-me)}})(),Le=Ee?`${Ee.treeWidth}px ${Ee.splitterWidth}px ${Ee.detailWidth}px`:$==="tree"||!a?"minmax(0, 1fr) 0px 0px":$==="detail"?"0px 0px minmax(0, 1fr)":`minmax(${b}px, ${W}px) ${Ji}px minmax(${m}px, 1fr)`;Qt.useEffect(()=>{let le=R.current;if(!le){J(0);return}let me=0,j=()=>{window.cancelAnimationFrame(me),me=window.requestAnimationFrame(()=>{let Te=le.clientWidth;J(Ye=>Math.abs(Ye-Te)<.5?Ye:Te);});};if(j(),typeof ResizeObserver>"u")return window.addEventListener("resize",j),()=>{window.cancelAnimationFrame(me),window.removeEventListener("resize",j);};let ke=new ResizeObserver(j);return ke.observe(le),window.addEventListener("resize",j),()=>{window.cancelAnimationFrame(me),ke.disconnect(),window.removeEventListener("resize",j);}},[]);let lt=le=>{p===void 0&&q(le),d?.(le);},Qe=le=>{let me=new Set(ze);me.has(le)?me.delete(le):me.add(le),lt(Array.from(me));},vt=le=>{i===void 0&&K(le.id),c?.(le);};Qt.useEffect(()=>{se(0);},[o]),Qt.useEffect(()=>{let le=h?.trim().toLowerCase();if(!le)return;let me=Me.find(({node:ct})=>em(ct).includes(le));if(!me)return;let j=new Set(ze);me.parentIds.forEach(ct=>j.add(ct)),lt(Array.from(j)),vt(me.node);let Te=hl(o,j).findIndex(({node:ct})=>ct.id===me.node.id);Te>=0&&fe>0&&se(Math.floor(Te/fe));let Ye=0,pt=0;return Ye=window.requestAnimationFrame(()=>{pt=window.requestAnimationFrame(()=>{let ct=D.current?.querySelector("tr.orb-selected"),Ft=ct?.closest(".orb-table-container");if(ct&&Ft){let _t=Ft.getBoundingClientRect(),yt=ct.getBoundingClientRect(),bt=yt.top-_t.top+Ft.scrollTop;Ft.scrollTo({top:bt-Ft.clientHeight/2+yt.height/2,behavior:"smooth"});return}ct?.scrollIntoView({block:"center",behavior:"smooth"});});}),()=>{window.cancelAnimationFrame(Ye),window.cancelAnimationFrame(pt);}},[h,S,Me,o,fe]);let St=Qt.useMemo(()=>Re.map(({node:le,level:me,hasChildren:j})=>({...le,id:le.id,__node:le,__level:me,__hasChildren:j,__expanded:ze.has(le.id),__searchText:em(le)})),[ze,Re]),Et=Qt.useMemo(()=>Ke.map((le,me)=>({id:le.id,label:le.label,minWidth:typeof le.width=="number"?le.width:le.minWidth??(me===0?320:120),numeric:le.numeric??le.align==="right",render:(j,ke)=>{let Te=ke.__node,Ye=le.render?le.render(Te):Te[le.id];if(me!==0)return e(we,{sx:{minWidth:0,color:le.align==="right"?"text.primary":"text.secondary",fontWeight:le.align==="right"?750:500,textAlign:le.align??"left"},children:Ye});let pt=Number(ke.__level??0),ct=!!ke.__hasChildren,Ft=!!ke.__expanded;return l(ie,{direction:"row",alignItems:"center",spacing:1,sx:{minWidth:0,pl:`${pt*24}px`},children:[e(ae,{tooltip:ct?Ft?"Collapse":"Expand":"",onClick:_t=>{_t.stopPropagation(),ct&&Qe(Te.id);},disabled:!ct,sx:{width:24,height:24,visibility:ct?"visible":"hidden",transform:Ft?"rotate(0deg)":"rotate(-90deg)",transition:"transform 160ms ease"},children:e(Br,{sx:{fontSize:20}})}),e(we,{sx:{width:10,height:10,borderRadius:"50%",flexShrink:0,backgroundColor:Te.markerColor??k.palette.primary.main}}),e(we,{sx:{minWidth:0},children:Ye})]})}})),[Ke,ze,k.palette.primary.main]),Lt=le=>{if(!re)return;le.preventDefault(),le.currentTarget.setPointerCapture(le.pointerId),F.current={startX:le.clientX,startWidth:W};let me=ke=>{let Te=F.current;Te&&H(at(Te.startWidth+ke.clientX-Te.startX));},j=()=>{F.current=null,window.removeEventListener("pointermove",me),window.removeEventListener("pointerup",j),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",me),window.addEventListener("pointerup",j);},te=()=>{let le=R.current?.clientWidth??0,me=le>0?Math.max(b,(le-Ji)/2):Ju;X("split"),H(at(me));},rt=()=>a?typeof a=="function"?a(He):a:null,Fe=a?e(Rn,{"aria-label":"Tree pane layout",value:$,options:[{value:"tree",label:"Expand tree",icon:e($a,{fontSize:"small"})},{value:"split",label:"Split evenly",icon:e(_a,{fontSize:"small"})},{value:"detail",label:"Expand detail",icon:e(Wa,{fontSize:"small"})}],onValueChange:le=>{le==="split"?te():X(le);},sx:{position:"absolute",top:13,right:56,zIndex:3,backdropFilter:"blur(10px)"}}):null;return l(we,{ref:D,className:["ctree_comp",M].filter(Boolean).join(" "),sx:{position:"relative",height:"100%",minHeight:0,border:`1px solid ${k.palette.divider}`,borderRadius:"var(--orb-r-container)",overflow:"hidden",backgroundColor:"background.paper",boxShadow:`0 18px 42px ${tt(k.palette.common.black,ht()==="dark"?.24:.08)}`,...N},children:[Fe,l(we,{ref:R,sx:{height:"100%",display:"grid",gridTemplateColumns:Le,transition:`grid-template-columns ${yn}`,minWidth:0},children:[l(we,{"aria-hidden":ft?true:void 0,sx:{minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column",opacity:ft?0:1,transform:ft?"translateX(-12px)":"translateX(0)",pointerEvents:ft?"none":"auto",transition:`opacity ${yn}, transform ${yn}`,willChange:"opacity, transform"},children:[l(ie,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:2,sx:{px:2,py:1.5,minHeight:74,borderBottom:`1px solid ${k.palette.divider}`},children:[l(ie,{direction:"row",alignItems:"center",spacing:1.4,sx:{minWidth:0},children:[e(uo,{sx:{color:"primary.main",fontSize:28}}),l(we,{sx:{minWidth:0},children:[e(E,{sx:{fontSize:20,fontWeight:750,lineHeight:1.12},noWrap:true,children:t}),r&&e(E,{sx:{fontSize:14,color:"text.secondary",mt:.3},noWrap:true,children:r})]})]}),I!==void 0?I:e(ae,{tooltip:"Add node",color:"default",children:e(Mo,{fontSize:"small"})})]}),l(we,{sx:{flex:1,minHeight:0,overflow:"hidden"},children:[e(Xr,{appId:v,tableKey:y,title:g??(typeof t=="string"?t:"Tree"),columns:Et,rows:St,rowKey:"id",fitContainer:true,fullWidth:true,showSummary:false,selectionMode:"single",selected:Ce?[Ce]:[],onSelectionChange:le=>{let me=le[le.length-1],j=Ve.find(ke=>ke.id===me);j&&vt(j);},page:ge,rowsPerPage:fe,rowsPerPageOptions:C,count:St.length,onPageChange:se,onRowsPerPageChange:le=>{se(0),xe(le);},filterConfig:x,serviceUrl:L,graphReport:{enabled:false},disableGrouping:true,disableSorting:true,maxHeight:"100%"}),St.length===0&&e(we,{sx:{minHeight:220,display:"grid",placeItems:"center",color:"text.secondary"},children:A})]})]}),e(we,{"data-ctree-splitter":"true",role:"separator","aria-orientation":"vertical",onPointerDown:re?Lt:void 0,sx:{width:"100%",cursor:re?"col-resize":"default",backgroundColor:re?tt(k.palette.text.primary,ht()==="dark"?.16:.08):"transparent",opacity:re?1:0,pointerEvents:re?"auto":"none",position:"relative",transition:`opacity ${yn}, background-color 120ms ease`,"&:hover":{backgroundColor:re?tt(k.palette.primary.main,ht()==="dark"?.35:.18):"transparent"}}}),l(we,{"aria-hidden":et?true:void 0,sx:{minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column",opacity:et?0:1,transform:et?"translateX(12px)":"translateX(0)",pointerEvents:et?"none":"auto",transition:`opacity ${yn}, transform ${yn}`,willChange:"opacity, transform"},children:[e(we,{sx:{px:2,pt:2,minHeight:74,display:"flex",alignItems:"flex-end"},children:e(Nt,{sx:{width:"100%"}})}),e(we,{sx:{flex:1,minHeight:0,overflow:"auto",px:2,pb:2},children:rt()})]})]})]})};w();var xy={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)"}}},rB=({children:t,transitionKey:r,variant:o="fade",durationMs:n=220,delayMs:a=0,easing:i="cubic-bezier(0.22, 1, 0.36, 1)",disabled:s=false,sx:c})=>{let p=po("(prefers-reduced-motion: reduce)"),[u,d]=Qt.useState("to"),f=!s&&!p&&o!=="none";Qt.useEffect(()=>{if(!f){d("to");return}d("from");let v=requestAnimationFrame(()=>{v=requestAnimationFrame(()=>{d("to");});});return ()=>cancelAnimationFrame(v)},[r,f]);let b=xy[o],m=Qt.useMemo(()=>f?u==="from"?b.from:b.to:{opacity:1,transform:"none"},[f,u,b.from,b.to]);return e(we,{sx:{willChange:f?"opacity, transform":"auto",transition:f?`opacity ${n}ms ${i} ${a}ms, transform ${n}ms ${i} ${a}ms`:"none",backfaceVisibility:"hidden",...m,...c},children:t})},oB={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};exports.AIBrowserGlow=HF;exports.Activity=Ml;exports.AgentPanel=zu;exports.AlertCircle=Dl;exports.AlertTriangle=Al;exports.ArrowDown=qy;exports.ArrowRight=Xy;exports.ArrowUp=Yy;exports.BarChart=os;exports.Bot=Zy;exports.Button=us;exports.CAINavProvider=ev;exports.CAlert=Ko;exports.CAmapChart=Vd;exports.CAppHeader=wi;exports.CAppHeaderSearch=Us;exports.CAppPageLayout=RD;exports.CAuthPage=JF;exports.CAvatar=Uo;exports.CBadge=Sa;exports.CBarChart=Wn;exports.CButton=ve;exports.CCalendar=Dn;exports.CCardDetailPanel=ep;exports.CCardGrid=rp;exports.CCardGridCard=tb;exports.CCardPage=nR;exports.CChartCard=ri;exports.CCheckbox=Dt;exports.CChip=Tt;exports.CComboChart=Ld;exports.CCustomizeAgent=Wd;exports.CDatePicker=vg;exports.CDetailInfoPage=PM;exports.CDetailSearchAiBar=dp;exports.CDetailSectionCard=vi;exports.CDialog=Vt;exports.CDivider=Nt;exports.CFileUpload=xg;exports.CFilterField=Hw;exports.CFishboneChart=Od;exports.CGoogleMapChart=zd;exports.CGraphCharts=Hd;exports.CGraphKpiCards=Nd;exports.CGraphReport=ii;exports.CHeatmapChart=Fd;exports.CIconButton=ae;exports.CKanbanBoard=eD;exports.CKanbanBucket=fp;exports.CKanbanCard=Vs;exports.CLayoutManagement=Zd;exports.CLayoutManager=nn;exports.CLineChart=Ed;exports.CList=Aw;exports.CListItem=Nw;exports.CListItemAvatar=Bw;exports.CListItemButton=Ew;exports.CListItemIcon=Lw;exports.CListItemText=Fw;exports.CListSubheader=Ow;exports.CMenu=Yt;exports.CMessageBox=On;exports.COrbCanvas=_h;exports.CPageLayout=qa;exports.CPageTransition=rB;exports.CPaper=Ne;exports.CPieChart=oi;exports.CPivotTable=bN;exports.CPlanningGantt=ju;exports.CPlanningLayout=HO;exports.CPopover=cs;exports.CProgress=In;exports.CRadioGroup=_m;exports.CSegmentedControl=Rn;exports.CSelect=Kt;exports.CSkeleton=Qm;exports.CSmartFilter=zr;exports.CSmartTable=w1;exports.CSpinner=Gr;exports.CStack=ie;exports.CStandardPage=D1;exports.CStatusBadge=Rw;exports.CSwitch=Ca;exports.CTable=Xr;exports.CTableBody=v1;exports.CTableCell=y1;exports.CTableContainer=x1;exports.CTableHead=C1;exports.CTableRow=S1;exports.CTabs=gg;exports.CTextArea=Pn;exports.CTextField=Be;exports.CTooltip=it;exports.CTreeComp=QO;exports.CTypography=E;exports.CValueHelp=wd;exports.CVariantManagement=di;exports.CVariantManager=Ud;exports.CVoiceWaveOverlay=tl;exports.CWaterfallChart=Bd;exports.Calendar=ns;exports.CalendarDays=Qy;exports.Camera=jy;exports.ChartNoAxesCombined=Jy;exports.Check=Go;exports.CheckCircle=sa;exports.ChevronDown=Io;exports.ChevronLeft=Nl;exports.ChevronRight=Lr;exports.ChevronUp=ex;exports.ChevronsDown=tx;exports.ChevronsUp=rx;exports.CircleAlert=la;exports.CircleCheck=wn;exports.CircleCheckBig=ox;exports.CircleStop=nx;exports.Clipboard=El;exports.ClipboardCheck=ax;exports.ClipboardList=ix;exports.Clock=Ll;exports.CodeBlock=qn;exports.Columns3=sx;exports.CopilotChat=BF;exports.Copy=ca;exports.CopyPlus=lx;exports.Delete=cx;exports.Download=dx;exports.Edit=Fl;exports.Expand=px;exports.Eye=ux;exports.EyeOff=mx;exports.File=gx;exports.FileText=Ol;exports.Filter=fx;exports.FloatingAgentPanel=MF;exports.FolderTree=kn;exports.GitBranch=Bl;exports.GlobalMessage=ww;exports.Globe=Tn;exports.Grid=zl;exports.GripVertical=bx;exports.Hammer=hx;exports.Image=vx;exports.Info=da;exports.Languages=yx;exports.Layers=xx;exports.LayoutDashboard=Cx;exports.Lightbulb=pa;exports.LineChart=Vl;exports.Loader2=Hl;exports.Lock=ua;exports.LockKeyhole=Sx;exports.LogOut=Wl;exports.Mail=as;exports.MapPin=$l;exports.MarkdownRenderer=Zn;exports.MathBlock=Xn;exports.Menu=wx;exports.MermaidBlock=As;exports.MessageCircle=Im;exports.MessageSquare=kx;exports.Mic=ma;exports.MicOff=Tx;exports.Moon=Gl;exports.MoreHorizontal=Px;exports.NavigationIsland=cc;exports.NavigationIsland2=fs;exports.ORBCAFE_I18N_MESSAGES=Nn;exports.ORB_DARK=sm;exports.ORB_FONT_STACK=Sy;exports.ORB_LIGHT=im;exports.ORB_RADIUS=ky;exports.ORB_TOKENS=ts;exports.ORB_TRANSITION_FAST=Ty;exports.OrbcafeI18nProvider=Ta;exports.OrbisModeProvider=Sn;exports.PAGE_TRANSITION_PRESETS=oB;exports.PAppPageLayout=GE;exports.PBarcodeScanner=LN;exports.PNavIsland=du;exports.PNumericKeypad=YN;exports.PSmartFilter=au;exports.PTable=Bh;exports.PTouchCard=WN;exports.PWorkloadNav=iu;exports.PackageCheck=Ix;exports.PackageSearch=Rx;exports.PanelLeftOpen=ga;exports.PanelRight=fa;exports.PanelsTopLeft=Mx;exports.PieChart=_l;exports.Pin=_o;exports.PivotChartPanel=Zp;exports.Play=Dx;exports.Plus=ba;exports.QrCode=Ax;exports.ReceiptText=Nx;exports.RefreshCw=ha;exports.Rocket=Ex;exports.RotateCcw=Lx;exports.RotateCw=Ul;exports.Rows3=Fx;exports.SapIcon=Mt;exports.Save=Ox;exports.ScanLine=Bx;exports.Search=Fr;exports.Send=Rm;exports.SendHorizontal=Kl;exports.Settings=va;exports.ShieldCheck=zx;exports.Sigma=Vx;exports.SortAsc=Hx;exports.SquareSplitHorizontal=Wx;exports.Star=$x;exports.StdChat=Ou;exports.Sun=ql;exports.Table2=Gx;exports.TableBlock=Es;exports.TabletSmartphone=_x;exports.Terminal=is;exports.ThinkBlock=bi;exports.ThumbsDown=Xl;exports.ThumbsUp=Yl;exports.Trash2=Zl;exports.TreeMenu=En;exports.TreePine=Ux;exports.TrendingDown=Ql;exports.TriangleAlert=ya;exports.Truck=Kx;exports.UploadCloud=jl;exports.User=ss;exports.VoiceNavigatorProvider=oL;exports.VoiceWaveOverlay=QE;exports.Volume2=Jl;exports.Warehouse=qx;exports.Workflow=Xx;exports.X=or;exports.XCircle=xa;exports.addKanbanBucket=bp;exports.buildAmapEmbedUrl=ni;exports.buildGoogleMapEmbedUrl=$n;exports.buildGoogleMapIframe=gP;exports.buttonVariants=Tg;exports.createKanbanBoardModel=vp;exports.createSapIcon=ne;exports.findKanbanCard=Hr;exports.message=fw;exports.messageManager=eo;exports.moveKanbanCard=Ci;exports.orbAlpha=tt;exports.orbChartSeries=wy;exports.parseMarkdownTable=fi;exports.renameKanbanBucket=hp;exports.renderMarkdown=jR;exports.resolveVariantFilters=mi;exports.resolveVariantLayout=gi;exports.useAINav=tv;exports.useAmapEmbedUrl=vR;exports.useAuthPage=_F;exports.useCardPage=cR;exports.useDetailInfo=up;exports.useGoogleMapEmbedUrl=hR;exports.useGraphChartData=uR;exports.useGraphInteraction=li;exports.useGraphReport=tn;exports.useKanbanBoard=aD;exports.useMediaQuery=Rr;exports.useNavigationIsland=fc;exports.useOrbMode=hr;exports.useOrbTokens=xm;exports.useOrbcafeI18n=de;exports.usePadLayout=TN;exports.usePadRecordEditor=RN;exports.usePageLayout=Tp;exports.usePivotTable=CN;exports.usePlanningGantt=Ku;exports.usePlanningLayout=sO;exports.useStandardReport=O1;exports.useVoiceInput=pn;exports.useVoiceNavigator=nL;
234
+ `,nz=({active:t=false,colors:r=Sx,zIndex:o=2147483e3})=>{let n={"--orbcafe-ai-glow-line":r[0],"--orbcafe-ai-glow-z-index":o};return c(jsxRuntime.Fragment,{children:[e("style",{children:wx}),e("div",{className:"orbcafe-ai-browser-glow","data-active":t?"true":"false",style:n,"aria-hidden":"true"})]})};var hz=({defaultMode:t="login",onLogin:r,onRegister:o,onForgotPassword:n}={})=>{let[a,i]=Jt.useState(t),[s,l]=Jt.useState(false),d=Jt.useCallback(async m=>{l(true);try{await m?.();}finally{l(false);}},[]),p=Jt.useCallback(m=>d(()=>r?.(m)),[r,d]),u=Jt.useCallback(m=>d(()=>o?.(m)),[o,d]),f=Jt.useCallback(m=>d(()=>n?.(m)),[n,d]),b=Jt.useMemo(()=>({mode:a,loading:s,onModeChange:i,onLogin:p,onRegister:u,onForgotPassword:f}),[f,p,u,s,a]);return {mode:a,loading:s,setMode:i,authPageProps:b}};T();var Tx={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."},Tz=({mode:t,defaultMode:r="login",onModeChange:o,onLogin:n,onRegister:a,onForgotPassword:i,loading:s=false,logo:l,copy:d,sx:p})=>{let u=t!==void 0,[f,b]=Jt.useState(r),m=t??f,v=Jt.useMemo(()=>({...Tx,...d}),[d]),[y,g]=Jt.useState({username:"demo@orbcafe.local",password:"orbcafe-demo",remember:true}),[x,h]=Jt.useState({name:"",email:"",password:"",confirmPassword:"",acceptedTerms:false}),[C,P]=Jt.useState({email:""}),[w,k]=Jt.useState(""),R=N=>{u||b(N),k(""),o?.(N);},S=async N=>{N.preventDefault(),await n?.(y),k("Demo login accepted. No real authentication request was sent.");},E=async N=>{N.preventDefault(),await a?.(x),k("Demo registration saved locally for this screen.");},D=async N=>{N.preventDefault(),await i?.(C),k("Demo reset link request created. No email was sent.");},I=m==="login"?v.loginTitle:m==="register"?v.registerTitle:v.forgotTitle,A=m==="login"?v.loginSubtitle:m==="register"?v.registerSubtitle:v.forgotSubtitle;return c("div",{className:"orb-auth-frame orb-root",style:p,children:[c("div",{className:"orb-auth-brand",children:[e("span",{className:"orb-auth-dia",style:{width:230,height:230,right:-70,bottom:-60}}),e("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)"}}),e("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?e("span",{style:{alignSelf:"flex-start",position:"relative"},children:l}):e("span",{className:"orb-logo-slot",children:"Host logo"}),c("div",{className:"orb-auth-claim",children:[e("div",{className:"orb-auth-rule"}),e("h2",{children:v.headline}),e("p",{children:v.subheadline})]}),e("div",{className:"orb-auth-meta",children:v.brandMeta})]}),e("div",{className:"orb-auth-form",children:c("div",{className:"orb-auth-card",children:[e("span",{className:"orb-overline",style:{letterSpacing:"0.12em"},children:v.productName}),e("h1",{className:"orb-h2",style:{margin:0},children:I}),e("p",{className:"orb-body-dense",style:{color:"var(--orb-muted)",margin:"-10px 0 0"},children:A}),w&&e(tn,{severity:"success",children:w}),m==="login"&&c("form",{onSubmit:S,style:{display:"flex",flexDirection:"column",gap:16},children:[e(ze,{label:"Email",type:"email",autoComplete:"username",value:y.username,onChange:N=>g(O=>({...O,username:N.target.value})),startAdornment:e(Bs,{size:15,strokeWidth:1.8})}),e(ze,{label:"Password",type:"password",autoComplete:"current-password",value:y.password,onChange:N=>g(O=>({...O,password:N.target.value})),startAdornment:e(Na,{size:15,strokeWidth:1.8})}),c("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},children:[e(Dt,{label:"Remember me",checked:y.remember,onChange:N=>g(O=>({...O,remember:N.target.checked}))}),e("button",{type:"button",className:"orb-link",onClick:()=>R("forgot"),children:"Forgot password?"})]}),e(Ce,{type:"submit",size:"large",block:true,loading:s,children:s?"Signing in\u2026":"Sign in"}),c("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["New user?"," ",e("button",{type:"button",className:"orb-link",onClick:()=>R("register"),children:"Register"})]})]}),m==="register"&&c("form",{onSubmit:E,style:{display:"flex",flexDirection:"column",gap:16},children:[e(ze,{label:"Full name",value:x.name,onChange:N=>h(O=>({...O,name:N.target.value})),startAdornment:e(Bs,{size:15,strokeWidth:1.8})}),e(ze,{label:"Work email",type:"email",autoComplete:"username",value:x.email,onChange:N=>h(O=>({...O,email:N.target.value})),startAdornment:e(Fs,{size:15,strokeWidth:1.8})}),e(ze,{label:"Password",type:"password",autoComplete:"new-password",value:x.password,onChange:N=>h(O=>({...O,password:N.target.value})),startAdornment:e(Na,{size:15,strokeWidth:1.8})}),e(ze,{label:"Confirm password",type:"password",autoComplete:"new-password",value:x.confirmPassword,onChange:N=>h(O=>({...O,confirmPassword:N.target.value}))}),e(Dt,{label:"I accept the demo workspace terms",checked:x.acceptedTerms,onChange:N=>h(O=>({...O,acceptedTerms:N.target.checked}))}),e(Ce,{type:"submit",size:"large",block:true,loading:s,children:"Create demo account"}),c("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["Already have an account?"," ",e("button",{type:"button",className:"orb-link",onClick:()=>R("login"),children:"Sign in"})]})]}),m==="forgot"&&c("form",{onSubmit:D,style:{display:"flex",flexDirection:"column",gap:16},children:[e(ze,{label:"Work email",type:"email",autoComplete:"username",value:C.email,onChange:N=>P({email:N.target.value}),startAdornment:e(Fs,{size:15,strokeWidth:1.8})}),e(Ce,{type:"submit",size:"large",block:true,loading:s,children:"Send reset request"}),c("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["Remember your password?"," ",e("button",{type:"button",className:"orb-link",onClick:()=>R("login"),children:"Back to sign in"})]})]}),c("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:[e("span",{style:{flex:1,height:1,background:"var(--orb-border)"}}),"or",e("span",{style:{flex:1,height:1,background:"var(--orb-border)"}})]}),e(Ce,{variant:"neutral",size:"large",block:true,children:"Continue with corporate SSO"}),c("p",{className:"orb-meta",style:{textAlign:"center",fontWeight:300,margin:0},children:["Protected by corporate single sign-on.",e("br",{}),"Demo credentials: demo@orbcafe.local / orbcafe-demo"]})]})})]})};var Rx={keyword:{value:"",operator:"contains"},status:{value:"",operator:"equals"},owner:{value:"",operator:"contains"},workCenter:{value:"",operator:"contains"}},Mx=[{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"}],vg=({tasks:t,appId:r,tableKey:o,defaultScale:n="week",defaultSelectedTaskId:a,initialFilters:i,filterFields:s,filterAppId:l,filterTableKey:d,serviceUrl:p,variantService:u,layout:f,columns:b,page:m,rowsPerPage:v,rowsPerPageOptions:y,count:g,onPageChange:x,onRowsPerPageChange:h,onFilterSearch:C,onFilterVariantLoad:P,enableRowReorder:w,onTaskReorder:k,onLayoutIdChange:R,onLayoutSave:S})=>{let E=r??l??"planning-gantt",D=o??d??"planning",[I,A]=Jt.useState(n),[N,O]=Jt.useState(a??t[0]?.id??""),[F,q]=Jt.useState(""),[z,X]=Jt.useState(null),[$,_]=Jt.useState({...Rx,...i}),V=Jt.useMemo(()=>{let le=String($.keyword?.value??"").trim().toLowerCase(),be=String($.status?.value??"").trim(),_e=String($.owner?.value??"").trim().toLowerCase(),De=String($.workCenter?.value??"").trim().toLowerCase(),Pe=$.dateRange?.value,Ve=Pe?.[0]?ro__default.default(Pe[0]):null,Te=Pe?.[1]?ro__default.default(Pe[1]):null;return t.filter(xe=>{if(le&&![xe.id,xe.code,xe.title,xe.project,xe.workCenter,xe.owner?.name].join(" ").toLowerCase().includes(le)||be&&xe.status!==be||_e&&!String(xe.owner?.name??"").toLowerCase().includes(_e)||De&&!String(xe.workCenter??"").toLowerCase().includes(De))return false;if(Ve||Te){let We=ro__default.default(xe.startDate),ot=ro__default.default(xe.endDate),it=Ve?ot.isAfter(Ve)||ot.isSame(Ve,"day"):true,Ze=Te?We.isBefore(Te)||We.isSame(Te,"day"):true;if(!it||!Ze)return false}return true})},[$,t]);Jt.useEffect(()=>{V.length!==0&&(V.some(le=>le.id===N)||O(V[0].id));},[V,N]);let B=Jt.useCallback(le=>{O(le.id);},[]),Z=Jt.useCallback(le=>{q(le),R?.(le);},[R]),Q=Jt.useCallback(le=>{X(be=>({key:(be?.key??0)+1,variant:le})),P?.(le);},[P]),ge=Jt.useMemo(()=>({appId:E,tableKey:D,fields:s??Mx,filters:$,onFilterChange:_,onVariantLoad:Q,onSearch:C??(()=>{}),currentLayoutId:F,layoutRefs:[{tableKey:D,layoutId:F||null}],variantService:u,serviceUrl:p}),[F,s,$,Q,C,E,D,p,u]),se=Jt.useMemo(()=>({appId:E,tableKey:D,serviceUrl:p,tasks:V,columns:b,scale:I,onScaleChange:A,page:m,rowsPerPage:v,rowsPerPageOptions:y,count:g,onPageChange:x,onRowsPerPageChange:h,selectedTaskId:N,onTaskSelect:B,enableRowReorder:w,onTaskReorder:k,layout:f,layoutVariant:z?.variant,layoutVariantLoadKey:z?.key,onLayoutIdChange:Z,onLayoutSave:S}),[b,g,w,V,Z,f,z?.key,z?.variant,x,h,S,k,B,m,E,D,v,y,I,p,N]);return {scale:I,setScale:A,selectedTaskId:N,setSelectedTaskId:O,filters:$,setFilters:_,filteredTasks:V,smartFilterProps:ge,planningGanttProps:se}};var Lz=t=>{let r=vg(t),o=Jt.useMemo(()=>({filterProps:r.smartFilterProps,ganttProps:r.planningGanttProps}),[r.planningGanttProps,r.smartFilterProps]);return {...r,layoutProps:o}};T();ro__default.default.extend(Nx__default.default);var tc=[{value:"hour",label:"Hour",width:56},{value:"day",label:"Day",width:46},{value:"week",label:"Week",width:78},{value:"month",label:"Month",width:104}],rc=36,oc=58,xa=8,nc=260,Hx=320,_o="220ms cubic-bezier(0.2, 0, 0, 1)",yg={"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"}},zx=t=>t?yg[t]?.label??t:"Planned",Vx=t=>t?yg[t]?.color??"default":"info",Cg=t=>Math.min(100,Math.max(0,t??0)),xg=(t,r=0)=>t.flatMap(o=>[{...o,level:r},...xg(o.children??[],r+1)]),Wx=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:zx(t.status),statusTone:t.status??"planned",progress:Cg(t.progress),startDate:t.startDate,endDate:t.endDate,color:t.color,reorderable:t.reorderable!==false}),Sg=(t,r)=>r==="month"?t.startOf("month"):r==="week"?t.startOf("week"):r==="day"?t.startOf("day"):t.startOf("hour"),wg=(t,r)=>r==="month"?t.endOf("month"):r==="week"?t.endOf("week"):r==="day"?t.endOf("day"):t.endOf("hour"),$x=(t,r,o)=>{let n=[],a=Sg(t,o),i=wg(r,o);for(;a.isBefore(i)||a.isSame(i);){let s=o==="month"?a.add(1,"month"):o==="week"?a.add(1,"week"):o==="day"?a.add(1,"day"):a.add(1,"hour");n.push({key:`${o}-${a.valueOf()}`,label:o==="month"?a.format("MMM YYYY"):o==="week"?a.format("MMM D"):o==="day"?a.format("D"):a.format("HH:mm"),contextLabel:o==="hour"?a.format("MMM D"):o==="day"?a.format("MMM"):o==="week"?`W${a.isoWeek()}`:void 0,title:o==="hour"?a.format("MMM D, YYYY HH:mm"):o==="day"?a.format("MMM D, YYYY"):o==="week"?`${a.format("MMM D, YYYY")} - Week ${a.isoWeek()}`:void 0,start:a,end:s}),a=s;}return n},ac=(t,r,o)=>{let n=0;for(let a of r){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*o}n+=o;}return n},kg=({appId:t="planning-gantt",tableKey:r="planning",serviceUrl:o,title:n="Project Plan",extraTools:a,bodyHeight:i=560,tasks:s,columns:l,scale:d="week",onScaleChange:p,page:u,rowsPerPage:f=20,rowsPerPageOptions:b=[20,50,100,-1],count:m,onPageChange:v,onRowsPerPageChange:y,timelineStart:g,timelineEnd:x,selectedTaskId:h,onTaskSelect:C,enableRowReorder:P=true,onTaskReorder:w,layout:k,layoutVariant:R,layoutVariantLoadKey:S,onLayoutIdChange:E,onLayoutSave:D,emptyLabel:I="No planning tasks available.",sx:A})=>{let N=sr(),{t:O}=pe(),F=Jt.useRef(null),q=Jt.useRef(null),z=Jt.useRef(null),X=Jt.useRef(false),[$,_]=Jt.useState(null),[V,B]=Jt.useState("content"),[Z,Q]=Jt.useState(null),[ge,se]=Jt.useState(0),[le,be]=Jt.useState({}),[_e,De]=Jt.useState(rc),[Pe,Ve]=Jt.useState([]),Te=Jt.useRef(void 0),[xe,We]=Jt.useState({activeId:null,overId:null}),[ot,it]=Jt.useState(null),[Ze,U]=Jt.useState(false),Fe=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:4}})),ye=Jt.useRef(null),Le=Jt.useMemo(()=>xg(s),[s]),st=Jt.useMemo(()=>{if(Pe.length===0)return Le;let H=new Map(Le.map(Se=>[Se.id,Se])),j=Pe.map(Se=>H.get(Se)).filter(Se=>!!Se),me=new Set(j.map(Se=>Se.id));return [...j,...Le.filter(Se=>!me.has(Se.id))]},[Le,Pe]),Je=Jt.useMemo(()=>new Map(st.map(H=>[H.id,H])),[st]),vt=Jt.useMemo(()=>st.map(H=>Wx(H)),[st]),St=Jt.useMemo(()=>new Map(vt.map(H=>[H.id,H])),[vt]),Et=Jt.useMemo(()=>[{id:"code",label:"ID",minWidth:90},{id:"title",label:"Task",minWidth:260,render:(H,j)=>c(ie,{spacing:.2,children:[e(L,{sx:{fontSize:15,fontWeight:700,lineHeight:1.2},children:j.title}),e(L,{sx:{fontSize:13,color:"text.secondary"},children:j.titleSub})]})},{id:"owner",label:"Owner",minWidth:170},{id:"status",label:"Status",minWidth:130,render:(H,j)=>e(Pt,{label:j.status,color:Vx(j.statusTone),size:"small"})},{id:"progress",label:"Progress",minWidth:140,numeric:true,render:H=>c(ie,{spacing:.6,children:[c(L,{variant:"caption",sx:{color:"text.secondary"},children:[H,"%"]}),e(Vn,{variant:"determinate",value:H,sx:{height:6,borderRadius:999}})]})},{id:"startDate",label:"Start",minWidth:120},{id:"endDate",label:"End",minWidth:120}],[]),Lt=Jt.useMemo(()=>{if(!l||l.length===0)return Et;let H=new Map(Et.map(j=>[j.id,j]));return l.map(j=>{let me=H.get(j.id),Se=j.width??me?.minWidth??120,tt={id:j.id,label:j.label,minWidth:Se};if(me?.numeric&&(tt.numeric=true),j.render){let Xe=j.render;return tt.render=(It,ft)=>{let gt=Je.get(ft.id);return Xe(gt||ft)},tt}return me?.render?(tt.render=me.render,tt):(tt.render=(Xe,It)=>{let ft=It[j.id];if(ft!=null&&String(ft).length>0)return String(ft);let kt=Je.get(It.id)?.[j.id];return kt!=null&&String(kt).length>0?String(kt):"-"},tt)})},[l,Et,Je]),re=fn({appId:t,tableKey:r,title:n,columns:Lt,rows:vt,rowKey:"id",page:u,rowsPerPage:f,rowsPerPageOptions:b,count:m??vt.length,onPageChange:v,onRowsPerPageChange:y,showSummary:false,layout:k,onLayoutSave:D}),nt=t?e(gn,{appId:t,tableKey:r,currentLayoutData:re.currentLayoutData,onLayoutLoad:re.handleLayoutLoad,targetLayoutId:re.layoutIdToLoad,activeLayoutId:re.currentLayoutId,serviceUrl:o}):null,Be=re.visibleRows;Jt.useEffect(()=>{let H=Le.map(j=>j.id);Ve(j=>{let me=new Set(H),Se=j.filter(ft=>me.has(ft)),tt=new Set(Se),Xe=H.filter(ft=>!tt.has(ft)),It=[...Se,...Xe];return It.length===j.length&&It.every((ft,gt)=>ft===j[gt])?j:It});},[Le]),Jt.useEffect(()=>{S===void 0||!R||Te.current!==S&&(Te.current=S,re.handleVariantLoad(R));},[re,R,S]),Jt.useEffect(()=>{E?.(re.currentLayoutId);},[re.currentLayoutId,E]);let ce=H=>H.type==="group"?`group-${H.id}`:`row-${(H.data||H)?.id}`,fe=Jt.useMemo(()=>{let H=vt.map(gt=>ro__default.default(gt.startDate)),j=vt.map(gt=>ro__default.default(gt.endDate)),me=g?ro__default.default(g):H.reduce((gt,kt)=>kt.isBefore(gt)?kt:gt,H[0]??ro__default.default()),Se=x?ro__default.default(x):j.reduce((gt,kt)=>kt.isAfter(gt)?kt:gt,j[0]??ro__default.default().add(30,"day")),tt=d==="month"?"month":d==="week"?"week":d==="day"?"day":"hour",Xe=d==="month"?"month":d==="week"?"week":d==="day"?"day":"hour",It=d==="hour"?12:1,ft=d==="hour"?12:1;return {start:Sg(me.subtract(It,tt),d),end:wg(Se.add(ft,Xe),d)}},[vt,d,x,g]),ee=tc.find(H=>H.value===d)??tc[1],Ie=Array.isArray(a)?a:a?[a]:[],Re=Jt.useMemo(()=>$x(fe.start,fe.end,d),[fe.end,fe.start,d]),je=Re.length*ee.width,mt=Re.length>0?100/Re.length:100,pt=Re.length>0?`repeat(${Re.length}, minmax(${ee.width}px, 1fr))`:"1fr",Ot=Re.length>0?`calc(100% / ${Re.length}) 100%`:"100% 100%",Kt=(re.columns||[]).filter(H=>re.visibleColumns.includes(H.id)).reduce((H,j)=>H+(re.columnWidths?.[j.id]||j.minWidth||100),0)+(re.grouping.length>0?72:0),yt=V==="manual"&&$!==null?$:Kt,bt=Z==="table",xr=Z==="timeline",Tt=Z==="timeline",Ft=Z==="table",ut=!Tt&&!Ft,Bt=()=>{let H=ge||F.current?.clientWidth||0;return H>0?Math.max(nc,H-xa-Hx):Math.max(nc,Kt)},we=H=>Math.min(Math.max(H,nc),Bt()),Y=(()=>{if(ge<=0)return null;let H=ut?xa:0;if(bt)return {tableWidth:ge,splitterWidth:H,timelineWidth:0};if(xr)return {tableWidth:0,splitterWidth:H,timelineWidth:ge};if(V==="even"){let me=Math.max(0,(ge-H)/2);return {tableWidth:me,splitterWidth:H,timelineWidth:Math.max(0,ge-H-me)}}let j=we(yt);return {tableWidth:j,splitterWidth:H,timelineWidth:Math.max(0,ge-H-j)}})(),te=Y?`${Y.tableWidth}px ${Y.splitterWidth}px ${Y.timelineWidth}px`:bt?"minmax(0, 1fr) 0px 0px":xr?"0px 0px minmax(0, 1fr)":V==="even"?`minmax(0, 1fr) ${xa}px minmax(0, 1fr)`:`${yt}px ${xa}px minmax(0, 1fr)`;Jt.useEffect(()=>{V==="manual"&&_(H=>H===null?null:we(H));},[V,Kt,ge]);let Ne=H=>{H.preventDefault(),H.currentTarget.setPointerCapture(H.pointerId),Q(null),B("manual"),ye.current={startX:H.clientX,startWidth:q.current?.getBoundingClientRect().width??yt};let j=Se=>{let tt=ye.current;if(!tt)return;let Xe=we(tt.startWidth+Se.clientX-tt.startX);_(Xe);},me=()=>{ye.current=null,window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",me),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",me);},he=()=>{Q(null),B("even"),_(null);},Ae=H=>!P||!H?false:St.get(H)?.reorderable!==false,Ke=(H,j)=>{if(!H||!j||H===j||!Ae(H)||!Ae(j))return false;if(re.grouping.length===0)return true;let me=St.get(H),Se=St.get(j);return !me||!Se?false:re.grouping.every(tt=>me[tt]===Se[tt])},et=(H,j)=>{if(!Ke(H,j))return;let me=Be.filter(Ht=>Ht.type!=="group").map(Ht=>String((Ht.data||Ht)?.id)),Se=me.indexOf(H),tt=me.indexOf(j);if(Se<0||tt<0)return;let Xe=[...me];[Xe[Se],Xe[tt]]=[Xe[tt],Xe[Se]];let It=new Set(me),ft=st.map(Ht=>Ht.id),gt=[...Xe,...ft.filter(Ht=>!It.has(Ht))],kt=Je.get(H),nr=Je.get(j);if(re.setOrder("asc"),re.setOrderBy(""),Ve(gt),kt&&nr){let{level:Ht,...Yt}=kt,{level:Vt,...qt}=nr,$t=gt.reduce((rr,ar)=>{let gr=Je.get(ar);if(gr){let{level:Ir,...Rr}=gr;rr.push(Rr);}return rr},[]);w?.($t,{activeTask:Yt,targetTask:qt});}},qe=(H,j)=>{if(!Ae(j.id)){H.preventDefault();return}H.stopPropagation(),H.dataTransfer.effectAllowed="move",H.dataTransfer.setData("text/plain",j.id),We({activeId:j.id,overId:null}),C?.(Je.get(j.id)||j);},Ct=(H,j)=>{if(!Ke(xe.activeId,j)){We(me=>me.overId===null?me:{...me,overId:null});return}H.preventDefault(),H.stopPropagation(),H.dataTransfer.dropEffect="move",We(me=>me.overId===j?me:{...me,overId:j});},Nt=(H,j)=>{let me=xe.activeId||H.dataTransfer.getData("text/plain");if(!Ke(me,j)){We({activeId:null,overId:null});return}H.preventDefault(),H.stopPropagation(),et(me,j),We({activeId:null,overId:null});},wt=()=>{We({activeId:null,overId:null});},xt=H=>{if(X.current)return;let j=H==="table"?q.current:z.current,me=H==="table"?z.current:q.current;!j||!me||(X.current=true,me.scrollTop=j.scrollTop,window.requestAnimationFrame(()=>{X.current=false;}));};return Jt.useLayoutEffect(()=>{let H=F.current;if(!H){se(0);return}let j=0,me=()=>{window.cancelAnimationFrame(j),j=window.requestAnimationFrame(()=>{let tt=H.clientWidth;se(Xe=>Math.abs(Xe-tt)<.5?Xe:tt);});};if(me(),typeof ResizeObserver>"u")return window.addEventListener("resize",me),()=>{window.cancelAnimationFrame(j),window.removeEventListener("resize",me);};let Se=new ResizeObserver(me);return Se.observe(H),window.addEventListener("resize",me),()=>{window.cancelAnimationFrame(j),Se.disconnect(),window.removeEventListener("resize",me);}},[vt.length]),Jt.useLayoutEffect(()=>{if(!h||Ft)return;let H=z.current,j=q.current;if(!H)return;let me=`row-${h}`,Se=Array.from(H.querySelectorAll("[data-planning-timeline-row-key]")).find(It=>It.dataset.planningTimelineRowKey===me),tt=St.get(h);if(!Se||!tt)return;let Xe=window.requestAnimationFrame(()=>{let It=H.getBoundingClientRect(),ft=Se.getBoundingClientRect(),gt=Math.max(1,H.clientHeight-_e),kt=H.scrollTop+ft.top-It.top-_e-(gt-ft.height)/2;X.current=true,H.scrollTop=Math.max(0,kt),j&&!Tt&&(j.scrollTop=H.scrollTop);let nr=Math.max(1,H.scrollWidth),Ht=Re.length>0?nr/Re.length:ee.width,Yt=ac(ro__default.default(tt.startDate),Re,Ht),Vt=Math.max(0,Yt-Ht);H.scrollLeft=Math.min(Vt,Math.max(0,nr-H.clientWidth)),window.requestAnimationFrame(()=>{X.current=false;});});return ()=>window.cancelAnimationFrame(Xe)},[ee.width,_e,h,Tt,St,Ft,Be,Re]),Jt.useLayoutEffect(()=>{let H=q.current;if(!H)return;let j=0,me=0,Se=false,tt=()=>{if(Se)return;let Vt=H.querySelector("thead"),qt=Array.from(H.querySelectorAll("tbody tr[data-ctable-row-key]"));if(qt.length===0)return;let $t=Vt?.getBoundingClientRect().height||rc,rr={};qt.forEach(ar=>{let gr=ar.dataset.ctableRowKey;gr&&(rr[gr]=ar.getBoundingClientRect().height);}),De(ar=>Math.abs(ar-$t)<.01?ar:$t),be(ar=>{let gr=Object.keys(ar),Ir=Object.keys(rr);return gr.length===Ir.length&&Ir.every(Rr=>Math.abs((ar[Rr]??0)-rr[Rr])<.01)?ar:rr});},Xe=()=>{window.cancelAnimationFrame(j),j=window.requestAnimationFrame(tt);};if(tt(),window.cancelAnimationFrame(me),me=window.requestAnimationFrame(()=>{me=window.requestAnimationFrame(tt);}),typeof document<"u"&&document.fonts?.ready&&document.fonts.ready.then(()=>{Se||Xe();}).catch(()=>{}),typeof ResizeObserver>"u")return window.addEventListener("resize",Xe),()=>{Se=true,window.cancelAnimationFrame(j),window.cancelAnimationFrame(me),window.removeEventListener("resize",Xe);};let It=new ResizeObserver(Xe),ft=H.querySelector("table"),gt=H.querySelector("tbody"),kt=H.querySelector("thead");ft&&It.observe(ft),kt&&It.observe(kt);let nr=new WeakSet,Ht=()=>{H.querySelectorAll("tbody tr[data-ctable-row-key]").forEach(Vt=>{nr.has(Vt)||(It.observe(Vt),nr.add(Vt));});};Ht();let Yt=null;return gt&&typeof MutationObserver<"u"&&(Yt=new MutationObserver(()=>{Ht(),Xe();}),Yt.observe(gt,{childList:true,subtree:true,characterData:true})),window.addEventListener("resize",Xe),()=>{Se=true,window.cancelAnimationFrame(j),window.cancelAnimationFrame(me),It.disconnect(),Yt?.disconnect(),window.removeEventListener("resize",Xe);}},[Be,re.visibleColumns,re.grouping,re.columnWidths]),c(Ee,{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 ${N.palette.divider}`,...A},children:[e("div",{className:"orb-table-toolbar orb-planning-table-toolbar",role:"toolbar","aria-label":O("table.title.default"),children:c("div",{className:"orb-table-toolbar-primary",children:[e(mi,{value:re.filterText,onChange:H=>{re.setFilterText(H),re.setPage(0);}}),e(ui,{rowsPerPage:re.rowsPerPage,rowsPerPageOptions:b,page:re.page,count:re.totalDisplayCount,onRowsPerPageChange:re.setRowsPerPage,onPageChange:re.setPage}),Ie.length>0&&e("div",{className:"orb-table-toolbar-custom",children:Ie.map((H,j)=>e("div",{className:"orb-planning-extra-tool",children:H},`planning-extra-tool-${j}`))}),e("span",{className:"orb-table-toolbar-spacer"}),c("div",{className:"orb-table-toolbar-actions",children:[c("div",{className:"orb-table-tool-group",children:[e(ae,{className:"orb-table-tool-button",tooltip:"Column visibility",onClick:H=>re.setAnchorEl(H.currentTarget),sx:dr,children:e(an,{fontSize:"small"})}),e(ae,{className:"orb-table-tool-button",tooltip:"Group by",onClick:H=>re.setGroupAnchorEl(H.currentTarget),sx:dr,children:e(xo,{fontSize:"small"})}),e(ae,{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:dr,children:e(ip,{fontSize:"small"})})]}),nt&&e("div",{className:"orb-table-tool-group",children:nt}),e("div",{className:"orb-table-tool-group orb-planning-pane-controls",children:e(Wn,{"aria-label":"Planning pane layout",size:"small",value:Z??(V==="even"?"split":null),options:[{value:"table",label:"Expand task table",icon:e(ii,{fontSize:"small"})},{value:"split",label:"Split evenly",icon:e(li,{fontSize:"small"})},{value:"timeline",label:"Expand timeline",icon:e(ai,{fontSize:"small"})}],onValueChange:H=>{H==="split"?he():Q(H);}})}),e("div",{className:"orb-table-tool-group orb-planning-scale-control",children:e(Wt,{label:"",value:d,options:tc.map(H=>({value:H.value,label:H.label})),onChange:H=>p?.(H.target.value)})})]})]})}),vt.length===0?e("div",{sx:{minHeight:240,display:"grid",placeItems:"center",color:"text.secondary"},children:I}):e("div",{sx:{overflow:"hidden",flex:1,minHeight:0},children:c("div",{ref:F,sx:{height:"100%",display:"grid",gridTemplateColumns:te,minWidth:0,transition:`grid-template-columns ${_o}`},children:[e("div",{"data-planning-scroll-pane":"table",ref:q,onScroll:()=>xt("table"),sx:{width:"100%",minWidth:0,maxWidth:"100%",height:i,overflowX:"auto",overflowY:"auto",opacity:Tt?0:1,transform:Tt?"translateX(-10px)":"translateX(0)",pointerEvents:Tt?"none":"auto",transition:`opacity ${_o}, transform ${_o}`},children:e(core.DndContext,{sensors:Fe,collisionDetection:core.closestCenter,modifiers:[modifiers.restrictToHorizontalAxis],onDragEnd:H=>{let j=H?.active?.id,me=H?.over?.id;typeof j=="string"&&typeof me=="string"&&re.handleColumnReorder(j,me);},children:c("table",{className:"orb-tbl orb-ctable orb-planning-table",sx:{tableLayout:"fixed",width:Kt,"& thead th":{height:rc,py:0,lineHeight:1.15,boxSizing:"border-box"}},children:[e(bi,{columns:re.columns,visibleColumns:re.visibleColumns,order:re.order,orderBy:re.orderBy,sortBy:re.sortBy,onRequestSort:re.handleRequestSort,onContextMenu:(H,j)=>{H.preventDefault(),H.stopPropagation(),it({mouseX:H.clientX+2,mouseY:H.clientY-6,columnId:j});},grouping:re.grouping,isAllExpanded:re.isAllExpanded,handleToggleAll:re.handleToggleAll,columnWidths:re.columnWidths,onColumnResize:re.handleColumnResize,enableColumnReorder:true}),e(hi,{visibleRows:Be,columns:re.columns,visibleColumns:re.visibleColumns,selected:h?[h]:[],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:I,handleClick:(H,j)=>{C?.(Je.get(j.id)||j);},getRowDataKey:({entry:H})=>ce(H),getGroupRowProps:()=>({style:{height:oc}}),getRowProps:({data:H})=>{let j=H,me=Ae(j.id),Se=xe.activeId===j.id,tt=xe.overId===j.id&&Ke(xe.activeId,j.id);return {draggable:me,className:tt?"orb-is-drop-target":void 0,style:{cursor:Se?"grabbing":me?"grab":C?"pointer":"default",height:oc,opacity:Se?.56:1,transition:"background-color 120ms ease, opacity 120ms ease"},onDragStart:Xe=>qe(Xe,j),onDragOver:Xe=>Ct(Xe,j.id),onDragEnter:Xe=>Ct(Xe,j.id),onDrop:Xe=>Nt(Xe,j.id),onDragEnd:wt}}})]})})}),e("div",{onPointerDown:ut?Ne:void 0,role:"separator","aria-orientation":"vertical",sx:{width:ut?xa:0,cursor:ut?"col-resize":"default",opacity:ut?1:0,pointerEvents:ut?"auto":"none",borderLeft:ut?`1px solid ${N.palette.divider}`:"0 solid transparent",borderRight:ut?`1px solid ${N.palette.divider}`:"0 solid transparent",backgroundColor:ht()==="dark"?"color-mix(in oklch, var(--orb-muted) 10%, transparent)":"color-mix(in oklch, var(--orb-fg) 4%, transparent)",transition:`width ${_o}, opacity ${_o}, background-color 120ms ease`,position:"relative","&:hover":{backgroundColor:N.palette.action.selected},"&::before":{content:'""',position:"absolute",top:0,bottom:0,left:-6,right:-6,cursor:ut?"col-resize":"default"}}}),e("div",{sx:{minWidth:0,overflow:"hidden",opacity:Ft?0:1,transform:Ft?"translateX(10px)":"translateX(0)",pointerEvents:Ft?"none":"auto",transition:`opacity ${_o}, transform ${_o}`},children:e("div",{"data-planning-scroll-pane":"timeline",ref:z,onScroll:()=>xt("timeline"),sx:{width:"100%",height:i,overflowX:"auto",overflowY:"auto"},children:c("div",{sx:{width:"100%",minWidth:je||"100%"},children:[e("div",{className:"orb-planning-timeline-header",sx:{display:"grid",gridTemplateColumns:pt,height:_e,boxSizing:"border-box",borderBottom:`1px solid ${N.palette.divider}`,position:"sticky",top:0,zIndex:2},children:Re.map(H=>c("div",{title:H.title,sx:{px:.75,display:"flex",flexDirection:H.contextLabel?"column":"row",alignItems:"center",justifyContent:"center",gap:H.contextLabel?.15:0,borderRight:`1px solid ${N.palette.divider}`,color:H.contextLabel?"text.primary":"text.secondary",overflow:"hidden"},children:[H.contextLabel&&e(L,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"text.secondary",fontSize:11,fontWeight:700,lineHeight:1.1},children:H.contextLabel}),e(L,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:12,fontWeight:700,lineHeight:1.15},children:H.label})]},H.key))}),e(ie,{sx:{position:"relative"},children:Be.map(H=>{let j=ce(H),me=le[j]??oc;if(H.type==="group")return e("div",{className:"orb-planning-timeline-row orb-table-group-row","data-planning-timeline-row-key":j,sx:{position:"relative",height:me,boxSizing:"border-box",borderBottom:`1px solid ${N.palette.divider}`}},H.id);let Se=H.data||H,tt=ro__default.default(Se.startDate),Xe=ro__default.default(Se.endDate),It=ac(tt,Re,mt),ft=ac(Xe,Re,mt),gt=Math.max(0,ft-It),kt=Cg(Se.progress),nr=Se.id===h,Ht=Ae(Se.id),Yt=xe.activeId===Se.id,Vt=xe.overId===Se.id&&Ke(xe.activeId,Se.id),qt=Se.color??(Se.statusTone==="blocked"?N.palette.error.main:N.palette.primary.main);return e("div",{className:`orb-planning-timeline-row ${nr?"orb-is-selected":""}`,"data-planning-timeline-row-key":j,draggable:Ht,onDragStart:$t=>qe($t,Se),onDragOver:$t=>Ct($t,Se.id),onDragEnter:$t=>Ct($t,Se.id),onDrop:$t=>Nt($t,Se.id),onDragEnd:wt,onClick:()=>C?.(Je.get(Se.id)||Se),sx:{position:"relative",height:me,boxSizing:"border-box",borderBottom:`1px solid ${N.palette.divider}`,opacity:Yt?.56:1,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,height:2,backgroundColor:N.palette.primary.main,opacity:Vt?1:0,transition:"opacity 120ms ease",pointerEvents:"none",zIndex:3},backgroundImage:ht()==="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:Ot,cursor:Yt?"grabbing":Ht?"grab":C?"pointer":"default",transition:"opacity 120ms ease"},children:e(lt,{title:`${Se.title}: ${tt.format("MMM D HH:mm")} - ${Xe.format("MMM D HH:mm")}`,children:c("div",{sx:{position:"absolute",left:`${It}%`,top:Math.max(8,(me-24)/2),width:`max(18px, ${gt}%)`,height:24,borderRadius:999,overflow:"hidden",backgroundColor:ht()==="dark"?"color-mix(in oklch, var(--orb-muted) 18%, transparent)":"color-mix(in oklch, var(--orb-fg) 10%, transparent)",outline:nr?`2px solid ${N.palette.warning.main}`:"none",outlineOffset:2},children:[e("div",{sx:{height:"100%",width:`${kt}%`,backgroundColor:qt}}),e(L,{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:Se.code})]})})},Se.id)})})]})})})]})}),e(cn,{groupAnchorEl:re.groupAnchorEl,setGroupAnchorEl:re.setGroupAnchorEl,grouping:re.grouping,setGrouping:re.setGrouping,columns:re.columns}),e(dn,{anchorEl:re.anchorEl,setAnchorEl:re.setAnchorEl,columns:re.columns,visibleColumns:re.visibleColumns,toggleColumnVisibility:re.toggleColumnVisibility}),e(kp,{contextMenu:ot,handleClose:()=>it(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:H=>{re.applyMultiSort([{field:H,direction:"asc"}]);},onSortDesc:H=>{re.applyMultiSort([{field:H,direction:"desc"}]);},onClearSort:H=>{let j=re.sortBy.filter(me=>me.field!==H);j.length>0?re.applyMultiSort(j):(re.clearMultiSort(),re.orderBy===H&&re.setOrderBy(""));},onHideColumn:H=>{re.visibleColumns.includes(H)&&re.toggleColumnVisibility(H);},onToggleGroup:H=>re.toggleGroupField(H),onToggleSummary:H=>re.toggleSummaryColumn(H),onOpenSortDialog:()=>U(true)}),e(Pp,{open:Ze,onClose:()=>U(false),columns:re.columns,initialRules:re.sortBy.length>0?re.sortBy:re.orderBy?[{field:re.orderBy,direction:re.order}]:[],onApply:H=>re.applyMultiSort(H),onClear:()=>{re.clearMultiSort(),re.setOrderBy("");}})]})};T();var m5=({filterProps:t,ganttProps:r,spacing:o=2,sx:n,children:a})=>{let i=n?[{height:"100%",overflow:"hidden"},n]:{height:"100%",overflow:"hidden"},s=r.sx?[{height:"100%"},r.sx]:{height:"100%"};return c(ie,{spacing:o,sx:i,children:[e("div",{sx:{flexShrink:0},children:e(Wr,{...t})}),e("div",{sx:{flex:1,minHeight:0,overflow:"hidden"},children:e(kg,{...r,bodyHeight:r.bodyHeight??"100%",sx:s})}),a]})};T();var Pg=640,Gx=360,_x=360,Ms=8,Nn="220ms cubic-bezier(0.2, 0, 0, 1)",lc=(t,r,o=0,n=[])=>t.flatMap(a=>{let i=a.children??[],s=[{node:a,level:o,hasChildren:i.length>0,parentIds:n}];return r.has(a.id)?[...s,...lc(i,r,o+1,[...n,a.id])]:s}),Ig=t=>t.flatMap(r=>[r,...Ig(r.children??[])]),Rg=(t,r=0,o=[])=>t.flatMap(n=>{let a=n.children??[];return [{node:n,level:r,hasChildren:a.length>0,parentIds:o},...Rg(a,r+1,[...o,n.id])]}),Mg=t=>t.flatMap(r=>{let o=r.children??[];return o.length===0?[]:[r.id,...Mg(o)]}),Tg=t=>Object.entries(t).filter(([r])=>r!=="children").map(([,r])=>r==null?"":typeof r=="string"||typeof r=="number"||typeof r=="boolean"?String(r):"").join(" ").toLowerCase(),k5=({title:t,subtitle:r,nodes:o,columns:n,detail:a,selectedNodeId:i,defaultSelectedNodeId:s,onNodeSelect:l,expandedNodeIds:d,defaultExpandedNodeIds:p,onExpandedNodeIdsChange:u,defaultPaneMode:f="split",minTreePaneWidth:b=Gx,minDetailPaneWidth:m=_x,tableAppId:v="ctree-comp",tableKey:y="default",tableTitle:g,filterConfig:x,searchQuery:h,searchToken:C,defaultRowsPerPage:P=-1,rowsPerPageOptions:w=[20,50,100,-1],serviceUrl:k,emptyLabel:R="No tree items available.",headerAction:S,sx:E,className:D})=>{let I=sr(),A=Jt.useRef(null),N=Jt.useRef(null),O=Jt.useRef(null),[F,q]=Jt.useState(s??o[0]?.id??null),[z,X]=Jt.useState(p??Mg(o).slice(0,3)),[$,_]=Jt.useState(f),[V,B]=Jt.useState(Pg),[Z,Q]=Jt.useState(0),[ge,se]=Jt.useState(0),[le,be]=Jt.useState(P),_e=Jt.useMemo(()=>n&&n.length>0?n:[{id:"label",label:"Name",render:ce=>c(ie,{spacing:.3,children:[e(L,{sx:{fontSize:15,fontWeight:700,lineHeight:1.15},children:ce.label}),ce.subtitle&&e(L,{sx:{fontSize:13,color:"text.secondary",lineHeight:1.2},children:ce.subtitle})]})}],[n]),De=Jt.useMemo(()=>new Set(d??z),[d,z]),Pe=Jt.useMemo(()=>lc(o,De),[o,De]),Ve=Jt.useMemo(()=>Ig(o),[o]),Te=Jt.useMemo(()=>Rg(o),[o]),xe=i===void 0?F:i,We=Jt.useMemo(()=>Ve.find(ce=>ce.id===xe)??null,[xe,Ve]),ot=ce=>{let fe=N.current?.clientWidth??0,ee=fe>0?Math.max(b,fe-Ms-m):Math.max(b,ce);return Math.min(Math.max(ce,b),ee)},it=$==="detail",Ze=$==="tree"||!a,U=$==="split"&&!!a,ye=(()=>{if(Z<=0)return null;if($==="tree"||!a)return {treeWidth:Z,splitterWidth:0,detailWidth:0};if($==="detail")return {treeWidth:0,splitterWidth:0,detailWidth:Z};let ce=U?Ms:0,fe=ot(V);return {treeWidth:fe,splitterWidth:ce,detailWidth:Math.max(0,Z-ce-fe)}})(),Le=ye?`${ye.treeWidth}px ${ye.splitterWidth}px ${ye.detailWidth}px`:$==="tree"||!a?"minmax(0, 1fr) 0px 0px":$==="detail"?"0px 0px minmax(0, 1fr)":`minmax(${b}px, ${V}px) ${Ms}px minmax(${m}px, 1fr)`;Jt.useEffect(()=>{let ce=N.current;if(!ce){Q(0);return}let fe=0,ee=()=>{window.cancelAnimationFrame(fe),fe=window.requestAnimationFrame(()=>{let Re=ce.clientWidth;Q(je=>Math.abs(je-Re)<.5?je:Re);});};if(ee(),typeof ResizeObserver>"u")return window.addEventListener("resize",ee),()=>{window.cancelAnimationFrame(fe),window.removeEventListener("resize",ee);};let Ie=new ResizeObserver(ee);return Ie.observe(ce),window.addEventListener("resize",ee),()=>{window.cancelAnimationFrame(fe),Ie.disconnect(),window.removeEventListener("resize",ee);}},[]);let st=ce=>{d===void 0&&X(ce),u?.(ce);},Je=ce=>{let fe=new Set(De);fe.has(ce)?fe.delete(ce):fe.add(ce),st(Array.from(fe));},vt=ce=>{i===void 0&&q(ce.id),l?.(ce);};Jt.useEffect(()=>{se(0);},[o]),Jt.useEffect(()=>{let ce=h?.trim().toLowerCase();if(!ce)return;let fe=Te.find(({node:pt})=>Tg(pt).includes(ce));if(!fe)return;let ee=new Set(De);fe.parentIds.forEach(pt=>ee.add(pt)),st(Array.from(ee)),vt(fe.node);let Re=lc(o,ee).findIndex(({node:pt})=>pt.id===fe.node.id);Re>=0&&le>0&&se(Math.floor(Re/le));let je=0,mt=0;return je=window.requestAnimationFrame(()=>{mt=window.requestAnimationFrame(()=>{let pt=A.current?.querySelector("tr.orb-selected"),Ot=pt?.closest(".orb-table-container");if(pt&&Ot){let Kt=Ot.getBoundingClientRect(),yt=pt.getBoundingClientRect(),bt=yt.top-Kt.top+Ot.scrollTop;Ot.scrollTo({top:bt-Ot.clientHeight/2+yt.height/2,behavior:"smooth"});return}pt?.scrollIntoView({block:"center",behavior:"smooth"});});}),()=>{window.cancelAnimationFrame(je),window.cancelAnimationFrame(mt);}},[h,C,Te,o,le]);let St=Jt.useMemo(()=>Pe.map(({node:ce,level:fe,hasChildren:ee})=>({...ce,id:ce.id,__node:ce,__level:fe,__hasChildren:ee,__expanded:De.has(ce.id),__searchText:Tg(ce)})),[De,Pe]),Et=Jt.useMemo(()=>_e.map((ce,fe)=>({id:ce.id,label:ce.label,minWidth:typeof ce.width=="number"?ce.width:ce.minWidth??(fe===0?320:120),numeric:ce.numeric??ce.align==="right",render:(ee,Ie)=>{let Re=Ie.__node,je=ce.render?ce.render(Re):Re[ce.id];if(fe!==0)return e(ke,{sx:{minWidth:0,color:ce.align==="right"?"text.primary":"text.secondary",fontWeight:ce.align==="right"?750:500,textAlign:ce.align??"left"},children:je});let mt=Number(Ie.__level??0),pt=!!Ie.__hasChildren,Ot=!!Ie.__expanded;return c(ie,{direction:"row",alignItems:"center",spacing:1,sx:{minWidth:0,pl:`${mt*24}px`},children:[e(ae,{tooltip:pt?Ot?"Collapse":"Expand":"",onClick:Kt=>{Kt.stopPropagation(),pt&&Je(Re.id);},disabled:!pt,sx:{width:24,height:24,visibility:pt?"visible":"hidden",transform:Ot?"rotate(0deg)":"rotate(-90deg)",transition:"transform 160ms ease"},children:e(Vr,{sx:{fontSize:20}})}),e(ke,{sx:{width:10,height:10,borderRadius:"50%",flexShrink:0,backgroundColor:Re.markerColor??I.palette.primary.main}}),e(ke,{sx:{minWidth:0},children:je})]})}})),[_e,De,I.palette.primary.main]),Lt=ce=>{if(!U)return;ce.preventDefault(),ce.currentTarget.setPointerCapture(ce.pointerId),O.current={startX:ce.clientX,startWidth:V};let fe=Ie=>{let Re=O.current;Re&&B(ot(Re.startWidth+Ie.clientX-Re.startX));},ee=()=>{O.current=null,window.removeEventListener("pointermove",fe),window.removeEventListener("pointerup",ee),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",fe),window.addEventListener("pointerup",ee);},re=()=>{let ce=N.current?.clientWidth??0,fe=ce>0?Math.max(b,(ce-Ms)/2):Pg;_("split"),B(ot(fe));},nt=()=>a?typeof a=="function"?a(We):a:null,Be=a?e(Wn,{"aria-label":"Tree pane layout",value:$,options:[{value:"tree",label:"Expand tree",icon:e(ii,{fontSize:"small"})},{value:"split",label:"Split evenly",icon:e(li,{fontSize:"small"})},{value:"detail",label:"Expand detail",icon:e(ai,{fontSize:"small"})}],onValueChange:ce=>{ce==="split"?re():_(ce);},sx:{position:"absolute",top:13,right:56,zIndex:3,backdropFilter:"blur(10px)"}}):null;return c(ke,{ref:A,className:["ctree_comp",D].filter(Boolean).join(" "),sx:{position:"relative",height:"100%",minHeight:0,border:`1px solid ${I.palette.divider}`,borderRadius:"var(--orb-r-container)",overflow:"hidden",backgroundColor:"background.paper",boxShadow:`0 18px 42px ${rt(I.palette.common.black,ht()==="dark"?.24:.08)}`,...E},children:[Be,c(ke,{ref:N,sx:{height:"100%",display:"grid",gridTemplateColumns:Le,transition:`grid-template-columns ${Nn}`,minWidth:0},children:[c(ke,{"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 ${Nn}, transform ${Nn}`,willChange:"opacity, transform"},children:[c(ie,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:2,sx:{px:2,py:1.5,minHeight:74,borderBottom:`1px solid ${I.palette.divider}`},children:[c(ie,{direction:"row",alignItems:"center",spacing:1.4,sx:{minWidth:0},children:[e(xo,{sx:{color:"primary.main",fontSize:28}}),c(ke,{sx:{minWidth:0},children:[e(L,{sx:{fontSize:20,fontWeight:750,lineHeight:1.12},noWrap:true,children:t}),r&&e(L,{sx:{fontSize:14,color:"text.secondary",mt:.3},noWrap:true,children:r})]})]}),S!==void 0?S:e(ae,{tooltip:"Add node",color:"default",children:e(Bo,{fontSize:"small"})})]}),c(ke,{sx:{flex:1,minHeight:0,overflow:"hidden"},children:[e(Jr,{appId:v,tableKey:y,title:g??(typeof t=="string"?t:"Tree"),columns:Et,rows:St,rowKey:"id",fitContainer:true,fullWidth:true,showSummary:false,selectionMode:"single",selected:xe?[xe]:[],onSelectionChange:ce=>{let fe=ce[ce.length-1],ee=Ve.find(Ie=>Ie.id===fe);ee&&vt(ee);},page:ge,rowsPerPage:le,rowsPerPageOptions:w,count:St.length,onPageChange:se,onRowsPerPageChange:ce=>{se(0),be(ce);},filterConfig:x,serviceUrl:k,graphReport:{enabled:false},disableGrouping:true,disableSorting:true,maxHeight:"100%"}),St.length===0&&e(ke,{sx:{minHeight:220,display:"grid",placeItems:"center",color:"text.secondary"},children:R})]})]}),e(ke,{"data-ctree-splitter":"true",role:"separator","aria-orientation":"vertical",onPointerDown:U?Lt:void 0,sx:{width:"100%",cursor:U?"col-resize":"default",backgroundColor:U?rt(I.palette.text.primary,ht()==="dark"?.16:.08):"transparent",opacity:U?1:0,pointerEvents:U?"auto":"none",position:"relative",transition:`opacity ${Nn}, background-color 120ms ease`,"&:hover":{backgroundColor:U?rt(I.palette.primary.main,ht()==="dark"?.35:.18):"transparent"}}}),c(ke,{"aria-hidden":Ze?true:void 0,sx:{minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column",opacity:Ze?0:1,transform:Ze?"translateX(12px)":"translateX(0)",pointerEvents:Ze?"none":"auto",transition:`opacity ${Nn}, transform ${Nn}`,willChange:"opacity, transform"},children:[e(ke,{sx:{px:2,pt:2,minHeight:74,display:"flex",alignItems:"flex-end"},children:e(At,{sx:{width:"100%"}})}),e(ke,{sx:{flex:1,minHeight:0,overflow:"auto",px:2,pb:2},children:nt()})]})]})]})};T();var Xx={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)"}}},M5=({children:t,transitionKey:r,variant:o="fade",durationMs:n=220,delayMs:a=0,easing:i="cubic-bezier(0.22, 1, 0.36, 1)",disabled:s=false,sx:l})=>{let d=Co("(prefers-reduced-motion: reduce)"),[p,u]=Jt.useState("to"),f=!s&&!d&&o!=="none";Jt.useEffect(()=>{if(!f){u("to");return}u("from");let v=requestAnimationFrame(()=>{v=requestAnimationFrame(()=>{u("to");});});return ()=>cancelAnimationFrame(v)},[r,f]);let b=Xx[o],m=Jt.useMemo(()=>f?p==="from"?b.from:b.to:{opacity:1,transform:"none"},[f,p,b.from,b.to]);return e(ke,{sx:{willChange:f?"opacity, transform":"auto",transition:f?`opacity ${n}ms ${i} ${a}ms, transform ${n}ms ${i} ${a}ms`:"none",backfaceVisibility:"hidden",...m,...l},children:t})},D5={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};exports.AIBrowserGlow=nz;exports.Activity=Cc;exports.AgentPanel=Lm;exports.AlertCircle=ka;exports.AlertTriangle=xc;exports.ArrowDown=x0;exports.ArrowRight=S0;exports.ArrowUp=Sc;exports.BarChart=Ls;exports.Bot=w0;exports.Button=$s;exports.CAINavProvider=Py;exports.CAlert=tn;exports.CAmapChart=Ep;exports.CAppHeader=Wi;exports.CAppHeaderSearch=xl;exports.CAppPageLayout=ZA;exports.CAuthPage=Tz;exports.CAvatar=en;exports.CBadge=Va;exports.CBarChart=ea;exports.CButton=Ce;exports.CCalendar=Gn;exports.CCardDetailPanel=Xp;exports.CCardGrid=Zp;exports.CCardGridCard=Th;exports.CCardPage=TD;exports.CChartCard=Ci;exports.CCheckbox=Dt;exports.CChip=Pt;exports.CComboChart=Rp;exports.CCustomizeAgent=Op;exports.CDatePicker=_f;exports.CDetailInfoPage=XN;exports.CDetailSearchAiBar=nu;exports.CDetailSectionCard=Fi;exports.CDialog=zt;exports.CDivider=At;exports.CFileUpload=Kf;exports.CFilterField=lT;exports.CFishboneChart=Dp;exports.CGoogleMapChart=Ap;exports.CGraphCharts=Lp;exports.CGraphKpiCards=Tp;exports.CGraphReport=ki;exports.CHeatmapChart=Mp;exports.CIconButton=ae;exports.CKanbanBoard=SA;exports.CKanbanBucket=cu;exports.CKanbanCard=fl;exports.CLayoutManagement=_p;exports.CLayoutManager=gn;exports.CLineChart=Ip;exports.CList=JP;exports.CListItem=eT;exports.CListItemAvatar=aT;exports.CListItemButton=tT;exports.CListItemIcon=rT;exports.CListItemText=oT;exports.CListSubheader=nT;exports.CMenu=jt;exports.CMessageBox=Yn;exports.CMetricChartCard=ms;exports.COrbCanvas=fy;exports.CPageLayout=pi;exports.CPageTransition=M5;exports.CPaper=Ee;exports.CPieChart=xi;exports.CPivotTable=HL;exports.CPlanningGantt=kg;exports.CPlanningLayout=m5;exports.CPopover=zs;exports.CProgress=Vn;exports.CRadioGroup=bf;exports.CSegmentedControl=Wn;exports.CSelect=Wt;exports.CSkeleton=wf;exports.CSmartFilter=Wr;exports.CSmartTable=UM;exports.CSpinner=Xr;exports.CStack=ie;exports.CStandardPage=QM;exports.CStatusBadge=ZP;exports.CSwitch=za;exports.CTable=Jr;exports.CTableBody=VM;exports.CTableCell=WM;exports.CTableContainer=$M;exports.CTableHead=GM;exports.CTableRow=_M;exports.CTabs=Vf;exports.CTextArea=zn;exports.CTextField=ze;exports.CTooltip=lt;exports.CTreeComp=k5;exports.CTypography=L;exports.CValueHelp=hp;exports.CVariantManagement=Ri;exports.CVariantManager=zp;exports.CVoiceWaveOverlay=Nl;exports.CWaterfallChart=Np;exports.Calendar=Os;exports.CalendarDays=k0;exports.Camera=P0;exports.ChartNoAxesCombined=T0;exports.Check=qr;exports.CheckCircle=Pa;exports.ChevronDown=Fr;exports.ChevronLeft=Ta;exports.ChevronRight=Br;exports.ChevronUp=I0;exports.ChevronsDown=R0;exports.ChevronsUp=M0;exports.CircleAlert=Ia;exports.CircleCheck=On;exports.CircleCheckBig=D0;exports.CircleStop=wc;exports.Clipboard=kc;exports.ClipboardCheck=N0;exports.ClipboardList=A0;exports.Clock=Pc;exports.CodeBlock=ia;exports.Columns3=E0;exports.CopilotChat=tz;exports.Copy=ho;exports.CopyPlus=L0;exports.Delete=O0;exports.Download=F0;exports.Edit=Tc;exports.Expand=Ic;exports.Eye=B0;exports.EyeOff=H0;exports.File=Ra;exports.FileText=Rc;exports.Filter=z0;exports.FloatingAgentPanel=qH;exports.FolderTree=Fn;exports.GitBranch=Mc;exports.GlobalMessage=UP;exports.Globe=Bn;exports.Grid=Dc;exports.GripVertical=V0;exports.Hammer=W0;exports.Image=Nc;exports.Info=Ma;exports.InputArea=zl;exports.Languages=$0;exports.Layers=G0;exports.LayoutDashboard=_0;exports.Lightbulb=Da;exports.LineChart=Ac;exports.Loader2=Ec;exports.Lock=Na;exports.LockKeyhole=U0;exports.LogOut=Lc;exports.METRIC_CHART_TYPES=us;exports.Mail=Fs;exports.MapPin=Oc;exports.MarkdownRenderer=ca;exports.MathBlock=sa;exports.Menu=K0;exports.MermaidBlock=sl;exports.MessageCircle=Qg;exports.MessageSquare=Fc;exports.Mic=Aa;exports.MicOff=q0;exports.Moon=Bc;exports.MoreHorizontal=X0;exports.NavigationIsland=od;exports.NavigationIsland2=Us;exports.OMPHPanel=VH;exports.ORBCAFE_I18N_MESSAGES=Un;exports.ORB_DARK=Eg;exports.ORB_FONT_STACK=Zx;exports.ORB_LIGHT=Ag;exports.ORB_RADIUS=Qx;exports.ORB_TOKENS=Ns;exports.ORB_TRANSITION_FAST=Jx;exports.OrbcafeI18nProvider=Ga;exports.OrbisModeProvider=Ln;exports.PAGE_TRANSITION_PRESETS=D5;exports.PAppPageLayout=p2;exports.PBarcodeScanner=rO;exports.PNavIsland=nm;exports.PNumericKeypad=hO;exports.PSmartFilter=Ju;exports.PTable=ly;exports.PTouchCard=cO;exports.PWorkloadNav=em;exports.PackageCheck=Y0;exports.PackageSearch=Z0;exports.PanelLeftOpen=Ea;exports.PanelRight=La;exports.PanelsTopLeft=j0;exports.PieChart=Hc;exports.Pin=Qo;exports.PivotChartPanel=_u;exports.Play=Q0;exports.Plus=Oa;exports.QrCode=J0;exports.ReceiptText=eS;exports.RefreshCw=Fa;exports.Rocket=tS;exports.RotateCcw=rS;exports.RotateCw=zc;exports.Rows3=oS;exports.SapIcon=Mt;exports.Save=nS;exports.ScanLine=aS;exports.Search=Hr;exports.Send=Jg;exports.SendHorizontal=Vc;exports.Settings=Jo;exports.ShieldCheck=iS;exports.Sigma=sS;exports.SortAsc=lS;exports.SquareSplitHorizontal=cS;exports.Star=dS;exports.StdChat=Am;exports.Sun=Wc;exports.Table2=pS;exports.TableBlock=cl;exports.TabletSmartphone=uS;exports.Terminal=Hn;exports.ThinkBlock=Li;exports.ThumbsDown=$c;exports.ThumbsUp=Gc;exports.Trash2=_c;exports.TreeMenu=Kn;exports.TreePine=mS;exports.TrendingDown=Uc;exports.TriangleAlert=Ba;exports.Truck=gS;exports.UploadCloud=Kc;exports.User=Bs;exports.VoiceNavigatorProvider=P2;exports.VoiceWaveOverlay=y2;exports.Volume2=qc;exports.Warehouse=fS;exports.Workflow=bS;exports.X=Zt;exports.XCircle=Ha;exports.addKanbanBucket=du;exports.buildAmapEmbedUrl=Si;exports.buildGoogleMapEmbedUrl=ta;exports.buildGoogleMapIframe=FR;exports.buttonVariants=jf;exports.createKanbanBoardModel=uu;exports.createSapIcon=ne;exports.findKanbanCard=Gr;exports.message=BP;exports.messageManager=ao;exports.moveKanbanCard=zi;exports.orbAlpha=rt;exports.orbChartSeries=jx;exports.parseMarkdownTable=Ei;exports.parseOmphFileHref=Wl;exports.renameKanbanBucket=pu;exports.renderMarkdown=CN;exports.resolveVariantFilters=Ni;exports.resolveVariantLayout=Ai;exports.useAINav=Ty;exports.useAmapEmbedUrl=VD;exports.useAuthPage=hz;exports.useCardPage=ND;exports.useDetailInfo=iu;exports.useGoogleMapEmbedUrl=zD;exports.useGraphChartData=LD;exports.useGraphInteraction=Ti;exports.useGraphReport=pn;exports.useKanbanBoard=IA;exports.useMediaQuery=Dr;exports.useNavigationIsland=cd;exports.useOrbMode=yr;exports.useOrbTokens=Es;exports.useOrbcafeI18n=pe;exports.usePadLayout=qL;exports.usePadRecordEditor=ZL;exports.usePageLayout=yu;exports.usePivotTable=GL;exports.usePlanningGantt=vg;exports.usePlanningLayout=Lz;exports.useStandardReport=nD;exports.useVoiceInput=Cn;exports.useVoiceNavigator=T2;