@texturehq/edges 2.2.3 → 2.2.5

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.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';var reactAriaComponents=require('react-aria-components'),He=require('react'),Lw=require('papaparse'),luxon=require('luxon'),zw=require('fuse.js'),reactVirtual=require('@tanstack/react-virtual'),jsxRuntime=require('react/jsx-runtime'),tailwindMerge=require('tailwind-merge'),zb=require('@phosphor-icons/react'),oN=require('@phosphor-icons/react/ssr'),reactStately=require('react-stately'),lucideReact=require('lucide-react'),framerMotion=require('framer-motion'),IP=require('react-ace'),reactColorful=require('react-colorful'),curve=require('@visx/curve'),shape=require('@visx/shape'),gradient=require('@visx/gradient'),scale=require('@visx/scale'),d3Array=require('d3-array'),axis=require('@visx/axis'),responsive=require('@visx/responsive'),zoom=require('@visx/zoom'),brush=require('@visx/brush'),pattern=require('@visx/pattern'),core=require('@dnd-kit/core'),sortable=require('@dnd-kit/sortable'),utilities=require('@dnd-kit/utilities'),reactDom=require('react-dom'),PA=require('react-map-gl'),server=require('react-dom/server'),VI=require('@tiptap/extension-link'),react=require('@tiptap/react'),menus=require('@tiptap/react/menus'),WI=require('@tiptap/starter-kit');var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;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 He__namespace=/*#__PURE__*/_interopNamespace(He);var Lw__default=/*#__PURE__*/_interopDefault(Lw);var zw__default=/*#__PURE__*/_interopDefault(zw);var zb__namespace=/*#__PURE__*/_interopNamespace(zb);var oN__namespace=/*#__PURE__*/_interopNamespace(oN);var IP__default=/*#__PURE__*/_interopDefault(IP);var PA__default=/*#__PURE__*/_interopDefault(PA);var VI__default=/*#__PURE__*/_interopDefault(VI);var WI__default=/*#__PURE__*/_interopDefault(WI);var J1=Object.create;var hu=Object.defineProperty;var $1=Object.getOwnPropertyDescriptor;var X1=Object.getOwnPropertyNames;var Z1=Object.getPrototypeOf,Q1=Object.prototype.hasOwnProperty;var _1=(e,t,r)=>t in e?hu(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r;var Lr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ew=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of X1(t))!Q1.call(e,n)&&n!==r&&hu(e,n,{get:()=>t[n],enumerable:!(o=$1(t,n))||o.enumerable});return e};var fl=(e,t,r)=>(r=e!=null?J1(Z1(e)):{},ew(t||!e||!e.__esModule?hu(r,"default",{value:e,enumerable:true}):r,e));var Yi=(e,t,r)=>_1(e,typeof t!="symbol"?t+"":t,r);var Cu=Lr((yu,vu)=>{(function(e,t){typeof define=="function"&&define.amd?define([],t):typeof yu<"u"?t():(t(),e.FileSaver={});})(yu,function(){function e(s,c){return typeof c>"u"?c={autoBom:false}:typeof c!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),c={autoBom:!c}),c.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(s.type)?new Blob(["\uFEFF",s],{type:s.type}):s}function t(s,c,l){var d=new XMLHttpRequest;d.open("GET",s),d.responseType="blob",d.onload=function(){i(d.response,c,l);},d.onerror=function(){console.error("could not download file");},d.send();}function r(s){var c=new XMLHttpRequest;c.open("HEAD",s,false);try{c.send();}catch{}return 200<=c.status&&299>=c.status}function o(s){try{s.dispatchEvent(new MouseEvent("click"));}catch{var c=document.createEvent("MouseEvents");c.initMouseEvent("click",true,true,window,0,0,0,80,20,false,false,false,false,0,null),s.dispatchEvent(c);}}var n=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:void 0,a=n.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),i=n.saveAs||(typeof window!="object"||window!==n?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(s,c,l){var d=n.URL||n.webkitURL,u=document.createElement("a");c=c||s.name||"download",u.download=c,u.rel="noopener",typeof s=="string"?(u.href=s,u.origin===location.origin?o(u):r(u.href)?t(s,c,l):o(u,u.target="_blank")):(u.href=d.createObjectURL(s),setTimeout(function(){d.revokeObjectURL(u.href);},4e4),setTimeout(function(){o(u);},0));}:"msSaveOrOpenBlob"in navigator?function(s,c,l){if(c=c||s.name||"download",typeof s!="string")navigator.msSaveOrOpenBlob(e(s,l),c);else if(r(s))t(s,c,l);else {var d=document.createElement("a");d.href=s,d.target="_blank",setTimeout(function(){o(d);});}}:function(s,c,l,d){if(d=d||open("","_blank"),d&&(d.document.title=d.document.body.innerText="downloading..."),typeof s=="string")return t(s,c,l);var u=s.type==="application/octet-stream",p=/constructor/i.test(n.HTMLElement)||n.safari,m=/CriOS\/[\d]+/.test(navigator.userAgent);if((m||u&&p||a)&&typeof FileReader<"u"){var f=new FileReader;f.onloadend=function(){var x=f.result;x=m?x:x.replace(/^data:[^;]*;/,"data:attachment/file;"),d?d.location.href=x:location=x,d=null;},f.readAsDataURL(s);}else {var g=n.URL||n.webkitURL,b=g.createObjectURL(s);d?d.location=b:location.href=b,d=null,setTimeout(function(){g.revokeObjectURL(b);},4e4);}});n.saveAs=i.saveAs=i,typeof vu<"u"&&(vu.exports=i);});});var Xh=Lr(Ye=>{var Dt=typeof Symbol=="function"&&Symbol.for,Em=Dt?Symbol.for("react.element"):60103,Lm=Dt?Symbol.for("react.portal"):60106,yc=Dt?Symbol.for("react.fragment"):60107,vc=Dt?Symbol.for("react.strict_mode"):60108,Cc=Dt?Symbol.for("react.profiler"):60114,Sc=Dt?Symbol.for("react.provider"):60109,wc=Dt?Symbol.for("react.context"):60110,Am=Dt?Symbol.for("react.async_mode"):60111,Tc=Dt?Symbol.for("react.concurrent_mode"):60111,Nc=Dt?Symbol.for("react.forward_ref"):60112,kc=Dt?Symbol.for("react.suspense"):60113,gR=Dt?Symbol.for("react.suspense_list"):60120,Pc=Dt?Symbol.for("react.memo"):60115,Rc=Dt?Symbol.for("react.lazy"):60116,bR=Dt?Symbol.for("react.block"):60121,xR=Dt?Symbol.for("react.fundamental"):60117,hR=Dt?Symbol.for("react.responder"):60118,yR=Dt?Symbol.for("react.scope"):60119;function wr(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Em:switch(e=e.type,e){case Am:case Tc:case yc:case Cc:case vc:case kc:return e;default:switch(e=e&&e.$$typeof,e){case wc:case Nc:case Rc:case Pc:case Sc:return e;default:return t}}case Lm:return t}}}function $h(e){return wr(e)===Tc}Ye.AsyncMode=Am;Ye.ConcurrentMode=Tc;Ye.ContextConsumer=wc;Ye.ContextProvider=Sc;Ye.Element=Em;Ye.ForwardRef=Nc;Ye.Fragment=yc;Ye.Lazy=Rc;Ye.Memo=Pc;Ye.Portal=Lm;Ye.Profiler=Cc;Ye.StrictMode=vc;Ye.Suspense=kc;Ye.isAsyncMode=function(e){return $h(e)||wr(e)===Am};Ye.isConcurrentMode=$h;Ye.isContextConsumer=function(e){return wr(e)===wc};Ye.isContextProvider=function(e){return wr(e)===Sc};Ye.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Em};Ye.isForwardRef=function(e){return wr(e)===Nc};Ye.isFragment=function(e){return wr(e)===yc};Ye.isLazy=function(e){return wr(e)===Rc};Ye.isMemo=function(e){return wr(e)===Pc};Ye.isPortal=function(e){return wr(e)===Lm};Ye.isProfiler=function(e){return wr(e)===Cc};Ye.isStrictMode=function(e){return wr(e)===vc};Ye.isSuspense=function(e){return wr(e)===kc};Ye.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===yc||e===Tc||e===Cc||e===vc||e===kc||e===gR||typeof e=="object"&&e!==null&&(e.$$typeof===Rc||e.$$typeof===Pc||e.$$typeof===Sc||e.$$typeof===wc||e.$$typeof===Nc||e.$$typeof===xR||e.$$typeof===hR||e.$$typeof===yR||e.$$typeof===bR)};Ye.typeOf=wr;});var Zh=Lr(Ke=>{process.env.NODE_ENV!=="production"&&(function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,n=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,f=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,x=e?Symbol.for("react.responder"):60118,h=e?Symbol.for("react.scope"):60119;function y(L){return typeof L=="string"||typeof L=="function"||L===o||L===l||L===a||L===n||L===u||L===p||typeof L=="object"&&L!==null&&(L.$$typeof===f||L.$$typeof===m||L.$$typeof===i||L.$$typeof===s||L.$$typeof===d||L.$$typeof===b||L.$$typeof===x||L.$$typeof===h||L.$$typeof===g)}function v(L){if(typeof L=="object"&&L!==null){var oe=L.$$typeof;switch(oe){case t:var ie=L.type;switch(ie){case c:case l:case o:case a:case n:case u:return ie;default:var ne=ie&&ie.$$typeof;switch(ne){case s:case d:case f:case m:case i:return ne;default:return oe}}case r:return oe}}}var S=c,w=l,N=s,D=i,R=t,A=d,O=o,P=f,T=m,k=r,V=a,H=n,I=u,q=false;function j(L){return q||(q=true,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),K(L)||v(L)===c}function K(L){return v(L)===l}function Y(L){return v(L)===s}function M(L){return v(L)===i}function E(L){return typeof L=="object"&&L!==null&&L.$$typeof===t}function z(L){return v(L)===d}function B(L){return v(L)===o}function C(L){return v(L)===f}function W(L){return v(L)===m}function G(L){return v(L)===r}function F(L){return v(L)===a}function Z(L){return v(L)===n}function _(L){return v(L)===u}Ke.AsyncMode=S,Ke.ConcurrentMode=w,Ke.ContextConsumer=N,Ke.ContextProvider=D,Ke.Element=R,Ke.ForwardRef=A,Ke.Fragment=O,Ke.Lazy=P,Ke.Memo=T,Ke.Portal=k,Ke.Profiler=V,Ke.StrictMode=H,Ke.Suspense=I,Ke.isAsyncMode=j,Ke.isConcurrentMode=K,Ke.isContextConsumer=Y,Ke.isContextProvider=M,Ke.isElement=E,Ke.isForwardRef=z,Ke.isFragment=B,Ke.isLazy=C,Ke.isMemo=W,Ke.isPortal=G,Ke.isProfiler=F,Ke.isStrictMode=Z,Ke.isSuspense=_,Ke.isValidElementType=y,Ke.typeOf=v;})();});var Fm=Lr((yK,Im)=>{process.env.NODE_ENV==="production"?Im.exports=Xh():Im.exports=Zh();});var ey=Lr((vK,_h)=>{var Qh=Object.getOwnPropertySymbols,vR=Object.prototype.hasOwnProperty,CR=Object.prototype.propertyIsEnumerable;function SR(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function wR(){try{if(!Object.assign)return !1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return !1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;var o=Object.getOwnPropertyNames(t).map(function(a){return t[a]});if(o.join("")!=="0123456789")return !1;var n={};return "abcdefghijklmnopqrst".split("").forEach(function(a){n[a]=a;}),Object.keys(Object.assign({},n)).join("")==="abcdefghijklmnopqrst"}catch{return false}}_h.exports=wR()?Object.assign:function(e,t){for(var r,o=SR(e),n,a=1;a<arguments.length;a++){r=Object(arguments[a]);for(var i in r)vR.call(r,i)&&(o[i]=r[i]);if(Qh){n=Qh(r);for(var s=0;s<n.length;s++)CR.call(r,n[s])&&(o[n[s]]=r[n[s]]);}}return o};});var Mc=Lr((CK,ty)=>{var TR="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";ty.exports=TR;});var Bm=Lr((SK,ry)=>{ry.exports=Function.call.bind(Object.prototype.hasOwnProperty);});var sy=Lr((wK,iy)=>{var Vm=function(){};process.env.NODE_ENV!=="production"&&(oy=Mc(),Dc={},ny=Bm(),Vm=function(e){var t="Warning: "+e;typeof console<"u"&&console.error(t);try{throw new Error(t)}catch{}});var oy,Dc,ny;function ay(e,t,r,o,n){if(process.env.NODE_ENV!=="production"){for(var a in e)if(ny(e,a)){var i;try{if(typeof e[a]!="function"){var s=Error((o||"React class")+": "+r+" type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[a]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw s.name="Invariant Violation",s}i=e[a](t,a,o,r,null,oy);}catch(l){i=l;}if(i&&!(i instanceof Error)&&Vm((o||"React class")+": type specification of "+r+" `"+a+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof i+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),i instanceof Error&&!(i.message in Dc)){Dc[i.message]=true;var c=n?n():"";Vm("Failed "+r+" type: "+i.message+(c??""));}}}}ay.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(Dc={});};iy.exports=ay;});var dy=Lr((TK,cy)=>{var NR=Fm(),kR=ey(),ii=Mc(),Om=Bm(),ly=sy(),si=function(){};process.env.NODE_ENV!=="production"&&(si=function(e){var t="Warning: "+e;typeof console<"u"&&console.error(t);try{throw new Error(t)}catch{}});function Ec(){return null}cy.exports=function(e,t){var r=typeof Symbol=="function"&&Symbol.iterator,o="@@iterator";function n(T){var k=T&&(r&&T[r]||T[o]);if(typeof k=="function")return k}var a="<<anonymous>>",i={array:d("array"),bigint:d("bigint"),bool:d("boolean"),func:d("function"),number:d("number"),object:d("object"),string:d("string"),symbol:d("symbol"),any:u(),arrayOf:p,element:m(),elementType:f(),instanceOf:g,node:y(),objectOf:x,oneOf:b,oneOfType:h,shape:S,exact:w};function s(T,k){return T===k?T!==0||1/T===1/k:T!==T&&k!==k}function c(T,k){this.message=T,this.data=k&&typeof k=="object"?k:{},this.stack="";}c.prototype=Error.prototype;function l(T){if(process.env.NODE_ENV!=="production")var k={},V=0;function H(q,j,K,Y,M,E,z){if(Y=Y||a,E=E||K,z!==ii){if(t){var B=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw B.name="Invariant Violation",B}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var C=Y+":"+K;!k[C]&&V<3&&(si("You are manually calling a React.PropTypes validation function for the `"+E+"` prop on `"+Y+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),k[C]=true,V++);}}return j[K]==null?q?j[K]===null?new c("The "+M+" `"+E+"` is marked as required "+("in `"+Y+"`, but its value is `null`.")):new c("The "+M+" `"+E+"` is marked as required in "+("`"+Y+"`, but its value is `undefined`.")):null:T(j,K,Y,M,E)}var I=H.bind(null,false);return I.isRequired=H.bind(null,true),I}function d(T){function k(V,H,I,q,j,K){var Y=V[H],M=R(Y);if(M!==T){var E=A(Y);return new c("Invalid "+q+" `"+j+"` of type "+("`"+E+"` supplied to `"+I+"`, expected ")+("`"+T+"`."),{expectedType:T})}return null}return l(k)}function u(){return l(Ec)}function p(T){function k(V,H,I,q,j){if(typeof T!="function")return new c("Property `"+j+"` of component `"+I+"` has invalid PropType notation inside arrayOf.");var K=V[H];if(!Array.isArray(K)){var Y=R(K);return new c("Invalid "+q+" `"+j+"` of type "+("`"+Y+"` supplied to `"+I+"`, expected an array."))}for(var M=0;M<K.length;M++){var E=T(K,M,I,q,j+"["+M+"]",ii);if(E instanceof Error)return E}return null}return l(k)}function m(){function T(k,V,H,I,q){var j=k[V];if(!e(j)){var K=R(j);return new c("Invalid "+I+" `"+q+"` of type "+("`"+K+"` supplied to `"+H+"`, expected a single ReactElement."))}return null}return l(T)}function f(){function T(k,V,H,I,q){var j=k[V];if(!NR.isValidElementType(j)){var K=R(j);return new c("Invalid "+I+" `"+q+"` of type "+("`"+K+"` supplied to `"+H+"`, expected a single ReactElement type."))}return null}return l(T)}function g(T){function k(V,H,I,q,j){if(!(V[H]instanceof T)){var K=T.name||a,Y=P(V[H]);return new c("Invalid "+q+" `"+j+"` of type "+("`"+Y+"` supplied to `"+I+"`, expected ")+("instance of `"+K+"`."))}return null}return l(k)}function b(T){if(!Array.isArray(T))return process.env.NODE_ENV!=="production"&&(arguments.length>1?si("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):si("Invalid argument supplied to oneOf, expected an array.")),Ec;function k(V,H,I,q,j){for(var K=V[H],Y=0;Y<T.length;Y++)if(s(K,T[Y]))return null;var M=JSON.stringify(T,function(z,B){var C=A(B);return C==="symbol"?String(B):B});return new c("Invalid "+q+" `"+j+"` of value `"+String(K)+"` "+("supplied to `"+I+"`, expected one of "+M+"."))}return l(k)}function x(T){function k(V,H,I,q,j){if(typeof T!="function")return new c("Property `"+j+"` of component `"+I+"` has invalid PropType notation inside objectOf.");var K=V[H],Y=R(K);if(Y!=="object")return new c("Invalid "+q+" `"+j+"` of type "+("`"+Y+"` supplied to `"+I+"`, expected an object."));for(var M in K)if(Om(K,M)){var E=T(K,M,I,q,j+"."+M,ii);if(E instanceof Error)return E}return null}return l(k)}function h(T){if(!Array.isArray(T))return process.env.NODE_ENV!=="production"&&si("Invalid argument supplied to oneOfType, expected an instance of array."),Ec;for(var k=0;k<T.length;k++){var V=T[k];if(typeof V!="function")return si("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+O(V)+" at index "+k+"."),Ec}function H(I,q,j,K,Y){for(var M=[],E=0;E<T.length;E++){var z=T[E],B=z(I,q,j,K,Y,ii);if(B==null)return null;B.data&&Om(B.data,"expectedType")&&M.push(B.data.expectedType);}var C=M.length>0?", expected one of type ["+M.join(", ")+"]":"";return new c("Invalid "+K+" `"+Y+"` supplied to "+("`"+j+"`"+C+"."))}return l(H)}function y(){function T(k,V,H,I,q){return N(k[V])?null:new c("Invalid "+I+" `"+q+"` supplied to "+("`"+H+"`, expected a ReactNode."))}return l(T)}function v(T,k,V,H,I){return new c((T||"React class")+": "+k+" type `"+V+"."+H+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+I+"`.")}function S(T){function k(V,H,I,q,j){var K=V[H],Y=R(K);if(Y!=="object")return new c("Invalid "+q+" `"+j+"` of type `"+Y+"` "+("supplied to `"+I+"`, expected `object`."));for(var M in T){var E=T[M];if(typeof E!="function")return v(I,q,j,M,A(E));var z=E(K,M,I,q,j+"."+M,ii);if(z)return z}return null}return l(k)}function w(T){function k(V,H,I,q,j){var K=V[H],Y=R(K);if(Y!=="object")return new c("Invalid "+q+" `"+j+"` of type `"+Y+"` "+("supplied to `"+I+"`, expected `object`."));var M=kR({},V[H],T);for(var E in M){var z=T[E];if(Om(T,E)&&typeof z!="function")return v(I,q,j,E,A(z));if(!z)return new c("Invalid "+q+" `"+j+"` key `"+E+"` supplied to `"+I+"`.\nBad object: "+JSON.stringify(V[H],null," ")+`
2
2
  Valid keys: `+JSON.stringify(Object.keys(T),null," "));var B=z(K,E,I,q,j+"."+E,ii);if(B)return B}return null}return l(k)}function N(T){switch(typeof T){case "number":case "string":case "undefined":return true;case "boolean":return !T;case "object":if(Array.isArray(T))return T.every(N);if(T===null||e(T))return true;var k=n(T);if(k){var V=k.call(T),H;if(k!==T.entries){for(;!(H=V.next()).done;)if(!N(H.value))return false}else for(;!(H=V.next()).done;){var I=H.value;if(I&&!N(I[1]))return false}}else return false;return true;default:return false}}function D(T,k){return T==="symbol"?true:k?k["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&k instanceof Symbol:false}function R(T){var k=typeof T;return Array.isArray(T)?"array":T instanceof RegExp?"object":D(k,T)?"symbol":k}function A(T){if(typeof T>"u"||T===null)return ""+T;var k=R(T);if(k==="object"){if(T instanceof Date)return "date";if(T instanceof RegExp)return "regexp"}return k}function O(T){var k=A(T);switch(k){case "array":case "object":return "an "+k;case "boolean":case "date":case "regexp":return "a "+k;default:return k}}function P(T){return !T.constructor||!T.constructor.name?a:T.constructor.name}return i.checkPropTypes=ly,i.resetWarningCache=ly.resetWarningCache,i.PropTypes=i,i};});var fy=Lr((NK,my)=>{var PR=Mc();function uy(){}function py(){}py.resetWarningCache=uy;my.exports=function(){function e(o,n,a,i,s,c){if(c!==PR){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}e.isRequired=e;function t(){return e}var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:py,resetWarningCache:uy};return r.PropTypes=r,r};});var xy=Lr((kK,zm)=>{process.env.NODE_ENV!=="production"?(gy=Fm(),by=true,zm.exports=dy()(gy.isElement,by)):zm.exports=fy()();var gy,by;});var hy=Lr((PK,Lc)=>{(function(){var e={}.hasOwnProperty;function t(){for(var n="",a=0;a<arguments.length;a++){var i=arguments[a];i&&(n=o(n,r(i)));}return n}function r(n){if(typeof n=="string"||typeof n=="number")return n;if(typeof n!="object")return "";if(Array.isArray(n))return t.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var a="";for(var i in n)e.call(n,i)&&n[i]&&(a=o(a,i));return a}function o(n,a){return a?n?n+" "+a:n+a:n}typeof Lc<"u"&&Lc.exports?(t.default=t,Lc.exports=t):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return t}):window.classNames=t;})();});function Qt(e,t=false){let[r,o]=He.useState(t);return He.useEffect(()=>{if(typeof window>"u")return;let n=window.matchMedia(e);o(n.matches);let a=i=>{o(i.matches);};return n.addEventListener("change",a),()=>{n.removeEventListener("change",a);}},[e]),r}var In={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"};function _t(e="base"){let t=Qt(`(min-width: ${In.sm})`,e!=="base"),r=Qt(`(min-width: ${In.md})`,["md","lg","xl","2xl"].includes(e)),o=Qt(`(min-width: ${In.lg})`,["lg","xl","2xl"].includes(e)),n=Qt(`(min-width: ${In.xl})`,["xl","2xl"].includes(e)),a=Qt(`(min-width: ${In["2xl"]})`,e==="2xl"),i=!r,s=r,c="base";return a?c="2xl":n?c="xl":o?c="lg":r?c="md":t&&(c="sm"),{current:c,isSm:t,isMd:r,isLg:o,isXl:n,is2Xl:a,isMobile:i,isDesktop:s}}var wl=fl(Cu(),1);var Su=class{constructor(){Yi(this,"formatters",new Map);}register(t,r){this.formatters.set(t,r);}format(t,r,...o){let n=this.formatters.get(t);return n?n(r,...o):(console.warn(`No formatter registered for key: ${t}`),null)}has(t){return this.formatters.has(t)}keys(){return Array.from(this.formatters.keys())}unregister(t){this.formatters.delete(t);}clear(){this.formatters.clear();}},se=new Su;var $o=(e,t="Yes",r="No")=>e==null?null:e?t:r,ow=e=>$o(e,"Enabled","Disabled"),nw=e=>$o(e,"On","Off"),aw=e=>$o(e,"Active","Inactive"),iw=e=>$o(e,"True","False"),sw=e=>$o(e,"\u2713","\u2717"),Xo=e=>{if(e==null)return null;if(typeof e=="boolean")return e;if(typeof e=="string"){let t=e.toLowerCase().trim();return t==="true"||t==="yes"||t==="1"||t==="on"||t==="enabled"?true:t==="false"||t==="no"||t==="0"||t==="off"||t==="disabled"?false:null}return typeof e=="number"?e!==0:null},Ig=(e,t)=>{if(t.hideWhenNull&&e==null)return null;if(e==null)return t.nullText??null;let r=Xo(e);return r===null?t.nullText??null:$o(r,t.trueText??"Yes",t.falseText??"No")};se.register("boolean",(e,t,r)=>{let o=Xo(e);return o!==null?$o(o,typeof t=="string"?t:"Yes",typeof r=="string"?r:"No"):null});se.register("yesNo",e=>{let t=Xo(e);return t!==null?$o(t,"Yes","No"):null});se.register("enabledDisabled",e=>{let t=Xo(e);return t!==null?ow(t):null});se.register("onOff",e=>{let t=Xo(e);return t!==null?nw(t):null});se.register("activeInactive",e=>{let t=Xo(e);return t!==null?aw(t):null});se.register("trueFalse",e=>{let t=Xo(e);return t!==null?iw(t):null});se.register("checkmark",e=>{let t=Xo(e);return t!==null?sw(t):null});var pe=e=>e==null,Fg=(e,t=0)=>pe(e)?null:`${e.toFixed(t)}%`,Bg=(e,t=0)=>Fg(e,t)??"\u2014",lw=e=>pe(e)?null:Math.round(e).toString(),cw=(e,t=1)=>pe(e)?null:e.toFixed(t),dw=(e,t,r=true)=>{if(pe(e))return null;let o={useGrouping:r};return t!==void 0&&(o.minimumFractionDigits=t,o.maximumFractionDigits=t),new Intl.NumberFormat("en-US",o).format(e)},uw=(e,t="short")=>pe(e)?null:new Intl.NumberFormat("en-US",{notation:"compact",compactDisplay:t}).format(e),pw=(e,t=2)=>pe(e)?null:e.toExponential(t),Vg=(e,t="USD",r)=>{if(pe(e))return null;let o={style:"currency",currency:t,currencyDisplay:r?.currencyDisplay??"symbol",useGrouping:r?.thousandsSeparator??true};return r?.minimumFractionDigits!==void 0&&(o.minimumFractionDigits=r.minimumFractionDigits),r?.maximumFractionDigits!==void 0&&(o.maximumFractionDigits=r.maximumFractionDigits),new Intl.NumberFormat("en-US",o).format(e)},Og=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o={useGrouping:t.thousandsSeparator??false};return t.decimals!==void 0&&(o.minimumFractionDigits=t.decimals,o.maximumFractionDigits=t.decimals),t.notation&&(o.notation=t.notation,t.notation==="compact"&&t.compactDisplay&&(o.compactDisplay=t.compactDisplay)),t.sign&&(o.signDisplay=t.sign),new Intl.NumberFormat("en-US",o).format(r)},zg=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);return isNaN(r)?t.nullText??null:Vg(r,t.currency,t)};se.register("percentage",(e,t)=>typeof e=="number"?Fg(e,typeof t=="number"?t:0):null);se.register("integer",e=>typeof e=="number"?lw(e):null);se.register("float",(e,t)=>typeof e=="number"?cw(e,typeof t=="number"?t:1):null);se.register("number",(e,t,r)=>{let o=typeof e=="string"?parseFloat(e):Number(e);return isNaN(o)?null:dw(o,typeof t=="number"?t:void 0,typeof r=="boolean"?r:true)});se.register("compact",(e,t)=>typeof e=="number"?uw(e,t==="long"?"long":"short"):null);se.register("scientific",(e,t)=>typeof e=="number"?pw(e,typeof t=="number"?t:2):null);se.register("currency",(e,t,r)=>typeof e=="number"?Vg(e,typeof t=="string"?t:"USD",typeof r=="object"&&r!==null?r:{}):null);var wu=(e,t=0)=>{if(pe(e))return null;let r=e*1e3;return t===0?`${Math.round(r)} mA`:`${r.toFixed(t)} mA`},gl=(e,t=1)=>pe(e)?null:`${e.toFixed(t)} A`,Tu=(e,t=2)=>pe(e)?null:`${(e/1e3).toFixed(t)} kA`,mw=(e,t)=>{if(pe(e))return null;let r=Math.abs(e);return r>=1e3?Tu(e,t??2):r<1?wu(e,t??0):gl(e,t??1)},Nu=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.decimals;if(t.unit)switch(t.unit){case "kA":return Tu(r,o??2);case "mA":return wu(r,o??0);case "A":return gl(r,o??1)}return t.autoScale!==false?mw(r,o):gl(r,o??1)};se.register("current",Nu);var i6=wu,s6=gl,l6=Tu;var Fn=e=>{if(e==null)return null;if(e instanceof Date)return luxon.DateTime.fromJSDate(e);if(typeof e=="string"){let t=luxon.DateTime.fromISO(e);return t.isValid?t:null}if(typeof e=="number"){let t=luxon.DateTime.fromMillis(e);return t.isValid?t:null}return null},fw=(e,t=false,r)=>{if(!e)return null;let o=Fn(e);if(!o)return "Invalid Date";let n=r?o.setZone(r):o;return t?n.toLocaleString(luxon.DateTime.DATETIME_SHORT):n.toLocaleString(luxon.DateTime.DATE_SHORT)},bl=e=>{if(!e)return null;let t=Fn(e);return t?t.toRelative():"Invalid Date"},gw=(e,t)=>{if(!e)return null;let r=Fn(e);return r?(t?r.setZone(t):r).toLocaleString(luxon.DateTime.DATETIME_MED_WITH_WEEKDAY):"Invalid Date"},bw=e=>{if(!e)return null;let t=Fn(e);return t?t.toISO():null},xw=(e,t,r)=>{if(!e)return null;let o=Fn(e);return o?(r?o.setZone(r):o).toFormat(t):"Invalid Date"},p6=e=>{let t=Fn(e);return t?{year:t.year,month:t.month,day:t.day,weekday:t.weekday,hour:t.hour,minute:t.minute,second:t.second,millisecond:t.millisecond,weekdayShort:t.weekdayShort,weekdayLong:t.weekdayLong,monthShort:t.monthShort,monthLong:t.monthLong}:null},Hg=(e,t)=>{if(t.hideWhenNull&&e==null)return null;if(e==null)return t.nullText??null;let r=Fn(e);if(!r)return t.nullText??"Invalid Date";let o=t.timezone?r.setZone(t.timezone):r;if(t.relative)return o.toRelative();if(t.format)return o.toFormat(t.format);if(t.dateStyle||t.timeStyle){let n={};if(t.dateStyle)switch(t.dateStyle){case "short":n.date=luxon.DateTime.DATE_SHORT;break;case "medium":n.date=luxon.DateTime.DATE_MED;break;case "long":n.date=luxon.DateTime.DATE_FULL;break;case "full":n.date=luxon.DateTime.DATE_HUGE;break}if(t.timeStyle)switch(t.timeStyle){case "short":n.time=luxon.DateTime.TIME_SIMPLE;break;case "medium":n.time=luxon.DateTime.TIME_WITH_SECONDS;break;case "long":case "full":n.time=luxon.DateTime.TIME_WITH_SHORT_OFFSET;break}if(n.date&&n.time)return o.toLocaleString({...n.date,...n.time});if(n.date)return o.toLocaleString(n.date);if(n.time)return o.toLocaleString(n.time)}return o.toLocaleString(luxon.DateTime.DATETIME_SHORT)};se.register("date",(e,t,r)=>fw(e,typeof t=="boolean"?t:false,typeof r=="string"?r:void 0));se.register("relativeTime",e=>bl(e));se.register("fullDateTime",(e,t)=>gw(e,typeof t=="string"?t:void 0));se.register("isoString",e=>bw(e));se.register("customDateFormat",(e,t,r)=>typeof t=="string"?xw(e,t,typeof r=="string"?r:void 0):null);var ku=(e,t=1)=>pe(e)?null:`${e.toFixed(t)} m`,hw=(e,t=1)=>pe(e)?null:`${(e*100).toFixed(t)} cm`,yw=(e,t=0)=>pe(e)?null:`${(e*1e3).toFixed(t)} mm`,Pu=(e,t=1)=>pe(e)?null:`${(e/1e3).toFixed(t)} km`,Ru=(e,t=0)=>pe(e)?null:`${e.toFixed(t)} ft`,vw=(e,t=1)=>pe(e)?null:`${e.toFixed(t)} in`,Mu=(e,t=1)=>pe(e)?null:`${e.toFixed(t)} mi`,Du=(e,t=0)=>pe(e)?null:`${e.toFixed(t)} yd`,b6=(e,t=1)=>pe(e)?null:`${e.toFixed(t)} nm`,x6=e=>e*3.28084,h6=e=>e/3.28084,y6=e=>e*1.60934,v6=e=>e/1.60934,C6=e=>e/5280,Wg=e=>e*5280,S6=e=>e/1609.34,w6=e=>e*1609.34,T6=e=>e*.9144,N6=e=>e/.9144,k6=e=>e*2.54,P6=e=>e/2.54,Gg=(e,t=false,r=1)=>{if(pe(e))return null;let o=Math.abs(e);return t?o>=1e3?Pu(e,r):o<.01?yw(e,0):o<1?hw(e,r):ku(e,r):o<.01?Ru(Wg(e),0):o<.1?Du(Wg(e)/3,0):Mu(e,r)},Ug=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.decimals??1;if(t.autoScale){let n=t.unit==="m"||t.unit==="km";return Gg(r,n,o)}switch(t.unit){case "km":return Pu(r,o);case "ft":return Ru(r,o);case "mi":return Mu(r,o);case "yd":return Du(r,o);default:return ku(r,o)}};se.register("miles",(e,t)=>typeof e=="number"?Mu(e,typeof t=="number"?t:1):null);se.register("kilometers",(e,t)=>typeof e=="number"?Pu(e,typeof t=="number"?t:1):null);se.register("meters",(e,t)=>typeof e=="number"?ku(e,typeof t=="number"?t:1):null);se.register("feet",(e,t)=>typeof e=="number"?Ru(e,typeof t=="number"?t:0):null);se.register("yards",(e,t)=>typeof e=="number"?Du(e,typeof t=="number"?t:0):null);se.register("inches",(e,t)=>typeof e=="number"?vw(e,typeof t=="number"?t:1):null);se.register("autoScaleDistance",(e,t,r)=>typeof e=="number"?Gg(e,typeof t=="boolean"?t:false,typeof r=="number"?r:1):null);var Eu=(e,t=1)=>pe(e)?null:`${e.toFixed(t)} Wh`,Lu=(e,t=1)=>pe(e)?null:`${(e/1e3).toFixed(t)} kWh`,Yg=(e,t=1)=>pe(e)?null:`${(e/1e6).toFixed(t)} MWh`,Kg=(e,t=1)=>pe(e)?null:`${(e/1e9).toFixed(t)} GWh`,Au=e=>{let t=Math.abs(e);return t>=1e9?"GWh":t>=1e6?"MWh":t>=1e3?"kWh":"Wh"},qg=(e,t=1)=>{if(pe(e))return null;switch(Au(e)){case "GWh":return Kg(e,t);case "MWh":return Yg(e,t);case "kWh":return Lu(e,t);default:return Eu(e,t)}},Iu={Wh:1,kWh:1e3,MWh:1e6,GWh:1e9},Fu=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.sourceUnit?r*Iu[t.sourceUnit]:r,n=t.decimals??1;if(t.unit)switch(t.unit){case "GWh":return Kg(o,n);case "MWh":return Yg(o,n);case "kWh":return Lu(o,n);case "Wh":return Eu(o,n)}return t.autoScale!==false?qg(o,n):Eu(o,n)};se.register("kWh",e=>typeof e=="number"?Lu(e):null);se.register("autoScaleEnergy",(e,t)=>typeof e=="number"?qg(e,typeof t=="number"?t:1):null);se.register("energy",Fu);var xl=e=>{if(!e)return null;let t=e.replace(/\D/g,"");return t.length===10?t.replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3"):t.length===11&&t.startsWith("1")?t.replace(/1(\d{3})(\d{3})(\d{4})/,"+1 ($1) $2-$3"):e},Bu=e=>{if(!e)return null;let t=e.replace(/[^\d+]/g,"");return t.startsWith("+")?t.length===12&&t.startsWith("+1")?t.replace(/\+1(\d{3})(\d{3})(\d{4})/,"+1 ($1) $2-$3"):t.length===13&&t.startsWith("+44")?t.replace(/\+44(\d{2})(\d{4})(\d{4})/,"+44 $1 $2 $3"):t.replace(/(\+\d{1,3})(\d{3,4})(\d{3,4})(\d{3,4})?/,"$1 $2 $3 $4").trim():xl(e)},Ha=e=>e?e.startsWith("+")||e.length>11?Bu(e):xl(e):null,jg=(e,t)=>{if(t.hideWhenNull&&e==null)return null;if(e==null)return t.nullText??null;let r=String(e);if(t.international)return Bu(r);switch(t.country){case "US":case "CA":return xl(r);default:return Ha(r)}};se.register("phoneNumber",e=>typeof e=="string"?Ha(e):null);se.register("usPhone",e=>typeof e=="string"?xl(e):null);se.register("internationalPhone",e=>typeof e=="string"?Bu(e):null);var hl=(e,t=0)=>pe(e)?null:t===0?`${Math.round(e)} W`:`${e.toFixed(t)} W`,Vu=(e,t=1)=>pe(e)?null:`${(e/1e3).toFixed(t)} kW`,Ou=(e,t=1)=>pe(e)?null:`${(e/1e6).toFixed(t)} MW`,zu=(e,t=2)=>pe(e)?null:`${(e/1e9).toFixed(t)} GW`,Cw=(e,t)=>{if(pe(e))return null;let r=Math.abs(e);return r>=1e9?zu(e,t??2):r>=1e6?Ou(e,t??1):r>=1e3?Vu(e,t??1):hl(e,t??0)},Hu=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.decimals;if(t.unit)switch(t.unit){case "GW":return zu(r,o??2);case "MW":return Ou(r,o??1);case "kW":return Vu(r,o??1);case "W":return hl(r,o??0)}return t.autoScale!==false?Cw(r,o):hl(r,o??0)};se.register("power",Hu);var B6=hl,V6=Vu,O6=Ou,z6=zu;var Wu=(e,t=1)=>pe(e)?null:`${(e*1e3).toFixed(t)} m\u03A9`,yl=(e,t=1)=>pe(e)?null:`${e.toFixed(t)} \u03A9`,Jg=(e,t=1)=>pe(e)?null:`${(e/1e3).toFixed(t)} k\u03A9`,$g=(e,t=2)=>pe(e)?null:`${(e/1e6).toFixed(t)} M\u03A9`,Sw=(e,t)=>{if(pe(e))return null;let r=Math.abs(e);return r>=1e6?$g(e,t??2):r>=1e3?Jg(e,t??1):r<1?Wu(e,t??1):yl(e,t??1)},Gu=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.decimals;if(t.unit)switch(t.unit){case "M\u03A9":return $g(r,o??2);case "k\u03A9":return Jg(r,o??1);case "m\u03A9":return Wu(r,o??1);case "\u03A9":return yl(r,o??1)}return t.autoScale!==false?Sw(r,o):yl(r,o??1)};se.register("resistance",Gu);se.register("ohms",e=>typeof e=="number"?yl(e):null);se.register("milliohms",e=>typeof e=="number"?Wu(e):null);var Xg=e=>{switch(e){case "FAHRENHEIT":return "F";case "CELSIUS":return "C";case "KELVIN":return "K";default:return "F"}},Zg=(e,t=0)=>pe(e)?null:`${e.toFixed(t)}\xB0F`,Qg=(e,t=true,r=0)=>pe(e)?null:`${(t?(e-32)*(5/9):e).toFixed(r)}\xB0C`,_g=(e,t=true,r=0)=>pe(e)?null:`${(t?(e-32)*(5/9)+273.15:e+273.15).toFixed(r)}K`,ww=e=>e*9/5+32,Tw=e=>(e-32)*(5/9),q6=e=>e+273.15,Nw=e=>e-273.15,j6=e=>Tw(e)+273.15,J6=e=>ww(Nw(e)),eb=(e,t="F",r=0)=>{if(pe(e))return null;switch(typeof t=="string"&&t.length>1?Xg(t):t){case "C":return Qg(e,true,r);case "K":return _g(e,true,r);default:return Zg(e,r)}},tb=(e,t)=>{if(t.hideWhenNull&&e==null)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.decimals??0,n=t.unit??"F";if(t.showUnit===false)switch(typeof n=="string"&&n.length>1?Xg(n):n){case "C":return ((r-32)*.5555555555555556).toFixed(o);case "K":return ((r-32)*.5555555555555556+273.15).toFixed(o);default:return r.toFixed(o)}return eb(r,n,o)};se.register("temperature",(e,t,r)=>typeof e=="number"?eb(e,typeof t=="string"?t:"F",typeof r=="number"?r:0):null);se.register("fahrenheit",(e,t)=>typeof e=="number"?Zg(e,typeof t=="number"?t:0):null);se.register("celsius",(e,t,r)=>typeof e=="number"?Qg(e,typeof t=="boolean"?t:true,typeof r=="number"?r:0):null);se.register("kelvin",(e,t,r)=>typeof e=="number"?_g(e,typeof t=="boolean"?t:true,typeof r=="number"?r:0):null);var kw=(e,t)=>!!(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0),rb=e=>e?.toUpperCase()??"",ob=e=>e?.toLowerCase()??"",nb=e=>e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():"",ab=e=>{if(!e)return "";let t=new Set(["a","an","the","and","but","or","for","nor","on","at","of","to","with","in","as","by"]);return e.toLowerCase().split(/\s+/).map((r,o)=>t.has(r)&&o!==0?r:r.charAt(0).toUpperCase()+r.slice(1)).join(" ")},ib=e=>e?e.split(/\s+/).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" "):"",sb=e=>e?e.charAt(0).toUpperCase()+e.slice(1):"",lb=e=>e?e.replace(/([A-Z])/g," $1").replace(/^./,t=>t.toUpperCase()).trim():"",cb=e=>e?e.toLowerCase().split("_").map(t=>sb(t)).join(" "):"",Pw=e=>e?e.includes("_")?cb(e):e.toUpperCase()===e?sb(e.toLowerCase()):lb(e):"",Wa=(e,t=16)=>{if(!e)return "";if(t<5||e.length<=t)return e;let r=t-3,o=Math.ceil(r/2),n=Math.floor(r/2);return `${e.slice(0,o)}...${e.slice(-n)}`},vl=(e,t=8)=>e?e.length<=t?e:`...${e.slice(-t)}`:"",Cl=(e,t=16,r="...")=>e?e.length<=t?e:e.slice(0,t)+r:"",Rw=e=>{if(!e)return "";let t=e.toString(),r=t.slice(-4),o=t.length-4;return o>0?"*".repeat(o)+r:t},db=(e,t)=>{if(kw(e,t))return null;if(e==null)return t.nullText??null;let r=String(e);if(t.transform&&(Array.isArray(t.transform)?t.transform:[t.transform]).forEach(n=>{switch(n){case "uppercase":r=rb(r);break;case "lowercase":r=ob(r);break;case "capitalize":r=ib(r);break;case "titleCase":r=ab(r);break;case "sentenceCase":r=nb(r);break}}),t.truncate){let{length:o,position:n,ellipsis:a="..."}=t.truncate;switch(n){case "start":r=vl(r,o);break;case "middle":r=Wa(r,o);break;case "end":r=Cl(r,o,a);break}}return r};se.register("uppercase",e=>rb(String(e)));se.register("lowercase",e=>ob(String(e)));se.register("sentenceCase",e=>nb(String(e)));se.register("titleCase",e=>ab(String(e)));se.register("capitalize",e=>ib(String(e)));se.register("camelCaseToWords",e=>lb(String(e)));se.register("snakeCaseToWords",e=>cb(String(e)));se.register("enumToSentenceCase",e=>Pw(String(e)));se.register("truncateMiddle",(e,t)=>Wa(String(e),typeof t=="number"?t:16));se.register("truncateStart",(e,t)=>vl(String(e),typeof t=="number"?t:8));se.register("truncateEnd",(e,t,r)=>Cl(String(e),typeof t=="number"?t:16,typeof r=="string"?r:"..."));se.register("secret",e=>Rw(String(e)));var Uu=(e,t=0)=>{if(pe(e))return null;let r=e*1e3;return t===0?`${Math.round(r)} mV`:`${r.toFixed(t)} mV`},Sl=(e,t=0)=>pe(e)?null:t===0?`${Math.round(e)} V`:`${e.toFixed(t)} V`,Yu=(e,t=1)=>pe(e)?null:`${(e/1e3).toFixed(t)} kV`,Mw=(e,t)=>{if(pe(e))return null;let r=Math.abs(e);return r>=1e3?Yu(e,t??1):r<1?Uu(e,t??0):Sl(e,t??0)},Ku=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.decimals;if(t.unit)switch(t.unit){case "kV":return Yu(r,o??1);case "mV":return Uu(r,o??0);case "V":return Sl(r,o??0)}return t.autoScale!==false?Mw(r,o):Sl(r,o??0)};se.register("voltage",Ku);var e7=Uu,t7=Sl,r7=Yu;var Dw=(e,t)=>{if(e==null)return t.nullText??null;if(t.hideWhenNull&&e===null)return null;let r=typeof e=="number"?e:Number(e);return Number.isNaN(r)?t.nullText??null:Bg(r,t.decimals??0)},jr=(e,t)=>{switch(t.type){case "text":return db(e,t);case "number":return Og(e,t);case "percentage":return Dw(e,t);case "currency":return zg(e,t);case "date":return Hg(e,t);case "boolean":return Ig(e,t);case "energy":return Fu(e,t);case "power":return Hu(e,t);case "voltage":return Ku(e,t);case "current":return Nu(e,t);case "resistance":return Gu(e,t);case "temperature":return tb(e,t);case "distance":return Ug(e,t);case "phone":return jg(e,t);case "custom":{let r=t;return r.hideWhenNull&&e==null?null:e==null?r.nullText??null:r.formatter(e,r.options)}default:return e!=null?String(e):null}};var Ga={power:"W",energy:"Wh",voltage:"V",current:"A",resistance:"\u03A9",distance:"m"},Ew=new Set(["number","power","energy","voltage","current","resistance","temperature","distance","percentage"]);function qu(e){if(!e)return null;switch(e.type){case "percentage":return "%";case "power":return e.unit??Ga.power;case "energy":return e.unit??e.sourceUnit??Ga.energy;case "voltage":return e.unit??Ga.voltage;case "current":return e.unit??Ga.current;case "resistance":return e.unit??Ga.resistance;case "temperature":{let t=typeof e.unit=="string"?e.unit:"F";return t==="C"||t==="CELSIUS"?"\xB0C":t==="F"||t==="FAHRENHEIT"?"\xB0F":t==="K"||t==="KELVIN"?"K":t}case "distance":return e.unit??Ga.distance;default:return null}}function ub(e,t){if(!Ew.has(t.type))return null;let r;if(typeof e=="number")r=e;else if(typeof e=="string"){let n=parseFloat(e);if(Number.isNaN(n))return null;r=n;}else return null;let o=qu(t);if(o!==null){let n;if(t.type==="percentage")n=t;else if(t.type==="energy")n=t.unit?{...t,autoScale:false}:{...t,unit:t.sourceUnit??"Wh",autoScale:false};else if(t.type==="temperature")n={...t};else {let s=t.unit;n={...t,unit:s??o,autoScale:false};}let a=jr(r,n);if(!a)return "";if(typeof a=="string"&&a.startsWith("device."))return null;let i=String(a);return i.endsWith(` ${o}`)?i.slice(0,-(o.length+1)):i.endsWith(o)?i.slice(0,-o.length):i}if(t.type==="number"){let n=jr(r,t);return n?String(n):""}return String(r)}var pb=["stroke","fill","color","stop-color","flood-color","lighting-color"],mb=/var\s*\(/;function fb(e,t){let r=[e,...Array.from(e.querySelectorAll("*"))],o=[t,...Array.from(t.querySelectorAll("*"))],n=Math.min(r.length,o.length);for(let a=0;a<n;a++){let i=r[a],s=o[a];if(!(i instanceof Element)||!(s instanceof Element))continue;let c=window.getComputedStyle(i);for(let l of pb){let d=s.getAttribute(l);if(d&&mb.test(d)){let u=c.getPropertyValue(l);u&&s.setAttribute(l,u.trim());}}if(s instanceof HTMLElement||s instanceof SVGElement)for(let l of pb){let d=l,u=s.style.getPropertyValue(d);if(u&&mb.test(u)){let p=c.getPropertyValue(d);p&&s.style.setProperty(d,p.trim());}}}}function ju(e,t,r=true){let o=e||"chart";if(r){let n=new Date().toISOString().replace(/[:.]/g,"-").slice(0,-5);return `${o}-${n}.${t}`}return `${o}.${t}`}async function Ju(e,t,r={},o){let n=Array.isArray(t[0])?t:[t];try{switch(e){case "csv":await Aw(n,r);break;case "svg":await Iw(o,r);break;case "png":await Fw(o,r);break;default:throw new Error(`Unsupported export type: ${e}`)}}catch(a){throw console.error("Export failed:",a),new Error(`Failed to export chart as ${e}: ${a instanceof Error?a.message:"Unknown error"}`)}}async function Aw(e,t){try{let r=t.yFormat?qu(t.yFormat):null,o=t.yFormat,n=p=>{if(p==null||p==="")return "";if(!o)return typeof p=="number"?p:String(p);let m=ub(p,o);return m===null?typeof p=="number"?p:String(p):m},a=new Map;e.forEach(p=>{p.forEach(m=>{let f=m.xValue.getTime();a.has(f)||a.set(f,m.xValue);});});let i=Array.from(a.values()).sort((p,m)=>p.getTime()-m.getTime()),s=e.map((p,m)=>{let f=t.seriesLabels?.[m]||`Series ${m+1}`;return r&&!f.includes(`(${r})`)?`${f} (${r})`:f}),c=i.map(p=>{let m={[t.xLabel||"Date"]:p.toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})};return e.forEach((f,g)=>{let b=s[g],x=f.find(h=>h.xValue.getTime()===p.getTime());m[b]=x?n(x.yValue):"",x?.category&&(m[`${b} Category`]=x.category);}),m}),l=Lw__default.default.unparse(c,{header:!0,skipEmptyLines:!0}),d=new Blob([l],{type:"text/csv;charset=utf-8;"}),u=ju(t.filename||"chart-data","csv",t.timestamp!==!1);(0,wl.saveAs)(d,u);}catch(r){throw new Error(`CSV export failed: ${r instanceof Error?r.message:"Unknown error"}`)}}async function Iw(e,t){if(!e.current)throw new Error("SVG element not found");try{let r=e.current,o=r.cloneNode(!0);if(fb(r,o),!o.querySelector("rect[data-background]")){let l=document.createElementNS("http://www.w3.org/2000/svg","rect");l.setAttribute("width",o.getAttribute("width")||"100%"),l.setAttribute("height",o.getAttribute("height")||"100%"),l.setAttribute("fill","white"),l.setAttribute("data-background","true"),o.insertBefore(l,o.firstChild);}let i=new XMLSerializer().serializeToString(o);i.includes("<?xml")||(i=`<?xml version="1.0" encoding="UTF-8"?>
3
3
  `+i),i.includes("xmlns=")||(i=i.replace("<svg",'<svg xmlns="http://www.w3.org/2000/svg"'));let s=new Blob([i],{type:"image/svg+xml;charset=utf-8"}),c=ju(t.filename||"chart","svg",t.timestamp!==!1);(0,wl.saveAs)(s,c);}catch(r){throw new Error(`SVG export failed: ${r instanceof Error?r.message:"Unknown error"}`)}}async function Fw(e,t,r=2){if(!e.current)throw new Error("SVG element not found");let o="";try{let n=e.current,a=n.getBoundingClientRect(),i=n.cloneNode(!0);fb(n,i),i.setAttribute("width",String(a.width)),i.setAttribute("height",String(a.height)),i.removeAttribute("transform");let s=i.getElementsByTagName("text");Array.from(s).forEach(p=>{p.style.fontFamily||(p.style.fontFamily="system-ui, -apple-system, sans-serif"),p.style.fontSize||(p.style.fontSize="12px");});let c=document.createElementNS("http://www.w3.org/2000/svg","rect");c.setAttribute("width",String(a.width)),c.setAttribute("height",String(a.height)),c.setAttribute("fill","white"),i.insertBefore(c,i.firstChild);let d=new XMLSerializer().serializeToString(i);d.includes("xmlns=")||(d=d.replace("<svg",'<svg xmlns="http://www.w3.org/2000/svg"'));let u=new Blob([d],{type:"image/svg+xml;charset=utf-8"});return o=URL.createObjectURL(u),new Promise((p,m)=>{let f=new Image,g=setTimeout(()=>{o&&URL.revokeObjectURL(o),m(new Error("Image loading timeout"));},1e4);f.onload=()=>{clearTimeout(g);try{let b=document.createElement("canvas");b.width=a.width*r,b.height=a.height*r;let x=b.getContext("2d");if(!x)throw new Error("Canvas context not available");x.imageSmoothingEnabled=!0,x.imageSmoothingQuality="high",x.scale(r,r),x.fillStyle="white",x.fillRect(0,0,a.width,a.height),x.drawImage(f,0,0,a.width,a.height),b.toBlob(h=>{if(h){let y=ju(t.filename||"chart","png",t.timestamp!==!1);(0,wl.saveAs)(h,y),p();}else m(new Error("Failed to create PNG blob"));o&&URL.revokeObjectURL(o);},"image/png",1);}catch(b){o&&URL.revokeObjectURL(o),m(b);}},f.onerror=()=>{clearTimeout(g),o&&URL.revokeObjectURL(o),m(new Error("Failed to load SVG as image"));},f.src=o;})}catch(n){throw o&&URL.revokeObjectURL(o),new Error(`PNG export failed: ${n instanceof Error?n.message:"Unknown error"}`)}}function Bw(e){if(typeof window>"u")return false;switch(e){case "csv":return true;case "svg":return typeof XMLSerializer<"u";case "png":return typeof HTMLCanvasElement<"u"&&typeof HTMLCanvasElement.prototype.toBlob=="function";default:return false}}function Vw(e){return {csv:"CSV Spreadsheet",svg:"SVG Vector Image",png:"PNG Image"}[e]||"Unknown Format"}function Tl({datasets:e,metadata:t,svgRef:r}){return He.useCallback(async o=>{try{await Ju(o,e,t,r);}catch(n){throw console.error("Chart export failed:",n),n}},[e,t,r])}function Ki(e,t){return t.split(".").reduce((r,o)=>r?.[o],e)}function Hw(e,t){let r=Ki(e,t.field),o=t.value;switch(t.operator){case "eq":return r===o;case "neq":return r!==o;case "in":return Array.isArray(o)?o.includes(r):false;case "nin":return Array.isArray(o)?!o.includes(r):false;case "gt":return r instanceof Date&&typeof o=="string"?r>new Date(o):r>o;case "gte":return r instanceof Date&&typeof o=="string"?r>=new Date(o):r>=o;case "lt":return r instanceof Date&&typeof o=="string"?r<new Date(o):r<o;case "lte":return r instanceof Date&&typeof o=="string"?r<=new Date(o):r<=o;case "contains":return typeof r!="string"?false:r.toLowerCase().includes(String(o).toLowerCase());case "startsWith":return typeof r!="string"?false:r.toLowerCase().startsWith(String(o).toLowerCase());case "endsWith":return typeof r!="string"?false:r.toLowerCase().endsWith(String(o).toLowerCase());default:return false}}function gb(e,t){if(t.conditions.length===0)return true;let r=t.conditions.map(o=>"conditions"in o?gb(e,o):Hw(e,o));return t.logic==="AND"?r.every(Boolean):r.some(Boolean)}function Ww(e,t){return !t||t.conditions.length===0?e:e.filter(r=>gb(r,t))}function Gw(e,t,r){if(e==null&&t==null)return 0;if(e==null)return r==="asc"?1:-1;if(t==null)return r==="asc"?-1:1;if(e instanceof Date&&t instanceof Date){let o=e.getTime()-t.getTime();return r==="asc"?o:-o}if(typeof e=="string"&&typeof t=="string"){let o=e.toLowerCase().localeCompare(t.toLowerCase());return r==="asc"?o:-o}return e<t?r==="asc"?-1:1:e>t?r==="asc"?1:-1:0}function Uw(e,t){return t?[...e].sort((r,o)=>{let n=Ki(r,t.field),a=Ki(o,t.field);return Gw(n,a,t.direction)}):e}function Yw(e,t){if(!t||!t.query.trim())return e;let{query:r,fields:o,fuzzy:n=true,threshold:a=.3}=t;if(n)return new zw__default.default(e,{keys:o,threshold:a,ignoreLocation:true,includeScore:true}).search(r).map(l=>l.item);let i=r.toLowerCase();return e.filter(s=>o.some(c=>{let l=Ki(s,c);return l==null?false:String(l).toLowerCase().includes(i)}))}function Kw(e,t){let r={};for(let o of t){if(r[o.field]={},o.values)for(let n of o.values)r[o.field][String(n.value)]=0;for(let n of e){let a=Ki(n,o.field);if(a!=null)if(Array.isArray(a))for(let i of a){let s=String(i);r[o.field][s]=(r[o.field][s]||0)+1;}else {let i=String(a);r[o.field][i]=(r[o.field][i]||0)+1;}}}return r}function $u({data:e,filters:t,sort:r,search:o,facetConfigs:n=[]}){let a=Yw(e,o||null);a=Ww(a,t||null);let i=Kw(a,n);return a=Uw(a,r||null),{data:a,facetCounts:i,resultCount:a.length}}function Nl({data:e,filters:t,sort:r,search:o,facetConfigs:n=[]}){return He.useMemo(()=>$u({data:e,filters:t,sort:r,search:o,facetConfigs:n}),[e,t,r,o,n])}function Zo(e,t=300){let[r,o]=He.useState(e);return He.useEffect(()=>{let n=setTimeout(()=>o(e),t);return ()=>clearTimeout(n)},[e,t]),r}function kl({filters:e,sort:t,search:r,onStateChange:o,searchDebounce:n=300}){let a=Zo(r,n),i=He.useRef(true);He.useEffect(()=>{if(i.current){i.current=false;return}o({filters:e,sort:t,search:a});},[e,t,a,o]);}function bb(e){return e.mode==="client"?Nl({data:e.data,filters:e.filters,sort:e.sort,search:e.search,facetConfigs:e.facetConfigs}):(kl({filters:e.filters,sort:e.sort,search:e.search,onStateChange:e.onStateChange,searchDebounce:e.searchDebounce}),{data:e.data,facetCounts:e.facetCounts||{},resultCount:e.resultCount??e.data.length})}function Pl(e,t=300){let[r,o]=He.useState(false);return He.useEffect(()=>{if(e){let n=setTimeout(()=>{o(true);},t);return ()=>clearTimeout(n)}o(false);},[e,t]),r}function Ua(){let[e,t]=He.useState({width:0,height:0}),r=He.useRef(null),o=He.useRef(void 0),n=He.useCallback(a=>{if(r.current&&(r.current.disconnect(),r.current=null),o.current&&(cancelAnimationFrame(o.current),o.current=void 0),!a){t({width:0,height:0});return}let i=a.getBoundingClientRect();t({width:i.width,height:i.height}),r.current=new ResizeObserver(s=>{o.current&&cancelAnimationFrame(o.current),o.current=requestAnimationFrame(c=>{for(let l of s){let{width:d,height:u}=l.contentRect;t(p=>p.width!==d||p.height!==u?{width:d,height:u}:p);}});}),r.current.observe(a);},[]);return He.useEffect(()=>()=>{o.current&&cancelAnimationFrame(o.current),r.current&&r.current.disconnect();},[]),{ref:n,width:e.width,height:e.height}}function Qo({items:e,onLoadMore:t,hasMore:r,isLoading:o=false,loadingState:n,enableVirtualization:a,estimatedItemSize:i=50,overscan:s=5,scrollElement:c,loadMoreThreshold:l=100}){let d=He.useRef(null),u=He.useRef(null),p=He.useRef(false),[m,f]=He.useState(0);He.useEffect(()=>{u.current&&(c||d.current)&&f(D=>D+1);},[c,e.length]);let g=n||(o?e.length===0?"loading":"loading-more":"idle"),b=g==="loading",x=g==="loading-more",h=a!==void 0?a:e.length>=100,y=reactVirtual.useVirtualizer({count:e.length,getScrollElement:()=>c||d.current,estimateSize:()=>i,overscan:s}),v=h?y:null,S=h?y.getVirtualItems():[];He.useEffect(()=>{let D=u.current,R=c||d.current;if(!D||!R||!r||o||!t)return;let A=new IntersectionObserver(O=>{let[P]=O;P?.isIntersecting&&!p.current&&r&&t&&(p.current=true,Promise.resolve(t()).finally(()=>{p.current=false;}));},{root:R,rootMargin:`0px 0px ${l}px 0px`,threshold:0});return A.observe(D),()=>{A.disconnect();}},[r,o,t,c,l,m]);let w=He.useCallback((D,R)=>{v?v.scrollToIndex(D,R):d.current&&d.current.children[D]?.scrollIntoView({behavior:"smooth",block:R?.align||"start"});},[v]),N=He.useCallback(()=>{v?v.scrollToIndex(0,{align:"start"}):d.current&&d.current.scrollTo({top:0,behavior:"smooth"});},[v]);return {virtualizer:v,virtualItems:S,computedLoadingState:g,isInitialLoad:b,isLoadingMore:x,scrollRef:d,loadMoreRef:u,scrollToIndex:w,scrollToTop:N}}function Rl(e,t){let[r,o]=He.useState(()=>{if(typeof window>"u")return t;try{let i=window.localStorage.getItem(e);return i?JSON.parse(i):t}catch(i){return console.error(`Error reading localStorage key "${e}":`,i),t}});He.useEffect(()=>{if(!(typeof window>"u"))try{window.localStorage.setItem(e,JSON.stringify(r));}catch(i){console.error(`Error writing to localStorage key "${e}":`,i);}},[e,r]);let n=He.useCallback(i=>{try{o(s=>i instanceof Function?i(s):i);}catch(s){console.error(`Error setting value for localStorage key "${e}":`,s);}},[e]),a=He.useCallback(()=>{try{typeof window<"u"&&window.localStorage.removeItem(e),o(t);}catch(i){console.error(`Error removing localStorage key "${e}":`,i);}},[e,t]);return [r,n,a]}var Cb=fl(Cu(),1);function sT(e,t,r=true){let o=e;if(r){let n=new Date().toISOString().replace(/[:.]/g,"-").slice(0,-5);return `${o}-${n}.${t}`}return `${o}.${t}`}function lT(e,t){return t.accessor?typeof t.accessor=="function"?t.accessor(e):e[t.accessor]:null}function Sb(e,t){let r=lT(t,e);return e.exportValue?e.exportValue(r,t)??"":r==null?"":r instanceof Date?r.toISOString():typeof r=="object"?JSON.stringify(r):r}function Zu(e){return e.filter(t=>t.exportable!==false)}function wb(e){let t=e.map(n=>n.exportLabel||n.label),r=new Set,o=[];for(let n of t)r.has(n)?o.includes(n)||o.push(n):r.add(n);if(o.length>0)throw new Error(`Duplicate export headers found: ${o.join(", ")}. Use exportLabel to provide unique headers.`)}async function Qu(e){let{columns:t,data:r,metadata:o={}}=e;try{let n=Zu(t);if(n.length===0)throw new Error("No exportable columns found");wb(n);let a=r.map(l=>{let d={};for(let u of n){let p=u.exportLabel||u.label;d[p]=Sb(u,l);}return d}),i=Lw__default.default.unparse(a,{header:!0,skipEmptyLines:!0}),s=new Blob([i],{type:"text/csv;charset=utf-8;"}),c=sT(o.filename||"table-data","csv",o.timestamp!==!1);(0,Cb.saveAs)(s,c);}catch(n){throw new Error(`CSV export failed: ${n instanceof Error?n.message:"Unknown error"}`)}}function cT(e){let{columns:t,data:r}=e,o=Zu(t);return wb(o),r.map(n=>{let a={};for(let i of o){let s=i.exportLabel||i.label;a[s]=Sb(i,n);}return a})}function dT(e){return Zu(e).map(t=>t.exportLabel||t.label)}function Tb({columns:e,data:t,metadata:r}){let n=e.filter(i=>i.exportable!==false).length>0&&t.length>0;return {exportCSV:He.useCallback(async()=>{try{await Qu({columns:e,data:t,metadata:r});}catch(i){throw console.error("Table export failed:",i),i}},[e,t,r]),canExport:n}}function _u(e,t,r,o){if(r.length===0)throw new Error("tierForViewport: resolution ladder is empty");let n=[...r].sort((s,c)=>s.bucketMs-c.bucketMs),a=e/Math.max(1,t*o.targetPointsPerPx),i=Math.max(o.nativeMs,a);return n.find(s=>s.bucketMs>=i)??n[n.length-1]}function pT(e,t){return Math.floor(e/t.tileSpanMs)}function _o(e,t,r){let o=pT(e.startMs,t)-r,n=Math.ceil(e.endMs/t.tileSpanMs)-1+r,a=[];for(let i=o;i<=n;i++)a.push({tierId:t.id,index:i,startMs:i*t.tileSpanMs,endMs:(i+1)*t.tileSpanMs});return a}var tr=(e,t)=>`${e}:${t}`;var Nb={erroredTiles:0};function ep(e,t){let r=new Map,o=new Map,n=0;for(let c of e){let l=t.get(tr(c.tierId,c.index));if(l){if(l.status==="error"){n+=1;continue}if(l.data){for(let d of l.data.line)r.set(d.xValue.getTime(),d);for(let d of l.data.band??[])o.set(d.xValue.getTime(),d);}}}let a=(c,l)=>c.xValue.getTime()-l.xValue.getTime(),i=[...r.values()].sort(a),s=[...o.values()].sort(a);return {line:i,band:s,coverage:{earliestMs:i.length?i[0].xValue.getTime():void 0,latestMs:i.length?i[i.length-1].xValue.getTime():void 0,erroredTiles:n}}}function mT(e,t,r){let o=_o(e,t,0);return o.length===0?false:o.every(n=>{let a=r.get(tr(n.tierId,n.index));return a!=null&&(a.status==="loaded"||a.status==="empty")})}function kb(e,t,r){return _o(e,t,0).some(n=>{let a=r.get(tr(n.tierId,n.index));return a?.status==="loaded"&&(a.data?.line.length??0)>0})}function fT(e,t){if(!e.line.length)return false;let r=e.coverage.earliestMs,o=e.coverage.latestMs;return r==null||o==null?false:r<t.endMs&&o>t.startMs}function Pb({viewport:e,targetTier:t,ladder:r,store:o,overscanTiles:n,prev:a}){let i=mT(e,t,o);if(i&&kb(e,t,o)){let c=_o(e,t,n),{line:l,band:d,coverage:u}=ep(c,o);return {line:l,band:d,renderTier:t,targetTier:t,isFallback:false,isStale:false,coverage:u}}let s=r.findIndex(c=>c.id===t.id);for(let c=s+1;c<r.length;c++){let l=r[c];if(kb(e,l,o)){let d=_o(e,l,n),{line:u,band:p,coverage:m}=ep(d,o);return {line:u,band:p,renderTier:l,targetTier:t,isFallback:true,isStale:false,coverage:m}}}if(i){let c=_o(e,t,n),{line:l,band:d,coverage:u}=ep(c,o);return {line:l,band:d,renderTier:t,targetTier:t,isFallback:false,isStale:false,coverage:u}}return a?fT(a,e)?{...a,targetTier:t,isFallback:true,isStale:false}:{line:a.line,band:a.band,renderTier:null,targetTier:t,isFallback:true,isStale:true,coverage:Nb}:{line:[],band:[],renderTier:null,targetTier:t,isFallback:false,isStale:false,coverage:Nb}}var Rb=new Map;function Mb(e,t){switch(t.type){case "reset":return new Map;case "request":{let r=new Map(e);for(let o of t.ids){let n=r.get(o);(!n||n.status==="error")&&r.set(o,{status:"loading"});}return r}case "fulfilled":{let r=new Map(e);return r.set(t.id,{status:t.data.line.length>0?"loaded":"empty",data:t.data}),r}case "failed":{let r=new Map(e);return r.set(t.id,{status:"error",error:t.error}),r}default:return e}}function Eb({refs:e,refsKey:t,store:r,tier:o,viewport:n,fetchTile:a,dispatch:i,concurrency:s,maxFutureMs:c}){let l=He.useRef(e);l.current=e;let d=He.useRef(n);d.current=n;let u=He.useRef(new Map),p=He.useCallback(()=>{for(let m of u.current.values())m.ac.abort();u.current.clear();},[]);return He.useEffect(()=>{for(let[x,h]of u.current)h.tierId!==o.id&&(h.ac.abort(),u.current.delete(x));let m=l.current.filter(x=>{let h=tr(x.tierId,x.index),y=r.get(h);return y?y.status==="loading"&&!u.current.has(h):true}),f=(d.current.startMs+d.current.endMs)/2;m.sort((x,h)=>Math.abs((x.startMs+x.endMs)/2-f)-Math.abs((h.startMs+h.endMs)/2-f));let g=Math.max(0,s-u.current.size),b=m.slice(0,g);if(b.length!==0){i({type:"request",ids:b.map(x=>tr(x.tierId,x.index))});for(let x of b){let h=tr(x.tierId,x.index),y=new AbortController;u.current.set(h,{ac:y,tierId:x.tierId});let v=c!=null?Math.min(x.endMs,c):x.endMs;a(o,x.startMs,v,y.signal).then(S=>{y.signal.aborted||i({type:"fulfilled",id:h,data:S});}).catch(S=>{if(!y.signal.aborted){let w=S instanceof Error?S.message:String(S);i({type:"failed",id:h,error:new Error(`tile fetch failed (tile ${h}, tier ${o.id}): ${w}`)});}}).finally(()=>{u.current.delete(h);});}}},[t,r,a,o,i,s,c]),He.useEffect(()=>p,[p]),{abortAll:p}}var Fb=1.3,xT=25e4,hT=3;function yT(e,t,r){let o=t.tileSpanMs/t.bucketMs,n=Math.max(1,Math.floor(xT/o/r));return Math.min(Math.max(1,Math.ceil(.5*e/t.tileSpanMs)),n)}function rp(e){let{fetchTile:t,ladder:r,nativeMs:o,initialViewport:n,widthPx:a,maxFutureMs:i,targetPointsPerPx:s=1,concurrency:c=3,tileCostSeriesCount:l=hT,resetKey:d}=e,u=He.useMemo(()=>({targetPointsPerPx:s,nativeMs:o}),[s,o]),[p,m]=He.useState(n),[f,g]=He.useState(()=>_u(n.endMs-n.startMs,Math.max(1,a),r,u)),[b,x]=He.useReducer(Mb,Rb),h=He.useRef(n.endMs-n.startMs);He.useEffect(()=>{let j=p.endMs-p.startMs,K=_u(j,Math.max(1,a),r,u);if(K.id===f.id)return;let Y=j/h.current;(Y>Fb||Y<1/Fb)&&(h.current=j,g(K));},[p,a,r,f.id,u]);let y=p.endMs-p.startMs,v=He.useMemo(()=>yT(y,f,l),[y,f,l]),S=He.useMemo(()=>_o(p,f,v),[p,f,v]),w=He.useMemo(()=>S.map(j=>tr(j.tierId,j.index)).join(","),[S]),N=He.useRef(S);N.current=S;let D=He.useRef(p);D.current=p;let R=He.useRef(b);R.current=b;let{abortAll:A}=Eb({refs:S,refsKey:w,store:b,tier:f,viewport:p,fetchTile:t,dispatch:x,concurrency:c,...i!=null?{maxFutureMs:i}:{}}),O=He.useRef(null),P=He.useRef(false);He.useEffect(()=>{if(!P.current){P.current=true;return}A(),O.current=null,x({type:"reset"});},[A,d]);let T=He.useMemo(()=>N.current.map(j=>`${tr(j.tierId,j.index)}:${b.get(tr(j.tierId,j.index))?.status??"\u2205"}`).join("|"),[w,b]),k=He.useMemo(()=>{let j=Pb({viewport:D.current,targetTier:f,ladder:r,store:R.current,overscanTiles:v,prev:O.current});return O.current=j,j},[T,f,r,v,p.startMs,p.endMs]),V=He.useMemo(()=>N.current.some(j=>R.current.get(tr(j.tierId,j.index))?.status==="loading"),[T]),H=He.useMemo(()=>{let j=N.current[0];return j?R.current.get(tr(j.tierId,j.index))?.status==="empty":false},[T]),I=He.useCallback(j=>m(j),[]),q=He.useCallback(j=>m(j),[]);return {viewport:p,onViewportChange:I,jumpTo:q,tier:f,series:k,loading:V,atDataStart:H}}function Ml(e=true){let[t,r]=He.useState(null);return He.useEffect(()=>{if(!e){r(null);return}let o=typeof window<"u"?window.visualViewport:null;if(!o)return;let n=()=>{let a=Math.max(0,window.innerHeight-o.height-(o.offsetTop??0));r({height:o.height,keyboardOffset:a});};return n(),o.addEventListener("resize",n),o.addEventListener("scroll",n),()=>{o.removeEventListener("resize",n),o.removeEventListener("scroll",n);}},[e]),t}function DF(e,t=1){return pe(e)?null:Math.abs(e)>=1e3?`${(e/1e3).toFixed(t)} MWh`:`${e.toFixed(t)} kWh`}function EF(e,t=1){return pe(e)?null:Math.abs(e)>=1e3?`${(e/1e3).toFixed(t)} MW`:`${e.toFixed(t)} kW`}function lo({value:e,formatter:t,emptyClassName:r="text-text-secondary",emptyText:o="\u2014"}){if(e==null)return jsxRuntime.jsx("span",{className:r,children:o});if(typeof t=="function")return t(e);if(t&&typeof t=="object"){let n=jr(e,t);return e instanceof Date&&n?jsxRuntime.jsx("time",{dateTime:e.toISOString(),title:e.toISOString(),children:n}):n||jsxRuntime.jsx("span",{className:r,children:o})}if(!t){if(typeof e=="string")return e;if(e instanceof Date){let n=jr(e,{type:"date"});return jsxRuntime.jsx("time",{dateTime:e.toISOString(),title:e.toISOString(),children:n})}if(typeof e=="number")return jr(e,{type:"number"});if(typeof e=="boolean")return jr(e,{type:"boolean"})}return String(e)}function FF(e,t,r){return He__namespace.default.useCallback(o=>lo({value:o,formatter:e,emptyClassName:t,emptyText:r}),[e,t,r])}var OF=(e,t)=>({type:e,...t});function rr(...e){return e.filter(Boolean).join(" ")}var co={displayXl:"text-display-xl",displayLg:"text-display-lg",displayMd:"text-display-md",displaySm:"text-display-sm",headingXl:"text-heading-xl",headingLg:"text-heading-lg",headingMd:"text-heading-md",headingSm:"text-heading-sm",bodyLg:"text-body-lg",bodyMd:"text-body-md",bodySm:"text-body-sm",labelLg:"text-label-lg",labelMd:"text-label-md",labelSm:"text-label-sm",code:"text-code",agent:"text-agent"};function bt(e,...t){return rr(co[e],...t)}function st(e,t){let r=He.forwardRef(({size:o=24,color:n="currentColor",className:a,mirrored:i,alt:s,...c},l)=>{let d=!!s||"aria-label"in c;return jsxRuntime.jsx("svg",{ref:l,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 256 256",fill:n,className:a,transform:i?"scale(-1, 1)":void 0,"aria-hidden":d?void 0:true,role:d?"img":void 0,"aria-label":s,...c,children:t})});return r.displayName=e,r}var El=()=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M12 128h44M200 128h44",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),jsxRuntime.jsx("circle",{cx:"76",cy:"128",r:"20",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsxRuntime.jsx("circle",{cx:"180",cy:"128",r:"20",fill:"none",stroke:"currentColor",strokeWidth:"16"})]}),Bb=()=>jsxRuntime.jsx("path",{d:"M166 120 88 70",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),Vb=()=>jsxRuntime.jsx("path",{d:"M162 122 92 128",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),Ob=()=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M112 85.7 A32 32 0 1 1 144 85.7",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),jsxRuntime.jsx("circle",{cx:"128",cy:"58",r:"8",fill:"currentColor",stroke:"none"})]}),NT=st("TextureRecloser",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:"36",y:"36",width:"184",height:"184",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsxRuntime.jsx("text",{x:"128",y:"126",textAnchor:"middle",dominantBaseline:"central",fontFamily:"ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",fontSize:"140",fontWeight:"700",fill:"currentColor",stroke:"none",children:"R"})]})),kT=st("TextureFuse",jsxRuntime.jsx("path",{d:"M20 128h72q18 -84 36 0q18 84 36 0h72",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",strokeLinejoin:"round"})),PT=st("TextureBreaker",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:"36",y:"36",width:"184",height:"184",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsxRuntime.jsx("text",{x:"128",y:"126",textAnchor:"middle",dominantBaseline:"central",fontFamily:"ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",fontSize:"140",fontWeight:"700",fill:"currentColor",stroke:"none",children:"B"})]})),RT=st("TextureSource",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M4 128h40M212 128h40",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),jsxRuntime.jsx("circle",{cx:"128",cy:"128",r:"84",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsxRuntime.jsx("path",{d:"M92 128q18 -84 36 0q18 84 36 0",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",strokeLinejoin:"round"})]})),MT=st("TextureCapacitor",jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx("path",{d:"M4 128h106M146 128h106M110 72v112M146 72v112",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"})})),DT=st("TextureRegulator",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("circle",{cx:"128",cy:"128",r:"92",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsxRuntime.jsx("text",{x:"128",y:"126",textAnchor:"middle",dominantBaseline:"central",fontFamily:"ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",fontSize:"128",fontWeight:"700",fill:"currentColor",stroke:"none",children:"V"})]})),ET=st("TextureSwitch",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(El,{}),jsxRuntime.jsx(Bb,{})]})),LT=st("TextureSwitchClosed",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(El,{}),jsxRuntime.jsx(Vb,{})]})),AT=st("TextureSectionalizerOpen",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(El,{}),jsxRuntime.jsx(Bb,{}),jsxRuntime.jsx(Ob,{})]})),IT=st("TextureSectionalizerClosed",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(El,{}),jsxRuntime.jsx(Vb,{}),jsxRuntime.jsx(Ob,{})]})),FT=st("TextureTransformer",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M40 64H88A22 22 0 0 1 88 108A22 22 0 0 1 88 152A22 22 0 0 1 88 196H40",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M216 64H168A22 22 0 0 0 168 108A22 22 0 0 0 168 152A22 22 0 0 0 168 196H216",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",strokeLinejoin:"round"})]})),Ka={1:[128],2:[110,146],3:[92,128,164]},op=e=>jsxRuntime.jsx("path",{d:`M24 ${e}h208`,fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"},e),np=e=>jsxRuntime.jsx("path",{d:`M24 ${e}h208`,fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",pathLength:100,strokeDasharray:"20 20"},e),BT=st("TextureSinglePhaseOverheadLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:Ka[1].map(op)})),VT=st("TextureTwoPhaseOverheadLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:Ka[2].map(op)})),OT=st("TextureThreePhaseOverheadLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:Ka[3].map(op)})),zT=st("TextureSinglePhaseUndergroundLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:Ka[1].map(np)})),HT=st("TextureTwoPhaseUndergroundLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:Ka[2].map(np)})),WT=st("TextureThreePhaseUndergroundLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:Ka[3].map(np)})),GT=st("TextureSupportStructure",jsxRuntime.jsx("circle",{cx:"128",cy:"128",r:"40",fill:"currentColor",stroke:"none"})),qa={TextureRecloser:NT,TextureFuse:kT,TextureBreaker:PT,TextureSource:RT,TextureCapacitor:MT,TextureRegulator:DT,TextureSwitch:ET,TextureSwitchClosed:LT,TextureSectionalizerOpen:AT,TextureSectionalizerClosed:IT,TextureTransformer:FT,TextureSinglePhaseOverheadLine:BT,TextureTwoPhaseOverheadLine:VT,TextureThreePhaseOverheadLine:OT,TextureSinglePhaseUndergroundLine:zT,TextureTwoPhaseUndergroundLine:HT,TextureThreePhaseUndergroundLine:WT,TextureSupportStructure:GT};if(process.env.NODE_ENV==="development")for(let e of Object.keys(qa))e in zb__namespace&&console.error(`Custom icon "${e}" collides with a Phosphor icon of the same name. Rename it (use the "Texture" prefix) to keep the icon namespace unambiguous.`);var ja={xs:16,sm:20,md:24,lg:32,xl:40,"2xl":48},U=He.memo(({name:e,size:t="md",color:r,weight:o="regular",className:n,ariaLabel:a,...i})=>{let s=qa[e]??zb__namespace[e];if(!s)return process.env.NODE_ENV==="development"&&console.error(`Icon "${e}" not found in @phosphor-icons/react or the custom icon registry`),null;let c=typeof t=="string"&&t in ja?ja[t]:t,l=tailwindMerge.twMerge("inline-block flex-shrink-0",!r&&"text-current",n);return jsxRuntime.jsx(s,{...i,size:c,color:r,weight:o,className:l,"aria-label":a||`${e} icon`,"data-testid":`icon-${e}`})});U.displayName="Icon";var Gb=He.memo(({variant:e="subtle",shape:t="square",containerSize:r,containerClassName:o,size:n="md",className:a,name:i,color:s,weight:c,ariaLabel:l,ref:d,...u})=>{let p=typeof n=="string"&&n in ja?ja[n]:n,m=r?typeof r=="string"&&r in ja?ja[r]:r:p*1.75,f=tailwindMerge.twMerge("inline-flex items-center justify-center flex-shrink-0",t==="circle"?"rounded-full":"rounded-lg",e==="subtle"&&"bg-background-muted",e==="solid"&&"bg-action-brand text-[color:var(--color-action-brand-text)]",e==="outline"&&"border-2 border-current",o);return jsxRuntime.jsx("div",{className:f,style:{width:m,height:m},children:jsxRuntime.jsx(U,{...u,name:i,size:n,color:s,weight:c,className:a,ariaLabel:l})})});Gb.displayName="IconWithContainer";function br({transparent:e=false,className:t,children:r,...o}){return jsxRuntime.jsx(reactAriaComponents.ModalOverlay,{...o,className:reactAriaComponents.composeRenderProps(t,(n,a)=>tailwindMerge.twMerge("fixed inset-0 z-50","outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",e?"bg-transparent":["bg-gradient-to-br from-background-modal/20 via-background-modal/15 to-background-modal/20","backdrop-blur-[2px]","supports-[backdrop-filter]:bg-background-modal/15"].join(" "),a.isEntering&&["animate-in fade-in","duration-300 ease-out"].join(" "),a.isExiting&&["animate-out fade-out","duration-200 ease-in"].join(" "),n)),children:r})}function _T({isEntering:e,isExiting:t,className:r="",disableGroup:o=false}){let n=[!o&&"group","bg-background-surface","forced-colors:bg-[Canvas]","shadow-lg","rounded-[var(--control-border-radius)]","bg-clip-padding","border","border-border-default","outline-none"].filter(Boolean).join(" "),a=e?["animate-in","fade-in","placement-bottom:slide-in-from-top-1","placement-top:slide-in-from-bottom-1","placement-left:slide-in-from-right-1","placement-right:slide-in-from-left-1","ease-out","duration-200"].join(" "):"",i=t?["animate-out","fade-out","placement-bottom:slide-out-to-top-1","placement-top:slide-out-to-bottom-1","placement-left:slide-out-to-right-1","placement-right:slide-out-to-left-1","ease-in","duration-150"].join(" "):"";return [n,a,i,r].filter(Boolean).join(" ")}function lt({children:e,showArrow:t=false,withBackdrop:r=false,className:o,isDismissable:n=true,disableGroup:a=false,...i}){let c=reactAriaComponents.useSlottedContext(reactAriaComponents.PopoverContext)?.trigger==="SubmenuTrigger",l=t?12:8;l=c?l-6:l;let d=jsxRuntime.jsxs(reactAriaComponents.Popover,{offset:l,...i,className:reactAriaComponents.composeRenderProps(o,(u,p)=>_T({...p,className:u,disableGroup:a})),children:[t&&jsxRuntime.jsx(reactAriaComponents.OverlayArrow,{children:jsxRuntime.jsx("svg",{width:12,height:12,viewBox:"0 0 12 12",className:"block fill-background-surface stroke-border-default stroke-1 group-placement-left:-rotate-90 group-placement-right:rotate-90 group-placement-bottom:rotate-180 forced-colors:fill-[Canvas] forced-colors:stroke-[ButtonBorder]",children:jsxRuntime.jsx("path",{d:"M0 0 L6 6 L12 0"})})}),e]});return r?jsxRuntime.jsx(br,{isDismissable:n,children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",isDismissable:n,children:d})}):d}var r2={"--color-brand-primary":["--color-action-brand","--color-text-link-default","--action-brand-background"],"--color-brand-dark":["--color-action-brand-hover","--color-text-link-hover","--action-brand-hover"],"--color-action-brand":["--color-text-link-default","--action-brand-background"],"--color-action-brand-hover":["--color-text-link-hover","--action-brand-hover"]};function Ub(e){let t={...e};for(let[r,o]of Object.entries(r2))if(e[r])for(let n of o)e[n]||(t[n]=e[r]);return t}function Yb(e){return e.replace(/[{}<>]/g,"")}function Kb(e){return Object.entries(e).map(([t,r])=>`${Yb(t)}: ${Yb(r)};`).join(" ")}function jb({variables:e,darkVariables:t,children:r}){let n=He.useId().replace(/:/g,""),a=e&&Object.keys(e).length>0,i=t&&Object.keys(t).length>0;if(!a&&!i)return jsxRuntime.jsx(jsxRuntime.Fragment,{children:r});let s=a?Ub(e):null,c=i?Ub(t):null,l=s?`[data-brand-scope="${n}"] { ${Kb(s)} }`:"",d=c?`.theme-dark [data-brand-scope="${n}"] { ${Kb(c)} }`:"",u=[l,d].filter(Boolean).join(`
4
- `);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),jsxRuntime.jsx("div",{"data-brand-scope":n,children:r})]})}var Ja=new Map,n2=8;function a2(e){if(!e.startsWith("var("))return e;let t=e.slice(4,e.lastIndexOf(")")).trim(),r=t.indexOf(",");return (r===-1?t:t.slice(0,r)).trim()}var Pt=(e,t="#000000")=>typeof window>"u"?t:Jb(e,t,0);function Jb(e,t,r){if(r>n2)return t;let o=e.startsWith("var(")?a2(e):e.startsWith("--")?e:`--${e}`;if(!e.startsWith("--")&&!e.startsWith("var(")&&!o.startsWith("--color-")&&(o=`--color-${o.slice(2)}`),Ja.has(o))return Ja.get(o);try{let n=document.body||document.documentElement,i=getComputedStyle(n).getPropertyValue(o).trim();if(i){if(i.startsWith("var(")){let l=Jb(i,t,r+1);return Ja.set(o,l),l}return Ja.set(o,i),i}let s=document.createElement("div");s.style.color=`var(${o})`,document.body.appendChild(s);let c=getComputedStyle(s).color;return document.body.removeChild(s),c&&c!=="rgb(0, 0, 0)"?(Ja.set(o,c),c):t}catch(n){return console.warn(`Failed to resolve color for ${e}:`,n),t}}var Ll=()=>{Ja.clear();},Bn=()=>{let e=[];for(let t=1;t<=12;t++){let r=Pt(`--color-viz-categorical-${t}`,"");r&&e.push(r);}return e.length===0?$b():e},$b=()=>["#5424db","#d92361","#e86a00","#5d89ff","#9a47e2","#f24cb8","#0ba286","#9c28af","#036e45","#52a119","#ff513d","#046691"],ji=()=>Pt("--color-viz-default","#444ae1"),i2=(e,t)=>{let r={},o=Bn();return e.forEach((n,a)=>{t&&t[n]?r[n]=t[n]:r[n]=o[a%o.length];}),r};var Xb=e=>{let t=e.match(/\d+/g);if(!t||t.length<3)return true;let[r,o,n]=t.map(Number);return (.299*r+.587*o+.114*n)/255>.5},s2=e=>Xb(e)?Pt("--color-text-primary","#333333"):Pt("--color-text-inverse","#ffffff"),Zb=(e,t)=>{if(!e||typeof e!="object")return console.warn("[Colors] Invalid GeoJSON data provided to extractUniqueValues"),[];if(!("type"in e)||e.type!=="FeatureCollection"&&e.type!=="Feature")return console.warn("[Colors] Data is not valid GeoJSON (missing type or invalid type)"),[];let r=new Set,o="features"in e?e.features:[e];if(!Array.isArray(o)||o.length===0)return console.warn("[Colors] No features found in GeoJSON data"),[];let n=0;return o.forEach(a=>{if(!(!a||typeof a!="object")&&a.properties&&t in a.properties){n++;let i=a.properties[t];i!=null&&r.add(i);}}),n===0&&console.warn(`[Colors] Property "${t}" not found on any features. Available properties: ${o[0]?.properties?Object.keys(o[0].properties).join(", "):"none"}`),Array.from(r).sort()},sp=e=>{let t=Bn(),r={};return e.forEach((o,n)=>{r[o]=t[n%t.length];}),r};var lp=(e,t)=>{if(!e||typeof e!="object")return console.warn("[Colors] Invalid GeoJSON data provided to extractNumericValues"),[];if(!("type"in e)||e.type!=="FeatureCollection"&&e.type!=="Feature")return console.warn("[Colors] Data is not valid GeoJSON (missing type or invalid type)"),[];let r="features"in e?e.features:[e];if(!Array.isArray(r)||r.length===0)return console.warn("[Colors] No features found in GeoJSON data"),[];let o=new Set,n=0;return r.forEach(a=>{if(!(!a||typeof a!="object")&&a.properties&&t in a.properties){n++;let i=a.properties[t];typeof i=="number"&&!isNaN(i)&&o.add(i);}}),n===0&&console.warn(`[Colors] Property "${t}" not found on any features. Available properties: ${r[0]?.properties?Object.keys(r[0].properties).join(", "):"none"}`),Array.from(o).sort((a,i)=>a-i)},cp=e=>e.length===0?(console.warn("[Colors] Cannot calculate bounds from empty array"),{min:0,max:1}):{min:e[0],max:e[e.length-1]},Qb=(e,t)=>{if(typeof t=="number")return t;if(e.length===0)return console.warn("[Colors] Cannot calculate center from empty array, defaulting to 0"),0;if(t==="median"){let r=Math.floor(e.length/2);return e.length%2===0?(e[r-1]+e[r])/2:e[r]}return e.reduce((r,o)=>r+o,0)/e.length},dp=(e="viridis")=>{let o=`viz-sequential-${{redYellowGreen:"red-yellow-green"}[e]||e}`,n=[];for(let a=1;a<=10;a++){let i=`${o}-${a}`,s=Pt(i);n.push(s);}return n},up=(e="redYellowBlue")=>{let o=`viz-diverging-${{orangeYellowSeafoam:"orange-yellow-seafoam",redYellowBlue:"red-yellow-blue",redBlue:"red-blue"}[e]||e}`,n=[];for(let a=1;a<=10;a++){let i=`${o}-${a}`,s=Pt(i);n.push(s);}return n},Ji=(e,t,r,o="viridis")=>{let n=dp(o);if(e<=t)return n[0];if(e>=r)return n[n.length-1];if(t===r)return n[Math.floor(n.length/2)];let i=(e-t)/(r-t)*(n.length-1),s=Math.floor(i);return n[s]},$i=(e,t,r,o,n="redYellowBlue")=>{let a=up(n),i=4;if(e<=t)return a[0];if(e>=r)return a[a.length-1];if(e===o||t===r)return a[i];if(e<o){let c=(e-t)/(o-t)*i,l=Math.floor(c);return a[Math.min(l,i)]}else {let s=(e-o)/(r-o),c=i+s*(a.length-1-i),l=Math.floor(c);return a[Math.min(l,a.length-1)]}};var pp=He.createContext({mode:"system",colorMode:"light",isDarkTheme:false,toggleTheme:()=>{}}),Ht=()=>He.useContext(pp);function p2(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function tx(){if(typeof window>"u")return "system";let e=localStorage.getItem("colorModePreference");return e==="light"||e==="dark"||e==="system"?e:"system"}function rx(e){return e==="system"?p2():e}var nx=({children:e})=>{let[t,r]=He.useState(tx),[o,n]=He.useState(()=>rx(tx())),a=o==="dark",i=He.useCallback(c=>{c==="dark"?(document.documentElement.classList.add("theme-dark"),document.body.classList.add("theme-dark")):(document.documentElement.classList.remove("theme-dark"),document.body.classList.remove("theme-dark")),Ll();},[]);He.useEffect(()=>{Ll();let c=rx(t);if(n(c),i(c),t==="system"){let l=window.matchMedia("(prefers-color-scheme: dark)"),d=u=>{let p=u.matches?"dark":"light";n(p),i(p);};return l.addEventListener("change",d),()=>{l.removeEventListener("change",d);}}},[t,i]);let s=He.useCallback(()=>{r(c=>{let l=c==="system"?"light":c==="light"?"dark":"system";return localStorage.setItem("colorModePreference",l),l});},[]);return jsxRuntime.jsx(pp.Provider,{value:{mode:t,colorMode:o,isDarkTheme:a,toggleTheme:s},children:e})};function $a(e){return e instanceof Date&&!Number.isNaN(e.getTime())}function Vn(e,t){return $a(e)?t.format(e):""}function ax(e){if(!$a(e.start)||!$a(e.end))return ()=>"";if((e.end.getTime()-e.start.getTime())/(1e3*60*60)<=720){let i=new Intl.DateTimeFormat("en",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"});return s=>Vn(s,i)}let r=e.start.getFullYear(),o=e.end.getFullYear(),n=r!==o,a=new Intl.DateTimeFormat("en",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",...n&&{year:"numeric"}});return i=>Vn(i,a)}function Xi(e,t){if(!$a(e.start)||!$a(e.end))return ()=>"";let r=(e.end.getTime()-e.start.getTime())/(1e3*60*60),o=t?.compact??false,n=l=>d=>$a(d)?l(d):"";if(r<=24){if(o)return n(d=>{let u=d.getHours(),p=u>=12?"pm":"am";return `${u%12||12}${p}`});let l=new Intl.DateTimeFormat("en",{hour:"numeric",minute:"2-digit"});return d=>Vn(d,l)}if(r<=48){if(o)return n(d=>{let u=d.getMonth()+1,p=d.getDate(),m=d.getHours(),f=m>=12?"p":"a",g=m%12||12;return `${u}/${p} ${g}${f}`});let l=new Intl.DateTimeFormat("en",{month:"short",day:"numeric",hour:"numeric"});return d=>Vn(d,l)}if(r<=168){if(o)return n(d=>{let u=d.getDate();return `${d.toLocaleDateString("en",{weekday:"short"}).charAt(0)}${u}`});let l=new Intl.DateTimeFormat("en",{weekday:"short",day:"numeric"});return d=>Vn(d,l)}if(r<=720){if(o)return n(d=>{let u=d.getMonth()+1,p=d.getDate();return `${u}/${p}`});let l=new Intl.DateTimeFormat("en",{month:"short",day:"numeric"});return d=>Vn(d,l)}let a=e.start.getFullYear(),i=e.end.getFullYear(),s=a!==i;if(o)return n(l=>{let d=l.getMonth()+1,u=l.getDate(),p=s?`/${l.getFullYear().toString().slice(-2)}`:"";return `${d}/${u}${p}`});let c=new Intl.DateTimeFormat("en",{month:"short",day:"numeric",...s&&{year:"numeric"}});return l=>Vn(l,c)}function $e(e=false){return `${e?"outline outline-1 outline-border-input data-[focus-visible]:outline-2 data-[focus-visible]:outline-action-default data-[focus-visible]:outline-offset-0 invalid:outline-2 invalid:outline-feedback-error-border group-invalid:outline-2 group-invalid:outline-feedback-error-border forced-colors:focus:outline-[Highlight] forced-colors:focus:outline-2 forced-colors:focus:outline-offset-2":"outline-none data-[focus-visible]:outline data-[focus-visible]:outline-2 data-[focus-visible]:outline-action-default data-[focus-visible]:outline-offset-0 invalid:outline-2 invalid:outline-feedback-error-border group-invalid:outline-2 group-invalid:outline-feedback-error-border forced-colors:focus:outline-[Highlight] forced-colors:focus:outline-2 forced-colors:focus:outline-offset-2"}`}function ke(e,t){return reactAriaComponents.composeRenderProps(e,r=>tailwindMerge.twMerge(t,r))}var We={sm:{text:"text-[length:var(--control-text-sm)]",height:"h-[var(--control-sm-height)]",padding:"px-[var(--control-padding-sm)]",paddingY:"py-[var(--control-gap-sm)]",gap:"gap-[var(--control-gap-sm)]"},md:{text:"text-[length:var(--control-text-md)]",height:"h-[var(--control-md-height)]",padding:"px-[var(--control-padding-md)]",paddingY:"py-[var(--control-gap-md)]",gap:"gap-[var(--control-gap-md)]"},lg:{text:"text-[length:var(--control-text-lg)]",height:"h-[var(--control-lg-height)]",padding:"px-[var(--control-padding-lg)]",paddingY:"py-[var(--control-gap-lg)]",gap:"gap-[var(--control-gap-lg)]"},xl:{text:"text-[length:var(--control-text-xl)]",height:"h-[var(--control-xl-height)]",padding:"px-[var(--control-padding-xl)]",paddingY:"py-[var(--control-gap-xl)]",gap:"gap-[var(--control-gap-xl)]"}};var x2="flex font-medium justify-center items-center gap-2 text-center transition rounded-[var(--control-border-radius)] whitespace-nowrap box-border",h2="bg-action-primary text-[color:var(--color-action-primary-text)] hover:bg-action-primary-hover forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent",y2={primary:h2,secondary:"bg-action-secondary text-[color:var(--color-action-secondary-text)] border-2 border-border-muted hover:bg-action-secondary-hover forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[ButtonText]",ghost:"border-none text-text-primary hover:bg-text-primary/5 forced-colors:text-[ButtonText] forced-colors:hover:bg-[ButtonFace]",destructive:"bg-transparent text-feedback-error-text border-2 border-border-muted hover:bg-feedback-error-background/50 forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[Mark]",link:"!text-action-primary hover:text-action-primary/90 hover:underline hover:decoration-2 hover:underline-offset-4",icon:"border-none text-text-primary hover:bg-background-hover hover:text-text-primary forced-colors:text-[ButtonText] forced-colors:hover:bg-[ButtonFace] p-1 flex-shrink-0 rounded-[var(--control-border-radius)]",unstyled:"bg-transparent"},sx={full:"w-full",default:"w-fit"},v2="opacity-50 cursor-not-allowed pointer-events-none",C2="opacity-100 cursor-pointer",S2={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},w2={primary:"bg-action-primary text-[color:var(--color-action-primary-text)]",destructive:"bg-feedback-error-border text-text-inverse"};function T2(e){return !e||e==="default"||e==="brand"?"primary":e}function N2(e){let{variant:t="primary",size:r="md",isDisabled:o,fullWidth:n=false,isLoading:a=false}=e,i=T2(t),s=i==="unstyled"?"":`${x2} ${y2[i]}`;i!=="unstyled"&&(s+=` ${We[r].text} ${We[r].height} ${We[r].padding} ${We[r].gap}`),o||a?s+=` ${v2}`:s+=` ${C2}`,n?s+=` ${sx.full}`:s+=` ${sx.default}`;let c=i==="primary"?"focus-visible:outline-action-primary":void 0;return [s,$e(),c].filter(Boolean).join(" ")}function re(e){let{icon:t,children:r,isLoading:o=false,loadingText:n,loadingIndicator:a,size:i="md",iconPosition:s="left",iconWeight:c,href:l,className:d,badgeNumber:u,badgeVariant:p="primary",badgePosition:m="top-right",style:f,target:g,rel:b,...x}=e,h=t?jsxRuntime.jsx(U,{name:t,size:i,weight:c}):null,y=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s==="left"&&h,typeof r=="function"?null:r,s==="right"&&h]}),v=jsxRuntime.jsxs("div",{className:"relative inline-flex items-center justify-center",children:[jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:a||jsxRuntime.jsx(U,{name:"CircleNotch",size:i,className:"animate-spin","aria-hidden":"true"})}),jsxRuntime.jsx("div",{className:"invisible","aria-hidden":"true",children:y}),n&&jsxRuntime.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:n})]}),S=(u??0)>0,w=tailwindMerge.twMerge(N2(e),d),N=l?{href:l,target:g,rel:b,...x}:{};if(l){let{onPress:R,onPressStart:A,onPressEnd:O,onPressChange:P,onPressUp:T,onAuxClick:k,onContextMenu:V,onDoubleClick:H,...I}=x;Object.assign(N,I);}let D=l?jsxRuntime.jsx(reactAriaComponents.Link,{...N,...o&&{"aria-busy":true},style:S?void 0:f,className:w,children:o?v:typeof r=="function"?(function(R){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s==="left"&&h,r(R),s==="right"&&h]})}):y}):jsxRuntime.jsx(reactAriaComponents.Button,{...x,...o&&{"aria-busy":true},style:S?void 0:f,className:w,children:o?v:typeof r=="function"?(function(R){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s==="left"&&h,r(R),s==="right"&&h]})}):y});return S?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative flex",d),style:f,children:[D,jsxRuntime.jsx("span",{className:`absolute ${S2[m]} flex h-5 w-5 items-center justify-center rounded-full ${w2[p]} text-xs font-medium`,"aria-label":`${u} items`,children:u})]}):D}function fp({action:e,defaultVariant:t,defaultSize:r="lg"}){let o=!!e.formId;return jsxRuntime.jsx(re,{type:o?"submit":"button",form:o?e.formId:void 0,size:e.size||r,variant:e.variant||t,onPress:o?void 0:e.onPress,isLoading:e.isLoading,isDisabled:e.isDisabled,children:e.label})}function rn({primaryAction:e,secondaryAction:t,tertiaryAction:r,footerContent:o}){let n=e||t||r;return !n&&!o?null:jsxRuntime.jsxs("div",{className:`flex w-full flex-col items-center justify-center border-t p-4 ${o?"h-28":""}`,children:[o&&jsxRuntime.jsx("div",{className:"flex h-10 justify-center",children:o}),n&&jsxRuntime.jsxs("div",{className:"flex w-full items-center justify-between gap-3",children:[jsxRuntime.jsx("div",{children:r&&jsxRuntime.jsx(fp,{action:r,defaultVariant:"destructive"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[t&&jsxRuntime.jsx(fp,{action:t,defaultVariant:"secondary"}),e&&jsxRuntime.jsx(fp,{action:e,defaultVariant:"primary"})]})]})]})}var k2={heading:{sm:co.headingSm,md:co.headingMd,lg:co.headingLg,xl:co.headingXl},display:{sm:co.displaySm,md:co.displayMd,lg:co.displayLg,xl:co.displayXl}},P2={page:"h-16 leading-[62px]"};function or({tag:e="h1",variant:t="heading",size:r="lg",height:o,className:n="",children:a}){let i=r==="xs"?"sm":r,s=k2[t][i],c=o?P2[o]:"";return jsxRuntime.jsx(e,{className:rr(s,"text-text-primary",c,n),children:a})}var Kt=({title:e,onClose:t,hideCloseIcon:r=false,titleAlign:o="left",hasBackArrow:n=false,onBack:a,headerContent:i})=>jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative flex h-16 w-full flex-shrink-0 items-center justify-between border-b px-6",e&&"border-b",o==="center"?"justify-center":""),children:[n&&jsxRuntime.jsx(re,{variant:"icon",onPress:a,className:"absolute left-6","aria-label":"Go back",children:jsxRuntime.jsx(U,{name:"CaretLeft","data-testid":"back-arrow"})}),i||jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e&&jsxRuntime.jsx(or,{size:"xs",children:e}),t&&!r&&jsxRuntime.jsx(re,{variant:"icon",onPress:t,"aria-label":"Close dialog",children:jsxRuntime.jsx(U,{name:"X","data-testid":"close-button"})})]})]});var J=({width:e,height:t,variant:r="rect",animation:o="pulse",gradient:n=false,flex:a=false,stack:i,responsive:s,delay:c=0,adjustAnimationSpeedBasedOnWidth:l=false,ariaLabel:d,className:u,"data-testid":p})=>{let[m,f]=He.useState(c===0);if(He.useEffect(()=>{if(c>0){let S=setTimeout(()=>f(true),c);return ()=>clearTimeout(S)}},[c]),!m)return null;let g=n?"bg-gradient-to-r from-[var(--color-skeleton-base)] via-[var(--color-skeleton-highlight)] to-[var(--color-skeleton-base)]":"bg-[var(--color-skeleton-base)]",b=l&&e?(()=>{let S=typeof e=="number"?e:parseFloat(String(e));return isNaN(S)?"":`animation-duration-[${Math.max(.8,S/100)}s]`})():"",x=o==="pulse"?`animate-pulse ${b}`:o==="wave"?`relative overflow-hidden before:absolute before:inset-0 before:bg-gradient-to-r before:from-transparent before:via-[var(--color-skeleton-wave)] before:to-transparent before:animate-wave ${b}`:"",h="rounded-sm";r==="circle"&&(h="rounded-full"),r==="text"&&(h="h-4 w-full rounded-sm");let y=a?"flex-1 min-w-0":"",v=s?Object.entries(s).map(([S,w])=>`${S}:w-[${w}]`).join(" "):"";return i?jsxRuntime.jsx("div",{className:"space-y-2","data-testid":p,children:i.map((S,w)=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(g,x,h,y,v,u),style:{width:S,height:t}},w))}):jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(g,x,h,y,v,u),style:{width:e,height:t},role:"presentation","aria-hidden":!d,"aria-label":d??void 0,"data-testid":p})},dx=({count:e=1,children:t,className:r,"data-testid":o})=>jsxRuntime.jsx("div",{className:r,"data-testid":o,children:Array.from({length:e}).map((n,a)=>jsxRuntime.jsx("div",{children:t},a))});var A2={outlined:"bg-background-surface border border-border-default",elevated:"bg-background-surface border-0 shadow-md",filled:"bg-background-muted border-0",ghost:"bg-transparent border-0 shadow-none"},I2="rounded-lg",bp={square:"aspect-square",video:"aspect-video",wide:"aspect-[2/1]",auto:""},F2={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between"};function Ge({variant:e="outlined",className:t,children:r,isLoading:o=false,layout:n="default"}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-full overflow-hidden",A2[e],I2,n==="flex"&&"flex flex-col",t),"data-testid":"card",children:o?jsxRuntime.jsx(J,{width:"100%",height:"100%",className:"rounded-none"}):r})}function xp({title:e,subtitle:t,actions:r,className:o,isLoading:n=false}){return n?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("p-6 pb-4",o),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx(J,{width:120,height:20}),jsxRuntime.jsx(J,{width:24,height:24})]}),t&&jsxRuntime.jsx(J,{width:200,height:16})]}):!e&&!t&&!r?null:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("p-6 pb-4",o),children:jsxRuntime.jsxs("div",{className:"flex justify-between items-start gap-4",children:[jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[e&&jsxRuntime.jsx("div",{className:"mb-1",children:typeof e=="string"?jsxRuntime.jsx(or,{tag:"h3",size:"sm",className:"text-text-primary",children:e}):e}),t&&jsxRuntime.jsx("div",{className:bt("bodySm","text-text-secondary"),children:t})]}),r&&jsxRuntime.jsx("div",{className:"flex-shrink-0",children:r})]})})}function hp({src:e,alt:t,aspectRatio:r="auto",className:o,children:n,isLoading:a=false}){return a?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("bg-background-muted",bp[r],o),children:jsxRuntime.jsx(J,{width:"100%",height:"100%"})}):n?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",bp[r],o),children:n}):e?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",bp[r],o),children:jsxRuntime.jsx("img",{src:e,alt:t||"",className:"w-full h-full object-cover",loading:"lazy"})}):null}function yp({className:e,children:t,isLoading:r=false,fill:o=false}){let a=e?.match(/p(?:t|b|l|r|x|y)?-(?:\d+(?:\.\d+)?|px|\[.+?\])/)?"":"px-6 py-4";return r?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(a,o&&"flex-1 flex flex-col min-h-0",e),children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(J,{width:"100%",height:16}),jsxRuntime.jsx(J,{width:"80%",height:16}),jsxRuntime.jsx(J,{width:"60%",height:16})]})}):t?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 text-text-primary",o&&"flex-1 flex flex-col min-h-0",e),children:t}):null}function vp({className:e,children:t,align:r="end",isLoading:o=false}){return o?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("px-6 py-4 flex gap-2 justify-end",e),children:[jsxRuntime.jsx(J,{width:80,height:32}),jsxRuntime.jsx(J,{width:60,height:32})]}):t?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 flex items-center gap-2",F2[r],e),children:t}):null}Ge.Header=xp;Ge.Media=hp;Ge.Content=yp;Ge.Footer=vp;var $r=class extends He.Component{constructor(){super(...arguments);Yi(this,"state",{hasError:false});Yi(this,"handleRetry",()=>{this.setState({hasError:false,error:void 0}),typeof window<"u"&&window.location.reload();});}static getDerivedStateFromError(r){return {hasError:true,error:r}}componentDidCatch(r,o){console.error("Error Boundary caught an error:",r,o);}render(){return this.state.hasError?this.props.fallback?this.props.fallback:jsxRuntime.jsxs(Ge,{children:[this.props.title&&jsxRuntime.jsx(Ge.Header,{title:this.props.title}),jsxRuntime.jsx(Ge.Content,{children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center gap-4","data-testid":"error-boundary",children:[jsxRuntime.jsx("p",{className:"text-feedback-error-text",children:this.state.error?.message||"Something went wrong"}),jsxRuntime.jsx("button",{className:"rounded bg-action-default px-4 py-2 text-[color:var(--color-action-default-text)] hover:bg-action-default-hover",onClick:this.handleRetry,children:"Retry"})]})})]}):this.props.children}};var z2=.3,H2=.5;function ct({children:e,title:t,headerContent:r,titleAlign:o="left",hideCloseIcon:n=false,hasBackArrow:a=false,onBack:i,isOpen:s,onClose:c,isDismissable:l=true,transparentOverlay:d=false,primaryAction:u,secondaryAction:p,footerContent:m,maxHeight:f="80vh",height:g,maxWidth:b="640px",contentPadding:x=true,showHandle:h=true,animationVariant:y="scale",className:v}){let[S,w]=He.useState(false),[N,D]=He.useState(0),[R,A]=He.useState(false),O=Ml(s),P=O?.height??null,T=O?.keyboardOffset??0,k=He.useRef(null),V=He.useRef(null),H=He.useRef(null),I=He.useRef({isDragging:false,startY:0,startTime:0,pointerId:null});He.useEffect(()=>{if(s){let E=setTimeout(()=>{w(true),setTimeout(()=>w(false),600);},400);return ()=>clearTimeout(E)}},[s]),He.useEffect(()=>{s||(D(0),A(false),I.current={isDragging:false,startY:0,startTime:0,pointerId:null});},[s]),He.useEffect(()=>{let E=V.current;if(!E||!s)return;let z=null,B=C=>{let W=C.target;W&&["INPUT","TEXTAREA","SELECT"].includes(W.tagName)&&(z&&clearTimeout(z),z=setTimeout(()=>{W.scrollIntoView({block:"nearest",behavior:"smooth"});},320));};return E.addEventListener("focusin",B),()=>{E.removeEventListener("focusin",B),z&&clearTimeout(z);}},[s]);let q=He.useCallback(E=>{l&&(E.pointerType!=="touch"&&E.pointerType!=="pen"||(H.current&&(clearTimeout(H.current),H.current=null),I.current={isDragging:true,startY:E.clientY,startTime:Date.now(),pointerId:E.pointerId},A(false),E.currentTarget.setPointerCapture(E.pointerId)));},[l]),j=He.useCallback(E=>{let{isDragging:z,startY:B,pointerId:C}=I.current;if(!z||E.pointerId!==C)return;let W=E.clientY-B;D(Math.max(0,W));},[]),K=He.useCallback(E=>{let{isDragging:z,startY:B,startTime:C,pointerId:W}=I.current;if(!z||E.pointerId!==W)return;let G=E.clientY-B,F=Date.now()-C,Z=G/F;I.current={isDragging:false,startY:0,startTime:0,pointerId:null};let L=(k.current?.getBoundingClientRect().height??0)*z2;(G>L||Z>H2&&G>50)&&l?(c?.(),D(0)):(A(true),D(0),H.current=setTimeout(()=>{A(false),H.current=null;},200));},[l,c]);if(!s)return null;let Y=t||r,M=u||p||m;return jsxRuntime.jsx($r,{children:jsxRuntime.jsx(br,{isOpen:s,onOpenChange:E=>{E||c?.();},isDismissable:l,transparent:d,style:{paddingBottom:T>0?`${T}px`:void 0,transition:"padding-bottom 0.25s ease-out"},className:"flex items-end justify-center p-0 sm:p-4",children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"w-full max-w-full p-0 sm:p-2 outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",isDismissable:l,children:jsxRuntime.jsx("div",{ref:k,className:tailwindMerge.twMerge("w-full",R&&"transition-transform duration-200"),style:{transform:N>0?`translateY(${N}px)`:void 0},children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{className:tailwindMerge.twMerge("relative flex w-full flex-col overflow-hidden","bg-background-surface","shadow-2xl shadow-black/30 dark:shadow-black/60","border-t border-x border-border-default/40","outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0 focus:shadow-none","origin-bottom",y==="scale"?"animate-[tray-enter-scale_400ms_cubic-bezier(0.32,0.72,0,1)]":"animate-[tray-enter_400ms_cubic-bezier(0.32,0.72,0,1)]",y==="scale"?"data-[exiting]:animate-[tray-exit-scale_250ms_cubic-bezier(0.32,0,0.67,0)]":"data-[exiting]:animate-[tray-exit_250ms_cubic-bezier(0.32,0,0.67,0)]",v),style:{maxWidth:b,...g?{height:g}:{maxHeight:/\d/.test(f)?P!==null?`min(${f}, ${Math.max(P-8,0)}px, 100dvh)`:`min(${f}, 100dvh)`:f}},children:[h&&jsxRuntime.jsx("div",{className:"absolute top-0 left-0 right-0 h-8 z-10 flex justify-center items-start pt-2 touch-none cursor-grab active:cursor-grabbing",onPointerDown:q,onPointerMove:j,onPointerUp:K,onPointerCancel:K,children:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("h-1 w-12 rounded-full bg-border-muted transition-all duration-300","hover:bg-border-default hover:w-16",S&&"animate-[handle-wiggle_0.6s_ease-in-out]")})}),Y&&(a?jsxRuntime.jsx(Kt,{title:t,headerContent:r,titleAlign:o,hideCloseIcon:n||!c,hasBackArrow:true,onBack:i??(()=>{}),onClose:c||(()=>{})}):jsxRuntime.jsx(Kt,{title:t,headerContent:r,titleAlign:o,hideCloseIcon:n||!c,onClose:c||(()=>{})})),jsxRuntime.jsx("div",{ref:V,className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto overscroll-contain",x?"p-4":"p-0"),children:e}),M&&jsxRuntime.jsx(rn,{primaryAction:u,secondaryAction:p,footerContent:m})]})})})})})}ct.displayName="Tray";function Qa({children:e,items:t,className:r,align:o="left",textAlign:n="left",size:a="md",onAction:i,header:s,footer:c,useMobileTray:l=true,popoverClassName:d}){let[u,p]=He.useState(false),{isMobile:m}=_t();if(l&&m){let g=He__namespace.default.isValidElement(e)?He__namespace.default.cloneElement(e,{onPress:()=>p(true)}):e,h=(y=>{if(typeof y=="string")return y;if(He__namespace.default.isValidElement(y)){let v=y.props;if(typeof v.children=="string")return v.children;if(Array.isArray(v.children))return v.children.find(w=>typeof w=="string")||""}return ""})(e)||"Actions";return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:r,children:g}),jsxRuntime.jsx(ct,{isOpen:u,onClose:()=>p(false),title:h,contentPadding:false,headerContent:s,footerContent:c,children:jsxRuntime.jsx("div",{className:"flex flex-col",children:t.map(y=>jsxRuntime.jsxs("button",{onClick:()=>{y.disabled||(y.onAction?y.onAction():i?.(y),p(false));},disabled:y.disabled,"data-testid":y.testId,className:tailwindMerge.twMerge("flex w-full items-center text-start transition-colors",!y.noPadding&&"px-6 py-3","border-b border-border-muted last:border-0",y.variant==="destructive"?"text-feedback-error-text hover:bg-feedback-error-background active:bg-feedback-error-background/80":"text-text-primary hover:bg-background-hover active:bg-background-hover/80",y.disabled&&"opacity-50 cursor-not-allowed"),children:[y.iconName&&jsxRuntime.jsx(U,{name:y.iconName,size:20,className:"mr-3 flex-shrink-0"}),jsxRuntime.jsx("div",{className:"flex flex-1 flex-col",children:y.render?y.render():jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:y.subtitle?"font-medium":"",children:y.name}),y.subtitle&&jsxRuntime.jsx("span",{className:"text-sm text-text-secondary",children:y.subtitle})]})})]},y.id))})})]})}return jsxRuntime.jsx("div",{className:r,children:jsxRuntime.jsxs(reactAriaComponents.MenuTrigger,{children:[e,jsxRuntime.jsx(lt,{className:tailwindMerge.twMerge("w-fit min-w-[180px] overflow-auto rounded-[var(--control-border-radius)] border border-border-default","bg-background-surface shadow-lg","animate-in fade-in zoom-in-97","duration-200 ease-out","data-[exiting]:animate-out data-[exiting]:fade-out data-[exiting]:zoom-out-97","data-[exiting]:duration-150 data-[exiting]:ease-in",o==="right"?"origin-top-right":"origin-top-left",d),placement:o==="right"?"bottom end":"bottom start",children:jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex min-w-[180px] flex-col gap-1",d),children:[s?jsxRuntime.jsx("div",{className:"px-3 pb-2 pt-3",children:s}):null,jsxRuntime.jsx(reactAriaComponents.Menu,{className:"!outline-none",children:t.map(g=>jsxRuntime.jsx(K2,{id:g.id,onAction:()=>{g.onAction?g.onAction():i?.(g);},textAlign:n,size:a,iconName:g.iconName,isDisabled:g.disabled,variant:g.variant,subtitle:g.subtitle,render:g.render,noPadding:g.noPadding,"data-testid":g.testId,children:g.name},g.id))}),c?jsxRuntime.jsx("div",{className:"px-3 pb-3 pt-2",children:c}):null]})})]})})}function K2({textAlign:e="left",iconName:t,size:r="md",isDisabled:o,children:n,variant:a="default",subtitle:i,render:s,noPadding:c,...l}){let d={sm:"px-3 py-2 text-sm",md:i?"px-4 py-2.5 text-base":"px-4 py-2 text-base"},u="text-text-primary hover:bg-background-hover data-[focused]:bg-background-hover data-[focus-visible]:ring-2 data-[focus-visible]:ring-action-primary data-[focus-visible]:ring-inset",p={primary:u,default:u,destructive:"text-feedback-error-text hover:bg-feedback-error-background data-[focused]:bg-feedback-error-background data-[focus-visible]:ring-2 data-[focus-visible]:ring-feedback-error-border data-[focus-visible]:ring-inset"};return s?jsxRuntime.jsx(reactAriaComponents.MenuItem,{...l,isDisabled:o,className:tailwindMerge.twMerge("group box-border flex w-full cursor-pointer items-center rounded-sm outline-none transition-colors",!c&&d[r],p[a],e==="right"?"justify-end":"justify-start",o&&"pointer-events-none opacity-50"),children:s()}):jsxRuntime.jsxs(reactAriaComponents.MenuItem,{...l,isDisabled:o,className:tailwindMerge.twMerge("group box-border flex w-full cursor-pointer items-center rounded-sm outline-none transition-colors",!c&&d[r],p[a],e==="right"?"justify-end":"justify-start",o&&"pointer-events-none opacity-50"),children:[t&&e==="left"&&jsxRuntime.jsx(U,{name:t,size:r==="sm"?16:20,className:"mr-3 flex-shrink-0"}),jsxRuntime.jsxs("div",{className:"flex flex-1 flex-col",children:[jsxRuntime.jsx("span",{className:i?"font-medium":"",children:n}),i&&jsxRuntime.jsx("span",{className:"text-sm text-text-secondary",children:i})]}),t&&e==="right"&&jsxRuntime.jsx(U,{name:t,size:r==="sm"?16:20,className:"ml-3 flex-shrink-0"})]})}var Eo=({className:e,size:t=24,color:r="text-action-brand"})=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("inline-block animate-spin rounded-full border-2 border-solid border-current border-r-transparent",r,e),style:{width:t,height:t},role:"status","aria-label":"loading",children:jsxRuntime.jsx("span",{className:"sr-only",children:"Loading..."})});function Ar({state:e,message:t,className:r,customIndicator:o}){if(e!=="loading-more")return null;let n=jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center justify-center gap-2 py-4","text-text-secondary",r),"aria-label":t||"Loading",children:[jsxRuntime.jsx(Eo,{size:20,color:"text-text-secondary"}),t&&jsxRuntime.jsx("span",{className:"text-sm","aria-hidden":"true",children:t})]});return o||n}var _a=He.createContext({variant:"timeline",size:"md"});function hx(){return He.useContext(_a)}function Bl(e){return He.isValidElement(e)&&e.type===zl}function _2(e){return He.isValidElement(e)&&e.type===Ol}function kp({variant:e="timeline",size:t="md",className:r,children:o,items:n,renderItem:a,isLoading:i=false,loadingState:s,error:c=null,renderLoadingSkeleton:l,loadingSkeletonCount:d=5,emptyMessage:u="No activity found.",onLoadMore:p,hasMore:m=false,enableVirtualization:f,estimatedItemSize:g,loadingIndicator:b,height:x,maxHeight:h,...y}){let v=He.useRef(null),{isMobile:S}=_t(),w=S?"stacked":e,N=n!==void 0&&a!==void 0,{scrollRef:D,loadMoreRef:R,virtualizer:A,virtualItems:O,isLoadingMore:P,computedLoadingState:T}=Qo({items:n||[],onLoadMore:N?p:void 0,hasMore:N?m:false,isLoading:i,loadingState:s,enableVirtualization:N?f:false,estimatedItemSize:g||(w==="stacked"?120:150),overscan:5}),k=N&&D?D:v,V=He.useMemo(()=>({variant:w,size:t}),[w,t]),H=w==="timeline"?t==="sm"?"gap-4":"gap-6":"gap-0",I=w==="stacked"?"divide-y divide-border-subtle rounded-lg border border-border-subtle bg-background-surface":"",q={};if(N&&p&&(x?(q.height=typeof x=="number"?`${x}px`:x,q.overflowY="auto"):h?(q.maxHeight=typeof h=="number"?`${h}px`:h,q.overflowY="auto"):(q.height="600px",q.overflowY="auto")),N){let Y=T==="loading"||i&&(!n||n.length===0);if(Y){let E=l?jsxRuntime.jsx(jsxRuntime.Fragment,{children:Array.from({length:d}).map((z,B)=>jsxRuntime.jsx("div",{children:l()},`skeleton-${B}`))}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:Array.from({length:d}).map((z,B)=>{let C=t==="sm"?"gap-2":"gap-3";if(w==="timeline"){let W=t==="sm"?"pt-3":"pt-4",G=t==="sm"?"p-3":"p-4";return jsxRuntime.jsxs("div",{className:"group relative grid items-start gap-4 grid-cols-[3rem_1fr]",children:[jsxRuntime.jsxs("div",{className:`relative flex h-full flex-col items-center ${W}`,children:[jsxRuntime.jsx(J,{width:32,height:32,variant:"circle"}),B<d-1&&jsxRuntime.jsx("span",{className:"absolute top-[2rem] left-1/2 w-0 border-l-2 border-dotted -translate-x-1/2 h-[calc(100%+2.5rem)] border-border-muted"})]}),jsxRuntime.jsxs("div",{className:`min-w-0 flex flex-col ${C} ${G} rounded-md border border-border-subtle bg-background-surface`,children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-3",children:[jsxRuntime.jsx(J,{width:"50%",height:16}),jsxRuntime.jsx(J,{width:"15%",height:12})]}),jsxRuntime.jsx(J,{width:"85%",height:t==="sm"?14:15}),jsxRuntime.jsx(J,{width:"70%",height:t==="sm"?14:15})]})]},`skeleton-${B}`)}else return jsxRuntime.jsxs("div",{className:`flex flex-col ${t==="sm"?"px-3 py-3":"px-4 py-4"}`,children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(J,{width:24,height:24,variant:"circle"}),jsxRuntime.jsx(J,{width:"50%",height:16})]}),jsxRuntime.jsxs("div",{className:`mt-3 flex flex-col ${C}`,children:[jsxRuntime.jsx(J,{width:"85%",height:t==="sm"?14:15}),jsxRuntime.jsx(J,{width:"70%",height:t==="sm"?14:15}),jsxRuntime.jsx(J,{width:"20%",height:12})]})]},`skeleton-${B}`)})});return jsxRuntime.jsx(_a.Provider,{value:V,children:jsxRuntime.jsx("div",{ref:k,"data-slot":"feed","data-variant":w,className:tailwindMerge.twMerge("flex flex-col",H,I,r),style:q,...y,children:E})})}if(c)return jsxRuntime.jsx(_a.Provider,{value:V,children:jsxRuntime.jsx("div",{ref:k,"data-slot":"feed","data-variant":w,className:tailwindMerge.twMerge("flex flex-col",H,I,r),style:q,...y,children:jsxRuntime.jsx("div",{className:"p-4 text-center text-feedback-error-text",children:c})})});if(!n||n.length===0)return jsxRuntime.jsx(_a.Provider,{value:V,children:jsxRuntime.jsx("div",{ref:k,"data-slot":"feed","data-variant":w,className:tailwindMerge.twMerge("flex flex-col",H,I,r),style:q,...y,children:jsxRuntime.jsx("div",{className:"p-4 text-center text-text-secondary",children:u})})});let M=A?O?.map(E=>({virtualItem:E,item:n[E.index],index:E.index}))||[]:n.map((E,z)=>({item:E,index:z,virtualItem:null}));return jsxRuntime.jsx(_a.Provider,{value:V,children:jsxRuntime.jsxs("div",{ref:k,"data-slot":"feed","data-variant":w,className:tailwindMerge.twMerge("flex flex-col",H,I,r),style:{...q,position:A?"relative":void 0},...y,children:[A?jsxRuntime.jsxs("div",{style:{height:`${A.getTotalSize()}px`,position:"relative"},children:[M.map(({item:E,index:z,virtualItem:B})=>{if(!E||!B)return null;let C=a(E,z),W=w==="timeline"&&He.isValidElement(C)&&Bl(C)?He.cloneElement(C,{showConnector:z!==n.length-1}):C;return jsxRuntime.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${B.start}px)`},"data-index":B.index,ref:A.measureElement,children:W},`item-${z}`)}),P&&jsxRuntime.jsx("div",{style:{position:"absolute",top:`${A.getTotalSize()}px`,left:0,width:"100%"},children:b||jsxRuntime.jsx(Ar,{state:"loading-more"})})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[M.map(({item:E,index:z})=>{let B=a(E,z);if(w==="timeline"&&He.isValidElement(B)&&Bl(B)){let C=z===n.length-1;return jsxRuntime.jsx("div",{children:He.cloneElement(B,{showConnector:!C})},`item-${z}`)}return jsxRuntime.jsx("div",{children:B},`item-${z}`)}),P&&(b||jsxRuntime.jsx(Ar,{state:"loading-more"}))]}),p&&m&&!Y&&jsxRuntime.jsx("div",{ref:R,style:A?{position:"absolute",top:`${A.getTotalSize()}px`,left:0,width:"100%",height:1}:{height:1,width:"100%"}})]})})}let j=He.Children.toArray(o),K=j.map((Y,M)=>{if(Bl(Y)){let E=Y.props.showConnector??(w==="timeline"&&M<j.length-1),z=w==="timeline"&&M>0;return He.cloneElement(Y,{showConnector:E,showIncomingConnector:z})}if(_2(Y)){let E=M===j.length-1;return He.cloneElement(Y,{__isLastGroup:E,__isFirstGroup:M===0})}return Y});return jsxRuntime.jsx(_a.Provider,{value:V,children:jsxRuntime.jsx("div",{"data-slot":"feed","data-variant":w,className:tailwindMerge.twMerge("flex flex-col",H,I,r),...y,children:K})})}kp.displayName="ActivityFeed";function Ol(e){let{variant:t,size:r}=hx(),{title:o,description:n,actions:a,children:i,className:s,__isLastGroup:c=false,__isFirstGroup:l=false,...d}=e,u=He.Children.toArray(i),p=u.map((g,b)=>{if(Bl(g)){let x=g.props.showConnector??(t==="timeline"&&!(c&&b===u.length-1));return He.cloneElement(g,{showConnector:x,showIncomingConnector:t==="timeline"&&!(l&&b===0)})}return g}),m=t==="timeline"?"pl-[3rem]":r==="sm"?"px-3":"px-4",f=r==="sm"?"gap-3":"gap-4";return jsxRuntime.jsxs("section",{"data-slot":"group",className:tailwindMerge.twMerge("flex flex-col",s),...d,children:[(o||n||a)&&jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("mb-2 flex flex-wrap items-end justify-between gap-2",m),children:[jsxRuntime.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[o&&jsxRuntime.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-text-secondary",children:o}),n&&jsxRuntime.jsx("span",{className:"text-sm text-text-secondary",children:n})]}),a&&jsxRuntime.jsx("div",{className:"flex flex-shrink-0 items-center gap-2",children:a})]}),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex flex-col",f),children:p})]})}Ol.displayName="ActivityFeedGroup";var bx={neutral:"bg-background-muted text-text-secondary border-border-muted",brand:"bg-background-muted text-action-brand border-action-brand/30",success:"bg-background-muted text-feedback-success-text border-feedback-success-border/40",warning:"bg-background-muted text-feedback-warning-text border-feedback-warning-border/40",danger:"bg-background-muted text-feedback-error-text border-feedback-error-border/40",info:"bg-background-muted text-feedback-info-text border-feedback-info-border/40"},eN={neutral:"bg-background-subtle",brand:"bg-action-brand/5",success:"bg-feedback-success-background",warning:"bg-feedback-warning-background",danger:"bg-feedback-error-background",info:"bg-feedback-info-background"},tN={neutral:"border-border-muted",brand:"border-action-brand",success:"border-feedback-success-border",warning:"border-feedback-warning-border",danger:"border-feedback-error-border",info:"border-feedback-info-border"};function zl(e){let{variant:t,size:r}=hx(),{title:o,description:n,timestamp:a,meta:i,media:s,actions:c,visual:l,icon:d,iconWeight:u,tone:p="neutral",surface:m,isHighlighted:f=false,showConnector:g=true,hideIndicator:b=false,interactive:x,className:h,children:y,onKeyDown:v,showIncomingConnector:S,...w}=e,N=l??(d?jsxRuntime.jsx(U,{name:d,weight:u||"fill",className:"h-4 w-4"}):null),D=m??(t==="stacked"?"minimal":"subtle"),R=r==="sm"?"gap-2":"gap-3",A="text-xs text-text-secondary",O=r==="sm"?"text-sm":"text-[15px]",P="text-xs text-text-secondary",T=x??typeof w.onClick=="function",k=M=>{if(!T){v?.(M);return}M.key===" "?M.preventDefault():M.key==="Enter"&&(M.preventDefault(),M.currentTarget.click()),v?.(M);},V=M=>{T&&M.key===" "&&(M.preventDefault(),M.currentTarget.click());},H=T?tailwindMerge.twMerge("group cursor-pointer",$e()):void 0,q=jsxRuntime.jsxs("div",{"data-slot":"connector",className:tailwindMerge.twMerge("relative flex h-full flex-col items-center",D==="minimal"?r==="sm"?"pt-2":"pt-3":r==="sm"?"pt-3":"pt-4"),children:[jsxRuntime.jsx("span",{"data-slot":"indicator",className:tailwindMerge.twMerge("relative z-10 flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-full border text-sm font-medium shadow-sm ring-2 ring-background-surface",bx[p]),children:N}),t==="timeline"&&g&&jsxRuntime.jsx("span",{"data-slot":"separator",className:"absolute top-[2rem] left-1/2 w-0 border-l-2 border-dotted -translate-x-1/2 h-[calc(100%+2.5rem)] border-border-muted"})]}),j=f?tailwindMerge.twMerge(eN[p],D==="minimal"?"rounded-md border border-border-muted":tN[p]):"";if(t==="stacked")return jsxRuntime.jsxs("div",{"data-slot":"item","data-variant":"stacked",role:T?"button":void 0,tabIndex:T?0:void 0,className:tailwindMerge.twMerge("flex flex-col",r==="sm"?"px-3 py-3":"px-4 py-4",{minimal:"",subtle:"bg-background-subtle",solid:"bg-background-muted"}[D],j,H,T?"transition-colors hover:bg-background-subtle/80":"",h),onKeyDown:k,onKeyUp:V,...w,children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[!b&&jsxRuntime.jsx("span",{"data-slot":"indicator",className:tailwindMerge.twMerge("flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full border text-sm font-medium shadow-sm ring-2 ring-background-surface",bx[p]),children:N}),jsxRuntime.jsx("div",{"data-slot":"title",className:"min-w-0 flex-1 text-sm font-semibold text-text-primary",children:o})]}),jsxRuntime.jsxs("div",{"data-slot":"content",className:tailwindMerge.twMerge("mt-3 flex flex-col",R),children:[n&&jsxRuntime.jsx("div",{"data-slot":"description",className:tailwindMerge.twMerge("text-text-secondary",O),children:n}),i&&jsxRuntime.jsx("div",{className:P,children:i}),s&&jsxRuntime.jsx("div",{className:"flex flex-col gap-2 text-sm text-text-secondary",children:s}),y,c&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-2 pt-1",children:c}),a&&jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("-mt-1.5",A),children:a})]})]});let K=D==="minimal"?r==="sm"?"py-2":"py-3":r==="sm"?"p-3":"p-4",Y={minimal:"",subtle:"rounded-md border border-border-subtle bg-background-surface",solid:"rounded-md bg-background-muted shadow-sm"};return jsxRuntime.jsxs("div",{"data-slot":"item","data-variant":"timeline",role:T?"button":void 0,tabIndex:T?0:void 0,className:tailwindMerge.twMerge("group relative grid items-start gap-4 grid-cols-[3rem_1fr]",H,h),onKeyDown:k,onKeyUp:V,...w,children:[b?jsxRuntime.jsx("div",{}):q,jsxRuntime.jsxs("div",{"data-slot":"content",className:tailwindMerge.twMerge("min-w-0 flex flex-col",R,K,Y[D],j,T?"transition-colors group-hover:bg-background-subtle/70":""),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-3",children:[jsxRuntime.jsx("div",{"data-slot":"title",className:"min-w-0 flex-1 text-sm font-semibold text-text-primary",children:o}),a&&jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-shrink-0",A),children:a})]}),n&&jsxRuntime.jsx("div",{"data-slot":"description",className:tailwindMerge.twMerge("text-text-secondary",O),children:n}),i&&jsxRuntime.jsx("div",{className:P,children:i}),s&&jsxRuntime.jsx("div",{className:"flex flex-col gap-2 text-sm text-text-secondary",children:s}),y,c&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-2 pt-2",children:c})]})]})}zl.displayName="ActivityItem";function Ir({isOpen:e,onClose:t,title:r,headerContent:o,titleAlign:n="left",hideCloseIcon:a=false,hasBackArrow:i=false,onBack:s,children:c,primaryAction:l,secondaryAction:d,tertiaryAction:u,footerContent:p,transparentOverlay:m=false,maxWidth:f="600px",minWidth:g="400px",maxHeight:b="85vh",height:x,mobileMaxHeight:h="90vh",mobileHeight:y,contentPadding:v=true,className:S}){let w=Qt("(max-width: 767px)"),N=Ml(w&&e===void 0),D=N?.height??null,R=N?.keyboardOffset??0,A=He.useRef(null),O=He.useCallback(()=>{A.current&&A.current.scrollTop!==0&&(A.current.scrollTop=0);},[]),P=He.useRef(null),T=He.useRef(null);He.useEffect(()=>{let q=T.current;if(!q||!w)return;let j=null,K=Y=>{let M=Y.target;M&&["INPUT","TEXTAREA","SELECT"].includes(M.tagName)&&(j&&clearTimeout(j),j=setTimeout(()=>{M.scrollIntoView({block:"nearest",behavior:"smooth"});},320));};return q.addEventListener("focusin",K),()=>{q.removeEventListener("focusin",K),j&&clearTimeout(j);}},[w]);let k=He.useCallback(()=>{P.current&&P.current.scrollTop!==0&&(P.current.scrollTop=0);},[]);if(e===false)return null;let V=r||o,H=l||d||u||p,I=e!==void 0;return w?I?jsxRuntime.jsx(ct,{isOpen:e,onClose:t,title:r,headerContent:o,titleAlign:n,hideCloseIcon:a,hasBackArrow:i,onBack:s,primaryAction:l,secondaryAction:d,footerContent:p,transparentOverlay:m,maxHeight:h,height:y,maxWidth:f,contentPadding:v,showHandle:true,animationVariant:"scale",className:S,children:c}):jsxRuntime.jsx($r,{children:jsxRuntime.jsx(br,{isDismissable:true,transparent:m,style:{paddingBottom:R>0?`${R}px`:void 0,transition:"padding-bottom 0.25s ease-out"},className:"flex items-end justify-center",children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"w-full p-0 outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{ref:A,onScroll:O,className:tailwindMerge.twMerge("relative flex w-full flex-col","bg-background-surface","shadow-2xl shadow-black/20","border-t border-x border-border-default/40","rounded-t-xl","overflow-hidden","animate-in slide-in-from-bottom","duration-300 ease-out","data-[exiting]:animate-out data-[exiting]:slide-out-to-bottom","data-[exiting]:duration-200 data-[exiting]:ease-in",S),style:{...y?{height:y}:{maxHeight:/\d/.test(h)?D!==null?`min(${h}, ${Math.max(D-8,0)}px, 100dvh)`:`min(${h}, 100dvh)`:h}},children:[jsxRuntime.jsx("div",{className:"flex justify-center pt-2",children:jsxRuntime.jsx("div",{className:"h-1.5 w-12 rounded-full bg-border-muted"})}),V&&(i?jsxRuntime.jsx(Kt,{title:r,headerContent:o,titleAlign:n,hideCloseIcon:a||!t,hasBackArrow:true,onBack:s,onClose:t||(()=>{})}):jsxRuntime.jsx(Kt,{title:r,headerContent:o,titleAlign:n,hideCloseIcon:a||!t,onClose:t||(()=>{})})),jsxRuntime.jsx("div",{ref:T,className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto overscroll-contain",v?"px-6 py-6":"p-0"),children:c}),H&&jsxRuntime.jsx(rn,{primaryAction:l,secondaryAction:d,tertiaryAction:u,footerContent:p})]})})})}):jsxRuntime.jsx($r,{children:jsxRuntime.jsx(br,{...I?{isOpen:e,onOpenChange:q=>{!q&&t&&t();}}:{},isDismissable:true,transparent:m,className:"flex items-center justify-center",children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"w-full p-4 outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",style:{maxWidth:f},children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{ref:P,onScroll:k,className:tailwindMerge.twMerge("relative flex w-full flex-col","bg-background-surface","shadow-2xl shadow-black/20","border border-border-default/50","rounded-md","overflow-hidden","outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0","animate-in fade-in zoom-in-96 slide-in-from-bottom-2","duration-300 ease-out","data-[exiting]:animate-out data-[exiting]:fade-out data-[exiting]:zoom-out-95","data-[exiting]:duration-200 data-[exiting]:ease-in",S),style:{minWidth:g,...x?{height:x}:{maxHeight:b}},children:[V&&(i?jsxRuntime.jsx(Kt,{title:r,headerContent:o,titleAlign:n,hideCloseIcon:a||!t,hasBackArrow:true,onBack:s,onClose:t||(()=>{})}):jsxRuntime.jsx(Kt,{title:r,headerContent:o,titleAlign:n,hideCloseIcon:a||!t,onClose:t||(()=>{})})),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto",v?"px-6 py-6":"p-0"),children:c}),H&&jsxRuntime.jsx(rn,{primaryAction:l,secondaryAction:d,tertiaryAction:u,footerContent:p})]})})})})}function Tx({isOpen:e,onClose:t,title:r,message:o,confirmLabel:n="OK",confirmVariant:a="primary",maxWidth:i="400px",minWidth:s="320px"}){return jsxRuntime.jsx(Ir,{isOpen:e,onClose:t,title:r,maxWidth:i,minWidth:s,primaryAction:{label:n,onPress:t,variant:a},children:jsxRuntime.jsx("div",{className:"text-text-primary",children:o})})}var on={xs:16,sm:20,md:24,lg:32,xl:40,"2xl":48},xr=He.memo(({name:e,size:t="md",color:r,weight:o="regular",className:n,ariaLabel:a,...i})=>{let s=oN__namespace[e];if(!s)return null;let c=typeof t=="string"?t in on?on[t]:on.md:t,l=tailwindMerge.twMerge("inline-block flex-shrink-0",!r&&"text-current",n);return jsxRuntime.jsx(s,{...i,size:c,color:r,weight:o,className:l,"aria-label":a||`${e} icon`,"data-testid":`icon-${e}`})});xr.displayName="IconSSR";var nN=He.memo(({variant:e="subtle",shape:t="square",containerSize:r,containerClassName:o,size:n="md",className:a,name:i,color:s,weight:c,ariaLabel:l,ref:d,...u})=>{let p=typeof n=="string"?n in on?on[n]:on.md:n,m=r?typeof r=="string"?r in on?on[r]:p*1.75:r:p*1.75,f=tailwindMerge.twMerge("inline-flex items-center justify-center flex-shrink-0",t==="circle"?"rounded-full":"rounded-lg",e==="subtle"&&"bg-background-muted",e==="solid"&&"bg-action-brand text-[color:var(--color-action-brand-text)]",e==="outline"&&"border-2 border-current",o);return jsxRuntime.jsx("div",{className:f,style:{width:m,height:m},children:jsxRuntime.jsx(xr,{...u,name:i,size:n,color:s,weight:c,className:a,ariaLabel:l})})});nN.displayName="IconSSRWithContainer";var ei=({className:e,showWordmark:t=true,width:r,fill:o})=>{let n,a;if(o?o.startsWith("fill-")?a=o:n=o:e?a=e:n="var(--color-text-primary)",t){let c=r||270,l=c/270*80;return jsxRuntime.jsxs("svg",{width:c,height:l,viewBox:"0 0 270 80",xmlns:"http://www.w3.org/2000/svg",className:a,style:n?{fill:n}:void 0,children:[jsxRuntime.jsxs("g",{clipPath:"url(#clip0_796_283)",children:[jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.223654 20.2934C0.417233 19.8234 0.873598 19.517 1.37984 19.517H20.5909C21.282 19.517 21.8422 20.0798 21.8422 20.774V40.049C21.8422 40.5572 21.5375 41.0155 21.0702 41.2102C20.6028 41.405 20.0647 41.2977 19.7067 40.9385L0.495628 21.6635C0.137428 21.3041 0.030075 20.7633 0.223654 20.2934ZM4.40349 22.0311L19.3396 37.017V22.0311H4.40349Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 20.2934C38.8394 19.8234 39.2958 19.517 39.802 19.517H59.013C59.7041 19.517 60.2642 20.0798 60.2642 20.774V40.049C60.2642 40.5572 59.9597 41.0155 59.4923 41.2102C59.025 41.405 58.4867 41.2977 58.1289 40.9385L38.9178 21.6635C38.5595 21.3041 38.4522 20.7633 38.6458 20.2934ZM42.8255 22.0311L57.7618 37.017V22.0311H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.4347 58.8447C19.6283 58.3747 20.0847 58.0685 20.5909 58.0685H39.802C40.493 58.0685 41.0532 58.6312 41.0532 59.3255V78.6005C41.0532 79.1087 40.7486 79.567 40.2813 79.7617C39.8139 79.9562 39.2757 79.849 38.9178 79.49L19.7067 60.215C19.3485 59.8555 19.2411 59.3147 19.4347 58.8447ZM23.6146 60.5825L38.5508 75.5682V60.5825H23.6146Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 58.1643C39.79 57.9695 40.3283 58.0768 40.6861 58.436L59.8972 77.711C60.2555 78.0703 60.3628 78.6113 60.1692 79.081C59.9756 79.551 59.5192 79.8575 59.013 79.8575H39.802C39.1109 79.8575 38.5508 79.2948 38.5508 78.6005V59.3255C38.5508 58.8173 38.8554 58.359 39.3227 58.1643ZM41.0532 62.3575V77.3433H55.9893L41.0532 62.3575Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 19.6129C39.79 19.4182 40.3283 19.5254 40.6861 19.8846L59.8972 39.1595C60.2555 39.519 60.3628 40.0598 60.1692 40.5298C59.9756 40.9995 59.5192 41.306 59.013 41.306H39.802C39.1109 41.306 38.5508 40.7433 38.5508 40.049V20.7741C38.5508 20.2658 38.8554 19.8075 39.3227 19.6129ZM41.0532 23.8061V38.792H55.9893L41.0532 23.8061Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 38.8885C39.79 38.694 40.3283 38.8012 40.6861 39.1602L59.8972 58.4352C60.2555 58.7945 60.3628 59.3355 60.1692 59.8055C59.9756 60.2752 59.5192 60.5817 59.013 60.5817H39.802C39.1109 60.5817 38.5508 60.019 38.5508 59.3247V40.0497C38.5508 39.5415 38.8554 39.0832 39.3227 38.8885ZM41.0532 43.0817V58.0675H55.9893L41.0532 43.0817Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 39.569C38.8394 39.0992 39.2958 38.7927 39.802 38.7927H59.013C59.7041 38.7927 60.2642 39.3555 60.2642 40.0497V59.3247C60.2642 59.833 59.9597 60.2912 59.4923 60.486C59.025 60.6805 58.4867 60.5732 58.1289 60.2142L38.9178 40.9392C38.5595 40.5797 38.4522 40.039 38.6458 39.569ZM42.8255 41.3067L57.7618 56.2927V41.3067H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 58.8447C38.8394 58.3747 39.2958 58.0685 39.802 58.0685H59.013C59.7041 58.0685 60.2642 58.6312 60.2642 59.3255V78.6005C60.2642 79.1087 59.9597 79.567 59.4923 79.7617C59.025 79.9562 58.4867 79.849 58.1289 79.49L38.9178 60.215C38.5595 59.8555 38.4522 59.3147 38.6458 58.8447ZM42.8255 60.5825L57.7618 75.5682V60.5825H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M58.5338 19.6129C59.0011 19.4182 59.5394 19.5254 59.8972 19.8846L79.1083 39.1595C79.4666 39.519 79.5739 40.0598 79.3803 40.5298C79.1867 40.9995 78.7303 41.306 78.2241 41.306H59.013C58.322 41.306 57.7618 40.7433 57.7618 40.049V20.7741C57.7618 20.2658 58.0664 19.8075 58.5338 19.6129ZM60.2643 23.8061V38.792H75.2006L60.2643 23.8061Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M58.5338 0.338803C59.0011 0.144135 59.5394 0.251385 59.8972 0.610565L79.1083 19.8855C79.4666 20.2449 79.5739 20.7857 79.3803 21.2556C79.1867 21.7256 78.7303 22.032 78.2241 22.032H59.013C58.322 22.032 57.7618 21.4692 57.7618 20.775V1.50003C57.7618 0.99174 58.0664 0.533468 58.5338 0.338803ZM60.2643 4.53208V19.5179H75.2006L60.2643 4.53208Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.8569 20.2934C58.0505 19.8234 58.5069 19.517 59.013 19.517H78.2241C78.9151 19.517 79.4753 20.0798 79.4753 20.774V40.049C79.4753 40.5572 79.1707 41.0155 78.7034 41.2102C78.236 41.405 77.6978 41.2977 77.3399 40.9385L58.1289 21.6635C57.7705 21.3041 57.6633 20.7633 57.8569 20.2934ZM62.0365 22.0311L76.9729 37.017V22.0311H62.0365Z"}),jsxRuntime.jsx("path",{d:"M269.838 49.4457H249.005C249.266 51.801 250.162 53.6985 251.695 55.1377C253.225 56.577 255.134 57.2967 257.416 57.2967C259.307 57.2967 260.887 56.8715 262.159 56.021C263.463 55.1377 264.408 53.9927 264.996 52.5862H269.251C268.502 54.9415 267.084 56.937 264.996 58.5725C262.943 60.208 260.414 61.026 257.416 61.026C255.069 61.026 252.917 60.4697 250.961 59.3575C249.037 58.2127 247.504 56.6587 246.363 54.696C245.255 52.7332 244.7 50.558 244.7 48.17C244.7 45.782 245.255 43.6067 246.363 41.644C247.504 39.6812 249.037 38.1437 250.961 37.0315C252.917 35.8867 255.069 35.3142 257.416 35.3142C259.73 35.3142 261.833 35.8702 263.724 36.9825C265.615 38.0947 267.098 39.6485 268.176 41.644C269.283 43.6395 269.838 45.913 269.838 48.4645V49.4457ZM257.416 39.0432C255.263 39.0432 253.439 39.6812 251.939 40.957C250.47 42.2327 249.542 43.9337 249.152 46.06H265.583C265.192 43.9992 264.262 42.3145 262.796 41.006C261.36 39.6975 259.568 39.0432 257.416 39.0432Z"}),jsxRuntime.jsx("path",{d:"M228.356 60.5352V35.8049H232.219V39.7794H232.464C233.05 38.5689 233.963 37.5712 235.202 36.7862C236.474 35.9684 237.974 35.5594 239.701 35.5594H243.125V39.4359H239.701C237.517 39.4359 235.757 40.1554 234.42 41.5949C233.083 43.0342 232.414 44.9152 232.414 47.2377V60.5352H228.356Z"}),jsxRuntime.jsx("path",{d:"M208.607 61.0259C205.64 61.0259 203.326 60.1262 201.663 58.3272C200 56.4952 199.169 53.8947 199.169 50.5252V35.8047H203.228V49.8874C203.228 52.2427 203.766 54.0744 204.842 55.3829C205.95 56.6587 207.532 57.2967 209.586 57.2967C211.02 57.2967 212.308 56.9694 213.449 56.3152C214.623 55.6284 215.536 54.6959 216.188 53.5184C216.84 52.3407 217.166 50.9997 217.166 49.4949V35.8047H221.225V60.5352H217.313V56.5607H217.068C216.286 57.9019 215.161 58.9814 213.694 59.7992C212.226 60.6169 210.531 61.0259 208.607 61.0259Z"}),jsxRuntime.jsx("path",{d:"M186.736 39.534V56.806H194.756V60.5352H182.677V39.534H177.199V35.8047H182.677V29.5732H186.736V35.8047H193.24V39.534H186.736Z"}),jsxRuntime.jsx("path",{d:"M156.585 60.5352H151.988L158.394 48.0227L152.33 35.8047H156.976L162.062 46.0599H165.388L170.474 35.8047H175.022L168.958 48.0227L175.365 60.5352H170.67L165.29 49.7892H162.013L156.585 60.5352Z"}),jsxRuntime.jsx("path",{d:"M150.138 49.1315H129.304C129.565 51.4867 130.461 53.3842 131.994 54.8235C133.526 56.2627 135.433 56.9825 137.715 56.9825C139.606 56.9825 141.188 56.5572 142.459 55.7067C143.763 54.8235 144.709 53.6785 145.296 52.272H149.551C148.801 54.6272 147.382 56.6227 145.296 58.2582C143.242 59.8937 140.715 60.7118 137.715 60.7118C135.368 60.7118 133.216 60.1555 131.26 59.0432C129.336 57.8985 127.804 56.3445 126.663 54.3817C125.554 52.419 125 50.2437 125 47.8557C125 45.4677 125.554 43.2925 126.663 41.3298C127.804 39.367 129.336 37.8295 131.26 36.7173C133.216 35.5725 135.368 35 137.715 35C140.03 35 142.133 35.556 144.024 36.6682C145.915 37.7805 147.399 39.3342 148.475 41.3298C149.583 43.3252 150.138 45.5987 150.138 48.1502V49.1315ZM137.715 38.729C135.564 38.729 133.738 39.367 132.238 40.6427C130.771 41.9185 129.842 43.6195 129.45 45.7458H145.883C145.491 43.685 144.562 42.0002 143.095 40.6917C141.661 39.3832 139.867 38.729 137.715 38.729Z"}),jsxRuntime.jsx("path",{d:"M116.961 60.5353H112.559V30.4072H101.164V26.1875H128.307V30.4072H116.961V60.5353Z"})]}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("clipPath",{id:"clip0_796_283",children:jsxRuntime.jsx("rect",{width:"270",height:"80",fill:"white"})})})]})}let i=r||80;return jsxRuntime.jsxs("svg",{width:i,height:i,viewBox:"0 0 80 80",xmlns:"http://www.w3.org/2000/svg",className:a,style:n?{fill:n}:void 0,children:[jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.223654 20.2934C0.417233 19.8234 0.873598 19.517 1.37984 19.517H20.5909C21.282 19.517 21.8422 20.0798 21.8422 20.774V40.049C21.8422 40.5572 21.5375 41.0155 21.0702 41.2102C20.6028 41.405 20.0647 41.2977 19.7067 40.9385L0.495628 21.6635C0.137428 21.3041 0.030075 20.7633 0.223654 20.2934ZM4.40349 22.0311L19.3396 37.017V22.0311H4.40349Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 20.2934C38.8394 19.8234 39.2958 19.517 39.802 19.517H59.013C59.7041 19.517 60.2642 20.0798 60.2642 20.774V40.049C60.2642 40.5572 59.9597 41.0155 59.4923 41.2102C59.025 41.405 58.4867 41.2977 58.1289 40.9385L38.9178 21.6635C38.5595 21.3041 38.4522 20.7633 38.6458 20.2934ZM42.8255 22.0311L57.7618 37.017V22.0311H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.4347 58.8447C19.6283 58.3747 20.0847 58.0685 20.5909 58.0685H39.802C40.493 58.0685 41.0532 58.6312 41.0532 59.3255V78.6005C41.0532 79.1087 40.7486 79.567 40.2813 79.7617C39.8139 79.9562 39.2757 79.849 38.9178 79.49L19.7067 60.215C19.3485 59.8555 19.2411 59.3147 19.4347 58.8447ZM23.6146 60.5825L38.5508 75.5682V60.5825H23.6146Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 58.1643C39.79 57.9695 40.3283 58.0768 40.6861 58.436L59.8972 77.711C60.2555 78.0703 60.3628 78.6113 60.1692 79.081C59.9756 79.551 59.5192 79.8575 59.013 79.8575H39.802C39.1109 79.8575 38.5508 79.2948 38.5508 78.6005V59.3255C38.5508 58.8173 38.8554 58.359 39.3227 58.1643ZM41.0532 62.3575V77.3433H55.9893L41.0532 62.3575Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 19.6129C39.79 19.4182 40.3283 19.5254 40.6861 19.8846L59.8972 39.1595C60.2555 39.519 60.3628 40.0598 60.1692 40.5298C59.9756 40.9995 59.5192 41.306 59.013 41.306H39.802C39.1109 41.306 38.5508 40.7433 38.5508 40.049V20.7741C38.5508 20.2658 38.8554 19.8075 39.3227 19.6129ZM41.0532 23.8061V38.792H55.9893L41.0532 23.8061Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 38.8885C39.79 38.694 40.3283 38.8012 40.6861 39.1602L59.8972 58.4352C60.2555 58.7945 60.3628 59.3355 60.1692 59.8055C59.9756 60.2752 59.5192 60.5817 59.013 60.5817H39.802C39.1109 60.5817 38.5508 60.019 38.5508 59.3247V40.0497C38.5508 39.5415 38.8554 39.0832 39.3227 38.8885ZM41.0532 43.0817V58.0675H55.9893L41.0532 43.0817Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 39.569C38.8394 39.0992 39.2958 38.7927 39.802 38.7927H59.013C59.7041 38.7927 60.2642 39.3555 60.2642 40.0497V59.3247C60.2642 59.833 59.9597 60.2912 59.4923 60.486C59.025 60.6805 58.4867 60.5732 58.1289 60.2142L38.9178 40.9392C38.5595 40.5797 38.4522 40.039 38.6458 39.569ZM42.8255 41.3067L57.7618 56.2927V41.3067H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 58.8447C38.8394 58.3747 39.2958 58.0685 39.802 58.0685H59.013C59.7041 58.0685 60.2642 58.6312 60.2642 59.3255V78.6005C60.2642 79.1087 59.9597 79.567 59.4923 79.7617C59.025 79.9562 58.4867 79.849 58.1289 79.49L38.9178 60.215C38.5595 59.8555 38.4522 59.3147 38.6458 58.8447ZM42.8255 60.5825L57.7618 75.5682V60.5825H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M58.5338 19.6129C59.0011 19.4182 59.5394 19.5254 59.8972 19.8846L79.1083 39.1595C79.4666 39.519 79.5739 40.0598 79.3803 40.5298C79.1867 40.9995 78.7303 41.306 78.2241 41.306H59.013C58.322 41.306 57.7618 40.7433 57.7618 40.049V20.7741C57.7618 20.2658 58.0664 19.8075 58.5338 19.6129ZM60.2643 23.8061V38.792H75.2006L60.2643 23.8061Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M58.5338 0.338803C59.0011 0.144135 59.5394 0.251385 59.8972 0.610565L79.1083 19.8855C79.4666 20.2449 79.5739 20.7857 79.3803 21.2556C79.1867 21.7256 78.7303 22.032 78.2241 22.032H59.013C58.322 22.032 57.7618 21.4692 57.7618 20.775V1.50003C57.7618 0.99174 58.0664 0.533468 58.5338 0.338803ZM60.2643 4.53208V19.5179H75.2006L60.2643 4.53208Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.8569 20.2934C58.0505 19.8234 58.5069 19.517 59.013 19.517H78.2241C78.9151 19.517 79.4753 20.0798 79.4753 20.774V40.049C79.4753 40.5572 79.1707 41.0155 78.7034 41.2102C78.236 41.405 77.6978 41.2977 77.3399 40.9385L58.1289 21.6635C57.7705 21.3041 57.6633 20.7633 57.8569 20.2934ZM62.0365 22.0311L76.9729 37.017V22.0311H62.0365Z"})]})};var Wl=({topItems:e=[],bottomItems:t=[],bottomContent:r,logo:o,showLogo:n=true,linkComponent:a="a",className:i="",mobileMenuId:s="app-mobile-menu",sidebarCollapseId:c="app-sidebar-collapse"})=>{let l=m=>m.length>0&&"items"in m[0],d=m=>l(m)?m:[{id:"default-section",items:m}],u=(m,f,g)=>jsxRuntime.jsxs("div",{className:"space-y-0.5",children:[m.title&&jsxRuntime.jsx("div",{className:"px-6 py-1 text-xs font-medium text-text-secondary uppercase tracking-wider",children:m.title}),jsxRuntime.jsx("div",{className:"space-y-0.5",children:m.items.map(b=>p(b))}),f<g-1&&jsxRuntime.jsx("div",{className:"border-b border-border-subtle mx-6 my-2"})]},m.id),p=(m,f=false)=>{if(m.children&&m.children.length>0){let x=`category-${m.id}`;return jsxRuntime.jsxs("div",{className:"group/category",children:[jsxRuntime.jsx("input",{type:"checkbox",id:x,className:"peer/category hidden",defaultChecked:m.isExpanded,"aria-hidden":"true"}),jsxRuntime.jsxs("label",{htmlFor:x,className:"flex items-center gap-3 px-6 py-1 text-text-primary hover:bg-background-hover hover:text-text-primary cursor-pointer transition-all duration-200",children:[m.icon&&jsxRuntime.jsx("span",{className:"flex-shrink-0 w-3.5 h-3.5 flex items-center justify-center transition-all duration-200",children:m.icon}),jsxRuntime.jsx("span",{className:"transition-all duration-200",children:m.label}),jsxRuntime.jsx("span",{className:"flex-1"}),jsxRuntime.jsx("svg",{className:"w-4 h-4 transform transition-transform duration-200 peer-checked/category:rotate-180 ml-auto",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),jsxRuntime.jsx("div",{className:"hidden peer-checked/category:block bg-background-subtle border-l-2 border-border-subtle ml-6",children:m.children.map(h=>p(h,true))})]},m.id)}let g={href:m.href||"#",className:`flex items-center gap-3 transition-all duration-200 hover:bg-background-hover ${f?"pl-8 pr-6 py-1 text-sm":"px-6 py-1"} ${m.isActive?`bg-action-brand/10 text-action-brand ${f?"":"border-l-2 border-action-brand"}`:"text-text-primary hover:text-text-primary"}`,"aria-current":m.isActive?"page":void 0},b=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[m.icon&&!f&&jsxRuntime.jsx("span",{className:"flex-shrink-0 w-3.5 h-3.5 flex items-center justify-center transition-all duration-200",children:m.icon}),jsxRuntime.jsx("span",{className:"transition-all duration-200",children:m.label})]});return a==="a"?jsxRuntime.jsx("a",{...g,children:b},m.id):jsxRuntime.jsx(a,{...g,children:b},m.id)};return jsxRuntime.jsxs("div",{className:`flex flex-col h-full ${i}`,children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between h-[60px] px-6 border-b border-border-default",children:[n&&jsxRuntime.jsx("div",{className:"relative top-[-1px] transition-all duration-200",children:o||jsxRuntime.jsx(ei,{showWordmark:true,width:120})}),jsxRuntime.jsx("label",{htmlFor:c,className:"hidden md:flex items-center justify-center w-8 h-8 rounded hover:bg-background-hover cursor-pointer transition-all duration-200 relative top-[-1px]","aria-label":"Collapse sidebar",children:jsxRuntime.jsx(xr,{name:"Sidebar",size:"sm"})}),jsxRuntime.jsx("label",{htmlFor:s,className:"md:hidden flex items-center justify-center w-8 h-8 rounded hover:bg-background-hover cursor-pointer transition-colors","aria-label":"Close menu",children:jsxRuntime.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),jsxRuntime.jsxs("nav",{className:"flex-1 flex flex-col overflow-hidden",children:[e&&e.length>0&&jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto py-2 scrollbar-hide",children:d(e).map((m,f,g)=>u(m,f,g.length))}),t&&t.length>0&&jsxRuntime.jsx("div",{className:"flex-shrink-0 border-t bg-background-muted/30",children:jsxRuntime.jsx("div",{className:"mt-2 pb-2 space-y-0.5",children:t.map(m=>p(m))})}),r&&jsxRuntime.jsx("div",{className:"flex-shrink-0 border-t border-border-default",children:jsxRuntime.jsx("div",{children:r})})]})]})};function Wn(e){return e.id??e.href??e.label}function Dp(e,t,r=[]){for(let o of e){if(o.href===t||o.id===t)return o.children?.length&&o.pushOnSelect!==false?[...r,Wn(o)]:r;if(o.children?.length){let n=Dp(o.children,t,[...r,Wn(o)]);if(n)return n}}return null}function Mx(e,t){let r=[],o=e;for(let n of t){let a=o.find(i=>Wn(i)===n);if(!a)break;r.push(a),o=a.children??[];}return r}function iN(e,t,r){let o=t.length>0?[...e,...t]:e,n=[{path:[],items:e,bottomItems:t.length>0?t:void 0}],a=Mx(o,r),i=[];for(let s of a){if(!s.children?.length)break;i=[...i,Wn(s)],n.push({path:i,parent:s,items:s.children});}return n}var sN=({href:e,...t})=>jsxRuntime.jsx("a",{href:e,...t}),Px=[];function lN(e){let t=[];for(let r of e){let o=r.items??[];o.length!==0&&(t.length>0&&t.push({id:`__divider__${r.id}`,label:"",divider:true}),r.title&&t.push({id:`__group__${r.id}`,label:r.title,groupLabel:true}),t.push(...o));}return t}function cN(e,t){if(process.env.NODE_ENV==="production"||t.length===0)return;let r=new Map;for(let o of e)o.id&&r.set(o.id,"id"),o.href&&!r.has(o.href)&&r.set(o.href,"href");for(let o of t){let n=null;o.id&&r.has(o.id)?n=r.get(o.id)==="id"?`id "${o.id}"`:`id "${o.id}" (matches an items \`href\`)`:o.href&&r.has(o.href)&&(n=r.get(o.href)==="href"?`href "${o.href}"`:`href "${o.href}" (matches an items \`id\`)`),n&&console.warn(`[StackNav] L1 ${n} appears in both \`items\` and \`bottomItems\`. Stack tokens and value lookups will resolve to the \`items\` entry, making the bottomItems entry unreachable. L1 ids and hrefs must be unique across both arrays.`);}}function dN(e){if(!e)return {};let t={};return e.background!==void 0&&(t["--edges-stack-nav-background"]=e.background),e.activeBackground!==void 0&&(t["--edges-stack-nav-row-active-background"]=e.activeBackground),e.activeColor!==void 0&&(t["--edges-stack-nav-row-active-color"]=e.activeColor),e.hoverBackground!==void 0&&(t["--edges-stack-nav-row-hover-background"]=e.hoverBackground),e.borderColor!==void 0&&(t["--edges-stack-nav-border-color"]=e.borderColor),t}function Gl({items:e,groups:t,bottomItems:r,value:o,defaultStack:n,stack:a,onStackChange:i,onSelect:s,linkComponent:c=sN,showLogo:l=false,logo:d,header:u,footer:p,mobileMenuId:m,sidebarCollapseId:f,rootLabel:g,sticky:b=true,width:x=260,ariaLabel:h="Navigation",theme:y,animated:v=true,style:S,className:w}){process.env.NODE_ENV!=="production"&&t&&e&&console.warn("[StackNav] Both `items` and `groups` were provided. `groups` takes precedence and `items` is ignored.");let N=He__namespace.useMemo(()=>t?lN(t):e??Px,[t,e]),D=r??Px,R=He__namespace.useMemo(()=>D.length>0?[...N,...D]:N,[N,D]);He__namespace.useEffect(()=>{cN(N,D);},[N,D]);let[A,O]=He__namespace.useState(()=>a!==void 0?a:n!==void 0?n:o?Dp(R,o)??[]:[]),P=a??A,T=He__namespace.useCallback(M=>{a===void 0&&O(M),i?.(M);},[a,i]),k=He__namespace.useRef(false);He__namespace.useEffect(()=>{if(a!==void 0||!k.current&&(k.current=true,n!==void 0)||!o)return;let M=Dp(R,o);O(E=>{let z=M??[];return fN(E,z)?E:z});},[o,R,a,n]);let V=He__namespace.useMemo(()=>iN(N,D,P),[N,D,P]),H=He__namespace.useCallback((M,E)=>{M.children?.length&&T([...E,Wn(M)]);},[T]),I=He__namespace.useCallback(()=>{T(P.slice(0,-1));},[P,T]),q=He__namespace.useCallback((M,E)=>{let z=Mx(R,P);if(s?.(E,z),!!E.children?.length&&E.pushOnSelect!==false){let C=V[V.length-1]?.path??[];H(E,C);}E.href||M.preventDefault();},[R,P,s,H,V]),j=He__namespace.useCallback(M=>o?M.href===o||M.id===o:false,[o]),K=b?"sticky top-0 h-[100dvh]":"",Y={...x!=null?{width:x}:{},...dN(y),...S};return jsxRuntime.jsxs("aside",{role:"navigation","aria-label":h,"data-edges-stack-nav":"",className:tailwindMerge.twMerge("edges-stack-nav flex flex-col flex-shrink-0 overflow-hidden",v&&"edges-stack-nav--animated",K,w),style:Y,children:[l?jsxRuntime.jsxs("div",{className:"edges-stack-nav__logo",children:[jsxRuntime.jsx("div",{className:"relative top-[-1px]",children:d??jsxRuntime.jsx(ei,{showWordmark:true,width:120})}),f?jsxRuntime.jsx("label",{htmlFor:f,className:"hidden md:flex items-center justify-center w-8 h-8 rounded hover:bg-background-hover cursor-pointer transition-all duration-200 relative top-[-1px]","aria-label":"Collapse sidebar",children:jsxRuntime.jsx(xr,{name:"Sidebar",size:"sm"})}):null,m?jsxRuntime.jsx("label",{htmlFor:m,className:"md:hidden flex items-center justify-center w-8 h-8 rounded hover:bg-background-hover cursor-pointer transition-colors","aria-label":"Close menu",children:jsxRuntime.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}):null]}):null,u?jsxRuntime.jsx("div",{className:"edges-stack-nav__header",children:u}):null,jsxRuntime.jsx("div",{className:"relative flex-1 overflow-hidden",children:V.map((M,E)=>{let z=M.path.length,B=E===V.length-1,C=E<V.length-1,W=z===0?"__root__":M.path.join("/");return jsxRuntime.jsx(uN,{pane:M,parentPath:M.path.slice(0,-1),depth:z,isTop:B,isAbove:C,rootLabel:g,LinkComponent:c,isActive:j,onSelect:q,onBack:I,animated:v},W)})}),p?jsxRuntime.jsx("div",{className:"edges-stack-nav__footer",children:p}):null]})}function uN({pane:e,depth:t,isTop:r,isAbove:o,rootLabel:n,LinkComponent:a,isActive:i,onSelect:s,onBack:c,animated:l}){let d=r?"edges-stack-nav__pane--top":o?"edges-stack-nav__pane--above":"edges-stack-nav__pane--below";return jsxRuntime.jsxs("nav",{"aria-label":e.parent?.label??n??"Navigation","aria-hidden":r?void 0:true,inert:r?void 0:true,className:tailwindMerge.twMerge("edges-stack-nav__pane absolute inset-0 flex flex-col gap-px overflow-y-auto px-2 py-3",!l&&"edges-stack-nav__pane--instant",d),children:[t>0&&e.parent?jsxRuntime.jsxs("button",{type:"button",className:"edges-stack-nav__back edges-stack-nav__row flex w-full cursor-pointer items-center gap-2 rounded-sm border-0 bg-transparent px-3 py-2 mb-2 text-left text-sm font-semibold text-text-primary",onClick:c,"aria-label":`Back from ${e.parent.label}`,children:[jsxRuntime.jsx(mN,{}),jsxRuntime.jsx("span",{children:e.parent.label})]}):n?jsxRuntime.jsx("div",{className:"px-3 pb-1.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-text-secondary",children:n}):null,e.items.map(u=>jsxRuntime.jsx(Rx,{item:u,LinkComponent:a,isActive:i(u),onSelect:s},Wn(u))),e.bottomItems&&e.bottomItems.length>0?jsxRuntime.jsx("div",{className:"edges-stack-nav__bottom-items mt-auto flex flex-col gap-px pt-3",children:e.bottomItems.map(u=>jsxRuntime.jsx(Rx,{item:u,LinkComponent:a,isActive:i(u),onSelect:s},Wn(u)))}):null]})}function Rx({item:e,LinkComponent:t,isActive:r,onSelect:o}){if(e.divider)return jsxRuntime.jsx("div",{className:"edges-stack-nav__divider my-2",role:"separator"});if(e.groupLabel)return jsxRuntime.jsx("div",{className:"px-3 pt-6 pb-1.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-text-secondary",children:e.label});let n=!!e.children?.length,a=tailwindMerge.twMerge("edges-stack-nav__row flex items-center justify-between gap-3 rounded-sm px-3 py-2 text-sm font-normal text-text-primary no-underline cursor-pointer text-left bg-transparent border-0 transition-colors",r&&"edges-stack-nav__row--active font-semibold"),i=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[e.leading??e.icon?jsxRuntime.jsx("span",{className:"flex-shrink-0",children:e.leading??e.icon}):null,jsxRuntime.jsx("span",{className:"truncate",children:e.label})]}),jsxRuntime.jsxs("span",{className:"flex flex-shrink-0 items-center gap-2 text-text-secondary",children:[e.trailing,n?jsxRuntime.jsx(pN,{}):null]})]});return e.href?jsxRuntime.jsx(t,{href:e.href,"aria-label":e.ariaLabel,className:a,"aria-current":r?"page":void 0,onClick:s=>o(s,e),children:i}):jsxRuntime.jsx("button",{type:"button",className:a,"aria-label":e.ariaLabel,onClick:s=>{o(s,e);},children:i})}function pN(){return jsxRuntime.jsx("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:"M4.5 3 7.5 6 4.5 9"})})}function mN(){return jsxRuntime.jsx("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:"M8.5 3 4.5 7 8.5 11"})})}function fN(e,t){if(e===t)return true;if(e.length!==t.length)return false;for(let r=0;r<e.length;r+=1)if(e[r]!==t[r])return false;return true}var rs=({rightContent:e,centerContent:t,showMobileMenu:r=true,avatar:o,showColorModeSwitcher:n=false,toggleTheme:a,isDarkThemeEnabled:i=false,colorMode:s,actions:c,className:l="",mobileMenuId:d="app-mobile-menu"})=>{let u=()=>{switch(s||(i?"dark":"light")){case "system":return jsxRuntime.jsx(xr,{name:"Monitor",size:"sm"});case "light":return jsxRuntime.jsx(xr,{name:"Sun",size:"sm"});case "dark":return jsxRuntime.jsx(xr,{name:"Moon",size:"sm"})}},p=()=>{switch(s||(i?"dark":"light")){case "system":return "Switch to light mode";case "light":return "Switch to dark mode";case "dark":return "Switch to system mode";default:return "Toggle theme"}};return jsxRuntime.jsx("header",{className:`h-[60px] bg-background-surface border-b ${l}`,children:jsxRuntime.jsxs("div",{className:"relative flex h-full items-center",children:[jsxRuntime.jsx("div",{className:"flex items-center h-full flex-shrink-0",children:r&&jsxRuntime.jsx("label",{htmlFor:d,className:"md:hidden cursor-pointer","aria-label":"Open menu",children:jsxRuntime.jsx("div",{className:"flex h-full w-14 flex-col items-center justify-center border-r hover:bg-background-hover transition-colors",children:jsxRuntime.jsx(xr,{name:"List",size:"sm"})})})}),t&&jsxRuntime.jsx("div",{className:"flex-1 flex justify-end md:justify-center md:px-4 min-w-0",children:jsxRuntime.jsx("div",{className:"w-full md:max-w-4xl min-w-0",children:t})}),!t&&jsxRuntime.jsx("div",{className:"flex-1"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-4 pr-4 flex-shrink-0 ml-4",children:[e,n&&a&&jsxRuntime.jsx("button",{type:"button",onClick:a,className:"flex items-center justify-center w-8 h-8 rounded hover:bg-background-hover transition-colors","aria-label":p(),children:u()}),c,o&&jsxRuntime.jsx("div",{className:"flex items-center",children:o})]})]})})};function Ex({sideNav:e,stackNav:t,topNav:r,children:o,contentPaddingX:n,contentPaddingY:a,showSidebarBorder:i=true,mainClassName:s,enableJsEnhancements:c=false}){let l="app-mobile-menu",d="app-sidebar-collapse";return He.useEffect(()=>{if(!c)return;let u=document.getElementById(d),p=document.getElementById(l),m=document.querySelector("[data-app-shell]"),f=document.getElementById("app-sidebar");if(!u||!m||!f)return;let g=null,b=false;try{let A=localStorage.getItem("sidebar-collapsed");A!==null&&(u.checked=A==="true");}catch{}let x=()=>{try{localStorage.setItem("sidebar-collapsed",String(u.checked));}catch{}u.checked?b=true:(g&&(clearTimeout(g),g=null),m.removeAttribute("data-peek"),b=false);};u.addEventListener("change",x);let h=A=>{A.key==="Escape"&&(p&&(p.checked=false),m.removeAttribute("data-peek"));};document.addEventListener("keydown",h);let y=null;p&&(y=()=>{document.body.style.overflow=p.checked?"hidden":"";},p.addEventListener("change",y));let v=A=>{let P=A.target.closest("a");P&&P.href&&window.innerWidth<768&&p&&setTimeout(()=>{p.checked=false,document.body.style.overflow="";},100);};f.addEventListener("click",v);let S=16,w=200,N=()=>{g&&(clearTimeout(g),g=null),m.getAttribute("data-peek")!=="true"&&m.setAttribute("data-peek","true");},D=()=>{g&&clearTimeout(g),g=setTimeout(()=>{m.removeAttribute("data-peek"),g=null;},w);},R=A=>{if(window.innerWidth<768||!u.checked)return;let O=f.contains(A.target);if(b&&!O&&(b=false),b)return;A.clientX<=S||O?N():m.getAttribute("data-peek")==="true"&&D();};return document.addEventListener("mousemove",R),()=>{u.removeEventListener("change",x),document.removeEventListener("keydown",h),p&&y&&p.removeEventListener("change",y),f.removeEventListener("click",v),document.removeEventListener("mousemove",R),g&&clearTimeout(g);}},[c,l,d]),jsxRuntime.jsxs("div",{className:"min-h-[100dvh] bg-background text-text-primary relative","data-app-shell":"",children:[jsxRuntime.jsx("input",{type:"checkbox",id:d,className:"sr-only peer/sidebar","aria-hidden":"true"}),jsxRuntime.jsx("a",{href:"#app-content",className:"sr-only focus:not-sr-only focus:absolute focus:left-4 focus:top-4 z-50 rounded px-3 py-2 bg-background-surface shadow",children:"Skip to content"}),jsxRuntime.jsx(rs,{...r,mobileMenuId:l,className:["sticky top-0 flex-shrink-0 z-30 md:hidden",r?.className].filter(Boolean).join(" ")}),jsxRuntime.jsxs("div",{className:"flex w-full h-[calc(100dvh-60px)] md:h-[100dvh] relative overflow-hidden",children:[jsxRuntime.jsx("input",{type:"checkbox",id:l,className:"sr-only peer/mobile","aria-hidden":"true"}),jsxRuntime.jsx("label",{htmlFor:l,className:"fixed inset-0 bg-background-modal z-[55] opacity-0 pointer-events-none peer-checked/mobile:opacity-100 peer-checked/mobile:pointer-events-auto transition-opacity md:hidden","aria-label":"Close menu"}),jsxRuntime.jsx("div",{"aria-hidden":"true","data-peek-zone":"",className:"hidden md:block fixed left-0 top-0 bottom-0 w-4 z-[70] pointer-events-none"}),jsxRuntime.jsx("label",{htmlFor:d,"data-expand-rail":"",className:"hidden fixed left-3 top-3 z-[75] items-center justify-center w-9 h-9 rounded-md bg-background-surface border border-border-default shadow-sm hover:bg-background-hover cursor-pointer transition-all duration-200","aria-label":"Expand sidebar",children:jsxRuntime.jsx(xr,{name:"Sidebar",size:"sm"})}),jsxRuntime.jsx("aside",{id:"app-sidebar","data-app-sidebar":"",className:["bg-background-surface","border-r border-border-default","transition-transform duration-300 ease-in-out md:transition-[transform,width] md:duration-300 md:ease-in-out","fixed md:relative","left-0 top-0 bottom-0","z-[60] md:z-10","w-full md:w-64","h-[100dvh] md:h-full","-translate-x-full","peer-checked/mobile:translate-x-0","md:translate-x-0",i?"":"!border-r-0",(t??e)?.className||""].filter(Boolean).join(" "),children:t?jsxRuntime.jsx(Gl,{...t,mobileMenuId:l,sidebarCollapseId:d,sticky:false,width:null,className:["h-full !border-r-0",t.className].filter(Boolean).join(" ")}):jsxRuntime.jsx(Wl,{...e,mobileMenuId:l,sidebarCollapseId:d,className:"h-full"})}),jsxRuntime.jsxs("div",{className:"flex-1 flex flex-col h-full overflow-hidden",children:[jsxRuntime.jsx("div",{className:"sticky top-0 flex-shrink-0 hidden md:block z-20","data-top-nav-wrapper":"",children:jsxRuntime.jsx(rs,{...r,className:r?.className})}),jsxRuntime.jsx("main",{id:"app-content",className:["flex-1 overflow-y-auto overflow-x-hidden bg-background-body",n,a,s||""].join(" "),role:"main",children:o})]})]}),jsxRuntime.jsx("style",{dangerouslySetInnerHTML:{__html:`
4
+ `);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("style",{dangerouslySetInnerHTML:{__html:u}}),jsxRuntime.jsx("div",{"data-brand-scope":n,children:r})]})}var Ja=new Map,n2=8;function a2(e){if(!e.startsWith("var("))return e;let t=e.slice(4,e.lastIndexOf(")")).trim(),r=t.indexOf(",");return (r===-1?t:t.slice(0,r)).trim()}var Pt=(e,t="#000000")=>typeof window>"u"?t:Jb(e,t,0);function Jb(e,t,r){if(r>n2)return t;let o=e.startsWith("var(")?a2(e):e.startsWith("--")?e:`--${e}`;if(!e.startsWith("--")&&!e.startsWith("var(")&&!o.startsWith("--color-")&&(o=`--color-${o.slice(2)}`),Ja.has(o))return Ja.get(o);try{let n=document.body||document.documentElement,i=getComputedStyle(n).getPropertyValue(o).trim();if(i){if(i.startsWith("var(")){let l=Jb(i,t,r+1);return Ja.set(o,l),l}return Ja.set(o,i),i}let s=document.createElement("div");s.style.color=`var(${o})`,document.body.appendChild(s);let c=getComputedStyle(s).color;return document.body.removeChild(s),c&&c!=="rgb(0, 0, 0)"?(Ja.set(o,c),c):t}catch(n){return console.warn(`Failed to resolve color for ${e}:`,n),t}}var Ll=()=>{Ja.clear();},Bn=()=>{let e=[];for(let t=1;t<=12;t++){let r=Pt(`--color-viz-categorical-${t}`,"");r&&e.push(r);}return e.length===0?$b():e},$b=()=>["#5424db","#d92361","#e86a00","#5d89ff","#9a47e2","#f24cb8","#0ba286","#9c28af","#036e45","#52a119","#ff513d","#046691"],ji=()=>Pt("--color-viz-default","#444ae1"),i2=(e,t)=>{let r={},o=Bn();return e.forEach((n,a)=>{t&&t[n]?r[n]=t[n]:r[n]=o[a%o.length];}),r};var Xb=e=>{let t=e.match(/\d+/g);if(!t||t.length<3)return true;let[r,o,n]=t.map(Number);return (.299*r+.587*o+.114*n)/255>.5},s2=e=>Xb(e)?Pt("--color-text-primary","#333333"):Pt("--color-text-inverse","#ffffff"),Zb=(e,t)=>{if(!e||typeof e!="object")return console.warn("[Colors] Invalid GeoJSON data provided to extractUniqueValues"),[];if(!("type"in e)||e.type!=="FeatureCollection"&&e.type!=="Feature")return console.warn("[Colors] Data is not valid GeoJSON (missing type or invalid type)"),[];let r=new Set,o="features"in e?e.features:[e];if(!Array.isArray(o)||o.length===0)return console.warn("[Colors] No features found in GeoJSON data"),[];let n=0;return o.forEach(a=>{if(!(!a||typeof a!="object")&&a.properties&&t in a.properties){n++;let i=a.properties[t];i!=null&&r.add(i);}}),n===0&&console.warn(`[Colors] Property "${t}" not found on any features. Available properties: ${o[0]?.properties?Object.keys(o[0].properties).join(", "):"none"}`),Array.from(r).sort()},sp=e=>{let t=Bn(),r={};return e.forEach((o,n)=>{r[o]=t[n%t.length];}),r};var lp=(e,t)=>{if(!e||typeof e!="object")return console.warn("[Colors] Invalid GeoJSON data provided to extractNumericValues"),[];if(!("type"in e)||e.type!=="FeatureCollection"&&e.type!=="Feature")return console.warn("[Colors] Data is not valid GeoJSON (missing type or invalid type)"),[];let r="features"in e?e.features:[e];if(!Array.isArray(r)||r.length===0)return console.warn("[Colors] No features found in GeoJSON data"),[];let o=new Set,n=0;return r.forEach(a=>{if(!(!a||typeof a!="object")&&a.properties&&t in a.properties){n++;let i=a.properties[t];typeof i=="number"&&!isNaN(i)&&o.add(i);}}),n===0&&console.warn(`[Colors] Property "${t}" not found on any features. Available properties: ${r[0]?.properties?Object.keys(r[0].properties).join(", "):"none"}`),Array.from(o).sort((a,i)=>a-i)},cp=e=>e.length===0?(console.warn("[Colors] Cannot calculate bounds from empty array"),{min:0,max:1}):{min:e[0],max:e[e.length-1]},Qb=(e,t)=>{if(typeof t=="number")return t;if(e.length===0)return console.warn("[Colors] Cannot calculate center from empty array, defaulting to 0"),0;if(t==="median"){let r=Math.floor(e.length/2);return e.length%2===0?(e[r-1]+e[r])/2:e[r]}return e.reduce((r,o)=>r+o,0)/e.length},dp=(e="viridis")=>{let o=`viz-sequential-${{redYellowGreen:"red-yellow-green"}[e]||e}`,n=[];for(let a=1;a<=10;a++){let i=`${o}-${a}`,s=Pt(i);n.push(s);}return n},up=(e="redYellowBlue")=>{let o=`viz-diverging-${{orangeYellowSeafoam:"orange-yellow-seafoam",redYellowBlue:"red-yellow-blue",redBlue:"red-blue"}[e]||e}`,n=[];for(let a=1;a<=10;a++){let i=`${o}-${a}`,s=Pt(i);n.push(s);}return n},Ji=(e,t,r,o="viridis")=>{let n=dp(o);if(e<=t)return n[0];if(e>=r)return n[n.length-1];if(t===r)return n[Math.floor(n.length/2)];let i=(e-t)/(r-t)*(n.length-1),s=Math.floor(i);return n[s]},$i=(e,t,r,o,n="redYellowBlue")=>{let a=up(n),i=4;if(e<=t)return a[0];if(e>=r)return a[a.length-1];if(e===o||t===r)return a[i];if(e<o){let c=(e-t)/(o-t)*i,l=Math.floor(c);return a[Math.min(l,i)]}else {let s=(e-o)/(r-o),c=i+s*(a.length-1-i),l=Math.floor(c);return a[Math.min(l,a.length-1)]}};var pp=He.createContext({mode:"system",colorMode:"light",isDarkTheme:false,toggleTheme:()=>{}}),Ht=()=>He.useContext(pp);function p2(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function tx(){if(typeof window>"u")return "system";let e=localStorage.getItem("colorModePreference");return e==="light"||e==="dark"||e==="system"?e:"system"}function rx(e){return e==="system"?p2():e}var nx=({children:e})=>{let[t,r]=He.useState(tx),[o,n]=He.useState(()=>rx(tx())),a=o==="dark",i=He.useCallback(c=>{c==="dark"?(document.documentElement.classList.add("theme-dark"),document.body.classList.add("theme-dark")):(document.documentElement.classList.remove("theme-dark"),document.body.classList.remove("theme-dark")),Ll();},[]);He.useEffect(()=>{Ll();let c=rx(t);if(n(c),i(c),t==="system"){let l=window.matchMedia("(prefers-color-scheme: dark)"),d=u=>{let p=u.matches?"dark":"light";n(p),i(p);};return l.addEventListener("change",d),()=>{l.removeEventListener("change",d);}}},[t,i]);let s=He.useCallback(()=>{r(c=>{let l=c==="system"?"light":c==="light"?"dark":"system";return localStorage.setItem("colorModePreference",l),l});},[]);return jsxRuntime.jsx(pp.Provider,{value:{mode:t,colorMode:o,isDarkTheme:a,toggleTheme:s},children:e})};function $a(e){return e instanceof Date&&!Number.isNaN(e.getTime())}function Vn(e,t){return $a(e)?t.format(e):""}function ax(e){if(!$a(e.start)||!$a(e.end))return ()=>"";if((e.end.getTime()-e.start.getTime())/(1e3*60*60)<=720){let i=new Intl.DateTimeFormat("en",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"});return s=>Vn(s,i)}let r=e.start.getFullYear(),o=e.end.getFullYear(),n=r!==o,a=new Intl.DateTimeFormat("en",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",...n&&{year:"numeric"}});return i=>Vn(i,a)}function Xi(e,t){if(!$a(e.start)||!$a(e.end))return ()=>"";let r=(e.end.getTime()-e.start.getTime())/(1e3*60*60),o=t?.compact??false,n=l=>d=>$a(d)?l(d):"";if(r<=24){if(o)return n(d=>{let u=d.getHours(),p=u>=12?"pm":"am";return `${u%12||12}${p}`});let l=new Intl.DateTimeFormat("en",{hour:"numeric",minute:"2-digit"});return d=>Vn(d,l)}if(r<=48){if(o)return n(d=>{let u=d.getMonth()+1,p=d.getDate(),m=d.getHours(),f=m>=12?"p":"a",g=m%12||12;return `${u}/${p} ${g}${f}`});let l=new Intl.DateTimeFormat("en",{month:"short",day:"numeric",hour:"numeric"});return d=>Vn(d,l)}if(r<=168){if(o)return n(d=>{let u=d.getDate();return `${d.toLocaleDateString("en",{weekday:"short"}).charAt(0)}${u}`});let l=new Intl.DateTimeFormat("en",{weekday:"short",day:"numeric"});return d=>Vn(d,l)}if(r<=720){if(o)return n(d=>{let u=d.getMonth()+1,p=d.getDate();return `${u}/${p}`});let l=new Intl.DateTimeFormat("en",{month:"short",day:"numeric"});return d=>Vn(d,l)}let a=e.start.getFullYear(),i=e.end.getFullYear(),s=a!==i;if(o)return n(l=>{let d=l.getMonth()+1,u=l.getDate(),p=s?`/${l.getFullYear().toString().slice(-2)}`:"";return `${d}/${u}${p}`});let c=new Intl.DateTimeFormat("en",{month:"short",day:"numeric",...s&&{year:"numeric"}});return l=>Vn(l,c)}function $e(e=false){return `${e?"outline outline-1 outline-border-input data-[focus-visible]:outline-2 data-[focus-visible]:outline-action-default data-[focus-visible]:outline-offset-0 invalid:outline-2 invalid:outline-feedback-error-border group-invalid:outline-2 group-invalid:outline-feedback-error-border forced-colors:focus:outline-[Highlight] forced-colors:focus:outline-2 forced-colors:focus:outline-offset-2":"outline-none data-[focus-visible]:outline data-[focus-visible]:outline-2 data-[focus-visible]:outline-action-default data-[focus-visible]:outline-offset-0 invalid:outline-2 invalid:outline-feedback-error-border group-invalid:outline-2 group-invalid:outline-feedback-error-border forced-colors:focus:outline-[Highlight] forced-colors:focus:outline-2 forced-colors:focus:outline-offset-2"}`}function ke(e,t){return reactAriaComponents.composeRenderProps(e,r=>tailwindMerge.twMerge(t,r))}var We={sm:{text:"text-[length:var(--control-text-sm)]",height:"h-[var(--control-sm-height)]",padding:"px-[var(--control-padding-sm)]",paddingY:"py-[var(--control-gap-sm)]",gap:"gap-[var(--control-gap-sm)]"},md:{text:"text-[length:var(--control-text-md)]",height:"h-[var(--control-md-height)]",padding:"px-[var(--control-padding-md)]",paddingY:"py-[var(--control-gap-md)]",gap:"gap-[var(--control-gap-md)]"},lg:{text:"text-[length:var(--control-text-lg)]",height:"h-[var(--control-lg-height)]",padding:"px-[var(--control-padding-lg)]",paddingY:"py-[var(--control-gap-lg)]",gap:"gap-[var(--control-gap-lg)]"},xl:{text:"text-[length:var(--control-text-xl)]",height:"h-[var(--control-xl-height)]",padding:"px-[var(--control-padding-xl)]",paddingY:"py-[var(--control-gap-xl)]",gap:"gap-[var(--control-gap-xl)]"}};var x2="flex font-medium justify-center items-center gap-2 text-center transition rounded-[var(--control-border-radius)] whitespace-nowrap box-border",h2="bg-action-primary text-[color:var(--color-action-primary-text)] hover:bg-action-primary-hover forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent",y2={primary:h2,secondary:"bg-action-secondary text-[color:var(--color-action-secondary-text)] border-2 border-border-muted hover:bg-action-secondary-hover forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[ButtonText]",ghost:"border-none text-text-primary hover:bg-text-primary/5 forced-colors:text-[ButtonText] forced-colors:hover:bg-[ButtonFace]",destructive:"bg-transparent text-feedback-error-text border-2 border-border-muted hover:bg-feedback-error-background/50 forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[Mark]",link:"!text-action-primary hover:text-action-primary/90 hover:underline hover:decoration-2 hover:underline-offset-4",icon:"border-none text-text-primary hover:bg-background-hover hover:text-text-primary forced-colors:text-[ButtonText] forced-colors:hover:bg-[ButtonFace] p-1 flex-shrink-0 rounded-[var(--control-border-radius)]",unstyled:"bg-transparent"},sx={full:"w-full",default:"w-fit"},v2="opacity-50 cursor-not-allowed pointer-events-none",C2="opacity-100 cursor-pointer",S2={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},w2={primary:"bg-action-primary text-[color:var(--color-action-primary-text)]",destructive:"bg-feedback-error-border text-text-inverse"};function T2(e){return !e||e==="default"||e==="brand"?"primary":e}function N2(e){let{variant:t="primary",size:r="md",isDisabled:o,fullWidth:n=false,isLoading:a=false}=e,i=T2(t),s=i==="unstyled"?"":`${x2} ${y2[i]}`;i!=="unstyled"&&(s+=` ${We[r].text} ${We[r].height} ${We[r].padding} ${We[r].gap}`),o||a?s+=` ${v2}`:s+=` ${C2}`,n?s+=` ${sx.full}`:s+=` ${sx.default}`;let c=i==="primary"?"focus-visible:outline-action-primary":void 0;return [s,$e(),c].filter(Boolean).join(" ")}function re(e){let{icon:t,children:r,isLoading:o=false,loadingText:n,loadingIndicator:a,size:i="md",iconPosition:s="left",iconWeight:c,href:l,className:d,badgeNumber:u,badgeVariant:p="primary",badgePosition:m="top-right",style:f,target:g,rel:b,...x}=e,h=t?jsxRuntime.jsx(U,{name:t,size:i,weight:c}):null,y=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s==="left"&&h,typeof r=="function"?null:r,s==="right"&&h]}),v=jsxRuntime.jsxs("div",{className:"relative inline-flex items-center justify-center",children:[jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:a||jsxRuntime.jsx(U,{name:"CircleNotch",size:i,className:"animate-spin","aria-hidden":"true"})}),jsxRuntime.jsx("div",{className:"invisible","aria-hidden":"true",children:y}),n&&jsxRuntime.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:n})]}),S=(u??0)>0,w=tailwindMerge.twMerge(N2(e),d),N=l?{href:l,target:g,rel:b,...x}:{};if(l){let{onPress:R,onPressStart:A,onPressEnd:O,onPressChange:P,onPressUp:T,onAuxClick:k,onContextMenu:V,onDoubleClick:H,...I}=x;Object.assign(N,I);}let D=l?jsxRuntime.jsx(reactAriaComponents.Link,{...N,...o&&{"aria-busy":true},style:S?void 0:f,className:w,children:o?v:typeof r=="function"?(function(R){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s==="left"&&h,r(R),s==="right"&&h]})}):y}):jsxRuntime.jsx(reactAriaComponents.Button,{...x,...o&&{"aria-busy":true},style:S?void 0:f,className:w,children:o?v:typeof r=="function"?(function(R){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s==="left"&&h,r(R),s==="right"&&h]})}):y});return S?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative flex",d),style:f,children:[D,jsxRuntime.jsx("span",{className:`absolute ${S2[m]} flex h-5 w-5 items-center justify-center rounded-full ${w2[p]} text-xs font-medium`,"aria-label":`${u} items`,children:u})]}):D}function fp({action:e,defaultVariant:t,defaultSize:r="lg"}){let o=!!e.formId;return jsxRuntime.jsx(re,{type:o?"submit":"button",form:o?e.formId:void 0,size:e.size||r,variant:e.variant||t,onPress:o?void 0:e.onPress,isLoading:e.isLoading,isDisabled:e.isDisabled,children:e.label})}function rn({primaryAction:e,secondaryAction:t,tertiaryAction:r,footerContent:o}){let n=e||t||r;return !n&&!o?null:jsxRuntime.jsxs("div",{className:`flex w-full flex-col items-center justify-center border-t p-4 ${o?"h-28":""}`,children:[o&&jsxRuntime.jsx("div",{className:"flex h-10 justify-center",children:o}),n&&jsxRuntime.jsxs("div",{className:"flex w-full items-center justify-between gap-3",children:[jsxRuntime.jsx("div",{children:r&&jsxRuntime.jsx(fp,{action:r,defaultVariant:"destructive"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[t&&jsxRuntime.jsx(fp,{action:t,defaultVariant:"secondary"}),e&&jsxRuntime.jsx(fp,{action:e,defaultVariant:"primary"})]})]})]})}var k2={heading:{sm:co.headingSm,md:co.headingMd,lg:co.headingLg,xl:co.headingXl},display:{sm:co.displaySm,md:co.displayMd,lg:co.displayLg,xl:co.displayXl}},P2={page:"h-16 leading-[62px]"};function or({tag:e="h1",variant:t="heading",size:r="lg",height:o,className:n="",children:a}){let i=r==="xs"?"sm":r,s=k2[t][i],c=o?P2[o]:"";return jsxRuntime.jsx(e,{className:rr(s,"text-text-primary",c,n),children:a})}var Kt=({title:e,onClose:t,hideCloseIcon:r=false,titleAlign:o="left",hasBackArrow:n=false,onBack:a,headerContent:i})=>jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative flex h-16 w-full flex-shrink-0 items-center justify-between border-b px-6",e&&"border-b",o==="center"?"justify-center":""),children:[n&&jsxRuntime.jsx(re,{variant:"icon",onPress:a,className:"absolute left-6","aria-label":"Go back",children:jsxRuntime.jsx(U,{name:"CaretLeft","data-testid":"back-arrow"})}),i||jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e&&jsxRuntime.jsx(or,{size:"xs",children:e}),t&&!r&&jsxRuntime.jsx(re,{variant:"icon",onPress:t,"aria-label":"Close dialog",children:jsxRuntime.jsx(U,{name:"X","data-testid":"close-button"})})]})]});var J=({width:e,height:t,variant:r="rect",animation:o="pulse",gradient:n=false,flex:a=false,stack:i,responsive:s,delay:c=0,adjustAnimationSpeedBasedOnWidth:l=false,ariaLabel:d,className:u,"data-testid":p})=>{let[m,f]=He.useState(c===0);if(He.useEffect(()=>{if(c>0){let S=setTimeout(()=>f(true),c);return ()=>clearTimeout(S)}},[c]),!m)return null;let g=n?"bg-gradient-to-r from-[var(--color-skeleton-base)] via-[var(--color-skeleton-highlight)] to-[var(--color-skeleton-base)]":"bg-[var(--color-skeleton-base)]",b=l&&e?(()=>{let S=typeof e=="number"?e:parseFloat(String(e));return isNaN(S)?"":`animation-duration-[${Math.max(.8,S/100)}s]`})():"",x=o==="pulse"?`animate-pulse ${b}`:o==="wave"?`relative overflow-hidden before:absolute before:inset-0 before:bg-gradient-to-r before:from-transparent before:via-[var(--color-skeleton-wave)] before:to-transparent before:animate-wave ${b}`:"",h="rounded-sm";r==="circle"&&(h="rounded-full"),r==="text"&&(h="h-4 w-full rounded-sm");let y=a?"flex-1 min-w-0":"",v=s?Object.entries(s).map(([S,w])=>`${S}:w-[${w}]`).join(" "):"";return i?jsxRuntime.jsx("div",{className:"space-y-2","data-testid":p,children:i.map((S,w)=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(g,x,h,y,v,u),style:{width:S,height:t}},w))}):jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(g,x,h,y,v,u),style:{width:e,height:t},role:"presentation","aria-hidden":!d,"aria-label":d??void 0,"data-testid":p})},dx=({count:e=1,children:t,className:r,"data-testid":o})=>jsxRuntime.jsx("div",{className:r,"data-testid":o,children:Array.from({length:e}).map((n,a)=>jsxRuntime.jsx("div",{children:t},a))});var A2={outlined:"bg-background-surface border border-border-default",elevated:"bg-background-surface border-0 shadow-md",filled:"bg-background-muted border-0",ghost:"bg-transparent border-0 shadow-none"},I2="rounded-lg",bp={square:"aspect-square",video:"aspect-video",wide:"aspect-[2/1]",auto:""},F2={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between"};function Ge({variant:e="outlined",className:t,children:r,isLoading:o=false,layout:n="default"}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-full overflow-hidden",A2[e],I2,n==="flex"&&"flex flex-col",t),"data-testid":"card",children:o?jsxRuntime.jsx(J,{width:"100%",height:"100%",className:"rounded-none"}):r})}function xp({title:e,subtitle:t,actions:r,className:o,isLoading:n=false}){return n?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("p-6 pb-4",o),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx(J,{width:120,height:20}),jsxRuntime.jsx(J,{width:24,height:24})]}),t&&jsxRuntime.jsx(J,{width:200,height:16})]}):!e&&!t&&!r?null:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("p-6 pb-4",o),children:jsxRuntime.jsxs("div",{className:"flex justify-between items-start gap-4",children:[jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[e&&jsxRuntime.jsx("div",{className:"mb-1",children:typeof e=="string"?jsxRuntime.jsx(or,{tag:"h3",size:"sm",className:"text-text-primary",children:e}):e}),t&&jsxRuntime.jsx("div",{className:bt("bodySm","text-text-secondary"),children:t})]}),r&&jsxRuntime.jsx("div",{className:"flex-shrink-0",children:r})]})})}function hp({src:e,alt:t,aspectRatio:r="auto",className:o,children:n,isLoading:a=false}){return a?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("bg-background-muted",bp[r],o),children:jsxRuntime.jsx(J,{width:"100%",height:"100%"})}):n?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",bp[r],o),children:n}):e?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",bp[r],o),children:jsxRuntime.jsx("img",{src:e,alt:t||"",className:"w-full h-full object-cover",loading:"lazy"})}):null}function yp({className:e,children:t,isLoading:r=false,fill:o=false}){let a=e?.match(/p(?:t|b|l|r|x|y)?-(?:\d+(?:\.\d+)?|px|\[.+?\])/)?"":"px-6 py-4";return r?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(a,o&&"flex-1 flex flex-col min-h-0",e),children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(J,{width:"100%",height:16}),jsxRuntime.jsx(J,{width:"80%",height:16}),jsxRuntime.jsx(J,{width:"60%",height:16})]})}):t?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 text-text-primary",o&&"flex-1 flex flex-col min-h-0",e),children:t}):null}function vp({className:e,children:t,align:r="end",isLoading:o=false}){return o?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("px-6 py-4 flex gap-2 justify-end",e),children:[jsxRuntime.jsx(J,{width:80,height:32}),jsxRuntime.jsx(J,{width:60,height:32})]}):t?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 flex items-center gap-2",F2[r],e),children:t}):null}Ge.Header=xp;Ge.Media=hp;Ge.Content=yp;Ge.Footer=vp;var $r=class extends He.Component{constructor(){super(...arguments);Yi(this,"state",{hasError:false});Yi(this,"handleRetry",()=>{this.setState({hasError:false,error:void 0}),typeof window<"u"&&window.location.reload();});}static getDerivedStateFromError(r){return {hasError:true,error:r}}componentDidCatch(r,o){console.error("Error Boundary caught an error:",r,o);}render(){return this.state.hasError?this.props.fallback?this.props.fallback:jsxRuntime.jsxs(Ge,{children:[this.props.title&&jsxRuntime.jsx(Ge.Header,{title:this.props.title}),jsxRuntime.jsx(Ge.Content,{children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center gap-4","data-testid":"error-boundary",children:[jsxRuntime.jsx("p",{className:"text-feedback-error-text",children:this.state.error?.message||"Something went wrong"}),jsxRuntime.jsx("button",{className:"rounded bg-action-default px-4 py-2 text-[color:var(--color-action-default-text)] hover:bg-action-default-hover",onClick:this.handleRetry,children:"Retry"})]})})]}):this.props.children}};var z2=.3,H2=.5;function ct({children:e,title:t,headerContent:r,titleAlign:o="left",hideCloseIcon:n=false,hasBackArrow:a=false,onBack:i,isOpen:s,onClose:c,isDismissable:l=true,transparentOverlay:d=false,primaryAction:u,secondaryAction:p,footerContent:m,maxHeight:f="80vh",height:g,maxWidth:b="640px",contentPadding:x=true,showHandle:h=true,animationVariant:y="scale",className:v}){let[S,w]=He.useState(false),[N,D]=He.useState(0),[R,A]=He.useState(false),O=Ml(s),P=O?.height??null,T=O?.keyboardOffset??0,k=He.useRef(null),V=He.useRef(null),H=He.useRef(null),I=He.useRef({isDragging:false,startY:0,startTime:0,pointerId:null});He.useEffect(()=>{if(s){let E=setTimeout(()=>{w(true),setTimeout(()=>w(false),600);},400);return ()=>clearTimeout(E)}},[s]),He.useEffect(()=>{s||(D(0),A(false),I.current={isDragging:false,startY:0,startTime:0,pointerId:null});},[s]),He.useEffect(()=>{let E=V.current;if(!E||!s)return;let z=null,B=C=>{let W=C.target;W&&["INPUT","TEXTAREA","SELECT"].includes(W.tagName)&&(z&&clearTimeout(z),z=setTimeout(()=>{W.scrollIntoView({block:"nearest",behavior:"smooth"});},320));};return E.addEventListener("focusin",B),()=>{E.removeEventListener("focusin",B),z&&clearTimeout(z);}},[s]);let q=He.useCallback(E=>{l&&(E.pointerType!=="touch"&&E.pointerType!=="pen"||(H.current&&(clearTimeout(H.current),H.current=null),I.current={isDragging:true,startY:E.clientY,startTime:Date.now(),pointerId:E.pointerId},A(false),E.currentTarget.setPointerCapture(E.pointerId)));},[l]),j=He.useCallback(E=>{let{isDragging:z,startY:B,pointerId:C}=I.current;if(!z||E.pointerId!==C)return;let W=E.clientY-B;D(Math.max(0,W));},[]),K=He.useCallback(E=>{let{isDragging:z,startY:B,startTime:C,pointerId:W}=I.current;if(!z||E.pointerId!==W)return;let G=E.clientY-B,F=Date.now()-C,Z=G/F;I.current={isDragging:false,startY:0,startTime:0,pointerId:null};let L=(k.current?.getBoundingClientRect().height??0)*z2;(G>L||Z>H2&&G>50)&&l?(c?.(),D(0)):(A(true),D(0),H.current=setTimeout(()=>{A(false),H.current=null;},200));},[l,c]);if(!s)return null;let Y=t||r,M=u||p||m;return jsxRuntime.jsx($r,{children:jsxRuntime.jsx(br,{isOpen:s,onOpenChange:E=>{E||c?.();},isDismissable:l,transparent:d,style:{paddingBottom:T>0?`${T}px`:void 0,transition:"padding-bottom 0.25s ease-out"},className:"flex items-end justify-center p-0 sm:p-4",children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"w-full max-w-full p-0 sm:p-2 outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",isDismissable:l,children:jsxRuntime.jsx("div",{ref:k,className:tailwindMerge.twMerge("w-full",R&&"transition-transform duration-200"),style:{transform:N>0?`translateY(${N}px)`:void 0},children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{className:tailwindMerge.twMerge("relative flex w-full flex-col overflow-hidden","bg-background-surface","shadow-2xl shadow-black/30 dark:shadow-black/60","border-t border-x border-border-default/40","outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0 focus:shadow-none","origin-bottom",y==="scale"?"animate-[tray-enter-scale_400ms_cubic-bezier(0.32,0.72,0,1)]":"animate-[tray-enter_400ms_cubic-bezier(0.32,0.72,0,1)]",y==="scale"?"data-[exiting]:animate-[tray-exit-scale_250ms_cubic-bezier(0.32,0,0.67,0)]":"data-[exiting]:animate-[tray-exit_250ms_cubic-bezier(0.32,0,0.67,0)]",v),style:{maxWidth:b,...g?{height:g}:{maxHeight:/\d/.test(f)?P!==null?`min(${f}, ${Math.max(P-8,0)}px, 100dvh)`:`min(${f}, 100dvh)`:f}},children:[h&&jsxRuntime.jsx("div",{className:"absolute top-0 left-0 right-0 h-8 z-10 flex justify-center items-start pt-2 touch-none cursor-grab active:cursor-grabbing",onPointerDown:q,onPointerMove:j,onPointerUp:K,onPointerCancel:K,children:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("h-1 w-12 rounded-full bg-border-muted transition-all duration-300","hover:bg-border-default hover:w-16",S&&"animate-[handle-wiggle_0.6s_ease-in-out]")})}),Y&&(a?jsxRuntime.jsx(Kt,{title:t,headerContent:r,titleAlign:o,hideCloseIcon:n||!c,hasBackArrow:true,onBack:i??(()=>{}),onClose:c||(()=>{})}):jsxRuntime.jsx(Kt,{title:t,headerContent:r,titleAlign:o,hideCloseIcon:n||!c,onClose:c||(()=>{})})),jsxRuntime.jsx("div",{ref:V,className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto overscroll-contain",x?"p-4":"p-0"),children:e}),M&&jsxRuntime.jsx(rn,{primaryAction:u,secondaryAction:p,footerContent:m})]})})})})})}ct.displayName="Tray";function Qa({children:e,items:t,className:r,align:o="left",textAlign:n="left",size:a="md",onAction:i,header:s,footer:c,useMobileTray:l=true,popoverClassName:d}){let[u,p]=He.useState(false),{isMobile:m}=_t();if(l&&m){let g=He__namespace.default.isValidElement(e)?He__namespace.default.cloneElement(e,{onPress:()=>p(true)}):e,h=(y=>{if(typeof y=="string")return y;if(He__namespace.default.isValidElement(y)){let v=y.props;if(typeof v.children=="string")return v.children;if(Array.isArray(v.children))return v.children.find(w=>typeof w=="string")||""}return ""})(e)||"Actions";return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:r,children:g}),jsxRuntime.jsx(ct,{isOpen:u,onClose:()=>p(false),title:h,contentPadding:false,headerContent:s,footerContent:c,children:jsxRuntime.jsx("div",{className:"flex flex-col",children:t.map(y=>jsxRuntime.jsxs("button",{onClick:()=>{y.disabled||(y.onAction?y.onAction():i?.(y),p(false));},disabled:y.disabled,"data-testid":y.testId,className:tailwindMerge.twMerge("flex w-full items-center text-start transition-colors",!y.noPadding&&"px-6 py-3","border-b border-border-muted last:border-0",y.variant==="destructive"?"text-feedback-error-text hover:bg-feedback-error-background active:bg-feedback-error-background/80":"text-text-primary hover:bg-background-hover active:bg-background-hover/80",y.disabled&&"opacity-50 cursor-not-allowed"),children:[y.iconName&&jsxRuntime.jsx(U,{name:y.iconName,size:20,className:"mr-3 flex-shrink-0"}),jsxRuntime.jsx("div",{className:"flex flex-1 flex-col",children:y.render?y.render():jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:y.subtitle?"font-medium":"",children:y.name}),y.subtitle&&jsxRuntime.jsx("span",{className:"text-sm text-text-secondary",children:y.subtitle})]})})]},y.id))})})]})}return jsxRuntime.jsx("div",{className:r,children:jsxRuntime.jsxs(reactAriaComponents.MenuTrigger,{children:[e,jsxRuntime.jsx(lt,{className:tailwindMerge.twMerge("w-fit min-w-[180px] overflow-auto rounded-[var(--control-border-radius)] border border-border-default","bg-background-surface shadow-lg","animate-in fade-in zoom-in-97","duration-200 ease-out","data-[exiting]:animate-out data-[exiting]:fade-out data-[exiting]:zoom-out-97","data-[exiting]:duration-150 data-[exiting]:ease-in",o==="right"?"origin-top-right":"origin-top-left",d),placement:o==="right"?"bottom end":"bottom start",children:jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex min-w-[180px] flex-col gap-1",d),children:[s?jsxRuntime.jsx("div",{className:"px-3 pb-2 pt-3",children:s}):null,jsxRuntime.jsx(reactAriaComponents.Menu,{className:"!outline-none",children:t.map(g=>jsxRuntime.jsx(K2,{id:g.id,onAction:()=>{g.onAction?g.onAction():i?.(g);},textAlign:n,size:a,iconName:g.iconName,isDisabled:g.disabled,variant:g.variant,subtitle:g.subtitle,render:g.render,noPadding:g.noPadding,"data-testid":g.testId,children:g.name},g.id))}),c?jsxRuntime.jsx("div",{className:"px-3 pb-3 pt-2",children:c}):null]})})]})})}function K2({textAlign:e="left",iconName:t,size:r="md",isDisabled:o,children:n,variant:a="default",subtitle:i,render:s,noPadding:c,...l}){let d={sm:"px-3 py-2 text-sm",md:i?"px-4 py-2.5 text-base":"px-4 py-2 text-base"},u="text-text-primary hover:bg-background-hover data-[focused]:bg-background-hover data-[focus-visible]:ring-2 data-[focus-visible]:ring-action-primary data-[focus-visible]:ring-inset",p={primary:u,default:u,destructive:"text-feedback-error-text hover:bg-feedback-error-background data-[focused]:bg-feedback-error-background data-[focus-visible]:ring-2 data-[focus-visible]:ring-feedback-error-border data-[focus-visible]:ring-inset"};return s?jsxRuntime.jsx(reactAriaComponents.MenuItem,{...l,isDisabled:o,className:tailwindMerge.twMerge("group box-border flex w-full cursor-pointer items-center rounded-sm outline-none transition-colors",!c&&d[r],p[a],e==="right"?"justify-end":"justify-start",o&&"pointer-events-none opacity-50"),children:s()}):jsxRuntime.jsxs(reactAriaComponents.MenuItem,{...l,isDisabled:o,className:tailwindMerge.twMerge("group box-border flex w-full cursor-pointer items-center rounded-sm outline-none transition-colors",!c&&d[r],p[a],e==="right"?"justify-end":"justify-start",o&&"pointer-events-none opacity-50"),children:[t&&e==="left"&&jsxRuntime.jsx(U,{name:t,size:r==="sm"?16:20,className:"mr-3 flex-shrink-0"}),jsxRuntime.jsxs("div",{className:"flex flex-1 flex-col",children:[jsxRuntime.jsx("span",{className:i?"font-medium":"",children:n}),i&&jsxRuntime.jsx("span",{className:"text-sm text-text-secondary",children:i})]}),t&&e==="right"&&jsxRuntime.jsx(U,{name:t,size:r==="sm"?16:20,className:"ml-3 flex-shrink-0"})]})}var Eo=({className:e,size:t=24,color:r="text-action-brand"})=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("inline-block animate-spin rounded-full border-2 border-solid border-current border-r-transparent",r,e),style:{width:t,height:t},role:"status","aria-label":"loading",children:jsxRuntime.jsx("span",{className:"sr-only",children:"Loading..."})});function Ar({state:e,message:t,className:r,customIndicator:o}){if(e!=="loading-more")return null;let n=jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center justify-center gap-2 py-4","text-text-secondary",r),"aria-label":t||"Loading",children:[jsxRuntime.jsx(Eo,{size:20,color:"text-text-secondary"}),t&&jsxRuntime.jsx("span",{className:"text-sm","aria-hidden":"true",children:t})]});return o||n}var _a=He.createContext({variant:"timeline",size:"md"});function hx(){return He.useContext(_a)}function Bl(e){return He.isValidElement(e)&&e.type===zl}function _2(e){return He.isValidElement(e)&&e.type===Ol}function kp({variant:e="timeline",size:t="md",className:r,children:o,items:n,renderItem:a,isLoading:i=false,loadingState:s,error:c=null,renderLoadingSkeleton:l,loadingSkeletonCount:d=5,emptyMessage:u="No activity found.",onLoadMore:p,hasMore:m=false,enableVirtualization:f,estimatedItemSize:g,loadingIndicator:b,height:x,maxHeight:h,...y}){let v=He.useRef(null),{isMobile:S}=_t(),w=S?"stacked":e,N=n!==void 0&&a!==void 0,{scrollRef:D,loadMoreRef:R,virtualizer:A,virtualItems:O,isLoadingMore:P,computedLoadingState:T}=Qo({items:n||[],onLoadMore:N?p:void 0,hasMore:N?m:false,isLoading:i,loadingState:s,enableVirtualization:N?f:false,estimatedItemSize:g||(w==="stacked"?120:150),overscan:5}),k=N&&D?D:v,V=He.useMemo(()=>({variant:w,size:t}),[w,t]),H=w==="timeline"?t==="sm"?"gap-4":"gap-6":"gap-0",I=w==="stacked"?"divide-y divide-border-subtle rounded-lg border border-border-subtle bg-background-surface":"",q={};if(N&&p&&(x?(q.height=typeof x=="number"?`${x}px`:x,q.overflowY="auto"):h?(q.maxHeight=typeof h=="number"?`${h}px`:h,q.overflowY="auto"):(q.height="600px",q.overflowY="auto")),N){let Y=T==="loading"||i&&(!n||n.length===0);if(Y){let E=l?jsxRuntime.jsx(jsxRuntime.Fragment,{children:Array.from({length:d}).map((z,B)=>jsxRuntime.jsx("div",{children:l()},`skeleton-${B}`))}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:Array.from({length:d}).map((z,B)=>{let C=t==="sm"?"gap-2":"gap-3";if(w==="timeline"){let W=t==="sm"?"pt-3":"pt-4",G=t==="sm"?"p-3":"p-4";return jsxRuntime.jsxs("div",{className:"group relative grid items-start gap-4 grid-cols-[3rem_1fr]",children:[jsxRuntime.jsxs("div",{className:`relative flex h-full flex-col items-center ${W}`,children:[jsxRuntime.jsx(J,{width:32,height:32,variant:"circle"}),B<d-1&&jsxRuntime.jsx("span",{className:"absolute top-[2rem] left-1/2 w-0 border-l-2 border-dotted -translate-x-1/2 h-[calc(100%+2.5rem)] border-border-muted"})]}),jsxRuntime.jsxs("div",{className:`min-w-0 flex flex-col ${C} ${G} rounded-md border border-border-subtle bg-background-surface`,children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-3",children:[jsxRuntime.jsx(J,{width:"50%",height:16}),jsxRuntime.jsx(J,{width:"15%",height:12})]}),jsxRuntime.jsx(J,{width:"85%",height:t==="sm"?14:15}),jsxRuntime.jsx(J,{width:"70%",height:t==="sm"?14:15})]})]},`skeleton-${B}`)}else return jsxRuntime.jsxs("div",{className:`flex flex-col ${t==="sm"?"px-3 py-3":"px-4 py-4"}`,children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(J,{width:24,height:24,variant:"circle"}),jsxRuntime.jsx(J,{width:"50%",height:16})]}),jsxRuntime.jsxs("div",{className:`mt-3 flex flex-col ${C}`,children:[jsxRuntime.jsx(J,{width:"85%",height:t==="sm"?14:15}),jsxRuntime.jsx(J,{width:"70%",height:t==="sm"?14:15}),jsxRuntime.jsx(J,{width:"20%",height:12})]})]},`skeleton-${B}`)})});return jsxRuntime.jsx(_a.Provider,{value:V,children:jsxRuntime.jsx("div",{ref:k,"data-slot":"feed","data-variant":w,className:tailwindMerge.twMerge("flex flex-col",H,I,r),style:q,...y,children:E})})}if(c)return jsxRuntime.jsx(_a.Provider,{value:V,children:jsxRuntime.jsx("div",{ref:k,"data-slot":"feed","data-variant":w,className:tailwindMerge.twMerge("flex flex-col",H,I,r),style:q,...y,children:jsxRuntime.jsx("div",{className:"p-4 text-center text-feedback-error-text",children:c})})});if(!n||n.length===0)return jsxRuntime.jsx(_a.Provider,{value:V,children:jsxRuntime.jsx("div",{ref:k,"data-slot":"feed","data-variant":w,className:tailwindMerge.twMerge("flex flex-col",H,I,r),style:q,...y,children:jsxRuntime.jsx("div",{className:"p-4 text-center text-text-secondary",children:u})})});let M=A?O?.map(E=>({virtualItem:E,item:n[E.index],index:E.index}))||[]:n.map((E,z)=>({item:E,index:z,virtualItem:null}));return jsxRuntime.jsx(_a.Provider,{value:V,children:jsxRuntime.jsxs("div",{ref:k,"data-slot":"feed","data-variant":w,className:tailwindMerge.twMerge("flex flex-col",H,I,r),style:{...q,position:A?"relative":void 0},...y,children:[A?jsxRuntime.jsxs("div",{style:{height:`${A.getTotalSize()}px`,position:"relative"},children:[M.map(({item:E,index:z,virtualItem:B})=>{if(!E||!B)return null;let C=a(E,z),W=w==="timeline"&&He.isValidElement(C)&&Bl(C)?He.cloneElement(C,{showConnector:z!==n.length-1}):C;return jsxRuntime.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${B.start}px)`},"data-index":B.index,ref:A.measureElement,children:W},`item-${z}`)}),P&&jsxRuntime.jsx("div",{style:{position:"absolute",top:`${A.getTotalSize()}px`,left:0,width:"100%"},children:b||jsxRuntime.jsx(Ar,{state:"loading-more"})})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[M.map(({item:E,index:z})=>{let B=a(E,z);if(w==="timeline"&&He.isValidElement(B)&&Bl(B)){let C=z===n.length-1;return jsxRuntime.jsx("div",{children:He.cloneElement(B,{showConnector:!C})},`item-${z}`)}return jsxRuntime.jsx("div",{children:B},`item-${z}`)}),P&&(b||jsxRuntime.jsx(Ar,{state:"loading-more"}))]}),p&&m&&!Y&&jsxRuntime.jsx("div",{ref:R,style:A?{position:"absolute",top:`${A.getTotalSize()}px`,left:0,width:"100%",height:1}:{height:1,width:"100%"}})]})})}let j=He.Children.toArray(o),K=j.map((Y,M)=>{if(Bl(Y)){let E=Y.props.showConnector??(w==="timeline"&&M<j.length-1),z=w==="timeline"&&M>0;return He.cloneElement(Y,{showConnector:E,showIncomingConnector:z})}if(_2(Y)){let E=M===j.length-1;return He.cloneElement(Y,{__isLastGroup:E,__isFirstGroup:M===0})}return Y});return jsxRuntime.jsx(_a.Provider,{value:V,children:jsxRuntime.jsx("div",{"data-slot":"feed","data-variant":w,className:tailwindMerge.twMerge("flex flex-col",H,I,r),...y,children:K})})}kp.displayName="ActivityFeed";function Ol(e){let{variant:t,size:r}=hx(),{title:o,description:n,actions:a,children:i,className:s,__isLastGroup:c=false,__isFirstGroup:l=false,...d}=e,u=He.Children.toArray(i),p=u.map((g,b)=>{if(Bl(g)){let x=g.props.showConnector??(t==="timeline"&&!(c&&b===u.length-1));return He.cloneElement(g,{showConnector:x,showIncomingConnector:t==="timeline"&&!(l&&b===0)})}return g}),m=t==="timeline"?"pl-[3rem]":r==="sm"?"px-3":"px-4",f=r==="sm"?"gap-3":"gap-4";return jsxRuntime.jsxs("section",{"data-slot":"group",className:tailwindMerge.twMerge("flex flex-col",s),...d,children:[(o||n||a)&&jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("mb-2 flex flex-wrap items-end justify-between gap-2",m),children:[jsxRuntime.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[o&&jsxRuntime.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-text-secondary",children:o}),n&&jsxRuntime.jsx("span",{className:"text-sm text-text-secondary",children:n})]}),a&&jsxRuntime.jsx("div",{className:"flex flex-shrink-0 items-center gap-2",children:a})]}),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex flex-col",f),children:p})]})}Ol.displayName="ActivityFeedGroup";var bx={neutral:"bg-background-muted text-text-secondary border-border-muted",brand:"bg-background-muted text-action-brand border-action-brand/30",success:"bg-background-muted text-feedback-success-text border-feedback-success-border/40",warning:"bg-background-muted text-feedback-warning-text border-feedback-warning-border/40",danger:"bg-background-muted text-feedback-error-text border-feedback-error-border/40",info:"bg-background-muted text-feedback-info-text border-feedback-info-border/40"},eN={neutral:"bg-background-subtle",brand:"bg-action-brand/5",success:"bg-feedback-success-background",warning:"bg-feedback-warning-background",danger:"bg-feedback-error-background",info:"bg-feedback-info-background"},tN={neutral:"border-border-muted",brand:"border-action-brand",success:"border-feedback-success-border",warning:"border-feedback-warning-border",danger:"border-feedback-error-border",info:"border-feedback-info-border"};function zl(e){let{variant:t,size:r}=hx(),{title:o,description:n,timestamp:a,meta:i,media:s,actions:c,visual:l,icon:d,iconWeight:u,tone:p="neutral",surface:m,isHighlighted:f=false,showConnector:g=true,hideIndicator:b=false,interactive:x,className:h,children:y,onKeyDown:v,showIncomingConnector:S,...w}=e,N=l??(d?jsxRuntime.jsx(U,{name:d,weight:u||"fill",className:"h-4 w-4"}):null),D=m??(t==="stacked"?"minimal":"subtle"),R=r==="sm"?"gap-2":"gap-3",A="text-xs text-text-secondary",O=r==="sm"?"text-sm":"text-[15px]",P="text-xs text-text-secondary",T=x??typeof w.onClick=="function",k=M=>{if(!T){v?.(M);return}M.key===" "?M.preventDefault():M.key==="Enter"&&(M.preventDefault(),M.currentTarget.click()),v?.(M);},V=M=>{T&&M.key===" "&&(M.preventDefault(),M.currentTarget.click());},H=T?tailwindMerge.twMerge("group cursor-pointer",$e()):void 0,q=jsxRuntime.jsxs("div",{"data-slot":"connector",className:tailwindMerge.twMerge("relative flex h-full flex-col items-center",D==="minimal"?r==="sm"?"pt-2":"pt-3":r==="sm"?"pt-3":"pt-4"),children:[jsxRuntime.jsx("span",{"data-slot":"indicator",className:tailwindMerge.twMerge("relative z-10 flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-full border text-sm font-medium shadow-sm ring-2 ring-background-surface",bx[p]),children:N}),t==="timeline"&&g&&jsxRuntime.jsx("span",{"data-slot":"separator",className:"absolute top-[2rem] left-1/2 w-0 border-l-2 border-dotted -translate-x-1/2 h-[calc(100%+2.5rem)] border-border-muted"})]}),j=f?tailwindMerge.twMerge(eN[p],D==="minimal"?"rounded-md border border-border-muted":tN[p]):"";if(t==="stacked")return jsxRuntime.jsxs("div",{"data-slot":"item","data-variant":"stacked",role:T?"button":void 0,tabIndex:T?0:void 0,className:tailwindMerge.twMerge("flex flex-col",r==="sm"?"px-3 py-3":"px-4 py-4",{minimal:"",subtle:"bg-background-subtle",solid:"bg-background-muted"}[D],j,H,T?"transition-colors hover:bg-background-subtle/80":"",h),onKeyDown:k,onKeyUp:V,...w,children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[!b&&jsxRuntime.jsx("span",{"data-slot":"indicator",className:tailwindMerge.twMerge("flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full border text-sm font-medium shadow-sm ring-2 ring-background-surface",bx[p]),children:N}),jsxRuntime.jsx("div",{"data-slot":"title",className:"min-w-0 flex-1 text-sm font-semibold text-text-primary",children:o})]}),jsxRuntime.jsxs("div",{"data-slot":"content",className:tailwindMerge.twMerge("mt-3 flex flex-col",R),children:[n&&jsxRuntime.jsx("div",{"data-slot":"description",className:tailwindMerge.twMerge("text-text-secondary",O),children:n}),i&&jsxRuntime.jsx("div",{className:P,children:i}),s&&jsxRuntime.jsx("div",{className:"flex flex-col gap-2 text-sm text-text-secondary",children:s}),y,c&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-2 pt-1",children:c}),a&&jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("-mt-1.5",A),children:a})]})]});let K=D==="minimal"?r==="sm"?"py-2":"py-3":r==="sm"?"p-3":"p-4",Y={minimal:"",subtle:"rounded-md border border-border-subtle bg-background-surface",solid:"rounded-md bg-background-muted shadow-sm"};return jsxRuntime.jsxs("div",{"data-slot":"item","data-variant":"timeline",role:T?"button":void 0,tabIndex:T?0:void 0,className:tailwindMerge.twMerge("group relative grid items-start gap-4 grid-cols-[3rem_1fr]",H,h),onKeyDown:k,onKeyUp:V,...w,children:[b?jsxRuntime.jsx("div",{}):q,jsxRuntime.jsxs("div",{"data-slot":"content",className:tailwindMerge.twMerge("min-w-0 flex flex-col",R,K,Y[D],j,T?"transition-colors group-hover:bg-background-subtle/70":""),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-3",children:[jsxRuntime.jsx("div",{"data-slot":"title",className:"min-w-0 flex-1 text-sm font-semibold text-text-primary",children:o}),a&&jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-shrink-0",A),children:a})]}),n&&jsxRuntime.jsx("div",{"data-slot":"description",className:tailwindMerge.twMerge("text-text-secondary",O),children:n}),i&&jsxRuntime.jsx("div",{className:P,children:i}),s&&jsxRuntime.jsx("div",{className:"flex flex-col gap-2 text-sm text-text-secondary",children:s}),y,c&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-2 pt-2",children:c})]})]})}zl.displayName="ActivityItem";function Ir({isOpen:e,onClose:t,title:r,headerContent:o,titleAlign:n="left",hideCloseIcon:a=false,hasBackArrow:i=false,onBack:s,children:c,primaryAction:l,secondaryAction:d,tertiaryAction:u,footerContent:p,transparentOverlay:m=false,maxWidth:f="600px",minWidth:g="400px",maxHeight:b="85vh",height:x,mobileMaxHeight:h="90vh",mobileHeight:y,contentPadding:v=true,className:S}){let w=Qt("(max-width: 767px)"),N=Ml(w&&e===void 0),D=N?.height??null,R=N?.keyboardOffset??0,A=He.useRef(null),O=He.useCallback(()=>{A.current&&A.current.scrollTop!==0&&(A.current.scrollTop=0);},[]),P=He.useRef(null),T=He.useRef(null);He.useEffect(()=>{let q=T.current;if(!q||!w)return;let j=null,K=Y=>{let M=Y.target;M&&["INPUT","TEXTAREA","SELECT"].includes(M.tagName)&&(j&&clearTimeout(j),j=setTimeout(()=>{M.scrollIntoView({block:"nearest",behavior:"smooth"});},320));};return q.addEventListener("focusin",K),()=>{q.removeEventListener("focusin",K),j&&clearTimeout(j);}},[w]);let k=He.useCallback(()=>{P.current&&P.current.scrollTop!==0&&(P.current.scrollTop=0);},[]);if(e===false)return null;let V=r||o,H=l||d||u||p,I=e!==void 0;return w?I?jsxRuntime.jsx(ct,{isOpen:e,onClose:t,title:r,headerContent:o,titleAlign:n,hideCloseIcon:a,hasBackArrow:i,onBack:s,primaryAction:l,secondaryAction:d,footerContent:p,transparentOverlay:m,maxHeight:h,height:y,maxWidth:f,contentPadding:v,showHandle:true,animationVariant:"scale",className:S,children:c}):jsxRuntime.jsx($r,{children:jsxRuntime.jsx(br,{isDismissable:true,transparent:m,style:{paddingBottom:R>0?`${R}px`:void 0,transition:"padding-bottom 0.25s ease-out"},className:"flex items-end justify-center",children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"w-full p-0 outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{ref:A,onScroll:O,className:tailwindMerge.twMerge("relative flex w-full flex-col","bg-background-surface","shadow-2xl shadow-black/20","border-t border-x border-border-default/40","rounded-t-xl","overflow-hidden","animate-in slide-in-from-bottom","duration-300 ease-out","data-[exiting]:animate-out data-[exiting]:slide-out-to-bottom","data-[exiting]:duration-200 data-[exiting]:ease-in",S),style:{...y?{height:y}:{maxHeight:/\d/.test(h)?D!==null?`min(${h}, ${Math.max(D-8,0)}px, 100dvh)`:`min(${h}, 100dvh)`:h}},children:[jsxRuntime.jsx("div",{className:"flex justify-center pt-2",children:jsxRuntime.jsx("div",{className:"h-1.5 w-12 rounded-full bg-border-muted"})}),V&&(i?jsxRuntime.jsx(Kt,{title:r,headerContent:o,titleAlign:n,hideCloseIcon:a||!t,hasBackArrow:true,onBack:s,onClose:t||(()=>{})}):jsxRuntime.jsx(Kt,{title:r,headerContent:o,titleAlign:n,hideCloseIcon:a||!t,onClose:t||(()=>{})})),jsxRuntime.jsx("div",{ref:T,className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto overscroll-contain",v?"px-6 py-6":"p-0"),children:c}),H&&jsxRuntime.jsx(rn,{primaryAction:l,secondaryAction:d,tertiaryAction:u,footerContent:p})]})})})}):jsxRuntime.jsx($r,{children:jsxRuntime.jsx(br,{...I?{isOpen:e,onOpenChange:q=>{!q&&t&&t();}}:{},isDismissable:true,transparent:m,className:"flex items-center justify-center",children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"w-full p-4 outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",style:{maxWidth:f},children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{ref:P,onScroll:k,className:tailwindMerge.twMerge("relative flex w-full flex-col","bg-background-surface","shadow-2xl shadow-black/20","border border-border-default/50","rounded-md","overflow-hidden","outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0","animate-in fade-in zoom-in-96 slide-in-from-bottom-2","duration-300 ease-out","data-[exiting]:animate-out data-[exiting]:fade-out data-[exiting]:zoom-out-95","data-[exiting]:duration-200 data-[exiting]:ease-in",S),style:{minWidth:g,...x?{height:x}:{maxHeight:b}},children:[V&&(i?jsxRuntime.jsx(Kt,{title:r,headerContent:o,titleAlign:n,hideCloseIcon:a||!t,hasBackArrow:true,onBack:s,onClose:t||(()=>{})}):jsxRuntime.jsx(Kt,{title:r,headerContent:o,titleAlign:n,hideCloseIcon:a||!t,onClose:t||(()=>{})})),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto",v?"px-6 py-6":"p-0"),children:c}),H&&jsxRuntime.jsx(rn,{primaryAction:l,secondaryAction:d,tertiaryAction:u,footerContent:p})]})})})})}function Tx({isOpen:e,onClose:t,title:r,message:o,confirmLabel:n="OK",confirmVariant:a="primary",maxWidth:i="400px",minWidth:s="320px"}){return jsxRuntime.jsx(Ir,{isOpen:e,onClose:t,title:r,maxWidth:i,minWidth:s,primaryAction:{label:n,onPress:t,variant:a},children:jsxRuntime.jsx("div",{className:"text-text-primary",children:o})})}var on={xs:16,sm:20,md:24,lg:32,xl:40,"2xl":48},xr=He.memo(({name:e,size:t="md",color:r,weight:o="regular",className:n,ariaLabel:a,...i})=>{let s=oN__namespace[e];if(!s)return null;let c=typeof t=="string"?t in on?on[t]:on.md:t,l=tailwindMerge.twMerge("inline-block flex-shrink-0",!r&&"text-current",n);return jsxRuntime.jsx(s,{...i,size:c,color:r,weight:o,className:l,"aria-label":a||`${e} icon`,"data-testid":`icon-${e}`})});xr.displayName="IconSSR";var nN=He.memo(({variant:e="subtle",shape:t="square",containerSize:r,containerClassName:o,size:n="md",className:a,name:i,color:s,weight:c,ariaLabel:l,ref:d,...u})=>{let p=typeof n=="string"?n in on?on[n]:on.md:n,m=r?typeof r=="string"?r in on?on[r]:p*1.75:r:p*1.75,f=tailwindMerge.twMerge("inline-flex items-center justify-center flex-shrink-0",t==="circle"?"rounded-full":"rounded-lg",e==="subtle"&&"bg-background-muted",e==="solid"&&"bg-action-brand text-[color:var(--color-action-brand-text)]",e==="outline"&&"border-2 border-current",o);return jsxRuntime.jsx("div",{className:f,style:{width:m,height:m},children:jsxRuntime.jsx(xr,{...u,name:i,size:n,color:s,weight:c,className:a,ariaLabel:l})})});nN.displayName="IconSSRWithContainer";var ei=({className:e,showWordmark:t=true,width:r,fill:o})=>{let n,a;if(o?o.startsWith("fill-")?a=o:n=o:e?a=e:n="var(--color-text-primary)",t){let c=r||270,l=c/270*80;return jsxRuntime.jsxs("svg",{width:c,height:l,viewBox:"0 0 270 80",xmlns:"http://www.w3.org/2000/svg",className:a,style:n?{fill:n}:void 0,children:[jsxRuntime.jsxs("g",{clipPath:"url(#clip0_796_283)",children:[jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.223654 20.2934C0.417233 19.8234 0.873598 19.517 1.37984 19.517H20.5909C21.282 19.517 21.8422 20.0798 21.8422 20.774V40.049C21.8422 40.5572 21.5375 41.0155 21.0702 41.2102C20.6028 41.405 20.0647 41.2977 19.7067 40.9385L0.495628 21.6635C0.137428 21.3041 0.030075 20.7633 0.223654 20.2934ZM4.40349 22.0311L19.3396 37.017V22.0311H4.40349Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 20.2934C38.8394 19.8234 39.2958 19.517 39.802 19.517H59.013C59.7041 19.517 60.2642 20.0798 60.2642 20.774V40.049C60.2642 40.5572 59.9597 41.0155 59.4923 41.2102C59.025 41.405 58.4867 41.2977 58.1289 40.9385L38.9178 21.6635C38.5595 21.3041 38.4522 20.7633 38.6458 20.2934ZM42.8255 22.0311L57.7618 37.017V22.0311H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.4347 58.8447C19.6283 58.3747 20.0847 58.0685 20.5909 58.0685H39.802C40.493 58.0685 41.0532 58.6312 41.0532 59.3255V78.6005C41.0532 79.1087 40.7486 79.567 40.2813 79.7617C39.8139 79.9562 39.2757 79.849 38.9178 79.49L19.7067 60.215C19.3485 59.8555 19.2411 59.3147 19.4347 58.8447ZM23.6146 60.5825L38.5508 75.5682V60.5825H23.6146Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 58.1643C39.79 57.9695 40.3283 58.0768 40.6861 58.436L59.8972 77.711C60.2555 78.0703 60.3628 78.6113 60.1692 79.081C59.9756 79.551 59.5192 79.8575 59.013 79.8575H39.802C39.1109 79.8575 38.5508 79.2948 38.5508 78.6005V59.3255C38.5508 58.8173 38.8554 58.359 39.3227 58.1643ZM41.0532 62.3575V77.3433H55.9893L41.0532 62.3575Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 19.6129C39.79 19.4182 40.3283 19.5254 40.6861 19.8846L59.8972 39.1595C60.2555 39.519 60.3628 40.0598 60.1692 40.5298C59.9756 40.9995 59.5192 41.306 59.013 41.306H39.802C39.1109 41.306 38.5508 40.7433 38.5508 40.049V20.7741C38.5508 20.2658 38.8554 19.8075 39.3227 19.6129ZM41.0532 23.8061V38.792H55.9893L41.0532 23.8061Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 38.8885C39.79 38.694 40.3283 38.8012 40.6861 39.1602L59.8972 58.4352C60.2555 58.7945 60.3628 59.3355 60.1692 59.8055C59.9756 60.2752 59.5192 60.5817 59.013 60.5817H39.802C39.1109 60.5817 38.5508 60.019 38.5508 59.3247V40.0497C38.5508 39.5415 38.8554 39.0832 39.3227 38.8885ZM41.0532 43.0817V58.0675H55.9893L41.0532 43.0817Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 39.569C38.8394 39.0992 39.2958 38.7927 39.802 38.7927H59.013C59.7041 38.7927 60.2642 39.3555 60.2642 40.0497V59.3247C60.2642 59.833 59.9597 60.2912 59.4923 60.486C59.025 60.6805 58.4867 60.5732 58.1289 60.2142L38.9178 40.9392C38.5595 40.5797 38.4522 40.039 38.6458 39.569ZM42.8255 41.3067L57.7618 56.2927V41.3067H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 58.8447C38.8394 58.3747 39.2958 58.0685 39.802 58.0685H59.013C59.7041 58.0685 60.2642 58.6312 60.2642 59.3255V78.6005C60.2642 79.1087 59.9597 79.567 59.4923 79.7617C59.025 79.9562 58.4867 79.849 58.1289 79.49L38.9178 60.215C38.5595 59.8555 38.4522 59.3147 38.6458 58.8447ZM42.8255 60.5825L57.7618 75.5682V60.5825H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M58.5338 19.6129C59.0011 19.4182 59.5394 19.5254 59.8972 19.8846L79.1083 39.1595C79.4666 39.519 79.5739 40.0598 79.3803 40.5298C79.1867 40.9995 78.7303 41.306 78.2241 41.306H59.013C58.322 41.306 57.7618 40.7433 57.7618 40.049V20.7741C57.7618 20.2658 58.0664 19.8075 58.5338 19.6129ZM60.2643 23.8061V38.792H75.2006L60.2643 23.8061Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M58.5338 0.338803C59.0011 0.144135 59.5394 0.251385 59.8972 0.610565L79.1083 19.8855C79.4666 20.2449 79.5739 20.7857 79.3803 21.2556C79.1867 21.7256 78.7303 22.032 78.2241 22.032H59.013C58.322 22.032 57.7618 21.4692 57.7618 20.775V1.50003C57.7618 0.99174 58.0664 0.533468 58.5338 0.338803ZM60.2643 4.53208V19.5179H75.2006L60.2643 4.53208Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.8569 20.2934C58.0505 19.8234 58.5069 19.517 59.013 19.517H78.2241C78.9151 19.517 79.4753 20.0798 79.4753 20.774V40.049C79.4753 40.5572 79.1707 41.0155 78.7034 41.2102C78.236 41.405 77.6978 41.2977 77.3399 40.9385L58.1289 21.6635C57.7705 21.3041 57.6633 20.7633 57.8569 20.2934ZM62.0365 22.0311L76.9729 37.017V22.0311H62.0365Z"}),jsxRuntime.jsx("path",{d:"M269.838 49.4457H249.005C249.266 51.801 250.162 53.6985 251.695 55.1377C253.225 56.577 255.134 57.2967 257.416 57.2967C259.307 57.2967 260.887 56.8715 262.159 56.021C263.463 55.1377 264.408 53.9927 264.996 52.5862H269.251C268.502 54.9415 267.084 56.937 264.996 58.5725C262.943 60.208 260.414 61.026 257.416 61.026C255.069 61.026 252.917 60.4697 250.961 59.3575C249.037 58.2127 247.504 56.6587 246.363 54.696C245.255 52.7332 244.7 50.558 244.7 48.17C244.7 45.782 245.255 43.6067 246.363 41.644C247.504 39.6812 249.037 38.1437 250.961 37.0315C252.917 35.8867 255.069 35.3142 257.416 35.3142C259.73 35.3142 261.833 35.8702 263.724 36.9825C265.615 38.0947 267.098 39.6485 268.176 41.644C269.283 43.6395 269.838 45.913 269.838 48.4645V49.4457ZM257.416 39.0432C255.263 39.0432 253.439 39.6812 251.939 40.957C250.47 42.2327 249.542 43.9337 249.152 46.06H265.583C265.192 43.9992 264.262 42.3145 262.796 41.006C261.36 39.6975 259.568 39.0432 257.416 39.0432Z"}),jsxRuntime.jsx("path",{d:"M228.356 60.5352V35.8049H232.219V39.7794H232.464C233.05 38.5689 233.963 37.5712 235.202 36.7862C236.474 35.9684 237.974 35.5594 239.701 35.5594H243.125V39.4359H239.701C237.517 39.4359 235.757 40.1554 234.42 41.5949C233.083 43.0342 232.414 44.9152 232.414 47.2377V60.5352H228.356Z"}),jsxRuntime.jsx("path",{d:"M208.607 61.0259C205.64 61.0259 203.326 60.1262 201.663 58.3272C200 56.4952 199.169 53.8947 199.169 50.5252V35.8047H203.228V49.8874C203.228 52.2427 203.766 54.0744 204.842 55.3829C205.95 56.6587 207.532 57.2967 209.586 57.2967C211.02 57.2967 212.308 56.9694 213.449 56.3152C214.623 55.6284 215.536 54.6959 216.188 53.5184C216.84 52.3407 217.166 50.9997 217.166 49.4949V35.8047H221.225V60.5352H217.313V56.5607H217.068C216.286 57.9019 215.161 58.9814 213.694 59.7992C212.226 60.6169 210.531 61.0259 208.607 61.0259Z"}),jsxRuntime.jsx("path",{d:"M186.736 39.534V56.806H194.756V60.5352H182.677V39.534H177.199V35.8047H182.677V29.5732H186.736V35.8047H193.24V39.534H186.736Z"}),jsxRuntime.jsx("path",{d:"M156.585 60.5352H151.988L158.394 48.0227L152.33 35.8047H156.976L162.062 46.0599H165.388L170.474 35.8047H175.022L168.958 48.0227L175.365 60.5352H170.67L165.29 49.7892H162.013L156.585 60.5352Z"}),jsxRuntime.jsx("path",{d:"M150.138 49.1315H129.304C129.565 51.4867 130.461 53.3842 131.994 54.8235C133.526 56.2627 135.433 56.9825 137.715 56.9825C139.606 56.9825 141.188 56.5572 142.459 55.7067C143.763 54.8235 144.709 53.6785 145.296 52.272H149.551C148.801 54.6272 147.382 56.6227 145.296 58.2582C143.242 59.8937 140.715 60.7118 137.715 60.7118C135.368 60.7118 133.216 60.1555 131.26 59.0432C129.336 57.8985 127.804 56.3445 126.663 54.3817C125.554 52.419 125 50.2437 125 47.8557C125 45.4677 125.554 43.2925 126.663 41.3298C127.804 39.367 129.336 37.8295 131.26 36.7173C133.216 35.5725 135.368 35 137.715 35C140.03 35 142.133 35.556 144.024 36.6682C145.915 37.7805 147.399 39.3342 148.475 41.3298C149.583 43.3252 150.138 45.5987 150.138 48.1502V49.1315ZM137.715 38.729C135.564 38.729 133.738 39.367 132.238 40.6427C130.771 41.9185 129.842 43.6195 129.45 45.7458H145.883C145.491 43.685 144.562 42.0002 143.095 40.6917C141.661 39.3832 139.867 38.729 137.715 38.729Z"}),jsxRuntime.jsx("path",{d:"M116.961 60.5353H112.559V30.4072H101.164V26.1875H128.307V30.4072H116.961V60.5353Z"})]}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("clipPath",{id:"clip0_796_283",children:jsxRuntime.jsx("rect",{width:"270",height:"80",fill:"white"})})})]})}let i=r||80;return jsxRuntime.jsxs("svg",{width:i,height:i,viewBox:"0 0 80 80",xmlns:"http://www.w3.org/2000/svg",className:a,style:n?{fill:n}:void 0,children:[jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.223654 20.2934C0.417233 19.8234 0.873598 19.517 1.37984 19.517H20.5909C21.282 19.517 21.8422 20.0798 21.8422 20.774V40.049C21.8422 40.5572 21.5375 41.0155 21.0702 41.2102C20.6028 41.405 20.0647 41.2977 19.7067 40.9385L0.495628 21.6635C0.137428 21.3041 0.030075 20.7633 0.223654 20.2934ZM4.40349 22.0311L19.3396 37.017V22.0311H4.40349Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 20.2934C38.8394 19.8234 39.2958 19.517 39.802 19.517H59.013C59.7041 19.517 60.2642 20.0798 60.2642 20.774V40.049C60.2642 40.5572 59.9597 41.0155 59.4923 41.2102C59.025 41.405 58.4867 41.2977 58.1289 40.9385L38.9178 21.6635C38.5595 21.3041 38.4522 20.7633 38.6458 20.2934ZM42.8255 22.0311L57.7618 37.017V22.0311H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.4347 58.8447C19.6283 58.3747 20.0847 58.0685 20.5909 58.0685H39.802C40.493 58.0685 41.0532 58.6312 41.0532 59.3255V78.6005C41.0532 79.1087 40.7486 79.567 40.2813 79.7617C39.8139 79.9562 39.2757 79.849 38.9178 79.49L19.7067 60.215C19.3485 59.8555 19.2411 59.3147 19.4347 58.8447ZM23.6146 60.5825L38.5508 75.5682V60.5825H23.6146Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 58.1643C39.79 57.9695 40.3283 58.0768 40.6861 58.436L59.8972 77.711C60.2555 78.0703 60.3628 78.6113 60.1692 79.081C59.9756 79.551 59.5192 79.8575 59.013 79.8575H39.802C39.1109 79.8575 38.5508 79.2948 38.5508 78.6005V59.3255C38.5508 58.8173 38.8554 58.359 39.3227 58.1643ZM41.0532 62.3575V77.3433H55.9893L41.0532 62.3575Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 19.6129C39.79 19.4182 40.3283 19.5254 40.6861 19.8846L59.8972 39.1595C60.2555 39.519 60.3628 40.0598 60.1692 40.5298C59.9756 40.9995 59.5192 41.306 59.013 41.306H39.802C39.1109 41.306 38.5508 40.7433 38.5508 40.049V20.7741C38.5508 20.2658 38.8554 19.8075 39.3227 19.6129ZM41.0532 23.8061V38.792H55.9893L41.0532 23.8061Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.3227 38.8885C39.79 38.694 40.3283 38.8012 40.6861 39.1602L59.8972 58.4352C60.2555 58.7945 60.3628 59.3355 60.1692 59.8055C59.9756 60.2752 59.5192 60.5817 59.013 60.5817H39.802C39.1109 60.5817 38.5508 60.019 38.5508 59.3247V40.0497C38.5508 39.5415 38.8554 39.0832 39.3227 38.8885ZM41.0532 43.0817V58.0675H55.9893L41.0532 43.0817Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 39.569C38.8394 39.0992 39.2958 38.7927 39.802 38.7927H59.013C59.7041 38.7927 60.2642 39.3555 60.2642 40.0497V59.3247C60.2642 59.833 59.9597 60.2912 59.4923 60.486C59.025 60.6805 58.4867 60.5732 58.1289 60.2142L38.9178 40.9392C38.5595 40.5797 38.4522 40.039 38.6458 39.569ZM42.8255 41.3067L57.7618 56.2927V41.3067H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.6458 58.8447C38.8394 58.3747 39.2958 58.0685 39.802 58.0685H59.013C59.7041 58.0685 60.2642 58.6312 60.2642 59.3255V78.6005C60.2642 79.1087 59.9597 79.567 59.4923 79.7617C59.025 79.9562 58.4867 79.849 58.1289 79.49L38.9178 60.215C38.5595 59.8555 38.4522 59.3147 38.6458 58.8447ZM42.8255 60.5825L57.7618 75.5682V60.5825H42.8255Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M58.5338 19.6129C59.0011 19.4182 59.5394 19.5254 59.8972 19.8846L79.1083 39.1595C79.4666 39.519 79.5739 40.0598 79.3803 40.5298C79.1867 40.9995 78.7303 41.306 78.2241 41.306H59.013C58.322 41.306 57.7618 40.7433 57.7618 40.049V20.7741C57.7618 20.2658 58.0664 19.8075 58.5338 19.6129ZM60.2643 23.8061V38.792H75.2006L60.2643 23.8061Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M58.5338 0.338803C59.0011 0.144135 59.5394 0.251385 59.8972 0.610565L79.1083 19.8855C79.4666 20.2449 79.5739 20.7857 79.3803 21.2556C79.1867 21.7256 78.7303 22.032 78.2241 22.032H59.013C58.322 22.032 57.7618 21.4692 57.7618 20.775V1.50003C57.7618 0.99174 58.0664 0.533468 58.5338 0.338803ZM60.2643 4.53208V19.5179H75.2006L60.2643 4.53208Z"}),jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.8569 20.2934C58.0505 19.8234 58.5069 19.517 59.013 19.517H78.2241C78.9151 19.517 79.4753 20.0798 79.4753 20.774V40.049C79.4753 40.5572 79.1707 41.0155 78.7034 41.2102C78.236 41.405 77.6978 41.2977 77.3399 40.9385L58.1289 21.6635C57.7705 21.3041 57.6633 20.7633 57.8569 20.2934ZM62.0365 22.0311L76.9729 37.017V22.0311H62.0365Z"})]})};var Wl=({topItems:e=[],bottomItems:t=[],bottomContent:r,logo:o,showLogo:n=true,linkComponent:a="a",className:i="",mobileMenuId:s="app-mobile-menu",sidebarCollapseId:c="app-sidebar-collapse"})=>{let l=m=>m.length>0&&"items"in m[0],d=m=>l(m)?m:[{id:"default-section",items:m}],u=(m,f,g)=>jsxRuntime.jsxs("div",{className:"space-y-0.5",children:[m.title&&jsxRuntime.jsx("div",{className:"px-6 py-1 text-xs font-medium text-text-secondary uppercase tracking-wider",children:m.title}),jsxRuntime.jsx("div",{className:"space-y-0.5",children:m.items.map(b=>p(b))}),f<g-1&&jsxRuntime.jsx("div",{className:"border-b border-border-subtle mx-6 my-2"})]},m.id),p=(m,f=false)=>{if(m.children&&m.children.length>0){let x=`category-${m.id}`;return jsxRuntime.jsxs("div",{className:"group/category",children:[jsxRuntime.jsx("input",{type:"checkbox",id:x,className:"peer/category hidden",defaultChecked:m.isExpanded,"aria-hidden":"true"}),jsxRuntime.jsxs("label",{htmlFor:x,className:"flex items-center gap-3 px-6 py-1 text-text-primary hover:bg-background-hover hover:text-text-primary cursor-pointer transition-all duration-200",children:[m.icon&&jsxRuntime.jsx("span",{className:"flex-shrink-0 w-3.5 h-3.5 flex items-center justify-center transition-all duration-200",children:m.icon}),jsxRuntime.jsx("span",{className:"transition-all duration-200",children:m.label}),jsxRuntime.jsx("span",{className:"flex-1"}),jsxRuntime.jsx("svg",{className:"w-4 h-4 transform transition-transform duration-200 peer-checked/category:rotate-180 ml-auto",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),jsxRuntime.jsx("div",{className:"hidden peer-checked/category:block bg-background-subtle border-l-2 border-border-subtle ml-6",children:m.children.map(h=>p(h,true))})]},m.id)}let g={href:m.href||"#",className:`flex items-center gap-3 transition-all duration-200 hover:bg-background-hover ${f?"pl-8 pr-6 py-1 text-sm":"px-6 py-1"} ${m.isActive?`bg-action-brand/10 text-action-brand ${f?"":"border-l-2 border-action-brand"}`:"text-text-primary hover:text-text-primary"}`,"aria-current":m.isActive?"page":void 0},b=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[m.icon&&!f&&jsxRuntime.jsx("span",{className:"flex-shrink-0 w-3.5 h-3.5 flex items-center justify-center transition-all duration-200",children:m.icon}),jsxRuntime.jsx("span",{className:"transition-all duration-200",children:m.label})]});return a==="a"?jsxRuntime.jsx("a",{...g,children:b},m.id):jsxRuntime.jsx(a,{...g,children:b},m.id)};return jsxRuntime.jsxs("div",{className:`flex flex-col h-full ${i}`,children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between h-[60px] px-6 border-b border-border-default",children:[n&&jsxRuntime.jsx("div",{className:"relative top-[-1px] transition-all duration-200",children:o||jsxRuntime.jsx(ei,{showWordmark:true,width:120})}),jsxRuntime.jsx("label",{htmlFor:c,className:"hidden md:flex items-center justify-center w-8 h-8 rounded hover:bg-background-hover cursor-pointer transition-all duration-200 relative top-[-1px]","aria-label":"Collapse sidebar",children:jsxRuntime.jsx(xr,{name:"Sidebar",size:"sm"})}),jsxRuntime.jsx("label",{htmlFor:s,className:"md:hidden flex items-center justify-center w-8 h-8 rounded hover:bg-background-hover cursor-pointer transition-colors","aria-label":"Close menu",children:jsxRuntime.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),jsxRuntime.jsxs("nav",{className:"flex-1 flex flex-col overflow-hidden",children:[e&&e.length>0&&jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto py-2 scrollbar-hide",children:d(e).map((m,f,g)=>u(m,f,g.length))}),t&&t.length>0&&jsxRuntime.jsx("div",{className:"flex-shrink-0 border-t bg-background-muted/30",children:jsxRuntime.jsx("div",{className:"mt-2 pb-2 space-y-0.5",children:t.map(m=>p(m))})}),r&&jsxRuntime.jsx("div",{className:"flex-shrink-0 border-t border-border-default",children:jsxRuntime.jsx("div",{children:r})})]})]})};function Wn(e){return e.id??e.href??e.label}function Dp(e,t,r=[]){for(let o of e){if(o.href===t||o.id===t)return o.children?.length&&o.pushOnSelect!==false?[...r,Wn(o)]:r;if(o.children?.length){let n=Dp(o.children,t,[...r,Wn(o)]);if(n)return n}}return null}function Mx(e,t){let r=[],o=e;for(let n of t){let a=o.find(i=>Wn(i)===n);if(!a)break;r.push(a),o=a.children??[];}return r}function iN(e,t,r){let o=t.length>0?[...e,...t]:e,n=[{path:[],items:e,bottomItems:t.length>0?t:void 0}],a=Mx(o,r),i=[];for(let s of a){if(!s.children?.length)break;i=[...i,Wn(s)],n.push({path:i,parent:s,items:s.children});}return n}var sN=({href:e,...t})=>jsxRuntime.jsx("a",{href:e,...t}),Px=[];function lN(e){let t=[];for(let r of e){let o=r.items??[];o.length!==0&&(t.length>0&&t.push({id:`__divider__${r.id}`,label:"",divider:true}),r.title&&t.push({id:`__group__${r.id}`,label:r.title,groupLabel:true}),t.push(...o));}return t}function cN(e,t){if(process.env.NODE_ENV==="production"||t.length===0)return;let r=new Map;for(let o of e)o.id&&r.set(o.id,"id"),o.href&&!r.has(o.href)&&r.set(o.href,"href");for(let o of t){let n=null;o.id&&r.has(o.id)?n=r.get(o.id)==="id"?`id "${o.id}"`:`id "${o.id}" (matches an items \`href\`)`:o.href&&r.has(o.href)&&(n=r.get(o.href)==="href"?`href "${o.href}"`:`href "${o.href}" (matches an items \`id\`)`),n&&console.warn(`[StackNav] L1 ${n} appears in both \`items\` and \`bottomItems\`. Stack tokens and value lookups will resolve to the \`items\` entry, making the bottomItems entry unreachable. L1 ids and hrefs must be unique across both arrays.`);}}function dN(e){if(!e)return {};let t={};return e.background!==void 0&&(t["--edges-stack-nav-background"]=e.background),e.activeBackground!==void 0&&(t["--edges-stack-nav-row-active-background"]=e.activeBackground),e.activeColor!==void 0&&(t["--edges-stack-nav-row-active-color"]=e.activeColor),e.hoverBackground!==void 0&&(t["--edges-stack-nav-row-hover-background"]=e.hoverBackground),e.borderColor!==void 0&&(t["--edges-stack-nav-border-color"]=e.borderColor),t}function Gl({items:e,groups:t,bottomItems:r,value:o,defaultStack:n,stack:a,onStackChange:i,onSelect:s,linkComponent:c=sN,showLogo:l=false,logo:d,header:u,footer:p,mobileMenuId:m,sidebarCollapseId:f,rootLabel:g,sticky:b=true,width:x=260,ariaLabel:h="Navigation",theme:y,animated:v=true,style:S,className:w}){process.env.NODE_ENV!=="production"&&t&&e&&console.warn("[StackNav] Both `items` and `groups` were provided. `groups` takes precedence and `items` is ignored.");let N=He__namespace.useMemo(()=>t?lN(t):e??Px,[t,e]),D=r??Px,R=He__namespace.useMemo(()=>D.length>0?[...N,...D]:N,[N,D]);He__namespace.useEffect(()=>{cN(N,D);},[N,D]);let[A,O]=He__namespace.useState(()=>a!==void 0?a:n!==void 0?n:o?Dp(R,o)??[]:[]),P=a??A,T=He__namespace.useCallback(M=>{a===void 0&&O(M),i?.(M);},[a,i]),k=He__namespace.useRef(false);He__namespace.useEffect(()=>{if(a!==void 0||!k.current&&(k.current=true,n!==void 0)||!o)return;let M=Dp(R,o);O(E=>{let z=M??[];return fN(E,z)?E:z});},[o,R,a,n]);let V=He__namespace.useMemo(()=>iN(N,D,P),[N,D,P]),H=He__namespace.useCallback((M,E)=>{M.children?.length&&T([...E,Wn(M)]);},[T]),I=He__namespace.useCallback(()=>{T(P.slice(0,-1));},[P,T]),q=He__namespace.useCallback((M,E)=>{let z=Mx(R,P);if(s?.(E,z),!!E.children?.length&&E.pushOnSelect!==false){let C=V[V.length-1]?.path??[];H(E,C);}E.href||M.preventDefault();},[R,P,s,H,V]),j=He__namespace.useCallback(M=>o?M.href===o||M.id===o:false,[o]),K=b?"sticky top-0 h-[100dvh]":"",Y={...x!=null?{width:x}:{},...dN(y),...S};return jsxRuntime.jsxs("aside",{role:"navigation","aria-label":h,"data-edges-stack-nav":"",className:tailwindMerge.twMerge("edges-stack-nav flex flex-col flex-shrink-0 overflow-hidden",v&&"edges-stack-nav--animated",K,w),style:Y,children:[l?jsxRuntime.jsxs("div",{className:"edges-stack-nav__logo",children:[jsxRuntime.jsx("div",{className:"relative top-[-1px]",children:d??jsxRuntime.jsx(ei,{showWordmark:true,width:120})}),f?jsxRuntime.jsx("label",{htmlFor:f,className:"hidden md:flex items-center justify-center w-8 h-8 rounded hover:bg-background-hover cursor-pointer transition-all duration-200 relative top-[-1px]","aria-label":"Collapse sidebar",children:jsxRuntime.jsx(xr,{name:"Sidebar",size:"sm"})}):null,m?jsxRuntime.jsx("label",{htmlFor:m,className:"md:hidden flex items-center justify-center w-8 h-8 rounded hover:bg-background-hover cursor-pointer transition-colors","aria-label":"Close menu",children:jsxRuntime.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}):null]}):null,u?jsxRuntime.jsx("div",{className:"edges-stack-nav__header",children:u}):null,jsxRuntime.jsx("div",{className:"relative flex-1 overflow-hidden",children:V.map((M,E)=>{let z=M.path.length,B=E===V.length-1,C=E<V.length-1,W=z===0?"__root__":M.path.join("/");return jsxRuntime.jsx(uN,{pane:M,parentPath:M.path.slice(0,-1),depth:z,isTop:B,isAbove:C,rootLabel:g,LinkComponent:c,isActive:j,onSelect:q,onBack:I,animated:v},W)})}),p?jsxRuntime.jsx("div",{className:"edges-stack-nav__footer",children:p}):null]})}function uN({pane:e,depth:t,isTop:r,isAbove:o,rootLabel:n,LinkComponent:a,isActive:i,onSelect:s,onBack:c,animated:l}){let d=r?"edges-stack-nav__pane--top":o?"edges-stack-nav__pane--above":"edges-stack-nav__pane--below";return jsxRuntime.jsxs("nav",{"aria-label":e.parent?.label??n??"Navigation","aria-hidden":r?void 0:true,inert:r?void 0:true,className:tailwindMerge.twMerge("edges-stack-nav__pane absolute inset-0 flex flex-col gap-px overflow-y-auto px-2 py-3",!l&&"edges-stack-nav__pane--instant",d),children:[t>0&&e.parent?jsxRuntime.jsxs("button",{type:"button",className:"edges-stack-nav__back edges-stack-nav__row flex w-full cursor-pointer items-center gap-2 rounded-sm border-0 bg-transparent px-3 py-2 mb-2 text-left text-sm font-semibold text-text-primary",onClick:c,"aria-label":`Back from ${e.parent.label}`,children:[jsxRuntime.jsx(mN,{}),jsxRuntime.jsx("span",{children:e.parent.label})]}):n?jsxRuntime.jsx("div",{className:"px-3 pb-1.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-text-secondary",children:n}):null,e.items.map(u=>jsxRuntime.jsx(Rx,{item:u,LinkComponent:a,isActive:i(u),onSelect:s},Wn(u))),e.bottomItems&&e.bottomItems.length>0?jsxRuntime.jsx("div",{className:"edges-stack-nav__bottom-items mt-auto flex flex-col gap-px pt-3",children:e.bottomItems.map(u=>jsxRuntime.jsx(Rx,{item:u,LinkComponent:a,isActive:i(u),onSelect:s},Wn(u)))}):null]})}function Rx({item:e,LinkComponent:t,isActive:r,onSelect:o}){if(e.divider)return jsxRuntime.jsx("div",{className:"edges-stack-nav__divider my-2",role:"separator"});if(e.groupLabel)return jsxRuntime.jsx("div",{className:"px-3 pt-6 pb-1.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-text-secondary",children:e.label});let n=!!e.children?.length,a=tailwindMerge.twMerge("edges-stack-nav__row flex items-center justify-between gap-3 rounded-sm px-3 py-2 text-sm font-normal text-text-primary no-underline cursor-pointer text-left bg-transparent border-0 transition-colors",r&&"edges-stack-nav__row--active font-semibold"),i=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[e.leading??e.icon?jsxRuntime.jsx("span",{className:"inline-flex items-center flex-shrink-0",children:e.leading??e.icon}):null,jsxRuntime.jsx("span",{className:"truncate",children:e.label})]}),jsxRuntime.jsxs("span",{className:"flex flex-shrink-0 items-center gap-2 text-text-secondary",children:[e.trailing,n?jsxRuntime.jsx(pN,{}):null]})]});return e.href?jsxRuntime.jsx(t,{href:e.href,"aria-label":e.ariaLabel,className:a,"aria-current":r?"page":void 0,onClick:s=>o(s,e),children:i}):jsxRuntime.jsx("button",{type:"button",className:a,"aria-label":e.ariaLabel,onClick:s=>{o(s,e);},children:i})}function pN(){return jsxRuntime.jsx("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:"M4.5 3 7.5 6 4.5 9"})})}function mN(){return jsxRuntime.jsx("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:"M8.5 3 4.5 7 8.5 11"})})}function fN(e,t){if(e===t)return true;if(e.length!==t.length)return false;for(let r=0;r<e.length;r+=1)if(e[r]!==t[r])return false;return true}var rs=({rightContent:e,centerContent:t,showMobileMenu:r=true,avatar:o,showColorModeSwitcher:n=false,toggleTheme:a,isDarkThemeEnabled:i=false,colorMode:s,actions:c,className:l="",mobileMenuId:d="app-mobile-menu"})=>{let u=()=>{switch(s||(i?"dark":"light")){case "system":return jsxRuntime.jsx(xr,{name:"Monitor",size:"sm"});case "light":return jsxRuntime.jsx(xr,{name:"Sun",size:"sm"});case "dark":return jsxRuntime.jsx(xr,{name:"Moon",size:"sm"})}},p=()=>{switch(s||(i?"dark":"light")){case "system":return "Switch to light mode";case "light":return "Switch to dark mode";case "dark":return "Switch to system mode";default:return "Toggle theme"}};return jsxRuntime.jsx("header",{className:`h-[60px] bg-background-surface border-b ${l}`,children:jsxRuntime.jsxs("div",{className:"relative flex h-full items-center",children:[jsxRuntime.jsx("div",{className:"flex items-center h-full flex-shrink-0",children:r&&jsxRuntime.jsx("label",{htmlFor:d,className:"md:hidden cursor-pointer","aria-label":"Open menu",children:jsxRuntime.jsx("div",{className:"flex h-full w-14 flex-col items-center justify-center border-r hover:bg-background-hover transition-colors",children:jsxRuntime.jsx(xr,{name:"List",size:"sm"})})})}),t&&jsxRuntime.jsx("div",{className:"flex-1 flex justify-end md:justify-center md:px-4 min-w-0",children:jsxRuntime.jsx("div",{className:"w-full md:max-w-4xl min-w-0",children:t})}),!t&&jsxRuntime.jsx("div",{className:"flex-1"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-4 pr-4 flex-shrink-0 ml-4",children:[e,n&&a&&jsxRuntime.jsx("button",{type:"button",onClick:a,className:"flex items-center justify-center w-8 h-8 rounded hover:bg-background-hover transition-colors","aria-label":p(),children:u()}),c,o&&jsxRuntime.jsx("div",{className:"flex items-center",children:o})]})]})})};function Ex({sideNav:e,stackNav:t,topNav:r,children:o,contentPaddingX:n,contentPaddingY:a,showSidebarBorder:i=true,mainClassName:s,enableJsEnhancements:c=false}){let l="app-mobile-menu",d="app-sidebar-collapse";return He.useEffect(()=>{if(!c)return;let u=document.getElementById(d),p=document.getElementById(l),m=document.querySelector("[data-app-shell]"),f=document.getElementById("app-sidebar");if(!u||!m||!f)return;let g=null,b=false;try{let A=localStorage.getItem("sidebar-collapsed");A!==null&&(u.checked=A==="true");}catch{}let x=()=>{try{localStorage.setItem("sidebar-collapsed",String(u.checked));}catch{}u.checked?b=true:(g&&(clearTimeout(g),g=null),m.removeAttribute("data-peek"),b=false);};u.addEventListener("change",x);let h=A=>{A.key==="Escape"&&(p&&(p.checked=false),m.removeAttribute("data-peek"));};document.addEventListener("keydown",h);let y=null;p&&(y=()=>{document.body.style.overflow=p.checked?"hidden":"";},p.addEventListener("change",y));let v=A=>{let P=A.target.closest("a");P&&P.href&&window.innerWidth<768&&p&&setTimeout(()=>{p.checked=false,document.body.style.overflow="";},100);};f.addEventListener("click",v);let S=16,w=200,N=()=>{g&&(clearTimeout(g),g=null),m.getAttribute("data-peek")!=="true"&&m.setAttribute("data-peek","true");},D=()=>{g&&clearTimeout(g),g=setTimeout(()=>{m.removeAttribute("data-peek"),g=null;},w);},R=A=>{if(window.innerWidth<768||!u.checked)return;let O=f.contains(A.target);if(b&&!O&&(b=false),b)return;A.clientX<=S||O?N():m.getAttribute("data-peek")==="true"&&D();};return document.addEventListener("mousemove",R),()=>{u.removeEventListener("change",x),document.removeEventListener("keydown",h),p&&y&&p.removeEventListener("change",y),f.removeEventListener("click",v),document.removeEventListener("mousemove",R),g&&clearTimeout(g);}},[c,l,d]),jsxRuntime.jsxs("div",{className:"min-h-[100dvh] bg-background text-text-primary relative","data-app-shell":"",children:[jsxRuntime.jsx("input",{type:"checkbox",id:d,className:"sr-only peer/sidebar","aria-hidden":"true"}),jsxRuntime.jsx("a",{href:"#app-content",className:"sr-only focus:not-sr-only focus:absolute focus:left-4 focus:top-4 z-50 rounded px-3 py-2 bg-background-surface shadow",children:"Skip to content"}),jsxRuntime.jsx(rs,{...r,mobileMenuId:l,className:["sticky top-0 flex-shrink-0 z-30 md:hidden",r?.className].filter(Boolean).join(" ")}),jsxRuntime.jsxs("div",{className:"flex w-full h-[calc(100dvh-60px)] md:h-[100dvh] relative overflow-hidden",children:[jsxRuntime.jsx("input",{type:"checkbox",id:l,className:"sr-only peer/mobile","aria-hidden":"true"}),jsxRuntime.jsx("label",{htmlFor:l,className:"fixed inset-0 bg-background-modal z-[55] opacity-0 pointer-events-none peer-checked/mobile:opacity-100 peer-checked/mobile:pointer-events-auto transition-opacity md:hidden","aria-label":"Close menu"}),jsxRuntime.jsx("div",{"aria-hidden":"true","data-peek-zone":"",className:"hidden md:block fixed left-0 top-0 bottom-0 w-4 z-[70] pointer-events-none"}),jsxRuntime.jsx("label",{htmlFor:d,"data-expand-rail":"",className:"hidden fixed left-3 top-3 z-[75] items-center justify-center w-9 h-9 rounded-md bg-background-surface border border-border-default shadow-sm hover:bg-background-hover cursor-pointer transition-all duration-200","aria-label":"Expand sidebar",children:jsxRuntime.jsx(xr,{name:"Sidebar",size:"sm"})}),jsxRuntime.jsx("aside",{id:"app-sidebar","data-app-sidebar":"",className:["bg-background-surface","border-r border-border-default","transition-transform duration-300 ease-in-out md:transition-[transform,width] md:duration-300 md:ease-in-out","fixed md:relative","left-0 top-0 bottom-0","z-[60] md:z-10","w-full md:w-64","h-[100dvh] md:h-full","-translate-x-full","peer-checked/mobile:translate-x-0","md:translate-x-0",i?"":"!border-r-0",(t??e)?.className||""].filter(Boolean).join(" "),children:t?jsxRuntime.jsx(Gl,{...t,mobileMenuId:l,sidebarCollapseId:d,sticky:false,width:null,className:["h-full !border-r-0",t.className].filter(Boolean).join(" ")}):jsxRuntime.jsx(Wl,{...e,mobileMenuId:l,sidebarCollapseId:d,className:"h-full"})}),jsxRuntime.jsxs("div",{className:"flex-1 flex flex-col h-full overflow-hidden",children:[jsxRuntime.jsx("div",{className:"sticky top-0 flex-shrink-0 hidden md:block z-20","data-top-nav-wrapper":"",children:jsxRuntime.jsx(rs,{...r,className:r?.className})}),jsxRuntime.jsx("main",{id:"app-content",className:["flex-1 overflow-y-auto overflow-x-hidden bg-background-body",n,a,s||""].join(" "),role:"main",children:o})]})]}),jsxRuntime.jsx("style",{dangerouslySetInnerHTML:{__html:`
5
5
  @media (min-width: 768px) {
6
6
  /* Collapsed: hide the rail offscreen, surface the floating expand
7
7
  button, and let the edge zone receive hover events. */
@@ -26,7 +26,7 @@ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var B=z(K,E,I,q,j+"."+E,
26
26
  z-index: 50;
27
27
  }
28
28
  }
29
- `}})]})}var Ul={prefix:String(Math.round(Math.random()*1e10)),current:0},Lx=He__namespace.default.createContext(Ul),yN=He__namespace.default.createContext(false);var vN=!!(typeof window<"u"&&window.document&&window.document.createElement),Ap=new WeakMap;function CN(e=false){let t=He.useContext(Lx),r=He.useRef(null);if(r.current===null&&!e){var o,n;let a=(n=He__namespace.default.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||n===void 0||(o=n.ReactCurrentOwner)===null||o===void 0?void 0:o.current;if(a){let i=Ap.get(a);i==null?Ap.set(a,{id:t.current,state:a.memoizedState}):a.memoizedState!==i.state&&(t.current=i.id,Ap.delete(a));}r.current=++t.current;}return r.current}function SN(e){let t=He.useContext(Lx);t===Ul&&!vN&&process.env.NODE_ENV!=="production"&&console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");let r=CN(!!e),o=t===Ul&&process.env.NODE_ENV==="test"?"react-aria":`react-aria${t.prefix}`;return e||`${o}-${r}`}function wN(e){let t=He__namespace.default.useId(),[r]=He.useState(Yl()),o=r||process.env.NODE_ENV==="test"?"react-aria":`react-aria${Ul.prefix}`;return e||`${o}-${t}`}typeof He__namespace.default.useId=="function"?wN:SN;function NN(){return false}function kN(){return true}function PN(e){return ()=>{}}function Yl(){return typeof He__namespace.default.useSyncExternalStore=="function"?He__namespace.default.useSyncExternalStore(PN,NN,kN):He.useContext(yN)}function Ax(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Kl(e,t,r){Ax(e,t),t.set(e,r);}var RN=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),MN=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function Fp(e){if(Intl.Locale){let r=new Intl.Locale(e).maximize(),o=typeof r.getTextInfo=="function"?r.getTextInfo():r.textInfo;if(o)return o.direction==="rtl";if(r.script)return RN.has(r.script)}let t=e.split("-")[0];return MN.has(t)}var Fx=Symbol.for("react-aria.i18n.locale");function Bx(){let e=typeof window<"u"&&window[Fx]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e]);}catch{e="en-US";}return {locale:e,direction:Fp(e)?"rtl":"ltr"}}var Bp=Bx(),os=new Set;function Ix(){Bp=Bx();for(let e of os)e(Bp);}function Vx(){let e=Yl(),[t,r]=He.useState(Bp);return He.useEffect(()=>(os.size===0&&window.addEventListener("languagechange",Ix),os.add(r),()=>{os.delete(r),os.size===0&&window.removeEventListener("languagechange",Ix);}),[]),e?{locale:typeof window<"u"&&window[Fx]||"en-US",direction:"ltr"}:t}var IN=He__namespace.default.createContext(null);function Vp(){let e=Vx();return He.useContext(IN)||e}function ql(e,t){return e-t*Math.floor(e/t)}var Ox=1721426;function jl(e,t,r,o){t=$l(e,t);let n=t-1,a=-2;return r<=2?a=0:Jl(t)&&(a=-1),Ox-1+365*n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400)+Math.floor((367*r-362)/12+a+o)}function Jl(e){return e%4===0&&(e%100!==0||e%400===0)}function $l(e,t){return e==="BC"?1-t:t}function FN(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}var BN={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]},Fr=class{fromJulianDay(t){let r=t,o=r-Ox,n=Math.floor(o/146097),a=ql(o,146097),i=Math.floor(a/36524),s=ql(a,36524),c=Math.floor(s/1461),l=ql(s,1461),d=Math.floor(l/365),u=n*400+i*100+c*4+d+(i!==4&&d!==4?1:0),[p,m]=FN(u),f=r-jl(p,m,1,1),g=2;r<jl(p,m,3,1)?g=0:Jl(m)&&(g=1);let b=Math.floor(((f+g)*12+373)/367),x=r-jl(p,m,b,1)+1;return new Un(p,m,b,x)}toJulianDay(t){return jl(t.era,t.year,t.month,t.day)}getDaysInMonth(t){return BN[Jl(t.year)?"leapyear":"standard"][t.month-1]}getMonthsInYear(t){return 12}getDaysInYear(t){return Jl(t.year)?366:365}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getYearsInEra(t){return 9999}getEras(){return ["BC","AD"]}isInverseEra(t){return t.era==="BC"}balanceDate(t){t.year<=0&&(t.era=t.era==="BC"?"AD":"BC",t.year=1-t.year);}constructor(){this.identifier="gregory";}};function zp(e,t){var r,o,n,a;return (a=(n=(r=e.isEqual)===null||r===void 0?void 0:r.call(e,t))!==null&&n!==void 0?n:(o=t.isEqual)===null||o===void 0?void 0:o.call(t,e))!==null&&a!==void 0?a:e.identifier===t.identifier}function Hp(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function Hx(e,t){return zx(e)-zx(t)}function zx(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}var Op=null;function Yn(){return Op==null&&(Op=new Intl.DateTimeFormat().resolvedOptions().timeZone),Op}function nn(e){e=yr(e,new Fr);let t=$l(e.era,e.year);return Ux(t,e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function Ux(e,t,r,o,n,a,i){let s=new Date;return s.setUTCHours(o,n,a,i),s.setUTCFullYear(e,t-1,r),s.getTime()}function Gp(e,t){if(t==="UTC")return 0;if(e>0&&t===Yn()&&true)return new Date(e).getTimezoneOffset()*-6e4;let{year:r,month:o,day:n,hour:a,minute:i,second:s}=Yx(e,t);return Ux(r,o,n,a,i,s,0)-Math.floor(e/1e3)*1e3}var Wx=new Map;function Yx(e,t){let r=Wx.get(t);r||(r=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:false,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),Wx.set(t,r));let o=r.formatToParts(new Date(e)),n={};for(let a of o)a.type!=="literal"&&(n[a.type]=a.value);return {year:n.era==="BC"||n.era==="B"?-n.year+1:+n.year,month:+n.month,day:+n.day,hour:n.hour==="24"?0:+n.hour,minute:+n.minute,second:+n.second}}var Gx=864e5;function ON(e,t,r,o){return (r===o?[r]:[r,o]).filter(a=>zN(e,t,a))}function zN(e,t,r){let o=Yx(r,t);return e.year===o.year&&e.month===o.month&&e.day===o.day&&e.hour===o.hour&&e.minute===o.minute&&e.second===o.second}function Xr(e,t,r="compatible"){let o=mo(e);if(t==="UTC")return nn(o);if(t===Yn()&&r==="compatible"&&true){o=yr(o,new Fr);let c=new Date,l=$l(o.era,o.year);return c.setFullYear(l,o.month-1,o.day),c.setHours(o.hour,o.minute,o.second,o.millisecond),c.getTime()}let n=nn(o),a=Gp(n-Gx,t),i=Gp(n+Gx,t),s=ON(o,t,n-a,n-i);if(s.length===1)return s[0];if(s.length>1)switch(r){case "compatible":case "earlier":return s[0];case "later":return s[s.length-1];case "reject":throw new RangeError("Multiple possible absolute times found")}switch(r){case "earlier":return Math.min(n-a,n-i);case "compatible":case "later":return Math.max(n-a,n-i);case "reject":throw new RangeError("No such absolute time found")}}function Up(e,t,r="compatible"){return new Date(Xr(e,t,r))}function Br(e,t){let r=Gp(e,t),o=new Date(e+r),n=o.getUTCFullYear(),a=o.getUTCMonth()+1,i=o.getUTCDate(),s=o.getUTCHours(),c=o.getUTCMinutes(),l=o.getUTCSeconds(),d=o.getUTCMilliseconds();return new ti(n<1?"BC":"AD",n<1?-n+1:n,a,i,t,r,s,c,l,d)}function Xl(e,t){return Br(e.getTime(),t)}function mo(e,t){let r=0,o=0,n=0,a=0;if("timeZone"in e)({hour:r,minute:o,second:n,millisecond:a}=e);else if("hour"in e&&true)return e;return new ns(e.calendar,e.era,e.year,e.month,e.day,r,o,n,a)}function yr(e,t){if(zp(e.calendar,t))return e;let r=t.fromJulianDay(e.calendar.toJulianDay(e)),o=e.copy();return o.calendar=t,o.era=r.era,o.year=r.year,o.month=r.month,o.day=r.day,Lo(o),o}function Yp(e,t,r){if(e instanceof ti)return e.timeZone===t?e:Kp(e,t);let o=Xr(e,t,r);return Br(o,t)}function Kx(e){let t=nn(e)-e.offset;return new Date(t)}function Kp(e,t){let r=nn(e)-e.offset;return yr(Br(r,t),e.calendar)}var as=36e5;function ss(e,t){let r=e.copy(),o="hour"in r?UN(r,t):0;qp(r,t.years||0),r.calendar.balanceYearMonth&&r.calendar.balanceYearMonth(r,e),r.month+=t.months||0,jp(r),qx(r),r.day+=(t.weeks||0)*7,r.day+=t.days||0,r.day+=o,WN(r),r.calendar.balanceDate&&r.calendar.balanceDate(r),r.year<1&&(r.year=1,r.month=1,r.day=1);let n=r.calendar.getYearsInEra(r);if(r.year>n){var a,i;let c=(a=(i=r.calendar).isInverseEra)===null||a===void 0?void 0:a.call(i,r);r.year=n,r.month=c?1:r.calendar.getMonthsInYear(r),r.day=c?1:r.calendar.getDaysInMonth(r);}r.month<1&&(r.month=1,r.day=1);let s=r.calendar.getMonthsInYear(r);return r.month>s&&(r.month=s,r.day=r.calendar.getDaysInMonth(r)),r.day=Math.max(1,Math.min(r.calendar.getDaysInMonth(r),r.day)),r}function qp(e,t){var r,o;!((r=(o=e.calendar).isInverseEra)===null||r===void 0)&&r.call(o,e)&&(t=-t),e.year+=t;}function jp(e){for(;e.month<1;)qp(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,qp(e,1);}function WN(e){for(;e.day<1;)e.month--,jp(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,jp(e);}function qx(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day));}function Lo(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),qx(e);}function jx(e){let t={};for(let r in e)typeof e[r]=="number"&&(t[r]=-e[r]);return t}function Jp(e,t){return ss(e,jx(t))}function Ql(e,t){let r=e.copy();return t.era!=null&&(r.era=t.era),t.year!=null&&(r.year=t.year),t.month!=null&&(r.month=t.month),t.day!=null&&(r.day=t.day),Lo(r),r}function is(e,t){let r=e.copy();return t.hour!=null&&(r.hour=t.hour),t.minute!=null&&(r.minute=t.minute),t.second!=null&&(r.second=t.second),t.millisecond!=null&&(r.millisecond=t.millisecond),Jx(r),r}function GN(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=Zl(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=Zl(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=Zl(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=Zl(e.hour,24),t}function Jx(e){e.millisecond=Math.max(0,Math.min(e.millisecond,1e3)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23));}function Zl(e,t){let r=e%t;return r<0&&(r+=t),r}function UN(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,GN(e)}function _l(e,t,r,o){let n=e.copy();switch(t){case "era":{let s=e.calendar.getEras(),c=s.indexOf(e.era);if(c<0)throw new Error("Invalid era: "+e.era);c=Ao(c,r,0,s.length-1,o?.round),n.era=s[c],Lo(n);break}case "year":var a,i;!((a=(i=n.calendar).isInverseEra)===null||a===void 0)&&a.call(i,n)&&(r=-r),n.year=Ao(e.year,r,-1/0,9999,o?.round),n.year===-1/0&&(n.year=1),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e);break;case "month":n.month=Ao(e.month,r,1,e.calendar.getMonthsInYear(e),o?.round);break;case "day":n.day=Ao(e.day,r,1,e.calendar.getDaysInMonth(e),o?.round);break;default:throw new Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(n),Lo(n),n}function $p(e,t,r,o){let n=e.copy();switch(t){case "hour":{let a=e.hour,i=0,s=23;if(o?.hourCycle===12){let c=a>=12;i=c?12:0,s=c?23:11;}n.hour=Ao(a,r,i,s,o?.round);break}case "minute":n.minute=Ao(e.minute,r,0,59,o?.round);break;case "second":n.second=Ao(e.second,r,0,59,o?.round);break;case "millisecond":n.millisecond=Ao(e.millisecond,r,0,999,o?.round);break;default:throw new Error("Unsupported field "+t)}return n}function Ao(e,t,r,o,n=false){if(n){e+=Math.sign(t),e<r&&(e=o);let a=Math.abs(t);t>0?e=Math.ceil(e/a)*a:e=Math.floor(e/a)*a,e>o&&(e=r);}else e+=t,e<r?e=o-(r-e-1):e>o&&(e=r+(e-o-1));return e}function Xp(e,t){let r;if(t.years!=null&&t.years!==0||t.months!=null&&t.months!==0||t.weeks!=null&&t.weeks!==0||t.days!=null&&t.days!==0){let n=ss(mo(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days});r=Xr(n,e.timeZone);}else r=nn(e)-e.offset;r+=t.milliseconds||0,r+=(t.seconds||0)*1e3,r+=(t.minutes||0)*6e4,r+=(t.hours||0)*36e5;let o=Br(r,e.timeZone);return yr(o,e.calendar)}function $x(e,t){return Xp(e,jx(t))}function Xx(e,t,r,o){switch(t){case "hour":{let n=0,a=23;if(o?.hourCycle===12){let f=e.hour>=12;n=f?12:0,a=f?23:11;}let i=mo(e),s=yr(is(i,{hour:n}),new Fr),c=[Xr(s,e.timeZone,"earlier"),Xr(s,e.timeZone,"later")].filter(f=>Br(f,e.timeZone).day===s.day)[0],l=yr(is(i,{hour:a}),new Fr),d=[Xr(l,e.timeZone,"earlier"),Xr(l,e.timeZone,"later")].filter(f=>Br(f,e.timeZone).day===l.day).pop(),u=nn(e)-e.offset,p=Math.floor(u/as),m=u%as;return u=Ao(p,r,Math.floor(c/as),Math.floor(d/as),o?.round)*as+m,yr(Br(u,e.timeZone),e.calendar)}case "minute":case "second":case "millisecond":return $p(e,t,r,o);case "era":case "year":case "month":case "day":{let n=_l(mo(e),t,r,o),a=Xr(n,e.timeZone);return yr(Br(a,e.timeZone),e.calendar)}default:throw new Error("Unsupported field "+t)}}function Zx(e,t,r){let o=mo(e),n=is(Ql(o,t),t);if(n.compare(o)===0)return e;let a=Xr(n,e.timeZone,r);return yr(Br(a,e.timeZone),e.calendar)}var YN=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})$/;var KN=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;function ls(e){let t=e.match(YN);if(!t)throw KN.test(e)?new Error(`Invalid ISO 8601 date string: ${e}. Use parseAbsolute() instead.`):new Error("Invalid ISO 8601 date string: "+e);let r=new Un(Zp(t[1],0,9999),Zp(t[2],1,12),1);return r.day=Zp(t[3],1,r.calendar.getDaysInMonth(r)),r}function Zp(e,t,r){let o=Number(e);if(o<t||o>r)throw new RangeError(`Value out of range: ${t} <= ${o} <= ${r}`);return o}function Qx(e){return `${String(e.hour).padStart(2,"0")}:${String(e.minute).padStart(2,"0")}:${String(e.second).padStart(2,"0")}${e.millisecond?String(e.millisecond/1e3).slice(1):""}`}function Qp(e){let t=yr(e,new Fr),r;return t.era==="BC"?r=t.year===1?"0000":"-"+String(Math.abs(1-t.year)).padStart(6,"00"):r=String(t.year).padStart(4,"0"),`${r}-${String(t.month).padStart(2,"0")}-${String(t.day).padStart(2,"0")}`}function _p(e){return `${Qp(e)}T${Qx(e)}`}function jN(e){let t=Math.sign(e)<0?"-":"+";e=Math.abs(e);let r=Math.floor(e/36e5),o=Math.floor(e%36e5/6e4),n=Math.floor(e%36e5%6e4/1e3),a=`${t}${String(r).padStart(2,"0")}:${String(o).padStart(2,"0")}`;return n!==0&&(a+=`:${String(n).padStart(2,"0")}`),a}function _x(e){return `${_p(e)}${jN(e.offset)}[${e.timeZone}]`}function em(e){let t=typeof e[0]=="object"?e.shift():new Fr,r;if(typeof e[0]=="string")r=e.shift();else {let i=t.getEras();r=i[i.length-1];}let o=e.shift(),n=e.shift(),a=e.shift();return [t,r,o,n,a]}var JN=new WeakMap,Un=class e{copy(){return this.era?new e(this.calendar,this.era,this.year,this.month,this.day):new e(this.calendar,this.year,this.month,this.day)}add(t){return ss(this,t)}subtract(t){return Jp(this,t)}set(t){return Ql(this,t)}cycle(t,r,o){return _l(this,t,r,o)}toDate(t){return Up(this,t)}toString(){return Qp(this)}compare(t){return Hp(this,t)}constructor(...t){Kl(this,JN,{writable:true,value:void 0});let[r,o,n,a,i]=em(t);this.calendar=r,this.era=o,this.year=n,this.month=a,this.day=i,Lo(this);}};var $N=new WeakMap,ns=class e{copy(){return this.era?new e(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new e(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return ss(this,t)}subtract(t){return Jp(this,t)}set(t){return Ql(is(this,t),t)}cycle(t,r,o){switch(t){case "era":case "year":case "month":case "day":return _l(this,t,r,o);default:return $p(this,t,r,o)}}toDate(t,r){return Up(this,t,r)}toString(){return _p(this)}compare(t){let r=Hp(this,t);return r===0?Hx(this,mo(t)):r}constructor(...t){Kl(this,$N,{writable:true,value:void 0});let[r,o,n,a,i]=em(t);this.calendar=r,this.era=o,this.year=n,this.month=a,this.day=i,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,Lo(this);}},XN=new WeakMap,ti=class e{copy(){return this.era?new e(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new e(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(t){return Xp(this,t)}subtract(t){return $x(this,t)}set(t,r){return Zx(this,t,r)}cycle(t,r,o){return Xx(this,t,r,o)}toDate(){return Kx(this)}toString(){return _x(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(t){return this.toDate().getTime()-Yp(t,this.timeZone).toDate().getTime()}constructor(...t){Kl(this,XN,{writable:true,value:void 0});let[r,o,n,a,i]=em(t),s=t.shift(),c=t.shift();this.calendar=r,this.era=o,this.year=n,this.month=a,this.day=i,this.timeZone=s,this.offset=c,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,Lo(this);}};var tm=new Map;function rm(e){let{locale:t}=Vp(),r=t+(e?Object.entries(e).sort((n,a)=>n[0]<a[0]?-1:1).join():"");if(tm.has(r))return tm.get(r);let o=new Intl.Collator(t,e);return tm.set(r,o),o}function ec(e){let t=rm({usage:"search",...e}),r=He.useCallback((a,i)=>i.length===0?true:(a=a.normalize("NFC"),i=i.normalize("NFC"),t.compare(a.slice(0,i.length),i)===0),[t]),o=He.useCallback((a,i)=>i.length===0?true:(a=a.normalize("NFC"),i=i.normalize("NFC"),t.compare(a.slice(-i.length),i)===0),[t]),n=He.useCallback((a,i)=>{if(i.length===0)return true;a=a.normalize("NFC"),i=i.normalize("NFC");let s=0,c=i.length;for(;s+c<=a.length;s++){let l=a.slice(s,s+c);if(t.compare(i,l)===0)return true}return false},[t]);return He.useMemo(()=>({startsWith:r,endsWith:o,contains:n}),[r,o,n])}var rk=({isEntering:e,isExiting:t,className:r})=>["max-w-[200px] group bg-action-default border border-action-default-hover text-[color:var(--color-action-default-text)] text-sm rounded-lg drop-shadow-lg will-change-transform px-3 py-1",e?"animate-in fade-in placement-bottom:slide-in-from-top-0.5 placement-top:slide-in-from-bottom-0.5 placement-left:slide-in-from-right-0.5 placement-right:slide-in-from-left-0.5 ease-out duration-200":"",t?"animate-out fade-out placement-bottom:slide-out-to-top-0.5 placement-top:slide-out-to-bottom-0.5 placement-left:slide-out-to-right-0.5 placement-right:slide-out-to-left-0.5 ease-in duration-150":"",r].filter(Boolean).join(" ");function nr({children:e,content:t,...r}){return jsxRuntime.jsxs(reactAriaComponents.TooltipTrigger,{delay:200,children:[e,jsxRuntime.jsxs(reactAriaComponents.Tooltip,{...r,offset:10,className:reactAriaComponents.composeRenderProps(r.className,(o,n)=>rk({...n,className:o})),children:[jsxRuntime.jsx(reactAriaComponents.OverlayArrow,{children:jsxRuntime.jsx("svg",{width:8,height:8,viewBox:"0 0 8 8",className:"fill-action-default stroke-action-default-hover group-placement-left:-rotate-90 group-placement-right:rotate-90 group-placement-bottom:rotate-180 forced-colors:fill-[Canvas] forced-colors:stroke-[ButtonBorder]",children:jsxRuntime.jsx("path",{d:"M0 0 L4 4 L8 0"})})}),t]})]})}function Or(){let[e,t]=He__namespace.default.useState(false),r=He__namespace.default.useCallback((n,a)=>{t(true),a?.(n);},[]),o=He__namespace.default.useCallback((n,a)=>{t(false),a?.(n);},[]);return {isFocused:e,handleFocus:r,handleBlur:o}}var vt=He__namespace.default.forwardRef(({children:e,className:t},r)=>jsxRuntime.jsx("div",{ref:r,className:tailwindMerge.twMerge("relative w-full",t),children:e}));vt.displayName="InputWrapper";function cs({onClick:e,size:t="md",className:r}){return jsxRuntime.jsx("button",{type:"button",onClick:o=>{o.preventDefault(),o.stopPropagation(),e();},className:tailwindMerge.twMerge("absolute right-2 top-[48%] -translate-y-1/2 transform text-text-secondary hover:text-text-primary cursor-pointer",r),"aria-label":"Clear input",onMouseDown:o=>{o.preventDefault(),o.stopPropagation();},children:jsxRuntime.jsx(U,{name:"X",size:t==="sm"?16:20})})}function an(e){let{isInvalid:t,isDisabled:r,isFocused:o}=e,n="border rounded-[var(--control-border-radius)] !outline-none ";return r?`${n} border-border-muted`:t&&o?`${n} border-feedback-error-border shadow-[inset_0_0_0_1px_var(--color-feedback-error-border)]`:t?`${n} border-feedback-error-border`:o?`${n} border-border-focus shadow-[inset_0_0_0_1px_var(--color-border-focus)]`:`${n} border-border-input`}function th(e){return e.isDisabled?"bg-background-muted":e.transparent?"bg-transparent":"bg-background-input"}function ok(e){return e==="sm"?"!text-base md:!text-[length:var(--control-text-sm)]":e==="md"?"!text-base md:!text-[length:var(--control-text-md)]":""}function Wt(e){let{isInvalid:t,isDisabled:r,isFocused:o,transparent:n,size:a="md",className:i}=e;return tailwindMerge.twMerge("w-full",an({isInvalid:t,isDisabled:r,isFocused:o}),th({transparent:n,isDisabled:r}),We[a].text,We[a].height,We[a].padding,ok(a),i)}function nk(e){let{size:t="md",isFocusWithin:r,isInvalid:o,isDisabled:n,transparent:a,className:i}=e;return tailwindMerge.twMerge("group flex items-center rounded-[var(--control-border-radius)] overflow-hidden",th({transparent:a,isDisabled:n}),We[t].height,an({isFocused:r,isInvalid:o,isDisabled:n}),i)}function ze({children:e,size:t="md",tooltip:r,description:o,descriptionPlacement:n="below",isRequired:a,className:i,htmlFor:s}){let c=r||o&&n==="tooltip",l=r||o,d=o&&n==="inline",u=jsxRuntime.jsxs("label",{htmlFor:s,className:tailwindMerge.twMerge(We[t].text,"!text-text-label font-semibold flex items-center gap-1",i),children:[e,a&&jsxRuntime.jsx("span",{children:"*"}),c&&jsxRuntime.jsx("span",{className:"inline-flex items-center text-text-secondary",children:jsxRuntime.jsx(U,{name:"Info",size:t==="sm"?16:20})}),d&&jsxRuntime.jsx("span",{className:"text-text-secondary font-normal ml-1",children:o})]});return c&&l?jsxRuntime.jsx(nr,{content:l,children:u}):u}function Pe({size:e="md",className:t,children:r,...o}){return jsxRuntime.jsx("div",{...o,className:tailwindMerge.twMerge("leading-[2.25] text-text-secondary",We[e].text,t),children:r})}function ge({children:e,size:t="md",className:r}){return jsxRuntime.jsx("div",{role:"alert",className:tailwindMerge.twMerge(We[t].text,"text-feedback-error-text",r),children:e})}function rc({size:e="md",isInvalid:t,isDisabled:r,isFocused:o,transparent:n,className:a,...i}){return jsxRuntime.jsx("input",{className:Wt({isInvalid:t,isDisabled:r,isFocused:o,transparent:n,size:e,className:a}),...i})}function rh(e){let{children:t,...r}=e;return jsxRuntime.jsx("div",{...r,className:nk(e),children:typeof t=="function"?t(e):t})}function sk({children:e,...t}){return jsxRuntime.jsx(reactAriaComponents.ListBox,{...t,className:ke(t.className,"outline-0"),children:e})}var cm=He.createContext("md");function sh(){return He.useContext(cm)}function im(e="md"){let t=e==="sm"?"!text-base md:!text-[length:var(--control-text-sm)]":e==="md"?"!text-base md:!text-[length:var(--control-text-md)]":"";return `flex-1 text-start data-[placeholder]:text-text-disabled overflow-hidden text-ellipsis whitespace-nowrap ${We[e].text} ${t}`}function mk(){let e=He__namespace.default.useCallback((r,o)=>{o?.(r);},[]),t=He__namespace.default.useCallback((r,o)=>{o?.(r);},[]);return {handleFocus:e,handleBlur:t}}function qn({label:e,description:t,errorMessage:r,children:o,items:n,renderItem:a,renderSelectedValue:i,size:s="md",selectedKey:c,defaultSelectedKey:l,onSelectionChange:d,placeholder:u,showErrors:p=false,tooltip:m,isRequired:f,transparent:g,reserveErrorSpace:b=false,placement:x="bottom start",shouldFlip:h=true,menuWidth:y="match",descriptionPlacement:v="below",useMobileTray:S=true,...w}){let[N,D]=He.useState(null),[R,A]=He.useState(null),[O,P]=He.useState(false),T=c??N??l,{handleFocus:k,handleBlur:V}=mk(),{isMobile:H}=_t(),I=S&&H,q=He__namespace.default.useMemo(()=>!i||!T||!n?null:Array.from(n).find(z=>z.id===T)??null,[i,T,n]),j=E=>{d&&E!==null&&d(E),d||D(E);},K=He.useRef(null),Y=He.useRef(null),M=()=>{I&&P(!O);};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(reactAriaComponents.Select,{...w,selectedKey:T,defaultSelectedKey:l,onSelectionChange:j,placeholder:u,className:ke(w.className,"group flex w-full flex-col"),ref:K,onOpenChange:E=>{I||(E&&Y.current?A(Y.current.offsetWidth):E||K.current?.blur());},children:({isDisabled:E,isInvalid:z,isOpen:B})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(ze,{size:s,tooltip:m,description:v==="tooltip"||v==="inline"?t:void 0,descriptionPlacement:v,isRequired:f,children:e}),jsxRuntime.jsx(vt,{children:jsxRuntime.jsx("div",{ref:Y,children:jsxRuntime.jsxs(re,{variant:"unstyled",className:tailwindMerge.twMerge(Wt({isInvalid:z||p&&!!r,isDisabled:E,isFocused:I?O:B,transparent:g,size:s}),"flex items-center text-start gap-4 cursor-pointer pl-[var(--control-padding-sm)]"),onFocus:C=>k(C,w.onFocus),onBlur:C=>V(C,w.onBlur),onPress:I?M:void 0,"data-open":I?O:B,children:[i&&q?jsxRuntime.jsx("div",{className:im(s),children:i(q)}):I&&T?jsxRuntime.jsx("div",{className:im(s),children:n?Array.from(n).find(G=>G.id===T)?.label:String(T)}):jsxRuntime.jsx(reactAriaComponents.SelectValue,{className:im(s)}),jsxRuntime.jsx(U,{name:"CaretDown","aria-hidden":true,className:tailwindMerge.twMerge("h-4 w-4 text-text-primary group-disabled:text-text-disabled forced-colors:text-[ButtonText] transition-transform",(I?O:B)&&"rotate-180")})]})})}),b?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:p?jsxRuntime.jsx(ge,{size:s,className:"text-feedback-error-text",children:typeof r=="function"&&w.validationResult?r(w.validationResult):typeof r=="string"?r:null}):t&&v==="below"?jsxRuntime.jsx(Pe,{size:s,children:t}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:p?jsxRuntime.jsx(ge,{size:s,className:"mt-1 text-feedback-error-text",children:typeof r=="function"&&w.validationResult?r(w.validationResult):typeof r=="string"?r:null}):t&&v==="below"?jsxRuntime.jsx(Pe,{size:s,className:"mt-1",children:t}):null}),I?null:jsxRuntime.jsx(lt,{className:"bg-background-input shadow-xl border border-border-input/20 backdrop-blur-sm rounded-[var(--control-border-radius)]",style:{width:y==="match"&&R?`${R}px`:void 0,minWidth:y==="auto"&&R?`${R}px`:void 0,maxWidth:y==="auto"?"min(600px, 90vw)":void 0},placement:x,shouldFlip:h,children:jsxRuntime.jsx(cm.Provider,{value:"md",children:jsxRuntime.jsx(reactAriaComponents.ListBox,{items:n,className:"w-full max-h-[300px] overflow-auto bg-background-input p-0 outline-0",children:a&&n?C=>jsxRuntime.jsx(ar,{id:C.id,textValue:C.label,children:jsxRuntime.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap min-w-0 flex-1",children:a(C)})},C.id):o})})})]})}),I&&jsxRuntime.jsx(ct,{isOpen:O,onClose:()=>P(false),title:e??"Select an option",contentPadding:false,children:jsxRuntime.jsx(cm.Provider,{value:"md",children:jsxRuntime.jsx(reactAriaComponents.ListBox,{items:n,className:"w-full bg-background-surface p-0 outline-0 [&_[role=option]]:border-b [&_[role=option]]:border-border-default [&_[role=option]:last-child]:border-0 [&_[role=option]]:!px-6 [&_[role=option]]:!py-4 [&_[role=option]]:rounded-none",selectionMode:"single",selectedKeys:T!=null?[T]:[],onSelectionChange:E=>{let z=Array.from(E)[0];z!=null&&(j(z),P(false));},children:a&&n?E=>jsxRuntime.jsx(ar,{id:E.id,textValue:E.label,children:jsxRuntime.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap min-w-0 flex-1",children:a(E)})},E.id):o})})})]})}function ar({size:e,className:t,...r}){let o=sh(),n=e??o;return jsxRuntime.jsx(reactAriaComponents.ListBoxItem,{...r,className:tailwindMerge.twMerge("flex cursor-default items-center gap-2 rounded-sm px-3 outline-none text-text-primary data-[focused]:bg-background-hover data-[focus-visible]:ring-2 data-[focus-visible]:ring-action-default data-[focus-visible]:ring-inset data-[selected]:bg-background-selected data-[selected]:font-medium overflow-hidden",We[n].paddingY,We[n].text,t)})}var Tk=[],Nk={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6",xl:"h-7 w-7"},kk={sm:"pl-8",md:"pl-10",lg:"pl-11",xl:"pl-13"},ch={sm:"py-1",md:"py-2",lg:"py-3",xl:"py-4"},um=(e,t,r)=>{if(e==null||e==="")return "";let n=(r?r.flatMap(a=>a.items):t||[]).find(a=>a.id===e);return n?n.name:""};async function Pk(e,t,r){try{let o=e.url.replace("{q}",t),n=new URLSearchParams;e.extraParams&&Object.entries(e.extraParams).forEach(([c,l])=>{n.append(c,l.toString());});let a=`${o}${n.toString()?"?"+n.toString():""}`,i=await fetch(a,{method:"GET",headers:e.headers,signal:r});if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);let s=await i.json();return {items:e.transformResponse(s)}}catch(o){if(o instanceof Error&&o.name==="AbortError")return {items:[]};console.error("Error in REST request:",o);let n=o instanceof Error?o.message:"Unknown error occurred";return {items:[],error:n}}}async function Rk(e,t,r){try{let o=e.graphqlQuery.replace(`$${e.variableKey||"filter"}`,`"${t}"`),n=await fetch(e.url,{method:"POST",headers:{"Content-Type":"application/json",...e.headers},body:JSON.stringify({query:o}),signal:r});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);let a=await n.json();if(a.errors)throw new Error(a.errors[0]?.message||"GraphQL error occurred");return e.responsePath&&(a=e.responsePath.split(".").reduce((i,s)=>i?.[s],a)),{items:e.transformResponse(a)}}catch(o){if(o instanceof Error&&o.name==="AbortError")return {items:[]};console.error("Error in GraphQL request:",o);let n=o instanceof Error?o.message:"Unknown error occurred";return {items:[],error:n}}}function ac({label:e,staticItems:t=Tk,sections:r,selectedKey:o,defaultSelectedKey:n,onSelectionChange:a,requestConfig:i,defaultFilter:s,placeholder:c,errorMessage:l,description:d,size:u="md",tooltip:p,isRequired:m,isDisabled:f,isInvalid:g,validationResult:b,showErrors:x=true,renderItem:h,renderLeftIcon:y,renderSection:v,autoFocus:S=false,reserveErrorSpace:w=false,hideChevron:N=false,useMobileTray:D=true,className:R}){let A=He__namespace.default.useRef(null),O=He__namespace.default.useRef(null),[P,T]=He__namespace.default.useState(),[k,V]=He.useState(()=>um(o||n,t,r)),[H,I]=He.useState(false),[q,j]=He.useState(false),K=Zo(k),{contains:Y}=ec({sensitivity:"base"}),[M,E]=He.useState(),{isMobile:z}=_t(),B=D&&z,C=We[u].text,W=reactStately.useAsyncList({async load({signal:ne,filterText:ae=""}){if(!i)return {items:[]};if(!i.url||i.shouldLoad&&!i.shouldLoad(ae))return {items:[]};try{let ce;return i.requestType==="GraphQL"?ce=await Rk(i,ae,ne):ce=await Pk(i,ae,ne),E(ce.error),{items:ce.items}}catch(ce){return ce instanceof Error&&ce.name==="AbortError"?{items:[]}:(console.error("Error loading items:",ce),E(ce instanceof Error?ce.message:"Unknown error occurred"),{items:[]})}},initialFilterText:""}),G=i&&K!==""?W:null,F=false,Z=He.useRef("");He.useEffect(()=>{S&&I(true);},[S]),He.useEffect(()=>{let ne=um(o,t,r);ne!==k&&V(ne);},[o,t,r]),He.useEffect(()=>{let ne=()=>{A.current&&T(A.current.offsetWidth);};return ne(),window.addEventListener("resize",ne),()=>window.removeEventListener("resize",ne)},[]),He.useEffect(()=>{K===""?Z.current="":G&&K!==Z.current&&(Z.current=K,G.setFilterText(K));},[K,G]),F=Pl(!!G?.isLoading,300);let _=He__namespace.default.useMemo(()=>{if(!B||!k)return G?G.items:t;let ne=G?G.items:t,ae=s??(i?()=>true:Y);return ne.filter(ce=>ae(ce.name,k))},[B,k,G,t,s,Y]),L=ne=>{let ae=um(ne,t,r);V(ae),a&&a(ne);},oe=ne=>{V(ne);},ie=()=>{B&&j(true);};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(reactAriaComponents.ComboBox,{onSelectionChange:L,selectedKey:o||void 0,defaultSelectedKey:n||void 0,items:G?G.items:r?r.flatMap(ne=>ne.items):t,className:ke(R,"group flex flex-col w-full"),menuTrigger:B?"manual":i?"input":"focus",allowsEmptyCollection:!!i,isDisabled:f,isInvalid:g||!!l,inputValue:k,onInputChange:oe,autoFocus:S&&!B,defaultFilter:s??(i?()=>true:Y),"aria-label":e||c||"Autocomplete",children:ne=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(ze,{size:u,tooltip:p,isRequired:m,children:e}),jsxRuntime.jsxs(vt,{ref:A,children:[y?jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-3 top-[45%] -translate-y-1/2 z-10",children:y(F)}):jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 z-10 flex items-center",children:F?jsxRuntime.jsx(Eo,{size:16,color:"text-text-secondary"}):jsxRuntime.jsx(U,{name:"MagnifyingGlass",className:`${Nk[u]} text-text-secondary`})}),jsxRuntime.jsx(reactAriaComponents.Input,{className:Wt({isInvalid:g||!!l,isDisabled:f,isFocused:H||(B?q:ne.isOpen),size:u,className:tailwindMerge.twMerge(kk[u],k&&!f||!N&&!k?"pr-10":"pr-3",B&&"cursor-pointer",R)}),placeholder:c,disabled:f,onFocus:ae=>{I(true),B&&(ae.currentTarget.blur(),ie());},onBlur:()=>{I(false);},onClick:B?ie:void 0,readOnly:B,"aria-label":e||c||"Autocomplete"}),k&&!f&&jsxRuntime.jsx(cs,{onClick:()=>{V(""),a?.(null);},size:u}),!N&&!k&&jsxRuntime.jsx(reactAriaComponents.Button,{className:"absolute right-3 top-[46%] -translate-y-1/2 transform text-text-secondary hover:text-text-primary","aria-label":"Toggle menu",isDisabled:f,children:({isPressed:ae})=>jsxRuntime.jsx(U,{name:ae?"CaretUp":"CaretDown",className:"h-4 w-4"})})]}),w?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:x&&M?jsxRuntime.jsx(ge,{size:u,className:"text-feedback-error-text",children:M}):x&&typeof l=="string"?jsxRuntime.jsx(ge,{size:u,className:"text-feedback-error-text",children:l}):x&&typeof l=="function"&&b?jsxRuntime.jsx(ge,{size:u,className:"text-feedback-error-text",children:l(b)}):d?jsxRuntime.jsx(Pe,{size:u,children:d}):null}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[d&&jsxRuntime.jsx(Pe,{size:u,className:"mt-1",children:d}),x&&M&&jsxRuntime.jsx(ge,{size:u,className:"text-feedback-error-text mt-1",children:M}),x&&typeof l=="string"&&jsxRuntime.jsx(ge,{size:u,className:"text-feedback-error-text mt-1",children:l}),x&&typeof l=="function"&&b&&jsxRuntime.jsx(ge,{size:u,className:"text-feedback-error-text mt-1",children:l(b)})]}),!B&&jsxRuntime.jsx(lt,{className:"bg-background-input shadow-xl border border-border-input/20 backdrop-blur-sm ring-1 ring-black/5 rounded-[var(--control-border-radius)]",style:{minWidth:P?`${P}px`:void 0,zIndex:9999},children:jsxRuntime.jsx(reactAriaComponents.ListBox,{"aria-label":e||c||"Suggestions",className:`max-h-[300px] overflow-auto bg-background-input outline-none ${C}`,children:r?r.map(ae=>{let ce=ae.items.map(Ce=>jsxRuntime.jsx(ar,{id:Ce.id,textValue:Ce.name,size:u,className:`flex cursor-default items-center gap-2 px-3 ${ch[u]} text-text-primary outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium data-[focus-visible]:ring-0`,children:h?h(Ce):Ce.name},Ce.id));if(v){let Ce=v(ae,ce);return He__namespace.default.isValidElement(Ce)&&Ce.type===reactAriaComponents.ListBoxSection?Ce:jsxRuntime.jsx(reactAriaComponents.ListBoxSection,{children:Ce},ae.name)}return jsxRuntime.jsxs(reactAriaComponents.ListBoxSection,{children:[jsxRuntime.jsx(reactAriaComponents.Header,{className:"px-3 py-1 text-sm font-bold text-text-secondary",children:ae.name}),ce]},ae.name)}):ae=>jsxRuntime.jsx(ar,{id:ae.id,textValue:ae.name,size:u,className:`flex cursor-default items-center gap-2 px-3 ${ch[u]} text-text-primary outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium data-[focus-visible]:ring-0`,children:h?h(ae):ae.name},ae.id)})})]})}),B&&jsxRuntime.jsx(ct,{isOpen:q,onClose:()=>j(false),title:e??c??"Search",contentPadding:false,height:"80vh",children:jsxRuntime.jsxs("div",{className:"flex flex-col h-full",children:[jsxRuntime.jsx("div",{className:"p-4 border-b border-border-default",children:jsxRuntime.jsxs(vt,{children:[jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-3 top-[45%] -translate-y-1/2 z-10 flex items-center",children:F?jsxRuntime.jsx(Eo,{size:16,color:"text-text-secondary"}):jsxRuntime.jsx(U,{name:"MagnifyingGlass",className:"h-4 w-4 text-text-secondary"})}),jsxRuntime.jsx("input",{ref:O,type:"text",value:k,onChange:ne=>oe(ne.target.value),placeholder:c,autoFocus:true,className:Wt({isInvalid:false,isDisabled:false,isFocused:true,size:"md",className:"pl-10 pr-10"})}),k&&jsxRuntime.jsx(cs,{onClick:()=>{V(""),a?.(null);},size:"md"})]})}),jsxRuntime.jsx("div",{className:"flex-1 overflow-auto",children:jsxRuntime.jsx(reactAriaComponents.ListBox,{"aria-label":e||c||"Suggestions",items:_,selectedKeys:o?[o]:[],selectionMode:"single",onSelectionChange:ne=>{let ae=Array.from(ne)[0];ae&&(L(ae),j(false));},className:"bg-background-input outline-none",children:ne=>jsxRuntime.jsx(ar,{id:ne.id,textValue:ne.name,size:"md",className:"flex cursor-default items-center gap-2 px-4 py-3 text-text-primary outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium data-[focus-visible]:ring-0",children:h?h(ne):ne.name},ne.id)})})]})})]})}function Io({src:e,alt:t,firstName:r,lastName:o,fullName:n,onClick:a,size:i="md",shape:s="circle",variant:c="user",className:l,status:d,bordered:u=false,piiEntity:p}){let[m,f]=He.useState(false),g=He.useCallback(()=>f(true),[]);He.useEffect(()=>{f(false);},[e]);let b={xs:"h-6 w-6 text-xs",sm:"h-8 w-8 text-sm",md:"h-10 w-10 text-base",lg:"h-12 w-12 text-lg",xl:"h-16 w-16 text-xl"},x={xs:"h-1.5 w-1.5",sm:"h-2 w-2",md:"h-2.5 w-2.5",lg:"h-3 w-3",xl:"h-4 w-4"},h={xs:"bottom-0 right-0",sm:"bottom-0 right-0",md:"bottom-0 right-0",lg:"bottom-0.5 right-0.5",xl:"bottom-1 right-1"},y={online:"bg-feedback-success-background border-feedback-success-border",offline:"bg-text-secondary border-border-muted",away:"bg-feedback-warning-background border-feedback-warning-border",busy:"bg-feedback-error-background border-feedback-error-border"},v={user:"bg-feedback-info-background text-feedback-info-text",team:"bg-feedback-info-background text-feedback-info-text",organization:"bg-feedback-success-background text-feedback-success-text"},S=s==="circle"?"rounded-full":"rounded-md",w=tailwindMerge.twMerge("relative inline-flex items-center justify-center overflow-hidden transition-opacity outline-none",b[i],S,a&&"cursor-pointer hover:opacity-80",u&&"ring-2 ring-background-surface",l),D=(()=>{if(r||o){let P=r?.[0]||"",T=o?.[0]||"";return (P+T).toUpperCase()}if(n){let P=n.split(" "),T=P[0]?.[0]||"",k=P[P.length-1]?.[0]||"";return T===k?T.toUpperCase():(T+k).toUpperCase()}return ""})(),R=()=>{let P={xs:14,sm:16,md:20,lg:24,xl:32}[i];switch(c){case "team":return jsxRuntime.jsx(lucideReact.Users,{size:P});case "organization":return jsxRuntime.jsx(lucideReact.Building2,{size:P});default:return jsxRuntime.jsx(lucideReact.User,{size:P})}},A=P=>{if(p)return c==="organization"?P?"organization-logo":"initials":P?"avatar":"initials"},O=()=>e&&!m?jsxRuntime.jsx("img",{src:e,alt:t||n||"Avatar",className:"h-full w-full object-cover",onError:g,"data-pii-type":A(true),"data-pii-entity":p}):D?jsxRuntime.jsx("span",{className:"font-semibold","data-pii-type":A(false),"data-pii-entity":p,children:D}):R();return jsxRuntime.jsxs("div",{className:"relative inline-block",children:[jsxRuntime.jsx("div",{"data-avatar":true,className:tailwindMerge.twMerge(w,!e||m?v[c]:""),onClick:a,role:a?"button":void 0,tabIndex:a?0:void 0,children:O()}),d&&jsxRuntime.jsx("span",{className:tailwindMerge.twMerge("absolute border-2 border-background-surface",S,x[i],h[i],y[d]),"aria-label":`Status: ${d}`})]})}var Bk={default:"bg-feedback-info-background text-feedback-info-text",success:"bg-feedback-success-background text-feedback-success-text",error:"bg-feedback-error-background text-feedback-error-text",warning:"bg-feedback-warning-background text-feedback-warning-text",info:"bg-feedback-info-background text-feedback-info-text",primary:"bg-action-primary/10 text-action-primary border border-action-primary/20",brand:"bg-action-primary/10 text-action-primary border border-action-primary/20",secondary:"bg-action-secondary text-[color:var(--color-action-secondary-text)] border border-border-muted",neutral:"bg-background-muted text-text-secondary",charging:"bg-state-charging text-state-charging-text",discharging:"bg-state-discharging text-state-discharging-text",heat:"bg-state-heat text-state-heat-text",cool:"bg-state-cool text-state-cool-text",eco:"bg-state-eco text-state-eco-text",auto:"bg-state-auto text-state-auto-text",on:"bg-state-on text-state-on-text",off:"bg-state-off text-state-off-text",idle:"bg-state-idle text-state-idle-text",unknown:"bg-state-unknown text-state-unknown-text",connected:"bg-feedback-success-background text-feedback-success-text",disconnected:"bg-feedback-error-background text-feedback-error-text",importing:"bg-state-importing text-state-importing-text",exporting:"bg-state-exporting text-state-exporting-text"},Vk={xs:"px-1.5 py-0.5 text-xs",sm:"px-2.5 py-1.5 text-xs",md:"px-3.5 py-2 text-sm",lg:"px-4 py-2.5 text-base"},Ok={pill:"rounded-full",rounded:"rounded-lg",square:"rounded-sm"},zk={xs:"w-1 h-1",sm:"w-1.5 h-1.5",md:"w-2 h-2",lg:"w-2.5 h-2.5"};function at({children:e,variant:t="default",size:r="sm",shape:o="square",dot:n=false,dotPosition:a="left",dotPulse:i=false,className:s}){let c=n&&jsxRuntime.jsx("span",{className:tailwindMerge.twMerge("rounded-full bg-current opacity-75",zk[r],i&&"animate-pulse"),"aria-hidden":"true"});return jsxRuntime.jsxs("span",{className:tailwindMerge.twMerge("inline-flex items-center gap-1.5 font-medium",Vk[r],Ok[o],Bk[t],s),children:[n&&a==="left"&&c,e,n&&a==="right"&&c]})}var tt=({href:e,children:t,className:r="",external:o=false,title:n,variant:a="secondary",onClick:i,asButton:s=false,onPress:c,showArrow:l=false,alwaysUnderlined:d=false,LinkComponent:u,"data-pii-type":p,"data-pii-entity":m})=>{let f={...p&&{"data-pii-type":p},...m&&{"data-pii-entity":m}},g=o?{target:"_blank",rel:"noopener noreferrer"}:{},v=`${`${d?"underline decoration-1 underline-offset-4 decoration-current":"hover:underline hover:decoration-1 hover:underline-offset-4 hover:decoration-current"} cursor-pointer`} ${{primary:"text-action-primary hover:text-action-primary-hover visited:text-action-primary",secondary:"text-text-link-default hover:text-text-link-hover visited:text-text-link-default",muted:"text-text-secondary hover:text-text-secondary visited:text-text-secondary",unstyled:""}[a==="brand"?"primary":a==="default"?"secondary":a]} ${r}`,S=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[t,l&&jsxRuntime.jsxs("span",{children:["\xA0","\u2192"]})]});return s?jsxRuntime.jsx("button",{type:"button",className:v,onClick:c,title:n,...f,children:S}):u&&e?jsxRuntime.jsx(u,{href:e,className:v,title:n,onClick:i,...g,...f,children:S}):jsxRuntime.jsx("a",{href:e||"#",className:v,...g,...f,title:n,onClick:i,children:S})};var $k={info:{subtle:{container:"bg-feedback-info-background border-l-4 border-l-feedback-info-border",iconColor:"text-feedback-info-border",titleColor:"text-text-primary",bodyColor:"text-text-primary"},bold:{container:"bg-feedback-info-border border-feedback-info-border",iconColor:"text-text-inverse",titleColor:"text-text-inverse",bodyColor:"text-text-inverse/90"},icon:lucideReact.Info},success:{subtle:{container:"bg-feedback-success-background border-l-4 border-l-feedback-success-border",iconColor:"text-feedback-success-border",titleColor:"text-text-primary",bodyColor:"text-text-primary"},bold:{container:"bg-feedback-success-border border-feedback-success-border",iconColor:"text-text-inverse",titleColor:"text-text-inverse",bodyColor:"text-text-inverse/90"},icon:lucideReact.CheckCircle},warning:{subtle:{container:"bg-feedback-warning-background border-l-4 border-l-feedback-warning-border",iconColor:"text-feedback-warning-border",titleColor:"text-text-primary",bodyColor:"text-text-primary"},bold:{container:"bg-feedback-warning-border border-feedback-warning-border",iconColor:"text-text-inverse",titleColor:"text-text-inverse",bodyColor:"text-text-inverse/90"},icon:lucideReact.AlertCircle},error:{subtle:{container:"bg-feedback-error-background border-l-4 border-l-feedback-error-border",iconColor:"text-feedback-error-border",titleColor:"text-text-primary",bodyColor:"text-text-primary"},bold:{container:"bg-feedback-error-border border-feedback-error-border",iconColor:"text-text-inverse",titleColor:"text-text-inverse",bodyColor:"text-text-inverse/90"},icon:lucideReact.XCircle},discovery:{subtle:{container:"bg-background-muted border-l-4 border-l-action-brand",iconColor:"text-action-brand",titleColor:"text-text-primary",bodyColor:"text-text-primary"},bold:{container:"bg-action-brand border-action-brand",iconColor:"text-text-inverse",titleColor:"text-text-inverse",bodyColor:"text-text-inverse/90"},icon:lucideReact.Lightbulb}};function sc({variant:e="info",appearance:t="subtle",title:r,children:o,dismissible:n=false,onDismiss:a,primaryAction:i,secondaryAction:s,icon:c,hideIcon:l=false,className:d,testId:u}){let p=$k[e],m=p[t],f=p.icon,g=!!(i||s),b=!!(r||o);return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex gap-3 rounded-sm border p-4",m.container,d),role:"region","aria-live":"polite","data-testid":u,children:[!l&&jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-shrink-0",m.iconColor),"aria-hidden":"true",children:c||jsxRuntime.jsx(f,{className:"h-5 w-5"})}),jsxRuntime.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-3",children:[b&&jsxRuntime.jsxs("div",{className:"flex-1",children:[r&&jsxRuntime.jsx("div",{className:rr(bt("headingSm"),m.titleColor),children:r}),o&&jsxRuntime.jsx("div",{className:rr(bt("bodySm"),r?"mt-1":"",m.bodyColor),children:o})]}),g&&jsxRuntime.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[i&&(i.asLink?jsxRuntime.jsx(tt,{asButton:true,onPress:i.onPress,variant:t==="bold"?"unstyled":"default",className:t==="bold"?"text-text-inverse hover:text-text-inverse/80":"",children:i.label}):jsxRuntime.jsx(re,{size:"sm",variant:"primary",onPress:i.onPress,className:t==="bold"?"bg-background-surface text-text-primary hover:bg-background-surface/90":"",children:i.label})),s&&(s.asLink?jsxRuntime.jsx(tt,{asButton:true,onPress:s.onPress,variant:t==="bold"?"unstyled":"default",className:t==="bold"?"text-text-inverse hover:text-text-inverse/80":"",children:s.label}):jsxRuntime.jsx(re,{size:"sm",variant:"secondary",onPress:s.onPress,className:t==="bold"?"border-text-inverse/30 text-text-inverse hover:bg-text-inverse/10":"",children:s.label}))]})]}),n&&jsxRuntime.jsx("button",{type:"button",onClick:a,className:tailwindMerge.twMerge("flex h-8 w-8 flex-shrink-0 items-center justify-center self-start rounded-md transition-colors hover:bg-background-modal/10",m.iconColor,$e()),"aria-label":"Dismiss banner",children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]})}function mh({isOpen:e=true,position:t="sticky",className:r,...o}){let n=t==="fixed"?"fixed top-0 left-0 right-0 z-50":"sticky top-0 z-50",a=r?`${r} !rounded-none`:"!rounded-none";return jsxRuntime.jsx(framerMotion.AnimatePresence,{children:e&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:"easeInOut"},className:n,children:jsxRuntime.jsx(sc,{...o,className:a})})})}function sn({value:e,children:t,className:r,size:o="sm",iconPosition:n="right"}){let[a,i]=He.useState(false),l=jsxRuntime.jsx(re,{variant:"icon",size:o,onPress:()=>{let u=e||(typeof t=="string"?t:"");navigator.clipboard.writeText(u),i(true),setTimeout(()=>{i(false);},2e3);},className:"!px-2 relative",style:{top:"0.5px"},children:jsxRuntime.jsx(U,{name:"Copy",size:o==="sm"?14:16})}),d=a?jsxRuntime.jsx(nr,{content:"Copied!",children:l}):l;return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("inline-flex items-center gap-0.5",r),children:[n==="left"&&d,t,n==="right"&&d]})}function lc(e){let{children:t,maxWidth:r=600,className:o,...n}=e,{ref:a,width:i}=Ua(),[s,c]=He__namespace.default.useState(false),[l,d]=He__namespace.default.useState(false),u=He__namespace.default.useRef(false),p=He__namespace.default.useMemo(()=>t&&!e.items&&typeof t!="function"?He__namespace.default.Children.toArray(t):null,[t,e.items]);if(He__namespace.default.useEffect(()=>{p&&p.length>=4&&i>0&&!u.current?(u.current=true,c(i>r),d(true)):(!p||p&&p.length<4)&&d(true);let m=setTimeout(()=>{l||d(true);},100);return ()=>clearTimeout(m)},[i,r,p,l]),p&&s&&p.length>=4){let m=p[0],f=p.slice(1,-2),g=p.slice(-2),b=f.map(x=>{if(He__namespace.default.isValidElement(x)){let h=x.props;if(typeof h.children=="string")return {label:h.children,href:h.href}}return {label:"..."}});return jsxRuntime.jsxs(reactAriaComponents.Breadcrumbs,{...n,ref:a,className:tailwindMerge.twMerge("flex gap-2",l?"opacity-100":"opacity-0",o),children:[m,jsxRuntime.jsx(tP,{items:b}),g]})}return jsxRuntime.jsx(reactAriaComponents.Breadcrumbs,{...n,ref:a,className:tailwindMerge.twMerge("flex gap-2",l?"opacity-100":"opacity-0",o),children:t})}function tP({items:e}){let t=e.map((r,o)=>({id:`breadcrumb-${o}`,name:r.label,href:r.href}));return jsxRuntime.jsx(reactAriaComponents.Breadcrumb,{className:"flex items-center gap-2",children:jsxRuntime.jsxs("span",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Qa,{items:t,align:"left",size:"sm",children:jsxRuntime.jsx(re,{variant:"icon",size:"sm",icon:"DotsThree","aria-label":"Show hidden breadcrumbs",className:"px-0.5"})}),jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-4 w-4 text-text-secondary"})]})})}function cc(e){let{className:t,children:r,href:o,copyable:n,copyValue:a,...i}=e;return jsxRuntime.jsx(reactAriaComponents.Breadcrumb,{className:ke(t,"flex items-center gap-2"),...i,children:s=>{let c=s.isCurrent,l=typeof r=="function"?r(s):r;return jsxRuntime.jsx(jsxRuntime.Fragment,{children:c?n?jsxRuntime.jsx(sn,{value:a||(typeof l=="string"?l:void 0),size:"sm",iconPosition:"right",children:jsxRuntime.jsx("span",{className:"max-w-[200px] truncate font-semibold text-text-primary sm:max-w-none",children:l})}):jsxRuntime.jsx("span",{className:"max-w-[200px] truncate font-semibold text-text-primary sm:max-w-none",children:l}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(tt,{variant:"muted",href:o,className:"max-w-[150px] truncate sm:max-w-[300px] md:max-w-none",children:l}),jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-4 w-4 shrink-0 text-text-secondary"})]})})}})}function uP({isSelected:e,isDisabled:t}){let r=[$e,"w-9 h-9 text-sm cursor-default rounded-sm flex items-center justify-center forced-color-adjust-none font-semibold"];return t?r.push("text-text-disabled forced-colors:text-[GrayText]"):e?r.push("bg-action-default text-text-inverse invalid:bg-feedback-error-border forced-colors:bg-[Highlight] forced-colors:invalid:bg-[Mark] forced-colors:text-[HighlightText]"):r.push("text-text-primary hover:bg-background-hover pressed:bg-background-selected"),r.join(" ")}function ri({errorMessage:e,...t}){return jsxRuntime.jsxs(reactAriaComponents.Calendar,{...t,children:[jsxRuntime.jsx(dc,{}),jsxRuntime.jsxs(reactAriaComponents.CalendarGrid,{className:"border-separate [border-spacing:0] [&_td]:p-0 [&_td]:!border-0",children:[jsxRuntime.jsx(uc,{}),jsxRuntime.jsx(reactAriaComponents.CalendarGridBody,{children:r=>jsxRuntime.jsx(reactAriaComponents.CalendarCell,{date:r,className:({isSelected:o,isDisabled:n})=>`${uP({isSelected:o,isDisabled:n})} border-0`})})]}),e&&jsxRuntime.jsx(reactAriaComponents.Text,{slot:"errorMessage",className:"text-sm text-feedback-error-text",children:e})]})}function dc(){let{direction:e}=reactAriaComponents.useLocale(),t=18;return jsxRuntime.jsxs("header",{className:"flex w-full items-center gap-1 px-1 pb-4",children:[jsxRuntime.jsx(re,{variant:"icon",slot:"previous",className:"pl-0",children:e==="rtl"?jsxRuntime.jsx(U,{name:"CaretRight","aria-hidden":true,size:t}):jsxRuntime.jsx(U,{name:"CaretLeft","aria-hidden":true,size:t})}),jsxRuntime.jsx(reactAriaComponents.Heading,{className:"text-md mx-2 flex-1 text-center font-semibold text-text-primary"}),jsxRuntime.jsx(re,{variant:"icon",slot:"next",className:"pr-0",children:e==="rtl"?jsxRuntime.jsx(U,{name:"CaretLeft","aria-hidden":true,size:t}):jsxRuntime.jsx(U,{name:"CaretRight","aria-hidden":true,size:t})})]})}function uc(){return jsxRuntime.jsx(reactAriaComponents.CalendarGridHeader,{children:e=>jsxRuntime.jsx(reactAriaComponents.CalendarHeaderCell,{className:"text-xs font-semibold text-text-secondary",children:e})})}var yh=He__namespace.createContext(null);function ln(){let e=He__namespace.useContext(yh);if(!e)throw new Error("Carousel components must be used within a CarouselRoot");return e}function vh({page:e,defaultPage:t=0,onPageChange:r,orientation:o="horizontal",loop:n=false,autoplay:a=false,autoplayDelay:i=4e3,allowMouseDrag:s=false,spacing:c="1rem",slidesPerView:l=1,slidesPerMove:d=1,className:u,children:p,...m}){let f=e!==void 0,[g,b]=He__namespace.useState(t),x=f?e:g,h=He__namespace.useRef(null),[y,v]=He__namespace.useState(0),[S,w]=He__namespace.useState(typeof a=="boolean"?a:!!a),[N,D]=He__namespace.useState(false),R=He__namespace.useRef(null),A=He__namespace.useRef(null),O=typeof a=="object"&&a!==null&&a.delay?a.delay:i;He__namespace.useEffect(()=>{if(h.current){let C=Math.max(1,Math.floor(Number(l)||1)),W=h.current.children;if(W.length===0){v(0);return}let G=Math.ceil(W.length/C);v(G);}},[p,l]);let P=He__namespace.useRef(-1);He__namespace.useEffect(()=>{if(x!==P.current&&h.current){let C=Array.from(h.current.children);if(C.length===0)return;let W=x*l,G=Math.min(W,C.length-1),F=C[G];F&&typeof F.scrollIntoView=="function"&&(F.scrollIntoView({behavior:"smooth",block:o==="vertical"?"start":"nearest",inline:o==="horizontal"?"start":"nearest"}),P.current=x);}},[x,l,o]);let T=He__namespace.useCallback(C=>{let W=C;n?W<0?W=y-1:W>=y&&(W=0):W=Math.max(0,Math.min(C,y-1)),f||b(W),r?.(W);},[f,n,r,y]),k=He__namespace.useCallback(()=>{T(x+d);},[x,T,d]),V=He__namespace.useCallback(()=>{T(x-d);},[x,T,d]),H=He__namespace.useRef(k);He__namespace.useEffect(()=>{H.current=k;},[k]);let I=y>0&&(n||x<y-1),q=y>0&&(n||x>0),j=He__namespace.useCallback(()=>{w(C=>!C);},[]);He__namespace.useEffect(()=>{if(S&&y>1)return R.current=setInterval(()=>{H.current();},O),()=>{R.current&&(clearInterval(R.current),R.current=null);}},[S,y,O]);let K=He__namespace.useCallback(()=>{R.current&&(clearInterval(R.current),R.current=null);},[]),Y=He__namespace.useCallback(()=>{S&&y>1&&(R.current=setInterval(()=>{H.current();},O));},[S,y,O]),M=He__namespace.useCallback(C=>{if(!s)return;D(true);let W="touches"in C&&C.touches&&C.touches.length>0?C.touches[0].clientX:"clientX"in C?C.clientX:0,G="touches"in C&&C.touches&&C.touches.length>0?C.touches[0].clientY:"clientY"in C?C.clientY:0;A.current={x:W,y:G};},[s]),E=He__namespace.useCallback(C=>{if(!N||!A.current)return;let W="touches"in C&&C.touches&&C.touches.length>0?C.touches[0].clientX:"clientX"in C?C.clientX:0,G="touches"in C&&C.touches&&C.touches.length>0?C.touches[0].clientY:"clientY"in C?C.clientY:0,F=W-A.current.x,Z=G-A.current.y,_=50;o==="horizontal"&&Math.abs(F)>_?(F>0?V():k(),D(false),A.current=null):o==="vertical"&&Math.abs(Z)>_&&(Z>0?V():k(),D(false),A.current=null);},[N,o,k,V]),z=He__namespace.useCallback(()=>{D(false),A.current=null;},[]),B={currentPage:x,totalPages:y,orientation:o,loop:n,spacing:c,slidesPerView:l,goToPage:T,goToNext:k,goToPrev:V,canGoNext:I,canGoPrev:q,isAutoplayActive:S,toggleAutoplay:j,itemsRef:h,isDragging:N,allowMouseDrag:s,handleDragStart:M,handleDragMove:E,handleDragEnd:z};return jsxRuntime.jsx(yh.Provider,{value:B,children:jsxRuntime.jsx("div",{...m,className:tailwindMerge.twMerge("relative w-full",o==="vertical"?"h-full":"",u),onMouseEnter:K,onMouseLeave:Y,children:p})})}function Ch({className:e,children:t,...r}){let{itemsRef:o,orientation:n,spacing:a,isDragging:i,allowMouseDrag:s,handleDragStart:c,handleDragMove:l,handleDragEnd:d}=ln();return jsxRuntime.jsx("div",{ref:o,...r,className:tailwindMerge.twMerge("flex overflow-x-auto overflow-y-hidden snap-x snap-mandatory scrollbar-hide scroll-smooth",n==="vertical"&&"flex-col overflow-y-auto overflow-x-hidden snap-y",s&&i&&"cursor-grabbing select-none",s&&!i&&"cursor-grab",e),style:{gap:a,"--carousel-spacing":a,...r.style},onMouseDown:c,onMouseMove:l,onMouseUp:d,onMouseLeave:d,onTouchStart:c,onTouchMove:l,onTouchEnd:d,children:t})}function Sh({index:e,className:t,children:r,...o}){let{orientation:n,slidesPerView:a}=ln();return jsxRuntime.jsx("div",{...o,"data-index":e,className:tailwindMerge.twMerge("shrink-0 snap-start",n==="horizontal"?"h-full":"w-full",t),style:{width:n==="horizontal"?`calc((100% - (${a-1} * var(--carousel-spacing, 1rem))) / ${a})`:void 0,height:n==="vertical"?`calc((100% - (${a-1} * var(--carousel-spacing, 1rem))) / ${a})`:void 0,...o.style},children:r})}function wh({className:e,children:t,...r}){return jsxRuntime.jsx("div",{...r,className:tailwindMerge.twMerge("flex items-center justify-center gap-4 mt-4",e),children:t})}function Th({className:e,children:t,...r}){let{goToPrev:o,canGoPrev:n}=ln();return jsxRuntime.jsx("button",{type:"button",...r,onClick:a=>{o(),r.onClick?.(a);},disabled:!n||r.disabled,"aria-label":"Previous slide",className:tailwindMerge.twMerge("inline-flex items-center justify-center rounded-md","h-10 w-10","bg-background-input border border-border-input","text-text-primary hover:bg-background-muted","transition-colors duration-200","disabled:opacity-40 disabled:cursor-not-allowed","focus-visible:outline focus-visible:outline-2 focus-visible:outline-action-default",e),children:t||jsxRuntime.jsx(U,{name:"CaretLeft",size:"sm"})})}function Nh({className:e,children:t,...r}){let{goToNext:o,canGoNext:n}=ln();return jsxRuntime.jsx("button",{type:"button",...r,onClick:a=>{o(),r.onClick?.(a);},disabled:!n||r.disabled,"aria-label":"Next slide",className:tailwindMerge.twMerge("inline-flex items-center justify-center rounded-md","h-10 w-10","bg-background-input border border-border-input","text-text-primary hover:bg-background-muted","transition-colors duration-200","disabled:opacity-40 disabled:cursor-not-allowed","focus-visible:outline focus-visible:outline-2 focus-visible:outline-action-default",e),children:t||jsxRuntime.jsx(U,{name:"CaretRight",size:"sm"})})}function ym({index:e,className:t,children:r,...o}){let{currentPage:n,goToPage:a}=ln(),i=n===e;return jsxRuntime.jsx("button",{type:"button",...o,onClick:s=>{a(e),o.onClick?.(s);},"aria-label":`Go to slide ${e+1}`,"aria-current":i,className:tailwindMerge.twMerge("h-2 rounded-full transition-all duration-200",i?"w-6 bg-action-brand":"w-2 bg-border-muted hover:bg-border-input","focus-visible:outline focus-visible:outline-2 focus-visible:outline-action-default",t),children:r})}function kh({className:e,...t}){let{totalPages:r}=ln();return jsxRuntime.jsx("div",{...t,className:tailwindMerge.twMerge("flex items-center gap-2",e),role:"group","aria-label":"Carousel indicators",children:Array.from({length:r},(o,n)=>jsxRuntime.jsx(ym,{index:n},n))})}function Ph({className:e,children:t,...r}){let{isAutoplayActive:o,toggleAutoplay:n}=ln();return jsxRuntime.jsx("button",{type:"button",...r,onClick:a=>{n(),r.onClick?.(a);},"aria-label":o?"Pause autoplay":"Start autoplay",className:tailwindMerge.twMerge("inline-flex items-center justify-center rounded-md","h-10 w-10","bg-background-input border border-border-input","text-text-primary hover:bg-background-muted","transition-colors duration-200","focus-visible:outline focus-visible:outline-2 focus-visible:outline-action-default",e),children:t||jsxRuntime.jsx(U,{name:o?"Pause":"Play",size:"sm"})})}function Rh({className:e,...t}){let{currentPage:r,totalPages:o}=ln();return jsxRuntime.jsxs("div",{...t,className:tailwindMerge.twMerge("text-sm text-text-secondary tabular-nums",e),"aria-live":"polite","aria-atomic":"true",children:[r+1," / ",o]})}var hP="focus:ring-action-primary",yP="bg-action-primary border-action-primary text-[color:var(--color-action-primary-text)] hover:bg-action-primary-hover hover:border-action-primary-hover";function vm(e){return jsxRuntime.jsxs(reactAriaComponents.CheckboxGroup,{...e,className:ke(e.className,"flex flex-col gap-2"),children:[jsxRuntime.jsx(ze,{children:e.label}),e.children,e.description&&jsxRuntime.jsx(Pe,{children:e.description}),jsxRuntime.jsx(ge,{children:typeof e.errorMessage=="function"?void 0:e.errorMessage})]})}function vP({isDisabled:e}){return `flex gap-2 items-center group text-sm transition ${e?"text-text-disabled":"text-text-secondary"}`}function CP({isSelected:e,isInvalid:t,isDisabled:r,isIndeterminate:o}){let n="w-5 h-5 flex-shrink-0 rounded-[var(--control-border-radius)] flex items-center justify-center border-2 transition ring-offset-2 focus:ring-2",a=hP,i="";return r?i="border-border-muted bg-background-muted":t?i="border-feedback-error-border bg-feedback-error-background":e||o?i=yP:i="bg-background-input border-border-input hover:border-border-focus",`${n} ${a} ${i}`}var Mh="w-4 h-4 text-current group-disabled:text-text-disabled";function Zn(e){let{children:t,variant:r,...o}=e;return jsxRuntime.jsx(reactAriaComponents.Checkbox,{...o,className:reactAriaComponents.composeRenderProps(e.className,(n,a)=>`${vP(a)} ${n||""}`),children:n=>{let{isSelected:a,isIndeterminate:i,...s}=n,c=jsxRuntime.jsx("div",{className:CP({isSelected:a,isIndeterminate:i,...s}),children:i?jsxRuntime.jsx(lucideReact.Minus,{"aria-hidden":true,className:Mh}):a?jsxRuntime.jsx(lucideReact.Check,{"aria-hidden":true,className:Mh}):null});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[c,typeof t=="function"?t(n):t]})}})}var TP={primary:"bg-action-primary/10 text-action-primary border border-action-primary/20 hover:bg-action-primary/15",secondary:"bg-action-secondary text-[color:var(--color-action-secondary-text)] border border-border-muted hover:bg-action-secondary-hover",info:"bg-feedback-info-background text-feedback-info-text border border-feedback-info-border hover:bg-feedback-info-background/80"};function Eh(e){return !e||e==="default"?"secondary":e==="brand"?"primary":e}var NP={xs:"px-1.5 py-[2px] gap-0.5",sm:"px-2 py-1 gap-1",md:"px-3 py-1.5 gap-1.5",lg:"px-3 py-2 gap-2",xl:"px-4 py-2.5 gap-2"},kP="opacity-75 cursor-not-allowed pointer-events-none";function Lh(e){let{variant:t,size:r,isDisabled:o,isClickable:n,className:a}=e,i=r==="xs"?"text-xs":We[r].text;return tailwindMerge.twMerge("inline-flex items-center justify-center rounded-full font-medium transition-colors","whitespace-nowrap select-none",NP[r],i,TP[t],n&&!o&&"cursor-pointer",o&&kP,a)}function bo({children:e,onRemove:t,size:r="md",variant:o="secondary",isRemovable:n=true,isDisabled:a=false,className:i,onClick:s}){let c=!!s&&!a,l=n&&t&&!a,d=g=>{g.stopPropagation(),g.preventDefault(),t&&!a&&t();},u=()=>{s&&!a&&s();},p=r==="xs"?10:r==="sm"?12:r==="md"?14:16,f=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"truncate",children:e}),l?c?jsxRuntime.jsx("span",{onClick:d,onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),d(g));},role:"button",tabIndex:0,className:"flex-shrink-0 rounded-full p-0.5 hover:bg-text-primary/10 transition-colors cursor-pointer","aria-label":"Remove",children:jsxRuntime.jsx(U,{name:"X",size:p,className:"text-current opacity-70 hover:opacity-100"})}):jsxRuntime.jsx("button",{type:"button",onClick:d,className:"flex-shrink-0 rounded-full p-0.5 hover:bg-text-primary/10 transition-colors cursor-pointer","aria-label":"Remove",tabIndex:-1,children:jsxRuntime.jsx(U,{name:"X",size:p,className:"text-current opacity-70 hover:opacity-100"})}):null]});return c?jsxRuntime.jsx("button",{type:"button",onClick:u,className:Lh({variant:Eh(o),size:r,isDisabled:a,isClickable:c,className:i}),disabled:a,children:f}):jsxRuntime.jsx("span",{className:Lh({variant:Eh(o),size:r,isDisabled:a,isClickable:c,className:i}),children:f})}function Fh({label:e,description:t,errorMessage:r,size:o="md",tooltip:n,isRequired:a=false,isDisabled:i=false,isInvalid:s=false,validationResult:c,placeholder:l="Add items...",selectedItems:d=[],onItemsChange:u,staticItems:p,fetchSuggestions:m,chipVariant:f="secondary",showErrors:g=true,className:b}){let[x,h]=He.useState(""),[y,v]=He.useState([]),[S,w]=He.useState(false),[N,D]=He.useState(false),[R,A]=He.useState(-1),O=Zo(x,300),P=He.useRef(null),T=He.useRef(null),{isFocused:k,handleFocus:V,handleBlur:H}=Or(),I=He.useId(),q=He.useCallback(B=>{if(!u||!B.trim())return;let C=B.trim();if(d.includes(C)){h(""),D(false),v([]),A(-1);return}u([...d,C]),h(""),D(false),v([]),A(-1),P.current?.focus();},[d,u]),j=He.useCallback(B=>{u&&u(d.filter(C=>C!==B));},[d,u]);He.useEffect(()=>{if(!m)return;let B=true;return (async()=>{let W=O.trim();if(!W){B&&(w(false),v([]),D(false));return}w(true);try{let G=await m(W);if(!B)return;v(G),D(!0);}catch(G){if(!B)return;console.error("Error fetching suggestions:",G),v([]),D(false);}finally{B&&w(false);}})(),()=>{B=false;}},[O,m]),He.useEffect(()=>{if(m||!p)return;if(!O.trim()){v([]),D(false);return}let B=p.filter(C=>C.name.toLowerCase().includes(O.toLowerCase())).map(C=>C.id);v(B),D(B.length>0||O.trim().length>0);},[O,p,m]);let K=He.useMemo(()=>{let B=y.filter(C=>!d.includes(C));return x.trim()&&!B.includes(x.trim())&&!d.includes(x.trim())?[...B,`Create tag: "${x.trim()}"`]:B},[y,x,d]),Y=He.useCallback(B=>{h(B.target.value),A(-1),B.target.value&&D(true);},[]),M=He.useCallback(B=>{i||(B.startsWith("Create tag:")?q(x):q(B));},[q,x,i]),E=He.useCallback(B=>{if(!i)switch(B.key){case "Enter":case ",":if(B.preventDefault(),R>=0&&R<K.length){let C=K[R];C.startsWith("Create tag:")?q(x):q(C);}else x.trim()&&q(x.trim());break;case "Backspace":!x&&d.length>0&&(B.preventDefault(),j(d[d.length-1]));break;case "ArrowDown":B.preventDefault(),N&&A(C=>C<K.length-1?C+1:C);break;case "ArrowUp":B.preventDefault(),N&&A(C=>C>0?C-1:-1);break;case "Escape":D(false),A(-1);break}},[i,x,d,K,R,N,q,j]);He.useEffect(()=>{let B=C=>{T.current&&C.target instanceof Node&&!T.current.contains(C.target)&&D(false);};return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[]);let z=()=>tailwindMerge.twMerge("flex items-center gap-1.5 rounded-md overflow-x-auto overflow-y-hidden","[&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]",an({isInvalid:s,isDisabled:i,isFocused:k}),"bg-background-input",o==="sm"&&"px-2 py-1 h-[32px]",o==="md"&&"px-2.5 py-1.5 h-[40px]",o==="lg"&&"px-3 py-2 h-[44px]",o==="xl"&&"px-3.5 py-2.5 h-[48px]",i&&"opacity-50 cursor-not-allowed bg-background-muted");return jsxRuntime.jsxs("div",{ref:T,className:tailwindMerge.twMerge("relative flex flex-col gap-1",b),children:[e&&jsxRuntime.jsx(ze,{size:o,tooltip:n,isRequired:a,children:e}),jsxRuntime.jsx(vt,{children:jsxRuntime.jsxs("div",{className:z(),onClick:()=>!i&&P.current?.focus(),children:[d.map(B=>jsxRuntime.jsx(bo,{variant:f,size:"xs",onRemove:()=>j(B),isDisabled:i,className:"shrink-0 max-h-full",children:B},B)),jsxRuntime.jsx("input",{ref:P,type:"text",role:"combobox","aria-expanded":N,"aria-haspopup":"listbox","aria-controls":I,"aria-autocomplete":"list",value:x,onChange:Y,onKeyDown:E,onFocus:B=>V(B),onBlur:B=>H(B),placeholder:d.length===0?l:"",disabled:i,className:"flex-1 min-w-[120px] h-full !border-0 !outline-none !ring-0 bg-transparent text-text-primary text-sm placeholder:text-text-disabled disabled:cursor-not-allowed focus:!ring-0 focus:!outline-none focus:!border-0 focus-visible:!ring-0 focus-visible:!outline-none focus-visible:!border-0",style:{boxShadow:"none",WebkitAppearance:"none",appearance:"none",border:"none",outline:"none"}})]})}),N&&(x||K.length>0)&&jsxRuntime.jsx("div",{id:I,role:"listbox",className:tailwindMerge.twMerge("absolute z-50 mt-1 rounded-lg border border-border-default","max-h-60 overflow-auto bg-background-surface shadow-lg","left-0 right-0 top-full"),children:S?jsxRuntime.jsx("div",{className:"px-3 py-2 text-sm text-text-secondary",children:"Loading..."}):K.length>0?K.map((B,C)=>jsxRuntime.jsx("div",{role:"option","aria-selected":C===R,className:tailwindMerge.twMerge("cursor-pointer px-3 py-2 text-sm transition-colors","hover:bg-background-hover",C===R&&"bg-background-selected",B.startsWith("Create tag:")&&"italic text-text-secondary"),onClick:()=>M(B),children:B},B)):x&&jsxRuntime.jsx("div",{className:"px-3 py-2 text-sm text-text-secondary",children:"No suggestions found"})}),t&&jsxRuntime.jsx(Pe,{size:o,className:"mt-1",children:t}),g&&typeof r=="string"&&jsxRuntime.jsx(ge,{size:o,className:"text-feedback-error-text mt-1",children:r}),g&&typeof r=="function"&&c&&jsxRuntime.jsx(ge,{size:o,className:"text-feedback-error-text mt-1",children:r(c)})]})}var BP={json:()=>import('ace-builds/src-noconflict/mode-json'),javascript:()=>import('ace-builds/src-noconflict/mode-javascript'),typescript:()=>import('ace-builds/src-noconflict/mode-typescript'),html:()=>import('ace-builds/src-noconflict/mode-html'),css:()=>import('ace-builds/src-noconflict/mode-css'),markdown:()=>import('ace-builds/src-noconflict/mode-markdown'),yaml:()=>import('ace-builds/src-noconflict/mode-yaml'),xml:()=>import('ace-builds/src-noconflict/mode-xml'),python:()=>import('ace-builds/src-noconflict/mode-python'),sql:()=>import('ace-builds/src-noconflict/mode-sql')},VP={github:()=>import('ace-builds/src-noconflict/theme-github'),github_dark:()=>import('ace-builds/src-noconflict/theme-github_dark')},OP={"ext-language-tools":()=>import('ace-builds/src-noconflict/ext-language_tools')},ms=new Set;async function Sm(e,t){ms.has(e)||(await t(),ms.add(e));}async function zP(e,t,r){await Promise.all([Sm(`language:${e}`,BP[e]),Sm(`theme:${t}`,VP[t]),r?Sm("extension:language-tools",OP["ext-language-tools"]):void 0]);}function Vh(e,t,r){let o=ms.has(`language:${e}`)&&ms.has(`theme:${t}`);return r?o&&ms.has("extension:language-tools"):o}function Oh({value:e,readOnly:t=false,onChange:r,language:o="json",theme:n="github_dark",height:a,width:i="100%",className:s,lineHeight:c=19,minLines:l=3,maxLines:d=50,showLineNumbers:u=true,showGutter:p=true,fontSize:m=14,wrapEnabled:f=false}){let g=He.useRef(null),[b,x]=He.useState(()=>Vh(o,n,!t)),h=He.useMemo(()=>{if(a)return a;let y=(e.match(/\n/g)||[]).length+1;return `${Math.max(l,Math.min(y,d))*c+10}px`},[e,a,c,l,d]);return He.useEffect(()=>{let y=false,v=!t;return Vh(o,n,v)?(x(true),()=>{y=true;}):(x(false),zP(o,n,v).then(()=>{y||x(true);}).catch(S=>{y||x(true),console.error("Failed to load Ace editor resources",S);}),()=>{y=true;})},[o,t,n]),He.useEffect(()=>{b&&g.current?.editor&&g.current.editor.resize();},[h,b]),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden rounded-md border border-border-input",s),style:{width:i,height:h},children:b?jsxRuntime.jsx(IP__default.default,{ref:g,mode:o,theme:n,value:e,onChange:r,readOnly:t,width:"100%",height:"100%",fontSize:m,showPrintMargin:false,showGutter:p,highlightActiveLine:!t,setOptions:{useWorker:true,showLineNumbers:u,tabSize:2,enableBasicAutocompletion:!t,enableLiveAutocompletion:!t,enableSnippets:!t,showFoldWidgets:true,wrap:f},editorProps:{$blockScrolling:true}}):jsxRuntime.jsx("div",{className:"flex h-full w-full items-center justify-center bg-surface-muted text-foreground-muted",children:"Loading editor\u2026"})})}var Hh=He__namespace.createContext({variant:"contained",density:"comfortable",showDividers:true}),Wh=He__namespace.createContext(null),YP={contained:"rounded-lg border border-border-default bg-background-surface overflow-hidden",bordered:"rounded-lg border border-border-default bg-background-surface",plain:"bg-transparent"},zh={true:"divide-y divide-border-default",false:"gap-3"},KP={comfortable:"px-5 py-3",compact:"px-4 py-2.5"},qP={comfortable:"px-5 pt-0",compact:"px-4 pt-0"},jP={comfortable:"h-4 w-4",compact:"h-3.5 w-3.5"};function km(){return He__namespace.useContext(Hh)}function JP(e){let t=He__namespace.useContext(Wh);if(!t)throw new Error(`${e} must be used within a <CollapseItem>`);return t}function $P({variant:e,showDividers:t,className:r}){let o="group/collapse-item w-full transition-colors",n={contained:"bg-background-surface",bordered:"bg-background-surface",plain:"bg-transparent"},a=t?"":"rounded-lg border border-border-default bg-background-surface overflow-hidden";return tailwindMerge.twMerge(o,n[e],a,r)}function XP({isDisabled:e,isPressed:t,density:r,variant:o,showDividers:n,className:a}){let i="group/collapse-header flex w-full items-start gap-4 text-left transition-colors duration-150",s=e?"cursor-not-allowed text-text-disabled":"cursor-pointer text-text-primary",c=t&&!e?"bg-background-hover":"",l=KP[r];return tailwindMerge.twMerge(i,$e(),l,s,c,o==="plain"&&n?"px-0":"",a)}function ZP({density:e,showDividers:t,className:r}){let o="text-text-primary",n=qP[e];return tailwindMerge.twMerge(o,n,t?"":"rounded-b-lg",r)}function oi({variant:e="contained",density:t="comfortable",showDividers:r=true,className:o,...n}){let a=He__namespace.useMemo(()=>({variant:e,density:t,showDividers:r}),[e,t,r]),i=tailwindMerge.twMerge("flex w-full flex-col",YP[e],r?zh.true:zh.false,e==="plain"&&r?"border-y border-border-default/60":"");return jsxRuntime.jsx(Hh.Provider,{value:a,children:jsxRuntime.jsx(reactAriaComponents.DisclosureGroup,{...n,className:ke(o,i)})})}function dn({className:e,children:t,...r}){let{variant:o,showDividers:n}=km();return jsxRuntime.jsx(reactAriaComponents.Disclosure,{...r,className:reactAriaComponents.composeRenderProps(e,a=>$P({variant:o,showDividers:n,className:a})),children:a=>jsxRuntime.jsx(Wh.Provider,{value:a,children:t})})}dn.displayName="CollapseItem";function un({title:e,description:t,startContent:r,endContent:o,indicator:n,indicatorPosition:a="end",showIndicator:i=true,keepIndicatorSpace:s=false,children:c,className:l,...d}){let u=JP("CollapseHeader"),{density:p,variant:m,showDividers:f}=km(),g=jP[p];return jsxRuntime.jsx(reactAriaComponents.Button,{...d,slot:"trigger","data-expanded":u.isExpanded?"true":void 0,className:reactAriaComponents.composeRenderProps(l,(b,x)=>XP({isDisabled:x.isDisabled??false,isPressed:x.isPressed??false,density:p,variant:m,showDividers:f,className:b})),children:b=>{let x=b.isDisabled??false,h=i?typeof n=="function"?n({isExpanded:u.isExpanded,isDisabled:x}):n??jsxRuntime.jsx(U,{name:"CaretDown",size:p==="compact"?"xs":"sm",weight:"bold","aria-hidden":"true",className:tailwindMerge.twMerge("text-text-secondary transition-transform duration-200",u.isExpanded?"rotate-180":"rotate-0")}):null,y=h?jsxRuntime.jsx("span",{className:tailwindMerge.twMerge("flex flex-shrink-0 items-center justify-center text-text-secondary",g),"aria-hidden":"true",children:h}):s?jsxRuntime.jsx("span",{className:tailwindMerge.twMerge("flex flex-shrink-0 items-center justify-center",g),"aria-hidden":"true"}):null;return jsxRuntime.jsxs("div",{className:"flex w-full items-center gap-4",children:[a==="start"&&y,r&&jsxRuntime.jsx("div",{className:"flex flex-shrink-0 items-center text-text-secondary",children:r}),jsxRuntime.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[c??jsxRuntime.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1 text-left",children:[e&&jsxRuntime.jsx("span",{className:"truncate font-medium text-text-primary",children:e}),t&&jsxRuntime.jsx("span",{className:"text-sm text-text-secondary",children:t})]}),o&&jsxRuntime.jsx("div",{className:"flex flex-shrink-0 items-center text-sm text-text-secondary",children:o})]}),a==="end"&&y]})}})}un.displayName="CollapseHeader";function pn({className:e,children:t,...r}){let{density:o,showDividers:n}=km();return jsxRuntime.jsx(reactAriaComponents.DisclosurePanel,{...r,className:reactAriaComponents.composeRenderProps(e,a=>ZP({density:o,showDividers:n,className:a})),children:t})}pn.displayName="CollapseContent";function ni(e){if(!e)return false;let t=e.startsWith("#")?e.slice(1):e;return /^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$/.test(t)}function Rm(e){if(!e)return "";let t=e.startsWith("#")?e.slice(1):e;return t.length===3&&(t=t.split("").map(r=>r+r).join("")),`#${t.toUpperCase()}`}function tR({label:e,description:t,errorMessage:r,size:o="md",tooltip:n,isRequired:a,transparent:i,className:s,validationResult:c,value:l,defaultValue:d,onChange:u,placeholder:p="#000000",showColorSwatch:m=true,reserveErrorSpace:f=true,...g}){let[b,x]=He.useState(d||""),[h,y]=He.useState(l||d||""),[v,S]=He.useState(false),[w,N]=He.useState(null),{isFocused:D,handleFocus:R,handleBlur:A}=Or(),O=l!==void 0?l:b;He.useEffect(()=>{l!==void 0&&y(l);},[l]);let P=O?!ni(O):false,T=He.useCallback(H=>{if(y(H),ni(H)){let I=Rm(H);u?u(I):x(I);}else H===""&&(u?u(""):x(""));},[u]),k=He.useCallback(H=>{let I=Rm(H);y(I),u?u(I):x(I);},[u]),V=He.useCallback(H=>{if(ni(h)){let I=Rm(h);y(I),u&&I!==O?u(I):!u&&I!==b&&x(I);}A(H,g.onBlur);},[h,O,b,u,A,g.onBlur]);return jsxRuntime.jsx(reactAriaComponents.TextField,{...g,isRequired:a,className:ke(s,"group flex flex-col"),children:({isDisabled:H})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(ze,{size:o,tooltip:n,isRequired:a,children:e}),jsxRuntime.jsx(vt,{children:jsxRuntime.jsxs("div",{className:"flex gap-2",children:[jsxRuntime.jsxs("div",{className:"flex-1 relative",children:[jsxRuntime.jsx(rc,{size:o,disabled:H,type:"text",value:h,placeholder:p,onFocus:I=>R(I,g.onFocus),onBlur:V,onChange:I=>T(I.target.value),className:tailwindMerge.twMerge(Wt({isInvalid:P,isDisabled:H,isFocused:D,size:o,transparent:i}),m?"pr-12":"pr-3","pl-3")}),m&&jsxRuntime.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none",style:{width:We[o].height},children:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-6 h-6 rounded border shadow-sm",ni(O)?"border-border-default":"border-border-default bg-background-muted"),style:ni(O)?{backgroundColor:O}:void 0,"aria-hidden":"true",children:!ni(O)&&jsxRuntime.jsx("div",{className:"w-full h-full flex items-center justify-center",children:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full border-2 border-border-muted"})})})})]}),jsxRuntime.jsx("div",{ref:N,children:jsxRuntime.jsx(re,{variant:"secondary",size:o,icon:"Palette",onPress:()=>S(!v),isDisabled:H,className:"flex-shrink-0",children:"Pick"})})]})}),f?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof r=="string"?jsxRuntime.jsx(ge,{size:o,children:r}):typeof r=="function"&&c?jsxRuntime.jsx(ge,{size:o,children:r(c)}):t?jsxRuntime.jsx(Pe,{size:o,children:t}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof r=="string"?jsxRuntime.jsx(ge,{size:o,className:"mt-1",children:r}):typeof r=="function"&&c?jsxRuntime.jsx(ge,{size:o,className:"mt-1",children:r(c)}):t?jsxRuntime.jsx(Pe,{size:o,className:"mt-1",children:t}):null}),v&&w&&jsxRuntime.jsx(lt,{triggerRef:{current:w},isOpen:v,onOpenChange:S,placement:"bottom end",className:"bg-background-input shadow-xl border border-border-input/20 backdrop-blur-sm rounded-lg p-4",children:jsxRuntime.jsxs("div",{className:"flex flex-col gap-4",children:[jsxRuntime.jsx(reactColorful.HexColorPicker,{color:O||"#000000",onChange:k,style:{width:"200px",height:"200px"}}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"w-10 h-10 rounded border border-border-default shadow-sm flex-shrink-0",style:{backgroundColor:O||"#000000"}}),jsxRuntime.jsx("div",{className:"flex-1 text-text-primary text-[length:var(--control-text-sm)] font-mono",children:O||"#000000"})]})]})})]})})}function Yh({isOpen:e,onClose:t,onConfirm:r,title:o,message:n,confirmLabel:a="Confirm",cancelLabel:i="Cancel",confirmVariant:s,isDestructive:c=false,isLoading:l=false,maxWidth:d="500px",minWidth:u="400px"}){return jsxRuntime.jsx(Ir,{isOpen:e,onClose:t,title:o,maxWidth:d,minWidth:u,primaryAction:{label:a,onPress:()=>{r();},variant:s??(c?"destructive":"primary"),isLoading:l},secondaryAction:{label:i,onPress:t,variant:"secondary",isDisabled:l},children:jsxRuntime.jsx("div",{className:"text-text-primary",children:n})})}function Kh({isConnected:e,connectedAt:t,disconnectedAt:r,showTimestamp:o=false,isLoading:n,size:a="sm",shape:i="pill",...s}){if(n)return jsxRuntime.jsx(J,{className:"inline-flex h-6 w-24"});let c=e?"Connected":"Disconnected",l=e?"success":"neutral",d=null;if(o){if(e&&t)d=bl(t);else if(!e&&r){let u=bl(r);d=u?`Offline ${u}`:null;}}return jsxRuntime.jsxs("div",{className:"inline-flex flex-col gap-1",children:[jsxRuntime.jsx(at,{variant:l,size:a,shape:i,dot:e,dotPulse:e,...s,children:c}),d&&jsxRuntime.jsx("span",{className:"text-xs text-text-secondary",children:d})]})}function qh({firstName:e,lastName:t,email:r,phone:o,avatarUrl:n,href:a,LinkComponent:i,variant:s="outlined",layout:c="horizontal",showEmail:l=true,showPhone:d=false,isLoading:u=false,className:p,contentClassName:m,piiEntity:f}){let g=`${e} ${t}`.trim(),b=({children:h,className:y})=>a?i?jsxRuntime.jsx(i,{href:a,className:y,children:h}):jsxRuntime.jsx(tt,{href:a,variant:"unstyled",className:tailwindMerge.twMerge("hover:underline",y),asButton:false,children:h}):jsxRuntime.jsx("span",{className:y,children:h}),x=c==="vertical";return u?jsxRuntime.jsx(Ge,{variant:s,className:tailwindMerge.twMerge("flex flex-col",p),children:jsxRuntime.jsx(Ge.Content,{className:"flex items-center flex-1",children:jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("w-full",x?"flex flex-col items-center gap-4":"flex items-center gap-4"),children:[jsxRuntime.jsx(J,{width:56,height:56,className:"rounded flex-shrink-0"}),jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge(x?"w-full text-center":"flex-1","space-y-2"),children:[jsxRuntime.jsx(J,{width:"70%",height:20,className:tailwindMerge.twMerge(x&&"mx-auto")}),jsxRuntime.jsx(J,{width:"100%",height:16,className:tailwindMerge.twMerge(x&&"mx-auto")})]})]})})}):jsxRuntime.jsx(Ge,{variant:s,className:tailwindMerge.twMerge("group/card flex flex-col",p),children:jsxRuntime.jsx(Ge.Content,{className:tailwindMerge.twMerge("flex items-center flex-1",a&&"cursor-pointer",m),children:jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative w-full",x?"flex flex-col items-center gap-4 text-center":"flex items-center gap-4"),children:[jsxRuntime.jsx(Io,{firstName:e,lastName:t,src:n,size:"xl",variant:"user",shape:"square",className:"flex-shrink-0",piiEntity:f}),jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge(x?"w-full":"flex-1 min-w-0"),children:[a&&jsxRuntime.jsx(b,{className:"after:absolute after:inset-0",children:jsxRuntime.jsx("span",{className:"sr-only",children:g})}),jsxRuntime.jsx("span",{className:"text-lg font-semibold leading-tight text-text-primary block mb-1.5 group-hover/card:text-text-brand transition-colors","data-pii-type":f?"full-name":void 0,"data-pii-entity":f,children:g}),jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("space-y-0.5",x&&"flex flex-col items-center"),children:[l&&r&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2.5 text-text-primary",children:[jsxRuntime.jsx(U,{name:"Envelope",size:16,className:"text-text-secondary flex-shrink-0"}),jsxRuntime.jsx(tt,{href:`mailto:${r}`,variant:"unstyled",className:tailwindMerge.twMerge("text-sm leading-relaxed text-text-primary relative z-20",x?"":"truncate"),"data-pii-type":f?"email":void 0,"data-pii-entity":f,children:r})]}),d&&o&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2.5 text-text-primary",children:[jsxRuntime.jsx(U,{name:"Phone",size:16,className:"text-text-secondary flex-shrink-0"}),jsxRuntime.jsx(tt,{href:`tel:${o}`,variant:"unstyled",className:tailwindMerge.twMerge("text-sm leading-relaxed text-text-primary relative z-20",x?"":"truncate"),"data-pii-type":f?"phone":void 0,"data-pii-entity":f,children:Ha(o)})]})]})]})]})})})}function fc({firstName:e,lastName:t,email:r,avatarUrl:o,layout:n="stacked",size:a="md",href:i,LinkComponent:s,linkVariant:c="unstyled",emphasis:l="normal",showEmail:d=false,badge:u,avatarShape:p,isLoading:m=false,className:f,piiEntity:g}){let b=p??(n==="inline"?"circle":"square"),h={xs:{avatarSize:"xs",gap:"gap-1.5",textSize:"text-xs",secondaryTextSize:"text-xs",skeletonAvatar:24,skeletonText:80,skeletonSecondary:60},sm:{avatarSize:"sm",gap:"gap-2",textSize:"text-sm",secondaryTextSize:"text-xs",skeletonAvatar:32,skeletonText:96,skeletonSecondary:72},md:{avatarSize:"md",gap:"gap-3",textSize:"text-base",secondaryTextSize:"text-sm",skeletonAvatar:40,skeletonText:128,skeletonSecondary:96},lg:{avatarSize:"lg",gap:"gap-3",textSize:"text-lg",secondaryTextSize:"text-base",skeletonAvatar:48,skeletonText:160,skeletonSecondary:120}}[a],y=`${e} ${t}`.trim(),S={strong:"font-semibold text-text-primary",high:"font-semibold text-text-primary",normal:"text-text-primary",low:"text-text-secondary"}[l],w=({children:N,className:D})=>i?s?jsxRuntime.jsx(s,{href:i,className:D,children:N}):jsxRuntime.jsx(tt,{href:i,variant:c,className:tailwindMerge.twMerge("hover:underline",D),asButton:false,children:N}):jsxRuntime.jsx("span",{className:D,children:N});return m?n==="inline"?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center",h.gap,f),children:[jsxRuntime.jsx(J,{width:h.skeletonAvatar,height:h.skeletonAvatar,className:"flex-shrink-0 rounded-full"}),jsxRuntime.jsx(J,{width:h.skeletonText,height:h.skeletonAvatar*.5})]}):jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center",h.gap,f),children:[jsxRuntime.jsx(J,{width:h.skeletonAvatar,height:h.skeletonAvatar,className:"flex-shrink-0 rounded-full"}),jsxRuntime.jsxs("div",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx(J,{width:h.skeletonText,height:16}),d&&jsxRuntime.jsx(J,{width:h.skeletonSecondary,height:12})]})]}):n==="inline"?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center",h.gap,f),children:[jsxRuntime.jsxs(w,{className:tailwindMerge.twMerge("flex items-center",h.gap),children:[jsxRuntime.jsx(Io,{firstName:e,lastName:t,src:o,size:h.avatarSize,variant:"user",shape:b,className:"flex-shrink-0",piiEntity:g}),jsxRuntime.jsx("span",{className:tailwindMerge.twMerge("leading-normal truncate hover:text-text-primary",S,h.textSize,i&&"hover:underline hover:decoration-1 hover:underline-offset-4"),"data-pii-type":g?"full-name":void 0,"data-pii-entity":g,children:y})]}),u]}):jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center justify-start",h.gap,f),children:[jsxRuntime.jsx(Io,{firstName:e,lastName:t,src:o,size:h.avatarSize,variant:"user",shape:b,className:"flex-shrink-0",piiEntity:g}),jsxRuntime.jsxs("div",{className:"flex flex-col items-start min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(w,{className:tailwindMerge.twMerge("leading-normal truncate hover:text-text-primary",S,h.textSize,i&&"hover:underline hover:decoration-1 hover:underline-offset-4"),children:jsxRuntime.jsx("span",{"data-pii-type":g?"full-name":void 0,"data-pii-entity":g,children:y})}),u]}),d&&r&&jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("text-text-secondary leading-normal truncate",h.secondaryTextSize),"data-pii-type":g?"email":void 0,"data-pii-entity":g,children:r})]})]})}var gc={duration:.5,ease:"easeInOut"},zr=He.createContext(null),ta=()=>{let e=He.useContext(zr);if(!e)throw new Error("useChartContext must be used within a ChartContextProvider");return e};function bc(e,t){if(t<=0||e.length<2)return e;let r=[e[0]];for(let o=1;o<e.length;o++)e[o].xValue.getTime()-e[o-1].xValue.getTime()>t&&r.push(null),r.push(e[o]);return r}var fn=({data:e,color:t="var(--color-viz-default)",baseline:r,fillOpacity:o=.1,showLine:n=true,maxGapMs:a,animate:i=true})=>{let s=He.useId(),c=He.useId(),{xScale:l,yScale:d,animationSettings:u}=ta(),p=l.range(),m=d.range(),f=(y,v)=>typeof r=="function"?r(y,v):r??0,g=y=>y.chartYValue??y.yValue,b=a!=null?bc(e,a):e,x={transformOrigin:`0 ${m[0]}px`,transformBox:"fill-box",isolation:"isolate"},h=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[r===void 0?jsxRuntime.jsx(shape.AreaClosed,{data:b,x:y=>y?l(y.xValue):0,y:y=>y?d(g(y)):0,yScale:d,defined:y=>y!=null,fill:`url(#${s})`,curve:curve.curveLinear}):jsxRuntime.jsx(shape.Area,{data:b,x:y=>y?l(y.xValue):0,y0:(y,v)=>y?d(f(y,v)):0,y1:y=>y?d(g(y)):0,defined:y=>y!=null,fill:t,fillOpacity:o,curve:curve.curveLinear}),n?jsxRuntime.jsx(shape.LinePath,{data:b,x:y=>y?l(y.xValue):0,y:y=>y?d(g(y)):0,defined:y=>y!=null,stroke:t,strokeWidth:3,curve:curve.curveLinear}):null]});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("defs",{children:[jsxRuntime.jsxs("linearGradient",{id:s,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[jsxRuntime.jsx("stop",{offset:"50%",stopColor:t,stopOpacity:o}),jsxRuntime.jsx("stop",{offset:"100%",stopColor:t,stopOpacity:0})]}),i&&jsxRuntime.jsx("clipPath",{id:c,children:jsxRuntime.jsx("rect",{x:p[0],y:m[1],width:p[1]-p[0],height:m[0]-m[1]})})]}),i?jsxRuntime.jsx("g",{clipPath:`url(#${c})`,children:jsxRuntime.jsx(framerMotion.motion.g,{initial:{scaleY:0},animate:{scaleY:1},transition:{duration:u.duration,ease:u.ease},style:x,children:h})}):jsxRuntime.jsx("g",{style:x,children:h})]})};var hc=({data:e,color:t="var(--color-viz-default)",opacity:r=1,categoryColors:o={}})=>{let{xScale:n,yScale:a,animationSettings:i}=ta(),s=He.useId(),c=n.range(),l=a.range(),d=[...e].sort((m,f)=>m.xValue.getTime()-f.xValue.getTime());if(d.length===0)return null;let u=d.length>1?d[1].xValue.getTime()-d[0].xValue.getTime():15*6e4,p=Math.abs(n(new Date(d[0].xValue.getTime()+u))-n(d[0].xValue));return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("clipPath",{id:s,children:jsxRuntime.jsx("rect",{x:c[0],y:l[1],width:c[1]-c[0],height:l[0]-l[1]})})}),jsxRuntime.jsx("g",{clipPath:`url(#${s})`,children:jsxRuntime.jsx(framerMotion.motion.g,{initial:{scaleY:0},animate:{scaleY:1},transition:{duration:i.duration,ease:i.ease},style:{transformOrigin:`0 ${a(0)}px`,isolation:"isolate"},children:d.map((m,f)=>{let g=n(m.xValue),b=a(m.yValue),x=a(0),h=Math.min(b,x),y=Math.abs(b-x),v=d[f+1],S=v?Math.abs(n(v.xValue)-g):p,w=m.category&&o[m.category]?o[m.category]:t;return jsxRuntime.jsx(shape.Bar,{x:g-S/2,y:h,width:S,height:y,fill:w,opacity:r,rx:1},m.xValue.getTime())})})})]})};var ho=fl(xy()),yy=fl(hy());var RR=["top","left","transform","className","children","innerRef"];function Hm(){return Hm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);}return e},Hm.apply(this,arguments)}function MR(e,t){if(e==null)return {};var r={},o=Object.keys(e),n,a;for(a=0;a<o.length;a++)n=o[a],!(t.indexOf(n)>=0)&&(r[n]=e[n]);return r}function gs(e){var t=e.top,r=t===void 0?0:t,o=e.left,n=o===void 0?0:o,a=e.transform,i=e.className,s=e.children,c=e.innerRef,l=MR(e,RR);return He__namespace.default.createElement("g",Hm({ref:c,className:(0, yy.default)("visx-group",i),transform:a||"translate("+n+", "+r+")"},l),s)}gs.propTypes={top:ho.default.number,left:ho.default.number,transform:ho.default.string,className:ho.default.string,children:ho.default.node,innerRef:ho.default.oneOfType([ho.default.string,ho.default.func,ho.default.object])};function FR(e){return e>=1e9?"GW":e>=1e6?"MW":e>=1e3?"kW":"W"}function BR(e){return e>=1e3?"kA":e<1?"mA":"A"}function VR(e){return e>=1e3?"kV":e<1?"mV":"V"}function OR(e){return e>=1e6?"M\u03A9":e>=1e3?"k\u03A9":e<1?"m\u03A9":"\u03A9"}function li(e,t){if(typeof e!="object"||e===null)return e;switch(e.type){case "energy":{if(e.unit||e.autoScale===false)return e;let r=e.sourceUnit?Iu[e.sourceUnit]:1;return {...e,unit:Au(t*r)}}case "power":return e.unit||e.autoScale===false?e:{...e,unit:FR(t)};case "current":return e.unit||e.autoScale===false?e:{...e,unit:BR(t)};case "voltage":return e.unit||e.autoScale===false?e:{...e,unit:VR(t)};case "resistance":return e.unit||e.autoScale===false?e:{...e,unit:OR(t)};default:return e}}var zR=e=>e.baselineValue??0,Ie={top:0,right:0,bottom:50,left:60};function Qr(e={type:"number"}){let t=i=>{if(i==null)return "-";let s=lo({value:i,formatter:e});if(s===null)return "-";if(typeof s=="string")return s;if(typeof s=="number")return s.toString();if(typeof s=="object"&&s!==null&&"props"in s){let c=d=>{if(d==null)return "";if(typeof d=="string")return d;if(typeof d=="number")return d.toString();if(typeof d=="object"&&"props"in d){let u=d.props;if(u?.children)return Array.isArray(u.children)?u.children.map(c).join(""):c(u.children)}return ""};return c(s)||i.toString()}return i.toString()},r=i=>{if(i==null)return "-";if(typeof e=="string"){let s=lo({value:i,formatter:e});return s===null?"-":String(s)}if(typeof e=="object"&&e.type)switch(e.type){case "energy":case "power":case "voltage":case "current":case "resistance":case "temperature":case "distance":return t(i);case "currency":return t(i);default:return t(i)}return t(i)},o,n,a;return typeof e=="object"&&e.type&&e.type==="number"&&("min"in e&&(o=e.min),"max"in e&&(n=e.max)),{format:t,tickFormat:r,min:o,max:n,tickInterval:a}}var Wm=(e,t)=>{let r=d3Array.extent(e,o=>o.xValue);return scale.scaleTime({range:[Ie.left,t-Ie.right],domain:r,nice:true})},bs=(e,t,r,o)=>{let n=Qr(r);if(o)return scale.scaleLinear({range:[t-Ie.bottom,Ie.top],domain:o,nice:true});let a=d3Array.min(e,l=>Math.min(l.yValue,l.chartYValue??l.yValue))||0,i=d3Array.max(e,l=>Math.max(l.yValue,l.chartYValue??l.yValue))||0,s=n.min!==void 0?n.min:a>=0?0:a*1.1,c=n.max!==void 0?n.max:i<=0?0:i*1.1;return scale.scaleLinear({range:[t-Ie.bottom,Ie.top],domain:[s,c],nice:true})};function HR(e,t=12,r="system-ui"){if(typeof window>"u"||typeof document>"u")return e.length*(t*.6);let o=document.createElement("canvas"),n=null;try{n=o.getContext("2d");}catch{return e.length*(t*.6)}return n?(n.font=`${t}px ${r}`,n.measureText(e).width):e.length*(t*.6)}function ci(e,t=12,r="system-ui"){return e.length===0?0:Math.max(...e.map(o=>HR(o,t,r)))}function xs(e){return e instanceof Date&&!Number.isNaN(e.getTime())}function WR(e,t,r=12,o=false){if(!xs(t[0])||!xs(t[1]))return console.warn("ChartAxis: Invalid date in domain, skipping tick calculation"),[];let n=t[0].getTime(),i=t[1].getTime()-n;if(i===0||i<1e3)return [t[0]];let s=Xi({start:t[0],end:t[1]},{compact:o}),l=[t[0],new Date((t[0].getTime()+t[1].getTime())/2),t[1]].map(b=>s(b)),d=ci(l,r),p=d+d,m=Math.floor(e/p),f=Math.max(2,Math.min(8,m));if(f<=2)return [t[0],t[1]];let g=[t[0]];for(let b=1;b<f-1;b++){let x=b/(f-1),h=n+i*x;g.push(new Date(h));}return g.push(t[1]),g}var GR=({top:e,scale:t,width:r})=>{let o=t.domain(),n=[o[0],o[o.length-1]],a=xs(n[0])&&xs(n[1]),i=r<400,s=a?n[0].getTime():0,c=a?n[1].getTime():0,l=He.useMemo(()=>a?Xi({start:n[0],end:n[1]},{compact:i}):()=>"",[s,c,i,a]),d=He.useMemo(()=>WR(r,n,12,i),[r,s,c,i]);return d.length===0?null:jsxRuntime.jsx(axis.Axis,{orientation:"bottom",top:e,scale:t,tickValues:d,tickFormat:u=>{let p=u;return xs(p)?l(p):""},stroke:"var(--color-border-muted)",tickStroke:"var(--color-border-muted)",tickLabelProps:(u,p,m)=>({fill:"var(--color-text-secondary)",fontSize:12,textAnchor:p===0?"start":p===m.length-1?"end":"middle"}),rangePadding:0})};function di(e,t=12){let r=t*2.5,o=Math.floor(e/r);return Math.max(2,Math.min(6,o))}var UR=({left:e,scale:t,yFormatter:r,height:o})=>{let n=Qr(r),a=He.useMemo(()=>!o||o<=0?5:di(o),[o]);return jsxRuntime.jsx(axis.Axis,{orientation:"left",left:e,scale:t,numTicks:a,tickFormat:i=>(n.tickFormat||n.format)(i),stroke:"var(--color-border-muted)",tickStroke:"var(--color-border-muted)",tickLabelProps:()=>({fill:"var(--color-text-secondary)",fontSize:12,textAnchor:"end",dy:"0.33em"})})},YR=({top:e,scale:t})=>jsxRuntime.jsx(axis.Axis,{orientation:"bottom",top:e,scale:t,stroke:"var(--color-border-muted)",tickStroke:"var(--color-border-muted)",tickLabelProps:()=>({fill:"var(--color-text-secondary)",fontSize:12,textAnchor:"middle",dy:"0.25em"})}),KR=({left:e,scale:t})=>jsxRuntime.jsx(axis.Axis,{orientation:"left",left:e,scale:t,stroke:"var(--color-border-muted)",tickStroke:"var(--color-border-muted)",tickLabelProps:()=>({fill:"var(--color-text-secondary)",fontSize:12,textAnchor:"end",dx:"-0.25em",dy:"0.33em"})}),qR=({top:e,scale:t,yFormatter:r,width:o})=>{let n=Qr(r),a=He.useMemo(()=>{if(!o||o<=0)return 5;let s=Math.floor(o/60);return Math.max(2,Math.min(8,s))},[o]);return jsxRuntime.jsx(axis.Axis,{orientation:"bottom",top:e,scale:t,numTicks:a,tickFormat:i=>(n.tickFormat||n.format)(i),stroke:"var(--color-border-muted)",tickStroke:"var(--color-border-muted)",tickLabelProps:()=>({fill:"var(--color-text-secondary)",fontSize:12,textAnchor:"middle",dy:"0.25em"})})},Hr={Bottom:GR,Left:UR,CategoryBottom:YR,CategoryLeft:KR,NumericBottom:qR};var gn=({data:e,formatter:t,label:r,categoryLabels:o})=>{if(!e)return null;let n=He__namespace.default.useContext(zr),a=o??n?.categoryLabels,i=n?.xScale,s=n?.width,c=n?.height,l=Qr(t),d=h=>{if(h.baselineValue===void 0)return l.format(h.value);let y=Math.min(h.baselineValue,h.value),v=Math.max(h.baselineValue,h.value);return `${l.format(y)} \u2013 ${l.format(v)}`},u=He__namespace.default.useRef(null),[p,m]=He__namespace.default.useState({x:0,y:0,translate:"translate(-50%, -100%)"});He__namespace.default.useEffect(()=>{if(!u.current)return;let y=u.current.getBoundingClientRect(),v=s??window.innerWidth,S=c??window.innerHeight,w=e.x,N=e.y,D=16,R=e.x+y.width+D<=v,A=e.x-y.width-D>=0,O;e.position==="left"?O=A||!R:O=!R&&A;let P=O?"translate(calc(-100% - 16px), -50%)":"translate(16px, -50%)";if(!R&&!A){let T=v-e.x,k=e.x;T<=k?(w=v,P="translate(-100%, -50%)"):(w=0,P="translate(0, -50%)");}N-y.height/2<0?N=y.height/2:N+y.height/2>S&&(N=S-y.height/2),m({x:w,y:N,translate:P});},[e.x,e.y,e.position,s,c]);let f=i?.domain(),b=f&&f.length===2&&f.every(h=>h instanceof Date)?ax({start:f[0],end:f[1]}):null,x=r||(b&&e.xValue instanceof Date?b(e.xValue):String(e.xValue));return jsxRuntime.jsx(framerMotion.AnimatePresence,{children:jsxRuntime.jsxs(framerMotion.motion.div,{ref:u,role:"tooltip","aria-live":"polite",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},"data-testid":"tooltip",className:"pointer-events-none absolute z-50 rounded-lg bg-background-surface p-4 text-sm shadow-xl ring-1 ring-border-default whitespace-nowrap",style:{left:p.x,top:p.y,transform:p.translate},children:[jsxRuntime.jsx("div",{className:"mb-1 font-medium text-text-primary",children:x}),e.isEvent?jsxRuntime.jsxs("div",{className:"space-y-2",children:[e.series.length>1&&jsxRuntime.jsx("ul",{className:"list-none p-0 border-b border-border-default pb-2",children:e.series.slice(0,-1).map(h=>jsxRuntime.jsxs("li",{className:"py-0.5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("span",{className:"font-medium text-text-primary",children:[h.label,":"]}),jsxRuntime.jsx("span",{className:"text-text-secondary",children:d(h)})]}),h.category&&jsxRuntime.jsxs("div",{className:"mt-0.5 flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"h-3 w-3",style:{backgroundColor:h.categoryColor||h.color,borderRadius:"1px"}}),jsxRuntime.jsx("span",{className:"text-sm text-text-secondary",children:a?.[h.category]||h.category})]})]},h.label))}),(()=>{let h=e.series[e.series.length-1],y=e.eventItems?.length?e.eventItems:[{label:h.label,color:h.color,metadata:e.eventMetadata}];return jsxRuntime.jsx("div",{className:"space-y-2",children:y.map((v,S)=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"h-2 w-2 rounded-full",style:{backgroundColor:v.color}}),jsxRuntime.jsx("span",{className:"font-medium text-text-primary",children:v.label})]}),v.metadata&&Object.keys(v.metadata).length>0&&jsxRuntime.jsx("div",{className:"ml-4 mt-1 space-y-0.5 text-xs text-text-secondary",children:Object.entries(v.metadata).map(([w,N])=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("span",{className:"capitalize",children:[w,":"]}),jsxRuntime.jsx("span",{className:"font-medium",children:N})]},w))})]},`${v.label}-${S}`))})})()]}):jsxRuntime.jsx("ul",{className:"list-none p-0",children:e.series.map(h=>jsxRuntime.jsxs("li",{className:"py-0.5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("span",{className:"font-medium text-text-primary",children:[h.label,":"]}),jsxRuntime.jsx("span",{className:"text-text-secondary",children:d(h)})]}),h.category&&jsxRuntime.jsxs("div",{className:"mt-0.5 flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"h-3 w-3",style:{backgroundColor:h.categoryColor||h.color,borderRadius:"1px"}}),jsxRuntime.jsx("span",{className:"text-sm text-text-secondary",children:a?.[h.category]||h.category})]})]},h.label))})]})})};var e5={top:20,right:20,bottom:50,left:60},Py=({data:e,width:t,height:r,margin:o=e5,color:n,yFormatter:a={type:"number"},showGrid:i=true,showAxes:s=true,animate:c=true,barRadius:l=4,barPadding:d=.3,onBarClick:u,onBarHover:p,activeIndex:m,className:f,style:g,"aria-label":b="Category bar chart",orientation:x="vertical",showTooltip:h=true})=>{let[y,v]=He.useState(null),[S,w]=He.useState(null),[N,D]=He.useState(null),[R,A]=He.useState(t??600),[O,P]=He.useState(r??300),T=He.useRef(null),k=m??y,V=He.useId(),H=n||"var(--color-viz-default)";He.useEffect(()=>{if(t!==void 0&&r!==void 0){A(t),P(r);return}if(!T.current)return;let M=new ResizeObserver(E=>{for(let z of E)t===void 0&&A(z.contentRect.width),r===void 0&&P(z.contentRect.height);});return M.observe(T.current),t===void 0&&A(T.current.offsetWidth),r===void 0&&P(T.current.offsetHeight||300),()=>{M.disconnect();}},[t,r]);let{xScale:I,yScale:q,innerWidth:j,innerHeight:K}=He.useMemo(()=>{let M=R-o.left-o.right,E=O-o.top-o.bottom;if(x==="horizontal"){let B=d3Array.max(e,C=>C.value)||0;return {xScale:scale.scaleLinear({range:[0,M],domain:[0,B*1.1],nice:true}),yScale:scale.scaleBand({range:[0,E],domain:e.map(C=>C.label),padding:d}),innerWidth:M,innerHeight:E}}let z=d3Array.max(e,B=>B.value)||0;return {xScale:scale.scaleBand({range:[0,M],domain:e.map(B=>B.label),padding:d}),yScale:scale.scaleLinear({range:[E,0],domain:[0,z*1.1],nice:true}),innerWidth:M,innerHeight:E}},[e,R,O,o,d,x]);if(e.length===0)return jsxRuntime.jsx("div",{ref:T,className:tailwindMerge.twMerge("flex h-full min-h-[200px] w-full items-center justify-center rounded-lg border border-dashed border-border-default bg-background-surface text-sm font-medium text-text-secondary",f),style:r!==void 0?{height:r,...g}:g,children:"No data available"});let Y=(M,E)=>{if(v(M),p?.(E,M),M!==null&&E){let z,B;if(x==="horizontal"){let W=I(E.value),G=q(E.label)||0,F=q.bandwidth();z=o.left+W,B=o.top+G+F/2;}else {let W=I,G=q,F=W(E.label)??0,Z=W.bandwidth(),_=G(E.value);z=o.left+F+Z/2,B=o.top+_;}let C=z>R/2;D(E.label),w({xValue:new Date,series:[{label:"Value",value:E.value,color:E.color||H}],x:z,y:B,position:C?"left":"right"});}else w(null),D(null);};return jsxRuntime.jsxs("div",{ref:T,className:tailwindMerge.twMerge("relative h-full w-full overflow-hidden rounded-lg bg-background-surface",f),style:r!==void 0?{height:r,...g}:g,"aria-label":b,role:"img",children:[jsxRuntime.jsxs("svg",{width:R,height:O,children:[jsxRuntime.jsx("defs",{children:jsxRuntime.jsx(gradient.LinearGradient,{id:`${V}-bar`,from:H,to:H,toOpacity:.85})}),jsxRuntime.jsxs(gs,{left:o.left,top:o.top,children:[i&&jsxRuntime.jsx("g",{className:"grid-lines",children:(x==="horizontal"?I.ticks(5):q.ticks(5)).map(M=>{let E=x==="horizontal"?0:q(M),z=x==="horizontal"?I(M):0;return jsxRuntime.jsx("line",{x1:x==="horizontal"?z:0,y1:x==="horizontal"?0:E,x2:x==="horizontal"?z:j,y2:x==="horizontal"?K:E,stroke:"var(--color-border-default)",strokeOpacity:.5,strokeDasharray:"2,3"},M)})}),e.map((M,E)=>{let z=k===E||k==null,B=M.color||`url(#${V}-bar)`;if(x==="horizontal"){let L=I(M.value),oe=q.bandwidth(),ie=q(M.label)||0;return jsxRuntime.jsx(framerMotion.motion.rect,{x:0,y:ie,width:L,height:oe,fill:B,rx:l,ry:l,initial:c?{width:0,opacity:.5}:void 0,animate:{width:L,opacity:z?1:.5},transition:{duration:.5,delay:E*.05,ease:"easeOut",opacity:{duration:.15,delay:0}},style:{cursor:u||p?"pointer":"default"},onMouseEnter:()=>Y(E,M),onMouseLeave:()=>Y(null,null),onClick:()=>u?.(M,E)},M.label)}let C=I,W=q,G=C.bandwidth(),F=C(M.label)??0,Z=W(M.value),_=Math.max(0,K-Z);return c?jsxRuntime.jsx(framerMotion.motion.rect,{x:F,width:G,fill:B,rx:l,ry:l,initial:{y:K,height:0,opacity:.5},animate:{y:Z,height:_,opacity:z?1:.5},transition:{duration:.5,delay:E*.05,ease:"easeOut",opacity:{duration:.15,delay:0}},style:{cursor:u||p?"pointer":"default"},onMouseEnter:()=>Y(E,M),onMouseLeave:()=>Y(null,null),onClick:()=>u?.(M,E)},M.label):jsxRuntime.jsx("rect",{x:F,y:Z,width:G,height:_,fill:B,rx:l,ry:l,opacity:z?1:.5,style:{cursor:u||p?"pointer":"default",transition:"opacity 150ms ease-out"},onMouseEnter:()=>Y(E,M),onMouseLeave:()=>Y(null,null),onClick:()=>u?.(M,E)},M.label)}),s&&x==="vertical"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Hr.CategoryBottom,{top:K,scale:I}),jsxRuntime.jsx(Hr.Left,{left:0,scale:q,yFormatter:a,height:K})]}),s&&x==="horizontal"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Hr.NumericBottom,{top:K,scale:I,yFormatter:a,width:j}),jsxRuntime.jsx(Hr.CategoryLeft,{left:0,scale:q})]})]})]}),h&&jsxRuntime.jsx(gn,{data:S,formatter:a,label:N??void 0})]})};var Ry=({item:e,onToggle:t})=>{let r=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"h-3 w-3 shrink-0",style:{backgroundColor:e.fill,borderRadius:"1px",opacity:e.isHidden?.35:1}}),jsxRuntime.jsx("span",{className:`text-sm whitespace-nowrap ${e.isHidden?"text-text-disabled line-through":"text-text-secondary"}`,children:e.category})]});return t?jsxRuntime.jsx("button",{type:"button",className:"flex items-center gap-2 shrink-0 rounded-sm focus:outline-none focus:ring-2 focus:ring-border-focus disabled:cursor-not-allowed disabled:opacity-60","aria-pressed":!e.isHidden,"aria-label":`${e.isHidden?"Show":"Hide"} ${e.category}`,disabled:e.isDisabled,onClick:()=>t(e.category),children:r}):jsxRuntime.jsx("div",{className:"flex items-center gap-2 shrink-0",children:r})},o5=({items:e,onToggle:t})=>e.length===0?null:jsxRuntime.jsx("div",{className:"flex items-center gap-3 flex-wrap",children:e.map(r=>jsxRuntime.jsx(Ry,{item:r,onToggle:t},r.category))}),pi=({items:e,onExport:t,marginLeft:r=0,marginRight:o=0,isZoomed:n=false,onResetZoom:a,onLegendItemToggle:i})=>{let[s,c]=He__namespace.default.useState(false),[l,d]=He__namespace.default.useState(null),[u,p]=He__namespace.default.useState(false),[m,f]=He__namespace.default.useState(false),g=He__namespace.default.useCallback(async x=>{c(true),d(x),f(false);try{await t(x);}catch(h){console.error("Export failed:",h);}finally{c(false),d(null);}},[t]),b=He__namespace.default.useCallback(async x=>{await g(x);},[g]);return jsxRuntime.jsxs("div",{className:"mt-4 flex items-center justify-between gap-3 min-h-[32px]",style:{marginLeft:r,marginRight:o},children:[jsxRuntime.jsx("div",{className:"hidden sm:block flex-1 min-w-0",children:jsxRuntime.jsx(o5,{items:e,onToggle:i})}),jsxRuntime.jsx("div",{className:"sm:hidden flex items-center gap-3",children:e.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{onClick:()=>p(true),className:"text-sm text-text-secondary hover:text-text-primary transition-colors underline decoration-dotted underline-offset-4",children:"Legend"}),jsxRuntime.jsx(ct,{isOpen:u,onClose:()=>p(false),title:"Legend",children:jsxRuntime.jsx("div",{className:"grid grid-cols-1 gap-3 p-4",children:e.map(x=>jsxRuntime.jsx(Ry,{item:x,onToggle:i},x.category))})})]})}),jsxRuntime.jsxs("div",{className:"sm:hidden flex items-center gap-2 shrink-0",children:[n&&a&&jsxRuntime.jsx(re,{variant:"secondary",size:"sm",onPress:a,children:jsxRuntime.jsx(U,{name:"ArrowsOut",size:16})}),jsxRuntime.jsx(re,{variant:"secondary",size:"sm",onPress:()=>f(true),isDisabled:s,children:jsxRuntime.jsx(U,{name:"Export",size:16})}),jsxRuntime.jsx(ct,{isOpen:m,onClose:()=>f(false),title:"Export Chart",contentPadding:false,children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsxs("button",{onClick:()=>g("csv"),disabled:s,className:"flex items-center gap-3 px-6 py-4 text-left hover:bg-background-hover active:bg-background-muted transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[jsxRuntime.jsx(U,{name:"List",size:20,className:"text-text-secondary"}),jsxRuntime.jsx("span",{className:"text-sm text-text-primary",children:l==="csv"?"Exporting...":"Export as CSV"})]}),jsxRuntime.jsxs("button",{onClick:()=>g("svg"),disabled:s,className:"flex items-center gap-3 px-6 py-4 text-left hover:bg-background-hover active:bg-background-muted transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[jsxRuntime.jsx(U,{name:"Code",size:20,className:"text-text-secondary"}),jsxRuntime.jsx("span",{className:"text-sm text-text-primary",children:l==="svg"?"Exporting...":"Export as SVG"})]}),jsxRuntime.jsxs("button",{onClick:()=>g("png"),disabled:s,className:"flex items-center gap-3 px-6 py-4 text-left hover:bg-background-hover active:bg-background-muted transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[jsxRuntime.jsx(U,{name:"DownloadSimple",size:20,className:"text-text-secondary"}),jsxRuntime.jsx("span",{className:"text-sm text-text-primary",children:l==="png"?"Exporting...":"Export as PNG"})]})]})})]}),jsxRuntime.jsxs("div",{className:"hidden sm:flex items-center gap-2 shrink-0",children:[n&&a&&jsxRuntime.jsxs(re,{variant:"secondary",size:"sm",onPress:a,children:[jsxRuntime.jsx(U,{name:"ArrowsOut",size:16}),jsxRuntime.jsx("span",{className:"hidden sm:inline",children:"Reset Zoom"})]}),jsxRuntime.jsxs(reactAriaComponents.DialogTrigger,{children:[jsxRuntime.jsxs(re,{variant:"secondary",size:"sm",isDisabled:s,children:[jsxRuntime.jsx(U,{name:"Export",size:16}),s?"Exporting...":"Export"]}),jsxRuntime.jsx(lt,{placement:"top end",className:"min-w-48 p-1 bg-background-surface rounded-lg shadow-xl ring-1 ring-border-default",children:jsxRuntime.jsxs(reactAriaComponents.Menu,{onAction:b,className:"outline-none",children:[jsxRuntime.jsx(reactAriaComponents.MenuItem,{id:"csv",className:"flex items-center gap-2 px-3 py-2 text-sm text-text-primary rounded cursor-pointer hover:bg-background-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus focus-visible:ring-offset-1 focus-visible:ring-offset-background-surface data-[focused]:bg-background-hover data-[focused]:ring-2 data-[focused]:ring-border-focus data-[focused]:ring-offset-1 data-[focused]:ring-offset-background-surface",isDisabled:s,children:jsxRuntime.jsxs("span",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(U,{name:"List",size:14}),l==="csv"?"Exporting...":"Export as CSV"]})}),jsxRuntime.jsx(reactAriaComponents.MenuItem,{id:"svg",className:"flex items-center gap-2 px-3 py-2 text-sm text-text-primary rounded cursor-pointer hover:bg-background-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus focus-visible:ring-offset-1 focus-visible:ring-offset-background-surface data-[focused]:bg-background-hover data-[focused]:ring-2 data-[focused]:ring-border-focus data-[focused]:ring-offset-1 data-[focused]:ring-offset-background-surface",isDisabled:s,children:jsxRuntime.jsxs("span",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(U,{name:"Code",size:14}),l==="svg"?"Exporting...":"Export as SVG"]})}),jsxRuntime.jsx(reactAriaComponents.MenuItem,{id:"png",className:"flex items-center gap-2 px-3 py-2 text-sm text-text-primary rounded cursor-pointer hover:bg-background-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus focus-visible:ring-offset-1 focus-visible:ring-offset-background-surface data-[focused]:bg-background-hover data-[focused]:ring-2 data-[focused]:ring-border-focus data-[focused]:ring-offset-1 data-[focused]:ring-offset-background-surface",isDisabled:s,children:jsxRuntime.jsxs("span",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(U,{name:"DownloadSimple",size:14}),l==="png"?"Exporting...":"Export as PNG"]})})]})})]})]})]})};var Um=({data:e,seriesMetadata:t,width:r,height:o,onBrushChange:n,brushRegion:a,margin:i=Ie,yDomain:s})=>{let c=He.useRef(null),l=He.useRef(false),d=He.useMemo(()=>e.flat(),[e]),u=He.useMemo(()=>({top:10,bottom:15,left:i.left,right:i.right}),[i]),p=r-u.left-u.right,m=He.useMemo(()=>{if(d.length===0)return scale.scaleTime({domain:[new Date,new Date],range:[0,p]});let h=new Date(Math.min(...d.map(v=>v.xValue.getTime()))),y=new Date(Math.max(...d.map(v=>v.xValue.getTime())));return scale.scaleTime({domain:[h,y],range:[0,p]})},[d,p]),f=He.useMemo(()=>{let h=d.length>0?Math.max(0,...d.map(y=>y.yValue)):1;return scale.scaleLinear({domain:s??[0,h],range:[o-u.bottom,u.top]})},[d,o,s,u.top,u.bottom]),g=h=>{if(l.current)return;if(!h){n(null);return}let{x0:y,x1:v}=h;if(y===v)return;let S=new Date(y),w=new Date(v);if(!(Number.isNaN(S.getTime())||Number.isNaN(w.getTime()))){if(d.length>0){let N=Math.min(...d.map(P=>P.xValue.getTime())),D=Math.max(...d.map(P=>P.xValue.getTime())),A=(D-N)*.05;if(Math.abs(S.getTime()-N)<A&&Math.abs(w.getTime()-D)<A){n(null);return}}n([S,w]);}},b=He.useMemo(()=>{if(d.length!==0)return {start:{x:0,y:u.top},end:{x:p,y:o-u.bottom}}},[p,o,d]);He.useEffect(()=>{if(!c.current||d.length===0)return;let h=c.current.state;if(h?.isBrushing||h?.activeHandle)return;let y=Math.min(...d.map(R=>R.xValue.getTime())),v=Math.max(...d.map(R=>R.xValue.getTime())),S=a?a[0]:new Date(y),w=a?a[1]:new Date(v),N=c.current.state?.extent;if(N){let R=m.invert(N.x0),A=m.invert(N.x1),O=Math.abs(R.getTime()-S.getTime()),P=Math.abs(A.getTime()-w.getTime());if(O<1e3&&P<1e3)return}l.current=true;let D=R=>{let A=c.current.getExtent({x:m(S),y:u.top},{x:m(w),y:o-u.bottom});return {...R,start:{y:A.y0,x:A.x0},end:{y:A.y1,x:A.x1},extent:A}};c.current.updateBrush(D),setTimeout(()=>{l.current=false;},50);},[a,m,o,d]);let x={fill:"url(#brush_pattern)",fillOpacity:.15,stroke:"var(--color-border-focus)",strokeWidth:1.5,strokeOpacity:.3};return jsxRuntime.jsx("div",{className:"mt-2",children:jsxRuntime.jsxs("svg",{width:r,height:o,children:[jsxRuntime.jsx(pattern.PatternLines,{id:"brush_pattern",height:8,width:8,stroke:"var(--color-text-secondary)",strokeWidth:1,orientation:["diagonal"]}),jsxRuntime.jsxs("g",{transform:`translate(${u.left}, 0)`,children:[e.map((h,y)=>jsxRuntime.jsx(shape.LinePath,{data:h,x:v=>m(v.xValue),y:v=>f(v.yValue),stroke:t[y]?.color||"var(--color-gray-500)",strokeWidth:1.5,opacity:.8},`brush-series-${y}`)),jsxRuntime.jsx(brush.Brush,{xScale:m,yScale:f,width:p,height:o-u.top-u.bottom,margin:{top:u.top,bottom:u.bottom,left:0,right:0},handleSize:8,innerRef:c,resizeTriggerAreas:["left","right"],brushDirection:"horizontal",initialBrushPosition:b,onChange:g,onClick:()=>n(null),selectedBoxStyle:x,useWindowMoveEvents:true})]})]})})};function Bo(e){switch(e){case "command":return Pt("--color-action-brand","#111111");case "success":return Pt("--color-feedback-success-border","#278a4a");case "warning":return Pt("--color-feedback-warning-border","#c88420");case "error":return Pt("--color-feedback-error-border","#c42d2d");case "alert":return Pt("--color-feedback-warning-border","#c88420");default:return Pt("--color-text-secondary","#525250")}}function Bc({events:e,color:t,showLabels:r=false}){let o=He.useContext(zr),[n,a]=He.useState(null);if(!o)return console.warn("ChartEventMarkers must be used within a ChartContainer"),null;let{xScale:i,yScale:s,height:c,tooltip:l,datasets:d,seriesMetadata:u,seriesTypes:p,categoryColors:m}=o,f=e.filter(x=>{let h=i(x.timestamp);return h>=Ie.left&&h<=i.range()[1]}),g=He.useCallback((x,h)=>{a(h);let y=i(x.timestamp),v=y>(i.range()[1]-Ie.right-Ie.left)/2+Ie.left,S=[];d&&u&&d.forEach((D,R)=>{if(D.length===0)return;let A=d3Array.bisector(V=>V.xValue).left,O=A(D,x.timestamp),P=D[O-1],T=D[O],k;if(!P)k=T;else if(!T)k=P;else {let V=Math.abs(x.timestamp.getTime()-P.xValue.getTime()),H=Math.abs(x.timestamp.getTime()-T.xValue.getTime());k=V<H?P:T;}k&&u[R]&&S.push({label:u[R].label,value:k.yValue,color:u[R].color,type:p?.[R]||"line",...k.category&&{category:k.category,categoryColor:m?.[k.category]}});});let N=f.filter(D=>Math.abs(i(D.timestamp)-y)<=10).map(D=>({label:D.label,color:t||Bo(D.type),metadata:D.metadata}));S.push({label:N.length>1?`${N.length} events`:x.label,value:0,color:t||Bo(x.type),type:"event"}),l.show({xValue:x.timestamp,series:S,x:y,y:S.length>1&&typeof S[0].value=="number"?s(S[0].value):c/2,position:v?"left":"right",isEvent:true,eventMetadata:x.metadata,eventItems:N});},[i,s,c,l,t,d,u,p,m,f]),b=He.useCallback(()=>{a(null),l.hide();},[l]);return f.length===0?null:jsxRuntime.jsx("g",{className:"chart-event-markers","data-testid":"chart-event-markers",children:f.map((x,h)=>{let y=i(x.timestamp),v=t||Bo(x.type),S=n===h;return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("line",{x1:y,y1:Ie.top,x2:y,y2:c-Ie.bottom,stroke:v,strokeWidth:S?3:2,strokeDasharray:"4 4",strokeOpacity:S?.9:.6,pointerEvents:"none"}),jsxRuntime.jsx("circle",{cx:y,cy:Ie.top,r:S?5:4,fill:v,stroke:"var(--color-background-surface)",strokeWidth:2,pointerEvents:"none"}),jsxRuntime.jsx("circle",{cx:y,cy:c-Ie.bottom,r:S?5:4,fill:v,stroke:"var(--color-background-surface)",strokeWidth:2,pointerEvents:"none"}),r&&jsxRuntime.jsx("text",{x:y,y:Ie.top-8,textAnchor:"middle",fill:"var(--color-text-secondary)",fontSize:11,fontWeight:500,pointerEvents:"none",children:x.label}),jsxRuntime.jsx("rect",{x:y-10,y:Ie.top,width:20,height:c-Ie.top-Ie.bottom,fill:"transparent",style:{cursor:"pointer"},onMouseEnter:()=>g(x,h),onMouseLeave:b})]},`${x.timestamp.getTime()}-${h}`)})})}function Vc({spans:e,opacity:t=.25,color:r}){let o=He.useContext(zr),[n,a]=He.useState(null),i=o?.xScale,s=o?.height,c=o?.tooltip,[l,d]=i?.domain()??[new Date(0),new Date(0)],[u,p]=i?.range()??[0,0],m=He.useCallback((S,w)=>{if(!i||!c)return;a(w);let N=S.start<l?l:S.start,D=S.end>d?d:S.end,R=(i(N)+i(D))/2,A=R>(p-u)/2+u,P=e.filter(T=>T.end>T.start&&T.start<S.end&&T.end>S.start).map(T=>({label:T.label,color:T.color??r??Bo(T.type),metadata:T.metadata}));c.show({xValue:S.start,series:[{label:P.length>1?`${P.length} scheduled commands`:S.label,value:0,color:S.color??r??Bo(S.type),type:"event"}],x:R,y:(s??0)/2,position:A?"left":"right",isEvent:true,eventMetadata:S.metadata,eventItems:P});},[i,s,c,r,l,d,u,p,e]),f=He.useCallback(()=>{a(null),c?.hide();},[c]);if(!o)return console.warn("ChartEventSpans must be used within a ChartContainer"),null;let{xScale:g,height:b}=o,x=Ie.top,y=b-Ie.bottom-x,v=e.filter(S=>S.end>S.start);return v.length===0?null:jsxRuntime.jsx("g",{className:"chart-event-spans","data-testid":"chart-event-spans",children:v.map((S,w)=>{let N=S.start<l?l:S.start,D=S.end>d?d:S.end;if(N>=d||D<=l)return null;let R=g(N),O=g(D)-R;if(O<=0)return null;let P=S.color??r??Bo(S.type);return jsxRuntime.jsx("rect",{x:R,y:x,width:O,height:y,fill:P,fillOpacity:n===w?Math.min((t??.25)*1.8,1):t??.25,pointerEvents:"all",style:{cursor:"pointer"},onMouseEnter:()=>m(S,w),onMouseLeave:f},`${S.start.getTime()}-${S.end.getTime()}-${w}`)})})}var ra=({data:e,color:t="var(--color-viz-default)",strokeWidth:r=3,strokeDasharray:o,categoryColors:n={},maxGapMs:a,animate:i=true})=>{let{xScale:s,yScale:c,animationSettings:l}=ta(),d=c.range(),u=Object.keys(n).length>0,p=h=>h.category?n[h.category]??t:t,m=h=>h.chartYValue??h.yValue,f=e.length===1?e[0]:void 0,g=a!=null?bc(e,a):e,b=f?jsxRuntime.jsx("circle",{cx:s(f.xValue),cy:c(m(f)),r,fill:u?p(f):t}):u?e.slice(0,-1).map((h,y)=>{let v=e[y+1];return a!=null&&a>0&&v.xValue.getTime()-h.xValue.getTime()>a?null:jsxRuntime.jsx(shape.LinePath,{data:[h,v],x:S=>s(S.xValue),y:S=>c(m(S)),stroke:p(h),strokeWidth:r,strokeDasharray:o,strokeLinecap:"round",curve:curve.curveLinear},`${h.xValue.getTime()}-${v.xValue.getTime()}`)}):jsxRuntime.jsx(shape.LinePath,{data:g,x:h=>h?s(h.xValue):0,y:h=>h?c(m(h)):0,defined:h=>h!=null,stroke:t,strokeWidth:r,strokeDasharray:o,strokeLinecap:"round",curve:curve.curveLinear}),x={transformOrigin:`0 ${d[0]}px`,transformBox:"fill-box",isolation:"isolate"};return i?jsxRuntime.jsx(framerMotion.motion.g,{initial:{scaleY:0},animate:{scaleY:1},transition:{duration:l.duration,ease:l.ease},style:x,children:b}):jsxRuntime.jsx("g",{style:x,children:b})};var Wy=e=>e.type===fn||e.type===ra||e.type===hc,C5=e=>e.type===Bc||e.type===Vc,S5=(e,t,r)=>{if(!e.tooltipRange||e.baseline===void 0)return;let o=typeof e.baseline=="function"?e.baseline(t,r):e.baseline;return typeof o=="number"&&Number.isFinite(o)&&o!==t.yValue?o:void 0},w5=d3Array.bisector(e=>e.xValue).left,T5=()=>jsxRuntime.jsx("div",{className:"flex h-full items-center justify-center",children:jsxRuntime.jsx("p",{className:"text-text-secondary",children:"No data available"})}),N5=()=>jsxRuntime.jsxs("div",{className:"flex h-full flex-col gap-4 p-4",children:[jsxRuntime.jsx(J,{className:"h-full w-full"}),jsxRuntime.jsxs("div",{className:"flex gap-4",children:[jsxRuntime.jsx(J,{className:"h-4 w-24"}),jsxRuntime.jsx(J,{className:"h-4 w-24"})]})]}),k5=({parentWidth:e,parentHeight:t,yFormatter:r={type:"number"},yDomain:o,referenceLines:n,isLoading:a=false,enableZoom:i=false,enableBrush:s=false,brushHeight:c=60,onZoomChange:l,zoomDomain:d,hiddenSeriesLabels:u,onHiddenSeriesChange:p,children:m})=>{let f=u!==void 0,g=d!==void 0,[b,x]=He.useState(null),[h,y]=He.useState(null),v=g?d:h,[S,w]=He.useState(()=>new Set),N=f?u:S,D=He.useRef(null),R=He.useRef(0),A=He.useRef(""),O=He.useRef(null),{colorMode:P}=Ht(),T=He.useMemo(()=>Bn(),[P]),k=He.useMemo(()=>ji(),[P]),{datasets:V,seriesMetadata:H,categoryInfo:I,categoryColors:q,categoryLabels:j,seriesTypes:K}=He.useMemo(()=>{let ue=He.Children.toArray(m).filter(De=>He.isValidElement(De)&&Wy(De)),Fe=ue.filter(De=>De.props.data).length,Ne=[],Oe=[],ot=[],ft=null,Le=null;ue.forEach((De,wt)=>{let Ae=De.props;if(!Ae.data)return;Ne.push(Ae.data);let za=("color"in Ae&&Ae.color?Ae.color:void 0)||(Fe===1?k:T[wt%T.length]),An=De.type===fn;Oe.push({label:"label"in Ae&&Ae.label||`Series ${Ne.length}`,color:za,...An&&"baseline"in Ae&&Ae.baseline!==void 0?{baseline:Ae.baseline,tooltipRange:"tooltipRange"in Ae&&Ae.tooltipRange||false}:{}});let xu=An?"area":De.type===ra?"line":"bar";ot.push(xu),"categoryColors"in Ae&&Ae.categoryColors&&(ft=Ae.categoryColors),"categoryLabels"in Ae&&Ae.categoryLabels&&(Le=Ae.categoryLabels);});let gt=null;if(ft){let De=new Set;Ne.forEach(wt=>{wt.forEach(Ae=>{Ae.category&&De.add(Ae.category);});}),gt=Array.from(De).map(wt=>({label:Le?.[wt]||wt,color:ft[wt]||"#6b7280"}));}return {datasets:Ne,seriesMetadata:Oe,categoryInfo:gt,categoryColors:ft,categoryLabels:Le,seriesTypes:ot}},[m,k,T,P]),Y=e,M=s?c+8:0,E=t-60-M,z=Math.max(100,E),B=He.useCallback($=>$?N.has($):false,[N]),C=He.useMemo(()=>H.map(($,ue)=>B($.label)?null:ue).filter($=>$!==null),[H,B]),W=He.useMemo(()=>C.map($=>V[$]).filter($=>!!$),[V,C]),G=He.useMemo(()=>C.map($=>H[$]).filter($=>!!$),[H,C]),F=He.useMemo(()=>C.map($=>K[$]).filter($=>!!$),[K,C]),Z=F.findIndex($=>$==="bar"),_=Z!==-1,L=He.useCallback(($,ue)=>{let Fe=$.has(ue);if(!Fe&&H.reduce((ot,ft)=>$.has(ft.label)||ft.label===ue?ot:ot+1,0)<1)return $;let Ne=new Set($);return Fe?Ne.delete(ue):Ne.add(ue),Ne},[H]),oe=He.useCallback($=>{if(f){let ue=u;if(!ue.has($)&&H.reduce((Oe,ot)=>ue.has(ot.label)||ot.label===$?Oe:Oe+1,0)<1){x(null);return}p?.(Ne=>L(Ne,$));}else w(ue=>L(ue,$));x(null);},[f,u,p,H,L]),ie=He.useMemo(()=>H.map($=>$.label).join(""),[H]),ne=He.useRef(ie);He.useEffect(()=>{ne.current!==ie&&(ne.current=ie,f||w($=>$.size===0?$:new Set));},[ie,f]);let ae=He.useMemo(()=>W.flat(),[W]),ce=He.useMemo(()=>{if(ae.length===0)return null;let $=[...ae].sort((ue,Fe)=>ue.xValue.getTime()-Fe.xValue.getTime());return [$[0].xValue,$[$.length-1].xValue]},[ae]),te=v||ce,ye=He.useCallback($=>{g?l?.($):y($);},[g,l]),qe=He.useMemo(()=>te?V.map(ue=>ue.filter(Fe=>Fe.xValue>=te[0]&&Fe.xValue<=te[1])):V,[V,te]),It=He.useMemo(()=>C.map($=>qe[$]??[]),[C,qe]);He.useEffect(()=>{l&&l(v);},[v,l]);let de=He.useMemo(()=>C.flatMap($=>qe[$]??[]),[qe,C]),le=He.useMemo(()=>bs(de,z,r,o),[de,z,r,o]),me=He.useRef(JSON.stringify(r)),Q=He.useRef(null),X=He.useMemo(()=>{let[$,ue]=le.domain(),Fe=Math.max(Math.abs($),Math.abs(ue)),Ne=JSON.stringify(r);if(Ne!==me.current&&(me.current=Ne,Q.current=null),Q.current!==null)return Q.current;if(Fe===0)return li(r,0);let Oe=li(r,Fe);return Q.current=Oe,Oe},[le,r]),be=He.useMemo(()=>{let $=z-Ie.top-Ie.bottom;return di($)},[z]),ee=He.useMemo(()=>{let $=Qr(X),ue=$.tickFormat||$.format,Ne=le.ticks(be).map(ft=>ue(ft)),Oe=ci(Ne,12,"system-ui"),ot=Math.ceil(Oe)+12;return {...Ie,left:Math.max(ot,30)}},[le,X,be]),ve=He.useMemo(()=>te?scale.scaleTime({domain:te,range:[ee.left,Y-ee.right]}):Wm(ae,Y),[te,ae,Y,ee]),rt=He.useCallback($=>{if(!ce)return;let{scaleX:ue,translateX:Fe}=$,Ne=Y-ee.left-ee.right,[Oe,ot]=ce,ft=ot.getTime()-Oe.getTime();if(ft<=0){ye(null);return}let Le=-Fe,gt=Le+Ne,De=Ne*ue/ft,wt=Le/De,Ae=gt/De,Ln=new Date(Oe.getTime()+wt),za=new Date(Oe.getTime()+Ae),An=Math.abs(Ln.getTime()-Oe.getTime()),xu=Math.abs(za.getTime()-ot.getTime()),Ag=ft*.02;An<Ag&&xu<Ag?ye(null):ye([Ln,za]);},[ce,Y,ee,ye]),Ft=He.useCallback($=>{let{left:ue}=D.current?.getBoundingClientRect()||{left:0},Fe=$.clientX-ue;if($.timeStamp-(R.current||0)<16)return;R.current=$.timeStamp;let Ne=ve.invert(Fe),Oe=It.map((Le,gt)=>{if(!Le||Le.length===0)return null;let De=w5(Le,Ne,1);if(De===0)return {point:Le[0],index:0,datasetIndex:gt};if(De>=Le.length)return {point:Le[Le.length-1],index:Le.length-1,datasetIndex:gt};let wt=Le[De-1],Ae=Le[De];if(!wt||!Ae)return null;let Ln=Math.abs(wt.xValue.getTime()-Ne.getTime()),za=Math.abs(Ae.xValue.getTime()-Ne.getTime()),An=Ln<za;return {point:An?wt:Ae,index:An?De-1:De,datasetIndex:gt}}).filter(Le=>Le!==null&&G[Le.datasetIndex]!==void 0).map(({point:Le,index:gt,datasetIndex:De})=>({label:G[De].label,value:Le.yValue,baselineValue:S5(G[De],Le,gt),color:G[De].color,point:Le,type:F[De]}));if(Oe.length===0){x(null);return}let ot=ve(Oe[0].point.xValue),ft=ot>(Y-ee.right-ee.left)/2+ee.left;x({xValue:Oe[0].point.xValue,series:Oe.map(({label:Le,value:gt,baselineValue:De,color:wt,point:Ae,type:Ln})=>({label:Le,value:gt,...De!==void 0?{baselineValue:De}:{},chartY:Ae.chartYValue??gt,showMarker:Ae.showTooltipMarker??true,color:wt,type:Ln,category:Ae.category,categoryColor:Ae.category&&q?q[Ae.category]:void 0})),x:ot,y:le(Oe[0].point.chartYValue??Oe[0].value),position:ft?"left":"right"});},[It,G,F,ve,le,Y,q,ee]),Ui=()=>{x(null);},En=He.useCallback(()=>{ye(null),O.current&&O.current.reset();},[ye]),Yt=He.useCallback($=>{if(!(O.current&&ce))return;let[ue,Fe]=ce,Ne=Fe.getTime()-ue.getTime();if(Ne<=0){O.current.reset();return}if(!$){O.current.reset();return}let[Oe,ot]=$,ft=ot.getTime()-Oe.getTime();if(ft<=0){O.current.reset();return}let Le=Ne/ft,gt=Y-ee.left-ee.right,wt=-((Oe.getTime()-ue.getTime())/Ne)*gt*Le;O.current.setTransformMatrix({scaleX:Le,scaleY:1,translateX:wt,translateY:0,skewX:0,skewY:0});},[ce,Y,ee]),gu=He.useCallback($=>{ye($),Yt($);},[ye,Yt]);He.useEffect(()=>{g&&Yt(d??null);},[g,d,Yt]);let bu={width:Y,height:z,xScale:ve,yScale:le,yFormatter:X,animationSettings:gc,tooltip:{data:b,show:x,hide:()=>x(null)},datasets:It,seriesMetadata:G,seriesTypes:F,categoryColors:q||void 0,categoryLabels:j||void 0},U1=He.Children.toArray(m),Dg=0,ml=[],Eg=[];U1.forEach($=>{if(!He.isValidElement($)){ml.push($);return}if(C5($))Eg.push($);else if(Wy($)){let ue=Dg;Dg++;let Fe=$.props,Ne=H[ue]?.label;if(B(Ne))return;ml.push(He__namespace.default.cloneElement($,{...Fe,data:qe[ue]||Fe.data,color:H[ue]?.color}));}else ml.push($);});let Y1=C.length,K1=(I||H).map($=>{let ue=!I&&B($.label);return {category:$.label,fill:$.color,isHidden:ue,isDisabled:!I&&!ue&&Y1<=1}}),q1=typeof r=="object"&&r!==null&&typeof r.type=="string",j1=Tl({datasets:W,metadata:{xLabel:"Date",yLabel:"Value",seriesLabels:G.map($=>$.label),timestamp:true,...q1?{yFormat:r}:{}},svgRef:D});if(a)return jsxRuntime.jsx(N5,{});if(V.length===0)return jsxRuntime.jsx(T5,{});let Lg=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("title",{children:"Data chart visualization"}),jsxRuntime.jsx("g",{children:le.ticks(be).map($=>{let ue=Math.abs($)<Number.EPSILON;return jsxRuntime.jsx(shape.Line,{from:{x:ee.left,y:le($)},to:{x:Y-ee.right,y:le($)},stroke:ue?"var(--color-border-default)":"var(--color-border-muted)",strokeWidth:ue?1.5:1},`grid-line-${$}`)})}),ml,n&&n.length>0&&jsxRuntime.jsx("g",{children:n.map($=>{let ue=le($.value),Fe=$.color??"var(--color-error-base)";return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx(shape.Line,{from:{x:ee.left,y:ue},to:{x:Y-ee.right,y:ue},stroke:Fe,strokeWidth:1.5,strokeDasharray:"6 4"}),$.label&&jsxRuntime.jsx("text",{x:Y-ee.right-4,y:ue-4,textAnchor:"end",fontSize:11,fill:Fe,children:$.label})]},`ref-line-${$.value}`)})}),jsxRuntime.jsx(Hr.Bottom,{top:z-ee.bottom,scale:ve,width:Y-ee.left-ee.right}),jsxRuntime.jsx(Hr.Left,{left:ee.left,scale:le,yFormatter:X,height:z-ee.top-ee.bottom}),b&&!b.isEvent&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[_?(()=>{let $=W[Z]??[];if($.length===0)return null;let ue=[...$].sort((De,wt)=>De.xValue.getTime()-wt.xValue.getTime()),Fe=ue.findIndex(De=>De.xValue.getTime()===b.xValue.getTime()),Ne=ue[Fe+1],Oe=ue.length>1&&Ne?Ne.xValue.getTime()-b.xValue.getTime():15*6e4,ot=Math.abs(ve(new Date(b.xValue.getTime()+Oe))-ve(b.xValue)),Le=ve(b.xValue)-ot/2,gt=le.range();return jsxRuntime.jsx("rect",{x:Le,y:gt[1],width:ot,height:gt[0]-gt[1],className:"fill-background-muted",opacity:.5,pointerEvents:"none",style:{transition:"all 100ms ease-out"}})})():null,b.series.filter($=>$.type!=="bar"&&$.showMarker!==false).map($=>jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("circle",{cx:ve(b.xValue),cy:le($.chartY??$.value),r:8,fill:"white",stroke:$.color,strokeWidth:2,style:{transition:"all 100ms ease-out"}}),jsxRuntime.jsx("circle",{cx:ve(b.xValue),cy:le($.chartY??$.value),r:4,fill:$.color,style:{transition:"all 100ms ease-out"}})]},`highlight-${$.label}`))]}),jsxRuntime.jsx("rect",{x:ee.left,y:ee.top,width:Y-ee.left-ee.right,height:z-ee.top-ee.bottom,fill:"transparent",style:{cursor:i?"grab":"crosshair",touchAction:"none"},onMouseMove:Ft,onMouseLeave:Ui}),Eg]});return jsxRuntime.jsx("div",{className:"relative flex h-full flex-col",children:jsxRuntime.jsxs(zr.Provider,{value:bu,children:[i?jsxRuntime.jsx(zoom.Zoom,{width:Y,height:z,scaleXMin:1,scaleXMax:20,scaleYMin:1,scaleYMax:1,constrain:$=>{let{scaleX:ue,translateX:Fe}=$,Ne=Math.max(1,Math.min(20,ue)),Oe=1,ot=Y-ee.left-ee.right,ft=0,Le=ot*(1-Ne),gt=Math.max(Le,Math.min(ft,Fe));return {...$,scaleX:Ne,scaleY:Oe,translateX:gt,translateY:0}},children:$=>{if(O.current=$,$.transformMatrix){let{scaleX:ue,translateX:Fe}=$.transformMatrix,Ne=`${ue.toFixed(4)}-${Fe.toFixed(2)}`;Ne!==A.current&&(A.current=Ne,setTimeout(()=>{rt($.transformMatrix);},0));}return jsxRuntime.jsx("svg",{width:Y,height:z,className:"overflow-visible",ref:ue=>{D.current=ue,$.containerRef.current!==ue&&($.containerRef.current=ue);},role:"img","aria-label":"Data chart",style:{cursor:$.isDragging?"grabbing":"grab",touchAction:"none"},onMouseDown:$.dragStart,onMouseMove:$.dragMove,onMouseUp:$.dragEnd,onMouseLeave:()=>{$.isDragging&&$.dragEnd();},onTouchStart:$.dragStart,onTouchMove:$.dragMove,onTouchEnd:$.dragEnd,children:Lg})}}):jsxRuntime.jsx("svg",{width:Y,height:z,className:"overflow-visible",ref:D,role:"img","aria-label":"Data chart",children:Lg}),jsxRuntime.jsx(gn,{data:b,formatter:X}),s&&ce&&jsxRuntime.jsx(Um,{data:W,seriesMetadata:G,width:Y,height:c,onBrushChange:gu,brushRegion:v,margin:ee,...o?{yDomain:o}:{}}),jsxRuntime.jsx(pi,{onExport:j1,items:K1,marginLeft:0,marginRight:ee.right,isZoomed:v!==null,onResetZoom:En,onLegendItemToggle:I?void 0:oe})]})})},Uy=responsive.withParentSize(k5);var L5=e=>e.toLocaleString(),A5=e=>`${Math.round(e*100)}%`,jy=({data:e,width:t=800,height:r=400,padding:o=0,barGap:n=30,formatValue:a=L5,formatPercentage:i=A5,color:s,showScale:c=true,showOverallConversion:l=true,overallConversionLabel:d="Overall Conversion:",activeStageId:u,onStageClick:p,onStageHover:m,className:f,style:g,"aria-label":b="Funnel chart"})=>{let[x,h]=He.useState(null),[y,v]=He.useState(t),S=He.useRef(null),w=u??x,N=He.useId(),D=s||"var(--color-viz-default)";He.useEffect(()=>{if(!S.current)return;let k=new ResizeObserver(V=>{for(let H of V)v(H.contentRect.width);});return k.observe(S.current),()=>{k.disconnect();}},[]);let{layout:R,overallConversion:A}=He.useMemo(()=>{if(e.length===0)return {layout:[],overallConversion:0};let k=e[0].value,V=l?60:0,H=r-o*2-V,I=(e.length-1)*n,q=(H-I)/e.length,j=e.map((Y,M)=>{let E=o+V+M*(q+n),z=k===0?0:Y.value/k,B=z,C=M===0?null:e[M-1].value,W=C==null||C===0?0:1-Y.value/C;return {stage:Y,index:M,y:E,barHeight:q,widthPercent:z,conversionRate:B,dropOff:W}}),K=k===0?0:e[e.length-1].value/k;return {layout:j,overallConversion:K,maxValue:k}},[e,y,r,o,n,c,l]);if(e.length===0)return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex h-full min-h-[280px] w-full items-center justify-center rounded-lg border border-dashed border-border-default bg-background-surface text-sm font-medium text-text-secondary",f),style:{width:t,height:r,...g},children:"No funnel data available"});let O=c?60:0,P=o+O,T=y-o*2-O;return jsxRuntime.jsx("div",{ref:S,className:tailwindMerge.twMerge("relative w-full overflow-hidden rounded-lg bg-background-surface",f),style:{height:r,...g},"aria-label":b,role:"img",children:jsxRuntime.jsxs("svg",{width:"100%",height:r,className:"relative",children:[jsxRuntime.jsxs("defs",{children:[jsxRuntime.jsx(gradient.LinearGradient,{id:`${N}-bar`,from:D,to:D,toOpacity:.85}),jsxRuntime.jsx(gradient.LinearGradient,{id:`${N}-bg`,from:D,to:D,fromOpacity:.01,toOpacity:.15,x1:"0",y1:"0",x2:"1",y2:"0"})]}),l&&jsxRuntime.jsxs("text",{x:P,y:o+20,className:"fill-text-primary text-sm font-medium",children:[jsxRuntime.jsx("tspan",{className:"fill-text-secondary",children:d})," ",i(A)]}),c&&jsxRuntime.jsx("g",{children:R.map(k=>{let V=k.y+k.barHeight/2;return jsxRuntime.jsx("text",{x:o+O-12,y:V,textAnchor:"end",dominantBaseline:"middle",className:"fill-text-secondary text-xs",children:i(k.conversionRate)},k.stage.id)})}),R.map(k=>{let V=w===k.stage.id,H=T*k.widthPercent;return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:P,y:k.y,width:T,height:k.barHeight,fill:`url(#${N}-bg)`,rx:4}),jsxRuntime.jsx(framerMotion.motion.rect,{x:P,y:k.y,width:H,height:k.barHeight,fill:`url(#${N}-bar)`,rx:4,initial:{width:0},animate:{width:H},transition:{duration:.6,delay:k.index*.1,ease:"easeOut"},opacity:V||w==null?1:.5,style:{cursor:p||m?"pointer":"default",transition:"opacity 150ms ease"},onMouseEnter:()=>{h(k.stage.id),m?.(k.stage);},onMouseLeave:()=>{h(null),m?.(null);},onClick:()=>p?.(k.stage)}),jsxRuntime.jsx("rect",{x:P+10,y:k.y+k.barHeight/2-10,width:70,height:20,className:"fill-background-surface stroke-border-default",strokeWidth:1,rx:4,style:{pointerEvents:"none"}}),jsxRuntime.jsx("text",{x:P+16,y:k.y+k.barHeight/2+4,className:"fill-text-primary text-xs font-semibold",style:{pointerEvents:"none"},children:a(k.stage.value)}),jsxRuntime.jsxs("text",{x:P,y:k.y-8,className:"fill-text-secondary text-xs",style:{pointerEvents:"none"},children:[jsxRuntime.jsx("tspan",{children:k.index+1})," ",k.stage.label]}),k.stage.secondaryValue&&jsxRuntime.jsx("text",{x:P+16,y:k.y-24,className:"fill-text-secondary text-xs",style:{pointerEvents:"none"},children:k.stage.secondaryValue}),k.index>0&&k.dropOff>0&&jsxRuntime.jsxs("text",{x:P+T,y:k.y-8,textAnchor:"end",className:"fill-text-secondary text-xs",children:[i(k.dropOff)," drop"]}),k.stage.annotation&&jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:P+H+8,y:k.y+8,width:60,height:24,rx:3,className:"fill-background-muted"}),jsxRuntime.jsx("text",{x:P+H+16,y:k.y+20,className:"fill-text-secondary text-xs font-medium",children:k.stage.annotation})]})]},k.stage.id)})]})})};var F5=d3Array.bisector(e=>e.xValue).left,B5=(e,t,r)=>{if(!e.tooltipRange||e.baseline===void 0)return;let o=typeof e.baseline=="function"?e.baseline(t,r):e.baseline;return typeof o=="number"&&Number.isFinite(o)&&o!==t.yValue?o:void 0};function Jy(e){let{mouseX:t,datasets:r,seriesMetadata:o,seriesTypes:n,xScale:a,yScale:i,plotLeft:s,plotRight:c}=e,l=a.invert(t),d=r.map((m,f)=>{if(!m||m.length===0)return null;let g=F5(m,l,1);if(g===0)return {point:m[0],index:0,datasetIndex:f};if(g>=m.length)return {point:m[m.length-1],index:m.length-1,datasetIndex:f};let b=m[g-1],x=m[g];if(!b||!x)return null;let h=Math.abs(b.xValue.getTime()-l.getTime()),y=Math.abs(x.xValue.getTime()-l.getTime()),v=h<y;return {point:v?b:x,index:v?g-1:g,datasetIndex:f}}).filter(m=>m!==null&&o[m.datasetIndex]!==void 0).map(({point:m,index:f,datasetIndex:g})=>({label:o[g].label,value:m.yValue,baselineValue:B5(o[g],m,f),color:o[g].color,point:m,type:n[g]}));if(d.length===0)return null;let u=a(d[0].point.xValue),p=u>(s+c)/2;return {xValue:d[0].point.xValue,series:d.map(({label:m,value:f,baselineValue:g,color:b,point:x,type:h})=>({label:m,value:f,...g!==void 0?{baselineValue:g}:{},chartY:x.chartYValue??f,showMarker:x.showTooltipMarker??true,color:b,type:h,...x.category!==void 0?{category:x.category}:{}})),x:u,y:i(d[0].point.chartYValue??d[0].value),position:p?"left":"right"}}function $y(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Oc(e,t,r){e.prototype=t.prototype=r,r.constructor=e;}function qm(e,t){var r=Object.create(e.prototype);for(var o in t)r[o]=t[o];return r}function ks(){}var Ts=.7,Wc=1/Ts,fi="\\s*([+-]?\\d+)\\s*",Ns="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",yo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",V5=/^#([0-9a-f]{3,8})$/,O5=new RegExp(`^rgb\\(${fi},${fi},${fi}\\)$`),z5=new RegExp(`^rgb\\(${yo},${yo},${yo}\\)$`),H5=new RegExp(`^rgba\\(${fi},${fi},${fi},${Ns}\\)$`),W5=new RegExp(`^rgba\\(${yo},${yo},${yo},${Ns}\\)$`),G5=new RegExp(`^hsl\\(${Ns},${yo},${yo}\\)$`),U5=new RegExp(`^hsla\\(${Ns},${yo},${yo},${Ns}\\)$`),Xy={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Oc(ks,bn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Zy,formatHex:Zy,formatHex8:Y5,formatHsl:K5,formatRgb:Qy,toString:Qy});function Zy(){return this.rgb().formatHex()}function Y5(){return this.rgb().formatHex8()}function K5(){return nv(this).formatHsl()}function Qy(){return this.rgb().formatRgb()}function bn(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=V5.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?_y(t):r===3?new dr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?zc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?zc(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=O5.exec(e))?new dr(t[1],t[2],t[3],1):(t=z5.exec(e))?new dr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=H5.exec(e))?zc(t[1],t[2],t[3],t[4]):(t=W5.exec(e))?zc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=G5.exec(e))?rv(t[1],t[2]/100,t[3]/100,1):(t=U5.exec(e))?rv(t[1],t[2]/100,t[3]/100,t[4]):Xy.hasOwnProperty(e)?_y(Xy[e]):e==="transparent"?new dr(NaN,NaN,NaN,0):null}function _y(e){return new dr(e>>16&255,e>>8&255,e&255,1)}function zc(e,t,r,o){return o<=0&&(e=t=r=NaN),new dr(e,t,r,o)}function q5(e){return e instanceof ks||(e=bn(e)),e?(e=e.rgb(),new dr(e.r,e.g,e.b,e.opacity)):new dr}function gi(e,t,r,o){return arguments.length===1?q5(e):new dr(e,t,r,o??1)}function dr(e,t,r,o){this.r=+e,this.g=+t,this.b=+r,this.opacity=+o;}Oc(dr,gi,qm(ks,{brighter(e){return e=e==null?Wc:Math.pow(Wc,e),new dr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ts:Math.pow(Ts,e),new dr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new dr(sa(this.r),sa(this.g),sa(this.b),Gc(this.opacity))},displayable(){return -0.5<=this.r&&this.r<255.5&&-0.5<=this.g&&this.g<255.5&&-0.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ev,formatHex:ev,formatHex8:j5,formatRgb:tv,toString:tv}));function ev(){return `#${ia(this.r)}${ia(this.g)}${ia(this.b)}`}function j5(){return `#${ia(this.r)}${ia(this.g)}${ia(this.b)}${ia((isNaN(this.opacity)?1:this.opacity)*255)}`}function tv(){let e=Gc(this.opacity);return `${e===1?"rgb(":"rgba("}${sa(this.r)}, ${sa(this.g)}, ${sa(this.b)}${e===1?")":`, ${e})`}`}function Gc(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function sa(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ia(e){return e=sa(e),(e<16?"0":"")+e.toString(16)}function rv(e,t,r,o){return o<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new _r(e,t,r,o)}function nv(e){if(e instanceof _r)return new _r(e.h,e.s,e.l,e.opacity);if(e instanceof ks||(e=bn(e)),!e)return new _r;if(e instanceof _r)return e;e=e.rgb();var t=e.r/255,r=e.g/255,o=e.b/255,n=Math.min(t,r,o),a=Math.max(t,r,o),i=NaN,s=a-n,c=(a+n)/2;return s?(t===a?i=(r-o)/s+(r<o)*6:r===a?i=(o-t)/s+2:i=(t-r)/s+4,s/=c<.5?a+n:2-a-n,i*=60):s=c>0&&c<1?0:i,new _r(i,s,c,e.opacity)}function av(e,t,r,o){return arguments.length===1?nv(e):new _r(e,t,r,o??1)}function _r(e,t,r,o){this.h=+e,this.s=+t,this.l=+r,this.opacity=+o;}Oc(_r,av,qm(ks,{brighter(e){return e=e==null?Wc:Math.pow(Wc,e),new _r(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ts:Math.pow(Ts,e),new _r(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,o=r+(r<.5?r:1-r)*t,n=2*r-o;return new dr(jm(e>=240?e-240:e+120,n,o),jm(e,n,o),jm(e<120?e+240:e-120,n,o),this.opacity)},clamp(){return new _r(ov(this.h),Hc(this.s),Hc(this.l),Gc(this.opacity))},displayable(){return (0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=Gc(this.opacity);return `${e===1?"hsl(":"hsla("}${ov(this.h)}, ${Hc(this.s)*100}%, ${Hc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ov(e){return e=(e||0)%360,e<0?e+360:e}function Hc(e){return Math.max(0,Math.min(1,e||0))}function jm(e,t,r){return (e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}var Ps=e=>()=>e;function J5(e,t){return function(r){return e+r*t}}function $5(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(o){return Math.pow(e+o*t,r)}}function lv(e){return (e=+e)==1?Uc:function(t,r){return r-t?$5(t,r,e):Ps(isNaN(t)?r:t)}}function Uc(e,t){var r=t-e;return r?J5(e,r):Ps(isNaN(e)?t:e)}var $m=(function e(t){var r=lv(t);function o(n,a){var i=r((n=gi(n)).r,(a=gi(a)).r),s=r(n.g,a.g),c=r(n.b,a.b),l=Uc(n.opacity,a.opacity);return function(d){return n.r=i(d),n.g=s(d),n.b=c(d),n.opacity=l(d),n+""}}return o.gamma=e,o})(1);function dv(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,o=t.slice(),n;return function(a){for(n=0;n<r;++n)o[n]=e[n]*(1-a)+t[n]*a;return o}}function uv(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function pv(e,t){var r=t?t.length:0,o=e?Math.min(r,e.length):0,n=new Array(o),a=new Array(r),i;for(i=0;i<o;++i)n[i]=la(e[i],t[i]);for(;i<r;++i)a[i]=t[i];return function(s){for(i=0;i<o;++i)a[i]=n[i](s);return a}}function mv(e,t){var r=new Date;return e=+e,t=+t,function(o){return r.setTime(e*(1-o)+t*o),r}}function xn(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function fv(e,t){var r={},o={},n;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(n in t)n in e?r[n]=la(e[n],t[n]):o[n]=t[n];return function(a){for(n in r)o[n]=r[n](a);return o}}var Zm=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Xm=new RegExp(Zm.source,"g");function X5(e){return function(){return e}}function Z5(e){return function(t){return e(t)+""}}function gv(e,t){var r=Zm.lastIndex=Xm.lastIndex=0,o,n,a,i=-1,s=[],c=[];for(e=e+"",t=t+"";(o=Zm.exec(e))&&(n=Xm.exec(t));)(a=n.index)>r&&(a=t.slice(r,a),s[i]?s[i]+=a:s[++i]=a),(o=o[0])===(n=n[0])?s[i]?s[i]+=n:s[++i]=n:(s[++i]=null,c.push({i,x:xn(o,n)})),r=Xm.lastIndex;return r<t.length&&(a=t.slice(r),s[i]?s[i]+=a:s[++i]=a),s.length<2?c[0]?Z5(c[0].x):X5(t):(t=c.length,function(l){for(var d=0,u;d<t;++d)s[(u=c[d]).i]=u.x(l);return s.join("")})}function la(e,t){var r=typeof t,o;return t==null||r==="boolean"?Ps(t):(r==="number"?xn:r==="string"?(o=bn(t))?(t=o,$m):gv:t instanceof bn?$m:t instanceof Date?mv:uv(t)?dv:Array.isArray(t)?pv:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?fv:xn)(e,t)}function Qm(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function _m(e){return function(){return e}}function ef(e){return +e}var bv=[0,1];function bi(e){return e}function tf(e,t){return (t-=e=+e)?function(r){return (r-e)/t}:_m(isNaN(t)?NaN:.5)}function _5(e,t){var r;return e>t&&(r=e,e=t,t=r),function(o){return Math.max(e,Math.min(t,o))}}function e4(e,t,r){var o=e[0],n=e[1],a=t[0],i=t[1];return n<o?(o=tf(n,o),a=r(i,a)):(o=tf(o,n),a=r(a,i)),function(s){return a(o(s))}}function t4(e,t,r){var o=Math.min(e.length,t.length)-1,n=new Array(o),a=new Array(o),i=-1;for(e[o]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++i<o;)n[i]=tf(e[i],e[i+1]),a[i]=r(t[i],t[i+1]);return function(s){var c=d3Array.bisect(e,s,1,o)-1;return a[c](n[c](s))}}function xv(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function r4(){var e=bv,t=bv,r=la,o,n,a,i=bi,s,c,l;function d(){var p=Math.min(e.length,t.length);return i!==bi&&(i=_5(e[0],e[p-1])),s=p>2?t4:e4,c=l=null,u}function u(p){return p==null||isNaN(p=+p)?a:(c||(c=s(e.map(o),t,r)))(o(i(p)))}return u.invert=function(p){return i(n((l||(l=s(t,e.map(o),xn)))(p)))},u.domain=function(p){return arguments.length?(e=Array.from(p,ef),d()):e.slice()},u.range=function(p){return arguments.length?(t=Array.from(p),d()):t.slice()},u.rangeRound=function(p){return t=Array.from(p),r=Qm,d()},u.clamp=function(p){return arguments.length?(i=p?true:bi,d()):i!==bi},u.interpolate=function(p){return arguments.length?(r=p,d()):r},u.unknown=function(p){return arguments.length?(a=p,u):a},function(p,m){return o=p,n=m,d()}}function rf(){return r4()(bi,bi)}function of(e,t){e=e.slice();var r=0,o=e.length-1,n=e[r],a=e[o],i;return a<n&&(i=r,r=o,o=i,i=n,n=a,a=i),e[r]=t.floor(n),e[o]=t.ceil(a),e}var nf=new Date,af=new Date;function Je(e,t,r,o){function n(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return n.floor=a=>(e(a=new Date(+a)),a),n.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),n.round=a=>{let i=n(a),s=n.ceil(a);return a-i<s-a?i:s},n.offset=(a,i)=>(t(a=new Date(+a),i==null?1:Math.floor(i)),a),n.range=(a,i,s)=>{let c=[];if(a=n.ceil(a),s=s==null?1:Math.floor(s),!(a<i)||!(s>0))return c;let l;do c.push(l=new Date(+a)),t(a,s),e(a);while(l<a&&a<i);return c},n.filter=a=>Je(i=>{if(i>=i)for(;e(i),!a(i);)i.setTime(i-1);},(i,s)=>{if(i>=i)if(s<0)for(;++s<=0;)for(;t(i,-1),!a(i););else for(;--s>=0;)for(;t(i,1),!a(i););}),r&&(n.count=(a,i)=>(nf.setTime(+a),af.setTime(+i),e(nf),e(af),Math.floor(r(nf,af))),n.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?n.filter(o?i=>o(i)%a===0:i=>n.count(0,i)%a===0):n)),n}var Rs=Je(()=>{},(e,t)=>{e.setTime(+e+t);},(e,t)=>t-e);Rs.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Je(t=>{t.setTime(Math.floor(t/e)*e);},(t,r)=>{t.setTime(+t+r*e);},(t,r)=>(r-t)/e):Rs);Rs.range;var vo=Je(e=>{e.setTime(e-e.getMilliseconds());},(e,t)=>{e.setTime(+e+t*1e3);},(e,t)=>(t-e)/1e3,e=>e.getUTCSeconds());vo.range;var xi=Je(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*1e3);},(e,t)=>{e.setTime(+e+t*6e4);},(e,t)=>(t-e)/6e4,e=>e.getMinutes());xi.range;var Yc=Je(e=>{e.setUTCSeconds(0,0);},(e,t)=>{e.setTime(+e+t*6e4);},(e,t)=>(t-e)/6e4,e=>e.getUTCMinutes());Yc.range;var hi=Je(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*1e3-e.getMinutes()*6e4);},(e,t)=>{e.setTime(+e+t*36e5);},(e,t)=>(t-e)/36e5,e=>e.getHours());hi.range;var Kc=Je(e=>{e.setUTCMinutes(0,0,0);},(e,t)=>{e.setTime(+e+t*36e5);},(e,t)=>(t-e)/36e5,e=>e.getUTCHours());Kc.range;var Oo=Je(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/864e5,e=>e.getDate()-1);Oo.range;var Ds=Je(e=>{e.setUTCHours(0,0,0,0);},(e,t)=>{e.setUTCDate(e.getUTCDate()+t);},(e,t)=>(t-e)/864e5,e=>e.getUTCDate()-1);Ds.range;var qc=Je(e=>{e.setUTCHours(0,0,0,0);},(e,t)=>{e.setUTCDate(e.getUTCDate()+t);},(e,t)=>(t-e)/864e5,e=>Math.floor(e/864e5));qc.range;function ua(e){return Je(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0);},(t,r)=>{t.setDate(t.getDate()+r*7);},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/6048e5)}var zo=ua(0),yi=ua(1),vv=ua(2),Cv=ua(3),hn=ua(4),Sv=ua(5),wv=ua(6);zo.range;yi.range;vv.range;Cv.range;hn.range;Sv.range;wv.range;function pa(e){return Je(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0);},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7);},(t,r)=>(r-t)/6048e5)}var ma=pa(0),vi=pa(1),Nv=pa(2),kv=pa(3),yn=pa(4),Pv=pa(5),Rv=pa(6);ma.range;vi.range;Nv.range;kv.range;yn.range;Pv.range;Rv.range;var Ci=Je(e=>{e.setDate(1),e.setHours(0,0,0,0);},(e,t)=>{e.setMonth(e.getMonth()+t);},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Ci.range;var jc=Je(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0);},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t);},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());jc.range;var Nr=Je(e=>{e.setMonth(0,1),e.setHours(0,0,0,0);},(e,t)=>{e.setFullYear(e.getFullYear()+t);},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Nr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Je(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0);},(t,r)=>{t.setFullYear(t.getFullYear()+r*e);});Nr.range;var eo=Je(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t);},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());eo.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Je(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e);});eo.range;function Lv(e,t,r,o,n,a){let i=[[vo,1,1e3],[vo,5,5*1e3],[vo,15,15*1e3],[vo,30,30*1e3],[a,1,6e4],[a,5,5*6e4],[a,15,15*6e4],[a,30,30*6e4],[n,1,36e5],[n,3,3*36e5],[n,6,6*36e5],[n,12,12*36e5],[o,1,864e5],[o,2,2*864e5],[r,1,6048e5],[t,1,2592e6],[t,3,3*2592e6],[e,1,31536e6]];function s(l,d,u){let p=d<l;p&&([l,d]=[d,l]);let m=u&&typeof u.range=="function"?u:c(l,d,u),f=m?m.range(l,+d+1):[];return p?f.reverse():f}function c(l,d,u){let p=Math.abs(d-l)/u,m=d3Array.bisector(([,,b])=>b).right(i,p);if(m===i.length)return e.every(d3Array.tickStep(l/31536e6,d/31536e6,u));if(m===0)return Rs.every(Math.max(d3Array.tickStep(l,d,u),1));let[f,g]=i[p/i[m-1][2]<i[m][2]/p?m-1:m];return f.every(g)}return [s,c]}var [sf,lf]=Lv(Nr,Ci,zo,Oo,hi,xi);function cf(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function df(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Es(e,t,r){return {y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function uf(e){var t=e.dateTime,r=e.date,o=e.time,n=e.periods,a=e.days,i=e.shortDays,s=e.months,c=e.shortMonths,l=Ls(n),d=As(n),u=Ls(a),p=As(a),m=Ls(i),f=As(i),g=Ls(s),b=As(s),x=Ls(c),h=As(c),y={a:I,A:q,b:j,B:K,c:null,d:Ov,e:Ov,f:Q4,g:lM,G:dM,H:$4,I:X4,j:Z4,L:Uv,m:_4,M:eM,p:Y,q:M,Q:Wv,s:Gv,S:tM,u:rM,U:oM,V:nM,w:aM,W:iM,x:null,X:null,y:sM,Y:cM,Z:uM,"%":Hv},v={a:E,A:z,b:B,B:C,c:null,d:zv,e:zv,f:gM,g:NM,G:PM,H:pM,I:mM,j:fM,L:Kv,m:bM,M:xM,p:W,q:G,Q:Wv,s:Gv,S:hM,u:yM,U:vM,V:CM,w:SM,W:wM,x:null,X:null,y:TM,Y:kM,Z:RM,"%":Hv},S={a:A,A:O,b:P,B:T,c:k,d:Bv,e:Bv,f:K4,g:Fv,G:Iv,H:Vv,I:Vv,j:W4,L:Y4,m:H4,M:G4,p:R,q:z4,Q:j4,s:J4,S:U4,u:I4,U:F4,V:B4,w:A4,W:V4,x:V,X:H,y:Fv,Y:Iv,Z:O4,"%":q4};y.x=w(r,y),y.X=w(o,y),y.c=w(t,y),v.x=w(r,v),v.X=w(o,v),v.c=w(t,v);function w(F,Z){return function(_){var L=[],oe=-1,ie=0,ne=F.length,ae,ce,Ce;for(_ instanceof Date||(_=new Date(+_));++oe<ne;)F.charCodeAt(oe)===37&&(L.push(F.slice(ie,oe)),(ce=Av[ae=F.charAt(++oe)])!=null?ae=F.charAt(++oe):ce=ae==="e"?" ":"0",(Ce=Z[ae])&&(ae=Ce(_,ce)),L.push(ae),ie=oe+1);return L.push(F.slice(ie,oe)),L.join("")}}function N(F,Z){return function(_){var L=Es(1900,void 0,1),oe=D(L,F,_+="",0),ie,ne;if(oe!=_.length)return null;if("Q"in L)return new Date(L.Q);if("s"in L)return new Date(L.s*1e3+("L"in L?L.L:0));if(Z&&!("Z"in L)&&(L.Z=0),"p"in L&&(L.H=L.H%12+L.p*12),L.m===void 0&&(L.m="q"in L?L.q:0),"V"in L){if(L.V<1||L.V>53)return null;"w"in L||(L.w=1),"Z"in L?(ie=df(Es(L.y,0,1)),ne=ie.getUTCDay(),ie=ne>4||ne===0?vi.ceil(ie):vi(ie),ie=Ds.offset(ie,(L.V-1)*7),L.y=ie.getUTCFullYear(),L.m=ie.getUTCMonth(),L.d=ie.getUTCDate()+(L.w+6)%7):(ie=cf(Es(L.y,0,1)),ne=ie.getDay(),ie=ne>4||ne===0?yi.ceil(ie):yi(ie),ie=Oo.offset(ie,(L.V-1)*7),L.y=ie.getFullYear(),L.m=ie.getMonth(),L.d=ie.getDate()+(L.w+6)%7);}else ("W"in L||"U"in L)&&("w"in L||(L.w="u"in L?L.u%7:"W"in L?1:0),ne="Z"in L?df(Es(L.y,0,1)).getUTCDay():cf(Es(L.y,0,1)).getDay(),L.m=0,L.d="W"in L?(L.w+6)%7+L.W*7-(ne+5)%7:L.w+L.U*7-(ne+6)%7);return "Z"in L?(L.H+=L.Z/100|0,L.M+=L.Z%100,df(L)):cf(L)}}function D(F,Z,_,L){for(var oe=0,ie=Z.length,ne=_.length,ae,ce;oe<ie;){if(L>=ne)return -1;if(ae=Z.charCodeAt(oe++),ae===37){if(ae=Z.charAt(oe++),ce=S[ae in Av?Z.charAt(oe++):ae],!ce||(L=ce(F,_,L))<0)return -1}else if(ae!=_.charCodeAt(L++))return -1}return L}function R(F,Z,_){var L=l.exec(Z.slice(_));return L?(F.p=d.get(L[0].toLowerCase()),_+L[0].length):-1}function A(F,Z,_){var L=m.exec(Z.slice(_));return L?(F.w=f.get(L[0].toLowerCase()),_+L[0].length):-1}function O(F,Z,_){var L=u.exec(Z.slice(_));return L?(F.w=p.get(L[0].toLowerCase()),_+L[0].length):-1}function P(F,Z,_){var L=x.exec(Z.slice(_));return L?(F.m=h.get(L[0].toLowerCase()),_+L[0].length):-1}function T(F,Z,_){var L=g.exec(Z.slice(_));return L?(F.m=b.get(L[0].toLowerCase()),_+L[0].length):-1}function k(F,Z,_){return D(F,t,Z,_)}function V(F,Z,_){return D(F,r,Z,_)}function H(F,Z,_){return D(F,o,Z,_)}function I(F){return i[F.getDay()]}function q(F){return a[F.getDay()]}function j(F){return c[F.getMonth()]}function K(F){return s[F.getMonth()]}function Y(F){return n[+(F.getHours()>=12)]}function M(F){return 1+~~(F.getMonth()/3)}function E(F){return i[F.getUTCDay()]}function z(F){return a[F.getUTCDay()]}function B(F){return c[F.getUTCMonth()]}function C(F){return s[F.getUTCMonth()]}function W(F){return n[+(F.getUTCHours()>=12)]}function G(F){return 1+~~(F.getUTCMonth()/3)}return {format:function(F){var Z=w(F+="",y);return Z.toString=function(){return F},Z},parse:function(F){var Z=N(F+="",false);return Z.toString=function(){return F},Z},utcFormat:function(F){var Z=w(F+="",v);return Z.toString=function(){return F},Z},utcParse:function(F){var Z=N(F+="",true);return Z.toString=function(){return F},Z}}}var Av={"-":"",_:" ",0:"0"},Lt=/^\s*\d+/,D4=/^%/,E4=/[\\^$*+?|[\]().{}]/g;function Ve(e,t,r){var o=e<0?"-":"",n=(o?-e:e)+"",a=n.length;return o+(a<r?new Array(r-a+1).join(t)+n:n)}function L4(e){return e.replace(E4,"\\$&")}function Ls(e){return new RegExp("^(?:"+e.map(L4).join("|")+")","i")}function As(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function A4(e,t,r){var o=Lt.exec(t.slice(r,r+1));return o?(e.w=+o[0],r+o[0].length):-1}function I4(e,t,r){var o=Lt.exec(t.slice(r,r+1));return o?(e.u=+o[0],r+o[0].length):-1}function F4(e,t,r){var o=Lt.exec(t.slice(r,r+2));return o?(e.U=+o[0],r+o[0].length):-1}function B4(e,t,r){var o=Lt.exec(t.slice(r,r+2));return o?(e.V=+o[0],r+o[0].length):-1}function V4(e,t,r){var o=Lt.exec(t.slice(r,r+2));return o?(e.W=+o[0],r+o[0].length):-1}function Iv(e,t,r){var o=Lt.exec(t.slice(r,r+4));return o?(e.y=+o[0],r+o[0].length):-1}function Fv(e,t,r){var o=Lt.exec(t.slice(r,r+2));return o?(e.y=+o[0]+(+o[0]>68?1900:2e3),r+o[0].length):-1}function O4(e,t,r){var o=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return o?(e.Z=o[1]?0:-(o[2]+(o[3]||"00")),r+o[0].length):-1}function z4(e,t,r){var o=Lt.exec(t.slice(r,r+1));return o?(e.q=o[0]*3-3,r+o[0].length):-1}function H4(e,t,r){var o=Lt.exec(t.slice(r,r+2));return o?(e.m=o[0]-1,r+o[0].length):-1}function Bv(e,t,r){var o=Lt.exec(t.slice(r,r+2));return o?(e.d=+o[0],r+o[0].length):-1}function W4(e,t,r){var o=Lt.exec(t.slice(r,r+3));return o?(e.m=0,e.d=+o[0],r+o[0].length):-1}function Vv(e,t,r){var o=Lt.exec(t.slice(r,r+2));return o?(e.H=+o[0],r+o[0].length):-1}function G4(e,t,r){var o=Lt.exec(t.slice(r,r+2));return o?(e.M=+o[0],r+o[0].length):-1}function U4(e,t,r){var o=Lt.exec(t.slice(r,r+2));return o?(e.S=+o[0],r+o[0].length):-1}function Y4(e,t,r){var o=Lt.exec(t.slice(r,r+3));return o?(e.L=+o[0],r+o[0].length):-1}function K4(e,t,r){var o=Lt.exec(t.slice(r,r+6));return o?(e.L=Math.floor(o[0]/1e3),r+o[0].length):-1}function q4(e,t,r){var o=D4.exec(t.slice(r,r+1));return o?r+o[0].length:-1}function j4(e,t,r){var o=Lt.exec(t.slice(r));return o?(e.Q=+o[0],r+o[0].length):-1}function J4(e,t,r){var o=Lt.exec(t.slice(r));return o?(e.s=+o[0],r+o[0].length):-1}function Ov(e,t){return Ve(e.getDate(),t,2)}function $4(e,t){return Ve(e.getHours(),t,2)}function X4(e,t){return Ve(e.getHours()%12||12,t,2)}function Z4(e,t){return Ve(1+Oo.count(Nr(e),e),t,3)}function Uv(e,t){return Ve(e.getMilliseconds(),t,3)}function Q4(e,t){return Uv(e,t)+"000"}function _4(e,t){return Ve(e.getMonth()+1,t,2)}function eM(e,t){return Ve(e.getMinutes(),t,2)}function tM(e,t){return Ve(e.getSeconds(),t,2)}function rM(e){var t=e.getDay();return t===0?7:t}function oM(e,t){return Ve(zo.count(Nr(e)-1,e),t,2)}function Yv(e){var t=e.getDay();return t>=4||t===0?hn(e):hn.ceil(e)}function nM(e,t){return e=Yv(e),Ve(hn.count(Nr(e),e)+(Nr(e).getDay()===4),t,2)}function aM(e){return e.getDay()}function iM(e,t){return Ve(yi.count(Nr(e)-1,e),t,2)}function sM(e,t){return Ve(e.getFullYear()%100,t,2)}function lM(e,t){return e=Yv(e),Ve(e.getFullYear()%100,t,2)}function cM(e,t){return Ve(e.getFullYear()%1e4,t,4)}function dM(e,t){var r=e.getDay();return e=r>=4||r===0?hn(e):hn.ceil(e),Ve(e.getFullYear()%1e4,t,4)}function uM(e){var t=e.getTimezoneOffset();return (t>0?"-":(t*=-1,"+"))+Ve(t/60|0,"0",2)+Ve(t%60,"0",2)}function zv(e,t){return Ve(e.getUTCDate(),t,2)}function pM(e,t){return Ve(e.getUTCHours(),t,2)}function mM(e,t){return Ve(e.getUTCHours()%12||12,t,2)}function fM(e,t){return Ve(1+Ds.count(eo(e),e),t,3)}function Kv(e,t){return Ve(e.getUTCMilliseconds(),t,3)}function gM(e,t){return Kv(e,t)+"000"}function bM(e,t){return Ve(e.getUTCMonth()+1,t,2)}function xM(e,t){return Ve(e.getUTCMinutes(),t,2)}function hM(e,t){return Ve(e.getUTCSeconds(),t,2)}function yM(e){var t=e.getUTCDay();return t===0?7:t}function vM(e,t){return Ve(ma.count(eo(e)-1,e),t,2)}function qv(e){var t=e.getUTCDay();return t>=4||t===0?yn(e):yn.ceil(e)}function CM(e,t){return e=qv(e),Ve(yn.count(eo(e),e)+(eo(e).getUTCDay()===4),t,2)}function SM(e){return e.getUTCDay()}function wM(e,t){return Ve(vi.count(eo(e)-1,e),t,2)}function TM(e,t){return Ve(e.getUTCFullYear()%100,t,2)}function NM(e,t){return e=qv(e),Ve(e.getUTCFullYear()%100,t,2)}function kM(e,t){return Ve(e.getUTCFullYear()%1e4,t,4)}function PM(e,t){var r=e.getUTCDay();return e=r>=4||r===0?yn(e):yn.ceil(e),Ve(e.getUTCFullYear()%1e4,t,4)}function RM(){return "+0000"}function Hv(){return "%"}function Wv(e){return +e}function Gv(e){return Math.floor(+e/1e3)}var Si,Jc;pf({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function pf(e){return Si=uf(e),Jc=Si.format,Si.parse,Si.utcFormat,Si.utcParse,Si}function MM(e){return new Date(e)}function DM(e){return e instanceof Date?+e:+new Date(+e)}function Xv(e,t,r,o,n,a,i,s,c,l){var d=rf(),u=d.invert,p=d.domain,m=l(".%L"),f=l(":%S"),g=l("%I:%M"),b=l("%I %p"),x=l("%a %d"),h=l("%b %d"),y=l("%B"),v=l("%Y");function S(w){return (c(w)<w?m:s(w)<w?f:i(w)<w?g:a(w)<w?b:o(w)<w?n(w)<w?x:h:r(w)<w?y:v)(w)}return d.invert=function(w){return new Date(u(w))},d.domain=function(w){return arguments.length?p(Array.from(w,DM)):p().map(MM)},d.ticks=function(w){var N=p();return e(N[0],N[N.length-1],w??10)},d.tickFormat=function(w,N){return N==null?S:l(N)},d.nice=function(w){var N=p();return (!w||typeof w.range!="function")&&(w=t(N[0],N[N.length-1],w??10)),w?p(of(N,w)):d},d.copy=function(){return xv(d,Xv(e,t,r,o,n,a,i,s,c,l))},d}function $c(){return $y.apply(Xv(sf,lf,Nr,Ci,zo,Oo,hi,xi,vo,Jc).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}var Qv=e=>e instanceof Date&&!Number.isNaN(e.getTime());function Xc(e,t,r){let[o,n]=He.useState(null);He.useImperativeHandle(r,()=>({setPreview:n}),[]);let[a,i]=e.range(),s=He.useMemo(()=>o?$c().domain([new Date(o[0]),new Date(o[1])]).range([a,i]):e,[o,e,a,i]),c=s.domain(),l=c[0],d=c[c.length-1],u=Qv(l)&&Qv(d),p=t<400,m=Math.max(2,Math.min(8,Math.floor(t/(p?70:110)))),f=He.useMemo(()=>u?s.ticks(m):[],[s,m,u]);return {activeScale:s,ticks:f,start:l,end:d,valid:u,compact:p,rangeStart:a,rangeEnd:i}}var BM=6,_v=20,ff=He.forwardRef(({top:e,scale:t,width:r},o)=>{let{activeScale:n,ticks:a,start:i,end:s,valid:c,compact:l,rangeStart:d,rangeEnd:u}=Xc(t,r,o),p=He.useMemo(()=>c?Xi({start:i,end:s},{compact:l}):()=>"",[i,s,l,c]),m=He.useId(),f=Math.min(d,u),g=Math.abs(u-d);return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("line",{x1:d,x2:u,y1:e,y2:e,stroke:"var(--color-border-muted)",strokeWidth:1}),a.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("clipPath",{id:m,children:jsxRuntime.jsx("rect",{x:f,y:e-4,width:g,height:_v+16})})}),jsxRuntime.jsx("g",{clipPath:`url(#${m})`,children:a.map(b=>jsxRuntime.jsxs("g",{transform:`translate(${n(b)},${e})`,children:[jsxRuntime.jsx("line",{x1:0,x2:0,y1:0,y2:BM,stroke:"var(--color-border-muted)",strokeWidth:1}),jsxRuntime.jsx("text",{x:0,y:_v,textAnchor:"middle",fontSize:12,fill:"var(--color-text-secondary)",children:p(b)})]},b.getTime()))})]})]})});ff.displayName="LiveTimeAxisBottom";var gf=He.forwardRef(({scale:e,width:t,top:r,bottom:o},n)=>{let{activeScale:a,ticks:i}=Xc(e,t,n);return jsxRuntime.jsx("g",{"aria-hidden":"true",children:i.map(s=>{let c=a(s);return jsxRuntime.jsx("line",{x1:c,x2:c,y1:r,y2:o,stroke:"var(--color-border-muted)",strokeWidth:1},s.getTime())})})});gf.displayName="LiveTimeGridlines";function Zc(e,t,r){let o=e[1]-e[0],n=t/Math.max(1,r)*o;return [e[0]-n,e[1]-n]}function t0(e,t,r){let o=e[1]-e[0],n=e[0]+t*o,a=o/r,i=n-t*a;return [i,i+a]}function bf(e,t,r=16,o=800){return t===1?e*r:t===2?e*o:e}var r0=(e,t,r,o,n)=>{let a=t!==1?t0(e,r,t):e;return o!==0&&(a=Zc(a,o,n)),a},o0=(e,t)=>{if(!t)return e;let r=e[1]-e[0];if(r>=t[1]-t[0])return [t[0],t[1]];let[o,n]=e;return n>t[1]&&(n=t[1],o=n-r),o<t[0]&&(o=t[0],n=o+r),[o,n]},HM=e=>typeof requestAnimationFrame=="function"?requestAnimationFrame(e):setTimeout(()=>e(0),0),WM=e=>{typeof cancelAnimationFrame=="function"?cancelAnimationFrame(e):clearTimeout(e);};function n0(e){let{groupRef:t}=e,r=He.useRef({xDomain:e.xDomain,plotWidthPx:e.plotWidthPx,plotLeftPx:e.plotLeftPx??0});r.current={xDomain:e.xDomain,plotWidthPx:e.plotWidthPx,plotLeftPx:e.plotLeftPx??0};let o=He.useRef(e.onCommit);o.current=e.onCommit;let n=He.useRef(e.panBoundsMs);n.current=e.panBoundsMs;let a=He.useRef(e.settleMs??140);a.current=e.settleMs??140;let i=He.useRef(e.zoomIntent??(P=>P.ctrlKey));i.current=e.zoomIntent??(P=>P.ctrlKey);let s=He.useRef(e.onGestureStart);s.current=e.onGestureStart;let c=He.useRef(e.onFramePreview);c.current=e.onFramePreview;let l=He.useRef(null),d=He.useRef({scale:1,cursorFrac:.5,panDxPx:0,timer:null}),u=He.useRef(null),p=He.useRef(null),m=He.useRef(false),f=He.useCallback((P,T,k)=>{p.current={translateX:P,scaleX:T,preview:k},u.current==null&&(u.current=HM(()=>{u.current=null;let V=p.current;V!=null&&(t.current?.setAttribute("transform",`translate(${V.translateX},0) scale(${V.scaleX},1)`),c.current?.(V.preview));}));},[t]),g=He.useCallback(()=>{u.current!=null&&(WM(u.current),u.current=null),p.current=null,t.current?.removeAttribute("transform"),c.current?.(null);},[t]),b=He.useCallback(()=>{m.current||(m.current=true,s.current?.());},[]),x=He.useCallback(()=>{m.current=false;},[]),h=He.useCallback(()=>{d.current.timer!=null&&(clearTimeout(d.current.timer),d.current.timer=null);},[]),y=He.useCallback(()=>{d.current={scale:1,cursorFrac:.5,panDxPx:0,timer:null};},[]),v=He.useCallback(()=>{let{xDomain:P,plotWidthPx:T}=r.current,{scale:k,cursorFrac:V,panDxPx:H}=d.current;k===1&&H===0||o.current(o0(r0(P,k,V,H,T),n.current));},[]),S=He.useCallback(()=>{d.current.timer!=null&&(h(),v(),y(),g());},[h,v,y,g]),w=He.useCallback(P=>{S(),P.currentTarget.setPointerCapture?.(P.pointerId),l.current={startX:P.clientX,dxPx:0},b();},[S,b]),N=He.useCallback(P=>{if(!l.current)return;l.current.dxPx=P.clientX-l.current.startX;let{xDomain:T,plotWidthPx:k}=r.current;f(l.current.dxPx,1,Zc(T,l.current.dxPx,k));},[f]),D=He.useCallback(P=>{if(!l.current)return;let{dxPx:T}=l.current;l.current=null,g(),x(),T!==0&&o.current(o0(Zc(r.current.xDomain,T,r.current.plotWidthPx),n.current));},[g,x]),R=He.useCallback(()=>{l.current&&(l.current=null,g(),x());},[g,x]),A=He.useRef(null),O=He.useCallback(P=>{if(A.current?.(),A.current=null,!P)return;let T=k=>{if(l.current)return;let{plotWidthPx:V,plotLeftPx:H}=r.current,I=bf(k.deltaY,k.deltaMode),q=bf(k.deltaX,k.deltaMode),j=i.current(k);if(!j&&q===0)return;if(k.preventDefault(),b(),j){let E=Math.min(1,Math.max(0,(k.clientX-P.getBoundingClientRect().left)/Math.max(1,V)));d.current.scale*=Math.exp(-I/200),d.current.cursorFrac=E;}else d.current.panDxPx-=q;let{scale:K,cursorFrac:Y,panDxPx:M}=d.current;f((H+Y*V)*(1-K)+M,K,r0(r.current.xDomain,K,Y,M,V)),h(),d.current.timer=setTimeout(()=>{v(),y(),g(),x();},a.current);};P.addEventListener("wheel",T,{passive:false}),A.current=()=>P.removeEventListener("wheel",T);},[f,g,h,v,y,b,x]);return He.useEffect(()=>()=>{A.current?.(),A.current=null,g(),d.current.timer!=null&&clearTimeout(d.current.timer);},[g]),{onPointerDown:w,onPointerMove:N,onPointerUp:D,onPointerCancel:R,wheelTargetRef:O,gestureActiveRef:m}}var l0=e=>e.type===fn||e.type===ra,JM=({children:e,viewport:t,panBounds:r,onViewportChange:o,onPlotWidthChange:n,yFormatter:a={type:"number"},yDomain:i,referenceLines:s,parentWidth:c=0,parentHeight:l=0})=>{let[d,u]=He.useState(null),p=He.useRef(null),m=He.useRef(0),f=He.useId(),g=He.useRef(null),b=He.useRef(null),x=He.useRef(null),{colorMode:h}=Ht(),y=He.useMemo(()=>Bn(),[h]),v=He.useMemo(()=>ji(),[h]),{datasets:S,seriesMetadata:w,seriesTypes:N}=He.useMemo(()=>{let te=He.Children.toArray(e).filter(le=>He.isValidElement(le)&&l0(le)),ye=te.filter(le=>le.props.data).length,qe=[],It=[],de=[];return te.forEach((le,me)=>{let Q=le.props;if(!Q.data)return;qe.push(Q.data);let be=("color"in Q&&Q.color?Q.color:void 0)||(ye===1?v:y[me%y.length]),ee=le.type===fn;It.push({label:"label"in Q&&Q.label||`Series ${qe.length}`,color:be,...ee&&"baseline"in Q&&Q.baseline!==void 0?{baseline:Q.baseline,tooltipRange:"tooltipRange"in Q&&Q.tooltipRange||false}:{}}),de.push(ee?"area":"line");}),{datasets:qe,seriesMetadata:It,seriesTypes:de}},[e,v,y]),D=c,R=Math.max(100,l-60),A=He.useMemo(()=>[new Date(t.startMs),new Date(t.endMs)],[t.startMs,t.endMs]),O=He.useMemo(()=>S.flat(),[S]),P=He.useMemo(()=>{let te=bs(O,R,a,i);if(!i){let[ye,qe]=te.domain();qe>ye&&te.domain([ye,qe+(qe-ye)*.05]);}return te},[O,R,a,i]),T=He.useRef(JSON.stringify(a)),k=He.useRef(null),V=He.useMemo(()=>{let[te,ye]=P.domain(),qe=Math.max(Math.abs(te),Math.abs(ye)),It=JSON.stringify(a);if(It!==T.current&&(T.current=It,k.current=null),k.current!==null)return k.current;if(qe===0)return li(a,0);let de=li(a,qe);return k.current=de,de},[P,a]),H=He.useMemo(()=>{let te=R-Ie.top-Ie.bottom;return di(te)},[R]),I=He.useMemo(()=>{let te=Qr(V),ye=te.tickFormat||te.format,It=P.ticks(H).map(me=>ye(me)),de=ci(It,12,"system-ui"),le=Math.ceil(de)+12;return {...Ie,left:Math.max(le,30)}},[P,V,H]),q=He.useMemo(()=>scale.scaleTime({domain:A,range:[I.left,D-I.right]}),[A,D,I]),j=He.useMemo(()=>[t.startMs,t.endMs],[t.startMs,t.endMs]),K=He.useMemo(()=>r?[r.startMs,r.endMs]:void 0,[r]),Y=He.useCallback(te=>{o({startMs:te[0],endMs:te[1]});},[o]),M=D-I.left-I.right,E=He.useCallback(()=>u(null),[]),z=He.useCallback(te=>{b.current?.setPreview(te),x.current?.setPreview(te);},[]),{onPointerDown:B,onPointerMove:C,onPointerUp:W,onPointerCancel:G,wheelTargetRef:F,gestureActiveRef:Z}=n0({xDomain:j,plotWidthPx:M,plotLeftPx:I.left,groupRef:g,onCommit:Y,onGestureStart:E,onFramePreview:z,...K?{panBoundsMs:K}:{}});He.useEffect(()=>{n?.(Math.max(0,D-I.left-I.right));},[D,I,n]);let _=He.useCallback(te=>{if(Z.current)return;let{left:ye}=p.current?.getBoundingClientRect()||{left:0},qe=te.clientX-ye;te.timeStamp-(m.current||0)<16||(m.current=te.timeStamp,u(Jy({mouseX:qe,datasets:S,seriesMetadata:w,seriesTypes:N,xScale:q,yScale:P,plotLeft:I.left,plotRight:D-I.right})));},[S,w,N,q,P,D,I,Z]),L=He.useCallback(()=>u(null),[]),oe={width:D,height:R,xScale:q,yScale:P,yFormatter:V,animationSettings:gc,tooltip:{data:d,show:u,hide:()=>u(null)},datasets:S,seriesMetadata:w,seriesTypes:N},ie=0,ne=[];He.Children.toArray(e).forEach(te=>{if(!He.isValidElement(te)){ne.push(te);return}if(l0(te)){let ye=ie;ie++;let qe=te.props;ne.push(He__namespace.default.cloneElement(te,{...qe,color:w[ye]?.color,animate:false}));}else ne.push(te);});let ae=w.map(te=>({category:te.label,fill:te.color})),ce=Tl({datasets:S,metadata:{xLabel:"Date",yLabel:"Value",seriesLabels:w.map(te=>te.label),timestamp:true},svgRef:p}),Ce=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("title",{children:"Data chart visualization"}),jsxRuntime.jsx("g",{children:P.ticks(H).map(te=>{let ye=Math.abs(te)<Number.EPSILON;return jsxRuntime.jsx(shape.Line,{from:{x:I.left,y:P(te)},to:{x:D-I.right,y:P(te)},stroke:ye?"var(--color-border-default)":"var(--color-border-muted)",strokeWidth:ye?1.5:1},`grid-line-${te}`)})}),jsxRuntime.jsx(gf,{ref:x,scale:q,width:D-I.left-I.right,top:P.range()[1],bottom:P.range()[0]}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("clipPath",{id:f,children:jsxRuntime.jsx("rect",{x:q.range()[0],y:P.range()[1],width:q.range()[1]-q.range()[0],height:P.range()[0]-P.range()[1]})})}),jsxRuntime.jsx("g",{clipPath:`url(#${f})`,children:jsxRuntime.jsx("g",{ref:g,children:ne})}),s&&s.length>0&&jsxRuntime.jsx("g",{children:s.map(te=>{let ye=P(te.value),qe=te.color??"var(--color-error-base)";return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx(shape.Line,{from:{x:I.left,y:ye},to:{x:D-I.right,y:ye},stroke:qe,strokeWidth:1.5,strokeDasharray:"6 4"}),te.label&&jsxRuntime.jsx("text",{x:D-I.right-4,y:ye-4,textAnchor:"end",fontSize:11,fill:qe,children:te.label})]},`ref-line-${te.value}`)})}),jsxRuntime.jsx(ff,{ref:b,top:R-I.bottom,scale:q,width:D-I.left-I.right}),jsxRuntime.jsx(Hr.Left,{left:I.left,scale:P,yFormatter:V,height:R-I.top-I.bottom}),d&&!d.isEvent&&jsxRuntime.jsx(jsxRuntime.Fragment,{children:d.series.filter(te=>te.type!=="bar"&&te.showMarker!==false).map(te=>jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("circle",{cx:q(d.xValue),cy:P(te.chartY??te.value),r:8,fill:"white",stroke:te.color,strokeWidth:2,style:{transition:"all 100ms ease-out"}}),jsxRuntime.jsx("circle",{cx:q(d.xValue),cy:P(te.chartY??te.value),r:4,fill:te.color,style:{transition:"all 100ms ease-out"}})]},`highlight-${te.label}`))}),jsxRuntime.jsx("rect",{"data-camera-surface":"",x:I.left,y:I.top,width:D-I.left-I.right,height:R-I.top-I.bottom,fill:"transparent",style:{cursor:"grab",touchAction:"none"},onMouseMove:_,onMouseLeave:L,onPointerDown:B,onPointerMove:C,onPointerUp:W,onPointerCancel:G,ref:F})]});return jsxRuntime.jsx("div",{className:"relative flex h-full flex-col",children:jsxRuntime.jsxs(zr.Provider,{value:oe,children:[jsxRuntime.jsx("svg",{width:D,height:R,className:"overflow-visible",ref:p,role:"img","aria-label":"Data chart",children:Ce}),jsxRuntime.jsx(gn,{data:d,formatter:V}),jsxRuntime.jsx(pi,{onExport:ce,items:ae,marginLeft:0,marginRight:I.right})]})})},_c=responsive.withParentSize(JM);var $M={sm:"gap-4 px-6 py-8",md:"gap-5 px-8 py-12",lg:"gap-6 px-10 py-16"},XM={sm:"xs",md:"sm",lg:"md"},ZM={sm:bt("bodySm"),md:bt("bodySm"),lg:bt("bodyMd")},QM={sm:"h-10 w-10",md:"h-12 w-12",lg:"h-16 w-16"},_M={sm:20,md:24,lg:32},eD={center:"items-center text-center [&_.empty-state-actions]:justify-center [&_.empty-state-actions]:text-center",start:"items-start text-left [&_.empty-state-actions]:justify-start [&_.empty-state-actions]:text-left"},tD={mesh:"radial-gradient(at 20% 20%, rgba(68, 74, 225, 0.06) 0px, transparent 45%), radial-gradient(at 80% 80%, rgba(68, 74, 225, 0.045) 0px, transparent 45%), radial-gradient(at 50% 50%, rgba(68, 74, 225, 0.03) 0px, transparent 50%)","top-fade":"linear-gradient(to bottom, rgba(68, 74, 225, 0.06) 0%, rgba(68, 74, 225, 0.02) 60%, transparent 100%)",center:"radial-gradient(ellipse 600px 400px at center, rgba(68, 74, 225, 0.06) 0px, transparent 60%)",corners:"radial-gradient(at 0% 0%, rgba(68, 74, 225, 0.06) 0px, transparent 40%), radial-gradient(at 100% 100%, rgba(68, 74, 225, 0.045) 0px, transparent 40%)",bottom:"radial-gradient(ellipse 700px 300px at 50% 100%, rgba(68, 74, 225, 0.06) 0px, transparent 60%)",asymmetric:"radial-gradient(at 15% 30%, rgba(68, 74, 225, 0.06) 0px, transparent 45%), radial-gradient(at 85% 70%, rgba(68, 74, 225, 0.04) 0px, transparent 50%)"};function ed({icon:e,title:t,description:r,primaryAction:o,secondaryAction:n,actions:a,size:i="md",alignment:s="center",variant:c="default",spotlightPattern:l="mesh",fullHeight:d=false,className:u}){let p=i==="sm"?"sm":"md",m=c==="spotlight",f=m?{background:tD[l]}:void 0,g=()=>a?jsxRuntime.jsx("div",{className:"empty-state-actions mt-2 flex flex-wrap items-center gap-3",children:a}):o||n?jsxRuntime.jsxs("div",{className:"empty-state-actions mt-2 flex flex-col gap-3",children:[o&&(o.href?jsxRuntime.jsx(re,{variant:"secondary",size:p,onPress:o.onPress,isDisabled:o.isDisabled,isLoading:o.isLoading,href:o.href,children:o.label}):jsxRuntime.jsx(re,{variant:"secondary",size:p,onPress:o.onPress,isDisabled:o.isDisabled,isLoading:o.isLoading,children:o.label})),n&&jsxRuntime.jsx(tt,{href:n.href||"#",variant:"muted",onPress:n.onPress,className:bt("labelMd"),children:n.label})]}):null;return jsxRuntime.jsxs("section",{"data-testid":"empty-state",role:"status","aria-live":"polite",className:tailwindMerge.twMerge("flex w-full flex-col rounded-xl text-text-primary",$M[i],eD[s],d?"h-full justify-center":"",m?"relative overflow-hidden":"",u),style:f,children:[e&&jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex items-center justify-center rounded-full border border-border-muted bg-background-muted text-text-secondary",QM[i]),children:jsxRuntime.jsx(U,{name:e,size:_M[i]})}),jsxRuntime.jsx(or,{size:XM[i],tag:"h2",className:"text-text-secondary",children:t}),r&&jsxRuntime.jsx("p",{className:tailwindMerge.twMerge("max-w-xs text-text-secondary whitespace-pre-line",ZM[i]),children:r}),g()]})}function sD({selectionState:e,isDisabled:t}){let r=`${$e} w-full h-full flex items-center justify-center rounded-sm forced-color-adjust-none font-semibold`,o={none:"text-text-primary group-hover:bg-background-muted group-pressed:bg-background-muted",middle:["bg-background-selected group-hover:bg-background-muted forced-colors:group-hover:bg-[Highlight]","group-invalid:group-hover:bg-feedback-error-background forced-colors:group-invalid:group-hover:bg-[Mark]","group-pressed:bg-background-muted forced-colors:group-pressed:bg-[Highlight] forced-colors:text-[HighlightText]","group-invalid:group-pressed:bg-feedback-error-background forced-colors:group-invalid:group-pressed:bg-[Mark]"].join(" "),cap:"bg-action-default text-[color:var(--color-action-default-text)] group-invalid:bg-feedback-error-border forced-colors:bg-[Highlight] forced-colors:group-invalid:bg-[Mark] forced-colors:text-[HighlightText]"},n=t?"text-text-disabled forced-colors:text-text-disabled font-light":"";return [r,o[e],n].filter(Boolean).join(" ")}function Ti({errorMessage:e,...t}){return jsxRuntime.jsxs(reactAriaComponents.RangeCalendar,{...t,children:[jsxRuntime.jsx(dc,{}),jsxRuntime.jsxs(reactAriaComponents.CalendarGrid,{className:"w-full border-separate [border-spacing:0] [&_td]:p-0 [&_td]:!border-0",children:[jsxRuntime.jsx(uc,{}),jsxRuntime.jsx(reactAriaComponents.CalendarGridBody,{children:r=>jsxRuntime.jsx(reactAriaComponents.CalendarCell,{date:r,className:"selection-start:rounded-s-full selection-end:rounded-e-full [td:last-child_&]:rounded-e-end group h-9 w-9 cursor-default text-sm border-0 outside-month:text-text-disabled invalid:selected:bg-feedback-error-background forced-colors:selected:bg-[Highlight] forced-colors:selected:text-[HighlightText] forced-colors:invalid:selected:bg-[Mark] [td:first-child_&]:rounded-s-full [&]:border-0",children:({formattedDate:o,isSelected:n,isSelectionStart:a,isSelectionEnd:i,isFocusVisible:s,isDisabled:c})=>jsxRuntime.jsx("span",{className:sD({selectionState:n&&(a||i)?"cap":n?"middle":"none",isDisabled:c}),children:o})})})]}),e&&jsxRuntime.jsx(reactAriaComponents.Text,{slot:"errorMessage",className:"text-sm text-feedback-error-text",children:e})]})}function p0(e){return e==="brand"?"primary":e==="default"||e==="secondary"||!e?"subtle":e}var cD={sm:"h-[var(--control-sm-height)] text-xs",md:"h-[var(--control-md-height)] text-sm",lg:"h-[var(--control-lg-height)] text-base",xl:"h-[var(--control-xl-height)] text-lg"},dD={sm:14,md:16,lg:18,xl:20},uD=({isSelected:e,isFirst:t,isLast:r,isDisabled:o,variant:n="subtle"})=>{let a=p0(n),i=a==="primary"?"focus-visible:outline-action-primary":"focus-visible:outline-[color:var(--color-action-secondary-text)]";return a==="subtle"?tailwindMerge.twMerge($e(),"focus-visible:outline-[color:var(--color-action-secondary-text)]","px-3 text-center transition cursor-pointer forced-color-adjust-none -ml-px first:ml-0 flex items-center justify-center h-full gap-2",e?"bg-background-muted text-text-primary font-medium forced-colors:!bg-[Highlight] forced-colors:!text-[HighlightText]":"text-text-secondary hover:bg-background-hover pressed:bg-background-hover forced-colors:!bg-[ButtonFace] forced-colors:!text-[ButtonText]",!r&&"border-r border-border-muted",o&&"bg-background-muted text-text-disabled forced-colors:!bg-[ButtonFace] forced-colors:!text-[GrayText] border-border-muted forced-colors:border-[GrayText] cursor-not-allowed"):tailwindMerge.twMerge($e(),i,"px-3 text-center transition cursor-pointer forced-color-adjust-none -ml-px first:ml-0 flex items-center justify-center h-full gap-2",e?"bg-action-primary text-[color:var(--color-action-primary-text)] font-semibold forced-colors:!bg-[Highlight] forced-colors:!text-[HighlightText]":"text-text-secondary hover:bg-background-hover pressed:bg-background-hover forced-colors:!bg-[ButtonFace] forced-colors:!text-[ButtonText] hover:font-semibold",!r&&"border-r border-border-muted",o&&"bg-background-muted text-text-disabled forced-colors:!bg-[ButtonFace] forced-colors:!text-[GrayText] border-border-muted forced-colors:border-[GrayText] cursor-not-allowed")};function rd({options:e,value:t,onChange:r,size:o="md",className:n,isDisabled:a,variant:i="subtle",iconOnly:s=false,"aria-label":c}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("inline-flex overflow-hidden rounded-[var(--control-border-radius)]",p0(i)==="subtle"?"border border-border-muted":"border-2 border-border-muted",cD[o],n),role:"group","aria-label":c,children:e.map((l,d)=>{let u=s&&!!l.icon;return jsxRuntime.jsxs(reactAriaComponents.ToggleButton,{isSelected:t===l.id,onChange:()=>r(l.id),className:uD({isSelected:t===l.id,isFirst:d===0,isLast:d===e.length-1,isDisabled:a,variant:i}),isDisabled:a,"aria-label":l.label,children:[l.icon&&jsxRuntime.jsx(U,{name:l.icon,size:dD[o]}),u?jsxRuntime.jsx("span",{className:"sr-only",children:l.label}):jsxRuntime.jsx("span",{className:"inline-flex flex-col items-center after:content-[attr(data-label)] after:font-semibold after:h-0 after:overflow-hidden after:invisible","data-label":l.label,children:l.label})]},l.id)})})}function gD(e){return e instanceof Date&&!Number.isNaN(e.getTime())}function vf(e){return gD(e)?e:(console.warn("Invalid date detected in TimeControls, using fallback:",e),new Date)}var g0={FIVE_MINUTES:0,FIFTEEN_MINUTES:1,HOUR:2,DAY:3,WEEK:4,MONTH:5,YEAR:6},bD=[{id:"FIFTEEN_MINUTES",label:"15m"},{id:"HOUR",label:"1h"},{id:"DAY",label:"1d"},{id:"WEEK",label:"1w"}];function od({dateRange:e,onDateRangeChange:t,windowSize:r,onWindowSizeChange:o,showWindowSize:n=true,showRangeSelector:a=true,allowDatePicker:i=false,lockWindowSize:s=false,restrictToSingleDay:c=false,presetRanges:l=[],windowSizeOptions:d=bD,autoAdjustWindowSize:u=false,className:p}){let[m,f]=He.useState(0),g=He.useRef(null),[b,x]=He.useState(false),h=M=>{let z=(M.before.getTime()-M.after.getTime())/(1e3*60*60);return z<=24?"FIFTEEN_MINUTES":z<=72||z<=168?"HOUR":("DAY")};He.useEffect(()=>{if(u&&!b&&o){let M=h(e);o(M);}},[e,u,b,o]);let y=M=>l.find(E=>{let z=E.getRange();return Math.abs(z.after.getTime()-M.after.getTime())<1e3*60*60*24&&Math.abs(z.before.getTime()-M.before.getTime())<1e3*60*60*24})?.id,[v,S]=He.useState(()=>y(e)),w=vf(e.after),N=vf(e.before),D=new Date(N);D.setDate(D.getDate()-1);let R={start:Xl(w,Yn()),end:Xl(D,Yn())};He.useEffect(()=>{let M=new ResizeObserver(E=>{for(let z of E)f(z.contentRect.width);});return g.current&&M.observe(g.current),()=>{g.current&&M.unobserve(g.current);}},[]);let A=[...d].sort((M,E)=>g0[M.id]-g0[E.id]),O=M=>{let E=M.toString(),z=l.find(B=>B.id===E);z&&(S(E),x(false),t(z.getRange()));},P=M=>{if(M?.start&&M?.end){S(void 0);let E=new Date(M.start.year,M.start.month-1,M.start.day,0,0,0,0),z=new Date(M.end.year,M.end.month-1,M.end.day+1,0,0,0,0);t({after:E,before:z});}},T=M=>{if(M){S(void 0);let E=new Date(M.year,M.month-1,M.day,0,0,0,0),z=new Date(M.year,M.month-1,M.day+1,0,0,0,0);t({after:E,before:z});}},k=M=>{o&&(x(true),o(M.toString()));},V=()=>{if(l.length>0){let M=l[0];S(M.id),x(false),t(M.getRange());}},H=(M,E=0)=>{let z=vf(M),B=new Date(z);return E!==0&&B.setDate(B.getDate()+E),B.toLocaleDateString("en-US")},I=A.map(M=>({id:M.id,label:M.label,value:M.id})),q=l.map(M=>({id:M.id,label:M.label,value:M.id})),j=s?jsxRuntime.jsx("div",{className:"flex items-center rounded-md border border-border-muted bg-background-muted px-3 py-2 text-sm text-text-secondary",children:A.find(M=>M.id===r)?.label||r}):jsxRuntime.jsx(qn,{className:"w-full md:w-auto",selectedKey:r,onSelectionChange:k,items:I,size:"md","aria-label":"Select Window Size",children:M=>jsxRuntime.jsx(ar,{id:M.id,"aria-label":M.label,size:"md",children:M.label},M.id)}),K=c?jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsxs(reactAriaComponents.DialogTrigger,{children:[jsxRuntime.jsxs(re,{className:"border-l pl-2 pr-2 hover:border-border-default hover:bg-background-muted hover:text-text-link-hover",variant:"secondary",children:[jsxRuntime.jsx(U,{name:"CalendarBlank",size:18}),jsxRuntime.jsx("span",{className:"ml-2 hidden md:block",children:H(e.after)})]}),jsxRuntime.jsx(lt,{className:"w-auto p-3",disableGroup:true,children:jsxRuntime.jsx(ri,{"aria-label":"Select date",value:ls(w.toISOString().split("T")[0]),onChange:T})})]})}):jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsxs(reactAriaComponents.DialogTrigger,{children:[jsxRuntime.jsxs(re,{className:"rounded-r-none border-l pl-2 pr-2 hover:border-border-default hover:bg-background-muted hover:text-text-link-hover",variant:"secondary",children:[jsxRuntime.jsx(U,{name:"CalendarBlank",size:18}),!v&&jsxRuntime.jsx("span",{className:"ml-2 hidden md:block",children:`${H(e.after)} - ${H(e.before,-1)}`})]}),jsxRuntime.jsx(lt,{className:"w-auto p-3",disableGroup:true,children:jsxRuntime.jsx(Ti,{"aria-label":"Date range calendar",value:R,onChange:P})})]}),!v&&jsxRuntime.jsx(re,{variant:"ghost",size:"md",onPress:V,children:"Reset"})]}),Y=m<600;return jsxRuntime.jsx("div",{ref:g,className:tailwindMerge.twMerge("flex w-full flex-wrap items-center justify-between gap-4",p),children:Y?jsxRuntime.jsxs("div",{className:"flex w-full justify-between",children:[jsxRuntime.jsxs("div",{className:"flex items-center",children:[i&&K,a&&v!==void 0&&jsxRuntime.jsx(qn,{selectedKey:v,onSelectionChange:O,items:q,size:"md","aria-label":"Select Date Range",children:M=>jsxRuntime.jsx(ar,{id:M.id,size:"md",children:M.label},M.id)})]}),jsxRuntime.jsx("div",{className:"flex items-center",children:n&&r&&j})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[i&&K,a&&v!==void 0&&jsxRuntime.jsx(rd,{options:l.map(M=>({id:M.id,label:M.label})),value:v,onChange:O,size:"sm",variant:"secondary","aria-label":"Select Date Range"})]}),jsxRuntime.jsx("div",{className:"flex items-center",children:n&&r&&j})]})})}var CD=1440*60*1e3,SD=6e4,Ni=(e,t)=>({startMs:t-e*CD,endMs:t}),Fs=e=>({after:new Date(e.startMs),before:new Date(e.endMs)});function b0({source:e,initialRange:t,viewportEnd:r,yFormatter:o,yDomain:n,referenceLines:a,emptyState:i,presetRanges:s,tierToWindow:c,windowSizeOptions:l,height:d=360,hint:u,dataBounds:p,children:m}){let[f,g]=He.useState(900),b=p?.endMs,[x,h]=He.useState(()=>b??Date.now());He.useEffect(()=>{if(b!=null){h(b);return}h(Date.now());let Z=setInterval(()=>h(Date.now()),SD);return ()=>clearInterval(Z)},[b]);let y=r?.getTime()??b,v=t?.days??30,S=He.useMemo(()=>Ni(v,y??Date.now()),[v,y]),w=x,N=He.useMemo(()=>({startMs:p?.startMs??0,endMs:x}),[p?.startMs,x]),D=Z=>{let _=Math.min(Z.endMs-Z.startMs,N.endMs-N.startMs),L=Math.max(Math.min(Z.endMs,N.endMs),N.startMs+_);return {startMs:L-_,endMs:L}},[R,A]=He.useState(null),O=R??S,P=rp({fetchTile:e.fetchTile,ladder:e.ladder,nativeMs:e.nativeMs,initialViewport:S,widthPx:f,maxFutureMs:w,tileCostSeriesCount:e.tileCostSeriesCount,resetKey:e.resetKey}),T=He.useMemo(()=>[{id:"year",label:"Year",getRange:()=>Fs(Ni(365,y??Date.now()))},{id:"month",label:"Month",getRange:()=>Fs(Ni(30,y??Date.now()))},{id:"week",label:"Week",getRange:()=>Fs(Ni(7,y??Date.now()))},{id:"day",label:"24h",getRange:()=>Fs(Ni(1,y??Date.now()))}],[y]),{line:k,coverage:V,renderTier:H,targetTier:I,isFallback:q,isStale:j}=P.series,K=H?H.bucketMs*1.5:0,Y=Z=>Z==null?"\u2014":new Date(Z).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),M=(Z,_)=>{let L=_-Z<1728e5?{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}:{month:"short",day:"numeric",year:"numeric"},oe=new Intl.DateTimeFormat("en-US",L);return `${oe.format(new Date(Z))} \u2013 ${oe.format(new Date(_))}`},E=P.viewport.startMs!==O.startMs||P.viewport.endMs!==O.endMs,z=j||P.loading&&V.earliestMs==null,B=(P.viewport.endMs-P.viewport.startMs)*.03,C=!z&&V.earliestMs!=null&&V.earliestMs>P.viewport.startMs+B,W=!P.loading&&V.earliestMs==null&&V.latestMs==null&&k.length===0&&!j,G=m({series:P.series,gapMs:K}),F=He.isValidElement(G)&&G.type===He.Fragment?G.props.children:G;return jsxRuntime.jsxs("div",{className:"flex flex-col gap-3",children:[jsxRuntime.jsx(od,{dateRange:Fs(P.viewport),onDateRangeChange:Z=>P.jumpTo(D({startMs:Z.after.getTime(),endMs:Z.before.getTime()})),windowSize:c[I.id],windowSizeOptions:l,lockWindowSize:true,presetRanges:s??T}),jsxRuntime.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs text-text-secondary",children:[jsxRuntime.jsxs("span",{children:["Window"," ",jsxRuntime.jsx("span",{className:"font-medium text-text-primary",children:M(P.viewport.startMs,P.viewport.endMs)})]}),jsxRuntime.jsx("span",{className:"text-text-tertiary",children:"\u2022"}),jsxRuntime.jsxs("span",{children:["Resolution ",jsxRuntime.jsx("span",{className:"font-medium text-text-primary",children:H?.id??I.id}),q&&jsxRuntime.jsxs("span",{className:"text-text-tertiary",children:[" \xB7 loading ",I.id]})]}),jsxRuntime.jsx("span",{className:"text-text-tertiary",children:"\u2022"}),jsxRuntime.jsxs("span",{children:[jsxRuntime.jsx("span",{className:"font-medium text-text-primary",children:k.length})," pts"]}),P.loading&&jsxRuntime.jsx("span",{className:"text-text-tertiary",children:"loading\u2026"}),C&&jsxRuntime.jsxs("span",{className:"text-text-tertiary",children:["showing available history from ",Y(V.earliestMs)]}),!C&&!z&&P.atDataStart&&jsxRuntime.jsx("span",{className:"text-text-tertiary",children:"no earlier data loaded"}),E&&jsxRuntime.jsx(re,{variant:"ghost",size:"sm",onPress:()=>{let Z=D(Ni(v,y??Date.now()));A(Z),P.jumpTo(Z);},children:"\u27F2 Reset"})]}),jsxRuntime.jsx("div",{className:"relative overflow-hidden rounded-md border border-border-subtle",style:{height:d},children:W?jsxRuntime.jsx(ed,{title:i.title,description:i.description}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(_c,{viewport:P.viewport,panBounds:N,onViewportChange:P.onViewportChange,onPlotWidthChange:g,...o&&{yFormatter:o},...n&&{yDomain:n},...a&&{referenceLines:a},children:F}),P.loading&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 h-0.5 animate-pulse bg-[var(--color-viz-categorical-1)] opacity-60"})]})}),u&&jsxRuntime.jsx("p",{className:"text-xs text-text-tertiary",children:u})]})}function TD(e,t,r){return {field:e,operator:t,value:r}}function ND(e,t="AND"){return {logic:t,conditions:e}}function Bs(){return {logic:"AND",conditions:[]}}function nd(e){return !e||e.conditions.length===0?true:e.conditions.every(t=>"conditions"in t?nd(t):false)}function kD(e,t){if(!e)return [];let r=new Map(t?.map(i=>[i.field,i])),o=new Map;function n(i){if("conditions"in i)i.conditions.forEach(s=>n(s));else {let s=o.get(i.field)||[];s.push(i),o.set(i.field,s);}}e.conditions.forEach(i=>n(i));let a=[];for(let[i,s]of o.entries()){let c=r.get(i),l=c?.label||i,d=[],u=[],p=[];for(let m of s)m.operator==="in"&&Array.isArray(m.value)?d.push(...m.value):m.operator==="eq"?typeof m.value!="boolean"&&!Array.isArray(m.value)?d.push(m.value):p.push(m):["gte","gt","lte","lt"].includes(m.operator)?u.push({operator:m.operator,value:typeof m.value=="boolean"||Array.isArray(m.value)?String(m.value):m.value}):p.push(m);if(d.length>0){let f=Array.from(new Set(d)).map(g=>c?.values?.find(x=>String(x.value)===String(g))?.label??g);a.push({id:`${i}-in`,label:l,value:f.join(", ")});}if(u.length>0){let m=u.find(g=>g.operator==="gte"||g.operator==="gt"),f=u.find(g=>g.operator==="lte"||g.operator==="lt");if(m&&f){let g=m.operator==="gte"?"\u2265":">",b=f.operator==="lte"?"\u2264":"<";a.push({id:`${i}-range`,label:l,value:`${g} ${m.value} and ${b} ${f.value}`});}else for(let g of u){let b;g.operator==="gte"?b="\u2265":g.operator==="gt"?b=">":g.operator==="lte"?b="\u2264":b="<",a.push({id:`${i}-${g.operator}`,label:l,value:`${b} ${g.value}`});}}for(let m of p){let f;m.operator==="neq"?f=`\u2260 ${m.value}`:m.operator==="contains"?f=`contains "${m.value}"`:m.operator==="startsWith"?f=`starts with "${m.value}"`:m.operator==="endsWith"?f=`ends with "${m.value}"`:f=String(m.value),a.push({id:`${i}-${m.operator}`,label:l,value:f});}}return a}function Sn(e,t){let r=e||Bs();return {...r,conditions:[...r.conditions,t]}}function ba(e,t){if(!e)return Bs();let r=e.conditions.filter(o=>"conditions"in o?ba(o,t).conditions.length>0:o.field!==t);return {...e,conditions:r}}function xa(e){if(!e)return [];let t=new Set;function r(o){"conditions"in o?o.conditions.forEach(r):t.add(o.field);}return e.conditions.forEach(r),Array.from(t)}function Vs({count:e,label:t="results",isLoading:r=false,className:o=""}){if(r)return jsxRuntime.jsx("div",{className:`flex items-center ${o}`,children:jsxRuntime.jsx(J,{width:80,height:16})});let n=t.endsWith("s")?t.slice(0,-1):t,a=e===1?n:t;return jsxRuntime.jsxs("div",{className:`text-sm text-text-secondary whitespace-nowrap ${o}`,children:[e.toLocaleString()," ",a]})}var ED=e=>{let t=Wt({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused,transparent:e.transparent,size:e.size}),r=[e.showSearchIcon?"":"pl-3",e.isClearable&&e.hasValue||e.isPassword?"pr-8":"pr-3"].join(" ");return tailwindMerge.twMerge(t,r,e.className)};function Gr({label:e,description:t,errorMessage:r,size:o="md",tooltip:n,isRequired:a,transparent:i,showSearchIcon:s,isClearable:c,onClear:l,type:d,validationResult:u,reserveErrorSpace:p=true,isLoading:m=false,descriptionPlacement:f="below",...g}){let[b,x]=He__namespace.default.useState(false),{isFocused:h,handleFocus:y,handleBlur:v}=Or(),S=d==="password",w=Pl(m,300);return jsxRuntime.jsx(reactAriaComponents.TextField,{...g,isRequired:a,className:ke(g.className,"group flex flex-col"),children:({isDisabled:N,isInvalid:D})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(ze,{size:o,tooltip:n,description:f==="tooltip"||f==="inline"?t:void 0,descriptionPlacement:f,isRequired:a,children:e}),jsxRuntime.jsxs(vt,{children:[s&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute top-1/2 -translate-y-1/2 transform flex items-center z-10",style:{left:9},children:(()=>{let R={sm:14,md:16,lg:18,xl:20}[o];return w?jsxRuntime.jsx(Eo,{size:R,color:"text-text-secondary"}):jsxRuntime.jsx(U,{name:"MagnifyingGlass",size:R,className:`transition-colors ${h?"text-action-brand":"text-text-secondary"}`})})()}),jsxRuntime.jsx(rc,{size:o,disabled:N,type:S?b?"text":"password":d,value:g.value,defaultValue:g.defaultValue,placeholder:g.placeholder,onFocus:R=>y(R,g.onFocus),onBlur:R=>v(R,g.onBlur),onChange:R=>g.onChange?.(R.target.value),style:s?{paddingLeft:{sm:28,md:32,lg:36,xl:37}[o]}:void 0,className:ED({isInvalid:D,isDisabled:N,isFocused:h,size:o,transparent:i,showSearchIcon:s,isClearable:c,hasValue:!!g.value,isPassword:S,className:typeof g.className=="string"?g.className:void 0})}),c&&g.value&&!N&&jsxRuntime.jsx(cs,{onClick:()=>{l?l():g.onChange&&g.onChange("");},size:o}),S&&!N&&jsxRuntime.jsx("button",{type:"button",onClick:()=>x(!b),className:"absolute right-3 top-1/2 -translate-y-1/2 transform text-text-secondary hover:text-text-primary","aria-label":b?"Hide password":"Show password",onMouseDown:R=>{R.preventDefault(),R.stopPropagation();},children:jsxRuntime.jsx(U,{name:b?"EyeSlash":"Eye",size:o==="sm"?16:20,className:"text-text-primary"})})]}),p?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof r=="string"?jsxRuntime.jsx(ge,{size:o,children:r}):typeof r=="function"&&u?jsxRuntime.jsx(ge,{size:o,children:r(u)}):t&&f==="below"?jsxRuntime.jsx(Pe,{size:o,children:t}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof r=="string"?jsxRuntime.jsx(ge,{size:o,className:"mt-1",children:r}):typeof r=="function"&&u?jsxRuntime.jsx(ge,{size:o,className:"mt-1",children:r(u)}):t&&f==="below"?jsxRuntime.jsx(Pe,{size:o,className:"mt-1",children:t}):null})]})})}function ha({value:e,onChange:t,onClear:r,placeholder:o="Search...",size:n="sm",className:a="",isLoading:i=false}){return jsxRuntime.jsx("div",{className:`flex-1 min-w-0 sm:max-w-sm ${a}`,children:jsxRuntime.jsx(Gr,{value:e,onChange:t,placeholder:o,showSearchIcon:true,isClearable:!!e&&!!r,onClear:r,size:n,"aria-label":o,reserveErrorSpace:false,isLoading:i})})}function Os({value:e,options:t,onChange:r,direction:o,onDirectionChange:n,showLabel:a=true,size:i="sm",className:s="",compact:c=false}){let[l,d]=He.useState(false),u=o!==void 0&&n!==void 0,p=t.find(m=>m.value===e);return c?jsxRuntime.jsxs("div",{className:`flex items-center gap-2 ${s}`,children:[jsxRuntime.jsx(re,{variant:"secondary",size:i,icon:"ArrowsDownUp","aria-label":`Sort by: ${p?.label||"Select"}`,onPress:()=>d(true)}),jsxRuntime.jsx(ct,{isOpen:l,onClose:()=>d(false),title:"Sort by",contentPadding:false,children:jsxRuntime.jsx(reactAriaComponents.ListBox,{items:t.map(m=>({id:m.value,label:m.label,value:m.value})),className:"w-full bg-background-surface p-0 outline-0 [&_[role=option]]:border-b [&_[role=option]]:border-border-default [&_[role=option]:last-child]:border-0 [&_[role=option]]:!px-6 [&_[role=option]]:!py-4 [&_[role=option]]:rounded-none",selectionMode:"single",selectedKeys:e?[e]:[],onSelectionChange:m=>{let f=Array.from(m)[0];f!=null&&(r(f),d(false));},children:m=>jsxRuntime.jsx(ar,{id:m.id,textValue:m.label,children:jsxRuntime.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap min-w-0 flex-1",children:m.label})},m.id)})})]}):jsxRuntime.jsxs("div",{className:`flex items-center gap-2 ${s}`,children:[a&&jsxRuntime.jsx("span",{className:"text-sm text-text-secondary whitespace-nowrap",children:"Sort by:"}),jsxRuntime.jsx(qn,{selectedKey:e,onSelectionChange:m=>r(m),size:i,className:"min-w-32",items:t.map(m=>({id:m.value,label:m.label,value:m.value})),renderItem:m=>m.label,"aria-label":"Sort by",reserveErrorSpace:false}),u&&jsxRuntime.jsx(re,{variant:"ghost",size:i,onClick:()=>n(o==="asc"?"desc":"asc"),"aria-label":`Sort ${o==="asc"?"descending":"ascending"}`,className:"p-1.5",children:o==="asc"?jsxRuntime.jsx(lucideReact.ArrowUp,{className:"w-4 h-4"}):jsxRuntime.jsx(lucideReact.ArrowDown,{className:"w-4 h-4"})})]})}function C0({search:e,searchMobileMode:t="expanded",filters:r=[],onRemoveFilter:o,onClearAllFilters:n,onManageFilters:a,exportControl:i,maxVisibleFilterChips:s=3,sort:c,resultsCount:l,leftControls:d,onManageColumns:u,columnPicker:p,customControls:m,actions:f,interactionMode:g="auto",sticky:b,stickyTop:x="0",zIndex:h=10,className:y="",style:v}){let S=r.length>0;if(!(e||S||a||c||l||d||u||p||m||f||i))return null;let N=b?"sticky bg-background-surface":"",D=b?{top:x,zIndex:h}:{};return jsxRuntime.jsxs("div",{className:`@container flex flex-col gap-3 bg-background-surface py-3 border-b border-border-default ${N} ${y}`,style:{...v,...D},children:[jsxRuntime.jsxs("div",{className:"hidden @[640px]:flex @[640px]:items-center @[640px]:justify-between @[640px]:gap-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[d,d&&l&&jsxRuntime.jsx("div",{className:"h-4 w-px bg-border-default"}),l&&jsxRuntime.jsx(Vs,{count:l.count,label:l.label,isLoading:l.isLoading}),l&&c&&jsxRuntime.jsx("div",{className:"h-4 w-px bg-border-default"}),c&&jsxRuntime.jsx(Os,{value:c.value,options:c.options,onChange:c.onChange,showLabel:c.showLabel,direction:c.direction,onDirectionChange:c.onDirectionChange}),u?jsxRuntime.jsx(re,{variant:"secondary",size:"sm",icon:"Columns",onClick:u,children:"Columns"}):p,S&&o&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[r.slice(0,s).map(R=>jsxRuntime.jsxs(bo,{variant:"primary",size:"sm",onRemove:()=>o(R.id),isRemovable:true,children:[R.label,": ",R.value]},R.id)),r.length>s&&a&&jsxRuntime.jsxs(re,{variant:"ghost",size:"sm",onClick:a,className:"text-text-secondary hover:text-text-primary whitespace-nowrap",children:["+",r.length-s," more"]}),n&&jsxRuntime.jsx(re,{variant:"ghost",size:"sm",onClick:n,className:"text-text-secondary hover:text-text-primary whitespace-nowrap",children:"Clear all"})]})]}),jsxRuntime.jsx("div",{className:"flex items-center gap-3 flex-shrink-0",children:m||jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[f&&f.items.length>0&&jsxRuntime.jsx(jsxRuntime.Fragment,{children:f.items.map(R=>jsxRuntime.jsx(re,{variant:R.variant||"secondary",size:"sm",icon:R.icon,onPress:R.onClick,isDisabled:R.disabled,children:R.label},R.id))}),e&&jsxRuntime.jsx("div",{className:"w-64",children:jsxRuntime.jsx(ha,{value:e.value,onChange:e.onChange,onClear:e.onClear,placeholder:e.placeholder,isLoading:e.isLoading})}),a&&jsxRuntime.jsx(re,{variant:"secondary",size:"sm",icon:"Sliders",badgeNumber:r.length>0?r.length:void 0,onClick:a,children:"Filters"}),i&&jsxRuntime.jsx(re,{variant:"secondary",size:"sm",icon:"Upload",onClick:i.onClick,isDisabled:i.isDisabled,children:i.label})]})})]}),jsxRuntime.jsxs("div",{className:"@[640px]:hidden",children:[jsxRuntime.jsx("div",{className:"flex flex-col gap-3 mb-3",children:jsxRuntime.jsx("div",{className:"flex items-center gap-3",children:m?jsxRuntime.jsx("div",{className:"flex-1",children:m}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[f&&f.items.length>0&&jsxRuntime.jsx(Qa,{items:f.items.map(R=>({id:R.id,name:R.label,iconName:R.icon,variant:R.variant==="destructive"?"destructive":"primary",disabled:R.disabled,onAction:R.onClick})),align:"left",size:"sm",children:jsxRuntime.jsx(re,{variant:"secondary",size:"sm",icon:"DotsThreeVertical","aria-label":f.menuLabel||"Actions"})}),e&&jsxRuntime.jsx("div",{className:"flex-1",children:jsxRuntime.jsx(ha,{value:e.value,onChange:e.onChange,onClear:e.onClear,placeholder:e.placeholder,isLoading:e.isLoading})}),a&&jsxRuntime.jsx(re,{variant:"secondary",size:"sm",icon:"Sliders",badgeNumber:r.length>0?r.length:void 0,onClick:a,"aria-label":`Filters${r.length>0?` (${r.length} active)`:""}`}),i&&jsxRuntime.jsx(re,{variant:"secondary",size:"sm",icon:"Upload",onClick:i.onClick,isDisabled:i.isDisabled,children:i.label})]})})}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[d,l&&jsxRuntime.jsx(Vs,{count:l.count,label:l.label,isLoading:l.isLoading})]}),jsxRuntime.jsx("div",{className:"flex items-center gap-2",children:c&&jsxRuntime.jsx(Os,{value:c.value,options:c.options,onChange:c.onChange,showLabel:false,direction:c.direction,onDirectionChange:c.onDirectionChange,compact:g!=="desktop"})})]})]})]})}function S0({filters:e,onRemove:t,onClearAll:r,onManageFilters:o,maxVisibleChips:n=3,mode:a="chips",showManageButton:i=true,size:s="sm",className:c=""}){let l=e.length>0,d=e.slice(0,n),u=Math.max(0,e.length-n),p=u>0,m=a==="button"&&!!o,f=a==="chips"&&i&&!!o;if(!l&&!m&&!f)return null;let g=m&&jsxRuntime.jsxs(re,{variant:"secondary",size:s,onClick:o,className:"whitespace-nowrap",children:[e.length," ",e.length===1?"filter":"filters"]}),b=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[f&&jsxRuntime.jsx(re,{variant:"secondary",size:s,icon:"Sliders",onClick:o,className:"whitespace-nowrap",children:"Filters"}),l&&d.map(h=>jsxRuntime.jsxs(bo,{variant:"secondary",size:s,onRemove:()=>t(h.id),isRemovable:true,children:[h.label,": ",h.value]},h.id)),l&&p&&o&&jsxRuntime.jsxs(re,{variant:"ghost",size:s,onClick:o,className:"text-text-secondary hover:text-text-primary whitespace-nowrap",children:["+",u," more"]}),l&&r&&jsxRuntime.jsx(re,{variant:"ghost",size:s,onClick:r,className:"text-text-secondary hover:text-text-primary whitespace-nowrap",children:"Clear all"})]}),x=a==="button"?g:b;return jsxRuntime.jsx("div",{className:`flex flex-wrap items-center gap-2 ${c}`,children:x})}function T0({label:e,description:t,errorMessage:r,size:o="md",tooltip:n,isRequired:a,isDisabled:i,isInvalid:s,showCalendar:c=true,reserveErrorSpace:l=true,validationResult:d,className:u,...p}){let[m,f]=He.useState(false),g=b=>{p.onChange&&b&&p.onChange(b),f(false);};return jsxRuntime.jsxs(reactAriaComponents.DateField,{...p,isDisabled:i,isRequired:a,isInvalid:s,className:ke(u,"flex flex-col gap-1"),children:[e&&jsxRuntime.jsx(ze,{size:o,tooltip:n,isRequired:a,children:e}),jsxRuntime.jsx(vt,{children:jsxRuntime.jsxs("div",{className:"relative w-full",children:[jsxRuntime.jsx(zs,{size:o,isDisabled:i,isInvalid:s,hasCalendar:c}),c&&!i&&jsxRuntime.jsxs(reactAriaComponents.DialogTrigger,{isOpen:m,onOpenChange:f,children:[jsxRuntime.jsx(re,{variant:"unstyled",className:"absolute right-2 top-1/2 -translate-y-1/2 flex h-8 w-8 items-center justify-center rounded hover:bg-background-hover text-text-secondary hover:text-text-primary transition-colors","aria-label":"Open calendar",children:jsxRuntime.jsx(U,{name:"Calendar",size:18})}),jsxRuntime.jsx(reactAriaComponents.Popover,{className:"bg-background-surface rounded-lg border border-border-default shadow-xl",children:jsxRuntime.jsx(reactAriaComponents.Dialog,{className:"p-4 outline-none",children:jsxRuntime.jsx(ri,{value:p.value,onChange:g,minValue:p.minValue,maxValue:p.maxValue,isDisabled:i,isReadOnly:p.isReadOnly,isDateUnavailable:p.isDateUnavailable})})})]})]})}),l?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof r=="string"?jsxRuntime.jsx(ge,{size:o,children:r}):typeof r=="function"&&d?jsxRuntime.jsx(ge,{size:o,children:r(d)}):t?jsxRuntime.jsx(Pe,{size:o,children:t}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof r=="string"?jsxRuntime.jsx(ge,{size:o,className:"mt-1",children:r}):typeof r=="function"&&d?jsxRuntime.jsx(ge,{size:o,className:"mt-1",children:r(d)}):t?jsxRuntime.jsx(Pe,{size:o,className:"mt-1",children:t}):null})]})}function KD({isPlaceholder:e,isDisabled:t,size:r="md"}){return tailwindMerge.twMerge("inline-block box-content px-0.5 rounded outline-none tabular-nums text-center transition-colors",{sm:"text-base md:text-xs",md:"text-base md:text-sm",lg:"text-base",xl:"text-lg"}[r],e?"text-text-disabled italic":"text-text-primary",t?"text-text-disabled cursor-not-allowed":"cursor-text",!t&&"hover:bg-background-hover","data-[focused]:bg-background-selected data-[focused]:text-text-primary")}function zs({size:e="md",isDisabled:t,isInvalid:r,hasCalendar:o,className:n,...a}){return jsxRuntime.jsx(reactAriaComponents.DateInput,{className:tailwindMerge.twMerge(an({isInvalid:r,isDisabled:t}),"px-3 py-2 flex items-center gap-0.5 w-full",o&&"pr-10",n),...a,children:i=>jsxRuntime.jsx(reactAriaComponents.DateSegment,{segment:i,className:KD({isPlaceholder:i.isPlaceholder,isDisabled:!i.isEditable||t,size:e})})})}function sd({label:e,description:t,errorMessage:r,...o}){return jsxRuntime.jsxs(reactAriaComponents.DateRangePicker,{...o,className:ke(o.className,"group flex flex-col gap-1"),children:[e&&jsxRuntime.jsx(ze,{children:e}),jsxRuntime.jsxs(rh,{className:"w-auto min-w-[208px]",children:[jsxRuntime.jsx(zs,{slot:"start",className:"px-2 py-1.5 text-sm"}),jsxRuntime.jsx("span",{"aria-hidden":"true",className:"text-text-primary group-disabled:text-text-disabled forced-colors:text-[ButtonText] group-disabled:forced-colors:text-[GrayText]",children:"\u2013"}),jsxRuntime.jsx(zs,{slot:"end",className:"flex-1 px-2 py-1.5 text-sm"}),jsxRuntime.jsx(re,{variant:"icon",className:"mr-1 w-6 rounded outline-offset-0",children:jsxRuntime.jsx(lucideReact.CalendarIcon,{"aria-hidden":true,className:"h-4 w-4"})})]}),t&&jsxRuntime.jsx(Pe,{children:t}),typeof r=="string"?jsxRuntime.jsx(ge,{children:r}):null,jsxRuntime.jsx(lt,{children:jsxRuntime.jsx(Ti,{})})]})}var e3=e=>{let t=Wt({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused,transparent:e.transparent,size:e.size});return tailwindMerge.twMerge(t,"pr-9","[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",e.className)};function Hs({label:e,description:t,errorMessage:r,size:o="md",tooltip:n,isRequired:a,transparent:i,validationResult:s,reserveErrorSpace:c=true,descriptionPlacement:l="below",...d}){let u=He.useId(),{isFocused:p,handleFocus:m,handleBlur:f}=Or();return jsxRuntime.jsx(reactAriaComponents.NumberField,{...d,id:u,isRequired:a,className:ke(d.className,"group flex flex-col gap-1"),step:d.step??1,onChange:g=>{typeof g=="number"&&(d.maxValue!=null&&g>d.maxValue?d.onChange?.(d.maxValue):d.minValue!=null&&g<d.minValue?d.onChange?.(d.minValue):d.onChange?.(g));},isInvalid:!!r||typeof d.value=="number"&&(d.maxValue!=null&&d.value>d.maxValue||d.minValue!=null&&d.value<d.minValue),children:({isDisabled:g,isInvalid:b})=>jsxRuntime.jsxs("div",{className:"flex flex-col gap-1",children:[e&&jsxRuntime.jsx(ze,{size:o,tooltip:n,description:l==="tooltip"||l==="inline"?t:void 0,descriptionPlacement:l,isRequired:a,htmlFor:u,children:e}),jsxRuntime.jsx("div",{className:"relative",children:jsxRuntime.jsxs(reactAriaComponents.Group,{className:"relative",children:[jsxRuntime.jsx(reactAriaComponents.Input,{onFocus:h=>m(h,d.onFocus),onBlur:h=>f(h,d.onBlur),className:e3({isInvalid:b||!!r,isDisabled:g,isFocused:p,transparent:i,size:o,className:typeof d.className=="string"?d.className:void 0})}),jsxRuntime.jsxs("div",{className:"absolute inset-y-[2px] right-[2px] flex flex-col divide-y divide-border-default border-l border-border-default overflow-hidden rounded-r-[calc(var(--control-border-radius)-2px)]",children:[jsxRuntime.jsx(reactAriaComponents.Button,{slot:"increment",isDisabled:g,className:"flex h-1/2 w-7 items-center justify-center bg-background-input hover:bg-background-input-hover active:bg-background-input-active disabled:cursor-not-allowed disabled:opacity-50",children:jsxRuntime.jsx(U,{name:"CaretUp",size:14})}),jsxRuntime.jsx(reactAriaComponents.Button,{slot:"decrement",isDisabled:g,className:"flex h-1/2 w-7 items-center justify-center bg-background-input hover:bg-background-input-hover active:bg-background-input-active disabled:cursor-not-allowed disabled:opacity-50",children:jsxRuntime.jsx(U,{name:"CaretDown",size:14})})]})]})}),c?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:r?jsxRuntime.jsx(ge,{size:o,children:typeof r=="function"?r(s):r}):t&&l==="below"?jsxRuntime.jsx(Pe,{size:o,children:t}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:r?jsxRuntime.jsx(ge,{size:o,className:"mt-1",children:typeof r=="function"?r(s):r}):t&&l==="below"?jsxRuntime.jsx(Pe,{size:o,className:"mt-1",children:t}):null})]})})}var Pf={sm:{track:"h-4 w-7",handle:"h-3.5 w-3.5",text:"text-xs"},md:{track:"h-5 w-9",handle:"h-4 w-4",text:"text-sm"},lg:{track:"h-6 w-11",handle:"h-5 w-5",text:"text-base"},xl:{track:"h-7 w-14",handle:"h-6 w-6",text:"text-lg"}};function o3({isSelected:e,isDisabled:t,size:r="md"}){let o="flex px-px items-center shrink-0 cursor-default rounded-full transition duration-200 ease-in-out shadow-inner border border-transparent",n=Pf[r].track,a=$e,i="focus-visible:outline-action-primary",s="";return e?s="bg-action-primary forced-colors:!bg-[Highlight] group-pressed:bg-action-primary-hover":s="bg-border-input group-pressed:bg-border-focus",[o,n,a,i,s,t?"bg-background-muted forced-colors:group-selected:!bg-[GrayText] forced-colors:border-[GrayText]":""].filter(Boolean).join(" ")}function n3({isSelected:e,isDisabled:t,size:r="md"}){let o="transform rounded-full bg-background-surface outline-none shadow transition duration-200 ease-in-out",n=Pf[r].handle;return [o,n,e?"translate-x-[100%]":"translate-x-0",t?"forced-colors:outline-[GrayText]":""].filter(Boolean).join(" ")}function ld({children:e,variant:t="primary",size:r="md",...o}){return jsxRuntime.jsx(reactAriaComponents.Switch,{...o,className:ke(o.className,`group flex items-center gap-2 ${Pf[r].text} text-text-primary transition disabled:text-text-disabled forced-colors:disabled:text-[GrayText]`),children:n=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:o3({...n,size:r}),children:jsxRuntime.jsx("span",{className:n3({...n,size:r})})}),e]})})}function P0(e){return new Intl.NumberFormat("en-US").format(e)}function R0({isOpen:e,onClose:t,facetConfigs:r,facetCounts:o={},currentFilters:n,onApply:a,onClear:i,title:s="Filters",resultCount:c}){let[l,d]=He.useState(n),[u,p]=He.useState({}),[m,f]=He.useState({}),[g,b]=He.useState(null),{isMobile:x}=_t(),h=He.useMemo(()=>r.some(C=>C.group),[r]),{groups:y,ungroupedFacets:v,facetsByGroup:S}=He.useMemo(()=>{let C=new Set,W=[],G={};for(let F of r)F.group?(C.has(F.group)||(C.add(F.group),G[F.group]=[]),G[F.group].push(F)):W.push(F);return {groups:Array.from(C),ungroupedFacets:W,facetsByGroup:G}},[r]);He.useEffect(()=>{e&&(d(n),p({}),f({}),b(!x&&y.length>0?y[0]:null));},[e,n,y,x]);let w=He.useMemo(()=>!l||nd(l)?0:xa(l).length,[l]),N=()=>{a(l),t();},D=()=>{let C=Bs();d(C),i?i():a(C),t();},R=C=>{if(!l)return [];if(!xa(l).includes(C))return [];let G=[];function F(Z){if(Z)for(let _ of Z.conditions)"conditions"in _?F(_):_.field===C&&_.operator==="in"&&Array.isArray(_.value)&&G.push(..._.value.map(String));}return F(l),G},A=(C,W,G)=>{let F=ba(l,C);W!==void 0&&(F=Sn(F,{field:C,operator:"gte",value:W})),G!==void 0&&(F=Sn(F,{field:C,operator:"lte",value:G})),d(F);},O=C=>{if(!l)return;let W;function G(F){if(F)for(let Z of F.conditions)"conditions"in Z?G(Z):Z.field===C&&Z.operator==="eq"&&typeof Z.value=="boolean"&&(W=Z.value);}return G(l),W},P=(C,W)=>{let G=ba(l,C);W!==void 0&&(G=Sn(G,{field:C,operator:"eq",value:W})),d(G);},T=(C,W,G)=>{let F=ba(l,C);W&&(F=Sn(F,{field:C,operator:"gte",value:W.toString()})),G&&(F=Sn(F,{field:C,operator:"lte",value:G.toString()})),d(F);},k=C=>{let W=S[C]||[],G=l?xa(l):[];return W.filter(F=>G.includes(F.field)).length},V="pr-9 bg-background-muted/50",H="border-t border-border-muted",I="text-sm font-medium text-text-link-default",q=C=>jsxRuntime.jsx("span",{className:I,children:C}),j=C=>{let W=o[C.field]||{},G=u[C.field]||"",F=[];C.values?F=C.values.map(L=>({value:String(L.value),label:L.label,count:W[String(L.value)]})):F=Object.entries(W).map(([L,oe])=>({value:L,label:L,count:oe}));let Z=F.length;if(G){let L=G.toLowerCase();F=F.filter(oe=>oe.label.toLowerCase().includes(L));}F.sort((L,oe)=>L.count!==void 0&&oe.count!==void 0&&oe.count!==L.count?oe.count-L.count:L.label.localeCompare(oe.label));let _=C.type||"string";if(_==="string"||!C.type){let L=R(C.field),oe=C.searchThreshold??10,ie=C.maxVisibleOptions??50,ne=m[C.field]??false,ae=ne||F.length<=ie?F:F.slice(0,ie),ce=F.length>ie&&!ne;return jsxRuntime.jsxs(dn,{id:C.field,children:[jsxRuntime.jsx(un,{title:C.label,description:C.description,className:V,endContent:L.length>0?q(`${L.length} selected`):void 0}),jsxRuntime.jsx(pn,{className:H,children:jsxRuntime.jsxs("div",{className:"space-y-4 pt-4 pb-4",children:[Z>oe&&jsxRuntime.jsx(ha,{value:G,onChange:Ce=>p(te=>({...te,[C.field]:Ce})),onClear:()=>p(Ce=>({...Ce,[C.field]:""})),placeholder:`Search ${C.label.toLowerCase()}...`,size:"sm",className:"w-full !max-w-none pr-4"}),jsxRuntime.jsx(vm,{value:L,onChange:Ce=>{let te=ba(l,C.field);Ce.length>0&&(te=Sn(te,{field:C.field,operator:"in",value:Ce})),d(te);},children:jsxRuntime.jsx("div",{className:"space-y-1.5",children:ae.map(Ce=>jsxRuntime.jsx("div",{className:"rounded-md py-2 pr-4 transition-colors hover:bg-background-hover",children:jsxRuntime.jsx(Zn,{value:Ce.value,children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-3 flex-1",children:[C.renderLabel?C.renderLabel(Ce.value,Ce.label):jsxRuntime.jsx("span",{className:"text-sm font-medium text-text-primary",children:Ce.label}),Ce.count!==void 0&&jsxRuntime.jsx("span",{className:"text-xs font-medium text-text-secondary tabular-nums",children:P0(Ce.count)})]})})},Ce.value))})}),ce&&jsxRuntime.jsx("div",{className:"pt-2 border-t border-border-muted",children:jsxRuntime.jsxs(re,{variant:"ghost",size:"sm",onPress:()=>f(Ce=>({...Ce,[C.field]:true})),className:"w-full",children:["Show all ",F.length," options"]})}),ne&&F.length>ie&&jsxRuntime.jsx("div",{className:"pt-2 border-t border-border-muted",children:jsxRuntime.jsx(re,{variant:"ghost",size:"sm",onPress:()=>f(Ce=>({...Ce,[C.field]:false})),className:"w-full",children:"Show less"})})]})})]},C.field)}if(_==="number"){let L,oe,ie=ae=>{if(ae)for(let ce of ae.conditions)"conditions"in ce?ie(ce):ce.field===C.field&&(ce.operator==="gte"&&typeof ce.value=="number"&&(L=ce.value),ce.operator==="lte"&&typeof ce.value=="number"&&(oe=ce.value));};ie(l);let ne=L!==void 0||oe!==void 0;return jsxRuntime.jsxs(dn,{id:C.field,children:[jsxRuntime.jsx(un,{title:C.label,description:C.description,className:V,endContent:ne?q(L!==void 0&&oe!==void 0?`${L} - ${oe}`:L!==void 0?`\u2265 ${L}`:`\u2264 ${oe}`):void 0}),jsxRuntime.jsx(pn,{className:H,children:jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-4 pt-4 pb-4",children:[jsxRuntime.jsx(Hs,{label:"Min",value:L,onChange:ae=>A(C.field,ae,oe)},`${C.field}-min`),jsxRuntime.jsx(Hs,{label:"Max",value:oe,onChange:ae=>A(C.field,L,ae)},`${C.field}-max`)]})})]},C.field)}if(_==="boolean"){let L=O(C.field);return jsxRuntime.jsxs(dn,{id:C.field,children:[jsxRuntime.jsx(un,{title:C.label,description:C.description,className:V,endContent:L!==void 0?q(L?"Yes":"No"):void 0}),jsxRuntime.jsx(pn,{className:H,children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between pt-4 pb-4",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium text-text-primary",children:L!==void 0?L?"Enabled":"Disabled":"No filter applied"}),jsxRuntime.jsx(ld,{size:"lg",isSelected:L??false,onChange:oe=>P(C.field,oe?true:void 0),children:L?"Yes":"No"})]})})]},C.field)}if(_==="date"){let L,oe,ie=te=>{if(te)for(let ye of te.conditions)"conditions"in ye?ie(ye):ye.field===C.field&&(ye.operator==="gte"&&(L=String(ye.value)),ye.operator==="lte"&&(oe=String(ye.value)));};ie(l);let ne=L!==void 0||oe!==void 0,ae=te=>{if(te)try{return /^\d{4}-\d{2}-\d{2}$/.test(te)?ls(te):void 0}catch{return}},ce=ae(L),Ce=ae(oe);return jsxRuntime.jsxs(dn,{id:C.field,children:[jsxRuntime.jsx(un,{title:C.label,description:C.description,className:V,endContent:ne?q("Date range selected"):void 0}),jsxRuntime.jsx(pn,{className:H,children:jsxRuntime.jsx("div",{className:"pt-4 pb-4",children:jsxRuntime.jsx(sd,{label:"Date Range",value:ce&&Ce?{start:ce,end:Ce}:void 0,onChange:te=>{te?T(C.field,te.start,te.end):T(C.field,void 0,void 0);}})})})]},C.field)}return null},K=()=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[v.map(C=>{let G=(l?xa(l):[]).includes(C.field);return jsxRuntime.jsxs("button",{type:"button",onClick:()=>b(`__ungrouped__${C.field}`),className:"flex items-center justify-between px-6 py-3 text-left hover:bg-background-hover border-b border-border-muted transition-colors",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium text-text-primary",children:C.label}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[G&&jsxRuntime.jsx("span",{className:I,children:"1 active"}),jsxRuntime.jsx(U,{name:"CaretRight",size:"sm",className:"text-text-secondary"})]})]},C.field)}),y.map(C=>{let W=k(C);return jsxRuntime.jsxs("button",{type:"button",onClick:()=>b(C),className:"flex items-center justify-between px-6 py-3 text-left hover:bg-background-hover border-b border-border-muted transition-colors",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium text-text-primary",children:C}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[W>0&&jsxRuntime.jsxs("span",{className:I,children:[W," active"]}),jsxRuntime.jsx(U,{name:"CaretRight",size:"sm",className:"text-text-secondary"})]})]},C)})]}),Y=C=>{if(C.startsWith("__ungrouped__")){let G=C.replace("__ungrouped__",""),F=v.find(Z=>Z.field===G);return F?jsxRuntime.jsx(oi,{variant:"contained",density:"comfortable",showDividers:true,defaultExpandedKeys:[F.field],children:j(F)}):null}let W=S[C]||[];return W.length===0?null:jsxRuntime.jsx(oi,{variant:"contained",density:"comfortable",showDividers:true,defaultExpandedKeys:[W[0].field],children:W.map(G=>j(G))})},M=()=>{if(g){let C=g.startsWith("__ungrouped__")&&v.find(W=>W.field===g.replace("__ungrouped__",""))?.label||g;return jsxRuntime.jsxs("div",{className:"flex flex-col h-full",children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>b(null),className:"flex items-center gap-2 px-4 py-3 border-b border-border-muted hover:bg-background-hover transition-colors",children:[jsxRuntime.jsx(U,{name:"CaretLeft",size:"sm",className:"text-text-secondary"}),jsxRuntime.jsx("span",{className:"text-sm font-medium text-text-primary",children:C})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto",children:Y(g)})]})}return K()},E=()=>jsxRuntime.jsxs("div",{className:"flex h-full",children:[jsxRuntime.jsxs("div",{className:"w-48 flex-shrink-0 border-r border-border-muted overflow-y-auto bg-background-muted/30",children:[v.map(C=>{let G=(l?xa(l):[]).includes(C.field),F=g===`__ungrouped__${C.field}`;return jsxRuntime.jsxs("button",{type:"button",onClick:()=>b(`__ungrouped__${C.field}`),className:`flex items-center justify-between w-full px-4 py-3 text-left border-b border-border-muted transition-colors ${F?"bg-background-selected":"hover:bg-background-hover"}`,children:[jsxRuntime.jsx("span",{className:`text-sm truncate ${F?"font-semibold text-text-primary":"font-medium text-text-primary"}`,children:C.label}),G&&jsxRuntime.jsx("span",{className:"w-2 h-2 rounded-full bg-action-primary flex-shrink-0 ml-2"})]},C.field)}),y.map(C=>{let W=k(C),G=g===C;return jsxRuntime.jsxs("button",{type:"button",onClick:()=>b(C),className:`flex items-center justify-between w-full px-4 py-3 text-left border-b border-border-muted transition-colors ${G?"bg-background-selected":"hover:bg-background-hover"}`,children:[jsxRuntime.jsx("span",{className:`text-sm truncate ${G?"font-semibold text-text-primary":"font-medium text-text-primary"}`,children:C}),W>0&&jsxRuntime.jsx("span",{className:"w-2 h-2 rounded-full bg-action-primary flex-shrink-0 ml-2"})]},C)})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto",children:g?Y(g):jsxRuntime.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-sm",children:"Select a category to view filters"})})]}),z=()=>jsxRuntime.jsx(oi,{variant:"contained",density:"comfortable",showDividers:true,defaultExpandedKeys:[r[0].field],children:r.map(C=>j(C))});return jsxRuntime.jsx(Ir,{isOpen:e,onClose:t,title:h&&x&&g?g.startsWith("__ungrouped__")?v.find(C=>C.field===g.replace("__ungrouped__",""))?.label||s:g:w>0?`${s} (${w} active)`:s,hideCloseIcon:false,primaryAction:{label:"Apply filters",onPress:N,variant:"primary"},secondaryAction:{label:"Clear all",onPress:D},maxWidth:h?"800px":"700px",height:"600px",mobileHeight:"85vh",contentPadding:false,footerContent:c!==void 0?jsxRuntime.jsxs("div",{className:"text-sm text-text-secondary text-center",children:[jsxRuntime.jsx("span",{className:"font-semibold text-text-primary",children:P0(c)})," ",c===1?"result":"results"," with current filters"]}):void 0,children:r.length===0?jsxRuntime.jsx("div",{className:"py-12 text-center",children:jsxRuntime.jsx("div",{className:"text-sm font-medium text-text-secondary",children:"No filters available"})}):h?x?M():E():z()})}function Mf(e="left"){switch(e){case "center":return "justify-center text-center";case "right":return "justify-end text-right";default:return "justify-start text-left"}}function Ur(e="normal",t){return tailwindMerge.twMerge({strong:"font-semibold text-text-primary",high:"font-semibold text-text-primary",normal:"text-text-primary",low:"text-text-secondary"}[e],t&&"hover:text-action-primary cursor-pointer transition-colors")}function Me(e="left",t){return tailwindMerge.twMerge("flex items-center gap-1 min-w-0 overflow-hidden",Mf(e),t)}function ud(e,t="\u2014"){return e==null||e===""?t:String(e)}var wn={xs:"h-4 w-12",sm:"h-4 w-20",md:"h-4 w-24",lg:"h-4 w-32",xl:"h-4 w-40"};function mr(e="normal"){return {strong:wn.lg,high:wn.lg,normal:wn.md,low:wn.sm}[e]}function we(e,t){return typeof e=="function"?e(t):e}function M0(e="neutral",t="sm"){return tailwindMerge.twMerge("inline-flex items-center rounded-full font-medium",t==="sm"?"px-2 py-0.5 text-xs":"px-2.5 py-1 text-sm",{success:"bg-feedback-success-background text-feedback-success-text",error:"bg-feedback-error-background text-feedback-error-text",warning:"bg-feedback-warning-background text-feedback-warning-text",info:"bg-feedback-info-background text-feedback-info-text",neutral:"bg-background-muted text-text-secondary"}[e])}function D0(e){return e?"success":"neutral"}function pd(e,t=false){return t?e>0?"text-feedback-success-text":e<0?"text-feedback-error-text":"text-text-primary":"text-text-primary"}function Df(e="hover",t="secondary"){let r={primary:"text-action-primary hover:text-action-primary-hover visited:text-action-primary",secondary:"text-text-link-default hover:text-text-link-hover visited:text-text-link-default",default:"text-text-link-default hover:text-text-link-hover visited:text-text-link-default",brand:"text-action-primary hover:text-action-primary-hover visited:text-action-primary",muted:"text-text-secondary hover:text-text-secondary visited:text-text-secondary",unstyled:""},o={visible:"underline underline-offset-4 decoration-1 cursor-pointer",hover:"hover:underline hover:underline-offset-4 hover:decoration-1 cursor-pointer transition-colors",none:"cursor-pointer"},n=r[t],a=o[e]||"";return `${n} ${a}`.trim()}function To(e,t,r,o="hover",n="secondary",a,i){if(!t)return e;let s=typeof t=="function"&&r?t(r):t,c=Df(o,n);return jsxRuntime.jsx("a",{href:s,className:tailwindMerge.twMerge(c,a==="strong"||a==="high"?"font-semibold":"",i),onClick:d=>{d.metaKey||d.ctrlKey;},children:e})}function E0({row:e,context:t,actions:r,align:o="right",size:n="sm"}){let{isLoading:a}=t;if(a)return jsxRuntime.jsx(J,{className:wn.sm});let s=(typeof r=="function"?r(e):r).filter(l=>!we(l.hidden,e));if(s.length===0)return null;let c=Me(o);return jsxRuntime.jsx("div",{className:c,children:s.map(l=>{let d=we(l.disabled,e);return l.variant==="icon"||!l.label?jsxRuntime.jsx(re,{variant:"icon",size:n,onPress:()=>{l.onClick(e);},isDisabled:d,"aria-label":l.label||l.id,children:jsxRuntime.jsx(U,{name:l.icon||"DotsThree",size:n==="sm"?16:20})},l.id):jsxRuntime.jsxs(re,{variant:l.variant||"secondary",size:n,onPress:()=>{l.onClick(e);},isDisabled:d,children:[l.icon&&jsxRuntime.jsx(U,{name:l.icon,size:n==="sm"?14:16}),l.label]},l.id)})})}function A0({value:e,row:t,context:r,variant:o="default",label:n,size:a="sm",shape:i="square",dot:s,dotPosition:c="left",dotPulse:l,align:d="left",emptyText:u="\u2014",className:p,maxVisible:m=2,maxLabelLength:f}){let{isLoading:g}=r,b=(w,N)=>{if(!f||w.length<=f)return jsxRuntime.jsx(jsxRuntime.Fragment,{children:w});let D=w.slice(0,f-1)+"\u2026";return jsxRuntime.jsx(nr,{content:N,children:jsxRuntime.jsx("span",{children:D})})};if(g)return jsxRuntime.jsx(J,{className:mr("normal")});if(e==null||e==="")return jsxRuntime.jsx("div",{className:Me(d,"text-text-secondary"),children:u});if(Array.isArray(e)&&e.length===0)return jsxRuntime.jsx("div",{className:Me(d,"text-text-secondary"),children:u});let x=Me(d,p);if(Array.isArray(e)){let w=e.slice(0,m),N=e.slice(m),D=N.length>0;return jsxRuntime.jsx("div",{className:x,children:jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[w.map((R,A)=>{let O=typeof o=="function"?o(R,t):o,P=typeof n=="function"?n(R,t):n!==void 0?n:String(R),T=typeof s=="function"?s(R,t):s,k=typeof l=="function"?l(R,t):l;return jsxRuntime.jsx("span",{className:"flex-shrink-0 whitespace-nowrap",children:jsxRuntime.jsx(at,{variant:O,size:a,shape:i,dot:T,dotPosition:c,dotPulse:k,children:b(P,P)})},A)}),D&&jsxRuntime.jsx(nr,{content:N.join(", "),children:jsxRuntime.jsx("span",{className:"flex-shrink-0 whitespace-nowrap",children:jsxRuntime.jsxs(at,{variant:"neutral",size:a,shape:i,children:["+",N.length]})})})]})})}let h=typeof o=="function"?o(e,t):o,y=typeof n=="function"?n(e,t):n!==void 0?n:String(e),v=typeof s=="function"?s(e,t):s,S=typeof l=="function"?l(e,t):l;return jsxRuntime.jsx("div",{className:x,children:jsxRuntime.jsx(at,{variant:h,size:a,shape:i,dot:v,dotPosition:c,dotPulse:S,children:b(y,y)})})}function I0({value:e,context:t,format:r="icon",trueText:o="Yes",falseText:n="No",trueIcon:a="Check",falseIcon:i="X",showFalse:s=true,align:c="center",emphasis:l="normal",className:d}){let{isLoading:u}=t;if(u)return jsxRuntime.jsx(J,{className:mr(l)});let p=!!e;if(!p&&!s)return jsxRuntime.jsx("div",{className:Me(c,d)});let m=Me(c,d);switch(r){case "icon":return jsxRuntime.jsx("div",{className:m,children:jsxRuntime.jsx(U,{name:p?a:i,size:16,className:p?"text-feedback-success-text":"text-text-disabled"})});case "text":return jsxRuntime.jsx("div",{className:m,children:jsxRuntime.jsx("span",{className:Ur(l),children:p?o:n})});case "badge":return jsxRuntime.jsx("div",{className:m,children:jsxRuntime.jsx(at,{variant:p?"success":"neutral",size:"sm",children:p?o:n})});default:return null}}function B0({row:e,context:t,firstName:r,lastName:o,email:n,avatarUrl:a,layout:i="stacked",size:s="sm",href:c,LinkComponent:l,linkVariant:d="secondary",showEmail:u=false,badge:p,emphasis:m="normal",align:f="left",className:g,piiEntity:b}){let{isLoading:x}=t,h=we(r,e),y=we(o,e),v=we(n,e),S=we(a,e),w=we(c,e),N=typeof p=="function"?p(e):p,D=we(b,e),R=Me(f,g);return jsxRuntime.jsx("div",{className:R,children:jsxRuntime.jsx(fc,{firstName:h,lastName:y,email:v,avatarUrl:S,layout:i,size:s,href:w,LinkComponent:l,linkVariant:d,showEmail:u,badge:N,emphasis:m,isLoading:x,piiEntity:D})})}function V0({value:e,row:t,context:r,render:o,className:n}){let a=o(e,t,r);return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("h-full w-full",n),children:a})}function O0({value:e,row:t,context:r,format:o="date",customFormat:n,emptyText:a="\u2014",align:i="left",emphasis:s="normal",href:c,linkBehavior:l="hover",className:d}){let{isLoading:u}=r;if(u)return jsxRuntime.jsx(J,{className:mr(s)});if(!e)return jsxRuntime.jsx("div",{className:Me(i,"text-text-secondary"),children:a});let p=e instanceof Date?e:new Date(e);if(isNaN(p.getTime()))return jsxRuntime.jsx("div",{className:Me(i,"text-text-secondary"),children:a});let m;switch(o){case "date":m=p.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"});break;case "time":m=p.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});break;case "datetime":m=p.toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});break;case "relative":m=f3(p);break;case "custom":m=n?p.toLocaleString("en-US",n):p.toISOString();break;default:m=p.toLocaleDateString();}let f=Me(i,tailwindMerge.twMerge(Ur(s),d)),g=we(c,t);return g?jsxRuntime.jsx("div",{className:f,children:To(m,g,t,l)}):jsxRuntime.jsx("div",{className:f,children:m})}function f3(e){let r=new Date().getTime()-e.getTime(),o=Math.floor(r/1e3),n=Math.floor(o/60),a=Math.floor(n/60),i=Math.floor(a/24);return o<60?"just now":n<60?`${n} minute${n!==1?"s":""} ago`:a<24?`${a} hour${a!==1?"s":""} ago`:i<7?`${i} day${i!==1?"s":""} ago`:e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function md({manufacturer:e,model:t,deviceType:r,deviceTypeIconName:o,logoUrl:n,layout:a="stacked",size:i="md",href:s,LinkComponent:c,linkVariant:l="unstyled",showDeviceTypeIcon:d=true,showLogo:u=true,emphasis:p="normal",isLoading:m=false,className:f,piiEntity:g}){let[b,x]=He.useState(false),h=o||(r?b3(r):"DeviceMobile"),v={xs:{iconSize:28,logoSize:"w-7 h-7",gap:"gap-1.5",textSize:"text-xs",secondaryTextSize:"text-xs",iconInTextSize:12,skeletonIcon:28,skeletonText:80,skeletonSecondary:60},sm:{iconSize:32,logoSize:"w-8 h-8",gap:"gap-2",textSize:"text-sm",secondaryTextSize:"text-xs",iconInTextSize:14,skeletonIcon:32,skeletonText:96,skeletonSecondary:72},md:{iconSize:32,logoSize:"w-9 h-9",gap:"gap-3",textSize:"text-base",secondaryTextSize:"text-sm",iconInTextSize:16,skeletonIcon:36,skeletonText:128,skeletonSecondary:96},lg:{iconSize:40,logoSize:"w-10 h-10",gap:"gap-3",textSize:"text-lg",secondaryTextSize:"text-base",iconInTextSize:18,skeletonIcon:40,skeletonText:160,skeletonSecondary:120}}[i],S=n&&!b&&u,N={strong:"font-semibold text-text-primary",high:"font-semibold text-text-primary",normal:"text-text-primary",low:"text-text-secondary"}[p],D=({children:R,className:A})=>s?c?jsxRuntime.jsx(c,{href:s,className:A,children:R}):jsxRuntime.jsx(tt,{href:s,variant:l,className:tailwindMerge.twMerge("hover:underline",A),asButton:false,children:R}):jsxRuntime.jsx("span",{className:A,children:R});if(m)return a==="inline"?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center",v.gap,f),children:[jsxRuntime.jsx(J,{width:v.skeletonIcon,height:v.skeletonIcon,className:"flex-shrink-0 rounded"}),jsxRuntime.jsx(J,{width:v.skeletonText,height:v.skeletonIcon*.6})]}):jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center",v.gap,f),children:[jsxRuntime.jsx(J,{width:v.skeletonIcon,height:v.skeletonIcon,className:"flex-shrink-0"}),jsxRuntime.jsxs("div",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx(J,{width:v.skeletonText,height:16}),jsxRuntime.jsx(J,{width:v.skeletonSecondary,height:12})]})]});if(a==="inline"){let R=`${e} ${t}`;return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center",v.gap,f),children:[jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-shrink-0 flex items-center justify-center rounded border border-border-muted",v.logoSize),children:S?jsxRuntime.jsx("img",{src:n,alt:`${e} logo`,className:"w-full h-full object-contain",onError:()=>x(true)}):jsxRuntime.jsx(U,{name:h,size:v.iconSize*.6,className:"text-text-secondary"})}),jsxRuntime.jsx(D,{className:tailwindMerge.twMerge("truncate leading-normal hover:text-text-primary",N,v.textSize,s&&"hover:underline hover:decoration-1 hover:underline-offset-4"),children:jsxRuntime.jsx("span",{"data-pii-type":g?"device-name":void 0,"data-pii-entity":g,children:R})})]})}return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center justify-start",v.gap,f),children:[u&&jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-shrink-0 flex items-center justify-center rounded border border-border-muted",v.logoSize),children:S?jsxRuntime.jsx("img",{src:n,alt:`${e} logo`,className:"w-full h-full object-contain",onError:()=>x(true)}):jsxRuntime.jsx(U,{name:h,size:v.iconSize*.6,className:"text-text-secondary"})}),jsxRuntime.jsxs("div",{className:"flex flex-col items-start min-w-0",children:[jsxRuntime.jsx(D,{className:tailwindMerge.twMerge("truncate leading-normal hover:text-text-primary",N,v.textSize,s&&"hover:underline hover:decoration-1 hover:underline-offset-4"),children:jsxRuntime.jsx("span",{"data-pii-type":g?"device-name":void 0,"data-pii-entity":g,children:e})}),jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center gap-1.5 text-text-secondary leading-normal",v.secondaryTextSize),children:[d&&jsxRuntime.jsx(U,{name:h,size:v.iconInTextSize,className:"flex-shrink-0"}),jsxRuntime.jsx("span",{className:"truncate","data-pii-type":g?"device-name":void 0,"data-pii-entity":g,children:t})]})]})]})}function b3(e){switch(e){case "battery":return "BatteryHigh";case "charger":return "ChargingStation";case "inverter":return "Power";case "thermostat":return "ThermometerSimple";case "vehicle":return "CarSimple";case "water_heater":return "DropHalfBottom";case "meter":return "Gauge";default:return "DeviceMobile"}}function H0({row:e,context:t,manufacturer:r,model:o,deviceType:n,logoUrl:a,layout:i="stacked",size:s="sm",href:c,LinkComponent:l,linkVariant:d="secondary",showDeviceTypeIcon:u=true,showLogo:p=true,emphasis:m="normal",align:f="left",className:g,piiEntity:b}){let{isLoading:x}=t,h=we(r,e),y=we(o,e),v=we(n,e),S=we(a,e),w=we(c,e),N=we(b,e),D=Me(f,g);return jsxRuntime.jsx("div",{className:D,children:jsxRuntime.jsx(md,{manufacturer:h,model:y,deviceType:v,logoUrl:S,layout:i,size:s,href:w,LinkComponent:l,linkVariant:d,showDeviceTypeIcon:u,showLogo:p,emphasis:m,isLoading:x,piiEntity:N})})}var Ree={charging:"percentage",discharging:"percentage",on:"kW",idle:void 0,off:void 0,heat:"temperature",cool:"temperature",auto:"temperature",eco:"temperature",unknown:void 0,connected:void 0,disconnected:void 0},x3=["charging","discharging","heat","cool","on","connected"],h3={unknown:"Unknown",on:"On",off:"Off",idle:"Idle",charging:"Charging",discharging:"Discharging",heat:"Heating",eco:"Eco Mode",cool:"Cooling",auto:"Auto",connected:"Connected",disconnected:"Disconnected"};function Ef(e){return x3.includes(e)}function Lf(e){return h3[e]}function va({state:e,label:t,icon:r,isLoading:o,size:n="sm",shape:a="pill",dot:i,dotPulse:s,fixedWidth:c,className:l,...d}){if(o)return jsxRuntime.jsx(J,{className:"inline-flex h-6 w-20"});let u=t??Lf(e),p=Ef(e);return jsxRuntime.jsxs(at,{variant:e,size:n,shape:a,dot:i??p,dotPulse:s??p,className:c?`w-28 justify-center ${l||""}`:l,...d,children:[r&&jsxRuntime.jsx(U,{name:r,size:n==="sm"?12:n==="md"?14:16}),u]})}var v3={importing:"Importing",exporting:"Exporting"};function G0(e){return v3[e]}function gd({state:e,label:t,showIcon:r=false,isLoading:o,size:n="sm",shape:a="pill",fixedWidth:i,className:s,...c}){if(o)return jsxRuntime.jsx(J,{className:"inline-flex h-6 w-24"});let l=t??G0(e),d=e==="exporting"?"ArrowUp":"ArrowDown",u=n==="sm"?12:n==="md"?14:16;return r?jsxRuntime.jsx(at,{variant:e,size:n,shape:a,className:`w-6 justify-center ${s||""}`,...c,children:jsxRuntime.jsx(U,{name:d,size:u})}):jsxRuntime.jsx(at,{variant:e,size:n,shape:a,className:i?`w-28 justify-center ${s||""}`:s,...c,children:l})}function bd({state:e,stateLabel:t,metric:r,metricFormatter:o,secondaryState:n,layout:a="horizontal",isLoading:i,size:s="sm",shape:c="pill",icon:l,fixedWidth:d,secondaryStateIconOnly:u=false,className:p}){if(i)return jsxRuntime.jsx(J,{className:tailwindMerge.twMerge("inline-flex h-6 w-32",p)});let m=r!=null&&o?jr(r,o):null,f=a==="horizontal",g=o&&!m;return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("inline-flex items-center",f?"gap-2":"flex-col gap-1",p),children:[(m||g)&&jsxRuntime.jsx("span",{className:tailwindMerge.twMerge("font-medium inline-block",m?"text-text-primary":"text-text-secondary",s==="sm"&&"text-xs min-w-12",s==="md"&&"text-sm min-w-14",s==="lg"&&"text-base min-w-16"),children:m||"\u2014"}),jsxRuntime.jsx(va,{state:e,label:t,icon:l,size:s,shape:c,fixedWidth:d}),n&&jsxRuntime.jsx(jsxRuntime.Fragment,{children:n==="importing"||n==="exporting"?jsxRuntime.jsx(gd,{state:n,size:s,shape:c,fixedWidth:d,showIcon:u}):jsxRuntime.jsx(va,{state:n,size:s,shape:c,fixedWidth:d})})]})}function U0({value:e,row:t,context:r,metric:o,metricFormatter:n,secondaryState:a,size:i="sm",shape:s="pill",label:c,icon:l,fixedWidth:d=true,align:u="left",compact:p=false,className:m}){let{isLoading:f}=r;if(f){let v={pill:"rounded-full",rounded:"rounded-lg",square:"rounded-sm"}[s],S=o!=null||n!=null;return jsxRuntime.jsx("div",{className:"flex items-center gap-2",children:S?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(J,{className:"h-4 w-12"}),jsxRuntime.jsx(J,{className:`h-6 w-24 ${v}`}),jsxRuntime.jsx(J,{className:`h-6 w-20 ${v}`})]}):jsxRuntime.jsx(J,{className:`h-6 w-24 ${v}`})})}if(!e)return jsxRuntime.jsx("div",{className:Me(u,m),children:jsxRuntime.jsx("span",{className:"text-text-secondary",children:"\u2014"})});let g=we(o,t),b=we(a,t),x=typeof c=="function"?c(e,t):c,h=Me(u,m);return g!=null||n?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(h),children:jsxRuntime.jsx(bd,{state:e,stateLabel:x,metric:g,metricFormatter:n,secondaryState:b||void 0,size:i,shape:s,icon:l,fixedWidth:d,secondaryStateIconOnly:p,layout:"horizontal"})}):jsxRuntime.jsx("div",{className:h,children:jsxRuntime.jsx(va,{state:e,label:x,icon:l,size:i,shape:s,fixedWidth:d})})}function K0({value:e,row:t,context:r,formatter:o,align:n="left",emphasis:a="normal",href:i,linkBehavior:s="hover",className:c,emptyText:l="\u2014",emptyClassName:d="text-text-secondary"}){let{isLoading:u}=r;if(u)return jsxRuntime.jsx(J,{className:mr(a)});let p=lo({value:e,formatter:o,emptyText:l,emptyClassName:d}),m=Ur(a),f=Me(n,tailwindMerge.twMerge(m,c)),g=jsxRuntime.jsx("div",{className:f,children:p}),b=we(i,t);return b?To(g,b,t,s):g}var If=He__namespace.default.memo(({value:e,min:t,max:r,color:o="var(--color-viz-default)",backgroundColor:n="var(--color-background-muted)",colorScale:a,showLabel:i=true,formatLabel:s,height:c=20,minWidth:l=4,segments:d,segmentGap:u=2,barWidth:p,context:m})=>{let f=He.useMemo(()=>r===t?100:Math.max(0,Math.min(100,(e-t)/(r-t)*100)),[e,t,r]),g=He.useMemo(()=>o==="auto"&&a?a.type==="diverging"&&a.center!==void 0?$i(e,t,r,a.center,a.scheme):Ji(e,t,r,a.scheme):o,[o,a,e,t,r]);if(m.isLoading)return jsxRuntime.jsx("div",{className:"flex items-center gap-2 w-full",style:{height:c},children:jsxRuntime.jsx("div",{className:"h-full flex-1 animate-pulse bg-border-default rounded"})});if(d&&d>0){let h=`calc((100% - ${u*(d-1)}px) / ${d})`,y=Math.ceil(f/100*d),v={height:c,...p&&{width:typeof p=="number"?`${p}px`:p,flexShrink:0}};return jsxRuntime.jsxs("div",{className:"flex items-center gap-2 w-full",children:[jsxRuntime.jsx("div",{className:`flex gap-0.5 ${p?"":"flex-1"}`,style:v,children:Array.from({length:d}).map((S,w)=>{let N=w<y;return jsxRuntime.jsx("div",{className:"rounded-sm",style:{width:h,backgroundColor:N?g:n==="none"?"transparent":n,marginRight:w<d-1?`${u}px`:0}},w)})}),i&&jsxRuntime.jsx("span",{className:"text-sm text-text-primary whitespace-nowrap",children:s?s(e):e.toLocaleString()})]})}let b={height:c,backgroundColor:n==="none"?"transparent":n,...p&&{width:typeof p=="number"?`${p}px`:p,flexShrink:0}};return jsxRuntime.jsxs("div",{className:"flex items-center gap-2 w-full",children:[jsxRuntime.jsx("div",{className:`relative rounded-sm ${p?"":"flex-1"}`,style:b,children:jsxRuntime.jsx("div",{className:"absolute left-0 top-0 h-full rounded-sm",style:{width:`${f}%`,minWidth:f>0?l:0,backgroundColor:g}})}),i&&jsxRuntime.jsx("span",{className:"text-sm text-text-primary whitespace-nowrap",children:s?s(e):e.toLocaleString()})]})});If.displayName="HorizontalBarCell";var Ff=He__namespace.default.memo(({value:e,data:t,color:r="var(--color-viz-default)",categoryColors:o,context:n,width:a,height:i=40})=>{let s=e||t||[],c=b=>"xValue"in b?b.xValue:b.x,l=b=>"yValue"in b?b.yValue:b.y,d=a||100,u=i,{xScale:p,yScale:m,barWidth:f}=He.useMemo(()=>{if(s.length===0)return {xScale:scale.scaleTime({range:[0,d],domain:[new Date,new Date]}),yScale:scale.scaleLinear({range:[u,0],domain:[0,1]}),barWidth:2};let b=d3Array.extent(s,N=>c(N)),x=d3Array.min(s,N=>l(N))??0,h=d3Array.max(s,N=>l(N))??0,y=x<0?x:0,v=scale.scaleTime({range:[0,d],domain:b}),S=scale.scaleLinear({range:[u,0],domain:[y,h*1.05]}),w=s.length>1?d/s.length*.8:8;return {xScale:v,yScale:S,barWidth:Math.max(2,w)}},[s,d,u]);if(n.isLoading)return jsxRuntime.jsx("div",{className:"flex items-center gap-0.5",style:{width:d,height:u},children:Array.from({length:5}).map((b,x)=>jsxRuntime.jsx("div",{className:"flex-1 animate-pulse bg-border-default rounded"},x))});if(!s||s.length===0)return jsxRuntime.jsx("div",{className:"flex items-center justify-center text-text-secondary text-xs",style:{width:d,height:u},children:"No data"});let g=m(0);return jsxRuntime.jsx("svg",{width:d,height:u,children:s.map((b,x)=>{let h=l(b),y=p(c(b)),v=m(h),S=Math.abs(g-v),w=b.category&&o?.[b.category]?o[b.category]:r;return jsxRuntime.jsx(shape.Bar,{x:y-f/2,y:h>=0?v:g,width:f,height:S,fill:w,rx:1},`bar-${x}`)})})});Ff.displayName="MiniBarCell";function X0({value:e,row:t,context:r,format:o="number",decimals:n=0,prefix:a,suffix:i,emptyText:s="\u2014",align:c="right",emphasis:l="normal",href:d,linkBehavior:u="hover",showPositiveSign:p=false,colorCode:m=false,className:f}){let{isLoading:g}=r;if(g)return jsxRuntime.jsx(J,{className:mr(l)});if(e==null||isNaN(Number(e)))return jsxRuntime.jsx("div",{className:Me(c,"text-text-secondary"),children:s});let b=Number(e),x;switch(o){case "currency":x=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:n,maximumFractionDigits:n}).format(b);break;case "percent":x=new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:n,maximumFractionDigits:n}).format(b/100);break;case "compact":x=new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:n>0?1:0,maximumFractionDigits:n}).format(b);break;default:x=new Intl.NumberFormat("en-US",{minimumFractionDigits:n,maximumFractionDigits:n}).format(b);}let y=`${p&&b>0?"+":""}${x}`,v=m?pd(b,true):Ur(l),S=Me(c,tailwindMerge.twMerge(v,f)),w=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[a&&jsxRuntime.jsx("span",{className:"text-text-secondary",children:a}),jsxRuntime.jsx("span",{children:y}),i&&jsxRuntime.jsx("span",{className:"text-text-secondary",children:i})]}),N=we(d,t);return N?jsxRuntime.jsx("div",{className:S,children:To(w,N,t,u)}):jsxRuntime.jsx("div",{className:S,children:w})}var Bf=He__namespace.default.memo(({value:e,showLabel:t=true,color:r="var(--color-viz-categorical-1)",backgroundColor:o="var(--color-background-muted)",height:n=20,segments:a,segmentGap:i=2,colorScale:s,context:c})=>{let l=He.useMemo(()=>Math.max(0,Math.min(100,e)),[e]),d=He.useMemo(()=>r==="auto"&&s?s.type==="diverging"&&s.center!==void 0?$i(e,0,100,s.center,s.scheme):Ji(e,0,100,s.scheme):r,[r,s,e]);if(c.isLoading)return jsxRuntime.jsx("div",{className:"flex items-center gap-2",style:{height:n},children:jsxRuntime.jsx("div",{className:"h-full w-full animate-pulse bg-border-default rounded"})});if(a&&a>0){let p=`calc((100% - ${i*(a-1)}px) / ${a})`,m=Math.ceil(l/100*a);return jsxRuntime.jsxs("div",{className:"flex items-center gap-2 w-full",children:[jsxRuntime.jsx("div",{className:"flex gap-0.5 flex-1",style:{height:n},children:Array.from({length:a}).map((f,g)=>{let b=g<m,x=d;if(r==="auto"&&s&&b){let h=(g+1)/a*100;s.type==="diverging"&&s.center!==void 0?x=$i(h,0,100,s.center,s.scheme):x=Ji(h,0,100,s.scheme);}return jsxRuntime.jsx("div",{className:"rounded-sm",style:{width:p,backgroundColor:b?x:o==="none"?"transparent":o,marginRight:g<a-1?`${i}px`:0}},g)})}),t&&jsxRuntime.jsxs("span",{className:"text-sm text-text-primary whitespace-nowrap",children:[l.toFixed(0),"%"]})]})}return jsxRuntime.jsxs("div",{className:"flex items-center gap-2 w-full",children:[jsxRuntime.jsx("div",{className:"relative flex-1 rounded-sm",style:{height:n,backgroundColor:o==="none"?"transparent":o},children:jsxRuntime.jsx("div",{className:"absolute left-0 top-0 h-full rounded-sm transition-all duration-300",style:{width:`${l}%`,backgroundColor:d}})}),t&&jsxRuntime.jsxs("span",{className:"text-sm text-text-primary whitespace-nowrap",children:[l.toFixed(0),"%"]})]})});Bf.displayName="PercentBarCell";function Q0({row:e,context:t,isSelected:r=false,onSelect:o,isDisabled:n=false,align:a="center"}){let{isLoading:i}=t;if(i)return jsxRuntime.jsx("div",{className:Me(a),children:jsxRuntime.jsx(J,{className:"h-4 w-4 rounded"})});let s=we(n,e),c=Me(a);return jsxRuntime.jsx("div",{className:c,children:jsxRuntime.jsx(Zn,{isSelected:r,onChange:l=>{o?.(e,l);},isDisabled:s,"aria-label":"Select row"})})}function yd({streetAddress:e,city:t,state:r,postalCode:o,layout:n="stacked",size:a="md",href:i,LinkComponent:s,linkVariant:c="unstyled",emphasis:l="normal",isLoading:d=false,className:u,piiEntity:p}){let f={xs:{iconSize:16,iconContainerSize:"w-7 h-7",gap:"gap-1.5",textSize:"text-xs",secondaryTextSize:"text-xs",skeletonIconStacked:28,skeletonIconInline:16,skeletonText:80,skeletonSecondary:60},sm:{iconSize:20,iconContainerSize:"w-8 h-8",gap:"gap-2",textSize:"text-sm",secondaryTextSize:"text-xs",skeletonIconStacked:32,skeletonIconInline:20,skeletonText:96,skeletonSecondary:72},md:{iconSize:24,iconContainerSize:"w-9 h-9",gap:"gap-3",textSize:"text-base",secondaryTextSize:"text-sm",skeletonIconStacked:36,skeletonIconInline:24,skeletonText:128,skeletonSecondary:96},lg:{iconSize:28,iconContainerSize:"w-10 h-10",gap:"gap-3",textSize:"text-lg",secondaryTextSize:"text-base",skeletonIconStacked:40,skeletonIconInline:28,skeletonText:160,skeletonSecondary:120}}[a],b={strong:"font-semibold text-text-primary",high:"font-semibold text-text-primary",normal:"text-text-primary",low:"text-text-secondary"}[l],x=[];t&&x.push(t),r&&o?x.push(`${r} ${o}`):r?x.push(r):o&&x.push(o);let h=x.join(", "),y=({children:S,className:w})=>i?s?jsxRuntime.jsx(s,{href:i,className:w,children:S}):jsxRuntime.jsx(tt,{href:i,variant:c,className:tailwindMerge.twMerge("hover:underline",w),asButton:false,children:S}):jsxRuntime.jsx("span",{className:w,children:S});if(d)return n==="inline"?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center",f.gap,u),children:[jsxRuntime.jsx(J,{width:f.skeletonIconInline,height:f.skeletonIconInline,className:"flex-shrink-0 rounded"}),jsxRuntime.jsx(J,{width:f.skeletonText,height:f.skeletonIconInline*.8})]}):jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center",f.gap,u),children:[jsxRuntime.jsx(J,{width:f.skeletonIconStacked,height:f.skeletonIconStacked,className:"flex-shrink-0 rounded"}),jsxRuntime.jsxs("div",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx(J,{width:f.skeletonText,height:16}),jsxRuntime.jsx(J,{width:f.skeletonSecondary,height:12})]})]});if(n==="inline")return jsxRuntime.jsxs(y,{className:tailwindMerge.twMerge("flex items-center",f.gap,i&&"hover:bg-background-hover transition-colors",u),children:[jsxRuntime.jsx(U,{name:"MapPin",size:f.iconSize,className:"text-text-secondary flex-shrink-0"}),jsxRuntime.jsx("span",{className:tailwindMerge.twMerge("leading-normal truncate hover:text-text-primary",b,f.textSize,i&&"hover:underline hover:decoration-1 hover:underline-offset-4"),"data-pii-type":p?"address":void 0,"data-pii-entity":p,children:e})]});let v=()=>{if(p){if(t&&r&&o)return "city-state-zip";if(t&&r)return "city-state";if(t)return "city";if(r)return "state";if(o)return "postal-code"}};return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center justify-start",f.gap,u),children:[jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-shrink-0 flex items-center justify-center rounded border border-border-muted",f.iconContainerSize),children:jsxRuntime.jsx(U,{name:"MapPin",size:f.iconSize,className:"text-text-secondary"})}),jsxRuntime.jsxs("div",{className:"flex flex-col items-start min-w-0",children:[jsxRuntime.jsx(y,{className:tailwindMerge.twMerge("leading-normal truncate hover:text-text-primary",b,f.textSize,i&&"hover:underline hover:decoration-1 hover:underline-offset-4"),children:jsxRuntime.jsx("span",{"data-pii-type":p?"address":void 0,"data-pii-entity":p,children:e})}),h&&jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("text-text-secondary leading-normal truncate",f.secondaryTextSize),"data-pii-type":v(),"data-pii-entity":p,children:h})]})]})}function eC({row:e,context:t,streetAddress:r,city:o,state:n,postalCode:a,layout:i="stacked",size:s="sm",href:c,LinkComponent:l,linkVariant:d="secondary",emphasis:u="normal",align:p="left",className:m,piiEntity:f}){let{isLoading:g}=t,b=we(r,e),x=we(o,e),h=we(n,e),y=we(a,e),v=we(c,e),S=we(f,e),w=Me(p,m);return jsxRuntime.jsx("div",{className:w,children:jsxRuntime.jsx(yd,{streetAddress:b,city:x,state:h,postalCode:y,layout:i,size:s,href:v,LinkComponent:l,linkVariant:d,emphasis:u,isLoading:g,piiEntity:S})})}var Vf=He__namespace.default.memo(({value:e,data:t,type:r="line",color:o="var(--color-viz-default)",strokeWidth:n=2,categoryColors:a,context:i,width:s,height:c=40})=>{let l=e||t||[],d=s||100,u=c,{xScale:p,yScale:m}=He.useMemo(()=>{if(l.length===0)return {xScale:scale.scaleTime({range:[0,d],domain:[new Date,new Date]}),yScale:scale.scaleLinear({range:[u,0],domain:[0,1]})};let g=d3Array.extent(l,y=>y.xValue),b=d3Array.min(l,y=>y.yValue)||0,x=d3Array.max(l,y=>y.yValue)||0,h=(x-b)*.1||1;return {xScale:scale.scaleTime({range:[0,d],domain:g}),yScale:scale.scaleLinear({range:[u,0],domain:[b-h,x+h]})}},[l,d,u]);if(i.isLoading)return jsxRuntime.jsx("div",{className:"flex items-center",style:{width:d,height:u},children:jsxRuntime.jsx("div",{className:"h-1 w-full animate-pulse bg-border-default rounded"})});if(!l||l.length===0)return jsxRuntime.jsx("div",{className:"flex items-center justify-center text-text-secondary text-xs",style:{width:d,height:u},children:"No data"});let f=a&&l[0]?.category&&a[l[0].category]?a[l[0].category]:o;return jsxRuntime.jsxs("svg",{width:d,height:u,className:"overflow-visible",children:[(r==="area"||r==="both")&&jsxRuntime.jsx(shape.AreaClosed,{data:l,x:g=>p(g.xValue),y:g=>m(g.yValue),yScale:m,fill:f,fillOpacity:.15,curve:curve.curveLinear}),(r==="line"||r==="both")&&jsxRuntime.jsx(shape.LinePath,{data:l,x:g=>p(g.xValue),y:g=>m(g.yValue),stroke:f,strokeWidth:n,strokeLinecap:"round",curve:curve.curveLinear})]})});Vf.displayName="SparklineCell";function nC({value:e,row:t,context:r,prefix:o,suffix:n,emptyText:a="\u2014",href:i,linkBehavior:s="hover",linkVariant:c="secondary",emphasis:l="normal",truncate:d=true,copyable:u=false,align:p="left",className:m,piiType:f,piiEntity:g}){let{isLoading:b}=r;if(b)return jsxRuntime.jsx(J,{className:mr(l)});let x=ud(e,a),h=we(i,t),y=we(g,t),v=x,S=false,w=false;if(d&&x&&typeof x=="string")if(typeof d=="boolean")w=true;else {let{position:k="end",length:V=16,ellipsis:H="...",tooltip:I=true}=d;if(x.length>V){switch(k){case "start":v=vl(x,V);break;case "middle":v=Wa(x,V);break;case "end":v=Cl(x,V,H);break}S=I;}}let N=f&&y?{"data-pii-type":f,"data-pii-entity":y}:{},D=Object.keys(N).length>0,R=jsxRuntime.jsx("span",{className:w?"truncate":"",...N,children:v}),A=S?jsxRuntime.jsx(nr,{content:D?jsxRuntime.jsx("span",{...N,children:String(x)}):String(x),children:R}):R,O=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[o&&jsxRuntime.jsx("span",{className:"text-text-secondary",children:o}),A,n&&jsxRuntime.jsx("span",{className:"text-text-secondary",children:n})]}),P=O;if(u&&x&&x!==a){let k=typeof u=="function"?u(t):String(x);P=jsxRuntime.jsx(sn,{value:k,size:"sm",children:O});}if(h){let k=Me(p,m);return jsxRuntime.jsx("div",{className:k,children:To(P,h,t,s,c,l)})}let T=Me(p,tailwindMerge.twMerge(Ur(l),m));return jsxRuntime.jsx("div",{className:T,children:P})}var $3={sm:"sm:hidden",md:"md:hidden",lg:"lg:hidden",xl:"xl:hidden"},X3={sm:"hidden sm:grid",md:"hidden md:grid",lg:"hidden lg:grid",xl:"hidden xl:grid"};function vd(e,t){return t.accessor?typeof t.accessor=="function"?t.accessor(e):e[t.accessor]:null}function Cd(e,t,r,o){if(r.cell){let n=r.cell,a=typeof r.cellProps=="function"?r.cellProps(e,t):r.cellProps;return jsxRuntime.jsx(n,{value:e,row:t,context:o,...a})}return r.render?r.render(e,t,o):e?.toString()??"\u2014"}function wd({row:e,columns:t,density:r,isLoading:o,onClick:n}){let a=t.filter(u=>u.mobile!==false).map(u=>{let p=u.mobile===false?null:u.mobile;return {...u,mobilePriority:p?.priority??2,mobileFormat:p?.format??"secondary",showLabel:p?.label??p?.format==="secondary",icon:p?.icon}}).sort((u,p)=>u.mobilePriority-p.mobilePriority),i=a.filter(u=>u.mobilePriority===1||u.mobileFormat==="primary"),s=a.filter(u=>u.mobilePriority===2&&u.mobileFormat!=="primary"),c=a.filter(u=>u.mobileFormat==="badge"),l={isLoading:!!o,rowIndex:0,columnIndex:0,density:r};return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("border-b border-border-default bg-background-surface transition-colors",n&&"cursor-pointer hover:bg-background-hover active:bg-background-pressed",{compact:"px-3 py-2",default:"px-4 py-3",relaxed:"px-4 py-4"}[r]),onClick:n,role:n?"button":void 0,tabIndex:n?0:void 0,children:[i.length>0&&jsxRuntime.jsxs("div",{className:"mb-2 flex items-start justify-between",children:[jsxRuntime.jsx("div",{className:"flex-1",children:i.map(u=>{let p=vd(e,u);return jsxRuntime.jsx("div",{className:"font-medium text-text-primary [&>*]:!justify-start [&>*]:!text-left",children:Cd(p,e,u,l)},u.id)})}),c.length>0&&jsxRuntime.jsx("div",{className:"ml-2 flex flex-wrap gap-1",children:c.map(u=>{let p=vd(e,u);return jsxRuntime.jsx("div",{className:"inline-flex",children:Cd(p,e,u,l)},u.id)})})]}),s.length>0&&jsxRuntime.jsx("div",{className:"space-y-1",children:s.map(u=>{let p=vd(e,u),m=u.showLabel&&u.label;return jsxRuntime.jsxs("div",{className:"flex items-center text-sm text-text-secondary",children:[u.icon&&jsxRuntime.jsx(U,{name:u.icon,className:"mr-1.5 h-4 w-4 flex-shrink-0"}),m&&jsxRuntime.jsxs("span",{className:"mr-1 font-medium",children:[u.label,":"]}),jsxRuntime.jsx("span",{className:"truncate [&>*]:!justify-start [&>*]:!text-left",children:Cd(p,e,u,l)})]},u.id)})})]})}function Td({row:e,columns:t,density:r,isLoading:o,onClick:n}){let a=t.filter(c=>c.mobile!==false),i={isLoading:!!o,rowIndex:0,columnIndex:0,density:r};return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("border-b border-border-default bg-background-surface transition-colors",n&&"cursor-pointer hover:bg-background-hover active:bg-background-pressed",{compact:"px-3 py-2",default:"px-4 py-3",relaxed:"px-4 py-4"}[r]),onClick:n,role:n?"button":void 0,tabIndex:n?0:void 0,children:jsxRuntime.jsx("div",{className:"space-y-2",children:a.map((c,l)=>{let d=vd(e,c),u=l===0;return jsxRuntime.jsxs("div",{children:[!u&&jsxRuntime.jsx("div",{className:"text-xs text-text-secondary",children:c.label}),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(u?"font-medium text-text-primary":"text-sm text-text-primary","[&>*]:!justify-start [&>*]:!text-left"),children:Cd(d,e,c,i)})]},c.id)})})})}function aC(e="md"){return {mobile:$3[e],desktop:X3[e]}}function iC({density:e}){return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("border-b border-border-default bg-background-surface",{compact:"px-3 py-2",default:"px-4 py-3",relaxed:"px-4 py-4"}[e]),children:[jsxRuntime.jsx("div",{className:"mb-2 h-5 w-3/4 animate-pulse rounded bg-background-muted"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsx("div",{className:"h-4 w-1/2 animate-pulse rounded bg-background-muted"}),jsxRuntime.jsx("div",{className:"h-4 w-2/3 animate-pulse rounded bg-background-muted"})]})]})}var cE={compact:"py-1.5 px-3 text-sm",default:"py-3 px-4 text-sm",relaxed:"py-4 px-4 text-base"},dE={left:"text-left justify-start",center:"text-center justify-center",right:"text-right justify-end"};function uE(e){let t={};return e.width!==void 0&&(t.width=typeof e.width=="number"?`${e.width}px`:e.width),e.minWidth!==void 0&&(t.minWidth=typeof e.minWidth=="number"?`${e.minWidth}px`:e.minWidth),e.maxWidth!==void 0&&(t.maxWidth=typeof e.maxWidth=="number"?`${e.maxWidth}px`:e.maxWidth),e.flex!==void 0&&(t.flex=`${e.flex} 1 0`),t}function pE({column:e,sortConfig:t,onSort:r,stickyHeader:o,stickyFirstColumn:n,isFirstColumn:a,density:i="default",isLoading:s=false}){let c=e.reorderable!==false,{attributes:l,listeners:d,setNodeRef:u,transform:p,transition:m,isDragging:f}=sortable.useSortable({id:e.id,disabled:!c||s}),g=t?.columnId===e.id,b=g?t.direction:null,x=n&&a,h={...uE(e),transform:utilities.CSS.Transform.toString(p),transition:m,opacity:f?.8:1,zIndex:f?50:void 0};return jsxRuntime.jsx("div",{ref:u,className:tailwindMerge.twMerge("flex items-center border-b border-border-default bg-background-surface",e.sortable?"gap-2":"gap-1",cE[i],dE[e.align||"left"],o&&"sticky top-0 z-10",x&&"sticky left-0 z-20 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.1)]",o&&x&&"z-30",e.sortable&&!s&&"hover:bg-background-hover",s&&"cursor-not-allowed opacity-60",g?"font-bold text-text-primary":"font-medium text-text-secondary",f&&"bg-background-hover"),style:h,role:"columnheader","aria-sort":g?b==="asc"?"ascending":"descending":"none","aria-disabled":s,...l,...d,children:s?jsxRuntime.jsx(J,{className:"h-4 w-24"}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"flex-1 truncate cursor-pointer",onClick:()=>!s&&e.sortable&&r(e.id),children:e.label}),e.sortable&&jsxRuntime.jsx("button",{type:"button",className:"flex flex-shrink-0 cursor-pointer",onClick:()=>!s&&r(e.id),"aria-label":`Sort by ${e.label}`,children:g?jsxRuntime.jsx(U,{name:b==="asc"?"CaretUp":"CaretDown",size:14,weight:"bold",className:"text-text-primary"}):jsxRuntime.jsx(U,{name:"CaretUpDown",size:12,className:"text-text-secondary opacity-40"})})]})})}function lC({columns:e,columnOrder:t,onColumnOrderChange:r,sortConfig:o,onSort:n,stickyHeader:a,stickyFirstColumn:i,density:s="default",isLoading:c=false}){let l=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:5}}),core.useSensor(core.KeyboardSensor,{coordinateGetter:sortable.sortableKeyboardCoordinates})),d=new Map(e.map(m=>[m.id,m])),u=m=>{let{active:f,over:g}=m;if(g&&f.id!==g.id){let b=t.indexOf(f.id),x=t.indexOf(g.id);if(d.get(g.id)?.reorderable===false)return;let y=0;for(let N=0;N<t.length&&d.get(t[N])?.reorderable===false;N++)y=N+1;if(x<y)return;let v=Math.min(b,x),S=Math.max(b,x);for(let N=v;N<=S;N++){if(N===b)continue;if(d.get(t[N])?.reorderable===false)return}let w=sortable.arrayMove(t,b,x);r(w);}},p=t.map(m=>d.get(m)).filter(m=>m!==void 0);return jsxRuntime.jsx(core.DndContext,{sensors:l,collisionDetection:core.closestCenter,onDragEnd:u,children:jsxRuntime.jsx(sortable.SortableContext,{items:t,strategy:sortable.horizontalListSortingStrategy,children:jsxRuntime.jsx("div",{className:"contents",role:"rowgroup",children:p.map((m,f)=>jsxRuntime.jsx(pE,{column:m,sortConfig:o,onSort:n,stickyHeader:a,stickyFirstColumn:i,isFirstColumn:f===0,density:s,isLoading:c},m.id))})})})}var Wf={compact:"py-1.5 px-3 text-sm",default:"py-3 px-4 text-sm",relaxed:"py-4 px-4 text-base"},Gf={left:"text-left justify-start",center:"text-center justify-center",right:"text-right justify-end"},hE={full:"w-full",auto:"w-auto inline-block",contained:"w-full max-w-6xl mx-auto"},yE={auto:"table-auto",fixed:"table-fixed",responsive:"table-auto"};function Uf(e){let t={};return e.width!==void 0&&(t.width=typeof e.width=="number"?`${e.width}px`:e.width),e.minWidth!==void 0&&(t.minWidth=typeof e.minWidth=="number"?`${e.minWidth}px`:e.minWidth),e.maxWidth!==void 0&&(t.maxWidth=typeof e.maxWidth=="number"?`${e.maxWidth}px`:e.maxWidth),e.flex!==void 0&&(t.flex=`${e.flex} 1 0`),t}function vE(e,t){return t.accessor?typeof t.accessor=="function"?t.accessor(e):e[t.accessor]:null}function CE({column:e,sortConfig:t,onSort:r,stickyHeader:o,stickyFirstColumn:n,isFirstColumn:a,density:i="default",isLoading:s=false}){let c=t?.columnId===e.id,l=c?t.direction:null,d=n&&a;return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex items-center border-b border-border-default bg-background-surface",e.sortable?"gap-2":"gap-1",Wf[i],Gf[e.align||"left"],o&&"sticky top-0 z-10",d&&"sticky left-0 z-20 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.1)]",o&&d&&"z-30",e.sortable&&!s&&"cursor-pointer hover:bg-background-hover",s&&"cursor-not-allowed opacity-60",c?"font-bold text-text-primary":"font-medium text-text-secondary"),onClick:()=>!s&&e.sortable&&r(e.id),role:"columnheader","aria-sort":c?l==="asc"?"ascending":"descending":"none","aria-disabled":s,style:Uf(e),children:s?jsxRuntime.jsx(J,{className:"h-4 w-24"}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"truncate",children:e.label}),e.sortable&&jsxRuntime.jsx("div",{className:"flex flex-shrink-0",children:c?jsxRuntime.jsx(U,{name:l==="asc"?"CaretUp":"CaretDown",size:14,weight:"bold",className:"text-text-primary"}):jsxRuntime.jsx(U,{name:"CaretUpDown",size:12,className:"text-text-secondary opacity-40"})})]})})}function SE({column:e,row:t,rowIndex:r,columnIndex:o,isHovered:n,density:a="default",className:i,stickyFirstColumn:s}){let c=s&&o===0,l=vE(t,e),d={isLoading:false,isHovered:n,rowIndex:r,columnIndex:o,density:a},u;if(e.cell){let p=e.cell,m=typeof e.cellProps=="function"?e.cellProps(l,t):e.cellProps;u=jsxRuntime.jsx(p,{value:l,row:t,context:d,...m});}else e.render?u=e.render(l,t,d):u=jsxRuntime.jsx("span",{className:"truncate",children:l?.toString()??""});if(e.popover){let p=e.popover,m,f="top",g=false,b="hover";typeof p=="string"?m=p:typeof p=="function"?m=p(l,t):(m=typeof p.content=="function"?p.content(l,t):p.content,f=p.placement||"top",g=p.showArrow??false,b=p.trigger||"hover"),u=jsxRuntime.jsxs(reactAriaComponents.DialogTrigger,{...b==="hover"?{trigger:"longPress"}:{},children:[jsxRuntime.jsx("div",{className:"cursor-help",children:u}),jsxRuntime.jsx(lt,{placement:f,showArrow:g,children:jsxRuntime.jsx("div",{className:"p-2",children:m})})]});}return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex items-center border-b border-border-default bg-background-surface",e.noCellPadding?"":Wf[a],Gf[e.align||"left"],c&&"sticky left-0 z-10 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.1)]",i),role:"cell",style:Uf(e),children:u})}function wE({column:e,rowIndex:t,columnIndex:r,density:o="default",stickyFirstColumn:n}){let a=n&&r===0,i={isLoading:true,rowIndex:t,columnIndex:r,density:o},s;if(e.cell){let c=e.cell,l=typeof e.cellProps=="function"?e.cellProps(null,{}):e.cellProps;s=jsxRuntime.jsx(c,{value:null,row:{},context:i,...l});}else e.render?s=e.render(null,{},i):s=jsxRuntime.jsx(J,{className:"h-4 w-full max-w-[200px]"});return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex items-center border-b border-border-default bg-background-surface",e.noCellPadding?"":Wf[o],Gf[e.align||"left"],a&&"sticky left-0 z-10 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.1)]"),role:"cell",style:Uf(e),children:s})}function TE(e,t){let r=new Set(["BUTTON","A","INPUT","SELECT","TEXTAREA"]),o=new Set(["button","link","checkbox","switch","menuitem","option"]),n=e;for(;n&&n!==t;){if(r.has(n.tagName))return true;let a=n.getAttribute("role");if(a&&o.has(a))return true;n=n.parentElement;}return false}function cC({columns:e,row:t,rowIndex:r,density:o="default",onClick:n,stickyFirstColumn:a}){let[i,s]=He.useState(false),c=He.useCallback(l=>{if(!n)return;let d=l.target,u=l.currentTarget;TE(d,u)||n(t);},[n,t]);return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("contents group",n&&"cursor-pointer"),role:"row",onClick:c,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),children:e.map((l,d)=>jsxRuntime.jsx(SE,{column:l,row:t,rowIndex:r,columnIndex:d,isHovered:i,density:o,className:n?"group-hover:bg-background-hover":"",stickyFirstColumn:a},l.id))})}function dC({columns:e,rowIndex:t,density:r="default",stickyFirstColumn:o}){return jsxRuntime.jsx("div",{className:"contents",role:"row",children:e.map((n,a)=>jsxRuntime.jsx(wE,{column:n,rowIndex:t,columnIndex:a,density:r,stickyFirstColumn:o},n.id))})}function uC({columns:e,data:t,className:r,density:o="default",width:n="full",height:a,maxHeight:i,layout:s="auto",mobileRenderer:c="auto",customMobileRowRender:l,mobileBreakpoint:d="md",isLoading:u=false,loadingState:p,loadingRowCount:m=5,onLoadMore:f,hasMore:g=false,enableVirtualization:b,estimatedRowHeight:x,loadingIndicator:h,stickyHeader:y=false,stickyFirstColumn:v=false,onRowClick:S,getRowId:w,hideHeader:N=false,sortConfig:D,onSort:R,"aria-label":A,enableColumnReorder:O=false,columnOrder:P,onColumnOrderChange:T}){let[k,V]=He.useState(null),H=D!==void 0,I=H?D:k,q=He.useRef(null),j=He.useMemo(()=>e.map(de=>de.id),[e]),[K,Y]=He.useState(j),M=P!==void 0,E=M?P:K;He.useEffect(()=>{M||Y(de=>{let le=e.map(ee=>ee.id),me=new Set(le),Q=new Set(de),X=de.filter(ee=>me.has(ee)),be=le.filter(ee=>!Q.has(ee));return [...X,...be]});},[e,M]);let z=He.useCallback(de=>{M||Y(de),T?.(de);},[M,T]),B=He.useMemo(()=>{if(!O&&!P)return e;let de=new Map(e.map(le=>[le.id,le]));return E.map(le=>de.get(le)).filter(le=>le!==void 0)},[e,E,O,P]),C=f?Qo({items:t,onLoadMore:f,hasMore:g,isLoading:u,loadingState:p,enableVirtualization:b,estimatedItemSize:x||(o==="compact"?40:o==="relaxed"?60:48),overscan:5}):null,W=C?.scrollRef??q,{loadMoreRef:G,virtualizer:F,virtualItems:Z,isLoadingMore:_,computedLoadingState:L}=C||{},{gridTemplateColumns:oe,totalMinWidth:ie}=He.useMemo(()=>{let de=0;return {gridTemplateColumns:B.map(me=>{if(me.minWidth?de+=typeof me.minWidth=="number"?me.minWidth:0:me.width&&typeof me.width=="number"&&(de+=me.width),me.width)return typeof me.width=="number"?`${me.width}px`:me.width;if(me.flex)return `${me.flex}fr`;if(me.minWidth&&me.maxWidth){let Q=typeof me.minWidth=="number"?`${me.minWidth}px`:me.minWidth,X=typeof me.maxWidth=="number"?`${me.maxWidth}px`:me.maxWidth;return `minmax(${Q}, ${X})`}return me.minWidth?`minmax(${typeof me.minWidth=="number"?`${me.minWidth}px`:me.minWidth}, 1fr)`:me.maxWidth?`minmax(0, ${typeof me.maxWidth=="number"?`${me.maxWidth}px`:me.maxWidth})`:"1fr"}).join(" "),totalMinWidth:de}},[B]),ne=He.useCallback(de=>{if(!e.find(Q=>Q.id===de)?.sortable)return;let me;I?.columnId===de?me={columnId:de,direction:I.direction==="asc"?"desc":"asc"}:me={columnId:de,direction:"asc"},H||V(me),R?.(me);},[e,I,R,H]),ae=L==="loading"||u&&t.length===0,ce={};a?(ce.height=typeof a=="number"?`${a}px`:a,ce.overflowY="auto"):i?(ce.maxHeight=typeof i=="number"?`${i}px`:i,ce.overflowY="auto"):f&&(ce.height="600px",ce.overflowY="auto");let Ce=tailwindMerge.twMerge(hE[n],!f&&(s==="responsive"?"overflow-x-auto scrollbar-visible":"overflow-auto scrollbar-visible"),r),te=aC(d),ye=c!=="none",qe=(de,le)=>ye?c==="custom"&&l?l(de,le):jsxRuntime.jsx(c==="cards"?Td:wd,{row:de,columns:B,density:o,isLoading:u,onClick:S?()=>S(de):void 0}):null,It=F?Z?.map(de=>({virtualItem:de,row:t[de.index],index:de.index}))||[]:t.map((de,le)=>({row:de,index:le,virtualItem:null}));return jsxRuntime.jsxs("div",{ref:W,className:Ce,style:{...ce,position:F?"relative":void 0},children:[jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("grid border-separate border-spacing-0",yE[s],n==="auto"?"inline-grid w-auto":"w-full",ye&&te.desktop),role:"table","aria-label":A,style:{gridTemplateColumns:oe,minWidth:ie>0?`${ie}px`:void 0},children:[!N&&(O?jsxRuntime.jsx(lC,{columns:e,columnOrder:E,onColumnOrderChange:z,sortConfig:I,onSort:ne,stickyHeader:y,stickyFirstColumn:v,density:o,isLoading:ae}):jsxRuntime.jsx("div",{className:"contents",role:"rowgroup",children:B.map((de,le)=>jsxRuntime.jsx(CE,{column:de,sortConfig:I,onSort:ne,stickyHeader:y,stickyFirstColumn:v,isFirstColumn:le===0,density:o,isLoading:ae},de.id))})),F?jsxRuntime.jsx("div",{className:"col-span-full",style:{gridColumn:"1 / -1",height:`${F.getTotalSize()}px`,position:"relative"},role:"rowgroup",children:ae?Array.from({length:m}).map((de,le)=>jsxRuntime.jsx("div",{className:"contents",children:jsxRuntime.jsx(dC,{columns:B,rowIndex:le,density:o,stickyFirstColumn:v})},`loading-${le}`)):t.length>0?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[It.map(({row:de,index:le,virtualItem:me})=>{if(!de||!me)return null;let Q=w?w(de):`row-${le}`;return jsxRuntime.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",display:"grid",gridTemplateColumns:oe,transform:`translateY(${me.start}px)`},"data-index":me.index,ref:F.measureElement,children:jsxRuntime.jsx(cC,{columns:B,row:de,rowIndex:le,density:o,onClick:S,stickyFirstColumn:v})},Q)}),_&&jsxRuntime.jsx("div",{style:{position:"absolute",top:`${F.getTotalSize()}px`,left:0,width:"100%"},children:h||jsxRuntime.jsx(Ar,{state:"loading-more"})})]}):jsxRuntime.jsx("div",{className:"py-12 text-center text-text-secondary",children:"No data available"})}):jsxRuntime.jsx("div",{className:"contents",role:"rowgroup",children:ae?Array.from({length:m}).map((de,le)=>jsxRuntime.jsx(dC,{columns:B,rowIndex:le,density:o,stickyFirstColumn:v},`loading-${le}`)):t.length>0?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[It.map(({row:de,index:le})=>{if(!de)return null;let me=w?w(de):`row-${le}`;return jsxRuntime.jsx(cC,{columns:B,row:de,rowIndex:le,density:o,onClick:S,stickyFirstColumn:v},me)}),_&&jsxRuntime.jsx("div",{className:"col-span-full",style:{gridColumn:"1 / -1"},children:h||jsxRuntime.jsx(Ar,{state:"loading-more"})})]}):jsxRuntime.jsx("div",{className:"col-span-full py-12 text-center text-text-secondary",role:"row",children:jsxRuntime.jsx("div",{role:"cell",children:"No data available"})})})]}),ye&&jsxRuntime.jsx("div",{className:te.mobile,children:ae?Array.from({length:m}).map((de,le)=>jsxRuntime.jsx(iC,{density:o},`mobile-loading-${le}`)):t.length>0?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[It.map(({row:de,index:le})=>{if(!de)return null;let me=w?w(de):`mobile-row-${le}`;return jsxRuntime.jsx("div",{className:"border-b border-border-default last:border-b-0",children:qe(de,le)},me)}),_&&(h||jsxRuntime.jsx(Ar,{state:"loading-more"}))]}):jsxRuntime.jsx("div",{className:"py-12 text-center text-text-secondary",children:"No data available"})}),f&&g&&!ae&&(F?jsxRuntime.jsx("div",{ref:G,style:{position:"absolute",top:`${F.getTotalSize()}px`,left:0,width:"100%",height:1}}):jsxRuntime.jsx("div",{ref:G,className:"h-px w-full"}))]})}function mC({status:e,alertCount:t,showCount:r=false,isLoading:o,size:n="sm",shape:a="pill",...i}){if(o)return jsxRuntime.jsx(J,{className:"inline-flex h-6 w-20"});let s={healthy:"success",warning:"warning",error:"error",unknown:"neutral"},c={healthy:"Healthy",warning:"Warning",error:"Error",unknown:"Unknown"},l=e==="warning"||e==="error",d=r&&t?`${c[e]} (${t})`:c[e];return jsxRuntime.jsx(at,{variant:s[e],size:n,shape:a,dot:l,dotPulse:l,...i,children:d})}var kE={battery:"BatteryHigh",charger:"ChargingStation",thermostat:"ThermometerSimple",inverter:"Power",vehicle:"Car",water_heater:"DropHalfBottom",meter:"Gauge",gateway:"WifiHigh",other:"Cube",unknown:"Question"},PE={battery:"Battery",charger:"Charger",thermostat:"Thermostat",inverter:"Inverter",vehicle:"Vehicle",water_heater:"Water Heater",meter:"Meter",gateway:"Gateway",other:"Other",unknown:"Unknown"};function gC({deviceType:e,iconName:t,size:r="md",showLabel:o=false,className:n}){let a=t||(e?kE[e]:"Question"),i=e?PE[e]:void 0;return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("inline-flex items-center",o?"flex-col gap-1":"gap-0",n),children:[jsxRuntime.jsx(U,{name:a,size:r}),o&&i&&jsxRuntime.jsx("span",{className:"text-xs text-text-secondary",children:i})]})}function Ks({children:e,title:t,headerContent:r,titleAlign:o="left",hideCloseIcon:n=false,hasBackArrow:a=false,onBack:i,isOpen:s,slideInFrom:c="right",transparentOverlay:l=false,onClose:d,className:u,primaryAction:p,secondaryAction:m,tertiaryAction:f,footerContent:g,contentPadding:b=true,maxWidth:x="400px"}){if(!s)return null;let h=t||r,y=p||m||f||g;return jsxRuntime.jsx($r,{children:jsxRuntime.jsx(br,{isOpen:s,onOpenChange:v=>!v&&d?.(),isDismissable:true,transparent:l,children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{className:tailwindMerge.twMerge("fixed top-0 bottom-0 flex flex-col bg-background-surface shadow-xl overflow-hidden",c==="right"?"right-0":"left-0",c==="right"?"animate-in slide-in-from-right duration-300 ease-out":"animate-in slide-in-from-left duration-300 ease-out","data-[exiting]:animate-out",c==="right"?"data-[exiting]:slide-out-to-right":"data-[exiting]:slide-out-to-left","data-[exiting]:duration-200 data-[exiting]:ease-in","outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-action-default focus-visible:outline-offset-0",u),style:{maxWidth:x,width:"100%"},children:[h&&(a&&i?jsxRuntime.jsx(Kt,{title:t,headerContent:r,titleAlign:o,hideCloseIcon:n,hasBackArrow:true,onBack:i,onClose:d}):jsxRuntime.jsx(Kt,{title:t,headerContent:r,titleAlign:o,hideCloseIcon:n,onClose:d})),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-1 overflow-y-auto overscroll-contain",b?"px-6 py-6":"p-0"),children:e}),y&&jsxRuntime.jsx(rn,{primaryAction:p,secondaryAction:m,tertiaryAction:f,footerContent:g})]})})})})}Ks.displayName="Drawer";function xC({status:e,programName:t,isLoading:r,size:o="sm",shape:n="pill",...a}){if(r)return jsxRuntime.jsx(J,{className:"inline-flex h-6 w-20"});let i={enrolled:"success",eligible:"info",pending:"warning",not_eligible:"neutral",opted_out:"neutral"},s={enrolled:"Enrolled",eligible:"Eligible",pending:"Pending",not_eligible:"Not Eligible",opted_out:"Opted Out"},c=jsxRuntime.jsx(at,{variant:i[e],size:o,shape:n,...a,children:s[e]});return t?jsxRuntime.jsx(nr,{content:t,children:c}):c}function yC({value:e,onChange:t,onUrlChange:r,accept:o="image/*",maxSize:n,isDisabled:a=false,onUpload:i,className:s,showPreview:c=true,placeholder:l="Drop files here or click to browse"}){let[d,u]=He.useState(false),[p,m]=He.useState(false),[f,g]=He.useState(null),[b,x]=He.useState(e),h=He.useRef(null),y=async w=>{if(g(null),n&&w.size>n){g(`File size must be less than ${(n/1024/1024).toFixed(2)}MB`);return}if(c&&w.type.startsWith("image/")){let N=new FileReader;N.onloadend=()=>{x(N.result);},N.readAsDataURL(w);}if(i){m(true);try{let N=await i(w);x(N),r?.(N);}catch(N){g("Failed to upload file"),console.error("Upload error:",N);}finally{m(false);}}t?.(w,b);},v=async w=>{try{let N=w.items;if(N.length>0){let D=N[0];if(D.kind==="file"){let R=await D.getFile();R&&y(R);}}}catch(N){g("Failed to upload file"),console.error("Upload error:",N);}finally{u(false);}},S=()=>{x(void 0),g(null),t?.(null),r?.(""),h.current&&(h.current.value="");};return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("w-full",s),children:[jsxRuntime.jsxs(reactAriaComponents.DropZone,{className:tailwindMerge.twMerge("relative flex min-h-[200px] w-full flex-col items-center justify-center rounded-lg border-2 border-dashed transition-colors",d?"border-action-brand bg-action-brand/5":"border-border-muted hover:border-border-default",a&&"pointer-events-none opacity-50",f&&"border-feedback-error-border bg-feedback-error-background/50"),onDrop:v,onDropEnter:()=>u(true),onDropExit:()=>u(false),children:[b?jsxRuntime.jsxs("div",{className:"relative flex h-full w-full items-center justify-center p-4",children:[c&&(b.startsWith("data:image")||b.startsWith("http"))?jsxRuntime.jsx("img",{src:b,alt:"Preview",className:"max-h-48 max-w-full rounded-md object-contain"}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Image,{className:"h-12 w-12 text-text-secondary"}),jsxRuntime.jsx("span",{className:"text-sm text-text-secondary",children:"File uploaded"})]}),!a&&jsxRuntime.jsx(re,{variant:"icon",size:"sm",onPress:S,className:"absolute right-2 top-2 bg-background-surface shadow-md",children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4 p-6",children:[jsxRuntime.jsx(lucideReact.Upload,{className:"h-12 w-12 text-text-secondary"}),jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx("p",{className:"text-sm text-text-primary",children:l}),jsxRuntime.jsx("p",{className:"mt-1 text-xs text-text-secondary",children:o==="image/*"?"PNG, JPG, GIF up to 10MB":`Accepts ${o}`})]}),jsxRuntime.jsx(reactAriaComponents.FileTrigger,{acceptedFileTypes:o.split(","),onSelect:w=>{let N=Array.from(w||[]);N.length>0&&y(N[0]);},children:jsxRuntime.jsx(re,{variant:"secondary",size:"sm",isDisabled:a,children:"Choose File"})})]}),p&&jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-lg bg-background-surface/80",children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-2",children:[jsxRuntime.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-action-brand border-t-transparent"}),jsxRuntime.jsx("span",{className:"text-sm text-text-secondary",children:"Uploading..."})]})})]}),f&&jsxRuntime.jsx("p",{className:"mt-2 text-sm text-feedback-error-text",children:f})]})}function CC({version:e,isLatest:t,updateAvailable:r,isLoading:o,size:n="sm",shape:a="rounded",...i}){if(o)return jsxRuntime.jsx(J,{className:"inline-flex h-6 w-16"});let s="neutral",c=e;return t?s="success":r&&(s="warning",c=`${e} (Update)`),jsxRuntime.jsx(at,{variant:s,size:n,shape:a,...i,children:c})}function Di(e){return jsxRuntime.jsx(reactAriaComponents.Form,{validationBehavior:"aria",...e,className:tailwindMerge.twMerge("flex flex-col gap-6",e.className)})}function wC({placeholder:e="Search...",value:t,onChange:r,isOpen:o,onOpenChange:n,trigger:a,children:i,showShortcutHint:s=true,showInput:c=true,className:l}){let[d,u]=He.useState(false),p=Qt("(max-width: 767px)"),m=o!==void 0?o:d,f=He.useCallback(h=>{n?n(h):u(h);},[n]);He.useEffect(()=>{let h=y=>{(y.metaKey||y.ctrlKey)&&y.key==="k"&&(y.preventDefault(),f(!m)),y.key==="Escape"&&m&&f(false);};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[m,f]);let g=He.useCallback(h=>{r?.(h);},[r]),b=jsxRuntime.jsxs("button",{type:"button",className:"flex items-center gap-2 px-3 py-2 text-sm text-text-secondary hover:text-text-primary hover:bg-background-hover rounded-md transition-colors","aria-label":"Open search",children:[jsxRuntime.jsx(U,{name:"MagnifyingGlass",size:18}),!p&&s&&jsxRuntime.jsxs("span",{className:"hidden md:flex items-center gap-1 text-xs",children:[jsxRuntime.jsx("kbd",{className:"px-1.5 py-0.5 bg-background-muted border border-border-muted rounded text-xs",children:navigator.platform.includes("Mac")?"\u2318":"Ctrl"}),jsxRuntime.jsx("kbd",{className:"px-1.5 py-0.5 bg-background-muted border border-border-muted rounded text-xs",children:"K"})]})]}),x=a===null||He.isValidElement(a)&&a.type===He.Fragment&&!a.props.children;return p?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!x&&(a?jsxRuntime.jsx("button",{type:"button",onClick:()=>f(true),className:"appearance-none bg-transparent border-none p-0 cursor-pointer",children:a}):jsxRuntime.jsx("button",{type:"button",onClick:()=>f(true),className:"appearance-none bg-transparent border-none p-0 cursor-pointer",children:b})),jsxRuntime.jsx(ct,{isOpen:m,onClose:()=>f(false),hideCloseIcon:false,contentPadding:false,maxHeight:"90vh",children:jsxRuntime.jsxs("div",{className:"flex flex-col h-full",children:[c&&jsxRuntime.jsx("div",{className:"p-4 border-b border-border-muted flex-shrink-0",children:jsxRuntime.jsx(Gr,{value:t,onChange:g,placeholder:e,showSearchIcon:true,isClearable:!!t,onClear:()=>r?.(""),reserveErrorSpace:false,className:l,autoFocus:true})}),jsxRuntime.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:i})]})})]}):x?null:jsxRuntime.jsxs(reactAriaComponents.DialogTrigger,{isOpen:m,onOpenChange:f,children:[a||b,jsxRuntime.jsx(lt,{placement:"bottom",className:"w-[600px] max-w-[90vw] bg-background-surface shadow-xl border border-border-default rounded-lg overflow-hidden",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[c&&jsxRuntime.jsx("div",{className:"p-4 border-b border-border-muted",children:jsxRuntime.jsx(Gr,{value:t,onChange:g,placeholder:e,showSearchIcon:true,isClearable:!!t,onClear:()=>r?.(""),reserveErrorSpace:false,className:l,autoFocus:true})}),jsxRuntime.jsx("div",{className:"max-h-[500px] overflow-hidden",children:i})]})})]})}function kC({placeholder:e="Search...",value:t,onChange:r,isOpen:o,onOpenChange:n,children:a,maxHeight:i="400px",variant:s="default",className:c}){let[l,d]=He.useState(false),u=Qt("(max-width: 767px)"),p=He.useRef(null),m=He.useRef(null),f=o!==void 0?o:l,g=He.useCallback(A=>{n?n(A):d(A);},[n]);He.useEffect(()=>{let A=O=>{(O.metaKey||O.ctrlKey)&&O.key==="k"&&(O.preventDefault(),g(!f)),O.key==="Escape"&&f&&g(false);};return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)},[f,g]),He.useEffect(()=>{f&&!u&&p.current&&setTimeout(()=>{p.current?.querySelector("input")?.focus();},0);},[f,u]),He.useEffect(()=>{if(!f||u)return;let A=O=>{let P=O.target,T=p.current?.contains(P),k=m.current?.contains(P);!T&&!k&&g(false);};return document.addEventListener("mousedown",A,true),()=>document.removeEventListener("mousedown",A,true)},[f,u,g]);let b=A=>{r?.(A);},x=He.useCallback(()=>{g(false);},[g]),h=He.useCallback(()=>{r?.("");},[r]),[y,v]=He.useState(null);He.useEffect(()=>{if(f&&!u&&p.current){let A=null,O=()=>{let T=p.current?.getBoundingClientRect();T&&v({top:T.bottom+8,left:T.left,width:T.width});},P=()=>{A===null&&(A=requestAnimationFrame(()=>{O(),A=null;}));};return O(),window.addEventListener("resize",P),window.addEventListener("scroll",P,true),()=>{window.removeEventListener("resize",P),window.removeEventListener("scroll",P,true),A!==null&&cancelAnimationFrame(A);}}},[f,u]);let S=He.useCallback(()=>{g(true);},[g]);if(u)return jsxRuntime.jsxs("div",{className:c,children:[jsxRuntime.jsx("button",{type:"button",onClick:S,className:"flex items-center justify-center w-10 h-10 rounded-lg hover:bg-background-hover transition-colors","aria-label":"Open search",children:jsxRuntime.jsx(U,{name:"MagnifyingGlass",size:"md"})}),jsxRuntime.jsxs(ct,{isOpen:f,onClose:x,contentPadding:false,height:"80vh",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 px-4 pt-4",children:[jsxRuntime.jsx("div",{className:"flex-1",children:jsxRuntime.jsx(Gr,{value:t,onChange:b,placeholder:e,showSearchIcon:true,isClearable:!!t,onClear:h,reserveErrorSpace:false,autoFocus:true})}),jsxRuntime.jsx(re,{variant:"icon",onPress:x,"aria-label":"Close search",className:"flex-shrink-0",children:jsxRuntime.jsx(U,{name:"X",size:"md"})})]}),jsxRuntime.jsx("div",{className:"mt-4",children:a})]})]},"mobile");let w=A=>{let P=A.target.tagName==="INPUT";if(A.key==="ArrowDown"&&f&&P){A.preventDefault();let T=m.current?.querySelector("[data-search-result]");T&&T.focus();}},N=A=>{let O=A.target;if(!O.hasAttribute("data-search-result"))return;let T=Array.from(m.current?.querySelectorAll("[data-search-result]")||[]),k=T.indexOf(O);if(A.key==="ArrowDown"){A.preventDefault(),A.stopPropagation();let V=Math.min(k+1,T.length-1);T[V]?.focus();}else if(A.key==="ArrowUp")if(A.preventDefault(),A.stopPropagation(),k===0)p.current?.querySelector("input")?.focus();else {let V=Math.max(k-1,0);T[V]?.focus();}else A.key==="Escape"&&(A.preventDefault(),A.stopPropagation(),g(false),p.current?.querySelector("input")?.focus());},D=f&&y&&typeof document<"u"?reactDom.createPortal(jsxRuntime.jsx("div",{ref:m,style:{position:"fixed",top:`${y.top}px`,left:`${y.left}px`,width:`${y.width}px`,zIndex:9999},role:"listbox",onKeyDown:N,children:jsxRuntime.jsx("div",{className:"bg-background-surface shadow-2xl border border-border-default rounded-lg overflow-hidden animate-in fade-in zoom-in-95 duration-200",children:jsxRuntime.jsx("div",{className:"overflow-y-auto",style:{maxHeight:i},children:a})})}),document.body):null,R=s==="elevated"?"bg-background-muted/50 border-border-subtle/50 focus-within:bg-background-body focus-within:border-border-focus focus-within:shadow-md backdrop-blur-sm transition-all duration-200":"";return jsxRuntime.jsxs("div",{ref:p,className:`relative w-full ${c||""}`,onKeyDown:w,children:[jsxRuntime.jsx(Gr,{value:t,onChange:b,placeholder:e,showSearchIcon:true,isClearable:!!t,onClear:()=>r?.(""),reserveErrorSpace:false,className:R,onFocus:()=>g(true)}),D]},"desktop")}function PC({message:e="No results found",suggestion:t,icon:r="MagnifyingGlass",className:o=""}){return jsxRuntime.jsxs("div",{className:`flex flex-col items-center justify-center py-12 px-4 text-center ${o}`,children:[jsxRuntime.jsx("div",{className:"text-text-secondary mb-3",children:jsxRuntime.jsx(U,{name:r,size:48})}),jsxRuntime.jsx("p",{className:"text-base font-medium text-text-primary mb-1",children:e}),t&&jsxRuntime.jsx("p",{className:"text-sm text-text-secondary max-w-xs",children:t})]})}function MC({count:e=3,className:t=""}){return jsxRuntime.jsx("div",{className:`flex flex-col ${t}`,children:Array.from({length:e}).map((r,o)=>jsxRuntime.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5",children:[jsxRuntime.jsx(J,{width:20,height:20,variant:"circle"}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[jsxRuntime.jsx(J,{width:"60%",height:16}),jsxRuntime.jsx(J,{width:"40%",height:12})]}),jsxRuntime.jsx(J,{width:16,height:16})]},o))})}function EC({title:e,count:t,isLoading:r,footer:o,children:n,className:a}){return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex flex-col",a),children:[jsxRuntime.jsxs("div",{className:"flex items-baseline gap-1.5 px-4 pt-4 pb-2 border-t border-border-muted first:border-t-0",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-text-primary",children:e}),!r&&t!==void 0&&jsxRuntime.jsx("span",{className:"text-xs text-text-secondary",children:t}),r&&jsxRuntime.jsx("span",{className:"text-xs text-text-secondary animate-pulse",children:"Loading..."})]}),jsxRuntime.jsx("div",{className:"flex flex-col",children:n}),o&&jsxRuntime.jsx("div",{className:"px-4 py-2 border-t border-border-subtle",children:o})]})}function LC({id:e,title:t,subtitle:r,metadata:o,icon:n,customIcon:a,onSelect:i,isFocused:s=false,className:c,testId:l}){return jsxRuntime.jsxs("div",{role:"option",tabIndex:0,onClick:()=>{i?.(e);},onKeyDown:p=>{let m=p.currentTarget;switch(p.key){case "Enter":case " ":{p.preventDefault(),i?.(e);break}case "ArrowDown":{p.preventDefault();let f=Array.from(document.querySelectorAll("[data-search-result]")),g=f.indexOf(m);g!==-1&&g<f.length-1&&f[g+1].focus();break}case "ArrowUp":{p.preventDefault();let f=Array.from(document.querySelectorAll("[data-search-result]")),g=f.indexOf(m);if(g>0)f[g-1].focus();else {let b=document.querySelector('input[type="text"][placeholder*="Search"]');b&&b.focus();}break}case "Escape":{p.preventDefault();let f=document.querySelector('input[type="text"][placeholder*="Search"]');f&&f.focus();break}}},"data-testid":l,"data-search-result":true,className:tailwindMerge.twMerge("group flex items-center gap-3 px-4 py-3 cursor-pointer outline-none transition-colors","text-text-primary hover:bg-background-hover","focus-visible:bg-background-muted focus-visible:outline-none","data-[focused]:bg-background-hover",s&&"bg-background-hover",c),"data-focused":s||void 0,children:[a?jsxRuntime.jsx("div",{className:"flex-shrink-0",children:a}):n?jsxRuntime.jsx("div",{className:"flex-shrink-0 text-text-secondary",children:jsxRuntime.jsx(U,{name:n,size:20})}):null,jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-baseline gap-2",children:[jsxRuntime.jsx("span",{className:"font-medium text-text-primary truncate",children:t}),o&&jsxRuntime.jsx("span",{className:"text-xs text-text-secondary flex-shrink-0",children:o})]}),r&&jsxRuntime.jsx("div",{className:"text-sm text-text-secondary truncate mt-0.5",children:r})]}),jsxRuntime.jsx("div",{className:"flex-shrink-0 opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100 group-data-[focused]:opacity-100 transition-opacity",children:jsxRuntime.jsx(U,{name:"ArrowRight",size:16,className:"text-text-secondary"})})]})}function AC({children:e,maxHeight:t="400px",className:r}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-y-auto overscroll-contain","divide-y divide-border-muted",r),style:{maxHeight:t},children:e})}function FC({placeholder:e="Search...",onClick:t,showShortcut:r=true,variant:o="default",className:n=""}){let a=typeof navigator<"u"&&navigator.platform.includes("Mac");return jsxRuntime.jsxs("button",{type:"button",onClick:t,className:`
29
+ `}})]})}var Ul={prefix:String(Math.round(Math.random()*1e10)),current:0},Lx=He__namespace.default.createContext(Ul),yN=He__namespace.default.createContext(false);var vN=!!(typeof window<"u"&&window.document&&window.document.createElement),Ap=new WeakMap;function CN(e=false){let t=He.useContext(Lx),r=He.useRef(null);if(r.current===null&&!e){var o,n;let a=(n=He__namespace.default.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||n===void 0||(o=n.ReactCurrentOwner)===null||o===void 0?void 0:o.current;if(a){let i=Ap.get(a);i==null?Ap.set(a,{id:t.current,state:a.memoizedState}):a.memoizedState!==i.state&&(t.current=i.id,Ap.delete(a));}r.current=++t.current;}return r.current}function SN(e){let t=He.useContext(Lx);t===Ul&&!vN&&process.env.NODE_ENV!=="production"&&console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");let r=CN(!!e),o=t===Ul&&process.env.NODE_ENV==="test"?"react-aria":`react-aria${t.prefix}`;return e||`${o}-${r}`}function wN(e){let t=He__namespace.default.useId(),[r]=He.useState(Yl()),o=r||process.env.NODE_ENV==="test"?"react-aria":`react-aria${Ul.prefix}`;return e||`${o}-${t}`}typeof He__namespace.default.useId=="function"?wN:SN;function NN(){return false}function kN(){return true}function PN(e){return ()=>{}}function Yl(){return typeof He__namespace.default.useSyncExternalStore=="function"?He__namespace.default.useSyncExternalStore(PN,NN,kN):He.useContext(yN)}function Ax(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Kl(e,t,r){Ax(e,t),t.set(e,r);}var RN=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),MN=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function Fp(e){if(Intl.Locale){let r=new Intl.Locale(e).maximize(),o=typeof r.getTextInfo=="function"?r.getTextInfo():r.textInfo;if(o)return o.direction==="rtl";if(r.script)return RN.has(r.script)}let t=e.split("-")[0];return MN.has(t)}var Fx=Symbol.for("react-aria.i18n.locale");function Bx(){let e=typeof window<"u"&&window[Fx]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e]);}catch{e="en-US";}return {locale:e,direction:Fp(e)?"rtl":"ltr"}}var Bp=Bx(),os=new Set;function Ix(){Bp=Bx();for(let e of os)e(Bp);}function Vx(){let e=Yl(),[t,r]=He.useState(Bp);return He.useEffect(()=>(os.size===0&&window.addEventListener("languagechange",Ix),os.add(r),()=>{os.delete(r),os.size===0&&window.removeEventListener("languagechange",Ix);}),[]),e?{locale:typeof window<"u"&&window[Fx]||"en-US",direction:"ltr"}:t}var IN=He__namespace.default.createContext(null);function Vp(){let e=Vx();return He.useContext(IN)||e}function ql(e,t){return e-t*Math.floor(e/t)}var Ox=1721426;function jl(e,t,r,o){t=$l(e,t);let n=t-1,a=-2;return r<=2?a=0:Jl(t)&&(a=-1),Ox-1+365*n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400)+Math.floor((367*r-362)/12+a+o)}function Jl(e){return e%4===0&&(e%100!==0||e%400===0)}function $l(e,t){return e==="BC"?1-t:t}function FN(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}var BN={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]},Fr=class{fromJulianDay(t){let r=t,o=r-Ox,n=Math.floor(o/146097),a=ql(o,146097),i=Math.floor(a/36524),s=ql(a,36524),c=Math.floor(s/1461),l=ql(s,1461),d=Math.floor(l/365),u=n*400+i*100+c*4+d+(i!==4&&d!==4?1:0),[p,m]=FN(u),f=r-jl(p,m,1,1),g=2;r<jl(p,m,3,1)?g=0:Jl(m)&&(g=1);let b=Math.floor(((f+g)*12+373)/367),x=r-jl(p,m,b,1)+1;return new Un(p,m,b,x)}toJulianDay(t){return jl(t.era,t.year,t.month,t.day)}getDaysInMonth(t){return BN[Jl(t.year)?"leapyear":"standard"][t.month-1]}getMonthsInYear(t){return 12}getDaysInYear(t){return Jl(t.year)?366:365}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getYearsInEra(t){return 9999}getEras(){return ["BC","AD"]}isInverseEra(t){return t.era==="BC"}balanceDate(t){t.year<=0&&(t.era=t.era==="BC"?"AD":"BC",t.year=1-t.year);}constructor(){this.identifier="gregory";}};function zp(e,t){var r,o,n,a;return (a=(n=(r=e.isEqual)===null||r===void 0?void 0:r.call(e,t))!==null&&n!==void 0?n:(o=t.isEqual)===null||o===void 0?void 0:o.call(t,e))!==null&&a!==void 0?a:e.identifier===t.identifier}function Hp(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function Hx(e,t){return zx(e)-zx(t)}function zx(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}var Op=null;function Yn(){return Op==null&&(Op=new Intl.DateTimeFormat().resolvedOptions().timeZone),Op}function nn(e){e=yr(e,new Fr);let t=$l(e.era,e.year);return Ux(t,e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function Ux(e,t,r,o,n,a,i){let s=new Date;return s.setUTCHours(o,n,a,i),s.setUTCFullYear(e,t-1,r),s.getTime()}function Gp(e,t){if(t==="UTC")return 0;if(e>0&&t===Yn()&&true)return new Date(e).getTimezoneOffset()*-6e4;let{year:r,month:o,day:n,hour:a,minute:i,second:s}=Yx(e,t);return Ux(r,o,n,a,i,s,0)-Math.floor(e/1e3)*1e3}var Wx=new Map;function Yx(e,t){let r=Wx.get(t);r||(r=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:false,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),Wx.set(t,r));let o=r.formatToParts(new Date(e)),n={};for(let a of o)a.type!=="literal"&&(n[a.type]=a.value);return {year:n.era==="BC"||n.era==="B"?-n.year+1:+n.year,month:+n.month,day:+n.day,hour:n.hour==="24"?0:+n.hour,minute:+n.minute,second:+n.second}}var Gx=864e5;function ON(e,t,r,o){return (r===o?[r]:[r,o]).filter(a=>zN(e,t,a))}function zN(e,t,r){let o=Yx(r,t);return e.year===o.year&&e.month===o.month&&e.day===o.day&&e.hour===o.hour&&e.minute===o.minute&&e.second===o.second}function Xr(e,t,r="compatible"){let o=mo(e);if(t==="UTC")return nn(o);if(t===Yn()&&r==="compatible"&&true){o=yr(o,new Fr);let c=new Date,l=$l(o.era,o.year);return c.setFullYear(l,o.month-1,o.day),c.setHours(o.hour,o.minute,o.second,o.millisecond),c.getTime()}let n=nn(o),a=Gp(n-Gx,t),i=Gp(n+Gx,t),s=ON(o,t,n-a,n-i);if(s.length===1)return s[0];if(s.length>1)switch(r){case "compatible":case "earlier":return s[0];case "later":return s[s.length-1];case "reject":throw new RangeError("Multiple possible absolute times found")}switch(r){case "earlier":return Math.min(n-a,n-i);case "compatible":case "later":return Math.max(n-a,n-i);case "reject":throw new RangeError("No such absolute time found")}}function Up(e,t,r="compatible"){return new Date(Xr(e,t,r))}function Br(e,t){let r=Gp(e,t),o=new Date(e+r),n=o.getUTCFullYear(),a=o.getUTCMonth()+1,i=o.getUTCDate(),s=o.getUTCHours(),c=o.getUTCMinutes(),l=o.getUTCSeconds(),d=o.getUTCMilliseconds();return new ti(n<1?"BC":"AD",n<1?-n+1:n,a,i,t,r,s,c,l,d)}function Xl(e,t){return Br(e.getTime(),t)}function mo(e,t){let r=0,o=0,n=0,a=0;if("timeZone"in e)({hour:r,minute:o,second:n,millisecond:a}=e);else if("hour"in e&&true)return e;return new ns(e.calendar,e.era,e.year,e.month,e.day,r,o,n,a)}function yr(e,t){if(zp(e.calendar,t))return e;let r=t.fromJulianDay(e.calendar.toJulianDay(e)),o=e.copy();return o.calendar=t,o.era=r.era,o.year=r.year,o.month=r.month,o.day=r.day,Lo(o),o}function Yp(e,t,r){if(e instanceof ti)return e.timeZone===t?e:Kp(e,t);let o=Xr(e,t,r);return Br(o,t)}function Kx(e){let t=nn(e)-e.offset;return new Date(t)}function Kp(e,t){let r=nn(e)-e.offset;return yr(Br(r,t),e.calendar)}var as=36e5;function ss(e,t){let r=e.copy(),o="hour"in r?UN(r,t):0;qp(r,t.years||0),r.calendar.balanceYearMonth&&r.calendar.balanceYearMonth(r,e),r.month+=t.months||0,jp(r),qx(r),r.day+=(t.weeks||0)*7,r.day+=t.days||0,r.day+=o,WN(r),r.calendar.balanceDate&&r.calendar.balanceDate(r),r.year<1&&(r.year=1,r.month=1,r.day=1);let n=r.calendar.getYearsInEra(r);if(r.year>n){var a,i;let c=(a=(i=r.calendar).isInverseEra)===null||a===void 0?void 0:a.call(i,r);r.year=n,r.month=c?1:r.calendar.getMonthsInYear(r),r.day=c?1:r.calendar.getDaysInMonth(r);}r.month<1&&(r.month=1,r.day=1);let s=r.calendar.getMonthsInYear(r);return r.month>s&&(r.month=s,r.day=r.calendar.getDaysInMonth(r)),r.day=Math.max(1,Math.min(r.calendar.getDaysInMonth(r),r.day)),r}function qp(e,t){var r,o;!((r=(o=e.calendar).isInverseEra)===null||r===void 0)&&r.call(o,e)&&(t=-t),e.year+=t;}function jp(e){for(;e.month<1;)qp(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,qp(e,1);}function WN(e){for(;e.day<1;)e.month--,jp(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,jp(e);}function qx(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day));}function Lo(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),qx(e);}function jx(e){let t={};for(let r in e)typeof e[r]=="number"&&(t[r]=-e[r]);return t}function Jp(e,t){return ss(e,jx(t))}function Ql(e,t){let r=e.copy();return t.era!=null&&(r.era=t.era),t.year!=null&&(r.year=t.year),t.month!=null&&(r.month=t.month),t.day!=null&&(r.day=t.day),Lo(r),r}function is(e,t){let r=e.copy();return t.hour!=null&&(r.hour=t.hour),t.minute!=null&&(r.minute=t.minute),t.second!=null&&(r.second=t.second),t.millisecond!=null&&(r.millisecond=t.millisecond),Jx(r),r}function GN(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=Zl(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=Zl(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=Zl(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=Zl(e.hour,24),t}function Jx(e){e.millisecond=Math.max(0,Math.min(e.millisecond,1e3)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23));}function Zl(e,t){let r=e%t;return r<0&&(r+=t),r}function UN(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,GN(e)}function _l(e,t,r,o){let n=e.copy();switch(t){case "era":{let s=e.calendar.getEras(),c=s.indexOf(e.era);if(c<0)throw new Error("Invalid era: "+e.era);c=Ao(c,r,0,s.length-1,o?.round),n.era=s[c],Lo(n);break}case "year":var a,i;!((a=(i=n.calendar).isInverseEra)===null||a===void 0)&&a.call(i,n)&&(r=-r),n.year=Ao(e.year,r,-1/0,9999,o?.round),n.year===-1/0&&(n.year=1),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e);break;case "month":n.month=Ao(e.month,r,1,e.calendar.getMonthsInYear(e),o?.round);break;case "day":n.day=Ao(e.day,r,1,e.calendar.getDaysInMonth(e),o?.round);break;default:throw new Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(n),Lo(n),n}function $p(e,t,r,o){let n=e.copy();switch(t){case "hour":{let a=e.hour,i=0,s=23;if(o?.hourCycle===12){let c=a>=12;i=c?12:0,s=c?23:11;}n.hour=Ao(a,r,i,s,o?.round);break}case "minute":n.minute=Ao(e.minute,r,0,59,o?.round);break;case "second":n.second=Ao(e.second,r,0,59,o?.round);break;case "millisecond":n.millisecond=Ao(e.millisecond,r,0,999,o?.round);break;default:throw new Error("Unsupported field "+t)}return n}function Ao(e,t,r,o,n=false){if(n){e+=Math.sign(t),e<r&&(e=o);let a=Math.abs(t);t>0?e=Math.ceil(e/a)*a:e=Math.floor(e/a)*a,e>o&&(e=r);}else e+=t,e<r?e=o-(r-e-1):e>o&&(e=r+(e-o-1));return e}function Xp(e,t){let r;if(t.years!=null&&t.years!==0||t.months!=null&&t.months!==0||t.weeks!=null&&t.weeks!==0||t.days!=null&&t.days!==0){let n=ss(mo(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days});r=Xr(n,e.timeZone);}else r=nn(e)-e.offset;r+=t.milliseconds||0,r+=(t.seconds||0)*1e3,r+=(t.minutes||0)*6e4,r+=(t.hours||0)*36e5;let o=Br(r,e.timeZone);return yr(o,e.calendar)}function $x(e,t){return Xp(e,jx(t))}function Xx(e,t,r,o){switch(t){case "hour":{let n=0,a=23;if(o?.hourCycle===12){let f=e.hour>=12;n=f?12:0,a=f?23:11;}let i=mo(e),s=yr(is(i,{hour:n}),new Fr),c=[Xr(s,e.timeZone,"earlier"),Xr(s,e.timeZone,"later")].filter(f=>Br(f,e.timeZone).day===s.day)[0],l=yr(is(i,{hour:a}),new Fr),d=[Xr(l,e.timeZone,"earlier"),Xr(l,e.timeZone,"later")].filter(f=>Br(f,e.timeZone).day===l.day).pop(),u=nn(e)-e.offset,p=Math.floor(u/as),m=u%as;return u=Ao(p,r,Math.floor(c/as),Math.floor(d/as),o?.round)*as+m,yr(Br(u,e.timeZone),e.calendar)}case "minute":case "second":case "millisecond":return $p(e,t,r,o);case "era":case "year":case "month":case "day":{let n=_l(mo(e),t,r,o),a=Xr(n,e.timeZone);return yr(Br(a,e.timeZone),e.calendar)}default:throw new Error("Unsupported field "+t)}}function Zx(e,t,r){let o=mo(e),n=is(Ql(o,t),t);if(n.compare(o)===0)return e;let a=Xr(n,e.timeZone,r);return yr(Br(a,e.timeZone),e.calendar)}var YN=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})$/;var KN=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;function ls(e){let t=e.match(YN);if(!t)throw KN.test(e)?new Error(`Invalid ISO 8601 date string: ${e}. Use parseAbsolute() instead.`):new Error("Invalid ISO 8601 date string: "+e);let r=new Un(Zp(t[1],0,9999),Zp(t[2],1,12),1);return r.day=Zp(t[3],1,r.calendar.getDaysInMonth(r)),r}function Zp(e,t,r){let o=Number(e);if(o<t||o>r)throw new RangeError(`Value out of range: ${t} <= ${o} <= ${r}`);return o}function Qx(e){return `${String(e.hour).padStart(2,"0")}:${String(e.minute).padStart(2,"0")}:${String(e.second).padStart(2,"0")}${e.millisecond?String(e.millisecond/1e3).slice(1):""}`}function Qp(e){let t=yr(e,new Fr),r;return t.era==="BC"?r=t.year===1?"0000":"-"+String(Math.abs(1-t.year)).padStart(6,"00"):r=String(t.year).padStart(4,"0"),`${r}-${String(t.month).padStart(2,"0")}-${String(t.day).padStart(2,"0")}`}function _p(e){return `${Qp(e)}T${Qx(e)}`}function jN(e){let t=Math.sign(e)<0?"-":"+";e=Math.abs(e);let r=Math.floor(e/36e5),o=Math.floor(e%36e5/6e4),n=Math.floor(e%36e5%6e4/1e3),a=`${t}${String(r).padStart(2,"0")}:${String(o).padStart(2,"0")}`;return n!==0&&(a+=`:${String(n).padStart(2,"0")}`),a}function _x(e){return `${_p(e)}${jN(e.offset)}[${e.timeZone}]`}function em(e){let t=typeof e[0]=="object"?e.shift():new Fr,r;if(typeof e[0]=="string")r=e.shift();else {let i=t.getEras();r=i[i.length-1];}let o=e.shift(),n=e.shift(),a=e.shift();return [t,r,o,n,a]}var JN=new WeakMap,Un=class e{copy(){return this.era?new e(this.calendar,this.era,this.year,this.month,this.day):new e(this.calendar,this.year,this.month,this.day)}add(t){return ss(this,t)}subtract(t){return Jp(this,t)}set(t){return Ql(this,t)}cycle(t,r,o){return _l(this,t,r,o)}toDate(t){return Up(this,t)}toString(){return Qp(this)}compare(t){return Hp(this,t)}constructor(...t){Kl(this,JN,{writable:true,value:void 0});let[r,o,n,a,i]=em(t);this.calendar=r,this.era=o,this.year=n,this.month=a,this.day=i,Lo(this);}};var $N=new WeakMap,ns=class e{copy(){return this.era?new e(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new e(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return ss(this,t)}subtract(t){return Jp(this,t)}set(t){return Ql(is(this,t),t)}cycle(t,r,o){switch(t){case "era":case "year":case "month":case "day":return _l(this,t,r,o);default:return $p(this,t,r,o)}}toDate(t,r){return Up(this,t,r)}toString(){return _p(this)}compare(t){let r=Hp(this,t);return r===0?Hx(this,mo(t)):r}constructor(...t){Kl(this,$N,{writable:true,value:void 0});let[r,o,n,a,i]=em(t);this.calendar=r,this.era=o,this.year=n,this.month=a,this.day=i,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,Lo(this);}},XN=new WeakMap,ti=class e{copy(){return this.era?new e(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new e(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(t){return Xp(this,t)}subtract(t){return $x(this,t)}set(t,r){return Zx(this,t,r)}cycle(t,r,o){return Xx(this,t,r,o)}toDate(){return Kx(this)}toString(){return _x(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(t){return this.toDate().getTime()-Yp(t,this.timeZone).toDate().getTime()}constructor(...t){Kl(this,XN,{writable:true,value:void 0});let[r,o,n,a,i]=em(t),s=t.shift(),c=t.shift();this.calendar=r,this.era=o,this.year=n,this.month=a,this.day=i,this.timeZone=s,this.offset=c,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,Lo(this);}};var tm=new Map;function rm(e){let{locale:t}=Vp(),r=t+(e?Object.entries(e).sort((n,a)=>n[0]<a[0]?-1:1).join():"");if(tm.has(r))return tm.get(r);let o=new Intl.Collator(t,e);return tm.set(r,o),o}function ec(e){let t=rm({usage:"search",...e}),r=He.useCallback((a,i)=>i.length===0?true:(a=a.normalize("NFC"),i=i.normalize("NFC"),t.compare(a.slice(0,i.length),i)===0),[t]),o=He.useCallback((a,i)=>i.length===0?true:(a=a.normalize("NFC"),i=i.normalize("NFC"),t.compare(a.slice(-i.length),i)===0),[t]),n=He.useCallback((a,i)=>{if(i.length===0)return true;a=a.normalize("NFC"),i=i.normalize("NFC");let s=0,c=i.length;for(;s+c<=a.length;s++){let l=a.slice(s,s+c);if(t.compare(i,l)===0)return true}return false},[t]);return He.useMemo(()=>({startsWith:r,endsWith:o,contains:n}),[r,o,n])}var rk=({isEntering:e,isExiting:t,className:r})=>["max-w-[200px] group bg-action-default border border-action-default-hover text-[color:var(--color-action-default-text)] text-sm rounded-lg drop-shadow-lg will-change-transform px-3 py-1",e?"animate-in fade-in placement-bottom:slide-in-from-top-0.5 placement-top:slide-in-from-bottom-0.5 placement-left:slide-in-from-right-0.5 placement-right:slide-in-from-left-0.5 ease-out duration-200":"",t?"animate-out fade-out placement-bottom:slide-out-to-top-0.5 placement-top:slide-out-to-bottom-0.5 placement-left:slide-out-to-right-0.5 placement-right:slide-out-to-left-0.5 ease-in duration-150":"",r].filter(Boolean).join(" ");function nr({children:e,content:t,...r}){return jsxRuntime.jsxs(reactAriaComponents.TooltipTrigger,{delay:200,children:[e,jsxRuntime.jsxs(reactAriaComponents.Tooltip,{...r,offset:10,className:reactAriaComponents.composeRenderProps(r.className,(o,n)=>rk({...n,className:o})),children:[jsxRuntime.jsx(reactAriaComponents.OverlayArrow,{children:jsxRuntime.jsx("svg",{width:8,height:8,viewBox:"0 0 8 8",className:"fill-action-default stroke-action-default-hover group-placement-left:-rotate-90 group-placement-right:rotate-90 group-placement-bottom:rotate-180 forced-colors:fill-[Canvas] forced-colors:stroke-[ButtonBorder]",children:jsxRuntime.jsx("path",{d:"M0 0 L4 4 L8 0"})})}),t]})]})}function Or(){let[e,t]=He__namespace.default.useState(false),r=He__namespace.default.useCallback((n,a)=>{t(true),a?.(n);},[]),o=He__namespace.default.useCallback((n,a)=>{t(false),a?.(n);},[]);return {isFocused:e,handleFocus:r,handleBlur:o}}var vt=He__namespace.default.forwardRef(({children:e,className:t},r)=>jsxRuntime.jsx("div",{ref:r,className:tailwindMerge.twMerge("relative w-full",t),children:e}));vt.displayName="InputWrapper";function cs({onClick:e,size:t="md",className:r}){return jsxRuntime.jsx("button",{type:"button",onClick:o=>{o.preventDefault(),o.stopPropagation(),e();},className:tailwindMerge.twMerge("absolute right-2 top-[48%] -translate-y-1/2 transform text-text-secondary hover:text-text-primary cursor-pointer",r),"aria-label":"Clear input",onMouseDown:o=>{o.preventDefault(),o.stopPropagation();},children:jsxRuntime.jsx(U,{name:"X",size:t==="sm"?16:20})})}function an(e){let{isInvalid:t,isDisabled:r,isFocused:o}=e,n="border rounded-[var(--control-border-radius)] !outline-none ";return r?`${n} border-border-muted`:t&&o?`${n} border-feedback-error-border shadow-[inset_0_0_0_1px_var(--color-feedback-error-border)]`:t?`${n} border-feedback-error-border`:o?`${n} border-border-focus shadow-[inset_0_0_0_1px_var(--color-border-focus)]`:`${n} border-border-input`}function th(e){return e.isDisabled?"bg-background-muted":e.transparent?"bg-transparent":"bg-background-input"}function ok(e){return e==="sm"?"!text-base md:!text-[length:var(--control-text-sm)]":e==="md"?"!text-base md:!text-[length:var(--control-text-md)]":""}function Wt(e){let{isInvalid:t,isDisabled:r,isFocused:o,transparent:n,size:a="md",className:i}=e;return tailwindMerge.twMerge("w-full",an({isInvalid:t,isDisabled:r,isFocused:o}),th({transparent:n,isDisabled:r}),We[a].text,We[a].height,We[a].padding,ok(a),i)}function nk(e){let{size:t="md",isFocusWithin:r,isInvalid:o,isDisabled:n,transparent:a,className:i}=e;return tailwindMerge.twMerge("group flex items-center rounded-[var(--control-border-radius)] overflow-hidden",th({transparent:a,isDisabled:n}),We[t].height,an({isFocused:r,isInvalid:o,isDisabled:n}),i)}function ze({children:e,size:t="md",tooltip:r,description:o,descriptionPlacement:n="below",isRequired:a,className:i,htmlFor:s}){let c=r||o&&n==="tooltip",l=r||o,d=o&&n==="inline",u=jsxRuntime.jsxs("label",{htmlFor:s,className:tailwindMerge.twMerge(We[t].text,"!text-text-label font-semibold flex items-center gap-1",i),children:[e,a&&jsxRuntime.jsx("span",{children:"*"}),c&&jsxRuntime.jsx("span",{className:"inline-flex items-center text-text-secondary",children:jsxRuntime.jsx(U,{name:"Info",size:t==="sm"?16:20})}),d&&jsxRuntime.jsx("span",{className:"text-text-secondary font-normal ml-1",children:o})]});return c&&l?jsxRuntime.jsx(nr,{content:l,children:u}):u}function Pe({size:e="md",className:t,children:r,...o}){return jsxRuntime.jsx("div",{...o,className:tailwindMerge.twMerge("leading-[2.25] text-text-secondary",We[e].text,t),children:r})}function ge({children:e,size:t="md",className:r}){return jsxRuntime.jsx("div",{role:"alert",className:tailwindMerge.twMerge(We[t].text,"text-feedback-error-text",r),children:e})}function rc({size:e="md",isInvalid:t,isDisabled:r,isFocused:o,transparent:n,className:a,...i}){return jsxRuntime.jsx("input",{className:Wt({isInvalid:t,isDisabled:r,isFocused:o,transparent:n,size:e,className:a}),...i})}function rh(e){let{children:t,...r}=e;return jsxRuntime.jsx("div",{...r,className:nk(e),children:typeof t=="function"?t(e):t})}function sk({children:e,...t}){return jsxRuntime.jsx(reactAriaComponents.ListBox,{...t,className:ke(t.className,"outline-0"),children:e})}var cm=He.createContext("md");function sh(){return He.useContext(cm)}function im(e="md"){let t=e==="sm"?"!text-base md:!text-[length:var(--control-text-sm)]":e==="md"?"!text-base md:!text-[length:var(--control-text-md)]":"";return `flex-1 text-start data-[placeholder]:text-text-disabled overflow-hidden text-ellipsis whitespace-nowrap ${We[e].text} ${t}`}function mk(){let e=He__namespace.default.useCallback((r,o)=>{o?.(r);},[]),t=He__namespace.default.useCallback((r,o)=>{o?.(r);},[]);return {handleFocus:e,handleBlur:t}}function qn({label:e,description:t,errorMessage:r,children:o,items:n,renderItem:a,renderSelectedValue:i,size:s="md",selectedKey:c,defaultSelectedKey:l,onSelectionChange:d,placeholder:u,showErrors:p=false,tooltip:m,isRequired:f,transparent:g,reserveErrorSpace:b=false,placement:x="bottom start",shouldFlip:h=true,menuWidth:y="match",descriptionPlacement:v="below",useMobileTray:S=true,...w}){let[N,D]=He.useState(null),[R,A]=He.useState(null),[O,P]=He.useState(false),T=c??N??l,{handleFocus:k,handleBlur:V}=mk(),{isMobile:H}=_t(),I=S&&H,q=He__namespace.default.useMemo(()=>!i||!T||!n?null:Array.from(n).find(z=>z.id===T)??null,[i,T,n]),j=E=>{d&&E!==null&&d(E),d||D(E);},K=He.useRef(null),Y=He.useRef(null),M=()=>{I&&P(!O);};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(reactAriaComponents.Select,{...w,selectedKey:T,defaultSelectedKey:l,onSelectionChange:j,placeholder:u,className:ke(w.className,"group flex w-full flex-col"),ref:K,onOpenChange:E=>{I||(E&&Y.current?A(Y.current.offsetWidth):E||K.current?.blur());},children:({isDisabled:E,isInvalid:z,isOpen:B})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(ze,{size:s,tooltip:m,description:v==="tooltip"||v==="inline"?t:void 0,descriptionPlacement:v,isRequired:f,children:e}),jsxRuntime.jsx(vt,{children:jsxRuntime.jsx("div",{ref:Y,children:jsxRuntime.jsxs(re,{variant:"unstyled",className:tailwindMerge.twMerge(Wt({isInvalid:z||p&&!!r,isDisabled:E,isFocused:I?O:B,transparent:g,size:s}),"flex items-center text-start gap-4 cursor-pointer pl-[var(--control-padding-sm)]"),onFocus:C=>k(C,w.onFocus),onBlur:C=>V(C,w.onBlur),onPress:I?M:void 0,"data-open":I?O:B,children:[i&&q?jsxRuntime.jsx("div",{className:im(s),children:i(q)}):I&&T?jsxRuntime.jsx("div",{className:im(s),children:n?Array.from(n).find(G=>G.id===T)?.label:String(T)}):jsxRuntime.jsx(reactAriaComponents.SelectValue,{className:im(s)}),jsxRuntime.jsx(U,{name:"CaretDown","aria-hidden":true,className:tailwindMerge.twMerge("h-4 w-4 text-text-primary group-disabled:text-text-disabled forced-colors:text-[ButtonText] transition-transform",(I?O:B)&&"rotate-180")})]})})}),b?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:p?jsxRuntime.jsx(ge,{size:s,className:"text-feedback-error-text",children:typeof r=="function"&&w.validationResult?r(w.validationResult):typeof r=="string"?r:null}):t&&v==="below"?jsxRuntime.jsx(Pe,{size:s,children:t}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:p?jsxRuntime.jsx(ge,{size:s,className:"mt-1 text-feedback-error-text",children:typeof r=="function"&&w.validationResult?r(w.validationResult):typeof r=="string"?r:null}):t&&v==="below"?jsxRuntime.jsx(Pe,{size:s,className:"mt-1",children:t}):null}),I?null:jsxRuntime.jsx(lt,{className:"bg-background-input shadow-xl border border-border-input/20 backdrop-blur-sm rounded-[var(--control-border-radius)]",style:{width:y==="match"&&R?`${R}px`:void 0,minWidth:y==="auto"&&R?`${R}px`:void 0,maxWidth:y==="auto"?"min(600px, 90vw)":void 0},placement:x,shouldFlip:h,children:jsxRuntime.jsx(cm.Provider,{value:"md",children:jsxRuntime.jsx(reactAriaComponents.ListBox,{items:n,className:"w-full max-h-[300px] overflow-auto bg-background-input p-0 outline-0",children:a&&n?C=>jsxRuntime.jsx(ar,{id:C.id,textValue:C.label,children:jsxRuntime.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap min-w-0 flex-1",children:a(C)})},C.id):o})})})]})}),I&&jsxRuntime.jsx(ct,{isOpen:O,onClose:()=>P(false),title:e??"Select an option",contentPadding:false,children:jsxRuntime.jsx(cm.Provider,{value:"md",children:jsxRuntime.jsx(reactAriaComponents.ListBox,{items:n,className:"w-full bg-background-surface p-0 outline-0 [&_[role=option]]:border-b [&_[role=option]]:border-border-default [&_[role=option]:last-child]:border-0 [&_[role=option]]:!px-6 [&_[role=option]]:!py-4 [&_[role=option]]:rounded-none",selectionMode:"single",selectedKeys:T!=null?[T]:[],onSelectionChange:E=>{let z=Array.from(E)[0];z!=null&&(j(z),P(false));},children:a&&n?E=>jsxRuntime.jsx(ar,{id:E.id,textValue:E.label,children:jsxRuntime.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap min-w-0 flex-1",children:a(E)})},E.id):o})})})]})}function ar({size:e,className:t,...r}){let o=sh(),n=e??o;return jsxRuntime.jsx(reactAriaComponents.ListBoxItem,{...r,className:tailwindMerge.twMerge("flex cursor-default items-center gap-2 rounded-sm px-3 outline-none text-text-primary data-[focused]:bg-background-hover data-[focus-visible]:ring-2 data-[focus-visible]:ring-action-default data-[focus-visible]:ring-inset data-[selected]:bg-background-selected data-[selected]:font-medium overflow-hidden",We[n].paddingY,We[n].text,t)})}var Tk=[],Nk={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6",xl:"h-7 w-7"},kk={sm:"pl-8",md:"pl-10",lg:"pl-11",xl:"pl-13"},ch={sm:"py-1",md:"py-2",lg:"py-3",xl:"py-4"},um=(e,t,r)=>{if(e==null||e==="")return "";let n=(r?r.flatMap(a=>a.items):t||[]).find(a=>a.id===e);return n?n.name:""};async function Pk(e,t,r){try{let o=e.url.replace("{q}",t),n=new URLSearchParams;e.extraParams&&Object.entries(e.extraParams).forEach(([c,l])=>{n.append(c,l.toString());});let a=`${o}${n.toString()?"?"+n.toString():""}`,i=await fetch(a,{method:"GET",headers:e.headers,signal:r});if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);let s=await i.json();return {items:e.transformResponse(s)}}catch(o){if(o instanceof Error&&o.name==="AbortError")return {items:[]};console.error("Error in REST request:",o);let n=o instanceof Error?o.message:"Unknown error occurred";return {items:[],error:n}}}async function Rk(e,t,r){try{let o=e.graphqlQuery.replace(`$${e.variableKey||"filter"}`,`"${t}"`),n=await fetch(e.url,{method:"POST",headers:{"Content-Type":"application/json",...e.headers},body:JSON.stringify({query:o}),signal:r});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);let a=await n.json();if(a.errors)throw new Error(a.errors[0]?.message||"GraphQL error occurred");return e.responsePath&&(a=e.responsePath.split(".").reduce((i,s)=>i?.[s],a)),{items:e.transformResponse(a)}}catch(o){if(o instanceof Error&&o.name==="AbortError")return {items:[]};console.error("Error in GraphQL request:",o);let n=o instanceof Error?o.message:"Unknown error occurred";return {items:[],error:n}}}function ac({label:e,staticItems:t=Tk,sections:r,selectedKey:o,defaultSelectedKey:n,onSelectionChange:a,requestConfig:i,defaultFilter:s,placeholder:c,errorMessage:l,description:d,size:u="md",tooltip:p,isRequired:m,isDisabled:f,isInvalid:g,validationResult:b,showErrors:x=true,renderItem:h,renderLeftIcon:y,renderSection:v,autoFocus:S=false,reserveErrorSpace:w=false,hideChevron:N=false,useMobileTray:D=true,className:R}){let A=He__namespace.default.useRef(null),O=He__namespace.default.useRef(null),[P,T]=He__namespace.default.useState(),[k,V]=He.useState(()=>um(o||n,t,r)),[H,I]=He.useState(false),[q,j]=He.useState(false),K=Zo(k),{contains:Y}=ec({sensitivity:"base"}),[M,E]=He.useState(),{isMobile:z}=_t(),B=D&&z,C=We[u].text,W=reactStately.useAsyncList({async load({signal:ne,filterText:ae=""}){if(!i)return {items:[]};if(!i.url||i.shouldLoad&&!i.shouldLoad(ae))return {items:[]};try{let ce;return i.requestType==="GraphQL"?ce=await Rk(i,ae,ne):ce=await Pk(i,ae,ne),E(ce.error),{items:ce.items}}catch(ce){return ce instanceof Error&&ce.name==="AbortError"?{items:[]}:(console.error("Error loading items:",ce),E(ce instanceof Error?ce.message:"Unknown error occurred"),{items:[]})}},initialFilterText:""}),G=i&&K!==""?W:null,F=false,Z=He.useRef("");He.useEffect(()=>{S&&I(true);},[S]),He.useEffect(()=>{let ne=um(o,t,r);ne!==k&&V(ne);},[o,t,r]),He.useEffect(()=>{let ne=()=>{A.current&&T(A.current.offsetWidth);};return ne(),window.addEventListener("resize",ne),()=>window.removeEventListener("resize",ne)},[]),He.useEffect(()=>{K===""?Z.current="":G&&K!==Z.current&&(Z.current=K,G.setFilterText(K));},[K,G]),F=Pl(!!G?.isLoading,300);let _=He__namespace.default.useMemo(()=>{if(!B||!k)return G?G.items:t;let ne=G?G.items:t,ae=s??(i?()=>true:Y);return ne.filter(ce=>ae(ce.name,k))},[B,k,G,t,s,Y]),L=ne=>{let ae=um(ne,t,r);V(ae),a&&a(ne);},oe=ne=>{V(ne);},ie=()=>{B&&j(true);};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(reactAriaComponents.ComboBox,{onSelectionChange:L,selectedKey:o||void 0,defaultSelectedKey:n||void 0,items:G?G.items:r?r.flatMap(ne=>ne.items):t,className:ke(R,"group flex flex-col w-full"),menuTrigger:B?"manual":i?"input":"focus",allowsEmptyCollection:!!i,isDisabled:f,isInvalid:g||!!l,inputValue:k,onInputChange:oe,autoFocus:S&&!B,defaultFilter:s??(i?()=>true:Y),"aria-label":e||c||"Autocomplete",children:ne=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(ze,{size:u,tooltip:p,isRequired:m,children:e}),jsxRuntime.jsxs(vt,{ref:A,children:[y?jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-3 top-[45%] -translate-y-1/2 z-10",children:y(F)}):jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 z-10 flex items-center",children:F?jsxRuntime.jsx(Eo,{size:16,color:"text-text-secondary"}):jsxRuntime.jsx(U,{name:"MagnifyingGlass",className:`${Nk[u]} text-text-secondary`})}),jsxRuntime.jsx(reactAriaComponents.Input,{className:Wt({isInvalid:g||!!l,isDisabled:f,isFocused:H||(B?q:ne.isOpen),size:u,className:tailwindMerge.twMerge(kk[u],k&&!f||!N&&!k?"pr-10":"pr-3",B&&"cursor-pointer",R)}),placeholder:c,disabled:f,onFocus:ae=>{I(true),B&&(ae.currentTarget.blur(),ie());},onBlur:()=>{I(false);},onClick:B?ie:void 0,readOnly:B,"aria-label":e||c||"Autocomplete"}),k&&!f&&jsxRuntime.jsx(cs,{onClick:()=>{V(""),a?.(null);},size:u}),!N&&!k&&jsxRuntime.jsx(reactAriaComponents.Button,{className:"absolute right-3 top-[46%] -translate-y-1/2 transform text-text-secondary hover:text-text-primary","aria-label":"Toggle menu",isDisabled:f,children:({isPressed:ae})=>jsxRuntime.jsx(U,{name:ae?"CaretUp":"CaretDown",className:"h-4 w-4"})})]}),w?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:x&&M?jsxRuntime.jsx(ge,{size:u,className:"text-feedback-error-text",children:M}):x&&typeof l=="string"?jsxRuntime.jsx(ge,{size:u,className:"text-feedback-error-text",children:l}):x&&typeof l=="function"&&b?jsxRuntime.jsx(ge,{size:u,className:"text-feedback-error-text",children:l(b)}):d?jsxRuntime.jsx(Pe,{size:u,children:d}):null}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[d&&jsxRuntime.jsx(Pe,{size:u,className:"mt-1",children:d}),x&&M&&jsxRuntime.jsx(ge,{size:u,className:"text-feedback-error-text mt-1",children:M}),x&&typeof l=="string"&&jsxRuntime.jsx(ge,{size:u,className:"text-feedback-error-text mt-1",children:l}),x&&typeof l=="function"&&b&&jsxRuntime.jsx(ge,{size:u,className:"text-feedback-error-text mt-1",children:l(b)})]}),!B&&jsxRuntime.jsx(lt,{className:"bg-background-input shadow-xl border border-border-input/20 backdrop-blur-sm ring-1 ring-black/5 rounded-[var(--control-border-radius)]",style:{minWidth:P?`${P}px`:void 0,zIndex:9999},children:jsxRuntime.jsx(reactAriaComponents.ListBox,{"aria-label":e||c||"Suggestions",className:`max-h-[300px] overflow-auto bg-background-input outline-none ${C}`,children:r?r.map(ae=>{let ce=ae.items.map(Ce=>jsxRuntime.jsx(ar,{id:Ce.id,textValue:Ce.name,size:u,className:`flex cursor-default items-center gap-2 px-3 ${ch[u]} text-text-primary outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium data-[focus-visible]:ring-0`,children:h?h(Ce):Ce.name},Ce.id));if(v){let Ce=v(ae,ce);return He__namespace.default.isValidElement(Ce)&&Ce.type===reactAriaComponents.ListBoxSection?Ce:jsxRuntime.jsx(reactAriaComponents.ListBoxSection,{children:Ce},ae.name)}return jsxRuntime.jsxs(reactAriaComponents.ListBoxSection,{children:[jsxRuntime.jsx(reactAriaComponents.Header,{className:"px-3 py-1 text-sm font-bold text-text-secondary",children:ae.name}),ce]},ae.name)}):ae=>jsxRuntime.jsx(ar,{id:ae.id,textValue:ae.name,size:u,className:`flex cursor-default items-center gap-2 px-3 ${ch[u]} text-text-primary outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium data-[focus-visible]:ring-0`,children:h?h(ae):ae.name},ae.id)})})]})}),B&&jsxRuntime.jsx(ct,{isOpen:q,onClose:()=>j(false),title:e??c??"Search",contentPadding:false,height:"80vh",children:jsxRuntime.jsxs("div",{className:"flex flex-col h-full",children:[jsxRuntime.jsx("div",{className:"p-4 border-b border-border-default",children:jsxRuntime.jsxs(vt,{children:[jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-3 top-[45%] -translate-y-1/2 z-10 flex items-center",children:F?jsxRuntime.jsx(Eo,{size:16,color:"text-text-secondary"}):jsxRuntime.jsx(U,{name:"MagnifyingGlass",className:"h-4 w-4 text-text-secondary"})}),jsxRuntime.jsx("input",{ref:O,type:"text",value:k,onChange:ne=>oe(ne.target.value),placeholder:c,autoFocus:true,className:Wt({isInvalid:false,isDisabled:false,isFocused:true,size:"md",className:"pl-10 pr-10"})}),k&&jsxRuntime.jsx(cs,{onClick:()=>{V(""),a?.(null);},size:"md"})]})}),jsxRuntime.jsx("div",{className:"flex-1 overflow-auto",children:jsxRuntime.jsx(reactAriaComponents.ListBox,{"aria-label":e||c||"Suggestions",items:_,selectedKeys:o?[o]:[],selectionMode:"single",onSelectionChange:ne=>{let ae=Array.from(ne)[0];ae&&(L(ae),j(false));},className:"bg-background-input outline-none",children:ne=>jsxRuntime.jsx(ar,{id:ne.id,textValue:ne.name,size:"md",className:"flex cursor-default items-center gap-2 px-4 py-3 text-text-primary outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium data-[focus-visible]:ring-0",children:h?h(ne):ne.name},ne.id)})})]})})]})}function Io({src:e,alt:t,firstName:r,lastName:o,fullName:n,onClick:a,size:i="md",shape:s="circle",variant:c="user",className:l,status:d,bordered:u=false,piiEntity:p}){let[m,f]=He.useState(false),g=He.useCallback(()=>f(true),[]);He.useEffect(()=>{f(false);},[e]);let b={xs:"h-6 w-6 text-xs",sm:"h-8 w-8 text-sm",md:"h-10 w-10 text-base",lg:"h-12 w-12 text-lg",xl:"h-16 w-16 text-xl"},x={xs:"h-1.5 w-1.5",sm:"h-2 w-2",md:"h-2.5 w-2.5",lg:"h-3 w-3",xl:"h-4 w-4"},h={xs:"bottom-0 right-0",sm:"bottom-0 right-0",md:"bottom-0 right-0",lg:"bottom-0.5 right-0.5",xl:"bottom-1 right-1"},y={online:"bg-feedback-success-background border-feedback-success-border",offline:"bg-text-secondary border-border-muted",away:"bg-feedback-warning-background border-feedback-warning-border",busy:"bg-feedback-error-background border-feedback-error-border"},v={user:"bg-feedback-info-background text-feedback-info-text",team:"bg-feedback-info-background text-feedback-info-text",organization:"bg-feedback-success-background text-feedback-success-text"},S=s==="circle"?"rounded-full":"rounded-md",w=tailwindMerge.twMerge("relative inline-flex items-center justify-center overflow-hidden transition-opacity outline-none",b[i],S,a&&"cursor-pointer hover:opacity-80",u&&"ring-2 ring-background-surface",l),D=(()=>{if(r||o){let P=r?.[0]||"",T=o?.[0]||"";return (P+T).toUpperCase()}if(n){let P=n.split(" "),T=P[0]?.[0]||"",k=P[P.length-1]?.[0]||"";return T===k?T.toUpperCase():(T+k).toUpperCase()}return ""})(),R=()=>{let P={xs:14,sm:16,md:20,lg:24,xl:32}[i];switch(c){case "team":return jsxRuntime.jsx(lucideReact.Users,{size:P});case "organization":return jsxRuntime.jsx(lucideReact.Building2,{size:P});default:return jsxRuntime.jsx(lucideReact.User,{size:P})}},A=P=>{if(p)return c==="organization"?P?"organization-logo":"initials":P?"avatar":"initials"},O=()=>e&&!m?jsxRuntime.jsx("img",{src:e,alt:t||n||"Avatar",className:"h-full w-full object-cover",onError:g,"data-pii-type":A(true),"data-pii-entity":p}):D?jsxRuntime.jsx("span",{className:"font-semibold","data-pii-type":A(false),"data-pii-entity":p,children:D}):R();return jsxRuntime.jsxs("div",{className:"relative inline-block",children:[jsxRuntime.jsx("div",{"data-avatar":true,className:tailwindMerge.twMerge(w,!e||m?v[c]:""),onClick:a,role:a?"button":void 0,tabIndex:a?0:void 0,children:O()}),d&&jsxRuntime.jsx("span",{className:tailwindMerge.twMerge("absolute border-2 border-background-surface",S,x[i],h[i],y[d]),"aria-label":`Status: ${d}`})]})}var Bk={default:"bg-feedback-info-background text-feedback-info-text",success:"bg-feedback-success-background text-feedback-success-text",error:"bg-feedback-error-background text-feedback-error-text",warning:"bg-feedback-warning-background text-feedback-warning-text",info:"bg-feedback-info-background text-feedback-info-text",primary:"bg-action-primary/10 text-action-primary border border-action-primary/20",brand:"bg-action-primary/10 text-action-primary border border-action-primary/20",secondary:"bg-action-secondary text-[color:var(--color-action-secondary-text)] border border-border-muted",neutral:"bg-background-muted text-text-secondary",charging:"bg-state-charging text-state-charging-text",discharging:"bg-state-discharging text-state-discharging-text",heat:"bg-state-heat text-state-heat-text",cool:"bg-state-cool text-state-cool-text",eco:"bg-state-eco text-state-eco-text",auto:"bg-state-auto text-state-auto-text",on:"bg-state-on text-state-on-text",off:"bg-state-off text-state-off-text",idle:"bg-state-idle text-state-idle-text",unknown:"bg-state-unknown text-state-unknown-text",connected:"bg-feedback-success-background text-feedback-success-text",disconnected:"bg-feedback-error-background text-feedback-error-text",importing:"bg-state-importing text-state-importing-text",exporting:"bg-state-exporting text-state-exporting-text"},Vk={xs:"px-1.5 py-0.5 text-xs",sm:"px-2.5 py-1.5 text-xs",md:"px-3.5 py-2 text-sm",lg:"px-4 py-2.5 text-base"},Ok={pill:"rounded-full",rounded:"rounded-lg",square:"rounded-sm"},zk={xs:"w-1 h-1",sm:"w-1.5 h-1.5",md:"w-2 h-2",lg:"w-2.5 h-2.5"};function at({children:e,variant:t="default",size:r="sm",shape:o="square",dot:n=false,dotPosition:a="left",dotPulse:i=false,className:s}){let c=n&&jsxRuntime.jsx("span",{className:tailwindMerge.twMerge("rounded-full bg-current opacity-75",zk[r],i&&"animate-pulse"),"aria-hidden":"true"});return jsxRuntime.jsxs("span",{className:tailwindMerge.twMerge("inline-flex items-center gap-1.5 font-medium",Vk[r],Ok[o],Bk[t],s),children:[n&&a==="left"&&c,e,n&&a==="right"&&c]})}var tt=({href:e,children:t,className:r="",external:o=false,title:n,variant:a="secondary",onClick:i,asButton:s=false,onPress:c,showArrow:l=false,alwaysUnderlined:d=false,LinkComponent:u,"data-pii-type":p,"data-pii-entity":m})=>{let f={...p&&{"data-pii-type":p},...m&&{"data-pii-entity":m}},g=o?{target:"_blank",rel:"noopener noreferrer"}:{},v=`${`${d?"underline decoration-1 underline-offset-4 decoration-current":"hover:underline hover:decoration-1 hover:underline-offset-4 hover:decoration-current"} cursor-pointer`} ${{primary:"text-action-primary hover:text-action-primary-hover visited:text-action-primary",secondary:"text-text-link-default hover:text-text-link-hover visited:text-text-link-default",muted:"text-text-secondary hover:text-text-secondary visited:text-text-secondary",unstyled:""}[a==="brand"?"primary":a==="default"?"secondary":a]} ${r}`,S=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[t,l&&jsxRuntime.jsxs("span",{children:["\xA0","\u2192"]})]});return s?jsxRuntime.jsx("button",{type:"button",className:v,onClick:c,title:n,...f,children:S}):u&&e?jsxRuntime.jsx(u,{href:e,className:v,title:n,onClick:i,...g,...f,children:S}):jsxRuntime.jsx("a",{href:e||"#",className:v,...g,...f,title:n,onClick:i,children:S})};var $k={info:{subtle:{container:"bg-feedback-info-background border-l-4 border-l-feedback-info-border",iconColor:"text-feedback-info-border",titleColor:"text-text-primary",bodyColor:"text-text-primary"},bold:{container:"bg-feedback-info-border border-feedback-info-border",iconColor:"text-text-inverse",titleColor:"text-text-inverse",bodyColor:"text-text-inverse/90"},icon:lucideReact.Info},success:{subtle:{container:"bg-feedback-success-background border-l-4 border-l-feedback-success-border",iconColor:"text-feedback-success-border",titleColor:"text-text-primary",bodyColor:"text-text-primary"},bold:{container:"bg-feedback-success-border border-feedback-success-border",iconColor:"text-text-inverse",titleColor:"text-text-inverse",bodyColor:"text-text-inverse/90"},icon:lucideReact.CheckCircle},warning:{subtle:{container:"bg-feedback-warning-background border-l-4 border-l-feedback-warning-border",iconColor:"text-feedback-warning-border",titleColor:"text-text-primary",bodyColor:"text-text-primary"},bold:{container:"bg-feedback-warning-border border-feedback-warning-border",iconColor:"text-text-inverse",titleColor:"text-text-inverse",bodyColor:"text-text-inverse/90"},icon:lucideReact.AlertCircle},error:{subtle:{container:"bg-feedback-error-background border-l-4 border-l-feedback-error-border",iconColor:"text-feedback-error-border",titleColor:"text-text-primary",bodyColor:"text-text-primary"},bold:{container:"bg-feedback-error-border border-feedback-error-border",iconColor:"text-text-inverse",titleColor:"text-text-inverse",bodyColor:"text-text-inverse/90"},icon:lucideReact.XCircle},discovery:{subtle:{container:"bg-background-muted border-l-4 border-l-action-brand",iconColor:"text-action-brand",titleColor:"text-text-primary",bodyColor:"text-text-primary"},bold:{container:"bg-action-brand border-action-brand",iconColor:"text-text-inverse",titleColor:"text-text-inverse",bodyColor:"text-text-inverse/90"},icon:lucideReact.Lightbulb}};function sc({variant:e="info",appearance:t="subtle",title:r,children:o,dismissible:n=false,onDismiss:a,primaryAction:i,secondaryAction:s,icon:c,hideIcon:l=false,className:d,testId:u}){let p=$k[e],m=p[t],f=p.icon,g=!!(i||s),b=!!(r||o);return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex gap-3 rounded-sm border p-4",m.container,d),role:"region","aria-live":"polite","data-testid":u,children:[!l&&jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-shrink-0",m.iconColor),"aria-hidden":"true",children:c||jsxRuntime.jsx(f,{className:"h-5 w-5"})}),jsxRuntime.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-3",children:[b&&jsxRuntime.jsxs("div",{className:"flex-1",children:[r&&jsxRuntime.jsx("div",{className:rr(bt("headingSm"),m.titleColor),children:r}),o&&jsxRuntime.jsx("div",{className:rr(bt("bodySm"),r?"mt-1":"",m.bodyColor),children:o})]}),g&&jsxRuntime.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[i&&(i.asLink?jsxRuntime.jsx(tt,{asButton:true,onPress:i.onPress,variant:t==="bold"?"unstyled":"default",className:t==="bold"?"text-text-inverse hover:text-text-inverse/80":"",children:i.label}):jsxRuntime.jsx(re,{size:"sm",variant:"primary",onPress:i.onPress,className:t==="bold"?"bg-background-surface text-text-primary hover:bg-background-surface/90":"",children:i.label})),s&&(s.asLink?jsxRuntime.jsx(tt,{asButton:true,onPress:s.onPress,variant:t==="bold"?"unstyled":"default",className:t==="bold"?"text-text-inverse hover:text-text-inverse/80":"",children:s.label}):jsxRuntime.jsx(re,{size:"sm",variant:"secondary",onPress:s.onPress,className:t==="bold"?"border-text-inverse/30 text-text-inverse hover:bg-text-inverse/10":"",children:s.label}))]})]}),n&&jsxRuntime.jsx("button",{type:"button",onClick:a,className:tailwindMerge.twMerge("flex h-8 w-8 flex-shrink-0 items-center justify-center self-start rounded-md transition-colors hover:bg-background-modal/10",m.iconColor,$e()),"aria-label":"Dismiss banner",children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]})}function mh({isOpen:e=true,position:t="sticky",className:r,...o}){let n=t==="fixed"?"fixed top-0 left-0 right-0 z-50":"sticky top-0 z-50",a=r?`${r} !rounded-none`:"!rounded-none";return jsxRuntime.jsx(framerMotion.AnimatePresence,{children:e&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:"easeInOut"},className:n,children:jsxRuntime.jsx(sc,{...o,className:a})})})}function sn({value:e,children:t,className:r,size:o="sm",iconPosition:n="right"}){let[a,i]=He.useState(false),l=jsxRuntime.jsx(re,{variant:"icon",size:o,onPress:()=>{let u=e||(typeof t=="string"?t:"");navigator.clipboard.writeText(u),i(true),setTimeout(()=>{i(false);},2e3);},className:"!px-2 relative",style:{top:"0.5px"},children:jsxRuntime.jsx(U,{name:"Copy",size:o==="sm"?14:16})}),d=a?jsxRuntime.jsx(nr,{content:"Copied!",children:l}):l;return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("inline-flex items-center gap-0.5",r),children:[n==="left"&&d,t,n==="right"&&d]})}function lc(e){let{children:t,maxWidth:r=600,className:o,...n}=e,{ref:a,width:i}=Ua(),[s,c]=He__namespace.default.useState(false),[l,d]=He__namespace.default.useState(false),u=He__namespace.default.useRef(false),p=He__namespace.default.useMemo(()=>t&&!e.items&&typeof t!="function"?He__namespace.default.Children.toArray(t):null,[t,e.items]);if(He__namespace.default.useEffect(()=>{p&&p.length>=4&&i>0&&!u.current?(u.current=true,c(i>r),d(true)):(!p||p&&p.length<4)&&d(true);let m=setTimeout(()=>{l||d(true);},100);return ()=>clearTimeout(m)},[i,r,p,l]),p&&s&&p.length>=4){let m=p[0],f=p.slice(1,-2),g=p.slice(-2),b=f.map(x=>{if(He__namespace.default.isValidElement(x)){let h=x.props;if(typeof h.children=="string")return {label:h.children,href:h.href}}return {label:"..."}});return jsxRuntime.jsxs(reactAriaComponents.Breadcrumbs,{...n,ref:a,className:tailwindMerge.twMerge("flex gap-2",l?"opacity-100":"opacity-0",o),children:[m,jsxRuntime.jsx(tP,{items:b}),g]})}return jsxRuntime.jsx(reactAriaComponents.Breadcrumbs,{...n,ref:a,className:tailwindMerge.twMerge("flex gap-2",l?"opacity-100":"opacity-0",o),children:t})}function tP({items:e}){let t=e.map((r,o)=>({id:`breadcrumb-${o}`,name:r.label,href:r.href}));return jsxRuntime.jsx(reactAriaComponents.Breadcrumb,{className:"flex items-center gap-2",children:jsxRuntime.jsxs("span",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Qa,{items:t,align:"left",size:"sm",children:jsxRuntime.jsx(re,{variant:"icon",size:"sm",icon:"DotsThree","aria-label":"Show hidden breadcrumbs",className:"px-0.5"})}),jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-4 w-4 text-text-secondary"})]})})}function cc(e){let{className:t,children:r,href:o,copyable:n,copyValue:a,...i}=e;return jsxRuntime.jsx(reactAriaComponents.Breadcrumb,{className:ke(t,"flex items-center gap-2"),...i,children:s=>{let c=s.isCurrent,l=typeof r=="function"?r(s):r;return jsxRuntime.jsx(jsxRuntime.Fragment,{children:c?n?jsxRuntime.jsx(sn,{value:a||(typeof l=="string"?l:void 0),size:"sm",iconPosition:"right",children:jsxRuntime.jsx("span",{className:"max-w-[200px] truncate font-semibold text-text-primary sm:max-w-none",children:l})}):jsxRuntime.jsx("span",{className:"max-w-[200px] truncate font-semibold text-text-primary sm:max-w-none",children:l}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(tt,{variant:"muted",href:o,className:"max-w-[150px] truncate sm:max-w-[300px] md:max-w-none",children:l}),jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-4 w-4 shrink-0 text-text-secondary"})]})})}})}function uP({isSelected:e,isDisabled:t}){let r=[$e,"w-9 h-9 text-sm cursor-default rounded-sm flex items-center justify-center forced-color-adjust-none font-semibold"];return t?r.push("text-text-disabled forced-colors:text-[GrayText]"):e?r.push("bg-action-default text-text-inverse invalid:bg-feedback-error-border forced-colors:bg-[Highlight] forced-colors:invalid:bg-[Mark] forced-colors:text-[HighlightText]"):r.push("text-text-primary hover:bg-background-hover pressed:bg-background-selected"),r.join(" ")}function ri({errorMessage:e,...t}){return jsxRuntime.jsxs(reactAriaComponents.Calendar,{...t,children:[jsxRuntime.jsx(dc,{}),jsxRuntime.jsxs(reactAriaComponents.CalendarGrid,{className:"border-separate [border-spacing:0] [&_td]:p-0 [&_td]:!border-0",children:[jsxRuntime.jsx(uc,{}),jsxRuntime.jsx(reactAriaComponents.CalendarGridBody,{children:r=>jsxRuntime.jsx(reactAriaComponents.CalendarCell,{date:r,className:({isSelected:o,isDisabled:n})=>`${uP({isSelected:o,isDisabled:n})} border-0`})})]}),e&&jsxRuntime.jsx(reactAriaComponents.Text,{slot:"errorMessage",className:"text-sm text-feedback-error-text",children:e})]})}function dc(){let{direction:e}=reactAriaComponents.useLocale(),t=18;return jsxRuntime.jsxs("header",{className:"flex w-full items-center gap-1 px-1 pb-4",children:[jsxRuntime.jsx(re,{variant:"icon",slot:"previous",className:"pl-0",children:e==="rtl"?jsxRuntime.jsx(U,{name:"CaretRight","aria-hidden":true,size:t}):jsxRuntime.jsx(U,{name:"CaretLeft","aria-hidden":true,size:t})}),jsxRuntime.jsx(reactAriaComponents.Heading,{className:"text-md mx-2 flex-1 text-center font-semibold text-text-primary"}),jsxRuntime.jsx(re,{variant:"icon",slot:"next",className:"pr-0",children:e==="rtl"?jsxRuntime.jsx(U,{name:"CaretLeft","aria-hidden":true,size:t}):jsxRuntime.jsx(U,{name:"CaretRight","aria-hidden":true,size:t})})]})}function uc(){return jsxRuntime.jsx(reactAriaComponents.CalendarGridHeader,{children:e=>jsxRuntime.jsx(reactAriaComponents.CalendarHeaderCell,{className:"text-xs font-semibold text-text-secondary",children:e})})}var yh=He__namespace.createContext(null);function ln(){let e=He__namespace.useContext(yh);if(!e)throw new Error("Carousel components must be used within a CarouselRoot");return e}function vh({page:e,defaultPage:t=0,onPageChange:r,orientation:o="horizontal",loop:n=false,autoplay:a=false,autoplayDelay:i=4e3,allowMouseDrag:s=false,spacing:c="1rem",slidesPerView:l=1,slidesPerMove:d=1,className:u,children:p,...m}){let f=e!==void 0,[g,b]=He__namespace.useState(t),x=f?e:g,h=He__namespace.useRef(null),[y,v]=He__namespace.useState(0),[S,w]=He__namespace.useState(typeof a=="boolean"?a:!!a),[N,D]=He__namespace.useState(false),R=He__namespace.useRef(null),A=He__namespace.useRef(null),O=typeof a=="object"&&a!==null&&a.delay?a.delay:i;He__namespace.useEffect(()=>{if(h.current){let C=Math.max(1,Math.floor(Number(l)||1)),W=h.current.children;if(W.length===0){v(0);return}let G=Math.ceil(W.length/C);v(G);}},[p,l]);let P=He__namespace.useRef(-1);He__namespace.useEffect(()=>{if(x!==P.current&&h.current){let C=Array.from(h.current.children);if(C.length===0)return;let W=x*l,G=Math.min(W,C.length-1),F=C[G];F&&typeof F.scrollIntoView=="function"&&(F.scrollIntoView({behavior:"smooth",block:o==="vertical"?"start":"nearest",inline:o==="horizontal"?"start":"nearest"}),P.current=x);}},[x,l,o]);let T=He__namespace.useCallback(C=>{let W=C;n?W<0?W=y-1:W>=y&&(W=0):W=Math.max(0,Math.min(C,y-1)),f||b(W),r?.(W);},[f,n,r,y]),k=He__namespace.useCallback(()=>{T(x+d);},[x,T,d]),V=He__namespace.useCallback(()=>{T(x-d);},[x,T,d]),H=He__namespace.useRef(k);He__namespace.useEffect(()=>{H.current=k;},[k]);let I=y>0&&(n||x<y-1),q=y>0&&(n||x>0),j=He__namespace.useCallback(()=>{w(C=>!C);},[]);He__namespace.useEffect(()=>{if(S&&y>1)return R.current=setInterval(()=>{H.current();},O),()=>{R.current&&(clearInterval(R.current),R.current=null);}},[S,y,O]);let K=He__namespace.useCallback(()=>{R.current&&(clearInterval(R.current),R.current=null);},[]),Y=He__namespace.useCallback(()=>{S&&y>1&&(R.current=setInterval(()=>{H.current();},O));},[S,y,O]),M=He__namespace.useCallback(C=>{if(!s)return;D(true);let W="touches"in C&&C.touches&&C.touches.length>0?C.touches[0].clientX:"clientX"in C?C.clientX:0,G="touches"in C&&C.touches&&C.touches.length>0?C.touches[0].clientY:"clientY"in C?C.clientY:0;A.current={x:W,y:G};},[s]),E=He__namespace.useCallback(C=>{if(!N||!A.current)return;let W="touches"in C&&C.touches&&C.touches.length>0?C.touches[0].clientX:"clientX"in C?C.clientX:0,G="touches"in C&&C.touches&&C.touches.length>0?C.touches[0].clientY:"clientY"in C?C.clientY:0,F=W-A.current.x,Z=G-A.current.y,_=50;o==="horizontal"&&Math.abs(F)>_?(F>0?V():k(),D(false),A.current=null):o==="vertical"&&Math.abs(Z)>_&&(Z>0?V():k(),D(false),A.current=null);},[N,o,k,V]),z=He__namespace.useCallback(()=>{D(false),A.current=null;},[]),B={currentPage:x,totalPages:y,orientation:o,loop:n,spacing:c,slidesPerView:l,goToPage:T,goToNext:k,goToPrev:V,canGoNext:I,canGoPrev:q,isAutoplayActive:S,toggleAutoplay:j,itemsRef:h,isDragging:N,allowMouseDrag:s,handleDragStart:M,handleDragMove:E,handleDragEnd:z};return jsxRuntime.jsx(yh.Provider,{value:B,children:jsxRuntime.jsx("div",{...m,className:tailwindMerge.twMerge("relative w-full",o==="vertical"?"h-full":"",u),onMouseEnter:K,onMouseLeave:Y,children:p})})}function Ch({className:e,children:t,...r}){let{itemsRef:o,orientation:n,spacing:a,isDragging:i,allowMouseDrag:s,handleDragStart:c,handleDragMove:l,handleDragEnd:d}=ln();return jsxRuntime.jsx("div",{ref:o,...r,className:tailwindMerge.twMerge("flex overflow-x-auto overflow-y-hidden snap-x snap-mandatory scrollbar-hide scroll-smooth",n==="vertical"&&"flex-col overflow-y-auto overflow-x-hidden snap-y",s&&i&&"cursor-grabbing select-none",s&&!i&&"cursor-grab",e),style:{gap:a,"--carousel-spacing":a,...r.style},onMouseDown:c,onMouseMove:l,onMouseUp:d,onMouseLeave:d,onTouchStart:c,onTouchMove:l,onTouchEnd:d,children:t})}function Sh({index:e,className:t,children:r,...o}){let{orientation:n,slidesPerView:a}=ln();return jsxRuntime.jsx("div",{...o,"data-index":e,className:tailwindMerge.twMerge("shrink-0 snap-start",n==="horizontal"?"h-full":"w-full",t),style:{width:n==="horizontal"?`calc((100% - (${a-1} * var(--carousel-spacing, 1rem))) / ${a})`:void 0,height:n==="vertical"?`calc((100% - (${a-1} * var(--carousel-spacing, 1rem))) / ${a})`:void 0,...o.style},children:r})}function wh({className:e,children:t,...r}){return jsxRuntime.jsx("div",{...r,className:tailwindMerge.twMerge("flex items-center justify-center gap-4 mt-4",e),children:t})}function Th({className:e,children:t,...r}){let{goToPrev:o,canGoPrev:n}=ln();return jsxRuntime.jsx("button",{type:"button",...r,onClick:a=>{o(),r.onClick?.(a);},disabled:!n||r.disabled,"aria-label":"Previous slide",className:tailwindMerge.twMerge("inline-flex items-center justify-center rounded-md","h-10 w-10","bg-background-input border border-border-input","text-text-primary hover:bg-background-muted","transition-colors duration-200","disabled:opacity-40 disabled:cursor-not-allowed","focus-visible:outline focus-visible:outline-2 focus-visible:outline-action-default",e),children:t||jsxRuntime.jsx(U,{name:"CaretLeft",size:"sm"})})}function Nh({className:e,children:t,...r}){let{goToNext:o,canGoNext:n}=ln();return jsxRuntime.jsx("button",{type:"button",...r,onClick:a=>{o(),r.onClick?.(a);},disabled:!n||r.disabled,"aria-label":"Next slide",className:tailwindMerge.twMerge("inline-flex items-center justify-center rounded-md","h-10 w-10","bg-background-input border border-border-input","text-text-primary hover:bg-background-muted","transition-colors duration-200","disabled:opacity-40 disabled:cursor-not-allowed","focus-visible:outline focus-visible:outline-2 focus-visible:outline-action-default",e),children:t||jsxRuntime.jsx(U,{name:"CaretRight",size:"sm"})})}function ym({index:e,className:t,children:r,...o}){let{currentPage:n,goToPage:a}=ln(),i=n===e;return jsxRuntime.jsx("button",{type:"button",...o,onClick:s=>{a(e),o.onClick?.(s);},"aria-label":`Go to slide ${e+1}`,"aria-current":i,className:tailwindMerge.twMerge("h-2 rounded-full transition-all duration-200",i?"w-6 bg-action-brand":"w-2 bg-border-muted hover:bg-border-input","focus-visible:outline focus-visible:outline-2 focus-visible:outline-action-default",t),children:r})}function kh({className:e,...t}){let{totalPages:r}=ln();return jsxRuntime.jsx("div",{...t,className:tailwindMerge.twMerge("flex items-center gap-2",e),role:"group","aria-label":"Carousel indicators",children:Array.from({length:r},(o,n)=>jsxRuntime.jsx(ym,{index:n},n))})}function Ph({className:e,children:t,...r}){let{isAutoplayActive:o,toggleAutoplay:n}=ln();return jsxRuntime.jsx("button",{type:"button",...r,onClick:a=>{n(),r.onClick?.(a);},"aria-label":o?"Pause autoplay":"Start autoplay",className:tailwindMerge.twMerge("inline-flex items-center justify-center rounded-md","h-10 w-10","bg-background-input border border-border-input","text-text-primary hover:bg-background-muted","transition-colors duration-200","focus-visible:outline focus-visible:outline-2 focus-visible:outline-action-default",e),children:t||jsxRuntime.jsx(U,{name:o?"Pause":"Play",size:"sm"})})}function Rh({className:e,...t}){let{currentPage:r,totalPages:o}=ln();return jsxRuntime.jsxs("div",{...t,className:tailwindMerge.twMerge("text-sm text-text-secondary tabular-nums",e),"aria-live":"polite","aria-atomic":"true",children:[r+1," / ",o]})}var hP="focus:ring-action-primary",yP="bg-action-primary border-action-primary text-[color:var(--color-action-primary-text)] hover:bg-action-primary-hover hover:border-action-primary-hover";function vm(e){return jsxRuntime.jsxs(reactAriaComponents.CheckboxGroup,{...e,className:ke(e.className,"flex flex-col gap-2"),children:[jsxRuntime.jsx(ze,{children:e.label}),e.children,e.description&&jsxRuntime.jsx(Pe,{children:e.description}),jsxRuntime.jsx(ge,{children:typeof e.errorMessage=="function"?void 0:e.errorMessage})]})}function vP({isDisabled:e}){return `flex gap-2 items-center group text-sm transition ${e?"text-text-disabled":"text-text-secondary"}`}function CP({isSelected:e,isInvalid:t,isDisabled:r,isIndeterminate:o}){let n="w-5 h-5 flex-shrink-0 rounded-[var(--control-border-radius)] flex items-center justify-center border-2 transition ring-offset-2 focus:ring-2",a=hP,i="";return r?i="border-border-muted bg-background-muted":t?i="border-feedback-error-border bg-feedback-error-background":e||o?i=yP:i="bg-background-input border-border-input hover:border-border-focus",`${n} ${a} ${i}`}var Mh="w-4 h-4 text-current group-disabled:text-text-disabled";function Zn(e){let{children:t,variant:r,...o}=e;return jsxRuntime.jsx(reactAriaComponents.Checkbox,{...o,className:reactAriaComponents.composeRenderProps(e.className,(n,a)=>`${vP(a)} ${n||""}`),children:n=>{let{isSelected:a,isIndeterminate:i,...s}=n,c=jsxRuntime.jsx("div",{className:CP({isSelected:a,isIndeterminate:i,...s}),children:i?jsxRuntime.jsx(lucideReact.Minus,{"aria-hidden":true,className:Mh}):a?jsxRuntime.jsx(lucideReact.Check,{"aria-hidden":true,className:Mh}):null});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[c,typeof t=="function"?t(n):t]})}})}var TP={primary:"bg-action-primary/10 text-action-primary border border-action-primary/20 hover:bg-action-primary/15",secondary:"bg-action-secondary text-[color:var(--color-action-secondary-text)] border border-border-muted hover:bg-action-secondary-hover",info:"bg-feedback-info-background text-feedback-info-text border border-feedback-info-border hover:bg-feedback-info-background/80"};function Eh(e){return !e||e==="default"?"secondary":e==="brand"?"primary":e}var NP={xs:"px-1.5 py-[2px] gap-0.5",sm:"px-2 py-1 gap-1",md:"px-3 py-1.5 gap-1.5",lg:"px-3 py-2 gap-2",xl:"px-4 py-2.5 gap-2"},kP="opacity-75 cursor-not-allowed pointer-events-none";function Lh(e){let{variant:t,size:r,isDisabled:o,isClickable:n,className:a}=e,i=r==="xs"?"text-xs":We[r].text;return tailwindMerge.twMerge("inline-flex items-center justify-center rounded-full font-medium transition-colors","whitespace-nowrap select-none",NP[r],i,TP[t],n&&!o&&"cursor-pointer",o&&kP,a)}function bo({children:e,onRemove:t,size:r="md",variant:o="secondary",isRemovable:n=true,isDisabled:a=false,className:i,onClick:s}){let c=!!s&&!a,l=n&&t&&!a,d=g=>{g.stopPropagation(),g.preventDefault(),t&&!a&&t();},u=()=>{s&&!a&&s();},p=r==="xs"?10:r==="sm"?12:r==="md"?14:16,f=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"truncate",children:e}),l?c?jsxRuntime.jsx("span",{onClick:d,onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),d(g));},role:"button",tabIndex:0,className:"flex-shrink-0 rounded-full p-0.5 hover:bg-text-primary/10 transition-colors cursor-pointer","aria-label":"Remove",children:jsxRuntime.jsx(U,{name:"X",size:p,className:"text-current opacity-70 hover:opacity-100"})}):jsxRuntime.jsx("button",{type:"button",onClick:d,className:"flex-shrink-0 rounded-full p-0.5 hover:bg-text-primary/10 transition-colors cursor-pointer","aria-label":"Remove",tabIndex:-1,children:jsxRuntime.jsx(U,{name:"X",size:p,className:"text-current opacity-70 hover:opacity-100"})}):null]});return c?jsxRuntime.jsx("button",{type:"button",onClick:u,className:Lh({variant:Eh(o),size:r,isDisabled:a,isClickable:c,className:i}),disabled:a,children:f}):jsxRuntime.jsx("span",{className:Lh({variant:Eh(o),size:r,isDisabled:a,isClickable:c,className:i}),children:f})}function Fh({label:e,description:t,errorMessage:r,size:o="md",tooltip:n,isRequired:a=false,isDisabled:i=false,isInvalid:s=false,validationResult:c,placeholder:l="Add items...",selectedItems:d=[],onItemsChange:u,staticItems:p,fetchSuggestions:m,chipVariant:f="secondary",showErrors:g=true,className:b}){let[x,h]=He.useState(""),[y,v]=He.useState([]),[S,w]=He.useState(false),[N,D]=He.useState(false),[R,A]=He.useState(-1),O=Zo(x,300),P=He.useRef(null),T=He.useRef(null),{isFocused:k,handleFocus:V,handleBlur:H}=Or(),I=He.useId(),q=He.useCallback(B=>{if(!u||!B.trim())return;let C=B.trim();if(d.includes(C)){h(""),D(false),v([]),A(-1);return}u([...d,C]),h(""),D(false),v([]),A(-1),P.current?.focus();},[d,u]),j=He.useCallback(B=>{u&&u(d.filter(C=>C!==B));},[d,u]);He.useEffect(()=>{if(!m)return;let B=true;return (async()=>{let W=O.trim();if(!W){B&&(w(false),v([]),D(false));return}w(true);try{let G=await m(W);if(!B)return;v(G),D(!0);}catch(G){if(!B)return;console.error("Error fetching suggestions:",G),v([]),D(false);}finally{B&&w(false);}})(),()=>{B=false;}},[O,m]),He.useEffect(()=>{if(m||!p)return;if(!O.trim()){v([]),D(false);return}let B=p.filter(C=>C.name.toLowerCase().includes(O.toLowerCase())).map(C=>C.id);v(B),D(B.length>0||O.trim().length>0);},[O,p,m]);let K=He.useMemo(()=>{let B=y.filter(C=>!d.includes(C));return x.trim()&&!B.includes(x.trim())&&!d.includes(x.trim())?[...B,`Create tag: "${x.trim()}"`]:B},[y,x,d]),Y=He.useCallback(B=>{h(B.target.value),A(-1),B.target.value&&D(true);},[]),M=He.useCallback(B=>{i||(B.startsWith("Create tag:")?q(x):q(B));},[q,x,i]),E=He.useCallback(B=>{if(!i)switch(B.key){case "Enter":case ",":if(B.preventDefault(),R>=0&&R<K.length){let C=K[R];C.startsWith("Create tag:")?q(x):q(C);}else x.trim()&&q(x.trim());break;case "Backspace":!x&&d.length>0&&(B.preventDefault(),j(d[d.length-1]));break;case "ArrowDown":B.preventDefault(),N&&A(C=>C<K.length-1?C+1:C);break;case "ArrowUp":B.preventDefault(),N&&A(C=>C>0?C-1:-1);break;case "Escape":D(false),A(-1);break}},[i,x,d,K,R,N,q,j]);He.useEffect(()=>{let B=C=>{T.current&&C.target instanceof Node&&!T.current.contains(C.target)&&D(false);};return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[]);let z=()=>tailwindMerge.twMerge("flex items-center gap-1.5 rounded-md overflow-x-auto overflow-y-hidden","[&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]",an({isInvalid:s,isDisabled:i,isFocused:k}),"bg-background-input",o==="sm"&&"px-2 py-1 h-[32px]",o==="md"&&"px-2.5 py-1.5 h-[40px]",o==="lg"&&"px-3 py-2 h-[44px]",o==="xl"&&"px-3.5 py-2.5 h-[48px]",i&&"opacity-50 cursor-not-allowed bg-background-muted");return jsxRuntime.jsxs("div",{ref:T,className:tailwindMerge.twMerge("relative flex flex-col gap-1",b),children:[e&&jsxRuntime.jsx(ze,{size:o,tooltip:n,isRequired:a,children:e}),jsxRuntime.jsx(vt,{children:jsxRuntime.jsxs("div",{className:z(),onClick:()=>!i&&P.current?.focus(),children:[d.map(B=>jsxRuntime.jsx(bo,{variant:f,size:"xs",onRemove:()=>j(B),isDisabled:i,className:"shrink-0 max-h-full",children:B},B)),jsxRuntime.jsx("input",{ref:P,type:"text",role:"combobox","aria-expanded":N,"aria-haspopup":"listbox","aria-controls":I,"aria-autocomplete":"list",value:x,onChange:Y,onKeyDown:E,onFocus:B=>V(B),onBlur:B=>H(B),placeholder:d.length===0?l:"",disabled:i,className:"flex-1 min-w-[120px] h-full !border-0 !outline-none !ring-0 bg-transparent text-text-primary text-sm placeholder:text-text-disabled disabled:cursor-not-allowed focus:!ring-0 focus:!outline-none focus:!border-0 focus-visible:!ring-0 focus-visible:!outline-none focus-visible:!border-0",style:{boxShadow:"none",WebkitAppearance:"none",appearance:"none",border:"none",outline:"none"}})]})}),N&&(x||K.length>0)&&jsxRuntime.jsx("div",{id:I,role:"listbox",className:tailwindMerge.twMerge("absolute z-50 mt-1 rounded-lg border border-border-default","max-h-60 overflow-auto bg-background-surface shadow-lg","left-0 right-0 top-full"),children:S?jsxRuntime.jsx("div",{className:"px-3 py-2 text-sm text-text-secondary",children:"Loading..."}):K.length>0?K.map((B,C)=>jsxRuntime.jsx("div",{role:"option","aria-selected":C===R,className:tailwindMerge.twMerge("cursor-pointer px-3 py-2 text-sm transition-colors","hover:bg-background-hover",C===R&&"bg-background-selected",B.startsWith("Create tag:")&&"italic text-text-secondary"),onClick:()=>M(B),children:B},B)):x&&jsxRuntime.jsx("div",{className:"px-3 py-2 text-sm text-text-secondary",children:"No suggestions found"})}),t&&jsxRuntime.jsx(Pe,{size:o,className:"mt-1",children:t}),g&&typeof r=="string"&&jsxRuntime.jsx(ge,{size:o,className:"text-feedback-error-text mt-1",children:r}),g&&typeof r=="function"&&c&&jsxRuntime.jsx(ge,{size:o,className:"text-feedback-error-text mt-1",children:r(c)})]})}var BP={json:()=>import('ace-builds/src-noconflict/mode-json'),javascript:()=>import('ace-builds/src-noconflict/mode-javascript'),typescript:()=>import('ace-builds/src-noconflict/mode-typescript'),html:()=>import('ace-builds/src-noconflict/mode-html'),css:()=>import('ace-builds/src-noconflict/mode-css'),markdown:()=>import('ace-builds/src-noconflict/mode-markdown'),yaml:()=>import('ace-builds/src-noconflict/mode-yaml'),xml:()=>import('ace-builds/src-noconflict/mode-xml'),python:()=>import('ace-builds/src-noconflict/mode-python'),sql:()=>import('ace-builds/src-noconflict/mode-sql')},VP={github:()=>import('ace-builds/src-noconflict/theme-github'),github_dark:()=>import('ace-builds/src-noconflict/theme-github_dark')},OP={"ext-language-tools":()=>import('ace-builds/src-noconflict/ext-language_tools')},ms=new Set;async function Sm(e,t){ms.has(e)||(await t(),ms.add(e));}async function zP(e,t,r){await Promise.all([Sm(`language:${e}`,BP[e]),Sm(`theme:${t}`,VP[t]),r?Sm("extension:language-tools",OP["ext-language-tools"]):void 0]);}function Vh(e,t,r){let o=ms.has(`language:${e}`)&&ms.has(`theme:${t}`);return r?o&&ms.has("extension:language-tools"):o}function Oh({value:e,readOnly:t=false,onChange:r,language:o="json",theme:n="github_dark",height:a,width:i="100%",className:s,lineHeight:c=19,minLines:l=3,maxLines:d=50,showLineNumbers:u=true,showGutter:p=true,fontSize:m=14,wrapEnabled:f=false}){let g=He.useRef(null),[b,x]=He.useState(()=>Vh(o,n,!t)),h=He.useMemo(()=>{if(a)return a;let y=(e.match(/\n/g)||[]).length+1;return `${Math.max(l,Math.min(y,d))*c+10}px`},[e,a,c,l,d]);return He.useEffect(()=>{let y=false,v=!t;return Vh(o,n,v)?(x(true),()=>{y=true;}):(x(false),zP(o,n,v).then(()=>{y||x(true);}).catch(S=>{y||x(true),console.error("Failed to load Ace editor resources",S);}),()=>{y=true;})},[o,t,n]),He.useEffect(()=>{b&&g.current?.editor&&g.current.editor.resize();},[h,b]),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden rounded-md border border-border-input",s),style:{width:i,height:h},children:b?jsxRuntime.jsx(IP__default.default,{ref:g,mode:o,theme:n,value:e,onChange:r,readOnly:t,width:"100%",height:"100%",fontSize:m,showPrintMargin:false,showGutter:p,highlightActiveLine:!t,setOptions:{useWorker:true,showLineNumbers:u,tabSize:2,enableBasicAutocompletion:!t,enableLiveAutocompletion:!t,enableSnippets:!t,showFoldWidgets:true,wrap:f},editorProps:{$blockScrolling:true}}):jsxRuntime.jsx("div",{className:"flex h-full w-full items-center justify-center bg-surface-muted text-foreground-muted",children:"Loading editor\u2026"})})}var Hh=He__namespace.createContext({variant:"contained",density:"comfortable",showDividers:true}),Wh=He__namespace.createContext(null),YP={contained:"rounded-lg border border-border-default bg-background-surface overflow-hidden",bordered:"rounded-lg border border-border-default bg-background-surface",plain:"bg-transparent"},zh={true:"divide-y divide-border-default",false:"gap-3"},KP={comfortable:"px-5 py-3",compact:"px-4 py-2.5"},qP={comfortable:"px-5 pt-0",compact:"px-4 pt-0"},jP={comfortable:"h-4 w-4",compact:"h-3.5 w-3.5"};function km(){return He__namespace.useContext(Hh)}function JP(e){let t=He__namespace.useContext(Wh);if(!t)throw new Error(`${e} must be used within a <CollapseItem>`);return t}function $P({variant:e,showDividers:t,className:r}){let o="group/collapse-item w-full transition-colors",n={contained:"bg-background-surface",bordered:"bg-background-surface",plain:"bg-transparent"},a=t?"":"rounded-lg border border-border-default bg-background-surface overflow-hidden";return tailwindMerge.twMerge(o,n[e],a,r)}function XP({isDisabled:e,isPressed:t,density:r,variant:o,showDividers:n,className:a}){let i="group/collapse-header flex w-full items-start gap-4 text-left transition-colors duration-150",s=e?"cursor-not-allowed text-text-disabled":"cursor-pointer text-text-primary",c=t&&!e?"bg-background-hover":"",l=KP[r];return tailwindMerge.twMerge(i,$e(),l,s,c,o==="plain"&&n?"px-0":"",a)}function ZP({density:e,showDividers:t,className:r}){let o="text-text-primary",n=qP[e];return tailwindMerge.twMerge(o,n,t?"":"rounded-b-lg",r)}function oi({variant:e="contained",density:t="comfortable",showDividers:r=true,className:o,...n}){let a=He__namespace.useMemo(()=>({variant:e,density:t,showDividers:r}),[e,t,r]),i=tailwindMerge.twMerge("flex w-full flex-col",YP[e],r?zh.true:zh.false,e==="plain"&&r?"border-y border-border-default/60":"");return jsxRuntime.jsx(Hh.Provider,{value:a,children:jsxRuntime.jsx(reactAriaComponents.DisclosureGroup,{...n,className:ke(o,i)})})}function dn({className:e,children:t,...r}){let{variant:o,showDividers:n}=km();return jsxRuntime.jsx(reactAriaComponents.Disclosure,{...r,className:reactAriaComponents.composeRenderProps(e,a=>$P({variant:o,showDividers:n,className:a})),children:a=>jsxRuntime.jsx(Wh.Provider,{value:a,children:t})})}dn.displayName="CollapseItem";function un({title:e,description:t,startContent:r,endContent:o,indicator:n,indicatorPosition:a="end",showIndicator:i=true,keepIndicatorSpace:s=false,children:c,className:l,...d}){let u=JP("CollapseHeader"),{density:p,variant:m,showDividers:f}=km(),g=jP[p];return jsxRuntime.jsx(reactAriaComponents.Button,{...d,slot:"trigger","data-expanded":u.isExpanded?"true":void 0,className:reactAriaComponents.composeRenderProps(l,(b,x)=>XP({isDisabled:x.isDisabled??false,isPressed:x.isPressed??false,density:p,variant:m,showDividers:f,className:b})),children:b=>{let x=b.isDisabled??false,h=i?typeof n=="function"?n({isExpanded:u.isExpanded,isDisabled:x}):n??jsxRuntime.jsx(U,{name:"CaretDown",size:p==="compact"?"xs":"sm",weight:"bold","aria-hidden":"true",className:tailwindMerge.twMerge("text-text-secondary transition-transform duration-200",u.isExpanded?"rotate-180":"rotate-0")}):null,y=h?jsxRuntime.jsx("span",{className:tailwindMerge.twMerge("flex flex-shrink-0 items-center justify-center text-text-secondary",g),"aria-hidden":"true",children:h}):s?jsxRuntime.jsx("span",{className:tailwindMerge.twMerge("flex flex-shrink-0 items-center justify-center",g),"aria-hidden":"true"}):null;return jsxRuntime.jsxs("div",{className:"flex w-full items-center gap-4",children:[a==="start"&&y,r&&jsxRuntime.jsx("div",{className:"flex flex-shrink-0 items-center text-text-secondary",children:r}),jsxRuntime.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[c??jsxRuntime.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1 text-left",children:[e&&jsxRuntime.jsx("span",{className:"truncate font-medium text-text-primary",children:e}),t&&jsxRuntime.jsx("span",{className:"text-sm text-text-secondary",children:t})]}),o&&jsxRuntime.jsx("div",{className:"flex flex-shrink-0 items-center text-sm text-text-secondary",children:o})]}),a==="end"&&y]})}})}un.displayName="CollapseHeader";function pn({className:e,children:t,...r}){let{density:o,showDividers:n}=km();return jsxRuntime.jsx(reactAriaComponents.DisclosurePanel,{...r,className:reactAriaComponents.composeRenderProps(e,a=>ZP({density:o,showDividers:n,className:a})),children:t})}pn.displayName="CollapseContent";function ni(e){if(!e)return false;let t=e.startsWith("#")?e.slice(1):e;return /^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$/.test(t)}function Rm(e){if(!e)return "";let t=e.startsWith("#")?e.slice(1):e;return t.length===3&&(t=t.split("").map(r=>r+r).join("")),`#${t.toUpperCase()}`}function tR({label:e,description:t,errorMessage:r,size:o="md",tooltip:n,isRequired:a,transparent:i,className:s,validationResult:c,value:l,defaultValue:d,onChange:u,placeholder:p="#000000",showColorSwatch:m=true,reserveErrorSpace:f=true,...g}){let[b,x]=He.useState(d||""),[h,y]=He.useState(l||d||""),[v,S]=He.useState(false),[w,N]=He.useState(null),{isFocused:D,handleFocus:R,handleBlur:A}=Or(),O=l!==void 0?l:b;He.useEffect(()=>{l!==void 0&&y(l);},[l]);let P=O?!ni(O):false,T=He.useCallback(H=>{if(y(H),ni(H)){let I=Rm(H);u?u(I):x(I);}else H===""&&(u?u(""):x(""));},[u]),k=He.useCallback(H=>{let I=Rm(H);y(I),u?u(I):x(I);},[u]),V=He.useCallback(H=>{if(ni(h)){let I=Rm(h);y(I),u&&I!==O?u(I):!u&&I!==b&&x(I);}A(H,g.onBlur);},[h,O,b,u,A,g.onBlur]);return jsxRuntime.jsx(reactAriaComponents.TextField,{...g,isRequired:a,className:ke(s,"group flex flex-col"),children:({isDisabled:H})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(ze,{size:o,tooltip:n,isRequired:a,children:e}),jsxRuntime.jsx(vt,{children:jsxRuntime.jsxs("div",{className:"flex gap-2",children:[jsxRuntime.jsxs("div",{className:"flex-1 relative",children:[jsxRuntime.jsx(rc,{size:o,disabled:H,type:"text",value:h,placeholder:p,onFocus:I=>R(I,g.onFocus),onBlur:V,onChange:I=>T(I.target.value),className:tailwindMerge.twMerge(Wt({isInvalid:P,isDisabled:H,isFocused:D,size:o,transparent:i}),m?"pr-12":"pr-3","pl-3")}),m&&jsxRuntime.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none",style:{width:We[o].height},children:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-6 h-6 rounded border shadow-sm",ni(O)?"border-border-default":"border-border-default bg-background-muted"),style:ni(O)?{backgroundColor:O}:void 0,"aria-hidden":"true",children:!ni(O)&&jsxRuntime.jsx("div",{className:"w-full h-full flex items-center justify-center",children:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full border-2 border-border-muted"})})})})]}),jsxRuntime.jsx("div",{ref:N,children:jsxRuntime.jsx(re,{variant:"secondary",size:o,icon:"Palette",onPress:()=>S(!v),isDisabled:H,className:"flex-shrink-0",children:"Pick"})})]})}),f?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof r=="string"?jsxRuntime.jsx(ge,{size:o,children:r}):typeof r=="function"&&c?jsxRuntime.jsx(ge,{size:o,children:r(c)}):t?jsxRuntime.jsx(Pe,{size:o,children:t}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof r=="string"?jsxRuntime.jsx(ge,{size:o,className:"mt-1",children:r}):typeof r=="function"&&c?jsxRuntime.jsx(ge,{size:o,className:"mt-1",children:r(c)}):t?jsxRuntime.jsx(Pe,{size:o,className:"mt-1",children:t}):null}),v&&w&&jsxRuntime.jsx(lt,{triggerRef:{current:w},isOpen:v,onOpenChange:S,placement:"bottom end",className:"bg-background-input shadow-xl border border-border-input/20 backdrop-blur-sm rounded-lg p-4",children:jsxRuntime.jsxs("div",{className:"flex flex-col gap-4",children:[jsxRuntime.jsx(reactColorful.HexColorPicker,{color:O||"#000000",onChange:k,style:{width:"200px",height:"200px"}}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"w-10 h-10 rounded border border-border-default shadow-sm flex-shrink-0",style:{backgroundColor:O||"#000000"}}),jsxRuntime.jsx("div",{className:"flex-1 text-text-primary text-[length:var(--control-text-sm)] font-mono",children:O||"#000000"})]})]})})]})})}function Yh({isOpen:e,onClose:t,onConfirm:r,title:o,message:n,confirmLabel:a="Confirm",cancelLabel:i="Cancel",confirmVariant:s,isDestructive:c=false,isLoading:l=false,maxWidth:d="500px",minWidth:u="400px"}){return jsxRuntime.jsx(Ir,{isOpen:e,onClose:t,title:o,maxWidth:d,minWidth:u,primaryAction:{label:a,onPress:()=>{r();},variant:s??(c?"destructive":"primary"),isLoading:l},secondaryAction:{label:i,onPress:t,variant:"secondary",isDisabled:l},children:jsxRuntime.jsx("div",{className:"text-text-primary",children:n})})}function Kh({isConnected:e,connectedAt:t,disconnectedAt:r,showTimestamp:o=false,isLoading:n,size:a="sm",shape:i="pill",...s}){if(n)return jsxRuntime.jsx(J,{className:"inline-flex h-6 w-24"});let c=e?"Connected":"Disconnected",l=e?"success":"neutral",d=null;if(o){if(e&&t)d=bl(t);else if(!e&&r){let u=bl(r);d=u?`Offline ${u}`:null;}}return jsxRuntime.jsxs("div",{className:"inline-flex flex-col gap-1",children:[jsxRuntime.jsx(at,{variant:l,size:a,shape:i,dot:e,dotPulse:e,...s,children:c}),d&&jsxRuntime.jsx("span",{className:"text-xs text-text-secondary",children:d})]})}function qh({firstName:e,lastName:t,email:r,phone:o,avatarUrl:n,href:a,LinkComponent:i,variant:s="outlined",layout:c="horizontal",showEmail:l=true,showPhone:d=false,isLoading:u=false,className:p,contentClassName:m,piiEntity:f}){let g=`${e} ${t}`.trim(),b=({children:h,className:y})=>a?i?jsxRuntime.jsx(i,{href:a,className:y,children:h}):jsxRuntime.jsx(tt,{href:a,variant:"unstyled",className:tailwindMerge.twMerge("hover:underline",y),asButton:false,children:h}):jsxRuntime.jsx("span",{className:y,children:h}),x=c==="vertical";return u?jsxRuntime.jsx(Ge,{variant:s,className:tailwindMerge.twMerge("flex flex-col",p),children:jsxRuntime.jsx(Ge.Content,{className:"flex items-center flex-1",children:jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("w-full",x?"flex flex-col items-center gap-4":"flex items-center gap-4"),children:[jsxRuntime.jsx(J,{width:56,height:56,className:"rounded flex-shrink-0"}),jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge(x?"w-full text-center":"flex-1","space-y-2"),children:[jsxRuntime.jsx(J,{width:"70%",height:20,className:tailwindMerge.twMerge(x&&"mx-auto")}),jsxRuntime.jsx(J,{width:"100%",height:16,className:tailwindMerge.twMerge(x&&"mx-auto")})]})]})})}):jsxRuntime.jsx(Ge,{variant:s,className:tailwindMerge.twMerge("group/card flex flex-col",p),children:jsxRuntime.jsx(Ge.Content,{className:tailwindMerge.twMerge("flex items-center flex-1",a&&"cursor-pointer",m),children:jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative w-full",x?"flex flex-col items-center gap-4 text-center":"flex items-center gap-4"),children:[jsxRuntime.jsx(Io,{firstName:e,lastName:t,src:n,size:"xl",variant:"user",shape:"square",className:"flex-shrink-0",piiEntity:f}),jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge(x?"w-full":"flex-1 min-w-0"),children:[a&&jsxRuntime.jsx(b,{className:"after:absolute after:inset-0",children:jsxRuntime.jsx("span",{className:"sr-only",children:g})}),jsxRuntime.jsx("span",{className:"text-lg font-semibold leading-tight text-text-primary block mb-1.5 group-hover/card:text-text-brand transition-colors","data-pii-type":f?"full-name":void 0,"data-pii-entity":f,children:g}),jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("space-y-0.5",x&&"flex flex-col items-center"),children:[l&&r&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2.5 text-text-primary",children:[jsxRuntime.jsx(U,{name:"Envelope",size:16,className:"text-text-secondary flex-shrink-0"}),jsxRuntime.jsx(tt,{href:`mailto:${r}`,variant:"unstyled",className:tailwindMerge.twMerge("text-sm leading-relaxed text-text-primary relative z-20",x?"":"truncate"),"data-pii-type":f?"email":void 0,"data-pii-entity":f,children:r})]}),d&&o&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2.5 text-text-primary",children:[jsxRuntime.jsx(U,{name:"Phone",size:16,className:"text-text-secondary flex-shrink-0"}),jsxRuntime.jsx(tt,{href:`tel:${o}`,variant:"unstyled",className:tailwindMerge.twMerge("text-sm leading-relaxed text-text-primary relative z-20",x?"":"truncate"),"data-pii-type":f?"phone":void 0,"data-pii-entity":f,children:Ha(o)})]})]})]})]})})})}function fc({firstName:e,lastName:t,email:r,avatarUrl:o,layout:n="stacked",size:a="md",href:i,LinkComponent:s,linkVariant:c="unstyled",emphasis:l="normal",showEmail:d=false,badge:u,avatarShape:p,isLoading:m=false,className:f,piiEntity:g}){let b=p??(n==="inline"?"circle":"square"),h={xs:{avatarSize:"xs",gap:"gap-1.5",textSize:"text-xs",secondaryTextSize:"text-xs",skeletonAvatar:24,skeletonText:80,skeletonSecondary:60},sm:{avatarSize:"sm",gap:"gap-2",textSize:"text-sm",secondaryTextSize:"text-xs",skeletonAvatar:32,skeletonText:96,skeletonSecondary:72},md:{avatarSize:"md",gap:"gap-3",textSize:"text-base",secondaryTextSize:"text-sm",skeletonAvatar:40,skeletonText:128,skeletonSecondary:96},lg:{avatarSize:"lg",gap:"gap-3",textSize:"text-lg",secondaryTextSize:"text-base",skeletonAvatar:48,skeletonText:160,skeletonSecondary:120}}[a],y=`${e} ${t}`.trim(),S={strong:"font-semibold text-text-primary",high:"font-semibold text-text-primary",normal:"text-text-primary",low:"text-text-secondary"}[l],w=({children:N,className:D})=>i?s?jsxRuntime.jsx(s,{href:i,className:D,children:N}):jsxRuntime.jsx(tt,{href:i,variant:c,className:tailwindMerge.twMerge("hover:underline",D),asButton:false,children:N}):jsxRuntime.jsx("span",{className:D,children:N});return m?n==="inline"?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center",h.gap,f),children:[jsxRuntime.jsx(J,{width:h.skeletonAvatar,height:h.skeletonAvatar,className:"flex-shrink-0 rounded-full"}),jsxRuntime.jsx(J,{width:h.skeletonText,height:h.skeletonAvatar*.5})]}):jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center",h.gap,f),children:[jsxRuntime.jsx(J,{width:h.skeletonAvatar,height:h.skeletonAvatar,className:"flex-shrink-0 rounded-full"}),jsxRuntime.jsxs("div",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx(J,{width:h.skeletonText,height:16}),d&&jsxRuntime.jsx(J,{width:h.skeletonSecondary,height:12})]})]}):n==="inline"?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center",h.gap,f),children:[jsxRuntime.jsxs(w,{className:tailwindMerge.twMerge("flex items-center",h.gap),children:[jsxRuntime.jsx(Io,{firstName:e,lastName:t,src:o,size:h.avatarSize,variant:"user",shape:b,className:"flex-shrink-0",piiEntity:g}),jsxRuntime.jsx("span",{className:tailwindMerge.twMerge("leading-normal truncate hover:text-text-primary",S,h.textSize,i&&"hover:underline hover:decoration-1 hover:underline-offset-4"),"data-pii-type":g?"full-name":void 0,"data-pii-entity":g,children:y})]}),u]}):jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center justify-start",h.gap,f),children:[jsxRuntime.jsx(Io,{firstName:e,lastName:t,src:o,size:h.avatarSize,variant:"user",shape:b,className:"flex-shrink-0",piiEntity:g}),jsxRuntime.jsxs("div",{className:"flex flex-col items-start min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(w,{className:tailwindMerge.twMerge("leading-normal truncate hover:text-text-primary",S,h.textSize,i&&"hover:underline hover:decoration-1 hover:underline-offset-4"),children:jsxRuntime.jsx("span",{"data-pii-type":g?"full-name":void 0,"data-pii-entity":g,children:y})}),u]}),d&&r&&jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("text-text-secondary leading-normal truncate",h.secondaryTextSize),"data-pii-type":g?"email":void 0,"data-pii-entity":g,children:r})]})]})}var gc={duration:.5,ease:"easeInOut"},zr=He.createContext(null),ta=()=>{let e=He.useContext(zr);if(!e)throw new Error("useChartContext must be used within a ChartContextProvider");return e};function bc(e,t){if(t<=0||e.length<2)return e;let r=[e[0]];for(let o=1;o<e.length;o++)e[o].xValue.getTime()-e[o-1].xValue.getTime()>t&&r.push(null),r.push(e[o]);return r}var fn=({data:e,color:t="var(--color-viz-default)",baseline:r,fillOpacity:o=.1,showLine:n=true,maxGapMs:a,animate:i=true})=>{let s=He.useId(),c=He.useId(),{xScale:l,yScale:d,animationSettings:u}=ta(),p=l.range(),m=d.range(),f=(y,v)=>typeof r=="function"?r(y,v):r??0,g=y=>y.chartYValue??y.yValue,b=a!=null?bc(e,a):e,x={transformOrigin:`0 ${m[0]}px`,transformBox:"fill-box",isolation:"isolate"},h=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[r===void 0?jsxRuntime.jsx(shape.AreaClosed,{data:b,x:y=>y?l(y.xValue):0,y:y=>y?d(g(y)):0,yScale:d,defined:y=>y!=null,fill:`url(#${s})`,curve:curve.curveLinear}):jsxRuntime.jsx(shape.Area,{data:b,x:y=>y?l(y.xValue):0,y0:(y,v)=>y?d(f(y,v)):0,y1:y=>y?d(g(y)):0,defined:y=>y!=null,fill:t,fillOpacity:o,curve:curve.curveLinear}),n?jsxRuntime.jsx(shape.LinePath,{data:b,x:y=>y?l(y.xValue):0,y:y=>y?d(g(y)):0,defined:y=>y!=null,stroke:t,strokeWidth:3,curve:curve.curveLinear}):null]});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("defs",{children:[jsxRuntime.jsxs("linearGradient",{id:s,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[jsxRuntime.jsx("stop",{offset:"50%",stopColor:t,stopOpacity:o}),jsxRuntime.jsx("stop",{offset:"100%",stopColor:t,stopOpacity:0})]}),i&&jsxRuntime.jsx("clipPath",{id:c,children:jsxRuntime.jsx("rect",{x:p[0],y:m[1],width:p[1]-p[0],height:m[0]-m[1]})})]}),i?jsxRuntime.jsx("g",{clipPath:`url(#${c})`,children:jsxRuntime.jsx(framerMotion.motion.g,{initial:{scaleY:0},animate:{scaleY:1},transition:{duration:u.duration,ease:u.ease},style:x,children:h})}):jsxRuntime.jsx("g",{style:x,children:h})]})};var hc=({data:e,color:t="var(--color-viz-default)",opacity:r=1,categoryColors:o={}})=>{let{xScale:n,yScale:a,animationSettings:i}=ta(),s=He.useId(),c=n.range(),l=a.range(),d=[...e].sort((m,f)=>m.xValue.getTime()-f.xValue.getTime());if(d.length===0)return null;let u=d.length>1?d[1].xValue.getTime()-d[0].xValue.getTime():15*6e4,p=Math.abs(n(new Date(d[0].xValue.getTime()+u))-n(d[0].xValue));return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("clipPath",{id:s,children:jsxRuntime.jsx("rect",{x:c[0],y:l[1],width:c[1]-c[0],height:l[0]-l[1]})})}),jsxRuntime.jsx("g",{clipPath:`url(#${s})`,children:jsxRuntime.jsx(framerMotion.motion.g,{initial:{scaleY:0},animate:{scaleY:1},transition:{duration:i.duration,ease:i.ease},style:{transformOrigin:`0 ${a(0)}px`,isolation:"isolate"},children:d.map((m,f)=>{let g=n(m.xValue),b=a(m.yValue),x=a(0),h=Math.min(b,x),y=Math.abs(b-x),v=d[f+1],S=v?Math.abs(n(v.xValue)-g):p,w=m.category&&o[m.category]?o[m.category]:t;return jsxRuntime.jsx(shape.Bar,{x:g-S/2,y:h,width:S,height:y,fill:w,opacity:r,rx:1},m.xValue.getTime())})})})]})};var ho=fl(xy()),yy=fl(hy());var RR=["top","left","transform","className","children","innerRef"];function Hm(){return Hm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);}return e},Hm.apply(this,arguments)}function MR(e,t){if(e==null)return {};var r={},o=Object.keys(e),n,a;for(a=0;a<o.length;a++)n=o[a],!(t.indexOf(n)>=0)&&(r[n]=e[n]);return r}function gs(e){var t=e.top,r=t===void 0?0:t,o=e.left,n=o===void 0?0:o,a=e.transform,i=e.className,s=e.children,c=e.innerRef,l=MR(e,RR);return He__namespace.default.createElement("g",Hm({ref:c,className:(0, yy.default)("visx-group",i),transform:a||"translate("+n+", "+r+")"},l),s)}gs.propTypes={top:ho.default.number,left:ho.default.number,transform:ho.default.string,className:ho.default.string,children:ho.default.node,innerRef:ho.default.oneOfType([ho.default.string,ho.default.func,ho.default.object])};function FR(e){return e>=1e9?"GW":e>=1e6?"MW":e>=1e3?"kW":"W"}function BR(e){return e>=1e3?"kA":e<1?"mA":"A"}function VR(e){return e>=1e3?"kV":e<1?"mV":"V"}function OR(e){return e>=1e6?"M\u03A9":e>=1e3?"k\u03A9":e<1?"m\u03A9":"\u03A9"}function li(e,t){if(typeof e!="object"||e===null)return e;switch(e.type){case "energy":{if(e.unit||e.autoScale===false)return e;let r=e.sourceUnit?Iu[e.sourceUnit]:1;return {...e,unit:Au(t*r)}}case "power":return e.unit||e.autoScale===false?e:{...e,unit:FR(t)};case "current":return e.unit||e.autoScale===false?e:{...e,unit:BR(t)};case "voltage":return e.unit||e.autoScale===false?e:{...e,unit:VR(t)};case "resistance":return e.unit||e.autoScale===false?e:{...e,unit:OR(t)};default:return e}}var zR=e=>e.baselineValue??0,Ie={top:0,right:0,bottom:50,left:60};function Qr(e={type:"number"}){let t=i=>{if(i==null)return "-";let s=lo({value:i,formatter:e});if(s===null)return "-";if(typeof s=="string")return s;if(typeof s=="number")return s.toString();if(typeof s=="object"&&s!==null&&"props"in s){let c=d=>{if(d==null)return "";if(typeof d=="string")return d;if(typeof d=="number")return d.toString();if(typeof d=="object"&&"props"in d){let u=d.props;if(u?.children)return Array.isArray(u.children)?u.children.map(c).join(""):c(u.children)}return ""};return c(s)||i.toString()}return i.toString()},r=i=>{if(i==null)return "-";if(typeof e=="string"){let s=lo({value:i,formatter:e});return s===null?"-":String(s)}if(typeof e=="object"&&e.type)switch(e.type){case "energy":case "power":case "voltage":case "current":case "resistance":case "temperature":case "distance":return t(i);case "currency":return t(i);default:return t(i)}return t(i)},o,n,a;return typeof e=="object"&&e.type&&e.type==="number"&&("min"in e&&(o=e.min),"max"in e&&(n=e.max)),{format:t,tickFormat:r,min:o,max:n,tickInterval:a}}var Wm=(e,t)=>{let r=d3Array.extent(e,o=>o.xValue);return scale.scaleTime({range:[Ie.left,t-Ie.right],domain:r,nice:true})},bs=(e,t,r,o)=>{let n=Qr(r);if(o)return scale.scaleLinear({range:[t-Ie.bottom,Ie.top],domain:o,nice:true});let a=d3Array.min(e,l=>Math.min(l.yValue,l.chartYValue??l.yValue))||0,i=d3Array.max(e,l=>Math.max(l.yValue,l.chartYValue??l.yValue))||0,s=n.min!==void 0?n.min:a>=0?0:a*1.1,c=n.max!==void 0?n.max:i<=0?0:i*1.1;return scale.scaleLinear({range:[t-Ie.bottom,Ie.top],domain:[s,c],nice:true})};function HR(e,t=12,r="system-ui"){if(typeof window>"u"||typeof document>"u")return e.length*(t*.6);let o=document.createElement("canvas"),n=null;try{n=o.getContext("2d");}catch{return e.length*(t*.6)}return n?(n.font=`${t}px ${r}`,n.measureText(e).width):e.length*(t*.6)}function ci(e,t=12,r="system-ui"){return e.length===0?0:Math.max(...e.map(o=>HR(o,t,r)))}function xs(e){return e instanceof Date&&!Number.isNaN(e.getTime())}function WR(e,t,r=12,o=false){if(!xs(t[0])||!xs(t[1]))return console.warn("ChartAxis: Invalid date in domain, skipping tick calculation"),[];let n=t[0].getTime(),i=t[1].getTime()-n;if(i===0||i<1e3)return [t[0]];let s=Xi({start:t[0],end:t[1]},{compact:o}),l=[t[0],new Date((t[0].getTime()+t[1].getTime())/2),t[1]].map(b=>s(b)),d=ci(l,r),p=d+d,m=Math.floor(e/p),f=Math.max(2,Math.min(8,m));if(f<=2)return [t[0],t[1]];let g=[t[0]];for(let b=1;b<f-1;b++){let x=b/(f-1),h=n+i*x;g.push(new Date(h));}return g.push(t[1]),g}var GR=({top:e,scale:t,width:r})=>{let o=t.domain(),n=[o[0],o[o.length-1]],a=xs(n[0])&&xs(n[1]),i=r<400,s=a?n[0].getTime():0,c=a?n[1].getTime():0,l=He.useMemo(()=>a?Xi({start:n[0],end:n[1]},{compact:i}):()=>"",[s,c,i,a]),d=He.useMemo(()=>WR(r,n,12,i),[r,s,c,i]);return d.length===0?null:jsxRuntime.jsx(axis.Axis,{orientation:"bottom",top:e,scale:t,tickValues:d,tickFormat:u=>{let p=u;return xs(p)?l(p):""},stroke:"var(--color-border-muted)",tickStroke:"var(--color-border-muted)",tickLabelProps:(u,p,m)=>({fill:"var(--color-text-secondary)",fontSize:12,textAnchor:p===0?"start":p===m.length-1?"end":"middle"}),rangePadding:0})};function di(e,t=12){let r=t*2.5,o=Math.floor(e/r);return Math.max(2,Math.min(6,o))}var UR=({left:e,scale:t,yFormatter:r,height:o})=>{let n=Qr(r),a=He.useMemo(()=>!o||o<=0?5:di(o),[o]);return jsxRuntime.jsx(axis.Axis,{orientation:"left",left:e,scale:t,numTicks:a,tickFormat:i=>(n.tickFormat||n.format)(i),stroke:"var(--color-border-muted)",tickStroke:"var(--color-border-muted)",tickLabelProps:()=>({fill:"var(--color-text-secondary)",fontSize:12,textAnchor:"end",dy:"0.33em"})})},YR=({top:e,scale:t})=>jsxRuntime.jsx(axis.Axis,{orientation:"bottom",top:e,scale:t,stroke:"var(--color-border-muted)",tickStroke:"var(--color-border-muted)",tickLabelProps:()=>({fill:"var(--color-text-secondary)",fontSize:12,textAnchor:"middle",dy:"0.25em"})}),KR=({left:e,scale:t})=>jsxRuntime.jsx(axis.Axis,{orientation:"left",left:e,scale:t,stroke:"var(--color-border-muted)",tickStroke:"var(--color-border-muted)",tickLabelProps:()=>({fill:"var(--color-text-secondary)",fontSize:12,textAnchor:"end",dx:"-0.25em",dy:"0.33em"})}),qR=({top:e,scale:t,yFormatter:r,width:o})=>{let n=Qr(r),a=He.useMemo(()=>{if(!o||o<=0)return 5;let s=Math.floor(o/60);return Math.max(2,Math.min(8,s))},[o]);return jsxRuntime.jsx(axis.Axis,{orientation:"bottom",top:e,scale:t,numTicks:a,tickFormat:i=>(n.tickFormat||n.format)(i),stroke:"var(--color-border-muted)",tickStroke:"var(--color-border-muted)",tickLabelProps:()=>({fill:"var(--color-text-secondary)",fontSize:12,textAnchor:"middle",dy:"0.25em"})})},Hr={Bottom:GR,Left:UR,CategoryBottom:YR,CategoryLeft:KR,NumericBottom:qR};var gn=({data:e,formatter:t,label:r,categoryLabels:o})=>{if(!e)return null;let n=He__namespace.default.useContext(zr),a=o??n?.categoryLabels,i=n?.xScale,s=n?.width,c=n?.height,l=Qr(t),d=h=>{if(h.baselineValue===void 0)return l.format(h.value);let y=Math.min(h.baselineValue,h.value),v=Math.max(h.baselineValue,h.value);return `${l.format(y)} \u2013 ${l.format(v)}`},u=He__namespace.default.useRef(null),[p,m]=He__namespace.default.useState({x:0,y:0,translate:"translate(-50%, -100%)"});He__namespace.default.useEffect(()=>{if(!u.current)return;let y=u.current.getBoundingClientRect(),v=s??window.innerWidth,S=c??window.innerHeight,w=e.x,N=e.y,D=16,R=e.x+y.width+D<=v,A=e.x-y.width-D>=0,O;e.position==="left"?O=A||!R:O=!R&&A;let P=O?"translate(calc(-100% - 16px), -50%)":"translate(16px, -50%)";if(!R&&!A){let T=v-e.x,k=e.x;T<=k?(w=v,P="translate(-100%, -50%)"):(w=0,P="translate(0, -50%)");}N-y.height/2<0?N=y.height/2:N+y.height/2>S&&(N=S-y.height/2),m({x:w,y:N,translate:P});},[e.x,e.y,e.position,s,c]);let f=i?.domain(),b=f&&f.length===2&&f.every(h=>h instanceof Date)?ax({start:f[0],end:f[1]}):null,x=r||(b&&e.xValue instanceof Date?b(e.xValue):String(e.xValue));return jsxRuntime.jsx(framerMotion.AnimatePresence,{children:jsxRuntime.jsxs(framerMotion.motion.div,{ref:u,role:"tooltip","aria-live":"polite",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},"data-testid":"tooltip",className:"pointer-events-none absolute z-50 rounded-lg bg-background-surface p-4 text-sm shadow-xl ring-1 ring-border-default whitespace-nowrap",style:{left:p.x,top:p.y,transform:p.translate},children:[jsxRuntime.jsx("div",{className:"mb-1 font-medium text-text-primary",children:x}),e.isEvent?jsxRuntime.jsxs("div",{className:"space-y-2",children:[e.series.length>1&&jsxRuntime.jsx("ul",{className:"list-none p-0 border-b border-border-default pb-2",children:e.series.slice(0,-1).map(h=>jsxRuntime.jsxs("li",{className:"py-0.5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("span",{className:"font-medium text-text-primary",children:[h.label,":"]}),jsxRuntime.jsx("span",{className:"text-text-secondary",children:d(h)})]}),h.category&&jsxRuntime.jsxs("div",{className:"mt-0.5 flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"h-3 w-3",style:{backgroundColor:h.categoryColor||h.color,borderRadius:"1px"}}),jsxRuntime.jsx("span",{className:"text-sm text-text-secondary",children:a?.[h.category]||h.category})]})]},h.label))}),(()=>{let h=e.series[e.series.length-1],y=e.eventItems?.length?e.eventItems:[{label:h.label,color:h.color,metadata:e.eventMetadata}];return jsxRuntime.jsx("div",{className:"space-y-2",children:y.map((v,S)=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"h-2 w-2 rounded-full",style:{backgroundColor:v.color}}),jsxRuntime.jsx("span",{className:"font-medium text-text-primary",children:v.label})]}),v.metadata&&Object.keys(v.metadata).length>0&&jsxRuntime.jsx("div",{className:"ml-4 mt-1 space-y-0.5 text-xs text-text-secondary",children:Object.entries(v.metadata).map(([w,N])=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("span",{className:"capitalize",children:[w,":"]}),jsxRuntime.jsx("span",{className:"font-medium",children:N})]},w))})]},`${v.label}-${S}`))})})()]}):jsxRuntime.jsx("ul",{className:"list-none p-0",children:e.series.map(h=>jsxRuntime.jsxs("li",{className:"py-0.5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("span",{className:"font-medium text-text-primary",children:[h.label,":"]}),jsxRuntime.jsx("span",{className:"text-text-secondary",children:d(h)})]}),h.category&&jsxRuntime.jsxs("div",{className:"mt-0.5 flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"h-3 w-3",style:{backgroundColor:h.categoryColor||h.color,borderRadius:"1px"}}),jsxRuntime.jsx("span",{className:"text-sm text-text-secondary",children:a?.[h.category]||h.category})]})]},h.label))})]})})};var e5={top:20,right:20,bottom:50,left:60},Py=({data:e,width:t,height:r,margin:o=e5,color:n,yFormatter:a={type:"number"},showGrid:i=true,showAxes:s=true,animate:c=true,barRadius:l=4,barPadding:d=.3,onBarClick:u,onBarHover:p,activeIndex:m,className:f,style:g,"aria-label":b="Category bar chart",orientation:x="vertical",showTooltip:h=true})=>{let[y,v]=He.useState(null),[S,w]=He.useState(null),[N,D]=He.useState(null),[R,A]=He.useState(t??600),[O,P]=He.useState(r??300),T=He.useRef(null),k=m??y,V=He.useId(),H=n||"var(--color-viz-default)";He.useEffect(()=>{if(t!==void 0&&r!==void 0){A(t),P(r);return}if(!T.current)return;let M=new ResizeObserver(E=>{for(let z of E)t===void 0&&A(z.contentRect.width),r===void 0&&P(z.contentRect.height);});return M.observe(T.current),t===void 0&&A(T.current.offsetWidth),r===void 0&&P(T.current.offsetHeight||300),()=>{M.disconnect();}},[t,r]);let{xScale:I,yScale:q,innerWidth:j,innerHeight:K}=He.useMemo(()=>{let M=R-o.left-o.right,E=O-o.top-o.bottom;if(x==="horizontal"){let B=d3Array.max(e,C=>C.value)||0;return {xScale:scale.scaleLinear({range:[0,M],domain:[0,B*1.1],nice:true}),yScale:scale.scaleBand({range:[0,E],domain:e.map(C=>C.label),padding:d}),innerWidth:M,innerHeight:E}}let z=d3Array.max(e,B=>B.value)||0;return {xScale:scale.scaleBand({range:[0,M],domain:e.map(B=>B.label),padding:d}),yScale:scale.scaleLinear({range:[E,0],domain:[0,z*1.1],nice:true}),innerWidth:M,innerHeight:E}},[e,R,O,o,d,x]);if(e.length===0)return jsxRuntime.jsx("div",{ref:T,className:tailwindMerge.twMerge("flex h-full min-h-[200px] w-full items-center justify-center rounded-lg border border-dashed border-border-default bg-background-surface text-sm font-medium text-text-secondary",f),style:r!==void 0?{height:r,...g}:g,children:"No data available"});let Y=(M,E)=>{if(v(M),p?.(E,M),M!==null&&E){let z,B;if(x==="horizontal"){let W=I(E.value),G=q(E.label)||0,F=q.bandwidth();z=o.left+W,B=o.top+G+F/2;}else {let W=I,G=q,F=W(E.label)??0,Z=W.bandwidth(),_=G(E.value);z=o.left+F+Z/2,B=o.top+_;}let C=z>R/2;D(E.label),w({xValue:new Date,series:[{label:"Value",value:E.value,color:E.color||H}],x:z,y:B,position:C?"left":"right"});}else w(null),D(null);};return jsxRuntime.jsxs("div",{ref:T,className:tailwindMerge.twMerge("relative h-full w-full overflow-hidden rounded-lg bg-background-surface",f),style:r!==void 0?{height:r,...g}:g,"aria-label":b,role:"img",children:[jsxRuntime.jsxs("svg",{width:R,height:O,children:[jsxRuntime.jsx("defs",{children:jsxRuntime.jsx(gradient.LinearGradient,{id:`${V}-bar`,from:H,to:H,toOpacity:.85})}),jsxRuntime.jsxs(gs,{left:o.left,top:o.top,children:[i&&jsxRuntime.jsx("g",{className:"grid-lines",children:(x==="horizontal"?I.ticks(5):q.ticks(5)).map(M=>{let E=x==="horizontal"?0:q(M),z=x==="horizontal"?I(M):0;return jsxRuntime.jsx("line",{x1:x==="horizontal"?z:0,y1:x==="horizontal"?0:E,x2:x==="horizontal"?z:j,y2:x==="horizontal"?K:E,stroke:"var(--color-border-default)",strokeOpacity:.5,strokeDasharray:"2,3"},M)})}),e.map((M,E)=>{let z=k===E||k==null,B=M.color||`url(#${V}-bar)`;if(x==="horizontal"){let L=I(M.value),oe=q.bandwidth(),ie=q(M.label)||0;return jsxRuntime.jsx(framerMotion.motion.rect,{x:0,y:ie,width:L,height:oe,fill:B,rx:l,ry:l,initial:c?{width:0,opacity:.5}:void 0,animate:{width:L,opacity:z?1:.5},transition:{duration:.5,delay:E*.05,ease:"easeOut",opacity:{duration:.15,delay:0}},style:{cursor:u||p?"pointer":"default"},onMouseEnter:()=>Y(E,M),onMouseLeave:()=>Y(null,null),onClick:()=>u?.(M,E)},M.label)}let C=I,W=q,G=C.bandwidth(),F=C(M.label)??0,Z=W(M.value),_=Math.max(0,K-Z);return c?jsxRuntime.jsx(framerMotion.motion.rect,{x:F,width:G,fill:B,rx:l,ry:l,initial:{y:K,height:0,opacity:.5},animate:{y:Z,height:_,opacity:z?1:.5},transition:{duration:.5,delay:E*.05,ease:"easeOut",opacity:{duration:.15,delay:0}},style:{cursor:u||p?"pointer":"default"},onMouseEnter:()=>Y(E,M),onMouseLeave:()=>Y(null,null),onClick:()=>u?.(M,E)},M.label):jsxRuntime.jsx("rect",{x:F,y:Z,width:G,height:_,fill:B,rx:l,ry:l,opacity:z?1:.5,style:{cursor:u||p?"pointer":"default",transition:"opacity 150ms ease-out"},onMouseEnter:()=>Y(E,M),onMouseLeave:()=>Y(null,null),onClick:()=>u?.(M,E)},M.label)}),s&&x==="vertical"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Hr.CategoryBottom,{top:K,scale:I}),jsxRuntime.jsx(Hr.Left,{left:0,scale:q,yFormatter:a,height:K})]}),s&&x==="horizontal"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Hr.NumericBottom,{top:K,scale:I,yFormatter:a,width:j}),jsxRuntime.jsx(Hr.CategoryLeft,{left:0,scale:q})]})]})]}),h&&jsxRuntime.jsx(gn,{data:S,formatter:a,label:N??void 0})]})};var Ry=({item:e,onToggle:t})=>{let r=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"h-3 w-3 shrink-0",style:{backgroundColor:e.fill,borderRadius:"1px",opacity:e.isHidden?.35:1}}),jsxRuntime.jsx("span",{className:`text-sm whitespace-nowrap ${e.isHidden?"text-text-disabled line-through":"text-text-secondary"}`,children:e.category})]});return t?jsxRuntime.jsx("button",{type:"button",className:"flex items-center gap-2 shrink-0 rounded-sm focus:outline-none focus:ring-2 focus:ring-border-focus disabled:cursor-not-allowed disabled:opacity-60","aria-pressed":!e.isHidden,"aria-label":`${e.isHidden?"Show":"Hide"} ${e.category}`,disabled:e.isDisabled,onClick:()=>t(e.category),children:r}):jsxRuntime.jsx("div",{className:"flex items-center gap-2 shrink-0",children:r})},o5=({items:e,onToggle:t})=>e.length===0?null:jsxRuntime.jsx("div",{className:"flex items-center gap-3 flex-wrap",children:e.map(r=>jsxRuntime.jsx(Ry,{item:r,onToggle:t},r.category))}),pi=({items:e,onExport:t,marginLeft:r=0,marginRight:o=0,isZoomed:n=false,onResetZoom:a,onLegendItemToggle:i})=>{let[s,c]=He__namespace.default.useState(false),[l,d]=He__namespace.default.useState(null),[u,p]=He__namespace.default.useState(false),[m,f]=He__namespace.default.useState(false),g=He__namespace.default.useCallback(async x=>{c(true),d(x),f(false);try{await t(x);}catch(h){console.error("Export failed:",h);}finally{c(false),d(null);}},[t]),b=He__namespace.default.useCallback(async x=>{await g(x);},[g]);return jsxRuntime.jsxs("div",{className:"mt-4 flex items-center justify-between gap-3 min-h-[32px]",style:{marginLeft:r,marginRight:o},children:[jsxRuntime.jsx("div",{className:"hidden sm:block flex-1 min-w-0",children:jsxRuntime.jsx(o5,{items:e,onToggle:i})}),jsxRuntime.jsx("div",{className:"sm:hidden flex items-center gap-3",children:e.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{onClick:()=>p(true),className:"text-sm text-text-secondary hover:text-text-primary transition-colors underline decoration-dotted underline-offset-4",children:"Legend"}),jsxRuntime.jsx(ct,{isOpen:u,onClose:()=>p(false),title:"Legend",children:jsxRuntime.jsx("div",{className:"grid grid-cols-1 gap-3 p-4",children:e.map(x=>jsxRuntime.jsx(Ry,{item:x,onToggle:i},x.category))})})]})}),jsxRuntime.jsxs("div",{className:"sm:hidden flex items-center gap-2 shrink-0",children:[n&&a&&jsxRuntime.jsx(re,{variant:"secondary",size:"sm",onPress:a,children:jsxRuntime.jsx(U,{name:"ArrowsOut",size:16})}),jsxRuntime.jsx(re,{variant:"secondary",size:"sm",onPress:()=>f(true),isDisabled:s,children:jsxRuntime.jsx(U,{name:"Export",size:16})}),jsxRuntime.jsx(ct,{isOpen:m,onClose:()=>f(false),title:"Export Chart",contentPadding:false,children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsxs("button",{onClick:()=>g("csv"),disabled:s,className:"flex items-center gap-3 px-6 py-4 text-left hover:bg-background-hover active:bg-background-muted transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[jsxRuntime.jsx(U,{name:"List",size:20,className:"text-text-secondary"}),jsxRuntime.jsx("span",{className:"text-sm text-text-primary",children:l==="csv"?"Exporting...":"Export as CSV"})]}),jsxRuntime.jsxs("button",{onClick:()=>g("svg"),disabled:s,className:"flex items-center gap-3 px-6 py-4 text-left hover:bg-background-hover active:bg-background-muted transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[jsxRuntime.jsx(U,{name:"Code",size:20,className:"text-text-secondary"}),jsxRuntime.jsx("span",{className:"text-sm text-text-primary",children:l==="svg"?"Exporting...":"Export as SVG"})]}),jsxRuntime.jsxs("button",{onClick:()=>g("png"),disabled:s,className:"flex items-center gap-3 px-6 py-4 text-left hover:bg-background-hover active:bg-background-muted transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[jsxRuntime.jsx(U,{name:"DownloadSimple",size:20,className:"text-text-secondary"}),jsxRuntime.jsx("span",{className:"text-sm text-text-primary",children:l==="png"?"Exporting...":"Export as PNG"})]})]})})]}),jsxRuntime.jsxs("div",{className:"hidden sm:flex items-center gap-2 shrink-0",children:[n&&a&&jsxRuntime.jsxs(re,{variant:"secondary",size:"sm",onPress:a,children:[jsxRuntime.jsx(U,{name:"ArrowsOut",size:16}),jsxRuntime.jsx("span",{className:"hidden sm:inline",children:"Reset Zoom"})]}),jsxRuntime.jsxs(reactAriaComponents.DialogTrigger,{children:[jsxRuntime.jsxs(re,{variant:"secondary",size:"sm",isDisabled:s,children:[jsxRuntime.jsx(U,{name:"Export",size:16}),s?"Exporting...":"Export"]}),jsxRuntime.jsx(lt,{placement:"top end",className:"min-w-48 p-1 bg-background-surface rounded-lg shadow-xl ring-1 ring-border-default",children:jsxRuntime.jsxs(reactAriaComponents.Menu,{onAction:b,className:"outline-none",children:[jsxRuntime.jsx(reactAriaComponents.MenuItem,{id:"csv",className:"flex items-center gap-2 px-3 py-2 text-sm text-text-primary rounded cursor-pointer hover:bg-background-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus focus-visible:ring-offset-1 focus-visible:ring-offset-background-surface data-[focused]:bg-background-hover data-[focused]:ring-2 data-[focused]:ring-border-focus data-[focused]:ring-offset-1 data-[focused]:ring-offset-background-surface",isDisabled:s,children:jsxRuntime.jsxs("span",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(U,{name:"List",size:14}),l==="csv"?"Exporting...":"Export as CSV"]})}),jsxRuntime.jsx(reactAriaComponents.MenuItem,{id:"svg",className:"flex items-center gap-2 px-3 py-2 text-sm text-text-primary rounded cursor-pointer hover:bg-background-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus focus-visible:ring-offset-1 focus-visible:ring-offset-background-surface data-[focused]:bg-background-hover data-[focused]:ring-2 data-[focused]:ring-border-focus data-[focused]:ring-offset-1 data-[focused]:ring-offset-background-surface",isDisabled:s,children:jsxRuntime.jsxs("span",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(U,{name:"Code",size:14}),l==="svg"?"Exporting...":"Export as SVG"]})}),jsxRuntime.jsx(reactAriaComponents.MenuItem,{id:"png",className:"flex items-center gap-2 px-3 py-2 text-sm text-text-primary rounded cursor-pointer hover:bg-background-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus focus-visible:ring-offset-1 focus-visible:ring-offset-background-surface data-[focused]:bg-background-hover data-[focused]:ring-2 data-[focused]:ring-border-focus data-[focused]:ring-offset-1 data-[focused]:ring-offset-background-surface",isDisabled:s,children:jsxRuntime.jsxs("span",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(U,{name:"DownloadSimple",size:14}),l==="png"?"Exporting...":"Export as PNG"]})})]})})]})]})]})};var Um=({data:e,seriesMetadata:t,width:r,height:o,onBrushChange:n,brushRegion:a,margin:i=Ie,yDomain:s})=>{let c=He.useRef(null),l=He.useRef(false),d=He.useMemo(()=>e.flat(),[e]),u=He.useMemo(()=>({top:10,bottom:15,left:i.left,right:i.right}),[i]),p=r-u.left-u.right,m=He.useMemo(()=>{if(d.length===0)return scale.scaleTime({domain:[new Date,new Date],range:[0,p]});let h=new Date(Math.min(...d.map(v=>v.xValue.getTime()))),y=new Date(Math.max(...d.map(v=>v.xValue.getTime())));return scale.scaleTime({domain:[h,y],range:[0,p]})},[d,p]),f=He.useMemo(()=>{let h=d.length>0?Math.max(0,...d.map(y=>y.yValue)):1;return scale.scaleLinear({domain:s??[0,h],range:[o-u.bottom,u.top]})},[d,o,s,u.top,u.bottom]),g=h=>{if(l.current)return;if(!h){n(null);return}let{x0:y,x1:v}=h;if(y===v)return;let S=new Date(y),w=new Date(v);if(!(Number.isNaN(S.getTime())||Number.isNaN(w.getTime()))){if(d.length>0){let N=Math.min(...d.map(P=>P.xValue.getTime())),D=Math.max(...d.map(P=>P.xValue.getTime())),A=(D-N)*.05;if(Math.abs(S.getTime()-N)<A&&Math.abs(w.getTime()-D)<A){n(null);return}}n([S,w]);}},b=He.useMemo(()=>{if(d.length!==0)return {start:{x:0,y:u.top},end:{x:p,y:o-u.bottom}}},[p,o,d]);He.useEffect(()=>{if(!c.current||d.length===0)return;let h=c.current.state;if(h?.isBrushing||h?.activeHandle)return;let y=Math.min(...d.map(R=>R.xValue.getTime())),v=Math.max(...d.map(R=>R.xValue.getTime())),S=a?a[0]:new Date(y),w=a?a[1]:new Date(v),N=c.current.state?.extent;if(N){let R=m.invert(N.x0),A=m.invert(N.x1),O=Math.abs(R.getTime()-S.getTime()),P=Math.abs(A.getTime()-w.getTime());if(O<1e3&&P<1e3)return}l.current=true;let D=R=>{let A=c.current.getExtent({x:m(S),y:u.top},{x:m(w),y:o-u.bottom});return {...R,start:{y:A.y0,x:A.x0},end:{y:A.y1,x:A.x1},extent:A}};c.current.updateBrush(D),setTimeout(()=>{l.current=false;},50);},[a,m,o,d]);let x={fill:"url(#brush_pattern)",fillOpacity:.15,stroke:"var(--color-border-focus)",strokeWidth:1.5,strokeOpacity:.3};return jsxRuntime.jsx("div",{className:"mt-2",children:jsxRuntime.jsxs("svg",{width:r,height:o,children:[jsxRuntime.jsx(pattern.PatternLines,{id:"brush_pattern",height:8,width:8,stroke:"var(--color-text-secondary)",strokeWidth:1,orientation:["diagonal"]}),jsxRuntime.jsxs("g",{transform:`translate(${u.left}, 0)`,children:[e.map((h,y)=>jsxRuntime.jsx(shape.LinePath,{data:h,x:v=>m(v.xValue),y:v=>f(v.yValue),stroke:t[y]?.color||"var(--color-gray-500)",strokeWidth:1.5,opacity:.8},`brush-series-${y}`)),jsxRuntime.jsx(brush.Brush,{xScale:m,yScale:f,width:p,height:o-u.top-u.bottom,margin:{top:u.top,bottom:u.bottom,left:0,right:0},handleSize:8,innerRef:c,resizeTriggerAreas:["left","right"],brushDirection:"horizontal",initialBrushPosition:b,onChange:g,onClick:()=>n(null),selectedBoxStyle:x,useWindowMoveEvents:true})]})]})})};function Bo(e){switch(e){case "command":return Pt("--color-action-brand","#111111");case "success":return Pt("--color-feedback-success-border","#278a4a");case "warning":return Pt("--color-feedback-warning-border","#c88420");case "error":return Pt("--color-feedback-error-border","#c42d2d");case "alert":return Pt("--color-feedback-warning-border","#c88420");default:return Pt("--color-text-secondary","#525250")}}function Bc({events:e,color:t,showLabels:r=false}){let o=He.useContext(zr),[n,a]=He.useState(null);if(!o)return console.warn("ChartEventMarkers must be used within a ChartContainer"),null;let{xScale:i,yScale:s,height:c,tooltip:l,datasets:d,seriesMetadata:u,seriesTypes:p,categoryColors:m}=o,f=e.filter(x=>{let h=i(x.timestamp);return h>=Ie.left&&h<=i.range()[1]}),g=He.useCallback((x,h)=>{a(h);let y=i(x.timestamp),v=y>(i.range()[1]-Ie.right-Ie.left)/2+Ie.left,S=[];d&&u&&d.forEach((D,R)=>{if(D.length===0)return;let A=d3Array.bisector(V=>V.xValue).left,O=A(D,x.timestamp),P=D[O-1],T=D[O],k;if(!P)k=T;else if(!T)k=P;else {let V=Math.abs(x.timestamp.getTime()-P.xValue.getTime()),H=Math.abs(x.timestamp.getTime()-T.xValue.getTime());k=V<H?P:T;}k&&u[R]&&S.push({label:u[R].label,value:k.yValue,color:u[R].color,type:p?.[R]||"line",...k.category&&{category:k.category,categoryColor:m?.[k.category]}});});let N=f.filter(D=>Math.abs(i(D.timestamp)-y)<=10).map(D=>({label:D.label,color:t||Bo(D.type),metadata:D.metadata}));S.push({label:N.length>1?`${N.length} events`:x.label,value:0,color:t||Bo(x.type),type:"event"}),l.show({xValue:x.timestamp,series:S,x:y,y:S.length>1&&typeof S[0].value=="number"?s(S[0].value):c/2,position:v?"left":"right",isEvent:true,eventMetadata:x.metadata,eventItems:N});},[i,s,c,l,t,d,u,p,m,f]),b=He.useCallback(()=>{a(null),l.hide();},[l]);return f.length===0?null:jsxRuntime.jsx("g",{className:"chart-event-markers","data-testid":"chart-event-markers",children:f.map((x,h)=>{let y=i(x.timestamp),v=t||Bo(x.type),S=n===h;return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("line",{x1:y,y1:Ie.top,x2:y,y2:c-Ie.bottom,stroke:v,strokeWidth:S?3:2,strokeDasharray:"4 4",strokeOpacity:S?.9:.6,pointerEvents:"none"}),jsxRuntime.jsx("circle",{cx:y,cy:Ie.top,r:S?5:4,fill:v,stroke:"var(--color-background-surface)",strokeWidth:2,pointerEvents:"none"}),jsxRuntime.jsx("circle",{cx:y,cy:c-Ie.bottom,r:S?5:4,fill:v,stroke:"var(--color-background-surface)",strokeWidth:2,pointerEvents:"none"}),r&&jsxRuntime.jsx("text",{x:y,y:Ie.top-8,textAnchor:"middle",fill:"var(--color-text-secondary)",fontSize:11,fontWeight:500,pointerEvents:"none",children:x.label}),jsxRuntime.jsx("rect",{x:y-10,y:Ie.top,width:20,height:c-Ie.top-Ie.bottom,fill:"transparent",style:{cursor:"pointer"},onMouseEnter:()=>g(x,h),onMouseLeave:b})]},`${x.timestamp.getTime()}-${h}`)})})}function Vc({spans:e,opacity:t=.25,color:r}){let o=He.useContext(zr),[n,a]=He.useState(null),i=o?.xScale,s=o?.height,c=o?.tooltip,[l,d]=i?.domain()??[new Date(0),new Date(0)],[u,p]=i?.range()??[0,0],m=He.useCallback((S,w)=>{if(!i||!c)return;a(w);let N=S.start<l?l:S.start,D=S.end>d?d:S.end,R=(i(N)+i(D))/2,A=R>(p-u)/2+u,P=e.filter(T=>T.end>T.start&&T.start<S.end&&T.end>S.start).map(T=>({label:T.label,color:T.color??r??Bo(T.type),metadata:T.metadata}));c.show({xValue:S.start,series:[{label:P.length>1?`${P.length} scheduled commands`:S.label,value:0,color:S.color??r??Bo(S.type),type:"event"}],x:R,y:(s??0)/2,position:A?"left":"right",isEvent:true,eventMetadata:S.metadata,eventItems:P});},[i,s,c,r,l,d,u,p,e]),f=He.useCallback(()=>{a(null),c?.hide();},[c]);if(!o)return console.warn("ChartEventSpans must be used within a ChartContainer"),null;let{xScale:g,height:b}=o,x=Ie.top,y=b-Ie.bottom-x,v=e.filter(S=>S.end>S.start);return v.length===0?null:jsxRuntime.jsx("g",{className:"chart-event-spans","data-testid":"chart-event-spans",children:v.map((S,w)=>{let N=S.start<l?l:S.start,D=S.end>d?d:S.end;if(N>=d||D<=l)return null;let R=g(N),O=g(D)-R;if(O<=0)return null;let P=S.color??r??Bo(S.type);return jsxRuntime.jsx("rect",{x:R,y:x,width:O,height:y,fill:P,fillOpacity:n===w?Math.min((t??.25)*1.8,1):t??.25,pointerEvents:"all",style:{cursor:"pointer"},onMouseEnter:()=>m(S,w),onMouseLeave:f},`${S.start.getTime()}-${S.end.getTime()}-${w}`)})})}var ra=({data:e,color:t="var(--color-viz-default)",strokeWidth:r=3,strokeDasharray:o,categoryColors:n={},maxGapMs:a,animate:i=true})=>{let{xScale:s,yScale:c,animationSettings:l}=ta(),d=c.range(),u=Object.keys(n).length>0,p=h=>h.category?n[h.category]??t:t,m=h=>h.chartYValue??h.yValue,f=e.length===1?e[0]:void 0,g=a!=null?bc(e,a):e,b=f?jsxRuntime.jsx("circle",{cx:s(f.xValue),cy:c(m(f)),r,fill:u?p(f):t}):u?e.slice(0,-1).map((h,y)=>{let v=e[y+1];return a!=null&&a>0&&v.xValue.getTime()-h.xValue.getTime()>a?null:jsxRuntime.jsx(shape.LinePath,{data:[h,v],x:S=>s(S.xValue),y:S=>c(m(S)),stroke:p(h),strokeWidth:r,strokeDasharray:o,strokeLinecap:"round",curve:curve.curveLinear},`${h.xValue.getTime()}-${v.xValue.getTime()}`)}):jsxRuntime.jsx(shape.LinePath,{data:g,x:h=>h?s(h.xValue):0,y:h=>h?c(m(h)):0,defined:h=>h!=null,stroke:t,strokeWidth:r,strokeDasharray:o,strokeLinecap:"round",curve:curve.curveLinear}),x={transformOrigin:`0 ${d[0]}px`,transformBox:"fill-box",isolation:"isolate"};return i?jsxRuntime.jsx(framerMotion.motion.g,{initial:{scaleY:0},animate:{scaleY:1},transition:{duration:l.duration,ease:l.ease},style:x,children:b}):jsxRuntime.jsx("g",{style:x,children:b})};var Wy=e=>e.type===fn||e.type===ra||e.type===hc,C5=e=>e.type===Bc||e.type===Vc,S5=(e,t,r)=>{if(!e.tooltipRange||e.baseline===void 0)return;let o=typeof e.baseline=="function"?e.baseline(t,r):e.baseline;return typeof o=="number"&&Number.isFinite(o)&&o!==t.yValue?o:void 0},w5=d3Array.bisector(e=>e.xValue).left,T5=()=>jsxRuntime.jsx("div",{className:"flex h-full items-center justify-center",children:jsxRuntime.jsx("p",{className:"text-text-secondary",children:"No data available"})}),N5=()=>jsxRuntime.jsxs("div",{className:"flex h-full flex-col gap-4 p-4",children:[jsxRuntime.jsx(J,{className:"h-full w-full"}),jsxRuntime.jsxs("div",{className:"flex gap-4",children:[jsxRuntime.jsx(J,{className:"h-4 w-24"}),jsxRuntime.jsx(J,{className:"h-4 w-24"})]})]}),k5=({parentWidth:e,parentHeight:t,yFormatter:r={type:"number"},yDomain:o,referenceLines:n,isLoading:a=false,enableZoom:i=false,enableBrush:s=false,brushHeight:c=60,onZoomChange:l,zoomDomain:d,hiddenSeriesLabels:u,onHiddenSeriesChange:p,children:m})=>{let f=u!==void 0,g=d!==void 0,[b,x]=He.useState(null),[h,y]=He.useState(null),v=g?d:h,[S,w]=He.useState(()=>new Set),N=f?u:S,D=He.useRef(null),R=He.useRef(0),A=He.useRef(""),O=He.useRef(null),{colorMode:P}=Ht(),T=He.useMemo(()=>Bn(),[P]),k=He.useMemo(()=>ji(),[P]),{datasets:V,seriesMetadata:H,categoryInfo:I,categoryColors:q,categoryLabels:j,seriesTypes:K}=He.useMemo(()=>{let ue=He.Children.toArray(m).filter(De=>He.isValidElement(De)&&Wy(De)),Fe=ue.filter(De=>De.props.data).length,Ne=[],Oe=[],ot=[],ft=null,Le=null;ue.forEach((De,wt)=>{let Ae=De.props;if(!Ae.data)return;Ne.push(Ae.data);let za=("color"in Ae&&Ae.color?Ae.color:void 0)||(Fe===1?k:T[wt%T.length]),An=De.type===fn;Oe.push({label:"label"in Ae&&Ae.label||`Series ${Ne.length}`,color:za,...An&&"baseline"in Ae&&Ae.baseline!==void 0?{baseline:Ae.baseline,tooltipRange:"tooltipRange"in Ae&&Ae.tooltipRange||false}:{}});let xu=An?"area":De.type===ra?"line":"bar";ot.push(xu),"categoryColors"in Ae&&Ae.categoryColors&&(ft=Ae.categoryColors),"categoryLabels"in Ae&&Ae.categoryLabels&&(Le=Ae.categoryLabels);});let gt=null;if(ft){let De=new Set;Ne.forEach(wt=>{wt.forEach(Ae=>{Ae.category&&De.add(Ae.category);});}),gt=Array.from(De).map(wt=>({label:Le?.[wt]||wt,color:ft[wt]||"#6b7280"}));}return {datasets:Ne,seriesMetadata:Oe,categoryInfo:gt,categoryColors:ft,categoryLabels:Le,seriesTypes:ot}},[m,k,T,P]),Y=e,M=s?c+8:0,E=t-60-M,z=Math.max(100,E),B=He.useCallback($=>$?N.has($):false,[N]),C=He.useMemo(()=>H.map(($,ue)=>B($.label)?null:ue).filter($=>$!==null),[H,B]),W=He.useMemo(()=>C.map($=>V[$]).filter($=>!!$),[V,C]),G=He.useMemo(()=>C.map($=>H[$]).filter($=>!!$),[H,C]),F=He.useMemo(()=>C.map($=>K[$]).filter($=>!!$),[K,C]),Z=F.findIndex($=>$==="bar"),_=Z!==-1,L=He.useCallback(($,ue)=>{let Fe=$.has(ue);if(!Fe&&H.reduce((ot,ft)=>$.has(ft.label)||ft.label===ue?ot:ot+1,0)<1)return $;let Ne=new Set($);return Fe?Ne.delete(ue):Ne.add(ue),Ne},[H]),oe=He.useCallback($=>{if(f){let ue=u;if(!ue.has($)&&H.reduce((Oe,ot)=>ue.has(ot.label)||ot.label===$?Oe:Oe+1,0)<1){x(null);return}p?.(Ne=>L(Ne,$));}else w(ue=>L(ue,$));x(null);},[f,u,p,H,L]),ie=He.useMemo(()=>H.map($=>$.label).join(""),[H]),ne=He.useRef(ie);He.useEffect(()=>{ne.current!==ie&&(ne.current=ie,f||w($=>$.size===0?$:new Set));},[ie,f]);let ae=He.useMemo(()=>W.flat(),[W]),ce=He.useMemo(()=>{if(ae.length===0)return null;let $=[...ae].sort((ue,Fe)=>ue.xValue.getTime()-Fe.xValue.getTime());return [$[0].xValue,$[$.length-1].xValue]},[ae]),te=v||ce,ye=He.useCallback($=>{g?l?.($):y($);},[g,l]),qe=He.useMemo(()=>te?V.map(ue=>ue.filter(Fe=>Fe.xValue>=te[0]&&Fe.xValue<=te[1])):V,[V,te]),It=He.useMemo(()=>C.map($=>qe[$]??[]),[C,qe]);He.useEffect(()=>{l&&l(v);},[v,l]);let de=He.useMemo(()=>C.flatMap($=>qe[$]??[]),[qe,C]),le=He.useMemo(()=>bs(de,z,r,o),[de,z,r,o]),me=He.useRef(JSON.stringify(r)),Q=He.useRef(null),X=He.useMemo(()=>{let[$,ue]=le.domain(),Fe=Math.max(Math.abs($),Math.abs(ue)),Ne=JSON.stringify(r);if(Ne!==me.current&&(me.current=Ne,Q.current=null),Q.current!==null)return Q.current;if(Fe===0)return li(r,0);let Oe=li(r,Fe);return Q.current=Oe,Oe},[le,r]),be=He.useMemo(()=>{let $=z-Ie.top-Ie.bottom;return di($)},[z]),ee=He.useMemo(()=>{let $=Qr(X),ue=$.tickFormat||$.format,Ne=le.ticks(be).map(ft=>ue(ft)),Oe=ci(Ne,12,"system-ui"),ot=Math.ceil(Oe)+12;return {...Ie,left:Math.max(ot,30)}},[le,X,be]),ve=He.useMemo(()=>te?scale.scaleTime({domain:te,range:[ee.left,Y-ee.right]}):Wm(ae,Y),[te,ae,Y,ee]),rt=He.useCallback($=>{if(!ce)return;let{scaleX:ue,translateX:Fe}=$,Ne=Y-ee.left-ee.right,[Oe,ot]=ce,ft=ot.getTime()-Oe.getTime();if(ft<=0){ye(null);return}let Le=-Fe,gt=Le+Ne,De=Ne*ue/ft,wt=Le/De,Ae=gt/De,Ln=new Date(Oe.getTime()+wt),za=new Date(Oe.getTime()+Ae),An=Math.abs(Ln.getTime()-Oe.getTime()),xu=Math.abs(za.getTime()-ot.getTime()),Ag=ft*.02;An<Ag&&xu<Ag?ye(null):ye([Ln,za]);},[ce,Y,ee,ye]),Ft=He.useCallback($=>{let{left:ue}=D.current?.getBoundingClientRect()||{left:0},Fe=$.clientX-ue;if($.timeStamp-(R.current||0)<16)return;R.current=$.timeStamp;let Ne=ve.invert(Fe),Oe=It.map((Le,gt)=>{if(!Le||Le.length===0)return null;let De=w5(Le,Ne,1);if(De===0)return {point:Le[0],index:0,datasetIndex:gt};if(De>=Le.length)return {point:Le[Le.length-1],index:Le.length-1,datasetIndex:gt};let wt=Le[De-1],Ae=Le[De];if(!wt||!Ae)return null;let Ln=Math.abs(wt.xValue.getTime()-Ne.getTime()),za=Math.abs(Ae.xValue.getTime()-Ne.getTime()),An=Ln<za;return {point:An?wt:Ae,index:An?De-1:De,datasetIndex:gt}}).filter(Le=>Le!==null&&G[Le.datasetIndex]!==void 0).map(({point:Le,index:gt,datasetIndex:De})=>({label:G[De].label,value:Le.yValue,baselineValue:S5(G[De],Le,gt),color:G[De].color,point:Le,type:F[De]}));if(Oe.length===0){x(null);return}let ot=ve(Oe[0].point.xValue),ft=ot>(Y-ee.right-ee.left)/2+ee.left;x({xValue:Oe[0].point.xValue,series:Oe.map(({label:Le,value:gt,baselineValue:De,color:wt,point:Ae,type:Ln})=>({label:Le,value:gt,...De!==void 0?{baselineValue:De}:{},chartY:Ae.chartYValue??gt,showMarker:Ae.showTooltipMarker??true,color:wt,type:Ln,category:Ae.category,categoryColor:Ae.category&&q?q[Ae.category]:void 0})),x:ot,y:le(Oe[0].point.chartYValue??Oe[0].value),position:ft?"left":"right"});},[It,G,F,ve,le,Y,q,ee]),Ui=()=>{x(null);},En=He.useCallback(()=>{ye(null),O.current&&O.current.reset();},[ye]),Yt=He.useCallback($=>{if(!(O.current&&ce))return;let[ue,Fe]=ce,Ne=Fe.getTime()-ue.getTime();if(Ne<=0){O.current.reset();return}if(!$){O.current.reset();return}let[Oe,ot]=$,ft=ot.getTime()-Oe.getTime();if(ft<=0){O.current.reset();return}let Le=Ne/ft,gt=Y-ee.left-ee.right,wt=-((Oe.getTime()-ue.getTime())/Ne)*gt*Le;O.current.setTransformMatrix({scaleX:Le,scaleY:1,translateX:wt,translateY:0,skewX:0,skewY:0});},[ce,Y,ee]),gu=He.useCallback($=>{ye($),Yt($);},[ye,Yt]);He.useEffect(()=>{g&&Yt(d??null);},[g,d,Yt]);let bu={width:Y,height:z,xScale:ve,yScale:le,yFormatter:X,animationSettings:gc,tooltip:{data:b,show:x,hide:()=>x(null)},datasets:It,seriesMetadata:G,seriesTypes:F,categoryColors:q||void 0,categoryLabels:j||void 0},U1=He.Children.toArray(m),Dg=0,ml=[],Eg=[];U1.forEach($=>{if(!He.isValidElement($)){ml.push($);return}if(C5($))Eg.push($);else if(Wy($)){let ue=Dg;Dg++;let Fe=$.props,Ne=H[ue]?.label;if(B(Ne))return;ml.push(He__namespace.default.cloneElement($,{...Fe,data:qe[ue]||Fe.data,color:H[ue]?.color}));}else ml.push($);});let Y1=C.length,K1=(I||H).map($=>{let ue=!I&&B($.label);return {category:$.label,fill:$.color,isHidden:ue,isDisabled:!I&&!ue&&Y1<=1}}),q1=typeof r=="object"&&r!==null&&typeof r.type=="string",j1=Tl({datasets:W,metadata:{xLabel:"Date",yLabel:"Value",seriesLabels:G.map($=>$.label),timestamp:true,...q1?{yFormat:r}:{}},svgRef:D});if(a)return jsxRuntime.jsx(N5,{});if(V.length===0)return jsxRuntime.jsx(T5,{});let Lg=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("title",{children:"Data chart visualization"}),jsxRuntime.jsx("g",{children:le.ticks(be).map($=>{let ue=Math.abs($)<Number.EPSILON;return jsxRuntime.jsx(shape.Line,{from:{x:ee.left,y:le($)},to:{x:Y-ee.right,y:le($)},stroke:ue?"var(--color-border-default)":"var(--color-border-muted)",strokeWidth:ue?1.5:1},`grid-line-${$}`)})}),ml,n&&n.length>0&&jsxRuntime.jsx("g",{children:n.map($=>{let ue=le($.value),Fe=$.color??"var(--color-error-base)";return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx(shape.Line,{from:{x:ee.left,y:ue},to:{x:Y-ee.right,y:ue},stroke:Fe,strokeWidth:1.5,strokeDasharray:"6 4"}),$.label&&jsxRuntime.jsx("text",{x:Y-ee.right-4,y:ue-4,textAnchor:"end",fontSize:11,fill:Fe,children:$.label})]},`ref-line-${$.value}`)})}),jsxRuntime.jsx(Hr.Bottom,{top:z-ee.bottom,scale:ve,width:Y-ee.left-ee.right}),jsxRuntime.jsx(Hr.Left,{left:ee.left,scale:le,yFormatter:X,height:z-ee.top-ee.bottom}),b&&!b.isEvent&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[_?(()=>{let $=W[Z]??[];if($.length===0)return null;let ue=[...$].sort((De,wt)=>De.xValue.getTime()-wt.xValue.getTime()),Fe=ue.findIndex(De=>De.xValue.getTime()===b.xValue.getTime()),Ne=ue[Fe+1],Oe=ue.length>1&&Ne?Ne.xValue.getTime()-b.xValue.getTime():15*6e4,ot=Math.abs(ve(new Date(b.xValue.getTime()+Oe))-ve(b.xValue)),Le=ve(b.xValue)-ot/2,gt=le.range();return jsxRuntime.jsx("rect",{x:Le,y:gt[1],width:ot,height:gt[0]-gt[1],className:"fill-background-muted",opacity:.5,pointerEvents:"none",style:{transition:"all 100ms ease-out"}})})():null,b.series.filter($=>$.type!=="bar"&&$.showMarker!==false).map($=>jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("circle",{cx:ve(b.xValue),cy:le($.chartY??$.value),r:8,fill:"white",stroke:$.color,strokeWidth:2,style:{transition:"all 100ms ease-out"}}),jsxRuntime.jsx("circle",{cx:ve(b.xValue),cy:le($.chartY??$.value),r:4,fill:$.color,style:{transition:"all 100ms ease-out"}})]},`highlight-${$.label}`))]}),jsxRuntime.jsx("rect",{x:ee.left,y:ee.top,width:Y-ee.left-ee.right,height:z-ee.top-ee.bottom,fill:"transparent",style:{cursor:i?"grab":"crosshair",touchAction:"none"},onMouseMove:Ft,onMouseLeave:Ui}),Eg]});return jsxRuntime.jsx("div",{className:"relative flex h-full flex-col",children:jsxRuntime.jsxs(zr.Provider,{value:bu,children:[i?jsxRuntime.jsx(zoom.Zoom,{width:Y,height:z,scaleXMin:1,scaleXMax:20,scaleYMin:1,scaleYMax:1,constrain:$=>{let{scaleX:ue,translateX:Fe}=$,Ne=Math.max(1,Math.min(20,ue)),Oe=1,ot=Y-ee.left-ee.right,ft=0,Le=ot*(1-Ne),gt=Math.max(Le,Math.min(ft,Fe));return {...$,scaleX:Ne,scaleY:Oe,translateX:gt,translateY:0}},children:$=>{if(O.current=$,$.transformMatrix){let{scaleX:ue,translateX:Fe}=$.transformMatrix,Ne=`${ue.toFixed(4)}-${Fe.toFixed(2)}`;Ne!==A.current&&(A.current=Ne,setTimeout(()=>{rt($.transformMatrix);},0));}return jsxRuntime.jsx("svg",{width:Y,height:z,className:"overflow-visible",ref:ue=>{D.current=ue,$.containerRef.current!==ue&&($.containerRef.current=ue);},role:"img","aria-label":"Data chart",style:{cursor:$.isDragging?"grabbing":"grab",touchAction:"none"},onMouseDown:$.dragStart,onMouseMove:$.dragMove,onMouseUp:$.dragEnd,onMouseLeave:()=>{$.isDragging&&$.dragEnd();},onTouchStart:$.dragStart,onTouchMove:$.dragMove,onTouchEnd:$.dragEnd,children:Lg})}}):jsxRuntime.jsx("svg",{width:Y,height:z,className:"overflow-visible",ref:D,role:"img","aria-label":"Data chart",children:Lg}),jsxRuntime.jsx(gn,{data:b,formatter:X}),s&&ce&&jsxRuntime.jsx(Um,{data:W,seriesMetadata:G,width:Y,height:c,onBrushChange:gu,brushRegion:v,margin:ee,...o?{yDomain:o}:{}}),jsxRuntime.jsx(pi,{onExport:j1,items:K1,marginLeft:0,marginRight:ee.right,isZoomed:v!==null,onResetZoom:En,onLegendItemToggle:I?void 0:oe})]})})},Uy=responsive.withParentSize(k5);var L5=e=>e.toLocaleString(),A5=e=>`${Math.round(e*100)}%`,jy=({data:e,width:t=800,height:r=400,padding:o=0,barGap:n=30,formatValue:a=L5,formatPercentage:i=A5,color:s,showScale:c=true,showOverallConversion:l=true,overallConversionLabel:d="Overall Conversion:",activeStageId:u,onStageClick:p,onStageHover:m,className:f,style:g,"aria-label":b="Funnel chart"})=>{let[x,h]=He.useState(null),[y,v]=He.useState(t),S=He.useRef(null),w=u??x,N=He.useId(),D=s||"var(--color-viz-default)";He.useEffect(()=>{if(!S.current)return;let k=new ResizeObserver(V=>{for(let H of V)v(H.contentRect.width);});return k.observe(S.current),()=>{k.disconnect();}},[]);let{layout:R,overallConversion:A}=He.useMemo(()=>{if(e.length===0)return {layout:[],overallConversion:0};let k=e[0].value,V=l?60:0,H=r-o*2-V,I=(e.length-1)*n,q=(H-I)/e.length,j=e.map((Y,M)=>{let E=o+V+M*(q+n),z=k===0?0:Y.value/k,B=z,C=M===0?null:e[M-1].value,W=C==null||C===0?0:1-Y.value/C;return {stage:Y,index:M,y:E,barHeight:q,widthPercent:z,conversionRate:B,dropOff:W}}),K=k===0?0:e[e.length-1].value/k;return {layout:j,overallConversion:K,maxValue:k}},[e,y,r,o,n,c,l]);if(e.length===0)return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex h-full min-h-[280px] w-full items-center justify-center rounded-lg border border-dashed border-border-default bg-background-surface text-sm font-medium text-text-secondary",f),style:{width:t,height:r,...g},children:"No funnel data available"});let O=c?60:0,P=o+O,T=y-o*2-O;return jsxRuntime.jsx("div",{ref:S,className:tailwindMerge.twMerge("relative w-full overflow-hidden rounded-lg bg-background-surface",f),style:{height:r,...g},"aria-label":b,role:"img",children:jsxRuntime.jsxs("svg",{width:"100%",height:r,className:"relative",children:[jsxRuntime.jsxs("defs",{children:[jsxRuntime.jsx(gradient.LinearGradient,{id:`${N}-bar`,from:D,to:D,toOpacity:.85}),jsxRuntime.jsx(gradient.LinearGradient,{id:`${N}-bg`,from:D,to:D,fromOpacity:.01,toOpacity:.15,x1:"0",y1:"0",x2:"1",y2:"0"})]}),l&&jsxRuntime.jsxs("text",{x:P,y:o+20,className:"fill-text-primary text-sm font-medium",children:[jsxRuntime.jsx("tspan",{className:"fill-text-secondary",children:d})," ",i(A)]}),c&&jsxRuntime.jsx("g",{children:R.map(k=>{let V=k.y+k.barHeight/2;return jsxRuntime.jsx("text",{x:o+O-12,y:V,textAnchor:"end",dominantBaseline:"middle",className:"fill-text-secondary text-xs",children:i(k.conversionRate)},k.stage.id)})}),R.map(k=>{let V=w===k.stage.id,H=T*k.widthPercent;return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:P,y:k.y,width:T,height:k.barHeight,fill:`url(#${N}-bg)`,rx:4}),jsxRuntime.jsx(framerMotion.motion.rect,{x:P,y:k.y,width:H,height:k.barHeight,fill:`url(#${N}-bar)`,rx:4,initial:{width:0},animate:{width:H},transition:{duration:.6,delay:k.index*.1,ease:"easeOut"},opacity:V||w==null?1:.5,style:{cursor:p||m?"pointer":"default",transition:"opacity 150ms ease"},onMouseEnter:()=>{h(k.stage.id),m?.(k.stage);},onMouseLeave:()=>{h(null),m?.(null);},onClick:()=>p?.(k.stage)}),jsxRuntime.jsx("rect",{x:P+10,y:k.y+k.barHeight/2-10,width:70,height:20,className:"fill-background-surface stroke-border-default",strokeWidth:1,rx:4,style:{pointerEvents:"none"}}),jsxRuntime.jsx("text",{x:P+16,y:k.y+k.barHeight/2+4,className:"fill-text-primary text-xs font-semibold",style:{pointerEvents:"none"},children:a(k.stage.value)}),jsxRuntime.jsxs("text",{x:P,y:k.y-8,className:"fill-text-secondary text-xs",style:{pointerEvents:"none"},children:[jsxRuntime.jsx("tspan",{children:k.index+1})," ",k.stage.label]}),k.stage.secondaryValue&&jsxRuntime.jsx("text",{x:P+16,y:k.y-24,className:"fill-text-secondary text-xs",style:{pointerEvents:"none"},children:k.stage.secondaryValue}),k.index>0&&k.dropOff>0&&jsxRuntime.jsxs("text",{x:P+T,y:k.y-8,textAnchor:"end",className:"fill-text-secondary text-xs",children:[i(k.dropOff)," drop"]}),k.stage.annotation&&jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:P+H+8,y:k.y+8,width:60,height:24,rx:3,className:"fill-background-muted"}),jsxRuntime.jsx("text",{x:P+H+16,y:k.y+20,className:"fill-text-secondary text-xs font-medium",children:k.stage.annotation})]})]},k.stage.id)})]})})};var F5=d3Array.bisector(e=>e.xValue).left,B5=(e,t,r)=>{if(!e.tooltipRange||e.baseline===void 0)return;let o=typeof e.baseline=="function"?e.baseline(t,r):e.baseline;return typeof o=="number"&&Number.isFinite(o)&&o!==t.yValue?o:void 0};function Jy(e){let{mouseX:t,datasets:r,seriesMetadata:o,seriesTypes:n,xScale:a,yScale:i,plotLeft:s,plotRight:c}=e,l=a.invert(t),d=r.map((m,f)=>{if(!m||m.length===0)return null;let g=F5(m,l,1);if(g===0)return {point:m[0],index:0,datasetIndex:f};if(g>=m.length)return {point:m[m.length-1],index:m.length-1,datasetIndex:f};let b=m[g-1],x=m[g];if(!b||!x)return null;let h=Math.abs(b.xValue.getTime()-l.getTime()),y=Math.abs(x.xValue.getTime()-l.getTime()),v=h<y;return {point:v?b:x,index:v?g-1:g,datasetIndex:f}}).filter(m=>m!==null&&o[m.datasetIndex]!==void 0).map(({point:m,index:f,datasetIndex:g})=>({label:o[g].label,value:m.yValue,baselineValue:B5(o[g],m,f),color:o[g].color,point:m,type:n[g]}));if(d.length===0)return null;let u=a(d[0].point.xValue),p=u>(s+c)/2;return {xValue:d[0].point.xValue,series:d.map(({label:m,value:f,baselineValue:g,color:b,point:x,type:h})=>({label:m,value:f,...g!==void 0?{baselineValue:g}:{},chartY:x.chartYValue??f,showMarker:x.showTooltipMarker??true,color:b,type:h,...x.category!==void 0?{category:x.category}:{}})),x:u,y:i(d[0].point.chartYValue??d[0].value),position:p?"left":"right"}}function $y(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Oc(e,t,r){e.prototype=t.prototype=r,r.constructor=e;}function qm(e,t){var r=Object.create(e.prototype);for(var o in t)r[o]=t[o];return r}function ks(){}var Ts=.7,Wc=1/Ts,fi="\\s*([+-]?\\d+)\\s*",Ns="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",yo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",V5=/^#([0-9a-f]{3,8})$/,O5=new RegExp(`^rgb\\(${fi},${fi},${fi}\\)$`),z5=new RegExp(`^rgb\\(${yo},${yo},${yo}\\)$`),H5=new RegExp(`^rgba\\(${fi},${fi},${fi},${Ns}\\)$`),W5=new RegExp(`^rgba\\(${yo},${yo},${yo},${Ns}\\)$`),G5=new RegExp(`^hsl\\(${Ns},${yo},${yo}\\)$`),U5=new RegExp(`^hsla\\(${Ns},${yo},${yo},${Ns}\\)$`),Xy={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Oc(ks,bn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Zy,formatHex:Zy,formatHex8:Y5,formatHsl:K5,formatRgb:Qy,toString:Qy});function Zy(){return this.rgb().formatHex()}function Y5(){return this.rgb().formatHex8()}function K5(){return nv(this).formatHsl()}function Qy(){return this.rgb().formatRgb()}function bn(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=V5.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?_y(t):r===3?new dr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?zc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?zc(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=O5.exec(e))?new dr(t[1],t[2],t[3],1):(t=z5.exec(e))?new dr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=H5.exec(e))?zc(t[1],t[2],t[3],t[4]):(t=W5.exec(e))?zc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=G5.exec(e))?rv(t[1],t[2]/100,t[3]/100,1):(t=U5.exec(e))?rv(t[1],t[2]/100,t[3]/100,t[4]):Xy.hasOwnProperty(e)?_y(Xy[e]):e==="transparent"?new dr(NaN,NaN,NaN,0):null}function _y(e){return new dr(e>>16&255,e>>8&255,e&255,1)}function zc(e,t,r,o){return o<=0&&(e=t=r=NaN),new dr(e,t,r,o)}function q5(e){return e instanceof ks||(e=bn(e)),e?(e=e.rgb(),new dr(e.r,e.g,e.b,e.opacity)):new dr}function gi(e,t,r,o){return arguments.length===1?q5(e):new dr(e,t,r,o??1)}function dr(e,t,r,o){this.r=+e,this.g=+t,this.b=+r,this.opacity=+o;}Oc(dr,gi,qm(ks,{brighter(e){return e=e==null?Wc:Math.pow(Wc,e),new dr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ts:Math.pow(Ts,e),new dr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new dr(sa(this.r),sa(this.g),sa(this.b),Gc(this.opacity))},displayable(){return -0.5<=this.r&&this.r<255.5&&-0.5<=this.g&&this.g<255.5&&-0.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ev,formatHex:ev,formatHex8:j5,formatRgb:tv,toString:tv}));function ev(){return `#${ia(this.r)}${ia(this.g)}${ia(this.b)}`}function j5(){return `#${ia(this.r)}${ia(this.g)}${ia(this.b)}${ia((isNaN(this.opacity)?1:this.opacity)*255)}`}function tv(){let e=Gc(this.opacity);return `${e===1?"rgb(":"rgba("}${sa(this.r)}, ${sa(this.g)}, ${sa(this.b)}${e===1?")":`, ${e})`}`}function Gc(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function sa(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ia(e){return e=sa(e),(e<16?"0":"")+e.toString(16)}function rv(e,t,r,o){return o<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new _r(e,t,r,o)}function nv(e){if(e instanceof _r)return new _r(e.h,e.s,e.l,e.opacity);if(e instanceof ks||(e=bn(e)),!e)return new _r;if(e instanceof _r)return e;e=e.rgb();var t=e.r/255,r=e.g/255,o=e.b/255,n=Math.min(t,r,o),a=Math.max(t,r,o),i=NaN,s=a-n,c=(a+n)/2;return s?(t===a?i=(r-o)/s+(r<o)*6:r===a?i=(o-t)/s+2:i=(t-r)/s+4,s/=c<.5?a+n:2-a-n,i*=60):s=c>0&&c<1?0:i,new _r(i,s,c,e.opacity)}function av(e,t,r,o){return arguments.length===1?nv(e):new _r(e,t,r,o??1)}function _r(e,t,r,o){this.h=+e,this.s=+t,this.l=+r,this.opacity=+o;}Oc(_r,av,qm(ks,{brighter(e){return e=e==null?Wc:Math.pow(Wc,e),new _r(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ts:Math.pow(Ts,e),new _r(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,o=r+(r<.5?r:1-r)*t,n=2*r-o;return new dr(jm(e>=240?e-240:e+120,n,o),jm(e,n,o),jm(e<120?e+240:e-120,n,o),this.opacity)},clamp(){return new _r(ov(this.h),Hc(this.s),Hc(this.l),Gc(this.opacity))},displayable(){return (0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=Gc(this.opacity);return `${e===1?"hsl(":"hsla("}${ov(this.h)}, ${Hc(this.s)*100}%, ${Hc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ov(e){return e=(e||0)%360,e<0?e+360:e}function Hc(e){return Math.max(0,Math.min(1,e||0))}function jm(e,t,r){return (e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}var Ps=e=>()=>e;function J5(e,t){return function(r){return e+r*t}}function $5(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(o){return Math.pow(e+o*t,r)}}function lv(e){return (e=+e)==1?Uc:function(t,r){return r-t?$5(t,r,e):Ps(isNaN(t)?r:t)}}function Uc(e,t){var r=t-e;return r?J5(e,r):Ps(isNaN(e)?t:e)}var $m=(function e(t){var r=lv(t);function o(n,a){var i=r((n=gi(n)).r,(a=gi(a)).r),s=r(n.g,a.g),c=r(n.b,a.b),l=Uc(n.opacity,a.opacity);return function(d){return n.r=i(d),n.g=s(d),n.b=c(d),n.opacity=l(d),n+""}}return o.gamma=e,o})(1);function dv(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,o=t.slice(),n;return function(a){for(n=0;n<r;++n)o[n]=e[n]*(1-a)+t[n]*a;return o}}function uv(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function pv(e,t){var r=t?t.length:0,o=e?Math.min(r,e.length):0,n=new Array(o),a=new Array(r),i;for(i=0;i<o;++i)n[i]=la(e[i],t[i]);for(;i<r;++i)a[i]=t[i];return function(s){for(i=0;i<o;++i)a[i]=n[i](s);return a}}function mv(e,t){var r=new Date;return e=+e,t=+t,function(o){return r.setTime(e*(1-o)+t*o),r}}function xn(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function fv(e,t){var r={},o={},n;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(n in t)n in e?r[n]=la(e[n],t[n]):o[n]=t[n];return function(a){for(n in r)o[n]=r[n](a);return o}}var Zm=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Xm=new RegExp(Zm.source,"g");function X5(e){return function(){return e}}function Z5(e){return function(t){return e(t)+""}}function gv(e,t){var r=Zm.lastIndex=Xm.lastIndex=0,o,n,a,i=-1,s=[],c=[];for(e=e+"",t=t+"";(o=Zm.exec(e))&&(n=Xm.exec(t));)(a=n.index)>r&&(a=t.slice(r,a),s[i]?s[i]+=a:s[++i]=a),(o=o[0])===(n=n[0])?s[i]?s[i]+=n:s[++i]=n:(s[++i]=null,c.push({i,x:xn(o,n)})),r=Xm.lastIndex;return r<t.length&&(a=t.slice(r),s[i]?s[i]+=a:s[++i]=a),s.length<2?c[0]?Z5(c[0].x):X5(t):(t=c.length,function(l){for(var d=0,u;d<t;++d)s[(u=c[d]).i]=u.x(l);return s.join("")})}function la(e,t){var r=typeof t,o;return t==null||r==="boolean"?Ps(t):(r==="number"?xn:r==="string"?(o=bn(t))?(t=o,$m):gv:t instanceof bn?$m:t instanceof Date?mv:uv(t)?dv:Array.isArray(t)?pv:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?fv:xn)(e,t)}function Qm(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function _m(e){return function(){return e}}function ef(e){return +e}var bv=[0,1];function bi(e){return e}function tf(e,t){return (t-=e=+e)?function(r){return (r-e)/t}:_m(isNaN(t)?NaN:.5)}function _5(e,t){var r;return e>t&&(r=e,e=t,t=r),function(o){return Math.max(e,Math.min(t,o))}}function e4(e,t,r){var o=e[0],n=e[1],a=t[0],i=t[1];return n<o?(o=tf(n,o),a=r(i,a)):(o=tf(o,n),a=r(a,i)),function(s){return a(o(s))}}function t4(e,t,r){var o=Math.min(e.length,t.length)-1,n=new Array(o),a=new Array(o),i=-1;for(e[o]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++i<o;)n[i]=tf(e[i],e[i+1]),a[i]=r(t[i],t[i+1]);return function(s){var c=d3Array.bisect(e,s,1,o)-1;return a[c](n[c](s))}}function xv(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function r4(){var e=bv,t=bv,r=la,o,n,a,i=bi,s,c,l;function d(){var p=Math.min(e.length,t.length);return i!==bi&&(i=_5(e[0],e[p-1])),s=p>2?t4:e4,c=l=null,u}function u(p){return p==null||isNaN(p=+p)?a:(c||(c=s(e.map(o),t,r)))(o(i(p)))}return u.invert=function(p){return i(n((l||(l=s(t,e.map(o),xn)))(p)))},u.domain=function(p){return arguments.length?(e=Array.from(p,ef),d()):e.slice()},u.range=function(p){return arguments.length?(t=Array.from(p),d()):t.slice()},u.rangeRound=function(p){return t=Array.from(p),r=Qm,d()},u.clamp=function(p){return arguments.length?(i=p?true:bi,d()):i!==bi},u.interpolate=function(p){return arguments.length?(r=p,d()):r},u.unknown=function(p){return arguments.length?(a=p,u):a},function(p,m){return o=p,n=m,d()}}function rf(){return r4()(bi,bi)}function of(e,t){e=e.slice();var r=0,o=e.length-1,n=e[r],a=e[o],i;return a<n&&(i=r,r=o,o=i,i=n,n=a,a=i),e[r]=t.floor(n),e[o]=t.ceil(a),e}var nf=new Date,af=new Date;function Je(e,t,r,o){function n(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return n.floor=a=>(e(a=new Date(+a)),a),n.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),n.round=a=>{let i=n(a),s=n.ceil(a);return a-i<s-a?i:s},n.offset=(a,i)=>(t(a=new Date(+a),i==null?1:Math.floor(i)),a),n.range=(a,i,s)=>{let c=[];if(a=n.ceil(a),s=s==null?1:Math.floor(s),!(a<i)||!(s>0))return c;let l;do c.push(l=new Date(+a)),t(a,s),e(a);while(l<a&&a<i);return c},n.filter=a=>Je(i=>{if(i>=i)for(;e(i),!a(i);)i.setTime(i-1);},(i,s)=>{if(i>=i)if(s<0)for(;++s<=0;)for(;t(i,-1),!a(i););else for(;--s>=0;)for(;t(i,1),!a(i););}),r&&(n.count=(a,i)=>(nf.setTime(+a),af.setTime(+i),e(nf),e(af),Math.floor(r(nf,af))),n.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?n.filter(o?i=>o(i)%a===0:i=>n.count(0,i)%a===0):n)),n}var Rs=Je(()=>{},(e,t)=>{e.setTime(+e+t);},(e,t)=>t-e);Rs.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Je(t=>{t.setTime(Math.floor(t/e)*e);},(t,r)=>{t.setTime(+t+r*e);},(t,r)=>(r-t)/e):Rs);Rs.range;var vo=Je(e=>{e.setTime(e-e.getMilliseconds());},(e,t)=>{e.setTime(+e+t*1e3);},(e,t)=>(t-e)/1e3,e=>e.getUTCSeconds());vo.range;var xi=Je(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*1e3);},(e,t)=>{e.setTime(+e+t*6e4);},(e,t)=>(t-e)/6e4,e=>e.getMinutes());xi.range;var Yc=Je(e=>{e.setUTCSeconds(0,0);},(e,t)=>{e.setTime(+e+t*6e4);},(e,t)=>(t-e)/6e4,e=>e.getUTCMinutes());Yc.range;var hi=Je(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*1e3-e.getMinutes()*6e4);},(e,t)=>{e.setTime(+e+t*36e5);},(e,t)=>(t-e)/36e5,e=>e.getHours());hi.range;var Kc=Je(e=>{e.setUTCMinutes(0,0,0);},(e,t)=>{e.setTime(+e+t*36e5);},(e,t)=>(t-e)/36e5,e=>e.getUTCHours());Kc.range;var Oo=Je(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/864e5,e=>e.getDate()-1);Oo.range;var Ds=Je(e=>{e.setUTCHours(0,0,0,0);},(e,t)=>{e.setUTCDate(e.getUTCDate()+t);},(e,t)=>(t-e)/864e5,e=>e.getUTCDate()-1);Ds.range;var qc=Je(e=>{e.setUTCHours(0,0,0,0);},(e,t)=>{e.setUTCDate(e.getUTCDate()+t);},(e,t)=>(t-e)/864e5,e=>Math.floor(e/864e5));qc.range;function ua(e){return Je(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0);},(t,r)=>{t.setDate(t.getDate()+r*7);},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/6048e5)}var zo=ua(0),yi=ua(1),vv=ua(2),Cv=ua(3),hn=ua(4),Sv=ua(5),wv=ua(6);zo.range;yi.range;vv.range;Cv.range;hn.range;Sv.range;wv.range;function pa(e){return Je(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0);},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7);},(t,r)=>(r-t)/6048e5)}var ma=pa(0),vi=pa(1),Nv=pa(2),kv=pa(3),yn=pa(4),Pv=pa(5),Rv=pa(6);ma.range;vi.range;Nv.range;kv.range;yn.range;Pv.range;Rv.range;var Ci=Je(e=>{e.setDate(1),e.setHours(0,0,0,0);},(e,t)=>{e.setMonth(e.getMonth()+t);},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Ci.range;var jc=Je(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0);},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t);},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());jc.range;var Nr=Je(e=>{e.setMonth(0,1),e.setHours(0,0,0,0);},(e,t)=>{e.setFullYear(e.getFullYear()+t);},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Nr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Je(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0);},(t,r)=>{t.setFullYear(t.getFullYear()+r*e);});Nr.range;var eo=Je(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t);},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());eo.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Je(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e);});eo.range;function Lv(e,t,r,o,n,a){let i=[[vo,1,1e3],[vo,5,5*1e3],[vo,15,15*1e3],[vo,30,30*1e3],[a,1,6e4],[a,5,5*6e4],[a,15,15*6e4],[a,30,30*6e4],[n,1,36e5],[n,3,3*36e5],[n,6,6*36e5],[n,12,12*36e5],[o,1,864e5],[o,2,2*864e5],[r,1,6048e5],[t,1,2592e6],[t,3,3*2592e6],[e,1,31536e6]];function s(l,d,u){let p=d<l;p&&([l,d]=[d,l]);let m=u&&typeof u.range=="function"?u:c(l,d,u),f=m?m.range(l,+d+1):[];return p?f.reverse():f}function c(l,d,u){let p=Math.abs(d-l)/u,m=d3Array.bisector(([,,b])=>b).right(i,p);if(m===i.length)return e.every(d3Array.tickStep(l/31536e6,d/31536e6,u));if(m===0)return Rs.every(Math.max(d3Array.tickStep(l,d,u),1));let[f,g]=i[p/i[m-1][2]<i[m][2]/p?m-1:m];return f.every(g)}return [s,c]}var [sf,lf]=Lv(Nr,Ci,zo,Oo,hi,xi);function cf(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function df(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Es(e,t,r){return {y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function uf(e){var t=e.dateTime,r=e.date,o=e.time,n=e.periods,a=e.days,i=e.shortDays,s=e.months,c=e.shortMonths,l=Ls(n),d=As(n),u=Ls(a),p=As(a),m=Ls(i),f=As(i),g=Ls(s),b=As(s),x=Ls(c),h=As(c),y={a:I,A:q,b:j,B:K,c:null,d:Ov,e:Ov,f:Q4,g:lM,G:dM,H:$4,I:X4,j:Z4,L:Uv,m:_4,M:eM,p:Y,q:M,Q:Wv,s:Gv,S:tM,u:rM,U:oM,V:nM,w:aM,W:iM,x:null,X:null,y:sM,Y:cM,Z:uM,"%":Hv},v={a:E,A:z,b:B,B:C,c:null,d:zv,e:zv,f:gM,g:NM,G:PM,H:pM,I:mM,j:fM,L:Kv,m:bM,M:xM,p:W,q:G,Q:Wv,s:Gv,S:hM,u:yM,U:vM,V:CM,w:SM,W:wM,x:null,X:null,y:TM,Y:kM,Z:RM,"%":Hv},S={a:A,A:O,b:P,B:T,c:k,d:Bv,e:Bv,f:K4,g:Fv,G:Iv,H:Vv,I:Vv,j:W4,L:Y4,m:H4,M:G4,p:R,q:z4,Q:j4,s:J4,S:U4,u:I4,U:F4,V:B4,w:A4,W:V4,x:V,X:H,y:Fv,Y:Iv,Z:O4,"%":q4};y.x=w(r,y),y.X=w(o,y),y.c=w(t,y),v.x=w(r,v),v.X=w(o,v),v.c=w(t,v);function w(F,Z){return function(_){var L=[],oe=-1,ie=0,ne=F.length,ae,ce,Ce;for(_ instanceof Date||(_=new Date(+_));++oe<ne;)F.charCodeAt(oe)===37&&(L.push(F.slice(ie,oe)),(ce=Av[ae=F.charAt(++oe)])!=null?ae=F.charAt(++oe):ce=ae==="e"?" ":"0",(Ce=Z[ae])&&(ae=Ce(_,ce)),L.push(ae),ie=oe+1);return L.push(F.slice(ie,oe)),L.join("")}}function N(F,Z){return function(_){var L=Es(1900,void 0,1),oe=D(L,F,_+="",0),ie,ne;if(oe!=_.length)return null;if("Q"in L)return new Date(L.Q);if("s"in L)return new Date(L.s*1e3+("L"in L?L.L:0));if(Z&&!("Z"in L)&&(L.Z=0),"p"in L&&(L.H=L.H%12+L.p*12),L.m===void 0&&(L.m="q"in L?L.q:0),"V"in L){if(L.V<1||L.V>53)return null;"w"in L||(L.w=1),"Z"in L?(ie=df(Es(L.y,0,1)),ne=ie.getUTCDay(),ie=ne>4||ne===0?vi.ceil(ie):vi(ie),ie=Ds.offset(ie,(L.V-1)*7),L.y=ie.getUTCFullYear(),L.m=ie.getUTCMonth(),L.d=ie.getUTCDate()+(L.w+6)%7):(ie=cf(Es(L.y,0,1)),ne=ie.getDay(),ie=ne>4||ne===0?yi.ceil(ie):yi(ie),ie=Oo.offset(ie,(L.V-1)*7),L.y=ie.getFullYear(),L.m=ie.getMonth(),L.d=ie.getDate()+(L.w+6)%7);}else ("W"in L||"U"in L)&&("w"in L||(L.w="u"in L?L.u%7:"W"in L?1:0),ne="Z"in L?df(Es(L.y,0,1)).getUTCDay():cf(Es(L.y,0,1)).getDay(),L.m=0,L.d="W"in L?(L.w+6)%7+L.W*7-(ne+5)%7:L.w+L.U*7-(ne+6)%7);return "Z"in L?(L.H+=L.Z/100|0,L.M+=L.Z%100,df(L)):cf(L)}}function D(F,Z,_,L){for(var oe=0,ie=Z.length,ne=_.length,ae,ce;oe<ie;){if(L>=ne)return -1;if(ae=Z.charCodeAt(oe++),ae===37){if(ae=Z.charAt(oe++),ce=S[ae in Av?Z.charAt(oe++):ae],!ce||(L=ce(F,_,L))<0)return -1}else if(ae!=_.charCodeAt(L++))return -1}return L}function R(F,Z,_){var L=l.exec(Z.slice(_));return L?(F.p=d.get(L[0].toLowerCase()),_+L[0].length):-1}function A(F,Z,_){var L=m.exec(Z.slice(_));return L?(F.w=f.get(L[0].toLowerCase()),_+L[0].length):-1}function O(F,Z,_){var L=u.exec(Z.slice(_));return L?(F.w=p.get(L[0].toLowerCase()),_+L[0].length):-1}function P(F,Z,_){var L=x.exec(Z.slice(_));return L?(F.m=h.get(L[0].toLowerCase()),_+L[0].length):-1}function T(F,Z,_){var L=g.exec(Z.slice(_));return L?(F.m=b.get(L[0].toLowerCase()),_+L[0].length):-1}function k(F,Z,_){return D(F,t,Z,_)}function V(F,Z,_){return D(F,r,Z,_)}function H(F,Z,_){return D(F,o,Z,_)}function I(F){return i[F.getDay()]}function q(F){return a[F.getDay()]}function j(F){return c[F.getMonth()]}function K(F){return s[F.getMonth()]}function Y(F){return n[+(F.getHours()>=12)]}function M(F){return 1+~~(F.getMonth()/3)}function E(F){return i[F.getUTCDay()]}function z(F){return a[F.getUTCDay()]}function B(F){return c[F.getUTCMonth()]}function C(F){return s[F.getUTCMonth()]}function W(F){return n[+(F.getUTCHours()>=12)]}function G(F){return 1+~~(F.getUTCMonth()/3)}return {format:function(F){var Z=w(F+="",y);return Z.toString=function(){return F},Z},parse:function(F){var Z=N(F+="",false);return Z.toString=function(){return F},Z},utcFormat:function(F){var Z=w(F+="",v);return Z.toString=function(){return F},Z},utcParse:function(F){var Z=N(F+="",true);return Z.toString=function(){return F},Z}}}var Av={"-":"",_:" ",0:"0"},Lt=/^\s*\d+/,D4=/^%/,E4=/[\\^$*+?|[\]().{}]/g;function Ve(e,t,r){var o=e<0?"-":"",n=(o?-e:e)+"",a=n.length;return o+(a<r?new Array(r-a+1).join(t)+n:n)}function L4(e){return e.replace(E4,"\\$&")}function Ls(e){return new RegExp("^(?:"+e.map(L4).join("|")+")","i")}function As(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function A4(e,t,r){var o=Lt.exec(t.slice(r,r+1));return o?(e.w=+o[0],r+o[0].length):-1}function I4(e,t,r){var o=Lt.exec(t.slice(r,r+1));return o?(e.u=+o[0],r+o[0].length):-1}function F4(e,t,r){var o=Lt.exec(t.slice(r,r+2));return o?(e.U=+o[0],r+o[0].length):-1}function B4(e,t,r){var o=Lt.exec(t.slice(r,r+2));return o?(e.V=+o[0],r+o[0].length):-1}function V4(e,t,r){var o=Lt.exec(t.slice(r,r+2));return o?(e.W=+o[0],r+o[0].length):-1}function Iv(e,t,r){var o=Lt.exec(t.slice(r,r+4));return o?(e.y=+o[0],r+o[0].length):-1}function Fv(e,t,r){var o=Lt.exec(t.slice(r,r+2));return o?(e.y=+o[0]+(+o[0]>68?1900:2e3),r+o[0].length):-1}function O4(e,t,r){var o=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return o?(e.Z=o[1]?0:-(o[2]+(o[3]||"00")),r+o[0].length):-1}function z4(e,t,r){var o=Lt.exec(t.slice(r,r+1));return o?(e.q=o[0]*3-3,r+o[0].length):-1}function H4(e,t,r){var o=Lt.exec(t.slice(r,r+2));return o?(e.m=o[0]-1,r+o[0].length):-1}function Bv(e,t,r){var o=Lt.exec(t.slice(r,r+2));return o?(e.d=+o[0],r+o[0].length):-1}function W4(e,t,r){var o=Lt.exec(t.slice(r,r+3));return o?(e.m=0,e.d=+o[0],r+o[0].length):-1}function Vv(e,t,r){var o=Lt.exec(t.slice(r,r+2));return o?(e.H=+o[0],r+o[0].length):-1}function G4(e,t,r){var o=Lt.exec(t.slice(r,r+2));return o?(e.M=+o[0],r+o[0].length):-1}function U4(e,t,r){var o=Lt.exec(t.slice(r,r+2));return o?(e.S=+o[0],r+o[0].length):-1}function Y4(e,t,r){var o=Lt.exec(t.slice(r,r+3));return o?(e.L=+o[0],r+o[0].length):-1}function K4(e,t,r){var o=Lt.exec(t.slice(r,r+6));return o?(e.L=Math.floor(o[0]/1e3),r+o[0].length):-1}function q4(e,t,r){var o=D4.exec(t.slice(r,r+1));return o?r+o[0].length:-1}function j4(e,t,r){var o=Lt.exec(t.slice(r));return o?(e.Q=+o[0],r+o[0].length):-1}function J4(e,t,r){var o=Lt.exec(t.slice(r));return o?(e.s=+o[0],r+o[0].length):-1}function Ov(e,t){return Ve(e.getDate(),t,2)}function $4(e,t){return Ve(e.getHours(),t,2)}function X4(e,t){return Ve(e.getHours()%12||12,t,2)}function Z4(e,t){return Ve(1+Oo.count(Nr(e),e),t,3)}function Uv(e,t){return Ve(e.getMilliseconds(),t,3)}function Q4(e,t){return Uv(e,t)+"000"}function _4(e,t){return Ve(e.getMonth()+1,t,2)}function eM(e,t){return Ve(e.getMinutes(),t,2)}function tM(e,t){return Ve(e.getSeconds(),t,2)}function rM(e){var t=e.getDay();return t===0?7:t}function oM(e,t){return Ve(zo.count(Nr(e)-1,e),t,2)}function Yv(e){var t=e.getDay();return t>=4||t===0?hn(e):hn.ceil(e)}function nM(e,t){return e=Yv(e),Ve(hn.count(Nr(e),e)+(Nr(e).getDay()===4),t,2)}function aM(e){return e.getDay()}function iM(e,t){return Ve(yi.count(Nr(e)-1,e),t,2)}function sM(e,t){return Ve(e.getFullYear()%100,t,2)}function lM(e,t){return e=Yv(e),Ve(e.getFullYear()%100,t,2)}function cM(e,t){return Ve(e.getFullYear()%1e4,t,4)}function dM(e,t){var r=e.getDay();return e=r>=4||r===0?hn(e):hn.ceil(e),Ve(e.getFullYear()%1e4,t,4)}function uM(e){var t=e.getTimezoneOffset();return (t>0?"-":(t*=-1,"+"))+Ve(t/60|0,"0",2)+Ve(t%60,"0",2)}function zv(e,t){return Ve(e.getUTCDate(),t,2)}function pM(e,t){return Ve(e.getUTCHours(),t,2)}function mM(e,t){return Ve(e.getUTCHours()%12||12,t,2)}function fM(e,t){return Ve(1+Ds.count(eo(e),e),t,3)}function Kv(e,t){return Ve(e.getUTCMilliseconds(),t,3)}function gM(e,t){return Kv(e,t)+"000"}function bM(e,t){return Ve(e.getUTCMonth()+1,t,2)}function xM(e,t){return Ve(e.getUTCMinutes(),t,2)}function hM(e,t){return Ve(e.getUTCSeconds(),t,2)}function yM(e){var t=e.getUTCDay();return t===0?7:t}function vM(e,t){return Ve(ma.count(eo(e)-1,e),t,2)}function qv(e){var t=e.getUTCDay();return t>=4||t===0?yn(e):yn.ceil(e)}function CM(e,t){return e=qv(e),Ve(yn.count(eo(e),e)+(eo(e).getUTCDay()===4),t,2)}function SM(e){return e.getUTCDay()}function wM(e,t){return Ve(vi.count(eo(e)-1,e),t,2)}function TM(e,t){return Ve(e.getUTCFullYear()%100,t,2)}function NM(e,t){return e=qv(e),Ve(e.getUTCFullYear()%100,t,2)}function kM(e,t){return Ve(e.getUTCFullYear()%1e4,t,4)}function PM(e,t){var r=e.getUTCDay();return e=r>=4||r===0?yn(e):yn.ceil(e),Ve(e.getUTCFullYear()%1e4,t,4)}function RM(){return "+0000"}function Hv(){return "%"}function Wv(e){return +e}function Gv(e){return Math.floor(+e/1e3)}var Si,Jc;pf({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function pf(e){return Si=uf(e),Jc=Si.format,Si.parse,Si.utcFormat,Si.utcParse,Si}function MM(e){return new Date(e)}function DM(e){return e instanceof Date?+e:+new Date(+e)}function Xv(e,t,r,o,n,a,i,s,c,l){var d=rf(),u=d.invert,p=d.domain,m=l(".%L"),f=l(":%S"),g=l("%I:%M"),b=l("%I %p"),x=l("%a %d"),h=l("%b %d"),y=l("%B"),v=l("%Y");function S(w){return (c(w)<w?m:s(w)<w?f:i(w)<w?g:a(w)<w?b:o(w)<w?n(w)<w?x:h:r(w)<w?y:v)(w)}return d.invert=function(w){return new Date(u(w))},d.domain=function(w){return arguments.length?p(Array.from(w,DM)):p().map(MM)},d.ticks=function(w){var N=p();return e(N[0],N[N.length-1],w??10)},d.tickFormat=function(w,N){return N==null?S:l(N)},d.nice=function(w){var N=p();return (!w||typeof w.range!="function")&&(w=t(N[0],N[N.length-1],w??10)),w?p(of(N,w)):d},d.copy=function(){return xv(d,Xv(e,t,r,o,n,a,i,s,c,l))},d}function $c(){return $y.apply(Xv(sf,lf,Nr,Ci,zo,Oo,hi,xi,vo,Jc).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}var Qv=e=>e instanceof Date&&!Number.isNaN(e.getTime());function Xc(e,t,r){let[o,n]=He.useState(null);He.useImperativeHandle(r,()=>({setPreview:n}),[]);let[a,i]=e.range(),s=He.useMemo(()=>o?$c().domain([new Date(o[0]),new Date(o[1])]).range([a,i]):e,[o,e,a,i]),c=s.domain(),l=c[0],d=c[c.length-1],u=Qv(l)&&Qv(d),p=t<400,m=Math.max(2,Math.min(8,Math.floor(t/(p?70:110)))),f=He.useMemo(()=>u?s.ticks(m):[],[s,m,u]);return {activeScale:s,ticks:f,start:l,end:d,valid:u,compact:p,rangeStart:a,rangeEnd:i}}var BM=6,_v=20,ff=He.forwardRef(({top:e,scale:t,width:r},o)=>{let{activeScale:n,ticks:a,start:i,end:s,valid:c,compact:l,rangeStart:d,rangeEnd:u}=Xc(t,r,o),p=He.useMemo(()=>c?Xi({start:i,end:s},{compact:l}):()=>"",[i,s,l,c]),m=He.useId(),f=Math.min(d,u),g=Math.abs(u-d);return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("line",{x1:d,x2:u,y1:e,y2:e,stroke:"var(--color-border-muted)",strokeWidth:1}),a.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("clipPath",{id:m,children:jsxRuntime.jsx("rect",{x:f,y:e-4,width:g,height:_v+16})})}),jsxRuntime.jsx("g",{clipPath:`url(#${m})`,children:a.map(b=>jsxRuntime.jsxs("g",{transform:`translate(${n(b)},${e})`,children:[jsxRuntime.jsx("line",{x1:0,x2:0,y1:0,y2:BM,stroke:"var(--color-border-muted)",strokeWidth:1}),jsxRuntime.jsx("text",{x:0,y:_v,textAnchor:"middle",fontSize:12,fill:"var(--color-text-secondary)",children:p(b)})]},b.getTime()))})]})]})});ff.displayName="LiveTimeAxisBottom";var gf=He.forwardRef(({scale:e,width:t,top:r,bottom:o},n)=>{let{activeScale:a,ticks:i}=Xc(e,t,n);return jsxRuntime.jsx("g",{"aria-hidden":"true",children:i.map(s=>{let c=a(s);return jsxRuntime.jsx("line",{x1:c,x2:c,y1:r,y2:o,stroke:"var(--color-border-muted)",strokeWidth:1},s.getTime())})})});gf.displayName="LiveTimeGridlines";function Zc(e,t,r){let o=e[1]-e[0],n=t/Math.max(1,r)*o;return [e[0]-n,e[1]-n]}function t0(e,t,r){let o=e[1]-e[0],n=e[0]+t*o,a=o/r,i=n-t*a;return [i,i+a]}function bf(e,t,r=16,o=800){return t===1?e*r:t===2?e*o:e}var r0=(e,t,r,o,n)=>{let a=t!==1?t0(e,r,t):e;return o!==0&&(a=Zc(a,o,n)),a},o0=(e,t)=>{if(!t)return e;let r=e[1]-e[0];if(r>=t[1]-t[0])return [t[0],t[1]];let[o,n]=e;return n>t[1]&&(n=t[1],o=n-r),o<t[0]&&(o=t[0],n=o+r),[o,n]},HM=e=>typeof requestAnimationFrame=="function"?requestAnimationFrame(e):setTimeout(()=>e(0),0),WM=e=>{typeof cancelAnimationFrame=="function"?cancelAnimationFrame(e):clearTimeout(e);};function n0(e){let{groupRef:t}=e,r=He.useRef({xDomain:e.xDomain,plotWidthPx:e.plotWidthPx,plotLeftPx:e.plotLeftPx??0});r.current={xDomain:e.xDomain,plotWidthPx:e.plotWidthPx,plotLeftPx:e.plotLeftPx??0};let o=He.useRef(e.onCommit);o.current=e.onCommit;let n=He.useRef(e.panBoundsMs);n.current=e.panBoundsMs;let a=He.useRef(e.settleMs??140);a.current=e.settleMs??140;let i=He.useRef(e.zoomIntent??(P=>P.ctrlKey));i.current=e.zoomIntent??(P=>P.ctrlKey);let s=He.useRef(e.onGestureStart);s.current=e.onGestureStart;let c=He.useRef(e.onFramePreview);c.current=e.onFramePreview;let l=He.useRef(null),d=He.useRef({scale:1,cursorFrac:.5,panDxPx:0,timer:null}),u=He.useRef(null),p=He.useRef(null),m=He.useRef(false),f=He.useCallback((P,T,k)=>{p.current={translateX:P,scaleX:T,preview:k},u.current==null&&(u.current=HM(()=>{u.current=null;let V=p.current;V!=null&&(t.current?.setAttribute("transform",`translate(${V.translateX},0) scale(${V.scaleX},1)`),c.current?.(V.preview));}));},[t]),g=He.useCallback(()=>{u.current!=null&&(WM(u.current),u.current=null),p.current=null,t.current?.removeAttribute("transform"),c.current?.(null);},[t]),b=He.useCallback(()=>{m.current||(m.current=true,s.current?.());},[]),x=He.useCallback(()=>{m.current=false;},[]),h=He.useCallback(()=>{d.current.timer!=null&&(clearTimeout(d.current.timer),d.current.timer=null);},[]),y=He.useCallback(()=>{d.current={scale:1,cursorFrac:.5,panDxPx:0,timer:null};},[]),v=He.useCallback(()=>{let{xDomain:P,plotWidthPx:T}=r.current,{scale:k,cursorFrac:V,panDxPx:H}=d.current;k===1&&H===0||o.current(o0(r0(P,k,V,H,T),n.current));},[]),S=He.useCallback(()=>{d.current.timer!=null&&(h(),v(),y(),g());},[h,v,y,g]),w=He.useCallback(P=>{S(),P.currentTarget.setPointerCapture?.(P.pointerId),l.current={startX:P.clientX,dxPx:0},b();},[S,b]),N=He.useCallback(P=>{if(!l.current)return;l.current.dxPx=P.clientX-l.current.startX;let{xDomain:T,plotWidthPx:k}=r.current;f(l.current.dxPx,1,Zc(T,l.current.dxPx,k));},[f]),D=He.useCallback(P=>{if(!l.current)return;let{dxPx:T}=l.current;l.current=null,g(),x(),T!==0&&o.current(o0(Zc(r.current.xDomain,T,r.current.plotWidthPx),n.current));},[g,x]),R=He.useCallback(()=>{l.current&&(l.current=null,g(),x());},[g,x]),A=He.useRef(null),O=He.useCallback(P=>{if(A.current?.(),A.current=null,!P)return;let T=k=>{if(l.current)return;let{plotWidthPx:V,plotLeftPx:H}=r.current,I=bf(k.deltaY,k.deltaMode),q=bf(k.deltaX,k.deltaMode),j=i.current(k);if(!j&&q===0)return;if(k.preventDefault(),b(),j){let E=Math.min(1,Math.max(0,(k.clientX-P.getBoundingClientRect().left)/Math.max(1,V)));d.current.scale*=Math.exp(-I/200),d.current.cursorFrac=E;}else d.current.panDxPx-=q;let{scale:K,cursorFrac:Y,panDxPx:M}=d.current;f((H+Y*V)*(1-K)+M,K,r0(r.current.xDomain,K,Y,M,V)),h(),d.current.timer=setTimeout(()=>{v(),y(),g(),x();},a.current);};P.addEventListener("wheel",T,{passive:false}),A.current=()=>P.removeEventListener("wheel",T);},[f,g,h,v,y,b,x]);return He.useEffect(()=>()=>{A.current?.(),A.current=null,g(),d.current.timer!=null&&clearTimeout(d.current.timer);},[g]),{onPointerDown:w,onPointerMove:N,onPointerUp:D,onPointerCancel:R,wheelTargetRef:O,gestureActiveRef:m}}var l0=e=>e.type===fn||e.type===ra,JM=({children:e,viewport:t,panBounds:r,onViewportChange:o,onPlotWidthChange:n,yFormatter:a={type:"number"},yDomain:i,referenceLines:s,parentWidth:c=0,parentHeight:l=0})=>{let[d,u]=He.useState(null),p=He.useRef(null),m=He.useRef(0),f=He.useId(),g=He.useRef(null),b=He.useRef(null),x=He.useRef(null),{colorMode:h}=Ht(),y=He.useMemo(()=>Bn(),[h]),v=He.useMemo(()=>ji(),[h]),{datasets:S,seriesMetadata:w,seriesTypes:N}=He.useMemo(()=>{let te=He.Children.toArray(e).filter(le=>He.isValidElement(le)&&l0(le)),ye=te.filter(le=>le.props.data).length,qe=[],It=[],de=[];return te.forEach((le,me)=>{let Q=le.props;if(!Q.data)return;qe.push(Q.data);let be=("color"in Q&&Q.color?Q.color:void 0)||(ye===1?v:y[me%y.length]),ee=le.type===fn;It.push({label:"label"in Q&&Q.label||`Series ${qe.length}`,color:be,...ee&&"baseline"in Q&&Q.baseline!==void 0?{baseline:Q.baseline,tooltipRange:"tooltipRange"in Q&&Q.tooltipRange||false}:{}}),de.push(ee?"area":"line");}),{datasets:qe,seriesMetadata:It,seriesTypes:de}},[e,v,y]),D=c,R=Math.max(100,l-60),A=He.useMemo(()=>[new Date(t.startMs),new Date(t.endMs)],[t.startMs,t.endMs]),O=He.useMemo(()=>S.flat(),[S]),P=He.useMemo(()=>{let te=bs(O,R,a,i);if(!i){let[ye,qe]=te.domain();qe>ye&&te.domain([ye,qe+(qe-ye)*.05]);}return te},[O,R,a,i]),T=He.useRef(JSON.stringify(a)),k=He.useRef(null),V=He.useMemo(()=>{let[te,ye]=P.domain(),qe=Math.max(Math.abs(te),Math.abs(ye)),It=JSON.stringify(a);if(It!==T.current&&(T.current=It,k.current=null),k.current!==null)return k.current;if(qe===0)return li(a,0);let de=li(a,qe);return k.current=de,de},[P,a]),H=He.useMemo(()=>{let te=R-Ie.top-Ie.bottom;return di(te)},[R]),I=He.useMemo(()=>{let te=Qr(V),ye=te.tickFormat||te.format,It=P.ticks(H).map(me=>ye(me)),de=ci(It,12,"system-ui"),le=Math.ceil(de)+12;return {...Ie,left:Math.max(le,30)}},[P,V,H]),q=He.useMemo(()=>scale.scaleTime({domain:A,range:[I.left,D-I.right]}),[A,D,I]),j=He.useMemo(()=>[t.startMs,t.endMs],[t.startMs,t.endMs]),K=He.useMemo(()=>r?[r.startMs,r.endMs]:void 0,[r]),Y=He.useCallback(te=>{o({startMs:te[0],endMs:te[1]});},[o]),M=D-I.left-I.right,E=He.useCallback(()=>u(null),[]),z=He.useCallback(te=>{b.current?.setPreview(te),x.current?.setPreview(te);},[]),{onPointerDown:B,onPointerMove:C,onPointerUp:W,onPointerCancel:G,wheelTargetRef:F,gestureActiveRef:Z}=n0({xDomain:j,plotWidthPx:M,plotLeftPx:I.left,groupRef:g,onCommit:Y,onGestureStart:E,onFramePreview:z,...K?{panBoundsMs:K}:{}});He.useEffect(()=>{n?.(Math.max(0,D-I.left-I.right));},[D,I,n]);let _=He.useCallback(te=>{if(Z.current)return;let{left:ye}=p.current?.getBoundingClientRect()||{left:0},qe=te.clientX-ye;te.timeStamp-(m.current||0)<16||(m.current=te.timeStamp,u(Jy({mouseX:qe,datasets:S,seriesMetadata:w,seriesTypes:N,xScale:q,yScale:P,plotLeft:I.left,plotRight:D-I.right})));},[S,w,N,q,P,D,I,Z]),L=He.useCallback(()=>u(null),[]),oe={width:D,height:R,xScale:q,yScale:P,yFormatter:V,animationSettings:gc,tooltip:{data:d,show:u,hide:()=>u(null)},datasets:S,seriesMetadata:w,seriesTypes:N},ie=0,ne=[];He.Children.toArray(e).forEach(te=>{if(!He.isValidElement(te)){ne.push(te);return}if(l0(te)){let ye=ie;ie++;let qe=te.props;ne.push(He__namespace.default.cloneElement(te,{...qe,color:w[ye]?.color,animate:false}));}else ne.push(te);});let ae=w.map(te=>({category:te.label,fill:te.color})),ce=Tl({datasets:S,metadata:{xLabel:"Date",yLabel:"Value",seriesLabels:w.map(te=>te.label),timestamp:true},svgRef:p}),Ce=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("title",{children:"Data chart visualization"}),jsxRuntime.jsx("g",{children:P.ticks(H).map(te=>{let ye=Math.abs(te)<Number.EPSILON;return jsxRuntime.jsx(shape.Line,{from:{x:I.left,y:P(te)},to:{x:D-I.right,y:P(te)},stroke:ye?"var(--color-border-default)":"var(--color-border-muted)",strokeWidth:ye?1.5:1},`grid-line-${te}`)})}),jsxRuntime.jsx(gf,{ref:x,scale:q,width:D-I.left-I.right,top:P.range()[1],bottom:P.range()[0]}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("clipPath",{id:f,children:jsxRuntime.jsx("rect",{x:q.range()[0],y:P.range()[1],width:q.range()[1]-q.range()[0],height:P.range()[0]-P.range()[1]})})}),jsxRuntime.jsx("g",{clipPath:`url(#${f})`,children:jsxRuntime.jsx("g",{ref:g,children:ne})}),s&&s.length>0&&jsxRuntime.jsx("g",{children:s.map(te=>{let ye=P(te.value),qe=te.color??"var(--color-error-base)";return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx(shape.Line,{from:{x:I.left,y:ye},to:{x:D-I.right,y:ye},stroke:qe,strokeWidth:1.5,strokeDasharray:"6 4"}),te.label&&jsxRuntime.jsx("text",{x:D-I.right-4,y:ye-4,textAnchor:"end",fontSize:11,fill:qe,children:te.label})]},`ref-line-${te.value}`)})}),jsxRuntime.jsx(ff,{ref:b,top:R-I.bottom,scale:q,width:D-I.left-I.right}),jsxRuntime.jsx(Hr.Left,{left:I.left,scale:P,yFormatter:V,height:R-I.top-I.bottom}),d&&!d.isEvent&&jsxRuntime.jsx(jsxRuntime.Fragment,{children:d.series.filter(te=>te.type!=="bar"&&te.showMarker!==false).map(te=>jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("circle",{cx:q(d.xValue),cy:P(te.chartY??te.value),r:8,fill:"white",stroke:te.color,strokeWidth:2,style:{transition:"all 100ms ease-out"}}),jsxRuntime.jsx("circle",{cx:q(d.xValue),cy:P(te.chartY??te.value),r:4,fill:te.color,style:{transition:"all 100ms ease-out"}})]},`highlight-${te.label}`))}),jsxRuntime.jsx("rect",{"data-camera-surface":"",x:I.left,y:I.top,width:D-I.left-I.right,height:R-I.top-I.bottom,fill:"transparent",style:{cursor:"grab",touchAction:"none"},onMouseMove:_,onMouseLeave:L,onPointerDown:B,onPointerMove:C,onPointerUp:W,onPointerCancel:G,ref:F})]});return jsxRuntime.jsx("div",{className:"relative flex h-full flex-col",children:jsxRuntime.jsxs(zr.Provider,{value:oe,children:[jsxRuntime.jsx("svg",{width:D,height:R,className:"overflow-visible",ref:p,role:"img","aria-label":"Data chart",children:Ce}),jsxRuntime.jsx(gn,{data:d,formatter:V}),jsxRuntime.jsx(pi,{onExport:ce,items:ae,marginLeft:0,marginRight:I.right})]})})},_c=responsive.withParentSize(JM);var $M={sm:"gap-4 px-6 py-8",md:"gap-5 px-8 py-12",lg:"gap-6 px-10 py-16"},XM={sm:"xs",md:"sm",lg:"md"},ZM={sm:bt("bodySm"),md:bt("bodySm"),lg:bt("bodyMd")},QM={sm:"h-10 w-10",md:"h-12 w-12",lg:"h-16 w-16"},_M={sm:20,md:24,lg:32},eD={center:"items-center text-center [&_.empty-state-actions]:justify-center [&_.empty-state-actions]:text-center",start:"items-start text-left [&_.empty-state-actions]:justify-start [&_.empty-state-actions]:text-left"},tD={mesh:"radial-gradient(at 20% 20%, rgba(68, 74, 225, 0.06) 0px, transparent 45%), radial-gradient(at 80% 80%, rgba(68, 74, 225, 0.045) 0px, transparent 45%), radial-gradient(at 50% 50%, rgba(68, 74, 225, 0.03) 0px, transparent 50%)","top-fade":"linear-gradient(to bottom, rgba(68, 74, 225, 0.06) 0%, rgba(68, 74, 225, 0.02) 60%, transparent 100%)",center:"radial-gradient(ellipse 600px 400px at center, rgba(68, 74, 225, 0.06) 0px, transparent 60%)",corners:"radial-gradient(at 0% 0%, rgba(68, 74, 225, 0.06) 0px, transparent 40%), radial-gradient(at 100% 100%, rgba(68, 74, 225, 0.045) 0px, transparent 40%)",bottom:"radial-gradient(ellipse 700px 300px at 50% 100%, rgba(68, 74, 225, 0.06) 0px, transparent 60%)",asymmetric:"radial-gradient(at 15% 30%, rgba(68, 74, 225, 0.06) 0px, transparent 45%), radial-gradient(at 85% 70%, rgba(68, 74, 225, 0.04) 0px, transparent 50%)"};function ed({icon:e,title:t,description:r,primaryAction:o,secondaryAction:n,actions:a,size:i="md",alignment:s="center",variant:c="default",spotlightPattern:l="mesh",fullHeight:d=false,className:u}){let p=i==="sm"?"sm":"md",m=c==="spotlight",f=m?{background:tD[l]}:void 0,g=()=>a?jsxRuntime.jsx("div",{className:"empty-state-actions mt-2 flex flex-wrap items-center gap-3",children:a}):o||n?jsxRuntime.jsxs("div",{className:"empty-state-actions mt-2 flex flex-col gap-3",children:[o&&(o.href?jsxRuntime.jsx(re,{variant:"secondary",size:p,onPress:o.onPress,isDisabled:o.isDisabled,isLoading:o.isLoading,href:o.href,children:o.label}):jsxRuntime.jsx(re,{variant:"secondary",size:p,onPress:o.onPress,isDisabled:o.isDisabled,isLoading:o.isLoading,children:o.label})),n&&jsxRuntime.jsx(tt,{href:n.href||"#",variant:"muted",onPress:n.onPress,className:bt("labelMd"),children:n.label})]}):null;return jsxRuntime.jsxs("section",{"data-testid":"empty-state",role:"status","aria-live":"polite",className:tailwindMerge.twMerge("flex w-full flex-col rounded-xl text-text-primary",$M[i],eD[s],d?"h-full justify-center":"",m?"relative overflow-hidden":"",u),style:f,children:[e&&jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex items-center justify-center rounded-full border border-border-muted bg-background-muted text-text-secondary",QM[i]),children:jsxRuntime.jsx(U,{name:e,size:_M[i]})}),jsxRuntime.jsx(or,{size:XM[i],tag:"h2",className:"text-text-secondary",children:t}),r&&jsxRuntime.jsx("p",{className:tailwindMerge.twMerge("max-w-xs text-text-secondary whitespace-pre-line",ZM[i]),children:r}),g()]})}function sD({selectionState:e,isDisabled:t}){let r=`${$e} w-full h-full flex items-center justify-center rounded-sm forced-color-adjust-none font-semibold`,o={none:"text-text-primary group-hover:bg-background-muted group-pressed:bg-background-muted",middle:["bg-background-selected group-hover:bg-background-muted forced-colors:group-hover:bg-[Highlight]","group-invalid:group-hover:bg-feedback-error-background forced-colors:group-invalid:group-hover:bg-[Mark]","group-pressed:bg-background-muted forced-colors:group-pressed:bg-[Highlight] forced-colors:text-[HighlightText]","group-invalid:group-pressed:bg-feedback-error-background forced-colors:group-invalid:group-pressed:bg-[Mark]"].join(" "),cap:"bg-action-default text-[color:var(--color-action-default-text)] group-invalid:bg-feedback-error-border forced-colors:bg-[Highlight] forced-colors:group-invalid:bg-[Mark] forced-colors:text-[HighlightText]"},n=t?"text-text-disabled forced-colors:text-text-disabled font-light":"";return [r,o[e],n].filter(Boolean).join(" ")}function Ti({errorMessage:e,...t}){return jsxRuntime.jsxs(reactAriaComponents.RangeCalendar,{...t,children:[jsxRuntime.jsx(dc,{}),jsxRuntime.jsxs(reactAriaComponents.CalendarGrid,{className:"w-full border-separate [border-spacing:0] [&_td]:p-0 [&_td]:!border-0",children:[jsxRuntime.jsx(uc,{}),jsxRuntime.jsx(reactAriaComponents.CalendarGridBody,{children:r=>jsxRuntime.jsx(reactAriaComponents.CalendarCell,{date:r,className:"selection-start:rounded-s-full selection-end:rounded-e-full [td:last-child_&]:rounded-e-end group h-9 w-9 cursor-default text-sm border-0 outside-month:text-text-disabled invalid:selected:bg-feedback-error-background forced-colors:selected:bg-[Highlight] forced-colors:selected:text-[HighlightText] forced-colors:invalid:selected:bg-[Mark] [td:first-child_&]:rounded-s-full [&]:border-0",children:({formattedDate:o,isSelected:n,isSelectionStart:a,isSelectionEnd:i,isFocusVisible:s,isDisabled:c})=>jsxRuntime.jsx("span",{className:sD({selectionState:n&&(a||i)?"cap":n?"middle":"none",isDisabled:c}),children:o})})})]}),e&&jsxRuntime.jsx(reactAriaComponents.Text,{slot:"errorMessage",className:"text-sm text-feedback-error-text",children:e})]})}function p0(e){return e==="brand"?"primary":e==="default"||e==="secondary"||!e?"subtle":e}var cD={sm:"h-[var(--control-sm-height)] text-xs",md:"h-[var(--control-md-height)] text-sm",lg:"h-[var(--control-lg-height)] text-base",xl:"h-[var(--control-xl-height)] text-lg"},dD={sm:14,md:16,lg:18,xl:20},uD=({isSelected:e,isFirst:t,isLast:r,isDisabled:o,variant:n="subtle"})=>{let a=p0(n),i=a==="primary"?"focus-visible:outline-action-primary":"focus-visible:outline-[color:var(--color-action-secondary-text)]";return a==="subtle"?tailwindMerge.twMerge($e(),"focus-visible:outline-[color:var(--color-action-secondary-text)]","px-3 text-center transition cursor-pointer forced-color-adjust-none -ml-px first:ml-0 flex items-center justify-center h-full gap-2",e?"bg-background-muted text-text-primary font-medium forced-colors:!bg-[Highlight] forced-colors:!text-[HighlightText]":"text-text-secondary hover:bg-background-hover pressed:bg-background-hover forced-colors:!bg-[ButtonFace] forced-colors:!text-[ButtonText]",!r&&"border-r border-border-muted",o&&"bg-background-muted text-text-disabled forced-colors:!bg-[ButtonFace] forced-colors:!text-[GrayText] border-border-muted forced-colors:border-[GrayText] cursor-not-allowed"):tailwindMerge.twMerge($e(),i,"px-3 text-center transition cursor-pointer forced-color-adjust-none -ml-px first:ml-0 flex items-center justify-center h-full gap-2",e?"bg-action-primary text-[color:var(--color-action-primary-text)] font-semibold forced-colors:!bg-[Highlight] forced-colors:!text-[HighlightText]":"text-text-secondary hover:bg-background-hover pressed:bg-background-hover forced-colors:!bg-[ButtonFace] forced-colors:!text-[ButtonText] hover:font-semibold",!r&&"border-r border-border-muted",o&&"bg-background-muted text-text-disabled forced-colors:!bg-[ButtonFace] forced-colors:!text-[GrayText] border-border-muted forced-colors:border-[GrayText] cursor-not-allowed")};function rd({options:e,value:t,onChange:r,size:o="md",className:n,isDisabled:a,variant:i="subtle",iconOnly:s=false,"aria-label":c}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("inline-flex overflow-hidden rounded-[var(--control-border-radius)]",p0(i)==="subtle"?"border border-border-muted":"border-2 border-border-muted",cD[o],n),role:"group","aria-label":c,children:e.map((l,d)=>{let u=s&&!!l.icon;return jsxRuntime.jsxs(reactAriaComponents.ToggleButton,{isSelected:t===l.id,onChange:()=>r(l.id),className:uD({isSelected:t===l.id,isFirst:d===0,isLast:d===e.length-1,isDisabled:a,variant:i}),isDisabled:a,"aria-label":l.label,children:[l.icon&&jsxRuntime.jsx(U,{name:l.icon,size:dD[o]}),u?jsxRuntime.jsx("span",{className:"sr-only",children:l.label}):jsxRuntime.jsx("span",{className:"inline-flex flex-col items-center after:content-[attr(data-label)] after:font-semibold after:h-0 after:overflow-hidden after:invisible","data-label":l.label,children:l.label})]},l.id)})})}function gD(e){return e instanceof Date&&!Number.isNaN(e.getTime())}function vf(e){return gD(e)?e:(console.warn("Invalid date detected in TimeControls, using fallback:",e),new Date)}var g0={FIVE_MINUTES:0,FIFTEEN_MINUTES:1,HOUR:2,DAY:3,WEEK:4,MONTH:5,YEAR:6},bD=[{id:"FIFTEEN_MINUTES",label:"15m"},{id:"HOUR",label:"1h"},{id:"DAY",label:"1d"},{id:"WEEK",label:"1w"}];function od({dateRange:e,onDateRangeChange:t,windowSize:r,onWindowSizeChange:o,showWindowSize:n=true,showRangeSelector:a=true,allowDatePicker:i=false,lockWindowSize:s=false,restrictToSingleDay:c=false,presetRanges:l=[],windowSizeOptions:d=bD,autoAdjustWindowSize:u=false,className:p}){let[m,f]=He.useState(0),g=He.useRef(null),[b,x]=He.useState(false),h=M=>{let z=(M.before.getTime()-M.after.getTime())/(1e3*60*60);return z<=24?"FIFTEEN_MINUTES":z<=72||z<=168?"HOUR":("DAY")};He.useEffect(()=>{if(u&&!b&&o){let M=h(e);o(M);}},[e,u,b,o]);let y=M=>l.find(E=>{let z=E.getRange();return Math.abs(z.after.getTime()-M.after.getTime())<1e3*60*60*24&&Math.abs(z.before.getTime()-M.before.getTime())<1e3*60*60*24})?.id,[v,S]=He.useState(()=>y(e)),w=vf(e.after),N=vf(e.before),D=new Date(N);D.setDate(D.getDate()-1);let R={start:Xl(w,Yn()),end:Xl(D,Yn())};He.useEffect(()=>{let M=new ResizeObserver(E=>{for(let z of E)f(z.contentRect.width);});return g.current&&M.observe(g.current),()=>{g.current&&M.unobserve(g.current);}},[]);let A=[...d].sort((M,E)=>g0[M.id]-g0[E.id]),O=M=>{let E=M.toString(),z=l.find(B=>B.id===E);z&&(S(E),x(false),t(z.getRange()));},P=M=>{if(M?.start&&M?.end){S(void 0);let E=new Date(M.start.year,M.start.month-1,M.start.day,0,0,0,0),z=new Date(M.end.year,M.end.month-1,M.end.day+1,0,0,0,0);t({after:E,before:z});}},T=M=>{if(M){S(void 0);let E=new Date(M.year,M.month-1,M.day,0,0,0,0),z=new Date(M.year,M.month-1,M.day+1,0,0,0,0);t({after:E,before:z});}},k=M=>{o&&(x(true),o(M.toString()));},V=()=>{if(l.length>0){let M=l[0];S(M.id),x(false),t(M.getRange());}},H=(M,E=0)=>{let z=vf(M),B=new Date(z);return E!==0&&B.setDate(B.getDate()+E),B.toLocaleDateString("en-US")},I=A.map(M=>({id:M.id,label:M.label,value:M.id})),q=l.map(M=>({id:M.id,label:M.label,value:M.id})),j=s?jsxRuntime.jsx("div",{className:"flex items-center rounded-md border border-border-muted bg-background-muted px-3 py-2 text-sm text-text-secondary",children:A.find(M=>M.id===r)?.label||r}):jsxRuntime.jsx(qn,{className:"w-full md:w-auto",selectedKey:r,onSelectionChange:k,items:I,size:"md","aria-label":"Select Window Size",children:M=>jsxRuntime.jsx(ar,{id:M.id,"aria-label":M.label,size:"md",children:M.label},M.id)}),K=c?jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsxs(reactAriaComponents.DialogTrigger,{children:[jsxRuntime.jsxs(re,{className:"border-l pl-2 pr-2 hover:border-border-default hover:bg-background-muted hover:text-text-link-hover",variant:"secondary",children:[jsxRuntime.jsx(U,{name:"CalendarBlank",size:18}),jsxRuntime.jsx("span",{className:"ml-2 hidden md:block",children:H(e.after)})]}),jsxRuntime.jsx(lt,{className:"w-auto p-3",disableGroup:true,children:jsxRuntime.jsx(ri,{"aria-label":"Select date",value:ls(w.toISOString().split("T")[0]),onChange:T})})]})}):jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsxs(reactAriaComponents.DialogTrigger,{children:[jsxRuntime.jsxs(re,{className:"rounded-r-none border-l pl-2 pr-2 hover:border-border-default hover:bg-background-muted hover:text-text-link-hover",variant:"secondary",children:[jsxRuntime.jsx(U,{name:"CalendarBlank",size:18}),!v&&jsxRuntime.jsx("span",{className:"ml-2 hidden md:block",children:`${H(e.after)} - ${H(e.before,-1)}`})]}),jsxRuntime.jsx(lt,{className:"w-auto p-3",disableGroup:true,children:jsxRuntime.jsx(Ti,{"aria-label":"Date range calendar",value:R,onChange:P})})]}),!v&&jsxRuntime.jsx(re,{variant:"ghost",size:"md",onPress:V,children:"Reset"})]}),Y=m<600;return jsxRuntime.jsx("div",{ref:g,className:tailwindMerge.twMerge("flex w-full flex-wrap items-center justify-between gap-4",p),children:Y?jsxRuntime.jsxs("div",{className:"flex w-full justify-between",children:[jsxRuntime.jsxs("div",{className:"flex items-center",children:[i&&K,a&&v!==void 0&&jsxRuntime.jsx(qn,{selectedKey:v,onSelectionChange:O,items:q,size:"md","aria-label":"Select Date Range",children:M=>jsxRuntime.jsx(ar,{id:M.id,size:"md",children:M.label},M.id)})]}),jsxRuntime.jsx("div",{className:"flex items-center",children:n&&r&&j})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[i&&K,a&&v!==void 0&&jsxRuntime.jsx(rd,{options:l.map(M=>({id:M.id,label:M.label})),value:v,onChange:O,size:"sm",variant:"secondary","aria-label":"Select Date Range"})]}),jsxRuntime.jsx("div",{className:"flex items-center",children:n&&r&&j})]})})}var CD=1440*60*1e3,SD=6e4,Ni=(e,t)=>({startMs:t-e*CD,endMs:t}),Fs=e=>({after:new Date(e.startMs),before:new Date(e.endMs)});function b0({source:e,initialRange:t,viewportEnd:r,yFormatter:o,yDomain:n,referenceLines:a,emptyState:i,presetRanges:s,tierToWindow:c,windowSizeOptions:l,height:d=360,hint:u,dataBounds:p,children:m}){let[f,g]=He.useState(900),b=p?.endMs,[x,h]=He.useState(()=>b??Date.now());He.useEffect(()=>{if(b!=null){h(b);return}h(Date.now());let Z=setInterval(()=>h(Date.now()),SD);return ()=>clearInterval(Z)},[b]);let y=r?.getTime()??b,v=t?.days??30,S=He.useMemo(()=>Ni(v,y??Date.now()),[v,y]),w=x,N=He.useMemo(()=>({startMs:p?.startMs??0,endMs:x}),[p?.startMs,x]),D=Z=>{let _=Math.min(Z.endMs-Z.startMs,N.endMs-N.startMs),L=Math.max(Math.min(Z.endMs,N.endMs),N.startMs+_);return {startMs:L-_,endMs:L}},[R,A]=He.useState(null),O=R??S,P=rp({fetchTile:e.fetchTile,ladder:e.ladder,nativeMs:e.nativeMs,initialViewport:S,widthPx:f,maxFutureMs:w,tileCostSeriesCount:e.tileCostSeriesCount,resetKey:e.resetKey}),T=He.useMemo(()=>[{id:"year",label:"Year",getRange:()=>Fs(Ni(365,y??Date.now()))},{id:"month",label:"Month",getRange:()=>Fs(Ni(30,y??Date.now()))},{id:"week",label:"Week",getRange:()=>Fs(Ni(7,y??Date.now()))},{id:"day",label:"24h",getRange:()=>Fs(Ni(1,y??Date.now()))}],[y]),{line:k,coverage:V,renderTier:H,targetTier:I,isFallback:q,isStale:j}=P.series,K=H?H.bucketMs*1.5:0,Y=Z=>Z==null?"\u2014":new Date(Z).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),M=(Z,_)=>{let L=_-Z<1728e5?{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}:{month:"short",day:"numeric",year:"numeric"},oe=new Intl.DateTimeFormat("en-US",L);return `${oe.format(new Date(Z))} \u2013 ${oe.format(new Date(_))}`},E=P.viewport.startMs!==O.startMs||P.viewport.endMs!==O.endMs,z=j||P.loading&&V.earliestMs==null,B=(P.viewport.endMs-P.viewport.startMs)*.03,C=!z&&V.earliestMs!=null&&V.earliestMs>P.viewport.startMs+B,W=!P.loading&&V.earliestMs==null&&V.latestMs==null&&k.length===0&&!j,G=m({series:P.series,gapMs:K}),F=He.isValidElement(G)&&G.type===He.Fragment?G.props.children:G;return jsxRuntime.jsxs("div",{className:"flex flex-col gap-3",children:[jsxRuntime.jsx(od,{dateRange:Fs(P.viewport),onDateRangeChange:Z=>P.jumpTo(D({startMs:Z.after.getTime(),endMs:Z.before.getTime()})),windowSize:c[I.id],windowSizeOptions:l,lockWindowSize:true,presetRanges:s??T}),jsxRuntime.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs text-text-secondary",children:[jsxRuntime.jsxs("span",{children:["Window"," ",jsxRuntime.jsx("span",{className:"font-medium text-text-primary",children:M(P.viewport.startMs,P.viewport.endMs)})]}),jsxRuntime.jsx("span",{className:"text-text-tertiary",children:"\u2022"}),jsxRuntime.jsxs("span",{children:["Resolution ",jsxRuntime.jsx("span",{className:"font-medium text-text-primary",children:H?.id??I.id}),q&&jsxRuntime.jsxs("span",{className:"text-text-tertiary",children:[" \xB7 loading ",I.id]})]}),jsxRuntime.jsx("span",{className:"text-text-tertiary",children:"\u2022"}),jsxRuntime.jsxs("span",{children:[jsxRuntime.jsx("span",{className:"font-medium text-text-primary",children:k.length})," pts"]}),P.loading&&jsxRuntime.jsx("span",{className:"text-text-tertiary",children:"loading\u2026"}),C&&jsxRuntime.jsxs("span",{className:"text-text-tertiary",children:["showing available history from ",Y(V.earliestMs)]}),!C&&!z&&P.atDataStart&&jsxRuntime.jsx("span",{className:"text-text-tertiary",children:"no earlier data loaded"}),E&&jsxRuntime.jsx(re,{variant:"ghost",size:"sm",onPress:()=>{let Z=D(Ni(v,y??Date.now()));A(Z),P.jumpTo(Z);},children:"\u27F2 Reset"})]}),jsxRuntime.jsx("div",{className:"relative overflow-hidden rounded-md border border-border-subtle",style:{height:d},children:W?jsxRuntime.jsx(ed,{title:i.title,description:i.description}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(_c,{viewport:P.viewport,panBounds:N,onViewportChange:P.onViewportChange,onPlotWidthChange:g,...o&&{yFormatter:o},...n&&{yDomain:n},...a&&{referenceLines:a},children:F}),P.loading&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 h-0.5 animate-pulse bg-[var(--color-viz-categorical-1)] opacity-60"})]})}),u&&jsxRuntime.jsx("p",{className:"text-xs text-text-tertiary",children:u})]})}function TD(e,t,r){return {field:e,operator:t,value:r}}function ND(e,t="AND"){return {logic:t,conditions:e}}function Bs(){return {logic:"AND",conditions:[]}}function nd(e){return !e||e.conditions.length===0?true:e.conditions.every(t=>"conditions"in t?nd(t):false)}function kD(e,t){if(!e)return [];let r=new Map(t?.map(i=>[i.field,i])),o=new Map;function n(i){if("conditions"in i)i.conditions.forEach(s=>n(s));else {let s=o.get(i.field)||[];s.push(i),o.set(i.field,s);}}e.conditions.forEach(i=>n(i));let a=[];for(let[i,s]of o.entries()){let c=r.get(i),l=c?.label||i,d=[],u=[],p=[];for(let m of s)m.operator==="in"&&Array.isArray(m.value)?d.push(...m.value):m.operator==="eq"?typeof m.value!="boolean"&&!Array.isArray(m.value)?d.push(m.value):p.push(m):["gte","gt","lte","lt"].includes(m.operator)?u.push({operator:m.operator,value:typeof m.value=="boolean"||Array.isArray(m.value)?String(m.value):m.value}):p.push(m);if(d.length>0){let f=Array.from(new Set(d)).map(g=>c?.values?.find(x=>String(x.value)===String(g))?.label??g);a.push({id:`${i}-in`,label:l,value:f.join(", ")});}if(u.length>0){let m=u.find(g=>g.operator==="gte"||g.operator==="gt"),f=u.find(g=>g.operator==="lte"||g.operator==="lt");if(m&&f){let g=m.operator==="gte"?"\u2265":">",b=f.operator==="lte"?"\u2264":"<";a.push({id:`${i}-range`,label:l,value:`${g} ${m.value} and ${b} ${f.value}`});}else for(let g of u){let b;g.operator==="gte"?b="\u2265":g.operator==="gt"?b=">":g.operator==="lte"?b="\u2264":b="<",a.push({id:`${i}-${g.operator}`,label:l,value:`${b} ${g.value}`});}}for(let m of p){let f;m.operator==="neq"?f=`\u2260 ${m.value}`:m.operator==="contains"?f=`contains "${m.value}"`:m.operator==="startsWith"?f=`starts with "${m.value}"`:m.operator==="endsWith"?f=`ends with "${m.value}"`:f=String(m.value),a.push({id:`${i}-${m.operator}`,label:l,value:f});}}return a}function Sn(e,t){let r=e||Bs();return {...r,conditions:[...r.conditions,t]}}function ba(e,t){if(!e)return Bs();let r=e.conditions.filter(o=>"conditions"in o?ba(o,t).conditions.length>0:o.field!==t);return {...e,conditions:r}}function xa(e){if(!e)return [];let t=new Set;function r(o){"conditions"in o?o.conditions.forEach(r):t.add(o.field);}return e.conditions.forEach(r),Array.from(t)}function Vs({count:e,label:t="results",isLoading:r=false,className:o=""}){if(r)return jsxRuntime.jsx("div",{className:`flex items-center ${o}`,children:jsxRuntime.jsx(J,{width:80,height:16})});let n=t.endsWith("s")?t.slice(0,-1):t,a=e===1?n:t;return jsxRuntime.jsxs("div",{className:`text-sm text-text-secondary whitespace-nowrap ${o}`,children:[e.toLocaleString()," ",a]})}var ED=e=>{let t=Wt({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused,transparent:e.transparent,size:e.size}),r=[e.showSearchIcon?"":"pl-3",e.isClearable&&e.hasValue||e.isPassword?"pr-8":"pr-3"].join(" ");return tailwindMerge.twMerge(t,r,e.className)};function Gr({label:e,description:t,errorMessage:r,size:o="md",tooltip:n,isRequired:a,transparent:i,showSearchIcon:s,isClearable:c,onClear:l,type:d,validationResult:u,reserveErrorSpace:p=true,isLoading:m=false,descriptionPlacement:f="below",...g}){let[b,x]=He__namespace.default.useState(false),{isFocused:h,handleFocus:y,handleBlur:v}=Or(),S=d==="password",w=Pl(m,300);return jsxRuntime.jsx(reactAriaComponents.TextField,{...g,isRequired:a,className:ke(g.className,"group flex flex-col"),children:({isDisabled:N,isInvalid:D})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(ze,{size:o,tooltip:n,description:f==="tooltip"||f==="inline"?t:void 0,descriptionPlacement:f,isRequired:a,children:e}),jsxRuntime.jsxs(vt,{children:[s&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute top-1/2 -translate-y-1/2 transform flex items-center z-10",style:{left:9},children:(()=>{let R={sm:14,md:16,lg:18,xl:20}[o];return w?jsxRuntime.jsx(Eo,{size:R,color:"text-text-secondary"}):jsxRuntime.jsx(U,{name:"MagnifyingGlass",size:R,className:`transition-colors ${h?"text-action-brand":"text-text-secondary"}`})})()}),jsxRuntime.jsx(rc,{size:o,disabled:N,type:S?b?"text":"password":d,name:g.name,autoComplete:g.autoComplete,value:g.value,defaultValue:g.defaultValue,placeholder:g.placeholder,onFocus:R=>y(R,g.onFocus),onBlur:R=>v(R,g.onBlur),onChange:R=>g.onChange?.(R.target.value),style:s?{paddingLeft:{sm:28,md:32,lg:36,xl:37}[o]}:void 0,className:ED({isInvalid:D,isDisabled:N,isFocused:h,size:o,transparent:i,showSearchIcon:s,isClearable:c,hasValue:!!g.value,isPassword:S,className:typeof g.className=="string"?g.className:void 0})}),c&&g.value&&!N&&jsxRuntime.jsx(cs,{onClick:()=>{l?l():g.onChange&&g.onChange("");},size:o}),S&&!N&&jsxRuntime.jsx("button",{type:"button",onClick:()=>x(!b),className:"absolute right-3 top-1/2 -translate-y-1/2 transform text-text-secondary hover:text-text-primary","aria-label":b?"Hide password":"Show password",onMouseDown:R=>{R.preventDefault(),R.stopPropagation();},children:jsxRuntime.jsx(U,{name:b?"EyeSlash":"Eye",size:o==="sm"?16:20,className:"text-text-primary"})})]}),p?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof r=="string"?jsxRuntime.jsx(ge,{size:o,children:r}):typeof r=="function"&&u?jsxRuntime.jsx(ge,{size:o,children:r(u)}):t&&f==="below"?jsxRuntime.jsx(Pe,{size:o,children:t}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof r=="string"?jsxRuntime.jsx(ge,{size:o,className:"mt-1",children:r}):typeof r=="function"&&u?jsxRuntime.jsx(ge,{size:o,className:"mt-1",children:r(u)}):t&&f==="below"?jsxRuntime.jsx(Pe,{size:o,className:"mt-1",children:t}):null})]})})}function ha({value:e,onChange:t,onClear:r,placeholder:o="Search...",size:n="sm",className:a="",isLoading:i=false}){return jsxRuntime.jsx("div",{className:`flex-1 min-w-0 sm:max-w-sm ${a}`,children:jsxRuntime.jsx(Gr,{value:e,onChange:t,placeholder:o,showSearchIcon:true,isClearable:!!e&&!!r,onClear:r,size:n,"aria-label":o,reserveErrorSpace:false,isLoading:i})})}function Os({value:e,options:t,onChange:r,direction:o,onDirectionChange:n,showLabel:a=true,size:i="sm",className:s="",compact:c=false}){let[l,d]=He.useState(false),u=o!==void 0&&n!==void 0,p=t.find(m=>m.value===e);return c?jsxRuntime.jsxs("div",{className:`flex items-center gap-2 ${s}`,children:[jsxRuntime.jsx(re,{variant:"secondary",size:i,icon:"ArrowsDownUp","aria-label":`Sort by: ${p?.label||"Select"}`,onPress:()=>d(true)}),jsxRuntime.jsx(ct,{isOpen:l,onClose:()=>d(false),title:"Sort by",contentPadding:false,children:jsxRuntime.jsx(reactAriaComponents.ListBox,{items:t.map(m=>({id:m.value,label:m.label,value:m.value})),className:"w-full bg-background-surface p-0 outline-0 [&_[role=option]]:border-b [&_[role=option]]:border-border-default [&_[role=option]:last-child]:border-0 [&_[role=option]]:!px-6 [&_[role=option]]:!py-4 [&_[role=option]]:rounded-none",selectionMode:"single",selectedKeys:e?[e]:[],onSelectionChange:m=>{let f=Array.from(m)[0];f!=null&&(r(f),d(false));},children:m=>jsxRuntime.jsx(ar,{id:m.id,textValue:m.label,children:jsxRuntime.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap min-w-0 flex-1",children:m.label})},m.id)})})]}):jsxRuntime.jsxs("div",{className:`flex items-center gap-2 ${s}`,children:[a&&jsxRuntime.jsx("span",{className:"text-sm text-text-secondary whitespace-nowrap",children:"Sort by:"}),jsxRuntime.jsx(qn,{selectedKey:e,onSelectionChange:m=>r(m),size:i,className:"min-w-32",items:t.map(m=>({id:m.value,label:m.label,value:m.value})),renderItem:m=>m.label,"aria-label":"Sort by",reserveErrorSpace:false}),u&&jsxRuntime.jsx(re,{variant:"ghost",size:i,onClick:()=>n(o==="asc"?"desc":"asc"),"aria-label":`Sort ${o==="asc"?"descending":"ascending"}`,className:"p-1.5",children:o==="asc"?jsxRuntime.jsx(lucideReact.ArrowUp,{className:"w-4 h-4"}):jsxRuntime.jsx(lucideReact.ArrowDown,{className:"w-4 h-4"})})]})}function C0({search:e,searchMobileMode:t="expanded",filters:r=[],onRemoveFilter:o,onClearAllFilters:n,onManageFilters:a,exportControl:i,maxVisibleFilterChips:s=3,sort:c,resultsCount:l,leftControls:d,onManageColumns:u,columnPicker:p,customControls:m,actions:f,interactionMode:g="auto",sticky:b,stickyTop:x="0",zIndex:h=10,className:y="",style:v}){let S=r.length>0;if(!(e||S||a||c||l||d||u||p||m||f||i))return null;let N=b?"sticky bg-background-surface":"",D=b?{top:x,zIndex:h}:{};return jsxRuntime.jsxs("div",{className:`@container flex flex-col gap-3 bg-background-surface py-3 border-b border-border-default ${N} ${y}`,style:{...v,...D},children:[jsxRuntime.jsxs("div",{className:"hidden @[640px]:flex @[640px]:items-center @[640px]:justify-between @[640px]:gap-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[d,d&&l&&jsxRuntime.jsx("div",{className:"h-4 w-px bg-border-default"}),l&&jsxRuntime.jsx(Vs,{count:l.count,label:l.label,isLoading:l.isLoading}),l&&c&&jsxRuntime.jsx("div",{className:"h-4 w-px bg-border-default"}),c&&jsxRuntime.jsx(Os,{value:c.value,options:c.options,onChange:c.onChange,showLabel:c.showLabel,direction:c.direction,onDirectionChange:c.onDirectionChange}),u?jsxRuntime.jsx(re,{variant:"secondary",size:"sm",icon:"Columns",onClick:u,children:"Columns"}):p,S&&o&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[r.slice(0,s).map(R=>jsxRuntime.jsxs(bo,{variant:"primary",size:"sm",onRemove:()=>o(R.id),isRemovable:true,children:[R.label,": ",R.value]},R.id)),r.length>s&&a&&jsxRuntime.jsxs(re,{variant:"ghost",size:"sm",onClick:a,className:"text-text-secondary hover:text-text-primary whitespace-nowrap",children:["+",r.length-s," more"]}),n&&jsxRuntime.jsx(re,{variant:"ghost",size:"sm",onClick:n,className:"text-text-secondary hover:text-text-primary whitespace-nowrap",children:"Clear all"})]})]}),jsxRuntime.jsx("div",{className:"flex items-center gap-3 flex-shrink-0",children:m||jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[f&&f.items.length>0&&jsxRuntime.jsx(jsxRuntime.Fragment,{children:f.items.map(R=>jsxRuntime.jsx(re,{variant:R.variant||"secondary",size:"sm",icon:R.icon,onPress:R.onClick,isDisabled:R.disabled,children:R.label},R.id))}),e&&jsxRuntime.jsx("div",{className:"w-64",children:jsxRuntime.jsx(ha,{value:e.value,onChange:e.onChange,onClear:e.onClear,placeholder:e.placeholder,isLoading:e.isLoading})}),a&&jsxRuntime.jsx(re,{variant:"secondary",size:"sm",icon:"Sliders",badgeNumber:r.length>0?r.length:void 0,onClick:a,children:"Filters"}),i&&jsxRuntime.jsx(re,{variant:"secondary",size:"sm",icon:"Upload",onClick:i.onClick,isDisabled:i.isDisabled,children:i.label})]})})]}),jsxRuntime.jsxs("div",{className:"@[640px]:hidden",children:[jsxRuntime.jsx("div",{className:"flex flex-col gap-3 mb-3",children:jsxRuntime.jsx("div",{className:"flex items-center gap-3",children:m?jsxRuntime.jsx("div",{className:"flex-1",children:m}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[f&&f.items.length>0&&jsxRuntime.jsx(Qa,{items:f.items.map(R=>({id:R.id,name:R.label,iconName:R.icon,variant:R.variant==="destructive"?"destructive":"primary",disabled:R.disabled,onAction:R.onClick})),align:"left",size:"sm",children:jsxRuntime.jsx(re,{variant:"secondary",size:"sm",icon:"DotsThreeVertical","aria-label":f.menuLabel||"Actions"})}),e&&jsxRuntime.jsx("div",{className:"flex-1",children:jsxRuntime.jsx(ha,{value:e.value,onChange:e.onChange,onClear:e.onClear,placeholder:e.placeholder,isLoading:e.isLoading})}),a&&jsxRuntime.jsx(re,{variant:"secondary",size:"sm",icon:"Sliders",badgeNumber:r.length>0?r.length:void 0,onClick:a,"aria-label":`Filters${r.length>0?` (${r.length} active)`:""}`}),i&&jsxRuntime.jsx(re,{variant:"secondary",size:"sm",icon:"Upload",onClick:i.onClick,isDisabled:i.isDisabled,children:i.label})]})})}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[d,l&&jsxRuntime.jsx(Vs,{count:l.count,label:l.label,isLoading:l.isLoading})]}),jsxRuntime.jsx("div",{className:"flex items-center gap-2",children:c&&jsxRuntime.jsx(Os,{value:c.value,options:c.options,onChange:c.onChange,showLabel:false,direction:c.direction,onDirectionChange:c.onDirectionChange,compact:g!=="desktop"})})]})]})]})}function S0({filters:e,onRemove:t,onClearAll:r,onManageFilters:o,maxVisibleChips:n=3,mode:a="chips",showManageButton:i=true,size:s="sm",className:c=""}){let l=e.length>0,d=e.slice(0,n),u=Math.max(0,e.length-n),p=u>0,m=a==="button"&&!!o,f=a==="chips"&&i&&!!o;if(!l&&!m&&!f)return null;let g=m&&jsxRuntime.jsxs(re,{variant:"secondary",size:s,onClick:o,className:"whitespace-nowrap",children:[e.length," ",e.length===1?"filter":"filters"]}),b=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[f&&jsxRuntime.jsx(re,{variant:"secondary",size:s,icon:"Sliders",onClick:o,className:"whitespace-nowrap",children:"Filters"}),l&&d.map(h=>jsxRuntime.jsxs(bo,{variant:"secondary",size:s,onRemove:()=>t(h.id),isRemovable:true,children:[h.label,": ",h.value]},h.id)),l&&p&&o&&jsxRuntime.jsxs(re,{variant:"ghost",size:s,onClick:o,className:"text-text-secondary hover:text-text-primary whitespace-nowrap",children:["+",u," more"]}),l&&r&&jsxRuntime.jsx(re,{variant:"ghost",size:s,onClick:r,className:"text-text-secondary hover:text-text-primary whitespace-nowrap",children:"Clear all"})]}),x=a==="button"?g:b;return jsxRuntime.jsx("div",{className:`flex flex-wrap items-center gap-2 ${c}`,children:x})}function T0({label:e,description:t,errorMessage:r,size:o="md",tooltip:n,isRequired:a,isDisabled:i,isInvalid:s,showCalendar:c=true,reserveErrorSpace:l=true,validationResult:d,className:u,...p}){let[m,f]=He.useState(false),g=b=>{p.onChange&&b&&p.onChange(b),f(false);};return jsxRuntime.jsxs(reactAriaComponents.DateField,{...p,isDisabled:i,isRequired:a,isInvalid:s,className:ke(u,"flex flex-col gap-1"),children:[e&&jsxRuntime.jsx(ze,{size:o,tooltip:n,isRequired:a,children:e}),jsxRuntime.jsx(vt,{children:jsxRuntime.jsxs("div",{className:"relative w-full",children:[jsxRuntime.jsx(zs,{size:o,isDisabled:i,isInvalid:s,hasCalendar:c}),c&&!i&&jsxRuntime.jsxs(reactAriaComponents.DialogTrigger,{isOpen:m,onOpenChange:f,children:[jsxRuntime.jsx(re,{variant:"unstyled",className:"absolute right-2 top-1/2 -translate-y-1/2 flex h-8 w-8 items-center justify-center rounded hover:bg-background-hover text-text-secondary hover:text-text-primary transition-colors","aria-label":"Open calendar",children:jsxRuntime.jsx(U,{name:"Calendar",size:18})}),jsxRuntime.jsx(reactAriaComponents.Popover,{className:"bg-background-surface rounded-lg border border-border-default shadow-xl",children:jsxRuntime.jsx(reactAriaComponents.Dialog,{className:"p-4 outline-none",children:jsxRuntime.jsx(ri,{value:p.value,onChange:g,minValue:p.minValue,maxValue:p.maxValue,isDisabled:i,isReadOnly:p.isReadOnly,isDateUnavailable:p.isDateUnavailable})})})]})]})}),l?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof r=="string"?jsxRuntime.jsx(ge,{size:o,children:r}):typeof r=="function"&&d?jsxRuntime.jsx(ge,{size:o,children:r(d)}):t?jsxRuntime.jsx(Pe,{size:o,children:t}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof r=="string"?jsxRuntime.jsx(ge,{size:o,className:"mt-1",children:r}):typeof r=="function"&&d?jsxRuntime.jsx(ge,{size:o,className:"mt-1",children:r(d)}):t?jsxRuntime.jsx(Pe,{size:o,className:"mt-1",children:t}):null})]})}function KD({isPlaceholder:e,isDisabled:t,size:r="md"}){return tailwindMerge.twMerge("inline-block box-content px-0.5 rounded outline-none tabular-nums text-center transition-colors",{sm:"text-base md:text-xs",md:"text-base md:text-sm",lg:"text-base",xl:"text-lg"}[r],e?"text-text-disabled italic":"text-text-primary",t?"text-text-disabled cursor-not-allowed":"cursor-text",!t&&"hover:bg-background-hover","data-[focused]:bg-background-selected data-[focused]:text-text-primary")}function zs({size:e="md",isDisabled:t,isInvalid:r,hasCalendar:o,className:n,...a}){return jsxRuntime.jsx(reactAriaComponents.DateInput,{className:tailwindMerge.twMerge(an({isInvalid:r,isDisabled:t}),"px-3 py-2 flex items-center gap-0.5 w-full",o&&"pr-10",n),...a,children:i=>jsxRuntime.jsx(reactAriaComponents.DateSegment,{segment:i,className:KD({isPlaceholder:i.isPlaceholder,isDisabled:!i.isEditable||t,size:e})})})}function sd({label:e,description:t,errorMessage:r,...o}){return jsxRuntime.jsxs(reactAriaComponents.DateRangePicker,{...o,className:ke(o.className,"group flex flex-col gap-1"),children:[e&&jsxRuntime.jsx(ze,{children:e}),jsxRuntime.jsxs(rh,{className:"w-auto min-w-[208px]",children:[jsxRuntime.jsx(zs,{slot:"start",className:"px-2 py-1.5 text-sm"}),jsxRuntime.jsx("span",{"aria-hidden":"true",className:"text-text-primary group-disabled:text-text-disabled forced-colors:text-[ButtonText] group-disabled:forced-colors:text-[GrayText]",children:"\u2013"}),jsxRuntime.jsx(zs,{slot:"end",className:"flex-1 px-2 py-1.5 text-sm"}),jsxRuntime.jsx(re,{variant:"icon",className:"mr-1 w-6 rounded outline-offset-0",children:jsxRuntime.jsx(lucideReact.CalendarIcon,{"aria-hidden":true,className:"h-4 w-4"})})]}),t&&jsxRuntime.jsx(Pe,{children:t}),typeof r=="string"?jsxRuntime.jsx(ge,{children:r}):null,jsxRuntime.jsx(lt,{children:jsxRuntime.jsx(Ti,{})})]})}var e3=e=>{let t=Wt({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused,transparent:e.transparent,size:e.size});return tailwindMerge.twMerge(t,"pr-9","[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",e.className)};function Hs({label:e,description:t,errorMessage:r,size:o="md",tooltip:n,isRequired:a,transparent:i,validationResult:s,reserveErrorSpace:c=true,descriptionPlacement:l="below",...d}){let u=He.useId(),{isFocused:p,handleFocus:m,handleBlur:f}=Or();return jsxRuntime.jsx(reactAriaComponents.NumberField,{...d,id:u,isRequired:a,className:ke(d.className,"group flex flex-col gap-1"),step:d.step??1,onChange:g=>{typeof g=="number"&&(d.maxValue!=null&&g>d.maxValue?d.onChange?.(d.maxValue):d.minValue!=null&&g<d.minValue?d.onChange?.(d.minValue):d.onChange?.(g));},isInvalid:!!r||typeof d.value=="number"&&(d.maxValue!=null&&d.value>d.maxValue||d.minValue!=null&&d.value<d.minValue),children:({isDisabled:g,isInvalid:b})=>jsxRuntime.jsxs("div",{className:"flex flex-col gap-1",children:[e&&jsxRuntime.jsx(ze,{size:o,tooltip:n,description:l==="tooltip"||l==="inline"?t:void 0,descriptionPlacement:l,isRequired:a,htmlFor:u,children:e}),jsxRuntime.jsx("div",{className:"relative",children:jsxRuntime.jsxs(reactAriaComponents.Group,{className:"relative",children:[jsxRuntime.jsx(reactAriaComponents.Input,{onFocus:h=>m(h,d.onFocus),onBlur:h=>f(h,d.onBlur),className:e3({isInvalid:b||!!r,isDisabled:g,isFocused:p,transparent:i,size:o,className:typeof d.className=="string"?d.className:void 0})}),jsxRuntime.jsxs("div",{className:"absolute inset-y-[2px] right-[2px] flex flex-col divide-y divide-border-default border-l border-border-default overflow-hidden rounded-r-[calc(var(--control-border-radius)-2px)]",children:[jsxRuntime.jsx(reactAriaComponents.Button,{slot:"increment",isDisabled:g,className:"flex h-1/2 w-7 items-center justify-center bg-background-input hover:bg-background-input-hover active:bg-background-input-active disabled:cursor-not-allowed disabled:opacity-50",children:jsxRuntime.jsx(U,{name:"CaretUp",size:14})}),jsxRuntime.jsx(reactAriaComponents.Button,{slot:"decrement",isDisabled:g,className:"flex h-1/2 w-7 items-center justify-center bg-background-input hover:bg-background-input-hover active:bg-background-input-active disabled:cursor-not-allowed disabled:opacity-50",children:jsxRuntime.jsx(U,{name:"CaretDown",size:14})})]})]})}),c?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:r?jsxRuntime.jsx(ge,{size:o,children:typeof r=="function"?r(s):r}):t&&l==="below"?jsxRuntime.jsx(Pe,{size:o,children:t}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:r?jsxRuntime.jsx(ge,{size:o,className:"mt-1",children:typeof r=="function"?r(s):r}):t&&l==="below"?jsxRuntime.jsx(Pe,{size:o,className:"mt-1",children:t}):null})]})})}var Pf={sm:{track:"h-4 w-7",handle:"h-3.5 w-3.5",text:"text-xs"},md:{track:"h-5 w-9",handle:"h-4 w-4",text:"text-sm"},lg:{track:"h-6 w-11",handle:"h-5 w-5",text:"text-base"},xl:{track:"h-7 w-14",handle:"h-6 w-6",text:"text-lg"}};function o3({isSelected:e,isDisabled:t,size:r="md"}){let o="flex px-px items-center shrink-0 cursor-default rounded-full transition duration-200 ease-in-out shadow-inner border border-transparent",n=Pf[r].track,a=$e,i="focus-visible:outline-action-primary",s="";return e?s="bg-action-primary forced-colors:!bg-[Highlight] group-pressed:bg-action-primary-hover":s="bg-border-input group-pressed:bg-border-focus",[o,n,a,i,s,t?"bg-background-muted forced-colors:group-selected:!bg-[GrayText] forced-colors:border-[GrayText]":""].filter(Boolean).join(" ")}function n3({isSelected:e,isDisabled:t,size:r="md"}){let o="transform rounded-full bg-background-surface outline-none shadow transition duration-200 ease-in-out",n=Pf[r].handle;return [o,n,e?"translate-x-[100%]":"translate-x-0",t?"forced-colors:outline-[GrayText]":""].filter(Boolean).join(" ")}function ld({children:e,variant:t="primary",size:r="md",...o}){return jsxRuntime.jsx(reactAriaComponents.Switch,{...o,className:ke(o.className,`group flex items-center gap-2 ${Pf[r].text} text-text-primary transition disabled:text-text-disabled forced-colors:disabled:text-[GrayText]`),children:n=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:o3({...n,size:r}),children:jsxRuntime.jsx("span",{className:n3({...n,size:r})})}),e]})})}function P0(e){return new Intl.NumberFormat("en-US").format(e)}function R0({isOpen:e,onClose:t,facetConfigs:r,facetCounts:o={},currentFilters:n,onApply:a,onClear:i,title:s="Filters",resultCount:c}){let[l,d]=He.useState(n),[u,p]=He.useState({}),[m,f]=He.useState({}),[g,b]=He.useState(null),{isMobile:x}=_t(),h=He.useMemo(()=>r.some(C=>C.group),[r]),{groups:y,ungroupedFacets:v,facetsByGroup:S}=He.useMemo(()=>{let C=new Set,W=[],G={};for(let F of r)F.group?(C.has(F.group)||(C.add(F.group),G[F.group]=[]),G[F.group].push(F)):W.push(F);return {groups:Array.from(C),ungroupedFacets:W,facetsByGroup:G}},[r]);He.useEffect(()=>{e&&(d(n),p({}),f({}),b(!x&&y.length>0?y[0]:null));},[e,n,y,x]);let w=He.useMemo(()=>!l||nd(l)?0:xa(l).length,[l]),N=()=>{a(l),t();},D=()=>{let C=Bs();d(C),i?i():a(C),t();},R=C=>{if(!l)return [];if(!xa(l).includes(C))return [];let G=[];function F(Z){if(Z)for(let _ of Z.conditions)"conditions"in _?F(_):_.field===C&&_.operator==="in"&&Array.isArray(_.value)&&G.push(..._.value.map(String));}return F(l),G},A=(C,W,G)=>{let F=ba(l,C);W!==void 0&&(F=Sn(F,{field:C,operator:"gte",value:W})),G!==void 0&&(F=Sn(F,{field:C,operator:"lte",value:G})),d(F);},O=C=>{if(!l)return;let W;function G(F){if(F)for(let Z of F.conditions)"conditions"in Z?G(Z):Z.field===C&&Z.operator==="eq"&&typeof Z.value=="boolean"&&(W=Z.value);}return G(l),W},P=(C,W)=>{let G=ba(l,C);W!==void 0&&(G=Sn(G,{field:C,operator:"eq",value:W})),d(G);},T=(C,W,G)=>{let F=ba(l,C);W&&(F=Sn(F,{field:C,operator:"gte",value:W.toString()})),G&&(F=Sn(F,{field:C,operator:"lte",value:G.toString()})),d(F);},k=C=>{let W=S[C]||[],G=l?xa(l):[];return W.filter(F=>G.includes(F.field)).length},V="pr-9 bg-background-muted/50",H="border-t border-border-muted",I="text-sm font-medium text-text-link-default",q=C=>jsxRuntime.jsx("span",{className:I,children:C}),j=C=>{let W=o[C.field]||{},G=u[C.field]||"",F=[];C.values?F=C.values.map(L=>({value:String(L.value),label:L.label,count:W[String(L.value)]})):F=Object.entries(W).map(([L,oe])=>({value:L,label:L,count:oe}));let Z=F.length;if(G){let L=G.toLowerCase();F=F.filter(oe=>oe.label.toLowerCase().includes(L));}F.sort((L,oe)=>L.count!==void 0&&oe.count!==void 0&&oe.count!==L.count?oe.count-L.count:L.label.localeCompare(oe.label));let _=C.type||"string";if(_==="string"||!C.type){let L=R(C.field),oe=C.searchThreshold??10,ie=C.maxVisibleOptions??50,ne=m[C.field]??false,ae=ne||F.length<=ie?F:F.slice(0,ie),ce=F.length>ie&&!ne;return jsxRuntime.jsxs(dn,{id:C.field,children:[jsxRuntime.jsx(un,{title:C.label,description:C.description,className:V,endContent:L.length>0?q(`${L.length} selected`):void 0}),jsxRuntime.jsx(pn,{className:H,children:jsxRuntime.jsxs("div",{className:"space-y-4 pt-4 pb-4",children:[Z>oe&&jsxRuntime.jsx(ha,{value:G,onChange:Ce=>p(te=>({...te,[C.field]:Ce})),onClear:()=>p(Ce=>({...Ce,[C.field]:""})),placeholder:`Search ${C.label.toLowerCase()}...`,size:"sm",className:"w-full !max-w-none pr-4"}),jsxRuntime.jsx(vm,{value:L,onChange:Ce=>{let te=ba(l,C.field);Ce.length>0&&(te=Sn(te,{field:C.field,operator:"in",value:Ce})),d(te);},children:jsxRuntime.jsx("div",{className:"space-y-1.5",children:ae.map(Ce=>jsxRuntime.jsx("div",{className:"rounded-md py-2 pr-4 transition-colors hover:bg-background-hover",children:jsxRuntime.jsx(Zn,{value:Ce.value,children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-3 flex-1",children:[C.renderLabel?C.renderLabel(Ce.value,Ce.label):jsxRuntime.jsx("span",{className:"text-sm font-medium text-text-primary",children:Ce.label}),Ce.count!==void 0&&jsxRuntime.jsx("span",{className:"text-xs font-medium text-text-secondary tabular-nums",children:P0(Ce.count)})]})})},Ce.value))})}),ce&&jsxRuntime.jsx("div",{className:"pt-2 border-t border-border-muted",children:jsxRuntime.jsxs(re,{variant:"ghost",size:"sm",onPress:()=>f(Ce=>({...Ce,[C.field]:true})),className:"w-full",children:["Show all ",F.length," options"]})}),ne&&F.length>ie&&jsxRuntime.jsx("div",{className:"pt-2 border-t border-border-muted",children:jsxRuntime.jsx(re,{variant:"ghost",size:"sm",onPress:()=>f(Ce=>({...Ce,[C.field]:false})),className:"w-full",children:"Show less"})})]})})]},C.field)}if(_==="number"){let L,oe,ie=ae=>{if(ae)for(let ce of ae.conditions)"conditions"in ce?ie(ce):ce.field===C.field&&(ce.operator==="gte"&&typeof ce.value=="number"&&(L=ce.value),ce.operator==="lte"&&typeof ce.value=="number"&&(oe=ce.value));};ie(l);let ne=L!==void 0||oe!==void 0;return jsxRuntime.jsxs(dn,{id:C.field,children:[jsxRuntime.jsx(un,{title:C.label,description:C.description,className:V,endContent:ne?q(L!==void 0&&oe!==void 0?`${L} - ${oe}`:L!==void 0?`\u2265 ${L}`:`\u2264 ${oe}`):void 0}),jsxRuntime.jsx(pn,{className:H,children:jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-4 pt-4 pb-4",children:[jsxRuntime.jsx(Hs,{label:"Min",value:L,onChange:ae=>A(C.field,ae,oe)},`${C.field}-min`),jsxRuntime.jsx(Hs,{label:"Max",value:oe,onChange:ae=>A(C.field,L,ae)},`${C.field}-max`)]})})]},C.field)}if(_==="boolean"){let L=O(C.field);return jsxRuntime.jsxs(dn,{id:C.field,children:[jsxRuntime.jsx(un,{title:C.label,description:C.description,className:V,endContent:L!==void 0?q(L?"Yes":"No"):void 0}),jsxRuntime.jsx(pn,{className:H,children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between pt-4 pb-4",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium text-text-primary",children:L!==void 0?L?"Enabled":"Disabled":"No filter applied"}),jsxRuntime.jsx(ld,{size:"lg",isSelected:L??false,onChange:oe=>P(C.field,oe?true:void 0),children:L?"Yes":"No"})]})})]},C.field)}if(_==="date"){let L,oe,ie=te=>{if(te)for(let ye of te.conditions)"conditions"in ye?ie(ye):ye.field===C.field&&(ye.operator==="gte"&&(L=String(ye.value)),ye.operator==="lte"&&(oe=String(ye.value)));};ie(l);let ne=L!==void 0||oe!==void 0,ae=te=>{if(te)try{return /^\d{4}-\d{2}-\d{2}$/.test(te)?ls(te):void 0}catch{return}},ce=ae(L),Ce=ae(oe);return jsxRuntime.jsxs(dn,{id:C.field,children:[jsxRuntime.jsx(un,{title:C.label,description:C.description,className:V,endContent:ne?q("Date range selected"):void 0}),jsxRuntime.jsx(pn,{className:H,children:jsxRuntime.jsx("div",{className:"pt-4 pb-4",children:jsxRuntime.jsx(sd,{label:"Date Range",value:ce&&Ce?{start:ce,end:Ce}:void 0,onChange:te=>{te?T(C.field,te.start,te.end):T(C.field,void 0,void 0);}})})})]},C.field)}return null},K=()=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[v.map(C=>{let G=(l?xa(l):[]).includes(C.field);return jsxRuntime.jsxs("button",{type:"button",onClick:()=>b(`__ungrouped__${C.field}`),className:"flex items-center justify-between px-6 py-3 text-left hover:bg-background-hover border-b border-border-muted transition-colors",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium text-text-primary",children:C.label}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[G&&jsxRuntime.jsx("span",{className:I,children:"1 active"}),jsxRuntime.jsx(U,{name:"CaretRight",size:"sm",className:"text-text-secondary"})]})]},C.field)}),y.map(C=>{let W=k(C);return jsxRuntime.jsxs("button",{type:"button",onClick:()=>b(C),className:"flex items-center justify-between px-6 py-3 text-left hover:bg-background-hover border-b border-border-muted transition-colors",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium text-text-primary",children:C}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[W>0&&jsxRuntime.jsxs("span",{className:I,children:[W," active"]}),jsxRuntime.jsx(U,{name:"CaretRight",size:"sm",className:"text-text-secondary"})]})]},C)})]}),Y=C=>{if(C.startsWith("__ungrouped__")){let G=C.replace("__ungrouped__",""),F=v.find(Z=>Z.field===G);return F?jsxRuntime.jsx(oi,{variant:"contained",density:"comfortable",showDividers:true,defaultExpandedKeys:[F.field],children:j(F)}):null}let W=S[C]||[];return W.length===0?null:jsxRuntime.jsx(oi,{variant:"contained",density:"comfortable",showDividers:true,defaultExpandedKeys:[W[0].field],children:W.map(G=>j(G))})},M=()=>{if(g){let C=g.startsWith("__ungrouped__")&&v.find(W=>W.field===g.replace("__ungrouped__",""))?.label||g;return jsxRuntime.jsxs("div",{className:"flex flex-col h-full",children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>b(null),className:"flex items-center gap-2 px-4 py-3 border-b border-border-muted hover:bg-background-hover transition-colors",children:[jsxRuntime.jsx(U,{name:"CaretLeft",size:"sm",className:"text-text-secondary"}),jsxRuntime.jsx("span",{className:"text-sm font-medium text-text-primary",children:C})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto",children:Y(g)})]})}return K()},E=()=>jsxRuntime.jsxs("div",{className:"flex h-full",children:[jsxRuntime.jsxs("div",{className:"w-48 flex-shrink-0 border-r border-border-muted overflow-y-auto bg-background-muted/30",children:[v.map(C=>{let G=(l?xa(l):[]).includes(C.field),F=g===`__ungrouped__${C.field}`;return jsxRuntime.jsxs("button",{type:"button",onClick:()=>b(`__ungrouped__${C.field}`),className:`flex items-center justify-between w-full px-4 py-3 text-left border-b border-border-muted transition-colors ${F?"bg-background-selected":"hover:bg-background-hover"}`,children:[jsxRuntime.jsx("span",{className:`text-sm truncate ${F?"font-semibold text-text-primary":"font-medium text-text-primary"}`,children:C.label}),G&&jsxRuntime.jsx("span",{className:"w-2 h-2 rounded-full bg-action-primary flex-shrink-0 ml-2"})]},C.field)}),y.map(C=>{let W=k(C),G=g===C;return jsxRuntime.jsxs("button",{type:"button",onClick:()=>b(C),className:`flex items-center justify-between w-full px-4 py-3 text-left border-b border-border-muted transition-colors ${G?"bg-background-selected":"hover:bg-background-hover"}`,children:[jsxRuntime.jsx("span",{className:`text-sm truncate ${G?"font-semibold text-text-primary":"font-medium text-text-primary"}`,children:C}),W>0&&jsxRuntime.jsx("span",{className:"w-2 h-2 rounded-full bg-action-primary flex-shrink-0 ml-2"})]},C)})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto",children:g?Y(g):jsxRuntime.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-sm",children:"Select a category to view filters"})})]}),z=()=>jsxRuntime.jsx(oi,{variant:"contained",density:"comfortable",showDividers:true,defaultExpandedKeys:[r[0].field],children:r.map(C=>j(C))});return jsxRuntime.jsx(Ir,{isOpen:e,onClose:t,title:h&&x&&g?g.startsWith("__ungrouped__")?v.find(C=>C.field===g.replace("__ungrouped__",""))?.label||s:g:w>0?`${s} (${w} active)`:s,hideCloseIcon:false,primaryAction:{label:"Apply filters",onPress:N,variant:"primary"},secondaryAction:{label:"Clear all",onPress:D},maxWidth:h?"800px":"700px",height:"600px",mobileHeight:"85vh",contentPadding:false,footerContent:c!==void 0?jsxRuntime.jsxs("div",{className:"text-sm text-text-secondary text-center",children:[jsxRuntime.jsx("span",{className:"font-semibold text-text-primary",children:P0(c)})," ",c===1?"result":"results"," with current filters"]}):void 0,children:r.length===0?jsxRuntime.jsx("div",{className:"py-12 text-center",children:jsxRuntime.jsx("div",{className:"text-sm font-medium text-text-secondary",children:"No filters available"})}):h?x?M():E():z()})}function Mf(e="left"){switch(e){case "center":return "justify-center text-center";case "right":return "justify-end text-right";default:return "justify-start text-left"}}function Ur(e="normal",t){return tailwindMerge.twMerge({strong:"font-semibold text-text-primary",high:"font-semibold text-text-primary",normal:"text-text-primary",low:"text-text-secondary"}[e],t&&"hover:text-action-primary cursor-pointer transition-colors")}function Me(e="left",t){return tailwindMerge.twMerge("flex items-center gap-1 min-w-0 overflow-hidden",Mf(e),t)}function ud(e,t="\u2014"){return e==null||e===""?t:String(e)}var wn={xs:"h-4 w-12",sm:"h-4 w-20",md:"h-4 w-24",lg:"h-4 w-32",xl:"h-4 w-40"};function mr(e="normal"){return {strong:wn.lg,high:wn.lg,normal:wn.md,low:wn.sm}[e]}function we(e,t){return typeof e=="function"?e(t):e}function M0(e="neutral",t="sm"){return tailwindMerge.twMerge("inline-flex items-center rounded-full font-medium",t==="sm"?"px-2 py-0.5 text-xs":"px-2.5 py-1 text-sm",{success:"bg-feedback-success-background text-feedback-success-text",error:"bg-feedback-error-background text-feedback-error-text",warning:"bg-feedback-warning-background text-feedback-warning-text",info:"bg-feedback-info-background text-feedback-info-text",neutral:"bg-background-muted text-text-secondary"}[e])}function D0(e){return e?"success":"neutral"}function pd(e,t=false){return t?e>0?"text-feedback-success-text":e<0?"text-feedback-error-text":"text-text-primary":"text-text-primary"}function Df(e="hover",t="secondary"){let r={primary:"text-action-primary hover:text-action-primary-hover visited:text-action-primary",secondary:"text-text-link-default hover:text-text-link-hover visited:text-text-link-default",default:"text-text-link-default hover:text-text-link-hover visited:text-text-link-default",brand:"text-action-primary hover:text-action-primary-hover visited:text-action-primary",muted:"text-text-secondary hover:text-text-secondary visited:text-text-secondary",unstyled:""},o={visible:"underline underline-offset-4 decoration-1 cursor-pointer",hover:"hover:underline hover:underline-offset-4 hover:decoration-1 cursor-pointer transition-colors",none:"cursor-pointer"},n=r[t],a=o[e]||"";return `${n} ${a}`.trim()}function To(e,t,r,o="hover",n="secondary",a,i){if(!t)return e;let s=typeof t=="function"&&r?t(r):t,c=Df(o,n);return jsxRuntime.jsx("a",{href:s,className:tailwindMerge.twMerge(c,a==="strong"||a==="high"?"font-semibold":"",i),onClick:d=>{d.metaKey||d.ctrlKey;},children:e})}function E0({row:e,context:t,actions:r,align:o="right",size:n="sm"}){let{isLoading:a}=t;if(a)return jsxRuntime.jsx(J,{className:wn.sm});let s=(typeof r=="function"?r(e):r).filter(l=>!we(l.hidden,e));if(s.length===0)return null;let c=Me(o);return jsxRuntime.jsx("div",{className:c,children:s.map(l=>{let d=we(l.disabled,e);return l.variant==="icon"||!l.label?jsxRuntime.jsx(re,{variant:"icon",size:n,onPress:()=>{l.onClick(e);},isDisabled:d,"aria-label":l.label||l.id,children:jsxRuntime.jsx(U,{name:l.icon||"DotsThree",size:n==="sm"?16:20})},l.id):jsxRuntime.jsxs(re,{variant:l.variant||"secondary",size:n,onPress:()=>{l.onClick(e);},isDisabled:d,children:[l.icon&&jsxRuntime.jsx(U,{name:l.icon,size:n==="sm"?14:16}),l.label]},l.id)})})}function A0({value:e,row:t,context:r,variant:o="default",label:n,size:a="sm",shape:i="square",dot:s,dotPosition:c="left",dotPulse:l,align:d="left",emptyText:u="\u2014",className:p,maxVisible:m=2,maxLabelLength:f}){let{isLoading:g}=r,b=(w,N)=>{if(!f||w.length<=f)return jsxRuntime.jsx(jsxRuntime.Fragment,{children:w});let D=w.slice(0,f-1)+"\u2026";return jsxRuntime.jsx(nr,{content:N,children:jsxRuntime.jsx("span",{children:D})})};if(g)return jsxRuntime.jsx(J,{className:mr("normal")});if(e==null||e==="")return jsxRuntime.jsx("div",{className:Me(d,"text-text-secondary"),children:u});if(Array.isArray(e)&&e.length===0)return jsxRuntime.jsx("div",{className:Me(d,"text-text-secondary"),children:u});let x=Me(d,p);if(Array.isArray(e)){let w=e.slice(0,m),N=e.slice(m),D=N.length>0;return jsxRuntime.jsx("div",{className:x,children:jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[w.map((R,A)=>{let O=typeof o=="function"?o(R,t):o,P=typeof n=="function"?n(R,t):n!==void 0?n:String(R),T=typeof s=="function"?s(R,t):s,k=typeof l=="function"?l(R,t):l;return jsxRuntime.jsx("span",{className:"flex-shrink-0 whitespace-nowrap",children:jsxRuntime.jsx(at,{variant:O,size:a,shape:i,dot:T,dotPosition:c,dotPulse:k,children:b(P,P)})},A)}),D&&jsxRuntime.jsx(nr,{content:N.join(", "),children:jsxRuntime.jsx("span",{className:"flex-shrink-0 whitespace-nowrap",children:jsxRuntime.jsxs(at,{variant:"neutral",size:a,shape:i,children:["+",N.length]})})})]})})}let h=typeof o=="function"?o(e,t):o,y=typeof n=="function"?n(e,t):n!==void 0?n:String(e),v=typeof s=="function"?s(e,t):s,S=typeof l=="function"?l(e,t):l;return jsxRuntime.jsx("div",{className:x,children:jsxRuntime.jsx(at,{variant:h,size:a,shape:i,dot:v,dotPosition:c,dotPulse:S,children:b(y,y)})})}function I0({value:e,context:t,format:r="icon",trueText:o="Yes",falseText:n="No",trueIcon:a="Check",falseIcon:i="X",showFalse:s=true,align:c="center",emphasis:l="normal",className:d}){let{isLoading:u}=t;if(u)return jsxRuntime.jsx(J,{className:mr(l)});let p=!!e;if(!p&&!s)return jsxRuntime.jsx("div",{className:Me(c,d)});let m=Me(c,d);switch(r){case "icon":return jsxRuntime.jsx("div",{className:m,children:jsxRuntime.jsx(U,{name:p?a:i,size:16,className:p?"text-feedback-success-text":"text-text-disabled"})});case "text":return jsxRuntime.jsx("div",{className:m,children:jsxRuntime.jsx("span",{className:Ur(l),children:p?o:n})});case "badge":return jsxRuntime.jsx("div",{className:m,children:jsxRuntime.jsx(at,{variant:p?"success":"neutral",size:"sm",children:p?o:n})});default:return null}}function B0({row:e,context:t,firstName:r,lastName:o,email:n,avatarUrl:a,layout:i="stacked",size:s="sm",href:c,LinkComponent:l,linkVariant:d="secondary",showEmail:u=false,badge:p,emphasis:m="normal",align:f="left",className:g,piiEntity:b}){let{isLoading:x}=t,h=we(r,e),y=we(o,e),v=we(n,e),S=we(a,e),w=we(c,e),N=typeof p=="function"?p(e):p,D=we(b,e),R=Me(f,g);return jsxRuntime.jsx("div",{className:R,children:jsxRuntime.jsx(fc,{firstName:h,lastName:y,email:v,avatarUrl:S,layout:i,size:s,href:w,LinkComponent:l,linkVariant:d,showEmail:u,badge:N,emphasis:m,isLoading:x,piiEntity:D})})}function V0({value:e,row:t,context:r,render:o,className:n}){let a=o(e,t,r);return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("h-full w-full",n),children:a})}function O0({value:e,row:t,context:r,format:o="date",customFormat:n,emptyText:a="\u2014",align:i="left",emphasis:s="normal",href:c,linkBehavior:l="hover",className:d}){let{isLoading:u}=r;if(u)return jsxRuntime.jsx(J,{className:mr(s)});if(!e)return jsxRuntime.jsx("div",{className:Me(i,"text-text-secondary"),children:a});let p=e instanceof Date?e:new Date(e);if(isNaN(p.getTime()))return jsxRuntime.jsx("div",{className:Me(i,"text-text-secondary"),children:a});let m;switch(o){case "date":m=p.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"});break;case "time":m=p.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});break;case "datetime":m=p.toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});break;case "relative":m=f3(p);break;case "custom":m=n?p.toLocaleString("en-US",n):p.toISOString();break;default:m=p.toLocaleDateString();}let f=Me(i,tailwindMerge.twMerge(Ur(s),d)),g=we(c,t);return g?jsxRuntime.jsx("div",{className:f,children:To(m,g,t,l)}):jsxRuntime.jsx("div",{className:f,children:m})}function f3(e){let r=new Date().getTime()-e.getTime(),o=Math.floor(r/1e3),n=Math.floor(o/60),a=Math.floor(n/60),i=Math.floor(a/24);return o<60?"just now":n<60?`${n} minute${n!==1?"s":""} ago`:a<24?`${a} hour${a!==1?"s":""} ago`:i<7?`${i} day${i!==1?"s":""} ago`:e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function md({manufacturer:e,model:t,deviceType:r,deviceTypeIconName:o,logoUrl:n,layout:a="stacked",size:i="md",href:s,LinkComponent:c,linkVariant:l="unstyled",showDeviceTypeIcon:d=true,showLogo:u=true,emphasis:p="normal",isLoading:m=false,className:f,piiEntity:g}){let[b,x]=He.useState(false),h=o||(r?b3(r):"DeviceMobile"),v={xs:{iconSize:28,logoSize:"w-7 h-7",gap:"gap-1.5",textSize:"text-xs",secondaryTextSize:"text-xs",iconInTextSize:12,skeletonIcon:28,skeletonText:80,skeletonSecondary:60},sm:{iconSize:32,logoSize:"w-8 h-8",gap:"gap-2",textSize:"text-sm",secondaryTextSize:"text-xs",iconInTextSize:14,skeletonIcon:32,skeletonText:96,skeletonSecondary:72},md:{iconSize:32,logoSize:"w-9 h-9",gap:"gap-3",textSize:"text-base",secondaryTextSize:"text-sm",iconInTextSize:16,skeletonIcon:36,skeletonText:128,skeletonSecondary:96},lg:{iconSize:40,logoSize:"w-10 h-10",gap:"gap-3",textSize:"text-lg",secondaryTextSize:"text-base",iconInTextSize:18,skeletonIcon:40,skeletonText:160,skeletonSecondary:120}}[i],S=n&&!b&&u,N={strong:"font-semibold text-text-primary",high:"font-semibold text-text-primary",normal:"text-text-primary",low:"text-text-secondary"}[p],D=({children:R,className:A})=>s?c?jsxRuntime.jsx(c,{href:s,className:A,children:R}):jsxRuntime.jsx(tt,{href:s,variant:l,className:tailwindMerge.twMerge("hover:underline",A),asButton:false,children:R}):jsxRuntime.jsx("span",{className:A,children:R});if(m)return a==="inline"?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center",v.gap,f),children:[jsxRuntime.jsx(J,{width:v.skeletonIcon,height:v.skeletonIcon,className:"flex-shrink-0 rounded"}),jsxRuntime.jsx(J,{width:v.skeletonText,height:v.skeletonIcon*.6})]}):jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center",v.gap,f),children:[jsxRuntime.jsx(J,{width:v.skeletonIcon,height:v.skeletonIcon,className:"flex-shrink-0"}),jsxRuntime.jsxs("div",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx(J,{width:v.skeletonText,height:16}),jsxRuntime.jsx(J,{width:v.skeletonSecondary,height:12})]})]});if(a==="inline"){let R=`${e} ${t}`;return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center",v.gap,f),children:[jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-shrink-0 flex items-center justify-center rounded border border-border-muted",v.logoSize),children:S?jsxRuntime.jsx("img",{src:n,alt:`${e} logo`,className:"w-full h-full object-contain",onError:()=>x(true)}):jsxRuntime.jsx(U,{name:h,size:v.iconSize*.6,className:"text-text-secondary"})}),jsxRuntime.jsx(D,{className:tailwindMerge.twMerge("truncate leading-normal hover:text-text-primary",N,v.textSize,s&&"hover:underline hover:decoration-1 hover:underline-offset-4"),children:jsxRuntime.jsx("span",{"data-pii-type":g?"device-name":void 0,"data-pii-entity":g,children:R})})]})}return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center justify-start",v.gap,f),children:[u&&jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-shrink-0 flex items-center justify-center rounded border border-border-muted",v.logoSize),children:S?jsxRuntime.jsx("img",{src:n,alt:`${e} logo`,className:"w-full h-full object-contain",onError:()=>x(true)}):jsxRuntime.jsx(U,{name:h,size:v.iconSize*.6,className:"text-text-secondary"})}),jsxRuntime.jsxs("div",{className:"flex flex-col items-start min-w-0",children:[jsxRuntime.jsx(D,{className:tailwindMerge.twMerge("truncate leading-normal hover:text-text-primary",N,v.textSize,s&&"hover:underline hover:decoration-1 hover:underline-offset-4"),children:jsxRuntime.jsx("span",{"data-pii-type":g?"device-name":void 0,"data-pii-entity":g,children:e})}),jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center gap-1.5 text-text-secondary leading-normal",v.secondaryTextSize),children:[d&&jsxRuntime.jsx(U,{name:h,size:v.iconInTextSize,className:"flex-shrink-0"}),jsxRuntime.jsx("span",{className:"truncate","data-pii-type":g?"device-name":void 0,"data-pii-entity":g,children:t})]})]})]})}function b3(e){switch(e){case "battery":return "BatteryHigh";case "charger":return "ChargingStation";case "inverter":return "Power";case "thermostat":return "ThermometerSimple";case "vehicle":return "CarSimple";case "water_heater":return "DropHalfBottom";case "meter":return "Gauge";default:return "DeviceMobile"}}function H0({row:e,context:t,manufacturer:r,model:o,deviceType:n,logoUrl:a,layout:i="stacked",size:s="sm",href:c,LinkComponent:l,linkVariant:d="secondary",showDeviceTypeIcon:u=true,showLogo:p=true,emphasis:m="normal",align:f="left",className:g,piiEntity:b}){let{isLoading:x}=t,h=we(r,e),y=we(o,e),v=we(n,e),S=we(a,e),w=we(c,e),N=we(b,e),D=Me(f,g);return jsxRuntime.jsx("div",{className:D,children:jsxRuntime.jsx(md,{manufacturer:h,model:y,deviceType:v,logoUrl:S,layout:i,size:s,href:w,LinkComponent:l,linkVariant:d,showDeviceTypeIcon:u,showLogo:p,emphasis:m,isLoading:x,piiEntity:N})})}var Ree={charging:"percentage",discharging:"percentage",on:"kW",idle:void 0,off:void 0,heat:"temperature",cool:"temperature",auto:"temperature",eco:"temperature",unknown:void 0,connected:void 0,disconnected:void 0},x3=["charging","discharging","heat","cool","on","connected"],h3={unknown:"Unknown",on:"On",off:"Off",idle:"Idle",charging:"Charging",discharging:"Discharging",heat:"Heating",eco:"Eco Mode",cool:"Cooling",auto:"Auto",connected:"Connected",disconnected:"Disconnected"};function Ef(e){return x3.includes(e)}function Lf(e){return h3[e]}function va({state:e,label:t,icon:r,isLoading:o,size:n="sm",shape:a="pill",dot:i,dotPulse:s,fixedWidth:c,className:l,...d}){if(o)return jsxRuntime.jsx(J,{className:"inline-flex h-6 w-20"});let u=t??Lf(e),p=Ef(e);return jsxRuntime.jsxs(at,{variant:e,size:n,shape:a,dot:i??p,dotPulse:s??p,className:c?`w-28 justify-center ${l||""}`:l,...d,children:[r&&jsxRuntime.jsx(U,{name:r,size:n==="sm"?12:n==="md"?14:16}),u]})}var v3={importing:"Importing",exporting:"Exporting"};function G0(e){return v3[e]}function gd({state:e,label:t,showIcon:r=false,isLoading:o,size:n="sm",shape:a="pill",fixedWidth:i,className:s,...c}){if(o)return jsxRuntime.jsx(J,{className:"inline-flex h-6 w-24"});let l=t??G0(e),d=e==="exporting"?"ArrowUp":"ArrowDown",u=n==="sm"?12:n==="md"?14:16;return r?jsxRuntime.jsx(at,{variant:e,size:n,shape:a,className:`w-6 justify-center ${s||""}`,...c,children:jsxRuntime.jsx(U,{name:d,size:u})}):jsxRuntime.jsx(at,{variant:e,size:n,shape:a,className:i?`w-28 justify-center ${s||""}`:s,...c,children:l})}function bd({state:e,stateLabel:t,metric:r,metricFormatter:o,secondaryState:n,layout:a="horizontal",isLoading:i,size:s="sm",shape:c="pill",icon:l,fixedWidth:d,secondaryStateIconOnly:u=false,className:p}){if(i)return jsxRuntime.jsx(J,{className:tailwindMerge.twMerge("inline-flex h-6 w-32",p)});let m=r!=null&&o?jr(r,o):null,f=a==="horizontal",g=o&&!m;return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("inline-flex items-center",f?"gap-2":"flex-col gap-1",p),children:[(m||g)&&jsxRuntime.jsx("span",{className:tailwindMerge.twMerge("font-medium inline-block",m?"text-text-primary":"text-text-secondary",s==="sm"&&"text-xs min-w-12",s==="md"&&"text-sm min-w-14",s==="lg"&&"text-base min-w-16"),children:m||"\u2014"}),jsxRuntime.jsx(va,{state:e,label:t,icon:l,size:s,shape:c,fixedWidth:d}),n&&jsxRuntime.jsx(jsxRuntime.Fragment,{children:n==="importing"||n==="exporting"?jsxRuntime.jsx(gd,{state:n,size:s,shape:c,fixedWidth:d,showIcon:u}):jsxRuntime.jsx(va,{state:n,size:s,shape:c,fixedWidth:d})})]})}function U0({value:e,row:t,context:r,metric:o,metricFormatter:n,secondaryState:a,size:i="sm",shape:s="pill",label:c,icon:l,fixedWidth:d=true,align:u="left",compact:p=false,className:m}){let{isLoading:f}=r;if(f){let v={pill:"rounded-full",rounded:"rounded-lg",square:"rounded-sm"}[s],S=o!=null||n!=null;return jsxRuntime.jsx("div",{className:"flex items-center gap-2",children:S?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(J,{className:"h-4 w-12"}),jsxRuntime.jsx(J,{className:`h-6 w-24 ${v}`}),jsxRuntime.jsx(J,{className:`h-6 w-20 ${v}`})]}):jsxRuntime.jsx(J,{className:`h-6 w-24 ${v}`})})}if(!e)return jsxRuntime.jsx("div",{className:Me(u,m),children:jsxRuntime.jsx("span",{className:"text-text-secondary",children:"\u2014"})});let g=we(o,t),b=we(a,t),x=typeof c=="function"?c(e,t):c,h=Me(u,m);return g!=null||n?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(h),children:jsxRuntime.jsx(bd,{state:e,stateLabel:x,metric:g,metricFormatter:n,secondaryState:b||void 0,size:i,shape:s,icon:l,fixedWidth:d,secondaryStateIconOnly:p,layout:"horizontal"})}):jsxRuntime.jsx("div",{className:h,children:jsxRuntime.jsx(va,{state:e,label:x,icon:l,size:i,shape:s,fixedWidth:d})})}function K0({value:e,row:t,context:r,formatter:o,align:n="left",emphasis:a="normal",href:i,linkBehavior:s="hover",className:c,emptyText:l="\u2014",emptyClassName:d="text-text-secondary"}){let{isLoading:u}=r;if(u)return jsxRuntime.jsx(J,{className:mr(a)});let p=lo({value:e,formatter:o,emptyText:l,emptyClassName:d}),m=Ur(a),f=Me(n,tailwindMerge.twMerge(m,c)),g=jsxRuntime.jsx("div",{className:f,children:p}),b=we(i,t);return b?To(g,b,t,s):g}var If=He__namespace.default.memo(({value:e,min:t,max:r,color:o="var(--color-viz-default)",backgroundColor:n="var(--color-background-muted)",colorScale:a,showLabel:i=true,formatLabel:s,height:c=20,minWidth:l=4,segments:d,segmentGap:u=2,barWidth:p,context:m})=>{let f=He.useMemo(()=>r===t?100:Math.max(0,Math.min(100,(e-t)/(r-t)*100)),[e,t,r]),g=He.useMemo(()=>o==="auto"&&a?a.type==="diverging"&&a.center!==void 0?$i(e,t,r,a.center,a.scheme):Ji(e,t,r,a.scheme):o,[o,a,e,t,r]);if(m.isLoading)return jsxRuntime.jsx("div",{className:"flex items-center gap-2 w-full",style:{height:c},children:jsxRuntime.jsx("div",{className:"h-full flex-1 animate-pulse bg-border-default rounded"})});if(d&&d>0){let h=`calc((100% - ${u*(d-1)}px) / ${d})`,y=Math.ceil(f/100*d),v={height:c,...p&&{width:typeof p=="number"?`${p}px`:p,flexShrink:0}};return jsxRuntime.jsxs("div",{className:"flex items-center gap-2 w-full",children:[jsxRuntime.jsx("div",{className:`flex gap-0.5 ${p?"":"flex-1"}`,style:v,children:Array.from({length:d}).map((S,w)=>{let N=w<y;return jsxRuntime.jsx("div",{className:"rounded-sm",style:{width:h,backgroundColor:N?g:n==="none"?"transparent":n,marginRight:w<d-1?`${u}px`:0}},w)})}),i&&jsxRuntime.jsx("span",{className:"text-sm text-text-primary whitespace-nowrap",children:s?s(e):e.toLocaleString()})]})}let b={height:c,backgroundColor:n==="none"?"transparent":n,...p&&{width:typeof p=="number"?`${p}px`:p,flexShrink:0}};return jsxRuntime.jsxs("div",{className:"flex items-center gap-2 w-full",children:[jsxRuntime.jsx("div",{className:`relative rounded-sm ${p?"":"flex-1"}`,style:b,children:jsxRuntime.jsx("div",{className:"absolute left-0 top-0 h-full rounded-sm",style:{width:`${f}%`,minWidth:f>0?l:0,backgroundColor:g}})}),i&&jsxRuntime.jsx("span",{className:"text-sm text-text-primary whitespace-nowrap",children:s?s(e):e.toLocaleString()})]})});If.displayName="HorizontalBarCell";var Ff=He__namespace.default.memo(({value:e,data:t,color:r="var(--color-viz-default)",categoryColors:o,context:n,width:a,height:i=40})=>{let s=e||t||[],c=b=>"xValue"in b?b.xValue:b.x,l=b=>"yValue"in b?b.yValue:b.y,d=a||100,u=i,{xScale:p,yScale:m,barWidth:f}=He.useMemo(()=>{if(s.length===0)return {xScale:scale.scaleTime({range:[0,d],domain:[new Date,new Date]}),yScale:scale.scaleLinear({range:[u,0],domain:[0,1]}),barWidth:2};let b=d3Array.extent(s,N=>c(N)),x=d3Array.min(s,N=>l(N))??0,h=d3Array.max(s,N=>l(N))??0,y=x<0?x:0,v=scale.scaleTime({range:[0,d],domain:b}),S=scale.scaleLinear({range:[u,0],domain:[y,h*1.05]}),w=s.length>1?d/s.length*.8:8;return {xScale:v,yScale:S,barWidth:Math.max(2,w)}},[s,d,u]);if(n.isLoading)return jsxRuntime.jsx("div",{className:"flex items-center gap-0.5",style:{width:d,height:u},children:Array.from({length:5}).map((b,x)=>jsxRuntime.jsx("div",{className:"flex-1 animate-pulse bg-border-default rounded"},x))});if(!s||s.length===0)return jsxRuntime.jsx("div",{className:"flex items-center justify-center text-text-secondary text-xs",style:{width:d,height:u},children:"No data"});let g=m(0);return jsxRuntime.jsx("svg",{width:d,height:u,children:s.map((b,x)=>{let h=l(b),y=p(c(b)),v=m(h),S=Math.abs(g-v),w=b.category&&o?.[b.category]?o[b.category]:r;return jsxRuntime.jsx(shape.Bar,{x:y-f/2,y:h>=0?v:g,width:f,height:S,fill:w,rx:1},`bar-${x}`)})})});Ff.displayName="MiniBarCell";function X0({value:e,row:t,context:r,format:o="number",decimals:n=0,prefix:a,suffix:i,emptyText:s="\u2014",align:c="right",emphasis:l="normal",href:d,linkBehavior:u="hover",showPositiveSign:p=false,colorCode:m=false,className:f}){let{isLoading:g}=r;if(g)return jsxRuntime.jsx(J,{className:mr(l)});if(e==null||isNaN(Number(e)))return jsxRuntime.jsx("div",{className:Me(c,"text-text-secondary"),children:s});let b=Number(e),x;switch(o){case "currency":x=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:n,maximumFractionDigits:n}).format(b);break;case "percent":x=new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:n,maximumFractionDigits:n}).format(b/100);break;case "compact":x=new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:n>0?1:0,maximumFractionDigits:n}).format(b);break;default:x=new Intl.NumberFormat("en-US",{minimumFractionDigits:n,maximumFractionDigits:n}).format(b);}let y=`${p&&b>0?"+":""}${x}`,v=m?pd(b,true):Ur(l),S=Me(c,tailwindMerge.twMerge(v,f)),w=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[a&&jsxRuntime.jsx("span",{className:"text-text-secondary",children:a}),jsxRuntime.jsx("span",{children:y}),i&&jsxRuntime.jsx("span",{className:"text-text-secondary",children:i})]}),N=we(d,t);return N?jsxRuntime.jsx("div",{className:S,children:To(w,N,t,u)}):jsxRuntime.jsx("div",{className:S,children:w})}var Bf=He__namespace.default.memo(({value:e,showLabel:t=true,color:r="var(--color-viz-categorical-1)",backgroundColor:o="var(--color-background-muted)",height:n=20,segments:a,segmentGap:i=2,colorScale:s,context:c})=>{let l=He.useMemo(()=>Math.max(0,Math.min(100,e)),[e]),d=He.useMemo(()=>r==="auto"&&s?s.type==="diverging"&&s.center!==void 0?$i(e,0,100,s.center,s.scheme):Ji(e,0,100,s.scheme):r,[r,s,e]);if(c.isLoading)return jsxRuntime.jsx("div",{className:"flex items-center gap-2",style:{height:n},children:jsxRuntime.jsx("div",{className:"h-full w-full animate-pulse bg-border-default rounded"})});if(a&&a>0){let p=`calc((100% - ${i*(a-1)}px) / ${a})`,m=Math.ceil(l/100*a);return jsxRuntime.jsxs("div",{className:"flex items-center gap-2 w-full",children:[jsxRuntime.jsx("div",{className:"flex gap-0.5 flex-1",style:{height:n},children:Array.from({length:a}).map((f,g)=>{let b=g<m,x=d;if(r==="auto"&&s&&b){let h=(g+1)/a*100;s.type==="diverging"&&s.center!==void 0?x=$i(h,0,100,s.center,s.scheme):x=Ji(h,0,100,s.scheme);}return jsxRuntime.jsx("div",{className:"rounded-sm",style:{width:p,backgroundColor:b?x:o==="none"?"transparent":o,marginRight:g<a-1?`${i}px`:0}},g)})}),t&&jsxRuntime.jsxs("span",{className:"text-sm text-text-primary whitespace-nowrap",children:[l.toFixed(0),"%"]})]})}return jsxRuntime.jsxs("div",{className:"flex items-center gap-2 w-full",children:[jsxRuntime.jsx("div",{className:"relative flex-1 rounded-sm",style:{height:n,backgroundColor:o==="none"?"transparent":o},children:jsxRuntime.jsx("div",{className:"absolute left-0 top-0 h-full rounded-sm transition-all duration-300",style:{width:`${l}%`,backgroundColor:d}})}),t&&jsxRuntime.jsxs("span",{className:"text-sm text-text-primary whitespace-nowrap",children:[l.toFixed(0),"%"]})]})});Bf.displayName="PercentBarCell";function Q0({row:e,context:t,isSelected:r=false,onSelect:o,isDisabled:n=false,align:a="center"}){let{isLoading:i}=t;if(i)return jsxRuntime.jsx("div",{className:Me(a),children:jsxRuntime.jsx(J,{className:"h-4 w-4 rounded"})});let s=we(n,e),c=Me(a);return jsxRuntime.jsx("div",{className:c,children:jsxRuntime.jsx(Zn,{isSelected:r,onChange:l=>{o?.(e,l);},isDisabled:s,"aria-label":"Select row"})})}function yd({streetAddress:e,city:t,state:r,postalCode:o,layout:n="stacked",size:a="md",href:i,LinkComponent:s,linkVariant:c="unstyled",emphasis:l="normal",isLoading:d=false,className:u,piiEntity:p}){let f={xs:{iconSize:16,iconContainerSize:"w-7 h-7",gap:"gap-1.5",textSize:"text-xs",secondaryTextSize:"text-xs",skeletonIconStacked:28,skeletonIconInline:16,skeletonText:80,skeletonSecondary:60},sm:{iconSize:20,iconContainerSize:"w-8 h-8",gap:"gap-2",textSize:"text-sm",secondaryTextSize:"text-xs",skeletonIconStacked:32,skeletonIconInline:20,skeletonText:96,skeletonSecondary:72},md:{iconSize:24,iconContainerSize:"w-9 h-9",gap:"gap-3",textSize:"text-base",secondaryTextSize:"text-sm",skeletonIconStacked:36,skeletonIconInline:24,skeletonText:128,skeletonSecondary:96},lg:{iconSize:28,iconContainerSize:"w-10 h-10",gap:"gap-3",textSize:"text-lg",secondaryTextSize:"text-base",skeletonIconStacked:40,skeletonIconInline:28,skeletonText:160,skeletonSecondary:120}}[a],b={strong:"font-semibold text-text-primary",high:"font-semibold text-text-primary",normal:"text-text-primary",low:"text-text-secondary"}[l],x=[];t&&x.push(t),r&&o?x.push(`${r} ${o}`):r?x.push(r):o&&x.push(o);let h=x.join(", "),y=({children:S,className:w})=>i?s?jsxRuntime.jsx(s,{href:i,className:w,children:S}):jsxRuntime.jsx(tt,{href:i,variant:c,className:tailwindMerge.twMerge("hover:underline",w),asButton:false,children:S}):jsxRuntime.jsx("span",{className:w,children:S});if(d)return n==="inline"?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center",f.gap,u),children:[jsxRuntime.jsx(J,{width:f.skeletonIconInline,height:f.skeletonIconInline,className:"flex-shrink-0 rounded"}),jsxRuntime.jsx(J,{width:f.skeletonText,height:f.skeletonIconInline*.8})]}):jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center",f.gap,u),children:[jsxRuntime.jsx(J,{width:f.skeletonIconStacked,height:f.skeletonIconStacked,className:"flex-shrink-0 rounded"}),jsxRuntime.jsxs("div",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx(J,{width:f.skeletonText,height:16}),jsxRuntime.jsx(J,{width:f.skeletonSecondary,height:12})]})]});if(n==="inline")return jsxRuntime.jsxs(y,{className:tailwindMerge.twMerge("flex items-center",f.gap,i&&"hover:bg-background-hover transition-colors",u),children:[jsxRuntime.jsx(U,{name:"MapPin",size:f.iconSize,className:"text-text-secondary flex-shrink-0"}),jsxRuntime.jsx("span",{className:tailwindMerge.twMerge("leading-normal truncate hover:text-text-primary",b,f.textSize,i&&"hover:underline hover:decoration-1 hover:underline-offset-4"),"data-pii-type":p?"address":void 0,"data-pii-entity":p,children:e})]});let v=()=>{if(p){if(t&&r&&o)return "city-state-zip";if(t&&r)return "city-state";if(t)return "city";if(r)return "state";if(o)return "postal-code"}};return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center justify-start",f.gap,u),children:[jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-shrink-0 flex items-center justify-center rounded border border-border-muted",f.iconContainerSize),children:jsxRuntime.jsx(U,{name:"MapPin",size:f.iconSize,className:"text-text-secondary"})}),jsxRuntime.jsxs("div",{className:"flex flex-col items-start min-w-0",children:[jsxRuntime.jsx(y,{className:tailwindMerge.twMerge("leading-normal truncate hover:text-text-primary",b,f.textSize,i&&"hover:underline hover:decoration-1 hover:underline-offset-4"),children:jsxRuntime.jsx("span",{"data-pii-type":p?"address":void 0,"data-pii-entity":p,children:e})}),h&&jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("text-text-secondary leading-normal truncate",f.secondaryTextSize),"data-pii-type":v(),"data-pii-entity":p,children:h})]})]})}function eC({row:e,context:t,streetAddress:r,city:o,state:n,postalCode:a,layout:i="stacked",size:s="sm",href:c,LinkComponent:l,linkVariant:d="secondary",emphasis:u="normal",align:p="left",className:m,piiEntity:f}){let{isLoading:g}=t,b=we(r,e),x=we(o,e),h=we(n,e),y=we(a,e),v=we(c,e),S=we(f,e),w=Me(p,m);return jsxRuntime.jsx("div",{className:w,children:jsxRuntime.jsx(yd,{streetAddress:b,city:x,state:h,postalCode:y,layout:i,size:s,href:v,LinkComponent:l,linkVariant:d,emphasis:u,isLoading:g,piiEntity:S})})}var Vf=He__namespace.default.memo(({value:e,data:t,type:r="line",color:o="var(--color-viz-default)",strokeWidth:n=2,categoryColors:a,context:i,width:s,height:c=40})=>{let l=e||t||[],d=s||100,u=c,{xScale:p,yScale:m}=He.useMemo(()=>{if(l.length===0)return {xScale:scale.scaleTime({range:[0,d],domain:[new Date,new Date]}),yScale:scale.scaleLinear({range:[u,0],domain:[0,1]})};let g=d3Array.extent(l,y=>y.xValue),b=d3Array.min(l,y=>y.yValue)||0,x=d3Array.max(l,y=>y.yValue)||0,h=(x-b)*.1||1;return {xScale:scale.scaleTime({range:[0,d],domain:g}),yScale:scale.scaleLinear({range:[u,0],domain:[b-h,x+h]})}},[l,d,u]);if(i.isLoading)return jsxRuntime.jsx("div",{className:"flex items-center",style:{width:d,height:u},children:jsxRuntime.jsx("div",{className:"h-1 w-full animate-pulse bg-border-default rounded"})});if(!l||l.length===0)return jsxRuntime.jsx("div",{className:"flex items-center justify-center text-text-secondary text-xs",style:{width:d,height:u},children:"No data"});let f=a&&l[0]?.category&&a[l[0].category]?a[l[0].category]:o;return jsxRuntime.jsxs("svg",{width:d,height:u,className:"overflow-visible",children:[(r==="area"||r==="both")&&jsxRuntime.jsx(shape.AreaClosed,{data:l,x:g=>p(g.xValue),y:g=>m(g.yValue),yScale:m,fill:f,fillOpacity:.15,curve:curve.curveLinear}),(r==="line"||r==="both")&&jsxRuntime.jsx(shape.LinePath,{data:l,x:g=>p(g.xValue),y:g=>m(g.yValue),stroke:f,strokeWidth:n,strokeLinecap:"round",curve:curve.curveLinear})]})});Vf.displayName="SparklineCell";function nC({value:e,row:t,context:r,prefix:o,suffix:n,emptyText:a="\u2014",href:i,linkBehavior:s="hover",linkVariant:c="secondary",emphasis:l="normal",truncate:d=true,copyable:u=false,align:p="left",className:m,piiType:f,piiEntity:g}){let{isLoading:b}=r;if(b)return jsxRuntime.jsx(J,{className:mr(l)});let x=ud(e,a),h=we(i,t),y=we(g,t),v=x,S=false,w=false;if(d&&x&&typeof x=="string")if(typeof d=="boolean")w=true;else {let{position:k="end",length:V=16,ellipsis:H="...",tooltip:I=true}=d;if(x.length>V){switch(k){case "start":v=vl(x,V);break;case "middle":v=Wa(x,V);break;case "end":v=Cl(x,V,H);break}S=I;}}let N=f&&y?{"data-pii-type":f,"data-pii-entity":y}:{},D=Object.keys(N).length>0,R=jsxRuntime.jsx("span",{className:w?"truncate":"",...N,children:v}),A=S?jsxRuntime.jsx(nr,{content:D?jsxRuntime.jsx("span",{...N,children:String(x)}):String(x),children:R}):R,O=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[o&&jsxRuntime.jsx("span",{className:"text-text-secondary",children:o}),A,n&&jsxRuntime.jsx("span",{className:"text-text-secondary",children:n})]}),P=O;if(u&&x&&x!==a){let k=typeof u=="function"?u(t):String(x);P=jsxRuntime.jsx(sn,{value:k,size:"sm",children:O});}if(h){let k=Me(p,m);return jsxRuntime.jsx("div",{className:k,children:To(P,h,t,s,c,l)})}let T=Me(p,tailwindMerge.twMerge(Ur(l),m));return jsxRuntime.jsx("div",{className:T,children:P})}var $3={sm:"sm:hidden",md:"md:hidden",lg:"lg:hidden",xl:"xl:hidden"},X3={sm:"hidden sm:grid",md:"hidden md:grid",lg:"hidden lg:grid",xl:"hidden xl:grid"};function vd(e,t){return t.accessor?typeof t.accessor=="function"?t.accessor(e):e[t.accessor]:null}function Cd(e,t,r,o){if(r.cell){let n=r.cell,a=typeof r.cellProps=="function"?r.cellProps(e,t):r.cellProps;return jsxRuntime.jsx(n,{value:e,row:t,context:o,...a})}return r.render?r.render(e,t,o):e?.toString()??"\u2014"}function wd({row:e,columns:t,density:r,isLoading:o,onClick:n}){let a=t.filter(u=>u.mobile!==false).map(u=>{let p=u.mobile===false?null:u.mobile;return {...u,mobilePriority:p?.priority??2,mobileFormat:p?.format??"secondary",showLabel:p?.label??p?.format==="secondary",icon:p?.icon}}).sort((u,p)=>u.mobilePriority-p.mobilePriority),i=a.filter(u=>u.mobilePriority===1||u.mobileFormat==="primary"),s=a.filter(u=>u.mobilePriority===2&&u.mobileFormat!=="primary"),c=a.filter(u=>u.mobileFormat==="badge"),l={isLoading:!!o,rowIndex:0,columnIndex:0,density:r};return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("border-b border-border-default bg-background-surface transition-colors",n&&"cursor-pointer hover:bg-background-hover active:bg-background-pressed",{compact:"px-3 py-2",default:"px-4 py-3",relaxed:"px-4 py-4"}[r]),onClick:n,role:n?"button":void 0,tabIndex:n?0:void 0,children:[i.length>0&&jsxRuntime.jsxs("div",{className:"mb-2 flex items-start justify-between",children:[jsxRuntime.jsx("div",{className:"flex-1",children:i.map(u=>{let p=vd(e,u);return jsxRuntime.jsx("div",{className:"font-medium text-text-primary [&>*]:!justify-start [&>*]:!text-left",children:Cd(p,e,u,l)},u.id)})}),c.length>0&&jsxRuntime.jsx("div",{className:"ml-2 flex flex-wrap gap-1",children:c.map(u=>{let p=vd(e,u);return jsxRuntime.jsx("div",{className:"inline-flex",children:Cd(p,e,u,l)},u.id)})})]}),s.length>0&&jsxRuntime.jsx("div",{className:"space-y-1",children:s.map(u=>{let p=vd(e,u),m=u.showLabel&&u.label;return jsxRuntime.jsxs("div",{className:"flex items-center text-sm text-text-secondary",children:[u.icon&&jsxRuntime.jsx(U,{name:u.icon,className:"mr-1.5 h-4 w-4 flex-shrink-0"}),m&&jsxRuntime.jsxs("span",{className:"mr-1 font-medium",children:[u.label,":"]}),jsxRuntime.jsx("span",{className:"truncate [&>*]:!justify-start [&>*]:!text-left",children:Cd(p,e,u,l)})]},u.id)})})]})}function Td({row:e,columns:t,density:r,isLoading:o,onClick:n}){let a=t.filter(c=>c.mobile!==false),i={isLoading:!!o,rowIndex:0,columnIndex:0,density:r};return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("border-b border-border-default bg-background-surface transition-colors",n&&"cursor-pointer hover:bg-background-hover active:bg-background-pressed",{compact:"px-3 py-2",default:"px-4 py-3",relaxed:"px-4 py-4"}[r]),onClick:n,role:n?"button":void 0,tabIndex:n?0:void 0,children:jsxRuntime.jsx("div",{className:"space-y-2",children:a.map((c,l)=>{let d=vd(e,c),u=l===0;return jsxRuntime.jsxs("div",{children:[!u&&jsxRuntime.jsx("div",{className:"text-xs text-text-secondary",children:c.label}),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(u?"font-medium text-text-primary":"text-sm text-text-primary","[&>*]:!justify-start [&>*]:!text-left"),children:Cd(d,e,c,i)})]},c.id)})})})}function aC(e="md"){return {mobile:$3[e],desktop:X3[e]}}function iC({density:e}){return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("border-b border-border-default bg-background-surface",{compact:"px-3 py-2",default:"px-4 py-3",relaxed:"px-4 py-4"}[e]),children:[jsxRuntime.jsx("div",{className:"mb-2 h-5 w-3/4 animate-pulse rounded bg-background-muted"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsx("div",{className:"h-4 w-1/2 animate-pulse rounded bg-background-muted"}),jsxRuntime.jsx("div",{className:"h-4 w-2/3 animate-pulse rounded bg-background-muted"})]})]})}var cE={compact:"py-1.5 px-3 text-sm",default:"py-3 px-4 text-sm",relaxed:"py-4 px-4 text-base"},dE={left:"text-left justify-start",center:"text-center justify-center",right:"text-right justify-end"};function uE(e){let t={};return e.width!==void 0&&(t.width=typeof e.width=="number"?`${e.width}px`:e.width),e.minWidth!==void 0&&(t.minWidth=typeof e.minWidth=="number"?`${e.minWidth}px`:e.minWidth),e.maxWidth!==void 0&&(t.maxWidth=typeof e.maxWidth=="number"?`${e.maxWidth}px`:e.maxWidth),e.flex!==void 0&&(t.flex=`${e.flex} 1 0`),t}function pE({column:e,sortConfig:t,onSort:r,stickyHeader:o,stickyFirstColumn:n,isFirstColumn:a,density:i="default",isLoading:s=false}){let c=e.reorderable!==false,{attributes:l,listeners:d,setNodeRef:u,transform:p,transition:m,isDragging:f}=sortable.useSortable({id:e.id,disabled:!c||s}),g=t?.columnId===e.id,b=g?t.direction:null,x=n&&a,h={...uE(e),transform:utilities.CSS.Transform.toString(p),transition:m,opacity:f?.8:1,zIndex:f?50:void 0};return jsxRuntime.jsx("div",{ref:u,className:tailwindMerge.twMerge("flex items-center border-b border-border-default bg-background-surface",e.sortable?"gap-2":"gap-1",cE[i],dE[e.align||"left"],o&&"sticky top-0 z-10",x&&"sticky left-0 z-20 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.1)]",o&&x&&"z-30",e.sortable&&!s&&"hover:bg-background-hover",s&&"cursor-not-allowed opacity-60",g?"font-bold text-text-primary":"font-medium text-text-secondary",f&&"bg-background-hover"),style:h,role:"columnheader","aria-sort":g?b==="asc"?"ascending":"descending":"none","aria-disabled":s,...l,...d,children:s?jsxRuntime.jsx(J,{className:"h-4 w-24"}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"flex-1 truncate cursor-pointer",onClick:()=>!s&&e.sortable&&r(e.id),children:e.label}),e.sortable&&jsxRuntime.jsx("button",{type:"button",className:"flex flex-shrink-0 cursor-pointer",onClick:()=>!s&&r(e.id),"aria-label":`Sort by ${e.label}`,children:g?jsxRuntime.jsx(U,{name:b==="asc"?"CaretUp":"CaretDown",size:14,weight:"bold",className:"text-text-primary"}):jsxRuntime.jsx(U,{name:"CaretUpDown",size:12,className:"text-text-secondary opacity-40"})})]})})}function lC({columns:e,columnOrder:t,onColumnOrderChange:r,sortConfig:o,onSort:n,stickyHeader:a,stickyFirstColumn:i,density:s="default",isLoading:c=false}){let l=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:5}}),core.useSensor(core.KeyboardSensor,{coordinateGetter:sortable.sortableKeyboardCoordinates})),d=new Map(e.map(m=>[m.id,m])),u=m=>{let{active:f,over:g}=m;if(g&&f.id!==g.id){let b=t.indexOf(f.id),x=t.indexOf(g.id);if(d.get(g.id)?.reorderable===false)return;let y=0;for(let N=0;N<t.length&&d.get(t[N])?.reorderable===false;N++)y=N+1;if(x<y)return;let v=Math.min(b,x),S=Math.max(b,x);for(let N=v;N<=S;N++){if(N===b)continue;if(d.get(t[N])?.reorderable===false)return}let w=sortable.arrayMove(t,b,x);r(w);}},p=t.map(m=>d.get(m)).filter(m=>m!==void 0);return jsxRuntime.jsx(core.DndContext,{sensors:l,collisionDetection:core.closestCenter,onDragEnd:u,children:jsxRuntime.jsx(sortable.SortableContext,{items:t,strategy:sortable.horizontalListSortingStrategy,children:jsxRuntime.jsx("div",{className:"contents",role:"rowgroup",children:p.map((m,f)=>jsxRuntime.jsx(pE,{column:m,sortConfig:o,onSort:n,stickyHeader:a,stickyFirstColumn:i,isFirstColumn:f===0,density:s,isLoading:c},m.id))})})})}var Wf={compact:"py-1.5 px-3 text-sm",default:"py-3 px-4 text-sm",relaxed:"py-4 px-4 text-base"},Gf={left:"text-left justify-start",center:"text-center justify-center",right:"text-right justify-end"},hE={full:"w-full",auto:"w-auto inline-block",contained:"w-full max-w-6xl mx-auto"},yE={auto:"table-auto",fixed:"table-fixed",responsive:"table-auto"};function Uf(e){let t={};return e.width!==void 0&&(t.width=typeof e.width=="number"?`${e.width}px`:e.width),e.minWidth!==void 0&&(t.minWidth=typeof e.minWidth=="number"?`${e.minWidth}px`:e.minWidth),e.maxWidth!==void 0&&(t.maxWidth=typeof e.maxWidth=="number"?`${e.maxWidth}px`:e.maxWidth),e.flex!==void 0&&(t.flex=`${e.flex} 1 0`),t}function vE(e,t){return t.accessor?typeof t.accessor=="function"?t.accessor(e):e[t.accessor]:null}function CE({column:e,sortConfig:t,onSort:r,stickyHeader:o,stickyFirstColumn:n,isFirstColumn:a,density:i="default",isLoading:s=false}){let c=t?.columnId===e.id,l=c?t.direction:null,d=n&&a;return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex items-center border-b border-border-default bg-background-surface",e.sortable?"gap-2":"gap-1",Wf[i],Gf[e.align||"left"],o&&"sticky top-0 z-10",d&&"sticky left-0 z-20 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.1)]",o&&d&&"z-30",e.sortable&&!s&&"cursor-pointer hover:bg-background-hover",s&&"cursor-not-allowed opacity-60",c?"font-bold text-text-primary":"font-medium text-text-secondary"),onClick:()=>!s&&e.sortable&&r(e.id),role:"columnheader","aria-sort":c?l==="asc"?"ascending":"descending":"none","aria-disabled":s,style:Uf(e),children:s?jsxRuntime.jsx(J,{className:"h-4 w-24"}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"truncate",children:e.label}),e.sortable&&jsxRuntime.jsx("div",{className:"flex flex-shrink-0",children:c?jsxRuntime.jsx(U,{name:l==="asc"?"CaretUp":"CaretDown",size:14,weight:"bold",className:"text-text-primary"}):jsxRuntime.jsx(U,{name:"CaretUpDown",size:12,className:"text-text-secondary opacity-40"})})]})})}function SE({column:e,row:t,rowIndex:r,columnIndex:o,isHovered:n,density:a="default",className:i,stickyFirstColumn:s}){let c=s&&o===0,l=vE(t,e),d={isLoading:false,isHovered:n,rowIndex:r,columnIndex:o,density:a},u;if(e.cell){let p=e.cell,m=typeof e.cellProps=="function"?e.cellProps(l,t):e.cellProps;u=jsxRuntime.jsx(p,{value:l,row:t,context:d,...m});}else e.render?u=e.render(l,t,d):u=jsxRuntime.jsx("span",{className:"truncate",children:l?.toString()??""});if(e.popover){let p=e.popover,m,f="top",g=false,b="hover";typeof p=="string"?m=p:typeof p=="function"?m=p(l,t):(m=typeof p.content=="function"?p.content(l,t):p.content,f=p.placement||"top",g=p.showArrow??false,b=p.trigger||"hover"),u=jsxRuntime.jsxs(reactAriaComponents.DialogTrigger,{...b==="hover"?{trigger:"longPress"}:{},children:[jsxRuntime.jsx("div",{className:"cursor-help",children:u}),jsxRuntime.jsx(lt,{placement:f,showArrow:g,children:jsxRuntime.jsx("div",{className:"p-2",children:m})})]});}return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex items-center border-b border-border-default bg-background-surface",e.noCellPadding?"":Wf[a],Gf[e.align||"left"],c&&"sticky left-0 z-10 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.1)]",i),role:"cell",style:Uf(e),children:u})}function wE({column:e,rowIndex:t,columnIndex:r,density:o="default",stickyFirstColumn:n}){let a=n&&r===0,i={isLoading:true,rowIndex:t,columnIndex:r,density:o},s;if(e.cell){let c=e.cell,l=typeof e.cellProps=="function"?e.cellProps(null,{}):e.cellProps;s=jsxRuntime.jsx(c,{value:null,row:{},context:i,...l});}else e.render?s=e.render(null,{},i):s=jsxRuntime.jsx(J,{className:"h-4 w-full max-w-[200px]"});return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex items-center border-b border-border-default bg-background-surface",e.noCellPadding?"":Wf[o],Gf[e.align||"left"],a&&"sticky left-0 z-10 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.1)]"),role:"cell",style:Uf(e),children:s})}function TE(e,t){let r=new Set(["BUTTON","A","INPUT","SELECT","TEXTAREA"]),o=new Set(["button","link","checkbox","switch","menuitem","option"]),n=e;for(;n&&n!==t;){if(r.has(n.tagName))return true;let a=n.getAttribute("role");if(a&&o.has(a))return true;n=n.parentElement;}return false}function cC({columns:e,row:t,rowIndex:r,density:o="default",onClick:n,stickyFirstColumn:a}){let[i,s]=He.useState(false),c=He.useCallback(l=>{if(!n)return;let d=l.target,u=l.currentTarget;TE(d,u)||n(t);},[n,t]);return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("contents group",n&&"cursor-pointer"),role:"row",onClick:c,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),children:e.map((l,d)=>jsxRuntime.jsx(SE,{column:l,row:t,rowIndex:r,columnIndex:d,isHovered:i,density:o,className:n?"group-hover:bg-background-hover":"",stickyFirstColumn:a},l.id))})}function dC({columns:e,rowIndex:t,density:r="default",stickyFirstColumn:o}){return jsxRuntime.jsx("div",{className:"contents",role:"row",children:e.map((n,a)=>jsxRuntime.jsx(wE,{column:n,rowIndex:t,columnIndex:a,density:r,stickyFirstColumn:o},n.id))})}function uC({columns:e,data:t,className:r,density:o="default",width:n="full",height:a,maxHeight:i,layout:s="auto",mobileRenderer:c="auto",customMobileRowRender:l,mobileBreakpoint:d="md",isLoading:u=false,loadingState:p,loadingRowCount:m=5,onLoadMore:f,hasMore:g=false,enableVirtualization:b,estimatedRowHeight:x,loadingIndicator:h,stickyHeader:y=false,stickyFirstColumn:v=false,onRowClick:S,getRowId:w,hideHeader:N=false,sortConfig:D,onSort:R,"aria-label":A,enableColumnReorder:O=false,columnOrder:P,onColumnOrderChange:T}){let[k,V]=He.useState(null),H=D!==void 0,I=H?D:k,q=He.useRef(null),j=He.useMemo(()=>e.map(de=>de.id),[e]),[K,Y]=He.useState(j),M=P!==void 0,E=M?P:K;He.useEffect(()=>{M||Y(de=>{let le=e.map(ee=>ee.id),me=new Set(le),Q=new Set(de),X=de.filter(ee=>me.has(ee)),be=le.filter(ee=>!Q.has(ee));return [...X,...be]});},[e,M]);let z=He.useCallback(de=>{M||Y(de),T?.(de);},[M,T]),B=He.useMemo(()=>{if(!O&&!P)return e;let de=new Map(e.map(le=>[le.id,le]));return E.map(le=>de.get(le)).filter(le=>le!==void 0)},[e,E,O,P]),C=f?Qo({items:t,onLoadMore:f,hasMore:g,isLoading:u,loadingState:p,enableVirtualization:b,estimatedItemSize:x||(o==="compact"?40:o==="relaxed"?60:48),overscan:5}):null,W=C?.scrollRef??q,{loadMoreRef:G,virtualizer:F,virtualItems:Z,isLoadingMore:_,computedLoadingState:L}=C||{},{gridTemplateColumns:oe,totalMinWidth:ie}=He.useMemo(()=>{let de=0;return {gridTemplateColumns:B.map(me=>{if(me.minWidth?de+=typeof me.minWidth=="number"?me.minWidth:0:me.width&&typeof me.width=="number"&&(de+=me.width),me.width)return typeof me.width=="number"?`${me.width}px`:me.width;if(me.flex)return `${me.flex}fr`;if(me.minWidth&&me.maxWidth){let Q=typeof me.minWidth=="number"?`${me.minWidth}px`:me.minWidth,X=typeof me.maxWidth=="number"?`${me.maxWidth}px`:me.maxWidth;return `minmax(${Q}, ${X})`}return me.minWidth?`minmax(${typeof me.minWidth=="number"?`${me.minWidth}px`:me.minWidth}, 1fr)`:me.maxWidth?`minmax(0, ${typeof me.maxWidth=="number"?`${me.maxWidth}px`:me.maxWidth})`:"1fr"}).join(" "),totalMinWidth:de}},[B]),ne=He.useCallback(de=>{if(!e.find(Q=>Q.id===de)?.sortable)return;let me;I?.columnId===de?me={columnId:de,direction:I.direction==="asc"?"desc":"asc"}:me={columnId:de,direction:"asc"},H||V(me),R?.(me);},[e,I,R,H]),ae=L==="loading"||u&&t.length===0,ce={};a?(ce.height=typeof a=="number"?`${a}px`:a,ce.overflowY="auto"):i?(ce.maxHeight=typeof i=="number"?`${i}px`:i,ce.overflowY="auto"):f&&(ce.height="600px",ce.overflowY="auto");let Ce=tailwindMerge.twMerge(hE[n],!f&&(s==="responsive"?"overflow-x-auto scrollbar-visible":"overflow-auto scrollbar-visible"),r),te=aC(d),ye=c!=="none",qe=(de,le)=>ye?c==="custom"&&l?l(de,le):jsxRuntime.jsx(c==="cards"?Td:wd,{row:de,columns:B,density:o,isLoading:u,onClick:S?()=>S(de):void 0}):null,It=F?Z?.map(de=>({virtualItem:de,row:t[de.index],index:de.index}))||[]:t.map((de,le)=>({row:de,index:le,virtualItem:null}));return jsxRuntime.jsxs("div",{ref:W,className:Ce,style:{...ce,position:F?"relative":void 0},children:[jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("grid border-separate border-spacing-0",yE[s],n==="auto"?"inline-grid w-auto":"w-full",ye&&te.desktop),role:"table","aria-label":A,style:{gridTemplateColumns:oe,minWidth:ie>0?`${ie}px`:void 0},children:[!N&&(O?jsxRuntime.jsx(lC,{columns:e,columnOrder:E,onColumnOrderChange:z,sortConfig:I,onSort:ne,stickyHeader:y,stickyFirstColumn:v,density:o,isLoading:ae}):jsxRuntime.jsx("div",{className:"contents",role:"rowgroup",children:B.map((de,le)=>jsxRuntime.jsx(CE,{column:de,sortConfig:I,onSort:ne,stickyHeader:y,stickyFirstColumn:v,isFirstColumn:le===0,density:o,isLoading:ae},de.id))})),F?jsxRuntime.jsx("div",{className:"col-span-full",style:{gridColumn:"1 / -1",height:`${F.getTotalSize()}px`,position:"relative"},role:"rowgroup",children:ae?Array.from({length:m}).map((de,le)=>jsxRuntime.jsx("div",{className:"contents",children:jsxRuntime.jsx(dC,{columns:B,rowIndex:le,density:o,stickyFirstColumn:v})},`loading-${le}`)):t.length>0?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[It.map(({row:de,index:le,virtualItem:me})=>{if(!de||!me)return null;let Q=w?w(de):`row-${le}`;return jsxRuntime.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",display:"grid",gridTemplateColumns:oe,transform:`translateY(${me.start}px)`},"data-index":me.index,ref:F.measureElement,children:jsxRuntime.jsx(cC,{columns:B,row:de,rowIndex:le,density:o,onClick:S,stickyFirstColumn:v})},Q)}),_&&jsxRuntime.jsx("div",{style:{position:"absolute",top:`${F.getTotalSize()}px`,left:0,width:"100%"},children:h||jsxRuntime.jsx(Ar,{state:"loading-more"})})]}):jsxRuntime.jsx("div",{className:"py-12 text-center text-text-secondary",children:"No data available"})}):jsxRuntime.jsx("div",{className:"contents",role:"rowgroup",children:ae?Array.from({length:m}).map((de,le)=>jsxRuntime.jsx(dC,{columns:B,rowIndex:le,density:o,stickyFirstColumn:v},`loading-${le}`)):t.length>0?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[It.map(({row:de,index:le})=>{if(!de)return null;let me=w?w(de):`row-${le}`;return jsxRuntime.jsx(cC,{columns:B,row:de,rowIndex:le,density:o,onClick:S,stickyFirstColumn:v},me)}),_&&jsxRuntime.jsx("div",{className:"col-span-full",style:{gridColumn:"1 / -1"},children:h||jsxRuntime.jsx(Ar,{state:"loading-more"})})]}):jsxRuntime.jsx("div",{className:"col-span-full py-12 text-center text-text-secondary",role:"row",children:jsxRuntime.jsx("div",{role:"cell",children:"No data available"})})})]}),ye&&jsxRuntime.jsx("div",{className:te.mobile,children:ae?Array.from({length:m}).map((de,le)=>jsxRuntime.jsx(iC,{density:o},`mobile-loading-${le}`)):t.length>0?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[It.map(({row:de,index:le})=>{if(!de)return null;let me=w?w(de):`mobile-row-${le}`;return jsxRuntime.jsx("div",{className:"border-b border-border-default last:border-b-0",children:qe(de,le)},me)}),_&&(h||jsxRuntime.jsx(Ar,{state:"loading-more"}))]}):jsxRuntime.jsx("div",{className:"py-12 text-center text-text-secondary",children:"No data available"})}),f&&g&&!ae&&(F?jsxRuntime.jsx("div",{ref:G,style:{position:"absolute",top:`${F.getTotalSize()}px`,left:0,width:"100%",height:1}}):jsxRuntime.jsx("div",{ref:G,className:"h-px w-full"}))]})}function mC({status:e,alertCount:t,showCount:r=false,isLoading:o,size:n="sm",shape:a="pill",...i}){if(o)return jsxRuntime.jsx(J,{className:"inline-flex h-6 w-20"});let s={healthy:"success",warning:"warning",error:"error",unknown:"neutral"},c={healthy:"Healthy",warning:"Warning",error:"Error",unknown:"Unknown"},l=e==="warning"||e==="error",d=r&&t?`${c[e]} (${t})`:c[e];return jsxRuntime.jsx(at,{variant:s[e],size:n,shape:a,dot:l,dotPulse:l,...i,children:d})}var kE={battery:"BatteryHigh",charger:"ChargingStation",thermostat:"ThermometerSimple",inverter:"Power",vehicle:"Car",water_heater:"DropHalfBottom",meter:"Gauge",gateway:"WifiHigh",other:"Cube",unknown:"Question"},PE={battery:"Battery",charger:"Charger",thermostat:"Thermostat",inverter:"Inverter",vehicle:"Vehicle",water_heater:"Water Heater",meter:"Meter",gateway:"Gateway",other:"Other",unknown:"Unknown"};function gC({deviceType:e,iconName:t,size:r="md",showLabel:o=false,className:n}){let a=t||(e?kE[e]:"Question"),i=e?PE[e]:void 0;return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("inline-flex items-center",o?"flex-col gap-1":"gap-0",n),children:[jsxRuntime.jsx(U,{name:a,size:r}),o&&i&&jsxRuntime.jsx("span",{className:"text-xs text-text-secondary",children:i})]})}function Ks({children:e,title:t,headerContent:r,titleAlign:o="left",hideCloseIcon:n=false,hasBackArrow:a=false,onBack:i,isOpen:s,slideInFrom:c="right",transparentOverlay:l=false,onClose:d,className:u,primaryAction:p,secondaryAction:m,tertiaryAction:f,footerContent:g,contentPadding:b=true,maxWidth:x="400px"}){if(!s)return null;let h=t||r,y=p||m||f||g;return jsxRuntime.jsx($r,{children:jsxRuntime.jsx(br,{isOpen:s,onOpenChange:v=>!v&&d?.(),isDismissable:true,transparent:l,children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{className:tailwindMerge.twMerge("fixed top-0 bottom-0 flex flex-col bg-background-surface shadow-xl overflow-hidden",c==="right"?"right-0":"left-0",c==="right"?"animate-in slide-in-from-right duration-300 ease-out":"animate-in slide-in-from-left duration-300 ease-out","data-[exiting]:animate-out",c==="right"?"data-[exiting]:slide-out-to-right":"data-[exiting]:slide-out-to-left","data-[exiting]:duration-200 data-[exiting]:ease-in","outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-action-default focus-visible:outline-offset-0",u),style:{maxWidth:x,width:"100%"},children:[h&&(a&&i?jsxRuntime.jsx(Kt,{title:t,headerContent:r,titleAlign:o,hideCloseIcon:n,hasBackArrow:true,onBack:i,onClose:d}):jsxRuntime.jsx(Kt,{title:t,headerContent:r,titleAlign:o,hideCloseIcon:n,onClose:d})),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-1 overflow-y-auto overscroll-contain",b?"px-6 py-6":"p-0"),children:e}),y&&jsxRuntime.jsx(rn,{primaryAction:p,secondaryAction:m,tertiaryAction:f,footerContent:g})]})})})})}Ks.displayName="Drawer";function xC({status:e,programName:t,isLoading:r,size:o="sm",shape:n="pill",...a}){if(r)return jsxRuntime.jsx(J,{className:"inline-flex h-6 w-20"});let i={enrolled:"success",eligible:"info",pending:"warning",not_eligible:"neutral",opted_out:"neutral"},s={enrolled:"Enrolled",eligible:"Eligible",pending:"Pending",not_eligible:"Not Eligible",opted_out:"Opted Out"},c=jsxRuntime.jsx(at,{variant:i[e],size:o,shape:n,...a,children:s[e]});return t?jsxRuntime.jsx(nr,{content:t,children:c}):c}function yC({value:e,onChange:t,onUrlChange:r,accept:o="image/*",maxSize:n,isDisabled:a=false,onUpload:i,className:s,showPreview:c=true,placeholder:l="Drop files here or click to browse"}){let[d,u]=He.useState(false),[p,m]=He.useState(false),[f,g]=He.useState(null),[b,x]=He.useState(e),h=He.useRef(null),y=async w=>{if(g(null),n&&w.size>n){g(`File size must be less than ${(n/1024/1024).toFixed(2)}MB`);return}if(c&&w.type.startsWith("image/")){let N=new FileReader;N.onloadend=()=>{x(N.result);},N.readAsDataURL(w);}if(i){m(true);try{let N=await i(w);x(N),r?.(N);}catch(N){g("Failed to upload file"),console.error("Upload error:",N);}finally{m(false);}}t?.(w,b);},v=async w=>{try{let N=w.items;if(N.length>0){let D=N[0];if(D.kind==="file"){let R=await D.getFile();R&&y(R);}}}catch(N){g("Failed to upload file"),console.error("Upload error:",N);}finally{u(false);}},S=()=>{x(void 0),g(null),t?.(null),r?.(""),h.current&&(h.current.value="");};return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("w-full",s),children:[jsxRuntime.jsxs(reactAriaComponents.DropZone,{className:tailwindMerge.twMerge("relative flex min-h-[200px] w-full flex-col items-center justify-center rounded-lg border-2 border-dashed transition-colors",d?"border-action-brand bg-action-brand/5":"border-border-muted hover:border-border-default",a&&"pointer-events-none opacity-50",f&&"border-feedback-error-border bg-feedback-error-background/50"),onDrop:v,onDropEnter:()=>u(true),onDropExit:()=>u(false),children:[b?jsxRuntime.jsxs("div",{className:"relative flex h-full w-full items-center justify-center p-4",children:[c&&(b.startsWith("data:image")||b.startsWith("http"))?jsxRuntime.jsx("img",{src:b,alt:"Preview",className:"max-h-48 max-w-full rounded-md object-contain"}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Image,{className:"h-12 w-12 text-text-secondary"}),jsxRuntime.jsx("span",{className:"text-sm text-text-secondary",children:"File uploaded"})]}),!a&&jsxRuntime.jsx(re,{variant:"icon",size:"sm",onPress:S,className:"absolute right-2 top-2 bg-background-surface shadow-md",children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4 p-6",children:[jsxRuntime.jsx(lucideReact.Upload,{className:"h-12 w-12 text-text-secondary"}),jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx("p",{className:"text-sm text-text-primary",children:l}),jsxRuntime.jsx("p",{className:"mt-1 text-xs text-text-secondary",children:o==="image/*"?"PNG, JPG, GIF up to 10MB":`Accepts ${o}`})]}),jsxRuntime.jsx(reactAriaComponents.FileTrigger,{acceptedFileTypes:o.split(","),onSelect:w=>{let N=Array.from(w||[]);N.length>0&&y(N[0]);},children:jsxRuntime.jsx(re,{variant:"secondary",size:"sm",isDisabled:a,children:"Choose File"})})]}),p&&jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-lg bg-background-surface/80",children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-2",children:[jsxRuntime.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-action-brand border-t-transparent"}),jsxRuntime.jsx("span",{className:"text-sm text-text-secondary",children:"Uploading..."})]})})]}),f&&jsxRuntime.jsx("p",{className:"mt-2 text-sm text-feedback-error-text",children:f})]})}function CC({version:e,isLatest:t,updateAvailable:r,isLoading:o,size:n="sm",shape:a="rounded",...i}){if(o)return jsxRuntime.jsx(J,{className:"inline-flex h-6 w-16"});let s="neutral",c=e;return t?s="success":r&&(s="warning",c=`${e} (Update)`),jsxRuntime.jsx(at,{variant:s,size:n,shape:a,...i,children:c})}function Di(e){return jsxRuntime.jsx(reactAriaComponents.Form,{validationBehavior:"aria",...e,className:tailwindMerge.twMerge("flex flex-col gap-6",e.className)})}function wC({placeholder:e="Search...",value:t,onChange:r,isOpen:o,onOpenChange:n,trigger:a,children:i,showShortcutHint:s=true,showInput:c=true,className:l}){let[d,u]=He.useState(false),p=Qt("(max-width: 767px)"),m=o!==void 0?o:d,f=He.useCallback(h=>{n?n(h):u(h);},[n]);He.useEffect(()=>{let h=y=>{(y.metaKey||y.ctrlKey)&&y.key==="k"&&(y.preventDefault(),f(!m)),y.key==="Escape"&&m&&f(false);};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[m,f]);let g=He.useCallback(h=>{r?.(h);},[r]),b=jsxRuntime.jsxs("button",{type:"button",className:"flex items-center gap-2 px-3 py-2 text-sm text-text-secondary hover:text-text-primary hover:bg-background-hover rounded-md transition-colors","aria-label":"Open search",children:[jsxRuntime.jsx(U,{name:"MagnifyingGlass",size:18}),!p&&s&&jsxRuntime.jsxs("span",{className:"hidden md:flex items-center gap-1 text-xs",children:[jsxRuntime.jsx("kbd",{className:"px-1.5 py-0.5 bg-background-muted border border-border-muted rounded text-xs",children:navigator.platform.includes("Mac")?"\u2318":"Ctrl"}),jsxRuntime.jsx("kbd",{className:"px-1.5 py-0.5 bg-background-muted border border-border-muted rounded text-xs",children:"K"})]})]}),x=a===null||He.isValidElement(a)&&a.type===He.Fragment&&!a.props.children;return p?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!x&&(a?jsxRuntime.jsx("button",{type:"button",onClick:()=>f(true),className:"appearance-none bg-transparent border-none p-0 cursor-pointer",children:a}):jsxRuntime.jsx("button",{type:"button",onClick:()=>f(true),className:"appearance-none bg-transparent border-none p-0 cursor-pointer",children:b})),jsxRuntime.jsx(ct,{isOpen:m,onClose:()=>f(false),hideCloseIcon:false,contentPadding:false,maxHeight:"90vh",children:jsxRuntime.jsxs("div",{className:"flex flex-col h-full",children:[c&&jsxRuntime.jsx("div",{className:"p-4 border-b border-border-muted flex-shrink-0",children:jsxRuntime.jsx(Gr,{value:t,onChange:g,placeholder:e,showSearchIcon:true,isClearable:!!t,onClear:()=>r?.(""),reserveErrorSpace:false,className:l,autoFocus:true})}),jsxRuntime.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:i})]})})]}):x?null:jsxRuntime.jsxs(reactAriaComponents.DialogTrigger,{isOpen:m,onOpenChange:f,children:[a||b,jsxRuntime.jsx(lt,{placement:"bottom",className:"w-[600px] max-w-[90vw] bg-background-surface shadow-xl border border-border-default rounded-lg overflow-hidden",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[c&&jsxRuntime.jsx("div",{className:"p-4 border-b border-border-muted",children:jsxRuntime.jsx(Gr,{value:t,onChange:g,placeholder:e,showSearchIcon:true,isClearable:!!t,onClear:()=>r?.(""),reserveErrorSpace:false,className:l,autoFocus:true})}),jsxRuntime.jsx("div",{className:"max-h-[500px] overflow-hidden",children:i})]})})]})}function kC({placeholder:e="Search...",value:t,onChange:r,isOpen:o,onOpenChange:n,children:a,maxHeight:i="400px",variant:s="default",className:c}){let[l,d]=He.useState(false),u=Qt("(max-width: 767px)"),p=He.useRef(null),m=He.useRef(null),f=o!==void 0?o:l,g=He.useCallback(A=>{n?n(A):d(A);},[n]);He.useEffect(()=>{let A=O=>{(O.metaKey||O.ctrlKey)&&O.key==="k"&&(O.preventDefault(),g(!f)),O.key==="Escape"&&f&&g(false);};return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)},[f,g]),He.useEffect(()=>{f&&!u&&p.current&&setTimeout(()=>{p.current?.querySelector("input")?.focus();},0);},[f,u]),He.useEffect(()=>{if(!f||u)return;let A=O=>{let P=O.target,T=p.current?.contains(P),k=m.current?.contains(P);!T&&!k&&g(false);};return document.addEventListener("mousedown",A,true),()=>document.removeEventListener("mousedown",A,true)},[f,u,g]);let b=A=>{r?.(A);},x=He.useCallback(()=>{g(false);},[g]),h=He.useCallback(()=>{r?.("");},[r]),[y,v]=He.useState(null);He.useEffect(()=>{if(f&&!u&&p.current){let A=null,O=()=>{let T=p.current?.getBoundingClientRect();T&&v({top:T.bottom+8,left:T.left,width:T.width});},P=()=>{A===null&&(A=requestAnimationFrame(()=>{O(),A=null;}));};return O(),window.addEventListener("resize",P),window.addEventListener("scroll",P,true),()=>{window.removeEventListener("resize",P),window.removeEventListener("scroll",P,true),A!==null&&cancelAnimationFrame(A);}}},[f,u]);let S=He.useCallback(()=>{g(true);},[g]);if(u)return jsxRuntime.jsxs("div",{className:c,children:[jsxRuntime.jsx("button",{type:"button",onClick:S,className:"flex items-center justify-center w-10 h-10 rounded-lg hover:bg-background-hover transition-colors","aria-label":"Open search",children:jsxRuntime.jsx(U,{name:"MagnifyingGlass",size:"md"})}),jsxRuntime.jsxs(ct,{isOpen:f,onClose:x,contentPadding:false,height:"80vh",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 px-4 pt-4",children:[jsxRuntime.jsx("div",{className:"flex-1",children:jsxRuntime.jsx(Gr,{value:t,onChange:b,placeholder:e,showSearchIcon:true,isClearable:!!t,onClear:h,reserveErrorSpace:false,autoFocus:true})}),jsxRuntime.jsx(re,{variant:"icon",onPress:x,"aria-label":"Close search",className:"flex-shrink-0",children:jsxRuntime.jsx(U,{name:"X",size:"md"})})]}),jsxRuntime.jsx("div",{className:"mt-4",children:a})]})]},"mobile");let w=A=>{let P=A.target.tagName==="INPUT";if(A.key==="ArrowDown"&&f&&P){A.preventDefault();let T=m.current?.querySelector("[data-search-result]");T&&T.focus();}},N=A=>{let O=A.target;if(!O.hasAttribute("data-search-result"))return;let T=Array.from(m.current?.querySelectorAll("[data-search-result]")||[]),k=T.indexOf(O);if(A.key==="ArrowDown"){A.preventDefault(),A.stopPropagation();let V=Math.min(k+1,T.length-1);T[V]?.focus();}else if(A.key==="ArrowUp")if(A.preventDefault(),A.stopPropagation(),k===0)p.current?.querySelector("input")?.focus();else {let V=Math.max(k-1,0);T[V]?.focus();}else A.key==="Escape"&&(A.preventDefault(),A.stopPropagation(),g(false),p.current?.querySelector("input")?.focus());},D=f&&y&&typeof document<"u"?reactDom.createPortal(jsxRuntime.jsx("div",{ref:m,style:{position:"fixed",top:`${y.top}px`,left:`${y.left}px`,width:`${y.width}px`,zIndex:9999},role:"listbox",onKeyDown:N,children:jsxRuntime.jsx("div",{className:"bg-background-surface shadow-2xl border border-border-default rounded-lg overflow-hidden animate-in fade-in zoom-in-95 duration-200",children:jsxRuntime.jsx("div",{className:"overflow-y-auto",style:{maxHeight:i},children:a})})}),document.body):null,R=s==="elevated"?"bg-background-muted/50 border-border-subtle/50 focus-within:bg-background-body focus-within:border-border-focus focus-within:shadow-md backdrop-blur-sm transition-all duration-200":"";return jsxRuntime.jsxs("div",{ref:p,className:`relative w-full ${c||""}`,onKeyDown:w,children:[jsxRuntime.jsx(Gr,{value:t,onChange:b,placeholder:e,showSearchIcon:true,isClearable:!!t,onClear:()=>r?.(""),reserveErrorSpace:false,className:R,onFocus:()=>g(true)}),D]},"desktop")}function PC({message:e="No results found",suggestion:t,icon:r="MagnifyingGlass",className:o=""}){return jsxRuntime.jsxs("div",{className:`flex flex-col items-center justify-center py-12 px-4 text-center ${o}`,children:[jsxRuntime.jsx("div",{className:"text-text-secondary mb-3",children:jsxRuntime.jsx(U,{name:r,size:48})}),jsxRuntime.jsx("p",{className:"text-base font-medium text-text-primary mb-1",children:e}),t&&jsxRuntime.jsx("p",{className:"text-sm text-text-secondary max-w-xs",children:t})]})}function MC({count:e=3,className:t=""}){return jsxRuntime.jsx("div",{className:`flex flex-col ${t}`,children:Array.from({length:e}).map((r,o)=>jsxRuntime.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5",children:[jsxRuntime.jsx(J,{width:20,height:20,variant:"circle"}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[jsxRuntime.jsx(J,{width:"60%",height:16}),jsxRuntime.jsx(J,{width:"40%",height:12})]}),jsxRuntime.jsx(J,{width:16,height:16})]},o))})}function EC({title:e,count:t,isLoading:r,footer:o,children:n,className:a}){return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex flex-col",a),children:[jsxRuntime.jsxs("div",{className:"flex items-baseline gap-1.5 px-4 pt-4 pb-2 border-t border-border-muted first:border-t-0",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-text-primary",children:e}),!r&&t!==void 0&&jsxRuntime.jsx("span",{className:"text-xs text-text-secondary",children:t}),r&&jsxRuntime.jsx("span",{className:"text-xs text-text-secondary animate-pulse",children:"Loading..."})]}),jsxRuntime.jsx("div",{className:"flex flex-col",children:n}),o&&jsxRuntime.jsx("div",{className:"px-4 py-2 border-t border-border-subtle",children:o})]})}function LC({id:e,title:t,subtitle:r,metadata:o,icon:n,customIcon:a,onSelect:i,isFocused:s=false,className:c,testId:l}){return jsxRuntime.jsxs("div",{role:"option",tabIndex:0,onClick:()=>{i?.(e);},onKeyDown:p=>{let m=p.currentTarget;switch(p.key){case "Enter":case " ":{p.preventDefault(),i?.(e);break}case "ArrowDown":{p.preventDefault();let f=Array.from(document.querySelectorAll("[data-search-result]")),g=f.indexOf(m);g!==-1&&g<f.length-1&&f[g+1].focus();break}case "ArrowUp":{p.preventDefault();let f=Array.from(document.querySelectorAll("[data-search-result]")),g=f.indexOf(m);if(g>0)f[g-1].focus();else {let b=document.querySelector('input[type="text"][placeholder*="Search"]');b&&b.focus();}break}case "Escape":{p.preventDefault();let f=document.querySelector('input[type="text"][placeholder*="Search"]');f&&f.focus();break}}},"data-testid":l,"data-search-result":true,className:tailwindMerge.twMerge("group flex items-center gap-3 px-4 py-3 cursor-pointer outline-none transition-colors","text-text-primary hover:bg-background-hover","focus-visible:bg-background-muted focus-visible:outline-none","data-[focused]:bg-background-hover",s&&"bg-background-hover",c),"data-focused":s||void 0,children:[a?jsxRuntime.jsx("div",{className:"flex-shrink-0",children:a}):n?jsxRuntime.jsx("div",{className:"flex-shrink-0 text-text-secondary",children:jsxRuntime.jsx(U,{name:n,size:20})}):null,jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-baseline gap-2",children:[jsxRuntime.jsx("span",{className:"font-medium text-text-primary truncate",children:t}),o&&jsxRuntime.jsx("span",{className:"text-xs text-text-secondary flex-shrink-0",children:o})]}),r&&jsxRuntime.jsx("div",{className:"text-sm text-text-secondary truncate mt-0.5",children:r})]}),jsxRuntime.jsx("div",{className:"flex-shrink-0 opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100 group-data-[focused]:opacity-100 transition-opacity",children:jsxRuntime.jsx(U,{name:"ArrowRight",size:16,className:"text-text-secondary"})})]})}function AC({children:e,maxHeight:t="400px",className:r}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-y-auto overscroll-contain","divide-y divide-border-muted",r),style:{maxHeight:t},children:e})}function FC({placeholder:e="Search...",onClick:t,showShortcut:r=true,variant:o="default",className:n=""}){let a=typeof navigator<"u"&&navigator.platform.includes("Mac");return jsxRuntime.jsxs("button",{type:"button",onClick:t,className:`
30
30
  flex items-center gap-3 w-full px-4 py-2.5 rounded-lg
31
31
  transition-all duration-200 cursor-text
32
32
  ${{default:`