@owox/web 0.13.0-next-20251119104944 → 0.13.0-next-20251119115009
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,730 +0,0 @@
|
|
|
1
|
-
var bI=Object.defineProperty;var SI=(e,t,n)=>t in e?bI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ns=(e,t,n)=>SI(e,typeof t!="symbol"?t+"":t,n);function CI(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const l=Object.getOwnPropertyDescriptor(r,s);l&&Object.defineProperty(e,s,l.get?l:{enumerable:!0,get:()=>r[s]})}}}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 s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const l of s)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(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(s){if(s.ep)return;s.ep=!0;const l=n(s);fetch(s.href,l)}})();function Aj(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ax={exports:{}},_d={};/**
|
|
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 S2;function EI(){if(S2)return _d;S2=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,l){var c=null;if(l!==void 0&&(c=""+l),s.key!==void 0&&(c=""+s.key),"key"in s){l={};for(var d in s)d!=="key"&&(l[d]=s[d])}else l=s;return s=l.ref,{$$typeof:e,type:r,key:c,ref:s!==void 0?s:null,props:l}}return _d.Fragment=t,_d.jsx=n,_d.jsxs=n,_d}var C2;function wI(){return C2||(C2=1,ax.exports=EI()),ax.exports}var o=wI(),sx={exports:{}},dt={};/**
|
|
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 E2;function RI(){if(E2)return dt;E2=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=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(){}},E=Object.assign,S={};function R(L,P,q){this.props=L,this.context=P,this.refs=S,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 T(){}T.prototype=R.prototype;function _(L,P,q){this.props=L,this.context=P,this.refs=S,this.updater=q||w}var D=_.prototype=new T;D.constructor=_,E(D,R.prototype),D.isPureReactComponent=!0;var A=Array.isArray;function O(){}var j={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 ee=/\/+/g;function $(L,P){return typeof L=="object"&&L!==null&&L.key!=null?Z(""+L.key):P.toString(36)}function W(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===""?"."+$(L,0):te,A(ue)?(q="",le!=null&&(q=le.replace(ee,"$&/")+"/"),k(ue,P,q,"",function(_e){return _e})):ue!=null&&(Y(ue)&&(ue=G(ue,q+(ue.key==null||L&&L.key===ue.key?"":(""+ue.key).replace(ee,"$&/")+"/")+le)),P.push(ue)),1;le=0;var Ne=te===""?".":te+":";if(A(L))for(var we=0;we<L.length;we++)te=L[we],ve=Ne+$(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=Ne+$(te,we++),le+=k(te,P,q,ve,ue);else if(ve==="object"){if(typeof L.then=="function")return k(W(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 H(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:H,forEach:function(L,P,q){H(L,function(){P.apply(this,arguments)},q)},count:function(L){var P=0;return H(L,function(){P++}),P},toArray:function(L){return H(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 dt.Activity=y,dt.Children=xe,dt.Component=R,dt.Fragment=n,dt.Profiler=s,dt.PureComponent=_,dt.StrictMode=r,dt.Suspense=f,dt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,dt.__COMPILER_RUNTIME={__proto__:null,c:function(L){return j.H.useMemoCache(L)}},dt.cache=function(L){return function(){return L.apply(null,arguments)}},dt.cacheSignal=function(){return null},dt.cloneElement=function(L,P,q){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var te=E({},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),Ne=0;Ne<ve;Ne++)le[Ne]=arguments[Ne+2];te.children=le}return F(L.type,ue,te)},dt.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},dt.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 Ne=Array(le),we=0;we<le;we++)Ne[we]=arguments[we+2];ue.children=Ne}if(L&&L.defaultProps)for(te in le=L.defaultProps,le)ue[te]===void 0&&(ue[te]=le[te]);return F(L,ve,ue)},dt.createRef=function(){return{current:null}},dt.forwardRef=function(L){return{$$typeof:d,render:L}},dt.isValidElement=Y,dt.lazy=function(L){return{$$typeof:g,_payload:{_status:-1,_result:L},_init:B}},dt.memo=function(L,P){return{$$typeof:h,type:L,compare:P===void 0?null:P}},dt.startTransition=function(L){var P=j.T,q={};j.T=q;try{var te=L(),ue=j.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),j.T=P}},dt.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},dt.use=function(L){return j.H.use(L)},dt.useActionState=function(L,P,q){return j.H.useActionState(L,P,q)},dt.useCallback=function(L,P){return j.H.useCallback(L,P)},dt.useContext=function(L){return j.H.useContext(L)},dt.useDebugValue=function(){},dt.useDeferredValue=function(L,P){return j.H.useDeferredValue(L,P)},dt.useEffect=function(L,P){return j.H.useEffect(L,P)},dt.useEffectEvent=function(L){return j.H.useEffectEvent(L)},dt.useId=function(){return j.H.useId()},dt.useImperativeHandle=function(L,P,q){return j.H.useImperativeHandle(L,P,q)},dt.useInsertionEffect=function(L,P){return j.H.useInsertionEffect(L,P)},dt.useLayoutEffect=function(L,P){return j.H.useLayoutEffect(L,P)},dt.useMemo=function(L,P){return j.H.useMemo(L,P)},dt.useOptimistic=function(L,P){return j.H.useOptimistic(L,P)},dt.useReducer=function(L,P,q){return j.H.useReducer(L,P,q)},dt.useRef=function(L){return j.H.useRef(L)},dt.useState=function(L){return j.H.useState(L)},dt.useSyncExternalStore=function(L,P,q){return j.H.useSyncExternalStore(L,P,q)},dt.useTransition=function(){return j.H.useTransition()},dt.version="19.2.0",dt}var w2;function pb(){return w2||(w2=1,sx.exports=RI()),sx.exports}var p=pb();const ye=Aj(p),gb=CI({__proto__:null,default:ye},[p]);var ox={exports:{}},Nd={},ix={exports:{}},lx={};/**
|
|
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 R2;function TI(){return R2||(R2=1,(function(e){function t(k,H){var B=k.length;k.push(H);e:for(;0<B;){var ie=B-1>>>1,xe=k[ie];if(0<s(xe,H))k[ie]=H,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 H=k[0],B=k.pop();if(B!==H){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>s(q,B))te<xe&&0>s(ue,q)?(k[ie]=ue,k[te]=B,ie=te):(k[ie]=q,k[P]=B,ie=P);else if(te<xe&&0>s(ue,B))k[ie]=ue,k[te]=B,ie=te;else break e}}return H}function s(k,H){var B=k.sortIndex-H.sortIndex;return B!==0?B:k.id-H.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,E=!1,S=!1,R=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function D(k){for(var H=n(h);H!==null;){if(H.callback===null)r(h);else if(H.startTime<=k)r(h),H.sortIndex=H.expirationTime,t(f,H);else break;H=n(h)}}function A(k){if(E=!1,D(k),!w)if(n(f)!==null)w=!0,O||(O=!0,Z());else{var H=n(h);H!==null&&W(A,H.startTime-k)}}var O=!1,j=-1,M=5,F=-1;function G(){return S?!0:!(e.unstable_now()-F<M)}function Y(){if(S=!1,O){var k=e.unstable_now();F=k;var H=!0;try{e:{w=!1,E&&(E=!1,T(j),j=-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),H=!0;break t}y===n(f)&&r(f),D(k)}else r(f);y=n(f)}if(y!==null)H=!0;else{var L=n(h);L!==null&&W(A,L.startTime-k),H=!1}}break e}finally{y=null,v=B,b=!1}H=void 0}}finally{H?Z():O=!1}}}var Z;if(typeof _=="function")Z=function(){_(Y)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,$=ee.port2;ee.port1.onmessage=Y,Z=function(){$.postMessage(null)}}else Z=function(){R(Y,0)};function W(k,H){j=R(function(){k(e.unstable_now())},H)}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 H=3;break;default:H=v}var B=v;v=H;try{return k()}finally{v=B}},e.unstable_requestPaint=function(){S=!0},e.unstable_runWithPriority=function(k,H){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var B=v;v=k;try{return H()}finally{v=B}},e.unstable_scheduleCallback=function(k,H,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:H,priorityLevel:k,startTime:B,expirationTime:xe,sortIndex:-1},B>ie?(k.sortIndex=B,t(h,k),n(f)===null&&k===n(h)&&(E?(T(j),j=-1):E=!0,W(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 H=v;return function(){var B=v;v=H;try{return k.apply(this,arguments)}finally{v=B}}}})(lx)),lx}var T2;function jI(){return T2||(T2=1,ix.exports=TI()),ix.exports}var cx={exports:{}},Nr={};/**
|
|
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 j2;function _I(){if(j2)return Nr;j2=1;var e=pb();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},s=Symbol.for("react.portal");function l(f,h,g){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,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 Nr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Nr.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)},Nr.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()}},Nr.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))},Nr.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},Nr.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})}},Nr.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)},Nr.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})}},Nr.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)},Nr.requestFormReset=function(f){r.d.r(f)},Nr.unstable_batchedUpdates=function(f,h){return f(h)},Nr.useFormState=function(f,h,g){return c.H.useFormState(f,h,g)},Nr.useFormStatus=function(){return c.H.useHostTransitionStatus()},Nr.version="19.2.0",Nr}var _2;function Dj(){if(_2)return cx.exports;_2=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(),cx.exports=_I(),cx.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 N2;function NI(){if(N2)return Nd;N2=1;var e=jI(),t=pb(),n=Dj();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 s(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,m=i;;){var x=u.return;if(x===null)break;var C=x.alternate;if(C===null){if(m=x.return,m!==null){u=m;continue}break}if(x.child===C.child){for(C=x.child;C;){if(C===u)return f(x),a;if(C===m)return f(x),i;C=C.sibling}throw Error(r(188))}if(u.return!==m.return)u=x,m=C;else{for(var N=!1,I=x.child;I;){if(I===u){N=!0,u=x,m=C;break}if(I===m){N=!0,m=x,u=C;break}I=I.sibling}if(!N){for(I=C.child;I;){if(I===u){N=!0,u=C,m=x;break}if(I===m){N=!0,m=C,u=x;break}I=I.sibling}if(!N)throw Error(r(189))}}if(u.alternate!==m)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"),E=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),T=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"),j=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 ee=Symbol.for("react.client.reference");function $(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===ee?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case E:return"Fragment";case R:return"Profiler";case S: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 T: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 j:return i=a.displayName||null,i!==null?i:$(a.type)||"Memo";case M:i=a._payload,a=a._init;try{return $(a(i))}catch{}}return null}var W=Array.isArray,k=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=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 Ne(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)?Bw(a):0;break;default:if(a=i.tagName,i=i.namespaceURI)i=Bw(i),a=Gw(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 _e(a){a.memoizedState!==null&&q(le,a);var i=te.current,u=Gw(i,a.type);i!==u&&(q(ue,a),q(te,u))}function He(a){ue.current===a&&(P(te),P(ue)),le.current===a&&(P(le),wd._currentValue=B)}var We,Ft;function jt(a){if(We===void 0)try{throw Error()}catch(u){var i=u.stack.trim().match(/\n( *(at )?)/);We=i&&i[1]||"",Ft=-1<u.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+We+a+Ft}var Bt=!1;function xn(a,i){if(!a||Bt)return"";Bt=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={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]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var x=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");x&&x.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var C=m.DetermineComponentFrameRoot(),N=C[0],I=C[1];if(N&&I){var V=N.split(`
|
|
44
|
-
`),ae=I.split(`
|
|
45
|
-
`);for(x=m=0;m<V.length&&!V[m].includes("DetermineComponentFrameRoot");)m++;for(;x<ae.length&&!ae[x].includes("DetermineComponentFrameRoot");)x++;if(m===V.length||x===ae.length)for(m=V.length-1,x=ae.length-1;1<=m&&0<=x&&V[m]!==ae[x];)x--;for(;1<=m&&0<=x;m--,x--)if(V[m]!==ae[x]){if(m!==1||x!==1)do if(m--,x--,0>x||V[m]!==ae[x]){var he=`
|
|
46
|
-
`+V[m].replace(" at new "," at ");return a.displayName&&he.includes("<anonymous>")&&(he=he.replace("<anonymous>",a.displayName)),he}while(1<=m&&0<=x);break}}}finally{Bt=!1,Error.prepareStackTrace=u}return(u=a?a.displayName||a.name:"")?jt(u):""}function jr(a,i){switch(a.tag){case 26:case 27:case 5:return jt(a.type);case 16:return jt("Lazy");case 13:return a.child!==i&&i!==null?jt("Suspense Fallback"):jt("Suspense");case 19:return jt("SuspenseList");case 0:case 15:return xn(a.type,!1);case 11:return xn(a.type.render,!1);case 1:return xn(a.type,!0);case 31:return jt("Activity");default:return""}}function aa(a){try{var i="",u=null;do i+=jr(a,u),u=a,a=a.return;while(a);return i}catch(m){return`
|
|
47
|
-
Error generating stack: `+m.message+`
|
|
48
|
-
`+m.stack}}var Fe=Object.prototype.hasOwnProperty,U=e.unstable_scheduleCallback,Q=e.unstable_cancelCallback,de=e.unstable_shouldYield,je=e.unstable_requestPaint,be=e.unstable_now,Ee=e.unstable_getCurrentPriorityLevel,Ye=e.unstable_ImmediatePriority,st=e.unstable_UserBlockingPriority,ot=e.unstable_NormalPriority,mn=e.unstable_LowPriority,Na=e.unstable_IdlePriority,pn=e.log,zo=e.unstable_setDisableYieldValue,Dn=null,bn=null;function hr(a){if(typeof pn=="function"&&zo(a),bn&&typeof bn.setStrictMode=="function")try{bn.setStrictMode(Dn,a)}catch{}}var Sn=Math.clz32?Math.clz32:Vo,Wi=Math.log,Cs=Math.LN2;function Vo(a){return a>>>=0,a===0?32:31-(Wi(a)/Cs|0)|0}var Ys=256,Es=262144,gn=4194304;function dn(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 Vn(a,i,u){var m=a.pendingLanes;if(m===0)return 0;var x=0,C=a.suspendedLanes,N=a.pingedLanes;a=a.warmLanes;var I=m&134217727;return I!==0?(m=I&~C,m!==0?x=dn(m):(N&=I,N!==0?x=dn(N):u||(u=I&~a,u!==0&&(x=dn(u))))):(I=m&~C,I!==0?x=dn(I):N!==0?x=dn(N):u||(u=m&~a,u!==0&&(x=dn(u)))),x===0?0:i!==0&&i!==x&&(i&C)===0&&(C=x&-x,u=i&-i,C>=u||C===32&&(u&4194048)!==0)?i:x}function mr(a,i){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&i)===0}function Qn(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 On(){var a=gn;return gn<<=1,(gn&62914560)===0&&(gn=4194304),a}function _r(a){for(var i=[],u=0;31>u;u++)i.push(a);return i}function Br(a,i){a.pendingLanes|=i,i!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function z(a,i,u,m,x,C){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,V=a.expirationTimes,ae=a.hiddenUpdates;for(u=N&~u;0<u;){var he=31-Sn(u),pe=1<<he;I[he]=0,V[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}m!==0&&X(a,m,0),C!==0&&x===0&&a.tag!==0&&(a.suspendedLanes|=C&~(N&~i))}function X(a,i,u){a.pendingLanes|=i,a.suspendedLanes&=~i;var m=31-Sn(i);a.entangledLanes|=i,a.entanglements[m]=a.entanglements[m]|1073741824|u&261930}function se(a,i){var u=a.entangledLanes|=i;for(a=a.entanglements;u;){var m=31-Sn(u),x=1<<m;x&i|a[m]&i&&(a[m]|=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 ke(){var a=H.p;return a!==0?a:(a=window.event,a===void 0?32:m2(a.type))}function Me(a,i){var u=H.p;try{return H.p=a,i()}finally{H.p=u}}var Le=Math.random().toString(36).slice(2),Ve="__reactFiber$"+Le,Ge="__reactProps$"+Le,qe="__reactContainer$"+Le,ct="__reactEvents$"+Le,Wt="__reactListeners$"+Le,$n="__reactHandles$"+Le,cr="__reactResources$"+Le,Gt="__reactMarker$"+Le;function qt(a){delete a[Ve],delete a[Ge],delete a[ct],delete a[Wt],delete a[$n]}function Gr(a){var i=a[Ve];if(i)return i;for(var u=a.parentNode;u;){if(i=u[qe]||u[Ve]){if(u=i.alternate,i.child!==null||u!==null&&u.child!==null)for(a=Xw(a);a!==null;){if(u=a[Ve])return u;a=Xw(a)}return i}a=u,u=a.parentNode}return null}function Aa(a){if(a=a[Ve]||a[qe]){var i=a.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return a}return null}function qr(a){var i=a.tag;if(i===5||i===26||i===27||i===6)return a.stateNode;throw Error(r(33))}function pr(a){var i=a[cr];return i||(i=a[cr]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Cn(a){a[Gt]=!0}var $o=new Set,ws={};function Da(a,i){es(a,i),es(a+"Capture",i)}function es(a,i){for(ws[a]=i,a=0;a<i.length;a++)$o.add(i[a])}var _t=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]*$"),Xn={},Ws={};function Qs(a){return Fe.call(Ws,a)?!0:Fe.call(Xn,a)?!1:_t.test(a)?Ws[a]=!0:(Xn[a]=!0,!1)}function fn(a,i,u){if(Qs(i))if(u===null)a.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":a.removeAttribute(i);return;case"boolean":var m=i.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){a.removeAttribute(i);return}}a.setAttribute(i,""+u)}}function Xs(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 Oa(a,i,u,m){if(m===null)a.removeAttribute(u);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(u);return}a.setAttributeNS(i,u,""+m)}}function Zr(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function LS(a){var i=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function hM(a,i,u){var m=Object.getOwnPropertyDescriptor(a.constructor.prototype,i);if(!a.hasOwnProperty(i)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var x=m.get,C=m.set;return Object.defineProperty(a,i,{configurable:!0,get:function(){return x.call(this)},set:function(N){u=""+N,C.call(this,N)}}),Object.defineProperty(a,i,{enumerable:m.enumerable}),{getValue:function(){return u},setValue:function(N){u=""+N},stopTracking:function(){a._valueTracker=null,delete a[i]}}}}function Qg(a){if(!a._valueTracker){var i=LS(a)?"checked":"value";a._valueTracker=hM(a,i,""+a[i])}}function PS(a){if(!a)return!1;var i=a._valueTracker;if(!i)return!0;var u=i.getValue(),m="";return a&&(m=LS(a)?a.checked?"true":"false":a.value),a=m,a!==u?(i.setValue(a),!0):!1}function rh(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 mM=/[\n"\\]/g;function Ma(a){return a.replace(mM,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Xg(a,i,u,m,x,C,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=""+Zr(i)):a.value!==""+Zr(i)&&(a.value=""+Zr(i)):N!=="submit"&&N!=="reset"||a.removeAttribute("value"),i!=null?Jg(a,N,Zr(i)):u!=null?Jg(a,N,Zr(u)):m!=null&&a.removeAttribute("value"),x==null&&C!=null&&(a.defaultChecked=!!C),x!=null&&(a.checked=x&&typeof x!="function"&&typeof x!="symbol"),I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?a.name=""+Zr(I):a.removeAttribute("name")}function US(a,i,u,m,x,C,N,I){if(C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(a.type=C),i!=null||u!=null){if(!(C!=="submit"&&C!=="reset"||i!=null)){Qg(a);return}u=u!=null?""+Zr(u):"",i=i!=null?""+Zr(i):u,I||i===a.value||(a.value=i),a.defaultValue=i}m=m??x,m=typeof m!="function"&&typeof m!="symbol"&&!!m,a.checked=I?a.checked:!!m,a.defaultChecked=!!m,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(a.name=N),Qg(a)}function Jg(a,i,u){i==="number"&&rh(a.ownerDocument)===a||a.defaultValue===""+u||(a.defaultValue=""+u)}function ec(a,i,u,m){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&&m&&(a[u].defaultSelected=!0)}else{for(u=""+Zr(u),i=null,x=0;x<a.length;x++){if(a[x].value===u){a[x].selected=!0,m&&(a[x].defaultSelected=!0);return}i!==null||a[x].disabled||(i=a[x])}i!==null&&(i.selected=!0)}}function FS(a,i,u){if(i!=null&&(i=""+Zr(i),i!==a.value&&(a.value=i),u==null)){a.defaultValue!==i&&(a.defaultValue=i);return}a.defaultValue=u!=null?""+Zr(u):""}function zS(a,i,u,m){if(i==null){if(m!=null){if(u!=null)throw Error(r(92));if(W(m)){if(1<m.length)throw Error(r(93));m=m[0]}u=m}u==null&&(u=""),i=u}u=Zr(i),a.defaultValue=u,m=a.textContent,m===u&&m!==""&&m!==null&&(a.value=m),Qg(a)}function tc(a,i){if(i){var u=a.firstChild;if(u&&u===a.lastChild&&u.nodeType===3){u.nodeValue=i;return}}a.textContent=i}var pM=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 VS(a,i,u){var m=i.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?m?a.setProperty(i,""):i==="float"?a.cssFloat="":a[i]="":m?a.setProperty(i,u):typeof u!="number"||u===0||pM.has(i)?i==="float"?a.cssFloat=u:a[i]=(""+u).trim():a[i]=u+"px"}function $S(a,i,u){if(i!=null&&typeof i!="object")throw Error(r(62));if(a=a.style,u!=null){for(var m in u)!u.hasOwnProperty(m)||i!=null&&i.hasOwnProperty(m)||(m.indexOf("--")===0?a.setProperty(m,""):m==="float"?a.cssFloat="":a[m]="");for(var x in i)m=i[x],i.hasOwnProperty(x)&&u[x]!==m&&VS(a,x,m)}else for(var C in i)i.hasOwnProperty(C)&&VS(a,C,i[C])}function ey(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 gM=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"]]),yM=/^[\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 ah(a){return yM.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function Js(){}var ty=null;function ny(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var nc=null,rc=null;function HS(a){var i=Aa(a);if(i&&(a=i.stateNode)){var u=a[Ge]||null;e:switch(a=i.stateNode,i.type){case"input":if(Xg(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="'+Ma(""+i)+'"][type="radio"]'),i=0;i<u.length;i++){var m=u[i];if(m!==a&&m.form===a.form){var x=m[Ge]||null;if(!x)throw Error(r(90));Xg(m,x.value,x.defaultValue,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name)}}for(i=0;i<u.length;i++)m=u[i],m.form===a.form&&PS(m)}break e;case"textarea":FS(a,u.value,u.defaultValue);break e;case"select":i=u.value,i!=null&&ec(a,!!u.multiple,i,!1)}}}var ry=!1;function BS(a,i,u){if(ry)return a(i,u);ry=!0;try{var m=a(i);return m}finally{if(ry=!1,(nc!==null||rc!==null)&&(Gh(),nc&&(i=nc,a=rc,rc=nc=null,HS(i),a)))for(i=0;i<a.length;i++)HS(a[i])}}function Vu(a,i){var u=a.stateNode;if(u===null)return null;var m=u[Ge]||null;if(m===null)return null;u=m[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":(m=!m.disabled)||(a=a.type,m=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!m;break e;default:a=!1}if(a)return null;if(u&&typeof u!="function")throw Error(r(231,i,typeof u));return u}var eo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ay=!1;if(eo)try{var $u={};Object.defineProperty($u,"passive",{get:function(){ay=!0}}),window.addEventListener("test",$u,$u),window.removeEventListener("test",$u,$u)}catch{ay=!1}var Ho=null,sy=null,sh=null;function GS(){if(sh)return sh;var a,i=sy,u=i.length,m,x="value"in Ho?Ho.value:Ho.textContent,C=x.length;for(a=0;a<u&&i[a]===x[a];a++);var N=u-a;for(m=1;m<=N&&i[u-m]===x[C-m];m++);return sh=x.slice(a,1<m?1-m:void 0)}function oh(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 ih(){return!0}function qS(){return!1}function Kr(a){function i(u,m,x,C,N){this._reactName=u,this._targetInst=x,this.type=m,this.nativeEvent=C,this.target=N,this.currentTarget=null;for(var I in a)a.hasOwnProperty(I)&&(u=a[I],this[I]=u?u(C):C[I]);return this.isDefaultPrevented=(C.defaultPrevented!=null?C.defaultPrevented:C.returnValue===!1)?ih:qS,this.isPropagationStopped=qS,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=ih)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=ih)},persist:function(){},isPersistent:ih}),i}var Qi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},lh=Kr(Qi),Hu=y({},Qi,{view:0,detail:0}),vM=Kr(Hu),oy,iy,Bu,ch=y({},Hu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:cy,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!==Bu&&(Bu&&a.type==="mousemove"?(oy=a.screenX-Bu.screenX,iy=a.screenY-Bu.screenY):iy=oy=0,Bu=a),oy)},movementY:function(a){return"movementY"in a?a.movementY:iy}}),ZS=Kr(ch),xM=y({},ch,{dataTransfer:0}),bM=Kr(xM),SM=y({},Hu,{relatedTarget:0}),ly=Kr(SM),CM=y({},Qi,{animationName:0,elapsedTime:0,pseudoElement:0}),EM=Kr(CM),wM=y({},Qi,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),RM=Kr(wM),TM=y({},Qi,{data:0}),KS=Kr(TM),jM={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_M={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"},NM={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function AM(a){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(a):(a=NM[a])?!!i[a]:!1}function cy(){return AM}var DM=y({},Hu,{key:function(a){if(a.key){var i=jM[a.key]||a.key;if(i!=="Unidentified")return i}return a.type==="keypress"?(a=oh(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?_M[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:cy,charCode:function(a){return a.type==="keypress"?oh(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?oh(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),OM=Kr(DM),MM=y({},ch,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),YS=Kr(MM),IM=y({},Hu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:cy}),kM=Kr(IM),LM=y({},Qi,{propertyName:0,elapsedTime:0,pseudoElement:0}),PM=Kr(LM),UM=y({},ch,{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}),FM=Kr(UM),zM=y({},Qi,{newState:0,oldState:0}),VM=Kr(zM),$M=[9,13,27,32],uy=eo&&"CompositionEvent"in window,Gu=null;eo&&"documentMode"in document&&(Gu=document.documentMode);var HM=eo&&"TextEvent"in window&&!Gu,WS=eo&&(!uy||Gu&&8<Gu&&11>=Gu),QS=" ",XS=!1;function JS(a,i){switch(a){case"keyup":return $M.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function eC(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var ac=!1;function BM(a,i){switch(a){case"compositionend":return eC(i);case"keypress":return i.which!==32?null:(XS=!0,QS);case"textInput":return a=i.data,a===QS&&XS?null:a;default:return null}}function GM(a,i){if(ac)return a==="compositionend"||!uy&&JS(a,i)?(a=GS(),sh=sy=Ho=null,ac=!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 WS&&i.locale!=="ko"?null:i.data;default:return null}}var qM={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 tC(a){var i=a&&a.nodeName&&a.nodeName.toLowerCase();return i==="input"?!!qM[a.type]:i==="textarea"}function nC(a,i,u,m){nc?rc?rc.push(m):rc=[m]:nc=m,i=Xh(i,"onChange"),0<i.length&&(u=new lh("onChange","change",null,u,m),a.push({event:u,listeners:i}))}var qu=null,Zu=null;function ZM(a){Uw(a,0)}function uh(a){var i=qr(a);if(PS(i))return a}function rC(a,i){if(a==="change")return i}var aC=!1;if(eo){var dy;if(eo){var fy="oninput"in document;if(!fy){var sC=document.createElement("div");sC.setAttribute("oninput","return;"),fy=typeof sC.oninput=="function"}dy=fy}else dy=!1;aC=dy&&(!document.documentMode||9<document.documentMode)}function oC(){qu&&(qu.detachEvent("onpropertychange",iC),Zu=qu=null)}function iC(a){if(a.propertyName==="value"&&uh(Zu)){var i=[];nC(i,Zu,a,ny(a)),BS(ZM,i)}}function KM(a,i,u){a==="focusin"?(oC(),qu=i,Zu=u,qu.attachEvent("onpropertychange",iC)):a==="focusout"&&oC()}function YM(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return uh(Zu)}function WM(a,i){if(a==="click")return uh(i)}function QM(a,i){if(a==="input"||a==="change")return uh(i)}function XM(a,i){return a===i&&(a!==0||1/a===1/i)||a!==a&&i!==i}var sa=typeof Object.is=="function"?Object.is:XM;function Ku(a,i){if(sa(a,i))return!0;if(typeof a!="object"||a===null||typeof i!="object"||i===null)return!1;var u=Object.keys(a),m=Object.keys(i);if(u.length!==m.length)return!1;for(m=0;m<u.length;m++){var x=u[m];if(!Fe.call(i,x)||!sa(a[x],i[x]))return!1}return!0}function lC(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function cC(a,i){var u=lC(a);a=0;for(var m;u;){if(u.nodeType===3){if(m=a+u.textContent.length,a<=i&&m>=i)return{node:u,offset:i-a};a=m}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=lC(u)}}function uC(a,i){return a&&i?a===i?!0:a&&a.nodeType===3?!1:i&&i.nodeType===3?uC(a,i.parentNode):"contains"in a?a.contains(i):a.compareDocumentPosition?!!(a.compareDocumentPosition(i)&16):!1:!1}function dC(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var i=rh(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=rh(a.document)}return i}function hy(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 JM=eo&&"documentMode"in document&&11>=document.documentMode,sc=null,my=null,Yu=null,py=!1;function fC(a,i,u){var m=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;py||sc==null||sc!==rh(m)||(m=sc,"selectionStart"in m&&hy(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Yu&&Ku(Yu,m)||(Yu=m,m=Xh(my,"onSelect"),0<m.length&&(i=new lh("onSelect","select",null,i,u),a.push({event:i,listeners:m}),i.target=sc)))}function Xi(a,i){var u={};return u[a.toLowerCase()]=i.toLowerCase(),u["Webkit"+a]="webkit"+i,u["Moz"+a]="moz"+i,u}var oc={animationend:Xi("Animation","AnimationEnd"),animationiteration:Xi("Animation","AnimationIteration"),animationstart:Xi("Animation","AnimationStart"),transitionrun:Xi("Transition","TransitionRun"),transitionstart:Xi("Transition","TransitionStart"),transitioncancel:Xi("Transition","TransitionCancel"),transitionend:Xi("Transition","TransitionEnd")},gy={},hC={};eo&&(hC=document.createElement("div").style,"AnimationEvent"in window||(delete oc.animationend.animation,delete oc.animationiteration.animation,delete oc.animationstart.animation),"TransitionEvent"in window||delete oc.transitionend.transition);function Ji(a){if(gy[a])return gy[a];if(!oc[a])return a;var i=oc[a],u;for(u in i)if(i.hasOwnProperty(u)&&u in hC)return gy[a]=i[u];return a}var mC=Ji("animationend"),pC=Ji("animationiteration"),gC=Ji("animationstart"),e6=Ji("transitionrun"),t6=Ji("transitionstart"),n6=Ji("transitioncancel"),yC=Ji("transitionend"),vC=new Map,yy="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(" ");yy.push("scrollEnd");function ts(a,i){vC.set(a,i),Da(i,[a])}var dh=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)},Ia=[],ic=0,vy=0;function fh(){for(var a=ic,i=vy=ic=0;i<a;){var u=Ia[i];Ia[i++]=null;var m=Ia[i];Ia[i++]=null;var x=Ia[i];Ia[i++]=null;var C=Ia[i];if(Ia[i++]=null,m!==null&&x!==null){var N=m.pending;N===null?x.next=x:(x.next=N.next,N.next=x),m.pending=x}C!==0&&xC(u,x,C)}}function hh(a,i,u,m){Ia[ic++]=a,Ia[ic++]=i,Ia[ic++]=u,Ia[ic++]=m,vy|=m,a.lanes|=m,a=a.alternate,a!==null&&(a.lanes|=m)}function xy(a,i,u,m){return hh(a,i,u,m),mh(a)}function el(a,i){return hh(a,null,null,i),mh(a)}function xC(a,i,u){a.lanes|=u;var m=a.alternate;m!==null&&(m.lanes|=u);for(var x=!1,C=a.return;C!==null;)C.childLanes|=u,m=C.alternate,m!==null&&(m.childLanes|=u),C.tag===22&&(a=C.stateNode,a===null||a._visibility&1||(x=!0)),a=C,C=C.return;return a.tag===3?(C=a.stateNode,x&&i!==null&&(x=31-Sn(u),a=C.hiddenUpdates,m=a[x],m===null?a[x]=[i]:m.push(i),i.lane=u|536870912),C):null}function mh(a){if(50<yd)throw yd=0,_v=null,Error(r(185));for(var i=a.return;i!==null;)a=i,i=a.return;return a.tag===3?a.stateNode:null}var lc={};function r6(a,i,u,m){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=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function oa(a,i,u,m){return new r6(a,i,u,m)}function by(a){return a=a.prototype,!(!a||!a.isReactComponent)}function to(a,i){var u=a.alternate;return u===null?(u=oa(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 bC(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 ph(a,i,u,m,x,C){var N=0;if(m=a,typeof a=="function")by(a)&&(N=1);else if(typeof a=="string")N=lI(a,u,te.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case F:return a=oa(31,u,i,x),a.elementType=F,a.lanes=C,a;case E:return tl(u.children,x,C,i);case S:N=8,x|=24;break;case R:return a=oa(12,u,i,x|2),a.elementType=R,a.lanes=C,a;case A:return a=oa(13,u,i,x),a.elementType=A,a.lanes=C,a;case O:return a=oa(19,u,i,x),a.elementType=O,a.lanes=C,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case _:N=10;break e;case T:N=9;break e;case D:N=11;break e;case j:N=14;break e;case M:N=16,m=null;break e}N=29,u=Error(r(130,a===null?"null":typeof a,"")),m=null}return i=oa(N,u,i,x),i.elementType=a,i.type=m,i.lanes=C,i}function tl(a,i,u,m){return a=oa(7,a,m,i),a.lanes=u,a}function Sy(a,i,u){return a=oa(6,a,null,i),a.lanes=u,a}function SC(a){var i=oa(18,null,null,0);return i.stateNode=a,i}function Cy(a,i,u){return i=oa(4,a.children!==null?a.children:[],a.key,i),i.lanes=u,i.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},i}var CC=new WeakMap;function ka(a,i){if(typeof a=="object"&&a!==null){var u=CC.get(a);return u!==void 0?u:(i={value:a,source:i,stack:aa(i)},CC.set(a,i),i)}return{value:a,source:i,stack:aa(i)}}var cc=[],uc=0,gh=null,Wu=0,La=[],Pa=0,Bo=null,Rs=1,Ts="";function no(a,i){cc[uc++]=Wu,cc[uc++]=gh,gh=a,Wu=i}function EC(a,i,u){La[Pa++]=Rs,La[Pa++]=Ts,La[Pa++]=Bo,Bo=a;var m=Rs;a=Ts;var x=32-Sn(m)-1;m&=~(1<<x),u+=1;var C=32-Sn(i)+x;if(30<C){var N=x-x%5;C=(m&(1<<N)-1).toString(32),m>>=N,x-=N,Rs=1<<32-Sn(i)+x|u<<x|m,Ts=C+a}else Rs=1<<C|u<<x|m,Ts=a}function Ey(a){a.return!==null&&(no(a,1),EC(a,1,0))}function wy(a){for(;a===gh;)gh=cc[--uc],cc[uc]=null,Wu=cc[--uc],cc[uc]=null;for(;a===Bo;)Bo=La[--Pa],La[Pa]=null,Ts=La[--Pa],La[Pa]=null,Rs=La[--Pa],La[Pa]=null}function wC(a,i){La[Pa++]=Rs,La[Pa++]=Ts,La[Pa++]=Bo,Rs=i.id,Ts=i.overflow,Bo=a}var gr=null,cn=null,Nt=!1,Go=null,Ua=!1,Ry=Error(r(519));function qo(a){var i=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Qu(ka(i,a)),Ry}function RC(a){var i=a.stateNode,u=a.type,m=a.memoizedProps;switch(i[Ve]=a,i[Ge]=m,u){case"dialog":bt("cancel",i),bt("close",i);break;case"iframe":case"object":case"embed":bt("load",i);break;case"video":case"audio":for(u=0;u<xd.length;u++)bt(xd[u],i);break;case"source":bt("error",i);break;case"img":case"image":case"link":bt("error",i),bt("load",i);break;case"details":bt("toggle",i);break;case"input":bt("invalid",i),US(i,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":bt("invalid",i);break;case"textarea":bt("invalid",i),zS(i,m.value,m.defaultValue,m.children)}u=m.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||i.textContent===""+u||m.suppressHydrationWarning===!0||$w(i.textContent,u)?(m.popover!=null&&(bt("beforetoggle",i),bt("toggle",i)),m.onScroll!=null&&bt("scroll",i),m.onScrollEnd!=null&&bt("scrollend",i),m.onClick!=null&&(i.onclick=Js),i=!0):i=!1,i||qo(a,!0)}function TC(a){for(gr=a.return;gr;)switch(gr.tag){case 5:case 31:case 13:Ua=!1;return;case 27:case 3:Ua=!0;return;default:gr=gr.return}}function dc(a){if(a!==gr)return!1;if(!Nt)return TC(a),Nt=!0,!1;var i=a.tag,u;if((u=i!==3&&i!==27)&&((u=i===5)&&(u=a.type,u=!(u!=="form"&&u!=="button")||Hv(a.type,a.memoizedProps)),u=!u),u&&cn&&qo(a),TC(a),i===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));cn=Qw(a)}else if(i===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));cn=Qw(a)}else i===27?(i=cn,oi(a.type)?(a=Kv,Kv=null,cn=a):cn=i):cn=gr?za(a.stateNode.nextSibling):null;return!0}function nl(){cn=gr=null,Nt=!1}function Ty(){var a=Go;return a!==null&&(Xr===null?Xr=a:Xr.push.apply(Xr,a),Go=null),a}function Qu(a){Go===null?Go=[a]:Go.push(a)}var jy=L(null),rl=null,ro=null;function Zo(a,i,u){q(jy,i._currentValue),i._currentValue=u}function ao(a){a._currentValue=jy.current,P(jy)}function _y(a,i,u){for(;a!==null;){var m=a.alternate;if((a.childLanes&i)!==i?(a.childLanes|=i,m!==null&&(m.childLanes|=i)):m!==null&&(m.childLanes&i)!==i&&(m.childLanes|=i),a===u)break;a=a.return}}function Ny(a,i,u,m){var x=a.child;for(x!==null&&(x.return=a);x!==null;){var C=x.dependencies;if(C!==null){var N=x.child;C=C.firstContext;e:for(;C!==null;){var I=C;C=x;for(var V=0;V<i.length;V++)if(I.context===i[V]){C.lanes|=u,I=C.alternate,I!==null&&(I.lanes|=u),_y(C.return,u,a),m||(N=null);break e}C=I.next}}else if(x.tag===18){if(N=x.return,N===null)throw Error(r(341));N.lanes|=u,C=N.alternate,C!==null&&(C.lanes|=u),_y(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 fc(a,i,u,m){a=null;for(var x=i,C=!1;x!==null;){if(!C){if((x.flags&524288)!==0)C=!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;sa(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(wd):a=[wd])}x=x.return}a!==null&&Ny(i,a,u,m),i.flags|=262144}function yh(a){for(a=a.firstContext;a!==null;){if(!sa(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function al(a){rl=a,ro=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function yr(a){return jC(rl,a)}function vh(a,i){return rl===null&&al(a),jC(a,i)}function jC(a,i){var u=i._currentValue;if(i={context:i,memoizedValue:u,next:null},ro===null){if(a===null)throw Error(r(308));ro=i,a.dependencies={lanes:0,firstContext:i},a.flags|=524288}else ro=ro.next=i;return u}var a6=typeof AbortController<"u"?AbortController:function(){var a=[],i=this.signal={aborted:!1,addEventListener:function(u,m){a.push(m)}};this.abort=function(){i.aborted=!0,a.forEach(function(u){return u()})}},s6=e.unstable_scheduleCallback,o6=e.unstable_NormalPriority,Hn={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ay(){return{controller:new a6,data:new Map,refCount:0}}function Xu(a){a.refCount--,a.refCount===0&&s6(o6,function(){a.controller.abort()})}var Ju=null,Dy=0,hc=0,mc=null;function i6(a,i){if(Ju===null){var u=Ju=[];Dy=0,hc=Iv(),mc={status:"pending",value:void 0,then:function(m){u.push(m)}}}return Dy++,i.then(_C,_C),i}function _C(){if(--Dy===0&&Ju!==null){mc!==null&&(mc.status="fulfilled");var a=Ju;Ju=null,hc=0,mc=null;for(var i=0;i<a.length;i++)(0,a[i])()}}function l6(a,i){var u=[],m={status:"pending",value:null,reason:null,then:function(x){u.push(x)}};return a.then(function(){m.status="fulfilled",m.value=i;for(var x=0;x<u.length;x++)(0,u[x])(i)},function(x){for(m.status="rejected",m.reason=x,x=0;x<u.length;x++)(0,u[x])(void 0)}),m}var NC=k.S;k.S=function(a,i){fw=be(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&i6(a,i),NC!==null&&NC(a,i)};var sl=L(null);function Oy(){var a=sl.current;return a!==null?a:tn.pooledCache}function xh(a,i){i===null?q(sl,sl.current):q(sl,i.pool)}function AC(){var a=Oy();return a===null?null:{parent:Hn._currentValue,pool:a}}var pc=Error(r(460)),My=Error(r(474)),bh=Error(r(542)),Sh={then:function(){}};function DC(a){return a=a.status,a==="fulfilled"||a==="rejected"}function OC(a,i,u){switch(u=a[u],u===void 0?a.push(i):u!==i&&(i.then(Js,Js),i=u),i.status){case"fulfilled":return i.value;case"rejected":throw a=i.reason,IC(a),a;default:if(typeof i.status=="string")i.then(Js,Js);else{if(a=tn,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=i,a.status="pending",a.then(function(m){if(i.status==="pending"){var x=i;x.status="fulfilled",x.value=m}},function(m){if(i.status==="pending"){var x=i;x.status="rejected",x.reason=m}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw a=i.reason,IC(a),a}throw il=i,pc}}function ol(a){try{var i=a._init;return i(a._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(il=u,pc):u}}var il=null;function MC(){if(il===null)throw Error(r(459));var a=il;return il=null,a}function IC(a){if(a===pc||a===bh)throw Error(r(483))}var gc=null,ed=0;function Ch(a){var i=ed;return ed+=1,gc===null&&(gc=[]),OC(gc,a,i)}function td(a,i){i=i.props.ref,a.ref=i!==void 0?i:null}function Eh(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(J,K){if(a){var re=J.deletions;re===null?(J.deletions=[K],J.flags|=16):re.push(K)}}function u(J,K){if(!a)return null;for(;K!==null;)i(J,K),K=K.sibling;return null}function m(J){for(var K=new Map;J!==null;)J.key!==null?K.set(J.key,J):K.set(J.index,J),J=J.sibling;return K}function x(J,K){return J=to(J,K),J.index=0,J.sibling=null,J}function C(J,K,re){return J.index=re,a?(re=J.alternate,re!==null?(re=re.index,re<K?(J.flags|=67108866,K):re):(J.flags|=67108866,K)):(J.flags|=1048576,K)}function N(J){return a&&J.alternate===null&&(J.flags|=67108866),J}function I(J,K,re,me){return K===null||K.tag!==6?(K=Sy(re,J.mode,me),K.return=J,K):(K=x(K,re),K.return=J,K)}function V(J,K,re,me){var et=re.type;return et===E?he(J,K,re.props.children,me,re.key):K!==null&&(K.elementType===et||typeof et=="object"&&et!==null&&et.$$typeof===M&&ol(et)===K.type)?(K=x(K,re.props),td(K,re),K.return=J,K):(K=ph(re.type,re.key,re.props,null,J.mode,me),td(K,re),K.return=J,K)}function ae(J,K,re,me){return K===null||K.tag!==4||K.stateNode.containerInfo!==re.containerInfo||K.stateNode.implementation!==re.implementation?(K=Cy(re,J.mode,me),K.return=J,K):(K=x(K,re.children||[]),K.return=J,K)}function he(J,K,re,me,et){return K===null||K.tag!==7?(K=tl(re,J.mode,me,et),K.return=J,K):(K=x(K,re),K.return=J,K)}function pe(J,K,re){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return K=Sy(""+K,J.mode,re),K.return=J,K;if(typeof K=="object"&&K!==null){switch(K.$$typeof){case b:return re=ph(K.type,K.key,K.props,null,J.mode,re),td(re,K),re.return=J,re;case w:return K=Cy(K,J.mode,re),K.return=J,K;case M:return K=ol(K),pe(J,K,re)}if(W(K)||Z(K))return K=tl(K,J.mode,re,null),K.return=J,K;if(typeof K.then=="function")return pe(J,Ch(K),re);if(K.$$typeof===_)return pe(J,vh(J,K),re);Eh(J,K)}return null}function oe(J,K,re,me){var et=K!==null?K.key:null;if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return et!==null?null:I(J,K,""+re,me);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case b:return re.key===et?V(J,K,re,me):null;case w:return re.key===et?ae(J,K,re,me):null;case M:return re=ol(re),oe(J,K,re,me)}if(W(re)||Z(re))return et!==null?null:he(J,K,re,me,null);if(typeof re.then=="function")return oe(J,K,Ch(re),me);if(re.$$typeof===_)return oe(J,K,vh(J,re),me);Eh(J,re)}return null}function fe(J,K,re,me,et){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return J=J.get(re)||null,I(K,J,""+me,et);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case b:return J=J.get(me.key===null?re:me.key)||null,V(K,J,me,et);case w:return J=J.get(me.key===null?re:me.key)||null,ae(K,J,me,et);case M:return me=ol(me),fe(J,K,re,me,et)}if(W(me)||Z(me))return J=J.get(re)||null,he(K,J,me,et,null);if(typeof me.then=="function")return fe(J,K,re,Ch(me),et);if(me.$$typeof===_)return fe(J,K,re,vh(K,me),et);Eh(K,me)}return null}function Be(J,K,re,me){for(var et=null,kt=null,Qe=K,mt=K=0,Rt=null;Qe!==null&&mt<re.length;mt++){Qe.index>mt?(Rt=Qe,Qe=null):Rt=Qe.sibling;var Lt=oe(J,Qe,re[mt],me);if(Lt===null){Qe===null&&(Qe=Rt);break}a&&Qe&&Lt.alternate===null&&i(J,Qe),K=C(Lt,K,mt),kt===null?et=Lt:kt.sibling=Lt,kt=Lt,Qe=Rt}if(mt===re.length)return u(J,Qe),Nt&&no(J,mt),et;if(Qe===null){for(;mt<re.length;mt++)Qe=pe(J,re[mt],me),Qe!==null&&(K=C(Qe,K,mt),kt===null?et=Qe:kt.sibling=Qe,kt=Qe);return Nt&&no(J,mt),et}for(Qe=m(Qe);mt<re.length;mt++)Rt=fe(Qe,J,mt,re[mt],me),Rt!==null&&(a&&Rt.alternate!==null&&Qe.delete(Rt.key===null?mt:Rt.key),K=C(Rt,K,mt),kt===null?et=Rt:kt.sibling=Rt,kt=Rt);return a&&Qe.forEach(function(di){return i(J,di)}),Nt&&no(J,mt),et}function tt(J,K,re,me){if(re==null)throw Error(r(151));for(var et=null,kt=null,Qe=K,mt=K=0,Rt=null,Lt=re.next();Qe!==null&&!Lt.done;mt++,Lt=re.next()){Qe.index>mt?(Rt=Qe,Qe=null):Rt=Qe.sibling;var di=oe(J,Qe,Lt.value,me);if(di===null){Qe===null&&(Qe=Rt);break}a&&Qe&&di.alternate===null&&i(J,Qe),K=C(di,K,mt),kt===null?et=di:kt.sibling=di,kt=di,Qe=Rt}if(Lt.done)return u(J,Qe),Nt&&no(J,mt),et;if(Qe===null){for(;!Lt.done;mt++,Lt=re.next())Lt=pe(J,Lt.value,me),Lt!==null&&(K=C(Lt,K,mt),kt===null?et=Lt:kt.sibling=Lt,kt=Lt);return Nt&&no(J,mt),et}for(Qe=m(Qe);!Lt.done;mt++,Lt=re.next())Lt=fe(Qe,J,mt,Lt.value,me),Lt!==null&&(a&&Lt.alternate!==null&&Qe.delete(Lt.key===null?mt:Lt.key),K=C(Lt,K,mt),kt===null?et=Lt:kt.sibling=Lt,kt=Lt);return a&&Qe.forEach(function(xI){return i(J,xI)}),Nt&&no(J,mt),et}function Jt(J,K,re,me){if(typeof re=="object"&&re!==null&&re.type===E&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case b:e:{for(var et=re.key;K!==null;){if(K.key===et){if(et=re.type,et===E){if(K.tag===7){u(J,K.sibling),me=x(K,re.props.children),me.return=J,J=me;break e}}else if(K.elementType===et||typeof et=="object"&&et!==null&&et.$$typeof===M&&ol(et)===K.type){u(J,K.sibling),me=x(K,re.props),td(me,re),me.return=J,J=me;break e}u(J,K);break}else i(J,K);K=K.sibling}re.type===E?(me=tl(re.props.children,J.mode,me,re.key),me.return=J,J=me):(me=ph(re.type,re.key,re.props,null,J.mode,me),td(me,re),me.return=J,J=me)}return N(J);case w:e:{for(et=re.key;K!==null;){if(K.key===et)if(K.tag===4&&K.stateNode.containerInfo===re.containerInfo&&K.stateNode.implementation===re.implementation){u(J,K.sibling),me=x(K,re.children||[]),me.return=J,J=me;break e}else{u(J,K);break}else i(J,K);K=K.sibling}me=Cy(re,J.mode,me),me.return=J,J=me}return N(J);case M:return re=ol(re),Jt(J,K,re,me)}if(W(re))return Be(J,K,re,me);if(Z(re)){if(et=Z(re),typeof et!="function")throw Error(r(150));return re=et.call(re),tt(J,K,re,me)}if(typeof re.then=="function")return Jt(J,K,Ch(re),me);if(re.$$typeof===_)return Jt(J,K,vh(J,re),me);Eh(J,re)}return typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint"?(re=""+re,K!==null&&K.tag===6?(u(J,K.sibling),me=x(K,re),me.return=J,J=me):(u(J,K),me=Sy(re,J.mode,me),me.return=J,J=me),N(J)):u(J,K)}return function(J,K,re,me){try{ed=0;var et=Jt(J,K,re,me);return gc=null,et}catch(Qe){if(Qe===pc||Qe===bh)throw Qe;var kt=oa(29,Qe,null,J.mode);return kt.lanes=me,kt.return=J,kt}finally{}}}var ll=kC(!0),LC=kC(!1),Ko=!1;function Iy(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ky(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 Yo(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function Wo(a,i,u){var m=a.updateQueue;if(m===null)return null;if(m=m.shared,(Pt&2)!==0){var x=m.pending;return x===null?i.next=i:(i.next=x.next,x.next=i),m.pending=i,i=mh(a),xC(a,null,u),i}return hh(a,m,i,u),mh(a)}function nd(a,i,u){if(i=i.updateQueue,i!==null&&(i=i.shared,(u&4194048)!==0)){var m=i.lanes;m&=a.pendingLanes,u|=m,i.lanes=u,se(a,u)}}function Ly(a,i){var u=a.updateQueue,m=a.alternate;if(m!==null&&(m=m.updateQueue,u===m)){var x=null,C=null;if(u=u.firstBaseUpdate,u!==null){do{var N={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};C===null?x=C=N:C=C.next=N,u=u.next}while(u!==null);C===null?x=C=i:C=C.next=i}else x=C=i;u={baseState:m.baseState,firstBaseUpdate:x,lastBaseUpdate:C,shared:m.shared,callbacks:m.callbacks},a.updateQueue=u;return}a=u.lastBaseUpdate,a===null?u.firstBaseUpdate=i:a.next=i,u.lastBaseUpdate=i}var Py=!1;function rd(){if(Py){var a=mc;if(a!==null)throw a}}function ad(a,i,u,m){Py=!1;var x=a.updateQueue;Ko=!1;var C=x.firstBaseUpdate,N=x.lastBaseUpdate,I=x.shared.pending;if(I!==null){x.shared.pending=null;var V=I,ae=V.next;V.next=null,N===null?C=ae:N.next=ae,N=V;var he=a.alternate;he!==null&&(he=he.updateQueue,I=he.lastBaseUpdate,I!==N&&(I===null?he.firstBaseUpdate=ae:I.next=ae,he.lastBaseUpdate=V))}if(C!==null){var pe=x.baseState;N=0,he=ae=V=null,I=C;do{var oe=I.lane&-536870913,fe=oe!==I.lane;if(fe?(wt&oe)===oe:(m&oe)===oe){oe!==0&&oe===hc&&(Py=!0),he!==null&&(he=he.next={lane:0,tag:I.tag,payload:I.payload,callback:null,next:null});e:{var Be=a,tt=I;oe=i;var Jt=u;switch(tt.tag){case 1:if(Be=tt.payload,typeof Be=="function"){pe=Be.call(Jt,pe,oe);break e}pe=Be;break e;case 3:Be.flags=Be.flags&-65537|128;case 0:if(Be=tt.payload,oe=typeof Be=="function"?Be.call(Jt,pe,oe):Be,oe==null)break e;pe=y({},pe,oe);break e;case 2:Ko=!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,V=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&&(V=pe),x.baseState=V,x.firstBaseUpdate=ae,x.lastBaseUpdate=he,C===null&&(x.shared.lanes=0),ti|=N,a.lanes=N,a.memoizedState=pe}}function PC(a,i){if(typeof a!="function")throw Error(r(191,a));a.call(i)}function UC(a,i){var u=a.callbacks;if(u!==null)for(a.callbacks=null,a=0;a<u.length;a++)PC(u[a],i)}var yc=L(null),wh=L(0);function FC(a,i){a=mo,q(wh,a),q(yc,i),mo=a|i.baseLanes}function Uy(){q(wh,mo),q(yc,yc.current)}function Fy(){mo=wh.current,P(yc),P(wh)}var ia=L(null),Fa=null;function Qo(a){var i=a.alternate;q(Mn,Mn.current&1),q(ia,a),Fa===null&&(i===null||yc.current!==null||i.memoizedState!==null)&&(Fa=a)}function zy(a){q(Mn,Mn.current),q(ia,a),Fa===null&&(Fa=a)}function zC(a){a.tag===22?(q(Mn,Mn.current),q(ia,a),Fa===null&&(Fa=a)):Xo()}function Xo(){q(Mn,Mn.current),q(ia,ia.current)}function la(a){P(ia),Fa===a&&(Fa=null),P(Mn)}var Mn=L(0);function Rh(a){for(var i=a;i!==null;){if(i.tag===13){var u=i.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||qv(u)||Zv(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 so=0,ft=null,Qt=null,Bn=null,Th=!1,vc=!1,cl=!1,jh=0,sd=0,xc=null,c6=0;function En(){throw Error(r(321))}function Vy(a,i){if(i===null)return!1;for(var u=0;u<i.length&&u<a.length;u++)if(!sa(a[u],i[u]))return!1;return!0}function $y(a,i,u,m,x,C){return so=C,ft=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,k.H=a===null||a.memoizedState===null?EE:rv,cl=!1,C=u(m,x),cl=!1,vc&&(C=$C(i,u,m,x)),VC(a),C}function VC(a){k.H=ld;var i=Qt!==null&&Qt.next!==null;if(so=0,Bn=Qt=ft=null,Th=!1,sd=0,xc=null,i)throw Error(r(300));a===null||Gn||(a=a.dependencies,a!==null&&yh(a)&&(Gn=!0))}function $C(a,i,u,m){ft=a;var x=0;do{if(vc&&(xc=null),sd=0,vc=!1,25<=x)throw Error(r(301));if(x+=1,Bn=Qt=null,a.updateQueue!=null){var C=a.updateQueue;C.lastEffect=null,C.events=null,C.stores=null,C.memoCache!=null&&(C.memoCache.index=0)}k.H=wE,C=i(u,m)}while(vc);return C}function u6(){var a=k.H,i=a.useState()[0];return i=typeof i.then=="function"?od(i):i,a=a.useState()[0],(Qt!==null?Qt.memoizedState:null)!==a&&(ft.flags|=1024),i}function Hy(){var a=jh!==0;return jh=0,a}function By(a,i,u){i.updateQueue=a.updateQueue,i.flags&=-2053,a.lanes&=~u}function Gy(a){if(Th){for(a=a.memoizedState;a!==null;){var i=a.queue;i!==null&&(i.pending=null),a=a.next}Th=!1}so=0,Bn=Qt=ft=null,vc=!1,sd=jh=0,xc=null}function Lr(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bn===null?ft.memoizedState=Bn=a:Bn=Bn.next=a,Bn}function In(){if(Qt===null){var a=ft.alternate;a=a!==null?a.memoizedState:null}else a=Qt.next;var i=Bn===null?ft.memoizedState:Bn.next;if(i!==null)Bn=i,Qt=a;else{if(a===null)throw ft.alternate===null?Error(r(467)):Error(r(310));Qt=a,a={memoizedState:Qt.memoizedState,baseState:Qt.baseState,baseQueue:Qt.baseQueue,queue:Qt.queue,next:null},Bn===null?ft.memoizedState=Bn=a:Bn=Bn.next=a}return Bn}function _h(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function od(a){var i=sd;return sd+=1,xc===null&&(xc=[]),a=OC(xc,a,i),i=ft,(Bn===null?i.memoizedState:Bn.next)===null&&(i=i.alternate,k.H=i===null||i.memoizedState===null?EE:rv),a}function Nh(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return od(a);if(a.$$typeof===_)return yr(a)}throw Error(r(438,String(a)))}function qy(a){var i=null,u=ft.updateQueue;if(u!==null&&(i=u.memoCache),i==null){var m=ft.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(i={data:m.data.map(function(x){return x.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),u===null&&(u=_h(),ft.updateQueue=u),u.memoCache=i,u=i.data[i.index],u===void 0)for(u=i.data[i.index]=Array(a),m=0;m<a;m++)u[m]=G;return i.index++,u}function oo(a,i){return typeof i=="function"?i(a):i}function Ah(a){var i=In();return Zy(i,Qt,a)}function Zy(a,i,u){var m=a.queue;if(m===null)throw Error(r(311));m.lastRenderedReducer=u;var x=a.baseQueue,C=m.pending;if(C!==null){if(x!==null){var N=x.next;x.next=C.next,C.next=N}i.baseQueue=x=C,m.pending=null}if(C=a.baseState,x===null)a.memoizedState=C;else{i=x.next;var I=N=null,V=null,ae=i,he=!1;do{var pe=ae.lane&-536870913;if(pe!==ae.lane?(wt&pe)===pe:(so&pe)===pe){var oe=ae.revertLane;if(oe===0)V!==null&&(V=V.next={lane:0,revertLane:0,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null}),pe===hc&&(he=!0);else if((so&oe)===oe){ae=ae.next,oe===hc&&(he=!0);continue}else pe={lane:0,revertLane:ae.revertLane,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},V===null?(I=V=pe,N=C):V=V.next=pe,ft.lanes|=oe,ti|=oe;pe=ae.action,cl&&u(C,pe),C=ae.hasEagerState?ae.eagerState:u(C,pe)}else oe={lane:pe,revertLane:ae.revertLane,gesture:ae.gesture,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},V===null?(I=V=oe,N=C):V=V.next=oe,ft.lanes|=pe,ti|=pe;ae=ae.next}while(ae!==null&&ae!==i);if(V===null?N=C:V.next=I,!sa(C,a.memoizedState)&&(Gn=!0,he&&(u=mc,u!==null)))throw u;a.memoizedState=C,a.baseState=N,a.baseQueue=V,m.lastRenderedState=C}return x===null&&(m.lanes=0),[a.memoizedState,m.dispatch]}function Ky(a){var i=In(),u=i.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=a;var m=u.dispatch,x=u.pending,C=i.memoizedState;if(x!==null){u.pending=null;var N=x=x.next;do C=a(C,N.action),N=N.next;while(N!==x);sa(C,i.memoizedState)||(Gn=!0),i.memoizedState=C,i.baseQueue===null&&(i.baseState=C),u.lastRenderedState=C}return[C,m]}function HC(a,i,u){var m=ft,x=In(),C=Nt;if(C){if(u===void 0)throw Error(r(407));u=u()}else u=i();var N=!sa((Qt||x).memoizedState,u);if(N&&(x.memoizedState=u,Gn=!0),x=x.queue,Qy(qC.bind(null,m,x,a),[a]),x.getSnapshot!==i||N||Bn!==null&&Bn.memoizedState.tag&1){if(m.flags|=2048,bc(9,{destroy:void 0},GC.bind(null,m,x,u,i),null),tn===null)throw Error(r(349));C||(so&127)!==0||BC(m,i,u)}return u}function BC(a,i,u){a.flags|=16384,a={getSnapshot:i,value:u},i=ft.updateQueue,i===null?(i=_h(),ft.updateQueue=i,i.stores=[a]):(u=i.stores,u===null?i.stores=[a]:u.push(a))}function GC(a,i,u,m){i.value=u,i.getSnapshot=m,ZC(i)&&KC(a)}function qC(a,i,u){return u(function(){ZC(i)&&KC(a)})}function ZC(a){var i=a.getSnapshot;a=a.value;try{var u=i();return!sa(a,u)}catch{return!0}}function KC(a){var i=el(a,2);i!==null&&Jr(i,a,2)}function Yy(a){var i=Lr();if(typeof a=="function"){var u=a;if(a=u(),cl){hr(!0);try{u()}finally{hr(!1)}}}return i.memoizedState=i.baseState=a,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:oo,lastRenderedState:a},i}function YC(a,i,u,m){return a.baseState=u,Zy(a,Qt,typeof m=="function"?m:oo)}function d6(a,i,u,m,x){if(Mh(a))throw Error(r(485));if(a=i.action,a!==null){var C={payload:x,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){C.listeners.push(N)}};k.T!==null?u(!0):C.isTransition=!1,m(C),u=i.pending,u===null?(C.next=i.pending=C,WC(i,C)):(C.next=u.next,i.pending=u.next=C)}}function WC(a,i){var u=i.action,m=i.payload,x=a.state;if(i.isTransition){var C=k.T,N={};k.T=N;try{var I=u(x,m),V=k.S;V!==null&&V(N,I),QC(a,i,I)}catch(ae){Wy(a,i,ae)}finally{C!==null&&N.types!==null&&(C.types=N.types),k.T=C}}else try{C=u(x,m),QC(a,i,C)}catch(ae){Wy(a,i,ae)}}function QC(a,i,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(m){XC(a,i,m)},function(m){return Wy(a,i,m)}):XC(a,i,u)}function XC(a,i,u){i.status="fulfilled",i.value=u,JC(i),a.state=u,i=a.pending,i!==null&&(u=i.next,u===i?a.pending=null:(u=u.next,i.next=u,WC(a,u)))}function Wy(a,i,u){var m=a.pending;if(a.pending=null,m!==null){m=m.next;do i.status="rejected",i.reason=u,JC(i),i=i.next;while(i!==m)}a.action=null}function JC(a){a=a.listeners;for(var i=0;i<a.length;i++)(0,a[i])()}function eE(a,i){return i}function tE(a,i){if(Nt){var u=tn.formState;if(u!==null){e:{var m=ft;if(Nt){if(cn){t:{for(var x=cn,C=Ua;x.nodeType!==8;){if(!C){x=null;break t}if(x=za(x.nextSibling),x===null){x=null;break t}}C=x.data,x=C==="F!"||C==="F"?x:null}if(x){cn=za(x.nextSibling),m=x.data==="F!";break e}}qo(m)}m=!1}m&&(i=u[0])}}return u=Lr(),u.memoizedState=u.baseState=i,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:eE,lastRenderedState:i},u.queue=m,u=bE.bind(null,ft,m),m.dispatch=u,m=Yy(!1),C=nv.bind(null,ft,!1,m.queue),m=Lr(),x={state:i,dispatch:null,action:a,pending:null},m.queue=x,u=d6.bind(null,ft,x,C,u),x.dispatch=u,m.memoizedState=a,[i,u,!1]}function nE(a){var i=In();return rE(i,Qt,a)}function rE(a,i,u){if(i=Zy(a,i,eE)[0],a=Ah(oo)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var m=od(i)}catch(N){throw N===pc?bh:N}else m=i;i=In();var x=i.queue,C=x.dispatch;return u!==i.memoizedState&&(ft.flags|=2048,bc(9,{destroy:void 0},f6.bind(null,x,u),null)),[m,C,a]}function f6(a,i){a.action=i}function aE(a){var i=In(),u=Qt;if(u!==null)return rE(i,u,a);In(),i=i.memoizedState,u=In();var m=u.queue.dispatch;return u.memoizedState=a,[i,m,!1]}function bc(a,i,u,m){return a={tag:a,create:u,deps:m,inst:i,next:null},i=ft.updateQueue,i===null&&(i=_h(),ft.updateQueue=i),u=i.lastEffect,u===null?i.lastEffect=a.next=a:(m=u.next,u.next=a,a.next=m,i.lastEffect=a),a}function sE(){return In().memoizedState}function Dh(a,i,u,m){var x=Lr();ft.flags|=a,x.memoizedState=bc(1|i,{destroy:void 0},u,m===void 0?null:m)}function Oh(a,i,u,m){var x=In();m=m===void 0?null:m;var C=x.memoizedState.inst;Qt!==null&&m!==null&&Vy(m,Qt.memoizedState.deps)?x.memoizedState=bc(i,C,u,m):(ft.flags|=a,x.memoizedState=bc(1|i,C,u,m))}function oE(a,i){Dh(8390656,8,a,i)}function Qy(a,i){Oh(2048,8,a,i)}function h6(a){ft.flags|=4;var i=ft.updateQueue;if(i===null)i=_h(),ft.updateQueue=i,i.events=[a];else{var u=i.events;u===null?i.events=[a]:u.push(a)}}function iE(a){var i=In().memoizedState;return h6({ref:i,nextImpl:a}),function(){if((Pt&2)!==0)throw Error(r(440));return i.impl.apply(void 0,arguments)}}function lE(a,i){return Oh(4,2,a,i)}function cE(a,i){return Oh(4,4,a,i)}function uE(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 dE(a,i,u){u=u!=null?u.concat([a]):null,Oh(4,4,uE.bind(null,i,a),u)}function Xy(){}function fE(a,i){var u=In();i=i===void 0?null:i;var m=u.memoizedState;return i!==null&&Vy(i,m[1])?m[0]:(u.memoizedState=[a,i],a)}function hE(a,i){var u=In();i=i===void 0?null:i;var m=u.memoizedState;if(i!==null&&Vy(i,m[1]))return m[0];if(m=a(),cl){hr(!0);try{a()}finally{hr(!1)}}return u.memoizedState=[m,i],m}function Jy(a,i,u){return u===void 0||(so&1073741824)!==0&&(wt&261930)===0?a.memoizedState=i:(a.memoizedState=u,a=mw(),ft.lanes|=a,ti|=a,u)}function mE(a,i,u,m){return sa(u,i)?u:yc.current!==null?(a=Jy(a,u,m),sa(a,i)||(Gn=!0),a):(so&42)===0||(so&1073741824)!==0&&(wt&261930)===0?(Gn=!0,a.memoizedState=u):(a=mw(),ft.lanes|=a,ti|=a,i)}function pE(a,i,u,m,x){var C=H.p;H.p=C!==0&&8>C?C:8;var N=k.T,I={};k.T=I,nv(a,!1,i,u);try{var V=x(),ae=k.S;if(ae!==null&&ae(I,V),V!==null&&typeof V=="object"&&typeof V.then=="function"){var he=l6(V,m);id(a,i,he,da(a))}else id(a,i,m,da(a))}catch(pe){id(a,i,{then:function(){},status:"rejected",reason:pe},da())}finally{H.p=C,N!==null&&I.types!==null&&(N.types=I.types),k.T=N}}function m6(){}function ev(a,i,u,m){if(a.tag!==5)throw Error(r(476));var x=gE(a).queue;pE(a,x,i,B,u===null?m6:function(){return yE(a),u(m)})}function gE(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:oo,lastRenderedState:B},next:null};var u={};return i.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oo,lastRenderedState:u},next:null},a.memoizedState=i,a=a.alternate,a!==null&&(a.memoizedState=i),i}function yE(a){var i=gE(a);i.next===null&&(i=a.alternate.memoizedState),id(a,i.next.queue,{},da())}function tv(){return yr(wd)}function vE(){return In().memoizedState}function xE(){return In().memoizedState}function p6(a){for(var i=a.return;i!==null;){switch(i.tag){case 24:case 3:var u=da();a=Yo(u);var m=Wo(i,a,u);m!==null&&(Jr(m,i,u),nd(m,i,u)),i={cache:Ay()},a.payload=i;return}i=i.return}}function g6(a,i,u){var m=da();u={lane:m,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Mh(a)?SE(i,u):(u=xy(a,i,u,m),u!==null&&(Jr(u,a,m),CE(u,i,m)))}function bE(a,i,u){var m=da();id(a,i,u,m)}function id(a,i,u,m){var x={lane:m,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Mh(a))SE(i,x);else{var C=a.alternate;if(a.lanes===0&&(C===null||C.lanes===0)&&(C=i.lastRenderedReducer,C!==null))try{var N=i.lastRenderedState,I=C(N,u);if(x.hasEagerState=!0,x.eagerState=I,sa(I,N))return hh(a,i,x,0),tn===null&&fh(),!1}catch{}finally{}if(u=xy(a,i,x,m),u!==null)return Jr(u,a,m),CE(u,i,m),!0}return!1}function nv(a,i,u,m){if(m={lane:2,revertLane:Iv(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},Mh(a)){if(i)throw Error(r(479))}else i=xy(a,u,m,2),i!==null&&Jr(i,a,2)}function Mh(a){var i=a.alternate;return a===ft||i!==null&&i===ft}function SE(a,i){vc=Th=!0;var u=a.pending;u===null?i.next=i:(i.next=u.next,u.next=i),a.pending=i}function CE(a,i,u){if((u&4194048)!==0){var m=i.lanes;m&=a.pendingLanes,u|=m,i.lanes=u,se(a,u)}}var ld={readContext:yr,use:Nh,useCallback:En,useContext:En,useEffect:En,useImperativeHandle:En,useLayoutEffect:En,useInsertionEffect:En,useMemo:En,useReducer:En,useRef:En,useState:En,useDebugValue:En,useDeferredValue:En,useTransition:En,useSyncExternalStore:En,useId:En,useHostTransitionStatus:En,useFormState:En,useActionState:En,useOptimistic:En,useMemoCache:En,useCacheRefresh:En};ld.useEffectEvent=En;var EE={readContext:yr,use:Nh,useCallback:function(a,i){return Lr().memoizedState=[a,i===void 0?null:i],a},useContext:yr,useEffect:oE,useImperativeHandle:function(a,i,u){u=u!=null?u.concat([a]):null,Dh(4194308,4,uE.bind(null,i,a),u)},useLayoutEffect:function(a,i){return Dh(4194308,4,a,i)},useInsertionEffect:function(a,i){Dh(4,2,a,i)},useMemo:function(a,i){var u=Lr();i=i===void 0?null:i;var m=a();if(cl){hr(!0);try{a()}finally{hr(!1)}}return u.memoizedState=[m,i],m},useReducer:function(a,i,u){var m=Lr();if(u!==void 0){var x=u(i);if(cl){hr(!0);try{u(i)}finally{hr(!1)}}}else x=i;return m.memoizedState=m.baseState=x,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:x},m.queue=a,a=a.dispatch=g6.bind(null,ft,a),[m.memoizedState,a]},useRef:function(a){var i=Lr();return a={current:a},i.memoizedState=a},useState:function(a){a=Yy(a);var i=a.queue,u=bE.bind(null,ft,i);return i.dispatch=u,[a.memoizedState,u]},useDebugValue:Xy,useDeferredValue:function(a,i){var u=Lr();return Jy(u,a,i)},useTransition:function(){var a=Yy(!1);return a=pE.bind(null,ft,a.queue,!0,!1),Lr().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,i,u){var m=ft,x=Lr();if(Nt){if(u===void 0)throw Error(r(407));u=u()}else{if(u=i(),tn===null)throw Error(r(349));(wt&127)!==0||BC(m,i,u)}x.memoizedState=u;var C={value:u,getSnapshot:i};return x.queue=C,oE(qC.bind(null,m,C,a),[a]),m.flags|=2048,bc(9,{destroy:void 0},GC.bind(null,m,C,u,i),null),u},useId:function(){var a=Lr(),i=tn.identifierPrefix;if(Nt){var u=Ts,m=Rs;u=(m&~(1<<32-Sn(m)-1)).toString(32)+u,i="_"+i+"R_"+u,u=jh++,0<u&&(i+="H"+u.toString(32)),i+="_"}else u=c6++,i="_"+i+"r_"+u.toString(32)+"_";return a.memoizedState=i},useHostTransitionStatus:tv,useFormState:tE,useActionState:tE,useOptimistic:function(a){var i=Lr();i.memoizedState=i.baseState=a;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=u,i=nv.bind(null,ft,!0,u),u.dispatch=i,[a,i]},useMemoCache:qy,useCacheRefresh:function(){return Lr().memoizedState=p6.bind(null,ft)},useEffectEvent:function(a){var i=Lr(),u={impl:a};return i.memoizedState=u,function(){if((Pt&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},rv={readContext:yr,use:Nh,useCallback:fE,useContext:yr,useEffect:Qy,useImperativeHandle:dE,useInsertionEffect:lE,useLayoutEffect:cE,useMemo:hE,useReducer:Ah,useRef:sE,useState:function(){return Ah(oo)},useDebugValue:Xy,useDeferredValue:function(a,i){var u=In();return mE(u,Qt.memoizedState,a,i)},useTransition:function(){var a=Ah(oo)[0],i=In().memoizedState;return[typeof a=="boolean"?a:od(a),i]},useSyncExternalStore:HC,useId:vE,useHostTransitionStatus:tv,useFormState:nE,useActionState:nE,useOptimistic:function(a,i){var u=In();return YC(u,Qt,a,i)},useMemoCache:qy,useCacheRefresh:xE};rv.useEffectEvent=iE;var wE={readContext:yr,use:Nh,useCallback:fE,useContext:yr,useEffect:Qy,useImperativeHandle:dE,useInsertionEffect:lE,useLayoutEffect:cE,useMemo:hE,useReducer:Ky,useRef:sE,useState:function(){return Ky(oo)},useDebugValue:Xy,useDeferredValue:function(a,i){var u=In();return Qt===null?Jy(u,a,i):mE(u,Qt.memoizedState,a,i)},useTransition:function(){var a=Ky(oo)[0],i=In().memoizedState;return[typeof a=="boolean"?a:od(a),i]},useSyncExternalStore:HC,useId:vE,useHostTransitionStatus:tv,useFormState:aE,useActionState:aE,useOptimistic:function(a,i){var u=In();return Qt!==null?YC(u,Qt,a,i):(u.baseState=a,[a,u.queue.dispatch])},useMemoCache:qy,useCacheRefresh:xE};wE.useEffectEvent=iE;function av(a,i,u,m){i=a.memoizedState,u=u(m,i),u=u==null?i:y({},i,u),a.memoizedState=u,a.lanes===0&&(a.updateQueue.baseState=u)}var sv={enqueueSetState:function(a,i,u){a=a._reactInternals;var m=da(),x=Yo(m);x.payload=i,u!=null&&(x.callback=u),i=Wo(a,x,m),i!==null&&(Jr(i,a,m),nd(i,a,m))},enqueueReplaceState:function(a,i,u){a=a._reactInternals;var m=da(),x=Yo(m);x.tag=1,x.payload=i,u!=null&&(x.callback=u),i=Wo(a,x,m),i!==null&&(Jr(i,a,m),nd(i,a,m))},enqueueForceUpdate:function(a,i){a=a._reactInternals;var u=da(),m=Yo(u);m.tag=2,i!=null&&(m.callback=i),i=Wo(a,m,u),i!==null&&(Jr(i,a,u),nd(i,a,u))}};function RE(a,i,u,m,x,C,N){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(m,C,N):i.prototype&&i.prototype.isPureReactComponent?!Ku(u,m)||!Ku(x,C):!0}function TE(a,i,u,m){a=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(u,m),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(u,m),i.state!==a&&sv.enqueueReplaceState(i,i.state,null)}function ul(a,i){var u=i;if("ref"in i){u={};for(var m in i)m!=="ref"&&(u[m]=i[m])}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 jE(a){dh(a)}function _E(a){console.error(a)}function NE(a){dh(a)}function Ih(a,i){try{var u=a.onUncaughtError;u(i.value,{componentStack:i.stack})}catch(m){setTimeout(function(){throw m})}}function AE(a,i,u){try{var m=a.onCaughtError;m(u.value,{componentStack:u.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(x){setTimeout(function(){throw x})}}function ov(a,i,u){return u=Yo(u),u.tag=3,u.payload={element:null},u.callback=function(){Ih(a,i)},u}function DE(a){return a=Yo(a),a.tag=3,a}function OE(a,i,u,m){var x=u.type.getDerivedStateFromError;if(typeof x=="function"){var C=m.value;a.payload=function(){return x(C)},a.callback=function(){AE(i,u,m)}}var N=u.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(a.callback=function(){AE(i,u,m),typeof x!="function"&&(ni===null?ni=new Set([this]):ni.add(this));var I=m.stack;this.componentDidCatch(m.value,{componentStack:I!==null?I:""})})}function y6(a,i,u,m,x){if(u.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(i=u.alternate,i!==null&&fc(i,u,x,!0),u=ia.current,u!==null){switch(u.tag){case 31:case 13:return Fa===null?qh():u.alternate===null&&wn===0&&(wn=3),u.flags&=-257,u.flags|=65536,u.lanes=x,m===Sh?u.flags|=16384:(i=u.updateQueue,i===null?u.updateQueue=new Set([m]):i.add(m),Dv(a,m,x)),!1;case 22:return u.flags|=65536,m===Sh?u.flags|=16384:(i=u.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([m])},u.updateQueue=i):(u=i.retryQueue,u===null?i.retryQueue=new Set([m]):u.add(m)),Dv(a,m,x)),!1}throw Error(r(435,u.tag))}return Dv(a,m,x),qh(),!1}if(Nt)return i=ia.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=x,m!==Ry&&(a=Error(r(422),{cause:m}),Qu(ka(a,u)))):(m!==Ry&&(i=Error(r(423),{cause:m}),Qu(ka(i,u))),a=a.current.alternate,a.flags|=65536,x&=-x,a.lanes|=x,m=ka(m,u),x=ov(a.stateNode,m,x),Ly(a,x),wn!==4&&(wn=2)),!1;var C=Error(r(520),{cause:m});if(C=ka(C,u),gd===null?gd=[C]:gd.push(C),wn!==4&&(wn=2),i===null)return!0;m=ka(m,u),u=i;do{switch(u.tag){case 3:return u.flags|=65536,a=x&-x,u.lanes|=a,a=ov(u.stateNode,m,a),Ly(u,a),!1;case 1:if(i=u.type,C=u.stateNode,(u.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||C!==null&&typeof C.componentDidCatch=="function"&&(ni===null||!ni.has(C))))return u.flags|=65536,x&=-x,u.lanes|=x,x=DE(x),OE(x,a,u,m),Ly(u,x),!1}u=u.return}while(u!==null);return!1}var iv=Error(r(461)),Gn=!1;function vr(a,i,u,m){i.child=a===null?LC(i,null,u,m):ll(i,a.child,u,m)}function ME(a,i,u,m,x){u=u.render;var C=i.ref;if("ref"in m){var N={};for(var I in m)I!=="ref"&&(N[I]=m[I])}else N=m;return al(i),m=$y(a,i,u,N,C,x),I=Hy(),a!==null&&!Gn?(By(a,i,x),io(a,i,x)):(Nt&&I&&Ey(i),i.flags|=1,vr(a,i,m,x),i.child)}function IE(a,i,u,m,x){if(a===null){var C=u.type;return typeof C=="function"&&!by(C)&&C.defaultProps===void 0&&u.compare===null?(i.tag=15,i.type=C,kE(a,i,C,m,x)):(a=ph(u.type,null,m,i,i.mode,x),a.ref=i.ref,a.return=i,i.child=a)}if(C=a.child,!pv(a,x)){var N=C.memoizedProps;if(u=u.compare,u=u!==null?u:Ku,u(N,m)&&a.ref===i.ref)return io(a,i,x)}return i.flags|=1,a=to(C,m),a.ref=i.ref,a.return=i,i.child=a}function kE(a,i,u,m,x){if(a!==null){var C=a.memoizedProps;if(Ku(C,m)&&a.ref===i.ref)if(Gn=!1,i.pendingProps=m=C,pv(a,x))(a.flags&131072)!==0&&(Gn=!0);else return i.lanes=a.lanes,io(a,i,x)}return lv(a,i,u,m,x)}function LE(a,i,u,m){var x=m.children,C=a!==null?a.memoizedState:null;if(a===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((i.flags&128)!==0){if(C=C!==null?C.baseLanes|u:u,a!==null){for(m=i.child=a.child,x=0;m!==null;)x=x|m.lanes|m.childLanes,m=m.sibling;m=x&~C}else m=0,i.child=null;return PE(a,i,C,u,m)}if((u&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},a!==null&&xh(i,C!==null?C.cachePool:null),C!==null?FC(i,C):Uy(),zC(i);else return m=i.lanes=536870912,PE(a,i,C!==null?C.baseLanes|u:u,u,m)}else C!==null?(xh(i,C.cachePool),FC(i,C),Xo(),i.memoizedState=null):(a!==null&&xh(i,null),Uy(),Xo());return vr(a,i,x,u),i.child}function cd(a,i){return a!==null&&a.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function PE(a,i,u,m,x){var C=Oy();return C=C===null?null:{parent:Hn._currentValue,pool:C},i.memoizedState={baseLanes:u,cachePool:C},a!==null&&xh(i,null),Uy(),zC(i),a!==null&&fc(a,i,m,!0),i.childLanes=x,null}function kh(a,i){return i=Ph({mode:i.mode,children:i.children},a.mode),i.ref=a.ref,a.child=i,i.return=a,i}function UE(a,i,u){return ll(i,a.child,null,u),a=kh(i,i.pendingProps),a.flags|=2,la(i),i.memoizedState=null,a}function v6(a,i,u){var m=i.pendingProps,x=(i.flags&128)!==0;if(i.flags&=-129,a===null){if(Nt){if(m.mode==="hidden")return a=kh(i,m),i.lanes=536870912,cd(null,a);if(zy(i),(a=cn)?(a=Ww(a,Ua),a=a!==null&&a.data==="&"?a:null,a!==null&&(i.memoizedState={dehydrated:a,treeContext:Bo!==null?{id:Rs,overflow:Ts}:null,retryLane:536870912,hydrationErrors:null},u=SC(a),u.return=i,i.child=u,gr=i,cn=null)):a=null,a===null)throw qo(i);return i.lanes=536870912,null}return kh(i,m)}var C=a.memoizedState;if(C!==null){var N=C.dehydrated;if(zy(i),x)if(i.flags&256)i.flags&=-257,i=UE(a,i,u);else if(i.memoizedState!==null)i.child=a.child,i.flags|=128,i=null;else throw Error(r(558));else if(Gn||fc(a,i,u,!1),x=(u&a.childLanes)!==0,Gn||x){if(m=tn,m!==null&&(N=ge(m,u),N!==0&&N!==C.retryLane))throw C.retryLane=N,el(a,N),Jr(m,a,N),iv;qh(),i=UE(a,i,u)}else a=C.treeContext,cn=za(N.nextSibling),gr=i,Nt=!0,Go=null,Ua=!1,a!==null&&wC(i,a),i=kh(i,m),i.flags|=4096;return i}return a=to(a.child,{mode:m.mode,children:m.children}),a.ref=i.ref,i.child=a,a.return=i,a}function Lh(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 lv(a,i,u,m,x){return al(i),u=$y(a,i,u,m,void 0,x),m=Hy(),a!==null&&!Gn?(By(a,i,x),io(a,i,x)):(Nt&&m&&Ey(i),i.flags|=1,vr(a,i,u,x),i.child)}function FE(a,i,u,m,x,C){return al(i),i.updateQueue=null,u=$C(i,m,u,x),VC(a),m=Hy(),a!==null&&!Gn?(By(a,i,C),io(a,i,C)):(Nt&&m&&Ey(i),i.flags|=1,vr(a,i,u,C),i.child)}function zE(a,i,u,m,x){if(al(i),i.stateNode===null){var C=lc,N=u.contextType;typeof N=="object"&&N!==null&&(C=yr(N)),C=new u(m,C),i.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,C.updater=sv,i.stateNode=C,C._reactInternals=i,C=i.stateNode,C.props=m,C.state=i.memoizedState,C.refs={},Iy(i),N=u.contextType,C.context=typeof N=="object"&&N!==null?yr(N):lc,C.state=i.memoizedState,N=u.getDerivedStateFromProps,typeof N=="function"&&(av(i,u,N,m),C.state=i.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(N=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),N!==C.state&&sv.enqueueReplaceState(C,C.state,null),ad(i,m,C,x),rd(),C.state=i.memoizedState),typeof C.componentDidMount=="function"&&(i.flags|=4194308),m=!0}else if(a===null){C=i.stateNode;var I=i.memoizedProps,V=ul(u,I);C.props=V;var ae=C.context,he=u.contextType;N=lc,typeof he=="object"&&he!==null&&(N=yr(he));var pe=u.getDerivedStateFromProps;he=typeof pe=="function"||typeof C.getSnapshotBeforeUpdate=="function",I=i.pendingProps!==I,he||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(I||ae!==N)&&TE(i,C,m,N),Ko=!1;var oe=i.memoizedState;C.state=oe,ad(i,m,C,x),rd(),ae=i.memoizedState,I||oe!==ae||Ko?(typeof pe=="function"&&(av(i,u,pe,m),ae=i.memoizedState),(V=Ko||RE(i,u,V,m,oe,ae,N))?(he||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount()),typeof C.componentDidMount=="function"&&(i.flags|=4194308)):(typeof C.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=m,i.memoizedState=ae),C.props=m,C.state=ae,C.context=N,m=V):(typeof C.componentDidMount=="function"&&(i.flags|=4194308),m=!1)}else{C=i.stateNode,ky(a,i),N=i.memoizedProps,he=ul(u,N),C.props=he,pe=i.pendingProps,oe=C.context,ae=u.contextType,V=lc,typeof ae=="object"&&ae!==null&&(V=yr(ae)),I=u.getDerivedStateFromProps,(ae=typeof I=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(N!==pe||oe!==V)&&TE(i,C,m,V),Ko=!1,oe=i.memoizedState,C.state=oe,ad(i,m,C,x),rd();var fe=i.memoizedState;N!==pe||oe!==fe||Ko||a!==null&&a.dependencies!==null&&yh(a.dependencies)?(typeof I=="function"&&(av(i,u,I,m),fe=i.memoizedState),(he=Ko||RE(i,u,he,m,oe,fe,V)||a!==null&&a.dependencies!==null&&yh(a.dependencies))?(ae||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(m,fe,V),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(m,fe,V)),typeof C.componentDidUpdate=="function"&&(i.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof C.componentDidUpdate!="function"||N===a.memoizedProps&&oe===a.memoizedState||(i.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||N===a.memoizedProps&&oe===a.memoizedState||(i.flags|=1024),i.memoizedProps=m,i.memoizedState=fe),C.props=m,C.state=fe,C.context=V,m=he):(typeof C.componentDidUpdate!="function"||N===a.memoizedProps&&oe===a.memoizedState||(i.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||N===a.memoizedProps&&oe===a.memoizedState||(i.flags|=1024),m=!1)}return C=m,Lh(a,i),m=(i.flags&128)!==0,C||m?(C=i.stateNode,u=m&&typeof u.getDerivedStateFromError!="function"?null:C.render(),i.flags|=1,a!==null&&m?(i.child=ll(i,a.child,null,x),i.child=ll(i,null,u,x)):vr(a,i,u,x),i.memoizedState=C.state,a=i.child):a=io(a,i,x),a}function VE(a,i,u,m){return nl(),i.flags|=256,vr(a,i,u,m),i.child}var cv={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function uv(a){return{baseLanes:a,cachePool:AC()}}function dv(a,i,u){return a=a!==null?a.childLanes&~u:0,i&&(a|=ua),a}function $E(a,i,u){var m=i.pendingProps,x=!1,C=(i.flags&128)!==0,N;if((N=C)||(N=a!==null&&a.memoizedState===null?!1:(Mn.current&2)!==0),N&&(x=!0,i.flags&=-129),N=(i.flags&32)!==0,i.flags&=-33,a===null){if(Nt){if(x?Qo(i):Xo(),(a=cn)?(a=Ww(a,Ua),a=a!==null&&a.data!=="&"?a:null,a!==null&&(i.memoizedState={dehydrated:a,treeContext:Bo!==null?{id:Rs,overflow:Ts}:null,retryLane:536870912,hydrationErrors:null},u=SC(a),u.return=i,i.child=u,gr=i,cn=null)):a=null,a===null)throw qo(i);return Zv(a)?i.lanes=32:i.lanes=536870912,null}var I=m.children;return m=m.fallback,x?(Xo(),x=i.mode,I=Ph({mode:"hidden",children:I},x),m=tl(m,x,u,null),I.return=i,m.return=i,I.sibling=m,i.child=I,m=i.child,m.memoizedState=uv(u),m.childLanes=dv(a,N,u),i.memoizedState=cv,cd(null,m)):(Qo(i),fv(i,I))}var V=a.memoizedState;if(V!==null&&(I=V.dehydrated,I!==null)){if(C)i.flags&256?(Qo(i),i.flags&=-257,i=hv(a,i,u)):i.memoizedState!==null?(Xo(),i.child=a.child,i.flags|=128,i=null):(Xo(),I=m.fallback,x=i.mode,m=Ph({mode:"visible",children:m.children},x),I=tl(I,x,u,null),I.flags|=2,m.return=i,I.return=i,m.sibling=I,i.child=m,ll(i,a.child,null,u),m=i.child,m.memoizedState=uv(u),m.childLanes=dv(a,N,u),i.memoizedState=cv,i=cd(null,m));else if(Qo(i),Zv(I)){if(N=I.nextSibling&&I.nextSibling.dataset,N)var ae=N.dgst;N=ae,m=Error(r(419)),m.stack="",m.digest=N,Qu({value:m,source:null,stack:null}),i=hv(a,i,u)}else if(Gn||fc(a,i,u,!1),N=(u&a.childLanes)!==0,Gn||N){if(N=tn,N!==null&&(m=ge(N,u),m!==0&&m!==V.retryLane))throw V.retryLane=m,el(a,m),Jr(N,a,m),iv;qv(I)||qh(),i=hv(a,i,u)}else qv(I)?(i.flags|=192,i.child=a.child,i=null):(a=V.treeContext,cn=za(I.nextSibling),gr=i,Nt=!0,Go=null,Ua=!1,a!==null&&wC(i,a),i=fv(i,m.children),i.flags|=4096);return i}return x?(Xo(),I=m.fallback,x=i.mode,V=a.child,ae=V.sibling,m=to(V,{mode:"hidden",children:m.children}),m.subtreeFlags=V.subtreeFlags&65011712,ae!==null?I=to(ae,I):(I=tl(I,x,u,null),I.flags|=2),I.return=i,m.return=i,m.sibling=I,i.child=m,cd(null,m),m=i.child,I=a.child.memoizedState,I===null?I=uv(u):(x=I.cachePool,x!==null?(V=Hn._currentValue,x=x.parent!==V?{parent:V,pool:V}:x):x=AC(),I={baseLanes:I.baseLanes|u,cachePool:x}),m.memoizedState=I,m.childLanes=dv(a,N,u),i.memoizedState=cv,cd(a.child,m)):(Qo(i),u=a.child,a=u.sibling,u=to(u,{mode:"visible",children:m.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 fv(a,i){return i=Ph({mode:"visible",children:i},a.mode),i.return=a,a.child=i}function Ph(a,i){return a=oa(22,a,null,i),a.lanes=0,a}function hv(a,i,u){return ll(i,a.child,null,u),a=fv(i,i.pendingProps.children),a.flags|=2,i.memoizedState=null,a}function HE(a,i,u){a.lanes|=i;var m=a.alternate;m!==null&&(m.lanes|=i),_y(a.return,i,u)}function mv(a,i,u,m,x,C){var N=a.memoizedState;N===null?a.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:m,tail:u,tailMode:x,treeForkCount:C}:(N.isBackwards=i,N.rendering=null,N.renderingStartTime=0,N.last=m,N.tail=u,N.tailMode=x,N.treeForkCount=C)}function BE(a,i,u){var m=i.pendingProps,x=m.revealOrder,C=m.tail;m=m.children;var N=Mn.current,I=(N&2)!==0;if(I?(N=N&1|2,i.flags|=128):N&=1,q(Mn,N),vr(a,i,m,u),m=Nt?Wu:0,!I&&a!==null&&(a.flags&128)!==0)e:for(a=i.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&HE(a,u,i);else if(a.tag===19)HE(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&&Rh(a)===null&&(x=u),u=u.sibling;u=x,u===null?(x=i.child,i.child=null):(x=u.sibling,u.sibling=null),mv(i,!1,x,u,C,m);break;case"backwards":case"unstable_legacy-backwards":for(u=null,x=i.child,i.child=null;x!==null;){if(a=x.alternate,a!==null&&Rh(a)===null){i.child=x;break}a=x.sibling,x.sibling=u,u=x,x=a}mv(i,!0,u,null,C,m);break;case"together":mv(i,!1,null,null,void 0,m);break;default:i.memoizedState=null}return i.child}function io(a,i,u){if(a!==null&&(i.dependencies=a.dependencies),ti|=i.lanes,(u&i.childLanes)===0)if(a!==null){if(fc(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=to(a,a.pendingProps),i.child=u,u.return=i;a.sibling!==null;)a=a.sibling,u=u.sibling=to(a,a.pendingProps),u.return=i;u.sibling=null}return i.child}function pv(a,i){return(a.lanes&i)!==0?!0:(a=a.dependencies,!!(a!==null&&yh(a)))}function x6(a,i,u){switch(i.tag){case 3:Ne(i,i.stateNode.containerInfo),Zo(i,Hn,a.memoizedState.cache),nl();break;case 27:case 5:_e(i);break;case 4:Ne(i,i.stateNode.containerInfo);break;case 10:Zo(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,zy(i),null;break;case 13:var m=i.memoizedState;if(m!==null)return m.dehydrated!==null?(Qo(i),i.flags|=128,null):(u&i.child.childLanes)!==0?$E(a,i,u):(Qo(i),a=io(a,i,u),a!==null?a.sibling:null);Qo(i);break;case 19:var x=(a.flags&128)!==0;if(m=(u&i.childLanes)!==0,m||(fc(a,i,u,!1),m=(u&i.childLanes)!==0),x){if(m)return BE(a,i,u);i.flags|=128}if(x=i.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),q(Mn,Mn.current),m)break;return null;case 22:return i.lanes=0,LE(a,i,u,i.pendingProps);case 24:Zo(i,Hn,a.memoizedState.cache)}return io(a,i,u)}function GE(a,i,u){if(a!==null)if(a.memoizedProps!==i.pendingProps)Gn=!0;else{if(!pv(a,u)&&(i.flags&128)===0)return Gn=!1,x6(a,i,u);Gn=(a.flags&131072)!==0}else Gn=!1,Nt&&(i.flags&1048576)!==0&&EC(i,Wu,i.index);switch(i.lanes=0,i.tag){case 16:e:{var m=i.pendingProps;if(a=ol(i.elementType),i.type=a,typeof a=="function")by(a)?(m=ul(a,m),i.tag=1,i=zE(null,i,a,m,u)):(i.tag=0,i=lv(null,i,a,m,u));else{if(a!=null){var x=a.$$typeof;if(x===D){i.tag=11,i=ME(null,i,a,m,u);break e}else if(x===j){i.tag=14,i=IE(null,i,a,m,u);break e}}throw i=$(a)||a,Error(r(306,i,""))}}return i;case 0:return lv(a,i,i.type,i.pendingProps,u);case 1:return m=i.type,x=ul(m,i.pendingProps),zE(a,i,m,x,u);case 3:e:{if(Ne(i,i.stateNode.containerInfo),a===null)throw Error(r(387));m=i.pendingProps;var C=i.memoizedState;x=C.element,ky(a,i),ad(i,m,null,u);var N=i.memoizedState;if(m=N.cache,Zo(i,Hn,m),m!==C.cache&&Ny(i,[Hn],u,!0),rd(),m=N.element,C.isDehydrated)if(C={element:m,isDehydrated:!1,cache:N.cache},i.updateQueue.baseState=C,i.memoizedState=C,i.flags&256){i=VE(a,i,m,u);break e}else if(m!==x){x=ka(Error(r(424)),i),Qu(x),i=VE(a,i,m,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(cn=za(a.firstChild),gr=i,Nt=!0,Go=null,Ua=!0,u=LC(i,null,m,u),i.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(nl(),m===x){i=io(a,i,u);break e}vr(a,i,m,u)}i=i.child}return i;case 26:return Lh(a,i),a===null?(u=n2(i.type,null,i.pendingProps,null))?i.memoizedState=u:Nt||(u=i.type,a=i.pendingProps,m=Jh(ve.current).createElement(u),m[Ve]=i,m[Ge]=a,xr(m,u,a),Cn(m),i.stateNode=m):i.memoizedState=n2(i.type,a.memoizedProps,i.pendingProps,a.memoizedState),null;case 27:return _e(i),a===null&&Nt&&(m=i.stateNode=Jw(i.type,i.pendingProps,ve.current),gr=i,Ua=!0,x=cn,oi(i.type)?(Kv=x,cn=za(m.firstChild)):cn=x),vr(a,i,i.pendingProps.children,u),Lh(a,i),a===null&&(i.flags|=4194304),i.child;case 5:return a===null&&Nt&&((x=m=cn)&&(m=Y6(m,i.type,i.pendingProps,Ua),m!==null?(i.stateNode=m,gr=i,cn=za(m.firstChild),Ua=!1,x=!0):x=!1),x||qo(i)),_e(i),x=i.type,C=i.pendingProps,N=a!==null?a.memoizedProps:null,m=C.children,Hv(x,C)?m=null:N!==null&&Hv(x,N)&&(i.flags|=32),i.memoizedState!==null&&(x=$y(a,i,u6,null,null,u),wd._currentValue=x),Lh(a,i),vr(a,i,m,u),i.child;case 6:return a===null&&Nt&&((a=u=cn)&&(u=W6(u,i.pendingProps,Ua),u!==null?(i.stateNode=u,gr=i,cn=null,a=!0):a=!1),a||qo(i)),null;case 13:return $E(a,i,u);case 4:return Ne(i,i.stateNode.containerInfo),m=i.pendingProps,a===null?i.child=ll(i,null,m,u):vr(a,i,m,u),i.child;case 11:return ME(a,i,i.type,i.pendingProps,u);case 7:return vr(a,i,i.pendingProps,u),i.child;case 8:return vr(a,i,i.pendingProps.children,u),i.child;case 12:return vr(a,i,i.pendingProps.children,u),i.child;case 10:return m=i.pendingProps,Zo(i,i.type,m.value),vr(a,i,m.children,u),i.child;case 9:return x=i.type._context,m=i.pendingProps.children,al(i),x=yr(x),m=m(x),i.flags|=1,vr(a,i,m,u),i.child;case 14:return IE(a,i,i.type,i.pendingProps,u);case 15:return kE(a,i,i.type,i.pendingProps,u);case 19:return BE(a,i,u);case 31:return v6(a,i,u);case 22:return LE(a,i,u,i.pendingProps);case 24:return al(i),m=yr(Hn),a===null?(x=Oy(),x===null&&(x=tn,C=Ay(),x.pooledCache=C,C.refCount++,C!==null&&(x.pooledCacheLanes|=u),x=C),i.memoizedState={parent:m,cache:x},Iy(i),Zo(i,Hn,x)):((a.lanes&u)!==0&&(ky(a,i),ad(i,null,null,u),rd()),x=a.memoizedState,C=i.memoizedState,x.parent!==m?(x={parent:m,cache:m},i.memoizedState=x,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=x),Zo(i,Hn,m)):(m=C.cache,Zo(i,Hn,m),m!==x.cache&&Ny(i,[Hn],u,!0))),vr(a,i,i.pendingProps.children,u),i.child;case 29:throw i.pendingProps}throw Error(r(156,i.tag))}function lo(a){a.flags|=4}function gv(a,i,u,m,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(vw())a.flags|=8192;else throw il=Sh,My}else a.flags&=-16777217}function qE(a,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!i2(i))if(vw())a.flags|=8192;else throw il=Sh,My}function Uh(a,i){i!==null&&(a.flags|=4),a.flags&16384&&(i=a.tag!==22?On():536870912,a.lanes|=i,wc|=i)}function ud(a,i){if(!Nt)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 m=null;u!==null;)u.alternate!==null&&(m=u),u=u.sibling;m===null?i||a.tail===null?a.tail=null:a.tail.sibling=null:m.sibling=null}}function un(a){var i=a.alternate!==null&&a.alternate.child===a.child,u=0,m=0;if(i)for(var x=a.child;x!==null;)u|=x.lanes|x.childLanes,m|=x.subtreeFlags&65011712,m|=x.flags&65011712,x.return=a,x=x.sibling;else for(x=a.child;x!==null;)u|=x.lanes|x.childLanes,m|=x.subtreeFlags,m|=x.flags,x.return=a,x=x.sibling;return a.subtreeFlags|=m,a.childLanes=u,i}function b6(a,i,u){var m=i.pendingProps;switch(wy(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return un(i),null;case 1:return un(i),null;case 3:return u=i.stateNode,m=null,a!==null&&(m=a.memoizedState.cache),i.memoizedState.cache!==m&&(i.flags|=2048),ao(Hn),we(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(a===null||a.child===null)&&(dc(i)?lo(i):a===null||a.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Ty())),un(i),null;case 26:var x=i.type,C=i.memoizedState;return a===null?(lo(i),C!==null?(un(i),qE(i,C)):(un(i),gv(i,x,null,m,u))):C?C!==a.memoizedState?(lo(i),un(i),qE(i,C)):(un(i),i.flags&=-16777217):(a=a.memoizedProps,a!==m&&lo(i),un(i),gv(i,x,a,m,u)),null;case 27:if(He(i),u=ve.current,x=i.type,a!==null&&i.stateNode!=null)a.memoizedProps!==m&&lo(i);else{if(!m){if(i.stateNode===null)throw Error(r(166));return un(i),null}a=te.current,dc(i)?RC(i):(a=Jw(x,m,u),i.stateNode=a,lo(i))}return un(i),null;case 5:if(He(i),x=i.type,a!==null&&i.stateNode!=null)a.memoizedProps!==m&&lo(i);else{if(!m){if(i.stateNode===null)throw Error(r(166));return un(i),null}if(C=te.current,dc(i))RC(i);else{var N=Jh(ve.current);switch(C){case 1:C=N.createElementNS("http://www.w3.org/2000/svg",x);break;case 2:C=N.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;default:switch(x){case"svg":C=N.createElementNS("http://www.w3.org/2000/svg",x);break;case"math":C=N.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;case"script":C=N.createElement("div"),C.innerHTML="<script><\/script>",C=C.removeChild(C.firstChild);break;case"select":C=typeof m.is=="string"?N.createElement("select",{is:m.is}):N.createElement("select"),m.multiple?C.multiple=!0:m.size&&(C.size=m.size);break;default:C=typeof m.is=="string"?N.createElement(x,{is:m.is}):N.createElement(x)}}C[Ve]=i,C[Ge]=m;e:for(N=i.child;N!==null;){if(N.tag===5||N.tag===6)C.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=C;e:switch(xr(C,x,m),x){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&lo(i)}}return un(i),gv(i,i.type,a===null?null:a.memoizedProps,i.pendingProps,u),null;case 6:if(a&&i.stateNode!=null)a.memoizedProps!==m&&lo(i);else{if(typeof m!="string"&&i.stateNode===null)throw Error(r(166));if(a=ve.current,dc(i)){if(a=i.stateNode,u=i.memoizedProps,m=null,x=gr,x!==null)switch(x.tag){case 27:case 5:m=x.memoizedProps}a[Ve]=i,a=!!(a.nodeValue===u||m!==null&&m.suppressHydrationWarning===!0||$w(a.nodeValue,u)),a||qo(i,!0)}else a=Jh(a).createTextNode(m),a[Ve]=i,i.stateNode=a}return un(i),null;case 31:if(u=i.memoizedState,a===null||a.memoizedState!==null){if(m=dc(i),u!==null){if(a===null){if(!m)throw Error(r(318));if(a=i.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(557));a[Ve]=i}else nl(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;un(i),a=!1}else u=Ty(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=u),a=!0;if(!a)return i.flags&256?(la(i),i):(la(i),null);if((i.flags&128)!==0)throw Error(r(558))}return un(i),null;case 13:if(m=i.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(x=dc(i),m!==null&&m.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[Ve]=i}else nl(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;un(i),x=!1}else x=Ty(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=x),x=!0;if(!x)return i.flags&256?(la(i),i):(la(i),null)}return la(i),(i.flags&128)!==0?(i.lanes=u,i):(u=m!==null,a=a!==null&&a.memoizedState!==null,u&&(m=i.child,x=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(x=m.alternate.memoizedState.cachePool.pool),C=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(C=m.memoizedState.cachePool.pool),C!==x&&(m.flags|=2048)),u!==a&&u&&(i.child.flags|=8192),Uh(i,i.updateQueue),un(i),null);case 4:return we(),a===null&&Uv(i.stateNode.containerInfo),un(i),null;case 10:return ao(i.type),un(i),null;case 19:if(P(Mn),m=i.memoizedState,m===null)return un(i),null;if(x=(i.flags&128)!==0,C=m.rendering,C===null)if(x)ud(m,!1);else{if(wn!==0||a!==null&&(a.flags&128)!==0)for(a=i.child;a!==null;){if(C=Rh(a),C!==null){for(i.flags|=128,ud(m,!1),a=C.updateQueue,i.updateQueue=a,Uh(i,a),i.subtreeFlags=0,a=u,u=i.child;u!==null;)bC(u,a),u=u.sibling;return q(Mn,Mn.current&1|2),Nt&&no(i,m.treeForkCount),i.child}a=a.sibling}m.tail!==null&&be()>Hh&&(i.flags|=128,x=!0,ud(m,!1),i.lanes=4194304)}else{if(!x)if(a=Rh(C),a!==null){if(i.flags|=128,x=!0,a=a.updateQueue,i.updateQueue=a,Uh(i,a),ud(m,!0),m.tail===null&&m.tailMode==="hidden"&&!C.alternate&&!Nt)return un(i),null}else 2*be()-m.renderingStartTime>Hh&&u!==536870912&&(i.flags|=128,x=!0,ud(m,!1),i.lanes=4194304);m.isBackwards?(C.sibling=i.child,i.child=C):(a=m.last,a!==null?a.sibling=C:i.child=C,m.last=C)}return m.tail!==null?(a=m.tail,m.rendering=a,m.tail=a.sibling,m.renderingStartTime=be(),a.sibling=null,u=Mn.current,q(Mn,x?u&1|2:u&1),Nt&&no(i,m.treeForkCount),a):(un(i),null);case 22:case 23:return la(i),Fy(),m=i.memoizedState!==null,a!==null?a.memoizedState!==null!==m&&(i.flags|=8192):m&&(i.flags|=8192),m?(u&536870912)!==0&&(i.flags&128)===0&&(un(i),i.subtreeFlags&6&&(i.flags|=8192)):un(i),u=i.updateQueue,u!==null&&Uh(i,u.retryQueue),u=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),m=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(m=i.memoizedState.cachePool.pool),m!==u&&(i.flags|=2048),a!==null&&P(sl),null;case 24:return u=null,a!==null&&(u=a.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),ao(Hn),un(i),null;case 25:return null;case 30:return null}throw Error(r(156,i.tag))}function S6(a,i){switch(wy(i),i.tag){case 1:return a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 3:return ao(Hn),we(),a=i.flags,(a&65536)!==0&&(a&128)===0?(i.flags=a&-65537|128,i):null;case 26:case 27:case 5:return He(i),null;case 31:if(i.memoizedState!==null){if(la(i),i.alternate===null)throw Error(r(340));nl()}return a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 13:if(la(i),a=i.memoizedState,a!==null&&a.dehydrated!==null){if(i.alternate===null)throw Error(r(340));nl()}return a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 19:return P(Mn),null;case 4:return we(),null;case 10:return ao(i.type),null;case 22:case 23:return la(i),Fy(),a!==null&&P(sl),a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 24:return ao(Hn),null;case 25:return null;default:return null}}function ZE(a,i){switch(wy(i),i.tag){case 3:ao(Hn),we();break;case 26:case 27:case 5:He(i);break;case 4:we();break;case 31:i.memoizedState!==null&&la(i);break;case 13:la(i);break;case 19:P(Mn);break;case 10:ao(i.type);break;case 22:case 23:la(i),Fy(),a!==null&&P(sl);break;case 24:ao(Hn)}}function dd(a,i){try{var u=i.updateQueue,m=u!==null?u.lastEffect:null;if(m!==null){var x=m.next;u=x;do{if((u.tag&a)===a){m=void 0;var C=u.create,N=u.inst;m=C(),N.destroy=m}u=u.next}while(u!==x)}}catch(I){Kt(i,i.return,I)}}function Jo(a,i,u){try{var m=i.updateQueue,x=m!==null?m.lastEffect:null;if(x!==null){var C=x.next;m=C;do{if((m.tag&a)===a){var N=m.inst,I=N.destroy;if(I!==void 0){N.destroy=void 0,x=i;var V=u,ae=I;try{ae()}catch(he){Kt(x,V,he)}}}m=m.next}while(m!==C)}}catch(he){Kt(i,i.return,he)}}function KE(a){var i=a.updateQueue;if(i!==null){var u=a.stateNode;try{UC(i,u)}catch(m){Kt(a,a.return,m)}}}function YE(a,i,u){u.props=ul(a.type,a.memoizedProps),u.state=a.memoizedState;try{u.componentWillUnmount()}catch(m){Kt(a,i,m)}}function fd(a,i){try{var u=a.ref;if(u!==null){switch(a.tag){case 26:case 27:case 5:var m=a.stateNode;break;case 30:m=a.stateNode;break;default:m=a.stateNode}typeof u=="function"?a.refCleanup=u(m):u.current=m}}catch(x){Kt(a,i,x)}}function js(a,i){var u=a.ref,m=a.refCleanup;if(u!==null)if(typeof m=="function")try{m()}catch(x){Kt(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){Kt(a,i,x)}else u.current=null}function WE(a){var i=a.type,u=a.memoizedProps,m=a.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":u.autoFocus&&m.focus();break e;case"img":u.src?m.src=u.src:u.srcSet&&(m.srcset=u.srcSet)}}catch(x){Kt(a,a.return,x)}}function yv(a,i,u){try{var m=a.stateNode;H6(m,a.type,u,i),m[Ge]=i}catch(x){Kt(a,a.return,x)}}function QE(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&oi(a.type)||a.tag===4}function vv(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||QE(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&&oi(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 xv(a,i,u){var m=a.tag;if(m===5||m===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=Js));else if(m!==4&&(m===27&&oi(a.type)&&(u=a.stateNode,i=null),a=a.child,a!==null))for(xv(a,i,u),a=a.sibling;a!==null;)xv(a,i,u),a=a.sibling}function Fh(a,i,u){var m=a.tag;if(m===5||m===6)a=a.stateNode,i?u.insertBefore(a,i):u.appendChild(a);else if(m!==4&&(m===27&&oi(a.type)&&(u=a.stateNode),a=a.child,a!==null))for(Fh(a,i,u),a=a.sibling;a!==null;)Fh(a,i,u),a=a.sibling}function XE(a){var i=a.stateNode,u=a.memoizedProps;try{for(var m=a.type,x=i.attributes;x.length;)i.removeAttributeNode(x[0]);xr(i,m,u),i[Ve]=a,i[Ge]=u}catch(C){Kt(a,a.return,C)}}var co=!1,qn=!1,bv=!1,JE=typeof WeakSet=="function"?WeakSet:Set,ur=null;function C6(a,i){if(a=a.containerInfo,Vv=om,a=dC(a),hy(a)){if("selectionStart"in a)var u={start:a.selectionStart,end:a.selectionEnd};else e:{u=(u=a.ownerDocument)&&u.defaultView||window;var m=u.getSelection&&u.getSelection();if(m&&m.rangeCount!==0){u=m.anchorNode;var x=m.anchorOffset,C=m.focusNode;m=m.focusOffset;try{u.nodeType,C.nodeType}catch{u=null;break e}var N=0,I=-1,V=-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!==C||m!==0&&pe.nodeType!==3||(V=N+m),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===C&&++he===m&&(V=N),(fe=pe.nextSibling)!==null)break;pe=oe,oe=pe.parentNode}pe=fe}u=I===-1||V===-1?null:{start:I,end:V}}else u=null}u=u||{start:0,end:0}}else u=null;for($v={focusedElem:a,selectionRange:u},om=!1,ur=i;ur!==null;)if(i=ur,a=i.child,(i.subtreeFlags&1028)!==0&&a!==null)a.return=i,ur=a;else for(;ur!==null;){switch(i=ur,C=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&&C!==null){a=void 0,u=i,x=C.memoizedProps,C=C.memoizedState,m=u.stateNode;try{var Be=ul(u.type,x);a=m.getSnapshotBeforeUpdate(Be,C),m.__reactInternalSnapshotBeforeUpdate=a}catch(tt){Kt(u,u.return,tt)}}break;case 3:if((a&1024)!==0){if(a=i.stateNode.containerInfo,u=a.nodeType,u===9)Gv(a);else if(u===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Gv(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,ur=a;break}ur=i.return}}function ew(a,i,u){var m=u.flags;switch(u.tag){case 0:case 11:case 15:fo(a,u),m&4&&dd(5,u);break;case 1:if(fo(a,u),m&4)if(a=u.stateNode,i===null)try{a.componentDidMount()}catch(N){Kt(u,u.return,N)}else{var x=ul(u.type,i.memoizedProps);i=i.memoizedState;try{a.componentDidUpdate(x,i,a.__reactInternalSnapshotBeforeUpdate)}catch(N){Kt(u,u.return,N)}}m&64&&KE(u),m&512&&fd(u,u.return);break;case 3:if(fo(a,u),m&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{UC(a,i)}catch(N){Kt(u,u.return,N)}}break;case 27:i===null&&m&4&&XE(u);case 26:case 5:fo(a,u),i===null&&m&4&&WE(u),m&512&&fd(u,u.return);break;case 12:fo(a,u);break;case 31:fo(a,u),m&4&&rw(a,u);break;case 13:fo(a,u),m&4&&aw(a,u),m&64&&(a=u.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(u=D6.bind(null,u),Q6(a,u))));break;case 22:if(m=u.memoizedState!==null||co,!m){i=i!==null&&i.memoizedState!==null||qn,x=co;var C=qn;co=m,(qn=i)&&!C?ho(a,u,(u.subtreeFlags&8772)!==0):fo(a,u),co=x,qn=C}break;case 30:break;default:fo(a,u)}}function tw(a){var i=a.alternate;i!==null&&(a.alternate=null,tw(i)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(i=a.stateNode,i!==null&&qt(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 hn=null,Yr=!1;function uo(a,i,u){for(u=u.child;u!==null;)nw(a,i,u),u=u.sibling}function nw(a,i,u){if(bn&&typeof bn.onCommitFiberUnmount=="function")try{bn.onCommitFiberUnmount(Dn,u)}catch{}switch(u.tag){case 26:qn||js(u,i),uo(a,i,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:qn||js(u,i);var m=hn,x=Yr;oi(u.type)&&(hn=u.stateNode,Yr=!1),uo(a,i,u),Sd(u.stateNode),hn=m,Yr=x;break;case 5:qn||js(u,i);case 6:if(m=hn,x=Yr,hn=null,uo(a,i,u),hn=m,Yr=x,hn!==null)if(Yr)try{(hn.nodeType===9?hn.body:hn.nodeName==="HTML"?hn.ownerDocument.body:hn).removeChild(u.stateNode)}catch(C){Kt(u,i,C)}else try{hn.removeChild(u.stateNode)}catch(C){Kt(u,i,C)}break;case 18:hn!==null&&(Yr?(a=hn,Kw(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,u.stateNode),Oc(a)):Kw(hn,u.stateNode));break;case 4:m=hn,x=Yr,hn=u.stateNode.containerInfo,Yr=!0,uo(a,i,u),hn=m,Yr=x;break;case 0:case 11:case 14:case 15:Jo(2,u,i),qn||Jo(4,u,i),uo(a,i,u);break;case 1:qn||(js(u,i),m=u.stateNode,typeof m.componentWillUnmount=="function"&&YE(u,i,m)),uo(a,i,u);break;case 21:uo(a,i,u);break;case 22:qn=(m=qn)||u.memoizedState!==null,uo(a,i,u),qn=m;break;default:uo(a,i,u)}}function rw(a,i){if(i.memoizedState===null&&(a=i.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{Oc(a)}catch(u){Kt(i,i.return,u)}}}function aw(a,i){if(i.memoizedState===null&&(a=i.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Oc(a)}catch(u){Kt(i,i.return,u)}}function E6(a){switch(a.tag){case 31:case 13:case 19:var i=a.stateNode;return i===null&&(i=a.stateNode=new JE),i;case 22:return a=a.stateNode,i=a._retryCache,i===null&&(i=a._retryCache=new JE),i;default:throw Error(r(435,a.tag))}}function zh(a,i){var u=E6(a);i.forEach(function(m){if(!u.has(m)){u.add(m);var x=O6.bind(null,a,m);m.then(x,x)}})}function Wr(a,i){var u=i.deletions;if(u!==null)for(var m=0;m<u.length;m++){var x=u[m],C=a,N=i,I=N;e:for(;I!==null;){switch(I.tag){case 27:if(oi(I.type)){hn=I.stateNode,Yr=!1;break e}break;case 5:hn=I.stateNode,Yr=!1;break e;case 3:case 4:hn=I.stateNode.containerInfo,Yr=!0;break e}I=I.return}if(hn===null)throw Error(r(160));nw(C,N,x),hn=null,Yr=!1,C=x.alternate,C!==null&&(C.return=null),x.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)sw(i,a),i=i.sibling}var ns=null;function sw(a,i){var u=a.alternate,m=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:Wr(i,a),Qr(a),m&4&&(Jo(3,a,a.return),dd(3,a),Jo(5,a,a.return));break;case 1:Wr(i,a),Qr(a),m&512&&(qn||u===null||js(u,u.return)),m&64&&co&&(a=a.updateQueue,a!==null&&(m=a.callbacks,m!==null&&(u=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=u===null?m:u.concat(m))));break;case 26:var x=ns;if(Wr(i,a),Qr(a),m&512&&(qn||u===null||js(u,u.return)),m&4){var C=u!==null?u.memoizedState:null;if(m=a.memoizedState,u===null)if(m===null)if(a.stateNode===null){e:{m=a.type,u=a.memoizedProps,x=x.ownerDocument||x;t:switch(m){case"title":C=x.getElementsByTagName("title")[0],(!C||C[Gt]||C[Ve]||C.namespaceURI==="http://www.w3.org/2000/svg"||C.hasAttribute("itemprop"))&&(C=x.createElement(m),x.head.insertBefore(C,x.querySelector("head > title"))),xr(C,m,u),C[Ve]=a,Cn(C),m=C;break e;case"link":var N=s2("link","href",x).get(m+(u.href||""));if(N){for(var I=0;I<N.length;I++)if(C=N[I],C.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&C.getAttribute("rel")===(u.rel==null?null:u.rel)&&C.getAttribute("title")===(u.title==null?null:u.title)&&C.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){N.splice(I,1);break t}}C=x.createElement(m),xr(C,m,u),x.head.appendChild(C);break;case"meta":if(N=s2("meta","content",x).get(m+(u.content||""))){for(I=0;I<N.length;I++)if(C=N[I],C.getAttribute("content")===(u.content==null?null:""+u.content)&&C.getAttribute("name")===(u.name==null?null:u.name)&&C.getAttribute("property")===(u.property==null?null:u.property)&&C.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&C.getAttribute("charset")===(u.charSet==null?null:u.charSet)){N.splice(I,1);break t}}C=x.createElement(m),xr(C,m,u),x.head.appendChild(C);break;default:throw Error(r(468,m))}C[Ve]=a,Cn(C),m=C}a.stateNode=m}else o2(x,a.type,a.stateNode);else a.stateNode=a2(x,m,a.memoizedProps);else C!==m?(C===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):C.count--,m===null?o2(x,a.type,a.stateNode):a2(x,m,a.memoizedProps)):m===null&&a.stateNode!==null&&yv(a,a.memoizedProps,u.memoizedProps)}break;case 27:Wr(i,a),Qr(a),m&512&&(qn||u===null||js(u,u.return)),u!==null&&m&4&&yv(a,a.memoizedProps,u.memoizedProps);break;case 5:if(Wr(i,a),Qr(a),m&512&&(qn||u===null||js(u,u.return)),a.flags&32){x=a.stateNode;try{tc(x,"")}catch(Be){Kt(a,a.return,Be)}}m&4&&a.stateNode!=null&&(x=a.memoizedProps,yv(a,x,u!==null?u.memoizedProps:x)),m&1024&&(bv=!0);break;case 6:if(Wr(i,a),Qr(a),m&4){if(a.stateNode===null)throw Error(r(162));m=a.memoizedProps,u=a.stateNode;try{u.nodeValue=m}catch(Be){Kt(a,a.return,Be)}}break;case 3:if(nm=null,x=ns,ns=em(i.containerInfo),Wr(i,a),ns=x,Qr(a),m&4&&u!==null&&u.memoizedState.isDehydrated)try{Oc(i.containerInfo)}catch(Be){Kt(a,a.return,Be)}bv&&(bv=!1,ow(a));break;case 4:m=ns,ns=em(a.stateNode.containerInfo),Wr(i,a),Qr(a),ns=m;break;case 12:Wr(i,a),Qr(a);break;case 31:Wr(i,a),Qr(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,zh(a,m)));break;case 13:Wr(i,a),Qr(a),a.child.flags&8192&&a.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&($h=be()),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,zh(a,m)));break;case 22:x=a.memoizedState!==null;var V=u!==null&&u.memoizedState!==null,ae=co,he=qn;if(co=ae||x,qn=he||V,Wr(i,a),qn=he,co=ae,Qr(a),m&8192)e:for(i=a.stateNode,i._visibility=x?i._visibility&-2:i._visibility|1,x&&(u===null||V||co||qn||dl(a)),u=null,i=a;;){if(i.tag===5||i.tag===26){if(u===null){V=u=i;try{if(C=V.stateNode,x)N=C.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none";else{I=V.stateNode;var pe=V.memoizedProps.style,oe=pe!=null&&pe.hasOwnProperty("display")?pe.display:null;I.style.display=oe==null||typeof oe=="boolean"?"":(""+oe).trim()}}catch(Be){Kt(V,V.return,Be)}}}else if(i.tag===6){if(u===null){V=i;try{V.stateNode.nodeValue=x?"":V.memoizedProps}catch(Be){Kt(V,V.return,Be)}}}else if(i.tag===18){if(u===null){V=i;try{var fe=V.stateNode;x?Yw(fe,!0):Yw(V.stateNode,!1)}catch(Be){Kt(V,V.return,Be)}}}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}m&4&&(m=a.updateQueue,m!==null&&(u=m.retryQueue,u!==null&&(m.retryQueue=null,zh(a,u))));break;case 19:Wr(i,a),Qr(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,zh(a,m)));break;case 30:break;case 21:break;default:Wr(i,a),Qr(a)}}function Qr(a){var i=a.flags;if(i&2){try{for(var u,m=a.return;m!==null;){if(QE(m)){u=m;break}m=m.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var x=u.stateNode,C=vv(a);Fh(a,C,x);break;case 5:var N=u.stateNode;u.flags&32&&(tc(N,""),u.flags&=-33);var I=vv(a);Fh(a,I,N);break;case 3:case 4:var V=u.stateNode.containerInfo,ae=vv(a);xv(a,ae,V);break;default:throw Error(r(161))}}catch(he){Kt(a,a.return,he)}a.flags&=-3}i&4096&&(a.flags&=-4097)}function ow(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var i=a;ow(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),a=a.sibling}}function fo(a,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)ew(a,i.alternate,i),i=i.sibling}function dl(a){for(a=a.child;a!==null;){var i=a;switch(i.tag){case 0:case 11:case 14:case 15:Jo(4,i,i.return),dl(i);break;case 1:js(i,i.return);var u=i.stateNode;typeof u.componentWillUnmount=="function"&&YE(i,i.return,u),dl(i);break;case 27:Sd(i.stateNode);case 26:case 5:js(i,i.return),dl(i);break;case 22:i.memoizedState===null&&dl(i);break;case 30:dl(i);break;default:dl(i)}a=a.sibling}}function ho(a,i,u){for(u=u&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var m=i.alternate,x=a,C=i,N=C.flags;switch(C.tag){case 0:case 11:case 15:ho(x,C,u),dd(4,C);break;case 1:if(ho(x,C,u),m=C,x=m.stateNode,typeof x.componentDidMount=="function")try{x.componentDidMount()}catch(ae){Kt(m,m.return,ae)}if(m=C,x=m.updateQueue,x!==null){var I=m.stateNode;try{var V=x.shared.hiddenCallbacks;if(V!==null)for(x.shared.hiddenCallbacks=null,x=0;x<V.length;x++)PC(V[x],I)}catch(ae){Kt(m,m.return,ae)}}u&&N&64&&KE(C),fd(C,C.return);break;case 27:XE(C);case 26:case 5:ho(x,C,u),u&&m===null&&N&4&&WE(C),fd(C,C.return);break;case 12:ho(x,C,u);break;case 31:ho(x,C,u),u&&N&4&&rw(x,C);break;case 13:ho(x,C,u),u&&N&4&&aw(x,C);break;case 22:C.memoizedState===null&&ho(x,C,u),fd(C,C.return);break;case 30:break;default:ho(x,C,u)}i=i.sibling}}function Sv(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&&Xu(u))}function Cv(a,i){a=null,i.alternate!==null&&(a=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==a&&(i.refCount++,a!=null&&Xu(a))}function rs(a,i,u,m){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)iw(a,i,u,m),i=i.sibling}function iw(a,i,u,m){var x=i.flags;switch(i.tag){case 0:case 11:case 15:rs(a,i,u,m),x&2048&&dd(9,i);break;case 1:rs(a,i,u,m);break;case 3:rs(a,i,u,m),x&2048&&(a=null,i.alternate!==null&&(a=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==a&&(i.refCount++,a!=null&&Xu(a)));break;case 12:if(x&2048){rs(a,i,u,m),a=i.stateNode;try{var C=i.memoizedProps,N=C.id,I=C.onPostCommit;typeof I=="function"&&I(N,i.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(V){Kt(i,i.return,V)}}else rs(a,i,u,m);break;case 31:rs(a,i,u,m);break;case 13:rs(a,i,u,m);break;case 23:break;case 22:C=i.stateNode,N=i.alternate,i.memoizedState!==null?C._visibility&2?rs(a,i,u,m):hd(a,i):C._visibility&2?rs(a,i,u,m):(C._visibility|=2,Sc(a,i,u,m,(i.subtreeFlags&10256)!==0||!1)),x&2048&&Sv(N,i);break;case 24:rs(a,i,u,m),x&2048&&Cv(i.alternate,i);break;default:rs(a,i,u,m)}}function Sc(a,i,u,m,x){for(x=x&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var C=a,N=i,I=u,V=m,ae=N.flags;switch(N.tag){case 0:case 11:case 15:Sc(C,N,I,V,x),dd(8,N);break;case 23:break;case 22:var he=N.stateNode;N.memoizedState!==null?he._visibility&2?Sc(C,N,I,V,x):hd(C,N):(he._visibility|=2,Sc(C,N,I,V,x)),x&&ae&2048&&Sv(N.alternate,N);break;case 24:Sc(C,N,I,V,x),x&&ae&2048&&Cv(N.alternate,N);break;default:Sc(C,N,I,V,x)}i=i.sibling}}function hd(a,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var u=a,m=i,x=m.flags;switch(m.tag){case 22:hd(u,m),x&2048&&Sv(m.alternate,m);break;case 24:hd(u,m),x&2048&&Cv(m.alternate,m);break;default:hd(u,m)}i=i.sibling}}var md=8192;function Cc(a,i,u){if(a.subtreeFlags&md)for(a=a.child;a!==null;)lw(a,i,u),a=a.sibling}function lw(a,i,u){switch(a.tag){case 26:Cc(a,i,u),a.flags&md&&a.memoizedState!==null&&cI(u,ns,a.memoizedState,a.memoizedProps);break;case 5:Cc(a,i,u);break;case 3:case 4:var m=ns;ns=em(a.stateNode.containerInfo),Cc(a,i,u),ns=m;break;case 22:a.memoizedState===null&&(m=a.alternate,m!==null&&m.memoizedState!==null?(m=md,md=16777216,Cc(a,i,u),md=m):Cc(a,i,u));break;default:Cc(a,i,u)}}function cw(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 pd(a){var i=a.deletions;if((a.flags&16)!==0){if(i!==null)for(var u=0;u<i.length;u++){var m=i[u];ur=m,dw(m,a)}cw(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)uw(a),a=a.sibling}function uw(a){switch(a.tag){case 0:case 11:case 15:pd(a),a.flags&2048&&Jo(9,a,a.return);break;case 3:pd(a);break;case 12:pd(a);break;case 22:var i=a.stateNode;a.memoizedState!==null&&i._visibility&2&&(a.return===null||a.return.tag!==13)?(i._visibility&=-3,Vh(a)):pd(a);break;default:pd(a)}}function Vh(a){var i=a.deletions;if((a.flags&16)!==0){if(i!==null)for(var u=0;u<i.length;u++){var m=i[u];ur=m,dw(m,a)}cw(a)}for(a=a.child;a!==null;){switch(i=a,i.tag){case 0:case 11:case 15:Jo(8,i,i.return),Vh(i);break;case 22:u=i.stateNode,u._visibility&2&&(u._visibility&=-3,Vh(i));break;default:Vh(i)}a=a.sibling}}function dw(a,i){for(;ur!==null;){var u=ur;switch(u.tag){case 0:case 11:case 15:Jo(8,u,i);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var m=u.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:Xu(u.memoizedState.cache)}if(m=u.child,m!==null)m.return=u,ur=m;else e:for(u=a;ur!==null;){m=ur;var x=m.sibling,C=m.return;if(tw(m),m===u){ur=null;break e}if(x!==null){x.return=C,ur=x;break e}ur=C}}}var w6={getCacheForType:function(a){var i=yr(Hn),u=i.data.get(a);return u===void 0&&(u=a(),i.data.set(a,u)),u},cacheSignal:function(){return yr(Hn).controller.signal}},R6=typeof WeakMap=="function"?WeakMap:Map,Pt=0,tn=null,xt=null,wt=0,Zt=0,ca=null,ei=!1,Ec=!1,Ev=!1,mo=0,wn=0,ti=0,fl=0,wv=0,ua=0,wc=0,gd=null,Xr=null,Rv=!1,$h=0,fw=0,Hh=1/0,Bh=null,ni=null,Jn=0,ri=null,Rc=null,po=0,Tv=0,jv=null,hw=null,yd=0,_v=null;function da(){return(Pt&2)!==0&&wt!==0?wt&-wt:k.T!==null?Iv():ke()}function mw(){if(ua===0)if((wt&536870912)===0||Nt){var a=Es;Es<<=1,(Es&3932160)===0&&(Es=262144),ua=a}else ua=536870912;return a=ia.current,a!==null&&(a.flags|=32),ua}function Jr(a,i,u){(a===tn&&(Zt===2||Zt===9)||a.cancelPendingCommit!==null)&&(Tc(a,0),ai(a,wt,ua,!1)),Br(a,u),((Pt&2)===0||a!==tn)&&(a===tn&&((Pt&2)===0&&(fl|=u),wn===4&&ai(a,wt,ua,!1)),_s(a))}function pw(a,i,u){if((Pt&6)!==0)throw Error(r(327));var m=!u&&(i&127)===0&&(i&a.expiredLanes)===0||mr(a,i),x=m?_6(a,i):Av(a,i,!0),C=m;do{if(x===0){Ec&&!m&&ai(a,i,0,!1);break}else{if(u=a.current.alternate,C&&!T6(u)){x=Av(a,i,!1),C=!1;continue}if(x===2){if(C=i,a.errorRecoveryDisabledLanes&C)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=gd;var V=I.current.memoizedState.isDehydrated;if(V&&(Tc(I,N).flags|=256),N=Av(I,N,!1),N!==2){if(Ev&&!V){I.errorRecoveryDisabledLanes|=C,fl|=C,x=4;break e}C=Xr,Xr=x,C!==null&&(Xr===null?Xr=C:Xr.push.apply(Xr,C))}x=N}if(C=!1,x!==2)continue}}if(x===1){Tc(a,0),ai(a,i,0,!0);break}e:{switch(m=a,C=x,C){case 0:case 1:throw Error(r(345));case 4:if((i&4194048)!==i)break;case 6:ai(m,i,ua,!ei);break e;case 2:Xr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((i&62914560)===i&&(x=$h+300-be(),10<x)){if(ai(m,i,ua,!ei),Vn(m,0,!0)!==0)break e;po=i,m.timeoutHandle=qw(gw.bind(null,m,u,Xr,Bh,Rv,i,ua,fl,wc,ei,C,"Throttled",-0,0),x);break e}gw(m,u,Xr,Bh,Rv,i,ua,fl,wc,ei,C,null,-0,0)}}break}while(!0);_s(a)}function gw(a,i,u,m,x,C,N,I,V,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:Js},lw(i,C,pe);var Be=(C&62914560)===C?$h-be():(C&4194048)===C?fw-be():0;if(Be=uI(pe,Be),Be!==null){po=C,a.cancelPendingCommit=Be(ww.bind(null,a,i,C,u,m,x,N,I,V,he,pe,null,oe,fe)),ai(a,C,N,!ae);return}}ww(a,i,C,u,m,x,N,I,V)}function T6(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 m=0;m<u.length;m++){var x=u[m],C=x.getSnapshot;x=x.value;try{if(!sa(C(),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 ai(a,i,u,m){i&=~wv,i&=~fl,a.suspendedLanes|=i,a.pingedLanes&=~i,m&&(a.warmLanes|=i),m=a.expirationTimes;for(var x=i;0<x;){var C=31-Sn(x),N=1<<C;m[C]=-1,x&=~N}u!==0&&X(a,u,i)}function Gh(){return(Pt&6)===0?(vd(0),!1):!0}function Nv(){if(xt!==null){if(Zt===0)var a=xt.return;else a=xt,ro=rl=null,Gy(a),gc=null,ed=0,a=xt;for(;a!==null;)ZE(a.alternate,a),a=a.return;xt=null}}function Tc(a,i){var u=a.timeoutHandle;u!==-1&&(a.timeoutHandle=-1,q6(u)),u=a.cancelPendingCommit,u!==null&&(a.cancelPendingCommit=null,u()),po=0,Nv(),tn=a,xt=u=to(a.current,null),wt=i,Zt=0,ca=null,ei=!1,Ec=mr(a,i),Ev=!1,wc=ua=wv=fl=ti=wn=0,Xr=gd=null,Rv=!1,(i&8)!==0&&(i|=i&32);var m=a.entangledLanes;if(m!==0)for(a=a.entanglements,m&=i;0<m;){var x=31-Sn(m),C=1<<x;i|=a[x],m&=~C}return mo=i,fh(),u}function yw(a,i){ft=null,k.H=ld,i===pc||i===bh?(i=MC(),Zt=3):i===My?(i=MC(),Zt=4):Zt=i===iv?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,ca=i,xt===null&&(wn=1,Ih(a,ka(i,a.current)))}function vw(){var a=ia.current;return a===null?!0:(wt&4194048)===wt?Fa===null:(wt&62914560)===wt||(wt&536870912)!==0?a===Fa:!1}function xw(){var a=k.H;return k.H=ld,a===null?ld:a}function bw(){var a=k.A;return k.A=w6,a}function qh(){wn=4,ei||(wt&4194048)!==wt&&ia.current!==null||(Ec=!0),(ti&134217727)===0&&(fl&134217727)===0||tn===null||ai(tn,wt,ua,!1)}function Av(a,i,u){var m=Pt;Pt|=2;var x=xw(),C=bw();(tn!==a||wt!==i)&&(Bh=null,Tc(a,i)),i=!1;var N=wn;e:do try{if(Zt!==0&&xt!==null){var I=xt,V=ca;switch(Zt){case 8:Nv(),N=6;break e;case 3:case 2:case 9:case 6:ia.current===null&&(i=!0);var ae=Zt;if(Zt=0,ca=null,jc(a,I,V,ae),u&&Ec){N=0;break e}break;default:ae=Zt,Zt=0,ca=null,jc(a,I,V,ae)}}j6(),N=wn;break}catch(he){yw(a,he)}while(!0);return i&&a.shellSuspendCounter++,ro=rl=null,Pt=m,k.H=x,k.A=C,xt===null&&(tn=null,wt=0,fh()),N}function j6(){for(;xt!==null;)Sw(xt)}function _6(a,i){var u=Pt;Pt|=2;var m=xw(),x=bw();tn!==a||wt!==i?(Bh=null,Hh=be()+500,Tc(a,i)):Ec=mr(a,i);e:do try{if(Zt!==0&&xt!==null){i=xt;var C=ca;t:switch(Zt){case 1:Zt=0,ca=null,jc(a,i,C,1);break;case 2:case 9:if(DC(C)){Zt=0,ca=null,Cw(i);break}i=function(){Zt!==2&&Zt!==9||tn!==a||(Zt=7),_s(a)},C.then(i,i);break e;case 3:Zt=7;break e;case 4:Zt=5;break e;case 7:DC(C)?(Zt=0,ca=null,Cw(i)):(Zt=0,ca=null,jc(a,i,C,7));break;case 5:var N=null;switch(xt.tag){case 26:N=xt.memoizedState;case 5:case 27:var I=xt;if(N?i2(N):I.stateNode.complete){Zt=0,ca=null;var V=I.sibling;if(V!==null)xt=V;else{var ae=I.return;ae!==null?(xt=ae,Zh(ae)):xt=null}break t}}Zt=0,ca=null,jc(a,i,C,5);break;case 6:Zt=0,ca=null,jc(a,i,C,6);break;case 8:Nv(),wn=6;break e;default:throw Error(r(462))}}N6();break}catch(he){yw(a,he)}while(!0);return ro=rl=null,k.H=m,k.A=x,Pt=u,xt!==null?0:(tn=null,wt=0,fh(),wn)}function N6(){for(;xt!==null&&!de();)Sw(xt)}function Sw(a){var i=GE(a.alternate,a,mo);a.memoizedProps=a.pendingProps,i===null?Zh(a):xt=i}function Cw(a){var i=a,u=i.alternate;switch(i.tag){case 15:case 0:i=FE(u,i,i.pendingProps,i.type,void 0,wt);break;case 11:i=FE(u,i,i.pendingProps,i.type.render,i.ref,wt);break;case 5:Gy(i);default:ZE(u,i),i=xt=bC(i,mo),i=GE(u,i,mo)}a.memoizedProps=a.pendingProps,i===null?Zh(a):xt=i}function jc(a,i,u,m){ro=rl=null,Gy(i),gc=null,ed=0;var x=i.return;try{if(y6(a,x,i,u,wt)){wn=1,Ih(a,ka(u,a.current)),xt=null;return}}catch(C){if(x!==null)throw xt=x,C;wn=1,Ih(a,ka(u,a.current)),xt=null;return}i.flags&32768?(Nt||m===1?a=!0:Ec||(wt&536870912)!==0?a=!1:(ei=a=!0,(m===2||m===9||m===3||m===6)&&(m=ia.current,m!==null&&m.tag===13&&(m.flags|=16384))),Ew(i,a)):Zh(i)}function Zh(a){var i=a;do{if((i.flags&32768)!==0){Ew(i,ei);return}a=i.return;var u=b6(i.alternate,i,mo);if(u!==null){xt=u;return}if(i=i.sibling,i!==null){xt=i;return}xt=i=a}while(i!==null);wn===0&&(wn=5)}function Ew(a,i){do{var u=S6(a.alternate,a);if(u!==null){u.flags&=32767,xt=u;return}if(u=a.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!i&&(a=a.sibling,a!==null)){xt=a;return}xt=a=u}while(a!==null);wn=6,xt=null}function ww(a,i,u,m,x,C,N,I,V){a.cancelPendingCommit=null;do Kh();while(Jn!==0);if((Pt&6)!==0)throw Error(r(327));if(i!==null){if(i===a.current)throw Error(r(177));if(C=i.lanes|i.childLanes,C|=vy,z(a,u,C,N,I,V),a===tn&&(xt=tn=null,wt=0),Rc=i,ri=a,po=u,Tv=C,jv=x,hw=m,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,M6(ot,function(){return Nw(),null})):(a.callbackNode=null,a.callbackPriority=0),m=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||m){m=k.T,k.T=null,x=H.p,H.p=2,N=Pt,Pt|=4;try{C6(a,i,u)}finally{Pt=N,H.p=x,k.T=m}}Jn=1,Rw(),Tw(),jw()}}function Rw(){if(Jn===1){Jn=0;var a=ri,i=Rc,u=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||u){u=k.T,k.T=null;var m=H.p;H.p=2;var x=Pt;Pt|=4;try{sw(i,a);var C=$v,N=dC(a.containerInfo),I=C.focusedElem,V=C.selectionRange;if(N!==I&&I&&I.ownerDocument&&uC(I.ownerDocument.documentElement,I)){if(V!==null&&hy(I)){var ae=V.start,he=V.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(),Be=I.textContent.length,tt=Math.min(V.start,Be),Jt=V.end===void 0?tt:Math.min(V.end,Be);!fe.extend&&tt>Jt&&(N=Jt,Jt=tt,tt=N);var J=cC(I,tt),K=cC(I,Jt);if(J&&K&&(fe.rangeCount!==1||fe.anchorNode!==J.node||fe.anchorOffset!==J.offset||fe.focusNode!==K.node||fe.focusOffset!==K.offset)){var re=pe.createRange();re.setStart(J.node,J.offset),fe.removeAllRanges(),tt>Jt?(fe.addRange(re),fe.extend(K.node,K.offset)):(re.setEnd(K.node,K.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}}om=!!Vv,$v=Vv=null}finally{Pt=x,H.p=m,k.T=u}}a.current=i,Jn=2}}function Tw(){if(Jn===2){Jn=0;var a=ri,i=Rc,u=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||u){u=k.T,k.T=null;var m=H.p;H.p=2;var x=Pt;Pt|=4;try{ew(a,i.alternate,i)}finally{Pt=x,H.p=m,k.T=u}}Jn=3}}function jw(){if(Jn===4||Jn===3){Jn=0,je();var a=ri,i=Rc,u=po,m=hw;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Jn=5:(Jn=0,Rc=ri=null,_w(a,a.pendingLanes));var x=a.pendingLanes;if(x===0&&(ni=null),ze(u),i=i.stateNode,bn&&typeof bn.onCommitFiberRoot=="function")try{bn.onCommitFiberRoot(Dn,i,void 0,(i.current.flags&128)===128)}catch{}if(m!==null){i=k.T,x=H.p,H.p=2,k.T=null;try{for(var C=a.onRecoverableError,N=0;N<m.length;N++){var I=m[N];C(I.value,{componentStack:I.stack})}}finally{k.T=i,H.p=x}}(po&3)!==0&&Kh(),_s(a),x=a.pendingLanes,(u&261930)!==0&&(x&42)!==0?a===_v?yd++:(yd=0,_v=a):yd=0,vd(0)}}function _w(a,i){(a.pooledCacheLanes&=i)===0&&(i=a.pooledCache,i!=null&&(a.pooledCache=null,Xu(i)))}function Kh(){return Rw(),Tw(),jw(),Nw()}function Nw(){if(Jn!==5)return!1;var a=ri,i=Tv;Tv=0;var u=ze(po),m=k.T,x=H.p;try{H.p=32>u?32:u,k.T=null,u=jv,jv=null;var C=ri,N=po;if(Jn=0,Rc=ri=null,po=0,(Pt&6)!==0)throw Error(r(331));var I=Pt;if(Pt|=4,uw(C.current),iw(C,C.current,N,u),Pt=I,vd(0,!1),bn&&typeof bn.onPostCommitFiberRoot=="function")try{bn.onPostCommitFiberRoot(Dn,C)}catch{}return!0}finally{H.p=x,k.T=m,_w(a,i)}}function Aw(a,i,u){i=ka(u,i),i=ov(a.stateNode,i,2),a=Wo(a,i,2),a!==null&&(Br(a,2),_s(a))}function Kt(a,i,u){if(a.tag===3)Aw(a,a,u);else for(;i!==null;){if(i.tag===3){Aw(i,a,u);break}else if(i.tag===1){var m=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(ni===null||!ni.has(m))){a=ka(u,a),u=DE(2),m=Wo(i,u,2),m!==null&&(OE(u,m,i,a),Br(m,2),_s(m));break}}i=i.return}}function Dv(a,i,u){var m=a.pingCache;if(m===null){m=a.pingCache=new R6;var x=new Set;m.set(i,x)}else x=m.get(i),x===void 0&&(x=new Set,m.set(i,x));x.has(u)||(Ev=!0,x.add(u),a=A6.bind(null,a,i,u),i.then(a,a))}function A6(a,i,u){var m=a.pingCache;m!==null&&m.delete(i),a.pingedLanes|=a.suspendedLanes&u,a.warmLanes&=~u,tn===a&&(wt&u)===u&&(wn===4||wn===3&&(wt&62914560)===wt&&300>be()-$h?(Pt&2)===0&&Tc(a,0):wv|=u,wc===wt&&(wc=0)),_s(a)}function Dw(a,i){i===0&&(i=On()),a=el(a,i),a!==null&&(Br(a,i),_s(a))}function D6(a){var i=a.memoizedState,u=0;i!==null&&(u=i.retryLane),Dw(a,u)}function O6(a,i){var u=0;switch(a.tag){case 31:case 13:var m=a.stateNode,x=a.memoizedState;x!==null&&(u=x.retryLane);break;case 19:m=a.stateNode;break;case 22:m=a.stateNode._retryCache;break;default:throw Error(r(314))}m!==null&&m.delete(i),Dw(a,u)}function M6(a,i){return U(a,i)}var Yh=null,_c=null,Ov=!1,Wh=!1,Mv=!1,si=0;function _s(a){a!==_c&&a.next===null&&(_c===null?Yh=_c=a:_c=_c.next=a),Wh=!0,Ov||(Ov=!0,k6())}function vd(a,i){if(!Mv&&Wh){Mv=!0;do for(var u=!1,m=Yh;m!==null;){if(a!==0){var x=m.pendingLanes;if(x===0)var C=0;else{var N=m.suspendedLanes,I=m.pingedLanes;C=(1<<31-Sn(42|a)+1)-1,C&=x&~(N&~I),C=C&201326741?C&201326741|1:C?C|2:0}C!==0&&(u=!0,kw(m,C))}else C=wt,C=Vn(m,m===tn?C:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(C&3)===0||mr(m,C)||(u=!0,kw(m,C));m=m.next}while(u);Mv=!1}}function I6(){Ow()}function Ow(){Wh=Ov=!1;var a=0;si!==0&&G6()&&(a=si);for(var i=be(),u=null,m=Yh;m!==null;){var x=m.next,C=Mw(m,i);C===0?(m.next=null,u===null?Yh=x:u.next=x,x===null&&(_c=u)):(u=m,(a!==0||(C&3)!==0)&&(Wh=!0)),m=x}Jn!==0&&Jn!==5||vd(a),si!==0&&(si=0)}function Mw(a,i){for(var u=a.suspendedLanes,m=a.pingedLanes,x=a.expirationTimes,C=a.pendingLanes&-62914561;0<C;){var N=31-Sn(C),I=1<<N,V=x[N];V===-1?((I&u)===0||(I&m)!==0)&&(x[N]=Qn(I,i)):V<=i&&(a.expiredLanes|=I),C&=~I}if(i=tn,u=wt,u=Vn(a,a===i?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m=a.callbackNode,u===0||a===i&&(Zt===2||Zt===9)||a.cancelPendingCommit!==null)return m!==null&&m!==null&&Q(m),a.callbackNode=null,a.callbackPriority=0;if((u&3)===0||mr(a,u)){if(i=u&-u,i===a.callbackPriority)return i;switch(m!==null&&Q(m),ze(u)){case 2:case 8:u=st;break;case 32:u=ot;break;case 268435456:u=Na;break;default:u=ot}return m=Iw.bind(null,a),u=U(u,m),a.callbackPriority=i,a.callbackNode=u,i}return m!==null&&m!==null&&Q(m),a.callbackPriority=2,a.callbackNode=null,2}function Iw(a,i){if(Jn!==0&&Jn!==5)return a.callbackNode=null,a.callbackPriority=0,null;var u=a.callbackNode;if(Kh()&&a.callbackNode!==u)return null;var m=wt;return m=Vn(a,a===tn?m:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m===0?null:(pw(a,m,i),Mw(a,be()),a.callbackNode!=null&&a.callbackNode===u?Iw.bind(null,a):null)}function kw(a,i){if(Kh())return null;pw(a,i,!0)}function k6(){Z6(function(){(Pt&6)!==0?U(Ye,I6):Ow()})}function Iv(){if(si===0){var a=hc;a===0&&(a=Ys,Ys<<=1,(Ys&261888)===0&&(Ys=256)),si=a}return si}function Lw(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:ah(""+a)}function Pw(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 L6(a,i,u,m,x){if(i==="submit"&&u&&u.stateNode===x){var C=Lw((x[Ge]||null).action),N=m.submitter;N&&(i=(i=N[Ge]||null)?Lw(i.formAction):N.getAttribute("formAction"),i!==null&&(C=i,N=null));var I=new lh("action","action",null,m,x);a.push({event:I,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(si!==0){var V=N?Pw(x,N):new FormData(x);ev(u,{pending:!0,data:V,method:x.method,action:C},null,V)}}else typeof C=="function"&&(I.preventDefault(),V=N?Pw(x,N):new FormData(x),ev(u,{pending:!0,data:V,method:x.method,action:C},C,V))},currentTarget:x}]})}}for(var kv=0;kv<yy.length;kv++){var Lv=yy[kv],P6=Lv.toLowerCase(),U6=Lv[0].toUpperCase()+Lv.slice(1);ts(P6,"on"+U6)}ts(mC,"onAnimationEnd"),ts(pC,"onAnimationIteration"),ts(gC,"onAnimationStart"),ts("dblclick","onDoubleClick"),ts("focusin","onFocus"),ts("focusout","onBlur"),ts(e6,"onTransitionRun"),ts(t6,"onTransitionStart"),ts(n6,"onTransitionCancel"),ts(yC,"onTransitionEnd"),es("onMouseEnter",["mouseout","mouseover"]),es("onMouseLeave",["mouseout","mouseover"]),es("onPointerEnter",["pointerout","pointerover"]),es("onPointerLeave",["pointerout","pointerover"]),Da("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Da("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Da("onBeforeInput",["compositionend","keypress","textInput","paste"]),Da("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Da("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Da("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xd="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(" "),F6=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(xd));function Uw(a,i){i=(i&4)!==0;for(var u=0;u<a.length;u++){var m=a[u],x=m.event;m=m.listeners;e:{var C=void 0;if(i)for(var N=m.length-1;0<=N;N--){var I=m[N],V=I.instance,ae=I.currentTarget;if(I=I.listener,V!==C&&x.isPropagationStopped())break e;C=I,x.currentTarget=ae;try{C(x)}catch(he){dh(he)}x.currentTarget=null,C=V}else for(N=0;N<m.length;N++){if(I=m[N],V=I.instance,ae=I.currentTarget,I=I.listener,V!==C&&x.isPropagationStopped())break e;C=I,x.currentTarget=ae;try{C(x)}catch(he){dh(he)}x.currentTarget=null,C=V}}}}function bt(a,i){var u=i[ct];u===void 0&&(u=i[ct]=new Set);var m=a+"__bubble";u.has(m)||(Fw(i,a,2,!1),u.add(m))}function Pv(a,i,u){var m=0;i&&(m|=4),Fw(u,a,m,i)}var Qh="_reactListening"+Math.random().toString(36).slice(2);function Uv(a){if(!a[Qh]){a[Qh]=!0,$o.forEach(function(u){u!=="selectionchange"&&(F6.has(u)||Pv(u,!1,a),Pv(u,!0,a))});var i=a.nodeType===9?a:a.ownerDocument;i===null||i[Qh]||(i[Qh]=!0,Pv("selectionchange",!1,i))}}function Fw(a,i,u,m){switch(m2(i)){case 2:var x=hI;break;case 8:x=mI;break;default:x=Jv}u=x.bind(null,i,u,a),x=void 0,!ay||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(x=!0),m?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 Fv(a,i,u,m,x){var C=m;if((i&1)===0&&(i&2)===0&&m!==null)e:for(;;){if(m===null)return;var N=m.tag;if(N===3||N===4){var I=m.stateNode.containerInfo;if(I===x)break;if(N===4)for(N=m.return;N!==null;){var V=N.tag;if((V===3||V===4)&&N.stateNode.containerInfo===x)return;N=N.return}for(;I!==null;){if(N=Gr(I),N===null)return;if(V=N.tag,V===5||V===6||V===26||V===27){m=C=N;continue e}I=I.parentNode}}m=m.return}BS(function(){var ae=C,he=ny(u),pe=[];e:{var oe=vC.get(a);if(oe!==void 0){var fe=lh,Be=a;switch(a){case"keypress":if(oh(u)===0)break e;case"keydown":case"keyup":fe=OM;break;case"focusin":Be="focus",fe=ly;break;case"focusout":Be="blur",fe=ly;break;case"beforeblur":case"afterblur":fe=ly;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=ZS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=bM;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=kM;break;case mC:case pC:case gC:fe=EM;break;case yC:fe=PM;break;case"scroll":case"scrollend":fe=vM;break;case"wheel":fe=FM;break;case"copy":case"cut":case"paste":fe=RM;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=YS;break;case"toggle":case"beforetoggle":fe=VM}var tt=(i&4)!==0,Jt=!tt&&(a==="scroll"||a==="scrollend"),J=tt?oe!==null?oe+"Capture":null:oe;tt=[];for(var K=ae,re;K!==null;){var me=K;if(re=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||re===null||J===null||(me=Vu(K,J),me!=null&&tt.push(bd(K,me,re))),Jt)break;K=K.return}0<tt.length&&(oe=new fe(oe,Be,null,u,he),pe.push({event:oe,listeners:tt}))}}if((i&7)===0){e:{if(oe=a==="mouseover"||a==="pointerover",fe=a==="mouseout"||a==="pointerout",oe&&u!==ty&&(Be=u.relatedTarget||u.fromElement)&&(Gr(Be)||Be[qe]))break e;if((fe||oe)&&(oe=he.window===he?he:(oe=he.ownerDocument)?oe.defaultView||oe.parentWindow:window,fe?(Be=u.relatedTarget||u.toElement,fe=ae,Be=Be?Gr(Be):null,Be!==null&&(Jt=l(Be),tt=Be.tag,Be!==Jt||tt!==5&&tt!==27&&tt!==6)&&(Be=null)):(fe=null,Be=ae),fe!==Be)){if(tt=ZS,me="onMouseLeave",J="onMouseEnter",K="mouse",(a==="pointerout"||a==="pointerover")&&(tt=YS,me="onPointerLeave",J="onPointerEnter",K="pointer"),Jt=fe==null?oe:qr(fe),re=Be==null?oe:qr(Be),oe=new tt(me,K+"leave",fe,u,he),oe.target=Jt,oe.relatedTarget=re,me=null,Gr(he)===ae&&(tt=new tt(J,K+"enter",Be,u,he),tt.target=re,tt.relatedTarget=Jt,me=tt),Jt=me,fe&&Be)t:{for(tt=z6,J=fe,K=Be,re=0,me=J;me;me=tt(me))re++;me=0;for(var et=K;et;et=tt(et))me++;for(;0<re-me;)J=tt(J),re--;for(;0<me-re;)K=tt(K),me--;for(;re--;){if(J===K||K!==null&&J===K.alternate){tt=J;break t}J=tt(J),K=tt(K)}tt=null}else tt=null;fe!==null&&zw(pe,oe,fe,tt,!1),Be!==null&&Jt!==null&&zw(pe,Jt,Be,tt,!0)}}e:{if(oe=ae?qr(ae):window,fe=oe.nodeName&&oe.nodeName.toLowerCase(),fe==="select"||fe==="input"&&oe.type==="file")var kt=rC;else if(tC(oe))if(aC)kt=QM;else{kt=YM;var Qe=KM}else fe=oe.nodeName,!fe||fe.toLowerCase()!=="input"||oe.type!=="checkbox"&&oe.type!=="radio"?ae&&ey(ae.elementType)&&(kt=rC):kt=WM;if(kt&&(kt=kt(a,ae))){nC(pe,kt,u,he);break e}Qe&&Qe(a,oe,ae),a==="focusout"&&ae&&oe.type==="number"&&ae.memoizedProps.value!=null&&Jg(oe,"number",oe.value)}switch(Qe=ae?qr(ae):window,a){case"focusin":(tC(Qe)||Qe.contentEditable==="true")&&(sc=Qe,my=ae,Yu=null);break;case"focusout":Yu=my=sc=null;break;case"mousedown":py=!0;break;case"contextmenu":case"mouseup":case"dragend":py=!1,fC(pe,u,he);break;case"selectionchange":if(JM)break;case"keydown":case"keyup":fC(pe,u,he)}var mt;if(uy)e:{switch(a){case"compositionstart":var Rt="onCompositionStart";break e;case"compositionend":Rt="onCompositionEnd";break e;case"compositionupdate":Rt="onCompositionUpdate";break e}Rt=void 0}else ac?JS(a,u)&&(Rt="onCompositionEnd"):a==="keydown"&&u.keyCode===229&&(Rt="onCompositionStart");Rt&&(WS&&u.locale!=="ko"&&(ac||Rt!=="onCompositionStart"?Rt==="onCompositionEnd"&&ac&&(mt=GS()):(Ho=he,sy="value"in Ho?Ho.value:Ho.textContent,ac=!0)),Qe=Xh(ae,Rt),0<Qe.length&&(Rt=new KS(Rt,a,null,u,he),pe.push({event:Rt,listeners:Qe}),mt?Rt.data=mt:(mt=eC(u),mt!==null&&(Rt.data=mt)))),(mt=HM?BM(a,u):GM(a,u))&&(Rt=Xh(ae,"onBeforeInput"),0<Rt.length&&(Qe=new KS("onBeforeInput","beforeinput",null,u,he),pe.push({event:Qe,listeners:Rt}),Qe.data=mt)),L6(pe,a,ae,u,he)}Uw(pe,i)})}function bd(a,i,u){return{instance:a,listener:i,currentTarget:u}}function Xh(a,i){for(var u=i+"Capture",m=[];a!==null;){var x=a,C=x.stateNode;if(x=x.tag,x!==5&&x!==26&&x!==27||C===null||(x=Vu(a,u),x!=null&&m.unshift(bd(a,x,C)),x=Vu(a,i),x!=null&&m.push(bd(a,x,C))),a.tag===3)return m;a=a.return}return[]}function z6(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function zw(a,i,u,m,x){for(var C=i._reactName,N=[];u!==null&&u!==m;){var I=u,V=I.alternate,ae=I.stateNode;if(I=I.tag,V!==null&&V===m)break;I!==5&&I!==26&&I!==27||ae===null||(V=ae,x?(ae=Vu(u,C),ae!=null&&N.unshift(bd(u,ae,V))):x||(ae=Vu(u,C),ae!=null&&N.push(bd(u,ae,V)))),u=u.return}N.length!==0&&a.push({event:i,listeners:N})}var V6=/\r\n?/g,$6=/\u0000|\uFFFD/g;function Vw(a){return(typeof a=="string"?a:""+a).replace(V6,`
|
|
49
|
-
`).replace($6,"")}function $w(a,i){return i=Vw(i),Vw(a)===i}function Xt(a,i,u,m,x,C){switch(u){case"children":typeof m=="string"?i==="body"||i==="textarea"&&m===""||tc(a,m):(typeof m=="number"||typeof m=="bigint")&&i!=="body"&&tc(a,""+m);break;case"className":Xs(a,"class",m);break;case"tabIndex":Xs(a,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":Xs(a,u,m);break;case"style":$S(a,m,C);break;case"data":if(i!=="object"){Xs(a,"data",m);break}case"src":case"href":if(m===""&&(i!=="a"||u!=="href")){a.removeAttribute(u);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(u);break}m=ah(""+m),a.setAttribute(u,m);break;case"action":case"formAction":if(typeof m=="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 C=="function"&&(u==="formAction"?(i!=="input"&&Xt(a,i,"name",x.name,x,null),Xt(a,i,"formEncType",x.formEncType,x,null),Xt(a,i,"formMethod",x.formMethod,x,null),Xt(a,i,"formTarget",x.formTarget,x,null)):(Xt(a,i,"encType",x.encType,x,null),Xt(a,i,"method",x.method,x,null),Xt(a,i,"target",x.target,x,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(u);break}m=ah(""+m),a.setAttribute(u,m);break;case"onClick":m!=null&&(a.onclick=Js);break;case"onScroll":m!=null&&bt("scroll",a);break;case"onScrollEnd":m!=null&&bt("scrollend",a);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(u=m.__html,u!=null){if(x.children!=null)throw Error(r(60));a.innerHTML=u}}break;case"multiple":a.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":a.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){a.removeAttribute("xlink:href");break}u=ah(""+m),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":m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(u,""+m):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":m&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(u,""):a.removeAttribute(u);break;case"capture":case"download":m===!0?a.setAttribute(u,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(u,m):a.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?a.setAttribute(u,m):a.removeAttribute(u);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?a.removeAttribute(u):a.setAttribute(u,m);break;case"popover":bt("beforetoggle",a),bt("toggle",a),fn(a,"popover",m);break;case"xlinkActuate":Oa(a,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":Oa(a,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":Oa(a,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":Oa(a,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":Oa(a,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":Oa(a,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":Oa(a,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":Oa(a,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":Oa(a,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":fn(a,"is",m);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=gM.get(u)||u,fn(a,u,m))}}function zv(a,i,u,m,x,C){switch(u){case"style":$S(a,m,C);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(u=m.__html,u!=null){if(x.children!=null)throw Error(r(60));a.innerHTML=u}}break;case"children":typeof m=="string"?tc(a,m):(typeof m=="number"||typeof m=="bigint")&&tc(a,""+m);break;case"onScroll":m!=null&&bt("scroll",a);break;case"onScrollEnd":m!=null&&bt("scrollend",a);break;case"onClick":m!=null&&(a.onclick=Js);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ws.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(x=u.endsWith("Capture"),i=u.slice(2,x?u.length-7:void 0),C=a[Ge]||null,C=C!=null?C[u]:null,typeof C=="function"&&a.removeEventListener(i,C,x),typeof m=="function")){typeof C!="function"&&C!==null&&(u in a?a[u]=null:a.hasAttribute(u)&&a.removeAttribute(u)),a.addEventListener(i,m,x);break e}u in a?a[u]=m:m===!0?a.setAttribute(u,""):fn(a,u,m)}}}function xr(a,i,u){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":bt("error",a),bt("load",a);var m=!1,x=!1,C;for(C in u)if(u.hasOwnProperty(C)){var N=u[C];if(N!=null)switch(C){case"src":m=!0;break;case"srcSet":x=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:Xt(a,i,C,N,u,null)}}x&&Xt(a,i,"srcSet",u.srcSet,u,null),m&&Xt(a,i,"src",u.src,u,null);return;case"input":bt("invalid",a);var I=C=N=x=null,V=null,ae=null;for(m in u)if(u.hasOwnProperty(m)){var he=u[m];if(he!=null)switch(m){case"name":x=he;break;case"type":N=he;break;case"checked":V=he;break;case"defaultChecked":ae=he;break;case"value":C=he;break;case"defaultValue":I=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,i));break;default:Xt(a,i,m,he,u,null)}}US(a,C,I,V,ae,N,x,!1);return;case"select":bt("invalid",a),m=N=C=null;for(x in u)if(u.hasOwnProperty(x)&&(I=u[x],I!=null))switch(x){case"value":C=I;break;case"defaultValue":N=I;break;case"multiple":m=I;default:Xt(a,i,x,I,u,null)}i=C,u=N,a.multiple=!!m,i!=null?ec(a,!!m,i,!1):u!=null&&ec(a,!!m,u,!0);return;case"textarea":bt("invalid",a),C=x=m=null;for(N in u)if(u.hasOwnProperty(N)&&(I=u[N],I!=null))switch(N){case"value":m=I;break;case"defaultValue":x=I;break;case"children":C=I;break;case"dangerouslySetInnerHTML":if(I!=null)throw Error(r(91));break;default:Xt(a,i,N,I,u,null)}zS(a,m,x,C);return;case"option":for(V in u)if(u.hasOwnProperty(V)&&(m=u[V],m!=null))switch(V){case"selected":a.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:Xt(a,i,V,m,u,null)}return;case"dialog":bt("beforetoggle",a),bt("toggle",a),bt("cancel",a),bt("close",a);break;case"iframe":case"object":bt("load",a);break;case"video":case"audio":for(m=0;m<xd.length;m++)bt(xd[m],a);break;case"image":bt("error",a),bt("load",a);break;case"details":bt("toggle",a);break;case"embed":case"source":case"link":bt("error",a),bt("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)&&(m=u[ae],m!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:Xt(a,i,ae,m,u,null)}return;default:if(ey(i)){for(he in u)u.hasOwnProperty(he)&&(m=u[he],m!==void 0&&zv(a,i,he,m,u,void 0));return}}for(I in u)u.hasOwnProperty(I)&&(m=u[I],m!=null&&Xt(a,i,I,m,u,null))}function H6(a,i,u,m){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var x=null,C=null,N=null,I=null,V=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":V=pe;default:m.hasOwnProperty(fe)||Xt(a,i,fe,null,m,pe)}}for(var oe in m){var fe=m[oe];if(pe=u[oe],m.hasOwnProperty(oe)&&(fe!=null||pe!=null))switch(oe){case"type":C=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&&Xt(a,i,oe,fe,m,pe)}}Xg(a,N,I,V,ae,he,C,x);return;case"select":fe=N=I=oe=null;for(C in u)if(V=u[C],u.hasOwnProperty(C)&&V!=null)switch(C){case"value":break;case"multiple":fe=V;default:m.hasOwnProperty(C)||Xt(a,i,C,null,m,V)}for(x in m)if(C=m[x],V=u[x],m.hasOwnProperty(x)&&(C!=null||V!=null))switch(x){case"value":oe=C;break;case"defaultValue":I=C;break;case"multiple":N=C;default:C!==V&&Xt(a,i,x,C,m,V)}i=I,u=N,m=fe,oe!=null?ec(a,!!u,oe,!1):!!m!=!!u&&(i!=null?ec(a,!!u,i,!0):ec(a,!!u,u?[]:"",!1));return;case"textarea":fe=oe=null;for(I in u)if(x=u[I],u.hasOwnProperty(I)&&x!=null&&!m.hasOwnProperty(I))switch(I){case"value":break;case"children":break;default:Xt(a,i,I,null,m,x)}for(N in m)if(x=m[N],C=u[N],m.hasOwnProperty(N)&&(x!=null||C!=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!==C&&Xt(a,i,N,x,m,C)}FS(a,oe,fe);return;case"option":for(var Be in u)if(oe=u[Be],u.hasOwnProperty(Be)&&oe!=null&&!m.hasOwnProperty(Be))switch(Be){case"selected":a.selected=!1;break;default:Xt(a,i,Be,null,m,oe)}for(V in m)if(oe=m[V],fe=u[V],m.hasOwnProperty(V)&&oe!==fe&&(oe!=null||fe!=null))switch(V){case"selected":a.selected=oe&&typeof oe!="function"&&typeof oe!="symbol";break;default:Xt(a,i,V,oe,m,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 tt in u)oe=u[tt],u.hasOwnProperty(tt)&&oe!=null&&!m.hasOwnProperty(tt)&&Xt(a,i,tt,null,m,oe);for(ae in m)if(oe=m[ae],fe=u[ae],m.hasOwnProperty(ae)&&oe!==fe&&(oe!=null||fe!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(r(137,i));break;default:Xt(a,i,ae,oe,m,fe)}return;default:if(ey(i)){for(var Jt in u)oe=u[Jt],u.hasOwnProperty(Jt)&&oe!==void 0&&!m.hasOwnProperty(Jt)&&zv(a,i,Jt,void 0,m,oe);for(he in m)oe=m[he],fe=u[he],!m.hasOwnProperty(he)||oe===fe||oe===void 0&&fe===void 0||zv(a,i,he,oe,m,fe);return}}for(var J in u)oe=u[J],u.hasOwnProperty(J)&&oe!=null&&!m.hasOwnProperty(J)&&Xt(a,i,J,null,m,oe);for(pe in m)oe=m[pe],fe=u[pe],!m.hasOwnProperty(pe)||oe===fe||oe==null&&fe==null||Xt(a,i,pe,oe,m,fe)}function Hw(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function B6(){if(typeof performance.getEntriesByType=="function"){for(var a=0,i=0,u=performance.getEntriesByType("resource"),m=0;m<u.length;m++){var x=u[m],C=x.transferSize,N=x.initiatorType,I=x.duration;if(C&&I&&Hw(N)){for(N=0,I=x.responseEnd,m+=1;m<u.length;m++){var V=u[m],ae=V.startTime;if(ae>I)break;var he=V.transferSize,pe=V.initiatorType;he&&Hw(pe)&&(V=V.responseEnd,N+=he*(V<I?1:(I-ae)/(V-ae)))}if(--m,i+=8*(C+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 Vv=null,$v=null;function Jh(a){return a.nodeType===9?a:a.ownerDocument}function Bw(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 Gw(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 Hv(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 Bv=null;function G6(){var a=window.event;return a&&a.type==="popstate"?a===Bv?!1:(Bv=a,!0):(Bv=null,!1)}var qw=typeof setTimeout=="function"?setTimeout:void 0,q6=typeof clearTimeout=="function"?clearTimeout:void 0,Zw=typeof Promise=="function"?Promise:void 0,Z6=typeof queueMicrotask=="function"?queueMicrotask:typeof Zw<"u"?function(a){return Zw.resolve(null).then(a).catch(K6)}:qw;function K6(a){setTimeout(function(){throw a})}function oi(a){return a==="head"}function Kw(a,i){var u=i,m=0;do{var x=u.nextSibling;if(a.removeChild(u),x&&x.nodeType===8)if(u=x.data,u==="/$"||u==="/&"){if(m===0){a.removeChild(x),Oc(i);return}m--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")m++;else if(u==="html")Sd(a.ownerDocument.documentElement);else if(u==="head"){u=a.ownerDocument.head,Sd(u);for(var C=u.firstChild;C;){var N=C.nextSibling,I=C.nodeName;C[Gt]||I==="SCRIPT"||I==="STYLE"||I==="LINK"&&C.rel.toLowerCase()==="stylesheet"||u.removeChild(C),C=N}}else u==="body"&&Sd(a.ownerDocument.body);u=x}while(u);Oc(i)}function Yw(a,i){var u=a;a=0;do{var m=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||""),m&&m.nodeType===8)if(u=m.data,u==="/$"){if(a===0)break;a--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||a++;u=m}while(u)}function Gv(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":Gv(u),qt(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}a.removeChild(u)}}function Y6(a,i,u,m){for(;a.nodeType===1;){var x=u;if(a.nodeName.toLowerCase()!==i.toLowerCase()){if(!m&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(m){if(!a[Gt])switch(i){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(C=a.getAttribute("rel"),C==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(C!==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(C=a.getAttribute("src"),(C!==(x.src==null?null:x.src)||a.getAttribute("type")!==(x.type==null?null:x.type)||a.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin))&&C&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(i==="input"&&a.type==="hidden"){var C=x.name==null?null:""+x.name;if(x.type==="hidden"&&a.getAttribute("name")===C)return a}else return a;if(a=za(a.nextSibling),a===null)break}return null}function W6(a,i,u){if(i==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!u||(a=za(a.nextSibling),a===null))return null;return a}function Ww(a,i){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!i||(a=za(a.nextSibling),a===null))return null;return a}function qv(a){return a.data==="$?"||a.data==="$~"}function Zv(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function Q6(a,i){var u=a.ownerDocument;if(a.data==="$~")a._reactRetry=i;else if(a.data!=="$?"||u.readyState!=="loading")i();else{var m=function(){i(),u.removeEventListener("DOMContentLoaded",m)};u.addEventListener("DOMContentLoaded",m),a._reactRetry=m}}function za(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 Kv=null;function Qw(a){a=a.nextSibling;for(var i=0;a;){if(a.nodeType===8){var u=a.data;if(u==="/$"||u==="/&"){if(i===0)return za(a.nextSibling);i--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||i++}a=a.nextSibling}return null}function Xw(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 Jw(a,i,u){switch(i=Jh(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 Sd(a){for(var i=a.attributes;i.length;)a.removeAttributeNode(i[0]);qt(a)}var Va=new Map,e2=new Set;function em(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var go=H.d;H.d={f:X6,r:J6,D:eI,C:tI,L:nI,m:rI,X:sI,S:aI,M:oI};function X6(){var a=go.f(),i=Gh();return a||i}function J6(a){var i=Aa(a);i!==null&&i.tag===5&&i.type==="form"?yE(i):go.r(a)}var Nc=typeof document>"u"?null:document;function t2(a,i,u){var m=Nc;if(m&&typeof i=="string"&&i){var x=Ma(i);x='link[rel="'+a+'"][href="'+x+'"]',typeof u=="string"&&(x+='[crossorigin="'+u+'"]'),e2.has(x)||(e2.add(x),a={rel:a,crossOrigin:u,href:i},m.querySelector(x)===null&&(i=m.createElement("link"),xr(i,"link",a),Cn(i),m.head.appendChild(i)))}}function eI(a){go.D(a),t2("dns-prefetch",a,null)}function tI(a,i){go.C(a,i),t2("preconnect",a,i)}function nI(a,i,u){go.L(a,i,u);var m=Nc;if(m&&a&&i){var x='link[rel="preload"][as="'+Ma(i)+'"]';i==="image"&&u&&u.imageSrcSet?(x+='[imagesrcset="'+Ma(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(x+='[imagesizes="'+Ma(u.imageSizes)+'"]')):x+='[href="'+Ma(a)+'"]';var C=x;switch(i){case"style":C=Ac(a);break;case"script":C=Dc(a)}Va.has(C)||(a=y({rel:"preload",href:i==="image"&&u&&u.imageSrcSet?void 0:a,as:i},u),Va.set(C,a),m.querySelector(x)!==null||i==="style"&&m.querySelector(Cd(C))||i==="script"&&m.querySelector(Ed(C))||(i=m.createElement("link"),xr(i,"link",a),Cn(i),m.head.appendChild(i)))}}function rI(a,i){go.m(a,i);var u=Nc;if(u&&a){var m=i&&typeof i.as=="string"?i.as:"script",x='link[rel="modulepreload"][as="'+Ma(m)+'"][href="'+Ma(a)+'"]',C=x;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":C=Dc(a)}if(!Va.has(C)&&(a=y({rel:"modulepreload",href:a},i),Va.set(C,a),u.querySelector(x)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Ed(C)))return}m=u.createElement("link"),xr(m,"link",a),Cn(m),u.head.appendChild(m)}}}function aI(a,i,u){go.S(a,i,u);var m=Nc;if(m&&a){var x=pr(m).hoistableStyles,C=Ac(a);i=i||"default";var N=x.get(C);if(!N){var I={loading:0,preload:null};if(N=m.querySelector(Cd(C)))I.loading=5;else{a=y({rel:"stylesheet",href:a,"data-precedence":i},u),(u=Va.get(C))&&Yv(a,u);var V=N=m.createElement("link");Cn(V),xr(V,"link",a),V._p=new Promise(function(ae,he){V.onload=ae,V.onerror=he}),V.addEventListener("load",function(){I.loading|=1}),V.addEventListener("error",function(){I.loading|=2}),I.loading|=4,tm(N,i,m)}N={type:"stylesheet",instance:N,count:1,state:I},x.set(C,N)}}}function sI(a,i){go.X(a,i);var u=Nc;if(u&&a){var m=pr(u).hoistableScripts,x=Dc(a),C=m.get(x);C||(C=u.querySelector(Ed(x)),C||(a=y({src:a,async:!0},i),(i=Va.get(x))&&Wv(a,i),C=u.createElement("script"),Cn(C),xr(C,"link",a),u.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},m.set(x,C))}}function oI(a,i){go.M(a,i);var u=Nc;if(u&&a){var m=pr(u).hoistableScripts,x=Dc(a),C=m.get(x);C||(C=u.querySelector(Ed(x)),C||(a=y({src:a,async:!0,type:"module"},i),(i=Va.get(x))&&Wv(a,i),C=u.createElement("script"),Cn(C),xr(C,"link",a),u.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},m.set(x,C))}}function n2(a,i,u,m){var x=(x=ve.current)?em(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=Ac(u.href),u=pr(x).hoistableStyles,m=u.get(i),m||(m={type:"style",instance:null,count:0,state:null},u.set(i,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){a=Ac(u.href);var C=pr(x).hoistableStyles,N=C.get(a);if(N||(x=x.ownerDocument||x,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},C.set(a,N),(C=x.querySelector(Cd(a)))&&!C._p&&(N.instance=C,N.state.loading=5),Va.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},Va.set(a,u),C||iI(x,a,u,N.state))),i&&m===null)throw Error(r(528,""));return N}if(i&&m!==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=Dc(u),u=pr(x).hoistableScripts,m=u.get(i),m||(m={type:"script",instance:null,count:0,state:null},u.set(i,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function Ac(a){return'href="'+Ma(a)+'"'}function Cd(a){return'link[rel="stylesheet"]['+a+"]"}function r2(a){return y({},a,{"data-precedence":a.precedence,precedence:null})}function iI(a,i,u,m){a.querySelector('link[rel="preload"][as="style"]['+i+"]")?m.loading=1:(i=a.createElement("link"),m.preload=i,i.addEventListener("load",function(){return m.loading|=1}),i.addEventListener("error",function(){return m.loading|=2}),xr(i,"link",u),Cn(i),a.head.appendChild(i))}function Dc(a){return'[src="'+Ma(a)+'"]'}function Ed(a){return"script[async]"+a}function a2(a,i,u){if(i.count++,i.instance===null)switch(i.type){case"style":var m=a.querySelector('style[data-href~="'+Ma(u.href)+'"]');if(m)return i.instance=m,Cn(m),m;var x=y({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return m=(a.ownerDocument||a).createElement("style"),Cn(m),xr(m,"style",x),tm(m,u.precedence,a),i.instance=m;case"stylesheet":x=Ac(u.href);var C=a.querySelector(Cd(x));if(C)return i.state.loading|=4,i.instance=C,Cn(C),C;m=r2(u),(x=Va.get(x))&&Yv(m,x),C=(a.ownerDocument||a).createElement("link"),Cn(C);var N=C;return N._p=new Promise(function(I,V){N.onload=I,N.onerror=V}),xr(C,"link",m),i.state.loading|=4,tm(C,u.precedence,a),i.instance=C;case"script":return C=Dc(u.src),(x=a.querySelector(Ed(C)))?(i.instance=x,Cn(x),x):(m=u,(x=Va.get(C))&&(m=y({},u),Wv(m,x)),a=a.ownerDocument||a,x=a.createElement("script"),Cn(x),xr(x,"link",m),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&&(m=i.instance,i.state.loading|=4,tm(m,u.precedence,a));return i.instance}function tm(a,i,u){for(var m=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),x=m.length?m[m.length-1]:null,C=x,N=0;N<m.length;N++){var I=m[N];if(I.dataset.precedence===i)C=I;else if(C!==x)break}C?C.parentNode.insertBefore(a,C.nextSibling):(i=u.nodeType===9?u.head:u,i.insertBefore(a,i.firstChild))}function Yv(a,i){a.crossOrigin==null&&(a.crossOrigin=i.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=i.referrerPolicy),a.title==null&&(a.title=i.title)}function Wv(a,i){a.crossOrigin==null&&(a.crossOrigin=i.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=i.referrerPolicy),a.integrity==null&&(a.integrity=i.integrity)}var nm=null;function s2(a,i,u){if(nm===null){var m=new Map,x=nm=new Map;x.set(u,m)}else x=nm,m=x.get(u),m||(m=new Map,x.set(u,m));if(m.has(a))return m;for(m.set(a,null),u=u.getElementsByTagName(a),x=0;x<u.length;x++){var C=u[x];if(!(C[Gt]||C[Ve]||a==="link"&&C.getAttribute("rel")==="stylesheet")&&C.namespaceURI!=="http://www.w3.org/2000/svg"){var N=C.getAttribute(i)||"";N=a+N;var I=m.get(N);I?I.push(C):m.set(N,[C])}}return m}function o2(a,i,u){a=a.ownerDocument||a,a.head.insertBefore(u,i==="title"?a.querySelector("head > title"):null)}function lI(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 i2(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function cI(a,i,u,m){if(u.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var x=Ac(m.href),C=i.querySelector(Cd(x));if(C){i=C._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(a.count++,a=rm.bind(a),i.then(a,a)),u.state.loading|=4,u.instance=C,Cn(C);return}C=i.ownerDocument||i,m=r2(m),(x=Va.get(x))&&Yv(m,x),C=C.createElement("link"),Cn(C);var N=C;N._p=new Promise(function(I,V){N.onload=I,N.onerror=V}),xr(C,"link",m),u.instance=C}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(u,i),(i=u.state.preload)&&(u.state.loading&3)===0&&(a.count++,u=rm.bind(a),i.addEventListener("load",u),i.addEventListener("error",u))}}var Qv=0;function uI(a,i){return a.stylesheets&&a.count===0&&sm(a,a.stylesheets),0<a.count||0<a.imgCount?function(u){var m=setTimeout(function(){if(a.stylesheets&&sm(a,a.stylesheets),a.unsuspend){var C=a.unsuspend;a.unsuspend=null,C()}},6e4+i);0<a.imgBytes&&Qv===0&&(Qv=62500*B6());var x=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&sm(a,a.stylesheets),a.unsuspend)){var C=a.unsuspend;a.unsuspend=null,C()}},(a.imgBytes>Qv?50:800)+i);return a.unsuspend=u,function(){a.unsuspend=null,clearTimeout(m),clearTimeout(x)}}:null}function rm(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)sm(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var am=null;function sm(a,i){a.stylesheets=null,a.unsuspend!==null&&(a.count++,am=new Map,i.forEach(dI,a),am=null,rm.call(a))}function dI(a,i){if(!(i.state.loading&4)){var u=am.get(a);if(u)var m=u.get(null);else{u=new Map,am.set(a,u);for(var x=a.querySelectorAll("link[data-precedence],style[data-precedence]"),C=0;C<x.length;C++){var N=x[C];(N.nodeName==="LINK"||N.getAttribute("media")!=="not all")&&(u.set(N.dataset.precedence,N),m=N)}m&&u.set(null,m)}x=i.instance,N=x.getAttribute("data-precedence"),C=u.get(N)||m,C===m&&u.set(null,x),u.set(N,x),this.count++,m=rm.bind(this),x.addEventListener("load",m),x.addEventListener("error",m),C?C.parentNode.insertBefore(x,C.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(x,a.firstChild)),i.state.loading|=4}}var wd={$$typeof:_,Provider:null,Consumer:null,_currentValue:B,_currentValue2:B,_threadCount:0};function fI(a,i,u,m,x,C,N,I,V){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=_r(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_r(0),this.hiddenUpdates=_r(null),this.identifierPrefix=m,this.onUncaughtError=x,this.onCaughtError=C,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=V,this.incompleteTransitions=new Map}function l2(a,i,u,m,x,C,N,I,V,ae,he,pe){return a=new fI(a,i,u,N,V,ae,he,pe,I),i=1,C===!0&&(i|=24),C=oa(3,null,null,i),a.current=C,C.stateNode=a,i=Ay(),i.refCount++,a.pooledCache=i,i.refCount++,C.memoizedState={element:m,isDehydrated:u,cache:i},Iy(C),a}function c2(a){return a?(a=lc,a):lc}function u2(a,i,u,m,x,C){x=c2(x),m.context===null?m.context=x:m.pendingContext=x,m=Yo(i),m.payload={element:u},C=C===void 0?null:C,C!==null&&(m.callback=C),u=Wo(a,m,i),u!==null&&(Jr(u,a,i),nd(u,a,i))}function d2(a,i){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var u=a.retryLane;a.retryLane=u!==0&&u<i?u:i}}function Xv(a,i){d2(a,i),(a=a.alternate)&&d2(a,i)}function f2(a){if(a.tag===13||a.tag===31){var i=el(a,67108864);i!==null&&Jr(i,a,67108864),Xv(a,67108864)}}function h2(a){if(a.tag===13||a.tag===31){var i=da();i=Re(i);var u=el(a,i);u!==null&&Jr(u,a,i),Xv(a,i)}}var om=!0;function hI(a,i,u,m){var x=k.T;k.T=null;var C=H.p;try{H.p=2,Jv(a,i,u,m)}finally{H.p=C,k.T=x}}function mI(a,i,u,m){var x=k.T;k.T=null;var C=H.p;try{H.p=8,Jv(a,i,u,m)}finally{H.p=C,k.T=x}}function Jv(a,i,u,m){if(om){var x=ex(m);if(x===null)Fv(a,i,m,im,u),p2(a,m);else if(gI(x,a,i,u,m))m.stopPropagation();else if(p2(a,m),i&4&&-1<pI.indexOf(a)){for(;x!==null;){var C=Aa(x);if(C!==null)switch(C.tag){case 3:if(C=C.stateNode,C.current.memoizedState.isDehydrated){var N=dn(C.pendingLanes);if(N!==0){var I=C;for(I.pendingLanes|=2,I.entangledLanes|=2;N;){var V=1<<31-Sn(N);I.entanglements[1]|=V,N&=~V}_s(C),(Pt&6)===0&&(Hh=be()+500,vd(0))}}break;case 31:case 13:I=el(C,2),I!==null&&Jr(I,C,2),Gh(),Xv(C,2)}if(C=ex(m),C===null&&Fv(a,i,m,im,u),C===x)break;x=C}x!==null&&m.stopPropagation()}else Fv(a,i,m,null,u)}}function ex(a){return a=ny(a),tx(a)}var im=null;function tx(a){if(im=null,a=Gr(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 im=a,null}function m2(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 Ye:return 2;case st:return 8;case ot:case mn:return 32;case Na:return 268435456;default:return 32}default:return 32}}var nx=!1,ii=null,li=null,ci=null,Rd=new Map,Td=new Map,ui=[],pI="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 p2(a,i){switch(a){case"focusin":case"focusout":ii=null;break;case"dragenter":case"dragleave":li=null;break;case"mouseover":case"mouseout":ci=null;break;case"pointerover":case"pointerout":Rd.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Td.delete(i.pointerId)}}function jd(a,i,u,m,x,C){return a===null||a.nativeEvent!==C?(a={blockedOn:i,domEventName:u,eventSystemFlags:m,nativeEvent:C,targetContainers:[x]},i!==null&&(i=Aa(i),i!==null&&f2(i)),a):(a.eventSystemFlags|=m,i=a.targetContainers,x!==null&&i.indexOf(x)===-1&&i.push(x),a)}function gI(a,i,u,m,x){switch(i){case"focusin":return ii=jd(ii,a,i,u,m,x),!0;case"dragenter":return li=jd(li,a,i,u,m,x),!0;case"mouseover":return ci=jd(ci,a,i,u,m,x),!0;case"pointerover":var C=x.pointerId;return Rd.set(C,jd(Rd.get(C)||null,a,i,u,m,x)),!0;case"gotpointercapture":return C=x.pointerId,Td.set(C,jd(Td.get(C)||null,a,i,u,m,x)),!0}return!1}function g2(a){var i=Gr(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,Me(a.priority,function(){h2(u)});return}}else if(i===31){if(i=d(u),i!==null){a.blockedOn=i,Me(a.priority,function(){h2(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 lm(a){if(a.blockedOn!==null)return!1;for(var i=a.targetContainers;0<i.length;){var u=ex(a.nativeEvent);if(u===null){u=a.nativeEvent;var m=new u.constructor(u.type,u);ty=m,u.target.dispatchEvent(m),ty=null}else return i=Aa(u),i!==null&&f2(i),a.blockedOn=u,!1;i.shift()}return!0}function y2(a,i,u){lm(a)&&u.delete(i)}function yI(){nx=!1,ii!==null&&lm(ii)&&(ii=null),li!==null&&lm(li)&&(li=null),ci!==null&&lm(ci)&&(ci=null),Rd.forEach(y2),Td.forEach(y2)}function cm(a,i){a.blockedOn===i&&(a.blockedOn=null,nx||(nx=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,yI)))}var um=null;function v2(a){um!==a&&(um=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){um===a&&(um=null);for(var i=0;i<a.length;i+=3){var u=a[i],m=a[i+1],x=a[i+2];if(typeof m!="function"){if(tx(m||u)===null)continue;break}var C=Aa(u);C!==null&&(a.splice(i,3),i-=3,ev(C,{pending:!0,data:x,method:u.method,action:m},m,x))}}))}function Oc(a){function i(V){return cm(V,a)}ii!==null&&cm(ii,a),li!==null&&cm(li,a),ci!==null&&cm(ci,a),Rd.forEach(i),Td.forEach(i);for(var u=0;u<ui.length;u++){var m=ui[u];m.blockedOn===a&&(m.blockedOn=null)}for(;0<ui.length&&(u=ui[0],u.blockedOn===null);)g2(u),u.blockedOn===null&&ui.shift();if(u=(a.ownerDocument||a).$$reactFormReplay,u!=null)for(m=0;m<u.length;m+=3){var x=u[m],C=u[m+1],N=x[Ge]||null;if(typeof C=="function")N||v2(u);else if(N){var I=null;if(C&&C.hasAttribute("formAction")){if(x=C,N=C[Ge]||null)I=N.formAction;else if(tx(x)!==null)continue}else I=N.action;typeof I=="function"?u[m+1]=I:(u.splice(m,3),m-=3),v2(u)}}}function x2(){function a(C){C.canIntercept&&C.info==="react-transition"&&C.intercept({handler:function(){return new Promise(function(N){return x=N})},focusReset:"manual",scroll:"manual"})}function i(){x!==null&&(x(),x=null),m||setTimeout(u,20)}function u(){if(!m&&!navigation.transition){var C=navigation.currentEntry;C&&C.url!=null&&navigation.navigate(C.url,{state:C.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,x=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(u,100),function(){m=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),x!==null&&(x(),x=null)}}}function rx(a){this._internalRoot=a}dm.prototype.render=rx.prototype.render=function(a){var i=this._internalRoot;if(i===null)throw Error(r(409));var u=i.current,m=da();u2(u,m,a,i,null,null)},dm.prototype.unmount=rx.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var i=a.containerInfo;u2(a.current,2,null,a,null,null),Gh(),i[qe]=null}};function dm(a){this._internalRoot=a}dm.prototype.unstable_scheduleHydration=function(a){if(a){var i=ke();a={blockedOn:null,target:a,priority:i};for(var u=0;u<ui.length&&i!==0&&i<ui[u].priority;u++);ui.splice(u,0,a),u===0&&g2(a)}};var b2=t.version;if(b2!=="19.2.0")throw Error(r(527,b2,"19.2.0"));H.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 vI={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var fm=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fm.isDisabled&&fm.supportsFiber)try{Dn=fm.inject(vI),bn=fm}catch{}}return Nd.createRoot=function(a,i){if(!s(a))throw Error(r(299));var u=!1,m="",x=jE,C=_E,N=NE;return i!=null&&(i.unstable_strictMode===!0&&(u=!0),i.identifierPrefix!==void 0&&(m=i.identifierPrefix),i.onUncaughtError!==void 0&&(x=i.onUncaughtError),i.onCaughtError!==void 0&&(C=i.onCaughtError),i.onRecoverableError!==void 0&&(N=i.onRecoverableError)),i=l2(a,1,!1,null,null,u,m,null,x,C,N,x2),a[qe]=i.current,Uv(a),new rx(i)},Nd.hydrateRoot=function(a,i,u){if(!s(a))throw Error(r(299));var m=!1,x="",C=jE,N=_E,I=NE,V=null;return u!=null&&(u.unstable_strictMode===!0&&(m=!0),u.identifierPrefix!==void 0&&(x=u.identifierPrefix),u.onUncaughtError!==void 0&&(C=u.onUncaughtError),u.onCaughtError!==void 0&&(N=u.onCaughtError),u.onRecoverableError!==void 0&&(I=u.onRecoverableError),u.formState!==void 0&&(V=u.formState)),i=l2(a,1,!0,i,u??null,m,x,V,C,N,I,x2),i.context=c2(null),u=i.current,m=da(),m=Re(m),x=Yo(m),x.callback=null,Wo(u,x,m),u=m,i.current.lanes=u,Br(i,u),_s(i),a[qe]=i.current,Uv(a),new dm(i)},Nd.version="19.2.0",Nd}var A2;function AI(){if(A2)return ox.exports;A2=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(),ox.exports=NI(),ox.exports}var DI=AI();/**
|
|
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 Oj=e=>{throw TypeError(e)},OI=(e,t,n)=>t.has(e)||Oj("Cannot "+n),ux=(e,t,n)=>(OI(e,t,"read from private field"),n?n.call(e):t.get(e)),MI=(e,t,n)=>t.has(e)?Oj("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),D2="popstate";function II(e={}){function t(r,s){let{pathname:l,search:c,hash:d}=r.location;return nf("",{pathname:l,search:c,hash:d},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:Fs(s)}return LI(t,n,null,e)}function yt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function _n(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function kI(){return Math.random().toString(36).substring(2,10)}function O2(e,t){return{usr:e.state,key:e.key,idx:t}}function nf(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?ki(t):t,state:n,key:t&&t.key||r||kI()}}function Fs({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 ki(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 LI(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:l=!1}=r,c=s.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 S=g(),R=S==null?null:S-h;h=S,f&&f({action:d,location:E.location,delta:R})}function v(S,R){d="PUSH";let T=nf(E.location,S,R);h=g()+1;let _=O2(T,h),D=E.createHref(T);try{c.pushState(_,"",D)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;s.location.assign(D)}l&&f&&f({action:d,location:E.location,delta:1})}function b(S,R){d="REPLACE";let T=nf(E.location,S,R);h=g();let _=O2(T,h),D=E.createHref(T);c.replaceState(_,"",D),l&&f&&f({action:d,location:E.location,delta:0})}function w(S){return Mj(S)}let E={get action(){return d},get location(){return e(s,c)},listen(S){if(f)throw new Error("A history only accepts one active listener");return s.addEventListener(D2,y),f=S,()=>{s.removeEventListener(D2,y),f=null}},createHref(S){return t(s,S)},createURL:w,encodeLocation(S){let R=w(S);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:v,replace:b,go(S){return c.go(S)}};return E}function Mj(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),yt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Fs(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Hd,M2=class{constructor(e){if(MI(this,Hd,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(ux(this,Hd).has(e))return ux(this,Hd).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){ux(this,Hd).set(e,t)}};Hd=new WeakMap;var PI=new Set(["lazy","caseSensitive","path","id","index","children"]);function UI(e){return PI.has(e)}var FI=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function zI(e){return FI.has(e)}function VI(e){return e.index===!0}function rf(e,t,n=[],r={},s=!1){return e.map((l,c)=>{let d=[...n,String(c)],f=typeof l.id=="string"?l.id:d.join("-");if(yt(l.index!==!0||!l.children,"Cannot specify children on an index route"),yt(s||!r[f],`Found a route id collision on id "${f}". Route id's must be globally unique within Data Router usages`),VI(l)){let h={...l,id:f};return r[f]=I2(h,t(h)),h}else{let h={...l,id:f,children:void 0};return r[f]=I2(h,t(h)),l.children&&(h.children=rf(l.children,t,d,r,s)),h}})}function I2(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function yi(e,t,n="/"){return Fm(e,t,n,!1)}function Fm(e,t,n,r){let s=typeof t=="string"?ki(t):t,l=qa(s.pathname||"/",n);if(l==null)return null;let c=Ij(e);HI(c);let d=null;for(let f=0;d==null&&f<c.length;++f){let h=ek(l);d=XI(c[f],h,r)}return d}function $I(e,t){let{route:n,pathname:r,params:s}=e;return{id:n.id,pathname:r,params:s,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function Ij(e,t=[],n=[],r="",s=!1){let l=(c,d,f=s,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;yt(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=Ls([r,g.relativePath]),v=n.concat(g);c.children&&c.children.length>0&&(yt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),Ij(c.children,t,v,y,f)),!(c.path==null&&!c.index)&&t.push({path:y,score:WI(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 kj(c.path))l(c,d,!0,h)}),t}function kj(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),l=n.replace(/\?$/,"");if(r.length===0)return s?[l,""]:[l];let c=kj(r.join("/")),d=[];return d.push(...c.map(f=>f===""?l:[l,f].join("/"))),s&&d.push(...c),d.map(f=>e.startsWith("/")&&f===""?"/":f)}function HI(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:QI(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var BI=/^:[\w-]+$/,GI=3,qI=2,ZI=1,KI=10,YI=-2,k2=e=>e==="*";function WI(e,t){let n=e.split("/"),r=n.length;return n.some(k2)&&(r+=YI),t&&(r+=qI),n.filter(s=>!k2(s)).reduce((s,l)=>s+(BI.test(l)?GI:l===""?ZI:KI),r)}function QI(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function XI(e,t,n=!1){let{routesMeta:r}=e,s={},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=ep({path:f.relativePath,caseSensitive:f.caseSensitive,end:h},g),v=f.route;if(!y&&h&&n&&!r[r.length-1].route.index&&(y=ep({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},g)),!y)return null;Object.assign(s,y.params),c.push({params:s,pathname:Ls([l,y.pathname]),pathnameBase:ak(Ls([l,y.pathnameBase])),route:v}),y.pathnameBase!=="/"&&(l=Ls([l,y.pathnameBase]))}return c}function ep(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=JI(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let l=s[0],c=l.replace(/(.)\/+$/,"$1"),d=s.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 JI(e,t=!1,n=!0){_n(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=[],s="^"+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:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function ek(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return _n(!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 qa(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 tk({basename:e,pathname:t}){return t==="/"?e:Ls([e,t])}function nk(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?ki(e):e;return{pathname:n?n.startsWith("/")?n:rk(n,t):t,search:sk(r),hash:ok(s)}}function rk(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function dx(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 Lj(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Bp(e){let t=Lj(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Gp(e,t,n,r=!1){let s;typeof e=="string"?s=ki(e):(s={...e},yt(!s.pathname||!s.pathname.includes("?"),dx("?","pathname","search",s)),yt(!s.pathname||!s.pathname.includes("#"),dx("#","pathname","hash",s)),yt(!s.search||!s.search.includes("#"),dx("#","search","hash",s)));let l=e===""||s.pathname==="",c=l?"/":s.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;s.pathname=v.join("/")}d=y>=0?t[y]:"/"}let f=nk(s,d),h=c&&c!=="/"&&c.endsWith("/"),g=(l||c===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(h||g)&&(f.pathname+="/"),f}var Ls=e=>e.join("/").replace(/\/\/+/g,"/"),ak=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),sk=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,ok=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,tp=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 af(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function yb(e){return e.filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var bi=Symbol("Uninstrumented");function ik(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(s=>s({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 s=Yc(n.lazy,t.lazy,()=>{});s&&(r.lazy=s)}if(typeof t.lazy=="object"){let s=t.lazy;["middleware","loader","action"].forEach(l=>{let c=s[l],d=n[`lazy.${l}`];if(typeof c=="function"&&d.length>0){let f=Yc(d,c,()=>{});f&&(r.lazy=Object.assign(r.lazy||{},{[l]:f}))}})}return["loader","action"].forEach(s=>{let l=t[s];if(typeof l=="function"&&n[s].length>0){let c=l[bi]??l,d=Yc(n[s],c,(...f)=>L2(f[0]));d&&(d[bi]=c,r[s]=d)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(s=>{let l=s[bi]??s,c=Yc(n.middleware,l,(...d)=>L2(d[0]));return c?(c[bi]=l,c):s})),r}function lk(e,t){let n={navigate:[],fetch:[]};if(t.forEach(r=>r({instrument(s){let l=Object.keys(s);for(let c of l)s[c]&&n[c].push(s[c])}})),n.navigate.length>0){let r=e.navigate[bi]??e.navigate,s=Yc(n.navigate,r,(...l)=>{let[c,d]=l;return{to:typeof c=="number"||typeof c=="string"?c:c?Fs(c):".",...P2(e,d??{})}});s&&(s[bi]=r,e.navigate=s)}if(n.fetch.length>0){let r=e.fetch[bi]??e.fetch,s=Yc(n.fetch,r,(...l)=>{let[c,,d,f]=l;return{href:d??".",fetcherKey:c,...P2(e,f??{})}});s&&(s[bi]=r,e.fetch=s)}return e}function Yc(e,t,n){return e.length===0?null:async(...r)=>{let s=await Pj(e,n(...r),()=>t(...r),e.length-1);if(s.type==="error")throw s.value;return s.value}}async function Pj(e,t,n,r){let s=e[r],l;if(s){let c,d=async()=>(c?console.error("You cannot call instrumented handlers more than once"):c=Pj(e,t,n,r-1),l=await c,yt(l,"Expected a result"),l.type==="error"&&l.value instanceof Error?{status:"error",error:l.value}:{status:"success",error:void 0});try{await s(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 L2(e){let{request:t,context:n,params:r,unstable_pattern:s}=e;return{request:ck(t),params:{...r},unstable_pattern:s,context:uk(n)}}function P2(e,t){return{currentUrl:Fs(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 ck(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function uk(e){if(fk(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var dk=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function fk(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")===dk}var Uj=["POST","PUT","PATCH","DELETE"],hk=new Set(Uj),mk=["GET",...Uj],pk=new Set(mk),gk=new Set([301,302,303,307,308]),yk=new Set([307,308]),fx={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},vk={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ad={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},xk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,vb=e=>xk.test(e),bk=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Fj="remix-router-transitions",zj=Symbol("ResetLoaderData");function Sk(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";yt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],s=e.mapRouteProperties||bk,l=s;if(e.unstable_instrumentations){let z=e.unstable_instrumentations;l=X=>({...s(X),...ik(z.map(se=>se.route).filter(Boolean),X)})}let c={},d=rf(e.routes,l,void 0,c),f,h=e.basename||"/";h.startsWith("/")||(h=`/${h}`);let g=e.dataStrategy||Tk,y={...e.future},v=null,b=new Set,w=null,E=null,S=null,R=e.hydrationData!=null,T=yi(d,e.history.location,h),_=!1,D=null,A;if(T==null&&!e.patchRoutesOnNavigation){let z=$a(404,{pathname:e.history.location.pathname}),{matches:X,route:se}=hm(d);A=!0,T=X,D={[se.id]:z}}else if(T&&!e.hydrationData&&Qn(T,d,e.history.location.pathname).active&&(T=null),T)if(T.some(z=>z.route.lazy))A=!1;else if(!T.some(z=>xb(z.route)))A=!0;else{let z=e.hydrationData?e.hydrationData.loaderData:null,X=e.hydrationData?e.hydrationData.errors:null;if(X){let se=T.findIndex(ge=>X[ge.route.id]!==void 0);A=T.slice(0,se+1).every(ge=>!u0(ge.route,z,X))}else A=T.every(se=>!u0(se.route,z,X))}else{A=!1,T=[];let z=Qn(null,d,e.history.location.pathname);z.active&&z.matches&&(_=!0,T=z.matches)}let O,j={historyAction:e.history.action,location:e.history.location,matches:T,initialized:A,navigation:fx,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,ee=null,$=!1,W=!1,k=new Set,H=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 Ne(){if(v=e.history.listen(({action:z,location:X,delta:se})=>{if(ve){ve(),ve=void 0;return}_n(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=Ys({currentLocation:j.location,nextLocation:X,historyAction:z});if(ge&&se!=null){let Re=new Promise(ze=>{ve=ze});e.history.go(se*-1),Vo(ge,{state:"blocked",location:X,proceed(){Vo(ge,{state:"proceeding",proceed:void 0,reset:void 0,location:X}),Re.then(()=>e.history.go(se))},reset(){let ze=new Map(j.blockers);ze.set(ge,Ad),He({blockers:ze})}});return}return Bt(z,X)}),n){Vk(t,Z);let z=()=>$k(t,Z);t.addEventListener("pagehide",z),ee=()=>t.removeEventListener("pagehide",z)}return j.initialized||Bt("POP",j.location,{initialHydration:!0}),O}function we(){v&&v(),ee&&ee(),b.clear(),G&&G.abort(),j.fetchers.forEach((z,X)=>pn(X)),j.blockers.forEach((z,X)=>Cs(X))}function _e(z){return b.add(z),()=>b.delete(z)}function He(z,X={}){z.matches&&(z.matches=z.matches.map(Re=>{let ze=c[Re.route.id],ke=Re.route;return ke.element!==ze.element||ke.errorElement!==ze.errorElement||ke.hydrateFallbackElement!==ze.hydrateFallbackElement?{...Re,route:ze}:Re})),j={...j,...z};let se=[],ge=[];j.fetchers.forEach((Re,ze)=>{Re.state==="idle"&&(te.has(ze)?se.push(ze):ge.push(ze))}),te.forEach(Re=>{!j.fetchers.has(Re)&&!H.has(Re)&&se.push(Re)}),[...b].forEach(Re=>Re(j,{deletedFetchers:se,viewTransitionOpts:X.viewTransitionOpts,flushSync:X.flushSync===!0})),se.forEach(Re=>pn(Re)),ge.forEach(Re=>j.fetchers.delete(Re))}function We(z,X,{flushSync:se}={}){var Ge,qe;let ge=j.actionData!=null&&j.navigation.formMethod!=null&&Ur(j.navigation.formMethod)&&j.navigation.state==="loading"&&((Ge=z.state)==null?void 0:Ge._isRedirect)!==!0,Re;X.actionData?Object.keys(X.actionData).length>0?Re=X.actionData:Re=null:ge?Re=j.actionData:Re=null;let ze=X.loaderData?Z2(j.loaderData,X.loaderData,X.matches||[],X.errors):j.loaderData,ke=j.blockers;ke.size>0&&(ke=new Map(ke),ke.forEach((ct,Wt)=>ke.set(Wt,Ad)));let Me=$?!1:mr(z,X.matches||j.matches),Le=F===!0||j.navigation.formMethod!=null&&Ur(j.navigation.formMethod)&&((qe=z.state)==null?void 0:qe._isRedirect)!==!0;f&&(d=f,f=void 0),$||M==="POP"||(M==="PUSH"?e.history.push(z,z.state):M==="REPLACE"&&e.history.replace(z,z.state));let Ve;if(M==="POP"){let ct=Z.get(j.location.pathname);ct&&ct.has(z.pathname)?Ve={currentLocation:j.location,nextLocation:z}:Z.has(z.pathname)&&(Ve={currentLocation:z,nextLocation:j.location})}else if(Y){let ct=Z.get(j.location.pathname);ct?ct.add(z.pathname):(ct=new Set([z.pathname]),Z.set(j.location.pathname,ct)),Ve={currentLocation:j.location,nextLocation:z}}He({...X,actionData:Re,loaderData:ze,historyAction:M,location:z,initialized:!0,navigation:fx,revalidation:"idle",restoreScrollPosition:Me,preventScrollReset:Le,blockers:ke},{viewTransitionOpts:Ve,flushSync:se===!0}),M="POP",F=!1,Y=!1,$=!1,W=!1,le==null||le.resolve(),le=null}async function Ft(z,X){if(typeof z=="number"){e.history.go(z);return}let se=c0(j.location,j.matches,h,z,X==null?void 0:X.fromRouteId,X==null?void 0:X.relative),{path:ge,submission:Re,error:ze}=U2(!1,se,X),ke=j.location,Me=nf(j.location,ge,X&&X.state);Me={...Me,...e.history.encodeLocation(Me)};let Le=X&&X.replace!=null?X.replace:void 0,Ve="PUSH";Le===!0?Ve="REPLACE":Le===!1||Re!=null&&Ur(Re.formMethod)&&Re.formAction===j.location.pathname+j.location.search&&(Ve="REPLACE");let Ge=X&&"preventScrollReset"in X?X.preventScrollReset===!0:void 0,qe=(X&&X.flushSync)===!0,ct=Ys({currentLocation:ke,nextLocation:Me,historyAction:Ve});if(ct){Vo(ct,{state:"blocked",location:Me,proceed(){Vo(ct,{state:"proceeding",proceed:void 0,reset:void 0,location:Me}),Ft(z,X)},reset(){let Wt=new Map(j.blockers);Wt.set(ct,Ad),He({blockers:Wt})}});return}await Bt(Ve,Me,{submission:Re,pendingError:ze,preventScrollReset:Ge,replace:X&&X.replace,enableViewTransition:X&&X.viewTransition,flushSync:qe})}function jt(){le||(le=Hk()),Ye(),He({revalidation:"loading"});let z=le.promise;return j.navigation.state==="submitting"?z:j.navigation.state==="idle"?(Bt(j.historyAction,j.location,{startUninterruptedRevalidation:!0}),z):(Bt(M||j.historyAction,j.navigation.location,{overrideNavigation:j.navigation,enableViewTransition:Y===!0}),z)}async function Bt(z,X,se){G&&G.abort(),G=null,M=z,$=(se&&se.startUninterruptedRevalidation)===!0,Vn(j.location,j.matches),F=(se&&se.preventScrollReset)===!0,Y=(se&&se.enableViewTransition)===!0;let ge=f||d,Re=se&&se.overrideNavigation,ze=se!=null&&se.initialHydration&&j.matches&&j.matches.length>0&&!_?j.matches:yi(ge,X,h),ke=(se&&se.flushSync)===!0;if(ze&&j.initialized&&!W&&Ik(j.location,X)&&!(se&&se.submission&&Ur(se.submission.formMethod))){We(X,{matches:ze},{flushSync:ke});return}let Me=Qn(ze,ge,X.pathname);if(Me.active&&Me.matches&&(ze=Me.matches),!ze){let{error:cr,notFoundMatches:Gt,route:qt}=Es(X.pathname);We(X,{matches:Gt,loaderData:{},errors:{[qt.id]:cr}},{flushSync:ke});return}G=new AbortController;let Le=$c(e.history,X,G.signal,se&&se.submission),Ve=e.getContext?await e.getContext():new M2,Ge;if(se&&se.pendingError)Ge=[vi(ze).route.id,{type:"error",error:se.pendingError}];else if(se&&se.submission&&Ur(se.submission.formMethod)){let cr=await xn(Le,X,se.submission,ze,Ve,Me.active,se&&se.initialHydration===!0,{replace:se.replace,flushSync:ke});if(cr.shortCircuited)return;if(cr.pendingActionResult){let[Gt,qt]=cr.pendingActionResult;if(fa(qt)&&af(qt.error)&&qt.error.status===404){G=null,We(X,{matches:cr.matches,loaderData:{},errors:{[Gt]:qt.error}});return}}ze=cr.matches||ze,Ge=cr.pendingActionResult,Re=hx(X,se.submission),ke=!1,Me.active=!1,Le=$c(e.history,Le.url,Le.signal)}let{shortCircuited:qe,matches:ct,loaderData:Wt,errors:$n}=await jr(Le,X,ze,Ve,Me.active,Re,se&&se.submission,se&&se.fetcherSubmission,se&&se.replace,se&&se.initialHydration===!0,ke,Ge);qe||(G=null,We(X,{matches:ct||ze,...K2(Ge),loaderData:Wt,errors:$n}))}async function xn(z,X,se,ge,Re,ze,ke,Me={}){Ye();let Le=Fk(X,se);if(He({navigation:Le},{flushSync:Me.flushSync===!0}),ze){let qe=await On(ge,X.pathname,z.signal);if(qe.type==="aborted")return{shortCircuited:!0};if(qe.type==="error"){if(qe.partialMatches.length===0){let{matches:Wt,route:$n}=hm(d);return{matches:Wt,pendingActionResult:[$n.id,{type:"error",error:qe.error}]}}let ct=vi(qe.partialMatches).route.id;return{matches:qe.partialMatches,pendingActionResult:[ct,{type:"error",error:qe.error}]}}else if(qe.matches)ge=qe.matches;else{let{notFoundMatches:ct,error:Wt,route:$n}=Es(X.pathname);return{matches:ct,pendingActionResult:[$n.id,{type:"error",error:Wt}]}}}let Ve,Ge=zm(ge,X);if(!Ge.route.action&&!Ge.route.lazy)Ve={type:"error",error:$a(405,{method:z.method,pathname:X.pathname,routeId:Ge.route.id})};else{let qe=Xc(l,c,z,ge,Ge,ke?[]:r,Re),ct=await be(z,qe,Re,null);if(Ve=ct[Ge.route.id],!Ve){for(let Wt of ge)if(ct[Wt.route.id]){Ve=ct[Wt.route.id];break}}if(z.signal.aborted)return{shortCircuited:!0}}if(vl(Ve)){let qe;return Me&&Me.replace!=null?qe=Me.replace:qe=B2(Ve.response.headers.get("Location"),new URL(z.url),h)===j.location.pathname+j.location.search,await je(z,Ve,!0,{submission:se,replace:qe}),{shortCircuited:!0}}if(fa(Ve)){let qe=vi(ge,Ge.route.id);return(Me&&Me.replace)!==!0&&(M="PUSH"),{matches:ge,pendingActionResult:[qe.route.id,Ve,Ge.route.id]}}return{matches:ge,pendingActionResult:[Ge.route.id,Ve]}}async function jr(z,X,se,ge,Re,ze,ke,Me,Le,Ve,Ge,qe){let ct=ze||hx(X,ke),Wt=ke||Me||W2(ct),$n=!$&&!Ve;if(Re){if($n){let Xn=aa(qe);He({navigation:ct,...Xn!==void 0?{actionData:Xn}:{}},{flushSync:Ge})}let _t=await On(se,X.pathname,z.signal);if(_t.type==="aborted")return{shortCircuited:!0};if(_t.type==="error"){if(_t.partialMatches.length===0){let{matches:Ws,route:Qs}=hm(d);return{matches:Ws,loaderData:{},errors:{[Qs.id]:_t.error}}}let Xn=vi(_t.partialMatches).route.id;return{matches:_t.partialMatches,loaderData:{},errors:{[Xn]:_t.error}}}else if(_t.matches)se=_t.matches;else{let{error:Xn,notFoundMatches:Ws,route:Qs}=Es(X.pathname);return{matches:Ws,loaderData:{},errors:{[Qs.id]:Xn}}}}let cr=f||d,{dsMatches:Gt,revalidatingFetchers:qt}=F2(z,ge,l,c,e.history,j,se,Wt,X,Ve?[]:r,Ve===!0,W,k,te,P,L,cr,h,e.patchRoutesOnNavigation!=null,qe);if(ie=++B,!e.dataStrategy&&!Gt.some(_t=>_t.shouldLoad)&&!Gt.some(_t=>_t.route.middleware&&_t.route.middleware.length>0)&&qt.length===0){let _t=hr();return We(X,{matches:se,loaderData:{},errors:qe&&fa(qe[1])?{[qe[0]]:qe[1].error}:null,...K2(qe),..._t?{fetchers:new Map(j.fetchers)}:{}},{flushSync:Ge}),{shortCircuited:!0}}if($n){let _t={};if(!Re){_t.navigation=ct;let Xn=aa(qe);Xn!==void 0&&(_t.actionData=Xn)}qt.length>0&&(_t.fetchers=Fe(qt)),He(_t,{flushSync:Ge})}qt.forEach(_t=>{Dn(_t.key),_t.controller&&H.set(_t.key,_t.controller)});let Gr=()=>qt.forEach(_t=>Dn(_t.key));G&&G.signal.addEventListener("abort",Gr);let{loaderResults:Aa,fetcherResults:qr}=await Ee(Gt,qt,z,ge);if(z.signal.aborted)return{shortCircuited:!0};G&&G.signal.removeEventListener("abort",Gr),qt.forEach(_t=>H.delete(_t.key));let pr=mm(Aa);if(pr)return await je(z,pr.result,!0,{replace:Le}),{shortCircuited:!0};if(pr=mm(qr),pr)return L.add(pr.key),await je(z,pr.result,!0,{replace:Le}),{shortCircuited:!0};let{loaderData:Cn,errors:$o}=q2(j,se,Aa,qe,qt,qr);Ve&&j.errors&&($o={...j.errors,...$o});let ws=hr(),Da=Sn(ie),es=ws||Da||qt.length>0;return{matches:se,loaderData:Cn,errors:$o,...es?{fetchers:new Map(j.fetchers)}:{}}}function aa(z){if(z&&!fa(z[1]))return{[z[0]]:z[1].data};if(j.actionData)return Object.keys(j.actionData).length===0?null:j.actionData}function Fe(z){return z.forEach(X=>{let se=j.fetchers.get(X.key),ge=Dd(void 0,se?se.data:void 0);j.fetchers.set(X.key,ge)}),new Map(j.fetchers)}async function U(z,X,se,ge){Dn(z);let Re=(ge&&ge.flushSync)===!0,ze=f||d,ke=c0(j.location,j.matches,h,se,X,ge==null?void 0:ge.relative),Me=yi(ze,ke,h),Le=Qn(Me,ze,ke);if(Le.active&&Le.matches&&(Me=Le.matches),!Me){ot(z,X,$a(404,{pathname:ke}),{flushSync:Re});return}let{path:Ve,submission:Ge,error:qe}=U2(!0,ke,ge);if(qe){ot(z,X,qe,{flushSync:Re});return}let ct=e.getContext?await e.getContext():new M2,Wt=(ge&&ge.preventScrollReset)===!0;if(Ge&&Ur(Ge.formMethod)){await Q(z,X,Ve,Me,ct,Le.active,Re,Wt,Ge);return}P.set(z,{routeId:X,path:Ve}),await de(z,X,Ve,Me,ct,Le.active,Re,Wt,Ge)}async function Q(z,X,se,ge,Re,ze,ke,Me,Le){Ye(),P.delete(z);let Ve=j.fetchers.get(z);st(z,zk(Le,Ve),{flushSync:ke});let Ge=new AbortController,qe=$c(e.history,se,Ge.signal,Le);if(ze){let fn=await On(ge,new URL(qe.url).pathname,qe.signal,z);if(fn.type==="aborted")return;if(fn.type==="error"){ot(z,X,fn.error,{flushSync:ke});return}else if(fn.matches)ge=fn.matches;else{ot(z,X,$a(404,{pathname:se}),{flushSync:ke});return}}let ct=zm(ge,se);if(!ct.route.action&&!ct.route.lazy){let fn=$a(405,{method:Le.formMethod,pathname:se,routeId:X});ot(z,X,fn,{flushSync:ke});return}H.set(z,Ge);let Wt=B,$n=Xc(l,c,qe,ge,ct,r,Re),Gt=(await be(qe,$n,Re,z))[ct.route.id];if(qe.signal.aborted){H.get(z)===Ge&&H.delete(z);return}if(te.has(z)){if(vl(Gt)||fa(Gt)){st(z,bo(void 0));return}}else{if(vl(Gt))if(H.delete(z),ie>Wt){st(z,bo(void 0));return}else return L.add(z),st(z,Dd(Le)),je(qe,Gt,!1,{fetcherSubmission:Le,preventScrollReset:Me});if(fa(Gt)){ot(z,X,Gt.error);return}}let qt=j.navigation.location||j.location,Gr=$c(e.history,qt,Ge.signal),Aa=f||d,qr=j.navigation.state!=="idle"?yi(Aa,j.navigation.location,h):j.matches;yt(qr,"Didn't find any matches after fetcher action");let pr=++B;xe.set(z,pr);let Cn=Dd(Le,Gt.data);j.fetchers.set(z,Cn);let{dsMatches:$o,revalidatingFetchers:ws}=F2(Gr,Re,l,c,e.history,j,qr,Le,qt,r,!1,W,k,te,P,L,Aa,h,e.patchRoutesOnNavigation!=null,[ct.route.id,Gt]);ws.filter(fn=>fn.key!==z).forEach(fn=>{let Xs=fn.key,Oa=j.fetchers.get(Xs),Zr=Dd(void 0,Oa?Oa.data:void 0);j.fetchers.set(Xs,Zr),Dn(Xs),fn.controller&&H.set(Xs,fn.controller)}),He({fetchers:new Map(j.fetchers)});let Da=()=>ws.forEach(fn=>Dn(fn.key));Ge.signal.addEventListener("abort",Da);let{loaderResults:es,fetcherResults:_t}=await Ee($o,ws,Gr,Re);if(Ge.signal.aborted)return;if(Ge.signal.removeEventListener("abort",Da),xe.delete(z),H.delete(z),ws.forEach(fn=>H.delete(fn.key)),j.fetchers.has(z)){let fn=bo(Gt.data);j.fetchers.set(z,fn)}let Xn=mm(es);if(Xn)return je(Gr,Xn.result,!1,{preventScrollReset:Me});if(Xn=mm(_t),Xn)return L.add(Xn.key),je(Gr,Xn.result,!1,{preventScrollReset:Me});let{loaderData:Ws,errors:Qs}=q2(j,qr,es,void 0,ws,_t);Sn(pr),j.navigation.state==="loading"&&pr>ie?(yt(M,"Expected pending action"),G&&G.abort(),We(j.navigation.location,{matches:qr,loaderData:Ws,errors:Qs,fetchers:new Map(j.fetchers)})):(He({errors:Qs,loaderData:Z2(j.loaderData,Ws,qr,Qs),fetchers:new Map(j.fetchers)}),W=!1)}async function de(z,X,se,ge,Re,ze,ke,Me,Le){let Ve=j.fetchers.get(z);st(z,Dd(Le,Ve?Ve.data:void 0),{flushSync:ke});let Ge=new AbortController,qe=$c(e.history,se,Ge.signal);if(ze){let qt=await On(ge,new URL(qe.url).pathname,qe.signal,z);if(qt.type==="aborted")return;if(qt.type==="error"){ot(z,X,qt.error,{flushSync:ke});return}else if(qt.matches)ge=qt.matches;else{ot(z,X,$a(404,{pathname:se}),{flushSync:ke});return}}let ct=zm(ge,se);H.set(z,Ge);let Wt=B,$n=Xc(l,c,qe,ge,ct,r,Re),Gt=(await be(qe,$n,Re,z))[ct.route.id];if(H.get(z)===Ge&&H.delete(z),!qe.signal.aborted){if(te.has(z)){st(z,bo(void 0));return}if(vl(Gt))if(ie>Wt){st(z,bo(void 0));return}else{L.add(z),await je(qe,Gt,!1,{preventScrollReset:Me});return}if(fa(Gt)){ot(z,X,Gt.error);return}st(z,bo(Gt.data))}}async function je(z,X,se,{submission:ge,fetcherSubmission:Re,preventScrollReset:ze,replace:ke}={}){X.response.headers.has("X-Remix-Revalidate")&&(W=!0);let Me=X.response.headers.get("Location");yt(Me,"Expected a Location header on the redirect Response"),Me=B2(Me,new URL(z.url),h);let Le=nf(j.location,Me,{_isRedirect:!0});if(n){let $n=!1;if(X.response.headers.has("X-Remix-Reload-Document"))$n=!0;else if(vb(Me)){const cr=Mj(Me,!0);$n=cr.origin!==t.location.origin||qa(cr.pathname,h)==null}if($n){ke?t.location.replace(Me):t.location.assign(Me);return}}G=null;let Ve=ke===!0||X.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Ge,formAction:qe,formEncType:ct}=j.navigation;!ge&&!Re&&Ge&&qe&&ct&&(ge=W2(j.navigation));let Wt=ge||Re;if(yk.has(X.response.status)&&Wt&&Ur(Wt.formMethod))await Bt(Ve,Le,{submission:{...Wt,formAction:Me},preventScrollReset:ze||F,enableViewTransition:se?Y:void 0});else{let $n=hx(Le,ge);await Bt(Ve,Le,{overrideNavigation:$n,fetcherSubmission:Re,preventScrollReset:ze||F,enableViewTransition:se?Y:void 0})}}async function be(z,X,se,ge){let Re,ze={};try{Re=await _k(g,z,X,ge,se,!1)}catch(ke){return X.filter(Me=>Me.shouldLoad).forEach(Me=>{ze[Me.route.id]={type:"error",error:ke}}),ze}if(z.signal.aborted)return ze;for(let[ke,Me]of Object.entries(Re))if(Pk(Me)){let Le=Me.result;ze[ke]={type:"redirect",response:Ok(Le,z,ke,X,h)}}else ze[ke]=await Dk(Me);return ze}async function Ee(z,X,se,ge){let Re=be(se,z,ge,null),ze=Promise.all(X.map(async Le=>{if(Le.matches&&Le.match&&Le.request&&Le.controller){let Ge=(await be(Le.request,Le.matches,ge,Le.key))[Le.match.route.id];return{[Le.key]:Ge}}else return Promise.resolve({[Le.key]:{type:"error",error:$a(404,{pathname:Le.path})}})})),ke=await Re,Me=(await ze).reduce((Le,Ve)=>Object.assign(Le,Ve),{});return{loaderResults:ke,fetcherResults:Me}}function Ye(){W=!0,P.forEach((z,X)=>{H.has(X)&&k.add(X),Dn(X)})}function st(z,X,se={}){j.fetchers.set(z,X),He({fetchers:new Map(j.fetchers)},{flushSync:(se&&se.flushSync)===!0})}function ot(z,X,se,ge={}){let Re=vi(j.matches,X);pn(z),He({errors:{[Re.route.id]:se},fetchers:new Map(j.fetchers)},{flushSync:(ge&&ge.flushSync)===!0})}function mn(z){return q.set(z,(q.get(z)||0)+1),te.has(z)&&te.delete(z),j.fetchers.get(z)||vk}function Na(z,X){Dn(z,X==null?void 0:X.reason),st(z,bo(null))}function pn(z){let X=j.fetchers.get(z);H.has(z)&&!(X&&X.state==="loading"&&xe.has(z))&&Dn(z),P.delete(z),xe.delete(z),L.delete(z),te.delete(z),k.delete(z),j.fetchers.delete(z)}function zo(z){let X=(q.get(z)||0)-1;X<=0?(q.delete(z),te.add(z)):q.set(z,X),He({fetchers:new Map(j.fetchers)})}function Dn(z,X){let se=H.get(z);se&&(se.abort(X),H.delete(z))}function bn(z){for(let X of z){let se=mn(X),ge=bo(se.data);j.fetchers.set(X,ge)}}function hr(){let z=[],X=!1;for(let se of L){let ge=j.fetchers.get(se);yt(ge,`Expected fetcher: ${se}`),ge.state==="loading"&&(L.delete(se),z.push(se),X=!0)}return bn(z),X}function Sn(z){let X=[];for(let[se,ge]of xe)if(ge<z){let Re=j.fetchers.get(se);yt(Re,`Expected fetcher: ${se}`),Re.state==="loading"&&(Dn(se),xe.delete(se),X.push(se))}return bn(X),X.length>0}function Wi(z,X){let se=j.blockers.get(z)||Ad;return ue.get(z)!==X&&ue.set(z,X),se}function Cs(z){j.blockers.delete(z),ue.delete(z)}function Vo(z,X){let se=j.blockers.get(z)||Ad;yt(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(j.blockers);ge.set(z,X),He({blockers:ge})}function Ys({currentLocation:z,nextLocation:X,historyAction:se}){if(ue.size===0)return;ue.size>1&&_n(!1,"A router only supports one blocker at a time");let ge=Array.from(ue.entries()),[Re,ze]=ge[ge.length-1],ke=j.blockers.get(Re);if(!(ke&&ke.state==="proceeding")&&ze({currentLocation:z,nextLocation:X,historyAction:se}))return Re}function Es(z){let X=$a(404,{pathname:z}),se=f||d,{matches:ge,route:Re}=hm(se);return{notFoundMatches:ge,route:Re,error:X}}function gn(z,X,se){if(w=z,S=X,E=se||null,!R&&j.navigation===fx){R=!0;let ge=mr(j.location,j.matches);ge!=null&&He({restoreScrollPosition:ge})}return()=>{w=null,S=null,E=null}}function dn(z,X){return E&&E(z,X.map(ge=>$I(ge,j.loaderData)))||z.key}function Vn(z,X){if(w&&S){let se=dn(z,X);w[se]=S()}}function mr(z,X){if(w){let se=dn(z,X),ge=w[se];if(typeof ge=="number")return ge}return null}function Qn(z,X,se){if(e.patchRoutesOnNavigation)if(z){if(Object.keys(z[0].params).length>0)return{active:!0,matches:Fm(X,se,h,!0)}}else return{active:!0,matches:Fm(X,se,h,!0)||[]};return{active:!1,matches:null}}async function On(z,X,se,ge){if(!e.patchRoutesOnNavigation)return{type:"success",matches:z};let Re=z;for(;;){let ze=f==null,ke=f||d,Me=c;try{await e.patchRoutesOnNavigation({signal:se,path:X,matches:Re,fetcherKey:ge,patch:(Ge,qe)=>{se.aborted||z2(Ge,qe,ke,Me,l,!1)}})}catch(Ge){return{type:"error",error:Ge,partialMatches:Re}}finally{ze&&!se.aborted&&(d=[...d])}if(se.aborted)return{type:"aborted"};let Le=yi(ke,X,h);if(Le)return{type:"success",matches:Le};let Ve=Fm(ke,X,h,!0);if(!Ve||Re.length===Ve.length&&Re.every((Ge,qe)=>Ge.route.id===Ve[qe].route.id))return{type:"success",matches:null};Re=Ve}}function _r(z){c={},f=rf(z,l,void 0,c)}function Br(z,X,se=!1){let ge=f==null;z2(z,X,f||d,c,l,se),ge&&(d=[...d],He({}))}return O={get basename(){return h},get future(){return y},get state(){return j},get routes(){return d},get window(){return t},initialize:Ne,subscribe:_e,enableScrollRestoration:gn,navigate:Ft,fetch:U,revalidate:jt,createHref:z=>e.history.createHref(z),encodeLocation:z=>e.history.encodeLocation(z),getFetcher:mn,resetFetcher:Na,deleteFetcher:zo,dispose:we,getBlocker:Wi,deleteBlocker:Cs,patchRoutes:Br,_internalFetchControllers:H,_internalSetRoutes:_r,_internalSetStateDoNotUseOrYouWillBreakYourApp(z){He(z)}},e.unstable_instrumentations&&(O=lk(O,e.unstable_instrumentations.map(z=>z.router).filter(Boolean))),O}function Ck(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function c0(e,t,n,r,s,l){let c,d;if(s){c=[];for(let h of t)if(c.push(h),h.route.id===s){d=h;break}}else c=t,d=t[t.length-1];let f=Gp(r||".",Bp(c),qa(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=bb(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=tk({basename:n,pathname:f.pathname})),Fs(f)}function U2(e,t,n){if(!n||!Ck(n))return{path:t};if(n.formMethod&&!Uk(n.formMethod))return{path:t,error:$a(405,{method:n.formMethod})};let r=()=>({path:t,error:$a(400,{type:"invalid-body"})}),l=(n.formMethod||"get").toUpperCase(),c=qj(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!Ur(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(!Ur(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()}}}yt(typeof FormData=="function","FormData is not available in this environment");let d,f;if(n.formData)d=f0(n.formData),f=n.formData;else if(n.body instanceof FormData)d=f0(n.body),f=n.body;else if(n.body instanceof URLSearchParams)d=n.body,f=G2(d);else if(n.body==null)d=new URLSearchParams,f=new FormData;else try{d=new URLSearchParams(n.body),f=G2(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(Ur(h.formMethod))return{path:t,submission:h};let g=ki(t);return e&&g.search&&bb(g.search)&&d.append("index",""),g.search=`?${d}`,{path:Fs(g),submission:h}}function F2(e,t,n,r,s,l,c,d,f,h,g,y,v,b,w,E,S,R,T,_){var $;let D=_?fa(_[1])?_[1].error:_[1].data:void 0,A=s.createURL(l.location),O=s.createURL(f),j;if(g&&l.errors){let W=Object.keys(l.errors)[0];j=c.findIndex(k=>k.route.id===W)}else if(_&&fa(_[1])){let W=_[0];j=c.findIndex(k=>k.route.id===W)-1}let M=_?_[1].statusCode:void 0,F=M&&M>=400,G={currentUrl:A,currentParams:(($=l.matches[0])==null?void 0:$.params)||{},nextUrl:O,nextParams:c[0].params,...d,actionResult:D,actionStatus:M},Y=yb(c.map(W=>W.route.path)),Z=c.map((W,k)=>{let{route:H}=W,B=null;if(j!=null&&k>j?B=!1:H.lazy?B=!0:xb(H)?g?B=u0(H,l.loaderData,l.errors):Ek(l.loaderData,l.matches[k],W)&&(B=!0):B=!1,B!==null)return d0(n,r,e,Y,W,h,t,B);let ie=F?!1:y||A.pathname+A.search===O.pathname+O.search||A.search!==O.search||wk(l.matches[k],W),xe={...G,defaultShouldRevalidate:ie},L=np(W,xe);return d0(n,r,e,Y,W,h,t,L,xe)}),ee=[];return w.forEach((W,k)=>{if(g||!c.some(te=>te.route.id===W.routeId)||b.has(k))return;let H=l.fetchers.get(k),B=H&&H.state!=="idle"&&H.data===void 0,ie=yi(S,W.path,R);if(!ie){if(T&&B)return;ee.push({key:k,routeId:W.routeId,path:W.path,matches:null,match:null,request:null,controller:null});return}if(E.has(k))return;let xe=zm(ie,W.path),L=new AbortController,P=$c(s,W.path,L.signal),q=null;if(v.has(k))v.delete(k),q=Xc(n,r,P,ie,xe,h,t);else if(B)y&&(q=Xc(n,r,P,ie,xe,h,t));else{let te={...G,defaultShouldRevalidate:F?!1:y};np(xe,te)&&(q=Xc(n,r,P,ie,xe,h,t,te))}q&&ee.push({key:k,routeId:W.routeId,path:W.path,matches:q,match:xe,request:P,controller:L})}),{dsMatches:Z,revalidatingFetchers:ee}}function xb(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function u0(e,t,n){if(e.lazy)return!0;if(!xb(e))return!1;let r=t!=null&&e.id in t,s=n!=null&&n[e.id]!==void 0;return!r&&s?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!s}function Ek(e,t,n){let r=!t||n.route.id!==t.route.id,s=!e.hasOwnProperty(n.route.id);return r||s}function wk(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function np(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function z2(e,t,n,r,s,l){let c;if(e){let h=r[e];yt(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=>Vj(h,y));g?f.push({existingRoute:g,newRoute:h}):d.push(h)}),d.length>0){let h=rf(d,s,[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]=rf([y],s,[],{},!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 Vj(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 s;return(s=t.children)==null?void 0:s.some(l=>Vj(n,l))}):!1}var V2=new WeakMap,$j=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let s=n[t.id];if(yt(s,"No route found in manifest"),!s.lazy||typeof s.lazy!="object")return;let l=s.lazy[e];if(!l)return;let c=V2.get(s);c||(c={},V2.set(s,c));let d=c[e];if(d)return d;let f=(async()=>{let h=UI(e),y=s[e]!==void 0&&e!=="hasErrorBoundary";if(h)_n(!h,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(y)_n(!1,`Route "${s.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let v=await l();v!=null&&(Object.assign(s,{[e]:v}),Object.assign(s,r(s)))}typeof s.lazy=="object"&&(s.lazy[e]=void 0,Object.values(s.lazy).every(v=>v===void 0)&&(s.lazy=void 0))})();return c[e]=f,f},$2=new WeakMap;function Rk(e,t,n,r,s){let l=n[e.id];if(yt(l,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let g=$2.get(l);if(g)return{lazyRoutePromise:g,lazyHandlerPromise:g};let y=(async()=>{yt(typeof e.lazy=="function","No lazy route function found");let v=await e.lazy(),b={};for(let w in v){let E=v[w];if(E===void 0)continue;let S=zI(w),T=l[w]!==void 0&&w!=="hasErrorBoundary";S?_n(!S,"Route property "+w+" is not a supported property to be returned from a lazy route function. This property will be ignored."):T?_n(!T,`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]=E}Object.assign(l,b),Object.assign(l,{...r(l),lazy:void 0})})();return $2.set(l,y),y.catch(()=>{}),{lazyRoutePromise:y,lazyHandlerPromise:y}}let c=Object.keys(e.lazy),d=[],f;for(let g of c){if(s&&s.includes(g))continue;let y=$j({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 H2(e){let t=e.matches.filter(s=>s.shouldLoad),n={};return(await Promise.all(t.map(s=>s.resolve()))).forEach((s,l)=>{n[t[l].route.id]=s}),n}async function Tk(e){return e.matches.some(t=>t.route.middleware)?Hj(e,()=>H2(e)):H2(e)}function Hj(e,t){return jk(e,t,r=>r,kk,n);function n(r,s,l){if(l)return Promise.resolve(Object.assign(l.value,{[s]:{type:"error",result:r}}));{let{matches:c}=e,d=Math.min(Math.max(c.findIndex(h=>h.route.id===s),0),Math.max(c.findIndex(h=>h.unstable_shouldCallHandler()),0)),f=vi(c,c[d].route.id).route.id;return Promise.resolve({[f]:{type:"error",result:r}})}}}async function jk(e,t,n,r,s){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 Bj({request:c,params:d,context:f,unstable_pattern:h},g,t,n,r,s)}async function Bj(e,t,n,r,s,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 Bj(e,t,n,r,s,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 s(w)?w:y?w??y.value:(y={value:await v()},y.value)}catch(b){return await l(b,h,y)}}function Gj(e,t,n,r,s){let l=$j({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),c=Rk(r.route,Ur(n.method)?"action":"loader",t,e,s);return{middleware:l,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function d0(e,t,n,r,s,l,c,d,f=null){let h=!1,g=Gj(e,t,n,s,l);return{...s,_lazyPromises:g,shouldLoad:d,unstable_shouldRevalidateArgs:f,unstable_shouldCallHandler(y){return h=!0,f?typeof y=="boolean"?np(s,{...f,defaultShouldRevalidate:y}):np(s,f):d},resolve(y){let{lazy:v,loader:b,middleware:w}=s.route,E=h||d||y&&!Ur(n.method)&&(v||b),S=w&&w.length>0&&!b&&!v;return E&&(Ur(n.method)||!S)?Nk({request:n,unstable_pattern:r,match:s,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 Xc(e,t,n,r,s,l,c,d=null){return r.map(f=>f.route.id!==s.route.id?{...f,shouldLoad:!1,unstable_shouldRevalidateArgs:d,unstable_shouldCallHandler:()=>!1,_lazyPromises:Gj(e,t,n,f,l),resolve:()=>Promise.resolve({type:"data",result:void 0})}:d0(e,t,n,yb(r.map(h=>h.route.path)),f,l,c,!0,d))}async function _k(e,t,n,r,s,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:yb(n.map(h=>h.route.path)),params:n[0].params,context:s,matches:n},f=await e({...c,fetcherKey:r,runClientMiddleware:h=>{let g=c;return Hj(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 Nk({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:r,lazyRoutePromise:s,handlerOverride:l,scopedContext:c}){let d,f,h=Ur(e.method),g=h?"action":"loader",y=v=>{let b,w=new Promise((R,T)=>b=T);f=()=>b(),e.signal.addEventListener("abort",f);let E=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]:[]),S=(async()=>{try{return{type:"data",result:await(l?l(T=>E(T)):E())}}catch(R){return{type:"error",result:R}}})();return Promise.race([S,w])};try{let v=h?n.route.action:n.route.loader;if(r||s)if(v){let b,[w]=await Promise.all([y(v).catch(E=>{b=E}),r,s]);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),s]);else if(g==="action"){let w=new URL(e.url),E=w.pathname+w.search;throw $a(405,{method:e.method,pathname:E,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 $a(404,{pathname:w})}}catch(v){return{type:"error",result:v}}finally{f&&e.signal.removeEventListener("abort",f)}return d}async function Ak(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 Dk(e){var r,s,l,c,d,f;let{result:t,type:n}=e;if(Zj(t)){let h;try{h=await Ak(t)}catch(g){return{type:"error",error:g}}return n==="error"?{type:"error",error:new tp(t.status,t.statusText,h),statusCode:t.status,headers:t.headers}:{type:"data",data:h,statusCode:t.status,headers:t.headers}}return n==="error"?Y2(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(r=t.init)==null?void 0:r.status,headers:(s=t.init)!=null&&s.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new tp(((l=t.init)==null?void 0:l.status)||500,void 0,t.data),statusCode:af(t)?t.status:void 0,headers:(c=t.init)!=null&&c.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:af(t)?t.status:void 0}:Y2(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 Ok(e,t,n,r,s){let l=e.headers.get("Location");if(yt(l,"Redirects returned/thrown from loaders/actions must have a Location header"),!vb(l)){let c=r.slice(0,r.findIndex(d=>d.route.id===n)+1);l=c0(new URL(t.url),c,s,l),e.headers.set("Location",l)}return e}function B2(e,t,n){if(vb(e)){let r=e,s=r.startsWith("//")?new URL(t.protocol+r):new URL(r),l=qa(s.pathname,n)!=null;if(s.origin===t.origin&&l)return s.pathname+s.search+s.hash}return e}function $c(e,t,n,r){let s=e.createURL(qj(t)).toString(),l={signal:n};if(r&&Ur(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=f0(r.formData):l.body=r.formData}return new Request(s,l)}function f0(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function G2(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Mk(e,t,n,r=!1,s=!1){let l={},c=null,d,f=!1,h={},g=n&&fa(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(yt(!vl(b),"Cannot handle redirect results in processLoaderData"),fa(b)){let w=b.error;if(g!==void 0&&(w=g,g=void 0),c=c||{},s)c[v]=w;else{let E=vi(e,v);c[E.route.id]==null&&(c[E.route.id]=w)}r||(l[v]=zj),f||(f=!0,d=af(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 q2(e,t,n,r,s,l){let{loaderData:c,errors:d}=Mk(t,n,r);return s.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(yt(v,"Did not find corresponding fetcher result"),fa(v)){let b=vi(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(vl(v))yt(!1,"Unhandled fetcher revalidation redirect");else{let b=bo(v.data);e.fetchers.set(h,b)}}),{loaderData:c,errors:d}}function Z2(e,t,n,r){let s=Object.entries(t).filter(([,l])=>l!==zj).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&&(s[c]=e[c]),r&&r.hasOwnProperty(c))break}return s}function K2(e){return e?fa(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function vi(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 hm(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 $a(e,{pathname:t,routeId:n,method:r,type:s,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.`:s==="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 tp(e||500,c,new Error(d),!0)}function mm(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,s]=t[n];if(vl(s))return{key:r,result:s}}}function qj(e){let t=typeof e=="string"?ki(e):e;return Fs({...t,hash:""})}function Ik(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function kk(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&Lk(n))}function Lk(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function Pk(e){return Zj(e.result)&&gk.has(e.result.status)}function fa(e){return e.type==="error"}function vl(e){return(e&&e.type)==="redirect"}function Y2(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Zj(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Uk(e){return pk.has(e.toUpperCase())}function Ur(e){return hk.has(e.toUpperCase())}function bb(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function zm(e,t){let n=typeof t=="string"?ki(t).search:t.search;if(e[e.length-1].route.index&&bb(n||""))return e[e.length-1];let r=Lj(e);return r[r.length-1]}function W2(e){let{formMethod:t,formAction:n,formEncType:r,text:s,formData:l,json:c}=e;if(!(!t||!n||!r)){if(s!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:s};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 hx(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 Fk(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 Dd(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 zk(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 bo(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 Vk(e,t){try{let n=e.sessionStorage.getItem(Fj);if(n){let r=JSON.parse(n);for(let[s,l]of Object.entries(r||{}))l&&Array.isArray(l)&&t.set(s,new Set(l||[]))}}catch{}}function $k(e,t){if(t.size>0){let n={};for(let[r,s]of t)n[r]=[...s];try{e.sessionStorage.setItem(Fj,JSON.stringify(n))}catch(r){_n(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function Hk(){let e,t,n=new Promise((r,s)=>{e=async l=>{r(l);try{await n}catch{}},t=async l=>{s(l);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Vl=p.createContext(null);Vl.displayName="DataRouter";var bf=p.createContext(null);bf.displayName="DataRouterState";p.createContext(!1);var Sb=p.createContext({isTransitioning:!1});Sb.displayName="ViewTransition";var Kj=p.createContext(new Map);Kj.displayName="Fetchers";var Bk=p.createContext(null);Bk.displayName="Await";var vs=p.createContext(null);vs.displayName="Navigation";var qp=p.createContext(null);qp.displayName="Location";var Ya=p.createContext({outlet:null,matches:[],isDataRoute:!1});Ya.displayName="Route";var Cb=p.createContext(null);Cb.displayName="RouteError";function Gk(e,{relative:t}={}){yt(xu(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=p.useContext(vs),{hash:s,pathname:l,search:c}=Sf(e,{relative:t}),d=l;return n!=="/"&&(d=l==="/"?n:Ls([n,l])),r.createHref({pathname:d,search:c,hash:s})}function xu(){return p.useContext(qp)!=null}function Gs(){return yt(xu(),"useLocation() may be used only in the context of a <Router> component."),p.useContext(qp).location}var Yj="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Wj(e){p.useContext(vs).static||p.useLayoutEffect(e)}function Zp(){let{isDataRoute:e}=p.useContext(Ya);return e?s8():qk()}function qk(){yt(xu(),"useNavigate() may be used only in the context of a <Router> component.");let e=p.useContext(Vl),{basename:t,navigator:n}=p.useContext(vs),{matches:r}=p.useContext(Ya),{pathname:s}=Gs(),l=JSON.stringify(Bp(r)),c=p.useRef(!1);return Wj(()=>{c.current=!0}),p.useCallback((f,h={})=>{if(_n(c.current,Yj),!c.current)return;if(typeof f=="number"){n.go(f);return}let g=Gp(f,JSON.parse(l),s,h.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:Ls([t,g.pathname])),(h.replace?n.replace:n.push)(g,h.state,h)},[t,n,l,s,e])}var Qj=p.createContext(null);function Wa(){return p.useContext(Qj)}function Zk(e){let t=p.useContext(Ya).outlet;return p.useMemo(()=>t&&p.createElement(Qj.Provider,{value:e},t),[t,e])}function Xj(){let{matches:e}=p.useContext(Ya),t=e[e.length-1];return t?t.params:{}}function Sf(e,{relative:t}={}){let{matches:n}=p.useContext(Ya),{pathname:r}=Gs(),s=JSON.stringify(Bp(n));return p.useMemo(()=>Gp(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function Kk(e,t,n,r,s){yt(xu(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:l}=p.useContext(vs),{matches:c}=p.useContext(Ya),d=c[c.length-1],f=d?d.params:{},h=d?d.pathname:"/",g=d?d.pathnameBase:"/",y=d&&d.route;{let T=y&&y.path||"";Jj(h,!y||T.endsWith("*")||T.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${T}">) 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="${T}"> to <Route path="${T==="/"?"*":`${T}/*`}">.`)}let v=Gs(),b;b=v;let w=b.pathname||"/",E=w;if(g!=="/"){let T=g.replace(/^\//,"").split("/");E="/"+w.replace(/^\//,"").split("/").slice(T.length).join("/")}let S=yi(e,{pathname:E});return _n(y||S!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),_n(S==null||S[S.length-1].route.element!==void 0||S[S.length-1].route.Component!==void 0||S[S.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.`),Jk(S&&S.map(T=>Object.assign({},T,{params:Object.assign({},f,T.params),pathname:Ls([g,l.encodeLocation?l.encodeLocation(T.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?g:Ls([g,l.encodeLocation?l.encodeLocation(T.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathnameBase])})),c,n,r,s)}function Yk(){let e=a8(),t=af(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)",s={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=p.createElement(p.Fragment,null,p.createElement("p",null,"💿 Hey developer 👋"),p.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",p.createElement("code",{style:l},"ErrorBoundary")," or"," ",p.createElement("code",{style:l},"errorElement")," prop on your route.")),p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},t),n?p.createElement("pre",{style:s},n):null,c)}var Wk=p.createElement(Yk,null),Qk=class extends p.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?p.createElement(Ya.Provider,{value:this.props.routeContext},p.createElement(Cb.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Xk({routeContext:e,match:t,children:n}){let r=p.useContext(Vl);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),p.createElement(Ya.Provider,{value:e},n)}function Jk(e,t=[],n=null,r=null,s=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);yt(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,E=null;n&&(v=c&&g.route.id?c[g.route.id]:void 0,w=g.route.errorElement||Wk,d&&(f<0&&y===0?(Jj("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,E=null):f===y&&(b=!0,E=g.route.hydrateFallbackElement||null)));let S=t.concat(l.slice(0,y+1)),R=()=>{let T;return v?T=w:b?T=E:g.route.Component?T=p.createElement(g.route.Component,null):g.route.element?T=g.route.element:T=h,p.createElement(Xk,{match:g,routeContext:{outlet:h,matches:S,isDataRoute:n!=null},children:T})};return n&&(g.route.ErrorBoundary||g.route.errorElement||y===0)?p.createElement(Qk,{location:n.location,revalidation:n.revalidation,component:w,error:v,children:R(),routeContext:{outlet:null,matches:S,isDataRoute:!0},unstable_onError:r}):R()},null)}function Eb(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function e8(e){let t=p.useContext(Vl);return yt(t,Eb(e)),t}function t8(e){let t=p.useContext(bf);return yt(t,Eb(e)),t}function n8(e){let t=p.useContext(Ya);return yt(t,Eb(e)),t}function wb(e){let t=n8(e),n=t.matches[t.matches.length-1];return yt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function r8(){return wb("useRouteId")}function a8(){var r;let e=p.useContext(Cb),t=t8("useRouteError"),n=wb("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function s8(){let{router:e}=e8("useNavigate"),t=wb("useNavigate"),n=p.useRef(!1);return Wj(()=>{n.current=!0}),p.useCallback(async(s,l={})=>{_n(n.current,Yj),n.current&&(typeof s=="number"?e.navigate(s):await e.navigate(s,{fromRouteId:t,...l}))},[e,t])}var Q2={};function Jj(e,t,n){!t&&!Q2[e]&&(Q2[e]=!0,_n(!1,n))}var X2={};function J2(e,t){!e&&!X2[t]&&(X2[t]=!0,console.warn(t))}function o8(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&_n(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:p.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&_n(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:p.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&_n(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:p.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var i8=["HydrateFallback","hydrateFallbackElement"],l8=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 c8({router:e,flushSync:t,unstable_onError:n}){let[r,s]=p.useState(e.state),[l,c]=p.useState(),[d,f]=p.useState({isTransitioning:!1}),[h,g]=p.useState(),[y,v]=p.useState(),[b,w]=p.useState(),E=p.useRef(new Map),S=p.useCallback(A=>{s(O=>(A.errors&&n&&Object.entries(A.errors).forEach(([j,M])=>{var F;((F=O.errors)==null?void 0:F[j])!==M&&n(M)}),A))},[n]),R=p.useCallback((A,{deletedFetchers:O,flushSync:j,viewTransitionOpts:M})=>{A.fetchers.forEach((G,Y)=>{G.data!==void 0&&E.current.set(Y,G.data)}),O.forEach(G=>E.current.delete(G)),J2(j===!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(J2(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&&j?t(()=>S(A)):p.startTransition(()=>S(A));return}if(t&&j){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(()=>S(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,S]);p.useLayoutEffect(()=>e.subscribe(R),[e,R]),p.useEffect(()=>{d.isTransitioning&&!d.flushSync&&g(new l8)},[d]),p.useEffect(()=>{if(h&&l&&e.window){let A=l,O=h.promise,j=e.window.document.startViewTransition(async()=>{p.startTransition(()=>S(A)),await O});j.finished.finally(()=>{g(void 0),v(void 0),c(void 0),f({isTransitioning:!1})}),v(j)}},[l,h,e.window,S]),p.useEffect(()=>{h&&l&&r.location.key===l.location.key&&h.resolve()},[h,y,r.location,l]),p.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 T=p.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:A=>e.navigate(A),push:(A,O,j)=>e.navigate(A,{state:O,preventScrollReset:j==null?void 0:j.preventScrollReset}),replace:(A,O,j)=>e.navigate(A,{replace:!0,state:O,preventScrollReset:j==null?void 0:j.preventScrollReset})}),[e]),_=e.basename||"/",D=p.useMemo(()=>({router:e,navigator:T,static:!1,basename:_,unstable_onError:n}),[e,T,_,n]);return p.createElement(p.Fragment,null,p.createElement(Vl.Provider,{value:D},p.createElement(bf.Provider,{value:r},p.createElement(Kj.Provider,{value:E.current},p.createElement(Sb.Provider,{value:d},p.createElement(h8,{basename:_,location:r.location,navigationType:r.historyAction,navigator:T},p.createElement(u8,{routes:e.routes,future:e.future,state:r,unstable_onError:n})))))),null)}var u8=p.memo(d8);function d8({routes:e,future:t,state:n,unstable_onError:r}){return Kk(e,void 0,n,r,t)}function f8({to:e,replace:t,state:n,relative:r}){yt(xu(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=p.useContext(vs);_n(!s,"<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}=p.useContext(Ya),{pathname:c}=Gs(),d=Zp(),f=Gp(e,Bp(l),c,r==="path"),h=JSON.stringify(f);return p.useEffect(()=>{d(JSON.parse(h),{replace:t,state:n,relative:r})},[d,h,r,t,n]),null}function e_(e){return Zk(e.context)}function h8({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:l=!1}){yt(!xu(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),d=p.useMemo(()=>({basename:c,navigator:s,static:l,future:{}}),[c,s,l]);typeof n=="string"&&(n=ki(n));let{pathname:f="/",search:h="",hash:g="",state:y=null,key:v="default"}=n,b=p.useMemo(()=>{let w=qa(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 _n(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:p.createElement(vs.Provider,{value:d},p.createElement(qp.Provider,{children:t,value:b}))}var Vm="get",$m="application/x-www-form-urlencoded";function Kp(e){return e!=null&&typeof e.tagName=="string"}function m8(e){return Kp(e)&&e.tagName.toLowerCase()==="button"}function p8(e){return Kp(e)&&e.tagName.toLowerCase()==="form"}function g8(e){return Kp(e)&&e.tagName.toLowerCase()==="input"}function y8(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function v8(e,t){return e.button===0&&(!t||t==="_self")&&!y8(e)}function h0(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(s=>[n,s]):[[n,r]])},[]))}function x8(e,t){let n=h0(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(l=>{n.append(s,l)})}),n}var pm=null;function b8(){if(pm===null)try{new FormData(document.createElement("form"),0),pm=!1}catch{pm=!0}return pm}var S8=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function mx(e){return e!=null&&!S8.has(e)?(_n(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${$m}"`),null):e}function C8(e,t){let n,r,s,l,c;if(p8(e)){let d=e.getAttribute("action");r=d?qa(d,t):null,n=e.getAttribute("method")||Vm,s=mx(e.getAttribute("enctype"))||$m,l=new FormData(e)}else if(m8(e)||g8(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?qa(f,t):null,n=e.getAttribute("formmethod")||d.getAttribute("method")||Vm,s=mx(e.getAttribute("formenctype"))||mx(d.getAttribute("enctype"))||$m,l=new FormData(d,e),!b8()){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(Kp(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Vm,r=null,s=$m,c=e}return l&&s==="text/plain"&&(c=l,l=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:l,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Rb(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function E8(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&&qa(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function w8(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 R8(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 T8(e,t,n){let r=await Promise.all(e.map(async s=>{let l=t.routes[s.route.id];if(l){let c=await w8(l,n);return c.links?c.links():[]}return[]}));return A8(r.flat(1).filter(R8).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function eR(e,t,n,r,s,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(s.pathname+s.search+s.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 j8(e,t,{includeHydrateFallback:n}={}){return _8(e.map(r=>{let s=t.routes[r.route.id];if(!s)return[];let l=[s.module];return s.clientActionModule&&(l=l.concat(s.clientActionModule)),s.clientLoaderModule&&(l=l.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(l=l.concat(s.hydrateFallbackModule)),s.imports&&(l=l.concat(s.imports)),l}).flat(1))}function _8(e){return[...new Set(e)]}function N8(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function A8(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let l=JSON.stringify(N8(s));return n.has(l)||(n.add(l),r.push({key:l,link:s})),r},[])}function t_(){let e=p.useContext(Vl);return Rb(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function D8(){let e=p.useContext(bf);return Rb(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Tb=p.createContext(void 0);Tb.displayName="FrameworkContext";function n_(){let e=p.useContext(Tb);return Rb(e,"You must render this element inside a <HydratedRouter> element"),e}function O8(e,t){let n=p.useContext(Tb),[r,s]=p.useState(!1),[l,c]=p.useState(!1),{onFocus:d,onBlur:f,onMouseEnter:h,onMouseLeave:g,onTouchStart:y}=t,v=p.useRef(null);p.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let E=R=>{R.forEach(T=>{c(T.isIntersecting)})},S=new IntersectionObserver(E,{threshold:.5});return v.current&&S.observe(v.current),()=>{S.disconnect()}}},[e]),p.useEffect(()=>{if(r){let E=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(E)}}},[r]);let b=()=>{s(!0)},w=()=>{s(!1),c(!1)};return n?e!=="intent"?[l,v,{}]:[l,v,{onFocus:Od(d,b),onBlur:Od(f,w),onMouseEnter:Od(h,b),onMouseLeave:Od(g,w),onTouchStart:Od(y,b)}]:[!1,v,{}]}function Od(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function M8({page:e,...t}){let{router:n}=t_(),r=p.useMemo(()=>yi(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?p.createElement(k8,{page:e,matches:r,...t}):null}function I8(e){let{manifest:t,routeModules:n}=n_(),[r,s]=p.useState([]);return p.useEffect(()=>{let l=!1;return T8(e,t,n).then(c=>{l||s(c)}),()=>{l=!0}},[e,t,n]),r}function k8({page:e,matches:t,...n}){let r=Gs(),{manifest:s,routeModules:l}=n_(),{basename:c}=t_(),{loaderData:d,matches:f}=D8(),h=p.useMemo(()=>eR(e,t,f,s,r,"data"),[e,t,f,s,r]),g=p.useMemo(()=>eR(e,t,f,s,r,"assets"),[e,t,f,s,r]),y=p.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let w=new Set,E=!1;if(t.forEach(R=>{var _;let T=s.routes[R.route.id];!T||!T.hasLoader||(!h.some(D=>D.route.id===R.route.id)&&R.route.id in d&&((_=l[R.route.id])!=null&&_.shouldRevalidate)||T.hasClientLoader?E=!0:w.add(R.route.id))}),w.size===0)return[];let S=E8(e,c,"data");return E&&w.size>0&&S.searchParams.set("_routes",t.filter(R=>w.has(R.route.id)).map(R=>R.route.id).join(",")),[S.pathname+S.search]},[c,d,r,s,h,t,e,l]),v=p.useMemo(()=>j8(g,s),[g,s]),b=I8(g);return p.createElement(p.Fragment,null,y.map(w=>p.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),v.map(w=>p.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),b.map(({key:w,link:E})=>p.createElement("link",{key:w,nonce:n.nonce,...E})))}function L8(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var r_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{r_&&(window.__reactRouterVersion="7.9.5")}catch{}function P8(e,t){return Sk({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:II({window:t==null?void 0:t.window}),hydrationData:U8(),routes:e,mapRouteProperties:o8,hydrationRouteProperties:i8,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 U8(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:F8(e.errors)}),e}function F8(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,s]of t)if(s&&s.__type==="RouteErrorResponse")n[r]=new tp(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let l=window[s.__subType];if(typeof l=="function")try{let c=new l(s.message);c.stack="",n[r]=c}catch{}}if(n[r]==null){let l=new Error(s.message);l.stack="",n[r]=l}}else n[r]=s;return n}var a_=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Za=p.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:l,replace:c,state:d,target:f,to:h,preventScrollReset:g,viewTransition:y,...v},b){let{basename:w}=p.useContext(vs),E=typeof h=="string"&&a_.test(h),S,R=!1;if(typeof h=="string"&&E&&(S=h,r_))try{let F=new URL(window.location.href),G=h.startsWith("//")?new URL(F.protocol+h):new URL(h),Y=qa(G.pathname,w);G.origin===F.origin&&Y!=null?h=Y+G.search+G.hash:R=!0}catch{_n(!1,`<Link to="${h}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let T=Gk(h,{relative:s}),[_,D,A]=O8(r,v),O=$8(h,{replace:c,state:d,target:f,preventScrollReset:g,relative:s,viewTransition:y});function j(F){t&&t(F),F.defaultPrevented||O(F)}let M=p.createElement("a",{...v,...A,href:S||T,onClick:R||l?t:j,ref:L8(b,D),target:f,"data-discover":!E&&n==="render"?"true":void 0});return _&&!E?p.createElement(p.Fragment,null,M,p.createElement(M8,{page:T})):M});Za.displayName="Link";var Cf=p.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:l,to:c,viewTransition:d,children:f,...h},g){let y=Sf(c,{relative:h.relative}),v=Gs(),b=p.useContext(bf),{navigator:w,basename:E}=p.useContext(vs),S=b!=null&&K8(y)&&d===!0,R=w.encodeLocation?w.encodeLocation(y).pathname:y.pathname,T=v.pathname,_=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(T=T.toLowerCase(),_=_?_.toLowerCase():null,R=R.toLowerCase()),_&&E&&(_=qa(_,E)||_);const D=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let A=T===R||!s&&T.startsWith(R)&&T.charAt(D)==="/",O=_!=null&&(_===R||!s&&_.startsWith(R)&&_.charAt(R.length)==="/"),j={isActive:A,isPending:O,isTransitioning:S},M=A?t:void 0,F;typeof r=="function"?F=r(j):F=[r,A?"active":null,O?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let G=typeof l=="function"?l(j):l;return p.createElement(Za,{...h,"aria-current":M,className:F,ref:g,style:G,to:c,viewTransition:d},typeof f=="function"?f(j):f)});Cf.displayName="NavLink";var z8=p.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:l,method:c=Vm,action:d,onSubmit:f,relative:h,preventScrollReset:g,viewTransition:y,...v},b)=>{let w=q8(),E=Z8(d,{relative:h}),S=c.toLowerCase()==="get"?"get":"post",R=typeof d=="string"&&a_.test(d),T=_=>{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:s,state:l,relative:h,preventScrollReset:g,viewTransition:y})};return p.createElement("form",{ref:b,method:S,action:E,onSubmit:r?f:T,...v,"data-discover":!R&&e==="render"?"true":void 0})});z8.displayName="Form";function V8(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=p.useContext(Vl);return yt(t,V8(e)),t}function $8(e,{target:t,replace:n,state:r,preventScrollReset:s,relative:l,viewTransition:c}={}){let d=Zp(),f=Gs(),h=Sf(e,{relative:l});return p.useCallback(g=>{if(v8(g,t)){g.preventDefault();let y=n!==void 0?n:Fs(f)===Fs(h);d(e,{replace:y,state:r,preventScrollReset:s,relative:l,viewTransition:c})}},[f,d,h,n,r,t,e,s,l,c])}function H8(e){_n(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=p.useRef(h0(e)),n=p.useRef(!1),r=Gs(),s=p.useMemo(()=>x8(r.search,n.current?null:t.current),[r.search]),l=Zp(),c=p.useCallback((d,f)=>{const h=h0(typeof d=="function"?d(new URLSearchParams(s)):d);n.current=!0,l("?"+h,f)},[l,s]);return[s,c]}var B8=0,G8=()=>`__${String(++B8)}__`;function q8(){let{router:e}=s_("useSubmit"),{basename:t}=p.useContext(vs),n=r8();return p.useCallback(async(r,s={})=>{let{action:l,method:c,encType:d,formData:f,body:h}=C8(r,t);if(s.navigate===!1){let g=s.fetcherKey||G8();await e.fetch(g,n,s.action||l,{preventScrollReset:s.preventScrollReset,formData:f,body:h,formMethod:s.method||c,formEncType:s.encType||d,flushSync:s.flushSync})}else await e.navigate(s.action||l,{preventScrollReset:s.preventScrollReset,formData:f,body:h,formMethod:s.method||c,formEncType:s.encType||d,replace:s.replace,state:s.state,fromRouteId:n,flushSync:s.flushSync,viewTransition:s.viewTransition})},[e,t,n])}function Z8(e,{relative:t}={}){let{basename:n}=p.useContext(vs),r=p.useContext(Ya);yt(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),l={...Sf(e||".",{relative:t})},c=Gs();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===".")&&s.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(l.pathname=l.pathname==="/"?n:Ls([n,l.pathname])),Fs(l)}function K8(e,{relative:t}={}){let n=p.useContext(Sb);yt(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"),s=Sf(e,{relative:t});if(!n.isTransitioning)return!1;let l=qa(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=qa(n.nextLocation.pathname,r)||n.nextLocation.pathname;return ep(s.pathname,c)!=null||ep(s.pathname,l)!=null}var ds=Dj();const Y8=Aj(ds);function W8(e){return p.createElement(c8,{flushSync:ds.flushSync,...e})}function tR(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ir(...e){return t=>{let n=!1;const r=e.map(s=>{const l=tR(s,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let s=0;s<r.length;s++){const l=r[s];typeof l=="function"?l():tR(e[s],null)}}}}function ut(...e){return p.useCallback(Ir(...e),e)}var Q8=Symbol.for("react.lazy"),rp=gb[" use ".trim().toString()];function X8(e){return typeof e=="object"&&e!==null&&"then"in e}function o_(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Q8&&"_payload"in e&&X8(e._payload)}function jb(e){const t=J8(e),n=p.forwardRef((r,s)=>{let{children:l,...c}=r;o_(l)&&typeof rp=="function"&&(l=rp(l._payload));const d=p.Children.toArray(l),f=d.find(t9);if(f){const h=f.props.children,g=d.map(y=>y===f?p.Children.count(h)>1?p.Children.only(null):p.isValidElement(h)?h.props.children:null:y);return o.jsx(t,{...c,ref:s,children:p.isValidElement(h)?p.cloneElement(h,void 0,g):null})}return o.jsx(t,{...c,ref:s,children:l})});return n.displayName=`${e}.Slot`,n}var Yp=jb("Slot");function J8(e){const t=p.forwardRef((n,r)=>{let{children:s,...l}=n;if(o_(s)&&typeof rp=="function"&&(s=rp(s._payload)),p.isValidElement(s)){const c=r9(s),d=n9(l,s.props);return s.type!==p.Fragment&&(d.ref=r?Ir(r,c):c),p.cloneElement(s,d)}return p.Children.count(s)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var e9=Symbol("radix.slottable");function t9(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===e9}function n9(e,t){const n={...t};for(const r in t){const s=e[r],l=t[r];/^on[A-Z]/.test(r)?s&&l?n[r]=(...d)=>{const f=l(...d);return s(...d),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...l}:r==="className"&&(n[r]=[s,l].filter(Boolean).join(" "))}return{...e,...n}}function r9(e){var r,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function i_(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=i_(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function l_(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=i_(e))&&(r&&(r+=" "),r+=t);return r}const nR=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,rR=l_,Ef=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return rR(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:l}=t,c=Object.keys(s).map(h=>{const g=n==null?void 0:n[h],y=l==null?void 0:l[h];if(g===null)return null;const v=nR(g)||nR(y);return s[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[E,S]=w;return Array.isArray(S)?S.includes({...l,...d}[E]):{...l,...d}[E]===S})?[...h,y,v]:h},[]);return rR(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 a9=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),c_=(...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 s9={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 o9=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:l,iconNode:c,...d},f)=>p.createElement("svg",{ref:f,...s9,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:c_("lucide",s),...d},[...c.map(([h,g])=>p.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 Oe=(e,t)=>{const n=p.forwardRef(({className:r,...s},l)=>p.createElement(o9,{ref:l,iconNode:t,className:c_(`lucide-${a9(e)}`,r),...s}));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 i9=[["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"}]],_b=Oe("ArchiveRestore",i9);/**
|
|
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 l9=[["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"}]],aR=Oe("ArrowDownZA",l9);/**
|
|
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 c9=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],u9=Oe("ArrowLeft",c9);/**
|
|
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 d9=[["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"}]],f9=Oe("ArrowRightLeft",d9);/**
|
|
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 h9=[["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"}]],sR=Oe("ArrowUpAZ",h9);/**
|
|
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 m9=[["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"}]],oR=Oe("ArrowUpDown",m9);/**
|
|
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 p9=[["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"}]],g9=Oe("Asterisk",p9);/**
|
|
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 y9=[["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"}]],v9=Oe("BadgeAlert",y9);/**
|
|
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 x9=[["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"}]],b9=Oe("BookOpen",x9);/**
|
|
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 S9=[["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"}]],ap=Oe("Box",S9);/**
|
|
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 C9=[["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"}]],E9=Oe("BriefcaseBusiness",C9);/**
|
|
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 w9=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],fr=Oe("Check",w9);/**
|
|
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 R9=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Qa=Oe("ChevronDown",R9);/**
|
|
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 T9=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],j9=Oe("ChevronLeft",T9);/**
|
|
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 _9=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ja=Oe("ChevronRight",_9);/**
|
|
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 N9=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],zs=Oe("ChevronUp",N9);/**
|
|
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 A9=[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]],D9=Oe("ChevronsDownUp",A9);/**
|
|
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 O9=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Nb=Oe("ChevronsUpDown",O9);/**
|
|
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 M9=[["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"}]],wf=Oe("CircleAlert",M9);/**
|
|
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 I9=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],k9=Oe("CircleCheckBig",I9);/**
|
|
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 L9=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Wp=Oe("CircleCheck",L9);/**
|
|
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 P9=[["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"}]],sp=Oe("CircleX",P9);/**
|
|
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 U9=[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]],Ab=Oe("Code",U9);/**
|
|
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 F9=[["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"}]],z9=Oe("Columns3",F9);/**
|
|
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 V9=[["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"}]],sf=Oe("Copy",V9);/**
|
|
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 $9=[["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"}]],H9=Oe("DatabaseZap",$9);/**
|
|
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 B9=[["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"}]],lu=Oe("Database",B9);/**
|
|
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 G9=[["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"}]],q9=Oe("Download",G9);/**
|
|
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 Z9=[["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"}]],K9=Oe("EllipsisVertical",Z9);/**
|
|
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 Y9=[["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"}]],Xa=Oe("Ellipsis",Y9);/**
|
|
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 W9=[["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"}]],_l=Oe("ExternalLink",W9);/**
|
|
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 Q9=[["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"}]],X9=Oe("EyeOff",Q9);/**
|
|
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 J9=[["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"}]],u_=Oe("Eye",J9);/**
|
|
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 eL=[["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"}]],tL=Oe("FileText",eL);/**
|
|
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 nL=[["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"}]],iR=Oe("Gem",nL);/**
|
|
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 rL=[["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"}]],aL=Oe("GraduationCap",rL);/**
|
|
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 sL=[["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"}]],oL=Oe("GripVertical",sL);/**
|
|
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 iL=[["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"}]],lL=Oe("Grip",iL);/**
|
|
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 cL=[["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"}]],uL=Oe("Hand",cL);/**
|
|
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 dL=[["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"}]],fL=Oe("History",dL);/**
|
|
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 hL=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],zr=Oe("Info",hL);/**
|
|
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 mL=[["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"}]],m0=Oe("KeyRound",mL);/**
|
|
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 pL=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Rf=Oe("LoaderCircle",pL);/**
|
|
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 gL=[["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"}]],yL=Oe("Lock",gL);/**
|
|
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 vL=[["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"}]],xL=Oe("LogOut",vL);/**
|
|
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 bL=[["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"}]],SL=Oe("Menu",bL);/**
|
|
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 CL=[["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"}]],EL=Oe("MessageCircleQuestion",CL);/**
|
|
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 wL=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],RL=Oe("MessageCircle",wL);/**
|
|
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 TL=[["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"}]],d_=Oe("Monitor",TL);/**
|
|
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 jL=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],f_=Oe("Moon",jL);/**
|
|
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 _L=[["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"}]],NL=Oe("OctagonAlert",_L);/**
|
|
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 AL=[["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"}]],DL=Oe("OctagonX",AL);/**
|
|
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 OL=[["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"}]],ML=Oe("PackageSearch",OL);/**
|
|
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 IL=[["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"}]],kL=Oe("PenLine",IL);/**
|
|
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 LL=[["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"}]],Tf=Oe("Pencil",LL);/**
|
|
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 PL=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Db=Oe("Play",PL);/**
|
|
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 UL=[["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"}]],Ob=Oe("Plug",UL);/**
|
|
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 FL=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],_a=Oe("Plus",FL);/**
|
|
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 zL=[["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"}]],VL=Oe("RefreshCw",zL);/**
|
|
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 $L=[["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"}]],HL=Oe("Scale",$L);/**
|
|
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 BL=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],$l=Oe("Search",BL);/**
|
|
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 GL=[["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"}]],h_=Oe("Settings",GL);/**
|
|
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 qL=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m9 8 6 4-6 4Z",key:"f1r3lt"}]],ZL=Oe("SquarePlay",qL);/**
|
|
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 KL=[["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"}]],m_=Oe("Sun",KL);/**
|
|
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 YL=[["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"}]],WL=Oe("Table",YL);/**
|
|
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 QL=[["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=Oe("Telescope",QL);/**
|
|
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 JL=[["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"}]],Mb=Oe("Timer",JL);/**
|
|
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 e7=[["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"}]],Lo=Oe("Trash2",e7);/**
|
|
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 t7=[["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"}]],Qp=Oe("TriangleAlert",t7);/**
|
|
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 n7=[["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"}]],of=Oe("Unplug",n7);/**
|
|
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 r7=[["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"}]],lR=Oe("Users",r7);/**
|
|
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 a7=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],cu=Oe("X",a7),px=768;function s7(){const[e,t]=p.useState(void 0);return p.useEffect(()=>{const n=window.matchMedia(`(max-width: ${px-1}px)`),r=()=>{t(window.innerWidth<px)};return n.addEventListener("change",r),t(window.innerWidth<px),()=>n.removeEventListener("change",r)},[]),!!e}const o7=(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},i7=(e,t)=>({classGroupId:e,validator:t}),p_=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),op="-",cR=[],l7="arbitrary..",c7=e=>{const t=d7(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return u7(c);const d=c.split(op),f=d[0]===""&&d.length>1?1:0;return g_(d,f,t)},getConflictingClassGroupIds:(c,d)=>{if(d){const f=r[c],h=n[c];return f?h?o7(h,f):f:h||cR}return n[c]||cR}}},g_=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],l=n.nextPart.get(s);if(l){const h=g_(e,t+1,l);if(h)return h}const c=n.validators;if(c===null)return;const d=t===0?e.join(op):e.slice(t).join(op),f=c.length;for(let h=0;h<f;h++){const g=c[h];if(g.validator(d))return g.classGroupId}},u7=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?l7+r:void 0})(),d7=e=>{const{theme:t,classGroups:n}=e;return f7(n,t)},f7=(e,t)=>{const n=p_();for(const r in e){const s=e[r];Ib(s,n,r,t)}return n},Ib=(e,t,n,r)=>{const s=e.length;for(let l=0;l<s;l++){const c=e[l];h7(c,t,n,r)}},h7=(e,t,n,r)=>{if(typeof e=="string"){m7(e,t,n);return}if(typeof e=="function"){p7(e,t,n,r);return}g7(e,t,n,r)},m7=(e,t,n)=>{const r=e===""?t:y_(t,e);r.classGroupId=n},p7=(e,t,n,r)=>{if(y7(e)){Ib(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(i7(n,e))},g7=(e,t,n,r)=>{const s=Object.entries(e),l=s.length;for(let c=0;c<l;c++){const[d,f]=s[c];Ib(f,y_(t,d),n,r)}},y_=(e,t)=>{let n=e;const r=t.split(op),s=r.length;for(let l=0;l<s;l++){const c=r[l];let d=n.nextPart.get(c);d||(d=p_(),n.nextPart.set(c,d)),n=d}return n},y7=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,v7=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(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 s(l,c),c},set(l,c){l in n?n[l]=c:s(l,c)}}},p0="!",uR=":",x7=[],dR=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),b7=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const l=[];let c=0,d=0,f=0,h;const g=s.length;for(let E=0;E<g;E++){const S=s[E];if(c===0&&d===0){if(S===uR){l.push(s.slice(f,E)),f=E+1;continue}if(S==="/"){h=E;continue}}S==="["?c++:S==="]"?c--:S==="("?d++:S===")"&&d--}const y=l.length===0?s:s.slice(f);let v=y,b=!1;y.endsWith(p0)?(v=y.slice(0,-1),b=!0):y.startsWith(p0)&&(v=y.slice(1),b=!0);const w=h&&h>f?h-f:void 0;return dR(l,b,v,w)};if(t){const s=t+uR,l=r;r=c=>c.startsWith(s)?l(c.slice(s.length)):dR(x7,!1,c,void 0,!0)}if(n){const s=r;r=l=>n({className:l,parseClassName:s})}return r},S7=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let l=0;l<n.length;l++){const c=n[l],d=c[0]==="[",f=t.has(c);d||f?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(c)):s.push(c)}return s.length>0&&(s.sort(),r.push(...s)),r}},C7=e=>({cache:v7(e.cacheSize),parseClassName:b7(e),sortModifiers:S7(e),...c7(e)}),E7=/\s+/,w7=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:l}=t,c=[],d=e.trim().split(E7);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:E}=n(g);if(y){f=g+(f.length>0?" "+f:f);continue}let S=!!E,R=r(S?w.substring(0,E):w);if(!R){if(!S){f=g+(f.length>0?" "+f:f);continue}if(R=r(w),!R){f=g+(f.length>0?" "+f:f);continue}S=!1}const T=v.length===0?"":v.length===1?v[0]:l(v).join(":"),_=b?T+p0:T,D=_+R;if(c.indexOf(D)>-1)continue;c.push(D);const A=s(R,S);for(let O=0;O<A.length;++O){const j=A[O];c.push(_+j)}f=g+(f.length>0?" "+f:f)}return f},R7=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=v_(n))&&(s&&(s+=" "),s+=r);return s},v_=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=v_(e[r]))&&(n&&(n+=" "),n+=t);return n},T7=(e,...t)=>{let n,r,s,l;const c=f=>{const h=t.reduce((g,y)=>y(g),e());return n=C7(h),r=n.cache.get,s=n.cache.set,l=d,d(f)},d=f=>{const h=r(f);if(h)return h;const g=w7(f,n);return s(f,g),g};return l=c,(...f)=>l(R7(...f))},j7=[],er=e=>{const t=n=>n[e]||j7;return t.isThemeGetter=!0,t},x_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,b_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,_7=/^\d+\/\d+$/,N7=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,A7=/\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$/,D7=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,O7=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,M7=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Mc=e=>_7.test(e),gt=e=>!!e&&!Number.isNaN(Number(e)),fi=e=>!!e&&Number.isInteger(Number(e)),gx=e=>e.endsWith("%")&>(e.slice(0,-1)),yo=e=>N7.test(e),I7=()=>!0,k7=e=>A7.test(e)&&!D7.test(e),S_=()=>!1,L7=e=>O7.test(e),P7=e=>M7.test(e),U7=e=>!Ze(e)&&!Ke(e),F7=e=>bu(e,w_,S_),Ze=e=>x_.test(e),hl=e=>bu(e,R_,k7),yx=e=>bu(e,B7,gt),fR=e=>bu(e,C_,S_),z7=e=>bu(e,E_,P7),gm=e=>bu(e,T_,L7),Ke=e=>b_.test(e),Md=e=>Su(e,R_),V7=e=>Su(e,G7),hR=e=>Su(e,C_),$7=e=>Su(e,w_),H7=e=>Su(e,E_),ym=e=>Su(e,T_,!0),bu=(e,t,n)=>{const r=x_.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Su=(e,t,n=!1)=>{const r=b_.exec(e);return r?r[1]?t(r[1]):n:!1},C_=e=>e==="position"||e==="percentage",E_=e=>e==="image"||e==="url",w_=e=>e==="length"||e==="size"||e==="bg-size",R_=e=>e==="length",B7=e=>e==="number",G7=e=>e==="family-name",T_=e=>e==="shadow",q7=()=>{const e=er("color"),t=er("font"),n=er("text"),r=er("font-weight"),s=er("tracking"),l=er("leading"),c=er("breakpoint"),d=er("container"),f=er("spacing"),h=er("radius"),g=er("shadow"),y=er("inset-shadow"),v=er("text-shadow"),b=er("drop-shadow"),w=er("blur"),E=er("perspective"),S=er("aspect"),R=er("ease"),T=er("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(),Ke,Ze],O=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],M=()=>[Ke,Ze,f],F=()=>[Mc,"full","auto",...M()],G=()=>[fi,"none","subgrid",Ke,Ze],Y=()=>["auto",{span:["full",fi,Ke,Ze]},fi,Ke,Ze],Z=()=>[fi,"auto",Ke,Ze],ee=()=>["auto","min","max","fr",Ke,Ze],$=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],k=()=>["auto",...M()],H=()=>[Mc,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],B=()=>[e,Ke,Ze],ie=()=>[...D(),hR,fR,{position:[Ke,Ze]}],xe=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",$7,F7,{size:[Ke,Ze]}],P=()=>[gx,Md,hl],q=()=>["","none","full",h,Ke,Ze],te=()=>["",gt,Md,hl],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=()=>[gt,gx,hR,fR],Ne=()=>["","none",w,Ke,Ze],we=()=>["none",gt,Ke,Ze],_e=()=>["none",gt,Ke,Ze],He=()=>[gt,Ke,Ze],We=()=>[Mc,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[yo],breakpoint:[yo],color:[I7],container:[yo],"drop-shadow":[yo],ease:["in","out","in-out"],font:[U7],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[yo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[yo],shadow:[yo],spacing:["px",gt],text:[yo],"text-shadow":[yo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Mc,Ze,Ke,S]}],container:["container"],columns:[{columns:[gt,Ze,Ke,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:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],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:[fi,"auto",Ke,Ze]}],basis:[{basis:[Mc,"full","auto",d,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[gt,Mc,"auto","initial","none",Ze]}],grow:[{grow:["",gt,Ke,Ze]}],shrink:[{shrink:["",gt,Ke,Ze]}],order:[{order:[fi,"first","last","none",Ke,Ze]}],"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":ee()}],"auto-rows":[{"auto-rows":ee()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...$(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...$()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":$()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],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:H()}],w:[{w:[d,"screen",...H()]}],"min-w":[{"min-w":[d,"screen","none",...H()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[c]},...H()]}],h:[{h:["screen","lh",...H()]}],"min-h":[{"min-h":["screen","lh","none",...H()]}],"max-h":[{"max-h":["screen","lh",...H()]}],"font-size":[{text:["base",n,Md,hl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Ke,yx]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",gx,Ze]}],"font-family":[{font:[V7,Ze,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:[s,Ke,Ze]}],"line-clamp":[{"line-clamp":[gt,"none",Ke,yx]}],leading:[{leading:[l,...M()]}],"list-image":[{"list-image":["none",Ke,Ze]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ke,Ze]}],"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:[gt,"from-font","auto",Ke,hl]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[gt,"auto",Ke,Ze]}],"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",Ke,Ze]}],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",Ke,Ze]}],"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"]},fi,Ke,Ze],radial:["",Ke,Ze],conic:[fi,Ke,Ze]},H7,z7]}],"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":[gt,Ke,Ze]}],"outline-w":[{outline:["",gt,Md,hl]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","none",g,ym,gm]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",y,ym,gm]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[gt,hl]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",v,ym,gm]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[gt,Ke,Ze]}],"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":[gt]}],"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":[Ke,Ze]}],"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":[gt]}],"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",Ke,Ze]}],filter:[{filter:["","none",Ke,Ze]}],blur:[{blur:Ne()}],brightness:[{brightness:[gt,Ke,Ze]}],contrast:[{contrast:[gt,Ke,Ze]}],"drop-shadow":[{"drop-shadow":["","none",b,ym,gm]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",gt,Ke,Ze]}],"hue-rotate":[{"hue-rotate":[gt,Ke,Ze]}],invert:[{invert:["",gt,Ke,Ze]}],saturate:[{saturate:[gt,Ke,Ze]}],sepia:[{sepia:["",gt,Ke,Ze]}],"backdrop-filter":[{"backdrop-filter":["","none",Ke,Ze]}],"backdrop-blur":[{"backdrop-blur":Ne()}],"backdrop-brightness":[{"backdrop-brightness":[gt,Ke,Ze]}],"backdrop-contrast":[{"backdrop-contrast":[gt,Ke,Ze]}],"backdrop-grayscale":[{"backdrop-grayscale":["",gt,Ke,Ze]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[gt,Ke,Ze]}],"backdrop-invert":[{"backdrop-invert":["",gt,Ke,Ze]}],"backdrop-opacity":[{"backdrop-opacity":[gt,Ke,Ze]}],"backdrop-saturate":[{"backdrop-saturate":[gt,Ke,Ze]}],"backdrop-sepia":[{"backdrop-sepia":["",gt,Ke,Ze]}],"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",Ke,Ze]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[gt,"initial",Ke,Ze]}],ease:[{ease:["linear","initial",R,Ke,Ze]}],delay:[{delay:[gt,Ke,Ze]}],animate:[{animate:["none",T,Ke,Ze]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[E,Ke,Ze]}],"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:_e()}],"scale-x":[{"scale-x":_e()}],"scale-y":[{"scale-y":_e()}],"scale-z":[{"scale-z":_e()}],"scale-3d":["scale-3d"],skew:[{skew:He()}],"skew-x":[{"skew-x":He()}],"skew-y":[{"skew-y":He()}],transform:[{transform:[Ke,Ze,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:We()}],"translate-x":[{"translate-x":We()}],"translate-y":[{"translate-y":We()}],"translate-z":[{"translate-z":We()}],"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",Ke,Ze]}],"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",Ke,Ze]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[gt,Md,hl,yx]}],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"]}},Z7=T7(q7);function ne(...e){return Z7(l_(e))}const kb=Ef("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,...s}){const l=r?Yp:"button";return o.jsx(l,{"data-slot":"button",className:ne(kb({variant:t,size:n,className:e})),...s})}function zt({className:e,type:t,...n}){return o.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 K7=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Y7=K7.reduce((e,t)=>{const n=jb(`Primitive.${t}`),r=p.forwardRef((s,l)=>{const{asChild:c,...d}=s,f=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(f,{...d,ref:l})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),W7="Separator",mR="horizontal",Q7=["horizontal","vertical"],j_=p.forwardRef((e,t)=>{const{decorative:n,orientation:r=mR,...s}=e,l=X7(r)?r:mR,d=n?{role:"none"}:{"aria-orientation":l==="vertical"?l:void 0,role:"separator"};return o.jsx(Y7.div,{"data-orientation":l,...d,...s,ref:t})});j_.displayName=W7;function X7(e){return Q7.includes(e)}var J7=j_;function __({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return o.jsx(J7,{"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(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function eP(e,t){const n=p.createContext(t),r=l=>{const{children:c,...d}=l,f=p.useMemo(()=>d,Object.values(d));return o.jsx(n.Provider,{value:f,children:c})};r.displayName=e+"Provider";function s(l){const c=p.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${l}\` must be used within \`${e}\``)}return[r,s]}function ir(e,t=[]){let n=[];function r(l,c){const d=p.createContext(c),f=n.length;n=[...n,c];const h=y=>{var R;const{scope:v,children:b,...w}=y,E=((R=v==null?void 0:v[e])==null?void 0:R[f])||d,S=p.useMemo(()=>w,Object.values(w));return o.jsx(E.Provider,{value:S,children:b})};h.displayName=l+"Provider";function g(y,v){var E;const b=((E=v==null?void 0:v[e])==null?void 0:E[f])||d,w=p.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 s=()=>{const l=n.map(c=>p.createContext(c));return function(d){const f=(d==null?void 0:d[e])||l;return p.useMemo(()=>({[`__scope${e}`]:{...d,[e]:f}}),[d,f])}};return s.scopeName=e,[r,tP(s,...t)]}function tP(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(l){const c=r.reduce((d,{useScope:f,scopeName:h})=>{const y=f(l)[`__scope${h}`];return{...d,...y}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var Cr=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},nP=gb[" useId ".trim().toString()]||(()=>{}),rP=0;function Nn(e){const[t,n]=p.useState(nP());return Cr(()=>{n(r=>r??String(rP++))},[e]),e||(t?`radix-${t}`:"")}var aP=gb[" useInsertionEffect ".trim().toString()]||Cr;function Vr({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,l,c]=sP({defaultProp:t,onChange:n}),d=e!==void 0,f=d?e:s;{const g=p.useRef(e!==void 0);p.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=p.useCallback(g=>{var y;if(d){const v=oP(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 sP({defaultProp:e,onChange:t}){const[n,r]=p.useState(e),s=p.useRef(n),l=p.useRef(t);return aP(()=>{l.current=t},[t]),p.useEffect(()=>{var c;s.current!==n&&((c=l.current)==null||c.call(l,n),s.current=n)},[n,s]),[n,r,l]}function oP(e){return typeof e=="function"}function iP(e){const t=lP(e),n=p.forwardRef((r,s)=>{const{children:l,...c}=r,d=p.Children.toArray(l),f=d.find(uP);if(f){const h=f.props.children,g=d.map(y=>y===f?p.Children.count(h)>1?p.Children.only(null):p.isValidElement(h)?h.props.children:null:y);return o.jsx(t,{...c,ref:s,children:p.isValidElement(h)?p.cloneElement(h,void 0,g):null})}return o.jsx(t,{...c,ref:s,children:l})});return n.displayName=`${e}.Slot`,n}function lP(e){const t=p.forwardRef((n,r)=>{const{children:s,...l}=n;if(p.isValidElement(s)){const c=fP(s),d=dP(l,s.props);return s.type!==p.Fragment&&(d.ref=r?Ir(r,c):c),p.cloneElement(s,d)}return p.Children.count(s)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var cP=Symbol("radix.slottable");function uP(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===cP}function dP(e,t){const n={...t};for(const r in t){const s=e[r],l=t[r];/^on[A-Z]/.test(r)?s&&l?n[r]=(...d)=>{const f=l(...d);return s(...d),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...l}:r==="className"&&(n[r]=[s,l].filter(Boolean).join(" "))}return{...e,...n}}function fP(e){var r,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var hP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Je=hP.reduce((e,t)=>{const n=iP(`Primitive.${t}`),r=p.forwardRef((s,l)=>{const{asChild:c,...d}=s,f=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(f,{...d,ref:l})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function N_(e,t){e&&ds.flushSync(()=>e.dispatchEvent(t))}function ms(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function mP(e,t=globalThis==null?void 0:globalThis.document){const n=ms(e);p.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var pP="DismissableLayer",g0="dismissableLayer.update",gP="dismissableLayer.pointerDownOutside",yP="dismissableLayer.focusOutside",pR,A_=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Hl=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:l,onInteractOutside:c,onDismiss:d,...f}=e,h=p.useContext(A_),[g,y]=p.useState(null),v=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=p.useState({}),w=ut(t,j=>y(j)),E=Array.from(h.layers),[S]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),R=E.indexOf(S),T=g?E.indexOf(g):-1,_=h.layersWithOutsidePointerEventsDisabled.size>0,D=T>=R,A=bP(j=>{const M=j.target,F=[...h.branches].some(G=>G.contains(M));!D||F||(s==null||s(j),c==null||c(j),j.defaultPrevented||d==null||d())},v),O=SP(j=>{const M=j.target;[...h.branches].some(G=>G.contains(M))||(l==null||l(j),c==null||c(j),j.defaultPrevented||d==null||d())},v);return mP(j=>{T===h.layers.size-1&&(r==null||r(j),!j.defaultPrevented&&d&&(j.preventDefault(),d()))},v),p.useEffect(()=>{if(g)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(pR=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(g)),h.layers.add(g),gR(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=pR)}},[g,v,n,h]),p.useEffect(()=>()=>{g&&(h.layers.delete(g),h.layersWithOutsidePointerEventsDisabled.delete(g),gR())},[g,h]),p.useEffect(()=>{const j=()=>b({});return document.addEventListener(g0,j),()=>document.removeEventListener(g0,j)},[]),o.jsx(Je.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)})});Hl.displayName=pP;var vP="DismissableLayerBranch",xP=p.forwardRef((e,t)=>{const n=p.useContext(A_),r=p.useRef(null),s=ut(t,r);return p.useEffect(()=>{const l=r.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),o.jsx(Je.div,{...e,ref:s})});xP.displayName=vP;function bP(e,t=globalThis==null?void 0:globalThis.document){const n=ms(e),r=p.useRef(!1),s=p.useRef(()=>{});return p.useEffect(()=>{const l=d=>{if(d.target&&!r.current){let f=function(){D_(gP,n,h,{discrete:!0})};const h={originalEvent:d};d.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=f,t.addEventListener("click",s.current,{once:!0})):f()}else t.removeEventListener("click",s.current);r.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",l),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function SP(e,t=globalThis==null?void 0:globalThis.document){const n=ms(e),r=p.useRef(!1);return p.useEffect(()=>{const s=l=>{l.target&&!r.current&&D_(yP,n,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function gR(){const e=new CustomEvent(g0);document.dispatchEvent(e)}function D_(e,t,n,{discrete:r}){const s=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?N_(s,l):s.dispatchEvent(l)}var vx="focusScope.autoFocusOnMount",xx="focusScope.autoFocusOnUnmount",yR={bubbles:!1,cancelable:!0},CP="FocusScope",jf=p.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:l,...c}=e,[d,f]=p.useState(null),h=ms(s),g=ms(l),y=p.useRef(null),v=ut(t,E=>f(E)),b=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let E=function(_){if(b.paused||!d)return;const D=_.target;d.contains(D)?y.current=D:hi(y.current,{select:!0})},S=function(_){if(b.paused||!d)return;const D=_.relatedTarget;D!==null&&(d.contains(D)||hi(y.current,{select:!0}))},R=function(_){if(document.activeElement===document.body)for(const A of _)A.removedNodes.length>0&&hi(d)};document.addEventListener("focusin",E),document.addEventListener("focusout",S);const T=new MutationObserver(R);return d&&T.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",E),document.removeEventListener("focusout",S),T.disconnect()}}},[r,d,b.paused]),p.useEffect(()=>{if(d){xR.add(b);const E=document.activeElement;if(!d.contains(E)){const R=new CustomEvent(vx,yR);d.addEventListener(vx,h),d.dispatchEvent(R),R.defaultPrevented||(EP(_P(O_(d)),{select:!0}),document.activeElement===E&&hi(d))}return()=>{d.removeEventListener(vx,h),setTimeout(()=>{const R=new CustomEvent(xx,yR);d.addEventListener(xx,g),d.dispatchEvent(R),R.defaultPrevented||hi(E??document.body,{select:!0}),d.removeEventListener(xx,g),xR.remove(b)},0)}}},[d,h,g,b]);const w=p.useCallback(E=>{if(!n&&!r||b.paused)return;const S=E.key==="Tab"&&!E.altKey&&!E.ctrlKey&&!E.metaKey,R=document.activeElement;if(S&&R){const T=E.currentTarget,[_,D]=wP(T);_&&D?!E.shiftKey&&R===D?(E.preventDefault(),n&&hi(_,{select:!0})):E.shiftKey&&R===_&&(E.preventDefault(),n&&hi(D,{select:!0})):R===T&&E.preventDefault()}},[n,r,b.paused]);return o.jsx(Je.div,{tabIndex:-1,...c,ref:v,onKeyDown:w})});jf.displayName=CP;function EP(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(hi(r,{select:t}),document.activeElement!==n)return}function wP(e){const t=O_(e),n=vR(t,e),r=vR(t.reverse(),e);return[n,r]}function O_(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function vR(e,t){for(const n of e)if(!RP(n,{upTo:t}))return n}function RP(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 TP(e){return e instanceof HTMLInputElement&&"select"in e}function hi(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&TP(e)&&t&&e.select()}}var xR=jP();function jP(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=bR(e,t),e.unshift(t)},remove(t){var n;e=bR(e,t),(n=e[0])==null||n.resume()}}}function bR(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function _P(e){return e.filter(t=>t.tagName!=="A")}var NP="Portal",Bl=p.forwardRef((e,t)=>{var d;const{container:n,...r}=e,[s,l]=p.useState(!1);Cr(()=>l(!0),[]);const c=n||s&&((d=globalThis==null?void 0:globalThis.document)==null?void 0:d.body);return c?Y8.createPortal(o.jsx(Je.div,{...r,ref:t}),c):null});Bl.displayName=NP;function AP(e,t){return p.useReducer((n,r)=>t[n][r]??n,e)}var Er=e=>{const{present:t,children:n}=e,r=DP(t),s=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),l=ut(r.ref,OP(s));return typeof n=="function"||r.isPresent?p.cloneElement(s,{ref:l}):null};Er.displayName="Presence";function DP(e){const[t,n]=p.useState(),r=p.useRef(null),s=p.useRef(e),l=p.useRef("none"),c=e?"mounted":"unmounted",[d,f]=AP(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const h=vm(r.current);l.current=d==="mounted"?h:"none"},[d]),Cr(()=>{const h=r.current,g=s.current;if(g!==e){const v=l.current,b=vm(h);e?f("MOUNT"):b==="none"||(h==null?void 0:h.display)==="none"?f("UNMOUNT"):f(g&&v!==b?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,f]),Cr(()=>{if(t){let h;const g=t.ownerDocument.defaultView??window,y=b=>{const E=vm(r.current).includes(CSS.escape(b.animationName));if(b.target===t&&E&&(f("ANIMATION_END"),!s.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",h=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},v=b=>{b.target===t&&(l.current=vm(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:p.useCallback(h=>{r.current=h?getComputedStyle(h):null,n(h)},[])}}function vm(e){return(e==null?void 0:e.animationName)||"none"}function OP(e){var r,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var bx=0;function Xp(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??SR()),document.body.insertAdjacentElement("beforeend",e[1]??SR()),bx++,()=>{bx===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),bx--}},[])}function SR(){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 Os=function(){return Os=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},Os.apply(this,arguments)};function M_(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 s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function MP(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,l;r<s;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 Hm="right-scroll-bar-position",Bm="width-before-scroll-bar",IP="with-scroll-bars-hidden",kP="--removed-body-scroll-bar-size";function Sx(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function LP(e,t){var n=p.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var PP=typeof window<"u"?p.useLayoutEffect:p.useEffect,CR=new WeakMap;function UP(e,t){var n=LP(null,function(r){return e.forEach(function(s){return Sx(s,r)})});return PP(function(){var r=CR.get(n);if(r){var s=new Set(r),l=new Set(e),c=n.current;s.forEach(function(d){l.has(d)||Sx(d,null)}),l.forEach(function(d){s.has(d)||Sx(d,c)})}CR.set(n,e)},[e]),n}function FP(e){return e}function zP(e,t){t===void 0&&(t=FP);var n=[],r=!1,s={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 s}function VP(e){e===void 0&&(e={});var t=zP(null);return t.options=Os({async:!0,ssr:!1},e),t}var I_=function(e){var t=e.sideCar,n=M_(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 p.createElement(r,Os({},n))};I_.isSideCarExport=!0;function $P(e,t){return e.useMedium(t),I_}var k_=VP(),Cx=function(){},Jp=p.forwardRef(function(e,t){var n=p.useRef(null),r=p.useState({onScrollCapture:Cx,onWheelCapture:Cx,onTouchMoveCapture:Cx}),s=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,E=e.inert,S=e.allowPinchZoom,R=e.as,T=R===void 0?"div":R,_=e.gapMode,D=M_(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=v,O=UP([n,t]),j=Os(Os({},D),s);return p.createElement(p.Fragment,null,g&&p.createElement(A,{sideCar:k_,removeScrollBar:h,shards:y,noRelative:b,noIsolation:w,inert:E,setCallbacks:l,allowPinchZoom:!!S,lockRef:n,gapMode:_}),c?p.cloneElement(p.Children.only(d),Os(Os({},j),{ref:O})):p.createElement(T,Os({},j,{className:f,ref:O}),d))});Jp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Jp.classNames={fullWidth:Bm,zeroRight:Hm};var HP=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function BP(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=HP();return t&&e.setAttribute("nonce",t),e}function GP(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function qP(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var ZP=function(){var e=0,t=null;return{add:function(n){e==0&&(t=BP())&&(GP(t,n),qP(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},KP=function(){var e=ZP();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},L_=function(){var e=KP(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},YP={left:0,top:0,right:0,gap:0},Ex=function(e){return parseInt(e||"",10)||0},WP=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[Ex(n),Ex(r),Ex(s)]},QP=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return YP;var t=WP(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])}},XP=L_(),Jc="data-scroll-locked",JP=function(e,t,n,r){var s=e.left,l=e.top,c=e.right,d=e.gap;return n===void 0&&(n="margin"),`
|
|
442
|
-
.`.concat(IP,` {
|
|
443
|
-
overflow: hidden `).concat(r,`;
|
|
444
|
-
padding-right: `).concat(d,"px ").concat(r,`;
|
|
445
|
-
}
|
|
446
|
-
body[`).concat(Jc,`] {
|
|
447
|
-
overflow: hidden `).concat(r,`;
|
|
448
|
-
overscroll-behavior: contain;
|
|
449
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
450
|
-
padding-left: `.concat(s,`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(Hm,` {
|
|
460
|
-
right: `).concat(d,"px ").concat(r,`;
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
.`).concat(Bm,` {
|
|
464
|
-
margin-right: `).concat(d,"px ").concat(r,`;
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
.`).concat(Hm," .").concat(Hm,` {
|
|
468
|
-
right: 0 `).concat(r,`;
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
.`).concat(Bm," .").concat(Bm,` {
|
|
472
|
-
margin-right: 0 `).concat(r,`;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
body[`).concat(Jc,`] {
|
|
476
|
-
`).concat(kP,": ").concat(d,`px;
|
|
477
|
-
}
|
|
478
|
-
`)},ER=function(){var e=parseInt(document.body.getAttribute(Jc)||"0",10);return isFinite(e)?e:0},eU=function(){p.useEffect(function(){return document.body.setAttribute(Jc,(ER()+1).toString()),function(){var e=ER()-1;e<=0?document.body.removeAttribute(Jc):document.body.setAttribute(Jc,e.toString())}},[])},tU=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;eU();var l=p.useMemo(function(){return QP(s)},[s]);return p.createElement(XP,{styles:JP(l,!t,s,n?"":"!important")})},y0=!1;if(typeof window<"u")try{var xm=Object.defineProperty({},"passive",{get:function(){return y0=!0,!0}});window.addEventListener("test",xm,xm),window.removeEventListener("test",xm,xm)}catch{y0=!1}var Ic=y0?{passive:!1}:!1,nU=function(e){return e.tagName==="TEXTAREA"},P_=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!nU(e)&&n[t]==="visible")},rU=function(e){return P_(e,"overflowY")},aU=function(e){return P_(e,"overflowX")},wR=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=U_(e,r);if(s){var l=F_(e,r),c=l[1],d=l[2];if(c>d)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},sU=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},oU=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},U_=function(e,t){return e==="v"?rU(t):aU(t)},F_=function(e,t){return e==="v"?sU(t):oU(t)},iU=function(e,t){return e==="h"&&t==="rtl"?-1:1},lU=function(e,t,n,r,s){var l=iU(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=F_(e,d),w=b[0],E=b[1],S=b[2],R=E-S-l*w;(w||R)&&U_(e,d)&&(y+=R,v+=w);var T=d.parentNode;d=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}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},bm=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},RR=function(e){return[e.deltaX,e.deltaY]},TR=function(e){return e&&"current"in e?e.current:e},cU=function(e,t){return e[0]===t[0]&&e[1]===t[1]},uU=function(e){return`
|
|
479
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
480
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
481
|
-
`)},dU=0,kc=[];function fU(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),s=p.useState(dU++)[0],l=p.useState(L_)[0],c=p.useRef(e);p.useEffect(function(){c.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var E=MP([e.lockRef.current],(e.shards||[]).map(TR),!0).filter(Boolean);return E.forEach(function(S){return S.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),E.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var d=p.useCallback(function(E,S){if("touches"in E&&E.touches.length===2||E.type==="wheel"&&E.ctrlKey)return!c.current.allowPinchZoom;var R=bm(E),T=n.current,_="deltaX"in E?E.deltaX:T[0]-R[0],D="deltaY"in E?E.deltaY:T[1]-R[1],A,O=E.target,j=Math.abs(_)>Math.abs(D)?"h":"v";if("touches"in E&&j==="h"&&O.type==="range")return!1;var M=wR(j,O);if(!M)return!0;if(M?A=j:(A=j==="v"?"h":"v",M=wR(j,O)),!M)return!1;if(!r.current&&"changedTouches"in E&&(_||D)&&(r.current=A),!A)return!0;var F=r.current||A;return lU(F,S,E,F==="h"?_:D)},[]),f=p.useCallback(function(E){var S=E;if(!(!kc.length||kc[kc.length-1]!==l)){var R="deltaY"in S?RR(S):bm(S),T=t.current.filter(function(A){return A.name===S.type&&(A.target===S.target||S.target===A.shadowParent)&&cU(A.delta,R)})[0];if(T&&T.should){S.cancelable&&S.preventDefault();return}if(!T){var _=(c.current.shards||[]).map(TR).filter(Boolean).filter(function(A){return A.contains(S.target)}),D=_.length>0?d(S,_[0]):!c.current.noIsolation;D&&S.cancelable&&S.preventDefault()}}},[]),h=p.useCallback(function(E,S,R,T){var _={name:E,delta:S,target:R,should:T,shadowParent:hU(R)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(D){return D!==_})},1)},[]),g=p.useCallback(function(E){n.current=bm(E),r.current=void 0},[]),y=p.useCallback(function(E){h(E.type,RR(E),E.target,d(E,e.lockRef.current))},[]),v=p.useCallback(function(E){h(E.type,bm(E),E.target,d(E,e.lockRef.current))},[]);p.useEffect(function(){return kc.push(l),e.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:v}),document.addEventListener("wheel",f,Ic),document.addEventListener("touchmove",f,Ic),document.addEventListener("touchstart",g,Ic),function(){kc=kc.filter(function(E){return E!==l}),document.removeEventListener("wheel",f,Ic),document.removeEventListener("touchmove",f,Ic),document.removeEventListener("touchstart",g,Ic)}},[]);var b=e.removeScrollBar,w=e.inert;return p.createElement(p.Fragment,null,w?p.createElement(l,{styles:uU(s)}):null,b?p.createElement(tU,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function hU(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const mU=$P(k_,fU);var _f=p.forwardRef(function(e,t){return p.createElement(Jp,Os({},e,{ref:t,sideCar:mU}))});_f.classNames=Jp.classNames;var pU=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Lc=new WeakMap,Sm=new WeakMap,Cm={},wx=0,z_=function(e){return e&&(e.host||z_(e.parentNode))},gU=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=z_(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})},yU=function(e,t,n,r){var s=gU(t,Array.isArray(e)?e:[e]);Cm[n]||(Cm[n]=new WeakMap);var l=Cm[n],c=[],d=new Set,f=new Set(s),h=function(y){!y||d.has(y)||(d.add(y),h(y.parentNode))};s.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",E=(Lc.get(v)||0)+1,S=(l.get(v)||0)+1;Lc.set(v,E),l.set(v,S),c.push(v),E===1&&w&&Sm.set(v,!0),S===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(),wx++,function(){c.forEach(function(y){var v=Lc.get(y)-1,b=l.get(y)-1;Lc.set(y,v),l.set(y,b),v||(Sm.has(y)||y.removeAttribute(r),Sm.delete(y)),b||y.removeAttribute(n)}),wx--,wx||(Lc=new WeakMap,Lc=new WeakMap,Sm=new WeakMap,Cm={})}},eg=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=pU(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),yU(r,s,n,"aria-hidden")):function(){return null}};function vU(e){const t=xU(e),n=p.forwardRef((r,s)=>{const{children:l,...c}=r,d=p.Children.toArray(l),f=d.find(SU);if(f){const h=f.props.children,g=d.map(y=>y===f?p.Children.count(h)>1?p.Children.only(null):p.isValidElement(h)?h.props.children:null:y);return o.jsx(t,{...c,ref:s,children:p.isValidElement(h)?p.cloneElement(h,void 0,g):null})}return o.jsx(t,{...c,ref:s,children:l})});return n.displayName=`${e}.Slot`,n}function xU(e){const t=p.forwardRef((n,r)=>{const{children:s,...l}=n;if(p.isValidElement(s)){const c=EU(s),d=CU(l,s.props);return s.type!==p.Fragment&&(d.ref=r?Ir(r,c):c),p.cloneElement(s,d)}return p.Children.count(s)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var bU=Symbol("radix.slottable");function SU(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===bU}function CU(e,t){const n={...t};for(const r in t){const s=e[r],l=t[r];/^on[A-Z]/.test(r)?s&&l?n[r]=(...d)=>{const f=l(...d);return s(...d),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...l}:r==="className"&&(n[r]=[s,l].filter(Boolean).join(" "))}return{...e,...n}}function EU(e){var r,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var tg="Dialog",[V_,$_]=ir(tg),[wU,xs]=V_(tg),H_=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:l,modal:c=!0}=e,d=p.useRef(null),f=p.useRef(null),[h,g]=Vr({prop:r,defaultProp:s??!1,onChange:l,caller:tg});return o.jsx(wU,{scope:t,triggerRef:d,contentRef:f,contentId:Nn(),titleId:Nn(),descriptionId:Nn(),open:h,onOpenChange:g,onOpenToggle:p.useCallback(()=>g(y=>!y),[g]),modal:c,children:n})};H_.displayName=tg;var B_="DialogTrigger",G_=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=xs(B_,n),l=ut(t,s.triggerRef);return o.jsx(Je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Ub(s.open),...r,ref:l,onClick:Te(e.onClick,s.onOpenToggle)})});G_.displayName=B_;var Lb="DialogPortal",[RU,q_]=V_(Lb,{forceMount:void 0}),Z_=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,l=xs(Lb,t);return o.jsx(RU,{scope:t,forceMount:n,children:p.Children.map(r,c=>o.jsx(Er,{present:n||l.open,children:o.jsx(Bl,{asChild:!0,container:s,children:c})}))})};Z_.displayName=Lb;var ip="DialogOverlay",K_=p.forwardRef((e,t)=>{const n=q_(ip,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,l=xs(ip,e.__scopeDialog);return l.modal?o.jsx(Er,{present:r||l.open,children:o.jsx(jU,{...s,ref:t})}):null});K_.displayName=ip;var TU=vU("DialogOverlay.RemoveScroll"),jU=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=xs(ip,n);return o.jsx(_f,{as:TU,allowPinchZoom:!0,shards:[s.contentRef],children:o.jsx(Je.div,{"data-state":Ub(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Nl="DialogContent",Y_=p.forwardRef((e,t)=>{const n=q_(Nl,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,l=xs(Nl,e.__scopeDialog);return o.jsx(Er,{present:r||l.open,children:l.modal?o.jsx(_U,{...s,ref:t}):o.jsx(NU,{...s,ref:t})})});Y_.displayName=Nl;var _U=p.forwardRef((e,t)=>{const n=xs(Nl,e.__scopeDialog),r=p.useRef(null),s=ut(t,n.contentRef,r);return p.useEffect(()=>{const l=r.current;if(l)return eg(l)},[]),o.jsx(W_,{...e,ref:s,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())})}),NU=p.forwardRef((e,t)=>{const n=xs(Nl,e.__scopeDialog),r=p.useRef(!1),s=p.useRef(!1);return o.jsx(W_,{...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,s.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"&&(s.current=!0));const c=l.target;((h=n.triggerRef.current)==null?void 0:h.contains(c))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&s.current&&l.preventDefault()}})}),W_=p.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:l,...c}=e,d=xs(Nl,n),f=p.useRef(null),h=ut(t,f);return Xp(),o.jsxs(o.Fragment,{children:[o.jsx(jf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:l,children:o.jsx(Hl,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":Ub(d.open),...c,ref:h,onDismiss:()=>d.onOpenChange(!1)})}),o.jsxs(o.Fragment,{children:[o.jsx(DU,{titleId:d.titleId}),o.jsx(MU,{contentRef:f,descriptionId:d.descriptionId})]})]})}),Pb="DialogTitle",Q_=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=xs(Pb,n);return o.jsx(Je.h2,{id:s.titleId,...r,ref:t})});Q_.displayName=Pb;var X_="DialogDescription",J_=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=xs(X_,n);return o.jsx(Je.p,{id:s.descriptionId,...r,ref:t})});J_.displayName=X_;var eN="DialogClose",tN=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=xs(eN,n);return o.jsx(Je.button,{type:"button",...r,ref:t,onClick:Te(e.onClick,()=>s.onOpenChange(!1))})});tN.displayName=eN;function Ub(e){return e?"open":"closed"}var nN="DialogTitleWarning",[AU,rN]=eP(nN,{contentName:Nl,titleName:Pb,docsSlug:"dialog"}),DU=({titleId:e})=>{const t=rN(nN),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 p.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},OU="DialogDescriptionWarning",MU=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${rN(OU).contentName}}.`;return p.useEffect(()=>{var l;const s=(l=e.current)==null?void 0:l.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},ng=H_,IU=G_,rg=Z_,ag=K_,sg=Y_,Fb=Q_,zb=J_,og=tN;function Li({...e}){return o.jsx(ng,{"data-slot":"sheet",...e})}function kU({...e}){return o.jsx(rg,{"data-slot":"sheet-portal",...e})}function LU({className:e,...t}){return o.jsx(ag,{"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 Pi({className:e,children:t,side:n="right",...r}){return o.jsxs(kU,{children:[o.jsx(LU,{}),o.jsxs(sg,{"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,o.jsxs(og,{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:[o.jsx(cu,{className:"size-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Ui({className:e,...t}){return o.jsx("div",{"data-slot":"sheet-header",className:ne("flex flex-col gap-1 border-b p-4",e),...t})}function Fi({className:e,...t}){return o.jsx(Fb,{"data-slot":"sheet-title",className:ne("text-foreground font-semibold",e),...t})}function Gl({className:e,...t}){return o.jsx(zb,{"data-slot":"sheet-description",className:ne("text-muted-foreground text-sm",e),...t})}function is({className:e,...t}){return o.jsx("div",{"data-slot":"skeleton",className:ne("bg-accent animate-pulse rounded-md",e),...t})}const PU=["top","right","bottom","left"],Ni=Math.min,pa=Math.max,lp=Math.round,Em=Math.floor,Ps=e=>({x:e,y:e}),UU={left:"right",right:"left",bottom:"top",top:"bottom"},FU={start:"end",end:"start"};function v0(e,t,n){return pa(e,Ni(t,n))}function Oo(e,t){return typeof e=="function"?e(t):e}function Mo(e){return e.split("-")[0]}function Cu(e){return e.split("-")[1]}function Vb(e){return e==="x"?"y":"x"}function $b(e){return e==="y"?"height":"width"}const zU=new Set(["top","bottom"]);function Ms(e){return zU.has(Mo(e))?"y":"x"}function Hb(e){return Vb(Ms(e))}function VU(e,t,n){n===void 0&&(n=!1);const r=Cu(e),s=Hb(e),l=$b(s);let c=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(c=cp(c)),[c,cp(c)]}function $U(e){const t=cp(e);return[x0(e),t,x0(t)]}function x0(e){return e.replace(/start|end/g,t=>FU[t])}const jR=["left","right"],_R=["right","left"],HU=["top","bottom"],BU=["bottom","top"];function GU(e,t,n){switch(e){case"top":case"bottom":return n?t?_R:jR:t?jR:_R;case"left":case"right":return t?HU:BU;default:return[]}}function qU(e,t,n,r){const s=Cu(e);let l=GU(Mo(e),n==="start",r);return s&&(l=l.map(c=>c+"-"+s),t&&(l=l.concat(l.map(x0)))),l}function cp(e){return e.replace(/left|right|bottom|top/g,t=>UU[t])}function ZU(e){return{top:0,right:0,bottom:0,left:0,...e}}function aN(e){return typeof e!="number"?ZU(e):{top:e,right:e,bottom:e,left:e}}function up(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function NR(e,t,n){let{reference:r,floating:s}=e;const l=Ms(t),c=Hb(t),d=$b(c),f=Mo(t),h=l==="y",g=r.x+r.width/2-s.width/2,y=r.y+r.height/2-s.height/2,v=r[d]/2-s[d]/2;let b;switch(f){case"top":b={x:g,y:r.y-s.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-s.width,y};break;default:b={x:r.x,y:r.y}}switch(Cu(t)){case"start":b[c]-=v*(n&&h?-1:1);break;case"end":b[c]+=v*(n&&h?-1:1);break}return b}const KU=async(e,t,n)=>{const{placement:r="bottom",strategy:s="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:s}),{x:g,y}=NR(h,r,f),v=r,b={},w=0;for(let E=0;E<d.length;E++){const{name:S,fn:R}=d[E],{x:T,y:_,data:D,reset:A}=await R({x:g,y,initialPlacement:r,placement:v,strategy:s,middlewareData:b,rects:h,platform:c,elements:{reference:e,floating:t}});g=T??g,y=_??y,b={...b,[S]:{...b[S],...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:s}):A.rects),{x:g,y}=NR(h,v,f)),E=-1)}return{x:g,y,placement:v,strategy:s,middlewareData:b}};async function lf(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:l,rects:c,elements:d,strategy:f}=e,{boundary:h="clippingAncestors",rootBoundary:g="viewport",elementContext:y="floating",altBoundary:v=!1,padding:b=0}=Oo(t,e),w=aN(b),S=d[v?y==="floating"?"reference":"floating":y],R=up(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(S)))==null||n?S:S.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(d.floating)),boundary:h,rootBoundary:g,strategy:f})),T=y==="floating"?{x:r,y:s,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=up(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:T,offsetParent:_,strategy:f}):T);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 YU=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:l,platform:c,elements:d,middlewareData:f}=t,{element:h,padding:g=0}=Oo(e,t)||{};if(h==null)return{};const y=aN(g),v={x:n,y:r},b=Hb(s),w=$b(b),E=await c.getDimensions(h),S=b==="y",R=S?"top":"left",T=S?"bottom":"right",_=S?"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 j=O?O[_]:0;(!j||!await(c.isElement==null?void 0:c.isElement(O)))&&(j=d.floating[_]||l.floating[w]);const M=D/2-A/2,F=j/2-E[w]/2-1,G=Ni(y[R],F),Y=Ni(y[T],F),Z=G,ee=j-E[w]-Y,$=j/2-E[w]/2+M,W=v0(Z,$,ee),k=!f.arrow&&Cu(s)!=null&&$!==W&&l.reference[w]/2-($<Z?G:Y)-E[w]/2<0,H=k?$<Z?$-Z:$-ee:0;return{[b]:v[b]+H,data:{[b]:W,centerOffset:$-W-H,...k&&{alignmentOffset:H}},reset:k}}}),WU=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,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:E=!0,...S}=Oo(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const R=Mo(s),T=Ms(d),_=Mo(d)===d,D=await(f.isRTL==null?void 0:f.isRTL(h.floating)),A=v||(_||!E?[cp(d)]:$U(d)),O=w!=="none";!v&&O&&A.push(...qU(d,E,w,D));const j=[d,...A],M=await lf(t,S),F=[];let G=((r=l.flip)==null?void 0:r.overflows)||[];if(g&&F.push(M[R]),y){const $=VU(s,c,D);F.push(M[$[0]],M[$[1]])}if(G=[...G,{placement:s,overflows:F}],!F.every($=>$<=0)){var Y,Z;const $=(((Y=l.flip)==null?void 0:Y.index)||0)+1,W=j[$];if(W&&(!(y==="alignment"?T!==Ms(W):!1)||G.every(B=>Ms(B.placement)===T?B.overflows[0]>0:!0)))return{data:{index:$,overflows:G},reset:{placement:W}};let k=(Z=G.filter(H=>H.overflows[0]<=0).sort((H,B)=>H.overflows[1]-B.overflows[1])[0])==null?void 0:Z.placement;if(!k)switch(b){case"bestFit":{var ee;const H=(ee=G.filter(B=>{if(O){const ie=Ms(B.placement);return ie===T||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:ee[0];H&&(k=H);break}case"initialPlacement":k=d;break}if(s!==k)return{reset:{placement:k}}}return{}}}};function AR(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function DR(e){return PU.some(t=>e[t]>=0)}const QU=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=Oo(e,t);switch(r){case"referenceHidden":{const l=await lf(t,{...s,elementContext:"reference"}),c=AR(l,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:DR(c)}}}case"escaped":{const l=await lf(t,{...s,altBoundary:!0}),c=AR(l,n.floating);return{data:{escapedOffsets:c,escaped:DR(c)}}}default:return{}}}}},sN=new Set(["left","top"]);async function XU(e,t){const{placement:n,platform:r,elements:s}=e,l=await(r.isRTL==null?void 0:r.isRTL(s.floating)),c=Mo(n),d=Cu(n),f=Ms(n)==="y",h=sN.has(c)?-1:1,g=l&&f?-1:1,y=Oo(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 JU=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:l,placement:c,middlewareData:d}=t,f=await XU(t,e);return c===((n=d.offset)==null?void 0:n.placement)&&(r=d.arrow)!=null&&r.alignmentOffset?{}:{x:s+f.x,y:l+f.y,data:{...f,placement:c}}}}},eF=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:l=!0,crossAxis:c=!1,limiter:d={fn:S=>{let{x:R,y:T}=S;return{x:R,y:T}}},...f}=Oo(e,t),h={x:n,y:r},g=await lf(t,f),y=Ms(Mo(s)),v=Vb(y);let b=h[v],w=h[y];if(l){const S=v==="y"?"top":"left",R=v==="y"?"bottom":"right",T=b+g[S],_=b-g[R];b=v0(T,b,_)}if(c){const S=y==="y"?"top":"left",R=y==="y"?"bottom":"right",T=w+g[S],_=w-g[R];w=v0(T,w,_)}const E=d.fn({...t,[v]:b,[y]:w});return{...E,data:{x:E.x-n,y:E.y-r,enabled:{[v]:l,[y]:c}}}}}},tF=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:l,middlewareData:c}=t,{offset:d=0,mainAxis:f=!0,crossAxis:h=!0}=Oo(e,t),g={x:n,y:r},y=Ms(s),v=Vb(y);let b=g[v],w=g[y];const E=Oo(d,t),S=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:0,crossAxis:0,...E};if(f){const _=v==="y"?"height":"width",D=l.reference[v]-l.floating[_]+S.mainAxis,A=l.reference[v]+l.reference[_]-S.mainAxis;b<D?b=D:b>A&&(b=A)}if(h){var R,T;const _=v==="y"?"width":"height",D=sN.has(Mo(s)),A=l.reference[y]-l.floating[_]+(D&&((R=c.offset)==null?void 0:R[y])||0)+(D?0:S.crossAxis),O=l.reference[y]+l.reference[_]+(D?0:((T=c.offset)==null?void 0:T[y])||0)-(D?S.crossAxis:0);w<A?w=A:w>O&&(w=O)}return{[v]:b,[y]:w}}}},nF=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:l,platform:c,elements:d}=t,{apply:f=()=>{},...h}=Oo(e,t),g=await lf(t,h),y=Mo(s),v=Cu(s),b=Ms(s)==="y",{width:w,height:E}=l.floating;let S,R;y==="top"||y==="bottom"?(S=y,R=v===(await(c.isRTL==null?void 0:c.isRTL(d.floating))?"start":"end")?"left":"right"):(R=y,S=v==="end"?"top":"bottom");const T=E-g.top-g.bottom,_=w-g.left-g.right,D=Ni(E-g[S],T),A=Ni(w-g[R],_),O=!t.middlewareData.shift;let j=D,M=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(j=T),O&&!v){const G=pa(g.left,0),Y=pa(g.right,0),Z=pa(g.top,0),ee=pa(g.bottom,0);b?M=w-2*(G!==0||Y!==0?G+Y:pa(g.left,g.right)):j=E-2*(Z!==0||ee!==0?Z+ee:pa(g.top,g.bottom))}await f({...t,availableWidth:M,availableHeight:j});const F=await c.getDimensions(d.floating);return w!==F.width||E!==F.height?{reset:{rects:!0}}:{}}}};function ig(){return typeof window<"u"}function Eu(e){return oN(e)?(e.nodeName||"").toLowerCase():"#document"}function va(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function qs(e){var t;return(t=(oN(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function oN(e){return ig()?e instanceof Node||e instanceof va(e).Node:!1}function ps(e){return ig()?e instanceof Element||e instanceof va(e).Element:!1}function Vs(e){return ig()?e instanceof HTMLElement||e instanceof va(e).HTMLElement:!1}function OR(e){return!ig()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof va(e).ShadowRoot}const rF=new Set(["inline","contents"]);function Nf(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=gs(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!rF.has(s)}const aF=new Set(["table","td","th"]);function sF(e){return aF.has(Eu(e))}const oF=[":popover-open",":modal"];function lg(e){return oF.some(t=>{try{return e.matches(t)}catch{return!1}})}const iF=["transform","translate","scale","rotate","perspective"],lF=["transform","translate","scale","rotate","perspective","filter"],cF=["paint","layout","strict","content"];function Bb(e){const t=Gb(),n=ps(e)?gs(e):e;return iF.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)||lF.some(r=>(n.willChange||"").includes(r))||cF.some(r=>(n.contain||"").includes(r))}function uF(e){let t=Ai(e);for(;Vs(t)&&!uu(t);){if(Bb(t))return t;if(lg(t))return null;t=Ai(t)}return null}function Gb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const dF=new Set(["html","body","#document"]);function uu(e){return dF.has(Eu(e))}function gs(e){return va(e).getComputedStyle(e)}function cg(e){return ps(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ai(e){if(Eu(e)==="html")return e;const t=e.assignedSlot||e.parentNode||OR(e)&&e.host||qs(e);return OR(t)?t.host:t}function iN(e){const t=Ai(e);return uu(t)?e.ownerDocument?e.ownerDocument.body:e.body:Vs(t)&&Nf(t)?t:iN(t)}function cf(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=iN(e),l=s===((r=e.ownerDocument)==null?void 0:r.body),c=va(s);if(l){const d=b0(c);return t.concat(c,c.visualViewport||[],Nf(s)?s:[],d&&n?cf(d):[])}return t.concat(s,cf(s,[],n))}function b0(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function lN(e){const t=gs(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Vs(e),l=s?e.offsetWidth:n,c=s?e.offsetHeight:r,d=lp(n)!==l||lp(r)!==c;return d&&(n=l,r=c),{width:n,height:r,$:d}}function qb(e){return ps(e)?e:e.contextElement}function eu(e){const t=qb(e);if(!Vs(t))return Ps(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:l}=lN(t);let c=(l?lp(n.width):n.width)/r,d=(l?lp(n.height):n.height)/s;return(!c||!Number.isFinite(c))&&(c=1),(!d||!Number.isFinite(d))&&(d=1),{x:c,y:d}}const fF=Ps(0);function cN(e){const t=va(e);return!Gb()||!t.visualViewport?fF:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function hF(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==va(e)?!1:t}function Al(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),l=qb(e);let c=Ps(1);t&&(r?ps(r)&&(c=eu(r)):c=eu(e));const d=hF(l,n,r)?cN(l):Ps(0);let f=(s.left+d.x)/c.x,h=(s.top+d.y)/c.y,g=s.width/c.x,y=s.height/c.y;if(l){const v=va(l),b=r&&ps(r)?va(r):r;let w=v,E=b0(w);for(;E&&r&&b!==w;){const S=eu(E),R=E.getBoundingClientRect(),T=gs(E),_=R.left+(E.clientLeft+parseFloat(T.paddingLeft))*S.x,D=R.top+(E.clientTop+parseFloat(T.paddingTop))*S.y;f*=S.x,h*=S.y,g*=S.x,y*=S.y,f+=_,h+=D,w=va(E),E=b0(w)}}return up({width:g,height:y,x:f,y:h})}function ug(e,t){const n=cg(e).scrollLeft;return t?t.left+n:Al(qs(e)).left+n}function uN(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ug(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function mF(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const l=s==="fixed",c=qs(r),d=t?lg(t.floating):!1;if(r===c||d&&l)return n;let f={scrollLeft:0,scrollTop:0},h=Ps(1);const g=Ps(0),y=Vs(r);if((y||!y&&!l)&&((Eu(r)!=="body"||Nf(c))&&(f=cg(r)),Vs(r))){const b=Al(r);h=eu(r),g.x=b.x+r.clientLeft,g.y=b.y+r.clientTop}const v=c&&!y&&!l?uN(c,f):Ps(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 pF(e){return Array.from(e.getClientRects())}function gF(e){const t=qs(e),n=cg(e),r=e.ownerDocument.body,s=pa(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),l=pa(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+ug(e);const d=-n.scrollTop;return gs(r).direction==="rtl"&&(c+=pa(t.clientWidth,r.clientWidth)-s),{width:s,height:l,x:c,y:d}}const MR=25;function yF(e,t){const n=va(e),r=qs(e),s=n.visualViewport;let l=r.clientWidth,c=r.clientHeight,d=0,f=0;if(s){l=s.width,c=s.height;const g=Gb();(!g||g&&t==="fixed")&&(d=s.offsetLeft,f=s.offsetTop)}const h=ug(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<=MR&&(l-=w)}else h<=MR&&(l+=h);return{width:l,height:c,x:d,y:f}}const vF=new Set(["absolute","fixed"]);function xF(e,t){const n=Al(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,l=Vs(e)?eu(e):Ps(1),c=e.clientWidth*l.x,d=e.clientHeight*l.y,f=s*l.x,h=r*l.y;return{width:c,height:d,x:f,y:h}}function IR(e,t,n){let r;if(t==="viewport")r=yF(e,n);else if(t==="document")r=gF(qs(e));else if(ps(t))r=xF(t,n);else{const s=cN(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return up(r)}function dN(e,t){const n=Ai(e);return n===t||!ps(n)||uu(n)?!1:gs(n).position==="fixed"||dN(n,t)}function bF(e,t){const n=t.get(e);if(n)return n;let r=cf(e,[],!1).filter(d=>ps(d)&&Eu(d)!=="body"),s=null;const l=gs(e).position==="fixed";let c=l?Ai(e):e;for(;ps(c)&&!uu(c);){const d=gs(c),f=Bb(c);!f&&d.position==="fixed"&&(s=null),(l?!f&&!s:!f&&d.position==="static"&&!!s&&vF.has(s.position)||Nf(c)&&!f&&dN(e,c))?r=r.filter(g=>g!==c):s=d,c=Ai(c)}return t.set(e,r),r}function SF(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const c=[...n==="clippingAncestors"?lg(t)?[]:bF(t,this._c):[].concat(n),r],d=c[0],f=c.reduce((h,g)=>{const y=IR(t,g,s);return h.top=pa(y.top,h.top),h.right=Ni(y.right,h.right),h.bottom=Ni(y.bottom,h.bottom),h.left=pa(y.left,h.left),h},IR(t,d,s));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function CF(e){const{width:t,height:n}=lN(e);return{width:t,height:n}}function EF(e,t,n){const r=Vs(t),s=qs(t),l=n==="fixed",c=Al(e,!0,l,t);let d={scrollLeft:0,scrollTop:0};const f=Ps(0);function h(){f.x=ug(s)}if(r||!r&&!l)if((Eu(t)!=="body"||Nf(s))&&(d=cg(t)),r){const b=Al(t,!0,l,t);f.x=b.x+t.clientLeft,f.y=b.y+t.clientTop}else s&&h();l&&!r&&s&&h();const g=s&&!r&&!l?uN(s,d):Ps(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 Rx(e){return gs(e).position==="static"}function kR(e,t){if(!Vs(e)||gs(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return qs(e)===n&&(n=n.ownerDocument.body),n}function fN(e,t){const n=va(e);if(lg(e))return n;if(!Vs(e)){let s=Ai(e);for(;s&&!uu(s);){if(ps(s)&&!Rx(s))return s;s=Ai(s)}return n}let r=kR(e,t);for(;r&&sF(r)&&Rx(r);)r=kR(r,t);return r&&uu(r)&&Rx(r)&&!Bb(r)?n:r||uF(e)||n}const wF=async function(e){const t=this.getOffsetParent||fN,n=this.getDimensions,r=await n(e.floating);return{reference:EF(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function RF(e){return gs(e).direction==="rtl"}const TF={convertOffsetParentRelativeRectToViewportRelativeRect:mF,getDocumentElement:qs,getClippingRect:SF,getOffsetParent:fN,getElementRects:wF,getClientRects:pF,getDimensions:CF,getScale:eu,isElement:ps,isRTL:RF};function hN(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function jF(e,t){let n=null,r;const s=qs(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=Em(y),E=Em(s.clientWidth-(g+v)),S=Em(s.clientHeight-(y+b)),R=Em(g),_={rootMargin:-w+"px "+-E+"px "+-S+"px "+-R+"px",threshold:pa(0,Ni(1,f))||1};let D=!0;function A(O){const j=O[0].intersectionRatio;if(j!==f){if(!D)return c();j?c(!1,j):r=setTimeout(()=>{c(!1,1e-7)},1e3)}j===1&&!hN(h,e.getBoundingClientRect())&&c(),D=!1}try{n=new IntersectionObserver(A,{..._,root:s.ownerDocument})}catch{n=new IntersectionObserver(A,_)}n.observe(e)}return c(!0),l}function _F(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:l=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,h=qb(e),g=s||l?[...h?cf(h):[],...cf(t)]:[];g.forEach(R=>{s&&R.addEventListener("scroll",n,{passive:!0}),l&&R.addEventListener("resize",n)});const y=h&&d?jF(h,n):null;let v=-1,b=null;c&&(b=new ResizeObserver(R=>{let[T]=R;T&&T.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,E=f?Al(e):null;f&&S();function S(){const R=Al(e);E&&!hN(E,R)&&n(),E=R,w=requestAnimationFrame(S)}return n(),()=>{var R;g.forEach(T=>{s&&T.removeEventListener("scroll",n),l&&T.removeEventListener("resize",n)}),y==null||y(),(R=b)==null||R.disconnect(),b=null,f&&cancelAnimationFrame(w)}}const NF=JU,AF=eF,DF=WU,OF=nF,MF=QU,LR=YU,IF=tF,kF=(e,t,n)=>{const r=new Map,s={platform:TF,...n},l={...s.platform,_c:r};return KU(e,t,{...s,platform:l})};var LF=typeof document<"u",PF=function(){},Gm=LF?p.useLayoutEffect:PF;function dp(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,s;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(!dp(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const l=s[r];if(!(l==="_owner"&&e.$$typeof)&&!dp(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function mN(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function PR(e,t){const n=mN(e);return Math.round(t*n)/n}function Tx(e){const t=p.useRef(e);return Gm(()=>{t.current=e}),t}function UF(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:l,floating:c}={},transform:d=!0,whileElementsMounted:f,open:h}=e,[g,y]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,b]=p.useState(r);dp(v,r)||b(r);const[w,E]=p.useState(null),[S,R]=p.useState(null),T=p.useCallback(B=>{B!==O.current&&(O.current=B,E(B))},[]),_=p.useCallback(B=>{B!==j.current&&(j.current=B,R(B))},[]),D=l||w,A=c||S,O=p.useRef(null),j=p.useRef(null),M=p.useRef(g),F=f!=null,G=Tx(f),Y=Tx(s),Z=Tx(h),ee=p.useCallback(()=>{if(!O.current||!j.current)return;const B={placement:t,strategy:n,middleware:v};Y.current&&(B.platform=Y.current),kF(O.current,j.current,B).then(ie=>{const xe={...ie,isPositioned:Z.current!==!1};$.current&&!dp(M.current,xe)&&(M.current=xe,ds.flushSync(()=>{y(xe)}))})},[v,t,n,Y,Z]);Gm(()=>{h===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,y(B=>({...B,isPositioned:!1})))},[h]);const $=p.useRef(!1);Gm(()=>($.current=!0,()=>{$.current=!1}),[]),Gm(()=>{if(D&&(O.current=D),A&&(j.current=A),D&&A){if(G.current)return G.current(D,A,ee);ee()}},[D,A,ee,G,F]);const W=p.useMemo(()=>({reference:O,floating:j,setReference:T,setFloating:_}),[T,_]),k=p.useMemo(()=>({reference:D,floating:A}),[D,A]),H=p.useMemo(()=>{const B={position:n,left:0,top:0};if(!k.floating)return B;const ie=PR(k.floating,g.x),xe=PR(k.floating,g.y);return d?{...B,transform:"translate("+ie+"px, "+xe+"px)",...mN(k.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ie,top:xe}},[n,d,k.floating,g.x,g.y]);return p.useMemo(()=>({...g,update:ee,refs:W,elements:k,floatingStyles:H}),[g,ee,W,k,H])}const FF=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?LR({element:r.current,padding:s}).fn(n):{}:r?LR({element:r,padding:s}).fn(n):{}}}},zF=(e,t)=>({...NF(e),options:[e,t]}),VF=(e,t)=>({...AF(e),options:[e,t]}),$F=(e,t)=>({...IF(e),options:[e,t]}),HF=(e,t)=>({...DF(e),options:[e,t]}),BF=(e,t)=>({...OF(e),options:[e,t]}),GF=(e,t)=>({...MF(e),options:[e,t]}),qF=(e,t)=>({...FF(e),options:[e,t]});var ZF="Arrow",pN=p.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...l}=e;return o.jsx(Je.svg,{...l,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:o.jsx("polygon",{points:"0,0 30,0 15,10"})})});pN.displayName=ZF;var KF=pN;function Zb(e){const[t,n]=p.useState(void 0);return Cr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const l=s[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 Kb="Popper",[gN,Zs]=ir(Kb),[YF,yN]=gN(Kb),vN=e=>{const{__scopePopper:t,children:n}=e,[r,s]=p.useState(null);return o.jsx(YF,{scope:t,anchor:r,onAnchorChange:s,children:n})};vN.displayName=Kb;var xN="PopperAnchor",bN=p.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,l=yN(xN,n),c=p.useRef(null),d=ut(t,c),f=p.useRef(null);return p.useEffect(()=>{const h=f.current;f.current=(r==null?void 0:r.current)||c.current,h!==f.current&&l.onAnchorChange(f.current)}),r?null:o.jsx(Je.div,{...s,ref:d})});bN.displayName=xN;var Yb="PopperContent",[WF,QF]=gN(Yb),SN=p.forwardRef((e,t)=>{var le,Ne,we,_e,He,We;const{__scopePopper:n,side:r="bottom",sideOffset:s=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,...E}=e,S=yN(Yb,n),[R,T]=p.useState(null),_=ut(t,Ft=>T(Ft)),[D,A]=p.useState(null),O=Zb(D),j=(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,ee={padding:G,boundary:Y.filter(JF),altBoundary:Z},{refs:$,floatingStyles:W,placement:k,isPositioned:H,middlewareData:B}=UF({strategy:"fixed",placement:F,whileElementsMounted:(...Ft)=>_F(...Ft,{animationFrame:b==="always"}),elements:{reference:S.anchor},middleware:[zF({mainAxis:s+M,alignmentAxis:c}),f&&VF({mainAxis:!0,crossAxis:!1,limiter:y==="partial"?$F():void 0,...ee}),f&&HF({...ee}),BF({...ee,apply:({elements:Ft,rects:jt,availableWidth:Bt,availableHeight:xn})=>{const{width:jr,height:aa}=jt.reference,Fe=Ft.floating.style;Fe.setProperty("--radix-popper-available-width",`${Bt}px`),Fe.setProperty("--radix-popper-available-height",`${xn}px`),Fe.setProperty("--radix-popper-anchor-width",`${jr}px`),Fe.setProperty("--radix-popper-anchor-height",`${aa}px`)}}),D&&qF({element:D,padding:d}),ez({arrowWidth:j,arrowHeight:M}),v&&GF({strategy:"referenceHidden",...ee})]}),[ie,xe]=wN(k),L=ms(w);Cr(()=>{H&&(L==null||L())},[H,L]);const P=(le=B.arrow)==null?void 0:le.x,q=(Ne=B.arrow)==null?void 0:Ne.y,te=((we=B.arrow)==null?void 0:we.centerOffset)!==0,[ue,ve]=p.useState();return Cr(()=>{R&&ve(window.getComputedStyle(R).zIndex)},[R]),o.jsx("div",{ref:$.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:H?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ue,"--radix-popper-transform-origin":[(_e=B.transformOrigin)==null?void 0:_e.x,(He=B.transformOrigin)==null?void 0:He.y].join(" "),...((We=B.hide)==null?void 0:We.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:o.jsx(WF,{scope:n,placedSide:ie,onArrowChange:A,arrowX:P,arrowY:q,shouldHideArrow:te,children:o.jsx(Je.div,{"data-side":ie,"data-align":xe,...E,ref:_,style:{...E.style,animation:H?void 0:"none"}})})})});SN.displayName=Yb;var CN="PopperArrow",XF={top:"bottom",right:"left",bottom:"top",left:"right"},EN=p.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,l=QF(CN,r),c=XF[l.placedSide];return o.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:o.jsx(KF,{...s,ref:n,style:{...s.style,display:"block"}})})});EN.displayName=CN;function JF(e){return e!==null}var ez=e=>({name:"transformOrigin",options:e,fn(t){var S,R,T;const{placement:n,rects:r,middlewareData:s}=t,c=((S=s.arrow)==null?void 0:S.centerOffset)!==0,d=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[h,g]=wN(n),y={start:"0%",center:"50%",end:"100%"}[g],v=(((R=s.arrow)==null?void 0:R.x)??0)+d/2,b=(((T=s.arrow)==null?void 0:T.y)??0)+f/2;let w="",E="";return h==="bottom"?(w=c?y:`${v}px`,E=`${-f}px`):h==="top"?(w=c?y:`${v}px`,E=`${r.floating.height+f}px`):h==="right"?(w=`${-f}px`,E=c?y:`${b}px`):h==="left"&&(w=`${r.floating.width+f}px`,E=c?y:`${b}px`),{data:{x:w,y:E}}}});function wN(e){const[t,n="center"]=e.split("-");return[t,n]}var wu=vN,Ru=bN,Af=SN,Df=EN,tz=Symbol("radix.slottable");function nz(e){const t=({children:n})=>o.jsx(o.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=tz,t}var RN=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"}),rz="VisuallyHidden",TN=p.forwardRef((e,t)=>o.jsx(Je.span,{...e,ref:t,style:{...RN,...e.style}}));TN.displayName=rz;var az=TN,[dg]=ir("Tooltip",[Zs]),fg=Zs(),jN="TooltipProvider",sz=700,S0="tooltip.open",[oz,Wb]=dg(jN),_N=e=>{const{__scopeTooltip:t,delayDuration:n=sz,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:l}=e,c=p.useRef(!0),d=p.useRef(!1),f=p.useRef(0);return p.useEffect(()=>{const h=f.current;return()=>window.clearTimeout(h)},[]),o.jsx(oz,{scope:t,isOpenDelayedRef:c,delayDuration:n,onOpen:p.useCallback(()=>{window.clearTimeout(f.current),c.current=!1},[]),onClose:p.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>c.current=!0,r)},[r]),isPointerInTransitRef:d,onPointerInTransitChange:p.useCallback(h=>{d.current=h},[]),disableHoverableContent:s,children:l})};_N.displayName=jN;var uf="Tooltip",[iz,Of]=dg(uf),NN=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:l,disableHoverableContent:c,delayDuration:d}=e,f=Wb(uf,e.__scopeTooltip),h=fg(t),[g,y]=p.useState(null),v=Nn(),b=p.useRef(0),w=c??f.disableHoverableContent,E=d??f.delayDuration,S=p.useRef(!1),[R,T]=Vr({prop:r,defaultProp:s??!1,onChange:j=>{j?(f.onOpen(),document.dispatchEvent(new CustomEvent(S0))):f.onClose(),l==null||l(j)},caller:uf}),_=p.useMemo(()=>R?S.current?"delayed-open":"instant-open":"closed",[R]),D=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,S.current=!1,T(!0)},[T]),A=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,T(!1)},[T]),O=p.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{S.current=!0,T(!0),b.current=0},E)},[E,T]);return p.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),o.jsx(wu,{...h,children:o.jsx(iz,{scope:t,contentId:v,open:R,stateAttribute:_,trigger:g,onTriggerChange:y,onTriggerEnter:p.useCallback(()=>{f.isOpenDelayedRef.current?O():D()},[f.isOpenDelayedRef,O,D]),onTriggerLeave:p.useCallback(()=>{w?A():(window.clearTimeout(b.current),b.current=0)},[A,w]),onOpen:D,onClose:A,disableHoverableContent:w,children:n})})};NN.displayName=uf;var C0="TooltipTrigger",AN=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Of(C0,n),l=Wb(C0,n),c=fg(n),d=p.useRef(null),f=ut(t,d,s.onTriggerChange),h=p.useRef(!1),g=p.useRef(!1),y=p.useCallback(()=>h.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",y),[y]),o.jsx(Ru,{asChild:!0,...c,children:o.jsx(Je.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:f,onPointerMove:Te(e.onPointerMove,v=>{v.pointerType!=="touch"&&!g.current&&!l.isPointerInTransitRef.current&&(s.onTriggerEnter(),g.current=!0)}),onPointerLeave:Te(e.onPointerLeave,()=>{s.onTriggerLeave(),g.current=!1}),onPointerDown:Te(e.onPointerDown,()=>{s.open&&s.onClose(),h.current=!0,document.addEventListener("pointerup",y,{once:!0})}),onFocus:Te(e.onFocus,()=>{h.current||s.onOpen()}),onBlur:Te(e.onBlur,s.onClose),onClick:Te(e.onClick,s.onClose)})})});AN.displayName=C0;var Qb="TooltipPortal",[lz,cz]=dg(Qb,{forceMount:void 0}),DN=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,l=Of(Qb,t);return o.jsx(lz,{scope:t,forceMount:n,children:o.jsx(Er,{present:n||l.open,children:o.jsx(Bl,{asChild:!0,container:s,children:r})})})};DN.displayName=Qb;var du="TooltipContent",ON=p.forwardRef((e,t)=>{const n=cz(du,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...l}=e,c=Of(du,e.__scopeTooltip);return o.jsx(Er,{present:r||c.open,children:c.disableHoverableContent?o.jsx(MN,{side:s,...l,ref:t}):o.jsx(uz,{side:s,...l,ref:t})})}),uz=p.forwardRef((e,t)=>{const n=Of(du,e.__scopeTooltip),r=Wb(du,e.__scopeTooltip),s=p.useRef(null),l=ut(t,s),[c,d]=p.useState(null),{trigger:f,onClose:h}=n,g=s.current,{onPointerInTransitChange:y}=r,v=p.useCallback(()=>{d(null),y(!1)},[y]),b=p.useCallback((w,E)=>{const S=w.currentTarget,R={x:w.clientX,y:w.clientY},T=mz(R,S.getBoundingClientRect()),_=pz(R,T),D=gz(E.getBoundingClientRect()),A=vz([..._,...D]);d(A),y(!0)},[y]);return p.useEffect(()=>()=>v(),[v]),p.useEffect(()=>{if(f&&g){const w=S=>b(S,g),E=S=>b(S,f);return f.addEventListener("pointerleave",w),g.addEventListener("pointerleave",E),()=>{f.removeEventListener("pointerleave",w),g.removeEventListener("pointerleave",E)}}},[f,g,b,v]),p.useEffect(()=>{if(c){const w=E=>{const S=E.target,R={x:E.clientX,y:E.clientY},T=(f==null?void 0:f.contains(S))||(g==null?void 0:g.contains(S)),_=!yz(R,c);T?v():_&&(v(),h())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[f,g,c,h,v]),o.jsx(MN,{...e,ref:l})}),[dz,fz]=dg(uf,{isInside:!1}),hz=nz("TooltipContent"),MN=p.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:l,onPointerDownOutside:c,...d}=e,f=Of(du,n),h=fg(n),{onClose:g}=f;return p.useEffect(()=>(document.addEventListener(S0,g),()=>document.removeEventListener(S0,g)),[g]),p.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]),o.jsx(Hl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:y=>y.preventDefault(),onDismiss:g,children:o.jsxs(Af,{"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:[o.jsx(hz,{children:r}),o.jsx(dz,{scope:n,isInside:!0,children:o.jsx(az,{id:f.contentId,role:"tooltip",children:s||r})})]})})});ON.displayName=du;var IN="TooltipArrow",kN=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=fg(n);return fz(IN,n).isInside?null:o.jsx(Df,{...s,...r,ref:t})});kN.displayName=IN;function mz(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),l=Math.abs(t.left-e.x);switch(Math.min(n,r,s,l)){case l:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function pz(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 gz(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function yz(e,t){const{x:n,y:r}=e;let s=!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&&(s=!s)}return s}function vz(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),xz(t)}function xz(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const l=t[t.length-1],c=t[t.length-2];if((l.x-c.x)*(s.y-c.y)>=(l.y-c.y)*(s.x-c.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const l=n[n.length-1],c=n[n.length-2];if((l.x-c.x)*(s.y-c.y)>=(l.y-c.y)*(s.x-c.x))n.pop();else break}n.push(s)}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 bz=_N,Sz=NN,Cz=AN,Ez=DN,wz=ON,Rz=kN;function fs({delayDuration:e=0,...t}){return o.jsx(bz,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function St({...e}){return o.jsx(fs,{children:o.jsx(Sz,{"data-slot":"tooltip",...e})})}function Ct({...e}){return o.jsx(Cz,{"data-slot":"tooltip-trigger",...e})}function Et({className:e,sideOffset:t=0,children:n,...r}){return o.jsx(Ez,{children:o.jsxs(wz,{"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,o.jsx(Rz,{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 Tz="sidebar_state",jz=3600*24*7,_z="16rem",Nz="18rem",Az="3rem",Dz="b",LN=p.createContext(null);function Mf(){const e=p.useContext(LN);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function Oz({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:s,children:l,...c}){const d=s7(),[f,h]=p.useState(!1),[g,y]=p.useState(e),v=t??g,b=p.useCallback(R=>{const T=typeof R=="function"?R(v):R;n?n(T):y(T),document.cookie=`${Tz}=${T}; path=/; max-age=${jz}`},[n,v]),w=p.useCallback(()=>d?h(R=>!R):b(R=>!R),[d,b,h]);p.useEffect(()=>{const R=T=>{T.key===Dz&&(T.metaKey||T.ctrlKey)&&(T.preventDefault(),w())};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[w]);const E=v?"expanded":"collapsed",S=p.useMemo(()=>({state:E,open:v,setOpen:b,isMobile:d,openMobile:f,setOpenMobile:h,toggleSidebar:w}),[E,v,b,d,f,h,w]);return o.jsx(LN.Provider,{value:S,children:o.jsx(fs,{delayDuration:0,children:o.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":_z,"--sidebar-width-icon":Az,...s},className:ne("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...c,children:l})})})}function Mz({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:s,...l}){const{isMobile:c,state:d,openMobile:f,setOpenMobile:h}=Mf();return n==="none"?o.jsx("div",{"data-slot":"sidebar",className:ne("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...l,children:s}):c?o.jsx(Li,{open:f,onOpenChange:h,...l,children:o.jsxs(Pi,{"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":Nz},side:e,children:[o.jsxs(Ui,{className:"sr-only",children:[o.jsx(Fi,{children:"Sidebar"}),o.jsx(Gl,{children:"Displays the mobile sidebar."})]}),o.jsx("div",{className:"flex h-full w-full flex-col",children:s})]})}):o.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:[o.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)")}),o.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:o.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:s})})]})}function Iz({className:e,onClick:t,...n}){const{toggleSidebar:r}=Mf();return o.jsx("div",{className:"absolute top-4 left-0 z-10 md:hidden",children:o.jsxs(Se,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:ne("size-7",e),onClick:s=>{t==null||t(s),r()},...n,children:[o.jsx(SL,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})})}function kz({className:e,...t}){const{toggleSidebar:n}=Mf();return o.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 Lz({className:e,...t}){return o.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 Pz({className:e,...t}){return o.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:ne("flex flex-col gap-2 p-2",e),...t})}function Uz({className:e,...t}){return o.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:ne("flex flex-col gap-2 p-2",e),...t})}function Fz({className:e,...t}){return o.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 UR({className:e,...t}){return o.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 FR({className:e,...t}){return o.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:ne("w-full text-sm",e),...t})}function zz({className:e,...t}){return o.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:ne("flex w-full min-w-0 flex-col gap-1",e),...t})}function Vz({className:e,...t}){return o.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:ne("group/menu-item relative",e),...t})}const $z=Ef("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 Hz({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:s,className:l,...c}){const d=e?Yp:"button",{isMobile:f,state:h}=Mf(),g=o.jsx(d,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":t,className:ne($z({variant:n,size:r}),l),...c});return s?(typeof s=="string"&&(s={children:s}),o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:g}),o.jsx(Et,{side:"right",align:"center",hidden:h!=="collapsed"||f,...s})]})):g}function E0(e){const t=Bz(e),n=p.forwardRef((r,s)=>{const{children:l,...c}=r,d=p.Children.toArray(l),f=d.find(qz);if(f){const h=f.props.children,g=d.map(y=>y===f?p.Children.count(h)>1?p.Children.only(null):p.isValidElement(h)?h.props.children:null:y);return o.jsx(t,{...c,ref:s,children:p.isValidElement(h)?p.cloneElement(h,void 0,g):null})}return o.jsx(t,{...c,ref:s,children:l})});return n.displayName=`${e}.Slot`,n}function Bz(e){const t=p.forwardRef((n,r)=>{const{children:s,...l}=n;if(p.isValidElement(s)){const c=Kz(s),d=Zz(l,s.props);return s.type!==p.Fragment&&(d.ref=r?Ir(r,c):c),p.cloneElement(s,d)}return p.Children.count(s)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Gz=Symbol("radix.slottable");function qz(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Gz}function Zz(e,t){const n={...t};for(const r in t){const s=e[r],l=t[r];/^on[A-Z]/.test(r)?s&&l?n[r]=(...d)=>{const f=l(...d);return s(...d),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...l}:r==="className"&&(n[r]=[s,l].filter(Boolean).join(" "))}return{...e,...n}}function Kz(e){var r,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Yz(e){const t=e+"CollectionProvider",[n,r]=ir(t),[s,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=E=>{const{scope:S,children:R}=E,T=ye.useRef(null),_=ye.useRef(new Map).current;return o.jsx(s,{scope:S,itemMap:_,collectionRef:T,children:R})};c.displayName=t;const d=e+"CollectionSlot",f=E0(d),h=ye.forwardRef((E,S)=>{const{scope:R,children:T}=E,_=l(d,R),D=ut(S,_.collectionRef);return o.jsx(f,{ref:D,children:T})});h.displayName=d;const g=e+"CollectionItemSlot",y="data-radix-collection-item",v=E0(g),b=ye.forwardRef((E,S)=>{const{scope:R,children:T,..._}=E,D=ye.useRef(null),A=ut(S,D),O=l(g,R);return ye.useEffect(()=>(O.itemMap.set(D,{ref:D,..._}),()=>void O.itemMap.delete(D))),o.jsx(v,{[y]:"",ref:A,children:T})});b.displayName=g;function w(E){const S=l(e+"CollectionConsumer",E);return ye.useCallback(()=>{const T=S.collectionRef.current;if(!T)return[];const _=Array.from(T.querySelectorAll(`[${y}]`));return Array.from(S.itemMap.values()).sort((O,j)=>_.indexOf(O.ref.current)-_.indexOf(j.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:c,Slot:h,ItemSlot:b},w,r]}var Wz=p.createContext(void 0);function If(e){const t=p.useContext(Wz);return e||t||"ltr"}function zR(e){const t=Qz(e),n=p.forwardRef((r,s)=>{const{children:l,...c}=r,d=p.Children.toArray(l),f=d.find(Jz);if(f){const h=f.props.children,g=d.map(y=>y===f?p.Children.count(h)>1?p.Children.only(null):p.isValidElement(h)?h.props.children:null:y);return o.jsx(t,{...c,ref:s,children:p.isValidElement(h)?p.cloneElement(h,void 0,g):null})}return o.jsx(t,{...c,ref:s,children:l})});return n.displayName=`${e}.Slot`,n}function Qz(e){const t=p.forwardRef((n,r)=>{const{children:s,...l}=n;if(p.isValidElement(s)){const c=tV(s),d=eV(l,s.props);return s.type!==p.Fragment&&(d.ref=r?Ir(r,c):c),p.cloneElement(s,d)}return p.Children.count(s)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Xz=Symbol("radix.slottable");function Jz(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Xz}function eV(e,t){const n={...t};for(const r in t){const s=e[r],l=t[r];/^on[A-Z]/.test(r)?s&&l?n[r]=(...d)=>{const f=l(...d);return s(...d),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...l}:r==="className"&&(n[r]=[s,l].filter(Boolean).join(" "))}return{...e,...n}}function tV(e){var r,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function nV(e){const t=e+"CollectionProvider",[n,r]=ir(t),[s,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=E=>{const{scope:S,children:R}=E,T=ye.useRef(null),_=ye.useRef(new Map).current;return o.jsx(s,{scope:S,itemMap:_,collectionRef:T,children:R})};c.displayName=t;const d=e+"CollectionSlot",f=zR(d),h=ye.forwardRef((E,S)=>{const{scope:R,children:T}=E,_=l(d,R),D=ut(S,_.collectionRef);return o.jsx(f,{ref:D,children:T})});h.displayName=d;const g=e+"CollectionItemSlot",y="data-radix-collection-item",v=zR(g),b=ye.forwardRef((E,S)=>{const{scope:R,children:T,..._}=E,D=ye.useRef(null),A=ut(S,D),O=l(g,R);return ye.useEffect(()=>(O.itemMap.set(D,{ref:D,..._}),()=>void O.itemMap.delete(D))),o.jsx(v,{[y]:"",ref:A,children:T})});b.displayName=g;function w(E){const S=l(e+"CollectionConsumer",E);return ye.useCallback(()=>{const T=S.collectionRef.current;if(!T)return[];const _=Array.from(T.querySelectorAll(`[${y}]`));return Array.from(S.itemMap.values()).sort((O,j)=>_.indexOf(O.ref.current)-_.indexOf(j.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:c,Slot:h,ItemSlot:b},w,r]}var jx="rovingFocusGroup.onEntryFocus",rV={bubbles:!1,cancelable:!0},kf="RovingFocusGroup",[w0,PN,aV]=nV(kf),[sV,hg]=ir(kf,[aV]),[oV,iV]=sV(kf),UN=p.forwardRef((e,t)=>o.jsx(w0.Provider,{scope:e.__scopeRovingFocusGroup,children:o.jsx(w0.Slot,{scope:e.__scopeRovingFocusGroup,children:o.jsx(lV,{...e,ref:t})})}));UN.displayName=kf;var lV=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:l,currentTabStopId:c,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:f,onEntryFocus:h,preventScrollOnEntryFocus:g=!1,...y}=e,v=p.useRef(null),b=ut(t,v),w=If(l),[E,S]=Vr({prop:c,defaultProp:d??null,onChange:f,caller:kf}),[R,T]=p.useState(!1),_=ms(h),D=PN(n),A=p.useRef(!1),[O,j]=p.useState(0);return p.useEffect(()=>{const M=v.current;if(M)return M.addEventListener(jx,_),()=>M.removeEventListener(jx,_)},[_]),o.jsx(oV,{scope:n,orientation:r,dir:w,loop:s,currentTabStopId:E,onItemFocus:p.useCallback(M=>S(M),[S]),onItemShiftTab:p.useCallback(()=>T(!0),[]),onFocusableItemAdd:p.useCallback(()=>j(M=>M+1),[]),onFocusableItemRemove:p.useCallback(()=>j(M=>M-1),[]),children:o.jsx(Je.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(jx,rV);if(M.currentTarget.dispatchEvent(G),!G.defaultPrevented){const Y=D().filter(k=>k.focusable),Z=Y.find(k=>k.active),ee=Y.find(k=>k.id===E),W=[Z,ee,...Y].filter(Boolean).map(k=>k.ref.current);VN(W,g)}}A.current=!1}),onBlur:Te(e.onBlur,()=>T(!1))})})}),FN="RovingFocusGroupItem",zN=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:l,children:c,...d}=e,f=Nn(),h=l||f,g=iV(FN,n),y=g.currentTabStopId===h,v=PN(n),{onFocusableItemAdd:b,onFocusableItemRemove:w,currentTabStopId:E}=g;return p.useEffect(()=>{if(r)return b(),()=>w()},[r,b,w]),o.jsx(w0.ItemSlot,{scope:n,id:h,focusable:r,active:s,children:o.jsx(Je.span,{tabIndex:y?0:-1,"data-orientation":g.orientation,...d,ref:t,onMouseDown:Te(e.onMouseDown,S=>{r?g.onItemFocus(h):S.preventDefault()}),onFocus:Te(e.onFocus,()=>g.onItemFocus(h)),onKeyDown:Te(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){g.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const R=dV(S,g.orientation,g.dir);if(R!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.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(S.currentTarget);_=g.loop?fV(_,D+1):_.slice(D+1)}setTimeout(()=>VN(_))}}),children:typeof c=="function"?c({isCurrentTabStop:y,hasTabStop:E!=null}):c})})});zN.displayName=FN;var cV={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function uV(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function dV(e,t,n){const r=uV(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return cV[r]}function VN(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function fV(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var $N=UN,HN=zN,R0=["Enter"," "],hV=["ArrowDown","PageUp","Home"],BN=["ArrowUp","PageDown","End"],mV=[...hV,...BN],pV={ltr:[...R0,"ArrowRight"],rtl:[...R0,"ArrowLeft"]},gV={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Lf="Menu",[df,yV,vV]=Yz(Lf),[ql,GN]=ir(Lf,[vV,Zs,hg]),Pf=Zs(),qN=hg(),[ZN,zi]=ql(Lf),[xV,Uf]=ql(Lf),KN=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:l,modal:c=!0}=e,d=Pf(t),[f,h]=p.useState(null),g=p.useRef(!1),y=ms(l),v=If(s);return p.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})}},[]),o.jsx(wu,{...d,children:o.jsx(ZN,{scope:t,open:n,onOpenChange:y,content:f,onContentChange:h,children:o.jsx(xV,{scope:t,onClose:p.useCallback(()=>y(!1),[y]),isUsingKeyboardRef:g,dir:v,modal:c,children:r})})})};KN.displayName=Lf;var bV="MenuAnchor",Xb=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Pf(n);return o.jsx(Ru,{...s,...r,ref:t})});Xb.displayName=bV;var Jb="MenuPortal",[SV,YN]=ql(Jb,{forceMount:void 0}),WN=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,l=zi(Jb,t);return o.jsx(SV,{scope:t,forceMount:n,children:o.jsx(Er,{present:n||l.open,children:o.jsx(Bl,{asChild:!0,container:s,children:r})})})};WN.displayName=Jb;var Ba="MenuContent",[CV,e1]=ql(Ba),QN=p.forwardRef((e,t)=>{const n=YN(Ba,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,l=zi(Ba,e.__scopeMenu),c=Uf(Ba,e.__scopeMenu);return o.jsx(df.Provider,{scope:e.__scopeMenu,children:o.jsx(Er,{present:r||l.open,children:o.jsx(df.Slot,{scope:e.__scopeMenu,children:c.modal?o.jsx(EV,{...s,ref:t}):o.jsx(wV,{...s,ref:t})})})})}),EV=p.forwardRef((e,t)=>{const n=zi(Ba,e.__scopeMenu),r=p.useRef(null),s=ut(t,r);return p.useEffect(()=>{const l=r.current;if(l)return eg(l)},[]),o.jsx(t1,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Te(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),wV=p.forwardRef((e,t)=>{const n=zi(Ba,e.__scopeMenu);return o.jsx(t1,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),RV=E0("MenuContent.ScrollLock"),t1=p.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:l,onCloseAutoFocus:c,disableOutsidePointerEvents:d,onEntryFocus:f,onEscapeKeyDown:h,onPointerDownOutside:g,onFocusOutside:y,onInteractOutside:v,onDismiss:b,disableOutsideScroll:w,...E}=e,S=zi(Ba,n),R=Uf(Ba,n),T=Pf(n),_=qN(n),D=yV(n),[A,O]=p.useState(null),j=p.useRef(null),M=ut(t,j,S.onContentChange),F=p.useRef(0),G=p.useRef(""),Y=p.useRef(0),Z=p.useRef(null),ee=p.useRef("right"),$=p.useRef(0),W=w?_f:p.Fragment,k=w?{as:RV,allowPinchZoom:!0}:void 0,H=ie=>{var le,Ne;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=PV(te,xe,q),ve=(Ne=L.find(we=>we.textValue===ue))==null?void 0:Ne.ref.current;(function we(_e){G.current=_e,window.clearTimeout(F.current),_e!==""&&(F.current=window.setTimeout(()=>we(""),1e3))})(xe),ve&&setTimeout(()=>ve.focus())};p.useEffect(()=>()=>window.clearTimeout(F.current),[]),Xp();const B=p.useCallback(ie=>{var L,P;return ee.current===((L=Z.current)==null?void 0:L.side)&&FV(ie,(P=Z.current)==null?void 0:P.area)},[]);return o.jsx(CV,{scope:n,searchRef:G,onItemEnter:p.useCallback(ie=>{B(ie)&&ie.preventDefault()},[B]),onItemLeave:p.useCallback(ie=>{var xe;B(ie)||((xe=j.current)==null||xe.focus(),O(null))},[B]),onTriggerLeave:p.useCallback(ie=>{B(ie)&&ie.preventDefault()},[B]),pointerGraceTimerRef:Y,onPointerGraceIntentChange:p.useCallback(ie=>{Z.current=ie},[]),children:o.jsx(W,{...k,children:o.jsx(jf,{asChild:!0,trapped:s,onMountAutoFocus:Te(l,ie=>{var xe;ie.preventDefault(),(xe=j.current)==null||xe.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:o.jsx(Hl,{asChild:!0,disableOutsidePointerEvents:d,onEscapeKeyDown:h,onPointerDownOutside:g,onFocusOutside:y,onInteractOutside:v,onDismiss:b,children:o.jsx($N,{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:o.jsx(Af,{role:"menu","aria-orientation":"vertical","data-state":mA(S.open),"data-radix-menu-content":"",dir:R.dir,...T,...E,ref:M,style:{outline:"none",...E.style},onKeyDown:Te(E.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&&H(ie.key));const te=j.current;if(ie.target!==te||!mV.includes(ie.key))return;ie.preventDefault();const ve=D().filter(le=>!le.disabled).map(le=>le.ref.current);BN.includes(ie.key)&&ve.reverse(),kV(ve)}),onBlur:Te(e.onBlur,ie=>{ie.currentTarget.contains(ie.target)||(window.clearTimeout(F.current),G.current="")}),onPointerMove:Te(e.onPointerMove,ff(ie=>{const xe=ie.target,L=$.current!==ie.clientX;if(ie.currentTarget.contains(xe)&&L){const P=ie.clientX>$.current?"right":"left";ee.current=P,$.current=ie.clientX}}))})})})})})})});QN.displayName=Ba;var TV="MenuGroup",n1=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsx(Je.div,{role:"group",...r,ref:t})});n1.displayName=TV;var jV="MenuLabel",XN=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsx(Je.div,{...r,ref:t})});XN.displayName=jV;var fp="MenuItem",VR="menu.itemSelect",mg=p.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,l=p.useRef(null),c=Uf(fp,e.__scopeMenu),d=e1(fp,e.__scopeMenu),f=ut(t,l),h=p.useRef(!1),g=()=>{const y=l.current;if(!n&&y){const v=new CustomEvent(VR,{bubbles:!0,cancelable:!0});y.addEventListener(VR,b=>r==null?void 0:r(b),{once:!0}),N_(y,v),v.defaultPrevented?h.current=!1:c.onClose()}};return o.jsx(JN,{...s,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===" "||R0.includes(y.key)&&(y.currentTarget.click(),y.preventDefault())})})});mg.displayName=fp;var JN=p.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...l}=e,c=e1(fp,n),d=qN(n),f=p.useRef(null),h=ut(t,f),[g,y]=p.useState(!1),[v,b]=p.useState("");return p.useEffect(()=>{const w=f.current;w&&b((w.textContent??"").trim())},[l.children]),o.jsx(df.ItemSlot,{scope:n,disabled:r,textValue:s??v,children:o.jsx(HN,{asChild:!0,...d,focusable:!r,children:o.jsx(Je.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,ff(w=>{r?c.onItemLeave(w):(c.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Te(e.onPointerLeave,ff(w=>c.onItemLeave(w))),onFocus:Te(e.onFocus,()=>y(!0)),onBlur:Te(e.onBlur,()=>y(!1))})})})}),_V="MenuCheckboxItem",eA=p.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return o.jsx(sA,{scope:e.__scopeMenu,checked:n,children:o.jsx(mg,{role:"menuitemcheckbox","aria-checked":hp(n)?"mixed":n,...s,ref:t,"data-state":s1(n),onSelect:Te(s.onSelect,()=>r==null?void 0:r(hp(n)?!0:!n),{checkForDefaultPrevented:!1})})})});eA.displayName=_V;var tA="MenuRadioGroup",[NV,AV]=ql(tA,{value:void 0,onValueChange:()=>{}}),nA=p.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,l=ms(r);return o.jsx(NV,{scope:e.__scopeMenu,value:n,onValueChange:l,children:o.jsx(n1,{...s,ref:t})})});nA.displayName=tA;var rA="MenuRadioItem",aA=p.forwardRef((e,t)=>{const{value:n,...r}=e,s=AV(rA,e.__scopeMenu),l=n===s.value;return o.jsx(sA,{scope:e.__scopeMenu,checked:l,children:o.jsx(mg,{role:"menuitemradio","aria-checked":l,...r,ref:t,"data-state":s1(l),onSelect:Te(r.onSelect,()=>{var c;return(c=s.onValueChange)==null?void 0:c.call(s,n)},{checkForDefaultPrevented:!1})})})});aA.displayName=rA;var r1="MenuItemIndicator",[sA,DV]=ql(r1,{checked:!1}),oA=p.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,l=DV(r1,n);return o.jsx(Er,{present:r||hp(l.checked)||l.checked===!0,children:o.jsx(Je.span,{...s,ref:t,"data-state":s1(l.checked)})})});oA.displayName=r1;var OV="MenuSeparator",iA=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsx(Je.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});iA.displayName=OV;var MV="MenuArrow",lA=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Pf(n);return o.jsx(Df,{...s,...r,ref:t})});lA.displayName=MV;var a1="MenuSub",[IV,cA]=ql(a1),uA=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:s}=e,l=zi(a1,t),c=Pf(t),[d,f]=p.useState(null),[h,g]=p.useState(null),y=ms(s);return p.useEffect(()=>(l.open===!1&&y(!1),()=>y(!1)),[l.open,y]),o.jsx(wu,{...c,children:o.jsx(ZN,{scope:t,open:r,onOpenChange:y,content:h,onContentChange:g,children:o.jsx(IV,{scope:t,contentId:Nn(),triggerId:Nn(),trigger:d,onTriggerChange:f,children:n})})})};uA.displayName=a1;var Bd="MenuSubTrigger",dA=p.forwardRef((e,t)=>{const n=zi(Bd,e.__scopeMenu),r=Uf(Bd,e.__scopeMenu),s=cA(Bd,e.__scopeMenu),l=e1(Bd,e.__scopeMenu),c=p.useRef(null),{pointerGraceTimerRef:d,onPointerGraceIntentChange:f}=l,h={__scopeMenu:e.__scopeMenu},g=p.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return p.useEffect(()=>g,[g]),p.useEffect(()=>{const y=d.current;return()=>{window.clearTimeout(y),f(null)}},[d,f]),o.jsx(Xb,{asChild:!0,...h,children:o.jsx(JN,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":mA(n.open),...e,ref:Ir(t,s.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,ff(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,ff(y=>{var b,w;g();const v=(b=n.content)==null?void 0:b.getBoundingClientRect();if(v){const E=(w=n.content)==null?void 0:w.dataset.side,S=E==="right",R=S?-5:5,T=v[S?"left":"right"],_=v[S?"right":"left"];l.onPointerGraceIntentChange({area:[{x:y.clientX+R,y:y.clientY},{x:T,y:v.top},{x:_,y:v.top},{x:_,y:v.bottom},{x:T,y:v.bottom}],side:E}),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===" "||pV[r.dir].includes(y.key)&&(n.onOpenChange(!0),(b=n.content)==null||b.focus(),y.preventDefault())})})})});dA.displayName=Bd;var fA="MenuSubContent",hA=p.forwardRef((e,t)=>{const n=YN(Ba,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,l=zi(Ba,e.__scopeMenu),c=Uf(Ba,e.__scopeMenu),d=cA(fA,e.__scopeMenu),f=p.useRef(null),h=ut(t,f);return o.jsx(df.Provider,{scope:e.__scopeMenu,children:o.jsx(Er,{present:r||l.open,children:o.jsx(df.Slot,{scope:e.__scopeMenu,children:o.jsx(t1,{id:d.contentId,"aria-labelledby":d.triggerId,...s,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=gV[c.dir].includes(g.key);y&&v&&(l.onOpenChange(!1),(b=d.trigger)==null||b.focus(),g.preventDefault())})})})})})});hA.displayName=fA;function mA(e){return e?"open":"closed"}function hp(e){return e==="indeterminate"}function s1(e){return hp(e)?"indeterminate":e?"checked":"unchecked"}function kV(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function LV(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function PV(e,t,n){const s=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let c=LV(e,Math.max(l,0));s.length===1&&(c=c.filter(h=>h!==n));const f=c.find(h=>h.toLowerCase().startsWith(s.toLowerCase()));return f!==n?f:void 0}function UV(e,t){const{x:n,y:r}=e;let s=!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&&(s=!s)}return s}function FV(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return UV(n,t)}function ff(e){return t=>t.pointerType==="mouse"?e(t):void 0}var zV=KN,VV=Xb,$V=WN,HV=QN,BV=n1,GV=XN,qV=mg,ZV=eA,KV=nA,YV=aA,WV=oA,QV=iA,XV=lA,JV=uA,e$=dA,t$=hA,pg="DropdownMenu",[n$]=ir(pg,[GN]),kr=GN(),[r$,pA]=n$(pg),gA=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:l,onOpenChange:c,modal:d=!0}=e,f=kr(t),h=p.useRef(null),[g,y]=Vr({prop:s,defaultProp:l??!1,onChange:c,caller:pg});return o.jsx(r$,{scope:t,triggerId:Nn(),triggerRef:h,contentId:Nn(),open:g,onOpenChange:y,onOpenToggle:p.useCallback(()=>y(v=>!v),[y]),modal:d,children:o.jsx(zV,{...f,open:g,onOpenChange:y,dir:r,modal:d,children:n})})};gA.displayName=pg;var yA="DropdownMenuTrigger",vA=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,l=pA(yA,n),c=kr(n);return o.jsx(VV,{asChild:!0,...c,children:o.jsx(Je.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,...s,ref:Ir(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())})})})});vA.displayName=yA;var a$="DropdownMenuPortal",xA=e=>{const{__scopeDropdownMenu:t,...n}=e,r=kr(t);return o.jsx($V,{...r,...n})};xA.displayName=a$;var bA="DropdownMenuContent",SA=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=pA(bA,n),l=kr(n),c=p.useRef(!1);return o.jsx(HV,{id:s.contentId,"aria-labelledby":s.triggerId,...l,...r,ref:t,onCloseAutoFocus:Te(e.onCloseAutoFocus,d=>{var f;c.current||(f=s.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;(!s.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)"}})});SA.displayName=bA;var s$="DropdownMenuGroup",o$=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=kr(n);return o.jsx(BV,{...s,...r,ref:t})});o$.displayName=s$;var i$="DropdownMenuLabel",l$=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=kr(n);return o.jsx(GV,{...s,...r,ref:t})});l$.displayName=i$;var c$="DropdownMenuItem",CA=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=kr(n);return o.jsx(qV,{...s,...r,ref:t})});CA.displayName=c$;var u$="DropdownMenuCheckboxItem",d$=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=kr(n);return o.jsx(ZV,{...s,...r,ref:t})});d$.displayName=u$;var f$="DropdownMenuRadioGroup",h$=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=kr(n);return o.jsx(KV,{...s,...r,ref:t})});h$.displayName=f$;var m$="DropdownMenuRadioItem",p$=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=kr(n);return o.jsx(YV,{...s,...r,ref:t})});p$.displayName=m$;var g$="DropdownMenuItemIndicator",y$=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=kr(n);return o.jsx(WV,{...s,...r,ref:t})});y$.displayName=g$;var v$="DropdownMenuSeparator",EA=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=kr(n);return o.jsx(QV,{...s,...r,ref:t})});EA.displayName=v$;var x$="DropdownMenuArrow",b$=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=kr(n);return o.jsx(XV,{...s,...r,ref:t})});b$.displayName=x$;var S$=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:s,defaultOpen:l}=e,c=kr(t),[d,f]=Vr({prop:r,defaultProp:l??!1,onChange:s,caller:"DropdownMenuSub"});return o.jsx(JV,{...c,open:d,onOpenChange:f,children:n})},C$="DropdownMenuSubTrigger",wA=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=kr(n);return o.jsx(e$,{...s,...r,ref:t})});wA.displayName=C$;var E$="DropdownMenuSubContent",RA=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=kr(n);return o.jsx(t$,{...s,...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)"}})});RA.displayName=E$;var w$=gA,R$=vA,TA=xA,T$=SA,j$=CA,_$=EA,N$=S$,A$=wA,D$=RA;function wr({...e}){return o.jsx(w$,{"data-slot":"dropdown-menu",...e})}function O$({...e}){return o.jsx(TA,{"data-slot":"dropdown-menu-portal",...e})}function Rr({...e}){return o.jsx(R$,{"data-slot":"dropdown-menu-trigger",...e})}function Tr({className:e,sideOffset:t=4,...n}){return o.jsx(TA,{children:o.jsx(T$,{"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 vt({className:e,inset:t,variant:n="default",...r}){return o.jsx(j$,{"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 Ka({className:e,...t}){return o.jsx(_$,{"data-slot":"dropdown-menu-separator",className:ne("bg-border -mx-1 my-1 h-px",e),...t})}function o1({...e}){return o.jsx(N$,{"data-slot":"dropdown-menu-sub",...e})}function i1({className:e,inset:t,children:n,...r}){return o.jsxs(A$,{"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,o.jsx(ja,{className:"ml-auto size-4"})]})}function l1({className:e,...t}){return o.jsx(D$,{"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 M$="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",I$=({width:e=45,height:t=36,className:n=""})=>o.jsx("img",{src:M$,alt:"OWOX Logo",width:e,height:t,className:n}),jA=p.createContext(null),_A=p.createContext(()=>{});function k$(){return p.useContext(_A)}function mp(e){const t=p.useContext(jA);if(t==null)throw new Error("useAppSelector must be used within StoreProvider");return e(t)}function NA(){return mp(e=>e.project)}function c1(){const{data:e,callState:t,error:n}=mp(r=>r.flags);return{flags:e,callState:t,error:n}}function L$({isOpen:e}){const{title:t}=NA();return o.jsx(Rr,{asChild:!0,children:o.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:[o.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:o.jsx(I$,{width:24,height:24})}),o.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[o.jsx("span",{className:"truncate font-medium",children:"OWOX Data Marts"}),o.jsx("span",{className:"text-muted-foreground truncate text-xs",children:t??"Project"})]}),o.jsx(Qa,{className:`ml-auto size-4 transition-transform duration-200 ${e?"rotate-180":""}`})]})})}var Or=(e=>(e.LOADING="loading",e.AUTHENTICATED="authenticated",e.UNAUTHENTICATED="unauthenticated",e.ERROR="error",e))(Or||{});function AA(e,t){return function(){return e.apply(t,arguments)}}const{toString:P$}=Object.prototype,{getPrototypeOf:u1}=Object,{iterator:gg,toStringTag:DA}=Symbol,yg=(e=>t=>{const n=P$.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),bs=e=>(e=e.toLowerCase(),t=>yg(t)===e),vg=e=>t=>typeof t===e,{isArray:Tu}=Array,fu=vg("undefined");function Ff(e){return e!==null&&!fu(e)&&e.constructor!==null&&!fu(e.constructor)&&ta(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const OA=bs("ArrayBuffer");function U$(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&OA(e.buffer),t}const F$=vg("string"),ta=vg("function"),MA=vg("number"),zf=e=>e!==null&&typeof e=="object",z$=e=>e===!0||e===!1,qm=e=>{if(yg(e)!=="object")return!1;const t=u1(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(DA in e)&&!(gg in e)},V$=e=>{if(!zf(e)||Ff(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},$$=bs("Date"),H$=bs("File"),B$=bs("Blob"),G$=bs("FileList"),q$=e=>zf(e)&&ta(e.pipe),Z$=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||ta(e.append)&&((t=yg(e))==="formdata"||t==="object"&&ta(e.toString)&&e.toString()==="[object FormData]"))},K$=bs("URLSearchParams"),[Y$,W$,Q$,X$]=["ReadableStream","Request","Response","Headers"].map(bs),J$=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Vf(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),Tu(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(Ff(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 IA(e,t){if(Ff(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const xl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,kA=e=>!fu(e)&&e!==xl;function T0(){const{caseless:e,skipUndefined:t}=kA(this)&&this||{},n={},r=(s,l)=>{const c=e&&IA(n,l)||l;qm(n[c])&&qm(s)?n[c]=T0(n[c],s):qm(s)?n[c]=T0({},s):Tu(s)?n[c]=s.slice():(!t||!fu(s))&&(n[c]=s)};for(let s=0,l=arguments.length;s<l;s++)arguments[s]&&Vf(arguments[s],r);return n}const eH=(e,t,n,{allOwnKeys:r}={})=>(Vf(t,(s,l)=>{n&&ta(s)?e[l]=AA(s,n):e[l]=s},{allOwnKeys:r}),e),tH=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),nH=(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)},rH=(e,t,n,r)=>{let s,l,c;const d={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),l=s.length;l-- >0;)c=s[l],(!r||r(c,e,t))&&!d[c]&&(t[c]=e[c],d[c]=!0);e=n!==!1&&u1(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},aH=(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},sH=e=>{if(!e)return null;if(Tu(e))return e;let t=e.length;if(!MA(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},oH=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&u1(Uint8Array)),iH=(e,t)=>{const r=(e&&e[gg]).call(e);let s;for(;(s=r.next())&&!s.done;){const l=s.value;t.call(e,l[0],l[1])}},lH=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},cH=bs("HTMLFormElement"),uH=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),$R=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),dH=bs("RegExp"),LA=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Vf(n,(s,l)=>{let c;(c=t(s,l,e))!==!1&&(r[l]=c||s)}),Object.defineProperties(e,r)},fH=e=>{LA(e,(t,n)=>{if(ta(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(ta(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+"'")})}})},hH=(e,t)=>{const n={},r=s=>{s.forEach(l=>{n[l]=!0})};return Tu(e)?r(e):r(String(e).split(t)),n},mH=()=>{},pH=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function gH(e){return!!(e&&ta(e.append)&&e[DA]==="FormData"&&e[gg])}const yH=e=>{const t=new Array(10),n=(r,s)=>{if(zf(r)){if(t.indexOf(r)>=0)return;if(Ff(r))return r;if(!("toJSON"in r)){t[s]=r;const l=Tu(r)?[]:{};return Vf(r,(c,d)=>{const f=n(c,s+1);!fu(f)&&(l[d]=f)}),t[s]=void 0,l}}return r};return n(e,0)},vH=bs("AsyncFunction"),xH=e=>e&&(zf(e)||ta(e))&&ta(e.then)&&ta(e.catch),PA=((e,t)=>e?setImmediate:t?((n,r)=>(xl.addEventListener("message",({source:s,data:l})=>{s===xl&&l===n&&r.length&&r.shift()()},!1),s=>{r.push(s),xl.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",ta(xl.postMessage)),bH=typeof queueMicrotask<"u"?queueMicrotask.bind(xl):typeof process<"u"&&process.nextTick||PA,SH=e=>e!=null&&ta(e[gg]),ce={isArray:Tu,isArrayBuffer:OA,isBuffer:Ff,isFormData:Z$,isArrayBufferView:U$,isString:F$,isNumber:MA,isBoolean:z$,isObject:zf,isPlainObject:qm,isEmptyObject:V$,isReadableStream:Y$,isRequest:W$,isResponse:Q$,isHeaders:X$,isUndefined:fu,isDate:$$,isFile:H$,isBlob:B$,isRegExp:dH,isFunction:ta,isStream:q$,isURLSearchParams:K$,isTypedArray:oH,isFileList:G$,forEach:Vf,merge:T0,extend:eH,trim:J$,stripBOM:tH,inherits:nH,toFlatObject:rH,kindOf:yg,kindOfTest:bs,endsWith:aH,toArray:sH,forEachEntry:iH,matchAll:lH,isHTMLForm:cH,hasOwnProperty:$R,hasOwnProp:$R,reduceDescriptors:LA,freezeMethods:fH,toObjectSet:hH,toCamelCase:uH,noop:mH,toFiniteNumber:pH,findKey:IA,global:xl,isContextDefined:kA,isSpecCompliantForm:gH,toJSONObject:yH,isAsyncFn:vH,isThenable:xH,setImmediate:PA,asap:bH,isIterable:SH};function ht(e,t,n,r,s){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),s&&(this.response=s,this.status=s.status?s.status:null)}ce.inherits(ht,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 UA=ht.prototype,FA={};["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=>{FA[e]={value:e}});Object.defineProperties(ht,FA);Object.defineProperty(UA,"isAxiosError",{value:!0});ht.from=(e,t,n,r,s,l)=>{const c=Object.create(UA);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 ht.call(c,d,f,n,r,s),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 CH=null;function j0(e){return ce.isPlainObject(e)||ce.isArray(e)}function zA(e){return ce.endsWith(e,"[]")?e.slice(0,-2):e}function HR(e,t,n){return e?e.concat(t).map(function(s,l){return s=zA(s),!n&&l?"["+s+"]":s}).join(n?".":""):t}function EH(e){return ce.isArray(e)&&!e.some(j0)}const wH=ce.toFlatObject(ce,{},null,function(t){return/^is[A-Z]/.test(t)});function xg(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(E,S){return!ce.isUndefined(S[E])});const r=n.metaTokens,s=n.visitor||g,l=n.dots,c=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&ce.isSpecCompliantForm(t);if(!ce.isFunction(s))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 ht("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,E,S){let R=w;if(w&&!S&&typeof w=="object"){if(ce.endsWith(E,"{}"))E=r?E:E.slice(0,-2),w=JSON.stringify(w);else if(ce.isArray(w)&&EH(w)||(ce.isFileList(w)||ce.endsWith(E,"[]"))&&(R=ce.toArray(w)))return E=zA(E),R.forEach(function(_,D){!(ce.isUndefined(_)||_===null)&&t.append(c===!0?HR([E],D,l):c===null?E:E+"[]",h(_))}),!1}return j0(w)?!0:(t.append(HR(S,E,l),h(w)),!1)}const y=[],v=Object.assign(wH,{defaultVisitor:g,convertValue:h,isVisitable:j0});function b(w,E){if(!ce.isUndefined(w)){if(y.indexOf(w)!==-1)throw Error("Circular reference detected in "+E.join("."));y.push(w),ce.forEach(w,function(R,T){(!(ce.isUndefined(R)||R===null)&&s.call(t,R,ce.isString(T)?T.trim():T,E,v))===!0&&b(R,E?E.concat(T):[T])}),y.pop()}}if(!ce.isObject(e))throw new TypeError("data must be an object");return b(e),t}function BR(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function d1(e,t){this._pairs=[],e&&xg(e,this,t)}const VA=d1.prototype;VA.append=function(t,n){this._pairs.push([t,n])};VA.toString=function(t){const n=t?function(r){return t.call(this,r,BR)}:BR;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function RH(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function $A(e,t,n){if(!t)return e;const r=n&&n.encode||RH;ce.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let l;if(s?l=s(t,n):l=ce.isURLSearchParams(t)?t.toString():new d1(t,n).toString(r),l){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+l}return e}class GR{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 HA={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},TH=typeof URLSearchParams<"u"?URLSearchParams:d1,jH=typeof FormData<"u"?FormData:null,_H=typeof Blob<"u"?Blob:null,NH={isBrowser:!0,classes:{URLSearchParams:TH,FormData:jH,Blob:_H},protocols:["http","https","file","blob","url","data"]},f1=typeof window<"u"&&typeof document<"u",_0=typeof navigator=="object"&&navigator||void 0,AH=f1&&(!_0||["ReactNative","NativeScript","NS"].indexOf(_0.product)<0),DH=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",OH=f1&&window.location.href||"http://localhost",MH=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:f1,hasStandardBrowserEnv:AH,hasStandardBrowserWebWorkerEnv:DH,navigator:_0,origin:OH},Symbol.toStringTag,{value:"Module"})),Dr={...MH,...NH};function IH(e,t){return xg(e,new Dr.classes.URLSearchParams,{visitor:function(n,r,s,l){return Dr.isNode&&ce.isBuffer(n)?(this.append(r,n.toString("base64")),!1):l.defaultVisitor.apply(this,arguments)},...t})}function kH(e){return ce.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function LH(e){const t={},n=Object.keys(e);let r;const s=n.length;let l;for(r=0;r<s;r++)l=n[r],t[l]=e[l];return t}function BA(e){function t(n,r,s,l){let c=n[l++];if(c==="__proto__")return!0;const d=Number.isFinite(+c),f=l>=n.length;return c=!c&&ce.isArray(s)?s.length:c,f?(ce.hasOwnProp(s,c)?s[c]=[s[c],r]:s[c]=r,!d):((!s[c]||!ce.isObject(s[c]))&&(s[c]=[]),t(n,r,s[c],l)&&ce.isArray(s[c])&&(s[c]=LH(s[c])),!d)}if(ce.isFormData(e)&&ce.isFunction(e.entries)){const n={};return ce.forEachEntry(e,(r,s)=>{t(kH(r),s,n,0)}),n}return null}function PH(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 $f={transitional:HA,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,l=ce.isObject(t);if(l&&ce.isHTMLForm(t)&&(t=new FormData(t)),ce.isFormData(t))return s?JSON.stringify(BA(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 IH(t,this.formSerializer).toString();if((d=ce.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return xg(d?{"files[]":t}:t,f&&new f,this.formSerializer)}}return l||s?(n.setContentType("application/json",!1),PH(t)):t}],transformResponse:[function(t){const n=this.transitional||$f.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(ce.isResponse(t)||ce.isReadableStream(t))return t;if(t&&ce.isString(t)&&(r&&!this.responseType||s)){const c=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(d){if(c)throw d.name==="SyntaxError"?ht.from(d,ht.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:Dr.classes.FormData,Blob:Dr.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=>{$f.headers[e]={}});const UH=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"]),FH=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
486
|
-
`).forEach(function(c){s=c.indexOf(":"),n=c.substring(0,s).trim().toLowerCase(),r=c.substring(s+1).trim(),!(!n||t[n]&&UH[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},qR=Symbol("internals");function Id(e){return e&&String(e).trim().toLowerCase()}function Zm(e){return e===!1||e==null?e:ce.isArray(e)?e.map(Zm):String(e)}function zH(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 VH=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function _x(e,t,n,r,s){if(ce.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!ce.isString(t)){if(ce.isString(r))return t.indexOf(r)!==-1;if(ce.isRegExp(r))return r.test(t)}}function $H(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function HH(e,t){const n=ce.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,l,c){return this[r].call(this,t,s,l,c)},configurable:!0})})}let na=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function l(d,f,h){const g=Id(f);if(!g)throw new Error("header name must be a non-empty string");const y=ce.findKey(s,g);(!y||s[y]===void 0||h===!0||h===void 0&&s[y]!==!1)&&(s[y||f]=Zm(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())&&!VH(t))c(FH(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=Id(t),t){const r=ce.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return zH(s);if(ce.isFunction(n))return n.call(this,s,r);if(ce.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Id(t),t){const r=ce.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||_x(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function l(c){if(c=Id(c),c){const d=ce.findKey(r,c);d&&(!n||_x(r,r[d],d,n))&&(delete r[d],s=!0)}}return ce.isArray(t)?t.forEach(l):l(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const l=n[r];(!t||_x(this,this[l],l,t,!0))&&(delete this[l],s=!0)}return s}normalize(t){const n=this,r={};return ce.forEach(this,(s,l)=>{const c=ce.findKey(r,l);if(c){n[c]=Zm(s),delete n[l];return}const d=t?$H(l):String(l).trim();d!==l&&delete n[l],n[d]=Zm(s),r[d]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return ce.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=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(s=>r.set(s)),r}static accessor(t){const r=(this[qR]=this[qR]={accessors:{}}).accessors,s=this.prototype;function l(c){const d=Id(c);r[d]||(HH(s,c),r[d]=!0)}return ce.isArray(t)?t.forEach(l):l(t),this}};na.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ce.reduceDescriptors(na.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});ce.freezeMethods(na);function Nx(e,t){const n=this||$f,r=t||n,s=na.from(r.headers);let l=r.data;return ce.forEach(e,function(d){l=d.call(n,l,s.normalize(),t?t.status:void 0)}),s.normalize(),l}function GA(e){return!!(e&&e.__CANCEL__)}function ju(e,t,n){ht.call(this,e??"canceled",ht.ERR_CANCELED,t,n),this.name="CanceledError"}ce.inherits(ju,ht,{__CANCEL__:!0});function qA(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ht("Request failed with status code "+n.status,[ht.ERR_BAD_REQUEST,ht.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function BH(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function GH(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,l=0,c;return t=t!==void 0?t:1e3,function(f){const h=Date.now(),g=r[l];c||(c=h),n[s]=f,r[s]=h;let y=l,v=0;for(;y!==s;)v+=n[y++],y=y%e;if(s=(s+1)%e,s===l&&(l=(l+1)%e),h-c<t)return;const b=g&&h-g;return b?Math.round(v*1e3/b):void 0}}function qH(e,t){let n=0,r=1e3/t,s,l;const c=(h,g=Date.now())=>{n=g,s=null,l&&(clearTimeout(l),l=null),e(...h)};return[(...h)=>{const g=Date.now(),y=g-n;y>=r?c(h,g):(s=h,l||(l=setTimeout(()=>{l=null,c(s)},r-y)))},()=>s&&c(s)]}const pp=(e,t,n=3)=>{let r=0;const s=GH(50,250);return qH(l=>{const c=l.loaded,d=l.lengthComputable?l.total:void 0,f=c-r,h=s(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)},ZR=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},KR=e=>(...t)=>ce.asap(()=>e(...t)),ZH=Dr.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Dr.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Dr.origin),Dr.navigator&&/(msie|trident)/i.test(Dr.navigator.userAgent)):()=>!0,KH=Dr.hasStandardBrowserEnv?{write(e,t,n,r,s,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(s)&&d.push(`domain=${s}`),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 YH(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function WH(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ZA(e,t,n){let r=!YH(t);return e&&(r||n==!1)?WH(e,t):t}const YR=e=>e instanceof na?{...e}:e;function Dl(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 s(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)=>s(YR(h),YR(g),y,!0)};return ce.forEach(Object.keys({...e,...t}),function(g){const y=f[g]||s,v=y(e[g],t[g],g);ce.isUndefined(v)&&y!==d||(n[g]=v)}),n}const KA=e=>{const t=Dl({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:l,headers:c,auth:d}=t;if(t.headers=c=na.from(c),t.url=$A(ZA(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(Dr.hasStandardBrowserEnv||Dr.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(Dr.hasStandardBrowserEnv&&(r&&ce.isFunction(r)&&(r=r(t)),r||r!==!1&&ZH(t.url))){const f=s&&l&&KH.read(l);f&&c.set(s,f)}return t},QH=typeof XMLHttpRequest<"u",XH=QH&&function(e){return new Promise(function(n,r){const s=KA(e);let l=s.data;const c=na.from(s.headers).normalize();let{responseType:d,onUploadProgress:f,onDownloadProgress:h}=s,g,y,v,b,w;function E(){b&&b(),w&&w(),s.cancelToken&&s.cancelToken.unsubscribe(g),s.signal&&s.signal.removeEventListener("abort",g)}let S=new XMLHttpRequest;S.open(s.method.toUpperCase(),s.url,!0),S.timeout=s.timeout;function R(){if(!S)return;const _=na.from("getAllResponseHeaders"in S&&S.getAllResponseHeaders()),A={data:!d||d==="text"||d==="json"?S.responseText:S.response,status:S.status,statusText:S.statusText,headers:_,config:e,request:S};qA(function(j){n(j),E()},function(j){r(j),E()},A),S=null}"onloadend"in S?S.onloadend=R:S.onreadystatechange=function(){!S||S.readyState!==4||S.status===0&&!(S.responseURL&&S.responseURL.indexOf("file:")===0)||setTimeout(R)},S.onabort=function(){S&&(r(new ht("Request aborted",ht.ECONNABORTED,e,S)),S=null)},S.onerror=function(D){const A=D&&D.message?D.message:"Network Error",O=new ht(A,ht.ERR_NETWORK,e,S);O.event=D||null,r(O),S=null},S.ontimeout=function(){let D=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const A=s.transitional||HA;s.timeoutErrorMessage&&(D=s.timeoutErrorMessage),r(new ht(D,A.clarifyTimeoutError?ht.ETIMEDOUT:ht.ECONNABORTED,e,S)),S=null},l===void 0&&c.setContentType(null),"setRequestHeader"in S&&ce.forEach(c.toJSON(),function(D,A){S.setRequestHeader(A,D)}),ce.isUndefined(s.withCredentials)||(S.withCredentials=!!s.withCredentials),d&&d!=="json"&&(S.responseType=s.responseType),h&&([v,w]=pp(h,!0),S.addEventListener("progress",v)),f&&S.upload&&([y,b]=pp(f),S.upload.addEventListener("progress",y),S.upload.addEventListener("loadend",b)),(s.cancelToken||s.signal)&&(g=_=>{S&&(r(!_||_.type?new ju(null,e,S):_),S.abort(),S=null)},s.cancelToken&&s.cancelToken.subscribe(g),s.signal&&(s.signal.aborted?g():s.signal.addEventListener("abort",g)));const T=BH(s.url);if(T&&Dr.protocols.indexOf(T)===-1){r(new ht("Unsupported protocol "+T+":",ht.ERR_BAD_REQUEST,e));return}S.send(l||null)})},JH=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const l=function(h){if(!s){s=!0,d();const g=h instanceof Error?h:this.reason;r.abort(g instanceof ht?g:new ju(g instanceof Error?g.message:g))}};let c=t&&setTimeout(()=>{c=null,l(new ht(`timeout ${t} of ms exceeded`,ht.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}},eB=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},tB=async function*(e,t){for await(const n of nB(e))yield*eB(n,t)},nB=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()}},WR=(e,t,n,r)=>{const s=tB(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 s.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),s.return()}},{highWaterMark:2})},QR=64*1024,{isFunction:wm}=ce,rB=(({Request:e,Response:t})=>({Request:e,Response:t}))(ce.global),{ReadableStream:XR,TextEncoder:JR}=ce.global,eT=(e,...t)=>{try{return!!e(...t)}catch{return!1}},aB=e=>{e=ce.merge.call({skipUndefined:!0},rB,e);const{fetch:t,Request:n,Response:r}=e,s=t?wm(t):typeof fetch=="function",l=wm(n),c=wm(r);if(!s)return!1;const d=s&&wm(XR),f=s&&(typeof JR=="function"?(w=>E=>w.encode(E))(new JR):async w=>new Uint8Array(await new n(w).arrayBuffer())),h=l&&d&&eT(()=>{let w=!1;const E=new n(Dr.origin,{body:new XR,method:"POST",get duplex(){return w=!0,"half"}}).headers.has("Content-Type");return w&&!E}),g=c&&d&&eT(()=>ce.isReadableStream(new r("").body)),y={stream:g&&(w=>w.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(w=>{!y[w]&&(y[w]=(E,S)=>{let R=E&&E[w];if(R)return R.call(E);throw new ht(`Response type '${w}' is not supported`,ht.ERR_NOT_SUPPORT,S)})});const v=async w=>{if(w==null)return 0;if(ce.isBlob(w))return w.size;if(ce.isSpecCompliantForm(w))return(await new n(Dr.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,E)=>{const S=ce.toFiniteNumber(w.getContentLength());return S??v(E)};return async w=>{let{url:E,method:S,data:R,signal:T,cancelToken:_,timeout:D,onDownloadProgress:A,onUploadProgress:O,responseType:j,headers:M,withCredentials:F="same-origin",fetchOptions:G}=KA(w),Y=t||fetch;j=j?(j+"").toLowerCase():"text";let Z=JH([T,_&&_.toAbortSignal()],D),ee=null;const $=Z&&Z.unsubscribe&&(()=>{Z.unsubscribe()});let W;try{if(O&&h&&S!=="get"&&S!=="head"&&(W=await b(M,R))!==0){let L=new n(E,{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]=ZR(W,pp(KR(O)));R=WR(L.body,QR,q,te)}}ce.isString(F)||(F=F?"include":"omit");const k=l&&"credentials"in n.prototype,H={...G,signal:Z,method:S.toUpperCase(),headers:M.normalize().toJSON(),body:R,duplex:"half",credentials:k?F:void 0};ee=l&&new n(E,H);let B=await(l?Y(ee,G):Y(E,H));const ie=g&&(j==="stream"||j==="response");if(g&&(A||ie&&$)){const L={};["status","statusText","headers"].forEach(ue=>{L[ue]=B[ue]});const P=ce.toFiniteNumber(B.headers.get("content-length")),[q,te]=A&&ZR(P,pp(KR(A),!0))||[];B=new r(WR(B.body,QR,q,()=>{te&&te(),$&&$()}),L)}j=j||"text";let xe=await y[ce.findKey(y,j)||"text"](B,w);return!ie&&$&&$(),await new Promise((L,P)=>{qA(L,P,{data:xe,headers:na.from(B.headers),status:B.status,statusText:B.statusText,config:w,request:ee})})}catch(k){throw $&&$(),k&&k.name==="TypeError"&&/Load failed|fetch/i.test(k.message)?Object.assign(new ht("Network Error",ht.ERR_NETWORK,w,ee),{cause:k.cause||k}):ht.from(k,k&&k.code,w,ee)}}},sB=new Map,YA=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,l=[r,s,n];let c=l.length,d=c,f,h,g=sB;for(;d--;)f=l[d],h=g.get(f),h===void 0&&g.set(f,h=d?new Map:aB(t)),g=h;return h};YA();const h1={http:CH,xhr:XH,fetch:{get:YA}};ce.forEach(h1,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const tT=e=>`- ${e}`,oB=e=>ce.isFunction(e)||e===null||e===!1;function iB(e,t){e=ce.isArray(e)?e:[e];const{length:n}=e;let r,s;const l={};for(let c=0;c<n;c++){r=e[c];let d;if(s=r,!oB(r)&&(s=h1[(d=String(r)).toLowerCase()],s===void 0))throw new ht(`Unknown adapter '${d}'`);if(s&&(ce.isFunction(s)||(s=s.get(t))))break;l[d||"#"+c]=s}if(!s){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(tT).join(`
|
|
489
|
-
`):" "+tT(c[0]):"as no adapter specified";throw new ht("There is no suitable adapter to dispatch the request "+d,"ERR_NOT_SUPPORT")}return s}const WA={getAdapter:iB,adapters:h1};function Ax(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ju(null,e)}function nT(e){return Ax(e),e.headers=na.from(e.headers),e.data=Nx.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),WA.getAdapter(e.adapter||$f.adapter,e)(e).then(function(r){return Ax(e),r.data=Nx.call(e,e.transformResponse,r),r.headers=na.from(r.headers),r},function(r){return GA(r)||(Ax(e),r&&r.response&&(r.response.data=Nx.call(e,e.transformResponse,r.response),r.response.headers=na.from(r.response.headers))),Promise.reject(r)})}const QA="1.13.2",bg={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{bg[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const rT={};bg.transitional=function(t,n,r){function s(l,c){return"[Axios v"+QA+"] Transitional option '"+l+"'"+c+(r?". "+r:"")}return(l,c,d)=>{if(t===!1)throw new ht(s(c," has been removed"+(n?" in "+n:"")),ht.ERR_DEPRECATED);return n&&!rT[c]&&(rT[c]=!0,console.warn(s(c," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(l,c,d):!0}};bg.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function lB(e,t,n){if(typeof e!="object")throw new ht("options must be an object",ht.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const l=r[s],c=t[l];if(c){const d=e[l],f=d===void 0||c(d,l,e);if(f!==!0)throw new ht("option "+l+" must be "+f,ht.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ht("Unknown option "+l,ht.ERR_BAD_OPTION)}}const Km={assertOptions:lB,validators:bg},As=Km.validators;let Sl=class{constructor(t){this.defaults=t||{},this.interceptors={request:new GR,response:new GR}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const l=s.stack?s.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=Dl(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:l}=n;r!==void 0&&Km.assertOptions(r,{silentJSONParsing:As.transitional(As.boolean),forcedJSONParsing:As.transitional(As.boolean),clarifyTimeoutError:As.transitional(As.boolean)},!1),s!=null&&(ce.isFunction(s)?n.paramsSerializer={serialize:s}:Km.assertOptions(s,{encode:As.function,serialize:As.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Km.assertOptions(n,{baseUrl:As.spelling("baseURL"),withXsrfToken:As.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=na.concat(c,l);const d=[];let f=!0;this.interceptors.request.forEach(function(E){typeof E.runWhen=="function"&&E.runWhen(n)===!1||(f=f&&E.synchronous,d.unshift(E.fulfilled,E.rejected))});const h=[];this.interceptors.response.forEach(function(E){h.push(E.fulfilled,E.rejected)});let g,y=0,v;if(!f){const w=[nT.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++],E=d[y++];try{b=w(b)}catch(S){E.call(this,S);break}}try{g=nT.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=Dl(this.defaults,t);const n=ZA(t.baseURL,t.url,t.allowAbsoluteUrls);return $A(n,t.params,t.paramsSerializer)}};ce.forEach(["delete","get","head","options"],function(t){Sl.prototype[t]=function(n,r){return this.request(Dl(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(Dl(d||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:l,data:c}))}}Sl.prototype[t]=n(),Sl.prototype[t+"Form"]=n(!0)});let cB=class XA{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(s=>{if(!r._listeners)return;let l=r._listeners.length;for(;l-- >0;)r._listeners[l](s);r._listeners=null}),this.promise.then=s=>{let l;const c=new Promise(d=>{r.subscribe(d),l=d}).then(s);return c.cancel=function(){r.unsubscribe(l)},c},t(function(l,c,d){r.reason||(r.reason=new ju(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 XA(function(s){t=s}),cancel:t}}};function uB(e){return function(n){return e.apply(null,n)}}function dB(e){return ce.isObject(e)&&e.isAxiosError===!0}const N0={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(N0).forEach(([e,t])=>{N0[t]=e});function JA(e){const t=new Sl(e),n=AA(Sl.prototype.request,t);return ce.extend(n,Sl.prototype,t,{allOwnKeys:!0}),ce.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return JA(Dl(e,s))},n}const An=JA($f);An.Axios=Sl;An.CanceledError=ju;An.CancelToken=cB;An.isCancel=GA;An.VERSION=QA;An.toFormData=xg;An.AxiosError=ht;An.Cancel=An.CanceledError;An.all=function(t){return Promise.all(t)};An.spread=uB;An.isAxiosError=dB;An.mergeConfig=Dl;An.AxiosHeaders=na;An.formToJSON=e=>BA(ce.isHTMLForm(e)?new FormData(e):e);An.getAdapter=WA.getAdapter;An.HttpStatusCode=N0;An.default=An;const{Axios:tle,AxiosError:aT,CanceledError:nle,isCancel:rle,CancelToken:ale,VERSION:sle,all:ole,Cancel:ile,isAxiosError:lle,spread:cle,toFormData:ule,AxiosHeaders:fB,HttpStatusCode:dle,formToJSON:fle,getAdapter:hle,mergeConfig:mle}=An;function hB(e){return{id:e.userId,email:e.email,fullName:e.fullName,roles:e.roles,projectId:e.projectId,projectTitle:e.projectTitle,avatar:e.avatar}}const hu={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 mB(e){if(e&&typeof e=="object"&&"response"in e){const n=e,{status:r,data:s}=n.response;switch(r){case 401:return{message:(s==null?void 0:s.message)??"Invalid credentials or session expired",code:"UNAUTHORIZED",statusCode:401};case 403:return{message:(s==null?void 0:s.message)??"Access forbidden",code:"FORBIDDEN",statusCode:403};case 422:return{message:(s==null?void 0:s.message)??"Invalid request data",code:"VALIDATION_ERROR",statusCode:422};default:return{message:(s==null?void 0:s.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 m1=An.create({baseURL:"/",timeout:3e4,headers:{"Content-Type":"application/json",Accept:"application/json"},withCredentials:!0});function pB(){const e=window.location.pathname+window.location.search,t=new URL(hu.SIGN_IN,window.location.origin);e.startsWith("/auth/")||t.searchParams.set("redirect",e),window.location.href=t.toString()}function gB(){const e=new URL(hu.SIGN_OUT,window.location.origin);e.searchParams.set("redirect",hu.SIGN_IN),window.location.href=e.toString()}async function yB(){try{return(await m1.post(hu.ACCESS_TOKEN,{})).data}catch(e){const t=mB(e);throw new Error(t.message)}}async function vB(e){const t=await m1.get(hu.API_USER,{headers:{"X-OWOX-Authorization":`Bearer ${e}`}});return hB(t.data)}async function xB(e){return(await m1.get(hu.API_PROJECTS,{headers:{"X-OWOX-Authorization":`Bearer ${e}`}})).data}const e4=p.createContext(null);class bB{constructor(t,n){Ns(this,"getToken");Ns(this,"refreshFn");this.getToken=t,this.refreshFn=n}getAccessToken(){return this.getToken()}async refreshToken(){return await this.refreshFn()}}let p1=null;function SB(e){p1=e}function g1(){return p1}function Rm(){p1=null}const CB=()=>{typeof window<"u"&&!window.dataLayer&&(window.dataLayer=[])},Pe=e=>{e.timestamp=e.timestamp??Date.now(),e.eventType=e.eventType??"app",t4(e)},EB=e=>{Pe({event:"system_user_identified",eventType:"system",category:"UserSession",action:"Identified",...e})},wB=()=>{Pe({event:"system_user_logged_out",eventType:"system",category:"UserSession",action:"Logout"})},t4=e=>{var t;if(typeof window<"u"){CB();try{(t=window.dataLayer)==null||t.push(e)}catch(n){console.error("Failed to push data to dataLayer",n)}}};function RB(e,t){switch(t.type){case"SET_LOADING":return{...e,status:Or.LOADING,error:void 0};case"SET_AUTHENTICATED":return{...e,status:Or.AUTHENTICATED,session:t.payload.session,error:void 0};case"SET_UNAUTHENTICATED":return{...e,status:Or.UNAUTHENTICATED,session:null,error:void 0};case"SET_USER":return{...e,user:t.payload.user};case"SET_ERROR":return{...e,status:Or.ERROR,error:t.payload};case"CLEAR_ERROR":return{...e,error:void 0};default:return e}}const TB={status:Or.LOADING,session:null,user:null};function jB({children:e}){var g;const[t,n]=p.useReducer(RB,TB);p.useEffect(()=>{var y;if((y=t.session)!=null&&y.accessToken){const v=new bB(()=>{var b;return((b=t.session)==null?void 0:b.accessToken)??null},async()=>await s());SB(v)}else Rm()},[(g=t.session)==null?void 0:g.accessToken]);const r=p.useCallback(()=>{pB()},[]);async function s(){try{const v=(await yB()).accessToken;if(!v)throw new Error("Invalid token received");const b={accessToken:v},w=await vB(v);return n({type:"SET_USER",payload:{user:w}}),n({type:"SET_AUTHENTICATED",payload:{session:b}}),v}catch(y){throw Rm(),n({type:"SET_UNAUTHENTICATED"}),y}}const l=p.useCallback(async()=>{await s()},[]),c=p.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),Rm(),n({type:"SET_UNAUTHENTICATED"})}},[l,r]),d=p.useCallback(()=>{try{wB()}finally{gB()}},[]),f=p.useCallback(()=>{n({type:"CLEAR_ERROR"})},[]);p.useEffect(()=>{c()},[c]),p.useEffect(()=>{t.user&&(t4({projectId:t.user.projectId}),EB({userId:t.user.id,userEmail:t.user.email,userFullName:t.user.fullName}))},[t.user]),p.useEffect(()=>{const y=()=>{d()};return window.addEventListener("auth:logout",y),()=>{window.removeEventListener("auth:logout",y),Rm()}},[d]);const h={...t,signIn:r,signOut:d,refreshToken:l,clearError:f};return o.jsx(e4.Provider,{value:h,children:e})}function Vi(){const e=p.useContext(e4);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function n4(){const{status:e,session:t,user:n,error:r}=Vi();return{status:e,session:t,user:n,error:r,isLoading:e===Or.LOADING,isAuthenticated:e===Or.AUTHENTICATED,isUnauthenticated:e===Or.UNAUTHENTICATED,hasError:e===Or.ERROR}}function _B(){const{user:e}=Vi();return e}function tu({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"},s=e?"flex h-screen items-center justify-center":"flex items-center justify-center p-4";return o.jsx("div",{className:s,children:o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:` ${r[t]} mx-auto mb-4 animate-spin rounded-full border-gray-300 border-t-blue-600`}),n&&o.jsx("p",{className:"text-sm text-gray-600",children:n})]})})}function sT({message:e}){return o.jsx(tu,{fullScreen:!0,message:e})}function oT(){return o.jsx("div",{className:"flex h-screen items-center justify-center",children:o.jsxs("div",{className:"text-center",children:[o.jsx("h2",{className:"mb-4 text-2xl font-bold text-gray-900",children:"Authentication Required"}),o.jsx("p",{className:"mb-6 text-gray-600",children:"You need to sign in to access this page."}),o.jsx(Se,{onClick:()=>window.location.href="/api/auth/sign-in",children:"Sign In"})]})})}function NB({children:e,fallback:t,redirectTo:n}){const{isLoading:r,isAuthenticated:s,isUnauthenticated:l}=n4();return r?o.jsx(sT,{}):s?o.jsx(o.Fragment,{children:e}):l?n?(window.location.href=n,o.jsx(sT,{})):t?o.jsx(o.Fragment,{children:t}):o.jsx(oT,{}):t?o.jsx(o.Fragment,{children:t}):o.jsx(oT,{})}const r4=p.createContext(null);function a4(){const e=p.useContext(r4);if(!e)throw new Error("useProjects must be used within a ProjectsProvider");return e}const AB="/ui",DB=()=>AB,gp=(e,t)=>{const n=DB(),r=t.startsWith("/")?t:`/${t}`;return`${n}/${e}${r}`};function OB(){const{projects:e,loadProjects:t,error:n,isLoading:r}=a4(),{user:s}=Vi();return o.jsxs(o1,{children:[o.jsx(Ka,{}),o.jsxs(i1,{className:"flex items-center gap-2",children:[o.jsx(f9,{className:"h-4 w-4"}),"Switch project"]}),o.jsx(O$,{children:o.jsxs(l1,{children:[r&&o.jsx(vt,{disabled:!0,children:o.jsxs("span",{className:"flex items-center gap-2",children:[o.jsx(Rf,{className:"h-4 w-4 animate-spin"})," Loading projects..."]})}),!r&&n&&o.jsxs(o.Fragment,{children:[o.jsx(vt,{disabled:!0,children:"Unable to load projects. Please try again."}),o.jsx(vt,{onClick:()=>void t(),children:"Retry"})]}),!r&&!n&&e.map(l=>{const c=l.id===(s==null?void 0:s.projectId);return o.jsx(vt,{asChild:!0,children:o.jsxs(Cf,{to:gp(encodeURIComponent(l.id),"/"),className:"flex items-center gap-2",children:[c?o.jsx(fr,{className:"h-4 w-4"}):o.jsx("span",{className:"h-4 w-4"}),l.title]})},l.id)})]})})]})}function MB(){return o.jsx(OB,{})}const IB=({className:e,size:t=24})=>o.jsx("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:o.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"})}),s4=({className:e,size:t=24})=>o.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:[o.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"}),o.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"}),o.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"}),o.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"}),o.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"}),o.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"}),o.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"})]}),o4=({className:e,size:t=24})=>o.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:[o.jsx("path",{d:"M48 29.0142L24 26.0256L0 29.0142L24 48L48 29.0142Z",fill:"#FCBF92"}),o.jsx("path",{d:"M0 29.0142L24 36.2676V48L0 35.8398V29.0142Z",fill:"#9D5025"}),o.jsx("path",{d:"M48 29.0142L24 36.2676V48L48 35.8398V29.0142Z",fill:"#F58534"}),o.jsx("path",{d:"M3.099 18.7008H0V25.5978L3.099 26.1684L6.5436 22.4742L3.099 18.7014V18.7008Z",fill:"#9D5025"}),o.jsx("path",{d:"M6.54421 25.8828L3.09961 26.1678V18.7008H6.54421V25.8828Z",fill:"#F58534"}),o.jsx("path",{d:"M8.86613 10.0992L4.78613 10.8768V26.5248L8.86613 27.3804L12.6005 18.7002L8.86613 10.0986V10.0992Z",fill:"#9D5025"}),o.jsx("path",{d:"M12.6 26.9526L8.86621 27.3804V10.0992L12.6 10.527V26.9526Z",fill:"#F58534"}),o.jsx("path",{d:"M16.8213 13.5798L11.1885 14.1504V27.873L16.8213 29.0142L22.8003 21.261L16.8213 13.5798Z",fill:"#9D5025"}),o.jsx("path",{d:"M20.6187 28.3722L16.8213 29.0142V13.5798L20.6187 13.8648V28.3722Z",fill:"#F58534"}),o.jsx("path",{d:"M23.9995 1.134L20.2021 2.3466V29.6562L23.9995 30.4332L27.7969 15.7836L23.9995 1.134Z",fill:"#9D5025"}),o.jsx("path",{d:"M27.5156 28.3722L31.1792 29.0142L36.812 18.7008L31.1792 8.4588L27.5156 9.0294V28.3722Z",fill:"#9D5025"}),o.jsx("path",{d:"M36.812 18.7008L31.1792 8.4588L27.5156 9.0294",fill:"#9D5025"}),o.jsx("path",{d:"M35.3281 26.9532L39.1327 27.381L43.2127 14.3646L39.1327 1.4196L35.3281 2.3466V26.9532Z",fill:"#9D5025"}),o.jsx("path",{d:"M41.4551 25.8828L44.8997 26.1678L47.9987 13.2948L44.8997 0L41.4551 0.8556V25.8828Z",fill:"#9D5025"}),o.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"})]}),i4=({className:e,size:t=24})=>o.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:[o.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"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28 14H42V24L28 14Z",fill:"#007944"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28 0V13.9683L42 14L28 0Z",fill:"#64C3A7"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 42L12.0563 22H36V42H12ZM34 24H14V40H34V24Z",fill:"white"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 22H22V42H20V22Z",fill:"white"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36 28V30H12V28H36Z",fill:"white"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36 34V36H12V34H36Z",fill:"white"})]}),kB=({className:e,size:t=24})=>o.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:[o.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"}),o.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"}),o.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"}),o.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"})]}),LB=({className:e,size:t=24})=>o.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:[o.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"}),o.jsx("path",{d:"M11 11H23V14H11V11Z",fill:"white"}),o.jsx("path",{d:"M11 16H23V19H11V16Z",fill:"white"}),o.jsx("path",{d:"M11 21H23V24H11V21Z",fill:"white"}),o.jsx("path",{d:"M11 26H23V29H11V26Z",fill:"white"}),o.jsx("path",{d:"M25 11H37V14H25V11Z",fill:"white"}),o.jsx("path",{d:"M25 16H37V19H25V16Z",fill:"white"}),o.jsx("path",{d:"M25 21H37V24H25V21Z",fill:"white"}),o.jsx("path",{d:"M25 26H37V29H25V26Z",fill:"white"}),o.jsx("path",{d:"M25 31H37V34H25V31Z",fill:"white"}),o.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"})]}),PB=({className:e,size:t=24})=>o.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:[o.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"}),o.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"}),o.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"}),o.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"}),o.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"}),o.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"}),o.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"})]}),UB=({className:e,size:t=24})=>o.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:o.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"})}),FB=({className:e,size:t=24})=>o.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:[o.jsx("path",{d:"M2 8.48783L5.5122 7.02441V40.9756L2 39.5122V8.48783Z",fill:"#205B98"}),o.jsx("path",{d:"M5.51172 7.02441L12.2434 8.48783V39.5122L5.51172 40.9756V7.02441Z",fill:"#5294CF"}),o.jsx("path",{d:"M12.2441 3.5122L18 0V48L12.2441 44.4878V3.5122Z",fill:"#205B98"}),o.jsx("path",{d:"M18 0H30V48H18V0Z",fill:"#2D72B8"}),o.jsx("path",{d:"M35.3665 3.5122L30 0V48L35.3665 44.4878V3.5122Z",fill:"#5294CF"}),o.jsx("path",{d:"M45.6099 8.48783L42.0977 7.02441V40.9756L45.6099 39.5122V8.48783Z",fill:"#5294CF"}),o.jsx("path",{d:"M42.0969 7.02441L35.3652 8.48783V39.5122L42.0969 40.9756V7.02441Z",fill:"#205B98"})]}),zB=({className:e,size:t=24})=>o.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:[o.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"}),o.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)"}),o.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"}),o.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)"}),o.jsxs("defs",{children:[o.jsxs("linearGradient",{id:"paint0_linear_19_1262",x1:"23.9333",y1:"14.3467",x2:"23.9333",y2:"0",gradientUnits:"userSpaceOnUse",children:[o.jsx("stop",{offset:"0.199","stop-color":"#005BA1"}),o.jsx("stop",{offset:"1","stop-color":"#0078D4"})]}),o.jsxs("linearGradient",{id:"paint1_linear_19_1262",x1:"23.9333",y1:"33.9014",x2:"23.9333",y2:"14.0987",gradientUnits:"userSpaceOnUse",children:[o.jsx("stop",{"stop-color":"#198AB3"}),o.jsx("stop",{offset:"0.172","stop-color":"#32BEDD"}),o.jsx("stop",{offset:"0.5","stop-color":"#198AB3"}),o.jsx("stop",{offset:"0.662","stop-color":"#32BEDD"}),o.jsx("stop",{offset:"0.975","stop-color":"#50E6FF"})]})]})]}),_u=({className:e="",size:t=24,base64:n})=>o.jsx("img",{src:n??void 0,alt:"icon",className:`max-w-none ${e}`,style:{width:t,height:t}}),VB=({className:e,size:t=24})=>o.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[o.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"}),o.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"}),o.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"})]}),$B=({className:e,size:t=24})=>o.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("rect",{fill:"currentColor",width:"3",height:"8",x:"13",y:"2",rx:"1.5"}),o.jsx("path",{fill:"currentColor",d:"M19 8.5V10h1.5A1.5 1.5 0 1 0 19 8.5"}),o.jsx("rect",{fill:"currentColor",width:"3",height:"8",x:"8",y:"14",rx:"1.5"}),o.jsx("path",{fill:"currentColor",d:"M5 15.5V14H3.5A1.5 1.5 0 1 0 5 15.5"}),o.jsx("rect",{fill:"currentColor",width:"8",height:"3",x:"14",y:"13",rx:"1.5"}),o.jsx("path",{fill:"currentColor",d:"M15.5 19H14v1.5a1.5 1.5 0 1 0 1.5-1.5"}),o.jsx("rect",{fill:"currentColor",width:"8",height:"3",x:"2",y:"8",rx:"1.5"}),o.jsx("path",{fill:"currentColor",d:"M8.5 5H10V3.5A1.5 1.5 0 1 0 8.5 5"})]}),HB=({className:e,size:t=24})=>o.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:[o.jsx("path",{d:"M16 16H22",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),o.jsx("path",{d:"M19 13V19",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),o.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"}),o.jsx("path",{d:"M3.28906 7L11.9991 12L20.7091 7",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),o.jsx("path",{d:"M12 22V12",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"})]}),BB=({className:e,size:t=24})=>o.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:[o.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"}),o.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"})]}),GB=({className:e,size:t=24})=>o.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:[o.jsx("rect",{x:"2",y:"2",width:"20",height:"20",fill:"white"}),o.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"})]}),qB=({className:e,size:t=24})=>o.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:[o.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"}),o.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"}),o.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"}),o.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"})]}),ZB=({className:e,size:t=24})=>o.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:[o.jsx("path",{d:"M2 2H11.5V11.5H2V2Z",fill:"#F25022"}),o.jsx("path",{d:"M12.5 2H22V11.5H12.5V2Z",fill:"#7FBA00"}),o.jsx("path",{d:"M2 12.5H11.5V22H2V12.5Z",fill:"#00A4EF"}),o.jsx("path",{d:"M12.5 12.5H22V22H12.5V12.5Z",fill:"#FFB900"})]});function $i({className:e,...t}){return o.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 l4({value:e,onChange:t,keysToMask:n=[],className:r,minHeightClass:s="min-h-[150px]",displayOnly:l=!1,showCopyButton:c=!1}){const d=(S,R)=>{if(!S||R.length===0)return!1;try{const T=JSON.parse(S),_=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 _(T)}catch{return!1}},f=l?!1:!e||n.length===0||!d(e,n),[h,g]=p.useState(f),[y,v]=p.useState(!1);p.useEffect(()=>{l?g(!1):(!e||n.length===0||!d(e,n))&&g(!0)},[e,n,l]),p.useEffect(()=>{if(y){const S=setTimeout(()=>{v(!1)},2e3);return()=>{clearTimeout(S)}}},[y]);const b=()=>{navigator.clipboard.writeText(e),v(!0)},w=S=>{if(!S)return"";try{const R=JSON.parse(S),T=A=>{if(typeof A!="object"||A===null)return A;const O=Array.isArray(A)?[...A]:{...A};return Array.isArray(O)?O.forEach((j,M)=>{typeof j=="object"&&j!==null&&(O[M]=T(j))}):Object.entries(O).forEach(([j,M])=>{if(n.includes(j))if(typeof M=="string"){const F=M.length;F>30?O[j]="*".repeat(Math.min(20,Math.ceil(F/3))):F>10?O[j]="*".repeat(Math.min(10,Math.ceil(F/2))):O[j]="*".repeat(F)}else O[j]="***";else typeof M=="object"&&M!==null&&(O[j]=T(M))}),O},D=T(typeof R=="object"?R:{});return JSON.stringify(D,null,2)}catch{return S}},E=e&&n.length>0&&d(e,n);return o.jsxs("div",{className:"relative",children:[!h&&E&&!l&&o.jsx(fs,{children:o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx("div",{className:"absolute top-2 left-2 z-10",children:o.jsx(yL,{className:"h-4 w-4 text-gray-500"})})}),o.jsx(Et,{children:o.jsx("p",{children:"Content is locked in masked mode. Click the eye icon to enable editing."})})]})}),l?o.jsx("div",{className:`p-2 font-mono ${r??""} ${s} cursor-not-allowed whitespace-pre-wrap opacity-70`,children:w(e)}):o.jsx($i,{value:h?e:w(e),onChange:S=>{(h||!E)&&t&&t(S.target.value)},onFocus:S=>{!h&&E&&S.target.blur()},readOnly:!!(!h&&E),className:`font-mono ${r??""} ${!h&&E?"cursor-not-allowed opacity-70":""} ${s}`,rows:8}),E&&!l&&o.jsx(Se,{type:"button",variant:"ghost",className:"absolute top-2 right-2",onClick:()=>{g(!h)},children:h?o.jsx(fs,{children:o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(X9,{className:"h-4 w-4"}),o.jsx("span",{className:"text-xs",children:"Mask & Lock"})]})}),o.jsx(Et,{children:o.jsx("p",{children:"Mask sensitive data and lock editing"})})]})}):o.jsx(fs,{children:o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(u_,{className:"h-4 w-4"}),o.jsx("span",{className:"text-xs",children:"Show & Edit"})]})}),o.jsx(Et,{children:o.jsx("p",{children:"Show sensitive data and enable editing"})})]})})}),c&&o.jsx(Se,{type:"button",variant:"ghost",className:`absolute ${E&&!l?"top-2 right-24":"top-2 right-2"}`,onClick:b,children:o.jsx(fs,{children:o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx("div",{className:"flex items-center gap-1",children:y?o.jsxs(o.Fragment,{children:[o.jsx(fr,{className:"h-4 w-4"}),o.jsx("span",{className:"text-xs",children:"Copied!"})]}):o.jsxs(o.Fragment,{children:[o.jsx(sf,{className:"h-4 w-4"}),o.jsx("span",{className:"text-xs",children:"Copy"})]})})}),o.jsx(Et,{children:o.jsx("p",{children:"Copy content to clipboard"})})]})})})]})}var It;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function n(s){throw new Error}e.assertNever=n,e.arrayToEnum=s=>{const l={};for(const c of s)l[c]=c;return l},e.getValidEnumValues=s=>{const l=e.objectKeys(s).filter(d=>typeof s[s[d]]!="number"),c={};for(const d of l)c[d]=s[d];return e.objectValues(c)},e.objectValues=s=>e.objectKeys(s).map(function(l){return s[l]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const l=[];for(const c in s)Object.prototype.hasOwnProperty.call(s,c)&&l.push(c);return l},e.find=(s,l)=>{for(const c of s)if(l(c))return c},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,l=" | "){return s.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}e.joinValues=r,e.jsonStringifyReplacer=(s,l)=>typeof l=="bigint"?l.toString():l})(It||(It={}));var iT;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(iT||(iT={}));const $e=It.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),pi=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=It.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 Io 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:[]},s=l=>{for(const c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(s);else if(c.code==="invalid_return_type")s(c.returnTypeError);else if(c.code==="invalid_arguments")s(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 s(this),r}static assert(t){if(!(t instanceof Io))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,It.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const s of this.issues)if(s.path.length>0){const l=s.path[0];n[l]=n[l]||[],n[l].push(t(s))}else r.push(t(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Io.create=e=>new Io(e);const A0=(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,It.jsonStringifyReplacer)}`;break;case Ce.unrecognized_keys:n=`Unrecognized key(s) in object: ${It.joinValues(e.keys,", ")}`;break;case Ce.invalid_union:n="Invalid input";break;case Ce.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${It.joinValues(e.options)}`;break;case Ce.invalid_enum_value:n=`Invalid enum value. Expected ${It.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}"`:It.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,It.assertNever(e)}return{message:n}};let KB=A0;function YB(){return KB}const WB=e=>{const{data:t,path:n,errorMaps:r,issueData:s}=e,l=[...n,...s.path||[]],c={...s,path:l};if(s.message!==void 0)return{...s,path:l,message:s.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{...s,path:l,message:d}};function De(e,t){const n=YB(),r=WB({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===A0?void 0:A0].filter(s=>!!s)});e.common.issues.push(r)}class $r{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 s of n){if(s.status==="aborted")return it;s.status==="dirty"&&t.dirty(),r.push(s.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const s of n){const l=await s.key,c=await s.value;r.push({key:l,value:c})}return $r.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const s of n){const{key:l,value:c}=s;if(l.status==="aborted"||c.status==="aborted")return it;l.status==="dirty"&&t.dirty(),c.status==="dirty"&&t.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||s.alwaysSet)&&(r[l.value]=c.value)}return{status:t.value,value:r}}}const it=Object.freeze({status:"aborted"}),Gd=e=>({status:"dirty",value:e}),Ja=e=>({status:"valid",value:e}),lT=e=>e.status==="aborted",cT=e=>e.status==="dirty",mu=e=>e.status==="valid",yp=e=>typeof Promise<"u"&&e instanceof Promise;var Xe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Xe||(Xe={}));class $s{constructor(t,n,r,s){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=s}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 uT=(e,t)=>{if(mu(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 Io(e.common.issues);return this._error=n,this._error}}};function pt(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:s}=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:s}:{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:s}}class Tt{get description(){return this._def.description}_getType(t){return pi(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:pi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new $r,ctx:{common:t.parent.common,data:t.data,parsedType:pi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(yp(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:pi(t)},s=this._parseSync({data:t,path:r.path,parent:r});return uT(r,s)}"~validate"(t){var r,s;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:pi(t)};if(!this["~standard"].async)try{const l=this._parseSync({data:t,path:[],parent:n});return mu(l)?{value:l.value}:{issues:n.common.issues}}catch(l){(s=(r=l==null?void 0:l.message)==null?void 0:r.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(l=>mu(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:pi(t)},s=this._parse({data:t,path:r.path,parent:r}),l=await(yp(s)?s:Promise.resolve(s));return uT(r,l)}refine(t,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,l)=>{const c=t(s),d=()=>l.addIssue({code:Ce.custom,...r(s)});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,s)=>t(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(t){return new Il({schema:this,typeName:lt.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 jo.create(this,this._def)}nullable(){return kl.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Us.create(this)}promise(){return Rp.create(this,this._def)}or(t){return bp.create([this,t],this._def)}and(t){return Sp.create(this,t,this._def)}transform(t){return new Il({...pt(this._def),schema:this,typeName:lt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Tp({...pt(this._def),innerType:this,defaultValue:n,typeName:lt.ZodDefault})}brand(){return new f4({typeName:lt.ZodBranded,type:this,...pt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new jp({...pt(this._def),innerType:this,catchValue:n,typeName:lt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return v1.create(this,t)}readonly(){return _p.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const QB=/^c[^\s-]{8,}$/i,XB=/^[0-9a-z]+$/,JB=/^[0-9A-HJKMNP-TV-Z]{26}$/i,eG=/^[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,nG=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,rG=/^[-+]?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,sG="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Dx;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])$/,iG=/^(?:(?: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])$/,lG=/^(([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]))$/,cG=/^(([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])$/,uG=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dG=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,c4="((\\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])))",fG=new RegExp(`^${c4}$`);function u4(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 hG(e){return new RegExp(`^${u4(e)}$`)}function mG(e){let t=`${c4}T${u4(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 pG(e,t){return!!((t==="v4"||!t)&&oG.test(e)||(t==="v6"||!t)&&lG.test(e))}function gG(e,t){if(!nG.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,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function yG(e,t){return!!((t==="v4"||!t)&&iG.test(e)||(t==="v6"||!t)&&cG.test(e))}class Ro extends Tt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==$e.string){const l=this._getOrReturnCtx(t);return De(l,{code:Ce.invalid_type,expected:$e.string,received:l.parsedType}),it}const r=new $r;let s;for(const l of this._def.checks)if(l.kind==="min")t.data.length<l.value&&(s=this._getOrReturnCtx(t,s),De(s,{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&&(s=this._getOrReturnCtx(t,s),De(s,{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)&&(s=this._getOrReturnCtx(t,s),c?De(s,{code:Ce.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):d&&De(s,{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)||(s=this._getOrReturnCtx(t,s),De(s,{validation:"email",code:Ce.invalid_string,message:l.message}),r.dirty());else if(l.kind==="emoji")Dx||(Dx=new RegExp(sG,"u")),Dx.test(t.data)||(s=this._getOrReturnCtx(t,s),De(s,{validation:"emoji",code:Ce.invalid_string,message:l.message}),r.dirty());else if(l.kind==="uuid")eG.test(t.data)||(s=this._getOrReturnCtx(t,s),De(s,{validation:"uuid",code:Ce.invalid_string,message:l.message}),r.dirty());else if(l.kind==="nanoid")tG.test(t.data)||(s=this._getOrReturnCtx(t,s),De(s,{validation:"nanoid",code:Ce.invalid_string,message:l.message}),r.dirty());else if(l.kind==="cuid")QB.test(t.data)||(s=this._getOrReturnCtx(t,s),De(s,{validation:"cuid",code:Ce.invalid_string,message:l.message}),r.dirty());else if(l.kind==="cuid2")XB.test(t.data)||(s=this._getOrReturnCtx(t,s),De(s,{validation:"cuid2",code:Ce.invalid_string,message:l.message}),r.dirty());else if(l.kind==="ulid")JB.test(t.data)||(s=this._getOrReturnCtx(t,s),De(s,{validation:"ulid",code:Ce.invalid_string,message:l.message}),r.dirty());else if(l.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),De(s,{validation:"url",code:Ce.invalid_string,message:l.message}),r.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),De(s,{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)||(s=this._getOrReturnCtx(t,s),De(s,{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)||(s=this._getOrReturnCtx(t,s),De(s,{code:Ce.invalid_string,validation:{startsWith:l.value},message:l.message}),r.dirty()):l.kind==="endsWith"?t.data.endsWith(l.value)||(s=this._getOrReturnCtx(t,s),De(s,{code:Ce.invalid_string,validation:{endsWith:l.value},message:l.message}),r.dirty()):l.kind==="datetime"?mG(l).test(t.data)||(s=this._getOrReturnCtx(t,s),De(s,{code:Ce.invalid_string,validation:"datetime",message:l.message}),r.dirty()):l.kind==="date"?fG.test(t.data)||(s=this._getOrReturnCtx(t,s),De(s,{code:Ce.invalid_string,validation:"date",message:l.message}),r.dirty()):l.kind==="time"?hG(l).test(t.data)||(s=this._getOrReturnCtx(t,s),De(s,{code:Ce.invalid_string,validation:"time",message:l.message}),r.dirty()):l.kind==="duration"?rG.test(t.data)||(s=this._getOrReturnCtx(t,s),De(s,{validation:"duration",code:Ce.invalid_string,message:l.message}),r.dirty()):l.kind==="ip"?pG(t.data,l.version)||(s=this._getOrReturnCtx(t,s),De(s,{validation:"ip",code:Ce.invalid_string,message:l.message}),r.dirty()):l.kind==="jwt"?gG(t.data,l.alg)||(s=this._getOrReturnCtx(t,s),De(s,{validation:"jwt",code:Ce.invalid_string,message:l.message}),r.dirty()):l.kind==="cidr"?yG(t.data,l.version)||(s=this._getOrReturnCtx(t,s),De(s,{validation:"cidr",code:Ce.invalid_string,message:l.message}),r.dirty()):l.kind==="base64"?uG.test(t.data)||(s=this._getOrReturnCtx(t,s),De(s,{validation:"base64",code:Ce.invalid_string,message:l.message}),r.dirty()):l.kind==="base64url"?dG.test(t.data)||(s=this._getOrReturnCtx(t,s),De(s,{validation:"base64url",code:Ce.invalid_string,message:l.message}),r.dirty()):It.assertNever(l);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(s=>t.test(s),{validation:n,code:Ce.invalid_string,...Xe.errToObj(r)})}_addCheck(t){return new Ro({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Xe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Xe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Xe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Xe.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Xe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Xe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Xe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Xe.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Xe.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Xe.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Xe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Xe.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Xe.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,...Xe.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,...Xe.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Xe.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Xe.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Xe.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Xe.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Xe.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Xe.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Xe.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Xe.errToObj(n)})}nonempty(t){return this.min(1,Xe.errToObj(t))}trim(){return new Ro({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ro({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ro({...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}}Ro.create=e=>new Ro({checks:[],typeName:lt.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...pt(e)});function vG(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r,l=Number.parseInt(e.toFixed(s).replace(".","")),c=Number.parseInt(t.toFixed(s).replace(".",""));return l%c/10**s}class pu extends Tt{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 De(l,{code:Ce.invalid_type,expected:$e.number,received:l.parsedType}),it}let r;const s=new $r;for(const l of this._def.checks)l.kind==="int"?It.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),De(r,{code:Ce.invalid_type,expected:"integer",received:"float",message:l.message}),s.dirty()):l.kind==="min"?(l.inclusive?t.data<l.value:t.data<=l.value)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ce.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?t.data>l.value:t.data>=l.value)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ce.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="multipleOf"?vG(t.data,l.value)!==0&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ce.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):l.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),De(r,{code:Ce.not_finite,message:l.message}),s.dirty()):It.assertNever(l);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Xe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Xe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Xe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Xe.toString(n))}setLimit(t,n,r,s){return new pu({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Xe.toString(s)}]})}_addCheck(t){return new pu({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Xe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Xe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Xe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Xe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Xe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Xe.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Xe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Xe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Xe.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"&&It.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)}}pu.create=e=>new pu({checks:[],typeName:lt.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...pt(e)});class hf extends Tt{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 s=new $r;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),De(r,{code:Ce.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?t.data>l.value:t.data>=l.value)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ce.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="multipleOf"?t.data%l.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ce.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):It.assertNever(l);return{status:s.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return De(n,{code:Ce.invalid_type,expected:$e.bigint,received:n.parsedType}),it}gte(t,n){return this.setLimit("min",t,!0,Xe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Xe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Xe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Xe.toString(n))}setLimit(t,n,r,s){return new hf({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Xe.toString(s)}]})}_addCheck(t){return new hf({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Xe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Xe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Xe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Xe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Xe.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}}hf.create=e=>new hf({checks:[],typeName:lt.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...pt(e)});class D0 extends Tt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==$e.boolean){const r=this._getOrReturnCtx(t);return De(r,{code:Ce.invalid_type,expected:$e.boolean,received:r.parsedType}),it}return Ja(t.data)}}D0.create=e=>new D0({typeName:lt.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...pt(e)});class vp extends Tt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==$e.date){const l=this._getOrReturnCtx(t);return De(l,{code:Ce.invalid_type,expected:$e.date,received:l.parsedType}),it}if(Number.isNaN(t.data.getTime())){const l=this._getOrReturnCtx(t);return De(l,{code:Ce.invalid_date}),it}const r=new $r;let s;for(const l of this._def.checks)l.kind==="min"?t.data.getTime()<l.value&&(s=this._getOrReturnCtx(t,s),De(s,{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&&(s=this._getOrReturnCtx(t,s),De(s,{code:Ce.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),r.dirty()):It.assertNever(l);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new vp({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Xe.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Xe.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}}vp.create=e=>new vp({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:lt.ZodDate,...pt(e)});class dT extends Tt{_parse(t){if(this._getType(t)!==$e.symbol){const r=this._getOrReturnCtx(t);return De(r,{code:Ce.invalid_type,expected:$e.symbol,received:r.parsedType}),it}return Ja(t.data)}}dT.create=e=>new dT({typeName:lt.ZodSymbol,...pt(e)});class O0 extends Tt{_parse(t){if(this._getType(t)!==$e.undefined){const r=this._getOrReturnCtx(t);return De(r,{code:Ce.invalid_type,expected:$e.undefined,received:r.parsedType}),it}return Ja(t.data)}}O0.create=e=>new O0({typeName:lt.ZodUndefined,...pt(e)});class xp extends Tt{_parse(t){if(this._getType(t)!==$e.null){const r=this._getOrReturnCtx(t);return De(r,{code:Ce.invalid_type,expected:$e.null,received:r.parsedType}),it}return Ja(t.data)}}xp.create=e=>new xp({typeName:lt.ZodNull,...pt(e)});class fT extends Tt{constructor(){super(...arguments),this._any=!0}_parse(t){return Ja(t.data)}}fT.create=e=>new fT({typeName:lt.ZodAny,...pt(e)});class M0 extends Tt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ja(t.data)}}M0.create=e=>new M0({typeName:lt.ZodUnknown,...pt(e)});class Di extends Tt{_parse(t){const n=this._getOrReturnCtx(t);return De(n,{code:Ce.invalid_type,expected:$e.never,received:n.parsedType}),it}}Di.create=e=>new Di({typeName:lt.ZodNever,...pt(e)});class hT extends Tt{_parse(t){if(this._getType(t)!==$e.undefined){const r=this._getOrReturnCtx(t);return De(r,{code:Ce.invalid_type,expected:$e.void,received:r.parsedType}),it}return Ja(t.data)}}hT.create=e=>new hT({typeName:lt.ZodVoid,...pt(e)});class Us extends Tt{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==$e.array)return De(n,{code:Ce.invalid_type,expected:$e.array,received:n.parsedType}),it;if(s.exactLength!==null){const c=n.data.length>s.exactLength.value,d=n.data.length<s.exactLength.value;(c||d)&&(De(n,{code:c?Ce.too_big:Ce.too_small,minimum:d?s.exactLength.value:void 0,maximum:c?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(De(n,{code:Ce.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(De(n,{code:Ce.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((c,d)=>s.type._parseAsync(new $s(n,c,n.path,d)))).then(c=>$r.mergeArray(r,c));const l=[...n.data].map((c,d)=>s.type._parseSync(new $s(n,c,n.path,d)));return $r.mergeArray(r,l)}get element(){return this._def.type}min(t,n){return new Us({...this._def,minLength:{value:t,message:Xe.toString(n)}})}max(t,n){return new Us({...this._def,maxLength:{value:t,message:Xe.toString(n)}})}length(t,n){return new Us({...this._def,exactLength:{value:t,message:Xe.toString(n)}})}nonempty(t){return this.min(1,t)}}Us.create=(e,t)=>new Us({type:e,minLength:null,maxLength:null,exactLength:null,typeName:lt.ZodArray,...pt(t)});function Hc(e){if(e instanceof Kn){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=jo.create(Hc(r))}return new Kn({...e._def,shape:()=>t})}else return e instanceof Us?new Us({...e._def,type:Hc(e.element)}):e instanceof jo?jo.create(Hc(e.unwrap())):e instanceof kl?kl.create(Hc(e.unwrap())):e instanceof Ol?Ol.create(e.items.map(t=>Hc(t))):e}class Kn extends Tt{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=It.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 De(h,{code:Ce.invalid_type,expected:$e.object,received:h.parsedType}),it}const{status:r,ctx:s}=this._processInputParams(t),{shape:l,keys:c}=this._getCached(),d=[];if(!(this._def.catchall instanceof Di&&this._def.unknownKeys==="strip"))for(const h in s.data)c.includes(h)||d.push(h);const f=[];for(const h of c){const g=l[h],y=s.data[h];f.push({key:{status:"valid",value:h},value:g._parse(new $s(s,y,s.path,h)),alwaysSet:h in s.data})}if(this._def.catchall instanceof Di){const h=this._def.unknownKeys;if(h==="passthrough")for(const g of d)f.push({key:{status:"valid",value:g},value:{status:"valid",value:s.data[g]}});else if(h==="strict")d.length>0&&(De(s,{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=s.data[g];f.push({key:{status:"valid",value:g},value:h._parse(new $s(s,y,s.path,g)),alwaysSet:g in s.data})}}return s.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=>$r.mergeObjectSync(r,h)):$r.mergeObjectSync(r,f)}get shape(){return this._def.shape()}strict(t){return Xe.errToObj,new Kn({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var l,c;const s=((c=(l=this._def).errorMap)==null?void 0:c.call(l,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:Xe.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new Kn({...this._def,unknownKeys:"strip"})}passthrough(){return new Kn({...this._def,unknownKeys:"passthrough"})}extend(t){return new Kn({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Kn({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:lt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Kn({...this._def,catchall:t})}pick(t){const n={};for(const r of It.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Kn({...this._def,shape:()=>n})}omit(t){const n={};for(const r of It.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new Kn({...this._def,shape:()=>n})}deepPartial(){return Hc(this)}partial(t){const n={};for(const r of It.objectKeys(this.shape)){const s=this.shape[r];t&&!t[r]?n[r]=s:n[r]=s.optional()}return new Kn({...this._def,shape:()=>n})}required(t){const n={};for(const r of It.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let l=this.shape[r];for(;l instanceof jo;)l=l._def.innerType;n[r]=l}return new Kn({...this._def,shape:()=>n})}keyof(){return d4(It.objectKeys(this.shape))}}Kn.create=(e,t)=>new Kn({shape:()=>e,unknownKeys:"strip",catchall:Di.create(),typeName:lt.ZodObject,...pt(t)});Kn.strictCreate=(e,t)=>new Kn({shape:()=>e,unknownKeys:"strict",catchall:Di.create(),typeName:lt.ZodObject,...pt(t)});Kn.lazycreate=(e,t)=>new Kn({shape:e,unknownKeys:"strip",catchall:Di.create(),typeName:lt.ZodObject,...pt(t)});class bp extends Tt{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function s(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 Io(d.ctx.common.issues));return De(n,{code:Ce.invalid_union,unionErrors:c}),it}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(s);{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 Io(f));return De(n,{code:Ce.invalid_union,unionErrors:d}),it}}get options(){return this._def.options}}bp.create=(e,t)=>new bp({options:e,typeName:lt.ZodUnion,...pt(t)});const So=e=>e instanceof k0?So(e.schema):e instanceof Il?So(e.innerType()):e instanceof Ep?[e.value]:e instanceof Ml?e.options:e instanceof wp?It.objectValues(e.enum):e instanceof Tp?So(e._def.innerType):e instanceof O0?[void 0]:e instanceof xp?[null]:e instanceof jo?[void 0,...So(e.unwrap())]:e instanceof kl?[null,...So(e.unwrap())]:e instanceof f4||e instanceof _p?So(e.unwrap()):e instanceof jp?So(e._def.innerType):[];class y1 extends Tt{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==$e.object)return De(n,{code:Ce.invalid_type,expected:$e.object,received:n.parsedType}),it;const r=this.discriminator,s=n.data[r],l=this.optionsMap.get(s);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}):(De(n,{code:Ce.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),it)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const s=new Map;for(const l of n){const c=So(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(s.has(d))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(d)}`);s.set(d,l)}}return new y1({typeName:lt.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:s,...pt(r)})}}function I0(e,t){const n=pi(e),r=pi(t);if(e===t)return{valid:!0,data:e};if(n===$e.object&&r===$e.object){const s=It.objectKeys(t),l=It.objectKeys(e).filter(d=>s.indexOf(d)!==-1),c={...e,...t};for(const d of l){const f=I0(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 s=[];for(let l=0;l<e.length;l++){const c=e[l],d=t[l],f=I0(c,d);if(!f.valid)return{valid:!1};s.push(f.data)}return{valid:!0,data:s}}else return n===$e.date&&r===$e.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Sp extends Tt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=(l,c)=>{if(lT(l)||lT(c))return it;const d=I0(l.value,c.value);return d.valid?((cT(l)||cT(c))&&n.dirty(),{status:n.value,value:d.data}):(De(r,{code:Ce.invalid_intersection_types}),it)};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])=>s(l,c)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Sp.create=(e,t,n)=>new Sp({left:e,right:t,typeName:lt.ZodIntersection,...pt(n)});class Ol extends Tt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==$e.array)return De(r,{code:Ce.invalid_type,expected:$e.array,received:r.parsedType}),it;if(r.data.length<this._def.items.length)return De(r,{code:Ce.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),it;!this._def.rest&&r.data.length>this._def.items.length&&(De(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 $s(r,c,r.path,d)):null}).filter(c=>!!c);return r.common.async?Promise.all(l).then(c=>$r.mergeArray(n,c)):$r.mergeArray(n,l)}get items(){return this._def.items}rest(t){return new Ol({...this._def,rest:t})}}Ol.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ol({items:e,typeName:lt.ZodTuple,rest:null,...pt(t)})};class Cp extends Tt{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 De(r,{code:Ce.invalid_type,expected:$e.object,received:r.parsedType}),it;const s=[],l=this._def.keyType,c=this._def.valueType;for(const d in r.data)s.push({key:l._parse(new $s(r,d,r.path,d)),value:c._parse(new $s(r,r.data[d],r.path,d)),alwaysSet:d in r.data});return r.common.async?$r.mergeObjectAsync(n,s):$r.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Tt?new Cp({keyType:t,valueType:n,typeName:lt.ZodRecord,...pt(r)}):new Cp({keyType:Ro.create(),valueType:t,typeName:lt.ZodRecord,...pt(n)})}}class mT extends Tt{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 De(r,{code:Ce.invalid_type,expected:$e.map,received:r.parsedType}),it;const s=this._def.keyType,l=this._def.valueType,c=[...r.data.entries()].map(([d,f],h)=>({key:s._parse(new $s(r,d,r.path,[h,"key"])),value:l._parse(new $s(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 it;(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 it;(h.status==="dirty"||g.status==="dirty")&&n.dirty(),d.set(h.value,g.value)}return{status:n.value,value:d}}}}mT.create=(e,t,n)=>new mT({valueType:t,keyType:e,typeName:lt.ZodMap,...pt(n)});class mf extends Tt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==$e.set)return De(r,{code:Ce.invalid_type,expected:$e.set,received:r.parsedType}),it;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(De(r,{code:Ce.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(De(r,{code:Ce.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.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 it;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 $s(r,f,r.path,h)));return r.common.async?Promise.all(d).then(f=>c(f)):c(d)}min(t,n){return new mf({...this._def,minSize:{value:t,message:Xe.toString(n)}})}max(t,n){return new mf({...this._def,maxSize:{value:t,message:Xe.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}mf.create=(e,t)=>new mf({valueType:e,minSize:null,maxSize:null,typeName:lt.ZodSet,...pt(t)});class k0 extends Tt{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})}}k0.create=(e,t)=>new k0({getter:e,typeName:lt.ZodLazy,...pt(t)});class Ep extends Tt{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return De(n,{received:n.data,code:Ce.invalid_literal,expected:this._def.value}),it}return{status:"valid",value:t.data}}get value(){return this._def.value}}Ep.create=(e,t)=>new Ep({value:e,typeName:lt.ZodLiteral,...pt(t)});function d4(e,t){return new Ml({values:e,typeName:lt.ZodEnum,...pt(t)})}class Ml extends Tt{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return De(n,{expected:It.joinValues(r),received:n.parsedType,code:Ce.invalid_type}),it}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 De(n,{received:n.data,code:Ce.invalid_enum_value,options:r}),it}return Ja(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 Ml.create(t,{...this._def,...n})}exclude(t,n=this._def){return Ml.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}Ml.create=d4;class wp extends Tt{_parse(t){const n=It.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==$e.string&&r.parsedType!==$e.number){const s=It.objectValues(n);return De(r,{expected:It.joinValues(s),received:r.parsedType,code:Ce.invalid_type}),it}if(this._cache||(this._cache=new Set(It.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=It.objectValues(n);return De(r,{received:r.data,code:Ce.invalid_enum_value,options:s}),it}return Ja(t.data)}get enum(){return this._def.values}}wp.create=(e,t)=>new wp({values:e,typeName:lt.ZodNativeEnum,...pt(t)});class Rp extends Tt{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==$e.promise&&n.common.async===!1)return De(n,{code:Ce.invalid_type,expected:$e.promise,received:n.parsedType}),it;const r=n.parsedType===$e.promise?n.data:Promise.resolve(n.data);return Ja(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Rp.create=(e,t)=>new Rp({type:e,typeName:lt.ZodPromise,...pt(t)});class Il extends Tt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===lt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=this._def.effect||null,l={addIssue:c=>{De(r,c),c.fatal?n.abort():n.dirty()},get path(){return r.path}};if(l.addIssue=l.addIssue.bind(l),s.type==="preprocess"){const c=s.transform(r.data,l);if(r.common.async)return Promise.resolve(c).then(async d=>{if(n.value==="aborted")return it;const f=await this._def.schema._parseAsync({data:d,path:r.path,parent:r});return f.status==="aborted"?it:f.status==="dirty"||n.value==="dirty"?Gd(f.value):f});{if(n.value==="aborted")return it;const d=this._def.schema._parseSync({data:c,path:r.path,parent:r});return d.status==="aborted"?it:d.status==="dirty"||n.value==="dirty"?Gd(d.value):d}}if(s.type==="refinement"){const c=d=>{const f=s.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"?it:(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"?it:(d.status==="dirty"&&n.dirty(),c(d.value).then(()=>({status:n.value,value:d.value}))))}if(s.type==="transform")if(r.common.async===!1){const c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!mu(c))return it;const d=s.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=>mu(c)?Promise.resolve(s.transform(c.value,l)).then(d=>({status:n.value,value:d})):it);It.assertNever(s)}}Il.create=(e,t,n)=>new Il({schema:e,typeName:lt.ZodEffects,effect:t,...pt(n)});Il.createWithPreprocess=(e,t,n)=>new Il({schema:t,effect:{type:"preprocess",transform:e},typeName:lt.ZodEffects,...pt(n)});class jo extends Tt{_parse(t){return this._getType(t)===$e.undefined?Ja(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}jo.create=(e,t)=>new jo({innerType:e,typeName:lt.ZodOptional,...pt(t)});class kl extends Tt{_parse(t){return this._getType(t)===$e.null?Ja(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}kl.create=(e,t)=>new kl({innerType:e,typeName:lt.ZodNullable,...pt(t)});class Tp extends Tt{_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}}Tp.create=(e,t)=>new Tp({innerType:e,typeName:lt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...pt(t)});class jp extends Tt{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return yp(s)?s.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Io(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Io(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}jp.create=(e,t)=>new jp({innerType:e,typeName:lt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...pt(t)});class pT extends Tt{_parse(t){if(this._getType(t)!==$e.nan){const r=this._getOrReturnCtx(t);return De(r,{code:Ce.invalid_type,expected:$e.nan,received:r.parsedType}),it}return{status:"valid",value:t.data}}}pT.create=e=>new pT({typeName:lt.ZodNaN,...pt(e)});class f4 extends Tt{_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 v1 extends Tt{_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"?it:l.status==="dirty"?(n.dirty(),Gd(l.value)):this._def.out._parseAsync({data:l.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?it:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(t,n){return new v1({in:t,out:n,typeName:lt.ZodPipeline})}}class _p extends Tt{_parse(t){const n=this._def.innerType._parse(t),r=s=>(mu(s)&&(s.value=Object.freeze(s.value)),s);return yp(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}_p.create=(e,t)=>new _p({innerType:e,typeName:lt.ZodReadonly,...pt(t)});var lt;(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"})(lt||(lt={}));const sn=Ro.create,xG=pu.create,bG=D0.create,SG=xp.create,CG=M0.create;Di.create;const gT=Us.create,an=Kn.create,EG=bp.create,h4=y1.create;Sp.create;Ol.create;const wG=Cp.create,Ks=Ep.create;Ml.create;const x1=wp.create;Rp.create;jo.create;const RG=kl.create,Ox=it,m4=an({serviceAccount:sn().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"}),Ox):n.client_email?e:(t.addIssue({code:Ce.custom,message:"Service Account must contain a client_email field"}),Ox)}catch(n){return console.error(n),t.addIssue({code:Ce.custom,message:"Service Account must be a valid JSON string"}),Ox}})}),TG=[{type:"menu-item",title:"GitHub Community",href:"https://github.com/OWOX/owox-data-marts",icon:IB,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:iR,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:h_,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:iR,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Subscription",href:"https://platform.owox.com/ui/p/none/settings/subscription",icon:E9,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Members",href:"https://platform.owox.com/ui/p/none/settings/members",icon:lR,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Members",href:"/auth",icon:lR,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:zr,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:zr,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:RL,visible:{flagKey:"MENU_FEEDBACK_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"Issues",href:"https://github.com/OWOX/owox-data-marts/issues",icon:v9,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:$B,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:HL,visible:{flagKey:"MENU_LICENSE_VISIBLE",expectedValue:"true"},group:"legal"},{type:"menu-item",title:"OWOX BI",href:"https://bi.owox.com/",icon:VB,visible:{flagKey:"MENU_OWOX_BI_VISIBLE",expectedValue:"true"},group:"external"}];function yT(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}=c1(),{loadProjects:t,projects:n}=a4(),{id:r}=NA(),s=yT("IDP_PROVIDER","owox",e);p.useEffect(()=>{s&&t()},[t,s]);const l=n.length>1;return{visibleMenuItems:p.useMemo(()=>{const f=TG.filter(v=>typeof v.visible=="boolean"?v.visible:yT(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 _G(){const{visibleMenuItems:e,canSwitchProject:t}=jG();return o.jsxs(Tr,{align:"start",sideOffset:8,className:"w-56",children:[e.map((n,r)=>{if(n.type==="separator")return o.jsx(Ka,{},`separator-${String(r)}`);const s=n.icon;return o.jsx(vt,{asChild:!0,children:o.jsxs("a",{href:n.href,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2",children:[o.jsx(s,{className:"size-4"}),n.title]})},n.href)}),t&&o.jsx(MB,{},"switch-project")]})}var Mr=(e=>(e.IDLE="idle",e.LOADING="loading",e.LOADED="loaded",e.ERROR="error",e))(Mr||{});let NG={data:""},AG=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||NG},DG=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,OG=/\/\*[^]*?\*\/| +/g,vT=/\n+/g,xi=(e,t)=>{let n="",r="",s="";for(let l in e){let c=e[l];l[0]=="@"?l[1]=="i"?n=l+" "+c+";":r+=l[1]=="f"?xi(c,l):l+"{"+xi(c,l[1]=="k"?"":t)+"}":typeof c=="object"?r+=xi(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(),s+=xi.p?xi.p(l,c):l+":"+c+";")}return n+(t&&s?t+"{"+s+"}":s)+r},vo={},p4=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+p4(e[n]);return t}return e},MG=(e,t,n,r,s)=>{let l=p4(e),c=vo[l]||(vo[l]=(f=>{let h=0,g=11;for(;h<f.length;)g=101*g+f.charCodeAt(h++)>>>0;return"go"+g})(l));if(!vo[c]){let f=l!==e?e:(h=>{let g,y,v=[{}];for(;g=DG.exec(h.replace(OG,""));)g[4]?v.shift():g[3]?(y=g[3].replace(vT," ").trim(),v.unshift(v[0][y]=v[0][y]||{})):v[0][g[1]]=g[2].replace(vT," ").trim();return v[0]})(e);vo[c]=xi(s?{["@keyframes "+c]:f}:f,n?"":"."+c)}let d=n&&vo.g?vo.g:null;return n&&(vo.g=vo[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)})(vo[c],t,r,d),c},IG=(e,t,n)=>e.reduce((r,s,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?"":xi(d,""):d===!1?"":d}return r+s+(c??"")},"");function Sg(e){let t=this||{},n=e.call?e(t.p):e;return MG(n.unshift?n.raw?IG(n,[].slice.call(arguments,1),t.p):n.reduce((r,s)=>Object.assign(r,s&&s.call?s(t.p):s),{}):n,AG(t.target),t.g,t.o,t.k)}let g4,L0,P0;Sg.bind({g:1});let ko=Sg.bind({k:1});function kG(e,t,n,r){xi.p=t,g4=e,L0=n,P0=r}function Hi(e,t){let n=this||{};return function(){let r=arguments;function s(l,c){let d=Object.assign({},l),f=d.className||s.className;n.p=Object.assign({theme:L0&&L0()},d),n.o=/ *go\d+/.test(f),d.className=Sg.apply(n,r)+(f?" "+f:"");let h=e;return e[0]&&(h=d.as||e,delete d.as),P0&&h[0]&&P0(d),g4(h,d)}return s}}var LG=e=>typeof e=="function",Np=(e,t)=>LG(e)?e(t):e,PG=(()=>{let e=0;return()=>(++e).toString()})(),y4=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),UG=20,b1="default",v4=(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 v4(e,{type:e.toasts.find(c=>c.id===r.id)?1:0,toast:r});case 3:let{toastId:s}=t;return{...e,toasts:e.toasts.map(c=>c.id===s||s===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}))}}},Ym=[],x4={toasts:[],pausedAt:void 0,settings:{toastLimit:UG}},Is={},b4=(e,t=b1)=>{Is[t]=v4(Is[t]||x4,e),Ym.forEach(([n,r])=>{n===t&&r(Is[t])})},S4=e=>Object.keys(Is).forEach(t=>b4(e,t)),FG=e=>Object.keys(Is).find(t=>Is[t].toasts.some(n=>n.id===e)),Cg=(e=b1)=>t=>{b4(t,e)},zG={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},VG=(e={},t=b1)=>{let[n,r]=p.useState(Is[t]||x4),s=p.useRef(Is[t]);p.useEffect(()=>(s.current!==Is[t]&&r(Is[t]),Ym.push([t,r]),()=>{let c=Ym.findIndex(([d])=>d===t);c>-1&&Ym.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)||zG[c.type],style:{...e.style,...(h=e[c.type])==null?void 0:h.style,...c.style}}});return{...n,toasts:l}},$G=(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)||PG()}),Hf=e=>(t,n)=>{let r=$G(t,e,n);return Cg(r.toasterId||FG(r.id))({type:2,toast:r}),r.id},rn=(e,t)=>Hf("blank")(e,t);rn.error=Hf("error");rn.success=Hf("success");rn.loading=Hf("loading");rn.custom=Hf("custom");rn.dismiss=(e,t)=>{let n={type:3,toastId:e};t?Cg(t)(n):S4(n)};rn.dismissAll=e=>rn.dismiss(void 0,e);rn.remove=(e,t)=>{let n={type:4,toastId:e};t?Cg(t)(n):S4(n)};rn.removeAll=e=>rn.remove(void 0,e);rn.promise=(e,t,n)=>{let r=rn.loading(t.loading,{...n,...n==null?void 0:n.loading});return typeof e=="function"&&(e=e()),e.then(s=>{let l=t.success?Np(t.success,s):void 0;return l?rn.success(l,{id:r,...n,...n==null?void 0:n.success}):rn.dismiss(r),s}).catch(s=>{let l=t.error?Np(t.error,s):void 0;l?rn.error(l,{id:r,...n,...n==null?void 0:n.error}):rn.dismiss(r)}),e};var HG=1e3,BG=(e,t="default")=>{let{toasts:n,pausedAt:r}=VG(e,t),s=p.useRef(new Map).current,l=p.useCallback((y,v=HG)=>{if(s.has(y))return;let b=setTimeout(()=>{s.delete(y),c({type:4,toastId:y})},v);s.set(y,b)},[]);p.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&&rn.dismiss(b.id);return}return setTimeout(()=>rn.dismiss(b.id,t),w)});return()=>{v.forEach(b=>b&&clearTimeout(b))}},[n,r,t]);let c=p.useCallback(Cg(t),[t]),d=p.useCallback(()=>{c({type:5,time:Date.now()})},[c]),f=p.useCallback((y,v)=>{c({type:1,toast:{id:y,height:v}})},[c]),h=p.useCallback(()=>{r&&c({type:6,time:Date.now()})},[r,c]),g=p.useCallback((y,v)=>{let{reverseOrder:b=!1,gutter:w=8,defaultPosition:E}=v||{},S=n.filter(_=>(_.position||E)===(y.position||E)&&_.height),R=S.findIndex(_=>_.id===y.id),T=S.filter((_,D)=>D<R&&_.visible).length;return S.filter(_=>_.visible).slice(...b?[T+1]:[0,T]).reduce((_,D)=>_+(D.height||0)+w,0)},[n]);return p.useEffect(()=>{n.forEach(y=>{if(y.dismissed)l(y.id,y.removeDelay);else{let v=s.get(y.id);v&&(clearTimeout(v),s.delete(y.id))}})},[n,l]),{toasts:n,handlers:{updateHeight:f,startPause:d,endPause:h,calculateOffset:g}}},GG=ko`
|
|
491
|
-
from {
|
|
492
|
-
transform: scale(0) rotate(45deg);
|
|
493
|
-
opacity: 0;
|
|
494
|
-
}
|
|
495
|
-
to {
|
|
496
|
-
transform: scale(1) rotate(45deg);
|
|
497
|
-
opacity: 1;
|
|
498
|
-
}`,qG=ko`
|
|
499
|
-
from {
|
|
500
|
-
transform: scale(0);
|
|
501
|
-
opacity: 0;
|
|
502
|
-
}
|
|
503
|
-
to {
|
|
504
|
-
transform: scale(1);
|
|
505
|
-
opacity: 1;
|
|
506
|
-
}`,ZG=ko`
|
|
507
|
-
from {
|
|
508
|
-
transform: scale(0) rotate(90deg);
|
|
509
|
-
opacity: 0;
|
|
510
|
-
}
|
|
511
|
-
to {
|
|
512
|
-
transform: scale(1) rotate(90deg);
|
|
513
|
-
opacity: 1;
|
|
514
|
-
}`,KG=Hi("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: ${GG} 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: ${qG} 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: ${ZG} 0.15s ease-out forwards;
|
|
544
|
-
animation-delay: 180ms;
|
|
545
|
-
transform: rotate(90deg);
|
|
546
|
-
}
|
|
547
|
-
`,YG=ko`
|
|
548
|
-
from {
|
|
549
|
-
transform: rotate(0deg);
|
|
550
|
-
}
|
|
551
|
-
to {
|
|
552
|
-
transform: rotate(360deg);
|
|
553
|
-
}
|
|
554
|
-
`,WG=Hi("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: ${YG} 1s linear infinite;
|
|
563
|
-
`,QG=ko`
|
|
564
|
-
from {
|
|
565
|
-
transform: scale(0) rotate(45deg);
|
|
566
|
-
opacity: 0;
|
|
567
|
-
}
|
|
568
|
-
to {
|
|
569
|
-
transform: scale(1) rotate(45deg);
|
|
570
|
-
opacity: 1;
|
|
571
|
-
}`,XG=ko`
|
|
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
|
-
}`,JG=Hi("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: ${QG} 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: ${XG} 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
|
-
`,eq=Hi("div")`
|
|
613
|
-
position: absolute;
|
|
614
|
-
`,tq=Hi("div")`
|
|
615
|
-
position: relative;
|
|
616
|
-
display: flex;
|
|
617
|
-
justify-content: center;
|
|
618
|
-
align-items: center;
|
|
619
|
-
min-width: 20px;
|
|
620
|
-
min-height: 20px;
|
|
621
|
-
`,nq=ko`
|
|
622
|
-
from {
|
|
623
|
-
transform: scale(0.6);
|
|
624
|
-
opacity: 0.4;
|
|
625
|
-
}
|
|
626
|
-
to {
|
|
627
|
-
transform: scale(1);
|
|
628
|
-
opacity: 1;
|
|
629
|
-
}`,rq=Hi("div")`
|
|
630
|
-
position: relative;
|
|
631
|
-
transform: scale(0.6);
|
|
632
|
-
opacity: 0.4;
|
|
633
|
-
min-width: 20px;
|
|
634
|
-
animation: ${nq} 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"?p.createElement(rq,null,t):t:n==="blank"?null:p.createElement(tq,null,p.createElement(WG,{...r}),n!=="loading"&&p.createElement(eq,null,n==="error"?p.createElement(KG,{...r}):p.createElement(JG,{...r})))},sq=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
|
-
`,iq="0%{opacity:0;} 100%{opacity:1;}",lq="0%{opacity:1;} 100%{opacity:0;}",cq=Hi("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
|
-
`,uq=Hi("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
|
-
`,dq=(e,t)=>{let n=e.includes("top")?1:-1,[r,s]=y4()?[iq,lq]:[sq(n),oq(n)];return{animation:t?`${ko(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${ko(s)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},fq=p.memo(({toast:e,position:t,style:n,children:r})=>{let s=e.height?dq(e.position||t||"top-center",e.visible):{opacity:0},l=p.createElement(aq,{toast:e}),c=p.createElement(uq,{...e.ariaProps},Np(e.message,e));return p.createElement(cq,{className:e.className,style:{...s,...n,...e.style}},typeof r=="function"?r({icon:l,message:c}):p.createElement(p.Fragment,null,l,c))});kG(p.createElement);var hq=({id:e,className:t,style:n,onHeightUpdate:r,children:s})=>{let l=p.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 p.createElement("div",{ref:l,className:t,style:n},s)},mq=(e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},s=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:y4()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...s}},pq=Sg`
|
|
662
|
-
z-index: 9999;
|
|
663
|
-
> * {
|
|
664
|
-
pointer-events: auto;
|
|
665
|
-
}
|
|
666
|
-
`,Tm=16,gq=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:s,toasterId:l,containerStyle:c,containerClassName:d})=>{let{toasts:f,handlers:h}=BG(n,l);return p.createElement("div",{"data-rht-toaster":l||"",style:{position:"fixed",zIndex:9999,top:Tm,left:Tm,right:Tm,bottom:Tm,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=mq(y,v);return p.createElement(hq,{id:g.id,key:g.id,onHeightUpdate:h.updateHeight,className:g.visible?pq:"",style:b},g.type==="custom"?Np(g.message,g):s?s(g):p.createElement(fq,{toast:g,position:y}))}))},At=rn;const yn=e=>{var n;return(n=e.response)==null?void 0:n.data};function xT(e,t="Something went wrong"){var s,l;const n=yn(e);let r=n.message.trim()||t;(l=(s=n.errorDetails)==null?void 0:s.error)!=null&&l.trim()&&(r=`${r}. ${n.errorDetails.error}`),At.error(r)}class yq{constructor(){Ns(this,"isRefreshingToken",!1);Ns(this,"refreshTokenPromise",null);Ns(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 vq={baseURL:"/api",timeout:3e4,headers:{"Content-Type":"application/json",Accept:"application/json"}},ga=An.create(vq),U0=new yq;ga.interceptors.request.use(e=>{if(e.skipAuthHeader||new fB(e.headers).has("X-OWOX-Authorization"))return e;const n=g1(),r=(n==null?void 0:n.getAccessToken())??U0.getAccessToken();return r&&(e.headers["X-OWOX-Authorization"]=`Bearer ${r}`),e},e=>Promise.reject(e instanceof Error?e:new Error("Unknown error")));ga.interceptors.response.use(e=>e,async e=>{var n,r,s;const t=e.config;if(((n=e.response)==null?void 0:n.status)===401&&!t._retry){t._retry=!0;try{const l=g1();if(!l)throw new Error("No token provider available");const c=await U0.refreshToken(()=>l.refreshToken());return t.headers["X-OWOX-Authorization"]=`Bearer ${c}`,await ga(t)}catch{return U0.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&&xT(e,"Access forbidden - insufficient permissions"),((s=e.response)==null?void 0:s.status)===400&&xT(e,"Bad request"),Promise.reject(e)});const C4={projects:[],callState:Mr.IDLE,error:null};function xq(e,t){switch(t.type){case"LOADING":return{...e,callState:Mr.LOADING,error:null};case"SUCCESS":return{projects:t.payload,callState:Mr.LOADED,error:null};case"ERROR":return{...e,callState:Mr.ERROR,error:t.payload};case"RESET":return{...C4};default:return e}}function bq({children:e}){const[t,n]=p.useReducer(xq,C4),r=p.useCallback(async()=>{n({type:"LOADING"});try{const d=g1();if(!d){n({type:"ERROR",payload:yn(new aT("No token provider"))});return}const f=d.getAccessToken();if(!f){n({type:"ERROR",payload:yn(new aT("Unable to obtain access token"))});return}const h=await xB(f);n({type:"SUCCESS",payload:h})}catch(d){n({type:"ERROR",payload:yn(d)})}},[]),s=p.useCallback(()=>{n({type:"RESET"})},[]),l=t.callState===Mr.LOADING,c={...t,loadProjects:r,reset:s,isLoading:l};return o.jsx(r4.Provider,{value:c,children:e})}function Sq(){const[e,t]=p.useState(!1);return o.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:"flex flex-col gap-2",children:o.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:"flex w-full min-w-0 flex-col gap-1",children:o.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:"group/menu-item relative",children:o.jsxs(wr,{open:e,onOpenChange:t,children:[o.jsx(L$,{isOpen:e}),o.jsx(bq,{children:o.jsx(_G,{})})]})})})})}var Cq=(e,t,n,r,s,l,c,d)=>{let f=document.documentElement,h=["light","dark"];function g(b){(Array.isArray(e)?e:[e]).forEach(w=>{let E=w==="class",S=E&&l?s.map(R=>l[R]||R):s;E?(f.classList.remove(...S),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{}},bT=["light","dark"],E4="(prefers-color-scheme: dark)",Eq=typeof window>"u",S1=p.createContext(void 0),wq={setTheme:e=>{},themes:[]},w4=()=>{var e;return(e=p.useContext(S1))!=null?e:wq},Rq=e=>p.useContext(S1)?p.createElement(p.Fragment,null,e.children):p.createElement(jq,{...e}),Tq=["light","dark"],jq=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:s="theme",themes:l=Tq,defaultTheme:c=n?"system":"light",attribute:d="data-theme",value:f,children:h,nonce:g,scriptProps:y})=>{let[v,b]=p.useState(()=>Nq(s,c)),[w,E]=p.useState(()=>v==="system"?Mx():v),S=f?Object.values(f):l,R=p.useCallback(A=>{let O=A;if(!O)return;A==="system"&&n&&(O=Mx());let j=f?f[O]:O,M=t?Aq(g):null,F=document.documentElement,G=Y=>{Y==="class"?(F.classList.remove(...S),j&&F.classList.add(j)):Y.startsWith("data-")&&(j?F.setAttribute(Y,j):F.removeAttribute(Y))};if(Array.isArray(d)?d.forEach(G):G(d),r){let Y=bT.includes(c)?c:null,Z=bT.includes(O)?O:Y;F.style.colorScheme=Z}M==null||M()},[g]),T=p.useCallback(A=>{let O=typeof A=="function"?A(v):A;b(O);try{localStorage.setItem(s,O)}catch{}},[v]),_=p.useCallback(A=>{let O=Mx(A);E(O),v==="system"&&n&&!e&&R("system")},[v,e]);p.useEffect(()=>{let A=window.matchMedia(E4);return A.addListener(_),_(A),()=>A.removeListener(_)},[_]),p.useEffect(()=>{let A=O=>{O.key===s&&(O.newValue?b(O.newValue):T(c))};return window.addEventListener("storage",A),()=>window.removeEventListener("storage",A)},[T]),p.useEffect(()=>{R(e??v)},[e,v]);let D=p.useMemo(()=>({theme:v,setTheme:T,forcedTheme:e,resolvedTheme:v==="system"?w:v,themes:n?[...l,"system"]:l,systemTheme:n?w:void 0}),[v,T,e,w,n,l]);return p.createElement(S1.Provider,{value:D},p.createElement(_q,{forcedTheme:e,storageKey:s,attribute:d,enableSystem:n,enableColorScheme:r,defaultTheme:c,value:f,themes:l,nonce:g,scriptProps:y}),h)},_q=p.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:l,value:c,themes:d,nonce:f,scriptProps:h})=>{let g=JSON.stringify([n,t,l,e,d,c,r,s]).slice(1,-1);return p.createElement("script",{...h,suppressHydrationWarning:!0,nonce:typeof window>"u"?f:"",dangerouslySetInnerHTML:{__html:`(${Cq.toString()})(${g})`}})}),Nq=(e,t)=>{if(Eq)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},Aq=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)}},Mx=e=>(e||(e=window.matchMedia(E4)),e.matches?"dark":"light");const Dq=({theme:e,setTheme:t,signOut:n})=>[{type:"submenu",title:"Appearance",icon:Oq(e),submenu:{value:e,onChange:r=>{t(r)},options:[{value:"system",label:"System",icon:d_},{value:"light",label:"Light",icon:m_},{value:"dark",label:"Dark",icon:f_}]}},{type:"separator"},{type:"item",title:"Sign out",icon:xL,onClick:n,className:"text-red-600 focus:text-red-600"}];function Oq(e){switch(e){case"light":return m_;case"dark":return f_;case"system":default:return d_}}function Mq({avatar:e,initials:t,displayName:n}){return o.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?o.jsx("img",{src:e,alt:n,className:"size-full rounded-full object-cover"}):o.jsx("span",{children:t})})}function Iq({isOpen:e,displayName:t,email:n,avatar:r,initials:s}){return o.jsx(Rr,{asChild:!0,children:o.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:[o.jsx(Mq,{avatar:r,initials:s,displayName:t}),o.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight group-data-[collapsible=icon]:hidden",children:[o.jsx("span",{className:"truncate font-medium",children:t}),n&&o.jsx("span",{className:"text-muted-foreground truncate text-xs",children:n})]}),o.jsx(Qa,{className:`ml-auto size-4 transition-transform duration-200 group-data-[collapsible=icon]:hidden ${e?"rotate-180":""}`})]})})}function kq({items:e}){return o.jsx(Tr,{align:"start",side:"top",sideOffset:8,className:"w-56",children:e.map((t,n)=>{if(t.type==="separator")return o.jsx(Ka,{},`sep-${String(n)}`);if(t.type==="submenu"){const{submenu:r}=t;return o.jsxs(o1,{children:[o.jsxs(i1,{className:"flex items-center gap-2 px-2 py-1.5",children:[o.jsx(t.icon,{className:"size-4"}),t.title]}),o.jsx(l1,{children:r.options.map(s=>o.jsxs(vt,{className:"flex items-center gap-2 px-2 py-1.5",onClick:()=>{r.onChange(s.value)},children:[s.icon&&o.jsx(s.icon,{className:"size-4"}),s.label,r.value===s.value&&o.jsx(fr,{className:"ml-auto size-4"})]},s.value))})]},t.title)}return o.jsxs(vt,{onClick:t.onClick,className:`flex items-center gap-2 px-2 py-1.5 ${t.className??""}`,children:[o.jsx(t.icon,{className:`size-4 ${t.className??""}`}),t.title]},t.title)})})}function Lq(e,t){var n,r,s,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=(s=c[0])==null?void 0:s[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 Pq(){const{user:e,signOut:t}=Vi(),{setTheme:n,theme:r}=w4(),[s,l]=p.useState(!1);if(!e)return null;const{fullName:c,email:d,avatar:f}=e,h=c??d??"Unknown User",g=Lq(c,d);return o.jsx("div",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:"group/menu-item relative",children:o.jsxs(wr,{open:s,onOpenChange:l,children:[o.jsx(Iq,{isOpen:s,displayName:h,email:d,avatar:f,initials:g}),o.jsx(kq,{items:Dq({theme:r,setTheme:n,signOut:t})})]})})}function Uq(){const{user:e,status:t}=Vi();return t===Or.LOADING||t===Or.UNAUTHENTICATED||!(e!=null&&e.projectId)?null:e.projectId}function Po(){const e=Zp(),t=Uq(),n=p.useCallback((l,c)=>{if(!t){e("/",{replace:!0});return}const d=gp(t,l);e(d,c)},[e,t]),r=p.useCallback(l=>t?gp(t,l):l,[t]);return p.useMemo(()=>({navigate:n,scope:r,projectId:t}),[n,r,t])}function Fq(){const{scope:e}=Po();return o.jsxs(Cf,{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:[o.jsx("div",{className:"flex aspect-square size-8 items-center justify-center",children:o.jsx(_a,{className:"size-4 shrink-0"})}),o.jsx("div",{className:"grid flex-1 text-left text-sm leading-tight",children:o.jsx("span",{className:"truncate font-medium",children:"New Data Mart"})})]})}const zq=[{title:"Data Marts",url:"/data-marts",icon:ap},{title:"Storages",url:"/data-storages",icon:lu},{title:"Destinations",url:"/data-destinations",icon:_b}];function Vq(){const{scope:e}=Po();return o.jsx(zz,{children:zq.map(t=>{const n=t.icon;return o.jsx(Vz,{children:o.jsx(Cf,{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})=>o.jsxs(St,{delayDuration:500,children:[o.jsx(Ct,{asChild:!0,children:o.jsxs(Hz,{className:`${r?"hover:bg-transparent":""}`,children:[o.jsx(n,{className:"size-4 shrink-0 transition-all"}),o.jsx("span",{children:t.title}),t.badge&&o.jsx("span",{className:"bg-primary/20 text-primary ml-auto rounded-full px-2 py-0.5 text-xs",children:t.badge})]})}),o.jsx(Et,{side:"right",children:t.title})]})})},t.title)})})}function $q({variant:e="inset",collapsible:t="icon"}){return o.jsxs(Mz,{variant:e,collapsible:t,children:[o.jsx(Pz,{children:o.jsx(Sq,{})}),o.jsxs(Fz,{children:[o.jsx(UR,{children:o.jsx(FR,{children:o.jsx(Fq,{})})}),o.jsx(UR,{children:o.jsx(FR,{children:o.jsx(Vq,{})})})]}),o.jsx(Uz,{children:o.jsx(Pq,{})}),o.jsx(kz,{})]})}function Hq({children:e,...t}){return o.jsx(Rq,{attribute:"class",defaultTheme:"system",enableSystem:!0,...t,children:e})}class Zl{constructor(t){Ns(this,"baseUrl");this.baseUrl=t}async get(t,n,r){const s=this.createUrl(t);return(await ga.get(s,{...r,params:n})).data}async post(t,n,r){const s=this.createUrl(t);return(await ga.post(s,n,r)).data}async put(t,n,r){const s=this.createUrl(t);return(await ga.put(s,n,r)).data}async patch(t,n,r){const s=this.createUrl(t);return(await ga.patch(s,n,r)).data}async delete(t,n){const r=this.createUrl(t);return(await ga.delete(r,n)).data}createUrl(t){return this.baseUrl?`${this.baseUrl}${t}`:t}}class Bq{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 s=JSON.parse(r);return typeof s=="object"?s: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 ks=new Bq;class Gq{getTimezones(){return Intl.supportedValuesOf("timeZone")}getTimezonesWithOffset(){const t=this.getTimezones(),n=new Date;return t.map(r=>{const s=this.getTimezoneOffset(r,n),l=this.formatOffset(s),c=this.isDaylightSavingTime(r,n),d=this.getDisplayName(r,l);return{identifier:r,displayName:d,offsetMinutes:s,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}),s=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(s.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),s=Math.floor(r/60),l=r%60;return`${n}${s.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}`}isDaylightSavingTime(t,n=new Date){try{const r=new Date(n.getFullYear(),0,1),s=new Date(n.getFullYear(),6,1),l=this.getTimezoneOffset(t,r),c=this.getTimezoneOffset(t,s),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),s=this.formatOffset(r),l=this.isDaylightSavingTime(t,n),c=this.getDisplayName(t,s);return{identifier:t,displayName:c,offsetMinutes:r,offsetString:s,isDST:l}}getBrowserOffset(){return this.getBrowserTimezone().offsetMinutes}}const qq=new Gq;function Zq({isLoading:e,className:t}){const[n,r]=p.useState(0),[s,l]=p.useState(!1);return p.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]),o.jsx("div",{className:ne("fixed top-0 right-0 left-0 z-50 h-1 transition-opacity duration-300",!s&&"opacity-0",t),children:o.jsx("div",{className:"bg-primary h-full transition-all duration-300 ease-out",style:{width:`${n.toString()}%`}})})}const R4=p.createContext({isLoading:!1});function Kq({children:e}){const[t,n]=p.useState(0),r=t>0;return p.useEffect(()=>{const s=ga.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=ga.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()=>{ga.interceptors.request.eject(s),ga.interceptors.response.eject(l)}},[]),o.jsx(R4.Provider,{value:{isLoading:r},children:e})}function Yq(){return p.useContext(R4)}function Wq(){return o.jsx(gq,{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 Qq({children:e}){const{isLoading:t}=n4(),n=_B(),r=Xj(),s=Gs();return p.useEffect(()=>{if(t)return;const l=r.projectId,c=n==null?void 0:n.projectId;if(l&&!s.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,s.pathname]),o.jsx(o.Fragment,{children:e})}const ST="sidebar_state";function Xq(){const{state:e,isMobile:t}=Mf(),r=t||e==="collapsed",{isLoading:s}=Yq();return o.jsxs(o.Fragment,{children:[o.jsx(Wq,{}),o.jsx(Zq,{isLoading:s}),o.jsxs(NB,{redirectTo:"/auth/sign-in",children:[o.jsx($q,{variant:"inset",collapsible:"icon"}),o.jsxs(Lz,{children:[r&&o.jsx(Iz,{}),o.jsx(Qq,{children:o.jsx(e_,{})})]})]})]})}function Jq(){const[e,t]=p.useState(()=>ks.get(ST,"boolean")??!0),n=r=>{t(r),ks.set(ST,r)};return o.jsx(Hq,{children:o.jsx(Kq,{children:o.jsx(Oz,{open:e,onOpenChange:n,children:o.jsx(Xq,{})})})})}function eZ(){return o.jsxs("div",{className:"app-container",children:[o.jsx("h1",{children:"About OWOX"}),o.jsx("p",{children:"OWOX Data Marts — Free, Open-Source Connectors for Data Analysts"})]})}function CT(){return o.jsxs("div",{className:"dm-empty-state-404page",children:[o.jsxs("div",{className:"dm-empty-state-404page-foreground",children:[o.jsx(XL,{className:"dm-empty-state-ico",strokeWidth:1}),o.jsx("h1",{className:"dm-empty-state-title",children:"Lost in the 404th Data Realm"}),o.jsxs("p",{className:"dm-empty-state-subtitle",children:["In this dimension, ",o.jsx("code",{children:"1+1=3"}),", percentages exceed 100%, and dashboards predict"," ",o.jsx("i",{children:"yesterday"}),".",o.jsx("br",{}),"Escape while you can!"]}),o.jsx(Se,{variant:"default",asChild:!0,children:o.jsxs(Za,{to:"/",className:"flex items-center gap-1","aria-label":"Guide Me Home",children:["Guide Me Home",o.jsx(ja,{className:"h-4 w-4"})]})})]}),o.jsx("div",{className:"dm-empty-state-404page-background"})]})}const tZ={items:[],loading:!1,error:null};function nZ(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 T4=p.createContext(void 0);function rZ({children:e}){const[t,n]=p.useReducer(nZ,tZ);return o.jsx(T4.Provider,{value:{state:t,dispatch:n},children:e})}function aZ(){const e=p.useContext(T4);if(e===void 0)throw new Error("useDataMartListContext must be used within a DataMartListProvider");return e}class sZ extends Zl{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,s){return await this.get(`/${t}/runs`,{limit:n,offset:r},s)}async getDataMartsByConnectorName(t){return this.get(`/by-connector/${t}`)}}const nn=new sZ;var Sr=(e=>(e.DRAFT="DRAFT",e.PUBLISHED="PUBLISHED",e))(Sr||{}),Ue=(e=>(e.SQL="SQL",e.TABLE="TABLE",e.VIEW="VIEW",e.TABLE_PATTERN="TABLE_PATTERN",e.CONNECTOR="CONNECTOR",e))(Ue||{}),Wm=(e=>(e.ALREADY_PUBLISHED="ALREADY_PUBLISHED",e.INVALID_STORAGE="INVALID_STORAGE",e.MISSING_DEFINITION="MISSING_DEFINITION",e))(Wm||{});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 j4=(e=>(e.SCHEDULED="scheduled",e.MANUAL="manual",e))(j4||{}),Cl=(e=>(e.CONNECTOR="CONNECTOR",e.GOOGLE_SHEETS_EXPORT="GOOGLE_SHEETS_EXPORT",e.LOOKER_STUDIO="LOOKER_STUDIO",e))(Cl||{}),ar=(e=>(e.RUNNING="RUNNING",e.SUCCESS="SUCCESS",e.FAILED="FAILED",e.CANCELLED="CANCELLED",e.INTERRUPTED="INTERRUPTED",e.PENDING="PENDING",e))(ar||{});const _4={statuses:{[Sr.DRAFT]:{code:Sr.DRAFT,displayName:"Draft",description:"Data mart is in draft mode and not yet published"},[Sr.PUBLISHED]:{code:Sr.PUBLISHED,displayName:"Published",description:"Data mart is published and available for use"}},getInfo(e){return this.statuses[e]},getAllStatuses(){return Object.values(this.statuses)}},N4=e=>e?/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+$/.test(e):!1,A4=e=>e?/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_\-*]+$/.test(e):!1,iZ=e=>e?N4(e)?"":"Invalid format. Expected: project.dataset.object":"Fully qualified name is required",lZ=e=>e?A4(e)?"":"Invalid format. Expected: project.dataset.table_* (with wildcards)":"Table pattern is required",D4=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)},O4=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)},cZ=e=>e?D4(e)?"":"Invalid format. Expected: database.object or catalog.database.object":"Fully qualified name is required",uZ=e=>e?O4(e)?"":"Invalid format. Expected: database.table_* or catalog.database.table_* (with wildcards)":"Table pattern is required",dZ=[{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 fZ(e){return"projectId"in e}function hZ(e){return"outputBucket"in e}var Ie=(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))(Ie||{}),wo=(e=>(e.ACTIVE="active",e.COMING_SOON="coming_soon",e))(wo||{});const mZ=({label:e,value:t,truncate:n=!1})=>{const r=typeof t=="string"?t.trim():t,s=r==="";return o.jsxs("div",{className:"grid grid-cols-2 gap-1",children:[o.jsxs("span",{className:"text-muted-foreground text-sm",children:[e,":"]}),n&&r&&!s?o.jsx("span",{className:"truncate text-sm",title:r,children:r.length>30?r.substring(0,30)+"...":r}):o.jsx("span",{className:"text-sm",children:s||r===void 0?o.jsx("span",{className:"text-muted-foreground",children:"—"}):r})]})},pZ=({type:e,config:t})=>{const n={[Ie.GOOGLE_BIGQUERY]:[{label:"Project ID",key:"projectId"},{label:"Location",key:"location"}],[Ie.AWS_ATHENA]:[{label:"Region",key:"region"},{label:"Output Bucket",key:"outputBucket"}],[Ie.SNOWFLAKE]:[],[Ie.DATABRICKS]:[],[Ie.AWS_REDSHIFT]:[],[Ie.AZURE_SYNAPSE]:[]},r=t&&(e===Ie.GOOGLE_BIGQUERY&&fZ(t)||e===Ie.AWS_ATHENA&&hZ(t));return o.jsx("div",{className:"grid gap-2",children:n[e].map(({label:s,key:l})=>{let c;return r&&(c=(e===Ie.GOOGLE_BIGQUERY,t[l])),o.jsx(mZ,{label:s,value:c},l)})})},gZ=({type:e,config:t})=>o.jsx("div",{className:"space-y-4",children:o.jsxs("div",{className:"space-y-1",children:[o.jsx("h4",{className:"text-sm font-medium",children:"Configuration"}),o.jsx(pZ,{type:e,config:t})]})}),yZ=Ef("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 br({className:e,variant:t,asChild:n=!1,...r}){const s=n?Yp:"span";return o.jsx(s,{"data-slot":"badge",className:ne(yZ({variant:t}),e),...r})}function M4(e){return e.type===Ie.GOOGLE_BIGQUERY}function I4(e){return e.type===Ie.AWS_ATHENA}const Bi={types:{[Ie.GOOGLE_BIGQUERY]:{type:Ie.GOOGLE_BIGQUERY,displayName:"Google BigQuery",icon:s4,status:wo.ACTIVE},[Ie.AWS_ATHENA]:{type:Ie.AWS_ATHENA,displayName:"AWS Athena",icon:o4,status:wo.ACTIVE},[Ie.SNOWFLAKE]:{type:Ie.SNOWFLAKE,displayName:"Snowflake",icon:PB,status:wo.COMING_SOON},[Ie.DATABRICKS]:{type:Ie.DATABRICKS,displayName:"Databricks",icon:UB,status:wo.COMING_SOON},[Ie.AWS_REDSHIFT]:{type:Ie.AWS_REDSHIFT,displayName:"AWS Redshift",icon:FB,status:wo.COMING_SOON},[Ie.AZURE_SYNAPSE]:{type:Ie.AZURE_SYNAPSE,displayName:"Azure Synapse",icon:zB,status:wo.COMING_SOON}},getInfo(e){return this.types[e]},getAllTypes(){return Object.values(this.types)}};function vZ({dataStorage:e,isLoading:t=!1}){if(t)return o.jsx("div",{className:"space-y-4",children:o.jsx("div",{className:"grid gap-4",children:Array(4).fill(0).map((c,d)=>o.jsxs("div",{className:"space-y-1",children:[o.jsx(is,{className:"h-5 w-24"}),o.jsx(is,{className:"h-6 w-40"})]},d))})});if(!e)return o.jsx("div",{children:"No storage information available."});const{type:n,config:r,createdAt:s,modifiedAt:l}=e;return o.jsx("div",{className:"space-y-2",children:o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("div",{children:e.title}),o.jsx(br,{variant:"secondary",className:"flex h-7 items-center gap-2",children:(()=>{const{displayName:c,icon:d}=Bi.getInfo(n);return o.jsxs(o.Fragment,{children:[o.jsx(d,{}),c]})})()})]}),o.jsx("div",{className:"bg-muted/10 rounded-md border p-4",children:o.jsx(gZ,{type:n,config:r})}),o.jsxs("div",{className:"text-muted-foreground flex gap-6 text-xs",children:[o.jsxs("div",{children:[o.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(s))]}),o.jsxs("div",{children:[o.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 xZ(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 bZ(e,t,n){const r=encodeURIComponent(e),s=encodeURIComponent(t),l=encodeURIComponent(n);return`https://console.cloud.google.com/bigquery?project=${r}&ws=!1m5!1m4!4m3!1s${r}!2s${s}!3s${l}`}function SZ(e){return`https://console.aws.amazon.com/athena/home?region=${encodeURIComponent(e)}#/query-editor`}function CZ(e,t){const n=xZ(t);if(!n)return null;const{dataset:r,table:s}=n;return M4(e)?bZ(e.config.projectId,r,s):I4(e)?SZ(e.config.region):null}function EZ(e,t){const n=CZ(e,t);return n?(window.open(n,"_blank","noopener,noreferrer"),!0):!1}function wZ(e){return M4(e)?"Open table in Google BigQuery":I4(e)?"Open region in AWS Athena":"Open data in storage"}function k4(e){switch(e.type){case Ie.GOOGLE_BIGQUERY:return!!(e.config.projectId&&e.config.location);case Ie.AWS_ATHENA:return!!(e.config.region&&e.config.outputBucket);default:return!1}}const RZ=an({accessKeyId:sn().min(1,"Access Key ID is required"),secretAccessKey:sn().min(1,"Secret Access Key is required")}),TZ=an({projectId:sn().min(1,"Project ID is required"),location:sn().min(1,"Location is required")}),jZ=an({region:sn().min(1,"Region is required"),outputBucket:sn().min(1,"Output Bucket is required")}),L4=an({title:sn().min(1,"Title is required").max(255,"Title must be 255 characters or less")}),_Z=L4.extend({type:Ks(Ie.GOOGLE_BIGQUERY),credentials:m4,config:TZ}),NZ=L4.extend({type:Ks(Ie.AWS_ATHENA),credentials:RZ,config:jZ}),AZ=h4("type",[_Z,NZ]),DZ=(e,t)=>{if(!e)return!1;switch(t){case Ie.GOOGLE_BIGQUERY:return N4(e);case Ie.AWS_ATHENA:return D4(e);default:return!1}},OZ=(e,t)=>{if(!e)return!1;switch(t){case Ie.GOOGLE_BIGQUERY:return A4(e);case Ie.AWS_ATHENA:return O4(e);default:return!1}},MZ=(e,t)=>{if(!e)return"Fully qualified name is required";switch(t){case Ie.GOOGLE_BIGQUERY:return iZ(e);case Ie.AWS_ATHENA:return cZ(e);default:return"Unsupported storage type"}},IZ=(e,t)=>{if(!e)return"Table pattern is required";switch(t){case Ie.GOOGLE_BIGQUERY:return lZ(e);case Ie.AWS_ATHENA:return uZ(e);default:return"Unsupported storage type"}},P4=e=>{switch(e){case Ie.GOOGLE_BIGQUERY:return"project.dataset.table";case Ie.AWS_ATHENA:return"database.table or catalog.database.table";default:return""}},kZ=e=>{switch(e){case Ie.GOOGLE_BIGQUERY:return"project.dataset.table_*";case Ie.AWS_ATHENA:return"database.table_* or catalog.database.table_*";default:return""}},U4=e=>{switch(e){case Ie.GOOGLE_BIGQUERY:return"Enter the fully qualified name of the table (e.g., project.dataset.table)";case Ie.AWS_ATHENA:return"Enter the fully qualified name of the table (e.g., database.table or catalog.database.table)";default:return""}},LZ=e=>{switch(e){case Ie.GOOGLE_BIGQUERY:return'Enter a pattern to match multiple tables (e.g., project.dataset.table_* will match all tables starting with "table_")';case Ie.AWS_ATHENA:return'Enter a pattern to match multiple tables (e.g., database.table_* will match all tables starting with "table_")';default:return""}};var jn=(e=>(e.SUCCESS="success",e.ERROR="error",e.WARNING="warning",e.INFO="info",e.NEUTRAL="neutral",e))(jn||{});const PZ={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:""},UZ=e=>PZ[e],FZ={[jn.SUCCESS]:{icon:Wp,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"}},[jn.ERROR]:{icon:DL,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"}},[jn.WARNING]:{icon:Qp,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"}},[jn.INFO]:{icon:zr,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"}},[jn.NEUTRAL]:{icon:zr,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 Bf({type:e=jn.NEUTRAL,variant:t="ghost",showIcon:n=!0,children:r,className:s}){const{icon:l,colors:c}=FZ[e],d=f=>{const h="inline-flex items-center gap-1 text-sm",g=UZ(f),y=c[f];return ne(h,g,y,s)};return o.jsxs("span",{className:d(t),children:[n&&o.jsx(l,{className:"h-4 w-4","data-testid":"icon"}),r]})}const F4=/^https:\/\/(docs|spreadsheets)\.google\.com\/spreadsheets\/d\/([a-zA-Z0-9-_]+)/,zZ=/[#&]gid=([0-9]+)/;function z4(e){return F4.test(e)}function VZ(e){const t=F4.exec(e);return t?t[2]:""}function $Z(e){const t=zZ.exec(e);return t?t[1]:"0"}function HZ(e){return{spreadsheetId:VZ(e),sheetId:parseInt($Z(e),10)}}function C1(e,t){return`https://docs.google.com/spreadsheets/d/${e}/edit#gid=${String(t)}`}function BZ(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 Ix(e){return BZ(e,"client_email")}const V4=p.createContext(void 0);var nt=(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))(nt||{}),xa=(e=>(e.GOOGLE_SHEETS_CONFIG="google-sheets-config",e.LOOKER_STUDIO_CONFIG="looker-studio-config",e))(xa||{}),ln=(e=>(e.SUCCESS="SUCCESS",e.RUNNING="RUNNING",e.ERROR="ERROR",e.CANCELLED="CANCELLED",e))(ln||{}),Ln=(e=>(e.EDIT="edit",e.CREATE="create",e))(Ln||{});const GZ={reports:[],destinations:[],currentReport:null,loading:!1,error:null,polledReportIds:[]};function qZ(e,t){switch(t.type){case nt.FETCH_REPORTS_START:case nt.FETCH_REPORT_START:case nt.CREATE_REPORT_START:case nt.UPDATE_REPORT_START:case nt.DELETE_REPORT_START:return{...e,loading:!0,error:null};case nt.FETCH_REPORTS_SUCCESS:return{...e,reports:t.payload,loading:!1,error:null};case nt.FETCH_DESTINATIONS_SUCCESS:return{...e,destinations:t.payload,loading:!1,error:null};case nt.FETCH_REPORT_SUCCESS:return{...e,currentReport:t.payload,loading:!1,error:null};case nt.CREATE_REPORT_SUCCESS:return{...e,reports:[...e.reports,t.payload],loading:!1,error:null};case nt.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 nt.DELETE_REPORT_SUCCESS:return{...e,reports:e.reports.filter(n=>n.id!==t.payload),loading:!1,error:null};case nt.FETCH_REPORTS_ERROR:case nt.FETCH_REPORT_ERROR:case nt.FETCH_DESTINATIONS_ERROR:case nt.CREATE_REPORT_ERROR:case nt.UPDATE_REPORT_ERROR:case nt.DELETE_REPORT_ERROR:return{...e,loading:!1,error:t.payload};case nt.CLEAR_CURRENT_REPORT:return{...e,currentReport:null};case nt.CLEAR_ERROR:return{...e,error:null};case nt.START_POLLING_REPORT:return{...e,polledReportIds:[...e.polledReportIds,t.payload]};case nt.STOP_POLLING_REPORT:return{...e,polledReportIds:e.polledReportIds.filter(n=>n!==t.payload)};case nt.STOP_ALL_POLLING:return{...e,polledReportIds:[]};case nt.UPDATE_POLLED_REPORT:{const n=e.reports.find(r=>r.id===t.payload.id);return n&&t.payload.lastRunStatus!==ln.RUNNING||(n==null?void 0:n.lastRunStatus)!==ln.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 $4({children:e}){const[t,n]=p.useReducer(qZ,GZ);return o.jsx(V4.Provider,{value:{state:t,dispatch:n},children:e})}function ZZ(){const e=p.useContext(V4);if(e===void 0)throw new Error("useReportContext must be used within a ReportProvider");return e}class KZ extends Zl{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 Co=new KZ,YZ={initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3};class WZ{constructor(){Ns(this,"pollingTimers",new Map);Ns(this,"pollCounters",new Map);Ns(this,"config",YZ)}setConfig(t){this.config={...this.config,...t}}startPolling(t,n){this.stopPolling(t),this.pollCounters.set(t,0);const r=async()=>{try{const s=this.pollCounters.get(t)??0;this.pollCounters.set(t,s+1);const l=await Co.getReportById(t);if(n(l),l.lastRunStatus!==ln.RUNNING){this.stopPolling(t);return}const d=s<this.config.initialPollCount?this.config.initialPollingIntervalMs:this.config.regularPollingIntervalMs,f=setTimeout(()=>{r()},d);this.pollingTimers.set(t,f)}catch(s){console.error(`Error polling report status for ${t}:`,s),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 jm=new WZ;var Dt=(e=>(e.GOOGLE_SHEETS="GOOGLE_SHEETS",e.LOOKER_STUDIO="LOOKER_STUDIO",e.ODATA="OData",e))(Dt||{}),nu=(e=>(e.ACTIVE="Active",e.COMING_SOON="Coming soon",e))(nu||{}),El=(e=>(e.GOOGLE_SHEETS_CREDENTIALS="google-sheets-credentials",e.LOOKER_STUDIO_CREDENTIALS="looker-studio-credentials",e))(El||{});class QZ extends Zl{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 pl=new QZ,Ll={types:{[Dt.GOOGLE_SHEETS]:{type:Dt.GOOGLE_SHEETS,displayName:"Google Sheets",icon:i4,status:nu.ACTIVE},[Dt.LOOKER_STUDIO]:{type:Dt.LOOKER_STUDIO,displayName:"Looker Studio",icon:kB,status:nu.ACTIVE},[Dt.ODATA]:{type:Dt.ODATA,displayName:"OData",icon:LB,status:nu.COMING_SOON}},getInfo(e){return this.types[e]},getAllTypes(){return Object.values(this.types)}},XZ=an({deploymentUrl:sn().optional(),destinationId:sn().optional(),destinationSecretKey:sn().optional()}),H4=an({title:sn().min(1,"Title is required"),type:x1(Dt)}),JZ=H4.extend({type:Ks(Dt.GOOGLE_SHEETS),credentials:m4}),eK=H4.extend({type:Ks(Dt.LOOKER_STUDIO),credentials:XZ.optional()}),tK=h4("type",[JZ,eK]),B4=p.createContext(void 0);var Ot=(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))(Ot||{});const nK={dataDestinations:[],currentDataDestination:null,loading:!1,error:null};function rK(e,t){switch(t.type){case Ot.FETCH_DESTINATIONS_START:case Ot.FETCH_DESTINATION_START:case Ot.CREATE_DESTINATION_START:case Ot.UPDATE_DESTINATION_START:case Ot.DELETE_DESTINATION_START:return{...e,loading:!0,error:null};case Ot.FETCH_DESTINATIONS_SUCCESS:return{...e,dataDestinations:t.payload,loading:!1,error:null};case Ot.FETCH_DESTINATION_SUCCESS:return{...e,currentDataDestination:t.payload,loading:!1,error:null};case Ot.CREATE_DESTINATION_SUCCESS:return{...e,dataDestinations:[...e.dataDestinations,t.payload],loading:!1,error:null};case Ot.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 Ot.DELETE_DESTINATION_SUCCESS:return{...e,dataDestinations:e.dataDestinations.filter(n=>n.id!==t.payload),loading:!1,error:null};case Ot.FETCH_DESTINATIONS_ERROR:case Ot.FETCH_DESTINATION_ERROR:case Ot.CREATE_DESTINATION_ERROR:case Ot.UPDATE_DESTINATION_ERROR:case Ot.DELETE_DESTINATION_ERROR:return{...e,loading:!1,error:t.payload};case Ot.CLEAR_CURRENT_DESTINATION:return{...e,currentDataDestination:null};case Ot.CLEAR_ERROR:return{...e,error:null};default:return e}}function Eg({children:e}){const[t,n]=p.useReducer(rK,nK);return o.jsx(B4.Provider,{value:{state:t,dispatch:n},children:e})}function aK(){const e=p.useContext(B4);if(e===void 0)throw new Error("useDataDestinationContext must be used within a DataDestinationProvider");return e}class sK{mapFromDto(t){let n="";try{t.credentials.type===El.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:Dt.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:El.GOOGLE_SHEETS_CREDENTIALS}),r}mapToCreateRequest(t){const n=t;return{title:n.title,type:Dt.GOOGLE_SHEETS,credentials:{serviceAccountKey:JSON.parse(n.credentials.serviceAccount),type:El.GOOGLE_SHEETS_CREDENTIALS}}}}class oK{mapFromDto(t){const n=this.extractLookerStudioCredentials(t.credentials);return{id:t.id,title:t.title,type:Dt.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:El.LOOKER_STUDIO_CREDENTIALS}}}mapToCreateRequest(t){return{title:t.title,type:Dt.LOOKER_STUDIO,credentials:{type:El.LOOKER_STUDIO_CREDENTIALS}}}extractLookerStudioCredentials(t){return t.type===El.LOOKER_STUDIO_CREDENTIALS?{deploymentUrl:t.deploymentUrl,destinationId:t.destinationId,destinationSecretKey:t.destinationSecretKey}:{deploymentUrl:"",destinationId:"",destinationSecretKey:""}}}const G4={getMapper(e){switch(e){case Dt.GOOGLE_SHEETS:return new sK;case Dt.LOOKER_STUDIO:return new oK;default:throw new Error(`Unknown destination type: ${e}`)}}};function Bc(e){return G4.getMapper(e.type).mapFromDto(e)}function wg(){const{state:e,dispatch:t}=aK(),n=p.useCallback(async()=>{t({type:Ot.FETCH_DESTINATIONS_START});try{const g=(await pl.getDataDestinations()).map(Bc);t({type:Ot.FETCH_DESTINATIONS_SUCCESS,payload:g})}catch(h){const g=h instanceof Error?h.message:"Failed to load destinations";t({type:Ot.FETCH_DESTINATIONS_ERROR,payload:g}),Pe({event:"data_destination_error",category:"DataDestination",action:"ListError",label:g})}},[t]),r=p.useCallback(async h=>{try{const g=await pl.getDataDestinationById(h),y=Bc(g);t({type:Ot.FETCH_DESTINATION_SUCCESS,payload:y})}catch(g){const y=g instanceof Error?g.message:"Failed to load destination";t({type:Ot.FETCH_DESTINATION_ERROR,payload:y}),Pe({event:"data_destination_error",category:"DataDestination",action:"GetError",label:y})}},[t]),s=p.useCallback(async h=>{t({type:Ot.CREATE_DESTINATION_START});try{const g=await pl.createDataDestination(h),y=Bc(g);return t({type:Ot.CREATE_DESTINATION_SUCCESS,payload:y}),Pe({event:"data_destination_created",category:"DataDestination",action:"Create",label:y.type}),At.success("Destination created"),y}catch(g){const y=g instanceof Error?g.message:"Failed to create destination";return t({type:Ot.CREATE_DESTINATION_ERROR,payload:y}),Pe({event:"data_destination_error",category:"DataDestination",action:"CreateError",label:h.type}),null}},[t]),l=p.useCallback(async(h,g)=>{t({type:Ot.UPDATE_DESTINATION_START});try{const y=await pl.updateDataDestination(h,g),v=Bc(y);return t({type:Ot.UPDATE_DESTINATION_SUCCESS,payload:v}),Pe({event:"data_destination_updated",category:"DataDestination",action:"Update",label:v.type}),At.success("Destination updated"),v}catch(y){const v=y instanceof Error?y.message:"Failed to update destination";return t({type:Ot.UPDATE_DESTINATION_ERROR,payload:v}),Pe({event:"data_destination_error",category:"DataDestination",action:"UpdateError",label:v}),null}},[t]),c=p.useCallback(async h=>{t({type:Ot.DELETE_DESTINATION_START});try{await pl.deleteDataDestination(h),t({type:Ot.DELETE_DESTINATION_SUCCESS,payload:h}),Pe({event:"data_destination_deleted",category:"DataDestination",action:"Delete"}),At.success("Destination deleted")}catch(g){const y=g instanceof Error?g.message:"Failed to delete destination";throw t({type:Ot.DELETE_DESTINATION_ERROR,payload:y}),Pe({event:"data_destination_error",category:"DataDestination",action:"DeleteError",label:y}),g}},[t]),d=p.useCallback(()=>{t({type:Ot.CLEAR_CURRENT_DESTINATION})},[t]),f=p.useCallback(async h=>{try{const g=await pl.rotateSecretKey(h),y=Bc(g);return Pe({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 Pe({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:s,updateDataDestination:l,deleteDataDestination:c,clearCurrentDataDestination:d,rotateSecretKey:f}}function iK(e){const t=Ll.getInfo(e.type),n=t.status===nu.ACTIVE;return{destinationInfo:t,isVisible:n}}function lK(){const{dataMart:e}=Wa(),{fetchReportsByDataMartId:t}=Kl(),{dataDestinations:n,fetchDataDestinations:r,loading:s}=wg(),[l,c]=p.useState(!0);return p.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||s}}function E1(e){return JSON.stringify(e,null,2)}class cK{mapFromDto(t){if(t.type!==xa.GOOGLE_SHEETS_CONFIG)throw new Error("Invalid destination config type");return{type:xa.GOOGLE_SHEETS_CONFIG,spreadsheetId:t.spreadsheetId,sheetId:t.sheetId.toString()}}}class uK{mapFromDto(t){if(t.type!==xa.LOOKER_STUDIO_CONFIG)throw new Error("Invalid destination config type");return{type:xa.LOOKER_STUDIO_CONFIG,cacheLifetime:t.cacheLifetime}}}const dK={getMapper(e){switch(e){case xa.GOOGLE_SHEETS_CONFIG:return new cK;case xa.LOOKER_STUDIO_CONFIG:return new uK;default:throw new Error(`Unknown destination config type: ${String(e)}`)}}};function fK(e){return dK.getMapper(e.type).mapFromDto(e)}function gl(e){const t=fK(e.destinationConfig);return{id:e.id,title:e.title,dataMart:{id:e.dataMart.id},dataDestination:Bc(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 Kl(){const{state:e,dispatch:t}=ZZ(),n=p.useCallback(async()=>{t({type:nt.FETCH_DESTINATIONS_START});try{const S=await pl.getDataDestinations();t({type:nt.FETCH_DESTINATIONS_SUCCESS,payload:S})}catch(S){const R=S instanceof Error?S.message:"Failed to fetch destinations";t({type:nt.FETCH_DESTINATIONS_ERROR,payload:R}),Pe({event:"report_error",category:"Report",action:"DestinationsListError",label:R})}},[t]),r=p.useCallback(async()=>{t({type:nt.FETCH_REPORTS_START});try{const R=(await Co.getReportsByProject()).map(gl);t({type:nt.FETCH_REPORTS_SUCCESS,payload:R})}catch(S){const R=S instanceof Error?S.message:"Failed to fetch reports";t({type:nt.FETCH_REPORTS_ERROR,payload:R}),Pe({event:"report_error",category:"Report",action:"ListError",label:R})}},[t]),s=p.useCallback(async(S,R)=>{R!=null&&R.silent||t({type:nt.FETCH_REPORTS_START});try{const _=(await Co.getReportsByDataMartId(S,R!=null&&R.silent?{skipLoadingIndicator:!0}:void 0)).map(gl);t({type:nt.FETCH_REPORTS_SUCCESS,payload:_})}catch(T){const _=T instanceof Error?T.message:"Failed to fetch reports";t({type:nt.FETCH_REPORTS_ERROR,payload:_}),Pe({event:"report_error",category:"Report",action:"ListError",label:_})}},[t]),l=p.useCallback(async S=>{t({type:nt.FETCH_REPORT_START});try{const R=await Co.getReportById(S),T=gl(R);t({type:nt.FETCH_REPORT_SUCCESS,payload:T})}catch(R){const T=R instanceof Error?R.message:"Failed to fetch report";t({type:nt.FETCH_REPORT_ERROR,payload:T}),Pe({event:"report_error",category:"Report",action:"GetError",label:T})}},[t]),c=p.useCallback(async S=>{t({type:nt.CREATE_REPORT_START});try{const R=await Co.createReport(S),T=gl(R);return t({type:nt.CREATE_REPORT_SUCCESS,payload:T}),Pe({event:"report_created",category:"Report",action:"Create",label:T.dataDestination.type}),At.success("Report created"),T}catch(R){const T=R instanceof Error?R.message:"Failed to create report";return t({type:nt.CREATE_REPORT_ERROR,payload:T}),Pe({event:"report_error",category:"Report",action:"CreateError",label:S.destinationConfig.type}),null}},[t]),d=p.useCallback(async(S,R)=>{t({type:nt.UPDATE_REPORT_START});try{const T=await Co.updateReport(S,R),_=gl(T);return t({type:nt.UPDATE_REPORT_SUCCESS,payload:_}),Pe({event:"report_updated",category:"Report",action:"Update",label:_.dataDestination.type}),At.success("Report updated"),_}catch(T){const _=T instanceof Error?T.message:"Failed to update report";return t({type:nt.UPDATE_REPORT_ERROR,payload:_}),Pe({event:"report_error",category:"Report",action:"UpdateError",label:_}),null}},[t]),f=p.useCallback(async S=>{t({type:nt.DELETE_REPORT_START});try{await Co.deleteReport(S),t({type:nt.DELETE_REPORT_SUCCESS,payload:S}),Pe({event:"report_deleted",category:"Report",action:"Delete"}),At.success("Report deleted")}catch(R){const T=R instanceof Error?R.message:"Failed to delete report";t({type:nt.DELETE_REPORT_ERROR,payload:T}),Pe({event:"report_error",category:"Report",action:"DeleteError",label:T})}},[t]),h=p.useCallback(()=>{t({type:nt.CLEAR_CURRENT_REPORT})},[t]),g=p.useCallback(()=>{t({type:nt.CLEAR_ERROR})},[t]),y=p.useCallback(S=>{jm.stopPolling(S),t({type:nt.STOP_POLLING_REPORT,payload:S})},[t]),v=p.useCallback(S=>{e.polledReportIds.includes(S)&&y(S),t({type:nt.START_POLLING_REPORT,payload:S}),jm.startPolling(S,R=>{const T=gl(R);t({type:nt.UPDATE_POLLED_REPORT,payload:T})})},[t,e.polledReportIds,y]),b=p.useCallback(()=>{jm.stopAllPolling(),t({type:nt.STOP_ALL_POLLING})},[t]),w=p.useCallback(S=>{jm.setConfig(S)},[]),E=p.useCallback(async S=>{try{y(S),await Co.runReport(S),await l(S),v(S),Pe({event:"report_run_started",category:"Report",action:"Run",label:S}),At.success("Report run started")}catch(R){const T=R instanceof Error?R.message:"Failed to run report";Pe({event:"report_error",category:"Report",action:"RunError",label:T}),console.error("Failed to run report:",R)}},[l,v,y]);return p.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:s,fetchReportById:l,createReport:c,updateReport:d,deleteReport:f,runReport:E,startPollingReport:v,stopPollingReport:y,stopAllPolling:b,setPollingConfig:w,clearCurrentReport:h,clearError:g}}ln.SUCCESS+"",ln.SUCCESS,ln.RUNNING+"",ln.RUNNING,ln.ERROR+"",ln.ERROR,ln.CANCELLED+"",ln.CANCELLED;var kx,Rg="HoverCard",[q4]=ir(Rg,[Zs]),Tg=Zs(),[hK,jg]=q4(Rg),Z4=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:s,onOpenChange:l,openDelay:c=700,closeDelay:d=300}=e,f=Tg(t),h=p.useRef(0),g=p.useRef(0),y=p.useRef(!1),v=p.useRef(!1),[b,w]=Vr({prop:r,defaultProp:s??!1,onChange:l,caller:Rg}),E=p.useCallback(()=>{clearTimeout(g.current),h.current=window.setTimeout(()=>w(!0),c)},[c,w]),S=p.useCallback(()=>{clearTimeout(h.current),!y.current&&!v.current&&(g.current=window.setTimeout(()=>w(!1),d))},[d,w]),R=p.useCallback(()=>w(!1),[w]);return p.useEffect(()=>()=>{clearTimeout(h.current),clearTimeout(g.current)},[]),o.jsx(hK,{scope:t,open:b,onOpenChange:w,onOpen:E,onClose:S,onDismiss:R,hasSelectionRef:y,isPointerDownOnContentRef:v,children:o.jsx(wu,{...f,children:n})})};Z4.displayName=Rg;var K4="HoverCardTrigger",Y4=p.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=jg(K4,n),l=Tg(n);return o.jsx(Ru,{asChild:!0,...l,children:o.jsx(Je.a,{"data-state":s.open?"open":"closed",...r,ref:t,onPointerEnter:Te(e.onPointerEnter,Dp(s.onOpen)),onPointerLeave:Te(e.onPointerLeave,Dp(s.onClose)),onFocus:Te(e.onFocus,s.onOpen),onBlur:Te(e.onBlur,s.onClose),onTouchStart:Te(e.onTouchStart,c=>c.preventDefault())})})});Y4.displayName=K4;var w1="HoverCardPortal",[mK,pK]=q4(w1,{forceMount:void 0}),W4=e=>{const{__scopeHoverCard:t,forceMount:n,children:r,container:s}=e,l=jg(w1,t);return o.jsx(mK,{scope:t,forceMount:n,children:o.jsx(Er,{present:n||l.open,children:o.jsx(Bl,{asChild:!0,container:s,children:r})})})};W4.displayName=w1;var Ap="HoverCardContent",Q4=p.forwardRef((e,t)=>{const n=pK(Ap,e.__scopeHoverCard),{forceMount:r=n.forceMount,...s}=e,l=jg(Ap,e.__scopeHoverCard);return o.jsx(Er,{present:r||l.open,children:o.jsx(gK,{"data-state":l.open?"open":"closed",...s,onPointerEnter:Te(e.onPointerEnter,Dp(l.onOpen)),onPointerLeave:Te(e.onPointerLeave,Dp(l.onClose)),ref:t})})});Q4.displayName=Ap;var gK=p.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:l,onInteractOutside:c,...d}=e,f=jg(Ap,n),h=Tg(n),g=p.useRef(null),y=ut(t,g),[v,b]=p.useState(!1);return p.useEffect(()=>{if(v){const w=document.body;return kx=w.style.userSelect||w.style.webkitUserSelect,w.style.userSelect="none",w.style.webkitUserSelect="none",()=>{w.style.userSelect=kx,w.style.webkitUserSelect=kx}}},[v]),p.useEffect(()=>{if(g.current){const w=()=>{b(!1),f.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var S;((S=document.getSelection())==null?void 0:S.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]),p.useEffect(()=>{g.current&&xK(g.current).forEach(E=>E.setAttribute("tabindex","-1"))}),o.jsx(Hl,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:c,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:Te(l,w=>{w.preventDefault()}),onDismiss:f.onDismiss,children:o.jsx(Af,{...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",vK=p.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=Tg(n);return o.jsx(Df,{...s,...r,ref:t})});vK.displayName=yK;function Dp(e){return t=>t.pointerType==="touch"?void 0:e()}function xK(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 bK=Z4,SK=Y4,CK=W4,EK=Q4;const R1=({...e})=>o.jsx(bK,{"data-slot":"hover-card",...e});R1.displayName="HoverCard";const T1=p.forwardRef(({...e},t)=>o.jsx(SK,{"data-slot":"hover-card-trigger",ref:t,...e}));T1.displayName="HoverCardTrigger";const j1=p.forwardRef(({className:e,align:t="center",sideOffset:n=4,onClick:r,...s},l)=>{const c=d=>{d.stopPropagation(),r&&r(d)};return o.jsx(CK,{children:o.jsx(EK,{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,...s})})});j1.displayName="HoverCardContent";const _1=p.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:ne("border-border flex gap-4 border-b pb-4",e),...t}));_1.displayName="HoverCardHeader";const N1=p.forwardRef(({className:e,...t},n)=>o.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}));N1.displayName="HoverCardHeaderIcon";const A1=p.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:ne("flex flex-col space-y-1",e),...t}));A1.displayName="HoverCardHeaderText";const D1=p.forwardRef(({className:e,...t},n)=>o.jsx("h2",{ref:n,className:ne("text-md pt-1 leading-snug font-semibold",e),...t}));D1.displayName="HoverCardHeaderTitle";const O1=p.forwardRef(({className:e,...t},n)=>o.jsx("p",{ref:n,className:ne("text-muted-foreground text-sm",e),...t}));O1.displayName="HoverCardHeaderDescription";const M1=p.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:ne("flex flex-col",e),...t}));M1.displayName="HoverCardBody";const Si=p.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:ne("border-border flex items-center justify-between border-b py-4",e),...t}));Si.displayName="HoverCardItem";const Ci=p.forwardRef(({className:e,...t},n)=>o.jsx("span",{ref:n,className:ne("text-muted-foreground text-sm",e),...t}));Ci.displayName="HoverCardItemLabel";const Ei=p.forwardRef(({className:e,...t},n)=>o.jsx("span",{ref:n,className:ne("text-sm",e),...t}));Ei.displayName="HoverCardItemValue";const I1=p.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:ne("pt-4 pb-2",e),...t}));I1.displayName="HoverCardFooter";function _g(e){return e.type===xa.GOOGLE_SHEETS_CONFIG}function X4(e){return e.type===xa.LOOKER_STUDIO_CONFIG}function Pl({date:e,className:t=""}){const n=p.useMemo(()=>{const r=new Date,s=e.getTime()-r.getTime(),l=Math.abs(s),c=s<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=E=>E.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}),w=E=>E.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 E=b(e);return c?`Yesterday at ${E}`:`Tomorrow at ${E}`}if(h<7){const E=w(e),S=b(e);return c?`Last ${E} at ${S}`:`This ${E} at ${S}`}if(h<14){const E=w(e),S=b(e);return c?`Last ${E} at ${S}`:`Next ${E} at ${S}`}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 o.jsx("span",{className:`${t}`,title:e.toLocaleString(),children:n})}const wK=()=>{const e=p.useMemo(()=>new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),[]),t=p.useMemo(()=>new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}),[]);return{detailedDateFormatter:e,shortDateFormatter:t}},RK=ye.memo(function({report:t,children:n}){const{detailedDateFormatter:r,shortDateFormatter:s}=wK(),l=p.useMemo(()=>t.lastRunStatus?{statusType:_K(t.lastRunStatus),statusText:AK(t.lastRunStatus)}:null,[t.lastRunStatus]),c=p.useMemo(()=>({modifiedAt:r.format(new Date(t.modifiedAt)),createdAt:s.format(new Date(t.createdAt))}),[t.modifiedAt,t.createdAt,r,s]),d=p.useMemo(()=>_g(t.destinationConfig)?{isGoogleSheets:!0,spreadsheetId:t.destinationConfig.spreadsheetId,sheetId:t.destinationConfig.sheetId}:{isGoogleSheets:!1,spreadsheetId:null,sheetId:null},[t.destinationConfig]),f=p.useCallback(()=>{if(!d.isGoogleSheets||!d.spreadsheetId||!d.sheetId)return;const h=C1(d.spreadsheetId,d.sheetId);window.open(h,"_blank","noopener,noreferrer")},[d]);return o.jsxs(R1,{children:[o.jsx(T1,{asChild:!0,children:o.jsx("span",{children:n})}),o.jsxs(j1,{children:[o.jsxs(_1,{children:[o.jsx(N1,{children:o.jsx(i4,{size:20})}),o.jsxs(A1,{children:[o.jsx(D1,{children:t.title||"Unnamed Report"}),o.jsxs(O1,{children:["Last modified ",o.jsx(Pl,{date:new Date(t.modifiedAt)})]})]})]}),o.jsxs(M1,{children:[o.jsxs(Si,{children:[o.jsx(Ci,{children:"Last run status:"}),o.jsx(Ei,{children:l?o.jsx(Bf,{type:l.statusType,variant:"ghost",children:l.statusText}):"Not run yet"})]}),o.jsxs(Si,{children:[o.jsx(Ci,{children:"Last run date:"}),o.jsx(Ei,{children:t.lastRunDate?o.jsx(Pl,{date:t.lastRunDate}):"Never run"})]}),t.lastRunError&&o.jsxs(Si,{children:[o.jsx(Ci,{children:"Error message:"}),o.jsx(Ei,{children:t.lastRunError})]}),o.jsxs(Si,{children:[o.jsx(Ci,{children:"Total runs:"}),o.jsxs(Ei,{children:[t.runsCount||0," runs",c.createdAt&&o.jsxs(o.Fragment,{children:[", since ",c.createdAt]})]})]})]}),d.isGoogleSheets&&o.jsx(I1,{children:o.jsxs(Se,{className:"w-full",variant:"default",onClick:f,title:"Open in Google Sheets","aria-label":"Open in Google Sheets",children:["Open in Google Sheets",o.jsx(_l,{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)),TK=e=>{switch(e){case Sr.DRAFT:return jn.NEUTRAL;case Sr.PUBLISHED:return jn.SUCCESS;default:return jn.NEUTRAL}},jK=e=>{switch(e){case ar.SUCCESS:return jn.SUCCESS;case ar.RUNNING:return jn.INFO;case ar.FAILED:case ar.CANCELLED:case ar.INTERRUPTED:return jn.ERROR;default:return jn.NEUTRAL}},_K=e=>{switch(e){case ln.SUCCESS:return jn.SUCCESS;case ln.RUNNING:return jn.INFO;case ln.ERROR:return jn.ERROR;default:return jn.NEUTRAL}},NK=e=>{switch(e){case ar.SUCCESS:return"Success";case ar.RUNNING:return"Running";case ar.FAILED:return"Failed";case ar.CANCELLED:return"Cancelled";case ar.INTERRUPTED:return"Interrupted";case ar.PENDING:return"Pending";default:return"Unknown"}},AK=e=>{switch(e){case ln.SUCCESS:return"Success";case ln.RUNNING:return"Running";case ln.ERROR:return"Failed";default:return"Unknown"}},J4=e=>an({fullyQualifiedName:sn().min(1,"Fully qualified name is required").refine(t=>DZ(t,e),t=>({message:MZ(t,e)}))}),DK=e=>an({pattern:sn().min(1,"Table pattern is required").refine(t=>OZ(t,e),t=>({message:IZ(t,e)}))}),OK=e=>{const t=[];return e.status.code===Sr.PUBLISHED&&t.push(Wm.ALREADY_PUBLISHED),k4(e.storage)||t.push(Wm.INVALID_STORAGE),e.definition||t.push(Wm.MISSING_DEFINITION),t},MK=e=>e.map(t=>oZ[t]);function IK(e){return e.map(t=>({id:t.id,title:t.title,status:_4.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 e3(){const{state:e,dispatch:t}=aZ(),n=p.useCallback(async()=>{t({type:"SET_LOADING"});try{const l=await nn.getDataMarts(),c=IK(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=p.useCallback(async l=>{t({type:"SET_LOADING"});try{await nn.deleteDataMart(l),Pe({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}),Pe({event:"data_mart_error",category:"DataMart",action:"DeleteError",label:d}),c}},[t]),s=p.useCallback(()=>n(),[n]);return{items:e.items,loading:e.loading,error:e.error,loadDataMarts:n,refreshList:s,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 wi(e,t){return typeof e=="function"?e(t):e}function ba(e,t){return n=>{t.setState(r=>({...r,[e]:wi(n,r[e])}))}}function Ng(e){return e instanceof Function}function kK(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function LK(e,t){const n=[],r=s=>{s.forEach(l=>{n.push(l);const c=t(l);c!=null&&c.length&&r(c)})};return r(e),n}function rt(e,t,n){let r=[],s;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 s;r=d;let h;if(n.key&&n.debug&&(h=Date.now()),s=t(...d),n==null||n.onChange==null||n.onChange(s),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,E)=>{for(w=String(w);w.length<E;)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 s}}function at(e,t,n,r){return{debug:()=>{var s;return(s=e==null?void 0:e.debugAll)!=null?s:e[t]},key:!1,onChange:r}}function PK(e,t,n,r){const s=()=>{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:s,getContext:rt(()=>[e,n,t,l],(c,d,f,h)=>({table:c,column:d,row:f,cell:h,getValue:h.getValue,renderValue:h.renderValue}),at(e.options,"debugCells"))};return e._features.forEach(c=>{c.createCell==null||c.createCell(l,n,t,e)},{}),l}function UK(e,t,n,r){var s,l;const d={...e._getDefaultColumnDef(),...t},f=d.accessorKey;let h=(s=(l=d.id)!=null?l:f?typeof String.prototype.replaceAll=="function"?f.replaceAll(".","_"):f.replace(/\./g,"_"):void 0)!=null?s: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 E of f.split(".")){var w;b=(w=b)==null?void 0:w[E]}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:rt(()=>[!0],()=>{var v;return[y,...(v=y.columns)==null?void 0:v.flatMap(b=>b.getFlatColumns())]},at(e.options,"debugColumns")),getLeafColumns:rt(()=>[e._getOrderColumnsFn()],v=>{var b;if((b=y.columns)!=null&&b.length){let w=y.columns.flatMap(E=>E.getLeafColumns());return v(w)}return[y]},at(e.options,"debugColumns"))};for(const v of e._features)v.createColumn==null||v.createColumn(y,e);return y}const Ar="debugHeaders";function ET(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 FK={createTable:e=>{e.getHeaderGroups=rt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,s)=>{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=s==null?void 0:s.map(y=>n.find(v=>v.id===y)).filter(Boolean))!=null?c:[],h=n.filter(y=>!(r!=null&&r.includes(y.id))&&!(s!=null&&s.includes(y.id)));return _m(t,[...d,...h,...f],e)},at(e.options,Ar)),e.getCenterHeaderGroups=rt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,s)=>(n=n.filter(l=>!(r!=null&&r.includes(l.id))&&!(s!=null&&s.includes(l.id))),_m(t,n,e,"center")),at(e.options,Ar)),e.getLeftHeaderGroups=rt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var s;const l=(s=r==null?void 0:r.map(c=>n.find(d=>d.id===c)).filter(Boolean))!=null?s:[];return _m(t,l,e,"left")},at(e.options,Ar)),e.getRightHeaderGroups=rt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var s;const l=(s=r==null?void 0:r.map(c=>n.find(d=>d.id===c)).filter(Boolean))!=null?s:[];return _m(t,l,e,"right")},at(e.options,Ar)),e.getFooterGroups=rt(()=>[e.getHeaderGroups()],t=>[...t].reverse(),at(e.options,Ar)),e.getLeftFooterGroups=rt(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),at(e.options,Ar)),e.getCenterFooterGroups=rt(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),at(e.options,Ar)),e.getRightFooterGroups=rt(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),at(e.options,Ar)),e.getFlatHeaders=rt(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),at(e.options,Ar)),e.getLeftFlatHeaders=rt(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),at(e.options,Ar)),e.getCenterFlatHeaders=rt(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),at(e.options,Ar)),e.getRightFlatHeaders=rt(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),at(e.options,Ar)),e.getCenterLeafHeaders=rt(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),at(e.options,Ar)),e.getLeftLeafHeaders=rt(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),at(e.options,Ar)),e.getRightLeafHeaders=rt(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),at(e.options,Ar)),e.getLeafHeaders=rt(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var s,l,c,d,f,h;return[...(s=(l=t[0])==null?void 0:l.headers)!=null?s:[],...(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()},at(e.options,Ar))}};function _m(e,t,n,r){var s,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 E;(E=w.columns)!=null&&E.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:[]},E=[];v.forEach(S=>{const R=[...E].reverse()[0],T=S.column.depth===w.depth;let _,D=!1;if(T&&S.column.parent?_=S.column.parent:(_=S.column,D=!0),R&&(R==null?void 0:R.column)===_)R.subHeaders.push(S);else{const A=ET(n,_,{id:[r,b,_.id,S==null?void 0:S.id].filter(Boolean).join("_"),isPlaceholder:D,placeholderId:D?`${E.filter(O=>O.column===_).length}`:void 0,depth:b,index:E.length});A.subHeaders.push(S),E.push(A)}w.headers.push(S),S.headerGroup=w}),f.push(w),b>0&&h(E,b-1)},g=t.map((v,b)=>ET(n,v,{depth:c,index:b}));h(g,c-1),f.reverse();const y=v=>v.filter(w=>w.column.getIsVisible()).map(w=>{let E=0,S=0,R=[0];w.subHeaders&&w.subHeaders.length?(R=[],y(w.subHeaders).forEach(_=>{let{colSpan:D,rowSpan:A}=_;E+=D,R.push(A)})):E=1;const T=Math.min(...R);return S=S+T,w.colSpan=E,w.rowSpan=S,{colSpan:E,rowSpan:S}});return y((s=(l=f[0])==null?void 0:l.headers)!=null?s:[]),f}const k1=(e,t,n,r,s,l,c)=>{let d={id:t,index:r,original:n,depth:s,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:()=>LK(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:rt(()=>[e.getAllLeafColumns()],f=>f.map(h=>PK(e,d,h,h.id)),at(e.options,"debugRows")),_getAllCellsByColumnId:rt(()=>[d.getAllCells()],f=>f.reduce((h,g)=>(h[g.column.id]=g,h),{}),at(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},zK={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()}}},t3=(e,t,n)=>{var r,s;const l=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((s=e.getValue(t))==null||(s=s.toString())==null||(s=s.toLowerCase())==null)&&s.includes(l))};t3.autoRemove=e=>hs(e);const n3=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};n3.autoRemove=e=>hs(e);const r3=(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())};r3.autoRemove=e=>hs(e);const a3=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};a3.autoRemove=e=>hs(e);const s3=(e,t,n)=>!n.some(r=>{var s;return!((s=e.getValue(t))!=null&&s.includes(r))});s3.autoRemove=e=>hs(e)||!(e!=null&&e.length);const o3=(e,t,n)=>n.some(r=>{var s;return(s=e.getValue(t))==null?void 0:s.includes(r)});o3.autoRemove=e=>hs(e)||!(e!=null&&e.length);const i3=(e,t,n)=>e.getValue(t)===n;i3.autoRemove=e=>hs(e);const l3=(e,t,n)=>e.getValue(t)==n;l3.autoRemove=e=>hs(e);const L1=(e,t,n)=>{let[r,s]=n;const l=e.getValue(t);return l>=r&&l<=s};L1.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,s=typeof n!="number"?parseFloat(n):n,l=t===null||Number.isNaN(r)?-1/0:r,c=n===null||Number.isNaN(s)?1/0:s;if(l>c){const d=l;l=c,c=d}return[l,c]};L1.autoRemove=e=>hs(e)||hs(e[0])&&hs(e[1]);const Eo={includesString:t3,includesStringSensitive:n3,equalsString:r3,arrIncludes:a3,arrIncludesAll:s3,arrIncludesSome:o3,equals:i3,weakEquals:l3,inNumberRange:L1};function hs(e){return e==null||e===""}const VK={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:ba("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"?Eo.includesString:typeof r=="number"?Eo.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Eo.equals:Array.isArray(r)?Eo.arrIncludes:Eo.weakEquals},e.getFilterFn=()=>{var n,r;return Ng(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:Eo[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,s;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((s=t.options.enableFilters)!=null?s:!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(s=>s.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const s=e.getFilterFn(),l=r==null?void 0:r.find(g=>g.id===e.id),c=wi(n,l?l.value:void 0);if(wT(s,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=s=>{var l;return(l=wi(t,s))==null?void 0:l.filter(c=>{const d=n.find(f=>f.id===c.id);if(d){const f=d.getFilterFn();if(wT(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 wT(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const $K=(e,t,n)=>n.reduce((r,s)=>{const l=s.getValue(e);return r+(typeof l=="number"?l:0)},0),HK=(e,t,n)=>{let r;return n.forEach(s=>{const l=s.getValue(e);l!=null&&(r>l||r===void 0&&l>=l)&&(r=l)}),r},BK=(e,t,n)=>{let r;return n.forEach(s=>{const l=s.getValue(e);l!=null&&(r<l||r===void 0&&l>=l)&&(r=l)}),r},GK=(e,t,n)=>{let r,s;return n.forEach(l=>{const c=l.getValue(e);c!=null&&(r===void 0?c>=c&&(r=s=c):(r>c&&(r=c),s<c&&(s=c)))}),[r,s]},qK=(e,t)=>{let n=0,r=0;if(t.forEach(s=>{let l=s.getValue(e);l!=null&&(l=+l)>=l&&(++n,r+=l)}),n)return r/n},ZK=(e,t)=>{if(!t.length)return;const n=t.map(l=>l.getValue(e));if(!kK(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),s=n.sort((l,c)=>l-c);return n.length%2!==0?s[r]:(s[r-1]+s[r])/2},KK=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),YK=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,WK=(e,t)=>t.length,Lx={sum:$K,min:HK,max:BK,extent:GK,mean:qK,median:ZK,unique:KK,uniqueCount:YK,count:WK},QK={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:ba("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 Lx.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Lx.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Ng(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:Lx[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 s;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((s=n.subRows)!=null&&s.length)}}};function XK(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 JK={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:ba("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=rt(n=>[Yd(t,n)],n=>n.findIndex(r=>r.id===e.id),at(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=Yd(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const s=Yd(t,n);return((r=s[s.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=rt(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>s=>{let l=[];if(!(t!=null&&t.length))l=s;else{const c=[...t],d=[...s];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 XK(l,n,r)},at(e.options,"debugTable"))}},Px=()=>({left:[],right:[]}),eY={getInitialState:e=>({columnPinning:Px(),...e}),getDefaultOptions:e=>({onColumnPinningChange:ba("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(s=>s.id).filter(Boolean);t.setColumnPinning(s=>{var l,c;if(n==="right"){var d,f;return{left:((d=s==null?void 0:s.left)!=null?d:[]).filter(y=>!(r!=null&&r.includes(y))),right:[...((f=s==null?void 0:s.right)!=null?f:[]).filter(y=>!(r!=null&&r.includes(y))),...r]}}if(n==="left"){var h,g;return{left:[...((h=s==null?void 0:s.left)!=null?h:[]).filter(y=>!(r!=null&&r.includes(y))),...r],right:((g=s==null?void 0:s.right)!=null?g:[]).filter(y=>!(r!=null&&r.includes(y)))}}return{left:((l=s==null?void 0:s.left)!=null?l:[]).filter(y=>!(r!=null&&r.includes(y))),right:((c=s==null?void 0:s.right)!=null?c:[]).filter(y=>!(r!=null&&r.includes(y)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var s,l,c;return((s=r.columnDef.enablePinning)!=null?s:!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:s}=t.getState().columnPinning,l=n.some(d=>r==null?void 0:r.includes(d)),c=n.some(d=>s==null?void 0:s.includes(d));return l?"left":c?"right":!1},e.getPinnedIndex=()=>{var n,r;const s=e.getIsPinned();return s?(n=(r=t.getState().columnPinning)==null||(r=r[s])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=rt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,s)=>{const l=[...r??[],...s??[]];return n.filter(c=>!l.includes(c.column.id))},at(t.options,"debugRows")),e.getLeftVisibleCells=rt(()=>[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"})),at(t.options,"debugRows")),e.getRightVisibleCells=rt(()=>[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"})),at(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?Px():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Px())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var s,l;return!!((s=r.left)!=null&&s.length||(l=r.right)!=null&&l.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=rt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),at(e.options,"debugColumns")),e.getRightLeafColumns=rt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),at(e.options,"debugColumns")),e.getCenterLeafColumns=rt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const s=[...n??[],...r??[]];return t.filter(l=>!s.includes(l.id))},at(e.options,"debugColumns"))}};function tY(e){return e||(typeof document<"u"?document:null)}const Nm={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Ux=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),nY={getDefaultColumnDef:()=>Nm,getInitialState:e=>({columnSizing:{},columnSizingInfo:Ux(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:ba("columnSizing",e),onColumnSizingInfoChange:ba("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,s;const l=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Nm.minSize,(r=l??e.columnDef.size)!=null?r:Nm.size),(s=e.columnDef.maxSize)!=null?s:Nm.maxSize)},e.getStart=rt(n=>[n,Yd(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((s,l)=>s+l.getSize(),0),at(t.options,"debugColumns")),e.getAfter=rt(n=>[n,Yd(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((s,l)=>s+l.getSize(),0),at(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...s}=n;return s})},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=s=>{if(s.subHeaders.length)s.subHeaders.forEach(r);else{var l;n+=(l=s.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),s=r==null?void 0:r.getCanResize();return l=>{if(!r||!s||(l.persist==null||l.persist(),Fx(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=Fx(l)?Math.round(l.touches[0].clientX):l.clientX,h={},g=(R,T)=>{typeof T=="number"&&(t.setColumnSizingInfo(_=>{var D,A;const O=t.options.columnResizeDirection==="rtl"?-1:1,j=(T-((D=_==null?void 0:_.startOffset)!=null?D:0))*O,M=Math.max(j/((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:j,deltaPercentage:M}}),(t.options.columnResizeMode==="onChange"||R==="end")&&t.setColumnSizing(_=>({..._,...h})))},y=R=>g("move",R),v=R=>{g("end",R),t.setColumnSizingInfo(T=>({...T,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},b=tY(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)}},E={moveHandler:R=>(R.cancelable&&(R.preventDefault(),R.stopPropagation()),y(R.touches[0].clientX),!1),upHandler:R=>{var T;b==null||b.removeEventListener("touchmove",E.moveHandler),b==null||b.removeEventListener("touchend",E.upHandler),R.cancelable&&(R.preventDefault(),R.stopPropagation()),v((T=R.touches[0])==null?void 0:T.clientX)}},S=rY()?{passive:!1}:!1;Fx(l)?(b==null||b.addEventListener("touchmove",E.moveHandler,S),b==null||b.addEventListener("touchend",E.upHandler,S)):(b==null||b.addEventListener("mousemove",w.moveHandler,S),b==null||b.addEventListener("mouseup",w.upHandler,S)),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?Ux():(n=e.initialState.columnSizingInfo)!=null?n:Ux())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0}}};let Am=null;function rY(){if(typeof Am=="boolean")return Am;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 Am=e,Am}function Fx(e){return e.type==="touchstart"}const aY={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:ba("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 s=e.columns;return(n=s.length?s.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=rt(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),at(t.options,"debugRows")),e.getVisibleCells=rt(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,s)=>[...n,...r,...s],at(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>rt(()=>[r(),r().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(l=>l.getIsVisible==null?void 0:l.getIsVisible()),at(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((s,l)=>({...s,[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 Yd(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const sY={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()}}},oY={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:ba("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,s,l;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&((l=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?l:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Eo.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Ng(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Eo[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},iY={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:ba("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,s;if(!t){e._queue(()=>{t=!0});return}if((r=(s=e.options.autoResetAll)!=null?s: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 s,l;e.setExpanded(r?{}:(s=(l=e.initialState)==null?void 0:l.expanded)!=null?s:{})},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(s=>!s.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 s;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=(s=n)!=null?s:!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,s;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((s=e.subRows)!=null&&s.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()}}}},F0=0,z0=10,zx=()=>({pageIndex:F0,pageSize:z0}),lY={getInitialState:e=>({...e,pagination:{...zx(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:ba("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,s;if(!t){e._queue(()=>{t=!0});return}if((r=(s=e.options.autoResetAll)!=null?s:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const s=l=>wi(r,l);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(s)},e.resetPagination=r=>{var s;e.setPagination(r?zx():(s=e.initialState.pagination)!=null?s:zx())},e.setPageIndex=r=>{e.setPagination(s=>{let l=wi(r,s.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)),{...s,pageIndex:l}})},e.resetPageIndex=r=>{var s,l;e.setPageIndex(r?F0:(s=(l=e.initialState)==null||(l=l.pagination)==null?void 0:l.pageIndex)!=null?s:F0)},e.resetPageSize=r=>{var s,l;e.setPageSize(r?z0:(s=(l=e.initialState)==null||(l=l.pagination)==null?void 0:l.pageSize)!=null?s:z0)},e.setPageSize=r=>{e.setPagination(s=>{const l=Math.max(1,wi(r,s.pageSize)),c=s.pageSize*s.pageIndex,d=Math.floor(c/l);return{...s,pageIndex:d,pageSize:l}})},e.setPageCount=r=>e.setPagination(s=>{var l;let c=wi(r,(l=e.options.pageCount)!=null?l:-1);return typeof c=="number"&&(c=Math.max(-1,c)),{...s,pageCount:c}}),e.getPageOptions=rt(()=>[e.getPageCount()],r=>{let s=[];return r&&r>0&&(s=[...new Array(r)].fill(null).map((l,c)=>c)),s},at(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,s=e.getPageCount();return s===-1?!0:s===0?!1:r<s-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}}},Vx=()=>({top:[],bottom:[]}),cY={getInitialState:e=>({rowPinning:Vx(),...e}),getDefaultOptions:e=>({onRowPinningChange:ba("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,s)=>{const l=r?e.getLeafRows().map(f=>{let{id:h}=f;return h}):[],c=s?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(E=>!(d!=null&&d.has(E))),bottom:[...((v=f==null?void 0:f.bottom)!=null?v:[]).filter(E=>!(d!=null&&d.has(E))),...Array.from(d)]}}if(n==="top"){var b,w;return{top:[...((b=f==null?void 0:f.top)!=null?b:[]).filter(E=>!(d!=null&&d.has(E))),...Array.from(d)],bottom:((w=f==null?void 0:f.bottom)!=null?w:[]).filter(E=>!(d!=null&&d.has(E)))}}return{top:((h=f==null?void 0:f.top)!=null?h:[]).filter(E=>!(d!=null&&d.has(E))),bottom:((g=f==null?void 0:f.bottom)!=null?g:[]).filter(E=>!(d!=null&&d.has(E)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:s}=t.options;return typeof r=="function"?r(e):(n=r??s)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:s}=t.getState().rowPinning,l=n.some(d=>r==null?void 0:r.includes(d)),c=n.some(d=>s==null?void 0:s.includes(d));return l?"top":c?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const s=e.getIsPinned();if(!s)return-1;const l=(n=s==="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?Vx():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Vx())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var s,l;return!!((s=r.top)!=null&&s.length||(l=r.bottom)!=null&&l.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var s;return((s=e.options.keepPinnedRows)==null||s?(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=rt(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),at(e.options,"debugRows")),e.getBottomRows=rt(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),at(e.options,"debugRows")),e.getCenterRows=rt(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const s=new Set([...n??[],...r??[]]);return t.filter(l=>!s.has(l.id))},at(e.options,"debugRows"))}},uY={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:ba("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},s=e.getPreGroupedRowModel().flatRows;return t?s.forEach(l=>{l.getCanSelect()&&(r[l.id]=!0)}):s.forEach(l=>{delete r[l.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),s={...n};return e.getRowModel().rows.forEach(l=>{V0(s,l.id,r,!0,e)}),s}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=rt(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?$x(e,n):{rows:[],flatRows:[],rowsById:{}},at(e.options,"debugTable")),e.getFilteredSelectedRowModel=rt(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?$x(e,n):{rows:[],flatRows:[],rowsById:{}},at(e.options,"debugTable")),e.getGroupedSelectedRowModel=rt(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?$x(e,n):{rows:[],flatRows:[],rowsById:{}},at(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(s=>s.getCanSelect()&&!n[s.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(s=>s.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(s=>!n[s.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 s=e.getIsSelected();t.setRowSelection(l=>{var c;if(n=typeof n<"u"?n:!s,e.getCanSelect()&&s===n)return l;const d={...l};return V0(d,e.id,n,(c=r==null?void 0:r.selectChildren)!=null?c:!0,t),d})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return P1(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return $0(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return $0(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 s;n&&e.toggleSelected((s=r.target)==null?void 0:s.checked)}}}},V0=(e,t,n,r,s)=>{var l;const c=s.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=>V0(e,d.id,n,r,s))};function $x(e,t){const n=e.getState().rowSelection,r=[],s={},l=function(c,d){return c.map(f=>{var h;const g=P1(f,n);if(g&&(r.push(f),s[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:s}}function P1(e,t){var n;return(n=t[e.id])!=null?n:!1}function $0(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let s=!0,l=!1;return e.subRows.forEach(c=>{if(!(l&&!s)&&(c.getCanSelect()&&(P1(c,t)?l=!0:s=!1),c.subRows&&c.subRows.length)){const d=$0(c,t);d==="all"?l=!0:(d==="some"&&(l=!0),s=!1)}}),s?"all":l?"some":!1}const H0=/([0-9]+)/gm,dY=(e,t,n)=>c3(Oi(e.getValue(n)).toLowerCase(),Oi(t.getValue(n)).toLowerCase()),fY=(e,t,n)=>c3(Oi(e.getValue(n)),Oi(t.getValue(n))),hY=(e,t,n)=>U1(Oi(e.getValue(n)).toLowerCase(),Oi(t.getValue(n)).toLowerCase()),mY=(e,t,n)=>U1(Oi(e.getValue(n)),Oi(t.getValue(n))),pY=(e,t,n)=>{const r=e.getValue(n),s=t.getValue(n);return r>s?1:r<s?-1:0},gY=(e,t,n)=>U1(e.getValue(n),t.getValue(n));function U1(e,t){return e===t?0:e>t?1:-1}function Oi(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(H0).filter(Boolean),r=t.split(H0).filter(Boolean);for(;n.length&&r.length;){const s=n.shift(),l=r.shift(),c=parseInt(s,10),d=parseInt(l,10),f=[c,d].sort();if(isNaN(f[0])){if(s>l)return 1;if(l>s)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 kd={alphanumeric:dY,alphanumericCaseSensitive:fY,text:hY,textCaseSensitive:mY,datetime:pY,basic:gY},yY={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:ba("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const s of n){const l=s==null?void 0:s.getValue(e.id);if(Object.prototype.toString.call(l)==="[object Date]")return kd.datetime;if(typeof l=="string"&&(r=!0,l.split(H0).length>1))return kd.alphanumeric}return r?kd.text:kd.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 Ng(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:kd[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const s=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:s==="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||s||(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,s;const l=e.getFirstSortDir(),c=e.getIsSorted();return c?c!==l&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(s=t.options.enableMultiRemove)!=null)||s)?!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(s=>s.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(s=>s.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())}},vY=[FK,aY,JK,eY,zK,VK,sY,oY,yY,QK,iY,lY,cY,uY,nY];function xY(e){var t,n;const r=[...vY,...(t=e._features)!=null?t:[]];let s={_features:r};const l=s._features.reduce((v,b)=>Object.assign(v,b.getDefaultOptions==null?void 0:b.getDefaultOptions(s)),{}),c=v=>s.options.mergeOptions?s.options.mergeOptions(l,v):{...l,...v};let f={...{},...(n=e.initialState)!=null?n:{}};s._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:()=>{s.setState(s.initialState)},setOptions:v=>{const b=wi(v,s.options);s.options=c(b)},getState:()=>s.options.state,setState:v=>{s.options.onStateChange==null||s.options.onStateChange(v)},_getRowId:(v,b,w)=>{var E;return(E=s.options.getRowId==null?void 0:s.options.getRowId(v,b,w))!=null?E:`${w?[w.id,b].join("."):b}`},getCoreRowModel:()=>(s._getCoreRowModel||(s._getCoreRowModel=s.options.getCoreRowModel(s)),s._getCoreRowModel()),getRowModel:()=>s.getPaginationRowModel(),getRow:(v,b)=>{let w=(b?s.getPrePaginationRowModel():s.getRowModel()).rowsById[v];if(!w&&(w=s.getCoreRowModel().rowsById[v],!w))throw new Error;return w},_getDefaultColumnDef:rt(()=>[s.options.defaultColumn],v=>{var b;return v=(b=v)!=null?b:{},{header:w=>{const E=w.header.column.columnDef;return E.accessorKey?E.accessorKey:E.accessorFn?E.id:null},cell:w=>{var E,S;return(E=(S=w.renderValue())==null||S.toString==null?void 0:S.toString())!=null?E:null},...s._features.reduce((w,E)=>Object.assign(w,E.getDefaultColumnDef==null?void 0:E.getDefaultColumnDef()),{}),...v}},at(e,"debugColumns")),_getColumnDefs:()=>s.options.columns,getAllColumns:rt(()=>[s._getColumnDefs()],v=>{const b=function(w,E,S){return S===void 0&&(S=0),w.map(R=>{const T=UK(s,R,S,E),_=R;return T.columns=_.columns?b(_.columns,T,S+1):[],T})};return b(v)},at(e,"debugColumns")),getAllFlatColumns:rt(()=>[s.getAllColumns()],v=>v.flatMap(b=>b.getFlatColumns()),at(e,"debugColumns")),_getAllFlatColumnsById:rt(()=>[s.getAllFlatColumns()],v=>v.reduce((b,w)=>(b[w.id]=w,b),{}),at(e,"debugColumns")),getAllLeafColumns:rt(()=>[s.getAllColumns(),s._getOrderColumnsFn()],(v,b)=>{let w=v.flatMap(E=>E.getLeafColumns());return b(w)},at(e,"debugColumns")),getColumn:v=>s._getAllFlatColumnsById()[v]};Object.assign(s,y);for(let v=0;v<s._features.length;v++){const b=s._features[v];b==null||b.createTable==null||b.createTable(s)}return s}function Nu(){return e=>rt(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(s,l,c){l===void 0&&(l=0);const d=[];for(let h=0;h<s.length;h++){const g=k1(e,e._getRowId(s[h],h,c),s[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(s[h],h),(f=g.originalSubRows)!=null&&f.length&&(g.subRows=r(g.originalSubRows,l+1,g))}}return d};return n.rows=r(t),n},at(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function bY(e){const t=[],n=r=>{var s;t.push(r),(s=r.subRows)!=null&&s.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function SY(e,t,n){return n.options.filterFromLeafRows?CY(e,t,n):EY(e,t,n)}function CY(e,t,n){var r;const s=[],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=k1(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,s.push(b);continue}if(t(b)||w.subRows.length){g.push(b),l[b.id]=b,s.push(b);continue}}else b=w,t(b)&&(g.push(b),l[b.id]=b,s.push(b))}return g};return{rows:d(e),flatRows:s,rowsById:l}}function EY(e,t,n){var r;const s=[],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 E=k1(n,b.id,b.original,b.index,b.depth,void 0,b.parentId);E.subRows=d(b.subRows,h+1),b=E}g.push(b),s.push(b),l[b.id]=b}}return g};return{rows:d(e),flatRows:s,rowsById:l}}function Gf(){return e=>rt(()=>[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 s=[],l=[];(n??[]).forEach(v=>{var b;const w=e.getColumn(v.id);if(!w)return;const E=w.getFilterFn();E&&s.push({id:v.id,filterFn:E,resolvedValue:(b=E.resolveFilterValue==null?void 0:E.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={},s.length)for(let w=0;w<s.length;w++){h=s[w];const E=h.id;b.columnFilters[E]=h.filterFn(b,E,h.resolvedValue,S=>{b.columnFiltersMeta[E]=S})}if(l.length){for(let w=0;w<l.length;w++){g=l[w];const E=g.id;if(g.filterFn(b,E,g.resolvedValue,S=>{b.columnFiltersMeta[E]=S})){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 SY(t.rows,y,e)},at(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Ag(e){return t=>rt(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:s,pageIndex:l}=n;let{rows:c,flatRows:d,rowsById:f}=r;const h=s*l,g=h+s;c=c.slice(h,g);let y;t.options.paginateExpandedRows?y={rows:c,flatRows:d,rowsById:f}:y=bY({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},at(t.options,"debugTable"))}function qf(){return e=>rt(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,s=[],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],E=c[w.id],S=E.sortUndefined,R=(v=w==null?void 0:w.desc)!=null?v:!1;let T=0;if(S){const _=g.getValue(w.id),D=y.getValue(w.id),A=_===void 0,O=D===void 0;if(A||O){if(S==="first")return A?-1:1;if(S==="last")return A?1:-1;T=A&&O?0:A?S:-S}}if(T===0&&(T=E.sortingFn(g,y,w.id)),T!==0)return R&&(T*=-1),E.invertSorting&&(T*=-1),T}return g.index-y.index}),h.forEach(g=>{var y;s.push(g),(y=g.subRows)!=null&&y.length&&(g.subRows=d(g.subRows))}),h};return{rows:d(n.rows),flatRows:s,rowsById:n.rowsById}},at(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 gu(e,t){return e?wY(e)?p.createElement(e,t):e:null}function wY(e){return RY(e)||typeof e=="function"||TY(e)}function RY(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function TY(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Au(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=p.useState(()=>({current:xY(t)})),[r,s]=p.useState(()=>n.current.initialState);return n.current.setOptions(l=>({...l,...e,state:{...r,...e.state},onStateChange:c=>{s(c),e.onStateChange==null||e.onStateChange(c)}})),n.current}function Du({className:e,...t}){return o.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:o.jsx("table",{"data-slot":"table",className:ne("w-full caption-bottom text-sm",e),...t})})}function Ou({className:e,...t}){return o.jsx("thead",{"data-slot":"table-header",className:ne("[&_tr]:border-b",e),...t})}function Mu({className:e,...t}){return o.jsx("tbody",{"data-slot":"table-body",className:ne("[&_tr:last-child]:border-0",e),...t})}function sr({className:e,...t}){return o.jsx("tr",{"data-slot":"table-row",className:ne("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function Iu({className:e,...t}){return o.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 Sa({className:e,...t}){return o.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 jY=Symbol("radix.slottable");function _Y(e){const t=({children:n})=>o.jsx(o.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=jY,t}var u3="AlertDialog",[NY]=ir(u3,[$_]),Uo=$_(),d3=e=>{const{__scopeAlertDialog:t,...n}=e,r=Uo(t);return o.jsx(ng,{...r,...n,modal:!0})};d3.displayName=u3;var AY="AlertDialogTrigger",DY=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Uo(n);return o.jsx(IU,{...s,...r,ref:t})});DY.displayName=AY;var OY="AlertDialogPortal",f3=e=>{const{__scopeAlertDialog:t,...n}=e,r=Uo(t);return o.jsx(rg,{...r,...n})};f3.displayName=OY;var MY="AlertDialogOverlay",h3=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Uo(n);return o.jsx(ag,{...s,...r,ref:t})});h3.displayName=MY;var ru="AlertDialogContent",[IY,kY]=NY(ru),LY=_Y("AlertDialogContent"),m3=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...s}=e,l=Uo(n),c=p.useRef(null),d=ut(t,c),f=p.useRef(null);return o.jsx(AU,{contentName:ru,titleName:p3,docsSlug:"alert-dialog",children:o.jsx(IY,{scope:n,cancelRef:f,children:o.jsxs(sg,{role:"alertdialog",...l,...s,ref:d,onOpenAutoFocus:Te(s.onOpenAutoFocus,h=>{var g;h.preventDefault(),(g=f.current)==null||g.focus({preventScroll:!0})}),onPointerDownOutside:h=>h.preventDefault(),onInteractOutside:h=>h.preventDefault(),children:[o.jsx(LY,{children:r}),o.jsx(UY,{contentRef:c})]})})})});m3.displayName=ru;var p3="AlertDialogTitle",g3=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Uo(n);return o.jsx(Fb,{...s,...r,ref:t})});g3.displayName=p3;var y3="AlertDialogDescription",v3=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Uo(n);return o.jsx(zb,{...s,...r,ref:t})});v3.displayName=y3;var PY="AlertDialogAction",x3=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Uo(n);return o.jsx(og,{...s,...r,ref:t})});x3.displayName=PY;var b3="AlertDialogCancel",S3=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:s}=kY(b3,n),l=Uo(n),c=ut(t,s);return o.jsx(og,{...l,...r,ref:c})});S3.displayName=b3;var UY=({contentRef:e})=>{const t=`\`${ru}\` requires a description for the component to be accessible for screen reader users.
|
|
688
|
-
|
|
689
|
-
You can add a description to the \`${ru}\` by passing a \`${y3}\` 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 \`${ru}\`. 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 p.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},FY=d3,zY=f3,VY=h3,$Y=m3,HY=x3,BY=S3,GY=g3,qY=v3;function ZY({...e}){return o.jsx(FY,{"data-slot":"alert-dialog",...e})}function KY({...e}){return o.jsx(zY,{"data-slot":"alert-dialog-portal",...e})}function YY({className:e,...t}){return o.jsx(VY,{"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 WY({className:e,...t}){return o.jsxs(KY,{children:[o.jsx(YY,{}),o.jsx($Y,{"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 QY({className:e,...t}){return o.jsx("div",{"data-slot":"alert-dialog-header",className:ne("flex flex-col gap-2 text-center sm:text-left",e),...t})}function XY({className:e,...t}){return o.jsx("div",{"data-slot":"alert-dialog-footer",className:ne("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function JY({className:e,...t}){return o.jsx(GY,{"data-slot":"alert-dialog-title",className:ne("text-lg font-semibold",e),...t})}function eW({className:e,...t}){return o.jsx(qY,{"data-slot":"alert-dialog-description",className:ne("text-muted-foreground text-sm",e),...t})}function tW({className:e,...t}){return o.jsx(HY,{className:ne(kb(),e),...t})}function nW({className:e,...t}){return o.jsx(BY,{className:ne(kb({variant:"outline"}),e),...t})}const C3=["facebook","linkedin","tiktok","microsoft","connector","sql","blank"],E3={facebook:{title:"Facebook Ads",datamartTitle:"Facebook Ads Data Mart",connectorSourceTitle:"FacebookMarketing",definitionType:Ue.CONNECTOR,icon:BB},linkedin:{title:"LinkedIn Ads",datamartTitle:"LinkedIn Ads Data Mart",connectorSourceTitle:"LinkedInAds",definitionType:Ue.CONNECTOR,icon:GB},tiktok:{title:"TikTok Ads",datamartTitle:"TikTok Ads Data Mart",connectorSourceTitle:"TikTokAds",definitionType:Ue.CONNECTOR,icon:qB},microsoft:{title:"Microsoft Ads",datamartTitle:"Microsoft Ads Data Mart",connectorSourceTitle:"MicrosoftAds",definitionType:Ue.CONNECTOR,icon:ZB},connector:{title:"Other connector",datamartTitle:"Connector-based Data Mart",definitionType:Ue.CONNECTOR,icon:Ob},sql:{title:"SQL query",datamartTitle:"SQL-based Data Mart",definitionType:Ue.SQL,icon:Ab},blank:{title:"Blank Data Mart",datamartTitle:"New Data Mart",icon:ap}},RT=C3.map(e=>({key:e,...E3[e]}));function rW(e){if(!e||!C3.includes(e))return;const t=e;return{key:t,...E3[t]}}function aW({children:e,className:t="",...n}){return o.jsx("div",{className:"dm-card",children:o.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 sW({children:e,className:t="",...n}){return o.jsx("div",{className:ne("pb-2",t),...n,children:e})}function oW({children:e,className:t="",...n}){return o.jsx("h2",{className:ne("mb-6 text-4xl font-semibold xl:text-5xl",t),...n,children:e})}function iW({children:e,className:t="",...n}){return o.jsx("p",{className:ne("text-muted-foreground text-lg",t),...n,children:e})}function lW({children:e,rings:t=7,className:n="",...r}){return o.jsxs("div",{className:ne("relative flex w-full justify-center lg:w-[30%] 2xl:w-[35%]",n),...r,children:[o.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:Array.from({length:t},(s,l)=>{const c=`${(16*(l+1)+24).toString()}vmin`;return o.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)})}),o.jsx("div",{className:"animate-glow-burst"}),o.jsx("div",{className:"animate-icon-entrance","aria-label":"Illustration",children:e})]})}function cW({children:e,className:t="",...n}){return o.jsx("div",{className:ne("w-full space-y-8 lg:w-[70%] 2xl:w-[65%]",t),...n,children:e})}function Hx({separator:e=!0,children:t,className:n="",...r}){return o.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 TT({children:e,className:t="",...n}){return o.jsx("h3",{className:ne("mb-4 text-xl font-medium",t),...n,children:e})}function Bx({children:e,className:t="",...n}){return o.jsx("div",{className:ne("flex flex-wrap items-center gap-4",t),...n,children:e})}function Dm({href:e,icon:t,title:n,variant:r="outline",size:s,className:l="",target:c,...d}){const f=r==="outline"?"lg":"sm",h=o.jsxs("span",{className:ne("flex items-center gap-2"),children:[t,n]});return e?o.jsx(Se,{asChild:!0,variant:r,size:s??f,className:ne(r==="ghost"?"text-muted-foreground":"",l),...d,children:o.jsx(Za,{to:e,target:c,children:h})}):o.jsx(Se,{variant:r,size:s??f,className:l,...d,children:h})}function uW(){const{scope:e}=Po(),t=RT.filter(r=>r.definitionType===Ue.CONNECTOR),n=RT.filter(r=>r.definitionType!==Ue.CONNECTOR);return o.jsxs(aW,{children:[o.jsx(lW,{children:o.jsx(HB,{className:"animate-icon-entrance","aria-label":"Data Mart creation illustration"})}),o.jsxs(cW,{children:[o.jsxs(sW,{children:[o.jsx(oW,{children:"Let’s Build Your First Data Mart"}),o.jsx(iW,{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"})]}),o.jsxs(Hx,{children:[o.jsx(TT,{children:"Connect a data source"}),o.jsx(Bx,{children:t.map(r=>o.jsx(Dm,{href:e(`/data-marts/create?preset=${r.key}`),icon:r.icon&&o.jsx(r.icon,{className:"h-4 w-4"}),title:r.title,variant:"outline"},r.key))})]}),o.jsxs(Hx,{children:[o.jsx(TT,{children:"Use existing SQL or start from scratch"}),o.jsx(Bx,{children:n.map((r,s)=>o.jsxs(o.Fragment,{children:[o.jsx(Dm,{href:e(`/data-marts/create?preset=${r.key}`),icon:r.icon&&o.jsx(r.icon,{className:"h-4 w-4"}),title:r.title,variant:"outline"},r.key),s<n.length-1&&o.jsx("span",{className:"text-muted-foreground text-sm",children:"or"})]}))})]}),o.jsx(Hx,{separator:!1,children:o.jsxs(Bx,{children:[o.jsx(Dm,{href:"https://www.youtube.com/playlist?list=PLvcNVLV5BVbHHCekyAZBEIVnlC4i1qcHx",icon:o.jsx(ZL,{className:"h-4 w-4"}),title:"Watch a 2-minute demo",variant:"ghost",target:"_blank"}),o.jsx(Dm,{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:o.jsx(aL,{className:"h-4 w-4"}),title:"Core concepts",variant:"ghost",target:"_blank"})]})})]})]})}function dW(){return o.jsx(is,{className:"bg-muted/50 h-72 w-full rounded-md border-b border-gray-200 dark:border-white/10 dark:bg-white/4"})}const Pc={DEFAULT_SORTING_COLUMN:"createdAt",DEFAULT_EXCLUDED_COLUMNS:["actions"],STORAGE_KEYS:{SORTING_SUFFIX:"-sorting",COLUMN_VISIBILITY_SUFFIX:"-column-visibility"}},fW={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 Zf({columns:e,storageKeyPrefix:t,defaultSortingColumn:n=Pc.DEFAULT_SORTING_COLUMN,defaultColumnVisibility:r={},excludedColumnsFromSorting:s=Pc.DEFAULT_EXCLUDED_COLUMNS,excludedColumnsFromVisibility:l=Pc.DEFAULT_EXCLUDED_COLUMNS}){const c=p.useMemo(()=>({SORTING:`${t}${Pc.STORAGE_KEYS.SORTING_SUFFIX}`,COLUMN_VISIBILITY:`${t}${Pc.STORAGE_KEYS.COLUMN_VISIBILITY_SUFFIX}`}),[t]),d=p.useMemo(()=>fW.extractColumnIds(e),[e]),f=p.useMemo(()=>d.filter(E=>!s.includes(E)),[d,s]),h=p.useCallback(()=>{const E=ks.get(c.SORTING,"json");return E&&Array.isArray(E)&&E.length>0?E:[{id:f.includes(n)?n:f[0]??Pc.DEFAULT_SORTING_COLUMN,desc:!0}]},[c.SORTING,f,n]),g=p.useCallback(()=>{const E=ks.get(c.COLUMN_VISIBILITY,"json");if(E&&typeof E=="object"&&!Array.isArray(E)){const S={};for(const R of d)l.includes(R)||(S[R]=E[R]);return S}return r},[c.COLUMN_VISIBILITY,d,l,r]),[y,v]=p.useState(h),[b,w]=p.useState(g);return p.useEffect(()=>{y.length>0&&f.includes(y[0].id)&&ks.set(c.SORTING,y)},[y,f,c.SORTING]),p.useEffect(()=>{const E={};for(const S of d){if(l.includes(S))continue;const R=b[S];typeof R=="boolean"&&(E[S]=R)}ks.set(c.COLUMN_VISIBILITY,E)},[b,d,l,c.COLUMN_VISIBILITY]),{sorting:y,setSorting:v,columnVisibility:b,setColumnVisibility:w}}function hW({columns:e,data:t,deleteDataMart:n,refetchDataMarts:r,isLoading:s}){var O;const{navigate:l,scope:c}=Po(),{sorting:d,setSorting:f,columnVisibility:h,setColumnVisibility:g}=Zf({columns:e,storageKeyPrefix:"data-mart-list",defaultColumnVisibility:{triggersCount:!1,reportsCount:!1}}),[y,v]=p.useState([]),[b,w]=p.useState({}),[E,S]=p.useState(!1),[R,T]=p.useState(!1),_=async()=>{try{T(!0);const M=A.getSelectedRowModel().rows.map(F=>F.original.id);for(const F of M)await n(F);rn.success(`Successfully deleted ${String(M.length)} data mart${M.length!==1?"s":""}`),w({}),await r()}catch(j){console.error("Error deleting data marts:",j),rn.error("Failed to delete some data marts. Please try again.")}finally{T(!1),S(!1)}},D=Object.keys(b).length>0,A=Au({data:t,columns:[{id:"select",size:40,header:({table:j})=>o.jsx("button",{type:"button",role:"checkbox","aria-checked":j.getIsAllRowsSelected(),"data-state":j.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:j.getToggleAllRowsSelectedHandler(),children:j.getIsAllRowsSelected()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(fr,{className:"size-3.5 text-white"})})}),cell:({row:j})=>o.jsx("button",{type:"button",role:"checkbox","aria-checked":j.getIsSelected(),"data-state":j.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:j.getToggleSelectedHandler(),children:j.getIsSelected()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(fr,{className:"size-3.5 text-white"})})}),enableSorting:!1,enableHiding:!1},...e],getCoreRowModel:Nu(),getPaginationRowModel:Ag(),onSortingChange:f,getSortedRowModel:qf(),onColumnFiltersChange:v,getFilteredRowModel:Gf(),onColumnVisibilityChange:g,onRowSelectionChange:w,state:{sorting:d,columnFilters:y,columnVisibility:h,rowSelection:b},enableRowSelection:!0});return s?o.jsx("div",{children:o.jsx(dW,{})}):t.length?o.jsxs("div",{className:"dm-card",children:[o.jsxs("div",{className:"dm-card-toolbar",children:[o.jsxs("div",{className:"dm-card-toolbar-left",children:[D&&o.jsx(Se,{variant:"destructive",size:"sm",className:"dm-card-toolbar-btn-delete",onClick:()=>{S(!0)},disabled:R,children:o.jsx(Lo,{className:"h-4 w-4"})}),o.jsxs("div",{className:"dm-card-toolbar-search",children:[o.jsx($l,{className:"dm-card-toolbar-search-icon"}),o.jsx(zt,{placeholder:"Search by title",value:(O=A.getColumn("title"))==null?void 0:O.getFilterValue(),onChange:j=>{var M;return(M=A.getColumn("title"))==null?void 0:M.setFilterValue(j.target.value)},className:"dm-card-toolbar-search-input"})]})]}),o.jsx("div",{className:"dm-card-toolbar-right",children:o.jsx(Za,{to:c("/data-marts/create"),children:o.jsxs(Se,{variant:"outline",className:"dm-card-toolbar-btn-primary",children:[o.jsx(_a,{className:"h-4 w-4"}),"New Data Mart"]})})})]}),o.jsx("div",{className:"dm-card-table-wrap",children:o.jsxs(Du,{className:"dm-card-table",role:"table","aria-label":"Data Marts table",children:[o.jsx(Ou,{className:"dm-card-table-header",children:A.getHeaderGroups().map(j=>o.jsx(sr,{className:"dm-card-table-header-row",children:j.headers.map(M=>o.jsx(Iu,{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:gu(M.column.columnDef.header,M.getContext())},M.id))},j.id))}),o.jsx(Mu,{className:"dm-card-table-body",children:A.getRowModel().rows.length?A.getRowModel().rows.map(j=>o.jsx(sr,{"data-state":j.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=j.original.id;l(`/data-marts/${F}/data-setup`)},children:j.getVisibleCells().map(M=>o.jsx(Sa,{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:gu(M.column.columnDef.cell,M.getContext())},M.id))},j.id)):o.jsx(sr,{children:o.jsx(Sa,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),o.jsxs("div",{className:"dm-card-pagination",children:[o.jsx(Se,{variant:"outline",size:"sm",onClick:()=>{A.previousPage()},disabled:!A.getCanPreviousPage(),children:"Previous"}),o.jsx(Se,{variant:"outline",size:"sm",onClick:()=>{A.nextPage()},disabled:!A.getCanNextPage(),children:"Next"})]}),o.jsx(ZY,{open:E,onOpenChange:S,children:o.jsxs(WY,{children:[o.jsxs(QY,{children:[o.jsx(JY,{children:"Are you sure?"}),o.jsxs(eW,{children:["You're about to delete ",Object.keys(b).length," selected data mart",Object.keys(b).length!==1?"s":"",". This action cannot be undone."]})]}),o.jsxs(XY,{children:[o.jsx(nW,{disabled:R,children:"Cancel"}),o.jsx(tW,{onClick:()=>{_()},disabled:R,className:"bg-destructive hover:bg-destructive/90",children:R?"Deleting...":"Delete"})]})]})})]}):o.jsx(uW,{})}function ml({column:e,children:t}){return o.jsxs(Se,{variant:"ghost",onClick:()=>{e.toggleSorting(e.getIsSorted()==="asc")},className:"group dm-card-table-header-row-btn",children:[t,o.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[e.getIsSorted()==="asc"&&o.jsx(zs,{className:"text-foreground h-4 w-4"}),e.getIsSorted()==="desc"&&o.jsx(Qa,{className:"text-foreground h-4 w-4"}),!e.getIsSorted()&&o.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:o.jsx(zs,{className:"text-muted-foreground h-4 w-4"})})]})]})}function F1({...e}){return o.jsx(ng,{"data-slot":"dialog",...e})}function mW({...e}){return o.jsx(rg,{"data-slot":"dialog-portal",...e})}function pW({className:e,...t}){return o.jsx(ag,{"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 z1({className:e,children:t,showCloseButton:n=!0,...r}){return o.jsxs(mW,{"data-slot":"dialog-portal",children:[o.jsx(pW,{}),o.jsxs(sg,{"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&&o.jsxs(og,{"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:[o.jsx(cu,{}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function V1({className:e,...t}){return o.jsx("div",{"data-slot":"dialog-header",className:ne("flex flex-col gap-2 text-center sm:text-left",e),...t})}function gW({className:e,...t}){return o.jsx("div",{"data-slot":"dialog-footer",className:ne("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function $1({className:e,...t}){return o.jsx(Fb,{"data-slot":"dialog-title",className:ne("text-lg leading-none font-semibold",e),...t})}function H1({className:e,...t}){return o.jsx(zb,{"data-slot":"dialog-description",className:ne("text-muted-foreground text-sm",e),...t})}const yW=Ef("",{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 au({className:e,variant:t,...n}){return t==="brand"?o.jsx(Se,{variant:"default",className:ne(yW({variant:t}),e),...n}):o.jsx(Se,{variant:t,className:e,...n})}const Hr=({open:e,onOpenChange:t,title:n,description:r,confirmLabel:s="Confirm",cancelLabel:l,onConfirm:c,onCancel:d,variant:f="destructive",children:h})=>{const g=()=>{t(!1),d==null||d()};return o.jsx(F1,{open:e,onOpenChange:t,children:o.jsxs(z1,{children:[o.jsxs(V1,{children:[o.jsx($1,{children:n}),o.jsx(H1,{children:r})]}),h,o.jsxs(gW,{children:[l&&o.jsx(au,{variant:"secondary",onClick:g,children:l}),o.jsx(au,{variant:f,onClick:c,children:s})]})]})})},vW=({row:e,onDeleteSuccess:t})=>{const{scope:n}=Po(),[r,s]=p.useState(!1),[l,c]=p.useState(!1),{deleteDataMart:d,refreshList:f}=e3(),h=async()=>{try{await d(e.original.id),s(!1),await f(),t==null||t()}catch(g){console.error("Failed to delete data mart:",g)}};return o.jsxs("div",{className:"text-right",children:[o.jsxs(wr,{open:l,onOpenChange:c,children:[o.jsx(Rr,{asChild:!0,children:o.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:o.jsx(Xa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsxs(Tr,{align:"end",children:[o.jsx(vt,{children:o.jsxs(Za,{to:n(`/data-marts/${e.original.id}/data-setup`),className:"flex gap-2 text-left",children:[o.jsx(Tf,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),o.jsx("span",{children:"Edit"})]})}),o.jsx(Ka,{}),o.jsxs(vt,{onClick:()=>{s(!0)},children:[o.jsx(Lo,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),o.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]}),o.jsx(Hr,{open:r,onOpenChange:s,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 Rn=(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))(Rn||{});const mi={[Rn.TITLE]:"Title",[Rn.DEFINITION_TYPE]:"Input Source",[Rn.STORAGE_TYPE]:"Storage",[Rn.STATUS]:"Status",[Rn.TRIGGERS_COUNT]:"Triggers",[Rn.REPORTS_COUNT]:"Reports",[Rn.CREATED_AT]:"Created at"};function xW({table:e}){return o.jsx("div",{className:"px-4 text-right",children:o.jsxs(wr,{children:[o.jsx(Rr,{asChild:!0,children:o.jsx(Se,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:o.jsx(Xa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsx(Tr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>{const n=mi[t.id]||t.id;return o.jsx(vt,{className:"capitalize",children:o.jsxs("label",{className:"flex items-center space-x-2",children:[o.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()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(fr,{className:"size-3.5 text-white"})})}),o.jsx("span",{children:n})]})},t.id)})})]})})}const jT={types:{[Ue.SQL]:{type:Ue.SQL,displayName:"SQL",icon:Ab},[Ue.TABLE]:{type:Ue.TABLE,displayName:"Table",icon:WL},[Ue.VIEW]:{type:Ue.VIEW,displayName:"View",icon:lL},[Ue.TABLE_PATTERN]:{type:Ue.TABLE_PATTERN,displayName:"Pattern",icon:g9},[Ue.CONNECTOR]:{type:Ue.CONNECTOR,displayName:"Connector",icon:Ob}},getInfo(e){return e?this.types[e]:{type:null,displayName:"—",icon:()=>null}}},bW=({onDeleteSuccess:e,connectors:t=[]}={})=>[{accessorKey:Rn.TITLE,size:40,header:({column:n})=>o.jsx(ml,{column:n,children:mi[Rn.TITLE]}),cell:({row:n})=>o.jsx("div",{children:n.getValue("title")})},{accessorFn:n=>{const r=n.definitionType;if(r===Ue.CONNECTOR){const s=n.definition,l=t.find(c=>c.name===s.connector.source.name);return(l==null?void 0:l.displayName)??(l==null?void 0:l.name)??"Unknown"}else{const{displayName:s}=jT.getInfo(r);return s}},id:Rn.DEFINITION_TYPE,size:15,header:({column:n})=>o.jsx(ml,{column:n,children:mi[Rn.DEFINITION_TYPE]}),cell:({row:n})=>{const r=n.original.definitionType;switch(r){case Ue.CONNECTOR:{const s=n.original.definition,l=t.find(c=>c.name===s.connector.source.name);return o.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[(l==null?void 0:l.logoBase64)&&o.jsx(_u,{base64:l.logoBase64,size:18}),(l==null?void 0:l.displayName)??"Unknown"]})}default:{const{displayName:s,icon:l}=jT.getInfo(r);return o.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[o.jsx(l,{className:"h-4 w-4"}),s]})}}}},{accessorKey:Rn.STORAGE_TYPE,size:15,header:({column:n})=>o.jsx(ml,{column:n,children:mi[Rn.STORAGE_TYPE]}),cell:({row:n})=>{const r=n.getValue("storageType"),s=n.original.storageTitle,{displayName:l,icon:c}=Bi.getInfo(r),d=s??l;return o.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[o.jsx(c,{size:18}),d]})}},{accessorKey:Rn.CREATED_AT,size:15,header:({column:n})=>o.jsx(ml,{column:n,children:mi[Rn.CREATED_AT]}),cell:({row:n})=>{const r=n.getValue("createdAt"),s=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(r);return o.jsx("div",{className:"text-muted-foreground",children:s})}},{accessorKey:Rn.STATUS,size:15,header:({column:n})=>o.jsx(ml,{column:n,children:mi[Rn.STATUS]}),cell:({row:n})=>{const r=n.getValue("status");return o.jsx(Bf,{type:TK(r.code),variant:"ghost",showIcon:!1,children:r.displayName})}},{accessorKey:Rn.TRIGGERS_COUNT,size:15,header:({column:n})=>o.jsx(ml,{column:n,children:mi[Rn.TRIGGERS_COUNT]}),cell:({row:n})=>{const r=n.getValue("triggersCount")>0?n.getValue("triggersCount"):"—";return o.jsx("div",{className:"text-muted-foreground",children:r})}},{accessorKey:Rn.REPORTS_COUNT,size:15,header:({column:n})=>o.jsx(ml,{column:n,children:mi[Rn.REPORTS_COUNT]}),cell:({row:n})=>{const r=n.getValue("reportsCount")>0?n.getValue("reportsCount"):"—";return o.jsx("div",{className:"text-muted-foreground",children:r})}},{id:"actions",size:80,header:({table:n})=>o.jsx(xW,{table:n}),cell:({row:n})=>o.jsx(vW,{row:n,onDeleteSuccess:e})}];var nr=(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))(nr||{});const SW={connectors:[],connectorSpecification:null,connectorFields:null,loading:!1,loadingSpecification:!1,loadingFields:!1,error:null};function CW(e,t){switch(t.type){case nr.FETCH_CONNECTORS_START:return{...e,loading:!0,error:null};case nr.FETCH_CONNECTORS_SUCCESS:return{...e,connectors:t.payload,loading:!1,error:null};case nr.FETCH_CONNECTORS_ERROR:return{...e,loading:!1,error:t.payload};case nr.FETCH_CONNECTOR_SPECIFICATION_START:return{...e,loadingSpecification:!0,error:null};case nr.FETCH_CONNECTOR_SPECIFICATION_SUCCESS:return{...e,connectorSpecification:t.payload,loadingSpecification:!1,error:null};case nr.FETCH_CONNECTOR_SPECIFICATION_ERROR:return{...e,loadingSpecification:!1,error:t.payload};case nr.FETCH_CONNECTOR_FIELDS_START:return{...e,loadingFields:!0,error:null};case nr.FETCH_CONNECTOR_FIELDS_SUCCESS:return{...e,connectorFields:t.payload,loadingFields:!1,error:null};case nr.FETCH_CONNECTOR_FIELDS_ERROR:return{...e,loadingFields:!1,error:t.payload};default:return e}}const w3=p.createContext(void 0);function yu({children:e}){const[t,n]=p.useReducer(CW,SW);return o.jsx(w3.Provider,{value:{state:t,dispatch:n},children:e})}function EW(){const e=p.useContext(w3);if(!e)throw new Error("useConnectorContext must be used within a ConnectorContextProvider");return e}var os=(e=>(e.STRING="string",e.NUMBER="number",e.BOOLEAN="boolean",e.OBJECT="object",e.ARRAY="array",e.DATE="date",e))(os||{});class Qm extends Zl{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 R3(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 Yl(){const{state:e,dispatch:t}=EW(),n=p.useMemo(()=>R3(e.connectors),[e.connectors]),r=p.useCallback(async()=>{t({type:nr.FETCH_CONNECTORS_START});try{const d=await new Qm().getAvailableConnectors();t({type:nr.FETCH_CONNECTORS_SUCCESS,payload:d})}catch(c){const d=c instanceof Error?c.message:"Unknown error";t({type:nr.FETCH_CONNECTORS_ERROR,payload:d}),Pe({event:"connector_error",category:"Connector",action:"ListError",label:d})}},[t]),s=p.useCallback(async c=>{t({type:nr.FETCH_CONNECTOR_SPECIFICATION_START});try{const f=await new Qm().getConnectorSpecification(c);t({type:nr.FETCH_CONNECTOR_SPECIFICATION_SUCCESS,payload:f})}catch(d){const f=d instanceof Error?d.message:"Unknown error";t({type:nr.FETCH_CONNECTOR_SPECIFICATION_ERROR,payload:f}),Pe({event:"connector_error",category:"Connector",action:"SpecificationError",label:c})}},[t]),l=p.useCallback(async c=>{t({type:nr.FETCH_CONNECTOR_FIELDS_START});try{const f=await new Qm().getConnectorFields(c);t({type:nr.FETCH_CONNECTOR_FIELDS_SUCCESS,payload:f})}catch(d){const f=d instanceof Error?d.message:"Unknown error";t({type:nr.FETCH_CONNECTOR_FIELDS_ERROR,payload:f}),Pe({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:s,fetchConnectorFields:l}}const wW=()=>{const{items:e,loadDataMarts:t,deleteDataMart:n,refreshList:r,loading:s}=e3(),{connectors:l,fetchAvailableConnectors:c}=Yl();return p.useEffect(()=>{c()},[c]),p.useEffect(()=>{t()},[t]),o.jsx(hW,{columns:bW({connectors:l}),data:e,deleteDataMart:n,refetchDataMarts:r,isLoading:s})};function _T(){return o.jsxs("div",{className:"dm-page",children:[o.jsx("header",{className:"dm-page-header",children:o.jsx("h1",{className:"dm-page-header-title",children:"Data Marts"})}),o.jsx("div",{className:"dm-page-content",children:o.jsx(rZ,{children:o.jsx(yu,{children:o.jsx(wW,{})})})})]})}const T3=p.createContext(void 0),Ld=e=>{const t=OK(e);return{...e,canPublish:t.length===0,validationErrors:t}};var Ga=(e=>(e.CONNECTED="CONNECTED",e.CONNECTED_WITH_DEFINITION_MISMATCH="CONNECTED_WITH_DEFINITION_MISMATCH",e.DISCONNECTED="DISCONNECTED",e))(Ga||{}),pf=(e=>(e.NULLABLE="NULLABLE",e.REQUIRED="REQUIRED",e.REPEATED="REPEATED",e))(pf||{}),kn=(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))(kn||{}),B1=(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))(B1||{});const RW=(e,t)=>!!(e!==Ue.CONNECTOR||t!==null&&t.fields.some(r=>r.status===Ga.CONNECTED)),j3={dataMart:null,isLoading:!1,error:null,runs:[]};function TW(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:Ld(t.payload)};case"UPDATE_DATA_MART_TITLE_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:Ld({...e.dataMart,title:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_DESCRIPTION_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:Ld({...e.dataMart,description:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_STORAGE":return e.dataMart?{...e,dataMart:Ld({...e.dataMart,storage:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_DEFINITION_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:Ld({...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 j3;default:return e}}function Fo(){const e=p.useContext(T3);if(e===void 0)throw new Error("useDataMartContext must be used within a DataMartProvider");return e}class jW{mapFromDto(t){const n=t.config,r=t.credentials;let s="";return r&&Object.keys(r).length>0&&(s=JSON.stringify(r,null,2)),{id:t.id,title:t.title,type:Ie.GOOGLE_BIGQUERY,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt),credentials:{serviceAccount:s},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 _W{mapFromDto(t){const n=t.config,r=t.credentials;return{id:t.id,title:t.title,type:Ie.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 _3={getMapper(e){switch(e){case Ie.GOOGLE_BIGQUERY:return new jW;case Ie.AWS_ATHENA:return new _W;default:throw new Error(`Unknown storage type: ${e}`)}}};function Xm(e){return _3.getMapper(e.type).mapFromDto(e)}function NW(e){const t=_3.getMapper(e.type);return{title:e.title,...t.mapToUpdateRequest(e)}}function AW(e){return{id:e.id,type:e.type,title:e.title,createdAt:new Date(e.createdAt),modifiedAt:new Date(e.modifiedAt)}}function DW(e){return{type:e}}let Om=null;async function OW(){if(Om)return Om;const e=await MW();return Om=R3(e),Om}async function MW(){return await new Qm().getAvailableConnectors()}async function IW(e){const t=await OW();return t.length===0?null:t.find(r=>r.name===e)??null}function kW(e,t){const n=t.find(r=>r.name===e.source.name);return(n==null?void 0:n.displayName)??e.source.name}function LW(e){return{sqlQuery:e.sqlQuery}}function PW(e){return{sqlQuery:e.sqlQuery}}function UW(e){return{fullyQualifiedName:e.fullyQualifiedName}}function FW(e){return{fullyQualifiedName:e.fullyQualifiedName}}function zW(e){return{fullyQualifiedName:e.fullyQualifiedName}}function VW(e){return{fullyQualifiedName:e.fullyQualifiedName}}function $W(e){return{pattern:e.pattern}}function HW(e){return{pattern:e.pattern}}function BW(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 GW(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 qW(e,t){if(!e||!t)return null;switch(e){case Ue.SQL:return PW(t);case Ue.TABLE:return FW(t);case Ue.VIEW:return VW(t);case Ue.TABLE_PATTERN:return HW(t);case Ue.CONNECTOR:{const n=GW(t);return n.connector.info=await IW(n.connector.source.name),n}default:return console.warn(`Unknown definition type: ${String(e)}`),null}}async function Uc(e){const t={id:e.id,title:e.title,description:e.description,status:_4.getInfo(e.status),storage:Xm(e.storage),definitionType:e.definitionType,definition:await qW(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=RW(t.definitionType,t.schema),t}function ZW(e){return{id:e.id,title:e.title}}const KW=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}),NT=e=>e.runs.map(KW);function N3({children:e}){const[t,n]=p.useReducer(TW,j3),r=p.useCallback(async A=>{try{n({type:"FETCH_DATA_MART_START"});const O=await nn.getDataMartById(A),j=await Uc(O);n({type:"FETCH_DATA_MART_SUCCESS",payload:j})}catch(O){n({type:"FETCH_DATA_MART_ERROR",payload:yn(O)})}},[]),s=p.useCallback(async A=>{try{n({type:"CREATE_DATA_MART_START"});const O=await nn.createDataMart(A),j=ZW(O);return n({type:"CREATE_DATA_MART_SUCCESS",payload:j}),Pe({event:"data_mart_created",category:"DataMart",action:"Create",label:j.id}),At.success("Data Mart created"),j}catch(O){const j=yn(O);throw n({type:"CREATE_DATA_MART_ERROR",payload:j}),Pe({event:"data_mart_error",category:"DataMart",action:"CreateError",label:j.message}),O}},[]),l=p.useCallback(async(A,O)=>{try{n({type:"UPDATE_DATA_MART_START"});const j=await nn.updateDataMart(A,O),M=await Uc(j);n({type:"UPDATE_DATA_MART_SUCCESS",payload:M}),Pe({event:"data_mart_updated",category:"DataMart",action:"Update",label:M.id})}catch(j){const M=yn(j);n({type:"UPDATE_DATA_MART_ERROR",payload:M}),Pe({event:"data_mart_error",category:"DataMart",action:"UpdateError",label:M.message})}},[]),c=p.useCallback(async A=>{try{n({type:"DELETE_DATA_MART_START"}),await nn.deleteDataMart(A),n({type:"DELETE_DATA_MART_SUCCESS"}),Pe({event:"data_mart_deleted",category:"DataMart",action:"Delete",label:A}),At.success("Data Mart deleted")}catch(O){const j=yn(O);n({type:"DELETE_DATA_MART_ERROR",payload:j}),Pe({event:"data_mart_error",category:"DataMart",action:"DeleteError",label:j.message})}},[]),d=p.useCallback(async(A,O)=>{try{n({type:"UPDATE_DATA_MART_TITLE_START"}),await nn.updateDataMartTitle(A,O),n({type:"UPDATE_DATA_MART_TITLE_SUCCESS",payload:O}),Pe({event:"data_mart_updated",category:"DataMart",action:"UpdateTitle",label:O}),At.success("Title updated")}catch(j){const M=yn(j);n({type:"UPDATE_DATA_MART_TITLE_ERROR",payload:M}),Pe({event:"data_mart_error",category:"DataMart",action:"UpdateTitleError",label:M.message})}},[]),f=p.useCallback(async(A,O)=>{try{n({type:"UPDATE_DATA_MART_DESCRIPTION_START"}),await nn.updateDataMartDescription(A,O),n({type:"UPDATE_DATA_MART_DESCRIPTION_SUCCESS",payload:O??""}),Pe({event:"data_mart_updated",category:"DataMart",action:"UpdateDescription"}),At.success("Description updated")}catch(j){const M=yn(j);n({type:"UPDATE_DATA_MART_DESCRIPTION_ERROR",payload:M}),Pe({event:"data_mart_error",category:"DataMart",action:"UpdateDescriptionError",label:M.message})}},[]),h=p.useCallback(A=>{n({type:"UPDATE_DATA_MART_STORAGE",payload:A})},[]),g=p.useCallback(async(A,O,j)=>{try{n({type:"UPDATE_DATA_MART_DEFINITION_START"});let M;switch(O){case Ue.SQL:M={definitionType:O,definition:LW(j)};break;case Ue.TABLE:M={definitionType:O,definition:UW(j)};break;case Ue.VIEW:M={definitionType:O,definition:zW(j)};break;case Ue.TABLE_PATTERN:M={definitionType:O,definition:$W(j)};break;case Ue.CONNECTOR:{const Y=j;let Z;for(const ee of Y.connector.source.configuration){const $=ee;if($._copiedFrom){Z=$._copiedFrom.dataMartId;break}}M={definitionType:Ue.CONNECTOR,definition:BW(Y),sourceDataMartId:Z};break}default:throw new Error(`Unsupported definition type: ${String(O)}`)}const F=await nn.updateDataMartDefinition(A,M),G=await Uc(F);n({type:"UPDATE_DATA_MART_DEFINITION_SUCCESS",payload:{definitionType:O,definition:j}}),n({type:"UPDATE_DATA_MART_SUCCESS",payload:G}),Pe({event:"data_mart_updated",category:"DataMart",action:"UpdateDefinition",label:O})}catch(M){const F=yn(M);n({type:"UPDATE_DATA_MART_DEFINITION_ERROR",payload:F}),Pe({event:"data_mart_error",category:"DataMart",action:"UpdateDefinitionError",label:F.message})}},[]),y=p.useCallback(async A=>{try{n({type:"PUBLISH_DATA_MART_START"});const O=await nn.publishDataMart(A),j=await Uc(O);n({type:"PUBLISH_DATA_MART_SUCCESS",payload:j}),At.success("Data Mart published")}catch(O){const j=yn(O);throw n({type:"PUBLISH_DATA_MART_ERROR",payload:j}),Pe({event:"data_mart_error",category:"DataMart",action:"PublishError",label:j.message}),O}},[]),v=p.useCallback(async(A,O=5,j=0,M)=>{try{M!=null&&M.silent||n({type:"FETCH_DATA_MART_RUNS_START"});const F=await nn.getDataMartRuns(A,O,j,M!=null&&M.silent?{skipLoadingIndicator:!0}:void 0),G=NT(F);return n({type:"FETCH_DATA_MART_RUNS_SUCCESS",payload:G}),G}catch(F){throw n({type:"FETCH_DATA_MART_RUNS_ERROR",payload:yn(F)}),F}},[]),b=p.useCallback(async(A,O,j=5)=>{try{n({type:"LOAD_MORE_DATA_MART_RUNS_START"});const M=await nn.getDataMartRuns(A,j,O),F=NT(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:yn(M)}),M}},[]),w=p.useCallback(async A=>{const O=At.loading("Manual run started");try{n({type:"RUN_DATA_MART_START"}),await nn.runDataMart(A.id,A.payload),n({type:"RUN_DATA_MART_SUCCESS"})}catch(j){At.dismiss(O);const M=yn(j);n({type:"RUN_DATA_MART_ERROR",payload:M}),Pe({event:"data_mart_error",category:"DataMart",action:"RunError",label:M.message})}},[]),E=p.useCallback(async(A,O)=>{try{await nn.cancelDataMartRun(A,O),await v(A),At.success("Data Mart run canceled")}catch(j){const M=yn(j);n({type:"RUN_DATA_MART_ERROR",payload:M}),Pe({event:"data_mart_error",category:"DataMart",action:"CancelRunError",label:M.message})}},[v]),S=p.useCallback(async A=>{try{n({type:"ACTUALIZE_DATA_MART_SCHEMA_START"});const O=await nn.actualizeDataMartSchema(A),j=await Uc(O);n({type:"ACTUALIZE_DATA_MART_SCHEMA_SUCCESS",payload:j}),At.success("Output schema actualized")}catch(O){const j=yn(O);n({type:"ACTUALIZE_DATA_MART_SCHEMA_ERROR",payload:j}),Pe({event:"data_mart_error",category:"DataMart",action:"ActualizeSchemaError",label:j.message})}},[]),R=p.useCallback(async(A,O)=>{try{n({type:"UPDATE_DATA_MART_SCHEMA_START"});const j=await nn.updateDataMartSchema(A,{schema:O}),M=await Uc(j);n({type:"UPDATE_DATA_MART_SCHEMA_SUCCESS",payload:M}),At.success("Output schema updated")}catch(j){const M=yn(j);n({type:"UPDATE_DATA_MART_SCHEMA_ERROR",payload:M}),Pe({event:"data_mart_error",category:"DataMart",action:"UpdateSchemaError",label:M.message})}},[]),T=p.useCallback(()=>{n({type:"RESET"})},[]),_=p.useCallback(()=>t.error?t.error.message:null,[t.error]),D={...t,getDataMart:r,createDataMart:s,updateDataMart:l,deleteDataMart:c,updateDataMartTitle:d,updateDataMartDescription:f,updateDataMartStorage:h,updateDataMartDefinition:g,publishDataMart:y,runDataMart:w,cancelDataMartRun:E,actualizeDataMartSchema:S,updateDataMartSchema:R,getDataMartRuns:v,loadMoreDataMartRuns:b,getErrorMessage:_,reset:T};return o.jsx(T3.Provider,{value:D,children:e})}var Kf=e=>e.type==="checkbox",bl=e=>e instanceof Date,ea=e=>e==null;const A3=e=>typeof e=="object";var Wn=e=>!ea(e)&&!Array.isArray(e)&&A3(e)&&!bl(e),D3=e=>Wn(e)&&e.target?Kf(e.target)?e.target.checked:e.target.value:e,YW=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,O3=(e,t)=>e.has(YW(t)),WW=e=>{const t=e.constructor&&e.constructor.prototype;return Wn(t)&&t.hasOwnProperty("isPrototypeOf")},G1=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function tr(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(!(G1&&(e instanceof Blob||r))&&(n||Wn(e)))if(t=n?[]:Object.create(Object.getPrototypeOf(e)),!n&&!WW(e))t=e;else for(const s in e)e.hasOwnProperty(s)&&(t[s]=tr(e[s]));else return e;return t}var Dg=e=>/^\w*$/.test(e),Tn=e=>e===void 0,q1=e=>Array.isArray(e)?e.filter(Boolean):[],Z1=e=>q1(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Ae=(e,t,n)=>{if(!t||!Wn(e))return n;const r=(Dg(t)?[t]:Z1(t)).reduce((s,l)=>ea(s)?s:s[l],e);return Tn(r)||r===e?Tn(e[t])?n:e[t]:r},ha=e=>typeof e=="boolean",Yt=(e,t,n)=>{let r=-1;const s=Dg(t)?[t]:Z1(t),l=s.length,c=l-1;for(;++r<l;){const d=s[r];let f=n;if(r!==c){const h=e[d];f=Wn(h)||Array.isArray(h)?h:isNaN(+s[r+1])?{}:[]}if(d==="__proto__"||d==="constructor"||d==="prototype")return;e[d]=f,e=e[d]}};const Op={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},ls={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},xo={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},K1=ye.createContext(null);K1.displayName="HookFormContext";const ku=()=>ye.useContext(K1),M3=e=>{const{children:t,...n}=e;return ye.createElement(K1.Provider,{value:n},t)};var I3=(e,t,n,r=!0)=>{const s={defaultValues:t._defaultValues};for(const l in e)Object.defineProperty(s,l,{get:()=>{const c=l;return t._proxyFormState[c]!==ls.all&&(t._proxyFormState[c]=!r||ls.all),n&&(n[c]=!0),e[c]}});return s};const Y1=typeof window<"u"?ye.useLayoutEffect:ye.useEffect;function k3(e){const t=ku(),{control:n=t.control,disabled:r,name:s,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 Y1(()=>n._subscribe({name:s,formState:f.current,exact:l,callback:h=>{!r&&d({...n._formState,...h})}}),[s,r,l]),ye.useEffect(()=>{f.current.isValid&&n._setValid(!0)},[n]),ye.useMemo(()=>I3(c,n,f.current,!1),[c,n])}var ya=e=>typeof e=="string",B0=(e,t,n,r,s)=>ya(e)?(r&&t.watch.add(e),Ae(n,e,s)):Array.isArray(e)?e.map(l=>(r&&t.watch.add(l),Ae(n,l))):(r&&(t.watchAll=!0),n),G0=e=>ea(e)||!A3(e);function cs(e,t,n=new WeakSet){if(G0(e)||G0(t))return e===t;if(bl(e)&&bl(t))return e.getTime()===t.getTime();const r=Object.keys(e),s=Object.keys(t);if(r.length!==s.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(!s.includes(l))return!1;if(l!=="ref"){const d=t[l];if(bl(c)&&bl(d)||Wn(c)&&Wn(d)||Array.isArray(c)&&Array.isArray(d)?!cs(c,d,n):c!==d)return!1}}return!0}function QW(e){const t=ku(),{control:n=t.control,name:r,defaultValue:s,disabled:l,exact:c,compute:d}=e||{},f=ye.useRef(s),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}),E=ye.useCallback(D=>{const A=B0(r,n._names,D||n._formValues,!1,f.current);return h.current?h.current(A):A},[n._formValues,n._names,r]),S=ye.useCallback(D=>{if(!l){const A=B0(r,n._names,D||n._formValues,!1,f.current);if(h.current){const O=h.current(A);cs(O,g.current)||(w(O),g.current=O)}else w(A)}},[n._formValues,n._names,l,r]);Y1(()=>((y.current!==n||!cs(v.current,r))&&(y.current=n,v.current=r,S()),n._subscribe({name:r,formState:{values:!0},exact:c,callback:D=>{S(D.values)}})),[n,c,r,S]),ye.useEffect(()=>n._removeUnmounted());const R=y.current!==n,T=v.current,_=ye.useMemo(()=>{if(l)return null;const D=!R&&!cs(T,r);return R||D?E():null},[l,R,r,T,E]);return _!==null?_:b}function XW(e){const t=ku(),{name:n,disabled:r,control:s=t.control,shouldUnregister:l,defaultValue:c}=e,d=O3(s._names.array,n),f=ye.useMemo(()=>Ae(s._formValues,n,Ae(s._defaultValues,n,c)),[s,n,c]),h=QW({control:s,name:n,defaultValue:f,exact:!0}),g=k3({control:s,name:n,exact:!0}),y=ye.useRef(e),v=ye.useRef(void 0),b=ye.useRef(s.register(n,{...e.rules,value:h,...ha(e.disabled)?{disabled:e.disabled}:{}}));y.current=e;const w=ye.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Ae(g.errors,n)},isDirty:{enumerable:!0,get:()=>!!Ae(g.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Ae(g.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Ae(g.validatingFields,n)},error:{enumerable:!0,get:()=>Ae(g.errors,n)}}),[g,n]),E=ye.useCallback(_=>b.current.onChange({target:{value:D3(_),name:n},type:Op.CHANGE}),[n]),S=ye.useCallback(()=>b.current.onBlur({target:{value:Ae(s._formValues,n),name:n},type:Op.BLUR}),[n,s._formValues]),R=ye.useCallback(_=>{const D=Ae(s._fields,n);D&&_&&(D._f.ref={focus:()=>_.focus&&_.focus(),select:()=>_.select&&_.select(),setCustomValidity:A=>_.setCustomValidity(A),reportValidity:()=>_.reportValidity()})},[s._fields,n]),T=ye.useMemo(()=>({name:n,value:h,...ha(r)||g.disabled?{disabled:g.disabled||r}:{},onChange:E,onBlur:S,ref:R}),[n,r,g.disabled,E,S,R,h]);return ye.useEffect(()=>{const _=s._options.shouldUnregister||l,D=v.current;D&&D!==n&&!d&&s.unregister(D),s.register(n,{...y.current.rules,...ha(y.current.disabled)?{disabled:y.current.disabled}:{}});const A=(O,j)=>{const M=Ae(s._fields,O);M&&M._f&&(M._f.mount=j)};if(A(n,!0),_){const O=tr(Ae(s._options.defaultValues,n,y.current.defaultValue));Yt(s._defaultValues,n,O),Tn(Ae(s._formValues,n))&&Yt(s._formValues,n,O)}return!d&&s.register(n),v.current=n,()=>{(d?_&&!s._state.action:_)?s.unregister(n):A(n,!1)}},[n,s,d,l]),ye.useEffect(()=>{s._setDisabledField({disabled:r,name:n})},[r,n,s]),ye.useMemo(()=>({field:T,formState:g,fieldState:w}),[T,g,w])}const JW=e=>e.render(XW(e));var W1=(e,t,n,r,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:s||!0}}:{},Wd=e=>Array.isArray(e)?e:[e],AT=()=>{let e=[];return{get observers(){return e},next:s=>{for(const l of e)l.next&&l.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(l=>l!==s)}}),unsubscribe:()=>{e=[]}}};function L3(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const s=e[r],l=t[r];if(s&&Wn(s)&&l){const c=L3(s,l);Wn(c)&&(n[r]=c)}else e[r]&&(n[r]=l)}return n}var Pr=e=>Wn(e)&&!Object.keys(e).length,Q1=e=>e.type==="file",us=e=>typeof e=="function",Mp=e=>{if(!G1)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},P3=e=>e.type==="select-multiple",X1=e=>e.type==="radio",eQ=e=>X1(e)||Kf(e),Gx=e=>Mp(e)&&e.isConnected;function tQ(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Tn(e)?r++:e[t[r++]];return e}function nQ(e){for(const t in e)if(e.hasOwnProperty(t)&&!Tn(e[t]))return!1;return!0}function Zn(e,t){const n=Array.isArray(t)?t:Dg(t)?[t]:Z1(t),r=n.length===1?e:tQ(e,n),s=n.length-1,l=n[s];return r&&delete r[l],s!==0&&(Wn(r)&&Pr(r)||Array.isArray(r)&&nQ(r))&&Zn(e,n.slice(0,-1)),e}var rQ=e=>{for(const t in e)if(us(e[t]))return!0;return!1};function U3(e){return Array.isArray(e)||Wn(e)&&!rQ(e)}function q0(e,t={}){for(const n in e)U3(e[n])?(t[n]=Array.isArray(e[n])?[]:{},q0(e[n],t[n])):Tn(e[n])||(t[n]=!0);return t}function Gc(e,t,n){n||(n=q0(t));for(const r in e)U3(e[r])?Tn(t)||G0(n[r])?n[r]=q0(e[r],Array.isArray(e[r])?[]:{}):Gc(e[r],ea(t)?{}:t[r],n[r]):n[r]=!cs(e[r],t[r]);return n}const DT={value:!1,isValid:!1},OT={value:!0,isValid:!0};var F3=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&&!Tn(e[0].attributes.value)?Tn(e[0].value)||e[0].value===""?OT:{value:e[0].value,isValid:!0}:OT:DT}return DT},z3=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Tn(e)?e:t?e===""?NaN:e&&+e:n&&ya(e)?new Date(e):r?r(e):e;const MT={isValid:!1,value:null};var V3=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,MT):MT;function IT(e){const t=e.ref;return Q1(t)?t.files:X1(t)?V3(e.refs).value:P3(t)?[...t.selectedOptions].map(({value:n})=>n):Kf(t)?F3(e.refs).value:z3(Tn(t.value)?e.ref.value:t.value,e)}var aQ=(e,t,n,r)=>{const s={};for(const l of e){const c=Ae(t,l);c&&Yt(s,l,c._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:r}},Ip=e=>e instanceof RegExp,Pd=e=>Tn(e)?e:Ip(e)?e.source:Wn(e)?Ip(e.value)?e.value.source:e.value:e,kT=e=>({isOnSubmit:!e||e===ls.onSubmit,isOnBlur:e===ls.onBlur,isOnChange:e===ls.onChange,isOnAll:e===ls.all,isOnTouch:e===ls.onTouched});const LT="AsyncFunction";var sQ=e=>!!e&&!!e.validate&&!!(us(e.validate)&&e.validate.constructor.name===LT||Wn(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===LT)),oQ=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),PT=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Qd=(e,t,n,r)=>{for(const s of n||Object.keys(e)){const l=Ae(e,s);if(l){const{_f:c,...d}=l;if(c){if(c.refs&&c.refs[0]&&t(c.refs[0],s)&&!r)return!0;if(c.ref&&t(c.ref,c.name)&&!r)return!0;if(Qd(d,t))break}else if(Wn(d)&&Qd(d,t))break}}};function UT(e,t,n){const r=Ae(e,n);if(r||Dg(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const l=s.join("."),c=Ae(t,l),d=Ae(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};s.pop()}return{name:n}}var iQ=(e,t,n,r)=>{n(e);const{name:s,...l}=e;return Pr(l)||Object.keys(l).length>=Object.keys(t).length||Object.keys(l).find(c=>t[c]===(!r||ls.all))},lQ=(e,t,n)=>!e||!t||e===t||Wd(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),cQ=(e,t,n,r,s)=>s.isOnAll?!1:!n&&s.isOnTouch?!(t||e):(n?r.isOnBlur:s.isOnBlur)?!e:(n?r.isOnChange:s.isOnChange)?e:!0,uQ=(e,t)=>!q1(Ae(e,t)).length&&Zn(e,t),dQ=(e,t,n)=>{const r=Wd(Ae(e,n));return Yt(r,"root",t[n]),Yt(e,n,r),e};function FT(e,t,n="validate"){if(ya(e)||Array.isArray(e)&&e.every(ya)||ha(e)&&!e)return{type:n,message:ya(e)?e:"",ref:t}}var Fc=e=>Wn(e)&&!Ip(e)?e:{value:e,message:""},zT=async(e,t,n,r,s,l)=>{const{ref:c,refs:d,required:f,maxLength:h,minLength:g,min:y,max:v,pattern:b,validate:w,name:E,valueAsNumber:S,mount:R}=e._f,T=Ae(n,E);if(!R||t.has(E))return{};const _=d?d[0]:c,D=Z=>{s&&_.reportValidity&&(_.setCustomValidity(ha(Z)?"":Z||""),_.reportValidity())},A={},O=X1(c),j=Kf(c),M=O||j,F=(S||Q1(c))&&Tn(c.value)&&Tn(T)||Mp(c)&&c.value===""||T===""||Array.isArray(T)&&!T.length,G=W1.bind(null,E,r,A),Y=(Z,ee,$,W=xo.maxLength,k=xo.minLength)=>{const H=Z?ee:$;A[E]={type:Z?W:k,message:H,ref:c,...G(Z?W:k,H)}};if(l?!Array.isArray(T)||!T.length:f&&(!M&&(F||ea(T))||ha(T)&&!T||j&&!F3(d).isValid||O&&!V3(d).isValid)){const{value:Z,message:ee}=ya(f)?{value:!!f,message:f}:Fc(f);if(Z&&(A[E]={type:xo.required,message:ee,ref:_,...G(xo.required,ee)},!r))return D(ee),A}if(!F&&(!ea(y)||!ea(v))){let Z,ee;const $=Fc(v),W=Fc(y);if(!ea(T)&&!isNaN(T)){const k=c.valueAsNumber||T&&+T;ea($.value)||(Z=k>$.value),ea(W.value)||(ee=k<W.value)}else{const k=c.valueAsDate||new Date(T),H=xe=>new Date(new Date().toDateString()+" "+xe),B=c.type=="time",ie=c.type=="week";ya($.value)&&T&&(Z=B?H(T)>H($.value):ie?T>$.value:k>new Date($.value)),ya(W.value)&&T&&(ee=B?H(T)<H(W.value):ie?T<W.value:k<new Date(W.value))}if((Z||ee)&&(Y(!!Z,$.message,W.message,xo.max,xo.min),!r))return D(A[E].message),A}if((h||g)&&!F&&(ya(T)||l&&Array.isArray(T))){const Z=Fc(h),ee=Fc(g),$=!ea(Z.value)&&T.length>+Z.value,W=!ea(ee.value)&&T.length<+ee.value;if(($||W)&&(Y($,Z.message,ee.message),!r))return D(A[E].message),A}if(b&&!F&&ya(T)){const{value:Z,message:ee}=Fc(b);if(Ip(Z)&&!T.match(Z)&&(A[E]={type:xo.pattern,message:ee,ref:c,...G(xo.pattern,ee)},!r))return D(ee),A}if(w){if(us(w)){const Z=await w(T,n),ee=FT(Z,_);if(ee&&(A[E]={...ee,...G(xo.validate,ee.message)},!r))return D(ee.message),A}else if(Wn(w)){let Z={};for(const ee in w){if(!Pr(Z)&&!r)break;const $=FT(await w[ee](T,n),_,ee);$&&(Z={...$,...G(ee,$.message)},D($.message),r&&(A[E]=Z))}if(!Pr(Z)&&(A[E]={ref:_,...Z},!r))return A}}return D(!0),A};const fQ={mode:ls.onSubmit,reValidateMode:ls.onChange,shouldFocusError:!0};function hQ(e={}){let t={...fQ,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:us(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},s=Wn(t.defaultValues)||Wn(t.values)?tr(t.defaultValues||t.values)||{}:{},l=t.shouldUnregister?{}:tr(s),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:AT(),state:AT()},b=t.criteriaMode===ls.all,w=U=>Q=>{clearTimeout(h),h=setTimeout(U,Q)},E=async U=>{if(!t.disabled&&(g.isValid||y.isValid||U)){const Q=t.resolver?Pr((await j()).errors):await F(r,!0);Q!==n.isValid&&v.state.next({isValid:Q})}},S=(U,Q)=>{!t.disabled&&(g.isValidating||g.validatingFields||y.isValidating||y.validatingFields)&&((U||Array.from(d.mount)).forEach(de=>{de&&(Q?Yt(n.validatingFields,de,Q):Zn(n.validatingFields,de))}),v.state.next({validatingFields:n.validatingFields,isValidating:!Pr(n.validatingFields)}))},R=(U,Q=[],de,je,be=!0,Ee=!0)=>{if(je&&de&&!t.disabled){if(c.action=!0,Ee&&Array.isArray(Ae(r,U))){const Ye=de(Ae(r,U),je.argA,je.argB);be&&Yt(r,U,Ye)}if(Ee&&Array.isArray(Ae(n.errors,U))){const Ye=de(Ae(n.errors,U),je.argA,je.argB);be&&Yt(n.errors,U,Ye),uQ(n.errors,U)}if((g.touchedFields||y.touchedFields)&&Ee&&Array.isArray(Ae(n.touchedFields,U))){const Ye=de(Ae(n.touchedFields,U),je.argA,je.argB);be&&Yt(n.touchedFields,U,Ye)}(g.dirtyFields||y.dirtyFields)&&(n.dirtyFields=Gc(s,l)),v.state.next({name:U,isDirty:Y(U,Q),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Yt(l,U,Q)},T=(U,Q)=>{Yt(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,je)=>{const be=Ae(r,U);if(be){const Ee=Ae(l,U,Tn(de)?Ae(s,U):de);Tn(Ee)||je&&je.defaultChecked||Q?Yt(l,U,Q?Ee:IT(be._f)):$(U,Ee),c.mount&&E()}},A=(U,Q,de,je,be)=>{let Ee=!1,Ye=!1;const st={name:U};if(!t.disabled){if(!de||je){(g.isDirty||y.isDirty)&&(Ye=n.isDirty,n.isDirty=st.isDirty=Y(),Ee=Ye!==st.isDirty);const ot=cs(Ae(s,U),Q);Ye=!!Ae(n.dirtyFields,U),ot?Zn(n.dirtyFields,U):Yt(n.dirtyFields,U,!0),st.dirtyFields=n.dirtyFields,Ee=Ee||(g.dirtyFields||y.dirtyFields)&&Ye!==!ot}if(de){const ot=Ae(n.touchedFields,U);ot||(Yt(n.touchedFields,U,de),st.touchedFields=n.touchedFields,Ee=Ee||(g.touchedFields||y.touchedFields)&&ot!==de)}Ee&&be&&v.state.next(st)}return Ee?st:{}},O=(U,Q,de,je)=>{const be=Ae(n.errors,U),Ee=(g.isValid||y.isValid)&&ha(Q)&&n.isValid!==Q;if(t.delayError&&de?(f=w(()=>T(U,de)),f(t.delayError)):(clearTimeout(h),f=null,de?Yt(n.errors,U,de):Zn(n.errors,U)),(de?!cs(be,de):be)||!Pr(je)||Ee){const Ye={...je,...Ee&&ha(Q)?{isValid:Q}:{},errors:n.errors,name:U};n={...n,...Ye},v.state.next(Ye)}},j=async U=>{S(U,!0);const Q=await t.resolver(l,t.context,aQ(U||d.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return S(U),Q},M=async U=>{const{errors:Q}=await j(U);if(U)for(const de of U){const je=Ae(Q,de);je?Yt(n.errors,de,je):Zn(n.errors,de)}else n.errors=Q;return Q},F=async(U,Q,de={valid:!0})=>{for(const je in U){const be=U[je];if(be){const{_f:Ee,...Ye}=be;if(Ee){const st=d.array.has(Ee.name),ot=be._f&&sQ(be._f);ot&&g.validatingFields&&S([Ee.name],!0);const mn=await zT(be,d.disabled,l,b,t.shouldUseNativeValidation&&!Q,st);if(ot&&g.validatingFields&&S([Ee.name]),mn[Ee.name]&&(de.valid=!1,Q))break;!Q&&(Ae(mn,Ee.name)?st?dQ(n.errors,mn,Ee.name):Yt(n.errors,Ee.name,mn[Ee.name]):Zn(n.errors,Ee.name))}!Pr(Ye)&&await F(Ye,Q,de)}}return de.valid},G=()=>{for(const U of d.unMount){const Q=Ae(r,U);Q&&(Q._f.refs?Q._f.refs.every(de=>!Gx(de)):!Gx(Q._f.ref))&&le(U)}d.unMount=new Set},Y=(U,Q)=>!t.disabled&&(U&&Q&&Yt(l,U,Q),!cs(xe(),s)),Z=(U,Q,de)=>B0(U,d,{...c.mount?l:Tn(Q)?s:ya(U)?{[U]:Q}:Q},de,Q),ee=U=>q1(Ae(c.mount?l:s,U,t.shouldUnregister?Ae(s,U,[]):[])),$=(U,Q,de={})=>{const je=Ae(r,U);let be=Q;if(je){const Ee=je._f;Ee&&(!Ee.disabled&&Yt(l,U,z3(Q,Ee)),be=Mp(Ee.ref)&&ea(Q)?"":Q,P3(Ee.ref)?[...Ee.ref.options].forEach(Ye=>Ye.selected=be.includes(Ye.value)):Ee.refs?Kf(Ee.ref)?Ee.refs.forEach(Ye=>{(!Ye.defaultChecked||!Ye.disabled)&&(Array.isArray(be)?Ye.checked=!!be.find(st=>st===Ye.value):Ye.checked=be===Ye.value||!!be)}):Ee.refs.forEach(Ye=>Ye.checked=Ye.value===be):Q1(Ee.ref)?Ee.ref.value="":(Ee.ref.value=be,Ee.ref.type||v.state.next({name:U,values:tr(l)})))}(de.shouldDirty||de.shouldTouch)&&A(U,be,de.shouldTouch,de.shouldDirty,!0),de.shouldValidate&&ie(U)},W=(U,Q,de)=>{for(const je in Q){if(!Q.hasOwnProperty(je))return;const be=Q[je],Ee=U+"."+je,Ye=Ae(r,Ee);(d.array.has(U)||Wn(be)||Ye&&!Ye._f)&&!bl(be)?W(Ee,be,de):$(Ee,be,de)}},k=(U,Q,de={})=>{const je=Ae(r,U),be=d.array.has(U),Ee=tr(Q);Yt(l,U,Ee),be?(v.array.next({name:U,values:tr(l)}),(g.isDirty||g.dirtyFields||y.isDirty||y.dirtyFields)&&de.shouldDirty&&v.state.next({name:U,dirtyFields:Gc(s,l),isDirty:Y(U,Ee)})):je&&!je._f&&!ea(Ee)?W(U,Ee,de):$(U,Ee,de),PT(U,d)&&v.state.next({...n,name:U}),v.state.next({name:c.mount?U:void 0,values:tr(l)})},H=async U=>{c.mount=!0;const Q=U.target;let de=Q.name,je=!0;const be=Ae(r,de),Ee=ot=>{je=Number.isNaN(ot)||bl(ot)&&isNaN(ot.getTime())||cs(ot,Ae(l,de,ot))},Ye=kT(t.mode),st=kT(t.reValidateMode);if(be){let ot,mn;const Na=Q.type?IT(be._f):D3(U),pn=U.type===Op.BLUR||U.type===Op.FOCUS_OUT,zo=!oQ(be._f)&&!t.resolver&&!Ae(n.errors,de)&&!be._f.deps||cQ(pn,Ae(n.touchedFields,de),n.isSubmitted,st,Ye),Dn=PT(de,d,pn);Yt(l,de,Na),pn?(!Q||!Q.readOnly)&&(be._f.onBlur&&be._f.onBlur(U),f&&f(0)):be._f.onChange&&be._f.onChange(U);const bn=A(de,Na,pn),hr=!Pr(bn)||Dn;if(!pn&&v.state.next({name:de,type:U.type,values:tr(l)}),zo)return(g.isValid||y.isValid)&&(t.mode==="onBlur"?pn&&E():pn||E()),hr&&v.state.next({name:de,...Dn?{}:bn});if(!pn&&Dn&&v.state.next({...n}),t.resolver){const{errors:Sn}=await j([de]);if(Ee(Na),je){const Wi=UT(n.errors,r,de),Cs=UT(Sn,r,Wi.name||de);ot=Cs.error,de=Cs.name,mn=Pr(Sn)}}else S([de],!0),ot=(await zT(be,d.disabled,l,b,t.shouldUseNativeValidation))[de],S([de]),Ee(Na),je&&(ot?mn=!1:(g.isValid||y.isValid)&&(mn=await F(r,!0)));je&&(be._f.deps&&(!Array.isArray(be._f.deps)||be._f.deps.length>0)&&ie(be._f.deps),O(de,mn,ot,bn))}},B=(U,Q)=>{if(Ae(n.errors,Q)&&U.focus)return U.focus(),1},ie=async(U,Q={})=>{let de,je;const be=Wd(U);if(t.resolver){const Ee=await M(Tn(U)?U:be);de=Pr(Ee),je=U?!be.some(Ye=>Ae(Ee,Ye)):de}else U?(je=(await Promise.all(be.map(async Ee=>{const Ye=Ae(r,Ee);return await F(Ye&&Ye._f?{[Ee]:Ye}:Ye)}))).every(Boolean),!(!je&&!n.isValid)&&E()):je=de=await F(r);return v.state.next({...!ya(U)||(g.isValid||y.isValid)&&de!==n.isValid?{}:{name:U},...t.resolver||!U?{isValid:de}:{},errors:n.errors}),Q.shouldFocus&&!je&&Qd(r,B,U?be:d.mount),je},xe=(U,Q)=>{let de={...c.mount?l:s};return Q&&(de=L3(Q.dirtyFields?n.dirtyFields:n.touchedFields,de)),Tn(U)?de:ya(U)?Ae(de,U):U.map(je=>Ae(de,je))},L=(U,Q)=>({invalid:!!Ae((Q||n).errors,U),isDirty:!!Ae((Q||n).dirtyFields,U),error:Ae((Q||n).errors,U),isValidating:!!Ae(n.validatingFields,U),isTouched:!!Ae((Q||n).touchedFields,U)}),P=U=>{U&&Wd(U).forEach(Q=>Zn(n.errors,Q)),v.state.next({errors:U?n.errors:{}})},q=(U,Q,de)=>{const je=(Ae(r,U,{_f:{}})._f||{}).ref,be=Ae(n.errors,U)||{},{ref:Ee,message:Ye,type:st,...ot}=be;Yt(n.errors,U,{...ot,...Q,ref:je}),v.state.next({name:U,errors:n.errors,isValid:!1}),de&&de.shouldFocus&&je&&je.focus&&je.focus()},te=(U,Q)=>us(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=>{lQ(U.name,Q.name,U.exact)&&iQ(Q,U.formState||g,jr,U.reRenderRoot)&&U.callback({values:{...l},...n,...Q,defaultValues:s})}}).unsubscribe,ve=U=>(c.mount=!0,y={...y,...U.formState},ue({...U,formState:y})),le=(U,Q={})=>{for(const de of U?Wd(U):d.mount)d.mount.delete(de),d.array.delete(de),Q.keepValue||(Zn(r,de),Zn(l,de)),!Q.keepError&&Zn(n.errors,de),!Q.keepDirty&&Zn(n.dirtyFields,de),!Q.keepTouched&&Zn(n.touchedFields,de),!Q.keepIsValidating&&Zn(n.validatingFields,de),!t.shouldUnregister&&!Q.keepDefaultValue&&Zn(s,de);v.state.next({values:tr(l)}),v.state.next({...n,...Q.keepDirty?{isDirty:Y()}:{}}),!Q.keepIsValid&&E()},Ne=({disabled:U,name:Q})=>{(ha(U)&&c.mount||U||d.disabled.has(Q))&&(U?d.disabled.add(Q):d.disabled.delete(Q))},we=(U,Q={})=>{let de=Ae(r,U);const je=ha(Q.disabled)||ha(t.disabled);return Yt(r,U,{...de||{},_f:{...de&&de._f?de._f:{ref:{name:U}},name:U,mount:!0,...Q}}),d.mount.add(U),de?Ne({disabled:ha(Q.disabled)?Q.disabled:t.disabled,name:U}):D(U,!0,Q.value),{...je?{disabled:Q.disabled||t.disabled}:{},...t.progressive?{required:!!Q.required,min:Pd(Q.min),max:Pd(Q.max),minLength:Pd(Q.minLength),maxLength:Pd(Q.maxLength),pattern:Pd(Q.pattern)}:{},name:U,onChange:H,onBlur:H,ref:be=>{if(be){we(U,Q),de=Ae(r,U);const Ee=Tn(be.value)&&be.querySelectorAll&&be.querySelectorAll("input,select,textarea")[0]||be,Ye=eQ(Ee),st=de._f.refs||[];if(Ye?st.find(ot=>ot===Ee):Ee===de._f.ref)return;Yt(r,U,{_f:{...de._f,...Ye?{refs:[...st.filter(Gx),Ee,...Array.isArray(Ae(s,U))?[{}]:[]],ref:{type:Ee.type,name:U}}:{ref:Ee}}}),D(U,!1,void 0,Ee)}else de=Ae(r,U,{}),de._f&&(de._f.mount=!1),(t.shouldUnregister||Q.shouldUnregister)&&!(O3(d.array,U)&&c.action)&&d.unMount.add(U)}}},_e=()=>t.shouldFocusError&&Qd(r,B,d.mount),He=U=>{ha(U)&&(v.state.next({disabled:U}),Qd(r,(Q,de)=>{const je=Ae(r,de);je&&(Q.disabled=je._f.disabled||U,Array.isArray(je._f.refs)&&je._f.refs.forEach(be=>{be.disabled=je._f.disabled||U}))},0,!1))},We=(U,Q)=>async de=>{let je;de&&(de.preventDefault&&de.preventDefault(),de.persist&&de.persist());let be=tr(l);if(v.state.next({isSubmitting:!0}),t.resolver){const{errors:Ee,values:Ye}=await j();n.errors=Ee,be=tr(Ye)}else await F(r);if(d.disabled.size)for(const Ee of d.disabled)Zn(be,Ee);if(Zn(n.errors,"root"),Pr(n.errors)){v.state.next({errors:{}});try{await U(be,de)}catch(Ee){je=Ee}}else Q&&await Q({...n.errors},de),_e(),setTimeout(_e);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Pr(n.errors)&&!je,submitCount:n.submitCount+1,errors:n.errors}),je)throw je},Ft=(U,Q={})=>{Ae(r,U)&&(Tn(Q.defaultValue)?k(U,tr(Ae(s,U))):(k(U,Q.defaultValue),Yt(s,U,tr(Q.defaultValue))),Q.keepTouched||Zn(n.touchedFields,U),Q.keepDirty||(Zn(n.dirtyFields,U),n.isDirty=Q.defaultValue?Y(U,tr(Ae(s,U))):Y()),Q.keepError||(Zn(n.errors,U),g.isValid&&E()),v.state.next({...n}))},jt=(U,Q={})=>{const de=U?tr(U):s,je=tr(de),be=Pr(U),Ee=be?s:je;if(Q.keepDefaultValues||(s=de),!Q.keepValues){if(Q.keepDirtyValues){const Ye=new Set([...d.mount,...Object.keys(Gc(s,l))]);for(const st of Array.from(Ye))Ae(n.dirtyFields,st)?Yt(Ee,st,Ae(l,st)):k(st,Ae(Ee,st))}else{if(G1&&Tn(U))for(const Ye of d.mount){const st=Ae(r,Ye);if(st&&st._f){const ot=Array.isArray(st._f.refs)?st._f.refs[0]:st._f.ref;if(Mp(ot)){const mn=ot.closest("form");if(mn){mn.reset();break}}}}if(Q.keepFieldsRef)for(const Ye of d.mount)k(Ye,Ae(Ee,Ye));else r={}}l=t.shouldUnregister?Q.keepDefaultValues?tr(s):{}:tr(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&&!Pr(Ee),c.watch=!!t.shouldUnregister,v.state.next({submitCount:Q.keepSubmitCount?n.submitCount:0,isDirty:be?!1:Q.keepDirty?n.isDirty:!!(Q.keepDefaultValues&&!cs(U,s)),isSubmitted:Q.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:be?{}:Q.keepDirtyValues?Q.keepDefaultValues&&l?Gc(s,l):n.dirtyFields:Q.keepDefaultValues&&U?Gc(s,U):Q.keepDirty?n.dirtyFields:{},touchedFields:Q.keepTouched?n.touchedFields:{},errors:Q.keepErrors?n.errors:{},isSubmitSuccessful:Q.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},Bt=(U,Q)=>jt(us(U)?U(l):U,Q),xn=(U,Q={})=>{const de=Ae(r,U),je=de&&de._f;if(je){const be=je.refs?je.refs[0]:je.ref;be.focus&&(be.focus(),Q.shouldSelect&&us(be.select)&&be.select())}},jr=U=>{n={...n,...U}},Fe={control:{register:we,unregister:le,getFieldState:L,handleSubmit:We,setError:q,_subscribe:ue,_runSchema:j,_focusError:_e,_getWatch:Z,_getDirty:Y,_setValid:E,_setFieldArray:R,_setDisabledField:Ne,_setErrors:_,_getFieldArray:ee,_reset:jt,_resetDefaultValues:()=>us(t.defaultValues)&&t.defaultValues().then(U=>{Bt(U,t.resetOptions),v.state.next({isLoading:!1})}),_removeUnmounted:G,_disableForm:He,_subjects:v,_proxyFormState:g,get _fields(){return r},get _formValues(){return l},get _state(){return c},set _state(U){c=U},get _defaultValues(){return s},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:We,watch:te,setValue:k,getValues:xe,reset:Bt,resetField:Ft,clearErrors:P,unregister:le,setError:q,setFocus:xn,getFieldState:L};return{...Fe,formControl:Fe}}function Gi(e={}){const t=ye.useRef(void 0),n=ye.useRef(void 0),[r,s]=ye.useState({isDirty:!1,isValidating:!1,isLoading:us(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:us(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!us(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:c,...d}=hQ(e);t.current={...d,formState:r}}const l=t.current.control;return l._options=e,Y1(()=>{const c=l._subscribe({formState:l._proxyFormState,callback:()=>s({...l._formState}),reRenderRoot:!0});return s(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&&!cs(e.values,n.current)?(l._reset(e.values,{keepFieldsRef:!0,...l._options.resetOptions}),n.current=e.values,s(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=I3(r,l),t.current}var mQ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],pQ=mQ.reduce((e,t)=>{const n=jb(`Primitive.${t}`),r=p.forwardRef((s,l)=>{const{asChild:c,...d}=s,f=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(f,{...d,ref:l})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),gQ="Label",$3=p.forwardRef((e,t)=>o.jsx(pQ.label,{...e,ref:t,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));$3.displayName=gQ;var yQ=$3;function Ca({className:e,...t}){return o.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 Wl=M3,H3=p.createContext({}),en=({...e})=>o.jsx(H3.Provider,{value:{name:e.name},children:o.jsx(JW,{...e})}),Yf=()=>{const e=p.useContext(H3),t=p.useContext(B3),{getFieldState:n}=ku(),r=k3({name:e.name}),s=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`,...s}},B3=p.createContext({});function Vt({className:e="",...t}){const n=p.useId();return o.jsx(B3.Provider,{value:{id:n},children:o.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 $t({className:e="",tooltip:t,tooltipProps:n,children:r,...s}){const{error:l,formItemId:c}=Yf();return o.jsxs(Ca,{"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,...s,children:[o.jsx("span",{children:r}),t&&o.jsxs(St,{...n,children:[o.jsx(Ct,{asChild:!0,children:o.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:o.jsx(zr,{className:"text-muted-foreground/50 hover:text-muted-foreground size-4 shrink-0 transition-colors","aria-hidden":"true"})})}),o.jsx(Et,{side:"top",align:"center",role:"tooltip",children:t})]})]})}function Ht({...e}){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:s}=Yf();return o.jsx(Yp,{"data-slot":"form-control",id:n,"aria-describedby":t?`${r} ${s}`:`${r}`,"aria-invalid":!!t,...e})}function Pn({className:e,...t}){const{formDescriptionId:n}=Yf();return o.jsx("div",{"data-slot":"form-description",id:n,className:ne("text-muted-foreground text-sm",e),...t})}function on({className:e,...t}){const{error:n,formMessageId:r}=Yf(),s=n?String((n==null?void 0:n.message)??""):t.children;return s?o.jsx("p",{"data-slot":"form-message",id:r,className:ne("text-destructive text-sm",e),...t,children:s}):null}function Ql({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 o.jsx("div",{className:r,children:o.jsx("div",{className:ne("flex min-h-full flex-col gap-4",t),children:e})})}function Xl({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 o.jsx("div",{className:ne(r,e),children:t})}function Hs({title:e,children:t}){return o.jsxs("section",{className:"mb-4",children:[e&&o.jsx("h3",{className:"text-muted-foreground/75 mb-2 text-xs font-semibold tracking-wide uppercase",children:e}),o.jsx("div",{className:"flex flex-col gap-2",children:t})]})}function vQ({value:e,label:t,checked:n,onChange:r,disabled:s=!1,orientation:l="vertical",className:c=""}){const{formItemId:d}=Yf();return o.jsxs("label",{htmlFor:`${d}-${e}`,className:ne("flex cursor-pointer items-center gap-2 rounded-md py-1 pr-4 pl-2 text-sm",s&&"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:[o.jsx("input",{type:"radio",id:`${d}-${e}`,value:e,checked:n,onChange:r,disabled:s,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")}),o.jsx("span",{className:ne("peer-disabled:cursor-not-allowed peer-disabled:opacity-50"),children:t})]})}function xQ({options:e,value:t,onChange:n,orientation:r="vertical",className:s=""}){return o.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",s),children:e.map(l=>o.jsx(vQ,{value:l.value,label:l.label,checked:t===l.value,onChange:c=>n(c.target.value),disabled:l.disabled,orientation:r},l.value))})}const qi=p.forwardRef(({children:e,className:t="",...n},r)=>o.jsx("form",{ref:r,className:ne("flex flex-1 flex-col overflow-hidden",t),...n,children:e}));qi.displayName="AppForm";function VT(e,[t,n]){return Math.min(n,Math.max(t,e))}function Z0(e){const t=bQ(e),n=p.forwardRef((r,s)=>{const{children:l,...c}=r,d=p.Children.toArray(l),f=d.find(CQ);if(f){const h=f.props.children,g=d.map(y=>y===f?p.Children.count(h)>1?p.Children.only(null):p.isValidElement(h)?h.props.children:null:y);return o.jsx(t,{...c,ref:s,children:p.isValidElement(h)?p.cloneElement(h,void 0,g):null})}return o.jsx(t,{...c,ref:s,children:l})});return n.displayName=`${e}.Slot`,n}function bQ(e){const t=p.forwardRef((n,r)=>{const{children:s,...l}=n;if(p.isValidElement(s)){const c=wQ(s),d=EQ(l,s.props);return s.type!==p.Fragment&&(d.ref=r?Ir(r,c):c),p.cloneElement(s,d)}return p.Children.count(s)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var SQ=Symbol("radix.slottable");function CQ(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===SQ}function EQ(e,t){const n={...t};for(const r in t){const s=e[r],l=t[r];/^on[A-Z]/.test(r)?s&&l?n[r]=(...d)=>{const f=l(...d);return s(...d),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...l}:r==="className"&&(n[r]=[s,l].filter(Boolean).join(" "))}return{...e,...n}}function wQ(e){var r,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function RQ(e){const t=e+"CollectionProvider",[n,r]=ir(t),[s,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=E=>{const{scope:S,children:R}=E,T=ye.useRef(null),_=ye.useRef(new Map).current;return o.jsx(s,{scope:S,itemMap:_,collectionRef:T,children:R})};c.displayName=t;const d=e+"CollectionSlot",f=Z0(d),h=ye.forwardRef((E,S)=>{const{scope:R,children:T}=E,_=l(d,R),D=ut(S,_.collectionRef);return o.jsx(f,{ref:D,children:T})});h.displayName=d;const g=e+"CollectionItemSlot",y="data-radix-collection-item",v=Z0(g),b=ye.forwardRef((E,S)=>{const{scope:R,children:T,..._}=E,D=ye.useRef(null),A=ut(S,D),O=l(g,R);return ye.useEffect(()=>(O.itemMap.set(D,{ref:D,..._}),()=>void O.itemMap.delete(D))),o.jsx(v,{[y]:"",ref:A,children:T})});b.displayName=g;function w(E){const S=l(e+"CollectionConsumer",E);return ye.useCallback(()=>{const T=S.collectionRef.current;if(!T)return[];const _=Array.from(T.querySelectorAll(`[${y}]`));return Array.from(S.itemMap.values()).sort((O,j)=>_.indexOf(O.ref.current)-_.indexOf(j.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:c,Slot:h,ItemSlot:b},w,r]}function J1(e){const t=p.useRef({value:e,previous:e});return p.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var TQ=[" ","Enter","ArrowUp","ArrowDown"],jQ=[" ","Enter"],Ul="Select",[Og,Mg,_Q]=RQ(Ul),[Lu]=ir(Ul,[_Q,Zs]),Ig=Zs(),[NQ,Zi]=Lu(Ul),[AQ,DQ]=Lu(Ul),G3=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:l,value:c,defaultValue:d,onValueChange:f,dir:h,name:g,autoComplete:y,disabled:v,required:b,form:w}=e,E=Ig(t),[S,R]=p.useState(null),[T,_]=p.useState(null),[D,A]=p.useState(!1),O=If(h),[j,M]=Vr({prop:r,defaultProp:s??!1,onChange:l,caller:Ul}),[F,G]=Vr({prop:c,defaultProp:d,onChange:f,caller:Ul}),Y=p.useRef(null),Z=S?w||!!S.closest("form"):!0,[ee,$]=p.useState(new Set),W=Array.from(ee).map(k=>k.props.value).join(";");return o.jsx(wu,{...E,children:o.jsxs(NQ,{required:b,scope:t,trigger:S,onTriggerChange:R,valueNode:T,onValueNodeChange:_,valueNodeHasChildren:D,onValueNodeHasChildrenChange:A,contentId:Nn(),value:F,onValueChange:G,open:j,onOpenChange:M,dir:O,triggerPointerDownPosRef:Y,disabled:v,children:[o.jsx(Og.Provider,{scope:t,children:o.jsx(AQ,{scope:e.__scopeSelect,onNativeOptionAdd:p.useCallback(k=>{$(H=>new Set(H).add(k))},[]),onNativeOptionRemove:p.useCallback(k=>{$(H=>{const B=new Set(H);return B.delete(k),B})},[]),children:n})}),Z?o.jsxs(pD,{"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?o.jsx("option",{value:""}):null,Array.from(ee)]},W):null]})})};G3.displayName=Ul;var q3="SelectTrigger",Z3=p.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,l=Ig(n),c=Zi(q3,n),d=c.disabled||r,f=ut(t,c.onTriggerChange),h=Mg(n),g=p.useRef("touch"),[y,v,b]=yD(E=>{const S=h().filter(_=>!_.disabled),R=S.find(_=>_.value===c.value),T=vD(S,E,R);T!==void 0&&c.onValueChange(T.value)}),w=E=>{d||(c.onOpenChange(!0),b()),E&&(c.triggerPointerDownPosRef.current={x:Math.round(E.pageX),y:Math.round(E.pageY)})};return o.jsx(Ru,{asChild:!0,...l,children:o.jsx(Je.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":gD(c.value)?"":void 0,...s,ref:f,onClick:Te(s.onClick,E=>{E.currentTarget.focus(),g.current!=="mouse"&&w(E)}),onPointerDown:Te(s.onPointerDown,E=>{g.current=E.pointerType;const S=E.target;S.hasPointerCapture(E.pointerId)&&S.releasePointerCapture(E.pointerId),E.button===0&&E.ctrlKey===!1&&E.pointerType==="mouse"&&(w(E),E.preventDefault())}),onKeyDown:Te(s.onKeyDown,E=>{const S=y.current!=="";!(E.ctrlKey||E.altKey||E.metaKey)&&E.key.length===1&&v(E.key),!(S&&E.key===" ")&&TQ.includes(E.key)&&(w(),E.preventDefault())})})})});Z3.displayName=q3;var K3="SelectValue",Y3=p.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:l,placeholder:c="",...d}=e,f=Zi(K3,n),{onValueNodeHasChildrenChange:h}=f,g=l!==void 0,y=ut(t,f.onValueNodeChange);return Cr(()=>{h(g)},[h,g]),o.jsx(Je.span,{...d,ref:y,style:{pointerEvents:"none"},children:gD(f.value)?o.jsx(o.Fragment,{children:c}):l})});Y3.displayName=K3;var OQ="SelectIcon",W3=p.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return o.jsx(Je.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});W3.displayName=OQ;var MQ="SelectPortal",Q3=e=>o.jsx(Bl,{asChild:!0,...e});Q3.displayName=MQ;var Fl="SelectContent",X3=p.forwardRef((e,t)=>{const n=Zi(Fl,e.__scopeSelect),[r,s]=p.useState();if(Cr(()=>{s(new DocumentFragment)},[]),!n.open){const l=r;return l?ds.createPortal(o.jsx(J3,{scope:e.__scopeSelect,children:o.jsx(Og.Slot,{scope:e.__scopeSelect,children:o.jsx("div",{children:e.children})})}),l):null}return o.jsx(eD,{...e,ref:t})});X3.displayName=Fl;var as=10,[J3,Ki]=Lu(Fl),IQ="SelectContentImpl",kQ=Z0("SelectContent.RemoveScroll"),eD=p.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:l,onPointerDownOutside:c,side:d,sideOffset:f,align:h,alignOffset:g,arrowPadding:y,collisionBoundary:v,collisionPadding:b,sticky:w,hideWhenDetached:E,avoidCollisions:S,...R}=e,T=Zi(Fl,n),[_,D]=p.useState(null),[A,O]=p.useState(null),j=ut(t,le=>D(le)),[M,F]=p.useState(null),[G,Y]=p.useState(null),Z=Mg(n),[ee,$]=p.useState(!1),W=p.useRef(!1);p.useEffect(()=>{if(_)return eg(_)},[_]),Xp();const k=p.useCallback(le=>{const[Ne,...we]=Z().map(We=>We.ref.current),[_e]=we.slice(-1),He=document.activeElement;for(const We of le)if(We===He||(We==null||We.scrollIntoView({block:"nearest"}),We===Ne&&A&&(A.scrollTop=0),We===_e&&A&&(A.scrollTop=A.scrollHeight),We==null||We.focus(),document.activeElement!==He))return},[Z,A]),H=p.useCallback(()=>k([M,_]),[k,M,_]);p.useEffect(()=>{ee&&H()},[ee,H]);const{onOpenChange:B,triggerPointerDownPosRef:ie}=T;p.useEffect(()=>{if(_){let le={x:0,y:0};const Ne=_e=>{var He,We;le={x:Math.abs(Math.round(_e.pageX)-(((He=ie.current)==null?void 0:He.x)??0)),y:Math.abs(Math.round(_e.pageY)-(((We=ie.current)==null?void 0:We.y)??0))}},we=_e=>{le.x<=10&&le.y<=10?_e.preventDefault():_.contains(_e.target)||B(!1),document.removeEventListener("pointermove",Ne),ie.current=null};return ie.current!==null&&(document.addEventListener("pointermove",Ne),document.addEventListener("pointerup",we,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Ne),document.removeEventListener("pointerup",we,{capture:!0})}}},[_,B,ie]),p.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]=yD(le=>{const Ne=Z().filter(He=>!He.disabled),we=Ne.find(He=>He.ref.current===document.activeElement),_e=vD(Ne,le,we);_e&&setTimeout(()=>_e.ref.current.focus())}),P=p.useCallback((le,Ne,we)=>{const _e=!W.current&&!we;(T.value!==void 0&&T.value===Ne||_e)&&(F(le),_e&&(W.current=!0))},[T.value]),q=p.useCallback(()=>_==null?void 0:_.focus(),[_]),te=p.useCallback((le,Ne,we)=>{const _e=!W.current&&!we;(T.value!==void 0&&T.value===Ne||_e)&&Y(le)},[T.value]),ue=r==="popper"?K0:tD,ve=ue===K0?{side:d,sideOffset:f,align:h,alignOffset:g,arrowPadding:y,collisionBoundary:v,collisionPadding:b,sticky:w,hideWhenDetached:E,avoidCollisions:S}:{};return o.jsx(J3,{scope:n,content:_,viewport:A,onViewportChange:O,itemRefCallback:P,selectedItem:M,onItemLeave:q,itemTextRefCallback:te,focusSelectedItem:H,selectedItemText:G,position:r,isPositioned:ee,searchRef:xe,children:o.jsx(_f,{as:kQ,allowPinchZoom:!0,children:o.jsx(jf,{asChild:!0,trapped:T.open,onMountAutoFocus:le=>{le.preventDefault()},onUnmountAutoFocus:Te(s,le=>{var Ne;(Ne=T.trigger)==null||Ne.focus({preventScroll:!0}),le.preventDefault()}),children:o.jsx(Hl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:le=>le.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:o.jsx(ue,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:le=>le.preventDefault(),...R,...ve,onPlaced:()=>$(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...R.style},onKeyDown:Te(R.onKeyDown,le=>{const Ne=le.ctrlKey||le.altKey||le.metaKey;if(le.key==="Tab"&&le.preventDefault(),!Ne&&le.key.length===1&&L(le.key),["ArrowUp","ArrowDown","Home","End"].includes(le.key)){let _e=Z().filter(He=>!He.disabled).map(He=>He.ref.current);if(["ArrowUp","End"].includes(le.key)&&(_e=_e.slice().reverse()),["ArrowUp","ArrowDown"].includes(le.key)){const He=le.target,We=_e.indexOf(He);_e=_e.slice(We+1)}setTimeout(()=>k(_e)),le.preventDefault()}})})})})})})});eD.displayName=IQ;var LQ="SelectItemAlignedPosition",tD=p.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,l=Zi(Fl,n),c=Ki(Fl,n),[d,f]=p.useState(null),[h,g]=p.useState(null),y=ut(t,j=>g(j)),v=Mg(n),b=p.useRef(!1),w=p.useRef(!0),{viewport:E,selectedItem:S,selectedItemText:R,focusSelectedItem:T}=c,_=p.useCallback(()=>{if(l.trigger&&l.valueNode&&d&&h&&E&&S&&R){const j=l.trigger.getBoundingClientRect(),M=h.getBoundingClientRect(),F=l.valueNode.getBoundingClientRect(),G=R.getBoundingClientRect();if(l.dir!=="rtl"){const He=G.left-M.left,We=F.left-He,Ft=j.left-We,jt=j.width+Ft,Bt=Math.max(jt,M.width),xn=window.innerWidth-as,jr=VT(We,[as,Math.max(as,xn-Bt)]);d.style.minWidth=jt+"px",d.style.left=jr+"px"}else{const He=M.right-G.right,We=window.innerWidth-F.right-He,Ft=window.innerWidth-j.right-We,jt=j.width+Ft,Bt=Math.max(jt,M.width),xn=window.innerWidth-as,jr=VT(We,[as,Math.max(as,xn-Bt)]);d.style.minWidth=jt+"px",d.style.right=jr+"px"}const Y=v(),Z=window.innerHeight-as*2,ee=E.scrollHeight,$=window.getComputedStyle(h),W=parseInt($.borderTopWidth,10),k=parseInt($.paddingTop,10),H=parseInt($.borderBottomWidth,10),B=parseInt($.paddingBottom,10),ie=W+k+ee+B+H,xe=Math.min(S.offsetHeight*5,ie),L=window.getComputedStyle(E),P=parseInt(L.paddingTop,10),q=parseInt(L.paddingBottom,10),te=j.top+j.height/2-as,ue=Z-te,ve=S.offsetHeight/2,le=S.offsetTop+ve,Ne=W+k+le,we=ie-Ne;if(Ne<=te){const He=Y.length>0&&S===Y[Y.length-1].ref.current;d.style.bottom="0px";const We=h.clientHeight-E.offsetTop-E.offsetHeight,Ft=Math.max(ue,ve+(He?q:0)+We+H),jt=Ne+Ft;d.style.height=jt+"px"}else{const He=Y.length>0&&S===Y[0].ref.current;d.style.top="0px";const Ft=Math.max(te,W+E.offsetTop+(He?P:0)+ve)+we;d.style.height=Ft+"px",E.scrollTop=Ne-te+E.offsetTop}d.style.margin=`${as}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,E,S,R,l.dir,r]);Cr(()=>_(),[_]);const[D,A]=p.useState();Cr(()=>{h&&A(window.getComputedStyle(h).zIndex)},[h]);const O=p.useCallback(j=>{j&&w.current===!0&&(_(),T==null||T(),w.current=!1)},[_,T]);return o.jsx(UQ,{scope:n,contentWrapper:d,shouldExpandOnScrollRef:b,onScrollButtonChange:O,children:o.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:D},children:o.jsx(Je.div,{...s,ref:y,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});tD.displayName=LQ;var PQ="SelectPopperPosition",K0=p.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=as,...l}=e,c=Ig(n);return o.jsx(Af,{...c,...l,ref:t,align:r,collisionPadding:s,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)"}})});K0.displayName=PQ;var[UQ,eS]=Lu(Fl,{}),Y0="SelectViewport",nD=p.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,l=Ki(Y0,n),c=eS(Y0,n),d=ut(t,l.onViewportChange),f=p.useRef(0);return o.jsxs(o.Fragment,{children:[o.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}),o.jsx(Og.Slot,{scope:n,children:o.jsx(Je.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Te(s.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-as*2,E=parseFloat(y.style.minHeight),S=parseFloat(y.style.height),R=Math.max(E,S);if(R<w){const T=R+b,_=Math.min(w,T),D=T-_;y.style.height=_+"px",y.style.bottom==="0px"&&(g.scrollTop=D>0?D:0,y.style.justifyContent="flex-end")}}}f.current=g.scrollTop})})})]})});nD.displayName=Y0;var rD="SelectGroup",[FQ,zQ]=Lu(rD),aD=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Nn();return o.jsx(FQ,{scope:n,id:s,children:o.jsx(Je.div,{role:"group","aria-labelledby":s,...r,ref:t})})});aD.displayName=rD;var sD="SelectLabel",VQ=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=zQ(sD,n);return o.jsx(Je.div,{id:s.id,...r,ref:t})});VQ.displayName=sD;var kp="SelectItem",[$Q,oD]=Lu(kp),iD=p.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:l,...c}=e,d=Zi(kp,n),f=Ki(kp,n),h=d.value===r,[g,y]=p.useState(l??""),[v,b]=p.useState(!1),w=ut(t,T=>{var _;return(_=f.itemRefCallback)==null?void 0:_.call(f,T,r,s)}),E=Nn(),S=p.useRef("touch"),R=()=>{s||(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 o.jsx($Q,{scope:n,value:r,disabled:s,textId:E,isSelected:h,onItemTextChange:p.useCallback(T=>{y(_=>_||((T==null?void 0:T.textContent)??"").trim())},[]),children:o.jsx(Og.ItemSlot,{scope:n,value:r,disabled:s,textValue:g,children:o.jsx(Je.div,{role:"option","aria-labelledby":E,"data-highlighted":v?"":void 0,"aria-selected":h&&v,"data-state":h?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...c,ref:w,onFocus:Te(c.onFocus,()=>b(!0)),onBlur:Te(c.onBlur,()=>b(!1)),onClick:Te(c.onClick,()=>{S.current!=="mouse"&&R()}),onPointerUp:Te(c.onPointerUp,()=>{S.current==="mouse"&&R()}),onPointerDown:Te(c.onPointerDown,T=>{S.current=T.pointerType}),onPointerMove:Te(c.onPointerMove,T=>{var _;S.current=T.pointerType,s?(_=f.onItemLeave)==null||_.call(f):S.current==="mouse"&&T.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Te(c.onPointerLeave,T=>{var _;T.currentTarget===document.activeElement&&((_=f.onItemLeave)==null||_.call(f))}),onKeyDown:Te(c.onKeyDown,T=>{var D;((D=f.searchRef)==null?void 0:D.current)!==""&&T.key===" "||(jQ.includes(T.key)&&R(),T.key===" "&&T.preventDefault())})})})})});iD.displayName=kp;var qd="SelectItemText",lD=p.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...l}=e,c=Zi(qd,n),d=Ki(qd,n),f=oD(qd,n),h=DQ(qd,n),[g,y]=p.useState(null),v=ut(t,R=>y(R),f.onItemTextChange,R=>{var T;return(T=d.itemTextRefCallback)==null?void 0:T.call(d,R,f.value,f.disabled)}),b=g==null?void 0:g.textContent,w=p.useMemo(()=>o.jsx("option",{value:f.value,disabled:f.disabled,children:b},f.value),[f.disabled,f.value,b]),{onNativeOptionAdd:E,onNativeOptionRemove:S}=h;return Cr(()=>(E(w),()=>S(w)),[E,S,w]),o.jsxs(o.Fragment,{children:[o.jsx(Je.span,{id:f.textId,...l,ref:v}),f.isSelected&&c.valueNode&&!c.valueNodeHasChildren?ds.createPortal(l.children,c.valueNode):null]})});lD.displayName=qd;var cD="SelectItemIndicator",uD=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return oD(cD,n).isSelected?o.jsx(Je.span,{"aria-hidden":!0,...r,ref:t}):null});uD.displayName=cD;var W0="SelectScrollUpButton",dD=p.forwardRef((e,t)=>{const n=Ki(W0,e.__scopeSelect),r=eS(W0,e.__scopeSelect),[s,l]=p.useState(!1),c=ut(t,r.onScrollButtonChange);return Cr(()=>{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]),s?o.jsx(hD,{...e,ref:c,onAutoScroll:()=>{const{viewport:d,selectedItem:f}=n;d&&f&&(d.scrollTop=d.scrollTop-f.offsetHeight)}}):null});dD.displayName=W0;var Q0="SelectScrollDownButton",fD=p.forwardRef((e,t)=>{const n=Ki(Q0,e.__scopeSelect),r=eS(Q0,e.__scopeSelect),[s,l]=p.useState(!1),c=ut(t,r.onScrollButtonChange);return Cr(()=>{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]),s?o.jsx(hD,{...e,ref:c,onAutoScroll:()=>{const{viewport:d,selectedItem:f}=n;d&&f&&(d.scrollTop=d.scrollTop+f.offsetHeight)}}):null});fD.displayName=Q0;var hD=p.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,l=Ki("SelectScrollButton",n),c=p.useRef(null),d=Mg(n),f=p.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return p.useEffect(()=>()=>f(),[f]),Cr(()=>{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]),o.jsx(Je.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Te(s.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(r,50))}),onPointerMove:Te(s.onPointerMove,()=>{var h;(h=l.onItemLeave)==null||h.call(l),c.current===null&&(c.current=window.setInterval(r,50))}),onPointerLeave:Te(s.onPointerLeave,()=>{f()})})}),HQ="SelectSeparator",mD=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return o.jsx(Je.div,{"aria-hidden":!0,...r,ref:t})});mD.displayName=HQ;var X0="SelectArrow",BQ=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Ig(n),l=Zi(X0,n),c=Ki(X0,n);return l.open&&c.position==="popper"?o.jsx(Df,{...s,...r,ref:t}):null});BQ.displayName=X0;var GQ="SelectBubbleInput",pD=p.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=p.useRef(null),l=ut(r,s),c=J1(t);return p.useEffect(()=>{const d=s.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]),o.jsx(Je.select,{...n,style:{...RN,...n.style},ref:l,defaultValue:t})});pD.displayName=GQ;function gD(e){return e===""||e===void 0}function yD(e){const t=ms(e),n=p.useRef(""),r=p.useRef(0),s=p.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=p.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,l]}function vD(e,t,n){const s=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let c=qQ(e,Math.max(l,0));s.length===1&&(c=c.filter(h=>h!==n));const f=c.find(h=>h.textValue.toLowerCase().startsWith(s.toLowerCase()));return f!==n?f:void 0}function qQ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ZQ=G3,KQ=Z3,YQ=Y3,WQ=W3,QQ=Q3,XQ=X3,JQ=nD,eX=aD,tX=iD,nX=lD,rX=uD,aX=dD,sX=fD,oX=mD;function Ea({...e}){return o.jsx(ZQ,{"data-slot":"select",...e})}function kg({...e}){return o.jsx(eX,{"data-slot":"select-group",...e})}function wa({...e}){return o.jsx(YQ,{"data-slot":"select-value",...e})}function Ra({className:e,size:t="default",children:n,...r}){return o.jsxs(KQ,{"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,o.jsx(WQ,{asChild:!0,children:o.jsx(Qa,{className:"size-4 opacity-50"})})]})}function Ta({className:e,children:t,position:n="popper",...r}){return o.jsx(QQ,{children:o.jsxs(XQ,{"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:[o.jsx(lX,{}),o.jsx(JQ,{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}),o.jsx(cX,{})]})})}function Yn({className:e,children:t,...n}){return o.jsxs(tX,{"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:[o.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:o.jsx(rX,{children:o.jsx(fr,{className:"size-4"})})}),o.jsx(nX,{children:t})]})}function iX({className:e,...t}){return o.jsx(oX,{"data-slot":"select-separator",className:ne("bg-border pointer-events-none -mx-1 my-1 h-px",e),...t})}function lX({className:e,...t}){return o.jsx(aX,{"data-slot":"select-scroll-up-button",className:ne("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(zs,{className:"size-4"})})}function cX({className:e,...t}){return o.jsx(sX,{"data-slot":"select-scroll-down-button",className:ne("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(Qa,{className:"size-4"})})}const uX=an({title:sn().min(1,"Title is required").max(100,"Title must be less than 100 characters"),storageId:sn().min(1,"Storage is required")});function dX(){const{createDataMart:e,isLoading:t,error:n}=Fo();return{handleCreate:p.useCallback(async s=>{try{return await e(s)}catch(l){return console.error(l),null}},[e]),isSubmitting:t,serverError:n}}function fX(e){const{getDataMart:t,deleteDataMart:n,updateDataMartTitle:r,updateDataMartDescription:s,updateDataMartDefinition:l,updateDataMartSchema:c,actualizeDataMartSchema:d,publishDataMart:f,runDataMart:h,cancelDataMartRun:g,getDataMartRuns:y,loadMoreDataMartRuns:v,reset:b,dataMart:w,isLoading:E,error:S,getErrorMessage:R,runs:T}=Fo();return p.useEffect(()=>(e?t(e):b(),()=>{b()}),[e,t,b]),{dataMart:w,isLoading:E,error:S,getErrorMessage:R,deleteDataMart:n,updateDataMartTitle:r,updateDataMartDescription:s,updateDataMartDefinition:l,updateDataMartSchema:c,actualizeDataMartSchema:d,publishDataMart:f,runDataMart:h,cancelDataMartRun:g,getDataMartRuns:y,loadMoreDataMartRuns:v,runs:T,getDataMart:t}}const $T=(e,t,n)=>{if(e&&"reportValidity"in e){const r=Ae(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},J0=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?$T(r.ref,n,e):r&&r.refs&&r.refs.forEach(s=>$T(s,n,e))}},HT=(e,t)=>{t.shouldUseNativeValidation&&J0(e,t);const n={};for(const r in e){const s=Ae(t.fields,r),l=Object.assign(e[r]||{},{ref:s&&s.ref});if(hX(t.names||Object.keys(e),r)){const c=Object.assign({},Ae(n,r));Yt(c,"root",l),Yt(n,r,c)}else Yt(n,r,l)}return n},hX=(e,t)=>{const n=BT(t);return e.some(r=>BT(r).match(`^${n}\\.\\d+`))};function BT(e){return e.replace(/\]|\[/g,"")}function xD(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 s=(n==null?void 0:n.Parent)??Object;class l extends s{}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 mX extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const pX={};function bD(e){return pX}function gX(e,t){return typeof t=="bigint"?t.toString():t}const SD=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function Mm(e){return typeof e=="string"?e:e==null?void 0:e.message}function CD(e,t,n){var s,l,c,d,f,h;const r={...e,path:e.path??[]};if(!e.message){const g=Mm((c=(l=(s=e.inst)==null?void 0:s._zod.def)==null?void 0:l.error)==null?void 0:c.call(l,e))??Mm((d=t==null?void 0:t.error)==null?void 0:d.call(t,e))??Mm((f=n.customError)==null?void 0:f.call(n,e))??Mm((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 ED=(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,gX,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},yX=xD("$ZodError",ED),wD=xD("$ZodError",ED,{Parent:Error}),vX=e=>(t,n,r,s)=>{const l=r?Object.assign(r,{async:!1}):{async:!1},c=t._zod.run({value:n,issues:[]},l);if(c instanceof Promise)throw new mX;if(c.issues.length){const d=new((s==null?void 0:s.Err)??e)(c.issues.map(f=>CD(f,l,bD())));throw SD(d,s==null?void 0:s.callee),d}return c.value},xX=vX(wD),bX=e=>async(t,n,r,s)=>{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((s==null?void 0:s.Err)??e)(c.issues.map(f=>CD(f,l,bD())));throw SD(d,s==null?void 0:s.callee),d}return c.value},SX=bX(wD);function GT(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function CX(e,t){for(var n={};e.length;){var r=e[0],s=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:s};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]=W1(c,t,n,s,h?[].concat(h,r.message):r.message)}e.shift()}return n}function EX(e,t){for(var n={};e.length;){var r=e[0],s=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:s};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]=W1(c,t,n,s,h?[].concat(h,r.message):r.message)}e.shift()}return n}function Jl(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,s,l){try{return Promise.resolve(GT(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(c){return l.shouldUseNativeValidation&&J0({},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:HT(CX(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,s,l){try{return Promise.resolve(GT(function(){return Promise.resolve((n.mode==="sync"?xX:SX)(e,r,t)).then(function(c){return l.shouldUseNativeValidation&&J0({},l),{errors:{},values:n.raw?Object.assign({},r):c}})},function(c){if((function(d){return d instanceof yX})(c))return{values:{},errors:HT(EX(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 RD=p.createContext(void 0);function wX(){const e=p.useContext(RD);if(e===void 0)throw new Error("useDataStorageContext must be used within a DataStorageProvider");return e}var Mt=(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))(Mt||{});const RX={dataStorages:[],currentDataStorage:null,loading:!1,error:null};function TX(e,t){switch(t.type){case Mt.FETCH_STORAGES_START:case Mt.FETCH_STORAGE_START:case Mt.CREATE_STORAGE_START:case Mt.UPDATE_STORAGE_START:return{...e,error:null};case Mt.DELETE_STORAGE_START:return{...e,loading:!0,error:null};case Mt.FETCH_STORAGES_SUCCESS:return{...e,dataStorages:t.payload,loading:!1,error:null};case Mt.FETCH_STORAGE_SUCCESS:return{...e,currentDataStorage:t.payload,loading:!1,error:null};case Mt.CREATE_STORAGE_SUCCESS:return{...e,dataStorages:[...e.dataStorages,t.payload],loading:!1,error:null};case Mt.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 Mt.DELETE_STORAGE_SUCCESS:return{...e,dataStorages:e.dataStorages.filter(n=>n.id!==t.payload),loading:!1,error:null};case Mt.FETCH_STORAGES_ERROR:case Mt.FETCH_STORAGE_ERROR:case Mt.CREATE_STORAGE_ERROR:case Mt.UPDATE_STORAGE_ERROR:case Mt.DELETE_STORAGE_ERROR:return{...e,loading:!1,error:t.payload};case Mt.CLEAR_CURRENT_STORAGE:return{...e,currentDataStorage:null};case Mt.CLEAR_ERROR:return{...e,error:null};default:return e}}function tS({children:e}){const[t,n]=p.useReducer(TX,RX);return o.jsx(RD.Provider,{value:{state:t,dispatch:n},children:e})}class jX extends Zl{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 Ud=new jX;function Lg(){const{state:e,dispatch:t}=wX(),n=p.useCallback(async()=>{t({type:Mt.FETCH_STORAGES_START});try{const f=await Ud.getDataStorages();t({type:Mt.FETCH_STORAGES_SUCCESS,payload:f.map(AW)})}catch(f){throw t({type:Mt.FETCH_STORAGES_ERROR,payload:yn(f)}),f}},[t]),r=p.useCallback(async f=>{try{const h=await Ud.getDataStorageById(f),g=Xm(h);t({type:Mt.FETCH_STORAGE_SUCCESS,payload:g})}catch(h){throw t({type:Mt.FETCH_STORAGE_ERROR,payload:yn(h)}),h}},[t]),s=p.useCallback(async f=>{t({type:Mt.CREATE_STORAGE_START});try{const h=DW(f),g=await Ud.createDataStorage(h),y=Xm(g);return t({type:Mt.CREATE_STORAGE_SUCCESS,payload:y}),Pe({event:"data_storage_created",category:"DataStorage",action:"Create",label:y.type}),At.success("Storage created"),y}catch(h){return t({type:Mt.CREATE_STORAGE_ERROR,payload:yn(h)}),null}},[t]),l=p.useCallback(async(f,h)=>{t({type:Mt.UPDATE_STORAGE_START});try{const g=NW(h),y=await Ud.updateDataStorage(f,g),v=Xm(y);return t({type:Mt.UPDATE_STORAGE_SUCCESS,payload:v}),Pe({event:"data_storage_updated",category:"DataStorage",action:"Update",label:v.type}),At.success("Storage updated"),v}catch(g){return t({type:Mt.UPDATE_STORAGE_ERROR,payload:yn(g)}),null}},[t]),c=p.useCallback(async f=>{t({type:Mt.DELETE_STORAGE_START});try{await Ud.deleteDataStorage(f),t({type:Mt.DELETE_STORAGE_SUCCESS,payload:f}),Pe({event:"data_storage_deleted",category:"DataStorage",action:"Delete",label:f}),At.success("Storage deleted")}catch(h){throw t({type:Mt.DELETE_STORAGE_ERROR,payload:yn(h)}),h}},[t]),d=p.useCallback(()=>{t({type:Mt.CLEAR_CURRENT_STORAGE})},[t]);return{dataStorages:e.dataStorages,currentDataStorage:e.currentDataStorage,loading:e.loading,error:e.error,fetchDataStorages:n,getDataStorageById:r,createDataStorage:s,updateDataStorage:l,deleteDataStorage:c,clearCurrentDataStorage:d}}const TD=({isOpen:e,onClose:t,onSelect:n})=>o.jsx(F1,{open:e,onOpenChange:t,children:o.jsxs(z1,{className:"sm:max-w-sm",children:[o.jsxs(V1,{children:[o.jsx($1,{children:"New Storage"}),o.jsx(H1,{children:"Choose the type of storage you want to create"})]}),o.jsx("div",{className:"flex flex-col gap-4 py-4",children:Bi.getAllTypes().map(r=>{const s=r.icon,l=r.status===wo.ACTIVE;return o.jsxs(Se,{variant:"outline",className:"flex px-4 py-6",onClick:()=>void n(r.type),disabled:!l,children:[o.jsxs("span",{className:"flex flex-grow items-center gap-2",children:[o.jsx(s,{size:24}),o.jsx("span",{className:"font-medium",children:r.displayName})]}),!l&&o.jsx(br,{variant:"secondary",children:"Coming soon"})]},r.type)})})]})});function _X({initialData:e,onSuccess:t}){const{handleCreate:n,isSubmitting:r,serverError:s}=dX(),{dataStorages:l,loading:c,fetchDataStorages:d,createDataStorage:f,getDataStorageById:h}=Lg(),[g,y]=p.useState(!1);p.useEffect(()=>{d()},[d]);const v=Gi({resolver:Jl(uX),defaultValues:{title:(e==null?void 0:e.title)??"",storageId:""},mode:"onTouched"}),b=async S=>{const R=await n(S);R&&t&&t(R)},w=()=>{y(!0)},E=async S=>{try{const R=await f(S);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 o.jsxs(o.Fragment,{children:[o.jsx(Wl,{...v,children:o.jsxs(qi,{onSubmit:S=>{v.handleSubmit(b)(S)},children:[o.jsxs(Ql,{variant:"light",children:[s&&o.jsx("div",{className:"rounded bg-red-100 p-3 text-red-700",children:s.message}),o.jsx(en,{control:v.control,name:"title",render:({field:S})=>o.jsxs(Vt,{children:[o.jsx($t,{children:"Title"}),o.jsx(Ht,{children:o.jsx(zt,{id:"title",placeholder:"Enter title",...S,disabled:r})}),o.jsx(on,{})]})}),o.jsx(en,{control:v.control,name:"storageId",render:({field:S})=>o.jsxs(Vt,{children:[o.jsx($t,{children:"Storage"}),o.jsx(Ht,{children:o.jsxs(Ea,{onValueChange:R=>{R==="create_new"?w():S.onChange(R)},value:S.value,disabled:r||c,children:[o.jsx(Ra,{className:"w-full",children:o.jsx(wa,{placeholder:"Select a storage"})}),o.jsx(Ta,{children:o.jsxs(kg,{children:[c&&o.jsx(Yn,{value:"loading",disabled:!0,children:"Loading..."}),!c&&l.map(R=>{const T=Bi.getInfo(R.type).icon;return o.jsx(Yn,{value:R.id,children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(T,{size:20}),o.jsx("span",{children:R.title})]})},R.id)}),!c&&l.length>0&&o.jsx(iX,{}),o.jsx(Yn,{value:"create_new",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"flex h-5 w-5 items-center justify-center",children:o.jsx(_a,{size:20})}),o.jsx("span",{children:"Create new storage"})]})})]})})]})}),o.jsx(on,{})]})})]}),o.jsxs(Xl,{variant:"light",children:[o.jsx(Se,{type:"submit",children:"Create Data Mart"}),o.jsx(Se,{variant:"outline",type:"button",onClick:()=>{window.history.back()},children:"Go back"})]})]})}),o.jsx(TD,{isOpen:g,onClose:()=>{y(!1)},onSelect:S=>E(S)})]})}function NX({title:e,onUpdate:t,className:n,errorMessage:r="Title cannot be empty",minWidth:s="200px"}){const[l,c]=p.useState(e),[d,f]=p.useState(!1),h=p.useRef(null);p.useEffect(()=>{c(e)},[e]),p.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()===""){At.error(r),c(e);return}g()}else v.key==="Escape"&&c(e)};return o.jsx("h2",{className:ne("m-0 cursor-pointer p-0 hover:opacity-80",n),children:o.jsx($i,{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:s},disabled:d})})}var yl=(e=>(e.MANUAL_BACKFILL="MANUAL_BACKFILL",e.INCREMENTAL="INCREMENTAL",e))(yl||{}),jD=(e=>(e.MANUAL_BACKFILL="MANUAL_BACKFILL",e.HIDE_IN_CONFIG_FORM="HIDE_IN_CONFIG_FORM",e))(jD||{}),Pg="Tabs",[AX]=ir(Pg,[hg]),_D=hg(),[DX,nS]=AX(Pg),ND=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:l,orientation:c="horizontal",dir:d,activationMode:f="automatic",...h}=e,g=If(d),[y,v]=Vr({prop:r,onChange:s,defaultProp:l??"",caller:Pg});return o.jsx(DX,{scope:n,baseId:Nn(),value:y,onValueChange:v,orientation:c,dir:g,activationMode:f,children:o.jsx(Je.div,{dir:g,"data-orientation":c,...h,ref:t})})});ND.displayName=Pg;var AD="TabsList",DD=p.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,l=nS(AD,n),c=_D(n);return o.jsx($N,{asChild:!0,...c,orientation:l.orientation,dir:l.dir,loop:r,children:o.jsx(Je.div,{role:"tablist","aria-orientation":l.orientation,...s,ref:t})})});DD.displayName=AD;var OD="TabsTrigger",MD=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...l}=e,c=nS(OD,n),d=_D(n),f=LD(c.baseId,r),h=PD(c.baseId,r),g=r===c.value;return o.jsx(HN,{asChild:!0,...d,focusable:!s,active:g,children:o.jsx(Je.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":h,"data-state":g?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:f,...l,ref:t,onMouseDown:Te(e.onMouseDown,y=>{!s&&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&&!s&&y&&c.onValueChange(r)})})})});MD.displayName=OD;var ID="TabsContent",kD=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:l,...c}=e,d=nS(ID,n),f=LD(d.baseId,r),h=PD(d.baseId,r),g=r===d.value,y=p.useRef(g);return p.useEffect(()=>{const v=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(v)},[]),o.jsx(Er,{present:s||g,children:({present:v})=>o.jsx(Je.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=ID;function LD(e,t){return`${e}-trigger-${t}`}function PD(e,t){return`${e}-content-${t}`}var OX=ND,MX=DD,IX=MD,kX=kD;function LX({className:e,...t}){return o.jsx(OX,{"data-slot":"tabs",className:ne("flex flex-col gap-2",e),...t})}function PX({className:e,...t}){return o.jsx(MX,{"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 UX({className:e,...t}){return o.jsx(IX,{"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 FX({className:e,...t}){return o.jsx(kX,{"data-slot":"tabs-content",className:ne("flex-1 outline-none",e),...t})}var Ug="Collapsible",[zX,UD]=ir(Ug),[VX,rS]=zX(Ug),FD=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:l,onOpenChange:c,...d}=e,[f,h]=Vr({prop:r,defaultProp:s??!1,onChange:c,caller:Ug});return o.jsx(VX,{scope:n,disabled:l,contentId:Nn(),open:f,onOpenToggle:p.useCallback(()=>h(g=>!g),[h]),children:o.jsx(Je.div,{"data-state":iS(f),"data-disabled":l?"":void 0,...d,ref:t})})});FD.displayName=Ug;var zD="CollapsibleTrigger",aS=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=rS(zD,n);return o.jsx(Je.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":iS(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:Te(e.onClick,s.onOpenToggle)})});aS.displayName=zD;var sS="CollapsibleContent",oS=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=rS(sS,e.__scopeCollapsible);return o.jsx(Er,{present:n||s.open,children:({present:l})=>o.jsx($X,{...r,ref:t,present:l})})});oS.displayName=sS;var $X=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...l}=e,c=rS(sS,n),[d,f]=p.useState(r),h=p.useRef(null),g=ut(t,h),y=p.useRef(0),v=y.current,b=p.useRef(0),w=b.current,E=c.open||d,S=p.useRef(E),R=p.useRef(void 0);return p.useEffect(()=>{const T=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(T)},[]),Cr(()=>{const T=h.current;if(T){R.current=R.current||{transitionDuration:T.style.transitionDuration,animationName:T.style.animationName},T.style.transitionDuration="0s",T.style.animationName="none";const _=T.getBoundingClientRect();y.current=_.height,b.current=_.width,S.current||(T.style.transitionDuration=R.current.transitionDuration,T.style.animationName=R.current.animationName),f(r)}},[c.open,r]),o.jsx(Je.div,{"data-state":iS(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!E,...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:E&&s})});function iS(e){return e?"open":"closed"}var VD=FD,HX=aS,BX=oS;const GX=VD,qX=aS,ZX=oS;function KX({children:e,className:t="",...n}){return o.jsx("div",{className:ne("flex flex-1 flex-col overflow-hidden",t),...n,children:e})}function YX({children:e,className:t="",...n}){return o.jsx("div",{className:ne("bg-muted dark:bg-sidebar flex-1 overflow-y-auto p-4",t),...n,children:o.jsx("div",{className:"flex min-h-full flex-col gap-4",children:e})})}function WX({children:e,className:t="",variant:n="horizontal",...r}){const s=n==="vertical"?"flex flex-col gap-1.5 pt-4":"flex items-center justify-between border-t px-4 py-3";return o.jsx("div",{className:ne(s,t),...r,children:e})}function Zd({children:e,className:t="",...n}){return o.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 QX({label:e,children:t,className:n="",options:r,value:s,onValueChange:l,required:c=!1,tooltip:d,...f}){return o.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:o.jsxs(LX,{value:s,onValueChange:l,children:[o.jsxs("div",{className:"flex items-center",children:[o.jsx(To,{required:c,tooltip:d,className:"w-full",children:e}),o.jsx(PX,{children:r.map(h=>o.jsx(UX,{value:h.value,children:h.label},h.value))})]}),t]})})}function $D({title:e,children:t,defaultOpen:n=!1,className:r=""}){const[s,l]=p.useState(n);return o.jsxs(GX,{open:s,onOpenChange:l,"data-slot":"wizard-collapsible",className:ne("group/collapsible flex flex-col gap-2 py-3",r),children:[o.jsx(qX,{asChild:!0,children:o.jsxs("button",{type:"button",className:ne("flex cursor-pointer items-center gap-1"),children:[o.jsx("span",{className:"text-muted-foreground/75 text-xs font-semibold tracking-wide uppercase",children:e}),o.jsx(ja,{className:ne("text-foreground/75 h-3.5 w-3.5 transition-transform duration-200",s&&"rotate-90")})]})}),o.jsx(ZX,{className:"data-[state=open]:animate-collapsible-down data-[state=closed]:animate-collapsible-up overflow-hidden",children:o.jsx("div",{className:"flex flex-col gap-2 pt-2",children:t})})]})}function To({children:e,required:t=!1,tooltip:n,tooltipProps:r,className:s="",...l}){return o.jsxs(Ca,{"data-slot":"wizard-step-label",className:ne("text-foreground flex items-center justify-between gap-2 text-sm font-medium",s),...l,children:[t?o.jsxs(St,{...r,children:[o.jsx(Ct,{asChild:!0,children:o.jsxs("span",{className:"flex items-center gap-1",children:[e,o.jsx("span",{className:"ml-1 text-red-500",children:"*"})]})}),o.jsx(Et,{side:"top",align:"center",role:"tooltip",children:"Required"})]}):o.jsx("span",{children:e}),n&&o.jsxs(St,{...r,children:[o.jsx(Ct,{asChild:!0,children:o.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:o.jsx(zr,{className:"text-muted-foreground/50 hover:text-muted-foreground size-4 shrink-0 transition-colors","aria-hidden":"true"})})}),o.jsx(Et,{side:"top",align:"center",role:"tooltip",children:n})]})]})}function wl({title:e,children:t,className:n="",...r}){return o.jsxs("section",{"data-slot":"wizard-step-section",className:ne("mb-8",n),...r,children:[e&&o.jsx("h3",{className:"text-muted-foreground/75 mb-2 text-xs font-semibold tracking-wide uppercase",children:e}),o.jsx("div",{className:"flex flex-col gap-2",children:t})]})}function Mi({icon:e,title:t,subtitle:n,docUrl:r,variant:s="default",className:l,...c}){return s==="compact"?o.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:[o.jsxs("div",{className:"flex items-center gap-2",children:[e&&o.jsx("div",{children:e}),o.jsx("h2",{className:"text-md font-medium",children:t})]}),r!=null&&o.jsx(Se,{variant:"outline",asChild:!0,children:o.jsxs(Za,{to:r,target:"_blank",rel:"noopener noreferrer",children:["Documentation",o.jsx(_l,{className:"h-4 w-4"})]})})]}):o.jsxs("div",{"data-slot":"wizard-step-hero",className:ne("mb-6 flex flex-col items-center justify-center text-center",l),...c,children:[e&&o.jsx("div",{className:"mt-6 mb-3",children:e}),o.jsx("h2",{className:"text-xl font-medium",children:t}),n&&o.jsx("p",{className:"text-muted-foreground mt-2 text-sm",children:n}),r!=null&&o.jsx(Se,{variant:"outline",className:"mt-3 mb-6",asChild:!0,children:o.jsxs(Za,{to:r,target:"_blank",rel:"noopener noreferrer",children:["Documentation",o.jsx(_l,{className:"h-4 w-4"})]})})]})}function _o({children:e,className:t="",...n}){return o.jsx("div",{"data-slot":"wizard-step",className:ne("space-y-4",t),...n,children:e})}function XX({children:e,className:t="",...n}){return o.jsx("div",{className:ne("grid grid-cols-1 gap-4 md:grid-cols-2",t),...n,children:e})}function JX({icon:e,title:t,selected:n=!1,disabled:r=!1,onClick:s,onDoubleClick:l,className:c="",...d}){return o.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:s,onDoubleClick:l,...d,children:[e&&o.jsx("span",{className:"shrink-0",children:e}),r?o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx("span",{className:"cursor-not-allowed text-sm font-medium opacity-70",children:t})}),o.jsx(Et,{side:"top",align:"center",children:"Coming soon"})]}):o.jsx("span",{className:"text-sm font-medium",children:t})]})}function HD({type:e,id:t,name:n,value:r,label:s,checked:l,selected:c=!1,disabled:d=!1,tooltip:f,rightIcon:h,onChange:g,className:y="",...v}){const b=E=>{g&&g(e==="checkbox"?E.target.checked:E.target.value)},w=p.useRef(null);return o.jsxs("div",{"data-slot":"wizard-step-card-item",onClick:E=>{if(d)return;const S=E.target;S.tagName==="INPUT"||S.tagName==="LABEL"||S.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:[o.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}),s&&o.jsx(To,{htmlFor:t,className:ne("cursor-pointer",d&&"cursor-not-allowed"),children:s}),(f||h)&&o.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[f&&o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx(zr,{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})}),o.jsx(Et,{side:"top",align:"center",children:f})]}),h&&o.jsx("div",{className:"flex items-center",children:h})]})]})}function lS({variant:e="grid",items:t,className:n=""}){const r=t??(e==="grid"?12:6),s=e==="grid"?"grid grid-cols-1 gap-4 md:grid-cols-2":"flex flex-col gap-4";return o.jsx("div",{"data-slot":"wizard-step-loading",className:ne(s,n),children:Array.from({length:r}).map((l,c)=>o.jsx(is,{className:"border-border h-12 rounded-md border-b bg-white dark:bg-white/4"},c))})}function qT(e){const t=eJ(e),n=p.forwardRef((r,s)=>{const{children:l,...c}=r,d=p.Children.toArray(l),f=d.find(nJ);if(f){const h=f.props.children,g=d.map(y=>y===f?p.Children.count(h)>1?p.Children.only(null):p.isValidElement(h)?h.props.children:null:y);return o.jsx(t,{...c,ref:s,children:p.isValidElement(h)?p.cloneElement(h,void 0,g):null})}return o.jsx(t,{...c,ref:s,children:l})});return n.displayName=`${e}.Slot`,n}function eJ(e){const t=p.forwardRef((n,r)=>{const{children:s,...l}=n;if(p.isValidElement(s)){const c=aJ(s),d=rJ(l,s.props);return s.type!==p.Fragment&&(d.ref=r?Ir(r,c):c),p.cloneElement(s,d)}return p.Children.count(s)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var tJ=Symbol("radix.slottable");function nJ(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===tJ}function rJ(e,t){const n={...t};for(const r in t){const s=e[r],l=t[r];/^on[A-Z]/.test(r)?s&&l?n[r]=(...d)=>{const f=l(...d);return s(...d),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...l}:r==="className"&&(n[r]=[s,l].filter(Boolean).join(" "))}return{...e,...n}}function aJ(e){var r,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function sJ(e){const t=e+"CollectionProvider",[n,r]=ir(t),[s,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=E=>{const{scope:S,children:R}=E,T=ye.useRef(null),_=ye.useRef(new Map).current;return o.jsx(s,{scope:S,itemMap:_,collectionRef:T,children:R})};c.displayName=t;const d=e+"CollectionSlot",f=qT(d),h=ye.forwardRef((E,S)=>{const{scope:R,children:T}=E,_=l(d,R),D=ut(S,_.collectionRef);return o.jsx(f,{ref:D,children:T})});h.displayName=d;const g=e+"CollectionItemSlot",y="data-radix-collection-item",v=qT(g),b=ye.forwardRef((E,S)=>{const{scope:R,children:T,..._}=E,D=ye.useRef(null),A=ut(S,D),O=l(g,R);return ye.useEffect(()=>(O.itemMap.set(D,{ref:D,..._}),()=>void O.itemMap.delete(D))),o.jsx(v,{[y]:"",ref:A,children:T})});b.displayName=g;function w(E){const S=l(e+"CollectionConsumer",E);return ye.useCallback(()=>{const T=S.collectionRef.current;if(!T)return[];const _=Array.from(T.querySelectorAll(`[${y}]`));return Array.from(S.itemMap.values()).sort((O,j)=>_.indexOf(O.ref.current)-_.indexOf(j.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:c,Slot:h,ItemSlot:b},w,r]}var Ss="Accordion",oJ=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[cS,iJ,lJ]=sJ(Ss),[Fg]=ir(Ss,[lJ,UD]),uS=UD(),BD=ye.forwardRef((e,t)=>{const{type:n,...r}=e,s=r,l=r;return o.jsx(cS.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?o.jsx(fJ,{...l,ref:t}):o.jsx(dJ,{...s,ref:t})})});BD.displayName=Ss;var[GD,cJ]=Fg(Ss),[qD,uJ]=Fg(Ss,{collapsible:!1}),dJ=ye.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},collapsible:l=!1,...c}=e,[d,f]=Vr({prop:n,defaultProp:r??"",onChange:s,caller:Ss});return o.jsx(GD,{scope:e.__scopeAccordion,value:ye.useMemo(()=>d?[d]:[],[d]),onItemOpen:f,onItemClose:ye.useCallback(()=>l&&f(""),[l,f]),children:o.jsx(qD,{scope:e.__scopeAccordion,collapsible:l,children:o.jsx(ZD,{...c,ref:t})})})}),fJ=ye.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...l}=e,[c,d]=Vr({prop:n,defaultProp:r??[],onChange:s,caller:Ss}),f=ye.useCallback(g=>d((y=[])=>[...y,g]),[d]),h=ye.useCallback(g=>d((y=[])=>y.filter(v=>v!==g)),[d]);return o.jsx(GD,{scope:e.__scopeAccordion,value:c,onItemOpen:f,onItemClose:h,children:o.jsx(qD,{scope:e.__scopeAccordion,collapsible:!0,children:o.jsx(ZD,{...l,ref:t})})})}),[hJ,zg]=Fg(Ss),ZD=ye.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:s,orientation:l="vertical",...c}=e,d=ye.useRef(null),f=ut(d,t),h=iJ(n),y=If(s)==="ltr",v=Te(e.onKeyDown,b=>{var M;if(!oJ.includes(b.key))return;const w=b.target,E=h().filter(F=>{var G;return!((G=F.ref.current)!=null&&G.disabled)}),S=E.findIndex(F=>F.ref.current===w),R=E.length;if(S===-1)return;b.preventDefault();let T=S;const _=0,D=R-1,A=()=>{T=S+1,T>D&&(T=_)},O=()=>{T=S-1,T<_&&(T=D)};switch(b.key){case"Home":T=_;break;case"End":T=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 j=T%R;(M=E[j].ref.current)==null||M.focus()});return o.jsx(hJ,{scope:n,disabled:r,direction:s,orientation:l,children:o.jsx(cS.Slot,{scope:n,children:o.jsx(Je.div,{...c,"data-orientation":l,ref:f,onKeyDown:r?void 0:v})})})}),Lp="AccordionItem",[mJ,dS]=Fg(Lp),KD=ye.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...s}=e,l=zg(Lp,n),c=cJ(Lp,n),d=uS(n),f=Nn(),h=r&&c.value.includes(r)||!1,g=l.disabled||e.disabled;return o.jsx(mJ,{scope:n,open:h,disabled:g,triggerId:f,children:o.jsx(VD,{"data-orientation":l.orientation,"data-state":eO(h),...d,...s,ref:t,disabled:g,open:h,onOpenChange:y=>{y?c.onItemOpen(r):c.onItemClose(r)}})})});KD.displayName=Lp;var YD="AccordionHeader",WD=ye.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=zg(Ss,n),l=dS(YD,n);return o.jsx(Je.h3,{"data-orientation":s.orientation,"data-state":eO(l.open),"data-disabled":l.disabled?"":void 0,...r,ref:t})});WD.displayName=YD;var eb="AccordionTrigger",QD=ye.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=zg(Ss,n),l=dS(eb,n),c=uJ(eb,n),d=uS(n);return o.jsx(cS.ItemSlot,{scope:n,children:o.jsx(HX,{"aria-disabled":l.open&&!c.collapsible||void 0,"data-orientation":s.orientation,id:l.triggerId,...d,...r,ref:t})})});QD.displayName=eb;var XD="AccordionContent",JD=ye.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=zg(Ss,n),l=dS(XD,n),c=uS(n);return o.jsx(BX,{role:"region","aria-labelledby":l.triggerId,"data-orientation":s.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}})});JD.displayName=XD;function eO(e){return e?"open":"closed"}var pJ=BD,gJ=KD,yJ=WD,vJ=QD,xJ=JD;const fS={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:o.jsx(EL,{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}},tO=p.createContext("default");function lr({variant:e="default",...t}){return o.jsx(tO.Provider,{value:e,children:o.jsx(pJ,{"data-slot":"accordion",...t})})}function hS(e){const t=p.useContext(tO);return e??t??"default"}function Un({className:e,variant:t,...n}){const r=hS(t),{itemClass:s}=fS[r];return o.jsx(gJ,{"data-slot":"accordion-item",className:ne(s,e),...n})}function Fn({className:e,children:t,variant:n,...r}){const s=hS(n),{triggerClass:l,icon:c,chevronClass:d,headerClass:f}=fS[s];return o.jsx(yJ,{className:f,children:o.jsxs(vJ,{"data-slot":"accordion-trigger",className:ne(l,e),...r,children:[c,t,o.jsx(Qa,{className:d,"aria-hidden":"true"})]})})}function zn({className:e,children:t,variant:n,...r}){const s=hS(n),{contentClass:l,contentInnerClass:c}=fS[s];return o.jsx(xJ,{"data-slot":"accordion-content",className:ne(l,e),...r,children:o.jsx("div",{className:c,children:t})})}function or({href:e,children:t,className:n,...r}){return o.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,o.jsx(_l,{className:"ml-1 inline h-3 w-3","aria-hidden":"true"})]})}function ZT(){return o.jsx(lr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Un,{value:"connector-state-details",children:[o.jsx(Fn,{children:"What’s connector state?"}),o.jsxs(zn,{children:[o.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."}),o.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."}),o.jsxs("p",{className:"mb-2",children:["For more details, see the"," ",o.jsx(or,{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 Vg=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),s=new Map(r.map(y=>[y.type,y.value])),l=s.get("year")??"",c=s.get("month")??"",d=s.get("day")??"",f=s.get("hour")??"",h=s.get("minute")??"",g=s.get("second")??"";return`${l}-${c}-${d} ${f}:${h}:${g}`},zc=e=>Vg(nO(e).toISOString()),nO=e=>{const t=e.trim();if(t.includes("T")||t.includes("Z")){const s=new Date(t);if(!isNaN(s.getTime()))return s}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},bJ=(e,t)=>{const n=t.getTime()-e.getTime(),r=Math.floor(n/1e3),s=Math.floor(r/60),l=Math.floor(s/60),c=s%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 SJ({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),s=(t==null?void 0:t.states)??[],l=new Map(s.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 o.jsx($D,{title:"State Info",children:c.length===0?o.jsxs(Vt,{children:[o.jsx($t,{children:"Connector state"}),o.jsx(Ht,{children:o.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"})}),o.jsx(Pn,{children:o.jsx(ZT,{})})]}):o.jsx(o.Fragment,{children:c.map(({state:d,index:f})=>{const h=d.at||"",g=h?Vg(nO(h).toISOString()):"—",y=d.state,v=(()=>{try{return JSON.stringify(y,null,2)}catch{return typeof y=="string"?y:'"—"'}})();return o.jsxs(Vt,{children:[o.jsx($t,{tooltip:`Created at ${g}`,children:`Connector state of configuration #${String(f+1)}`}),o.jsx(Ht,{children:o.jsx(l4,{value:v,displayOnly:!0,className:"bg-muted overflow-auto rounded-md text-sm",minHeightClass:"min-h-0",showCopyButton:!0})}),o.jsx(Pn,{children:o.jsx(ZT,{})})]},d._id)})})})}function CJ({configuration:e,onClose:t,onSubmit:n}){const[r,s]=p.useState(new Set),l=p.useId(),c=Gi({defaultValues:{runType:yl.INCREMENTAL}}),{loading:d,loadingSpecification:f,connectorSpecification:h,fetchConnectorSpecification:g}=Yl(),{dataMart:y}=Fo(),v=p.useCallback(async S=>{!r.has(S)&&!f&&(s(R=>new Set(R).add(S)),await g(S))},[r,f,g]);p.useEffect(()=>{e!=null&&e.connector.source.name&&v(e.connector.source.name)},[e,d,v]);const b=S=>{n&&n(S)},w=()=>{t&&t()},E=S=>{if(!S)return"text";switch(S){case os.DATE:return"date";case os.NUMBER:return"number";default:return"text"}};return f?o.jsx("div",{children:"Loading..."}):h?o.jsx(Wl,{...c,children:o.jsxs(qi,{id:l,noValidate:!0,onSubmit:S=>void c.handleSubmit(b)(S),children:[o.jsxs(Ql,{children:[o.jsxs(Hs,{title:"General",children:[o.jsx(en,{control:c.control,name:"runType",render:({field:S})=>o.jsxs(Vt,{children:[o.jsx($t,{tooltip:"Select how you want to load data: incremental updates or full backfill for a period",children:"Run type"}),o.jsx(Ht,{children:o.jsxs(o.Fragment,{children:[o.jsx(xQ,{options:[{value:yl.INCREMENTAL,label:"Incremental load"},{value:yl.MANUAL_BACKFILL,label:"Backfill (custom period)"}],value:S.value,onChange:S.onChange,orientation:"horizontal"}),o.jsx(Pn,{children:c.watch("runType")===yl.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")===yl.INCREMENTAL&&o.jsx(SJ,{configuration:e,connectorState:(y==null?void 0:y.connectorState)??null})]}),c.watch("runType")===yl.MANUAL_BACKFILL&&o.jsx(Hs,{title:"Run configuration",children:h.filter(S=>{var R;return(R=S.attributes)==null?void 0:R.includes(jD.MANUAL_BACKFILL)}).map(S=>o.jsx(en,{control:c.control,name:`data.${S.name}`,render:()=>o.jsxs(Vt,{children:[o.jsx($t,{tooltip:S.description,children:S.title??S.name}),o.jsx(Ht,{children:o.jsx(zt,{id:S.name,placeholder:S.description,type:E(S.requiredType),defaultValue:typeof S.default=="string"||typeof S.default=="number"?S.default.toString():void 0,...c.register(`data.${S.name}`,{required:!0})})}),o.jsx(on,{})]},S.name)}))})]}),o.jsxs(Xl,{children:[o.jsx(Se,{type:"submit",disabled:!c.formState.isValid||f,children:"Run"}),o.jsx(Se,{type:"button",variant:"outline",onClick:w,children:"Cancel"})]})]})}):o.jsx("div",{children:"No connector specification found"})}function EJ({isOpen:e,onClose:t,configuration:n,onSubmit:r}){return o.jsx(Li,{open:e,onOpenChange:t,children:o.jsxs(Pi,{children:[o.jsx(Ui,{children:o.jsx(Fi,{children:"Manual Run"})}),o.jsx(CJ,{configuration:n,onClose:t,onSubmit:r})]})})}function rO({children:e,configuration:t,onManualRun:n,open:r}){const[s,l]=p.useState(r??!1),c=()=>{l(!0)},d=h=>{n(h),l(!1)},f=()=>e?o.jsx("div",{onClick:c,style:{cursor:"pointer"},children:e}):null;return o.jsxs(o.Fragment,{children:[f(),s&&o.jsx(yu,{children:o.jsx(EJ,{isOpen:s,onClose:()=>{l(!1)},configuration:t,onSubmit:d})})]})}var Rl=(e=>(e.IDLE="IDLE",e.READY="READY",e.PROCESSING="PROCESSING",e.SUCCESS="SUCCESS",e.ERROR="ERROR",e.CANCELLING="CANCELLING",e.CANCELLED="CANCELLED",e))(Rl||{});const wJ=1e3;function RJ(e,t){const[n,r]=p.useState(!1),[s,l]=p.useState(null),c=p.useRef(null),d=p.useRef(null),f=p.useRef(!0),h=p.useRef(t);h.current=t;const g=p.useCallback(S=>{f.current&&r(S)},[]),y=p.useCallback(S=>{f.current&&l(S)},[]),v=p.useCallback((S,R)=>{const T=S instanceof Error?S.message:"Schema actualization failed";At.dismiss(R),y(T),g(!1),c.current=null,d.current=null,At.error(T,{duration:void 0,id:R})},[y,g]),b=p.useCallback(async()=>{var R;const S=c.current;if((R=d.current)==null||R.abort(),S){At.dismiss(S);try{await nn.abortSchemaActualizeTrigger(e,S)}catch{}}c.current=null,d.current=null,g(!1)},[e,g]),w=p.useCallback(async(S,R)=>{var _;const T=D=>D===Rl.SUCCESS||D===Rl.ERROR||D===Rl.CANCELLED;for(;!R.aborted&&c.current===S;)try{const D=await nn.getSchemaActualizeTriggerStatus(e,S);if(T(D)){try{const A=await nn.getSchemaActualizeTriggerResponse(e,S);if(At.dismiss(S),A.success)(_=h.current)==null||_.call(h),At.success("Output schema actualized",{duration:void 0,id:S});else{const O=A.error??"Schema actualization failed";y(O),At.error(O,{duration:void 0,id:S})}}catch(A){const O=A instanceof Error?A.message:"Schema actualization failed";At.dismiss(S),y(O),At.error(O,{duration:void 0,id:S})}g(!1),c.current=null,d.current=null;return}await new Promise(A=>setTimeout(A,wJ))}catch(D){v(D,S)}},[e,y,g,v]),E=p.useCallback(async()=>{c.current&&await b(),y(null),g(!0);try{const{triggerId:S}=await nn.createSchemaActualizeTrigger(e);At.loading("Synchronizing schema with the data storage state. This may take a while.",{duration:1/0,id:S}),c.current=S;const R=new AbortController;d.current=R;try{await w(S,R.signal)}catch(T){v(T,S)}}catch(S){g(!1),y(S instanceof Error?S.message:"Failed to start schema actualization")}},[e,b,w,y,g,v]);return p.useEffect(()=>(f.current=!0,()=>{var R;f.current=!1;const S=c.current;(R=d.current)==null||R.abort(),S&&(At.dismiss(S),nn.abortSchemaActualizeTrigger(e,S).catch(()=>{})),c.current=null,d.current=null}),[e]),{run:E,isLoading:n,cancel:b,error:s}}function TJ({id:e}){const{navigate:t}=Po(),{dataMart:n,deleteDataMart:r,updateDataMartTitle:s,updateDataMartDescription:l,updateDataMartDefinition:c,actualizeDataMartSchema:d,updateDataMartSchema:f,publishDataMart:h,runDataMart:g,cancelDataMartRun:y,getDataMartRuns:v,loadMoreDataMartRuns:b,isLoading:w,error:E,getErrorMessage:S,runs:R,getDataMart:T}=fX(e),[_,D]=p.useState(!1),[A,O]=p.useState(!1),{id:j="",canPublish:M=!1,canActualizeSchema:F=!1,status:G={code:null,displayName:"",description:""},title:Y="",definition:Z=null,definitionType:ee=null,validationErrors:$=[]}=n??{},W=p.useCallback(()=>{j&&T(j)},[j,T]),{run:k,isLoading:H}=RJ(j,W),B=p.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=p.useCallback(async q=>{j&&await s(j,q)},[j,s]),L=p.useCallback(async()=>{if(j){O(!0);try{await h(j),B()}catch(q){console.log(q instanceof Error?q.message:"Failed to publish Data Mart")}finally{O(!1)}}},[j,h,B]),P=p.useCallback(async q=>{if(j){if(G.code!==Sr.PUBLISHED){rn.error("Manual run is only available for published Data Marts");return}await g({id:j,payload:q})}},[j,G,g]);return n?o.jsxs("div",{className:"px-12 py-6",children:[o.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center space-x-1 md:-ml-10",children:[o.jsx(au,{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:o.jsx(u9,{className:"h-5 w-5"})}),o.jsx(NX,{title:Y,onUpdate:xe,className:"text-2xl font-medium"})]}),o.jsxs("div",{className:"flex items-center gap-2"+(A?" opacity-50":""),style:{minWidth:"120px"},children:[o.jsxs("div",{className:"ml-4 flex items-center gap-2",children:[o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx("div",{children:o.jsx(Bf,{type:G.code===Sr.PUBLISHED?jn.SUCCESS:jn.NEUTRAL,variant:"subtle",children:G.displayName})})}),o.jsx(Et,{children:G.code===Sr.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===Sr.DRAFT&&o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx("div",{children:o.jsxs(au,{variant:"default",onClick:()=>{L()},disabled:A||!M,className:"ml-2 flex items-center gap-1",children:[o.jsx(Wp,{className:"h-4 w-4"}),"Publish Data Mart"]})})}),!M&&o.jsxs(Et,{children:[o.jsx("div",{children:"Cannot publish Data Mart. Fix the issues below."}),$.length>0&&o.jsx("ul",{className:"mt-1 list-disc space-y-1 pl-4",children:MK($).map((q,te)=>o.jsx("li",{children:q},te))})]})]})]}),o.jsxs(wr,{children:[o.jsx(Rr,{asChild:!0,children:o.jsx(au,{variant:"ghost",children:o.jsx(K9,{className:"h-5 w-5"})})}),o.jsxs(Tr,{align:"end",children:[ee===Ue.CONNECTOR&&o.jsxs(o.Fragment,{children:[o.jsx(rO,{configuration:Z??null,onManualRun:q=>{P({runType:q.runType,data:q.data})},children:o.jsxs(vt,{onClick:q=>{q.preventDefault()},children:[o.jsx(Db,{className:"text-foreground h-4 w-4"}),o.jsx("span",{children:"Manual Run..."})]})}),o.jsx(Ka,{})]}),o.jsxs(vt,{onClick:()=>{D(!0)},children:[o.jsx(Lo,{className:"h-4 w-4 text-red-600"}),o.jsx("span",{className:"text-red-600",children:"Delete Data Mart"})]})]})]})]})]}),o.jsx("div",{children:o.jsx("nav",{className:"-mb-px flex space-x-4 border-b","aria-label":"Tabs",role:"tablist",children:ie.map(q=>o.jsx(Cf,{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))})}),o.jsx("div",{className:"pt-4",children:o.jsx(e_,{context:{dataMart:n,isLoading:w,error:E,getErrorMessage:S,updateDataMartDescription:l,updateDataMartDefinition:c,actualizeDataMartSchema:d,updateDataMartSchema:f,runDataMart:g,cancelDataMartRun:y,getDataMartRuns:v,loadMoreDataMartRuns:b,runs:R,getDataMart:T,runSchemaActualization:B,isSchemaActualizationLoading:H}})}),o.jsx(Hr,{open:_,onOpenChange:D,title:"Delete Data Mart",description:o.jsxs(o.Fragment,{children:["Are you sure you want to delete ",o.jsxs("strong",{children:['"',Y,'"']}),"? This action cannot be undone."]}),confirmLabel:"Delete",cancelLabel:"Cancel",variant:"destructive",onConfirm:()=>{(async()=>{try{await r(j),D(!1),t("/data-marts")}catch(q){console.error("Failed to delete Data Mart:",q)}})()}})]}):o.jsxs("div",{className:"dm-page-content flex flex-col gap-4 py-4 md:py-8",children:[o.jsx(is,{className:"h-16 w-full"},0),Array.from({length:3}).map((q,te)=>o.jsx(is,{className:"h-48 w-full"},te+1))]})}function jJ({description:e,onUpdate:t,className:n,placeholder:r="Add description...",minWidth:s="100%",minHeight:l="100px"}){const[c,d]=p.useState(e??""),[f,h]=p.useState(!1),[g,y]=p.useState(!1),v=p.useRef(null);p.useEffect(()=>{d(e??"")},[e]),p.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)},E=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)}},S=R=>{R.key==="Enter"&&R.ctrlKey?(R.preventDefault(),E()):R.key==="Escape"&&(R.preventDefault(),d(e??""),h(!1))};return f?o.jsxs("div",{className:"w-full",children:[o.jsx($i,{ref:v,value:c,onChange:w,onBlur:()=>void E(),onKeyDown:S,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:s},disabled:g}),o.jsxs("div",{className:"mt-2 text-xs text-gray-500",children:[o.jsxs("span",{children:["Press"," ",o.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 •"," "]}),o.jsxs("span",{children:[o.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 •"," "]}),o.jsx("span",{children:"Changes are also saved when you click outside"})]})]}):o.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:o.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:s},children:e??r})})}function _J(){const{dataMart:e,updateDataMartDescription:t}=Wa(),n=async r=>{await t(e.id,r)};return o.jsx("div",{children:o.jsx(jJ,{description:e.description,onUpdate:n,placeholder:"Add a description for this Data Mart..."})})}function KT(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 NJ(e){if(Array.isArray(e))return e}function AJ(e,t,n){return(t=PJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DJ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,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,s=g}finally{try{if(!f&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(h)throw s}}return d}}function OJ(){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 YT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function WT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YT(Object(n),!0).forEach(function(r){AJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function MJ(e,t){if(e==null)return{};var n,r,s=IJ(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)&&(s[n]=e[n])}return s}function IJ(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 kJ(e,t){return NJ(e)||DJ(e,t)||UJ(e,t)||OJ()}function LJ(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 PJ(e){var t=LJ(e,"string");return typeof t=="symbol"?t:t+""}function UJ(e,t){if(e){if(typeof e=="string")return KT(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)?KT(e,t):void 0}}function FJ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function XT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QT(Object(n),!0).forEach(function(r){FJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zJ(){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(s,l){return l(s)},r)}}function Kd(e){return function t(){for(var n=this,r=arguments.length,s=new Array(r),l=0;l<r;l++)s[l]=arguments[l];return s.length>=e.length?e.apply(this,s):function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];return t.apply(n,[].concat(s,d))}}}function Pp(e){return{}.toString.call(e).includes("Object")}function VJ(e){return!Object.keys(e).length}function gf(e){return typeof e=="function"}function $J(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function HJ(e,t){return Pp(t)||Ti("changeType"),Object.keys(t).some(function(n){return!$J(e,n)})&&Ti("changeField"),t}function BJ(e){gf(e)||Ti("selectorType")}function GJ(e){gf(e)||Pp(e)||Ti("handlerType"),Pp(e)&&Object.values(e).some(function(t){return!gf(t)})&&Ti("handlersType")}function qJ(e){e||Ti("initialIsRequired"),Pp(e)||Ti("initialType"),VJ(e)&&Ti("initialContent")}function ZJ(e,t){throw new Error(e[t]||e.default)}var KJ={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"},Ti=Kd(ZJ)(KJ),Im={changes:HJ,selector:BJ,handler:GJ,initial:qJ};function YJ(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Im.initial(e),Im.handler(t);var n={current:e},r=Kd(XJ)(n,t),s=Kd(QJ)(n),l=Kd(Im.changes)(e),c=Kd(WJ)(n);function d(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(g){return g};return Im.selector(h),h(n.current)}function f(h){zJ(r,s,l,c)(h)}return[d,f]}function WJ(e,t){return gf(t)?t(e.current):t}function QJ(e,t){return e.current=XT(XT({},e.current),t),t}function XJ(e,t,n){return gf(t)?t(e.current):Object.keys(n).forEach(function(r){var s;return(s=t[r])===null||s===void 0?void 0:s.call(t,e.current[r])}),n}var JJ={create:YJ},eee={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.54.0/min/vs"}};function tee(e){return function t(){for(var n=this,r=arguments.length,s=new Array(r),l=0;l<r;l++)s[l]=arguments[l];return s.length>=e.length?e.apply(this,s):function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];return t.apply(n,[].concat(s,d))}}}function nee(e){return{}.toString.call(e).includes("Object")}function ree(e){return e||JT("configIsRequired"),nee(e)||JT("configType"),e.urls?(aee(),{paths:{vs:e.urls.monacoBase}}):e}function aee(){console.warn(aO.deprecation)}function see(e,t){throw new Error(e[t]||e.default)}var aO={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
|
-
`},JT=tee(see)(aO),oee={config:ree},iee=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(s){return n.reduceRight(function(l,c){return c(l)},s)}};function sO(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],sO(e[n],t[n]))}),WT(WT({},e),t)}var lee={type:"cancelation",msg:"operation is manually canceled"};function qx(e){var t=!1,n=new Promise(function(r,s){e.then(function(l){return t?s(lee):r(l)}),e.catch(s)});return n.cancel=function(){return t=!0},n}var cee=["monaco"],uee=JJ.create({config:eee,isInitialized:!1,resolve:null,reject:null,monaco:null}),oO=kJ(uee,2),Wf=oO[0],$g=oO[1];function dee(e){var t=oee.config(e),n=t.monaco,r=MJ(t,cee);$g(function(s){return{config:sO(s.config,r),monaco:n}})}function fee(){var e=Wf(function(t){var n=t.monaco,r=t.isInitialized,s=t.resolve;return{monaco:n,isInitialized:r,resolve:s}});if(!e.isInitialized){if($g({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),qx(Zx);if(window.monaco&&window.monaco.editor)return iO(window.monaco),e.resolve(window.monaco),qx(Zx);iee(hee,pee)(gee)}return qx(Zx)}function hee(e){return document.body.appendChild(e)}function mee(e){var t=document.createElement("script");return e&&(t.src=e),t}function pee(e){var t=Wf(function(r){var s=r.config,l=r.reject;return{config:s,reject:l}}),n=mee("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function gee(){var e=Wf(function(n){var r=n.config,s=n.resolve,l=n.reject;return{config:r,resolve:s,reject:l}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){var r=n.m;iO(r),e.resolve(r)},function(n){e.reject(n)})}function iO(e){Wf().monaco||$g({monaco:e})}function yee(){return Wf(function(e){var t=e.monaco;return t})}var Zx=new Promise(function(e,t){return $g({resolve:e,reject:t})}),lO={config:dee,init:fee,__getMonacoInstance:yee},vee={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Kx=vee,xee={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},bee=xee;function See({children:e}){return ye.createElement("div",{style:bee.container},e)}var Cee=See,Eee=Cee;function wee({width:e,height:t,isEditorReady:n,loading:r,_ref:s,className:l,wrapperProps:c}){return ye.createElement("section",{style:{...Kx.wrapper,width:e,height:t},...c},!n&&ye.createElement(Eee,null,r),ye.createElement("div",{ref:s,style:{...Kx.fullWidth,...!n&&Kx.hide},className:l}))}var Ree=wee,cO=p.memo(Ree);function Tee(e){p.useEffect(e,[])}var uO=Tee;function jee(e,t,n=!0){let r=p.useRef(!0);p.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var ma=jee;function Xd(){}function Wc(e,t,n,r){return _ee(e,r)||Nee(e,t,n,r)}function _ee(e,t){return e.editor.getModel(dO(e,t))}function Nee(e,t,n,r){return e.editor.createModel(t,n,r?dO(e,r):void 0)}function dO(e,t){return e.Uri.parse(t)}function Aee({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:s,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:E={},beforeMount:S=Xd,onMount:R=Xd}){let[T,_]=p.useState(!1),[D,A]=p.useState(!0),O=p.useRef(null),j=p.useRef(null),M=p.useRef(null),F=p.useRef(R),G=p.useRef(S),Y=p.useRef(!1);uO(()=>{let W=lO.init();return W.then(k=>(j.current=k)&&A(!1)).catch(k=>(k==null?void 0:k.type)!=="cancelation"&&console.error("Monaco initialization: error:",k)),()=>O.current?$():W.cancel()}),ma(()=>{if(O.current&&j.current){let W=O.current.getOriginalEditor(),k=Wc(j.current,e||"",r||n||"text",l||"");k!==W.getModel()&&W.setModel(k)}},[l],T),ma(()=>{if(O.current&&j.current){let W=O.current.getModifiedEditor(),k=Wc(j.current,t||"",s||n||"text",c||"");k!==W.getModel()&&W.setModel(k)}},[c],T),ma(()=>{let W=O.current.getModifiedEditor();W.getOption(j.current.editor.EditorOption.readOnly)?W.setValue(t||""):t!==W.getValue()&&(W.executeEdits("",[{range:W.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),W.pushUndoStop())},[t],T),ma(()=>{var W,k;(k=(W=O.current)==null?void 0:W.getModel())==null||k.original.setValue(e||"")},[e],T),ma(()=>{let{original:W,modified:k}=O.current.getModel();j.current.editor.setModelLanguage(W,r||n||"text"),j.current.editor.setModelLanguage(k,s||n||"text")},[n,r,s],T),ma(()=>{var W;(W=j.current)==null||W.editor.setTheme(h)},[h],T),ma(()=>{var W;(W=O.current)==null||W.updateOptions(y)},[y],T);let Z=p.useCallback(()=>{var H;if(!j.current)return;G.current(j.current);let W=Wc(j.current,e||"",r||n||"text",l||""),k=Wc(j.current,t||"",s||n||"text",c||"");(H=O.current)==null||H.setModel({original:W,modified:k})},[n,t,s,e,r,l,c]),ee=p.useCallback(()=>{var W;!Y.current&&M.current&&(O.current=j.current.editor.createDiffEditor(M.current,{automaticLayout:!0,...y}),Z(),(W=j.current)==null||W.editor.setTheme(h),_(!0),Y.current=!0)},[y,h,Z]);p.useEffect(()=>{T&&F.current(O.current,j.current)},[T]),p.useEffect(()=>{!D&&!T&&ee()},[D,T,ee]);function $(){var k,H,B,ie;let W=(k=O.current)==null?void 0:k.getModel();d||((H=W==null?void 0:W.original)==null||H.dispose()),f||((B=W==null?void 0:W.modified)==null||B.dispose()),(ie=O.current)==null||ie.dispose()}return ye.createElement(cO,{width:b,height:v,isEditorReady:T,loading:g,_ref:M,className:w,wrapperProps:E})}var Dee=Aee;p.memo(Dee);function Oee(e){let t=p.useRef();return p.useEffect(()=>{t.current=e},[e]),t.current}var Mee=Oee,km=new Map;function Iee({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:s,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:E,wrapperProps:S={},beforeMount:R=Xd,onMount:T=Xd,onChange:_,onValidate:D=Xd}){let[A,O]=p.useState(!1),[j,M]=p.useState(!0),F=p.useRef(null),G=p.useRef(null),Y=p.useRef(null),Z=p.useRef(T),ee=p.useRef(R),$=p.useRef(),W=p.useRef(r),k=Mee(l),H=p.useRef(!1),B=p.useRef(!1);uO(()=>{let L=lO.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()}),ma(()=>{var P,q,te,ue;let L=Wc(F.current,e||r||"",t||s||"",l||n||"");L!==((P=G.current)==null?void 0:P.getModel())&&(y&&km.set(k,(q=G.current)==null?void 0:q.saveViewState()),(te=G.current)==null||te.setModel(L),y&&((ue=G.current)==null||ue.restoreViewState(km.get(l))))},[l],A),ma(()=>{var L;(L=G.current)==null||L.updateOptions(h)},[h],A),ma(()=>{!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),ma(()=>{var P,q;let L=(P=G.current)==null?void 0:P.getModel();L&&s&&((q=F.current)==null||q.editor.setModelLanguage(L,s))},[s],A),ma(()=>{var L;d!==void 0&&((L=G.current)==null||L.revealLine(d))},[d],A),ma(()=>{var L;(L=F.current)==null||L.editor.setTheme(c)},[c],A);let ie=p.useCallback(()=>{var L;if(!(!Y.current||!F.current)&&!H.current){ee.current(F.current);let P=l||n,q=Wc(F.current,r||e||"",t||s||"",P||"");G.current=(L=F.current)==null?void 0:L.editor.create(Y.current,{model:q,automaticLayout:!0,...h},g),y&&G.current.restoreViewState(km.get(P)),F.current.editor.setTheme(c),d!==void 0&&G.current.revealLine(d),O(!0),H.current=!0}},[e,t,n,r,s,l,h,g,y,c,d]);p.useEffect(()=>{A&&Z.current(G.current,F.current)},[A]),p.useEffect(()=>{!j&&!A&&ie()},[j,A,ie]),W.current=r,p.useEffect(()=>{var L,P;A&&_&&((L=$.current)==null||L.dispose(),$.current=(P=G.current)==null?void 0:P.onDidChangeModelContent(q=>{B.current||_(G.current.getValue(),q)}))},[A,_]),p.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=$.current)==null||L.dispose(),v?y&&km.set(l,G.current.saveViewState()):(P=G.current.getModel())==null||P.dispose(),G.current.dispose()}return ye.createElement(cO,{width:b,height:w,isEditorReady:A,loading:f,_ref:Y,className:E,wrapperProps:S})}var kee=Iee,Lee=p.memo(kee);function Pee({initialValue:e,onChange:t}){const[n,r]=p.useState((e==null?void 0:e.sqlQuery)??""),{resolvedTheme:s}=w4();p.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 o.jsx("div",{className:"shadow-xs",children:o.jsx(Lee,{className:"overflow-hidden rounded-md border border-gray-200 dark:border-gray-200/4",height:"30vh",language:"sql",value:n,onChange:l,theme:s==="dark"?"vs-dark":"light",options:{selectOnLineNumbers:!0,hideCursorInOverviewRuler:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,overviewRulerBorder:!1}})})}function tb({icon:e,title:t,subtitle:n,rightContent:r,onClick:s,className:l}){const c=e;return o.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",s&&"cursor-pointer dark:hover:bg-white/5",l),onClick:s,children:[o.jsxs("div",{className:"flex flex-grow items-start justify-center gap-3 px-6 py-5",children:[e&&o.jsx("div",{className:"flex items-center justify-center",children:o.jsx(c,{className:"h-6 w-6"})}),o.jsxs("div",{className:"flex flex-grow flex-col gap-1",children:[o.jsx("div",{className:"text-md font-medium",children:t}),n&&o.jsx("div",{className:"text-muted-foreground/60 text-sm",children:n})]})]}),o.jsxs("div",{className:"flex items-center justify-center gap-2 p-4",children:[r,s&&o.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:o.jsx(ja,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})]})]})}var ej=1,Uee=.9,Fee=.8,zee=.17,Yx=.1,Wx=.999,Vee=.9999,$ee=.99,Hee=/[\\\/_+.#"@\[\(\{&]/,Bee=/[\\\/_+.#"@\[\(\{&]/g,Gee=/[\s-]/,fO=/[\s-]/g;function nb(e,t,n,r,s,l,c){if(l===t.length)return s===e.length?ej:$ee;var d=`${s},${l}`;if(c[d]!==void 0)return c[d];for(var f=r.charAt(l),h=n.indexOf(f,s),g=0,y,v,b,w;h>=0;)y=nb(e,t,n,r,h+1,l+1,c),y>g&&(h===s?y*=ej:Hee.test(e.charAt(h-1))?(y*=Fee,b=e.slice(s,h-1).match(Bee),b&&s>0&&(y*=Math.pow(Wx,b.length))):Gee.test(e.charAt(h-1))?(y*=Uee,w=e.slice(s,h-1).match(fO),w&&s>0&&(y*=Math.pow(Wx,w.length))):(y*=zee,s>0&&(y*=Math.pow(Wx,h-s))),e.charAt(h)!==t.charAt(l)&&(y*=Vee)),(y<Yx&&n.charAt(h-1)===r.charAt(l+1)||r.charAt(l+1)===r.charAt(l)&&n.charAt(h-1)!==r.charAt(l))&&(v=nb(e,t,n,r,h+1,l+2,c),v*Yx>y&&(y=v*Yx)),y>g&&(g=y),h=n.indexOf(f,h+1);return c[d]=g,g}function tj(e){return e.toLowerCase().replace(fO," ")}function qee(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,nb(e,t,tj(e),tj(t),0,0,{})}var Fd='[cmdk-group=""]',Qx='[cmdk-group-items=""]',Zee='[cmdk-group-heading=""]',hO='[cmdk-item=""]',nj=`${hO}:not([aria-disabled="true"])`,rb="cmdk-item-select",qc="data-value",Kee=(e,t,n)=>qee(e,t,n),mO=p.createContext(void 0),Qf=()=>p.useContext(mO),pO=p.createContext(void 0),mS=()=>p.useContext(pO),gO=p.createContext(void 0),yO=p.forwardRef((e,t)=>{let n=Zc(()=>{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=Zc(()=>new Set),s=Zc(()=>new Map),l=Zc(()=>new Map),c=Zc(()=>new Set),d=vO(e),{label:f,children:h,value:g,onValueChange:y,filter:v,shouldFilter:b,loop:w,disablePointerSelection:E=!1,vimBindings:S=!0,...R}=e,T=Nn(),_=Nn(),D=Nn(),A=p.useRef(null),O=ste();zl(()=>{if(g!==void 0){let P=g.trim();n.current.value=P,j.emit()}},[g]),zl(()=>{O(6,ee)},[]);let j=p.useMemo(()=>({subscribe:P=>(c.current.add(P),()=>c.current.delete(P)),snapshot:()=>n.current,setState:(P,q,te)=>{var ue,ve,le,Ne;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(T))==null||ue.focus()}if(O(7,()=>{var we;n.current.selectedItemId=(we=$())==null?void 0:we.id,j.emit()}),te||O(5,ee),((ve=d.current)==null?void 0:ve.value)!==void 0){let we=q??"";(Ne=(le=d.current).onValueChange)==null||Ne.call(le,we);return}}j.emit()}},emit:()=>{c.current.forEach(P=>P())}}),[]),M=p.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(),j.emit()}))},item:(P,q)=>(r.current.add(P),q&&(s.current.has(q)?s.current.get(q).add(P):s.current.set(q,new Set([P]))),O(3,()=>{Z(),G(),n.current.value||Y(),j.emit()}),()=>{l.current.delete(P),r.current.delete(P),n.current.filtered.items.delete(P);let te=$();O(4,()=>{Z(),(te==null?void 0:te.getAttribute("id"))===P&&Y(),j.emit()})}),group:P=>(s.current.has(P)||s.current.set(P,new Set),()=>{l.current.delete(P),s.current.delete(P)}),filter:()=>d.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>d.current.disablePointerSelection,listId:T,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:Kee;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=s.current.get(ue),le=0;ve.forEach(Ne=>{let we=P.get(Ne);le=Math.max(we,le)}),q.push([ue,le])});let te=A.current;W().sort((ue,ve)=>{var le,Ne;let we=ue.getAttribute("id"),_e=ve.getAttribute("id");return((le=P.get(_e))!=null?le:0)-((Ne=P.get(we))!=null?Ne:0)}).forEach(ue=>{let ve=ue.closest(Qx);ve?ve.appendChild(ue.parentElement===ve?ue:ue.closest(`${Qx} > *`)):te.appendChild(ue.parentElement===te?ue:ue.closest(`${Qx} > *`))}),q.sort((ue,ve)=>ve[1]-ue[1]).forEach(ue=>{var ve;let le=(ve=A.current)==null?void 0:ve.querySelector(`${Fd}[${qc}="${encodeURIComponent(ue[0])}"]`);le==null||le.parentElement.appendChild(le)})}function Y(){let P=W().find(te=>te.getAttribute("aria-disabled")!=="true"),q=P==null?void 0:P.getAttribute(qc);j.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 Ne=(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:[],_e=F(Ne,we);n.current.filtered.items.set(le,_e),_e>0&&ve++}for(let[le,Ne]of s.current)for(let we of Ne)if(n.current.filtered.items.get(we)>0){n.current.filtered.groups.add(le);break}n.current.filtered.count=ve}function ee(){var P,q,te;let ue=$();ue&&(((P=ue.parentElement)==null?void 0:P.firstChild)===ue&&((te=(q=ue.closest(Fd))==null?void 0:q.querySelector(Zee))==null||te.scrollIntoView({block:"nearest"})),ue.scrollIntoView({block:"nearest"}))}function $(){var P;return(P=A.current)==null?void 0:P.querySelector(`${hO}[aria-selected="true"]`)}function W(){var P;return Array.from(((P=A.current)==null?void 0:P.querySelectorAll(nj))||[])}function k(P){let q=W()[P];q&&j.setState("value",q.getAttribute(qc))}function H(P){var q;let te=$(),ue=W(),ve=ue.findIndex(Ne=>Ne===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&&j.setState("value",le.getAttribute(qc))}function B(P){let q=$(),te=q==null?void 0:q.closest(Fd),ue;for(;te&&!ue;)te=P>0?rte(te,Fd):ate(te,Fd),ue=te==null?void 0:te.querySelector(nj);ue?j.setState("value",ue.getAttribute(qc)):H(P)}let ie=()=>k(W().length-1),xe=P=>{P.preventDefault(),P.metaKey?ie():P.altKey?B(1):H(1)},L=P=>{P.preventDefault(),P.metaKey?k(0):P.altKey?B(-1):H(-1)};return p.createElement(Je.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":{S&&P.ctrlKey&&xe(P);break}case"ArrowDown":{xe(P);break}case"p":case"k":{S&&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=$();if(ue){let ve=new Event(rb);ue.dispatchEvent(ve)}}}}},p.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:ite},f),Hg(e,P=>p.createElement(pO.Provider,{value:j},p.createElement(mO.Provider,{value:M},P))))}),Yee=p.forwardRef((e,t)=>{var n,r;let s=Nn(),l=p.useRef(null),c=p.useContext(gO),d=Qf(),f=vO(e),h=(r=(n=f.current)==null?void 0:n.forceMount)!=null?r:c==null?void 0:c.forceMount;zl(()=>{if(!h)return d.item(s,c==null?void 0:c.id)},[h]);let g=xO(s,l,[e.value,e.children,l],e.keywords),y=mS(),v=Ii(O=>O.value&&O.value===g.current),b=Ii(O=>h||d.filter()===!1?!0:O.search?O.filtered.items.get(s)>0:!0);p.useEffect(()=>{let O=l.current;if(!(!O||e.disabled))return O.addEventListener(rb,w),()=>O.removeEventListener(rb,w)},[b,e.onSelect,e.disabled]);function w(){var O,j;E(),(j=(O=f.current).onSelect)==null||j.call(O,g.current)}function E(){y.setState("value",g.current,!0)}if(!b)return null;let{disabled:S,value:R,onSelect:T,forceMount:_,keywords:D,...A}=e;return p.createElement(Je.div,{ref:Ir(l,t),...A,id:s,"cmdk-item":"",role:"option","aria-disabled":!!S,"aria-selected":!!v,"data-disabled":!!S,"data-selected":!!v,onPointerMove:S||d.getDisablePointerSelection()?void 0:E,onClick:S?void 0:w},e.children)}),Wee=p.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...l}=e,c=Nn(),d=p.useRef(null),f=p.useRef(null),h=Nn(),g=Qf(),y=Ii(b=>s||g.filter()===!1?!0:b.search?b.filtered.groups.has(c):!0);zl(()=>g.group(c),[]),xO(c,d,[e.value,e.heading,f]);let v=p.useMemo(()=>({id:c,forceMount:s}),[s]);return p.createElement(Je.div,{ref:Ir(d,t),...l,"cmdk-group":"",role:"presentation",hidden:y?void 0:!0},n&&p.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:h},n),Hg(e,b=>p.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?h:void 0},p.createElement(gO.Provider,{value:v},b))))}),Qee=p.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=p.useRef(null),l=Ii(c=>!c.search);return!n&&!l?null:p.createElement(Je.div,{ref:Ir(s,t),...r,"cmdk-separator":"",role:"separator"})}),Xee=p.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,l=mS(),c=Ii(h=>h.search),d=Ii(h=>h.selectedItemId),f=Qf();return p.useEffect(()=>{e.value!=null&&l.setState("search",e.value)},[e.value]),p.createElement(Je.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:s?e.value:c,onChange:h=>{s||l.setState("search",h.target.value),n==null||n(h.target.value)}})}),Jee=p.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,l=p.useRef(null),c=p.useRef(null),d=Ii(h=>h.selectedItemId),f=Qf();return p.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)}}},[]),p.createElement(Je.div,{ref:Ir(l,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":d,"aria-label":r,id:f.listId},Hg(e,h=>p.createElement("div",{ref:Ir(c,f.listInnerRef),"cmdk-list-sizer":""},h)))}),ete=p.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:l,container:c,...d}=e;return p.createElement(ng,{open:n,onOpenChange:r},p.createElement(rg,{container:c},p.createElement(ag,{"cmdk-overlay":"",className:s}),p.createElement(sg,{"aria-label":e.label,"cmdk-dialog":"",className:l},p.createElement(yO,{ref:t,...d}))))}),tte=p.forwardRef((e,t)=>Ii(n=>n.filtered.count===0)?p.createElement(Je.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),nte=p.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...l}=e;return p.createElement(Je.div,{ref:t,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Hg(e,c=>p.createElement("div",{"aria-hidden":!0},c)))}),Pu=Object.assign(yO,{List:Jee,Item:Yee,Input:Xee,Group:Wee,Separator:Qee,Dialog:ete,Empty:tte,Loading:nte});function rte(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function ate(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function vO(e){let t=p.useRef(e);return zl(()=>{t.current=e}),t}var zl=typeof window>"u"?p.useEffect:p.useLayoutEffect;function Zc(e){let t=p.useRef();return t.current===void 0&&(t.current=e()),t}function Ii(e){let t=mS(),n=()=>e(t.snapshot());return p.useSyncExternalStore(t.subscribe,n,n)}function xO(e,t,n,r=[]){let s=p.useRef(),l=Qf();return zl(()=>{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():s.current}})(),f=r.map(h=>h.trim());l.value(e,d,f),(c=t.current)==null||c.setAttribute(qc,d),s.current=d}),s}var ste=()=>{let[e,t]=p.useState(),n=Zc(()=>new Map);return zl(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}};function ote(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Hg({asChild:e,children:t},n){return e&&p.isValidElement(t)?p.cloneElement(ote(t),{ref:t.ref},n(t.props.children)):n(t)}var ite={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function bO({className:e,...t}){return o.jsx(Pu,{"data-slot":"command",className:ne("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function SO({className:e,...t}){return o.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[o.jsx($l,{className:"size-4 shrink-0 opacity-50"}),o.jsx(Pu.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 o.jsx(Pu.List,{"data-slot":"command-list",className:ne("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function CO({...e}){return o.jsx(Pu.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function EO({className:e,...t}){return o.jsx(Pu.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 wO({className:e,...t}){return o.jsx(Pu.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 cte(e){const t=ute(e),n=p.forwardRef((r,s)=>{const{children:l,...c}=r,d=p.Children.toArray(l),f=d.find(fte);if(f){const h=f.props.children,g=d.map(y=>y===f?p.Children.count(h)>1?p.Children.only(null):p.isValidElement(h)?h.props.children:null:y);return o.jsx(t,{...c,ref:s,children:p.isValidElement(h)?p.cloneElement(h,void 0,g):null})}return o.jsx(t,{...c,ref:s,children:l})});return n.displayName=`${e}.Slot`,n}function ute(e){const t=p.forwardRef((n,r)=>{const{children:s,...l}=n;if(p.isValidElement(s)){const c=mte(s),d=hte(l,s.props);return s.type!==p.Fragment&&(d.ref=r?Ir(r,c):c),p.cloneElement(s,d)}return p.Children.count(s)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var dte=Symbol("radix.slottable");function fte(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===dte}function hte(e,t){const n={...t};for(const r in t){const s=e[r],l=t[r];/^on[A-Z]/.test(r)?s&&l?n[r]=(...d)=>{const f=l(...d);return s(...d),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...l}:r==="className"&&(n[r]=[s,l].filter(Boolean).join(" "))}return{...e,...n}}function mte(e){var r,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Bg="Popover",[RO]=ir(Bg,[Zs]),Xf=Zs(),[pte,Yi]=RO(Bg),TO=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:l,modal:c=!1}=e,d=Xf(t),f=p.useRef(null),[h,g]=p.useState(!1),[y,v]=Vr({prop:r,defaultProp:s??!1,onChange:l,caller:Bg});return o.jsx(wu,{...d,children:o.jsx(pte,{scope:t,contentId:Nn(),triggerRef:f,open:y,onOpenChange:v,onOpenToggle:p.useCallback(()=>v(b=>!b),[v]),hasCustomAnchor:h,onCustomAnchorAdd:p.useCallback(()=>g(!0),[]),onCustomAnchorRemove:p.useCallback(()=>g(!1),[]),modal:c,children:n})})};TO.displayName=Bg;var jO="PopoverAnchor",gte=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Yi(jO,n),l=Xf(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:d}=s;return p.useEffect(()=>(c(),()=>d()),[c,d]),o.jsx(Ru,{...l,...r,ref:t})});gte.displayName=jO;var _O="PopoverTrigger",NO=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Yi(_O,n),l=Xf(n),c=ut(t,s.triggerRef),d=o.jsx(Je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":IO(s.open),...r,ref:c,onClick:Te(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?d:o.jsx(Ru,{asChild:!0,...l,children:d})});NO.displayName=_O;var pS="PopoverPortal",[yte,vte]=RO(pS,{forceMount:void 0}),AO=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,l=Yi(pS,t);return o.jsx(yte,{scope:t,forceMount:n,children:o.jsx(Er,{present:n||l.open,children:o.jsx(Bl,{asChild:!0,container:s,children:r})})})};AO.displayName=pS;var vu="PopoverContent",DO=p.forwardRef((e,t)=>{const n=vte(vu,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,l=Yi(vu,e.__scopePopover);return o.jsx(Er,{present:r||l.open,children:l.modal?o.jsx(bte,{...s,ref:t}):o.jsx(Ste,{...s,ref:t})})});DO.displayName=vu;var xte=cte("PopoverContent.RemoveScroll"),bte=p.forwardRef((e,t)=>{const n=Yi(vu,e.__scopePopover),r=p.useRef(null),s=ut(t,r),l=p.useRef(!1);return p.useEffect(()=>{const c=r.current;if(c)return eg(c)},[]),o.jsx(_f,{as:xte,allowPinchZoom:!0,children:o.jsx(OO,{...e,ref:s,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})})})}),Ste=p.forwardRef((e,t)=>{const n=Yi(vu,e.__scopePopover),r=p.useRef(!1),s=p.useRef(!1);return o.jsx(OO,{...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,s.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"&&(s.current=!0));const c=l.target;((h=n.triggerRef.current)==null?void 0:h.contains(c))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&s.current&&l.preventDefault()}})}),OO=p.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:g,...y}=e,v=Yi(vu,n),b=Xf(n);return Xp(),o.jsx(jf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:l,children:o.jsx(Hl,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:g,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onDismiss:()=>v.onOpenChange(!1),children:o.jsx(Af,{"data-state":IO(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)"}})})})}),MO="PopoverClose",Cte=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Yi(MO,n);return o.jsx(Je.button,{type:"button",...r,ref:t,onClick:Te(e.onClick,()=>s.onOpenChange(!1))})});Cte.displayName=MO;var Ete="PopoverArrow",wte=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Xf(n);return o.jsx(Df,{...s,...r,ref:t})});wte.displayName=Ete;function IO(e){return e?"open":"closed"}var Rte=TO,Tte=NO,jte=AO,_te=DO;function gS({...e}){return o.jsx(Rte,{"data-slot":"popover",...e})}function yS({...e}){return o.jsx(Tte,{"data-slot":"popover-trigger",...e})}function vS({className:e,align:t="center",sideOffset:n=4,...r}){return o.jsx(jte,{children:o.jsx(_te,{"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 xS({options:e,value:t,onValueChange:n,placeholder:r="Select an option",emptyMessage:s="No results found.",className:l,disabled:c=!1}){const[d,f]=p.useState(!1),[h,g]=p.useState(""),y=p.useMemo(()=>{const w={};return e.forEach(E=>{const S=E.group??"";Object.prototype.hasOwnProperty.call(w,S)||(w[S]=[]),w[S].push(E)}),w},[e]),v=e.find(w=>w.value===t),b=p.useCallback(w=>{n(w),requestAnimationFrame(()=>{g(""),f(!1)})},[n]);return o.jsxs(gS,{open:d,onOpenChange:f,modal:!0,children:[o.jsx(yS,{asChild:!0,children:o.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,o.jsx(Nb,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),o.jsx(vS,{className:"max-h-[300px] min-w-[300px] overflow-auto p-0",align:"start",sideOffset:5,children:o.jsxs(bO,{children:[o.jsx(SO,{placeholder:`Search ${r.toLowerCase()}...`,value:h,onValueChange:g}),o.jsx(CO,{children:s}),Object.entries(y).map(([w,E])=>o.jsx(EO,{heading:w,children:E.map(S=>o.jsxs(wO,{value:S.value,onSelect:()=>{b(S.value)},keywords:[S.label],children:[o.jsx(fr,{className:ne("mr-2 h-4 w-4",t===S.value?"opacity-100":"opacity-0")}),S.label]},S.value))},w||"default"))]})})]})}function Nte(){return o.jsx(lr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Un,{value:"service-account-details",children:[o.jsx(Fn,{children:"How do I get a Service Account JSON key?"}),o.jsxs(zn,{children:[o.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."}),o.jsx("p",{className:"mb-2",children:"Here's what to do:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Go to"," ",o.jsx(or,{className:"underline",href:"https://console.cloud.google.com/iam-admin/serviceaccounts",children:"Google Cloud Console"}),"."]}),o.jsxs("li",{children:["Open ",o.jsx("strong",{children:"IAM & Admin → Service Accounts"}),"."]}),o.jsx("li",{children:"Create a new service account or select an existing one."}),o.jsxs("li",{children:["Assign the ",o.jsx("strong",{children:"bigquery.dataEditor"})," and ",o.jsx("strong",{children:"bigquery.jobUser"})," ","roles to this service account to allow read, write, and create access to your project resources."]}),o.jsxs("li",{children:["Open the Service Accounts page, go to the ",o.jsx("strong",{children:"Keys"})," tab, click"," ",o.jsx("strong",{children:"Add key"}),", and select ",o.jsx("strong",{children:"Create new key"}),"."]}),o.jsxs("li",{children:["Choose ",o.jsx("strong",{children:"JSON"})," format and click ",o.jsx("strong",{children:"Create"}),"."]}),o.jsx("li",{children:"Open the downloaded file, copy its entire content, and paste it into the field above."})]})]})]})})}function Ate(){return o.jsx(lr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Un,{value:"project-id-details",children:[o.jsx(Fn,{children:"How do I find my Project ID?"}),o.jsxs(zn,{children:[o.jsx("p",{className:"mb-2",children:"This is the ID of your Google Cloud project. BigQuery usage costs will be charged to this project."}),o.jsx("p",{className:"mb-2",children:"Here's how to find your billing project ID:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open"," ",o.jsx(or,{className:"underline",href:"https://console.cloud.google.com/",children:"Google Cloud Console"})," ","and sign in with your Google account."]}),o.jsx("li",{children:'Click the project selector dropdown at the top of the page (it shows the current project name or "Select a project").'}),o.jsxs("li",{children:["Find your project in the list. The ",o.jsx("strong",{children:"Project ID"})," is shown in the ID column."]}),o.jsx("li",{children:"If you don't see your project, use the search box to find it by name or ID."})]})]})]})})}function Dte(){return o.jsx(lr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Un,{value:"gbq-location-details",children:[o.jsx(Fn,{children:"How do I find my dataset location?"}),o.jsxs(zn,{children:[o.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."}),o.jsx("p",{className:"mb-2",children:"Here's how to check your dataset location:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open"," ",o.jsx(or,{className:"underline",href:"https://console.cloud.google.com/bigquery",children:"Google Cloud Console BigQuery page"}),"."]}),o.jsx("li",{children:"In the left panel, expand your project and find your datasets."}),o.jsxs("li",{children:["Click each dataset name to open its details. The ",o.jsx("strong",{children:"Data location"})," field shows the region where that dataset is stored (for example,"," ",o.jsx("code",{className:"text-sm font-semibold",children:"US"}),","," ",o.jsx("code",{className:"text-sm font-semibold",children:"EU"}),","," ",o.jsx("code",{className:"text-sm font-semibold",children:"asia-northeast1"}),")."]}),o.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."}),o.jsx("li",{children:"Put this location value in the field above."})]})]})]})})}const kO=e=>{try{const t=JSON.parse(e),{project_id:n,client_id:r,client_email:s}=t;return!n||!r||!s?null:{url:`https://console.cloud.google.com/iam-admin/serviceaccounts/details/${r}?project=${n}`,email:s}}catch{return null}},Ote=({form:e})=>{const[t,n]=p.useState(!1);if(e.watch("type")!==Ie.GOOGLE_BIGQUERY)return null;const r=()=>{n(!0),e.setValue("credentials.serviceAccount","",{shouldDirty:!0})},s=()=>{n(!1),e.resetField("credentials.serviceAccount")},l=e.watch("credentials.serviceAccount"),c=l?kO(l):null;return o.jsxs(o.Fragment,{children:[o.jsxs(Hs,{title:"Connection Settings",children:[o.jsx(en,{control:e.control,name:"config.projectId",render:({field:d})=>o.jsxs(Vt,{children:[o.jsx($t,{tooltip:"Enter the ID of your Google Cloud project where BigQuery usage will be billed",children:"Project ID"}),o.jsx(Ht,{children:o.jsx(zt,{...d,placeholder:"Enter a Project Id"})}),o.jsx(Pn,{children:o.jsx(Ate,{})}),o.jsx(on,{})]})}),o.jsx(en,{control:e.control,name:"config.location",render:({field:d})=>o.jsxs(Vt,{children:[o.jsx($t,{tooltip:"Choose the same region where your BigQuery data is stored to ensure queries work correctly",children:"Location"}),o.jsx(Ht,{children:o.jsx(xS,{options:dZ,value:d.value,onValueChange:d.onChange,placeholder:"Select a location",emptyMessage:"No locations found",className:"w-full"})}),o.jsx(Pn,{children:o.jsx(Dte,{})}),o.jsx(on,{})]})})]}),o.jsx(Hs,{title:"Authentication",children:o.jsx(en,{control:e.control,name:"credentials.serviceAccount",render:({field:d})=>o.jsxs(Vt,{children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx($t,{tooltip:"Paste a JSON key from a service account that has access to the selected storage provider",children:"Service Account"}),!t&&l&&o.jsx(Se,{variant:"ghost",size:"sm",onClick:r,type:"button",children:"Edit"}),t&&o.jsx(Se,{variant:"ghost",size:"sm",onClick:s,type:"button",children:"Cancel"})]}),o.jsx(Ht,{children:!t&&c?o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx(or,{href:c.url,children:c.email})}),o.jsx(Et,{children:o.jsx("p",{children:"View in Google Cloud Console"})})]}):o.jsx($i,{...d,className:"min-h-[150px] font-mono",rows:8,placeholder:"Paste your service account JSON here"})}),o.jsx(Pn,{children:o.jsx(Nte,{})}),o.jsx(on,{})]})})})]})};function Mte(){return o.jsx(lr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Un,{value:"athena-region-details",children:[o.jsx(Fn,{children:"How do I find my Athena region?"}),o.jsxs(zn,{children:[o.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."}),o.jsx("p",{className:"mb-2",children:"Here's how to find your Athena region:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open"," ",o.jsx(or,{className:"underline",href:"https://console.aws.amazon.com/athena/",children:"the AWS Athena console"}),"."]}),o.jsx("li",{children:"Look at the top right corner of the console. The selected region is shown in the region selector dropdown."}),o.jsx("li",{children:"Make sure to copy and paste the same region here in the form to avoid connection or query errors."})]})]})]})})}function Ite(){return o.jsx(lr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Un,{value:"athena-output-bucket-details",children:[o.jsx(Fn,{children:"How do I find a bucket?"}),o.jsxs(zn,{children:[o.jsxs("p",{className:"mb-2",children:["Athena saves query results in an ",o.jsx("strong",{children:"S3 bucket"}),". You need to specify the bucket used for query output."]}),o.jsx("p",{className:"mb-2",children:"Here's how to find or create an S3 bucket for Athena output:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open"," ",o.jsx(or,{className:"underline",href:"https://console.aws.amazon.com/s3/",children:"the AWS S3 console"}),"."]}),o.jsx("li",{children:"Look for an existing bucket used for Athena query results, or create a new one."}),o.jsx("li",{children:"If creating a new bucket, make sure it is in the same region as your Athena service."}),o.jsx("li",{children:"Enter the bucket name in this form field."})]})]})]})})}function kte(){return o.jsx(lr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Un,{value:"athena-access-key-id-details",children:[o.jsx(Fn,{children:"How do I get my AWS Access Key ID?"}),o.jsxs(zn,{children:[o.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."}),o.jsxs("p",{className:"mb-4 text-sm",children:["Learn more about how to create a user in AWS ",o.jsx(or,{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"}),"."]}),o.jsx(__,{className:"my-4"}),o.jsx("p",{className:"mb-2",children:"The Access Key ID is part of your AWS credentials needed to connect and authenticate."}),o.jsx("p",{className:"mb-2",children:"Here's how to find or create an Access Key ID:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open"," ",o.jsx(or,{className:"underline",href:"https://console.aws.amazon.com/iam/home#/security_credentials",children:"the AWS IAM Security Credentials page"}),"."]}),o.jsxs("li",{children:["Under ",o.jsx("strong",{children:"Access keys"}),", find your existing keys or create a new access key."]}),o.jsx("li",{children:"When you create a new key, download and securely store the Access Key ID and Secret Access Key."})]})]})]})})}function Lte(){return o.jsx(lr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Un,{value:"athena-secret-access-key-details",children:[o.jsx(Fn,{children:"How do I get my AWS Secret Access Key?"}),o.jsxs(zn,{children:[o.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."}),o.jsx("p",{className:"mb-2",children:"Here's how to get your Secret Access Key:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open"," ",o.jsx(or,{className:"underline",href:"https://console.aws.amazon.com/iam/home#/security_credentials",children:"the AWS IAM Security Credentials page"}),"."]}),o.jsxs("li",{children:["Under ",o.jsx("strong",{children:"Access keys"}),", create a new access key if you don't have one or lost the secret key."]}),o.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 Pte=({form:e})=>{const[t,n]=p.useState("");return p.useEffect(()=>{const r=e.getValues("credentials.accessKeyId");if(r){const s="_".repeat(r.length);n(s),e.setValue("credentials.secretAccessKey",s,{shouldDirty:!1})}},[e]),e.watch("type")!==Ie.AWS_ATHENA?null:o.jsxs(o.Fragment,{children:[o.jsxs(Hs,{title:"Connection Settings",children:[o.jsx(en,{control:e.control,name:"config.region",render:({field:r})=>o.jsxs(Vt,{children:[o.jsx($t,{tooltip:"Enter the AWS region where your Athena service is active",children:"Region"}),o.jsx(Ht,{children:o.jsx(zt,{...r,placeholder:"Enter a region"})}),o.jsx(Pn,{children:o.jsx(Mte,{})}),o.jsx(on,{})]})}),o.jsx(en,{control:e.control,name:"config.outputBucket",render:({field:r})=>o.jsxs(Vt,{children:[o.jsx($t,{tooltip:"Specify the S3 bucket where Athena query results will be stored",children:"Output Bucket"}),o.jsx(Ht,{children:o.jsx(zt,{...r,placeholder:"Enter an output bucket"})}),o.jsx(Pn,{children:o.jsx(Ite,{})}),o.jsx(on,{})]})})]}),o.jsxs(Hs,{title:"Authentication",children:[o.jsx(en,{control:e.control,name:"credentials.accessKeyId",render:({field:r})=>o.jsxs(Vt,{children:[o.jsx($t,{tooltip:"Your AWS Access Key ID used for authentication",children:"Access Key ID"}),o.jsx(Ht,{children:o.jsx(zt,{...r,placeholder:"Enter an access key id"})}),o.jsx(Pn,{children:o.jsx(kte,{})}),o.jsx(on,{})]})}),o.jsx(en,{control:e.control,name:"credentials.secretAccessKey",render:({field:r})=>o.jsxs(Vt,{children:[o.jsx($t,{tooltip:"Your AWS Secret Access Key used for authentication",children:"Secret Access Key"}),o.jsx(Ht,{children:o.jsx(zt,{...r,type:"password",placeholder:t||"Enter a secret access key"})}),o.jsx(Pn,{children:o.jsx(Lte,{})}),o.jsx(on,{})]})})]})]})};function Ute(){return o.jsx(lr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Un,{value:"bigquery-api-details",children:[o.jsx(Fn,{children:"How do I enable the BigQuery API?"}),o.jsxs(zn,{children:[o.jsxs("p",{className:"mb-2",children:["To run queries and process data in Google BigQuery, you need to enable the"," ",o.jsx(or,{className:"underline",href:"https://console.cloud.google.com/apis/library/bigquery.googleapis.com",children:"BigQuery API"})," ","in your Google Cloud project."]}),o.jsx("p",{className:"mb-2",children:"Here's how to do it:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsx("li",{children:"Open the link above and make sure the correct project is selected."}),o.jsxs("li",{children:["If the API isn't enabled yet, click ",o.jsx("strong",{children:"Enable"}),"."]}),o.jsx("li",{children:"If it's already enabled, you'll see the API dashboard — that's fine."})]})]})]})})}function Fte(){return o.jsx(lr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Un,{value:"athena-api-details",children:[o.jsx(Fn,{children:"How do I activate Athena API?"}),o.jsxs(zn,{children:[o.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."}),o.jsx("p",{className:"mb-2",children:"Here's how to activate Athena:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open"," ",o.jsx(or,{className:"underline",href:"https://console.aws.amazon.com/athena/",children:"the AWS Athena console"})," ","and sign in to your AWS account."]}),o.jsx("li",{children:"If you haven't used Athena before, you may need to set up a query result location (an S3 bucket)."}),o.jsx("li",{children:"You can start running queries immediately after setup."})]})]})]})})}function LO(e){return JSON.parse(JSON.stringify(e))}function zte({initialData:e,onSubmit:t,onCancel:n,onDirtyChange:r}){const s=Gi({resolver:Jl(AZ),defaultValues:e}),{watch:l,control:c,formState:{isDirty:d,isSubmitting:f}}=s,h=l("type");ye.useEffect(()=>{r==null||r(d)},[d,r]);const g=async y=>{const{dirtyFields:v}=s.formState,b=LO(y);return v.credentials||delete b.credentials,t(b)};return o.jsx(Wl,{...s,children:o.jsxs(qi,{onSubmit:y=>{s.handleSubmit(g)(y)},noValidate:!0,children:[o.jsxs(Ql,{children:[o.jsxs(Hs,{title:"General",children:[o.jsx(en,{control:c,name:"title",render:({field:y})=>o.jsxs(Vt,{children:[o.jsx($t,{tooltip:"Name the storage to clarify its purpose",children:"Title"}),o.jsx(Ht,{children:o.jsx(zt,{...y,placeholder:"Storage title"})}),o.jsx(on,{})]})}),o.jsx(en,{control:c,name:"type",render:({field:y})=>o.jsxs(Vt,{children:[o.jsx($t,{tooltip:"The selected source will be used to process data in your Data Marts",children:"Storage Type"}),o.jsx(Ht,{children:o.jsxs(Ea,{value:y.value,onValueChange:y.onChange,disabled:!!e,children:[o.jsx(Ra,{className:"w-full",children:o.jsx(wa,{placeholder:"Select a storage type"})}),o.jsx(Ta,{children:o.jsx(kg,{children:Bi.getAllTypes().map(({type:v,displayName:b,icon:w,status:E})=>o.jsx(Yn,{value:v,disabled:E===wo.COMING_SOON,children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(w,{size:20}),b]})},v))})})]})}),o.jsxs(Pn,{children:[h===Ie.GOOGLE_BIGQUERY&&o.jsx(Ute,{}),h===Ie.AWS_ATHENA&&o.jsx(Fte,{})]}),o.jsx(on,{})]})})]}),h===Ie.GOOGLE_BIGQUERY&&o.jsx(Ote,{form:s}),h===Ie.AWS_ATHENA&&o.jsx(Pte,{form:s})]}),o.jsxs(Xl,{children:[o.jsx(Se,{variant:"default",type:"submit",className:"w-full","aria-label":"Save",disabled:!d||f,children:"Save"}),o.jsx(Se,{variant:"outline",type:"button",onClick:n,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function PO({isOpen:e,onClose:t,dataStorage:n,onSaveSuccess:r}){const{updateDataStorage:s}=Lg(),[l,c]=p.useState(!1),[d,f]=p.useState(!1),h=p.useCallback(()=>{d?c(!0):t()},[d,t]),g=p.useCallback(()=>{c(!1),f(!1),t()},[t]),y=p.useCallback(w=>{f(w)},[]),v=async w=>{if(n){const E=await s(n.id,w);E&&(r(E),t())}},b=p.useRef(!1);return p.useEffect(()=>{const w=n?"Edit":"Create";e&&!b.current?(Pe({event:"data_storage_config_open",category:"DataStorage",action:w,label:n==null?void 0:n.type}),b.current=!0):!e&&b.current&&(Pe({event:"data_storage_config_close",category:"DataStorage",action:w,label:n==null?void 0:n.type}),b.current=!1)},[e,n]),o.jsxs(o.Fragment,{children:[o.jsx(Li,{open:e,onOpenChange:w=>{w||h()},children:o.jsxs(Pi,{children:[o.jsxs(Ui,{children:[o.jsx(Fi,{children:"Configure Storage Provider"}),o.jsx(Gl,{children:"Customize settings for your storage provider"})]}),o.jsx(zte,{initialData:n??void 0,onSubmit:v,onCancel:h,onDirtyChange:y})]})}),o.jsx(Hr,{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 Vte=({dataStorage:e,onDataStorageChange:t})=>{const[n,r]=p.useState(!1),s=Bi.getInfo(e.type),l=()=>{r(!0)},c=()=>{r(!1)},d=()=>{if(!k4(e))return o.jsxs("div",{className:"flex items-center space-x-2 text-sm",children:[o.jsx(Qp,{className:"h-4 w-4 text-red-500"}),o.jsx("span",{className:"text-red-500",children:"Storage configuration is incomplete"})]});const h=(y,v)=>o.jsxs("span",{children:[o.jsxs("span",{className:"text-muted-foreground/75",children:[y,":"]})," ",o.jsx("span",{className:"text-muted-foreground font-medium",children:v})]}),g=(y,v,b)=>o.jsxs("span",{children:[o.jsxs("span",{className:"text-muted-foreground/75",children:[y,":"]})," ",o.jsx(or,{href:b,onClick:w=>{w.stopPropagation()},children:v})]});switch(e.type){case Ie.GOOGLE_BIGQUERY:{const y=e.config.projectId,v=e.config.location,b=`https://console.cloud.google.com/bigquery?project=${y}`;return o.jsxs("div",{className:"flex flex-wrap gap-2",children:[g("Project ID",y,b),o.jsx("span",{className:"text-muted-foreground",children:"•"}),h("Location",v)]})}case Ie.AWS_ATHENA:{const y=e.config.region,v=e.config.outputBucket,b=`https://s3.console.aws.amazon.com/s3/buckets/${v}?region=${y}`;return o.jsxs("div",{className:"flex flex-wrap gap-2",children:[h("Region",y),o.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Bucket",v,b)]})}default:return"Unknown storage type configuration"}};return o.jsxs(o.Fragment,{children:[o.jsx(tb,{title:e.title,icon:s.icon,subtitle:d(),onClick:l}),o.jsx(tS,{children:o.jsx(PO,{isOpen:n,onClose:c,dataStorage:e,onSaveSuccess:f=>{t&&t(f)}})})]})};function $te({initialType:e,onTypeSelect:t}){var c;const[n,r]=p.useState(e??null);p.useEffect(()=>{e!==void 0&&e!==n&&r(e)},[e,n]);const s=d=>{r(d),t(d)},l=[{type:Ue.SQL,label:"SQL",description:"SQL query"},{type:Ue.TABLE,label:"Table",description:"Existing table"},{type:Ue.VIEW,label:"View",description:"Existing view"},{type:Ue.TABLE_PATTERN,label:"Pattern",description:"Table pattern"},{type:Ue.CONNECTOR,label:"Connector",description:"Data import from Source to Storage"}];return o.jsxs("div",{className:"dm-card-block",children:[o.jsx(Ca,{className:"text-foreground",children:"Definition Type"}),o.jsxs(Ea,{value:n??"",onValueChange:d=>{s(d)},children:[o.jsx(Ra,{className:"dm-card-formcontrol w-full","aria-label":"Definition Type",children:o.jsx(wa,{placeholder:"Select definition type",children:n&&((c=l.find(d=>d.type===n))==null?void 0:c.label)})}),o.jsx(Ta,{children:o.jsx(kg,{children:l.map(d=>o.jsxs(Yn,{value:d.type,children:[d.label,o.jsx("span",{className:"text-muted-foreground/80 ml-2",children:d.description})]},d.type))})})]})]})}const Hte=an({definitionType:Ks(Ue.SQL),definition:an({sqlQuery:sn().min(1,"SQL query is required")})}),Bte=e=>{const t=J4(e);return an({definitionType:Ks(Ue.TABLE),definition:t})},Gte=e=>{const t=J4(e);return an({definitionType:Ks(Ue.VIEW),definition:t})},qte=e=>{const t=DK(e);return an({definitionType:Ks(Ue.TABLE_PATTERN),definition:t})},Zte=an({definitionType:Ks(Ue.CONNECTOR),definition:an({connector:an({source:an({name:sn().min(1,"Connector name is required"),configuration:gT(wG(CG())).min(1,"At least one configuration is required"),node:sn().min(1,"Node is required"),fields:gT(sn()).min(1,"At least one field is required")}),storage:an({fullyQualifiedName:sn().min(1,"fully qualified name is required")})})})}),Kte=(e,t)=>{if(!e)return an({definitionType:RG(x1(Ue)),definition:an({}).optional()});switch(e){case Ue.SQL:return Hte;case Ue.TABLE:return Bte(t);case Ue.VIEW:return Gte(t);case Ue.TABLE_PATTERN:return qte(t);case Ue.CONNECTOR:return Zte;default:return an({})}};function Yte({control:e}){return o.jsx(en,{control:e,name:"definition.sqlQuery",render:({field:t})=>o.jsxs(Vt,{className:"dm-card-block",children:[o.jsx($t,{className:"text-foreground",children:"SQL Query"}),o.jsx(Ht,{children:o.jsx(Pee,{initialValue:{sqlQuery:t.value},onChange:n=>{t.onChange(n.sqlQuery)}})}),o.jsx(on,{})]})})}function Wte({control:e,storageType:t}){const n=P4(t),r=U4(t);return o.jsx(en,{control:e,name:"definition.fullyQualifiedName",render:({field:s})=>o.jsxs(Vt,{className:"dm-card-block",children:[o.jsx($t,{children:"Fully Qualified Table Name"}),o.jsx(Ht,{children:o.jsx(zt,{placeholder:n,value:s.value||"",onChange:s.onChange,className:"dm-card-formcontrol"})}),o.jsx(Pn,{className:"text-muted-foreground/75",children:r}),o.jsx(on,{})]})})}function Qte({control:e,storageType:t}){const n=P4(t),r=U4(t);return o.jsx(en,{control:e,name:"definition.fullyQualifiedName",render:({field:s})=>o.jsxs(Vt,{className:"dm-card-block",children:[o.jsx($t,{children:"Fully Qualified View Name"}),o.jsx(Ht,{children:o.jsx(zt,{placeholder:n,value:s.value||"",onChange:s.onChange,className:"dm-card-formcontrol"})}),o.jsx(Pn,{className:"text-muted-foreground/75",children:r}),o.jsx(on,{})]})})}function Xte({control:e,storageType:t}){const n=kZ(t),r=LZ(t);return o.jsx(en,{control:e,name:"definition.pattern",render:({field:s})=>o.jsxs(Vt,{className:"dm-card-block",children:[o.jsx($t,{children:"Table Pattern"}),o.jsx(Ht,{children:o.jsx(zt,{placeholder:n,value:s.value||"",onChange:s.onChange,className:"dm-card-formcontrol"})}),o.jsx(Pn,{className:"text-muted-foreground/75",children:r}),o.jsx(on,{})]})})}const bS=e=>{switch(e){case Ue.SQL:return{sqlQuery:""};case Ue.TABLE:return{fullyQualifiedName:""};case Ue.VIEW:return{fullyQualifiedName:""};case Ue.TABLE_PATTERN:return{pattern:""};case Ue.CONNECTOR:return{connector:{source:{name:"",configuration:[],node:"",fields:[]},storage:{fullyQualifiedName:""}}};default:return{}}},Jte=Ef("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 SS({className:e,variant:t,...n}){return o.jsx("div",{"data-slot":"alert",role:"alert",className:ne(Jte({variant:t}),e),...n})}function UO({className:e,...t}){return o.jsx("div",{"data-slot":"alert-title",className:ne("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function CS({className:e,...t}){return o.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 ene({connectors:e,selectedConnector:t,loading:n,error:r,onConnectorSelect:s,onConnectorDoubleClick:l}){return n?o.jsx(lS,{variant:"grid"}):r?o.jsxs(SS,{variant:"destructive",children:[o.jsx(wf,{className:"h-4 w-4"}),o.jsx(CS,{children:"Failed to load available connectors. Please try again."})]}):o.jsxs(_o,{children:[o.jsx(wl,{title:"Choose Connector",children:o.jsx(XX,{children:e.map(c=>o.jsx(JX,{icon:c.logoBase64?o.jsx(_u,{base64:c.logoBase64,size:20}):null,title:c.displayName,selected:(t==null?void 0:t.name)===c.name,onClick:()=>{s(c)},onDoubleClick:()=>{s(c),l==null||l(c)}},c.name))})}),e.length===0&&o.jsx(Mi,{icon:o.jsx(of,{size:56,strokeWidth:1}),title:"No connectors available",subtitle:"Ask your administrator to configure connectors."})]})}function tne({currentStep:e,totalSteps:t,canGoNext:n,canGoBack:r,isLoading:s=!1,onNext:l,onBack:c,onFinish:d,nextLabel:f="Next",backLabel:h="Back",finishLabel:g="Save"}){const y=e===t;return t===1?o.jsx("div",{className:"w-full",children:o.jsx(Se,{className:"w-full",variant:"default",onClick:d,disabled:!n||s,children:g})}):o.jsxs("div",{className:"flex w-full items-center justify-between gap-4",children:[o.jsx("div",{className:"flex-1",children:r&&o.jsxs(Se,{variant:"outline",onClick:c,disabled:s,children:[o.jsx(j9,{className:"h-4 w-4"}),h]})}),o.jsxs("div",{className:"text-muted-foreground/75 px-4 text-sm",children:["Step ",e," of ",t]}),o.jsx("div",{className:"flex flex-1 justify-end",children:y?o.jsx(Se,{variant:"default",onClick:d,disabled:!n||s,children:g}):o.jsxs(Se,{variant:"default",onClick:l,disabled:!n||s,children:[f,o.jsx(ja,{className:"h-4 w-4"})]})})]})}function Tl({connector:e,size:t=24,variant:n="compact"}){return o.jsx(Mi,{icon:o.jsx(_u,{base64:e.logoBase64,size:t}),title:e.displayName,docUrl:e.docUrl,variant:n})}function su({label:e}){return o.jsx("div",{className:"border-border text-muted-foreground mt-3 flex items-center justify-center gap-2 border-t pt-3 text-sm",children:o.jsx(Se,{variant:"outline",asChild:!0,children:o.jsxs(Za,{to:"https://github.com/OWOX/owox-data-marts/issues",target:"_blank",rel:"noopener noreferrer",children:[e," Open issue here",o.jsx(_l,{className:"h-4 w-4"})]})})})}const ab="**********";function nne({specification:e,configuration:t,onValueChange:n}){const{name:r,title:s}=e,l=s??r,c=r;return o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(zt,{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"}),o.jsx(Ca,{htmlFor:c,className:"cursor-pointer text-sm",children:o.jsx(To,{htmlFor:c,required:e.required,tooltip:e.description,children:l})})]})}function rne({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:s}=e,l=e.title??e.name;return o.jsx(zt,{id:r,name:r,type:"number",value:t[r]||"",placeholder:s??`Enter ${l.toLowerCase()}`,onChange:c=>{const d=c.target.value,f=d===""?void 0:parseFloat(d);n(r,f)}})}function ane({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:s,default:l}=e,c=e.title??e.name;return o.jsx($i,{id:r,name:r,value:Array.isArray(t[r])?t[r].join(`
|
|
704
|
-
`):Array.isArray(l)?l.join(`
|
|
705
|
-
`):"",placeholder:s??`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 sne({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:s,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 o.jsx(zt,{id:r,name:r,type:"date",value:t[r]||d(l)||"",placeholder:s??`Enter ${c.toLowerCase()}`,onChange:f=>{n(r,f.target.value)}})}function one({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:s}=e,l=e.title??e.name;return o.jsx(zt,{id:r,name:r,type:"text",value:t[r]||"",placeholder:s??`Enter ${l.toLowerCase()}`,onChange:c=>{n(r,c.target.value)}})}function ine({specification:e,configuration:t,onValueChange:n}){const r=e.title??e.name,{name:s,placeholder:l,default:c}=e;return o.jsx($i,{id:s,name:s,value:t[s]&&typeof t[s]=="object"?JSON.stringify(t[s],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(s,f)}catch{n(s,d.target.value)}}})}function lne({specification:e,configuration:t,onValueChange:n,isEditingExisting:r,isSecretEditing:s}){const l=e.title??e.name,c=r&&!s;return o.jsx(zt,{id:e.name,...c?{}:{name:e.name},type:c?"password":"text",autoComplete:c?"new-password":"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,value:c?ab: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 cne({specification:e,configuration:t,onValueChange:n,specOptions:r}){const{name:s,placeholder:l,default:c}=e,d=e.title??e.name,f=r.map(h=>({value:h,label:h}));return o.jsx(xS,{options:f,value:t[s]||c||"",onValueChange:h=>{n(s,h)},placeholder:l??`Select ${d.toLowerCase()}`,emptyMessage:"No options available",className:"w-full"})}function FO({specification:e,configuration:t,onValueChange:n,flags:r}){const{requiredType:s,options:l}=e,{isSecret:c=!1,isEditingExisting:d=!1,isSecretEditing:f=!1}=r??{};if(c)return o.jsx(lne,{specification:e,configuration:t,onValueChange:n,isEditingExisting:d,isSecretEditing:f});if(l&&l.length>0)return o.jsx(cne,{specification:e,configuration:t,onValueChange:n,specOptions:l});switch(s){case os.BOOLEAN:return o.jsx(nne,{specification:e,configuration:t,onValueChange:n});case os.NUMBER:return o.jsx(rne,{specification:e,configuration:t,onValueChange:n});case os.ARRAY:return o.jsx(ane,{specification:e,configuration:t,onValueChange:n});case os.OBJECT:return o.jsx(ine,{specification:e,configuration:t,onValueChange:n});case os.DATE:return o.jsx(sne,{specification:e,configuration:t,onValueChange:n});case os.STRING:default:return o.jsx(one,{specification:e,configuration:t,onValueChange:n})}}function une({specification:e,configuration:t,isEditingExisting:n,isSecretEditing:r,isSecret:s,onValueChange:l,onSecretEditToggle:c}){return o.jsxs(Zd,{children:[e.requiredType!==os.BOOLEAN&&o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(To,{htmlFor:e.name,required:e.required,tooltip:e.description,children:e.title??e.name}),s&&n&&o.jsx(Se,{variant:"ghost",size:"sm",type:"button",onClick:()=>{c(e.name,!r)},children:r?"Cancel":"Edit"})]}),FO({specification:e,configuration:t,onValueChange:l,flags:{isSecret:s,isEditingExisting:n,isSecretEditing:r}})]},e.name)}function dne({specification:e,configuration:t,onValueChange:n,isEditingExisting:r,isSecretEditing:s,onSecretEditToggle:l}){const c=p.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]=p.useState(c);if(p.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 o.jsx(QX,{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=>o.jsx(FX,{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,E=typeof t[e.name]=="object"&&t[e.name]!==null?t[e.name]:{},S=typeof E[g.value]=="object"&&E[g.value]!==null?E[g.value]:{};return o.jsxs("div",{className:"mb-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(To,{htmlFor:y,required:v.required,tooltip:v.description,className:"mb-2 justify-start",children:y}),w&&r&&o.jsx(Se,{variant:"ghost",size:"sm",type:"button",onClick:()=>{l(e.name,!s)},children:s?"Cancel":"Edit"})]}),FO({specification:{...v,name:y},configuration:S,onValueChange:(R,T)=>{h(g.value,R,T)},flags:{isEditingExisting:r,isSecret:w,isSecretEditing:s}})]},y)})},g.value))},e.name)}function rj(e,t,n,r,s,l){return e.map(c=>{const d=Array.isArray(c.attributes)?c.attributes.includes("SECRET"):!1,f=s[c.name];return c.oneOf&&c.requiredType===os.OBJECT?o.jsx(dne,{specification:c,configuration:t,onValueChange:n,isEditingExisting:l,isSecretEditing:f,onSecretEditToggle:r},c.name):o.jsx(une,{specification:c,configuration:t,isEditingExisting:l,isSecret:d,isSecretEditing:f,onValueChange:n,onSecretEditToggle:r},c.name)})}function aj({collapsibleTitle:e,items:t,configuration:n,onValueChange:r,onSecretEditToggle:s,secretEditing:l,isEditingExisting:c}){return e?o.jsx($D,{title:e,children:rj(t,n,r,s,l,c)}):rj(t,n,r,s,l,c)}function fne({currentConnectorName:e,onCopyConfiguration:t,connectorSpecification:n}){const[r,s]=p.useState([]),[l,c]=p.useState(!1),[d,f]=p.useState(!1),h=p.useCallback(async()=>{c(!0);try{const v=await nn.getDataMartsByConnectorName(e);s(v)}catch{s([])}finally{c(!1)}},[e]);p.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=[],E=R=>{if(!n)return!0;const T=n.find(_=>_.name===R);return(T==null?void 0:T.required)??!1},S=(R,T,_=0,D=!0)=>{if(R.startsWith("_")||D&&_===0&&!E(R))return;let A=null;if(T==null)A="N/A";else if(typeof T=="string")A=T;else if(typeof T=="number"||typeof T=="boolean")A=String(T);else if(Array.isArray(T))A=JSON.stringify(T);else if(typeof T=="object"){w.push({key:R,value:"{",indent:_}),Object.entries(T).forEach(([O,j])=>{S(O,j,_+1,!1)}),w.push({key:"",value:"}",indent:_});return}else A=JSON.stringify(T);w.push({key:R,value:A,indent:_})};for(const[R,T]of Object.entries(v))S(R,T);return o.jsx("div",{className:"space-y-1 font-mono text-xs",children:w.map(({key:R,value:T,indent:_},D)=>o.jsxs("div",{className:"flex gap-2",style:{paddingLeft:`${String(_*12)}px`},children:[R&&o.jsxs("span",{className:"font-medium",children:[R,":"]}),o.jsx("span",{className:"text-muted-foreground truncate",title:T,children:T})]},D))})};return o.jsx(fs,{children:o.jsxs(wr,{open:d,onOpenChange:f,children:[o.jsx(Rr,{asChild:!0,children:o.jsxs(Se,{type:"button",variant:"ghost",size:"sm",className:"cursor-pointer",children:[o.jsx("span",{className:"text-muted-foreground/75 text-xs font-semibold tracking-wide uppercase",children:"Copy from…"}),o.jsx(ja,{className:ne("text-foreground/75 h-3.5 w-3.5 transition-transform duration-200",d&&"rotate-90")})]})}),o.jsx(Tr,{side:"bottom",align:"end",className:"w-72",children:l?o.jsx(vt,{disabled:!0,children:"Loading…"}):r.length===0?o.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 p-4 text-center",children:[o.jsx("div",{className:"bg-muted/70 rounded-full p-3",children:o.jsx(ML,{className:"text-muted-foreground h-6 w-6",strokeWidth:1.5})}),o.jsx("span",{className:"text-foreground text-sm font-medium",children:"No matching Data Marts"}),o.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."})]}):o.jsxs("div",{className:"flex flex-col gap-2",children:[o.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."}),o.jsx("div",{children:r.map(v=>{const w=v.definition.connector.source.configuration;return w.length===0?null:w.length===1?o.jsxs(St,{delayDuration:300,children:[o.jsx(Ct,{asChild:!0,children:o.jsxs(vt,{onSelect:()=>{g(v,w[0])},children:[o.jsx(ap,{className:"text-foreground h-4 w-4"}),v.title]})}),o.jsx(Et,{side:"right",className:"max-w-sm",children:y(w[0])})]},v.id):o.jsxs(o1,{children:[o.jsxs(i1,{className:"flex items-center gap-2",children:[o.jsx(ap,{className:"text-foreground h-4 w-4"}),o.jsx("span",{children:v.title})]}),o.jsx(l1,{children:w.map((E,S)=>o.jsxs(St,{delayDuration:300,children:[o.jsx(Ct,{asChild:!0,children:o.jsxs(vt,{onSelect:()=>{g(v,E)},children:["Configuration ",S+1]})}),o.jsx(Et,{side:"right",className:"max-w-sm",children:y(E)})]},S))})]},v.id)})})]})})]})})}function sj({connector:e,connectorSpecification:t,onConfigurationChange:n,onValidationChange:r,initialConfiguration:s,loading:l=!1,isEditingExisting:c=!1}){const[d,f]=p.useState({}),h=p.useRef(!1),g=p.useRef(!1),[y,v]=p.useState({});p.useEffect(()=>{if(t){g.current=!0;const O={...s??{}};t.forEach(j=>{const M=Array.isArray(j.attributes)?j.attributes.includes("SECRET"):!1;O[j.name]===void 0&&j.default!==void 0&&(O[j.name]=j.default),c&&M&&(O[j.name]=ab)}),f(O),h.current=!0,setTimeout(()=>{g.current=!1},0)}},[t,s,c]),p.useEffect(()=>{h.current&&s&&Object.keys(s).length>0&&(g.current=!0,f({...s}),setTimeout(()=>{g.current=!1},0))},[s]),p.useEffect(()=>{h.current&&!g.current&&Object.keys(d).length>0&&(n==null||n(d))},[d,n]);const b=(O,j)=>{f(M=>({...M,[O]:j}))},w=p.useCallback(O=>!(O==null||typeof O=="string"&&O.trim()===""||typeof O=="number"&&isNaN(O)||Array.isArray(O)&&O.length===0),[]),E=p.useCallback((O,j)=>{var F;if(typeof O!="object"||O===null)return w(O);const M=(F=j.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?E(O[G.value],Y):!1)):w(O[j.name])},[w]),S=p.useCallback((O,j)=>{const M=j.filter(Z=>Z.required&&Z.oneOf),F=M.length===0?!0:M.some(Z=>E(O[Z.name],Z)),Y=j.filter(Z=>Z.required&&Z.name!=="Fields").every(Z=>w(O[Z.name]));return F&&Y},[w,E]),R=(O,j)=>{v(M=>({...M,[O]:j})),f(j?M=>({...M,[O]:""}):M=>({...M,[O]:ab}))},T=O=>{const j={...d};Object.entries(O.configuration).forEach(([M,F])=>{["_id","_copiedFrom"].includes(M)||(j[M]=F)}),j._copiedFrom={dataMartId:O.dataMartId,dataMartTitle:O.dataMartTitle,configId:O.configId},f(j)};if(p.useEffect(()=>{if(t&&r){const O=S(d,t);r(O)}},[d,t,r,S]),l)return o.jsx(lS,{variant:"list"});if(!t||t.length===0)return o.jsxs(_o,{children:[o.jsx(Tl,{connector:e}),o.jsx(Mi,{icon:o.jsx(of,{size:56,strokeWidth:1}),title:"No configuration found",subtitle:"This connector might not be fully implemented yet or there could be other issues."}),o.jsx(su,{label:"Need configuration?"})]});const _=[...t].filter(O=>{var j;return O.name!=="Fields"&&!((j=O.attributes)!=null&&j.includes("HIDE_IN_CONFIG_FORM"))}).sort((O,j)=>{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(j)}),D=_.filter(O=>{var j;return!((j=O.attributes)!=null&&j.includes("ADVANCED"))}),A=_.filter(O=>{var j;return(j=O.attributes)==null?void 0:j.includes("ADVANCED")});return o.jsx(o.Fragment,{children:o.jsxs(_o,{children:[o.jsx(Tl,{connector:e}),o.jsxs(wl,{children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h3",{className:"text-muted-foreground/75 text-xs font-semibold tracking-wide uppercase",children:"Configure Settings"}),o.jsx(fne,{currentConnectorName:e.name,onCopyConfiguration:T,connectorSpecification:t})]}),D.length>0&&o.jsx(aj,{items:D,configuration:d,onValueChange:b,onSecretEditToggle:R,secretEditing:y,isEditingExisting:c}),A.length>0&&o.jsx(aj,{collapsibleTitle:"Advanced Settings",items:A,configuration:d,onValueChange:b,onSecretEditToggle:R,secretEditing:y,isEditingExisting:c})]})]})})}function hne({connector:e,connectorFields:t,selectedField:n,connectorName:r,loading:s=!1,onFieldSelect:l}){const c=r?`Select data for ${r}`:"Select data";return s?o.jsx(lS,{variant:"list"}):!t||t.length===0?o.jsxs(_o,{children:[o.jsx(Tl,{connector:e}),o.jsx(Mi,{icon:o.jsx(of,{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."}),o.jsx(su,{label:"Missing some data?"})]}):o.jsxs(_o,{children:[o.jsx(Tl,{connector:e}),o.jsxs(wl,{title:c,children:[t.map(d=>o.jsx(HD,{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&&o.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[o.jsxs("p",{children:[o.jsx("span",{className:"font-semibold",children:"Table name:"})," ",d.destinationName??d.name]}),d.description&&o.jsxs("p",{children:[o.jsx("span",{className:"font-semibold",children:"Description:"})," ",d.description]}),d.documentation&&o.jsxs(Za,{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",o.jsx(ja,{className:"h-3 w-3"})]})]}),selected:n===d.name},d.name)),o.jsx(su,{label:"Missing some data?"})]})]})}var Ds=(e=>(e.ASC="asc",e.DESC="desc",e.ORIGINAL="original",e))(Ds||{});function oj({connector:e,connectorFields:t,selectedField:n,selectedFields:r,onFieldToggle:s}){const l=p.useRef(null),[c,d]=p.useState(""),[f,h]=p.useState(Ds.ORIGINAL),g=t==null?void 0:t.find(R=>R.name===n),y=p.useMemo(()=>(g==null?void 0:g.fields)??[],[g==null?void 0:g.fields]),v=p.useMemo(()=>(g==null?void 0:g.uniqueKeys)??[],[g==null?void 0:g.uniqueKeys]),b=p.useMemo(()=>{const R=new Map;return y.forEach((T,_)=>R.set(T.name,_)),R},[y]),w=p.useMemo(()=>{const R=y.filter(_=>_.name.toLowerCase().includes(c.toLowerCase().trim())),T=(_,D)=>{const A=v.includes(_.name),O=v.includes(D.name);if(A&&!O)return-1;if(!A&&O)return 1;if(f===Ds.ASC)return _.name.localeCompare(D.name);if(f===Ds.DESC)return D.name.localeCompare(_.name);const j=b.get(_.name)??0,M=b.get(D.name)??0;return j-M};return[...R].sort(T)},[y,c,v,f,b]),E=y.map(R=>R.name),S=r.filter(R=>E.includes(R)).length;return p.useEffect(()=>{if(v.length>0){const R=v.filter(T=>y.some(_=>_.name===T)&&!r.includes(T));R.length>0&&R.forEach(T=>{s(T,!0)})}},[n,v,y,r,s]),p.useEffect(()=>{const R=T=>{const D=(T.ctrlKey||T.metaKey)&&T.shiftKey&&T.key.toLowerCase()==="a",A=document.activeElement.tagName;if(!(A==="INPUT"||A==="TEXTAREA")&&D){T.preventDefault();const O=y.map(F=>F.name),M=O.filter(F=>!r.includes(F)).length>0;O.forEach(F=>{s(F,M)})}};return window.addEventListener("keydown",R),()=>{window.removeEventListener("keydown",R)}},[y,r,s]),!n||!t?o.jsxs(_o,{children:[o.jsx(Tl,{connector:e}),o.jsx(Mi,{icon:o.jsx(of,{size:56,strokeWidth:1}),title:"No fields found",subtitle:"This connector might not be fully implemented yet or there could be other issues."}),o.jsx(su,{label:"Need fields?"})]}):y.length?o.jsx(_o,{children:o.jsxs(o.Fragment,{children:[o.jsx(Tl,{connector:e}),o.jsxs("div",{className:"border-border -mt-6 mb-6 flex w-full items-center gap-2 border-b",children:[o.jsxs("div",{className:"relative flex-1",children:[o.jsx($l,{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()}}),o.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&&o.jsx("button",{type:"button",onClick:()=>{d("")},className:"text-muted-foreground hover:text-foreground absolute top-1/2 right-0 -translate-y-1/2",children:o.jsx(cu,{className:"h-4 w-4"})})]}),o.jsxs(wr,{children:[o.jsx(Rr,{asChild:!0,children:o.jsxs(Se,{variant:"ghost",size:"icon","aria-label":"Sort fields",children:[f===Ds.ASC&&o.jsx(sR,{className:"text-muted-foreground h-4 w-4"}),f===Ds.DESC&&o.jsx(aR,{className:"text-muted-foreground h-4 w-4"}),f===Ds.ORIGINAL&&o.jsx(oR,{className:"text-muted-foreground h-4 w-4"})]})}),o.jsxs(Tr,{align:"end",children:[o.jsxs(vt,{onSelect:()=>{h(Ds.ASC)},children:[o.jsx(sR,{className:"text-muted-foreground mr-2 h-4 w-4"}),"A–Z"]}),o.jsxs(vt,{onSelect:()=>{h(Ds.DESC)},children:[o.jsx(aR,{className:"text-muted-foreground mr-2 h-4 w-4"}),"Z–A"]}),o.jsxs(vt,{onSelect:()=>{h(Ds.ORIGINAL)},children:[o.jsx(oR,{className:"text-muted-foreground mr-2 h-4 w-4"}),"Original"]})]})]})]}),o.jsxs(wl,{title:`Selected ${String(S)} of ${String(E.length)} fields for "${n}" data`,children:[w.map(R=>{const T=v.includes(R.name);return o.jsx(HD,{type:"checkbox",id:`field-${R.name}`,name:"selectedFields",value:R.name,checked:r.includes(R.name),selected:r.includes(R.name)||T,disabled:T,onChange:_=>{s(R.name,_)},label:R.name,tooltip:o.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[T&&o.jsxs("p",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"font-semibold",children:"Unique key"})," ",o.jsx(m0,{className:"text-secondary h-3 w-3"})]}),o.jsxs("p",{children:[o.jsx("span",{className:"font-semibold",children:"Type:"})," ",R.type]}),R.description&&o.jsxs("p",{children:[o.jsx("span",{className:"font-semibold",children:"Description:"})," ",R.description]})]}),rightIcon:T?o.jsx(m0,{className:"text-muted-foreground/75 h-4 w-4"}):void 0},R.name)}),w.length===0&&c&&o.jsxs("div",{className:"text-muted-foreground pt-8 pb-4 text-center text-sm",children:['No fields match "',c,'"']}),o.jsx(su,{label:"Need another field?"})]})]})}):o.jsxs(_o,{children:[o.jsx(Tl,{connector:e}),o.jsx(Mi,{icon:o.jsx(of,{size:56,strokeWidth:1}),title:"No fields found",subtitle:"This connector might not be fully implemented yet or there could be other issues."}),o.jsx(su,{label:"Need fields?"})]})}const zO=p.createContext(void 0),VO={triggers:[],selectedTrigger:null,isLoading:!1,error:null};function mne(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 VO;default:return e}}class pne extends Zl{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 Vc=new pne;var vn=(e=>(e.REPORT_RUN="REPORT_RUN",e.CONNECTOR_RUN="CONNECTOR_RUN",e))(vn||{});const Qc={SCHEDULED_REPORT_RUN:"scheduled-report-run-config"};class sb{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!==vn.REPORT_RUN)return t;const n=t.triggerConfig;if(!n.reportId)return t;try{const r=await Co.getReportById(n.reportId),s=gl(r);return{...t,triggerConfig:{...n,report:s}}}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:vn.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 gne{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:vn.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 Xx={getMapper(e){switch(e){case vn.REPORT_RUN:return new sb;case vn.CONNECTOR_RUN:return new gne;default:throw new Error(`Unknown scheduled trigger type: ${String(e)}`)}}},zd={mapFromDto(e){return Xx.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 vn.REPORT_RUN:return new sb().enhanceWithReportData(n);case vn.CONNECTOR_RUN:{const r=t.definition;return{...n,triggerConfig:{...n.triggerConfig,connector:r}}}default:return n}},async mapFromDtoListWithReportData(e,t){const n=new sb,r=this.mapFromDtoList(e),s=r.filter(c=>c.type===vn.REPORT_RUN),l=await n.enhanceTriggersWithReportData(s);return r.map(c=>{switch(c.type){case vn.REPORT_RUN:return l.find(d=>d.id===c.id)??c;case vn.CONNECTOR_RUN:{const d=t.definition;return{...c,triggerConfig:{...c.triggerConfig,connector:d}}}default:return c}})},mapToCreateRequest(e){return Xx.getMapper(e.type).mapToCreateRequest(e)},mapToUpdateRequest(e){return Xx.getMapper(e.type).mapToUpdateRequest(e)}};function yne({children:e}){const[t,n]=p.useReducer(mne,VO),{dataMart:r}=Fo(),{fetchAvailableConnectors:s}=Yl();if(!r)throw new Error("Trigger provider must be used within a data mart context");const l=p.useCallback(async b=>{await s(),n({type:"FETCH_TRIGGERS_START"});try{const w=await Vc.getScheduledTriggers(b),E=await zd.mapFromDtoListWithReportData(w,r);n({type:"FETCH_TRIGGERS_SUCCESS",payload:E})}catch(w){const E=w instanceof Error?w.message:"Failed to fetch scheduled triggers";n({type:"FETCH_TRIGGERS_ERROR",payload:E}),Pe({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"ListError",label:E})}},[r,s]),c=p.useCallback(async(b,w)=>{n({type:"FETCH_TRIGGERS_START"});try{const S=(await Vc.getScheduledTriggers(b)).filter(T=>T.type===w),R=await zd.mapFromDtoListWithReportData(S,r);n({type:"FETCH_TRIGGERS_SUCCESS",payload:R})}catch(E){const S=E instanceof Error?E.message:"Failed to fetch scheduled triggers";n({type:"FETCH_TRIGGERS_ERROR",payload:S}),Pe({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"ListError",label:S})}},[r]),d=p.useCallback(async(b,w)=>{n({type:"FETCH_TRIGGER_START"});try{const E=await Vc.getScheduledTrigger(b,w),S=await zd.mapFromDtoWithReportData(E,r);n({type:"FETCH_TRIGGER_SUCCESS",payload:S})}catch(E){const S=E instanceof Error?E.message:"Failed to fetch scheduled trigger";n({type:"FETCH_TRIGGER_ERROR",payload:S}),Pe({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"GetError",label:S})}},[r]),f=p.useCallback(async(b,w,E,S,R,T)=>{n({type:"CREATE_TRIGGER_START"});try{const _={type:w,cronExpression:E,timeZone:S,isActive:R,triggerConfig:T},D=await Vc.createScheduledTrigger(b,_),A=await zd.mapFromDtoWithReportData(D,r);return n({type:"CREATE_TRIGGER_SUCCESS",payload:A}),Pe({event:"scheduled_trigger_created",category:"ScheduledTrigger",action:"Create",label:w}),rn.success("Trigger created"),A}catch(_){const D=_ instanceof Error?_.message:"Failed to create scheduled trigger";throw n({type:"CREATE_TRIGGER_ERROR",payload:D}),Pe({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"CreateError",label:D}),_}},[r]),h=p.useCallback(async(b,w,E,S,R)=>{n({type:"UPDATE_TRIGGER_START"});try{const T={cronExpression:E,timeZone:S,isActive:R},_=await Vc.updateScheduledTrigger(b,w,T),D=await zd.mapFromDtoWithReportData(_,r);n({type:"UPDATE_TRIGGER_SUCCESS",payload:D}),Pe({event:"scheduled_trigger_updated",category:"ScheduledTrigger",action:"Update",label:D.type}),rn.success("Trigger updated")}catch(T){const _=T instanceof Error?T.message:"Failed to update scheduled trigger";throw n({type:"UPDATE_TRIGGER_ERROR",payload:_}),Pe({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"UpdateError",label:_}),T}},[r]),g=p.useCallback(async(b,w)=>{n({type:"DELETE_TRIGGER_START"});try{await Vc.deleteScheduledTrigger(b,w),n({type:"DELETE_TRIGGER_SUCCESS",payload:w}),Pe({event:"scheduled_trigger_deleted",category:"ScheduledTrigger",action:"Delete",label:w}),rn.success("Trigger deleted")}catch(E){const S=E instanceof Error?E.message:"Failed to delete scheduled trigger";throw n({type:"DELETE_TRIGGER_ERROR",payload:S}),Pe({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"DeleteError",label:S}),E}},[]),y=p.useCallback(b=>{n({type:"SELECT_TRIGGER",payload:b})},[]),v=p.useCallback(()=>{n({type:"RESET"})},[]);return o.jsx(zO.Provider,{value:{...t,getScheduledTriggers:l,getScheduledTriggersByType:c,getScheduledTrigger:d,createScheduledTrigger:f,updateScheduledTrigger:h,deleteScheduledTrigger:g,selectScheduledTrigger:y,reset:v},children:e})}function $O(){const e=p.useContext(zO);if(e===void 0)throw new Error("useScheduledTriggerContext must be used within a ScheduledTriggerProvider");return e}function vne(e){const{getScheduledTriggers:t,getScheduledTriggersByType:n,getScheduledTrigger:r,createScheduledTrigger:s,updateScheduledTrigger:l,deleteScheduledTrigger:c,selectScheduledTrigger:d,reset:f,triggers:h,selectedTrigger:g,isLoading:y,error:v}=$O();return p.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,E,S,R,T)=>s(b,w,E,S,R,T),updateScheduledTrigger:(b,w,E,S,R)=>l(b,w,E,S,R),deleteScheduledTrigger:(b,w)=>c(b,w),selectScheduledTrigger:d}}const xne=an({type:Ks(Qc.SCHEDULED_REPORT_RUN),reportId:sn().min(1,"Report ID is required")}),bne=SG(),Sne=an({type:x1(vn),cronExpression:sn().min(1,"Cron expression is required"),timeZone:sn().min(1,"Time zone is required"),isActive:bG(),triggerConfig:EG([xne,bne])});function Cne({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:r}){const s=Gi({resolver:Jl(Sne),defaultValues:{type:e?e.type:n??vn.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:Qc.SCHEDULED_REPORT_RUN,reportId:t??""}}});p.useEffect(()=>{t&&s.getValues("type")===vn.REPORT_RUN&&s.setValue("triggerConfig",{type:Qc.SCHEDULED_REPORT_RUN,reportId:t})},[t,s]),p.useEffect(()=>{n&&(s.setValue("type",n),n===vn.REPORT_RUN?s.setValue("triggerConfig",{type:Qc.SCHEDULED_REPORT_RUN,reportId:t??""}):s.setValue("triggerConfig",null))},[n,t,s]);const l=d=>{s.setValue("type",d),d===vn.REPORT_RUN?s.setValue("triggerConfig",{type:Qc.SCHEDULED_REPORT_RUN,reportId:t??""}):s.setValue("triggerConfig",null)},c=async d=>{try{await r(d)}catch(f){console.error("Error submitting form:",f)}};return{form:s,handleTypeChange:l,handleSubmit:s.handleSubmit(c),isDirty:s.formState.isDirty}}function Ene({value:e,onChange:t,disabled:n}){const{reports:r,fetchReportsByDataMartId:s}=Kl(),{dataMart:l}=Fo();p.useEffect(()=>{l&&s(l.id)},[s,l]);const c=r.filter(d=>d.dataDestination.type===Dt.GOOGLE_SHEETS);return o.jsxs(Ea,{value:e,onValueChange:t,disabled:n,children:[o.jsx(Ra,{className:"w-full",children:o.jsx(wa,{placeholder:"Select a report"})}),o.jsx(Ta,{children:c.map(d=>o.jsx(Yn,{value:d.id,children:d.title},d.id))})]})}var Gg="Switch",[wne]=ir(Gg),[Rne,Tne]=wne(Gg),HO=p.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:l,required:c,disabled:d,value:f="on",onCheckedChange:h,form:g,...y}=e,[v,b]=p.useState(null),w=ut(t,_=>b(_)),E=p.useRef(!1),S=v?g||!!v.closest("form"):!0,[R,T]=Vr({prop:s,defaultProp:l??!1,onChange:h,caller:Gg});return o.jsxs(Rne,{scope:n,checked:R,disabled:d,children:[o.jsx(Je.button,{type:"button",role:"switch","aria-checked":R,"aria-required":c,"data-state":ZO(R),"data-disabled":d?"":void 0,disabled:d,value:f,...y,ref:w,onClick:Te(e.onClick,_=>{T(D=>!D),S&&(E.current=_.isPropagationStopped(),E.current||_.stopPropagation())})}),S&&o.jsx(qO,{control:v,bubbles:!E.current,name:r,value:f,checked:R,required:c,disabled:d,form:g,style:{transform:"translateX(-100%)"}})]})});HO.displayName=Gg;var BO="SwitchThumb",GO=p.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=Tne(BO,n);return o.jsx(Je.span,{"data-state":ZO(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});GO.displayName=BO;var jne="SwitchBubbleInput",qO=p.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...s},l)=>{const c=p.useRef(null),d=ut(c,l),f=J1(n),h=Zb(t);return p.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]),o.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:d,style:{...s.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});qO.displayName=jne;function ZO(e){return e?"checked":"unchecked"}var _ne=HO,Nne=GO;function KO({className:e,...t}){return o.jsx(_ne,{"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:o.jsx(Nne,{"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 Ane(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 ob(e,t="UTC"){const n=Ane(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:s,day:l,month:c,dayOfWeek:d}=n;if(r.startsWith("*/")&&s==="*"&&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!=="*"&&s.startsWith("*/")&&l==="*"&&c==="*"&&d==="*"){const y=Number.parseInt(s.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(s),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 YO({options:e,selected:t,onSelectionChange:n,placeholder:r="Select items...",searchPlaceholder:s="Search...",maxDisplayItems:l=3}){const[c,d]=p.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 o.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?o.jsx("div",{className:"flex flex-wrap gap-1",children:y.map(v=>o.jsxs(br,{variant:"secondary",className:"h-5 text-xs",children:[v.label,o.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:o.jsx(cu,{className:"h-2 w-2"})})]},v.value))}):o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsxs(br,{variant:"secondary",className:"h-5 text-xs",children:[y[0].label,o.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:o.jsx(cu,{className:"h-2 w-2"})})]}),y.length>1&&o.jsxs(br,{variant:"outline",className:"h-5 text-xs",children:["+",y.length-1]})]})};return o.jsxs(gS,{open:c,onOpenChange:d,modal:!0,children:[o.jsx(yS,{asChild:!0,children:o.jsxs(Se,{variant:"outline",role:"combobox","aria-expanded":c,className:"h-9 min-h-9 w-full justify-between bg-transparent py-1",children:[o.jsx("div",{className:"flex-1 text-left",children:g()}),o.jsx(Nb,{className:"ml-2 h-3 w-3 shrink-0 opacity-50"})]})}),o.jsx(vS,{className:"max-h-[400px] w-full overflow-y-auto p-0",style:{padding:0},children:o.jsxs(bO,{className:"h-full overflow-visible",children:[o.jsx(SO,{placeholder:s,className:"h-8"}),o.jsxs(lte,{className:"h-full max-h-[350px] overflow-y-auto",children:[o.jsx(CO,{children:"No items found."}),o.jsx(EO,{className:"h-full overflow-visible",children:e.map(y=>o.jsxs(wO,{value:y.value.toString(),onSelect:()=>f(y.value),className:"text-sm",children:[o.jsx(fr,{className:ne("mr-2 h-3 w-3",t.includes(y.value)?"opacity-100":"opacity-0")}),y.label]},y.value))})]})]})})]})}const WO=[{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"}],Lm=()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return"UTC"}};function QO(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(s=>{var l;return(l=WO.find(c=>c.value===s))==null?void 0:l.label}).join(", ")} at ${n}`;case"monthly":{const s=[...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 ${s.length===1?s[0]:s.length===2?`${s[0]} and ${s[1]}`:`${s.slice(0,-1).join(", ")}, and ${s[s.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 Dne(e,t,n=!0){const r=ob(e,t);return QO(r,n)}const One=Array.from({length:31},(e,t)=>({value:t+1,label:`${String(t+1)}${t===0?"st":t===1?"nd":t===2?"rd":"th"}`})),ib=[5,10,15,30],lb=[1,2,3,4,6,8,12],Mne=({value:e,onChange:t,disabled:n})=>o.jsxs("div",{className:"space-y-2",children:[o.jsx(Ca,{children:"Type"}),o.jsxs(Ea,{value:e,onValueChange:r=>{t(r)},disabled:n,children:[o.jsx(Ra,{className:"w-full",children:o.jsx(wa,{})}),o.jsxs(Ta,{children:[o.jsx(Yn,{value:"daily",children:"Daily"}),o.jsx(Yn,{value:"weekly",children:"Weekly"}),o.jsx(Yn,{value:"monthly",children:"Monthly"}),o.jsx(Yn,{value:"interval",children:"Interval"})]})]})]}),Ine=({value:e,onChange:t,disabled:n})=>o.jsxs("div",{className:"space-y-2",children:[o.jsx(Ca,{children:"Time"}),o.jsx("div",{className:"flex items-center gap-2",children:o.jsx(zt,{className:"w-24",type:"time",value:e,onChange:r=>{t(r.target.value)},disabled:n})})]}),ij=({value:e,onChange:t,disabled:n,timezones:r})=>o.jsxs("div",{className:"w-full space-y-2",children:[o.jsx(Ca,{children:"Timezone"}),o.jsx("div",{className:"flex items-center gap-2",children:o.jsx(xS,{options:r,value:e,onValueChange:t,placeholder:"Select timezone",emptyMessage:"No timezones found",disabled:n,className:"w-full"})})]}),kne=({value:e,onChange:t,disabled:n})=>o.jsxs("div",{className:"space-y-2",children:[o.jsx(Ca,{children:"Days of Week"}),o.jsx("div",{className:n?"pointer-events-none":"",children:o.jsx(YO,{options:WO,selected:e,onSelectionChange:t,placeholder:"Select days...",maxDisplayItems:3})})]}),Lne=({value:e,onChange:t,disabled:n})=>o.jsxs("div",{className:"space-y-2",children:[o.jsx(Ca,{children:"Days of Month"}),o.jsx("div",{className:n?"pointer-events-none":"",children:o.jsx(YO,{options:One,selected:e,onSelectionChange:t,placeholder:"Select days...",maxDisplayItems:4})})]}),Pne=({intervalType:e,intervalValue:t,onTypeChange:n,onValueChange:r,disabled:s})=>o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(Ca,{children:"Type"}),o.jsxs(Ea,{value:e,onValueChange:l=>{n(l)},disabled:s,children:[o.jsx(Ra,{className:"w-full",children:o.jsx(wa,{})}),o.jsxs(Ta,{children:[o.jsx(Yn,{value:"minutes",children:"Minutes"}),o.jsx(Yn,{value:"hours",children:"Hours"})]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Ca,{children:"Every"}),o.jsxs(Ea,{value:t.toString(),onValueChange:l=>{r(Number.parseInt(l)||1)},disabled:s,children:[o.jsx(Ra,{className:"w-full",children:o.jsx(wa,{})}),o.jsx(Ta,{children:(e==="minutes"?ib:lb).map(l=>o.jsxs(Yn,{value:l.toString(),children:[l," ",e==="minutes"?"min":"hr"]},l))})]})]})]}),Une=({value:e,onChange:t,disabled:n})=>o.jsxs("div",{className:"space-y-1",children:[o.jsx(Ca,{className:"text-sm",children:"Cron Expression"}),o.jsx(zt,{value:e,onChange:r=>{t(r.target.value)},placeholder:"0 9 * * *",className:"h-9 font-mono text-sm",disabled:n}),o.jsx("p",{className:"text-muted-foreground text-xs",children:"Format: minute hour day month day-of-week"})]});function Fne({cron:e="0 9 * * *",timezone:t,enabled:n=!0,onChange:r,className:s,showPreview:l=!0,showSaveButton:c=!1}){const[d,f]=p.useState(n),[h,g]=p.useState(t??Lm()),[y,v]=p.useState(!1),b=p.useMemo(()=>qq.getTimezonesWithOffset().map($=>({value:$.identifier,label:$.displayName,offset:$.offsetString,isDST:$.isDST})),[]),[w,E]=p.useState(()=>ob(e,h)),[S,R]=p.useState(""),[T,_]=p.useState("");p.useEffect(()=>{f(n)},[n]),p.useEffect(()=>{const $=t??Lm();g($)},[t]),p.useEffect(()=>{if(e){const $=ob(e,h);E($)}},[e,h]);const D=$=>{const[W,k]=$.time.split(":").map(Number);switch($.type){case"daily":return`${String(k)} ${String(W)} * * *`;case"weekly":return`${String(k)} ${String(W)} * * ${$.weekdays.join(",")}`;case"monthly":return`${String(k)} ${String(W)} ${$.monthDays.join(",")} * *`;case"interval":return $.intervalType==="minutes"?`*/${String($.intervalValue)} * * * *`:`0 */${String($.intervalValue)} * * *`;case"custom":return $.customCron;default:return`${String(k)} ${String(W)} * * *`}},A=p.useCallback($=>{E(W=>{if(W.intervalType===$)return console.log("Type unchanged, skipping update"),W;const H=($==="minutes"?ib:lb)[0];return{...W,intervalType:$,intervalValue:H}})},[]),O=p.useCallback($=>{E(W=>(W.intervalType==="minutes"?ib:lb).includes($)?{...W,intervalValue:$}:W)},[]),j=p.useMemo(()=>$=>QO($,d),[d]);p.useEffect(()=>{const $=D(w);R($),_(j(w))},[w,d,h,j]);const M=p.useRef(""),F=p.useRef(""),G=p.useRef(!1);p.useEffect(()=>{const $=D(w);r&&(M.current!==$||F.current!==h||G.current!==d)&&(r({cron:$,timezone:h,enabled:d}),M.current=$,F.current=h,G.current=d)},[w,h,d,r]);const Y=$=>{f($)},Z=$=>{g($),E(W=>({...W,timezone:$}))},ee=["daily","weekly","monthly"].includes(w.type);return o.jsxs("div",{className:s,children:[o.jsx("div",{className:"mb-4 space-y-4 pt-0",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h3",{className:"text-foreground flex items-center gap-1.5 font-medium",children:"Schedule Settings"}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Ca,{htmlFor:"schedule-enabled",className:"text-sm font-normal",children:d?"Enabled":"Disabled"}),o.jsx(KO,{id:"schedule-enabled",checked:d,onCheckedChange:Y})]})]})}),o.jsxs("div",{className:"space-y-4 pt-0",children:[o.jsxs("div",{className:`space-y-4 ${d?"":"opacity-50"}`,children:[o.jsx(Mne,{value:w.type,onChange:$=>{E(W=>({...W,type:$}))},disabled:!d}),w.type!=="custom"&&w.type!=="interval"&&o.jsxs("div",{className:"flex gap-3",children:[o.jsx(Ine,{value:w.time,onChange:$=>{E(W=>({...W,time:$}))},disabled:!d}),ee&&o.jsx(ij,{value:h,onChange:Z,disabled:!d,timezones:b})]}),(w.type==="interval"||w.type==="custom")&&o.jsx(ij,{value:h,onChange:Z,disabled:!d,timezones:b}),w.type==="weekly"&&o.jsx(kne,{value:w.weekdays,onChange:$=>{E(W=>({...W,weekdays:$}))},disabled:!d}),w.type==="monthly"&&o.jsx(Lne,{value:w.monthDays,onChange:$=>{E(W=>({...W,monthDays:$}))},disabled:!d}),w.type==="interval"&&o.jsx(Pne,{intervalType:w.intervalType,intervalValue:w.intervalValue,onTypeChange:A,onValueChange:O,disabled:!d}),w.type==="custom"&&o.jsx(Une,{value:w.customCron,onChange:$=>{E(W=>({...W,customCron:$}))},disabled:!d})]}),l&&o.jsxs(o.Fragment,{children:[o.jsx(__,{className:"my-3"}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex cursor-pointer items-center justify-between",onClick:()=>{v(!y)},children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(h_,{className:"h-4 w-4"}),o.jsx("span",{className:"text-sm font-medium",children:"Preview"})]}),y?o.jsx(zs,{className:"text-muted-foreground h-4 w-4"}):o.jsx(Qa,{className:"text-muted-foreground h-4 w-4"})]}),y&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"Status:"}),o.jsx(br,{variant:d?"default":"secondary",className:"text-xs",children:d?"Enabled":"Disabled"})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"Cron:"}),o.jsx(br,{variant:"secondary",className:"font-mono text-xs",children:S})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"Timezone:"}),o.jsx(br,{variant:"outline",className:"text-xs",children:h})]}),o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"Schedule:"}),o.jsx("span",{className:"flex-1 text-right text-xs",children:T})]})]}),d&&ee&&h!==Lm()&&o.jsxs(SS,{className:"border-amber-200 bg-amber-50",children:[o.jsx(wf,{className:"h-4 w-4"}),o.jsx(UO,{children:"Time Zone"}),o.jsxs(CS,{children:["Schedule runs in ",h," (not your local ",Lm()," ","time). Execution time may differ from expected."]})]})]})]})]}),c&&o.jsx(Se,{className:"w-full",disabled:!d,children:"Save Schedule"})]})]})}function zne(){return o.jsx(lr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Un,{value:"trigger-type-options-description-details",children:[o.jsx(Fn,{children:"How do I choose a type?"}),o.jsxs(zn,{children:[o.jsxs("p",{className:"mb-2",children:[o.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)."]}),o.jsxs("p",{className:"mb-2",children:[o.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 Vne(){return o.jsx(lr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Un,{value:"trigger-type-change-description-details",children:[o.jsx(Fn,{children:"How do I change the trigger type?"}),o.jsx(zn,{children:o.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 $ne(){return o.jsx(lr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Un,{value:"report-change-description-details",children:[o.jsx(Fn,{children:"How do I change a report?"}),o.jsx(zn,{children:o.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 Hne(){return o.jsx(lr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Un,{value:"report-select-description-details",children:[o.jsx(Fn,{children:"How do I choose the report?"}),o.jsxs(zn,{children:[o.jsx("p",{className:"mb-2",children:"For a Report Run trigger, select one of the available Destinations (e.g., a Google Sheets report)."}),o.jsxs("p",{children:["You can use an existing one or create a new one on the ",o.jsx("strong",{children:"Destinations"})," tab"," ","of this Data Mart."]})]})]})})}function Bne({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:r,onCancel:s,onDirtyChange:l}){const[c,d]=p.useState(!1),{form:f,handleTypeChange:h,handleSubmit:g,isDirty:y}=Cne({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:async S=>{d(!0);try{await r(S)}finally{d(!1)}}});p.useEffect(()=>{l==null||l(y)},[y,l]);const{control:v,watch:b}=f,E=b("type")===vn.REPORT_RUN;return o.jsx(Wl,{...f,children:o.jsxs(qi,{onSubmit:S=>void g(S),noValidate:!1,children:[o.jsxs(Ql,{children:[o.jsx(en,{control:v,name:"type",render:({field:S})=>o.jsxs(Vt,{children:[o.jsx($t,{tooltip:"Choose what you want this trigger to run - a report or a connector",children:"Trigger Type"}),o.jsxs(Ea,{onValueChange:R=>{S.onChange(R),h(R)},defaultValue:S.value,disabled:!!n||!!e||!!b("triggerConfig.reportId"),children:[o.jsx(Ht,{children:o.jsx(Ra,{className:"w-full",children:o.jsx(wa,{placeholder:"Select trigger type"})})}),o.jsxs(Ta,{children:[o.jsx(Yn,{value:vn.REPORT_RUN,children:"Report Run"}),o.jsx(Yn,{value:vn.CONNECTOR_RUN,children:"Connector Run"})]})]}),o.jsx(Pn,{children:e?o.jsx(Vne,{}):o.jsx(zne,{})}),o.jsx(on,{})]})}),E&&o.jsx(en,{control:v,name:"triggerConfig.reportId",render:({field:S})=>o.jsxs(Vt,{children:[o.jsx($t,{tooltip:"Select the report that will be run by this trigger",children:"Report"}),o.jsx(Ht,{children:o.jsx($4,{children:o.jsx(Ene,{value:S.value,onChange:S.onChange,disabled:!!t||!!e})})}),o.jsx(Pn,{children:e!=null&&e.triggerConfig?o.jsx($ne,{}):o.jsx(Hne,{})}),o.jsx(on,{})]})}),o.jsx(Fne,{showPreview:!1,cron:b("cronExpression"),timezone:b("timeZone"),enabled:b("isActive"),onChange:S=>{f.setValue("cronExpression",S.cron,{shouldDirty:!0}),f.setValue("timeZone",S.timezone,{shouldDirty:!0}),f.setValue("isActive",S.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"})]}),o.jsxs(Xl,{children:[o.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"}),s&&o.jsx(Se,{variant:"outline",type:"button",onClick:s,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function Gne({cronExpression:e,timeZone:t,isEnabled:n=!0}){const r=p.useMemo(()=>Dne(e,t,n),[e,t,n]);return o.jsxs("div",{children:[o.jsx("div",{children:r}),n&&o.jsx("code",{className:"text-muted-foreground mt-1 block text-xs",children:t})]})}function qne({table:e}){return o.jsx("div",{className:"text-right",children:o.jsxs(wr,{children:[o.jsx(Rr,{asChild:!0,children:o.jsx(Se,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:o.jsx(Xa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsx(Tr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>o.jsx(vt,{className:"capitalize",children:o.jsxs("label",{className:"flex items-center space-x-2",children:[o.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()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(fr,{className:"size-3.5 text-white"})})}),o.jsx("span",{children:t.columnDef.meta.title??t.id})]})},t.id))})]})})}function Zne({trigger:e,onEditTrigger:t,onDeleteTrigger:n}){const[r,s]=p.useState(!1),[l,c]=p.useState(!1),d=()=>{c(!1),n(e.id)};return o.jsxs("div",{className:"text-right",onClick:f=>{f.stopPropagation()},children:[o.jsxs(wr,{open:r,onOpenChange:s,children:[o.jsx(Rr,{asChild:!0,children:o.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:o.jsx(Xa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsxs(Tr,{align:"end",children:[o.jsxs(vt,{onClick:()=>{t(e.id)},children:[o.jsx(Tf,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Edit trigger"]}),o.jsx(Ka,{}),o.jsxs(vt,{onClick:()=>{c(!0)},children:[o.jsx(Lo,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),o.jsx("span",{className:"text-red-600",children:"Delete trigger"})]})]})]}),o.jsx(Hr,{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 Kne({connector:e}){const{connectors:t}=Yl(),n=kW(e,t);return o.jsx(o.Fragment,{children:n})}function XO({connector:e}){return o.jsx(Kne,{connector:e})}function Yne(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 Wne=e=>{const{connectors:t}=Yl();return p.useMemo(()=>t.find(n=>n.name===e),[t,e])},Qne=ye.memo(function({connector:t,children:n}){const r=Wne(t.source.name),{dataMart:s,runs:l,getDataMartRuns:c}=Fo();p.useEffect(()=>{s!=null&&s.id&&c(s.id)},[s==null?void 0:s.id,c]);const d=p.useMemo(()=>r!=null&&r.logoBase64?o.jsx(_u,{base64:r.logoBase64,size:20}):null,[r==null?void 0:r.logoBase64]),f=p.useCallback(()=>{s!=null&&s.storage&&EZ(s.storage,t.storage.fullyQualifiedName)},[s==null?void 0:s.storage,t.storage.fullyQualifiedName]),h=p.useMemo(()=>Yne(l),[l]),g=p.useMemo(()=>!h.lastRunDate||!h.lastRunStatus?null:{statusType:jK(h.lastRunStatus),statusText:NK(h.lastRunStatus),date:h.lastRunDate},[h]),y=p.useMemo(()=>(s==null?void 0:s.storage)&&wZ(s.storage),[s]),v=p.useMemo(()=>{const b=t.source.fields.length.toString();return`${t.source.node} • ${b} fields`},[t.source.node,t.source.fields.length]);return o.jsxs(R1,{children:[o.jsx(T1,{asChild:!0,children:o.jsx("span",{children:n})}),o.jsxs(j1,{children:[o.jsxs(_1,{children:[o.jsx(N1,{children:d}),o.jsxs(A1,{children:[o.jsx(D1,{children:o.jsx(XO,{connector:t})}),o.jsx(O1,{children:v})]})]}),o.jsxs(M1,{children:[o.jsxs(Si,{children:[o.jsx(Ci,{children:"Last run status:"}),o.jsx(Ei,{children:g?o.jsx(Bf,{type:g.statusType,variant:"ghost",children:g.statusText}):"Not run yet"})]}),o.jsxs(Si,{children:[o.jsx(Ci,{children:"Last run date:"}),o.jsx(Ei,{children:g?o.jsx(Pl,{date:g.date}):"Never run"})]}),o.jsxs(Si,{children:[o.jsx(Ci,{children:"Total runs:"}),o.jsxs(Ei,{children:[h.totalRuns," runs",h.firstRunDate&&o.jsxs(o.Fragment,{children:[", since"," ",h.firstRunDate.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})]})]})]})]}),o.jsx(I1,{children:o.jsxs(Se,{className:"w-full",variant:"default",onClick:f,title:"Open Storage","aria-label":"Open Storage",children:[y,o.jsx(_l,{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 Xne(e){const t=e.triggerConfig;return o.jsxs("div",{className:"inline gap-1",children:[t.report.title,o.jsx(RK,{report:t.report,children:o.jsx(zr,{className:"ml-1 inline-block h-4 w-4 align-text-bottom opacity-0 transition-opacity duration-200 group-hover:opacity-100"})})]})}function Jne(e){const t=e.triggerConfig,{connector:n}=t.connector;return o.jsxs("div",{className:"inline gap-1",children:[o.jsx(XO,{connector:n}),o.jsx(Qne,{connector:n,children:o.jsx(zr,{className:"ml-1 inline-block h-4 w-4 align-text-bottom opacity-0 transition-opacity duration-200 group-hover:opacity-100"})})]})}function ere({trigger:e}){switch(e.type){case vn.REPORT_RUN:return Xne(e);case vn.CONNECTOR_RUN:return Jne(e);default:return o.jsx("div",{className:"text-muted-foreground text-sm",children:"—"})}}function tre({onEditTrigger:e,onDeleteTrigger:t}){return[{accessorKey:"type",size:150,header:"Trigger Type",cell:({row:n})=>{const s=n.getValue("type")===vn.REPORT_RUN?"Report Run":"Connector Run";return o.jsx(br,{variant:"outline",children:s})},meta:{title:"Trigger Type"}},{accessorKey:"triggerConfig",size:35,header:"Run Target",cell:({row:n})=>o.jsx(ere,{trigger:n.original}),meta:{title:"Run Target"}},{accessorKey:"cronExpression",size:20,header:"Schedule",cell:({row:n})=>{const r=n.getValue("cronExpression"),s=n.original.timeZone,l=n.getValue("isActive");return o.jsx(Gne,{cronExpression:String(r),timeZone:s,isEnabled:l})},meta:{title:"Schedule"}},{accessorKey:"nextRun",size:15,header:"Next Run",cell:({row:n})=>{const r=n.original.nextRun;return o.jsx("div",{className:"text-muted-foreground text-sm",children:r?o.jsx(Pl,{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 o.jsx("div",{className:"text-sm",children:r?o.jsx(Pl,{date:new Date(r)}):o.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 o.jsx(Bf,{type:r?jn.SUCCESS:jn.NEUTRAL,variant:"ghost",showIcon:!1,children:r?"Enabled":"Disabled"})},meta:{title:"Trigger Status"}},{id:"actions",size:80,header:({table:n})=>o.jsx(qne,{table:n}),cell:({row:n})=>o.jsx(Zne,{trigger:n.original,onEditTrigger:e,onDeleteTrigger:t}),meta:{title:"Actions"}}]}function nre({table:e,onPreviousClick:t,onNextClick:n}){return o.jsxs("div",{className:"dm-card-pagination",role:"navigation","aria-label":"Table pagination",children:[o.jsx(Se,{variant:"outline",size:"sm",onClick:t,disabled:!e.getCanPreviousPage(),"aria-label":"Go to previous page",children:"Previous"}),o.jsx(Se,{variant:"outline",size:"sm",onClick:n,disabled:!e.getCanNextPage(),"aria-label":"Go to next page",children:"Next"})]})}function ES({isOpen:e,onClose:t,dataMartId:n,preSelectedReportId:r,preSelectedType:s}){const{createScheduledTrigger:l,updateScheduledTrigger:c,selectedTrigger:d}=$O(),[f,h]=p.useState(!1),[g,y]=p.useState(!1),v=p.useCallback(()=>{g?h(!0):t()},[g,t]),b=p.useCallback(()=>{h(!1),y(!1),t()},[t]),w=p.useCallback(D=>{y(D)},[]),E=p.useCallback(()=>{y(!1),t()},[t]),S=!!d,R=p.useMemo(()=>d?{type:d.type,cronExpression:d.cronExpression,timeZone:d.timeZone,isActive:d.isActive,triggerConfig:d.type===vn.REPORT_RUN?{type:Qc.SCHEDULED_REPORT_RUN,reportId:d.triggerConfig.reportId}:null}:void 0,[d]),T=async D=>{S?await c(n,d.id,D.cronExpression,D.timeZone,D.isActive):await l(n,D.type,D.cronExpression,D.timeZone,D.isActive,D.triggerConfig),E()},_=p.useRef(!1);return p.useEffect(()=>{const D=S?"Edit":"Create",A=(d==null?void 0:d.type)??s;e&&!_.current?(Pe({event:"scheduled_trigger_config_open",category:"ScheduledTrigger",action:D,label:A}),_.current=!0):!e&&_.current&&(Pe({event:"scheduled_trigger_config_close",category:"ScheduledTrigger",action:D,label:A}),_.current=!1)},[e,S,d,s]),o.jsxs(o.Fragment,{children:[o.jsx(Li,{open:e,onOpenChange:D=>{D||v()},children:o.jsxs(Pi,{children:[o.jsxs(Ui,{children:[o.jsxs(Fi,{children:[S?"Edit":"Create"," Scheduled Trigger"]}),o.jsx(Gl,{children:"Configure automatic runs for your reports or connectors."})]}),o.jsx(Bne,{preSelectedReportId:r,preSelectedType:s,initialData:R,onSubmit:T,onCancel:v,onDirtyChange:w})]})}),o.jsx(Hr,{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 rre({triggers:e,dataMartId:t,onEditTrigger:n,onDeleteTrigger:r}){const[s,l]=p.useState(!1),c=p.useCallback(()=>{l(!1)},[]),d=p.useCallback(R=>{r(R)},[r]),f=p.useMemo(()=>tre({onEditTrigger:n,onDeleteTrigger:d}),[n,d]),{sorting:h,setSorting:g,columnVisibility:y,setColumnVisibility:v}=Zf({columns:f,storageKeyPrefix:"data-mart-scheduled-triggers",defaultSortingColumn:"type"}),b=Au({data:e,columns:f,getCoreRowModel:Nu(),getPaginationRowModel:Ag(),onSortingChange:g,getSortedRowModel:qf(),getFilteredRowModel:Gf(),state:{sorting:h,columnVisibility:y},onColumnVisibilityChange:v,enableGlobalFilter:!0,enableColumnResizing:!1}),w=p.useCallback(()=>{b.previousPage()},[b]),E=p.useCallback(()=>{b.nextPage()},[b]);return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"dm-card-table-wrap",children:o.jsxs(Du,{id:"scheduled-triggers-table",className:"dm-card-table",role:"table","aria-label":"Scheduled Triggers",children:[o.jsx(Ou,{className:"dm-card-table-header",children:b.getHeaderGroups().map(R=>o.jsx(sr,{className:"dm-card-table-header-row",children:R.headers.map(T=>o.jsx(Iu,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",scope:"col",style:T.column.id==="type"?{width:150,minWidth:150,maxWidth:150}:T.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(T.getSize())}%`},children:T.isPlaceholder?null:typeof T.column.columnDef.header=="function"?T.column.columnDef.header(T.getContext()):T.column.columnDef.header},T.id))},R.id))}),o.jsx(Mu,{className:"dm-card-table-body",children:b.getRowModel().rows.length?b.getRowModel().rows.map((R,T)=>o.jsx(sr,{onClick:()=>{n(R.original.id)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":T+1,children:R.getVisibleCells().map((_,D)=>o.jsx(Sa,{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)):o.jsx(sr,{children:o.jsx(Sa,{colSpan:f.length,className:"dm-card-table-body-row-empty",role:"cell",children:o.jsx("span",{role:"status","aria-live":"polite",children:"No scheduled triggers found."})})})})]})}),o.jsx(nre,{table:b,onPreviousClick:w,onNextClick:E}),o.jsx(ES,{isOpen:s,onClose:c,dataMartId:t})]})}function are({dataMartId:e}){const{triggers:t,deleteScheduledTrigger:n,selectScheduledTrigger:r,selectedTrigger:s}=vne(e),[l,c]=p.useState(!1);p.useEffect(()=>{s&&c(!0)},[s]);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 o.jsxs(o.Fragment,{children:[o.jsx(rre,{triggers:t,dataMartId:e,onEditTrigger:d,onDeleteTrigger:g=>void h(g)}),o.jsx(ES,{isOpen:l,onClose:f,dataMartId:e})]})}function JO(){return o.jsx("div",{className:"dm-card-block !gap-1.5 !py-3",children:o.jsxs("div",{className:"text-foreground flex items-start gap-1.5 text-sm",children:[o.jsx(Mb,{className:"h-5 w-5 shrink-0","aria-hidden":"true"}),o.jsxs("div",{children:[o.jsx("p",{className:"font-medium",children:"Time Triggers"}),o.jsxs("p",{className:"text-muted-foreground",children:["Set up automatic runs in the ",o.jsx("span",{className:"font-medium",children:"Triggers"})," tab once you’ve saved and published this Data Mart."]})]})]})})}function sre({dataStorageType:e,target:t,destinationName:n,connectorName:r,onTargetChange:s}){const l=n.replace(/[^a-zA-Z0-9_]/g,"_"),c=r.replace(/[^a-zA-Z0-9_]/g,"_").toLowerCase(),[d,f]=p.useState(""),[h,g]=p.useState(""),[y,v]=p.useState(null),[b,w]=p.useState(null),E=_=>_.trim()?/^[A-Za-z][A-Za-z0-9_]*$/.test(_)?null:"Use letters, numbers, and underscores; start with a letter":"This field is required",S=p.useCallback((_,D,A,O)=>{s({fullyQualifiedName:`${_}.${D}`,isValid:!!(_&&D&&A===null&&O===null)})},[s]);p.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=E(_),O=E(D);f(_),g(D),v(A),w(O);const j=`${_}.${D}`,M=!!(_&&D&&A===null&&O===null);((t==null?void 0:t.fullyQualifiedName)!==j||t.isValid!==M)&&S(_,D,A,O)},[t,l,c,S]);const R=_=>{f(_);const D=E(_);v(D),S(_,h,D,b)},T=_=>{g(_);const D=E(_);w(D),S(d,_,y,D)};return o.jsxs(_o,{children:[e===Ie.GOOGLE_BIGQUERY&&o.jsxs(o.Fragment,{children:[o.jsx(Mi,{icon:o.jsx(s4,{}),title:"Google BigQuery",docUrl:"https://docs.owox.com/docs/storages/supported-storages/google-bigquery/",variant:"compact"}),o.jsxs(wl,{title:"Choose where to store your data",children:[o.jsxs(Zd,{children:[o.jsx(To,{required:!0,htmlFor:"dataset-name",tooltip:"Enter dataset name for Google BigQuery where the connector data will be stored.",children:"Dataset name"}),o.jsx(zt,{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}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Dataset is auto-created on first run if it doesn’t exist"}),y&&o.jsx("p",{id:"dataset-name-error",className:"text-destructive text-sm",children:y})]}),o.jsxs(Zd,{children:[o.jsx(To,{required:!0,htmlFor:"table-name",tooltip:"Enter table name where the connector data will be stored.",children:"Table name"}),o.jsx(zt,{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:_=>{T(_.target.value)},required:!0}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Table is auto-created on first run if it doesn’t exist"}),b&&o.jsx("p",{id:"table-name-error",className:"text-destructive text-sm",children:b})]})]})]}),e===Ie.AWS_ATHENA&&o.jsxs(o.Fragment,{children:[o.jsx(Mi,{icon:o.jsx(o4,{}),title:"AWS Athena",docUrl:"https://docs.owox.com/docs/storages/supported-storages/aws-athena/",variant:"compact"}),o.jsxs(wl,{title:"Choose where to store your data",children:[o.jsxs(Zd,{children:[o.jsx(To,{required:!0,htmlFor:"database-name",tooltip:"Enter database name for Amazon Athena where the connector data will be stored.",children:"Database name"}),o.jsx(zt,{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}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Database is auto-created on first run if it doesn’t exist"}),y&&o.jsx("p",{id:"database-name-error",className:"text-destructive text-sm",children:y})]}),o.jsxs(Zd,{children:[o.jsx(To,{required:!0,htmlFor:"athena-table-name",tooltip:"Enter table name where the connector data will be stored.",children:"Table name"}),o.jsx(zt,{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:_=>{T(_.target.value)},required:!0}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Table is auto-created on first run if it doesn’t exist"}),b&&o.jsx("p",{id:"athena-table-name-error",className:"text-destructive text-sm",children:b})]})]})]}),o.jsx(wl,{title:"Schedule updates",children:o.jsx(JO,{})})]})}function ore({onSubmit:e,dataStorageType:t,configurationOnly:n=!1,existingConnector:r=null,mode:s="full",initialStep:l,preselectedConnector:c,onDirtyChange:d}){const[f,h]=p.useState(!1),[g,y]=p.useState(null),[v,b]=p.useState(""),[w,E]=p.useState([]),[S,R]=p.useState(1),[T,_]=p.useState({}),[D,A]=p.useState(!1),[O,j]=p.useState(new Set),[M,F]=p.useState(new Set),{connectors:G,connectorSpecification:Y,connectorFields:Z,loading:ee,loadingSpecification:$,loadingFields:W,error:k,fetchAvailableConnectors:H,fetchConnectorSpecification:B,fetchConnectorFields:ie}=Yl();p.useEffect(()=>{d==null||d(f)},[f,d]);const[xe,L]=p.useState(null),q=(n?[{id:1,title:"Configuration",description:"Set up connector parameters"}]:s==="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=p.useCallback(async Fe=>{!O.has(Fe)&&!$&&(j(U=>new Set(U).add(Fe)),await B(Fe))},[O,$,B]),ue=p.useCallback(async Fe=>{M.has(Fe)||(F(U=>new Set(U).add(Fe)),await ie(Fe))},[M,ie]);p.useEffect(()=>{if(!c||g||G.length===0)return;const Fe=G.find(U=>U.name===c);Fe&&(y(Fe),R(l??2),te(Fe.name),!n&&s!=="fields-only"&&ue(Fe.name))},[c,G,g,l,n,s,te,ue]),p.useEffect(()=>{if(G.length===0&&!ee&&H(),r&&G.length>0&&!g){const{source:Fe,storage:U}=r;b(Fe.node),E(Fe.fields),_(Fe.configuration[0]||{}),L({fullyQualifiedName:U.fullyQualifiedName,isValid:!0});const Q=G.find(de=>de.name===Fe.name);Q&&(y(Q),te(Q.name),!n&&s!=="fields-only"&&ue(Q.name),s==="fields-only"&&ue(Q.name))}if(n&&G.length>0&&!g&&!r){const Fe=G[0];y(Fe),te(Fe.name)}},[s,r,G,n,ee,H,te,ue,g]);const ve=Fe=>{y(Fe),_({}),A(!1),h(!0),j(U=>{const Q=new Set(U);return Q.delete(Fe.name),Q}),te(Fe.name),ue(Fe.name)},le=Fe=>{b(Fe),E([]),h(!0)},Ne=(Fe,U)=>{E(U?Q=>Q.includes(Fe)?Q:[...Q,Fe]:Q=>Q.filter(de=>de!==Fe)),h(!0)},we=(Fe,U)=>{E(U?Q=>{const de=Fe.filter(je=>!Q.includes(je));return[...Q,...de]}:Q=>Q.filter(de=>!Fe.includes(de))),h(!0)},_e=Fe=>{L(Fe),h(!0)},He=p.useCallback(Fe=>{_(Fe),h(!0)},[]),We=p.useCallback(Fe=>{A(Fe)},[]);p.useEffect(()=>{Y&&(Y.some(U=>U.required&&U.name!=="Fields")||A(!0))},[Y]);const Ft=()=>{S<q&&R(S+1)},jt=()=>{S>1&&R(S-1)},Bt=()=>{if(n)return g!==null&&D;if(s==="fields-only")switch(S){case 1:return w.length>0;default:return!1}switch(S){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}},xn=()=>S>1,jr=(Fe,U)=>{if(!Fe)return U;const Q=Fe.find(de=>de.name===U);return(Q==null?void 0:Q.destinationName)??U},aa=()=>{if(n&&S===1)return Y&&g?o.jsx(sj,{connector:g,connectorSpecification:Y,onConfigurationChange:He,onValidationChange:We,initialConfiguration:T,loading:$,isEditingExisting:!!(r!=null&&r.source.configuration.length)}):null;if(s==="fields-only")switch(S){case 1:return g&&v&&Z?o.jsx(oj,{connector:g,connectorFields:Z,selectedField:v,selectedFields:w,onFieldToggle:Ne,onSelectAllFields:we}):null;default:return null}switch(S){case 1:return o.jsx(ene,{connectors:G,selectedConnector:g,loading:ee,error:k,onConnectorSelect:ve,onConnectorDoubleClick:()=>{R(Fe=>Fe<q?Fe+1:Fe)}});case 2:return g&&Y?o.jsx(sj,{connector:g,connectorSpecification:Y,onConfigurationChange:He,onValidationChange:We,initialConfiguration:T,loading:$,isEditingExisting:!1}):null;case 3:return g&&Z?o.jsx(hne,{connectorFields:Z,connector:g,selectedField:v,connectorName:g.displayName,loading:W,onFieldSelect:le}):null;case 4:return g&&v&&Z?o.jsx(oj,{connector:g,connectorFields:Z,selectedField:v,selectedFields:w,onFieldToggle:Ne,onSelectAllFields:we}):null;case 5:return v&&Z?o.jsx(sre,{dataStorageType:t,destinationName:jr(Z,v),connectorName:(g==null?void 0:g.displayName)??"",target:xe,onTargetChange:_e}):null;default:return null}};return o.jsxs(KX,{children:[o.jsx(YX,{children:aa()}),o.jsx(WX,{variant:"horizontal",children:o.jsx(tne,{currentStep:S,totalSteps:q,canGoNext:Bt(),canGoBack:xn(),isLoading:$||W,onNext:Ft,onBack:jt,onFinish:()=>{n&&g?e({source:{name:g.name,configuration:[T],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)??""}}):s==="fields-only"&&r?e({source:{...r.source,fields:w},storage:r.storage}):g&&xe&&e({source:{name:g.name,configuration:[T],node:v,fields:w},storage:{fullyQualifiedName:xe.fullyQualifiedName}}),h(!1)}})})]})}const e5=20,t5=20;function n5({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 ire(e=30,t=0){n5({vertical:t5+e,horizontal:e5+t})}function cb(){n5({vertical:t5,horizontal:e5})}function r5({isOpen:e,onClose:t,dataStorageType:n,onSubmit:r,configurationOnly:s=!1,existingConnector:l=null,mode:c="full",initialStep:d,preselectedConnector:f}){p.useEffect(()=>(e?ire(55):cb(),()=>{cb()}),[e]);const[h,g]=p.useState(!1),[y,v]=p.useState(!1),b=p.useCallback(()=>{y?g(!0):t()},[y,t]),w=p.useCallback(()=>{g(!1),v(!1),t()},[t]),E=p.useCallback(S=>{v(S)},[]);return o.jsxs(o.Fragment,{children:[o.jsx(Li,{open:e,onOpenChange:b,children:o.jsxs(Pi,{children:[o.jsxs(Ui,{children:[o.jsx(Fi,{children:c==="fields-only"?"Connector Fields":l!=null&&l.source.name?"Edit Connector":"Set Up Connector"}),o.jsx(Gl,{children:c==="fields-only"?"Select fields for your Data Mart":l!=null&&l.source.name?"Update configuration":"Follow these steps to set it up"})]}),o.jsx(ore,{onSubmit:S=>{r(S),t()},dataStorageType:n,configurationOnly:s||c==="configuration-only",existingConnector:l,mode:c,initialStep:d,preselectedConnector:f,onDirtyChange:E})]})}),o.jsx(Hr,{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 wS=({dataStorageType:e,onSubmit:t,children:n,configurationOnly:r=!1,existingConnector:s=null,preset:l,isOpen:c,onClose:d})=>{const[f,h]=p.useState(!1),[g,y]=p.useState(1),[v,b]=p.useState();p.useEffect(()=>{c!==void 0&&h(c)},[c]);const w=()=>{b(void 0),y(1),h(!0)},E=()=>{h(!1),d==null||d()};return p.useEffect(()=>{l&&(l==="connector"?(b(void 0),y(1),h(!0)):(b(l),y(2),h(!0)))},[l]),o.jsxs(o.Fragment,{children:[n&&o.jsx("div",{onClick:w,style:{cursor:"pointer"},children:n}),o.jsx(yu,{children:o.jsx(r5,{isOpen:f,onClose:E,dataStorageType:e,onSubmit:t,configurationOnly:r,existingConnector:s,initialStep:g,preselectedConnector:v})})]})};function lre({storageType:e,onSetupConnector:t,preset:n,isOpen:r,onClose:s}){return o.jsx(wS,{dataStorageType:e,onSubmit:t,configurationOnly:!1,preset:n,isOpen:r,onClose:s,children:o.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:[o.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:o.jsx(Ob,{className:"h-4 w-4",strokeWidth:2.25})}),o.jsx("span",{children:"Setup Connector"}),o.jsx(ja,{className:"h-6 w-6"})]})})}const cre=e=>{switch(e){case Ie.GOOGLE_BIGQUERY:return"Google BigQuery";case Ie.AWS_ATHENA:return"AWS Athena";default:return e}},Kc=e=>typeof e=="object"&&"connector"in e,Vd=e=>{if(!Kc(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,s=!!n.fullyQualifiedName&&n.fullyQualifiedName.split(".").length===2;return r&&s};function ure({configIndex:e,connectorDef:t,onRemoveConfiguration:n,onUpdateConfiguration:r,totalConfigurations:s,dataStorage:l}){const c=Bi.getInfo(l.type),{connectors:d,fetchAvailableConnectors:f}=Yl();p.useEffect(()=>{f()},[f]);const h=w=>{const E=d.find(S=>S.name===w);if(E!=null&&E.logoBase64)return()=>o.jsx(_u,{base64:E.logoBase64,size:24})},g=()=>{const w=t.connector.source.node||"No node selected";return o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx("span",{className:"text-muted-foreground/75",children:"Data:"})," ",o.jsx("span",{className:"text-muted-foreground font-medium",children:w}),o.jsx("span",{className:"text-muted-foreground",children:"•"}),o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsxs("span",{className:"text-muted-foreground flex items-center gap-1 font-medium",children:[o.jsx("span",{children:"Edit config"}),o.jsx(ja,{className:"h-3 w-3"})]})}),o.jsx(Et,{children:"Edit connector configuration"})]})]})},y=(w,E,S)=>o.jsxs("span",{children:[o.jsxs("span",{className:"text-muted-foreground/75",children:[w,":"]})," ",o.jsx(or,{href:S,onClick:R=>{R.stopPropagation()},children:E})]}),v=()=>{switch(l.type){case Ie.GOOGLE_BIGQUERY:{const w=l.config.projectId,E=t.connector.storage.fullyQualifiedName,S=E.split(".")[0],R=E.split(".")[1],T=`https://console.cloud.google.com/bigquery?project=${w}&ws=!1m4!1m3!3m2!1s${w}!2s${S}`,_=`https://console.cloud.google.com/bigquery?project=${w}&ws=!1m4!1m3!3m2!1s${w}!2s${S}!3s${R}`;return o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[y("Dataset",S,T),o.jsx("span",{className:"text-muted-foreground",children:"•"}),y("Table",R,_),o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx(zr,{className:"h-4 w-4"})}),o.jsx(Et,{children:"The dataset and table are automatically created during the first run of the data mart, if they don't already exist"})]})]})}case Ie.AWS_ATHENA:{const w=l.config.region,E=t.connector.storage.fullyQualifiedName,[S,R]=E.split("."),T=`https://console.aws.amazon.com/athena/home?region=${w}#/query-editor`;return o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[y("Database",S,T),o.jsx("span",{className:"text-muted-foreground",children:"•"}),y("Table",R,T),o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx(zr,{className:"h-4 w-4"})}),o.jsx(Et,{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=()=>s!==1;return o.jsxs("div",{className:"border-border flex w-full items-center rounded-lg border-1 p-1 dark:bg-white/2",children:[o.jsx("div",{className:"flex-grow",children:o.jsxs("div",{className:"grid grid-cols-2 items-center gap-4",children:[o.jsx(wS,{dataStorageType:l.type,onSubmit:r(e),configurationOnly:!0,existingConnector:{source:{...t.connector.source,configuration:[t.connector.source.configuration[e]]},storage:t.connector.storage},children:o.jsx(tb,{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"})}),o.jsx(tb,{title:cre(l.type),icon:c.icon,subtitle:v(),className:"bg-background min-h-[80px] cursor-default border-0 hover:shadow-none dark:bg-white/2"})]})}),o.jsx("div",{className:"shrink-0 px-4",children:o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx("span",{children:o.jsx(Se,{type:"button",variant:"ghost",onClick:()=>{b()&&n(e)},disabled:!b(),children:o.jsx(Lo,{className:"h-4 w-4"})})})}),!b()&&o.jsx(Et,{children:"Remove last configuration only after adding a new one."})]})})]})}function dre({storageType:e,onAddConfiguration:t,existingConnector:n}){return o.jsx("div",{children:o.jsx(wS,{dataStorageType:e,onSubmit:r=>{const s=r.source.configuration[0]||{};t(s)},configurationOnly:!0,existingConnector:n?{source:{...n.source,configuration:[]},storage:n.storage}:void 0,children:o.jsxs(Se,{type:"button",variant:"outline",className:"dm-card-table-add-field-btn cursor-pointer",children:[o.jsx(_a,{className:"h-4 w-4"}),o.jsx("span",{children:"Configuration"})]})})})}function fre({control:e,storageType:t,preset:n,autoOpen:r=!1,saveDataMartDefinition:s}){const{dataMart:l,runDataMart:c}=Wa(),{setValue:d,getValues:f,trigger:h}=ku(),[g,y]=p.useState(!1),[v,b]=p.useState(!1);p.useEffect(()=>{r&&b(!0)},[r]);const w=(l==null?void 0:l.status)??Sr.DRAFT,E=async $=>{d("definition",$,{shouldDirty:!0,shouldTouch:!0}),await h("definition")&&s&&s()},S=async $=>{const W=$.source,k=$.storage;await E({connector:{source:W,storage:k}})},R=async $=>{if(l){if(l.status.code!==Sr.PUBLISHED){At.error("Manual run is only available for published data marts");return}await c({id:l.id,payload:$})}},T=$=>async W=>{const H=f().definition;if(typeof H=="object"&&Kc(H)){const B=[...H.connector.source.configuration];B[$]=W.source.configuration[0]||{};const ie={connector:{...H.connector,source:{...H.connector.source,configuration:B}}};await E(ie)}},_=async $=>{const k=f().definition;if(typeof k=="object"&&Kc(k)){const H={connector:{...k.connector,source:{...k.connector.source,fields:$.source.fields}}};await E(H)}y(!1)},D=$=>{R({runType:$.runType,data:$.data})},A=$=>{const W=$.connector.source.fields.length;return o.jsxs(Se,{type:"button",variant:"outline",onClick:()=>{y(!0)},className:"dm-card-table-add-field-btn cursor-pointer",children:[o.jsx(kL,{className:"h-4 w-4"}),o.jsxs("span",{children:["Edit Fields (",String(W),")"]})]})},[O,j]=p.useState(null),[M,F]=p.useState(!1),G=$=>{j($),F(!0)},Y=async()=>{O!==null&&(await Z(O),j(null),F(!1))},Z=async $=>{const k=f().definition;if(Kc(k)&&k.connector.source.configuration.length<=1){const H=bS(Ue.CONNECTOR);await E(H)}if(typeof k=="object"&&Kc(k)&&k.connector.source.configuration.length>1){const H={...k.connector.source,configuration:k.connector.source.configuration.filter((ie,xe)=>xe!==$)},B={connector:{...k.connector,source:H}};await E(B)}},ee=async $=>{const k=f().definition;if(Kc(k)){const H={...k.connector.source,configuration:[...k.connector.source.configuration,$]},B={connector:{...k.connector,source:H}};await E(B)}};return o.jsxs(o.Fragment,{children:[o.jsx(en,{control:e,name:"definition",render:({field:$})=>o.jsxs(Vt,{className:"dark:bg-white/2",children:[o.jsx(Ht,{children:o.jsx("div",{className:"space-y-3",children:!Vd($.value)||w===Sr.DRAFT?o.jsx(lre,{storageType:t,onSetupConnector:W=>{S(W),b(!1)},preset:n,isOpen:v,onClose:()=>{b(!1)}}):o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(dre,{storageType:t,onAddConfiguration:W=>void ee(W),existingConnector:Vd($.value)?{source:$.value.connector.source,storage:$.value.connector.storage}:void 0}),Vd($.value)&&A($.value)]}),o.jsx("div",{className:"flex items-center gap-2",children:l&&l.definitionType===Ue.CONNECTOR&&o.jsx(rO,{configuration:l.definition,onManualRun:D,children:o.jsxs(Se,{variant:"outline",children:[o.jsx(Db,{className:"h-4 w-4"}),o.jsx("span",{children:"Manual Run..."})]})})})]}),o.jsx("div",{className:"space-y-3",children:Vd($.value)&&(l!=null&&l.storage)?$.value.connector.source.configuration.map((W,k)=>{const H=$.value;return o.jsx(yu,{children:o.jsx(ure,{configIndex:k,connectorDef:H,dataStorage:l.storage,onRemoveConfiguration:B=>{G(B)},onUpdateConfiguration:B=>T(B),dataMartStatus:typeof w=="object"?w.code:w,totalConfigurations:H.connector.source.configuration.length},k)},k)}):null})]})})}),o.jsx(on,{})]})}),o.jsx(yu,{children:o.jsx(r5,{isOpen:g,onClose:()=>{y(!1)},onSubmit:$=>void _($),dataStorageType:t,existingConnector:Vd(f().definition)?{source:f().definition.connector.source,storage:f().definition.connector.storage}:void 0,mode:"fields-only"})}),o.jsx(Hr,{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:()=>{j(null)},variant:"destructive"})]})}function hre({definitionType:e,storageType:t,preset:n,saveDataMartDefinition:r}){const{control:s}=ku(),[l,c]=p.useState(!1);return p.useEffect(()=>{e===Ue.CONNECTOR&&!n?c(!0):c(!1)},[e,n]),o.jsxs("div",{className:"space-y-2",children:[e===Ue.SQL&&o.jsx(Yte,{control:s}),e===Ue.TABLE&&o.jsx(Wte,{control:s,storageType:t}),e===Ue.VIEW&&o.jsx(Qte,{control:s,storageType:t}),e===Ue.TABLE_PATTERN&&o.jsx(Xte,{control:s,storageType:t}),e===Ue.CONNECTOR&&o.jsx(fre,{control:s,storageType:t,preset:n,autoOpen:l,saveDataMartDefinition:r})]})}function a5(){const[e]=H8(),t=e.get("preset");return p.useMemo(()=>{if(!t)return;const n=t.toLowerCase();return rW(n)},[t])}function mre(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 pre(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function gre(e,t){const[n,r]=p.useState(e);return p.useEffect(()=>{const s=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(s)}},[e,t]),n}const yre=1e3,vre=[Rl.SUCCESS,Rl.ERROR,Rl.CANCELLED];function xre(e){const[t,n]=p.useState(!1),[r,s]=p.useState(null),l=p.useRef({triggerId:null,abortController:null}),c=p.useCallback(y=>l.current.triggerId===y,[]),d=p.useCallback(y=>{s({isValid:!1,error:y instanceof Error?y.message:"Validation failed"}),n(!1)},[]),f=p.useCallback(async()=>{const{triggerId:y,abortController:v}=l.current;if(y){v==null||v.abort(),l.current={triggerId:null,abortController:null},s(null),n(!1);try{await nn.abortSqlDryRunTrigger(e,y)}catch(b){console.error("Failed to cancel trigger:",b)}}},[e]),h=p.useCallback(async(y,v)=>{for(;!v.aborted&&c(y);)try{const b=await nn.getSqlDryRunTriggerStatus(e,y);if(vre.includes(b)){const w=await nn.getSqlDryRunTriggerResponse(e,y);s({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,yre))}catch(b){d(b),l.current={triggerId:null,abortController:null};return}},[e,c,d]),g=p.useCallback(async y=>{await f(),n(!0),s(null);try{const{triggerId:v}=await nn.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 p.useEffect(()=>()=>{const{triggerId:y,abortController:v}=l.current;v==null||v.abort(),y&&nn.abortSqlDryRunTrigger(e,y).catch(()=>{})},[e]),{validateSql:g,isLoading:t,result:r,cancel:f}}const bre=300;function Sre({sql:e,dataMartId:t,debounceDelay:n=bre,className:r="",onValidationStateChange:s}){const l=gre(e.trim(),n),{validateSql:c,isLoading:d,result:f,cancel:h}=xre(t);p.useEffect(()=>{if(!l){h();const y={isLoading:!1,isValid:null,error:null,bytes:null};s==null||s(y);return}c(l)},[l,c,h,s]),p.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};s==null||s(y)},[d,f,s]);const g=()=>d?o.jsxs("div",{className:"flex h-5 items-center gap-2",children:[o.jsx(Rf,{className:"h-4 w-4 animate-spin"}),o.jsx("span",{className:"text-sm",children:"Validating..."})]}):f?f.isValid?o.jsxs("div",{className:"flex h-5 items-center gap-2",children:[o.jsx(k9,{className:"h-4 w-4 text-green-600"}),o.jsx("span",{className:"text-sm font-medium text-green-600",children:"Valid SQL code"}),f.bytes!==void 0&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"mx-1 text-gray-400",children:"•"}),o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(lu,{className:"h-3 w-3 text-gray-600"}),o.jsx("span",{className:"text-xs text-gray-600",children:mre(f.bytes)})]})}),o.jsx(Et,{children:o.jsx("p",{className:"text-xs",children:"This is an estimated volume and may differ from the actual value"})})]})]})]}):o.jsxs("div",{className:"flex h-9 items-center gap-2",children:[o.jsx(sp,{className:"h-4 w-4 flex-shrink-0 text-red-600"}),f.error&&o.jsx("span",{className:"text-xs text-red-500",children:f.error})]}):o.jsxs("div",{className:"flex h-5 items-center gap-2 text-gray-500",children:[o.jsx(lu,{className:"h-4 w-4"}),o.jsx("span",{className:"text-sm",children:"Type a query to get started"})]});return o.jsx("div",{className:`inline-flex h-9 items-center px-3 py-2 ${r}`,children:g()})}const Cre={isValid:null,isLoading:!1,error:null},Ere=(e,t)=>{if(e!==Ue.SQL)return"";const n=t;return(n==null?void 0:n.sqlQuery)??""},wre=e=>bS(e);function Rre({definitionType:e,initialDefinitionType:t,setDefinitionType:n}){const{dataMart:r,updateDataMartDefinition:s,runSchemaActualization:l}=Wa(),c=a5();if(!r)throw new Error("Data mart not found");const{definition:d,id:f,storage:{type:h}}=r,[,g]=p.useState(Cre),[y,v]=p.useState(!1),b=p.useCallback(()=>{if(!e)return;const ee={definitionType:e,definition:bS(e)};return d?{definitionType:e,definition:d}:ee},[e,d]),w=p.useCallback(()=>{if(!e)return;const ee=Kte(e,h);return Jl(ee)},[e,h]),E=Gi({resolver:w(),defaultValues:b(),mode:"onChange"}),{handleSubmit:S,reset:R,watch:T,formState:{isDirty:_,isValid:D}}=E,A=T("definition"),O=Ere(e,A);p.useEffect(()=>{e&&R(b())},[e,R,b]),p.useEffect(()=>{if(!e&&!t&&(c!=null&&c.definitionType)){n(c.definitionType);const ee={definitionType:c.definitionType,definition:wre(c.definitionType)};R(ee)}},[c,e,t,R,n]);const j=p.useCallback(ee=>{g({isLoading:ee.isLoading,isValid:ee.isValid,error:ee.error})},[]),M=p.useCallback(ee=>{n(ee)},[n]),F=p.useCallback(async ee=>{if(e&&f)try{await s(f,ee.definitionType,ee.definition),v(!0),R(ee)}catch($){console.error("Failed to update data mart definition:",$)}},[f,e,s,R]);p.useEffect(()=>{y&&(v(!1),l==null||l())},[y,l]);const G=p.useCallback(ee=>{ee==null||ee.preventDefault(),S(F)(ee)},[S,F]),Y=p.useCallback(()=>{R(b())},[R,b]),Z=()=>e?o.jsxs("form",{onSubmit:G,className:"space-y-4",children:[o.jsx(hre,{definitionType:e,storageType:h,preset:c==null?void 0:c.connectorSourceTitle,saveDataMartDefinition:G}),e!==Ue.CONNECTOR&&o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx(Se,{variant:"default",type:"submit",disabled:!D||!_,children:"Save"}),o.jsx(Se,{type:"button",variant:"ghost",onClick:Y,disabled:!_,children:"Discard"}),e===Ue.SQL&&O&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-6 w-px bg-gray-300"}),o.jsx(Sre,{sql:O,dataMartId:f,onValidationStateChange:j})]})]})]}):null;return o.jsx(M3,{...E,children:o.jsxs("div",{className:"space-y-4",children:[!t&&o.jsx($te,{initialType:e,onTypeSelect:M}),Z()]})})}function Tre(e){switch(e){case Ie.GOOGLE_BIGQUERY:return{type:"bigquery-data-mart-schema",fields:[]};case Ie.AWS_ATHENA:return{type:"athena-data-mart-schema",fields:[]};default:throw new Error(`Unsupported storage type: ${e}`)}}function s5(e){return e.type==="bigquery-data-mart-schema"}function o5(e){return e.type==="athena-data-mart-schema"}function lj(e){return e!==null&&typeof e=="object"&&"mode"in e}function cj(e){return e!==null&&typeof e=="object"&&"isPrimaryKey"in e}function jre(e){return e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):""}function Jx(e){return e==null?e:JSON.parse(JSON.stringify(e))}function _re(e){const t=Jx(e),[n,r]=p.useState(t),[s,l]=p.useState(!1);p.useEffect(()=>{const f=Jx(e);r(f),l(!1)},[e]);const c=p.useCallback(f=>{n?s5(n)&&f.every(lj)?(r({...n,fields:f}),l(!0)):o5(n)&&f.every(cj)&&(r({...n,fields:f}),l(!0)):f.length>0&&(lj(f[0])?(r({type:"bigquery-data-mart-schema",fields:f}),l(!0)):cj(f[0])&&(r({type:"athena-data-mart-schema",fields:f}),l(!0)))},[n]),d=p.useCallback(()=>{const f=Jx(e);r(f),l(!1)},[e]);return{schema:n,isDirty:s,updateSchema:c,resetSchema:d,setIsDirty:l}}function Nre(e,t){const n=p.useRef(!1),r=p.useRef(!1),[s,l]=p.useState("idle");return p.useEffect(()=>{e||(n.current||r.current)&&(l(t?"error":"success"),n.current=!1,r.current=!1)},[e,t]),{operationStatus:s,startSaveOperation:()=>{n.current=!0,l("idle")},startActualizeOperation:()=>{r.current=!0,l("idle")},resetOperationStatus:()=>{l("idle")}}}function Are(e){const t=p.useMemo(()=>Array.isArray(e)?Object.fromEntries(e.filter(s=>s.meta&&s.meta.hidden).map(s=>["id"in s&&s.id?s.id:"accessorKey"in s&&typeof s.accessorKey=="string"?s.accessorKey:void 0,!1]).filter(([s])=>s!==void 0)):{},[e]),[n,r]=p.useState({});return p.useEffect(()=>{r(t)},[t]),{columnVisibility:n,setColumnVisibility:r,defaultHiddenColumns:t}}function i5(e,t){const n=e.name?e.name.toLowerCase().includes(t):!1,r=e.alias?e.alias.toLowerCase().includes(t):!1,s=e.description?e.description.toLowerCase().includes(t):!1;if(n||r||s)return!0;const l=e;return l.fields&&l.fields.length>0?l.fields.some(c=>i5(c,t)):!1}function l5(e,t,n=""){const r=[];return e.forEach((s,l)=>{const c=n?`${n}.${String(l)}`:String(l),d=s.name?s.name.toLowerCase().includes(t):!1,f=s.alias?s.alias.toLowerCase().includes(t):!1,h=s.description?s.description.toLowerCase().includes(t):!1;if((d||f||h)&&r.push(c),s.fields&&s.fields.length>0){const g=l5(s.fields,t,c);g.length>0&&(r.includes(c)||r.push(c),r.push(...g))}}),r}function Dre(e,t,n){const r=e.original;if(!n)return!0;const s=n.toLowerCase();return i5(r,s)}function Ore(e){const[t,n]=p.useState(""),r=p.useCallback(l=>{n(l),e.setGlobalFilter(l)},[e]),s=t.toLowerCase();return{value:t,onChange:r,searchValue:s}}function Mre(e){const[t,n]=p.useState(new Set),[r,s]=p.useState(null),l=p.useRef(""),c=p.useMemo(()=>{const w=E=>E.some(S=>S.type===kn.RECORD||S.type===kn.STRUCT||S.fields&&w(S.fields));return w(e)},[e]),d=p.useCallback(w=>{n(E=>{const S=new Set(E);return S.has(w)?S.delete(w):S.add(w),S})},[]),f=p.useCallback(()=>{const w=[],E=(S,R="")=>{S.forEach((T,_)=>{const D=R?`${R}.${String(_)}`:String(_);(T.type===kn.RECORD||T.type===kn.STRUCT)&&T.fields&&T.fields.length>0&&(w.push(D),E(T.fields,D))})};E(e),n(S=>w.every(T=>S.has(T))?new Set:new Set(w))},[e]),h=p.useMemo(()=>{const w=[],E=(S,R="",T=0)=>{S.forEach((_,D)=>{const A=R?`${R}.${String(D)}`:String(D),O=_.type===kn.RECORD||_.type===kn.STRUCT;w.push({..._,path:A,level:T}),O&&_.fields&&t.has(A)&&E(_.fields,A,T+1)})};return E(e),w},[e,t]),g=p.useCallback(w=>{if(w!==l.current)if(l.current=w,w){r===null&&s(new Set(t));const S=l5(e,w).filter(R=>{const T=R.split(".").map(Number);let _=e,D;for(let A=0;A<T.length;A++){if(D=_[T[A]],!D)return!1;if((D.type===kn.RECORD||D.type===kn.STRUCT)&&D.fields&&D.fields.length>0)return!0;A<T.length-1&&(_=D.fields??[])}return!1});n(R=>{const T=new Set(R);return S.forEach(_=>{T.add(_)}),T})}else r!==null&&(n(r),s(null))},[e,t,r]),y=p.useCallback(w=>{const E=h[w];return E.type===kn.RECORD||E.type===kn.STRUCT},[h]),v=p.useMemo(()=>e.map(w=>({...w,fields:void 0})),[e]),b=p.useMemo(()=>{const w=[],E=(S,R="")=>{S.forEach((T,_)=>{const D=R?`${R}.${String(_)}`:String(_);(T.type===kn.RECORD||T.type===kn.STRUCT)&&T.fields&&T.fields.length>0&&(w.push(D),E(T.fields,D))})};return E(e),w.length===0?!1:w.every(S=>t.has(S))},[e,t]);return{expandedRecords:t,hasRecordFields:c,toggleRecordExpansion:d,toggleAllRecords:f,flattenedFields:h,handleSearchChange:g,isRecordType:y,topLevelFields:v,allExpanded:b}}function Ire(e,t,n,r){const s=p.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 S=0;S<v.length-1;S++)w=b[v[S]],b=w.fields??[];const E=v[v.length-1];b[E]&&(b[E]={...b[E],...h})}n(g)}},[e,t,n]),l=p.useCallback(()=>{if(n){const f={name:"",type:kn.STRING,mode:pf.NULLABLE,isPrimaryKey:!1,status:Ga.DISCONNECTED};n([...e,f])}},[e,n]),c=p.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 E=0;E<y.length-1;E++)b=v[y[E]],v=b.fields??[];const w=y[y.length-1];v.splice(w,1)}n(h)}},[e,t,n]),d=p.useCallback(f=>{var h,g;if(n&&r){const y=[...e],v=t[f].path,b={name:"",type:kn.STRING,mode:pf.NULLABLE,isPrimaryKey:!1,status:Ga.DISCONNECTED};if(!v)(h=y[f]).fields??(h.fields=[]),y[f].fields.push(b);else{const w=v.split(".").map(Number);let E=y;for(let S=0;S<w.length;S++){const R=w[S];S===w.length-1?((g=E[R]).fields??(g.fields=[]),E[R].fields.push(b)):E=E[R].fields??[]}}n(y)}},[e,t,n,r]);return{updateField:s,handleAddRow:l,handleDeleteRow:c,handleAddNestedField:d}}function c5(e,t,n){return{handleDragEnd:p.useCallback(s=>{const{active:l,over:c}=s;if(!c||l.id===c.id||!t)return;if(!n){const v=Number(l.id),b=Number(c.id),w=[...e],[E]=w.splice(v,1);w.splice(b,0,E),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 T=0;T<v.length-1;T++)w=w[v[T]].fields??[];const E=v[v.length-1],S=b[b.length-1],[R]=w.splice(E,1);w.splice(S,0,R),t(y)}}},[e,n,t])}}function kre(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return p.useMemo(()=>r=>{t.forEach(s=>s(r))},t)}const qg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Uu(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function RS(e){return"nodeType"in e}function ra(e){var t,n;return e?Uu(e)?e:RS(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function TS(e){const{Document:t}=ra(e);return e instanceof t}function Jf(e){return Uu(e)?!1:e instanceof ra(e).HTMLElement}function u5(e){return e instanceof ra(e).SVGElement}function Fu(e){return e?Uu(e)?e.document:RS(e)?TS(e)?e:Jf(e)||u5(e)?e.ownerDocument:document:document:document}const Bs=qg?p.useLayoutEffect:p.useEffect;function jS(e){const t=p.useRef(e);return Bs(()=>{t.current=e}),p.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return t.current==null?void 0:t.current(...r)},[])}function Lre(){const e=p.useRef(null),t=p.useCallback((r,s)=>{e.current=setInterval(r,s)},[]),n=p.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function yf(e,t){t===void 0&&(t=[e]);const n=p.useRef(e);return Bs(()=>{n.current!==e&&(n.current=e)},t),n}function eh(e,t){const n=p.useRef();return p.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Up(e){const t=jS(e),n=p.useRef(null),r=p.useCallback(s=>{s!==n.current&&(t==null||t(s,n.current)),n.current=s},[]);return[n,r]}function ub(e){const t=p.useRef();return p.useEffect(()=>{t.current=e},[e]),t.current}let e0={};function th(e,t){return p.useMemo(()=>{if(t)return t;const n=e0[e]==null?0:e0[e]+1;return e0[e]=n,e+"-"+n},[e,t])}function d5(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];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 ou=d5(1),Fp=d5(-1);function Pre(e){return"clientX"in e&&"clientY"in e}function _S(e){if(!e)return!1;const{KeyboardEvent:t}=ra(e.target);return t&&e instanceof t}function Ure(e){if(!e)return!1;const{TouchEvent:t}=ra(e.target);return t&&e instanceof t}function db(e){if(Ure(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 Pre(e)?{x:e.clientX,y:e.clientY}:null}const vf=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[vf.Translate.toString(e),vf.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),uj="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Fre(e){return e.matches(uj)?e:e.querySelector(uj)}const zre={display:"none"};function Vre(e){let{id:t,value:n}=e;return ye.createElement("div",{id:t,style:zre},n)}function $re(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const s={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:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function Hre(){const[e,t]=p.useState("");return{announce:p.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const f5=p.createContext(null);function Bre(e){const t=p.useContext(f5);p.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Gre(){const[e]=p.useState(()=>new Set),t=p.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[p.useCallback(r=>{let{type:s,event:l}=r;e.forEach(c=>{var d;return(d=c[s])==null?void 0:d.call(c,l)})},[e]),t]}const qre={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
|
-
`},Zre={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 Kre(e){let{announcements:t=Zre,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=qre}=e;const{announce:l,announcement:c}=Hre(),d=th("DndLiveRegion"),[f,h]=p.useState(!1);if(p.useEffect(()=>{h(!0)},[]),Bre(p.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(Vre,{id:r,value:s.draggable}),ye.createElement($re,{id:d,announcement:c}));return n?ds.createPortal(g,n):g}var rr;(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"})(rr||(rr={}));function zp(){}function h5(e,t){return p.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function m5(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return p.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const ys=Object.freeze({x:0,y:0});function Yre(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Wre(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Qre(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Xre(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function dj(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 p5=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=dj(t,t.left,t.top),l=[];for(const c of r){const{id:d}=c,f=n.get(d);if(f){const h=Yre(dj(f),s);l.push({id:d,data:{droppableContainer:c,value:h}})}}return l.sort(Wre)};function Jre(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),s=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height),c=s-r,d=l-n;if(r<s&&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 eae=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=[];for(const l of r){const{id:c}=l,d=n.get(c);if(d){const f=Jre(d,t);f>0&&s.push({id:c,data:{droppableContainer:l,value:f}})}}return s.sort(Qre)};function tae(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function g5(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ys}function nae(e){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),l=1;l<r;l++)s[l-1]=arguments[l];return s.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 rae=nae(1);function aae(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 sae(e,t,n){const r=aae(t);if(!r)return e;const{scaleX:s,scaleY:l,x:c,y:d}=r,f=e.left-c-(1-s)*parseFloat(n),h=e.top-d-(1-l)*parseFloat(n.slice(n.indexOf(" ")+1)),g=s?e.width/s: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 oae={ignoreTransform:!1};function zu(e,t){t===void 0&&(t=oae);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:h,transformOrigin:g}=ra(e).getComputedStyle(e);h&&(n=sae(n,h,g))}const{top:r,left:s,width:l,height:c,bottom:d,right:f}=n;return{top:r,left:s,width:l,height:c,bottom:d,right:f}}function fj(e){return zu(e,{ignoreTransform:!0})}function iae(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function lae(e,t){return t===void 0&&(t=ra(e).getComputedStyle(e)),t.position==="fixed"}function cae(e,t){t===void 0&&(t=ra(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const l=t[s];return typeof l=="string"?n.test(l):!1})}function NS(e,t){const n=[];function r(s){if(t!=null&&n.length>=t||!s)return n;if(TS(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!Jf(s)||u5(s)||n.includes(s))return n;const l=ra(e).getComputedStyle(s);return s!==e&&cae(s,l)&&n.push(s),lae(s,l)?n:r(s.parentNode)}return e?r(e):n}function y5(e){const[t]=NS(e,1);return t??null}function t0(e){return!qg||!e?null:Uu(e)?e:RS(e)?TS(e)||e===Fu(e).scrollingElement?window:Jf(e)?e:null:null}function v5(e){return Uu(e)?e.scrollX:e.scrollLeft}function x5(e){return Uu(e)?e.scrollY:e.scrollTop}function fb(e){return{x:v5(e),y:x5(e)}}var dr;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(dr||(dr={}));function b5(e){return!qg||!e?!1:e===document.scrollingElement}function S5(e){const t={x:0,y:0},n=b5(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},s=e.scrollTop<=t.y,l=e.scrollLeft<=t.x,c=e.scrollTop>=r.y,d=e.scrollLeft>=r.x;return{isTop:s,isLeft:l,isBottom:c,isRight:d,maxScroll:r,minScroll:t}}const uae={x:.2,y:.2};function dae(e,t,n,r,s){let{top:l,left:c,right:d,bottom:f}=n;r===void 0&&(r=10),s===void 0&&(s=uae);const{isTop:h,isBottom:g,isLeft:y,isRight:v}=S5(e),b={x:0,y:0},w={x:0,y:0},E={height:t.height*s.y,width:t.width*s.x};return!h&&l<=t.top+E.height?(b.y=dr.Backward,w.y=r*Math.abs((t.top+E.height-l)/E.height)):!g&&f>=t.bottom-E.height&&(b.y=dr.Forward,w.y=r*Math.abs((t.bottom-E.height-f)/E.height)),!v&&d>=t.right-E.width?(b.x=dr.Forward,w.x=r*Math.abs((t.right-E.width-d)/E.width)):!y&&c<=t.left+E.width&&(b.x=dr.Backward,w.x=r*Math.abs((t.left+E.width-c)/E.width)),{direction:b,speed:w}}function fae(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:s}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:s,width:e.clientWidth,height:e.clientHeight}}function C5(e){return e.reduce((t,n)=>ou(t,fb(n)),ys)}function hae(e){return e.reduce((t,n)=>t+v5(n),0)}function mae(e){return e.reduce((t,n)=>t+x5(n),0)}function pae(e,t){if(t===void 0&&(t=zu),!e)return;const{top:n,left:r,bottom:s,right:l}=t(e);y5(e)&&(s<=0||l<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const gae=[["x",["left","right"],hae],["y",["top","bottom"],mae]];class AS{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=NS(n),s=C5(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,c,d]of gae)for(const f of c)Object.defineProperty(this,f,{get:()=>{const h=d(r),g=s[l]-h;return this.rect[f]+g},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Jd{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 s;(s=this.target)==null||s.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function yae(e){const{EventTarget:t}=ra(e);return e instanceof t?e:Fu(e)}function n0(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 Ha;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Ha||(Ha={}));function hj(e){e.preventDefault()}function vae(e){e.stopPropagation()}var Ut;(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"})(Ut||(Ut={}));const E5={start:[Ut.Space,Ut.Enter],cancel:[Ut.Esc],end:[Ut.Space,Ut.Enter,Ut.Tab]},xae=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Ut.Right:return{...n,x:n.x+25};case Ut.Left:return{...n,x:n.x-25};case Ut.Down:return{...n,y:n.y+25};case Ut.Up:return{...n,y:n.y-25}}};class w5{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 Jd(Fu(n)),this.windowListeners=new Jd(ra(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ha.Resize,this.handleCancel),this.windowListeners.add(Ha.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ha.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&pae(r),n(ys)}handleKeyDown(t){if(_S(t)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:l=E5,coordinateGetter:c=xae,scrollBehavior:d="smooth"}=s,{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}:ys;this.referenceCoordinates||(this.referenceCoordinates=g);const y=c(t,{active:n,context:r.current,currentCoordinates:g});if(y){const v=Fp(y,g),b={x:0,y:0},{scrollableAncestors:w}=r.current;for(const E of w){const S=t.code,{isTop:R,isRight:T,isLeft:_,isBottom:D,maxScroll:A,minScroll:O}=S5(E),j=fae(E),M={x:Math.min(S===Ut.Right?j.right-j.width/2:j.right,Math.max(S===Ut.Right?j.left:j.left+j.width/2,y.x)),y:Math.min(S===Ut.Down?j.bottom-j.height/2:j.bottom,Math.max(S===Ut.Down?j.top:j.top+j.height/2,y.y))},F=S===Ut.Right&&!T||S===Ut.Left&&!_,G=S===Ut.Down&&!D||S===Ut.Up&&!R;if(F&&M.x!==y.x){const Y=E.scrollLeft+v.x,Z=S===Ut.Right&&Y<=A.x||S===Ut.Left&&Y>=O.x;if(Z&&!v.y){E.scrollTo({left:Y,behavior:d});return}Z?b.x=E.scrollLeft-Y:b.x=S===Ut.Right?E.scrollLeft-A.x:E.scrollLeft-O.x,b.x&&E.scrollBy({left:-b.x,behavior:d});break}else if(G&&M.y!==y.y){const Y=E.scrollTop+v.y,Z=S===Ut.Down&&Y<=A.y||S===Ut.Up&&Y>=O.y;if(Z&&!v.x){E.scrollTo({top:Y,behavior:d});return}Z?b.y=E.scrollTop-Y:b.y=S===Ut.Down?E.scrollTop-A.y:E.scrollTop-O.y,b.y&&E.scrollBy({top:-b.y,behavior:d});break}}this.handleMove(t,ou(Fp(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()}}w5.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=E5,onActivation:s}=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(),s==null||s({event:e.nativeEvent}),!0)}return!1}}];function mj(e){return!!(e&&"distance"in e)}function pj(e){return!!(e&&"delay"in e)}class DS{constructor(t,n,r){var s;r===void 0&&(r=yae(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=Fu(c),this.documentListeners=new Jd(this.document),this.listeners=new Jd(r),this.windowListeners=new Jd(ra(c)),this.initialCoordinates=(s=db(l))!=null?s:ys,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(Ha.Resize,this.handleCancel),this.windowListeners.add(Ha.DragStart,hj),this.windowListeners.add(Ha.VisibilityChange,this.handleCancel),this.windowListeners.add(Ha.ContextMenu,hj),this.documentListeners.add(Ha.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(pj(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(mj(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:s}=this.props;s(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Ha.Click,vae,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ha.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:s,props:l}=this,{onMove:c,options:{activationConstraint:d}}=l;if(!s)return;const f=(n=db(t))!=null?n:ys,h=Fp(s,f);if(!r&&d){if(mj(d)){if(d.tolerance!=null&&n0(h,d.tolerance))return this.handleCancel();if(n0(h,d.distance))return this.handleStart()}if(pj(d)&&n0(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===Ut.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const bae={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Zg extends DS{constructor(t){const{event:n}=t,r=Fu(n.target);super(t,bae,r)}}Zg.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 Sae={move:{name:"mousemove"},end:{name:"mouseup"}};var hb;(function(e){e[e.RightClick=2]="RightClick"})(hb||(hb={}));class Cae extends DS{constructor(t){super(t,Sae,Fu(t.event.target))}}Cae.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===hb.RightClick?!1:(r==null||r({event:n}),!0)}}];const r0={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Eae extends DS{constructor(t){super(t,r0)}static setup(){return window.addEventListener(r0.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(r0.move.name,t)};function t(){}}}Eae.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:s}=n;return s.length>1?!1:(r==null||r({event:n}),!0)}}];var ef;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(ef||(ef={}));var Vp;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Vp||(Vp={}));function wae(e){let{acceleration:t,activator:n=ef.Pointer,canScroll:r,draggingRect:s,enabled:l,interval:c=5,order:d=Vp.TreeOrder,pointerCoordinates:f,scrollableAncestors:h,scrollableAncestorRects:g,delta:y,threshold:v}=e;const b=Tae({delta:y,disabled:!l}),[w,E]=Lre(),S=p.useRef({x:0,y:0}),R=p.useRef({x:0,y:0}),T=p.useMemo(()=>{switch(n){case ef.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case ef.DraggableRect:return s}},[n,s,f]),_=p.useRef(null),D=p.useCallback(()=>{const O=_.current;if(!O)return;const j=S.current.x*R.current.x,M=S.current.y*R.current.y;O.scrollBy(j,M)},[]),A=p.useMemo(()=>d===Vp.TreeOrder?[...h].reverse():h,[d,h]);p.useEffect(()=>{if(!l||!h.length||!T){E();return}for(const O of A){if((r==null?void 0:r(O))===!1)continue;const j=h.indexOf(O),M=g[j];if(!M)continue;const{direction:F,speed:G}=dae(O,M,T,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){E(),_.current=O,w(D,c),S.current=G,R.current=F;return}}S.current={x:0,y:0},R.current={x:0,y:0},E()},[t,D,r,E,l,c,JSON.stringify(T),JSON.stringify(b),w,h,A,g,JSON.stringify(v)])}const Rae={x:{[dr.Backward]:!1,[dr.Forward]:!1},y:{[dr.Backward]:!1,[dr.Forward]:!1}};function Tae(e){let{delta:t,disabled:n}=e;const r=ub(t);return eh(s=>{if(n||!r||!s)return Rae;const l={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[dr.Backward]:s.x[dr.Backward]||l.x===-1,[dr.Forward]:s.x[dr.Forward]||l.x===1},y:{[dr.Backward]:s.y[dr.Backward]||l.y===-1,[dr.Forward]:s.y[dr.Forward]||l.y===1}}},[n,t,r])}function jae(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return eh(s=>{var l;return t==null?null:(l=r??s)!=null?l:null},[r,t])}function _ae(e,t){return p.useMemo(()=>e.reduce((n,r)=>{const{sensor:s}=r,l=s.activators.map(c=>({eventName:c.eventName,handler:t(c.handler,r)}));return[...n,...l]},[]),[e,t])}var xf;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(xf||(xf={}));var mb;(function(e){e.Optimized="optimized"})(mb||(mb={}));const gj=new Map;function Nae(e,t){let{dragging:n,dependencies:r,config:s}=t;const[l,c]=p.useState(null),{frequency:d,measure:f,strategy:h}=s,g=p.useRef(e),y=S(),v=yf(y),b=p.useCallback(function(R){R===void 0&&(R=[]),!v.current&&c(T=>T===null?R:T.concat(R.filter(_=>!T.includes(_))))},[v]),w=p.useRef(null),E=eh(R=>{if(y&&!n)return gj;if(!R||R===gj||g.current!==e||l!=null){const T=new Map;for(let _ of e){if(!_)continue;if(l&&l.length>0&&!l.includes(_.id)&&_.rect.current){T.set(_.id,_.rect.current);continue}const D=_.node.current,A=D?new AS(f(D),D):null;_.rect.current=A,A&&T.set(_.id,A)}return T}return R},[e,l,n,y,f]);return p.useEffect(()=>{g.current=e},[e]),p.useEffect(()=>{y||b()},[n,y]),p.useEffect(()=>{l&&l.length>0&&c(null)},[JSON.stringify(l)]),p.useEffect(()=>{y||typeof d!="number"||w.current!==null||(w.current=setTimeout(()=>{b(),w.current=null},d))},[d,y,b,...r]),{droppableRects:E,measureDroppableContainers:b,measuringScheduled:l!=null};function S(){switch(h){case xf.Always:return!1;case xf.BeforeDragging:return n;default:return!n}}}function R5(e,t){return eh(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Aae(e,t){return R5(e,t)}function Dae(e){let{callback:t,disabled:n}=e;const r=jS(t),s=p.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:l}=window;return new l(r)},[r,n]);return p.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function Kg(e){let{callback:t,disabled:n}=e;const r=jS(t),s=p.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:l}=window;return new l(r)},[n]);return p.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function Oae(e){return new AS(zu(e),e)}function yj(e,t,n){t===void 0&&(t=Oae);const[r,s]=p.useState(null);function l(){s(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=Dae({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=Kg({callback:l});return Bs(()=>{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 Mae(e){const t=R5(e);return g5(e,t)}const vj=[];function Iae(e){const t=p.useRef(e),n=eh(r=>e?r&&r!==vj&&e&&t.current&&e.parentNode===t.current.parentNode?r:NS(e):vj,[e]);return p.useEffect(()=>{t.current=e},[e]),n}function kae(e){const[t,n]=p.useState(null),r=p.useRef(e),s=p.useCallback(l=>{const c=t0(l.target);c&&n(d=>d?(d.set(c,fb(c)),new Map(d)):null)},[]);return p.useEffect(()=>{const l=r.current;if(e!==l){c(l);const d=e.map(f=>{const h=t0(f);return h?(h.addEventListener("scroll",s,{passive:!0}),[h,fb(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=t0(f);h==null||h.removeEventListener("scroll",s)})}},[s,e]),p.useMemo(()=>e.length?t?Array.from(t.values()).reduce((l,c)=>ou(l,c),ys):C5(e):ys,[e,t])}function xj(e,t){t===void 0&&(t=[]);const n=p.useRef(null);return p.useEffect(()=>{n.current=null},t),p.useEffect(()=>{const r=e!==ys;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Fp(e,n.current):ys}function Lae(e){p.useEffect(()=>{if(!qg)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 Pae(e,t){return p.useMemo(()=>e.reduce((n,r)=>{let{eventName:s,handler:l}=r;return n[s]=c=>{l(c,t)},n},{}),[e,t])}function T5(e){return p.useMemo(()=>e?iae(e):null,[e])}const bj=[];function Uae(e,t){t===void 0&&(t=zu);const[n]=e,r=T5(n?ra(n):null),[s,l]=p.useState(bj);function c(){l(()=>e.length?e.map(f=>b5(f)?r:new AS(t(f),f)):bj)}const d=Kg({callback:c});return Bs(()=>{d==null||d.disconnect(),c(),e.forEach(f=>d==null?void 0:d.observe(f))},[e]),s}function Fae(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Jf(t)?t:e}function zae(e){let{measure:t}=e;const[n,r]=p.useState(null),s=p.useCallback(h=>{for(const{target:g}of h)if(Jf(g)){r(y=>{const v=t(g);return y?{...y,width:v.width,height:v.height}:v});break}},[t]),l=Kg({callback:s}),c=p.useCallback(h=>{const g=Fae(h);l==null||l.disconnect(),g&&(l==null||l.observe(g)),r(g?t(g):null)},[t,l]),[d,f]=Up(c);return p.useMemo(()=>({nodeRef:d,rect:n,setRef:f}),[n,d,f])}const Vae=[{sensor:Zg,options:{}},{sensor:w5,options:{}}],$ae={current:{}},Jm={draggable:{measure:fj},droppable:{measure:fj,strategy:xf.WhileDragging,frequency:mb.Optimized},dragOverlay:{measure:zu}};class tf 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 Hae={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new tf,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:zp},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Jm,measureDroppableContainers:zp,windowRect:null,measuringScheduled:!1},Bae={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:zp,draggableNodes:new Map,over:null,measureDroppableContainers:zp},Yg=p.createContext(Bae),j5=p.createContext(Hae);function Gae(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new tf}}}function qae(e,t){switch(t.type){case rr.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case rr.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 rr.DragEnd:case rr.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case rr.RegisterDroppable:{const{element:n}=t,{id:r}=n,s=new tf(e.droppable.containers);return s.set(r,n),{...e,droppable:{...e.droppable,containers:s}}}case rr.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=t,l=e.droppable.containers.get(n);if(!l||r!==l.key)return e;const c=new tf(e.droppable.containers);return c.set(n,{...l,disabled:s}),{...e,droppable:{...e.droppable,containers:c}}}case rr.UnregisterDroppable:{const{id:n,key:r}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const l=new tf(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function Zae(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:s}=p.useContext(Yg),l=ub(r),c=ub(n==null?void 0:n.id);return p.useEffect(()=>{if(!t&&!r&&l&&c!=null){if(!_S(l)||document.activeElement===l.target)return;const d=s.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=Fre(g);if(y){y.focus();break}}})}},[r,t,s,c,l]),null}function Kae(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((s,l)=>l({transform:s,...r}),n):n}function Yae(e){return p.useMemo(()=>({draggable:{...Jm.draggable,...e==null?void 0:e.draggable},droppable:{...Jm.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Jm.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 Wae(e){let{activeNode:t,measure:n,initialRect:r,config:s=!0}=e;const l=p.useRef(!1),{x:c,y:d}=typeof s=="boolean"?{x:s,y:s}:s;Bs(()=>{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=g5(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=y5(h);v&&v.scrollBy({top:y.y,left:y.x})}},[t,c,d,r,n])}const _5=p.createContext({...ys,scaleX:1,scaleY:1});var gi;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(gi||(gi={}));const N5=p.memo(function(t){var n,r,s,l;let{id:c,accessibility:d,autoScroll:f=!0,children:h,sensors:g=Vae,collisionDetection:y=eae,measuring:v,modifiers:b,...w}=t;const E=p.useReducer(qae,void 0,Gae),[S,R]=E,[T,_]=Gre(),[D,A]=p.useState(gi.Uninitialized),O=D===gi.Initialized,{draggable:{active:j,nodes:M,translate:F},droppable:{containers:G}}=S,Y=j!=null?M.get(j):null,Z=p.useRef({initial:null,translated:null}),ee=p.useMemo(()=>{var gn;return j!=null?{id:j,data:(gn=Y==null?void 0:Y.data)!=null?gn:$ae,rect:Z}:null},[j,Y]),$=p.useRef(null),[W,k]=p.useState(null),[H,B]=p.useState(null),ie=yf(w,Object.values(w)),xe=th("DndDescribedBy",c),L=p.useMemo(()=>G.getEnabled(),[G]),P=Yae(v),{droppableRects:q,measureDroppableContainers:te,measuringScheduled:ue}=Nae(L,{dragging:O,dependencies:[F.x,F.y],config:P.droppable}),ve=jae(M,j),le=p.useMemo(()=>H?db(H):null,[H]),Ne=Es(),we=Aae(ve,P.draggable.measure);Wae({activeNode:j!=null?M.get(j):null,config:Ne.layoutShiftCompensation,initialRect:we,measure:P.draggable.measure});const _e=yj(ve,P.draggable.measure,we),He=yj(ve?ve.parentElement:null),We=p.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}),Ft=G.getNodeFor((n=We.current.over)==null?void 0:n.id),jt=zae({measure:P.dragOverlay.measure}),Bt=(r=jt.nodeRef.current)!=null?r:ve,xn=O?(s=jt.rect)!=null?s:_e:null,jr=!!(jt.nodeRef.current&&jt.rect),aa=Mae(jr?null:_e),Fe=T5(Bt?ra(Bt):null),U=Iae(O?Ft??ve:null),Q=Uae(U),de=Kae(b,{transform:{x:F.x-aa.x,y:F.y-aa.y,scaleX:1,scaleY:1},activatorEvent:H,active:ee,activeNodeRect:_e,containerNodeRect:He,draggingNodeRect:xn,over:We.current.over,overlayNodeRect:jt.rect,scrollableAncestors:U,scrollableAncestorRects:Q,windowRect:Fe}),je=le?ou(le,F):null,be=kae(U),Ee=xj(be),Ye=xj(be,[_e]),st=ou(de,Ee),ot=xn?rae(xn,de):null,mn=ee&&ot?y({active:ee,collisionRect:ot,droppableRects:q,droppableContainers:L,pointerCoordinates:je}):null,Na=Xre(mn,"id"),[pn,zo]=p.useState(null),Dn=jr?de:ou(de,Ye),bn=tae(Dn,(l=pn==null?void 0:pn.rect)!=null?l:null,_e),hr=p.useRef(null),Sn=p.useCallback((gn,dn)=>{let{sensor:Vn,options:mr}=dn;if($.current==null)return;const Qn=M.get($.current);if(!Qn)return;const On=gn.nativeEvent,_r=new Vn({active:$.current,activeNode:Qn,event:On,options:mr,context:We,onAbort(z){if(!M.get(z))return;const{onDragAbort:se}=ie.current,ge={id:z};se==null||se(ge),T({type:"onDragAbort",event:ge})},onPending(z,X,se,ge){if(!M.get(z))return;const{onDragPending:ze}=ie.current,ke={id:z,constraint:X,initialCoordinates:se,offset:ge};ze==null||ze(ke),T({type:"onDragPending",event:ke})},onStart(z){const X=$.current;if(X==null)return;const se=M.get(X);if(!se)return;const{onDragStart:ge}=ie.current,Re={activatorEvent:On,active:{id:X,data:se.data,rect:Z}};ds.unstable_batchedUpdates(()=>{ge==null||ge(Re),A(gi.Initializing),R({type:rr.DragStart,initialCoordinates:z,active:X}),T({type:"onDragStart",event:Re}),k(hr.current),B(On)})},onMove(z){R({type:rr.DragMove,coordinates:z})},onEnd:Br(rr.DragEnd),onCancel:Br(rr.DragCancel)});hr.current=_r;function Br(z){return async function(){const{active:se,collisions:ge,over:Re,scrollAdjustedTranslate:ze}=We.current;let ke=null;if(se&&ze){const{cancelDrop:Me}=ie.current;ke={activatorEvent:On,active:se,collisions:ge,delta:ze,over:Re},z===rr.DragEnd&&typeof Me=="function"&&await Promise.resolve(Me(ke))&&(z=rr.DragCancel)}$.current=null,ds.unstable_batchedUpdates(()=>{R({type:z}),A(gi.Uninitialized),zo(null),k(null),B(null),hr.current=null;const Me=z===rr.DragEnd?"onDragEnd":"onDragCancel";if(ke){const Le=ie.current[Me];Le==null||Le(ke),T({type:Me,event:ke})}})}}},[M]),Wi=p.useCallback((gn,dn)=>(Vn,mr)=>{const Qn=Vn.nativeEvent,On=M.get(mr);if($.current!==null||!On||Qn.dndKit||Qn.defaultPrevented)return;const _r={active:On};gn(Vn,dn.options,_r)===!0&&(Qn.dndKit={capturedBy:dn.sensor},$.current=mr,Sn(Vn,dn))},[M,Sn]),Cs=_ae(g,Wi);Lae(g),Bs(()=>{_e&&D===gi.Initializing&&A(gi.Initialized)},[_e,D]),p.useEffect(()=>{const{onDragMove:gn}=ie.current,{active:dn,activatorEvent:Vn,collisions:mr,over:Qn}=We.current;if(!dn||!Vn)return;const On={active:dn,activatorEvent:Vn,collisions:mr,delta:{x:st.x,y:st.y},over:Qn};ds.unstable_batchedUpdates(()=>{gn==null||gn(On),T({type:"onDragMove",event:On})})},[st.x,st.y]),p.useEffect(()=>{const{active:gn,activatorEvent:dn,collisions:Vn,droppableContainers:mr,scrollAdjustedTranslate:Qn}=We.current;if(!gn||$.current==null||!dn||!Qn)return;const{onDragOver:On}=ie.current,_r=mr.get(Na),Br=_r&&_r.rect.current?{id:_r.id,rect:_r.rect.current,data:_r.data,disabled:_r.disabled}:null,z={active:gn,activatorEvent:dn,collisions:Vn,delta:{x:Qn.x,y:Qn.y},over:Br};ds.unstable_batchedUpdates(()=>{zo(Br),On==null||On(z),T({type:"onDragOver",event:z})})},[Na]),Bs(()=>{We.current={activatorEvent:H,active:ee,activeNode:ve,collisionRect:ot,collisions:mn,droppableRects:q,draggableNodes:M,draggingNode:Bt,draggingNodeRect:xn,droppableContainers:G,over:pn,scrollableAncestors:U,scrollAdjustedTranslate:st},Z.current={initial:xn,translated:ot}},[ee,ve,mn,ot,M,Bt,xn,q,G,pn,U,st]),wae({...Ne,delta:F,draggingRect:ot,pointerCoordinates:je,scrollableAncestors:U,scrollableAncestorRects:Q});const Vo=p.useMemo(()=>({active:ee,activeNode:ve,activeNodeRect:_e,activatorEvent:H,collisions:mn,containerNodeRect:He,dragOverlay:jt,draggableNodes:M,droppableContainers:G,droppableRects:q,over:pn,measureDroppableContainers:te,scrollableAncestors:U,scrollableAncestorRects:Q,measuringConfiguration:P,measuringScheduled:ue,windowRect:Fe}),[ee,ve,_e,H,mn,He,jt,M,G,q,pn,te,U,Q,P,ue,Fe]),Ys=p.useMemo(()=>({activatorEvent:H,activators:Cs,active:ee,activeNodeRect:_e,ariaDescribedById:{draggable:xe},dispatch:R,draggableNodes:M,over:pn,measureDroppableContainers:te}),[H,Cs,ee,_e,R,xe,M,pn,te]);return ye.createElement(f5.Provider,{value:_},ye.createElement(Yg.Provider,{value:Ys},ye.createElement(j5.Provider,{value:Vo},ye.createElement(_5.Provider,{value:bn},h)),ye.createElement(Zae,{disabled:(d==null?void 0:d.restoreFocus)===!1})),ye.createElement(Kre,{...d,hiddenTextDescribedById:xe}));function Es(){const gn=(W==null?void 0:W.autoScrollEnabled)===!1,dn=typeof f=="object"?f.enabled===!1:f===!1,Vn=O&&!gn&&!dn;return typeof f=="object"?{...f,enabled:Vn}:{enabled:Vn}}}),Qae=p.createContext(null),Sj="button",Xae="Draggable";function Jae(e){let{id:t,data:n,disabled:r=!1,attributes:s}=e;const l=th(Xae),{activators:c,activatorEvent:d,active:f,activeNodeRect:h,ariaDescribedById:g,draggableNodes:y,over:v}=p.useContext(Yg),{role:b=Sj,roleDescription:w="draggable",tabIndex:E=0}=s??{},S=(f==null?void 0:f.id)===t,R=p.useContext(S?_5:Qae),[T,_]=Up(),[D,A]=Up(),O=Pae(c,t),j=yf(n);Bs(()=>(y.set(t,{id:t,key:l,node:T,activatorNode:D,data:j}),()=>{const F=y.get(t);F&&F.key===l&&y.delete(t)}),[y,t]);const M=p.useMemo(()=>({role:b,tabIndex:E,"aria-disabled":r,"aria-pressed":S&&b===Sj?!0:void 0,"aria-roledescription":w,"aria-describedby":g.draggable}),[r,b,E,S,w,g.draggable]);return{active:f,activatorEvent:d,activeNodeRect:h,attributes:M,isDragging:S,listeners:r?void 0:O,node:T,over:v,setNodeRef:_,setActivatorNodeRef:A,transform:R}}function ese(){return p.useContext(j5)}const tse="Droppable",nse={timeout:25};function rse(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:s}=e;const l=th(tse),{active:c,dispatch:d,over:f,measureDroppableContainers:h}=p.useContext(Yg),g=p.useRef({disabled:n}),y=p.useRef(!1),v=p.useRef(null),b=p.useRef(null),{disabled:w,updateMeasurementsFor:E,timeout:S}={...nse,...s},R=yf(E??r),T=p.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},S)},[S]),_=Kg({callback:T,disabled:w||!c}),D=p.useCallback((M,F)=>{_&&(F&&(_.unobserve(F),y.current=!1),M&&_.observe(M))},[_]),[A,O]=Up(D),j=yf(t);return p.useEffect(()=>{!_||!A.current||(_.disconnect(),y.current=!1,_.observe(A.current))},[A,_]),p.useEffect(()=>(d({type:rr.RegisterDroppable,element:{id:r,key:l,disabled:n,node:A,rect:v,data:j}}),()=>d({type:rr.UnregisterDroppable,key:l,id:r})),[r]),p.useEffect(()=>{n!==g.current.disabled&&(d({type:rr.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 A5(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function ase(e,t){return e.reduce((n,r,s)=>{const l=t.get(r);return l&&(n[s]=l),n},Array(e.length))}function Pm(e){return e!==null&&e>=0}function sse(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 ose(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const D5=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const l=A5(t,r,n),c=t[s],d=l[s];return!d||!c?null:{x:d.left-c.left,y:d.top-c.top,scaleX:d.width/c.width,scaleY:d.height/c.height}},Um={scaleX:1,scaleY:1},O5=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:s,rects:l,overIndex:c}=e;const d=(t=l[n])!=null?t:r;if(!d)return null;if(s===n){const h=l[c];return h?{x:0,y:n<c?h.top+h.height-(d.top+d.height):h.top-d.top,...Um}:null}const f=ise(l,s,n);return s>n&&s<=c?{x:0,y:-d.height-f,...Um}:s<n&&s>=c?{x:0,y:d.height+f,...Um}:{x:0,y:0,...Um}};function ise(e,t,n){const r=e[t],s=e[t-1],l=e[t+1];return r?n<t?s?r.top-(s.top+s.height):l?l.top-(r.top+r.height):0:l?l.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const M5="Sortable",I5=ye.createContext({activeIndex:-1,containerId:M5,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:D5,disabled:{draggable:!1,droppable:!1}});function k5(e){let{children:t,id:n,items:r,strategy:s=D5,disabled:l=!1}=e;const{active:c,dragOverlay:d,droppableRects:f,over:h,measureDroppableContainers:g}=ese(),y=th(M5,n),v=d.rect!==null,b=p.useMemo(()=>r.map(O=>typeof O=="object"&&"id"in O?O.id:O),[r]),w=c!=null,E=c?b.indexOf(c.id):-1,S=h?b.indexOf(h.id):-1,R=p.useRef(b),T=!sse(b,R.current),_=S!==-1&&E===-1||T,D=ose(l);Bs(()=>{T&&w&&g(b)},[T,b,w,g]),p.useEffect(()=>{R.current=b},[b]);const A=p.useMemo(()=>({activeIndex:E,containerId:y,disabled:D,disableTransforms:_,items:b,overIndex:S,useDragOverlay:v,sortedRects:ase(b,f),strategy:s}),[E,y,D.draggable,D.droppable,_,b,S,f,v,s]);return ye.createElement(I5.Provider,{value:A},t)}const lse=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return A5(n,r,s).indexOf(t)},cse=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:s,items:l,newIndex:c,previousItems:d,previousContainerId:f,transition:h}=e;return!h||!r||d!==l&&s===c?!1:n?!0:c!==s&&t===f},use={duration:200,easing:"ease"},L5="transform",dse=vf.Transition.toString({property:L5,duration:0,easing:"linear"}),fse={roleDescription:"sortable"};function hse(e){let{disabled:t,index:n,node:r,rect:s}=e;const[l,c]=p.useState(null),d=p.useRef(n);return Bs(()=>{if(!t&&n!==d.current&&r.current){const f=s.current;if(f){const h=zu(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,s]),p.useEffect(()=>{l&&c(null)},[l]),l}function mse(e){let{animateLayoutChanges:t=cse,attributes:n,disabled:r,data:s,getNewIndex:l=lse,id:c,strategy:d,resizeObserverConfig:f,transition:h=use}=e;const{items:g,containerId:y,activeIndex:v,disabled:b,disableTransforms:w,sortedRects:E,overIndex:S,useDragOverlay:R,strategy:T}=p.useContext(I5),_=pse(r,b),D=g.indexOf(c),A=p.useMemo(()=>({sortable:{containerId:y,index:D,items:g},...s}),[y,s,D,g]),O=p.useMemo(()=>g.slice(g.indexOf(c)),[g,c]),{rect:j,node:M,isOver:F,setNodeRef:G}=rse({id:c,data:A,disabled:_.droppable,resizeObserverConfig:{updateMeasurementsFor:O,...f}}),{active:Y,activatorEvent:Z,activeNodeRect:ee,attributes:$,setNodeRef:W,listeners:k,isDragging:H,over:B,setActivatorNodeRef:ie,transform:xe}=Jae({id:c,data:A,attributes:{...fse,...n},disabled:_.draggable}),L=kre(G,W),P=!!Y,q=P&&!w&&Pm(v)&&Pm(S),te=!R&&H,ue=te&&q?xe:null,le=q?ue??(d??T)({rects:E,activeNodeRect:ee,activeIndex:v,overIndex:S,index:D}):null,Ne=Pm(v)&&Pm(S)?l({id:c,items:g,activeIndex:v,overIndex:S}):D,we=Y==null?void 0:Y.id,_e=p.useRef({activeId:we,items:g,newIndex:Ne,containerId:y}),He=g!==_e.current.items,We=t({active:Y,containerId:y,isDragging:H,isSorting:P,id:c,index:D,items:g,newIndex:_e.current.newIndex,previousItems:_e.current.items,previousContainerId:_e.current.containerId,transition:h,wasDragging:_e.current.activeId!=null}),Ft=hse({disabled:!We,index:D,node:M,rect:j});return p.useEffect(()=>{P&&_e.current.newIndex!==Ne&&(_e.current.newIndex=Ne),y!==_e.current.containerId&&(_e.current.containerId=y),g!==_e.current.items&&(_e.current.items=g)},[P,Ne,y,g]),p.useEffect(()=>{if(we===_e.current.activeId)return;if(we&&!_e.current.activeId){_e.current.activeId=we;return}const Bt=setTimeout(()=>{_e.current.activeId=we},50);return()=>clearTimeout(Bt)},[we]),{active:Y,activeIndex:v,attributes:$,data:A,rect:j,index:D,newIndex:Ne,items:g,isOver:F,isSorting:P,isDragging:H,listeners:k,node:M,overIndex:S,over:B,setNodeRef:L,setActivatorNodeRef:ie,setDroppableNodeRef:G,setDraggableNodeRef:W,transform:Ft??le,transition:jt()};function jt(){if(Ft||He&&_e.current.newIndex===D)return dse;if(!(te&&!_S(Z)||!h)&&(P||We))return vf.Transition.toString({...h,property:L5})}}function pse(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}}Ut.Down,Ut.Right,Ut.Up,Ut.Left;function iu({value:e,placeholder:t="",onValueChange:n,minRows:r=1,isBold:s=!1,className:l,saveButtonText:c="Save",cancelButtonText:d="Discard"}){const[f,h]=p.useState(!1),[g,y]=p.useState(e),v=p.useRef(null),b=T=>{y(T.target.value)},w=()=>{n&&g!==e&&n(g.trim()),h(!1)},E=()=>{y(e),h(!1)},S=T=>{T.key==="Enter"&&!T.shiftKey?(r===1||T.ctrlKey)&&(T.preventDefault(),w()):T.key==="Escape"&&(T.preventDefault(),E())},R=T=>{h(T),T?(y(e),setTimeout(()=>{v.current&&v.current.focus()},0)):E()};return o.jsxs(gS,{open:f,onOpenChange:R,children:[o.jsx(yS,{asChild:!0,children:o.jsx("div",{className:ne("cursor-edit w-full min-w-[100px]",!e&&"text-gray-400",s&&"font-medium",l),children:e||t})}),o.jsxs(vS,{className:"w-auto max-w-[600px] min-w-[300px] p-2",align:"start",children:[o.jsx($i,{ref:v,value:g,onChange:b,onKeyDown:S,className:"min-h-[24px] resize-y",style:{minHeight:String(Math.max(r*24,24))+"px"},rows:r}),o.jsxs("div",{className:"mt-3 flex justify-end gap-2",children:[o.jsx(Se,{variant:"outline",size:"sm",onClick:E,className:"h-7 cursor-pointer px-2 text-xs",children:d}),o.jsx(Se,{size:"sm",onClick:w,className:"h-7 cursor-pointer px-2 text-xs",children:c})]})]})]})}function gse({isAllExpanded:e,onToggle:t}){return o.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?o.jsx(D9,{className:"h-4 w-4"}):o.jsx(Nb,{className:"h-4 w-4"})})}function yse({isExpanded:e,onToggle:t,ariaLabel:n}){return o.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?o.jsx(Qa,{className:"h-4 w-4"}):o.jsx(ja,{className:"h-4 w-4"})})}function vse({className:e="",...t}){return o.jsx("div",{...t,className:`flex cursor-grab items-center justify-center opacity-0 group-hover:opacity-100 active:cursor-grabbing ${e}`,children:o.jsx(oL,{className:"h-4 w-4 text-gray-400"})})}function P5({id:e,children:t}){const{attributes:n,listeners:r,setNodeRef:s,transform:l,transition:c,isDragging:d}=mse({id:e}),f={transform:vf.Transform.toString(l),transition:c,opacity:d?.75:1},h=p.Children.toArray(t),g=[o.jsx(Sa,{className:"bg-background dark:bg-muted",style:{width:20,position:"sticky",left:0,zIndex:2,paddingTop:8,paddingBottom:8,paddingLeft:4,paddingRight:0},children:o.jsx(vse,{...n,...r})},"drag-handle-cell"),...h.slice(1)];return o.jsx(sr,{ref:s,style:f,className:"group",children:g})}function U5({row:e,onDeleteRow:t,onAddNestedField:n,isRecordType:r}){const[s,l]=p.useState(!1),c=()=>{t&&t(e.index),l(!1)},d=r&&n&&r(e.index),f=!!t,h=d&&f;return o.jsxs("div",{className:"px-3 text-right",children:[o.jsxs(wr,{children:[o.jsx(Rr,{asChild:!0,children:o.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:o.jsx(Xa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsxs(Tr,{align:"end",children:[d&&o.jsxs(vt,{className:"cursor-pointer",onClick:()=>{n(e.index)},children:[o.jsx(_a,{className:"mr-2 h-4 w-4"}),"Add nested field"]}),h&&o.jsx(Ka,{}),f&&o.jsxs(vt,{onClick:()=>{l(!0)},children:[o.jsx(Lo,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),o.jsx("span",{className:"text-red-600",children:"Delete field"})]})]})]}),o.jsx(Hr,{open:s,onOpenChange:l,title:"Delete field",description:"Are you sure you want to delete this field?",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:c,variant:"destructive"})]})}function xse({mode:e,onModeChange:t}){const n=Object.values(pf),r=s=>{t&&t(s)};return o.jsxs(Ea,{value:e,onValueChange:r,children:[o.jsx(Ra,{className:"h-90 cursor-pointer",size:"sm",children:o.jsx(wa,{placeholder:"Select field mode"})}),o.jsx(Ta,{className:"max-h-[300px]",children:n.map(s=>o.jsx(Yn,{value:s,children:s},s))})]})}var Wg="Checkbox",[bse]=ir(Wg),[Sse,OS]=bse(Wg);function Cse(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:s,disabled:l,form:c,name:d,onCheckedChange:f,required:h,value:g="on",internal_do_not_use_render:y}=e,[v,b]=Vr({prop:n,defaultProp:s??!1,onChange:f,caller:Wg}),[w,E]=p.useState(null),[S,R]=p.useState(null),T=p.useRef(!1),_=w?!!c||!!w.closest("form"):!0,D={checked:v,disabled:l,setChecked:b,control:w,setControl:E,name:d,form:c,value:g,hasConsumerStoppedPropagationRef:T,required:h,defaultChecked:ji(s)?!1:s,isFormControl:_,bubbleInput:S,setBubbleInput:R};return o.jsx(Sse,{scope:t,...D,children:Ese(y)?y(D):r})}var F5="CheckboxTrigger",z5=p.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},s)=>{const{control:l,value:c,disabled:d,checked:f,required:h,setControl:g,setChecked:y,hasConsumerStoppedPropagationRef:v,isFormControl:b,bubbleInput:w}=OS(F5,e),E=ut(s,g),S=p.useRef(f);return p.useEffect(()=>{const R=l==null?void 0:l.form;if(R){const T=()=>y(S.current);return R.addEventListener("reset",T),()=>R.removeEventListener("reset",T)}},[l,y]),o.jsx(Je.button,{type:"button",role:"checkbox","aria-checked":ji(f)?"mixed":f,"aria-required":h,"data-state":q5(f),"data-disabled":d?"":void 0,disabled:d,value:c,...r,ref:E,onKeyDown:Te(t,R=>{R.key==="Enter"&&R.preventDefault()}),onClick:Te(n,R=>{y(T=>ji(T)?!0:!T),w&&b&&(v.current=R.isPropagationStopped(),v.current||R.stopPropagation())})})});z5.displayName=F5;var V5=p.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:l,required:c,disabled:d,value:f,onCheckedChange:h,form:g,...y}=e;return o.jsx(Cse,{__scopeCheckbox:n,checked:s,defaultChecked:l,disabled:d,required:c,onCheckedChange:h,name:r,form:g,value:f,internal_do_not_use_render:({isFormControl:v})=>o.jsxs(o.Fragment,{children:[o.jsx(z5,{...y,ref:t,__scopeCheckbox:n}),v&&o.jsx(G5,{__scopeCheckbox:n})]})})});V5.displayName=Wg;var $5="CheckboxIndicator",H5=p.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,l=OS($5,n);return o.jsx(Er,{present:r||ji(l.checked)||l.checked===!0,children:o.jsx(Je.span,{"data-state":q5(l.checked),"data-disabled":l.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});H5.displayName=$5;var B5="CheckboxBubbleInput",G5=p.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:l,defaultChecked:c,required:d,disabled:f,name:h,value:g,form:y,bubbleInput:v,setBubbleInput:b}=OS(B5,e),w=ut(n,b),E=J1(l),S=Zb(r);p.useEffect(()=>{const T=v;if(!T)return;const _=window.HTMLInputElement.prototype,A=Object.getOwnPropertyDescriptor(_,"checked").set,O=!s.current;if(E!==l&&A){const j=new Event("click",{bubbles:O});T.indeterminate=ji(l),A.call(T,ji(l)?!1:l),T.dispatchEvent(j)}},[v,E,l,s]);const R=p.useRef(ji(l)?!1:l);return o.jsx(Je.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,...S,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});G5.displayName=B5;function Ese(e){return typeof e=="function"}function ji(e){return e==="indeterminate"}function q5(e){return ji(e)?"indeterminate":e?"checked":"unchecked"}function Z5({className:e,...t}){return o.jsx(V5,{"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:o.jsx(H5,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:o.jsx(fr,{className:"size-3.5"})})})}function K5({isPrimaryKey:e,onPrimaryKeyChange:t}){const n=!!e,r=s=>{t&&t(s)};return o.jsx(Z5,{className:"cursor-pointer",checked:n,onCheckedChange:r,"aria-label":"Primary Key"})}const Cj={[Ga.CONNECTED]:{icon:Wp,color:"text-green-500",label:"Connected",description:"Field is connected to the data source"},[Ga.CONNECTED_WITH_DEFINITION_MISMATCH]:{icon:Qp,color:"text-orange-500",label:"Connected with issues",description:"Field is connected but has definition mismatches"},[Ga.DISCONNECTED]:{icon:NL,color:"text-red-500",label:"Disconnected",description:"Field is not connected to the data source"}};function Y5({status:e}){if(!e||!(e in Cj))return null;const t=Cj[e],{icon:n,color:r,label:s,description:l}=t,c=`schema-field-status-tooltip-${e}`;return o.jsx(fs,{children:o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx(n,{className:ne("h-5 w-5",r),role:"img","aria-label":s,"aria-describedby":c,tabIndex:0})}),o.jsxs(Et,{id:c,side:"bottom",role:"tooltip",children:[o.jsx("div",{className:"text-xs font-medium",children:s}),o.jsx("div",{className:"mt-1 max-w-xs text-xs break-words whitespace-normal",children:l})]})]})})}function W5({type:e,storageType:t,onTypeChange:n}){const r=t===Ie.GOOGLE_BIGQUERY?Object.values(kn):Object.values(B1),s=l=>{n&&(Ie.GOOGLE_BIGQUERY,n(l))};return o.jsxs(Ea,{value:e,onValueChange:s,children:[o.jsx(Ra,{className:"cursor-pointer",size:"sm",children:o.jsx(wa,{placeholder:"Select field type"})}),o.jsx(Ta,{className:"max-h-[300px]",children:r.map(l=>o.jsx(Yn,{value:l,children:l},l))})]})}function wse({table:e}){return o.jsx("div",{className:"px-3 text-right",children:o.jsxs(wr,{children:[o.jsx(Rr,{asChild:!0,children:o.jsx(Se,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:o.jsx(Xa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsx(Tr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>o.jsx(vt,{className:"capitalize",children:o.jsxs("label",{className:"flex items-center space-x-2",children:[o.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()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(fr,{className:"size-3.5 text-white"})})}),o.jsx("span",{children:t.columnDef.meta?t.columnDef.meta.title??t.id:t.id})]})},t.id))})]})})}function Rse({id:e,placeholder:t="Search",value:n,onChange:r,debounceTime:s=500,className:l,"aria-label":c}){const[d,f]=p.useState(n),h=p.useRef(!0);p.useEffect(()=>{(n===""||h.current)&&(f(n),h.current=!1)},[n]);const g=p.useCallback(y=>{const v=y.target.value;f(v);const b=setTimeout(()=>{r(v)},s);return()=>{clearTimeout(b)}},[r,s]);return o.jsxs("div",{className:"dm-card-toolbar-search",children:[o.jsx($l,{className:"dm-card-toolbar-search-icon","aria-hidden":"true"}),o.jsx(zt,{id:e,placeholder:t,value:d,onChange:g,className:l??"dm-card-toolbar-search-input","aria-label":c??t})]})}function Tse({searchInputId:e,onAddField:t,filterValue:n,onFilterChange:r,statusCounts:s,disabled:l=!1}){return o.jsxs("div",{className:"dm-card-toolbar",children:[o.jsx("div",{className:"dm-card-toolbar-left",children:o.jsx(Rse,{id:e,placeholder:"Search fields",value:n,onChange:r,className:"dm-card-toolbar-search-input","aria-label":"Search fields"})}),o.jsxs("div",{className:"dm-card-toolbar-right",children:[s&&o.jsx("div",{className:"mr-3 flex items-center gap-3",children:Object.entries(s).map(([c,d])=>d===0?null:o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Y5,{status:c}),o.jsx("span",{className:"text-sm font-medium text-gray-500",children:d})]},c))}),o.jsxs(Se,{variant:"outline",className:"dm-card-table-add-field-btn cursor-pointer",onClick:t,disabled:l,"aria-label":"Add new field",children:[o.jsx(_a,{className:"h-4 w-4","aria-hidden":"true"}),"Add Field"]})]})]})}const jse={dragHandle:{left:0,zIndex:1},status:{left:20,zIndex:1},name:{left:56,zIndex:1},actions:{right:0,zIndex:1}};function Ej(e,t={}){const n=jse[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 _se({fields:e,columns:t,onAddRow:n,fieldsForStatusCount:r,onSearchChange:s,dragContext:l,dragContextProps:c,rowComponent:d=sr,getRowId:f}){const{isSchemaActualizationLoading:h}=Wa(),g=t,y=l,v=d,{columnVisibility:b,setColumnVisibility:w}=Are(g),E=Au({data:e,columns:g,getCoreRowModel:Nu(),getFilteredRowModel:Gf(),columnResizeMode:"onChange",enableColumnResizing:!0,state:{columnVisibility:b},onColumnVisibilityChange:w,enableGlobalFilter:!0,globalFilterFn:Dre,defaultColumn:{enableResizing:!0,size:0,minSize:0}}),{value:S,onChange:R,searchValue:T}=Ore(E),_=p.useRef("");p.useEffect(()=>{s&&T!==_.current&&(_.current=T,s(T))},[T,s]);const D=p.useMemo(()=>{const j={[Ga.CONNECTED]:0,[Ga.CONNECTED_WITH_DEFINITION_MISMATCH]:0,[Ga.DISCONNECTED]:0};return(r??e).forEach(F=>{F.status in j&&j[F.status]++}),j},[e,r]);return o.jsxs("div",{className:"space-y-4",children:[n&&o.jsx(Tse,{table:E,searchInputId:"schema-fields-search-input",onAddField:n,filterValue:S,onFilterChange:R,statusCounts:D,disabled:h}),o.jsx("div",{className:"dm-card-table-wrap mb-0",children:o.jsxs(Du,{id:"schema-fields-table",className:"w-full table-auto",role:"table",children:[o.jsx(Ou,{className:"dm-card-table-header",children:E.getHeaderGroups().map(j=>o.jsx(sr,{className:"dm-card-table-header-row",children:j.headers.map(M=>o.jsx(Iu,{className:"bg-secondary dark:bg-background",style:Ej(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))},j.id))}),o.jsx(Mu,{className:"dm-card-table-body",children:E.getRowModel().rows.length?o.jsx(y,{...c,children:E.getRowModel().rows.map(j=>o.jsx(v,{id:f?f(j):j.index,row:j,children:j.getVisibleCells().map(M=>o.jsx(Sa,{className:"bg-background dark:bg-muted",style:Ej(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))},j.id))}):o.jsx(sr,{children:o.jsx(Sa,{colSpan:g.length,className:"text-center text-gray-400",style:{whiteSpace:"nowrap"},children:"Output schema has no configured fields"})})})]})}),n&&o.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:[o.jsx(_a,{className:"h-4 w-4","aria-hidden":"true"}),"Add Field"]})]})}function Q5({fields:e,onFieldsChange:t,onAddRow:n,createNewField:r,renderTypeCell:s,additionalColumns:l=[],fieldsForStatusCount:c,onSearchChange:d,nameColumnHeader:f,nameColumnCell:h,primaryKeyColumnCell:g,aliasColumnCell:y,descriptionColumnCell:v,actionsColumnCell:b,dragContext:w,dragContextProps:E,rowComponent:S,getRowId:R}){const T=p.useCallback((j,M)=>{if(t){const F=[...e];F[j]={...F[j],...M},t(F)}},[e,t]),_=p.useCallback(()=>{if(t){const j=r();t([...e,j])}},[e,t,r]),D=p.useCallback(j=>{if(t){const M=[...e];M.splice(j,1),t(M)}},[e,t]),A=p.useMemo(()=>[{id:"dragHandle",header:"",size:24,enableHiding:!1},{accessorKey:"status",header:"",size:36,cell:({row:j})=>o.jsx(Y5,{status:j.getValue("status")}),enableHiding:!1},{accessorKey:"name",header:f??(()=>o.jsxs(St,{children:[o.jsx(Ct,{className:"cursor-default",children:"Name"}),o.jsx(Et,{children:"Field name in the output schema"})]})),size:80,cell:({row:j})=>h?h({row:j,updateField:T}):o.jsx(iu,{value:jre(j.getValue("name")),onValueChange:M=>{T(j.index,{name:M})},placeholder:"Field name is required",isBold:!0}),enableHiding:!1},{accessorKey:"isPrimaryKey",header:()=>o.jsxs(St,{children:[o.jsx(Ct,{className:"cursor-default",children:"PK"}),o.jsx(Et,{children:"Is field must be considered as a part of the output Primary Key"})]}),size:36,cell:({row:j})=>g?g({row:j,updateField:T}):o.jsx(K5,{isPrimaryKey:j.getValue("isPrimaryKey"),onPrimaryKeyChange:M=>{T(j.index,{isPrimaryKey:M})}}),enableHiding:!1},{accessorKey:"alias",header:()=>o.jsxs(St,{children:[o.jsx(Ct,{className:"cursor-default",children:"Alias"}),o.jsx(Et,{children:"Alternative name for the field"})]}),size:80,cell:({row:j})=>y?y({row:j,updateField:T}):o.jsx(iu,{value:j.getValue("alias"),onValueChange:M=>{T(j.index,{alias:M})},placeholder:"-"})},{accessorKey:"description",header:()=>o.jsxs(St,{children:[o.jsx(Ct,{className:"cursor-default",children:"Description"}),o.jsx(Et,{children:"Detailed information about the field"})]}),cell:({row:j})=>v?v({row:j,updateField:T}):o.jsx(iu,{value:j.getValue("description"),onValueChange:M=>{T(j.index,{description:M})},minRows:5,placeholder:"-"})},{id:"actions",header:({table:j})=>o.jsx(wse,{table:j}),cell:({row:j,table:M})=>b?b({row:j,table:M}):o.jsx(U5,{row:j,onDeleteRow:t?D:void 0}),size:40,enableResizing:!1,enableHiding:!1}],[T,D,t,f,h,g,y,v,b]),O=p.useMemo(()=>{const M={accessorKey:"type",header:()=>o.jsxs(St,{children:[o.jsx(Ct,{className:"cursor-default pl-[12px]",children:"Type"}),o.jsx(Et,{children:"Data type of the field"})]}),size:80,cell:G=>s({row:G.row,updateField:T}),enableHiding:!1},F=[...A];if(F.splice(3,0,M),l.length>0){const G=[...l];G.sort((Y,Z)=>{const ee=Y.columnIndex??1/0,$=Z.columnIndex??1/0;return ee-$}),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,s,T,l]);return o.jsx(_se,{fields:e,columns:O,onFieldsChange:t,onAddRow:n??(t?_:void 0),fieldsForStatusCount:c,onSearchChange:d,dragContext:w,dragContextProps:E,rowComponent:S,getRowId:R})}function Nse({fields:e,onFieldsChange:t}){const{expandedRecords:n,hasRecordFields:r,toggleRecordExpansion:s,toggleAllRecords:l,flattenedFields:c,handleSearchChange:d,isRecordType:f,topLevelFields:h,allExpanded:g}=Mre(e),{updateField:y,handleDeleteRow:v,handleAddNestedField:b,handleAddRow:w}=Ire(e,c,t,Y=>Y),E=p.useCallback(()=>({name:"",type:kn.STRING,mode:pf.NULLABLE,isPrimaryKey:!1,status:Ga.DISCONNECTED}),[]),S=p.useCallback(({row:Y})=>o.jsx(W5,{type:Y.getValue("type"),storageType:Ie.GOOGLE_BIGQUERY,onTypeChange:Z=>{y(Y.index,{type:Z})}}),[y]),R=p.useMemo(()=>[{accessorKey:"mode",header:()=>o.jsxs(St,{children:[o.jsx(Ct,{className:"cursor-default pl-[12px]",children:"Mode"}),o.jsx(Et,{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})=>o.jsx(xse,{mode:Y.getValue("mode"),onModeChange:Z=>{y(Y.index,{mode:Z})}}),columnIndex:4}],[y]),T=p.useCallback(()=>o.jsxs("div",{className:"flex items-center",children:[r&&o.jsx(gse,{isAllExpanded:g,onToggle:l}),o.jsxs(St,{children:[o.jsx(Ct,{className:"cursor-default",children:"Name"}),o.jsx(Et,{children:"Field name in the output schema"})]})]}),[r,g,l]),_=p.useCallback(({row:Y})=>{const Z=c[Y.index],$=(Z.type===kn.RECORD||Z.type===kn.STRUCT)&&Z.fields&&Z.fields.length>0,W=Z.path??"",k=Z.level??0,H=n.has(W);return o.jsxs("div",{className:"flex items-center",children:[k>0&&o.jsx("div",{style:{width:`${String(k*16-($?4:0))}px`},className:"flex-shrink-0"}),$?o.jsx(yse,{isExpanded:H,onToggle:()=>{s(W)},ariaLabel:H?"Collapse nested fields":"Expand nested fields"}):r&&o.jsx("div",{className:"w-5"}),o.jsx(iu,{value:Y.getValue("name"),onValueChange:B=>{y(Y.index,{name:B})},placeholder:"Field name is required",isBold:!0})]})},[c,n,r,s,y]),D=p.useCallback(({row:Y})=>{const Z=c[Y.index],ee=Z.type===kn.RECORD||Z.type===kn.STRUCT;return(Z.level??0)===0&&!ee?o.jsx(K5,{isPrimaryKey:Y.getValue("isPrimaryKey"),onPrimaryKeyChange:W=>{y(Y.index,{isPrimaryKey:W})}}):o.jsx("div",{})},[c,y]),A=p.useCallback(({row:Y})=>o.jsx(iu,{value:Y.getValue("description"),onValueChange:Z=>{y(Y.index,{description:Z})},minRows:5,placeholder:"-"}),[y]),O=p.useCallback(({row:Y})=>o.jsx(iu,{value:Y.getValue("alias"),onValueChange:Z=>{y(Y.index,{alias:Z})},placeholder:"-"}),[y]),j=p.useCallback(({row:Y})=>o.jsx(U5,{row:Y,onDeleteRow:t?v:void 0,onAddNestedField:t?b:void 0,isRecordType:f}),[t,v,b,f]),{handleDragEnd:M}=c5(e,t,c),F=p.useCallback(Y=>{const Z=c[Y.index];return Z.path??String(c.indexOf(Z))},[c]),G=m5(h5(Zg,{activationConstraint:{distance:5}}));return o.jsx(N5,{sensors:G,collisionDetection:p5,onDragEnd:M,children:o.jsx(Q5,{fields:c,onFieldsChange:t,onAddRow:w,createNewField:E,renderTypeCell:S,additionalColumns:R,fieldsForStatusCount:h,onSearchChange:d,nameColumnHeader:T,nameColumnCell:_,primaryKeyColumnCell:D,aliasColumnCell:O,descriptionColumnCell:A,actionsColumnCell:j,dragContext:k5,dragContextProps:{items:c.map(Y=>Y.path??String(c.indexOf(Y))),strategy:O5},rowComponent:P5,getRowId:F})})}function Ase({fields:e,onFieldsChange:t}){const n=p.useCallback(()=>({name:"",type:B1.STRING,isPrimaryKey:!1,status:Ga.DISCONNECTED}),[]),r=p.useCallback(({row:c,updateField:d})=>o.jsx(W5,{type:c.getValue("type"),storageType:Ie.AWS_ATHENA,onTypeChange:f=>{d(c.index,{type:f})}}),[]),{handleDragEnd:s}=c5(e,t),l=m5(h5(Zg,{activationConstraint:{distance:5}}));return o.jsx(N5,{sensors:l,collisionDetection:p5,onDragEnd:s,children:o.jsx(Q5,{fields:e,onFieldsChange:t,createNewField:n,renderTypeCell:r,dragContext:k5,dragContextProps:{items:e.map((c,d)=>d),strategy:O5},rowComponent:P5})})}function Dse({schema:e,storageType:t,onFieldsChange:n}){const r=p.useMemo(()=>{if(!e){const s=Tre(t);return n(s.fields),s}return e},[e,t,n]);return s5(r)?o.jsx(Nse,{fields:r.fields,onFieldsChange:n}):o5(r)?o.jsx(Ase,{fields:r.fields,onFieldsChange:n}):o.jsx("div",{className:"p-4 text-center",children:o.jsx("p",{children:"Unsupported schema type"})})}function Ose({definitionType:e}){const{dataMart:t,updateDataMartSchema:n,isLoading:r,error:s,runSchemaActualization:l,isSchemaActualizationLoading:c}=Wa(),{id:d="",schema:f}=t??{},{schema:h,isDirty:g,updateSchema:y,resetSchema:v}=_re(f),{operationStatus:b,startSaveOperation:w}=Nre(r,s);p.useEffect(()=>{b==="success"&&v()},[b,v]);const E=p.useCallback(D=>{y(D)},[y]),S=p.useCallback(()=>{d&&h&&(w(),n(d,h).then(()=>{l==null||l()}))},[d,h,w,n,l]),R=p.useCallback(()=>{l==null||l()},[l]),T=p.useCallback(()=>{v()},[v]),_=r||c;return t?o.jsxs("div",{className:"space-y-4",children:[o.jsx(Dse,{schema:h,storageType:t.storage.type,onFieldsChange:E}),o.jsxs("div",{className:"align-items-center mt-8 flex justify-between",children:[o.jsxs("div",{className:"flex space-x-4",children:[o.jsx(Se,{variant:"default",onClick:S,disabled:!g||_,children:"Save"}),o.jsx(Se,{type:"button",variant:"ghost",onClick:T,disabled:!g||_,children:"Discard"})]}),o.jsx(Se,{type:"button",variant:"outline",onClick:R,disabled:!e||_,children:"Refresh schema"})]})]}):o.jsx("div",{children:"Error: Data mart not found"})}function Mse(){const e=Xj(),{id:t,projectId:n}=e;return t?n?o.jsx("div",{className:"dm-page",children:o.jsx(N3,{children:o.jsx(TJ,{id:t})})}):o.jsx("div",{className:"dm-page-header",children:"Project ID is required"}):o.jsx("div",{className:"dm-page-header",children:"Data Mart ID is required"})}function Ise({className:e,...t}){return o.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 kse({className:e,...t}){return o.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 Lse({className:e,...t}){return o.jsx("div",{"data-slot":"card-title",className:ne("leading-none font-semibold",e),...t})}function Pse({className:e,...t}){return o.jsx("div",{"data-slot":"card-description",className:ne("text-muted-foreground text-sm",e),...t})}function Use({className:e,...t}){return o.jsx("div",{"data-slot":"card-content",className:ne("px-6",e),...t})}function Fse({className:e,...t}){return o.jsx("div",{"data-slot":"card-footer",className:ne("flex items-center px-6 [.border-t]:pt-6",e),...t})}const MS=p.createContext({isCollapsed:!1,collapsible:!1,handleCollapse:()=>{throw new Error("CollapsibleCardContext: handleCollapse not implemented")}});function No({icon:e,tooltip:t,subtitle:n,children:r}){const{isCollapsed:s}=p.useContext(MS);return o.jsxs("div",{className:"flex items-center gap-2 self-center",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.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:o.jsx(e,{size:18})}),o.jsx(Lse,{className:"text-md text-foreground leading-none font-medium",children:r})]}),n&&o.jsx(Pse,{className:ne("text-md text-muted-foreground/50",!s&&"hidden"),children:n}),t&&o.jsx(fs,{children:o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.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:[o.jsx(zr,{className:"text-muted-foreground/50 hover:text-muted-foreground size-4 shrink-0 transition-colors"}),o.jsx("span",{className:"sr-only",children:t})]})}),o.jsx(Et,{children:o.jsx("p",{children:t})})]})})]})}No.displayName="CollapsibleCardHeaderTitle";function nh({children:e,className:t}){const n=r=>{r.stopPropagation()};return o.jsx("div",{className:ne("flex items-center gap-2 self-center",t),onClick:n,children:e})}nh.displayName="CollapsibleCardHeaderActions";function Ao({children:e}){const{collapsible:t,isCollapsed:n,handleCollapse:r}=p.useContext(MS);let s,l;return p.Children.forEach(e,c=>{if(p.isValidElement(c))switch(c.type){case No:s=c;break;case nh:l=c;break}}),o.jsxs(kse,{className:ne("group flex items-start justify-between gap-4 px-4 py-4",t&&"cursor-pointer"),onClick:t?r:void 0,children:[s,o.jsxs("div",{className:"flex items-center gap-2",children:[l,t&&o.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:o.jsx("div",{className:ne("transform transition-transform duration-200",n?"rotate-0":"rotate-180"),children:o.jsx(Qa,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})})]})]})}Ao.displayName="CollapsibleCardHeader";function Do({children:e}){return o.jsx(Use,{className:"px-4 pt-1",children:e})}Do.displayName="CollapsibleCardContent";function _i({left:e,right:t}){return o.jsxs(Fse,{className:"flex items-center gap-2 px-4 py-4",children:[o.jsx("div",{className:"flex flex-grow items-center gap-2",children:e}),t&&o.jsx("div",{className:"flex items-center",children:t})]})}_i.displayName="CollapsibleCardFooter";const wj="collapsed-card-";function jl({children:e,className:t,variant:n="default",collapsible:r=!1,defaultCollapsed:s=!1,onCollapsedChange:l,name:c}){const d=c?ks.get(`${wj}${c}`,"boolean")??s:s,[f,h]=p.useState(d);p.useEffect(()=>{c&&ks.set(`${wj}${c}`,f)},[f,c]);const g=()=>{const E=!f;h(E),l==null||l(E)};let y,v,b;p.Children.forEach(e,E=>{if(p.isValidElement(E))switch(E.type){case Ao:y=E;break;case Do:v=E;break;case _i:b=E;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 o.jsx(MS.Provider,{value:{isCollapsed:f,collapsible:r,handleCollapse:g},children:o.jsxs(Ise,{className:ne(w[n],t),children:[y,o.jsx("div",{className:ne("grid transition-all duration-200",f?"grid-rows-[0fr]":"grid-rows-[1fr]"),children:o.jsxs("div",{className:"overflow-hidden",children:[v,b]})})]})})}function zse(){const{dataMart:e,updateDataMartStorage:t}=Fo(),n=(e==null?void 0:e.definitionType)??null,[r,s]=p.useState(n);return o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsxs(jl,{collapsible:!0,name:"data-storage",children:[o.jsx(Ao,{children:o.jsx(No,{icon:lu,tooltip:"Configure where your data will be stored",children:"Storage"})}),o.jsx(Do,{children:(e==null?void 0:e.storage)&&o.jsx(Vte,{dataStorage:e.storage,onDataStorageChange:t})}),o.jsx(_i,{})]}),o.jsxs(jl,{collapsible:!0,name:"input-source",children:[o.jsx(Ao,{children:o.jsx(No,{icon:Ab,tooltip:"Configure how to extract data from your data warehouse",children:"Input Source"})}),o.jsx(Do,{children:e&&o.jsx(Rre,{definitionType:r,initialDefinitionType:n,setDefinitionType:s})}),o.jsx(_i,{})]}),o.jsxs(jl,{collapsible:!0,name:"output-schema",children:[o.jsx(Ao,{children:o.jsx(No,{icon:z9,tooltip:"Configure your data mart output schema",children:"Output Schema"})}),o.jsx(Do,{children:e&&o.jsx(Ose,{definitionType:r})}),o.jsx(_i,{})]})]})}function Vse({row:e,onDeleteSuccess:t,onEditReport:n}){const[r,s]=p.useState(!1),[l,c]=p.useState(!1),[d,f]=p.useState(!1),{deleteReport:h,fetchReportsByDataMartId:g,runReport:y}=Kl(),v=`actions-menu-${e.original.id}`,b=p.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=p.useCallback(()=>{n==null||n(e.original),c(!1)},[n,e.original]),E=p.useCallback(async()=>{try{s(!0),await y(e.original.id)}catch(R){console.error("Failed to run report:",R)}finally{s(!1)}},[y,e.original.id]),S=p.useCallback(()=>{f(!0),c(!1)},[]);return o.jsxs("div",{className:"text-right",onClick:R=>{R.stopPropagation()},children:[o.jsxs(wr,{open:l,onOpenChange:c,children:[o.jsx(Rr,{asChild:!0,children:o.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:[o.jsx("span",{className:"sr-only",children:"Open menu"}),o.jsx(Xa,{className:"dm-card-table-body-row-actionbtn-icon","aria-hidden":"true"})]})}),o.jsxs(Tr,{id:v,align:"end",role:"menu",children:[o.jsxs(vt,{onClick:R=>{R.stopPropagation(),w()},role:"menuitem",children:[o.jsx(Tf,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Edit report"]}),_g(e.original.destinationConfig)&&o.jsxs(o.Fragment,{children:[o.jsx(Ka,{}),o.jsxs(vt,{onClick:R=>{R.stopPropagation(),E()},disabled:r,role:"menuitem","aria-label":r?"Running report...":`Run report: ${e.original.title}`,children:[o.jsx(Db,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),r?"Running...":"Run report"]}),o.jsx(vt,{asChild:!0,children:o.jsxs("a",{href:C1(e.original.destinationConfig.spreadsheetId,e.original.destinationConfig.sheetId),target:"_blank",rel:"noopener noreferrer",role:"menuitem",onClick:R=>{R.stopPropagation()},children:[o.jsx(tL,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Open document"]})})]}),o.jsx(Ka,{}),o.jsxs(vt,{onClick:R=>{R.stopPropagation(),S()},role:"menuitem","aria-label":`Delete report: ${e.original.title}`,children:[o.jsx(Lo,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),o.jsx("span",{className:"text-red-600",children:"Delete report"})]})]})]}),o.jsx(Hr,{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 $se={[ln.SUCCESS]:{icon:Wp,color:"text-green-500",label:"Success"},[ln.ERROR]:{icon:sp,color:"text-red-500",label:"Fail"},[ln.RUNNING]:{icon:Rf,color:"text-primary animate-spin",label:"In progress"},[ln.CANCELLED]:{icon:sp,color:"text-gray-500",label:"Cancelled"}};function Hse({status:e,error:t}){if(!e)return null;const n=$se[e],{icon:r,color:s,label:l}=n,c=`status-tooltip-${e}-${t?"error":"normal"}`,d=()=>e===ln.ERROR&&t?`${l}: ${t}`:l;return o.jsx(fs,{children:o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx(r,{className:ne("h-5 w-5",s),role:"img","aria-label":d(),"aria-describedby":c,tabIndex:0})}),o.jsxs(Et,{id:c,side:"bottom",role:"tooltip",children:[o.jsx("div",{className:"text-xs",children:l}),e===ln.ERROR&&t&&o.jsx("div",{className:"mt-1 max-w-xs text-xs break-words whitespace-normal",children:t})]})]})})}function a0({column:e,children:t,label:n}){const r=e.getIsSorted(),s=p.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 o.jsxs(Se,{variant:"ghost",onClick:s,className:"group dm-card-table-header-row-btn","aria-label":`${d} - ${l()}. Click to sort.`,"aria-sort":c(),children:[t,o.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[r==="asc"&&o.jsx(zs,{className:"text-foreground h-4 w-4"}),r==="desc"&&o.jsx(Qa,{className:"text-foreground h-4 w-4"}),!r&&o.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:o.jsx(zs,{className:"text-muted-foreground h-4 w-4"})})]})]})}var Ri=(e=>(e.TITLE="title",e.LAST_RUN_DATE="lastRunDate",e.LAST_RUN_STATUS="lastRunStatus",e))(Ri||{});const X5={[Ri.TITLE]:"Title",[Ri.LAST_RUN_DATE]:"Last Run Date",[Ri.LAST_RUN_STATUS]:"Last Run Status"};function Bse({table:e}){return o.jsx("div",{className:"px-4 text-right",children:o.jsxs(wr,{children:[o.jsx(Rr,{asChild:!0,children:o.jsx(Se,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:o.jsx(Xa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsx(Tr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>{const n=X5[t.id]||t.id;return o.jsx(vt,{className:"capitalize",children:o.jsxs("label",{className:"flex items-center space-x-2",children:[o.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()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(fr,{className:"size-3.5 text-white"})})}),o.jsx("span",{children:n})]})},t.id)})})]})})}const Rj=e=>{switch(e){case"right":return"text-right";case"center":return"text-center";default:return"text-left"}},Gse=({onDeleteSuccess:e,onEditReport:t}={})=>[{accessorKey:Ri.TITLE,header:({column:n})=>o.jsx(a0,{column:n,children:X5[Ri.TITLE]}),cell:({row:n})=>n.original.title,enableColumnFilter:!0,size:50},{accessorKey:Ri.LAST_RUN_DATE,header:({column:n})=>o.jsx(a0,{column:n,children:"Last Run Date"}),cell:({row:n})=>{const r=n.original.lastRunDate;return o.jsx("div",{className:"text-muted-foreground text-sm",children:r?o.jsx(Pl,{date:new Date(r)}):"Never run"})},size:25},{accessorKey:Ri.LAST_RUN_STATUS,header:({column:n})=>o.jsx(a0,{column:n,children:"Last Run Status"}),cell:({row:n})=>n.original.lastRunStatus?o.jsx(Hse,{status:n.original.lastRunStatus,error:n.original.lastRunError}):o.jsx("span",{className:"text-muted-foreground text-sm",children:"—"}),size:25},{id:"actions",header:({table:n})=>o.jsx(Bse,{table:n}),cell:({row:n})=>o.jsx(Vse,{row:n,onDeleteSuccess:e,onEditReport:t}),size:80}];function J5({enabled:e,intervalMs:t=5e3,onlyWhenVisible:n=!0,onTick:r}){const s=p.useRef(r);s.current=r;const l=p.useRef(null);p.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;s.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])}const qse=5e3;function Zse({destination:e,onEditReport:t,autoRefreshEnabled:n=!1}){const{dataMart:r}=Wa(),{fetchReportsByDataMartId:s,reports:l,stopAllPolling:c,setPollingConfig:d}=Kl(),f=p.useMemo(()=>l.filter(S=>S.dataDestination.type===Dt.GOOGLE_SHEETS&&S.dataDestination.id===e.id),[l,e.id]);p.useEffect(()=>{d({initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3})},[d]),p.useEffect(()=>{(async()=>{try{if(!r)return;await s(r.id)}catch(R){console.error(R)}})()},[s,r]),J5({enabled:!!r&&n,intervalMs:qse,onTick:()=>{r&&s(r.id,{silent:!0})}}),p.useEffect(()=>()=>{c()},[r==null?void 0:r.id,c]);const h=p.useMemo(()=>Gse({onDeleteSuccess:()=>{},onEditReport:t}),[t]),{sorting:g,setSorting:y,columnVisibility:v,setColumnVisibility:b}=Zf({columns:h,storageKeyPrefix:`data-mart-google-sheets-reports-${e.id}`,defaultSortingColumn:"lastRunDate"}),w=Au({data:f,columns:h,getCoreRowModel:Nu(),onSortingChange:y,getSortedRowModel:qf(),state:{sorting:g,columnVisibility:v},onColumnVisibilityChange:b}),E=`google-sheets-reports-table-${e.id}`;return o.jsx("div",{className:"w-full",children:o.jsx("div",{className:"dm-card-table-wrap",children:o.jsxs(Du,{id:E,className:"dm-card-table",role:"table","aria-label":`${e.title} reports`,children:[o.jsx(Ou,{className:"dm-card-table-header",children:w.getHeaderGroups().map(S=>o.jsx(sr,{className:"dm-card-table-header-row",children:S.headers.map(R=>o.jsx(Iu,{className:Rj(R.column.columnDef._align),style:R.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(R.column.getSize())}%`},scope:"col",children:R.isPlaceholder?null:typeof R.column.columnDef.header=="function"?R.column.columnDef.header(R.getContext()):R.column.columnDef.header},R.id))},S.id))}),o.jsx(Mu,{className:"dm-card-table-body",children:w.getRowModel().rows.length?w.getRowModel().rows.map((S,R)=>o.jsx(sr,{onClick:()=>{const T=l.find(_=>_.id===S.original.id);T&&t(T)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":R+1,children:S.getVisibleCells().map((T,_)=>o.jsx(Sa,{className:`px-6 whitespace-normal ${Rj(T.column.columnDef._align)}`,style:T.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(T.column.getSize())}%`},role:"cell","aria-colindex":_+1,children:typeof T.column.columnDef.cell=="function"?T.column.columnDef.cell(T.getContext()):T.column.columnDef.cell},T.id))},S.id)):o.jsx(sr,{children:o.jsx(Sa,{colSpan:h.length,className:"dm-card-table-body-row-empty",role:"cell",children:o.jsx("span",{role:"status","aria-live":"polite",children:"No reports for this destination"})})})})]})})})}function Kse({children:e,className:t,...n}){return o.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 Yse({children:e,className:t,...n}){return o.jsx("div",{className:ne("flex flex-grow flex-col gap-1 py-4",t),...n,children:e})}function Wse({children:e,className:t,...n}){return o.jsx("div",{className:ne("text-md font-medium",t),...n,children:e})}function Qse({children:e,className:t,...n}){return o.jsx("div",{className:ne("text-muted-foreground text-sm",t),...n,children:e})}function Xse({checked:e,disabled:t,loading:n,onCheckedChange:r,tooltipTextSwitchOn:s,tooltipTextSwitchOff:l,tooltipTextSwitchDisabled:c}){const d=t?c??"Disabled":e?s:l;return o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx("div",{className:"flex items-center justify-center py-5 pl-6",onClick:f=>f.stopPropagation(),children:n?o.jsx(Rf,{className:"text-muted-foreground h-5 w-5 animate-spin"}):o.jsx(KO,{checked:e,disabled:t,onCheckedChange:r})})}),o.jsx(Et,{children:d})]})}function Jse({icon:e,className:t,...n}){return o.jsx("div",{className:ne("flex flex-shrink-0 items-center justify-center self-center p-4",t),...n,children:o.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??o.jsx(ja,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})})}function eoe(e){const{dataMart:t}=Wa(),{reports:n,createReport:r,deleteReport:s,fetchReportsByDataMartId:l}=Kl(),[c,d]=p.useState(!1),f=p.useMemo(()=>n.find(b=>b.dataDestination.type===Dt.LOOKER_STUDIO&&b.dataDestination.id===e.id),[n,e.id]),h=p.useMemo(()=>(t==null?void 0:t.status.code)===Sr.PUBLISHED,[t==null?void 0:t.status.code]),g=p.useMemo(()=>!!f,[f]),y=p.useMemo(()=>g?"Available in Looker Studio":"Not available in Looker Studio",[g]),v=p.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:xa.LOOKER_STUDIO_CONFIG,cacheLifetime:300}};await r(w),await l(t.id)}else f&&(await s(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,s,l]);return{existingReport:f,isLoading:c,isEnabled:h,isChecked:g,dynamicTitle:y,handleSwitchChange:v}}function toe({destination:e,onEditReport:t,...n}){const{existingReport:r,isLoading:s,isEnabled:l,isChecked:c,dynamicTitle:d,handleSwitchChange:f}=eoe(e),h=p.useCallback(()=>{r&&t(r)},[r,t]);return o.jsxs(Kse,{className:r?"cursor-pointer dark:hover:bg-white/5":"",onClick:r?h:void 0,...n,children:[o.jsx(Xse,{checked:c,disabled:!l,loading:s,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"}),o.jsxs(Yse,{children:[o.jsx(Wse,{children:d}),o.jsx(Qse,{children:c&&r?o.jsx(o.Fragment,{children:r.lastRunDate?o.jsxs(o.Fragment,{children:["Last fetched"," ",r.lastRunStatus===ln.SUCCESS&&"successfully ",o.jsx(Pl,{date:new Date(r.lastRunDate)}),r.lastRunStatus===ln.ERROR&&" but failed with error",r.lastRunError&&o.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&&o.jsx(Jse,{})]})}function noe(){const{scope:e}=Po();return o.jsx("div",{className:"dm-card",children:o.jsxs("div",{className:"dm-empty-state",children:[o.jsx(_b,{className:"dm-empty-state-ico",strokeWidth:1}),o.jsx("h2",{className:"dm-empty-state-title",children:"Google Sheets, Looker Studio… and friends!"}),o.jsx("p",{className:"dm-empty-state-subtitle",children:"To send your Data Mart's data to your favorite tools, create a Destination first."}),o.jsx(Se,{variant:"outline",asChild:!0,children:o.jsxs(Za,{to:e("/data-destinations"),className:"flex items-center gap-1",children:["Go to Destinations",o.jsx(ja,{className:"h-4 w-4"})]})})]})})}function roe(){const[e,t]=p.useState(!1),[n,r]=p.useState(Ln.CREATE),[s,l]=p.useState(null);return{isOpen:e,mode:n,editingReport:s,handleAddReport:()=>{r(Ln.CREATE),l(null),t(!0),Pe({event:"report_open",category:"Report",action:"CreateReport",label:"ReportForm"})},handleEditReport:h=>{r(Ln.EDIT),l(h),t(!0),Pe({event:"report_open",category:"Report",action:"EditReport",label:h.dataDestination.type})},handleCloseModal:()=>{t(!1),l(null),Pe({event:"report_close",category:"Report",action:n===Ln.EDIT?"Edit":"Create",label:"ReportForm"})}}}function aoe({destination:e,dataMartStatus:t}){const{destinationInfo:n,isVisible:r}=iK(e),{isOpen:s,mode:l,editingReport:c,handleAddReport:d,handleEditReport:f,handleCloseModal:h}=roe();return r?o.jsxs(o.Fragment,{children:[o.jsxs(jl,{name:e.id,collapsible:!0,defaultCollapsed:!1,children:[o.jsxs(Ao,{children:[o.jsx(No,{icon:n.icon,children:e.title}),o.jsx(nh,{children:e.type===Dt.GOOGLE_SHEETS&&o.jsx(soe,{dataMartStatus:t,onAddReport:d})})]}),o.jsx(Do,{children:o.jsx(boe,{destination:e,onEditReport:f,...e.type===Dt.GOOGLE_SHEETS&&{autoRefreshEnabled:!0}})}),o.jsx(_i,{})]}),o.jsx(xoe,{destination:e,isOpen:s,onClose:h,mode:l,initialReport:c})]}):null}function soe({dataMartStatus:e,onAddReport:t}){const n=(e==null?void 0:e.code)===Sr.DRAFT;return o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx("span",{children:o.jsxs(Se,{onClick:t,variant:"outline",size:"sm","aria-label":"Add new report",disabled:n,children:[o.jsx(_a,{className:"h-4 w-4"}),"Add Report"]})})}),n&&o.jsx(Et,{children:o.jsx("p",{children:"To create a report, publish the Data Mart first"})})]})}function ooe({elementId:e,isOpen:t,delay:n=100,selectText:r=!1}){p.useEffect(()=>{{const s=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(s)}}},[t,e,n,r])}const ioe=an({title:sn().min(1,"Title is required"),documentUrl:sn().refine(z4,"Enter a valid Google Sheets URL"),dataDestinationId:sn().min(1,"Destination is required")});function loe({initialReport:e,mode:t,dataMartId:n,onSuccess:r,preSelectedDestination:s}){const[l,c]=p.useState(null),[d,f]=p.useState(!1),{updateReport:h,createReport:g,error:y,clearError:v}=Kl();p.useEffect(()=>{d&&y&&(c(y),f(!1))},[y,d]);const b=Gi({resolver:Jl(ioe),defaultValues:{title:(e==null?void 0:e.title)??"",documentUrl:e!=null&&e.destinationConfig&&_g(e.destinationConfig)?`https://docs.google.com/spreadsheets/d/${e.destinationConfig.spreadsheetId}/edit#gid=${e.destinationConfig.sheetId}`:"",dataDestinationId:(e==null?void 0:e.dataDestination.id)??(s==null?void 0:s.id)??""},mode:"onTouched"}),{register:w,handleSubmit:E,formState:S,reset:R}=b,{errors:T,isDirty:_}=S,D=p.useCallback(async A=>{try{c(null),v(),f(!0);const{spreadsheetId:O,sheetId:j}=HZ(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:xa.GOOGLE_SHEETS_CONFIG,spreadsheetId:O,sheetId:j}});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:xa.GOOGLE_SHEETS_CONFIG,spreadsheetId:O,sheetId:j}})}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:E,errors:T,isDirty:_,reset:R,formError:l,isSubmitting:d,setFormError:c,getValues:b.getValues,onSubmit:D}}function coe(){return o.jsx(lr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Un,{value:"service-account-details",children:[o.jsx(Fn,{children:"How do I get a correct document link?"}),o.jsxs(zn,{children:[o.jsx("p",{className:"mb-2",children:"To get the correct Google Sheets document URL with a Sheet ID (GID), follow these steps:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open your Google Sheets document and select the specific ",o.jsx("strong",{children:"sheet tab"})," ","where the data should be inserted."]}),o.jsxs("li",{children:["Share the document with the service account email and grant it ",o.jsx("strong",{children:"Editor"})," ","access."]}),o.jsxs("li",{children:["While the correct sheet is selected, copy the URL from your browser's address bar — it should include the ",o.jsx("code",{className:"text-sm font-semibold",children:"gid"})," of that sheet."]}),o.jsx("li",{children:"Paste this URL into the field above."})]})]})]})})}function s0(e){return"serviceAccount"in e}function uoe({value:e,children:t}){const[n,r]=p.useState(!1),s=async()=>{e&&(await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),2e3))};return o.jsx(fs,{children:o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsxs("div",{role:"button",tabIndex:0,onClick:s,onKeyDown:l=>l.key==="Enter"&&s(),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:[o.jsx("span",{className:"truncate",children:t||e||"No data"}),n?o.jsx(fr,{className:"h-4 w-4 text-green-500"}):o.jsx(sf,{className:"h-4 w-4"})]})}),o.jsx(Et,{children:o.jsx("p",{children:n?"Copied!":"Click to copy"})})]})})}const doe=p.forwardRef(({initialReport:e,mode:t=Ln.EDIT,onDirtyChange:n,onFormErrorChange:r,onSubmit:s,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}=Wa(),{scope:b}=Po(),{dataDestinations:w,fetchDataDestinations:E,loading:S}=wg(),[R,T]=p.useState([]);p.useEffect(()=>{v&&E()},[v,E]),p.useEffect(()=>{if(w.length>0){const Y=w.filter(Z=>Z.type===Dt.GOOGLE_SHEETS);T(Y)}},[w]),ooe({elementId:h,isOpen:!0,delay:150});const{isDirty:_,reset:D,form:A,isSubmitting:O,formError:j,onSubmit:M}=loe({initialReport:e,mode:t,dataMartId:(v==null?void 0:v.id)??"",onSuccess:()=>{s==null||s()},preSelectedDestination:c});p.useEffect(()=>{r&&r(j)},[j,r]),p.useEffect(()=>{if(t===Ln.EDIT&&e&&_g(e.destinationConfig))D({title:e.title,documentUrl:C1(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]),p.useEffect(()=>{n==null||n(_)},[_,n]);const F=A.watch("documentUrl"),G=F&&z4(F.trim());return o.jsx(Wl,{...A,children:o.jsxs(qi,{id:f,ref:d,noValidate:!0,onSubmit:Y=>void A.handleSubmit(M)(Y),children:[o.jsxs(Ql,{children:[o.jsxs(Hs,{title:"General",children:[o.jsx(en,{control:A.control,name:"title",render:({field:Y})=>o.jsxs(Vt,{children:[o.jsx($t,{tooltip:"Add a title that reflects the report`s purpose",children:"Title"}),o.jsx(Ht,{children:o.jsx(zt,{id:h,placeholder:"Enter a report title",...Y})}),o.jsx(on,{})]})}),o.jsx(en,{control:A.control,name:"dataDestinationId",render:({field:Y})=>o.jsxs(Vt,{children:[o.jsx($t,{tooltip:"Select one of your existing destinations",children:"Destination"}),o.jsxs(Ea,{onValueChange:Y.onChange,value:Y.value,disabled:S||R.length===0,children:[o.jsx(Ht,{children:o.jsx(Ra,{id:y,className:"w-full max-w-full overflow-hidden",children:o.jsx(wa,{className:"truncate",placeholder:"Select a destination",children:Y.value&&R.length>0&&(()=>{const Z=R.find(ee=>ee.id===Y.value);if(Z){const $=Ll.getInfo(Z.type).icon;return o.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[o.jsx($,{className:"flex-shrink-0",size:18}),o.jsx("div",{className:"flex min-w-0 flex-col",children:o.jsx("span",{className:"truncate",children:Z.title})})]})}return null})()})})}),o.jsx(Ta,{children:R.map(Z=>{const $=Ll.getInfo(Z.type).icon;return o.jsx(Yn,{value:Z.id,children:o.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[o.jsx($,{className:"flex-shrink-0",size:18}),o.jsxs("div",{className:"flex min-w-0 flex-col",children:[o.jsx("span",{className:"truncate",children:Z.title}),o.jsx("span",{className:"text-muted-foreground truncate text-xs",children:(s0(Z.credentials)&&Ix(Z.credentials.serviceAccount))??"No email found"})]})]})},Z.id)})})]}),R.length===0&&!S&&o.jsxs(SS,{className:"mt-2",children:[o.jsx(wf,{className:"h-4 w-4"}),o.jsx(UO,{children:"No destinations available"}),o.jsxs(CS,{children:["You need to create a Destination before you can create a report."," ",o.jsx(Za,{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(ee=>ee.id===Y.value);return Z?o.jsxs("div",{className:"mt-2 flex flex-col gap-1",children:[o.jsx($t,{children:"Service Account Email"}),o.jsx(uoe,{value:s0(Z.credentials)?Ix(Z.credentials.serviceAccount)??"No email found":"",children:s0(Z.credentials)?Ix(Z.credentials.serviceAccount):"No email found"})]}):null})(),o.jsx(on,{})]})}),o.jsx(en,{control:A.control,name:"documentUrl",render:({field:Y})=>o.jsxs(Vt,{children:[o.jsx($t,{tooltip:"The link must include the Sheet ID to insert data into the correct tab",children:"Document Link with Sheet ID (GID)"}),o.jsx(Ht,{children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(zt,{id:g,placeholder:"Document URL",className:"flex-1",...Y}),o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.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:o.jsx(_l,{className:"h-4 w-4","aria-hidden":"true"})})}),o.jsx(Et,{side:"top",align:"center",role:"tooltip",children:G?"Open document in new tab":"Enter a valid URL to enable link"})]})]})}),o.jsx(Pn,{children:o.jsx(coe,{})}),o.jsx(on,{})]})})]}),o.jsx(Hs,{title:"Automate Report Runs",children:o.jsx(JO,{})})]}),o.jsxs(Xl,{children:[o.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&&o.jsx(Se,{variant:"outline",type:"button",onClick:l,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})});function foe({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:s}){const[l,c]=p.useState(!1),[d,f]=p.useState(!1),h=p.useCallback(()=>{d?c(!0):t()},[d,t]),g=p.useCallback(()=>{c(!1),f(!1),t()},[t]),y=p.useCallback(b=>{f(b)},[]),v=p.useCallback(()=>{f(!1),t()},[t]);return o.jsxs(o.Fragment,{children:[o.jsx(Li,{open:e,onOpenChange:b=>{b||h()},children:o.jsxs(Pi,{children:[o.jsxs(Ui,{children:[o.jsx(Fi,{children:r===Ln.CREATE?"Create new report":"Edit report"}),o.jsx(Gl,{children:r===Ln.CREATE?"Fill in the details to create a new Google Sheets report":"Update details of an existing Google Sheets report"})]}),o.jsx(Eg,{children:o.jsx(doe,{initialReport:n,mode:r,onDirtyChange:y,onSubmit:v,onCancel:h,preSelectedDestination:s})})]})}),o.jsx(Hr,{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 hoe=an({cacheLifetime:xG().min(300,"Cache time must be at least 5 minutes (300 seconds)")});function moe({initialReport:e,dataMartId:t,onSuccess:n,preSelectedDestination:r}){const[s,l]=p.useState(null),{createReport:c,updateReport:d}=Kl(),f=Gi({resolver:Jl(hoe),defaultValues:{cacheLifetime:e!=null&&e.destinationConfig&&X4(e.destinationConfig)?e.destinationConfig.cacheLifetime:300},mode:"onTouched"});return{form:f,onSubmit:async g=>{try{l(null);const{cacheLifetime:y}=g,v={type:xa.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:s,isSubmitting:f.formState.isSubmitting,isDirty:f.formState.isDirty,reset:f.reset}}function poe(){return o.jsx(lr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Un,{value:"cache-lifetime-details",children:[o.jsx(Fn,{children:"What is the Cache Lifetime for Looker Studio?"}),o.jsx(zn,{children:o.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 goe=[{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=p.forwardRef(({initialReport:e,mode:t=Ln.EDIT,onDirtyChange:n,onFormErrorChange:r,onSubmit:s,onCancel:l,preSelectedDestination:c},d)=>{const f="looker-studio-edit-form",{dataMart:h}=Wa(),{isDirty:g,reset:y,form:v,isSubmitting:b,formError:w,onSubmit:E}=moe({initialReport:e,dataMartId:(h==null?void 0:h.id)??"",onSuccess:()=>{s==null||s()},preSelectedDestination:c});return p.useEffect(()=>{r&&r(w)},[w,r]),p.useEffect(()=>{t===Ln.EDIT&&e&&X4(e.destinationConfig)?y({cacheLifetime:e.destinationConfig.cacheLifetime}):t===Ln.CREATE&&y({cacheLifetime:300})},[e,t,y]),p.useEffect(()=>{n==null||n(g)},[g,n]),o.jsx(Wl,{...v,children:o.jsxs(qi,{id:f,ref:d,noValidate:!0,onSubmit:S=>void v.handleSubmit(E)(S),children:[o.jsx(Ql,{children:o.jsx(Hs,{title:"Cache Configuration",children:o.jsx(en,{control:v.control,name:"cacheLifetime",render:({field:S})=>o.jsxs(Vt,{children:[o.jsx($t,{tooltip:"Period during which query results are served from storage-side cache, avoiding re-execution",children:"Cache Lifetime"}),o.jsxs(Ea,{onValueChange:R=>{S.onChange(parseInt(R,10))},value:S.value.toString(),defaultValue:"300",children:[o.jsx(Ht,{children:o.jsx(Ra,{className:"w-full",children:o.jsx(wa,{placeholder:"Select cache time"})})}),o.jsx(Ta,{children:goe.map(R=>o.jsx(Yn,{value:R.value.toString(),children:R.label},R.value))})]}),o.jsx(on,{}),o.jsx(Pn,{children:o.jsx(poe,{})})]})})})}),o.jsxs(Xl,{children:[o.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&&o.jsx(Se,{variant:"outline",type:"button",onClick:l,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})});function voe({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:s}){const[l,c]=p.useState(!1),[d,f]=p.useState(!1),h=p.useCallback(()=>{d?c(!0):t()},[d,t]),g=p.useCallback(()=>{c(!1),f(!1),t()},[t]),y=p.useCallback(b=>{f(b)},[]),v=p.useCallback(()=>{f(!1),t()},[t]);return o.jsxs(o.Fragment,{children:[o.jsx(Li,{open:e,onOpenChange:b=>{b||h()},children:o.jsxs(Pi,{children:[o.jsxs(Ui,{children:[o.jsx(Fi,{children:(s==null?void 0:s.title)??"Looker Studio"}),o.jsx(Gl,{children:r===Ln.CREATE?"Set up Data Mart as a data source":"Update connection details"})]}),o.jsx(Eg,{children:o.jsx(yoe,{initialReport:n,mode:r,onDirtyChange:y,onSubmit:v,onCancel:h,preSelectedDestination:s})})]})}),o.jsx(Hr,{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 xoe({destination:e,isOpen:t,onClose:n,mode:r,initialReport:s}){switch(e.type){case Dt.GOOGLE_SHEETS:return o.jsx(foe,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:s??void 0});case Dt.LOOKER_STUDIO:return o.jsx(voe,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:s??void 0});default:return null}}function boe({destination:e,onEditReport:t,autoRefreshEnabled:n}){switch(e.type){case Dt.GOOGLE_SHEETS:return o.jsx(Zse,{destination:e,onEditReport:t,autoRefreshEnabled:n});case Dt.LOOKER_STUDIO:return o.jsx(toe,{destination:e,onEditReport:t});default:return null}}function eM(){return o.jsx("div",{className:"flex flex-col gap-4",children:o.jsx("div",{className:"space-y-2 pb-4",children:Array.from({length:3}).map((e,t)=>o.jsx("div",{className:"border-border rounded-lg border p-4",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(is,{className:"h-4 w-4 rounded-full"}),o.jsx(is,{className:"h-4 w-40"}),o.jsx(is,{className:"h-3 w-32"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(is,{className:"h-6 w-16 rounded-full"}),o.jsx(is,{className:"h-4 w-4"})]})]})},t))})})}function Soe(){const{dataMart:e}=Wa(),{dataDestinations:t,isLoading:n}=lK();return e?o.jsx("div",{className:"flex flex-col gap-4",children:n?o.jsx(eM,{}):t.length===0?o.jsx(noe,{}):t.map(r=>o.jsx(aoe,{destination:r,dataMartStatus:e.status},r.id))}):null}function Coe(){return o.jsx(Eg,{children:o.jsx($4,{children:o.jsx(Soe,{})})})}function Tj(){return o.jsxs(jl,{children:[o.jsx(Ao,{children:o.jsx(No,{icon:b9,tooltip:"Description of the Data Mart",children:"Description"})}),o.jsx(Do,{children:o.jsx(_J,{})}),o.jsx(_i,{})]})}function Eoe(){const{dataMart:e}=Fo(),[t,n]=p.useState(!1),r=p.useCallback(()=>{n(!0)},[]),s=p.useCallback(()=>{n(!1)},[]);return o.jsxs(jl,{children:[o.jsxs(Ao,{children:[o.jsx(No,{icon:Mb,tooltip:"Time triggers allow you to schedule Data Mart runs at specific times",children:"Time triggers"}),o.jsx(nh,{children:o.jsxs(Se,{variant:"outline",onClick:r,"aria-label":"Add new trigger",children:[o.jsx(_a,{className:"h-4 w-4","aria-hidden":"true"}),"Add Trigger"]})})]}),o.jsx(Do,{children:o.jsx(yu,{children:o.jsx(yne,{children:e&&o.jsxs(o.Fragment,{children:[o.jsx(are,{dataMartId:e.id}),o.jsx(ES,{isOpen:t,onClose:s,dataMartId:e.id})]})})})}),o.jsx(_i,{})]})}function woe(){const e=a5(),{navigate:t}=Po(),n=r=>{const s=e?`/data-marts/${r.id}/data-setup?preset=${e.key}`:`/data-marts/${r.id}/data-setup`;t(s)};return o.jsx("div",{className:"flex h-full w-full items-center justify-center",children:o.jsx("div",{className:"m-auto w-lg",children:o.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:[o.jsx("h2",{className:"mb-4 text-xl font-medium",children:"Create Data Mart"}),o.jsx(tS,{children:o.jsx(N3,{children:o.jsx(_X,{initialData:{title:(e==null?void 0:e.datamartTitle)??"New Data Mart"},onSuccess:n})})})]})})})}function tM({isOpen:e,onClose:t,id:n}){const{getDataStorageById:r,currentDataStorage:s,loading:l,clearCurrentDataStorage:c}=Lg();p.useEffect(()=>(e&&n&&r(n),()=>{e||c()}),[e,n,r,c]);const d=()=>{c(),t()};return o.jsx(F1,{open:e,onOpenChange:f=>{f||d()},children:o.jsxs(z1,{children:[o.jsxs(V1,{children:[o.jsx($1,{children:"Storage Details"}),o.jsx(H1,{children:"View detailed information about this storage."})]}),o.jsx("div",{className:"py-4",children:o.jsx(vZ,{dataStorage:s,isLoading:l})})]})})}function o0({column:e,children:t}){return o.jsxs(Se,{variant:"ghost",onClick:()=>{e.toggleSorting(e.getIsSorted()==="asc")},className:"group dm-card-table-header-row-btn",children:[t,o.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[e.getIsSorted()==="asc"&&o.jsx(zs,{"data-testid":"lucide-arrow-up-down",className:"text-foreground h-4 w-4"}),e.getIsSorted()==="desc"&&o.jsx(Qa,{"data-testid":"lucide-arrow-up-down",className:"text-foreground h-4 w-4"}),!e.getIsSorted()&&o.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:o.jsx(zs,{"data-testid":"lucide-arrow-up-down",className:"text-muted-foreground h-4 w-4"})})]})]})}const Roe=({id:e,onViewDetails:t,onEdit:n,onDelete:r})=>{const[s,l]=p.useState(!1);return o.jsx("div",{className:"text-right",children:o.jsxs(wr,{open:s,onOpenChange:l,children:[o.jsx(Rr,{asChild:!0,children:o.jsx(Se,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${s?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:o.jsx(Xa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsxs(Tr,{align:"end",children:[o.jsxs(vt,{onClick:()=>t==null?void 0:t(e),children:[o.jsx(u_,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),o.jsx("span",{children:"View details"})]}),o.jsxs(vt,{onClick:()=>void(n==null?void 0:n(e)),children:[o.jsx(Tf,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),o.jsx("span",{children:"Edit"})]}),o.jsx(Ka,{}),o.jsxs(vt,{onClick:()=>r==null?void 0:r(e),children:[o.jsx(Lo,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),o.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]})})};function Toe({table:e}){return o.jsx("div",{className:"px-4 text-right",children:o.jsxs(wr,{children:[o.jsx(Rr,{asChild:!0,children:o.jsx(Se,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:o.jsx(Xa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsx(Tr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>o.jsx(vt,{className:"capitalize",children:o.jsxs("label",{className:"flex items-center space-x-2",children:[o.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()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(fr,{className:"size-3.5 text-white"})})}),o.jsx("span",{children:t.id})]})},t.id))})]})})}const joe=({onViewDetails:e,onEdit:t,onDelete:n}={})=>[{accessorKey:"title",size:50,header:({column:r})=>o.jsx(o0,{column:r,children:"Title"}),cell:({row:r})=>{const s=r.getValue("title");return o.jsx("div",{children:s})}},{accessorKey:"type",size:30,header:({column:r})=>o.jsx(o0,{column:r,children:"Type"}),cell:({row:r})=>{const s=r.getValue("type"),{displayName:l,icon:c}=Bi.getInfo(s);return o.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[o.jsx(c,{size:18}),l]})}},{accessorKey:"createdAt",size:20,sortDescFirst:!0,header:({column:r})=>o.jsx(o0,{column:r,children:"Created at"}),cell:({row:r})=>{const s=r.getValue("createdAt"),l=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(s);return o.jsx("div",{className:"text-muted-foreground",children:l})}},{id:"actions",size:80,header:({table:r})=>o.jsx(Toe,{table:r}),cell:({row:r})=>o.jsx(Roe,{id:r.original.id,onViewDetails:e,onEdit:t,onDelete:n})}];function _oe({onOpenTypeDialog:e}){return o.jsxs("div",{className:"dm-empty-state",children:[o.jsx(H9,{className:"dm-empty-state-ico",strokeWidth:1}),o.jsx("h2",{className:"dm-empty-state-title",children:"Create your first Storage"}),o.jsx("p",{className:"dm-empty-state-subtitle",children:"A Storage combines your data warehouse and access credentials — both required to start building Data Marts."}),o.jsxs(Se,{variant:"outline",onClick:e,children:[o.jsx(_a,{className:"h-4 w-4"}),"New Storage"]})]})}function Noe({columns:e,data:t,onEdit:n,onOpenTypeDialog:r}){var R;const{sorting:s,setSorting:l,columnVisibility:c,setColumnVisibility:d}=Zf({columns:e,storageKeyPrefix:"data-storage-list"}),[f,h]=p.useState([]),[g,y]=p.useState({}),[v,b]=p.useState(!1),[w]=p.useState(null),E=Au({data:t,columns:[...e],getCoreRowModel:Nu(),getPaginationRowModel:Ag(),onSortingChange:l,getSortedRowModel:qf(),onColumnFiltersChange:h,getFilteredRowModel:Gf(),onColumnVisibilityChange:d,onRowSelectionChange:y,state:{sorting:s,columnFilters:f,columnVisibility:c,rowSelection:g},enableRowSelection:!0}),S=(T,_)=>{_.target instanceof HTMLElement&&(_.target.closest('[role="checkbox"]')||_.target.closest(".actions-cell")||_.target.closest('[role="menuitem"]'))||n==null||n(T)};return t.length?o.jsxs("div",{children:[w&&o.jsx(tM,{isOpen:v,onClose:()=>{b(!1)},id:w.id}),o.jsxs("div",{className:"dm-card",children:[o.jsxs("div",{className:"dm-card-toolbar",children:[o.jsx("div",{className:"dm-card-toolbar-left",children:o.jsxs("div",{className:"dm-card-toolbar-search",children:[o.jsx($l,{className:"dm-card-toolbar-search-icon"}),o.jsx(zt,{placeholder:"Search by title",value:(R=E.getColumn("title"))==null?void 0:R.getFilterValue(),onChange:T=>{var _;return(_=E.getColumn("title"))==null?void 0:_.setFilterValue(T.target.value)},className:"dm-card-toolbar-search-input"})]})}),o.jsx("div",{className:"dm-card-toolbar-right",children:o.jsxs(Se,{variant:"outline",className:"dm-card-toolbar-btn-primary",onClick:()=>{r==null||r()},children:[o.jsx(_a,{className:"h-4 w-4"}),"New Storage"]})})]}),o.jsx("div",{className:"dm-card-table-wrap",children:o.jsxs(Du,{className:"dm-card-table",role:"table","aria-label":"Storages table",children:[o.jsx(Ou,{className:"dm-card-table-header",children:E.getHeaderGroups().map(T=>o.jsx(sr,{className:"dm-card-table-header-row",children:T.headers.map(_=>o.jsx(Iu,{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:gu(_.column.columnDef.header,_.getContext())},_.id))},T.id))}),o.jsx(Mu,{className:"dm-card-table-body",children:E.getRowModel().rows.length?E.getRowModel().rows.map(T=>o.jsx(sr,{"data-state":T.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:_=>{const D=T.original.id;S(D,_)},children:T.getVisibleCells().map(_=>o.jsx(Sa,{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:gu(_.column.columnDef.cell,_.getContext())},_.id))},T.id)):o.jsx(sr,{children:o.jsx(Sa,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),o.jsxs("div",{className:"dm-card-pagination",children:[o.jsx(Se,{variant:"outline",size:"sm",onClick:()=>{E.previousPage()},disabled:!E.getCanPreviousPage(),children:"Previous"}),o.jsx(Se,{variant:"outline",size:"sm",onClick:()=>{E.nextPage()},disabled:!E.getCanNextPage(),children:"Next"})]})]})]}):o.jsx("div",{className:"dm-card",children:o.jsx(_oe,{onOpenTypeDialog:r})})}const Aoe=({initialTypeDialogOpen:e=!1,onTypeDialogClose:t})=>{const[n,r]=p.useState(e),{dataStorages:s,currentDataStorage:l,clearCurrentDataStorage:c,fetchDataStorages:d,getDataStorageById:f,deleteDataStorage:h,createDataStorage:g}=Lg();p.useEffect(()=>{d()},[d]),p.useEffect(()=>{r(e)},[e]);const y=()=>{r(!1),t==null||t()},[v,b]=p.useState(!1),[w,E]=p.useState(!1),[S,R]=p.useState(null),[T,_]=p.useState(!1),[D,A]=p.useState(null),O=async k=>{try{const H=await g(k);y(),H!=null&&H.id&&(await f(H.id),b(!0))}catch(H){console.error("Failed to create storage:",H)}},j=k=>{A(k),_(!0)},M=()=>{_(!1),A(null)},F=async k=>{await f(k),b(!0)},G=k=>{R(k),E(!0)},Y=async()=>{if(S)try{await h(S),await d()}catch(k){console.error("Failed to delete storage:",k)}finally{E(!1),R(null)}},Z=async()=>{try{b(!1),await d()}catch(k){console.error("Failed to save storage:",k)}},ee=()=>{b(!1),c()},$=s.map(k=>({id:k.id,title:k.title,type:k.type,createdAt:k.createdAt,modifiedAt:k.modifiedAt})),W=joe({onViewDetails:j,onEdit:F,onDelete:G});return o.jsxs("div",{children:[o.jsx(Noe,{columns:W,data:$,onEdit:F,onOpenTypeDialog:()=>{r(!0)}}),o.jsx(tM,{isOpen:T,onClose:M,id:D??""}),o.jsx(TD,{isOpen:n,onClose:y,onSelect:O}),o.jsx(PO,{isOpen:v,onClose:ee,dataStorage:l,onSaveSuccess:()=>void Z()}),o.jsx(Hr,{open:w,onOpenChange:E,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"})]})},Doe=()=>{const[e,t]=p.useState(!1);return o.jsxs("div",{className:"dm-page",children:[o.jsx("header",{className:"dm-page-header",children:o.jsx("h1",{className:"dm-page-header-title",children:"Storages"})}),o.jsx("div",{className:"dm-page-content",children:o.jsx(tS,{children:o.jsx(Aoe,{initialTypeDialogOpen:e,onTypeDialogClose:()=>{t(!1)}})})})]})};function Ooe({onOpenTypeDialog:e}){return o.jsxs("div",{className:"dm-empty-state",children:[o.jsx(_b,{className:"dm-empty-state-ico",strokeWidth:1}),o.jsx("h2",{className:"dm-empty-state-title",children:"Create your first Destination"}),o.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."}),o.jsxs(Se,{variant:"outline",onClick:e,children:[o.jsx(_a,{className:"h-4 w-4"}),"New Destination"]})]})}function Moe({columns:e,data:t,onEdit:n,onOpenTypeDialog:r}){var w;const{sorting:s,setSorting:l,columnVisibility:c,setColumnVisibility:d}=Zf({columns:e,storageKeyPrefix:"data-destination-list"}),[f,h]=p.useState([]),[g,y]=p.useState({}),v=Au({data:t,columns:[...e],getCoreRowModel:Nu(),getPaginationRowModel:Ag(),onSortingChange:l,getSortedRowModel:qf(),onColumnFiltersChange:h,getFilteredRowModel:Gf(),onColumnVisibilityChange:d,onRowSelectionChange:y,state:{sorting:s,columnFilters:f,columnVisibility:c,rowSelection:g},enableRowSelection:!0}),b=(E,S)=>{S.target instanceof HTMLElement&&(S.target.closest('[role="checkbox"]')||S.target.closest(".actions-cell")||S.target.closest('[role="menuitem"]'))||n==null||n(E)};return t.length?o.jsx("div",{children:o.jsxs("div",{className:"dm-card",children:[o.jsxs("div",{className:"dm-card-toolbar",children:[o.jsx("div",{className:"dm-card-toolbar-left",children:o.jsxs("div",{className:"dm-card-toolbar-search",children:[o.jsx($l,{className:"dm-card-toolbar-search-icon"}),o.jsx(zt,{placeholder:"Search by title",value:(w=v.getColumn("title"))==null?void 0:w.getFilterValue(),onChange:E=>{var S;return(S=v.getColumn("title"))==null?void 0:S.setFilterValue(E.target.value)},className:"dm-card-toolbar-search-input"})]})}),o.jsx("div",{className:"dm-card-toolbar-right",children:o.jsxs(Se,{variant:"outline",className:"dm-card-toolbar-btn-primary",onClick:()=>{r==null||r()},children:[o.jsx(_a,{className:"h-4 w-4"}),"New Destination"]})})]}),o.jsx("div",{className:"dm-card-table-wrap",children:o.jsxs(Du,{className:"dm-card-table",role:"table","aria-label":"Destinations table",children:[o.jsx(Ou,{className:"dm-card-table-header",children:v.getHeaderGroups().map(E=>o.jsx(sr,{className:"dm-card-table-header-row",children:E.headers.map(S=>o.jsx(Iu,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",style:S.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(S.getSize())}%`},children:S.isPlaceholder?null:gu(S.column.columnDef.header,S.getContext())},S.id))},E.id))}),o.jsx(Mu,{className:"dm-card-table-body",children:v.getRowModel().rows.length?v.getRowModel().rows.map(E=>o.jsx(sr,{"data-state":E.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:S=>{const R=E.original.id;b(R,S)},children:E.getVisibleCells().map(S=>o.jsx(Sa,{className:`[&:has([role=checkbox])]pr-0 px-6 whitespace-normal [&>[role=checkbox]]:translate-y-[2px] ${S.column.id==="actions"?"actions-cell":""} ${S.column.id==="createdAt"?"whitespace-nowrap":""}`,style:S.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(S.column.getSize())}%`},children:gu(S.column.columnDef.cell,S.getContext())},S.id))},E.id)):o.jsx(sr,{children:o.jsx(Sa,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),o.jsxs("div",{className:"dm-card-pagination",children:[o.jsx(Se,{variant:"outline",size:"sm",onClick:()=>{v.previousPage()},disabled:!v.getCanPreviousPage(),children:"Previous"}),o.jsx(Se,{variant:"outline",size:"sm",onClick:()=>{v.nextPage()},disabled:!v.getCanNextPage(),children:"Next"})]})]})}):o.jsx("div",{className:"dm-card",children:o.jsx(Ooe,{onOpenTypeDialog:r})})}function i0({column:e,children:t}){return o.jsxs(Se,{variant:"ghost",onClick:()=>{e.toggleSorting(e.getIsSorted()==="asc")},className:"group dm-card-table-header-row-btn",children:[t,o.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[e.getIsSorted()==="asc"&&o.jsx(zs,{"data-testid":"lucide-arrow-up-down",className:"text-foreground h-4 w-4"}),e.getIsSorted()==="desc"&&o.jsx(Qa,{"data-testid":"lucide-arrow-up-down",className:"text-foreground h-4 w-4"}),!e.getIsSorted()&&o.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:o.jsx(zs,{"data-testid":"lucide-arrow-up-down",className:"text-muted-foreground h-4 w-4"})})]})]})}function IS(e){return"destinationSecretKey"in e}const Ioe=({id:e,type:t,credentials:n,onEdit:r,onDelete:s,onRotateSecretKey:l})=>{const[c,d]=p.useState(!1),f=()=>{if(n&&IS(n)){const y=E1(n);navigator.clipboard.writeText(y),At.success("JSON Config copied to clipboard")}},h=t===Dt.LOOKER_STUDIO,g=n&&"destinationSecretKey"in n&&n.destinationSecretKey;return o.jsx(o.Fragment,{children:o.jsx("div",{className:"text-right",children:o.jsxs(wr,{open:c,onOpenChange:d,children:[o.jsx(Rr,{asChild:!0,children:o.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:o.jsx(Xa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsxs(Tr,{align:"end",children:[o.jsxs(vt,{onClick:()=>void(r==null?void 0:r(e)),children:[o.jsx(Tf,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),o.jsx("span",{children:"Edit"})]}),h&&g&&o.jsxs(o.Fragment,{children:[o.jsx(Ka,{}),o.jsxs(vt,{onClick:f,children:[o.jsx(sf,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),o.jsx("span",{children:"Copy JSON Config"})]}),o.jsxs(vt,{onClick:()=>{l==null||l(e)},children:[o.jsx(m0,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),o.jsx("span",{children:"Rotate Secret Key"})]})]}),o.jsx(Ka,{}),o.jsxs(vt,{onClick:()=>s==null?void 0:s(e),children:[o.jsx(Lo,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),o.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]})})})};function koe({table:e}){return o.jsx("div",{className:"px-4 text-right",children:o.jsxs(wr,{children:[o.jsx(Rr,{asChild:!0,children:o.jsx(Se,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:o.jsx(Xa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsx(Tr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>o.jsx(vt,{className:"capitalize",children:o.jsxs("label",{className:"flex items-center space-x-2",children:[o.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()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(fr,{className:"size-3.5 text-white"})})}),o.jsx("span",{children:t.id})]})},t.id))})]})})}const Loe=({onEdit:e,onDelete:t,onRotateSecretKey:n}={})=>[{accessorKey:"title",size:50,header:({column:r})=>o.jsx(i0,{column:r,children:"Title"}),cell:({row:r})=>{const s=r.getValue("title");return o.jsx("div",{className:"overflow-hidden text-ellipsis",children:s})}},{accessorKey:"type",size:30,header:({column:r})=>o.jsx(i0,{column:r,children:"Type"}),cell:({row:r})=>{const s=r.getValue("type"),{displayName:l,icon:c}=Ll.getInfo(s);return o.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[o.jsx(c,{size:18}),l]})}},{accessorKey:"createdAt",size:20,sortDescFirst:!0,header:({column:r})=>o.jsx(i0,{column:r,children:"Created at"}),cell:({row:r})=>{const s=r.getValue("createdAt"),l=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(s);return o.jsx("div",{className:"text-muted-foreground",children:l})}},{id:"actions",size:80,header:({table:r})=>o.jsx(koe,{table:r}),cell:({row:r})=>o.jsx(Ioe,{id:r.original.id,type:r.original.type,credentials:r.original.credentials,onEdit:e,onDelete:t,onRotateSecretKey:n})}];function Poe(){return o.jsx(lr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Un,{value:"service-account-details",children:[o.jsx(Fn,{children:"How do I get a Service Account JSON key?"}),o.jsxs(zn,{children:[o.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."}),o.jsx("p",{className:"mb-2",children:"Here's what to do:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Go to"," ",o.jsx(or,{href:"https://console.cloud.google.com/iam-admin/serviceaccounts",children:"Google Cloud Console"})," ","."]}),o.jsxs("li",{children:["Open ",o.jsx("strong",{children:"IAM & Admin → Service Accounts"}),"."]}),o.jsx("li",{children:"Create a new service account or select an existing one."}),o.jsxs("li",{children:["Open the Service Accounts page, go to the ",o.jsx("strong",{children:"Keys"})," tab, click"," ",o.jsx("strong",{children:"Add key"}),", and select ",o.jsx("strong",{children:"Create new key"}),"."]}),o.jsxs("li",{children:["Choose ",o.jsx("strong",{children:"JSON"})," format and click ",o.jsx("strong",{children:"Create"}),"."]}),o.jsx("li",{children:"Open the downloaded file, copy its entire content, and paste it into the field above."})]})]})]})})}function Uoe({form:e}){const[t,n]=p.useState(!1),r=()=>{n(!0),e.setValue("credentials.serviceAccount","",{shouldDirty:!0})},s=()=>{n(!1),e.resetField("credentials.serviceAccount")},l=e.watch("credentials.serviceAccount"),c=l?kO(l):null;return o.jsx(en,{control:e.control,name:"credentials.serviceAccount",render:({field:d})=>o.jsxs(Vt,{children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx($t,{tooltip:"Paste a JSON key from a service account that has access to the selected destination provider",children:"Service Account"}),!t&&l&&o.jsx(Se,{variant:"ghost",size:"sm",onClick:r,type:"button",children:"Edit"}),t&&o.jsx(Se,{variant:"ghost",size:"sm",onClick:s,type:"button",children:"Cancel"})]}),o.jsx(Ht,{children:!t&&c?o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx(or,{href:c.url,children:c.email})}),o.jsx(Et,{children:o.jsx("p",{children:"View in Google Cloud Console"})})]}):o.jsx($i,{...d,className:"min-h-[150px] font-mono",rows:8,placeholder:"Paste your service account JSON here"})}),o.jsx(Pn,{children:o.jsx(Poe,{})}),o.jsx(on,{})]})})}function Foe(){return o.jsx(lr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Un,{value:"json-config-details",children:[o.jsx(Fn,{children:"What is the JSON Config for Looker Studio?"}),o.jsxs(zn,{children:[o.jsx("p",{className:"mb-2",children:"The JSON Config contains the necessary credentials and configuration for connecting to Looker Studio."}),o.jsxs("ul",{className:"list-inside space-y-2 text-sm",children:[o.jsx("li",{children:"You need to copy this JSON config to use it in the Looker Studio Connector."}),o.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 zoe({form:e}){const t=e.getValues("credentials"),n=p.useMemo(()=>t&&IS(t)?t:{deploymentUrl:"",destinationId:"",destinationSecretKey:""},[t]),r=p.useMemo(()=>E1(n),[n]);return o.jsx(o.Fragment,{children:n.destinationSecretKey&&o.jsx(en,{control:e.control,name:"credentials.destinationSecretKey",render:()=>o.jsxs(Vt,{children:[o.jsx($t,{children:"JSON Config"}),o.jsx(Ht,{children:o.jsx(l4,{value:r,displayOnly:!0,keysToMask:["destinationSecretKey"],className:"bg-muted overflow-auto rounded-md text-sm",showCopyButton:!0})}),o.jsx(on,{}),o.jsx(Pn,{children:o.jsx(Foe,{})})]})})})}const Voe=()=>o.jsxs(Un,{value:"sheets-api-details",children:[o.jsx(Fn,{children:"How do I enable the Google Sheets API?"}),o.jsxs(zn,{children:[o.jsxs("p",{className:"mb-2",children:["To send data to Google Sheets, you need to enable the"," ",o.jsx(or,{href:"https://console.cloud.google.com/apis/library/sheets.googleapis.com",children:"Google Sheets API"})," ","in your Google Cloud project."]}),o.jsx("p",{className:"mb-2",children:"Here's how to do it:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsx("li",{children:"Open the link above and make sure the correct project is selected."}),o.jsxs("li",{children:["If the API isn't enabled yet, click ",o.jsx("strong",{children:"Enable"}),"."]}),o.jsx("li",{children:"If it's already enabled, you'll see the API dashboard — that's fine."})]})]})]}),$oe=()=>o.jsxs(Un,{value:"looker-studio-details",children:[o.jsx(Fn,{children:"How do I connect to Looker Studio?"}),o.jsxs(zn,{children:[o.jsxs("p",{className:"mb-2",children:["To send data to Looker Studio, you need to provide a deployment URL that the"," ",o.jsx(or,{className:"p-0",href:"https://datastudio.google.com/datasources/create?connectorId=AKfycbz6kcYn3qGuG0jVNFjcDnkXvVDiz4hewKdAFjOm-_d4VkKVcBidPjqZO991AvGL3FtM4A",children:"Looker Studio connector"})," ","will use to access your data."]}),o.jsx("p",{className:"mb-2",children:"Make sure the deployment URL is accessible from the internet and properly secured."}),o.jsx(or,{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"})]})]}),Hoe=()=>o.jsxs(Un,{value:"odata-details",children:[o.jsx(Fn,{children:"How do I use OData?"}),o.jsxs(zn,{children:[o.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."}),o.jsx("p",{className:"mb-2",children:"This feature is coming soon."})]})]}),Boe={[Dt.GOOGLE_SHEETS]:Voe,[Dt.LOOKER_STUDIO]:$oe,[Dt.ODATA]:Hoe};function Goe({destinationType:e}){const t=Boe[e];return o.jsx(lr,{variant:"common",type:"single",collapsible:!0,children:o.jsx(t,{})})}function qoe({form:e,initialData:t}){return o.jsx(en,{control:e.control,name:"type",render:({field:n})=>o.jsxs(Vt,{children:[o.jsx($t,{tooltip:"Select the destination to send your data",children:"Destination Type"}),o.jsxs(Ea,{onValueChange:n.onChange,defaultValue:n.value,disabled:!!t,children:[o.jsx(Ht,{children:o.jsx(Ra,{className:"w-full",children:o.jsx(wa,{placeholder:"Select a destination type"})})}),o.jsx(Ta,{children:o.jsx(kg,{children:Ll.getAllTypes().map(({type:r,displayName:s,icon:l,status:c})=>{const d=c===nu.COMING_SOON;return o.jsx(Yn,{value:r,disabled:d,children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(l,{size:18}),s,d&&o.jsx(br,{variant:"secondary",children:c})]})},r)})})})]}),o.jsx(Pn,{children:o.jsx(Goe,{destinationType:n.value})}),o.jsx(on,{})]})})}function Zoe({initialData:e,onSubmit:t,onCancel:n,onDirtyChange:r}){const s=Gi({resolver:Jl(tK),defaultValues:e??{title:"New Destination",type:Dt.GOOGLE_SHEETS},mode:"onTouched"}),l=s.watch("type");p.useEffect(()=>{r==null||r(s.formState.isDirty)},[s.formState.isDirty,r]);const c=async d=>{const{dirtyFields:f}=s.formState,h=LO(d);return f.credentials||delete h.credentials,t(h)};return o.jsx(Wl,{...s,children:o.jsxs(qi,{onSubmit:d=>{s.handleSubmit(c)(d)},children:[o.jsxs(Ql,{children:[o.jsx(en,{control:s.control,name:"title",render:({field:d})=>o.jsxs(Vt,{children:[o.jsx($t,{tooltip:"Name the destination to clarify its purpose",children:"Title"}),o.jsx(Ht,{children:o.jsx(zt,{placeholder:"Enter title",...d})}),o.jsx(on,{})]})}),o.jsx(qoe,{form:s,initialData:e}),l===Dt.GOOGLE_SHEETS&&o.jsx(Uoe,{form:s}),l===Dt.LOOKER_STUDIO&&o.jsx(zoe,{form:s})]}),o.jsxs(Xl,{children:[o.jsxs(Se,{variant:"default",type:"submit",className:"w-full","aria-label":"Save",disabled:!s.formState.isDirty||s.formState.isSubmitting,children:[s.formState.isSubmitting&&o.jsx(Rf,{className:"mr-2 h-4 w-4 animate-spin"}),"Save"]}),o.jsx(Se,{variant:"outline",type:"button",onClick:n,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function Koe({isOpen:e,onClose:t,dataDestination:n,onSaveSuccess:r}){const{updateDataDestination:s,createDataDestination:l}=wg(),[c,d]=p.useState(!1),[f,h]=p.useState(!1),g=p.useCallback(()=>{f?d(!0):t()},[f,t]),y=p.useCallback(()=>{d(!1),h(!1),t()},[t]),v=p.useCallback(E=>{h(E)},[]),b=async E=>{const S=G4.getMapper(E.type);if(n){const R=S.mapToUpdateRequest(E),T=await s(n.id,R);T&&r(T)}else{const R=S.mapToCreateRequest(E),T=await l(R);T&&r(T)}t()},w=p.useRef(!1);return p.useEffect(()=>{const E=n?"Edit":"Create";e&&!w.current?(Pe({event:"data_destination_config_open",category:"DataDestination",action:E,label:n==null?void 0:n.type}),w.current=!0):!e&&w.current&&(Pe({event:"data_destination_config_close",category:"DataDestination",action:E,label:n==null?void 0:n.type}),w.current=!1)},[e,n]),o.jsxs(o.Fragment,{children:[o.jsx(Li,{open:e,onOpenChange:E=>{E||g()},children:o.jsxs(Pi,{children:[o.jsxs(Ui,{children:[o.jsx(Fi,{children:"Configure destination"}),o.jsx(Gl,{children:"Customize settings for your destination"})]}),o.jsx(Zoe,{initialData:n??void 0,onSubmit:b,onCancel:g,onDirtyChange:v})]})}),o.jsx(Hr,{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 Yoe=({isCreateSheetInitiallyOpen:e=!1,onCreateSheetClose:t})=>{const{dataDestinations:n,currentDataDestination:r,clearCurrentDataDestination:s,fetchDataDestinations:l,getDataDestinationById:c,deleteDataDestination:d,rotateSecretKey:f}=wg(),h=p.useCallback(()=>{s(),y(!0),t==null||t()},[s,t]),[g,y]=p.useState(!1),[v,b]=p.useState(!1),[w,E]=p.useState(!1),[S,R]=p.useState(null),[T,_]=p.useState(null);p.useEffect(()=>{l()},[l]),p.useEffect(()=>{e&&h()},[e,h]);const D=async ee=>{await c(ee),y(!0)},A=ee=>{R(ee),b(!0)},O=ee=>{_(ee),E(!0)},j=async()=>{if(T)try{const ee=await f(T);if(IS(ee.credentials)){At.success("New JSON Config copied to clipboard");const $=E1(ee.credentials);navigator.clipboard.writeText($)}await l()}catch(ee){console.error("Failed to rotate secret key:",ee)}finally{E(!1),_(null)}},M=async()=>{if(S)try{await d(S),await l()}catch(ee){console.error("Failed to delete destination:",ee)}finally{b(!1),R(null)}},F=async()=>{try{y(!1),await l()}catch(ee){console.error("Failed to save destination:",ee)}},G=()=>{y(!1),s()},Y=n.map(ee=>({id:ee.id,title:ee.title,type:ee.type,createdAt:ee.createdAt,modifiedAt:ee.modifiedAt,credentials:ee.credentials})),Z=Loe({onEdit:D,onDelete:A,onRotateSecretKey:O});return o.jsxs("div",{children:[o.jsx(Moe,{columns:Z,data:Y,onEdit:D,onDelete:A,onRotateSecretKey:O,onOpenTypeDialog:h}),o.jsx(Koe,{isOpen:g,onClose:G,dataDestination:r,onSaveSuccess:()=>void F()}),o.jsx(Hr,{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"}),o.jsx(Hr,{open:w,onOpenChange:E,title:"Rotate Secret Key",description:"Rotating the secret key will invalidate the previous key",confirmLabel:"Rotate Key",cancelLabel:"Cancel",onConfirm:()=>void j(),onCancel:()=>{E(!1)},variant:"destructive",children:o.jsxs("div",{className:"text-sm",children:[o.jsx("p",{className:"mb-2",children:"After rotation, you will need to:"}),o.jsxs("ol",{className:"mb-2 list-decimal pl-5",children:[o.jsx("li",{children:"The new JSON Config will be automatically copied to your clipboard"}),o.jsx("li",{children:"Go to your Looker Studio Connector"}),o.jsx("li",{children:"Update the configuration with the new JSON Config"}),o.jsx("li",{children:"Save the changes to restore access to your data marts"})]}),o.jsx("p",{className:"font-semibold",children:"Are you sure you want to rotate the secret key?"})]})})]})},Woe=()=>{const[e,t]=p.useState(!1);return o.jsxs("div",{className:"dm-page",children:[o.jsx("header",{className:"dm-page-header",children:o.jsx("h1",{className:"dm-page-header-title",children:"Destinations"})}),o.jsx("div",{className:"dm-page-content",children:o.jsx(Eg,{children:o.jsx(Yoe,{isCreateSheetInitiallyOpen:e,onCreateSheetClose:()=>{t(!1)}})})})]})};function Qoe({status:e}){switch(e){case ar.RUNNING:return o.jsx(br,{variant:"secondary",className:"text-primary bg-primary/10",children:"Running"});case ar.SUCCESS:return o.jsx(br,{variant:"secondary",className:"bg-green-50 text-green-600 dark:bg-green-950 dark:text-green-400",children:"Success"});case ar.FAILED:return o.jsx(br,{variant:"secondary",className:"bg-red-50 text-red-600 dark:bg-red-950 dark:text-red-400",children:"Failed"});case ar.CANCELLED:return o.jsx(br,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Cancelled"});case ar.INTERRUPTED:return o.jsx(br,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Interrupted"});case ar.PENDING:return o.jsx(br,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Pending"});default:return o.jsx(br,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Unknown"})}}var Fr=(e=>(e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.SYSTEM="SYSTEM",e))(Fr||{}),ss=(e=>(e.STRUCTURED="structured",e.RAW="raw",e.CONFIGURATION="configuration",e))(ss||{});const jj=(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=l0(v);return{id:`log-${t.toString()}`,timestamp:zc(g),level:n?Fr.ERROR:Fr.INFO,message:b.message,metadata:{at:(c=b.metadata)!=null&&c.at?zc(b.metadata.at):zc(g),type:((d=b.metadata)==null?void 0:d.type)??(y!=="unknown"?y:null)}}}}const s=/^\[(.*?)\]\s*\[(.*?)\]\s*(.*)$/.exec(e);if(s){const g=l0(s[3]);return{id:`log-${t.toString()}`,timestamp:zc(s[1]),level:n?Fr.ERROR:s[2],message:g.message,metadata:(f=g.metadata)!=null&&f.at?{...g.metadata,at:zc(g.metadata.at)}:g.metadata}}const l=l0(e);return{id:`log-${t.toString()}`,timestamp:"N/A",level:n?Fr.ERROR:Fr.INFO,message:l.message,metadata:(h=l.metadata)!=null&&h.at?{...l.metadata,at:zc(l.metadata.at)}:l.metadata}},l0=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 s=Object.keys(r);if(s.length===1){const l=s[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}},nM=e=>{var t;return(t=e.metadata)!=null&&t.type?e.metadata.type:e.level},Xoe=(e,t)=>{var c;let n="",r="";switch(e.type){case Cl.CONNECTOR:n=t??"",r="connector";break;case Cl.LOOKER_STUDIO:n="Looker Studio data fetching",r="report";break;case Cl.GOOGLE_SHEETS_EXPORT:n=((c=e.reportDefinition)==null?void 0:c.title)??"",r="report";break}return[pre(`${e.triggerType} ${r} run`.trim()),n].join(" • ")},Joe=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)},eie=e=>{const t=e.startedAt??e.createdAt;return Vg(t.toISOString())},tie=e=>{const t=_j(e.startedAt),n=_j(e.finishedAt);let r="";return e.startedAt&&e.finishedAt&&(r=bJ(e.startedAt,e.finishedAt)),{startedAt:t,finishedAt:n,duration:r}},_j=e=>e?Vg(e.toISOString()):"N/A";function nie({logViewType:e,setLogViewType:t,searchTerm:n,setSearchTerm:r,run:s,cancelDataMartRun:l,dataMartId:c}){const d=g=>{g.stopPropagation()},f=async g=>{if(g.stopPropagation(),c)try{await l(c,s.id),rn.success("Data mart run cancelled successfully")}catch(y){rn.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 o.jsxs("div",{className:"bg-background border-border flex items-center justify-between rounded-lg border p-3",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsxs("div",{className:"bg-background border-border flex items-center rounded-lg border",children:[o.jsx("button",{onClick:g=>{g.stopPropagation(),t(ss.STRUCTURED)},className:`${h(e===ss.STRUCTURED)} rounded-l-lg`,children:"Structured"}),o.jsx("button",{onClick:g=>{g.stopPropagation(),t(ss.RAW)},className:`${h(e===ss.RAW)} rounded-none`,children:"Raw"}),o.jsx("button",{onClick:g=>{g.stopPropagation(),t(ss.CONFIGURATION)},className:`${h(e===ss.CONFIGURATION)} rounded-r-lg`,children:"Configuration"})]}),e!==ss.CONFIGURATION&&o.jsxs("div",{className:"relative",children:[o.jsx($l,{className:"text-muted-foreground absolute top-2.5 left-2 h-4 w-4"}),o.jsx(zt,{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"})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[s.status===ar.RUNNING&&o.jsxs(Se,{variant:"destructive",size:"sm",onClick:g=>void f(g),children:[o.jsx(cu,{className:"h-4 w-4"}),"Cancel"]}),o.jsxs(Se,{variant:"outline",size:"sm",onClick:g=>{g.stopPropagation(),Joe(s)},className:"flex items-center gap-2",children:[o.jsx(q9,{className:"h-4 w-4"}),"JSON"]})]})]})}function rie(e){switch(e){case Fr.INFO:return o.jsx(zr,{className:"h-3 w-3 text-blue-500"});case Fr.WARNING:return o.jsx(Qp,{className:"h-3 w-3 text-yellow-500"});case Fr.ERROR:return o.jsx(sp,{className:"h-3 w-3 text-red-500"});case Fr.SYSTEM:return o.jsx(wf,{className:"text-muted-foreground h-3 w-3"});default:return o.jsx(zr,{className:"text-muted-foreground h-3 w-3"})}}function aie(e){switch(e){case Fr.INFO:return"text-blue-600 dark:text-blue-400";case Fr.WARNING:return"text-yellow-600 dark:text-yellow-400";case Fr.ERROR:return"text-red-600 dark:text-red-400";case Fr.SYSTEM:return"text-muted-foreground";default:return"text-muted-foreground"}}function sie(e){return e===j4.SCHEDULED?o.jsx(Mb,{size:18}):o.jsx(uL,{size:18})}function oie({logs:e}){const t=r=>{r.stopPropagation()},n=r=>{var s;return(s=r.metadata)!=null&&s.at?r.metadata.at:r.timestamp};return e.length===0?o.jsx("div",{className:"bg-background border-border rounded-lg border",children:o.jsx("div",{className:"text-muted-foreground p-8 text-center",children:"No logs found"})}):o.jsx("div",{className:"bg-background border-border rounded-lg border",children:o.jsx("div",{className:"max-h-96 overflow-y-auto",children:e.map((r,s)=>o.jsxs("div",{className:`border-border hover:bg-accent/30 flex items-start gap-3 border-b p-3 text-sm text-xs ${s===e.length-1?"border-b-0":""}`,onClick:t,children:[o.jsx("div",{className:"text-muted-foreground flex-shrink-0 font-mono text-xs",children:n(r)}),o.jsxs("div",{className:"flex min-w-0 flex-shrink-0 items-center gap-2",children:[rie(r.level),o.jsx("span",{className:`text-xs font-medium ${aie(r.level)}`,children:nM(r)})]}),o.jsx("div",{className:`min-w-0 flex-1 text-xs break-words ${r.level===Fr.ERROR?"text-red-700 dark:text-red-300":"text-foreground"}`,children:r.message.includes(`
|
|
716
|
-
`)?o.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap",children:r.message}):o.jsx("span",{children:r.message})})]},r.id))})})}var $p=(e=>(e.ERROR="error",e.DEFAULT="default",e))($p||{});function Hp({text:e,section:t,variant:n="default",copiedSection:r,onCopy:s,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 o.jsx("button",{onClick:g=>{s(e,t),g.stopPropagation()},className:`${f} ${h}`,title:`Copy ${t} to clipboard`,children:l?o.jsx(o.Fragment,{children:d?o.jsx(fr,{className:"h-3 w-3"}):o.jsx(sf,{className:"h-3 w-3"})}):d?o.jsxs(o.Fragment,{children:[o.jsx(fr,{className:"h-3 w-3"}),"Copied"]}):o.jsxs(o.Fragment,{children:[o.jsx(sf,{className:"h-3 w-3"}),"Copy"]})})}function kS(){const[e,t]=p.useState(null),n=async(s,l)=>{try{await navigator.clipboard.writeText(s),t(l),setTimeout(()=>{t(null)},2e3)}catch(c){console.error("Failed to copy text: ",c)}};return{copiedSection:e,copyToClipboard:n,handleCopy:(s,l)=>{n(s,l)}}}function iie({logs:e,errors:t}){const{copiedSection:n,handleCopy:r}=kS(),s=l=>{l.stopPropagation()};return o.jsxs("div",{className:"border-border space-y-4 rounded-lg border p-4",onClick:s,children:[t.length>0&&o.jsxs("div",{children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[o.jsxs("h4",{className:"flex items-center gap-2 text-sm font-medium text-red-600 dark:text-red-400",children:[o.jsx(wf,{className:"h-4 w-4 text-red-500"}),"Error Output:"]}),o.jsx(Hp,{text:t.join(`
|
|
717
|
-
`),section:"errors",variant:$p.ERROR,copiedSection:n,onCopy:r})]}),o.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)=>o.jsx("div",{className:"mb-1 leading-relaxed text-red-700 dark:text-red-300",children:l},c))})]}),e.length>0&&o.jsxs("div",{children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[o.jsxs("h4",{className:"text-foreground flex items-center gap-2 text-sm font-medium",children:[o.jsx(zr,{className:"h-4 w-4 text-blue-500"}),"Standard Output:"]}),o.jsx(Hp,{text:e.join(`
|
|
718
|
-
`),section:"logs",variant:$p.DEFAULT,copiedSection:n,onCopy:r})]}),o.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)=>o.jsx("div",{className:"mb-1 leading-relaxed",children:l},c))})]})]})}function lie({definitionRun:e,reportDefinition:t}){const{copiedSection:n,handleCopy:r}=kS(),s=l=>{l.stopPropagation()};return o.jsx("div",{className:"border-border rounded-lg border",onClick:s,children:e!=null?o.jsxs("div",{className:"p-4",children:[o.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[o.jsx("h4",{className:"text-foreground text-sm font-medium",children:"Configuration:"}),o.jsx(Hp,{text:JSON.stringify(e,null,2),section:"configuration",variant:$p.DEFAULT,copiedSection:n,onCopy:r})]}),o.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&&o.jsxs(o.Fragment,{children:[o.jsx("h4",{className:"text-foreground mt-3 mb-3 text-sm font-medium",children:"Report definition:"}),o.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)})]})]}):o.jsx("div",{className:"text-muted-foreground p-8 text-center",children:"No configuration data available for this run"})})}const $d=18;function cie({type:e,base64Icon:t}){switch(e){case Cl.CONNECTOR:return t?o.jsx(_u,{base64:t,size:$d}):o.jsx(lu,{size:$d});case Cl.GOOGLE_SHEETS_EXPORT:{const n=Ll.getInfo(Dt.GOOGLE_SHEETS).icon;return o.jsx(n,{size:$d})}case Cl.LOOKER_STUDIO:{const n=Ll.getInfo(Dt.LOOKER_STUDIO).icon;return o.jsx(n,{size:$d})}default:return o.jsx(lu,{size:$d})}}function uie({run:e,isExpanded:t,onToggle:n,logViewType:r,setLogViewType:s,searchTerm:l,setSearchTerm:c,cancelDataMartRun:d,dataMartId:f,dataMartConnectorInfo:h}){const{copiedSection:g,handleCopy:y}=kS(),v=p.useMemo(()=>{if(e.logs.length===0&&e.errors.length===0)return[];const S=e.logs.map((_,D)=>jj(_,D)),R=e.errors.map((_,D)=>jj(_,e.logs.length+D,!0));return[...S,...R].filter(_=>{const D=nM(_);return l===""||_.message.toLowerCase().includes(l.toLowerCase())||D.toLowerCase().includes(l.toLowerCase())})},[e.logs,e.errors,l]),b=p.useCallback(()=>r===ss.STRUCTURED?o.jsx(oie,{logs:v}):r===ss.RAW?o.jsx(iie,{logs:e.logs,errors:e.errors}):o.jsx(lie,{definitionRun:e.definitionRun,reportDefinition:e.reportDefinition}),[r,v,e.logs,e.errors,e.definitionRun,e.reportDefinition]),w=eie(e),E=tie(e);return o.jsxs("div",{className:"dm-card-block",children:[o.jsxs("div",{className:"flex cursor-pointer items-center justify-between",onClick:()=>{n(e.id)},children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{children:o.jsx(cie,{type:e.type,base64Icon:h==null?void 0:h.logoBase64})}),o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx("div",{className:"text-foreground align-center flex items-center font-mono text-sm font-medium",children:w})}),o.jsx(Et,{children:o.jsxs("div",{className:"space-y-1",children:[o.jsxs("div",{children:["Started At: ",E.startedAt]}),o.jsxs("div",{children:["Finished At: ",E.finishedAt]}),E.duration&&o.jsxs("div",{children:["Duration: ",E.duration]})]})})]}),o.jsxs("div",{className:"text-muted-foreground ml-6 flex items-center gap-1 text-sm",children:[sie(e.triggerType),Xoe(e,h==null?void 0:h.displayName)]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Qoe,{status:e.status}),o.jsx(ja,{className:`text-muted-foreground h-4 w-4 transition-transform ${t?"rotate-90":""}`})]})]}),t&&o.jsxs("div",{className:"border-border bg-muted/30 space-y-4 border-t p-4",children:[o.jsxs("div",{className:"flex items-center",children:[o.jsxs("h3",{className:"text-foreground mr-2 font-medium",children:["Run ID: ",e.id]}),o.jsx(Hp,{text:e.id,section:"run-id",onCopy:y,copiedSection:g,iconOnly:!0})]}),o.jsx(nie,{logViewType:r,setLogViewType:s,searchTerm:l,setSearchTerm:c,run:e,cancelDataMartRun:d,dataMartId:f}),b()]})]})}function die(){const{dataMart:t,getDataMartRuns:n,loadMoreDataMartRuns:r,cancelDataMartRun:s,runs:l=[],isLoading:c}=Wa(),[d,f]=p.useState(!1),[h,g]=p.useState(!0),[y,v]=p.useState(0),[b,w]=p.useState(null),[E,S]=p.useState(ss.STRUCTURED),[R,T]=p.useState(""),_=p.useCallback(async()=>{if(!(t!=null&&t.id))return;const j=await n(t.id,20,0);v(j.length),g(j.length===20)},[t==null?void 0:t.id,n,20]),D=p.useCallback(async()=>{if(!(t!=null&&t.id)||d)return;f(!0);const j=await r(t.id,y,20);v(M=>M+j.length),g(j.length===20),f(!1)},[t==null?void 0:t.id,r,y,d,20]);p.useEffect(()=>{t!=null&&t.id&&_()},[t==null?void 0:t.id,_]);const A=p.useMemo(()=>(t==null?void 0:t.definitionType)===Ue.CONNECTOR&&t.definition&&"connector"in t.definition?t.definition.connector.info??null:null,[t]),O=j=>{w(b===j?null:j)};return c?o.jsx(eM,{}):o.jsx("div",{className:"flex flex-col gap-4 pb-4",children:l.length===0?o.jsx("div",{className:"text-muted-foreground py-8 text-center",children:"No runs found for this Data Mart"}):o.jsxs("div",{className:"space-y-2",children:[l.map(j=>o.jsx(uie,{run:j,isExpanded:b===j.id,onToggle:O,logViewType:E,setLogViewType:S,searchTerm:R,setSearchTerm:T,cancelDataMartRun:s,dataMartId:t==null?void 0:t.id,dataMartConnectorInfo:A},j.id)),h&&o.jsx("div",{className:"flex justify-center pt-4",children:o.jsx(au,{variant:"outline",size:"sm",onClick:()=>void D(),disabled:d,className:"flex items-center gap-2",children:d?o.jsxs(o.Fragment,{children:[o.jsx(VL,{className:"h-4 w-4 animate-spin"}),"Loading..."]}):"Load More"})})]})})}const fie=5e3,hie=20;function mie(){const{dataMart:e,getDataMartRuns:t}=Fo(),n=p.useMemo(()=>e!=null&&e.id?`data-mart-run-history-auto-refresh-${e.id}`:"",[e==null?void 0:e.id]),[r,s]=p.useState(()=>n?ks.get(n,"boolean")??!1:!1);return p.useEffect(()=>{n&&ks.set(n,r)},[r,n]),J5({enabled:!!(e!=null&&e.id)&&r,intervalMs:fie,onTick:()=>{e!=null&&e.id&&t(e.id,hie,0,{silent:!0})}}),o.jsx("div",{className:"flex flex-col gap-4",children:o.jsxs(jl,{collapsible:!1,name:"run-history",children:[o.jsxs(Ao,{children:[o.jsx(No,{icon:fL,tooltip:"View all Data Mart execution runs with detailed logs and errors",children:"Run History"}),o.jsx(nh,{children:o.jsxs("div",{className:"flex items-center gap-2 pl-3",children:[o.jsx(Z5,{id:`run-history-auto-refresh-${(e==null?void 0:e.id)??"unknown"}`,checked:r,onCheckedChange:l=>{s(!!l)},"aria-label":"Auto refresh"}),o.jsx("label",{htmlFor:`run-history-auto-refresh-${(e==null?void 0:e.id)??"unknown"}`,className:"text-sm",children:"Auto refresh"})]})})]}),o.jsx(Do,{children:o.jsx(die,{})})]})})}const pie=[{path:"overview",element:o.jsx(Tj,{})},{path:"data-setup",element:o.jsx(zse,{})},{path:"reports",element:o.jsx(Coe,{})},{path:"triggers",element:o.jsx(Eoe,{})},{path:"run-history",element:o.jsx(mie,{})},{index:!0,element:o.jsx(Tj,{})}];function gie({to:e="/data-marts"}){const{user:t,status:n}=Vi();if(n===Or.LOADING)return o.jsx(tu,{fullScreen:!0,message:"Loading..."});if(n===Or.UNAUTHENTICATED||!t)return o.jsx(tu,{fullScreen:!0,message:"Authentication..."});if(t.projectId){const r=gp(t.projectId,e);return o.jsx(f8,{to:r,replace:!0})}return o.jsx(tu,{fullScreen:!0,message:"Project not found"})}const yie=[{index:!0,path:"/",element:o.jsx(gie,{})},{path:"/ui/:projectId",element:o.jsx(Jq,{}),children:[{path:"about",element:o.jsx(eZ,{})},{index:!0,element:o.jsx(_T,{})},{path:"data-marts",element:o.jsx(_T,{})},{path:"data-marts/create",element:o.jsx(woe,{})},{path:"data-marts/:id",element:o.jsx(Mse,{}),children:pie},{path:"data-storages",element:o.jsx(Doe,{})},{path:"data-destinations",element:o.jsx(Woe,{})},{path:"*",element:o.jsx(CT,{})}]},{path:"*",element:o.jsx(CT,{})}],rM="gtm-script",aM="gtm-noscript",vie="GOOGLE_TAG_MANAGER_CONTAINER_ID";function xie(){return!!document.getElementById(rM)}function bie(e){const t=document.createElement("script");return t.id=rM,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 Sie(e){const t=document.createElement("noscript");return t.id=aM,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 Cie(e){if(xie())return;const t=bie(e);document.head.prepend(t)}function Eie(e){if(document.getElementById(aM))return;const t=Sie(e);document.body.firstChild?document.body.insertBefore(t,document.body.firstChild):document.body.appendChild(t)}function wie(e){try{Cie(e),Eie(e)}catch(t){console.warn("Failed to initialize Google Tag Manager:",t)}}function Rie(e){return(e[vie]??"").trim()}function Tie(){const{flags:e,callState:t}=c1();return p.useEffect(()=>{if(t!==Mr.LOADED||!e)return;const n=Rie(e);n&&wie(n)},[e,t]),null}const jie="INTERCOM_APP_ID",sM="intercom-widget-script";function _ie(){return!!document.getElementById(sM)}function Nie(e,t){if(_ie()){t();return}const n=document.createElement("script");n.id=sM,n.src=`https://widget.intercom.io/widget/${e}`,n.async=!0,n.onload=()=>{t()},document.head.appendChild(n)}async function Aie(){try{return(await ga.post("/intercom/jwt")).data.token}catch(e){return console.warn("Failed to fetch Intercom JWT",e),null}}function Die(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 Oie(e,t){if(!t)return;const n=Die(e,t),r=await Aie();if(r){n.intercom_user_jwt=r;try{window.Intercom&&window.Intercom("boot",n)}catch(s){console.warn("Failed to boot Intercom",s)}}}function Mie(){const{flags:e,callState:t}=c1(),{user:n}=Vi(),r=p.useRef(!1);return p.useEffect(()=>{if(r.current||t!==Mr.LOADED||!e)return;const s=e[jie],l=(typeof s=="string"?s:"").trim();l&&Nie(l,()=>{Oie(l,n).then(()=>{r.current=!0,cb()})})},[e,t,n]),null}function Iie({initialState:e,reducer:t,children:n}){const[r,s]=p.useReducer(t,e),l=p.useMemo(()=>s,[s]);return o.jsx(jA.Provider,{value:r,children:o.jsx(_A.Provider,{value:l,children:n})})}function kie(e){return(t,n)=>{const r={...t};return Object.keys(e).forEach(s=>{const l=e[s],c=t[s],d=l(c,n);d!==c&&(r[s]=d)}),r}}const Nj={id:null,title:null},oM="project/SET_PROJECT",Lie="project/CLEAR_PROJECT";function Pie(e){return{type:oM,payload:e}}function Uie(e=Nj,t){switch(t.type){case oM:{const{id:n,title:r}=t.payload;return{id:n,title:r??null}}case Lie:return{...Nj};default:return e}}class Fie extends Zl{getFlags(){return this.get("/flags")}}const zie=new Fie(""),iM={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"},Vie={data:{...iM},callState:Mr.IDLE},lM="settings/LOAD_FLAGS",cM="settings/LOAD_FLAGS_SUCCESS",uM="settings/LOAD_FLAGS_ERROR";function $ie(){return{type:lM}}function Hie(e){return{type:cM,payload:e}}function Bie(e){return{type:uM,payload:e}}function Gie(e=Vie,t){switch(t.type){case lM:return{...e,callState:Mr.LOADING,error:void 0};case cM:return{...e,callState:Mr.LOADED,data:{...iM,...t.payload}};case uM:return{...e,callState:Mr.ERROR,error:t.payload};default:return e}}async function qie(e){try{e($ie());const t=await zie.getFlags();e(Hie(t))}catch(t){const n=t instanceof Error?t.message:"Failed to load settings";e(Bie(n))}}const dM="app/SET_READY";function Zie(e={ready:!1},t){switch(t.type){case dM:return{...e,ready:!!t.payload};default:return e}}const Kie=kie({project:Uie,flags:Gie,app:Zie});function Yie({children:e}){return o.jsx(Iie,{reducer:Kie,initialState:{project:{id:null,title:null},flags:{data:null,callState:Mr.IDLE},app:{ready:!1}},children:e})}function Wie({children:e}){const t=k$(),{user:n,status:r}=Vi(),s=mp(f=>f.flags),l=s.callState,c=mp(f=>f.app.ready);p.useEffect(()=>{r===Or.AUTHENTICATED&&(n!=null&&n.projectId)&&(t(Pie({id:n.projectId,title:n.projectTitle??null})),l===Mr.IDLE&&qie(t))},[r,n==null?void 0:n.projectId,n==null?void 0:n.projectTitle,l,t]),p.useEffect(()=>{const f=r===Or.AUTHENTICATED&&!!(n!=null&&n.projectId)&&l===Mr.LOADED;t({type:dM,payload:f})},[r,n==null?void 0:n.projectId,l,t]);const d=p.useMemo(()=>o.jsx(tu,{fullScreen:!0,message:"Loading application..."}),[]);return c?o.jsx(o.Fragment,{children:e}):l===Mr.ERROR?o.jsx(tu,{fullScreen:!0,message:`Failed to load app flags: ${s.error??""}`}):d}function Qie(){const e=P8(yie);return o.jsx(jB,{children:o.jsx(Yie,{children:o.jsxs(Wie,{children:[o.jsx(Tie,{}),o.jsx(Mie,{}),o.jsx(W8,{router:e})]})})})}const fM=document.getElementById("root");if(!fM)throw new Error("Root element not found");DI.createRoot(fM).render(o.jsx(p.StrictMode,{children:o.jsx(Qie,{})}));
|