@owox/web 0.13.0-next-20251119104944 → 0.13.0-next-20251119110856

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.
@@ -0,0 +1,730 @@
1
+ var zM=Object.defineProperty;var HM=(e,t,n)=>t in e?zM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ls=(e,t,n)=>HM(e,typeof t!="symbol"?t+"":t,n);function $M(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const l=Object.getOwnPropertyDescriptor(r,o);l&&Object.defineProperty(e,o,l.get?l:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(o){if(o.ep)return;o.ep=!0;const l=n(o);fetch(o.href,l)}})();function qT(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var fx={exports:{}},Id={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Iw;function BM(){if(Iw)return Id;Iw=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,l){var c=null;if(l!==void 0&&(c=""+l),o.key!==void 0&&(c=""+o.key),"key"in o){l={};for(var d in o)d!=="key"&&(l[d]=o[d])}else l=o;return o=l.ref,{$$typeof:e,type:r,key:c,ref:o!==void 0?o:null,props:l}}return Id.Fragment=t,Id.jsx=n,Id.jsxs=n,Id}var kw;function GM(){return kw||(kw=1,fx.exports=BM()),fx.exports}var s=GM(),hx={exports:{}},ft={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Lw;function qM(){if(Lw)return ft;Lw=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),v=Symbol.iterator;function b(L){return L===null||typeof L!="object"?null:(L=v&&L[v]||L["@@iterator"],typeof L=="function"?L:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,C={};function R(L,P,q){this.props=L,this.context=P,this.refs=C,this.updater=q||w}R.prototype.isReactComponent={},R.prototype.setState=function(L,P){if(typeof L!="object"&&typeof L!="function"&&L!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,L,P,"setState")},R.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function j(){}j.prototype=R.prototype;function _(L,P,q){this.props=L,this.context=P,this.refs=C,this.updater=q||w}var D=_.prototype=new j;D.constructor=_,S(D,R.prototype),D.isPureReactComponent=!0;var A=Array.isArray;function O(){}var T={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function F(L,P,q){var te=q.ref;return{$$typeof:e,type:L,key:P,ref:te!==void 0?te:null,props:q}}function G(L,P){return F(L.type,P,L.props)}function Y(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function Z(L){var P={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(q){return P[q]})}var J=/\/+/g;function H(L,P){return typeof L=="object"&&L!==null&&L.key!=null?Z(""+L.key):P.toString(36)}function K(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(O,O):(L.status="pending",L.then(function(P){L.status==="pending"&&(L.status="fulfilled",L.value=P)},function(P){L.status==="pending"&&(L.status="rejected",L.reason=P)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function k(L,P,q,te,ue){var ve=typeof L;(ve==="undefined"||ve==="boolean")&&(L=null);var le=!1;if(L===null)le=!0;else switch(ve){case"bigint":case"string":case"number":le=!0;break;case"object":switch(L.$$typeof){case e:case t:le=!0;break;case g:return le=L._init,k(le(L._payload),P,q,te,ue)}}if(le)return ue=ue(L),le=te===""?"."+H(L,0):te,A(ue)?(q="",le!=null&&(q=le.replace(J,"$&/")+"/"),k(ue,P,q,"",function(Ne){return Ne})):ue!=null&&(Y(ue)&&(ue=G(ue,q+(ue.key==null||L&&L.key===ue.key?"":(""+ue.key).replace(J,"$&/")+"/")+le)),P.push(ue)),1;le=0;var Ae=te===""?".":te+":";if(A(L))for(var we=0;we<L.length;we++)te=L[we],ve=Ae+H(te,we),le+=k(te,P,q,ve,ue);else if(we=b(L),typeof we=="function")for(L=we.call(L),we=0;!(te=L.next()).done;)te=te.value,ve=Ae+H(te,we++),le+=k(te,P,q,ve,ue);else if(ve==="object"){if(typeof L.then=="function")return k(K(L),P,q,te,ue);throw P=String(L),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return le}function z(L,P,q){if(L==null)return L;var te=[],ue=0;return k(L,te,"","",function(ve){return P.call(q,ve,ue++)}),te}function B(L){if(L._status===-1){var P=L._result;P=P(),P.then(function(q){(L._status===0||L._status===-1)&&(L._status=1,L._result=q)},function(q){(L._status===0||L._status===-1)&&(L._status=2,L._result=q)}),L._status===-1&&(L._status=0,L._result=P)}if(L._status===1)return L._result.default;throw L._result}var ie=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},xe={map:z,forEach:function(L,P,q){z(L,function(){P.apply(this,arguments)},q)},count:function(L){var P=0;return z(L,function(){P++}),P},toArray:function(L){return z(L,function(P){return P})||[]},only:function(L){if(!Y(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return ft.Activity=y,ft.Children=xe,ft.Component=R,ft.Fragment=n,ft.Profiler=o,ft.PureComponent=_,ft.StrictMode=r,ft.Suspense=f,ft.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,ft.__COMPILER_RUNTIME={__proto__:null,c:function(L){return T.H.useMemoCache(L)}},ft.cache=function(L){return function(){return L.apply(null,arguments)}},ft.cacheSignal=function(){return null},ft.cloneElement=function(L,P,q){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var te=S({},L.props),ue=L.key;if(P!=null)for(ve in P.key!==void 0&&(ue=""+P.key),P)!M.call(P,ve)||ve==="key"||ve==="__self"||ve==="__source"||ve==="ref"&&P.ref===void 0||(te[ve]=P[ve]);var ve=arguments.length-2;if(ve===1)te.children=q;else if(1<ve){for(var le=Array(ve),Ae=0;Ae<ve;Ae++)le[Ae]=arguments[Ae+2];te.children=le}return F(L.type,ue,te)},ft.createContext=function(L){return L={$$typeof:c,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:l,_context:L},L},ft.createElement=function(L,P,q){var te,ue={},ve=null;if(P!=null)for(te in P.key!==void 0&&(ve=""+P.key),P)M.call(P,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(ue[te]=P[te]);var le=arguments.length-2;if(le===1)ue.children=q;else if(1<le){for(var Ae=Array(le),we=0;we<le;we++)Ae[we]=arguments[we+2];ue.children=Ae}if(L&&L.defaultProps)for(te in le=L.defaultProps,le)ue[te]===void 0&&(ue[te]=le[te]);return F(L,ve,ue)},ft.createRef=function(){return{current:null}},ft.forwardRef=function(L){return{$$typeof:d,render:L}},ft.isValidElement=Y,ft.lazy=function(L){return{$$typeof:g,_payload:{_status:-1,_result:L},_init:B}},ft.memo=function(L,P){return{$$typeof:h,type:L,compare:P===void 0?null:P}},ft.startTransition=function(L){var P=T.T,q={};T.T=q;try{var te=L(),ue=T.S;ue!==null&&ue(q,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(O,ie)}catch(ve){ie(ve)}finally{P!==null&&q.types!==null&&(P.types=q.types),T.T=P}},ft.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},ft.use=function(L){return T.H.use(L)},ft.useActionState=function(L,P,q){return T.H.useActionState(L,P,q)},ft.useCallback=function(L,P){return T.H.useCallback(L,P)},ft.useContext=function(L){return T.H.useContext(L)},ft.useDebugValue=function(){},ft.useDeferredValue=function(L,P){return T.H.useDeferredValue(L,P)},ft.useEffect=function(L,P){return T.H.useEffect(L,P)},ft.useEffectEvent=function(L){return T.H.useEffectEvent(L)},ft.useId=function(){return T.H.useId()},ft.useImperativeHandle=function(L,P,q){return T.H.useImperativeHandle(L,P,q)},ft.useInsertionEffect=function(L,P){return T.H.useInsertionEffect(L,P)},ft.useLayoutEffect=function(L,P){return T.H.useLayoutEffect(L,P)},ft.useMemo=function(L,P){return T.H.useMemo(L,P)},ft.useOptimistic=function(L,P){return T.H.useOptimistic(L,P)},ft.useReducer=function(L,P,q){return T.H.useReducer(L,P,q)},ft.useRef=function(L){return T.H.useRef(L)},ft.useState=function(L){return T.H.useState(L)},ft.useSyncExternalStore=function(L,P,q){return T.H.useSyncExternalStore(L,P,q)},ft.useTransition=function(){return T.H.useTransition()},ft.version="19.2.0",ft}var Pw;function _1(){return Pw||(Pw=1,hx.exports=qM()),hx.exports}var m=_1();const ye=qT(m),N1=$M({__proto__:null,default:ye},[m]);var mx={exports:{}},kd={},px={exports:{}},gx={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var Uw;function ZM(){return Uw||(Uw=1,(function(e){function t(k,z){var B=k.length;k.push(z);e:for(;0<B;){var ie=B-1>>>1,xe=k[ie];if(0<o(xe,z))k[ie]=z,k[B]=xe,B=ie;else break e}}function n(k){return k.length===0?null:k[0]}function r(k){if(k.length===0)return null;var z=k[0],B=k.pop();if(B!==z){k[0]=B;e:for(var ie=0,xe=k.length,L=xe>>>1;ie<L;){var P=2*(ie+1)-1,q=k[P],te=P+1,ue=k[te];if(0>o(q,B))te<xe&&0>o(ue,q)?(k[ie]=ue,k[te]=B,ie=te):(k[ie]=q,k[P]=B,ie=P);else if(te<xe&&0>o(ue,B))k[ie]=ue,k[te]=B,ie=te;else break e}}return z}function o(k,z){var B=k.sortIndex-z.sortIndex;return B!==0?B:k.id-z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var f=[],h=[],g=1,y=null,v=3,b=!1,w=!1,S=!1,C=!1,R=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function D(k){for(var z=n(h);z!==null;){if(z.callback===null)r(h);else if(z.startTime<=k)r(h),z.sortIndex=z.expirationTime,t(f,z);else break;z=n(h)}}function A(k){if(S=!1,D(k),!w)if(n(f)!==null)w=!0,O||(O=!0,Z());else{var z=n(h);z!==null&&K(A,z.startTime-k)}}var O=!1,T=-1,M=5,F=-1;function G(){return C?!0:!(e.unstable_now()-F<M)}function Y(){if(C=!1,O){var k=e.unstable_now();F=k;var z=!0;try{e:{w=!1,S&&(S=!1,j(T),T=-1),b=!0;var B=v;try{t:{for(D(k),y=n(f);y!==null&&!(y.expirationTime>k&&G());){var ie=y.callback;if(typeof ie=="function"){y.callback=null,v=y.priorityLevel;var xe=ie(y.expirationTime<=k);if(k=e.unstable_now(),typeof xe=="function"){y.callback=xe,D(k),z=!0;break t}y===n(f)&&r(f),D(k)}else r(f);y=n(f)}if(y!==null)z=!0;else{var L=n(h);L!==null&&K(A,L.startTime-k),z=!1}}break e}finally{y=null,v=B,b=!1}z=void 0}}finally{z?Z():O=!1}}}var Z;if(typeof _=="function")Z=function(){_(Y)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,H=J.port2;J.port1.onmessage=Y,Z=function(){H.postMessage(null)}}else Z=function(){R(Y,0)};function K(k,z){T=R(function(){k(e.unstable_now())},z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(k){k.callback=null},e.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<k?Math.floor(1e3/k):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(k){switch(v){case 1:case 2:case 3:var z=3;break;default:z=v}var B=v;v=z;try{return k()}finally{v=B}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(k,z){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var B=v;v=k;try{return z()}finally{v=B}},e.unstable_scheduleCallback=function(k,z,B){var ie=e.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?ie+B:ie):B=ie,k){case 1:var xe=-1;break;case 2:xe=250;break;case 5:xe=1073741823;break;case 4:xe=1e4;break;default:xe=5e3}return xe=B+xe,k={id:g++,callback:z,priorityLevel:k,startTime:B,expirationTime:xe,sortIndex:-1},B>ie?(k.sortIndex=B,t(h,k),n(f)===null&&k===n(h)&&(S?(j(T),T=-1):S=!0,K(A,B-ie))):(k.sortIndex=xe,t(f,k),w||b||(w=!0,O||(O=!0,Z()))),k},e.unstable_shouldYield=G,e.unstable_wrapCallback=function(k){var z=v;return function(){var B=v;v=z;try{return k.apply(this,arguments)}finally{v=B}}}})(gx)),gx}var Fw;function KM(){return Fw||(Fw=1,px.exports=ZM()),px.exports}var yx={exports:{}},Dr={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var Vw;function YM(){if(Vw)return Dr;Vw=1;var e=_1();function t(f){var h="https://react.dev/errors/"+f;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+f+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");function l(f,h,g){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:y==null?null:""+y,children:f,containerInfo:h,implementation:g}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(f,h){if(f==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Dr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Dr.createPortal=function(f,h){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return l(f,h,null,g)},Dr.flushSync=function(f){var h=c.T,g=r.p;try{if(c.T=null,r.p=2,f)return f()}finally{c.T=h,r.p=g,r.d.f()}},Dr.preconnect=function(f,h){typeof f=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(f,h))},Dr.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},Dr.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var g=h.as,y=d(g,h.crossOrigin),v=typeof h.integrity=="string"?h.integrity:void 0,b=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;g==="style"?r.d.S(f,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:y,integrity:v,fetchPriority:b}):g==="script"&&r.d.X(f,{crossOrigin:y,integrity:v,fetchPriority:b,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Dr.preinitModule=function(f,h){if(typeof f=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var g=d(h.as,h.crossOrigin);r.d.M(f,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(f)},Dr.preload=function(f,h){if(typeof f=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var g=h.as,y=d(g,h.crossOrigin);r.d.L(f,g,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Dr.preloadModule=function(f,h){if(typeof f=="string")if(h){var g=d(h.as,h.crossOrigin);r.d.m(f,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(f)},Dr.requestFormReset=function(f){r.d.r(f)},Dr.unstable_batchedUpdates=function(f,h){return f(h)},Dr.useFormState=function(f,h,g){return c.H.useFormState(f,h,g)},Dr.useFormStatus=function(){return c.H.useHostTransitionStatus()},Dr.version="19.2.0",Dr}var zw;function ZT(){if(zw)return yx.exports;zw=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),yx.exports=YM(),yx.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var Hw;function WM(){if(Hw)return kd;Hw=1;var e=KM(),t=_1(),n=ZT();function r(a){var i="https://react.dev/errors/"+a;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)i+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+a+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function l(a){var i=a,u=a;if(a.alternate)for(;i.return;)i=i.return;else{a=i;do i=a,(i.flags&4098)!==0&&(u=i.return),a=i.return;while(a)}return i.tag===3?u:null}function c(a){if(a.tag===13){var i=a.memoizedState;if(i===null&&(a=a.alternate,a!==null&&(i=a.memoizedState)),i!==null)return i.dehydrated}return null}function d(a){if(a.tag===31){var i=a.memoizedState;if(i===null&&(a=a.alternate,a!==null&&(i=a.memoizedState)),i!==null)return i.dehydrated}return null}function f(a){if(l(a)!==a)throw Error(r(188))}function h(a){var i=a.alternate;if(!i){if(i=l(a),i===null)throw Error(r(188));return i!==a?null:a}for(var u=a,p=i;;){var x=u.return;if(x===null)break;var E=x.alternate;if(E===null){if(p=x.return,p!==null){u=p;continue}break}if(x.child===E.child){for(E=x.child;E;){if(E===u)return f(x),a;if(E===p)return f(x),i;E=E.sibling}throw Error(r(188))}if(u.return!==p.return)u=x,p=E;else{for(var N=!1,I=x.child;I;){if(I===u){N=!0,u=x,p=E;break}if(I===p){N=!0,p=x,u=E;break}I=I.sibling}if(!N){for(I=E.child;I;){if(I===u){N=!0,u=E,p=x;break}if(I===p){N=!0,p=E,u=x;break}I=I.sibling}if(!N)throw Error(r(189))}}if(u.alternate!==p)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?a:i}function g(a){var i=a.tag;if(i===5||i===26||i===27||i===6)return a;for(a=a.child;a!==null;){if(i=g(a),i!==null)return i;a=a.sibling}return null}var y=Object.assign,v=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),_=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),G=Symbol.for("react.memo_cache_sentinel"),Y=Symbol.iterator;function Z(a){return a===null||typeof a!="object"?null:(a=Y&&a[Y]||a["@@iterator"],typeof a=="function"?a:null)}var J=Symbol.for("react.client.reference");function H(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===J?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case S:return"Fragment";case R:return"Profiler";case C:return"StrictMode";case A:return"Suspense";case O:return"SuspenseList";case F:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case w:return"Portal";case _:return a.displayName||"Context";case j:return(a._context.displayName||"Context")+".Consumer";case D:var i=a.render;return a=a.displayName,a||(a=i.displayName||i.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case T:return i=a.displayName||null,i!==null?i:H(a.type)||"Memo";case M:i=a._payload,a=a._init;try{return H(a(i))}catch{}}return null}var K=Array.isArray,k=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B={pending:!1,data:null,method:null,action:null},ie=[],xe=-1;function L(a){return{current:a}}function P(a){0>xe||(a.current=ie[xe],ie[xe]=null,xe--)}function q(a,i){xe++,ie[xe]=a.current,a.current=i}var te=L(null),ue=L(null),ve=L(null),le=L(null);function Ae(a,i){switch(q(ve,i),q(ue,a),q(te,null),i.nodeType){case 9:case 11:a=(a=i.documentElement)&&(a=a.namespaceURI)?rw(a):0;break;default:if(a=i.tagName,i=i.namespaceURI)i=rw(i),a=aw(i,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}P(te),q(te,a)}function we(){P(te),P(ue),P(ve)}function Ne(a){a.memoizedState!==null&&q(le,a);var i=te.current,u=aw(i,a.type);i!==u&&(q(ue,a),q(te,u))}function Be(a){ue.current===a&&(P(te),P(ue)),le.current===a&&(P(le),Ad._currentValue=B)}var Qe,qt;function Dt(a){if(Qe===void 0)try{throw Error()}catch(u){var i=u.stack.trim().match(/\n( *(at )?)/);Qe=i&&i[1]||"",qt=-1<u.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+Qe+a+qt}var Zt=!1;function jn(a,i){if(!a||Zt)return"";Zt=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(i){var pe=function(){throw Error()};if(Object.defineProperty(pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pe,[])}catch(fe){var oe=fe}Reflect.construct(a,[],pe)}else{try{pe.call()}catch(fe){oe=fe}a.call(pe.prototype)}}else{try{throw Error()}catch(fe){oe=fe}(pe=a())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(fe){if(fe&&oe&&typeof fe.stack=="string")return[fe.stack,oe.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var x=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");x&&x.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var E=p.DetermineComponentFrameRoot(),N=E[0],I=E[1];if(N&&I){var $=N.split(`
44
+ `),ae=I.split(`
45
+ `);for(x=p=0;p<$.length&&!$[p].includes("DetermineComponentFrameRoot");)p++;for(;x<ae.length&&!ae[x].includes("DetermineComponentFrameRoot");)x++;if(p===$.length||x===ae.length)for(p=$.length-1,x=ae.length-1;1<=p&&0<=x&&$[p]!==ae[x];)x--;for(;1<=p&&0<=x;p--,x--)if($[p]!==ae[x]){if(p!==1||x!==1)do if(p--,x--,0>x||$[p]!==ae[x]){var he=`
46
+ `+$[p].replace(" at new "," at ");return a.displayName&&he.includes("<anonymous>")&&(he=he.replace("<anonymous>",a.displayName)),he}while(1<=p&&0<=x);break}}}finally{Zt=!1,Error.prepareStackTrace=u}return(u=a?a.displayName||a.name:"")?Dt(u):""}function Nr(a,i){switch(a.tag){case 26:case 27:case 5:return Dt(a.type);case 16:return Dt("Lazy");case 13:return a.child!==i&&i!==null?Dt("Suspense Fallback"):Dt("Suspense");case 19:return Dt("SuspenseList");case 0:case 15:return jn(a.type,!1);case 11:return jn(a.type.render,!1);case 1:return jn(a.type,!0);case 31:return Dt("Activity");default:return""}}function va(a){try{var i="",u=null;do i+=Nr(a,u),u=a,a=a.return;while(a);return i}catch(p){return`
47
+ Error generating stack: `+p.message+`
48
+ `+p.stack}}var Ve=Object.prototype.hasOwnProperty,U=e.unstable_scheduleCallback,Q=e.unstable_cancelCallback,de=e.unstable_shouldYield,_e=e.unstable_requestPaint,be=e.unstable_now,Ee=e.unstable_getCurrentPriorityLevel,We=e.unstable_ImmediatePriority,ot=e.unstable_UserBlockingPriority,it=e.unstable_NormalPriority,xn=e.unstable_LowPriority,Ua=e.unstable_IdlePriority,bn=e.log,ei=e.unstable_setDisableYieldValue,Fn=null,Tn=null;function vr(a){if(typeof bn=="function"&&ei(a),Tn&&typeof Tn.setStrictMode=="function")try{Tn.setStrictMode(Fn,a)}catch{}}var _n=Math.clz32?Math.clz32:ti,ul=Math.log,Ns=Math.LN2;function ti(a){return a>>>=0,a===0?32:31-(ul(a)/Ns|0)|0}var to=256,As=262144,Sn=4194304;function pn(a){var i=a&42;if(i!==0)return i;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function Gn(a,i,u){var p=a.pendingLanes;if(p===0)return 0;var x=0,E=a.suspendedLanes,N=a.pingedLanes;a=a.warmLanes;var I=p&134217727;return I!==0?(p=I&~E,p!==0?x=pn(p):(N&=I,N!==0?x=pn(N):u||(u=I&~a,u!==0&&(x=pn(u))))):(I=p&~E,I!==0?x=pn(I):N!==0?x=pn(N):u||(u=p&~a,u!==0&&(x=pn(u)))),x===0?0:i!==0&&i!==x&&(i&E)===0&&(E=x&-x,u=i&-i,E>=u||E===32&&(u&4194048)!==0)?i:x}function xr(a,i){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&i)===0}function er(a,i){switch(a){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Vn(){var a=Sn;return Sn<<=1,(Sn&62914560)===0&&(Sn=4194304),a}function Ar(a){for(var i=[],u=0;31>u;u++)i.push(a);return i}function Xr(a,i){a.pendingLanes|=i,i!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function V(a,i,u,p,x,E){var N=a.pendingLanes;a.pendingLanes=u,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=u,a.entangledLanes&=u,a.errorRecoveryDisabledLanes&=u,a.shellSuspendCounter=0;var I=a.entanglements,$=a.expirationTimes,ae=a.hiddenUpdates;for(u=N&~u;0<u;){var he=31-_n(u),pe=1<<he;I[he]=0,$[he]=-1;var oe=ae[he];if(oe!==null)for(ae[he]=null,he=0;he<oe.length;he++){var fe=oe[he];fe!==null&&(fe.lane&=-536870913)}u&=~pe}p!==0&&X(a,p,0),E!==0&&x===0&&a.tag!==0&&(a.suspendedLanes|=E&~(N&~i))}function X(a,i,u){a.pendingLanes|=i,a.suspendedLanes&=~i;var p=31-_n(i);a.entangledLanes|=i,a.entanglements[p]=a.entanglements[p]|1073741824|u&261930}function se(a,i){var u=a.entangledLanes|=i;for(a=a.entanglements;u;){var p=31-_n(u),x=1<<p;x&i|a[p]&i&&(a[p]|=i),u&=~x}}function ge(a,i){var u=i&-i;return u=(u&42)!==0?1:Re(u),(u&(a.suspendedLanes|i))!==0?0:u}function Re(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function ze(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function Le(){var a=z.p;return a!==0?a:(a=window.event,a===void 0?32:Tw(a.type))}function Ie(a,i){var u=z.p;try{return z.p=a,i()}finally{z.p=u}}var Pe=Math.random().toString(36).slice(2),He="__reactFiber$"+Pe,qe="__reactProps$"+Pe,Ze="__reactContainer$"+Pe,ut="__reactEvents$"+Pe,en="__reactListeners$"+Pe,qn="__reactHandles$"+Pe,hr="__reactResources$"+Pe,Kt="__reactMarker$"+Pe;function Yt(a){delete a[He],delete a[qe],delete a[ut],delete a[en],delete a[qn]}function Jr(a){var i=a[He];if(i)return i;for(var u=a.parentNode;u;){if(i=u[Ze]||u[He]){if(u=i.alternate,i.child!==null||u!==null&&u.child!==null)for(a=dw(a);a!==null;){if(u=a[He])return u;a=dw(a)}return i}a=u,u=a.parentNode}return null}function Fa(a){if(a=a[He]||a[Ze]){var i=a.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return a}return null}function ea(a){var i=a.tag;if(i===5||i===26||i===27||i===6)return a.stateNode;throw Error(r(33))}function br(a){var i=a[hr];return i||(i=a[hr]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Nn(a){a[Kt]=!0}var ni=new Set,Ds={};function Va(a,i){ss(a,i),ss(a+"Capture",i)}function ss(a,i){for(Ds[a]=i,a=0;a<i.length;a++)ni.add(i[a])}var Ot=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),tr={},no={};function ro(a){return Ve.call(no,a)?!0:Ve.call(tr,a)?!1:Ot.test(a)?no[a]=!0:(tr[a]=!0,!1)}function gn(a,i,u){if(ro(i))if(u===null)a.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":a.removeAttribute(i);return;case"boolean":var p=i.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){a.removeAttribute(i);return}}a.setAttribute(i,""+u)}}function ao(a,i,u){if(u===null)a.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(i);return}a.setAttribute(i,""+u)}}function za(a,i,u,p){if(p===null)a.removeAttribute(u);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(u);return}a.setAttributeNS(i,u,""+p)}}function ta(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function YS(a){var i=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function I6(a,i,u){var p=Object.getOwnPropertyDescriptor(a.constructor.prototype,i);if(!a.hasOwnProperty(i)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var x=p.get,E=p.set;return Object.defineProperty(a,i,{configurable:!0,get:function(){return x.call(this)},set:function(N){u=""+N,E.call(this,N)}}),Object.defineProperty(a,i,{enumerable:p.enumerable}),{getValue:function(){return u},setValue:function(N){u=""+N},stopTracking:function(){a._valueTracker=null,delete a[i]}}}}function sy(a){if(!a._valueTracker){var i=YS(a)?"checked":"value";a._valueTracker=I6(a,i,""+a[i])}}function WS(a){if(!a)return!1;var i=a._valueTracker;if(!i)return!0;var u=i.getValue(),p="";return a&&(p=YS(a)?a.checked?"true":"false":a.value),a=p,a!==u?(i.setValue(a),!0):!1}function ih(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var k6=/[\n"\\]/g;function Ha(a){return a.replace(k6,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function oy(a,i,u,p,x,E,N,I){a.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?a.type=N:a.removeAttribute("type"),i!=null?N==="number"?(i===0&&a.value===""||a.value!=i)&&(a.value=""+ta(i)):a.value!==""+ta(i)&&(a.value=""+ta(i)):N!=="submit"&&N!=="reset"||a.removeAttribute("value"),i!=null?iy(a,N,ta(i)):u!=null?iy(a,N,ta(u)):p!=null&&a.removeAttribute("value"),x==null&&E!=null&&(a.defaultChecked=!!E),x!=null&&(a.checked=x&&typeof x!="function"&&typeof x!="symbol"),I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?a.name=""+ta(I):a.removeAttribute("name")}function QS(a,i,u,p,x,E,N,I){if(E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(a.type=E),i!=null||u!=null){if(!(E!=="submit"&&E!=="reset"||i!=null)){sy(a);return}u=u!=null?""+ta(u):"",i=i!=null?""+ta(i):u,I||i===a.value||(a.value=i),a.defaultValue=i}p=p??x,p=typeof p!="function"&&typeof p!="symbol"&&!!p,a.checked=I?a.checked:!!p,a.defaultChecked=!!p,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(a.name=N),sy(a)}function iy(a,i,u){i==="number"&&ih(a.ownerDocument)===a||a.defaultValue===""+u||(a.defaultValue=""+u)}function fc(a,i,u,p){if(a=a.options,i){i={};for(var x=0;x<u.length;x++)i["$"+u[x]]=!0;for(u=0;u<a.length;u++)x=i.hasOwnProperty("$"+a[u].value),a[u].selected!==x&&(a[u].selected=x),x&&p&&(a[u].defaultSelected=!0)}else{for(u=""+ta(u),i=null,x=0;x<a.length;x++){if(a[x].value===u){a[x].selected=!0,p&&(a[x].defaultSelected=!0);return}i!==null||a[x].disabled||(i=a[x])}i!==null&&(i.selected=!0)}}function XS(a,i,u){if(i!=null&&(i=""+ta(i),i!==a.value&&(a.value=i),u==null)){a.defaultValue!==i&&(a.defaultValue=i);return}a.defaultValue=u!=null?""+ta(u):""}function JS(a,i,u,p){if(i==null){if(p!=null){if(u!=null)throw Error(r(92));if(K(p)){if(1<p.length)throw Error(r(93));p=p[0]}u=p}u==null&&(u=""),i=u}u=ta(i),a.defaultValue=u,p=a.textContent,p===u&&p!==""&&p!==null&&(a.value=p),sy(a)}function hc(a,i){if(i){var u=a.firstChild;if(u&&u===a.lastChild&&u.nodeType===3){u.nodeValue=i;return}}a.textContent=i}var L6=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function eC(a,i,u){var p=i.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?p?a.setProperty(i,""):i==="float"?a.cssFloat="":a[i]="":p?a.setProperty(i,u):typeof u!="number"||u===0||L6.has(i)?i==="float"?a.cssFloat=u:a[i]=(""+u).trim():a[i]=u+"px"}function tC(a,i,u){if(i!=null&&typeof i!="object")throw Error(r(62));if(a=a.style,u!=null){for(var p in u)!u.hasOwnProperty(p)||i!=null&&i.hasOwnProperty(p)||(p.indexOf("--")===0?a.setProperty(p,""):p==="float"?a.cssFloat="":a[p]="");for(var x in i)p=i[x],i.hasOwnProperty(x)&&u[x]!==p&&eC(a,x,p)}else for(var E in i)i.hasOwnProperty(E)&&eC(a,E,i[E])}function ly(a){if(a.indexOf("-")===-1)return!1;switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var P6=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),U6=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function lh(a){return U6.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function so(){}var cy=null;function uy(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var mc=null,pc=null;function nC(a){var i=Fa(a);if(i&&(a=i.stateNode)){var u=a[qe]||null;e:switch(a=i.stateNode,i.type){case"input":if(oy(a,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),i=u.name,u.type==="radio"&&i!=null){for(u=a;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+Ha(""+i)+'"][type="radio"]'),i=0;i<u.length;i++){var p=u[i];if(p!==a&&p.form===a.form){var x=p[qe]||null;if(!x)throw Error(r(90));oy(p,x.value,x.defaultValue,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name)}}for(i=0;i<u.length;i++)p=u[i],p.form===a.form&&WS(p)}break e;case"textarea":XS(a,u.value,u.defaultValue);break e;case"select":i=u.value,i!=null&&fc(a,!!u.multiple,i,!1)}}}var dy=!1;function rC(a,i,u){if(dy)return a(i,u);dy=!0;try{var p=a(i);return p}finally{if(dy=!1,(mc!==null||pc!==null)&&(Yh(),mc&&(i=mc,a=pc,pc=mc=null,nC(i),a)))for(i=0;i<a.length;i++)nC(a[i])}}function Zu(a,i){var u=a.stateNode;if(u===null)return null;var p=u[qe]||null;if(p===null)return null;u=p[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(a=a.type,p=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!p;break e;default:a=!1}if(a)return null;if(u&&typeof u!="function")throw Error(r(231,i,typeof u));return u}var oo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fy=!1;if(oo)try{var Ku={};Object.defineProperty(Ku,"passive",{get:function(){fy=!0}}),window.addEventListener("test",Ku,Ku),window.removeEventListener("test",Ku,Ku)}catch{fy=!1}var ri=null,hy=null,ch=null;function aC(){if(ch)return ch;var a,i=hy,u=i.length,p,x="value"in ri?ri.value:ri.textContent,E=x.length;for(a=0;a<u&&i[a]===x[a];a++);var N=u-a;for(p=1;p<=N&&i[u-p]===x[E-p];p++);return ch=x.slice(a,1<p?1-p:void 0)}function uh(a){var i=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&i===13&&(a=13)):a=i,a===10&&(a=13),32<=a||a===13?a:0}function dh(){return!0}function sC(){return!1}function na(a){function i(u,p,x,E,N){this._reactName=u,this._targetInst=x,this.type=p,this.nativeEvent=E,this.target=N,this.currentTarget=null;for(var I in a)a.hasOwnProperty(I)&&(u=a[I],this[I]=u?u(E):E[I]);return this.isDefaultPrevented=(E.defaultPrevented!=null?E.defaultPrevented:E.returnValue===!1)?dh:sC,this.isPropagationStopped=sC,this}return y(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=dh)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=dh)},persist:function(){},isPersistent:dh}),i}var dl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fh=na(dl),Yu=y({},dl,{view:0,detail:0}),F6=na(Yu),my,py,Wu,hh=y({},Yu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:yy,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==Wu&&(Wu&&a.type==="mousemove"?(my=a.screenX-Wu.screenX,py=a.screenY-Wu.screenY):py=my=0,Wu=a),my)},movementY:function(a){return"movementY"in a?a.movementY:py}}),oC=na(hh),V6=y({},hh,{dataTransfer:0}),z6=na(V6),H6=y({},Yu,{relatedTarget:0}),gy=na(H6),$6=y({},dl,{animationName:0,elapsedTime:0,pseudoElement:0}),B6=na($6),G6=y({},dl,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),q6=na(G6),Z6=y({},dl,{data:0}),iC=na(Z6),K6={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Y6={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},W6={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Q6(a){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(a):(a=W6[a])?!!i[a]:!1}function yy(){return Q6}var X6=y({},Yu,{key:function(a){if(a.key){var i=K6[a.key]||a.key;if(i!=="Unidentified")return i}return a.type==="keypress"?(a=uh(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?Y6[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:yy,charCode:function(a){return a.type==="keypress"?uh(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?uh(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),J6=na(X6),e8=y({},hh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),lC=na(e8),t8=y({},Yu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:yy}),n8=na(t8),r8=y({},dl,{propertyName:0,elapsedTime:0,pseudoElement:0}),a8=na(r8),s8=y({},hh,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),o8=na(s8),i8=y({},dl,{newState:0,oldState:0}),l8=na(i8),c8=[9,13,27,32],vy=oo&&"CompositionEvent"in window,Qu=null;oo&&"documentMode"in document&&(Qu=document.documentMode);var u8=oo&&"TextEvent"in window&&!Qu,cC=oo&&(!vy||Qu&&8<Qu&&11>=Qu),uC=" ",dC=!1;function fC(a,i){switch(a){case"keyup":return c8.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hC(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var gc=!1;function d8(a,i){switch(a){case"compositionend":return hC(i);case"keypress":return i.which!==32?null:(dC=!0,uC);case"textInput":return a=i.data,a===uC&&dC?null:a;default:return null}}function f8(a,i){if(gc)return a==="compositionend"||!vy&&fC(a,i)?(a=aC(),ch=hy=ri=null,gc=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return cC&&i.locale!=="ko"?null:i.data;default:return null}}var h8={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function mC(a){var i=a&&a.nodeName&&a.nodeName.toLowerCase();return i==="input"?!!h8[a.type]:i==="textarea"}function pC(a,i,u,p){mc?pc?pc.push(p):pc=[p]:mc=p,i=nm(i,"onChange"),0<i.length&&(u=new fh("onChange","change",null,u,p),a.push({event:u,listeners:i}))}var Xu=null,Ju=null;function m8(a){QE(a,0)}function mh(a){var i=ea(a);if(WS(i))return a}function gC(a,i){if(a==="change")return i}var yC=!1;if(oo){var xy;if(oo){var by="oninput"in document;if(!by){var vC=document.createElement("div");vC.setAttribute("oninput","return;"),by=typeof vC.oninput=="function"}xy=by}else xy=!1;yC=xy&&(!document.documentMode||9<document.documentMode)}function xC(){Xu&&(Xu.detachEvent("onpropertychange",bC),Ju=Xu=null)}function bC(a){if(a.propertyName==="value"&&mh(Ju)){var i=[];pC(i,Ju,a,uy(a)),rC(m8,i)}}function p8(a,i,u){a==="focusin"?(xC(),Xu=i,Ju=u,Xu.attachEvent("onpropertychange",bC)):a==="focusout"&&xC()}function g8(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return mh(Ju)}function y8(a,i){if(a==="click")return mh(i)}function v8(a,i){if(a==="input"||a==="change")return mh(i)}function x8(a,i){return a===i&&(a!==0||1/a===1/i)||a!==a&&i!==i}var xa=typeof Object.is=="function"?Object.is:x8;function ed(a,i){if(xa(a,i))return!0;if(typeof a!="object"||a===null||typeof i!="object"||i===null)return!1;var u=Object.keys(a),p=Object.keys(i);if(u.length!==p.length)return!1;for(p=0;p<u.length;p++){var x=u[p];if(!Ve.call(i,x)||!xa(a[x],i[x]))return!1}return!0}function SC(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function CC(a,i){var u=SC(a);a=0;for(var p;u;){if(u.nodeType===3){if(p=a+u.textContent.length,a<=i&&p>=i)return{node:u,offset:i-a};a=p}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=SC(u)}}function EC(a,i){return a&&i?a===i?!0:a&&a.nodeType===3?!1:i&&i.nodeType===3?EC(a,i.parentNode):"contains"in a?a.contains(i):a.compareDocumentPosition?!!(a.compareDocumentPosition(i)&16):!1:!1}function wC(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var i=ih(a.document);i instanceof a.HTMLIFrameElement;){try{var u=typeof i.contentWindow.location.href=="string"}catch{u=!1}if(u)a=i.contentWindow;else break;i=ih(a.document)}return i}function Sy(a){var i=a&&a.nodeName&&a.nodeName.toLowerCase();return i&&(i==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||i==="textarea"||a.contentEditable==="true")}var b8=oo&&"documentMode"in document&&11>=document.documentMode,yc=null,Cy=null,td=null,Ey=!1;function RC(a,i,u){var p=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Ey||yc==null||yc!==ih(p)||(p=yc,"selectionStart"in p&&Sy(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),td&&ed(td,p)||(td=p,p=nm(Cy,"onSelect"),0<p.length&&(i=new fh("onSelect","select",null,i,u),a.push({event:i,listeners:p}),i.target=yc)))}function fl(a,i){var u={};return u[a.toLowerCase()]=i.toLowerCase(),u["Webkit"+a]="webkit"+i,u["Moz"+a]="moz"+i,u}var vc={animationend:fl("Animation","AnimationEnd"),animationiteration:fl("Animation","AnimationIteration"),animationstart:fl("Animation","AnimationStart"),transitionrun:fl("Transition","TransitionRun"),transitionstart:fl("Transition","TransitionStart"),transitioncancel:fl("Transition","TransitionCancel"),transitionend:fl("Transition","TransitionEnd")},wy={},jC={};oo&&(jC=document.createElement("div").style,"AnimationEvent"in window||(delete vc.animationend.animation,delete vc.animationiteration.animation,delete vc.animationstart.animation),"TransitionEvent"in window||delete vc.transitionend.transition);function hl(a){if(wy[a])return wy[a];if(!vc[a])return a;var i=vc[a],u;for(u in i)if(i.hasOwnProperty(u)&&u in jC)return wy[a]=i[u];return a}var TC=hl("animationend"),_C=hl("animationiteration"),NC=hl("animationstart"),S8=hl("transitionrun"),C8=hl("transitionstart"),E8=hl("transitioncancel"),AC=hl("transitionend"),DC=new Map,Ry="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Ry.push("scrollEnd");function os(a,i){DC.set(a,i),Va(i,[a])}var ph=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},$a=[],xc=0,jy=0;function gh(){for(var a=xc,i=jy=xc=0;i<a;){var u=$a[i];$a[i++]=null;var p=$a[i];$a[i++]=null;var x=$a[i];$a[i++]=null;var E=$a[i];if($a[i++]=null,p!==null&&x!==null){var N=p.pending;N===null?x.next=x:(x.next=N.next,N.next=x),p.pending=x}E!==0&&OC(u,x,E)}}function yh(a,i,u,p){$a[xc++]=a,$a[xc++]=i,$a[xc++]=u,$a[xc++]=p,jy|=p,a.lanes|=p,a=a.alternate,a!==null&&(a.lanes|=p)}function Ty(a,i,u,p){return yh(a,i,u,p),vh(a)}function ml(a,i){return yh(a,null,null,i),vh(a)}function OC(a,i,u){a.lanes|=u;var p=a.alternate;p!==null&&(p.lanes|=u);for(var x=!1,E=a.return;E!==null;)E.childLanes|=u,p=E.alternate,p!==null&&(p.childLanes|=u),E.tag===22&&(a=E.stateNode,a===null||a._visibility&1||(x=!0)),a=E,E=E.return;return a.tag===3?(E=a.stateNode,x&&i!==null&&(x=31-_n(u),a=E.hiddenUpdates,p=a[x],p===null?a[x]=[i]:p.push(i),i.lane=u|536870912),E):null}function vh(a){if(50<Ed)throw Ed=0,Lv=null,Error(r(185));for(var i=a.return;i!==null;)a=i,i=a.return;return a.tag===3?a.stateNode:null}var bc={};function w8(a,i,u,p){this.tag=a,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ba(a,i,u,p){return new w8(a,i,u,p)}function _y(a){return a=a.prototype,!(!a||!a.isReactComponent)}function io(a,i){var u=a.alternate;return u===null?(u=ba(a.tag,i,a.key,a.mode),u.elementType=a.elementType,u.type=a.type,u.stateNode=a.stateNode,u.alternate=a,a.alternate=u):(u.pendingProps=i,u.type=a.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=a.flags&65011712,u.childLanes=a.childLanes,u.lanes=a.lanes,u.child=a.child,u.memoizedProps=a.memoizedProps,u.memoizedState=a.memoizedState,u.updateQueue=a.updateQueue,i=a.dependencies,u.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},u.sibling=a.sibling,u.index=a.index,u.ref=a.ref,u.refCleanup=a.refCleanup,u}function MC(a,i){a.flags&=65011714;var u=a.alternate;return u===null?(a.childLanes=0,a.lanes=i,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=u.childLanes,a.lanes=u.lanes,a.child=u.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=u.memoizedProps,a.memoizedState=u.memoizedState,a.updateQueue=u.updateQueue,a.type=u.type,i=u.dependencies,a.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),a}function xh(a,i,u,p,x,E){var N=0;if(p=a,typeof a=="function")_y(a)&&(N=1);else if(typeof a=="string")N=NM(a,u,te.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case F:return a=ba(31,u,i,x),a.elementType=F,a.lanes=E,a;case S:return pl(u.children,x,E,i);case C:N=8,x|=24;break;case R:return a=ba(12,u,i,x|2),a.elementType=R,a.lanes=E,a;case A:return a=ba(13,u,i,x),a.elementType=A,a.lanes=E,a;case O:return a=ba(19,u,i,x),a.elementType=O,a.lanes=E,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case _:N=10;break e;case j:N=9;break e;case D:N=11;break e;case T:N=14;break e;case M:N=16,p=null;break e}N=29,u=Error(r(130,a===null?"null":typeof a,"")),p=null}return i=ba(N,u,i,x),i.elementType=a,i.type=p,i.lanes=E,i}function pl(a,i,u,p){return a=ba(7,a,p,i),a.lanes=u,a}function Ny(a,i,u){return a=ba(6,a,null,i),a.lanes=u,a}function IC(a){var i=ba(18,null,null,0);return i.stateNode=a,i}function Ay(a,i,u){return i=ba(4,a.children!==null?a.children:[],a.key,i),i.lanes=u,i.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},i}var kC=new WeakMap;function Ba(a,i){if(typeof a=="object"&&a!==null){var u=kC.get(a);return u!==void 0?u:(i={value:a,source:i,stack:va(i)},kC.set(a,i),i)}return{value:a,source:i,stack:va(i)}}var Sc=[],Cc=0,bh=null,nd=0,Ga=[],qa=0,ai=null,Os=1,Ms="";function lo(a,i){Sc[Cc++]=nd,Sc[Cc++]=bh,bh=a,nd=i}function LC(a,i,u){Ga[qa++]=Os,Ga[qa++]=Ms,Ga[qa++]=ai,ai=a;var p=Os;a=Ms;var x=32-_n(p)-1;p&=~(1<<x),u+=1;var E=32-_n(i)+x;if(30<E){var N=x-x%5;E=(p&(1<<N)-1).toString(32),p>>=N,x-=N,Os=1<<32-_n(i)+x|u<<x|p,Ms=E+a}else Os=1<<E|u<<x|p,Ms=a}function Dy(a){a.return!==null&&(lo(a,1),LC(a,1,0))}function Oy(a){for(;a===bh;)bh=Sc[--Cc],Sc[Cc]=null,nd=Sc[--Cc],Sc[Cc]=null;for(;a===ai;)ai=Ga[--qa],Ga[qa]=null,Ms=Ga[--qa],Ga[qa]=null,Os=Ga[--qa],Ga[qa]=null}function PC(a,i){Ga[qa++]=Os,Ga[qa++]=Ms,Ga[qa++]=ai,Os=i.id,Ms=i.overflow,ai=a}var Sr=null,hn=null,Mt=!1,si=null,Za=!1,My=Error(r(519));function oi(a){var i=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw rd(Ba(i,a)),My}function UC(a){var i=a.stateNode,u=a.type,p=a.memoizedProps;switch(i[He]=a,i[qe]=p,u){case"dialog":wt("cancel",i),wt("close",i);break;case"iframe":case"object":case"embed":wt("load",i);break;case"video":case"audio":for(u=0;u<Rd.length;u++)wt(Rd[u],i);break;case"source":wt("error",i);break;case"img":case"image":case"link":wt("error",i),wt("load",i);break;case"details":wt("toggle",i);break;case"input":wt("invalid",i),QS(i,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":wt("invalid",i);break;case"textarea":wt("invalid",i),JS(i,p.value,p.defaultValue,p.children)}u=p.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||i.textContent===""+u||p.suppressHydrationWarning===!0||tw(i.textContent,u)?(p.popover!=null&&(wt("beforetoggle",i),wt("toggle",i)),p.onScroll!=null&&wt("scroll",i),p.onScrollEnd!=null&&wt("scrollend",i),p.onClick!=null&&(i.onclick=so),i=!0):i=!1,i||oi(a,!0)}function FC(a){for(Sr=a.return;Sr;)switch(Sr.tag){case 5:case 31:case 13:Za=!1;return;case 27:case 3:Za=!0;return;default:Sr=Sr.return}}function Ec(a){if(a!==Sr)return!1;if(!Mt)return FC(a),Mt=!0,!1;var i=a.tag,u;if((u=i!==3&&i!==27)&&((u=i===5)&&(u=a.type,u=!(u!=="form"&&u!=="button")||Qv(a.type,a.memoizedProps)),u=!u),u&&hn&&oi(a),FC(a),i===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));hn=uw(a)}else if(i===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));hn=uw(a)}else i===27?(i=hn,bi(a.type)?(a=nx,nx=null,hn=a):hn=i):hn=Sr?Ya(a.stateNode.nextSibling):null;return!0}function gl(){hn=Sr=null,Mt=!1}function Iy(){var a=si;return a!==null&&(oa===null?oa=a:oa.push.apply(oa,a),si=null),a}function rd(a){si===null?si=[a]:si.push(a)}var ky=L(null),yl=null,co=null;function ii(a,i,u){q(ky,i._currentValue),i._currentValue=u}function uo(a){a._currentValue=ky.current,P(ky)}function Ly(a,i,u){for(;a!==null;){var p=a.alternate;if((a.childLanes&i)!==i?(a.childLanes|=i,p!==null&&(p.childLanes|=i)):p!==null&&(p.childLanes&i)!==i&&(p.childLanes|=i),a===u)break;a=a.return}}function Py(a,i,u,p){var x=a.child;for(x!==null&&(x.return=a);x!==null;){var E=x.dependencies;if(E!==null){var N=x.child;E=E.firstContext;e:for(;E!==null;){var I=E;E=x;for(var $=0;$<i.length;$++)if(I.context===i[$]){E.lanes|=u,I=E.alternate,I!==null&&(I.lanes|=u),Ly(E.return,u,a),p||(N=null);break e}E=I.next}}else if(x.tag===18){if(N=x.return,N===null)throw Error(r(341));N.lanes|=u,E=N.alternate,E!==null&&(E.lanes|=u),Ly(N,u,a),N=null}else N=x.child;if(N!==null)N.return=x;else for(N=x;N!==null;){if(N===a){N=null;break}if(x=N.sibling,x!==null){x.return=N.return,N=x;break}N=N.return}x=N}}function wc(a,i,u,p){a=null;for(var x=i,E=!1;x!==null;){if(!E){if((x.flags&524288)!==0)E=!0;else if((x.flags&262144)!==0)break}if(x.tag===10){var N=x.alternate;if(N===null)throw Error(r(387));if(N=N.memoizedProps,N!==null){var I=x.type;xa(x.pendingProps.value,N.value)||(a!==null?a.push(I):a=[I])}}else if(x===le.current){if(N=x.alternate,N===null)throw Error(r(387));N.memoizedState.memoizedState!==x.memoizedState.memoizedState&&(a!==null?a.push(Ad):a=[Ad])}x=x.return}a!==null&&Py(i,a,u,p),i.flags|=262144}function Sh(a){for(a=a.firstContext;a!==null;){if(!xa(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function vl(a){yl=a,co=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function Cr(a){return VC(yl,a)}function Ch(a,i){return yl===null&&vl(a),VC(a,i)}function VC(a,i){var u=i._currentValue;if(i={context:i,memoizedValue:u,next:null},co===null){if(a===null)throw Error(r(308));co=i,a.dependencies={lanes:0,firstContext:i},a.flags|=524288}else co=co.next=i;return u}var R8=typeof AbortController<"u"?AbortController:function(){var a=[],i=this.signal={aborted:!1,addEventListener:function(u,p){a.push(p)}};this.abort=function(){i.aborted=!0,a.forEach(function(u){return u()})}},j8=e.unstable_scheduleCallback,T8=e.unstable_NormalPriority,Zn={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Uy(){return{controller:new R8,data:new Map,refCount:0}}function ad(a){a.refCount--,a.refCount===0&&j8(T8,function(){a.controller.abort()})}var sd=null,Fy=0,Rc=0,jc=null;function _8(a,i){if(sd===null){var u=sd=[];Fy=0,Rc=Hv(),jc={status:"pending",value:void 0,then:function(p){u.push(p)}}}return Fy++,i.then(zC,zC),i}function zC(){if(--Fy===0&&sd!==null){jc!==null&&(jc.status="fulfilled");var a=sd;sd=null,Rc=0,jc=null;for(var i=0;i<a.length;i++)(0,a[i])()}}function N8(a,i){var u=[],p={status:"pending",value:null,reason:null,then:function(x){u.push(x)}};return a.then(function(){p.status="fulfilled",p.value=i;for(var x=0;x<u.length;x++)(0,u[x])(i)},function(x){for(p.status="rejected",p.reason=x,x=0;x<u.length;x++)(0,u[x])(void 0)}),p}var HC=k.S;k.S=function(a,i){RE=be(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&_8(a,i),HC!==null&&HC(a,i)};var xl=L(null);function Vy(){var a=xl.current;return a!==null?a:an.pooledCache}function Eh(a,i){i===null?q(xl,xl.current):q(xl,i.pool)}function $C(){var a=Vy();return a===null?null:{parent:Zn._currentValue,pool:a}}var Tc=Error(r(460)),zy=Error(r(474)),wh=Error(r(542)),Rh={then:function(){}};function BC(a){return a=a.status,a==="fulfilled"||a==="rejected"}function GC(a,i,u){switch(u=a[u],u===void 0?a.push(i):u!==i&&(i.then(so,so),i=u),i.status){case"fulfilled":return i.value;case"rejected":throw a=i.reason,ZC(a),a;default:if(typeof i.status=="string")i.then(so,so);else{if(a=an,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=i,a.status="pending",a.then(function(p){if(i.status==="pending"){var x=i;x.status="fulfilled",x.value=p}},function(p){if(i.status==="pending"){var x=i;x.status="rejected",x.reason=p}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw a=i.reason,ZC(a),a}throw Sl=i,Tc}}function bl(a){try{var i=a._init;return i(a._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(Sl=u,Tc):u}}var Sl=null;function qC(){if(Sl===null)throw Error(r(459));var a=Sl;return Sl=null,a}function ZC(a){if(a===Tc||a===wh)throw Error(r(483))}var _c=null,od=0;function jh(a){var i=od;return od+=1,_c===null&&(_c=[]),GC(_c,a,i)}function id(a,i){i=i.props.ref,a.ref=i!==void 0?i:null}function Th(a,i){throw i.$$typeof===v?Error(r(525)):(a=Object.prototype.toString.call(i),Error(r(31,a==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":a)))}function KC(a){function i(ee,W){if(a){var re=ee.deletions;re===null?(ee.deletions=[W],ee.flags|=16):re.push(W)}}function u(ee,W){if(!a)return null;for(;W!==null;)i(ee,W),W=W.sibling;return null}function p(ee){for(var W=new Map;ee!==null;)ee.key!==null?W.set(ee.key,ee):W.set(ee.index,ee),ee=ee.sibling;return W}function x(ee,W){return ee=io(ee,W),ee.index=0,ee.sibling=null,ee}function E(ee,W,re){return ee.index=re,a?(re=ee.alternate,re!==null?(re=re.index,re<W?(ee.flags|=67108866,W):re):(ee.flags|=67108866,W)):(ee.flags|=1048576,W)}function N(ee){return a&&ee.alternate===null&&(ee.flags|=67108866),ee}function I(ee,W,re,me){return W===null||W.tag!==6?(W=Ny(re,ee.mode,me),W.return=ee,W):(W=x(W,re),W.return=ee,W)}function $(ee,W,re,me){var tt=re.type;return tt===S?he(ee,W,re.props.children,me,re.key):W!==null&&(W.elementType===tt||typeof tt=="object"&&tt!==null&&tt.$$typeof===M&&bl(tt)===W.type)?(W=x(W,re.props),id(W,re),W.return=ee,W):(W=xh(re.type,re.key,re.props,null,ee.mode,me),id(W,re),W.return=ee,W)}function ae(ee,W,re,me){return W===null||W.tag!==4||W.stateNode.containerInfo!==re.containerInfo||W.stateNode.implementation!==re.implementation?(W=Ay(re,ee.mode,me),W.return=ee,W):(W=x(W,re.children||[]),W.return=ee,W)}function he(ee,W,re,me,tt){return W===null||W.tag!==7?(W=pl(re,ee.mode,me,tt),W.return=ee,W):(W=x(W,re),W.return=ee,W)}function pe(ee,W,re){if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return W=Ny(""+W,ee.mode,re),W.return=ee,W;if(typeof W=="object"&&W!==null){switch(W.$$typeof){case b:return re=xh(W.type,W.key,W.props,null,ee.mode,re),id(re,W),re.return=ee,re;case w:return W=Ay(W,ee.mode,re),W.return=ee,W;case M:return W=bl(W),pe(ee,W,re)}if(K(W)||Z(W))return W=pl(W,ee.mode,re,null),W.return=ee,W;if(typeof W.then=="function")return pe(ee,jh(W),re);if(W.$$typeof===_)return pe(ee,Ch(ee,W),re);Th(ee,W)}return null}function oe(ee,W,re,me){var tt=W!==null?W.key:null;if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return tt!==null?null:I(ee,W,""+re,me);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case b:return re.key===tt?$(ee,W,re,me):null;case w:return re.key===tt?ae(ee,W,re,me):null;case M:return re=bl(re),oe(ee,W,re,me)}if(K(re)||Z(re))return tt!==null?null:he(ee,W,re,me,null);if(typeof re.then=="function")return oe(ee,W,jh(re),me);if(re.$$typeof===_)return oe(ee,W,Ch(ee,re),me);Th(ee,re)}return null}function fe(ee,W,re,me,tt){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return ee=ee.get(re)||null,I(W,ee,""+me,tt);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case b:return ee=ee.get(me.key===null?re:me.key)||null,$(W,ee,me,tt);case w:return ee=ee.get(me.key===null?re:me.key)||null,ae(W,ee,me,tt);case M:return me=bl(me),fe(ee,W,re,me,tt)}if(K(me)||Z(me))return ee=ee.get(re)||null,he(W,ee,me,tt,null);if(typeof me.then=="function")return fe(ee,W,re,jh(me),tt);if(me.$$typeof===_)return fe(ee,W,re,Ch(W,me),tt);Th(W,me)}return null}function Ge(ee,W,re,me){for(var tt=null,Vt=null,Xe=W,gt=W=0,Tt=null;Xe!==null&&gt<re.length;gt++){Xe.index>gt?(Tt=Xe,Xe=null):Tt=Xe.sibling;var zt=oe(ee,Xe,re[gt],me);if(zt===null){Xe===null&&(Xe=Tt);break}a&&Xe&&zt.alternate===null&&i(ee,Xe),W=E(zt,W,gt),Vt===null?tt=zt:Vt.sibling=zt,Vt=zt,Xe=Tt}if(gt===re.length)return u(ee,Xe),Mt&&lo(ee,gt),tt;if(Xe===null){for(;gt<re.length;gt++)Xe=pe(ee,re[gt],me),Xe!==null&&(W=E(Xe,W,gt),Vt===null?tt=Xe:Vt.sibling=Xe,Vt=Xe);return Mt&&lo(ee,gt),tt}for(Xe=p(Xe);gt<re.length;gt++)Tt=fe(Xe,ee,gt,re[gt],me),Tt!==null&&(a&&Tt.alternate!==null&&Xe.delete(Tt.key===null?gt:Tt.key),W=E(Tt,W,gt),Vt===null?tt=Tt:Vt.sibling=Tt,Vt=Tt);return a&&Xe.forEach(function(Ri){return i(ee,Ri)}),Mt&&lo(ee,gt),tt}function nt(ee,W,re,me){if(re==null)throw Error(r(151));for(var tt=null,Vt=null,Xe=W,gt=W=0,Tt=null,zt=re.next();Xe!==null&&!zt.done;gt++,zt=re.next()){Xe.index>gt?(Tt=Xe,Xe=null):Tt=Xe.sibling;var Ri=oe(ee,Xe,zt.value,me);if(Ri===null){Xe===null&&(Xe=Tt);break}a&&Xe&&Ri.alternate===null&&i(ee,Xe),W=E(Ri,W,gt),Vt===null?tt=Ri:Vt.sibling=Ri,Vt=Ri,Xe=Tt}if(zt.done)return u(ee,Xe),Mt&&lo(ee,gt),tt;if(Xe===null){for(;!zt.done;gt++,zt=re.next())zt=pe(ee,zt.value,me),zt!==null&&(W=E(zt,W,gt),Vt===null?tt=zt:Vt.sibling=zt,Vt=zt);return Mt&&lo(ee,gt),tt}for(Xe=p(Xe);!zt.done;gt++,zt=re.next())zt=fe(Xe,ee,gt,zt.value,me),zt!==null&&(a&&zt.alternate!==null&&Xe.delete(zt.key===null?gt:zt.key),W=E(zt,W,gt),Vt===null?tt=zt:Vt.sibling=zt,Vt=zt);return a&&Xe.forEach(function(VM){return i(ee,VM)}),Mt&&lo(ee,gt),tt}function rn(ee,W,re,me){if(typeof re=="object"&&re!==null&&re.type===S&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case b:e:{for(var tt=re.key;W!==null;){if(W.key===tt){if(tt=re.type,tt===S){if(W.tag===7){u(ee,W.sibling),me=x(W,re.props.children),me.return=ee,ee=me;break e}}else if(W.elementType===tt||typeof tt=="object"&&tt!==null&&tt.$$typeof===M&&bl(tt)===W.type){u(ee,W.sibling),me=x(W,re.props),id(me,re),me.return=ee,ee=me;break e}u(ee,W);break}else i(ee,W);W=W.sibling}re.type===S?(me=pl(re.props.children,ee.mode,me,re.key),me.return=ee,ee=me):(me=xh(re.type,re.key,re.props,null,ee.mode,me),id(me,re),me.return=ee,ee=me)}return N(ee);case w:e:{for(tt=re.key;W!==null;){if(W.key===tt)if(W.tag===4&&W.stateNode.containerInfo===re.containerInfo&&W.stateNode.implementation===re.implementation){u(ee,W.sibling),me=x(W,re.children||[]),me.return=ee,ee=me;break e}else{u(ee,W);break}else i(ee,W);W=W.sibling}me=Ay(re,ee.mode,me),me.return=ee,ee=me}return N(ee);case M:return re=bl(re),rn(ee,W,re,me)}if(K(re))return Ge(ee,W,re,me);if(Z(re)){if(tt=Z(re),typeof tt!="function")throw Error(r(150));return re=tt.call(re),nt(ee,W,re,me)}if(typeof re.then=="function")return rn(ee,W,jh(re),me);if(re.$$typeof===_)return rn(ee,W,Ch(ee,re),me);Th(ee,re)}return typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint"?(re=""+re,W!==null&&W.tag===6?(u(ee,W.sibling),me=x(W,re),me.return=ee,ee=me):(u(ee,W),me=Ny(re,ee.mode,me),me.return=ee,ee=me),N(ee)):u(ee,W)}return function(ee,W,re,me){try{od=0;var tt=rn(ee,W,re,me);return _c=null,tt}catch(Xe){if(Xe===Tc||Xe===wh)throw Xe;var Vt=ba(29,Xe,null,ee.mode);return Vt.lanes=me,Vt.return=ee,Vt}finally{}}}var Cl=KC(!0),YC=KC(!1),li=!1;function Hy(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $y(a,i){a=a.updateQueue,i.updateQueue===a&&(i.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function ci(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function ui(a,i,u){var p=a.updateQueue;if(p===null)return null;if(p=p.shared,(Bt&2)!==0){var x=p.pending;return x===null?i.next=i:(i.next=x.next,x.next=i),p.pending=i,i=vh(a),OC(a,null,u),i}return yh(a,p,i,u),vh(a)}function ld(a,i,u){if(i=i.updateQueue,i!==null&&(i=i.shared,(u&4194048)!==0)){var p=i.lanes;p&=a.pendingLanes,u|=p,i.lanes=u,se(a,u)}}function By(a,i){var u=a.updateQueue,p=a.alternate;if(p!==null&&(p=p.updateQueue,u===p)){var x=null,E=null;if(u=u.firstBaseUpdate,u!==null){do{var N={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};E===null?x=E=N:E=E.next=N,u=u.next}while(u!==null);E===null?x=E=i:E=E.next=i}else x=E=i;u={baseState:p.baseState,firstBaseUpdate:x,lastBaseUpdate:E,shared:p.shared,callbacks:p.callbacks},a.updateQueue=u;return}a=u.lastBaseUpdate,a===null?u.firstBaseUpdate=i:a.next=i,u.lastBaseUpdate=i}var Gy=!1;function cd(){if(Gy){var a=jc;if(a!==null)throw a}}function ud(a,i,u,p){Gy=!1;var x=a.updateQueue;li=!1;var E=x.firstBaseUpdate,N=x.lastBaseUpdate,I=x.shared.pending;if(I!==null){x.shared.pending=null;var $=I,ae=$.next;$.next=null,N===null?E=ae:N.next=ae,N=$;var he=a.alternate;he!==null&&(he=he.updateQueue,I=he.lastBaseUpdate,I!==N&&(I===null?he.firstBaseUpdate=ae:I.next=ae,he.lastBaseUpdate=$))}if(E!==null){var pe=x.baseState;N=0,he=ae=$=null,I=E;do{var oe=I.lane&-536870913,fe=oe!==I.lane;if(fe?(jt&oe)===oe:(p&oe)===oe){oe!==0&&oe===Rc&&(Gy=!0),he!==null&&(he=he.next={lane:0,tag:I.tag,payload:I.payload,callback:null,next:null});e:{var Ge=a,nt=I;oe=i;var rn=u;switch(nt.tag){case 1:if(Ge=nt.payload,typeof Ge=="function"){pe=Ge.call(rn,pe,oe);break e}pe=Ge;break e;case 3:Ge.flags=Ge.flags&-65537|128;case 0:if(Ge=nt.payload,oe=typeof Ge=="function"?Ge.call(rn,pe,oe):Ge,oe==null)break e;pe=y({},pe,oe);break e;case 2:li=!0}}oe=I.callback,oe!==null&&(a.flags|=64,fe&&(a.flags|=8192),fe=x.callbacks,fe===null?x.callbacks=[oe]:fe.push(oe))}else fe={lane:oe,tag:I.tag,payload:I.payload,callback:I.callback,next:null},he===null?(ae=he=fe,$=pe):he=he.next=fe,N|=oe;if(I=I.next,I===null){if(I=x.shared.pending,I===null)break;fe=I,I=fe.next,fe.next=null,x.lastBaseUpdate=fe,x.shared.pending=null}}while(!0);he===null&&($=pe),x.baseState=$,x.firstBaseUpdate=ae,x.lastBaseUpdate=he,E===null&&(x.shared.lanes=0),pi|=N,a.lanes=N,a.memoizedState=pe}}function WC(a,i){if(typeof a!="function")throw Error(r(191,a));a.call(i)}function QC(a,i){var u=a.callbacks;if(u!==null)for(a.callbacks=null,a=0;a<u.length;a++)WC(u[a],i)}var Nc=L(null),_h=L(0);function XC(a,i){a=bo,q(_h,a),q(Nc,i),bo=a|i.baseLanes}function qy(){q(_h,bo),q(Nc,Nc.current)}function Zy(){bo=_h.current,P(Nc),P(_h)}var Sa=L(null),Ka=null;function di(a){var i=a.alternate;q(zn,zn.current&1),q(Sa,a),Ka===null&&(i===null||Nc.current!==null||i.memoizedState!==null)&&(Ka=a)}function Ky(a){q(zn,zn.current),q(Sa,a),Ka===null&&(Ka=a)}function JC(a){a.tag===22?(q(zn,zn.current),q(Sa,a),Ka===null&&(Ka=a)):fi()}function fi(){q(zn,zn.current),q(Sa,Sa.current)}function Ca(a){P(Sa),Ka===a&&(Ka=null),P(zn)}var zn=L(0);function Nh(a){for(var i=a;i!==null;){if(i.tag===13){var u=i.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||ex(u)||tx(u)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===a)break;for(;i.sibling===null;){if(i.return===null||i.return===a)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var fo=0,ht=null,tn=null,Kn=null,Ah=!1,Ac=!1,El=!1,Dh=0,dd=0,Dc=null,A8=0;function An(){throw Error(r(321))}function Yy(a,i){if(i===null)return!1;for(var u=0;u<i.length&&u<a.length;u++)if(!xa(a[u],i[u]))return!1;return!0}function Wy(a,i,u,p,x,E){return fo=E,ht=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,k.H=a===null||a.memoizedState===null?L2:dv,El=!1,E=u(p,x),El=!1,Ac&&(E=t2(i,u,p,x)),e2(a),E}function e2(a){k.H=md;var i=tn!==null&&tn.next!==null;if(fo=0,Kn=tn=ht=null,Ah=!1,dd=0,Dc=null,i)throw Error(r(300));a===null||Yn||(a=a.dependencies,a!==null&&Sh(a)&&(Yn=!0))}function t2(a,i,u,p){ht=a;var x=0;do{if(Ac&&(Dc=null),dd=0,Ac=!1,25<=x)throw Error(r(301));if(x+=1,Kn=tn=null,a.updateQueue!=null){var E=a.updateQueue;E.lastEffect=null,E.events=null,E.stores=null,E.memoCache!=null&&(E.memoCache.index=0)}k.H=P2,E=i(u,p)}while(Ac);return E}function D8(){var a=k.H,i=a.useState()[0];return i=typeof i.then=="function"?fd(i):i,a=a.useState()[0],(tn!==null?tn.memoizedState:null)!==a&&(ht.flags|=1024),i}function Qy(){var a=Dh!==0;return Dh=0,a}function Xy(a,i,u){i.updateQueue=a.updateQueue,i.flags&=-2053,a.lanes&=~u}function Jy(a){if(Ah){for(a=a.memoizedState;a!==null;){var i=a.queue;i!==null&&(i.pending=null),a=a.next}Ah=!1}fo=0,Kn=tn=ht=null,Ac=!1,dd=Dh=0,Dc=null}function Ur(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kn===null?ht.memoizedState=Kn=a:Kn=Kn.next=a,Kn}function Hn(){if(tn===null){var a=ht.alternate;a=a!==null?a.memoizedState:null}else a=tn.next;var i=Kn===null?ht.memoizedState:Kn.next;if(i!==null)Kn=i,tn=a;else{if(a===null)throw ht.alternate===null?Error(r(467)):Error(r(310));tn=a,a={memoizedState:tn.memoizedState,baseState:tn.baseState,baseQueue:tn.baseQueue,queue:tn.queue,next:null},Kn===null?ht.memoizedState=Kn=a:Kn=Kn.next=a}return Kn}function Oh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function fd(a){var i=dd;return dd+=1,Dc===null&&(Dc=[]),a=GC(Dc,a,i),i=ht,(Kn===null?i.memoizedState:Kn.next)===null&&(i=i.alternate,k.H=i===null||i.memoizedState===null?L2:dv),a}function Mh(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return fd(a);if(a.$$typeof===_)return Cr(a)}throw Error(r(438,String(a)))}function ev(a){var i=null,u=ht.updateQueue;if(u!==null&&(i=u.memoCache),i==null){var p=ht.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(i={data:p.data.map(function(x){return x.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),u===null&&(u=Oh(),ht.updateQueue=u),u.memoCache=i,u=i.data[i.index],u===void 0)for(u=i.data[i.index]=Array(a),p=0;p<a;p++)u[p]=G;return i.index++,u}function ho(a,i){return typeof i=="function"?i(a):i}function Ih(a){var i=Hn();return tv(i,tn,a)}function tv(a,i,u){var p=a.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=u;var x=a.baseQueue,E=p.pending;if(E!==null){if(x!==null){var N=x.next;x.next=E.next,E.next=N}i.baseQueue=x=E,p.pending=null}if(E=a.baseState,x===null)a.memoizedState=E;else{i=x.next;var I=N=null,$=null,ae=i,he=!1;do{var pe=ae.lane&-536870913;if(pe!==ae.lane?(jt&pe)===pe:(fo&pe)===pe){var oe=ae.revertLane;if(oe===0)$!==null&&($=$.next={lane:0,revertLane:0,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null}),pe===Rc&&(he=!0);else if((fo&oe)===oe){ae=ae.next,oe===Rc&&(he=!0);continue}else pe={lane:0,revertLane:ae.revertLane,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},$===null?(I=$=pe,N=E):$=$.next=pe,ht.lanes|=oe,pi|=oe;pe=ae.action,El&&u(E,pe),E=ae.hasEagerState?ae.eagerState:u(E,pe)}else oe={lane:pe,revertLane:ae.revertLane,gesture:ae.gesture,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},$===null?(I=$=oe,N=E):$=$.next=oe,ht.lanes|=pe,pi|=pe;ae=ae.next}while(ae!==null&&ae!==i);if($===null?N=E:$.next=I,!xa(E,a.memoizedState)&&(Yn=!0,he&&(u=jc,u!==null)))throw u;a.memoizedState=E,a.baseState=N,a.baseQueue=$,p.lastRenderedState=E}return x===null&&(p.lanes=0),[a.memoizedState,p.dispatch]}function nv(a){var i=Hn(),u=i.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=a;var p=u.dispatch,x=u.pending,E=i.memoizedState;if(x!==null){u.pending=null;var N=x=x.next;do E=a(E,N.action),N=N.next;while(N!==x);xa(E,i.memoizedState)||(Yn=!0),i.memoizedState=E,i.baseQueue===null&&(i.baseState=E),u.lastRenderedState=E}return[E,p]}function n2(a,i,u){var p=ht,x=Hn(),E=Mt;if(E){if(u===void 0)throw Error(r(407));u=u()}else u=i();var N=!xa((tn||x).memoizedState,u);if(N&&(x.memoizedState=u,Yn=!0),x=x.queue,sv(s2.bind(null,p,x,a),[a]),x.getSnapshot!==i||N||Kn!==null&&Kn.memoizedState.tag&1){if(p.flags|=2048,Oc(9,{destroy:void 0},a2.bind(null,p,x,u,i),null),an===null)throw Error(r(349));E||(fo&127)!==0||r2(p,i,u)}return u}function r2(a,i,u){a.flags|=16384,a={getSnapshot:i,value:u},i=ht.updateQueue,i===null?(i=Oh(),ht.updateQueue=i,i.stores=[a]):(u=i.stores,u===null?i.stores=[a]:u.push(a))}function a2(a,i,u,p){i.value=u,i.getSnapshot=p,o2(i)&&i2(a)}function s2(a,i,u){return u(function(){o2(i)&&i2(a)})}function o2(a){var i=a.getSnapshot;a=a.value;try{var u=i();return!xa(a,u)}catch{return!0}}function i2(a){var i=ml(a,2);i!==null&&ia(i,a,2)}function rv(a){var i=Ur();if(typeof a=="function"){var u=a;if(a=u(),El){vr(!0);try{u()}finally{vr(!1)}}}return i.memoizedState=i.baseState=a,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ho,lastRenderedState:a},i}function l2(a,i,u,p){return a.baseState=u,tv(a,tn,typeof p=="function"?p:ho)}function O8(a,i,u,p,x){if(Ph(a))throw Error(r(485));if(a=i.action,a!==null){var E={payload:x,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){E.listeners.push(N)}};k.T!==null?u(!0):E.isTransition=!1,p(E),u=i.pending,u===null?(E.next=i.pending=E,c2(i,E)):(E.next=u.next,i.pending=u.next=E)}}function c2(a,i){var u=i.action,p=i.payload,x=a.state;if(i.isTransition){var E=k.T,N={};k.T=N;try{var I=u(x,p),$=k.S;$!==null&&$(N,I),u2(a,i,I)}catch(ae){av(a,i,ae)}finally{E!==null&&N.types!==null&&(E.types=N.types),k.T=E}}else try{E=u(x,p),u2(a,i,E)}catch(ae){av(a,i,ae)}}function u2(a,i,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(p){d2(a,i,p)},function(p){return av(a,i,p)}):d2(a,i,u)}function d2(a,i,u){i.status="fulfilled",i.value=u,f2(i),a.state=u,i=a.pending,i!==null&&(u=i.next,u===i?a.pending=null:(u=u.next,i.next=u,c2(a,u)))}function av(a,i,u){var p=a.pending;if(a.pending=null,p!==null){p=p.next;do i.status="rejected",i.reason=u,f2(i),i=i.next;while(i!==p)}a.action=null}function f2(a){a=a.listeners;for(var i=0;i<a.length;i++)(0,a[i])()}function h2(a,i){return i}function m2(a,i){if(Mt){var u=an.formState;if(u!==null){e:{var p=ht;if(Mt){if(hn){t:{for(var x=hn,E=Za;x.nodeType!==8;){if(!E){x=null;break t}if(x=Ya(x.nextSibling),x===null){x=null;break t}}E=x.data,x=E==="F!"||E==="F"?x:null}if(x){hn=Ya(x.nextSibling),p=x.data==="F!";break e}}oi(p)}p=!1}p&&(i=u[0])}}return u=Ur(),u.memoizedState=u.baseState=i,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:h2,lastRenderedState:i},u.queue=p,u=M2.bind(null,ht,p),p.dispatch=u,p=rv(!1),E=uv.bind(null,ht,!1,p.queue),p=Ur(),x={state:i,dispatch:null,action:a,pending:null},p.queue=x,u=O8.bind(null,ht,x,E,u),x.dispatch=u,p.memoizedState=a,[i,u,!1]}function p2(a){var i=Hn();return g2(i,tn,a)}function g2(a,i,u){if(i=tv(a,i,h2)[0],a=Ih(ho)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var p=fd(i)}catch(N){throw N===Tc?wh:N}else p=i;i=Hn();var x=i.queue,E=x.dispatch;return u!==i.memoizedState&&(ht.flags|=2048,Oc(9,{destroy:void 0},M8.bind(null,x,u),null)),[p,E,a]}function M8(a,i){a.action=i}function y2(a){var i=Hn(),u=tn;if(u!==null)return g2(i,u,a);Hn(),i=i.memoizedState,u=Hn();var p=u.queue.dispatch;return u.memoizedState=a,[i,p,!1]}function Oc(a,i,u,p){return a={tag:a,create:u,deps:p,inst:i,next:null},i=ht.updateQueue,i===null&&(i=Oh(),ht.updateQueue=i),u=i.lastEffect,u===null?i.lastEffect=a.next=a:(p=u.next,u.next=a,a.next=p,i.lastEffect=a),a}function v2(){return Hn().memoizedState}function kh(a,i,u,p){var x=Ur();ht.flags|=a,x.memoizedState=Oc(1|i,{destroy:void 0},u,p===void 0?null:p)}function Lh(a,i,u,p){var x=Hn();p=p===void 0?null:p;var E=x.memoizedState.inst;tn!==null&&p!==null&&Yy(p,tn.memoizedState.deps)?x.memoizedState=Oc(i,E,u,p):(ht.flags|=a,x.memoizedState=Oc(1|i,E,u,p))}function x2(a,i){kh(8390656,8,a,i)}function sv(a,i){Lh(2048,8,a,i)}function I8(a){ht.flags|=4;var i=ht.updateQueue;if(i===null)i=Oh(),ht.updateQueue=i,i.events=[a];else{var u=i.events;u===null?i.events=[a]:u.push(a)}}function b2(a){var i=Hn().memoizedState;return I8({ref:i,nextImpl:a}),function(){if((Bt&2)!==0)throw Error(r(440));return i.impl.apply(void 0,arguments)}}function S2(a,i){return Lh(4,2,a,i)}function C2(a,i){return Lh(4,4,a,i)}function E2(a,i){if(typeof i=="function"){a=a();var u=i(a);return function(){typeof u=="function"?u():i(null)}}if(i!=null)return a=a(),i.current=a,function(){i.current=null}}function w2(a,i,u){u=u!=null?u.concat([a]):null,Lh(4,4,E2.bind(null,i,a),u)}function ov(){}function R2(a,i){var u=Hn();i=i===void 0?null:i;var p=u.memoizedState;return i!==null&&Yy(i,p[1])?p[0]:(u.memoizedState=[a,i],a)}function j2(a,i){var u=Hn();i=i===void 0?null:i;var p=u.memoizedState;if(i!==null&&Yy(i,p[1]))return p[0];if(p=a(),El){vr(!0);try{a()}finally{vr(!1)}}return u.memoizedState=[p,i],p}function iv(a,i,u){return u===void 0||(fo&1073741824)!==0&&(jt&261930)===0?a.memoizedState=i:(a.memoizedState=u,a=TE(),ht.lanes|=a,pi|=a,u)}function T2(a,i,u,p){return xa(u,i)?u:Nc.current!==null?(a=iv(a,u,p),xa(a,i)||(Yn=!0),a):(fo&42)===0||(fo&1073741824)!==0&&(jt&261930)===0?(Yn=!0,a.memoizedState=u):(a=TE(),ht.lanes|=a,pi|=a,i)}function _2(a,i,u,p,x){var E=z.p;z.p=E!==0&&8>E?E:8;var N=k.T,I={};k.T=I,uv(a,!1,i,u);try{var $=x(),ae=k.S;if(ae!==null&&ae(I,$),$!==null&&typeof $=="object"&&typeof $.then=="function"){var he=N8($,p);hd(a,i,he,Ra(a))}else hd(a,i,p,Ra(a))}catch(pe){hd(a,i,{then:function(){},status:"rejected",reason:pe},Ra())}finally{z.p=E,N!==null&&I.types!==null&&(N.types=I.types),k.T=N}}function k8(){}function lv(a,i,u,p){if(a.tag!==5)throw Error(r(476));var x=N2(a).queue;_2(a,x,i,B,u===null?k8:function(){return A2(a),u(p)})}function N2(a){var i=a.memoizedState;if(i!==null)return i;i={memoizedState:B,baseState:B,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ho,lastRenderedState:B},next:null};var u={};return i.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ho,lastRenderedState:u},next:null},a.memoizedState=i,a=a.alternate,a!==null&&(a.memoizedState=i),i}function A2(a){var i=N2(a);i.next===null&&(i=a.alternate.memoizedState),hd(a,i.next.queue,{},Ra())}function cv(){return Cr(Ad)}function D2(){return Hn().memoizedState}function O2(){return Hn().memoizedState}function L8(a){for(var i=a.return;i!==null;){switch(i.tag){case 24:case 3:var u=Ra();a=ci(u);var p=ui(i,a,u);p!==null&&(ia(p,i,u),ld(p,i,u)),i={cache:Uy()},a.payload=i;return}i=i.return}}function P8(a,i,u){var p=Ra();u={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Ph(a)?I2(i,u):(u=Ty(a,i,u,p),u!==null&&(ia(u,a,p),k2(u,i,p)))}function M2(a,i,u){var p=Ra();hd(a,i,u,p)}function hd(a,i,u,p){var x={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Ph(a))I2(i,x);else{var E=a.alternate;if(a.lanes===0&&(E===null||E.lanes===0)&&(E=i.lastRenderedReducer,E!==null))try{var N=i.lastRenderedState,I=E(N,u);if(x.hasEagerState=!0,x.eagerState=I,xa(I,N))return yh(a,i,x,0),an===null&&gh(),!1}catch{}finally{}if(u=Ty(a,i,x,p),u!==null)return ia(u,a,p),k2(u,i,p),!0}return!1}function uv(a,i,u,p){if(p={lane:2,revertLane:Hv(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Ph(a)){if(i)throw Error(r(479))}else i=Ty(a,u,p,2),i!==null&&ia(i,a,2)}function Ph(a){var i=a.alternate;return a===ht||i!==null&&i===ht}function I2(a,i){Ac=Ah=!0;var u=a.pending;u===null?i.next=i:(i.next=u.next,u.next=i),a.pending=i}function k2(a,i,u){if((u&4194048)!==0){var p=i.lanes;p&=a.pendingLanes,u|=p,i.lanes=u,se(a,u)}}var md={readContext:Cr,use:Mh,useCallback:An,useContext:An,useEffect:An,useImperativeHandle:An,useLayoutEffect:An,useInsertionEffect:An,useMemo:An,useReducer:An,useRef:An,useState:An,useDebugValue:An,useDeferredValue:An,useTransition:An,useSyncExternalStore:An,useId:An,useHostTransitionStatus:An,useFormState:An,useActionState:An,useOptimistic:An,useMemoCache:An,useCacheRefresh:An};md.useEffectEvent=An;var L2={readContext:Cr,use:Mh,useCallback:function(a,i){return Ur().memoizedState=[a,i===void 0?null:i],a},useContext:Cr,useEffect:x2,useImperativeHandle:function(a,i,u){u=u!=null?u.concat([a]):null,kh(4194308,4,E2.bind(null,i,a),u)},useLayoutEffect:function(a,i){return kh(4194308,4,a,i)},useInsertionEffect:function(a,i){kh(4,2,a,i)},useMemo:function(a,i){var u=Ur();i=i===void 0?null:i;var p=a();if(El){vr(!0);try{a()}finally{vr(!1)}}return u.memoizedState=[p,i],p},useReducer:function(a,i,u){var p=Ur();if(u!==void 0){var x=u(i);if(El){vr(!0);try{u(i)}finally{vr(!1)}}}else x=i;return p.memoizedState=p.baseState=x,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:x},p.queue=a,a=a.dispatch=P8.bind(null,ht,a),[p.memoizedState,a]},useRef:function(a){var i=Ur();return a={current:a},i.memoizedState=a},useState:function(a){a=rv(a);var i=a.queue,u=M2.bind(null,ht,i);return i.dispatch=u,[a.memoizedState,u]},useDebugValue:ov,useDeferredValue:function(a,i){var u=Ur();return iv(u,a,i)},useTransition:function(){var a=rv(!1);return a=_2.bind(null,ht,a.queue,!0,!1),Ur().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,i,u){var p=ht,x=Ur();if(Mt){if(u===void 0)throw Error(r(407));u=u()}else{if(u=i(),an===null)throw Error(r(349));(jt&127)!==0||r2(p,i,u)}x.memoizedState=u;var E={value:u,getSnapshot:i};return x.queue=E,x2(s2.bind(null,p,E,a),[a]),p.flags|=2048,Oc(9,{destroy:void 0},a2.bind(null,p,E,u,i),null),u},useId:function(){var a=Ur(),i=an.identifierPrefix;if(Mt){var u=Ms,p=Os;u=(p&~(1<<32-_n(p)-1)).toString(32)+u,i="_"+i+"R_"+u,u=Dh++,0<u&&(i+="H"+u.toString(32)),i+="_"}else u=A8++,i="_"+i+"r_"+u.toString(32)+"_";return a.memoizedState=i},useHostTransitionStatus:cv,useFormState:m2,useActionState:m2,useOptimistic:function(a){var i=Ur();i.memoizedState=i.baseState=a;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=u,i=uv.bind(null,ht,!0,u),u.dispatch=i,[a,i]},useMemoCache:ev,useCacheRefresh:function(){return Ur().memoizedState=L8.bind(null,ht)},useEffectEvent:function(a){var i=Ur(),u={impl:a};return i.memoizedState=u,function(){if((Bt&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},dv={readContext:Cr,use:Mh,useCallback:R2,useContext:Cr,useEffect:sv,useImperativeHandle:w2,useInsertionEffect:S2,useLayoutEffect:C2,useMemo:j2,useReducer:Ih,useRef:v2,useState:function(){return Ih(ho)},useDebugValue:ov,useDeferredValue:function(a,i){var u=Hn();return T2(u,tn.memoizedState,a,i)},useTransition:function(){var a=Ih(ho)[0],i=Hn().memoizedState;return[typeof a=="boolean"?a:fd(a),i]},useSyncExternalStore:n2,useId:D2,useHostTransitionStatus:cv,useFormState:p2,useActionState:p2,useOptimistic:function(a,i){var u=Hn();return l2(u,tn,a,i)},useMemoCache:ev,useCacheRefresh:O2};dv.useEffectEvent=b2;var P2={readContext:Cr,use:Mh,useCallback:R2,useContext:Cr,useEffect:sv,useImperativeHandle:w2,useInsertionEffect:S2,useLayoutEffect:C2,useMemo:j2,useReducer:nv,useRef:v2,useState:function(){return nv(ho)},useDebugValue:ov,useDeferredValue:function(a,i){var u=Hn();return tn===null?iv(u,a,i):T2(u,tn.memoizedState,a,i)},useTransition:function(){var a=nv(ho)[0],i=Hn().memoizedState;return[typeof a=="boolean"?a:fd(a),i]},useSyncExternalStore:n2,useId:D2,useHostTransitionStatus:cv,useFormState:y2,useActionState:y2,useOptimistic:function(a,i){var u=Hn();return tn!==null?l2(u,tn,a,i):(u.baseState=a,[a,u.queue.dispatch])},useMemoCache:ev,useCacheRefresh:O2};P2.useEffectEvent=b2;function fv(a,i,u,p){i=a.memoizedState,u=u(p,i),u=u==null?i:y({},i,u),a.memoizedState=u,a.lanes===0&&(a.updateQueue.baseState=u)}var hv={enqueueSetState:function(a,i,u){a=a._reactInternals;var p=Ra(),x=ci(p);x.payload=i,u!=null&&(x.callback=u),i=ui(a,x,p),i!==null&&(ia(i,a,p),ld(i,a,p))},enqueueReplaceState:function(a,i,u){a=a._reactInternals;var p=Ra(),x=ci(p);x.tag=1,x.payload=i,u!=null&&(x.callback=u),i=ui(a,x,p),i!==null&&(ia(i,a,p),ld(i,a,p))},enqueueForceUpdate:function(a,i){a=a._reactInternals;var u=Ra(),p=ci(u);p.tag=2,i!=null&&(p.callback=i),i=ui(a,p,u),i!==null&&(ia(i,a,u),ld(i,a,u))}};function U2(a,i,u,p,x,E,N){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(p,E,N):i.prototype&&i.prototype.isPureReactComponent?!ed(u,p)||!ed(x,E):!0}function F2(a,i,u,p){a=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(u,p),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(u,p),i.state!==a&&hv.enqueueReplaceState(i,i.state,null)}function wl(a,i){var u=i;if("ref"in i){u={};for(var p in i)p!=="ref"&&(u[p]=i[p])}if(a=a.defaultProps){u===i&&(u=y({},u));for(var x in a)u[x]===void 0&&(u[x]=a[x])}return u}function V2(a){ph(a)}function z2(a){console.error(a)}function H2(a){ph(a)}function Uh(a,i){try{var u=a.onUncaughtError;u(i.value,{componentStack:i.stack})}catch(p){setTimeout(function(){throw p})}}function $2(a,i,u){try{var p=a.onCaughtError;p(u.value,{componentStack:u.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(x){setTimeout(function(){throw x})}}function mv(a,i,u){return u=ci(u),u.tag=3,u.payload={element:null},u.callback=function(){Uh(a,i)},u}function B2(a){return a=ci(a),a.tag=3,a}function G2(a,i,u,p){var x=u.type.getDerivedStateFromError;if(typeof x=="function"){var E=p.value;a.payload=function(){return x(E)},a.callback=function(){$2(i,u,p)}}var N=u.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(a.callback=function(){$2(i,u,p),typeof x!="function"&&(gi===null?gi=new Set([this]):gi.add(this));var I=p.stack;this.componentDidCatch(p.value,{componentStack:I!==null?I:""})})}function U8(a,i,u,p,x){if(u.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(i=u.alternate,i!==null&&wc(i,u,x,!0),u=Sa.current,u!==null){switch(u.tag){case 31:case 13:return Ka===null?Wh():u.alternate===null&&Dn===0&&(Dn=3),u.flags&=-257,u.flags|=65536,u.lanes=x,p===Rh?u.flags|=16384:(i=u.updateQueue,i===null?u.updateQueue=new Set([p]):i.add(p),Fv(a,p,x)),!1;case 22:return u.flags|=65536,p===Rh?u.flags|=16384:(i=u.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([p])},u.updateQueue=i):(u=i.retryQueue,u===null?i.retryQueue=new Set([p]):u.add(p)),Fv(a,p,x)),!1}throw Error(r(435,u.tag))}return Fv(a,p,x),Wh(),!1}if(Mt)return i=Sa.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=x,p!==My&&(a=Error(r(422),{cause:p}),rd(Ba(a,u)))):(p!==My&&(i=Error(r(423),{cause:p}),rd(Ba(i,u))),a=a.current.alternate,a.flags|=65536,x&=-x,a.lanes|=x,p=Ba(p,u),x=mv(a.stateNode,p,x),By(a,x),Dn!==4&&(Dn=2)),!1;var E=Error(r(520),{cause:p});if(E=Ba(E,u),Cd===null?Cd=[E]:Cd.push(E),Dn!==4&&(Dn=2),i===null)return!0;p=Ba(p,u),u=i;do{switch(u.tag){case 3:return u.flags|=65536,a=x&-x,u.lanes|=a,a=mv(u.stateNode,p,a),By(u,a),!1;case 1:if(i=u.type,E=u.stateNode,(u.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||E!==null&&typeof E.componentDidCatch=="function"&&(gi===null||!gi.has(E))))return u.flags|=65536,x&=-x,u.lanes|=x,x=B2(x),G2(x,a,u,p),By(u,x),!1}u=u.return}while(u!==null);return!1}var pv=Error(r(461)),Yn=!1;function Er(a,i,u,p){i.child=a===null?YC(i,null,u,p):Cl(i,a.child,u,p)}function q2(a,i,u,p,x){u=u.render;var E=i.ref;if("ref"in p){var N={};for(var I in p)I!=="ref"&&(N[I]=p[I])}else N=p;return vl(i),p=Wy(a,i,u,N,E,x),I=Qy(),a!==null&&!Yn?(Xy(a,i,x),mo(a,i,x)):(Mt&&I&&Dy(i),i.flags|=1,Er(a,i,p,x),i.child)}function Z2(a,i,u,p,x){if(a===null){var E=u.type;return typeof E=="function"&&!_y(E)&&E.defaultProps===void 0&&u.compare===null?(i.tag=15,i.type=E,K2(a,i,E,p,x)):(a=xh(u.type,null,p,i,i.mode,x),a.ref=i.ref,a.return=i,i.child=a)}if(E=a.child,!Ev(a,x)){var N=E.memoizedProps;if(u=u.compare,u=u!==null?u:ed,u(N,p)&&a.ref===i.ref)return mo(a,i,x)}return i.flags|=1,a=io(E,p),a.ref=i.ref,a.return=i,i.child=a}function K2(a,i,u,p,x){if(a!==null){var E=a.memoizedProps;if(ed(E,p)&&a.ref===i.ref)if(Yn=!1,i.pendingProps=p=E,Ev(a,x))(a.flags&131072)!==0&&(Yn=!0);else return i.lanes=a.lanes,mo(a,i,x)}return gv(a,i,u,p,x)}function Y2(a,i,u,p){var x=p.children,E=a!==null?a.memoizedState:null;if(a===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((i.flags&128)!==0){if(E=E!==null?E.baseLanes|u:u,a!==null){for(p=i.child=a.child,x=0;p!==null;)x=x|p.lanes|p.childLanes,p=p.sibling;p=x&~E}else p=0,i.child=null;return W2(a,i,E,u,p)}if((u&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},a!==null&&Eh(i,E!==null?E.cachePool:null),E!==null?XC(i,E):qy(),JC(i);else return p=i.lanes=536870912,W2(a,i,E!==null?E.baseLanes|u:u,u,p)}else E!==null?(Eh(i,E.cachePool),XC(i,E),fi(),i.memoizedState=null):(a!==null&&Eh(i,null),qy(),fi());return Er(a,i,x,u),i.child}function pd(a,i){return a!==null&&a.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function W2(a,i,u,p,x){var E=Vy();return E=E===null?null:{parent:Zn._currentValue,pool:E},i.memoizedState={baseLanes:u,cachePool:E},a!==null&&Eh(i,null),qy(),JC(i),a!==null&&wc(a,i,p,!0),i.childLanes=x,null}function Fh(a,i){return i=zh({mode:i.mode,children:i.children},a.mode),i.ref=a.ref,a.child=i,i.return=a,i}function Q2(a,i,u){return Cl(i,a.child,null,u),a=Fh(i,i.pendingProps),a.flags|=2,Ca(i),i.memoizedState=null,a}function F8(a,i,u){var p=i.pendingProps,x=(i.flags&128)!==0;if(i.flags&=-129,a===null){if(Mt){if(p.mode==="hidden")return a=Fh(i,p),i.lanes=536870912,pd(null,a);if(Ky(i),(a=hn)?(a=cw(a,Za),a=a!==null&&a.data==="&"?a:null,a!==null&&(i.memoizedState={dehydrated:a,treeContext:ai!==null?{id:Os,overflow:Ms}:null,retryLane:536870912,hydrationErrors:null},u=IC(a),u.return=i,i.child=u,Sr=i,hn=null)):a=null,a===null)throw oi(i);return i.lanes=536870912,null}return Fh(i,p)}var E=a.memoizedState;if(E!==null){var N=E.dehydrated;if(Ky(i),x)if(i.flags&256)i.flags&=-257,i=Q2(a,i,u);else if(i.memoizedState!==null)i.child=a.child,i.flags|=128,i=null;else throw Error(r(558));else if(Yn||wc(a,i,u,!1),x=(u&a.childLanes)!==0,Yn||x){if(p=an,p!==null&&(N=ge(p,u),N!==0&&N!==E.retryLane))throw E.retryLane=N,ml(a,N),ia(p,a,N),pv;Wh(),i=Q2(a,i,u)}else a=E.treeContext,hn=Ya(N.nextSibling),Sr=i,Mt=!0,si=null,Za=!1,a!==null&&PC(i,a),i=Fh(i,p),i.flags|=4096;return i}return a=io(a.child,{mode:p.mode,children:p.children}),a.ref=i.ref,i.child=a,a.return=i,a}function Vh(a,i){var u=i.ref;if(u===null)a!==null&&a.ref!==null&&(i.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(a===null||a.ref!==u)&&(i.flags|=4194816)}}function gv(a,i,u,p,x){return vl(i),u=Wy(a,i,u,p,void 0,x),p=Qy(),a!==null&&!Yn?(Xy(a,i,x),mo(a,i,x)):(Mt&&p&&Dy(i),i.flags|=1,Er(a,i,u,x),i.child)}function X2(a,i,u,p,x,E){return vl(i),i.updateQueue=null,u=t2(i,p,u,x),e2(a),p=Qy(),a!==null&&!Yn?(Xy(a,i,E),mo(a,i,E)):(Mt&&p&&Dy(i),i.flags|=1,Er(a,i,u,E),i.child)}function J2(a,i,u,p,x){if(vl(i),i.stateNode===null){var E=bc,N=u.contextType;typeof N=="object"&&N!==null&&(E=Cr(N)),E=new u(p,E),i.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,E.updater=hv,i.stateNode=E,E._reactInternals=i,E=i.stateNode,E.props=p,E.state=i.memoizedState,E.refs={},Hy(i),N=u.contextType,E.context=typeof N=="object"&&N!==null?Cr(N):bc,E.state=i.memoizedState,N=u.getDerivedStateFromProps,typeof N=="function"&&(fv(i,u,N,p),E.state=i.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(N=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),N!==E.state&&hv.enqueueReplaceState(E,E.state,null),ud(i,p,E,x),cd(),E.state=i.memoizedState),typeof E.componentDidMount=="function"&&(i.flags|=4194308),p=!0}else if(a===null){E=i.stateNode;var I=i.memoizedProps,$=wl(u,I);E.props=$;var ae=E.context,he=u.contextType;N=bc,typeof he=="object"&&he!==null&&(N=Cr(he));var pe=u.getDerivedStateFromProps;he=typeof pe=="function"||typeof E.getSnapshotBeforeUpdate=="function",I=i.pendingProps!==I,he||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(I||ae!==N)&&F2(i,E,p,N),li=!1;var oe=i.memoizedState;E.state=oe,ud(i,p,E,x),cd(),ae=i.memoizedState,I||oe!==ae||li?(typeof pe=="function"&&(fv(i,u,pe,p),ae=i.memoizedState),($=li||U2(i,u,$,p,oe,ae,N))?(he||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(i.flags|=4194308)):(typeof E.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=p,i.memoizedState=ae),E.props=p,E.state=ae,E.context=N,p=$):(typeof E.componentDidMount=="function"&&(i.flags|=4194308),p=!1)}else{E=i.stateNode,$y(a,i),N=i.memoizedProps,he=wl(u,N),E.props=he,pe=i.pendingProps,oe=E.context,ae=u.contextType,$=bc,typeof ae=="object"&&ae!==null&&($=Cr(ae)),I=u.getDerivedStateFromProps,(ae=typeof I=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(N!==pe||oe!==$)&&F2(i,E,p,$),li=!1,oe=i.memoizedState,E.state=oe,ud(i,p,E,x),cd();var fe=i.memoizedState;N!==pe||oe!==fe||li||a!==null&&a.dependencies!==null&&Sh(a.dependencies)?(typeof I=="function"&&(fv(i,u,I,p),fe=i.memoizedState),(he=li||U2(i,u,he,p,oe,fe,$)||a!==null&&a.dependencies!==null&&Sh(a.dependencies))?(ae||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(p,fe,$),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(p,fe,$)),typeof E.componentDidUpdate=="function"&&(i.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof E.componentDidUpdate!="function"||N===a.memoizedProps&&oe===a.memoizedState||(i.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||N===a.memoizedProps&&oe===a.memoizedState||(i.flags|=1024),i.memoizedProps=p,i.memoizedState=fe),E.props=p,E.state=fe,E.context=$,p=he):(typeof E.componentDidUpdate!="function"||N===a.memoizedProps&&oe===a.memoizedState||(i.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||N===a.memoizedProps&&oe===a.memoizedState||(i.flags|=1024),p=!1)}return E=p,Vh(a,i),p=(i.flags&128)!==0,E||p?(E=i.stateNode,u=p&&typeof u.getDerivedStateFromError!="function"?null:E.render(),i.flags|=1,a!==null&&p?(i.child=Cl(i,a.child,null,x),i.child=Cl(i,null,u,x)):Er(a,i,u,x),i.memoizedState=E.state,a=i.child):a=mo(a,i,x),a}function eE(a,i,u,p){return gl(),i.flags|=256,Er(a,i,u,p),i.child}var yv={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vv(a){return{baseLanes:a,cachePool:$C()}}function xv(a,i,u){return a=a!==null?a.childLanes&~u:0,i&&(a|=wa),a}function tE(a,i,u){var p=i.pendingProps,x=!1,E=(i.flags&128)!==0,N;if((N=E)||(N=a!==null&&a.memoizedState===null?!1:(zn.current&2)!==0),N&&(x=!0,i.flags&=-129),N=(i.flags&32)!==0,i.flags&=-33,a===null){if(Mt){if(x?di(i):fi(),(a=hn)?(a=cw(a,Za),a=a!==null&&a.data!=="&"?a:null,a!==null&&(i.memoizedState={dehydrated:a,treeContext:ai!==null?{id:Os,overflow:Ms}:null,retryLane:536870912,hydrationErrors:null},u=IC(a),u.return=i,i.child=u,Sr=i,hn=null)):a=null,a===null)throw oi(i);return tx(a)?i.lanes=32:i.lanes=536870912,null}var I=p.children;return p=p.fallback,x?(fi(),x=i.mode,I=zh({mode:"hidden",children:I},x),p=pl(p,x,u,null),I.return=i,p.return=i,I.sibling=p,i.child=I,p=i.child,p.memoizedState=vv(u),p.childLanes=xv(a,N,u),i.memoizedState=yv,pd(null,p)):(di(i),bv(i,I))}var $=a.memoizedState;if($!==null&&(I=$.dehydrated,I!==null)){if(E)i.flags&256?(di(i),i.flags&=-257,i=Sv(a,i,u)):i.memoizedState!==null?(fi(),i.child=a.child,i.flags|=128,i=null):(fi(),I=p.fallback,x=i.mode,p=zh({mode:"visible",children:p.children},x),I=pl(I,x,u,null),I.flags|=2,p.return=i,I.return=i,p.sibling=I,i.child=p,Cl(i,a.child,null,u),p=i.child,p.memoizedState=vv(u),p.childLanes=xv(a,N,u),i.memoizedState=yv,i=pd(null,p));else if(di(i),tx(I)){if(N=I.nextSibling&&I.nextSibling.dataset,N)var ae=N.dgst;N=ae,p=Error(r(419)),p.stack="",p.digest=N,rd({value:p,source:null,stack:null}),i=Sv(a,i,u)}else if(Yn||wc(a,i,u,!1),N=(u&a.childLanes)!==0,Yn||N){if(N=an,N!==null&&(p=ge(N,u),p!==0&&p!==$.retryLane))throw $.retryLane=p,ml(a,p),ia(N,a,p),pv;ex(I)||Wh(),i=Sv(a,i,u)}else ex(I)?(i.flags|=192,i.child=a.child,i=null):(a=$.treeContext,hn=Ya(I.nextSibling),Sr=i,Mt=!0,si=null,Za=!1,a!==null&&PC(i,a),i=bv(i,p.children),i.flags|=4096);return i}return x?(fi(),I=p.fallback,x=i.mode,$=a.child,ae=$.sibling,p=io($,{mode:"hidden",children:p.children}),p.subtreeFlags=$.subtreeFlags&65011712,ae!==null?I=io(ae,I):(I=pl(I,x,u,null),I.flags|=2),I.return=i,p.return=i,p.sibling=I,i.child=p,pd(null,p),p=i.child,I=a.child.memoizedState,I===null?I=vv(u):(x=I.cachePool,x!==null?($=Zn._currentValue,x=x.parent!==$?{parent:$,pool:$}:x):x=$C(),I={baseLanes:I.baseLanes|u,cachePool:x}),p.memoizedState=I,p.childLanes=xv(a,N,u),i.memoizedState=yv,pd(a.child,p)):(di(i),u=a.child,a=u.sibling,u=io(u,{mode:"visible",children:p.children}),u.return=i,u.sibling=null,a!==null&&(N=i.deletions,N===null?(i.deletions=[a],i.flags|=16):N.push(a)),i.child=u,i.memoizedState=null,u)}function bv(a,i){return i=zh({mode:"visible",children:i},a.mode),i.return=a,a.child=i}function zh(a,i){return a=ba(22,a,null,i),a.lanes=0,a}function Sv(a,i,u){return Cl(i,a.child,null,u),a=bv(i,i.pendingProps.children),a.flags|=2,i.memoizedState=null,a}function nE(a,i,u){a.lanes|=i;var p=a.alternate;p!==null&&(p.lanes|=i),Ly(a.return,i,u)}function Cv(a,i,u,p,x,E){var N=a.memoizedState;N===null?a.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:p,tail:u,tailMode:x,treeForkCount:E}:(N.isBackwards=i,N.rendering=null,N.renderingStartTime=0,N.last=p,N.tail=u,N.tailMode=x,N.treeForkCount=E)}function rE(a,i,u){var p=i.pendingProps,x=p.revealOrder,E=p.tail;p=p.children;var N=zn.current,I=(N&2)!==0;if(I?(N=N&1|2,i.flags|=128):N&=1,q(zn,N),Er(a,i,p,u),p=Mt?nd:0,!I&&a!==null&&(a.flags&128)!==0)e:for(a=i.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&nE(a,u,i);else if(a.tag===19)nE(a,u,i);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===i)break e;for(;a.sibling===null;){if(a.return===null||a.return===i)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(x){case"forwards":for(u=i.child,x=null;u!==null;)a=u.alternate,a!==null&&Nh(a)===null&&(x=u),u=u.sibling;u=x,u===null?(x=i.child,i.child=null):(x=u.sibling,u.sibling=null),Cv(i,!1,x,u,E,p);break;case"backwards":case"unstable_legacy-backwards":for(u=null,x=i.child,i.child=null;x!==null;){if(a=x.alternate,a!==null&&Nh(a)===null){i.child=x;break}a=x.sibling,x.sibling=u,u=x,x=a}Cv(i,!0,u,null,E,p);break;case"together":Cv(i,!1,null,null,void 0,p);break;default:i.memoizedState=null}return i.child}function mo(a,i,u){if(a!==null&&(i.dependencies=a.dependencies),pi|=i.lanes,(u&i.childLanes)===0)if(a!==null){if(wc(a,i,u,!1),(u&i.childLanes)===0)return null}else return null;if(a!==null&&i.child!==a.child)throw Error(r(153));if(i.child!==null){for(a=i.child,u=io(a,a.pendingProps),i.child=u,u.return=i;a.sibling!==null;)a=a.sibling,u=u.sibling=io(a,a.pendingProps),u.return=i;u.sibling=null}return i.child}function Ev(a,i){return(a.lanes&i)!==0?!0:(a=a.dependencies,!!(a!==null&&Sh(a)))}function V8(a,i,u){switch(i.tag){case 3:Ae(i,i.stateNode.containerInfo),ii(i,Zn,a.memoizedState.cache),gl();break;case 27:case 5:Ne(i);break;case 4:Ae(i,i.stateNode.containerInfo);break;case 10:ii(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Ky(i),null;break;case 13:var p=i.memoizedState;if(p!==null)return p.dehydrated!==null?(di(i),i.flags|=128,null):(u&i.child.childLanes)!==0?tE(a,i,u):(di(i),a=mo(a,i,u),a!==null?a.sibling:null);di(i);break;case 19:var x=(a.flags&128)!==0;if(p=(u&i.childLanes)!==0,p||(wc(a,i,u,!1),p=(u&i.childLanes)!==0),x){if(p)return rE(a,i,u);i.flags|=128}if(x=i.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),q(zn,zn.current),p)break;return null;case 22:return i.lanes=0,Y2(a,i,u,i.pendingProps);case 24:ii(i,Zn,a.memoizedState.cache)}return mo(a,i,u)}function aE(a,i,u){if(a!==null)if(a.memoizedProps!==i.pendingProps)Yn=!0;else{if(!Ev(a,u)&&(i.flags&128)===0)return Yn=!1,V8(a,i,u);Yn=(a.flags&131072)!==0}else Yn=!1,Mt&&(i.flags&1048576)!==0&&LC(i,nd,i.index);switch(i.lanes=0,i.tag){case 16:e:{var p=i.pendingProps;if(a=bl(i.elementType),i.type=a,typeof a=="function")_y(a)?(p=wl(a,p),i.tag=1,i=J2(null,i,a,p,u)):(i.tag=0,i=gv(null,i,a,p,u));else{if(a!=null){var x=a.$$typeof;if(x===D){i.tag=11,i=q2(null,i,a,p,u);break e}else if(x===T){i.tag=14,i=Z2(null,i,a,p,u);break e}}throw i=H(a)||a,Error(r(306,i,""))}}return i;case 0:return gv(a,i,i.type,i.pendingProps,u);case 1:return p=i.type,x=wl(p,i.pendingProps),J2(a,i,p,x,u);case 3:e:{if(Ae(i,i.stateNode.containerInfo),a===null)throw Error(r(387));p=i.pendingProps;var E=i.memoizedState;x=E.element,$y(a,i),ud(i,p,null,u);var N=i.memoizedState;if(p=N.cache,ii(i,Zn,p),p!==E.cache&&Py(i,[Zn],u,!0),cd(),p=N.element,E.isDehydrated)if(E={element:p,isDehydrated:!1,cache:N.cache},i.updateQueue.baseState=E,i.memoizedState=E,i.flags&256){i=eE(a,i,p,u);break e}else if(p!==x){x=Ba(Error(r(424)),i),rd(x),i=eE(a,i,p,u);break e}else{switch(a=i.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(hn=Ya(a.firstChild),Sr=i,Mt=!0,si=null,Za=!0,u=YC(i,null,p,u),i.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(gl(),p===x){i=mo(a,i,u);break e}Er(a,i,p,u)}i=i.child}return i;case 26:return Vh(a,i),a===null?(u=pw(i.type,null,i.pendingProps,null))?i.memoizedState=u:Mt||(u=i.type,a=i.pendingProps,p=rm(ve.current).createElement(u),p[He]=i,p[qe]=a,wr(p,u,a),Nn(p),i.stateNode=p):i.memoizedState=pw(i.type,a.memoizedProps,i.pendingProps,a.memoizedState),null;case 27:return Ne(i),a===null&&Mt&&(p=i.stateNode=fw(i.type,i.pendingProps,ve.current),Sr=i,Za=!0,x=hn,bi(i.type)?(nx=x,hn=Ya(p.firstChild)):hn=x),Er(a,i,i.pendingProps.children,u),Vh(a,i),a===null&&(i.flags|=4194304),i.child;case 5:return a===null&&Mt&&((x=p=hn)&&(p=gM(p,i.type,i.pendingProps,Za),p!==null?(i.stateNode=p,Sr=i,hn=Ya(p.firstChild),Za=!1,x=!0):x=!1),x||oi(i)),Ne(i),x=i.type,E=i.pendingProps,N=a!==null?a.memoizedProps:null,p=E.children,Qv(x,E)?p=null:N!==null&&Qv(x,N)&&(i.flags|=32),i.memoizedState!==null&&(x=Wy(a,i,D8,null,null,u),Ad._currentValue=x),Vh(a,i),Er(a,i,p,u),i.child;case 6:return a===null&&Mt&&((a=u=hn)&&(u=yM(u,i.pendingProps,Za),u!==null?(i.stateNode=u,Sr=i,hn=null,a=!0):a=!1),a||oi(i)),null;case 13:return tE(a,i,u);case 4:return Ae(i,i.stateNode.containerInfo),p=i.pendingProps,a===null?i.child=Cl(i,null,p,u):Er(a,i,p,u),i.child;case 11:return q2(a,i,i.type,i.pendingProps,u);case 7:return Er(a,i,i.pendingProps,u),i.child;case 8:return Er(a,i,i.pendingProps.children,u),i.child;case 12:return Er(a,i,i.pendingProps.children,u),i.child;case 10:return p=i.pendingProps,ii(i,i.type,p.value),Er(a,i,p.children,u),i.child;case 9:return x=i.type._context,p=i.pendingProps.children,vl(i),x=Cr(x),p=p(x),i.flags|=1,Er(a,i,p,u),i.child;case 14:return Z2(a,i,i.type,i.pendingProps,u);case 15:return K2(a,i,i.type,i.pendingProps,u);case 19:return rE(a,i,u);case 31:return F8(a,i,u);case 22:return Y2(a,i,u,i.pendingProps);case 24:return vl(i),p=Cr(Zn),a===null?(x=Vy(),x===null&&(x=an,E=Uy(),x.pooledCache=E,E.refCount++,E!==null&&(x.pooledCacheLanes|=u),x=E),i.memoizedState={parent:p,cache:x},Hy(i),ii(i,Zn,x)):((a.lanes&u)!==0&&($y(a,i),ud(i,null,null,u),cd()),x=a.memoizedState,E=i.memoizedState,x.parent!==p?(x={parent:p,cache:p},i.memoizedState=x,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=x),ii(i,Zn,p)):(p=E.cache,ii(i,Zn,p),p!==x.cache&&Py(i,[Zn],u,!0))),Er(a,i,i.pendingProps.children,u),i.child;case 29:throw i.pendingProps}throw Error(r(156,i.tag))}function po(a){a.flags|=4}function wv(a,i,u,p,x){if((i=(a.mode&32)!==0)&&(i=!1),i){if(a.flags|=16777216,(x&335544128)===x)if(a.stateNode.complete)a.flags|=8192;else if(DE())a.flags|=8192;else throw Sl=Rh,zy}else a.flags&=-16777217}function sE(a,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!bw(i))if(DE())a.flags|=8192;else throw Sl=Rh,zy}function Hh(a,i){i!==null&&(a.flags|=4),a.flags&16384&&(i=a.tag!==22?Vn():536870912,a.lanes|=i,Lc|=i)}function gd(a,i){if(!Mt)switch(a.tailMode){case"hidden":i=a.tail;for(var u=null;i!==null;)i.alternate!==null&&(u=i),i=i.sibling;u===null?a.tail=null:u.sibling=null;break;case"collapsed":u=a.tail;for(var p=null;u!==null;)u.alternate!==null&&(p=u),u=u.sibling;p===null?i||a.tail===null?a.tail=null:a.tail.sibling=null:p.sibling=null}}function mn(a){var i=a.alternate!==null&&a.alternate.child===a.child,u=0,p=0;if(i)for(var x=a.child;x!==null;)u|=x.lanes|x.childLanes,p|=x.subtreeFlags&65011712,p|=x.flags&65011712,x.return=a,x=x.sibling;else for(x=a.child;x!==null;)u|=x.lanes|x.childLanes,p|=x.subtreeFlags,p|=x.flags,x.return=a,x=x.sibling;return a.subtreeFlags|=p,a.childLanes=u,i}function z8(a,i,u){var p=i.pendingProps;switch(Oy(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mn(i),null;case 1:return mn(i),null;case 3:return u=i.stateNode,p=null,a!==null&&(p=a.memoizedState.cache),i.memoizedState.cache!==p&&(i.flags|=2048),uo(Zn),we(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(a===null||a.child===null)&&(Ec(i)?po(i):a===null||a.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Iy())),mn(i),null;case 26:var x=i.type,E=i.memoizedState;return a===null?(po(i),E!==null?(mn(i),sE(i,E)):(mn(i),wv(i,x,null,p,u))):E?E!==a.memoizedState?(po(i),mn(i),sE(i,E)):(mn(i),i.flags&=-16777217):(a=a.memoizedProps,a!==p&&po(i),mn(i),wv(i,x,a,p,u)),null;case 27:if(Be(i),u=ve.current,x=i.type,a!==null&&i.stateNode!=null)a.memoizedProps!==p&&po(i);else{if(!p){if(i.stateNode===null)throw Error(r(166));return mn(i),null}a=te.current,Ec(i)?UC(i):(a=fw(x,p,u),i.stateNode=a,po(i))}return mn(i),null;case 5:if(Be(i),x=i.type,a!==null&&i.stateNode!=null)a.memoizedProps!==p&&po(i);else{if(!p){if(i.stateNode===null)throw Error(r(166));return mn(i),null}if(E=te.current,Ec(i))UC(i);else{var N=rm(ve.current);switch(E){case 1:E=N.createElementNS("http://www.w3.org/2000/svg",x);break;case 2:E=N.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;default:switch(x){case"svg":E=N.createElementNS("http://www.w3.org/2000/svg",x);break;case"math":E=N.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;case"script":E=N.createElement("div"),E.innerHTML="<script><\/script>",E=E.removeChild(E.firstChild);break;case"select":E=typeof p.is=="string"?N.createElement("select",{is:p.is}):N.createElement("select"),p.multiple?E.multiple=!0:p.size&&(E.size=p.size);break;default:E=typeof p.is=="string"?N.createElement(x,{is:p.is}):N.createElement(x)}}E[He]=i,E[qe]=p;e:for(N=i.child;N!==null;){if(N.tag===5||N.tag===6)E.appendChild(N.stateNode);else if(N.tag!==4&&N.tag!==27&&N.child!==null){N.child.return=N,N=N.child;continue}if(N===i)break e;for(;N.sibling===null;){if(N.return===null||N.return===i)break e;N=N.return}N.sibling.return=N.return,N=N.sibling}i.stateNode=E;e:switch(wr(E,x,p),x){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&po(i)}}return mn(i),wv(i,i.type,a===null?null:a.memoizedProps,i.pendingProps,u),null;case 6:if(a&&i.stateNode!=null)a.memoizedProps!==p&&po(i);else{if(typeof p!="string"&&i.stateNode===null)throw Error(r(166));if(a=ve.current,Ec(i)){if(a=i.stateNode,u=i.memoizedProps,p=null,x=Sr,x!==null)switch(x.tag){case 27:case 5:p=x.memoizedProps}a[He]=i,a=!!(a.nodeValue===u||p!==null&&p.suppressHydrationWarning===!0||tw(a.nodeValue,u)),a||oi(i,!0)}else a=rm(a).createTextNode(p),a[He]=i,i.stateNode=a}return mn(i),null;case 31:if(u=i.memoizedState,a===null||a.memoizedState!==null){if(p=Ec(i),u!==null){if(a===null){if(!p)throw Error(r(318));if(a=i.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(557));a[He]=i}else gl(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;mn(i),a=!1}else u=Iy(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=u),a=!0;if(!a)return i.flags&256?(Ca(i),i):(Ca(i),null);if((i.flags&128)!==0)throw Error(r(558))}return mn(i),null;case 13:if(p=i.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(x=Ec(i),p!==null&&p.dehydrated!==null){if(a===null){if(!x)throw Error(r(318));if(x=i.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(r(317));x[He]=i}else gl(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;mn(i),x=!1}else x=Iy(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=x),x=!0;if(!x)return i.flags&256?(Ca(i),i):(Ca(i),null)}return Ca(i),(i.flags&128)!==0?(i.lanes=u,i):(u=p!==null,a=a!==null&&a.memoizedState!==null,u&&(p=i.child,x=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(x=p.alternate.memoizedState.cachePool.pool),E=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(E=p.memoizedState.cachePool.pool),E!==x&&(p.flags|=2048)),u!==a&&u&&(i.child.flags|=8192),Hh(i,i.updateQueue),mn(i),null);case 4:return we(),a===null&&qv(i.stateNode.containerInfo),mn(i),null;case 10:return uo(i.type),mn(i),null;case 19:if(P(zn),p=i.memoizedState,p===null)return mn(i),null;if(x=(i.flags&128)!==0,E=p.rendering,E===null)if(x)gd(p,!1);else{if(Dn!==0||a!==null&&(a.flags&128)!==0)for(a=i.child;a!==null;){if(E=Nh(a),E!==null){for(i.flags|=128,gd(p,!1),a=E.updateQueue,i.updateQueue=a,Hh(i,a),i.subtreeFlags=0,a=u,u=i.child;u!==null;)MC(u,a),u=u.sibling;return q(zn,zn.current&1|2),Mt&&lo(i,p.treeForkCount),i.child}a=a.sibling}p.tail!==null&&be()>Zh&&(i.flags|=128,x=!0,gd(p,!1),i.lanes=4194304)}else{if(!x)if(a=Nh(E),a!==null){if(i.flags|=128,x=!0,a=a.updateQueue,i.updateQueue=a,Hh(i,a),gd(p,!0),p.tail===null&&p.tailMode==="hidden"&&!E.alternate&&!Mt)return mn(i),null}else 2*be()-p.renderingStartTime>Zh&&u!==536870912&&(i.flags|=128,x=!0,gd(p,!1),i.lanes=4194304);p.isBackwards?(E.sibling=i.child,i.child=E):(a=p.last,a!==null?a.sibling=E:i.child=E,p.last=E)}return p.tail!==null?(a=p.tail,p.rendering=a,p.tail=a.sibling,p.renderingStartTime=be(),a.sibling=null,u=zn.current,q(zn,x?u&1|2:u&1),Mt&&lo(i,p.treeForkCount),a):(mn(i),null);case 22:case 23:return Ca(i),Zy(),p=i.memoizedState!==null,a!==null?a.memoizedState!==null!==p&&(i.flags|=8192):p&&(i.flags|=8192),p?(u&536870912)!==0&&(i.flags&128)===0&&(mn(i),i.subtreeFlags&6&&(i.flags|=8192)):mn(i),u=i.updateQueue,u!==null&&Hh(i,u.retryQueue),u=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),p=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(p=i.memoizedState.cachePool.pool),p!==u&&(i.flags|=2048),a!==null&&P(xl),null;case 24:return u=null,a!==null&&(u=a.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),uo(Zn),mn(i),null;case 25:return null;case 30:return null}throw Error(r(156,i.tag))}function H8(a,i){switch(Oy(i),i.tag){case 1:return a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 3:return uo(Zn),we(),a=i.flags,(a&65536)!==0&&(a&128)===0?(i.flags=a&-65537|128,i):null;case 26:case 27:case 5:return Be(i),null;case 31:if(i.memoizedState!==null){if(Ca(i),i.alternate===null)throw Error(r(340));gl()}return a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 13:if(Ca(i),a=i.memoizedState,a!==null&&a.dehydrated!==null){if(i.alternate===null)throw Error(r(340));gl()}return a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 19:return P(zn),null;case 4:return we(),null;case 10:return uo(i.type),null;case 22:case 23:return Ca(i),Zy(),a!==null&&P(xl),a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 24:return uo(Zn),null;case 25:return null;default:return null}}function oE(a,i){switch(Oy(i),i.tag){case 3:uo(Zn),we();break;case 26:case 27:case 5:Be(i);break;case 4:we();break;case 31:i.memoizedState!==null&&Ca(i);break;case 13:Ca(i);break;case 19:P(zn);break;case 10:uo(i.type);break;case 22:case 23:Ca(i),Zy(),a!==null&&P(xl);break;case 24:uo(Zn)}}function yd(a,i){try{var u=i.updateQueue,p=u!==null?u.lastEffect:null;if(p!==null){var x=p.next;u=x;do{if((u.tag&a)===a){p=void 0;var E=u.create,N=u.inst;p=E(),N.destroy=p}u=u.next}while(u!==x)}}catch(I){Qt(i,i.return,I)}}function hi(a,i,u){try{var p=i.updateQueue,x=p!==null?p.lastEffect:null;if(x!==null){var E=x.next;p=E;do{if((p.tag&a)===a){var N=p.inst,I=N.destroy;if(I!==void 0){N.destroy=void 0,x=i;var $=u,ae=I;try{ae()}catch(he){Qt(x,$,he)}}}p=p.next}while(p!==E)}}catch(he){Qt(i,i.return,he)}}function iE(a){var i=a.updateQueue;if(i!==null){var u=a.stateNode;try{QC(i,u)}catch(p){Qt(a,a.return,p)}}}function lE(a,i,u){u.props=wl(a.type,a.memoizedProps),u.state=a.memoizedState;try{u.componentWillUnmount()}catch(p){Qt(a,i,p)}}function vd(a,i){try{var u=a.ref;if(u!==null){switch(a.tag){case 26:case 27:case 5:var p=a.stateNode;break;case 30:p=a.stateNode;break;default:p=a.stateNode}typeof u=="function"?a.refCleanup=u(p):u.current=p}}catch(x){Qt(a,i,x)}}function Is(a,i){var u=a.ref,p=a.refCleanup;if(u!==null)if(typeof p=="function")try{p()}catch(x){Qt(a,i,x)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(x){Qt(a,i,x)}else u.current=null}function cE(a){var i=a.type,u=a.memoizedProps,p=a.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":u.autoFocus&&p.focus();break e;case"img":u.src?p.src=u.src:u.srcSet&&(p.srcset=u.srcSet)}}catch(x){Qt(a,a.return,x)}}function Rv(a,i,u){try{var p=a.stateNode;uM(p,a.type,u,i),p[qe]=i}catch(x){Qt(a,a.return,x)}}function uE(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&bi(a.type)||a.tag===4}function jv(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||uE(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&bi(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function Tv(a,i,u){var p=a.tag;if(p===5||p===6)a=a.stateNode,i?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(a,i):(i=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,i.appendChild(a),u=u._reactRootContainer,u!=null||i.onclick!==null||(i.onclick=so));else if(p!==4&&(p===27&&bi(a.type)&&(u=a.stateNode,i=null),a=a.child,a!==null))for(Tv(a,i,u),a=a.sibling;a!==null;)Tv(a,i,u),a=a.sibling}function $h(a,i,u){var p=a.tag;if(p===5||p===6)a=a.stateNode,i?u.insertBefore(a,i):u.appendChild(a);else if(p!==4&&(p===27&&bi(a.type)&&(u=a.stateNode),a=a.child,a!==null))for($h(a,i,u),a=a.sibling;a!==null;)$h(a,i,u),a=a.sibling}function dE(a){var i=a.stateNode,u=a.memoizedProps;try{for(var p=a.type,x=i.attributes;x.length;)i.removeAttributeNode(x[0]);wr(i,p,u),i[He]=a,i[qe]=u}catch(E){Qt(a,a.return,E)}}var go=!1,Wn=!1,_v=!1,fE=typeof WeakSet=="function"?WeakSet:Set,mr=null;function $8(a,i){if(a=a.containerInfo,Yv=um,a=wC(a),Sy(a)){if("selectionStart"in a)var u={start:a.selectionStart,end:a.selectionEnd};else e:{u=(u=a.ownerDocument)&&u.defaultView||window;var p=u.getSelection&&u.getSelection();if(p&&p.rangeCount!==0){u=p.anchorNode;var x=p.anchorOffset,E=p.focusNode;p=p.focusOffset;try{u.nodeType,E.nodeType}catch{u=null;break e}var N=0,I=-1,$=-1,ae=0,he=0,pe=a,oe=null;t:for(;;){for(var fe;pe!==u||x!==0&&pe.nodeType!==3||(I=N+x),pe!==E||p!==0&&pe.nodeType!==3||($=N+p),pe.nodeType===3&&(N+=pe.nodeValue.length),(fe=pe.firstChild)!==null;)oe=pe,pe=fe;for(;;){if(pe===a)break t;if(oe===u&&++ae===x&&(I=N),oe===E&&++he===p&&($=N),(fe=pe.nextSibling)!==null)break;pe=oe,oe=pe.parentNode}pe=fe}u=I===-1||$===-1?null:{start:I,end:$}}else u=null}u=u||{start:0,end:0}}else u=null;for(Wv={focusedElem:a,selectionRange:u},um=!1,mr=i;mr!==null;)if(i=mr,a=i.child,(i.subtreeFlags&1028)!==0&&a!==null)a.return=i,mr=a;else for(;mr!==null;){switch(i=mr,E=i.alternate,a=i.flags,i.tag){case 0:if((a&4)!==0&&(a=i.updateQueue,a=a!==null?a.events:null,a!==null))for(u=0;u<a.length;u++)x=a[u],x.ref.impl=x.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&E!==null){a=void 0,u=i,x=E.memoizedProps,E=E.memoizedState,p=u.stateNode;try{var Ge=wl(u.type,x);a=p.getSnapshotBeforeUpdate(Ge,E),p.__reactInternalSnapshotBeforeUpdate=a}catch(nt){Qt(u,u.return,nt)}}break;case 3:if((a&1024)!==0){if(a=i.stateNode.containerInfo,u=a.nodeType,u===9)Jv(a);else if(u===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Jv(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(r(163))}if(a=i.sibling,a!==null){a.return=i.return,mr=a;break}mr=i.return}}function hE(a,i,u){var p=u.flags;switch(u.tag){case 0:case 11:case 15:vo(a,u),p&4&&yd(5,u);break;case 1:if(vo(a,u),p&4)if(a=u.stateNode,i===null)try{a.componentDidMount()}catch(N){Qt(u,u.return,N)}else{var x=wl(u.type,i.memoizedProps);i=i.memoizedState;try{a.componentDidUpdate(x,i,a.__reactInternalSnapshotBeforeUpdate)}catch(N){Qt(u,u.return,N)}}p&64&&iE(u),p&512&&vd(u,u.return);break;case 3:if(vo(a,u),p&64&&(a=u.updateQueue,a!==null)){if(i=null,u.child!==null)switch(u.child.tag){case 27:case 5:i=u.child.stateNode;break;case 1:i=u.child.stateNode}try{QC(a,i)}catch(N){Qt(u,u.return,N)}}break;case 27:i===null&&p&4&&dE(u);case 26:case 5:vo(a,u),i===null&&p&4&&cE(u),p&512&&vd(u,u.return);break;case 12:vo(a,u);break;case 31:vo(a,u),p&4&&gE(a,u);break;case 13:vo(a,u),p&4&&yE(a,u),p&64&&(a=u.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(u=X8.bind(null,u),vM(a,u))));break;case 22:if(p=u.memoizedState!==null||go,!p){i=i!==null&&i.memoizedState!==null||Wn,x=go;var E=Wn;go=p,(Wn=i)&&!E?xo(a,u,(u.subtreeFlags&8772)!==0):vo(a,u),go=x,Wn=E}break;case 30:break;default:vo(a,u)}}function mE(a){var i=a.alternate;i!==null&&(a.alternate=null,mE(i)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(i=a.stateNode,i!==null&&Yt(i)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var yn=null,ra=!1;function yo(a,i,u){for(u=u.child;u!==null;)pE(a,i,u),u=u.sibling}function pE(a,i,u){if(Tn&&typeof Tn.onCommitFiberUnmount=="function")try{Tn.onCommitFiberUnmount(Fn,u)}catch{}switch(u.tag){case 26:Wn||Is(u,i),yo(a,i,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Wn||Is(u,i);var p=yn,x=ra;bi(u.type)&&(yn=u.stateNode,ra=!1),yo(a,i,u),Td(u.stateNode),yn=p,ra=x;break;case 5:Wn||Is(u,i);case 6:if(p=yn,x=ra,yn=null,yo(a,i,u),yn=p,ra=x,yn!==null)if(ra)try{(yn.nodeType===9?yn.body:yn.nodeName==="HTML"?yn.ownerDocument.body:yn).removeChild(u.stateNode)}catch(E){Qt(u,i,E)}else try{yn.removeChild(u.stateNode)}catch(E){Qt(u,i,E)}break;case 18:yn!==null&&(ra?(a=yn,iw(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,u.stateNode),Bc(a)):iw(yn,u.stateNode));break;case 4:p=yn,x=ra,yn=u.stateNode.containerInfo,ra=!0,yo(a,i,u),yn=p,ra=x;break;case 0:case 11:case 14:case 15:hi(2,u,i),Wn||hi(4,u,i),yo(a,i,u);break;case 1:Wn||(Is(u,i),p=u.stateNode,typeof p.componentWillUnmount=="function"&&lE(u,i,p)),yo(a,i,u);break;case 21:yo(a,i,u);break;case 22:Wn=(p=Wn)||u.memoizedState!==null,yo(a,i,u),Wn=p;break;default:yo(a,i,u)}}function gE(a,i){if(i.memoizedState===null&&(a=i.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{Bc(a)}catch(u){Qt(i,i.return,u)}}}function yE(a,i){if(i.memoizedState===null&&(a=i.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Bc(a)}catch(u){Qt(i,i.return,u)}}function B8(a){switch(a.tag){case 31:case 13:case 19:var i=a.stateNode;return i===null&&(i=a.stateNode=new fE),i;case 22:return a=a.stateNode,i=a._retryCache,i===null&&(i=a._retryCache=new fE),i;default:throw Error(r(435,a.tag))}}function Bh(a,i){var u=B8(a);i.forEach(function(p){if(!u.has(p)){u.add(p);var x=J8.bind(null,a,p);p.then(x,x)}})}function aa(a,i){var u=i.deletions;if(u!==null)for(var p=0;p<u.length;p++){var x=u[p],E=a,N=i,I=N;e:for(;I!==null;){switch(I.tag){case 27:if(bi(I.type)){yn=I.stateNode,ra=!1;break e}break;case 5:yn=I.stateNode,ra=!1;break e;case 3:case 4:yn=I.stateNode.containerInfo,ra=!0;break e}I=I.return}if(yn===null)throw Error(r(160));pE(E,N,x),yn=null,ra=!1,E=x.alternate,E!==null&&(E.return=null),x.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)vE(i,a),i=i.sibling}var is=null;function vE(a,i){var u=a.alternate,p=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:aa(i,a),sa(a),p&4&&(hi(3,a,a.return),yd(3,a),hi(5,a,a.return));break;case 1:aa(i,a),sa(a),p&512&&(Wn||u===null||Is(u,u.return)),p&64&&go&&(a=a.updateQueue,a!==null&&(p=a.callbacks,p!==null&&(u=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=u===null?p:u.concat(p))));break;case 26:var x=is;if(aa(i,a),sa(a),p&512&&(Wn||u===null||Is(u,u.return)),p&4){var E=u!==null?u.memoizedState:null;if(p=a.memoizedState,u===null)if(p===null)if(a.stateNode===null){e:{p=a.type,u=a.memoizedProps,x=x.ownerDocument||x;t:switch(p){case"title":E=x.getElementsByTagName("title")[0],(!E||E[Kt]||E[He]||E.namespaceURI==="http://www.w3.org/2000/svg"||E.hasAttribute("itemprop"))&&(E=x.createElement(p),x.head.insertBefore(E,x.querySelector("head > title"))),wr(E,p,u),E[He]=a,Nn(E),p=E;break e;case"link":var N=vw("link","href",x).get(p+(u.href||""));if(N){for(var I=0;I<N.length;I++)if(E=N[I],E.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&E.getAttribute("rel")===(u.rel==null?null:u.rel)&&E.getAttribute("title")===(u.title==null?null:u.title)&&E.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){N.splice(I,1);break t}}E=x.createElement(p),wr(E,p,u),x.head.appendChild(E);break;case"meta":if(N=vw("meta","content",x).get(p+(u.content||""))){for(I=0;I<N.length;I++)if(E=N[I],E.getAttribute("content")===(u.content==null?null:""+u.content)&&E.getAttribute("name")===(u.name==null?null:u.name)&&E.getAttribute("property")===(u.property==null?null:u.property)&&E.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&E.getAttribute("charset")===(u.charSet==null?null:u.charSet)){N.splice(I,1);break t}}E=x.createElement(p),wr(E,p,u),x.head.appendChild(E);break;default:throw Error(r(468,p))}E[He]=a,Nn(E),p=E}a.stateNode=p}else xw(x,a.type,a.stateNode);else a.stateNode=yw(x,p,a.memoizedProps);else E!==p?(E===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):E.count--,p===null?xw(x,a.type,a.stateNode):yw(x,p,a.memoizedProps)):p===null&&a.stateNode!==null&&Rv(a,a.memoizedProps,u.memoizedProps)}break;case 27:aa(i,a),sa(a),p&512&&(Wn||u===null||Is(u,u.return)),u!==null&&p&4&&Rv(a,a.memoizedProps,u.memoizedProps);break;case 5:if(aa(i,a),sa(a),p&512&&(Wn||u===null||Is(u,u.return)),a.flags&32){x=a.stateNode;try{hc(x,"")}catch(Ge){Qt(a,a.return,Ge)}}p&4&&a.stateNode!=null&&(x=a.memoizedProps,Rv(a,x,u!==null?u.memoizedProps:x)),p&1024&&(_v=!0);break;case 6:if(aa(i,a),sa(a),p&4){if(a.stateNode===null)throw Error(r(162));p=a.memoizedProps,u=a.stateNode;try{u.nodeValue=p}catch(Ge){Qt(a,a.return,Ge)}}break;case 3:if(om=null,x=is,is=am(i.containerInfo),aa(i,a),is=x,sa(a),p&4&&u!==null&&u.memoizedState.isDehydrated)try{Bc(i.containerInfo)}catch(Ge){Qt(a,a.return,Ge)}_v&&(_v=!1,xE(a));break;case 4:p=is,is=am(a.stateNode.containerInfo),aa(i,a),sa(a),is=p;break;case 12:aa(i,a),sa(a);break;case 31:aa(i,a),sa(a),p&4&&(p=a.updateQueue,p!==null&&(a.updateQueue=null,Bh(a,p)));break;case 13:aa(i,a),sa(a),a.child.flags&8192&&a.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(qh=be()),p&4&&(p=a.updateQueue,p!==null&&(a.updateQueue=null,Bh(a,p)));break;case 22:x=a.memoizedState!==null;var $=u!==null&&u.memoizedState!==null,ae=go,he=Wn;if(go=ae||x,Wn=he||$,aa(i,a),Wn=he,go=ae,sa(a),p&8192)e:for(i=a.stateNode,i._visibility=x?i._visibility&-2:i._visibility|1,x&&(u===null||$||go||Wn||Rl(a)),u=null,i=a;;){if(i.tag===5||i.tag===26){if(u===null){$=u=i;try{if(E=$.stateNode,x)N=E.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none";else{I=$.stateNode;var pe=$.memoizedProps.style,oe=pe!=null&&pe.hasOwnProperty("display")?pe.display:null;I.style.display=oe==null||typeof oe=="boolean"?"":(""+oe).trim()}}catch(Ge){Qt($,$.return,Ge)}}}else if(i.tag===6){if(u===null){$=i;try{$.stateNode.nodeValue=x?"":$.memoizedProps}catch(Ge){Qt($,$.return,Ge)}}}else if(i.tag===18){if(u===null){$=i;try{var fe=$.stateNode;x?lw(fe,!0):lw($.stateNode,!1)}catch(Ge){Qt($,$.return,Ge)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===a)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===a)break e;for(;i.sibling===null;){if(i.return===null||i.return===a)break e;u===i&&(u=null),i=i.return}u===i&&(u=null),i.sibling.return=i.return,i=i.sibling}p&4&&(p=a.updateQueue,p!==null&&(u=p.retryQueue,u!==null&&(p.retryQueue=null,Bh(a,u))));break;case 19:aa(i,a),sa(a),p&4&&(p=a.updateQueue,p!==null&&(a.updateQueue=null,Bh(a,p)));break;case 30:break;case 21:break;default:aa(i,a),sa(a)}}function sa(a){var i=a.flags;if(i&2){try{for(var u,p=a.return;p!==null;){if(uE(p)){u=p;break}p=p.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var x=u.stateNode,E=jv(a);$h(a,E,x);break;case 5:var N=u.stateNode;u.flags&32&&(hc(N,""),u.flags&=-33);var I=jv(a);$h(a,I,N);break;case 3:case 4:var $=u.stateNode.containerInfo,ae=jv(a);Tv(a,ae,$);break;default:throw Error(r(161))}}catch(he){Qt(a,a.return,he)}a.flags&=-3}i&4096&&(a.flags&=-4097)}function xE(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var i=a;xE(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),a=a.sibling}}function vo(a,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)hE(a,i.alternate,i),i=i.sibling}function Rl(a){for(a=a.child;a!==null;){var i=a;switch(i.tag){case 0:case 11:case 14:case 15:hi(4,i,i.return),Rl(i);break;case 1:Is(i,i.return);var u=i.stateNode;typeof u.componentWillUnmount=="function"&&lE(i,i.return,u),Rl(i);break;case 27:Td(i.stateNode);case 26:case 5:Is(i,i.return),Rl(i);break;case 22:i.memoizedState===null&&Rl(i);break;case 30:Rl(i);break;default:Rl(i)}a=a.sibling}}function xo(a,i,u){for(u=u&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var p=i.alternate,x=a,E=i,N=E.flags;switch(E.tag){case 0:case 11:case 15:xo(x,E,u),yd(4,E);break;case 1:if(xo(x,E,u),p=E,x=p.stateNode,typeof x.componentDidMount=="function")try{x.componentDidMount()}catch(ae){Qt(p,p.return,ae)}if(p=E,x=p.updateQueue,x!==null){var I=p.stateNode;try{var $=x.shared.hiddenCallbacks;if($!==null)for(x.shared.hiddenCallbacks=null,x=0;x<$.length;x++)WC($[x],I)}catch(ae){Qt(p,p.return,ae)}}u&&N&64&&iE(E),vd(E,E.return);break;case 27:dE(E);case 26:case 5:xo(x,E,u),u&&p===null&&N&4&&cE(E),vd(E,E.return);break;case 12:xo(x,E,u);break;case 31:xo(x,E,u),u&&N&4&&gE(x,E);break;case 13:xo(x,E,u),u&&N&4&&yE(x,E);break;case 22:E.memoizedState===null&&xo(x,E,u),vd(E,E.return);break;case 30:break;default:xo(x,E,u)}i=i.sibling}}function Nv(a,i){var u=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),a=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),a!==u&&(a!=null&&a.refCount++,u!=null&&ad(u))}function Av(a,i){a=null,i.alternate!==null&&(a=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==a&&(i.refCount++,a!=null&&ad(a))}function ls(a,i,u,p){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)bE(a,i,u,p),i=i.sibling}function bE(a,i,u,p){var x=i.flags;switch(i.tag){case 0:case 11:case 15:ls(a,i,u,p),x&2048&&yd(9,i);break;case 1:ls(a,i,u,p);break;case 3:ls(a,i,u,p),x&2048&&(a=null,i.alternate!==null&&(a=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==a&&(i.refCount++,a!=null&&ad(a)));break;case 12:if(x&2048){ls(a,i,u,p),a=i.stateNode;try{var E=i.memoizedProps,N=E.id,I=E.onPostCommit;typeof I=="function"&&I(N,i.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch($){Qt(i,i.return,$)}}else ls(a,i,u,p);break;case 31:ls(a,i,u,p);break;case 13:ls(a,i,u,p);break;case 23:break;case 22:E=i.stateNode,N=i.alternate,i.memoizedState!==null?E._visibility&2?ls(a,i,u,p):xd(a,i):E._visibility&2?ls(a,i,u,p):(E._visibility|=2,Mc(a,i,u,p,(i.subtreeFlags&10256)!==0||!1)),x&2048&&Nv(N,i);break;case 24:ls(a,i,u,p),x&2048&&Av(i.alternate,i);break;default:ls(a,i,u,p)}}function Mc(a,i,u,p,x){for(x=x&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var E=a,N=i,I=u,$=p,ae=N.flags;switch(N.tag){case 0:case 11:case 15:Mc(E,N,I,$,x),yd(8,N);break;case 23:break;case 22:var he=N.stateNode;N.memoizedState!==null?he._visibility&2?Mc(E,N,I,$,x):xd(E,N):(he._visibility|=2,Mc(E,N,I,$,x)),x&&ae&2048&&Nv(N.alternate,N);break;case 24:Mc(E,N,I,$,x),x&&ae&2048&&Av(N.alternate,N);break;default:Mc(E,N,I,$,x)}i=i.sibling}}function xd(a,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var u=a,p=i,x=p.flags;switch(p.tag){case 22:xd(u,p),x&2048&&Nv(p.alternate,p);break;case 24:xd(u,p),x&2048&&Av(p.alternate,p);break;default:xd(u,p)}i=i.sibling}}var bd=8192;function Ic(a,i,u){if(a.subtreeFlags&bd)for(a=a.child;a!==null;)SE(a,i,u),a=a.sibling}function SE(a,i,u){switch(a.tag){case 26:Ic(a,i,u),a.flags&bd&&a.memoizedState!==null&&AM(u,is,a.memoizedState,a.memoizedProps);break;case 5:Ic(a,i,u);break;case 3:case 4:var p=is;is=am(a.stateNode.containerInfo),Ic(a,i,u),is=p;break;case 22:a.memoizedState===null&&(p=a.alternate,p!==null&&p.memoizedState!==null?(p=bd,bd=16777216,Ic(a,i,u),bd=p):Ic(a,i,u));break;default:Ic(a,i,u)}}function CE(a){var i=a.alternate;if(i!==null&&(a=i.child,a!==null)){i.child=null;do i=a.sibling,a.sibling=null,a=i;while(a!==null)}}function Sd(a){var i=a.deletions;if((a.flags&16)!==0){if(i!==null)for(var u=0;u<i.length;u++){var p=i[u];mr=p,wE(p,a)}CE(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)EE(a),a=a.sibling}function EE(a){switch(a.tag){case 0:case 11:case 15:Sd(a),a.flags&2048&&hi(9,a,a.return);break;case 3:Sd(a);break;case 12:Sd(a);break;case 22:var i=a.stateNode;a.memoizedState!==null&&i._visibility&2&&(a.return===null||a.return.tag!==13)?(i._visibility&=-3,Gh(a)):Sd(a);break;default:Sd(a)}}function Gh(a){var i=a.deletions;if((a.flags&16)!==0){if(i!==null)for(var u=0;u<i.length;u++){var p=i[u];mr=p,wE(p,a)}CE(a)}for(a=a.child;a!==null;){switch(i=a,i.tag){case 0:case 11:case 15:hi(8,i,i.return),Gh(i);break;case 22:u=i.stateNode,u._visibility&2&&(u._visibility&=-3,Gh(i));break;default:Gh(i)}a=a.sibling}}function wE(a,i){for(;mr!==null;){var u=mr;switch(u.tag){case 0:case 11:case 15:hi(8,u,i);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var p=u.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:ad(u.memoizedState.cache)}if(p=u.child,p!==null)p.return=u,mr=p;else e:for(u=a;mr!==null;){p=mr;var x=p.sibling,E=p.return;if(mE(p),p===u){mr=null;break e}if(x!==null){x.return=E,mr=x;break e}mr=E}}}var G8={getCacheForType:function(a){var i=Cr(Zn),u=i.data.get(a);return u===void 0&&(u=a(),i.data.set(a,u)),u},cacheSignal:function(){return Cr(Zn).controller.signal}},q8=typeof WeakMap=="function"?WeakMap:Map,Bt=0,an=null,Et=null,jt=0,Wt=0,Ea=null,mi=!1,kc=!1,Dv=!1,bo=0,Dn=0,pi=0,jl=0,Ov=0,wa=0,Lc=0,Cd=null,oa=null,Mv=!1,qh=0,RE=0,Zh=1/0,Kh=null,gi=null,nr=0,yi=null,Pc=null,So=0,Iv=0,kv=null,jE=null,Ed=0,Lv=null;function Ra(){return(Bt&2)!==0&&jt!==0?jt&-jt:k.T!==null?Hv():Le()}function TE(){if(wa===0)if((jt&536870912)===0||Mt){var a=As;As<<=1,(As&3932160)===0&&(As=262144),wa=a}else wa=536870912;return a=Sa.current,a!==null&&(a.flags|=32),wa}function ia(a,i,u){(a===an&&(Wt===2||Wt===9)||a.cancelPendingCommit!==null)&&(Uc(a,0),vi(a,jt,wa,!1)),Xr(a,u),((Bt&2)===0||a!==an)&&(a===an&&((Bt&2)===0&&(jl|=u),Dn===4&&vi(a,jt,wa,!1)),ks(a))}function _E(a,i,u){if((Bt&6)!==0)throw Error(r(327));var p=!u&&(i&127)===0&&(i&a.expiredLanes)===0||xr(a,i),x=p?Y8(a,i):Uv(a,i,!0),E=p;do{if(x===0){kc&&!p&&vi(a,i,0,!1);break}else{if(u=a.current.alternate,E&&!Z8(u)){x=Uv(a,i,!1),E=!1;continue}if(x===2){if(E=i,a.errorRecoveryDisabledLanes&E)var N=0;else N=a.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){i=N;e:{var I=a;x=Cd;var $=I.current.memoizedState.isDehydrated;if($&&(Uc(I,N).flags|=256),N=Uv(I,N,!1),N!==2){if(Dv&&!$){I.errorRecoveryDisabledLanes|=E,jl|=E,x=4;break e}E=oa,oa=x,E!==null&&(oa===null?oa=E:oa.push.apply(oa,E))}x=N}if(E=!1,x!==2)continue}}if(x===1){Uc(a,0),vi(a,i,0,!0);break}e:{switch(p=a,E=x,E){case 0:case 1:throw Error(r(345));case 4:if((i&4194048)!==i)break;case 6:vi(p,i,wa,!mi);break e;case 2:oa=null;break;case 3:case 5:break;default:throw Error(r(329))}if((i&62914560)===i&&(x=qh+300-be(),10<x)){if(vi(p,i,wa,!mi),Gn(p,0,!0)!==0)break e;So=i,p.timeoutHandle=sw(NE.bind(null,p,u,oa,Kh,Mv,i,wa,jl,Lc,mi,E,"Throttled",-0,0),x);break e}NE(p,u,oa,Kh,Mv,i,wa,jl,Lc,mi,E,null,-0,0)}}break}while(!0);ks(a)}function NE(a,i,u,p,x,E,N,I,$,ae,he,pe,oe,fe){if(a.timeoutHandle=-1,pe=i.subtreeFlags,pe&8192||(pe&16785408)===16785408){pe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:so},SE(i,E,pe);var Ge=(E&62914560)===E?qh-be():(E&4194048)===E?RE-be():0;if(Ge=DM(pe,Ge),Ge!==null){So=E,a.cancelPendingCommit=Ge(PE.bind(null,a,i,E,u,p,x,N,I,$,he,pe,null,oe,fe)),vi(a,E,N,!ae);return}}PE(a,i,E,u,p,x,N,I,$)}function Z8(a){for(var i=a;;){var u=i.tag;if((u===0||u===11||u===15)&&i.flags&16384&&(u=i.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var p=0;p<u.length;p++){var x=u[p],E=x.getSnapshot;x=x.value;try{if(!xa(E(),x))return!1}catch{return!1}}if(u=i.child,i.subtreeFlags&16384&&u!==null)u.return=i,i=u;else{if(i===a)break;for(;i.sibling===null;){if(i.return===null||i.return===a)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function vi(a,i,u,p){i&=~Ov,i&=~jl,a.suspendedLanes|=i,a.pingedLanes&=~i,p&&(a.warmLanes|=i),p=a.expirationTimes;for(var x=i;0<x;){var E=31-_n(x),N=1<<E;p[E]=-1,x&=~N}u!==0&&X(a,u,i)}function Yh(){return(Bt&6)===0?(wd(0),!1):!0}function Pv(){if(Et!==null){if(Wt===0)var a=Et.return;else a=Et,co=yl=null,Jy(a),_c=null,od=0,a=Et;for(;a!==null;)oE(a.alternate,a),a=a.return;Et=null}}function Uc(a,i){var u=a.timeoutHandle;u!==-1&&(a.timeoutHandle=-1,hM(u)),u=a.cancelPendingCommit,u!==null&&(a.cancelPendingCommit=null,u()),So=0,Pv(),an=a,Et=u=io(a.current,null),jt=i,Wt=0,Ea=null,mi=!1,kc=xr(a,i),Dv=!1,Lc=wa=Ov=jl=pi=Dn=0,oa=Cd=null,Mv=!1,(i&8)!==0&&(i|=i&32);var p=a.entangledLanes;if(p!==0)for(a=a.entanglements,p&=i;0<p;){var x=31-_n(p),E=1<<x;i|=a[x],p&=~E}return bo=i,gh(),u}function AE(a,i){ht=null,k.H=md,i===Tc||i===wh?(i=qC(),Wt=3):i===zy?(i=qC(),Wt=4):Wt=i===pv?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Ea=i,Et===null&&(Dn=1,Uh(a,Ba(i,a.current)))}function DE(){var a=Sa.current;return a===null?!0:(jt&4194048)===jt?Ka===null:(jt&62914560)===jt||(jt&536870912)!==0?a===Ka:!1}function OE(){var a=k.H;return k.H=md,a===null?md:a}function ME(){var a=k.A;return k.A=G8,a}function Wh(){Dn=4,mi||(jt&4194048)!==jt&&Sa.current!==null||(kc=!0),(pi&134217727)===0&&(jl&134217727)===0||an===null||vi(an,jt,wa,!1)}function Uv(a,i,u){var p=Bt;Bt|=2;var x=OE(),E=ME();(an!==a||jt!==i)&&(Kh=null,Uc(a,i)),i=!1;var N=Dn;e:do try{if(Wt!==0&&Et!==null){var I=Et,$=Ea;switch(Wt){case 8:Pv(),N=6;break e;case 3:case 2:case 9:case 6:Sa.current===null&&(i=!0);var ae=Wt;if(Wt=0,Ea=null,Fc(a,I,$,ae),u&&kc){N=0;break e}break;default:ae=Wt,Wt=0,Ea=null,Fc(a,I,$,ae)}}K8(),N=Dn;break}catch(he){AE(a,he)}while(!0);return i&&a.shellSuspendCounter++,co=yl=null,Bt=p,k.H=x,k.A=E,Et===null&&(an=null,jt=0,gh()),N}function K8(){for(;Et!==null;)IE(Et)}function Y8(a,i){var u=Bt;Bt|=2;var p=OE(),x=ME();an!==a||jt!==i?(Kh=null,Zh=be()+500,Uc(a,i)):kc=xr(a,i);e:do try{if(Wt!==0&&Et!==null){i=Et;var E=Ea;t:switch(Wt){case 1:Wt=0,Ea=null,Fc(a,i,E,1);break;case 2:case 9:if(BC(E)){Wt=0,Ea=null,kE(i);break}i=function(){Wt!==2&&Wt!==9||an!==a||(Wt=7),ks(a)},E.then(i,i);break e;case 3:Wt=7;break e;case 4:Wt=5;break e;case 7:BC(E)?(Wt=0,Ea=null,kE(i)):(Wt=0,Ea=null,Fc(a,i,E,7));break;case 5:var N=null;switch(Et.tag){case 26:N=Et.memoizedState;case 5:case 27:var I=Et;if(N?bw(N):I.stateNode.complete){Wt=0,Ea=null;var $=I.sibling;if($!==null)Et=$;else{var ae=I.return;ae!==null?(Et=ae,Qh(ae)):Et=null}break t}}Wt=0,Ea=null,Fc(a,i,E,5);break;case 6:Wt=0,Ea=null,Fc(a,i,E,6);break;case 8:Pv(),Dn=6;break e;default:throw Error(r(462))}}W8();break}catch(he){AE(a,he)}while(!0);return co=yl=null,k.H=p,k.A=x,Bt=u,Et!==null?0:(an=null,jt=0,gh(),Dn)}function W8(){for(;Et!==null&&!de();)IE(Et)}function IE(a){var i=aE(a.alternate,a,bo);a.memoizedProps=a.pendingProps,i===null?Qh(a):Et=i}function kE(a){var i=a,u=i.alternate;switch(i.tag){case 15:case 0:i=X2(u,i,i.pendingProps,i.type,void 0,jt);break;case 11:i=X2(u,i,i.pendingProps,i.type.render,i.ref,jt);break;case 5:Jy(i);default:oE(u,i),i=Et=MC(i,bo),i=aE(u,i,bo)}a.memoizedProps=a.pendingProps,i===null?Qh(a):Et=i}function Fc(a,i,u,p){co=yl=null,Jy(i),_c=null,od=0;var x=i.return;try{if(U8(a,x,i,u,jt)){Dn=1,Uh(a,Ba(u,a.current)),Et=null;return}}catch(E){if(x!==null)throw Et=x,E;Dn=1,Uh(a,Ba(u,a.current)),Et=null;return}i.flags&32768?(Mt||p===1?a=!0:kc||(jt&536870912)!==0?a=!1:(mi=a=!0,(p===2||p===9||p===3||p===6)&&(p=Sa.current,p!==null&&p.tag===13&&(p.flags|=16384))),LE(i,a)):Qh(i)}function Qh(a){var i=a;do{if((i.flags&32768)!==0){LE(i,mi);return}a=i.return;var u=z8(i.alternate,i,bo);if(u!==null){Et=u;return}if(i=i.sibling,i!==null){Et=i;return}Et=i=a}while(i!==null);Dn===0&&(Dn=5)}function LE(a,i){do{var u=H8(a.alternate,a);if(u!==null){u.flags&=32767,Et=u;return}if(u=a.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!i&&(a=a.sibling,a!==null)){Et=a;return}Et=a=u}while(a!==null);Dn=6,Et=null}function PE(a,i,u,p,x,E,N,I,$){a.cancelPendingCommit=null;do Xh();while(nr!==0);if((Bt&6)!==0)throw Error(r(327));if(i!==null){if(i===a.current)throw Error(r(177));if(E=i.lanes|i.childLanes,E|=jy,V(a,u,E,N,I,$),a===an&&(Et=an=null,jt=0),Pc=i,yi=a,So=u,Iv=E,kv=x,jE=p,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,eM(it,function(){return HE(),null})):(a.callbackNode=null,a.callbackPriority=0),p=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||p){p=k.T,k.T=null,x=z.p,z.p=2,N=Bt,Bt|=4;try{$8(a,i,u)}finally{Bt=N,z.p=x,k.T=p}}nr=1,UE(),FE(),VE()}}function UE(){if(nr===1){nr=0;var a=yi,i=Pc,u=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||u){u=k.T,k.T=null;var p=z.p;z.p=2;var x=Bt;Bt|=4;try{vE(i,a);var E=Wv,N=wC(a.containerInfo),I=E.focusedElem,$=E.selectionRange;if(N!==I&&I&&I.ownerDocument&&EC(I.ownerDocument.documentElement,I)){if($!==null&&Sy(I)){var ae=$.start,he=$.end;if(he===void 0&&(he=ae),"selectionStart"in I)I.selectionStart=ae,I.selectionEnd=Math.min(he,I.value.length);else{var pe=I.ownerDocument||document,oe=pe&&pe.defaultView||window;if(oe.getSelection){var fe=oe.getSelection(),Ge=I.textContent.length,nt=Math.min($.start,Ge),rn=$.end===void 0?nt:Math.min($.end,Ge);!fe.extend&&nt>rn&&(N=rn,rn=nt,nt=N);var ee=CC(I,nt),W=CC(I,rn);if(ee&&W&&(fe.rangeCount!==1||fe.anchorNode!==ee.node||fe.anchorOffset!==ee.offset||fe.focusNode!==W.node||fe.focusOffset!==W.offset)){var re=pe.createRange();re.setStart(ee.node,ee.offset),fe.removeAllRanges(),nt>rn?(fe.addRange(re),fe.extend(W.node,W.offset)):(re.setEnd(W.node,W.offset),fe.addRange(re))}}}}for(pe=[],fe=I;fe=fe.parentNode;)fe.nodeType===1&&pe.push({element:fe,left:fe.scrollLeft,top:fe.scrollTop});for(typeof I.focus=="function"&&I.focus(),I=0;I<pe.length;I++){var me=pe[I];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}um=!!Yv,Wv=Yv=null}finally{Bt=x,z.p=p,k.T=u}}a.current=i,nr=2}}function FE(){if(nr===2){nr=0;var a=yi,i=Pc,u=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||u){u=k.T,k.T=null;var p=z.p;z.p=2;var x=Bt;Bt|=4;try{hE(a,i.alternate,i)}finally{Bt=x,z.p=p,k.T=u}}nr=3}}function VE(){if(nr===4||nr===3){nr=0,_e();var a=yi,i=Pc,u=So,p=jE;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?nr=5:(nr=0,Pc=yi=null,zE(a,a.pendingLanes));var x=a.pendingLanes;if(x===0&&(gi=null),ze(u),i=i.stateNode,Tn&&typeof Tn.onCommitFiberRoot=="function")try{Tn.onCommitFiberRoot(Fn,i,void 0,(i.current.flags&128)===128)}catch{}if(p!==null){i=k.T,x=z.p,z.p=2,k.T=null;try{for(var E=a.onRecoverableError,N=0;N<p.length;N++){var I=p[N];E(I.value,{componentStack:I.stack})}}finally{k.T=i,z.p=x}}(So&3)!==0&&Xh(),ks(a),x=a.pendingLanes,(u&261930)!==0&&(x&42)!==0?a===Lv?Ed++:(Ed=0,Lv=a):Ed=0,wd(0)}}function zE(a,i){(a.pooledCacheLanes&=i)===0&&(i=a.pooledCache,i!=null&&(a.pooledCache=null,ad(i)))}function Xh(){return UE(),FE(),VE(),HE()}function HE(){if(nr!==5)return!1;var a=yi,i=Iv;Iv=0;var u=ze(So),p=k.T,x=z.p;try{z.p=32>u?32:u,k.T=null,u=kv,kv=null;var E=yi,N=So;if(nr=0,Pc=yi=null,So=0,(Bt&6)!==0)throw Error(r(331));var I=Bt;if(Bt|=4,EE(E.current),bE(E,E.current,N,u),Bt=I,wd(0,!1),Tn&&typeof Tn.onPostCommitFiberRoot=="function")try{Tn.onPostCommitFiberRoot(Fn,E)}catch{}return!0}finally{z.p=x,k.T=p,zE(a,i)}}function $E(a,i,u){i=Ba(u,i),i=mv(a.stateNode,i,2),a=ui(a,i,2),a!==null&&(Xr(a,2),ks(a))}function Qt(a,i,u){if(a.tag===3)$E(a,a,u);else for(;i!==null;){if(i.tag===3){$E(i,a,u);break}else if(i.tag===1){var p=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(gi===null||!gi.has(p))){a=Ba(u,a),u=B2(2),p=ui(i,u,2),p!==null&&(G2(u,p,i,a),Xr(p,2),ks(p));break}}i=i.return}}function Fv(a,i,u){var p=a.pingCache;if(p===null){p=a.pingCache=new q8;var x=new Set;p.set(i,x)}else x=p.get(i),x===void 0&&(x=new Set,p.set(i,x));x.has(u)||(Dv=!0,x.add(u),a=Q8.bind(null,a,i,u),i.then(a,a))}function Q8(a,i,u){var p=a.pingCache;p!==null&&p.delete(i),a.pingedLanes|=a.suspendedLanes&u,a.warmLanes&=~u,an===a&&(jt&u)===u&&(Dn===4||Dn===3&&(jt&62914560)===jt&&300>be()-qh?(Bt&2)===0&&Uc(a,0):Ov|=u,Lc===jt&&(Lc=0)),ks(a)}function BE(a,i){i===0&&(i=Vn()),a=ml(a,i),a!==null&&(Xr(a,i),ks(a))}function X8(a){var i=a.memoizedState,u=0;i!==null&&(u=i.retryLane),BE(a,u)}function J8(a,i){var u=0;switch(a.tag){case 31:case 13:var p=a.stateNode,x=a.memoizedState;x!==null&&(u=x.retryLane);break;case 19:p=a.stateNode;break;case 22:p=a.stateNode._retryCache;break;default:throw Error(r(314))}p!==null&&p.delete(i),BE(a,u)}function eM(a,i){return U(a,i)}var Jh=null,Vc=null,Vv=!1,em=!1,zv=!1,xi=0;function ks(a){a!==Vc&&a.next===null&&(Vc===null?Jh=Vc=a:Vc=Vc.next=a),em=!0,Vv||(Vv=!0,nM())}function wd(a,i){if(!zv&&em){zv=!0;do for(var u=!1,p=Jh;p!==null;){if(a!==0){var x=p.pendingLanes;if(x===0)var E=0;else{var N=p.suspendedLanes,I=p.pingedLanes;E=(1<<31-_n(42|a)+1)-1,E&=x&~(N&~I),E=E&201326741?E&201326741|1:E?E|2:0}E!==0&&(u=!0,KE(p,E))}else E=jt,E=Gn(p,p===an?E:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(E&3)===0||xr(p,E)||(u=!0,KE(p,E));p=p.next}while(u);zv=!1}}function tM(){GE()}function GE(){em=Vv=!1;var a=0;xi!==0&&fM()&&(a=xi);for(var i=be(),u=null,p=Jh;p!==null;){var x=p.next,E=qE(p,i);E===0?(p.next=null,u===null?Jh=x:u.next=x,x===null&&(Vc=u)):(u=p,(a!==0||(E&3)!==0)&&(em=!0)),p=x}nr!==0&&nr!==5||wd(a),xi!==0&&(xi=0)}function qE(a,i){for(var u=a.suspendedLanes,p=a.pingedLanes,x=a.expirationTimes,E=a.pendingLanes&-62914561;0<E;){var N=31-_n(E),I=1<<N,$=x[N];$===-1?((I&u)===0||(I&p)!==0)&&(x[N]=er(I,i)):$<=i&&(a.expiredLanes|=I),E&=~I}if(i=an,u=jt,u=Gn(a,a===i?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),p=a.callbackNode,u===0||a===i&&(Wt===2||Wt===9)||a.cancelPendingCommit!==null)return p!==null&&p!==null&&Q(p),a.callbackNode=null,a.callbackPriority=0;if((u&3)===0||xr(a,u)){if(i=u&-u,i===a.callbackPriority)return i;switch(p!==null&&Q(p),ze(u)){case 2:case 8:u=ot;break;case 32:u=it;break;case 268435456:u=Ua;break;default:u=it}return p=ZE.bind(null,a),u=U(u,p),a.callbackPriority=i,a.callbackNode=u,i}return p!==null&&p!==null&&Q(p),a.callbackPriority=2,a.callbackNode=null,2}function ZE(a,i){if(nr!==0&&nr!==5)return a.callbackNode=null,a.callbackPriority=0,null;var u=a.callbackNode;if(Xh()&&a.callbackNode!==u)return null;var p=jt;return p=Gn(a,a===an?p:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),p===0?null:(_E(a,p,i),qE(a,be()),a.callbackNode!=null&&a.callbackNode===u?ZE.bind(null,a):null)}function KE(a,i){if(Xh())return null;_E(a,i,!0)}function nM(){mM(function(){(Bt&6)!==0?U(We,tM):GE()})}function Hv(){if(xi===0){var a=Rc;a===0&&(a=to,to<<=1,(to&261888)===0&&(to=256)),xi=a}return xi}function YE(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:lh(""+a)}function WE(a,i){var u=i.ownerDocument.createElement("input");return u.name=i.name,u.value=i.value,a.id&&u.setAttribute("form",a.id),i.parentNode.insertBefore(u,i),a=new FormData(a),u.parentNode.removeChild(u),a}function rM(a,i,u,p,x){if(i==="submit"&&u&&u.stateNode===x){var E=YE((x[qe]||null).action),N=p.submitter;N&&(i=(i=N[qe]||null)?YE(i.formAction):N.getAttribute("formAction"),i!==null&&(E=i,N=null));var I=new fh("action","action",null,p,x);a.push({event:I,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(xi!==0){var $=N?WE(x,N):new FormData(x);lv(u,{pending:!0,data:$,method:x.method,action:E},null,$)}}else typeof E=="function"&&(I.preventDefault(),$=N?WE(x,N):new FormData(x),lv(u,{pending:!0,data:$,method:x.method,action:E},E,$))},currentTarget:x}]})}}for(var $v=0;$v<Ry.length;$v++){var Bv=Ry[$v],aM=Bv.toLowerCase(),sM=Bv[0].toUpperCase()+Bv.slice(1);os(aM,"on"+sM)}os(TC,"onAnimationEnd"),os(_C,"onAnimationIteration"),os(NC,"onAnimationStart"),os("dblclick","onDoubleClick"),os("focusin","onFocus"),os("focusout","onBlur"),os(S8,"onTransitionRun"),os(C8,"onTransitionStart"),os(E8,"onTransitionCancel"),os(AC,"onTransitionEnd"),ss("onMouseEnter",["mouseout","mouseover"]),ss("onMouseLeave",["mouseout","mouseover"]),ss("onPointerEnter",["pointerout","pointerover"]),ss("onPointerLeave",["pointerout","pointerover"]),Va("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Va("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Va("onBeforeInput",["compositionend","keypress","textInput","paste"]),Va("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Va("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Va("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Rd="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),oM=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Rd));function QE(a,i){i=(i&4)!==0;for(var u=0;u<a.length;u++){var p=a[u],x=p.event;p=p.listeners;e:{var E=void 0;if(i)for(var N=p.length-1;0<=N;N--){var I=p[N],$=I.instance,ae=I.currentTarget;if(I=I.listener,$!==E&&x.isPropagationStopped())break e;E=I,x.currentTarget=ae;try{E(x)}catch(he){ph(he)}x.currentTarget=null,E=$}else for(N=0;N<p.length;N++){if(I=p[N],$=I.instance,ae=I.currentTarget,I=I.listener,$!==E&&x.isPropagationStopped())break e;E=I,x.currentTarget=ae;try{E(x)}catch(he){ph(he)}x.currentTarget=null,E=$}}}}function wt(a,i){var u=i[ut];u===void 0&&(u=i[ut]=new Set);var p=a+"__bubble";u.has(p)||(XE(i,a,2,!1),u.add(p))}function Gv(a,i,u){var p=0;i&&(p|=4),XE(u,a,p,i)}var tm="_reactListening"+Math.random().toString(36).slice(2);function qv(a){if(!a[tm]){a[tm]=!0,ni.forEach(function(u){u!=="selectionchange"&&(oM.has(u)||Gv(u,!1,a),Gv(u,!0,a))});var i=a.nodeType===9?a:a.ownerDocument;i===null||i[tm]||(i[tm]=!0,Gv("selectionchange",!1,i))}}function XE(a,i,u,p){switch(Tw(i)){case 2:var x=IM;break;case 8:x=kM;break;default:x=ix}u=x.bind(null,i,u,a),x=void 0,!fy||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(x=!0),p?x!==void 0?a.addEventListener(i,u,{capture:!0,passive:x}):a.addEventListener(i,u,!0):x!==void 0?a.addEventListener(i,u,{passive:x}):a.addEventListener(i,u,!1)}function Zv(a,i,u,p,x){var E=p;if((i&1)===0&&(i&2)===0&&p!==null)e:for(;;){if(p===null)return;var N=p.tag;if(N===3||N===4){var I=p.stateNode.containerInfo;if(I===x)break;if(N===4)for(N=p.return;N!==null;){var $=N.tag;if(($===3||$===4)&&N.stateNode.containerInfo===x)return;N=N.return}for(;I!==null;){if(N=Jr(I),N===null)return;if($=N.tag,$===5||$===6||$===26||$===27){p=E=N;continue e}I=I.parentNode}}p=p.return}rC(function(){var ae=E,he=uy(u),pe=[];e:{var oe=DC.get(a);if(oe!==void 0){var fe=fh,Ge=a;switch(a){case"keypress":if(uh(u)===0)break e;case"keydown":case"keyup":fe=J6;break;case"focusin":Ge="focus",fe=gy;break;case"focusout":Ge="blur",fe=gy;break;case"beforeblur":case"afterblur":fe=gy;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":fe=oC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=z6;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=n8;break;case TC:case _C:case NC:fe=B6;break;case AC:fe=a8;break;case"scroll":case"scrollend":fe=F6;break;case"wheel":fe=o8;break;case"copy":case"cut":case"paste":fe=q6;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=lC;break;case"toggle":case"beforetoggle":fe=l8}var nt=(i&4)!==0,rn=!nt&&(a==="scroll"||a==="scrollend"),ee=nt?oe!==null?oe+"Capture":null:oe;nt=[];for(var W=ae,re;W!==null;){var me=W;if(re=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||re===null||ee===null||(me=Zu(W,ee),me!=null&&nt.push(jd(W,me,re))),rn)break;W=W.return}0<nt.length&&(oe=new fe(oe,Ge,null,u,he),pe.push({event:oe,listeners:nt}))}}if((i&7)===0){e:{if(oe=a==="mouseover"||a==="pointerover",fe=a==="mouseout"||a==="pointerout",oe&&u!==cy&&(Ge=u.relatedTarget||u.fromElement)&&(Jr(Ge)||Ge[Ze]))break e;if((fe||oe)&&(oe=he.window===he?he:(oe=he.ownerDocument)?oe.defaultView||oe.parentWindow:window,fe?(Ge=u.relatedTarget||u.toElement,fe=ae,Ge=Ge?Jr(Ge):null,Ge!==null&&(rn=l(Ge),nt=Ge.tag,Ge!==rn||nt!==5&&nt!==27&&nt!==6)&&(Ge=null)):(fe=null,Ge=ae),fe!==Ge)){if(nt=oC,me="onMouseLeave",ee="onMouseEnter",W="mouse",(a==="pointerout"||a==="pointerover")&&(nt=lC,me="onPointerLeave",ee="onPointerEnter",W="pointer"),rn=fe==null?oe:ea(fe),re=Ge==null?oe:ea(Ge),oe=new nt(me,W+"leave",fe,u,he),oe.target=rn,oe.relatedTarget=re,me=null,Jr(he)===ae&&(nt=new nt(ee,W+"enter",Ge,u,he),nt.target=re,nt.relatedTarget=rn,me=nt),rn=me,fe&&Ge)t:{for(nt=iM,ee=fe,W=Ge,re=0,me=ee;me;me=nt(me))re++;me=0;for(var tt=W;tt;tt=nt(tt))me++;for(;0<re-me;)ee=nt(ee),re--;for(;0<me-re;)W=nt(W),me--;for(;re--;){if(ee===W||W!==null&&ee===W.alternate){nt=ee;break t}ee=nt(ee),W=nt(W)}nt=null}else nt=null;fe!==null&&JE(pe,oe,fe,nt,!1),Ge!==null&&rn!==null&&JE(pe,rn,Ge,nt,!0)}}e:{if(oe=ae?ea(ae):window,fe=oe.nodeName&&oe.nodeName.toLowerCase(),fe==="select"||fe==="input"&&oe.type==="file")var Vt=gC;else if(mC(oe))if(yC)Vt=v8;else{Vt=g8;var Xe=p8}else fe=oe.nodeName,!fe||fe.toLowerCase()!=="input"||oe.type!=="checkbox"&&oe.type!=="radio"?ae&&ly(ae.elementType)&&(Vt=gC):Vt=y8;if(Vt&&(Vt=Vt(a,ae))){pC(pe,Vt,u,he);break e}Xe&&Xe(a,oe,ae),a==="focusout"&&ae&&oe.type==="number"&&ae.memoizedProps.value!=null&&iy(oe,"number",oe.value)}switch(Xe=ae?ea(ae):window,a){case"focusin":(mC(Xe)||Xe.contentEditable==="true")&&(yc=Xe,Cy=ae,td=null);break;case"focusout":td=Cy=yc=null;break;case"mousedown":Ey=!0;break;case"contextmenu":case"mouseup":case"dragend":Ey=!1,RC(pe,u,he);break;case"selectionchange":if(b8)break;case"keydown":case"keyup":RC(pe,u,he)}var gt;if(vy)e:{switch(a){case"compositionstart":var Tt="onCompositionStart";break e;case"compositionend":Tt="onCompositionEnd";break e;case"compositionupdate":Tt="onCompositionUpdate";break e}Tt=void 0}else gc?fC(a,u)&&(Tt="onCompositionEnd"):a==="keydown"&&u.keyCode===229&&(Tt="onCompositionStart");Tt&&(cC&&u.locale!=="ko"&&(gc||Tt!=="onCompositionStart"?Tt==="onCompositionEnd"&&gc&&(gt=aC()):(ri=he,hy="value"in ri?ri.value:ri.textContent,gc=!0)),Xe=nm(ae,Tt),0<Xe.length&&(Tt=new iC(Tt,a,null,u,he),pe.push({event:Tt,listeners:Xe}),gt?Tt.data=gt:(gt=hC(u),gt!==null&&(Tt.data=gt)))),(gt=u8?d8(a,u):f8(a,u))&&(Tt=nm(ae,"onBeforeInput"),0<Tt.length&&(Xe=new iC("onBeforeInput","beforeinput",null,u,he),pe.push({event:Xe,listeners:Tt}),Xe.data=gt)),rM(pe,a,ae,u,he)}QE(pe,i)})}function jd(a,i,u){return{instance:a,listener:i,currentTarget:u}}function nm(a,i){for(var u=i+"Capture",p=[];a!==null;){var x=a,E=x.stateNode;if(x=x.tag,x!==5&&x!==26&&x!==27||E===null||(x=Zu(a,u),x!=null&&p.unshift(jd(a,x,E)),x=Zu(a,i),x!=null&&p.push(jd(a,x,E))),a.tag===3)return p;a=a.return}return[]}function iM(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function JE(a,i,u,p,x){for(var E=i._reactName,N=[];u!==null&&u!==p;){var I=u,$=I.alternate,ae=I.stateNode;if(I=I.tag,$!==null&&$===p)break;I!==5&&I!==26&&I!==27||ae===null||($=ae,x?(ae=Zu(u,E),ae!=null&&N.unshift(jd(u,ae,$))):x||(ae=Zu(u,E),ae!=null&&N.push(jd(u,ae,$)))),u=u.return}N.length!==0&&a.push({event:i,listeners:N})}var lM=/\r\n?/g,cM=/\u0000|\uFFFD/g;function ew(a){return(typeof a=="string"?a:""+a).replace(lM,`
49
+ `).replace(cM,"")}function tw(a,i){return i=ew(i),ew(a)===i}function nn(a,i,u,p,x,E){switch(u){case"children":typeof p=="string"?i==="body"||i==="textarea"&&p===""||hc(a,p):(typeof p=="number"||typeof p=="bigint")&&i!=="body"&&hc(a,""+p);break;case"className":ao(a,"class",p);break;case"tabIndex":ao(a,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":ao(a,u,p);break;case"style":tC(a,p,E);break;case"data":if(i!=="object"){ao(a,"data",p);break}case"src":case"href":if(p===""&&(i!=="a"||u!=="href")){a.removeAttribute(u);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){a.removeAttribute(u);break}p=lh(""+p),a.setAttribute(u,p);break;case"action":case"formAction":if(typeof p=="function"){a.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof E=="function"&&(u==="formAction"?(i!=="input"&&nn(a,i,"name",x.name,x,null),nn(a,i,"formEncType",x.formEncType,x,null),nn(a,i,"formMethod",x.formMethod,x,null),nn(a,i,"formTarget",x.formTarget,x,null)):(nn(a,i,"encType",x.encType,x,null),nn(a,i,"method",x.method,x,null),nn(a,i,"target",x.target,x,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){a.removeAttribute(u);break}p=lh(""+p),a.setAttribute(u,p);break;case"onClick":p!=null&&(a.onclick=so);break;case"onScroll":p!=null&&wt("scroll",a);break;case"onScrollEnd":p!=null&&wt("scrollend",a);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(u=p.__html,u!=null){if(x.children!=null)throw Error(r(60));a.innerHTML=u}}break;case"multiple":a.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":a.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){a.removeAttribute("xlink:href");break}u=lh(""+p),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?a.setAttribute(u,""+p):a.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":p&&typeof p!="function"&&typeof p!="symbol"?a.setAttribute(u,""):a.removeAttribute(u);break;case"capture":case"download":p===!0?a.setAttribute(u,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?a.setAttribute(u,p):a.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?a.setAttribute(u,p):a.removeAttribute(u);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?a.removeAttribute(u):a.setAttribute(u,p);break;case"popover":wt("beforetoggle",a),wt("toggle",a),gn(a,"popover",p);break;case"xlinkActuate":za(a,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":za(a,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":za(a,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":za(a,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":za(a,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":za(a,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":za(a,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":za(a,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":za(a,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":gn(a,"is",p);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=P6.get(u)||u,gn(a,u,p))}}function Kv(a,i,u,p,x,E){switch(u){case"style":tC(a,p,E);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(u=p.__html,u!=null){if(x.children!=null)throw Error(r(60));a.innerHTML=u}}break;case"children":typeof p=="string"?hc(a,p):(typeof p=="number"||typeof p=="bigint")&&hc(a,""+p);break;case"onScroll":p!=null&&wt("scroll",a);break;case"onScrollEnd":p!=null&&wt("scrollend",a);break;case"onClick":p!=null&&(a.onclick=so);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ds.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(x=u.endsWith("Capture"),i=u.slice(2,x?u.length-7:void 0),E=a[qe]||null,E=E!=null?E[u]:null,typeof E=="function"&&a.removeEventListener(i,E,x),typeof p=="function")){typeof E!="function"&&E!==null&&(u in a?a[u]=null:a.hasAttribute(u)&&a.removeAttribute(u)),a.addEventListener(i,p,x);break e}u in a?a[u]=p:p===!0?a.setAttribute(u,""):gn(a,u,p)}}}function wr(a,i,u){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":wt("error",a),wt("load",a);var p=!1,x=!1,E;for(E in u)if(u.hasOwnProperty(E)){var N=u[E];if(N!=null)switch(E){case"src":p=!0;break;case"srcSet":x=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:nn(a,i,E,N,u,null)}}x&&nn(a,i,"srcSet",u.srcSet,u,null),p&&nn(a,i,"src",u.src,u,null);return;case"input":wt("invalid",a);var I=E=N=x=null,$=null,ae=null;for(p in u)if(u.hasOwnProperty(p)){var he=u[p];if(he!=null)switch(p){case"name":x=he;break;case"type":N=he;break;case"checked":$=he;break;case"defaultChecked":ae=he;break;case"value":E=he;break;case"defaultValue":I=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,i));break;default:nn(a,i,p,he,u,null)}}QS(a,E,I,$,ae,N,x,!1);return;case"select":wt("invalid",a),p=N=E=null;for(x in u)if(u.hasOwnProperty(x)&&(I=u[x],I!=null))switch(x){case"value":E=I;break;case"defaultValue":N=I;break;case"multiple":p=I;default:nn(a,i,x,I,u,null)}i=E,u=N,a.multiple=!!p,i!=null?fc(a,!!p,i,!1):u!=null&&fc(a,!!p,u,!0);return;case"textarea":wt("invalid",a),E=x=p=null;for(N in u)if(u.hasOwnProperty(N)&&(I=u[N],I!=null))switch(N){case"value":p=I;break;case"defaultValue":x=I;break;case"children":E=I;break;case"dangerouslySetInnerHTML":if(I!=null)throw Error(r(91));break;default:nn(a,i,N,I,u,null)}JS(a,p,x,E);return;case"option":for($ in u)if(u.hasOwnProperty($)&&(p=u[$],p!=null))switch($){case"selected":a.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:nn(a,i,$,p,u,null)}return;case"dialog":wt("beforetoggle",a),wt("toggle",a),wt("cancel",a),wt("close",a);break;case"iframe":case"object":wt("load",a);break;case"video":case"audio":for(p=0;p<Rd.length;p++)wt(Rd[p],a);break;case"image":wt("error",a),wt("load",a);break;case"details":wt("toggle",a);break;case"embed":case"source":case"link":wt("error",a),wt("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ae in u)if(u.hasOwnProperty(ae)&&(p=u[ae],p!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:nn(a,i,ae,p,u,null)}return;default:if(ly(i)){for(he in u)u.hasOwnProperty(he)&&(p=u[he],p!==void 0&&Kv(a,i,he,p,u,void 0));return}}for(I in u)u.hasOwnProperty(I)&&(p=u[I],p!=null&&nn(a,i,I,p,u,null))}function uM(a,i,u,p){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var x=null,E=null,N=null,I=null,$=null,ae=null,he=null;for(fe in u){var pe=u[fe];if(u.hasOwnProperty(fe)&&pe!=null)switch(fe){case"checked":break;case"value":break;case"defaultValue":$=pe;default:p.hasOwnProperty(fe)||nn(a,i,fe,null,p,pe)}}for(var oe in p){var fe=p[oe];if(pe=u[oe],p.hasOwnProperty(oe)&&(fe!=null||pe!=null))switch(oe){case"type":E=fe;break;case"name":x=fe;break;case"checked":ae=fe;break;case"defaultChecked":he=fe;break;case"value":N=fe;break;case"defaultValue":I=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(r(137,i));break;default:fe!==pe&&nn(a,i,oe,fe,p,pe)}}oy(a,N,I,$,ae,he,E,x);return;case"select":fe=N=I=oe=null;for(E in u)if($=u[E],u.hasOwnProperty(E)&&$!=null)switch(E){case"value":break;case"multiple":fe=$;default:p.hasOwnProperty(E)||nn(a,i,E,null,p,$)}for(x in p)if(E=p[x],$=u[x],p.hasOwnProperty(x)&&(E!=null||$!=null))switch(x){case"value":oe=E;break;case"defaultValue":I=E;break;case"multiple":N=E;default:E!==$&&nn(a,i,x,E,p,$)}i=I,u=N,p=fe,oe!=null?fc(a,!!u,oe,!1):!!p!=!!u&&(i!=null?fc(a,!!u,i,!0):fc(a,!!u,u?[]:"",!1));return;case"textarea":fe=oe=null;for(I in u)if(x=u[I],u.hasOwnProperty(I)&&x!=null&&!p.hasOwnProperty(I))switch(I){case"value":break;case"children":break;default:nn(a,i,I,null,p,x)}for(N in p)if(x=p[N],E=u[N],p.hasOwnProperty(N)&&(x!=null||E!=null))switch(N){case"value":oe=x;break;case"defaultValue":fe=x;break;case"children":break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(r(91));break;default:x!==E&&nn(a,i,N,x,p,E)}XS(a,oe,fe);return;case"option":for(var Ge in u)if(oe=u[Ge],u.hasOwnProperty(Ge)&&oe!=null&&!p.hasOwnProperty(Ge))switch(Ge){case"selected":a.selected=!1;break;default:nn(a,i,Ge,null,p,oe)}for($ in p)if(oe=p[$],fe=u[$],p.hasOwnProperty($)&&oe!==fe&&(oe!=null||fe!=null))switch($){case"selected":a.selected=oe&&typeof oe!="function"&&typeof oe!="symbol";break;default:nn(a,i,$,oe,p,fe)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var nt in u)oe=u[nt],u.hasOwnProperty(nt)&&oe!=null&&!p.hasOwnProperty(nt)&&nn(a,i,nt,null,p,oe);for(ae in p)if(oe=p[ae],fe=u[ae],p.hasOwnProperty(ae)&&oe!==fe&&(oe!=null||fe!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(r(137,i));break;default:nn(a,i,ae,oe,p,fe)}return;default:if(ly(i)){for(var rn in u)oe=u[rn],u.hasOwnProperty(rn)&&oe!==void 0&&!p.hasOwnProperty(rn)&&Kv(a,i,rn,void 0,p,oe);for(he in p)oe=p[he],fe=u[he],!p.hasOwnProperty(he)||oe===fe||oe===void 0&&fe===void 0||Kv(a,i,he,oe,p,fe);return}}for(var ee in u)oe=u[ee],u.hasOwnProperty(ee)&&oe!=null&&!p.hasOwnProperty(ee)&&nn(a,i,ee,null,p,oe);for(pe in p)oe=p[pe],fe=u[pe],!p.hasOwnProperty(pe)||oe===fe||oe==null&&fe==null||nn(a,i,pe,oe,p,fe)}function nw(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function dM(){if(typeof performance.getEntriesByType=="function"){for(var a=0,i=0,u=performance.getEntriesByType("resource"),p=0;p<u.length;p++){var x=u[p],E=x.transferSize,N=x.initiatorType,I=x.duration;if(E&&I&&nw(N)){for(N=0,I=x.responseEnd,p+=1;p<u.length;p++){var $=u[p],ae=$.startTime;if(ae>I)break;var he=$.transferSize,pe=$.initiatorType;he&&nw(pe)&&($=$.responseEnd,N+=he*($<I?1:(I-ae)/($-ae)))}if(--p,i+=8*(E+N)/(x.duration/1e3),a++,10<a)break}}if(0<a)return i/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var Yv=null,Wv=null;function rm(a){return a.nodeType===9?a:a.ownerDocument}function rw(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function aw(a,i){if(a===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&i==="foreignObject"?0:a}function Qv(a,i){return a==="textarea"||a==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var Xv=null;function fM(){var a=window.event;return a&&a.type==="popstate"?a===Xv?!1:(Xv=a,!0):(Xv=null,!1)}var sw=typeof setTimeout=="function"?setTimeout:void 0,hM=typeof clearTimeout=="function"?clearTimeout:void 0,ow=typeof Promise=="function"?Promise:void 0,mM=typeof queueMicrotask=="function"?queueMicrotask:typeof ow<"u"?function(a){return ow.resolve(null).then(a).catch(pM)}:sw;function pM(a){setTimeout(function(){throw a})}function bi(a){return a==="head"}function iw(a,i){var u=i,p=0;do{var x=u.nextSibling;if(a.removeChild(u),x&&x.nodeType===8)if(u=x.data,u==="/$"||u==="/&"){if(p===0){a.removeChild(x),Bc(i);return}p--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")p++;else if(u==="html")Td(a.ownerDocument.documentElement);else if(u==="head"){u=a.ownerDocument.head,Td(u);for(var E=u.firstChild;E;){var N=E.nextSibling,I=E.nodeName;E[Kt]||I==="SCRIPT"||I==="STYLE"||I==="LINK"&&E.rel.toLowerCase()==="stylesheet"||u.removeChild(E),E=N}}else u==="body"&&Td(a.ownerDocument.body);u=x}while(u);Bc(i)}function lw(a,i){var u=a;a=0;do{var p=u.nextSibling;if(u.nodeType===1?i?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(i?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),p&&p.nodeType===8)if(u=p.data,u==="/$"){if(a===0)break;a--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||a++;u=p}while(u)}function Jv(a){var i=a.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var u=i;switch(i=i.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Jv(u),Yt(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}a.removeChild(u)}}function gM(a,i,u,p){for(;a.nodeType===1;){var x=u;if(a.nodeName.toLowerCase()!==i.toLowerCase()){if(!p&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(p){if(!a[Kt])switch(i){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(E=a.getAttribute("rel"),E==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(E!==x.rel||a.getAttribute("href")!==(x.href==null||x.href===""?null:x.href)||a.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin)||a.getAttribute("title")!==(x.title==null?null:x.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(E=a.getAttribute("src"),(E!==(x.src==null?null:x.src)||a.getAttribute("type")!==(x.type==null?null:x.type)||a.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin))&&E&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(i==="input"&&a.type==="hidden"){var E=x.name==null?null:""+x.name;if(x.type==="hidden"&&a.getAttribute("name")===E)return a}else return a;if(a=Ya(a.nextSibling),a===null)break}return null}function yM(a,i,u){if(i==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!u||(a=Ya(a.nextSibling),a===null))return null;return a}function cw(a,i){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!i||(a=Ya(a.nextSibling),a===null))return null;return a}function ex(a){return a.data==="$?"||a.data==="$~"}function tx(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function vM(a,i){var u=a.ownerDocument;if(a.data==="$~")a._reactRetry=i;else if(a.data!=="$?"||u.readyState!=="loading")i();else{var p=function(){i(),u.removeEventListener("DOMContentLoaded",p)};u.addEventListener("DOMContentLoaded",p),a._reactRetry=p}}function Ya(a){for(;a!=null;a=a.nextSibling){var i=a.nodeType;if(i===1||i===3)break;if(i===8){if(i=a.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return a}var nx=null;function uw(a){a=a.nextSibling;for(var i=0;a;){if(a.nodeType===8){var u=a.data;if(u==="/$"||u==="/&"){if(i===0)return Ya(a.nextSibling);i--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||i++}a=a.nextSibling}return null}function dw(a){a=a.previousSibling;for(var i=0;a;){if(a.nodeType===8){var u=a.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(i===0)return a;i--}else u!=="/$"&&u!=="/&"||i++}a=a.previousSibling}return null}function fw(a,i,u){switch(i=rm(u),a){case"html":if(a=i.documentElement,!a)throw Error(r(452));return a;case"head":if(a=i.head,!a)throw Error(r(453));return a;case"body":if(a=i.body,!a)throw Error(r(454));return a;default:throw Error(r(451))}}function Td(a){for(var i=a.attributes;i.length;)a.removeAttributeNode(i[0]);Yt(a)}var Wa=new Map,hw=new Set;function am(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var Co=z.d;z.d={f:xM,r:bM,D:SM,C:CM,L:EM,m:wM,X:jM,S:RM,M:TM};function xM(){var a=Co.f(),i=Yh();return a||i}function bM(a){var i=Fa(a);i!==null&&i.tag===5&&i.type==="form"?A2(i):Co.r(a)}var zc=typeof document>"u"?null:document;function mw(a,i,u){var p=zc;if(p&&typeof i=="string"&&i){var x=Ha(i);x='link[rel="'+a+'"][href="'+x+'"]',typeof u=="string"&&(x+='[crossorigin="'+u+'"]'),hw.has(x)||(hw.add(x),a={rel:a,crossOrigin:u,href:i},p.querySelector(x)===null&&(i=p.createElement("link"),wr(i,"link",a),Nn(i),p.head.appendChild(i)))}}function SM(a){Co.D(a),mw("dns-prefetch",a,null)}function CM(a,i){Co.C(a,i),mw("preconnect",a,i)}function EM(a,i,u){Co.L(a,i,u);var p=zc;if(p&&a&&i){var x='link[rel="preload"][as="'+Ha(i)+'"]';i==="image"&&u&&u.imageSrcSet?(x+='[imagesrcset="'+Ha(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(x+='[imagesizes="'+Ha(u.imageSizes)+'"]')):x+='[href="'+Ha(a)+'"]';var E=x;switch(i){case"style":E=Hc(a);break;case"script":E=$c(a)}Wa.has(E)||(a=y({rel:"preload",href:i==="image"&&u&&u.imageSrcSet?void 0:a,as:i},u),Wa.set(E,a),p.querySelector(x)!==null||i==="style"&&p.querySelector(_d(E))||i==="script"&&p.querySelector(Nd(E))||(i=p.createElement("link"),wr(i,"link",a),Nn(i),p.head.appendChild(i)))}}function wM(a,i){Co.m(a,i);var u=zc;if(u&&a){var p=i&&typeof i.as=="string"?i.as:"script",x='link[rel="modulepreload"][as="'+Ha(p)+'"][href="'+Ha(a)+'"]',E=x;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":E=$c(a)}if(!Wa.has(E)&&(a=y({rel:"modulepreload",href:a},i),Wa.set(E,a),u.querySelector(x)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Nd(E)))return}p=u.createElement("link"),wr(p,"link",a),Nn(p),u.head.appendChild(p)}}}function RM(a,i,u){Co.S(a,i,u);var p=zc;if(p&&a){var x=br(p).hoistableStyles,E=Hc(a);i=i||"default";var N=x.get(E);if(!N){var I={loading:0,preload:null};if(N=p.querySelector(_d(E)))I.loading=5;else{a=y({rel:"stylesheet",href:a,"data-precedence":i},u),(u=Wa.get(E))&&rx(a,u);var $=N=p.createElement("link");Nn($),wr($,"link",a),$._p=new Promise(function(ae,he){$.onload=ae,$.onerror=he}),$.addEventListener("load",function(){I.loading|=1}),$.addEventListener("error",function(){I.loading|=2}),I.loading|=4,sm(N,i,p)}N={type:"stylesheet",instance:N,count:1,state:I},x.set(E,N)}}}function jM(a,i){Co.X(a,i);var u=zc;if(u&&a){var p=br(u).hoistableScripts,x=$c(a),E=p.get(x);E||(E=u.querySelector(Nd(x)),E||(a=y({src:a,async:!0},i),(i=Wa.get(x))&&ax(a,i),E=u.createElement("script"),Nn(E),wr(E,"link",a),u.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},p.set(x,E))}}function TM(a,i){Co.M(a,i);var u=zc;if(u&&a){var p=br(u).hoistableScripts,x=$c(a),E=p.get(x);E||(E=u.querySelector(Nd(x)),E||(a=y({src:a,async:!0,type:"module"},i),(i=Wa.get(x))&&ax(a,i),E=u.createElement("script"),Nn(E),wr(E,"link",a),u.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},p.set(x,E))}}function pw(a,i,u,p){var x=(x=ve.current)?am(x):null;if(!x)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(i=Hc(u.href),u=br(x).hoistableStyles,p=u.get(i),p||(p={type:"style",instance:null,count:0,state:null},u.set(i,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){a=Hc(u.href);var E=br(x).hoistableStyles,N=E.get(a);if(N||(x=x.ownerDocument||x,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},E.set(a,N),(E=x.querySelector(_d(a)))&&!E._p&&(N.instance=E,N.state.loading=5),Wa.has(a)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Wa.set(a,u),E||_M(x,a,u,N.state))),i&&p===null)throw Error(r(528,""));return N}if(i&&p!==null)throw Error(r(529,""));return null;case"script":return i=u.async,u=u.src,typeof u=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=$c(u),u=br(x).hoistableScripts,p=u.get(i),p||(p={type:"script",instance:null,count:0,state:null},u.set(i,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function Hc(a){return'href="'+Ha(a)+'"'}function _d(a){return'link[rel="stylesheet"]['+a+"]"}function gw(a){return y({},a,{"data-precedence":a.precedence,precedence:null})}function _M(a,i,u,p){a.querySelector('link[rel="preload"][as="style"]['+i+"]")?p.loading=1:(i=a.createElement("link"),p.preload=i,i.addEventListener("load",function(){return p.loading|=1}),i.addEventListener("error",function(){return p.loading|=2}),wr(i,"link",u),Nn(i),a.head.appendChild(i))}function $c(a){return'[src="'+Ha(a)+'"]'}function Nd(a){return"script[async]"+a}function yw(a,i,u){if(i.count++,i.instance===null)switch(i.type){case"style":var p=a.querySelector('style[data-href~="'+Ha(u.href)+'"]');if(p)return i.instance=p,Nn(p),p;var x=y({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return p=(a.ownerDocument||a).createElement("style"),Nn(p),wr(p,"style",x),sm(p,u.precedence,a),i.instance=p;case"stylesheet":x=Hc(u.href);var E=a.querySelector(_d(x));if(E)return i.state.loading|=4,i.instance=E,Nn(E),E;p=gw(u),(x=Wa.get(x))&&rx(p,x),E=(a.ownerDocument||a).createElement("link"),Nn(E);var N=E;return N._p=new Promise(function(I,$){N.onload=I,N.onerror=$}),wr(E,"link",p),i.state.loading|=4,sm(E,u.precedence,a),i.instance=E;case"script":return E=$c(u.src),(x=a.querySelector(Nd(E)))?(i.instance=x,Nn(x),x):(p=u,(x=Wa.get(E))&&(p=y({},u),ax(p,x)),a=a.ownerDocument||a,x=a.createElement("script"),Nn(x),wr(x,"link",p),a.head.appendChild(x),i.instance=x);case"void":return null;default:throw Error(r(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(p=i.instance,i.state.loading|=4,sm(p,u.precedence,a));return i.instance}function sm(a,i,u){for(var p=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),x=p.length?p[p.length-1]:null,E=x,N=0;N<p.length;N++){var I=p[N];if(I.dataset.precedence===i)E=I;else if(E!==x)break}E?E.parentNode.insertBefore(a,E.nextSibling):(i=u.nodeType===9?u.head:u,i.insertBefore(a,i.firstChild))}function rx(a,i){a.crossOrigin==null&&(a.crossOrigin=i.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=i.referrerPolicy),a.title==null&&(a.title=i.title)}function ax(a,i){a.crossOrigin==null&&(a.crossOrigin=i.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=i.referrerPolicy),a.integrity==null&&(a.integrity=i.integrity)}var om=null;function vw(a,i,u){if(om===null){var p=new Map,x=om=new Map;x.set(u,p)}else x=om,p=x.get(u),p||(p=new Map,x.set(u,p));if(p.has(a))return p;for(p.set(a,null),u=u.getElementsByTagName(a),x=0;x<u.length;x++){var E=u[x];if(!(E[Kt]||E[He]||a==="link"&&E.getAttribute("rel")==="stylesheet")&&E.namespaceURI!=="http://www.w3.org/2000/svg"){var N=E.getAttribute(i)||"";N=a+N;var I=p.get(N);I?I.push(E):p.set(N,[E])}}return p}function xw(a,i,u){a=a.ownerDocument||a,a.head.insertBefore(u,i==="title"?a.querySelector("head > title"):null)}function NM(a,i,u){if(u===1||i.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return a=i.disabled,typeof i.precedence=="string"&&a==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function bw(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function AM(a,i,u,p){if(u.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var x=Hc(p.href),E=i.querySelector(_d(x));if(E){i=E._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(a.count++,a=im.bind(a),i.then(a,a)),u.state.loading|=4,u.instance=E,Nn(E);return}E=i.ownerDocument||i,p=gw(p),(x=Wa.get(x))&&rx(p,x),E=E.createElement("link"),Nn(E);var N=E;N._p=new Promise(function(I,$){N.onload=I,N.onerror=$}),wr(E,"link",p),u.instance=E}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(u,i),(i=u.state.preload)&&(u.state.loading&3)===0&&(a.count++,u=im.bind(a),i.addEventListener("load",u),i.addEventListener("error",u))}}var sx=0;function DM(a,i){return a.stylesheets&&a.count===0&&cm(a,a.stylesheets),0<a.count||0<a.imgCount?function(u){var p=setTimeout(function(){if(a.stylesheets&&cm(a,a.stylesheets),a.unsuspend){var E=a.unsuspend;a.unsuspend=null,E()}},6e4+i);0<a.imgBytes&&sx===0&&(sx=62500*dM());var x=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&cm(a,a.stylesheets),a.unsuspend)){var E=a.unsuspend;a.unsuspend=null,E()}},(a.imgBytes>sx?50:800)+i);return a.unsuspend=u,function(){a.unsuspend=null,clearTimeout(p),clearTimeout(x)}}:null}function im(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)cm(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var lm=null;function cm(a,i){a.stylesheets=null,a.unsuspend!==null&&(a.count++,lm=new Map,i.forEach(OM,a),lm=null,im.call(a))}function OM(a,i){if(!(i.state.loading&4)){var u=lm.get(a);if(u)var p=u.get(null);else{u=new Map,lm.set(a,u);for(var x=a.querySelectorAll("link[data-precedence],style[data-precedence]"),E=0;E<x.length;E++){var N=x[E];(N.nodeName==="LINK"||N.getAttribute("media")!=="not all")&&(u.set(N.dataset.precedence,N),p=N)}p&&u.set(null,p)}x=i.instance,N=x.getAttribute("data-precedence"),E=u.get(N)||p,E===p&&u.set(null,x),u.set(N,x),this.count++,p=im.bind(this),x.addEventListener("load",p),x.addEventListener("error",p),E?E.parentNode.insertBefore(x,E.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(x,a.firstChild)),i.state.loading|=4}}var Ad={$$typeof:_,Provider:null,Consumer:null,_currentValue:B,_currentValue2:B,_threadCount:0};function MM(a,i,u,p,x,E,N,I,$){this.tag=1,this.containerInfo=a,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ar(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ar(0),this.hiddenUpdates=Ar(null),this.identifierPrefix=p,this.onUncaughtError=x,this.onCaughtError=E,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=$,this.incompleteTransitions=new Map}function Sw(a,i,u,p,x,E,N,I,$,ae,he,pe){return a=new MM(a,i,u,N,$,ae,he,pe,I),i=1,E===!0&&(i|=24),E=ba(3,null,null,i),a.current=E,E.stateNode=a,i=Uy(),i.refCount++,a.pooledCache=i,i.refCount++,E.memoizedState={element:p,isDehydrated:u,cache:i},Hy(E),a}function Cw(a){return a?(a=bc,a):bc}function Ew(a,i,u,p,x,E){x=Cw(x),p.context===null?p.context=x:p.pendingContext=x,p=ci(i),p.payload={element:u},E=E===void 0?null:E,E!==null&&(p.callback=E),u=ui(a,p,i),u!==null&&(ia(u,a,i),ld(u,a,i))}function ww(a,i){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var u=a.retryLane;a.retryLane=u!==0&&u<i?u:i}}function ox(a,i){ww(a,i),(a=a.alternate)&&ww(a,i)}function Rw(a){if(a.tag===13||a.tag===31){var i=ml(a,67108864);i!==null&&ia(i,a,67108864),ox(a,67108864)}}function jw(a){if(a.tag===13||a.tag===31){var i=Ra();i=Re(i);var u=ml(a,i);u!==null&&ia(u,a,i),ox(a,i)}}var um=!0;function IM(a,i,u,p){var x=k.T;k.T=null;var E=z.p;try{z.p=2,ix(a,i,u,p)}finally{z.p=E,k.T=x}}function kM(a,i,u,p){var x=k.T;k.T=null;var E=z.p;try{z.p=8,ix(a,i,u,p)}finally{z.p=E,k.T=x}}function ix(a,i,u,p){if(um){var x=lx(p);if(x===null)Zv(a,i,p,dm,u),_w(a,p);else if(PM(x,a,i,u,p))p.stopPropagation();else if(_w(a,p),i&4&&-1<LM.indexOf(a)){for(;x!==null;){var E=Fa(x);if(E!==null)switch(E.tag){case 3:if(E=E.stateNode,E.current.memoizedState.isDehydrated){var N=pn(E.pendingLanes);if(N!==0){var I=E;for(I.pendingLanes|=2,I.entangledLanes|=2;N;){var $=1<<31-_n(N);I.entanglements[1]|=$,N&=~$}ks(E),(Bt&6)===0&&(Zh=be()+500,wd(0))}}break;case 31:case 13:I=ml(E,2),I!==null&&ia(I,E,2),Yh(),ox(E,2)}if(E=lx(p),E===null&&Zv(a,i,p,dm,u),E===x)break;x=E}x!==null&&p.stopPropagation()}else Zv(a,i,p,null,u)}}function lx(a){return a=uy(a),cx(a)}var dm=null;function cx(a){if(dm=null,a=Jr(a),a!==null){var i=l(a);if(i===null)a=null;else{var u=i.tag;if(u===13){if(a=c(i),a!==null)return a;a=null}else if(u===31){if(a=d(i),a!==null)return a;a=null}else if(u===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;a=null}else i!==a&&(a=null)}}return dm=a,null}function Tw(a){switch(a){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ee()){case We:return 2;case ot:return 8;case it:case xn:return 32;case Ua:return 268435456;default:return 32}default:return 32}}var ux=!1,Si=null,Ci=null,Ei=null,Dd=new Map,Od=new Map,wi=[],LM="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function _w(a,i){switch(a){case"focusin":case"focusout":Si=null;break;case"dragenter":case"dragleave":Ci=null;break;case"mouseover":case"mouseout":Ei=null;break;case"pointerover":case"pointerout":Dd.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Od.delete(i.pointerId)}}function Md(a,i,u,p,x,E){return a===null||a.nativeEvent!==E?(a={blockedOn:i,domEventName:u,eventSystemFlags:p,nativeEvent:E,targetContainers:[x]},i!==null&&(i=Fa(i),i!==null&&Rw(i)),a):(a.eventSystemFlags|=p,i=a.targetContainers,x!==null&&i.indexOf(x)===-1&&i.push(x),a)}function PM(a,i,u,p,x){switch(i){case"focusin":return Si=Md(Si,a,i,u,p,x),!0;case"dragenter":return Ci=Md(Ci,a,i,u,p,x),!0;case"mouseover":return Ei=Md(Ei,a,i,u,p,x),!0;case"pointerover":var E=x.pointerId;return Dd.set(E,Md(Dd.get(E)||null,a,i,u,p,x)),!0;case"gotpointercapture":return E=x.pointerId,Od.set(E,Md(Od.get(E)||null,a,i,u,p,x)),!0}return!1}function Nw(a){var i=Jr(a.target);if(i!==null){var u=l(i);if(u!==null){if(i=u.tag,i===13){if(i=c(u),i!==null){a.blockedOn=i,Ie(a.priority,function(){jw(u)});return}}else if(i===31){if(i=d(u),i!==null){a.blockedOn=i,Ie(a.priority,function(){jw(u)});return}}else if(i===3&&u.stateNode.current.memoizedState.isDehydrated){a.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}a.blockedOn=null}function fm(a){if(a.blockedOn!==null)return!1;for(var i=a.targetContainers;0<i.length;){var u=lx(a.nativeEvent);if(u===null){u=a.nativeEvent;var p=new u.constructor(u.type,u);cy=p,u.target.dispatchEvent(p),cy=null}else return i=Fa(u),i!==null&&Rw(i),a.blockedOn=u,!1;i.shift()}return!0}function Aw(a,i,u){fm(a)&&u.delete(i)}function UM(){ux=!1,Si!==null&&fm(Si)&&(Si=null),Ci!==null&&fm(Ci)&&(Ci=null),Ei!==null&&fm(Ei)&&(Ei=null),Dd.forEach(Aw),Od.forEach(Aw)}function hm(a,i){a.blockedOn===i&&(a.blockedOn=null,ux||(ux=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,UM)))}var mm=null;function Dw(a){mm!==a&&(mm=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){mm===a&&(mm=null);for(var i=0;i<a.length;i+=3){var u=a[i],p=a[i+1],x=a[i+2];if(typeof p!="function"){if(cx(p||u)===null)continue;break}var E=Fa(u);E!==null&&(a.splice(i,3),i-=3,lv(E,{pending:!0,data:x,method:u.method,action:p},p,x))}}))}function Bc(a){function i($){return hm($,a)}Si!==null&&hm(Si,a),Ci!==null&&hm(Ci,a),Ei!==null&&hm(Ei,a),Dd.forEach(i),Od.forEach(i);for(var u=0;u<wi.length;u++){var p=wi[u];p.blockedOn===a&&(p.blockedOn=null)}for(;0<wi.length&&(u=wi[0],u.blockedOn===null);)Nw(u),u.blockedOn===null&&wi.shift();if(u=(a.ownerDocument||a).$$reactFormReplay,u!=null)for(p=0;p<u.length;p+=3){var x=u[p],E=u[p+1],N=x[qe]||null;if(typeof E=="function")N||Dw(u);else if(N){var I=null;if(E&&E.hasAttribute("formAction")){if(x=E,N=E[qe]||null)I=N.formAction;else if(cx(x)!==null)continue}else I=N.action;typeof I=="function"?u[p+1]=I:(u.splice(p,3),p-=3),Dw(u)}}}function Ow(){function a(E){E.canIntercept&&E.info==="react-transition"&&E.intercept({handler:function(){return new Promise(function(N){return x=N})},focusReset:"manual",scroll:"manual"})}function i(){x!==null&&(x(),x=null),p||setTimeout(u,20)}function u(){if(!p&&!navigation.transition){var E=navigation.currentEntry;E&&E.url!=null&&navigation.navigate(E.url,{state:E.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var p=!1,x=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(u,100),function(){p=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),x!==null&&(x(),x=null)}}}function dx(a){this._internalRoot=a}pm.prototype.render=dx.prototype.render=function(a){var i=this._internalRoot;if(i===null)throw Error(r(409));var u=i.current,p=Ra();Ew(u,p,a,i,null,null)},pm.prototype.unmount=dx.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var i=a.containerInfo;Ew(a.current,2,null,a,null,null),Yh(),i[Ze]=null}};function pm(a){this._internalRoot=a}pm.prototype.unstable_scheduleHydration=function(a){if(a){var i=Le();a={blockedOn:null,target:a,priority:i};for(var u=0;u<wi.length&&i!==0&&i<wi[u].priority;u++);wi.splice(u,0,a),u===0&&Nw(a)}};var Mw=t.version;if(Mw!=="19.2.0")throw Error(r(527,Mw,"19.2.0"));z.findDOMNode=function(a){var i=a._reactInternals;if(i===void 0)throw typeof a.render=="function"?Error(r(188)):(a=Object.keys(a).join(","),Error(r(268,a)));return a=h(i),a=a!==null?g(a):null,a=a===null?null:a.stateNode,a};var FM={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var gm=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!gm.isDisabled&&gm.supportsFiber)try{Fn=gm.inject(FM),Tn=gm}catch{}}return kd.createRoot=function(a,i){if(!o(a))throw Error(r(299));var u=!1,p="",x=V2,E=z2,N=H2;return i!=null&&(i.unstable_strictMode===!0&&(u=!0),i.identifierPrefix!==void 0&&(p=i.identifierPrefix),i.onUncaughtError!==void 0&&(x=i.onUncaughtError),i.onCaughtError!==void 0&&(E=i.onCaughtError),i.onRecoverableError!==void 0&&(N=i.onRecoverableError)),i=Sw(a,1,!1,null,null,u,p,null,x,E,N,Ow),a[Ze]=i.current,qv(a),new dx(i)},kd.hydrateRoot=function(a,i,u){if(!o(a))throw Error(r(299));var p=!1,x="",E=V2,N=z2,I=H2,$=null;return u!=null&&(u.unstable_strictMode===!0&&(p=!0),u.identifierPrefix!==void 0&&(x=u.identifierPrefix),u.onUncaughtError!==void 0&&(E=u.onUncaughtError),u.onCaughtError!==void 0&&(N=u.onCaughtError),u.onRecoverableError!==void 0&&(I=u.onRecoverableError),u.formState!==void 0&&($=u.formState)),i=Sw(a,1,!0,i,u??null,p,x,$,E,N,I,Ow),i.context=Cw(null),u=i.current,p=Ra(),p=Re(p),x=ci(p),x.callback=null,ui(u,x,p),u=p,i.current.lanes=u,Xr(i,u),ks(i),a[Ze]=i.current,qv(a),new pm(i)},kd.version="19.2.0",kd}var $w;function QM(){if($w)return mx.exports;$w=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),mx.exports=WM(),mx.exports}var XM=QM();/**
50
+ * react-router v7.9.5
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */var KT=e=>{throw TypeError(e)},JM=(e,t,n)=>t.has(e)||KT("Cannot "+n),vx=(e,t,n)=>(JM(e,t,"read from private field"),n?n.call(e):t.get(e)),e9=(e,t,n)=>t.has(e)?KT("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Bw="popstate";function t9(e={}){function t(r,o){let{pathname:l,search:c,hash:d}=r.location;return lf("",{pathname:l,search:c,hash:d},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:Zs(o)}return r9(t,n,null,e)}function xt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function kn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function n9(){return Math.random().toString(36).substring(2,10)}function Gw(e,t){return{usr:e.state,key:e.key,idx:t}}function lf(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Qi(t):t,state:n,key:t&&t.key||r||n9()}}function Zs({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Qi(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function r9(e,t,n,r={}){let{window:o=document.defaultView,v5Compat:l=!1}=r,c=o.history,d="POP",f=null,h=g();h==null&&(h=0,c.replaceState({...c.state,idx:h},""));function g(){return(c.state||{idx:null}).idx}function y(){d="POP";let C=g(),R=C==null?null:C-h;h=C,f&&f({action:d,location:S.location,delta:R})}function v(C,R){d="PUSH";let j=lf(S.location,C,R);h=g()+1;let _=Gw(j,h),D=S.createHref(j);try{c.pushState(_,"",D)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;o.location.assign(D)}l&&f&&f({action:d,location:S.location,delta:1})}function b(C,R){d="REPLACE";let j=lf(S.location,C,R);h=g();let _=Gw(j,h),D=S.createHref(j);c.replaceState(_,"",D),l&&f&&f({action:d,location:S.location,delta:0})}function w(C){return YT(C)}let S={get action(){return d},get location(){return e(o,c)},listen(C){if(f)throw new Error("A history only accepts one active listener");return o.addEventListener(Bw,y),f=C,()=>{o.removeEventListener(Bw,y),f=null}},createHref(C){return t(o,C)},createURL:w,encodeLocation(C){let R=w(C);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:v,replace:b,go(C){return c.go(C)}};return S}function YT(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),xt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Zs(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Kd,qw=class{constructor(e){if(e9(this,Kd,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(vx(this,Kd).has(e))return vx(this,Kd).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){vx(this,Kd).set(e,t)}};Kd=new WeakMap;var a9=new Set(["lazy","caseSensitive","path","id","index","children"]);function s9(e){return a9.has(e)}var o9=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function i9(e){return o9.has(e)}function l9(e){return e.index===!0}function cf(e,t,n=[],r={},o=!1){return e.map((l,c)=>{let d=[...n,String(c)],f=typeof l.id=="string"?l.id:d.join("-");if(xt(l.index!==!0||!l.children,"Cannot specify children on an index route"),xt(o||!r[f],`Found a route id collision on id "${f}". Route id's must be globally unique within Data Router usages`),l9(l)){let h={...l,id:f};return r[f]=Zw(h,t(h)),h}else{let h={...l,id:f,children:void 0};return r[f]=Zw(h,t(h)),l.children&&(h.children=cf(l.children,t,d,r,o)),h}})}function Zw(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Di(e,t,n="/"){return Gm(e,t,n,!1)}function Gm(e,t,n,r){let o=typeof t=="string"?Qi(t):t,l=ts(o.pathname||"/",n);if(l==null)return null;let c=WT(e);u9(c);let d=null;for(let f=0;d==null&&f<c.length;++f){let h=S9(l);d=x9(c[f],h,r)}return d}function c9(e,t){let{route:n,pathname:r,params:o}=e;return{id:n.id,pathname:r,params:o,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function WT(e,t=[],n=[],r="",o=!1){let l=(c,d,f=o,h)=>{let g={relativePath:h===void 0?c.path||"":h,caseSensitive:c.caseSensitive===!0,childrenIndex:d,route:c};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(r)&&f)return;xt(g.relativePath.startsWith(r),`Absolute route path "${g.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(r.length)}let y=$s([r,g.relativePath]),v=n.concat(g);c.children&&c.children.length>0&&(xt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),WT(c.children,t,v,y,f)),!(c.path==null&&!c.index)&&t.push({path:y,score:y9(y,c.index),routesMeta:v})};return e.forEach((c,d)=>{var f;if(c.path===""||!((f=c.path)!=null&&f.includes("?")))l(c,d);else for(let h of QT(c.path))l(c,d,!0,h)}),t}function QT(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),l=n.replace(/\?$/,"");if(r.length===0)return o?[l,""]:[l];let c=QT(r.join("/")),d=[];return d.push(...c.map(f=>f===""?l:[l,f].join("/"))),o&&d.push(...c),d.map(f=>e.startsWith("/")&&f===""?"/":f)}function u9(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:v9(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var d9=/^:[\w-]+$/,f9=3,h9=2,m9=1,p9=10,g9=-2,Kw=e=>e==="*";function y9(e,t){let n=e.split("/"),r=n.length;return n.some(Kw)&&(r+=g9),t&&(r+=h9),n.filter(o=>!Kw(o)).reduce((o,l)=>o+(d9.test(l)?f9:l===""?m9:p9),r)}function v9(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function x9(e,t,n=!1){let{routesMeta:r}=e,o={},l="/",c=[];for(let d=0;d<r.length;++d){let f=r[d],h=d===r.length-1,g=l==="/"?t:t.slice(l.length)||"/",y=op({path:f.relativePath,caseSensitive:f.caseSensitive,end:h},g),v=f.route;if(!y&&h&&n&&!r[r.length-1].route.index&&(y=op({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},g)),!y)return null;Object.assign(o,y.params),c.push({params:o,pathname:$s([l,y.pathname]),pathnameBase:R9($s([l,y.pathnameBase])),route:v}),y.pathnameBase!=="/"&&(l=$s([l,y.pathnameBase]))}return c}function op(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=b9(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let l=o[0],c=l.replace(/(.)\/+$/,"$1"),d=o.slice(1);return{params:r.reduce((h,{paramName:g,isOptional:y},v)=>{if(g==="*"){let w=d[v]||"";c=l.slice(0,l.length-w.length).replace(/(.)\/+$/,"$1")}const b=d[v];return y&&!b?h[g]=void 0:h[g]=(b||"").replace(/%2F/g,"/"),h},{}),pathname:l,pathnameBase:c,pattern:e}}function b9(e,t=!1,n=!0){kn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,d,f)=>(r.push({paramName:d,isOptional:f!=null}),f?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function S9(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return kn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ts(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function C9({basename:e,pathname:t}){return t==="/"?e:$s([e,t])}function E9(e,t="/"){let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Qi(e):e;return{pathname:n?n.startsWith("/")?n:w9(n,t):t,search:j9(r),hash:T9(o)}}function w9(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function xx(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function XT(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Wp(e){let t=XT(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Qp(e,t,n,r=!1){let o;typeof e=="string"?o=Qi(e):(o={...e},xt(!o.pathname||!o.pathname.includes("?"),xx("?","pathname","search",o)),xt(!o.pathname||!o.pathname.includes("#"),xx("#","pathname","hash",o)),xt(!o.search||!o.search.includes("#"),xx("#","search","hash",o)));let l=e===""||o.pathname==="",c=l?"/":o.pathname,d;if(c==null)d=n;else{let y=t.length-1;if(!r&&c.startsWith("..")){let v=c.split("/");for(;v[0]==="..";)v.shift(),y-=1;o.pathname=v.join("/")}d=y>=0?t[y]:"/"}let f=E9(o,d),h=c&&c!=="/"&&c.endsWith("/"),g=(l||c===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(h||g)&&(f.pathname+="/"),f}var $s=e=>e.join("/").replace(/\/\/+/g,"/"),R9=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),j9=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,T9=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,ip=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function uf(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function A1(e){return e.filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Ii=Symbol("Uninstrumented");function _9(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(o=>o({id:t.id,index:t.index,path:t.path,instrument(l){let c=Object.keys(n);for(let d of c)l[d]&&n[d].push(l[d])}}));let r={};if(typeof t.lazy=="function"&&n.lazy.length>0){let o=iu(n.lazy,t.lazy,()=>{});o&&(r.lazy=o)}if(typeof t.lazy=="object"){let o=t.lazy;["middleware","loader","action"].forEach(l=>{let c=o[l],d=n[`lazy.${l}`];if(typeof c=="function"&&d.length>0){let f=iu(d,c,()=>{});f&&(r.lazy=Object.assign(r.lazy||{},{[l]:f}))}})}return["loader","action"].forEach(o=>{let l=t[o];if(typeof l=="function"&&n[o].length>0){let c=l[Ii]??l,d=iu(n[o],c,(...f)=>Yw(f[0]));d&&(d[Ii]=c,r[o]=d)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(o=>{let l=o[Ii]??o,c=iu(n.middleware,l,(...d)=>Yw(d[0]));return c?(c[Ii]=l,c):o})),r}function N9(e,t){let n={navigate:[],fetch:[]};if(t.forEach(r=>r({instrument(o){let l=Object.keys(o);for(let c of l)o[c]&&n[c].push(o[c])}})),n.navigate.length>0){let r=e.navigate[Ii]??e.navigate,o=iu(n.navigate,r,(...l)=>{let[c,d]=l;return{to:typeof c=="number"||typeof c=="string"?c:c?Zs(c):".",...Ww(e,d??{})}});o&&(o[Ii]=r,e.navigate=o)}if(n.fetch.length>0){let r=e.fetch[Ii]??e.fetch,o=iu(n.fetch,r,(...l)=>{let[c,,d,f]=l;return{href:d??".",fetcherKey:c,...Ww(e,f??{})}});o&&(o[Ii]=r,e.fetch=o)}return e}function iu(e,t,n){return e.length===0?null:async(...r)=>{let o=await JT(e,n(...r),()=>t(...r),e.length-1);if(o.type==="error")throw o.value;return o.value}}async function JT(e,t,n,r){let o=e[r],l;if(o){let c,d=async()=>(c?console.error("You cannot call instrumented handlers more than once"):c=JT(e,t,n,r-1),l=await c,xt(l,"Expected a result"),l.type==="error"&&l.value instanceof Error?{status:"error",error:l.value}:{status:"success",error:void 0});try{await o(d,t)}catch(f){console.error("An instrumentation function threw an error:",f)}c||await d(),await c}else try{l={type:"success",value:await n()}}catch(c){l={type:"error",value:c}}return l||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function Yw(e){let{request:t,context:n,params:r,unstable_pattern:o}=e;return{request:A9(t),params:{...r},unstable_pattern:o,context:D9(n)}}function Ww(e,t){return{currentUrl:Zs(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function A9(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function D9(e){if(M9(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var O9=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function M9(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===O9}var e_=["POST","PUT","PATCH","DELETE"],I9=new Set(e_),k9=["GET",...e_],L9=new Set(k9),P9=new Set([301,302,303,307,308]),U9=new Set([307,308]),bx={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},F9={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ld={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},V9=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,D1=e=>V9.test(e),z9=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),t_="remix-router-transitions",n_=Symbol("ResetLoaderData");function H9(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";xt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],o=e.mapRouteProperties||z9,l=o;if(e.unstable_instrumentations){let V=e.unstable_instrumentations;l=X=>({...o(X),..._9(V.map(se=>se.route).filter(Boolean),X)})}let c={},d=cf(e.routes,l,void 0,c),f,h=e.basename||"/";h.startsWith("/")||(h=`/${h}`);let g=e.dataStrategy||Z9,y={...e.future},v=null,b=new Set,w=null,S=null,C=null,R=e.hydrationData!=null,j=Di(d,e.history.location,h),_=!1,D=null,A;if(j==null&&!e.patchRoutesOnNavigation){let V=Qa(404,{pathname:e.history.location.pathname}),{matches:X,route:se}=ym(d);A=!0,j=X,D={[se.id]:V}}else if(j&&!e.hydrationData&&er(j,d,e.history.location.pathname).active&&(j=null),j)if(j.some(V=>V.route.lazy))A=!1;else if(!j.some(V=>O1(V.route)))A=!0;else{let V=e.hydrationData?e.hydrationData.loaderData:null,X=e.hydrationData?e.hydrationData.errors:null;if(X){let se=j.findIndex(ge=>X[ge.route.id]!==void 0);A=j.slice(0,se+1).every(ge=>!S0(ge.route,V,X))}else A=j.every(se=>!S0(se.route,V,X))}else{A=!1,j=[];let V=er(null,d,e.history.location.pathname);V.active&&V.matches&&(_=!0,j=V.matches)}let O,T={historyAction:e.history.action,location:e.history.location,matches:j,initialized:A,navigation:bx,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||D,fetchers:new Map,blockers:new Map},M="POP",F=!1,G,Y=!1,Z=new Map,J=null,H=!1,K=!1,k=new Set,z=new Map,B=0,ie=-1,xe=new Map,L=new Set,P=new Map,q=new Map,te=new Set,ue=new Map,ve,le=null;function Ae(){if(v=e.history.listen(({action:V,location:X,delta:se})=>{if(ve){ve(),ve=void 0;return}kn(ue.size===0||se!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ge=to({currentLocation:T.location,nextLocation:X,historyAction:V});if(ge&&se!=null){let Re=new Promise(ze=>{ve=ze});e.history.go(se*-1),ti(ge,{state:"blocked",location:X,proceed(){ti(ge,{state:"proceeding",proceed:void 0,reset:void 0,location:X}),Re.then(()=>e.history.go(se))},reset(){let ze=new Map(T.blockers);ze.set(ge,Ld),Be({blockers:ze})}});return}return Zt(V,X)}),n){lI(t,Z);let V=()=>cI(t,Z);t.addEventListener("pagehide",V),J=()=>t.removeEventListener("pagehide",V)}return T.initialized||Zt("POP",T.location,{initialHydration:!0}),O}function we(){v&&v(),J&&J(),b.clear(),G&&G.abort(),T.fetchers.forEach((V,X)=>bn(X)),T.blockers.forEach((V,X)=>Ns(X))}function Ne(V){return b.add(V),()=>b.delete(V)}function Be(V,X={}){V.matches&&(V.matches=V.matches.map(Re=>{let ze=c[Re.route.id],Le=Re.route;return Le.element!==ze.element||Le.errorElement!==ze.errorElement||Le.hydrateFallbackElement!==ze.hydrateFallbackElement?{...Re,route:ze}:Re})),T={...T,...V};let se=[],ge=[];T.fetchers.forEach((Re,ze)=>{Re.state==="idle"&&(te.has(ze)?se.push(ze):ge.push(ze))}),te.forEach(Re=>{!T.fetchers.has(Re)&&!z.has(Re)&&se.push(Re)}),[...b].forEach(Re=>Re(T,{deletedFetchers:se,viewTransitionOpts:X.viewTransitionOpts,flushSync:X.flushSync===!0})),se.forEach(Re=>bn(Re)),ge.forEach(Re=>T.fetchers.delete(Re))}function Qe(V,X,{flushSync:se}={}){var qe,Ze;let ge=T.actionData!=null&&T.navigation.formMethod!=null&&Vr(T.navigation.formMethod)&&T.navigation.state==="loading"&&((qe=V.state)==null?void 0:qe._isRedirect)!==!0,Re;X.actionData?Object.keys(X.actionData).length>0?Re=X.actionData:Re=null:ge?Re=T.actionData:Re=null;let ze=X.loaderData?oR(T.loaderData,X.loaderData,X.matches||[],X.errors):T.loaderData,Le=T.blockers;Le.size>0&&(Le=new Map(Le),Le.forEach((ut,en)=>Le.set(en,Ld)));let Ie=H?!1:xr(V,X.matches||T.matches),Pe=F===!0||T.navigation.formMethod!=null&&Vr(T.navigation.formMethod)&&((Ze=V.state)==null?void 0:Ze._isRedirect)!==!0;f&&(d=f,f=void 0),H||M==="POP"||(M==="PUSH"?e.history.push(V,V.state):M==="REPLACE"&&e.history.replace(V,V.state));let He;if(M==="POP"){let ut=Z.get(T.location.pathname);ut&&ut.has(V.pathname)?He={currentLocation:T.location,nextLocation:V}:Z.has(V.pathname)&&(He={currentLocation:V,nextLocation:T.location})}else if(Y){let ut=Z.get(T.location.pathname);ut?ut.add(V.pathname):(ut=new Set([V.pathname]),Z.set(T.location.pathname,ut)),He={currentLocation:T.location,nextLocation:V}}Be({...X,actionData:Re,loaderData:ze,historyAction:M,location:V,initialized:!0,navigation:bx,revalidation:"idle",restoreScrollPosition:Ie,preventScrollReset:Pe,blockers:Le},{viewTransitionOpts:He,flushSync:se===!0}),M="POP",F=!1,Y=!1,H=!1,K=!1,le==null||le.resolve(),le=null}async function qt(V,X){if(typeof V=="number"){e.history.go(V);return}let se=b0(T.location,T.matches,h,V,X==null?void 0:X.fromRouteId,X==null?void 0:X.relative),{path:ge,submission:Re,error:ze}=Qw(!1,se,X),Le=T.location,Ie=lf(T.location,ge,X&&X.state);Ie={...Ie,...e.history.encodeLocation(Ie)};let Pe=X&&X.replace!=null?X.replace:void 0,He="PUSH";Pe===!0?He="REPLACE":Pe===!1||Re!=null&&Vr(Re.formMethod)&&Re.formAction===T.location.pathname+T.location.search&&(He="REPLACE");let qe=X&&"preventScrollReset"in X?X.preventScrollReset===!0:void 0,Ze=(X&&X.flushSync)===!0,ut=to({currentLocation:Le,nextLocation:Ie,historyAction:He});if(ut){ti(ut,{state:"blocked",location:Ie,proceed(){ti(ut,{state:"proceeding",proceed:void 0,reset:void 0,location:Ie}),qt(V,X)},reset(){let en=new Map(T.blockers);en.set(ut,Ld),Be({blockers:en})}});return}await Zt(He,Ie,{submission:Re,pendingError:ze,preventScrollReset:qe,replace:X&&X.replace,enableViewTransition:X&&X.viewTransition,flushSync:Ze})}function Dt(){le||(le=uI()),We(),Be({revalidation:"loading"});let V=le.promise;return T.navigation.state==="submitting"?V:T.navigation.state==="idle"?(Zt(T.historyAction,T.location,{startUninterruptedRevalidation:!0}),V):(Zt(M||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:Y===!0}),V)}async function Zt(V,X,se){G&&G.abort(),G=null,M=V,H=(se&&se.startUninterruptedRevalidation)===!0,Gn(T.location,T.matches),F=(se&&se.preventScrollReset)===!0,Y=(se&&se.enableViewTransition)===!0;let ge=f||d,Re=se&&se.overrideNavigation,ze=se!=null&&se.initialHydration&&T.matches&&T.matches.length>0&&!_?T.matches:Di(ge,X,h),Le=(se&&se.flushSync)===!0;if(ze&&T.initialized&&!K&&tI(T.location,X)&&!(se&&se.submission&&Vr(se.submission.formMethod))){Qe(X,{matches:ze},{flushSync:Le});return}let Ie=er(ze,ge,X.pathname);if(Ie.active&&Ie.matches&&(ze=Ie.matches),!ze){let{error:hr,notFoundMatches:Kt,route:Yt}=As(X.pathname);Qe(X,{matches:Kt,loaderData:{},errors:{[Yt.id]:hr}},{flushSync:Le});return}G=new AbortController;let Pe=eu(e.history,X,G.signal,se&&se.submission),He=e.getContext?await e.getContext():new qw,qe;if(se&&se.pendingError)qe=[Oi(ze).route.id,{type:"error",error:se.pendingError}];else if(se&&se.submission&&Vr(se.submission.formMethod)){let hr=await jn(Pe,X,se.submission,ze,He,Ie.active,se&&se.initialHydration===!0,{replace:se.replace,flushSync:Le});if(hr.shortCircuited)return;if(hr.pendingActionResult){let[Kt,Yt]=hr.pendingActionResult;if(ja(Yt)&&uf(Yt.error)&&Yt.error.status===404){G=null,Qe(X,{matches:hr.matches,loaderData:{},errors:{[Kt]:Yt.error}});return}}ze=hr.matches||ze,qe=hr.pendingActionResult,Re=Sx(X,se.submission),Le=!1,Ie.active=!1,Pe=eu(e.history,Pe.url,Pe.signal)}let{shortCircuited:Ze,matches:ut,loaderData:en,errors:qn}=await Nr(Pe,X,ze,He,Ie.active,Re,se&&se.submission,se&&se.fetcherSubmission,se&&se.replace,se&&se.initialHydration===!0,Le,qe);Ze||(G=null,Qe(X,{matches:ut||ze,...iR(qe),loaderData:en,errors:qn}))}async function jn(V,X,se,ge,Re,ze,Le,Ie={}){We();let Pe=oI(X,se);if(Be({navigation:Pe},{flushSync:Ie.flushSync===!0}),ze){let Ze=await Vn(ge,X.pathname,V.signal);if(Ze.type==="aborted")return{shortCircuited:!0};if(Ze.type==="error"){if(Ze.partialMatches.length===0){let{matches:en,route:qn}=ym(d);return{matches:en,pendingActionResult:[qn.id,{type:"error",error:Ze.error}]}}let ut=Oi(Ze.partialMatches).route.id;return{matches:Ze.partialMatches,pendingActionResult:[ut,{type:"error",error:Ze.error}]}}else if(Ze.matches)ge=Ze.matches;else{let{notFoundMatches:ut,error:en,route:qn}=As(X.pathname);return{matches:ut,pendingActionResult:[qn.id,{type:"error",error:en}]}}}let He,qe=qm(ge,X);if(!qe.route.action&&!qe.route.lazy)He={type:"error",error:Qa(405,{method:V.method,pathname:X.pathname,routeId:qe.route.id})};else{let Ze=uu(l,c,V,ge,qe,Le?[]:r,Re),ut=await be(V,Ze,Re,null);if(He=ut[qe.route.id],!He){for(let en of ge)if(ut[en.route.id]){He=ut[en.route.id];break}}if(V.signal.aborted)return{shortCircuited:!0}}if(Ol(He)){let Ze;return Ie&&Ie.replace!=null?Ze=Ie.replace:Ze=rR(He.response.headers.get("Location"),new URL(V.url),h)===T.location.pathname+T.location.search,await _e(V,He,!0,{submission:se,replace:Ze}),{shortCircuited:!0}}if(ja(He)){let Ze=Oi(ge,qe.route.id);return(Ie&&Ie.replace)!==!0&&(M="PUSH"),{matches:ge,pendingActionResult:[Ze.route.id,He,qe.route.id]}}return{matches:ge,pendingActionResult:[qe.route.id,He]}}async function Nr(V,X,se,ge,Re,ze,Le,Ie,Pe,He,qe,Ze){let ut=ze||Sx(X,Le),en=Le||Ie||cR(ut),qn=!H&&!He;if(Re){if(qn){let tr=va(Ze);Be({navigation:ut,...tr!==void 0?{actionData:tr}:{}},{flushSync:qe})}let Ot=await Vn(se,X.pathname,V.signal);if(Ot.type==="aborted")return{shortCircuited:!0};if(Ot.type==="error"){if(Ot.partialMatches.length===0){let{matches:no,route:ro}=ym(d);return{matches:no,loaderData:{},errors:{[ro.id]:Ot.error}}}let tr=Oi(Ot.partialMatches).route.id;return{matches:Ot.partialMatches,loaderData:{},errors:{[tr]:Ot.error}}}else if(Ot.matches)se=Ot.matches;else{let{error:tr,notFoundMatches:no,route:ro}=As(X.pathname);return{matches:no,loaderData:{},errors:{[ro.id]:tr}}}}let hr=f||d,{dsMatches:Kt,revalidatingFetchers:Yt}=Xw(V,ge,l,c,e.history,T,se,en,X,He?[]:r,He===!0,K,k,te,P,L,hr,h,e.patchRoutesOnNavigation!=null,Ze);if(ie=++B,!e.dataStrategy&&!Kt.some(Ot=>Ot.shouldLoad)&&!Kt.some(Ot=>Ot.route.middleware&&Ot.route.middleware.length>0)&&Yt.length===0){let Ot=vr();return Qe(X,{matches:se,loaderData:{},errors:Ze&&ja(Ze[1])?{[Ze[0]]:Ze[1].error}:null,...iR(Ze),...Ot?{fetchers:new Map(T.fetchers)}:{}},{flushSync:qe}),{shortCircuited:!0}}if(qn){let Ot={};if(!Re){Ot.navigation=ut;let tr=va(Ze);tr!==void 0&&(Ot.actionData=tr)}Yt.length>0&&(Ot.fetchers=Ve(Yt)),Be(Ot,{flushSync:qe})}Yt.forEach(Ot=>{Fn(Ot.key),Ot.controller&&z.set(Ot.key,Ot.controller)});let Jr=()=>Yt.forEach(Ot=>Fn(Ot.key));G&&G.signal.addEventListener("abort",Jr);let{loaderResults:Fa,fetcherResults:ea}=await Ee(Kt,Yt,V,ge);if(V.signal.aborted)return{shortCircuited:!0};G&&G.signal.removeEventListener("abort",Jr),Yt.forEach(Ot=>z.delete(Ot.key));let br=vm(Fa);if(br)return await _e(V,br.result,!0,{replace:Pe}),{shortCircuited:!0};if(br=vm(ea),br)return L.add(br.key),await _e(V,br.result,!0,{replace:Pe}),{shortCircuited:!0};let{loaderData:Nn,errors:ni}=sR(T,se,Fa,Ze,Yt,ea);He&&T.errors&&(ni={...T.errors,...ni});let Ds=vr(),Va=_n(ie),ss=Ds||Va||Yt.length>0;return{matches:se,loaderData:Nn,errors:ni,...ss?{fetchers:new Map(T.fetchers)}:{}}}function va(V){if(V&&!ja(V[1]))return{[V[0]]:V[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function Ve(V){return V.forEach(X=>{let se=T.fetchers.get(X.key),ge=Pd(void 0,se?se.data:void 0);T.fetchers.set(X.key,ge)}),new Map(T.fetchers)}async function U(V,X,se,ge){Fn(V);let Re=(ge&&ge.flushSync)===!0,ze=f||d,Le=b0(T.location,T.matches,h,se,X,ge==null?void 0:ge.relative),Ie=Di(ze,Le,h),Pe=er(Ie,ze,Le);if(Pe.active&&Pe.matches&&(Ie=Pe.matches),!Ie){it(V,X,Qa(404,{pathname:Le}),{flushSync:Re});return}let{path:He,submission:qe,error:Ze}=Qw(!0,Le,ge);if(Ze){it(V,X,Ze,{flushSync:Re});return}let ut=e.getContext?await e.getContext():new qw,en=(ge&&ge.preventScrollReset)===!0;if(qe&&Vr(qe.formMethod)){await Q(V,X,He,Ie,ut,Pe.active,Re,en,qe);return}P.set(V,{routeId:X,path:He}),await de(V,X,He,Ie,ut,Pe.active,Re,en,qe)}async function Q(V,X,se,ge,Re,ze,Le,Ie,Pe){We(),P.delete(V);let He=T.fetchers.get(V);ot(V,iI(Pe,He),{flushSync:Le});let qe=new AbortController,Ze=eu(e.history,se,qe.signal,Pe);if(ze){let gn=await Vn(ge,new URL(Ze.url).pathname,Ze.signal,V);if(gn.type==="aborted")return;if(gn.type==="error"){it(V,X,gn.error,{flushSync:Le});return}else if(gn.matches)ge=gn.matches;else{it(V,X,Qa(404,{pathname:se}),{flushSync:Le});return}}let ut=qm(ge,se);if(!ut.route.action&&!ut.route.lazy){let gn=Qa(405,{method:Pe.formMethod,pathname:se,routeId:X});it(V,X,gn,{flushSync:Le});return}z.set(V,qe);let en=B,qn=uu(l,c,Ze,ge,ut,r,Re),Kt=(await be(Ze,qn,Re,V))[ut.route.id];if(Ze.signal.aborted){z.get(V)===qe&&z.delete(V);return}if(te.has(V)){if(Ol(Kt)||ja(Kt)){ot(V,To(void 0));return}}else{if(Ol(Kt))if(z.delete(V),ie>en){ot(V,To(void 0));return}else return L.add(V),ot(V,Pd(Pe)),_e(Ze,Kt,!1,{fetcherSubmission:Pe,preventScrollReset:Ie});if(ja(Kt)){it(V,X,Kt.error);return}}let Yt=T.navigation.location||T.location,Jr=eu(e.history,Yt,qe.signal),Fa=f||d,ea=T.navigation.state!=="idle"?Di(Fa,T.navigation.location,h):T.matches;xt(ea,"Didn't find any matches after fetcher action");let br=++B;xe.set(V,br);let Nn=Pd(Pe,Kt.data);T.fetchers.set(V,Nn);let{dsMatches:ni,revalidatingFetchers:Ds}=Xw(Jr,Re,l,c,e.history,T,ea,Pe,Yt,r,!1,K,k,te,P,L,Fa,h,e.patchRoutesOnNavigation!=null,[ut.route.id,Kt]);Ds.filter(gn=>gn.key!==V).forEach(gn=>{let ao=gn.key,za=T.fetchers.get(ao),ta=Pd(void 0,za?za.data:void 0);T.fetchers.set(ao,ta),Fn(ao),gn.controller&&z.set(ao,gn.controller)}),Be({fetchers:new Map(T.fetchers)});let Va=()=>Ds.forEach(gn=>Fn(gn.key));qe.signal.addEventListener("abort",Va);let{loaderResults:ss,fetcherResults:Ot}=await Ee(ni,Ds,Jr,Re);if(qe.signal.aborted)return;if(qe.signal.removeEventListener("abort",Va),xe.delete(V),z.delete(V),Ds.forEach(gn=>z.delete(gn.key)),T.fetchers.has(V)){let gn=To(Kt.data);T.fetchers.set(V,gn)}let tr=vm(ss);if(tr)return _e(Jr,tr.result,!1,{preventScrollReset:Ie});if(tr=vm(Ot),tr)return L.add(tr.key),_e(Jr,tr.result,!1,{preventScrollReset:Ie});let{loaderData:no,errors:ro}=sR(T,ea,ss,void 0,Ds,Ot);_n(br),T.navigation.state==="loading"&&br>ie?(xt(M,"Expected pending action"),G&&G.abort(),Qe(T.navigation.location,{matches:ea,loaderData:no,errors:ro,fetchers:new Map(T.fetchers)})):(Be({errors:ro,loaderData:oR(T.loaderData,no,ea,ro),fetchers:new Map(T.fetchers)}),K=!1)}async function de(V,X,se,ge,Re,ze,Le,Ie,Pe){let He=T.fetchers.get(V);ot(V,Pd(Pe,He?He.data:void 0),{flushSync:Le});let qe=new AbortController,Ze=eu(e.history,se,qe.signal);if(ze){let Yt=await Vn(ge,new URL(Ze.url).pathname,Ze.signal,V);if(Yt.type==="aborted")return;if(Yt.type==="error"){it(V,X,Yt.error,{flushSync:Le});return}else if(Yt.matches)ge=Yt.matches;else{it(V,X,Qa(404,{pathname:se}),{flushSync:Le});return}}let ut=qm(ge,se);z.set(V,qe);let en=B,qn=uu(l,c,Ze,ge,ut,r,Re),Kt=(await be(Ze,qn,Re,V))[ut.route.id];if(z.get(V)===qe&&z.delete(V),!Ze.signal.aborted){if(te.has(V)){ot(V,To(void 0));return}if(Ol(Kt))if(ie>en){ot(V,To(void 0));return}else{L.add(V),await _e(Ze,Kt,!1,{preventScrollReset:Ie});return}if(ja(Kt)){it(V,X,Kt.error);return}ot(V,To(Kt.data))}}async function _e(V,X,se,{submission:ge,fetcherSubmission:Re,preventScrollReset:ze,replace:Le}={}){X.response.headers.has("X-Remix-Revalidate")&&(K=!0);let Ie=X.response.headers.get("Location");xt(Ie,"Expected a Location header on the redirect Response"),Ie=rR(Ie,new URL(V.url),h);let Pe=lf(T.location,Ie,{_isRedirect:!0});if(n){let qn=!1;if(X.response.headers.has("X-Remix-Reload-Document"))qn=!0;else if(D1(Ie)){const hr=YT(Ie,!0);qn=hr.origin!==t.location.origin||ts(hr.pathname,h)==null}if(qn){Le?t.location.replace(Ie):t.location.assign(Ie);return}}G=null;let He=Le===!0||X.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:qe,formAction:Ze,formEncType:ut}=T.navigation;!ge&&!Re&&qe&&Ze&&ut&&(ge=cR(T.navigation));let en=ge||Re;if(U9.has(X.response.status)&&en&&Vr(en.formMethod))await Zt(He,Pe,{submission:{...en,formAction:Ie},preventScrollReset:ze||F,enableViewTransition:se?Y:void 0});else{let qn=Sx(Pe,ge);await Zt(He,Pe,{overrideNavigation:qn,fetcherSubmission:Re,preventScrollReset:ze||F,enableViewTransition:se?Y:void 0})}}async function be(V,X,se,ge){let Re,ze={};try{Re=await Y9(g,V,X,ge,se,!1)}catch(Le){return X.filter(Ie=>Ie.shouldLoad).forEach(Ie=>{ze[Ie.route.id]={type:"error",error:Le}}),ze}if(V.signal.aborted)return ze;for(let[Le,Ie]of Object.entries(Re))if(aI(Ie)){let Pe=Ie.result;ze[Le]={type:"redirect",response:J9(Pe,V,Le,X,h)}}else ze[Le]=await X9(Ie);return ze}async function Ee(V,X,se,ge){let Re=be(se,V,ge,null),ze=Promise.all(X.map(async Pe=>{if(Pe.matches&&Pe.match&&Pe.request&&Pe.controller){let qe=(await be(Pe.request,Pe.matches,ge,Pe.key))[Pe.match.route.id];return{[Pe.key]:qe}}else return Promise.resolve({[Pe.key]:{type:"error",error:Qa(404,{pathname:Pe.path})}})})),Le=await Re,Ie=(await ze).reduce((Pe,He)=>Object.assign(Pe,He),{});return{loaderResults:Le,fetcherResults:Ie}}function We(){K=!0,P.forEach((V,X)=>{z.has(X)&&k.add(X),Fn(X)})}function ot(V,X,se={}){T.fetchers.set(V,X),Be({fetchers:new Map(T.fetchers)},{flushSync:(se&&se.flushSync)===!0})}function it(V,X,se,ge={}){let Re=Oi(T.matches,X);bn(V),Be({errors:{[Re.route.id]:se},fetchers:new Map(T.fetchers)},{flushSync:(ge&&ge.flushSync)===!0})}function xn(V){return q.set(V,(q.get(V)||0)+1),te.has(V)&&te.delete(V),T.fetchers.get(V)||F9}function Ua(V,X){Fn(V,X==null?void 0:X.reason),ot(V,To(null))}function bn(V){let X=T.fetchers.get(V);z.has(V)&&!(X&&X.state==="loading"&&xe.has(V))&&Fn(V),P.delete(V),xe.delete(V),L.delete(V),te.delete(V),k.delete(V),T.fetchers.delete(V)}function ei(V){let X=(q.get(V)||0)-1;X<=0?(q.delete(V),te.add(V)):q.set(V,X),Be({fetchers:new Map(T.fetchers)})}function Fn(V,X){let se=z.get(V);se&&(se.abort(X),z.delete(V))}function Tn(V){for(let X of V){let se=xn(X),ge=To(se.data);T.fetchers.set(X,ge)}}function vr(){let V=[],X=!1;for(let se of L){let ge=T.fetchers.get(se);xt(ge,`Expected fetcher: ${se}`),ge.state==="loading"&&(L.delete(se),V.push(se),X=!0)}return Tn(V),X}function _n(V){let X=[];for(let[se,ge]of xe)if(ge<V){let Re=T.fetchers.get(se);xt(Re,`Expected fetcher: ${se}`),Re.state==="loading"&&(Fn(se),xe.delete(se),X.push(se))}return Tn(X),X.length>0}function ul(V,X){let se=T.blockers.get(V)||Ld;return ue.get(V)!==X&&ue.set(V,X),se}function Ns(V){T.blockers.delete(V),ue.delete(V)}function ti(V,X){let se=T.blockers.get(V)||Ld;xt(se.state==="unblocked"&&X.state==="blocked"||se.state==="blocked"&&X.state==="blocked"||se.state==="blocked"&&X.state==="proceeding"||se.state==="blocked"&&X.state==="unblocked"||se.state==="proceeding"&&X.state==="unblocked",`Invalid blocker state transition: ${se.state} -> ${X.state}`);let ge=new Map(T.blockers);ge.set(V,X),Be({blockers:ge})}function to({currentLocation:V,nextLocation:X,historyAction:se}){if(ue.size===0)return;ue.size>1&&kn(!1,"A router only supports one blocker at a time");let ge=Array.from(ue.entries()),[Re,ze]=ge[ge.length-1],Le=T.blockers.get(Re);if(!(Le&&Le.state==="proceeding")&&ze({currentLocation:V,nextLocation:X,historyAction:se}))return Re}function As(V){let X=Qa(404,{pathname:V}),se=f||d,{matches:ge,route:Re}=ym(se);return{notFoundMatches:ge,route:Re,error:X}}function Sn(V,X,se){if(w=V,C=X,S=se||null,!R&&T.navigation===bx){R=!0;let ge=xr(T.location,T.matches);ge!=null&&Be({restoreScrollPosition:ge})}return()=>{w=null,C=null,S=null}}function pn(V,X){return S&&S(V,X.map(ge=>c9(ge,T.loaderData)))||V.key}function Gn(V,X){if(w&&C){let se=pn(V,X);w[se]=C()}}function xr(V,X){if(w){let se=pn(V,X),ge=w[se];if(typeof ge=="number")return ge}return null}function er(V,X,se){if(e.patchRoutesOnNavigation)if(V){if(Object.keys(V[0].params).length>0)return{active:!0,matches:Gm(X,se,h,!0)}}else return{active:!0,matches:Gm(X,se,h,!0)||[]};return{active:!1,matches:null}}async function Vn(V,X,se,ge){if(!e.patchRoutesOnNavigation)return{type:"success",matches:V};let Re=V;for(;;){let ze=f==null,Le=f||d,Ie=c;try{await e.patchRoutesOnNavigation({signal:se,path:X,matches:Re,fetcherKey:ge,patch:(qe,Ze)=>{se.aborted||Jw(qe,Ze,Le,Ie,l,!1)}})}catch(qe){return{type:"error",error:qe,partialMatches:Re}}finally{ze&&!se.aborted&&(d=[...d])}if(se.aborted)return{type:"aborted"};let Pe=Di(Le,X,h);if(Pe)return{type:"success",matches:Pe};let He=Gm(Le,X,h,!0);if(!He||Re.length===He.length&&Re.every((qe,Ze)=>qe.route.id===He[Ze].route.id))return{type:"success",matches:null};Re=He}}function Ar(V){c={},f=cf(V,l,void 0,c)}function Xr(V,X,se=!1){let ge=f==null;Jw(V,X,f||d,c,l,se),ge&&(d=[...d],Be({}))}return O={get basename(){return h},get future(){return y},get state(){return T},get routes(){return d},get window(){return t},initialize:Ae,subscribe:Ne,enableScrollRestoration:Sn,navigate:qt,fetch:U,revalidate:Dt,createHref:V=>e.history.createHref(V),encodeLocation:V=>e.history.encodeLocation(V),getFetcher:xn,resetFetcher:Ua,deleteFetcher:ei,dispose:we,getBlocker:ul,deleteBlocker:Ns,patchRoutes:Xr,_internalFetchControllers:z,_internalSetRoutes:Ar,_internalSetStateDoNotUseOrYouWillBreakYourApp(V){Be(V)}},e.unstable_instrumentations&&(O=N9(O,e.unstable_instrumentations.map(V=>V.router).filter(Boolean))),O}function $9(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function b0(e,t,n,r,o,l){let c,d;if(o){c=[];for(let h of t)if(c.push(h),h.route.id===o){d=h;break}}else c=t,d=t[t.length-1];let f=Qp(r||".",Wp(c),ts(e.pathname,n)||e.pathname,l==="path");if(r==null&&(f.search=e.search,f.hash=e.hash),(r==null||r===""||r===".")&&d){let h=M1(f.search);if(d.route.index&&!h)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&h){let g=new URLSearchParams(f.search),y=g.getAll("index");g.delete("index"),y.filter(b=>b).forEach(b=>g.append("index",b));let v=g.toString();f.search=v?`?${v}`:""}}return n!=="/"&&(f.pathname=C9({basename:n,pathname:f.pathname})),Zs(f)}function Qw(e,t,n){if(!n||!$9(n))return{path:t};if(n.formMethod&&!sI(n.formMethod))return{path:t,error:Qa(405,{method:n.formMethod})};let r=()=>({path:t,error:Qa(400,{type:"invalid-body"})}),l=(n.formMethod||"get").toUpperCase(),c=l_(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!Vr(l))return r();let y=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((v,[b,w])=>`${v}${b}=${w}
59
+ `,""):String(n.body);return{path:t,submission:{formMethod:l,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:y}}}else if(n.formEncType==="application/json"){if(!Vr(l))return r();try{let y=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:l,formAction:c,formEncType:n.formEncType,formData:void 0,json:y,text:void 0}}}catch{return r()}}}xt(typeof FormData=="function","FormData is not available in this environment");let d,f;if(n.formData)d=E0(n.formData),f=n.formData;else if(n.body instanceof FormData)d=E0(n.body),f=n.body;else if(n.body instanceof URLSearchParams)d=n.body,f=aR(d);else if(n.body==null)d=new URLSearchParams,f=new FormData;else try{d=new URLSearchParams(n.body),f=aR(d)}catch{return r()}let h={formMethod:l,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(Vr(h.formMethod))return{path:t,submission:h};let g=Qi(t);return e&&g.search&&M1(g.search)&&d.append("index",""),g.search=`?${d}`,{path:Zs(g),submission:h}}function Xw(e,t,n,r,o,l,c,d,f,h,g,y,v,b,w,S,C,R,j,_){var H;let D=_?ja(_[1])?_[1].error:_[1].data:void 0,A=o.createURL(l.location),O=o.createURL(f),T;if(g&&l.errors){let K=Object.keys(l.errors)[0];T=c.findIndex(k=>k.route.id===K)}else if(_&&ja(_[1])){let K=_[0];T=c.findIndex(k=>k.route.id===K)-1}let M=_?_[1].statusCode:void 0,F=M&&M>=400,G={currentUrl:A,currentParams:((H=l.matches[0])==null?void 0:H.params)||{},nextUrl:O,nextParams:c[0].params,...d,actionResult:D,actionStatus:M},Y=A1(c.map(K=>K.route.path)),Z=c.map((K,k)=>{let{route:z}=K,B=null;if(T!=null&&k>T?B=!1:z.lazy?B=!0:O1(z)?g?B=S0(z,l.loaderData,l.errors):B9(l.loaderData,l.matches[k],K)&&(B=!0):B=!1,B!==null)return C0(n,r,e,Y,K,h,t,B);let ie=F?!1:y||A.pathname+A.search===O.pathname+O.search||A.search!==O.search||G9(l.matches[k],K),xe={...G,defaultShouldRevalidate:ie},L=lp(K,xe);return C0(n,r,e,Y,K,h,t,L,xe)}),J=[];return w.forEach((K,k)=>{if(g||!c.some(te=>te.route.id===K.routeId)||b.has(k))return;let z=l.fetchers.get(k),B=z&&z.state!=="idle"&&z.data===void 0,ie=Di(C,K.path,R);if(!ie){if(j&&B)return;J.push({key:k,routeId:K.routeId,path:K.path,matches:null,match:null,request:null,controller:null});return}if(S.has(k))return;let xe=qm(ie,K.path),L=new AbortController,P=eu(o,K.path,L.signal),q=null;if(v.has(k))v.delete(k),q=uu(n,r,P,ie,xe,h,t);else if(B)y&&(q=uu(n,r,P,ie,xe,h,t));else{let te={...G,defaultShouldRevalidate:F?!1:y};lp(xe,te)&&(q=uu(n,r,P,ie,xe,h,t,te))}q&&J.push({key:k,routeId:K.routeId,path:K.path,matches:q,match:xe,request:P,controller:L})}),{dsMatches:Z,revalidatingFetchers:J}}function O1(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function S0(e,t,n){if(e.lazy)return!0;if(!O1(e))return!1;let r=t!=null&&e.id in t,o=n!=null&&n[e.id]!==void 0;return!r&&o?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!o}function B9(e,t,n){let r=!t||n.route.id!==t.route.id,o=!e.hasOwnProperty(n.route.id);return r||o}function G9(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function lp(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function Jw(e,t,n,r,o,l){let c;if(e){let h=r[e];xt(h,`No route found to patch children into: routeId = ${e}`),h.children||(h.children=[]),c=h.children}else c=n;let d=[],f=[];if(t.forEach(h=>{let g=c.find(y=>r_(h,y));g?f.push({existingRoute:g,newRoute:h}):d.push(h)}),d.length>0){let h=cf(d,o,[e||"_","patch",String((c==null?void 0:c.length)||"0")],r);c.push(...h)}if(l&&f.length>0)for(let h=0;h<f.length;h++){let{existingRoute:g,newRoute:y}=f[h],v=g,[b]=cf([y],o,[],{},!0);Object.assign(v,{element:b.element?b.element:v.element,errorElement:b.errorElement?b.errorElement:v.errorElement,hydrateFallbackElement:b.hydrateFallbackElement?b.hydrateFallbackElement:v.hydrateFallbackElement})}}function r_(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var o;return(o=t.children)==null?void 0:o.some(l=>r_(n,l))}):!1}var eR=new WeakMap,a_=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let o=n[t.id];if(xt(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let l=o.lazy[e];if(!l)return;let c=eR.get(o);c||(c={},eR.set(o,c));let d=c[e];if(d)return d;let f=(async()=>{let h=s9(e),y=o[e]!==void 0&&e!=="hasErrorBoundary";if(h)kn(!h,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(y)kn(!1,`Route "${o.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let v=await l();v!=null&&(Object.assign(o,{[e]:v}),Object.assign(o,r(o)))}typeof o.lazy=="object"&&(o.lazy[e]=void 0,Object.values(o.lazy).every(v=>v===void 0)&&(o.lazy=void 0))})();return c[e]=f,f},tR=new WeakMap;function q9(e,t,n,r,o){let l=n[e.id];if(xt(l,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let g=tR.get(l);if(g)return{lazyRoutePromise:g,lazyHandlerPromise:g};let y=(async()=>{xt(typeof e.lazy=="function","No lazy route function found");let v=await e.lazy(),b={};for(let w in v){let S=v[w];if(S===void 0)continue;let C=i9(w),j=l[w]!==void 0&&w!=="hasErrorBoundary";C?kn(!C,"Route property "+w+" is not a supported property to be returned from a lazy route function. This property will be ignored."):j?kn(!j,`Route "${l.id}" has a static property "${w}" defined but its lazy function is also returning a value for this property. The lazy route property "${w}" will be ignored.`):b[w]=S}Object.assign(l,b),Object.assign(l,{...r(l),lazy:void 0})})();return tR.set(l,y),y.catch(()=>{}),{lazyRoutePromise:y,lazyHandlerPromise:y}}let c=Object.keys(e.lazy),d=[],f;for(let g of c){if(o&&o.includes(g))continue;let y=a_({key:g,route:e,manifest:n,mapRouteProperties:r});y&&(d.push(y),g===t&&(f=y))}let h=d.length>0?Promise.all(d).then(()=>{}):void 0;return h==null||h.catch(()=>{}),f==null||f.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:f}}async function nR(e){let t=e.matches.filter(o=>o.shouldLoad),n={};return(await Promise.all(t.map(o=>o.resolve()))).forEach((o,l)=>{n[t[l].route.id]=o}),n}async function Z9(e){return e.matches.some(t=>t.route.middleware)?s_(e,()=>nR(e)):nR(e)}function s_(e,t){return K9(e,t,r=>r,nI,n);function n(r,o,l){if(l)return Promise.resolve(Object.assign(l.value,{[o]:{type:"error",result:r}}));{let{matches:c}=e,d=Math.min(Math.max(c.findIndex(h=>h.route.id===o),0),Math.max(c.findIndex(h=>h.unstable_shouldCallHandler()),0)),f=Oi(c,c[d].route.id).route.id;return Promise.resolve({[f]:{type:"error",result:r}})}}}async function K9(e,t,n,r,o){let{matches:l,request:c,params:d,context:f,unstable_pattern:h}=e,g=l.flatMap(v=>v.route.middleware?v.route.middleware.map(b=>[v.route.id,b]):[]);return await o_({request:c,params:d,context:f,unstable_pattern:h},g,t,n,r,o)}async function o_(e,t,n,r,o,l,c=0){let{request:d}=e;if(d.signal.aborted)throw d.signal.reason??new Error(`Request aborted: ${d.method} ${d.url}`);let f=t[c];if(!f)return await n();let[h,g]=f,y,v=async()=>{if(y)throw new Error("You may only call `next()` once per middleware");try{return y={value:await o_(e,t,n,r,o,l,c+1)},y.value}catch(b){return y={value:await l(b,h,y)},y.value}};try{let b=await g(e,v),w=b!=null?r(b):void 0;return o(w)?w:y?w??y.value:(y={value:await v()},y.value)}catch(b){return await l(b,h,y)}}function i_(e,t,n,r,o){let l=a_({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),c=q9(r.route,Vr(n.method)?"action":"loader",t,e,o);return{middleware:l,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function C0(e,t,n,r,o,l,c,d,f=null){let h=!1,g=i_(e,t,n,o,l);return{...o,_lazyPromises:g,shouldLoad:d,unstable_shouldRevalidateArgs:f,unstable_shouldCallHandler(y){return h=!0,f?typeof y=="boolean"?lp(o,{...f,defaultShouldRevalidate:y}):lp(o,f):d},resolve(y){let{lazy:v,loader:b,middleware:w}=o.route,S=h||d||y&&!Vr(n.method)&&(v||b),C=w&&w.length>0&&!b&&!v;return S&&(Vr(n.method)||!C)?W9({request:n,unstable_pattern:r,match:o,lazyHandlerPromise:g==null?void 0:g.handler,lazyRoutePromise:g==null?void 0:g.route,handlerOverride:y,scopedContext:c}):Promise.resolve({type:"data",result:void 0})}}}function uu(e,t,n,r,o,l,c,d=null){return r.map(f=>f.route.id!==o.route.id?{...f,shouldLoad:!1,unstable_shouldRevalidateArgs:d,unstable_shouldCallHandler:()=>!1,_lazyPromises:i_(e,t,n,f,l),resolve:()=>Promise.resolve({type:"data",result:void 0})}:C0(e,t,n,A1(r.map(h=>h.route.path)),f,l,c,!0,d))}async function Y9(e,t,n,r,o,l){n.some(h=>{var g;return(g=h._lazyPromises)==null?void 0:g.middleware})&&await Promise.all(n.map(h=>{var g;return(g=h._lazyPromises)==null?void 0:g.middleware}));let c={request:t,unstable_pattern:A1(n.map(h=>h.route.path)),params:n[0].params,context:o,matches:n},f=await e({...c,fetcherKey:r,runClientMiddleware:h=>{let g=c;return s_(g,()=>h({...g,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(h=>{var g,y;return[(g=h._lazyPromises)==null?void 0:g.handler,(y=h._lazyPromises)==null?void 0:y.route]}))}catch{}return f}async function W9({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:r,lazyRoutePromise:o,handlerOverride:l,scopedContext:c}){let d,f,h=Vr(e.method),g=h?"action":"loader",y=v=>{let b,w=new Promise((R,j)=>b=j);f=()=>b(),e.signal.addEventListener("abort",f);let S=R=>typeof v!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${g}" [routeId: ${n.route.id}]`)):v({request:e,unstable_pattern:t,params:n.params,context:c},...R!==void 0?[R]:[]),C=(async()=>{try{return{type:"data",result:await(l?l(j=>S(j)):S())}}catch(R){return{type:"error",result:R}}})();return Promise.race([C,w])};try{let v=h?n.route.action:n.route.loader;if(r||o)if(v){let b,[w]=await Promise.all([y(v).catch(S=>{b=S}),r,o]);if(b!==void 0)throw b;d=w}else{await r;let b=h?n.route.action:n.route.loader;if(b)[d]=await Promise.all([y(b),o]);else if(g==="action"){let w=new URL(e.url),S=w.pathname+w.search;throw Qa(405,{method:e.method,pathname:S,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(v)d=await y(v);else{let b=new URL(e.url),w=b.pathname+b.search;throw Qa(404,{pathname:w})}}catch(v){return{type:"error",result:v}}finally{f&&e.signal.removeEventListener("abort",f)}return d}async function Q9(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function X9(e){var r,o,l,c,d,f;let{result:t,type:n}=e;if(c_(t)){let h;try{h=await Q9(t)}catch(g){return{type:"error",error:g}}return n==="error"?{type:"error",error:new ip(t.status,t.statusText,h),statusCode:t.status,headers:t.headers}:{type:"data",data:h,statusCode:t.status,headers:t.headers}}return n==="error"?lR(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(r=t.init)==null?void 0:r.status,headers:(o=t.init)!=null&&o.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new ip(((l=t.init)==null?void 0:l.status)||500,void 0,t.data),statusCode:uf(t)?t.status:void 0,headers:(c=t.init)!=null&&c.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:uf(t)?t.status:void 0}:lR(t)?{type:"data",data:t.data,statusCode:(d=t.init)==null?void 0:d.status,headers:(f=t.init)!=null&&f.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function J9(e,t,n,r,o){let l=e.headers.get("Location");if(xt(l,"Redirects returned/thrown from loaders/actions must have a Location header"),!D1(l)){let c=r.slice(0,r.findIndex(d=>d.route.id===n)+1);l=b0(new URL(t.url),c,o,l),e.headers.set("Location",l)}return e}function rR(e,t,n){if(D1(e)){let r=e,o=r.startsWith("//")?new URL(t.protocol+r):new URL(r),l=ts(o.pathname,n)!=null;if(o.origin===t.origin&&l)return o.pathname+o.search+o.hash}return e}function eu(e,t,n,r){let o=e.createURL(l_(t)).toString(),l={signal:n};if(r&&Vr(r.formMethod)){let{formMethod:c,formEncType:d}=r;l.method=c.toUpperCase(),d==="application/json"?(l.headers=new Headers({"Content-Type":d}),l.body=JSON.stringify(r.json)):d==="text/plain"?l.body=r.text:d==="application/x-www-form-urlencoded"&&r.formData?l.body=E0(r.formData):l.body=r.formData}return new Request(o,l)}function E0(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function aR(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function eI(e,t,n,r=!1,o=!1){let l={},c=null,d,f=!1,h={},g=n&&ja(n[1])?n[1].error:void 0;return e.forEach(y=>{if(!(y.route.id in t))return;let v=y.route.id,b=t[v];if(xt(!Ol(b),"Cannot handle redirect results in processLoaderData"),ja(b)){let w=b.error;if(g!==void 0&&(w=g,g=void 0),c=c||{},o)c[v]=w;else{let S=Oi(e,v);c[S.route.id]==null&&(c[S.route.id]=w)}r||(l[v]=n_),f||(f=!0,d=uf(b.error)?b.error.status:500),b.headers&&(h[v]=b.headers)}else l[v]=b.data,b.statusCode&&b.statusCode!==200&&!f&&(d=b.statusCode),b.headers&&(h[v]=b.headers)}),g!==void 0&&n&&(c={[n[0]]:g},n[2]&&(l[n[2]]=void 0)),{loaderData:l,errors:c,statusCode:d||200,loaderHeaders:h}}function sR(e,t,n,r,o,l){let{loaderData:c,errors:d}=eI(t,n,r);return o.filter(f=>!f.matches||f.matches.some(h=>h.shouldLoad)).forEach(f=>{let{key:h,match:g,controller:y}=f;if(y&&y.signal.aborted)return;let v=l[h];if(xt(v,"Did not find corresponding fetcher result"),ja(v)){let b=Oi(e.matches,g==null?void 0:g.route.id);d&&d[b.route.id]||(d={...d,[b.route.id]:v.error}),e.fetchers.delete(h)}else if(Ol(v))xt(!1,"Unhandled fetcher revalidation redirect");else{let b=To(v.data);e.fetchers.set(h,b)}}),{loaderData:c,errors:d}}function oR(e,t,n,r){let o=Object.entries(t).filter(([,l])=>l!==n_).reduce((l,[c,d])=>(l[c]=d,l),{});for(let l of n){let c=l.route.id;if(!t.hasOwnProperty(c)&&e.hasOwnProperty(c)&&l.route.loader&&(o[c]=e[c]),r&&r.hasOwnProperty(c))break}return o}function iR(e){return e?ja(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Oi(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function ym(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Qa(e,{pathname:t,routeId:n,method:r,type:o,message:l}={}){let c="Unknown Server Error",d="Unknown @remix-run/router error";return e===400?(c="Bad Request",r&&t&&n?d=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:o==="invalid-body"&&(d="Unable to encode submission body")):e===403?(c="Forbidden",d=`Route "${n}" does not match URL "${t}"`):e===404?(c="Not Found",d=`No route matches URL "${t}"`):e===405&&(c="Method Not Allowed",r&&t&&n?d=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(d=`Invalid request method "${r.toUpperCase()}"`)),new ip(e||500,c,new Error(d),!0)}function vm(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,o]=t[n];if(Ol(o))return{key:r,result:o}}}function l_(e){let t=typeof e=="string"?Qi(e):e;return Zs({...t,hash:""})}function tI(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function nI(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&rI(n))}function rI(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function aI(e){return c_(e.result)&&P9.has(e.result.status)}function ja(e){return e.type==="error"}function Ol(e){return(e&&e.type)==="redirect"}function lR(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function c_(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function sI(e){return L9.has(e.toUpperCase())}function Vr(e){return I9.has(e.toUpperCase())}function M1(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function qm(e,t){let n=typeof t=="string"?Qi(t).search:t.search;if(e[e.length-1].route.index&&M1(n||""))return e[e.length-1];let r=XT(e);return r[r.length-1]}function cR(e){let{formMethod:t,formAction:n,formEncType:r,text:o,formData:l,json:c}=e;if(!(!t||!n||!r)){if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:o};if(l!=null)return{formMethod:t,formAction:n,formEncType:r,formData:l,json:void 0,text:void 0};if(c!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:c,text:void 0}}}function Sx(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function oI(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Pd(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function iI(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function To(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function lI(e,t){try{let n=e.sessionStorage.getItem(t_);if(n){let r=JSON.parse(n);for(let[o,l]of Object.entries(r||{}))l&&Array.isArray(l)&&t.set(o,new Set(l||[]))}}catch{}}function cI(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(t_,JSON.stringify(n))}catch(r){kn(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function uI(){let e,t,n=new Promise((r,o)=>{e=async l=>{r(l);try{await n}catch{}},t=async l=>{o(l);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Xl=m.createContext(null);Xl.displayName="DataRouter";var Rf=m.createContext(null);Rf.displayName="DataRouterState";m.createContext(!1);var I1=m.createContext({isTransitioning:!1});I1.displayName="ViewTransition";var u_=m.createContext(new Map);u_.displayName="Fetchers";var dI=m.createContext(null);dI.displayName="Await";var ws=m.createContext(null);ws.displayName="Navigation";var Xp=m.createContext(null);Xp.displayName="Location";var rs=m.createContext({outlet:null,matches:[],isDataRoute:!1});rs.displayName="Route";var k1=m.createContext(null);k1.displayName="RouteError";function fI(e,{relative:t}={}){xt(Nu(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=m.useContext(ws),{hash:o,pathname:l,search:c}=jf(e,{relative:t}),d=l;return n!=="/"&&(d=l==="/"?n:$s([n,l])),r.createHref({pathname:d,search:c,hash:o})}function Nu(){return m.useContext(Xp)!=null}function Qs(){return xt(Nu(),"useLocation() may be used only in the context of a <Router> component."),m.useContext(Xp).location}var d_="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function f_(e){m.useContext(ws).static||m.useLayoutEffect(e)}function Jp(){let{isDataRoute:e}=m.useContext(rs);return e?jI():hI()}function hI(){xt(Nu(),"useNavigate() may be used only in the context of a <Router> component.");let e=m.useContext(Xl),{basename:t,navigator:n}=m.useContext(ws),{matches:r}=m.useContext(rs),{pathname:o}=Qs(),l=JSON.stringify(Wp(r)),c=m.useRef(!1);return f_(()=>{c.current=!0}),m.useCallback((f,h={})=>{if(kn(c.current,d_),!c.current)return;if(typeof f=="number"){n.go(f);return}let g=Qp(f,JSON.parse(l),o,h.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:$s([t,g.pathname])),(h.replace?n.replace:n.push)(g,h.state,h)},[t,n,l,o,e])}var h_=m.createContext(null);function Ia(){return m.useContext(h_)}function mI(e){let t=m.useContext(rs).outlet;return m.useMemo(()=>t&&m.createElement(h_.Provider,{value:e},t),[t,e])}function m_(){let{matches:e}=m.useContext(rs),t=e[e.length-1];return t?t.params:{}}function jf(e,{relative:t}={}){let{matches:n}=m.useContext(rs),{pathname:r}=Qs(),o=JSON.stringify(Wp(n));return m.useMemo(()=>Qp(e,JSON.parse(o),r,t==="path"),[e,o,r,t])}function pI(e,t,n,r,o){xt(Nu(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:l}=m.useContext(ws),{matches:c}=m.useContext(rs),d=c[c.length-1],f=d?d.params:{},h=d?d.pathname:"/",g=d?d.pathnameBase:"/",y=d&&d.route;{let j=y&&y.path||"";p_(h,!y||j.endsWith("*")||j.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${j}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
60
+
61
+ Please change the parent <Route path="${j}"> to <Route path="${j==="/"?"*":`${j}/*`}">.`)}let v=Qs(),b;b=v;let w=b.pathname||"/",S=w;if(g!=="/"){let j=g.replace(/^\//,"").split("/");S="/"+w.replace(/^\//,"").split("/").slice(j.length).join("/")}let C=Di(e,{pathname:S});return kn(y||C!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),kn(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),bI(C&&C.map(j=>Object.assign({},j,{params:Object.assign({},f,j.params),pathname:$s([g,l.encodeLocation?l.encodeLocation(j.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?g:$s([g,l.encodeLocation?l.encodeLocation(j.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathnameBase])})),c,n,r,o)}function gI(){let e=RI(),t=uf(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},l={padding:"2px 4px",backgroundColor:r},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=m.createElement(m.Fragment,null,m.createElement("p",null,"💿 Hey developer 👋"),m.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",m.createElement("code",{style:l},"ErrorBoundary")," or"," ",m.createElement("code",{style:l},"errorElement")," prop on your route.")),m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:o},n):null,c)}var yI=m.createElement(gI,null),vI=class extends m.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.unstable_onError?this.props.unstable_onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?m.createElement(rs.Provider,{value:this.props.routeContext},m.createElement(k1.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function xI({routeContext:e,match:t,children:n}){let r=m.useContext(Xl);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),m.createElement(rs.Provider,{value:e},n)}function bI(e,t=[],n=null,r=null,o=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let l=e,c=n==null?void 0:n.errors;if(c!=null){let h=l.findIndex(g=>g.route.id&&(c==null?void 0:c[g.route.id])!==void 0);xt(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),l=l.slice(0,Math.min(l.length,h+1))}let d=!1,f=-1;if(n)for(let h=0;h<l.length;h++){let g=l[h];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(f=h),g.route.id){let{loaderData:y,errors:v}=n,b=g.route.loader&&!y.hasOwnProperty(g.route.id)&&(!v||v[g.route.id]===void 0);if(g.route.lazy||b){d=!0,f>=0?l=l.slice(0,f+1):l=[l[0]];break}}}return l.reduceRight((h,g,y)=>{let v,b=!1,w=null,S=null;n&&(v=c&&g.route.id?c[g.route.id]:void 0,w=g.route.errorElement||yI,d&&(f<0&&y===0?(p_("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,S=null):f===y&&(b=!0,S=g.route.hydrateFallbackElement||null)));let C=t.concat(l.slice(0,y+1)),R=()=>{let j;return v?j=w:b?j=S:g.route.Component?j=m.createElement(g.route.Component,null):g.route.element?j=g.route.element:j=h,m.createElement(xI,{match:g,routeContext:{outlet:h,matches:C,isDataRoute:n!=null},children:j})};return n&&(g.route.ErrorBoundary||g.route.errorElement||y===0)?m.createElement(vI,{location:n.location,revalidation:n.revalidation,component:w,error:v,children:R(),routeContext:{outlet:null,matches:C,isDataRoute:!0},unstable_onError:r}):R()},null)}function L1(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function SI(e){let t=m.useContext(Xl);return xt(t,L1(e)),t}function CI(e){let t=m.useContext(Rf);return xt(t,L1(e)),t}function EI(e){let t=m.useContext(rs);return xt(t,L1(e)),t}function P1(e){let t=EI(e),n=t.matches[t.matches.length-1];return xt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function wI(){return P1("useRouteId")}function RI(){var r;let e=m.useContext(k1),t=CI("useRouteError"),n=P1("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function jI(){let{router:e}=SI("useNavigate"),t=P1("useNavigate"),n=m.useRef(!1);return f_(()=>{n.current=!0}),m.useCallback(async(o,l={})=>{kn(n.current,d_),n.current&&(typeof o=="number"?e.navigate(o):await e.navigate(o,{fromRouteId:t,...l}))},[e,t])}var uR={};function p_(e,t,n){!t&&!uR[e]&&(uR[e]=!0,kn(!1,n))}var dR={};function fR(e,t){!e&&!dR[t]&&(dR[t]=!0,console.warn(t))}function TI(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&kn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:m.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&kn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:m.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&kn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:m.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var _I=["HydrateFallback","hydrateFallbackElement"],NI=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}};function AI({router:e,flushSync:t,unstable_onError:n}){let[r,o]=m.useState(e.state),[l,c]=m.useState(),[d,f]=m.useState({isTransitioning:!1}),[h,g]=m.useState(),[y,v]=m.useState(),[b,w]=m.useState(),S=m.useRef(new Map),C=m.useCallback(A=>{o(O=>(A.errors&&n&&Object.entries(A.errors).forEach(([T,M])=>{var F;((F=O.errors)==null?void 0:F[T])!==M&&n(M)}),A))},[n]),R=m.useCallback((A,{deletedFetchers:O,flushSync:T,viewTransitionOpts:M})=>{A.fetchers.forEach((G,Y)=>{G.data!==void 0&&S.current.set(Y,G.data)}),O.forEach(G=>S.current.delete(G)),fR(T===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let F=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(fR(M==null||F,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!M||!F){t&&T?t(()=>C(A)):m.startTransition(()=>C(A));return}if(t&&T){t(()=>{y&&(h&&h.resolve(),y.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:M.currentLocation,nextLocation:M.nextLocation})});let G=e.window.document.startViewTransition(()=>{t(()=>C(A))});G.finished.finally(()=>{t(()=>{g(void 0),v(void 0),c(void 0),f({isTransitioning:!1})})}),t(()=>v(G));return}y?(h&&h.resolve(),y.skipTransition(),w({state:A,currentLocation:M.currentLocation,nextLocation:M.nextLocation})):(c(A),f({isTransitioning:!0,flushSync:!1,currentLocation:M.currentLocation,nextLocation:M.nextLocation}))},[e.window,t,y,h,C]);m.useLayoutEffect(()=>e.subscribe(R),[e,R]),m.useEffect(()=>{d.isTransitioning&&!d.flushSync&&g(new NI)},[d]),m.useEffect(()=>{if(h&&l&&e.window){let A=l,O=h.promise,T=e.window.document.startViewTransition(async()=>{m.startTransition(()=>C(A)),await O});T.finished.finally(()=>{g(void 0),v(void 0),c(void 0),f({isTransitioning:!1})}),v(T)}},[l,h,e.window,C]),m.useEffect(()=>{h&&l&&r.location.key===l.location.key&&h.resolve()},[h,y,r.location,l]),m.useEffect(()=>{!d.isTransitioning&&b&&(c(b.state),f({isTransitioning:!0,flushSync:!1,currentLocation:b.currentLocation,nextLocation:b.nextLocation}),w(void 0))},[d.isTransitioning,b]);let j=m.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:A=>e.navigate(A),push:(A,O,T)=>e.navigate(A,{state:O,preventScrollReset:T==null?void 0:T.preventScrollReset}),replace:(A,O,T)=>e.navigate(A,{replace:!0,state:O,preventScrollReset:T==null?void 0:T.preventScrollReset})}),[e]),_=e.basename||"/",D=m.useMemo(()=>({router:e,navigator:j,static:!1,basename:_,unstable_onError:n}),[e,j,_,n]);return m.createElement(m.Fragment,null,m.createElement(Xl.Provider,{value:D},m.createElement(Rf.Provider,{value:r},m.createElement(u_.Provider,{value:S.current},m.createElement(I1.Provider,{value:d},m.createElement(II,{basename:_,location:r.location,navigationType:r.historyAction,navigator:j},m.createElement(DI,{routes:e.routes,future:e.future,state:r,unstable_onError:n})))))),null)}var DI=m.memo(OI);function OI({routes:e,future:t,state:n,unstable_onError:r}){return pI(e,void 0,n,r,t)}function MI({to:e,replace:t,state:n,relative:r}){xt(Nu(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=m.useContext(ws);kn(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:l}=m.useContext(rs),{pathname:c}=Qs(),d=Jp(),f=Qp(e,Wp(l),c,r==="path"),h=JSON.stringify(f);return m.useEffect(()=>{d(JSON.parse(h),{replace:t,state:n,relative:r})},[d,h,r,t,n]),null}function g_(e){return mI(e.context)}function II({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:l=!1}){xt(!Nu(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),d=m.useMemo(()=>({basename:c,navigator:o,static:l,future:{}}),[c,o,l]);typeof n=="string"&&(n=Qi(n));let{pathname:f="/",search:h="",hash:g="",state:y=null,key:v="default"}=n,b=m.useMemo(()=>{let w=ts(f,c);return w==null?null:{location:{pathname:w,search:h,hash:g,state:y,key:v},navigationType:r}},[c,f,h,g,y,v,r]);return kn(b!=null,`<Router basename="${c}"> is not able to match the URL "${f}${h}${g}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:m.createElement(ws.Provider,{value:d},m.createElement(Xp.Provider,{children:t,value:b}))}var Zm="get",Km="application/x-www-form-urlencoded";function eg(e){return e!=null&&typeof e.tagName=="string"}function kI(e){return eg(e)&&e.tagName.toLowerCase()==="button"}function LI(e){return eg(e)&&e.tagName.toLowerCase()==="form"}function PI(e){return eg(e)&&e.tagName.toLowerCase()==="input"}function UI(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function FI(e,t){return e.button===0&&(!t||t==="_self")&&!UI(e)}function w0(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(o=>[n,o]):[[n,r]])},[]))}function VI(e,t){let n=w0(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(l=>{n.append(o,l)})}),n}var xm=null;function zI(){if(xm===null)try{new FormData(document.createElement("form"),0),xm=!1}catch{xm=!0}return xm}var HI=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Cx(e){return e!=null&&!HI.has(e)?(kn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Km}"`),null):e}function $I(e,t){let n,r,o,l,c;if(LI(e)){let d=e.getAttribute("action");r=d?ts(d,t):null,n=e.getAttribute("method")||Zm,o=Cx(e.getAttribute("enctype"))||Km,l=new FormData(e)}else if(kI(e)||PI(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||d.getAttribute("action");if(r=f?ts(f,t):null,n=e.getAttribute("formmethod")||d.getAttribute("method")||Zm,o=Cx(e.getAttribute("formenctype"))||Cx(d.getAttribute("enctype"))||Km,l=new FormData(d,e),!zI()){let{name:h,type:g,value:y}=e;if(g==="image"){let v=h?`${h}.`:"";l.append(`${v}x`,"0"),l.append(`${v}y`,"0")}else h&&l.append(h,y)}}else{if(eg(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Zm,r=null,o=Km,c=e}return l&&o==="text/plain"&&(c=l,l=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:l,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function U1(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function BI(e,t,n){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname=`_root.${n}`:t&&ts(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function GI(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function qI(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function ZI(e,t,n){let r=await Promise.all(e.map(async o=>{let l=t.routes[o.route.id];if(l){let c=await GI(l,n);return c.links?c.links():[]}return[]}));return QI(r.flat(1).filter(qI).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function hR(e,t,n,r,o,l){let c=(f,h)=>n[h]?f.route.id!==n[h].route.id:!0,d=(f,h)=>{var g;return n[h].pathname!==f.pathname||((g=n[h].route.path)==null?void 0:g.endsWith("*"))&&n[h].params["*"]!==f.params["*"]};return l==="assets"?t.filter((f,h)=>c(f,h)||d(f,h)):l==="data"?t.filter((f,h)=>{var y;let g=r.routes[f.route.id];if(!g||!g.hasLoader)return!1;if(c(f,h)||d(f,h))return!0;if(f.route.shouldRevalidate){let v=f.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((y=n[0])==null?void 0:y.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function KI(e,t,{includeHydrateFallback:n}={}){return YI(e.map(r=>{let o=t.routes[r.route.id];if(!o)return[];let l=[o.module];return o.clientActionModule&&(l=l.concat(o.clientActionModule)),o.clientLoaderModule&&(l=l.concat(o.clientLoaderModule)),n&&o.hydrateFallbackModule&&(l=l.concat(o.hydrateFallbackModule)),o.imports&&(l=l.concat(o.imports)),l}).flat(1))}function YI(e){return[...new Set(e)]}function WI(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function QI(e,t){let n=new Set;return new Set(t),e.reduce((r,o)=>{let l=JSON.stringify(WI(o));return n.has(l)||(n.add(l),r.push({key:l,link:o})),r},[])}function y_(){let e=m.useContext(Xl);return U1(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function XI(){let e=m.useContext(Rf);return U1(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var F1=m.createContext(void 0);F1.displayName="FrameworkContext";function v_(){let e=m.useContext(F1);return U1(e,"You must render this element inside a <HydratedRouter> element"),e}function JI(e,t){let n=m.useContext(F1),[r,o]=m.useState(!1),[l,c]=m.useState(!1),{onFocus:d,onBlur:f,onMouseEnter:h,onMouseLeave:g,onTouchStart:y}=t,v=m.useRef(null);m.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let S=R=>{R.forEach(j=>{c(j.isIntersecting)})},C=new IntersectionObserver(S,{threshold:.5});return v.current&&C.observe(v.current),()=>{C.disconnect()}}},[e]),m.useEffect(()=>{if(r){let S=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(S)}}},[r]);let b=()=>{o(!0)},w=()=>{o(!1),c(!1)};return n?e!=="intent"?[l,v,{}]:[l,v,{onFocus:Ud(d,b),onBlur:Ud(f,w),onMouseEnter:Ud(h,b),onMouseLeave:Ud(g,w),onTouchStart:Ud(y,b)}]:[!1,v,{}]}function Ud(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function e7({page:e,...t}){let{router:n}=y_(),r=m.useMemo(()=>Di(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?m.createElement(n7,{page:e,matches:r,...t}):null}function t7(e){let{manifest:t,routeModules:n}=v_(),[r,o]=m.useState([]);return m.useEffect(()=>{let l=!1;return ZI(e,t,n).then(c=>{l||o(c)}),()=>{l=!0}},[e,t,n]),r}function n7({page:e,matches:t,...n}){let r=Qs(),{manifest:o,routeModules:l}=v_(),{basename:c}=y_(),{loaderData:d,matches:f}=XI(),h=m.useMemo(()=>hR(e,t,f,o,r,"data"),[e,t,f,o,r]),g=m.useMemo(()=>hR(e,t,f,o,r,"assets"),[e,t,f,o,r]),y=m.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let w=new Set,S=!1;if(t.forEach(R=>{var _;let j=o.routes[R.route.id];!j||!j.hasLoader||(!h.some(D=>D.route.id===R.route.id)&&R.route.id in d&&((_=l[R.route.id])!=null&&_.shouldRevalidate)||j.hasClientLoader?S=!0:w.add(R.route.id))}),w.size===0)return[];let C=BI(e,c,"data");return S&&w.size>0&&C.searchParams.set("_routes",t.filter(R=>w.has(R.route.id)).map(R=>R.route.id).join(",")),[C.pathname+C.search]},[c,d,r,o,h,t,e,l]),v=m.useMemo(()=>KI(g,o),[g,o]),b=t7(g);return m.createElement(m.Fragment,null,y.map(w=>m.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),v.map(w=>m.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),b.map(({key:w,link:S})=>m.createElement("link",{key:w,nonce:n.nonce,...S})))}function r7(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var x_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{x_&&(window.__reactRouterVersion="7.9.5")}catch{}function a7(e,t){return H9({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:t9({window:t==null?void 0:t.window}),hydrationData:s7(),routes:e,mapRouteProperties:TI,hydrationRouteProperties:_I,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window,unstable_instrumentations:t==null?void 0:t.unstable_instrumentations}).initialize()}function s7(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:o7(e.errors)}),e}function o7(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,o]of t)if(o&&o.__type==="RouteErrorResponse")n[r]=new ip(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let l=window[o.__subType];if(typeof l=="function")try{let c=new l(o.message);c.stack="",n[r]=c}catch{}}if(n[r]==null){let l=new Error(o.message);l.stack="",n[r]=l}}else n[r]=o;return n}var b_=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ha=m.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:o,reloadDocument:l,replace:c,state:d,target:f,to:h,preventScrollReset:g,viewTransition:y,...v},b){let{basename:w}=m.useContext(ws),S=typeof h=="string"&&b_.test(h),C,R=!1;if(typeof h=="string"&&S&&(C=h,x_))try{let F=new URL(window.location.href),G=h.startsWith("//")?new URL(F.protocol+h):new URL(h),Y=ts(G.pathname,w);G.origin===F.origin&&Y!=null?h=Y+G.search+G.hash:R=!0}catch{kn(!1,`<Link to="${h}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let j=fI(h,{relative:o}),[_,D,A]=JI(r,v),O=c7(h,{replace:c,state:d,target:f,preventScrollReset:g,relative:o,viewTransition:y});function T(F){t&&t(F),F.defaultPrevented||O(F)}let M=m.createElement("a",{...v,...A,href:C||j,onClick:R||l?t:T,ref:r7(b,D),target:f,"data-discover":!S&&n==="render"?"true":void 0});return _&&!S?m.createElement(m.Fragment,null,M,m.createElement(e7,{page:j})):M});ha.displayName="Link";var Tf=m.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:o=!1,style:l,to:c,viewTransition:d,children:f,...h},g){let y=jf(c,{relative:h.relative}),v=Qs(),b=m.useContext(Rf),{navigator:w,basename:S}=m.useContext(ws),C=b!=null&&p7(y)&&d===!0,R=w.encodeLocation?w.encodeLocation(y).pathname:y.pathname,j=v.pathname,_=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(j=j.toLowerCase(),_=_?_.toLowerCase():null,R=R.toLowerCase()),_&&S&&(_=ts(_,S)||_);const D=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let A=j===R||!o&&j.startsWith(R)&&j.charAt(D)==="/",O=_!=null&&(_===R||!o&&_.startsWith(R)&&_.charAt(R.length)==="/"),T={isActive:A,isPending:O,isTransitioning:C},M=A?t:void 0,F;typeof r=="function"?F=r(T):F=[r,A?"active":null,O?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let G=typeof l=="function"?l(T):l;return m.createElement(ha,{...h,"aria-current":M,className:F,ref:g,style:G,to:c,viewTransition:d},typeof f=="function"?f(T):f)});Tf.displayName="NavLink";var i7=m.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:o,state:l,method:c=Zm,action:d,onSubmit:f,relative:h,preventScrollReset:g,viewTransition:y,...v},b)=>{let w=h7(),S=m7(d,{relative:h}),C=c.toLowerCase()==="get"?"get":"post",R=typeof d=="string"&&b_.test(d),j=_=>{if(f&&f(_),_.defaultPrevented)return;_.preventDefault();let D=_.nativeEvent.submitter,A=(D==null?void 0:D.getAttribute("formmethod"))||c;w(D||_.currentTarget,{fetcherKey:t,method:A,navigate:n,replace:o,state:l,relative:h,preventScrollReset:g,viewTransition:y})};return m.createElement("form",{ref:b,method:C,action:S,onSubmit:r?f:j,...v,"data-discover":!R&&e==="render"?"true":void 0})});i7.displayName="Form";function l7(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function S_(e){let t=m.useContext(Xl);return xt(t,l7(e)),t}function c7(e,{target:t,replace:n,state:r,preventScrollReset:o,relative:l,viewTransition:c}={}){let d=Jp(),f=Qs(),h=jf(e,{relative:l});return m.useCallback(g=>{if(FI(g,t)){g.preventDefault();let y=n!==void 0?n:Zs(f)===Zs(h);d(e,{replace:y,state:r,preventScrollReset:o,relative:l,viewTransition:c})}},[f,d,h,n,r,t,e,o,l,c])}function u7(e){kn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=m.useRef(w0(e)),n=m.useRef(!1),r=Qs(),o=m.useMemo(()=>VI(r.search,n.current?null:t.current),[r.search]),l=Jp(),c=m.useCallback((d,f)=>{const h=w0(typeof d=="function"?d(new URLSearchParams(o)):d);n.current=!0,l("?"+h,f)},[l,o]);return[o,c]}var d7=0,f7=()=>`__${String(++d7)}__`;function h7(){let{router:e}=S_("useSubmit"),{basename:t}=m.useContext(ws),n=wI();return m.useCallback(async(r,o={})=>{let{action:l,method:c,encType:d,formData:f,body:h}=$I(r,t);if(o.navigate===!1){let g=o.fetcherKey||f7();await e.fetch(g,n,o.action||l,{preventScrollReset:o.preventScrollReset,formData:f,body:h,formMethod:o.method||c,formEncType:o.encType||d,flushSync:o.flushSync})}else await e.navigate(o.action||l,{preventScrollReset:o.preventScrollReset,formData:f,body:h,formMethod:o.method||c,formEncType:o.encType||d,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[e,t,n])}function m7(e,{relative:t}={}){let{basename:n}=m.useContext(ws),r=m.useContext(rs);xt(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),l={...jf(e||".",{relative:t})},c=Qs();if(e==null){l.search=c.search;let d=new URLSearchParams(l.search),f=d.getAll("index");if(f.some(g=>g==="")){d.delete("index"),f.filter(y=>y).forEach(y=>d.append("index",y));let g=d.toString();l.search=g?`?${g}`:""}}return(!e||e===".")&&o.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(l.pathname=l.pathname==="/"?n:$s([n,l.pathname])),Zs(l)}function p7(e,{relative:t}={}){let n=m.useContext(I1);xt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=S_("useViewTransitionState"),o=jf(e,{relative:t});if(!n.isTransitioning)return!1;let l=ts(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=ts(n.nextLocation.pathname,r)||n.nextLocation.pathname;return op(o.pathname,c)!=null||op(o.pathname,l)!=null}var ys=ZT();const g7=qT(ys);function y7(e){return m.createElement(AI,{flushSync:ys.flushSync,...e})}function mR(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Lr(...e){return t=>{let n=!1;const r=e.map(o=>{const l=mR(o,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let o=0;o<r.length;o++){const l=r[o];typeof l=="function"?l():mR(e[o],null)}}}}function dt(...e){return m.useCallback(Lr(...e),e)}var v7=Symbol.for("react.lazy"),cp=N1[" use ".trim().toString()];function x7(e){return typeof e=="object"&&e!==null&&"then"in e}function C_(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===v7&&"_payload"in e&&x7(e._payload)}function V1(e){const t=b7(e),n=m.forwardRef((r,o)=>{let{children:l,...c}=r;C_(l)&&typeof cp=="function"&&(l=cp(l._payload));const d=m.Children.toArray(l),f=d.find(C7);if(f){const h=f.props.children,g=d.map(y=>y===f?m.Children.count(h)>1?m.Children.only(null):m.isValidElement(h)?h.props.children:null:y);return s.jsx(t,{...c,ref:o,children:m.isValidElement(h)?m.cloneElement(h,void 0,g):null})}return s.jsx(t,{...c,ref:o,children:l})});return n.displayName=`${e}.Slot`,n}var tg=V1("Slot");function b7(e){const t=m.forwardRef((n,r)=>{let{children:o,...l}=n;if(C_(o)&&typeof cp=="function"&&(o=cp(o._payload)),m.isValidElement(o)){const c=w7(o),d=E7(l,o.props);return o.type!==m.Fragment&&(d.ref=r?Lr(r,c):c),m.cloneElement(o,d)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var S7=Symbol("radix.slottable");function C7(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===S7}function E7(e,t){const n={...t};for(const r in t){const o=e[r],l=t[r];/^on[A-Z]/.test(r)?o&&l?n[r]=(...d)=>{const f=l(...d);return o(...d),f}:o&&(n[r]=o):r==="style"?n[r]={...o,...l}:r==="className"&&(n[r]=[o,l].filter(Boolean).join(" "))}return{...e,...n}}function w7(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function E_(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=E_(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function w_(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=E_(e))&&(r&&(r+=" "),r+=t);return r}const pR=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,gR=w_,_f=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return gR(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:l}=t,c=Object.keys(o).map(h=>{const g=n==null?void 0:n[h],y=l==null?void 0:l[h];if(g===null)return null;const v=pR(g)||pR(y);return o[h][v]}),d=n&&Object.entries(n).reduce((h,g)=>{let[y,v]=g;return v===void 0||(h[y]=v),h},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((h,g)=>{let{class:y,className:v,...b}=g;return Object.entries(b).every(w=>{let[S,C]=w;return Array.isArray(C)?C.includes({...l,...d}[S]):{...l,...d}[S]===C})?[...h,y,v]:h},[]);return gR(e,c,f,n==null?void 0:n.class,n==null?void 0:n.className)};/**
62
+ * @license lucide-react v0.475.0 - ISC
63
+ *
64
+ * This source code is licensed under the ISC license.
65
+ * See the LICENSE file in the root directory of this source tree.
66
+ */const R7=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),R_=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
67
+ * @license lucide-react v0.475.0 - ISC
68
+ *
69
+ * This source code is licensed under the ISC license.
70
+ * See the LICENSE file in the root directory of this source tree.
71
+ */var j7={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
72
+ * @license lucide-react v0.475.0 - ISC
73
+ *
74
+ * This source code is licensed under the ISC license.
75
+ * See the LICENSE file in the root directory of this source tree.
76
+ */const T7=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:l,iconNode:c,...d},f)=>m.createElement("svg",{ref:f,...j7,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:R_("lucide",o),...d},[...c.map(([h,g])=>m.createElement(h,g)),...Array.isArray(l)?l:[l]]));/**
77
+ * @license lucide-react v0.475.0 - ISC
78
+ *
79
+ * This source code is licensed under the ISC license.
80
+ * See the LICENSE file in the root directory of this source tree.
81
+ */const Me=(e,t)=>{const n=m.forwardRef(({className:r,...o},l)=>m.createElement(T7,{ref:l,iconNode:t,className:R_(`lucide-${R7(e)}`,r),...o}));return n.displayName=`${e}`,n};/**
82
+ * @license lucide-react v0.475.0 - ISC
83
+ *
84
+ * This source code is licensed under the ISC license.
85
+ * See the LICENSE file in the root directory of this source tree.
86
+ */const _7=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]],z1=Me("ArchiveRestore",_7);/**
87
+ * @license lucide-react v0.475.0 - ISC
88
+ *
89
+ * This source code is licensed under the ISC license.
90
+ * See the LICENSE file in the root directory of this source tree.
91
+ */const N7=[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M15 4h5l-5 6h5",key:"8asdl1"}],["path",{d:"M15 20v-3.5a2.5 2.5 0 0 1 5 0V20",key:"r6l5cz"}],["path",{d:"M20 18h-5",key:"18j1r2"}]],yR=Me("ArrowDownZA",N7);/**
92
+ * @license lucide-react v0.475.0 - ISC
93
+ *
94
+ * This source code is licensed under the ISC license.
95
+ * See the LICENSE file in the root directory of this source tree.
96
+ */const A7=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],D7=Me("ArrowLeft",A7);/**
97
+ * @license lucide-react v0.475.0 - ISC
98
+ *
99
+ * This source code is licensed under the ISC license.
100
+ * See the LICENSE file in the root directory of this source tree.
101
+ */const O7=[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]],M7=Me("ArrowRightLeft",O7);/**
102
+ * @license lucide-react v0.475.0 - ISC
103
+ *
104
+ * This source code is licensed under the ISC license.
105
+ * See the LICENSE file in the root directory of this source tree.
106
+ */const I7=[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M20 8h-5",key:"1vsyxs"}],["path",{d:"M15 10V6.5a2.5 2.5 0 0 1 5 0V10",key:"ag13bf"}],["path",{d:"M15 14h5l-5 6h5",key:"ur5jdg"}]],vR=Me("ArrowUpAZ",I7);/**
107
+ * @license lucide-react v0.475.0 - ISC
108
+ *
109
+ * This source code is licensed under the ISC license.
110
+ * See the LICENSE file in the root directory of this source tree.
111
+ */const k7=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],xR=Me("ArrowUpDown",k7);/**
112
+ * @license lucide-react v0.475.0 - ISC
113
+ *
114
+ * This source code is licensed under the ISC license.
115
+ * See the LICENSE file in the root directory of this source tree.
116
+ */const L7=[["path",{d:"M12 6v12",key:"1vza4d"}],["path",{d:"M17.196 9 6.804 15",key:"1ah31z"}],["path",{d:"m6.804 9 10.392 6",key:"1b6pxd"}]],P7=Me("Asterisk",L7);/**
117
+ * @license lucide-react v0.475.0 - ISC
118
+ *
119
+ * This source code is licensed under the ISC license.
120
+ * See the LICENSE file in the root directory of this source tree.
121
+ */const U7=[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],F7=Me("BadgeAlert",U7);/**
122
+ * @license lucide-react v0.475.0 - ISC
123
+ *
124
+ * This source code is licensed under the ISC license.
125
+ * See the LICENSE file in the root directory of this source tree.
126
+ */const V7=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],z7=Me("BookOpen",V7);/**
127
+ * @license lucide-react v0.475.0 - ISC
128
+ *
129
+ * This source code is licensed under the ISC license.
130
+ * See the LICENSE file in the root directory of this source tree.
131
+ */const H7=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],up=Me("Box",H7);/**
132
+ * @license lucide-react v0.475.0 - ISC
133
+ *
134
+ * This source code is licensed under the ISC license.
135
+ * See the LICENSE file in the root directory of this source tree.
136
+ */const $7=[["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M16 6V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2",key:"1ksdt3"}],["path",{d:"M22 13a18.15 18.15 0 0 1-20 0",key:"12hx5q"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],B7=Me("BriefcaseBusiness",$7);/**
137
+ * @license lucide-react v0.475.0 - ISC
138
+ *
139
+ * This source code is licensed under the ISC license.
140
+ * See the LICENSE file in the root directory of this source tree.
141
+ */const G7=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],lr=Me("Check",G7);/**
142
+ * @license lucide-react v0.475.0 - ISC
143
+ *
144
+ * This source code is licensed under the ISC license.
145
+ * See the LICENSE file in the root directory of this source tree.
146
+ */const q7=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ka=Me("ChevronDown",q7);/**
147
+ * @license lucide-react v0.475.0 - ISC
148
+ *
149
+ * This source code is licensed under the ISC license.
150
+ * See the LICENSE file in the root directory of this source tree.
151
+ */const Z7=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],K7=Me("ChevronLeft",Z7);/**
152
+ * @license lucide-react v0.475.0 - ISC
153
+ *
154
+ * This source code is licensed under the ISC license.
155
+ * See the LICENSE file in the root directory of this source tree.
156
+ */const Y7=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],La=Me("ChevronRight",Y7);/**
157
+ * @license lucide-react v0.475.0 - ISC
158
+ *
159
+ * This source code is licensed under the ISC license.
160
+ * See the LICENSE file in the root directory of this source tree.
161
+ */const W7=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],ns=Me("ChevronUp",W7);/**
162
+ * @license lucide-react v0.475.0 - ISC
163
+ *
164
+ * This source code is licensed under the ISC license.
165
+ * See the LICENSE file in the root directory of this source tree.
166
+ */const Q7=[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]],X7=Me("ChevronsDownUp",Q7);/**
167
+ * @license lucide-react v0.475.0 - ISC
168
+ *
169
+ * This source code is licensed under the ISC license.
170
+ * See the LICENSE file in the root directory of this source tree.
171
+ */const J7=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],H1=Me("ChevronsUpDown",J7);/**
172
+ * @license lucide-react v0.475.0 - ISC
173
+ *
174
+ * This source code is licensed under the ISC license.
175
+ * See the LICENSE file in the root directory of this source tree.
176
+ */const ek=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Nf=Me("CircleAlert",ek);/**
177
+ * @license lucide-react v0.475.0 - ISC
178
+ *
179
+ * This source code is licensed under the ISC license.
180
+ * See the LICENSE file in the root directory of this source tree.
181
+ */const tk=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],nk=Me("CircleCheckBig",tk);/**
182
+ * @license lucide-react v0.475.0 - ISC
183
+ *
184
+ * This source code is licensed under the ISC license.
185
+ * See the LICENSE file in the root directory of this source tree.
186
+ */const rk=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],ng=Me("CircleCheck",rk);/**
187
+ * @license lucide-react v0.475.0 - ISC
188
+ *
189
+ * This source code is licensed under the ISC license.
190
+ * See the LICENSE file in the root directory of this source tree.
191
+ */const ak=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],dp=Me("CircleX",ak);/**
192
+ * @license lucide-react v0.475.0 - ISC
193
+ *
194
+ * This source code is licensed under the ISC license.
195
+ * See the LICENSE file in the root directory of this source tree.
196
+ */const sk=[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]],$1=Me("Code",sk);/**
197
+ * @license lucide-react v0.475.0 - ISC
198
+ *
199
+ * This source code is licensed under the ISC license.
200
+ * See the LICENSE file in the root directory of this source tree.
201
+ */const ok=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],ik=Me("Columns3",ok);/**
202
+ * @license lucide-react v0.475.0 - ISC
203
+ *
204
+ * This source code is licensed under the ISC license.
205
+ * See the LICENSE file in the root directory of this source tree.
206
+ */const lk=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],df=Me("Copy",lk);/**
207
+ * @license lucide-react v0.475.0 - ISC
208
+ *
209
+ * This source code is licensed under the ISC license.
210
+ * See the LICENSE file in the root directory of this source tree.
211
+ */const ck=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 15 21.84",key:"14ibmq"}],["path",{d:"M21 5V8",key:"1marbg"}],["path",{d:"M21 12L18 17H22L19 22",key:"zafso"}],["path",{d:"M3 12A9 3 0 0 0 14.59 14.87",key:"1y4wr8"}]],uk=Me("DatabaseZap",ck);/**
212
+ * @license lucide-react v0.475.0 - ISC
213
+ *
214
+ * This source code is licensed under the ISC license.
215
+ * See the LICENSE file in the root directory of this source tree.
216
+ */const dk=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],zl=Me("Database",dk);/**
217
+ * @license lucide-react v0.475.0 - ISC
218
+ *
219
+ * This source code is licensed under the ISC license.
220
+ * See the LICENSE file in the root directory of this source tree.
221
+ */const fk=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],hk=Me("Download",fk);/**
222
+ * @license lucide-react v0.475.0 - ISC
223
+ *
224
+ * This source code is licensed under the ISC license.
225
+ * See the LICENSE file in the root directory of this source tree.
226
+ */const mk=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],pk=Me("EllipsisVertical",mk);/**
227
+ * @license lucide-react v0.475.0 - ISC
228
+ *
229
+ * This source code is licensed under the ISC license.
230
+ * See the LICENSE file in the root directory of this source tree.
231
+ */const gk=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],pa=Me("Ellipsis",gk);/**
232
+ * @license lucide-react v0.475.0 - ISC
233
+ *
234
+ * This source code is licensed under the ISC license.
235
+ * See the LICENSE file in the root directory of this source tree.
236
+ */const yk=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Fo=Me("ExternalLink",yk);/**
237
+ * @license lucide-react v0.475.0 - ISC
238
+ *
239
+ * This source code is licensed under the ISC license.
240
+ * See the LICENSE file in the root directory of this source tree.
241
+ */const vk=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],xk=Me("EyeOff",vk);/**
242
+ * @license lucide-react v0.475.0 - ISC
243
+ *
244
+ * This source code is licensed under the ISC license.
245
+ * See the LICENSE file in the root directory of this source tree.
246
+ */const bk=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],j_=Me("Eye",bk);/**
247
+ * @license lucide-react v0.475.0 - ISC
248
+ *
249
+ * This source code is licensed under the ISC license.
250
+ * See the LICENSE file in the root directory of this source tree.
251
+ */const Sk=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Ck=Me("FileText",Sk);/**
252
+ * @license lucide-react v0.475.0 - ISC
253
+ *
254
+ * This source code is licensed under the ISC license.
255
+ * See the LICENSE file in the root directory of this source tree.
256
+ */const Ek=[["path",{d:"M6 3h12l4 6-10 13L2 9Z",key:"1pcd5k"}],["path",{d:"M11 3 8 9l4 13 4-13-3-6",key:"1fcu3u"}],["path",{d:"M2 9h20",key:"16fsjt"}]],bR=Me("Gem",Ek);/**
257
+ * @license lucide-react v0.475.0 - ISC
258
+ *
259
+ * This source code is licensed under the ISC license.
260
+ * See the LICENSE file in the root directory of this source tree.
261
+ */const wk=[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]],Rk=Me("GraduationCap",wk);/**
262
+ * @license lucide-react v0.475.0 - ISC
263
+ *
264
+ * This source code is licensed under the ISC license.
265
+ * See the LICENSE file in the root directory of this source tree.
266
+ */const jk=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Tk=Me("GripVertical",jk);/**
267
+ * @license lucide-react v0.475.0 - ISC
268
+ *
269
+ * This source code is licensed under the ISC license.
270
+ * See the LICENSE file in the root directory of this source tree.
271
+ */const _k=[["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"19",cy:"5",r:"1",key:"w8mnmm"}],["circle",{cx:"5",cy:"5",r:"1",key:"lttvr7"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}],["circle",{cx:"19",cy:"19",r:"1",key:"shf9b7"}],["circle",{cx:"5",cy:"19",r:"1",key:"bfqh0e"}]],Nk=Me("Grip",_k);/**
272
+ * @license lucide-react v0.475.0 - ISC
273
+ *
274
+ * This source code is licensed under the ISC license.
275
+ * See the LICENSE file in the root directory of this source tree.
276
+ */const Ak=[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]],Dk=Me("Hand",Ak);/**
277
+ * @license lucide-react v0.475.0 - ISC
278
+ *
279
+ * This source code is licensed under the ISC license.
280
+ * See the LICENSE file in the root directory of this source tree.
281
+ */const Ok=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Mk=Me("History",Ok);/**
282
+ * @license lucide-react v0.475.0 - ISC
283
+ *
284
+ * This source code is licensed under the ISC license.
285
+ * See the LICENSE file in the root directory of this source tree.
286
+ */const Ik=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Br=Me("Info",Ik);/**
287
+ * @license lucide-react v0.475.0 - ISC
288
+ *
289
+ * This source code is licensed under the ISC license.
290
+ * See the LICENSE file in the root directory of this source tree.
291
+ */const kk=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],R0=Me("KeyRound",kk);/**
292
+ * @license lucide-react v0.475.0 - ISC
293
+ *
294
+ * This source code is licensed under the ISC license.
295
+ * See the LICENSE file in the root directory of this source tree.
296
+ */const Lk=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Af=Me("LoaderCircle",Lk);/**
297
+ * @license lucide-react v0.475.0 - ISC
298
+ *
299
+ * This source code is licensed under the ISC license.
300
+ * See the LICENSE file in the root directory of this source tree.
301
+ */const Pk=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Uk=Me("Lock",Pk);/**
302
+ * @license lucide-react v0.475.0 - ISC
303
+ *
304
+ * This source code is licensed under the ISC license.
305
+ * See the LICENSE file in the root directory of this source tree.
306
+ */const Fk=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],Vk=Me("LogOut",Fk);/**
307
+ * @license lucide-react v0.475.0 - ISC
308
+ *
309
+ * This source code is licensed under the ISC license.
310
+ * See the LICENSE file in the root directory of this source tree.
311
+ */const zk=[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]],Hk=Me("Menu",zk);/**
312
+ * @license lucide-react v0.475.0 - ISC
313
+ *
314
+ * This source code is licensed under the ISC license.
315
+ * See the LICENSE file in the root directory of this source tree.
316
+ */const $k=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Bk=Me("MessageCircleQuestion",$k);/**
317
+ * @license lucide-react v0.475.0 - ISC
318
+ *
319
+ * This source code is licensed under the ISC license.
320
+ * See the LICENSE file in the root directory of this source tree.
321
+ */const Gk=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],qk=Me("MessageCircle",Gk);/**
322
+ * @license lucide-react v0.475.0 - ISC
323
+ *
324
+ * This source code is licensed under the ISC license.
325
+ * See the LICENSE file in the root directory of this source tree.
326
+ */const Zk=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],T_=Me("Monitor",Zk);/**
327
+ * @license lucide-react v0.475.0 - ISC
328
+ *
329
+ * This source code is licensed under the ISC license.
330
+ * See the LICENSE file in the root directory of this source tree.
331
+ */const Kk=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],__=Me("Moon",Kk);/**
332
+ * @license lucide-react v0.475.0 - ISC
333
+ *
334
+ * This source code is licensed under the ISC license.
335
+ * See the LICENSE file in the root directory of this source tree.
336
+ */const Yk=[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]],Wk=Me("OctagonAlert",Yk);/**
337
+ * @license lucide-react v0.475.0 - ISC
338
+ *
339
+ * This source code is licensed under the ISC license.
340
+ * See the LICENSE file in the root directory of this source tree.
341
+ */const Qk=[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Xk=Me("OctagonX",Qk);/**
342
+ * @license lucide-react v0.475.0 - ISC
343
+ *
344
+ * This source code is licensed under the ISC license.
345
+ * See the LICENSE file in the root directory of this source tree.
346
+ */const Jk=[["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["circle",{cx:"18.5",cy:"15.5",r:"2.5",key:"b5zd12"}],["path",{d:"M20.27 17.27 22 19",key:"1l4muz"}]],eL=Me("PackageSearch",Jk);/**
347
+ * @license lucide-react v0.475.0 - ISC
348
+ *
349
+ * This source code is licensed under the ISC license.
350
+ * See the LICENSE file in the root directory of this source tree.
351
+ */const tL=[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]],nL=Me("PenLine",tL);/**
352
+ * @license lucide-react v0.475.0 - ISC
353
+ *
354
+ * This source code is licensed under the ISC license.
355
+ * See the LICENSE file in the root directory of this source tree.
356
+ */const rL=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Au=Me("Pencil",rL);/**
357
+ * @license lucide-react v0.475.0 - ISC
358
+ *
359
+ * This source code is licensed under the ISC license.
360
+ * See the LICENSE file in the root directory of this source tree.
361
+ */const aL=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],rg=Me("Play",aL);/**
362
+ * @license lucide-react v0.475.0 - ISC
363
+ *
364
+ * This source code is licensed under the ISC license.
365
+ * See the LICENSE file in the root directory of this source tree.
366
+ */const sL=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]],B1=Me("Plug",sL);/**
367
+ * @license lucide-react v0.475.0 - ISC
368
+ *
369
+ * This source code is licensed under the ISC license.
370
+ * See the LICENSE file in the root directory of this source tree.
371
+ */const oL=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Pa=Me("Plus",oL);/**
372
+ * @license lucide-react v0.475.0 - ISC
373
+ *
374
+ * This source code is licensed under the ISC license.
375
+ * See the LICENSE file in the root directory of this source tree.
376
+ */const iL=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],lL=Me("RefreshCw",iL);/**
377
+ * @license lucide-react v0.475.0 - ISC
378
+ *
379
+ * This source code is licensed under the ISC license.
380
+ * See the LICENSE file in the root directory of this source tree.
381
+ */const cL=[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]],uL=Me("Scale",cL);/**
382
+ * @license lucide-react v0.475.0 - ISC
383
+ *
384
+ * This source code is licensed under the ISC license.
385
+ * See the LICENSE file in the root directory of this source tree.
386
+ */const dL=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Jl=Me("Search",dL);/**
387
+ * @license lucide-react v0.475.0 - ISC
388
+ *
389
+ * This source code is licensed under the ISC license.
390
+ * See the LICENSE file in the root directory of this source tree.
391
+ */const fL=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],N_=Me("Settings",fL);/**
392
+ * @license lucide-react v0.475.0 - ISC
393
+ *
394
+ * This source code is licensed under the ISC license.
395
+ * See the LICENSE file in the root directory of this source tree.
396
+ */const hL=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m9 8 6 4-6 4Z",key:"f1r3lt"}]],mL=Me("SquarePlay",hL);/**
397
+ * @license lucide-react v0.475.0 - ISC
398
+ *
399
+ * This source code is licensed under the ISC license.
400
+ * See the LICENSE file in the root directory of this source tree.
401
+ */const pL=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],A_=Me("Sun",pL);/**
402
+ * @license lucide-react v0.475.0 - ISC
403
+ *
404
+ * This source code is licensed under the ISC license.
405
+ * See the LICENSE file in the root directory of this source tree.
406
+ */const gL=[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]],yL=Me("Table",gL);/**
407
+ * @license lucide-react v0.475.0 - ISC
408
+ *
409
+ * This source code is licensed under the ISC license.
410
+ * See the LICENSE file in the root directory of this source tree.
411
+ */const vL=[["path",{d:"m10.065 12.493-6.18 1.318a.934.934 0 0 1-1.108-.702l-.537-2.15a1.07 1.07 0 0 1 .691-1.265l13.504-4.44",key:"k4qptu"}],["path",{d:"m13.56 11.747 4.332-.924",key:"19l80z"}],["path",{d:"m16 21-3.105-6.21",key:"7oh9d"}],["path",{d:"M16.485 5.94a2 2 0 0 1 1.455-2.425l1.09-.272a1 1 0 0 1 1.212.727l1.515 6.06a1 1 0 0 1-.727 1.213l-1.09.272a2 2 0 0 1-2.425-1.455z",key:"m7xp4m"}],["path",{d:"m6.158 8.633 1.114 4.456",key:"74o979"}],["path",{d:"m8 21 3.105-6.21",key:"1fvxut"}],["circle",{cx:"12",cy:"13",r:"2",key:"1c1ljs"}]],xL=Me("Telescope",vL);/**
412
+ * @license lucide-react v0.475.0 - ISC
413
+ *
414
+ * This source code is licensed under the ISC license.
415
+ * See the LICENSE file in the root directory of this source tree.
416
+ */const bL=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],G1=Me("Timer",bL);/**
417
+ * @license lucide-react v0.475.0 - ISC
418
+ *
419
+ * This source code is licensed under the ISC license.
420
+ * See the LICENSE file in the root directory of this source tree.
421
+ */const SL=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],Xs=Me("Trash2",SL);/**
422
+ * @license lucide-react v0.475.0 - ISC
423
+ *
424
+ * This source code is licensed under the ISC license.
425
+ * See the LICENSE file in the root directory of this source tree.
426
+ */const CL=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],ag=Me("TriangleAlert",CL);/**
427
+ * @license lucide-react v0.475.0 - ISC
428
+ *
429
+ * This source code is licensed under the ISC license.
430
+ * See the LICENSE file in the root directory of this source tree.
431
+ */const EL=[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]],ff=Me("Unplug",EL);/**
432
+ * @license lucide-react v0.475.0 - ISC
433
+ *
434
+ * This source code is licensed under the ISC license.
435
+ * See the LICENSE file in the root directory of this source tree.
436
+ */const wL=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]],SR=Me("Users",wL);/**
437
+ * @license lucide-react v0.475.0 - ISC
438
+ *
439
+ * This source code is licensed under the ISC license.
440
+ * See the LICENSE file in the root directory of this source tree.
441
+ */const RL=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],xu=Me("X",RL),Ex=768;function jL(){const[e,t]=m.useState(void 0);return m.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Ex-1}px)`),r=()=>{t(window.innerWidth<Ex)};return n.addEventListener("change",r),t(window.innerWidth<Ex),()=>n.removeEventListener("change",r)},[]),!!e}const TL=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},_L=(e,t)=>({classGroupId:e,validator:t}),D_=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),fp="-",CR=[],NL="arbitrary..",AL=e=>{const t=OL(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return DL(c);const d=c.split(fp),f=d[0]===""&&d.length>1?1:0;return O_(d,f,t)},getConflictingClassGroupIds:(c,d)=>{if(d){const f=r[c],h=n[c];return f?h?TL(h,f):f:h||CR}return n[c]||CR}}},O_=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],l=n.nextPart.get(o);if(l){const h=O_(e,t+1,l);if(h)return h}const c=n.validators;if(c===null)return;const d=t===0?e.join(fp):e.slice(t).join(fp),f=c.length;for(let h=0;h<f;h++){const g=c[h];if(g.validator(d))return g.classGroupId}},DL=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?NL+r:void 0})(),OL=e=>{const{theme:t,classGroups:n}=e;return ML(n,t)},ML=(e,t)=>{const n=D_();for(const r in e){const o=e[r];q1(o,n,r,t)}return n},q1=(e,t,n,r)=>{const o=e.length;for(let l=0;l<o;l++){const c=e[l];IL(c,t,n,r)}},IL=(e,t,n,r)=>{if(typeof e=="string"){kL(e,t,n);return}if(typeof e=="function"){LL(e,t,n,r);return}PL(e,t,n,r)},kL=(e,t,n)=>{const r=e===""?t:M_(t,e);r.classGroupId=n},LL=(e,t,n,r)=>{if(UL(e)){q1(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(_L(n,e))},PL=(e,t,n,r)=>{const o=Object.entries(e),l=o.length;for(let c=0;c<l;c++){const[d,f]=o[c];q1(f,M_(t,d),n,r)}},M_=(e,t)=>{let n=e;const r=t.split(fp),o=r.length;for(let l=0;l<o;l++){const c=r[l];let d=n.nextPart.get(c);d||(d=D_(),n.nextPart.set(c,d)),n=d}return n},UL=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,FL=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(l,c)=>{n[l]=c,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(l){let c=n[l];if(c!==void 0)return c;if((c=r[l])!==void 0)return o(l,c),c},set(l,c){l in n?n[l]=c:o(l,c)}}},j0="!",ER=":",VL=[],wR=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),zL=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const l=[];let c=0,d=0,f=0,h;const g=o.length;for(let S=0;S<g;S++){const C=o[S];if(c===0&&d===0){if(C===ER){l.push(o.slice(f,S)),f=S+1;continue}if(C==="/"){h=S;continue}}C==="["?c++:C==="]"?c--:C==="("?d++:C===")"&&d--}const y=l.length===0?o:o.slice(f);let v=y,b=!1;y.endsWith(j0)?(v=y.slice(0,-1),b=!0):y.startsWith(j0)&&(v=y.slice(1),b=!0);const w=h&&h>f?h-f:void 0;return wR(l,b,v,w)};if(t){const o=t+ER,l=r;r=c=>c.startsWith(o)?l(c.slice(o.length)):wR(VL,!1,c,void 0,!0)}if(n){const o=r;r=l=>n({className:l,parseClassName:o})}return r},HL=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let l=0;l<n.length;l++){const c=n[l],d=c[0]==="[",f=t.has(c);d||f?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(c)):o.push(c)}return o.length>0&&(o.sort(),r.push(...o)),r}},$L=e=>({cache:FL(e.cacheSize),parseClassName:zL(e),sortModifiers:HL(e),...AL(e)}),BL=/\s+/,GL=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:l}=t,c=[],d=e.trim().split(BL);let f="";for(let h=d.length-1;h>=0;h-=1){const g=d[h],{isExternal:y,modifiers:v,hasImportantModifier:b,baseClassName:w,maybePostfixModifierPosition:S}=n(g);if(y){f=g+(f.length>0?" "+f:f);continue}let C=!!S,R=r(C?w.substring(0,S):w);if(!R){if(!C){f=g+(f.length>0?" "+f:f);continue}if(R=r(w),!R){f=g+(f.length>0?" "+f:f);continue}C=!1}const j=v.length===0?"":v.length===1?v[0]:l(v).join(":"),_=b?j+j0:j,D=_+R;if(c.indexOf(D)>-1)continue;c.push(D);const A=o(R,C);for(let O=0;O<A.length;++O){const T=A[O];c.push(_+T)}f=g+(f.length>0?" "+f:f)}return f},qL=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=I_(n))&&(o&&(o+=" "),o+=r);return o},I_=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=I_(e[r]))&&(n&&(n+=" "),n+=t);return n},ZL=(e,...t)=>{let n,r,o,l;const c=f=>{const h=t.reduce((g,y)=>y(g),e());return n=$L(h),r=n.cache.get,o=n.cache.set,l=d,d(f)},d=f=>{const h=r(f);if(h)return h;const g=GL(f,n);return o(f,g),g};return l=c,(...f)=>l(qL(...f))},KL=[],rr=e=>{const t=n=>n[e]||KL;return t.isThemeGetter=!0,t},k_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,L_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,YL=/^\d+\/\d+$/,WL=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,QL=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,XL=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,JL=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,eP=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Gc=e=>YL.test(e),vt=e=>!!e&&!Number.isNaN(Number(e)),ji=e=>!!e&&Number.isInteger(Number(e)),wx=e=>e.endsWith("%")&&vt(e.slice(0,-1)),Eo=e=>WL.test(e),tP=()=>!0,nP=e=>QL.test(e)&&!XL.test(e),P_=()=>!1,rP=e=>JL.test(e),aP=e=>eP.test(e),sP=e=>!Ke(e)&&!Ye(e),oP=e=>Du(e,V_,P_),Ke=e=>k_.test(e),Tl=e=>Du(e,z_,nP),Rx=e=>Du(e,dP,vt),RR=e=>Du(e,U_,P_),iP=e=>Du(e,F_,aP),bm=e=>Du(e,H_,rP),Ye=e=>L_.test(e),Fd=e=>Ou(e,z_),lP=e=>Ou(e,fP),jR=e=>Ou(e,U_),cP=e=>Ou(e,V_),uP=e=>Ou(e,F_),Sm=e=>Ou(e,H_,!0),Du=(e,t,n)=>{const r=k_.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ou=(e,t,n=!1)=>{const r=L_.exec(e);return r?r[1]?t(r[1]):n:!1},U_=e=>e==="position"||e==="percentage",F_=e=>e==="image"||e==="url",V_=e=>e==="length"||e==="size"||e==="bg-size",z_=e=>e==="length",dP=e=>e==="number",fP=e=>e==="family-name",H_=e=>e==="shadow",hP=()=>{const e=rr("color"),t=rr("font"),n=rr("text"),r=rr("font-weight"),o=rr("tracking"),l=rr("leading"),c=rr("breakpoint"),d=rr("container"),f=rr("spacing"),h=rr("radius"),g=rr("shadow"),y=rr("inset-shadow"),v=rr("text-shadow"),b=rr("drop-shadow"),w=rr("blur"),S=rr("perspective"),C=rr("aspect"),R=rr("ease"),j=rr("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],A=()=>[...D(),Ye,Ke],O=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],M=()=>[Ye,Ke,f],F=()=>[Gc,"full","auto",...M()],G=()=>[ji,"none","subgrid",Ye,Ke],Y=()=>["auto",{span:["full",ji,Ye,Ke]},ji,Ye,Ke],Z=()=>[ji,"auto",Ye,Ke],J=()=>["auto","min","max","fr",Ye,Ke],H=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],K=()=>["start","end","center","stretch","center-safe","end-safe"],k=()=>["auto",...M()],z=()=>[Gc,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],B=()=>[e,Ye,Ke],ie=()=>[...D(),jR,RR,{position:[Ye,Ke]}],xe=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",cP,oP,{size:[Ye,Ke]}],P=()=>[wx,Fd,Tl],q=()=>["","none","full",h,Ye,Ke],te=()=>["",vt,Fd,Tl],ue=()=>["solid","dashed","dotted","double"],ve=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],le=()=>[vt,wx,jR,RR],Ae=()=>["","none",w,Ye,Ke],we=()=>["none",vt,Ye,Ke],Ne=()=>["none",vt,Ye,Ke],Be=()=>[vt,Ye,Ke],Qe=()=>[Gc,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Eo],breakpoint:[Eo],color:[tP],container:[Eo],"drop-shadow":[Eo],ease:["in","out","in-out"],font:[sP],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Eo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Eo],shadow:[Eo],spacing:["px",vt],text:[Eo],"text-shadow":[Eo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Gc,Ke,Ye,C]}],container:["container"],columns:[{columns:[vt,Ke,Ye,d]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:A()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:F()}],"inset-x":[{"inset-x":F()}],"inset-y":[{"inset-y":F()}],start:[{start:F()}],end:[{end:F()}],top:[{top:F()}],right:[{right:F()}],bottom:[{bottom:F()}],left:[{left:F()}],visibility:["visible","invisible","collapse"],z:[{z:[ji,"auto",Ye,Ke]}],basis:[{basis:[Gc,"full","auto",d,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[vt,Gc,"auto","initial","none",Ke]}],grow:[{grow:["",vt,Ye,Ke]}],shrink:[{shrink:["",vt,Ye,Ke]}],order:[{order:[ji,"first","last","none",Ye,Ke]}],"grid-cols":[{"grid-cols":G()}],"col-start-end":[{col:Y()}],"col-start":[{"col-start":Z()}],"col-end":[{"col-end":Z()}],"grid-rows":[{"grid-rows":G()}],"row-start-end":[{row:Y()}],"row-start":[{"row-start":Z()}],"row-end":[{"row-end":Z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":J()}],"auto-rows":[{"auto-rows":J()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...H(),"normal"]}],"justify-items":[{"justify-items":[...K(),"normal"]}],"justify-self":[{"justify-self":["auto",...K()]}],"align-content":[{content:["normal",...H()]}],"align-items":[{items:[...K(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...K(),{baseline:["","last"]}]}],"place-content":[{"place-content":H()}],"place-items":[{"place-items":[...K(),"baseline"]}],"place-self":[{"place-self":["auto",...K()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:k()}],mx:[{mx:k()}],my:[{my:k()}],ms:[{ms:k()}],me:[{me:k()}],mt:[{mt:k()}],mr:[{mr:k()}],mb:[{mb:k()}],ml:[{ml:k()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:z()}],w:[{w:[d,"screen",...z()]}],"min-w":[{"min-w":[d,"screen","none",...z()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[c]},...z()]}],h:[{h:["screen","lh",...z()]}],"min-h":[{"min-h":["screen","lh","none",...z()]}],"max-h":[{"max-h":["screen","lh",...z()]}],"font-size":[{text:["base",n,Fd,Tl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Ye,Rx]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",wx,Ke]}],"font-family":[{font:[lP,Ke,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,Ye,Ke]}],"line-clamp":[{"line-clamp":[vt,"none",Ye,Rx]}],leading:[{leading:[l,...M()]}],"list-image":[{"list-image":["none",Ye,Ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ye,Ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ue(),"wavy"]}],"text-decoration-thickness":[{decoration:[vt,"from-font","auto",Ye,Tl]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[vt,"auto",Ye,Ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ye,Ke]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ye,Ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ie()}],"bg-repeat":[{bg:xe()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ji,Ye,Ke],radial:["",Ye,Ke],conic:[ji,Ye,Ke]},uP,iP]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:q()}],"rounded-s":[{"rounded-s":q()}],"rounded-e":[{"rounded-e":q()}],"rounded-t":[{"rounded-t":q()}],"rounded-r":[{"rounded-r":q()}],"rounded-b":[{"rounded-b":q()}],"rounded-l":[{"rounded-l":q()}],"rounded-ss":[{"rounded-ss":q()}],"rounded-se":[{"rounded-se":q()}],"rounded-ee":[{"rounded-ee":q()}],"rounded-es":[{"rounded-es":q()}],"rounded-tl":[{"rounded-tl":q()}],"rounded-tr":[{"rounded-tr":q()}],"rounded-br":[{"rounded-br":q()}],"rounded-bl":[{"rounded-bl":q()}],"border-w":[{border:te()}],"border-w-x":[{"border-x":te()}],"border-w-y":[{"border-y":te()}],"border-w-s":[{"border-s":te()}],"border-w-e":[{"border-e":te()}],"border-w-t":[{"border-t":te()}],"border-w-r":[{"border-r":te()}],"border-w-b":[{"border-b":te()}],"border-w-l":[{"border-l":te()}],"divide-x":[{"divide-x":te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ue(),"hidden","none"]}],"divide-style":[{divide:[...ue(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...ue(),"none","hidden"]}],"outline-offset":[{"outline-offset":[vt,Ye,Ke]}],"outline-w":[{outline:["",vt,Fd,Tl]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","none",g,Sm,bm]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",y,Sm,bm]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[vt,Tl]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",v,Sm,bm]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[vt,Ye,Ke]}],"mix-blend":[{"mix-blend":[...ve(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ve()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[vt]}],"mask-image-linear-from-pos":[{"mask-linear-from":le()}],"mask-image-linear-to-pos":[{"mask-linear-to":le()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":le()}],"mask-image-t-to-pos":[{"mask-t-to":le()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":le()}],"mask-image-r-to-pos":[{"mask-r-to":le()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":le()}],"mask-image-b-to-pos":[{"mask-b-to":le()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":le()}],"mask-image-l-to-pos":[{"mask-l-to":le()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":le()}],"mask-image-x-to-pos":[{"mask-x-to":le()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":le()}],"mask-image-y-to-pos":[{"mask-y-to":le()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[Ye,Ke]}],"mask-image-radial-from-pos":[{"mask-radial-from":le()}],"mask-image-radial-to-pos":[{"mask-radial-to":le()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":D()}],"mask-image-conic-pos":[{"mask-conic":[vt]}],"mask-image-conic-from-pos":[{"mask-conic-from":le()}],"mask-image-conic-to-pos":[{"mask-conic-to":le()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ie()}],"mask-repeat":[{mask:xe()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ye,Ke]}],filter:[{filter:["","none",Ye,Ke]}],blur:[{blur:Ae()}],brightness:[{brightness:[vt,Ye,Ke]}],contrast:[{contrast:[vt,Ye,Ke]}],"drop-shadow":[{"drop-shadow":["","none",b,Sm,bm]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",vt,Ye,Ke]}],"hue-rotate":[{"hue-rotate":[vt,Ye,Ke]}],invert:[{invert:["",vt,Ye,Ke]}],saturate:[{saturate:[vt,Ye,Ke]}],sepia:[{sepia:["",vt,Ye,Ke]}],"backdrop-filter":[{"backdrop-filter":["","none",Ye,Ke]}],"backdrop-blur":[{"backdrop-blur":Ae()}],"backdrop-brightness":[{"backdrop-brightness":[vt,Ye,Ke]}],"backdrop-contrast":[{"backdrop-contrast":[vt,Ye,Ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",vt,Ye,Ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[vt,Ye,Ke]}],"backdrop-invert":[{"backdrop-invert":["",vt,Ye,Ke]}],"backdrop-opacity":[{"backdrop-opacity":[vt,Ye,Ke]}],"backdrop-saturate":[{"backdrop-saturate":[vt,Ye,Ke]}],"backdrop-sepia":[{"backdrop-sepia":["",vt,Ye,Ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ye,Ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[vt,"initial",Ye,Ke]}],ease:[{ease:["linear","initial",R,Ye,Ke]}],delay:[{delay:[vt,Ye,Ke]}],animate:[{animate:["none",j,Ye,Ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Ye,Ke]}],"perspective-origin":[{"perspective-origin":A()}],rotate:[{rotate:we()}],"rotate-x":[{"rotate-x":we()}],"rotate-y":[{"rotate-y":we()}],"rotate-z":[{"rotate-z":we()}],scale:[{scale:Ne()}],"scale-x":[{"scale-x":Ne()}],"scale-y":[{"scale-y":Ne()}],"scale-z":[{"scale-z":Ne()}],"scale-3d":["scale-3d"],skew:[{skew:Be()}],"skew-x":[{"skew-x":Be()}],"skew-y":[{"skew-y":Be()}],transform:[{transform:[Ye,Ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Qe()}],"translate-x":[{"translate-x":Qe()}],"translate-y":[{"translate-y":Qe()}],"translate-z":[{"translate-z":Qe()}],"translate-none":["translate-none"],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ye,Ke]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ye,Ke]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[vt,Fd,Tl,Rx]}],stroke:[{stroke:["none",...B()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},mP=ZL(hP);function ne(...e){return mP(w_(e))}const Z1=_f("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-white/4 dark:hover:bg-white/8",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-white/8",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function Se({className:e,variant:t,size:n,asChild:r=!1,...o}){const l=r?tg:"button";return s.jsx(l,{"data-slot":"button",className:ne(Z1({variant:t,size:n,className:e})),...o})}function Ht({className:e,type:t,...n}){return s.jsx("input",{type:t,"data-slot":"input",className:ne("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...n})}var pP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],gP=pP.reduce((e,t)=>{const n=V1(`Primitive.${t}`),r=m.forwardRef((o,l)=>{const{asChild:c,...d}=o,f=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(f,{...d,ref:l})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),yP="Separator",TR="horizontal",vP=["horizontal","vertical"],$_=m.forwardRef((e,t)=>{const{decorative:n,orientation:r=TR,...o}=e,l=xP(r)?r:TR,d=n?{role:"none"}:{"aria-orientation":l==="vertical"?l:void 0,role:"separator"};return s.jsx(gP.div,{"data-orientation":l,...d,...o,ref:t})});$_.displayName=yP;function xP(e){return vP.includes(e)}var bP=$_;function B_({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return s.jsx(bP,{"data-slot":"separator",decorative:n,orientation:t,className:ne("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}function Te(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function SP(e,t){const n=m.createContext(t),r=l=>{const{children:c,...d}=l,f=m.useMemo(()=>d,Object.values(d));return s.jsx(n.Provider,{value:f,children:c})};r.displayName=e+"Provider";function o(l){const c=m.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${l}\` must be used within \`${e}\``)}return[r,o]}function cr(e,t=[]){let n=[];function r(l,c){const d=m.createContext(c),f=n.length;n=[...n,c];const h=y=>{var R;const{scope:v,children:b,...w}=y,S=((R=v==null?void 0:v[e])==null?void 0:R[f])||d,C=m.useMemo(()=>w,Object.values(w));return s.jsx(S.Provider,{value:C,children:b})};h.displayName=l+"Provider";function g(y,v){var S;const b=((S=v==null?void 0:v[e])==null?void 0:S[f])||d,w=m.useContext(b);if(w)return w;if(c!==void 0)return c;throw new Error(`\`${y}\` must be used within \`${l}\``)}return[h,g]}const o=()=>{const l=n.map(c=>m.createContext(c));return function(d){const f=(d==null?void 0:d[e])||l;return m.useMemo(()=>({[`__scope${e}`]:{...d,[e]:f}}),[d,f])}};return o.scopeName=e,[r,CP(o,...t)]}function CP(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(l){const c=r.reduce((d,{useScope:f,scopeName:h})=>{const y=f(l)[`__scope${h}`];return{...d,...y}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var jr=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},EP=N1[" useId ".trim().toString()]||(()=>{}),wP=0;function Ln(e){const[t,n]=m.useState(EP());return jr(()=>{n(r=>r??String(wP++))},[e]),e||(t?`radix-${t}`:"")}var RP=N1[" useInsertionEffect ".trim().toString()]||jr;function Gr({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,l,c]=jP({defaultProp:t,onChange:n}),d=e!==void 0,f=d?e:o;{const g=m.useRef(e!==void 0);m.useEffect(()=>{const y=g.current;y!==d&&console.warn(`${r} is changing from ${y?"controlled":"uncontrolled"} to ${d?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),g.current=d},[d,r])}const h=m.useCallback(g=>{var y;if(d){const v=TP(g)?g(e):g;v!==e&&((y=c.current)==null||y.call(c,v))}else l(g)},[d,e,l,c]);return[f,h]}function jP({defaultProp:e,onChange:t}){const[n,r]=m.useState(e),o=m.useRef(n),l=m.useRef(t);return RP(()=>{l.current=t},[t]),m.useEffect(()=>{var c;o.current!==n&&((c=l.current)==null||c.call(l,n),o.current=n)},[n,o]),[n,r,l]}function TP(e){return typeof e=="function"}function _P(e){const t=NP(e),n=m.forwardRef((r,o)=>{const{children:l,...c}=r,d=m.Children.toArray(l),f=d.find(DP);if(f){const h=f.props.children,g=d.map(y=>y===f?m.Children.count(h)>1?m.Children.only(null):m.isValidElement(h)?h.props.children:null:y);return s.jsx(t,{...c,ref:o,children:m.isValidElement(h)?m.cloneElement(h,void 0,g):null})}return s.jsx(t,{...c,ref:o,children:l})});return n.displayName=`${e}.Slot`,n}function NP(e){const t=m.forwardRef((n,r)=>{const{children:o,...l}=n;if(m.isValidElement(o)){const c=MP(o),d=OP(l,o.props);return o.type!==m.Fragment&&(d.ref=r?Lr(r,c):c),m.cloneElement(o,d)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var AP=Symbol("radix.slottable");function DP(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===AP}function OP(e,t){const n={...t};for(const r in t){const o=e[r],l=t[r];/^on[A-Z]/.test(r)?o&&l?n[r]=(...d)=>{const f=l(...d);return o(...d),f}:o&&(n[r]=o):r==="style"?n[r]={...o,...l}:r==="className"&&(n[r]=[o,l].filter(Boolean).join(" "))}return{...e,...n}}function MP(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var IP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],et=IP.reduce((e,t)=>{const n=_P(`Primitive.${t}`),r=m.forwardRef((o,l)=>{const{asChild:c,...d}=o,f=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(f,{...d,ref:l})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function G_(e,t){e&&ys.flushSync(()=>e.dispatchEvent(t))}function bs(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function kP(e,t=globalThis==null?void 0:globalThis.document){const n=bs(e);m.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var LP="DismissableLayer",T0="dismissableLayer.update",PP="dismissableLayer.pointerDownOutside",UP="dismissableLayer.focusOutside",_R,q_=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ec=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:c,onDismiss:d,...f}=e,h=m.useContext(q_),[g,y]=m.useState(null),v=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=m.useState({}),w=dt(t,T=>y(T)),S=Array.from(h.layers),[C]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),R=S.indexOf(C),j=g?S.indexOf(g):-1,_=h.layersWithOutsidePointerEventsDisabled.size>0,D=j>=R,A=zP(T=>{const M=T.target,F=[...h.branches].some(G=>G.contains(M));!D||F||(o==null||o(T),c==null||c(T),T.defaultPrevented||d==null||d())},v),O=HP(T=>{const M=T.target;[...h.branches].some(G=>G.contains(M))||(l==null||l(T),c==null||c(T),T.defaultPrevented||d==null||d())},v);return kP(T=>{j===h.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&d&&(T.preventDefault(),d()))},v),m.useEffect(()=>{if(g)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(_R=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(g)),h.layers.add(g),NR(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=_R)}},[g,v,n,h]),m.useEffect(()=>()=>{g&&(h.layers.delete(g),h.layersWithOutsidePointerEventsDisabled.delete(g),NR())},[g,h]),m.useEffect(()=>{const T=()=>b({});return document.addEventListener(T0,T),()=>document.removeEventListener(T0,T)},[]),s.jsx(et.div,{...f,ref:w,style:{pointerEvents:_?D?"auto":"none":void 0,...e.style},onFocusCapture:Te(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Te(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Te(e.onPointerDownCapture,A.onPointerDownCapture)})});ec.displayName=LP;var FP="DismissableLayerBranch",VP=m.forwardRef((e,t)=>{const n=m.useContext(q_),r=m.useRef(null),o=dt(t,r);return m.useEffect(()=>{const l=r.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),s.jsx(et.div,{...e,ref:o})});VP.displayName=FP;function zP(e,t=globalThis==null?void 0:globalThis.document){const n=bs(e),r=m.useRef(!1),o=m.useRef(()=>{});return m.useEffect(()=>{const l=d=>{if(d.target&&!r.current){let f=function(){Z_(PP,n,h,{discrete:!0})};const h={originalEvent:d};d.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=f,t.addEventListener("click",o.current,{once:!0})):f()}else t.removeEventListener("click",o.current);r.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",l),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function HP(e,t=globalThis==null?void 0:globalThis.document){const n=bs(e),r=m.useRef(!1);return m.useEffect(()=>{const o=l=>{l.target&&!r.current&&Z_(UP,n,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function NR(){const e=new CustomEvent(T0);document.dispatchEvent(e)}function Z_(e,t,n,{discrete:r}){const o=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?G_(o,l):o.dispatchEvent(l)}var jx="focusScope.autoFocusOnMount",Tx="focusScope.autoFocusOnUnmount",AR={bubbles:!1,cancelable:!0},$P="FocusScope",Df=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:l,...c}=e,[d,f]=m.useState(null),h=bs(o),g=bs(l),y=m.useRef(null),v=dt(t,S=>f(S)),b=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let S=function(_){if(b.paused||!d)return;const D=_.target;d.contains(D)?y.current=D:Ti(y.current,{select:!0})},C=function(_){if(b.paused||!d)return;const D=_.relatedTarget;D!==null&&(d.contains(D)||Ti(y.current,{select:!0}))},R=function(_){if(document.activeElement===document.body)for(const A of _)A.removedNodes.length>0&&Ti(d)};document.addEventListener("focusin",S),document.addEventListener("focusout",C);const j=new MutationObserver(R);return d&&j.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",C),j.disconnect()}}},[r,d,b.paused]),m.useEffect(()=>{if(d){OR.add(b);const S=document.activeElement;if(!d.contains(S)){const R=new CustomEvent(jx,AR);d.addEventListener(jx,h),d.dispatchEvent(R),R.defaultPrevented||(BP(YP(K_(d)),{select:!0}),document.activeElement===S&&Ti(d))}return()=>{d.removeEventListener(jx,h),setTimeout(()=>{const R=new CustomEvent(Tx,AR);d.addEventListener(Tx,g),d.dispatchEvent(R),R.defaultPrevented||Ti(S??document.body,{select:!0}),d.removeEventListener(Tx,g),OR.remove(b)},0)}}},[d,h,g,b]);const w=m.useCallback(S=>{if(!n&&!r||b.paused)return;const C=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,R=document.activeElement;if(C&&R){const j=S.currentTarget,[_,D]=GP(j);_&&D?!S.shiftKey&&R===D?(S.preventDefault(),n&&Ti(_,{select:!0})):S.shiftKey&&R===_&&(S.preventDefault(),n&&Ti(D,{select:!0})):R===j&&S.preventDefault()}},[n,r,b.paused]);return s.jsx(et.div,{tabIndex:-1,...c,ref:v,onKeyDown:w})});Df.displayName=$P;function BP(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ti(r,{select:t}),document.activeElement!==n)return}function GP(e){const t=K_(e),n=DR(t,e),r=DR(t.reverse(),e);return[n,r]}function K_(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function DR(e,t){for(const n of e)if(!qP(n,{upTo:t}))return n}function qP(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function ZP(e){return e instanceof HTMLInputElement&&"select"in e}function Ti(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ZP(e)&&t&&e.select()}}var OR=KP();function KP(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=MR(e,t),e.unshift(t)},remove(t){var n;e=MR(e,t),(n=e[0])==null||n.resume()}}}function MR(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function YP(e){return e.filter(t=>t.tagName!=="A")}var WP="Portal",tc=m.forwardRef((e,t)=>{var d;const{container:n,...r}=e,[o,l]=m.useState(!1);jr(()=>l(!0),[]);const c=n||o&&((d=globalThis==null?void 0:globalThis.document)==null?void 0:d.body);return c?g7.createPortal(s.jsx(et.div,{...r,ref:t}),c):null});tc.displayName=WP;function QP(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var _r=e=>{const{present:t,children:n}=e,r=XP(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),l=dt(r.ref,JP(o));return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:l}):null};_r.displayName="Presence";function XP(e){const[t,n]=m.useState(),r=m.useRef(null),o=m.useRef(e),l=m.useRef("none"),c=e?"mounted":"unmounted",[d,f]=QP(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const h=Cm(r.current);l.current=d==="mounted"?h:"none"},[d]),jr(()=>{const h=r.current,g=o.current;if(g!==e){const v=l.current,b=Cm(h);e?f("MOUNT"):b==="none"||(h==null?void 0:h.display)==="none"?f("UNMOUNT"):f(g&&v!==b?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,f]),jr(()=>{if(t){let h;const g=t.ownerDocument.defaultView??window,y=b=>{const S=Cm(r.current).includes(CSS.escape(b.animationName));if(b.target===t&&S&&(f("ANIMATION_END"),!o.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",h=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},v=b=>{b.target===t&&(l.current=Cm(r.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",y),t.addEventListener("animationend",y),()=>{g.clearTimeout(h),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",y),t.removeEventListener("animationend",y)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:m.useCallback(h=>{r.current=h?getComputedStyle(h):null,n(h)},[])}}function Cm(e){return(e==null?void 0:e.animationName)||"none"}function JP(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var _x=0;function sg(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??IR()),document.body.insertAdjacentElement("beforeend",e[1]??IR()),_x++,()=>{_x===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),_x--}},[])}function IR(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Fs=function(){return Fs=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},Fs.apply(this,arguments)};function Y_(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function eU(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,l;r<o;r++)(l||!(r in t))&&(l||(l=Array.prototype.slice.call(t,0,r)),l[r]=t[r]);return e.concat(l||Array.prototype.slice.call(t))}var Ym="right-scroll-bar-position",Wm="width-before-scroll-bar",tU="with-scroll-bars-hidden",nU="--removed-body-scroll-bar-size";function Nx(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function rU(e,t){var n=m.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var aU=typeof window<"u"?m.useLayoutEffect:m.useEffect,kR=new WeakMap;function sU(e,t){var n=rU(null,function(r){return e.forEach(function(o){return Nx(o,r)})});return aU(function(){var r=kR.get(n);if(r){var o=new Set(r),l=new Set(e),c=n.current;o.forEach(function(d){l.has(d)||Nx(d,null)}),l.forEach(function(d){o.has(d)||Nx(d,c)})}kR.set(n,e)},[e]),n}function oU(e){return e}function iU(e,t){t===void 0&&(t=oU);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(l){var c=t(l,r);return n.push(c),function(){n=n.filter(function(d){return d!==c})}},assignSyncMedium:function(l){for(r=!0;n.length;){var c=n;n=[],c.forEach(l)}n={push:function(d){return l(d)},filter:function(){return n}}},assignMedium:function(l){r=!0;var c=[];if(n.length){var d=n;n=[],d.forEach(l),c=n}var f=function(){var g=c;c=[],g.forEach(l)},h=function(){return Promise.resolve().then(f)};h(),n={push:function(g){c.push(g),h()},filter:function(g){return c=c.filter(g),n}}}};return o}function lU(e){e===void 0&&(e={});var t=iU(null);return t.options=Fs({async:!0,ssr:!1},e),t}var W_=function(e){var t=e.sideCar,n=Y_(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return m.createElement(r,Fs({},n))};W_.isSideCarExport=!0;function cU(e,t){return e.useMedium(t),W_}var Q_=lU(),Ax=function(){},og=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:Ax,onWheelCapture:Ax,onTouchMoveCapture:Ax}),o=r[0],l=r[1],c=e.forwardProps,d=e.children,f=e.className,h=e.removeScrollBar,g=e.enabled,y=e.shards,v=e.sideCar,b=e.noRelative,w=e.noIsolation,S=e.inert,C=e.allowPinchZoom,R=e.as,j=R===void 0?"div":R,_=e.gapMode,D=Y_(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=v,O=sU([n,t]),T=Fs(Fs({},D),o);return m.createElement(m.Fragment,null,g&&m.createElement(A,{sideCar:Q_,removeScrollBar:h,shards:y,noRelative:b,noIsolation:w,inert:S,setCallbacks:l,allowPinchZoom:!!C,lockRef:n,gapMode:_}),c?m.cloneElement(m.Children.only(d),Fs(Fs({},T),{ref:O})):m.createElement(j,Fs({},T,{className:f,ref:O}),d))});og.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};og.classNames={fullWidth:Wm,zeroRight:Ym};var uU=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function dU(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=uU();return t&&e.setAttribute("nonce",t),e}function fU(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function hU(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var mU=function(){var e=0,t=null;return{add:function(n){e==0&&(t=dU())&&(fU(t,n),hU(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},pU=function(){var e=mU();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},X_=function(){var e=pU(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},gU={left:0,top:0,right:0,gap:0},Dx=function(e){return parseInt(e||"",10)||0},yU=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Dx(n),Dx(r),Dx(o)]},vU=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return gU;var t=yU(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},xU=X_(),du="data-scroll-locked",bU=function(e,t,n,r){var o=e.left,l=e.top,c=e.right,d=e.gap;return n===void 0&&(n="margin"),`
442
+ .`.concat(tU,` {
443
+ overflow: hidden `).concat(r,`;
444
+ padding-right: `).concat(d,"px ").concat(r,`;
445
+ }
446
+ body[`).concat(du,`] {
447
+ overflow: hidden `).concat(r,`;
448
+ overscroll-behavior: contain;
449
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
450
+ padding-left: `.concat(o,`px;
451
+ padding-top: `).concat(l,`px;
452
+ padding-right: `).concat(c,`px;
453
+ margin-left:0;
454
+ margin-top:0;
455
+ margin-right: `).concat(d,"px ").concat(r,`;
456
+ `),n==="padding"&&"padding-right: ".concat(d,"px ").concat(r,";")].filter(Boolean).join(""),`
457
+ }
458
+
459
+ .`).concat(Ym,` {
460
+ right: `).concat(d,"px ").concat(r,`;
461
+ }
462
+
463
+ .`).concat(Wm,` {
464
+ margin-right: `).concat(d,"px ").concat(r,`;
465
+ }
466
+
467
+ .`).concat(Ym," .").concat(Ym,` {
468
+ right: 0 `).concat(r,`;
469
+ }
470
+
471
+ .`).concat(Wm," .").concat(Wm,` {
472
+ margin-right: 0 `).concat(r,`;
473
+ }
474
+
475
+ body[`).concat(du,`] {
476
+ `).concat(nU,": ").concat(d,`px;
477
+ }
478
+ `)},LR=function(){var e=parseInt(document.body.getAttribute(du)||"0",10);return isFinite(e)?e:0},SU=function(){m.useEffect(function(){return document.body.setAttribute(du,(LR()+1).toString()),function(){var e=LR()-1;e<=0?document.body.removeAttribute(du):document.body.setAttribute(du,e.toString())}},[])},CU=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;SU();var l=m.useMemo(function(){return vU(o)},[o]);return m.createElement(xU,{styles:bU(l,!t,o,n?"":"!important")})},_0=!1;if(typeof window<"u")try{var Em=Object.defineProperty({},"passive",{get:function(){return _0=!0,!0}});window.addEventListener("test",Em,Em),window.removeEventListener("test",Em,Em)}catch{_0=!1}var qc=_0?{passive:!1}:!1,EU=function(e){return e.tagName==="TEXTAREA"},J_=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!EU(e)&&n[t]==="visible")},wU=function(e){return J_(e,"overflowY")},RU=function(e){return J_(e,"overflowX")},PR=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=eN(e,r);if(o){var l=tN(e,r),c=l[1],d=l[2];if(c>d)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},jU=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},TU=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},eN=function(e,t){return e==="v"?wU(t):RU(t)},tN=function(e,t){return e==="v"?jU(t):TU(t)},_U=function(e,t){return e==="h"&&t==="rtl"?-1:1},NU=function(e,t,n,r,o){var l=_U(e,window.getComputedStyle(t).direction),c=l*r,d=n.target,f=t.contains(d),h=!1,g=c>0,y=0,v=0;do{if(!d)break;var b=tN(e,d),w=b[0],S=b[1],C=b[2],R=S-C-l*w;(w||R)&&eN(e,d)&&(y+=R,v+=w);var j=d.parentNode;d=j&&j.nodeType===Node.DOCUMENT_FRAGMENT_NODE?j.host:j}while(!f&&d!==document.body||f&&(t.contains(d)||t===d));return(g&&Math.abs(y)<1||!g&&Math.abs(v)<1)&&(h=!0),h},wm=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},UR=function(e){return[e.deltaX,e.deltaY]},FR=function(e){return e&&"current"in e?e.current:e},AU=function(e,t){return e[0]===t[0]&&e[1]===t[1]},DU=function(e){return`
479
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
480
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
481
+ `)},OU=0,Zc=[];function MU(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),o=m.useState(OU++)[0],l=m.useState(X_)[0],c=m.useRef(e);m.useEffect(function(){c.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var S=eU([e.lockRef.current],(e.shards||[]).map(FR),!0).filter(Boolean);return S.forEach(function(C){return C.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),S.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var d=m.useCallback(function(S,C){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!c.current.allowPinchZoom;var R=wm(S),j=n.current,_="deltaX"in S?S.deltaX:j[0]-R[0],D="deltaY"in S?S.deltaY:j[1]-R[1],A,O=S.target,T=Math.abs(_)>Math.abs(D)?"h":"v";if("touches"in S&&T==="h"&&O.type==="range")return!1;var M=PR(T,O);if(!M)return!0;if(M?A=T:(A=T==="v"?"h":"v",M=PR(T,O)),!M)return!1;if(!r.current&&"changedTouches"in S&&(_||D)&&(r.current=A),!A)return!0;var F=r.current||A;return NU(F,C,S,F==="h"?_:D)},[]),f=m.useCallback(function(S){var C=S;if(!(!Zc.length||Zc[Zc.length-1]!==l)){var R="deltaY"in C?UR(C):wm(C),j=t.current.filter(function(A){return A.name===C.type&&(A.target===C.target||C.target===A.shadowParent)&&AU(A.delta,R)})[0];if(j&&j.should){C.cancelable&&C.preventDefault();return}if(!j){var _=(c.current.shards||[]).map(FR).filter(Boolean).filter(function(A){return A.contains(C.target)}),D=_.length>0?d(C,_[0]):!c.current.noIsolation;D&&C.cancelable&&C.preventDefault()}}},[]),h=m.useCallback(function(S,C,R,j){var _={name:S,delta:C,target:R,should:j,shadowParent:IU(R)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(D){return D!==_})},1)},[]),g=m.useCallback(function(S){n.current=wm(S),r.current=void 0},[]),y=m.useCallback(function(S){h(S.type,UR(S),S.target,d(S,e.lockRef.current))},[]),v=m.useCallback(function(S){h(S.type,wm(S),S.target,d(S,e.lockRef.current))},[]);m.useEffect(function(){return Zc.push(l),e.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:v}),document.addEventListener("wheel",f,qc),document.addEventListener("touchmove",f,qc),document.addEventListener("touchstart",g,qc),function(){Zc=Zc.filter(function(S){return S!==l}),document.removeEventListener("wheel",f,qc),document.removeEventListener("touchmove",f,qc),document.removeEventListener("touchstart",g,qc)}},[]);var b=e.removeScrollBar,w=e.inert;return m.createElement(m.Fragment,null,w?m.createElement(l,{styles:DU(o)}):null,b?m.createElement(CU,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function IU(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const kU=cU(Q_,MU);var Of=m.forwardRef(function(e,t){return m.createElement(og,Fs({},e,{ref:t,sideCar:kU}))});Of.classNames=og.classNames;var LU=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Kc=new WeakMap,Rm=new WeakMap,jm={},Ox=0,nN=function(e){return e&&(e.host||nN(e.parentNode))},PU=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=nN(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},UU=function(e,t,n,r){var o=PU(t,Array.isArray(e)?e:[e]);jm[n]||(jm[n]=new WeakMap);var l=jm[n],c=[],d=new Set,f=new Set(o),h=function(y){!y||d.has(y)||(d.add(y),h(y.parentNode))};o.forEach(h);var g=function(y){!y||f.has(y)||Array.prototype.forEach.call(y.children,function(v){if(d.has(v))g(v);else try{var b=v.getAttribute(r),w=b!==null&&b!=="false",S=(Kc.get(v)||0)+1,C=(l.get(v)||0)+1;Kc.set(v,S),l.set(v,C),c.push(v),S===1&&w&&Rm.set(v,!0),C===1&&v.setAttribute(n,"true"),w||v.setAttribute(r,"true")}catch(R){console.error("aria-hidden: cannot operate on ",v,R)}})};return g(t),d.clear(),Ox++,function(){c.forEach(function(y){var v=Kc.get(y)-1,b=l.get(y)-1;Kc.set(y,v),l.set(y,b),v||(Rm.has(y)||y.removeAttribute(r),Rm.delete(y)),b||y.removeAttribute(n)}),Ox--,Ox||(Kc=new WeakMap,Kc=new WeakMap,Rm=new WeakMap,jm={})}},ig=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=LU(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),UU(r,o,n,"aria-hidden")):function(){return null}};function FU(e){const t=VU(e),n=m.forwardRef((r,o)=>{const{children:l,...c}=r,d=m.Children.toArray(l),f=d.find(HU);if(f){const h=f.props.children,g=d.map(y=>y===f?m.Children.count(h)>1?m.Children.only(null):m.isValidElement(h)?h.props.children:null:y);return s.jsx(t,{...c,ref:o,children:m.isValidElement(h)?m.cloneElement(h,void 0,g):null})}return s.jsx(t,{...c,ref:o,children:l})});return n.displayName=`${e}.Slot`,n}function VU(e){const t=m.forwardRef((n,r)=>{const{children:o,...l}=n;if(m.isValidElement(o)){const c=BU(o),d=$U(l,o.props);return o.type!==m.Fragment&&(d.ref=r?Lr(r,c):c),m.cloneElement(o,d)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var zU=Symbol("radix.slottable");function HU(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zU}function $U(e,t){const n={...t};for(const r in t){const o=e[r],l=t[r];/^on[A-Z]/.test(r)?o&&l?n[r]=(...d)=>{const f=l(...d);return o(...d),f}:o&&(n[r]=o):r==="style"?n[r]={...o,...l}:r==="className"&&(n[r]=[o,l].filter(Boolean).join(" "))}return{...e,...n}}function BU(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var lg="Dialog",[rN,aN]=cr(lg),[GU,Rs]=rN(lg),sN=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:l,modal:c=!0}=e,d=m.useRef(null),f=m.useRef(null),[h,g]=Gr({prop:r,defaultProp:o??!1,onChange:l,caller:lg});return s.jsx(GU,{scope:t,triggerRef:d,contentRef:f,contentId:Ln(),titleId:Ln(),descriptionId:Ln(),open:h,onOpenChange:g,onOpenToggle:m.useCallback(()=>g(y=>!y),[g]),modal:c,children:n})};sN.displayName=lg;var oN="DialogTrigger",iN=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Rs(oN,n),l=dt(t,o.triggerRef);return s.jsx(et.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":W1(o.open),...r,ref:l,onClick:Te(e.onClick,o.onOpenToggle)})});iN.displayName=oN;var K1="DialogPortal",[qU,lN]=rN(K1,{forceMount:void 0}),cN=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,l=Rs(K1,t);return s.jsx(qU,{scope:t,forceMount:n,children:m.Children.map(r,c=>s.jsx(_r,{present:n||l.open,children:s.jsx(tc,{asChild:!0,container:o,children:c})}))})};cN.displayName=K1;var hp="DialogOverlay",uN=m.forwardRef((e,t)=>{const n=lN(hp,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,l=Rs(hp,e.__scopeDialog);return l.modal?s.jsx(_r,{present:r||l.open,children:s.jsx(KU,{...o,ref:t})}):null});uN.displayName=hp;var ZU=FU("DialogOverlay.RemoveScroll"),KU=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Rs(hp,n);return s.jsx(Of,{as:ZU,allowPinchZoom:!0,shards:[o.contentRef],children:s.jsx(et.div,{"data-state":W1(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Hl="DialogContent",dN=m.forwardRef((e,t)=>{const n=lN(Hl,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,l=Rs(Hl,e.__scopeDialog);return s.jsx(_r,{present:r||l.open,children:l.modal?s.jsx(YU,{...o,ref:t}):s.jsx(WU,{...o,ref:t})})});dN.displayName=Hl;var YU=m.forwardRef((e,t)=>{const n=Rs(Hl,e.__scopeDialog),r=m.useRef(null),o=dt(t,n.contentRef,r);return m.useEffect(()=>{const l=r.current;if(l)return ig(l)},[]),s.jsx(fN,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Te(e.onCloseAutoFocus,l=>{var c;l.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Te(e.onPointerDownOutside,l=>{const c=l.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0;(c.button===2||d)&&l.preventDefault()}),onFocusOutside:Te(e.onFocusOutside,l=>l.preventDefault())})}),WU=m.forwardRef((e,t)=>{const n=Rs(Hl,e.__scopeDialog),r=m.useRef(!1),o=m.useRef(!1);return s.jsx(fN,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var c,d;(c=e.onCloseAutoFocus)==null||c.call(e,l),l.defaultPrevented||(r.current||(d=n.triggerRef.current)==null||d.focus(),l.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:l=>{var f,h;(f=e.onInteractOutside)==null||f.call(e,l),l.defaultPrevented||(r.current=!0,l.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=l.target;((h=n.triggerRef.current)==null?void 0:h.contains(c))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&o.current&&l.preventDefault()}})}),fN=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:l,...c}=e,d=Rs(Hl,n),f=m.useRef(null),h=dt(t,f);return sg(),s.jsxs(s.Fragment,{children:[s.jsx(Df,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:l,children:s.jsx(ec,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":W1(d.open),...c,ref:h,onDismiss:()=>d.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(XU,{titleId:d.titleId}),s.jsx(eF,{contentRef:f,descriptionId:d.descriptionId})]})]})}),Y1="DialogTitle",hN=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Rs(Y1,n);return s.jsx(et.h2,{id:o.titleId,...r,ref:t})});hN.displayName=Y1;var mN="DialogDescription",pN=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Rs(mN,n);return s.jsx(et.p,{id:o.descriptionId,...r,ref:t})});pN.displayName=mN;var gN="DialogClose",yN=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Rs(gN,n);return s.jsx(et.button,{type:"button",...r,ref:t,onClick:Te(e.onClick,()=>o.onOpenChange(!1))})});yN.displayName=gN;function W1(e){return e?"open":"closed"}var vN="DialogTitleWarning",[QU,xN]=SP(vN,{contentName:Hl,titleName:Y1,docsSlug:"dialog"}),XU=({titleId:e})=>{const t=xN(vN),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
482
+
483
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
484
+
485
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},JU="DialogDescriptionWarning",eF=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${xN(JU).contentName}}.`;return m.useEffect(()=>{var l;const o=(l=e.current)==null?void 0:l.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},cg=sN,tF=iN,ug=cN,dg=uN,fg=dN,Q1=hN,X1=pN,hg=yN;function Bo({...e}){return s.jsx(cg,{"data-slot":"sheet",...e})}function nF({...e}){return s.jsx(ug,{"data-slot":"sheet-portal",...e})}function rF({className:e,...t}){return s.jsx(dg,{"data-slot":"sheet-overlay",className:ne("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function Go({className:e,children:t,side:n="right",...r}){return s.jsxs(nF,{children:[s.jsx(rF,{}),s.jsxs(fg,{"data-slot":"sheet-content",className:ne("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-0 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",n==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full min-w-[100%] border-l sm:max-w-sm sm:min-w-[600px]",n==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full min-w-[100%] border-r sm:max-w-sm sm:min-w-[600px]",n==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",n==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...r,children:[t,s.jsxs(hg,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[s.jsx(xu,{className:"size-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function qo({className:e,...t}){return s.jsx("div",{"data-slot":"sheet-header",className:ne("flex flex-col gap-1 border-b p-4",e),...t})}function Zo({className:e,...t}){return s.jsx(Q1,{"data-slot":"sheet-title",className:ne("text-foreground font-semibold",e),...t})}function Xi({className:e,...t}){return s.jsx(X1,{"data-slot":"sheet-description",className:ne("text-muted-foreground text-sm",e),...t})}function hs({className:e,...t}){return s.jsx("div",{"data-slot":"skeleton",className:ne("bg-accent animate-pulse rounded-md",e),...t})}const aF=["top","right","bottom","left"],Bi=Math.min,Na=Math.max,mp=Math.round,Tm=Math.floor,Bs=e=>({x:e,y:e}),sF={left:"right",right:"left",bottom:"top",top:"bottom"},oF={start:"end",end:"start"};function N0(e,t,n){return Na(e,Bi(t,n))}function Vo(e,t){return typeof e=="function"?e(t):e}function zo(e){return e.split("-")[0]}function Mu(e){return e.split("-")[1]}function J1(e){return e==="x"?"y":"x"}function eb(e){return e==="y"?"height":"width"}const iF=new Set(["top","bottom"]);function Vs(e){return iF.has(zo(e))?"y":"x"}function tb(e){return J1(Vs(e))}function lF(e,t,n){n===void 0&&(n=!1);const r=Mu(e),o=tb(e),l=eb(o);let c=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(c=pp(c)),[c,pp(c)]}function cF(e){const t=pp(e);return[A0(e),t,A0(t)]}function A0(e){return e.replace(/start|end/g,t=>oF[t])}const VR=["left","right"],zR=["right","left"],uF=["top","bottom"],dF=["bottom","top"];function fF(e,t,n){switch(e){case"top":case"bottom":return n?t?zR:VR:t?VR:zR;case"left":case"right":return t?uF:dF;default:return[]}}function hF(e,t,n,r){const o=Mu(e);let l=fF(zo(e),n==="start",r);return o&&(l=l.map(c=>c+"-"+o),t&&(l=l.concat(l.map(A0)))),l}function pp(e){return e.replace(/left|right|bottom|top/g,t=>sF[t])}function mF(e){return{top:0,right:0,bottom:0,left:0,...e}}function bN(e){return typeof e!="number"?mF(e):{top:e,right:e,bottom:e,left:e}}function gp(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function HR(e,t,n){let{reference:r,floating:o}=e;const l=Vs(t),c=tb(t),d=eb(c),f=zo(t),h=l==="y",g=r.x+r.width/2-o.width/2,y=r.y+r.height/2-o.height/2,v=r[d]/2-o[d]/2;let b;switch(f){case"top":b={x:g,y:r.y-o.height};break;case"bottom":b={x:g,y:r.y+r.height};break;case"right":b={x:r.x+r.width,y};break;case"left":b={x:r.x-o.width,y};break;default:b={x:r.x,y:r.y}}switch(Mu(t)){case"start":b[c]-=v*(n&&h?-1:1);break;case"end":b[c]+=v*(n&&h?-1:1);break}return b}const pF=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:l=[],platform:c}=n,d=l.filter(Boolean),f=await(c.isRTL==null?void 0:c.isRTL(t));let h=await c.getElementRects({reference:e,floating:t,strategy:o}),{x:g,y}=HR(h,r,f),v=r,b={},w=0;for(let S=0;S<d.length;S++){const{name:C,fn:R}=d[S],{x:j,y:_,data:D,reset:A}=await R({x:g,y,initialPlacement:r,placement:v,strategy:o,middlewareData:b,rects:h,platform:c,elements:{reference:e,floating:t}});g=j??g,y=_??y,b={...b,[C]:{...b[C],...D}},A&&w<=50&&(w++,typeof A=="object"&&(A.placement&&(v=A.placement),A.rects&&(h=A.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:o}):A.rects),{x:g,y}=HR(h,v,f)),S=-1)}return{x:g,y,placement:v,strategy:o,middlewareData:b}};async function hf(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:l,rects:c,elements:d,strategy:f}=e,{boundary:h="clippingAncestors",rootBoundary:g="viewport",elementContext:y="floating",altBoundary:v=!1,padding:b=0}=Vo(t,e),w=bN(b),C=d[v?y==="floating"?"reference":"floating":y],R=gp(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(C)))==null||n?C:C.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(d.floating)),boundary:h,rootBoundary:g,strategy:f})),j=y==="floating"?{x:r,y:o,width:c.floating.width,height:c.floating.height}:c.reference,_=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d.floating)),D=await(l.isElement==null?void 0:l.isElement(_))?await(l.getScale==null?void 0:l.getScale(_))||{x:1,y:1}:{x:1,y:1},A=gp(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:j,offsetParent:_,strategy:f}):j);return{top:(R.top-A.top+w.top)/D.y,bottom:(A.bottom-R.bottom+w.bottom)/D.y,left:(R.left-A.left+w.left)/D.x,right:(A.right-R.right+w.right)/D.x}}const gF=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:l,platform:c,elements:d,middlewareData:f}=t,{element:h,padding:g=0}=Vo(e,t)||{};if(h==null)return{};const y=bN(g),v={x:n,y:r},b=tb(o),w=eb(b),S=await c.getDimensions(h),C=b==="y",R=C?"top":"left",j=C?"bottom":"right",_=C?"clientHeight":"clientWidth",D=l.reference[w]+l.reference[b]-v[b]-l.floating[w],A=v[b]-l.reference[b],O=await(c.getOffsetParent==null?void 0:c.getOffsetParent(h));let T=O?O[_]:0;(!T||!await(c.isElement==null?void 0:c.isElement(O)))&&(T=d.floating[_]||l.floating[w]);const M=D/2-A/2,F=T/2-S[w]/2-1,G=Bi(y[R],F),Y=Bi(y[j],F),Z=G,J=T-S[w]-Y,H=T/2-S[w]/2+M,K=N0(Z,H,J),k=!f.arrow&&Mu(o)!=null&&H!==K&&l.reference[w]/2-(H<Z?G:Y)-S[w]/2<0,z=k?H<Z?H-Z:H-J:0;return{[b]:v[b]+z,data:{[b]:K,centerOffset:H-K-z,...k&&{alignmentOffset:z}},reset:k}}}),yF=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:l,rects:c,initialPlacement:d,platform:f,elements:h}=t,{mainAxis:g=!0,crossAxis:y=!0,fallbackPlacements:v,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:S=!0,...C}=Vo(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const R=zo(o),j=Vs(d),_=zo(d)===d,D=await(f.isRTL==null?void 0:f.isRTL(h.floating)),A=v||(_||!S?[pp(d)]:cF(d)),O=w!=="none";!v&&O&&A.push(...hF(d,S,w,D));const T=[d,...A],M=await hf(t,C),F=[];let G=((r=l.flip)==null?void 0:r.overflows)||[];if(g&&F.push(M[R]),y){const H=lF(o,c,D);F.push(M[H[0]],M[H[1]])}if(G=[...G,{placement:o,overflows:F}],!F.every(H=>H<=0)){var Y,Z;const H=(((Y=l.flip)==null?void 0:Y.index)||0)+1,K=T[H];if(K&&(!(y==="alignment"?j!==Vs(K):!1)||G.every(B=>Vs(B.placement)===j?B.overflows[0]>0:!0)))return{data:{index:H,overflows:G},reset:{placement:K}};let k=(Z=G.filter(z=>z.overflows[0]<=0).sort((z,B)=>z.overflows[1]-B.overflows[1])[0])==null?void 0:Z.placement;if(!k)switch(b){case"bestFit":{var J;const z=(J=G.filter(B=>{if(O){const ie=Vs(B.placement);return ie===j||ie==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(ie=>ie>0).reduce((ie,xe)=>ie+xe,0)]).sort((B,ie)=>B[1]-ie[1])[0])==null?void 0:J[0];z&&(k=z);break}case"initialPlacement":k=d;break}if(o!==k)return{reset:{placement:k}}}return{}}}};function $R(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function BR(e){return aF.some(t=>e[t]>=0)}const vF=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Vo(e,t);switch(r){case"referenceHidden":{const l=await hf(t,{...o,elementContext:"reference"}),c=$R(l,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:BR(c)}}}case"escaped":{const l=await hf(t,{...o,altBoundary:!0}),c=$R(l,n.floating);return{data:{escapedOffsets:c,escaped:BR(c)}}}default:return{}}}}},SN=new Set(["left","top"]);async function xF(e,t){const{placement:n,platform:r,elements:o}=e,l=await(r.isRTL==null?void 0:r.isRTL(o.floating)),c=zo(n),d=Mu(n),f=Vs(n)==="y",h=SN.has(c)?-1:1,g=l&&f?-1:1,y=Vo(t,e);let{mainAxis:v,crossAxis:b,alignmentAxis:w}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return d&&typeof w=="number"&&(b=d==="end"?w*-1:w),f?{x:b*g,y:v*h}:{x:v*h,y:b*g}}const bF=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:l,placement:c,middlewareData:d}=t,f=await xF(t,e);return c===((n=d.offset)==null?void 0:n.placement)&&(r=d.arrow)!=null&&r.alignmentOffset?{}:{x:o+f.x,y:l+f.y,data:{...f,placement:c}}}}},SF=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:l=!0,crossAxis:c=!1,limiter:d={fn:C=>{let{x:R,y:j}=C;return{x:R,y:j}}},...f}=Vo(e,t),h={x:n,y:r},g=await hf(t,f),y=Vs(zo(o)),v=J1(y);let b=h[v],w=h[y];if(l){const C=v==="y"?"top":"left",R=v==="y"?"bottom":"right",j=b+g[C],_=b-g[R];b=N0(j,b,_)}if(c){const C=y==="y"?"top":"left",R=y==="y"?"bottom":"right",j=w+g[C],_=w-g[R];w=N0(j,w,_)}const S=d.fn({...t,[v]:b,[y]:w});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[v]:l,[y]:c}}}}}},CF=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:l,middlewareData:c}=t,{offset:d=0,mainAxis:f=!0,crossAxis:h=!0}=Vo(e,t),g={x:n,y:r},y=Vs(o),v=J1(y);let b=g[v],w=g[y];const S=Vo(d,t),C=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(f){const _=v==="y"?"height":"width",D=l.reference[v]-l.floating[_]+C.mainAxis,A=l.reference[v]+l.reference[_]-C.mainAxis;b<D?b=D:b>A&&(b=A)}if(h){var R,j;const _=v==="y"?"width":"height",D=SN.has(zo(o)),A=l.reference[y]-l.floating[_]+(D&&((R=c.offset)==null?void 0:R[y])||0)+(D?0:C.crossAxis),O=l.reference[y]+l.reference[_]+(D?0:((j=c.offset)==null?void 0:j[y])||0)-(D?C.crossAxis:0);w<A?w=A:w>O&&(w=O)}return{[v]:b,[y]:w}}}},EF=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:l,platform:c,elements:d}=t,{apply:f=()=>{},...h}=Vo(e,t),g=await hf(t,h),y=zo(o),v=Mu(o),b=Vs(o)==="y",{width:w,height:S}=l.floating;let C,R;y==="top"||y==="bottom"?(C=y,R=v===(await(c.isRTL==null?void 0:c.isRTL(d.floating))?"start":"end")?"left":"right"):(R=y,C=v==="end"?"top":"bottom");const j=S-g.top-g.bottom,_=w-g.left-g.right,D=Bi(S-g[C],j),A=Bi(w-g[R],_),O=!t.middlewareData.shift;let T=D,M=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=j),O&&!v){const G=Na(g.left,0),Y=Na(g.right,0),Z=Na(g.top,0),J=Na(g.bottom,0);b?M=w-2*(G!==0||Y!==0?G+Y:Na(g.left,g.right)):T=S-2*(Z!==0||J!==0?Z+J:Na(g.top,g.bottom))}await f({...t,availableWidth:M,availableHeight:T});const F=await c.getDimensions(d.floating);return w!==F.width||S!==F.height?{reset:{rects:!0}}:{}}}};function mg(){return typeof window<"u"}function Iu(e){return CN(e)?(e.nodeName||"").toLowerCase():"#document"}function Da(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Js(e){var t;return(t=(CN(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function CN(e){return mg()?e instanceof Node||e instanceof Da(e).Node:!1}function Ss(e){return mg()?e instanceof Element||e instanceof Da(e).Element:!1}function Ks(e){return mg()?e instanceof HTMLElement||e instanceof Da(e).HTMLElement:!1}function GR(e){return!mg()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Da(e).ShadowRoot}const wF=new Set(["inline","contents"]);function Mf(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Cs(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!wF.has(o)}const RF=new Set(["table","td","th"]);function jF(e){return RF.has(Iu(e))}const TF=[":popover-open",":modal"];function pg(e){return TF.some(t=>{try{return e.matches(t)}catch{return!1}})}const _F=["transform","translate","scale","rotate","perspective"],NF=["transform","translate","scale","rotate","perspective","filter"],AF=["paint","layout","strict","content"];function nb(e){const t=rb(),n=Ss(e)?Cs(e):e;return _F.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||NF.some(r=>(n.willChange||"").includes(r))||AF.some(r=>(n.contain||"").includes(r))}function DF(e){let t=Gi(e);for(;Ks(t)&&!bu(t);){if(nb(t))return t;if(pg(t))return null;t=Gi(t)}return null}function rb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const OF=new Set(["html","body","#document"]);function bu(e){return OF.has(Iu(e))}function Cs(e){return Da(e).getComputedStyle(e)}function gg(e){return Ss(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Gi(e){if(Iu(e)==="html")return e;const t=e.assignedSlot||e.parentNode||GR(e)&&e.host||Js(e);return GR(t)?t.host:t}function EN(e){const t=Gi(e);return bu(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ks(t)&&Mf(t)?t:EN(t)}function mf(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=EN(e),l=o===((r=e.ownerDocument)==null?void 0:r.body),c=Da(o);if(l){const d=D0(c);return t.concat(c,c.visualViewport||[],Mf(o)?o:[],d&&n?mf(d):[])}return t.concat(o,mf(o,[],n))}function D0(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function wN(e){const t=Cs(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ks(e),l=o?e.offsetWidth:n,c=o?e.offsetHeight:r,d=mp(n)!==l||mp(r)!==c;return d&&(n=l,r=c),{width:n,height:r,$:d}}function ab(e){return Ss(e)?e:e.contextElement}function fu(e){const t=ab(e);if(!Ks(t))return Bs(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:l}=wN(t);let c=(l?mp(n.width):n.width)/r,d=(l?mp(n.height):n.height)/o;return(!c||!Number.isFinite(c))&&(c=1),(!d||!Number.isFinite(d))&&(d=1),{x:c,y:d}}const MF=Bs(0);function RN(e){const t=Da(e);return!rb()||!t.visualViewport?MF:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function IF(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Da(e)?!1:t}function $l(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),l=ab(e);let c=Bs(1);t&&(r?Ss(r)&&(c=fu(r)):c=fu(e));const d=IF(l,n,r)?RN(l):Bs(0);let f=(o.left+d.x)/c.x,h=(o.top+d.y)/c.y,g=o.width/c.x,y=o.height/c.y;if(l){const v=Da(l),b=r&&Ss(r)?Da(r):r;let w=v,S=D0(w);for(;S&&r&&b!==w;){const C=fu(S),R=S.getBoundingClientRect(),j=Cs(S),_=R.left+(S.clientLeft+parseFloat(j.paddingLeft))*C.x,D=R.top+(S.clientTop+parseFloat(j.paddingTop))*C.y;f*=C.x,h*=C.y,g*=C.x,y*=C.y,f+=_,h+=D,w=Da(S),S=D0(w)}}return gp({width:g,height:y,x:f,y:h})}function yg(e,t){const n=gg(e).scrollLeft;return t?t.left+n:$l(Js(e)).left+n}function jN(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-yg(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function kF(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const l=o==="fixed",c=Js(r),d=t?pg(t.floating):!1;if(r===c||d&&l)return n;let f={scrollLeft:0,scrollTop:0},h=Bs(1);const g=Bs(0),y=Ks(r);if((y||!y&&!l)&&((Iu(r)!=="body"||Mf(c))&&(f=gg(r)),Ks(r))){const b=$l(r);h=fu(r),g.x=b.x+r.clientLeft,g.y=b.y+r.clientTop}const v=c&&!y&&!l?jN(c,f):Bs(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-f.scrollLeft*h.x+g.x+v.x,y:n.y*h.y-f.scrollTop*h.y+g.y+v.y}}function LF(e){return Array.from(e.getClientRects())}function PF(e){const t=Js(e),n=gg(e),r=e.ownerDocument.body,o=Na(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),l=Na(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+yg(e);const d=-n.scrollTop;return Cs(r).direction==="rtl"&&(c+=Na(t.clientWidth,r.clientWidth)-o),{width:o,height:l,x:c,y:d}}const qR=25;function UF(e,t){const n=Da(e),r=Js(e),o=n.visualViewport;let l=r.clientWidth,c=r.clientHeight,d=0,f=0;if(o){l=o.width,c=o.height;const g=rb();(!g||g&&t==="fixed")&&(d=o.offsetLeft,f=o.offsetTop)}const h=yg(r);if(h<=0){const g=r.ownerDocument,y=g.body,v=getComputedStyle(y),b=g.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,w=Math.abs(r.clientWidth-y.clientWidth-b);w<=qR&&(l-=w)}else h<=qR&&(l+=h);return{width:l,height:c,x:d,y:f}}const FF=new Set(["absolute","fixed"]);function VF(e,t){const n=$l(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,l=Ks(e)?fu(e):Bs(1),c=e.clientWidth*l.x,d=e.clientHeight*l.y,f=o*l.x,h=r*l.y;return{width:c,height:d,x:f,y:h}}function ZR(e,t,n){let r;if(t==="viewport")r=UF(e,n);else if(t==="document")r=PF(Js(e));else if(Ss(t))r=VF(t,n);else{const o=RN(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return gp(r)}function TN(e,t){const n=Gi(e);return n===t||!Ss(n)||bu(n)?!1:Cs(n).position==="fixed"||TN(n,t)}function zF(e,t){const n=t.get(e);if(n)return n;let r=mf(e,[],!1).filter(d=>Ss(d)&&Iu(d)!=="body"),o=null;const l=Cs(e).position==="fixed";let c=l?Gi(e):e;for(;Ss(c)&&!bu(c);){const d=Cs(c),f=nb(c);!f&&d.position==="fixed"&&(o=null),(l?!f&&!o:!f&&d.position==="static"&&!!o&&FF.has(o.position)||Mf(c)&&!f&&TN(e,c))?r=r.filter(g=>g!==c):o=d,c=Gi(c)}return t.set(e,r),r}function HF(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const c=[...n==="clippingAncestors"?pg(t)?[]:zF(t,this._c):[].concat(n),r],d=c[0],f=c.reduce((h,g)=>{const y=ZR(t,g,o);return h.top=Na(y.top,h.top),h.right=Bi(y.right,h.right),h.bottom=Bi(y.bottom,h.bottom),h.left=Na(y.left,h.left),h},ZR(t,d,o));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function $F(e){const{width:t,height:n}=wN(e);return{width:t,height:n}}function BF(e,t,n){const r=Ks(t),o=Js(t),l=n==="fixed",c=$l(e,!0,l,t);let d={scrollLeft:0,scrollTop:0};const f=Bs(0);function h(){f.x=yg(o)}if(r||!r&&!l)if((Iu(t)!=="body"||Mf(o))&&(d=gg(t)),r){const b=$l(t,!0,l,t);f.x=b.x+t.clientLeft,f.y=b.y+t.clientTop}else o&&h();l&&!r&&o&&h();const g=o&&!r&&!l?jN(o,d):Bs(0),y=c.left+d.scrollLeft-f.x-g.x,v=c.top+d.scrollTop-f.y-g.y;return{x:y,y:v,width:c.width,height:c.height}}function Mx(e){return Cs(e).position==="static"}function KR(e,t){if(!Ks(e)||Cs(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Js(e)===n&&(n=n.ownerDocument.body),n}function _N(e,t){const n=Da(e);if(pg(e))return n;if(!Ks(e)){let o=Gi(e);for(;o&&!bu(o);){if(Ss(o)&&!Mx(o))return o;o=Gi(o)}return n}let r=KR(e,t);for(;r&&jF(r)&&Mx(r);)r=KR(r,t);return r&&bu(r)&&Mx(r)&&!nb(r)?n:r||DF(e)||n}const GF=async function(e){const t=this.getOffsetParent||_N,n=this.getDimensions,r=await n(e.floating);return{reference:BF(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function qF(e){return Cs(e).direction==="rtl"}const ZF={convertOffsetParentRelativeRectToViewportRelativeRect:kF,getDocumentElement:Js,getClippingRect:HF,getOffsetParent:_N,getElementRects:GF,getClientRects:LF,getDimensions:$F,getScale:fu,isElement:Ss,isRTL:qF};function NN(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function KF(e,t){let n=null,r;const o=Js(e);function l(){var d;clearTimeout(r),(d=n)==null||d.disconnect(),n=null}function c(d,f){d===void 0&&(d=!1),f===void 0&&(f=1),l();const h=e.getBoundingClientRect(),{left:g,top:y,width:v,height:b}=h;if(d||t(),!v||!b)return;const w=Tm(y),S=Tm(o.clientWidth-(g+v)),C=Tm(o.clientHeight-(y+b)),R=Tm(g),_={rootMargin:-w+"px "+-S+"px "+-C+"px "+-R+"px",threshold:Na(0,Bi(1,f))||1};let D=!0;function A(O){const T=O[0].intersectionRatio;if(T!==f){if(!D)return c();T?c(!1,T):r=setTimeout(()=>{c(!1,1e-7)},1e3)}T===1&&!NN(h,e.getBoundingClientRect())&&c(),D=!1}try{n=new IntersectionObserver(A,{..._,root:o.ownerDocument})}catch{n=new IntersectionObserver(A,_)}n.observe(e)}return c(!0),l}function YF(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,h=ab(e),g=o||l?[...h?mf(h):[],...mf(t)]:[];g.forEach(R=>{o&&R.addEventListener("scroll",n,{passive:!0}),l&&R.addEventListener("resize",n)});const y=h&&d?KF(h,n):null;let v=-1,b=null;c&&(b=new ResizeObserver(R=>{let[j]=R;j&&j.target===h&&b&&(b.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var _;(_=b)==null||_.observe(t)})),n()}),h&&!f&&b.observe(h),b.observe(t));let w,S=f?$l(e):null;f&&C();function C(){const R=$l(e);S&&!NN(S,R)&&n(),S=R,w=requestAnimationFrame(C)}return n(),()=>{var R;g.forEach(j=>{o&&j.removeEventListener("scroll",n),l&&j.removeEventListener("resize",n)}),y==null||y(),(R=b)==null||R.disconnect(),b=null,f&&cancelAnimationFrame(w)}}const WF=bF,QF=SF,XF=yF,JF=EF,eV=vF,YR=gF,tV=CF,nV=(e,t,n)=>{const r=new Map,o={platform:ZF,...n},l={...o.platform,_c:r};return pF(e,t,{...o,platform:l})};var rV=typeof document<"u",aV=function(){},Qm=rV?m.useLayoutEffect:aV;function yp(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!yp(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const l=o[r];if(!(l==="_owner"&&e.$$typeof)&&!yp(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function AN(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function WR(e,t){const n=AN(e);return Math.round(t*n)/n}function Ix(e){const t=m.useRef(e);return Qm(()=>{t.current=e}),t}function sV(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:l,floating:c}={},transform:d=!0,whileElementsMounted:f,open:h}=e,[g,y]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,b]=m.useState(r);yp(v,r)||b(r);const[w,S]=m.useState(null),[C,R]=m.useState(null),j=m.useCallback(B=>{B!==O.current&&(O.current=B,S(B))},[]),_=m.useCallback(B=>{B!==T.current&&(T.current=B,R(B))},[]),D=l||w,A=c||C,O=m.useRef(null),T=m.useRef(null),M=m.useRef(g),F=f!=null,G=Ix(f),Y=Ix(o),Z=Ix(h),J=m.useCallback(()=>{if(!O.current||!T.current)return;const B={placement:t,strategy:n,middleware:v};Y.current&&(B.platform=Y.current),nV(O.current,T.current,B).then(ie=>{const xe={...ie,isPositioned:Z.current!==!1};H.current&&!yp(M.current,xe)&&(M.current=xe,ys.flushSync(()=>{y(xe)}))})},[v,t,n,Y,Z]);Qm(()=>{h===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,y(B=>({...B,isPositioned:!1})))},[h]);const H=m.useRef(!1);Qm(()=>(H.current=!0,()=>{H.current=!1}),[]),Qm(()=>{if(D&&(O.current=D),A&&(T.current=A),D&&A){if(G.current)return G.current(D,A,J);J()}},[D,A,J,G,F]);const K=m.useMemo(()=>({reference:O,floating:T,setReference:j,setFloating:_}),[j,_]),k=m.useMemo(()=>({reference:D,floating:A}),[D,A]),z=m.useMemo(()=>{const B={position:n,left:0,top:0};if(!k.floating)return B;const ie=WR(k.floating,g.x),xe=WR(k.floating,g.y);return d?{...B,transform:"translate("+ie+"px, "+xe+"px)",...AN(k.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ie,top:xe}},[n,d,k.floating,g.x,g.y]);return m.useMemo(()=>({...g,update:J,refs:K,elements:k,floatingStyles:z}),[g,J,K,k,z])}const oV=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?YR({element:r.current,padding:o}).fn(n):{}:r?YR({element:r,padding:o}).fn(n):{}}}},iV=(e,t)=>({...WF(e),options:[e,t]}),lV=(e,t)=>({...QF(e),options:[e,t]}),cV=(e,t)=>({...tV(e),options:[e,t]}),uV=(e,t)=>({...XF(e),options:[e,t]}),dV=(e,t)=>({...JF(e),options:[e,t]}),fV=(e,t)=>({...eV(e),options:[e,t]}),hV=(e,t)=>({...oV(e),options:[e,t]});var mV="Arrow",DN=m.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...l}=e;return s.jsx(et.svg,{...l,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});DN.displayName=mV;var pV=DN;function sb(e){const[t,n]=m.useState(void 0);return jr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const l=o[0];let c,d;if("borderBoxSize"in l){const f=l.borderBoxSize,h=Array.isArray(f)?f[0]:f;c=h.inlineSize,d=h.blockSize}else c=e.offsetWidth,d=e.offsetHeight;n({width:c,height:d})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var ob="Popper",[ON,eo]=cr(ob),[gV,MN]=ON(ob),IN=e=>{const{__scopePopper:t,children:n}=e,[r,o]=m.useState(null);return s.jsx(gV,{scope:t,anchor:r,onAnchorChange:o,children:n})};IN.displayName=ob;var kN="PopperAnchor",LN=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,l=MN(kN,n),c=m.useRef(null),d=dt(t,c),f=m.useRef(null);return m.useEffect(()=>{const h=f.current;f.current=(r==null?void 0:r.current)||c.current,h!==f.current&&l.onAnchorChange(f.current)}),r?null:s.jsx(et.div,{...o,ref:d})});LN.displayName=kN;var ib="PopperContent",[yV,vV]=ON(ib),PN=m.forwardRef((e,t)=>{var le,Ae,we,Ne,Be,Qe;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:l="center",alignOffset:c=0,arrowPadding:d=0,avoidCollisions:f=!0,collisionBoundary:h=[],collisionPadding:g=0,sticky:y="partial",hideWhenDetached:v=!1,updatePositionStrategy:b="optimized",onPlaced:w,...S}=e,C=MN(ib,n),[R,j]=m.useState(null),_=dt(t,qt=>j(qt)),[D,A]=m.useState(null),O=sb(D),T=(O==null?void 0:O.width)??0,M=(O==null?void 0:O.height)??0,F=r+(l!=="center"?"-"+l:""),G=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},Y=Array.isArray(h)?h:[h],Z=Y.length>0,J={padding:G,boundary:Y.filter(bV),altBoundary:Z},{refs:H,floatingStyles:K,placement:k,isPositioned:z,middlewareData:B}=sV({strategy:"fixed",placement:F,whileElementsMounted:(...qt)=>YF(...qt,{animationFrame:b==="always"}),elements:{reference:C.anchor},middleware:[iV({mainAxis:o+M,alignmentAxis:c}),f&&lV({mainAxis:!0,crossAxis:!1,limiter:y==="partial"?cV():void 0,...J}),f&&uV({...J}),dV({...J,apply:({elements:qt,rects:Dt,availableWidth:Zt,availableHeight:jn})=>{const{width:Nr,height:va}=Dt.reference,Ve=qt.floating.style;Ve.setProperty("--radix-popper-available-width",`${Zt}px`),Ve.setProperty("--radix-popper-available-height",`${jn}px`),Ve.setProperty("--radix-popper-anchor-width",`${Nr}px`),Ve.setProperty("--radix-popper-anchor-height",`${va}px`)}}),D&&hV({element:D,padding:d}),SV({arrowWidth:T,arrowHeight:M}),v&&fV({strategy:"referenceHidden",...J})]}),[ie,xe]=VN(k),L=bs(w);jr(()=>{z&&(L==null||L())},[z,L]);const P=(le=B.arrow)==null?void 0:le.x,q=(Ae=B.arrow)==null?void 0:Ae.y,te=((we=B.arrow)==null?void 0:we.centerOffset)!==0,[ue,ve]=m.useState();return jr(()=>{R&&ve(window.getComputedStyle(R).zIndex)},[R]),s.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:z?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ue,"--radix-popper-transform-origin":[(Ne=B.transformOrigin)==null?void 0:Ne.x,(Be=B.transformOrigin)==null?void 0:Be.y].join(" "),...((Qe=B.hide)==null?void 0:Qe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(yV,{scope:n,placedSide:ie,onArrowChange:A,arrowX:P,arrowY:q,shouldHideArrow:te,children:s.jsx(et.div,{"data-side":ie,"data-align":xe,...S,ref:_,style:{...S.style,animation:z?void 0:"none"}})})})});PN.displayName=ib;var UN="PopperArrow",xV={top:"bottom",right:"left",bottom:"top",left:"right"},FN=m.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,l=vV(UN,r),c=xV[l.placedSide];return s.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:s.jsx(pV,{...o,ref:n,style:{...o.style,display:"block"}})})});FN.displayName=UN;function bV(e){return e!==null}var SV=e=>({name:"transformOrigin",options:e,fn(t){var C,R,j;const{placement:n,rects:r,middlewareData:o}=t,c=((C=o.arrow)==null?void 0:C.centerOffset)!==0,d=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[h,g]=VN(n),y={start:"0%",center:"50%",end:"100%"}[g],v=(((R=o.arrow)==null?void 0:R.x)??0)+d/2,b=(((j=o.arrow)==null?void 0:j.y)??0)+f/2;let w="",S="";return h==="bottom"?(w=c?y:`${v}px`,S=`${-f}px`):h==="top"?(w=c?y:`${v}px`,S=`${r.floating.height+f}px`):h==="right"?(w=`${-f}px`,S=c?y:`${b}px`):h==="left"&&(w=`${r.floating.width+f}px`,S=c?y:`${b}px`),{data:{x:w,y:S}}}});function VN(e){const[t,n="center"]=e.split("-");return[t,n]}var ku=IN,Lu=LN,If=PN,kf=FN,CV=Symbol("radix.slottable");function EV(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=CV,t}var zN=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),wV="VisuallyHidden",HN=m.forwardRef((e,t)=>s.jsx(et.span,{...e,ref:t,style:{...zN,...e.style}}));HN.displayName=wV;var RV=HN,[vg]=cr("Tooltip",[eo]),xg=eo(),$N="TooltipProvider",jV=700,O0="tooltip.open",[TV,lb]=vg($N),BN=e=>{const{__scopeTooltip:t,delayDuration:n=jV,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:l}=e,c=m.useRef(!0),d=m.useRef(!1),f=m.useRef(0);return m.useEffect(()=>{const h=f.current;return()=>window.clearTimeout(h)},[]),s.jsx(TV,{scope:t,isOpenDelayedRef:c,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(f.current),c.current=!1},[]),onClose:m.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>c.current=!0,r)},[r]),isPointerInTransitRef:d,onPointerInTransitChange:m.useCallback(h=>{d.current=h},[]),disableHoverableContent:o,children:l})};BN.displayName=$N;var pf="Tooltip",[_V,Lf]=vg(pf),GN=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:l,disableHoverableContent:c,delayDuration:d}=e,f=lb(pf,e.__scopeTooltip),h=xg(t),[g,y]=m.useState(null),v=Ln(),b=m.useRef(0),w=c??f.disableHoverableContent,S=d??f.delayDuration,C=m.useRef(!1),[R,j]=Gr({prop:r,defaultProp:o??!1,onChange:T=>{T?(f.onOpen(),document.dispatchEvent(new CustomEvent(O0))):f.onClose(),l==null||l(T)},caller:pf}),_=m.useMemo(()=>R?C.current?"delayed-open":"instant-open":"closed",[R]),D=m.useCallback(()=>{window.clearTimeout(b.current),b.current=0,C.current=!1,j(!0)},[j]),A=m.useCallback(()=>{window.clearTimeout(b.current),b.current=0,j(!1)},[j]),O=m.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{C.current=!0,j(!0),b.current=0},S)},[S,j]);return m.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),s.jsx(ku,{...h,children:s.jsx(_V,{scope:t,contentId:v,open:R,stateAttribute:_,trigger:g,onTriggerChange:y,onTriggerEnter:m.useCallback(()=>{f.isOpenDelayedRef.current?O():D()},[f.isOpenDelayedRef,O,D]),onTriggerLeave:m.useCallback(()=>{w?A():(window.clearTimeout(b.current),b.current=0)},[A,w]),onOpen:D,onClose:A,disableHoverableContent:w,children:n})})};GN.displayName=pf;var M0="TooltipTrigger",qN=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Lf(M0,n),l=lb(M0,n),c=xg(n),d=m.useRef(null),f=dt(t,d,o.onTriggerChange),h=m.useRef(!1),g=m.useRef(!1),y=m.useCallback(()=>h.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",y),[y]),s.jsx(Lu,{asChild:!0,...c,children:s.jsx(et.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:f,onPointerMove:Te(e.onPointerMove,v=>{v.pointerType!=="touch"&&!g.current&&!l.isPointerInTransitRef.current&&(o.onTriggerEnter(),g.current=!0)}),onPointerLeave:Te(e.onPointerLeave,()=>{o.onTriggerLeave(),g.current=!1}),onPointerDown:Te(e.onPointerDown,()=>{o.open&&o.onClose(),h.current=!0,document.addEventListener("pointerup",y,{once:!0})}),onFocus:Te(e.onFocus,()=>{h.current||o.onOpen()}),onBlur:Te(e.onBlur,o.onClose),onClick:Te(e.onClick,o.onClose)})})});qN.displayName=M0;var cb="TooltipPortal",[NV,AV]=vg(cb,{forceMount:void 0}),ZN=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,l=Lf(cb,t);return s.jsx(NV,{scope:t,forceMount:n,children:s.jsx(_r,{present:n||l.open,children:s.jsx(tc,{asChild:!0,container:o,children:r})})})};ZN.displayName=cb;var Su="TooltipContent",KN=m.forwardRef((e,t)=>{const n=AV(Su,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...l}=e,c=Lf(Su,e.__scopeTooltip);return s.jsx(_r,{present:r||c.open,children:c.disableHoverableContent?s.jsx(YN,{side:o,...l,ref:t}):s.jsx(DV,{side:o,...l,ref:t})})}),DV=m.forwardRef((e,t)=>{const n=Lf(Su,e.__scopeTooltip),r=lb(Su,e.__scopeTooltip),o=m.useRef(null),l=dt(t,o),[c,d]=m.useState(null),{trigger:f,onClose:h}=n,g=o.current,{onPointerInTransitChange:y}=r,v=m.useCallback(()=>{d(null),y(!1)},[y]),b=m.useCallback((w,S)=>{const C=w.currentTarget,R={x:w.clientX,y:w.clientY},j=kV(R,C.getBoundingClientRect()),_=LV(R,j),D=PV(S.getBoundingClientRect()),A=FV([..._,...D]);d(A),y(!0)},[y]);return m.useEffect(()=>()=>v(),[v]),m.useEffect(()=>{if(f&&g){const w=C=>b(C,g),S=C=>b(C,f);return f.addEventListener("pointerleave",w),g.addEventListener("pointerleave",S),()=>{f.removeEventListener("pointerleave",w),g.removeEventListener("pointerleave",S)}}},[f,g,b,v]),m.useEffect(()=>{if(c){const w=S=>{const C=S.target,R={x:S.clientX,y:S.clientY},j=(f==null?void 0:f.contains(C))||(g==null?void 0:g.contains(C)),_=!UV(R,c);j?v():_&&(v(),h())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[f,g,c,h,v]),s.jsx(YN,{...e,ref:l})}),[OV,MV]=vg(pf,{isInside:!1}),IV=EV("TooltipContent"),YN=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:l,onPointerDownOutside:c,...d}=e,f=Lf(Su,n),h=xg(n),{onClose:g}=f;return m.useEffect(()=>(document.addEventListener(O0,g),()=>document.removeEventListener(O0,g)),[g]),m.useEffect(()=>{if(f.trigger){const y=v=>{const b=v.target;b!=null&&b.contains(f.trigger)&&g()};return window.addEventListener("scroll",y,{capture:!0}),()=>window.removeEventListener("scroll",y,{capture:!0})}},[f.trigger,g]),s.jsx(ec,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:y=>y.preventDefault(),onDismiss:g,children:s.jsxs(If,{"data-state":f.stateAttribute,...h,...d,ref:t,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[s.jsx(IV,{children:r}),s.jsx(OV,{scope:n,isInside:!0,children:s.jsx(RV,{id:f.contentId,role:"tooltip",children:o||r})})]})})});KN.displayName=Su;var WN="TooltipArrow",QN=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=xg(n);return MV(WN,n).isInside?null:s.jsx(kf,{...o,...r,ref:t})});QN.displayName=WN;function kV(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),l=Math.abs(t.left-e.x);switch(Math.min(n,r,o,l)){case l:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function LV(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function PV(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function UV(e,t){const{x:n,y:r}=e;let o=!1;for(let l=0,c=t.length-1;l<t.length;c=l++){const d=t[l],f=t[c],h=d.x,g=d.y,y=f.x,v=f.y;g>r!=v>r&&n<(y-h)*(r-g)/(v-g)+h&&(o=!o)}return o}function FV(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),VV(t)}function VV(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const l=t[t.length-1],c=t[t.length-2];if((l.x-c.x)*(o.y-c.y)>=(l.y-c.y)*(o.x-c.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const l=n[n.length-1],c=n[n.length-2];if((l.x-c.x)*(o.y-c.y)>=(l.y-c.y)*(o.x-c.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var zV=BN,HV=GN,$V=qN,BV=ZN,GV=KN,qV=QN;function vs({delayDuration:e=0,...t}){return s.jsx(zV,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function bt({...e}){return s.jsx(vs,{children:s.jsx(HV,{"data-slot":"tooltip",...e})})}function St({...e}){return s.jsx($V,{"data-slot":"tooltip-trigger",...e})}function Ct({className:e,sideOffset:t=0,children:n,...r}){return s.jsx(BV,{children:s.jsxs(GV,{"data-slot":"tooltip-content",sideOffset:t,className:ne("animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-[--radix-tooltip-content-transform-origin] rounded-md bg-black px-3 py-1.5 text-xs text-balance text-white dark:bg-white dark:text-black",e),...r,children:[n,s.jsx(qV,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-black fill-black dark:bg-white dark:fill-white"})]})})}const ZV="sidebar_state",KV=3600*24*7,YV="16rem",WV="18rem",QV="3rem",XV="b",XN=m.createContext(null);function Pf(){const e=m.useContext(XN);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function JV({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:o,children:l,...c}){const d=jL(),[f,h]=m.useState(!1),[g,y]=m.useState(e),v=t??g,b=m.useCallback(R=>{const j=typeof R=="function"?R(v):R;n?n(j):y(j),document.cookie=`${ZV}=${j}; path=/; max-age=${KV}`},[n,v]),w=m.useCallback(()=>d?h(R=>!R):b(R=>!R),[d,b,h]);m.useEffect(()=>{const R=j=>{j.key===XV&&(j.metaKey||j.ctrlKey)&&(j.preventDefault(),w())};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[w]);const S=v?"expanded":"collapsed",C=m.useMemo(()=>({state:S,open:v,setOpen:b,isMobile:d,openMobile:f,setOpenMobile:h,toggleSidebar:w}),[S,v,b,d,f,h,w]);return s.jsx(XN.Provider,{value:C,children:s.jsx(vs,{delayDuration:0,children:s.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":YV,"--sidebar-width-icon":QV,...o},className:ne("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...c,children:l})})})}function ez({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:o,...l}){const{isMobile:c,state:d,openMobile:f,setOpenMobile:h}=Pf();return n==="none"?s.jsx("div",{"data-slot":"sidebar",className:ne("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...l,children:o}):c?s.jsx(Bo,{open:f,onOpenChange:h,...l,children:s.jsxs(Go,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) min-w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":WV},side:e,children:[s.jsxs(qo,{className:"sr-only",children:[s.jsx(Zo,{children:"Sidebar"}),s.jsx(Xi,{children:"Displays the mobile sidebar."})]}),s.jsx("div",{className:"flex h-full w-full flex-col",children:o})]})}):s.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":d,"data-collapsible":d==="collapsed"?n:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[s.jsx("div",{"data-slot":"sidebar-gap",className:ne("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),s.jsx("div",{"data-slot":"sidebar-container",className:ne("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...l,children:s.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:o})})]})}function tz({className:e,onClick:t,...n}){const{toggleSidebar:r}=Pf();return s.jsx("div",{className:"absolute top-4 left-0 z-10 md:hidden",children:s.jsxs(Se,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:ne("size-7",e),onClick:o=>{t==null||t(o),r()},...n,children:[s.jsx(Hk,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})})}function nz({className:e,...t}){const{toggleSidebar:n}=Pf();return s.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:ne("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})}function rz({className:e,...t}){return s.jsx("main",{"data-slot":"sidebar-inset",className:ne("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...t})}function az({className:e,...t}){return s.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:ne("flex flex-col gap-2 p-2",e),...t})}function sz({className:e,...t}){return s.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:ne("flex flex-col gap-2 p-2",e),...t})}function oz({className:e,...t}){return s.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:ne("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function QR({className:e,...t}){return s.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:ne("relative flex w-full min-w-0 flex-col p-2",e),...t})}function XR({className:e,...t}){return s.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:ne("w-full text-sm",e),...t})}function iz({className:e,...t}){return s.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:ne("flex w-full min-w-0 flex-col gap-1",e),...t})}function lz({className:e,...t}){return s.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:ne("group/menu-item relative",e),...t})}const cz=_f("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function uz({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:o,className:l,...c}){const d=e?tg:"button",{isMobile:f,state:h}=Pf(),g=s.jsx(d,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":t,className:ne(cz({variant:n,size:r}),l),...c});return o?(typeof o=="string"&&(o={children:o}),s.jsxs(bt,{children:[s.jsx(St,{asChild:!0,children:g}),s.jsx(Ct,{side:"right",align:"center",hidden:h!=="collapsed"||f,...o})]})):g}function I0(e){const t=dz(e),n=m.forwardRef((r,o)=>{const{children:l,...c}=r,d=m.Children.toArray(l),f=d.find(hz);if(f){const h=f.props.children,g=d.map(y=>y===f?m.Children.count(h)>1?m.Children.only(null):m.isValidElement(h)?h.props.children:null:y);return s.jsx(t,{...c,ref:o,children:m.isValidElement(h)?m.cloneElement(h,void 0,g):null})}return s.jsx(t,{...c,ref:o,children:l})});return n.displayName=`${e}.Slot`,n}function dz(e){const t=m.forwardRef((n,r)=>{const{children:o,...l}=n;if(m.isValidElement(o)){const c=pz(o),d=mz(l,o.props);return o.type!==m.Fragment&&(d.ref=r?Lr(r,c):c),m.cloneElement(o,d)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var fz=Symbol("radix.slottable");function hz(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fz}function mz(e,t){const n={...t};for(const r in t){const o=e[r],l=t[r];/^on[A-Z]/.test(r)?o&&l?n[r]=(...d)=>{const f=l(...d);return o(...d),f}:o&&(n[r]=o):r==="style"?n[r]={...o,...l}:r==="className"&&(n[r]=[o,l].filter(Boolean).join(" "))}return{...e,...n}}function pz(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function gz(e){const t=e+"CollectionProvider",[n,r]=cr(t),[o,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=S=>{const{scope:C,children:R}=S,j=ye.useRef(null),_=ye.useRef(new Map).current;return s.jsx(o,{scope:C,itemMap:_,collectionRef:j,children:R})};c.displayName=t;const d=e+"CollectionSlot",f=I0(d),h=ye.forwardRef((S,C)=>{const{scope:R,children:j}=S,_=l(d,R),D=dt(C,_.collectionRef);return s.jsx(f,{ref:D,children:j})});h.displayName=d;const g=e+"CollectionItemSlot",y="data-radix-collection-item",v=I0(g),b=ye.forwardRef((S,C)=>{const{scope:R,children:j,..._}=S,D=ye.useRef(null),A=dt(C,D),O=l(g,R);return ye.useEffect(()=>(O.itemMap.set(D,{ref:D,..._}),()=>void O.itemMap.delete(D))),s.jsx(v,{[y]:"",ref:A,children:j})});b.displayName=g;function w(S){const C=l(e+"CollectionConsumer",S);return ye.useCallback(()=>{const j=C.collectionRef.current;if(!j)return[];const _=Array.from(j.querySelectorAll(`[${y}]`));return Array.from(C.itemMap.values()).sort((O,T)=>_.indexOf(O.ref.current)-_.indexOf(T.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:c,Slot:h,ItemSlot:b},w,r]}var yz=m.createContext(void 0);function Uf(e){const t=m.useContext(yz);return e||t||"ltr"}function JR(e){const t=vz(e),n=m.forwardRef((r,o)=>{const{children:l,...c}=r,d=m.Children.toArray(l),f=d.find(bz);if(f){const h=f.props.children,g=d.map(y=>y===f?m.Children.count(h)>1?m.Children.only(null):m.isValidElement(h)?h.props.children:null:y);return s.jsx(t,{...c,ref:o,children:m.isValidElement(h)?m.cloneElement(h,void 0,g):null})}return s.jsx(t,{...c,ref:o,children:l})});return n.displayName=`${e}.Slot`,n}function vz(e){const t=m.forwardRef((n,r)=>{const{children:o,...l}=n;if(m.isValidElement(o)){const c=Cz(o),d=Sz(l,o.props);return o.type!==m.Fragment&&(d.ref=r?Lr(r,c):c),m.cloneElement(o,d)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var xz=Symbol("radix.slottable");function bz(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===xz}function Sz(e,t){const n={...t};for(const r in t){const o=e[r],l=t[r];/^on[A-Z]/.test(r)?o&&l?n[r]=(...d)=>{const f=l(...d);return o(...d),f}:o&&(n[r]=o):r==="style"?n[r]={...o,...l}:r==="className"&&(n[r]=[o,l].filter(Boolean).join(" "))}return{...e,...n}}function Cz(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Ez(e){const t=e+"CollectionProvider",[n,r]=cr(t),[o,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=S=>{const{scope:C,children:R}=S,j=ye.useRef(null),_=ye.useRef(new Map).current;return s.jsx(o,{scope:C,itemMap:_,collectionRef:j,children:R})};c.displayName=t;const d=e+"CollectionSlot",f=JR(d),h=ye.forwardRef((S,C)=>{const{scope:R,children:j}=S,_=l(d,R),D=dt(C,_.collectionRef);return s.jsx(f,{ref:D,children:j})});h.displayName=d;const g=e+"CollectionItemSlot",y="data-radix-collection-item",v=JR(g),b=ye.forwardRef((S,C)=>{const{scope:R,children:j,..._}=S,D=ye.useRef(null),A=dt(C,D),O=l(g,R);return ye.useEffect(()=>(O.itemMap.set(D,{ref:D,..._}),()=>void O.itemMap.delete(D))),s.jsx(v,{[y]:"",ref:A,children:j})});b.displayName=g;function w(S){const C=l(e+"CollectionConsumer",S);return ye.useCallback(()=>{const j=C.collectionRef.current;if(!j)return[];const _=Array.from(j.querySelectorAll(`[${y}]`));return Array.from(C.itemMap.values()).sort((O,T)=>_.indexOf(O.ref.current)-_.indexOf(T.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:c,Slot:h,ItemSlot:b},w,r]}var kx="rovingFocusGroup.onEntryFocus",wz={bubbles:!1,cancelable:!0},Ff="RovingFocusGroup",[k0,JN,Rz]=Ez(Ff),[jz,bg]=cr(Ff,[Rz]),[Tz,_z]=jz(Ff),e4=m.forwardRef((e,t)=>s.jsx(k0.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(k0.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(Nz,{...e,ref:t})})}));e4.displayName=Ff;var Nz=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:l,currentTabStopId:c,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:f,onEntryFocus:h,preventScrollOnEntryFocus:g=!1,...y}=e,v=m.useRef(null),b=dt(t,v),w=Uf(l),[S,C]=Gr({prop:c,defaultProp:d??null,onChange:f,caller:Ff}),[R,j]=m.useState(!1),_=bs(h),D=JN(n),A=m.useRef(!1),[O,T]=m.useState(0);return m.useEffect(()=>{const M=v.current;if(M)return M.addEventListener(kx,_),()=>M.removeEventListener(kx,_)},[_]),s.jsx(Tz,{scope:n,orientation:r,dir:w,loop:o,currentTabStopId:S,onItemFocus:m.useCallback(M=>C(M),[C]),onItemShiftTab:m.useCallback(()=>j(!0),[]),onFocusableItemAdd:m.useCallback(()=>T(M=>M+1),[]),onFocusableItemRemove:m.useCallback(()=>T(M=>M-1),[]),children:s.jsx(et.div,{tabIndex:R||O===0?-1:0,"data-orientation":r,...y,ref:b,style:{outline:"none",...e.style},onMouseDown:Te(e.onMouseDown,()=>{A.current=!0}),onFocus:Te(e.onFocus,M=>{const F=!A.current;if(M.target===M.currentTarget&&F&&!R){const G=new CustomEvent(kx,wz);if(M.currentTarget.dispatchEvent(G),!G.defaultPrevented){const Y=D().filter(k=>k.focusable),Z=Y.find(k=>k.active),J=Y.find(k=>k.id===S),K=[Z,J,...Y].filter(Boolean).map(k=>k.ref.current);r4(K,g)}}A.current=!1}),onBlur:Te(e.onBlur,()=>j(!1))})})}),t4="RovingFocusGroupItem",n4=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:l,children:c,...d}=e,f=Ln(),h=l||f,g=_z(t4,n),y=g.currentTabStopId===h,v=JN(n),{onFocusableItemAdd:b,onFocusableItemRemove:w,currentTabStopId:S}=g;return m.useEffect(()=>{if(r)return b(),()=>w()},[r,b,w]),s.jsx(k0.ItemSlot,{scope:n,id:h,focusable:r,active:o,children:s.jsx(et.span,{tabIndex:y?0:-1,"data-orientation":g.orientation,...d,ref:t,onMouseDown:Te(e.onMouseDown,C=>{r?g.onItemFocus(h):C.preventDefault()}),onFocus:Te(e.onFocus,()=>g.onItemFocus(h)),onKeyDown:Te(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){g.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const R=Oz(C,g.orientation,g.dir);if(R!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let _=v().filter(D=>D.focusable).map(D=>D.ref.current);if(R==="last")_.reverse();else if(R==="prev"||R==="next"){R==="prev"&&_.reverse();const D=_.indexOf(C.currentTarget);_=g.loop?Mz(_,D+1):_.slice(D+1)}setTimeout(()=>r4(_))}}),children:typeof c=="function"?c({isCurrentTabStop:y,hasTabStop:S!=null}):c})})});n4.displayName=t4;var Az={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Dz(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Oz(e,t,n){const r=Dz(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Az[r]}function r4(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Mz(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var a4=e4,s4=n4,L0=["Enter"," "],Iz=["ArrowDown","PageUp","Home"],o4=["ArrowUp","PageDown","End"],kz=[...Iz,...o4],Lz={ltr:[...L0,"ArrowRight"],rtl:[...L0,"ArrowLeft"]},Pz={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Vf="Menu",[gf,Uz,Fz]=gz(Vf),[nc,i4]=cr(Vf,[Fz,eo,bg]),zf=eo(),l4=bg(),[c4,Ji]=nc(Vf),[Vz,Hf]=nc(Vf),u4=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:l,modal:c=!0}=e,d=zf(t),[f,h]=m.useState(null),g=m.useRef(!1),y=bs(l),v=Uf(o);return m.useEffect(()=>{const b=()=>{g.current=!0,document.addEventListener("pointerdown",w,{capture:!0,once:!0}),document.addEventListener("pointermove",w,{capture:!0,once:!0})},w=()=>g.current=!1;return document.addEventListener("keydown",b,{capture:!0}),()=>{document.removeEventListener("keydown",b,{capture:!0}),document.removeEventListener("pointerdown",w,{capture:!0}),document.removeEventListener("pointermove",w,{capture:!0})}},[]),s.jsx(ku,{...d,children:s.jsx(c4,{scope:t,open:n,onOpenChange:y,content:f,onContentChange:h,children:s.jsx(Vz,{scope:t,onClose:m.useCallback(()=>y(!1),[y]),isUsingKeyboardRef:g,dir:v,modal:c,children:r})})})};u4.displayName=Vf;var zz="MenuAnchor",ub=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=zf(n);return s.jsx(Lu,{...o,...r,ref:t})});ub.displayName=zz;var db="MenuPortal",[Hz,d4]=nc(db,{forceMount:void 0}),f4=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,l=Ji(db,t);return s.jsx(Hz,{scope:t,forceMount:n,children:s.jsx(_r,{present:n||l.open,children:s.jsx(tc,{asChild:!0,container:o,children:r})})})};f4.displayName=db;var Ja="MenuContent",[$z,fb]=nc(Ja),h4=m.forwardRef((e,t)=>{const n=d4(Ja,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,l=Ji(Ja,e.__scopeMenu),c=Hf(Ja,e.__scopeMenu);return s.jsx(gf.Provider,{scope:e.__scopeMenu,children:s.jsx(_r,{present:r||l.open,children:s.jsx(gf.Slot,{scope:e.__scopeMenu,children:c.modal?s.jsx(Bz,{...o,ref:t}):s.jsx(Gz,{...o,ref:t})})})})}),Bz=m.forwardRef((e,t)=>{const n=Ji(Ja,e.__scopeMenu),r=m.useRef(null),o=dt(t,r);return m.useEffect(()=>{const l=r.current;if(l)return ig(l)},[]),s.jsx(hb,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Te(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Gz=m.forwardRef((e,t)=>{const n=Ji(Ja,e.__scopeMenu);return s.jsx(hb,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),qz=I0("MenuContent.ScrollLock"),hb=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:l,onCloseAutoFocus:c,disableOutsidePointerEvents:d,onEntryFocus:f,onEscapeKeyDown:h,onPointerDownOutside:g,onFocusOutside:y,onInteractOutside:v,onDismiss:b,disableOutsideScroll:w,...S}=e,C=Ji(Ja,n),R=Hf(Ja,n),j=zf(n),_=l4(n),D=Uz(n),[A,O]=m.useState(null),T=m.useRef(null),M=dt(t,T,C.onContentChange),F=m.useRef(0),G=m.useRef(""),Y=m.useRef(0),Z=m.useRef(null),J=m.useRef("right"),H=m.useRef(0),K=w?Of:m.Fragment,k=w?{as:qz,allowPinchZoom:!0}:void 0,z=ie=>{var le,Ae;const xe=G.current+ie,L=D().filter(we=>!we.disabled),P=document.activeElement,q=(le=L.find(we=>we.ref.current===P))==null?void 0:le.textValue,te=L.map(we=>we.textValue),ue=aH(te,xe,q),ve=(Ae=L.find(we=>we.textValue===ue))==null?void 0:Ae.ref.current;(function we(Ne){G.current=Ne,window.clearTimeout(F.current),Ne!==""&&(F.current=window.setTimeout(()=>we(""),1e3))})(xe),ve&&setTimeout(()=>ve.focus())};m.useEffect(()=>()=>window.clearTimeout(F.current),[]),sg();const B=m.useCallback(ie=>{var L,P;return J.current===((L=Z.current)==null?void 0:L.side)&&oH(ie,(P=Z.current)==null?void 0:P.area)},[]);return s.jsx($z,{scope:n,searchRef:G,onItemEnter:m.useCallback(ie=>{B(ie)&&ie.preventDefault()},[B]),onItemLeave:m.useCallback(ie=>{var xe;B(ie)||((xe=T.current)==null||xe.focus(),O(null))},[B]),onTriggerLeave:m.useCallback(ie=>{B(ie)&&ie.preventDefault()},[B]),pointerGraceTimerRef:Y,onPointerGraceIntentChange:m.useCallback(ie=>{Z.current=ie},[]),children:s.jsx(K,{...k,children:s.jsx(Df,{asChild:!0,trapped:o,onMountAutoFocus:Te(l,ie=>{var xe;ie.preventDefault(),(xe=T.current)==null||xe.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:s.jsx(ec,{asChild:!0,disableOutsidePointerEvents:d,onEscapeKeyDown:h,onPointerDownOutside:g,onFocusOutside:y,onInteractOutside:v,onDismiss:b,children:s.jsx(a4,{asChild:!0,..._,dir:R.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:O,onEntryFocus:Te(f,ie=>{R.isUsingKeyboardRef.current||ie.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(If,{role:"menu","aria-orientation":"vertical","data-state":A4(C.open),"data-radix-menu-content":"",dir:R.dir,...j,...S,ref:M,style:{outline:"none",...S.style},onKeyDown:Te(S.onKeyDown,ie=>{const L=ie.target.closest("[data-radix-menu-content]")===ie.currentTarget,P=ie.ctrlKey||ie.altKey||ie.metaKey,q=ie.key.length===1;L&&(ie.key==="Tab"&&ie.preventDefault(),!P&&q&&z(ie.key));const te=T.current;if(ie.target!==te||!kz.includes(ie.key))return;ie.preventDefault();const ve=D().filter(le=>!le.disabled).map(le=>le.ref.current);o4.includes(ie.key)&&ve.reverse(),nH(ve)}),onBlur:Te(e.onBlur,ie=>{ie.currentTarget.contains(ie.target)||(window.clearTimeout(F.current),G.current="")}),onPointerMove:Te(e.onPointerMove,yf(ie=>{const xe=ie.target,L=H.current!==ie.clientX;if(ie.currentTarget.contains(xe)&&L){const P=ie.clientX>H.current?"right":"left";J.current=P,H.current=ie.clientX}}))})})})})})})});h4.displayName=Ja;var Zz="MenuGroup",mb=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(et.div,{role:"group",...r,ref:t})});mb.displayName=Zz;var Kz="MenuLabel",m4=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(et.div,{...r,ref:t})});m4.displayName=Kz;var vp="MenuItem",ej="menu.itemSelect",Sg=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,l=m.useRef(null),c=Hf(vp,e.__scopeMenu),d=fb(vp,e.__scopeMenu),f=dt(t,l),h=m.useRef(!1),g=()=>{const y=l.current;if(!n&&y){const v=new CustomEvent(ej,{bubbles:!0,cancelable:!0});y.addEventListener(ej,b=>r==null?void 0:r(b),{once:!0}),G_(y,v),v.defaultPrevented?h.current=!1:c.onClose()}};return s.jsx(p4,{...o,ref:f,disabled:n,onClick:Te(e.onClick,g),onPointerDown:y=>{var v;(v=e.onPointerDown)==null||v.call(e,y),h.current=!0},onPointerUp:Te(e.onPointerUp,y=>{var v;h.current||(v=y.currentTarget)==null||v.click()}),onKeyDown:Te(e.onKeyDown,y=>{const v=d.searchRef.current!=="";n||v&&y.key===" "||L0.includes(y.key)&&(y.currentTarget.click(),y.preventDefault())})})});Sg.displayName=vp;var p4=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...l}=e,c=fb(vp,n),d=l4(n),f=m.useRef(null),h=dt(t,f),[g,y]=m.useState(!1),[v,b]=m.useState("");return m.useEffect(()=>{const w=f.current;w&&b((w.textContent??"").trim())},[l.children]),s.jsx(gf.ItemSlot,{scope:n,disabled:r,textValue:o??v,children:s.jsx(s4,{asChild:!0,...d,focusable:!r,children:s.jsx(et.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...l,ref:h,onPointerMove:Te(e.onPointerMove,yf(w=>{r?c.onItemLeave(w):(c.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Te(e.onPointerLeave,yf(w=>c.onItemLeave(w))),onFocus:Te(e.onFocus,()=>y(!0)),onBlur:Te(e.onBlur,()=>y(!1))})})})}),Yz="MenuCheckboxItem",g4=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return s.jsx(S4,{scope:e.__scopeMenu,checked:n,children:s.jsx(Sg,{role:"menuitemcheckbox","aria-checked":xp(n)?"mixed":n,...o,ref:t,"data-state":yb(n),onSelect:Te(o.onSelect,()=>r==null?void 0:r(xp(n)?!0:!n),{checkForDefaultPrevented:!1})})})});g4.displayName=Yz;var y4="MenuRadioGroup",[Wz,Qz]=nc(y4,{value:void 0,onValueChange:()=>{}}),v4=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,l=bs(r);return s.jsx(Wz,{scope:e.__scopeMenu,value:n,onValueChange:l,children:s.jsx(mb,{...o,ref:t})})});v4.displayName=y4;var x4="MenuRadioItem",b4=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=Qz(x4,e.__scopeMenu),l=n===o.value;return s.jsx(S4,{scope:e.__scopeMenu,checked:l,children:s.jsx(Sg,{role:"menuitemradio","aria-checked":l,...r,ref:t,"data-state":yb(l),onSelect:Te(r.onSelect,()=>{var c;return(c=o.onValueChange)==null?void 0:c.call(o,n)},{checkForDefaultPrevented:!1})})})});b4.displayName=x4;var pb="MenuItemIndicator",[S4,Xz]=nc(pb,{checked:!1}),C4=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,l=Xz(pb,n);return s.jsx(_r,{present:r||xp(l.checked)||l.checked===!0,children:s.jsx(et.span,{...o,ref:t,"data-state":yb(l.checked)})})});C4.displayName=pb;var Jz="MenuSeparator",E4=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(et.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});E4.displayName=Jz;var eH="MenuArrow",w4=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=zf(n);return s.jsx(kf,{...o,...r,ref:t})});w4.displayName=eH;var gb="MenuSub",[tH,R4]=nc(gb),j4=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,l=Ji(gb,t),c=zf(t),[d,f]=m.useState(null),[h,g]=m.useState(null),y=bs(o);return m.useEffect(()=>(l.open===!1&&y(!1),()=>y(!1)),[l.open,y]),s.jsx(ku,{...c,children:s.jsx(c4,{scope:t,open:r,onOpenChange:y,content:h,onContentChange:g,children:s.jsx(tH,{scope:t,contentId:Ln(),triggerId:Ln(),trigger:d,onTriggerChange:f,children:n})})})};j4.displayName=gb;var Yd="MenuSubTrigger",T4=m.forwardRef((e,t)=>{const n=Ji(Yd,e.__scopeMenu),r=Hf(Yd,e.__scopeMenu),o=R4(Yd,e.__scopeMenu),l=fb(Yd,e.__scopeMenu),c=m.useRef(null),{pointerGraceTimerRef:d,onPointerGraceIntentChange:f}=l,h={__scopeMenu:e.__scopeMenu},g=m.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return m.useEffect(()=>g,[g]),m.useEffect(()=>{const y=d.current;return()=>{window.clearTimeout(y),f(null)}},[d,f]),s.jsx(ub,{asChild:!0,...h,children:s.jsx(p4,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":A4(n.open),...e,ref:Lr(t,o.onTriggerChange),onClick:y=>{var v;(v=e.onClick)==null||v.call(e,y),!(e.disabled||y.defaultPrevented)&&(y.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Te(e.onPointerMove,yf(y=>{l.onItemEnter(y),!y.defaultPrevented&&!e.disabled&&!n.open&&!c.current&&(l.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{n.onOpenChange(!0),g()},100))})),onPointerLeave:Te(e.onPointerLeave,yf(y=>{var b,w;g();const v=(b=n.content)==null?void 0:b.getBoundingClientRect();if(v){const S=(w=n.content)==null?void 0:w.dataset.side,C=S==="right",R=C?-5:5,j=v[C?"left":"right"],_=v[C?"right":"left"];l.onPointerGraceIntentChange({area:[{x:y.clientX+R,y:y.clientY},{x:j,y:v.top},{x:_,y:v.top},{x:_,y:v.bottom},{x:j,y:v.bottom}],side:S}),window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(y),y.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:Te(e.onKeyDown,y=>{var b;const v=l.searchRef.current!=="";e.disabled||v&&y.key===" "||Lz[r.dir].includes(y.key)&&(n.onOpenChange(!0),(b=n.content)==null||b.focus(),y.preventDefault())})})})});T4.displayName=Yd;var _4="MenuSubContent",N4=m.forwardRef((e,t)=>{const n=d4(Ja,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,l=Ji(Ja,e.__scopeMenu),c=Hf(Ja,e.__scopeMenu),d=R4(_4,e.__scopeMenu),f=m.useRef(null),h=dt(t,f);return s.jsx(gf.Provider,{scope:e.__scopeMenu,children:s.jsx(_r,{present:r||l.open,children:s.jsx(gf.Slot,{scope:e.__scopeMenu,children:s.jsx(hb,{id:d.contentId,"aria-labelledby":d.triggerId,...o,ref:h,align:"start",side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:g=>{var y;c.isUsingKeyboardRef.current&&((y=f.current)==null||y.focus()),g.preventDefault()},onCloseAutoFocus:g=>g.preventDefault(),onFocusOutside:Te(e.onFocusOutside,g=>{g.target!==d.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:Te(e.onEscapeKeyDown,g=>{c.onClose(),g.preventDefault()}),onKeyDown:Te(e.onKeyDown,g=>{var b;const y=g.currentTarget.contains(g.target),v=Pz[c.dir].includes(g.key);y&&v&&(l.onOpenChange(!1),(b=d.trigger)==null||b.focus(),g.preventDefault())})})})})})});N4.displayName=_4;function A4(e){return e?"open":"closed"}function xp(e){return e==="indeterminate"}function yb(e){return xp(e)?"indeterminate":e?"checked":"unchecked"}function nH(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function rH(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function aH(e,t,n){const o=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let c=rH(e,Math.max(l,0));o.length===1&&(c=c.filter(h=>h!==n));const f=c.find(h=>h.toLowerCase().startsWith(o.toLowerCase()));return f!==n?f:void 0}function sH(e,t){const{x:n,y:r}=e;let o=!1;for(let l=0,c=t.length-1;l<t.length;c=l++){const d=t[l],f=t[c],h=d.x,g=d.y,y=f.x,v=f.y;g>r!=v>r&&n<(y-h)*(r-g)/(v-g)+h&&(o=!o)}return o}function oH(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return sH(n,t)}function yf(e){return t=>t.pointerType==="mouse"?e(t):void 0}var iH=u4,lH=ub,cH=f4,uH=h4,dH=mb,fH=m4,hH=Sg,mH=g4,pH=v4,gH=b4,yH=C4,vH=E4,xH=w4,bH=j4,SH=T4,CH=N4,Cg="DropdownMenu",[EH]=cr(Cg,[i4]),Pr=i4(),[wH,D4]=EH(Cg),O4=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:l,onOpenChange:c,modal:d=!0}=e,f=Pr(t),h=m.useRef(null),[g,y]=Gr({prop:o,defaultProp:l??!1,onChange:c,caller:Cg});return s.jsx(wH,{scope:t,triggerId:Ln(),triggerRef:h,contentId:Ln(),open:g,onOpenChange:y,onOpenToggle:m.useCallback(()=>y(v=>!v),[y]),modal:d,children:s.jsx(iH,{...f,open:g,onOpenChange:y,dir:r,modal:d,children:n})})};O4.displayName=Cg;var M4="DropdownMenuTrigger",I4=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,l=D4(M4,n),c=Pr(n);return s.jsx(lH,{asChild:!0,...c,children:s.jsx(et.button,{type:"button",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":l.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Lr(t,l.triggerRef),onPointerDown:Te(e.onPointerDown,d=>{!r&&d.button===0&&d.ctrlKey===!1&&(l.onOpenToggle(),l.open||d.preventDefault())}),onKeyDown:Te(e.onKeyDown,d=>{r||(["Enter"," "].includes(d.key)&&l.onOpenToggle(),d.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(d.key)&&d.preventDefault())})})})});I4.displayName=M4;var RH="DropdownMenuPortal",k4=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Pr(t);return s.jsx(cH,{...r,...n})};k4.displayName=RH;var L4="DropdownMenuContent",P4=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=D4(L4,n),l=Pr(n),c=m.useRef(!1);return s.jsx(uH,{id:o.contentId,"aria-labelledby":o.triggerId,...l,...r,ref:t,onCloseAutoFocus:Te(e.onCloseAutoFocus,d=>{var f;c.current||(f=o.triggerRef.current)==null||f.focus(),c.current=!1,d.preventDefault()}),onInteractOutside:Te(e.onInteractOutside,d=>{const f=d.detail.originalEvent,h=f.button===0&&f.ctrlKey===!0,g=f.button===2||h;(!o.modal||g)&&(c.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});P4.displayName=L4;var jH="DropdownMenuGroup",TH=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Pr(n);return s.jsx(dH,{...o,...r,ref:t})});TH.displayName=jH;var _H="DropdownMenuLabel",NH=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Pr(n);return s.jsx(fH,{...o,...r,ref:t})});NH.displayName=_H;var AH="DropdownMenuItem",U4=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Pr(n);return s.jsx(hH,{...o,...r,ref:t})});U4.displayName=AH;var DH="DropdownMenuCheckboxItem",OH=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Pr(n);return s.jsx(mH,{...o,...r,ref:t})});OH.displayName=DH;var MH="DropdownMenuRadioGroup",IH=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Pr(n);return s.jsx(pH,{...o,...r,ref:t})});IH.displayName=MH;var kH="DropdownMenuRadioItem",LH=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Pr(n);return s.jsx(gH,{...o,...r,ref:t})});LH.displayName=kH;var PH="DropdownMenuItemIndicator",UH=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Pr(n);return s.jsx(yH,{...o,...r,ref:t})});UH.displayName=PH;var FH="DropdownMenuSeparator",F4=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Pr(n);return s.jsx(vH,{...o,...r,ref:t})});F4.displayName=FH;var VH="DropdownMenuArrow",zH=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Pr(n);return s.jsx(xH,{...o,...r,ref:t})});zH.displayName=VH;var HH=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:l}=e,c=Pr(t),[d,f]=Gr({prop:r,defaultProp:l??!1,onChange:o,caller:"DropdownMenuSub"});return s.jsx(bH,{...c,open:d,onOpenChange:f,children:n})},$H="DropdownMenuSubTrigger",V4=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Pr(n);return s.jsx(SH,{...o,...r,ref:t})});V4.displayName=$H;var BH="DropdownMenuSubContent",z4=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Pr(n);return s.jsx(CH,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});z4.displayName=BH;var GH=O4,qH=I4,H4=k4,ZH=P4,KH=U4,YH=F4,WH=HH,QH=V4,XH=z4;function ur({...e}){return s.jsx(GH,{"data-slot":"dropdown-menu",...e})}function JH({...e}){return s.jsx(H4,{"data-slot":"dropdown-menu-portal",...e})}function dr({...e}){return s.jsx(qH,{"data-slot":"dropdown-menu-trigger",...e})}function fr({className:e,sideOffset:t=4,...n}){return s.jsx(H4,{children:s.jsx(ZH,{"data-slot":"dropdown-menu-content",sideOffset:t,className:ne("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function pt({className:e,inset:t,variant:n="default",...r}){return s.jsx(KH,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:ne("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function ma({className:e,...t}){return s.jsx(YH,{"data-slot":"dropdown-menu-separator",className:ne("bg-border -mx-1 my-1 h-px",e),...t})}function vb({...e}){return s.jsx(WH,{"data-slot":"dropdown-menu-sub",...e})}function xb({className:e,inset:t,children:n,...r}){return s.jsxs(QH,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:ne("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",e),...r,children:[n,s.jsx(La,{className:"ml-auto size-4"})]})}function bb({className:e,...t}){return s.jsx(XH,{"data-slot":"dropdown-menu-sub-content",className:ne("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-lg",e),...t})}const e$="data:image/svg+xml,%3csvg%20width='45'%20height='36'%20viewBox='0%200%2045%2036'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1026_9)'%3e%3cpath%20d='M41.0124%202.70808C42.5841%204.28086%2043.2307%206.93134%2043.2307%206.93134C43.2307%206.93134%2044.1924%2012.2686%2044.1924%2019.5152C44.1924%209.25778%2040.7126%207.4971%2028.6169%207.4971H17.4622C11.2702%207.4971%2011.689%2013.72%2011.2702%2016.6815L10.7614%2021.156C10.5171%2025.8635%2011.3345%2028.7805%2016.1644%2028.7805C6.09372%2028.7805%200.499987%2030.4294%200.5%2016.2326C0.499994%209.80708%201.46893%206.93134%201.46893%206.93134C1.46893%206.93134%202.11548%204.28086%203.69048%202.70808C5.26549%201.13349%207.5998%200.975453%207.5998%200.975453C7.5998%200.975453%2012.4195%200.25%2021.9403%200.25C31.4612%200.25%2036.84%200.975453%2036.84%200.975453C36.84%200.975453%2039.4359%201.13349%2041.0124%202.70808Z'%20fill='url(%23paint0_linear_1026_9)'/%3e%3cpath%20d='M44.1907%2019.8412C44.1913%2019.9695%2044.1916%2020.0989%2044.1916%2020.2295C44.1916%2026.3837%2043.2754%2028.779%2043.2754%2028.779C43.2754%2028.779%2042.5584%2031.6808%2041.3343%2032.9343C39.3918%2034.9233%2037.3144%2035.0343%2037.3144%2035.0343C37.3144%2035.0343%2032.8453%2035.75%2023.229%2035.75C14.0031%2035.75%207.85921%2035.0387%207.85921%2035.0387C7.85921%2035.0387%205.26504%2034.8795%203.69004%2033.3064C2.11504%2031.7307%201.46849%2028.779%201.46849%2028.779C1.46849%2028.779%200.5%2022.7163%200.5%2016.0794C0.499988%2028.8752%205.0442%2028.7984%2013.3149%2028.6587H13.3149C14.2204%2028.6434%2015.1706%2028.6273%2016.1644%2028.6273H27.318C32.2013%2028.6273%2033.3039%2025.0731%2033.5164%2021.0028L34.0267%2014.7934C34.1626%2012.2409%2033.8337%2010.4287%2033.0336%209.26241C32.1612%207.99016%2030.6747%207.3439%2028.6169%207.3439C41.4253%207.3439%2044.1022%209.05998%2044.1907%2019.8412Z'%20fill='url(%23paint1_linear_1026_9)'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1026_9'%20x1='22.2878'%20y1='0.25'%20x2='22.4818'%20y2='30.5768'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%2305D2FF'/%3e%3cstop%20offset='0.156227'%20stop-color='%2321A1F1'/%3e%3cstop%20offset='0.407114'%20stop-color='%231E88E5'/%3e%3cstop%20offset='0.72248'%20stop-color='%231E6EE5'/%3e%3cstop%20offset='1'%20stop-color='%23182FFF'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1026_9'%20x1='3.17783'%20y1='35.6937'%20x2='37.9386'%20y2='5.41095'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%2324D8FF'/%3e%3cstop%20offset='0.156227'%20stop-color='%2321A1F1'/%3e%3cstop%20offset='0.407114'%20stop-color='%231E88E5'/%3e%3cstop%20offset='0.749106'%20stop-color='%231E7AE5'/%3e%3cstop%20offset='1'%20stop-color='%230046F9'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1026_9'%3e%3crect%20width='45'%20height='36'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",t$=({width:e=45,height:t=36,className:n=""})=>s.jsx("img",{src:e$,alt:"OWOX Logo",width:e,height:t,className:n}),$4=m.createContext(null),B4=m.createContext(()=>{});function n$(){return m.useContext(B4)}function bp(e){const t=m.useContext($4);if(t==null)throw new Error("useAppSelector must be used within StoreProvider");return e(t)}function G4(){return bp(e=>e.project)}function Eg(){const{data:e,callState:t,error:n}=bp(r=>r.flags);return{flags:e,callState:t,error:n}}function r$({isOpen:e}){const{title:t}=G4();return s.jsx(dr,{asChild:!0,children:s.jsxs("button",{type:"button","data-slot":"dropdown-menu-trigger","data-sidebar":"menu-button","data-size":"lg","data-active":e?"true":"false","aria-haspopup":"menu","aria-expanded":e,"data-state":e?"open":"closed",className:"peer/menu-button ring-sidebar-ring active:bg-sidebar-accent active:text-sidebar-accent-foreground data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground flex h-12 w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-0! focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",children:[s.jsx("div",{className:"text-sidebar-primary-foreground flex aspect-square size-8 items-center justify-center rounded-md border bg-white dark:bg-white/10",children:s.jsx(t$,{width:24,height:24})}),s.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[s.jsx("span",{className:"truncate font-medium",children:"OWOX Data Marts"}),s.jsx("span",{className:"text-muted-foreground truncate text-xs",children:t??"Project"})]}),s.jsx(ka,{className:`ml-auto size-4 transition-transform duration-200 ${e?"rotate-180":""}`})]})})}var Ir=(e=>(e.LOADING="loading",e.AUTHENTICATED="authenticated",e.UNAUTHENTICATED="unauthenticated",e.ERROR="error",e))(Ir||{});function q4(e,t){return function(){return e.apply(t,arguments)}}const{toString:a$}=Object.prototype,{getPrototypeOf:Sb}=Object,{iterator:wg,toStringTag:Z4}=Symbol,Rg=(e=>t=>{const n=a$.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),js=e=>(e=e.toLowerCase(),t=>Rg(t)===e),jg=e=>t=>typeof t===e,{isArray:Pu}=Array,Cu=jg("undefined");function $f(e){return e!==null&&!Cu(e)&&e.constructor!==null&&!Cu(e.constructor)&&da(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const K4=js("ArrayBuffer");function s$(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&K4(e.buffer),t}const o$=jg("string"),da=jg("function"),Y4=jg("number"),Bf=e=>e!==null&&typeof e=="object",i$=e=>e===!0||e===!1,Xm=e=>{if(Rg(e)!=="object")return!1;const t=Sb(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Z4 in e)&&!(wg in e)},l$=e=>{if(!Bf(e)||$f(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},c$=js("Date"),u$=js("File"),d$=js("Blob"),f$=js("FileList"),h$=e=>Bf(e)&&da(e.pipe),m$=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||da(e.append)&&((t=Rg(e))==="formdata"||t==="object"&&da(e.toString)&&e.toString()==="[object FormData]"))},p$=js("URLSearchParams"),[g$,y$,v$,x$]=["ReadableStream","Request","Response","Headers"].map(js),b$=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Gf(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),Pu(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if($f(e))return;const l=n?Object.getOwnPropertyNames(e):Object.keys(e),c=l.length;let d;for(r=0;r<c;r++)d=l[r],t.call(null,e[d],d,e)}}function W4(e,t){if($f(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,o;for(;r-- >0;)if(o=n[r],t===o.toLowerCase())return o;return null}const Ml=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Q4=e=>!Cu(e)&&e!==Ml;function P0(){const{caseless:e,skipUndefined:t}=Q4(this)&&this||{},n={},r=(o,l)=>{const c=e&&W4(n,l)||l;Xm(n[c])&&Xm(o)?n[c]=P0(n[c],o):Xm(o)?n[c]=P0({},o):Pu(o)?n[c]=o.slice():(!t||!Cu(o))&&(n[c]=o)};for(let o=0,l=arguments.length;o<l;o++)arguments[o]&&Gf(arguments[o],r);return n}const S$=(e,t,n,{allOwnKeys:r}={})=>(Gf(t,(o,l)=>{n&&da(o)?e[l]=q4(o,n):e[l]=o},{allOwnKeys:r}),e),C$=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),E$=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},w$=(e,t,n,r)=>{let o,l,c;const d={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),l=o.length;l-- >0;)c=o[l],(!r||r(c,e,t))&&!d[c]&&(t[c]=e[c],d[c]=!0);e=n!==!1&&Sb(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},R$=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},j$=e=>{if(!e)return null;if(Pu(e))return e;let t=e.length;if(!Y4(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},T$=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Sb(Uint8Array)),_$=(e,t)=>{const r=(e&&e[wg]).call(e);let o;for(;(o=r.next())&&!o.done;){const l=o.value;t.call(e,l[0],l[1])}},N$=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},A$=js("HTMLFormElement"),D$=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),tj=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),O$=js("RegExp"),X4=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Gf(n,(o,l)=>{let c;(c=t(o,l,e))!==!1&&(r[l]=c||o)}),Object.defineProperties(e,r)},M$=e=>{X4(e,(t,n)=>{if(da(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(da(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},I$=(e,t)=>{const n={},r=o=>{o.forEach(l=>{n[l]=!0})};return Pu(e)?r(e):r(String(e).split(t)),n},k$=()=>{},L$=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function P$(e){return!!(e&&da(e.append)&&e[Z4]==="FormData"&&e[wg])}const U$=e=>{const t=new Array(10),n=(r,o)=>{if(Bf(r)){if(t.indexOf(r)>=0)return;if($f(r))return r;if(!("toJSON"in r)){t[o]=r;const l=Pu(r)?[]:{};return Gf(r,(c,d)=>{const f=n(c,o+1);!Cu(f)&&(l[d]=f)}),t[o]=void 0,l}}return r};return n(e,0)},F$=js("AsyncFunction"),V$=e=>e&&(Bf(e)||da(e))&&da(e.then)&&da(e.catch),J4=((e,t)=>e?setImmediate:t?((n,r)=>(Ml.addEventListener("message",({source:o,data:l})=>{o===Ml&&l===n&&r.length&&r.shift()()},!1),o=>{r.push(o),Ml.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",da(Ml.postMessage)),z$=typeof queueMicrotask<"u"?queueMicrotask.bind(Ml):typeof process<"u"&&process.nextTick||J4,H$=e=>e!=null&&da(e[wg]),ce={isArray:Pu,isArrayBuffer:K4,isBuffer:$f,isFormData:m$,isArrayBufferView:s$,isString:o$,isNumber:Y4,isBoolean:i$,isObject:Bf,isPlainObject:Xm,isEmptyObject:l$,isReadableStream:g$,isRequest:y$,isResponse:v$,isHeaders:x$,isUndefined:Cu,isDate:c$,isFile:u$,isBlob:d$,isRegExp:O$,isFunction:da,isStream:h$,isURLSearchParams:p$,isTypedArray:T$,isFileList:f$,forEach:Gf,merge:P0,extend:S$,trim:b$,stripBOM:C$,inherits:E$,toFlatObject:w$,kindOf:Rg,kindOfTest:js,endsWith:R$,toArray:j$,forEachEntry:_$,matchAll:N$,isHTMLForm:A$,hasOwnProperty:tj,hasOwnProp:tj,reduceDescriptors:X4,freezeMethods:M$,toObjectSet:I$,toCamelCase:D$,noop:k$,toFiniteNumber:L$,findKey:W4,global:Ml,isContextDefined:Q4,isSpecCompliantForm:P$,toJSONObject:U$,isAsyncFn:F$,isThenable:V$,setImmediate:J4,asap:z$,isIterable:H$};function mt(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}ce.inherits(mt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ce.toJSONObject(this.config),code:this.code,status:this.status}}});const eA=mt.prototype,tA={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{tA[e]={value:e}});Object.defineProperties(mt,tA);Object.defineProperty(eA,"isAxiosError",{value:!0});mt.from=(e,t,n,r,o,l)=>{const c=Object.create(eA);ce.toFlatObject(e,c,function(g){return g!==Error.prototype},h=>h!=="isAxiosError");const d=e&&e.message?e.message:"Error",f=t==null&&e?e.code:t;return mt.call(c,d,f,n,r,o),e&&c.cause==null&&Object.defineProperty(c,"cause",{value:e,configurable:!0}),c.name=e&&e.name||"Error",l&&Object.assign(c,l),c};const $$=null;function U0(e){return ce.isPlainObject(e)||ce.isArray(e)}function nA(e){return ce.endsWith(e,"[]")?e.slice(0,-2):e}function nj(e,t,n){return e?e.concat(t).map(function(o,l){return o=nA(o),!n&&l?"["+o+"]":o}).join(n?".":""):t}function B$(e){return ce.isArray(e)&&!e.some(U0)}const G$=ce.toFlatObject(ce,{},null,function(t){return/^is[A-Z]/.test(t)});function Tg(e,t,n){if(!ce.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=ce.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(S,C){return!ce.isUndefined(C[S])});const r=n.metaTokens,o=n.visitor||g,l=n.dots,c=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&ce.isSpecCompliantForm(t);if(!ce.isFunction(o))throw new TypeError("visitor must be a function");function h(w){if(w===null)return"";if(ce.isDate(w))return w.toISOString();if(ce.isBoolean(w))return w.toString();if(!f&&ce.isBlob(w))throw new mt("Blob is not supported. Use a Buffer instead.");return ce.isArrayBuffer(w)||ce.isTypedArray(w)?f&&typeof Blob=="function"?new Blob([w]):Buffer.from(w):w}function g(w,S,C){let R=w;if(w&&!C&&typeof w=="object"){if(ce.endsWith(S,"{}"))S=r?S:S.slice(0,-2),w=JSON.stringify(w);else if(ce.isArray(w)&&B$(w)||(ce.isFileList(w)||ce.endsWith(S,"[]"))&&(R=ce.toArray(w)))return S=nA(S),R.forEach(function(_,D){!(ce.isUndefined(_)||_===null)&&t.append(c===!0?nj([S],D,l):c===null?S:S+"[]",h(_))}),!1}return U0(w)?!0:(t.append(nj(C,S,l),h(w)),!1)}const y=[],v=Object.assign(G$,{defaultVisitor:g,convertValue:h,isVisitable:U0});function b(w,S){if(!ce.isUndefined(w)){if(y.indexOf(w)!==-1)throw Error("Circular reference detected in "+S.join("."));y.push(w),ce.forEach(w,function(R,j){(!(ce.isUndefined(R)||R===null)&&o.call(t,R,ce.isString(j)?j.trim():j,S,v))===!0&&b(R,S?S.concat(j):[j])}),y.pop()}}if(!ce.isObject(e))throw new TypeError("data must be an object");return b(e),t}function rj(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Cb(e,t){this._pairs=[],e&&Tg(e,this,t)}const rA=Cb.prototype;rA.append=function(t,n){this._pairs.push([t,n])};rA.toString=function(t){const n=t?function(r){return t.call(this,r,rj)}:rj;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function q$(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function aA(e,t,n){if(!t)return e;const r=n&&n.encode||q$;ce.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let l;if(o?l=o(t,n):l=ce.isURLSearchParams(t)?t.toString():new Cb(t,n).toString(r),l){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+l}return e}class aj{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){ce.forEach(this.handlers,function(r){r!==null&&t(r)})}}const sA={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Z$=typeof URLSearchParams<"u"?URLSearchParams:Cb,K$=typeof FormData<"u"?FormData:null,Y$=typeof Blob<"u"?Blob:null,W$={isBrowser:!0,classes:{URLSearchParams:Z$,FormData:K$,Blob:Y$},protocols:["http","https","file","blob","url","data"]},Eb=typeof window<"u"&&typeof document<"u",F0=typeof navigator=="object"&&navigator||void 0,Q$=Eb&&(!F0||["ReactNative","NativeScript","NS"].indexOf(F0.product)<0),X$=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",J$=Eb&&window.location.href||"http://localhost",eB=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Eb,hasStandardBrowserEnv:Q$,hasStandardBrowserWebWorkerEnv:X$,navigator:F0,origin:J$},Symbol.toStringTag,{value:"Module"})),Mr={...eB,...W$};function tB(e,t){return Tg(e,new Mr.classes.URLSearchParams,{visitor:function(n,r,o,l){return Mr.isNode&&ce.isBuffer(n)?(this.append(r,n.toString("base64")),!1):l.defaultVisitor.apply(this,arguments)},...t})}function nB(e){return ce.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function rB(e){const t={},n=Object.keys(e);let r;const o=n.length;let l;for(r=0;r<o;r++)l=n[r],t[l]=e[l];return t}function oA(e){function t(n,r,o,l){let c=n[l++];if(c==="__proto__")return!0;const d=Number.isFinite(+c),f=l>=n.length;return c=!c&&ce.isArray(o)?o.length:c,f?(ce.hasOwnProp(o,c)?o[c]=[o[c],r]:o[c]=r,!d):((!o[c]||!ce.isObject(o[c]))&&(o[c]=[]),t(n,r,o[c],l)&&ce.isArray(o[c])&&(o[c]=rB(o[c])),!d)}if(ce.isFormData(e)&&ce.isFunction(e.entries)){const n={};return ce.forEachEntry(e,(r,o)=>{t(nB(r),o,n,0)}),n}return null}function aB(e,t,n){if(ce.isString(e))try{return(t||JSON.parse)(e),ce.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const qf={transitional:sA,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,l=ce.isObject(t);if(l&&ce.isHTMLForm(t)&&(t=new FormData(t)),ce.isFormData(t))return o?JSON.stringify(oA(t)):t;if(ce.isArrayBuffer(t)||ce.isBuffer(t)||ce.isStream(t)||ce.isFile(t)||ce.isBlob(t)||ce.isReadableStream(t))return t;if(ce.isArrayBufferView(t))return t.buffer;if(ce.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let d;if(l){if(r.indexOf("application/x-www-form-urlencoded")>-1)return tB(t,this.formSerializer).toString();if((d=ce.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return Tg(d?{"files[]":t}:t,f&&new f,this.formSerializer)}}return l||o?(n.setContentType("application/json",!1),aB(t)):t}],transformResponse:[function(t){const n=this.transitional||qf.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(ce.isResponse(t)||ce.isReadableStream(t))return t;if(t&&ce.isString(t)&&(r&&!this.responseType||o)){const c=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(d){if(c)throw d.name==="SyntaxError"?mt.from(d,mt.ERR_BAD_RESPONSE,this,null,this.response):d}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Mr.classes.FormData,Blob:Mr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ce.forEach(["delete","get","head","post","put","patch"],e=>{qf.headers[e]={}});const sB=ce.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),oB=e=>{const t={};let n,r,o;return e&&e.split(`
486
+ `).forEach(function(c){o=c.indexOf(":"),n=c.substring(0,o).trim().toLowerCase(),r=c.substring(o+1).trim(),!(!n||t[n]&&sB[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},sj=Symbol("internals");function Vd(e){return e&&String(e).trim().toLowerCase()}function Jm(e){return e===!1||e==null?e:ce.isArray(e)?e.map(Jm):String(e)}function iB(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const lB=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Lx(e,t,n,r,o){if(ce.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!ce.isString(t)){if(ce.isString(r))return t.indexOf(r)!==-1;if(ce.isRegExp(r))return r.test(t)}}function cB(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function uB(e,t){const n=ce.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(o,l,c){return this[r].call(this,t,o,l,c)},configurable:!0})})}let fa=class{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function l(d,f,h){const g=Vd(f);if(!g)throw new Error("header name must be a non-empty string");const y=ce.findKey(o,g);(!y||o[y]===void 0||h===!0||h===void 0&&o[y]!==!1)&&(o[y||f]=Jm(d))}const c=(d,f)=>ce.forEach(d,(h,g)=>l(h,g,f));if(ce.isPlainObject(t)||t instanceof this.constructor)c(t,n);else if(ce.isString(t)&&(t=t.trim())&&!lB(t))c(oB(t),n);else if(ce.isObject(t)&&ce.isIterable(t)){let d={},f,h;for(const g of t){if(!ce.isArray(g))throw TypeError("Object iterator must return a key-value pair");d[h=g[0]]=(f=d[h])?ce.isArray(f)?[...f,g[1]]:[f,g[1]]:g[1]}c(d,n)}else t!=null&&l(n,t,r);return this}get(t,n){if(t=Vd(t),t){const r=ce.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return iB(o);if(ce.isFunction(n))return n.call(this,o,r);if(ce.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Vd(t),t){const r=ce.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Lx(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function l(c){if(c=Vd(c),c){const d=ce.findKey(r,c);d&&(!n||Lx(r,r[d],d,n))&&(delete r[d],o=!0)}}return ce.isArray(t)?t.forEach(l):l(t),o}clear(t){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const l=n[r];(!t||Lx(this,this[l],l,t,!0))&&(delete this[l],o=!0)}return o}normalize(t){const n=this,r={};return ce.forEach(this,(o,l)=>{const c=ce.findKey(r,l);if(c){n[c]=Jm(o),delete n[l];return}const d=t?cB(l):String(l).trim();d!==l&&delete n[l],n[d]=Jm(o),r[d]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return ce.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&ce.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
487
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[sj]=this[sj]={accessors:{}}).accessors,o=this.prototype;function l(c){const d=Vd(c);r[d]||(uB(o,c),r[d]=!0)}return ce.isArray(t)?t.forEach(l):l(t),this}};fa.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ce.reduceDescriptors(fa.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});ce.freezeMethods(fa);function Px(e,t){const n=this||qf,r=t||n,o=fa.from(r.headers);let l=r.data;return ce.forEach(e,function(d){l=d.call(n,l,o.normalize(),t?t.status:void 0)}),o.normalize(),l}function iA(e){return!!(e&&e.__CANCEL__)}function Uu(e,t,n){mt.call(this,e??"canceled",mt.ERR_CANCELED,t,n),this.name="CanceledError"}ce.inherits(Uu,mt,{__CANCEL__:!0});function lA(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new mt("Request failed with status code "+n.status,[mt.ERR_BAD_REQUEST,mt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function dB(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function fB(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,l=0,c;return t=t!==void 0?t:1e3,function(f){const h=Date.now(),g=r[l];c||(c=h),n[o]=f,r[o]=h;let y=l,v=0;for(;y!==o;)v+=n[y++],y=y%e;if(o=(o+1)%e,o===l&&(l=(l+1)%e),h-c<t)return;const b=g&&h-g;return b?Math.round(v*1e3/b):void 0}}function hB(e,t){let n=0,r=1e3/t,o,l;const c=(h,g=Date.now())=>{n=g,o=null,l&&(clearTimeout(l),l=null),e(...h)};return[(...h)=>{const g=Date.now(),y=g-n;y>=r?c(h,g):(o=h,l||(l=setTimeout(()=>{l=null,c(o)},r-y)))},()=>o&&c(o)]}const Sp=(e,t,n=3)=>{let r=0;const o=fB(50,250);return hB(l=>{const c=l.loaded,d=l.lengthComputable?l.total:void 0,f=c-r,h=o(f),g=c<=d;r=c;const y={loaded:c,total:d,progress:d?c/d:void 0,bytes:f,rate:h||void 0,estimated:h&&d&&g?(d-c)/h:void 0,event:l,lengthComputable:d!=null,[t?"download":"upload"]:!0};e(y)},n)},oj=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ij=e=>(...t)=>ce.asap(()=>e(...t)),mB=Mr.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Mr.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Mr.origin),Mr.navigator&&/(msie|trident)/i.test(Mr.navigator.userAgent)):()=>!0,pB=Mr.hasStandardBrowserEnv?{write(e,t,n,r,o,l,c){if(typeof document>"u")return;const d=[`${e}=${encodeURIComponent(t)}`];ce.isNumber(n)&&d.push(`expires=${new Date(n).toUTCString()}`),ce.isString(r)&&d.push(`path=${r}`),ce.isString(o)&&d.push(`domain=${o}`),l===!0&&d.push("secure"),ce.isString(c)&&d.push(`SameSite=${c}`),document.cookie=d.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function gB(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function yB(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function cA(e,t,n){let r=!gB(t);return e&&(r||n==!1)?yB(e,t):t}const lj=e=>e instanceof fa?{...e}:e;function Bl(e,t){t=t||{};const n={};function r(h,g,y,v){return ce.isPlainObject(h)&&ce.isPlainObject(g)?ce.merge.call({caseless:v},h,g):ce.isPlainObject(g)?ce.merge({},g):ce.isArray(g)?g.slice():g}function o(h,g,y,v){if(ce.isUndefined(g)){if(!ce.isUndefined(h))return r(void 0,h,y,v)}else return r(h,g,y,v)}function l(h,g){if(!ce.isUndefined(g))return r(void 0,g)}function c(h,g){if(ce.isUndefined(g)){if(!ce.isUndefined(h))return r(void 0,h)}else return r(void 0,g)}function d(h,g,y){if(y in t)return r(h,g);if(y in e)return r(void 0,h)}const f={url:l,method:l,data:l,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,withXSRFToken:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:d,headers:(h,g,y)=>o(lj(h),lj(g),y,!0)};return ce.forEach(Object.keys({...e,...t}),function(g){const y=f[g]||o,v=y(e[g],t[g],g);ce.isUndefined(v)&&y!==d||(n[g]=v)}),n}const uA=e=>{const t=Bl({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:l,headers:c,auth:d}=t;if(t.headers=c=fa.from(c),t.url=aA(cA(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),d&&c.set("Authorization","Basic "+btoa((d.username||"")+":"+(d.password?unescape(encodeURIComponent(d.password)):""))),ce.isFormData(n)){if(Mr.hasStandardBrowserEnv||Mr.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if(ce.isFunction(n.getHeaders)){const f=n.getHeaders(),h=["content-type","content-length"];Object.entries(f).forEach(([g,y])=>{h.includes(g.toLowerCase())&&c.set(g,y)})}}if(Mr.hasStandardBrowserEnv&&(r&&ce.isFunction(r)&&(r=r(t)),r||r!==!1&&mB(t.url))){const f=o&&l&&pB.read(l);f&&c.set(o,f)}return t},vB=typeof XMLHttpRequest<"u",xB=vB&&function(e){return new Promise(function(n,r){const o=uA(e);let l=o.data;const c=fa.from(o.headers).normalize();let{responseType:d,onUploadProgress:f,onDownloadProgress:h}=o,g,y,v,b,w;function S(){b&&b(),w&&w(),o.cancelToken&&o.cancelToken.unsubscribe(g),o.signal&&o.signal.removeEventListener("abort",g)}let C=new XMLHttpRequest;C.open(o.method.toUpperCase(),o.url,!0),C.timeout=o.timeout;function R(){if(!C)return;const _=fa.from("getAllResponseHeaders"in C&&C.getAllResponseHeaders()),A={data:!d||d==="text"||d==="json"?C.responseText:C.response,status:C.status,statusText:C.statusText,headers:_,config:e,request:C};lA(function(T){n(T),S()},function(T){r(T),S()},A),C=null}"onloadend"in C?C.onloadend=R:C.onreadystatechange=function(){!C||C.readyState!==4||C.status===0&&!(C.responseURL&&C.responseURL.indexOf("file:")===0)||setTimeout(R)},C.onabort=function(){C&&(r(new mt("Request aborted",mt.ECONNABORTED,e,C)),C=null)},C.onerror=function(D){const A=D&&D.message?D.message:"Network Error",O=new mt(A,mt.ERR_NETWORK,e,C);O.event=D||null,r(O),C=null},C.ontimeout=function(){let D=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const A=o.transitional||sA;o.timeoutErrorMessage&&(D=o.timeoutErrorMessage),r(new mt(D,A.clarifyTimeoutError?mt.ETIMEDOUT:mt.ECONNABORTED,e,C)),C=null},l===void 0&&c.setContentType(null),"setRequestHeader"in C&&ce.forEach(c.toJSON(),function(D,A){C.setRequestHeader(A,D)}),ce.isUndefined(o.withCredentials)||(C.withCredentials=!!o.withCredentials),d&&d!=="json"&&(C.responseType=o.responseType),h&&([v,w]=Sp(h,!0),C.addEventListener("progress",v)),f&&C.upload&&([y,b]=Sp(f),C.upload.addEventListener("progress",y),C.upload.addEventListener("loadend",b)),(o.cancelToken||o.signal)&&(g=_=>{C&&(r(!_||_.type?new Uu(null,e,C):_),C.abort(),C=null)},o.cancelToken&&o.cancelToken.subscribe(g),o.signal&&(o.signal.aborted?g():o.signal.addEventListener("abort",g)));const j=dB(o.url);if(j&&Mr.protocols.indexOf(j)===-1){r(new mt("Unsupported protocol "+j+":",mt.ERR_BAD_REQUEST,e));return}C.send(l||null)})},bB=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,o;const l=function(h){if(!o){o=!0,d();const g=h instanceof Error?h:this.reason;r.abort(g instanceof mt?g:new Uu(g instanceof Error?g.message:g))}};let c=t&&setTimeout(()=>{c=null,l(new mt(`timeout ${t} of ms exceeded`,mt.ETIMEDOUT))},t);const d=()=>{e&&(c&&clearTimeout(c),c=null,e.forEach(h=>{h.unsubscribe?h.unsubscribe(l):h.removeEventListener("abort",l)}),e=null)};e.forEach(h=>h.addEventListener("abort",l));const{signal:f}=r;return f.unsubscribe=()=>ce.asap(d),f}},SB=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,o;for(;r<n;)o=r+t,yield e.slice(r,o),r=o},CB=async function*(e,t){for await(const n of EB(e))yield*SB(n,t)},EB=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},cj=(e,t,n,r)=>{const o=CB(e,t);let l=0,c,d=f=>{c||(c=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:h,value:g}=await o.next();if(h){d(),f.close();return}let y=g.byteLength;if(n){let v=l+=y;n(v)}f.enqueue(new Uint8Array(g))}catch(h){throw d(h),h}},cancel(f){return d(f),o.return()}},{highWaterMark:2})},uj=64*1024,{isFunction:_m}=ce,wB=(({Request:e,Response:t})=>({Request:e,Response:t}))(ce.global),{ReadableStream:dj,TextEncoder:fj}=ce.global,hj=(e,...t)=>{try{return!!e(...t)}catch{return!1}},RB=e=>{e=ce.merge.call({skipUndefined:!0},wB,e);const{fetch:t,Request:n,Response:r}=e,o=t?_m(t):typeof fetch=="function",l=_m(n),c=_m(r);if(!o)return!1;const d=o&&_m(dj),f=o&&(typeof fj=="function"?(w=>S=>w.encode(S))(new fj):async w=>new Uint8Array(await new n(w).arrayBuffer())),h=l&&d&&hj(()=>{let w=!1;const S=new n(Mr.origin,{body:new dj,method:"POST",get duplex(){return w=!0,"half"}}).headers.has("Content-Type");return w&&!S}),g=c&&d&&hj(()=>ce.isReadableStream(new r("").body)),y={stream:g&&(w=>w.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(w=>{!y[w]&&(y[w]=(S,C)=>{let R=S&&S[w];if(R)return R.call(S);throw new mt(`Response type '${w}' is not supported`,mt.ERR_NOT_SUPPORT,C)})});const v=async w=>{if(w==null)return 0;if(ce.isBlob(w))return w.size;if(ce.isSpecCompliantForm(w))return(await new n(Mr.origin,{method:"POST",body:w}).arrayBuffer()).byteLength;if(ce.isArrayBufferView(w)||ce.isArrayBuffer(w))return w.byteLength;if(ce.isURLSearchParams(w)&&(w=w+""),ce.isString(w))return(await f(w)).byteLength},b=async(w,S)=>{const C=ce.toFiniteNumber(w.getContentLength());return C??v(S)};return async w=>{let{url:S,method:C,data:R,signal:j,cancelToken:_,timeout:D,onDownloadProgress:A,onUploadProgress:O,responseType:T,headers:M,withCredentials:F="same-origin",fetchOptions:G}=uA(w),Y=t||fetch;T=T?(T+"").toLowerCase():"text";let Z=bB([j,_&&_.toAbortSignal()],D),J=null;const H=Z&&Z.unsubscribe&&(()=>{Z.unsubscribe()});let K;try{if(O&&h&&C!=="get"&&C!=="head"&&(K=await b(M,R))!==0){let L=new n(S,{method:"POST",body:R,duplex:"half"}),P;if(ce.isFormData(R)&&(P=L.headers.get("content-type"))&&M.setContentType(P),L.body){const[q,te]=oj(K,Sp(ij(O)));R=cj(L.body,uj,q,te)}}ce.isString(F)||(F=F?"include":"omit");const k=l&&"credentials"in n.prototype,z={...G,signal:Z,method:C.toUpperCase(),headers:M.normalize().toJSON(),body:R,duplex:"half",credentials:k?F:void 0};J=l&&new n(S,z);let B=await(l?Y(J,G):Y(S,z));const ie=g&&(T==="stream"||T==="response");if(g&&(A||ie&&H)){const L={};["status","statusText","headers"].forEach(ue=>{L[ue]=B[ue]});const P=ce.toFiniteNumber(B.headers.get("content-length")),[q,te]=A&&oj(P,Sp(ij(A),!0))||[];B=new r(cj(B.body,uj,q,()=>{te&&te(),H&&H()}),L)}T=T||"text";let xe=await y[ce.findKey(y,T)||"text"](B,w);return!ie&&H&&H(),await new Promise((L,P)=>{lA(L,P,{data:xe,headers:fa.from(B.headers),status:B.status,statusText:B.statusText,config:w,request:J})})}catch(k){throw H&&H(),k&&k.name==="TypeError"&&/Load failed|fetch/i.test(k.message)?Object.assign(new mt("Network Error",mt.ERR_NETWORK,w,J),{cause:k.cause||k}):mt.from(k,k&&k.code,w,J)}}},jB=new Map,dA=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:o}=t,l=[r,o,n];let c=l.length,d=c,f,h,g=jB;for(;d--;)f=l[d],h=g.get(f),h===void 0&&g.set(f,h=d?new Map:RB(t)),g=h;return h};dA();const wb={http:$$,xhr:xB,fetch:{get:dA}};ce.forEach(wb,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const mj=e=>`- ${e}`,TB=e=>ce.isFunction(e)||e===null||e===!1;function _B(e,t){e=ce.isArray(e)?e:[e];const{length:n}=e;let r,o;const l={};for(let c=0;c<n;c++){r=e[c];let d;if(o=r,!TB(r)&&(o=wb[(d=String(r)).toLowerCase()],o===void 0))throw new mt(`Unknown adapter '${d}'`);if(o&&(ce.isFunction(o)||(o=o.get(t))))break;l[d||"#"+c]=o}if(!o){const c=Object.entries(l).map(([f,h])=>`adapter ${f} `+(h===!1?"is not supported by the environment":"is not available in the build"));let d=n?c.length>1?`since :
488
+ `+c.map(mj).join(`
489
+ `):" "+mj(c[0]):"as no adapter specified";throw new mt("There is no suitable adapter to dispatch the request "+d,"ERR_NOT_SUPPORT")}return o}const fA={getAdapter:_B,adapters:wb};function Ux(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Uu(null,e)}function pj(e){return Ux(e),e.headers=fa.from(e.headers),e.data=Px.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),fA.getAdapter(e.adapter||qf.adapter,e)(e).then(function(r){return Ux(e),r.data=Px.call(e,e.transformResponse,r),r.headers=fa.from(r.headers),r},function(r){return iA(r)||(Ux(e),r&&r.response&&(r.response.data=Px.call(e,e.transformResponse,r.response),r.response.headers=fa.from(r.response.headers))),Promise.reject(r)})}const hA="1.13.2",_g={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{_g[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const gj={};_g.transitional=function(t,n,r){function o(l,c){return"[Axios v"+hA+"] Transitional option '"+l+"'"+c+(r?". "+r:"")}return(l,c,d)=>{if(t===!1)throw new mt(o(c," has been removed"+(n?" in "+n:"")),mt.ERR_DEPRECATED);return n&&!gj[c]&&(gj[c]=!0,console.warn(o(c," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(l,c,d):!0}};_g.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function NB(e,t,n){if(typeof e!="object")throw new mt("options must be an object",mt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const l=r[o],c=t[l];if(c){const d=e[l],f=d===void 0||c(d,l,e);if(f!==!0)throw new mt("option "+l+" must be "+f,mt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new mt("Unknown option "+l,mt.ERR_BAD_OPTION)}}const ep={assertOptions:NB,validators:_g},Ps=ep.validators;let Ll=class{constructor(t){this.defaults=t||{},this.interceptors={request:new aj,response:new aj}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const l=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?l&&!String(r.stack).endsWith(l.replace(/^.+\n.+\n/,""))&&(r.stack+=`
490
+ `+l):r.stack=l}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Bl(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:l}=n;r!==void 0&&ep.assertOptions(r,{silentJSONParsing:Ps.transitional(Ps.boolean),forcedJSONParsing:Ps.transitional(Ps.boolean),clarifyTimeoutError:Ps.transitional(Ps.boolean)},!1),o!=null&&(ce.isFunction(o)?n.paramsSerializer={serialize:o}:ep.assertOptions(o,{encode:Ps.function,serialize:Ps.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ep.assertOptions(n,{baseUrl:Ps.spelling("baseURL"),withXsrfToken:Ps.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let c=l&&ce.merge(l.common,l[n.method]);l&&ce.forEach(["delete","get","head","post","put","patch","common"],w=>{delete l[w]}),n.headers=fa.concat(c,l);const d=[];let f=!0;this.interceptors.request.forEach(function(S){typeof S.runWhen=="function"&&S.runWhen(n)===!1||(f=f&&S.synchronous,d.unshift(S.fulfilled,S.rejected))});const h=[];this.interceptors.response.forEach(function(S){h.push(S.fulfilled,S.rejected)});let g,y=0,v;if(!f){const w=[pj.bind(this),void 0];for(w.unshift(...d),w.push(...h),v=w.length,g=Promise.resolve(n);y<v;)g=g.then(w[y++],w[y++]);return g}v=d.length;let b=n;for(;y<v;){const w=d[y++],S=d[y++];try{b=w(b)}catch(C){S.call(this,C);break}}try{g=pj.call(this,b)}catch(w){return Promise.reject(w)}for(y=0,v=h.length;y<v;)g=g.then(h[y++],h[y++]);return g}getUri(t){t=Bl(this.defaults,t);const n=cA(t.baseURL,t.url,t.allowAbsoluteUrls);return aA(n,t.params,t.paramsSerializer)}};ce.forEach(["delete","get","head","options"],function(t){Ll.prototype[t]=function(n,r){return this.request(Bl(r||{},{method:t,url:n,data:(r||{}).data}))}});ce.forEach(["post","put","patch"],function(t){function n(r){return function(l,c,d){return this.request(Bl(d||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:l,data:c}))}}Ll.prototype[t]=n(),Ll.prototype[t+"Form"]=n(!0)});let AB=class mA{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(l){n=l});const r=this;this.promise.then(o=>{if(!r._listeners)return;let l=r._listeners.length;for(;l-- >0;)r._listeners[l](o);r._listeners=null}),this.promise.then=o=>{let l;const c=new Promise(d=>{r.subscribe(d),l=d}).then(o);return c.cancel=function(){r.unsubscribe(l)},c},t(function(l,c,d){r.reason||(r.reason=new Uu(l,c,d),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new mA(function(o){t=o}),cancel:t}}};function DB(e){return function(n){return e.apply(null,n)}}function OB(e){return ce.isObject(e)&&e.isAxiosError===!0}const V0={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(V0).forEach(([e,t])=>{V0[t]=e});function pA(e){const t=new Ll(e),n=q4(Ll.prototype.request,t);return ce.extend(n,Ll.prototype,t,{allOwnKeys:!0}),ce.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return pA(Bl(e,o))},n}const Un=pA(qf);Un.Axios=Ll;Un.CanceledError=Uu;Un.CancelToken=AB;Un.isCancel=iA;Un.VERSION=hA;Un.toFormData=Tg;Un.AxiosError=mt;Un.Cancel=Un.CanceledError;Un.all=function(t){return Promise.all(t)};Un.spread=DB;Un.isAxiosError=OB;Un.mergeConfig=Bl;Un.AxiosHeaders=fa;Un.formToJSON=e=>oA(ce.isHTMLForm(e)?new FormData(e):e);Un.getAdapter=fA.getAdapter;Un.HttpStatusCode=V0;Un.default=Un;const{Axios:nce,AxiosError:yj,CanceledError:rce,isCancel:ace,CancelToken:sce,VERSION:oce,all:ice,Cancel:lce,isAxiosError:cce,spread:uce,toFormData:dce,AxiosHeaders:MB,HttpStatusCode:fce,formToJSON:hce,getAdapter:mce,mergeConfig:pce}=Un;function IB(e){return{id:e.userId,email:e.email,fullName:e.fullName,roles:e.roles,projectId:e.projectId,projectTitle:e.projectTitle,avatar:e.avatar}}const Eu={SIGN_IN:"/auth/sign-in",SIGN_OUT:"/auth/sign-out",ACCESS_TOKEN:"/auth/access-token",API_USER:"/auth/api/user",API_PROJECTS:"/auth/api/projects"};function kB(e){if(e&&typeof e=="object"&&"response"in e){const n=e,{status:r,data:o}=n.response;switch(r){case 401:return{message:(o==null?void 0:o.message)??"Invalid credentials or session expired",code:"UNAUTHORIZED",statusCode:401};case 403:return{message:(o==null?void 0:o.message)??"Access forbidden",code:"FORBIDDEN",statusCode:403};case 422:return{message:(o==null?void 0:o.message)??"Invalid request data",code:"VALIDATION_ERROR",statusCode:422};default:return{message:(o==null?void 0:o.message)??"Authentication error",code:"AUTH_ERROR",statusCode:r}}}return e&&typeof e=="object"&&"request"in e?{message:"Network error - please check your connection",code:"NETWORK_ERROR"}:{message:e instanceof Error?e.message:"Unknown authentication error",code:"UNKNOWN_ERROR"}}const Rb=Un.create({baseURL:"/",timeout:3e4,headers:{"Content-Type":"application/json",Accept:"application/json"},withCredentials:!0});function LB(){const e=window.location.pathname+window.location.search,t=new URL(Eu.SIGN_IN,window.location.origin);e.startsWith("/auth/")||t.searchParams.set("redirect",e),window.location.href=t.toString()}function PB(){const e=new URL(Eu.SIGN_OUT,window.location.origin);e.searchParams.set("redirect",Eu.SIGN_IN),window.location.href=e.toString()}async function UB(){try{return(await Rb.post(Eu.ACCESS_TOKEN,{})).data}catch(e){const t=kB(e);throw new Error(t.message)}}async function FB(e){const t=await Rb.get(Eu.API_USER,{headers:{"X-OWOX-Authorization":`Bearer ${e}`}});return IB(t.data)}async function VB(e){return(await Rb.get(Eu.API_PROJECTS,{headers:{"X-OWOX-Authorization":`Bearer ${e}`}})).data}const gA=m.createContext(null);class zB{constructor(t,n){Ls(this,"getToken");Ls(this,"refreshFn");this.getToken=t,this.refreshFn=n}getAccessToken(){return this.getToken()}async refreshToken(){return await this.refreshFn()}}let jb=null;function HB(e){jb=e}function Tb(){return jb}function Nm(){jb=null}const $B=()=>{typeof window<"u"&&!window.dataLayer&&(window.dataLayer=[])},Ue=e=>{e.timestamp=e.timestamp??Date.now(),e.eventType=e.eventType??"app",yA(e)},BB=e=>{Ue({event:"system_user_identified",eventType:"system",category:"UserSession",action:"Identified",...e})},GB=()=>{Ue({event:"system_user_logged_out",eventType:"system",category:"UserSession",action:"Logout"})},yA=e=>{var t;if(typeof window<"u"){$B();try{(t=window.dataLayer)==null||t.push(e)}catch(n){console.error("Failed to push data to dataLayer",n)}}};function qB(e,t){switch(t.type){case"SET_LOADING":return{...e,status:Ir.LOADING,error:void 0};case"SET_AUTHENTICATED":return{...e,status:Ir.AUTHENTICATED,session:t.payload.session,error:void 0};case"SET_UNAUTHENTICATED":return{...e,status:Ir.UNAUTHENTICATED,session:null,error:void 0};case"SET_USER":return{...e,user:t.payload.user};case"SET_ERROR":return{...e,status:Ir.ERROR,error:t.payload};case"CLEAR_ERROR":return{...e,error:void 0};default:return e}}const ZB={status:Ir.LOADING,session:null,user:null};function KB({children:e}){var g;const[t,n]=m.useReducer(qB,ZB);m.useEffect(()=>{var y;if((y=t.session)!=null&&y.accessToken){const v=new zB(()=>{var b;return((b=t.session)==null?void 0:b.accessToken)??null},async()=>await o());HB(v)}else Nm()},[(g=t.session)==null?void 0:g.accessToken]);const r=m.useCallback(()=>{LB()},[]);async function o(){try{const v=(await UB()).accessToken;if(!v)throw new Error("Invalid token received");const b={accessToken:v},w=await FB(v);return n({type:"SET_USER",payload:{user:w}}),n({type:"SET_AUTHENTICATED",payload:{session:b}}),v}catch(y){throw Nm(),n({type:"SET_UNAUTHENTICATED"}),y}}const l=m.useCallback(async()=>{await o()},[]),c=m.useCallback(async()=>{try{n({type:"SET_LOADING"});try{await l()}catch{n({type:"SET_UNAUTHENTICATED"}),r()}}catch(y){console.error("Failed to initialize auth:",y),Nm(),n({type:"SET_UNAUTHENTICATED"})}},[l,r]),d=m.useCallback(()=>{try{GB()}finally{PB()}},[]),f=m.useCallback(()=>{n({type:"CLEAR_ERROR"})},[]);m.useEffect(()=>{c()},[c]),m.useEffect(()=>{t.user&&(yA({projectId:t.user.projectId}),BB({userId:t.user.id,userEmail:t.user.email,userFullName:t.user.fullName}))},[t.user]),m.useEffect(()=>{const y=()=>{d()};return window.addEventListener("auth:logout",y),()=>{window.removeEventListener("auth:logout",y),Nm()}},[d]);const h={...t,signIn:r,signOut:d,refreshToken:l,clearError:f};return s.jsx(gA.Provider,{value:h,children:e})}function el(){const e=m.useContext(gA);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function vA(){const{status:e,session:t,user:n,error:r}=el();return{status:e,session:t,user:n,error:r,isLoading:e===Ir.LOADING,isAuthenticated:e===Ir.AUTHENTICATED,isUnauthenticated:e===Ir.UNAUTHENTICATED,hasError:e===Ir.ERROR}}function YB(){const{user:e}=el();return e}function hu({fullScreen:e=!1,size:t="md",message:n}){const r={sm:"h-4 w-4 border-2",md:"h-8 w-8 border-4",lg:"h-12 w-12 border-4"},o=e?"flex h-screen items-center justify-center":"flex items-center justify-center p-4";return s.jsx("div",{className:o,children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:` ${r[t]} mx-auto mb-4 animate-spin rounded-full border-gray-300 border-t-blue-600`}),n&&s.jsx("p",{className:"text-sm text-gray-600",children:n})]})})}function vj({message:e}){return s.jsx(hu,{fullScreen:!0,message:e})}function xj(){return s.jsx("div",{className:"flex h-screen items-center justify-center",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h2",{className:"mb-4 text-2xl font-bold text-gray-900",children:"Authentication Required"}),s.jsx("p",{className:"mb-6 text-gray-600",children:"You need to sign in to access this page."}),s.jsx(Se,{onClick:()=>window.location.href="/api/auth/sign-in",children:"Sign In"})]})})}function WB({children:e,fallback:t,redirectTo:n}){const{isLoading:r,isAuthenticated:o,isUnauthenticated:l}=vA();return r?s.jsx(vj,{}):o?s.jsx(s.Fragment,{children:e}):l?n?(window.location.href=n,s.jsx(vj,{})):t?s.jsx(s.Fragment,{children:t}):s.jsx(xj,{}):t?s.jsx(s.Fragment,{children:t}):s.jsx(xj,{})}const xA=m.createContext(null);function bA(){const e=m.useContext(xA);if(!e)throw new Error("useProjects must be used within a ProjectsProvider");return e}const QB="/ui",XB=()=>QB,Cp=(e,t)=>{const n=XB(),r=t.startsWith("/")?t:`/${t}`;return`${n}/${e}${r}`};function JB(){const{projects:e,loadProjects:t,error:n,isLoading:r}=bA(),{user:o}=el();return s.jsxs(vb,{children:[s.jsx(ma,{}),s.jsxs(xb,{className:"flex items-center gap-2",children:[s.jsx(M7,{className:"h-4 w-4"}),"Switch project"]}),s.jsx(JH,{children:s.jsxs(bb,{children:[r&&s.jsx(pt,{disabled:!0,children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(Af,{className:"h-4 w-4 animate-spin"})," Loading projects..."]})}),!r&&n&&s.jsxs(s.Fragment,{children:[s.jsx(pt,{disabled:!0,children:"Unable to load projects. Please try again."}),s.jsx(pt,{onClick:()=>void t(),children:"Retry"})]}),!r&&!n&&e.map(l=>{const c=l.id===(o==null?void 0:o.projectId);return s.jsx(pt,{asChild:!0,children:s.jsxs(Tf,{to:Cp(encodeURIComponent(l.id),"/"),className:"flex items-center gap-2",children:[c?s.jsx(lr,{className:"h-4 w-4"}):s.jsx("span",{className:"h-4 w-4"}),l.title]})},l.id)})]})})]})}function eG(){return s.jsx(JB,{})}const tG=({className:e,size:t=24})=>s.jsx("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:s.jsx("path",{fill:"currentColor",d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})}),SA=({className:e,size:t=24})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[s.jsx("path",{d:"M10.6842 44.2221L0.419465 26.278C-0.139822 25.3001 -0.139822 23.6999 0.419465 22.722L10.6842 4.77786C11.2435 3.79993 12.6166 3 13.7355 3H34.265C35.3838 3 36.7567 3.79993 37.3163 4.77786L47.5801 22.722C48.14 23.6999 48.14 25.3001 47.5801 26.278L37.3163 44.2221C36.7567 45.2001 35.3838 46 34.265 46H13.7355C12.6166 46 11.2435 45.2001 10.6842 44.2221Z",fill:"#4486FA"}),s.jsx("path",{d:"M30.6154 18.3848L43.6923 32.8463L37.3828 43.85C36.8268 44.8118 35.4628 45.5986 34.3511 45.5986L17.5385 30.0771L30.6154 18.3848Z",fill:"#3778ED"}),s.jsx("path",{d:"M24.1539 33.1537C28.997 33.1537 32.9231 29.2276 32.9231 24.3845C32.9231 19.5414 28.997 15.6152 24.1539 15.6152C19.3108 15.6152 15.3846 19.5414 15.3846 24.3845C15.3846 29.2276 19.3108 33.1537 24.1539 33.1537Z",fill:"white"}),s.jsx("path",{d:"M31.2681 29.2331L34.3825 32.3476C34.7428 32.7079 34.7428 33.2925 34.3825 33.6528L33.7296 34.3057C33.3693 34.666 32.7847 34.666 32.4244 34.3057L29.3099 31.1913C28.9496 30.831 28.9496 30.2464 29.3099 29.886L29.9628 29.2331C30.3231 28.8728 30.9077 28.8728 31.2681 29.2331Z",fill:"white"}),s.jsx("path",{d:"M24.1538 31.0003C27.8074 31.0003 30.7692 28.0385 30.7692 24.3849C30.7692 20.7313 27.8074 17.7695 24.1538 17.7695C20.5003 17.7695 17.5385 20.7313 17.5385 24.3849C17.5385 28.0385 20.5003 31.0003 24.1538 31.0003Z",fill:"#4486FA"}),s.jsx("path",{d:"M24.1538 29.4615C26.9577 29.4615 29.2308 27.1884 29.2308 24.3845C29.2308 21.5806 26.9577 19.3076 24.1538 19.3076C21.3499 19.3076 19.0769 21.5806 19.0769 24.3845C19.0769 27.1884 21.3499 29.4615 24.1538 29.4615Z",fill:"#4486FA"}),s.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23.3846 21.4619H25.2308V29.4619H23.3846V21.4619ZM26.4615 24.8465H28.3077V28.5388H26.4615V24.8465ZM21.8462 23.6158H20V28.5388H21.8462V23.6158Z",fill:"white"})]}),CA=({className:e,size:t=24})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[s.jsx("path",{d:"M48 29.0142L24 26.0256L0 29.0142L24 48L48 29.0142Z",fill:"#FCBF92"}),s.jsx("path",{d:"M0 29.0142L24 36.2676V48L0 35.8398V29.0142Z",fill:"#9D5025"}),s.jsx("path",{d:"M48 29.0142L24 36.2676V48L48 35.8398V29.0142Z",fill:"#F58534"}),s.jsx("path",{d:"M3.099 18.7008H0V25.5978L3.099 26.1684L6.5436 22.4742L3.099 18.7014V18.7008Z",fill:"#9D5025"}),s.jsx("path",{d:"M6.54421 25.8828L3.09961 26.1678V18.7008H6.54421V25.8828Z",fill:"#F58534"}),s.jsx("path",{d:"M8.86613 10.0992L4.78613 10.8768V26.5248L8.86613 27.3804L12.6005 18.7002L8.86613 10.0986V10.0992Z",fill:"#9D5025"}),s.jsx("path",{d:"M12.6 26.9526L8.86621 27.3804V10.0992L12.6 10.527V26.9526Z",fill:"#F58534"}),s.jsx("path",{d:"M16.8213 13.5798L11.1885 14.1504V27.873L16.8213 29.0142L22.8003 21.261L16.8213 13.5798Z",fill:"#9D5025"}),s.jsx("path",{d:"M20.6187 28.3722L16.8213 29.0142V13.5798L20.6187 13.8648V28.3722Z",fill:"#F58534"}),s.jsx("path",{d:"M23.9995 1.134L20.2021 2.3466V29.6562L23.9995 30.4332L27.7969 15.7836L23.9995 1.134Z",fill:"#9D5025"}),s.jsx("path",{d:"M27.5156 28.3722L31.1792 29.0142L36.812 18.7008L31.1792 8.4588L27.5156 9.0294V28.3722Z",fill:"#9D5025"}),s.jsx("path",{d:"M36.812 18.7008L31.1792 8.4588L27.5156 9.0294",fill:"#9D5025"}),s.jsx("path",{d:"M35.3281 26.9532L39.1327 27.381L43.2127 14.3646L39.1327 1.4196L35.3281 2.3466V26.9532Z",fill:"#9D5025"}),s.jsx("path",{d:"M41.4551 25.8828L44.8997 26.1678L47.9987 13.2948L44.8997 0L41.4551 0.8556V25.8828Z",fill:"#9D5025"}),s.jsx("path",{d:"M24 1.134L27.7974 2.3466V29.6562L24 30.4332V1.134ZM36.8118 9.6L31.179 8.4588V29.0142L36.8118 27.873V9.6ZM43.2144 3.06L39.1344 1.4196V27.381L43.2144 26.5248V3.06ZM48 1.5618L44.901 0V26.1684L48 25.5978V1.5618Z",fill:"#F58534"})]}),nG=({className:e,size:t=24})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[s.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28 0C19.7661 0 12 0 10 0C8.19719 0 6 2.18498 6 4V44C6 45.815 8.18947 47.9993 10 47.9993H38C39.8105 47.9993 42 45.815 42 44C42 44 42 25.6447 42 14L28 0Z",fill:"#00A65F"}),s.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28 14H42V24L28 14Z",fill:"#007944"}),s.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28 0V13.9683L42 14L28 0Z",fill:"#64C3A7"}),s.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 42L12.0563 22H36V42H12ZM34 24H14V40H34V24Z",fill:"white"}),s.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 22H22V42H20V22Z",fill:"white"}),s.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36 28V30H12V28H36Z",fill:"white"}),s.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36 34V36H12V34H36Z",fill:"white"})]}),rG=({className:e,size:t=24})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[s.jsx("path",{d:"M23.7876 0C22.2395 0 20.8149 0.856389 20.0821 2.22332C19.3574 3.59024 19.4398 5.25361 20.3044 6.5382L22.0995 4.75131C22.0419 4.57015 22.009 4.38899 22.009 4.1996C22.009 3.21969 22.7995 2.42918 23.7794 2.42918C24.7593 2.42918 25.5498 3.21969 25.5498 4.1996C25.5498 5.1795 24.7593 5.97002 23.7794 5.97002C23.59 5.97002 23.4088 5.93708 23.2277 5.87944L21.4325 7.66632C22.923 8.67917 24.891 8.62153 26.3238 7.53457C27.7566 6.44762 28.3331 4.56192 27.7566 2.85737C27.1885 1.1446 25.5827 0 23.7876 0Z",fill:"#34A853"}),s.jsx("path",{d:"M22.1161 12.2282C22.1161 10.8118 21.6632 9.42842 20.8068 8.30029L18.4846 10.6224C19.2093 11.9564 18.954 13.6033 17.8506 14.6491L19.1187 17.737C20.9797 16.5266 22.1161 14.4515 22.1161 12.2282Z",fill:"#FBBC04"}),s.jsx("path",{d:"M15.6108 15.5637H15.5531C14.1286 15.5637 12.8604 14.6579 12.3993 13.3075C11.9382 11.957 12.3828 10.4666 13.511 9.58547C14.6391 8.70438 16.1954 8.64674 17.3894 9.43725L19.6951 7.13159C17.4553 5.31176 14.2932 5.17177 11.897 6.78574C9.50076 8.3997 8.44675 11.3806 9.28667 14.1392C10.1266 16.8977 12.671 18.7834 15.5531 18.7834C15.9978 18.7834 16.4425 18.7422 16.8789 18.6517L15.6108 15.5637Z",fill:"#EA4335"}),s.jsx("path",{d:"M23.87 18.231C22.4125 18.231 20.9632 18.4451 19.5716 18.8568L21.4161 23.3611C22.2148 23.1634 23.0383 23.0646 23.87 23.0646C28.6625 23.0646 32.7797 26.449 33.7184 31.1509C34.6489 35.8528 32.1374 40.5547 27.7155 42.3828C23.2936 44.2108 18.1882 42.6627 15.5284 38.6855C12.8687 34.7082 13.3792 29.3969 16.7636 26.0043C17.4718 25.2962 18.2787 24.7033 19.1598 24.2339L17.34 19.7461C10.5465 23.0728 7.32686 30.9697 9.86308 38.1008C12.3993 45.2319 19.8762 49.3244 27.2461 47.6117C34.616 45.9071 39.532 38.9407 38.6756 31.4226C37.8192 23.9045 31.454 18.231 23.8864 18.231H23.87Z",fill:"#4285F4"})]}),aG=({className:e,size:t=24})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[s.jsx("path",{d:"M6.10815 8C6.10815 6.89543 7.00358 6 8.10815 6H40.1082C41.2127 6 42.1082 6.89543 42.1082 8V40C42.1082 41.1046 41.2127 42 40.1082 42H8.10816C7.00359 42 6.10815 41.1046 6.10815 40V8Z",fill:"#FF9800"}),s.jsx("path",{d:"M11 11H23V14H11V11Z",fill:"white"}),s.jsx("path",{d:"M11 16H23V19H11V16Z",fill:"white"}),s.jsx("path",{d:"M11 21H23V24H11V21Z",fill:"white"}),s.jsx("path",{d:"M11 26H23V29H11V26Z",fill:"white"}),s.jsx("path",{d:"M25 11H37V14H25V11Z",fill:"white"}),s.jsx("path",{d:"M25 16H37V19H25V16Z",fill:"white"}),s.jsx("path",{d:"M25 21H37V24H25V21Z",fill:"white"}),s.jsx("path",{d:"M25 26H37V29H25V26Z",fill:"white"}),s.jsx("path",{d:"M25 31H37V34H25V31Z",fill:"white"}),s.jsx("path",{d:"M13 35C13 32.7909 14.7909 31 17 31C19.2091 31 21 32.7909 21 35C21 37.2091 19.2091 39 17 39C14.7909 39 13 37.2091 13 35Z",fill:"white"})]}),sG=({className:e,size:t=24})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[s.jsx("path",{d:"M41.1492 36.5821L31.017 30.7288C29.5935 29.9092 27.7733 30.3966 26.9494 31.8201C26.6302 32.3808 26.5051 32.9976 26.5655 33.5972V45.0365C26.5655 46.6712 27.894 47.9998 29.5331 47.9998C31.1679 47.9998 32.4965 46.6712 32.4965 45.0365V38.4585L38.173 41.7367C39.5964 42.5605 41.421 42.0688 42.2405 40.6454C43.0644 39.2219 42.577 37.4017 41.1492 36.5821Z",fill:"#29B5E8"}),s.jsx("path",{d:"M15.949 24.039C15.9663 22.9822 15.4099 21.9987 14.4954 21.4682L4.36313 15.6192C3.92316 15.3647 3.41849 15.231 2.91381 15.231C1.87427 15.231 0.908061 15.7874 0.390448 16.6846C-0.411852 18.0735 0.0669408 19.855 1.45587 20.6573L7.29627 24.0261L1.45587 27.3992C0.782972 27.7874 0.299866 28.4128 0.101448 29.1634C-0.101284 29.9139 0.00223886 30.699 0.390448 31.3719C0.908061 32.2691 1.87427 32.8255 2.9095 32.8255C3.41849 32.8255 3.92316 32.6918 4.36313 32.4373L14.4954 26.5883C15.4012 26.062 15.9577 25.0872 15.949 24.039Z",fill:"#29B5E8"}),s.jsx("path",{d:"M6.6628 11.4738L16.7951 17.3228C17.977 18.0086 19.4349 17.7843 20.3666 16.8742C20.9576 16.3307 21.3242 15.5543 21.3242 14.6916V2.96765C21.3242 1.32854 19.9957 0 18.3609 0C16.7217 0 15.3932 1.32854 15.3932 2.96765V9.64054L9.63907 6.31919C8.21564 5.49532 6.39536 5.98274 5.5715 7.40618C4.74763 8.82962 5.23936 10.6499 6.6628 11.4738Z",fill:"#29B5E8"}),s.jsx("path",{d:"M29.4459 24.5131C29.4459 24.7374 29.3165 25.048 29.1569 25.2119L25.1411 29.2277C24.9815 29.3873 24.6666 29.5167 24.4423 29.5167H23.42C23.1957 29.5167 22.8808 29.3873 22.7212 29.2277L18.7011 25.2119C18.5415 25.048 18.4121 24.7374 18.4121 24.5131V23.4908C18.4121 23.2622 18.5415 22.9516 18.7011 22.792L22.7212 18.7719C22.8808 18.6123 23.1957 18.4829 23.42 18.4829H24.4423C24.6666 18.4829 24.9815 18.6123 25.1411 18.7719L29.1569 22.792C29.3165 22.9516 29.4459 23.2622 29.4459 23.4908V24.5131ZM25.8614 24.0214V23.9782C25.8614 23.8143 25.7665 23.5857 25.6501 23.4649L24.4639 22.2831C24.3474 22.1623 24.1188 22.0674 23.9506 22.0674H23.9074C23.7435 22.0674 23.5149 22.1623 23.3941 22.2831L22.2123 23.4649C22.0958 23.5814 22.0009 23.81 22.0009 23.9782V24.0214C22.0009 24.1896 22.0958 24.4182 22.2123 24.5347L23.3941 25.7209C23.5149 25.8373 23.7435 25.9322 23.9074 25.9322H23.9506C24.1188 25.9322 24.3474 25.8373 24.4639 25.7209L25.6501 24.5347C25.7665 24.4182 25.8614 24.1896 25.8614 24.0214Z",fill:"#29B5E8"}),s.jsx("path",{d:"M31.0158 17.3228L41.1481 11.4738C42.5715 10.6542 43.0632 8.82962 42.2394 7.40618C41.4155 5.98274 39.5952 5.49532 38.1718 6.31919L32.4953 9.59741V2.96765C32.4953 1.32854 31.1667 0 29.532 0C27.8928 0 26.5643 1.32854 26.5643 2.96765V14.4587C26.5082 15.0539 26.6247 15.675 26.9482 16.2358C27.7721 17.6592 29.5923 18.1467 31.0158 17.3228Z",fill:"#29B5E8"}),s.jsx("path",{d:"M18.8267 30.3841C18.1538 30.2546 17.4335 30.3625 16.7951 30.7291L6.6628 36.5825C5.23936 37.402 4.74763 39.2223 5.5715 40.6457C6.39536 42.0735 8.21564 42.5609 9.63907 41.737L15.3932 38.4157V45.0368C15.3932 46.6716 16.7217 48.0002 18.3609 48.0002C19.9957 48.0002 21.3242 46.6716 21.3242 45.0368V33.3129C21.3242 31.8334 20.2415 30.6083 18.8267 30.3841Z",fill:"#29B5E8"}),s.jsx("path",{d:"M47.4814 16.6501C46.6618 15.2223 44.8372 14.7349 43.4138 15.5588L33.2815 21.4078C32.311 21.9685 31.7761 22.9951 31.7934 24.039C31.7847 25.0785 32.3196 26.0922 33.2815 26.6443L43.4138 32.4977C44.8372 33.3172 46.6575 32.8298 47.4814 31.4064C48.3052 29.9829 47.8135 28.1626 46.3901 27.3388L40.6532 24.0261L46.3901 20.7133C47.8178 19.8938 48.3052 18.0735 47.4814 16.6501Z",fill:"#29B5E8"})]}),oG=({className:e,size:t=24})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:s.jsx("path",{d:"M45.8905 35.0619V26.9571L45.0149 26.4095L24 37.9095L4.0796 26.9571V22.2476L24 33.0905L46 21.1524V13.1571L45.1244 12.6095L24 24.219L4.84577 13.7048L24 3.19048L39.4328 11.6238L40.6368 10.9667V10.0905L24 1L2 12.9381V14.1429L24 26.1905L43.9204 15.2381V20.0571L24 31.0095L2.87562 19.4L2 19.9476V28.0524L24 39.9905L43.9204 29.1476V33.8571L24 44.8095L2.87562 33.3095L2 33.8571V35.0619L24 47L45.8905 35.0619Z",fill:"#FF3621"})}),iG=({className:e,size:t=24})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[s.jsx("path",{d:"M2 8.48783L5.5122 7.02441V40.9756L2 39.5122V8.48783Z",fill:"#205B98"}),s.jsx("path",{d:"M5.51172 7.02441L12.2434 8.48783V39.5122L5.51172 40.9756V7.02441Z",fill:"#5294CF"}),s.jsx("path",{d:"M12.2441 3.5122L18 0V48L12.2441 44.4878V3.5122Z",fill:"#205B98"}),s.jsx("path",{d:"M18 0H30V48H18V0Z",fill:"#2D72B8"}),s.jsx("path",{d:"M35.3665 3.5122L30 0V48L35.3665 44.4878V3.5122Z",fill:"#5294CF"}),s.jsx("path",{d:"M45.6099 8.48783L42.0977 7.02441V40.9756L45.6099 39.5122V8.48783Z",fill:"#5294CF"}),s.jsx("path",{d:"M42.0969 7.02441L35.3652 8.48783V39.5122L42.0969 40.9756V7.02441Z",fill:"#205B98"})]}),lG=({className:e,size:t=24})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[s.jsx("path",{d:"M23.9333 0L3 11.9733V35.8933L23.9333 48L44.8667 36.0267V12.0267L23.9333 0ZM41 33.52L23.9333 43.3867L6.86667 33.624V14.3467L23.9333 4.48L41 14.3733V33.52Z",fill:"#0078D4"}),s.jsx("path",{d:"M23.9333 0L3 11.9733L6.86667 14.3467L23.9333 4.48L41 14.3467L44.8667 11.9733L23.9333 0Z",fill:"url(#paint0_linear_19_1262)"}),s.jsx("path",{d:"M33.9068 27.9336C33.7031 27.5984 33.4028 27.3325 33.0454 27.1709C31.9608 24.8031 30.2991 22.7454 28.2128 21.1865C26.1265 19.6276 23.6822 18.6173 21.1041 18.2482L38.3761 8.26689L34.3601 5.96289L14.6908 17.3336C14.3087 17.5535 14.0099 17.8936 13.8411 18.3009C13.6722 18.7082 13.6426 19.1598 13.757 19.5857C13.8714 20.0115 14.1232 20.3876 14.4734 20.6554C14.8236 20.9233 15.2525 21.068 15.6934 21.0669C15.7747 21.0519 15.8549 21.0314 15.9334 21.0056L16.2668 22.4002C18.7745 21.8089 21.4081 22.0755 23.7464 23.1574C26.0848 24.2393 27.9928 26.074 29.1654 28.3682L9.56812 39.6936L13.5681 42.0029L33.1761 30.6669C33.4376 30.5106 33.6586 30.295 33.8214 30.0376L34.0214 29.9896C34.0028 29.9122 33.9734 29.8429 33.9548 29.7656C34.0967 29.4794 34.1665 29.1629 34.1581 28.8436C34.1497 28.5243 34.0634 28.2119 33.9068 27.9336Z",fill:"#50E6FF"}),s.jsx("path",{d:"M32.176 24.0347C31.2003 24.0347 30.2465 24.3241 29.4352 24.8662C28.6239 25.4082 27.9916 26.1787 27.6182 27.0802C27.2448 27.9816 27.1471 28.9735 27.3375 29.9305C27.5278 30.8875 27.9977 31.7665 28.6876 32.4565C29.3775 33.1464 30.2566 33.6163 31.2135 33.8066C32.1705 33.997 33.1625 33.8993 34.0639 33.5259C34.9653 33.1525 35.7358 32.5202 36.2779 31.7089C36.82 30.8976 37.1093 29.9438 37.1093 28.9681C37.1093 27.6597 36.5896 26.4049 35.6644 25.4797C34.7392 24.5545 33.4844 24.0347 32.176 24.0347ZM15.6907 14.0454C14.7149 14.0454 13.7611 14.3347 12.9498 14.8768C12.1386 15.4189 11.5062 16.1894 11.1329 17.0908C10.7595 17.9923 10.6618 18.9842 10.8521 19.9412C11.0425 20.8982 11.5123 21.7772 12.2023 22.4671C12.8922 23.1571 13.7712 23.6269 14.7282 23.8173C15.6852 24.0076 16.6771 23.9099 17.5786 23.5365C18.48 23.1632 19.2505 22.5308 19.7926 21.7196C20.3347 20.9083 20.624 19.9545 20.624 18.9787C20.624 17.6703 20.1042 16.4155 19.1791 15.4904C18.2539 14.5652 16.9991 14.0454 15.6907 14.0454Z",fill:"url(#paint1_linear_19_1262)"}),s.jsxs("defs",{children:[s.jsxs("linearGradient",{id:"paint0_linear_19_1262",x1:"23.9333",y1:"14.3467",x2:"23.9333",y2:"0",gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{offset:"0.199","stop-color":"#005BA1"}),s.jsx("stop",{offset:"1","stop-color":"#0078D4"})]}),s.jsxs("linearGradient",{id:"paint1_linear_19_1262",x1:"23.9333",y1:"33.9014",x2:"23.9333",y2:"14.0987",gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{"stop-color":"#198AB3"}),s.jsx("stop",{offset:"0.172","stop-color":"#32BEDD"}),s.jsx("stop",{offset:"0.5","stop-color":"#198AB3"}),s.jsx("stop",{offset:"0.662","stop-color":"#32BEDD"}),s.jsx("stop",{offset:"0.975","stop-color":"#50E6FF"})]})]})]}),rc=({className:e="",size:t=24,base64:n})=>s.jsx("img",{src:n??void 0,alt:"icon",className:`max-w-none ${e}`,style:{width:t,height:t}}),cG=({className:e,size:t=24})=>s.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("path",{fill:"currentColor",d:"M12.455 21.73c-4.585 0-7.749-.347-7.964-.371-.164-.013-1.55-.141-2.44-1.037-.9-.907-1.26-2.518-1.274-2.586-.01-.044-.29-1.267-.432-3.389a61.23 61.23 0 0 1-.078-2.403c0-3.559.49-5.744.511-5.835.016-.068.377-1.522 1.273-2.423.873-.88 2.11-1.02 2.296-1.036.244-.036 2.712-.38 7.444-.38 1.422 0 3.843.082 3.867.083 2.365.106 3.696.274 3.86.296.186.014 1.554.149 2.437 1.037.895.9 1.255 2.355 1.27 2.417.018.069.508 1.963.508 5.743 0 .89-.065 2.337-.068 2.399-.131 2.248-.405 3.447-.416 3.497-.043.174-.422 1.66-1.123 2.383-1.035 1.066-2.154 1.212-2.356 1.23-.248.039-2.558.375-7.315.375Zm-.664-18.502c-4.815 0-7.295.367-7.32.371a.446.446 0 0 1-.038.004c-.009 0-1.04.086-1.711.76-.705.709-1.016 1.955-1.02 1.967-.003.015-.485 2.174-.485 5.614 0 .836.076 2.331.077 2.347.135 2.028.407 3.222.41 3.234.004.02.317 1.413 1.018 2.12.67.673 1.831.758 1.843.759l.024.002c.031.004 3.198.366 7.866.366 4.848 0 7.161-.362 7.184-.365a.484.484 0 0 1 .05-.005c.033-.003.91-.074 1.757-.947.441-.455.784-1.552.879-1.937 0-.004.265-1.173.391-3.323 0-.01.067-1.48.067-2.349 0-3.636-.475-5.488-.48-5.507-.005-.021-.316-1.267-1.02-1.976-.67-.674-1.832-.759-1.844-.76a.391.391 0 0 1-.033-.003c-.013-.002-1.362-.182-3.785-.29-.02 0-2.424-.082-3.83-.082Z"}),s.jsx("path",{fill:"currentColor",d:"M5.415 17.057V6.247h7.074c2.212 0 3.318.925 3.318 2.776 0 .74-.142 1.316-.425 1.732a1.476 1.476 0 0 1-.768.609c.201.052.398.155.59.311.585.477.878 1.213.878 2.209 0 1.162-.284 1.99-.85 2.489-.521.456-1.353.684-2.496.684H5.415Zm.987-9.722v3.531h6.482c.686 0 1.171-.114 1.456-.344.32-.26.48-.718.48-1.374 0-.615-.142-1.063-.425-1.344-.312-.313-.815-.469-1.511-.469H6.402Zm0 4.62v4.013h6.718c.658 0 1.152-.165 1.481-.498.33-.331.493-.86.493-1.586 0-.684-.173-1.177-.52-1.478-.348-.3-.86-.45-1.536-.45l-6.636-.001ZM19.282 17.057h-1.067V6.247h1.067v10.81Z"}),s.jsx("path",{fill:"currentColor",d:"M23.467 11.846c0-3.756-.488-5.627-.5-5.673l-.001-.006a6.188 6.188 0 0 0-.292-.852c-.197-.47-.494-1.022-.906-1.438-.4-.401-.917-.64-1.37-.779a4.392 4.392 0 0 0-.9-.18h-.015c-.156-.021-1.48-.19-3.837-.295-.114-.004-2.465-.082-3.855-.082-4.717 0-7.172.342-7.406.376l-.008.002H4.37c-.176.015-1.328.15-2.131.958-.414.416-.711.97-.909 1.44a6.178 6.178 0 0 0-.292.855c-.025.105-.505 2.264-.505 5.771 0 .84.073 2.278.078 2.386l.059.747c.105 1.173.243 1.982.316 2.358l.05.24.002.004c.006.028.096.432.292.937.199.512.497 1.1.909 1.515.402.405.925.644 1.38.783.453.137.82.17.891.176h.01l.685.069c1.19.107 3.82.301 7.25.301 4.744 0 7.041-.335 7.275-.371l.008-.001h.009c.167-.015 1.215-.149 2.188-1.152.312-.321.567-.832.752-1.307a8.15 8.15 0 0 0 .303-.951c.019-.085.282-1.266.409-3.448.005-.107.068-1.514.068-2.383Zm-.95 0c0-3.598-.469-5.426-.471-5.436l-.001-.005s-.02-.077-.059-.202a5.943 5.943 0 0 0-.177-.49c-.14-.341-.34-.73-.599-1.034l-.114-.124c-.289-.29-.697-.464-1.053-.564a3.79 3.79 0 0 0-.577-.114l-.048-.004a.677.677 0 0 1-.05-.005l-.062-.009-.186-.021a33.921 33.921 0 0 0-.727-.074 60.204 60.204 0 0 0-2.78-.185c-.022 0-2.421-.08-3.822-.08-2.401 0-4.218.091-5.437.183a37.894 37.894 0 0 0-1.725.169l-.087.011-.03.005h-.003a.744.744 0 0 1-.06.005h.001c.007 0-.23.02-.547.117-.32.099-.701.271-.994.566-.316.317-.553.769-.714 1.158-.145.35-.221.63-.234.678 0 0-.478 2.138-.478 5.552 0 .828.077 2.317.077 2.334.134 1.992.399 3.168.404 3.189a6.681 6.681 0 0 0 .235.763c.163.43.4.911.71 1.223.289.29.696.464 1.052.564.35.098.621.119.621.119h.002l.037.003H4.63c.007.002.017.002.03.004l.112.013a62.06 62.06 0 0 0 2.03.167c1.373.09 3.326.18 5.653.18 4.78 0 7.082-.353 7.142-.362l.077-.009c.067-.006.833-.094 1.581-.865.182-.188.363-.533.514-.908.147-.366.252-.724.297-.905.012-.054.263-1.201.384-3.274.004-.086.067-1.495.067-2.333ZM15.54 9.024c0-.869-.257-1.477-.733-1.875-.485-.406-1.243-.632-2.318-.633H5.68v10.27h7.055c1.118 0 1.872-.224 2.321-.618.483-.424.758-1.16.758-2.285 0-.94-.275-1.586-.778-1.997a1.303 1.303 0 0 0-.49-.26l-.881-.229.864-.29a1.21 1.21 0 0 0 .632-.503v-.002c.242-.354.379-.87.379-1.578Zm4.007-3.048v11.351h-1.6V5.976h1.6Zm-1.067 10.81h.534V6.517h-.534v10.27Zm-3.653-2.902c0-.643-.163-1.043-.427-1.272l-.114-.086c-.28-.19-.687-.3-1.248-.3l-6.37-.001v3.473h6.45c.618 0 1.032-.155 1.293-.419.258-.26.416-.703.416-1.395Zm-.275-4.737c0-.579-.134-.941-.345-1.15v-.001c-.24-.24-.659-.391-1.324-.391H6.67v2.99h6.215c.673 0 1.08-.115 1.29-.284.227-.185.38-.543.38-1.164Zm.808 4.737c0 .76-.17 1.374-.571 1.778-.397.4-.971.577-1.67.577H6.135v-4.555l6.904.001c.71 0 1.293.157 1.708.516.43.373.614.959.614 1.683Zm7.689-2.038c0 .44-.017 1.029-.033 1.506l-.024.605-.008.182-.002.05v.022c-.127 2.161-.393 3.345-.399 3.37v.003c-.05.203-.164.586-.322.979-.154.383-.366.814-.625 1.082-.907.935-1.856 1.02-1.929 1.026h-.005a.241.241 0 0 0-.023.003c-.053.008-2.382.368-7.225.368-3.51 0-6.175-.204-7.305-.308l-.593-.059v-.001h-.011a4.034 4.034 0 0 1-.727-.137c-.395-.111-.903-.317-1.285-.701-.39-.394-.662-.963-.832-1.412a6.672 6.672 0 0 1-.258-.84l-.004-.017-.01-.046a17.864 17.864 0 0 1-.145-.816 28.269 28.269 0 0 1-.257-2.396v-.011l-.002-.013-.002-.052-.008-.185c-.008-.156-.018-.371-.027-.612-.02-.48-.039-1.069-.039-1.493 0-3.459.485-5.638.493-5.674v-.006l.003-.005.003-.014.012-.046.048-.162c.043-.135.107-.323.194-.533.172-.414.442-.94.831-1.331.378-.38.849-.588 1.214-.7.365-.113.645-.137.668-.139h.002l.015-.002c.089-.013 2.58-.373 7.358-.373.706 0 1.662.02 2.441.04.39.01.737.02.988.028l.297.01c.035 0 .063.002.082.003h.033c1.216.055 2.164.128 2.81.187l1 .106.008.001h.01l.018.003.045.004a4.322 4.322 0 0 1 .663.13c.394.111.903.317 1.286.702.388.39.657.918.829 1.333.165.399.249.717.26.764l.08.374c.14.717.409 2.458.409 5.203Zm.95 0c0 .897-.066 2.35-.069 2.41v.004c-.132 2.26-.407 3.475-.423 3.543v.005c-.023.093-.132.52-.326 1.018-.19.492-.477 1.086-.866 1.488-1.073 1.106-2.236 1.281-2.507 1.308-.265.04-2.589.378-7.354.378-4.598 0-7.772-.348-7.994-.373a4.92 4.92 0 0 1-.994-.196c-.439-.134-.964-.36-1.416-.743l-.189-.174c-.488-.492-.82-1.162-1.029-1.7a7.404 7.404 0 0 1-.316-1.019c-.023-.1-.298-1.332-.438-3.43v-.003C.075 14.289 0 12.81 0 11.943c0-3.578.493-5.782.519-5.895v-.003c.01-.044.11-.439.32-.941.21-.5.54-1.125 1.024-1.61l.18-.169c.925-.8 2.096-.929 2.281-.945C4.65 2.333 7.127 2 11.791 2c.714 0 1.678.02 2.464.041a215.63 215.63 0 0 1 1.297.038l.082.002.023.001h.013c2.311.104 3.641.268 3.867.297.104.008.516.048 1.016.202.498.153 1.107.426 1.59.913l.174.188c.389.451.664.984.848 1.42.202.482.3.865.316.93.025.092.519 2.01.519 5.814Zm-8.914-2.699c0 .69-.167 1.25-.58 1.586v.001c-.359.289-.922.402-1.622.402H6.135v-4.07l6.75-.002c.725 0 1.312.162 1.696.546l.124.142c.268.348.381.827.381 1.395Zm.988-.123c0 .77-.147 1.407-.472 1.884a1.905 1.905 0 0 1-.396.435l.165.12v.002c.666.543.977 1.369.977 2.418 0 1.199-.292 2.123-.942 2.694-.592.519-1.502.75-2.67.75H5.148V5.976h7.342c1.135 0 2.037.236 2.658.756.63.528.926 1.31.926 2.292Z"})]}),uG=({className:e,size:t=24})=>s.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("path",{d:"M5.14132 15.1175C5.14132 16.4971 4.02636 17.612 2.64683 17.612C1.2673 17.612 0.152344 16.4971 0.152344 15.1175C0.152344 13.738 1.2673 12.623 2.64683 12.623H5.14132V15.1175ZM6.38856 15.1175C6.38856 13.738 7.50352 12.623 8.88305 12.623C10.2626 12.623 11.3775 13.738 11.3775 15.1175V21.3538C11.3775 22.7333 10.2626 23.8482 8.88305 23.8482C7.50352 23.8482 6.38856 22.7333 6.38856 21.3538V15.1175Z",fill:"#E01E5A"}),s.jsx("path",{d:"M8.88242 5.10226C7.50289 5.10226 6.38793 3.9873 6.38793 2.60777C6.38793 1.22824 7.50289 0.113281 8.88242 0.113281C10.2619 0.113281 11.3769 1.22824 11.3769 2.60777V5.10226H8.88242ZM8.88242 6.3684C10.2619 6.3684 11.3769 7.48336 11.3769 8.86289C11.3769 10.2424 10.2619 11.3574 8.88242 11.3574H2.6273C1.24777 11.3574 0.132812 10.2424 0.132812 8.86289C0.132812 7.48336 1.24777 6.3684 2.6273 6.3684H8.88242Z",fill:"#36C5F0"}),s.jsx("path",{d:"M18.8768 8.86289C18.8768 7.48336 19.9918 6.3684 21.3713 6.3684C22.7509 6.3684 23.8658 7.48336 23.8658 8.86289C23.8658 10.2424 22.7509 11.3574 21.3713 11.3574H18.8768V8.86289ZM17.6296 8.86289C17.6296 10.2424 16.5146 11.3574 15.1351 11.3574C13.7556 11.3574 12.6406 10.2424 12.6406 8.86289V2.60777C12.6406 1.22824 13.7556 0.113281 15.1351 0.113281C16.5146 0.113281 17.6296 1.22824 17.6296 2.60777V8.86289Z",fill:"#2EB67D"}),s.jsx("path",{d:"M15.1351 18.8593C16.5146 18.8593 17.6296 19.9742 17.6296 21.3538C17.6296 22.7333 16.5146 23.8482 15.1351 23.8482C13.7556 23.8482 12.6406 22.7333 12.6406 21.3538V18.8593H15.1351ZM15.1351 17.612C13.7556 17.612 12.6406 16.4971 12.6406 15.1175C12.6406 13.738 13.7556 12.623 15.1351 12.623H21.3902C22.7698 12.623 23.8847 13.738 23.8847 15.1175C23.8847 16.4971 22.7698 17.612 21.3902 17.612H15.1351Z",fill:"#ECB22E"})]}),dG=({className:e,size:t=24})=>s.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("rect",{fill:"currentColor",width:"3",height:"8",x:"13",y:"2",rx:"1.5"}),s.jsx("path",{fill:"currentColor",d:"M19 8.5V10h1.5A1.5 1.5 0 1 0 19 8.5"}),s.jsx("rect",{fill:"currentColor",width:"3",height:"8",x:"8",y:"14",rx:"1.5"}),s.jsx("path",{fill:"currentColor",d:"M5 15.5V14H3.5A1.5 1.5 0 1 0 5 15.5"}),s.jsx("rect",{fill:"currentColor",width:"8",height:"3",x:"14",y:"13",rx:"1.5"}),s.jsx("path",{fill:"currentColor",d:"M15.5 19H14v1.5a1.5 1.5 0 1 0 1.5-1.5"}),s.jsx("rect",{fill:"currentColor",width:"8",height:"3",x:"2",y:"8",rx:"1.5"}),s.jsx("path",{fill:"currentColor",d:"M8.5 5H10V3.5A1.5 1.5 0 1 0 8.5 5"})]}),fG=({className:e,size:t=24})=>s.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",children:[s.jsx("path",{d:"M16 16H22",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),s.jsx("path",{d:"M19 13V19",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),s.jsx("path",{d:"M21 9.99795V7.99795C20.9996 7.64722 20.9071 7.30276 20.7315 6.99911C20.556 6.69546 20.3037 6.44331 20 6.26795L13 2.26795C12.696 2.09241 12.3511 2 12 2C11.6489 2 11.304 2.09241 11 2.26795L4 6.26795C3.69626 6.44331 3.44398 6.69546 3.26846 6.99911C3.09294 7.30276 3.00036 7.64722 3 7.99795V15.9979C3.00036 16.3487 3.09294 16.6931 3.26846 16.9968C3.44398 17.3004 3.69626 17.5526 4 17.7279L11 21.7279C11.304 21.9035 11.6489 21.9959 12 21.9959C12.3511 21.9959 12.696 21.9035 13 21.7279L15 20.5879",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),s.jsx("path",{d:"M3.28906 7L11.9991 12L20.7091 7",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),s.jsx("path",{d:"M12 22V12",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"})]}),hG=({className:e,size:t=24})=>s.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",children:[s.jsx("path",{d:"M24 12C24 5.37308 18.6269 0 12 0C5.37308 0 0 5.37308 0 12C0 17.989 4.38757 22.9537 10.1252 23.8549V15.4696H7.07749V12H10.1252V9.35565C10.1252 6.34847 11.9173 4.68626 14.6579 4.68626C15.9707 4.68626 17.3444 4.92083 17.3444 4.92083V7.874H15.8307C14.3406 7.874 13.8748 8.79876 13.8748 9.74884V12H17.2026L16.6711 15.4696H13.8748V23.8549C19.6124 22.9554 24 17.9907 24 12Z",fill:"#1977F3"}),s.jsx("path",{d:"M16.6717 15.4708L17.2033 12.0012H13.8755V9.75008C13.8755 8.80169 14.3396 7.87524 15.8313 7.87524H17.345V4.92207C17.345 4.92207 15.9714 4.6875 14.6585 4.6875C11.918 4.6875 10.1258 6.34803 10.1258 9.35689V12.0012H7.07812V15.4708H10.1258V23.8561C10.7367 23.9523 11.3628 24.0012 12.0006 24.0012C12.6385 24.0012 13.2646 23.9506 13.8755 23.8561V15.4708H16.6717Z",fill:"#FEFEFE"})]}),mG=({className:e,size:t=24})=>s.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",children:[s.jsx("rect",{x:"2",y:"2",width:"20",height:"20",fill:"white"}),s.jsx("path",{d:"M20.4491 20.4496H16.8931V14.8805C16.8931 13.5525 16.8694 11.8429 15.0436 11.8429C13.1915 11.8429 12.9081 13.2899 12.9081 14.7838V20.4492H9.35203V8.99689H12.7658V10.562H12.8136C13.1553 9.97782 13.649 9.49726 14.2421 9.17149C14.8352 8.84572 15.5056 8.68693 16.1819 8.71203C19.7861 8.71203 20.4506 11.0828 20.4506 14.167L20.4491 20.4496ZM5.33963 7.43144C4.93148 7.43151 4.53247 7.31055 4.19307 7.08385C3.85367 6.85715 3.58913 6.53489 3.43287 6.15783C3.27661 5.78077 3.23566 5.36584 3.31521 4.96551C3.39477 4.56517 3.59125 4.19743 3.8798 3.90876C4.16835 3.6201 4.53602 3.42348 4.93631 3.34378C5.3366 3.26408 5.75152 3.30488 6.12863 3.46101C6.50573 3.61713 6.82807 3.88158 7.05489 4.22091C7.2817 4.56025 7.40281 4.95922 7.40288 5.36738C7.40293 5.63839 7.34959 5.90675 7.24593 6.15715C7.14227 6.40754 6.99032 6.63507 6.79873 6.82674C6.60714 7.0184 6.37966 7.17045 6.1293 7.27421C5.87895 7.37796 5.61062 7.43139 5.33963 7.43144ZM7.11765 20.4496H3.5579V8.99689H7.11765V20.4496ZM22.222 0.00163516H1.77099C1.30681 -0.00360329 0.859518 0.175663 0.52744 0.500042C0.195362 0.824421 0.00566506 1.26737 0 1.73156V22.2681C0.00547117 22.7325 0.195057 23.1758 0.527123 23.5005C0.85919 23.8252 1.30658 24.0048 1.77099 23.9999H22.222C22.6873 24.0057 23.1359 23.8266 23.4693 23.5019C23.8027 23.1772 23.9936 22.7334 24 22.2681V1.73008C23.9934 1.26497 23.8024 0.821515 23.469 0.497144C23.1356 0.172773 22.6871 -0.00598143 22.222 0.000152822",fill:"#0A66C2"})]}),pG=({className:e,size:t=24})=>s.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",children:[s.jsx("path",{d:"M2.4 0H21.6C22.9256 0 24 1.07443 24 2.4V21.6C24 22.9256 22.9256 24 21.6 24H2.4C1.07443 24 0 22.9256 0 21.6V2.4C0 1.07443 1.07443 0 2.4 0Z",fill:"#010101"}),s.jsx("path",{d:"M16.0971 9.46492C17.3375 10.3511 18.8571 10.8725 20.4981 10.8725V7.71605C20.1875 7.71617 19.8778 7.68377 19.5739 7.61937V10.104C17.9329 10.104 16.4136 9.58256 15.1729 8.69639V15.1378C15.1729 18.3601 12.5594 20.9721 9.33558 20.9721C8.13276 20.9721 7.01472 20.6087 6.08594 19.9853C7.14596 21.0686 8.62418 21.7407 10.2596 21.7407C13.4836 21.7407 16.0972 19.1286 16.0972 15.9062V9.46492H16.0971ZM17.2373 6.28044C16.6034 5.5883 16.1872 4.69375 16.0971 3.70479V3.29883H15.2213C15.4417 4.55571 16.1937 5.62956 17.2373 6.28044ZM8.12494 17.5127C7.77082 17.0486 7.5794 16.4808 7.58026 15.897C7.58026 14.4232 8.77571 13.2283 10.2505 13.2283C10.5254 13.2281 10.7986 13.2703 11.0605 13.3533V10.1263C10.7544 10.0844 10.4455 10.0666 10.1366 10.0732V12.5849C9.87454 12.5019 9.60122 12.4597 9.32629 12.4599C7.85147 12.4599 6.65612 13.6548 6.65612 15.1287C6.65612 16.1708 7.25362 17.0732 8.12494 17.5127Z",fill:"#EE1D52"}),s.jsx("path",{d:"M15.1726 8.69639C16.4133 9.58256 17.9326 10.104 19.5736 10.104V7.61937C18.6576 7.42444 17.8467 6.94594 17.237 6.28044C16.1934 5.62956 15.4414 4.55571 15.221 3.29883H12.9204V15.9061C12.9152 17.3758 11.7218 18.5658 10.2501 18.5658C9.38288 18.5658 8.61243 18.1527 8.12452 17.5127C7.2532 17.0732 6.6557 16.1708 6.6557 15.1287C6.6557 13.6548 7.85104 12.4599 9.32587 12.4599C9.60841 12.4599 9.88075 12.5039 10.1362 12.5849V10.0732C6.96907 10.1386 4.42188 12.7251 4.42188 15.9062C4.42188 17.4941 5.05621 18.9337 6.08563 19.9854C7.01441 20.6088 8.13245 20.9722 9.33528 20.9722C12.5591 20.9722 15.1726 18.3601 15.1726 15.1379V8.69639Z",fill:"white"}),s.jsx("path",{d:"M19.5758 7.6202V6.94836C18.7498 6.9496 17.9401 6.71839 17.2392 6.28116C17.8596 6.96001 18.6765 7.42815 19.5758 7.6202ZM15.2232 3.29966C15.2022 3.17955 15.186 3.05864 15.1748 2.93721V2.53125H11.9983V15.1386C11.9932 16.6082 10.7999 17.7982 9.32812 17.7982C8.89598 17.7982 8.48809 17.6958 8.12678 17.5135C8.61468 18.1535 9.38513 18.5666 10.2524 18.5666C11.7239 18.5666 12.9174 17.3766 12.9226 15.9069V3.29966H15.2232ZM10.1386 10.074V9.35876C9.87315 9.32247 9.60555 9.30433 9.33764 9.30447C6.1135 9.30447 3.5 11.9166 3.5 15.1386C3.5 17.1587 4.52715 18.9389 6.088 19.9862C5.05858 18.9344 4.42424 17.4948 4.42424 15.9069C4.42424 12.7259 6.97133 10.1394 10.1386 10.074Z",fill:"#69C9D0"})]}),gG=({className:e,size:t=24})=>s.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",children:[s.jsx("path",{d:"M2 2H11.5V11.5H2V2Z",fill:"#F25022"}),s.jsx("path",{d:"M12.5 2H22V11.5H12.5V2Z",fill:"#7FBA00"}),s.jsx("path",{d:"M2 12.5H11.5V22H2V12.5Z",fill:"#00A4EF"}),s.jsx("path",{d:"M12.5 12.5H22V22H12.5V12.5Z",fill:"#FFB900"})]}),yG=({className:e,size:t=24})=>s.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[s.jsxs("g",{"clip-path":"url(#clip0_377_3451)",children:[s.jsx("path",{d:"M16.4954 9.25H22.6042C23.1814 9.25 23.6492 9.71786 23.6492 10.295V15.8593C23.6492 17.9805 21.9297 19.7 19.8086 19.7H19.7904C17.6693 19.7003 15.9495 17.981 15.9492 15.8599C15.9492 15.8597 15.9492 15.8595 15.9492 15.8593V9.79616C15.9492 9.49452 16.1937 9.25 16.4954 9.25Z",fill:"#5059C9"}),s.jsx("path",{d:"M20.6234 8.14922C21.9903 8.14922 23.0984 7.04112 23.0984 5.67422C23.0984 4.30731 21.9903 3.19922 20.6234 3.19922C19.2565 3.19922 18.1484 4.30731 18.1484 5.67422C18.1484 7.04112 19.2565 8.14922 20.6234 8.14922Z",fill:"#5059C9"}),s.jsx("path",{d:"M12.9266 8.15001C14.901 8.15001 16.5016 6.54942 16.5016 4.575C16.5016 2.60058 14.901 1 12.9266 1C10.9521 1 9.35156 2.60058 9.35156 4.575C9.35156 6.54942 10.9521 8.15001 12.9266 8.15001Z",fill:"#7B83EB"}),s.jsx("path",{d:"M17.6912 9.25H7.60751C7.03725 9.26411 6.58614 9.73737 6.59937 10.3077V16.6541C6.51973 20.0763 9.22724 22.9163 12.6494 23C16.0715 22.9163 18.779 20.0763 18.6994 16.6541V10.3077C18.7126 9.73737 18.2615 9.26411 17.6912 9.25Z",fill:"#7B83EB"}),s.jsx("path",{opacity:"0.1",d:"M13.2019 9.25V18.1435C13.1991 18.5513 12.952 18.9177 12.5749 19.073C12.4548 19.1238 12.3257 19.15 12.1954 19.15H7.08585C7.01436 18.9685 6.94836 18.787 6.89335 18.6C6.70082 17.9689 6.60259 17.3128 6.60185 16.653V10.306C6.58863 9.73663 7.039 9.26411 7.60835 9.25H13.2019Z",fill:"black"}),s.jsx("path",{opacity:"0.2",d:"M12.6519 9.25V18.6935C12.6518 18.8239 12.6257 18.9529 12.5749 19.073C12.4196 19.4501 12.0532 19.6973 11.6454 19.7H7.34436C7.25085 19.5185 7.16286 19.337 7.08585 19.15C7.00885 18.963 6.94836 18.787 6.89335 18.6C6.70082 17.9689 6.60259 17.3128 6.60185 16.653V10.306C6.58863 9.73663 7.039 9.26411 7.60835 9.25H12.6519Z",fill:"black"}),s.jsx("path",{opacity:"0.2",d:"M12.6519 9.25V17.5935C12.6477 18.1476 12.1995 18.5958 11.6454 18.6H6.89335C6.70082 17.9689 6.60259 17.3128 6.60185 16.653V10.306C6.58863 9.73663 7.039 9.26411 7.60835 9.25H12.6519Z",fill:"black"}),s.jsx("path",{opacity:"0.2",d:"M12.1018 9.25V17.5935C12.0977 18.1476 11.6495 18.5958 11.0953 18.6H6.89335C6.70082 17.9689 6.60259 17.3128 6.60185 16.653V10.306C6.58863 9.73663 7.039 9.26411 7.60835 9.25H12.1018Z",fill:"black"}),s.jsx("path",{opacity:"0.1",d:"M13.2002 6.40688V8.13938C13.1067 8.14488 13.0187 8.15038 12.9252 8.15038C12.8317 8.15038 12.7437 8.14489 12.6502 8.13938C12.4646 8.12706 12.2805 8.09761 12.1002 8.05138C10.9865 7.78763 10.0663 7.00654 9.62522 5.95039C9.54932 5.77303 9.4904 5.58886 9.44922 5.40039H12.1937C12.7487 5.40249 13.1981 5.85188 13.2002 6.40688Z",fill:"black"}),s.jsx("path",{opacity:"0.2",d:"M12.65 6.95571V8.13821C12.4643 8.12589 12.2802 8.09644 12.1 8.05022C10.9862 7.78646 10.0661 7.00537 9.625 5.94922H11.6435C12.1985 5.95132 12.6479 6.40071 12.65 6.95571Z",fill:"black"}),s.jsx("path",{opacity:"0.2",d:"M12.65 6.95571V8.13821C12.4643 8.12589 12.2802 8.09644 12.1 8.05022C10.9862 7.78646 10.0661 7.00537 9.625 5.94922H11.6435C12.1985 5.95132 12.6479 6.40071 12.65 6.95571Z",fill:"black"}),s.jsx("path",{opacity:"0.2",d:"M12.1 6.95572V8.05022C10.9862 7.78646 10.0661 7.00537 9.625 5.94922H11.0935C11.6485 5.95133 12.0979 6.40072 12.1 6.95572Z",fill:"black"}),s.jsx("path",{d:"M1.00814 5.94922H11.0918C11.6486 5.94922 12.1 6.40059 12.1 6.95736V17.0411C12.1 17.5978 11.6486 18.0492 11.0918 18.0492H1.00814C0.451357 18.0492 0 17.5978 0 17.0411V6.95736C0 6.40059 0.451368 5.94922 1.00814 5.94922Z",fill:"url(#paint0_linear_377_3451)"}),s.jsx("path",{d:"M8.70484 9.78745H6.68908V15.2765H5.40484V9.78745H3.39844V8.72266H8.70484V9.78745Z",fill:"white"})]}),s.jsxs("defs",{children:[s.jsxs("linearGradient",{id:"paint0_linear_377_3451",x1:"2.10202",y1:"5.16147",x2:"9.99799",y2:"18.837",gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{"stop-color":"#5A62C3"}),s.jsx("stop",{offset:"0.5","stop-color":"#4D55BD"}),s.jsx("stop",{offset:"1","stop-color":"#3940AB"})]}),s.jsx("clipPath",{id:"clip0_377_3451",children:s.jsx("rect",{width:"23.65",height:"22",fill:"white",transform:"translate(0 1)"})})]})]}),vG=({className:e,size:t=24})=>s.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("path",{d:"M6.22775 0.0390625L6.2285 5.77431L0.5 5.77281V1.55856C0.5425 1.26056 0.63075 1.01031 0.76475 0.807812C1.09525 0.306812 1.57575 0.0545625 2.20625 0.0510625C3.53925 0.0440625 4.87975 0.0400625 6.22775 0.0390625Z",fill:"#0066DA"}),s.jsx("path",{d:"M6.22656 0.0390625L18.0331 0.0405625C18.0579 0.0405527 18.082 0.0481525 18.1021 0.0623125L18.1298 0.0825625C18.1218 0.0855625 18.1151 0.0888125 18.1096 0.0923125C18.1011 0.0968125 18.0968 0.103813 18.0968 0.113313L18.0953 5.77656C18.0943 5.77656 18.0931 5.77656 18.0916 5.77656H6.22956C6.22906 5.77606 6.22831 5.77531 6.22731 5.77431L6.22656 0.0390625Z",fill:"#FBBC04"}),s.jsx("path",{d:"M18.1322 0.0820312L23.7909 5.75803L18.0977 5.77603L18.0992 0.112781C18.0992 0.103281 18.1034 0.0962812 18.1119 0.0917812C18.1174 0.0882812 18.1242 0.0850312 18.1322 0.0820312Z",fill:"#EA4335"}),s.jsx("path",{d:"M0.5 5.77148L6.2285 5.77298C6.2295 5.77398 6.23025 5.77473 6.23075 5.77523L6.23225 13.7012L0.5 13.6997V5.77148Z",fill:"#2684FC"}),s.jsx("path",{d:"M23.788 5.75781L23.8232 5.78331V17.9258C23.6902 18.6523 23.3137 19.1216 22.6937 19.3336C22.4727 19.4096 22.147 19.4471 21.7165 19.4461C18.922 19.4416 16.099 19.4373 13.2475 19.4333C12.8335 19.4328 12.4135 19.4358 11.9875 19.4423C11.964 19.4428 11.944 19.4513 11.9275 19.4678C10.5325 20.8563 9.13247 22.2568 7.72747 23.6693C7.51222 23.8861 7.26847 24.0068 6.95947 23.9611C6.67147 23.9186 6.45922 23.7701 6.32272 23.5156C6.26522 23.4076 6.23597 23.2106 6.23497 22.9246C6.23147 21.7651 6.23022 20.6018 6.23122 19.4348L6.23047 16.5638L9.06397 13.7303C9.07632 13.718 9.09102 13.7081 9.10723 13.7015C9.12345 13.6948 9.14086 13.6913 9.15847 13.6913L18.031 13.6943C18.0475 13.6943 18.0633 13.6878 18.075 13.6761C18.0867 13.6644 18.0932 13.6486 18.0932 13.6321L18.091 5.77581C18.0925 5.77581 18.0937 5.77581 18.0947 5.77581L23.788 5.75781Z",fill:"#00AC47"}),s.jsx("path",{d:"M6.23225 13.7027V16.5647L6.233 19.4357C5.0345 19.4427 3.84625 19.4449 2.66825 19.4424C2.17725 19.4414 1.8235 19.4029 1.607 19.3269C1 19.1149 0.631 18.6449 0.5 17.9169V13.7012L6.23225 13.7027Z",fill:"#00832D"})]}),xG=({className:e,size:t=24,strokeWidth:n=2,strokeColor:r="#1E88E5"})=>s.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:r,"stroke-width":n,"stroke-linecap":"round","stroke-linejoin":"round",children:[s.jsx("path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7"}),s.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"})]});function Ko({className:e,...t}){return s.jsx("textarea",{"data-slot":"textarea",className:ne("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}function EA({value:e,onChange:t,keysToMask:n=[],className:r,minHeightClass:o="min-h-[150px]",displayOnly:l=!1,showCopyButton:c=!1}){const d=(C,R)=>{if(!C||R.length===0)return!1;try{const j=JSON.parse(C),_=D=>typeof D!="object"||D===null?!1:Array.isArray(D)?D.some(A=>typeof A=="object"&&A!==null&&_(A)):Object.keys(D).some(A=>R.includes(A)||typeof D[A]=="object"&&D[A]!==null&&_(D[A]));return _(j)}catch{return!1}},f=l?!1:!e||n.length===0||!d(e,n),[h,g]=m.useState(f),[y,v]=m.useState(!1);m.useEffect(()=>{l?g(!1):(!e||n.length===0||!d(e,n))&&g(!0)},[e,n,l]),m.useEffect(()=>{if(y){const C=setTimeout(()=>{v(!1)},2e3);return()=>{clearTimeout(C)}}},[y]);const b=()=>{navigator.clipboard.writeText(e),v(!0)},w=C=>{if(!C)return"";try{const R=JSON.parse(C),j=A=>{if(typeof A!="object"||A===null)return A;const O=Array.isArray(A)?[...A]:{...A};return Array.isArray(O)?O.forEach((T,M)=>{typeof T=="object"&&T!==null&&(O[M]=j(T))}):Object.entries(O).forEach(([T,M])=>{if(n.includes(T))if(typeof M=="string"){const F=M.length;F>30?O[T]="*".repeat(Math.min(20,Math.ceil(F/3))):F>10?O[T]="*".repeat(Math.min(10,Math.ceil(F/2))):O[T]="*".repeat(F)}else O[T]="***";else typeof M=="object"&&M!==null&&(O[T]=j(M))}),O},D=j(typeof R=="object"?R:{});return JSON.stringify(D,null,2)}catch{return C}},S=e&&n.length>0&&d(e,n);return s.jsxs("div",{className:"relative",children:[!h&&S&&!l&&s.jsx(vs,{children:s.jsxs(bt,{children:[s.jsx(St,{asChild:!0,children:s.jsx("div",{className:"absolute top-2 left-2 z-10",children:s.jsx(Uk,{className:"h-4 w-4 text-gray-500"})})}),s.jsx(Ct,{children:s.jsx("p",{children:"Content is locked in masked mode. Click the eye icon to enable editing."})})]})}),l?s.jsx("div",{className:`p-2 font-mono ${r??""} ${o} cursor-not-allowed whitespace-pre-wrap opacity-70`,children:w(e)}):s.jsx(Ko,{value:h?e:w(e),onChange:C=>{(h||!S)&&t&&t(C.target.value)},onFocus:C=>{!h&&S&&C.target.blur()},readOnly:!!(!h&&S),className:`font-mono ${r??""} ${!h&&S?"cursor-not-allowed opacity-70":""} ${o}`,rows:8}),S&&!l&&s.jsx(Se,{type:"button",variant:"ghost",className:"absolute top-2 right-2",onClick:()=>{g(!h)},children:h?s.jsx(vs,{children:s.jsxs(bt,{children:[s.jsx(St,{asChild:!0,children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(xk,{className:"h-4 w-4"}),s.jsx("span",{className:"text-xs",children:"Mask & Lock"})]})}),s.jsx(Ct,{children:s.jsx("p",{children:"Mask sensitive data and lock editing"})})]})}):s.jsx(vs,{children:s.jsxs(bt,{children:[s.jsx(St,{asChild:!0,children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(j_,{className:"h-4 w-4"}),s.jsx("span",{className:"text-xs",children:"Show & Edit"})]})}),s.jsx(Ct,{children:s.jsx("p",{children:"Show sensitive data and enable editing"})})]})})}),c&&s.jsx(Se,{type:"button",variant:"ghost",className:`absolute ${S&&!l?"top-2 right-24":"top-2 right-2"}`,onClick:b,children:s.jsx(vs,{children:s.jsxs(bt,{children:[s.jsx(St,{asChild:!0,children:s.jsx("div",{className:"flex items-center gap-1",children:y?s.jsxs(s.Fragment,{children:[s.jsx(lr,{className:"h-4 w-4"}),s.jsx("span",{className:"text-xs",children:"Copied!"})]}):s.jsxs(s.Fragment,{children:[s.jsx(df,{className:"h-4 w-4"}),s.jsx("span",{className:"text-xs",children:"Copy"})]})})}),s.jsx(Ct,{children:s.jsx("p",{children:"Copy content to clipboard"})})]})})})]})}var Ut;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function n(o){throw new Error}e.assertNever=n,e.arrayToEnum=o=>{const l={};for(const c of o)l[c]=c;return l},e.getValidEnumValues=o=>{const l=e.objectKeys(o).filter(d=>typeof o[o[d]]!="number"),c={};for(const d of l)c[d]=o[d];return e.objectValues(c)},e.objectValues=o=>e.objectKeys(o).map(function(l){return o[l]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const l=[];for(const c in o)Object.prototype.hasOwnProperty.call(o,c)&&l.push(c);return l},e.find=(o,l)=>{for(const c of o)if(l(c))return c},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function r(o,l=" | "){return o.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}e.joinValues=r,e.jsonStringifyReplacer=(o,l)=>typeof l=="bigint"?l.toString():l})(Ut||(Ut={}));var bj;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(bj||(bj={}));const $e=Ut.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ni=e=>{switch(typeof e){case"undefined":return $e.undefined;case"string":return $e.string;case"number":return Number.isNaN(e)?$e.nan:$e.number;case"boolean":return $e.boolean;case"function":return $e.function;case"bigint":return $e.bigint;case"symbol":return $e.symbol;case"object":return Array.isArray(e)?$e.array:e===null?$e.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?$e.promise:typeof Map<"u"&&e instanceof Map?$e.map:typeof Set<"u"&&e instanceof Set?$e.set:typeof Date<"u"&&e instanceof Date?$e.date:$e.object;default:return $e.unknown}},Ce=Ut.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Ho extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(l){return l.message},r={_errors:[]},o=l=>{for(const c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(o);else if(c.code==="invalid_return_type")o(c.returnTypeError);else if(c.code==="invalid_arguments")o(c.argumentsError);else if(c.path.length===0)r._errors.push(n(c));else{let d=r,f=0;for(;f<c.path.length;){const h=c.path[f];f===c.path.length-1?(d[h]=d[h]||{_errors:[]},d[h]._errors.push(n(c))):d[h]=d[h]||{_errors:[]},d=d[h],f++}}};return o(this),r}static assert(t){if(!(t instanceof Ho))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ut.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const o of this.issues)if(o.path.length>0){const l=o.path[0];n[l]=n[l]||[],n[l].push(t(o))}else r.push(t(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Ho.create=e=>new Ho(e);const z0=(e,t)=>{let n;switch(e.code){case Ce.invalid_type:e.received===$e.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Ce.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ut.jsonStringifyReplacer)}`;break;case Ce.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ut.joinValues(e.keys,", ")}`;break;case Ce.invalid_union:n="Invalid input";break;case Ce.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ut.joinValues(e.options)}`;break;case Ce.invalid_enum_value:n=`Invalid enum value. Expected ${Ut.joinValues(e.options)}, received '${e.received}'`;break;case Ce.invalid_arguments:n="Invalid function arguments";break;case Ce.invalid_return_type:n="Invalid function return type";break;case Ce.invalid_date:n="Invalid date";break;case Ce.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Ut.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Ce.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Ce.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Ce.custom:n="Invalid input";break;case Ce.invalid_intersection_types:n="Intersection results could not be merged";break;case Ce.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Ce.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ut.assertNever(e)}return{message:n}};let bG=z0;function SG(){return bG}const CG=e=>{const{data:t,path:n,errorMaps:r,issueData:o}=e,l=[...n,...o.path||[]],c={...o,path:l};if(o.message!==void 0)return{...o,path:l,message:o.message};let d="";const f=r.filter(h=>!!h).slice().reverse();for(const h of f)d=h(c,{data:t,defaultError:d}).message;return{...o,path:l,message:d}};function Oe(e,t){const n=SG(),r=CG({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===z0?void 0:z0].filter(o=>!!o)});e.common.issues.push(r)}class qr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const o of n){if(o.status==="aborted")return lt;o.status==="dirty"&&t.dirty(),r.push(o.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const o of n){const l=await o.key,c=await o.value;r.push({key:l,value:c})}return qr.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const o of n){const{key:l,value:c}=o;if(l.status==="aborted"||c.status==="aborted")return lt;l.status==="dirty"&&t.dirty(),c.status==="dirty"&&t.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||o.alwaysSet)&&(r[l.value]=c.value)}return{status:t.value,value:r}}}const lt=Object.freeze({status:"aborted"}),Wd=e=>({status:"dirty",value:e}),as=e=>({status:"valid",value:e}),Sj=e=>e.status==="aborted",Cj=e=>e.status==="dirty",wu=e=>e.status==="valid",Ep=e=>typeof Promise<"u"&&e instanceof Promise;var Je;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Je||(Je={}));class Ys{constructor(t,n,r,o){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Ej=(e,t)=>{if(wu(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Ho(e.common.issues);return this._error=n,this._error}}};function yt(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:o}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(c,d)=>{const{message:f}=e;return c.code==="invalid_enum_value"?{message:f??d.defaultError}:typeof d.data>"u"?{message:f??r??d.defaultError}:c.code!=="invalid_type"?{message:d.defaultError}:{message:f??n??d.defaultError}},description:o}}class At{get description(){return this._def.description}_getType(t){return Ni(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Ni(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new qr,ctx:{common:t.parent.common,data:t.data,parsedType:Ni(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Ep(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ni(t)},o=this._parseSync({data:t,path:r.path,parent:r});return Ej(r,o)}"~validate"(t){var r,o;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ni(t)};if(!this["~standard"].async)try{const l=this._parseSync({data:t,path:[],parent:n});return wu(l)?{value:l.value}:{issues:n.common.issues}}catch(l){(o=(r=l==null?void 0:l.message)==null?void 0:r.toLowerCase())!=null&&o.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(l=>wu(l)?{value:l.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ni(t)},o=this._parse({data:t,path:r.path,parent:r}),l=await(Ep(o)?o:Promise.resolve(o));return Ej(r,l)}refine(t,n){const r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,l)=>{const c=t(o),d=()=>l.addIssue({code:Ce.custom,...r(o)});return typeof Promise<"u"&&c instanceof Promise?c.then(f=>f?!0:(d(),!1)):c?!0:(d(),!1)})}refinement(t,n){return this._refinement((r,o)=>t(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(t){return new Zl({schema:this,typeName:ct.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Io.create(this,this._def)}nullable(){return Kl.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Gs.create(this)}promise(){return Dp.create(this,this._def)}or(t){return jp.create([this,t],this._def)}and(t){return Tp.create(this,t,this._def)}transform(t){return new Zl({...yt(this._def),schema:this,typeName:ct.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Op({...yt(this._def),innerType:this,defaultValue:n,typeName:ct.ZodDefault})}brand(){return new TA({typeName:ct.ZodBranded,type:this,...yt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Mp({...yt(this._def),innerType:this,catchValue:n,typeName:ct.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Nb.create(this,t)}readonly(){return Ip.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const EG=/^c[^\s-]{8,}$/i,wG=/^[0-9a-z]+$/,RG=/^[0-9A-HJKMNP-TV-Z]{26}$/i,jG=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,TG=/^[a-z0-9_-]{21}$/i,_G=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,NG=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,AG=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,DG="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Fx;const OG=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,MG=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,IG=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,kG=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,LG=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,PG=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,wA="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",UG=new RegExp(`^${wA}$`);function RA(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function FG(e){return new RegExp(`^${RA(e)}$`)}function VG(e){let t=`${wA}T${RA(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function zG(e,t){return!!((t==="v4"||!t)&&OG.test(e)||(t==="v6"||!t)&&IG.test(e))}function HG(e,t){if(!_G.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(r));return!(typeof o!="object"||o===null||"typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||t&&o.alg!==t)}catch{return!1}}function $G(e,t){return!!((t==="v4"||!t)&&MG.test(e)||(t==="v6"||!t)&&kG.test(e))}class Oo extends At{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==$e.string){const l=this._getOrReturnCtx(t);return Oe(l,{code:Ce.invalid_type,expected:$e.string,received:l.parsedType}),lt}const r=new qr;let o;for(const l of this._def.checks)if(l.kind==="min")t.data.length<l.value&&(o=this._getOrReturnCtx(t,o),Oe(o,{code:Ce.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),r.dirty());else if(l.kind==="max")t.data.length>l.value&&(o=this._getOrReturnCtx(t,o),Oe(o,{code:Ce.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),r.dirty());else if(l.kind==="length"){const c=t.data.length>l.value,d=t.data.length<l.value;(c||d)&&(o=this._getOrReturnCtx(t,o),c?Oe(o,{code:Ce.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):d&&Oe(o,{code:Ce.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),r.dirty())}else if(l.kind==="email")AG.test(t.data)||(o=this._getOrReturnCtx(t,o),Oe(o,{validation:"email",code:Ce.invalid_string,message:l.message}),r.dirty());else if(l.kind==="emoji")Fx||(Fx=new RegExp(DG,"u")),Fx.test(t.data)||(o=this._getOrReturnCtx(t,o),Oe(o,{validation:"emoji",code:Ce.invalid_string,message:l.message}),r.dirty());else if(l.kind==="uuid")jG.test(t.data)||(o=this._getOrReturnCtx(t,o),Oe(o,{validation:"uuid",code:Ce.invalid_string,message:l.message}),r.dirty());else if(l.kind==="nanoid")TG.test(t.data)||(o=this._getOrReturnCtx(t,o),Oe(o,{validation:"nanoid",code:Ce.invalid_string,message:l.message}),r.dirty());else if(l.kind==="cuid")EG.test(t.data)||(o=this._getOrReturnCtx(t,o),Oe(o,{validation:"cuid",code:Ce.invalid_string,message:l.message}),r.dirty());else if(l.kind==="cuid2")wG.test(t.data)||(o=this._getOrReturnCtx(t,o),Oe(o,{validation:"cuid2",code:Ce.invalid_string,message:l.message}),r.dirty());else if(l.kind==="ulid")RG.test(t.data)||(o=this._getOrReturnCtx(t,o),Oe(o,{validation:"ulid",code:Ce.invalid_string,message:l.message}),r.dirty());else if(l.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),Oe(o,{validation:"url",code:Ce.invalid_string,message:l.message}),r.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),Oe(o,{validation:"regex",code:Ce.invalid_string,message:l.message}),r.dirty())):l.kind==="trim"?t.data=t.data.trim():l.kind==="includes"?t.data.includes(l.value,l.position)||(o=this._getOrReturnCtx(t,o),Oe(o,{code:Ce.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),r.dirty()):l.kind==="toLowerCase"?t.data=t.data.toLowerCase():l.kind==="toUpperCase"?t.data=t.data.toUpperCase():l.kind==="startsWith"?t.data.startsWith(l.value)||(o=this._getOrReturnCtx(t,o),Oe(o,{code:Ce.invalid_string,validation:{startsWith:l.value},message:l.message}),r.dirty()):l.kind==="endsWith"?t.data.endsWith(l.value)||(o=this._getOrReturnCtx(t,o),Oe(o,{code:Ce.invalid_string,validation:{endsWith:l.value},message:l.message}),r.dirty()):l.kind==="datetime"?VG(l).test(t.data)||(o=this._getOrReturnCtx(t,o),Oe(o,{code:Ce.invalid_string,validation:"datetime",message:l.message}),r.dirty()):l.kind==="date"?UG.test(t.data)||(o=this._getOrReturnCtx(t,o),Oe(o,{code:Ce.invalid_string,validation:"date",message:l.message}),r.dirty()):l.kind==="time"?FG(l).test(t.data)||(o=this._getOrReturnCtx(t,o),Oe(o,{code:Ce.invalid_string,validation:"time",message:l.message}),r.dirty()):l.kind==="duration"?NG.test(t.data)||(o=this._getOrReturnCtx(t,o),Oe(o,{validation:"duration",code:Ce.invalid_string,message:l.message}),r.dirty()):l.kind==="ip"?zG(t.data,l.version)||(o=this._getOrReturnCtx(t,o),Oe(o,{validation:"ip",code:Ce.invalid_string,message:l.message}),r.dirty()):l.kind==="jwt"?HG(t.data,l.alg)||(o=this._getOrReturnCtx(t,o),Oe(o,{validation:"jwt",code:Ce.invalid_string,message:l.message}),r.dirty()):l.kind==="cidr"?$G(t.data,l.version)||(o=this._getOrReturnCtx(t,o),Oe(o,{validation:"cidr",code:Ce.invalid_string,message:l.message}),r.dirty()):l.kind==="base64"?LG.test(t.data)||(o=this._getOrReturnCtx(t,o),Oe(o,{validation:"base64",code:Ce.invalid_string,message:l.message}),r.dirty()):l.kind==="base64url"?PG.test(t.data)||(o=this._getOrReturnCtx(t,o),Oe(o,{validation:"base64url",code:Ce.invalid_string,message:l.message}),r.dirty()):Ut.assertNever(l);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(o=>t.test(o),{validation:n,code:Ce.invalid_string,...Je.errToObj(r)})}_addCheck(t){return new Oo({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Je.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Je.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Je.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Je.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Je.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Je.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Je.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Je.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Je.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Je.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Je.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Je.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Je.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...Je.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Je.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Je.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Je.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Je.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Je.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Je.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Je.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Je.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Je.errToObj(n)})}nonempty(t){return this.min(1,Je.errToObj(t))}trim(){return new Oo({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Oo({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Oo({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Oo.create=e=>new Oo({checks:[],typeName:ct.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...yt(e)});function BG(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,l=Number.parseInt(e.toFixed(o).replace(".","")),c=Number.parseInt(t.toFixed(o).replace(".",""));return l%c/10**o}class Ru extends At{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==$e.number){const l=this._getOrReturnCtx(t);return Oe(l,{code:Ce.invalid_type,expected:$e.number,received:l.parsedType}),lt}let r;const o=new qr;for(const l of this._def.checks)l.kind==="int"?Ut.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Oe(r,{code:Ce.invalid_type,expected:"integer",received:"float",message:l.message}),o.dirty()):l.kind==="min"?(l.inclusive?t.data<l.value:t.data<=l.value)&&(r=this._getOrReturnCtx(t,r),Oe(r,{code:Ce.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),o.dirty()):l.kind==="max"?(l.inclusive?t.data>l.value:t.data>=l.value)&&(r=this._getOrReturnCtx(t,r),Oe(r,{code:Ce.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),o.dirty()):l.kind==="multipleOf"?BG(t.data,l.value)!==0&&(r=this._getOrReturnCtx(t,r),Oe(r,{code:Ce.not_multiple_of,multipleOf:l.value,message:l.message}),o.dirty()):l.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Oe(r,{code:Ce.not_finite,message:l.message}),o.dirty()):Ut.assertNever(l);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Je.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Je.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Je.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Je.toString(n))}setLimit(t,n,r,o){return new Ru({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Je.toString(o)}]})}_addCheck(t){return new Ru({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Je.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Je.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Je.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Je.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Je.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Je.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Je.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Je.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Je.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ut.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}Ru.create=e=>new Ru({checks:[],typeName:ct.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...yt(e)});class vf extends At{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==$e.bigint)return this._getInvalidInput(t);let r;const o=new qr;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?t.data<l.value:t.data<=l.value)&&(r=this._getOrReturnCtx(t,r),Oe(r,{code:Ce.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),o.dirty()):l.kind==="max"?(l.inclusive?t.data>l.value:t.data>=l.value)&&(r=this._getOrReturnCtx(t,r),Oe(r,{code:Ce.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),o.dirty()):l.kind==="multipleOf"?t.data%l.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Oe(r,{code:Ce.not_multiple_of,multipleOf:l.value,message:l.message}),o.dirty()):Ut.assertNever(l);return{status:o.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return Oe(n,{code:Ce.invalid_type,expected:$e.bigint,received:n.parsedType}),lt}gte(t,n){return this.setLimit("min",t,!0,Je.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Je.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Je.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Je.toString(n))}setLimit(t,n,r,o){return new vf({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Je.toString(o)}]})}_addCheck(t){return new vf({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Je.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Je.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Je.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Je.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Je.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}vf.create=e=>new vf({checks:[],typeName:ct.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...yt(e)});class H0 extends At{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==$e.boolean){const r=this._getOrReturnCtx(t);return Oe(r,{code:Ce.invalid_type,expected:$e.boolean,received:r.parsedType}),lt}return as(t.data)}}H0.create=e=>new H0({typeName:ct.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...yt(e)});class wp extends At{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==$e.date){const l=this._getOrReturnCtx(t);return Oe(l,{code:Ce.invalid_type,expected:$e.date,received:l.parsedType}),lt}if(Number.isNaN(t.data.getTime())){const l=this._getOrReturnCtx(t);return Oe(l,{code:Ce.invalid_date}),lt}const r=new qr;let o;for(const l of this._def.checks)l.kind==="min"?t.data.getTime()<l.value&&(o=this._getOrReturnCtx(t,o),Oe(o,{code:Ce.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),r.dirty()):l.kind==="max"?t.data.getTime()>l.value&&(o=this._getOrReturnCtx(t,o),Oe(o,{code:Ce.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),r.dirty()):Ut.assertNever(l);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new wp({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Je.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Je.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}wp.create=e=>new wp({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:ct.ZodDate,...yt(e)});class wj extends At{_parse(t){if(this._getType(t)!==$e.symbol){const r=this._getOrReturnCtx(t);return Oe(r,{code:Ce.invalid_type,expected:$e.symbol,received:r.parsedType}),lt}return as(t.data)}}wj.create=e=>new wj({typeName:ct.ZodSymbol,...yt(e)});class $0 extends At{_parse(t){if(this._getType(t)!==$e.undefined){const r=this._getOrReturnCtx(t);return Oe(r,{code:Ce.invalid_type,expected:$e.undefined,received:r.parsedType}),lt}return as(t.data)}}$0.create=e=>new $0({typeName:ct.ZodUndefined,...yt(e)});class Rp extends At{_parse(t){if(this._getType(t)!==$e.null){const r=this._getOrReturnCtx(t);return Oe(r,{code:Ce.invalid_type,expected:$e.null,received:r.parsedType}),lt}return as(t.data)}}Rp.create=e=>new Rp({typeName:ct.ZodNull,...yt(e)});class Rj extends At{constructor(){super(...arguments),this._any=!0}_parse(t){return as(t.data)}}Rj.create=e=>new Rj({typeName:ct.ZodAny,...yt(e)});class B0 extends At{constructor(){super(...arguments),this._unknown=!0}_parse(t){return as(t.data)}}B0.create=e=>new B0({typeName:ct.ZodUnknown,...yt(e)});class qi extends At{_parse(t){const n=this._getOrReturnCtx(t);return Oe(n,{code:Ce.invalid_type,expected:$e.never,received:n.parsedType}),lt}}qi.create=e=>new qi({typeName:ct.ZodNever,...yt(e)});class jj extends At{_parse(t){if(this._getType(t)!==$e.undefined){const r=this._getOrReturnCtx(t);return Oe(r,{code:Ce.invalid_type,expected:$e.void,received:r.parsedType}),lt}return as(t.data)}}jj.create=e=>new jj({typeName:ct.ZodVoid,...yt(e)});class Gs extends At{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),o=this._def;if(n.parsedType!==$e.array)return Oe(n,{code:Ce.invalid_type,expected:$e.array,received:n.parsedType}),lt;if(o.exactLength!==null){const c=n.data.length>o.exactLength.value,d=n.data.length<o.exactLength.value;(c||d)&&(Oe(n,{code:c?Ce.too_big:Ce.too_small,minimum:d?o.exactLength.value:void 0,maximum:c?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(Oe(n,{code:Ce.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(Oe(n,{code:Ce.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((c,d)=>o.type._parseAsync(new Ys(n,c,n.path,d)))).then(c=>qr.mergeArray(r,c));const l=[...n.data].map((c,d)=>o.type._parseSync(new Ys(n,c,n.path,d)));return qr.mergeArray(r,l)}get element(){return this._def.type}min(t,n){return new Gs({...this._def,minLength:{value:t,message:Je.toString(n)}})}max(t,n){return new Gs({...this._def,maxLength:{value:t,message:Je.toString(n)}})}length(t,n){return new Gs({...this._def,exactLength:{value:t,message:Je.toString(n)}})}nonempty(t){return this.min(1,t)}}Gs.create=(e,t)=>new Gs({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ct.ZodArray,...yt(t)});function tu(e){if(e instanceof Xn){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Io.create(tu(r))}return new Xn({...e._def,shape:()=>t})}else return e instanceof Gs?new Gs({...e._def,type:tu(e.element)}):e instanceof Io?Io.create(tu(e.unwrap())):e instanceof Kl?Kl.create(tu(e.unwrap())):e instanceof Gl?Gl.create(e.items.map(t=>tu(t))):e}class Xn extends At{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Ut.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==$e.object){const h=this._getOrReturnCtx(t);return Oe(h,{code:Ce.invalid_type,expected:$e.object,received:h.parsedType}),lt}const{status:r,ctx:o}=this._processInputParams(t),{shape:l,keys:c}=this._getCached(),d=[];if(!(this._def.catchall instanceof qi&&this._def.unknownKeys==="strip"))for(const h in o.data)c.includes(h)||d.push(h);const f=[];for(const h of c){const g=l[h],y=o.data[h];f.push({key:{status:"valid",value:h},value:g._parse(new Ys(o,y,o.path,h)),alwaysSet:h in o.data})}if(this._def.catchall instanceof qi){const h=this._def.unknownKeys;if(h==="passthrough")for(const g of d)f.push({key:{status:"valid",value:g},value:{status:"valid",value:o.data[g]}});else if(h==="strict")d.length>0&&(Oe(o,{code:Ce.unrecognized_keys,keys:d}),r.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const h=this._def.catchall;for(const g of d){const y=o.data[g];f.push({key:{status:"valid",value:g},value:h._parse(new Ys(o,y,o.path,g)),alwaysSet:g in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const h=[];for(const g of f){const y=await g.key,v=await g.value;h.push({key:y,value:v,alwaysSet:g.alwaysSet})}return h}).then(h=>qr.mergeObjectSync(r,h)):qr.mergeObjectSync(r,f)}get shape(){return this._def.shape()}strict(t){return Je.errToObj,new Xn({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var l,c;const o=((c=(l=this._def).errorMap)==null?void 0:c.call(l,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:Je.errToObj(t).message??o}:{message:o}}}:{}})}strip(){return new Xn({...this._def,unknownKeys:"strip"})}passthrough(){return new Xn({...this._def,unknownKeys:"passthrough"})}extend(t){return new Xn({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Xn({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ct.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Xn({...this._def,catchall:t})}pick(t){const n={};for(const r of Ut.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Xn({...this._def,shape:()=>n})}omit(t){const n={};for(const r of Ut.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new Xn({...this._def,shape:()=>n})}deepPartial(){return tu(this)}partial(t){const n={};for(const r of Ut.objectKeys(this.shape)){const o=this.shape[r];t&&!t[r]?n[r]=o:n[r]=o.optional()}return new Xn({...this._def,shape:()=>n})}required(t){const n={};for(const r of Ut.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let l=this.shape[r];for(;l instanceof Io;)l=l._def.innerType;n[r]=l}return new Xn({...this._def,shape:()=>n})}keyof(){return jA(Ut.objectKeys(this.shape))}}Xn.create=(e,t)=>new Xn({shape:()=>e,unknownKeys:"strip",catchall:qi.create(),typeName:ct.ZodObject,...yt(t)});Xn.strictCreate=(e,t)=>new Xn({shape:()=>e,unknownKeys:"strict",catchall:qi.create(),typeName:ct.ZodObject,...yt(t)});Xn.lazycreate=(e,t)=>new Xn({shape:e,unknownKeys:"strip",catchall:qi.create(),typeName:ct.ZodObject,...yt(t)});class jp extends At{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function o(l){for(const d of l)if(d.result.status==="valid")return d.result;for(const d of l)if(d.result.status==="dirty")return n.common.issues.push(...d.ctx.common.issues),d.result;const c=l.map(d=>new Ho(d.ctx.common.issues));return Oe(n,{code:Ce.invalid_union,unionErrors:c}),lt}if(n.common.async)return Promise.all(r.map(async l=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(o);{let l;const c=[];for(const f of r){const h={...n,common:{...n.common,issues:[]},parent:null},g=f._parseSync({data:n.data,path:n.path,parent:h});if(g.status==="valid")return g;g.status==="dirty"&&!l&&(l={result:g,ctx:h}),h.common.issues.length&&c.push(h.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const d=c.map(f=>new Ho(f));return Oe(n,{code:Ce.invalid_union,unionErrors:d}),lt}}get options(){return this._def.options}}jp.create=(e,t)=>new jp({options:e,typeName:ct.ZodUnion,...yt(t)});const _o=e=>e instanceof q0?_o(e.schema):e instanceof Zl?_o(e.innerType()):e instanceof Np?[e.value]:e instanceof ql?e.options:e instanceof Ap?Ut.objectValues(e.enum):e instanceof Op?_o(e._def.innerType):e instanceof $0?[void 0]:e instanceof Rp?[null]:e instanceof Io?[void 0,..._o(e.unwrap())]:e instanceof Kl?[null,..._o(e.unwrap())]:e instanceof TA||e instanceof Ip?_o(e.unwrap()):e instanceof Mp?_o(e._def.innerType):[];class _b extends At{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==$e.object)return Oe(n,{code:Ce.invalid_type,expected:$e.object,received:n.parsedType}),lt;const r=this.discriminator,o=n.data[r],l=this.optionsMap.get(o);return l?n.common.async?l._parseAsync({data:n.data,path:n.path,parent:n}):l._parseSync({data:n.data,path:n.path,parent:n}):(Oe(n,{code:Ce.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),lt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const o=new Map;for(const l of n){const c=_o(l.shape[t]);if(!c.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const d of c){if(o.has(d))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(d)}`);o.set(d,l)}}return new _b({typeName:ct.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:o,...yt(r)})}}function G0(e,t){const n=Ni(e),r=Ni(t);if(e===t)return{valid:!0,data:e};if(n===$e.object&&r===$e.object){const o=Ut.objectKeys(t),l=Ut.objectKeys(e).filter(d=>o.indexOf(d)!==-1),c={...e,...t};for(const d of l){const f=G0(e[d],t[d]);if(!f.valid)return{valid:!1};c[d]=f.data}return{valid:!0,data:c}}else if(n===$e.array&&r===$e.array){if(e.length!==t.length)return{valid:!1};const o=[];for(let l=0;l<e.length;l++){const c=e[l],d=t[l],f=G0(c,d);if(!f.valid)return{valid:!1};o.push(f.data)}return{valid:!0,data:o}}else return n===$e.date&&r===$e.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Tp extends At{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=(l,c)=>{if(Sj(l)||Sj(c))return lt;const d=G0(l.value,c.value);return d.valid?((Cj(l)||Cj(c))&&n.dirty(),{status:n.value,value:d.data}):(Oe(r,{code:Ce.invalid_intersection_types}),lt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([l,c])=>o(l,c)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Tp.create=(e,t,n)=>new Tp({left:e,right:t,typeName:ct.ZodIntersection,...yt(n)});class Gl extends At{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==$e.array)return Oe(r,{code:Ce.invalid_type,expected:$e.array,received:r.parsedType}),lt;if(r.data.length<this._def.items.length)return Oe(r,{code:Ce.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),lt;!this._def.rest&&r.data.length>this._def.items.length&&(Oe(r,{code:Ce.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const l=[...r.data].map((c,d)=>{const f=this._def.items[d]||this._def.rest;return f?f._parse(new Ys(r,c,r.path,d)):null}).filter(c=>!!c);return r.common.async?Promise.all(l).then(c=>qr.mergeArray(n,c)):qr.mergeArray(n,l)}get items(){return this._def.items}rest(t){return new Gl({...this._def,rest:t})}}Gl.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Gl({items:e,typeName:ct.ZodTuple,rest:null,...yt(t)})};class _p extends At{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==$e.object)return Oe(r,{code:Ce.invalid_type,expected:$e.object,received:r.parsedType}),lt;const o=[],l=this._def.keyType,c=this._def.valueType;for(const d in r.data)o.push({key:l._parse(new Ys(r,d,r.path,d)),value:c._parse(new Ys(r,r.data[d],r.path,d)),alwaysSet:d in r.data});return r.common.async?qr.mergeObjectAsync(n,o):qr.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof At?new _p({keyType:t,valueType:n,typeName:ct.ZodRecord,...yt(r)}):new _p({keyType:Oo.create(),valueType:t,typeName:ct.ZodRecord,...yt(n)})}}class Tj extends At{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==$e.map)return Oe(r,{code:Ce.invalid_type,expected:$e.map,received:r.parsedType}),lt;const o=this._def.keyType,l=this._def.valueType,c=[...r.data.entries()].map(([d,f],h)=>({key:o._parse(new Ys(r,d,r.path,[h,"key"])),value:l._parse(new Ys(r,f,r.path,[h,"value"]))}));if(r.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const f of c){const h=await f.key,g=await f.value;if(h.status==="aborted"||g.status==="aborted")return lt;(h.status==="dirty"||g.status==="dirty")&&n.dirty(),d.set(h.value,g.value)}return{status:n.value,value:d}})}else{const d=new Map;for(const f of c){const h=f.key,g=f.value;if(h.status==="aborted"||g.status==="aborted")return lt;(h.status==="dirty"||g.status==="dirty")&&n.dirty(),d.set(h.value,g.value)}return{status:n.value,value:d}}}}Tj.create=(e,t,n)=>new Tj({valueType:t,keyType:e,typeName:ct.ZodMap,...yt(n)});class xf extends At{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==$e.set)return Oe(r,{code:Ce.invalid_type,expected:$e.set,received:r.parsedType}),lt;const o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(Oe(r,{code:Ce.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(Oe(r,{code:Ce.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const l=this._def.valueType;function c(f){const h=new Set;for(const g of f){if(g.status==="aborted")return lt;g.status==="dirty"&&n.dirty(),h.add(g.value)}return{status:n.value,value:h}}const d=[...r.data.values()].map((f,h)=>l._parse(new Ys(r,f,r.path,h)));return r.common.async?Promise.all(d).then(f=>c(f)):c(d)}min(t,n){return new xf({...this._def,minSize:{value:t,message:Je.toString(n)}})}max(t,n){return new xf({...this._def,maxSize:{value:t,message:Je.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}xf.create=(e,t)=>new xf({valueType:e,minSize:null,maxSize:null,typeName:ct.ZodSet,...yt(t)});class q0 extends At{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}q0.create=(e,t)=>new q0({getter:e,typeName:ct.ZodLazy,...yt(t)});class Np extends At{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Oe(n,{received:n.data,code:Ce.invalid_literal,expected:this._def.value}),lt}return{status:"valid",value:t.data}}get value(){return this._def.value}}Np.create=(e,t)=>new Np({value:e,typeName:ct.ZodLiteral,...yt(t)});function jA(e,t){return new ql({values:e,typeName:ct.ZodEnum,...yt(t)})}class ql extends At{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Oe(n,{expected:Ut.joinValues(r),received:n.parsedType,code:Ce.invalid_type}),lt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return Oe(n,{received:n.data,code:Ce.invalid_enum_value,options:r}),lt}return as(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return ql.create(t,{...this._def,...n})}exclude(t,n=this._def){return ql.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}ql.create=jA;class Ap extends At{_parse(t){const n=Ut.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==$e.string&&r.parsedType!==$e.number){const o=Ut.objectValues(n);return Oe(r,{expected:Ut.joinValues(o),received:r.parsedType,code:Ce.invalid_type}),lt}if(this._cache||(this._cache=new Set(Ut.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const o=Ut.objectValues(n);return Oe(r,{received:r.data,code:Ce.invalid_enum_value,options:o}),lt}return as(t.data)}get enum(){return this._def.values}}Ap.create=(e,t)=>new Ap({values:e,typeName:ct.ZodNativeEnum,...yt(t)});class Dp extends At{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==$e.promise&&n.common.async===!1)return Oe(n,{code:Ce.invalid_type,expected:$e.promise,received:n.parsedType}),lt;const r=n.parsedType===$e.promise?n.data:Promise.resolve(n.data);return as(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Dp.create=(e,t)=>new Dp({type:e,typeName:ct.ZodPromise,...yt(t)});class Zl extends At{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ct.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=this._def.effect||null,l={addIssue:c=>{Oe(r,c),c.fatal?n.abort():n.dirty()},get path(){return r.path}};if(l.addIssue=l.addIssue.bind(l),o.type==="preprocess"){const c=o.transform(r.data,l);if(r.common.async)return Promise.resolve(c).then(async d=>{if(n.value==="aborted")return lt;const f=await this._def.schema._parseAsync({data:d,path:r.path,parent:r});return f.status==="aborted"?lt:f.status==="dirty"||n.value==="dirty"?Wd(f.value):f});{if(n.value==="aborted")return lt;const d=this._def.schema._parseSync({data:c,path:r.path,parent:r});return d.status==="aborted"?lt:d.status==="dirty"||n.value==="dirty"?Wd(d.value):d}}if(o.type==="refinement"){const c=d=>{const f=o.refinement(d,l);if(r.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(r.common.async===!1){const d=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return d.status==="aborted"?lt:(d.status==="dirty"&&n.dirty(),c(d.value),{status:n.value,value:d.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(d=>d.status==="aborted"?lt:(d.status==="dirty"&&n.dirty(),c(d.value).then(()=>({status:n.value,value:d.value}))))}if(o.type==="transform")if(r.common.async===!1){const c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!wu(c))return lt;const d=o.transform(c.value,l);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:d}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>wu(c)?Promise.resolve(o.transform(c.value,l)).then(d=>({status:n.value,value:d})):lt);Ut.assertNever(o)}}Zl.create=(e,t,n)=>new Zl({schema:e,typeName:ct.ZodEffects,effect:t,...yt(n)});Zl.createWithPreprocess=(e,t,n)=>new Zl({schema:t,effect:{type:"preprocess",transform:e},typeName:ct.ZodEffects,...yt(n)});class Io extends At{_parse(t){return this._getType(t)===$e.undefined?as(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Io.create=(e,t)=>new Io({innerType:e,typeName:ct.ZodOptional,...yt(t)});class Kl extends At{_parse(t){return this._getType(t)===$e.null?as(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Kl.create=(e,t)=>new Kl({innerType:e,typeName:ct.ZodNullable,...yt(t)});class Op extends At{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===$e.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Op.create=(e,t)=>new Op({innerType:e,typeName:ct.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...yt(t)});class Mp extends At{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Ep(o)?o.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Ho(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ho(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Mp.create=(e,t)=>new Mp({innerType:e,typeName:ct.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...yt(t)});class _j extends At{_parse(t){if(this._getType(t)!==$e.nan){const r=this._getOrReturnCtx(t);return Oe(r,{code:Ce.invalid_type,expected:$e.nan,received:r.parsedType}),lt}return{status:"valid",value:t.data}}}_j.create=e=>new _j({typeName:ct.ZodNaN,...yt(e)});class TA extends At{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Nb extends At{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?lt:l.status==="dirty"?(n.dirty(),Wd(l.value)):this._def.out._parseAsync({data:l.value,path:r.path,parent:r})})();{const o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?lt:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(t,n){return new Nb({in:t,out:n,typeName:ct.ZodPipeline})}}class Ip extends At{_parse(t){const n=this._def.innerType._parse(t),r=o=>(wu(o)&&(o.value=Object.freeze(o.value)),o);return Ep(n)?n.then(o=>r(o)):r(n)}unwrap(){return this._def.innerType}}Ip.create=(e,t)=>new Ip({innerType:e,typeName:ct.ZodReadonly,...yt(t)});var ct;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(ct||(ct={}));const $t=Oo.create,GG=Ru.create,qG=H0.create,ZG=Rp.create,KG=B0.create;qi.create;const Z0=Gs.create,Jt=Xn.create,YG=jp.create,_A=_b.create;Tp.create;Gl.create;const WG=_p.create,ga=Np.create;ql.create;const Ng=Ap.create;Dp.create;Io.create;const QG=Kl.create,Vx=lt,NA=Jt({serviceAccount:$t().min(1,"Service Account Key is required").transform((e,t)=>{try{const n=JSON.parse(e);return typeof n!="object"?(t.addIssue({code:Ce.custom,message:"Service Account must be a valid JSON object"}),Vx):n.client_email?e:(t.addIssue({code:Ce.custom,message:"Service Account must contain a client_email field"}),Vx)}catch(n){return console.error(n),t.addIssue({code:Ce.custom,message:"Service Account must be a valid JSON string"}),Vx}})}),XG=[{type:"menu-item",title:"GitHub Community",href:"https://github.com/OWOX/owox-data-marts",icon:tG,visible:{flagKey:"MENU_GITHUB_COMMUNITY_VISIBLE",expectedValue:"true"},group:"community"},{type:"menu-item",title:"Discover Upgrade Options",href:"https://www.owox.com/pricing/?utm_source=bi_owox_com&utm_medium=community_edition&utm_campaign=pricing&utm_keyword=upgrade_options&utm_content=header_dropdown",icon:bR,visible:{flagKey:"MENU_UPGRADE_OPTIONS_VISIBLE",expectedValue:"true"},group:"community"},{type:"menu-item",title:"Project settings",href:"https://platform.owox.com/ui/p/none/settings/general",icon:N_,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Credits consumption",href:"https://platform.owox.com/ui/p/none/settings/consumption",icon:bR,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Subscription",href:"https://platform.owox.com/ui/p/none/settings/subscription",icon:B7,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Members",href:"https://platform.owox.com/ui/p/none/settings/members",icon:SR,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Members",href:"/auth",icon:SR,visible:{flagKey:"IDP_PROVIDER",expectedValue:"better-auth"},group:"project"},{type:"menu-item",title:"Documentation",href:"https://docs.owox.com/?utm_source=community_edition&utm_medium=organic&utm_campaign=documentation&utm_content=header_dropdown",icon:Br,visible:{flagKey:"MENU_DOCUMENTATION_COMMUNITY_EDITION_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"Documentation",href:"https://docs.owox.com/?utm_source=app_owox_com&utm_medium=organic&utm_campaign=documentation&utm_content=header_dropdown",icon:Br,visible:{flagKey:"MENU_DOCUMENTATION_OWOX_CLOUD_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"Leave Feedback",href:"https://github.com/OWOX/owox-data-marts/discussions",icon:qk,visible:{flagKey:"MENU_FEEDBACK_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"Issues",href:"https://github.com/OWOX/owox-data-marts/issues",icon:F7,visible:{flagKey:"MENU_ISSUES_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"Slack Community",href:"https://join.slack.com/t/owox-data-marts/shared_invite/zt-3fffrsau9-UlobJVlXzRLpXmvs0ffvoQ",icon:dG,visible:{flagKey:"MENU_SLACK_COMMUNITY_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"License",href:"https://github.com/OWOX/owox-data-marts#License-1-ov-file",icon:uL,visible:{flagKey:"MENU_LICENSE_VISIBLE",expectedValue:"true"},group:"legal"},{type:"menu-item",title:"OWOX BI",href:"https://bi.owox.com/",icon:cG,visible:{flagKey:"MENU_OWOX_BI_VISIBLE",expectedValue:"true"},group:"external"}];function Nj(e,t,n){if(!n||typeof n!="object")return!1;const r=n[e];return t===void 0?!!r:r===t}function JG(){const{flags:e}=Eg(),{loadProjects:t,projects:n}=bA(),{id:r}=G4(),o=Nj("IDP_PROVIDER","owox",e);m.useEffect(()=>{o&&t()},[t,o]);const l=n.length>1;return{visibleMenuItems:m.useMemo(()=>{const f=XG.filter(v=>typeof v.visible=="boolean"?v.visible:Nj(v.visible.flagKey,v.visible.expectedValue,e)).map(v=>{if(v.group==="project"&&v.href&&r)try{const b=v.href.replace("/p/none/",`/p/${r}/`);return{...v,href:b}}catch{return v}return v}),h=new Map;f.forEach(v=>{const b=v.group||"default";h.has(b)||h.set(b,[]);const w=h.get(b);w&&w.push(v)});const g=[],y=Array.from(h.entries()).filter(([,v])=>v.length>0);return y.forEach(([,v],b)=>{g.push(...v),b<y.length-1&&g.push({type:"separator",visible:!0})}),g},[e,r]),canSwitchProject:l}}function eq(){const{visibleMenuItems:e,canSwitchProject:t}=JG();return s.jsxs(fr,{align:"start",sideOffset:8,className:"w-56",children:[e.map((n,r)=>{if(n.type==="separator")return s.jsx(ma,{},`separator-${String(r)}`);const o=n.icon;return s.jsx(pt,{asChild:!0,children:s.jsxs("a",{href:n.href,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2",children:[s.jsx(o,{className:"size-4"}),n.title]})},n.href)}),t&&s.jsx(eG,{},"switch-project")]})}var kr=(e=>(e.IDLE="idle",e.LOADING="loading",e.LOADED="loaded",e.ERROR="error",e))(kr||{});let tq={data:""},nq=e=>{if(typeof window=="object"){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||tq},rq=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,aq=/\/\*[^]*?\*\/| +/g,Aj=/\n+/g,Mi=(e,t)=>{let n="",r="",o="";for(let l in e){let c=e[l];l[0]=="@"?l[1]=="i"?n=l+" "+c+";":r+=l[1]=="f"?Mi(c,l):l+"{"+Mi(c,l[1]=="k"?"":t)+"}":typeof c=="object"?r+=Mi(c,t?t.replace(/([^,])+/g,d=>l.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,f=>/&/.test(f)?f.replace(/&/g,d):d?d+" "+f:f)):l):c!=null&&(l=/^--/.test(l)?l:l.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=Mi.p?Mi.p(l,c):l+":"+c+";")}return n+(t&&o?t+"{"+o+"}":o)+r},wo={},AA=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+AA(e[n]);return t}return e},sq=(e,t,n,r,o)=>{let l=AA(e),c=wo[l]||(wo[l]=(f=>{let h=0,g=11;for(;h<f.length;)g=101*g+f.charCodeAt(h++)>>>0;return"go"+g})(l));if(!wo[c]){let f=l!==e?e:(h=>{let g,y,v=[{}];for(;g=rq.exec(h.replace(aq,""));)g[4]?v.shift():g[3]?(y=g[3].replace(Aj," ").trim(),v.unshift(v[0][y]=v[0][y]||{})):v[0][g[1]]=g[2].replace(Aj," ").trim();return v[0]})(e);wo[c]=Mi(o?{["@keyframes "+c]:f}:f,n?"":"."+c)}let d=n&&wo.g?wo.g:null;return n&&(wo.g=wo[c]),((f,h,g,y)=>{y?h.data=h.data.replace(y,f):h.data.indexOf(f)===-1&&(h.data=g?f+h.data:h.data+f)})(wo[c],t,r,d),c},oq=(e,t,n)=>e.reduce((r,o,l)=>{let c=t[l];if(c&&c.call){let d=c(n),f=d&&d.props&&d.props.className||/^go/.test(d)&&d;c=f?"."+f:d&&typeof d=="object"?d.props?"":Mi(d,""):d===!1?"":d}return r+o+(c??"")},"");function Ag(e){let t=this||{},n=e.call?e(t.p):e;return sq(n.unshift?n.raw?oq(n,[].slice.call(arguments,1),t.p):n.reduce((r,o)=>Object.assign(r,o&&o.call?o(t.p):o),{}):n,nq(t.target),t.g,t.o,t.k)}let DA,K0,Y0;Ag.bind({g:1});let $o=Ag.bind({k:1});function iq(e,t,n,r){Mi.p=t,DA=e,K0=n,Y0=r}function tl(e,t){let n=this||{};return function(){let r=arguments;function o(l,c){let d=Object.assign({},l),f=d.className||o.className;n.p=Object.assign({theme:K0&&K0()},d),n.o=/ *go\d+/.test(f),d.className=Ag.apply(n,r)+(f?" "+f:"");let h=e;return e[0]&&(h=d.as||e,delete d.as),Y0&&h[0]&&Y0(d),DA(h,d)}return o}}var lq=e=>typeof e=="function",kp=(e,t)=>lq(e)?e(t):e,cq=(()=>{let e=0;return()=>(++e).toString()})(),OA=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),uq=20,Ab="default",MA=(e,t)=>{let{toastLimit:n}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,n)};case 1:return{...e,toasts:e.toasts.map(c=>c.id===t.toast.id?{...c,...t.toast}:c)};case 2:let{toast:r}=t;return MA(e,{type:e.toasts.find(c=>c.id===r.id)?1:0,toast:r});case 3:let{toastId:o}=t;return{...e,toasts:e.toasts.map(c=>c.id===o||o===void 0?{...c,dismissed:!0,visible:!1}:c)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(c=>c.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let l=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(c=>({...c,pauseDuration:c.pauseDuration+l}))}}},tp=[],IA={toasts:[],pausedAt:void 0,settings:{toastLimit:uq}},zs={},kA=(e,t=Ab)=>{zs[t]=MA(zs[t]||IA,e),tp.forEach(([n,r])=>{n===t&&r(zs[t])})},LA=e=>Object.keys(zs).forEach(t=>kA(e,t)),dq=e=>Object.keys(zs).find(t=>zs[t].toasts.some(n=>n.id===e)),Dg=(e=Ab)=>t=>{kA(t,e)},fq={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},hq=(e={},t=Ab)=>{let[n,r]=m.useState(zs[t]||IA),o=m.useRef(zs[t]);m.useEffect(()=>(o.current!==zs[t]&&r(zs[t]),tp.push([t,r]),()=>{let c=tp.findIndex(([d])=>d===t);c>-1&&tp.splice(c,1)}),[t]);let l=n.toasts.map(c=>{var d,f,h;return{...e,...e[c.type],...c,removeDelay:c.removeDelay||((d=e[c.type])==null?void 0:d.removeDelay)||(e==null?void 0:e.removeDelay),duration:c.duration||((f=e[c.type])==null?void 0:f.duration)||(e==null?void 0:e.duration)||fq[c.type],style:{...e.style,...(h=e[c.type])==null?void 0:h.style,...c.style}}});return{...n,toasts:l}},mq=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||cq()}),Zf=e=>(t,n)=>{let r=mq(t,e,n);return Dg(r.toasterId||dq(r.id))({type:2,toast:r}),r.id},on=(e,t)=>Zf("blank")(e,t);on.error=Zf("error");on.success=Zf("success");on.loading=Zf("loading");on.custom=Zf("custom");on.dismiss=(e,t)=>{let n={type:3,toastId:e};t?Dg(t)(n):LA(n)};on.dismissAll=e=>on.dismiss(void 0,e);on.remove=(e,t)=>{let n={type:4,toastId:e};t?Dg(t)(n):LA(n)};on.removeAll=e=>on.remove(void 0,e);on.promise=(e,t,n)=>{let r=on.loading(t.loading,{...n,...n==null?void 0:n.loading});return typeof e=="function"&&(e=e()),e.then(o=>{let l=t.success?kp(t.success,o):void 0;return l?on.success(l,{id:r,...n,...n==null?void 0:n.success}):on.dismiss(r),o}).catch(o=>{let l=t.error?kp(t.error,o):void 0;l?on.error(l,{id:r,...n,...n==null?void 0:n.error}):on.dismiss(r)}),e};var pq=1e3,gq=(e,t="default")=>{let{toasts:n,pausedAt:r}=hq(e,t),o=m.useRef(new Map).current,l=m.useCallback((y,v=pq)=>{if(o.has(y))return;let b=setTimeout(()=>{o.delete(y),c({type:4,toastId:y})},v);o.set(y,b)},[]);m.useEffect(()=>{if(r)return;let y=Date.now(),v=n.map(b=>{if(b.duration===1/0)return;let w=(b.duration||0)+b.pauseDuration-(y-b.createdAt);if(w<0){b.visible&&on.dismiss(b.id);return}return setTimeout(()=>on.dismiss(b.id,t),w)});return()=>{v.forEach(b=>b&&clearTimeout(b))}},[n,r,t]);let c=m.useCallback(Dg(t),[t]),d=m.useCallback(()=>{c({type:5,time:Date.now()})},[c]),f=m.useCallback((y,v)=>{c({type:1,toast:{id:y,height:v}})},[c]),h=m.useCallback(()=>{r&&c({type:6,time:Date.now()})},[r,c]),g=m.useCallback((y,v)=>{let{reverseOrder:b=!1,gutter:w=8,defaultPosition:S}=v||{},C=n.filter(_=>(_.position||S)===(y.position||S)&&_.height),R=C.findIndex(_=>_.id===y.id),j=C.filter((_,D)=>D<R&&_.visible).length;return C.filter(_=>_.visible).slice(...b?[j+1]:[0,j]).reduce((_,D)=>_+(D.height||0)+w,0)},[n]);return m.useEffect(()=>{n.forEach(y=>{if(y.dismissed)l(y.id,y.removeDelay);else{let v=o.get(y.id);v&&(clearTimeout(v),o.delete(y.id))}})},[n,l]),{toasts:n,handlers:{updateHeight:f,startPause:d,endPause:h,calculateOffset:g}}},yq=$o`
491
+ from {
492
+ transform: scale(0) rotate(45deg);
493
+ opacity: 0;
494
+ }
495
+ to {
496
+ transform: scale(1) rotate(45deg);
497
+ opacity: 1;
498
+ }`,vq=$o`
499
+ from {
500
+ transform: scale(0);
501
+ opacity: 0;
502
+ }
503
+ to {
504
+ transform: scale(1);
505
+ opacity: 1;
506
+ }`,xq=$o`
507
+ from {
508
+ transform: scale(0) rotate(90deg);
509
+ opacity: 0;
510
+ }
511
+ to {
512
+ transform: scale(1) rotate(90deg);
513
+ opacity: 1;
514
+ }`,bq=tl("div")`
515
+ width: 20px;
516
+ opacity: 0;
517
+ height: 20px;
518
+ border-radius: 10px;
519
+ background: ${e=>e.primary||"#ff4b4b"};
520
+ position: relative;
521
+ transform: rotate(45deg);
522
+
523
+ animation: ${yq} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
524
+ forwards;
525
+ animation-delay: 100ms;
526
+
527
+ &:after,
528
+ &:before {
529
+ content: '';
530
+ animation: ${vq} 0.15s ease-out forwards;
531
+ animation-delay: 150ms;
532
+ position: absolute;
533
+ border-radius: 3px;
534
+ opacity: 0;
535
+ background: ${e=>e.secondary||"#fff"};
536
+ bottom: 9px;
537
+ left: 4px;
538
+ height: 2px;
539
+ width: 12px;
540
+ }
541
+
542
+ &:before {
543
+ animation: ${xq} 0.15s ease-out forwards;
544
+ animation-delay: 180ms;
545
+ transform: rotate(90deg);
546
+ }
547
+ `,Sq=$o`
548
+ from {
549
+ transform: rotate(0deg);
550
+ }
551
+ to {
552
+ transform: rotate(360deg);
553
+ }
554
+ `,Cq=tl("div")`
555
+ width: 12px;
556
+ height: 12px;
557
+ box-sizing: border-box;
558
+ border: 2px solid;
559
+ border-radius: 100%;
560
+ border-color: ${e=>e.secondary||"#e0e0e0"};
561
+ border-right-color: ${e=>e.primary||"#616161"};
562
+ animation: ${Sq} 1s linear infinite;
563
+ `,Eq=$o`
564
+ from {
565
+ transform: scale(0) rotate(45deg);
566
+ opacity: 0;
567
+ }
568
+ to {
569
+ transform: scale(1) rotate(45deg);
570
+ opacity: 1;
571
+ }`,wq=$o`
572
+ 0% {
573
+ height: 0;
574
+ width: 0;
575
+ opacity: 0;
576
+ }
577
+ 40% {
578
+ height: 0;
579
+ width: 6px;
580
+ opacity: 1;
581
+ }
582
+ 100% {
583
+ opacity: 1;
584
+ height: 10px;
585
+ }`,Rq=tl("div")`
586
+ width: 20px;
587
+ opacity: 0;
588
+ height: 20px;
589
+ border-radius: 10px;
590
+ background: ${e=>e.primary||"#61d345"};
591
+ position: relative;
592
+ transform: rotate(45deg);
593
+
594
+ animation: ${Eq} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
595
+ forwards;
596
+ animation-delay: 100ms;
597
+ &:after {
598
+ content: '';
599
+ box-sizing: border-box;
600
+ animation: ${wq} 0.2s ease-out forwards;
601
+ opacity: 0;
602
+ animation-delay: 200ms;
603
+ position: absolute;
604
+ border-right: 2px solid;
605
+ border-bottom: 2px solid;
606
+ border-color: ${e=>e.secondary||"#fff"};
607
+ bottom: 6px;
608
+ left: 6px;
609
+ height: 10px;
610
+ width: 6px;
611
+ }
612
+ `,jq=tl("div")`
613
+ position: absolute;
614
+ `,Tq=tl("div")`
615
+ position: relative;
616
+ display: flex;
617
+ justify-content: center;
618
+ align-items: center;
619
+ min-width: 20px;
620
+ min-height: 20px;
621
+ `,_q=$o`
622
+ from {
623
+ transform: scale(0.6);
624
+ opacity: 0.4;
625
+ }
626
+ to {
627
+ transform: scale(1);
628
+ opacity: 1;
629
+ }`,Nq=tl("div")`
630
+ position: relative;
631
+ transform: scale(0.6);
632
+ opacity: 0.4;
633
+ min-width: 20px;
634
+ animation: ${_q} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
635
+ forwards;
636
+ `,Aq=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?m.createElement(Nq,null,t):t:n==="blank"?null:m.createElement(Tq,null,m.createElement(Cq,{...r}),n!=="loading"&&m.createElement(jq,null,n==="error"?m.createElement(bq,{...r}):m.createElement(Rq,{...r})))},Dq=e=>`
637
+ 0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
638
+ 100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
639
+ `,Oq=e=>`
640
+ 0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
641
+ 100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
642
+ `,Mq="0%{opacity:0;} 100%{opacity:1;}",Iq="0%{opacity:1;} 100%{opacity:0;}",kq=tl("div")`
643
+ display: flex;
644
+ align-items: center;
645
+ background: #fff;
646
+ color: #363636;
647
+ line-height: 1.3;
648
+ will-change: transform;
649
+ box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
650
+ max-width: 350px;
651
+ pointer-events: auto;
652
+ padding: 8px 10px;
653
+ border-radius: 8px;
654
+ `,Lq=tl("div")`
655
+ display: flex;
656
+ justify-content: center;
657
+ margin: 4px 10px;
658
+ color: inherit;
659
+ flex: 1 1 auto;
660
+ white-space: pre-line;
661
+ `,Pq=(e,t)=>{let n=e.includes("top")?1:-1,[r,o]=OA()?[Mq,Iq]:[Dq(n),Oq(n)];return{animation:t?`${$o(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${$o(o)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Uq=m.memo(({toast:e,position:t,style:n,children:r})=>{let o=e.height?Pq(e.position||t||"top-center",e.visible):{opacity:0},l=m.createElement(Aq,{toast:e}),c=m.createElement(Lq,{...e.ariaProps},kp(e.message,e));return m.createElement(kq,{className:e.className,style:{...o,...n,...e.style}},typeof r=="function"?r({icon:l,message:c}):m.createElement(m.Fragment,null,l,c))});iq(m.createElement);var Fq=({id:e,className:t,style:n,onHeightUpdate:r,children:o})=>{let l=m.useCallback(c=>{if(c){let d=()=>{let f=c.getBoundingClientRect().height;r(e,f)};d(),new MutationObserver(d).observe(c,{subtree:!0,childList:!0,characterData:!0})}},[e,r]);return m.createElement("div",{ref:l,className:t,style:n},o)},Vq=(e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:OA()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...o}},zq=Ag`
662
+ z-index: 9999;
663
+ > * {
664
+ pointer-events: auto;
665
+ }
666
+ `,Am=16,Hq=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:o,toasterId:l,containerStyle:c,containerClassName:d})=>{let{toasts:f,handlers:h}=gq(n,l);return m.createElement("div",{"data-rht-toaster":l||"",style:{position:"fixed",zIndex:9999,top:Am,left:Am,right:Am,bottom:Am,pointerEvents:"none",...c},className:d,onMouseEnter:h.startPause,onMouseLeave:h.endPause},f.map(g=>{let y=g.position||t,v=h.calculateOffset(g,{reverseOrder:e,gutter:r,defaultPosition:t}),b=Vq(y,v);return m.createElement(Fq,{id:g.id,key:g.id,onHeightUpdate:h.updateHeight,className:g.visible?zq:"",style:b},g.type==="custom"?kp(g.message,g):o?o(g):m.createElement(Uq,{toast:g,position:y}))}))},It=on;const Cn=e=>{var n;return(n=e.response)==null?void 0:n.data};function Dj(e,t="Something went wrong"){var o,l;const n=Cn(e);let r=n.message.trim()||t;(l=(o=n.errorDetails)==null?void 0:o.error)!=null&&l.trim()&&(r=`${r}. ${n.errorDetails.error}`),It.error(r)}class $q{constructor(){Ls(this,"isRefreshingToken",!1);Ls(this,"refreshTokenPromise",null);Ls(this,"accessToken",null)}getAccessToken(){return this.accessToken}setAccessToken(t){this.accessToken=t}isRefreshing(){return this.isRefreshingToken}async refreshToken(t){if(this.isRefreshingToken&&this.refreshTokenPromise)return await this.refreshTokenPromise;this.isRefreshingToken=!0,this.refreshTokenPromise=this.performRefresh(t);try{const n=await this.refreshTokenPromise;return this.setAccessToken(n),n}finally{this.isRefreshingToken=!1,this.refreshTokenPromise=null}}clear(){this.accessToken=null,this.isRefreshingToken=!1,this.refreshTokenPromise=null}async performRefresh(t){try{return await t()}catch(n){throw this.clear(),n}}}const Bq={baseURL:"/api",timeout:3e4,headers:{"Content-Type":"application/json",Accept:"application/json"}},ca=Un.create(Bq),W0=new $q;ca.interceptors.request.use(e=>{if(e.skipAuthHeader||new MB(e.headers).has("X-OWOX-Authorization"))return e;const n=Tb(),r=(n==null?void 0:n.getAccessToken())??W0.getAccessToken();return r&&(e.headers["X-OWOX-Authorization"]=`Bearer ${r}`),e},e=>Promise.reject(e instanceof Error?e:new Error("Unknown error")));ca.interceptors.response.use(e=>e,async e=>{var n,r,o;const t=e.config;if(((n=e.response)==null?void 0:n.status)===401&&!t._retry){t._retry=!0;try{const l=Tb();if(!l)throw new Error("No token provider available");const c=await W0.refreshToken(()=>l.refreshToken());return t.headers["X-OWOX-Authorization"]=`Bearer ${c}`,await ca(t)}catch{return W0.clear(),window.dispatchEvent(new CustomEvent("auth:logout",{detail:{reason:"token_refresh_failed"}})),Promise.reject(new Error("Token refresh failed"))}}return((r=e.response)==null?void 0:r.status)===403&&Dj(e,"Access forbidden - insufficient permissions"),((o=e.response)==null?void 0:o.status)===400&&Dj(e,"Bad request"),Promise.reject(e)});const PA={projects:[],callState:kr.IDLE,error:null};function Gq(e,t){switch(t.type){case"LOADING":return{...e,callState:kr.LOADING,error:null};case"SUCCESS":return{projects:t.payload,callState:kr.LOADED,error:null};case"ERROR":return{...e,callState:kr.ERROR,error:t.payload};case"RESET":return{...PA};default:return e}}function qq({children:e}){const[t,n]=m.useReducer(Gq,PA),r=m.useCallback(async()=>{n({type:"LOADING"});try{const d=Tb();if(!d){n({type:"ERROR",payload:Cn(new yj("No token provider"))});return}const f=d.getAccessToken();if(!f){n({type:"ERROR",payload:Cn(new yj("Unable to obtain access token"))});return}const h=await VB(f);n({type:"SUCCESS",payload:h})}catch(d){n({type:"ERROR",payload:Cn(d)})}},[]),o=m.useCallback(()=>{n({type:"RESET"})},[]),l=t.callState===kr.LOADING,c={...t,loadProjects:r,reset:o,isLoading:l};return s.jsx(xA.Provider,{value:c,children:e})}function Zq(){const[e,t]=m.useState(!1);return s.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:"flex flex-col gap-2",children:s.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:"flex w-full min-w-0 flex-col gap-1",children:s.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:"group/menu-item relative",children:s.jsxs(ur,{open:e,onOpenChange:t,children:[s.jsx(r$,{isOpen:e}),s.jsx(qq,{children:s.jsx(eq,{})})]})})})})}var Kq=(e,t,n,r,o,l,c,d)=>{let f=document.documentElement,h=["light","dark"];function g(b){(Array.isArray(e)?e:[e]).forEach(w=>{let S=w==="class",C=S&&l?o.map(R=>l[R]||R):o;S?(f.classList.remove(...C),f.classList.add(l&&l[b]?l[b]:b)):f.setAttribute(w,b)}),y(b)}function y(b){d&&h.includes(b)&&(f.style.colorScheme=b)}function v(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)g(r);else try{let b=localStorage.getItem(t)||n,w=c&&b==="system"?v():b;g(w)}catch{}},Oj=["light","dark"],UA="(prefers-color-scheme: dark)",Yq=typeof window>"u",Db=m.createContext(void 0),Wq={setTheme:e=>{},themes:[]},Ob=()=>{var e;return(e=m.useContext(Db))!=null?e:Wq},Qq=e=>m.useContext(Db)?m.createElement(m.Fragment,null,e.children):m.createElement(Jq,{...e}),Xq=["light","dark"],Jq=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:o="theme",themes:l=Xq,defaultTheme:c=n?"system":"light",attribute:d="data-theme",value:f,children:h,nonce:g,scriptProps:y})=>{let[v,b]=m.useState(()=>tZ(o,c)),[w,S]=m.useState(()=>v==="system"?zx():v),C=f?Object.values(f):l,R=m.useCallback(A=>{let O=A;if(!O)return;A==="system"&&n&&(O=zx());let T=f?f[O]:O,M=t?nZ(g):null,F=document.documentElement,G=Y=>{Y==="class"?(F.classList.remove(...C),T&&F.classList.add(T)):Y.startsWith("data-")&&(T?F.setAttribute(Y,T):F.removeAttribute(Y))};if(Array.isArray(d)?d.forEach(G):G(d),r){let Y=Oj.includes(c)?c:null,Z=Oj.includes(O)?O:Y;F.style.colorScheme=Z}M==null||M()},[g]),j=m.useCallback(A=>{let O=typeof A=="function"?A(v):A;b(O);try{localStorage.setItem(o,O)}catch{}},[v]),_=m.useCallback(A=>{let O=zx(A);S(O),v==="system"&&n&&!e&&R("system")},[v,e]);m.useEffect(()=>{let A=window.matchMedia(UA);return A.addListener(_),_(A),()=>A.removeListener(_)},[_]),m.useEffect(()=>{let A=O=>{O.key===o&&(O.newValue?b(O.newValue):j(c))};return window.addEventListener("storage",A),()=>window.removeEventListener("storage",A)},[j]),m.useEffect(()=>{R(e??v)},[e,v]);let D=m.useMemo(()=>({theme:v,setTheme:j,forcedTheme:e,resolvedTheme:v==="system"?w:v,themes:n?[...l,"system"]:l,systemTheme:n?w:void 0}),[v,j,e,w,n,l]);return m.createElement(Db.Provider,{value:D},m.createElement(eZ,{forcedTheme:e,storageKey:o,attribute:d,enableSystem:n,enableColorScheme:r,defaultTheme:c,value:f,themes:l,nonce:g,scriptProps:y}),h)},eZ=m.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:o,defaultTheme:l,value:c,themes:d,nonce:f,scriptProps:h})=>{let g=JSON.stringify([n,t,l,e,d,c,r,o]).slice(1,-1);return m.createElement("script",{...h,suppressHydrationWarning:!0,nonce:typeof window>"u"?f:"",dangerouslySetInnerHTML:{__html:`(${Kq.toString()})(${g})`}})}),tZ=(e,t)=>{if(Yq)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},nZ=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},zx=e=>(e||(e=window.matchMedia(UA)),e.matches?"dark":"light");const rZ=({theme:e,setTheme:t,signOut:n})=>[{type:"submenu",title:"Appearance",icon:aZ(e),submenu:{value:e,onChange:r=>{t(r)},options:[{value:"system",label:"System",icon:T_},{value:"light",label:"Light",icon:A_},{value:"dark",label:"Dark",icon:__}]}},{type:"separator"},{type:"item",title:"Sign out",icon:Vk,onClick:n,className:"text-red-600 focus:text-red-600"}];function aZ(e){switch(e){case"light":return A_;case"dark":return __;case"system":default:return T_}}function sZ({avatar:e,initials:t,displayName:n}){return s.jsx("div",{className:"text-muted-foreground flex aspect-square size-8 items-center justify-center rounded-full border bg-white text-sm font-medium dark:bg-white/10",children:e?s.jsx("img",{src:e,alt:n,className:"size-full rounded-full object-cover"}):s.jsx("span",{children:t})})}function oZ({isOpen:e,displayName:t,email:n,avatar:r,initials:o}){return s.jsx(dr,{asChild:!0,children:s.jsxs("button",{type:"button","data-slot":"dropdown-menu-trigger","data-sidebar":"menu-button","data-size":"lg","data-active":e?"true":"false","aria-haspopup":"menu","aria-expanded":e,"data-state":e?"open":"closed",className:"peer/menu-button ring-sidebar-ring active:bg-sidebar-accent active:text-sidebar-accent-foreground data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground flex h-12 w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:rounded-full group-data-[collapsible=icon]:p-0! focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",children:[s.jsx(sZ,{avatar:r,initials:o,displayName:t}),s.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight group-data-[collapsible=icon]:hidden",children:[s.jsx("span",{className:"truncate font-medium",children:t}),n&&s.jsx("span",{className:"text-muted-foreground truncate text-xs",children:n})]}),s.jsx(ka,{className:`ml-auto size-4 transition-transform duration-200 group-data-[collapsible=icon]:hidden ${e?"rotate-180":""}`})]})})}function iZ({items:e}){return s.jsx(fr,{align:"start",side:"top",sideOffset:8,className:"w-56",children:e.map((t,n)=>{if(t.type==="separator")return s.jsx(ma,{},`sep-${String(n)}`);if(t.type==="submenu"){const{submenu:r}=t;return s.jsxs(vb,{children:[s.jsxs(xb,{className:"flex items-center gap-2 px-2 py-1.5",children:[s.jsx(t.icon,{className:"size-4"}),t.title]}),s.jsx(bb,{children:r.options.map(o=>s.jsxs(pt,{className:"flex items-center gap-2 px-2 py-1.5",onClick:()=>{r.onChange(o.value)},children:[o.icon&&s.jsx(o.icon,{className:"size-4"}),o.label,r.value===o.value&&s.jsx(lr,{className:"ml-auto size-4"})]},o.value))})]},t.title)}return s.jsxs(pt,{onClick:t.onClick,className:`flex items-center gap-2 px-2 py-1.5 ${t.className??""}`,children:[s.jsx(t.icon,{className:`size-4 ${t.className??""}`}),t.title]},t.title)})})}function lZ(e,t){var n,r,o,l;if(e){const c=e.trim().split(" ").filter(Boolean);return c.length>=2?`${((n=c[0])==null?void 0:n[0])??""}${((r=c[1])==null?void 0:r[0])??""}`.toUpperCase():((l=(o=c[0])==null?void 0:o[0])==null?void 0:l.toUpperCase())||""}if(t!=null&&t.includes("@")){const c=t.split("@")[0];return c.length>1?`${c[0]}${c[1]}`.toUpperCase():c[0].toUpperCase()}return"U"}function cZ(){const{user:e,signOut:t}=el(),{setTheme:n,theme:r}=Ob(),[o,l]=m.useState(!1);if(!e)return null;const{fullName:c,email:d,avatar:f}=e,h=c??d??"Unknown User",g=lZ(c,d);return s.jsx("div",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:"group/menu-item relative",children:s.jsxs(ur,{open:o,onOpenChange:l,children:[s.jsx(oZ,{isOpen:o,displayName:h,email:d,avatar:f,initials:g}),s.jsx(iZ,{items:rZ({theme:r,setTheme:n,signOut:t})})]})})}function uZ(){const{user:e,status:t}=el();return t===Ir.LOADING||t===Ir.UNAUTHENTICATED||!(e!=null&&e.projectId)?null:e.projectId}function Yo(){const e=Jp(),t=uZ(),n=m.useCallback((l,c)=>{if(!t){e("/",{replace:!0});return}const d=Cp(t,l);e(d,c)},[e,t]),r=m.useCallback(l=>t?Cp(t,l):l,[t]);return m.useMemo(()=>({navigate:n,scope:r,projectId:t}),[n,r,t])}function dZ(){const{scope:e}=Yo();return s.jsxs(Tf,{to:e("/data-marts/create"),"data-sidebar":"menu-button","data-size":"md",className:"peer/menu-button ring-sidebar-ring bg-primary hover:bg-primary-hover text-primary-foreground hover:text-primary-foreground flex h-8 w-full items-center gap-2 overflow-hidden rounded-full p-2 text-left text-sm outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-0! focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",children:[s.jsx("div",{className:"flex aspect-square size-8 items-center justify-center",children:s.jsx(Pa,{className:"size-4 shrink-0"})}),s.jsx("div",{className:"grid flex-1 text-left text-sm leading-tight",children:s.jsx("span",{className:"truncate font-medium",children:"New Data Mart"})})]})}const fZ=[{title:"Data Marts",url:"/data-marts",icon:up},{title:"Storages",url:"/data-storages",icon:zl},{title:"Destinations",url:"/data-destinations",icon:z1}];function hZ(){const{scope:e}=Yo();return s.jsx(iz,{children:fZ.map(t=>{const n=t.icon;return s.jsx(lz,{children:s.jsx(Tf,{to:e(t.url),className:({isActive:r})=>`flex w-full items-center gap-2 rounded-md font-medium transition-colors ${r?"bg-sidebar-active text-sidebar-active-foreground font-medium shadow-sm":""}`,children:({isActive:r})=>s.jsxs(bt,{delayDuration:500,children:[s.jsx(St,{asChild:!0,children:s.jsxs(uz,{className:`${r?"hover:bg-transparent":""}`,children:[s.jsx(n,{className:"size-4 shrink-0 transition-all"}),s.jsx("span",{children:t.title}),t.badge&&s.jsx("span",{className:"bg-primary/20 text-primary ml-auto rounded-full px-2 py-0.5 text-xs",children:t.badge})]})}),s.jsx(Ct,{side:"right",children:t.title})]})})},t.title)})})}function mZ({variant:e="inset",collapsible:t="icon"}){return s.jsxs(ez,{variant:e,collapsible:t,children:[s.jsx(az,{children:s.jsx(Zq,{})}),s.jsxs(oz,{children:[s.jsx(QR,{children:s.jsx(XR,{children:s.jsx(dZ,{})})}),s.jsx(QR,{children:s.jsx(XR,{children:s.jsx(hZ,{})})})]}),s.jsx(sz,{children:s.jsx(cZ,{})}),s.jsx(nz,{})]})}function pZ({children:e,...t}){return s.jsx(Qq,{attribute:"class",defaultTheme:"system",enableSystem:!0,...t,children:e})}class ac{constructor(t){Ls(this,"baseUrl");this.baseUrl=t}async get(t,n,r){const o=this.createUrl(t);return(await ca.get(o,{...r,params:n})).data}async post(t,n,r){const o=this.createUrl(t);return(await ca.post(o,n,r)).data}async put(t,n,r){const o=this.createUrl(t);return(await ca.put(o,n,r)).data}async patch(t,n,r){const o=this.createUrl(t);return(await ca.patch(o,n,r)).data}async delete(t,n){const r=this.createUrl(t);return(await ca.delete(r,n)).data}createUrl(t){return this.baseUrl?`${this.baseUrl}${t}`:t}}class gZ{set(t,n){try{const r=typeof n=="object"?JSON.stringify(n):String(n);localStorage.setItem(t,r)}catch(r){console.error(`Error setting localStorage key "${t}":`,r)}}get(t,n){try{const r=localStorage.getItem(t);if(r===null)return null;switch(n){case"boolean":return r==="true";case"json":{const o=JSON.parse(r);return typeof o=="object"?o:null}default:return r}}catch(r){return console.error(`Error getting localStorage key "${t}":`,r),null}}remove(t){try{localStorage.removeItem(t)}catch(n){console.error(`Error removing localStorage key "${t}":`,n)}}has(t){try{return localStorage.getItem(t)!==null}catch(n){return console.error(`Error checking localStorage key "${t}":`,n),!1}}clear(){try{localStorage.clear()}catch(t){console.error("Error clearing localStorage:",t)}}}const Hs=new gZ;class yZ{getTimezones(){return Intl.supportedValuesOf("timeZone")}getTimezonesWithOffset(){const t=this.getTimezones(),n=new Date;return t.map(r=>{const o=this.getTimezoneOffset(r,n),l=this.formatOffset(o),c=this.isDaylightSavingTime(r,n),d=this.getDisplayName(r,l);return{identifier:r,displayName:d,offsetMinutes:o,offsetString:l,isDST:c}})}getTimezoneOffset(t,n=new Date){try{const r=new Intl.DateTimeFormat("en-US",{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),o=new Intl.DateTimeFormat("en-US",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),l=new Date(r.format(n)),c=new Date(o.format(n));return Math.round((c.getTime()-l.getTime())/(1e3*60))}catch(r){return console.warn(`Failed to get offset for timezone ${t}:`,r),0}}formatOffset(t){const n=t>=0?"+":"-",r=Math.abs(t),o=Math.floor(r/60),l=r%60;return`${n}${o.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}`}isDaylightSavingTime(t,n=new Date){try{const r=new Date(n.getFullYear(),0,1),o=new Date(n.getFullYear(),6,1),l=this.getTimezoneOffset(t,r),c=this.getTimezoneOffset(t,o),d=this.getTimezoneOffset(t,n),f=Math.min(l,c);return d>f}catch(r){return console.warn(`Failed to check DST for timezone ${t}:`,r),!1}}getDisplayName(t,n){return`${t} (${n})`}getBrowserTimezone(){const t=Intl.DateTimeFormat().resolvedOptions().timeZone,n=new Date,r=this.getTimezoneOffset(t,n),o=this.formatOffset(r),l=this.isDaylightSavingTime(t,n),c=this.getDisplayName(t,o);return{identifier:t,displayName:c,offsetMinutes:r,offsetString:o,isDST:l}}getBrowserOffset(){return this.getBrowserTimezone().offsetMinutes}}const vZ=new yZ;function xZ({isLoading:e,className:t}){const[n,r]=m.useState(0),[o,l]=m.useState(!1);return m.useEffect(()=>{let c,d;return e?(l(!0),r(0),c=setInterval(()=>{r(f=>f<90?f+(90-f)/10:f)},200)):(r(100),d=setTimeout(()=>{l(!1)},300)),()=>{clearInterval(c),clearTimeout(d)}},[e]),s.jsx("div",{className:ne("fixed top-0 right-0 left-0 z-50 h-1 transition-opacity duration-300",!o&&"opacity-0",t),children:s.jsx("div",{className:"bg-primary h-full transition-all duration-300 ease-out",style:{width:`${n.toString()}%`}})})}const FA=m.createContext({isLoading:!1});function bZ({children:e}){const[t,n]=m.useState(0),r=t>0;return m.useEffect(()=>{const o=ca.interceptors.request.use(c=>(c.skipLoadingIndicator||n(d=>d+1),c),c=>(c.config.skipLoadingIndicator||n(d=>Math.max(0,d-1)),Promise.reject(c))),l=ca.interceptors.response.use(c=>(c.config.skipLoadingIndicator||n(d=>Math.max(0,d-1)),c),c=>(c.config.skipLoadingIndicator||n(d=>Math.max(0,d-1)),Promise.reject(c)));return()=>{ca.interceptors.request.eject(o),ca.interceptors.response.eject(l)}},[]),s.jsx(FA.Provider,{value:{isLoading:r},children:e})}function SZ(){return m.useContext(FA)}function CZ(){return s.jsx(Hq,{position:"top-center",toastOptions:{duration:3e3,style:{borderRadius:"32px",boxShadow:"none",padding:"0.4rem 1rem",maxWidth:"800px",fontSize:"0.875rem",borderBottomWidth:"1px",borderBottomStyle:"solid"},success:{style:{background:"#ECFDF5",color:"#166534",borderBottomColor:"#D6DFE6"}},error:{style:{background:"#FEE2E2",color:"#991B1B",borderBottomColor:"#EAD1D1"},duration:6e3},loading:{style:{background:"#E8EDFB",color:"#1D4ED8",borderBottomColor:"#CAD5F6",borderBottomWidth:"1px",borderBottomStyle:"solid"}}}})}function EZ({children:e}){const{isLoading:t}=vA(),n=YB(),r=m_(),o=Qs();return m.useEffect(()=>{if(t)return;const l=r.projectId,c=n==null?void 0:n.projectId;if(l&&!o.pathname.startsWith("/auth")&&n&&c&&c!==l){const d=new URLSearchParams({projectId:l}).toString();window.location.href=`/auth/sign-in?${d}`}},[t,n,r.projectId,o.pathname]),s.jsx(s.Fragment,{children:e})}const Mj="sidebar_state";function wZ(){const{state:e,isMobile:t}=Pf(),r=t||e==="collapsed",{isLoading:o}=SZ();return s.jsxs(s.Fragment,{children:[s.jsx(CZ,{}),s.jsx(xZ,{isLoading:o}),s.jsxs(WB,{redirectTo:"/auth/sign-in",children:[s.jsx(mZ,{variant:"inset",collapsible:"icon"}),s.jsxs(rz,{children:[r&&s.jsx(tz,{}),s.jsx(EZ,{children:s.jsx(g_,{})})]})]})]})}function RZ(){const[e,t]=m.useState(()=>Hs.get(Mj,"boolean")??!0),n=r=>{t(r),Hs.set(Mj,r)};return s.jsx(pZ,{children:s.jsx(bZ,{children:s.jsx(JV,{open:e,onOpenChange:n,children:s.jsx(wZ,{})})})})}function jZ(){return s.jsxs("div",{className:"app-container",children:[s.jsx("h1",{children:"About OWOX"}),s.jsx("p",{children:"OWOX Data Marts — Free, Open-Source Connectors for Data Analysts"})]})}function Ij(){return s.jsxs("div",{className:"dm-empty-state-404page",children:[s.jsxs("div",{className:"dm-empty-state-404page-foreground",children:[s.jsx(xL,{className:"dm-empty-state-ico",strokeWidth:1}),s.jsx("h1",{className:"dm-empty-state-title",children:"Lost in the 404th Data Realm"}),s.jsxs("p",{className:"dm-empty-state-subtitle",children:["In this dimension, ",s.jsx("code",{children:"1+1=3"}),", percentages exceed 100%, and dashboards predict"," ",s.jsx("i",{children:"yesterday"}),".",s.jsx("br",{}),"Escape while you can!"]}),s.jsx(Se,{variant:"default",asChild:!0,children:s.jsxs(ha,{to:"/",className:"flex items-center gap-1","aria-label":"Guide Me Home",children:["Guide Me Home",s.jsx(La,{className:"h-4 w-4"})]})})]}),s.jsx("div",{className:"dm-empty-state-404page-background"})]})}const TZ={items:[],loading:!1,error:null};function _Z(e,t){switch(t.type){case"SET_ITEMS":return{...e,items:t.payload,loading:!1,error:null};case"SET_LOADING":return{...e,loading:!0,error:null};case"SET_ERROR":return{...e,loading:!1,error:t.payload};default:return e}}const VA=m.createContext(void 0);function NZ({children:e}){const[t,n]=m.useReducer(_Z,TZ);return s.jsx(VA.Provider,{value:{state:t,dispatch:n},children:e})}function AZ(){const e=m.useContext(VA);if(e===void 0)throw new Error("useDataMartListContext must be used within a DataMartListProvider");return e}class DZ extends ac{constructor(){super("/data-marts")}async getDataMarts(){return this.get("/")}async getDataMartById(t){return this.get(`/${t}`)}async createDataMart(t){return this.post("",t)}async updateDataMart(t,n){return this.patch(`/${t}`,n)}async deleteDataMart(t){return this.delete(`/${t}`)}async updateDataMartDescription(t,n){return this.put(`/${t}/description`,{description:n})}async updateDataMartTitle(t,n){return this.put(`/${t}/title`,{title:n})}async updateDataMartDefinition(t,n){return this.put(`/${t}/definition`,n,{timeout:18e4})}async publishDataMart(t){return this.put(`/${t}/publish`,void 0,{timeout:18e4})}async runDataMart(t,n){return this.post(`/${t}/manual-run`,{payload:n})}async cancelDataMartRun(t,n){await this.post(`/${t}/runs/${n}/cancel`)}async actualizeDataMartSchema(t){return this.post(`/${t}/actualize-schema`,void 0,{timeout:18e4})}async updateDataMartSchema(t,n){return this.put(`/${t}/schema`,n,{timeout:18e4})}async createSqlDryRunTrigger(t,n){return this.post(`/${t}/sql-dry-run-triggers`,{sql:n},{skipLoadingIndicator:!0})}async getSqlDryRunTriggerStatus(t,n){return(await this.get(`/${t}/sql-dry-run-triggers/${n}/status`,void 0,{skipLoadingIndicator:!0})).status}async getSqlDryRunTriggerResponse(t,n){return this.get(`/${t}/sql-dry-run-triggers/${n}`,void 0,{skipLoadingIndicator:!0})}async abortSqlDryRunTrigger(t,n){await this.delete(`/${t}/sql-dry-run-triggers/${n}`,{skipLoadingIndicator:!0})}async createSchemaActualizeTrigger(t){return this.post(`/${t}/schema-actualize-triggers`,void 0,{skipLoadingIndicator:!0})}async getSchemaActualizeTriggerStatus(t,n){return(await this.get(`/${t}/schema-actualize-triggers/${n}/status`,void 0,{skipLoadingIndicator:!0})).status}async getSchemaActualizeTriggerResponse(t,n){return this.get(`/${t}/schema-actualize-triggers/${n}`,void 0,{skipLoadingIndicator:!0})}async abortSchemaActualizeTrigger(t,n){await this.delete(`/${t}/schema-actualize-triggers/${n}`,{skipLoadingIndicator:!0})}async getDataMartRuns(t,n=5,r=0,o){return await this.get(`/${t}/runs`,{limit:n,offset:r},o)}async getDataMartsByConnectorName(t){return this.get(`/by-connector/${t}`)}}const sn=new DZ;var Rr=(e=>(e.DRAFT="DRAFT",e.PUBLISHED="PUBLISHED",e))(Rr||{}),Fe=(e=>(e.SQL="SQL",e.TABLE="TABLE",e.VIEW="VIEW",e.TABLE_PATTERN="TABLE_PATTERN",e.CONNECTOR="CONNECTOR",e))(Fe||{}),np=(e=>(e.ALREADY_PUBLISHED="ALREADY_PUBLISHED",e.INVALID_STORAGE="INVALID_STORAGE",e.MISSING_DEFINITION="MISSING_DEFINITION",e))(np||{});const OZ={ALREADY_PUBLISHED:"Data mart is already published",INVALID_STORAGE:"Data mart must have a valid storage",MISSING_DEFINITION:"Data Mart must have an input source configured"};var zA=(e=>(e.SCHEDULED="scheduled",e.MANUAL="manual",e))(zA||{}),zr=(e=>(e.CONNECTOR="CONNECTOR",e.GOOGLE_SHEETS_EXPORT="GOOGLE_SHEETS_EXPORT",e.LOOKER_STUDIO="LOOKER_STUDIO",e.EMAIL="EMAIL",e.SLACK="SLACK",e.MS_TEAMS="MS_TEAMS",e.GOOGLE_CHAT="GOOGLE_CHAT",e))(zr||{}),ir=(e=>(e.RUNNING="RUNNING",e.SUCCESS="SUCCESS",e.FAILED="FAILED",e.CANCELLED="CANCELLED",e.INTERRUPTED="INTERRUPTED",e.PENDING="PENDING",e))(ir||{});const HA={statuses:{[Rr.DRAFT]:{code:Rr.DRAFT,displayName:"Draft",description:"Data mart is in draft mode and not yet published"},[Rr.PUBLISHED]:{code:Rr.PUBLISHED,displayName:"Published",description:"Data mart is published and available for use"}},getInfo(e){return this.statuses[e]},getAllStatuses(){return Object.values(this.statuses)}},$A=e=>e?/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+$/.test(e):!1,BA=e=>e?/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_\-*]+$/.test(e):!1,MZ=e=>e?$A(e)?"":"Invalid format. Expected: project.dataset.object":"Fully qualified name is required",IZ=e=>e?BA(e)?"":"Invalid format. Expected: project.dataset.table_* (with wildcards)":"Table pattern is required",GA=e=>{if(!e)return!1;const t=/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+$/,n=/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+$/;return t.test(e)||n.test(e)},qA=e=>{if(!e)return!1;const t=/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_\-*]+$/,n=/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_\-*]+$/;return t.test(e)||n.test(e)},kZ=e=>e?GA(e)?"":"Invalid format. Expected: database.object or catalog.database.object":"Fully qualified name is required",LZ=e=>e?qA(e)?"":"Invalid format. Expected: database.table_* or catalog.database.table_* (with wildcards)":"Table pattern is required",PZ=[{value:"US",label:"US (multiple regions)",group:"North America"},{value:"northamerica-northeast1",label:"northamerica-northeast1 (Montréal)",group:"North America"},{value:"northamerica-northeast2",label:"northamerica-northeast2 (Toronto)",group:"North America"},{value:"us-central1",label:"us-central1 (Iowa)",group:"North America"},{value:"us-east1",label:"us-east1 (South Carolina)",group:"North America"},{value:"us-east4",label:"us-east4 (Northern Virginia)",group:"North America"},{value:"us-east5",label:"us-east5 (Columbus)",group:"North America"},{value:"us-west1",label:"us-west1 (Oregon)",group:"North America"},{value:"us-west2",label:"us-west2 (Los Angeles)",group:"North America"},{value:"us-west3",label:"us-west3 (Salt Lake City)",group:"North America"},{value:"us-west4",label:"us-west4 (Las Vegas)",group:"North America"},{value:"EU",label:"EU (multiple regions)",group:"Europe"},{value:"europe-central2",label:"europe-central2 (Warsaw)",group:"Europe"},{value:"europe-north1",label:"europe-north1 (Finland)",group:"Europe"},{value:"europe-southwest1",label:"europe-southwest1 (Madrid)",group:"Europe"},{value:"europe-west1",label:"europe-west1 (Belgium)",group:"Europe"},{value:"europe-west2",label:"europe-west2 (London)",group:"Europe"},{value:"europe-west3",label:"europe-west3 (Frankfurt)",group:"Europe"},{value:"europe-west4",label:"europe-west4 (Netherlands)",group:"Europe"},{value:"europe-west6",label:"europe-west6 (Zurich)",group:"Europe"},{value:"europe-west8",label:"europe-west8 (Milan)",group:"Europe"},{value:"europe-west9",label:"europe-west9 (Paris)",group:"Europe"},{value:"europe-west12",label:"europe-west12 (Turin)",group:"Europe"},{value:"asia-east1",label:"asia-east1 (Taiwan)",group:"Asia Pacific"},{value:"asia-east2",label:"asia-east2 (Hong Kong)",group:"Asia Pacific"},{value:"asia-northeast1",label:"asia-northeast1 (Tokyo)",group:"Asia Pacific"},{value:"asia-northeast2",label:"asia-northeast2 (Osaka)",group:"Asia Pacific"},{value:"asia-northeast3",label:"asia-northeast3 (Seoul)",group:"Asia Pacific"},{value:"asia-south1",label:"asia-south1 (Mumbai)",group:"Asia Pacific"},{value:"asia-south2",label:"asia-south2 (Delhi)",group:"Asia Pacific"},{value:"asia-southeast1",label:"asia-southeast1 (Singapore)",group:"Asia Pacific"},{value:"asia-southeast2",label:"asia-southeast2 (Jakarta)",group:"Asia Pacific"},{value:"australia-southeast1",label:"australia-southeast1 (Sydney)",group:"Asia Pacific"},{value:"australia-southeast2",label:"australia-southeast2 (Melbourne)",group:"Asia Pacific"},{value:"southamerica-east1",label:"southamerica-east1 (São Paulo)",group:"Other"},{value:"southamerica-west1",label:"southamerica-west1 (Santiago)",group:"Other"},{value:"me-central1",label:"me-central1 (Doha)",group:"Other"},{value:"me-central2",label:"me-central2 (Dammam)",group:"Other"},{value:"me-west1",label:"me-west1 (Tel Aviv)",group:"Other"},{value:"africa-south1",label:"africa-south1 (Johannesburg)",group:"Other"}];function UZ(e){return"projectId"in e}function FZ(e){return"outputBucket"in e}var ke=(e=>(e.GOOGLE_BIGQUERY="GOOGLE_BIGQUERY",e.AWS_ATHENA="AWS_ATHENA",e.SNOWFLAKE="SNOWFLAKE",e.DATABRICKS="DATABRICKS",e.AWS_REDSHIFT="AWS_REDSHIFT",e.AZURE_SYNAPSE="AZURE_SYNAPSE",e))(ke||{}),Do=(e=>(e.ACTIVE="active",e.COMING_SOON="coming_soon",e))(Do||{});const VZ=({label:e,value:t,truncate:n=!1})=>{const r=typeof t=="string"?t.trim():t,o=r==="";return s.jsxs("div",{className:"grid grid-cols-2 gap-1",children:[s.jsxs("span",{className:"text-muted-foreground text-sm",children:[e,":"]}),n&&r&&!o?s.jsx("span",{className:"truncate text-sm",title:r,children:r.length>30?r.substring(0,30)+"...":r}):s.jsx("span",{className:"text-sm",children:o||r===void 0?s.jsx("span",{className:"text-muted-foreground",children:"—"}):r})]})},zZ=({type:e,config:t})=>{const n={[ke.GOOGLE_BIGQUERY]:[{label:"Project ID",key:"projectId"},{label:"Location",key:"location"}],[ke.AWS_ATHENA]:[{label:"Region",key:"region"},{label:"Output Bucket",key:"outputBucket"}],[ke.SNOWFLAKE]:[],[ke.DATABRICKS]:[],[ke.AWS_REDSHIFT]:[],[ke.AZURE_SYNAPSE]:[]},r=t&&(e===ke.GOOGLE_BIGQUERY&&UZ(t)||e===ke.AWS_ATHENA&&FZ(t));return s.jsx("div",{className:"grid gap-2",children:n[e].map(({label:o,key:l})=>{let c;return r&&(c=(e===ke.GOOGLE_BIGQUERY,t[l])),s.jsx(VZ,{label:o,value:c},l)})})},HZ=({type:e,config:t})=>s.jsx("div",{className:"space-y-4",children:s.jsxs("div",{className:"space-y-1",children:[s.jsx("h4",{className:"text-sm font-medium",children:"Configuration"}),s.jsx(zZ,{type:e,config:t})]})}),$Z=_f("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function gr({className:e,variant:t,asChild:n=!1,...r}){const o=n?tg:"span";return s.jsx(o,{"data-slot":"badge",className:ne($Z({variant:t}),e),...r})}function ZA(e){return e.type===ke.GOOGLE_BIGQUERY}function KA(e){return e.type===ke.AWS_ATHENA}const nl={types:{[ke.GOOGLE_BIGQUERY]:{type:ke.GOOGLE_BIGQUERY,displayName:"Google BigQuery",icon:SA,status:Do.ACTIVE},[ke.AWS_ATHENA]:{type:ke.AWS_ATHENA,displayName:"AWS Athena",icon:CA,status:Do.ACTIVE},[ke.SNOWFLAKE]:{type:ke.SNOWFLAKE,displayName:"Snowflake",icon:sG,status:Do.COMING_SOON},[ke.DATABRICKS]:{type:ke.DATABRICKS,displayName:"Databricks",icon:oG,status:Do.COMING_SOON},[ke.AWS_REDSHIFT]:{type:ke.AWS_REDSHIFT,displayName:"AWS Redshift",icon:iG,status:Do.COMING_SOON},[ke.AZURE_SYNAPSE]:{type:ke.AZURE_SYNAPSE,displayName:"Azure Synapse",icon:lG,status:Do.COMING_SOON}},getInfo(e){return this.types[e]},getAllTypes(){return Object.values(this.types)}};function BZ({dataStorage:e,isLoading:t=!1}){if(t)return s.jsx("div",{className:"space-y-4",children:s.jsx("div",{className:"grid gap-4",children:Array(4).fill(0).map((c,d)=>s.jsxs("div",{className:"space-y-1",children:[s.jsx(hs,{className:"h-5 w-24"}),s.jsx(hs,{className:"h-6 w-40"})]},d))})});if(!e)return s.jsx("div",{children:"No storage information available."});const{type:n,config:r,createdAt:o,modifiedAt:l}=e;return s.jsx("div",{className:"space-y-2",children:s.jsxs("div",{className:"grid gap-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{children:e.title}),s.jsx(gr,{variant:"secondary",className:"flex h-7 items-center gap-2",children:(()=>{const{displayName:c,icon:d}=nl.getInfo(n);return s.jsxs(s.Fragment,{children:[s.jsx(d,{}),c]})})()})]}),s.jsx("div",{className:"bg-muted/10 rounded-md border p-4",children:s.jsx(HZ,{type:n,config:r})}),s.jsxs("div",{className:"text-muted-foreground flex gap-6 text-xs",children:[s.jsxs("div",{children:[s.jsx("span",{className:"font-medium",children:"Created:"})," ",new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(o))]}),s.jsxs("div",{children:[s.jsx("span",{className:"font-medium",children:"Modified:"})," ",new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(l))]})]})]})})}function GZ(e){const t=e.split(".");return t.length!==2?(console.error("Invalid fully qualified name format:",e),null):{dataset:t[0],table:t[1]}}function qZ(e,t,n){const r=encodeURIComponent(e),o=encodeURIComponent(t),l=encodeURIComponent(n);return`https://console.cloud.google.com/bigquery?project=${r}&ws=!1m5!1m4!4m3!1s${r}!2s${o}!3s${l}`}function ZZ(e){return`https://console.aws.amazon.com/athena/home?region=${encodeURIComponent(e)}#/query-editor`}function KZ(e,t){const n=GZ(t);if(!n)return null;const{dataset:r,table:o}=n;return ZA(e)?qZ(e.config.projectId,r,o):KA(e)?ZZ(e.config.region):null}function YZ(e,t){const n=KZ(e,t);return n?(window.open(n,"_blank","noopener,noreferrer"),!0):!1}function WZ(e){return ZA(e)?"Open table in Google BigQuery":KA(e)?"Open region in AWS Athena":"Open data in storage"}function YA(e){switch(e.type){case ke.GOOGLE_BIGQUERY:return!!(e.config.projectId&&e.config.location);case ke.AWS_ATHENA:return!!(e.config.region&&e.config.outputBucket);default:return!1}}const QZ=Jt({accessKeyId:$t().min(1,"Access Key ID is required"),secretAccessKey:$t().min(1,"Secret Access Key is required")}),XZ=Jt({projectId:$t().min(1,"Project ID is required"),location:$t().min(1,"Location is required")}),JZ=Jt({region:$t().min(1,"Region is required"),outputBucket:$t().min(1,"Output Bucket is required")}),WA=Jt({title:$t().min(1,"Title is required").max(255,"Title must be 255 characters or less")}),eK=WA.extend({type:ga(ke.GOOGLE_BIGQUERY),credentials:NA,config:XZ}),tK=WA.extend({type:ga(ke.AWS_ATHENA),credentials:QZ,config:JZ}),nK=_A("type",[eK,tK]),rK=(e,t)=>{if(!e)return!1;switch(t){case ke.GOOGLE_BIGQUERY:return $A(e);case ke.AWS_ATHENA:return GA(e);default:return!1}},aK=(e,t)=>{if(!e)return!1;switch(t){case ke.GOOGLE_BIGQUERY:return BA(e);case ke.AWS_ATHENA:return qA(e);default:return!1}},sK=(e,t)=>{if(!e)return"Fully qualified name is required";switch(t){case ke.GOOGLE_BIGQUERY:return MZ(e);case ke.AWS_ATHENA:return kZ(e);default:return"Unsupported storage type"}},oK=(e,t)=>{if(!e)return"Table pattern is required";switch(t){case ke.GOOGLE_BIGQUERY:return IZ(e);case ke.AWS_ATHENA:return LZ(e);default:return"Unsupported storage type"}},QA=e=>{switch(e){case ke.GOOGLE_BIGQUERY:return"project.dataset.table";case ke.AWS_ATHENA:return"database.table or catalog.database.table";default:return""}},iK=e=>{switch(e){case ke.GOOGLE_BIGQUERY:return"project.dataset.table_*";case ke.AWS_ATHENA:return"database.table_* or catalog.database.table_*";default:return""}},XA=e=>{switch(e){case ke.GOOGLE_BIGQUERY:return"Enter the fully qualified name of the table (e.g., project.dataset.table)";case ke.AWS_ATHENA:return"Enter the fully qualified name of the table (e.g., database.table or catalog.database.table)";default:return""}},lK=e=>{switch(e){case ke.GOOGLE_BIGQUERY:return'Enter a pattern to match multiple tables (e.g., project.dataset.table_* will match all tables starting with "table_")';case ke.AWS_ATHENA:return'Enter a pattern to match multiple tables (e.g., database.table_* will match all tables starting with "table_")';default:return""}};var In=(e=>(e.SUCCESS="success",e.ERROR="error",e.WARNING="warning",e.INFO="info",e.NEUTRAL="neutral",e))(In||{});const cK={solid:"px-2.5 py-0.5 rounded-full",subtle:"px-2.5 py-0.5 rounded-full",outline:"px-2.5 py-0.5 rounded-full border",ghost:""},uK=e=>cK[e],dK={[In.SUCCESS]:{icon:ng,colors:{solid:"bg-green-500 text-white",subtle:"bg-green-50 text-green-700 dark:bg-green-950 dark:text-green-400",outline:"border-green-500 text-green-700 dark:text-green-400",ghost:"text-green-500 dark:text-green-400"}},[In.ERROR]:{icon:Xk,colors:{solid:"bg-red-500 text-white",subtle:"bg-red-50 text-red-700 dark:bg-red-950 dark:text-red-400",outline:"border-red-500 text-red-700 dark:text-red-400",ghost:"text-red-500 dark:text-red-400"}},[In.WARNING]:{icon:ag,colors:{solid:"bg-yellow-500 text-white",subtle:"bg-yellow-50 text-yellow-700 dark:bg-yellow-950 dark:text-yellow-400",outline:"border-yellow-500 text-yellow-700 dark:text-yellow-400",ghost:"text-yellow-500 dark:text-yellow-400"}},[In.INFO]:{icon:Br,colors:{solid:"bg-blue-500 text-white",subtle:"bg-blue-50 text-blue-700 dark:bg-blue-950 dark:text-blue-400",outline:"border-blue-500 text-blue-700 dark:text-blue-400",ghost:"text-blue-500 dark:text-blue-400"}},[In.NEUTRAL]:{icon:Br,colors:{solid:"bg-gray-500 text-white",subtle:"bg-gray-50 text-gray-700 dark:bg-gray-950 dark:text-gray-400",outline:"border-gray-500 text-gray-700 dark:text-gray-400",ghost:"text-muted-foreground"}}};function Kf({type:e=In.NEUTRAL,variant:t="ghost",showIcon:n=!0,children:r,className:o}){const{icon:l,colors:c}=dK[e],d=f=>{const h="inline-flex items-center gap-1 text-sm",g=uK(f),y=c[f];return ne(h,g,y,o)};return s.jsxs("span",{className:d(t),children:[n&&s.jsx(l,{className:"h-4 w-4","data-testid":"icon"}),r]})}const JA=/^https:\/\/(docs|spreadsheets)\.google\.com\/spreadsheets\/d\/([a-zA-Z0-9-_]+)/,fK=/[#&]gid=([0-9]+)/;function e3(e){return JA.test(e)}function hK(e){const t=JA.exec(e);return t?t[2]:""}function mK(e){const t=fK.exec(e);return t?t[1]:"0"}function pK(e){return{spreadsheetId:hK(e),sheetId:parseInt(mK(e),10)}}function Mb(e,t){return`https://docs.google.com/spreadsheets/d/${e}/edit#gid=${String(t)}`}function gK(e,t,n){try{const r=JSON.parse(e);return t in r?r[t]:n}catch(r){return console.error(`Error parsing service account JSON: ${String(r)}`),n}}function Hx(e){return gK(e,"client_email")}const t3=m.createContext(void 0);var rt=(e=>(e.FETCH_REPORTS_START="FETCH_REPORTS_START",e.FETCH_REPORTS_SUCCESS="FETCH_REPORTS_SUCCESS",e.FETCH_REPORTS_ERROR="FETCH_REPORTS_ERROR",e.FETCH_DESTINATIONS_START="FETCH_DESTINATIONS_START",e.FETCH_DESTINATIONS_SUCCESS="FETCH_DESTINATIONS_SUCCESS",e.FETCH_DESTINATIONS_ERROR="FETCH_DESTINATIONS_ERROR",e.FETCH_REPORT_START="FETCH_REPORT_START",e.FETCH_REPORT_SUCCESS="FETCH_REPORT_SUCCESS",e.FETCH_REPORT_ERROR="FETCH_REPORT_ERROR",e.CLEAR_CURRENT_REPORT="CLEAR_CURRENT_REPORT",e.CREATE_REPORT_START="CREATE_REPORT_START",e.CREATE_REPORT_SUCCESS="CREATE_REPORT_SUCCESS",e.CREATE_REPORT_ERROR="CREATE_REPORT_ERROR",e.UPDATE_REPORT_START="UPDATE_REPORT_START",e.UPDATE_REPORT_SUCCESS="UPDATE_REPORT_SUCCESS",e.UPDATE_REPORT_ERROR="UPDATE_REPORT_ERROR",e.DELETE_REPORT_START="DELETE_REPORT_START",e.DELETE_REPORT_SUCCESS="DELETE_REPORT_SUCCESS",e.DELETE_REPORT_ERROR="DELETE_REPORT_ERROR",e.START_POLLING_REPORT="START_POLLING_REPORT",e.STOP_POLLING_REPORT="STOP_POLLING_REPORT",e.UPDATE_POLLED_REPORT="UPDATE_POLLED_REPORT",e.STOP_ALL_POLLING="STOP_ALL_POLLING",e.CLEAR_ERROR="CLEAR_ERROR",e))(rt||{}),yr=(e=>(e.GOOGLE_SHEETS_CONFIG="google-sheets-config",e.LOOKER_STUDIO_CONFIG="looker-studio-config",e.EMAIL_CONFIG="email-config",e))(yr||{}),fn=(e=>(e.SUCCESS="SUCCESS",e.RUNNING="RUNNING",e.ERROR="ERROR",e.CANCELLED="CANCELLED",e))(fn||{}),ln=(e=>(e.EDIT="edit",e.CREATE="create",e))(ln||{});const yK={reports:[],destinations:[],currentReport:null,loading:!1,error:null,polledReportIds:[]};function vK(e,t){switch(t.type){case rt.FETCH_REPORTS_START:case rt.FETCH_REPORT_START:case rt.CREATE_REPORT_START:case rt.UPDATE_REPORT_START:case rt.DELETE_REPORT_START:return{...e,loading:!0,error:null};case rt.FETCH_REPORTS_SUCCESS:return{...e,reports:t.payload,loading:!1,error:null};case rt.FETCH_DESTINATIONS_SUCCESS:return{...e,destinations:t.payload,loading:!1,error:null};case rt.FETCH_REPORT_SUCCESS:return{...e,currentReport:t.payload,loading:!1,error:null};case rt.CREATE_REPORT_SUCCESS:return{...e,reports:[...e.reports,t.payload],loading:!1,error:null};case rt.UPDATE_REPORT_SUCCESS:return{...e,currentReport:t.payload,reports:e.reports.map(n=>n.id===t.payload.id?t.payload:n),loading:!1,error:null};case rt.DELETE_REPORT_SUCCESS:return{...e,reports:e.reports.filter(n=>n.id!==t.payload),loading:!1,error:null};case rt.FETCH_REPORTS_ERROR:case rt.FETCH_REPORT_ERROR:case rt.FETCH_DESTINATIONS_ERROR:case rt.CREATE_REPORT_ERROR:case rt.UPDATE_REPORT_ERROR:case rt.DELETE_REPORT_ERROR:return{...e,loading:!1,error:t.payload};case rt.CLEAR_CURRENT_REPORT:return{...e,currentReport:null};case rt.CLEAR_ERROR:return{...e,error:null};case rt.START_POLLING_REPORT:return{...e,polledReportIds:[...e.polledReportIds,t.payload]};case rt.STOP_POLLING_REPORT:return{...e,polledReportIds:e.polledReportIds.filter(n=>n!==t.payload)};case rt.STOP_ALL_POLLING:return{...e,polledReportIds:[]};case rt.UPDATE_POLLED_REPORT:{const n=e.reports.find(r=>r.id===t.payload.id);return n&&t.payload.lastRunStatus!==fn.RUNNING||(n==null?void 0:n.lastRunStatus)!==fn.RUNNING?{...e,reports:e.reports.map(r=>r.id===t.payload.id?{...r,lastRunStatus:t.payload.lastRunStatus}:r),polledReportIds:e.polledReportIds.filter(r=>r!==t.payload.id)}:e}default:return e}}function n3({children:e}){const[t,n]=m.useReducer(vK,yK);return s.jsx(t3.Provider,{value:{state:t,dispatch:n},children:e})}function xK(){const e=m.useContext(t3);if(e===void 0)throw new Error("useReportContext must be used within a ReportProvider");return e}class bK extends ac{constructor(){super("/reports")}async createReport(t){return this.post("",t)}async getReportById(t){return this.get(`/${t}`)}async getReportsByDataMartId(t,n){return this.get(`/data-mart/${t}`,void 0,n)}async getReportsByProject(){return this.get("/")}async updateReport(t,n){return this.put(`/${t}`,n)}async deleteReport(t){return this.delete(`/${t}`)}async runReport(t){return this.post(`/${t}/run`)}}const No=new bK,SK={initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3};class CK{constructor(){Ls(this,"pollingTimers",new Map);Ls(this,"pollCounters",new Map);Ls(this,"config",SK)}setConfig(t){this.config={...this.config,...t}}startPolling(t,n){this.stopPolling(t),this.pollCounters.set(t,0);const r=async()=>{try{const o=this.pollCounters.get(t)??0;this.pollCounters.set(t,o+1);const l=await No.getReportById(t);if(n(l),l.lastRunStatus!==fn.RUNNING){this.stopPolling(t);return}const d=o<this.config.initialPollCount?this.config.initialPollingIntervalMs:this.config.regularPollingIntervalMs,f=setTimeout(()=>{r()},d);this.pollingTimers.set(t,f)}catch(o){console.error(`Error polling report status for ${t}:`,o),this.stopPolling(t)}};return r(),()=>{this.stopPolling(t)}}stopPolling(t){const n=this.pollingTimers.get(t);n&&(clearTimeout(n),this.pollingTimers.delete(t),this.pollCounters.delete(t))}stopAllPolling(){for(const t of this.pollingTimers.keys())this.stopPolling(t)}isPolling(t){return this.pollingTimers.has(t)}}const Dm=new CK;var je=(e=>(e.GOOGLE_SHEETS="GOOGLE_SHEETS",e.LOOKER_STUDIO="LOOKER_STUDIO",e.ODATA="OData",e.EMAIL="EMAIL",e.SLACK="SLACK",e.MS_TEAMS="MS_TEAMS",e.GOOGLE_CHAT="GOOGLE_CHAT",e))(je||{}),us=(e=>(e.ACTIVE="Active",e.COMING_SOON="Coming soon",e.CLOUD_ONLY="Cloud only",e))(us||{}),qs=(e=>(e.GOOGLE_SHEETS_CREDENTIALS="google-sheets-credentials",e.LOOKER_STUDIO_CREDENTIALS="looker-studio-credentials",e.EMAIL_CREDENTIALS="email-credentials",e))(qs||{});class EK extends ac{constructor(){super("/data-destinations")}async getDataDestinations(){return this.get("/")}async getDataDestinationById(t){return this.get(`/${t}`)}async createDataDestination(t){return this.post("",t)}async updateDataDestination(t,n){return this.put(`/${t}`,n)}async deleteDataDestination(t){return this.delete(`/${t}`)}async rotateSecretKey(t){return this.post(`/${t}/rotate-secret-key`)}}const Nl=new EK,Hr={types:{[je.GOOGLE_SHEETS]:{type:je.GOOGLE_SHEETS,displayName:"Google Sheets",icon:nG,status:us.ACTIVE},[je.LOOKER_STUDIO]:{type:je.LOOKER_STUDIO,displayName:"Looker Studio",icon:rG,status:us.ACTIVE},[je.EMAIL]:{type:je.EMAIL,displayName:"Email",icon:xG,status:us.CLOUD_ONLY},[je.SLACK]:{type:je.SLACK,displayName:"Slack",icon:uG,status:us.CLOUD_ONLY},[je.MS_TEAMS]:{type:je.MS_TEAMS,displayName:"Microsoft Teams",icon:yG,status:us.CLOUD_ONLY},[je.GOOGLE_CHAT]:{type:je.GOOGLE_CHAT,displayName:"Google Chat",icon:vG,status:us.CLOUD_ONLY},[je.ODATA]:{type:je.ODATA,displayName:"OData",icon:aG,status:us.COMING_SOON}},getInfo(e){return this.types[e]},getAllTypes(){return Object.values(this.types)}},wK=Jt({deploymentUrl:$t().optional(),destinationId:$t().optional(),destinationSecretKey:$t().optional()}),RK=Jt({to:Z0($t().email()).min(1)}),Ib=Jt({title:$t().min(1,"Title is required"),type:Ng(je)}),jK=Ib.extend({type:ga(je.GOOGLE_SHEETS),credentials:NA}),TK=Ib.extend({type:ga(je.LOOKER_STUDIO),credentials:wK.optional()}),Og=Ib.extend({credentials:RK.optional()}),_K=Og.extend({type:ga(je.EMAIL)}),NK=Og.extend({type:ga(je.SLACK)}),AK=Og.extend({type:ga(je.MS_TEAMS)}),DK=Og.extend({type:ga(je.GOOGLE_CHAT)}),OK=_A("type",[jK,TK,_K,NK,AK,DK]),r3=m.createContext(void 0);var Lt=(e=>(e.FETCH_DESTINATIONS_START="FETCH_DESTINATIONS_START",e.FETCH_DESTINATIONS_SUCCESS="FETCH_DESTINATIONS_SUCCESS",e.FETCH_DESTINATIONS_ERROR="FETCH_DESTINATIONS_ERROR",e.FETCH_DESTINATION_START="FETCH_DESTINATION_START",e.FETCH_DESTINATION_SUCCESS="FETCH_DESTINATION_SUCCESS",e.FETCH_DESTINATION_ERROR="FETCH_DESTINATION_ERROR",e.CLEAR_CURRENT_DESTINATION="CLEAR_CURRENT_DESTINATION",e.CREATE_DESTINATION_START="CREATE_DESTINATION_START",e.CREATE_DESTINATION_SUCCESS="CREATE_DESTINATION_SUCCESS",e.CREATE_DESTINATION_ERROR="CREATE_DESTINATION_ERROR",e.UPDATE_DESTINATION_START="UPDATE_DESTINATION_START",e.UPDATE_DESTINATION_SUCCESS="UPDATE_DESTINATION_SUCCESS",e.UPDATE_DESTINATION_ERROR="UPDATE_DESTINATION_ERROR",e.DELETE_DESTINATION_START="DELETE_DESTINATION_START",e.DELETE_DESTINATION_SUCCESS="DELETE_DESTINATION_SUCCESS",e.DELETE_DESTINATION_ERROR="DELETE_DESTINATION_ERROR",e.CLEAR_ERROR="CLEAR_ERROR",e))(Lt||{});const MK={dataDestinations:[],currentDataDestination:null,loading:!1,error:null};function IK(e,t){switch(t.type){case Lt.FETCH_DESTINATIONS_START:case Lt.FETCH_DESTINATION_START:case Lt.CREATE_DESTINATION_START:case Lt.UPDATE_DESTINATION_START:case Lt.DELETE_DESTINATION_START:return{...e,loading:!0,error:null};case Lt.FETCH_DESTINATIONS_SUCCESS:return{...e,dataDestinations:t.payload,loading:!1,error:null};case Lt.FETCH_DESTINATION_SUCCESS:return{...e,currentDataDestination:t.payload,loading:!1,error:null};case Lt.CREATE_DESTINATION_SUCCESS:return{...e,dataDestinations:[...e.dataDestinations,t.payload],loading:!1,error:null};case Lt.UPDATE_DESTINATION_SUCCESS:return{...e,currentDataDestination:t.payload,dataDestinations:e.dataDestinations.map(n=>n.id===t.payload.id?t.payload:n),loading:!1,error:null};case Lt.DELETE_DESTINATION_SUCCESS:return{...e,dataDestinations:e.dataDestinations.filter(n=>n.id!==t.payload),loading:!1,error:null};case Lt.FETCH_DESTINATIONS_ERROR:case Lt.FETCH_DESTINATION_ERROR:case Lt.CREATE_DESTINATION_ERROR:case Lt.UPDATE_DESTINATION_ERROR:case Lt.DELETE_DESTINATION_ERROR:return{...e,loading:!1,error:t.payload};case Lt.CLEAR_CURRENT_DESTINATION:return{...e,currentDataDestination:null};case Lt.CLEAR_ERROR:return{...e,error:null};default:return e}}function Yf({children:e}){const[t,n]=m.useReducer(IK,MK);return s.jsx(r3.Provider,{value:{state:t,dispatch:n},children:e})}function kK(){const e=m.useContext(r3);if(e===void 0)throw new Error("useDataDestinationContext must be used within a DataDestinationProvider");return e}class Om{constructor(t){this.type=t}mapFromDto(t){const n=this.extractCredentials(t.credentials);return{id:t.id,title:t.title,type:this.type,projectId:t.projectId,credentials:n,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt)}}mapToUpdateRequest(t){const n=t,r={title:n.title??""};if(n.credentials!==void 0){const o=n.credentials.to;r.credentials={type:qs.EMAIL_CREDENTIALS,to:o}}return r}mapToCreateRequest(t){const n=t,r=n.credentials.to;return{title:n.title,type:this.type,credentials:{type:qs.EMAIL_CREDENTIALS,to:r}}}extractCredentials(t){return t.type===qs.EMAIL_CREDENTIALS?{to:t.to}:{to:[]}}}class LK{mapFromDto(t){let n="";try{t.credentials.type===qs.GOOGLE_SHEETS_CREDENTIALS&&(n=JSON.stringify(t.credentials.serviceAccountKey,null,2))}catch(r){console.error(r,"Error parsing service account key")}return{id:t.id,title:t.title,type:je.GOOGLE_SHEETS,projectId:t.projectId,credentials:{serviceAccount:n},createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt)}}mapToUpdateRequest(t){const n=t,r={title:n.title??""};return n.credentials&&(r.credentials={serviceAccountKey:JSON.parse(n.credentials.serviceAccount),type:qs.GOOGLE_SHEETS_CREDENTIALS}),r}mapToCreateRequest(t){const n=t;return{title:n.title,type:je.GOOGLE_SHEETS,credentials:{serviceAccountKey:JSON.parse(n.credentials.serviceAccount),type:qs.GOOGLE_SHEETS_CREDENTIALS}}}}class PK{mapFromDto(t){const n=this.extractLookerStudioCredentials(t.credentials);return{id:t.id,title:t.title,type:je.LOOKER_STUDIO,projectId:t.projectId,credentials:n,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt)}}mapToUpdateRequest(t){return{title:t.title??"",credentials:{type:qs.LOOKER_STUDIO_CREDENTIALS}}}mapToCreateRequest(t){return{title:t.title,type:je.LOOKER_STUDIO,credentials:{type:qs.LOOKER_STUDIO_CREDENTIALS}}}extractLookerStudioCredentials(t){return t.type===qs.LOOKER_STUDIO_CREDENTIALS?{deploymentUrl:t.deploymentUrl,destinationId:t.destinationId,destinationSecretKey:t.destinationSecretKey}:{deploymentUrl:"",destinationId:"",destinationSecretKey:""}}}const a3={getMapper(e){switch(e){case je.GOOGLE_SHEETS:return new LK;case je.LOOKER_STUDIO:return new PK;case je.EMAIL:return new Om(je.EMAIL);case je.SLACK:return new Om(je.SLACK);case je.MS_TEAMS:return new Om(je.MS_TEAMS);case je.GOOGLE_CHAT:return new Om(je.GOOGLE_CHAT);default:throw new Error(`Unknown destination type: ${e}`)}}};function nu(e){return a3.getMapper(e.type).mapFromDto(e)}function Wf(){const{state:e,dispatch:t}=kK(),n=m.useCallback(async()=>{t({type:Lt.FETCH_DESTINATIONS_START});try{const g=(await Nl.getDataDestinations()).map(nu);t({type:Lt.FETCH_DESTINATIONS_SUCCESS,payload:g})}catch(h){const g=h instanceof Error?h.message:"Failed to load destinations";t({type:Lt.FETCH_DESTINATIONS_ERROR,payload:g}),Ue({event:"data_destination_error",category:"DataDestination",action:"ListError",label:g})}},[t]),r=m.useCallback(async h=>{try{const g=await Nl.getDataDestinationById(h),y=nu(g);t({type:Lt.FETCH_DESTINATION_SUCCESS,payload:y})}catch(g){const y=g instanceof Error?g.message:"Failed to load destination";t({type:Lt.FETCH_DESTINATION_ERROR,payload:y}),Ue({event:"data_destination_error",category:"DataDestination",action:"GetError",label:y})}},[t]),o=m.useCallback(async h=>{t({type:Lt.CREATE_DESTINATION_START});try{const g=await Nl.createDataDestination(h),y=nu(g);return t({type:Lt.CREATE_DESTINATION_SUCCESS,payload:y}),Ue({event:"data_destination_created",category:"DataDestination",action:"Create",label:y.type}),It.success("Destination created"),y}catch(g){const y=g instanceof Error?g.message:"Failed to create destination";return t({type:Lt.CREATE_DESTINATION_ERROR,payload:y}),Ue({event:"data_destination_error",category:"DataDestination",action:"CreateError",label:h.type}),null}},[t]),l=m.useCallback(async(h,g)=>{t({type:Lt.UPDATE_DESTINATION_START});try{const y=await Nl.updateDataDestination(h,g),v=nu(y);return t({type:Lt.UPDATE_DESTINATION_SUCCESS,payload:v}),Ue({event:"data_destination_updated",category:"DataDestination",action:"Update",label:v.type}),It.success("Destination updated"),v}catch(y){const v=y instanceof Error?y.message:"Failed to update destination";return t({type:Lt.UPDATE_DESTINATION_ERROR,payload:v}),Ue({event:"data_destination_error",category:"DataDestination",action:"UpdateError",label:v}),null}},[t]),c=m.useCallback(async h=>{t({type:Lt.DELETE_DESTINATION_START});try{await Nl.deleteDataDestination(h),t({type:Lt.DELETE_DESTINATION_SUCCESS,payload:h}),Ue({event:"data_destination_deleted",category:"DataDestination",action:"Delete"}),It.success("Destination deleted")}catch(g){const y=g instanceof Error?g.message:"Failed to delete destination";throw t({type:Lt.DELETE_DESTINATION_ERROR,payload:y}),Ue({event:"data_destination_error",category:"DataDestination",action:"DeleteError",label:y}),g}},[t]),d=m.useCallback(()=>{t({type:Lt.CLEAR_CURRENT_DESTINATION})},[t]),f=m.useCallback(async h=>{try{const g=await Nl.rotateSecretKey(h),y=nu(g);return Ue({event:"data_destination_updated",category:"DataDestination",action:"RotateSecretKey",label:y.type}),y}catch(g){const y=g instanceof Error?g.message:"Failed to rotate secret key";throw Ue({event:"data_destination_error",category:"DataDestination",action:"RotateSecretKeyError",label:y}),console.error("Failed to rotate secret key:",g),g}},[]);return{dataDestinations:e.dataDestinations,currentDataDestination:e.currentDataDestination,loading:e.loading,error:e.error,fetchDataDestinations:n,getDataDestinationById:r,createDataDestination:o,updateDataDestination:l,deleteDataDestination:c,clearCurrentDataDestination:d,rotateSecretKey:f}}function UK(e){const t=Hr.getInfo(e.type),n=t.status!==us.COMING_SOON;return{destinationInfo:t,isVisible:n}}function FK(){const{dataMart:e}=Ia(),{fetchReportsByDataMartId:t}=Ts(),{dataDestinations:n,fetchDataDestinations:r,loading:o}=Wf(),[l,c]=m.useState(!0);return m.useEffect(()=>{if(!e)return;(async()=>{c(!0);try{await Promise.all([r(),t(e.id)])}catch(h){console.error("Failed to fetch Data Mart destinations or reports:",h)}finally{c(!1)}})()},[e,r,t]),{dataDestinations:n,isLoading:l||o}}function kb(e){return JSON.stringify(e,null,2)}class VK{mapFromDto(t){if(t.type!==yr.EMAIL_CONFIG)throw new Error("Invalid destination config type");return{type:yr.EMAIL_CONFIG,reportCondition:t.reportCondition,subject:t.subject,messageTemplate:t.messageTemplate}}}class zK{mapFromDto(t){if(t.type!==yr.GOOGLE_SHEETS_CONFIG)throw new Error("Invalid destination config type");return{type:yr.GOOGLE_SHEETS_CONFIG,spreadsheetId:t.spreadsheetId,sheetId:t.sheetId.toString()}}}class HK{mapFromDto(t){if(t.type!==yr.LOOKER_STUDIO_CONFIG)throw new Error("Invalid destination config type");return{type:yr.LOOKER_STUDIO_CONFIG,cacheLifetime:t.cacheLifetime}}}const $K={getMapper(e){switch(e){case yr.GOOGLE_SHEETS_CONFIG:return new zK;case yr.LOOKER_STUDIO_CONFIG:return new HK;case yr.EMAIL_CONFIG:return new VK;default:throw new Error(`Unknown destination config type: ${String(e)}`)}}};function BK(e){return $K.getMapper(e.type).mapFromDto(e)}function Al(e){const t=BK(e.destinationConfig);return{id:e.id,title:e.title,dataMart:{id:e.dataMart.id},dataDestination:nu(e.dataDestinationAccess),destinationConfig:t,lastRunDate:e.lastRunAt?new Date(e.lastRunAt):null,lastRunStatus:e.lastRunStatus,lastRunError:e.lastRunError,runsCount:e.runsCount,createdAt:new Date(e.createdAt),modifiedAt:new Date(e.modifiedAt)}}function Ts(){const{state:e,dispatch:t}=xK(),n=m.useCallback(async()=>{t({type:rt.FETCH_DESTINATIONS_START});try{const C=await Nl.getDataDestinations();t({type:rt.FETCH_DESTINATIONS_SUCCESS,payload:C})}catch(C){const R=C instanceof Error?C.message:"Failed to fetch destinations";t({type:rt.FETCH_DESTINATIONS_ERROR,payload:R}),Ue({event:"report_error",category:"Report",action:"DestinationsListError",label:R})}},[t]),r=m.useCallback(async()=>{t({type:rt.FETCH_REPORTS_START});try{const R=(await No.getReportsByProject()).map(Al);t({type:rt.FETCH_REPORTS_SUCCESS,payload:R})}catch(C){const R=C instanceof Error?C.message:"Failed to fetch reports";t({type:rt.FETCH_REPORTS_ERROR,payload:R}),Ue({event:"report_error",category:"Report",action:"ListError",label:R})}},[t]),o=m.useCallback(async(C,R)=>{R!=null&&R.silent||t({type:rt.FETCH_REPORTS_START});try{const _=(await No.getReportsByDataMartId(C,R!=null&&R.silent?{skipLoadingIndicator:!0}:void 0)).map(Al);t({type:rt.FETCH_REPORTS_SUCCESS,payload:_})}catch(j){const _=j instanceof Error?j.message:"Failed to fetch reports";t({type:rt.FETCH_REPORTS_ERROR,payload:_}),Ue({event:"report_error",category:"Report",action:"ListError",label:_})}},[t]),l=m.useCallback(async C=>{t({type:rt.FETCH_REPORT_START});try{const R=await No.getReportById(C),j=Al(R);t({type:rt.FETCH_REPORT_SUCCESS,payload:j})}catch(R){const j=R instanceof Error?R.message:"Failed to fetch report";t({type:rt.FETCH_REPORT_ERROR,payload:j}),Ue({event:"report_error",category:"Report",action:"GetError",label:j})}},[t]),c=m.useCallback(async C=>{t({type:rt.CREATE_REPORT_START});try{const R=await No.createReport(C),j=Al(R);return t({type:rt.CREATE_REPORT_SUCCESS,payload:j}),Ue({event:"report_created",category:"Report",action:"Create",label:j.dataDestination.type}),It.success("Report created"),j}catch(R){const j=R instanceof Error?R.message:"Failed to create report";return t({type:rt.CREATE_REPORT_ERROR,payload:j}),Ue({event:"report_error",category:"Report",action:"CreateError",label:C.destinationConfig.type}),null}},[t]),d=m.useCallback(async(C,R)=>{t({type:rt.UPDATE_REPORT_START});try{const j=await No.updateReport(C,R),_=Al(j);return t({type:rt.UPDATE_REPORT_SUCCESS,payload:_}),Ue({event:"report_updated",category:"Report",action:"Update",label:_.dataDestination.type}),It.success("Report updated"),_}catch(j){const _=j instanceof Error?j.message:"Failed to update report";return t({type:rt.UPDATE_REPORT_ERROR,payload:_}),Ue({event:"report_error",category:"Report",action:"UpdateError",label:_}),null}},[t]),f=m.useCallback(async C=>{t({type:rt.DELETE_REPORT_START});try{await No.deleteReport(C),t({type:rt.DELETE_REPORT_SUCCESS,payload:C}),Ue({event:"report_deleted",category:"Report",action:"Delete"}),It.success("Report deleted")}catch(R){const j=R instanceof Error?R.message:"Failed to delete report";t({type:rt.DELETE_REPORT_ERROR,payload:j}),Ue({event:"report_error",category:"Report",action:"DeleteError",label:j})}},[t]),h=m.useCallback(()=>{t({type:rt.CLEAR_CURRENT_REPORT})},[t]),g=m.useCallback(()=>{t({type:rt.CLEAR_ERROR})},[t]),y=m.useCallback(C=>{Dm.stopPolling(C),t({type:rt.STOP_POLLING_REPORT,payload:C})},[t]),v=m.useCallback(C=>{e.polledReportIds.includes(C)&&y(C),t({type:rt.START_POLLING_REPORT,payload:C}),Dm.startPolling(C,R=>{const j=Al(R);t({type:rt.UPDATE_POLLED_REPORT,payload:j})})},[t,e.polledReportIds,y]),b=m.useCallback(()=>{Dm.stopAllPolling(),t({type:rt.STOP_ALL_POLLING})},[t]),w=m.useCallback(C=>{Dm.setConfig(C)},[]),S=m.useCallback(async C=>{try{y(C),await No.runReport(C),await l(C),v(C),Ue({event:"report_run_started",category:"Report",action:"Run",label:C}),It.success("Report run started")}catch(R){const j=R instanceof Error?R.message:"Failed to run report";Ue({event:"report_error",category:"Report",action:"RunError",label:j}),console.error("Failed to run report:",R)}},[l,v,y]);return m.useEffect(()=>()=>{b()},[b]),{destinations:e.destinations,reports:e.reports,currentReport:e.currentReport,loading:e.loading,error:e.error,polledReportIds:e.polledReportIds,fetchDestinations:n,fetchReports:r,fetchReportsByDataMartId:o,fetchReportById:l,createReport:c,updateReport:d,deleteReport:f,runReport:S,startPollingReport:v,stopPollingReport:y,stopAllPolling:b,setPollingConfig:w,clearCurrentReport:h,clearError:g}}fn.SUCCESS+"",fn.SUCCESS,fn.RUNNING+"",fn.RUNNING,fn.ERROR+"",fn.ERROR,fn.CANCELLED+"",fn.CANCELLED;var $x,Mg="HoverCard",[s3]=cr(Mg,[eo]),Ig=eo(),[GK,kg]=s3(Mg),o3=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:o,onOpenChange:l,openDelay:c=700,closeDelay:d=300}=e,f=Ig(t),h=m.useRef(0),g=m.useRef(0),y=m.useRef(!1),v=m.useRef(!1),[b,w]=Gr({prop:r,defaultProp:o??!1,onChange:l,caller:Mg}),S=m.useCallback(()=>{clearTimeout(g.current),h.current=window.setTimeout(()=>w(!0),c)},[c,w]),C=m.useCallback(()=>{clearTimeout(h.current),!y.current&&!v.current&&(g.current=window.setTimeout(()=>w(!1),d))},[d,w]),R=m.useCallback(()=>w(!1),[w]);return m.useEffect(()=>()=>{clearTimeout(h.current),clearTimeout(g.current)},[]),s.jsx(GK,{scope:t,open:b,onOpenChange:w,onOpen:S,onClose:C,onDismiss:R,hasSelectionRef:y,isPointerDownOnContentRef:v,children:s.jsx(ku,{...f,children:n})})};o3.displayName=Mg;var i3="HoverCardTrigger",l3=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=kg(i3,n),l=Ig(n);return s.jsx(Lu,{asChild:!0,...l,children:s.jsx(et.a,{"data-state":o.open?"open":"closed",...r,ref:t,onPointerEnter:Te(e.onPointerEnter,Pp(o.onOpen)),onPointerLeave:Te(e.onPointerLeave,Pp(o.onClose)),onFocus:Te(e.onFocus,o.onOpen),onBlur:Te(e.onBlur,o.onClose),onTouchStart:Te(e.onTouchStart,c=>c.preventDefault())})})});l3.displayName=i3;var Lb="HoverCardPortal",[qK,ZK]=s3(Lb,{forceMount:void 0}),c3=e=>{const{__scopeHoverCard:t,forceMount:n,children:r,container:o}=e,l=kg(Lb,t);return s.jsx(qK,{scope:t,forceMount:n,children:s.jsx(_r,{present:n||l.open,children:s.jsx(tc,{asChild:!0,container:o,children:r})})})};c3.displayName=Lb;var Lp="HoverCardContent",u3=m.forwardRef((e,t)=>{const n=ZK(Lp,e.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=e,l=kg(Lp,e.__scopeHoverCard);return s.jsx(_r,{present:r||l.open,children:s.jsx(KK,{"data-state":l.open?"open":"closed",...o,onPointerEnter:Te(e.onPointerEnter,Pp(l.onOpen)),onPointerLeave:Te(e.onPointerLeave,Pp(l.onClose)),ref:t})})});u3.displayName=Lp;var KK=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:c,...d}=e,f=kg(Lp,n),h=Ig(n),g=m.useRef(null),y=dt(t,g),[v,b]=m.useState(!1);return m.useEffect(()=>{if(v){const w=document.body;return $x=w.style.userSelect||w.style.webkitUserSelect,w.style.userSelect="none",w.style.webkitUserSelect="none",()=>{w.style.userSelect=$x,w.style.webkitUserSelect=$x}}},[v]),m.useEffect(()=>{if(g.current){const w=()=>{b(!1),f.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var C;((C=document.getSelection())==null?void 0:C.toString())!==""&&(f.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",w),()=>{document.removeEventListener("pointerup",w),f.hasSelectionRef.current=!1,f.isPointerDownOnContentRef.current=!1}}},[f.isPointerDownOnContentRef,f.hasSelectionRef]),m.useEffect(()=>{g.current&&QK(g.current).forEach(S=>S.setAttribute("tabindex","-1"))}),s.jsx(ec,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:c,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:Te(l,w=>{w.preventDefault()}),onDismiss:f.onDismiss,children:s.jsx(If,{...h,...d,onPointerDown:Te(d.onPointerDown,w=>{w.currentTarget.contains(w.target)&&b(!0),f.hasSelectionRef.current=!1,f.isPointerDownOnContentRef.current=!0}),ref:y,style:{...d.style,userSelect:v?"text":void 0,WebkitUserSelect:v?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),YK="HoverCardArrow",WK=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=Ig(n);return s.jsx(kf,{...o,...r,ref:t})});WK.displayName=YK;function Pp(e){return t=>t.pointerType==="touch"?void 0:e()}function QK(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}var XK=o3,JK=l3,eY=c3,tY=u3;const Pb=({...e})=>s.jsx(XK,{"data-slot":"hover-card",...e});Pb.displayName="HoverCard";const Ub=m.forwardRef(({...e},t)=>s.jsx(JK,{"data-slot":"hover-card-trigger",ref:t,...e}));Ub.displayName="HoverCardTrigger";const Fb=m.forwardRef(({className:e,align:t="center",sideOffset:n=4,onClick:r,...o},l)=>{const c=d=>{d.stopPropagation(),r&&r(d)};return s.jsx(eY,{children:s.jsx(tY,{ref:l,align:t,sideOffset:n,className:ne("bg-popover text-popover-foreground z-50 w-110 rounded-lg border px-6 py-4 shadow-md outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),onClick:c,...o})})});Fb.displayName="HoverCardContent";const Vb=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:ne("border-border flex gap-4 border-b pb-4",e),...t}));Vb.displayName="HoverCardHeader";const zb=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:ne("bg-muted flex h-14 min-h-[56px] w-14 min-w-[56px] shrink-0 items-center justify-center rounded-full",e),...t}));zb.displayName="HoverCardHeaderIcon";const Hb=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:ne("flex flex-col space-y-1",e),...t}));Hb.displayName="HoverCardHeaderText";const $b=m.forwardRef(({className:e,...t},n)=>s.jsx("h2",{ref:n,className:ne("text-md pt-1 leading-snug font-semibold",e),...t}));$b.displayName="HoverCardHeaderTitle";const Bb=m.forwardRef(({className:e,...t},n)=>s.jsx("p",{ref:n,className:ne("text-muted-foreground text-sm",e),...t}));Bb.displayName="HoverCardHeaderDescription";const Gb=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:ne("flex flex-col",e),...t}));Gb.displayName="HoverCardBody";const ki=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:ne("border-border flex items-center justify-between border-b py-4",e),...t}));ki.displayName="HoverCardItem";const Li=m.forwardRef(({className:e,...t},n)=>s.jsx("span",{ref:n,className:ne("text-muted-foreground text-sm",e),...t}));Li.displayName="HoverCardItemLabel";const Pi=m.forwardRef(({className:e,...t},n)=>s.jsx("span",{ref:n,className:ne("text-sm",e),...t}));Pi.displayName="HoverCardItemValue";const qb=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:ne("pt-4 pb-2",e),...t}));qb.displayName="HoverCardFooter";function Lg(e){return e.type===yr.GOOGLE_SHEETS_CONFIG}function d3(e){return e.type===yr.LOOKER_STUDIO_CONFIG}function Bx(e){return e.type===yr.EMAIL_CONFIG}function Zi({date:e,className:t=""}){const n=m.useMemo(()=>{const r=new Date,o=e.getTime()-r.getTime(),l=Math.abs(o),c=o<0,d=Math.floor(l/(1e3*60)),f=Math.floor(l/(1e3*60*60)),h=Math.floor(l/(1e3*60*60*24)),g=Math.floor(h/7),y=Math.floor(h/30),v=Math.floor(h/365),b=S=>S.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}),w=S=>S.toLocaleDateString("en-US",{weekday:"long"});if(d<1)return c?"Just now":"In a moment";if(d<60)return c?d===1?"1 minute ago":`${d} minutes ago`:d===1?"In 1 minute":`In ${d} minutes`;if(f<24)return c?f===1?"1 hour ago":`${f} hours ago`:f===1?"In 1 hour":`In ${f} hours`;if(h===1){const S=b(e);return c?`Yesterday at ${S}`:`Tomorrow at ${S}`}if(h<7){const S=w(e),C=b(e);return c?`Last ${S} at ${C}`:`This ${S} at ${C}`}if(h<14){const S=w(e),C=b(e);return c?`Last ${S} at ${C}`:`Next ${S} at ${C}`}return g<4?c?g===2?"2 weeks ago":"3 weeks ago":g===2?"In 2 weeks":"In 3 weeks":y<12?c?y===1?"1 month ago":`${y} months ago`:y===1?"In 1 month":`In ${y} months`:c?v===1?"1 year ago":`${v} years ago`:v===1?"In 1 year":`In ${v} years`},[e]);return s.jsx("span",{className:`${t}`,title:e.toLocaleString(),children:n})}const nY=()=>{const e=m.useMemo(()=>new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),[]),t=m.useMemo(()=>new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}),[]);return{detailedDateFormatter:e,shortDateFormatter:t}},rY=ye.memo(function({report:t,children:n}){const{detailedDateFormatter:r,shortDateFormatter:o}=nY(),l=m.useMemo(()=>t.lastRunStatus?{statusType:oY(t.lastRunStatus),statusText:lY(t.lastRunStatus)}:null,[t.lastRunStatus]),c=m.useMemo(()=>({modifiedAt:r.format(new Date(t.modifiedAt)),createdAt:o.format(new Date(t.createdAt))}),[t.modifiedAt,t.createdAt,r,o]),d=m.useMemo(()=>Hr.getInfo(t.dataDestination.type).icon,[t.dataDestination.type]),f=m.useMemo(()=>Lg(t.destinationConfig)?{isGoogleSheets:!0,spreadsheetId:t.destinationConfig.spreadsheetId,sheetId:t.destinationConfig.sheetId}:{isGoogleSheets:!1,spreadsheetId:null,sheetId:null},[t.destinationConfig]),h=m.useCallback(()=>{if(!f.isGoogleSheets||!f.spreadsheetId||!f.sheetId)return;const g=Mb(f.spreadsheetId,f.sheetId);window.open(g,"_blank","noopener,noreferrer")},[f]);return s.jsxs(Pb,{children:[s.jsx(Ub,{asChild:!0,children:s.jsx("span",{children:n})}),s.jsxs(Fb,{children:[s.jsxs(Vb,{children:[s.jsx(zb,{children:s.jsx(d,{size:20})}),s.jsxs(Hb,{children:[s.jsx($b,{children:t.title||"Unnamed Report"}),s.jsxs(Bb,{children:["Last modified ",s.jsx(Zi,{date:new Date(t.modifiedAt)})]})]})]}),s.jsxs(Gb,{children:[s.jsxs(ki,{children:[s.jsx(Li,{children:"Last run status:"}),s.jsx(Pi,{children:l?s.jsx(Kf,{type:l.statusType,variant:"ghost",children:l.statusText}):"Not run yet"})]}),s.jsxs(ki,{children:[s.jsx(Li,{children:"Last run date:"}),s.jsx(Pi,{children:t.lastRunDate?s.jsx(Zi,{date:t.lastRunDate}):"Never run"})]}),t.lastRunError&&s.jsxs(ki,{children:[s.jsx(Li,{children:"Error message:"}),s.jsx(Pi,{children:t.lastRunError})]}),s.jsxs(ki,{children:[s.jsx(Li,{children:"Total runs:"}),s.jsxs(Pi,{children:[t.runsCount||0," runs",c.createdAt&&s.jsxs(s.Fragment,{children:[", since ",c.createdAt]})]})]})]}),f.isGoogleSheets&&s.jsx(qb,{children:s.jsxs(Se,{className:"w-full",variant:"default",onClick:h,title:"Open in Google Sheets","aria-label":"Open in Google Sheets",children:["Open in Google Sheets",s.jsx(Fo,{className:"ml-1 inline h-4 w-4","aria-hidden":"true"})]})})]})]})},(e,t)=>e.report.id===t.report.id&&e.report.title===t.report.title&&e.report.modifiedAt===t.report.modifiedAt&&e.report.lastRunStatus===t.report.lastRunStatus&&e.report.lastRunDate===t.report.lastRunDate&&e.report.lastRunError===t.report.lastRunError&&e.report.runsCount===t.report.runsCount&&e.report.createdAt===t.report.createdAt&&JSON.stringify(e.report.destinationConfig)===JSON.stringify(t.report.destinationConfig)),aY=e=>{switch(e){case Rr.DRAFT:return In.NEUTRAL;case Rr.PUBLISHED:return In.SUCCESS;default:return In.NEUTRAL}},sY=e=>{switch(e){case ir.SUCCESS:return In.SUCCESS;case ir.RUNNING:return In.INFO;case ir.FAILED:case ir.CANCELLED:case ir.INTERRUPTED:return In.ERROR;default:return In.NEUTRAL}},oY=e=>{switch(e){case fn.SUCCESS:return In.SUCCESS;case fn.RUNNING:return In.INFO;case fn.ERROR:return In.ERROR;default:return In.NEUTRAL}},iY=e=>{switch(e){case ir.SUCCESS:return"Success";case ir.RUNNING:return"Running";case ir.FAILED:return"Failed";case ir.CANCELLED:return"Cancelled";case ir.INTERRUPTED:return"Interrupted";case ir.PENDING:return"Pending";default:return"Unknown"}},lY=e=>{switch(e){case fn.SUCCESS:return"Success";case fn.RUNNING:return"Running";case fn.ERROR:return"Failed";default:return"Unknown"}},f3=e=>Jt({fullyQualifiedName:$t().min(1,"Fully qualified name is required").refine(t=>rK(t,e),t=>({message:sK(t,e)}))}),cY=e=>Jt({pattern:$t().min(1,"Table pattern is required").refine(t=>aK(t,e),t=>({message:oK(t,e)}))}),uY=e=>{const t=[];return e.status.code===Rr.PUBLISHED&&t.push(np.ALREADY_PUBLISHED),YA(e.storage)||t.push(np.INVALID_STORAGE),e.definition||t.push(np.MISSING_DEFINITION),t},dY=e=>e.map(t=>OZ[t]);function fY(e){return e.map(t=>({id:t.id,title:t.title,status:HA.getInfo(t.status),storageType:t.storage.type,storageTitle:t.storage.title||void 0,definitionType:t.definitionType,triggersCount:t.triggersCount,reportsCount:t.reportsCount,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt),definition:t.definition}))}function h3(){const{state:e,dispatch:t}=AZ(),n=m.useCallback(async()=>{t({type:"SET_LOADING"});try{const l=await sn.getDataMarts(),c=fY(l);t({type:"SET_ITEMS",payload:c})}catch(l){t({type:"SET_ERROR",payload:l instanceof Error?l.message:"Failed to load data marts"})}},[t]),r=m.useCallback(async l=>{t({type:"SET_LOADING"});try{await sn.deleteDataMart(l),Ue({event:"data_mart_deleted",category:"DataMart",action:"Delete"})}catch(c){const d=c instanceof Error?c.message:"Failed to delete data mart";throw t({type:"SET_ERROR",payload:d}),Ue({event:"data_mart_error",category:"DataMart",action:"DeleteError",label:d}),c}},[t]),o=m.useCallback(()=>n(),[n]);return{items:e.items,loading:e.loading,error:e.error,loadDataMarts:n,refreshList:o,deleteDataMart:r}}/**
667
+ * table-core
668
+ *
669
+ * Copyright (c) TanStack
670
+ *
671
+ * This source code is licensed under the MIT license found in the
672
+ * LICENSE.md file in the root directory of this source tree.
673
+ *
674
+ * @license MIT
675
+ */function Ui(e,t){return typeof e=="function"?e(t):e}function Oa(e,t){return n=>{t.setState(r=>({...r,[e]:Ui(n,r[e])}))}}function Pg(e){return e instanceof Function}function hY(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function mY(e,t){const n=[],r=o=>{o.forEach(l=>{n.push(l);const c=t(l);c!=null&&c.length&&r(c)})};return r(e),n}function at(e,t,n){let r=[],o;return l=>{let c;n.key&&n.debug&&(c=Date.now());const d=e(l);if(!(d.length!==r.length||d.some((g,y)=>r[y]!==g)))return o;r=d;let h;if(n.key&&n.debug&&(h=Date.now()),o=t(...d),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const g=Math.round((Date.now()-c)*100)/100,y=Math.round((Date.now()-h)*100)/100,v=y/16,b=(w,S)=>{for(w=String(w);w.length<S;)w=" "+w;return w};console.info(`%c⏱ ${b(y,5)} /${b(g,5)} ms`,`
676
+ font-size: .6rem;
677
+ font-weight: bold;
678
+ color: hsl(${Math.max(0,Math.min(120-120*v,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function st(e,t,n,r){return{debug:()=>{var o;return(o=e==null?void 0:e.debugAll)!=null?o:e[t]},key:!1,onChange:r}}function pY(e,t,n,r){const o=()=>{var c;return(c=l.getValue())!=null?c:e.options.renderFallbackValue},l={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:at(()=>[e,n,t,l],(c,d,f,h)=>({table:c,column:d,row:f,cell:h,getValue:h.getValue,renderValue:h.renderValue}),st(e.options,"debugCells"))};return e._features.forEach(c=>{c.createCell==null||c.createCell(l,n,t,e)},{}),l}function gY(e,t,n,r){var o,l;const d={...e._getDefaultColumnDef(),...t},f=d.accessorKey;let h=(o=(l=d.id)!=null?l:f?typeof String.prototype.replaceAll=="function"?f.replaceAll(".","_"):f.replace(/\./g,"_"):void 0)!=null?o:typeof d.header=="string"?d.header:void 0,g;if(d.accessorFn?g=d.accessorFn:f&&(f.includes(".")?g=v=>{let b=v;for(const S of f.split(".")){var w;b=(w=b)==null?void 0:w[S]}return b}:g=v=>v[d.accessorKey]),!h)throw new Error;let y={id:`${String(h)}`,accessorFn:g,parent:r,depth:n,columnDef:d,columns:[],getFlatColumns:at(()=>[!0],()=>{var v;return[y,...(v=y.columns)==null?void 0:v.flatMap(b=>b.getFlatColumns())]},st(e.options,"debugColumns")),getLeafColumns:at(()=>[e._getOrderColumnsFn()],v=>{var b;if((b=y.columns)!=null&&b.length){let w=y.columns.flatMap(S=>S.getLeafColumns());return v(w)}return[y]},st(e.options,"debugColumns"))};for(const v of e._features)v.createColumn==null||v.createColumn(y,e);return y}const Or="debugHeaders";function kj(e,t,n){var r;let l={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const c=[],d=f=>{f.subHeaders&&f.subHeaders.length&&f.subHeaders.map(d),c.push(f)};return d(l),c},getContext:()=>({table:e,header:l,column:t})};return e._features.forEach(c=>{c.createHeader==null||c.createHeader(l,e)}),l}const yY={createTable:e=>{e.getHeaderGroups=at(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var l,c;const d=(l=r==null?void 0:r.map(y=>n.find(v=>v.id===y)).filter(Boolean))!=null?l:[],f=(c=o==null?void 0:o.map(y=>n.find(v=>v.id===y)).filter(Boolean))!=null?c:[],h=n.filter(y=>!(r!=null&&r.includes(y.id))&&!(o!=null&&o.includes(y.id)));return Mm(t,[...d,...h,...f],e)},st(e.options,Or)),e.getCenterHeaderGroups=at(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(l=>!(r!=null&&r.includes(l.id))&&!(o!=null&&o.includes(l.id))),Mm(t,n,e,"center")),st(e.options,Or)),e.getLeftHeaderGroups=at(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const l=(o=r==null?void 0:r.map(c=>n.find(d=>d.id===c)).filter(Boolean))!=null?o:[];return Mm(t,l,e,"left")},st(e.options,Or)),e.getRightHeaderGroups=at(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const l=(o=r==null?void 0:r.map(c=>n.find(d=>d.id===c)).filter(Boolean))!=null?o:[];return Mm(t,l,e,"right")},st(e.options,Or)),e.getFooterGroups=at(()=>[e.getHeaderGroups()],t=>[...t].reverse(),st(e.options,Or)),e.getLeftFooterGroups=at(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),st(e.options,Or)),e.getCenterFooterGroups=at(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),st(e.options,Or)),e.getRightFooterGroups=at(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),st(e.options,Or)),e.getFlatHeaders=at(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),st(e.options,Or)),e.getLeftFlatHeaders=at(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),st(e.options,Or)),e.getCenterFlatHeaders=at(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),st(e.options,Or)),e.getRightFlatHeaders=at(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),st(e.options,Or)),e.getCenterLeafHeaders=at(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),st(e.options,Or)),e.getLeftLeafHeaders=at(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),st(e.options,Or)),e.getRightLeafHeaders=at(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),st(e.options,Or)),e.getLeafHeaders=at(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,l,c,d,f,h;return[...(o=(l=t[0])==null?void 0:l.headers)!=null?o:[],...(c=(d=n[0])==null?void 0:d.headers)!=null?c:[],...(f=(h=r[0])==null?void 0:h.headers)!=null?f:[]].map(g=>g.getLeafHeaders()).flat()},st(e.options,Or))}};function Mm(e,t,n,r){var o,l;let c=0;const d=function(v,b){b===void 0&&(b=1),c=Math.max(c,b),v.filter(w=>w.getIsVisible()).forEach(w=>{var S;(S=w.columns)!=null&&S.length&&d(w.columns,b+1)},0)};d(e);let f=[];const h=(v,b)=>{const w={depth:b,id:[r,`${b}`].filter(Boolean).join("_"),headers:[]},S=[];v.forEach(C=>{const R=[...S].reverse()[0],j=C.column.depth===w.depth;let _,D=!1;if(j&&C.column.parent?_=C.column.parent:(_=C.column,D=!0),R&&(R==null?void 0:R.column)===_)R.subHeaders.push(C);else{const A=kj(n,_,{id:[r,b,_.id,C==null?void 0:C.id].filter(Boolean).join("_"),isPlaceholder:D,placeholderId:D?`${S.filter(O=>O.column===_).length}`:void 0,depth:b,index:S.length});A.subHeaders.push(C),S.push(A)}w.headers.push(C),C.headerGroup=w}),f.push(w),b>0&&h(S,b-1)},g=t.map((v,b)=>kj(n,v,{depth:c,index:b}));h(g,c-1),f.reverse();const y=v=>v.filter(w=>w.column.getIsVisible()).map(w=>{let S=0,C=0,R=[0];w.subHeaders&&w.subHeaders.length?(R=[],y(w.subHeaders).forEach(_=>{let{colSpan:D,rowSpan:A}=_;S+=D,R.push(A)})):S=1;const j=Math.min(...R);return C=C+j,w.colSpan=S,w.rowSpan=C,{colSpan:S,rowSpan:C}});return y((o=(l=f[0])==null?void 0:l.headers)!=null?o:[]),f}const Zb=(e,t,n,r,o,l,c)=>{let d={id:t,index:r,original:n,depth:o,parentId:c,_valuesCache:{},_uniqueValuesCache:{},getValue:f=>{if(d._valuesCache.hasOwnProperty(f))return d._valuesCache[f];const h=e.getColumn(f);if(h!=null&&h.accessorFn)return d._valuesCache[f]=h.accessorFn(d.original,r),d._valuesCache[f]},getUniqueValues:f=>{if(d._uniqueValuesCache.hasOwnProperty(f))return d._uniqueValuesCache[f];const h=e.getColumn(f);if(h!=null&&h.accessorFn)return h.columnDef.getUniqueValues?(d._uniqueValuesCache[f]=h.columnDef.getUniqueValues(d.original,r),d._uniqueValuesCache[f]):(d._uniqueValuesCache[f]=[d.getValue(f)],d._uniqueValuesCache[f])},renderValue:f=>{var h;return(h=d.getValue(f))!=null?h:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>mY(d.subRows,f=>f.subRows),getParentRow:()=>d.parentId?e.getRow(d.parentId,!0):void 0,getParentRows:()=>{let f=[],h=d;for(;;){const g=h.getParentRow();if(!g)break;f.push(g),h=g}return f.reverse()},getAllCells:at(()=>[e.getAllLeafColumns()],f=>f.map(h=>pY(e,d,h,h.id)),st(e.options,"debugRows")),_getAllCellsByColumnId:at(()=>[d.getAllCells()],f=>f.reduce((h,g)=>(h[g.column.id]=g,h),{}),st(e.options,"debugRows"))};for(let f=0;f<e._features.length;f++){const h=e._features[f];h==null||h.createRow==null||h.createRow(d,e)}return d},vY={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},m3=(e,t,n)=>{var r,o;const l=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(l))};m3.autoRemove=e=>xs(e);const p3=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};p3.autoRemove=e=>xs(e);const g3=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};g3.autoRemove=e=>xs(e);const y3=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};y3.autoRemove=e=>xs(e);const v3=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});v3.autoRemove=e=>xs(e)||!(e!=null&&e.length);const x3=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});x3.autoRemove=e=>xs(e)||!(e!=null&&e.length);const b3=(e,t,n)=>e.getValue(t)===n;b3.autoRemove=e=>xs(e);const S3=(e,t,n)=>e.getValue(t)==n;S3.autoRemove=e=>xs(e);const Kb=(e,t,n)=>{let[r,o]=n;const l=e.getValue(t);return l>=r&&l<=o};Kb.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,l=t===null||Number.isNaN(r)?-1/0:r,c=n===null||Number.isNaN(o)?1/0:o;if(l>c){const d=l;l=c,c=d}return[l,c]};Kb.autoRemove=e=>xs(e)||xs(e[0])&&xs(e[1]);const Ao={includesString:m3,includesStringSensitive:p3,equalsString:g3,arrIncludes:y3,arrIncludesAll:v3,arrIncludesSome:x3,equals:b3,weakEquals:S3,inNumberRange:Kb};function xs(e){return e==null||e===""}const xY={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Oa("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?Ao.includesString:typeof r=="number"?Ao.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Ao.equals:Array.isArray(r)?Ao.arrIncludes:Ao.weakEquals},e.getFilterFn=()=>{var n,r;return Pg(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:Ao[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),l=r==null?void 0:r.find(g=>g.id===e.id),c=Ui(n,l?l.value:void 0);if(Lj(o,c,e)){var d;return(d=r==null?void 0:r.filter(g=>g.id!==e.id))!=null?d:[]}const f={id:e.id,value:c};if(l){var h;return(h=r==null?void 0:r.map(g=>g.id===e.id?f:g))!=null?h:[]}return r!=null&&r.length?[...r,f]:[f]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var l;return(l=Ui(t,o))==null?void 0:l.filter(c=>{const d=n.find(f=>f.id===c.id);if(d){const f=d.getFilterFn();if(Lj(f,c.value,d))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function Lj(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const bY=(e,t,n)=>n.reduce((r,o)=>{const l=o.getValue(e);return r+(typeof l=="number"?l:0)},0),SY=(e,t,n)=>{let r;return n.forEach(o=>{const l=o.getValue(e);l!=null&&(r>l||r===void 0&&l>=l)&&(r=l)}),r},CY=(e,t,n)=>{let r;return n.forEach(o=>{const l=o.getValue(e);l!=null&&(r<l||r===void 0&&l>=l)&&(r=l)}),r},EY=(e,t,n)=>{let r,o;return n.forEach(l=>{const c=l.getValue(e);c!=null&&(r===void 0?c>=c&&(r=o=c):(r>c&&(r=c),o<c&&(o=c)))}),[r,o]},wY=(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let l=o.getValue(e);l!=null&&(l=+l)>=l&&(++n,r+=l)}),n)return r/n},RY=(e,t)=>{if(!t.length)return;const n=t.map(l=>l.getValue(e));if(!hY(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((l,c)=>l-c);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},jY=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),TY=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,_Y=(e,t)=>t.length,Gx={sum:bY,min:SY,max:CY,extent:EY,mean:wY,median:RY,unique:jY,uniqueCount:TY,count:_Y},NY={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Oa("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return Gx.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Gx.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Pg(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:Gx[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function AY(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(l=>!t.includes(l.id));return n==="remove"?r:[...t.map(l=>e.find(c=>c.id===l)).filter(Boolean),...r]}const DY={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Oa("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=at(n=>[ef(t,n)],n=>n.findIndex(r=>r.id===e.id),st(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=ef(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=ef(t,n);return((r=o[o.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=at(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let l=[];if(!(t!=null&&t.length))l=o;else{const c=[...t],d=[...o];for(;d.length&&c.length;){const f=c.shift(),h=d.findIndex(g=>g.id===f);h>-1&&l.push(d.splice(h,1)[0])}l=[...l,...d]}return AY(l,n,r)},st(e.options,"debugTable"))}},qx=()=>({left:[],right:[]}),OY={getInitialState:e=>({columnPinning:qx(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Oa("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var l,c;if(n==="right"){var d,f;return{left:((d=o==null?void 0:o.left)!=null?d:[]).filter(y=>!(r!=null&&r.includes(y))),right:[...((f=o==null?void 0:o.right)!=null?f:[]).filter(y=>!(r!=null&&r.includes(y))),...r]}}if(n==="left"){var h,g;return{left:[...((h=o==null?void 0:o.left)!=null?h:[]).filter(y=>!(r!=null&&r.includes(y))),...r],right:((g=o==null?void 0:o.right)!=null?g:[]).filter(y=>!(r!=null&&r.includes(y)))}}return{left:((l=o==null?void 0:o.left)!=null?l:[]).filter(y=>!(r!=null&&r.includes(y))),right:((c=o==null?void 0:o.right)!=null?c:[]).filter(y=>!(r!=null&&r.includes(y)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,l,c;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((l=(c=t.options.enableColumnPinning)!=null?c:t.options.enablePinning)!=null?l:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(d=>d.id),{left:r,right:o}=t.getState().columnPinning,l=n.some(d=>r==null?void 0:r.includes(d)),c=n.some(d=>o==null?void 0:o.includes(d));return l?"left":c?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=at(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const l=[...r??[],...o??[]];return n.filter(c=>!l.includes(c.column.id))},st(t.options,"debugRows")),e.getLeftVisibleCells=at(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(l=>n.find(c=>c.column.id===l)).filter(Boolean).map(l=>({...l,position:"left"})),st(t.options,"debugRows")),e.getRightVisibleCells=at(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(l=>n.find(c=>c.column.id===l)).filter(Boolean).map(l=>({...l,position:"right"})),st(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?qx():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:qx())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,l;return!!((o=r.left)!=null&&o.length||(l=r.right)!=null&&l.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=at(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),st(e.options,"debugColumns")),e.getRightLeafColumns=at(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),st(e.options,"debugColumns")),e.getCenterLeafColumns=at(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(l=>!o.includes(l.id))},st(e.options,"debugColumns"))}};function MY(e){return e||(typeof document<"u"?document:null)}const Im={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Zx=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),IY={getDefaultColumnDef:()=>Im,getInitialState:e=>({columnSizing:{},columnSizingInfo:Zx(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Oa("columnSizing",e),onColumnSizingInfoChange:Oa("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const l=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Im.minSize,(r=l??e.columnDef.size)!=null?r:Im.size),(o=e.columnDef.maxSize)!=null?o:Im.maxSize)},e.getStart=at(n=>[n,ef(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,l)=>o+l.getSize(),0),st(t.options,"debugColumns")),e.getAfter=at(n=>[n,ef(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,l)=>o+l.getSize(),0),st(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var l;n+=(l=o.column.getSize())!=null?l:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r==null?void 0:r.getCanResize();return l=>{if(!r||!o||(l.persist==null||l.persist(),Kx(l)&&l.touches&&l.touches.length>1))return;const c=e.getSize(),d=e?e.getLeafHeaders().map(R=>[R.column.id,R.column.getSize()]):[[r.id,r.getSize()]],f=Kx(l)?Math.round(l.touches[0].clientX):l.clientX,h={},g=(R,j)=>{typeof j=="number"&&(t.setColumnSizingInfo(_=>{var D,A;const O=t.options.columnResizeDirection==="rtl"?-1:1,T=(j-((D=_==null?void 0:_.startOffset)!=null?D:0))*O,M=Math.max(T/((A=_==null?void 0:_.startSize)!=null?A:0),-.999999);return _.columnSizingStart.forEach(F=>{let[G,Y]=F;h[G]=Math.round(Math.max(Y+Y*M,0)*100)/100}),{..._,deltaOffset:T,deltaPercentage:M}}),(t.options.columnResizeMode==="onChange"||R==="end")&&t.setColumnSizing(_=>({..._,...h})))},y=R=>g("move",R),v=R=>{g("end",R),t.setColumnSizingInfo(j=>({...j,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},b=MY(n),w={moveHandler:R=>y(R.clientX),upHandler:R=>{b==null||b.removeEventListener("mousemove",w.moveHandler),b==null||b.removeEventListener("mouseup",w.upHandler),v(R.clientX)}},S={moveHandler:R=>(R.cancelable&&(R.preventDefault(),R.stopPropagation()),y(R.touches[0].clientX),!1),upHandler:R=>{var j;b==null||b.removeEventListener("touchmove",S.moveHandler),b==null||b.removeEventListener("touchend",S.upHandler),R.cancelable&&(R.preventDefault(),R.stopPropagation()),v((j=R.touches[0])==null?void 0:j.clientX)}},C=kY()?{passive:!1}:!1;Kx(l)?(b==null||b.addEventListener("touchmove",S.moveHandler,C),b==null||b.addEventListener("touchend",S.upHandler,C)):(b==null||b.addEventListener("mousemove",w.moveHandler,C),b==null||b.addEventListener("mouseup",w.upHandler,C)),t.setColumnSizingInfo(R=>({...R,startOffset:f,startSize:c,deltaOffset:0,deltaPercentage:0,columnSizingStart:d,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?Zx():(n=e.initialState.columnSizingInfo)!=null?n:Zx())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let km=null;function kY(){if(typeof km=="boolean")return km;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return km=e,km}function Kx(e){return e.type==="touchstart"}const LY={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Oa("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const o=e.columns;return(n=o.length?o.some(l=>l.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=at(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),st(t.options,"debugRows")),e.getVisibleCells=at(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],st(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>at(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(l=>l.getIsVisible==null?void 0:l.getIsVisible()),st(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,l)=>({...o,[l.id]:n||!(l.getCanHide!=null&&l.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function ef(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const PY={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},UY={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Oa("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,o,l;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((l=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?l:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Ao.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Pg(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Ao[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},FY={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Oa("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,l;e.setExpanded(r?{}:(o=(l=e.initialState)==null?void 0:l.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(l=>{const c=l.split(".");r=Math.max(r,c.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const l=r===!0?!0:!!(r!=null&&r[e.id]);let c={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(d=>{c[d]=!0}):c=r,n=(o=n)!=null?o:!l,!l&&n)return{...c,[e.id]:!0};if(l&&!n){const{[e.id]:d,...f}=c;return f}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},Q0=0,X0=10,Yx=()=>({pageIndex:Q0,pageSize:X0}),VY={getInitialState:e=>({...e,pagination:{...Yx(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Oa("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=l=>Ui(r,l);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?Yx():(o=e.initialState.pagination)!=null?o:Yx())},e.setPageIndex=r=>{e.setPagination(o=>{let l=Ui(r,o.pageIndex);const c=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return l=Math.max(0,Math.min(l,c)),{...o,pageIndex:l}})},e.resetPageIndex=r=>{var o,l;e.setPageIndex(r?Q0:(o=(l=e.initialState)==null||(l=l.pagination)==null?void 0:l.pageIndex)!=null?o:Q0)},e.resetPageSize=r=>{var o,l;e.setPageSize(r?X0:(o=(l=e.initialState)==null||(l=l.pagination)==null?void 0:l.pageSize)!=null?o:X0)},e.setPageSize=r=>{e.setPagination(o=>{const l=Math.max(1,Ui(r,o.pageSize)),c=o.pageSize*o.pageIndex,d=Math.floor(c/l);return{...o,pageIndex:d,pageSize:l}})},e.setPageCount=r=>e.setPagination(o=>{var l;let c=Ui(r,(l=e.options.pageCount)!=null?l:-1);return typeof c=="number"&&(c=Math.max(-1,c)),{...o,pageCount:c}}),e.getPageOptions=at(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((l,c)=>c)),o},st(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},Wx=()=>({top:[],bottom:[]}),zY={getInitialState:e=>({rowPinning:Wx(),...e}),getDefaultOptions:e=>({onRowPinningChange:Oa("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const l=r?e.getLeafRows().map(f=>{let{id:h}=f;return h}):[],c=o?e.getParentRows().map(f=>{let{id:h}=f;return h}):[],d=new Set([...c,e.id,...l]);t.setRowPinning(f=>{var h,g;if(n==="bottom"){var y,v;return{top:((y=f==null?void 0:f.top)!=null?y:[]).filter(S=>!(d!=null&&d.has(S))),bottom:[...((v=f==null?void 0:f.bottom)!=null?v:[]).filter(S=>!(d!=null&&d.has(S))),...Array.from(d)]}}if(n==="top"){var b,w;return{top:[...((b=f==null?void 0:f.top)!=null?b:[]).filter(S=>!(d!=null&&d.has(S))),...Array.from(d)],bottom:((w=f==null?void 0:f.bottom)!=null?w:[]).filter(S=>!(d!=null&&d.has(S)))}}return{top:((h=f==null?void 0:f.top)!=null?h:[]).filter(S=>!(d!=null&&d.has(S))),bottom:((g=f==null?void 0:f.bottom)!=null?g:[]).filter(S=>!(d!=null&&d.has(S)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,l=n.some(d=>r==null?void 0:r.includes(d)),c=n.some(d=>o==null?void 0:o.includes(d));return l?"top":c?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const l=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(c=>{let{id:d}=c;return d});return(r=l==null?void 0:l.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?Wx():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Wx())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,l;return!!((o=r.top)!=null&&o.length||(l=r.bottom)!=null&&l.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(c=>{const d=e.getRow(c,!0);return d.getIsAllParentsExpanded()?d:null}):(n??[]).map(c=>t.find(d=>d.id===c))).filter(Boolean).map(c=>({...c,position:r}))},e.getTopRows=at(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),st(e.options,"debugRows")),e.getBottomRows=at(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),st(e.options,"debugRows")),e.getCenterRows=at(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(l=>!o.has(l.id))},st(e.options,"debugRows"))}},HY={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Oa("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(l=>{l.getCanSelect()&&(r[l.id]=!0)}):o.forEach(l=>{delete r[l.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(l=>{J0(o,l.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=at(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Qx(e,n):{rows:[],flatRows:[],rowsById:{}},st(e.options,"debugTable")),e.getFilteredSelectedRowModel=at(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Qx(e,n):{rows:[],flatRows:[],rowsById:{}},st(e.options,"debugTable")),e.getGroupedSelectedRowModel=at(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Qx(e,n):{rows:[],flatRows:[],rowsById:{}},st(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(l=>{var c;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return l;const d={...l};return J0(d,e.id,n,(c=r==null?void 0:r.selectChildren)!=null?c:!0,t),d})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Yb(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return e1(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return e1(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},J0=(e,t,n,r,o)=>{var l;const c=o.getRow(t,!0);n?(c.getCanMultiSelect()||Object.keys(e).forEach(d=>delete e[d]),c.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(l=c.subRows)!=null&&l.length&&c.getCanSelectSubRows()&&c.subRows.forEach(d=>J0(e,d.id,n,r,o))};function Qx(e,t){const n=e.getState().rowSelection,r=[],o={},l=function(c,d){return c.map(f=>{var h;const g=Yb(f,n);if(g&&(r.push(f),o[f.id]=f),(h=f.subRows)!=null&&h.length&&(f={...f,subRows:l(f.subRows)}),g)return f}).filter(Boolean)};return{rows:l(t.rows),flatRows:r,rowsById:o}}function Yb(e,t){var n;return(n=t[e.id])!=null?n:!1}function e1(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,l=!1;return e.subRows.forEach(c=>{if(!(l&&!o)&&(c.getCanSelect()&&(Yb(c,t)?l=!0:o=!1),c.subRows&&c.subRows.length)){const d=e1(c,t);d==="all"?l=!0:(d==="some"&&(l=!0),o=!1)}}),o?"all":l?"some":!1}const t1=/([0-9]+)/gm,$Y=(e,t,n)=>C3(Ki(e.getValue(n)).toLowerCase(),Ki(t.getValue(n)).toLowerCase()),BY=(e,t,n)=>C3(Ki(e.getValue(n)),Ki(t.getValue(n))),GY=(e,t,n)=>Wb(Ki(e.getValue(n)).toLowerCase(),Ki(t.getValue(n)).toLowerCase()),qY=(e,t,n)=>Wb(Ki(e.getValue(n)),Ki(t.getValue(n))),ZY=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},KY=(e,t,n)=>Wb(e.getValue(n),t.getValue(n));function Wb(e,t){return e===t?0:e>t?1:-1}function Ki(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function C3(e,t){const n=e.split(t1).filter(Boolean),r=t.split(t1).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),l=r.shift(),c=parseInt(o,10),d=parseInt(l,10),f=[c,d].sort();if(isNaN(f[0])){if(o>l)return 1;if(l>o)return-1;continue}if(isNaN(f[1]))return isNaN(c)?-1:1;if(c>d)return 1;if(d>c)return-1}return n.length-r.length}const zd={alphanumeric:$Y,alphanumericCaseSensitive:BY,text:GY,textCaseSensitive:qY,datetime:ZY,basic:KY},YY={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Oa("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const l=o==null?void 0:o.getValue(e.id);if(Object.prototype.toString.call(l)==="[object Date]")return zd.datetime;if(typeof l=="string"&&(r=!0,l.split(t1).length>1))return zd.alphanumeric}return r?zd.text:zd.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return Pg(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:zd[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),l=typeof n<"u"&&n!==null;t.setSorting(c=>{const d=c==null?void 0:c.find(b=>b.id===e.id),f=c==null?void 0:c.findIndex(b=>b.id===e.id);let h=[],g,y=l?n:o==="desc";if(c!=null&&c.length&&e.getCanMultiSort()&&r?d?g="toggle":g="add":c!=null&&c.length&&f!==c.length-1?g="replace":d?g="toggle":g="replace",g==="toggle"&&(l||o||(g="remove")),g==="add"){var v;h=[...c,{id:e.id,desc:y}],h.splice(0,h.length-((v=t.options.maxMultiSortColCount)!=null?v:Number.MAX_SAFE_INTEGER))}else g==="toggle"?h=c.map(b=>b.id===e.id?{...b,desc:y}:b):g==="remove"?h=c.filter(b=>b.id!==e.id):h=[{id:e.id,desc:y}];return h})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const l=e.getFirstSortDir(),c=e.getIsSorted();return c?c!==l&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:c==="desc"?"asc":"desc":l},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},WY=[yY,LY,DY,OY,vY,xY,PY,UY,YY,NY,FY,VY,zY,HY,IY];function QY(e){var t,n;const r=[...WY,...(t=e._features)!=null?t:[]];let o={_features:r};const l=o._features.reduce((v,b)=>Object.assign(v,b.getDefaultOptions==null?void 0:b.getDefaultOptions(o)),{}),c=v=>o.options.mergeOptions?o.options.mergeOptions(l,v):{...l,...v};let f={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(v=>{var b;f=(b=v.getInitialState==null?void 0:v.getInitialState(f))!=null?b:f});const h=[];let g=!1;const y={_features:r,options:{...l,...e},initialState:f,_queue:v=>{h.push(v),g||(g=!0,Promise.resolve().then(()=>{for(;h.length;)h.shift()();g=!1}).catch(b=>setTimeout(()=>{throw b})))},reset:()=>{o.setState(o.initialState)},setOptions:v=>{const b=Ui(v,o.options);o.options=c(b)},getState:()=>o.options.state,setState:v=>{o.options.onStateChange==null||o.options.onStateChange(v)},_getRowId:(v,b,w)=>{var S;return(S=o.options.getRowId==null?void 0:o.options.getRowId(v,b,w))!=null?S:`${w?[w.id,b].join("."):b}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(v,b)=>{let w=(b?o.getPrePaginationRowModel():o.getRowModel()).rowsById[v];if(!w&&(w=o.getCoreRowModel().rowsById[v],!w))throw new Error;return w},_getDefaultColumnDef:at(()=>[o.options.defaultColumn],v=>{var b;return v=(b=v)!=null?b:{},{header:w=>{const S=w.header.column.columnDef;return S.accessorKey?S.accessorKey:S.accessorFn?S.id:null},cell:w=>{var S,C;return(S=(C=w.renderValue())==null||C.toString==null?void 0:C.toString())!=null?S:null},...o._features.reduce((w,S)=>Object.assign(w,S.getDefaultColumnDef==null?void 0:S.getDefaultColumnDef()),{}),...v}},st(e,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:at(()=>[o._getColumnDefs()],v=>{const b=function(w,S,C){return C===void 0&&(C=0),w.map(R=>{const j=gY(o,R,C,S),_=R;return j.columns=_.columns?b(_.columns,j,C+1):[],j})};return b(v)},st(e,"debugColumns")),getAllFlatColumns:at(()=>[o.getAllColumns()],v=>v.flatMap(b=>b.getFlatColumns()),st(e,"debugColumns")),_getAllFlatColumnsById:at(()=>[o.getAllFlatColumns()],v=>v.reduce((b,w)=>(b[w.id]=w,b),{}),st(e,"debugColumns")),getAllLeafColumns:at(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(v,b)=>{let w=v.flatMap(S=>S.getLeafColumns());return b(w)},st(e,"debugColumns")),getColumn:v=>o._getAllFlatColumnsById()[v]};Object.assign(o,y);for(let v=0;v<o._features.length;v++){const b=o._features[v];b==null||b.createTable==null||b.createTable(o)}return o}function sc(){return e=>at(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,l,c){l===void 0&&(l=0);const d=[];for(let h=0;h<o.length;h++){const g=Zb(e,e._getRowId(o[h],h,c),o[h],h,l,void 0,c==null?void 0:c.id);if(n.flatRows.push(g),n.rowsById[g.id]=g,d.push(g),e.options.getSubRows){var f;g.originalSubRows=e.options.getSubRows(o[h],h),(f=g.originalSubRows)!=null&&f.length&&(g.subRows=r(g.originalSubRows,l+1,g))}}return d};return n.rows=r(t),n},st(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function XY(e){const t=[],n=r=>{var o;t.push(r),(o=r.subRows)!=null&&o.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function JY(e,t,n){return n.options.filterFromLeafRows?eW(e,t,n):tW(e,t,n)}function eW(e,t,n){var r;const o=[],l={},c=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,d=function(f,h){h===void 0&&(h=0);const g=[];for(let v=0;v<f.length;v++){var y;let b=f[v];const w=Zb(n,b.id,b.original,b.index,b.depth,void 0,b.parentId);if(w.columnFilters=b.columnFilters,(y=b.subRows)!=null&&y.length&&h<c){if(w.subRows=d(b.subRows,h+1),b=w,t(b)&&!w.subRows.length){g.push(b),l[b.id]=b,o.push(b);continue}if(t(b)||w.subRows.length){g.push(b),l[b.id]=b,o.push(b);continue}}else b=w,t(b)&&(g.push(b),l[b.id]=b,o.push(b))}return g};return{rows:d(e),flatRows:o,rowsById:l}}function tW(e,t,n){var r;const o=[],l={},c=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,d=function(f,h){h===void 0&&(h=0);const g=[];for(let v=0;v<f.length;v++){let b=f[v];if(t(b)){var y;if((y=b.subRows)!=null&&y.length&&h<c){const S=Zb(n,b.id,b.original,b.index,b.depth,void 0,b.parentId);S.subRows=d(b.subRows,h+1),b=S}g.push(b),o.push(b),l[b.id]=b}}return g};return{rows:d(e),flatRows:o,rowsById:l}}function Qf(){return e=>at(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let v=0;v<t.flatRows.length;v++)t.flatRows[v].columnFilters={},t.flatRows[v].columnFiltersMeta={};return t}const o=[],l=[];(n??[]).forEach(v=>{var b;const w=e.getColumn(v.id);if(!w)return;const S=w.getFilterFn();S&&o.push({id:v.id,filterFn:S,resolvedValue:(b=S.resolveFilterValue==null?void 0:S.resolveFilterValue(v.value))!=null?b:v.value})});const c=(n??[]).map(v=>v.id),d=e.getGlobalFilterFn(),f=e.getAllLeafColumns().filter(v=>v.getCanGlobalFilter());r&&d&&f.length&&(c.push("__global__"),f.forEach(v=>{var b;l.push({id:v.id,filterFn:d,resolvedValue:(b=d.resolveFilterValue==null?void 0:d.resolveFilterValue(r))!=null?b:r})}));let h,g;for(let v=0;v<t.flatRows.length;v++){const b=t.flatRows[v];if(b.columnFilters={},o.length)for(let w=0;w<o.length;w++){h=o[w];const S=h.id;b.columnFilters[S]=h.filterFn(b,S,h.resolvedValue,C=>{b.columnFiltersMeta[S]=C})}if(l.length){for(let w=0;w<l.length;w++){g=l[w];const S=g.id;if(g.filterFn(b,S,g.resolvedValue,C=>{b.columnFiltersMeta[S]=C})){b.columnFilters.__global__=!0;break}}b.columnFilters.__global__!==!0&&(b.columnFilters.__global__=!1)}}const y=v=>{for(let b=0;b<c.length;b++)if(v.columnFilters[c[b]]===!1)return!1;return!0};return JY(t.rows,y,e)},st(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Ug(e){return t=>at(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:o,pageIndex:l}=n;let{rows:c,flatRows:d,rowsById:f}=r;const h=o*l,g=h+o;c=c.slice(h,g);let y;t.options.paginateExpandedRows?y={rows:c,flatRows:d,rowsById:f}:y=XY({rows:c,flatRows:d,rowsById:f}),y.flatRows=[];const v=b=>{y.flatRows.push(b),b.subRows.length&&b.subRows.forEach(v)};return y.rows.forEach(v),y},st(t.options,"debugTable"))}function Fu(){return e=>at(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,o=[],l=r.filter(f=>{var h;return(h=e.getColumn(f.id))==null?void 0:h.getCanSort()}),c={};l.forEach(f=>{const h=e.getColumn(f.id);h&&(c[f.id]={sortUndefined:h.columnDef.sortUndefined,invertSorting:h.columnDef.invertSorting,sortingFn:h.getSortingFn()})});const d=f=>{const h=f.map(g=>({...g}));return h.sort((g,y)=>{for(let b=0;b<l.length;b+=1){var v;const w=l[b],S=c[w.id],C=S.sortUndefined,R=(v=w==null?void 0:w.desc)!=null?v:!1;let j=0;if(C){const _=g.getValue(w.id),D=y.getValue(w.id),A=_===void 0,O=D===void 0;if(A||O){if(C==="first")return A?-1:1;if(C==="last")return A?1:-1;j=A&&O?0:A?C:-C}}if(j===0&&(j=S.sortingFn(g,y,w.id)),j!==0)return R&&(j*=-1),S.invertSorting&&(j*=-1),j}return g.index-y.index}),h.forEach(g=>{var y;o.push(g),(y=g.subRows)!=null&&y.length&&(g.subRows=d(g.subRows))}),h};return{rows:d(n.rows),flatRows:o,rowsById:n.rowsById}},st(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
679
+ * react-table
680
+ *
681
+ * Copyright (c) TanStack
682
+ *
683
+ * This source code is licensed under the MIT license found in the
684
+ * LICENSE.md file in the root directory of this source tree.
685
+ *
686
+ * @license MIT
687
+ */function ju(e,t){return e?nW(e)?m.createElement(e,t):e:null}function nW(e){return rW(e)||typeof e=="function"||aW(e)}function rW(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function aW(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function oc(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=m.useState(()=>({current:QY(t)})),[r,o]=m.useState(()=>n.current.initialState);return n.current.setOptions(l=>({...l,...e,state:{...r,...e.state},onStateChange:c=>{o(c),e.onStateChange==null||e.onStateChange(c)}})),n.current}function ic({className:e,...t}){return s.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:s.jsx("table",{"data-slot":"table",className:ne("w-full caption-bottom text-sm",e),...t})})}function lc({className:e,...t}){return s.jsx("thead",{"data-slot":"table-header",className:ne("[&_tr]:border-b",e),...t})}function cc({className:e,...t}){return s.jsx("tbody",{"data-slot":"table-body",className:ne("[&_tr:last-child]:border-0",e),...t})}function Pn({className:e,...t}){return s.jsx("tr",{"data-slot":"table-row",className:ne("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function uc({className:e,...t}){return s.jsx("th",{"data-slot":"table-head",className:ne("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function Zr({className:e,...t}){return s.jsx("td",{"data-slot":"table-cell",className:ne("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}var sW=Symbol("radix.slottable");function oW(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=sW,t}var E3="AlertDialog",[iW]=cr(E3,[aN]),Wo=aN(),w3=e=>{const{__scopeAlertDialog:t,...n}=e,r=Wo(t);return s.jsx(cg,{...r,...n,modal:!0})};w3.displayName=E3;var lW="AlertDialogTrigger",cW=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Wo(n);return s.jsx(tF,{...o,...r,ref:t})});cW.displayName=lW;var uW="AlertDialogPortal",R3=e=>{const{__scopeAlertDialog:t,...n}=e,r=Wo(t);return s.jsx(ug,{...r,...n})};R3.displayName=uW;var dW="AlertDialogOverlay",j3=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Wo(n);return s.jsx(dg,{...o,...r,ref:t})});j3.displayName=dW;var mu="AlertDialogContent",[fW,hW]=iW(mu),mW=oW("AlertDialogContent"),T3=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...o}=e,l=Wo(n),c=m.useRef(null),d=dt(t,c),f=m.useRef(null);return s.jsx(QU,{contentName:mu,titleName:_3,docsSlug:"alert-dialog",children:s.jsx(fW,{scope:n,cancelRef:f,children:s.jsxs(fg,{role:"alertdialog",...l,...o,ref:d,onOpenAutoFocus:Te(o.onOpenAutoFocus,h=>{var g;h.preventDefault(),(g=f.current)==null||g.focus({preventScroll:!0})}),onPointerDownOutside:h=>h.preventDefault(),onInteractOutside:h=>h.preventDefault(),children:[s.jsx(mW,{children:r}),s.jsx(gW,{contentRef:c})]})})})});T3.displayName=mu;var _3="AlertDialogTitle",N3=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Wo(n);return s.jsx(Q1,{...o,...r,ref:t})});N3.displayName=_3;var A3="AlertDialogDescription",D3=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Wo(n);return s.jsx(X1,{...o,...r,ref:t})});D3.displayName=A3;var pW="AlertDialogAction",O3=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Wo(n);return s.jsx(hg,{...o,...r,ref:t})});O3.displayName=pW;var M3="AlertDialogCancel",I3=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=hW(M3,n),l=Wo(n),c=dt(t,o);return s.jsx(hg,{...l,...r,ref:c})});I3.displayName=M3;var gW=({contentRef:e})=>{const t=`\`${mu}\` requires a description for the component to be accessible for screen reader users.
688
+
689
+ You can add a description to the \`${mu}\` by passing a \`${A3}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
690
+
691
+ Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${mu}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
692
+
693
+ For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return m.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},yW=w3,vW=R3,xW=j3,bW=T3,SW=O3,CW=I3,EW=N3,wW=D3;function RW({...e}){return s.jsx(yW,{"data-slot":"alert-dialog",...e})}function jW({...e}){return s.jsx(vW,{"data-slot":"alert-dialog-portal",...e})}function TW({className:e,...t}){return s.jsx(xW,{"data-slot":"alert-dialog-overlay",className:ne("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function _W({className:e,...t}){return s.jsxs(jW,{children:[s.jsx(TW,{}),s.jsx(bW,{"data-slot":"alert-dialog-content",className:ne("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...t})]})}function NW({className:e,...t}){return s.jsx("div",{"data-slot":"alert-dialog-header",className:ne("flex flex-col gap-2 text-center sm:text-left",e),...t})}function AW({className:e,...t}){return s.jsx("div",{"data-slot":"alert-dialog-footer",className:ne("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function DW({className:e,...t}){return s.jsx(EW,{"data-slot":"alert-dialog-title",className:ne("text-lg font-semibold",e),...t})}function OW({className:e,...t}){return s.jsx(wW,{"data-slot":"alert-dialog-description",className:ne("text-muted-foreground text-sm",e),...t})}function MW({className:e,...t}){return s.jsx(SW,{className:ne(Z1(),e),...t})}function IW({className:e,...t}){return s.jsx(CW,{className:ne(Z1({variant:"outline"}),e),...t})}const k3=["facebook","linkedin","tiktok","microsoft","connector","sql","blank"],L3={facebook:{title:"Facebook Ads",datamartTitle:"Facebook Ads Data Mart",connectorSourceTitle:"FacebookMarketing",definitionType:Fe.CONNECTOR,icon:hG},linkedin:{title:"LinkedIn Ads",datamartTitle:"LinkedIn Ads Data Mart",connectorSourceTitle:"LinkedInAds",definitionType:Fe.CONNECTOR,icon:mG},tiktok:{title:"TikTok Ads",datamartTitle:"TikTok Ads Data Mart",connectorSourceTitle:"TikTokAds",definitionType:Fe.CONNECTOR,icon:pG},microsoft:{title:"Microsoft Ads",datamartTitle:"Microsoft Ads Data Mart",connectorSourceTitle:"MicrosoftAds",definitionType:Fe.CONNECTOR,icon:gG},connector:{title:"Other connector",datamartTitle:"Connector-based Data Mart",definitionType:Fe.CONNECTOR,icon:B1},sql:{title:"SQL query",datamartTitle:"SQL-based Data Mart",definitionType:Fe.SQL,icon:$1},blank:{title:"Blank Data Mart",datamartTitle:"New Data Mart",icon:up}},Pj=k3.map(e=>({key:e,...L3[e]}));function kW(e){if(!e||!k3.includes(e))return;const t=e;return{key:t,...L3[t]}}function LW({children:e,className:t="",...n}){return s.jsx("div",{className:"dm-card",children:s.jsx("div",{className:ne("-m-4 flex flex-col items-start justify-between gap-12 overflow-hidden px-8 py-16 lg:flex-row-reverse lg:px-16 lg:py-24 2xl:items-center",t),...n,children:e})})}function PW({children:e,className:t="",...n}){return s.jsx("div",{className:ne("pb-2",t),...n,children:e})}function UW({children:e,className:t="",...n}){return s.jsx("h2",{className:ne("mb-6 text-4xl font-semibold xl:text-5xl",t),...n,children:e})}function FW({children:e,className:t="",...n}){return s.jsx("p",{className:ne("text-muted-foreground text-lg",t),...n,children:e})}function VW({children:e,rings:t=7,className:n="",...r}){return s.jsxs("div",{className:ne("relative flex w-full justify-center lg:w-[30%] 2xl:w-[35%]",n),...r,children:[s.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:Array.from({length:t},(o,l)=>{const c=`${(16*(l+1)+24).toString()}vmin`;return s.jsx("div",{className:"animate-ring-pulse",style:{height:c,width:c,animationDelay:`${(l*.3).toString()}s`,animationDuration:"4s",opacity:.2+l*.1,filter:l===0?"blur(1px)":"none"}},l)})}),s.jsx("div",{className:"animate-glow-burst"}),s.jsx("div",{className:"animate-icon-entrance","aria-label":"Illustration",children:e})]})}function zW({children:e,className:t="",...n}){return s.jsx("div",{className:ne("w-full space-y-8 lg:w-[70%] 2xl:w-[65%]",t),...n,children:e})}function Xx({separator:e=!0,children:t,className:n="",...r}){return s.jsx("section",{className:ne("relative pb-10",e&&"after:from-border after:absolute after:bottom-0 after:left-0 after:h-px after:w-full after:bg-gradient-to-r after:to-transparent",n),...r,children:t})}function Uj({children:e,className:t="",...n}){return s.jsx("h3",{className:ne("mb-4 text-xl font-medium",t),...n,children:e})}function Jx({children:e,className:t="",...n}){return s.jsx("div",{className:ne("flex flex-wrap items-center gap-4",t),...n,children:e})}function Lm({href:e,icon:t,title:n,variant:r="outline",size:o,className:l="",target:c,...d}){const f=r==="outline"?"lg":"sm",h=s.jsxs("span",{className:ne("flex items-center gap-2"),children:[t,n]});return e?s.jsx(Se,{asChild:!0,variant:r,size:o??f,className:ne(r==="ghost"?"text-muted-foreground":"",l),...d,children:s.jsx(ha,{to:e,target:c,children:h})}):s.jsx(Se,{variant:r,size:o??f,className:l,...d,children:h})}function HW(){const{scope:e}=Yo(),t=Pj.filter(r=>r.definitionType===Fe.CONNECTOR),n=Pj.filter(r=>r.definitionType!==Fe.CONNECTOR);return s.jsxs(LW,{children:[s.jsx(VW,{children:s.jsx(fG,{className:"animate-icon-entrance","aria-label":"Data Mart creation illustration"})}),s.jsxs(zW,{children:[s.jsxs(PW,{children:[s.jsx(UW,{children:"Let’s Build Your First Data Mart"}),s.jsx(FW,{children:"A Data Mart is the key element of self-service analytics — it provides both control for data analyst and freedom for business users. To get started, connect the source you need or query the data you already have in storage"})]}),s.jsxs(Xx,{children:[s.jsx(Uj,{children:"Connect a data source"}),s.jsx(Jx,{children:t.map(r=>s.jsx(Lm,{href:e(`/data-marts/create?preset=${r.key}`),icon:r.icon&&s.jsx(r.icon,{className:"h-4 w-4"}),title:r.title,variant:"outline"},r.key))})]}),s.jsxs(Xx,{children:[s.jsx(Uj,{children:"Use existing SQL or start from scratch"}),s.jsx(Jx,{children:n.map((r,o)=>s.jsxs(s.Fragment,{children:[s.jsx(Lm,{href:e(`/data-marts/create?preset=${r.key}`),icon:r.icon&&s.jsx(r.icon,{className:"h-4 w-4"}),title:r.title,variant:"outline"},r.key),o<n.length-1&&s.jsx("span",{className:"text-muted-foreground text-sm",children:"or"})]}))})]}),s.jsx(Xx,{separator:!1,children:s.jsxs(Jx,{children:[s.jsx(Lm,{href:"https://www.youtube.com/playlist?list=PLvcNVLV5BVbHHCekyAZBEIVnlC4i1qcHx",icon:s.jsx(mL,{className:"h-4 w-4"}),title:"Watch a 2-minute demo",variant:"ghost",target:"_blank"}),s.jsx(Lm,{href:"https://docs.owox.com/docs/getting-started/core-concepts/?utm_source=owox_data_marts&utm_medium=empty_data_marts_page&utm_campaign=help_buttons",icon:s.jsx(Rk,{className:"h-4 w-4"}),title:"Core concepts",variant:"ghost",target:"_blank"})]})})]})]})}function $W(){return s.jsx(hs,{className:"bg-muted/50 h-72 w-full rounded-md border-b border-gray-200 dark:border-white/10 dark:bg-white/4"})}const Yc={DEFAULT_SORTING_COLUMN:"createdAt",DEFAULT_EXCLUDED_COLUMNS:["actions"],STORAGE_KEYS:{SORTING_SUFFIX:"-sorting",COLUMN_VISIBILITY_SUFFIX:"-column-visibility"}},BW={extractColumnIds:e=>e.map(t=>{if(t.id)return t.id;if("accessorKey"in t&&typeof t.accessorKey=="string")return t.accessorKey}).filter(t=>t!==void 0)};function Vu({columns:e,storageKeyPrefix:t,defaultSortingColumn:n=Yc.DEFAULT_SORTING_COLUMN,defaultColumnVisibility:r={},excludedColumnsFromSorting:o=Yc.DEFAULT_EXCLUDED_COLUMNS,excludedColumnsFromVisibility:l=Yc.DEFAULT_EXCLUDED_COLUMNS}){const c=m.useMemo(()=>({SORTING:`${t}${Yc.STORAGE_KEYS.SORTING_SUFFIX}`,COLUMN_VISIBILITY:`${t}${Yc.STORAGE_KEYS.COLUMN_VISIBILITY_SUFFIX}`}),[t]),d=m.useMemo(()=>BW.extractColumnIds(e),[e]),f=m.useMemo(()=>d.filter(S=>!o.includes(S)),[d,o]),h=m.useCallback(()=>{const S=Hs.get(c.SORTING,"json");return S&&Array.isArray(S)&&S.length>0?S:[{id:f.includes(n)?n:f[0]??Yc.DEFAULT_SORTING_COLUMN,desc:!0}]},[c.SORTING,f,n]),g=m.useCallback(()=>{const S=Hs.get(c.COLUMN_VISIBILITY,"json");if(S&&typeof S=="object"&&!Array.isArray(S)){const C={};for(const R of d)l.includes(R)||(C[R]=S[R]);return C}return r},[c.COLUMN_VISIBILITY,d,l,r]),[y,v]=m.useState(h),[b,w]=m.useState(g);return m.useEffect(()=>{y.length>0&&f.includes(y[0].id)&&Hs.set(c.SORTING,y)},[y,f,c.SORTING]),m.useEffect(()=>{const S={};for(const C of d){if(l.includes(C))continue;const R=b[C];typeof R=="boolean"&&(S[C]=R)}Hs.set(c.COLUMN_VISIBILITY,S)},[b,d,l,c.COLUMN_VISIBILITY]),{sorting:y,setSorting:v,columnVisibility:b,setColumnVisibility:w}}function GW({columns:e,data:t,deleteDataMart:n,refetchDataMarts:r,isLoading:o}){var O;const{navigate:l,scope:c}=Yo(),{sorting:d,setSorting:f,columnVisibility:h,setColumnVisibility:g}=Vu({columns:e,storageKeyPrefix:"data-mart-list",defaultColumnVisibility:{triggersCount:!1,reportsCount:!1}}),[y,v]=m.useState([]),[b,w]=m.useState({}),[S,C]=m.useState(!1),[R,j]=m.useState(!1),_=async()=>{try{j(!0);const M=A.getSelectedRowModel().rows.map(F=>F.original.id);for(const F of M)await n(F);on.success(`Successfully deleted ${String(M.length)} data mart${M.length!==1?"s":""}`),w({}),await r()}catch(T){console.error("Error deleting data marts:",T),on.error("Failed to delete some data marts. Please try again.")}finally{j(!1),C(!1)}},D=Object.keys(b).length>0,A=oc({data:t,columns:[{id:"select",size:40,header:({table:T})=>s.jsx("button",{type:"button",role:"checkbox","aria-checked":T.getIsAllRowsSelected(),"data-state":T.getIsAllRowsSelected()?"checked":"unchecked","aria-label":"Select all rows",className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:T.getToggleAllRowsSelectedHandler(),children:T.getIsAllRowsSelected()&&s.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:s.jsx(lr,{className:"size-3.5 text-white"})})}),cell:({row:T})=>s.jsx("button",{type:"button",role:"checkbox","aria-checked":T.getIsSelected(),"data-state":T.getIsSelected()?"checked":"unchecked","aria-label":"Select row",className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:T.getToggleSelectedHandler(),children:T.getIsSelected()&&s.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:s.jsx(lr,{className:"size-3.5 text-white"})})}),enableSorting:!1,enableHiding:!1},...e],getCoreRowModel:sc(),getPaginationRowModel:Ug(),onSortingChange:f,getSortedRowModel:Fu(),onColumnFiltersChange:v,getFilteredRowModel:Qf(),onColumnVisibilityChange:g,onRowSelectionChange:w,state:{sorting:d,columnFilters:y,columnVisibility:h,rowSelection:b},enableRowSelection:!0});return o?s.jsx("div",{children:s.jsx($W,{})}):t.length?s.jsxs("div",{className:"dm-card",children:[s.jsxs("div",{className:"dm-card-toolbar",children:[s.jsxs("div",{className:"dm-card-toolbar-left",children:[D&&s.jsx(Se,{variant:"destructive",size:"sm",className:"dm-card-toolbar-btn-delete",onClick:()=>{C(!0)},disabled:R,children:s.jsx(Xs,{className:"h-4 w-4"})}),s.jsxs("div",{className:"dm-card-toolbar-search",children:[s.jsx(Jl,{className:"dm-card-toolbar-search-icon"}),s.jsx(Ht,{placeholder:"Search by title",value:(O=A.getColumn("title"))==null?void 0:O.getFilterValue(),onChange:T=>{var M;return(M=A.getColumn("title"))==null?void 0:M.setFilterValue(T.target.value)},className:"dm-card-toolbar-search-input"})]})]}),s.jsx("div",{className:"dm-card-toolbar-right",children:s.jsx(ha,{to:c("/data-marts/create"),children:s.jsxs(Se,{variant:"outline",className:"dm-card-toolbar-btn-primary",children:[s.jsx(Pa,{className:"h-4 w-4"}),"New Data Mart"]})})})]}),s.jsx("div",{className:"dm-card-table-wrap",children:s.jsxs(ic,{className:"dm-card-table",role:"table","aria-label":"Data Marts table",children:[s.jsx(lc,{className:"dm-card-table-header",children:A.getHeaderGroups().map(T=>s.jsx(Pn,{className:"dm-card-table-header-row",children:T.headers.map(M=>s.jsx(uc,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",style:M.column.id==="select"?{width:40,minWidth:40,maxWidth:40}:M.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(M.getSize())}%`},children:M.isPlaceholder?null:ju(M.column.columnDef.header,M.getContext())},M.id))},T.id))}),s.jsx(cc,{className:"dm-card-table-body",children:A.getRowModel().rows.length?A.getRowModel().rows.map(T=>s.jsx(Pn,{"data-state":T.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:M=>{if(M.target instanceof HTMLElement&&(M.target.closest('[role="checkbox"]')||M.target.closest(".actions-cell")||M.target.closest('[role="menuitem"]')||M.target.closest('[data-state="open"]')))return;const F=T.original.id;l(`/data-marts/${F}/data-setup`)},children:T.getVisibleCells().map(M=>s.jsx(Zr,{className:`[&:has([role=checkbox])]pr-0 px-6 whitespace-normal [&>[role=checkbox]]:translate-y-[2px] ${M.column.id==="actions"?"actions-cell":""} ${M.column.id==="createdAt"?"whitespace-nowrap":""}`,style:M.column.id==="select"?{width:40,minWidth:40,maxWidth:40}:M.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(M.column.getSize())}%`},children:ju(M.column.columnDef.cell,M.getContext())},M.id))},T.id)):s.jsx(Pn,{children:s.jsx(Zr,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),s.jsxs("div",{className:"dm-card-pagination",children:[s.jsx(Se,{variant:"outline",size:"sm",onClick:()=>{A.previousPage()},disabled:!A.getCanPreviousPage(),children:"Previous"}),s.jsx(Se,{variant:"outline",size:"sm",onClick:()=>{A.nextPage()},disabled:!A.getCanNextPage(),children:"Next"})]}),s.jsx(RW,{open:S,onOpenChange:C,children:s.jsxs(_W,{children:[s.jsxs(NW,{children:[s.jsx(DW,{children:"Are you sure?"}),s.jsxs(OW,{children:["You're about to delete ",Object.keys(b).length," selected data mart",Object.keys(b).length!==1?"s":"",". This action cannot be undone."]})]}),s.jsxs(AW,{children:[s.jsx(IW,{disabled:R,children:"Cancel"}),s.jsx(MW,{onClick:()=>{_()},disabled:R,className:"bg-destructive hover:bg-destructive/90",children:R?"Deleting...":"Delete"})]})]})})]}):s.jsx(HW,{})}function _l({column:e,children:t}){return s.jsxs(Se,{variant:"ghost",onClick:()=>{e.toggleSorting(e.getIsSorted()==="asc")},className:"group dm-card-table-header-row-btn",children:[t,s.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[e.getIsSorted()==="asc"&&s.jsx(ns,{className:"text-foreground h-4 w-4"}),e.getIsSorted()==="desc"&&s.jsx(ka,{className:"text-foreground h-4 w-4"}),!e.getIsSorted()&&s.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:s.jsx(ns,{className:"text-muted-foreground h-4 w-4"})})]})]})}function Qb({...e}){return s.jsx(cg,{"data-slot":"dialog",...e})}function qW({...e}){return s.jsx(ug,{"data-slot":"dialog-portal",...e})}function ZW({className:e,...t}){return s.jsx(dg,{"data-slot":"dialog-overlay",className:ne("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function Xb({className:e,children:t,showCloseButton:n=!0,...r}){return s.jsxs(qW,{"data-slot":"dialog-portal",children:[s.jsx(ZW,{}),s.jsxs(fg,{"data-slot":"dialog-content",className:ne("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...r,children:[t,n&&s.jsxs(hg,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[s.jsx(xu,{}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Jb({className:e,...t}){return s.jsx("div",{"data-slot":"dialog-header",className:ne("flex flex-col gap-2 text-center sm:text-left",e),...t})}function KW({className:e,...t}){return s.jsx("div",{"data-slot":"dialog-footer",className:ne("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function eS({className:e,...t}){return s.jsx(Q1,{"data-slot":"dialog-title",className:ne("text-lg leading-none font-semibold",e),...t})}function tS({className:e,...t}){return s.jsx(X1,{"data-slot":"dialog-description",className:ne("text-muted-foreground text-sm",e),...t})}const YW=_f("",{variants:{variant:{brand:"bg-primary text-white shadow-xs hover:bg-primary-hover focus-visible:ring-brand-blue-200 dark:focus-visible:ring-brand-blue-400"}}});function pu({className:e,variant:t,...n}){return t==="brand"?s.jsx(Se,{variant:"default",className:ne(YW({variant:t}),e),...n}):s.jsx(Se,{variant:t,className:e,...n})}const Tr=({open:e,onOpenChange:t,title:n,description:r,confirmLabel:o="Confirm",cancelLabel:l,onConfirm:c,onCancel:d,variant:f="destructive",children:h})=>{const g=()=>{t(!1),d==null||d()};return s.jsx(Qb,{open:e,onOpenChange:t,children:s.jsxs(Xb,{children:[s.jsxs(Jb,{children:[s.jsx(eS,{children:n}),s.jsx(tS,{children:r})]}),h,s.jsxs(KW,{children:[l&&s.jsx(pu,{variant:"secondary",onClick:g,children:l}),s.jsx(pu,{variant:f,onClick:c,children:o})]})]})})},WW=({row:e,onDeleteSuccess:t})=>{const{scope:n}=Yo(),[r,o]=m.useState(!1),[l,c]=m.useState(!1),{deleteDataMart:d,refreshList:f}=h3(),h=async()=>{try{await d(e.original.id),o(!1),await f(),t==null||t()}catch(g){console.error("Failed to delete data mart:",g)}};return s.jsxs("div",{className:"text-right",children:[s.jsxs(ur,{open:l,onOpenChange:c,children:[s.jsx(dr,{asChild:!0,children:s.jsx(Se,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${l?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:s.jsx(pa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),s.jsxs(fr,{align:"end",children:[s.jsx(pt,{children:s.jsxs(ha,{to:n(`/data-marts/${e.original.id}/data-setup`),className:"flex gap-2 text-left",children:[s.jsx(Au,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),s.jsx("span",{children:"Edit"})]})}),s.jsx(ma,{}),s.jsxs(pt,{onClick:()=>{o(!0)},children:[s.jsx(Xs,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),s.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]}),s.jsx(Tr,{open:r,onOpenChange:o,title:"Delete Data Mart",description:"Are you sure you want to delete this data mart? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>void h(),variant:"destructive"})]})};var On=(e=>(e.TITLE="title",e.DEFINITION_TYPE="definitionType",e.STORAGE_TYPE="storageType",e.STATUS="status",e.TRIGGERS_COUNT="triggersCount",e.REPORTS_COUNT="reportsCount",e.CREATED_AT="createdAt",e))(On||{});const _i={[On.TITLE]:"Title",[On.DEFINITION_TYPE]:"Input Source",[On.STORAGE_TYPE]:"Storage",[On.STATUS]:"Status",[On.TRIGGERS_COUNT]:"Triggers",[On.REPORTS_COUNT]:"Reports",[On.CREATED_AT]:"Created at"};function QW({table:e}){return s.jsx("div",{className:"px-4 text-right",children:s.jsxs(ur,{children:[s.jsx(dr,{asChild:!0,children:s.jsx(Se,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:s.jsx(pa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),s.jsx(fr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>{const n=_i[t.id]||t.id;return s.jsx(pt,{className:"capitalize",children:s.jsxs("label",{className:"flex items-center space-x-2",children:[s.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&s.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:s.jsx(lr,{className:"size-3.5 text-white"})})}),s.jsx("span",{children:n})]})},t.id)})})]})})}const Fj={types:{[Fe.SQL]:{type:Fe.SQL,displayName:"SQL",icon:$1},[Fe.TABLE]:{type:Fe.TABLE,displayName:"Table",icon:yL},[Fe.VIEW]:{type:Fe.VIEW,displayName:"View",icon:Nk},[Fe.TABLE_PATTERN]:{type:Fe.TABLE_PATTERN,displayName:"Pattern",icon:P7},[Fe.CONNECTOR]:{type:Fe.CONNECTOR,displayName:"Connector",icon:B1}},getInfo(e){return e?this.types[e]:{type:null,displayName:"—",icon:()=>null}}},XW=({onDeleteSuccess:e,connectors:t=[]}={})=>[{accessorKey:On.TITLE,size:40,header:({column:n})=>s.jsx(_l,{column:n,children:_i[On.TITLE]}),cell:({row:n})=>s.jsx("div",{children:n.getValue("title")})},{accessorFn:n=>{const r=n.definitionType;if(r===Fe.CONNECTOR){const o=n.definition,l=t.find(c=>c.name===o.connector.source.name);return(l==null?void 0:l.displayName)??(l==null?void 0:l.name)??"Unknown"}else{const{displayName:o}=Fj.getInfo(r);return o}},id:On.DEFINITION_TYPE,size:15,header:({column:n})=>s.jsx(_l,{column:n,children:_i[On.DEFINITION_TYPE]}),cell:({row:n})=>{const r=n.original.definitionType;switch(r){case Fe.CONNECTOR:{const o=n.original.definition,l=t.find(c=>c.name===o.connector.source.name);return s.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[(l==null?void 0:l.logoBase64)&&s.jsx(rc,{base64:l.logoBase64,size:18}),(l==null?void 0:l.displayName)??"Unknown"]})}default:{const{displayName:o,icon:l}=Fj.getInfo(r);return s.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[s.jsx(l,{className:"h-4 w-4"}),o]})}}}},{accessorKey:On.STORAGE_TYPE,size:15,header:({column:n})=>s.jsx(_l,{column:n,children:_i[On.STORAGE_TYPE]}),cell:({row:n})=>{const r=n.getValue("storageType"),o=n.original.storageTitle,{displayName:l,icon:c}=nl.getInfo(r),d=o??l;return s.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[s.jsx(c,{size:18}),d]})}},{accessorKey:On.CREATED_AT,size:15,header:({column:n})=>s.jsx(_l,{column:n,children:_i[On.CREATED_AT]}),cell:({row:n})=>{const r=n.getValue("createdAt"),o=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(r);return s.jsx("div",{className:"text-muted-foreground",children:o})}},{accessorKey:On.STATUS,size:15,header:({column:n})=>s.jsx(_l,{column:n,children:_i[On.STATUS]}),cell:({row:n})=>{const r=n.getValue("status");return s.jsx(Kf,{type:aY(r.code),variant:"ghost",showIcon:!1,children:r.displayName})}},{accessorKey:On.TRIGGERS_COUNT,size:15,header:({column:n})=>s.jsx(_l,{column:n,children:_i[On.TRIGGERS_COUNT]}),cell:({row:n})=>{const r=n.getValue("triggersCount")>0?n.getValue("triggersCount"):"—";return s.jsx("div",{className:"text-muted-foreground",children:r})}},{accessorKey:On.REPORTS_COUNT,size:15,header:({column:n})=>s.jsx(_l,{column:n,children:_i[On.REPORTS_COUNT]}),cell:({row:n})=>{const r=n.getValue("reportsCount")>0?n.getValue("reportsCount"):"—";return s.jsx("div",{className:"text-muted-foreground",children:r})}},{id:"actions",size:80,header:({table:n})=>s.jsx(QW,{table:n}),cell:({row:n})=>s.jsx(WW,{row:n,onDeleteSuccess:e})}];var sr=(e=>(e.FETCH_CONNECTORS_START="FETCH_CONNECTORS_START",e.FETCH_CONNECTORS_SUCCESS="FETCH_CONNECTORS_SUCCESS",e.FETCH_CONNECTORS_ERROR="FETCH_CONNECTORS_ERROR",e.FETCH_CONNECTOR_SPECIFICATION_START="FETCH_CONNECTOR_SPECIFICATION_START",e.FETCH_CONNECTOR_SPECIFICATION_SUCCESS="FETCH_CONNECTOR_SPECIFICATION_SUCCESS",e.FETCH_CONNECTOR_SPECIFICATION_ERROR="FETCH_CONNECTOR_SPECIFICATION_ERROR",e.FETCH_CONNECTOR_FIELDS_START="FETCH_CONNECTOR_FIELDS_START",e.FETCH_CONNECTOR_FIELDS_SUCCESS="FETCH_CONNECTOR_FIELDS_SUCCESS",e.FETCH_CONNECTOR_FIELDS_ERROR="FETCH_CONNECTOR_FIELDS_ERROR",e))(sr||{});const JW={connectors:[],connectorSpecification:null,connectorFields:null,loading:!1,loadingSpecification:!1,loadingFields:!1,error:null};function eQ(e,t){switch(t.type){case sr.FETCH_CONNECTORS_START:return{...e,loading:!0,error:null};case sr.FETCH_CONNECTORS_SUCCESS:return{...e,connectors:t.payload,loading:!1,error:null};case sr.FETCH_CONNECTORS_ERROR:return{...e,loading:!1,error:t.payload};case sr.FETCH_CONNECTOR_SPECIFICATION_START:return{...e,loadingSpecification:!0,error:null};case sr.FETCH_CONNECTOR_SPECIFICATION_SUCCESS:return{...e,connectorSpecification:t.payload,loadingSpecification:!1,error:null};case sr.FETCH_CONNECTOR_SPECIFICATION_ERROR:return{...e,loadingSpecification:!1,error:t.payload};case sr.FETCH_CONNECTOR_FIELDS_START:return{...e,loadingFields:!0,error:null};case sr.FETCH_CONNECTOR_FIELDS_SUCCESS:return{...e,connectorFields:t.payload,loadingFields:!1,error:null};case sr.FETCH_CONNECTOR_FIELDS_ERROR:return{...e,loadingFields:!1,error:t.payload};default:return e}}const P3=m.createContext(void 0);function Tu({children:e}){const[t,n]=m.useReducer(eQ,JW);return s.jsx(P3.Provider,{value:{state:t,dispatch:n},children:e})}function tQ(){const e=m.useContext(P3);if(!e)throw new Error("useConnectorContext must be used within a ConnectorContextProvider");return e}var fs=(e=>(e.STRING="string",e.NUMBER="number",e.BOOLEAN="boolean",e.OBJECT="object",e.ARRAY="array",e.DATE="date",e))(fs||{});class rp extends ac{constructor(){super("/connectors")}async getAvailableConnectors(){return this.get("/")}async getConnectorSpecification(t){return this.get(`/${t}/specification`)}async getConnectorFields(t){return this.get(`/${t}/fields`)}}function U3(e){return e.map(t=>({name:t.name,displayName:t.title??t.name,description:t.description??"",logoBase64:t.logo,docUrl:t.docUrl})).sort((t,n)=>t.displayName.localeCompare(n.displayName))}function dc(){const{state:e,dispatch:t}=tQ(),n=m.useMemo(()=>U3(e.connectors),[e.connectors]),r=m.useCallback(async()=>{t({type:sr.FETCH_CONNECTORS_START});try{const d=await new rp().getAvailableConnectors();t({type:sr.FETCH_CONNECTORS_SUCCESS,payload:d})}catch(c){const d=c instanceof Error?c.message:"Unknown error";t({type:sr.FETCH_CONNECTORS_ERROR,payload:d}),Ue({event:"connector_error",category:"Connector",action:"ListError",label:d})}},[t]),o=m.useCallback(async c=>{t({type:sr.FETCH_CONNECTOR_SPECIFICATION_START});try{const f=await new rp().getConnectorSpecification(c);t({type:sr.FETCH_CONNECTOR_SPECIFICATION_SUCCESS,payload:f})}catch(d){const f=d instanceof Error?d.message:"Unknown error";t({type:sr.FETCH_CONNECTOR_SPECIFICATION_ERROR,payload:f}),Ue({event:"connector_error",category:"Connector",action:"SpecificationError",label:c})}},[t]),l=m.useCallback(async c=>{t({type:sr.FETCH_CONNECTOR_FIELDS_START});try{const f=await new rp().getConnectorFields(c);t({type:sr.FETCH_CONNECTOR_FIELDS_SUCCESS,payload:f})}catch(d){const f=d instanceof Error?d.message:"Unknown error";t({type:sr.FETCH_CONNECTOR_FIELDS_ERROR,payload:f}),Ue({event:"connector_error",category:"Connector",action:"FieldsError",label:c})}},[t]);return{connectors:n,connectorSpecification:e.connectorSpecification,connectorFields:e.connectorFields,loading:e.loading,loadingSpecification:e.loadingSpecification,loadingFields:e.loadingFields,error:e.error,fetchAvailableConnectors:r,fetchConnectorSpecification:o,fetchConnectorFields:l}}const nQ=()=>{const{items:e,loadDataMarts:t,deleteDataMart:n,refreshList:r,loading:o}=h3(),{connectors:l,fetchAvailableConnectors:c}=dc();return m.useEffect(()=>{c()},[c]),m.useEffect(()=>{t()},[t]),s.jsx(GW,{columns:XW({connectors:l}),data:e,deleteDataMart:n,refetchDataMarts:r,isLoading:o})};function Vj(){return s.jsxs("div",{className:"dm-page",children:[s.jsx("header",{className:"dm-page-header",children:s.jsx("h1",{className:"dm-page-header-title",children:"Data Marts"})}),s.jsx("div",{className:"dm-page-content",children:s.jsx(NZ,{children:s.jsx(Tu,{children:s.jsx(nQ,{})})})})]})}const F3=m.createContext(void 0),Hd=e=>{const t=uY(e);return{...e,canPublish:t.length===0,validationErrors:t}};var es=(e=>(e.CONNECTED="CONNECTED",e.CONNECTED_WITH_DEFINITION_MISMATCH="CONNECTED_WITH_DEFINITION_MISMATCH",e.DISCONNECTED="DISCONNECTED",e))(es||{}),bf=(e=>(e.NULLABLE="NULLABLE",e.REQUIRED="REQUIRED",e.REPEATED="REPEATED",e))(bf||{}),$n=(e=>(e.INTEGER="INTEGER",e.FLOAT="FLOAT",e.NUMERIC="NUMERIC",e.BIGNUMERIC="BIGNUMERIC",e.STRING="STRING",e.BYTES="BYTES",e.BOOLEAN="BOOLEAN",e.DATE="DATE",e.TIME="TIME",e.DATETIME="DATETIME",e.TIMESTAMP="TIMESTAMP",e.GEOGRAPHY="GEOGRAPHY",e.JSON="JSON",e.RECORD="RECORD",e.STRUCT="STRUCT",e.RANGE="RANGE",e.INTERVAL="INTERVAL",e))($n||{}),nS=(e=>(e.BOOLEAN="BOOLEAN",e.TINYINT="TINYINT",e.SMALLINT="SMALLINT",e.INTEGER="INTEGER",e.BIGINT="BIGINT",e.REAL="REAL",e.FLOAT="FLOAT",e.DOUBLE="DOUBLE",e.DECIMAL="DECIMAL",e.CHAR="CHAR",e.VARCHAR="VARCHAR",e.STRING="STRING",e.BINARY="BINARY",e.VARBINARY="VARBINARY",e.DATE="DATE",e.TIME="TIME",e.TIMESTAMP="TIMESTAMP",e.TIME_WITH_TIME_ZONE="TIME WITH TIME ZONE",e.TIMESTAMP_WITH_TIME_ZONE="TIMESTAMP WITH TIME ZONE",e.INTERVAL_YEAR_TO_MONTH="INTERVAL YEAR TO MONTH",e.INTERVAL_DAY_TO_SECOND="INTERVAL DAY TO SECOND",e.ARRAY="ARRAY",e.MAP="MAP",e.STRUCT="STRUCT",e.ROW="ROW",e.JSON="JSON",e))(nS||{});const rQ=(e,t)=>!!(e!==Fe.CONNECTOR||t!==null&&t.fields.some(r=>r.status===es.CONNECTED)),V3={dataMart:null,isLoading:!1,error:null,runs:[]};function aQ(e,t){switch(t.type){case"FETCH_DATA_MART_START":case"CREATE_DATA_MART_START":case"UPDATE_DATA_MART_START":case"UPDATE_DATA_MART_TITLE_START":case"UPDATE_DATA_MART_DESCRIPTION_START":case"UPDATE_DATA_MART_DEFINITION_START":case"DELETE_DATA_MART_START":case"PUBLISH_DATA_MART_START":case"RUN_DATA_MART_START":case"ACTUALIZE_DATA_MART_SCHEMA_START":case"UPDATE_DATA_MART_SCHEMA_START":case"FETCH_DATA_MART_RUNS_START":case"LOAD_MORE_DATA_MART_RUNS_START":return{...e,isLoading:!0,error:null};case"CREATE_DATA_MART_SUCCESS":return{...e,isLoading:!1,error:null};case"FETCH_DATA_MART_SUCCESS":case"UPDATE_DATA_MART_SUCCESS":case"PUBLISH_DATA_MART_SUCCESS":case"ACTUALIZE_DATA_MART_SCHEMA_SUCCESS":case"UPDATE_DATA_MART_SCHEMA_SUCCESS":return{...e,isLoading:!1,error:null,dataMart:Hd(t.payload)};case"UPDATE_DATA_MART_TITLE_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:Hd({...e.dataMart,title:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_DESCRIPTION_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:Hd({...e.dataMart,description:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_STORAGE":return e.dataMart?{...e,dataMart:Hd({...e.dataMart,storage:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_DEFINITION_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:Hd({...e.dataMart,definitionType:t.payload.definitionType,definition:t.payload.definition,modifiedAt:new Date})}:e;case"DELETE_DATA_MART_SUCCESS":return{...e,isLoading:!1,error:null,dataMart:null};case"RUN_DATA_MART_SUCCESS":return{...e,isLoading:!1,error:null};case"FETCH_DATA_MART_RUNS_SUCCESS":return{...e,isLoading:!1,error:null,runs:t.payload};case"LOAD_MORE_DATA_MART_RUNS_SUCCESS":return{...e,isLoading:!1,error:null,runs:[...e.runs,...t.payload]};case"FETCH_DATA_MART_ERROR":case"CREATE_DATA_MART_ERROR":case"UPDATE_DATA_MART_ERROR":case"UPDATE_DATA_MART_TITLE_ERROR":case"UPDATE_DATA_MART_DESCRIPTION_ERROR":case"UPDATE_DATA_MART_DEFINITION_ERROR":case"DELETE_DATA_MART_ERROR":case"PUBLISH_DATA_MART_ERROR":case"RUN_DATA_MART_ERROR":case"ACTUALIZE_DATA_MART_SCHEMA_ERROR":case"UPDATE_DATA_MART_SCHEMA_ERROR":case"FETCH_DATA_MART_RUNS_ERROR":case"LOAD_MORE_DATA_MART_RUNS_ERROR":return{...e,isLoading:!1,error:t.payload};case"RESET":return V3;default:return e}}function Qo(){const e=m.useContext(F3);if(e===void 0)throw new Error("useDataMartContext must be used within a DataMartProvider");return e}class sQ{mapFromDto(t){const n=t.config,r=t.credentials;let o="";return r&&Object.keys(r).length>0&&(o=JSON.stringify(r,null,2)),{id:t.id,title:t.title,type:ke.GOOGLE_BIGQUERY,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt),credentials:{serviceAccount:o},config:{projectId:(n==null?void 0:n.projectId)??"",location:(n==null?void 0:n.location)??""}}}mapToUpdateRequest(t){const n={config:{projectId:t.config.projectId,location:t.config.location}};return t.credentials&&(n.credentials={...JSON.parse(t.credentials.serviceAccount)}),n}}class oQ{mapFromDto(t){const n=t.config,r=t.credentials;return{id:t.id,title:t.title,type:ke.AWS_ATHENA,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt),credentials:{accessKeyId:(r==null?void 0:r.accessKeyId)??"",secretAccessKey:(r==null?void 0:r.secretAccessKey)??""},config:{region:(n==null?void 0:n.region)??"",outputBucket:(n==null?void 0:n.outputBucket)??""}}}mapToUpdateRequest(t){const n={config:{region:t.config.region,outputBucket:t.config.outputBucket}};return t.credentials&&(n.credentials={accessKeyId:t.credentials.accessKeyId,secretAccessKey:t.credentials.secretAccessKey}),n}}const z3={getMapper(e){switch(e){case ke.GOOGLE_BIGQUERY:return new sQ;case ke.AWS_ATHENA:return new oQ;default:throw new Error(`Unknown storage type: ${e}`)}}};function ap(e){return z3.getMapper(e.type).mapFromDto(e)}function iQ(e){const t=z3.getMapper(e.type);return{title:e.title,...t.mapToUpdateRequest(e)}}function lQ(e){return{id:e.id,type:e.type,title:e.title,createdAt:new Date(e.createdAt),modifiedAt:new Date(e.modifiedAt)}}function cQ(e){return{type:e}}let Pm=null;async function uQ(){if(Pm)return Pm;const e=await dQ();return Pm=U3(e),Pm}async function dQ(){return await new rp().getAvailableConnectors()}async function fQ(e){const t=await uQ();return t.length===0?null:t.find(r=>r.name===e)??null}function hQ(e,t){const n=t.find(r=>r.name===e.source.name);return(n==null?void 0:n.displayName)??e.source.name}function mQ(e){return{sqlQuery:e.sqlQuery}}function pQ(e){return{sqlQuery:e.sqlQuery}}function gQ(e){return{fullyQualifiedName:e.fullyQualifiedName}}function yQ(e){return{fullyQualifiedName:e.fullyQualifiedName}}function vQ(e){return{fullyQualifiedName:e.fullyQualifiedName}}function xQ(e){return{fullyQualifiedName:e.fullyQualifiedName}}function bQ(e){return{pattern:e.pattern}}function SQ(e){return{pattern:e.pattern}}function CQ(e){return{connector:{source:{name:e.connector.source.name,configuration:e.connector.source.configuration,node:e.connector.source.node,fields:e.connector.source.fields},storage:{fullyQualifiedName:e.connector.storage.fullyQualifiedName}}}}function EQ(e){const t=e.connector;return{connector:{source:{name:t.source.name,configuration:t.source.configuration,node:t.source.node,fields:t.source.fields},storage:{fullyQualifiedName:t.storage.fullyQualifiedName}}}}async function wQ(e,t){if(!e||!t)return null;switch(e){case Fe.SQL:return pQ(t);case Fe.TABLE:return yQ(t);case Fe.VIEW:return xQ(t);case Fe.TABLE_PATTERN:return SQ(t);case Fe.CONNECTOR:{const n=EQ(t);return n.connector.info=await fQ(n.connector.source.name),n}default:return console.warn(`Unknown definition type: ${String(e)}`),null}}async function Wc(e){const t={id:e.id,title:e.title,description:e.description,status:HA.getInfo(e.status),storage:ap(e.storage),definitionType:e.definitionType,definition:await wQ(e.definitionType,e.definition),schema:e.schema,connectorState:e.connectorState??null,createdAt:new Date(e.createdAt),modifiedAt:new Date(e.modifiedAt),canPublish:!1,canActualizeSchema:!1,validationErrors:[]};return t.canActualizeSchema=rQ(t.definitionType,t.schema),t}function RQ(e){return{id:e.id,title:e.title}}const jQ=e=>({id:e.id,status:e.status,createdAt:new Date(e.createdAt),logs:e.logs??[],errors:e.errors??[],definitionRun:e.definitionRun,type:e.type,triggerType:e.runType,startedAt:e.startedAt?new Date(e.startedAt):null,finishedAt:e.finishedAt?new Date(e.finishedAt):null,reportDefinition:e.reportDefinition?e.reportDefinition:null,reportId:e.reportId}),zj=e=>e.runs.map(jQ);function H3({children:e}){const[t,n]=m.useReducer(aQ,V3),r=m.useCallback(async A=>{try{n({type:"FETCH_DATA_MART_START"});const O=await sn.getDataMartById(A),T=await Wc(O);n({type:"FETCH_DATA_MART_SUCCESS",payload:T})}catch(O){n({type:"FETCH_DATA_MART_ERROR",payload:Cn(O)})}},[]),o=m.useCallback(async A=>{try{n({type:"CREATE_DATA_MART_START"});const O=await sn.createDataMart(A),T=RQ(O);return n({type:"CREATE_DATA_MART_SUCCESS",payload:T}),Ue({event:"data_mart_created",category:"DataMart",action:"Create",label:T.id}),It.success("Data Mart created"),T}catch(O){const T=Cn(O);throw n({type:"CREATE_DATA_MART_ERROR",payload:T}),Ue({event:"data_mart_error",category:"DataMart",action:"CreateError",label:T.message}),O}},[]),l=m.useCallback(async(A,O)=>{try{n({type:"UPDATE_DATA_MART_START"});const T=await sn.updateDataMart(A,O),M=await Wc(T);n({type:"UPDATE_DATA_MART_SUCCESS",payload:M}),Ue({event:"data_mart_updated",category:"DataMart",action:"Update",label:M.id})}catch(T){const M=Cn(T);n({type:"UPDATE_DATA_MART_ERROR",payload:M}),Ue({event:"data_mart_error",category:"DataMart",action:"UpdateError",label:M.message})}},[]),c=m.useCallback(async A=>{try{n({type:"DELETE_DATA_MART_START"}),await sn.deleteDataMart(A),n({type:"DELETE_DATA_MART_SUCCESS"}),Ue({event:"data_mart_deleted",category:"DataMart",action:"Delete",label:A}),It.success("Data Mart deleted")}catch(O){const T=Cn(O);n({type:"DELETE_DATA_MART_ERROR",payload:T}),Ue({event:"data_mart_error",category:"DataMart",action:"DeleteError",label:T.message})}},[]),d=m.useCallback(async(A,O)=>{try{n({type:"UPDATE_DATA_MART_TITLE_START"}),await sn.updateDataMartTitle(A,O),n({type:"UPDATE_DATA_MART_TITLE_SUCCESS",payload:O}),Ue({event:"data_mart_updated",category:"DataMart",action:"UpdateTitle",label:O}),It.success("Title updated")}catch(T){const M=Cn(T);n({type:"UPDATE_DATA_MART_TITLE_ERROR",payload:M}),Ue({event:"data_mart_error",category:"DataMart",action:"UpdateTitleError",label:M.message})}},[]),f=m.useCallback(async(A,O)=>{try{n({type:"UPDATE_DATA_MART_DESCRIPTION_START"}),await sn.updateDataMartDescription(A,O),n({type:"UPDATE_DATA_MART_DESCRIPTION_SUCCESS",payload:O??""}),Ue({event:"data_mart_updated",category:"DataMart",action:"UpdateDescription"}),It.success("Description updated")}catch(T){const M=Cn(T);n({type:"UPDATE_DATA_MART_DESCRIPTION_ERROR",payload:M}),Ue({event:"data_mart_error",category:"DataMart",action:"UpdateDescriptionError",label:M.message})}},[]),h=m.useCallback(A=>{n({type:"UPDATE_DATA_MART_STORAGE",payload:A})},[]),g=m.useCallback(async(A,O,T)=>{try{n({type:"UPDATE_DATA_MART_DEFINITION_START"});let M;switch(O){case Fe.SQL:M={definitionType:O,definition:mQ(T)};break;case Fe.TABLE:M={definitionType:O,definition:gQ(T)};break;case Fe.VIEW:M={definitionType:O,definition:vQ(T)};break;case Fe.TABLE_PATTERN:M={definitionType:O,definition:bQ(T)};break;case Fe.CONNECTOR:{const Y=T;let Z;for(const J of Y.connector.source.configuration){const H=J;if(H._copiedFrom){Z=H._copiedFrom.dataMartId;break}}M={definitionType:Fe.CONNECTOR,definition:CQ(Y),sourceDataMartId:Z};break}default:throw new Error(`Unsupported definition type: ${String(O)}`)}const F=await sn.updateDataMartDefinition(A,M),G=await Wc(F);n({type:"UPDATE_DATA_MART_DEFINITION_SUCCESS",payload:{definitionType:O,definition:T}}),n({type:"UPDATE_DATA_MART_SUCCESS",payload:G}),Ue({event:"data_mart_updated",category:"DataMart",action:"UpdateDefinition",label:O})}catch(M){const F=Cn(M);n({type:"UPDATE_DATA_MART_DEFINITION_ERROR",payload:F}),Ue({event:"data_mart_error",category:"DataMart",action:"UpdateDefinitionError",label:F.message})}},[]),y=m.useCallback(async A=>{try{n({type:"PUBLISH_DATA_MART_START"});const O=await sn.publishDataMart(A),T=await Wc(O);n({type:"PUBLISH_DATA_MART_SUCCESS",payload:T}),It.success("Data Mart published")}catch(O){const T=Cn(O);throw n({type:"PUBLISH_DATA_MART_ERROR",payload:T}),Ue({event:"data_mart_error",category:"DataMart",action:"PublishError",label:T.message}),O}},[]),v=m.useCallback(async(A,O=5,T=0,M)=>{try{M!=null&&M.silent||n({type:"FETCH_DATA_MART_RUNS_START"});const F=await sn.getDataMartRuns(A,O,T,M!=null&&M.silent?{skipLoadingIndicator:!0}:void 0),G=zj(F);return n({type:"FETCH_DATA_MART_RUNS_SUCCESS",payload:G}),G}catch(F){throw n({type:"FETCH_DATA_MART_RUNS_ERROR",payload:Cn(F)}),F}},[]),b=m.useCallback(async(A,O,T=5)=>{try{n({type:"LOAD_MORE_DATA_MART_RUNS_START"});const M=await sn.getDataMartRuns(A,T,O),F=zj(M);return n({type:"LOAD_MORE_DATA_MART_RUNS_SUCCESS",payload:F}),F}catch(M){throw n({type:"LOAD_MORE_DATA_MART_RUNS_ERROR",payload:Cn(M)}),M}},[]),w=m.useCallback(async A=>{const O=It.loading("Manual run started");try{n({type:"RUN_DATA_MART_START"}),await sn.runDataMart(A.id,A.payload),n({type:"RUN_DATA_MART_SUCCESS"})}catch(T){It.dismiss(O);const M=Cn(T);n({type:"RUN_DATA_MART_ERROR",payload:M}),Ue({event:"data_mart_error",category:"DataMart",action:"RunError",label:M.message})}},[]),S=m.useCallback(async(A,O)=>{try{await sn.cancelDataMartRun(A,O),await v(A),It.success("Data Mart run canceled")}catch(T){const M=Cn(T);n({type:"RUN_DATA_MART_ERROR",payload:M}),Ue({event:"data_mart_error",category:"DataMart",action:"CancelRunError",label:M.message})}},[v]),C=m.useCallback(async A=>{try{n({type:"ACTUALIZE_DATA_MART_SCHEMA_START"});const O=await sn.actualizeDataMartSchema(A),T=await Wc(O);n({type:"ACTUALIZE_DATA_MART_SCHEMA_SUCCESS",payload:T}),It.success("Output schema actualized")}catch(O){const T=Cn(O);n({type:"ACTUALIZE_DATA_MART_SCHEMA_ERROR",payload:T}),Ue({event:"data_mart_error",category:"DataMart",action:"ActualizeSchemaError",label:T.message})}},[]),R=m.useCallback(async(A,O)=>{try{n({type:"UPDATE_DATA_MART_SCHEMA_START"});const T=await sn.updateDataMartSchema(A,{schema:O}),M=await Wc(T);n({type:"UPDATE_DATA_MART_SCHEMA_SUCCESS",payload:M}),It.success("Output schema updated")}catch(T){const M=Cn(T);n({type:"UPDATE_DATA_MART_SCHEMA_ERROR",payload:M}),Ue({event:"data_mart_error",category:"DataMart",action:"UpdateSchemaError",label:M.message})}},[]),j=m.useCallback(()=>{n({type:"RESET"})},[]),_=m.useCallback(()=>t.error?t.error.message:null,[t.error]),D={...t,getDataMart:r,createDataMart:o,updateDataMart:l,deleteDataMart:c,updateDataMartTitle:d,updateDataMartDescription:f,updateDataMartStorage:h,updateDataMartDefinition:g,publishDataMart:y,runDataMart:w,cancelDataMartRun:S,actualizeDataMartSchema:C,updateDataMartSchema:R,getDataMartRuns:v,loadMoreDataMartRuns:b,getErrorMessage:_,reset:j};return s.jsx(F3.Provider,{value:D,children:e})}var Xf=e=>e.type==="checkbox",Il=e=>e instanceof Date,la=e=>e==null;const $3=e=>typeof e=="object";var Jn=e=>!la(e)&&!Array.isArray(e)&&$3(e)&&!Il(e),B3=e=>Jn(e)&&e.target?Xf(e.target)?e.target.checked:e.target.value:e,TQ=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,G3=(e,t)=>e.has(TQ(t)),_Q=e=>{const t=e.constructor&&e.constructor.prototype;return Jn(t)&&t.hasOwnProperty("isPrototypeOf")},rS=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ar(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(rS&&(e instanceof Blob||r))&&(n||Jn(e)))if(t=n?[]:Object.create(Object.getPrototypeOf(e)),!n&&!_Q(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=ar(e[o]));else return e;return t}var Fg=e=>/^\w*$/.test(e),Mn=e=>e===void 0,aS=e=>Array.isArray(e)?e.filter(Boolean):[],sS=e=>aS(e.replace(/["|']|\]/g,"").split(/\.|\[/)),De=(e,t,n)=>{if(!t||!Jn(e))return n;const r=(Fg(t)?[t]:sS(t)).reduce((o,l)=>la(o)?o:o[l],e);return Mn(r)||r===e?Mn(e[t])?n:e[t]:r},Ta=e=>typeof e=="boolean",Xt=(e,t,n)=>{let r=-1;const o=Fg(t)?[t]:sS(t),l=o.length,c=l-1;for(;++r<l;){const d=o[r];let f=n;if(r!==c){const h=e[d];f=Jn(h)||Array.isArray(h)?h:isNaN(+o[r+1])?{}:[]}if(d==="__proto__"||d==="constructor"||d==="prototype")return;e[d]=f,e=e[d]}};const Up={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},ms={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Ro={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},oS=ye.createContext(null);oS.displayName="HookFormContext";const zu=()=>ye.useContext(oS),q3=e=>{const{children:t,...n}=e;return ye.createElement(oS.Provider,{value:n},t)};var Z3=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const l in e)Object.defineProperty(o,l,{get:()=>{const c=l;return t._proxyFormState[c]!==ms.all&&(t._proxyFormState[c]=!r||ms.all),n&&(n[c]=!0),e[c]}});return o};const iS=typeof window<"u"?ye.useLayoutEffect:ye.useEffect;function K3(e){const t=zu(),{control:n=t.control,disabled:r,name:o,exact:l}=e||{},[c,d]=ye.useState(n._formState),f=ye.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return iS(()=>n._subscribe({name:o,formState:f.current,exact:l,callback:h=>{!r&&d({...n._formState,...h})}}),[o,r,l]),ye.useEffect(()=>{f.current.isValid&&n._setValid(!0)},[n]),ye.useMemo(()=>Z3(c,n,f.current,!1),[c,n])}var Aa=e=>typeof e=="string",n1=(e,t,n,r,o)=>Aa(e)?(r&&t.watch.add(e),De(n,e,o)):Array.isArray(e)?e.map(l=>(r&&t.watch.add(l),De(n,l))):(r&&(t.watchAll=!0),n),r1=e=>la(e)||!$3(e);function ps(e,t,n=new WeakSet){if(r1(e)||r1(t))return e===t;if(Il(e)&&Il(t))return e.getTime()===t.getTime();const r=Object.keys(e),o=Object.keys(t);if(r.length!==o.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const l of r){const c=e[l];if(!o.includes(l))return!1;if(l!=="ref"){const d=t[l];if(Il(c)&&Il(d)||Jn(c)&&Jn(d)||Array.isArray(c)&&Array.isArray(d)?!ps(c,d,n):c!==d)return!1}}return!0}function NQ(e){const t=zu(),{control:n=t.control,name:r,defaultValue:o,disabled:l,exact:c,compute:d}=e||{},f=ye.useRef(o),h=ye.useRef(d),g=ye.useRef(void 0),y=ye.useRef(n),v=ye.useRef(r);h.current=d;const[b,w]=ye.useState(()=>{const D=n._getWatch(r,f.current);return h.current?h.current(D):D}),S=ye.useCallback(D=>{const A=n1(r,n._names,D||n._formValues,!1,f.current);return h.current?h.current(A):A},[n._formValues,n._names,r]),C=ye.useCallback(D=>{if(!l){const A=n1(r,n._names,D||n._formValues,!1,f.current);if(h.current){const O=h.current(A);ps(O,g.current)||(w(O),g.current=O)}else w(A)}},[n._formValues,n._names,l,r]);iS(()=>((y.current!==n||!ps(v.current,r))&&(y.current=n,v.current=r,C()),n._subscribe({name:r,formState:{values:!0},exact:c,callback:D=>{C(D.values)}})),[n,c,r,C]),ye.useEffect(()=>n._removeUnmounted());const R=y.current!==n,j=v.current,_=ye.useMemo(()=>{if(l)return null;const D=!R&&!ps(j,r);return R||D?S():null},[l,R,r,j,S]);return _!==null?_:b}function AQ(e){const t=zu(),{name:n,disabled:r,control:o=t.control,shouldUnregister:l,defaultValue:c}=e,d=G3(o._names.array,n),f=ye.useMemo(()=>De(o._formValues,n,De(o._defaultValues,n,c)),[o,n,c]),h=NQ({control:o,name:n,defaultValue:f,exact:!0}),g=K3({control:o,name:n,exact:!0}),y=ye.useRef(e),v=ye.useRef(void 0),b=ye.useRef(o.register(n,{...e.rules,value:h,...Ta(e.disabled)?{disabled:e.disabled}:{}}));y.current=e;const w=ye.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!De(g.errors,n)},isDirty:{enumerable:!0,get:()=>!!De(g.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!De(g.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!De(g.validatingFields,n)},error:{enumerable:!0,get:()=>De(g.errors,n)}}),[g,n]),S=ye.useCallback(_=>b.current.onChange({target:{value:B3(_),name:n},type:Up.CHANGE}),[n]),C=ye.useCallback(()=>b.current.onBlur({target:{value:De(o._formValues,n),name:n},type:Up.BLUR}),[n,o._formValues]),R=ye.useCallback(_=>{const D=De(o._fields,n);D&&_&&(D._f.ref={focus:()=>_.focus&&_.focus(),select:()=>_.select&&_.select(),setCustomValidity:A=>_.setCustomValidity(A),reportValidity:()=>_.reportValidity()})},[o._fields,n]),j=ye.useMemo(()=>({name:n,value:h,...Ta(r)||g.disabled?{disabled:g.disabled||r}:{},onChange:S,onBlur:C,ref:R}),[n,r,g.disabled,S,C,R,h]);return ye.useEffect(()=>{const _=o._options.shouldUnregister||l,D=v.current;D&&D!==n&&!d&&o.unregister(D),o.register(n,{...y.current.rules,...Ta(y.current.disabled)?{disabled:y.current.disabled}:{}});const A=(O,T)=>{const M=De(o._fields,O);M&&M._f&&(M._f.mount=T)};if(A(n,!0),_){const O=ar(De(o._options.defaultValues,n,y.current.defaultValue));Xt(o._defaultValues,n,O),Mn(De(o._formValues,n))&&Xt(o._formValues,n,O)}return!d&&o.register(n),v.current=n,()=>{(d?_&&!o._state.action:_)?o.unregister(n):A(n,!1)}},[n,o,d,l]),ye.useEffect(()=>{o._setDisabledField({disabled:r,name:n})},[r,n,o]),ye.useMemo(()=>({field:j,formState:g,fieldState:w}),[j,g,w])}const DQ=e=>e.render(AQ(e));var lS=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},tf=e=>Array.isArray(e)?e:[e],Hj=()=>{let e=[];return{get observers(){return e},next:o=>{for(const l of e)l.next&&l.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(l=>l!==o)}}),unsubscribe:()=>{e=[]}}};function Y3(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const o=e[r],l=t[r];if(o&&Jn(o)&&l){const c=Y3(o,l);Jn(c)&&(n[r]=c)}else e[r]&&(n[r]=l)}return n}var Fr=e=>Jn(e)&&!Object.keys(e).length,cS=e=>e.type==="file",gs=e=>typeof e=="function",Fp=e=>{if(!rS)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},W3=e=>e.type==="select-multiple",uS=e=>e.type==="radio",OQ=e=>uS(e)||Xf(e),e0=e=>Fp(e)&&e.isConnected;function MQ(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Mn(e)?r++:e[t[r++]];return e}function IQ(e){for(const t in e)if(e.hasOwnProperty(t)&&!Mn(e[t]))return!1;return!0}function Qn(e,t){const n=Array.isArray(t)?t:Fg(t)?[t]:sS(t),r=n.length===1?e:MQ(e,n),o=n.length-1,l=n[o];return r&&delete r[l],o!==0&&(Jn(r)&&Fr(r)||Array.isArray(r)&&IQ(r))&&Qn(e,n.slice(0,-1)),e}var kQ=e=>{for(const t in e)if(gs(e[t]))return!0;return!1};function Q3(e){return Array.isArray(e)||Jn(e)&&!kQ(e)}function a1(e,t={}){for(const n in e)Q3(e[n])?(t[n]=Array.isArray(e[n])?[]:{},a1(e[n],t[n])):Mn(e[n])||(t[n]=!0);return t}function ru(e,t,n){n||(n=a1(t));for(const r in e)Q3(e[r])?Mn(t)||r1(n[r])?n[r]=a1(e[r],Array.isArray(e[r])?[]:{}):ru(e[r],la(t)?{}:t[r],n[r]):n[r]=!ps(e[r],t[r]);return n}const $j={value:!1,isValid:!1},Bj={value:!0,isValid:!0};var X3=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Mn(e[0].attributes.value)?Mn(e[0].value)||e[0].value===""?Bj:{value:e[0].value,isValid:!0}:Bj:$j}return $j},J3=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Mn(e)?e:t?e===""?NaN:e&&+e:n&&Aa(e)?new Date(e):r?r(e):e;const Gj={isValid:!1,value:null};var eD=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,Gj):Gj;function qj(e){const t=e.ref;return cS(t)?t.files:uS(t)?eD(e.refs).value:W3(t)?[...t.selectedOptions].map(({value:n})=>n):Xf(t)?X3(e.refs).value:J3(Mn(t.value)?e.ref.value:t.value,e)}var LQ=(e,t,n,r)=>{const o={};for(const l of e){const c=De(t,l);c&&Xt(o,l,c._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},Vp=e=>e instanceof RegExp,$d=e=>Mn(e)?e:Vp(e)?e.source:Jn(e)?Vp(e.value)?e.value.source:e.value:e,Zj=e=>({isOnSubmit:!e||e===ms.onSubmit,isOnBlur:e===ms.onBlur,isOnChange:e===ms.onChange,isOnAll:e===ms.all,isOnTouch:e===ms.onTouched});const Kj="AsyncFunction";var PQ=e=>!!e&&!!e.validate&&!!(gs(e.validate)&&e.validate.constructor.name===Kj||Jn(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Kj)),UQ=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Yj=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const nf=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const l=De(e,o);if(l){const{_f:c,...d}=l;if(c){if(c.refs&&c.refs[0]&&t(c.refs[0],o)&&!r)return!0;if(c.ref&&t(c.ref,c.name)&&!r)return!0;if(nf(d,t))break}else if(Jn(d)&&nf(d,t))break}}};function Wj(e,t,n){const r=De(e,n);if(r||Fg(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const l=o.join("."),c=De(t,l),d=De(e,l);if(c&&!Array.isArray(c)&&n!==l)return{name:n};if(d&&d.type)return{name:l,error:d};if(d&&d.root&&d.root.type)return{name:`${l}.root`,error:d.root};o.pop()}return{name:n}}var FQ=(e,t,n,r)=>{n(e);const{name:o,...l}=e;return Fr(l)||Object.keys(l).length>=Object.keys(t).length||Object.keys(l).find(c=>t[c]===(!r||ms.all))},VQ=(e,t,n)=>!e||!t||e===t||tf(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),zQ=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,HQ=(e,t)=>!aS(De(e,t)).length&&Qn(e,t),$Q=(e,t,n)=>{const r=tf(De(e,n));return Xt(r,"root",t[n]),Xt(e,n,r),e};function Qj(e,t,n="validate"){if(Aa(e)||Array.isArray(e)&&e.every(Aa)||Ta(e)&&!e)return{type:n,message:Aa(e)?e:"",ref:t}}var Qc=e=>Jn(e)&&!Vp(e)?e:{value:e,message:""},Xj=async(e,t,n,r,o,l)=>{const{ref:c,refs:d,required:f,maxLength:h,minLength:g,min:y,max:v,pattern:b,validate:w,name:S,valueAsNumber:C,mount:R}=e._f,j=De(n,S);if(!R||t.has(S))return{};const _=d?d[0]:c,D=Z=>{o&&_.reportValidity&&(_.setCustomValidity(Ta(Z)?"":Z||""),_.reportValidity())},A={},O=uS(c),T=Xf(c),M=O||T,F=(C||cS(c))&&Mn(c.value)&&Mn(j)||Fp(c)&&c.value===""||j===""||Array.isArray(j)&&!j.length,G=lS.bind(null,S,r,A),Y=(Z,J,H,K=Ro.maxLength,k=Ro.minLength)=>{const z=Z?J:H;A[S]={type:Z?K:k,message:z,ref:c,...G(Z?K:k,z)}};if(l?!Array.isArray(j)||!j.length:f&&(!M&&(F||la(j))||Ta(j)&&!j||T&&!X3(d).isValid||O&&!eD(d).isValid)){const{value:Z,message:J}=Aa(f)?{value:!!f,message:f}:Qc(f);if(Z&&(A[S]={type:Ro.required,message:J,ref:_,...G(Ro.required,J)},!r))return D(J),A}if(!F&&(!la(y)||!la(v))){let Z,J;const H=Qc(v),K=Qc(y);if(!la(j)&&!isNaN(j)){const k=c.valueAsNumber||j&&+j;la(H.value)||(Z=k>H.value),la(K.value)||(J=k<K.value)}else{const k=c.valueAsDate||new Date(j),z=xe=>new Date(new Date().toDateString()+" "+xe),B=c.type=="time",ie=c.type=="week";Aa(H.value)&&j&&(Z=B?z(j)>z(H.value):ie?j>H.value:k>new Date(H.value)),Aa(K.value)&&j&&(J=B?z(j)<z(K.value):ie?j<K.value:k<new Date(K.value))}if((Z||J)&&(Y(!!Z,H.message,K.message,Ro.max,Ro.min),!r))return D(A[S].message),A}if((h||g)&&!F&&(Aa(j)||l&&Array.isArray(j))){const Z=Qc(h),J=Qc(g),H=!la(Z.value)&&j.length>+Z.value,K=!la(J.value)&&j.length<+J.value;if((H||K)&&(Y(H,Z.message,J.message),!r))return D(A[S].message),A}if(b&&!F&&Aa(j)){const{value:Z,message:J}=Qc(b);if(Vp(Z)&&!j.match(Z)&&(A[S]={type:Ro.pattern,message:J,ref:c,...G(Ro.pattern,J)},!r))return D(J),A}if(w){if(gs(w)){const Z=await w(j,n),J=Qj(Z,_);if(J&&(A[S]={...J,...G(Ro.validate,J.message)},!r))return D(J.message),A}else if(Jn(w)){let Z={};for(const J in w){if(!Fr(Z)&&!r)break;const H=Qj(await w[J](j,n),_,J);H&&(Z={...H,...G(J,H.message)},D(H.message),r&&(A[S]=Z))}if(!Fr(Z)&&(A[S]={ref:_,...Z},!r))return A}}return D(!0),A};const BQ={mode:ms.onSubmit,reValidateMode:ms.onChange,shouldFocusError:!0};function GQ(e={}){let t={...BQ,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:gs(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},o=Jn(t.defaultValues)||Jn(t.values)?ar(t.defaultValues||t.values)||{}:{},l=t.shouldUnregister?{}:ar(o),c={action:!1,mount:!1,watch:!1},d={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},f,h=0;const g={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let y={...g};const v={array:Hj(),state:Hj()},b=t.criteriaMode===ms.all,w=U=>Q=>{clearTimeout(h),h=setTimeout(U,Q)},S=async U=>{if(!t.disabled&&(g.isValid||y.isValid||U)){const Q=t.resolver?Fr((await T()).errors):await F(r,!0);Q!==n.isValid&&v.state.next({isValid:Q})}},C=(U,Q)=>{!t.disabled&&(g.isValidating||g.validatingFields||y.isValidating||y.validatingFields)&&((U||Array.from(d.mount)).forEach(de=>{de&&(Q?Xt(n.validatingFields,de,Q):Qn(n.validatingFields,de))}),v.state.next({validatingFields:n.validatingFields,isValidating:!Fr(n.validatingFields)}))},R=(U,Q=[],de,_e,be=!0,Ee=!0)=>{if(_e&&de&&!t.disabled){if(c.action=!0,Ee&&Array.isArray(De(r,U))){const We=de(De(r,U),_e.argA,_e.argB);be&&Xt(r,U,We)}if(Ee&&Array.isArray(De(n.errors,U))){const We=de(De(n.errors,U),_e.argA,_e.argB);be&&Xt(n.errors,U,We),HQ(n.errors,U)}if((g.touchedFields||y.touchedFields)&&Ee&&Array.isArray(De(n.touchedFields,U))){const We=de(De(n.touchedFields,U),_e.argA,_e.argB);be&&Xt(n.touchedFields,U,We)}(g.dirtyFields||y.dirtyFields)&&(n.dirtyFields=ru(o,l)),v.state.next({name:U,isDirty:Y(U,Q),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Xt(l,U,Q)},j=(U,Q)=>{Xt(n.errors,U,Q),v.state.next({errors:n.errors})},_=U=>{n.errors=U,v.state.next({errors:n.errors,isValid:!1})},D=(U,Q,de,_e)=>{const be=De(r,U);if(be){const Ee=De(l,U,Mn(de)?De(o,U):de);Mn(Ee)||_e&&_e.defaultChecked||Q?Xt(l,U,Q?Ee:qj(be._f)):H(U,Ee),c.mount&&S()}},A=(U,Q,de,_e,be)=>{let Ee=!1,We=!1;const ot={name:U};if(!t.disabled){if(!de||_e){(g.isDirty||y.isDirty)&&(We=n.isDirty,n.isDirty=ot.isDirty=Y(),Ee=We!==ot.isDirty);const it=ps(De(o,U),Q);We=!!De(n.dirtyFields,U),it?Qn(n.dirtyFields,U):Xt(n.dirtyFields,U,!0),ot.dirtyFields=n.dirtyFields,Ee=Ee||(g.dirtyFields||y.dirtyFields)&&We!==!it}if(de){const it=De(n.touchedFields,U);it||(Xt(n.touchedFields,U,de),ot.touchedFields=n.touchedFields,Ee=Ee||(g.touchedFields||y.touchedFields)&&it!==de)}Ee&&be&&v.state.next(ot)}return Ee?ot:{}},O=(U,Q,de,_e)=>{const be=De(n.errors,U),Ee=(g.isValid||y.isValid)&&Ta(Q)&&n.isValid!==Q;if(t.delayError&&de?(f=w(()=>j(U,de)),f(t.delayError)):(clearTimeout(h),f=null,de?Xt(n.errors,U,de):Qn(n.errors,U)),(de?!ps(be,de):be)||!Fr(_e)||Ee){const We={..._e,...Ee&&Ta(Q)?{isValid:Q}:{},errors:n.errors,name:U};n={...n,...We},v.state.next(We)}},T=async U=>{C(U,!0);const Q=await t.resolver(l,t.context,LQ(U||d.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return C(U),Q},M=async U=>{const{errors:Q}=await T(U);if(U)for(const de of U){const _e=De(Q,de);_e?Xt(n.errors,de,_e):Qn(n.errors,de)}else n.errors=Q;return Q},F=async(U,Q,de={valid:!0})=>{for(const _e in U){const be=U[_e];if(be){const{_f:Ee,...We}=be;if(Ee){const ot=d.array.has(Ee.name),it=be._f&&PQ(be._f);it&&g.validatingFields&&C([Ee.name],!0);const xn=await Xj(be,d.disabled,l,b,t.shouldUseNativeValidation&&!Q,ot);if(it&&g.validatingFields&&C([Ee.name]),xn[Ee.name]&&(de.valid=!1,Q))break;!Q&&(De(xn,Ee.name)?ot?$Q(n.errors,xn,Ee.name):Xt(n.errors,Ee.name,xn[Ee.name]):Qn(n.errors,Ee.name))}!Fr(We)&&await F(We,Q,de)}}return de.valid},G=()=>{for(const U of d.unMount){const Q=De(r,U);Q&&(Q._f.refs?Q._f.refs.every(de=>!e0(de)):!e0(Q._f.ref))&&le(U)}d.unMount=new Set},Y=(U,Q)=>!t.disabled&&(U&&Q&&Xt(l,U,Q),!ps(xe(),o)),Z=(U,Q,de)=>n1(U,d,{...c.mount?l:Mn(Q)?o:Aa(U)?{[U]:Q}:Q},de,Q),J=U=>aS(De(c.mount?l:o,U,t.shouldUnregister?De(o,U,[]):[])),H=(U,Q,de={})=>{const _e=De(r,U);let be=Q;if(_e){const Ee=_e._f;Ee&&(!Ee.disabled&&Xt(l,U,J3(Q,Ee)),be=Fp(Ee.ref)&&la(Q)?"":Q,W3(Ee.ref)?[...Ee.ref.options].forEach(We=>We.selected=be.includes(We.value)):Ee.refs?Xf(Ee.ref)?Ee.refs.forEach(We=>{(!We.defaultChecked||!We.disabled)&&(Array.isArray(be)?We.checked=!!be.find(ot=>ot===We.value):We.checked=be===We.value||!!be)}):Ee.refs.forEach(We=>We.checked=We.value===be):cS(Ee.ref)?Ee.ref.value="":(Ee.ref.value=be,Ee.ref.type||v.state.next({name:U,values:ar(l)})))}(de.shouldDirty||de.shouldTouch)&&A(U,be,de.shouldTouch,de.shouldDirty,!0),de.shouldValidate&&ie(U)},K=(U,Q,de)=>{for(const _e in Q){if(!Q.hasOwnProperty(_e))return;const be=Q[_e],Ee=U+"."+_e,We=De(r,Ee);(d.array.has(U)||Jn(be)||We&&!We._f)&&!Il(be)?K(Ee,be,de):H(Ee,be,de)}},k=(U,Q,de={})=>{const _e=De(r,U),be=d.array.has(U),Ee=ar(Q);Xt(l,U,Ee),be?(v.array.next({name:U,values:ar(l)}),(g.isDirty||g.dirtyFields||y.isDirty||y.dirtyFields)&&de.shouldDirty&&v.state.next({name:U,dirtyFields:ru(o,l),isDirty:Y(U,Ee)})):_e&&!_e._f&&!la(Ee)?K(U,Ee,de):H(U,Ee,de),Yj(U,d)&&v.state.next({...n,name:U}),v.state.next({name:c.mount?U:void 0,values:ar(l)})},z=async U=>{c.mount=!0;const Q=U.target;let de=Q.name,_e=!0;const be=De(r,de),Ee=it=>{_e=Number.isNaN(it)||Il(it)&&isNaN(it.getTime())||ps(it,De(l,de,it))},We=Zj(t.mode),ot=Zj(t.reValidateMode);if(be){let it,xn;const Ua=Q.type?qj(be._f):B3(U),bn=U.type===Up.BLUR||U.type===Up.FOCUS_OUT,ei=!UQ(be._f)&&!t.resolver&&!De(n.errors,de)&&!be._f.deps||zQ(bn,De(n.touchedFields,de),n.isSubmitted,ot,We),Fn=Yj(de,d,bn);Xt(l,de,Ua),bn?(!Q||!Q.readOnly)&&(be._f.onBlur&&be._f.onBlur(U),f&&f(0)):be._f.onChange&&be._f.onChange(U);const Tn=A(de,Ua,bn),vr=!Fr(Tn)||Fn;if(!bn&&v.state.next({name:de,type:U.type,values:ar(l)}),ei)return(g.isValid||y.isValid)&&(t.mode==="onBlur"?bn&&S():bn||S()),vr&&v.state.next({name:de,...Fn?{}:Tn});if(!bn&&Fn&&v.state.next({...n}),t.resolver){const{errors:_n}=await T([de]);if(Ee(Ua),_e){const ul=Wj(n.errors,r,de),Ns=Wj(_n,r,ul.name||de);it=Ns.error,de=Ns.name,xn=Fr(_n)}}else C([de],!0),it=(await Xj(be,d.disabled,l,b,t.shouldUseNativeValidation))[de],C([de]),Ee(Ua),_e&&(it?xn=!1:(g.isValid||y.isValid)&&(xn=await F(r,!0)));_e&&(be._f.deps&&(!Array.isArray(be._f.deps)||be._f.deps.length>0)&&ie(be._f.deps),O(de,xn,it,Tn))}},B=(U,Q)=>{if(De(n.errors,Q)&&U.focus)return U.focus(),1},ie=async(U,Q={})=>{let de,_e;const be=tf(U);if(t.resolver){const Ee=await M(Mn(U)?U:be);de=Fr(Ee),_e=U?!be.some(We=>De(Ee,We)):de}else U?(_e=(await Promise.all(be.map(async Ee=>{const We=De(r,Ee);return await F(We&&We._f?{[Ee]:We}:We)}))).every(Boolean),!(!_e&&!n.isValid)&&S()):_e=de=await F(r);return v.state.next({...!Aa(U)||(g.isValid||y.isValid)&&de!==n.isValid?{}:{name:U},...t.resolver||!U?{isValid:de}:{},errors:n.errors}),Q.shouldFocus&&!_e&&nf(r,B,U?be:d.mount),_e},xe=(U,Q)=>{let de={...c.mount?l:o};return Q&&(de=Y3(Q.dirtyFields?n.dirtyFields:n.touchedFields,de)),Mn(U)?de:Aa(U)?De(de,U):U.map(_e=>De(de,_e))},L=(U,Q)=>({invalid:!!De((Q||n).errors,U),isDirty:!!De((Q||n).dirtyFields,U),error:De((Q||n).errors,U),isValidating:!!De(n.validatingFields,U),isTouched:!!De((Q||n).touchedFields,U)}),P=U=>{U&&tf(U).forEach(Q=>Qn(n.errors,Q)),v.state.next({errors:U?n.errors:{}})},q=(U,Q,de)=>{const _e=(De(r,U,{_f:{}})._f||{}).ref,be=De(n.errors,U)||{},{ref:Ee,message:We,type:ot,...it}=be;Xt(n.errors,U,{...it,...Q,ref:_e}),v.state.next({name:U,errors:n.errors,isValid:!1}),de&&de.shouldFocus&&_e&&_e.focus&&_e.focus()},te=(U,Q)=>gs(U)?v.state.subscribe({next:de=>"values"in de&&U(Z(void 0,Q),de)}):Z(U,Q,!0),ue=U=>v.state.subscribe({next:Q=>{VQ(U.name,Q.name,U.exact)&&FQ(Q,U.formState||g,Nr,U.reRenderRoot)&&U.callback({values:{...l},...n,...Q,defaultValues:o})}}).unsubscribe,ve=U=>(c.mount=!0,y={...y,...U.formState},ue({...U,formState:y})),le=(U,Q={})=>{for(const de of U?tf(U):d.mount)d.mount.delete(de),d.array.delete(de),Q.keepValue||(Qn(r,de),Qn(l,de)),!Q.keepError&&Qn(n.errors,de),!Q.keepDirty&&Qn(n.dirtyFields,de),!Q.keepTouched&&Qn(n.touchedFields,de),!Q.keepIsValidating&&Qn(n.validatingFields,de),!t.shouldUnregister&&!Q.keepDefaultValue&&Qn(o,de);v.state.next({values:ar(l)}),v.state.next({...n,...Q.keepDirty?{isDirty:Y()}:{}}),!Q.keepIsValid&&S()},Ae=({disabled:U,name:Q})=>{(Ta(U)&&c.mount||U||d.disabled.has(Q))&&(U?d.disabled.add(Q):d.disabled.delete(Q))},we=(U,Q={})=>{let de=De(r,U);const _e=Ta(Q.disabled)||Ta(t.disabled);return Xt(r,U,{...de||{},_f:{...de&&de._f?de._f:{ref:{name:U}},name:U,mount:!0,...Q}}),d.mount.add(U),de?Ae({disabled:Ta(Q.disabled)?Q.disabled:t.disabled,name:U}):D(U,!0,Q.value),{..._e?{disabled:Q.disabled||t.disabled}:{},...t.progressive?{required:!!Q.required,min:$d(Q.min),max:$d(Q.max),minLength:$d(Q.minLength),maxLength:$d(Q.maxLength),pattern:$d(Q.pattern)}:{},name:U,onChange:z,onBlur:z,ref:be=>{if(be){we(U,Q),de=De(r,U);const Ee=Mn(be.value)&&be.querySelectorAll&&be.querySelectorAll("input,select,textarea")[0]||be,We=OQ(Ee),ot=de._f.refs||[];if(We?ot.find(it=>it===Ee):Ee===de._f.ref)return;Xt(r,U,{_f:{...de._f,...We?{refs:[...ot.filter(e0),Ee,...Array.isArray(De(o,U))?[{}]:[]],ref:{type:Ee.type,name:U}}:{ref:Ee}}}),D(U,!1,void 0,Ee)}else de=De(r,U,{}),de._f&&(de._f.mount=!1),(t.shouldUnregister||Q.shouldUnregister)&&!(G3(d.array,U)&&c.action)&&d.unMount.add(U)}}},Ne=()=>t.shouldFocusError&&nf(r,B,d.mount),Be=U=>{Ta(U)&&(v.state.next({disabled:U}),nf(r,(Q,de)=>{const _e=De(r,de);_e&&(Q.disabled=_e._f.disabled||U,Array.isArray(_e._f.refs)&&_e._f.refs.forEach(be=>{be.disabled=_e._f.disabled||U}))},0,!1))},Qe=(U,Q)=>async de=>{let _e;de&&(de.preventDefault&&de.preventDefault(),de.persist&&de.persist());let be=ar(l);if(v.state.next({isSubmitting:!0}),t.resolver){const{errors:Ee,values:We}=await T();n.errors=Ee,be=ar(We)}else await F(r);if(d.disabled.size)for(const Ee of d.disabled)Qn(be,Ee);if(Qn(n.errors,"root"),Fr(n.errors)){v.state.next({errors:{}});try{await U(be,de)}catch(Ee){_e=Ee}}else Q&&await Q({...n.errors},de),Ne(),setTimeout(Ne);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Fr(n.errors)&&!_e,submitCount:n.submitCount+1,errors:n.errors}),_e)throw _e},qt=(U,Q={})=>{De(r,U)&&(Mn(Q.defaultValue)?k(U,ar(De(o,U))):(k(U,Q.defaultValue),Xt(o,U,ar(Q.defaultValue))),Q.keepTouched||Qn(n.touchedFields,U),Q.keepDirty||(Qn(n.dirtyFields,U),n.isDirty=Q.defaultValue?Y(U,ar(De(o,U))):Y()),Q.keepError||(Qn(n.errors,U),g.isValid&&S()),v.state.next({...n}))},Dt=(U,Q={})=>{const de=U?ar(U):o,_e=ar(de),be=Fr(U),Ee=be?o:_e;if(Q.keepDefaultValues||(o=de),!Q.keepValues){if(Q.keepDirtyValues){const We=new Set([...d.mount,...Object.keys(ru(o,l))]);for(const ot of Array.from(We))De(n.dirtyFields,ot)?Xt(Ee,ot,De(l,ot)):k(ot,De(Ee,ot))}else{if(rS&&Mn(U))for(const We of d.mount){const ot=De(r,We);if(ot&&ot._f){const it=Array.isArray(ot._f.refs)?ot._f.refs[0]:ot._f.ref;if(Fp(it)){const xn=it.closest("form");if(xn){xn.reset();break}}}}if(Q.keepFieldsRef)for(const We of d.mount)k(We,De(Ee,We));else r={}}l=t.shouldUnregister?Q.keepDefaultValues?ar(o):{}:ar(Ee),v.array.next({values:{...Ee}}),v.state.next({values:{...Ee}})}d={mount:Q.keepDirtyValues?d.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},c.mount=!g.isValid||!!Q.keepIsValid||!!Q.keepDirtyValues||!t.shouldUnregister&&!Fr(Ee),c.watch=!!t.shouldUnregister,v.state.next({submitCount:Q.keepSubmitCount?n.submitCount:0,isDirty:be?!1:Q.keepDirty?n.isDirty:!!(Q.keepDefaultValues&&!ps(U,o)),isSubmitted:Q.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:be?{}:Q.keepDirtyValues?Q.keepDefaultValues&&l?ru(o,l):n.dirtyFields:Q.keepDefaultValues&&U?ru(o,U):Q.keepDirty?n.dirtyFields:{},touchedFields:Q.keepTouched?n.touchedFields:{},errors:Q.keepErrors?n.errors:{},isSubmitSuccessful:Q.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},Zt=(U,Q)=>Dt(gs(U)?U(l):U,Q),jn=(U,Q={})=>{const de=De(r,U),_e=de&&de._f;if(_e){const be=_e.refs?_e.refs[0]:_e.ref;be.focus&&(be.focus(),Q.shouldSelect&&gs(be.select)&&be.select())}},Nr=U=>{n={...n,...U}},Ve={control:{register:we,unregister:le,getFieldState:L,handleSubmit:Qe,setError:q,_subscribe:ue,_runSchema:T,_focusError:Ne,_getWatch:Z,_getDirty:Y,_setValid:S,_setFieldArray:R,_setDisabledField:Ae,_setErrors:_,_getFieldArray:J,_reset:Dt,_resetDefaultValues:()=>gs(t.defaultValues)&&t.defaultValues().then(U=>{Zt(U,t.resetOptions),v.state.next({isLoading:!1})}),_removeUnmounted:G,_disableForm:Be,_subjects:v,_proxyFormState:g,get _fields(){return r},get _formValues(){return l},get _state(){return c},set _state(U){c=U},get _defaultValues(){return o},get _names(){return d},set _names(U){d=U},get _formState(){return n},get _options(){return t},set _options(U){t={...t,...U}}},subscribe:ve,trigger:ie,register:we,handleSubmit:Qe,watch:te,setValue:k,getValues:xe,reset:Zt,resetField:qt,clearErrors:P,unregister:le,setError:q,setFocus:jn,getFieldState:L};return{...Ve,formControl:Ve}}function Xo(e={}){const t=ye.useRef(void 0),n=ye.useRef(void 0),[r,o]=ye.useState({isDirty:!1,isValidating:!1,isLoading:gs(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:gs(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!gs(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:c,...d}=GQ(e);t.current={...d,formState:r}}const l=t.current.control;return l._options=e,iS(()=>{const c=l._subscribe({formState:l._proxyFormState,callback:()=>o({...l._formState}),reRenderRoot:!0});return o(d=>({...d,isReady:!0})),l._formState.isReady=!0,c},[l]),ye.useEffect(()=>l._disableForm(e.disabled),[l,e.disabled]),ye.useEffect(()=>{e.mode&&(l._options.mode=e.mode),e.reValidateMode&&(l._options.reValidateMode=e.reValidateMode)},[l,e.mode,e.reValidateMode]),ye.useEffect(()=>{e.errors&&(l._setErrors(e.errors),l._focusError())},[l,e.errors]),ye.useEffect(()=>{e.shouldUnregister&&l._subjects.state.next({values:l._getWatch()})},[l,e.shouldUnregister]),ye.useEffect(()=>{if(l._proxyFormState.isDirty){const c=l._getDirty();c!==r.isDirty&&l._subjects.state.next({isDirty:c})}},[l,r.isDirty]),ye.useEffect(()=>{e.values&&!ps(e.values,n.current)?(l._reset(e.values,{keepFieldsRef:!0,...l._options.resetOptions}),n.current=e.values,o(c=>({...c}))):l._resetDefaultValues()},[l,e.values]),ye.useEffect(()=>{l._state.mount||(l._setValid(),l._state.mount=!0),l._state.watch&&(l._state.watch=!1,l._subjects.state.next({...l._formState})),l._removeUnmounted()}),t.current.formState=Z3(r,l),t.current}var qQ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ZQ=qQ.reduce((e,t)=>{const n=V1(`Primitive.${t}`),r=m.forwardRef((o,l)=>{const{asChild:c,...d}=o,f=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(f,{...d,ref:l})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),KQ="Label",tD=m.forwardRef((e,t)=>s.jsx(ZQ.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));tD.displayName=KQ;var YQ=tD;function Ma({className:e,...t}){return s.jsx(YQ,{"data-slot":"label",className:ne("flex items-center gap-2 text-sm leading-none font-medium group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}const rl=q3,nD=m.createContext({}),kt=({...e})=>s.jsx(nD.Provider,{value:{name:e.name},children:s.jsx(DQ,{...e})}),Jf=()=>{const e=m.useContext(nD),t=m.useContext(rD),{getFieldState:n}=zu(),r=K3({name:e.name}),o=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:l}=t;return{id:l,name:e.name,formItemId:`${l}-form-item`,formDescriptionId:`${l}-form-item-description`,formMessageId:`${l}-form-item-message`,...o}},rD=m.createContext({});function _t({className:e="",...t}){const n=m.useId();return s.jsx(rD.Provider,{value:{id:n},children:s.jsx("div",{"data-slot":"form-item",className:ne("group border-border flex flex-col gap-2 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 hover:shadow-sm dark:border-transparent dark:bg-white/4",e),...t})})}function Rt({className:e="",tooltip:t,tooltipProps:n,children:r,...o}){const{error:l,formItemId:c}=Jf();return s.jsxs(Ma,{"data-slot":"form-label","data-error":!!l,className:ne("text-foreground flex items-center justify-between gap-2 text-sm font-medium","data-[error=true]:text-destructive",e),htmlFor:c,...o,children:[s.jsx("span",{children:r}),t&&s.jsxs(bt,{...n,children:[s.jsx(St,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,className:"pointer-events-none opacity-0 transition group-hover:pointer-events-auto group-hover:opacity-100","aria-label":"Help information",children:s.jsx(Br,{className:"text-muted-foreground/50 hover:text-muted-foreground size-4 shrink-0 transition-colors","aria-hidden":"true"})})}),s.jsx(Ct,{side:"top",align:"center",role:"tooltip",children:t})]})]})}function Nt({...e}){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:o}=Jf();return s.jsx(tg,{"data-slot":"form-control",id:n,"aria-describedby":t?`${r} ${o}`:`${r}`,"aria-invalid":!!t,...e})}function wn({className:e,...t}){const{formDescriptionId:n}=Jf();return s.jsx("div",{"data-slot":"form-description",id:n,className:ne("text-muted-foreground text-sm",e),...t})}function Ft({className:e,...t}){const{error:n,formMessageId:r}=Jf(),o=n?String((n==null?void 0:n.message)??""):t.children;return o?s.jsx("p",{"data-slot":"form-message",id:r,className:ne("text-destructive text-sm",e),...t,children:o}):null}function al({children:e,className:t="",variant:n="default"}){const r=n==="light"?"flex-1 overflow-y-auto":"bg-muted dark:bg-sidebar flex-1 overflow-y-auto p-4";return s.jsx("div",{className:r,children:s.jsx("div",{className:ne("flex min-h-full flex-col gap-4",t),children:e})})}function sl({className:e="",children:t,variant:n="default"}){const r=n==="light"?"flex flex-col gap-1.5 pt-4":"flex flex-col gap-1.5 border-t px-4 py-3";return s.jsx("div",{className:ne(r,e),children:t})}function ua({title:e,children:t}){return s.jsxs("section",{className:"mb-4",children:[e&&s.jsx("h3",{className:"text-muted-foreground/75 mb-2 text-xs font-semibold tracking-wide uppercase",children:e}),s.jsx("div",{className:"flex flex-col gap-2",children:t})]})}function WQ({value:e,label:t,checked:n,onChange:r,disabled:o=!1,orientation:l="vertical",className:c=""}){const{formItemId:d}=Jf();return s.jsxs("label",{htmlFor:`${d}-${e}`,className:ne("flex cursor-pointer items-center gap-2 rounded-md py-1 pr-4 pl-2 text-sm",o&&"cursor-not-allowed opacity-50",l==="horizontal"?"flex-row":"flex-col",n?"bg-muted border-input border-b":"hover:bg-muted border-border bg-transparent",c),children:[s.jsx("input",{type:"radio",id:`${d}-${e}`,value:e,checked:n,onChange:r,disabled:o,className:ne("peer border-input ring-offset-background h-4 w-4 rounded-full border","checked:bg-primary checked:border-primary","focus-visible:ring-ring focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50")}),s.jsx("span",{className:ne("peer-disabled:cursor-not-allowed peer-disabled:opacity-50"),children:t})]})}function QQ({options:e,value:t,onChange:n,orientation:r="vertical",className:o=""}){return s.jsx("div",{tabIndex:-1,className:ne(r==="horizontal"?"flex gap-6":"flex flex-col gap-2","border-input rounded-md border bg-transparent px-1 py-1 transition-colors","focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]","text-foreground selection:bg-primary selection:text-primary-foreground","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40","disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",o),children:e.map(l=>s.jsx(WQ,{value:l.value,label:l.label,checked:t===l.value,onChange:c=>n(c.target.value),disabled:l.disabled,orientation:r},l.value))})}const Jo=m.forwardRef(({children:e,className:t="",...n},r)=>s.jsx("form",{ref:r,className:ne("flex flex-1 flex-col overflow-hidden",t),...n,children:e}));Jo.displayName="AppForm";function Jj(e,[t,n]){return Math.min(n,Math.max(t,e))}function s1(e){const t=XQ(e),n=m.forwardRef((r,o)=>{const{children:l,...c}=r,d=m.Children.toArray(l),f=d.find(eX);if(f){const h=f.props.children,g=d.map(y=>y===f?m.Children.count(h)>1?m.Children.only(null):m.isValidElement(h)?h.props.children:null:y);return s.jsx(t,{...c,ref:o,children:m.isValidElement(h)?m.cloneElement(h,void 0,g):null})}return s.jsx(t,{...c,ref:o,children:l})});return n.displayName=`${e}.Slot`,n}function XQ(e){const t=m.forwardRef((n,r)=>{const{children:o,...l}=n;if(m.isValidElement(o)){const c=nX(o),d=tX(l,o.props);return o.type!==m.Fragment&&(d.ref=r?Lr(r,c):c),m.cloneElement(o,d)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var JQ=Symbol("radix.slottable");function eX(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===JQ}function tX(e,t){const n={...t};for(const r in t){const o=e[r],l=t[r];/^on[A-Z]/.test(r)?o&&l?n[r]=(...d)=>{const f=l(...d);return o(...d),f}:o&&(n[r]=o):r==="style"?n[r]={...o,...l}:r==="className"&&(n[r]=[o,l].filter(Boolean).join(" "))}return{...e,...n}}function nX(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function rX(e){const t=e+"CollectionProvider",[n,r]=cr(t),[o,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=S=>{const{scope:C,children:R}=S,j=ye.useRef(null),_=ye.useRef(new Map).current;return s.jsx(o,{scope:C,itemMap:_,collectionRef:j,children:R})};c.displayName=t;const d=e+"CollectionSlot",f=s1(d),h=ye.forwardRef((S,C)=>{const{scope:R,children:j}=S,_=l(d,R),D=dt(C,_.collectionRef);return s.jsx(f,{ref:D,children:j})});h.displayName=d;const g=e+"CollectionItemSlot",y="data-radix-collection-item",v=s1(g),b=ye.forwardRef((S,C)=>{const{scope:R,children:j,..._}=S,D=ye.useRef(null),A=dt(C,D),O=l(g,R);return ye.useEffect(()=>(O.itemMap.set(D,{ref:D,..._}),()=>void O.itemMap.delete(D))),s.jsx(v,{[y]:"",ref:A,children:j})});b.displayName=g;function w(S){const C=l(e+"CollectionConsumer",S);return ye.useCallback(()=>{const j=C.collectionRef.current;if(!j)return[];const _=Array.from(j.querySelectorAll(`[${y}]`));return Array.from(C.itemMap.values()).sort((O,T)=>_.indexOf(O.ref.current)-_.indexOf(T.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:c,Slot:h,ItemSlot:b},w,r]}function dS(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var aX=[" ","Enter","ArrowUp","ArrowDown"],sX=[" ","Enter"],Yl="Select",[Vg,zg,oX]=rX(Yl),[Hu]=cr(Yl,[oX,eo]),Hg=eo(),[iX,ol]=Hu(Yl),[lX,cX]=Hu(Yl),aD=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:l,value:c,defaultValue:d,onValueChange:f,dir:h,name:g,autoComplete:y,disabled:v,required:b,form:w}=e,S=Hg(t),[C,R]=m.useState(null),[j,_]=m.useState(null),[D,A]=m.useState(!1),O=Uf(h),[T,M]=Gr({prop:r,defaultProp:o??!1,onChange:l,caller:Yl}),[F,G]=Gr({prop:c,defaultProp:d,onChange:f,caller:Yl}),Y=m.useRef(null),Z=C?w||!!C.closest("form"):!0,[J,H]=m.useState(new Set),K=Array.from(J).map(k=>k.props.value).join(";");return s.jsx(ku,{...S,children:s.jsxs(iX,{required:b,scope:t,trigger:C,onTriggerChange:R,valueNode:j,onValueNodeChange:_,valueNodeHasChildren:D,onValueNodeHasChildrenChange:A,contentId:Ln(),value:F,onValueChange:G,open:T,onOpenChange:M,dir:O,triggerPointerDownPosRef:Y,disabled:v,children:[s.jsx(Vg.Provider,{scope:t,children:s.jsx(lX,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(k=>{H(z=>new Set(z).add(k))},[]),onNativeOptionRemove:m.useCallback(k=>{H(z=>{const B=new Set(z);return B.delete(k),B})},[]),children:n})}),Z?s.jsxs(_D,{"aria-hidden":!0,required:b,tabIndex:-1,name:g,autoComplete:y,value:F,onChange:k=>G(k.target.value),disabled:v,form:w,children:[F===void 0?s.jsx("option",{value:""}):null,Array.from(J)]},K):null]})})};aD.displayName=Yl;var sD="SelectTrigger",oD=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,l=Hg(n),c=ol(sD,n),d=c.disabled||r,f=dt(t,c.onTriggerChange),h=zg(n),g=m.useRef("touch"),[y,v,b]=AD(S=>{const C=h().filter(_=>!_.disabled),R=C.find(_=>_.value===c.value),j=DD(C,S,R);j!==void 0&&c.onValueChange(j.value)}),w=S=>{d||(c.onOpenChange(!0),b()),S&&(c.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return s.jsx(Lu,{asChild:!0,...l,children:s.jsx(et.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":ND(c.value)?"":void 0,...o,ref:f,onClick:Te(o.onClick,S=>{S.currentTarget.focus(),g.current!=="mouse"&&w(S)}),onPointerDown:Te(o.onPointerDown,S=>{g.current=S.pointerType;const C=S.target;C.hasPointerCapture(S.pointerId)&&C.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(w(S),S.preventDefault())}),onKeyDown:Te(o.onKeyDown,S=>{const C=y.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&v(S.key),!(C&&S.key===" ")&&aX.includes(S.key)&&(w(),S.preventDefault())})})})});oD.displayName=sD;var iD="SelectValue",lD=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:l,placeholder:c="",...d}=e,f=ol(iD,n),{onValueNodeHasChildrenChange:h}=f,g=l!==void 0,y=dt(t,f.onValueNodeChange);return jr(()=>{h(g)},[h,g]),s.jsx(et.span,{...d,ref:y,style:{pointerEvents:"none"},children:ND(f.value)?s.jsx(s.Fragment,{children:c}):l})});lD.displayName=iD;var uX="SelectIcon",cD=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return s.jsx(et.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});cD.displayName=uX;var dX="SelectPortal",uD=e=>s.jsx(tc,{asChild:!0,...e});uD.displayName=dX;var Wl="SelectContent",dD=m.forwardRef((e,t)=>{const n=ol(Wl,e.__scopeSelect),[r,o]=m.useState();if(jr(()=>{o(new DocumentFragment)},[]),!n.open){const l=r;return l?ys.createPortal(s.jsx(fD,{scope:e.__scopeSelect,children:s.jsx(Vg.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),l):null}return s.jsx(hD,{...e,ref:t})});dD.displayName=Wl;var cs=10,[fD,il]=Hu(Wl),fX="SelectContentImpl",hX=s1("SelectContent.RemoveScroll"),hD=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:l,onPointerDownOutside:c,side:d,sideOffset:f,align:h,alignOffset:g,arrowPadding:y,collisionBoundary:v,collisionPadding:b,sticky:w,hideWhenDetached:S,avoidCollisions:C,...R}=e,j=ol(Wl,n),[_,D]=m.useState(null),[A,O]=m.useState(null),T=dt(t,le=>D(le)),[M,F]=m.useState(null),[G,Y]=m.useState(null),Z=zg(n),[J,H]=m.useState(!1),K=m.useRef(!1);m.useEffect(()=>{if(_)return ig(_)},[_]),sg();const k=m.useCallback(le=>{const[Ae,...we]=Z().map(Qe=>Qe.ref.current),[Ne]=we.slice(-1),Be=document.activeElement;for(const Qe of le)if(Qe===Be||(Qe==null||Qe.scrollIntoView({block:"nearest"}),Qe===Ae&&A&&(A.scrollTop=0),Qe===Ne&&A&&(A.scrollTop=A.scrollHeight),Qe==null||Qe.focus(),document.activeElement!==Be))return},[Z,A]),z=m.useCallback(()=>k([M,_]),[k,M,_]);m.useEffect(()=>{J&&z()},[J,z]);const{onOpenChange:B,triggerPointerDownPosRef:ie}=j;m.useEffect(()=>{if(_){let le={x:0,y:0};const Ae=Ne=>{var Be,Qe;le={x:Math.abs(Math.round(Ne.pageX)-(((Be=ie.current)==null?void 0:Be.x)??0)),y:Math.abs(Math.round(Ne.pageY)-(((Qe=ie.current)==null?void 0:Qe.y)??0))}},we=Ne=>{le.x<=10&&le.y<=10?Ne.preventDefault():_.contains(Ne.target)||B(!1),document.removeEventListener("pointermove",Ae),ie.current=null};return ie.current!==null&&(document.addEventListener("pointermove",Ae),document.addEventListener("pointerup",we,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Ae),document.removeEventListener("pointerup",we,{capture:!0})}}},[_,B,ie]),m.useEffect(()=>{const le=()=>B(!1);return window.addEventListener("blur",le),window.addEventListener("resize",le),()=>{window.removeEventListener("blur",le),window.removeEventListener("resize",le)}},[B]);const[xe,L]=AD(le=>{const Ae=Z().filter(Be=>!Be.disabled),we=Ae.find(Be=>Be.ref.current===document.activeElement),Ne=DD(Ae,le,we);Ne&&setTimeout(()=>Ne.ref.current.focus())}),P=m.useCallback((le,Ae,we)=>{const Ne=!K.current&&!we;(j.value!==void 0&&j.value===Ae||Ne)&&(F(le),Ne&&(K.current=!0))},[j.value]),q=m.useCallback(()=>_==null?void 0:_.focus(),[_]),te=m.useCallback((le,Ae,we)=>{const Ne=!K.current&&!we;(j.value!==void 0&&j.value===Ae||Ne)&&Y(le)},[j.value]),ue=r==="popper"?o1:mD,ve=ue===o1?{side:d,sideOffset:f,align:h,alignOffset:g,arrowPadding:y,collisionBoundary:v,collisionPadding:b,sticky:w,hideWhenDetached:S,avoidCollisions:C}:{};return s.jsx(fD,{scope:n,content:_,viewport:A,onViewportChange:O,itemRefCallback:P,selectedItem:M,onItemLeave:q,itemTextRefCallback:te,focusSelectedItem:z,selectedItemText:G,position:r,isPositioned:J,searchRef:xe,children:s.jsx(Of,{as:hX,allowPinchZoom:!0,children:s.jsx(Df,{asChild:!0,trapped:j.open,onMountAutoFocus:le=>{le.preventDefault()},onUnmountAutoFocus:Te(o,le=>{var Ae;(Ae=j.trigger)==null||Ae.focus({preventScroll:!0}),le.preventDefault()}),children:s.jsx(ec,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:le=>le.preventDefault(),onDismiss:()=>j.onOpenChange(!1),children:s.jsx(ue,{role:"listbox",id:j.contentId,"data-state":j.open?"open":"closed",dir:j.dir,onContextMenu:le=>le.preventDefault(),...R,...ve,onPlaced:()=>H(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...R.style},onKeyDown:Te(R.onKeyDown,le=>{const Ae=le.ctrlKey||le.altKey||le.metaKey;if(le.key==="Tab"&&le.preventDefault(),!Ae&&le.key.length===1&&L(le.key),["ArrowUp","ArrowDown","Home","End"].includes(le.key)){let Ne=Z().filter(Be=>!Be.disabled).map(Be=>Be.ref.current);if(["ArrowUp","End"].includes(le.key)&&(Ne=Ne.slice().reverse()),["ArrowUp","ArrowDown"].includes(le.key)){const Be=le.target,Qe=Ne.indexOf(Be);Ne=Ne.slice(Qe+1)}setTimeout(()=>k(Ne)),le.preventDefault()}})})})})})})});hD.displayName=fX;var mX="SelectItemAlignedPosition",mD=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,l=ol(Wl,n),c=il(Wl,n),[d,f]=m.useState(null),[h,g]=m.useState(null),y=dt(t,T=>g(T)),v=zg(n),b=m.useRef(!1),w=m.useRef(!0),{viewport:S,selectedItem:C,selectedItemText:R,focusSelectedItem:j}=c,_=m.useCallback(()=>{if(l.trigger&&l.valueNode&&d&&h&&S&&C&&R){const T=l.trigger.getBoundingClientRect(),M=h.getBoundingClientRect(),F=l.valueNode.getBoundingClientRect(),G=R.getBoundingClientRect();if(l.dir!=="rtl"){const Be=G.left-M.left,Qe=F.left-Be,qt=T.left-Qe,Dt=T.width+qt,Zt=Math.max(Dt,M.width),jn=window.innerWidth-cs,Nr=Jj(Qe,[cs,Math.max(cs,jn-Zt)]);d.style.minWidth=Dt+"px",d.style.left=Nr+"px"}else{const Be=M.right-G.right,Qe=window.innerWidth-F.right-Be,qt=window.innerWidth-T.right-Qe,Dt=T.width+qt,Zt=Math.max(Dt,M.width),jn=window.innerWidth-cs,Nr=Jj(Qe,[cs,Math.max(cs,jn-Zt)]);d.style.minWidth=Dt+"px",d.style.right=Nr+"px"}const Y=v(),Z=window.innerHeight-cs*2,J=S.scrollHeight,H=window.getComputedStyle(h),K=parseInt(H.borderTopWidth,10),k=parseInt(H.paddingTop,10),z=parseInt(H.borderBottomWidth,10),B=parseInt(H.paddingBottom,10),ie=K+k+J+B+z,xe=Math.min(C.offsetHeight*5,ie),L=window.getComputedStyle(S),P=parseInt(L.paddingTop,10),q=parseInt(L.paddingBottom,10),te=T.top+T.height/2-cs,ue=Z-te,ve=C.offsetHeight/2,le=C.offsetTop+ve,Ae=K+k+le,we=ie-Ae;if(Ae<=te){const Be=Y.length>0&&C===Y[Y.length-1].ref.current;d.style.bottom="0px";const Qe=h.clientHeight-S.offsetTop-S.offsetHeight,qt=Math.max(ue,ve+(Be?q:0)+Qe+z),Dt=Ae+qt;d.style.height=Dt+"px"}else{const Be=Y.length>0&&C===Y[0].ref.current;d.style.top="0px";const qt=Math.max(te,K+S.offsetTop+(Be?P:0)+ve)+we;d.style.height=qt+"px",S.scrollTop=Ae-te+S.offsetTop}d.style.margin=`${cs}px 0`,d.style.minHeight=xe+"px",d.style.maxHeight=Z+"px",r==null||r(),requestAnimationFrame(()=>b.current=!0)}},[v,l.trigger,l.valueNode,d,h,S,C,R,l.dir,r]);jr(()=>_(),[_]);const[D,A]=m.useState();jr(()=>{h&&A(window.getComputedStyle(h).zIndex)},[h]);const O=m.useCallback(T=>{T&&w.current===!0&&(_(),j==null||j(),w.current=!1)},[_,j]);return s.jsx(gX,{scope:n,contentWrapper:d,shouldExpandOnScrollRef:b,onScrollButtonChange:O,children:s.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:D},children:s.jsx(et.div,{...o,ref:y,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});mD.displayName=mX;var pX="SelectPopperPosition",o1=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=cs,...l}=e,c=Hg(n);return s.jsx(If,{...c,...l,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});o1.displayName=pX;var[gX,fS]=Hu(Wl,{}),i1="SelectViewport",pD=m.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,l=il(i1,n),c=fS(i1,n),d=dt(t,l.onViewportChange),f=m.useRef(0);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),s.jsx(Vg.Slot,{scope:n,children:s.jsx(et.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Te(o.onScroll,h=>{const g=h.currentTarget,{contentWrapper:y,shouldExpandOnScrollRef:v}=c;if(v!=null&&v.current&&y){const b=Math.abs(f.current-g.scrollTop);if(b>0){const w=window.innerHeight-cs*2,S=parseFloat(y.style.minHeight),C=parseFloat(y.style.height),R=Math.max(S,C);if(R<w){const j=R+b,_=Math.min(w,j),D=j-_;y.style.height=_+"px",y.style.bottom==="0px"&&(g.scrollTop=D>0?D:0,y.style.justifyContent="flex-end")}}}f.current=g.scrollTop})})})]})});pD.displayName=i1;var gD="SelectGroup",[yX,vX]=Hu(gD),yD=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Ln();return s.jsx(yX,{scope:n,id:o,children:s.jsx(et.div,{role:"group","aria-labelledby":o,...r,ref:t})})});yD.displayName=gD;var vD="SelectLabel",xX=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=vX(vD,n);return s.jsx(et.div,{id:o.id,...r,ref:t})});xX.displayName=vD;var zp="SelectItem",[bX,xD]=Hu(zp),bD=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:l,...c}=e,d=ol(zp,n),f=il(zp,n),h=d.value===r,[g,y]=m.useState(l??""),[v,b]=m.useState(!1),w=dt(t,j=>{var _;return(_=f.itemRefCallback)==null?void 0:_.call(f,j,r,o)}),S=Ln(),C=m.useRef("touch"),R=()=>{o||(d.onValueChange(r),d.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return s.jsx(bX,{scope:n,value:r,disabled:o,textId:S,isSelected:h,onItemTextChange:m.useCallback(j=>{y(_=>_||((j==null?void 0:j.textContent)??"").trim())},[]),children:s.jsx(Vg.ItemSlot,{scope:n,value:r,disabled:o,textValue:g,children:s.jsx(et.div,{role:"option","aria-labelledby":S,"data-highlighted":v?"":void 0,"aria-selected":h&&v,"data-state":h?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...c,ref:w,onFocus:Te(c.onFocus,()=>b(!0)),onBlur:Te(c.onBlur,()=>b(!1)),onClick:Te(c.onClick,()=>{C.current!=="mouse"&&R()}),onPointerUp:Te(c.onPointerUp,()=>{C.current==="mouse"&&R()}),onPointerDown:Te(c.onPointerDown,j=>{C.current=j.pointerType}),onPointerMove:Te(c.onPointerMove,j=>{var _;C.current=j.pointerType,o?(_=f.onItemLeave)==null||_.call(f):C.current==="mouse"&&j.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Te(c.onPointerLeave,j=>{var _;j.currentTarget===document.activeElement&&((_=f.onItemLeave)==null||_.call(f))}),onKeyDown:Te(c.onKeyDown,j=>{var D;((D=f.searchRef)==null?void 0:D.current)!==""&&j.key===" "||(sX.includes(j.key)&&R(),j.key===" "&&j.preventDefault())})})})})});bD.displayName=zp;var Qd="SelectItemText",SD=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...l}=e,c=ol(Qd,n),d=il(Qd,n),f=xD(Qd,n),h=cX(Qd,n),[g,y]=m.useState(null),v=dt(t,R=>y(R),f.onItemTextChange,R=>{var j;return(j=d.itemTextRefCallback)==null?void 0:j.call(d,R,f.value,f.disabled)}),b=g==null?void 0:g.textContent,w=m.useMemo(()=>s.jsx("option",{value:f.value,disabled:f.disabled,children:b},f.value),[f.disabled,f.value,b]),{onNativeOptionAdd:S,onNativeOptionRemove:C}=h;return jr(()=>(S(w),()=>C(w)),[S,C,w]),s.jsxs(s.Fragment,{children:[s.jsx(et.span,{id:f.textId,...l,ref:v}),f.isSelected&&c.valueNode&&!c.valueNodeHasChildren?ys.createPortal(l.children,c.valueNode):null]})});SD.displayName=Qd;var CD="SelectItemIndicator",ED=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return xD(CD,n).isSelected?s.jsx(et.span,{"aria-hidden":!0,...r,ref:t}):null});ED.displayName=CD;var l1="SelectScrollUpButton",wD=m.forwardRef((e,t)=>{const n=il(l1,e.__scopeSelect),r=fS(l1,e.__scopeSelect),[o,l]=m.useState(!1),c=dt(t,r.onScrollButtonChange);return jr(()=>{if(n.viewport&&n.isPositioned){let d=function(){const h=f.scrollTop>0;l(h)};const f=n.viewport;return d(),f.addEventListener("scroll",d),()=>f.removeEventListener("scroll",d)}},[n.viewport,n.isPositioned]),o?s.jsx(jD,{...e,ref:c,onAutoScroll:()=>{const{viewport:d,selectedItem:f}=n;d&&f&&(d.scrollTop=d.scrollTop-f.offsetHeight)}}):null});wD.displayName=l1;var c1="SelectScrollDownButton",RD=m.forwardRef((e,t)=>{const n=il(c1,e.__scopeSelect),r=fS(c1,e.__scopeSelect),[o,l]=m.useState(!1),c=dt(t,r.onScrollButtonChange);return jr(()=>{if(n.viewport&&n.isPositioned){let d=function(){const h=f.scrollHeight-f.clientHeight,g=Math.ceil(f.scrollTop)<h;l(g)};const f=n.viewport;return d(),f.addEventListener("scroll",d),()=>f.removeEventListener("scroll",d)}},[n.viewport,n.isPositioned]),o?s.jsx(jD,{...e,ref:c,onAutoScroll:()=>{const{viewport:d,selectedItem:f}=n;d&&f&&(d.scrollTop=d.scrollTop+f.offsetHeight)}}):null});RD.displayName=c1;var jD=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,l=il("SelectScrollButton",n),c=m.useRef(null),d=zg(n),f=m.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return m.useEffect(()=>()=>f(),[f]),jr(()=>{var g;const h=d().find(y=>y.ref.current===document.activeElement);(g=h==null?void 0:h.ref.current)==null||g.scrollIntoView({block:"nearest"})},[d]),s.jsx(et.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:Te(o.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(r,50))}),onPointerMove:Te(o.onPointerMove,()=>{var h;(h=l.onItemLeave)==null||h.call(l),c.current===null&&(c.current=window.setInterval(r,50))}),onPointerLeave:Te(o.onPointerLeave,()=>{f()})})}),SX="SelectSeparator",TD=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return s.jsx(et.div,{"aria-hidden":!0,...r,ref:t})});TD.displayName=SX;var u1="SelectArrow",CX=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Hg(n),l=ol(u1,n),c=il(u1,n);return l.open&&c.position==="popper"?s.jsx(kf,{...o,...r,ref:t}):null});CX.displayName=u1;var EX="SelectBubbleInput",_D=m.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=m.useRef(null),l=dt(r,o),c=dS(t);return m.useEffect(()=>{const d=o.current;if(!d)return;const f=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(f,"value").set;if(c!==t&&g){const y=new Event("change",{bubbles:!0});g.call(d,t),d.dispatchEvent(y)}},[c,t]),s.jsx(et.select,{...n,style:{...zN,...n.style},ref:l,defaultValue:t})});_D.displayName=EX;function ND(e){return e===""||e===void 0}function AD(e){const t=bs(e),n=m.useRef(""),r=m.useRef(0),o=m.useCallback(c=>{const d=n.current+c;t(d),(function f(h){n.current=h,window.clearTimeout(r.current),h!==""&&(r.current=window.setTimeout(()=>f(""),1e3))})(d)},[t]),l=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,l]}function DD(e,t,n){const o=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let c=wX(e,Math.max(l,0));o.length===1&&(c=c.filter(h=>h!==n));const f=c.find(h=>h.textValue.toLowerCase().startsWith(o.toLowerCase()));return f!==n?f:void 0}function wX(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var RX=aD,jX=oD,TX=lD,_X=cD,NX=uD,AX=dD,DX=pD,OX=yD,MX=bD,IX=SD,kX=ED,LX=wD,PX=RD,UX=TD;function Kr({...e}){return s.jsx(RX,{"data-slot":"select",...e})}function $g({...e}){return s.jsx(OX,{"data-slot":"select-group",...e})}function Yr({...e}){return s.jsx(TX,{"data-slot":"select-value",...e})}function Wr({className:e,size:t="default",children:n,...r}){return s.jsxs(jX,{"data-slot":"select-trigger","data-size":t,className:ne("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,s.jsx(_X,{asChild:!0,children:s.jsx(ka,{className:"size-4 opacity-50"})})]})}function Qr({className:e,children:t,position:n="popper",...r}){return s.jsx(NX,{children:s.jsxs(AX,{"data-slot":"select-content",className:ne("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[s.jsx(VX,{}),s.jsx(DX,{className:ne("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),s.jsx(zX,{})]})})}function Rn({className:e,children:t,...n}){return s.jsxs(MX,{"data-slot":"select-item",className:ne("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[s.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:s.jsx(kX,{children:s.jsx(lr,{className:"size-4"})})}),s.jsx(IX,{children:t})]})}function FX({className:e,...t}){return s.jsx(UX,{"data-slot":"select-separator",className:ne("bg-border pointer-events-none -mx-1 my-1 h-px",e),...t})}function VX({className:e,...t}){return s.jsx(LX,{"data-slot":"select-scroll-up-button",className:ne("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(ns,{className:"size-4"})})}function zX({className:e,...t}){return s.jsx(PX,{"data-slot":"select-scroll-down-button",className:ne("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(ka,{className:"size-4"})})}const HX=Jt({title:$t().min(1,"Title is required").max(100,"Title must be less than 100 characters"),storageId:$t().min(1,"Storage is required")});function $X(){const{createDataMart:e,isLoading:t,error:n}=Qo();return{handleCreate:m.useCallback(async o=>{try{return await e(o)}catch(l){return console.error(l),null}},[e]),isSubmitting:t,serverError:n}}function BX(e){const{getDataMart:t,deleteDataMart:n,updateDataMartTitle:r,updateDataMartDescription:o,updateDataMartDefinition:l,updateDataMartSchema:c,actualizeDataMartSchema:d,publishDataMart:f,runDataMart:h,cancelDataMartRun:g,getDataMartRuns:y,loadMoreDataMartRuns:v,reset:b,dataMart:w,isLoading:S,error:C,getErrorMessage:R,runs:j}=Qo();return m.useEffect(()=>(e?t(e):b(),()=>{b()}),[e,t,b]),{dataMart:w,isLoading:S,error:C,getErrorMessage:R,deleteDataMart:n,updateDataMartTitle:r,updateDataMartDescription:o,updateDataMartDefinition:l,updateDataMartSchema:c,actualizeDataMartSchema:d,publishDataMart:f,runDataMart:h,cancelDataMartRun:g,getDataMartRuns:y,loadMoreDataMartRuns:v,runs:j,getDataMart:t}}const eT=(e,t,n)=>{if(e&&"reportValidity"in e){const r=De(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},d1=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?eT(r.ref,n,e):r&&r.refs&&r.refs.forEach(o=>eT(o,n,e))}},tT=(e,t)=>{t.shouldUseNativeValidation&&d1(e,t);const n={};for(const r in e){const o=De(t.fields,r),l=Object.assign(e[r]||{},{ref:o&&o.ref});if(GX(t.names||Object.keys(e),r)){const c=Object.assign({},De(n,r));Xt(c,"root",l),Xt(n,r,c)}else Xt(n,r,l)}return n},GX=(e,t)=>{const n=nT(t);return e.some(r=>nT(r).match(`^${n}\\.\\d+`))};function nT(e){return e.replace(/\]|\[/g,"")}function OD(e,t,n){function r(d,f){var h;Object.defineProperty(d,"_zod",{value:d._zod??{},enumerable:!1}),(h=d._zod).traits??(h.traits=new Set),d._zod.traits.add(e),t(d,f);for(const g in c.prototype)g in d||Object.defineProperty(d,g,{value:c.prototype[g].bind(d)});d._zod.constr=c,d._zod.def=f}const o=(n==null?void 0:n.Parent)??Object;class l extends o{}Object.defineProperty(l,"name",{value:e});function c(d){var f;const h=n!=null&&n.Parent?new l:this;r(h,d),(f=h._zod).deferred??(f.deferred=[]);for(const g of h._zod.deferred)g();return h}return Object.defineProperty(c,"init",{value:r}),Object.defineProperty(c,Symbol.hasInstance,{value:d=>{var f,h;return n!=null&&n.Parent&&d instanceof n.Parent?!0:(h=(f=d==null?void 0:d._zod)==null?void 0:f.traits)==null?void 0:h.has(e)}}),Object.defineProperty(c,"name",{value:e}),c}class qX extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const ZX={};function MD(e){return ZX}function KX(e,t){return typeof t=="bigint"?t.toString():t}const ID=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function Um(e){return typeof e=="string"?e:e==null?void 0:e.message}function kD(e,t,n){var o,l,c,d,f,h;const r={...e,path:e.path??[]};if(!e.message){const g=Um((c=(l=(o=e.inst)==null?void 0:o._zod.def)==null?void 0:l.error)==null?void 0:c.call(l,e))??Um((d=t==null?void 0:t.error)==null?void 0:d.call(t,e))??Um((f=n.customError)==null?void 0:f.call(n,e))??Um((h=n.localeError)==null?void 0:h.call(n,e))??"Invalid input";r.message=g}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}const LD=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,KX,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},YX=OD("$ZodError",LD),PD=OD("$ZodError",LD,{Parent:Error}),WX=e=>(t,n,r,o)=>{const l=r?Object.assign(r,{async:!1}):{async:!1},c=t._zod.run({value:n,issues:[]},l);if(c instanceof Promise)throw new qX;if(c.issues.length){const d=new((o==null?void 0:o.Err)??e)(c.issues.map(f=>kD(f,l,MD())));throw ID(d,o==null?void 0:o.callee),d}return c.value},QX=WX(PD),XX=e=>async(t,n,r,o)=>{const l=r?Object.assign(r,{async:!0}):{async:!0};let c=t._zod.run({value:n,issues:[]},l);if(c instanceof Promise&&(c=await c),c.issues.length){const d=new((o==null?void 0:o.Err)??e)(c.issues.map(f=>kD(f,l,MD())));throw ID(d,o==null?void 0:o.callee),d}return c.value},JX=XX(PD);function rT(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function eJ(e,t){for(var n={};e.length;){var r=e[0],o=r.code,l=r.message,c=r.path.join(".");if(!n[c])if("unionErrors"in r){var d=r.unionErrors[0].errors[0];n[c]={message:d.message,type:d.code}}else n[c]={message:l,type:o};if("unionErrors"in r&&r.unionErrors.forEach(function(g){return g.errors.forEach(function(y){return e.push(y)})}),t){var f=n[c].types,h=f&&f[r.code];n[c]=lS(c,t,n,o,h?[].concat(h,r.message):r.message)}e.shift()}return n}function tJ(e,t){for(var n={};e.length;){var r=e[0],o=r.code,l=r.message,c=r.path.join(".");if(!n[c])if(r.code==="invalid_union"&&r.errors.length>0){var d=r.errors[0][0];n[c]={message:d.message,type:d.code}}else n[c]={message:l,type:o};if(r.code==="invalid_union"&&r.errors.forEach(function(g){return g.forEach(function(y){return e.push(y)})}),t){var f=n[c].types,h=f&&f[r.code];n[c]=lS(c,t,n,o,h?[].concat(h,r.message):r.message)}e.shift()}return n}function ll(e,t,n){if(n===void 0&&(n={}),(function(r){return"_def"in r&&typeof r._def=="object"&&"typeName"in r._def})(e))return function(r,o,l){try{return Promise.resolve(rT(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(c){return l.shouldUseNativeValidation&&d1({},l),{errors:{},values:n.raw?Object.assign({},r):c}})},function(c){if((function(d){return Array.isArray(d==null?void 0:d.issues)})(c))return{values:{},errors:tT(eJ(c.errors,!l.shouldUseNativeValidation&&l.criteriaMode==="all"),l)};throw c}))}catch(c){return Promise.reject(c)}};if((function(r){return"_zod"in r&&typeof r._zod=="object"})(e))return function(r,o,l){try{return Promise.resolve(rT(function(){return Promise.resolve((n.mode==="sync"?QX:JX)(e,r,t)).then(function(c){return l.shouldUseNativeValidation&&d1({},l),{errors:{},values:n.raw?Object.assign({},r):c}})},function(c){if((function(d){return d instanceof YX})(c))return{values:{},errors:tT(tJ(c.issues,!l.shouldUseNativeValidation&&l.criteriaMode==="all"),l)};throw c}))}catch(c){return Promise.reject(c)}};throw new Error("Invalid input: not a Zod schema")}const UD=m.createContext(void 0);function nJ(){const e=m.useContext(UD);if(e===void 0)throw new Error("useDataStorageContext must be used within a DataStorageProvider");return e}var Pt=(e=>(e.FETCH_STORAGES_START="FETCH_STORAGES_START",e.FETCH_STORAGES_SUCCESS="FETCH_STORAGES_SUCCESS",e.FETCH_STORAGES_ERROR="FETCH_STORAGES_ERROR",e.FETCH_STORAGE_START="FETCH_STORAGE_START",e.FETCH_STORAGE_SUCCESS="FETCH_STORAGE_SUCCESS",e.FETCH_STORAGE_ERROR="FETCH_STORAGE_ERROR",e.CLEAR_CURRENT_STORAGE="CLEAR_CURRENT_STORAGE",e.CREATE_STORAGE_START="CREATE_STORAGE_START",e.CREATE_STORAGE_SUCCESS="CREATE_STORAGE_SUCCESS",e.CREATE_STORAGE_ERROR="CREATE_STORAGE_ERROR",e.UPDATE_STORAGE_START="UPDATE_STORAGE_START",e.UPDATE_STORAGE_SUCCESS="UPDATE_STORAGE_SUCCESS",e.UPDATE_STORAGE_ERROR="UPDATE_STORAGE_ERROR",e.DELETE_STORAGE_START="DELETE_STORAGE_START",e.DELETE_STORAGE_SUCCESS="DELETE_STORAGE_SUCCESS",e.DELETE_STORAGE_ERROR="DELETE_STORAGE_ERROR",e.CLEAR_ERROR="CLEAR_ERROR",e))(Pt||{});const rJ={dataStorages:[],currentDataStorage:null,loading:!1,error:null};function aJ(e,t){switch(t.type){case Pt.FETCH_STORAGES_START:case Pt.FETCH_STORAGE_START:case Pt.CREATE_STORAGE_START:case Pt.UPDATE_STORAGE_START:return{...e,error:null};case Pt.DELETE_STORAGE_START:return{...e,loading:!0,error:null};case Pt.FETCH_STORAGES_SUCCESS:return{...e,dataStorages:t.payload,loading:!1,error:null};case Pt.FETCH_STORAGE_SUCCESS:return{...e,currentDataStorage:t.payload,loading:!1,error:null};case Pt.CREATE_STORAGE_SUCCESS:return{...e,dataStorages:[...e.dataStorages,t.payload],loading:!1,error:null};case Pt.UPDATE_STORAGE_SUCCESS:return{...e,currentDataStorage:t.payload,dataStorages:e.dataStorages.map(n=>n.id===t.payload.id?t.payload:n),loading:!1,error:null};case Pt.DELETE_STORAGE_SUCCESS:return{...e,dataStorages:e.dataStorages.filter(n=>n.id!==t.payload),loading:!1,error:null};case Pt.FETCH_STORAGES_ERROR:case Pt.FETCH_STORAGE_ERROR:case Pt.CREATE_STORAGE_ERROR:case Pt.UPDATE_STORAGE_ERROR:case Pt.DELETE_STORAGE_ERROR:return{...e,loading:!1,error:t.payload};case Pt.CLEAR_CURRENT_STORAGE:return{...e,currentDataStorage:null};case Pt.CLEAR_ERROR:return{...e,error:null};default:return e}}function hS({children:e}){const[t,n]=m.useReducer(aJ,rJ);return s.jsx(UD.Provider,{value:{state:t,dispatch:n},children:e})}class sJ extends ac{constructor(){super("/data-storages")}async getDataStorages(){return this.get("/")}async getDataStorageById(t){return this.get(`/${t}`)}async createDataStorage(t){return this.post("",t)}async updateDataStorage(t,n){return this.put(`/${t}`,n)}async deleteDataStorage(t){return this.delete(`/${t}`)}}const Bd=new sJ;function Bg(){const{state:e,dispatch:t}=nJ(),n=m.useCallback(async()=>{t({type:Pt.FETCH_STORAGES_START});try{const f=await Bd.getDataStorages();t({type:Pt.FETCH_STORAGES_SUCCESS,payload:f.map(lQ)})}catch(f){throw t({type:Pt.FETCH_STORAGES_ERROR,payload:Cn(f)}),f}},[t]),r=m.useCallback(async f=>{try{const h=await Bd.getDataStorageById(f),g=ap(h);t({type:Pt.FETCH_STORAGE_SUCCESS,payload:g})}catch(h){throw t({type:Pt.FETCH_STORAGE_ERROR,payload:Cn(h)}),h}},[t]),o=m.useCallback(async f=>{t({type:Pt.CREATE_STORAGE_START});try{const h=cQ(f),g=await Bd.createDataStorage(h),y=ap(g);return t({type:Pt.CREATE_STORAGE_SUCCESS,payload:y}),Ue({event:"data_storage_created",category:"DataStorage",action:"Create",label:y.type}),It.success("Storage created"),y}catch(h){return t({type:Pt.CREATE_STORAGE_ERROR,payload:Cn(h)}),null}},[t]),l=m.useCallback(async(f,h)=>{t({type:Pt.UPDATE_STORAGE_START});try{const g=iQ(h),y=await Bd.updateDataStorage(f,g),v=ap(y);return t({type:Pt.UPDATE_STORAGE_SUCCESS,payload:v}),Ue({event:"data_storage_updated",category:"DataStorage",action:"Update",label:v.type}),It.success("Storage updated"),v}catch(g){return t({type:Pt.UPDATE_STORAGE_ERROR,payload:Cn(g)}),null}},[t]),c=m.useCallback(async f=>{t({type:Pt.DELETE_STORAGE_START});try{await Bd.deleteDataStorage(f),t({type:Pt.DELETE_STORAGE_SUCCESS,payload:f}),Ue({event:"data_storage_deleted",category:"DataStorage",action:"Delete",label:f}),It.success("Storage deleted")}catch(h){throw t({type:Pt.DELETE_STORAGE_ERROR,payload:Cn(h)}),h}},[t]),d=m.useCallback(()=>{t({type:Pt.CLEAR_CURRENT_STORAGE})},[t]);return{dataStorages:e.dataStorages,currentDataStorage:e.currentDataStorage,loading:e.loading,error:e.error,fetchDataStorages:n,getDataStorageById:r,createDataStorage:o,updateDataStorage:l,deleteDataStorage:c,clearCurrentDataStorage:d}}const FD=({isOpen:e,onClose:t,onSelect:n})=>s.jsx(Qb,{open:e,onOpenChange:t,children:s.jsxs(Xb,{className:"sm:max-w-sm",children:[s.jsxs(Jb,{children:[s.jsx(eS,{children:"New Storage"}),s.jsx(tS,{children:"Choose the type of storage you want to create"})]}),s.jsx("div",{className:"flex flex-col gap-4 py-4",children:nl.getAllTypes().map(r=>{const o=r.icon,l=r.status===Do.ACTIVE;return s.jsxs(Se,{variant:"outline",className:"flex px-4 py-6",onClick:()=>void n(r.type),disabled:!l,children:[s.jsxs("span",{className:"flex flex-grow items-center gap-2",children:[s.jsx(o,{size:24}),s.jsx("span",{className:"font-medium",children:r.displayName})]}),!l&&s.jsx(gr,{variant:"secondary",children:"Coming soon"})]},r.type)})})]})});function oJ({initialData:e,onSuccess:t}){const{handleCreate:n,isSubmitting:r,serverError:o}=$X(),{dataStorages:l,loading:c,fetchDataStorages:d,createDataStorage:f,getDataStorageById:h}=Bg(),[g,y]=m.useState(!1);m.useEffect(()=>{d()},[d]);const v=Xo({resolver:ll(HX),defaultValues:{title:(e==null?void 0:e.title)??"",storageId:""},mode:"onTouched"}),b=async C=>{const R=await n(C);R&&t&&t(R)},w=()=>{y(!0)},S=async C=>{try{const R=await f(C);R!=null&&R.id&&(await h(R.id),v.setValue("storageId",R.id))}catch(R){console.error("Failed to create storage:",R)}y(!1)};return s.jsxs(s.Fragment,{children:[s.jsx(rl,{...v,children:s.jsxs(Jo,{onSubmit:C=>{v.handleSubmit(b)(C)},children:[s.jsxs(al,{variant:"light",children:[o&&s.jsx("div",{className:"rounded bg-red-100 p-3 text-red-700",children:o.message}),s.jsx(kt,{control:v.control,name:"title",render:({field:C})=>s.jsxs(_t,{children:[s.jsx(Rt,{children:"Title"}),s.jsx(Nt,{children:s.jsx(Ht,{id:"title",placeholder:"Enter title",...C,disabled:r})}),s.jsx(Ft,{})]})}),s.jsx(kt,{control:v.control,name:"storageId",render:({field:C})=>s.jsxs(_t,{children:[s.jsx(Rt,{children:"Storage"}),s.jsx(Nt,{children:s.jsxs(Kr,{onValueChange:R=>{R==="create_new"?w():C.onChange(R)},value:C.value,disabled:r||c,children:[s.jsx(Wr,{className:"w-full",children:s.jsx(Yr,{placeholder:"Select a storage"})}),s.jsx(Qr,{children:s.jsxs($g,{children:[c&&s.jsx(Rn,{value:"loading",disabled:!0,children:"Loading..."}),!c&&l.map(R=>{const j=nl.getInfo(R.type).icon;return s.jsx(Rn,{value:R.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(j,{size:20}),s.jsx("span",{children:R.title})]})},R.id)}),!c&&l.length>0&&s.jsx(FX,{}),s.jsx(Rn,{value:"create_new",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex h-5 w-5 items-center justify-center",children:s.jsx(Pa,{size:20})}),s.jsx("span",{children:"Create new storage"})]})})]})})]})}),s.jsx(Ft,{})]})})]}),s.jsxs(sl,{variant:"light",children:[s.jsx(Se,{type:"submit",children:"Create Data Mart"}),s.jsx(Se,{variant:"outline",type:"button",onClick:()=>{window.history.back()},children:"Go back"})]})]})}),s.jsx(FD,{isOpen:g,onClose:()=>{y(!1)},onSelect:C=>S(C)})]})}function iJ({title:e,onUpdate:t,className:n,errorMessage:r="Title cannot be empty",minWidth:o="200px"}){const[l,c]=m.useState(e),[d,f]=m.useState(!1),h=m.useRef(null);m.useEffect(()=>{c(e)},[e]),m.useEffect(()=>{h.current&&(h.current.style.height="auto",h.current.style.height=`${String(h.current.scrollHeight)}px`)},[l]);const g=async()=>{if(l.trim()===""){c(e);return}if(l.trim()!==e)try{f(!0),await t(l.trim())}catch(v){c(e),console.error(v)}finally{f(!1)}},y=v=>{if(v.key==="Enter"&&!v.shiftKey){if(v.preventDefault(),l.trim()===""){It.error(r),c(e);return}g()}else v.key==="Escape"&&c(e)};return s.jsx("h2",{className:ne("m-0 cursor-pointer p-0 hover:opacity-80",n),children:s.jsx(Ko,{ref:h,value:l,onChange:v=>{c(v.target.value);const b=v.target;b.style.height="auto",b.style.height=`${String(b.scrollHeight)}px`},onBlur:()=>void g(),onKeyDown:y,className:ne("m-0 w-full border-0 p-0 shadow-none","bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0",{"opacity-50":d}),style:{fontSize:"inherit",fontWeight:"inherit",lineHeight:"inherit",fontFamily:"inherit",color:"inherit",resize:"none",overflow:"hidden",minHeight:"inherit",height:"auto",minWidth:o},disabled:d})})}var Dl=(e=>(e.MANUAL_BACKFILL="MANUAL_BACKFILL",e.INCREMENTAL="INCREMENTAL",e))(Dl||{}),VD=(e=>(e.MANUAL_BACKFILL="MANUAL_BACKFILL",e.HIDE_IN_CONFIG_FORM="HIDE_IN_CONFIG_FORM",e))(VD||{}),Gg="Tabs",[lJ]=cr(Gg,[bg]),zD=bg(),[cJ,mS]=lJ(Gg),HD=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:l,orientation:c="horizontal",dir:d,activationMode:f="automatic",...h}=e,g=Uf(d),[y,v]=Gr({prop:r,onChange:o,defaultProp:l??"",caller:Gg});return s.jsx(cJ,{scope:n,baseId:Ln(),value:y,onValueChange:v,orientation:c,dir:g,activationMode:f,children:s.jsx(et.div,{dir:g,"data-orientation":c,...h,ref:t})})});HD.displayName=Gg;var $D="TabsList",BD=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,l=mS($D,n),c=zD(n);return s.jsx(a4,{asChild:!0,...c,orientation:l.orientation,dir:l.dir,loop:r,children:s.jsx(et.div,{role:"tablist","aria-orientation":l.orientation,...o,ref:t})})});BD.displayName=$D;var GD="TabsTrigger",qD=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...l}=e,c=mS(GD,n),d=zD(n),f=YD(c.baseId,r),h=WD(c.baseId,r),g=r===c.value;return s.jsx(s4,{asChild:!0,...d,focusable:!o,active:g,children:s.jsx(et.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":h,"data-state":g?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:f,...l,ref:t,onMouseDown:Te(e.onMouseDown,y=>{!o&&y.button===0&&y.ctrlKey===!1?c.onValueChange(r):y.preventDefault()}),onKeyDown:Te(e.onKeyDown,y=>{[" ","Enter"].includes(y.key)&&c.onValueChange(r)}),onFocus:Te(e.onFocus,()=>{const y=c.activationMode!=="manual";!g&&!o&&y&&c.onValueChange(r)})})})});qD.displayName=GD;var ZD="TabsContent",KD=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:l,...c}=e,d=mS(ZD,n),f=YD(d.baseId,r),h=WD(d.baseId,r),g=r===d.value,y=m.useRef(g);return m.useEffect(()=>{const v=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(v)},[]),s.jsx(_r,{present:o||g,children:({present:v})=>s.jsx(et.div,{"data-state":g?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":f,hidden:!v,id:h,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:y.current?"0s":void 0},children:v&&l})})});KD.displayName=ZD;function YD(e,t){return`${e}-trigger-${t}`}function WD(e,t){return`${e}-content-${t}`}var uJ=HD,dJ=BD,fJ=qD,hJ=KD;function QD({className:e,...t}){return s.jsx(uJ,{"data-slot":"tabs",className:ne("flex flex-col gap-2",e),...t})}function XD({className:e,...t}){return s.jsx(dJ,{"data-slot":"tabs-list",className:ne("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function f1({className:e,...t}){return s.jsx(fJ,{"data-slot":"tabs-trigger",className:ne("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function mJ({className:e,...t}){return s.jsx(hJ,{"data-slot":"tabs-content",className:ne("flex-1 outline-none",e),...t})}var qg="Collapsible",[pJ,JD]=cr(qg),[gJ,pS]=pJ(qg),eO=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:l,onOpenChange:c,...d}=e,[f,h]=Gr({prop:r,defaultProp:o??!1,onChange:c,caller:qg});return s.jsx(gJ,{scope:n,disabled:l,contentId:Ln(),open:f,onOpenToggle:m.useCallback(()=>h(g=>!g),[h]),children:s.jsx(et.div,{"data-state":xS(f),"data-disabled":l?"":void 0,...d,ref:t})})});eO.displayName=qg;var tO="CollapsibleTrigger",gS=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=pS(tO,n);return s.jsx(et.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":xS(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:Te(e.onClick,o.onOpenToggle)})});gS.displayName=tO;var yS="CollapsibleContent",vS=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=pS(yS,e.__scopeCollapsible);return s.jsx(_r,{present:n||o.open,children:({present:l})=>s.jsx(yJ,{...r,ref:t,present:l})})});vS.displayName=yS;var yJ=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...l}=e,c=pS(yS,n),[d,f]=m.useState(r),h=m.useRef(null),g=dt(t,h),y=m.useRef(0),v=y.current,b=m.useRef(0),w=b.current,S=c.open||d,C=m.useRef(S),R=m.useRef(void 0);return m.useEffect(()=>{const j=requestAnimationFrame(()=>C.current=!1);return()=>cancelAnimationFrame(j)},[]),jr(()=>{const j=h.current;if(j){R.current=R.current||{transitionDuration:j.style.transitionDuration,animationName:j.style.animationName},j.style.transitionDuration="0s",j.style.animationName="none";const _=j.getBoundingClientRect();y.current=_.height,b.current=_.width,C.current||(j.style.transitionDuration=R.current.transitionDuration,j.style.animationName=R.current.animationName),f(r)}},[c.open,r]),s.jsx(et.div,{"data-state":xS(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!S,...l,ref:g,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":w?`${w}px`:void 0,...e.style},children:S&&o})});function xS(e){return e?"open":"closed"}var nO=eO,vJ=gS,xJ=vS;const bJ=nO,SJ=gS,CJ=vS;function EJ({children:e,className:t="",...n}){return s.jsx("div",{className:ne("flex flex-1 flex-col overflow-hidden",t),...n,children:e})}function wJ({children:e,className:t="",...n}){return s.jsx("div",{className:ne("bg-muted dark:bg-sidebar flex-1 overflow-y-auto p-4",t),...n,children:s.jsx("div",{className:"flex min-h-full flex-col gap-4",children:e})})}function RJ({children:e,className:t="",variant:n="horizontal",...r}){const o=n==="vertical"?"flex flex-col gap-1.5 pt-4":"flex items-center justify-between border-t px-4 py-3";return s.jsx("div",{className:ne(o,t),...r,children:e})}function Xd({children:e,className:t="",...n}){return s.jsx("div",{"data-slot":"wizard-step-item",className:ne("group border-border flex flex-col gap-2 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 hover:shadow-sm dark:border-transparent dark:bg-white/4",t),...n,children:e})}function jJ({label:e,children:t,className:n="",options:r,value:o,onValueChange:l,required:c=!1,tooltip:d,...f}){return s.jsx("div",{"data-slot":"wizard-step-item-one-of",className:ne("group border-border flex flex-col gap-2 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 hover:shadow-sm dark:border-transparent dark:bg-white/4",n),...f,children:s.jsxs(QD,{value:o,onValueChange:l,children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx(Mo,{required:c,tooltip:d,className:"w-full",children:e}),s.jsx(XD,{children:r.map(h=>s.jsx(f1,{value:h.value,children:h.label},h.value))})]}),t]})})}function rO({title:e,children:t,defaultOpen:n=!1,className:r=""}){const[o,l]=m.useState(n);return s.jsxs(bJ,{open:o,onOpenChange:l,"data-slot":"wizard-collapsible",className:ne("group/collapsible flex flex-col gap-2 py-3",r),children:[s.jsx(SJ,{asChild:!0,children:s.jsxs("button",{type:"button",className:ne("flex cursor-pointer items-center gap-1"),children:[s.jsx("span",{className:"text-muted-foreground/75 text-xs font-semibold tracking-wide uppercase",children:e}),s.jsx(La,{className:ne("text-foreground/75 h-3.5 w-3.5 transition-transform duration-200",o&&"rotate-90")})]})}),s.jsx(CJ,{className:"data-[state=open]:animate-collapsible-down data-[state=closed]:animate-collapsible-up overflow-hidden",children:s.jsx("div",{className:"flex flex-col gap-2 pt-2",children:t})})]})}function Mo({children:e,required:t=!1,tooltip:n,tooltipProps:r,className:o="",...l}){return s.jsxs(Ma,{"data-slot":"wizard-step-label",className:ne("text-foreground flex items-center justify-between gap-2 text-sm font-medium",o),...l,children:[t?s.jsxs(bt,{...r,children:[s.jsx(St,{asChild:!0,children:s.jsxs("span",{className:"flex items-center gap-1",children:[e,s.jsx("span",{className:"ml-1 text-red-500",children:"*"})]})}),s.jsx(Ct,{side:"top",align:"center",role:"tooltip",children:"Required"})]}):s.jsx("span",{children:e}),n&&s.jsxs(bt,{...r,children:[s.jsx(St,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,className:"pointer-events-none opacity-0 transition group-hover:pointer-events-auto group-hover:opacity-100","aria-label":"Help information",children:s.jsx(Br,{className:"text-muted-foreground/50 hover:text-muted-foreground size-4 shrink-0 transition-colors","aria-hidden":"true"})})}),s.jsx(Ct,{side:"top",align:"center",role:"tooltip",children:n})]})]})}function Pl({title:e,children:t,className:n="",...r}){return s.jsxs("section",{"data-slot":"wizard-step-section",className:ne("mb-8",n),...r,children:[e&&s.jsx("h3",{className:"text-muted-foreground/75 mb-2 text-xs font-semibold tracking-wide uppercase",children:e}),s.jsx("div",{className:"flex flex-col gap-2",children:t})]})}function Yi({icon:e,title:t,subtitle:n,docUrl:r,variant:o="default",className:l,...c}){return o==="compact"?s.jsxs("div",{"data-slot":"wizard-step-hero",className:ne("border-border mb-6 flex items-center justify-between gap-4 border-b pb-4",l),...c,children:[s.jsxs("div",{className:"flex items-center gap-2",children:[e&&s.jsx("div",{children:e}),s.jsx("h2",{className:"text-md font-medium",children:t})]}),r!=null&&s.jsx(Se,{variant:"outline",asChild:!0,children:s.jsxs(ha,{to:r,target:"_blank",rel:"noopener noreferrer",children:["Documentation",s.jsx(Fo,{className:"h-4 w-4"})]})})]}):s.jsxs("div",{"data-slot":"wizard-step-hero",className:ne("mb-6 flex flex-col items-center justify-center text-center",l),...c,children:[e&&s.jsx("div",{className:"mt-6 mb-3",children:e}),s.jsx("h2",{className:"text-xl font-medium",children:t}),n&&s.jsx("p",{className:"text-muted-foreground mt-2 text-sm",children:n}),r!=null&&s.jsx(Se,{variant:"outline",className:"mt-3 mb-6",asChild:!0,children:s.jsxs(ha,{to:r,target:"_blank",rel:"noopener noreferrer",children:["Documentation",s.jsx(Fo,{className:"h-4 w-4"})]})})]})}function ko({children:e,className:t="",...n}){return s.jsx("div",{"data-slot":"wizard-step",className:ne("space-y-4",t),...n,children:e})}function TJ({children:e,className:t="",...n}){return s.jsx("div",{className:ne("grid grid-cols-1 gap-4 md:grid-cols-2",t),...n,children:e})}function _J({icon:e,title:t,selected:n=!1,disabled:r=!1,onClick:o,onDoubleClick:l,className:c="",...d}){return s.jsxs("div",{className:ne("border-border flex items-center gap-4 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 select-none hover:shadow-sm dark:border-transparent dark:bg-white/4",r?"cursor-not-allowed opacity-50 hover:shadow-none":"cursor-pointer hover:shadow-sm dark:hover:bg-white/8",n&&!r?"ring-primary border-transparent ring-2 dark:bg-white/8":"",c),onClick:o,onDoubleClick:l,...d,children:[e&&s.jsx("span",{className:"shrink-0",children:e}),r?s.jsxs(bt,{children:[s.jsx(St,{asChild:!0,children:s.jsx("span",{className:"cursor-not-allowed text-sm font-medium opacity-70",children:t})}),s.jsx(Ct,{side:"top",align:"center",children:"Coming soon"})]}):s.jsx("span",{className:"text-sm font-medium",children:t})]})}function aO({type:e,id:t,name:n,value:r,label:o,checked:l,selected:c=!1,disabled:d=!1,tooltip:f,rightIcon:h,onChange:g,className:y="",...v}){const b=S=>{g&&g(e==="checkbox"?S.target.checked:S.target.value)},w=m.useRef(null);return s.jsxs("div",{"data-slot":"wizard-step-card-item",onClick:S=>{if(d)return;const C=S.target;C.tagName==="INPUT"||C.tagName==="LABEL"||C.closest("label")||w.current&&w.current.click()},className:ne("group border-border flex items-center gap-2 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 select-none hover:shadow-sm dark:border-transparent dark:bg-white/4",d?"cursor-not-allowed":"cursor-pointer hover:shadow-sm dark:hover:bg-white/8",c?"ring-primary border-transparent ring-2 dark:bg-white/8":"",y),children:[s.jsx("input",{ref:w,id:t,type:e,name:n,value:r,checked:l,disabled:d,onChange:b,className:ne("text-primary focus:ring-primary border-border cursor-pointer",e==="radio"||e==="checkbox"?"h-4 w-4":"h-8 w-full rounded-md border px-2"),...v}),o&&s.jsx(Mo,{htmlFor:t,className:ne("cursor-pointer",d&&"cursor-not-allowed"),children:o}),(f||h)&&s.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[f&&s.jsxs(bt,{children:[s.jsx(St,{asChild:!0,children:s.jsx(Br,{className:"text-muted-foreground/75 pointer-events-none h-4 w-4 opacity-0 group-hover:pointer-events-auto group-hover:opacity-100","data-tooltip-trigger":!0})}),s.jsx(Ct,{side:"top",align:"center",children:f})]}),h&&s.jsx("div",{className:"flex items-center",children:h})]})]})}function bS({variant:e="grid",items:t,className:n=""}){const r=t??(e==="grid"?12:6),o=e==="grid"?"grid grid-cols-1 gap-4 md:grid-cols-2":"flex flex-col gap-4";return s.jsx("div",{"data-slot":"wizard-step-loading",className:ne(o,n),children:Array.from({length:r}).map((l,c)=>s.jsx(hs,{className:"border-border h-12 rounded-md border-b bg-white dark:bg-white/4"},c))})}function aT(e){const t=NJ(e),n=m.forwardRef((r,o)=>{const{children:l,...c}=r,d=m.Children.toArray(l),f=d.find(DJ);if(f){const h=f.props.children,g=d.map(y=>y===f?m.Children.count(h)>1?m.Children.only(null):m.isValidElement(h)?h.props.children:null:y);return s.jsx(t,{...c,ref:o,children:m.isValidElement(h)?m.cloneElement(h,void 0,g):null})}return s.jsx(t,{...c,ref:o,children:l})});return n.displayName=`${e}.Slot`,n}function NJ(e){const t=m.forwardRef((n,r)=>{const{children:o,...l}=n;if(m.isValidElement(o)){const c=MJ(o),d=OJ(l,o.props);return o.type!==m.Fragment&&(d.ref=r?Lr(r,c):c),m.cloneElement(o,d)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var AJ=Symbol("radix.slottable");function DJ(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===AJ}function OJ(e,t){const n={...t};for(const r in t){const o=e[r],l=t[r];/^on[A-Z]/.test(r)?o&&l?n[r]=(...d)=>{const f=l(...d);return o(...d),f}:o&&(n[r]=o):r==="style"?n[r]={...o,...l}:r==="className"&&(n[r]=[o,l].filter(Boolean).join(" "))}return{...e,...n}}function MJ(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function IJ(e){const t=e+"CollectionProvider",[n,r]=cr(t),[o,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=S=>{const{scope:C,children:R}=S,j=ye.useRef(null),_=ye.useRef(new Map).current;return s.jsx(o,{scope:C,itemMap:_,collectionRef:j,children:R})};c.displayName=t;const d=e+"CollectionSlot",f=aT(d),h=ye.forwardRef((S,C)=>{const{scope:R,children:j}=S,_=l(d,R),D=dt(C,_.collectionRef);return s.jsx(f,{ref:D,children:j})});h.displayName=d;const g=e+"CollectionItemSlot",y="data-radix-collection-item",v=aT(g),b=ye.forwardRef((S,C)=>{const{scope:R,children:j,..._}=S,D=ye.useRef(null),A=dt(C,D),O=l(g,R);return ye.useEffect(()=>(O.itemMap.set(D,{ref:D,..._}),()=>void O.itemMap.delete(D))),s.jsx(v,{[y]:"",ref:A,children:j})});b.displayName=g;function w(S){const C=l(e+"CollectionConsumer",S);return ye.useCallback(()=>{const j=C.collectionRef.current;if(!j)return[];const _=Array.from(j.querySelectorAll(`[${y}]`));return Array.from(C.itemMap.values()).sort((O,T)=>_.indexOf(O.ref.current)-_.indexOf(T.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:c,Slot:h,ItemSlot:b},w,r]}var _s="Accordion",kJ=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[SS,LJ,PJ]=IJ(_s),[Zg]=cr(_s,[PJ,JD]),CS=JD(),sO=ye.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,l=r;return s.jsx(SS.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?s.jsx(zJ,{...l,ref:t}):s.jsx(VJ,{...o,ref:t})})});sO.displayName=_s;var[oO,UJ]=Zg(_s),[iO,FJ]=Zg(_s,{collapsible:!1}),VJ=ye.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:l=!1,...c}=e,[d,f]=Gr({prop:n,defaultProp:r??"",onChange:o,caller:_s});return s.jsx(oO,{scope:e.__scopeAccordion,value:ye.useMemo(()=>d?[d]:[],[d]),onItemOpen:f,onItemClose:ye.useCallback(()=>l&&f(""),[l,f]),children:s.jsx(iO,{scope:e.__scopeAccordion,collapsible:l,children:s.jsx(lO,{...c,ref:t})})})}),zJ=ye.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...l}=e,[c,d]=Gr({prop:n,defaultProp:r??[],onChange:o,caller:_s}),f=ye.useCallback(g=>d((y=[])=>[...y,g]),[d]),h=ye.useCallback(g=>d((y=[])=>y.filter(v=>v!==g)),[d]);return s.jsx(oO,{scope:e.__scopeAccordion,value:c,onItemOpen:f,onItemClose:h,children:s.jsx(iO,{scope:e.__scopeAccordion,collapsible:!0,children:s.jsx(lO,{...l,ref:t})})})}),[HJ,Kg]=Zg(_s),lO=ye.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:l="vertical",...c}=e,d=ye.useRef(null),f=dt(d,t),h=LJ(n),y=Uf(o)==="ltr",v=Te(e.onKeyDown,b=>{var M;if(!kJ.includes(b.key))return;const w=b.target,S=h().filter(F=>{var G;return!((G=F.ref.current)!=null&&G.disabled)}),C=S.findIndex(F=>F.ref.current===w),R=S.length;if(C===-1)return;b.preventDefault();let j=C;const _=0,D=R-1,A=()=>{j=C+1,j>D&&(j=_)},O=()=>{j=C-1,j<_&&(j=D)};switch(b.key){case"Home":j=_;break;case"End":j=D;break;case"ArrowRight":l==="horizontal"&&(y?A():O());break;case"ArrowDown":l==="vertical"&&A();break;case"ArrowLeft":l==="horizontal"&&(y?O():A());break;case"ArrowUp":l==="vertical"&&O();break}const T=j%R;(M=S[T].ref.current)==null||M.focus()});return s.jsx(HJ,{scope:n,disabled:r,direction:o,orientation:l,children:s.jsx(SS.Slot,{scope:n,children:s.jsx(et.div,{...c,"data-orientation":l,ref:f,onKeyDown:r?void 0:v})})})}),Hp="AccordionItem",[$J,ES]=Zg(Hp),cO=ye.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,l=Kg(Hp,n),c=UJ(Hp,n),d=CS(n),f=Ln(),h=r&&c.value.includes(r)||!1,g=l.disabled||e.disabled;return s.jsx($J,{scope:n,open:h,disabled:g,triggerId:f,children:s.jsx(nO,{"data-orientation":l.orientation,"data-state":pO(h),...d,...o,ref:t,disabled:g,open:h,onOpenChange:y=>{y?c.onItemOpen(r):c.onItemClose(r)}})})});cO.displayName=Hp;var uO="AccordionHeader",dO=ye.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Kg(_s,n),l=ES(uO,n);return s.jsx(et.h3,{"data-orientation":o.orientation,"data-state":pO(l.open),"data-disabled":l.disabled?"":void 0,...r,ref:t})});dO.displayName=uO;var h1="AccordionTrigger",fO=ye.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Kg(_s,n),l=ES(h1,n),c=FJ(h1,n),d=CS(n);return s.jsx(SS.ItemSlot,{scope:n,children:s.jsx(vJ,{"aria-disabled":l.open&&!c.collapsible||void 0,"data-orientation":o.orientation,id:l.triggerId,...d,...r,ref:t})})});fO.displayName=h1;var hO="AccordionContent",mO=ye.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Kg(_s,n),l=ES(hO,n),c=CS(n);return s.jsx(xJ,{role:"region","aria-labelledby":l.triggerId,"data-orientation":o.orientation,...c,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});mO.displayName=hO;function pO(e){return e?"open":"closed"}var BJ=sO,GJ=cO,qJ=dO,ZJ=fO,KJ=mO;const wS={default:{itemClass:"border-b last:border-b-0",triggerClass:"focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",icon:null,chevronClass:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200",contentClass:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",contentInnerClass:"pt-0 pb-4",headerClass:"flex"},common:{itemClass:"overflow-hidden",triggerClass:"group focus-visible:ring-primary hover:bg-muted [&[data-state=open]]:bg-muted flex items-center gap-1 rounded-sm px-2 py-1 transition-all outline-none focus-visible:ring-2 [&[data-state=open]]:rounded-br-none [&[data-state=open]]:rounded-bl-none [&[data-state=open]]:font-semibold",icon:s.jsx(Bk,{className:"size-4 shrink-0","aria-hidden":"true"}),chevronClass:"size-3.5 shrink-0 transition-transform duration-200 group-data-[state=open]:rotate-180",contentClass:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down bg-muted overflow-hidden rounded-sm rounded-tl-none py-0 pr-2 pl-7 text-sm",contentInnerClass:"pt-2 pb-4",headerClass:void 0}},gO=m.createContext("default");function Bn({variant:e="default",...t}){return s.jsx(gO.Provider,{value:e,children:s.jsx(BJ,{"data-slot":"accordion",...t})})}function RS(e){const t=m.useContext(gO);return e??t??"default"}function cn({className:e,variant:t,...n}){const r=RS(t),{itemClass:o}=wS[r];return s.jsx(GJ,{"data-slot":"accordion-item",className:ne(o,e),...n})}function un({className:e,children:t,variant:n,...r}){const o=RS(n),{triggerClass:l,icon:c,chevronClass:d,headerClass:f}=wS[o];return s.jsx(qJ,{className:f,children:s.jsxs(ZJ,{"data-slot":"accordion-trigger",className:ne(l,e),...r,children:[c,t,s.jsx(ka,{className:d,"aria-hidden":"true"})]})})}function dn({className:e,children:t,variant:n,...r}){const o=RS(n),{contentClass:l,contentInnerClass:c}=wS[o];return s.jsx(KJ,{"data-slot":"accordion-content",className:ne(l,e),...r,children:s.jsx("div",{className:c,children:t})})}function vn({href:e,children:t,className:n,...r}){return s.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:ne("text-muted-foreground hover:bg-muted inline-flex items-center px-1 font-medium hover:rounded-md",n),...r,children:[t,s.jsx(Fo,{className:"ml-1 inline h-3 w-3","aria-hidden":"true"})]})}function sT(){return s.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:s.jsxs(cn,{value:"connector-state-details",children:[s.jsx(un,{children:"What’s connector state?"}),s.jsxs(dn,{children:[s.jsx("p",{className:"mb-2",children:"The connector state stores internal data between runs and updates automatically with each execution. It’s used to track progress and ensure consistent data processing across runs."}),s.jsx("p",{className:"mb-2",children:"Connector state is available only for connectors that support incremental runs, helping add only new or updated records since the last run without reloading existing data."}),s.jsxs("p",{className:"mb-2",children:["For more details, see the"," ",s.jsx(vn,{className:"underline",href:"https://docs.owox.com/?utm_source=owox_data_marts&utm_medium=manual_run_sheet&utm_campaign=tooltip_connector_state",children:"OWOX documentation"}),"."]})]})]})})}const Yg=e=>{if(!e)return"—";let t;if(typeof e=="string"){if(t=new Date(e),isNaN(t.getTime()))return"—"}else if(t=e,isNaN(t.getTime()))return"—";const r=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(t),o=new Map(r.map(y=>[y.type,y.value])),l=o.get("year")??"",c=o.get("month")??"",d=o.get("day")??"",f=o.get("hour")??"",h=o.get("minute")??"",g=o.get("second")??"";return`${l}-${c}-${d} ${f}:${h}:${g}`},Xc=e=>Yg(yO(e).toISOString()),yO=e=>{const t=e.trim();if(t.includes("T")||t.includes("Z")){const o=new Date(t);if(!isNaN(o.getTime()))return o}let n=/^(\d{4})[-/](\d{1,2})[-/](\d{1,2})\s+(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?$/.exec(t);if(n)return new Date(Date.UTC(parseInt(n[1],10),parseInt(n[2],10)-1,parseInt(n[3],10),parseInt(n[4],10),parseInt(n[5],10),n[6]?parseInt(n[6],10):0));if(n=/^(\d{1,2})[./](\d{1,2})[./](\d{4})\s+(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?$/.exec(t),n)return new Date(Date.UTC(parseInt(n[3],10),parseInt(n[2],10)-1,parseInt(n[1],10),parseInt(n[4],10),parseInt(n[5],10),n[6]?parseInt(n[6],10):0));const r=new Date(t);return isNaN(r.getTime())?(console.warn(`Failed to parse date string: "${e}", using current date as fallback`),new Date):r},YJ=(e,t)=>{const n=t.getTime()-e.getTime(),r=Math.floor(n/1e3),o=Math.floor(r/60),l=Math.floor(o/60),c=o%60,d=r%60,f=[];return l>0&&f.push(`${String(l)} h`),c>0&&f.push(`${String(c)} min`),f.push(`${String(d)} sec`),f.join(" ")};function WJ({configuration:e,connectorState:t}){const r=((e==null?void 0:e.connector.source.configuration)??[]).map((d,f)=>{const h=d;return typeof h._id=="string"?{id:h._id,index:f}:void 0}).filter(d=>!!d),o=(t==null?void 0:t.states)??[],l=new Map(o.map(d=>[d._id,d])),c=r.map(({id:d,index:f})=>{const h=l.get(d);return h?{state:h,index:f}:void 0}).filter(d=>!!d);return s.jsx(rO,{title:"State Info",children:c.length===0?s.jsxs(_t,{children:[s.jsx(Rt,{children:"Connector state"}),s.jsx(Nt,{children:s.jsx("div",{className:"bg-muted min-h-[70px] cursor-not-allowed overflow-auto rounded-md px-3 py-2 font-mono text-sm whitespace-pre-wrap opacity-70",children:"No state available"})}),s.jsx(wn,{children:s.jsx(sT,{})})]}):s.jsx(s.Fragment,{children:c.map(({state:d,index:f})=>{const h=d.at||"",g=h?Yg(yO(h).toISOString()):"—",y=d.state,v=(()=>{try{return JSON.stringify(y,null,2)}catch{return typeof y=="string"?y:'"—"'}})();return s.jsxs(_t,{children:[s.jsx(Rt,{tooltip:`Created at ${g}`,children:`Connector state of configuration #${String(f+1)}`}),s.jsx(Nt,{children:s.jsx(EA,{value:v,displayOnly:!0,className:"bg-muted overflow-auto rounded-md text-sm",minHeightClass:"min-h-0",showCopyButton:!0})}),s.jsx(wn,{children:s.jsx(sT,{})})]},d._id)})})})}function QJ({configuration:e,onClose:t,onSubmit:n}){const[r,o]=m.useState(new Set),l=m.useId(),c=Xo({defaultValues:{runType:Dl.INCREMENTAL}}),{loading:d,loadingSpecification:f,connectorSpecification:h,fetchConnectorSpecification:g}=dc(),{dataMart:y}=Qo(),v=m.useCallback(async C=>{!r.has(C)&&!f&&(o(R=>new Set(R).add(C)),await g(C))},[r,f,g]);m.useEffect(()=>{e!=null&&e.connector.source.name&&v(e.connector.source.name)},[e,d,v]);const b=C=>{n&&n(C)},w=()=>{t&&t()},S=C=>{if(!C)return"text";switch(C){case fs.DATE:return"date";case fs.NUMBER:return"number";default:return"text"}};return f?s.jsx("div",{children:"Loading..."}):h?s.jsx(rl,{...c,children:s.jsxs(Jo,{id:l,noValidate:!0,onSubmit:C=>void c.handleSubmit(b)(C),children:[s.jsxs(al,{children:[s.jsxs(ua,{title:"General",children:[s.jsx(kt,{control:c.control,name:"runType",render:({field:C})=>s.jsxs(_t,{children:[s.jsx(Rt,{tooltip:"Select how you want to load data: incremental updates or full backfill for a period",children:"Run type"}),s.jsx(Nt,{children:s.jsxs(s.Fragment,{children:[s.jsx(QQ,{options:[{value:Dl.INCREMENTAL,label:"Incremental load"},{value:Dl.MANUAL_BACKFILL,label:"Backfill (custom period)"}],value:C.value,onChange:C.onChange,orientation:"horizontal"}),s.jsx(wn,{children:c.watch("runType")===Dl.MANUAL_BACKFILL?"Reloads all data for a specific time range from the source, replacing existing records for that period. Use when you need to correct or update historical data.":"Adds only new or updated records since the last run, using the current state of your Data Mart as a reference. Ideal for keeping data fresh without reloading what`s already there."})]})})]})}),c.watch("runType")===Dl.INCREMENTAL&&s.jsx(WJ,{configuration:e,connectorState:(y==null?void 0:y.connectorState)??null})]}),c.watch("runType")===Dl.MANUAL_BACKFILL&&s.jsx(ua,{title:"Run configuration",children:h.filter(C=>{var R;return(R=C.attributes)==null?void 0:R.includes(VD.MANUAL_BACKFILL)}).map(C=>s.jsx(kt,{control:c.control,name:`data.${C.name}`,render:()=>s.jsxs(_t,{children:[s.jsx(Rt,{tooltip:C.description,children:C.title??C.name}),s.jsx(Nt,{children:s.jsx(Ht,{id:C.name,placeholder:C.description,type:S(C.requiredType),defaultValue:typeof C.default=="string"||typeof C.default=="number"?C.default.toString():void 0,...c.register(`data.${C.name}`,{required:!0})})}),s.jsx(Ft,{})]},C.name)}))})]}),s.jsxs(sl,{children:[s.jsx(Se,{type:"submit",disabled:!c.formState.isValid||f,children:"Run"}),s.jsx(Se,{type:"button",variant:"outline",onClick:w,children:"Cancel"})]})]})}):s.jsx("div",{children:"No connector specification found"})}function XJ({isOpen:e,onClose:t,configuration:n,onSubmit:r}){return s.jsx(Bo,{open:e,onOpenChange:t,children:s.jsxs(Go,{children:[s.jsx(qo,{children:s.jsx(Zo,{children:"Manual Run"})}),s.jsx(QJ,{configuration:n,onClose:t,onSubmit:r})]})})}function vO({children:e,configuration:t,onManualRun:n,open:r}){const[o,l]=m.useState(r??!1),c=()=>{l(!0)},d=h=>{n(h),l(!1)},f=()=>e?s.jsx("div",{onClick:c,style:{cursor:"pointer"},children:e}):null;return s.jsxs(s.Fragment,{children:[f(),o&&s.jsx(Tu,{children:s.jsx(XJ,{isOpen:o,onClose:()=>{l(!1)},configuration:t,onSubmit:d})})]})}var Ul=(e=>(e.IDLE="IDLE",e.READY="READY",e.PROCESSING="PROCESSING",e.SUCCESS="SUCCESS",e.ERROR="ERROR",e.CANCELLING="CANCELLING",e.CANCELLED="CANCELLED",e))(Ul||{});const JJ=1e3;function eee(e,t){const[n,r]=m.useState(!1),[o,l]=m.useState(null),c=m.useRef(null),d=m.useRef(null),f=m.useRef(!0),h=m.useRef(t);h.current=t;const g=m.useCallback(C=>{f.current&&r(C)},[]),y=m.useCallback(C=>{f.current&&l(C)},[]),v=m.useCallback((C,R)=>{const j=C instanceof Error?C.message:"Schema actualization failed";It.dismiss(R),y(j),g(!1),c.current=null,d.current=null,It.error(j,{duration:void 0,id:R})},[y,g]),b=m.useCallback(async()=>{var R;const C=c.current;if((R=d.current)==null||R.abort(),C){It.dismiss(C);try{await sn.abortSchemaActualizeTrigger(e,C)}catch{}}c.current=null,d.current=null,g(!1)},[e,g]),w=m.useCallback(async(C,R)=>{var _;const j=D=>D===Ul.SUCCESS||D===Ul.ERROR||D===Ul.CANCELLED;for(;!R.aborted&&c.current===C;)try{const D=await sn.getSchemaActualizeTriggerStatus(e,C);if(j(D)){try{const A=await sn.getSchemaActualizeTriggerResponse(e,C);if(It.dismiss(C),A.success)(_=h.current)==null||_.call(h),It.success("Output schema actualized",{duration:void 0,id:C});else{const O=A.error??"Schema actualization failed";y(O),It.error(O,{duration:void 0,id:C})}}catch(A){const O=A instanceof Error?A.message:"Schema actualization failed";It.dismiss(C),y(O),It.error(O,{duration:void 0,id:C})}g(!1),c.current=null,d.current=null;return}await new Promise(A=>setTimeout(A,JJ))}catch(D){v(D,C)}},[e,y,g,v]),S=m.useCallback(async()=>{c.current&&await b(),y(null),g(!0);try{const{triggerId:C}=await sn.createSchemaActualizeTrigger(e);It.loading("Synchronizing schema with the data storage state. This may take a while.",{duration:1/0,id:C}),c.current=C;const R=new AbortController;d.current=R;try{await w(C,R.signal)}catch(j){v(j,C)}}catch(C){g(!1),y(C instanceof Error?C.message:"Failed to start schema actualization")}},[e,b,w,y,g,v]);return m.useEffect(()=>(f.current=!0,()=>{var R;f.current=!1;const C=c.current;(R=d.current)==null||R.abort(),C&&(It.dismiss(C),sn.abortSchemaActualizeTrigger(e,C).catch(()=>{})),c.current=null,d.current=null}),[e]),{run:S,isLoading:n,cancel:b,error:o}}function tee({id:e}){const{navigate:t}=Yo(),{dataMart:n,deleteDataMart:r,updateDataMartTitle:o,updateDataMartDescription:l,updateDataMartDefinition:c,actualizeDataMartSchema:d,updateDataMartSchema:f,publishDataMart:h,runDataMart:g,cancelDataMartRun:y,getDataMartRuns:v,loadMoreDataMartRuns:b,isLoading:w,error:S,getErrorMessage:C,runs:R,getDataMart:j}=BX(e),[_,D]=m.useState(!1),[A,O]=m.useState(!1),{id:T="",canPublish:M=!1,canActualizeSchema:F=!1,status:G={code:null,displayName:"",description:""},title:Y="",definition:Z=null,definitionType:J=null,validationErrors:H=[]}=n??{},K=m.useCallback(()=>{T&&j(T)},[T,j]),{run:k,isLoading:z}=eee(T,K),B=m.useCallback(async()=>{F&&await k()},[F,k]),ie=[{name:"Overview",path:"overview"},{name:"Data Setup",path:"data-setup"},{name:"Destinations",path:"reports"},{name:"Triggers",path:"triggers"},{name:"Run History",path:"run-history"}],xe=m.useCallback(async q=>{T&&await o(T,q)},[T,o]),L=m.useCallback(async()=>{if(T){O(!0);try{await h(T),B()}catch(q){console.log(q instanceof Error?q.message:"Failed to publish Data Mart")}finally{O(!1)}}},[T,h,B]),P=m.useCallback(async q=>{if(T){if(G.code!==Rr.PUBLISHED){on.error("Manual run is only available for published Data Marts");return}await g({id:T,payload:q})}},[T,G,g]);return n?s.jsxs("div",{className:"px-12 py-6",children:[s.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center space-x-1 md:-ml-10",children:[s.jsx(pu,{onClick:()=>{t("/data-marts")},variant:"ghost",size:"sm","aria-label":"Back to Data Marts",title:"Back to Data Marts",className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:s.jsx(D7,{className:"h-5 w-5"})}),s.jsx(iJ,{title:Y,onUpdate:xe,className:"text-2xl font-medium"})]}),s.jsxs("div",{className:"flex items-center gap-2"+(A?" opacity-50":""),style:{minWidth:"120px"},children:[s.jsxs("div",{className:"ml-4 flex items-center gap-2",children:[s.jsxs(bt,{children:[s.jsx(St,{asChild:!0,children:s.jsx("div",{children:s.jsx(Kf,{type:G.code===Rr.PUBLISHED?In.SUCCESS:In.NEUTRAL,variant:"subtle",children:G.displayName})})}),s.jsx(Ct,{children:G.code===Rr.PUBLISHED?"Your published Data Mart is ready for scheduled runs":"Draft Data Mart is not available for scheduled runs. Publish it to activate scheduling."})]}),G.code===Rr.DRAFT&&s.jsxs(bt,{children:[s.jsx(St,{asChild:!0,children:s.jsx("div",{children:s.jsxs(pu,{variant:"default",onClick:()=>{L()},disabled:A||!M,className:"ml-2 flex items-center gap-1",children:[s.jsx(ng,{className:"h-4 w-4"}),"Publish Data Mart"]})})}),!M&&s.jsxs(Ct,{children:[s.jsx("div",{children:"Cannot publish Data Mart. Fix the issues below."}),H.length>0&&s.jsx("ul",{className:"mt-1 list-disc space-y-1 pl-4",children:dY(H).map((q,te)=>s.jsx("li",{children:q},te))})]})]})]}),s.jsxs(ur,{children:[s.jsx(dr,{asChild:!0,children:s.jsx(pu,{variant:"ghost",children:s.jsx(pk,{className:"h-5 w-5"})})}),s.jsxs(fr,{align:"end",children:[J===Fe.CONNECTOR&&s.jsxs(s.Fragment,{children:[s.jsx(vO,{configuration:Z??null,onManualRun:q=>{P({runType:q.runType,data:q.data})},children:s.jsxs(pt,{onClick:q=>{q.preventDefault()},children:[s.jsx(rg,{className:"text-foreground h-4 w-4"}),s.jsx("span",{children:"Manual Run..."})]})}),s.jsx(ma,{})]}),s.jsxs(pt,{onClick:()=>{D(!0)},children:[s.jsx(Xs,{className:"h-4 w-4 text-red-600"}),s.jsx("span",{className:"text-red-600",children:"Delete Data Mart"})]})]})]})]})]}),s.jsx("div",{children:s.jsx("nav",{className:"-mb-px flex space-x-4 border-b","aria-label":"Tabs",role:"tablist",children:ie.map(q=>s.jsx(Tf,{to:q.path,className:({isActive:te})=>ne("border-b-2 px-4 py-2 text-sm font-medium whitespace-nowrap",te?"border-primary text-primary":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-400 dark:hover:border-gray-200 dark:hover:text-gray-200"),children:q.name},q.name))})}),s.jsx("div",{className:"pt-4",children:s.jsx(g_,{context:{dataMart:n,isLoading:w,error:S,getErrorMessage:C,updateDataMartDescription:l,updateDataMartDefinition:c,actualizeDataMartSchema:d,updateDataMartSchema:f,runDataMart:g,cancelDataMartRun:y,getDataMartRuns:v,loadMoreDataMartRuns:b,runs:R,getDataMart:j,runSchemaActualization:B,isSchemaActualizationLoading:z}})}),s.jsx(Tr,{open:_,onOpenChange:D,title:"Delete Data Mart",description:s.jsxs(s.Fragment,{children:["Are you sure you want to delete ",s.jsxs("strong",{children:['"',Y,'"']}),"? This action cannot be undone."]}),confirmLabel:"Delete",cancelLabel:"Cancel",variant:"destructive",onConfirm:()=>{(async()=>{try{await r(T),D(!1),t("/data-marts")}catch(q){console.error("Failed to delete Data Mart:",q)}})()}})]}):s.jsxs("div",{className:"dm-page-content flex flex-col gap-4 py-4 md:py-8",children:[s.jsx(hs,{className:"h-16 w-full"},0),Array.from({length:3}).map((q,te)=>s.jsx(hs,{className:"h-48 w-full"},te+1))]})}function nee({description:e,onUpdate:t,className:n,placeholder:r="Add description...",minWidth:o="100%",minHeight:l="100px"}){const[c,d]=m.useState(e??""),[f,h]=m.useState(!1),[g,y]=m.useState(!1),v=m.useRef(null);m.useEffect(()=>{d(e??"")},[e]),m.useEffect(()=>{if(v.current&&f){v.current.focus();const R=v.current.value.length;v.current.setSelectionRange(R,R),b(v.current)}},[f]);const b=R=>{R.style.height="auto",R.style.height=`${String(R.scrollHeight)}px`},w=R=>{d(R.target.value),b(R.target)},S=async()=>{const R=c.trim();if(R===(e??"")){h(!1);return}try{y(!0),await t(R===""?null:R),h(!1)}catch(_){console.error("Failed to update description:",_),d(e??"")}finally{y(!1)}},C=R=>{R.key==="Enter"&&R.ctrlKey?(R.preventDefault(),S()):R.key==="Escape"&&(R.preventDefault(),d(e??""),h(!1))};return f?s.jsxs("div",{className:"w-full",children:[s.jsx(Ko,{ref:v,value:c,onChange:w,onBlur:()=>void S(),onKeyDown:C,placeholder:r,className:ne("m-0 w-full border-0 bg-white p-2 shadow-none dark:bg-white/4","focus-visible:ring-primary focus-visible:ring-0",{"opacity-50":g}),style:{fontSize:"inherit",lineHeight:"inherit",fontFamily:"inherit",resize:"vertical",minHeight:l,minWidth:o},disabled:g}),s.jsxs("div",{className:"mt-2 text-xs text-gray-500",children:[s.jsxs("span",{children:["Press"," ",s.jsx("kbd",{className:"rounded border border-neutral-200 bg-neutral-100 px-1 py-0.5 font-sans dark:border-neutral-900 dark:bg-neutral-900",children:"Ctrl+Enter"})," ","to save •"," "]}),s.jsxs("span",{children:[s.jsx("kbd",{className:"rounded border border-neutral-200 bg-neutral-100 px-1 py-0.5 font-sans dark:border-neutral-900 dark:bg-neutral-900",children:"Esc"})," ","to cancel •"," "]}),s.jsx("span",{children:"Changes are also saved when you click outside"})]})]}):s.jsx("div",{className:"flex w-full items-center gap-4 rounded-md border-b border-gray-200 bg-white transition-shadow duration-200 hover:shadow-sm dark:border-0 dark:bg-white/4",children:s.jsx("div",{onClick:()=>{h(!0)},className:ne("min-h-24 cursor-pointer rounded p-2 whitespace-pre-wrap","transition-colors duration-150",!e&&"text-gray-400 italic",n),style:{minWidth:o},children:e??r})})}function ree(){const{dataMart:e,updateDataMartDescription:t}=Ia(),n=async r=>{await t(e.id,r)};return s.jsx("div",{children:s.jsx(nee,{description:e.description,onUpdate:n,placeholder:"Add a description for this Data Mart..."})})}function oT(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function aee(e){if(Array.isArray(e))return e}function see(e,t,n){return(t=fee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oee(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,o,l,c,d=[],f=!0,h=!1;try{if(l=(n=n.call(e)).next,t!==0)for(;!(f=(r=l.call(n)).done)&&(d.push(r.value),d.length!==t);f=!0);}catch(g){h=!0,o=g}finally{try{if(!f&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(h)throw o}}return d}}function iee(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
694
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function lT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iT(Object(n),!0).forEach(function(r){see(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lee(e,t){if(e==null)return{};var n,r,o=cee(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function cee(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function uee(e,t){return aee(e)||oee(e,t)||hee(e,t)||iee()}function dee(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fee(e){var t=dee(e,"string");return typeof t=="symbol"?t:t+""}function hee(e,t){if(e){if(typeof e=="string")return oT(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?oT(e,t):void 0}}function mee(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function uT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cT(Object(n),!0).forEach(function(r){mee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pee(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return t.reduceRight(function(o,l){return l(o)},r)}}function Jd(e){return function t(){for(var n=this,r=arguments.length,o=new Array(r),l=0;l<r;l++)o[l]=arguments[l];return o.length>=e.length?e.apply(this,o):function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];return t.apply(n,[].concat(o,d))}}}function $p(e){return{}.toString.call(e).includes("Object")}function gee(e){return!Object.keys(e).length}function Sf(e){return typeof e=="function"}function yee(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function vee(e,t){return $p(t)||zi("changeType"),Object.keys(t).some(function(n){return!yee(e,n)})&&zi("changeField"),t}function xee(e){Sf(e)||zi("selectorType")}function bee(e){Sf(e)||$p(e)||zi("handlerType"),$p(e)&&Object.values(e).some(function(t){return!Sf(t)})&&zi("handlersType")}function See(e){e||zi("initialIsRequired"),$p(e)||zi("initialType"),gee(e)&&zi("initialContent")}function Cee(e,t){throw new Error(e[t]||e.default)}var Eee={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},zi=Jd(Cee)(Eee),Fm={changes:vee,selector:xee,handler:bee,initial:See};function wee(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Fm.initial(e),Fm.handler(t);var n={current:e},r=Jd(Tee)(n,t),o=Jd(jee)(n),l=Jd(Fm.changes)(e),c=Jd(Ree)(n);function d(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(g){return g};return Fm.selector(h),h(n.current)}function f(h){pee(r,o,l,c)(h)}return[d,f]}function Ree(e,t){return Sf(t)?t(e.current):t}function jee(e,t){return e.current=uT(uT({},e.current),t),t}function Tee(e,t,n){return Sf(t)?t(e.current):Object.keys(n).forEach(function(r){var o;return(o=t[r])===null||o===void 0?void 0:o.call(t,e.current[r])}),n}var _ee={create:wee},Nee={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.54.0/min/vs"}};function Aee(e){return function t(){for(var n=this,r=arguments.length,o=new Array(r),l=0;l<r;l++)o[l]=arguments[l];return o.length>=e.length?e.apply(this,o):function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];return t.apply(n,[].concat(o,d))}}}function Dee(e){return{}.toString.call(e).includes("Object")}function Oee(e){return e||dT("configIsRequired"),Dee(e)||dT("configType"),e.urls?(Mee(),{paths:{vs:e.urls.monacoBase}}):e}function Mee(){console.warn(xO.deprecation)}function Iee(e,t){throw new Error(e[t]||e.default)}var xO={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
695
+ You are using deprecated way of configuration.
696
+
697
+ Instead of using
698
+ monaco.config({ urls: { monacoBase: '...' } })
699
+ use
700
+ monaco.config({ paths: { vs: '...' } })
701
+
702
+ For more please check the link https://github.com/suren-atoyan/monaco-loader#config
703
+ `},dT=Aee(Iee)(xO),kee={config:Oee},Lee=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o){return n.reduceRight(function(l,c){return c(l)},o)}};function bO(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],bO(e[n],t[n]))}),lT(lT({},e),t)}var Pee={type:"cancelation",msg:"operation is manually canceled"};function t0(e){var t=!1,n=new Promise(function(r,o){e.then(function(l){return t?o(Pee):r(l)}),e.catch(o)});return n.cancel=function(){return t=!0},n}var Uee=["monaco"],Fee=_ee.create({config:Nee,isInitialized:!1,resolve:null,reject:null,monaco:null}),SO=uee(Fee,2),eh=SO[0],Wg=SO[1];function Vee(e){var t=kee.config(e),n=t.monaco,r=lee(t,Uee);Wg(function(o){return{config:bO(o.config,r),monaco:n}})}function zee(){var e=eh(function(t){var n=t.monaco,r=t.isInitialized,o=t.resolve;return{monaco:n,isInitialized:r,resolve:o}});if(!e.isInitialized){if(Wg({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),t0(n0);if(window.monaco&&window.monaco.editor)return CO(window.monaco),e.resolve(window.monaco),t0(n0);Lee(Hee,Bee)(Gee)}return t0(n0)}function Hee(e){return document.body.appendChild(e)}function $ee(e){var t=document.createElement("script");return e&&(t.src=e),t}function Bee(e){var t=eh(function(r){var o=r.config,l=r.reject;return{config:o,reject:l}}),n=$ee("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function Gee(){var e=eh(function(n){var r=n.config,o=n.resolve,l=n.reject;return{config:r,resolve:o,reject:l}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){var r=n.m;CO(r),e.resolve(r)},function(n){e.reject(n)})}function CO(e){eh().monaco||Wg({monaco:e})}function qee(){return eh(function(e){var t=e.monaco;return t})}var n0=new Promise(function(e,t){return Wg({resolve:e,reject:t})}),EO={config:Vee,init:zee,__getMonacoInstance:qee},Zee={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},r0=Zee,Kee={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Yee=Kee;function Wee({children:e}){return ye.createElement("div",{style:Yee.container},e)}var Qee=Wee,Xee=Qee;function Jee({width:e,height:t,isEditorReady:n,loading:r,_ref:o,className:l,wrapperProps:c}){return ye.createElement("section",{style:{...r0.wrapper,width:e,height:t},...c},!n&&ye.createElement(Xee,null,r),ye.createElement("div",{ref:o,style:{...r0.fullWidth,...!n&&r0.hide},className:l}))}var ete=Jee,wO=m.memo(ete);function tte(e){m.useEffect(e,[])}var RO=tte;function nte(e,t,n=!0){let r=m.useRef(!0);m.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var _a=nte;function rf(){}function lu(e,t,n,r){return rte(e,r)||ate(e,t,n,r)}function rte(e,t){return e.editor.getModel(jO(e,t))}function ate(e,t,n,r){return e.editor.createModel(t,n,r?jO(e,r):void 0)}function jO(e,t){return e.Uri.parse(t)}function ste({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:o,originalModelPath:l,modifiedModelPath:c,keepCurrentOriginalModel:d=!1,keepCurrentModifiedModel:f=!1,theme:h="light",loading:g="Loading...",options:y={},height:v="100%",width:b="100%",className:w,wrapperProps:S={},beforeMount:C=rf,onMount:R=rf}){let[j,_]=m.useState(!1),[D,A]=m.useState(!0),O=m.useRef(null),T=m.useRef(null),M=m.useRef(null),F=m.useRef(R),G=m.useRef(C),Y=m.useRef(!1);RO(()=>{let K=EO.init();return K.then(k=>(T.current=k)&&A(!1)).catch(k=>(k==null?void 0:k.type)!=="cancelation"&&console.error("Monaco initialization: error:",k)),()=>O.current?H():K.cancel()}),_a(()=>{if(O.current&&T.current){let K=O.current.getOriginalEditor(),k=lu(T.current,e||"",r||n||"text",l||"");k!==K.getModel()&&K.setModel(k)}},[l],j),_a(()=>{if(O.current&&T.current){let K=O.current.getModifiedEditor(),k=lu(T.current,t||"",o||n||"text",c||"");k!==K.getModel()&&K.setModel(k)}},[c],j),_a(()=>{let K=O.current.getModifiedEditor();K.getOption(T.current.editor.EditorOption.readOnly)?K.setValue(t||""):t!==K.getValue()&&(K.executeEdits("",[{range:K.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),K.pushUndoStop())},[t],j),_a(()=>{var K,k;(k=(K=O.current)==null?void 0:K.getModel())==null||k.original.setValue(e||"")},[e],j),_a(()=>{let{original:K,modified:k}=O.current.getModel();T.current.editor.setModelLanguage(K,r||n||"text"),T.current.editor.setModelLanguage(k,o||n||"text")},[n,r,o],j),_a(()=>{var K;(K=T.current)==null||K.editor.setTheme(h)},[h],j),_a(()=>{var K;(K=O.current)==null||K.updateOptions(y)},[y],j);let Z=m.useCallback(()=>{var z;if(!T.current)return;G.current(T.current);let K=lu(T.current,e||"",r||n||"text",l||""),k=lu(T.current,t||"",o||n||"text",c||"");(z=O.current)==null||z.setModel({original:K,modified:k})},[n,t,o,e,r,l,c]),J=m.useCallback(()=>{var K;!Y.current&&M.current&&(O.current=T.current.editor.createDiffEditor(M.current,{automaticLayout:!0,...y}),Z(),(K=T.current)==null||K.editor.setTheme(h),_(!0),Y.current=!0)},[y,h,Z]);m.useEffect(()=>{j&&F.current(O.current,T.current)},[j]),m.useEffect(()=>{!D&&!j&&J()},[D,j,J]);function H(){var k,z,B,ie;let K=(k=O.current)==null?void 0:k.getModel();d||((z=K==null?void 0:K.original)==null||z.dispose()),f||((B=K==null?void 0:K.modified)==null||B.dispose()),(ie=O.current)==null||ie.dispose()}return ye.createElement(wO,{width:b,height:v,isEditorReady:j,loading:g,_ref:M,className:w,wrapperProps:S})}var ote=ste;m.memo(ote);function ite(e){let t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}var lte=ite,Vm=new Map;function cte({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:o,path:l,theme:c="light",line:d,loading:f="Loading...",options:h={},overrideServices:g={},saveViewState:y=!0,keepCurrentModel:v=!1,width:b="100%",height:w="100%",className:S,wrapperProps:C={},beforeMount:R=rf,onMount:j=rf,onChange:_,onValidate:D=rf}){let[A,O]=m.useState(!1),[T,M]=m.useState(!0),F=m.useRef(null),G=m.useRef(null),Y=m.useRef(null),Z=m.useRef(j),J=m.useRef(R),H=m.useRef(),K=m.useRef(r),k=lte(l),z=m.useRef(!1),B=m.useRef(!1);RO(()=>{let L=EO.init();return L.then(P=>(F.current=P)&&M(!1)).catch(P=>(P==null?void 0:P.type)!=="cancelation"&&console.error("Monaco initialization: error:",P)),()=>G.current?xe():L.cancel()}),_a(()=>{var P,q,te,ue;let L=lu(F.current,e||r||"",t||o||"",l||n||"");L!==((P=G.current)==null?void 0:P.getModel())&&(y&&Vm.set(k,(q=G.current)==null?void 0:q.saveViewState()),(te=G.current)==null||te.setModel(L),y&&((ue=G.current)==null||ue.restoreViewState(Vm.get(l))))},[l],A),_a(()=>{var L;(L=G.current)==null||L.updateOptions(h)},[h],A),_a(()=>{!G.current||r===void 0||(G.current.getOption(F.current.editor.EditorOption.readOnly)?G.current.setValue(r):r!==G.current.getValue()&&(B.current=!0,G.current.executeEdits("",[{range:G.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),G.current.pushUndoStop(),B.current=!1))},[r],A),_a(()=>{var P,q;let L=(P=G.current)==null?void 0:P.getModel();L&&o&&((q=F.current)==null||q.editor.setModelLanguage(L,o))},[o],A),_a(()=>{var L;d!==void 0&&((L=G.current)==null||L.revealLine(d))},[d],A),_a(()=>{var L;(L=F.current)==null||L.editor.setTheme(c)},[c],A);let ie=m.useCallback(()=>{var L;if(!(!Y.current||!F.current)&&!z.current){J.current(F.current);let P=l||n,q=lu(F.current,r||e||"",t||o||"",P||"");G.current=(L=F.current)==null?void 0:L.editor.create(Y.current,{model:q,automaticLayout:!0,...h},g),y&&G.current.restoreViewState(Vm.get(P)),F.current.editor.setTheme(c),d!==void 0&&G.current.revealLine(d),O(!0),z.current=!0}},[e,t,n,r,o,l,h,g,y,c,d]);m.useEffect(()=>{A&&Z.current(G.current,F.current)},[A]),m.useEffect(()=>{!T&&!A&&ie()},[T,A,ie]),K.current=r,m.useEffect(()=>{var L,P;A&&_&&((L=H.current)==null||L.dispose(),H.current=(P=G.current)==null?void 0:P.onDidChangeModelContent(q=>{B.current||_(G.current.getValue(),q)}))},[A,_]),m.useEffect(()=>{if(A){let L=F.current.editor.onDidChangeMarkers(P=>{var te;let q=(te=G.current.getModel())==null?void 0:te.uri;if(q&&P.find(ue=>ue.path===q.path)){let ue=F.current.editor.getModelMarkers({resource:q});D==null||D(ue)}});return()=>{L==null||L.dispose()}}return()=>{}},[A,D]);function xe(){var L,P;(L=H.current)==null||L.dispose(),v?y&&Vm.set(l,G.current.saveViewState()):(P=G.current.getModel())==null||P.dispose(),G.current.dispose()}return ye.createElement(wO,{width:b,height:w,isEditorReady:A,loading:f,_ref:Y,className:S,wrapperProps:C})}var ute=cte,TO=m.memo(ute);function dte({initialValue:e,onChange:t}){const[n,r]=m.useState((e==null?void 0:e.sqlQuery)??""),{resolvedTheme:o}=Ob();m.useEffect(()=>{e!=null&&e.sqlQuery&&e.sqlQuery!==n&&r(e.sqlQuery)},[e,n]);function l(c){c!==void 0&&(r(c),t({sqlQuery:c}))}return s.jsx("div",{className:"shadow-xs",children:s.jsx(TO,{className:"overflow-hidden rounded-md border border-gray-200 dark:border-gray-200/4",height:"30vh",language:"sql",value:n,onChange:l,theme:o==="dark"?"vs-dark":"light",options:{selectOnLineNumbers:!0,hideCursorInOverviewRuler:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,overviewRulerBorder:!1}})})}function m1({icon:e,title:t,subtitle:n,rightContent:r,onClick:o,className:l}){const c=e;return s.jsxs("div",{className:ne("group flex items-center gap-4 rounded-md border-b border-gray-200 bg-white transition-shadow duration-200 hover:shadow-xs dark:border-0 dark:bg-white/2",o&&"cursor-pointer dark:hover:bg-white/5",l),onClick:o,children:[s.jsxs("div",{className:"flex flex-grow items-start justify-center gap-3 px-6 py-5",children:[e&&s.jsx("div",{className:"flex items-center justify-center",children:s.jsx(c,{className:"h-6 w-6"})}),s.jsxs("div",{className:"flex flex-grow flex-col gap-1",children:[s.jsx("div",{className:"text-md font-medium",children:t}),n&&s.jsx("div",{className:"text-muted-foreground/60 text-sm",children:n})]})]}),s.jsxs("div",{className:"flex items-center justify-center gap-2 p-4",children:[r,o&&s.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-full transition-colors duration-200 group-hover:bg-gray-200/50 dark:group-hover:bg-white/4",children:s.jsx(La,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})]})]})}var fT=1,fte=.9,hte=.8,mte=.17,a0=.1,s0=.999,pte=.9999,gte=.99,yte=/[\\\/_+.#"@\[\(\{&]/,vte=/[\\\/_+.#"@\[\(\{&]/g,xte=/[\s-]/,_O=/[\s-]/g;function p1(e,t,n,r,o,l,c){if(l===t.length)return o===e.length?fT:gte;var d=`${o},${l}`;if(c[d]!==void 0)return c[d];for(var f=r.charAt(l),h=n.indexOf(f,o),g=0,y,v,b,w;h>=0;)y=p1(e,t,n,r,h+1,l+1,c),y>g&&(h===o?y*=fT:yte.test(e.charAt(h-1))?(y*=hte,b=e.slice(o,h-1).match(vte),b&&o>0&&(y*=Math.pow(s0,b.length))):xte.test(e.charAt(h-1))?(y*=fte,w=e.slice(o,h-1).match(_O),w&&o>0&&(y*=Math.pow(s0,w.length))):(y*=mte,o>0&&(y*=Math.pow(s0,h-o))),e.charAt(h)!==t.charAt(l)&&(y*=pte)),(y<a0&&n.charAt(h-1)===r.charAt(l+1)||r.charAt(l+1)===r.charAt(l)&&n.charAt(h-1)!==r.charAt(l))&&(v=p1(e,t,n,r,h+1,l+2,c),v*a0>y&&(y=v*a0)),y>g&&(g=y),h=n.indexOf(f,h+1);return c[d]=g,g}function hT(e){return e.toLowerCase().replace(_O," ")}function bte(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,p1(e,t,hT(e),hT(t),0,0,{})}var Gd='[cmdk-group=""]',o0='[cmdk-group-items=""]',Ste='[cmdk-group-heading=""]',NO='[cmdk-item=""]',mT=`${NO}:not([aria-disabled="true"])`,g1="cmdk-item-select",au="data-value",Cte=(e,t,n)=>bte(e,t,n),AO=m.createContext(void 0),th=()=>m.useContext(AO),DO=m.createContext(void 0),jS=()=>m.useContext(DO),OO=m.createContext(void 0),MO=m.forwardRef((e,t)=>{let n=su(()=>{var P,q;return{search:"",value:(q=(P=e.value)!=null?P:e.defaultValue)!=null?q:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=su(()=>new Set),o=su(()=>new Map),l=su(()=>new Map),c=su(()=>new Set),d=IO(e),{label:f,children:h,value:g,onValueChange:y,filter:v,shouldFilter:b,loop:w,disablePointerSelection:S=!1,vimBindings:C=!0,...R}=e,j=Ln(),_=Ln(),D=Ln(),A=m.useRef(null),O=Mte();Ql(()=>{if(g!==void 0){let P=g.trim();n.current.value=P,T.emit()}},[g]),Ql(()=>{O(6,J)},[]);let T=m.useMemo(()=>({subscribe:P=>(c.current.add(P),()=>c.current.delete(P)),snapshot:()=>n.current,setState:(P,q,te)=>{var ue,ve,le,Ae;if(!Object.is(n.current[P],q)){if(n.current[P]=q,P==="search")Z(),G(),O(1,Y);else if(P==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let we=document.getElementById(D);we?we.focus():(ue=document.getElementById(j))==null||ue.focus()}if(O(7,()=>{var we;n.current.selectedItemId=(we=H())==null?void 0:we.id,T.emit()}),te||O(5,J),((ve=d.current)==null?void 0:ve.value)!==void 0){let we=q??"";(Ae=(le=d.current).onValueChange)==null||Ae.call(le,we);return}}T.emit()}},emit:()=>{c.current.forEach(P=>P())}}),[]),M=m.useMemo(()=>({value:(P,q,te)=>{var ue;q!==((ue=l.current.get(P))==null?void 0:ue.value)&&(l.current.set(P,{value:q,keywords:te}),n.current.filtered.items.set(P,F(q,te)),O(2,()=>{G(),T.emit()}))},item:(P,q)=>(r.current.add(P),q&&(o.current.has(q)?o.current.get(q).add(P):o.current.set(q,new Set([P]))),O(3,()=>{Z(),G(),n.current.value||Y(),T.emit()}),()=>{l.current.delete(P),r.current.delete(P),n.current.filtered.items.delete(P);let te=H();O(4,()=>{Z(),(te==null?void 0:te.getAttribute("id"))===P&&Y(),T.emit()})}),group:P=>(o.current.has(P)||o.current.set(P,new Set),()=>{l.current.delete(P),o.current.delete(P)}),filter:()=>d.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>d.current.disablePointerSelection,listId:j,inputId:D,labelId:_,listInnerRef:A}),[]);function F(P,q){var te,ue;let ve=(ue=(te=d.current)==null?void 0:te.filter)!=null?ue:Cte;return P?ve(P,n.current.search,q):0}function G(){if(!n.current.search||d.current.shouldFilter===!1)return;let P=n.current.filtered.items,q=[];n.current.filtered.groups.forEach(ue=>{let ve=o.current.get(ue),le=0;ve.forEach(Ae=>{let we=P.get(Ae);le=Math.max(we,le)}),q.push([ue,le])});let te=A.current;K().sort((ue,ve)=>{var le,Ae;let we=ue.getAttribute("id"),Ne=ve.getAttribute("id");return((le=P.get(Ne))!=null?le:0)-((Ae=P.get(we))!=null?Ae:0)}).forEach(ue=>{let ve=ue.closest(o0);ve?ve.appendChild(ue.parentElement===ve?ue:ue.closest(`${o0} > *`)):te.appendChild(ue.parentElement===te?ue:ue.closest(`${o0} > *`))}),q.sort((ue,ve)=>ve[1]-ue[1]).forEach(ue=>{var ve;let le=(ve=A.current)==null?void 0:ve.querySelector(`${Gd}[${au}="${encodeURIComponent(ue[0])}"]`);le==null||le.parentElement.appendChild(le)})}function Y(){let P=K().find(te=>te.getAttribute("aria-disabled")!=="true"),q=P==null?void 0:P.getAttribute(au);T.setState("value",q||void 0)}function Z(){var P,q,te,ue;if(!n.current.search||d.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ve=0;for(let le of r.current){let Ae=(q=(P=l.current.get(le))==null?void 0:P.value)!=null?q:"",we=(ue=(te=l.current.get(le))==null?void 0:te.keywords)!=null?ue:[],Ne=F(Ae,we);n.current.filtered.items.set(le,Ne),Ne>0&&ve++}for(let[le,Ae]of o.current)for(let we of Ae)if(n.current.filtered.items.get(we)>0){n.current.filtered.groups.add(le);break}n.current.filtered.count=ve}function J(){var P,q,te;let ue=H();ue&&(((P=ue.parentElement)==null?void 0:P.firstChild)===ue&&((te=(q=ue.closest(Gd))==null?void 0:q.querySelector(Ste))==null||te.scrollIntoView({block:"nearest"})),ue.scrollIntoView({block:"nearest"}))}function H(){var P;return(P=A.current)==null?void 0:P.querySelector(`${NO}[aria-selected="true"]`)}function K(){var P;return Array.from(((P=A.current)==null?void 0:P.querySelectorAll(mT))||[])}function k(P){let q=K()[P];q&&T.setState("value",q.getAttribute(au))}function z(P){var q;let te=H(),ue=K(),ve=ue.findIndex(Ae=>Ae===te),le=ue[ve+P];(q=d.current)!=null&&q.loop&&(le=ve+P<0?ue[ue.length-1]:ve+P===ue.length?ue[0]:ue[ve+P]),le&&T.setState("value",le.getAttribute(au))}function B(P){let q=H(),te=q==null?void 0:q.closest(Gd),ue;for(;te&&!ue;)te=P>0?Dte(te,Gd):Ote(te,Gd),ue=te==null?void 0:te.querySelector(mT);ue?T.setState("value",ue.getAttribute(au)):z(P)}let ie=()=>k(K().length-1),xe=P=>{P.preventDefault(),P.metaKey?ie():P.altKey?B(1):z(1)},L=P=>{P.preventDefault(),P.metaKey?k(0):P.altKey?B(-1):z(-1)};return m.createElement(et.div,{ref:t,tabIndex:-1,...R,"cmdk-root":"",onKeyDown:P=>{var q;(q=R.onKeyDown)==null||q.call(R,P);let te=P.nativeEvent.isComposing||P.keyCode===229;if(!(P.defaultPrevented||te))switch(P.key){case"n":case"j":{C&&P.ctrlKey&&xe(P);break}case"ArrowDown":{xe(P);break}case"p":case"k":{C&&P.ctrlKey&&L(P);break}case"ArrowUp":{L(P);break}case"Home":{P.preventDefault(),k(0);break}case"End":{P.preventDefault(),ie();break}case"Enter":{P.preventDefault();let ue=H();if(ue){let ve=new Event(g1);ue.dispatchEvent(ve)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:kte},f),Qg(e,P=>m.createElement(DO.Provider,{value:T},m.createElement(AO.Provider,{value:M},P))))}),Ete=m.forwardRef((e,t)=>{var n,r;let o=Ln(),l=m.useRef(null),c=m.useContext(OO),d=th(),f=IO(e),h=(r=(n=f.current)==null?void 0:n.forceMount)!=null?r:c==null?void 0:c.forceMount;Ql(()=>{if(!h)return d.item(o,c==null?void 0:c.id)},[h]);let g=kO(o,l,[e.value,e.children,l],e.keywords),y=jS(),v=Wi(O=>O.value&&O.value===g.current),b=Wi(O=>h||d.filter()===!1?!0:O.search?O.filtered.items.get(o)>0:!0);m.useEffect(()=>{let O=l.current;if(!(!O||e.disabled))return O.addEventListener(g1,w),()=>O.removeEventListener(g1,w)},[b,e.onSelect,e.disabled]);function w(){var O,T;S(),(T=(O=f.current).onSelect)==null||T.call(O,g.current)}function S(){y.setState("value",g.current,!0)}if(!b)return null;let{disabled:C,value:R,onSelect:j,forceMount:_,keywords:D,...A}=e;return m.createElement(et.div,{ref:Lr(l,t),...A,id:o,"cmdk-item":"",role:"option","aria-disabled":!!C,"aria-selected":!!v,"data-disabled":!!C,"data-selected":!!v,onPointerMove:C||d.getDisablePointerSelection()?void 0:S,onClick:C?void 0:w},e.children)}),wte=m.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...l}=e,c=Ln(),d=m.useRef(null),f=m.useRef(null),h=Ln(),g=th(),y=Wi(b=>o||g.filter()===!1?!0:b.search?b.filtered.groups.has(c):!0);Ql(()=>g.group(c),[]),kO(c,d,[e.value,e.heading,f]);let v=m.useMemo(()=>({id:c,forceMount:o}),[o]);return m.createElement(et.div,{ref:Lr(d,t),...l,"cmdk-group":"",role:"presentation",hidden:y?void 0:!0},n&&m.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:h},n),Qg(e,b=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?h:void 0},m.createElement(OO.Provider,{value:v},b))))}),Rte=m.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=m.useRef(null),l=Wi(c=>!c.search);return!n&&!l?null:m.createElement(et.div,{ref:Lr(o,t),...r,"cmdk-separator":"",role:"separator"})}),jte=m.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,l=jS(),c=Wi(h=>h.search),d=Wi(h=>h.selectedItemId),f=th();return m.useEffect(()=>{e.value!=null&&l.setState("search",e.value)},[e.value]),m.createElement(et.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":d,id:f.inputId,type:"text",value:o?e.value:c,onChange:h=>{o||l.setState("search",h.target.value),n==null||n(h.target.value)}})}),Tte=m.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,l=m.useRef(null),c=m.useRef(null),d=Wi(h=>h.selectedItemId),f=th();return m.useEffect(()=>{if(c.current&&l.current){let h=c.current,g=l.current,y,v=new ResizeObserver(()=>{y=requestAnimationFrame(()=>{let b=h.offsetHeight;g.style.setProperty("--cmdk-list-height",b.toFixed(1)+"px")})});return v.observe(h),()=>{cancelAnimationFrame(y),v.unobserve(h)}}},[]),m.createElement(et.div,{ref:Lr(l,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":d,"aria-label":r,id:f.listId},Qg(e,h=>m.createElement("div",{ref:Lr(c,f.listInnerRef),"cmdk-list-sizer":""},h)))}),_te=m.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:l,container:c,...d}=e;return m.createElement(cg,{open:n,onOpenChange:r},m.createElement(ug,{container:c},m.createElement(dg,{"cmdk-overlay":"",className:o}),m.createElement(fg,{"aria-label":e.label,"cmdk-dialog":"",className:l},m.createElement(MO,{ref:t,...d}))))}),Nte=m.forwardRef((e,t)=>Wi(n=>n.filtered.count===0)?m.createElement(et.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Ate=m.forwardRef((e,t)=>{let{progress:n,children:r,label:o="Loading...",...l}=e;return m.createElement(et.div,{ref:t,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Qg(e,c=>m.createElement("div",{"aria-hidden":!0},c)))}),$u=Object.assign(MO,{List:Tte,Item:Ete,Input:jte,Group:wte,Separator:Rte,Dialog:_te,Empty:Nte,Loading:Ate});function Dte(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Ote(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function IO(e){let t=m.useRef(e);return Ql(()=>{t.current=e}),t}var Ql=typeof window>"u"?m.useEffect:m.useLayoutEffect;function su(e){let t=m.useRef();return t.current===void 0&&(t.current=e()),t}function Wi(e){let t=jS(),n=()=>e(t.snapshot());return m.useSyncExternalStore(t.subscribe,n,n)}function kO(e,t,n,r=[]){let o=m.useRef(),l=th();return Ql(()=>{var c;let d=(()=>{var h;for(let g of n){if(typeof g=="string")return g.trim();if(typeof g=="object"&&"current"in g)return g.current?(h=g.current.textContent)==null?void 0:h.trim():o.current}})(),f=r.map(h=>h.trim());l.value(e,d,f),(c=t.current)==null||c.setAttribute(au,d),o.current=d}),o}var Mte=()=>{let[e,t]=m.useState(),n=su(()=>new Map);return Ql(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}};function Ite(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Qg({asChild:e,children:t},n){return e&&m.isValidElement(t)?m.cloneElement(Ite(t),{ref:t.ref},n(t.props.children)):n(t)}var kte={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function LO({className:e,...t}){return s.jsx($u,{"data-slot":"command",className:ne("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function PO({className:e,...t}){return s.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[s.jsx(Jl,{className:"size-4 shrink-0 opacity-50"}),s.jsx($u.Input,{"data-slot":"command-input",className:ne("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function Lte({className:e,...t}){return s.jsx($u.List,{"data-slot":"command-list",className:ne("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function UO({...e}){return s.jsx($u.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function FO({className:e,...t}){return s.jsx($u.Group,{"data-slot":"command-group",className:ne("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}function VO({className:e,...t}){return s.jsx($u.Item,{"data-slot":"command-item",className:ne("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function Pte(e){const t=Ute(e),n=m.forwardRef((r,o)=>{const{children:l,...c}=r,d=m.Children.toArray(l),f=d.find(Vte);if(f){const h=f.props.children,g=d.map(y=>y===f?m.Children.count(h)>1?m.Children.only(null):m.isValidElement(h)?h.props.children:null:y);return s.jsx(t,{...c,ref:o,children:m.isValidElement(h)?m.cloneElement(h,void 0,g):null})}return s.jsx(t,{...c,ref:o,children:l})});return n.displayName=`${e}.Slot`,n}function Ute(e){const t=m.forwardRef((n,r)=>{const{children:o,...l}=n;if(m.isValidElement(o)){const c=Hte(o),d=zte(l,o.props);return o.type!==m.Fragment&&(d.ref=r?Lr(r,c):c),m.cloneElement(o,d)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Fte=Symbol("radix.slottable");function Vte(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Fte}function zte(e,t){const n={...t};for(const r in t){const o=e[r],l=t[r];/^on[A-Z]/.test(r)?o&&l?n[r]=(...d)=>{const f=l(...d);return o(...d),f}:o&&(n[r]=o):r==="style"?n[r]={...o,...l}:r==="className"&&(n[r]=[o,l].filter(Boolean).join(" "))}return{...e,...n}}function Hte(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Xg="Popover",[zO]=cr(Xg,[eo]),nh=eo(),[$te,cl]=zO(Xg),HO=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:l,modal:c=!1}=e,d=nh(t),f=m.useRef(null),[h,g]=m.useState(!1),[y,v]=Gr({prop:r,defaultProp:o??!1,onChange:l,caller:Xg});return s.jsx(ku,{...d,children:s.jsx($te,{scope:t,contentId:Ln(),triggerRef:f,open:y,onOpenChange:v,onOpenToggle:m.useCallback(()=>v(b=>!b),[v]),hasCustomAnchor:h,onCustomAnchorAdd:m.useCallback(()=>g(!0),[]),onCustomAnchorRemove:m.useCallback(()=>g(!1),[]),modal:c,children:n})})};HO.displayName=Xg;var $O="PopoverAnchor",Bte=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=cl($O,n),l=nh(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:d}=o;return m.useEffect(()=>(c(),()=>d()),[c,d]),s.jsx(Lu,{...l,...r,ref:t})});Bte.displayName=$O;var BO="PopoverTrigger",GO=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=cl(BO,n),l=nh(n),c=dt(t,o.triggerRef),d=s.jsx(et.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":WO(o.open),...r,ref:c,onClick:Te(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?d:s.jsx(Lu,{asChild:!0,...l,children:d})});GO.displayName=BO;var TS="PopoverPortal",[Gte,qte]=zO(TS,{forceMount:void 0}),qO=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,l=cl(TS,t);return s.jsx(Gte,{scope:t,forceMount:n,children:s.jsx(_r,{present:n||l.open,children:s.jsx(tc,{asChild:!0,container:o,children:r})})})};qO.displayName=TS;var _u="PopoverContent",ZO=m.forwardRef((e,t)=>{const n=qte(_u,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,l=cl(_u,e.__scopePopover);return s.jsx(_r,{present:r||l.open,children:l.modal?s.jsx(Kte,{...o,ref:t}):s.jsx(Yte,{...o,ref:t})})});ZO.displayName=_u;var Zte=Pte("PopoverContent.RemoveScroll"),Kte=m.forwardRef((e,t)=>{const n=cl(_u,e.__scopePopover),r=m.useRef(null),o=dt(t,r),l=m.useRef(!1);return m.useEffect(()=>{const c=r.current;if(c)return ig(c)},[]),s.jsx(Of,{as:Zte,allowPinchZoom:!0,children:s.jsx(KO,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Te(e.onCloseAutoFocus,c=>{var d;c.preventDefault(),l.current||(d=n.triggerRef.current)==null||d.focus()}),onPointerDownOutside:Te(e.onPointerDownOutside,c=>{const d=c.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0,h=d.button===2||f;l.current=h},{checkForDefaultPrevented:!1}),onFocusOutside:Te(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),Yte=m.forwardRef((e,t)=>{const n=cl(_u,e.__scopePopover),r=m.useRef(!1),o=m.useRef(!1);return s.jsx(KO,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var c,d;(c=e.onCloseAutoFocus)==null||c.call(e,l),l.defaultPrevented||(r.current||(d=n.triggerRef.current)==null||d.focus(),l.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:l=>{var f,h;(f=e.onInteractOutside)==null||f.call(e,l),l.defaultPrevented||(r.current=!0,l.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=l.target;((h=n.triggerRef.current)==null?void 0:h.contains(c))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&o.current&&l.preventDefault()}})}),KO=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:g,...y}=e,v=cl(_u,n),b=nh(n);return sg(),s.jsx(Df,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:l,children:s.jsx(ec,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:g,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onDismiss:()=>v.onOpenChange(!1),children:s.jsx(If,{"data-state":WO(v.open),role:"dialog",id:v.contentId,...b,...y,ref:t,style:{...y.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),YO="PopoverClose",Wte=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=cl(YO,n);return s.jsx(et.button,{type:"button",...r,ref:t,onClick:Te(e.onClick,()=>o.onOpenChange(!1))})});Wte.displayName=YO;var Qte="PopoverArrow",Xte=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=nh(n);return s.jsx(kf,{...o,...r,ref:t})});Xte.displayName=Qte;function WO(e){return e?"open":"closed"}var Jte=HO,ene=GO,tne=qO,nne=ZO;function _S({...e}){return s.jsx(Jte,{"data-slot":"popover",...e})}function NS({...e}){return s.jsx(ene,{"data-slot":"popover-trigger",...e})}function AS({className:e,align:t="center",sideOffset:n=4,...r}){return s.jsx(tne,{children:s.jsx(nne,{"data-slot":"popover-content",align:t,sideOffset:n,className:ne("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...r})})}function DS({options:e,value:t,onValueChange:n,placeholder:r="Select an option",emptyMessage:o="No results found.",className:l,disabled:c=!1}){const[d,f]=m.useState(!1),[h,g]=m.useState(""),y=m.useMemo(()=>{const w={};return e.forEach(S=>{const C=S.group??"";Object.prototype.hasOwnProperty.call(w,C)||(w[C]=[]),w[C].push(S)}),w},[e]),v=e.find(w=>w.value===t),b=m.useCallback(w=>{n(w),requestAnimationFrame(()=>{g(""),f(!1)})},[n]);return s.jsxs(_S,{open:d,onOpenChange:f,modal:!0,children:[s.jsx(NS,{asChild:!0,children:s.jsxs(Se,{variant:"outline",role:"combobox","aria-expanded":d,className:ne("w-full justify-between",!t&&"text-muted-foreground",l),disabled:c,children:[v?v.label:r,s.jsx(H1,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(AS,{className:"max-h-[300px] min-w-[300px] overflow-auto p-0",align:"start",sideOffset:5,children:s.jsxs(LO,{children:[s.jsx(PO,{placeholder:`Search ${r.toLowerCase()}...`,value:h,onValueChange:g}),s.jsx(UO,{children:o}),Object.entries(y).map(([w,S])=>s.jsx(FO,{heading:w,children:S.map(C=>s.jsxs(VO,{value:C.value,onSelect:()=>{b(C.value)},keywords:[C.label],children:[s.jsx(lr,{className:ne("mr-2 h-4 w-4",t===C.value?"opacity-100":"opacity-0")}),C.label]},C.value))},w||"default"))]})})]})}function rne(){return s.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:s.jsxs(cn,{value:"service-account-details",children:[s.jsx(un,{children:"How do I get a Service Account JSON key?"}),s.jsxs(dn,{children:[s.jsx("p",{className:"mb-2",children:"To get the JSON key, you'll need to create or use an existing service account in Google Cloud."}),s.jsx("p",{className:"mb-2",children:"Here's what to do:"}),s.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[s.jsxs("li",{children:["Go to"," ",s.jsx(vn,{className:"underline",href:"https://console.cloud.google.com/iam-admin/serviceaccounts",children:"Google Cloud Console"}),"."]}),s.jsxs("li",{children:["Open ",s.jsx("strong",{children:"IAM & Admin → Service Accounts"}),"."]}),s.jsx("li",{children:"Create a new service account or select an existing one."}),s.jsxs("li",{children:["Assign the ",s.jsx("strong",{children:"bigquery.dataEditor"})," and ",s.jsx("strong",{children:"bigquery.jobUser"})," ","roles to this service account to allow read, write, and create access to your project resources."]}),s.jsxs("li",{children:["Open the Service Accounts page, go to the ",s.jsx("strong",{children:"Keys"})," tab, click"," ",s.jsx("strong",{children:"Add key"}),", and select ",s.jsx("strong",{children:"Create new key"}),"."]}),s.jsxs("li",{children:["Choose ",s.jsx("strong",{children:"JSON"})," format and click ",s.jsx("strong",{children:"Create"}),"."]}),s.jsx("li",{children:"Open the downloaded file, copy its entire content, and paste it into the field above."})]})]})]})})}function ane(){return s.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:s.jsxs(cn,{value:"project-id-details",children:[s.jsx(un,{children:"How do I find my Project ID?"}),s.jsxs(dn,{children:[s.jsx("p",{className:"mb-2",children:"This is the ID of your Google Cloud project. BigQuery usage costs will be charged to this project."}),s.jsx("p",{className:"mb-2",children:"Here's how to find your billing project ID:"}),s.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[s.jsxs("li",{children:["Open"," ",s.jsx(vn,{className:"underline",href:"https://console.cloud.google.com/",children:"Google Cloud Console"})," ","and sign in with your Google account."]}),s.jsx("li",{children:'Click the project selector dropdown at the top of the page (it shows the current project name or "Select a project").'}),s.jsxs("li",{children:["Find your project in the list. The ",s.jsx("strong",{children:"Project ID"})," is shown in the ID column."]}),s.jsx("li",{children:"If you don't see your project, use the search box to find it by name or ID."})]})]})]})})}function sne(){return s.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:s.jsxs(cn,{value:"gbq-location-details",children:[s.jsx(un,{children:"How do I find my dataset location?"}),s.jsxs(dn,{children:[s.jsx("p",{className:"mb-2",children:"BigQuery data is stored in specific regions. To avoid query errors, your SQL queries must process data stored in the same location."}),s.jsx("p",{className:"mb-2",children:"Here's how to check your dataset location:"}),s.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[s.jsxs("li",{children:["Open"," ",s.jsx(vn,{className:"underline",href:"https://console.cloud.google.com/bigquery",children:"Google Cloud Console BigQuery page"}),"."]}),s.jsx("li",{children:"In the left panel, expand your project and find your datasets."}),s.jsxs("li",{children:["Click each dataset name to open its details. The ",s.jsx("strong",{children:"Data location"})," field shows the region where that dataset is stored (for example,"," ",s.jsx("code",{className:"text-sm font-semibold",children:"US"}),","," ",s.jsx("code",{className:"text-sm font-semibold",children:"EU"}),","," ",s.jsx("code",{className:"text-sm font-semibold",children:"asia-northeast1"}),")."]}),s.jsx("li",{children:"Make sure all your datasets are stored in the same location. If they are in different locations, select the location where most of your data is stored or create separate Storage for each location."}),s.jsx("li",{children:"Put this location value in the field above."})]})]})]})})}const QO=e=>{try{const t=JSON.parse(e),{project_id:n,client_id:r,client_email:o}=t;return!n||!r||!o?null:{url:`https://console.cloud.google.com/iam-admin/serviceaccounts/details/${r}?project=${n}`,email:o}}catch{return null}},one=({form:e})=>{const[t,n]=m.useState(!1);if(e.watch("type")!==ke.GOOGLE_BIGQUERY)return null;const r=()=>{n(!0),e.setValue("credentials.serviceAccount","",{shouldDirty:!0})},o=()=>{n(!1),e.resetField("credentials.serviceAccount")},l=e.watch("credentials.serviceAccount"),c=l?QO(l):null;return s.jsxs(s.Fragment,{children:[s.jsxs(ua,{title:"Connection Settings",children:[s.jsx(kt,{control:e.control,name:"config.projectId",render:({field:d})=>s.jsxs(_t,{children:[s.jsx(Rt,{tooltip:"Enter the ID of your Google Cloud project where BigQuery usage will be billed",children:"Project ID"}),s.jsx(Nt,{children:s.jsx(Ht,{...d,placeholder:"Enter a Project Id"})}),s.jsx(wn,{children:s.jsx(ane,{})}),s.jsx(Ft,{})]})}),s.jsx(kt,{control:e.control,name:"config.location",render:({field:d})=>s.jsxs(_t,{children:[s.jsx(Rt,{tooltip:"Choose the same region where your BigQuery data is stored to ensure queries work correctly",children:"Location"}),s.jsx(Nt,{children:s.jsx(DS,{options:PZ,value:d.value,onValueChange:d.onChange,placeholder:"Select a location",emptyMessage:"No locations found",className:"w-full"})}),s.jsx(wn,{children:s.jsx(sne,{})}),s.jsx(Ft,{})]})})]}),s.jsx(ua,{title:"Authentication",children:s.jsx(kt,{control:e.control,name:"credentials.serviceAccount",render:({field:d})=>s.jsxs(_t,{children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Rt,{tooltip:"Paste a JSON key from a service account that has access to the selected storage provider",children:"Service Account"}),!t&&l&&s.jsx(Se,{variant:"ghost",size:"sm",onClick:r,type:"button",children:"Edit"}),t&&s.jsx(Se,{variant:"ghost",size:"sm",onClick:o,type:"button",children:"Cancel"})]}),s.jsx(Nt,{children:!t&&c?s.jsxs(bt,{children:[s.jsx(St,{asChild:!0,children:s.jsx(vn,{href:c.url,children:c.email})}),s.jsx(Ct,{children:s.jsx("p",{children:"View in Google Cloud Console"})})]}):s.jsx(Ko,{...d,className:"min-h-[150px] font-mono",rows:8,placeholder:"Paste your service account JSON here"})}),s.jsx(wn,{children:s.jsx(rne,{})}),s.jsx(Ft,{})]})})})]})};function ine(){return s.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:s.jsxs(cn,{value:"athena-region-details",children:[s.jsx(un,{children:"How do I find my Athena region?"}),s.jsxs(dn,{children:[s.jsx("p",{className:"mb-2",children:"Athena queries run in a specific AWS region. You must select the region where your Athena service and data are located."}),s.jsx("p",{className:"mb-2",children:"Here's how to find your Athena region:"}),s.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[s.jsxs("li",{children:["Open"," ",s.jsx(vn,{className:"underline",href:"https://console.aws.amazon.com/athena/",children:"the AWS Athena console"}),"."]}),s.jsx("li",{children:"Look at the top right corner of the console. The selected region is shown in the region selector dropdown."}),s.jsx("li",{children:"Make sure to copy and paste the same region here in the form to avoid connection or query errors."})]})]})]})})}function lne(){return s.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:s.jsxs(cn,{value:"athena-output-bucket-details",children:[s.jsx(un,{children:"How do I find a bucket?"}),s.jsxs(dn,{children:[s.jsxs("p",{className:"mb-2",children:["Athena saves query results in an ",s.jsx("strong",{children:"S3 bucket"}),". You need to specify the bucket used for query output."]}),s.jsx("p",{className:"mb-2",children:"Here's how to find or create an S3 bucket for Athena output:"}),s.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[s.jsxs("li",{children:["Open"," ",s.jsx(vn,{className:"underline",href:"https://console.aws.amazon.com/s3/",children:"the AWS S3 console"}),"."]}),s.jsx("li",{children:"Look for an existing bucket used for Athena query results, or create a new one."}),s.jsx("li",{children:"If creating a new bucket, make sure it is in the same region as your Athena service."}),s.jsx("li",{children:"Enter the bucket name in this form field."})]})]})]})})}function cne(){return s.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:s.jsxs(cn,{value:"athena-access-key-id-details",children:[s.jsx(un,{children:"How do I get my AWS Access Key ID?"}),s.jsxs(dn,{children:[s.jsx("p",{className:"mb-2",children:"Before accessing your AWS Access Key ID, make sure you have a user with the necessary permissions to use Athena and Glue in your AWS account."}),s.jsxs("p",{className:"mb-4 text-sm",children:["Learn more about how to create a user in AWS ",s.jsx(vn,{className:"underline",href:"https://docs.owox.com/docs/storages/supported-storages/aws-athena/?utm_source=owox_data_marts&utm_medium=storage_enity&utm_campaign=tooltip_aws",children:"in documentation"}),"."]}),s.jsx(B_,{className:"my-4"}),s.jsx("p",{className:"mb-2",children:"The Access Key ID is part of your AWS credentials needed to connect and authenticate."}),s.jsx("p",{className:"mb-2",children:"Here's how to find or create an Access Key ID:"}),s.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[s.jsxs("li",{children:["Open"," ",s.jsx(vn,{className:"underline",href:"https://console.aws.amazon.com/iam/home#/security_credentials",children:"the AWS IAM Security Credentials page"}),"."]}),s.jsxs("li",{children:["Under ",s.jsx("strong",{children:"Access keys"}),", find your existing keys or create a new access key."]}),s.jsx("li",{children:"When you create a new key, download and securely store the Access Key ID and Secret Access Key."})]})]})]})})}function une(){return s.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:s.jsxs(cn,{value:"athena-secret-access-key-details",children:[s.jsx(un,{children:"How do I get my AWS Secret Access Key?"}),s.jsxs(dn,{children:[s.jsx("p",{className:"mb-2",children:"The Secret Access Key is part of your AWS credentials needed to connect and authenticate. It is only shown when you create a new key."}),s.jsx("p",{className:"mb-2",children:"Here's how to get your Secret Access Key:"}),s.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[s.jsxs("li",{children:["Open"," ",s.jsx(vn,{className:"underline",href:"https://console.aws.amazon.com/iam/home#/security_credentials",children:"the AWS IAM Security Credentials page"}),"."]}),s.jsxs("li",{children:["Under ",s.jsx("strong",{children:"Access keys"}),", create a new access key if you don't have one or lost the secret key."]}),s.jsx("li",{children:"When you create a new key, copy and securely store the Secret Access Key — you won't be able to see it again."})]})]})]})})}const dne=({form:e})=>{const[t,n]=m.useState("");return m.useEffect(()=>{const r=e.getValues("credentials.accessKeyId");if(r){const o="_".repeat(r.length);n(o),e.setValue("credentials.secretAccessKey",o,{shouldDirty:!1})}},[e]),e.watch("type")!==ke.AWS_ATHENA?null:s.jsxs(s.Fragment,{children:[s.jsxs(ua,{title:"Connection Settings",children:[s.jsx(kt,{control:e.control,name:"config.region",render:({field:r})=>s.jsxs(_t,{children:[s.jsx(Rt,{tooltip:"Enter the AWS region where your Athena service is active",children:"Region"}),s.jsx(Nt,{children:s.jsx(Ht,{...r,placeholder:"Enter a region"})}),s.jsx(wn,{children:s.jsx(ine,{})}),s.jsx(Ft,{})]})}),s.jsx(kt,{control:e.control,name:"config.outputBucket",render:({field:r})=>s.jsxs(_t,{children:[s.jsx(Rt,{tooltip:"Specify the S3 bucket where Athena query results will be stored",children:"Output Bucket"}),s.jsx(Nt,{children:s.jsx(Ht,{...r,placeholder:"Enter an output bucket"})}),s.jsx(wn,{children:s.jsx(lne,{})}),s.jsx(Ft,{})]})})]}),s.jsxs(ua,{title:"Authentication",children:[s.jsx(kt,{control:e.control,name:"credentials.accessKeyId",render:({field:r})=>s.jsxs(_t,{children:[s.jsx(Rt,{tooltip:"Your AWS Access Key ID used for authentication",children:"Access Key ID"}),s.jsx(Nt,{children:s.jsx(Ht,{...r,placeholder:"Enter an access key id"})}),s.jsx(wn,{children:s.jsx(cne,{})}),s.jsx(Ft,{})]})}),s.jsx(kt,{control:e.control,name:"credentials.secretAccessKey",render:({field:r})=>s.jsxs(_t,{children:[s.jsx(Rt,{tooltip:"Your AWS Secret Access Key used for authentication",children:"Secret Access Key"}),s.jsx(Nt,{children:s.jsx(Ht,{...r,type:"password",placeholder:t||"Enter a secret access key"})}),s.jsx(wn,{children:s.jsx(une,{})}),s.jsx(Ft,{})]})})]})]})};function fne(){return s.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:s.jsxs(cn,{value:"bigquery-api-details",children:[s.jsx(un,{children:"How do I enable the BigQuery API?"}),s.jsxs(dn,{children:[s.jsxs("p",{className:"mb-2",children:["To run queries and process data in Google BigQuery, you need to enable the"," ",s.jsx(vn,{className:"underline",href:"https://console.cloud.google.com/apis/library/bigquery.googleapis.com",children:"BigQuery API"})," ","in your Google Cloud project."]}),s.jsx("p",{className:"mb-2",children:"Here's how to do it:"}),s.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[s.jsx("li",{children:"Open the link above and make sure the correct project is selected."}),s.jsxs("li",{children:["If the API isn't enabled yet, click ",s.jsx("strong",{children:"Enable"}),"."]}),s.jsx("li",{children:"If it's already enabled, you'll see the API dashboard — that's fine."})]})]})]})})}function hne(){return s.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:s.jsxs(cn,{value:"athena-api-details",children:[s.jsx(un,{children:"How do I activate Athena API?"}),s.jsxs(dn,{children:[s.jsx("p",{className:"mb-2",children:"AWS Athena is a serverless interactive query service. To use it, you need to activate Athena in your AWS account."}),s.jsx("p",{className:"mb-2",children:"Here's how to activate Athena:"}),s.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[s.jsxs("li",{children:["Open"," ",s.jsx(vn,{className:"underline",href:"https://console.aws.amazon.com/athena/",children:"the AWS Athena console"})," ","and sign in to your AWS account."]}),s.jsx("li",{children:"If you haven't used Athena before, you may need to set up a query result location (an S3 bucket)."}),s.jsx("li",{children:"You can start running queries immediately after setup."})]})]})]})})}function XO(e){return JSON.parse(JSON.stringify(e))}function mne({initialData:e,onSubmit:t,onCancel:n,onDirtyChange:r}){const o=Xo({resolver:ll(nK),defaultValues:e}),{watch:l,control:c,formState:{isDirty:d,isSubmitting:f}}=o,h=l("type");ye.useEffect(()=>{r==null||r(d)},[d,r]);const g=async y=>{const{dirtyFields:v}=o.formState,b=XO(y);return v.credentials||delete b.credentials,t(b)};return s.jsx(rl,{...o,children:s.jsxs(Jo,{onSubmit:y=>{o.handleSubmit(g)(y)},noValidate:!0,children:[s.jsxs(al,{children:[s.jsxs(ua,{title:"General",children:[s.jsx(kt,{control:c,name:"title",render:({field:y})=>s.jsxs(_t,{children:[s.jsx(Rt,{tooltip:"Name the storage to clarify its purpose",children:"Title"}),s.jsx(Nt,{children:s.jsx(Ht,{...y,placeholder:"Storage title"})}),s.jsx(Ft,{})]})}),s.jsx(kt,{control:c,name:"type",render:({field:y})=>s.jsxs(_t,{children:[s.jsx(Rt,{tooltip:"The selected source will be used to process data in your Data Marts",children:"Storage Type"}),s.jsx(Nt,{children:s.jsxs(Kr,{value:y.value,onValueChange:y.onChange,disabled:!!e,children:[s.jsx(Wr,{className:"w-full",children:s.jsx(Yr,{placeholder:"Select a storage type"})}),s.jsx(Qr,{children:s.jsx($g,{children:nl.getAllTypes().map(({type:v,displayName:b,icon:w,status:S})=>s.jsx(Rn,{value:v,disabled:S===Do.COMING_SOON,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(w,{size:20}),b]})},v))})})]})}),s.jsxs(wn,{children:[h===ke.GOOGLE_BIGQUERY&&s.jsx(fne,{}),h===ke.AWS_ATHENA&&s.jsx(hne,{})]}),s.jsx(Ft,{})]})})]}),h===ke.GOOGLE_BIGQUERY&&s.jsx(one,{form:o}),h===ke.AWS_ATHENA&&s.jsx(dne,{form:o})]}),s.jsxs(sl,{children:[s.jsx(Se,{variant:"default",type:"submit",className:"w-full","aria-label":"Save",disabled:!d||f,children:"Save"}),s.jsx(Se,{variant:"outline",type:"button",onClick:n,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function JO({isOpen:e,onClose:t,dataStorage:n,onSaveSuccess:r}){const{updateDataStorage:o}=Bg(),[l,c]=m.useState(!1),[d,f]=m.useState(!1),h=m.useCallback(()=>{d?c(!0):t()},[d,t]),g=m.useCallback(()=>{c(!1),f(!1),t()},[t]),y=m.useCallback(w=>{f(w)},[]),v=async w=>{if(n){const S=await o(n.id,w);S&&(r(S),t())}},b=m.useRef(!1);return m.useEffect(()=>{const w=n?"Edit":"Create";e&&!b.current?(Ue({event:"data_storage_config_open",category:"DataStorage",action:w,label:n==null?void 0:n.type}),b.current=!0):!e&&b.current&&(Ue({event:"data_storage_config_close",category:"DataStorage",action:w,label:n==null?void 0:n.type}),b.current=!1)},[e,n]),s.jsxs(s.Fragment,{children:[s.jsx(Bo,{open:e,onOpenChange:w=>{w||h()},children:s.jsxs(Go,{children:[s.jsxs(qo,{children:[s.jsx(Zo,{children:"Configure Storage Provider"}),s.jsx(Xi,{children:"Customize settings for your storage provider"})]}),s.jsx(mne,{initialData:n??void 0,onSubmit:v,onCancel:h,onDirtyChange:y})]})}),s.jsx(Tr,{open:l,onOpenChange:c,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:g,variant:"destructive"})]})}const pne=({dataStorage:e,onDataStorageChange:t})=>{const[n,r]=m.useState(!1),o=nl.getInfo(e.type),l=()=>{r(!0)},c=()=>{r(!1)},d=()=>{if(!YA(e))return s.jsxs("div",{className:"flex items-center space-x-2 text-sm",children:[s.jsx(ag,{className:"h-4 w-4 text-red-500"}),s.jsx("span",{className:"text-red-500",children:"Storage configuration is incomplete"})]});const h=(y,v)=>s.jsxs("span",{children:[s.jsxs("span",{className:"text-muted-foreground/75",children:[y,":"]})," ",s.jsx("span",{className:"text-muted-foreground font-medium",children:v})]}),g=(y,v,b)=>s.jsxs("span",{children:[s.jsxs("span",{className:"text-muted-foreground/75",children:[y,":"]})," ",s.jsx(vn,{href:b,onClick:w=>{w.stopPropagation()},children:v})]});switch(e.type){case ke.GOOGLE_BIGQUERY:{const y=e.config.projectId,v=e.config.location,b=`https://console.cloud.google.com/bigquery?project=${y}`;return s.jsxs("div",{className:"flex flex-wrap gap-2",children:[g("Project ID",y,b),s.jsx("span",{className:"text-muted-foreground",children:"•"}),h("Location",v)]})}case ke.AWS_ATHENA:{const y=e.config.region,v=e.config.outputBucket,b=`https://s3.console.aws.amazon.com/s3/buckets/${v}?region=${y}`;return s.jsxs("div",{className:"flex flex-wrap gap-2",children:[h("Region",y),s.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Bucket",v,b)]})}default:return"Unknown storage type configuration"}};return s.jsxs(s.Fragment,{children:[s.jsx(m1,{title:e.title,icon:o.icon,subtitle:d(),onClick:l}),s.jsx(hS,{children:s.jsx(JO,{isOpen:n,onClose:c,dataStorage:e,onSaveSuccess:f=>{t&&t(f)}})})]})};function gne({initialType:e,onTypeSelect:t}){var c;const[n,r]=m.useState(e??null);m.useEffect(()=>{e!==void 0&&e!==n&&r(e)},[e,n]);const o=d=>{r(d),t(d)},l=[{type:Fe.SQL,label:"SQL",description:"SQL query"},{type:Fe.TABLE,label:"Table",description:"Existing table"},{type:Fe.VIEW,label:"View",description:"Existing view"},{type:Fe.TABLE_PATTERN,label:"Pattern",description:"Table pattern"},{type:Fe.CONNECTOR,label:"Connector",description:"Data import from Source to Storage"}];return s.jsxs("div",{className:"dm-card-block",children:[s.jsx(Ma,{className:"text-foreground",children:"Definition Type"}),s.jsxs(Kr,{value:n??"",onValueChange:d=>{o(d)},children:[s.jsx(Wr,{className:"dm-card-formcontrol w-full","aria-label":"Definition Type",children:s.jsx(Yr,{placeholder:"Select definition type",children:n&&((c=l.find(d=>d.type===n))==null?void 0:c.label)})}),s.jsx(Qr,{children:s.jsx($g,{children:l.map(d=>s.jsxs(Rn,{value:d.type,children:[d.label,s.jsx("span",{className:"text-muted-foreground/80 ml-2",children:d.description})]},d.type))})})]})]})}const yne=Jt({definitionType:ga(Fe.SQL),definition:Jt({sqlQuery:$t().min(1,"SQL query is required")})}),vne=e=>{const t=f3(e);return Jt({definitionType:ga(Fe.TABLE),definition:t})},xne=e=>{const t=f3(e);return Jt({definitionType:ga(Fe.VIEW),definition:t})},bne=e=>{const t=cY(e);return Jt({definitionType:ga(Fe.TABLE_PATTERN),definition:t})},Sne=Jt({definitionType:ga(Fe.CONNECTOR),definition:Jt({connector:Jt({source:Jt({name:$t().min(1,"Connector name is required"),configuration:Z0(WG(KG())).min(1,"At least one configuration is required"),node:$t().min(1,"Node is required"),fields:Z0($t()).min(1,"At least one field is required")}),storage:Jt({fullyQualifiedName:$t().min(1,"fully qualified name is required")})})})}),Cne=(e,t)=>{if(!e)return Jt({definitionType:QG(Ng(Fe)),definition:Jt({}).optional()});switch(e){case Fe.SQL:return yne;case Fe.TABLE:return vne(t);case Fe.VIEW:return xne(t);case Fe.TABLE_PATTERN:return bne(t);case Fe.CONNECTOR:return Sne;default:return Jt({})}};function Ene({control:e}){return s.jsx(kt,{control:e,name:"definition.sqlQuery",render:({field:t})=>s.jsxs(_t,{className:"dm-card-block",children:[s.jsx(Rt,{className:"text-foreground",children:"SQL Query"}),s.jsx(Nt,{children:s.jsx(dte,{initialValue:{sqlQuery:t.value},onChange:n=>{t.onChange(n.sqlQuery)}})}),s.jsx(Ft,{})]})})}function wne({control:e,storageType:t}){const n=QA(t),r=XA(t);return s.jsx(kt,{control:e,name:"definition.fullyQualifiedName",render:({field:o})=>s.jsxs(_t,{className:"dm-card-block",children:[s.jsx(Rt,{children:"Fully Qualified Table Name"}),s.jsx(Nt,{children:s.jsx(Ht,{placeholder:n,value:o.value||"",onChange:o.onChange,className:"dm-card-formcontrol"})}),s.jsx(wn,{className:"text-muted-foreground/75",children:r}),s.jsx(Ft,{})]})})}function Rne({control:e,storageType:t}){const n=QA(t),r=XA(t);return s.jsx(kt,{control:e,name:"definition.fullyQualifiedName",render:({field:o})=>s.jsxs(_t,{className:"dm-card-block",children:[s.jsx(Rt,{children:"Fully Qualified View Name"}),s.jsx(Nt,{children:s.jsx(Ht,{placeholder:n,value:o.value||"",onChange:o.onChange,className:"dm-card-formcontrol"})}),s.jsx(wn,{className:"text-muted-foreground/75",children:r}),s.jsx(Ft,{})]})})}function jne({control:e,storageType:t}){const n=iK(t),r=lK(t);return s.jsx(kt,{control:e,name:"definition.pattern",render:({field:o})=>s.jsxs(_t,{className:"dm-card-block",children:[s.jsx(Rt,{children:"Table Pattern"}),s.jsx(Nt,{children:s.jsx(Ht,{placeholder:n,value:o.value||"",onChange:o.onChange,className:"dm-card-formcontrol"})}),s.jsx(wn,{className:"text-muted-foreground/75",children:r}),s.jsx(Ft,{})]})})}const OS=e=>{switch(e){case Fe.SQL:return{sqlQuery:""};case Fe.TABLE:return{fullyQualifiedName:""};case Fe.VIEW:return{fullyQualifiedName:""};case Fe.TABLE_PATTERN:return{pattern:""};case Fe.CONNECTOR:return{connector:{source:{name:"",configuration:[],node:"",fields:[]},storage:{fullyQualifiedName:""}}};default:return{}}},Tne=_f("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function MS({className:e,variant:t,...n}){return s.jsx("div",{"data-slot":"alert",role:"alert",className:ne(Tne({variant:t}),e),...n})}function e5({className:e,...t}){return s.jsx("div",{"data-slot":"alert-title",className:ne("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function IS({className:e,...t}){return s.jsx("div",{"data-slot":"alert-description",className:ne("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}function _ne({connectors:e,selectedConnector:t,loading:n,error:r,onConnectorSelect:o,onConnectorDoubleClick:l}){return n?s.jsx(bS,{variant:"grid"}):r?s.jsxs(MS,{variant:"destructive",children:[s.jsx(Nf,{className:"h-4 w-4"}),s.jsx(IS,{children:"Failed to load available connectors. Please try again."})]}):s.jsxs(ko,{children:[s.jsx(Pl,{title:"Choose Connector",children:s.jsx(TJ,{children:e.map(c=>s.jsx(_J,{icon:c.logoBase64?s.jsx(rc,{base64:c.logoBase64,size:20}):null,title:c.displayName,selected:(t==null?void 0:t.name)===c.name,onClick:()=>{o(c)},onDoubleClick:()=>{o(c),l==null||l(c)}},c.name))})}),e.length===0&&s.jsx(Yi,{icon:s.jsx(ff,{size:56,strokeWidth:1}),title:"No connectors available",subtitle:"Ask your administrator to configure connectors."})]})}function Nne({currentStep:e,totalSteps:t,canGoNext:n,canGoBack:r,isLoading:o=!1,onNext:l,onBack:c,onFinish:d,nextLabel:f="Next",backLabel:h="Back",finishLabel:g="Save"}){const y=e===t;return t===1?s.jsx("div",{className:"w-full",children:s.jsx(Se,{className:"w-full",variant:"default",onClick:d,disabled:!n||o,children:g})}):s.jsxs("div",{className:"flex w-full items-center justify-between gap-4",children:[s.jsx("div",{className:"flex-1",children:r&&s.jsxs(Se,{variant:"outline",onClick:c,disabled:o,children:[s.jsx(K7,{className:"h-4 w-4"}),h]})}),s.jsxs("div",{className:"text-muted-foreground/75 px-4 text-sm",children:["Step ",e," of ",t]}),s.jsx("div",{className:"flex flex-1 justify-end",children:y?s.jsx(Se,{variant:"default",onClick:d,disabled:!n||o,children:g}):s.jsxs(Se,{variant:"default",onClick:l,disabled:!n||o,children:[f,s.jsx(La,{className:"h-4 w-4"})]})})]})}function Fl({connector:e,size:t=24,variant:n="compact"}){return s.jsx(Yi,{icon:s.jsx(rc,{base64:e.logoBase64,size:t}),title:e.displayName,docUrl:e.docUrl,variant:n})}function gu({label:e}){return s.jsx("div",{className:"border-border text-muted-foreground mt-3 flex items-center justify-center gap-2 border-t pt-3 text-sm",children:s.jsx(Se,{variant:"outline",asChild:!0,children:s.jsxs(ha,{to:"https://github.com/OWOX/owox-data-marts/issues",target:"_blank",rel:"noopener noreferrer",children:[e," Open issue here",s.jsx(Fo,{className:"h-4 w-4"})]})})})}const y1="**********";function Ane({specification:e,configuration:t,onValueChange:n}){const{name:r,title:o}=e,l=o??r,c=r;return s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(Ht,{type:"checkbox",id:c,name:r,checked:t[r]||!1,onChange:d=>{n(r,d.target.checked)},className:"text-primary focus:ring-primary border-border h-4 w-4 rounded"}),s.jsx(Ma,{htmlFor:c,className:"cursor-pointer text-sm",children:s.jsx(Mo,{htmlFor:c,required:e.required,tooltip:e.description,children:l})})]})}function Dne({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:o}=e,l=e.title??e.name;return s.jsx(Ht,{id:r,name:r,type:"number",value:t[r]||"",placeholder:o??`Enter ${l.toLowerCase()}`,onChange:c=>{const d=c.target.value,f=d===""?void 0:parseFloat(d);n(r,f)}})}function One({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:o,default:l}=e,c=e.title??e.name;return s.jsx(Ko,{id:r,name:r,value:Array.isArray(t[r])?t[r].join(`
704
+ `):Array.isArray(l)?l.join(`
705
+ `):"",placeholder:o??`Enter ${c.toLowerCase()} (one per line)`,rows:4,onChange:d=>{const f=d.target.value.split(`
706
+ `).filter(h=>h.trim());n(r,f)}})}function Mne({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:o,default:l}=e,c=e.title??e.name,d=f=>{if(!f||typeof f!="string"&&typeof f!="number")return"";const h=typeof f=="string"?f:f.toString();try{const g=new Date(h);return isNaN(g.getTime())?"":g.toISOString().split("T")[0]}catch{return""}};return s.jsx(Ht,{id:r,name:r,type:"date",value:t[r]||d(l)||"",placeholder:o??`Enter ${c.toLowerCase()}`,onChange:f=>{n(r,f.target.value)}})}function Ine({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:o}=e,l=e.title??e.name;return s.jsx(Ht,{id:r,name:r,type:"text",value:t[r]||"",placeholder:o??`Enter ${l.toLowerCase()}`,onChange:c=>{n(r,c.target.value)}})}function kne({specification:e,configuration:t,onValueChange:n}){const r=e.title??e.name,{name:o,placeholder:l,default:c}=e;return s.jsx(Ko,{id:o,name:o,value:t[o]&&typeof t[o]=="object"?JSON.stringify(t[o],null,2):typeof c=="object"?JSON.stringify(c,null,2):"",placeholder:l??`Enter ${r.toLowerCase()} as JSON`,rows:6,className:"font-mono",onChange:d=>{try{const f=JSON.parse(d.target.value);n(o,f)}catch{n(o,d.target.value)}}})}function Lne({specification:e,configuration:t,onValueChange:n,isEditingExisting:r,isSecretEditing:o}){const l=e.title??e.name,c=r&&!o;return s.jsx(Ht,{id:e.name,...c?{}:{name:e.name},type:c?"password":"text",autoComplete:c?"new-password":"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,value:c?y1:t[e.name]||"",...c?{readOnly:!0,disabled:!0}:{},...c?{}:{placeholder:e.placeholder??`Enter ${l.toLowerCase()}`},...c?{}:{onChange:d=>{n(e.name,d.target.value)}}})}function Pne({specification:e,configuration:t,onValueChange:n,specOptions:r}){const{name:o,placeholder:l,default:c}=e,d=e.title??e.name,f=r.map(h=>({value:h,label:h}));return s.jsx(DS,{options:f,value:t[o]||c||"",onValueChange:h=>{n(o,h)},placeholder:l??`Select ${d.toLowerCase()}`,emptyMessage:"No options available",className:"w-full"})}function t5({specification:e,configuration:t,onValueChange:n,flags:r}){const{requiredType:o,options:l}=e,{isSecret:c=!1,isEditingExisting:d=!1,isSecretEditing:f=!1}=r??{};if(c)return s.jsx(Lne,{specification:e,configuration:t,onValueChange:n,isEditingExisting:d,isSecretEditing:f});if(l&&l.length>0)return s.jsx(Pne,{specification:e,configuration:t,onValueChange:n,specOptions:l});switch(o){case fs.BOOLEAN:return s.jsx(Ane,{specification:e,configuration:t,onValueChange:n});case fs.NUMBER:return s.jsx(Dne,{specification:e,configuration:t,onValueChange:n});case fs.ARRAY:return s.jsx(One,{specification:e,configuration:t,onValueChange:n});case fs.OBJECT:return s.jsx(kne,{specification:e,configuration:t,onValueChange:n});case fs.DATE:return s.jsx(Mne,{specification:e,configuration:t,onValueChange:n});case fs.STRING:default:return s.jsx(Ine,{specification:e,configuration:t,onValueChange:n})}}function Une({specification:e,configuration:t,isEditingExisting:n,isSecretEditing:r,isSecret:o,onValueChange:l,onSecretEditToggle:c}){return s.jsxs(Xd,{children:[e.requiredType!==fs.BOOLEAN&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Mo,{htmlFor:e.name,required:e.required,tooltip:e.description,children:e.title??e.name}),o&&n&&s.jsx(Se,{variant:"ghost",size:"sm",type:"button",onClick:()=>{c(e.name,!r)},children:r?"Cancel":"Edit"})]}),t5({specification:e,configuration:t,onValueChange:l,flags:{isSecret:o,isEditingExisting:n,isSecretEditing:r}})]},e.name)}function Fne({specification:e,configuration:t,onValueChange:n,isEditingExisting:r,isSecretEditing:o,onSecretEditToggle:l}){const c=m.useMemo(()=>{var y,v;const g=t[e.name];if(g&&typeof g=="object"){const b=Object.keys(g);if(b.length>0)return b[0]}return((v=(y=e.oneOf)==null?void 0:y[0])==null?void 0:v.value)??""},[t,e.name,e.oneOf]),[d,f]=m.useState(c);if(m.useEffect(()=>{f(c)},[c]),!e.oneOf)return null;const h=(g,y,v)=>{const b=t[e.name]&&typeof t[e.name]=="object"?t[e.name]:{};n(e.name,{[g]:{...typeof b[g]=="object"&&b[g]!==null?b[g]:{},[y]:v}})};return s.jsx(jJ,{label:e.title??e.name,options:e.oneOf.map(g=>({value:g.value,label:g.label})),value:d,onValueChange:f,children:e.oneOf.map(g=>s.jsx(mJ,{value:g.value,children:Object.entries(g.items).map(([y,v])=>{const b=t[e.name]&&typeof t[e.name]=="object"?t[e.name]:{},w=Array.isArray(v.attributes)&&Object.keys(b)[0]===g.value?v.attributes.includes("SECRET"):!1,S=typeof t[e.name]=="object"&&t[e.name]!==null?t[e.name]:{},C=typeof S[g.value]=="object"&&S[g.value]!==null?S[g.value]:{};return s.jsxs("div",{className:"mb-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Mo,{htmlFor:y,required:v.required,tooltip:v.description,className:"mb-2 justify-start",children:y}),w&&r&&s.jsx(Se,{variant:"ghost",size:"sm",type:"button",onClick:()=>{l(e.name,!o)},children:o?"Cancel":"Edit"})]}),t5({specification:{...v,name:y},configuration:C,onValueChange:(R,j)=>{h(g.value,R,j)},flags:{isEditingExisting:r,isSecret:w,isSecretEditing:o}})]},y)})},g.value))},e.name)}function pT(e,t,n,r,o,l){return e.map(c=>{const d=Array.isArray(c.attributes)?c.attributes.includes("SECRET"):!1,f=o[c.name];return c.oneOf&&c.requiredType===fs.OBJECT?s.jsx(Fne,{specification:c,configuration:t,onValueChange:n,isEditingExisting:l,isSecretEditing:f,onSecretEditToggle:r},c.name):s.jsx(Une,{specification:c,configuration:t,isEditingExisting:l,isSecret:d,isSecretEditing:f,onValueChange:n,onSecretEditToggle:r},c.name)})}function gT({collapsibleTitle:e,items:t,configuration:n,onValueChange:r,onSecretEditToggle:o,secretEditing:l,isEditingExisting:c}){return e?s.jsx(rO,{title:e,children:pT(t,n,r,o,l,c)}):pT(t,n,r,o,l,c)}function Vne({currentConnectorName:e,onCopyConfiguration:t,connectorSpecification:n}){const[r,o]=m.useState([]),[l,c]=m.useState(!1),[d,f]=m.useState(!1),h=m.useCallback(async()=>{c(!0);try{const v=await sn.getDataMartsByConnectorName(e);o(v)}catch{o([])}finally{c(!1)}},[e]);m.useEffect(()=>{d&&h()},[d,h]);const g=(v,b)=>{const w=b._id;if(!w){console.error("Configuration does not have _id field");return}t({dataMartId:v.id,dataMartTitle:v.title,configId:w,configuration:b}),f(!1)},y=v=>{const w=[],S=R=>{if(!n)return!0;const j=n.find(_=>_.name===R);return(j==null?void 0:j.required)??!1},C=(R,j,_=0,D=!0)=>{if(R.startsWith("_")||D&&_===0&&!S(R))return;let A=null;if(j==null)A="N/A";else if(typeof j=="string")A=j;else if(typeof j=="number"||typeof j=="boolean")A=String(j);else if(Array.isArray(j))A=JSON.stringify(j);else if(typeof j=="object"){w.push({key:R,value:"{",indent:_}),Object.entries(j).forEach(([O,T])=>{C(O,T,_+1,!1)}),w.push({key:"",value:"}",indent:_});return}else A=JSON.stringify(j);w.push({key:R,value:A,indent:_})};for(const[R,j]of Object.entries(v))C(R,j);return s.jsx("div",{className:"space-y-1 font-mono text-xs",children:w.map(({key:R,value:j,indent:_},D)=>s.jsxs("div",{className:"flex gap-2",style:{paddingLeft:`${String(_*12)}px`},children:[R&&s.jsxs("span",{className:"font-medium",children:[R,":"]}),s.jsx("span",{className:"text-muted-foreground truncate",title:j,children:j})]},D))})};return s.jsx(vs,{children:s.jsxs(ur,{open:d,onOpenChange:f,children:[s.jsx(dr,{asChild:!0,children:s.jsxs(Se,{type:"button",variant:"ghost",size:"sm",className:"cursor-pointer",children:[s.jsx("span",{className:"text-muted-foreground/75 text-xs font-semibold tracking-wide uppercase",children:"Copy from…"}),s.jsx(La,{className:ne("text-foreground/75 h-3.5 w-3.5 transition-transform duration-200",d&&"rotate-90")})]})}),s.jsx(fr,{side:"bottom",align:"end",className:"w-72",children:l?s.jsx(pt,{disabled:!0,children:"Loading…"}):r.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 p-4 text-center",children:[s.jsx("div",{className:"bg-muted/70 rounded-full p-3",children:s.jsx(eL,{className:"text-muted-foreground h-6 w-6",strokeWidth:1.5})}),s.jsx("span",{className:"text-foreground text-sm font-medium",children:"No matching Data Marts"}),s.jsx("span",{className:"text-muted-foreground text-sm",children:"You can reuse configuration settings only from connector-based Data Marts that use the same source."})]}):s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("div",{className:"text-muted-foreground border-b p-2 text-sm",children:"Select one of your existing Data Marts to reuse its configuration settings."}),s.jsx("div",{children:r.map(v=>{const w=v.definition.connector.source.configuration;return w.length===0?null:w.length===1?s.jsxs(bt,{delayDuration:300,children:[s.jsx(St,{asChild:!0,children:s.jsxs(pt,{onSelect:()=>{g(v,w[0])},children:[s.jsx(up,{className:"text-foreground h-4 w-4"}),v.title]})}),s.jsx(Ct,{side:"right",className:"max-w-sm",children:y(w[0])})]},v.id):s.jsxs(vb,{children:[s.jsxs(xb,{className:"flex items-center gap-2",children:[s.jsx(up,{className:"text-foreground h-4 w-4"}),s.jsx("span",{children:v.title})]}),s.jsx(bb,{children:w.map((S,C)=>s.jsxs(bt,{delayDuration:300,children:[s.jsx(St,{asChild:!0,children:s.jsxs(pt,{onSelect:()=>{g(v,S)},children:["Configuration ",C+1]})}),s.jsx(Ct,{side:"right",className:"max-w-sm",children:y(S)})]},C))})]},v.id)})})]})})]})})}function yT({connector:e,connectorSpecification:t,onConfigurationChange:n,onValidationChange:r,initialConfiguration:o,loading:l=!1,isEditingExisting:c=!1}){const[d,f]=m.useState({}),h=m.useRef(!1),g=m.useRef(!1),[y,v]=m.useState({});m.useEffect(()=>{if(t){g.current=!0;const O={...o??{}};t.forEach(T=>{const M=Array.isArray(T.attributes)?T.attributes.includes("SECRET"):!1;O[T.name]===void 0&&T.default!==void 0&&(O[T.name]=T.default),c&&M&&(O[T.name]=y1)}),f(O),h.current=!0,setTimeout(()=>{g.current=!1},0)}},[t,o,c]),m.useEffect(()=>{h.current&&o&&Object.keys(o).length>0&&(g.current=!0,f({...o}),setTimeout(()=>{g.current=!1},0))},[o]),m.useEffect(()=>{h.current&&!g.current&&Object.keys(d).length>0&&(n==null||n(d))},[d,n]);const b=(O,T)=>{f(M=>({...M,[O]:T}))},w=m.useCallback(O=>!(O==null||typeof O=="string"&&O.trim()===""||typeof O=="number"&&isNaN(O)||Array.isArray(O)&&O.length===0),[]),S=m.useCallback((O,T)=>{var F;if(typeof O!="object"||O===null)return w(O);const M=(F=T.oneOf)==null?void 0:F.filter(G=>G.value===Object.keys(O)[0]);return M?M.every(G=>Object.entries(G.items).every(([,Y])=>G.value in O?S(O[G.value],Y):!1)):w(O[T.name])},[w]),C=m.useCallback((O,T)=>{const M=T.filter(Z=>Z.required&&Z.oneOf),F=M.length===0?!0:M.some(Z=>S(O[Z.name],Z)),Y=T.filter(Z=>Z.required&&Z.name!=="Fields").every(Z=>w(O[Z.name]));return F&&Y},[w,S]),R=(O,T)=>{v(M=>({...M,[O]:T})),f(T?M=>({...M,[O]:""}):M=>({...M,[O]:y1}))},j=O=>{const T={...d};Object.entries(O.configuration).forEach(([M,F])=>{["_id","_copiedFrom"].includes(M)||(T[M]=F)}),T._copiedFrom={dataMartId:O.dataMartId,dataMartTitle:O.dataMartTitle,configId:O.configId},f(T)};if(m.useEffect(()=>{if(t&&r){const O=C(d,t);r(O)}},[d,t,r,C]),l)return s.jsx(bS,{variant:"list"});if(!t||t.length===0)return s.jsxs(ko,{children:[s.jsx(Fl,{connector:e}),s.jsx(Yi,{icon:s.jsx(ff,{size:56,strokeWidth:1}),title:"No configuration found",subtitle:"This connector might not be fully implemented yet or there could be other issues."}),s.jsx(gu,{label:"Need configuration?"})]});const _=[...t].filter(O=>{var T;return O.name!=="Fields"&&!((T=O.attributes)!=null&&T.includes("HIDE_IN_CONFIG_FORM"))}).sort((O,T)=>{const M=F=>{const G=F.default!=null&&F.default!=="";return F.required&&!G?1:F.required&&G?2:!F.required&&!G?3:4};return M(O)-M(T)}),D=_.filter(O=>{var T;return!((T=O.attributes)!=null&&T.includes("ADVANCED"))}),A=_.filter(O=>{var T;return(T=O.attributes)==null?void 0:T.includes("ADVANCED")});return s.jsx(s.Fragment,{children:s.jsxs(ko,{children:[s.jsx(Fl,{connector:e}),s.jsxs(Pl,{children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h3",{className:"text-muted-foreground/75 text-xs font-semibold tracking-wide uppercase",children:"Configure Settings"}),s.jsx(Vne,{currentConnectorName:e.name,onCopyConfiguration:j,connectorSpecification:t})]}),D.length>0&&s.jsx(gT,{items:D,configuration:d,onValueChange:b,onSecretEditToggle:R,secretEditing:y,isEditingExisting:c}),A.length>0&&s.jsx(gT,{collapsibleTitle:"Advanced Settings",items:A,configuration:d,onValueChange:b,onSecretEditToggle:R,secretEditing:y,isEditingExisting:c})]})]})})}function zne({connector:e,connectorFields:t,selectedField:n,connectorName:r,loading:o=!1,onFieldSelect:l}){const c=r?`Select data for ${r}`:"Select data";return o?s.jsx(bS,{variant:"list"}):!t||t.length===0?s.jsxs(ko,{children:[s.jsx(Fl,{connector:e}),s.jsx(Yi,{icon:s.jsx(ff,{size:56,strokeWidth:1}),title:r?`No nodes found for ${r}`:"No nodes found",subtitle:"This connector might not be fully implemented yet or there could be other issues."}),s.jsx(gu,{label:"Missing some data?"})]}):s.jsxs(ko,{children:[s.jsx(Fl,{connector:e}),s.jsxs(Pl,{title:c,children:[t.map(d=>s.jsx(aO,{type:"radio",id:d.name,name:"selectedField",value:d.name,label:d.overview??d.name,checked:n===d.name,onChange:f=>{l(f)},tooltip:d.name&&s.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[s.jsxs("p",{children:[s.jsx("span",{className:"font-semibold",children:"Table name:"})," ",d.destinationName??d.name]}),d.description&&s.jsxs("p",{children:[s.jsx("span",{className:"font-semibold",children:"Description:"})," ",d.description]}),d.documentation&&s.jsxs(ha,{to:d.documentation,target:"_blank",rel:"noopener noreferrer",className:"bg-muted/16 hover:bg-muted/20 dark:bg-muted/8 dark:hover:bg-muted/16 flex items-center justify-center gap-1 rounded-sm px-2 py-1 font-semibold",children:["Read more",s.jsx(La,{className:"h-3 w-3"})]})]}),selected:n===d.name},d.name)),s.jsx(gu,{label:"Missing some data?"})]})]})}var Us=(e=>(e.ASC="asc",e.DESC="desc",e.ORIGINAL="original",e))(Us||{});function vT({connector:e,connectorFields:t,selectedField:n,selectedFields:r,onFieldToggle:o}){const l=m.useRef(null),[c,d]=m.useState(""),[f,h]=m.useState(Us.ORIGINAL),g=t==null?void 0:t.find(R=>R.name===n),y=m.useMemo(()=>(g==null?void 0:g.fields)??[],[g==null?void 0:g.fields]),v=m.useMemo(()=>(g==null?void 0:g.uniqueKeys)??[],[g==null?void 0:g.uniqueKeys]),b=m.useMemo(()=>{const R=new Map;return y.forEach((j,_)=>R.set(j.name,_)),R},[y]),w=m.useMemo(()=>{const R=y.filter(_=>_.name.toLowerCase().includes(c.toLowerCase().trim())),j=(_,D)=>{const A=v.includes(_.name),O=v.includes(D.name);if(A&&!O)return-1;if(!A&&O)return 1;if(f===Us.ASC)return _.name.localeCompare(D.name);if(f===Us.DESC)return D.name.localeCompare(_.name);const T=b.get(_.name)??0,M=b.get(D.name)??0;return T-M};return[...R].sort(j)},[y,c,v,f,b]),S=y.map(R=>R.name),C=r.filter(R=>S.includes(R)).length;return m.useEffect(()=>{if(v.length>0){const R=v.filter(j=>y.some(_=>_.name===j)&&!r.includes(j));R.length>0&&R.forEach(j=>{o(j,!0)})}},[n,v,y,r,o]),m.useEffect(()=>{const R=j=>{const D=(j.ctrlKey||j.metaKey)&&j.shiftKey&&j.key.toLowerCase()==="a",A=document.activeElement.tagName;if(!(A==="INPUT"||A==="TEXTAREA")&&D){j.preventDefault();const O=y.map(F=>F.name),M=O.filter(F=>!r.includes(F)).length>0;O.forEach(F=>{o(F,M)})}};return window.addEventListener("keydown",R),()=>{window.removeEventListener("keydown",R)}},[y,r,o]),!n||!t?s.jsxs(ko,{children:[s.jsx(Fl,{connector:e}),s.jsx(Yi,{icon:s.jsx(ff,{size:56,strokeWidth:1}),title:"No fields found",subtitle:"This connector might not be fully implemented yet or there could be other issues."}),s.jsx(gu,{label:"Need fields?"})]}):y.length?s.jsx(ko,{children:s.jsxs(s.Fragment,{children:[s.jsx(Fl,{connector:e}),s.jsxs("div",{className:"border-border -mt-6 mb-6 flex w-full items-center gap-2 border-b",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(Jl,{className:"text-muted-foreground absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2 cursor-text",onClick:()=>{var R;(R=l.current)==null||R.focus()}}),s.jsx("input",{ref:l,type:"text",placeholder:"Search field",value:c,onChange:R=>{d(R.target.value)},className:"h-12 w-full rounded-none border-0 pl-9 text-sm outline-none"}),c&&s.jsx("button",{type:"button",onClick:()=>{d("")},className:"text-muted-foreground hover:text-foreground absolute top-1/2 right-0 -translate-y-1/2",children:s.jsx(xu,{className:"h-4 w-4"})})]}),s.jsxs(ur,{children:[s.jsx(dr,{asChild:!0,children:s.jsxs(Se,{variant:"ghost",size:"icon","aria-label":"Sort fields",children:[f===Us.ASC&&s.jsx(vR,{className:"text-muted-foreground h-4 w-4"}),f===Us.DESC&&s.jsx(yR,{className:"text-muted-foreground h-4 w-4"}),f===Us.ORIGINAL&&s.jsx(xR,{className:"text-muted-foreground h-4 w-4"})]})}),s.jsxs(fr,{align:"end",children:[s.jsxs(pt,{onSelect:()=>{h(Us.ASC)},children:[s.jsx(vR,{className:"text-muted-foreground mr-2 h-4 w-4"}),"A–Z"]}),s.jsxs(pt,{onSelect:()=>{h(Us.DESC)},children:[s.jsx(yR,{className:"text-muted-foreground mr-2 h-4 w-4"}),"Z–A"]}),s.jsxs(pt,{onSelect:()=>{h(Us.ORIGINAL)},children:[s.jsx(xR,{className:"text-muted-foreground mr-2 h-4 w-4"}),"Original"]})]})]})]}),s.jsxs(Pl,{title:`Selected ${String(C)} of ${String(S.length)} fields for "${n}" data`,children:[w.map(R=>{const j=v.includes(R.name);return s.jsx(aO,{type:"checkbox",id:`field-${R.name}`,name:"selectedFields",value:R.name,checked:r.includes(R.name),selected:r.includes(R.name)||j,disabled:j,onChange:_=>{o(R.name,_)},label:R.name,tooltip:s.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[j&&s.jsxs("p",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"font-semibold",children:"Unique key"})," ",s.jsx(R0,{className:"text-secondary h-3 w-3"})]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-semibold",children:"Type:"})," ",R.type]}),R.description&&s.jsxs("p",{children:[s.jsx("span",{className:"font-semibold",children:"Description:"})," ",R.description]})]}),rightIcon:j?s.jsx(R0,{className:"text-muted-foreground/75 h-4 w-4"}):void 0},R.name)}),w.length===0&&c&&s.jsxs("div",{className:"text-muted-foreground pt-8 pb-4 text-center text-sm",children:['No fields match "',c,'"']}),s.jsx(gu,{label:"Need another field?"})]})]})}):s.jsxs(ko,{children:[s.jsx(Fl,{connector:e}),s.jsx(Yi,{icon:s.jsx(ff,{size:56,strokeWidth:1}),title:"No fields found",subtitle:"This connector might not be fully implemented yet or there could be other issues."}),s.jsx(gu,{label:"Need fields?"})]})}const n5=m.createContext(void 0),r5={triggers:[],selectedTrigger:null,isLoading:!1,error:null};function Hne(e,t){switch(t.type){case"FETCH_TRIGGERS_START":case"FETCH_TRIGGER_START":case"CREATE_TRIGGER_START":case"UPDATE_TRIGGER_START":case"DELETE_TRIGGER_START":return{...e,isLoading:!0,error:null};case"FETCH_TRIGGERS_SUCCESS":return{...e,triggers:t.payload,isLoading:!1};case"FETCH_TRIGGER_SUCCESS":return{...e,selectedTrigger:t.payload,isLoading:!1};case"CREATE_TRIGGER_SUCCESS":return{...e,triggers:[...e.triggers,t.payload],isLoading:!1};case"UPDATE_TRIGGER_SUCCESS":return{...e,triggers:e.triggers.map(n=>n.id===t.payload.id?t.payload:n),selectedTrigger:e.selectedTrigger&&e.selectedTrigger.id===t.payload.id?t.payload:e.selectedTrigger,isLoading:!1};case"DELETE_TRIGGER_SUCCESS":return{...e,triggers:e.triggers.filter(n=>n.id!==t.payload),selectedTrigger:e.selectedTrigger&&e.selectedTrigger.id===t.payload?null:e.selectedTrigger,isLoading:!1};case"FETCH_TRIGGERS_ERROR":case"FETCH_TRIGGER_ERROR":case"CREATE_TRIGGER_ERROR":case"UPDATE_TRIGGER_ERROR":case"DELETE_TRIGGER_ERROR":return{...e,isLoading:!1,error:t.payload};case"SELECT_TRIGGER":return{...e,selectedTrigger:t.payload};case"RESET":return r5;default:return e}}class $ne extends ac{constructor(){super("/data-marts")}async getScheduledTriggers(t){return this.get(`/${t}/scheduled-triggers`)}async getScheduledTrigger(t,n){return this.get(`/${t}/scheduled-triggers/${n}`)}async createScheduledTrigger(t,n){return this.post(`/${t}/scheduled-triggers`,n)}async updateScheduledTrigger(t,n,r){return this.put(`/${t}/scheduled-triggers/${n}`,r)}async deleteScheduledTrigger(t,n){return this.delete(`/${t}/scheduled-triggers/${n}`)}}const Jc=new $ne;var En=(e=>(e.REPORT_RUN="REPORT_RUN",e.CONNECTOR_RUN="CONNECTOR_RUN",e))(En||{});const cu={SCHEDULED_REPORT_RUN:"scheduled-report-run-config"};class v1{mapFromDto(t){return{id:t.id,type:t.type,cronExpression:t.cronExpression,timeZone:t.timeZone,isActive:t.isActive,nextRun:t.nextRunTimestamp?new Date(t.nextRunTimestamp):null,lastRun:t.lastRunTimestamp?new Date(t.lastRunTimestamp):null,triggerConfig:t.triggerConfig,createdById:t.createdById,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt)}}async enhanceWithReportData(t){if(t.type!==En.REPORT_RUN)return t;const n=t.triggerConfig;if(!n.reportId)return t;try{const r=await No.getReportById(n.reportId),o=Al(r);return{...t,triggerConfig:{...n,report:o}}}catch(r){return console.error(`Failed to fetch report data for trigger ${t.id}:`,r),t}}async enhanceTriggersWithReportData(t){return Promise.all(t.map(n=>this.enhanceWithReportData(n)))}mapToCreateRequest(t){return{type:En.REPORT_RUN,cronExpression:t.cronExpression,timeZone:t.timeZone,isActive:t.isActive,triggerConfig:t.triggerConfig}}mapToUpdateRequest(t){return{cronExpression:t.cronExpression,timeZone:t.timeZone,isActive:t.isActive}}}class Bne{mapFromDto(t){return{id:t.id,type:t.type,cronExpression:t.cronExpression,timeZone:t.timeZone,isActive:t.isActive,nextRun:t.nextRunTimestamp?new Date(t.nextRunTimestamp):null,lastRun:t.lastRunTimestamp?new Date(t.lastRunTimestamp):null,triggerConfig:t.triggerConfig,createdById:t.createdById,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt)}}mapToCreateRequest(t){return{type:En.CONNECTOR_RUN,cronExpression:t.cronExpression,timeZone:t.timeZone,isActive:t.isActive,triggerConfig:t.triggerConfig}}mapToUpdateRequest(t){return{cronExpression:t.cronExpression,timeZone:t.timeZone,isActive:t.isActive}}}const i0={getMapper(e){switch(e){case En.REPORT_RUN:return new v1;case En.CONNECTOR_RUN:return new Bne;default:throw new Error(`Unknown scheduled trigger type: ${String(e)}`)}}},qd={mapFromDto(e){return i0.getMapper(e.type).mapFromDto(e)},mapFromDtoList(e){return e.map(t=>this.mapFromDto(t))},async mapFromDtoWithReportData(e,t){const n=this.mapFromDto(e);switch(n.type){case En.REPORT_RUN:return new v1().enhanceWithReportData(n);case En.CONNECTOR_RUN:{const r=t.definition;return{...n,triggerConfig:{...n.triggerConfig,connector:r}}}default:return n}},async mapFromDtoListWithReportData(e,t){const n=new v1,r=this.mapFromDtoList(e),o=r.filter(c=>c.type===En.REPORT_RUN),l=await n.enhanceTriggersWithReportData(o);return r.map(c=>{switch(c.type){case En.REPORT_RUN:return l.find(d=>d.id===c.id)??c;case En.CONNECTOR_RUN:{const d=t.definition;return{...c,triggerConfig:{...c.triggerConfig,connector:d}}}default:return c}})},mapToCreateRequest(e){return i0.getMapper(e.type).mapToCreateRequest(e)},mapToUpdateRequest(e){return i0.getMapper(e.type).mapToUpdateRequest(e)}};function Gne({children:e}){const[t,n]=m.useReducer(Hne,r5),{dataMart:r}=Qo(),{fetchAvailableConnectors:o}=dc();if(!r)throw new Error("Trigger provider must be used within a data mart context");const l=m.useCallback(async b=>{await o(),n({type:"FETCH_TRIGGERS_START"});try{const w=await Jc.getScheduledTriggers(b),S=await qd.mapFromDtoListWithReportData(w,r);n({type:"FETCH_TRIGGERS_SUCCESS",payload:S})}catch(w){const S=w instanceof Error?w.message:"Failed to fetch scheduled triggers";n({type:"FETCH_TRIGGERS_ERROR",payload:S}),Ue({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"ListError",label:S})}},[r,o]),c=m.useCallback(async(b,w)=>{n({type:"FETCH_TRIGGERS_START"});try{const C=(await Jc.getScheduledTriggers(b)).filter(j=>j.type===w),R=await qd.mapFromDtoListWithReportData(C,r);n({type:"FETCH_TRIGGERS_SUCCESS",payload:R})}catch(S){const C=S instanceof Error?S.message:"Failed to fetch scheduled triggers";n({type:"FETCH_TRIGGERS_ERROR",payload:C}),Ue({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"ListError",label:C})}},[r]),d=m.useCallback(async(b,w)=>{n({type:"FETCH_TRIGGER_START"});try{const S=await Jc.getScheduledTrigger(b,w),C=await qd.mapFromDtoWithReportData(S,r);n({type:"FETCH_TRIGGER_SUCCESS",payload:C})}catch(S){const C=S instanceof Error?S.message:"Failed to fetch scheduled trigger";n({type:"FETCH_TRIGGER_ERROR",payload:C}),Ue({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"GetError",label:C})}},[r]),f=m.useCallback(async(b,w,S,C,R,j)=>{n({type:"CREATE_TRIGGER_START"});try{const _={type:w,cronExpression:S,timeZone:C,isActive:R,triggerConfig:j},D=await Jc.createScheduledTrigger(b,_),A=await qd.mapFromDtoWithReportData(D,r);return n({type:"CREATE_TRIGGER_SUCCESS",payload:A}),Ue({event:"scheduled_trigger_created",category:"ScheduledTrigger",action:"Create",label:w}),on.success("Trigger created"),A}catch(_){const D=_ instanceof Error?_.message:"Failed to create scheduled trigger";throw n({type:"CREATE_TRIGGER_ERROR",payload:D}),Ue({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"CreateError",label:D}),_}},[r]),h=m.useCallback(async(b,w,S,C,R)=>{n({type:"UPDATE_TRIGGER_START"});try{const j={cronExpression:S,timeZone:C,isActive:R},_=await Jc.updateScheduledTrigger(b,w,j),D=await qd.mapFromDtoWithReportData(_,r);n({type:"UPDATE_TRIGGER_SUCCESS",payload:D}),Ue({event:"scheduled_trigger_updated",category:"ScheduledTrigger",action:"Update",label:D.type}),on.success("Trigger updated")}catch(j){const _=j instanceof Error?j.message:"Failed to update scheduled trigger";throw n({type:"UPDATE_TRIGGER_ERROR",payload:_}),Ue({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"UpdateError",label:_}),j}},[r]),g=m.useCallback(async(b,w)=>{n({type:"DELETE_TRIGGER_START"});try{await Jc.deleteScheduledTrigger(b,w),n({type:"DELETE_TRIGGER_SUCCESS",payload:w}),Ue({event:"scheduled_trigger_deleted",category:"ScheduledTrigger",action:"Delete",label:w}),on.success("Trigger deleted")}catch(S){const C=S instanceof Error?S.message:"Failed to delete scheduled trigger";throw n({type:"DELETE_TRIGGER_ERROR",payload:C}),Ue({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"DeleteError",label:C}),S}},[]),y=m.useCallback(b=>{n({type:"SELECT_TRIGGER",payload:b})},[]),v=m.useCallback(()=>{n({type:"RESET"})},[]);return s.jsx(n5.Provider,{value:{...t,getScheduledTriggers:l,getScheduledTriggersByType:c,getScheduledTrigger:d,createScheduledTrigger:f,updateScheduledTrigger:h,deleteScheduledTrigger:g,selectScheduledTrigger:y,reset:v},children:e})}function a5(){const e=m.useContext(n5);if(e===void 0)throw new Error("useScheduledTriggerContext must be used within a ScheduledTriggerProvider");return e}function qne(e){const{getScheduledTriggers:t,getScheduledTriggersByType:n,getScheduledTrigger:r,createScheduledTrigger:o,updateScheduledTrigger:l,deleteScheduledTrigger:c,selectScheduledTrigger:d,reset:f,triggers:h,selectedTrigger:g,isLoading:y,error:v}=a5();return m.useEffect(()=>(e?t(e):f(),()=>{f()}),[e,t,f]),{triggers:h,selectedTrigger:g,isLoading:y,error:v,getScheduledTriggers:b=>t(b),getScheduledTriggersByType:(b,w)=>n(b,w),getScheduledTrigger:(b,w)=>r(b,w),createScheduledTrigger:(b,w,S,C,R,j)=>o(b,w,S,C,R,j),updateScheduledTrigger:(b,w,S,C,R)=>l(b,w,S,C,R),deleteScheduledTrigger:(b,w)=>c(b,w),selectScheduledTrigger:d}}const Zne=Jt({type:ga(cu.SCHEDULED_REPORT_RUN),reportId:$t().min(1,"Report ID is required")}),Kne=ZG(),Yne=Jt({type:Ng(En),cronExpression:$t().min(1,"Cron expression is required"),timeZone:$t().min(1,"Time zone is required"),isActive:qG(),triggerConfig:YG([Zne,Kne])});function Wne({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:r}){const o=Xo({resolver:ll(Yne),defaultValues:{type:e?e.type:n??En.REPORT_RUN,cronExpression:(e==null?void 0:e.cronExpression)??"",timeZone:(e==null?void 0:e.timeZone)??Intl.DateTimeFormat().resolvedOptions().timeZone,isActive:(e==null?void 0:e.isActive)??!0,triggerConfig:e?e.triggerConfig:{type:cu.SCHEDULED_REPORT_RUN,reportId:t??""}}});m.useEffect(()=>{t&&o.getValues("type")===En.REPORT_RUN&&o.setValue("triggerConfig",{type:cu.SCHEDULED_REPORT_RUN,reportId:t})},[t,o]),m.useEffect(()=>{n&&(o.setValue("type",n),n===En.REPORT_RUN?o.setValue("triggerConfig",{type:cu.SCHEDULED_REPORT_RUN,reportId:t??""}):o.setValue("triggerConfig",null))},[n,t,o]);const l=d=>{o.setValue("type",d),d===En.REPORT_RUN?o.setValue("triggerConfig",{type:cu.SCHEDULED_REPORT_RUN,reportId:t??""}):o.setValue("triggerConfig",null)},c=async d=>{try{await r(d)}catch(f){console.error("Error submitting form:",f)}};return{form:o,handleTypeChange:l,handleSubmit:o.handleSubmit(c),isDirty:o.formState.isDirty}}const Qne=[je.GOOGLE_SHEETS,je.EMAIL,je.SLACK,je.MS_TEAMS,je.GOOGLE_CHAT];function Xne({value:e,onChange:t,disabled:n}){const{reports:r,fetchReportsByDataMartId:o}=Ts(),{dataMart:l}=Qo();m.useEffect(()=>{l&&o(l.id)},[o,l]);const c=r.filter(d=>Qne.includes(d.dataDestination.type));return s.jsxs(Kr,{value:e,onValueChange:t,disabled:n,children:[s.jsx(Wr,{className:"w-full",children:s.jsx(Yr,{placeholder:"Select a report"})}),s.jsx(Qr,{children:c.map(d=>{const f=Hr.getInfo(d.dataDestination.type).icon;return s.jsx(Rn,{value:d.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(f,{className:"h-4 w-4",size:16}),s.jsx("span",{children:d.title})]})},d.id)})})]})}var Jg="Switch",[Jne]=cr(Jg),[ere,tre]=Jne(Jg),s5=m.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:l,required:c,disabled:d,value:f="on",onCheckedChange:h,form:g,...y}=e,[v,b]=m.useState(null),w=dt(t,_=>b(_)),S=m.useRef(!1),C=v?g||!!v.closest("form"):!0,[R,j]=Gr({prop:o,defaultProp:l??!1,onChange:h,caller:Jg});return s.jsxs(ere,{scope:n,checked:R,disabled:d,children:[s.jsx(et.button,{type:"button",role:"switch","aria-checked":R,"aria-required":c,"data-state":c5(R),"data-disabled":d?"":void 0,disabled:d,value:f,...y,ref:w,onClick:Te(e.onClick,_=>{j(D=>!D),C&&(S.current=_.isPropagationStopped(),S.current||_.stopPropagation())})}),C&&s.jsx(l5,{control:v,bubbles:!S.current,name:r,value:f,checked:R,required:c,disabled:d,form:g,style:{transform:"translateX(-100%)"}})]})});s5.displayName=Jg;var o5="SwitchThumb",i5=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=tre(o5,n);return s.jsx(et.span,{"data-state":c5(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});i5.displayName=o5;var nre="SwitchBubbleInput",l5=m.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...o},l)=>{const c=m.useRef(null),d=dt(c,l),f=dS(n),h=sb(t);return m.useEffect(()=>{const g=c.current;if(!g)return;const y=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(y,"checked").set;if(f!==n&&b){const w=new Event("click",{bubbles:r});b.call(g,n),g.dispatchEvent(w)}},[f,n,r]),s.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:d,style:{...o.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});l5.displayName=nre;function c5(e){return e?"checked":"unchecked"}var rre=s5,are=i5;function u5({className:e,...t}){return s.jsx(rre,{"data-slot":"switch",className:ne("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:s.jsx(are,{"data-slot":"switch-thumb",className:ne("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}function sre(e){const t=e.trim().split(/\s+/);return t.length!==5?null:{minute:t[0],hour:t[1],day:t[2],month:t[3],dayOfWeek:t[4]}}function x1(e,t="UTC"){const n=sre(e);if(!n)return{type:"daily",time:"09:00",weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:15,timezone:t};const{minute:r,hour:o,day:l,month:c,dayOfWeek:d}=n;if(r.startsWith("*/")&&o==="*"&&l==="*"&&c==="*"&&d==="*"){const y=Number.parseInt(r.substring(2));if(!isNaN(y))return{type:"interval",time:"09:00",weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:y,timezone:t}}if(r!=="*"&&o.startsWith("*/")&&l==="*"&&c==="*"&&d==="*"){const y=Number.parseInt(o.substring(2));if(!isNaN(y)&&r==="0")return{type:"interval",time:"09:00",weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"hours",intervalValue:y,timezone:t}}const f=Number.parseInt(r),h=Number.parseInt(o),g=!isNaN(f)&&!isNaN(h)?`${h.toString().padStart(2,"0")}:${f.toString().padStart(2,"0")}`:"09:00";if(!isNaN(f)&&!isNaN(h)&&l==="*"&&c==="*"&&d==="*")return{type:"daily",time:g,weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:15,timezone:t};if(!isNaN(f)&&!isNaN(h)&&l==="*"&&c==="*"&&d!=="*"){const y=d.split(",").map(v=>Number.parseInt(v.trim())).filter(v=>!isNaN(v)&&v>=0&&v<=6);if(y.length>0)return{type:"weekly",time:g,weekdays:y,monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:15,timezone:t}}if(!isNaN(f)&&!isNaN(h)&&l!=="*"&&c==="*"&&d==="*"){const y=l.split(",").map(v=>Number.parseInt(v.trim())).filter(v=>!isNaN(v)&&v>=1&&v<=31);if(y.length>0)return{type:"monthly",time:g,weekdays:[1,2,3,4,5],monthDays:y,customCron:e,intervalType:"minutes",intervalValue:15,timezone:t}}return{type:"custom",time:"09:00",weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:15,timezone:t}}function d5({options:e,selected:t,onSelectionChange:n,placeholder:r="Select items...",searchPlaceholder:o="Search...",maxDisplayItems:l=3}){const[c,d]=m.useState(!1),f=y=>{const v=t.includes(y)?t.filter(b=>b!==y):[...t,y].sort((b,w)=>b-w);n(v)},h=(y,v)=>{v.preventDefault(),v.stopPropagation(),n(t.filter(b=>b!==y))},g=()=>{if(t.length===0)return s.jsx("span",{className:"text-muted-foreground text-sm",children:r});const y=t.map(v=>e.find(b=>b.value===v)).filter(Boolean);return y.length<=l?s.jsx("div",{className:"flex flex-wrap gap-1",children:y.map(v=>s.jsxs(gr,{variant:"secondary",className:"h-5 text-xs",children:[v.label,s.jsx("span",{className:"hover:bg-secondary-foreground/20 ml-1 inline-flex cursor-pointer items-center justify-center rounded-full p-0.5",onClick:b=>h(v.value,b),children:s.jsx(xu,{className:"h-2 w-2"})})]},v.value))}):s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsxs(gr,{variant:"secondary",className:"h-5 text-xs",children:[y[0].label,s.jsx("span",{className:"hover:bg-secondary-foreground/20 ml-1 inline-flex cursor-pointer items-center justify-center rounded-full p-0.5",onClick:v=>h(y[0].value,v),children:s.jsx(xu,{className:"h-2 w-2"})})]}),y.length>1&&s.jsxs(gr,{variant:"outline",className:"h-5 text-xs",children:["+",y.length-1]})]})};return s.jsxs(_S,{open:c,onOpenChange:d,modal:!0,children:[s.jsx(NS,{asChild:!0,children:s.jsxs(Se,{variant:"outline",role:"combobox","aria-expanded":c,className:"h-9 min-h-9 w-full justify-between bg-transparent py-1",children:[s.jsx("div",{className:"flex-1 text-left",children:g()}),s.jsx(H1,{className:"ml-2 h-3 w-3 shrink-0 opacity-50"})]})}),s.jsx(AS,{className:"max-h-[400px] w-full overflow-y-auto p-0",style:{padding:0},children:s.jsxs(LO,{className:"h-full overflow-visible",children:[s.jsx(PO,{placeholder:o,className:"h-8"}),s.jsxs(Lte,{className:"h-full max-h-[350px] overflow-y-auto",children:[s.jsx(UO,{children:"No items found."}),s.jsx(FO,{className:"h-full overflow-visible",children:e.map(y=>s.jsxs(VO,{value:y.value.toString(),onSelect:()=>f(y.value),className:"text-sm",children:[s.jsx(lr,{className:ne("mr-2 h-3 w-3",t.includes(y.value)?"opacity-100":"opacity-0")}),y.label]},y.value))})]})]})})]})}const f5=[{value:1,label:"Monday"},{value:2,label:"Tuesday"},{value:3,label:"Wednesday"},{value:4,label:"Thursday"},{value:5,label:"Friday"},{value:6,label:"Saturday"},{value:0,label:"Sunday"}],zm=()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return"UTC"}};function h5(e,t){if(!t)return"Schedule is disabled";const n=e.time;switch(e.type){case"daily":return`Daily at ${n}`;case"weekly":return`Weekly on ${e.weekdays.map(o=>{var l;return(l=f5.find(c=>c.value===o))==null?void 0:l.label}).join(", ")} at ${n}`;case"monthly":{const o=[...e.monthDays].sort((c,d)=>c-d).map(c=>c===1?"1st":c===2?"2nd":c===3?"3rd":`${String(c)}th`);return`Monthly on the ${o.length===1?o[0]:o.length===2?`${o[0]} and ${o[1]}`:`${o.slice(0,-1).join(", ")}, and ${o[o.length-1]}`} at ${n}`}case"interval":return e.intervalType==="minutes"?`Every ${String(e.intervalValue)} minute${e.intervalValue!==1?"s":""}`:`Every ${String(e.intervalValue)} hour${e.intervalValue!==1?"s":""}`;case"custom":return"Custom schedule";default:return""}}function ore(e,t,n=!0){const r=x1(e,t);return h5(r,n)}const ire=Array.from({length:31},(e,t)=>({value:t+1,label:`${String(t+1)}${t===0?"st":t===1?"nd":t===2?"rd":"th"}`})),b1=[5,10,15,30],S1=[1,2,3,4,6,8,12],lre=({value:e,onChange:t,disabled:n})=>s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ma,{children:"Type"}),s.jsxs(Kr,{value:e,onValueChange:r=>{t(r)},disabled:n,children:[s.jsx(Wr,{className:"w-full",children:s.jsx(Yr,{})}),s.jsxs(Qr,{children:[s.jsx(Rn,{value:"daily",children:"Daily"}),s.jsx(Rn,{value:"weekly",children:"Weekly"}),s.jsx(Rn,{value:"monthly",children:"Monthly"}),s.jsx(Rn,{value:"interval",children:"Interval"})]})]})]}),cre=({value:e,onChange:t,disabled:n})=>s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ma,{children:"Time"}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(Ht,{className:"w-24",type:"time",value:e,onChange:r=>{t(r.target.value)},disabled:n})})]}),xT=({value:e,onChange:t,disabled:n,timezones:r})=>s.jsxs("div",{className:"w-full space-y-2",children:[s.jsx(Ma,{children:"Timezone"}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(DS,{options:r,value:e,onValueChange:t,placeholder:"Select timezone",emptyMessage:"No timezones found",disabled:n,className:"w-full"})})]}),ure=({value:e,onChange:t,disabled:n})=>s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ma,{children:"Days of Week"}),s.jsx("div",{className:n?"pointer-events-none":"",children:s.jsx(d5,{options:f5,selected:e,onSelectionChange:t,placeholder:"Select days...",maxDisplayItems:3})})]}),dre=({value:e,onChange:t,disabled:n})=>s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ma,{children:"Days of Month"}),s.jsx("div",{className:n?"pointer-events-none":"",children:s.jsx(d5,{options:ire,selected:e,onSelectionChange:t,placeholder:"Select days...",maxDisplayItems:4})})]}),fre=({intervalType:e,intervalValue:t,onTypeChange:n,onValueChange:r,disabled:o})=>s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ma,{children:"Type"}),s.jsxs(Kr,{value:e,onValueChange:l=>{n(l)},disabled:o,children:[s.jsx(Wr,{className:"w-full",children:s.jsx(Yr,{})}),s.jsxs(Qr,{children:[s.jsx(Rn,{value:"minutes",children:"Minutes"}),s.jsx(Rn,{value:"hours",children:"Hours"})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ma,{children:"Every"}),s.jsxs(Kr,{value:t.toString(),onValueChange:l=>{r(Number.parseInt(l)||1)},disabled:o,children:[s.jsx(Wr,{className:"w-full",children:s.jsx(Yr,{})}),s.jsx(Qr,{children:(e==="minutes"?b1:S1).map(l=>s.jsxs(Rn,{value:l.toString(),children:[l," ",e==="minutes"?"min":"hr"]},l))})]})]})]}),hre=({value:e,onChange:t,disabled:n})=>s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ma,{className:"text-sm",children:"Cron Expression"}),s.jsx(Ht,{value:e,onChange:r=>{t(r.target.value)},placeholder:"0 9 * * *",className:"h-9 font-mono text-sm",disabled:n}),s.jsx("p",{className:"text-muted-foreground text-xs",children:"Format: minute hour day month day-of-week"})]});function mre({cron:e="0 9 * * *",timezone:t,enabled:n=!0,onChange:r,className:o,showPreview:l=!0,showSaveButton:c=!1}){const[d,f]=m.useState(n),[h,g]=m.useState(t??zm()),[y,v]=m.useState(!1),b=m.useMemo(()=>vZ.getTimezonesWithOffset().map(H=>({value:H.identifier,label:H.displayName,offset:H.offsetString,isDST:H.isDST})),[]),[w,S]=m.useState(()=>x1(e,h)),[C,R]=m.useState(""),[j,_]=m.useState("");m.useEffect(()=>{f(n)},[n]),m.useEffect(()=>{const H=t??zm();g(H)},[t]),m.useEffect(()=>{if(e){const H=x1(e,h);S(H)}},[e,h]);const D=H=>{const[K,k]=H.time.split(":").map(Number);switch(H.type){case"daily":return`${String(k)} ${String(K)} * * *`;case"weekly":return`${String(k)} ${String(K)} * * ${H.weekdays.join(",")}`;case"monthly":return`${String(k)} ${String(K)} ${H.monthDays.join(",")} * *`;case"interval":return H.intervalType==="minutes"?`*/${String(H.intervalValue)} * * * *`:`0 */${String(H.intervalValue)} * * *`;case"custom":return H.customCron;default:return`${String(k)} ${String(K)} * * *`}},A=m.useCallback(H=>{S(K=>{if(K.intervalType===H)return console.log("Type unchanged, skipping update"),K;const z=(H==="minutes"?b1:S1)[0];return{...K,intervalType:H,intervalValue:z}})},[]),O=m.useCallback(H=>{S(K=>(K.intervalType==="minutes"?b1:S1).includes(H)?{...K,intervalValue:H}:K)},[]),T=m.useMemo(()=>H=>h5(H,d),[d]);m.useEffect(()=>{const H=D(w);R(H),_(T(w))},[w,d,h,T]);const M=m.useRef(""),F=m.useRef(""),G=m.useRef(!1);m.useEffect(()=>{const H=D(w);r&&(M.current!==H||F.current!==h||G.current!==d)&&(r({cron:H,timezone:h,enabled:d}),M.current=H,F.current=h,G.current=d)},[w,h,d,r]);const Y=H=>{f(H)},Z=H=>{g(H),S(K=>({...K,timezone:H}))},J=["daily","weekly","monthly"].includes(w.type);return s.jsxs("div",{className:o,children:[s.jsx("div",{className:"mb-4 space-y-4 pt-0",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h3",{className:"text-foreground flex items-center gap-1.5 font-medium",children:"Schedule Settings"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ma,{htmlFor:"schedule-enabled",className:"text-sm font-normal",children:d?"Enabled":"Disabled"}),s.jsx(u5,{id:"schedule-enabled",checked:d,onCheckedChange:Y})]})]})}),s.jsxs("div",{className:"space-y-4 pt-0",children:[s.jsxs("div",{className:`space-y-4 ${d?"":"opacity-50"}`,children:[s.jsx(lre,{value:w.type,onChange:H=>{S(K=>({...K,type:H}))},disabled:!d}),w.type!=="custom"&&w.type!=="interval"&&s.jsxs("div",{className:"flex gap-3",children:[s.jsx(cre,{value:w.time,onChange:H=>{S(K=>({...K,time:H}))},disabled:!d}),J&&s.jsx(xT,{value:h,onChange:Z,disabled:!d,timezones:b})]}),(w.type==="interval"||w.type==="custom")&&s.jsx(xT,{value:h,onChange:Z,disabled:!d,timezones:b}),w.type==="weekly"&&s.jsx(ure,{value:w.weekdays,onChange:H=>{S(K=>({...K,weekdays:H}))},disabled:!d}),w.type==="monthly"&&s.jsx(dre,{value:w.monthDays,onChange:H=>{S(K=>({...K,monthDays:H}))},disabled:!d}),w.type==="interval"&&s.jsx(fre,{intervalType:w.intervalType,intervalValue:w.intervalValue,onTypeChange:A,onValueChange:O,disabled:!d}),w.type==="custom"&&s.jsx(hre,{value:w.customCron,onChange:H=>{S(K=>({...K,customCron:H}))},disabled:!d})]}),l&&s.jsxs(s.Fragment,{children:[s.jsx(B_,{className:"my-3"}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex cursor-pointer items-center justify-between",onClick:()=>{v(!y)},children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(N_,{className:"h-4 w-4"}),s.jsx("span",{className:"text-sm font-medium",children:"Preview"})]}),y?s.jsx(ns,{className:"text-muted-foreground h-4 w-4"}):s.jsx(ka,{className:"text-muted-foreground h-4 w-4"})]}),y&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid gap-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground text-xs",children:"Status:"}),s.jsx(gr,{variant:d?"default":"secondary",className:"text-xs",children:d?"Enabled":"Disabled"})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground text-xs",children:"Cron:"}),s.jsx(gr,{variant:"secondary",className:"font-mono text-xs",children:C})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground text-xs",children:"Timezone:"}),s.jsx(gr,{variant:"outline",className:"text-xs",children:h})]}),s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsx("span",{className:"text-muted-foreground text-xs",children:"Schedule:"}),s.jsx("span",{className:"flex-1 text-right text-xs",children:j})]})]}),d&&J&&h!==zm()&&s.jsxs(MS,{className:"border-amber-200 bg-amber-50",children:[s.jsx(Nf,{className:"h-4 w-4"}),s.jsx(e5,{children:"Time Zone"}),s.jsxs(IS,{children:["Schedule runs in ",h," (not your local ",zm()," ","time). Execution time may differ from expected."]})]})]})]})]}),c&&s.jsx(Se,{className:"w-full",disabled:!d,children:"Save Schedule"})]})]})}function pre(){return s.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:s.jsxs(cn,{value:"trigger-type-options-description-details",children:[s.jsx(un,{children:"How do I choose a type?"}),s.jsxs(dn,{children:[s.jsxs("p",{className:"mb-2",children:[s.jsx("strong",{children:"Report Run"})," - runs a report to import data from the specified Data Storage into a Destination provider (e.g. Google Sheets document)."]}),s.jsxs("p",{className:"mb-2",children:[s.jsx("strong",{children:"Connector Run"})," - runs a connector (e.g., Facebook Ads) configured in the Data Mart to update raw data in the selected Data Storage."]})]})]})})}function gre(){return s.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:s.jsxs(cn,{value:"trigger-type-change-description-details",children:[s.jsx(un,{children:"How do I change the trigger type?"}),s.jsx(dn,{children:s.jsx("p",{children:"Trigger type cannot be changed after the trigger is created. If you need a different type, delete the existing trigger and create a new one with the desired type."})})]})})}function yre(){return s.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:s.jsxs(cn,{value:"report-change-description-details",children:[s.jsx(un,{children:"How do I change a report?"}),s.jsx(dn,{children:s.jsx("p",{children:"The report cannot be changed after the trigger is created. If you need a different report, delete the existing trigger and create a new one with the desired report."})})]})})}function vre(){return s.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:s.jsxs(cn,{value:"report-select-description-details",children:[s.jsx(un,{children:"How do I choose the report?"}),s.jsxs(dn,{children:[s.jsx("p",{className:"mb-2",children:"For a Report Run trigger, select one of the available Destinations (e.g., a Google Sheets report)."}),s.jsxs("p",{children:["You can use an existing one or create a new one on the ",s.jsx("strong",{children:"Destinations"})," tab"," ","of this Data Mart."]})]})]})})}function xre({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:r,onCancel:o,onDirtyChange:l}){const[c,d]=m.useState(!1),{form:f,handleTypeChange:h,handleSubmit:g,isDirty:y}=Wne({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:async C=>{d(!0);try{await r(C)}finally{d(!1)}}});m.useEffect(()=>{l==null||l(y)},[y,l]);const{control:v,watch:b}=f,S=b("type")===En.REPORT_RUN;return s.jsx(rl,{...f,children:s.jsxs(Jo,{onSubmit:C=>void g(C),noValidate:!1,children:[s.jsxs(al,{children:[s.jsx(kt,{control:v,name:"type",render:({field:C})=>s.jsxs(_t,{children:[s.jsx(Rt,{tooltip:"Choose what you want this trigger to run - a report or a connector",children:"Trigger Type"}),s.jsxs(Kr,{onValueChange:R=>{C.onChange(R),h(R)},defaultValue:C.value,disabled:!!n||!!e||!!b("triggerConfig.reportId"),children:[s.jsx(Nt,{children:s.jsx(Wr,{className:"w-full",children:s.jsx(Yr,{placeholder:"Select trigger type"})})}),s.jsxs(Qr,{children:[s.jsx(Rn,{value:En.REPORT_RUN,children:"Report Run"}),s.jsx(Rn,{value:En.CONNECTOR_RUN,children:"Connector Run"})]})]}),s.jsx(wn,{children:e?s.jsx(gre,{}):s.jsx(pre,{})}),s.jsx(Ft,{})]})}),S&&s.jsx(kt,{control:v,name:"triggerConfig.reportId",render:({field:C})=>s.jsxs(_t,{children:[s.jsx(Rt,{tooltip:"Select the report that will be run by this trigger",children:"Report"}),s.jsx(Nt,{children:s.jsx(n3,{children:s.jsx(Xne,{value:C.value,onChange:C.onChange,disabled:!!t||!!e})})}),s.jsx(wn,{children:e!=null&&e.triggerConfig?s.jsx(yre,{}):s.jsx(vre,{})}),s.jsx(Ft,{})]})}),s.jsx(mre,{showPreview:!1,cron:b("cronExpression"),timezone:b("timeZone"),enabled:b("isActive"),onChange:C=>{f.setValue("cronExpression",C.cron,{shouldDirty:!0}),f.setValue("timeZone",C.timezone,{shouldDirty:!0}),f.setValue("isActive",C.enabled,{shouldDirty:!0})},className:"border-border flex flex-col gap-1.5 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 hover:shadow-sm dark:border-transparent dark:bg-white/4"})]}),s.jsxs(sl,{children:[s.jsx(Se,{variant:"default",type:"submit",className:"w-full","aria-label":e?"Save changes":"Create trigger",disabled:!y||c,children:c?e?"Saving...":"Creating...":e?"Save changes":"Create trigger"}),o&&s.jsx(Se,{variant:"outline",type:"button",onClick:o,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function bre({cronExpression:e,timeZone:t,isEnabled:n=!0}){const r=m.useMemo(()=>ore(e,t,n),[e,t,n]);return s.jsxs("div",{children:[s.jsx("div",{children:r}),n&&s.jsx("code",{className:"text-muted-foreground mt-1 block text-xs",children:t})]})}function Sre({table:e}){return s.jsx("div",{className:"text-right",children:s.jsxs(ur,{children:[s.jsx(dr,{asChild:!0,children:s.jsx(Se,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:s.jsx(pa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),s.jsx(fr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>s.jsx(pt,{className:"capitalize",children:s.jsxs("label",{className:"flex items-center space-x-2",children:[s.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.columnDef.meta.title??t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&s.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:s.jsx(lr,{className:"size-3.5 text-white"})})}),s.jsx("span",{children:t.columnDef.meta.title??t.id})]})},t.id))})]})})}function Cre({trigger:e,onEditTrigger:t,onDeleteTrigger:n}){const[r,o]=m.useState(!1),[l,c]=m.useState(!1),d=()=>{c(!1),n(e.id)};return s.jsxs("div",{className:"text-right",onClick:f=>{f.stopPropagation()},children:[s.jsxs(ur,{open:r,onOpenChange:o,children:[s.jsx(dr,{asChild:!0,children:s.jsx(Se,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${r?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:s.jsx(pa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),s.jsxs(fr,{align:"end",children:[s.jsxs(pt,{onClick:()=>{t(e.id)},children:[s.jsx(Au,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Edit trigger"]}),s.jsx(ma,{}),s.jsxs(pt,{onClick:()=>{c(!0)},children:[s.jsx(Xs,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),s.jsx("span",{className:"text-red-600",children:"Delete trigger"})]})]})]}),s.jsx(Tr,{open:l,onOpenChange:c,title:"Delete Scheduled Trigger",description:"Are you sure you want to delete this scheduled trigger? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:d,variant:"destructive"})]})}function Ere({connector:e}){const{connectors:t}=dc(),n=hQ(e,t);return s.jsx(s.Fragment,{children:n})}function m5({connector:e}){return s.jsx(Ere,{connector:e})}function wre(e){if(e.length===0)return{lastRunDate:null,lastRunStatus:null,totalRuns:0,firstRunDate:null};const t=e[0],n=e[e.length-1],r=new Date(n.createdAt);return{lastRunDate:new Date(t.createdAt),lastRunStatus:t.status,totalRuns:e.length,firstRunDate:r}}const Rre=e=>{const{connectors:t}=dc();return m.useMemo(()=>t.find(n=>n.name===e),[t,e])},jre=ye.memo(function({connector:t,children:n}){const r=Rre(t.source.name),{dataMart:o,runs:l,getDataMartRuns:c}=Qo();m.useEffect(()=>{o!=null&&o.id&&c(o.id)},[o==null?void 0:o.id,c]);const d=m.useMemo(()=>r!=null&&r.logoBase64?s.jsx(rc,{base64:r.logoBase64,size:20}):null,[r==null?void 0:r.logoBase64]),f=m.useCallback(()=>{o!=null&&o.storage&&YZ(o.storage,t.storage.fullyQualifiedName)},[o==null?void 0:o.storage,t.storage.fullyQualifiedName]),h=m.useMemo(()=>wre(l),[l]),g=m.useMemo(()=>!h.lastRunDate||!h.lastRunStatus?null:{statusType:sY(h.lastRunStatus),statusText:iY(h.lastRunStatus),date:h.lastRunDate},[h]),y=m.useMemo(()=>(o==null?void 0:o.storage)&&WZ(o.storage),[o]),v=m.useMemo(()=>{const b=t.source.fields.length.toString();return`${t.source.node} • ${b} fields`},[t.source.node,t.source.fields.length]);return s.jsxs(Pb,{children:[s.jsx(Ub,{asChild:!0,children:s.jsx("span",{children:n})}),s.jsxs(Fb,{children:[s.jsxs(Vb,{children:[s.jsx(zb,{children:d}),s.jsxs(Hb,{children:[s.jsx($b,{children:s.jsx(m5,{connector:t})}),s.jsx(Bb,{children:v})]})]}),s.jsxs(Gb,{children:[s.jsxs(ki,{children:[s.jsx(Li,{children:"Last run status:"}),s.jsx(Pi,{children:g?s.jsx(Kf,{type:g.statusType,variant:"ghost",children:g.statusText}):"Not run yet"})]}),s.jsxs(ki,{children:[s.jsx(Li,{children:"Last run date:"}),s.jsx(Pi,{children:g?s.jsx(Zi,{date:g.date}):"Never run"})]}),s.jsxs(ki,{children:[s.jsx(Li,{children:"Total runs:"}),s.jsxs(Pi,{children:[h.totalRuns," runs",h.firstRunDate&&s.jsxs(s.Fragment,{children:[", since"," ",h.firstRunDate.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})]})]})]})]}),s.jsx(qb,{children:s.jsxs(Se,{className:"w-full",variant:"default",onClick:f,title:"Open Storage","aria-label":"Open Storage",children:[y,s.jsx(Fo,{className:"ml-1 inline h-4 w-4","aria-hidden":"true"})]})})]})]})},(e,t)=>e.connector.source.name===t.connector.source.name&&e.connector.storage.fullyQualifiedName===t.connector.storage.fullyQualifiedName&&e.connector.source.node===t.connector.source.node&&e.connector.source.fields.length===t.connector.source.fields.length);function Tre(e){const t=e.triggerConfig,n=Hr.getInfo(t.report.dataDestination.type).icon;return s.jsxs("div",{className:"group inline-flex items-center gap-2 whitespace-nowrap",children:[s.jsx(n,{className:"h-4 w-4",size:16}),t.report.title,s.jsx(rY,{report:t.report,children:s.jsx(Br,{className:"inline-block h-4 w-4 align-text-bottom opacity-0 transition-opacity duration-200 group-hover:opacity-100"})})]})}function _re(e){var o;const t=e.triggerConfig,{connector:n}=t.connector,r=(o=n.info)!=null&&o.logoBase64?s.jsx(rc,{base64:n.info.logoBase64,className:"h-4 w-4",size:16}):s.jsx(zl,{className:"h-4 w-4",size:16});return s.jsxs("div",{className:"group inline-flex items-center gap-2 whitespace-nowrap",children:[r,s.jsx(m5,{connector:n}),s.jsx(jre,{connector:n,children:s.jsx(Br,{className:"inline-block h-4 w-4 align-text-bottom opacity-0 transition-opacity duration-200 group-hover:opacity-100"})})]})}function Nre({trigger:e}){switch(e.type){case En.REPORT_RUN:return Tre(e);case En.CONNECTOR_RUN:return _re(e);default:return s.jsx("div",{className:"text-muted-foreground text-sm",children:"—"})}}function Are({onEditTrigger:e,onDeleteTrigger:t}){return[{accessorKey:"type",size:150,header:"Trigger Type",cell:({row:n})=>{const o=n.getValue("type")===En.REPORT_RUN?"Report Run":"Connector Run";return s.jsx(gr,{variant:"outline",children:o})},meta:{title:"Trigger Type"}},{accessorKey:"triggerConfig",size:35,header:"Run Target",cell:({row:n})=>s.jsx(Nre,{trigger:n.original}),meta:{title:"Run Target"}},{accessorKey:"cronExpression",size:20,header:"Schedule",cell:({row:n})=>{const r=n.getValue("cronExpression"),o=n.original.timeZone,l=n.getValue("isActive");return s.jsx(bre,{cronExpression:String(r),timeZone:o,isEnabled:l})},meta:{title:"Schedule"}},{accessorKey:"nextRun",size:15,header:"Next Run",cell:({row:n})=>{const r=n.original.nextRun;return s.jsx("div",{className:"text-muted-foreground text-sm",children:r?s.jsx(Zi,{date:new Date(r)}):"Not scheduled"})},meta:{title:"Next Run"}},{accessorKey:"lastRun",size:15,header:"Last Run",cell:({row:n})=>{const r=n.original.lastRun;return s.jsx("div",{className:"text-sm",children:r?s.jsx(Zi,{date:new Date(r)}):s.jsx("span",{className:"text-muted-foreground text-sm",children:"Never run"})})},meta:{title:"Last Run"}},{accessorKey:"isActive",size:15,header:"Trigger Status",cell:({row:n})=>{const r=n.getValue("isActive");return s.jsx(Kf,{type:r?In.SUCCESS:In.NEUTRAL,variant:"ghost",showIcon:!1,children:r?"Enabled":"Disabled"})},meta:{title:"Trigger Status"}},{id:"actions",size:80,header:({table:n})=>s.jsx(Sre,{table:n}),cell:({row:n})=>s.jsx(Cre,{trigger:n.original,onEditTrigger:e,onDeleteTrigger:t}),meta:{title:"Actions"}}]}function Dre({table:e,onPreviousClick:t,onNextClick:n}){return s.jsxs("div",{className:"dm-card-pagination",role:"navigation","aria-label":"Table pagination",children:[s.jsx(Se,{variant:"outline",size:"sm",onClick:t,disabled:!e.getCanPreviousPage(),"aria-label":"Go to previous page",children:"Previous"}),s.jsx(Se,{variant:"outline",size:"sm",onClick:n,disabled:!e.getCanNextPage(),"aria-label":"Go to next page",children:"Next"})]})}function kS({isOpen:e,onClose:t,dataMartId:n,preSelectedReportId:r,preSelectedType:o}){const{createScheduledTrigger:l,updateScheduledTrigger:c,selectedTrigger:d}=a5(),[f,h]=m.useState(!1),[g,y]=m.useState(!1),v=m.useCallback(()=>{g?h(!0):t()},[g,t]),b=m.useCallback(()=>{h(!1),y(!1),t()},[t]),w=m.useCallback(D=>{y(D)},[]),S=m.useCallback(()=>{y(!1),t()},[t]),C=!!d,R=m.useMemo(()=>d?{type:d.type,cronExpression:d.cronExpression,timeZone:d.timeZone,isActive:d.isActive,triggerConfig:d.type===En.REPORT_RUN?{type:cu.SCHEDULED_REPORT_RUN,reportId:d.triggerConfig.reportId}:null}:void 0,[d]),j=async D=>{C?await c(n,d.id,D.cronExpression,D.timeZone,D.isActive):await l(n,D.type,D.cronExpression,D.timeZone,D.isActive,D.triggerConfig),S()},_=m.useRef(!1);return m.useEffect(()=>{const D=C?"Edit":"Create",A=(d==null?void 0:d.type)??o;e&&!_.current?(Ue({event:"scheduled_trigger_config_open",category:"ScheduledTrigger",action:D,label:A}),_.current=!0):!e&&_.current&&(Ue({event:"scheduled_trigger_config_close",category:"ScheduledTrigger",action:D,label:A}),_.current=!1)},[e,C,d,o]),s.jsxs(s.Fragment,{children:[s.jsx(Bo,{open:e,onOpenChange:D=>{D||v()},children:s.jsxs(Go,{children:[s.jsxs(qo,{children:[s.jsxs(Zo,{children:[C?"Edit":"Create"," Scheduled Trigger"]}),s.jsx(Xi,{children:"Configure automatic runs for your reports or connectors."})]}),s.jsx(xre,{preSelectedReportId:r,preSelectedType:o,initialData:R,onSubmit:j,onCancel:v,onDirtyChange:w})]})}),s.jsx(Tr,{open:f,onOpenChange:h,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:b,variant:"destructive"})]})}function Ore({triggers:e,dataMartId:t,onEditTrigger:n,onDeleteTrigger:r}){const[o,l]=m.useState(!1),c=m.useCallback(()=>{l(!1)},[]),d=m.useCallback(R=>{r(R)},[r]),f=m.useMemo(()=>Are({onEditTrigger:n,onDeleteTrigger:d}),[n,d]),{sorting:h,setSorting:g,columnVisibility:y,setColumnVisibility:v}=Vu({columns:f,storageKeyPrefix:"data-mart-scheduled-triggers",defaultSortingColumn:"type"}),b=oc({data:e,columns:f,getCoreRowModel:sc(),getPaginationRowModel:Ug(),onSortingChange:g,getSortedRowModel:Fu(),getFilteredRowModel:Qf(),state:{sorting:h,columnVisibility:y},onColumnVisibilityChange:v,enableGlobalFilter:!0,enableColumnResizing:!1}),w=m.useCallback(()=>{b.previousPage()},[b]),S=m.useCallback(()=>{b.nextPage()},[b]);return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"dm-card-table-wrap",children:s.jsxs(ic,{id:"scheduled-triggers-table",className:"dm-card-table",role:"table","aria-label":"Scheduled Triggers",children:[s.jsx(lc,{className:"dm-card-table-header",children:b.getHeaderGroups().map(R=>s.jsx(Pn,{className:"dm-card-table-header-row",children:R.headers.map(j=>s.jsx(uc,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",scope:"col",style:j.column.id==="type"?{width:150,minWidth:150,maxWidth:150}:j.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(j.getSize())}%`},children:j.isPlaceholder?null:typeof j.column.columnDef.header=="function"?j.column.columnDef.header(j.getContext()):j.column.columnDef.header},j.id))},R.id))}),s.jsx(cc,{className:"dm-card-table-body",children:b.getRowModel().rows.length?b.getRowModel().rows.map((R,j)=>s.jsx(Pn,{onClick:()=>{n(R.original.id)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":j+1,children:R.getVisibleCells().map((_,D)=>s.jsx(Zr,{className:`whitespace-normal ${_.column.id==="actions"?"actions-cell":""}`,role:"cell","aria-colindex":D+1,style:_.column.id==="type"?{width:150,minWidth:150,maxWidth:150}:_.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(_.column.getSize())}%`},children:typeof _.column.columnDef.cell=="function"?_.column.columnDef.cell(_.getContext()):_.column.columnDef.cell},_.id))},R.id)):s.jsx(Pn,{children:s.jsx(Zr,{colSpan:f.length,className:"dm-card-table-body-row-empty",role:"cell",children:s.jsx("span",{role:"status","aria-live":"polite",children:"No scheduled triggers found."})})})})]})}),s.jsx(Dre,{table:b,onPreviousClick:w,onNextClick:S}),s.jsx(kS,{isOpen:o,onClose:c,dataMartId:t})]})}function Mre({dataMartId:e}){const{triggers:t,deleteScheduledTrigger:n,selectScheduledTrigger:r,selectedTrigger:o}=qne(e),[l,c]=m.useState(!1);m.useEffect(()=>{o&&c(!0)},[o]);const d=g=>{const y=t.find(v=>v.id===g);y&&r(y)},f=()=>{c(!1),r(null)},h=async g=>{try{await n(e,g)}catch(y){console.error("Error deleting trigger:",y)}};return s.jsxs(s.Fragment,{children:[s.jsx(Ore,{triggers:t,dataMartId:e,onEditTrigger:d,onDeleteTrigger:g=>void h(g)}),s.jsx(kS,{isOpen:l,onClose:f,dataMartId:e})]})}function LS(){return s.jsx("div",{className:"dm-card-block !gap-1.5 !py-3",children:s.jsxs("div",{className:"text-foreground flex items-start gap-1.5 text-sm",children:[s.jsx(G1,{className:"h-5 w-5 shrink-0","aria-hidden":"true"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Time Triggers"}),s.jsxs("p",{className:"text-muted-foreground",children:["Set up automatic runs in the ",s.jsx("span",{className:"font-medium",children:"Triggers"})," tab once you’ve saved and published this Data Mart."]})]})]})})}function Ire({dataStorageType:e,target:t,destinationName:n,connectorName:r,onTargetChange:o}){const l=n.replace(/[^a-zA-Z0-9_]/g,"_"),c=r.replace(/[^a-zA-Z0-9_]/g,"_").toLowerCase(),[d,f]=m.useState(""),[h,g]=m.useState(""),[y,v]=m.useState(null),[b,w]=m.useState(null),S=_=>_.trim()?/^[A-Za-z][A-Za-z0-9_]*$/.test(_)?null:"Use letters, numbers, and underscores; start with a letter":"This field is required",C=m.useCallback((_,D,A,O)=>{o({fullyQualifiedName:`${_}.${D}`,isValid:!!(_&&D&&A===null&&O===null)})},[o]);m.useEffect(()=>{let _="",D="";if(t!=null&&t.fullyQualifiedName){const F=t.fullyQualifiedName.split(".");_=F[0]??"",D=F[1]??""}else _=`${c}_owox`,D=l;const A=S(_),O=S(D);f(_),g(D),v(A),w(O);const T=`${_}.${D}`,M=!!(_&&D&&A===null&&O===null);((t==null?void 0:t.fullyQualifiedName)!==T||t.isValid!==M)&&C(_,D,A,O)},[t,l,c,C]);const R=_=>{f(_);const D=S(_);v(D),C(_,h,D,b)},j=_=>{g(_);const D=S(_);w(D),C(d,_,y,D)};return s.jsxs(ko,{children:[e===ke.GOOGLE_BIGQUERY&&s.jsxs(s.Fragment,{children:[s.jsx(Yi,{icon:s.jsx(SA,{}),title:"Google BigQuery",docUrl:"https://docs.owox.com/docs/storages/supported-storages/google-bigquery/",variant:"compact"}),s.jsxs(Pl,{title:"Choose where to store your data",children:[s.jsxs(Xd,{children:[s.jsx(Mo,{required:!0,htmlFor:"dataset-name",tooltip:"Enter dataset name for Google BigQuery where the connector data will be stored.",children:"Dataset name"}),s.jsx(Ht,{type:"text",id:"dataset-name",placeholder:"Enter dataset name",autoComplete:"off",className:"box-border w-full",value:d,"aria-invalid":!!y,"aria-describedby":y?"dataset-name-error":void 0,onChange:_=>{R(_.target.value)},required:!0}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Dataset is auto-created on first run if it doesn’t exist"}),y&&s.jsx("p",{id:"dataset-name-error",className:"text-destructive text-sm",children:y})]}),s.jsxs(Xd,{children:[s.jsx(Mo,{required:!0,htmlFor:"table-name",tooltip:"Enter table name where the connector data will be stored.",children:"Table name"}),s.jsx(Ht,{type:"text",id:"table-name",placeholder:"Enter table name",autoComplete:"off",className:"box-border w-full",value:h,"aria-invalid":!!b,"aria-describedby":b?"table-name-error":void 0,onChange:_=>{j(_.target.value)},required:!0}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Table is auto-created on first run if it doesn’t exist"}),b&&s.jsx("p",{id:"table-name-error",className:"text-destructive text-sm",children:b})]})]})]}),e===ke.AWS_ATHENA&&s.jsxs(s.Fragment,{children:[s.jsx(Yi,{icon:s.jsx(CA,{}),title:"AWS Athena",docUrl:"https://docs.owox.com/docs/storages/supported-storages/aws-athena/",variant:"compact"}),s.jsxs(Pl,{title:"Choose where to store your data",children:[s.jsxs(Xd,{children:[s.jsx(Mo,{required:!0,htmlFor:"database-name",tooltip:"Enter database name for Amazon Athena where the connector data will be stored.",children:"Database name"}),s.jsx(Ht,{type:"text",id:"database-name",placeholder:"Enter database name",autoComplete:"off",className:"box-border w-full",value:d,"aria-invalid":!!y,"aria-describedby":y?"database-name-error":void 0,onChange:_=>{R(_.target.value)},required:!0}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Database is auto-created on first run if it doesn’t exist"}),y&&s.jsx("p",{id:"database-name-error",className:"text-destructive text-sm",children:y})]}),s.jsxs(Xd,{children:[s.jsx(Mo,{required:!0,htmlFor:"athena-table-name",tooltip:"Enter table name where the connector data will be stored.",children:"Table name"}),s.jsx(Ht,{type:"text",id:"athena-table-name",placeholder:"Enter table name",autoComplete:"off",className:"box-border w-full",value:h,"aria-invalid":!!b,"aria-describedby":b?"athena-table-name-error":void 0,onChange:_=>{j(_.target.value)},required:!0}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Table is auto-created on first run if it doesn’t exist"}),b&&s.jsx("p",{id:"athena-table-name-error",className:"text-destructive text-sm",children:b})]})]})]}),s.jsx(Pl,{title:"Schedule updates",children:s.jsx(LS,{})})]})}function kre({onSubmit:e,dataStorageType:t,configurationOnly:n=!1,existingConnector:r=null,mode:o="full",initialStep:l,preselectedConnector:c,onDirtyChange:d}){const[f,h]=m.useState(!1),[g,y]=m.useState(null),[v,b]=m.useState(""),[w,S]=m.useState([]),[C,R]=m.useState(1),[j,_]=m.useState({}),[D,A]=m.useState(!1),[O,T]=m.useState(new Set),[M,F]=m.useState(new Set),{connectors:G,connectorSpecification:Y,connectorFields:Z,loading:J,loadingSpecification:H,loadingFields:K,error:k,fetchAvailableConnectors:z,fetchConnectorSpecification:B,fetchConnectorFields:ie}=dc();m.useEffect(()=>{d==null||d(f)},[f,d]);const[xe,L]=m.useState(null),q=(n?[{id:1,title:"Configuration",description:"Set up connector parameters"}]:o==="fields-only"?[{id:1,title:"Select Fields",description:"Pick specific fields"}]:[{id:1,title:"Select Connector",description:"Choose a data source"},{id:2,title:"Configuration",description:"Set up connector parameters"},{id:3,title:"Select Nodes",description:"Choose data nodes"},{id:4,title:"Select Fields",description:"Pick specific fields"},{id:5,title:"Target Setup",description:"Configure destination"}]).length,te=m.useCallback(async Ve=>{!O.has(Ve)&&!H&&(T(U=>new Set(U).add(Ve)),await B(Ve))},[O,H,B]),ue=m.useCallback(async Ve=>{M.has(Ve)||(F(U=>new Set(U).add(Ve)),await ie(Ve))},[M,ie]);m.useEffect(()=>{if(!c||g||G.length===0)return;const Ve=G.find(U=>U.name===c);Ve&&(y(Ve),R(l??2),te(Ve.name),!n&&o!=="fields-only"&&ue(Ve.name))},[c,G,g,l,n,o,te,ue]),m.useEffect(()=>{if(G.length===0&&!J&&z(),r&&G.length>0&&!g){const{source:Ve,storage:U}=r;b(Ve.node),S(Ve.fields),_(Ve.configuration[0]||{}),L({fullyQualifiedName:U.fullyQualifiedName,isValid:!0});const Q=G.find(de=>de.name===Ve.name);Q&&(y(Q),te(Q.name),!n&&o!=="fields-only"&&ue(Q.name),o==="fields-only"&&ue(Q.name))}if(n&&G.length>0&&!g&&!r){const Ve=G[0];y(Ve),te(Ve.name)}},[o,r,G,n,J,z,te,ue,g]);const ve=Ve=>{y(Ve),_({}),A(!1),h(!0),T(U=>{const Q=new Set(U);return Q.delete(Ve.name),Q}),te(Ve.name),ue(Ve.name)},le=Ve=>{b(Ve),S([]),h(!0)},Ae=(Ve,U)=>{S(U?Q=>Q.includes(Ve)?Q:[...Q,Ve]:Q=>Q.filter(de=>de!==Ve)),h(!0)},we=(Ve,U)=>{S(U?Q=>{const de=Ve.filter(_e=>!Q.includes(_e));return[...Q,...de]}:Q=>Q.filter(de=>!Ve.includes(de))),h(!0)},Ne=Ve=>{L(Ve),h(!0)},Be=m.useCallback(Ve=>{_(Ve),h(!0)},[]),Qe=m.useCallback(Ve=>{A(Ve)},[]);m.useEffect(()=>{Y&&(Y.some(U=>U.required&&U.name!=="Fields")||A(!0))},[Y]);const qt=()=>{C<q&&R(C+1)},Dt=()=>{C>1&&R(C-1)},Zt=()=>{if(n)return g!==null&&D;if(o==="fields-only")switch(C){case 1:return w.length>0;default:return!1}switch(C){case 1:return g!==null;case 2:return D;case 3:return v!=="";case 4:return w.length>0;case 5:return xe!==null&&xe.fullyQualifiedName!==""&&xe.isValid;default:return!1}},jn=()=>C>1,Nr=(Ve,U)=>{if(!Ve)return U;const Q=Ve.find(de=>de.name===U);return(Q==null?void 0:Q.destinationName)??U},va=()=>{if(n&&C===1)return Y&&g?s.jsx(yT,{connector:g,connectorSpecification:Y,onConfigurationChange:Be,onValidationChange:Qe,initialConfiguration:j,loading:H,isEditingExisting:!!(r!=null&&r.source.configuration.length)}):null;if(o==="fields-only")switch(C){case 1:return g&&v&&Z?s.jsx(vT,{connector:g,connectorFields:Z,selectedField:v,selectedFields:w,onFieldToggle:Ae,onSelectAllFields:we}):null;default:return null}switch(C){case 1:return s.jsx(_ne,{connectors:G,selectedConnector:g,loading:J,error:k,onConnectorSelect:ve,onConnectorDoubleClick:()=>{R(Ve=>Ve<q?Ve+1:Ve)}});case 2:return g&&Y?s.jsx(yT,{connector:g,connectorSpecification:Y,onConfigurationChange:Be,onValidationChange:Qe,initialConfiguration:j,loading:H,isEditingExisting:!1}):null;case 3:return g&&Z?s.jsx(zne,{connectorFields:Z,connector:g,selectedField:v,connectorName:g.displayName,loading:K,onFieldSelect:le}):null;case 4:return g&&v&&Z?s.jsx(vT,{connector:g,connectorFields:Z,selectedField:v,selectedFields:w,onFieldToggle:Ae,onSelectAllFields:we}):null;case 5:return v&&Z?s.jsx(Ire,{dataStorageType:t,destinationName:Nr(Z,v),connectorName:(g==null?void 0:g.displayName)??"",target:xe,onTargetChange:Ne}):null;default:return null}};return s.jsxs(EJ,{children:[s.jsx(wJ,{children:va()}),s.jsx(RJ,{variant:"horizontal",children:s.jsx(Nne,{currentStep:C,totalSteps:q,canGoNext:Zt(),canGoBack:jn(),isLoading:H||K,onNext:qt,onBack:Dt,onFinish:()=>{n&&g?e({source:{name:g.name,configuration:[j],node:(r==null?void 0:r.source.node)??v,fields:(r==null?void 0:r.source.fields)??w},storage:(r==null?void 0:r.storage)??{fullyQualifiedName:(r==null?void 0:r.storage.fullyQualifiedName)??""}}):o==="fields-only"&&r?e({source:{...r.source,fields:w},storage:r.storage}):g&&xe&&e({source:{name:g.name,configuration:[j],node:v,fields:w},storage:{fullyQualifiedName:xe.fullyQualifiedName}}),h(!1)}})})]})}const p5=20,g5=20;function y5({vertical:e,horizontal:t}){if(window.Intercom)try{const n={};n.vertical_padding=e,n.horizontal_padding=t,Object.keys(n).length>0&&window.Intercom("update",n)}catch(n){console.warn("Failed to update Intercom padding",n)}}function Lre(e=30,t=0){y5({vertical:g5+e,horizontal:p5+t})}function C1(){y5({vertical:g5,horizontal:p5})}function v5({isOpen:e,onClose:t,dataStorageType:n,onSubmit:r,configurationOnly:o=!1,existingConnector:l=null,mode:c="full",initialStep:d,preselectedConnector:f}){m.useEffect(()=>(e?Lre(55):C1(),()=>{C1()}),[e]);const[h,g]=m.useState(!1),[y,v]=m.useState(!1),b=m.useCallback(()=>{y?g(!0):t()},[y,t]),w=m.useCallback(()=>{g(!1),v(!1),t()},[t]),S=m.useCallback(C=>{v(C)},[]);return s.jsxs(s.Fragment,{children:[s.jsx(Bo,{open:e,onOpenChange:b,children:s.jsxs(Go,{children:[s.jsxs(qo,{children:[s.jsx(Zo,{children:c==="fields-only"?"Connector Fields":l!=null&&l.source.name?"Edit Connector":"Set Up Connector"}),s.jsx(Xi,{children:c==="fields-only"?"Select fields for your Data Mart":l!=null&&l.source.name?"Update configuration":"Follow these steps to set it up"})]}),s.jsx(kre,{onSubmit:C=>{r(C),t()},dataStorageType:n,configurationOnly:o||c==="configuration-only",existingConnector:l,mode:c,initialStep:d,preselectedConnector:f,onDirtyChange:S})]})}),s.jsx(Tr,{open:h,onOpenChange:g,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:w,variant:"destructive"})]})}const PS=({dataStorageType:e,onSubmit:t,children:n,configurationOnly:r=!1,existingConnector:o=null,preset:l,isOpen:c,onClose:d})=>{const[f,h]=m.useState(!1),[g,y]=m.useState(1),[v,b]=m.useState();m.useEffect(()=>{c!==void 0&&h(c)},[c]);const w=()=>{b(void 0),y(1),h(!0)},S=()=>{h(!1),d==null||d()};return m.useEffect(()=>{l&&(l==="connector"?(b(void 0),y(1),h(!0)):(b(l),y(2),h(!0)))},[l]),s.jsxs(s.Fragment,{children:[n&&s.jsx("div",{onClick:w,style:{cursor:"pointer"},children:n}),s.jsx(Tu,{children:s.jsx(v5,{isOpen:f,onClose:S,dataStorageType:e,onSubmit:t,configurationOnly:r,existingConnector:o,initialStep:g,preselectedConnector:v})})]})};function Pre({storageType:e,onSetupConnector:t,preset:n,isOpen:r,onClose:o}){return s.jsx(PS,{dataStorageType:e,onSubmit:t,configurationOnly:!1,preset:n,isOpen:r,onClose:o,children:s.jsxs(Se,{type:"button",variant:"outline",className:"flex h-24 w-full cursor-pointer items-center justify-center gap-2 border-0 shadow-none dark:border-transparent dark:bg-transparent dark:hover:bg-white/4",children:[s.jsx("div",{className:"text-foreground flex h-7 w-7 items-center justify-center rounded-sm bg-gray-200/50 transition-colors duration-200 group-hover:bg-gray-200/75 dark:bg-white/8 dark:group-hover:bg-white/10",children:s.jsx(B1,{className:"h-4 w-4",strokeWidth:2.25})}),s.jsx("span",{children:"Setup Connector"}),s.jsx(La,{className:"h-6 w-6"})]})})}const Ure=e=>{switch(e){case ke.GOOGLE_BIGQUERY:return"Google BigQuery";case ke.AWS_ATHENA:return"AWS Athena";default:return e}},ou=e=>typeof e=="object"&&"connector"in e,Zd=e=>{if(!ou(e))return!1;const{source:t,storage:n}=e.connector,r=!!t.name&&!!t.configuration&&t.configuration.length>0&&!!t.node&&!!t.fields&&t.fields.length>0,o=!!n.fullyQualifiedName&&n.fullyQualifiedName.split(".").length===2;return r&&o};function Fre({configIndex:e,connectorDef:t,onRemoveConfiguration:n,onUpdateConfiguration:r,totalConfigurations:o,dataStorage:l}){const c=nl.getInfo(l.type),{connectors:d,fetchAvailableConnectors:f}=dc();m.useEffect(()=>{f()},[f]);const h=w=>{const S=d.find(C=>C.name===w);if(S!=null&&S.logoBase64)return()=>s.jsx(rc,{base64:S.logoBase64,size:24})},g=()=>{const w=t.connector.source.node||"No node selected";return s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:"text-muted-foreground/75",children:"Data:"})," ",s.jsx("span",{className:"text-muted-foreground font-medium",children:w}),s.jsx("span",{className:"text-muted-foreground",children:"•"}),s.jsxs(bt,{children:[s.jsx(St,{asChild:!0,children:s.jsxs("span",{className:"text-muted-foreground flex items-center gap-1 font-medium",children:[s.jsx("span",{children:"Edit config"}),s.jsx(La,{className:"h-3 w-3"})]})}),s.jsx(Ct,{children:"Edit connector configuration"})]})]})},y=(w,S,C)=>s.jsxs("span",{children:[s.jsxs("span",{className:"text-muted-foreground/75",children:[w,":"]})," ",s.jsx(vn,{href:C,onClick:R=>{R.stopPropagation()},children:S})]}),v=()=>{switch(l.type){case ke.GOOGLE_BIGQUERY:{const w=l.config.projectId,S=t.connector.storage.fullyQualifiedName,C=S.split(".")[0],R=S.split(".")[1],j=`https://console.cloud.google.com/bigquery?project=${w}&ws=!1m4!1m3!3m2!1s${w}!2s${C}`,_=`https://console.cloud.google.com/bigquery?project=${w}&ws=!1m4!1m3!3m2!1s${w}!2s${C}!3s${R}`;return s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[y("Dataset",C,j),s.jsx("span",{className:"text-muted-foreground",children:"•"}),y("Table",R,_),s.jsxs(bt,{children:[s.jsx(St,{asChild:!0,children:s.jsx(Br,{className:"h-4 w-4"})}),s.jsx(Ct,{children:"The dataset and table are automatically created during the first run of the data mart, if they don't already exist"})]})]})}case ke.AWS_ATHENA:{const w=l.config.region,S=t.connector.storage.fullyQualifiedName,[C,R]=S.split("."),j=`https://console.aws.amazon.com/athena/home?region=${w}#/query-editor`;return s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[y("Database",C,j),s.jsx("span",{className:"text-muted-foreground",children:"•"}),y("Table",R,j),s.jsxs(bt,{children:[s.jsx(St,{asChild:!0,children:s.jsx(Br,{className:"h-4 w-4"})}),s.jsx(Ct,{children:"The database and table are automatically created during the first run of the data mart, if they don't already exist"})]})]})}default:return"Unknown storage type configuration"}},b=()=>o!==1;return s.jsxs("div",{className:"border-border flex w-full items-center rounded-lg border-1 p-1 dark:bg-white/2",children:[s.jsx("div",{className:"flex-grow",children:s.jsxs("div",{className:"grid grid-cols-2 items-center gap-4",children:[s.jsx(PS,{dataStorageType:l.type,onSubmit:r(e),configurationOnly:!0,existingConnector:{source:{...t.connector.source,configuration:[t.connector.source.configuration[e]]},storage:t.connector.storage},children:s.jsx(m1,{icon:h(t.connector.source.name),title:t.connector.source.name||"Connector",subtitle:g(),className:"bg-background hover:bg-muted min-h-[80px] cursor-pointer border-0 transition-colors hover:shadow-none"})}),s.jsx(m1,{title:Ure(l.type),icon:c.icon,subtitle:v(),className:"bg-background min-h-[80px] cursor-default border-0 hover:shadow-none dark:bg-white/2"})]})}),s.jsx("div",{className:"shrink-0 px-4",children:s.jsxs(bt,{children:[s.jsx(St,{asChild:!0,children:s.jsx("span",{children:s.jsx(Se,{type:"button",variant:"ghost",onClick:()=>{b()&&n(e)},disabled:!b(),children:s.jsx(Xs,{className:"h-4 w-4"})})})}),!b()&&s.jsx(Ct,{children:"Remove last configuration only after adding a new one."})]})})]})}function Vre({storageType:e,onAddConfiguration:t,existingConnector:n}){return s.jsx("div",{children:s.jsx(PS,{dataStorageType:e,onSubmit:r=>{const o=r.source.configuration[0]||{};t(o)},configurationOnly:!0,existingConnector:n?{source:{...n.source,configuration:[]},storage:n.storage}:void 0,children:s.jsxs(Se,{type:"button",variant:"outline",className:"dm-card-table-add-field-btn cursor-pointer",children:[s.jsx(Pa,{className:"h-4 w-4"}),s.jsx("span",{children:"Configuration"})]})})})}function zre({control:e,storageType:t,preset:n,autoOpen:r=!1,saveDataMartDefinition:o}){const{dataMart:l,runDataMart:c}=Ia(),{setValue:d,getValues:f,trigger:h}=zu(),[g,y]=m.useState(!1),[v,b]=m.useState(!1);m.useEffect(()=>{r&&b(!0)},[r]);const w=(l==null?void 0:l.status)??Rr.DRAFT,S=async H=>{d("definition",H,{shouldDirty:!0,shouldTouch:!0}),await h("definition")&&o&&o()},C=async H=>{const K=H.source,k=H.storage;await S({connector:{source:K,storage:k}})},R=async H=>{if(l){if(l.status.code!==Rr.PUBLISHED){It.error("Manual run is only available for published data marts");return}await c({id:l.id,payload:H})}},j=H=>async K=>{const z=f().definition;if(typeof z=="object"&&ou(z)){const B=[...z.connector.source.configuration];B[H]=K.source.configuration[0]||{};const ie={connector:{...z.connector,source:{...z.connector.source,configuration:B}}};await S(ie)}},_=async H=>{const k=f().definition;if(typeof k=="object"&&ou(k)){const z={connector:{...k.connector,source:{...k.connector.source,fields:H.source.fields}}};await S(z)}y(!1)},D=H=>{R({runType:H.runType,data:H.data})},A=H=>{const K=H.connector.source.fields.length;return s.jsxs(Se,{type:"button",variant:"outline",onClick:()=>{y(!0)},className:"dm-card-table-add-field-btn cursor-pointer",children:[s.jsx(nL,{className:"h-4 w-4"}),s.jsxs("span",{children:["Edit Fields (",String(K),")"]})]})},[O,T]=m.useState(null),[M,F]=m.useState(!1),G=H=>{T(H),F(!0)},Y=async()=>{O!==null&&(await Z(O),T(null),F(!1))},Z=async H=>{const k=f().definition;if(ou(k)&&k.connector.source.configuration.length<=1){const z=OS(Fe.CONNECTOR);await S(z)}if(typeof k=="object"&&ou(k)&&k.connector.source.configuration.length>1){const z={...k.connector.source,configuration:k.connector.source.configuration.filter((ie,xe)=>xe!==H)},B={connector:{...k.connector,source:z}};await S(B)}},J=async H=>{const k=f().definition;if(ou(k)){const z={...k.connector.source,configuration:[...k.connector.source.configuration,H]},B={connector:{...k.connector,source:z}};await S(B)}};return s.jsxs(s.Fragment,{children:[s.jsx(kt,{control:e,name:"definition",render:({field:H})=>s.jsxs(_t,{className:"dark:bg-white/2",children:[s.jsx(Nt,{children:s.jsx("div",{className:"space-y-3",children:!Zd(H.value)||w===Rr.DRAFT?s.jsx(Pre,{storageType:t,onSetupConnector:K=>{C(K),b(!1)},preset:n,isOpen:v,onClose:()=>{b(!1)}}):s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Vre,{storageType:t,onAddConfiguration:K=>void J(K),existingConnector:Zd(H.value)?{source:H.value.connector.source,storage:H.value.connector.storage}:void 0}),Zd(H.value)&&A(H.value)]}),s.jsx("div",{className:"flex items-center gap-2",children:l&&l.definitionType===Fe.CONNECTOR&&s.jsx(vO,{configuration:l.definition,onManualRun:D,children:s.jsxs(Se,{variant:"outline",children:[s.jsx(rg,{className:"h-4 w-4"}),s.jsx("span",{children:"Manual Run..."})]})})})]}),s.jsx("div",{className:"space-y-3",children:Zd(H.value)&&(l!=null&&l.storage)?H.value.connector.source.configuration.map((K,k)=>{const z=H.value;return s.jsx(Tu,{children:s.jsx(Fre,{configIndex:k,connectorDef:z,dataStorage:l.storage,onRemoveConfiguration:B=>{G(B)},onUpdateConfiguration:B=>j(B),dataMartStatus:typeof w=="object"?w.code:w,totalConfigurations:z.connector.source.configuration.length},k)},k)}):null})]})})}),s.jsx(Ft,{})]})}),s.jsx(Tu,{children:s.jsx(v5,{isOpen:g,onClose:()=>{y(!1)},onSubmit:H=>void _(H),dataStorageType:t,existingConnector:Zd(f().definition)?{source:f().definition.connector.source,storage:f().definition.connector.storage}:void 0,mode:"fields-only"})}),s.jsx(Tr,{open:M,onOpenChange:F,title:"Delete Configuration",description:"Are you sure you want to delete this configuration? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{Y()},onCancel:()=>{T(null)},variant:"destructive"})]})}function Hre({definitionType:e,storageType:t,preset:n,saveDataMartDefinition:r}){const{control:o}=zu(),[l,c]=m.useState(!1);return m.useEffect(()=>{e===Fe.CONNECTOR&&!n?c(!0):c(!1)},[e,n]),s.jsxs("div",{className:"space-y-2",children:[e===Fe.SQL&&s.jsx(Ene,{control:o}),e===Fe.TABLE&&s.jsx(wne,{control:o,storageType:t}),e===Fe.VIEW&&s.jsx(Rne,{control:o,storageType:t}),e===Fe.TABLE_PATTERN&&s.jsx(jne,{control:o,storageType:t}),e===Fe.CONNECTOR&&s.jsx(zre,{control:o,storageType:t,preset:n,autoOpen:l,saveDataMartDefinition:r})]})}function x5(){const[e]=u7(),t=e.get("preset");return m.useMemo(()=>{if(!t)return;const n=t.toLowerCase();return kW(n)},[t])}function $re(e){if(e===0)return"0 Bytes";const t=1024,n=["Bytes","KB","MB","GB","TB"],r=Math.floor(Math.log(e)/Math.log(t));return`${Number.parseFloat((e/Math.pow(t,r)).toFixed(2)).toString()} ${n[r]}`}function Bre(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function Gre(e){return!e||typeof e!="object"?!0:e.LICENSED_APP_EDITION==="COMMUNITY"}function qre(e,t){const[n,r]=m.useState(e);return m.useEffect(()=>{const o=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(o)}},[e,t]),n}const Zre=1e3,Kre=[Ul.SUCCESS,Ul.ERROR,Ul.CANCELLED];function Yre(e){const[t,n]=m.useState(!1),[r,o]=m.useState(null),l=m.useRef({triggerId:null,abortController:null}),c=m.useCallback(y=>l.current.triggerId===y,[]),d=m.useCallback(y=>{o({isValid:!1,error:y instanceof Error?y.message:"Validation failed"}),n(!1)},[]),f=m.useCallback(async()=>{const{triggerId:y,abortController:v}=l.current;if(y){v==null||v.abort(),l.current={triggerId:null,abortController:null},o(null),n(!1);try{await sn.abortSqlDryRunTrigger(e,y)}catch(b){console.error("Failed to cancel trigger:",b)}}},[e]),h=m.useCallback(async(y,v)=>{for(;!v.aborted&&c(y);)try{const b=await sn.getSqlDryRunTriggerStatus(e,y);if(Kre.includes(b)){const w=await sn.getSqlDryRunTriggerResponse(e,y);o({isValid:w.isValid,error:w.error??void 0,bytes:w.bytes}),n(!1),l.current={triggerId:null,abortController:null};return}await new Promise(w=>setTimeout(w,Zre))}catch(b){d(b),l.current={triggerId:null,abortController:null};return}},[e,c,d]),g=m.useCallback(async y=>{await f(),n(!0),o(null);try{const{triggerId:v}=await sn.createSqlDryRunTrigger(e,y),b=new AbortController;l.current={triggerId:v,abortController:b},await h(v,b.signal)}catch(v){d(v)}},[e,f,h,d]);return m.useEffect(()=>()=>{const{triggerId:y,abortController:v}=l.current;v==null||v.abort(),y&&sn.abortSqlDryRunTrigger(e,y).catch(()=>{})},[e]),{validateSql:g,isLoading:t,result:r,cancel:f}}const Wre=300;function Qre({sql:e,dataMartId:t,debounceDelay:n=Wre,className:r="",onValidationStateChange:o}){const l=qre(e.trim(),n),{validateSql:c,isLoading:d,result:f,cancel:h}=Yre(t);m.useEffect(()=>{if(!l){h();const y={isLoading:!1,isValid:null,error:null,bytes:null};o==null||o(y);return}c(l)},[l,c,h,o]),m.useEffect(()=>{const y={isLoading:d,isValid:(f==null?void 0:f.isValid)??null,error:(f==null?void 0:f.error)??null,bytes:(f==null?void 0:f.bytes)??null};o==null||o(y)},[d,f,o]);const g=()=>d?s.jsxs("div",{className:"flex h-5 items-center gap-2",children:[s.jsx(Af,{className:"h-4 w-4 animate-spin"}),s.jsx("span",{className:"text-sm",children:"Validating..."})]}):f?f.isValid?s.jsxs("div",{className:"flex h-5 items-center gap-2",children:[s.jsx(nk,{className:"h-4 w-4 text-green-600"}),s.jsx("span",{className:"text-sm font-medium text-green-600",children:"Valid SQL code"}),f.bytes!==void 0&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"mx-1 text-gray-400",children:"•"}),s.jsxs(bt,{children:[s.jsx(St,{asChild:!0,children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(zl,{className:"h-3 w-3 text-gray-600"}),s.jsx("span",{className:"text-xs text-gray-600",children:$re(f.bytes)})]})}),s.jsx(Ct,{children:s.jsx("p",{className:"text-xs",children:"This is an estimated volume and may differ from the actual value"})})]})]})]}):s.jsxs("div",{className:"flex h-9 items-center gap-2",children:[s.jsx(dp,{className:"h-4 w-4 flex-shrink-0 text-red-600"}),f.error&&s.jsx("span",{className:"text-xs text-red-500",children:f.error})]}):s.jsxs("div",{className:"flex h-5 items-center gap-2 text-gray-500",children:[s.jsx(zl,{className:"h-4 w-4"}),s.jsx("span",{className:"text-sm",children:"Type a query to get started"})]});return s.jsx("div",{className:`inline-flex h-9 items-center px-3 py-2 ${r}`,children:g()})}const Xre={isValid:null,isLoading:!1,error:null},Jre=(e,t)=>{if(e!==Fe.SQL)return"";const n=t;return(n==null?void 0:n.sqlQuery)??""},eae=e=>OS(e);function tae({definitionType:e,initialDefinitionType:t,setDefinitionType:n}){const{dataMart:r,updateDataMartDefinition:o,runSchemaActualization:l}=Ia(),c=x5();if(!r)throw new Error("Data mart not found");const{definition:d,id:f,storage:{type:h}}=r,[,g]=m.useState(Xre),[y,v]=m.useState(!1),b=m.useCallback(()=>{if(!e)return;const J={definitionType:e,definition:OS(e)};return d?{definitionType:e,definition:d}:J},[e,d]),w=m.useCallback(()=>{if(!e)return;const J=Cne(e,h);return ll(J)},[e,h]),S=Xo({resolver:w(),defaultValues:b(),mode:"onChange"}),{handleSubmit:C,reset:R,watch:j,formState:{isDirty:_,isValid:D}}=S,A=j("definition"),O=Jre(e,A);m.useEffect(()=>{e&&R(b())},[e,R,b]),m.useEffect(()=>{if(!e&&!t&&(c!=null&&c.definitionType)){n(c.definitionType);const J={definitionType:c.definitionType,definition:eae(c.definitionType)};R(J)}},[c,e,t,R,n]);const T=m.useCallback(J=>{g({isLoading:J.isLoading,isValid:J.isValid,error:J.error})},[]),M=m.useCallback(J=>{n(J)},[n]),F=m.useCallback(async J=>{if(e&&f)try{await o(f,J.definitionType,J.definition),v(!0),R(J)}catch(H){console.error("Failed to update data mart definition:",H)}},[f,e,o,R]);m.useEffect(()=>{y&&(v(!1),l==null||l())},[y,l]);const G=m.useCallback(J=>{J==null||J.preventDefault(),C(F)(J)},[C,F]),Y=m.useCallback(()=>{R(b())},[R,b]),Z=()=>e?s.jsxs("form",{onSubmit:G,className:"space-y-4",children:[s.jsx(Hre,{definitionType:e,storageType:h,preset:c==null?void 0:c.connectorSourceTitle,saveDataMartDefinition:G}),e!==Fe.CONNECTOR&&s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx(Se,{variant:"default",type:"submit",disabled:!D||!_,children:"Save"}),s.jsx(Se,{type:"button",variant:"ghost",onClick:Y,disabled:!_,children:"Discard"}),e===Fe.SQL&&O&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"h-6 w-px bg-gray-300"}),s.jsx(Qre,{sql:O,dataMartId:f,onValidationStateChange:T})]})]})]}):null;return s.jsx(q3,{...S,children:s.jsxs("div",{className:"space-y-4",children:[!t&&s.jsx(gne,{initialType:e,onTypeSelect:M}),Z()]})})}function nae(e){switch(e){case ke.GOOGLE_BIGQUERY:return{type:"bigquery-data-mart-schema",fields:[]};case ke.AWS_ATHENA:return{type:"athena-data-mart-schema",fields:[]};default:throw new Error(`Unsupported storage type: ${e}`)}}function b5(e){return e.type==="bigquery-data-mart-schema"}function S5(e){return e.type==="athena-data-mart-schema"}function bT(e){return e!==null&&typeof e=="object"&&"mode"in e}function ST(e){return e!==null&&typeof e=="object"&&"isPrimaryKey"in e}function rae(e){return e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):""}function l0(e){return e==null?e:JSON.parse(JSON.stringify(e))}function aae(e){const t=l0(e),[n,r]=m.useState(t),[o,l]=m.useState(!1);m.useEffect(()=>{const f=l0(e);r(f),l(!1)},[e]);const c=m.useCallback(f=>{n?b5(n)&&f.every(bT)?(r({...n,fields:f}),l(!0)):S5(n)&&f.every(ST)&&(r({...n,fields:f}),l(!0)):f.length>0&&(bT(f[0])?(r({type:"bigquery-data-mart-schema",fields:f}),l(!0)):ST(f[0])&&(r({type:"athena-data-mart-schema",fields:f}),l(!0)))},[n]),d=m.useCallback(()=>{const f=l0(e);r(f),l(!1)},[e]);return{schema:n,isDirty:o,updateSchema:c,resetSchema:d,setIsDirty:l}}function sae(e,t){const n=m.useRef(!1),r=m.useRef(!1),[o,l]=m.useState("idle");return m.useEffect(()=>{e||(n.current||r.current)&&(l(t?"error":"success"),n.current=!1,r.current=!1)},[e,t]),{operationStatus:o,startSaveOperation:()=>{n.current=!0,l("idle")},startActualizeOperation:()=>{r.current=!0,l("idle")},resetOperationStatus:()=>{l("idle")}}}function oae(e){const t=m.useMemo(()=>Array.isArray(e)?Object.fromEntries(e.filter(o=>o.meta&&o.meta.hidden).map(o=>["id"in o&&o.id?o.id:"accessorKey"in o&&typeof o.accessorKey=="string"?o.accessorKey:void 0,!1]).filter(([o])=>o!==void 0)):{},[e]),[n,r]=m.useState({});return m.useEffect(()=>{r(t)},[t]),{columnVisibility:n,setColumnVisibility:r,defaultHiddenColumns:t}}function C5(e,t){const n=e.name?e.name.toLowerCase().includes(t):!1,r=e.alias?e.alias.toLowerCase().includes(t):!1,o=e.description?e.description.toLowerCase().includes(t):!1;if(n||r||o)return!0;const l=e;return l.fields&&l.fields.length>0?l.fields.some(c=>C5(c,t)):!1}function E5(e,t,n=""){const r=[];return e.forEach((o,l)=>{const c=n?`${n}.${String(l)}`:String(l),d=o.name?o.name.toLowerCase().includes(t):!1,f=o.alias?o.alias.toLowerCase().includes(t):!1,h=o.description?o.description.toLowerCase().includes(t):!1;if((d||f||h)&&r.push(c),o.fields&&o.fields.length>0){const g=E5(o.fields,t,c);g.length>0&&(r.includes(c)||r.push(c),r.push(...g))}}),r}function iae(e,t,n){const r=e.original;if(!n)return!0;const o=n.toLowerCase();return C5(r,o)}function lae(e){const[t,n]=m.useState(""),r=m.useCallback(l=>{n(l),e.setGlobalFilter(l)},[e]),o=t.toLowerCase();return{value:t,onChange:r,searchValue:o}}function cae(e){const[t,n]=m.useState(new Set),[r,o]=m.useState(null),l=m.useRef(""),c=m.useMemo(()=>{const w=S=>S.some(C=>C.type===$n.RECORD||C.type===$n.STRUCT||C.fields&&w(C.fields));return w(e)},[e]),d=m.useCallback(w=>{n(S=>{const C=new Set(S);return C.has(w)?C.delete(w):C.add(w),C})},[]),f=m.useCallback(()=>{const w=[],S=(C,R="")=>{C.forEach((j,_)=>{const D=R?`${R}.${String(_)}`:String(_);(j.type===$n.RECORD||j.type===$n.STRUCT)&&j.fields&&j.fields.length>0&&(w.push(D),S(j.fields,D))})};S(e),n(C=>w.every(j=>C.has(j))?new Set:new Set(w))},[e]),h=m.useMemo(()=>{const w=[],S=(C,R="",j=0)=>{C.forEach((_,D)=>{const A=R?`${R}.${String(D)}`:String(D),O=_.type===$n.RECORD||_.type===$n.STRUCT;w.push({..._,path:A,level:j}),O&&_.fields&&t.has(A)&&S(_.fields,A,j+1)})};return S(e),w},[e,t]),g=m.useCallback(w=>{if(w!==l.current)if(l.current=w,w){r===null&&o(new Set(t));const C=E5(e,w).filter(R=>{const j=R.split(".").map(Number);let _=e,D;for(let A=0;A<j.length;A++){if(D=_[j[A]],!D)return!1;if((D.type===$n.RECORD||D.type===$n.STRUCT)&&D.fields&&D.fields.length>0)return!0;A<j.length-1&&(_=D.fields??[])}return!1});n(R=>{const j=new Set(R);return C.forEach(_=>{j.add(_)}),j})}else r!==null&&(n(r),o(null))},[e,t,r]),y=m.useCallback(w=>{const S=h[w];return S.type===$n.RECORD||S.type===$n.STRUCT},[h]),v=m.useMemo(()=>e.map(w=>({...w,fields:void 0})),[e]),b=m.useMemo(()=>{const w=[],S=(C,R="")=>{C.forEach((j,_)=>{const D=R?`${R}.${String(_)}`:String(_);(j.type===$n.RECORD||j.type===$n.STRUCT)&&j.fields&&j.fields.length>0&&(w.push(D),S(j.fields,D))})};return S(e),w.length===0?!1:w.every(C=>t.has(C))},[e,t]);return{expandedRecords:t,hasRecordFields:c,toggleRecordExpansion:d,toggleAllRecords:f,flattenedFields:h,handleSearchChange:g,isRecordType:y,topLevelFields:v,allExpanded:b}}function uae(e,t,n,r){const o=m.useCallback((f,h)=>{if(n){const g=[...e],y=t[f].path;if(!y)g[f]={...g[f],...h};else{const v=y.split(".").map(Number);let b=g,w;for(let C=0;C<v.length-1;C++)w=b[v[C]],b=w.fields??[];const S=v[v.length-1];b[S]&&(b[S]={...b[S],...h})}n(g)}},[e,t,n]),l=m.useCallback(()=>{if(n){const f={name:"",type:$n.STRING,mode:bf.NULLABLE,isPrimaryKey:!1,status:es.DISCONNECTED};n([...e,f])}},[e,n]),c=m.useCallback(f=>{if(n){const h=[...e],g=t[f].path;if(!g)h.splice(f,1);else{const y=g.split(".").map(Number);let v=h,b;for(let S=0;S<y.length-1;S++)b=v[y[S]],v=b.fields??[];const w=y[y.length-1];v.splice(w,1)}n(h)}},[e,t,n]),d=m.useCallback(f=>{var h,g;if(n&&r){const y=[...e],v=t[f].path,b={name:"",type:$n.STRING,mode:bf.NULLABLE,isPrimaryKey:!1,status:es.DISCONNECTED};if(!v)(h=y[f]).fields??(h.fields=[]),y[f].fields.push(b);else{const w=v.split(".").map(Number);let S=y;for(let C=0;C<w.length;C++){const R=w[C];C===w.length-1?((g=S[R]).fields??(g.fields=[]),S[R].fields.push(b)):S=S[R].fields??[]}}n(y)}},[e,t,n,r]);return{updateField:o,handleAddRow:l,handleDeleteRow:c,handleAddNestedField:d}}function w5(e,t,n){return{handleDragEnd:m.useCallback(o=>{const{active:l,over:c}=o;if(!c||l.id===c.id||!t)return;if(!n){const v=Number(l.id),b=Number(c.id),w=[...e],[S]=w.splice(v,1);w.splice(b,0,S),t(w);return}const d=n.findIndex((v,b)=>(v.path??String(b))===l.id),f=n.findIndex((v,b)=>(v.path??String(b))===c.id);if(d===-1||f===-1)return;const h=n[d].path,g=n[f].path,y=[...e];if(!h&&!g){const[v]=y.splice(d,1);y.splice(f,0,v),t(y);return}if(h&&g){const v=h.split(".").map(Number),b=g.split(".").map(Number);if(v.length===b.length&&v.slice(0,-1).join(".")===b.slice(0,-1).join(".")){let w=y;for(let j=0;j<v.length-1;j++)w=w[v[j]].fields??[];const S=v[v.length-1],C=b[b.length-1],[R]=w.splice(S,1);w.splice(C,0,R),t(y)}}},[e,n,t])}}function dae(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return m.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const ey=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Bu(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function US(e){return"nodeType"in e}function ya(e){var t,n;return e?Bu(e)?e:US(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function FS(e){const{Document:t}=ya(e);return e instanceof t}function rh(e){return Bu(e)?!1:e instanceof ya(e).HTMLElement}function R5(e){return e instanceof ya(e).SVGElement}function Gu(e){return e?Bu(e)?e.document:US(e)?FS(e)?e:rh(e)||R5(e)?e.ownerDocument:document:document:document}const Ws=ey?m.useLayoutEffect:m.useEffect;function VS(e){const t=m.useRef(e);return Ws(()=>{t.current=e}),m.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function fae(){const e=m.useRef(null),t=m.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=m.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Cf(e,t){t===void 0&&(t=[e]);const n=m.useRef(e);return Ws(()=>{n.current!==e&&(n.current=e)},t),n}function ah(e,t){const n=m.useRef();return m.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Bp(e){const t=VS(e),n=m.useRef(null),r=m.useCallback(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,r]}function E1(e){const t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}let c0={};function sh(e,t){return m.useMemo(()=>{if(t)return t;const n=c0[e]==null?0:c0[e]+1;return c0[e]=n,e+"-"+n},[e,t])}function j5(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((l,c)=>{const d=Object.entries(c);for(const[f,h]of d){const g=l[f];g!=null&&(l[f]=g+e*h)}return l},{...t})}}const yu=j5(1),Gp=j5(-1);function hae(e){return"clientX"in e&&"clientY"in e}function zS(e){if(!e)return!1;const{KeyboardEvent:t}=ya(e.target);return t&&e instanceof t}function mae(e){if(!e)return!1;const{TouchEvent:t}=ya(e.target);return t&&e instanceof t}function w1(e){if(mae(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return hae(e)?{x:e.clientX,y:e.clientY}:null}const Ef=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Ef.Translate.toString(e),Ef.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),CT="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function pae(e){return e.matches(CT)?e:e.querySelector(CT)}const gae={display:"none"};function yae(e){let{id:t,value:n}=e;return ye.createElement("div",{id:t,style:gae},n)}function vae(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return ye.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function xae(){const[e,t]=m.useState("");return{announce:m.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const T5=m.createContext(null);function bae(e){const t=m.useContext(T5);m.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Sae(){const[e]=m.useState(()=>new Set),t=m.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[m.useCallback(r=>{let{type:o,event:l}=r;e.forEach(c=>{var d;return(d=c[o])==null?void 0:d.call(c,l)})},[e]),t]}const Cae={draggable:`
707
+ To pick up a draggable item, press the space bar.
708
+ While dragging, use the arrow keys to move the item.
709
+ Press space again to drop the item in its new position, or press escape to cancel.
710
+ `},Eae={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function wae(e){let{announcements:t=Eae,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=Cae}=e;const{announce:l,announcement:c}=xae(),d=sh("DndLiveRegion"),[f,h]=m.useState(!1);if(m.useEffect(()=>{h(!0)},[]),bae(m.useMemo(()=>({onDragStart(y){let{active:v}=y;l(t.onDragStart({active:v}))},onDragMove(y){let{active:v,over:b}=y;t.onDragMove&&l(t.onDragMove({active:v,over:b}))},onDragOver(y){let{active:v,over:b}=y;l(t.onDragOver({active:v,over:b}))},onDragEnd(y){let{active:v,over:b}=y;l(t.onDragEnd({active:v,over:b}))},onDragCancel(y){let{active:v,over:b}=y;l(t.onDragCancel({active:v,over:b}))}}),[l,t])),!f)return null;const g=ye.createElement(ye.Fragment,null,ye.createElement(yae,{id:r,value:o.draggable}),ye.createElement(vae,{id:d,announcement:c}));return n?ys.createPortal(g,n):g}var or;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(or||(or={}));function qp(){}function _5(e,t){return m.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function N5(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return m.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const Es=Object.freeze({x:0,y:0});function Rae(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function jae(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Tae(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function _ae(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function ET(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const A5=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=ET(t,t.left,t.top),l=[];for(const c of r){const{id:d}=c,f=n.get(d);if(f){const h=Rae(ET(f),o);l.push({id:d,data:{droppableContainer:c,value:h}})}}return l.sort(jae)};function Nae(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height),c=o-r,d=l-n;if(r<o&&n<l){const f=t.width*t.height,h=e.width*e.height,g=c*d,y=g/(f+h-g);return Number(y.toFixed(4))}return 0}const Aae=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const l of r){const{id:c}=l,d=n.get(c);if(d){const f=Nae(d,t);f>0&&o.push({id:c,data:{droppableContainer:l,value:f}})}}return o.sort(Tae)};function Dae(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function D5(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Es}function Oae(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),l=1;l<r;l++)o[l-1]=arguments[l];return o.reduce((c,d)=>({...c,top:c.top+e*d.y,bottom:c.bottom+e*d.y,left:c.left+e*d.x,right:c.right+e*d.x}),{...n})}}const Mae=Oae(1);function Iae(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function kae(e,t,n){const r=Iae(t);if(!r)return e;const{scaleX:o,scaleY:l,x:c,y:d}=r,f=e.left-c-(1-o)*parseFloat(n),h=e.top-d-(1-l)*parseFloat(n.slice(n.indexOf(" ")+1)),g=o?e.width/o:e.width,y=l?e.height/l:e.height;return{width:g,height:y,top:h,right:f+g,bottom:h+y,left:f}}const Lae={ignoreTransform:!1};function qu(e,t){t===void 0&&(t=Lae);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:h,transformOrigin:g}=ya(e).getComputedStyle(e);h&&(n=kae(n,h,g))}const{top:r,left:o,width:l,height:c,bottom:d,right:f}=n;return{top:r,left:o,width:l,height:c,bottom:d,right:f}}function wT(e){return qu(e,{ignoreTransform:!0})}function Pae(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Uae(e,t){return t===void 0&&(t=ya(e).getComputedStyle(e)),t.position==="fixed"}function Fae(e,t){t===void 0&&(t=ya(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const l=t[o];return typeof l=="string"?n.test(l):!1})}function HS(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(FS(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!rh(o)||R5(o)||n.includes(o))return n;const l=ya(e).getComputedStyle(o);return o!==e&&Fae(o,l)&&n.push(o),Uae(o,l)?n:r(o.parentNode)}return e?r(e):n}function O5(e){const[t]=HS(e,1);return t??null}function u0(e){return!ey||!e?null:Bu(e)?e:US(e)?FS(e)||e===Gu(e).scrollingElement?window:rh(e)?e:null:null}function M5(e){return Bu(e)?e.scrollX:e.scrollLeft}function I5(e){return Bu(e)?e.scrollY:e.scrollTop}function R1(e){return{x:M5(e),y:I5(e)}}var pr;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(pr||(pr={}));function k5(e){return!ey||!e?!1:e===document.scrollingElement}function L5(e){const t={x:0,y:0},n=k5(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,l=e.scrollLeft<=t.x,c=e.scrollTop>=r.y,d=e.scrollLeft>=r.x;return{isTop:o,isLeft:l,isBottom:c,isRight:d,maxScroll:r,minScroll:t}}const Vae={x:.2,y:.2};function zae(e,t,n,r,o){let{top:l,left:c,right:d,bottom:f}=n;r===void 0&&(r=10),o===void 0&&(o=Vae);const{isTop:h,isBottom:g,isLeft:y,isRight:v}=L5(e),b={x:0,y:0},w={x:0,y:0},S={height:t.height*o.y,width:t.width*o.x};return!h&&l<=t.top+S.height?(b.y=pr.Backward,w.y=r*Math.abs((t.top+S.height-l)/S.height)):!g&&f>=t.bottom-S.height&&(b.y=pr.Forward,w.y=r*Math.abs((t.bottom-S.height-f)/S.height)),!v&&d>=t.right-S.width?(b.x=pr.Forward,w.x=r*Math.abs((t.right-S.width-d)/S.width)):!y&&c<=t.left+S.width&&(b.x=pr.Backward,w.x=r*Math.abs((t.left+S.width-c)/S.width)),{direction:b,speed:w}}function Hae(e){if(e===document.scrollingElement){const{innerWidth:l,innerHeight:c}=window;return{top:0,left:0,right:l,bottom:c,width:l,height:c}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function P5(e){return e.reduce((t,n)=>yu(t,R1(n)),Es)}function $ae(e){return e.reduce((t,n)=>t+M5(n),0)}function Bae(e){return e.reduce((t,n)=>t+I5(n),0)}function Gae(e,t){if(t===void 0&&(t=qu),!e)return;const{top:n,left:r,bottom:o,right:l}=t(e);O5(e)&&(o<=0||l<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const qae=[["x",["left","right"],$ae],["y",["top","bottom"],Bae]];class $S{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=HS(n),o=P5(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,c,d]of qae)for(const f of c)Object.defineProperty(this,f,{get:()=>{const h=d(r),g=o[l]-h;return this.rect[f]+g},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class af{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function Zae(e){const{EventTarget:t}=ya(e);return e instanceof t?e:Gu(e)}function d0(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var Xa;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Xa||(Xa={}));function RT(e){e.preventDefault()}function Kae(e){e.stopPropagation()}var Gt;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Gt||(Gt={}));const U5={start:[Gt.Space,Gt.Enter],cancel:[Gt.Esc],end:[Gt.Space,Gt.Enter,Gt.Tab]},Yae=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Gt.Right:return{...n,x:n.x+25};case Gt.Left:return{...n,x:n.x-25};case Gt.Down:return{...n,y:n.y+25};case Gt.Up:return{...n,y:n.y-25}}};class F5{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new af(Gu(n)),this.windowListeners=new af(ya(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Xa.Resize,this.handleCancel),this.windowListeners.add(Xa.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Xa.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Gae(r),n(Es)}handleKeyDown(t){if(zS(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:l=U5,coordinateGetter:c=Yae,scrollBehavior:d="smooth"}=o,{code:f}=t;if(l.end.includes(f)){this.handleEnd(t);return}if(l.cancel.includes(f)){this.handleCancel(t);return}const{collisionRect:h}=r.current,g=h?{x:h.left,y:h.top}:Es;this.referenceCoordinates||(this.referenceCoordinates=g);const y=c(t,{active:n,context:r.current,currentCoordinates:g});if(y){const v=Gp(y,g),b={x:0,y:0},{scrollableAncestors:w}=r.current;for(const S of w){const C=t.code,{isTop:R,isRight:j,isLeft:_,isBottom:D,maxScroll:A,minScroll:O}=L5(S),T=Hae(S),M={x:Math.min(C===Gt.Right?T.right-T.width/2:T.right,Math.max(C===Gt.Right?T.left:T.left+T.width/2,y.x)),y:Math.min(C===Gt.Down?T.bottom-T.height/2:T.bottom,Math.max(C===Gt.Down?T.top:T.top+T.height/2,y.y))},F=C===Gt.Right&&!j||C===Gt.Left&&!_,G=C===Gt.Down&&!D||C===Gt.Up&&!R;if(F&&M.x!==y.x){const Y=S.scrollLeft+v.x,Z=C===Gt.Right&&Y<=A.x||C===Gt.Left&&Y>=O.x;if(Z&&!v.y){S.scrollTo({left:Y,behavior:d});return}Z?b.x=S.scrollLeft-Y:b.x=C===Gt.Right?S.scrollLeft-A.x:S.scrollLeft-O.x,b.x&&S.scrollBy({left:-b.x,behavior:d});break}else if(G&&M.y!==y.y){const Y=S.scrollTop+v.y,Z=C===Gt.Down&&Y<=A.y||C===Gt.Up&&Y>=O.y;if(Z&&!v.x){S.scrollTo({top:Y,behavior:d});return}Z?b.y=S.scrollTop-Y:b.y=C===Gt.Down?S.scrollTop-A.y:S.scrollTop-O.y,b.y&&S.scrollBy({top:-b.y,behavior:d});break}}this.handleMove(t,yu(Gp(y,this.referenceCoordinates),b))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}F5.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=U5,onActivation:o}=t,{active:l}=n;const{code:c}=e.nativeEvent;if(r.start.includes(c)){const d=l.activatorNode.current;return d&&e.target!==d?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function jT(e){return!!(e&&"distance"in e)}function TT(e){return!!(e&&"delay"in e)}class BS{constructor(t,n,r){var o;r===void 0&&(r=Zae(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:l}=t,{target:c}=l;this.props=t,this.events=n,this.document=Gu(c),this.documentListeners=new af(this.document),this.listeners=new af(r),this.windowListeners=new af(ya(c)),this.initialCoordinates=(o=w1(l))!=null?o:Es,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Xa.Resize,this.handleCancel),this.windowListeners.add(Xa.DragStart,RT),this.windowListeners.add(Xa.VisibilityChange,this.handleCancel),this.windowListeners.add(Xa.ContextMenu,RT),this.documentListeners.add(Xa.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(TT(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(jT(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Xa.Click,Kae,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Xa.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:l}=this,{onMove:c,options:{activationConstraint:d}}=l;if(!o)return;const f=(n=w1(t))!=null?n:Es,h=Gp(o,f);if(!r&&d){if(jT(d)){if(d.tolerance!=null&&d0(h,d.tolerance))return this.handleCancel();if(d0(h,d.distance))return this.handleStart()}if(TT(d)&&d0(h,d.tolerance))return this.handleCancel();this.handlePending(d,h);return}t.cancelable&&t.preventDefault(),c(f)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Gt.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Wae={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ty extends BS{constructor(t){const{event:n}=t,r=Gu(n.target);super(t,Wae,r)}}ty.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const Qae={move:{name:"mousemove"},end:{name:"mouseup"}};var j1;(function(e){e[e.RightClick=2]="RightClick"})(j1||(j1={}));class Xae extends BS{constructor(t){super(t,Qae,Gu(t.event.target))}}Xae.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===j1.RightClick?!1:(r==null||r({event:n}),!0)}}];const f0={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Jae extends BS{constructor(t){super(t,f0)}static setup(){return window.addEventListener(f0.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(f0.move.name,t)};function t(){}}}Jae.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r==null||r({event:n}),!0)}}];var sf;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(sf||(sf={}));var Zp;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Zp||(Zp={}));function ese(e){let{acceleration:t,activator:n=sf.Pointer,canScroll:r,draggingRect:o,enabled:l,interval:c=5,order:d=Zp.TreeOrder,pointerCoordinates:f,scrollableAncestors:h,scrollableAncestorRects:g,delta:y,threshold:v}=e;const b=nse({delta:y,disabled:!l}),[w,S]=fae(),C=m.useRef({x:0,y:0}),R=m.useRef({x:0,y:0}),j=m.useMemo(()=>{switch(n){case sf.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case sf.DraggableRect:return o}},[n,o,f]),_=m.useRef(null),D=m.useCallback(()=>{const O=_.current;if(!O)return;const T=C.current.x*R.current.x,M=C.current.y*R.current.y;O.scrollBy(T,M)},[]),A=m.useMemo(()=>d===Zp.TreeOrder?[...h].reverse():h,[d,h]);m.useEffect(()=>{if(!l||!h.length||!j){S();return}for(const O of A){if((r==null?void 0:r(O))===!1)continue;const T=h.indexOf(O),M=g[T];if(!M)continue;const{direction:F,speed:G}=zae(O,M,j,t,v);for(const Y of["x","y"])b[Y][F[Y]]||(G[Y]=0,F[Y]=0);if(G.x>0||G.y>0){S(),_.current=O,w(D,c),C.current=G,R.current=F;return}}C.current={x:0,y:0},R.current={x:0,y:0},S()},[t,D,r,S,l,c,JSON.stringify(j),JSON.stringify(b),w,h,A,g,JSON.stringify(v)])}const tse={x:{[pr.Backward]:!1,[pr.Forward]:!1},y:{[pr.Backward]:!1,[pr.Forward]:!1}};function nse(e){let{delta:t,disabled:n}=e;const r=E1(t);return ah(o=>{if(n||!r||!o)return tse;const l={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[pr.Backward]:o.x[pr.Backward]||l.x===-1,[pr.Forward]:o.x[pr.Forward]||l.x===1},y:{[pr.Backward]:o.y[pr.Backward]||l.y===-1,[pr.Forward]:o.y[pr.Forward]||l.y===1}}},[n,t,r])}function rse(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return ah(o=>{var l;return t==null?null:(l=r??o)!=null?l:null},[r,t])}function ase(e,t){return m.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,l=o.activators.map(c=>({eventName:c.eventName,handler:t(c.handler,r)}));return[...n,...l]},[]),[e,t])}var wf;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(wf||(wf={}));var T1;(function(e){e.Optimized="optimized"})(T1||(T1={}));const _T=new Map;function sse(e,t){let{dragging:n,dependencies:r,config:o}=t;const[l,c]=m.useState(null),{frequency:d,measure:f,strategy:h}=o,g=m.useRef(e),y=C(),v=Cf(y),b=m.useCallback(function(R){R===void 0&&(R=[]),!v.current&&c(j=>j===null?R:j.concat(R.filter(_=>!j.includes(_))))},[v]),w=m.useRef(null),S=ah(R=>{if(y&&!n)return _T;if(!R||R===_T||g.current!==e||l!=null){const j=new Map;for(let _ of e){if(!_)continue;if(l&&l.length>0&&!l.includes(_.id)&&_.rect.current){j.set(_.id,_.rect.current);continue}const D=_.node.current,A=D?new $S(f(D),D):null;_.rect.current=A,A&&j.set(_.id,A)}return j}return R},[e,l,n,y,f]);return m.useEffect(()=>{g.current=e},[e]),m.useEffect(()=>{y||b()},[n,y]),m.useEffect(()=>{l&&l.length>0&&c(null)},[JSON.stringify(l)]),m.useEffect(()=>{y||typeof d!="number"||w.current!==null||(w.current=setTimeout(()=>{b(),w.current=null},d))},[d,y,b,...r]),{droppableRects:S,measureDroppableContainers:b,measuringScheduled:l!=null};function C(){switch(h){case wf.Always:return!1;case wf.BeforeDragging:return n;default:return!n}}}function V5(e,t){return ah(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function ose(e,t){return V5(e,t)}function ise(e){let{callback:t,disabled:n}=e;const r=VS(t),o=m.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:l}=window;return new l(r)},[r,n]);return m.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function ny(e){let{callback:t,disabled:n}=e;const r=VS(t),o=m.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:l}=window;return new l(r)},[n]);return m.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function lse(e){return new $S(qu(e),e)}function NT(e,t,n){t===void 0&&(t=lse);const[r,o]=m.useState(null);function l(){o(f=>{if(!e)return null;if(e.isConnected===!1){var h;return(h=f??n)!=null?h:null}const g=t(e);return JSON.stringify(f)===JSON.stringify(g)?f:g})}const c=ise({callback(f){if(e)for(const h of f){const{type:g,target:y}=h;if(g==="childList"&&y instanceof HTMLElement&&y.contains(e)){l();break}}}}),d=ny({callback:l});return Ws(()=>{l(),e?(d==null||d.observe(e),c==null||c.observe(document.body,{childList:!0,subtree:!0})):(d==null||d.disconnect(),c==null||c.disconnect())},[e]),r}function cse(e){const t=V5(e);return D5(e,t)}const AT=[];function use(e){const t=m.useRef(e),n=ah(r=>e?r&&r!==AT&&e&&t.current&&e.parentNode===t.current.parentNode?r:HS(e):AT,[e]);return m.useEffect(()=>{t.current=e},[e]),n}function dse(e){const[t,n]=m.useState(null),r=m.useRef(e),o=m.useCallback(l=>{const c=u0(l.target);c&&n(d=>d?(d.set(c,R1(c)),new Map(d)):null)},[]);return m.useEffect(()=>{const l=r.current;if(e!==l){c(l);const d=e.map(f=>{const h=u0(f);return h?(h.addEventListener("scroll",o,{passive:!0}),[h,R1(h)]):null}).filter(f=>f!=null);n(d.length?new Map(d):null),r.current=e}return()=>{c(e),c(l)};function c(d){d.forEach(f=>{const h=u0(f);h==null||h.removeEventListener("scroll",o)})}},[o,e]),m.useMemo(()=>e.length?t?Array.from(t.values()).reduce((l,c)=>yu(l,c),Es):P5(e):Es,[e,t])}function DT(e,t){t===void 0&&(t=[]);const n=m.useRef(null);return m.useEffect(()=>{n.current=null},t),m.useEffect(()=>{const r=e!==Es;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Gp(e,n.current):Es}function fse(e){m.useEffect(()=>{if(!ey)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function hse(e,t){return m.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:l}=r;return n[o]=c=>{l(c,t)},n},{}),[e,t])}function z5(e){return m.useMemo(()=>e?Pae(e):null,[e])}const OT=[];function mse(e,t){t===void 0&&(t=qu);const[n]=e,r=z5(n?ya(n):null),[o,l]=m.useState(OT);function c(){l(()=>e.length?e.map(f=>k5(f)?r:new $S(t(f),f)):OT)}const d=ny({callback:c});return Ws(()=>{d==null||d.disconnect(),c(),e.forEach(f=>d==null?void 0:d.observe(f))},[e]),o}function pse(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return rh(t)?t:e}function gse(e){let{measure:t}=e;const[n,r]=m.useState(null),o=m.useCallback(h=>{for(const{target:g}of h)if(rh(g)){r(y=>{const v=t(g);return y?{...y,width:v.width,height:v.height}:v});break}},[t]),l=ny({callback:o}),c=m.useCallback(h=>{const g=pse(h);l==null||l.disconnect(),g&&(l==null||l.observe(g)),r(g?t(g):null)},[t,l]),[d,f]=Bp(c);return m.useMemo(()=>({nodeRef:d,rect:n,setRef:f}),[n,d,f])}const yse=[{sensor:ty,options:{}},{sensor:F5,options:{}}],vse={current:{}},sp={draggable:{measure:wT},droppable:{measure:wT,strategy:wf.WhileDragging,frequency:T1.Optimized},dragOverlay:{measure:qu}};class of extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const xse={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new of,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:qp},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:sp,measureDroppableContainers:qp,windowRect:null,measuringScheduled:!1},bse={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:qp,draggableNodes:new Map,over:null,measureDroppableContainers:qp},ry=m.createContext(bse),H5=m.createContext(xse);function Sse(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new of}}}function Cse(e,t){switch(t.type){case or.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case or.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case or.DragEnd:case or.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case or.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new of(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case or.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,l=e.droppable.containers.get(n);if(!l||r!==l.key)return e;const c=new of(e.droppable.containers);return c.set(n,{...l,disabled:o}),{...e,droppable:{...e.droppable,containers:c}}}case or.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const l=new of(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function Ese(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=m.useContext(ry),l=E1(r),c=E1(n==null?void 0:n.id);return m.useEffect(()=>{if(!t&&!r&&l&&c!=null){if(!zS(l)||document.activeElement===l.target)return;const d=o.get(c);if(!d)return;const{activatorNode:f,node:h}=d;if(!f.current&&!h.current)return;requestAnimationFrame(()=>{for(const g of[f.current,h.current]){if(!g)continue;const y=pae(g);if(y){y.focus();break}}})}},[r,t,o,c,l]),null}function wse(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,l)=>l({transform:o,...r}),n):n}function Rse(e){return m.useMemo(()=>({draggable:{...sp.draggable,...e==null?void 0:e.draggable},droppable:{...sp.droppable,...e==null?void 0:e.droppable},dragOverlay:{...sp.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function jse(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const l=m.useRef(!1),{x:c,y:d}=typeof o=="boolean"?{x:o,y:o}:o;Ws(()=>{if(!c&&!d||!t){l.current=!1;return}if(l.current||!r)return;const h=t==null?void 0:t.node.current;if(!h||h.isConnected===!1)return;const g=n(h),y=D5(g,r);if(c||(y.x=0),d||(y.y=0),l.current=!0,Math.abs(y.x)>0||Math.abs(y.y)>0){const v=O5(h);v&&v.scrollBy({top:y.y,left:y.x})}},[t,c,d,r,n])}const $5=m.createContext({...Es,scaleX:1,scaleY:1});var Ai;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Ai||(Ai={}));const B5=m.memo(function(t){var n,r,o,l;let{id:c,accessibility:d,autoScroll:f=!0,children:h,sensors:g=yse,collisionDetection:y=Aae,measuring:v,modifiers:b,...w}=t;const S=m.useReducer(Cse,void 0,Sse),[C,R]=S,[j,_]=Sae(),[D,A]=m.useState(Ai.Uninitialized),O=D===Ai.Initialized,{draggable:{active:T,nodes:M,translate:F},droppable:{containers:G}}=C,Y=T!=null?M.get(T):null,Z=m.useRef({initial:null,translated:null}),J=m.useMemo(()=>{var Sn;return T!=null?{id:T,data:(Sn=Y==null?void 0:Y.data)!=null?Sn:vse,rect:Z}:null},[T,Y]),H=m.useRef(null),[K,k]=m.useState(null),[z,B]=m.useState(null),ie=Cf(w,Object.values(w)),xe=sh("DndDescribedBy",c),L=m.useMemo(()=>G.getEnabled(),[G]),P=Rse(v),{droppableRects:q,measureDroppableContainers:te,measuringScheduled:ue}=sse(L,{dragging:O,dependencies:[F.x,F.y],config:P.droppable}),ve=rse(M,T),le=m.useMemo(()=>z?w1(z):null,[z]),Ae=As(),we=ose(ve,P.draggable.measure);jse({activeNode:T!=null?M.get(T):null,config:Ae.layoutShiftCompensation,initialRect:we,measure:P.draggable.measure});const Ne=NT(ve,P.draggable.measure,we),Be=NT(ve?ve.parentElement:null),Qe=m.useRef({activatorEvent:null,active:null,activeNode:ve,collisionRect:null,collisions:null,droppableRects:q,draggableNodes:M,draggingNode:null,draggingNodeRect:null,droppableContainers:G,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),qt=G.getNodeFor((n=Qe.current.over)==null?void 0:n.id),Dt=gse({measure:P.dragOverlay.measure}),Zt=(r=Dt.nodeRef.current)!=null?r:ve,jn=O?(o=Dt.rect)!=null?o:Ne:null,Nr=!!(Dt.nodeRef.current&&Dt.rect),va=cse(Nr?null:Ne),Ve=z5(Zt?ya(Zt):null),U=use(O?qt??ve:null),Q=mse(U),de=wse(b,{transform:{x:F.x-va.x,y:F.y-va.y,scaleX:1,scaleY:1},activatorEvent:z,active:J,activeNodeRect:Ne,containerNodeRect:Be,draggingNodeRect:jn,over:Qe.current.over,overlayNodeRect:Dt.rect,scrollableAncestors:U,scrollableAncestorRects:Q,windowRect:Ve}),_e=le?yu(le,F):null,be=dse(U),Ee=DT(be),We=DT(be,[Ne]),ot=yu(de,Ee),it=jn?Mae(jn,de):null,xn=J&&it?y({active:J,collisionRect:it,droppableRects:q,droppableContainers:L,pointerCoordinates:_e}):null,Ua=_ae(xn,"id"),[bn,ei]=m.useState(null),Fn=Nr?de:yu(de,We),Tn=Dae(Fn,(l=bn==null?void 0:bn.rect)!=null?l:null,Ne),vr=m.useRef(null),_n=m.useCallback((Sn,pn)=>{let{sensor:Gn,options:xr}=pn;if(H.current==null)return;const er=M.get(H.current);if(!er)return;const Vn=Sn.nativeEvent,Ar=new Gn({active:H.current,activeNode:er,event:Vn,options:xr,context:Qe,onAbort(V){if(!M.get(V))return;const{onDragAbort:se}=ie.current,ge={id:V};se==null||se(ge),j({type:"onDragAbort",event:ge})},onPending(V,X,se,ge){if(!M.get(V))return;const{onDragPending:ze}=ie.current,Le={id:V,constraint:X,initialCoordinates:se,offset:ge};ze==null||ze(Le),j({type:"onDragPending",event:Le})},onStart(V){const X=H.current;if(X==null)return;const se=M.get(X);if(!se)return;const{onDragStart:ge}=ie.current,Re={activatorEvent:Vn,active:{id:X,data:se.data,rect:Z}};ys.unstable_batchedUpdates(()=>{ge==null||ge(Re),A(Ai.Initializing),R({type:or.DragStart,initialCoordinates:V,active:X}),j({type:"onDragStart",event:Re}),k(vr.current),B(Vn)})},onMove(V){R({type:or.DragMove,coordinates:V})},onEnd:Xr(or.DragEnd),onCancel:Xr(or.DragCancel)});vr.current=Ar;function Xr(V){return async function(){const{active:se,collisions:ge,over:Re,scrollAdjustedTranslate:ze}=Qe.current;let Le=null;if(se&&ze){const{cancelDrop:Ie}=ie.current;Le={activatorEvent:Vn,active:se,collisions:ge,delta:ze,over:Re},V===or.DragEnd&&typeof Ie=="function"&&await Promise.resolve(Ie(Le))&&(V=or.DragCancel)}H.current=null,ys.unstable_batchedUpdates(()=>{R({type:V}),A(Ai.Uninitialized),ei(null),k(null),B(null),vr.current=null;const Ie=V===or.DragEnd?"onDragEnd":"onDragCancel";if(Le){const Pe=ie.current[Ie];Pe==null||Pe(Le),j({type:Ie,event:Le})}})}}},[M]),ul=m.useCallback((Sn,pn)=>(Gn,xr)=>{const er=Gn.nativeEvent,Vn=M.get(xr);if(H.current!==null||!Vn||er.dndKit||er.defaultPrevented)return;const Ar={active:Vn};Sn(Gn,pn.options,Ar)===!0&&(er.dndKit={capturedBy:pn.sensor},H.current=xr,_n(Gn,pn))},[M,_n]),Ns=ase(g,ul);fse(g),Ws(()=>{Ne&&D===Ai.Initializing&&A(Ai.Initialized)},[Ne,D]),m.useEffect(()=>{const{onDragMove:Sn}=ie.current,{active:pn,activatorEvent:Gn,collisions:xr,over:er}=Qe.current;if(!pn||!Gn)return;const Vn={active:pn,activatorEvent:Gn,collisions:xr,delta:{x:ot.x,y:ot.y},over:er};ys.unstable_batchedUpdates(()=>{Sn==null||Sn(Vn),j({type:"onDragMove",event:Vn})})},[ot.x,ot.y]),m.useEffect(()=>{const{active:Sn,activatorEvent:pn,collisions:Gn,droppableContainers:xr,scrollAdjustedTranslate:er}=Qe.current;if(!Sn||H.current==null||!pn||!er)return;const{onDragOver:Vn}=ie.current,Ar=xr.get(Ua),Xr=Ar&&Ar.rect.current?{id:Ar.id,rect:Ar.rect.current,data:Ar.data,disabled:Ar.disabled}:null,V={active:Sn,activatorEvent:pn,collisions:Gn,delta:{x:er.x,y:er.y},over:Xr};ys.unstable_batchedUpdates(()=>{ei(Xr),Vn==null||Vn(V),j({type:"onDragOver",event:V})})},[Ua]),Ws(()=>{Qe.current={activatorEvent:z,active:J,activeNode:ve,collisionRect:it,collisions:xn,droppableRects:q,draggableNodes:M,draggingNode:Zt,draggingNodeRect:jn,droppableContainers:G,over:bn,scrollableAncestors:U,scrollAdjustedTranslate:ot},Z.current={initial:jn,translated:it}},[J,ve,xn,it,M,Zt,jn,q,G,bn,U,ot]),ese({...Ae,delta:F,draggingRect:it,pointerCoordinates:_e,scrollableAncestors:U,scrollableAncestorRects:Q});const ti=m.useMemo(()=>({active:J,activeNode:ve,activeNodeRect:Ne,activatorEvent:z,collisions:xn,containerNodeRect:Be,dragOverlay:Dt,draggableNodes:M,droppableContainers:G,droppableRects:q,over:bn,measureDroppableContainers:te,scrollableAncestors:U,scrollableAncestorRects:Q,measuringConfiguration:P,measuringScheduled:ue,windowRect:Ve}),[J,ve,Ne,z,xn,Be,Dt,M,G,q,bn,te,U,Q,P,ue,Ve]),to=m.useMemo(()=>({activatorEvent:z,activators:Ns,active:J,activeNodeRect:Ne,ariaDescribedById:{draggable:xe},dispatch:R,draggableNodes:M,over:bn,measureDroppableContainers:te}),[z,Ns,J,Ne,R,xe,M,bn,te]);return ye.createElement(T5.Provider,{value:_},ye.createElement(ry.Provider,{value:to},ye.createElement(H5.Provider,{value:ti},ye.createElement($5.Provider,{value:Tn},h)),ye.createElement(Ese,{disabled:(d==null?void 0:d.restoreFocus)===!1})),ye.createElement(wae,{...d,hiddenTextDescribedById:xe}));function As(){const Sn=(K==null?void 0:K.autoScrollEnabled)===!1,pn=typeof f=="object"?f.enabled===!1:f===!1,Gn=O&&!Sn&&!pn;return typeof f=="object"?{...f,enabled:Gn}:{enabled:Gn}}}),Tse=m.createContext(null),MT="button",_se="Draggable";function Nse(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const l=sh(_se),{activators:c,activatorEvent:d,active:f,activeNodeRect:h,ariaDescribedById:g,draggableNodes:y,over:v}=m.useContext(ry),{role:b=MT,roleDescription:w="draggable",tabIndex:S=0}=o??{},C=(f==null?void 0:f.id)===t,R=m.useContext(C?$5:Tse),[j,_]=Bp(),[D,A]=Bp(),O=hse(c,t),T=Cf(n);Ws(()=>(y.set(t,{id:t,key:l,node:j,activatorNode:D,data:T}),()=>{const F=y.get(t);F&&F.key===l&&y.delete(t)}),[y,t]);const M=m.useMemo(()=>({role:b,tabIndex:S,"aria-disabled":r,"aria-pressed":C&&b===MT?!0:void 0,"aria-roledescription":w,"aria-describedby":g.draggable}),[r,b,S,C,w,g.draggable]);return{active:f,activatorEvent:d,activeNodeRect:h,attributes:M,isDragging:C,listeners:r?void 0:O,node:j,over:v,setNodeRef:_,setActivatorNodeRef:A,transform:R}}function Ase(){return m.useContext(H5)}const Dse="Droppable",Ose={timeout:25};function Mse(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const l=sh(Dse),{active:c,dispatch:d,over:f,measureDroppableContainers:h}=m.useContext(ry),g=m.useRef({disabled:n}),y=m.useRef(!1),v=m.useRef(null),b=m.useRef(null),{disabled:w,updateMeasurementsFor:S,timeout:C}={...Ose,...o},R=Cf(S??r),j=m.useCallback(()=>{if(!y.current){y.current=!0;return}b.current!=null&&clearTimeout(b.current),b.current=setTimeout(()=>{h(Array.isArray(R.current)?R.current:[R.current]),b.current=null},C)},[C]),_=ny({callback:j,disabled:w||!c}),D=m.useCallback((M,F)=>{_&&(F&&(_.unobserve(F),y.current=!1),M&&_.observe(M))},[_]),[A,O]=Bp(D),T=Cf(t);return m.useEffect(()=>{!_||!A.current||(_.disconnect(),y.current=!1,_.observe(A.current))},[A,_]),m.useEffect(()=>(d({type:or.RegisterDroppable,element:{id:r,key:l,disabled:n,node:A,rect:v,data:T}}),()=>d({type:or.UnregisterDroppable,key:l,id:r})),[r]),m.useEffect(()=>{n!==g.current.disabled&&(d({type:or.SetDroppableDisabled,id:r,key:l,disabled:n}),g.current.disabled=n)},[r,l,n,d]),{active:c,rect:v,isOver:(f==null?void 0:f.id)===r,node:A,over:f,setNodeRef:O}}function G5(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Ise(e,t){return e.reduce((n,r,o)=>{const l=t.get(r);return l&&(n[o]=l),n},Array(e.length))}function Hm(e){return e!==null&&e>=0}function kse(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Lse(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const q5=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const l=G5(t,r,n),c=t[o],d=l[o];return!d||!c?null:{x:d.left-c.left,y:d.top-c.top,scaleX:d.width/c.width,scaleY:d.height/c.height}},$m={scaleX:1,scaleY:1},Z5=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:l,overIndex:c}=e;const d=(t=l[n])!=null?t:r;if(!d)return null;if(o===n){const h=l[c];return h?{x:0,y:n<c?h.top+h.height-(d.top+d.height):h.top-d.top,...$m}:null}const f=Pse(l,o,n);return o>n&&o<=c?{x:0,y:-d.height-f,...$m}:o<n&&o>=c?{x:0,y:d.height+f,...$m}:{x:0,y:0,...$m}};function Pse(e,t,n){const r=e[t],o=e[t-1],l=e[t+1];return r?n<t?o?r.top-(o.top+o.height):l?l.top-(r.top+r.height):0:l?l.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const K5="Sortable",Y5=ye.createContext({activeIndex:-1,containerId:K5,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:q5,disabled:{draggable:!1,droppable:!1}});function W5(e){let{children:t,id:n,items:r,strategy:o=q5,disabled:l=!1}=e;const{active:c,dragOverlay:d,droppableRects:f,over:h,measureDroppableContainers:g}=Ase(),y=sh(K5,n),v=d.rect!==null,b=m.useMemo(()=>r.map(O=>typeof O=="object"&&"id"in O?O.id:O),[r]),w=c!=null,S=c?b.indexOf(c.id):-1,C=h?b.indexOf(h.id):-1,R=m.useRef(b),j=!kse(b,R.current),_=C!==-1&&S===-1||j,D=Lse(l);Ws(()=>{j&&w&&g(b)},[j,b,w,g]),m.useEffect(()=>{R.current=b},[b]);const A=m.useMemo(()=>({activeIndex:S,containerId:y,disabled:D,disableTransforms:_,items:b,overIndex:C,useDragOverlay:v,sortedRects:Ise(b,f),strategy:o}),[S,y,D.draggable,D.droppable,_,b,C,f,v,o]);return ye.createElement(Y5.Provider,{value:A},t)}const Use=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return G5(n,r,o).indexOf(t)},Fse=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:l,newIndex:c,previousItems:d,previousContainerId:f,transition:h}=e;return!h||!r||d!==l&&o===c?!1:n?!0:c!==o&&t===f},Vse={duration:200,easing:"ease"},Q5="transform",zse=Ef.Transition.toString({property:Q5,duration:0,easing:"linear"}),Hse={roleDescription:"sortable"};function $se(e){let{disabled:t,index:n,node:r,rect:o}=e;const[l,c]=m.useState(null),d=m.useRef(n);return Ws(()=>{if(!t&&n!==d.current&&r.current){const f=o.current;if(f){const h=qu(r.current,{ignoreTransform:!0}),g={x:f.left-h.left,y:f.top-h.top,scaleX:f.width/h.width,scaleY:f.height/h.height};(g.x||g.y)&&c(g)}}n!==d.current&&(d.current=n)},[t,n,r,o]),m.useEffect(()=>{l&&c(null)},[l]),l}function Bse(e){let{animateLayoutChanges:t=Fse,attributes:n,disabled:r,data:o,getNewIndex:l=Use,id:c,strategy:d,resizeObserverConfig:f,transition:h=Vse}=e;const{items:g,containerId:y,activeIndex:v,disabled:b,disableTransforms:w,sortedRects:S,overIndex:C,useDragOverlay:R,strategy:j}=m.useContext(Y5),_=Gse(r,b),D=g.indexOf(c),A=m.useMemo(()=>({sortable:{containerId:y,index:D,items:g},...o}),[y,o,D,g]),O=m.useMemo(()=>g.slice(g.indexOf(c)),[g,c]),{rect:T,node:M,isOver:F,setNodeRef:G}=Mse({id:c,data:A,disabled:_.droppable,resizeObserverConfig:{updateMeasurementsFor:O,...f}}),{active:Y,activatorEvent:Z,activeNodeRect:J,attributes:H,setNodeRef:K,listeners:k,isDragging:z,over:B,setActivatorNodeRef:ie,transform:xe}=Nse({id:c,data:A,attributes:{...Hse,...n},disabled:_.draggable}),L=dae(G,K),P=!!Y,q=P&&!w&&Hm(v)&&Hm(C),te=!R&&z,ue=te&&q?xe:null,le=q?ue??(d??j)({rects:S,activeNodeRect:J,activeIndex:v,overIndex:C,index:D}):null,Ae=Hm(v)&&Hm(C)?l({id:c,items:g,activeIndex:v,overIndex:C}):D,we=Y==null?void 0:Y.id,Ne=m.useRef({activeId:we,items:g,newIndex:Ae,containerId:y}),Be=g!==Ne.current.items,Qe=t({active:Y,containerId:y,isDragging:z,isSorting:P,id:c,index:D,items:g,newIndex:Ne.current.newIndex,previousItems:Ne.current.items,previousContainerId:Ne.current.containerId,transition:h,wasDragging:Ne.current.activeId!=null}),qt=$se({disabled:!Qe,index:D,node:M,rect:T});return m.useEffect(()=>{P&&Ne.current.newIndex!==Ae&&(Ne.current.newIndex=Ae),y!==Ne.current.containerId&&(Ne.current.containerId=y),g!==Ne.current.items&&(Ne.current.items=g)},[P,Ae,y,g]),m.useEffect(()=>{if(we===Ne.current.activeId)return;if(we&&!Ne.current.activeId){Ne.current.activeId=we;return}const Zt=setTimeout(()=>{Ne.current.activeId=we},50);return()=>clearTimeout(Zt)},[we]),{active:Y,activeIndex:v,attributes:H,data:A,rect:T,index:D,newIndex:Ae,items:g,isOver:F,isSorting:P,isDragging:z,listeners:k,node:M,overIndex:C,over:B,setNodeRef:L,setActivatorNodeRef:ie,setDroppableNodeRef:G,setDraggableNodeRef:K,transform:qt??le,transition:Dt()};function Dt(){if(qt||Be&&Ne.current.newIndex===D)return zse;if(!(te&&!zS(Z)||!h)&&(P||Qe))return Ef.Transition.toString({...h,property:Q5})}}function Gse(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}Gt.Down,Gt.Right,Gt.Up,Gt.Left;function vu({value:e,placeholder:t="",onValueChange:n,minRows:r=1,isBold:o=!1,className:l,saveButtonText:c="Save",cancelButtonText:d="Discard"}){const[f,h]=m.useState(!1),[g,y]=m.useState(e),v=m.useRef(null),b=j=>{y(j.target.value)},w=()=>{n&&g!==e&&n(g.trim()),h(!1)},S=()=>{y(e),h(!1)},C=j=>{j.key==="Enter"&&!j.shiftKey?(r===1||j.ctrlKey)&&(j.preventDefault(),w()):j.key==="Escape"&&(j.preventDefault(),S())},R=j=>{h(j),j?(y(e),setTimeout(()=>{v.current&&v.current.focus()},0)):S()};return s.jsxs(_S,{open:f,onOpenChange:R,children:[s.jsx(NS,{asChild:!0,children:s.jsx("div",{className:ne("cursor-edit w-full min-w-[100px]",!e&&"text-gray-400",o&&"font-medium",l),children:e||t})}),s.jsxs(AS,{className:"w-auto max-w-[600px] min-w-[300px] p-2",align:"start",children:[s.jsx(Ko,{ref:v,value:g,onChange:b,onKeyDown:C,className:"min-h-[24px] resize-y",style:{minHeight:String(Math.max(r*24,24))+"px"},rows:r}),s.jsxs("div",{className:"mt-3 flex justify-end gap-2",children:[s.jsx(Se,{variant:"outline",size:"sm",onClick:S,className:"h-7 cursor-pointer px-2 text-xs",children:d}),s.jsx(Se,{size:"sm",onClick:w,className:"h-7 cursor-pointer px-2 text-xs",children:c})]})]})]})}function qse({isAllExpanded:e,onToggle:t}){return s.jsx(Se,{variant:"ghost",size:"icon",className:"h-5 w-5 cursor-pointer p-0",onClick:t,title:e?"Collapse all items":"Expand all items",children:e?s.jsx(X7,{className:"h-4 w-4"}):s.jsx(H1,{className:"h-4 w-4"})})}function Zse({isExpanded:e,onToggle:t,ariaLabel:n}){return s.jsx(Se,{variant:"ghost",size:"icon",className:"h-5 w-5 cursor-pointer p-0",onClick:t,"aria-label":n??(e?"Collapse":"Expand"),children:e?s.jsx(ka,{className:"h-4 w-4"}):s.jsx(La,{className:"h-4 w-4"})})}function Kse({className:e="",...t}){return s.jsx("div",{...t,className:`flex cursor-grab items-center justify-center opacity-0 group-hover:opacity-100 active:cursor-grabbing ${e}`,children:s.jsx(Tk,{className:"h-4 w-4 text-gray-400"})})}function X5({id:e,children:t}){const{attributes:n,listeners:r,setNodeRef:o,transform:l,transition:c,isDragging:d}=Bse({id:e}),f={transform:Ef.Transform.toString(l),transition:c,opacity:d?.75:1},h=m.Children.toArray(t),g=[s.jsx(Zr,{className:"bg-background dark:bg-muted",style:{width:20,position:"sticky",left:0,zIndex:2,paddingTop:8,paddingBottom:8,paddingLeft:4,paddingRight:0},children:s.jsx(Kse,{...n,...r})},"drag-handle-cell"),...h.slice(1)];return s.jsx(Pn,{ref:o,style:f,className:"group",children:g})}function J5({row:e,onDeleteRow:t,onAddNestedField:n,isRecordType:r}){const[o,l]=m.useState(!1),c=()=>{t&&t(e.index),l(!1)},d=r&&n&&r(e.index),f=!!t,h=d&&f;return s.jsxs("div",{className:"px-3 text-right",children:[s.jsxs(ur,{children:[s.jsx(dr,{asChild:!0,children:s.jsx(Se,{variant:"ghost",className:"dm-card-table-body-row-actionbtn opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100","aria-label":"Row actions",children:s.jsx(pa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),s.jsxs(fr,{align:"end",children:[d&&s.jsxs(pt,{className:"cursor-pointer",onClick:()=>{n(e.index)},children:[s.jsx(Pa,{className:"mr-2 h-4 w-4"}),"Add nested field"]}),h&&s.jsx(ma,{}),f&&s.jsxs(pt,{onClick:()=>{l(!0)},children:[s.jsx(Xs,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),s.jsx("span",{className:"text-red-600",children:"Delete field"})]})]})]}),s.jsx(Tr,{open:o,onOpenChange:l,title:"Delete field",description:"Are you sure you want to delete this field?",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:c,variant:"destructive"})]})}function Yse({mode:e,onModeChange:t}){const n=Object.values(bf),r=o=>{t&&t(o)};return s.jsxs(Kr,{value:e,onValueChange:r,children:[s.jsx(Wr,{className:"h-90 cursor-pointer",size:"sm",children:s.jsx(Yr,{placeholder:"Select field mode"})}),s.jsx(Qr,{className:"max-h-[300px]",children:n.map(o=>s.jsx(Rn,{value:o,children:o},o))})]})}var ay="Checkbox",[Wse]=cr(ay),[Qse,GS]=Wse(ay);function Xse(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:o,disabled:l,form:c,name:d,onCheckedChange:f,required:h,value:g="on",internal_do_not_use_render:y}=e,[v,b]=Gr({prop:n,defaultProp:o??!1,onChange:f,caller:ay}),[w,S]=m.useState(null),[C,R]=m.useState(null),j=m.useRef(!1),_=w?!!c||!!w.closest("form"):!0,D={checked:v,disabled:l,setChecked:b,control:w,setControl:S,name:d,form:c,value:g,hasConsumerStoppedPropagationRef:j,required:h,defaultChecked:Hi(o)?!1:o,isFormControl:_,bubbleInput:C,setBubbleInput:R};return s.jsx(Qse,{scope:t,...D,children:Jse(y)?y(D):r})}var e6="CheckboxTrigger",t6=m.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},o)=>{const{control:l,value:c,disabled:d,checked:f,required:h,setControl:g,setChecked:y,hasConsumerStoppedPropagationRef:v,isFormControl:b,bubbleInput:w}=GS(e6,e),S=dt(o,g),C=m.useRef(f);return m.useEffect(()=>{const R=l==null?void 0:l.form;if(R){const j=()=>y(C.current);return R.addEventListener("reset",j),()=>R.removeEventListener("reset",j)}},[l,y]),s.jsx(et.button,{type:"button",role:"checkbox","aria-checked":Hi(f)?"mixed":f,"aria-required":h,"data-state":i6(f),"data-disabled":d?"":void 0,disabled:d,value:c,...r,ref:S,onKeyDown:Te(t,R=>{R.key==="Enter"&&R.preventDefault()}),onClick:Te(n,R=>{y(j=>Hi(j)?!0:!j),w&&b&&(v.current=R.isPropagationStopped(),v.current||R.stopPropagation())})})});t6.displayName=e6;var n6=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:l,required:c,disabled:d,value:f,onCheckedChange:h,form:g,...y}=e;return s.jsx(Xse,{__scopeCheckbox:n,checked:o,defaultChecked:l,disabled:d,required:c,onCheckedChange:h,name:r,form:g,value:f,internal_do_not_use_render:({isFormControl:v})=>s.jsxs(s.Fragment,{children:[s.jsx(t6,{...y,ref:t,__scopeCheckbox:n}),v&&s.jsx(o6,{__scopeCheckbox:n})]})})});n6.displayName=ay;var r6="CheckboxIndicator",a6=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,l=GS(r6,n);return s.jsx(_r,{present:r||Hi(l.checked)||l.checked===!0,children:s.jsx(et.span,{"data-state":i6(l.checked),"data-disabled":l.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});a6.displayName=r6;var s6="CheckboxBubbleInput",o6=m.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:l,defaultChecked:c,required:d,disabled:f,name:h,value:g,form:y,bubbleInput:v,setBubbleInput:b}=GS(s6,e),w=dt(n,b),S=dS(l),C=sb(r);m.useEffect(()=>{const j=v;if(!j)return;const _=window.HTMLInputElement.prototype,A=Object.getOwnPropertyDescriptor(_,"checked").set,O=!o.current;if(S!==l&&A){const T=new Event("click",{bubbles:O});j.indeterminate=Hi(l),A.call(j,Hi(l)?!1:l),j.dispatchEvent(T)}},[v,S,l,o]);const R=m.useRef(Hi(l)?!1:l);return s.jsx(et.input,{type:"checkbox","aria-hidden":!0,defaultChecked:c??R.current,required:d,disabled:f,name:h,value:g,form:y,...t,tabIndex:-1,ref:w,style:{...t.style,...C,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});o6.displayName=s6;function Jse(e){return typeof e=="function"}function Hi(e){return e==="indeterminate"}function i6(e){return Hi(e)?"indeterminate":e?"checked":"unchecked"}function l6({className:e,...t}){return s.jsx(n6,{"data-slot":"checkbox",className:ne("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:s.jsx(a6,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:s.jsx(lr,{className:"size-3.5"})})})}function c6({isPrimaryKey:e,onPrimaryKeyChange:t}){const n=!!e,r=o=>{t&&t(o)};return s.jsx(l6,{className:"cursor-pointer",checked:n,onCheckedChange:r,"aria-label":"Primary Key"})}const IT={[es.CONNECTED]:{icon:ng,color:"text-green-500",label:"Connected",description:"Field is connected to the data source"},[es.CONNECTED_WITH_DEFINITION_MISMATCH]:{icon:ag,color:"text-orange-500",label:"Connected with issues",description:"Field is connected but has definition mismatches"},[es.DISCONNECTED]:{icon:Wk,color:"text-red-500",label:"Disconnected",description:"Field is not connected to the data source"}};function u6({status:e}){if(!e||!(e in IT))return null;const t=IT[e],{icon:n,color:r,label:o,description:l}=t,c=`schema-field-status-tooltip-${e}`;return s.jsx(vs,{children:s.jsxs(bt,{children:[s.jsx(St,{asChild:!0,children:s.jsx(n,{className:ne("h-5 w-5",r),role:"img","aria-label":o,"aria-describedby":c,tabIndex:0})}),s.jsxs(Ct,{id:c,side:"bottom",role:"tooltip",children:[s.jsx("div",{className:"text-xs font-medium",children:o}),s.jsx("div",{className:"mt-1 max-w-xs text-xs break-words whitespace-normal",children:l})]})]})})}function d6({type:e,storageType:t,onTypeChange:n}){const r=t===ke.GOOGLE_BIGQUERY?Object.values($n):Object.values(nS),o=l=>{n&&(ke.GOOGLE_BIGQUERY,n(l))};return s.jsxs(Kr,{value:e,onValueChange:o,children:[s.jsx(Wr,{className:"cursor-pointer",size:"sm",children:s.jsx(Yr,{placeholder:"Select field type"})}),s.jsx(Qr,{className:"max-h-[300px]",children:r.map(l=>s.jsx(Rn,{value:l,children:l},l))})]})}function eoe({table:e}){return s.jsx("div",{className:"px-3 text-right",children:s.jsxs(ur,{children:[s.jsx(dr,{asChild:!0,children:s.jsx(Se,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:s.jsx(pa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),s.jsx(fr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>s.jsx(pt,{className:"capitalize",children:s.jsxs("label",{className:"flex items-center space-x-2",children:[s.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.columnDef.meta?t.columnDef.meta.title??t.id:t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&s.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:s.jsx(lr,{className:"size-3.5 text-white"})})}),s.jsx("span",{children:t.columnDef.meta?t.columnDef.meta.title??t.id:t.id})]})},t.id))})]})})}function toe({id:e,placeholder:t="Search",value:n,onChange:r,debounceTime:o=500,className:l,"aria-label":c}){const[d,f]=m.useState(n),h=m.useRef(!0);m.useEffect(()=>{(n===""||h.current)&&(f(n),h.current=!1)},[n]);const g=m.useCallback(y=>{const v=y.target.value;f(v);const b=setTimeout(()=>{r(v)},o);return()=>{clearTimeout(b)}},[r,o]);return s.jsxs("div",{className:"dm-card-toolbar-search",children:[s.jsx(Jl,{className:"dm-card-toolbar-search-icon","aria-hidden":"true"}),s.jsx(Ht,{id:e,placeholder:t,value:d,onChange:g,className:l??"dm-card-toolbar-search-input","aria-label":c??t})]})}function noe({searchInputId:e,onAddField:t,filterValue:n,onFilterChange:r,statusCounts:o,disabled:l=!1}){return s.jsxs("div",{className:"dm-card-toolbar",children:[s.jsx("div",{className:"dm-card-toolbar-left",children:s.jsx(toe,{id:e,placeholder:"Search fields",value:n,onChange:r,className:"dm-card-toolbar-search-input","aria-label":"Search fields"})}),s.jsxs("div",{className:"dm-card-toolbar-right",children:[o&&s.jsx("div",{className:"mr-3 flex items-center gap-3",children:Object.entries(o).map(([c,d])=>d===0?null:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(u6,{status:c}),s.jsx("span",{className:"text-sm font-medium text-gray-500",children:d})]},c))}),s.jsxs(Se,{variant:"outline",className:"dm-card-table-add-field-btn cursor-pointer",onClick:t,disabled:l,"aria-label":"Add new field",children:[s.jsx(Pa,{className:"h-4 w-4","aria-hidden":"true"}),"Add Field"]})]})]})}const roe={dragHandle:{left:0,zIndex:1},status:{left:20,zIndex:1},name:{left:56,zIndex:1},actions:{right:0,zIndex:1}};function kT(e,t={}){const n=roe[e];return n?{...t,position:"sticky",zIndex:n.zIndex,...n.left!==void 0&&{left:n.left},...n.right!==void 0&&{right:n.right}}:t}function aoe({fields:e,columns:t,onAddRow:n,fieldsForStatusCount:r,onSearchChange:o,dragContext:l,dragContextProps:c,rowComponent:d=Pn,getRowId:f}){const{isSchemaActualizationLoading:h}=Ia(),g=t,y=l,v=d,{columnVisibility:b,setColumnVisibility:w}=oae(g),S=oc({data:e,columns:g,getCoreRowModel:sc(),getFilteredRowModel:Qf(),columnResizeMode:"onChange",enableColumnResizing:!0,state:{columnVisibility:b},onColumnVisibilityChange:w,enableGlobalFilter:!0,globalFilterFn:iae,defaultColumn:{enableResizing:!0,size:0,minSize:0}}),{value:C,onChange:R,searchValue:j}=lae(S),_=m.useRef("");m.useEffect(()=>{o&&j!==_.current&&(_.current=j,o(j))},[j,o]);const D=m.useMemo(()=>{const T={[es.CONNECTED]:0,[es.CONNECTED_WITH_DEFINITION_MISMATCH]:0,[es.DISCONNECTED]:0};return(r??e).forEach(F=>{F.status in T&&T[F.status]++}),T},[e,r]);return s.jsxs("div",{className:"space-y-4",children:[n&&s.jsx(noe,{table:S,searchInputId:"schema-fields-search-input",onAddField:n,filterValue:C,onFilterChange:R,statusCounts:D,disabled:h}),s.jsx("div",{className:"dm-card-table-wrap mb-0",children:s.jsxs(ic,{id:"schema-fields-table",className:"w-full table-auto",role:"table",children:[s.jsx(lc,{className:"dm-card-table-header",children:S.getHeaderGroups().map(T=>s.jsx(Pn,{className:"dm-card-table-header-row",children:T.headers.map(M=>s.jsx(uc,{className:"bg-secondary dark:bg-background",style:kT(M.column.id,{width:M.getSize()!==0?M.getSize():void 0,whiteSpace:"nowrap",cursor:"default"}),children:M.isPlaceholder?null:typeof M.column.columnDef.header=="function"?M.column.columnDef.header(M.getContext()):M.column.columnDef.header},M.id))},T.id))}),s.jsx(cc,{className:"dm-card-table-body",children:S.getRowModel().rows.length?s.jsx(y,{...c,children:S.getRowModel().rows.map(T=>s.jsx(v,{id:f?f(T):T.index,row:T,children:T.getVisibleCells().map(M=>s.jsx(Zr,{className:"bg-background dark:bg-muted",style:kT(M.column.id,{width:M.column.getSize()!==0?M.column.getSize():void 0,whiteSpace:"pre",paddingTop:8,paddingBottom:8}),children:M.column.columnDef.cell&&typeof M.column.columnDef.cell=="function"?M.column.columnDef.cell(M.getContext()):null},M.id))},T.id))}):s.jsx(Pn,{children:s.jsx(Zr,{colSpan:g.length,className:"text-center text-gray-400",style:{whiteSpace:"nowrap"},children:"Output schema has no configured fields"})})})]})}),n&&s.jsxs(Se,{variant:"outline",className:"dm-card-table-add-field-btn bg-background dark:bg-muted w-full cursor-pointer rounded-t-none border-0",onClick:n,disabled:h,"aria-label":"Add new field",children:[s.jsx(Pa,{className:"h-4 w-4","aria-hidden":"true"}),"Add Field"]})]})}function f6({fields:e,onFieldsChange:t,onAddRow:n,createNewField:r,renderTypeCell:o,additionalColumns:l=[],fieldsForStatusCount:c,onSearchChange:d,nameColumnHeader:f,nameColumnCell:h,primaryKeyColumnCell:g,aliasColumnCell:y,descriptionColumnCell:v,actionsColumnCell:b,dragContext:w,dragContextProps:S,rowComponent:C,getRowId:R}){const j=m.useCallback((T,M)=>{if(t){const F=[...e];F[T]={...F[T],...M},t(F)}},[e,t]),_=m.useCallback(()=>{if(t){const T=r();t([...e,T])}},[e,t,r]),D=m.useCallback(T=>{if(t){const M=[...e];M.splice(T,1),t(M)}},[e,t]),A=m.useMemo(()=>[{id:"dragHandle",header:"",size:24,enableHiding:!1},{accessorKey:"status",header:"",size:36,cell:({row:T})=>s.jsx(u6,{status:T.getValue("status")}),enableHiding:!1},{accessorKey:"name",header:f??(()=>s.jsxs(bt,{children:[s.jsx(St,{className:"cursor-default",children:"Name"}),s.jsx(Ct,{children:"Field name in the output schema"})]})),size:80,cell:({row:T})=>h?h({row:T,updateField:j}):s.jsx(vu,{value:rae(T.getValue("name")),onValueChange:M=>{j(T.index,{name:M})},placeholder:"Field name is required",isBold:!0}),enableHiding:!1},{accessorKey:"isPrimaryKey",header:()=>s.jsxs(bt,{children:[s.jsx(St,{className:"cursor-default",children:"PK"}),s.jsx(Ct,{children:"Is field must be considered as a part of the output Primary Key"})]}),size:36,cell:({row:T})=>g?g({row:T,updateField:j}):s.jsx(c6,{isPrimaryKey:T.getValue("isPrimaryKey"),onPrimaryKeyChange:M=>{j(T.index,{isPrimaryKey:M})}}),enableHiding:!1},{accessorKey:"alias",header:()=>s.jsxs(bt,{children:[s.jsx(St,{className:"cursor-default",children:"Alias"}),s.jsx(Ct,{children:"Alternative name for the field"})]}),size:80,cell:({row:T})=>y?y({row:T,updateField:j}):s.jsx(vu,{value:T.getValue("alias"),onValueChange:M=>{j(T.index,{alias:M})},placeholder:"-"})},{accessorKey:"description",header:()=>s.jsxs(bt,{children:[s.jsx(St,{className:"cursor-default",children:"Description"}),s.jsx(Ct,{children:"Detailed information about the field"})]}),cell:({row:T})=>v?v({row:T,updateField:j}):s.jsx(vu,{value:T.getValue("description"),onValueChange:M=>{j(T.index,{description:M})},minRows:5,placeholder:"-"})},{id:"actions",header:({table:T})=>s.jsx(eoe,{table:T}),cell:({row:T,table:M})=>b?b({row:T,table:M}):s.jsx(J5,{row:T,onDeleteRow:t?D:void 0}),size:40,enableResizing:!1,enableHiding:!1}],[j,D,t,f,h,g,y,v,b]),O=m.useMemo(()=>{const M={accessorKey:"type",header:()=>s.jsxs(bt,{children:[s.jsx(St,{className:"cursor-default pl-[12px]",children:"Type"}),s.jsx(Ct,{children:"Data type of the field"})]}),size:80,cell:G=>o({row:G.row,updateField:j}),enableHiding:!1},F=[...A];if(F.splice(3,0,M),l.length>0){const G=[...l];G.sort((Y,Z)=>{const J=Y.columnIndex??1/0,H=Z.columnIndex??1/0;return J-H}),G.forEach(Y=>{if(Y.columnIndex!==void 0){const Z=Math.min(Math.max(0,Y.columnIndex),F.length);F.splice(Z,0,Y)}else F.splice(F.length-1,0,Y)})}return F},[A,o,j,l]);return s.jsx(aoe,{fields:e,columns:O,onFieldsChange:t,onAddRow:n??(t?_:void 0),fieldsForStatusCount:c,onSearchChange:d,dragContext:w,dragContextProps:S,rowComponent:C,getRowId:R})}function soe({fields:e,onFieldsChange:t}){const{expandedRecords:n,hasRecordFields:r,toggleRecordExpansion:o,toggleAllRecords:l,flattenedFields:c,handleSearchChange:d,isRecordType:f,topLevelFields:h,allExpanded:g}=cae(e),{updateField:y,handleDeleteRow:v,handleAddNestedField:b,handleAddRow:w}=uae(e,c,t,Y=>Y),S=m.useCallback(()=>({name:"",type:$n.STRING,mode:bf.NULLABLE,isPrimaryKey:!1,status:es.DISCONNECTED}),[]),C=m.useCallback(({row:Y})=>s.jsx(d6,{type:Y.getValue("type"),storageType:ke.GOOGLE_BIGQUERY,onTypeChange:Z=>{y(Y.index,{type:Z})}}),[y]),R=m.useMemo(()=>[{accessorKey:"mode",header:()=>s.jsxs(bt,{children:[s.jsx(St,{className:"cursor-default pl-[12px]",children:"Mode"}),s.jsx(Ct,{style:{whiteSpace:"pre"},children:`BigQuery Field mode:
711
+ NULLABLE - field can be NULL
712
+ REQUIRED - field cant be NULL
713
+ REPEATED - field is an Array of Type`})]}),size:80,cell:({row:Y})=>s.jsx(Yse,{mode:Y.getValue("mode"),onModeChange:Z=>{y(Y.index,{mode:Z})}}),columnIndex:4}],[y]),j=m.useCallback(()=>s.jsxs("div",{className:"flex items-center",children:[r&&s.jsx(qse,{isAllExpanded:g,onToggle:l}),s.jsxs(bt,{children:[s.jsx(St,{className:"cursor-default",children:"Name"}),s.jsx(Ct,{children:"Field name in the output schema"})]})]}),[r,g,l]),_=m.useCallback(({row:Y})=>{const Z=c[Y.index],H=(Z.type===$n.RECORD||Z.type===$n.STRUCT)&&Z.fields&&Z.fields.length>0,K=Z.path??"",k=Z.level??0,z=n.has(K);return s.jsxs("div",{className:"flex items-center",children:[k>0&&s.jsx("div",{style:{width:`${String(k*16-(H?4:0))}px`},className:"flex-shrink-0"}),H?s.jsx(Zse,{isExpanded:z,onToggle:()=>{o(K)},ariaLabel:z?"Collapse nested fields":"Expand nested fields"}):r&&s.jsx("div",{className:"w-5"}),s.jsx(vu,{value:Y.getValue("name"),onValueChange:B=>{y(Y.index,{name:B})},placeholder:"Field name is required",isBold:!0})]})},[c,n,r,o,y]),D=m.useCallback(({row:Y})=>{const Z=c[Y.index],J=Z.type===$n.RECORD||Z.type===$n.STRUCT;return(Z.level??0)===0&&!J?s.jsx(c6,{isPrimaryKey:Y.getValue("isPrimaryKey"),onPrimaryKeyChange:K=>{y(Y.index,{isPrimaryKey:K})}}):s.jsx("div",{})},[c,y]),A=m.useCallback(({row:Y})=>s.jsx(vu,{value:Y.getValue("description"),onValueChange:Z=>{y(Y.index,{description:Z})},minRows:5,placeholder:"-"}),[y]),O=m.useCallback(({row:Y})=>s.jsx(vu,{value:Y.getValue("alias"),onValueChange:Z=>{y(Y.index,{alias:Z})},placeholder:"-"}),[y]),T=m.useCallback(({row:Y})=>s.jsx(J5,{row:Y,onDeleteRow:t?v:void 0,onAddNestedField:t?b:void 0,isRecordType:f}),[t,v,b,f]),{handleDragEnd:M}=w5(e,t,c),F=m.useCallback(Y=>{const Z=c[Y.index];return Z.path??String(c.indexOf(Z))},[c]),G=N5(_5(ty,{activationConstraint:{distance:5}}));return s.jsx(B5,{sensors:G,collisionDetection:A5,onDragEnd:M,children:s.jsx(f6,{fields:c,onFieldsChange:t,onAddRow:w,createNewField:S,renderTypeCell:C,additionalColumns:R,fieldsForStatusCount:h,onSearchChange:d,nameColumnHeader:j,nameColumnCell:_,primaryKeyColumnCell:D,aliasColumnCell:O,descriptionColumnCell:A,actionsColumnCell:T,dragContext:W5,dragContextProps:{items:c.map(Y=>Y.path??String(c.indexOf(Y))),strategy:Z5},rowComponent:X5,getRowId:F})})}function ooe({fields:e,onFieldsChange:t}){const n=m.useCallback(()=>({name:"",type:nS.STRING,isPrimaryKey:!1,status:es.DISCONNECTED}),[]),r=m.useCallback(({row:c,updateField:d})=>s.jsx(d6,{type:c.getValue("type"),storageType:ke.AWS_ATHENA,onTypeChange:f=>{d(c.index,{type:f})}}),[]),{handleDragEnd:o}=w5(e,t),l=N5(_5(ty,{activationConstraint:{distance:5}}));return s.jsx(B5,{sensors:l,collisionDetection:A5,onDragEnd:o,children:s.jsx(f6,{fields:e,onFieldsChange:t,createNewField:n,renderTypeCell:r,dragContext:W5,dragContextProps:{items:e.map((c,d)=>d),strategy:Z5},rowComponent:X5})})}function ioe({schema:e,storageType:t,onFieldsChange:n}){const r=m.useMemo(()=>{if(!e){const o=nae(t);return n(o.fields),o}return e},[e,t,n]);return b5(r)?s.jsx(soe,{fields:r.fields,onFieldsChange:n}):S5(r)?s.jsx(ooe,{fields:r.fields,onFieldsChange:n}):s.jsx("div",{className:"p-4 text-center",children:s.jsx("p",{children:"Unsupported schema type"})})}function loe({definitionType:e}){const{dataMart:t,updateDataMartSchema:n,isLoading:r,error:o,runSchemaActualization:l,isSchemaActualizationLoading:c}=Ia(),{id:d="",schema:f}=t??{},{schema:h,isDirty:g,updateSchema:y,resetSchema:v}=aae(f),{operationStatus:b,startSaveOperation:w}=sae(r,o);m.useEffect(()=>{b==="success"&&v()},[b,v]);const S=m.useCallback(D=>{y(D)},[y]),C=m.useCallback(()=>{d&&h&&(w(),n(d,h).then(()=>{l==null||l()}))},[d,h,w,n,l]),R=m.useCallback(()=>{l==null||l()},[l]),j=m.useCallback(()=>{v()},[v]),_=r||c;return t?s.jsxs("div",{className:"space-y-4",children:[s.jsx(ioe,{schema:h,storageType:t.storage.type,onFieldsChange:S}),s.jsxs("div",{className:"align-items-center mt-8 flex justify-between",children:[s.jsxs("div",{className:"flex space-x-4",children:[s.jsx(Se,{variant:"default",onClick:C,disabled:!g||_,children:"Save"}),s.jsx(Se,{type:"button",variant:"ghost",onClick:j,disabled:!g||_,children:"Discard"})]}),s.jsx(Se,{type:"button",variant:"outline",onClick:R,disabled:!e||_,children:"Refresh schema"})]})]}):s.jsx("div",{children:"Error: Data mart not found"})}function coe(){const e=m_(),{id:t,projectId:n}=e;return t?n?s.jsx("div",{className:"dm-page",children:s.jsx(H3,{children:s.jsx(tee,{id:t})})}):s.jsx("div",{className:"dm-page-header",children:"Project ID is required"}):s.jsx("div",{className:"dm-page-header",children:"Data Mart ID is required"})}function uoe({className:e,...t}){return s.jsx("div",{"data-slot":"card",className:ne("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function doe({className:e,...t}){return s.jsx("div",{"data-slot":"card-header",className:ne("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function foe({className:e,...t}){return s.jsx("div",{"data-slot":"card-title",className:ne("leading-none font-semibold",e),...t})}function hoe({className:e,...t}){return s.jsx("div",{"data-slot":"card-description",className:ne("text-muted-foreground text-sm",e),...t})}function moe({className:e,...t}){return s.jsx("div",{"data-slot":"card-content",className:ne("px-6",e),...t})}function poe({className:e,...t}){return s.jsx("div",{"data-slot":"card-footer",className:ne("flex items-center px-6 [.border-t]:pt-6",e),...t})}const qS=m.createContext({isCollapsed:!1,collapsible:!1,handleCollapse:()=>{throw new Error("CollapsibleCardContext: handleCollapse not implemented")}});function Lo({icon:e,tooltip:t,subtitle:n,children:r}){const{isCollapsed:o}=m.useContext(qS);return s.jsxs("div",{className:"flex items-center gap-2 self-center",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"text-foreground flex h-7 w-7 items-center justify-center rounded-sm bg-gray-200/50 transition-colors duration-200 group-hover:bg-gray-200/75 dark:bg-white/8 dark:group-hover:bg-white/10",children:s.jsx(e,{size:18})}),s.jsx(foe,{className:"text-md text-foreground leading-none font-medium",children:r})]}),n&&s.jsx(hoe,{className:ne("text-md text-muted-foreground/50",!o&&"hidden"),children:n}),t&&s.jsx(vs,{children:s.jsxs(bt,{children:[s.jsx(St,{asChild:!0,children:s.jsxs("div",{className:"pointer-events-none ml-2 flex items-center opacity-0 transition-opacity duration-200 group-hover:pointer-events-auto group-hover:opacity-100",children:[s.jsx(Br,{className:"text-muted-foreground/50 hover:text-muted-foreground size-4 shrink-0 transition-colors"}),s.jsx("span",{className:"sr-only",children:t})]})}),s.jsx(Ct,{children:s.jsx("p",{children:t})})]})})]})}Lo.displayName="CollapsibleCardHeaderTitle";function oh({children:e,className:t}){const n=r=>{r.stopPropagation()};return s.jsx("div",{className:ne("flex items-center gap-2 self-center",t),onClick:n,children:e})}oh.displayName="CollapsibleCardHeaderActions";function Po({children:e}){const{collapsible:t,isCollapsed:n,handleCollapse:r}=m.useContext(qS);let o,l;return m.Children.forEach(e,c=>{if(m.isValidElement(c))switch(c.type){case Lo:o=c;break;case oh:l=c;break}}),s.jsxs(doe,{className:ne("group flex items-start justify-between gap-4 px-4 py-4",t&&"cursor-pointer"),onClick:t?r:void 0,children:[o,s.jsxs("div",{className:"flex items-center gap-2",children:[l,t&&s.jsx("div",{className:ne("flex h-7 w-7 items-center justify-center rounded-full transition-colors duration-200 hover:bg-gray-200/50 dark:hover:bg-white/4"),children:s.jsx("div",{className:ne("transform transition-transform duration-200",n?"rotate-0":"rotate-180"),children:s.jsx(ka,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})})]})]})}Po.displayName="CollapsibleCardHeader";function Uo({children:e}){return s.jsx(moe,{className:"px-4 pt-1",children:e})}Uo.displayName="CollapsibleCardContent";function $i({left:e,right:t}){return s.jsxs(poe,{className:"flex items-center gap-2 px-4 py-4",children:[s.jsx("div",{className:"flex flex-grow items-center gap-2",children:e}),t&&s.jsx("div",{className:"flex items-center",children:t})]})}$i.displayName="CollapsibleCardFooter";const LT="collapsed-card-";function Vl({children:e,className:t,variant:n="default",collapsible:r=!1,defaultCollapsed:o=!1,onCollapsedChange:l,name:c}){const d=c?Hs.get(`${LT}${c}`,"boolean")??o:o,[f,h]=m.useState(d);m.useEffect(()=>{c&&Hs.set(`${LT}${c}`,f)},[f,c]);const g=()=>{const S=!f;h(S),l==null||l(S)};let y,v,b;m.Children.forEach(e,S=>{if(m.isValidElement(S))switch(S.type){case Po:y=S;break;case Uo:v=S;break;case $i:b=S;break}});const w={default:"rounded-md p-0 gap-0 bg-muted/50 dark:bg-white/4 border-0 border-b border-gray-200 dark:border-white/8 shadow-none",dense:"rounded-md p-0 gap-0 bg-muted/50 dark:bg-white/4 border-0 border-b border-gray-200 dark:border-white/8 shadow-none text-sm",flat:"rounded-md p-0 gap-0 border-0 border-b-0 shadow-none"};return s.jsx(qS.Provider,{value:{isCollapsed:f,collapsible:r,handleCollapse:g},children:s.jsxs(uoe,{className:ne(w[n],t),children:[y,s.jsx("div",{className:ne("grid transition-all duration-200",f?"grid-rows-[0fr]":"grid-rows-[1fr]"),children:s.jsxs("div",{className:"overflow-hidden",children:[v,b]})})]})})}function goe(){const{dataMart:e,updateDataMartStorage:t}=Qo(),n=(e==null?void 0:e.definitionType)??null,[r,o]=m.useState(n);return s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs(Vl,{collapsible:!0,name:"data-storage",children:[s.jsx(Po,{children:s.jsx(Lo,{icon:zl,tooltip:"Configure where your data will be stored",children:"Storage"})}),s.jsx(Uo,{children:(e==null?void 0:e.storage)&&s.jsx(pne,{dataStorage:e.storage,onDataStorageChange:t})}),s.jsx($i,{})]}),s.jsxs(Vl,{collapsible:!0,name:"input-source",children:[s.jsx(Po,{children:s.jsx(Lo,{icon:$1,tooltip:"Configure how to extract data from your data warehouse",children:"Input Source"})}),s.jsx(Uo,{children:e&&s.jsx(tae,{definitionType:r,initialDefinitionType:n,setDefinitionType:o})}),s.jsx($i,{})]}),s.jsxs(Vl,{collapsible:!0,name:"output-schema",children:[s.jsx(Po,{children:s.jsx(Lo,{icon:ik,tooltip:"Configure your data mart output schema",children:"Output Schema"})}),s.jsx(Uo,{children:e&&s.jsx(loe,{definitionType:r})}),s.jsx($i,{})]})]})}function yoe({row:e,onDeleteSuccess:t,onEditReport:n}){const[r,o]=m.useState(!1),[l,c]=m.useState(!1),[d,f]=m.useState(!1),{deleteReport:h,fetchReportsByDataMartId:g,runReport:y}=Ts(),v=`actions-menu-${e.original.id}`,b=m.useCallback(async()=>{try{await h(e.original.id),await g(e.original.dataMart.id),t==null||t(),f(!1)}catch(R){console.error("Failed to delete Google Sheet:",R)}},[h,g,t,e.original.id,e.original.dataMart.id]),w=m.useCallback(()=>{n==null||n(e.original),c(!1)},[n,e.original]),S=m.useCallback(async()=>{try{o(!0),await y(e.original.id)}catch(R){console.error("Failed to run report:",R)}finally{o(!1)}},[y,e.original.id]),C=m.useCallback(()=>{f(!0),c(!1)},[]);return s.jsxs("div",{className:"text-right",onClick:R=>{R.stopPropagation()},children:[s.jsxs(ur,{open:l,onOpenChange:c,children:[s.jsx(dr,{asChild:!0,children:s.jsxs(Se,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${l?"opacity-100":"group-hover:opacity-100"}`,"aria-label":`Actions for report: ${e.original.title}`,"aria-haspopup":"true","aria-expanded":l,"aria-controls":v,children:[s.jsx("span",{className:"sr-only",children:"Open menu"}),s.jsx(pa,{className:"dm-card-table-body-row-actionbtn-icon","aria-hidden":"true"})]})}),s.jsxs(fr,{id:v,align:"end",role:"menu",children:[s.jsxs(pt,{onClick:R=>{R.stopPropagation(),w()},role:"menuitem",children:[s.jsx(Au,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Edit report"]}),Lg(e.original.destinationConfig)&&s.jsxs(s.Fragment,{children:[s.jsx(ma,{}),s.jsxs(pt,{onClick:R=>{R.stopPropagation(),S()},disabled:r,role:"menuitem","aria-label":r?"Running report...":`Run report: ${e.original.title}`,children:[s.jsx(rg,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),r?"Running...":"Run report"]}),s.jsx(pt,{asChild:!0,children:s.jsxs("a",{href:Mb(e.original.destinationConfig.spreadsheetId,e.original.destinationConfig.sheetId),target:"_blank",rel:"noopener noreferrer",role:"menuitem",onClick:R=>{R.stopPropagation()},children:[s.jsx(Ck,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Open document"]})})]}),s.jsx(ma,{}),s.jsxs(pt,{onClick:R=>{R.stopPropagation(),C()},role:"menuitem","aria-label":`Delete report: ${e.original.title}`,children:[s.jsx(Xs,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),s.jsx("span",{className:"text-red-600",children:"Delete report"})]})]})]}),s.jsx(Tr,{open:d,onOpenChange:f,title:"Delete Report",description:`Are you sure you want to delete "${e.original.title}"? This action cannot be undone.`,confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{b()},variant:"destructive"})]})}const voe={[fn.SUCCESS]:{icon:ng,color:"text-green-500",label:"Success"},[fn.ERROR]:{icon:dp,color:"text-red-500",label:"Fail"},[fn.RUNNING]:{icon:Af,color:"text-primary animate-spin",label:"In progress"},[fn.CANCELLED]:{icon:dp,color:"text-gray-500",label:"Cancelled"}};function h6({status:e,error:t}){if(!e)return null;const n=voe[e],{icon:r,color:o,label:l}=n,c=`status-tooltip-${e}-${t?"error":"normal"}`,d=()=>e===fn.ERROR&&t?`${l}: ${t}`:l;return s.jsx(vs,{children:s.jsxs(bt,{children:[s.jsx(St,{asChild:!0,children:s.jsx(r,{className:ne("h-5 w-5",o),role:"img","aria-label":d(),"aria-describedby":c,tabIndex:0})}),s.jsxs(Ct,{id:c,side:"bottom",role:"tooltip",children:[s.jsx("div",{className:"text-xs",children:l}),e===fn.ERROR&&t&&s.jsx("div",{className:"mt-1 max-w-xs text-xs break-words whitespace-normal",children:t})]})]})})}function h0({column:e,children:t,label:n}){const r=e.getIsSorted(),o=m.useCallback(()=>{e.toggleSorting(e.getIsSorted()==="asc")},[e]),l=()=>r==="asc"?"sorted ascending":r==="desc"?"sorted descending":"not sorted",c=()=>r==="asc"?"ascending":r==="desc"?"descending":"none",d=n??(typeof t=="string"?t:"Column");return s.jsxs(Se,{variant:"ghost",onClick:o,className:"group dm-card-table-header-row-btn","aria-label":`${d} - ${l()}. Click to sort.`,"aria-sort":c(),children:[t,s.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[r==="asc"&&s.jsx(ns,{className:"text-foreground h-4 w-4"}),r==="desc"&&s.jsx(ka,{className:"text-foreground h-4 w-4"}),!r&&s.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:s.jsx(ns,{className:"text-muted-foreground h-4 w-4"})})]})]})}var Fi=(e=>(e.TITLE="title",e.LAST_RUN_DATE="lastRunDate",e.LAST_RUN_STATUS="lastRunStatus",e))(Fi||{});const m6={[Fi.TITLE]:"Title",[Fi.LAST_RUN_DATE]:"Last Run Date",[Fi.LAST_RUN_STATUS]:"Last Run Status"};function xoe({table:e}){return s.jsx("div",{className:"px-4 text-right",children:s.jsxs(ur,{children:[s.jsx(dr,{asChild:!0,children:s.jsx(Se,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:s.jsx(pa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),s.jsx(fr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>{const n=m6[t.id]||t.id;return s.jsx(pt,{className:"capitalize",children:s.jsxs("label",{className:"flex items-center space-x-2",children:[s.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&s.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:s.jsx(lr,{className:"size-3.5 text-white"})})}),s.jsx("span",{children:n})]})},t.id)})})]})})}const PT=e=>{switch(e){case"right":return"text-right";case"center":return"text-center";default:return"text-left"}},boe=({onDeleteSuccess:e,onEditReport:t}={})=>[{accessorKey:Fi.TITLE,header:({column:n})=>s.jsx(h0,{column:n,children:m6[Fi.TITLE]}),cell:({row:n})=>n.original.title,enableColumnFilter:!0,size:50},{accessorKey:Fi.LAST_RUN_DATE,header:({column:n})=>s.jsx(h0,{column:n,children:"Last Run Date"}),cell:({row:n})=>{const r=n.original.lastRunDate;return s.jsx("div",{className:"text-muted-foreground text-sm",children:r?s.jsx(Zi,{date:new Date(r)}):"Never run"})},size:25},{accessorKey:Fi.LAST_RUN_STATUS,header:({column:n})=>s.jsx(h0,{column:n,children:"Last Run Status"}),cell:({row:n})=>n.original.lastRunStatus?s.jsx(h6,{status:n.original.lastRunStatus,error:n.original.lastRunError}):s.jsx("span",{className:"text-muted-foreground text-sm",children:"—"}),size:25},{id:"actions",header:({table:n})=>s.jsx(xoe,{table:n}),cell:({row:n})=>s.jsx(yoe,{row:n,onDeleteSuccess:e,onEditReport:t}),size:80}];function Soe({destination:e,onEditReport:t}){const{reports:n,setPollingConfig:r}=Ts(),o=m.useMemo(()=>n.filter(v=>v.dataDestination.type===je.GOOGLE_SHEETS&&v.dataDestination.id===e.id),[n,e.id]);m.useEffect(()=>{r({initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3})},[r]);const l=m.useMemo(()=>boe({onDeleteSuccess:()=>{},onEditReport:t}),[t]),{sorting:c,setSorting:d,columnVisibility:f,setColumnVisibility:h}=Vu({columns:l,storageKeyPrefix:`data-mart-google-sheets-reports-${e.id}`,defaultSortingColumn:"lastRunDate"}),g=oc({data:o,columns:l,getCoreRowModel:sc(),onSortingChange:d,getSortedRowModel:Fu(),state:{sorting:c,columnVisibility:f},onColumnVisibilityChange:h}),y=`google-sheets-reports-table-${e.id}`;return s.jsx("div",{className:"w-full",children:s.jsx("div",{className:"dm-card-table-wrap",children:s.jsxs(ic,{id:y,className:"dm-card-table",role:"table","aria-label":`${e.title} reports`,children:[s.jsx(lc,{className:"dm-card-table-header",children:g.getHeaderGroups().map(v=>s.jsx(Pn,{className:"dm-card-table-header-row",children:v.headers.map(b=>s.jsx(uc,{className:PT(b.column.columnDef._align),style:b.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(b.column.getSize())}%`},scope:"col",children:b.isPlaceholder?null:typeof b.column.columnDef.header=="function"?b.column.columnDef.header(b.getContext()):b.column.columnDef.header},b.id))},v.id))}),s.jsx(cc,{className:"dm-card-table-body",children:g.getRowModel().rows.length?g.getRowModel().rows.map((v,b)=>s.jsx(Pn,{onClick:()=>{const w=n.find(S=>S.id===v.original.id);w&&t(w)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":b+1,children:v.getVisibleCells().map((w,S)=>s.jsx(Zr,{className:`px-6 whitespace-normal ${PT(w.column.columnDef._align)}`,style:w.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(w.column.getSize())}%`},role:"cell","aria-colindex":S+1,children:typeof w.column.columnDef.cell=="function"?w.column.columnDef.cell(w.getContext()):w.column.columnDef.cell},w.id))},v.id)):s.jsx(Pn,{children:s.jsx(Zr,{colSpan:l.length,className:"dm-card-table-body-row-empty",role:"cell",children:s.jsx("span",{role:"status","aria-live":"polite",children:"No reports for this destination"})})})})]})})})}function Coe({row:e,onDeleteSuccess:t,onEditReport:n}){const[r,o]=m.useState(!1),[l,c]=m.useState(!1),[d,f]=m.useState(!1),{deleteReport:h,fetchReportsByDataMartId:g,runReport:y}=Ts(),v=`actions-menu-${e.original.id}`,b=m.useCallback(async()=>{try{await h(e.original.id),await g(e.original.dataMart.id),t==null||t(),f(!1)}catch(R){console.error("Failed to delete report:",R)}},[h,g,t,e.original.id,e.original.dataMart.id]),w=m.useCallback(()=>{n==null||n(e.original),c(!1)},[n,e.original]),S=m.useCallback(async()=>{try{o(!0),await y(e.original.id)}catch(R){console.error("Failed to run report:",R)}finally{o(!1)}},[y,e.original.id]),C=m.useCallback(()=>{f(!0),c(!1)},[]);return s.jsxs("div",{className:"text-right",onClick:R=>{R.stopPropagation()},children:[s.jsxs(ur,{open:l,onOpenChange:c,children:[s.jsx(dr,{asChild:!0,children:s.jsxs(Se,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${l?"opacity-100":"group-hover:opacity-100"}`,"aria-label":`Actions for report: ${e.original.title}`,"aria-haspopup":"true","aria-expanded":l,"aria-controls":v,children:[s.jsx("span",{className:"sr-only",children:"Open menu"}),s.jsx(pa,{className:"dm-card-table-body-row-actionbtn-icon","aria-hidden":"true"})]})}),s.jsxs(fr,{id:v,align:"end",role:"menu",children:[s.jsxs(pt,{onClick:R=>{R.stopPropagation(),w()},role:"menuitem",children:[s.jsx(Au,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Edit report"]}),s.jsx(ma,{}),s.jsxs(pt,{onClick:R=>{R.stopPropagation(),S()},disabled:r,role:"menuitem","aria-label":r?"Running report...":`Run report: ${e.original.title}`,children:[s.jsx(rg,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),r?"Running...":"Run report"]}),s.jsx(ma,{}),s.jsxs(pt,{onClick:R=>{R.stopPropagation(),C()},role:"menuitem","aria-label":`Delete report: ${e.original.title}`,children:[s.jsx(Xs,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),s.jsx("span",{className:"text-red-600",children:"Delete report"})]})]})]}),s.jsx(Tr,{open:d,onOpenChange:f,title:"Delete Report",description:`Are you sure you want to delete "${e.original.title}"? This action cannot be undone.`,confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{b()},variant:"destructive"})]})}function m0({column:e,children:t,label:n}){const r=e.getIsSorted(),o=m.useCallback(()=>{e.toggleSorting(e.getIsSorted()==="asc")},[e]),l=()=>r==="asc"?"sorted ascending":r==="desc"?"sorted descending":"not sorted",c=()=>r==="asc"?"ascending":r==="desc"?"descending":"none",d=n??(typeof t=="string"?t:"Column");return s.jsxs(Se,{variant:"ghost",onClick:o,className:"group dm-card-table-header-row-btn","aria-label":`${d} - ${l()}. Click to sort.`,"aria-sort":c(),children:[t,s.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[r==="asc"&&s.jsx(ns,{className:"text-foreground h-4 w-4"}),r==="desc"&&s.jsx(ka,{className:"text-foreground h-4 w-4"}),!r&&s.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:s.jsx(ns,{className:"text-muted-foreground h-4 w-4"})})]})]})}var Vi=(e=>(e.TITLE="title",e.LAST_RUN_DATE="lastRunDate",e.LAST_RUN_STATUS="lastRunStatus",e))(Vi||{});const p6={[Vi.TITLE]:"Title",[Vi.LAST_RUN_DATE]:"Last Run Date",[Vi.LAST_RUN_STATUS]:"Last Run Status"};function Eoe({table:e}){return s.jsx("div",{className:"px-4 text-right",children:s.jsxs(ur,{children:[s.jsx(dr,{asChild:!0,children:s.jsx(Se,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:s.jsx(pa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),s.jsx(fr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>{const n=p6[t.id]||t.id;return s.jsx(pt,{className:"capitalize",children:s.jsxs("label",{className:"flex items-center space-x-2",children:[s.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&s.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:s.jsx(lr,{className:"size-3.5 text-white"})})}),s.jsx("span",{children:n})]})},t.id)})})]})})}const UT=e=>{switch(e){case"right":return"text-right";case"center":return"text-center";default:return"text-left"}},woe=({onDeleteSuccess:e,onEditReport:t}={})=>[{accessorKey:Vi.TITLE,header:({column:n})=>s.jsx(m0,{column:n,children:p6[Vi.TITLE]}),cell:({row:n})=>n.original.title,enableColumnFilter:!0,size:50},{accessorKey:Vi.LAST_RUN_DATE,header:({column:n})=>s.jsx(m0,{column:n,children:"Last Run Date"}),cell:({row:n})=>{const r=n.original.lastRunDate;return s.jsx("div",{className:"text-muted-foreground text-sm",children:r?s.jsx(Zi,{date:new Date(r)}):"Never run"})},size:25},{accessorKey:Vi.LAST_RUN_STATUS,header:({column:n})=>s.jsx(m0,{column:n,children:"Last Run Status"}),cell:({row:n})=>n.original.lastRunStatus?s.jsx(h6,{status:n.original.lastRunStatus,error:n.original.lastRunError}):s.jsx("span",{className:"text-muted-foreground text-sm",children:"—"}),size:25},{id:"actions",header:({table:n})=>s.jsx(Eoe,{table:n}),cell:({row:n})=>s.jsx(Coe,{row:n,onDeleteSuccess:e,onEditReport:t}),size:80}];function Roe({destinationType:e,destination:t,onEditReport:n}){const{reports:r,setPollingConfig:o}=Ts(),l=m.useMemo(()=>r.filter(b=>b.dataDestination.type===e&&b.dataDestination.id===t.id),[r,t.id,e]);m.useEffect(()=>{o({initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3})},[o]);const c=m.useMemo(()=>woe({onDeleteSuccess:()=>{},onEditReport:n}),[n]),{sorting:d,setSorting:f,columnVisibility:h,setColumnVisibility:g}=Vu({columns:c,storageKeyPrefix:`data-mart-email-reports-${t.id}`,defaultSortingColumn:"lastRunDate"}),y=oc({data:l,columns:c,getCoreRowModel:sc(),onSortingChange:f,getSortedRowModel:Fu(),state:{sorting:d,columnVisibility:h},onColumnVisibilityChange:g}),v=`email-reports-table-${t.id}`;return s.jsx("div",{className:"w-full",children:s.jsx("div",{className:"dm-card-table-wrap",children:s.jsxs(ic,{id:v,className:"dm-card-table",role:"table","aria-label":`${t.title} reports`,children:[s.jsx(lc,{className:"dm-card-table-header",children:y.getHeaderGroups().map(b=>s.jsx(Pn,{className:"dm-card-table-header-row",children:b.headers.map(w=>s.jsx(uc,{className:UT(w.column.columnDef._align),style:w.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(w.column.getSize())}%`},scope:"col",children:w.isPlaceholder?null:typeof w.column.columnDef.header=="function"?w.column.columnDef.header(w.getContext()):w.column.columnDef.header},w.id))},b.id))}),s.jsx(cc,{className:"dm-card-table-body",children:y.getRowModel().rows.length?y.getRowModel().rows.map((b,w)=>s.jsx(Pn,{onClick:()=>{const S=r.find(C=>C.id===b.original.id);S&&n(S)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":w+1,children:b.getVisibleCells().map((S,C)=>s.jsx(Zr,{className:`px-6 whitespace-normal ${UT(S.column.columnDef._align)}`,style:S.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(S.column.getSize())}%`},role:"cell","aria-colindex":C+1,children:typeof S.column.columnDef.cell=="function"?S.column.columnDef.cell(S.getContext()):S.column.columnDef.cell},S.id))},b.id)):s.jsx(Pn,{children:s.jsx(Zr,{colSpan:c.length,className:"dm-card-table-body-row-empty",role:"cell",children:s.jsx("span",{role:"status","aria-live":"polite",children:"No reports for this destination"})})})})]})})})}function joe({children:e,className:t,...n}){return s.jsx("div",{className:ne("group flex items-start justify-center gap-3 rounded-md border-b border-gray-200 bg-white transition-shadow duration-200 hover:shadow-xs dark:border-0 dark:bg-white/2",t),...n,children:e})}function Toe({children:e,className:t,...n}){return s.jsx("div",{className:ne("flex flex-grow flex-col gap-1 py-4",t),...n,children:e})}function _oe({children:e,className:t,...n}){return s.jsx("div",{className:ne("text-md font-medium",t),...n,children:e})}function Noe({children:e,className:t,...n}){return s.jsx("div",{className:ne("text-muted-foreground text-sm",t),...n,children:e})}function Aoe({checked:e,disabled:t,loading:n,onCheckedChange:r,tooltipTextSwitchOn:o,tooltipTextSwitchOff:l,tooltipTextSwitchDisabled:c}){const d=t?c??"Disabled":e?o:l;return s.jsxs(bt,{children:[s.jsx(St,{asChild:!0,children:s.jsx("div",{className:"flex items-center justify-center py-5 pl-6",onClick:f=>f.stopPropagation(),children:n?s.jsx(Af,{className:"text-muted-foreground h-5 w-5 animate-spin"}):s.jsx(u5,{checked:e,disabled:t,onCheckedChange:r})})}),s.jsx(Ct,{children:d})]})}function Doe({icon:e,className:t,...n}){return s.jsx("div",{className:ne("flex flex-shrink-0 items-center justify-center self-center p-4",t),...n,children:s.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-full transition-colors duration-200 group-hover:bg-gray-200/50 dark:group-hover:bg-white/4",children:e??s.jsx(La,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})})}function Ooe(e){const{dataMart:t}=Ia(),{reports:n,createReport:r,deleteReport:o,fetchReportsByDataMartId:l}=Ts(),[c,d]=m.useState(!1),f=m.useMemo(()=>n.find(b=>b.dataDestination.type===je.LOOKER_STUDIO&&b.dataDestination.id===e.id),[n,e.id]),h=m.useMemo(()=>(t==null?void 0:t.status.code)===Rr.PUBLISHED,[t==null?void 0:t.status.code]),g=m.useMemo(()=>!!f,[f]),y=m.useMemo(()=>g?"Available in Looker Studio":"Not available in Looker Studio",[g]),v=m.useCallback(async b=>{if(!(!t||!h)){d(!0);try{if(b){const w={title:`Looker Studio Report - ${e.title}`,dataMartId:t.id,dataDestinationId:e.id,destinationConfig:{type:yr.LOOKER_STUDIO_CONFIG,cacheLifetime:300}};await r(w),await l(t.id)}else f&&(await o(f.id),await l(t.id))}catch(w){console.error("Failed to toggle Looker Studio report:",w)}finally{d(!1)}}},[t,h,e,f,r,o,l]);return{existingReport:f,isLoading:c,isEnabled:h,isChecked:g,dynamicTitle:y,handleSwitchChange:v}}function Moe({destination:e,onEditReport:t,...n}){const{existingReport:r,isLoading:o,isEnabled:l,isChecked:c,dynamicTitle:d,handleSwitchChange:f}=Ooe(e),h=m.useCallback(()=>{r&&t(r)},[r,t]);return s.jsxs(joe,{className:r?"cursor-pointer dark:hover:bg-white/5":"",onClick:r?h:void 0,...n,children:[s.jsx(Aoe,{checked:c,disabled:!l,loading:o,onCheckedChange:g=>void f(g),tooltipTextSwitchOn:"Switch off to remove access",tooltipTextSwitchOff:"Switch on to enable access",tooltipTextSwitchDisabled:"Publish the Data Mart first to enable access in Looker Studio"}),s.jsxs(Toe,{children:[s.jsx(_oe,{children:d}),s.jsx(Noe,{children:c&&r?s.jsx(s.Fragment,{children:r.lastRunDate?s.jsxs(s.Fragment,{children:["Last fetched"," ",r.lastRunStatus===fn.SUCCESS&&"successfully ",s.jsx(Zi,{date:new Date(r.lastRunDate)}),r.lastRunStatus===fn.ERROR&&" but failed with error",r.lastRunError&&s.jsx("div",{className:"mt-1 text-red-600 dark:text-red-400",children:r.lastRunError})]}):"Waiting for Looker Studio to fetch data"}):"Switch on to enable access"})]}),c&&r&&s.jsx(Doe,{})]})}function Ioe(){const{scope:e}=Yo();return s.jsx("div",{className:"dm-card",children:s.jsxs("div",{className:"dm-empty-state",children:[s.jsx(z1,{className:"dm-empty-state-ico",strokeWidth:1}),s.jsx("h2",{className:"dm-empty-state-title",children:"Google Sheets, Looker Studio… and friends!"}),s.jsx("p",{className:"dm-empty-state-subtitle",children:"To send your Data Mart's data to your favorite tools, create a Destination first."}),s.jsx(Se,{variant:"outline",asChild:!0,children:s.jsxs(ha,{to:e("/data-destinations"),className:"flex items-center gap-1",children:["Go to Destinations",s.jsx(La,{className:"h-4 w-4"})]})})]})})}function koe(){const[e,t]=m.useState(!1),[n,r]=m.useState(ln.CREATE),[o,l]=m.useState(null);return{isOpen:e,mode:n,editingReport:o,handleAddReport:()=>{r(ln.CREATE),l(null),t(!0),Ue({event:"report_open",category:"Report",action:"CreateReport",label:"ReportForm"})},handleEditReport:h=>{r(ln.EDIT),l(h),t(!0),Ue({event:"report_open",category:"Report",action:"EditReport",label:h.dataDestination.type})},handleCloseModal:()=>{t(!1),l(null),Ue({event:"report_close",category:"Report",action:n===ln.EDIT?"Edit":"Create",label:"ReportForm"})}}}const Loe=[je.GOOGLE_SHEETS,je.EMAIL,je.SLACK,je.MS_TEAMS,je.GOOGLE_CHAT];function Poe({destination:e,dataMartStatus:t}){const{destinationInfo:n,isVisible:r}=UK(e),{isOpen:o,mode:l,editingReport:c,handleAddReport:d,handleEditReport:f,handleCloseModal:h}=koe();return r?s.jsxs(s.Fragment,{children:[s.jsxs(Vl,{name:e.id,collapsible:!0,defaultCollapsed:!1,children:[s.jsxs(Po,{children:[s.jsx(Lo,{icon:n.icon,children:e.title}),s.jsx(oh,{children:Loe.includes(e.type)&&s.jsx(Uoe,{dataMartStatus:t,onAddReport:d})})]}),s.jsx(Uo,{children:s.jsx(fie,{destination:e,onEditReport:f})}),s.jsx($i,{})]}),s.jsx(die,{destination:e,isOpen:o,onClose:h,mode:l,initialReport:c})]}):null}function Uoe({dataMartStatus:e,onAddReport:t}){const n=(e==null?void 0:e.code)===Rr.DRAFT;return s.jsxs(bt,{children:[s.jsx(St,{asChild:!0,children:s.jsx("span",{children:s.jsxs(Se,{onClick:t,variant:"outline",size:"sm","aria-label":"Add new report",disabled:n,children:[s.jsx(Pa,{className:"h-4 w-4"}),"Add Report"]})})}),n&&s.jsx(Ct,{children:s.jsx("p",{children:"To create a report, publish the Data Mart first"})})]})}function Foe({elementId:e,isOpen:t,delay:n=100,selectText:r=!1}){m.useEffect(()=>{{const o=setTimeout(()=>{const l=document.getElementById(e);if(l){const c=l;c.focus(),r&&c.value?c.select():c.value&&c.setSelectionRange(c.value.length,c.value.length)}},n);return()=>{clearTimeout(o)}}},[t,e,n,r])}const Voe=Jt({title:$t().min(1,"Title is required"),documentUrl:$t().refine(e3,"Enter a valid Google Sheets URL"),dataDestinationId:$t().min(1,"Destination is required")});function zoe({initialReport:e,mode:t,dataMartId:n,onSuccess:r,preSelectedDestination:o}){const[l,c]=m.useState(null),[d,f]=m.useState(!1),{updateReport:h,createReport:g,error:y,clearError:v}=Ts();m.useEffect(()=>{d&&y&&(c(y),f(!1))},[y,d]);const b=Xo({resolver:ll(Voe),defaultValues:{title:(e==null?void 0:e.title)??"",documentUrl:e!=null&&e.destinationConfig&&Lg(e.destinationConfig)?`https://docs.google.com/spreadsheets/d/${e.destinationConfig.spreadsheetId}/edit#gid=${e.destinationConfig.sheetId}`:"",dataDestinationId:(e==null?void 0:e.dataDestination.id)??(o==null?void 0:o.id)??""},mode:"onTouched"}),{register:w,handleSubmit:S,formState:C,reset:R}=b,{errors:j,isDirty:_}=C,D=m.useCallback(async A=>{try{c(null),v(),f(!0);const{spreadsheetId:O,sheetId:T}=pK(A.documentUrl);if(!O){c("Invalid Google Sheets URL");return}let M;if(t===ln.CREATE)M=await g({title:A.title,dataMartId:n,dataDestinationId:A.dataDestinationId,destinationConfig:{type:yr.GOOGLE_SHEETS_CONFIG,spreadsheetId:O,sheetId:T}});else{if(!e){c("Initial report is required for edit mode");return}M=await h(e.id,{title:A.title,dataDestinationId:A.dataDestinationId,destinationConfig:{type:yr.GOOGLE_SHEETS_CONFIG,spreadsheetId:O,sheetId:T}})}if(!M||y){c(y??"An error occurred while submitting the form");return}r==null||r()}catch(O){console.error("Error submitting form:",O),c("An error occurred while submitting the form")}},[t,e,n,g,h,r,v,y]);return{form:b,register:w,handleSubmit:S,errors:j,isDirty:_,reset:R,formError:l,isSubmitting:d,setFormError:c,getValues:b.getValues,onSubmit:D}}function Hoe(){return s.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:s.jsxs(cn,{value:"service-account-details",children:[s.jsx(un,{children:"How do I get a correct document link?"}),s.jsxs(dn,{children:[s.jsx("p",{className:"mb-2",children:"To get the correct Google Sheets document URL with a Sheet ID (GID), follow these steps:"}),s.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[s.jsxs("li",{children:["Open your Google Sheets document and select the specific ",s.jsx("strong",{children:"sheet tab"})," ","where the data should be inserted."]}),s.jsxs("li",{children:["Share the document with the service account email and grant it ",s.jsx("strong",{children:"Editor"})," ","access."]}),s.jsxs("li",{children:["While the correct sheet is selected, copy the URL from your browser's address bar — it should include the ",s.jsx("code",{className:"text-sm font-semibold",children:"gid"})," of that sheet."]}),s.jsx("li",{children:"Paste this URL into the field above."})]})]})]})})}function p0(e){return"serviceAccount"in e}function g6({value:e,children:t,doNotTruncateContent:n}){const[r,o]=m.useState(!1),l=async()=>{e&&(await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),2e3))};return s.jsx(vs,{children:s.jsxs(bt,{children:[s.jsx(St,{asChild:!0,children:s.jsxs("div",{role:"button",tabIndex:0,onClick:l,onKeyDown:c=>c.key==="Enter"&&l(),className:ne("flex cursor-pointer items-center justify-between gap-2 select-none","text-muted-foreground border-input rounded-md border px-3 py-1.5 text-sm","hover:bg-accent hover:text-accent-foreground transition-colors"),children:[s.jsx("span",{className:n?"w-[95%]":"truncate",children:t||e||"No data"}),r?s.jsx(lr,{className:"h-4 w-4 text-green-500"}):s.jsx(df,{className:"h-4 w-4"})]})}),s.jsx(Ct,{children:s.jsx("p",{children:r?"Copied!":"Click to copy"})})]})})}const $oe=m.forwardRef(({initialReport:e,mode:t=ln.EDIT,onDirtyChange:n,onFormErrorChange:r,onSubmit:o,onCancel:l,preSelectedDestination:c},d)=>{const f="google-sheets-edit-form",h="google-sheets-title-input",g="google-sheets-document-url-input",y="google-sheets-data-destination-select",{dataMart:v}=Ia(),{scope:b}=Yo(),{dataDestinations:w,fetchDataDestinations:S,loading:C}=Wf(),[R,j]=m.useState([]);m.useEffect(()=>{v&&S()},[v,S]),m.useEffect(()=>{if(w.length>0){const Y=w.filter(Z=>Z.type===je.GOOGLE_SHEETS);j(Y)}},[w]),Foe({elementId:h,isOpen:!0,delay:150});const{isDirty:_,reset:D,form:A,isSubmitting:O,formError:T,onSubmit:M}=zoe({initialReport:e,mode:t,dataMartId:(v==null?void 0:v.id)??"",onSuccess:()=>{o==null||o()},preSelectedDestination:c});m.useEffect(()=>{r&&r(T)},[T,r]),m.useEffect(()=>{if(t===ln.EDIT&&e&&Lg(e.destinationConfig))D({title:e.title,documentUrl:Mb(e.destinationConfig.spreadsheetId,e.destinationConfig.sheetId),dataDestinationId:e.dataDestination.id});else if(t===ln.CREATE){const Y=(c==null?void 0:c.id)??"";D({title:"",documentUrl:"",dataDestinationId:Y})}},[e,t,D,c]),m.useEffect(()=>{n==null||n(_)},[_,n]);const F=A.watch("documentUrl"),G=F&&e3(F.trim());return s.jsx(rl,{...A,children:s.jsxs(Jo,{id:f,ref:d,noValidate:!0,onSubmit:Y=>void A.handleSubmit(M)(Y),children:[s.jsxs(al,{children:[s.jsxs(ua,{title:"General",children:[s.jsx(kt,{control:A.control,name:"title",render:({field:Y})=>s.jsxs(_t,{children:[s.jsx(Rt,{tooltip:"Add a title that reflects the report`s purpose",children:"Title"}),s.jsx(Nt,{children:s.jsx(Ht,{id:h,placeholder:"Enter a report title",...Y})}),s.jsx(Ft,{})]})}),s.jsx(kt,{control:A.control,name:"dataDestinationId",render:({field:Y})=>s.jsxs(_t,{children:[s.jsx(Rt,{tooltip:"Select one of your existing destinations",children:"Destination"}),s.jsxs(Kr,{onValueChange:Y.onChange,value:Y.value,disabled:C||R.length===0,children:[s.jsx(Nt,{children:s.jsx(Wr,{id:y,className:"w-full max-w-full overflow-hidden",children:s.jsx(Yr,{className:"truncate",placeholder:"Select a destination",children:Y.value&&R.length>0&&(()=>{const Z=R.find(J=>J.id===Y.value);if(Z){const H=Hr.getInfo(Z.type).icon;return s.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[s.jsx(H,{className:"flex-shrink-0",size:18}),s.jsx("div",{className:"flex min-w-0 flex-col",children:s.jsx("span",{className:"truncate",children:Z.title})})]})}return null})()})})}),s.jsx(Qr,{children:R.map(Z=>{const H=Hr.getInfo(Z.type).icon;return s.jsx(Rn,{value:Z.id,children:s.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[s.jsx(H,{className:"flex-shrink-0",size:18}),s.jsxs("div",{className:"flex min-w-0 flex-col",children:[s.jsx("span",{className:"truncate",children:Z.title}),s.jsx("span",{className:"text-muted-foreground truncate text-xs",children:(p0(Z.credentials)&&Hx(Z.credentials.serviceAccount))??"No email found"})]})]})},Z.id)})})]}),R.length===0&&!C&&s.jsxs(MS,{className:"mt-2",children:[s.jsx(Nf,{className:"h-4 w-4"}),s.jsx(e5,{children:"No destinations available"}),s.jsxs(IS,{children:["You need to create a Destination before you can create a report."," ",s.jsx(ha,{to:b("/data-destinations"),className:"font-medium text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300",children:"Go to Destinations"})]})]}),Y.value&&R.length>0&&(()=>{const Z=R.find(J=>J.id===Y.value);return Z?s.jsxs("div",{className:"mt-2 flex flex-col gap-1",children:[s.jsx(Rt,{children:"Service Account Email"}),s.jsx(g6,{value:p0(Z.credentials)?Hx(Z.credentials.serviceAccount)??"No email found":"",children:p0(Z.credentials)?Hx(Z.credentials.serviceAccount):"No email found"})]}):null})(),s.jsx(Ft,{})]})}),s.jsx(kt,{control:A.control,name:"documentUrl",render:({field:Y})=>s.jsxs(_t,{children:[s.jsx(Rt,{tooltip:"The link must include the Sheet ID to insert data into the correct tab",children:"Document Link with Sheet ID (GID)"}),s.jsx(Nt,{children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ht,{id:g,placeholder:"Document URL",className:"flex-1",...Y}),s.jsxs(bt,{children:[s.jsx(St,{asChild:!0,children:s.jsx("button",{type:"button",className:`flex-shrink-0 rounded-md p-2 transition-all duration-200 ${G?"text-blue-600 hover:bg-blue-50 hover:text-blue-700 dark:text-blue-400 dark:hover:bg-blue-950/20 dark:hover:text-blue-300":"text-muted-foreground/30 cursor-not-allowed"}`,onClick:()=>{G&&window.open(F.trim(),"_blank","noopener,noreferrer")},disabled:!G,"aria-label":G?"Open document in new tab":"Document link is not valid",children:s.jsx(Fo,{className:"h-4 w-4","aria-hidden":"true"})})}),s.jsx(Ct,{side:"top",align:"center",role:"tooltip",children:G?"Open document in new tab":"Enter a valid URL to enable link"})]})]})}),s.jsx(wn,{children:s.jsx(Hoe,{})}),s.jsx(Ft,{})]})})]}),s.jsx(ua,{title:"Automate Report Runs",children:s.jsx(LS,{})})]}),s.jsxs(sl,{children:[s.jsx(Se,{variant:"default",type:"submit",className:"w-full","aria-label":t===ln.CREATE?"Create new report":"Save changes to report",disabled:!_||O,children:O?t===ln.CREATE?"Creating...":"Saving...":t===ln.CREATE?"Create new report":"Save changes to report"}),l&&s.jsx(Se,{variant:"outline",type:"button",onClick:l,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})});function Boe({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:o}){const[l,c]=m.useState(!1),[d,f]=m.useState(!1),h=m.useCallback(()=>{d?c(!0):t()},[d,t]),g=m.useCallback(()=>{c(!1),f(!1),t()},[t]),y=m.useCallback(b=>{f(b)},[]),v=m.useCallback(()=>{f(!1),t()},[t]);return s.jsxs(s.Fragment,{children:[s.jsx(Bo,{open:e,onOpenChange:b=>{b||h()},children:s.jsxs(Go,{children:[s.jsxs(qo,{children:[s.jsx(Zo,{children:r===ln.CREATE?"Create new report":"Edit report"}),s.jsx(Xi,{children:r===ln.CREATE?"Fill in the details to create a new Google Sheets report":"Update details of an existing Google Sheets report"})]}),s.jsx(Yf,{children:s.jsx($oe,{initialReport:n,mode:r,onDirtyChange:y,onSubmit:v,onCancel:h,preSelectedDestination:o})})]})}),s.jsx(Tr,{open:l,onOpenChange:c,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:g,variant:"destructive"})]})}const Goe=Jt({cacheLifetime:GG().min(300,"Cache time must be at least 5 minutes (300 seconds)")});function qoe({initialReport:e,dataMartId:t,onSuccess:n,preSelectedDestination:r}){const[o,l]=m.useState(null),{createReport:c,updateReport:d}=Ts(),f=Xo({resolver:ll(Goe),defaultValues:{cacheLifetime:e!=null&&e.destinationConfig&&d3(e.destinationConfig)?e.destinationConfig.cacheLifetime:300},mode:"onTouched"});return{form:f,onSubmit:async g=>{try{l(null);const{cacheLifetime:y}=g,v={type:yr.LOOKER_STUDIO_CONFIG,cacheLifetime:y};e?await d(e.id,{title:"Looker Studio Report",dataDestinationId:e.dataDestination.id,destinationConfig:v}):await c({title:"Looker Studio Report",dataMartId:t,dataDestinationId:(r==null?void 0:r.id)??"",destinationConfig:v}),n==null||n()}catch(y){console.error("Error submitting form:",y),l("Failed to save report. Please try again.")}},formError:o,isSubmitting:f.formState.isSubmitting,isDirty:f.formState.isDirty,reset:f.reset}}function Zoe(){return s.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:s.jsxs(cn,{value:"cache-lifetime-details",children:[s.jsx(un,{children:"What is the Cache Lifetime for Looker Studio?"}),s.jsx(dn,{children:s.jsx("p",{className:"mb-2",children:"Cache Lifetime - defines the period during which results from previous query executions are served from storage-side cache, eliminating the need to re-execute the query"})})]})})}const Koe=[{value:300,label:"5 minutes"},{value:600,label:"10 minutes"},{value:900,label:"15 minutes"},{value:1800,label:"30 minutes"},{value:3600,label:"1 hour"},{value:7200,label:"2 hours"},{value:14400,label:"4 hours"},{value:28800,label:"8 hours"},{value:43200,label:"12 hours"}],Yoe=m.forwardRef(({initialReport:e,mode:t=ln.EDIT,onDirtyChange:n,onFormErrorChange:r,onSubmit:o,onCancel:l,preSelectedDestination:c},d)=>{const f="looker-studio-edit-form",{dataMart:h}=Ia(),{isDirty:g,reset:y,form:v,isSubmitting:b,formError:w,onSubmit:S}=qoe({initialReport:e,dataMartId:(h==null?void 0:h.id)??"",onSuccess:()=>{o==null||o()},preSelectedDestination:c});return m.useEffect(()=>{r&&r(w)},[w,r]),m.useEffect(()=>{t===ln.EDIT&&e&&d3(e.destinationConfig)?y({cacheLifetime:e.destinationConfig.cacheLifetime}):t===ln.CREATE&&y({cacheLifetime:300})},[e,t,y]),m.useEffect(()=>{n==null||n(g)},[g,n]),s.jsx(rl,{...v,children:s.jsxs(Jo,{id:f,ref:d,noValidate:!0,onSubmit:C=>void v.handleSubmit(S)(C),children:[s.jsx(al,{children:s.jsx(ua,{title:"Cache Configuration",children:s.jsx(kt,{control:v.control,name:"cacheLifetime",render:({field:C})=>s.jsxs(_t,{children:[s.jsx(Rt,{tooltip:"Period during which query results are served from storage-side cache, avoiding re-execution",children:"Cache Lifetime"}),s.jsxs(Kr,{onValueChange:R=>{C.onChange(parseInt(R,10))},value:C.value.toString(),defaultValue:"300",children:[s.jsx(Nt,{children:s.jsx(Wr,{className:"w-full",children:s.jsx(Yr,{placeholder:"Select cache time"})})}),s.jsx(Qr,{children:Koe.map(R=>s.jsx(Rn,{value:R.value.toString(),children:R.label},R.value))})]}),s.jsx(Ft,{}),s.jsx(wn,{children:s.jsx(Zoe,{})})]})})})}),s.jsxs(sl,{children:[s.jsx(Se,{variant:"default",type:"submit",className:"w-full","aria-label":t===ln.CREATE?"Create":"Save changes",disabled:!g||b,children:b?t===ln.CREATE?"Creating...":"Saving...":t===ln.CREATE?"Create":"Save changes"}),l&&s.jsx(Se,{variant:"outline",type:"button",onClick:l,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})});function Woe({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:o}){const[l,c]=m.useState(!1),[d,f]=m.useState(!1),h=m.useCallback(()=>{d?c(!0):t()},[d,t]),g=m.useCallback(()=>{c(!1),f(!1),t()},[t]),y=m.useCallback(b=>{f(b)},[]),v=m.useCallback(()=>{f(!1),t()},[t]);return s.jsxs(s.Fragment,{children:[s.jsx(Bo,{open:e,onOpenChange:b=>{b||h()},children:s.jsxs(Go,{children:[s.jsxs(qo,{children:[s.jsx(Zo,{children:(o==null?void 0:o.title)??"Looker Studio"}),s.jsx(Xi,{children:r===ln.CREATE?"Set up Data Mart as a data source":"Update connection details"})]}),s.jsx(Yf,{children:s.jsx(Yoe,{initialReport:n,mode:r,onDirtyChange:y,onSubmit:v,onCancel:h,preSelectedDestination:o})})]})}),s.jsx(Tr,{open:l,onOpenChange:c,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:g,variant:"destructive"})]})}const FT=({destination:e})=>{const n=Hr.getInfo(e.type).icon;return s.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[s.jsx(n,{className:"flex-shrink-0",size:18}),s.jsx("div",{className:"flex min-w-0 flex-col",children:s.jsx("span",{className:"truncate",children:e.title})})]})};function Qoe(e){return"to"in e}const Xoe=({destination:e})=>{if(!e)return null;const t=e.credentials,n=Qoe(t)&&t.to.length?t.to.join(", "):"";return s.jsxs("div",{className:"mt-2 flex flex-col gap-1",children:[s.jsx(Rt,{children:"Recipients of this report"}),s.jsx(g6,{doNotTruncateContent:!0,value:n,children:n||"No recipients found"})]})};var kl=(e=>(e.ALWAYS="ALWAYS",e.RESULT_IS_EMPTY="RESULT_IS_EMPTY",e.RESULT_IS_NOT_EMPTY="RESULT_IS_NOT_EMPTY",e))(kl||{});const Joe=Jt({title:$t().min(1,"Title is required"),dataDestinationId:$t().min(1,"Destination is required"),reportCondition:Ng(kl),subject:$t().min(1,"Subject is required"),messageTemplate:$t().min(1,"Message body is required")});function eie({initialReport:e,mode:t,dataMartId:n,onSuccess:r,preSelectedDestination:o}){const[l,c]=m.useState(null),[d,f]=m.useState(!1),{updateReport:h,createReport:g,error:y,clearError:v}=Ts();m.useEffect(()=>{d&&y&&(c(y),f(!1))},[y,d]);const b=Xo({resolver:ll(Joe),defaultValues:{title:(e==null?void 0:e.title)??"",dataDestinationId:(e==null?void 0:e.dataDestination.id)??(o==null?void 0:o.id)??"",reportCondition:e!=null&&e.destinationConfig&&Bx(e.destinationConfig)?e.destinationConfig.reportCondition:kl.ALWAYS,subject:e!=null&&e.destinationConfig&&Bx(e.destinationConfig)?e.destinationConfig.subject:"",messageTemplate:e!=null&&e.destinationConfig&&Bx(e.destinationConfig)?e.destinationConfig.messageTemplate:""},mode:"onTouched"}),{handleSubmit:w,formState:S,reset:C}=b,{isDirty:R,errors:j}=S,_=m.useCallback(async D=>{try{c(null),v(),f(!0);let A;const O={type:yr.EMAIL_CONFIG,reportCondition:D.reportCondition,subject:D.subject,messageTemplate:D.messageTemplate};if(t===ln.CREATE)A=await g({title:D.title,dataMartId:n,dataDestinationId:D.dataDestinationId,destinationConfig:O});else{if(!e){c("Initial report is required for edit mode");return}A=await h(e.id,{title:D.title,dataDestinationId:D.dataDestinationId,destinationConfig:O})}if(!A||y){c(y??"An error occurred while submitting the form");return}r==null||r()}catch(A){console.error("Error submitting form:",A),c("An error occurred while submitting the form")}},[t,e,n,g,h,r,v,y]);return{form:b,handleSubmit:w,errors:j,isDirty:R,reset:C,formError:l,isSubmitting:d,setFormError:c,onSubmit:_}}function tie({value:e,onChange:t,onBlur:n,height:r=240,theme:o="light",options:l,className:c,placeholder:d="Write a message template."}){const f=h=>{n&&h.onDidBlurEditorText(n)};return s.jsx(TO,{language:"markdown",height:r,value:e,onChange:h=>{t(h??"")},onMount:f,theme:o,options:{wordWrap:"on",minimap:{enabled:!1},lineNumbers:"off",folding:!1,scrollBeyondLastLine:!1,automaticLayout:!0,placeholder:d,...l},className:c})}function nie({html:e,loading:t=!1,error:n=null,height:r=240,className:o,emptyState:l=s.jsx("div",{className:"text-muted-foreground text-sm",children:"Nothing to preview"})}){let c="#fff",d="#000";if(typeof window<"u"){const f=getComputedStyle(document.documentElement),h=f.getPropertyValue("--background").trim(),g=f.getPropertyValue("--foreground").trim();h&&(c=h),g&&(d=g)}return s.jsxs("div",{className:`bg-background overflow-auto p-4 ${o??""}`,style:{height:r},children:[t&&s.jsx("div",{className:"text-muted-foreground text-sm",children:"Generating preview…"}),!t&&n&&s.jsxs("div",{className:"text-destructive text-sm",children:["Error: ",n]}),!t&&!n&&!e&&l,!t&&!n&&!!e&&s.jsx("iframe",{title:"Markdown preview",sandbox:"allow-popups allow-popups-to-escape-sandbox",srcDoc:`<!doctype html><html style="background:${c};color:${d}"><head><meta charset='utf-8'/><base target='_blank'></head><body>${e}</body></html>`,className:"h-full w-full border-0"})]})}function rie({value:e,onChange:t,className:n}){return s.jsx(QD,{value:e,onValueChange:r=>{t(r)},children:s.jsxs(XD,{className:n??"h-7",children:[s.jsx(f1,{value:"markdown",children:"Markdown"}),s.jsx(f1,{value:"preview",children:"Preview"})]})})}function aie({markdown:e,enabled:t=!0,debounceMs:n=300,toHtml:r}){const[o,l]=m.useState(""),[c,d]=m.useState(!1),[f,h]=m.useState(null),g=m.useRef(null);return m.useEffect(()=>{var w;if(!t)return;const y=e;if(!y.trim()){l(""),h(null),d(!1);return}const v=new AbortController;(w=g.current)==null||w.abort(),g.current=v,d(!0),h(null);const b=setTimeout(()=>{r(y,v.signal).then(S=>{l(S)}).catch(S=>{if(v.signal.aborted)return;const C=S instanceof Error?S.message:"Failed to load preview";h(C)}).finally(()=>{v.signal.aborted||d(!1)})},n);return()=>{clearTimeout(b),v.abort()}},[e,t,n,r]),{html:o,loading:c,error:f}}function sie(e,t){return ca.post("/markdown/parse-to-html",{markdown:e},{headers:{"Content-Type":"application/json"},responseType:"text",signal:t}).then(n=>n.data)}function oie(e){const t=m.useCallback(sie,[]);return aie({...e,toHtml:t})}function iie(){return s.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:s.jsxs(cn,{value:"message-details",children:[s.jsx(un,{children:"How can I format my message?"}),s.jsxs(dn,{children:[s.jsx("p",{className:"mb-2",children:"You can format your message using Markdown — a simple text formatting syntax that lets you add structure and style without using complex editors."}),s.jsxs("p",{className:"mb-2",children:["For example:",s.jsx("br",{}),"**bold text** → ",s.jsx("b",{children:"bold text"}),s.jsx("br",{}),"__italic text__ → ",s.jsx("i",{children:"italic text"}),s.jsx("br",{}),"- list item → • list item"]}),s.jsxs("p",{children:["Use the Preview tab to see how your message will look after formatting.",s.jsx("br",{}),"If you’re new to Markdown, learn more from this"," ",s.jsx(vn,{className:"underline",href:"https://www.markdownguide.org/basic-syntax/",children:"quick guide"})]})]})]})})}function lie(){return s.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:s.jsxs(cn,{value:"sending-condition-details",children:[s.jsx(un,{children:"What are Data Mart Run results?"}),s.jsxs(dn,{children:[s.jsx("p",{className:"mb-2",children:"A Data Mart Run result is the outcome of processing your Data Mart — for example, running an SQL query that retrieves data for your report."}),s.jsx("p",{children:"Before sending a report, OWOX automatically runs the Data Mart and checks its result. Depending on your settings, the report can be sent always, only if the result is not empty, or only if it’s empty."})]})]})})}const cie=[je.EMAIL,je.SLACK,je.GOOGLE_CHAT,je.MS_TEAMS],y6=m.forwardRef(({initialReport:e,mode:t=ln.EDIT,onDirtyChange:n,onFormErrorChange:r,onSubmit:o,onCancel:l,preSelectedDestination:c},d)=>{const f="email-report-edit-form",{dataMart:h}=Ia(),{dataDestinations:g,fetchDataDestinations:y,loading:v}=Wf(),[b,w]=m.useState([]);m.useEffect(()=>{h&&y()},[h,y]),m.useEffect(()=>{if(g.length>0){const k=c!=null&&c.type?[c.type]:cie,z=g.filter(B=>k.includes(B.type));w(z)}},[g,c==null?void 0:c.type]);const{isDirty:S,reset:C,form:R,isSubmitting:j,formError:_,onSubmit:D}=eie({initialReport:e,mode:t,dataMartId:(h==null?void 0:h.id)??"",onSuccess:()=>{o==null||o()},preSelectedDestination:c});m.useEffect(()=>{r&&r(_)},[_,r]),m.useEffect(()=>{if(!(t===ln.EDIT&&e)){if(t===ln.CREATE){const k=(c==null?void 0:c.id)??"";C({title:"",dataDestinationId:k,reportCondition:kl.ALWAYS,subject:"",messageTemplate:""})}}},[e,t,C,c]),m.useEffect(()=>{n==null||n(S)},[S,n]);const A=m.useMemo(()=>[{value:kl.ALWAYS,label:"Send always"},{value:kl.RESULT_IS_EMPTY,label:"Send only when result is empty"},{value:kl.RESULT_IS_NOT_EMPTY,label:"Send only when result is not empty"}],[]),{resolvedTheme:O}=Ob(),T=O==="dark"?"vs-dark":"light",[M,F]=m.useState("markdown"),G=R.watch("messageTemplate"),{html:Y,loading:Z,error:J}=oie({markdown:G,enabled:M==="preview"}),H=R.watch("dataDestinationId"),K=m.useMemo(()=>H&&b.length>0?b.find(k=>k.id===H)??null:null,[H,b]);return s.jsx(rl,{...R,children:s.jsx(Jo,{id:f,ref:d,noValidate:!0,onSubmit:k=>{R.handleSubmit(D)(k)},children:s.jsxs(al,{children:[s.jsxs(ua,{title:"General",children:[s.jsx(kt,{control:R.control,name:"title",render:({field:k})=>s.jsxs(_t,{children:[s.jsx(Rt,{tooltip:"Add a title that reflects the report`s purpose",children:"Title"}),s.jsx(Nt,{children:s.jsx(Ht,{placeholder:"Enter a report title",...k})}),s.jsx(Ft,{})]})}),s.jsx(kt,{control:R.control,name:"dataDestinationId",render:({field:k})=>s.jsxs(_t,{children:[s.jsx(Rt,{tooltip:"Select one of your existing destinations",children:"Destination"}),s.jsxs(Kr,{onValueChange:k.onChange,value:k.value,disabled:v||b.length===0,children:[s.jsx(Nt,{children:s.jsx(Wr,{className:"w-full max-w-full overflow-hidden",children:s.jsx(Yr,{className:"truncate",placeholder:"Select a destination",children:K&&s.jsx(FT,{destination:K})})})}),s.jsx(Qr,{children:b.map(z=>s.jsx(Rn,{value:z.id,children:s.jsx(FT,{destination:z})},z.id))})]}),s.jsx(Xoe,{destination:K}),s.jsx(Ft,{})]})})]}),s.jsxs(ua,{title:"Template",children:[s.jsx(kt,{control:R.control,name:"subject",render:({field:k})=>s.jsxs(_t,{children:[s.jsx(Rt,{tooltip:"Add a short, clear subject line for your report",children:"Subject"}),s.jsx(Nt,{children:s.jsx(Ht,{placeholder:"Email subject",...k})}),s.jsx(Ft,{})]})}),s.jsx(kt,{control:R.control,name:"messageTemplate",render:({field:k})=>s.jsxs(_t,{children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx(Rt,{tooltip:"Write your report message in Markdown and check the final format in Preview",children:"Message"}),s.jsx(rie,{value:M,onChange:F})]}),s.jsx(Nt,{children:s.jsx("div",{className:"overflow-hidden rounded-md border",children:M==="markdown"?s.jsx(tie,{value:k.value,onChange:z=>{k.onChange(z)},onBlur:k.onBlur,height:240,theme:T}):s.jsx(nie,{html:Y,loading:Z,error:J,height:240})})}),s.jsx(wn,{children:s.jsx(iie,{})}),s.jsx(Ft,{})]})})]}),s.jsx(ua,{title:"Sending conditions",children:s.jsx(kt,{control:R.control,name:"reportCondition",render:({field:k})=>s.jsxs(_t,{children:[s.jsx(Rt,{tooltip:"Define when the report should be sent based on your Data Mart’s execution result",children:"Data Mart Run results"}),s.jsxs(Kr,{onValueChange:k.onChange,value:k.value,children:[s.jsx(Nt,{children:s.jsx(Wr,{className:"w-full max-w-full overflow-hidden",children:s.jsx(Yr,{})})}),s.jsx(Qr,{children:A.map(z=>s.jsx(Rn,{value:z.value,children:z.label},z.value))})]}),s.jsx(wn,{children:s.jsx(lie,{})}),s.jsx(Ft,{})]})})}),s.jsx(ua,{title:"Automate Report Runs",children:s.jsx(LS,{})}),s.jsxs(sl,{children:[s.jsx(Se,{type:"button",variant:"outline",onClick:l,disabled:j,children:"Cancel"}),s.jsx(Se,{type:"submit",disabled:j,children:t===ln.CREATE?"Create":"Save changes"})]})]})})})});y6.displayName="EmailReportEditForm";function uie({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:o}){const[l,c]=m.useState(!1),[d,f]=m.useState(!1),h=m.useCallback(()=>{d?c(!0):t()},[d,t]),g=m.useCallback(()=>{c(!1),f(!1),t()},[t]),y=m.useCallback(b=>{f(b)},[]),v=m.useCallback(()=>{f(!1),t()},[t]);return s.jsxs(s.Fragment,{children:[s.jsx(Bo,{open:e,onOpenChange:b=>{b||h()},children:s.jsxs(Go,{children:[s.jsxs(qo,{children:[s.jsx(Zo,{children:(o==null?void 0:o.title)??"Report"}),s.jsx(Xi,{children:r===ln.CREATE?"Create new report":"Edit report"})]}),s.jsx(Yf,{children:s.jsx(y6,{initialReport:n,mode:r,onDirtyChange:y,onSubmit:v,onCancel:h,preSelectedDestination:o})})]})}),s.jsx(Tr,{open:l,onOpenChange:c,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:g,variant:"destructive"})]})}function die({destination:e,isOpen:t,onClose:n,mode:r,initialReport:o}){switch(e.type){case je.GOOGLE_SHEETS:return s.jsx(Boe,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:o??void 0});case je.LOOKER_STUDIO:return s.jsx(Woe,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:o??void 0});case je.EMAIL:case je.SLACK:case je.GOOGLE_CHAT:case je.MS_TEAMS:return s.jsx(uie,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:o??void 0});default:return null}}function fie({destination:e,onEditReport:t}){switch(e.type){case je.GOOGLE_SHEETS:return s.jsx(Soe,{destination:e,onEditReport:t});case je.EMAIL:case je.SLACK:case je.GOOGLE_CHAT:case je.MS_TEAMS:return s.jsx(Roe,{destinationType:e.type,destination:e,onEditReport:t});case je.LOOKER_STUDIO:return s.jsx(Moe,{destination:e,onEditReport:t});default:return null}}function v6(){return s.jsx("div",{className:"flex flex-col gap-4",children:s.jsx("div",{className:"space-y-2 pb-4",children:Array.from({length:3}).map((e,t)=>s.jsx("div",{className:"border-border rounded-lg border p-4",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(hs,{className:"h-4 w-4 rounded-full"}),s.jsx(hs,{className:"h-4 w-40"}),s.jsx(hs,{className:"h-3 w-32"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(hs,{className:"h-6 w-16 rounded-full"}),s.jsx(hs,{className:"h-4 w-4"})]})]})},t))})})}function x6({enabled:e,intervalMs:t=5e3,onlyWhenVisible:n=!0,onTick:r}){const o=m.useRef(r);o.current=r;const l=m.useRef(null);m.useEffect(()=>{var f;if(!e)return;(f=l.current)==null||f.abort(),l.current=new AbortController;const c=()=>{if(!n||document.visibilityState==="visible"){const h=new AbortController;o.current(h.signal)}};c();const d=window.setInterval(c,t);return()=>{var h;window.clearInterval(d),(h=l.current)==null||h.abort()}},[e,t,n])}function hie({enabled:e=!0,intervalMs:t=5e3}={}){const{dataMart:n}=Ia(),{fetchReportsByDataMartId:r}=Ts();m.useEffect(()=>{n&&r(n.id)},[n==null?void 0:n.id,r]),x6({enabled:!!n&&e,intervalMs:t,onTick:()=>{n&&r(n.id,{silent:!0})}})}function mie(){const{dataMart:e}=Ia(),{dataDestinations:t,isLoading:n}=FK();return hie({enabled:!0,intervalMs:5e3}),e?s.jsx("div",{className:"flex flex-col gap-4",children:n?s.jsx(v6,{}):t.length===0?s.jsx(Ioe,{}):t.map(r=>s.jsx(Poe,{destination:r,dataMartStatus:e.status},r.id))}):null}function pie(){return s.jsx(Yf,{children:s.jsx(n3,{children:s.jsx(mie,{})})})}function VT(){return s.jsxs(Vl,{children:[s.jsx(Po,{children:s.jsx(Lo,{icon:z7,tooltip:"Description of the Data Mart",children:"Description"})}),s.jsx(Uo,{children:s.jsx(ree,{})}),s.jsx($i,{})]})}function gie(){const{dataMart:e}=Qo(),[t,n]=m.useState(!1),r=m.useCallback(()=>{n(!0)},[]),o=m.useCallback(()=>{n(!1)},[]);return s.jsxs(Vl,{children:[s.jsxs(Po,{children:[s.jsx(Lo,{icon:G1,tooltip:"Time triggers allow you to schedule Data Mart runs at specific times",children:"Time triggers"}),s.jsx(oh,{children:s.jsxs(Se,{variant:"outline",onClick:r,"aria-label":"Add new trigger",children:[s.jsx(Pa,{className:"h-4 w-4","aria-hidden":"true"}),"Add Trigger"]})})]}),s.jsx(Uo,{children:s.jsx(Tu,{children:s.jsx(Gne,{children:e&&s.jsxs(s.Fragment,{children:[s.jsx(Mre,{dataMartId:e.id}),s.jsx(kS,{isOpen:t,onClose:o,dataMartId:e.id})]})})})}),s.jsx($i,{})]})}function yie(){const e=x5(),{navigate:t}=Yo(),n=r=>{const o=e?`/data-marts/${r.id}/data-setup?preset=${e.key}`:`/data-marts/${r.id}/data-setup`;t(o)};return s.jsx("div",{className:"flex h-full w-full items-center justify-center",children:s.jsx("div",{className:"m-auto w-lg",children:s.jsxs("div",{className:"bg-muted/50 dark:bg-sidebar rounded-xl border-b border-gray-200 p-12 pt-8 dark:border-gray-700/50",children:[s.jsx("h2",{className:"mb-4 text-xl font-medium",children:"Create Data Mart"}),s.jsx(hS,{children:s.jsx(H3,{children:s.jsx(oJ,{initialData:{title:(e==null?void 0:e.datamartTitle)??"New Data Mart"},onSuccess:n})})})]})})})}function b6({isOpen:e,onClose:t,id:n}){const{getDataStorageById:r,currentDataStorage:o,loading:l,clearCurrentDataStorage:c}=Bg();m.useEffect(()=>(e&&n&&r(n),()=>{e||c()}),[e,n,r,c]);const d=()=>{c(),t()};return s.jsx(Qb,{open:e,onOpenChange:f=>{f||d()},children:s.jsxs(Xb,{children:[s.jsxs(Jb,{children:[s.jsx(eS,{children:"Storage Details"}),s.jsx(tS,{children:"View detailed information about this storage."})]}),s.jsx("div",{className:"py-4",children:s.jsx(BZ,{dataStorage:o,isLoading:l})})]})})}function g0({column:e,children:t}){return s.jsxs(Se,{variant:"ghost",onClick:()=>{e.toggleSorting(e.getIsSorted()==="asc")},className:"group dm-card-table-header-row-btn",children:[t,s.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[e.getIsSorted()==="asc"&&s.jsx(ns,{"data-testid":"lucide-arrow-up-down",className:"text-foreground h-4 w-4"}),e.getIsSorted()==="desc"&&s.jsx(ka,{"data-testid":"lucide-arrow-up-down",className:"text-foreground h-4 w-4"}),!e.getIsSorted()&&s.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:s.jsx(ns,{"data-testid":"lucide-arrow-up-down",className:"text-muted-foreground h-4 w-4"})})]})]})}const vie=({id:e,onViewDetails:t,onEdit:n,onDelete:r})=>{const[o,l]=m.useState(!1);return s.jsx("div",{className:"text-right",children:s.jsxs(ur,{open:o,onOpenChange:l,children:[s.jsx(dr,{asChild:!0,children:s.jsx(Se,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${o?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:s.jsx(pa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),s.jsxs(fr,{align:"end",children:[s.jsxs(pt,{onClick:()=>t==null?void 0:t(e),children:[s.jsx(j_,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),s.jsx("span",{children:"View details"})]}),s.jsxs(pt,{onClick:()=>void(n==null?void 0:n(e)),children:[s.jsx(Au,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),s.jsx("span",{children:"Edit"})]}),s.jsx(ma,{}),s.jsxs(pt,{onClick:()=>r==null?void 0:r(e),children:[s.jsx(Xs,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),s.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]})})};function xie({table:e}){return s.jsx("div",{className:"px-4 text-right",children:s.jsxs(ur,{children:[s.jsx(dr,{asChild:!0,children:s.jsx(Se,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:s.jsx(pa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),s.jsx(fr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>s.jsx(pt,{className:"capitalize",children:s.jsxs("label",{className:"flex items-center space-x-2",children:[s.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&s.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:s.jsx(lr,{className:"size-3.5 text-white"})})}),s.jsx("span",{children:t.id})]})},t.id))})]})})}const bie=({onViewDetails:e,onEdit:t,onDelete:n}={})=>[{accessorKey:"title",size:50,header:({column:r})=>s.jsx(g0,{column:r,children:"Title"}),cell:({row:r})=>{const o=r.getValue("title");return s.jsx("div",{children:o})}},{accessorKey:"type",size:30,header:({column:r})=>s.jsx(g0,{column:r,children:"Type"}),cell:({row:r})=>{const o=r.getValue("type"),{displayName:l,icon:c}=nl.getInfo(o);return s.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[s.jsx(c,{size:18}),l]})}},{accessorKey:"createdAt",size:20,sortDescFirst:!0,header:({column:r})=>s.jsx(g0,{column:r,children:"Created at"}),cell:({row:r})=>{const o=r.getValue("createdAt"),l=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(o);return s.jsx("div",{className:"text-muted-foreground",children:l})}},{id:"actions",size:80,header:({table:r})=>s.jsx(xie,{table:r}),cell:({row:r})=>s.jsx(vie,{id:r.original.id,onViewDetails:e,onEdit:t,onDelete:n})}];function Sie({onOpenTypeDialog:e}){return s.jsxs("div",{className:"dm-empty-state",children:[s.jsx(uk,{className:"dm-empty-state-ico",strokeWidth:1}),s.jsx("h2",{className:"dm-empty-state-title",children:"Create your first Storage"}),s.jsx("p",{className:"dm-empty-state-subtitle",children:"A Storage combines your data warehouse and access credentials — both required to start building Data Marts."}),s.jsxs(Se,{variant:"outline",onClick:e,children:[s.jsx(Pa,{className:"h-4 w-4"}),"New Storage"]})]})}function Cie({columns:e,data:t,onEdit:n,onOpenTypeDialog:r}){var R;const{sorting:o,setSorting:l,columnVisibility:c,setColumnVisibility:d}=Vu({columns:e,storageKeyPrefix:"data-storage-list"}),[f,h]=m.useState([]),[g,y]=m.useState({}),[v,b]=m.useState(!1),[w]=m.useState(null),S=oc({data:t,columns:[...e],getCoreRowModel:sc(),getPaginationRowModel:Ug(),onSortingChange:l,getSortedRowModel:Fu(),onColumnFiltersChange:h,getFilteredRowModel:Qf(),onColumnVisibilityChange:d,onRowSelectionChange:y,state:{sorting:o,columnFilters:f,columnVisibility:c,rowSelection:g},enableRowSelection:!0}),C=(j,_)=>{_.target instanceof HTMLElement&&(_.target.closest('[role="checkbox"]')||_.target.closest(".actions-cell")||_.target.closest('[role="menuitem"]'))||n==null||n(j)};return t.length?s.jsxs("div",{children:[w&&s.jsx(b6,{isOpen:v,onClose:()=>{b(!1)},id:w.id}),s.jsxs("div",{className:"dm-card",children:[s.jsxs("div",{className:"dm-card-toolbar",children:[s.jsx("div",{className:"dm-card-toolbar-left",children:s.jsxs("div",{className:"dm-card-toolbar-search",children:[s.jsx(Jl,{className:"dm-card-toolbar-search-icon"}),s.jsx(Ht,{placeholder:"Search by title",value:(R=S.getColumn("title"))==null?void 0:R.getFilterValue(),onChange:j=>{var _;return(_=S.getColumn("title"))==null?void 0:_.setFilterValue(j.target.value)},className:"dm-card-toolbar-search-input"})]})}),s.jsx("div",{className:"dm-card-toolbar-right",children:s.jsxs(Se,{variant:"outline",className:"dm-card-toolbar-btn-primary",onClick:()=>{r==null||r()},children:[s.jsx(Pa,{className:"h-4 w-4"}),"New Storage"]})})]}),s.jsx("div",{className:"dm-card-table-wrap",children:s.jsxs(ic,{className:"dm-card-table",role:"table","aria-label":"Storages table",children:[s.jsx(lc,{className:"dm-card-table-header",children:S.getHeaderGroups().map(j=>s.jsx(Pn,{className:"dm-card-table-header-row",children:j.headers.map(_=>s.jsx(uc,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",style:_.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(_.getSize())}%`},children:_.isPlaceholder?null:ju(_.column.columnDef.header,_.getContext())},_.id))},j.id))}),s.jsx(cc,{className:"dm-card-table-body",children:S.getRowModel().rows.length?S.getRowModel().rows.map(j=>s.jsx(Pn,{"data-state":j.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:_=>{const D=j.original.id;C(D,_)},children:j.getVisibleCells().map(_=>s.jsx(Zr,{className:`[&:has([role=checkbox])]pr-0 px-6 whitespace-normal [&>[role=checkbox]]:translate-y-[2px] ${_.column.id==="actions"?"actions-cell":""} ${_.column.id==="createdAt"?"whitespace-nowrap":""}`,style:_.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(_.column.getSize())}%`},children:ju(_.column.columnDef.cell,_.getContext())},_.id))},j.id)):s.jsx(Pn,{children:s.jsx(Zr,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),s.jsxs("div",{className:"dm-card-pagination",children:[s.jsx(Se,{variant:"outline",size:"sm",onClick:()=>{S.previousPage()},disabled:!S.getCanPreviousPage(),children:"Previous"}),s.jsx(Se,{variant:"outline",size:"sm",onClick:()=>{S.nextPage()},disabled:!S.getCanNextPage(),children:"Next"})]})]})]}):s.jsx("div",{className:"dm-card",children:s.jsx(Sie,{onOpenTypeDialog:r})})}const Eie=({initialTypeDialogOpen:e=!1,onTypeDialogClose:t})=>{const[n,r]=m.useState(e),{dataStorages:o,currentDataStorage:l,clearCurrentDataStorage:c,fetchDataStorages:d,getDataStorageById:f,deleteDataStorage:h,createDataStorage:g}=Bg();m.useEffect(()=>{d()},[d]),m.useEffect(()=>{r(e)},[e]);const y=()=>{r(!1),t==null||t()},[v,b]=m.useState(!1),[w,S]=m.useState(!1),[C,R]=m.useState(null),[j,_]=m.useState(!1),[D,A]=m.useState(null),O=async k=>{try{const z=await g(k);y(),z!=null&&z.id&&(await f(z.id),b(!0))}catch(z){console.error("Failed to create storage:",z)}},T=k=>{A(k),_(!0)},M=()=>{_(!1),A(null)},F=async k=>{await f(k),b(!0)},G=k=>{R(k),S(!0)},Y=async()=>{if(C)try{await h(C),await d()}catch(k){console.error("Failed to delete storage:",k)}finally{S(!1),R(null)}},Z=async()=>{try{b(!1),await d()}catch(k){console.error("Failed to save storage:",k)}},J=()=>{b(!1),c()},H=o.map(k=>({id:k.id,title:k.title,type:k.type,createdAt:k.createdAt,modifiedAt:k.modifiedAt})),K=bie({onViewDetails:T,onEdit:F,onDelete:G});return s.jsxs("div",{children:[s.jsx(Cie,{columns:K,data:H,onEdit:F,onOpenTypeDialog:()=>{r(!0)}}),s.jsx(b6,{isOpen:j,onClose:M,id:D??""}),s.jsx(FD,{isOpen:n,onClose:y,onSelect:O}),s.jsx(JO,{isOpen:v,onClose:J,dataStorage:l,onSaveSuccess:()=>void Z()}),s.jsx(Tr,{open:w,onOpenChange:S,title:"Delete Storage",description:"Are you sure you want to delete this storage? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{Y()},onCancel:()=>{R(null)},variant:"destructive"})]})},wie=()=>{const[e,t]=m.useState(!1);return s.jsxs("div",{className:"dm-page",children:[s.jsx("header",{className:"dm-page-header",children:s.jsx("h1",{className:"dm-page-header-title",children:"Storages"})}),s.jsx("div",{className:"dm-page-content",children:s.jsx(hS,{children:s.jsx(Eie,{initialTypeDialogOpen:e,onTypeDialogClose:()=>{t(!1)}})})})]})};function Rie({onOpenTypeDialog:e}){return s.jsxs("div",{className:"dm-empty-state",children:[s.jsx(z1,{className:"dm-empty-state-ico",strokeWidth:1}),s.jsx("h2",{className:"dm-empty-state-title",children:"Create your first Destination"}),s.jsx("p",{className:"dm-empty-state-subtitle",children:"A Destination combines your reporting tool and access credentials — both needed to deliver data from Data Marts to your reports and dashboards."}),s.jsxs(Se,{variant:"outline",onClick:e,children:[s.jsx(Pa,{className:"h-4 w-4"}),"New Destination"]})]})}function jie({columns:e,data:t,onEdit:n,onOpenTypeDialog:r}){var w;const{sorting:o,setSorting:l,columnVisibility:c,setColumnVisibility:d}=Vu({columns:e,storageKeyPrefix:"data-destination-list"}),[f,h]=m.useState([]),[g,y]=m.useState({}),v=oc({data:t,columns:[...e],getCoreRowModel:sc(),getPaginationRowModel:Ug(),onSortingChange:l,getSortedRowModel:Fu(),onColumnFiltersChange:h,getFilteredRowModel:Qf(),onColumnVisibilityChange:d,onRowSelectionChange:y,state:{sorting:o,columnFilters:f,columnVisibility:c,rowSelection:g},enableRowSelection:!0}),b=(S,C)=>{C.target instanceof HTMLElement&&(C.target.closest('[role="checkbox"]')||C.target.closest(".actions-cell")||C.target.closest('[role="menuitem"]'))||n==null||n(S)};return t.length?s.jsx("div",{children:s.jsxs("div",{className:"dm-card",children:[s.jsxs("div",{className:"dm-card-toolbar",children:[s.jsx("div",{className:"dm-card-toolbar-left",children:s.jsxs("div",{className:"dm-card-toolbar-search",children:[s.jsx(Jl,{className:"dm-card-toolbar-search-icon"}),s.jsx(Ht,{placeholder:"Search by title",value:(w=v.getColumn("title"))==null?void 0:w.getFilterValue(),onChange:S=>{var C;return(C=v.getColumn("title"))==null?void 0:C.setFilterValue(S.target.value)},className:"dm-card-toolbar-search-input"})]})}),s.jsx("div",{className:"dm-card-toolbar-right",children:s.jsxs(Se,{variant:"outline",className:"dm-card-toolbar-btn-primary",onClick:()=>{r==null||r()},children:[s.jsx(Pa,{className:"h-4 w-4"}),"New Destination"]})})]}),s.jsx("div",{className:"dm-card-table-wrap",children:s.jsxs(ic,{className:"dm-card-table",role:"table","aria-label":"Destinations table",children:[s.jsx(lc,{className:"dm-card-table-header",children:v.getHeaderGroups().map(S=>s.jsx(Pn,{className:"dm-card-table-header-row",children:S.headers.map(C=>s.jsx(uc,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",style:C.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(C.getSize())}%`},children:C.isPlaceholder?null:ju(C.column.columnDef.header,C.getContext())},C.id))},S.id))}),s.jsx(cc,{className:"dm-card-table-body",children:v.getRowModel().rows.length?v.getRowModel().rows.map(S=>s.jsx(Pn,{"data-state":S.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:C=>{const R=S.original.id;b(R,C)},children:S.getVisibleCells().map(C=>s.jsx(Zr,{className:`[&:has([role=checkbox])]pr-0 px-6 whitespace-normal [&>[role=checkbox]]:translate-y-[2px] ${C.column.id==="actions"?"actions-cell":""} ${C.column.id==="createdAt"?"whitespace-nowrap":""}`,style:C.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(C.column.getSize())}%`},children:ju(C.column.columnDef.cell,C.getContext())},C.id))},S.id)):s.jsx(Pn,{children:s.jsx(Zr,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),s.jsxs("div",{className:"dm-card-pagination",children:[s.jsx(Se,{variant:"outline",size:"sm",onClick:()=>{v.previousPage()},disabled:!v.getCanPreviousPage(),children:"Previous"}),s.jsx(Se,{variant:"outline",size:"sm",onClick:()=>{v.nextPage()},disabled:!v.getCanNextPage(),children:"Next"})]})]})}):s.jsx("div",{className:"dm-card",children:s.jsx(Rie,{onOpenTypeDialog:r})})}function y0({column:e,children:t}){return s.jsxs(Se,{variant:"ghost",onClick:()=>{e.toggleSorting(e.getIsSorted()==="asc")},className:"group dm-card-table-header-row-btn",children:[t,s.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[e.getIsSorted()==="asc"&&s.jsx(ns,{"data-testid":"lucide-arrow-up-down",className:"text-foreground h-4 w-4"}),e.getIsSorted()==="desc"&&s.jsx(ka,{"data-testid":"lucide-arrow-up-down",className:"text-foreground h-4 w-4"}),!e.getIsSorted()&&s.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:s.jsx(ns,{"data-testid":"lucide-arrow-up-down",className:"text-muted-foreground h-4 w-4"})})]})]})}function ZS(e){return"destinationSecretKey"in e}const Tie=({id:e,type:t,credentials:n,onEdit:r,onDelete:o,onRotateSecretKey:l})=>{const[c,d]=m.useState(!1),f=()=>{if(n&&ZS(n)){const y=kb(n);navigator.clipboard.writeText(y),It.success("JSON Config copied to clipboard")}},h=t===je.LOOKER_STUDIO,g=n&&"destinationSecretKey"in n&&n.destinationSecretKey;return s.jsx(s.Fragment,{children:s.jsx("div",{className:"text-right",children:s.jsxs(ur,{open:c,onOpenChange:d,children:[s.jsx(dr,{asChild:!0,children:s.jsx(Se,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${c?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:s.jsx(pa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),s.jsxs(fr,{align:"end",children:[s.jsxs(pt,{onClick:()=>void(r==null?void 0:r(e)),children:[s.jsx(Au,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),s.jsx("span",{children:"Edit"})]}),h&&g&&s.jsxs(s.Fragment,{children:[s.jsx(ma,{}),s.jsxs(pt,{onClick:f,children:[s.jsx(df,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),s.jsx("span",{children:"Copy JSON Config"})]}),s.jsxs(pt,{onClick:()=>{l==null||l(e)},children:[s.jsx(R0,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),s.jsx("span",{children:"Rotate Secret Key"})]})]}),s.jsx(ma,{}),s.jsxs(pt,{onClick:()=>o==null?void 0:o(e),children:[s.jsx(Xs,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),s.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]})})})};function _ie({table:e}){return s.jsx("div",{className:"px-4 text-right",children:s.jsxs(ur,{children:[s.jsx(dr,{asChild:!0,children:s.jsx(Se,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:s.jsx(pa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),s.jsx(fr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>s.jsx(pt,{className:"capitalize",children:s.jsxs("label",{className:"flex items-center space-x-2",children:[s.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&s.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:s.jsx(lr,{className:"size-3.5 text-white"})})}),s.jsx("span",{children:t.id})]})},t.id))})]})})}const Nie=({onEdit:e,onDelete:t,onRotateSecretKey:n}={})=>[{accessorKey:"title",size:50,header:({column:r})=>s.jsx(y0,{column:r,children:"Title"}),cell:({row:r})=>{const o=r.getValue("title");return s.jsx("div",{className:"overflow-hidden text-ellipsis",children:o})}},{accessorKey:"type",size:30,header:({column:r})=>s.jsx(y0,{column:r,children:"Type"}),cell:({row:r})=>{const o=r.getValue("type"),{displayName:l,icon:c}=Hr.getInfo(o);return s.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[s.jsx(c,{size:18}),l]})}},{accessorKey:"createdAt",size:20,sortDescFirst:!0,header:({column:r})=>s.jsx(y0,{column:r,children:"Created at"}),cell:({row:r})=>{const o=r.getValue("createdAt"),l=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(o);return s.jsx("div",{className:"text-muted-foreground",children:l})}},{id:"actions",size:80,header:({table:r})=>s.jsx(_ie,{table:r}),cell:({row:r})=>s.jsx(Tie,{id:r.original.id,type:r.original.type,credentials:r.original.credentials,onEdit:e,onDelete:t,onRotateSecretKey:n})}];function Aie(){return s.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:s.jsxs(cn,{value:"service-account-details",children:[s.jsx(un,{children:"How do I get a Service Account JSON key?"}),s.jsxs(dn,{children:[s.jsx("p",{className:"mb-2",children:"To get the JSON key, you'll need to create or use an existing service account in Google Cloud."}),s.jsx("p",{className:"mb-2",children:"Here's what to do:"}),s.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[s.jsxs("li",{children:["Go to"," ",s.jsx(vn,{href:"https://console.cloud.google.com/iam-admin/serviceaccounts",children:"Google Cloud Console"})," ","."]}),s.jsxs("li",{children:["Open ",s.jsx("strong",{children:"IAM & Admin → Service Accounts"}),"."]}),s.jsx("li",{children:"Create a new service account or select an existing one."}),s.jsxs("li",{children:["Open the Service Accounts page, go to the ",s.jsx("strong",{children:"Keys"})," tab, click"," ",s.jsx("strong",{children:"Add key"}),", and select ",s.jsx("strong",{children:"Create new key"}),"."]}),s.jsxs("li",{children:["Choose ",s.jsx("strong",{children:"JSON"})," format and click ",s.jsx("strong",{children:"Create"}),"."]}),s.jsx("li",{children:"Open the downloaded file, copy its entire content, and paste it into the field above."})]})]})]})})}function Die({form:e}){const[t,n]=m.useState(!1),r=()=>{n(!0),e.setValue("credentials.serviceAccount","",{shouldDirty:!0})},o=()=>{n(!1),e.resetField("credentials.serviceAccount")},l=e.watch("credentials.serviceAccount"),c=l?QO(l):null;return s.jsx(kt,{control:e.control,name:"credentials.serviceAccount",render:({field:d})=>s.jsxs(_t,{children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Rt,{tooltip:"Paste a JSON key from a service account that has access to the selected destination provider",children:"Service Account"}),!t&&l&&s.jsx(Se,{variant:"ghost",size:"sm",onClick:r,type:"button",children:"Edit"}),t&&s.jsx(Se,{variant:"ghost",size:"sm",onClick:o,type:"button",children:"Cancel"})]}),s.jsx(Nt,{children:!t&&c?s.jsxs(bt,{children:[s.jsx(St,{asChild:!0,children:s.jsx(vn,{href:c.url,children:c.email})}),s.jsx(Ct,{children:s.jsx("p",{children:"View in Google Cloud Console"})})]}):s.jsx(Ko,{...d,className:"min-h-[150px] font-mono",rows:8,placeholder:"Paste your service account JSON here"})}),s.jsx(wn,{children:s.jsx(Aie,{})}),s.jsx(Ft,{})]})})}function Oie(){return s.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:s.jsxs(cn,{value:"json-config-details",children:[s.jsx(un,{children:"What is the JSON Config for Looker Studio?"}),s.jsxs(dn,{children:[s.jsx("p",{className:"mb-2",children:"The JSON Config contains the necessary credentials and configuration for connecting to Looker Studio."}),s.jsxs("ul",{className:"list-inside space-y-2 text-sm",children:[s.jsx("li",{children:"You need to copy this JSON config to use it in the Looker Studio Connector."}),s.jsx("li",{children:"If you need to rotate a previous secret key, you can use the corresponding function in the menu on the destinations list."})]})]})]})})}function Mie({form:e}){const t=e.getValues("credentials"),n=m.useMemo(()=>t&&ZS(t)?t:{deploymentUrl:"",destinationId:"",destinationSecretKey:""},[t]),r=m.useMemo(()=>kb(n),[n]);return s.jsx(s.Fragment,{children:n.destinationSecretKey&&s.jsx(kt,{control:e.control,name:"credentials.destinationSecretKey",render:()=>s.jsxs(_t,{children:[s.jsx(Rt,{children:"JSON Config"}),s.jsx(Nt,{children:s.jsx(EA,{value:r,displayOnly:!0,keysToMask:["destinationSecretKey"],className:"bg-muted overflow-auto rounded-md text-sm",showCopyButton:!0})}),s.jsx(Ft,{}),s.jsx(wn,{children:s.jsx(Oie,{})})]})})})}const S6="credentials.to",Iie=/[,;\n]/,kie=", ",C6="Enter emails separated by comma, semicolon or newline",Lie="Emails list";function zT(e){const t=new Set,n=[];for(const r of e.split(Iie)){const o=r.trim();if(!o)continue;const l=o.toLowerCase();t.has(l)||(t.add(l),n.push(o))}return n}function v0(e){return e.join(kie)}function HT(e,t){e.setValue(S6,t,{shouldDirty:!0,shouldTouch:!0})}function Pie({field:e,form:t}){const n=Array.isArray(e.value)?v0(e.value):"",[r,o]=m.useState(n),[l,c]=m.useState(!1),d=Array.isArray(e.value)?v0(e.value):"";m.useEffect(()=>{l||o(d)},[d,l]);const f=y=>{const v=y.target.value;o(v),HT(t,zT(v))},h=()=>{c(!0)},g=y=>{c(!1),e.onBlur();const v=zT(y.target.value);HT(t,v),o(v0(v))};return s.jsx(Ko,{name:e.name,ref:e.ref,onFocus:h,onBlur:g,value:r,onChange:f,className:"min-h-[150px] font-mono",rows:8,placeholder:C6})}function Bm({form:e,emailsFieldTitle:t=Lie}){return s.jsx(kt,{control:e.control,name:S6,render:({field:n})=>s.jsxs(_t,{children:[s.jsx("div",{className:"flex items-center justify-between",children:s.jsx(Rt,{tooltip:C6,children:t})}),s.jsx(Nt,{children:s.jsx(Pie,{field:n,form:e})}),s.jsx(Ft,{})]})})}function Uie(){return s.jsxs(cn,{value:"sheets-api-details",children:[s.jsx(un,{children:"How do I enable the Google Sheets API?"}),s.jsxs(dn,{children:[s.jsxs("p",{className:"mb-2",children:["To send data to Google Sheets, you need to enable the"," ",s.jsx(vn,{href:"https://console.cloud.google.com/apis/library/sheets.googleapis.com",children:"Google Sheets API"})," ","in your Google Cloud project."]}),s.jsx("p",{className:"mb-2",children:"Here's how to do it:"}),s.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[s.jsx("li",{children:"Open the link above and make sure the correct project is selected."}),s.jsxs("li",{children:["If the API isn't enabled yet, click ",s.jsx("strong",{children:"Enable"}),"."]}),s.jsx("li",{children:"If it's already enabled, you'll see the API dashboard — that's fine."})]})]})]})}function Fie(){return s.jsxs(cn,{value:"looker-studio-details",children:[s.jsx(un,{children:"How do I connect to Looker Studio?"}),s.jsxs(dn,{children:[s.jsxs("p",{className:"mb-2",children:["To send data to Looker Studio, you need to provide a deployment URL that the"," ",s.jsx(vn,{className:"p-0",href:"https://datastudio.google.com/datasources/create?connectorId=AKfycbz6kcYn3qGuG0jVNFjcDnkXvVDiz4hewKdAFjOm-_d4VkKVcBidPjqZO991AvGL3FtM4A",children:"Looker Studio connector"})," ","will use to access your data."]}),s.jsx("p",{className:"mb-2",children:"Make sure the deployment URL is accessible from the internet and properly secured."}),s.jsx(vn,{className:"p-0",href:"https://docs.owox.com/docs/destinations/supported-destinations/looker-studio/?utm_source=owox_data_marts&utm_medium=destination_enity&utm_campaign=tooltip",children:"Learn more"})]})]})}function Vie(){return s.jsxs(cn,{value:"odata-details",children:[s.jsx(un,{children:"How do I use OData?"}),s.jsxs(dn,{children:[s.jsx("p",{className:"mb-2",children:"OData (Open Data Protocol) is an ISO/IEC approved, OASIS standard that defines a set of best practices for building and consuming RESTful APIs."}),s.jsx("p",{className:"mb-2",children:"This feature is coming soon."})]})]})}function zie(){return s.jsxs(cn,{value:"email-details",children:[s.jsx(un,{children:"How do I start sending Email?"}),s.jsxs(dn,{children:[s.jsxs("p",{className:"mb-2",children:["To send reports by email, first configure the ",s.jsx("strong",{children:"Email"})," destination in this form. Then, go to your Data Mart page, open the ",s.jsx("strong",{children:"Destinations"})," tab, and create a report in the Email block."]}),s.jsx("p",{className:"mb-2",children:"In the report settings, specify recipient addresses, add a message, and define delivery conditions. The generated report will be delivered by OWOX Data Marts to the selected addresses as formatted text."}),s.jsx("p",{className:"mb-2 text-sm",children:"Make sure recipients have permission to view the report data."}),s.jsxs("p",{className:"mb-2",children:["For more details, read the"," ",s.jsx(vn,{className:"underline",href:"https://docs.owox.com/docs/destinations/supported-destinations/email/?utm_source=owox_data_marts&utm_medium=destination_entity&utm_campaign=tooltip",children:"OWOX documentation"}),"."]})]})]})}function Hie(){return s.jsxs(cn,{value:"slack-details",children:[s.jsx(un,{children:"How do I start sending to Slack?"}),s.jsxs(dn,{children:[s.jsxs("p",{className:"mb-2",children:["To send reports to Slack, first configure the ",s.jsx("strong",{children:"Slack"})," destination in this form. Then, go to your Data Mart page, open the ",s.jsx("strong",{children:"Destinations"})," tab, and create a report in the Slack block."]}),s.jsx("p",{className:"mb-2",children:"In the report settings, choose the workspace, channel, message text, and define delivery conditions. The generated report will be delivered by OWOX Data Marts to the selected channel as a message."}),s.jsx("p",{className:"mb-2 text-sm",children:"Make sure OWOX has permission to post messages in the chosen channel."}),s.jsxs("p",{className:"mb-2",children:["For more details, read the"," ",s.jsx(vn,{className:"underline",href:"https://docs.owox.com/docs/destinations/supported-destinations/slack/?utm_source=owox_data_marts&utm_medium=destination_entity&utm_campaign=tooltip",children:"OWOX documentation"}),"."]})]})]})}function $ie(){return s.jsxs(cn,{value:"msteams-details",children:[s.jsx(un,{children:"How do I start sending to Microsoft Teams?"}),s.jsxs(dn,{children:[s.jsxs("p",{className:"mb-2",children:["To send reports to Microsoft Teams, first configure the ",s.jsx("strong",{children:"Microsoft Teams"})," ","destination in this form. Then, go to your Data Mart page, open the"," ",s.jsx("strong",{children:"Destinations"})," tab, and create a report in the Microsoft Teams block."]}),s.jsx("p",{className:"mb-2",children:"In the report settings, select the channel, add a message, and define delivery conditions. The generated report will be delivered by OWOX Data Marts to the selected channel as a message."}),s.jsx("p",{className:"mb-2 text-sm",children:"Make sure OWOX has permission to post messages in your Teams workspace."}),s.jsxs("p",{className:"mb-2",children:["For more details, read the"," ",s.jsx(vn,{className:"underline",href:"https://docs.owox.com/docs/destinations/supported-destinations/microsoft-teams/?utm_source=owox_data_marts&utm_medium=destination_entity&utm_campaign=tooltip",children:"OWOX documentation"}),"."]})]})]})}function Bie(){return s.jsxs(cn,{value:"googlechat-details",children:[s.jsx(un,{children:"How do I start sending to Google Chat?"}),s.jsxs(dn,{children:[s.jsxs("p",{className:"mb-2",children:["To send reports to Google Chat, first configure the ",s.jsx("strong",{children:"Google Chat"})," ","destination in this form. Then, go to your Data Mart page, open the"," ",s.jsx("strong",{children:"Destinations"})," tab, and create a report in the Google Chat block."]}),s.jsx("p",{className:"mb-2",children:"In the report settings, select the channel, add a message, and define delivery conditions. The generated report will be delivered by OWOX Data Marts to the connected space as chat messages."}),s.jsxs("p",{className:"mb-2",children:["For more details, read the"," ",s.jsx(vn,{className:"underline",href:"https://docs.owox.com/docs/destinations/supported-destinations/google-chat/?utm_source=owox_data_marts&utm_medium=destination_entity&utm_campaign=tooltip",children:"OWOX documentation"}),"."]})]})]})}const Gie={[je.GOOGLE_SHEETS]:Uie,[je.LOOKER_STUDIO]:Fie,[je.ODATA]:Vie,[je.EMAIL]:zie,[je.SLACK]:Hie,[je.MS_TEAMS]:$ie,[je.GOOGLE_CHAT]:Bie};function qie({destinationType:e}){const t=Gie[e];return s.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:s.jsx(t,{})})}function Zie({form:e,initialData:t}){const{flags:n}=Eg();return s.jsx(kt,{control:e.control,name:"type",render:({field:r})=>s.jsxs(_t,{children:[s.jsx(Rt,{tooltip:"Select the destination to send your data",children:"Destination Type"}),s.jsxs(Kr,{onValueChange:r.onChange,defaultValue:r.value,disabled:!!t,children:[s.jsx(Nt,{children:s.jsx(Wr,{className:"w-full",children:s.jsx(Yr,{placeholder:"Select a destination type"})})}),s.jsx(Qr,{children:s.jsx($g,{children:Hr.getAllTypes().map(({type:o,displayName:l,icon:c,status:d})=>{const f=d===us.COMING_SOON,h=d===us.CLOUD_ONLY&&Gre(n);return s.jsx(s.Fragment,{children:h?s.jsxs(bt,{children:[s.jsx(St,{asChild:!0,children:s.jsx("div",{children:s.jsx(Rn,{value:o,disabled:!0,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(c,{size:18}),l,s.jsx(gr,{variant:"secondary",children:"Cloud & Enterprise"})]})},o)})}),s.jsxs(Ct,{side:"left",align:"start",className:"w-[220px]",children:["Available only in"," ",s.jsxs(ha,{className:"inline-flex items-center gap-1 underline",target:"_blank",to:"https://docs.owox.com/docs/editions/owox-cloud-editions/?utm_source=owox_data_marts&utm_medium=destination_entity&utm_campaign=unavailable_select_item_tooltip",children:["Cloud edition",s.jsx(Fo,{className:"h-3 w-3"})]})," ","or with"," ",s.jsxs(ha,{className:"inline-flex items-center gap-1 underline",target:"_blank",to:"https://docs.owox.com/docs/editions/self-managed-editions/?utm_source=owox_data_marts&utm_medium=destination_entity&utm_campaign=unavailable_select_item_tooltip",children:["an Enterprise plan",s.jsx(Fo,{className:"h-3 w-3"})]}),"."]})]}):s.jsx(Rn,{value:o,disabled:f,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(c,{size:18}),l,f&&s.jsx(gr,{variant:"outline",children:d})]})},o)})})})})]}),s.jsx(wn,{children:s.jsx(qie,{destinationType:r.value})}),s.jsx(Ft,{})]})})}function Kie({initialData:e,onSubmit:t,onCancel:n,onDirtyChange:r}){const o=Xo({resolver:ll(OK),defaultValues:e??{title:"New Destination",type:je.GOOGLE_SHEETS},mode:"onTouched"}),l=o.watch("type");m.useEffect(()=>{r==null||r(o.formState.isDirty)},[o.formState.isDirty,r]);const c=async d=>{const{dirtyFields:f}=o.formState,h=XO(d);return f.credentials||delete h.credentials,t(h)};return s.jsx(rl,{...o,children:s.jsxs(Jo,{onSubmit:d=>{o.handleSubmit(c)(d)},children:[s.jsxs(al,{children:[s.jsx(kt,{control:o.control,name:"title",render:({field:d})=>s.jsxs(_t,{children:[s.jsx(Rt,{tooltip:"Name the destination to clarify its purpose",children:"Title"}),s.jsx(Nt,{children:s.jsx(Ht,{placeholder:"Enter title",...d})}),s.jsx(Ft,{})]})}),s.jsx(Zie,{form:o,initialData:e}),l===je.GOOGLE_SHEETS&&s.jsx(Die,{form:o}),l===je.LOOKER_STUDIO&&s.jsx(Mie,{form:o}),l===je.EMAIL&&s.jsx(Bm,{form:o,emailsFieldTitle:"Enter user emails list"}),l===je.SLACK&&s.jsx(Bm,{form:o,emailsFieldTitle:"Enter Slack channel emails list"}),l===je.MS_TEAMS&&s.jsx(Bm,{form:o,emailsFieldTitle:"Enter Microsoft Teams channel emails list"}),l===je.GOOGLE_CHAT&&s.jsx(Bm,{form:o,emailsFieldTitle:"Enter Google Chat channel emails list"})]}),s.jsxs(sl,{children:[s.jsxs(Se,{variant:"default",type:"submit",className:"w-full","aria-label":"Save",disabled:!o.formState.isDirty||o.formState.isSubmitting,children:[o.formState.isSubmitting&&s.jsx(Af,{className:"mr-2 h-4 w-4 animate-spin"}),"Save"]}),s.jsx(Se,{variant:"outline",type:"button",onClick:n,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function Yie({isOpen:e,onClose:t,dataDestination:n,onSaveSuccess:r}){const{updateDataDestination:o,createDataDestination:l}=Wf(),[c,d]=m.useState(!1),[f,h]=m.useState(!1),g=m.useCallback(()=>{f?d(!0):t()},[f,t]),y=m.useCallback(()=>{d(!1),h(!1),t()},[t]),v=m.useCallback(S=>{h(S)},[]),b=async S=>{const C=a3.getMapper(S.type);if(n){const R=C.mapToUpdateRequest(S),j=await o(n.id,R);j&&r(j)}else{const R=C.mapToCreateRequest(S),j=await l(R);j&&r(j)}t()},w=m.useRef(!1);return m.useEffect(()=>{const S=n?"Edit":"Create";e&&!w.current?(Ue({event:"data_destination_config_open",category:"DataDestination",action:S,label:n==null?void 0:n.type}),w.current=!0):!e&&w.current&&(Ue({event:"data_destination_config_close",category:"DataDestination",action:S,label:n==null?void 0:n.type}),w.current=!1)},[e,n]),s.jsxs(s.Fragment,{children:[s.jsx(Bo,{open:e,onOpenChange:S=>{S||g()},children:s.jsxs(Go,{children:[s.jsxs(qo,{children:[s.jsx(Zo,{children:"Configure destination"}),s.jsx(Xi,{children:"Customize settings for your destination"})]}),s.jsx(Kie,{initialData:n??void 0,onSubmit:b,onCancel:g,onDirtyChange:v})]})}),s.jsx(Tr,{open:c,onOpenChange:d,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:y,variant:"destructive"})]})}const Wie=({isCreateSheetInitiallyOpen:e=!1,onCreateSheetClose:t})=>{const{dataDestinations:n,currentDataDestination:r,clearCurrentDataDestination:o,fetchDataDestinations:l,getDataDestinationById:c,deleteDataDestination:d,rotateSecretKey:f}=Wf(),h=m.useCallback(()=>{o(),y(!0),t==null||t()},[o,t]),[g,y]=m.useState(!1),[v,b]=m.useState(!1),[w,S]=m.useState(!1),[C,R]=m.useState(null),[j,_]=m.useState(null);m.useEffect(()=>{l()},[l]),m.useEffect(()=>{e&&h()},[e,h]);const D=async J=>{await c(J),y(!0)},A=J=>{R(J),b(!0)},O=J=>{_(J),S(!0)},T=async()=>{if(j)try{const J=await f(j);if(ZS(J.credentials)){It.success("New JSON Config copied to clipboard");const H=kb(J.credentials);navigator.clipboard.writeText(H)}await l()}catch(J){console.error("Failed to rotate secret key:",J)}finally{S(!1),_(null)}},M=async()=>{if(C)try{await d(C),await l()}catch(J){console.error("Failed to delete destination:",J)}finally{b(!1),R(null)}},F=async()=>{try{y(!1),await l()}catch(J){console.error("Failed to save destination:",J)}},G=()=>{y(!1),o()},Y=n.map(J=>({id:J.id,title:J.title,type:J.type,createdAt:J.createdAt,modifiedAt:J.modifiedAt,credentials:J.credentials})),Z=Nie({onEdit:D,onDelete:A,onRotateSecretKey:O});return s.jsxs("div",{children:[s.jsx(jie,{columns:Z,data:Y,onEdit:D,onDelete:A,onRotateSecretKey:O,onOpenTypeDialog:h}),s.jsx(Yie,{isOpen:g,onClose:G,dataDestination:r,onSaveSuccess:()=>void F()}),s.jsx(Tr,{open:v,onOpenChange:b,title:"Delete Destination",description:"Are you sure you want to delete this destination? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{M()},onCancel:()=>{R(null)},variant:"destructive"}),s.jsx(Tr,{open:w,onOpenChange:S,title:"Rotate Secret Key",description:"Rotating the secret key will invalidate the previous key",confirmLabel:"Rotate Key",cancelLabel:"Cancel",onConfirm:()=>void T(),onCancel:()=>{S(!1)},variant:"destructive",children:s.jsxs("div",{className:"text-sm",children:[s.jsx("p",{className:"mb-2",children:"After rotation, you will need to:"}),s.jsxs("ol",{className:"mb-2 list-decimal pl-5",children:[s.jsx("li",{children:"The new JSON Config will be automatically copied to your clipboard"}),s.jsx("li",{children:"Go to your Looker Studio Connector"}),s.jsx("li",{children:"Update the configuration with the new JSON Config"}),s.jsx("li",{children:"Save the changes to restore access to your data marts"})]}),s.jsx("p",{className:"font-semibold",children:"Are you sure you want to rotate the secret key?"})]})})]})},Qie=()=>{const[e,t]=m.useState(!1);return s.jsxs("div",{className:"dm-page",children:[s.jsx("header",{className:"dm-page-header",children:s.jsx("h1",{className:"dm-page-header-title",children:"Destinations"})}),s.jsx("div",{className:"dm-page-content",children:s.jsx(Yf,{children:s.jsx(Wie,{isCreateSheetInitiallyOpen:e,onCreateSheetClose:()=>{t(!1)}})})})]})};function Xie({status:e}){switch(e){case ir.RUNNING:return s.jsx(gr,{variant:"secondary",className:"text-primary bg-primary/10",children:"Running"});case ir.SUCCESS:return s.jsx(gr,{variant:"secondary",className:"bg-green-50 text-green-600 dark:bg-green-950 dark:text-green-400",children:"Success"});case ir.FAILED:return s.jsx(gr,{variant:"secondary",className:"bg-red-50 text-red-600 dark:bg-red-950 dark:text-red-400",children:"Failed"});case ir.CANCELLED:return s.jsx(gr,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Cancelled"});case ir.INTERRUPTED:return s.jsx(gr,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Interrupted"});case ir.PENDING:return s.jsx(gr,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Pending"});default:return s.jsx(gr,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Unknown"})}}var $r=(e=>(e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.SYSTEM="SYSTEM",e))($r||{}),ds=(e=>(e.STRUCTURED="structured",e.RAW="raw",e.CONFIGURATION="configuration",e))(ds||{});const $T=(e,t,n=!1)=>{var c,d,f,h;const r=e.split(`
714
+ `).filter(g=>g.trim()!=="");if(r.length>=3){const g=r[0],y=r[1],v=r.slice(2).join(`
715
+ `);if(g.includes("T")&&g.includes("Z")){const b=x0(v);return{id:`log-${t.toString()}`,timestamp:Xc(g),level:n?$r.ERROR:$r.INFO,message:b.message,metadata:{at:(c=b.metadata)!=null&&c.at?Xc(b.metadata.at):Xc(g),type:((d=b.metadata)==null?void 0:d.type)??(y!=="unknown"?y:null)}}}}const o=/^\[(.*?)\]\s*\[(.*?)\]\s*(.*)$/.exec(e);if(o){const g=x0(o[3]);return{id:`log-${t.toString()}`,timestamp:Xc(o[1]),level:n?$r.ERROR:o[2],message:g.message,metadata:(f=g.metadata)!=null&&f.at?{...g.metadata,at:Xc(g.metadata.at)}:g.metadata}}const l=x0(e);return{id:`log-${t.toString()}`,timestamp:"N/A",level:n?$r.ERROR:$r.INFO,message:l.message,metadata:(h=l.metadata)!=null&&h.at?{...l.metadata,at:Xc(l.metadata.at)}:l.metadata}},x0=e=>{try{const t=JSON.parse(e);if(typeof t=="object"){const n={},r={...t};"type"in r&&(n.type=r.type,delete r.type),"at"in r&&(n.at=r.at,delete r.at);const o=Object.keys(r);if(o.length===1){const l=o[0],c=r[l];return{message:typeof c=="string"?c:JSON.stringify(c),metadata:Object.keys(n).length>0?n:void 0}}return{message:JSON.stringify(r,null,2),metadata:Object.keys(n).length>0?n:void 0}}}catch{}return{message:e}},E6=e=>{var t;return(t=e.metadata)!=null&&t.type?e.metadata.type:e.level},Jie=(e,t)=>{var c;let n="",r="";switch(e.type){case zr.CONNECTOR:n=t??"",r="connector";break;case zr.LOOKER_STUDIO:n="Looker Studio data fetching",r="report";break;case zr.GOOGLE_SHEETS_EXPORT:case zr.EMAIL:case zr.SLACK:case zr.MS_TEAMS:case zr.GOOGLE_CHAT:n=((c=e.reportDefinition)==null?void 0:c.title)??"",r="report";break}return[Bre(`${e.triggerType} ${r} run`.trim()),n].join(" • ")},ele=e=>{const t=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),n=URL.createObjectURL(t),r=document.createElement("a");r.href=n,r.download=`datamart-run-${e.id.slice(0,8)}-logs.json`,r.click(),URL.revokeObjectURL(n)},tle=e=>{const t=e.startedAt??e.createdAt;return Yg(t.toISOString())},nle=e=>{const t=BT(e.startedAt),n=BT(e.finishedAt);let r="";return e.startedAt&&e.finishedAt&&(r=YJ(e.startedAt,e.finishedAt)),{startedAt:t,finishedAt:n,duration:r}},BT=e=>e?Yg(e.toISOString()):"N/A";function rle({logViewType:e,setLogViewType:t,searchTerm:n,setSearchTerm:r,run:o,cancelDataMartRun:l,dataMartId:c}){const d=g=>{g.stopPropagation()},f=async g=>{if(g.stopPropagation(),c)try{await l(c,o.id),on.success("Data mart run cancelled successfully")}catch(y){on.error(y instanceof Error?y.message:"Failed to cancel data mart run")}},h=g=>`px-3 py-2 text-sm font-medium transition-colors rounded-none ${g?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-accent"}`;return s.jsxs("div",{className:"bg-background border-border flex items-center justify-between rounded-lg border p-3",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsxs("div",{className:"bg-background border-border flex items-center rounded-lg border",children:[s.jsx("button",{onClick:g=>{g.stopPropagation(),t(ds.STRUCTURED)},className:`${h(e===ds.STRUCTURED)} rounded-l-lg`,children:"Structured"}),s.jsx("button",{onClick:g=>{g.stopPropagation(),t(ds.RAW)},className:`${h(e===ds.RAW)} rounded-none`,children:"Raw"}),s.jsx("button",{onClick:g=>{g.stopPropagation(),t(ds.CONFIGURATION)},className:`${h(e===ds.CONFIGURATION)} rounded-r-lg`,children:"Configuration"})]}),e!==ds.CONFIGURATION&&s.jsxs("div",{className:"relative",children:[s.jsx(Jl,{className:"text-muted-foreground absolute top-2.5 left-2 h-4 w-4"}),s.jsx(Ht,{type:"text",placeholder:"Search logs...",value:n,onChange:g=>{r(g.target.value)},onClick:d,className:"border-input bg-background text-foreground placeholder:text-muted-foreground focus:ring-ring rounded-md border py-2 pr-4 pl-8 text-xs focus:border-transparent focus:ring-2 focus:outline-none"})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[o.status===ir.RUNNING&&s.jsxs(Se,{variant:"destructive",size:"sm",onClick:g=>void f(g),children:[s.jsx(xu,{className:"h-4 w-4"}),"Cancel"]}),s.jsxs(Se,{variant:"outline",size:"sm",onClick:g=>{g.stopPropagation(),ele(o)},className:"flex items-center gap-2",children:[s.jsx(hk,{className:"h-4 w-4"}),"JSON"]})]})]})}function ale(e){switch(e){case $r.INFO:return s.jsx(Br,{className:"h-3 w-3 text-blue-500"});case $r.WARNING:return s.jsx(ag,{className:"h-3 w-3 text-yellow-500"});case $r.ERROR:return s.jsx(dp,{className:"h-3 w-3 text-red-500"});case $r.SYSTEM:return s.jsx(Nf,{className:"text-muted-foreground h-3 w-3"});default:return s.jsx(Br,{className:"text-muted-foreground h-3 w-3"})}}function sle(e){switch(e){case $r.INFO:return"text-blue-600 dark:text-blue-400";case $r.WARNING:return"text-yellow-600 dark:text-yellow-400";case $r.ERROR:return"text-red-600 dark:text-red-400";case $r.SYSTEM:return"text-muted-foreground";default:return"text-muted-foreground"}}function ole(e){return e===zA.SCHEDULED?s.jsx(G1,{size:18}):s.jsx(Dk,{size:18})}function ile({logs:e}){const t=r=>{r.stopPropagation()},n=r=>{var o;return(o=r.metadata)!=null&&o.at?r.metadata.at:r.timestamp};return e.length===0?s.jsx("div",{className:"bg-background border-border rounded-lg border",children:s.jsx("div",{className:"text-muted-foreground p-8 text-center",children:"No logs found"})}):s.jsx("div",{className:"bg-background border-border rounded-lg border",children:s.jsx("div",{className:"max-h-96 overflow-y-auto",children:e.map((r,o)=>s.jsxs("div",{className:`border-border hover:bg-accent/30 flex items-start gap-3 border-b p-3 text-sm text-xs ${o===e.length-1?"border-b-0":""}`,onClick:t,children:[s.jsx("div",{className:"text-muted-foreground flex-shrink-0 font-mono text-xs",children:n(r)}),s.jsxs("div",{className:"flex min-w-0 flex-shrink-0 items-center gap-2",children:[ale(r.level),s.jsx("span",{className:`text-xs font-medium ${sle(r.level)}`,children:E6(r)})]}),s.jsx("div",{className:`min-w-0 flex-1 text-xs break-words ${r.level===$r.ERROR?"text-red-700 dark:text-red-300":"text-foreground"}`,children:r.message.includes(`
716
+ `)?s.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap",children:r.message}):s.jsx("span",{children:r.message})})]},r.id))})})}var Kp=(e=>(e.ERROR="error",e.DEFAULT="default",e))(Kp||{});function Yp({text:e,section:t,variant:n="default",copiedSection:r,onCopy:o,iconOnly:l=!1}){const c=n==="error",d=r===t,f="flex items-center gap-1 px-2 py-1 text-xs rounded transition-colors cursor-pointer",h=c?"text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-950/40":"text-foreground hover:bg-muted";return s.jsx("button",{onClick:g=>{o(e,t),g.stopPropagation()},className:`${f} ${h}`,title:`Copy ${t} to clipboard`,children:l?s.jsx(s.Fragment,{children:d?s.jsx(lr,{className:"h-3 w-3"}):s.jsx(df,{className:"h-3 w-3"})}):d?s.jsxs(s.Fragment,{children:[s.jsx(lr,{className:"h-3 w-3"}),"Copied"]}):s.jsxs(s.Fragment,{children:[s.jsx(df,{className:"h-3 w-3"}),"Copy"]})})}function KS(){const[e,t]=m.useState(null),n=async(o,l)=>{try{await navigator.clipboard.writeText(o),t(l),setTimeout(()=>{t(null)},2e3)}catch(c){console.error("Failed to copy text: ",c)}};return{copiedSection:e,copyToClipboard:n,handleCopy:(o,l)=>{n(o,l)}}}function lle({logs:e,errors:t}){const{copiedSection:n,handleCopy:r}=KS(),o=l=>{l.stopPropagation()};return s.jsxs("div",{className:"border-border space-y-4 rounded-lg border p-4",onClick:o,children:[t.length>0&&s.jsxs("div",{children:[s.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[s.jsxs("h4",{className:"flex items-center gap-2 text-sm font-medium text-red-600 dark:text-red-400",children:[s.jsx(Nf,{className:"h-4 w-4 text-red-500"}),"Error Output:"]}),s.jsx(Yp,{text:t.join(`
717
+ `),section:"errors",variant:Kp.ERROR,copiedSection:n,onCopy:r})]}),s.jsx("div",{className:"max-h-96 overflow-y-auto rounded-md bg-red-50 p-3 font-mono text-xs dark:border-red-800 dark:bg-red-950/40",children:t.map((l,c)=>s.jsx("div",{className:"mb-1 leading-relaxed text-red-700 dark:text-red-300",children:l},c))})]}),e.length>0&&s.jsxs("div",{children:[s.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[s.jsxs("h4",{className:"text-foreground flex items-center gap-2 text-sm font-medium",children:[s.jsx(Br,{className:"h-4 w-4 text-blue-500"}),"Standard Output:"]}),s.jsx(Yp,{text:e.join(`
718
+ `),section:"logs",variant:Kp.DEFAULT,copiedSection:n,onCopy:r})]}),s.jsx("div",{className:"bg-muted max-h-96 overflow-y-auto rounded-md p-3 font-mono text-xs dark:bg-white/3",children:e.map((l,c)=>s.jsx("div",{className:"mb-1 leading-relaxed",children:l},c))})]})]})}function cle({definitionRun:e,reportDefinition:t}){const{copiedSection:n,handleCopy:r}=KS(),o=l=>{l.stopPropagation()};return s.jsx("div",{className:"border-border rounded-lg border",onClick:o,children:e!=null?s.jsxs("div",{className:"p-4",children:[s.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[s.jsx("h4",{className:"text-foreground text-sm font-medium",children:"Configuration:"}),s.jsx(Yp,{text:JSON.stringify(e,null,2),section:"configuration",variant:Kp.DEFAULT,copiedSection:n,onCopy:r})]}),s.jsx("pre",{className:"bg-muted text-foreground overflow-x-auto rounded p-3 font-mono text-xs whitespace-pre-wrap dark:bg-white/3",children:JSON.stringify(e,null,2)}),t&&s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"text-foreground mt-3 mb-3 text-sm font-medium",children:"Report definition:"}),s.jsx("pre",{className:"bg-muted text-foreground overflow-x-auto rounded p-3 font-mono text-xs whitespace-pre-wrap dark:bg-white/3",children:JSON.stringify(t,null,2)})]})]}):s.jsx("div",{className:"text-muted-foreground p-8 text-center",children:"No configuration data available for this run"})})}const jo=18;function ule({type:e,base64Icon:t}){switch(e){case zr.CONNECTOR:return t?s.jsx(rc,{base64:t,size:jo}):s.jsx(zl,{size:jo});case zr.GOOGLE_SHEETS_EXPORT:{const n=Hr.getInfo(je.GOOGLE_SHEETS).icon;return s.jsx(n,{size:jo})}case zr.LOOKER_STUDIO:{const n=Hr.getInfo(je.LOOKER_STUDIO).icon;return s.jsx(n,{size:jo})}case zr.EMAIL:{const n=Hr.getInfo(je.EMAIL).icon;return s.jsx(n,{size:jo})}case zr.SLACK:{const n=Hr.getInfo(je.SLACK).icon;return s.jsx(n,{size:jo})}case zr.MS_TEAMS:{const n=Hr.getInfo(je.MS_TEAMS).icon;return s.jsx(n,{size:jo})}case zr.GOOGLE_CHAT:{const n=Hr.getInfo(je.GOOGLE_CHAT).icon;return s.jsx(n,{size:jo})}default:return s.jsx(zl,{size:jo})}}function dle({run:e,isExpanded:t,onToggle:n,logViewType:r,setLogViewType:o,searchTerm:l,setSearchTerm:c,cancelDataMartRun:d,dataMartId:f,dataMartConnectorInfo:h}){const{copiedSection:g,handleCopy:y}=KS(),v=m.useMemo(()=>{if(e.logs.length===0&&e.errors.length===0)return[];const C=e.logs.map((_,D)=>$T(_,D)),R=e.errors.map((_,D)=>$T(_,e.logs.length+D,!0));return[...C,...R].filter(_=>{const D=E6(_);return l===""||_.message.toLowerCase().includes(l.toLowerCase())||D.toLowerCase().includes(l.toLowerCase())})},[e.logs,e.errors,l]),b=m.useCallback(()=>r===ds.STRUCTURED?s.jsx(ile,{logs:v}):r===ds.RAW?s.jsx(lle,{logs:e.logs,errors:e.errors}):s.jsx(cle,{definitionRun:e.definitionRun,reportDefinition:e.reportDefinition}),[r,v,e.logs,e.errors,e.definitionRun,e.reportDefinition]),w=tle(e),S=nle(e);return s.jsxs("div",{className:"dm-card-block",children:[s.jsxs("div",{className:"flex cursor-pointer items-center justify-between",onClick:()=>{n(e.id)},children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{children:s.jsx(ule,{type:e.type,base64Icon:h==null?void 0:h.logoBase64})}),s.jsxs(bt,{children:[s.jsx(St,{asChild:!0,children:s.jsx("div",{className:"text-foreground align-center flex items-center font-mono text-sm font-medium",children:w})}),s.jsx(Ct,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{children:["Started At: ",S.startedAt]}),s.jsxs("div",{children:["Finished At: ",S.finishedAt]}),S.duration&&s.jsxs("div",{children:["Duration: ",S.duration]})]})})]}),s.jsxs("div",{className:"text-muted-foreground ml-6 flex items-center gap-1 text-sm",children:[ole(e.triggerType),Jie(e,h==null?void 0:h.displayName)]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Xie,{status:e.status}),s.jsx(La,{className:`text-muted-foreground h-4 w-4 transition-transform ${t?"rotate-90":""}`})]})]}),t&&s.jsxs("div",{className:"border-border bg-muted/30 space-y-4 border-t p-4",children:[s.jsxs("div",{className:"flex items-center",children:[s.jsxs("h3",{className:"text-foreground mr-2 font-medium",children:["Run ID: ",e.id]}),s.jsx(Yp,{text:e.id,section:"run-id",onCopy:y,copiedSection:g,iconOnly:!0})]}),s.jsx(rle,{logViewType:r,setLogViewType:o,searchTerm:l,setSearchTerm:c,run:e,cancelDataMartRun:d,dataMartId:f}),b()]})]})}function fle(){const{dataMart:t,getDataMartRuns:n,loadMoreDataMartRuns:r,cancelDataMartRun:o,runs:l=[],isLoading:c}=Ia(),[d,f]=m.useState(!1),[h,g]=m.useState(!0),[y,v]=m.useState(0),[b,w]=m.useState(null),[S,C]=m.useState(ds.STRUCTURED),[R,j]=m.useState(""),_=m.useCallback(async()=>{if(!(t!=null&&t.id))return;const T=await n(t.id,20,0);v(T.length),g(T.length===20)},[t==null?void 0:t.id,n,20]),D=m.useCallback(async()=>{if(!(t!=null&&t.id)||d)return;f(!0);const T=await r(t.id,y,20);v(M=>M+T.length),g(T.length===20),f(!1)},[t==null?void 0:t.id,r,y,d,20]);m.useEffect(()=>{t!=null&&t.id&&_()},[t==null?void 0:t.id,_]);const A=m.useMemo(()=>(t==null?void 0:t.definitionType)===Fe.CONNECTOR&&t.definition&&"connector"in t.definition?t.definition.connector.info??null:null,[t]),O=T=>{w(b===T?null:T)};return c?s.jsx(v6,{}):s.jsx("div",{className:"flex flex-col gap-4 pb-4",children:l.length===0?s.jsx("div",{className:"text-muted-foreground py-8 text-center",children:"No runs found for this Data Mart"}):s.jsxs("div",{className:"space-y-2",children:[l.map(T=>s.jsx(dle,{run:T,isExpanded:b===T.id,onToggle:O,logViewType:S,setLogViewType:C,searchTerm:R,setSearchTerm:j,cancelDataMartRun:o,dataMartId:t==null?void 0:t.id,dataMartConnectorInfo:A},T.id)),h&&s.jsx("div",{className:"flex justify-center pt-4",children:s.jsx(pu,{variant:"outline",size:"sm",onClick:()=>void D(),disabled:d,className:"flex items-center gap-2",children:d?s.jsxs(s.Fragment,{children:[s.jsx(lL,{className:"h-4 w-4 animate-spin"}),"Loading..."]}):"Load More"})})]})})}const hle=5e3,mle=20;function ple(){const{dataMart:e,getDataMartRuns:t}=Qo(),n=m.useMemo(()=>e!=null&&e.id?`data-mart-run-history-auto-refresh-${e.id}`:"",[e==null?void 0:e.id]),[r,o]=m.useState(()=>n?Hs.get(n,"boolean")??!1:!1);return m.useEffect(()=>{n&&Hs.set(n,r)},[r,n]),x6({enabled:!!(e!=null&&e.id)&&r,intervalMs:hle,onTick:()=>{e!=null&&e.id&&t(e.id,mle,0,{silent:!0})}}),s.jsx("div",{className:"flex flex-col gap-4",children:s.jsxs(Vl,{collapsible:!1,name:"run-history",children:[s.jsxs(Po,{children:[s.jsx(Lo,{icon:Mk,tooltip:"View all Data Mart execution runs with detailed logs and errors",children:"Run History"}),s.jsx(oh,{children:s.jsxs("div",{className:"flex items-center gap-2 pl-3",children:[s.jsx(l6,{id:`run-history-auto-refresh-${(e==null?void 0:e.id)??"unknown"}`,checked:r,onCheckedChange:l=>{o(!!l)},"aria-label":"Auto refresh"}),s.jsx("label",{htmlFor:`run-history-auto-refresh-${(e==null?void 0:e.id)??"unknown"}`,className:"text-sm",children:"Auto refresh"})]})})]}),s.jsx(Uo,{children:s.jsx(fle,{})})]})})}const gle=[{path:"overview",element:s.jsx(VT,{})},{path:"data-setup",element:s.jsx(goe,{})},{path:"reports",element:s.jsx(pie,{})},{path:"triggers",element:s.jsx(gie,{})},{path:"run-history",element:s.jsx(ple,{})},{index:!0,element:s.jsx(VT,{})}];function yle({to:e="/data-marts"}){const{user:t,status:n}=el();if(n===Ir.LOADING)return s.jsx(hu,{fullScreen:!0,message:"Loading..."});if(n===Ir.UNAUTHENTICATED||!t)return s.jsx(hu,{fullScreen:!0,message:"Authentication..."});if(t.projectId){const r=Cp(t.projectId,e);return s.jsx(MI,{to:r,replace:!0})}return s.jsx(hu,{fullScreen:!0,message:"Project not found"})}const vle=[{index:!0,path:"/",element:s.jsx(yle,{})},{path:"/ui/:projectId",element:s.jsx(RZ,{}),children:[{path:"about",element:s.jsx(jZ,{})},{index:!0,element:s.jsx(Vj,{})},{path:"data-marts",element:s.jsx(Vj,{})},{path:"data-marts/create",element:s.jsx(yie,{})},{path:"data-marts/:id",element:s.jsx(coe,{}),children:gle},{path:"data-storages",element:s.jsx(wie,{})},{path:"data-destinations",element:s.jsx(Qie,{})},{path:"*",element:s.jsx(Ij,{})}]},{path:"*",element:s.jsx(Ij,{})}],w6="gtm-script",R6="gtm-noscript",xle="GOOGLE_TAG_MANAGER_CONTAINER_ID";function ble(){return!!document.getElementById(w6)}function Sle(e){const t=document.createElement("script");return t.id=w6,t.innerHTML=`
719
+ (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
720
+ new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
721
+ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
722
+ 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
723
+ })(window,document,'script','dataLayer','${e}');
724
+ `,t}function Cle(e){const t=document.createElement("noscript");return t.id=R6,t.innerHTML=`
725
+ <iframe src="https://www.googletagmanager.com/ns.html?id=${e}"
726
+ height="0"
727
+ width="0"
728
+ style="display:none;visibility:hidden">
729
+ </iframe>
730
+ `,t}function Ele(e){if(ble())return;const t=Sle(e);document.head.prepend(t)}function wle(e){if(document.getElementById(R6))return;const t=Cle(e);document.body.firstChild?document.body.insertBefore(t,document.body.firstChild):document.body.appendChild(t)}function Rle(e){try{Ele(e),wle(e)}catch(t){console.warn("Failed to initialize Google Tag Manager:",t)}}function jle(e){return(e[xle]??"").trim()}function Tle(){const{flags:e,callState:t}=Eg();return m.useEffect(()=>{if(t!==kr.LOADED||!e)return;const n=jle(e);n&&Rle(n)},[e,t]),null}const _le="INTERCOM_APP_ID",j6="intercom-widget-script";function Nle(){return!!document.getElementById(j6)}function Ale(e,t){if(Nle()){t();return}const n=document.createElement("script");n.id=j6,n.src=`https://widget.intercom.io/widget/${e}`,n.async=!0,n.onload=()=>{t()},document.head.appendChild(n)}async function Dle(){try{return(await ca.post("/intercom/jwt")).data.token}catch(e){return console.warn("Failed to fetch Intercom JWT",e),null}}function Ole(e,t){const n={app_id:e,user_id:t.id};return t.email&&(n.email=t.email),t.fullName&&(n.name=t.fullName),t.projectTitle&&(n.Name_project=t.projectTitle),n}async function Mle(e,t){if(!t)return;const n=Ole(e,t),r=await Dle();if(r){n.intercom_user_jwt=r;try{window.Intercom&&window.Intercom("boot",n)}catch(o){console.warn("Failed to boot Intercom",o)}}}function Ile(){const{flags:e,callState:t}=Eg(),{user:n}=el(),r=m.useRef(!1);return m.useEffect(()=>{if(r.current||t!==kr.LOADED||!e)return;const o=e[_le],l=(typeof o=="string"?o:"").trim();l&&Ale(l,()=>{Mle(l,n).then(()=>{r.current=!0,C1()})})},[e,t,n]),null}function kle({initialState:e,reducer:t,children:n}){const[r,o]=m.useReducer(t,e),l=m.useMemo(()=>o,[o]);return s.jsx($4.Provider,{value:r,children:s.jsx(B4.Provider,{value:l,children:n})})}function Lle(e){return(t,n)=>{const r={...t};return Object.keys(e).forEach(o=>{const l=e[o],c=t[o],d=l(c,n);d!==c&&(r[o]=d)}),r}}const GT={id:null,title:null},T6="project/SET_PROJECT",Ple="project/CLEAR_PROJECT";function Ule(e){return{type:T6,payload:e}}function Fle(e=GT,t){switch(t.type){case T6:{const{id:n,title:r}=t.payload;return{id:n,title:r??null}}case Ple:return{...GT};default:return e}}class Vle extends ac{getFlags(){return this.get("/flags")}}const zle=new Vle(""),_6={LICENSED_APP_EDITION:"COMMUNITY",MENU_GITHUB_COMMUNITY_VISIBLE:"true",MENU_UPGRADE_OPTIONS_VISIBLE:"true",MENU_FEEDBACK_VISIBLE:"true",MENU_ISSUES_VISIBLE:"true",MENU_LICENSE_VISIBLE:"true",MENU_DOCUMENTATION_COMMUNITY_EDITION_VISIBLE:"true",MENU_SLACK_COMMUNITY_VISIBLE:"true"},Hle={data:{..._6},callState:kr.IDLE},N6="settings/LOAD_FLAGS",A6="settings/LOAD_FLAGS_SUCCESS",D6="settings/LOAD_FLAGS_ERROR";function $le(){return{type:N6}}function Ble(e){return{type:A6,payload:e}}function Gle(e){return{type:D6,payload:e}}function qle(e=Hle,t){switch(t.type){case N6:return{...e,callState:kr.LOADING,error:void 0};case A6:return{...e,callState:kr.LOADED,data:{..._6,...t.payload}};case D6:return{...e,callState:kr.ERROR,error:t.payload};default:return e}}async function Zle(e){try{e($le());const t=await zle.getFlags();e(Ble(t))}catch(t){const n=t instanceof Error?t.message:"Failed to load settings";e(Gle(n))}}const O6="app/SET_READY";function Kle(e={ready:!1},t){switch(t.type){case O6:return{...e,ready:!!t.payload};default:return e}}const Yle=Lle({project:Fle,flags:qle,app:Kle});function Wle({children:e}){return s.jsx(kle,{reducer:Yle,initialState:{project:{id:null,title:null},flags:{data:null,callState:kr.IDLE},app:{ready:!1}},children:e})}function Qle({children:e}){const t=n$(),{user:n,status:r}=el(),o=bp(f=>f.flags),l=o.callState,c=bp(f=>f.app.ready);m.useEffect(()=>{r===Ir.AUTHENTICATED&&(n!=null&&n.projectId)&&(t(Ule({id:n.projectId,title:n.projectTitle??null})),l===kr.IDLE&&Zle(t))},[r,n==null?void 0:n.projectId,n==null?void 0:n.projectTitle,l,t]),m.useEffect(()=>{const f=r===Ir.AUTHENTICATED&&!!(n!=null&&n.projectId)&&l===kr.LOADED;t({type:O6,payload:f})},[r,n==null?void 0:n.projectId,l,t]);const d=m.useMemo(()=>s.jsx(hu,{fullScreen:!0,message:"Loading application..."}),[]);return c?s.jsx(s.Fragment,{children:e}):l===kr.ERROR?s.jsx(hu,{fullScreen:!0,message:`Failed to load app flags: ${o.error??""}`}):d}function Xle(){const e=a7(vle);return s.jsx(KB,{children:s.jsx(Wle,{children:s.jsxs(Qle,{children:[s.jsx(Tle,{}),s.jsx(Ile,{}),s.jsx(y7,{router:e})]})})})}const M6=document.getElementById("root");if(!M6)throw new Error("Root element not found");XM.createRoot(M6).render(s.jsx(m.StrictMode,{children:s.jsx(Xle,{})}));